From d6b0fc599f628c5f5d95de9e34331d3a450c5e49 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 29 Feb 2024 12:32:20 -0800 Subject: [PATCH 001/438] support cw3 multisig import --- packages/i18n/locales/en/translation.json | 6 +- packages/state/contracts/Cw3FixedMultisig.ts | 371 ++++++++++++++++ packages/state/contracts/Cw3FlexMultisig.ts | 414 ++++++++++++++++++ packages/state/contracts/index.ts | 8 + packages/state/recoil/selectors/account.ts | 139 +++++- .../selectors/contracts/Cw3FixedMultisig.ts | 146 ++++++ .../selectors/contracts/Cw3FlexMultisig.ts | 203 +++++++++ .../state/recoil/selectors/contracts/index.ts | 2 + .../components/dao/ImportMultisigModal.tsx | 4 +- .../common/components/NewProposal.tsx | 2 +- .../DaoProposalSingle/common/hooks/index.ts | 1 - .../hooks/useLoadingVotesInfo.ts | 2 +- .../hooks/useProposalDaoInfoCards.tsx | 3 +- .../dao/create/ImportMultisigModal.tsx | 57 ++- .../dao/create/pages/CreateDaoStart.tsx | 162 +++++-- packages/stateless/hooks/index.ts | 1 + .../hooks/useProcessTQ.ts | 0 packages/types/account.ts | 20 +- .../types/components/ImportMultisigModal.ts | 6 +- packages/types/contracts/Cw3FixedMultisig.ts | 267 +++++++++++ packages/types/contracts/Cw3FlexMultisig.ts | 304 +++++++++++++ packages/utils/constants/contracts.ts | 2 + 22 files changed, 2043 insertions(+), 77 deletions(-) create mode 100644 packages/state/contracts/Cw3FixedMultisig.ts create mode 100644 packages/state/contracts/Cw3FlexMultisig.ts create mode 100644 packages/state/recoil/selectors/contracts/Cw3FixedMultisig.ts create mode 100644 packages/state/recoil/selectors/contracts/Cw3FlexMultisig.ts rename packages/{stateful/proposal-module-adapter/adapters/DaoProposalSingle/common => stateless}/hooks/useProcessTQ.ts (100%) create mode 100644 packages/types/contracts/Cw3FixedMultisig.ts create mode 100644 packages/types/contracts/Cw3FlexMultisig.ts diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 0032628d4..e7a95a4ca 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -60,6 +60,7 @@ "addVestingManagerSetupAction": "Add vesting manager setup action", "addVetoer": "Add vetoer", "addedRegisterAction": "Added register action", + "apolloSafe": "Apollo Safe", "approve": "Approve", "begin": "Begin", "burn": "Burn", @@ -109,6 +110,7 @@ "createNftCollection": "Create NFT collection", "createSubDao": "Create SubDAO", "cryptographicMultisig": "Cryptographic Multisig", + "cw3Multisig": "CW3 Multisig", "delete": "Delete", "deleteDraft": "Delete draft", "deposit": "Deposit", @@ -988,7 +990,7 @@ "icaExecuteDescription": "Execute an action from an ICA account on another chain.", "icaExperimental": "ICA is experimental and not properly supported by many chains. Only use this if you know what you are doing.", "icaHostSupported": "ICA is supported on this chain. Use at your own risk.", - "importCryptographicMultisigDescription": "Easily configure a DAO with the members and voting threshold of a cryptographic multisig by importing it from any Cosmos chain below.", + "importMultisigDescription": "Easily configure a DAO with the members and voting threshold of a multisig by importing it from any Cosmos chain below.", "inactiveDaoTooltip": "This DAO has no proposals and may be inactive or a duplicate.", "inactiveDaosTooltip": "These DAOs have no proposals and may be inactive or duplicates.", "inboxConfigPreferencesDescription": "Choose where you want to receive notifications. Website notifications appear here on the Inbox page.", @@ -1576,8 +1578,8 @@ "ibcTransferPath": "IBC Transfer Path", "icaExecute": "ICA Execute", "identity": "Identity", - "importCryptographicMultisig": "Import Cryptographic Multisig", "importFrom": "Import from...", + "importMultisig": "Import Multisig", "inactiveDaos": "Inactive DAOs", "initialTokenDistribution": "Initial Token Distribution", "instantiatePredictableSmartContract": "Instantiate Predictable Smart Contract", diff --git a/packages/state/contracts/Cw3FixedMultisig.ts b/packages/state/contracts/Cw3FixedMultisig.ts new file mode 100644 index 000000000..f0bdf558a --- /dev/null +++ b/packages/state/contracts/Cw3FixedMultisig.ts @@ -0,0 +1,371 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import { StdFee } from '@cosmjs/amino' +import { + CosmWasmClient, + ExecuteResult, + SigningCosmWasmClient, +} from '@cosmjs/cosmwasm-stargate' + +import { + Coin, + CosmosMsgForEmpty, + Expiration, + ProposalListResponseForEmpty, + ProposalResponseForEmpty, + ThresholdResponse, + Vote, + VoteListResponse, + VoteResponse, + VoterListResponse, + VoterResponse, +} from '@dao-dao/types/contracts/Cw3FixedMultisig' + +export interface Cw3FixedMultisigReadOnlyInterface { + contractAddress: string + threshold: () => Promise + proposal: ({ + proposalId, + }: { + proposalId: number + }) => Promise + listProposals: ({ + limit, + startAfter, + }: { + limit?: number + startAfter?: number + }) => Promise + reverseProposals: ({ + limit, + startBefore, + }: { + limit?: number + startBefore?: number + }) => Promise + getVote: ({ + proposalId, + voter, + }: { + proposalId: number + voter: string + }) => Promise + listVotes: ({ + limit, + proposalId, + startAfter, + }: { + limit?: number + proposalId: number + startAfter?: string + }) => Promise + voter: ({ address }: { address: string }) => Promise + listVoters: ({ + limit, + startAfter, + }: { + limit?: number + startAfter?: string + }) => Promise +} +export class Cw3FixedMultisigQueryClient + implements Cw3FixedMultisigReadOnlyInterface +{ + client: CosmWasmClient + contractAddress: string + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client + this.contractAddress = contractAddress + this.threshold = this.threshold.bind(this) + this.proposal = this.proposal.bind(this) + this.listProposals = this.listProposals.bind(this) + this.reverseProposals = this.reverseProposals.bind(this) + this.getVote = this.getVote.bind(this) + this.listVotes = this.listVotes.bind(this) + this.voter = this.voter.bind(this) + this.listVoters = this.listVoters.bind(this) + } + + threshold = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + threshold: {}, + }) + } + proposal = async ({ + proposalId, + }: { + proposalId: number + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + proposal: { + proposal_id: proposalId, + }, + }) + } + listProposals = async ({ + limit, + startAfter, + }: { + limit?: number + startAfter?: number + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + list_proposals: { + limit, + start_after: startAfter, + }, + }) + } + reverseProposals = async ({ + limit, + startBefore, + }: { + limit?: number + startBefore?: number + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + reverse_proposals: { + limit, + start_before: startBefore, + }, + }) + } + getVote = async ({ + proposalId, + voter, + }: { + proposalId: number + voter: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + vote: { + proposal_id: proposalId, + voter, + }, + }) + } + listVotes = async ({ + limit, + proposalId, + startAfter, + }: { + limit?: number + proposalId: number + startAfter?: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + list_votes: { + limit, + proposal_id: proposalId, + start_after: startAfter, + }, + }) + } + voter = async ({ address }: { address: string }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + voter: { + address, + }, + }) + } + listVoters = async ({ + limit, + startAfter, + }: { + limit?: number + startAfter?: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + list_voters: { + limit, + start_after: startAfter, + }, + }) + } +} +export interface Cw3FixedMultisigInterface + extends Cw3FixedMultisigReadOnlyInterface { + contractAddress: string + sender: string + propose: ( + { + description, + latest, + msgs, + title, + }: { + description: string + latest?: Expiration + msgs: CosmosMsgForEmpty[] + title: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + vote: ( + { + proposalId, + vote, + }: { + proposalId: number + vote: Vote + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + execute: ( + { + proposalId, + }: { + proposalId: number + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + close: ( + { + proposalId, + }: { + proposalId: number + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise +} +export class Cw3FixedMultisigClient + extends Cw3FixedMultisigQueryClient + implements Cw3FixedMultisigInterface +{ + client: SigningCosmWasmClient + sender: string + contractAddress: string + + constructor( + client: SigningCosmWasmClient, + sender: string, + contractAddress: string + ) { + super(client, contractAddress) + this.client = client + this.sender = sender + this.contractAddress = contractAddress + this.propose = this.propose.bind(this) + this.vote = this.vote.bind(this) + this.execute = this.execute.bind(this) + this.close = this.close.bind(this) + } + + propose = async ( + { + description, + latest, + msgs, + title, + }: { + description: string + latest?: Expiration + msgs: CosmosMsgForEmpty[] + title: string + }, + fee: number | StdFee | 'auto' = 'auto', + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + propose: { + description, + latest, + msgs, + title, + }, + }, + fee, + memo, + _funds + ) + } + vote = async ( + { + proposalId, + vote, + }: { + proposalId: number + vote: Vote + }, + fee: number | StdFee | 'auto' = 'auto', + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + vote: { + proposal_id: proposalId, + vote, + }, + }, + fee, + memo, + _funds + ) + } + execute = async ( + { + proposalId, + }: { + proposalId: number + }, + fee: number | StdFee | 'auto' = 'auto', + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + execute: { + proposal_id: proposalId, + }, + }, + fee, + memo, + _funds + ) + } + close = async ( + { + proposalId, + }: { + proposalId: number + }, + fee: number | StdFee | 'auto' = 'auto', + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + close: { + proposal_id: proposalId, + }, + }, + fee, + memo, + _funds + ) + } +} diff --git a/packages/state/contracts/Cw3FlexMultisig.ts b/packages/state/contracts/Cw3FlexMultisig.ts new file mode 100644 index 000000000..5a8cc5c78 --- /dev/null +++ b/packages/state/contracts/Cw3FlexMultisig.ts @@ -0,0 +1,414 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import { StdFee } from '@cosmjs/amino' +import { + CosmWasmClient, + ExecuteResult, + SigningCosmWasmClient, +} from '@cosmjs/cosmwasm-stargate' + +import { + Coin, + Config, + CosmosMsgForEmpty, + Expiration, + MemberDiff, + ProposalListResponseForEmpty, + ProposalResponseForEmpty, + ThresholdResponse, + Vote, + VoteListResponse, + VoteResponse, + VoterListResponse, + VoterResponse, +} from '@dao-dao/types/contracts/Cw3FlexMultisig' + +export interface Cw3FlexMultisigReadOnlyInterface { + contractAddress: string + threshold: () => Promise + proposal: ({ + proposalId, + }: { + proposalId: number + }) => Promise + listProposals: ({ + limit, + startAfter, + }: { + limit?: number + startAfter?: number + }) => Promise + reverseProposals: ({ + limit, + startBefore, + }: { + limit?: number + startBefore?: number + }) => Promise + getVote: ({ + proposalId, + voter, + }: { + proposalId: number + voter: string + }) => Promise + listVotes: ({ + limit, + proposalId, + startAfter, + }: { + limit?: number + proposalId: number + startAfter?: string + }) => Promise + voter: ({ address }: { address: string }) => Promise + listVoters: ({ + limit, + startAfter, + }: { + limit?: number + startAfter?: string + }) => Promise + config: () => Promise +} +export class Cw3FlexMultisigQueryClient + implements Cw3FlexMultisigReadOnlyInterface +{ + client: CosmWasmClient + contractAddress: string + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client + this.contractAddress = contractAddress + this.threshold = this.threshold.bind(this) + this.proposal = this.proposal.bind(this) + this.listProposals = this.listProposals.bind(this) + this.reverseProposals = this.reverseProposals.bind(this) + this.getVote = this.getVote.bind(this) + this.listVotes = this.listVotes.bind(this) + this.voter = this.voter.bind(this) + this.listVoters = this.listVoters.bind(this) + this.config = this.config.bind(this) + } + + threshold = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + threshold: {}, + }) + } + proposal = async ({ + proposalId, + }: { + proposalId: number + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + proposal: { + proposal_id: proposalId, + }, + }) + } + listProposals = async ({ + limit, + startAfter, + }: { + limit?: number + startAfter?: number + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + list_proposals: { + limit, + start_after: startAfter, + }, + }) + } + reverseProposals = async ({ + limit, + startBefore, + }: { + limit?: number + startBefore?: number + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + reverse_proposals: { + limit, + start_before: startBefore, + }, + }) + } + getVote = async ({ + proposalId, + voter, + }: { + proposalId: number + voter: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + vote: { + proposal_id: proposalId, + voter, + }, + }) + } + listVotes = async ({ + limit, + proposalId, + startAfter, + }: { + limit?: number + proposalId: number + startAfter?: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + list_votes: { + limit, + proposal_id: proposalId, + start_after: startAfter, + }, + }) + } + voter = async ({ address }: { address: string }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + voter: { + address, + }, + }) + } + listVoters = async ({ + limit, + startAfter, + }: { + limit?: number + startAfter?: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + list_voters: { + limit, + start_after: startAfter, + }, + }) + } + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {}, + }) + } +} +export interface Cw3FlexMultisigInterface + extends Cw3FlexMultisigReadOnlyInterface { + contractAddress: string + sender: string + propose: ( + { + description, + latest, + msgs, + title, + }: { + description: string + latest?: Expiration + msgs: CosmosMsgForEmpty[] + title: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + vote: ( + { + proposalId, + vote, + }: { + proposalId: number + vote: Vote + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + execute: ( + { + proposalId, + }: { + proposalId: number + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + close: ( + { + proposalId, + }: { + proposalId: number + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + memberChangedHook: ( + { + diffs, + }: { + diffs: MemberDiff[] + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise +} +export class Cw3FlexMultisigClient + extends Cw3FlexMultisigQueryClient + implements Cw3FlexMultisigInterface +{ + client: SigningCosmWasmClient + sender: string + contractAddress: string + + constructor( + client: SigningCosmWasmClient, + sender: string, + contractAddress: string + ) { + super(client, contractAddress) + this.client = client + this.sender = sender + this.contractAddress = contractAddress + this.propose = this.propose.bind(this) + this.vote = this.vote.bind(this) + this.execute = this.execute.bind(this) + this.close = this.close.bind(this) + this.memberChangedHook = this.memberChangedHook.bind(this) + } + + propose = async ( + { + description, + latest, + msgs, + title, + }: { + description: string + latest?: Expiration + msgs: CosmosMsgForEmpty[] + title: string + }, + fee: number | StdFee | 'auto' = 'auto', + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + propose: { + description, + latest, + msgs, + title, + }, + }, + fee, + memo, + _funds + ) + } + vote = async ( + { + proposalId, + vote, + }: { + proposalId: number + vote: Vote + }, + fee: number | StdFee | 'auto' = 'auto', + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + vote: { + proposal_id: proposalId, + vote, + }, + }, + fee, + memo, + _funds + ) + } + execute = async ( + { + proposalId, + }: { + proposalId: number + }, + fee: number | StdFee | 'auto' = 'auto', + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + execute: { + proposal_id: proposalId, + }, + }, + fee, + memo, + _funds + ) + } + close = async ( + { + proposalId, + }: { + proposalId: number + }, + fee: number | StdFee | 'auto' = 'auto', + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + close: { + proposal_id: proposalId, + }, + }, + fee, + memo, + _funds + ) + } + memberChangedHook = async ( + { + diffs, + }: { + diffs: MemberDiff[] + }, + fee: number | StdFee | 'auto' = 'auto', + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + member_changed_hook: { + diffs, + }, + }, + fee, + memo, + _funds + ) + } +} diff --git a/packages/state/contracts/index.ts b/packages/state/contracts/index.ts index e24531682..b65183560 100644 --- a/packages/state/contracts/index.ts +++ b/packages/state/contracts/index.ts @@ -1,4 +1,12 @@ export { Cw1WhitelistClient, Cw1WhitelistQueryClient } from './Cw1Whitelist' +export { + Cw3FixedMultisigClient, + Cw3FixedMultisigQueryClient, +} from './Cw3FixedMultisig' +export { + Cw3FlexMultisigClient, + Cw3FlexMultisigQueryClient, +} from './Cw3FlexMultisig' export { Cw4GroupClient, Cw4GroupQueryClient } from './Cw4Group' export { Cw20BaseClient, Cw20BaseQueryClient } from './Cw20Base' export { Cw20StakeClient, Cw20StakeQueryClient } from './Cw20Stake' diff --git a/packages/state/recoil/selectors/account.ts b/packages/state/recoil/selectors/account.ts index c4bbefaf3..b99a032b9 100644 --- a/packages/state/recoil/selectors/account.ts +++ b/packages/state/recoil/selectors/account.ts @@ -9,14 +9,16 @@ import { import { Account, AccountType, - CryptographicMultisigDetails, GenericToken, GenericTokenBalanceWithOwner, IcaAccount, + MultisigDetails as MultisigDetails, TokenType, WithChainId, } from '@dao-dao/types' +import { Threshold } from '@dao-dao/types/contracts/DaoProposalSingle.common' import { + ContractName, ICA_CHAINS_TX_PREFIX, POLYTONE_CONFIG_PER_CHAIN, getChainForChainId, @@ -28,8 +30,16 @@ import { LegacyAminoPubKey } from '@dao-dao/utils/protobuf/codegen/cosmos/crypto import { PubKey } from '@dao-dao/utils/protobuf/codegen/cosmos/crypto/secp256k1/keys' import { cosmosRpcClientForChainSelector } from './chain' -import { isDaoSelector, isPolytoneProxySelector } from './contract' -import { DaoCoreV2Selectors, PolytoneProxySelectors } from './contracts' +import { + isContractSelector, + isDaoSelector, + isPolytoneProxySelector, +} from './contract' +import { + Cw3FlexMultisigSelectors, + DaoCoreV2Selectors, + PolytoneProxySelectors, +} from './contracts' import { icaRemoteAddressSelector } from './ica' import { genericTokenBalanceSelector, @@ -337,7 +347,7 @@ export const reverseLookupPolytoneProxySelector = selectorFamily< * Get the details of a cryptographic multisig account. */ export const cryptographicMultisigDetailsSelector = selectorFamily< - CryptographicMultisigDetails, + MultisigDetails, WithChainId<{ address: string }> >({ key: 'cryptographicMultisigDetails', @@ -379,8 +389,127 @@ export const cryptographicMultisigDetailsSelector = selectorFamily< return { chainId, address, - addresses, + members: addresses.map((address) => ({ + address, + weight: 1, + })), + threshold: { + absolute_count: { + threshold: BigInt(threshold).toString(), + }, + }, + totalWeight: addresses.length, + } + }, +}) + +/** + * Get the details of a cw3-fixed or cw3-flex multisig account. + */ +export const cw3MultisigDetailsSelector = selectorFamily< + MultisigDetails, + WithChainId<{ address: string }> +>({ + key: 'cw3MultisigDetails', + get: + ({ address, chainId }) => + async ({ get }) => { + const isCw3Multisig = get( + isContractSelector({ + chainId, + contractAddress: address, + names: [ContractName.Cw3FixedMultisig, ContractName.Cw3FlexMultisig], + }) + ) + + if (!isCw3Multisig) { + throw new Error('Not a multisig address.') + } + + const [_threshold, { voters }] = get( + waitForAll([ + Cw3FlexMultisigSelectors.thresholdSelector({ + chainId, + contractAddress: address, + params: [], + }), + Cw3FlexMultisigSelectors.listAllVotersSelector({ + chainId, + contractAddress: address, + }), + ]) + ) + + const threshold: Threshold | undefined = + 'absolute_count' in _threshold + ? { + absolute_count: { + threshold: BigInt(_threshold.absolute_count.weight).toString(), + }, + } + : 'absolute_percentage' in _threshold + ? { + absolute_percentage: { + percentage: { + percent: _threshold.absolute_percentage.percentage, + }, + }, + } + : 'threshold_quorum' in _threshold + ? { + threshold_quorum: { + quorum: { + percent: _threshold.threshold_quorum.quorum, + }, + threshold: { + percent: _threshold.threshold_quorum.threshold, + }, + }, + } + : undefined + + if (!threshold) { + throw new Error('Unsupported multisig.') + } + + return { + chainId, + address, + members: voters.map(({ addr, weight }) => ({ + address: addr, + weight, + })), threshold, + totalWeight: voters.reduce((acc, { weight }) => acc + weight, 0), + } + }, +}) + +/** + * Get the details of a cryptographic, cw3-fixed, or cw3-flex multisig account. + */ +export const multisigDetailsSelector = selectorFamily< + MultisigDetails, + WithChainId<{ address: string }> +>({ + key: 'multisigDetails', + get: + (params) => + async ({ get }) => { + const [cryptographicMultisig, cw3Multisig] = get( + waitForAllSettled([ + cryptographicMultisigDetailsSelector(params), + cw3MultisigDetailsSelector(params), + ]) + ) + + if (cryptographicMultisig.state === 'hasValue') { + return cryptographicMultisig.contents + } + if (cw3Multisig.state === 'hasValue') { + return cw3Multisig.contents } + + throw new Error('Not a multisig address.') }, }) diff --git a/packages/state/recoil/selectors/contracts/Cw3FixedMultisig.ts b/packages/state/recoil/selectors/contracts/Cw3FixedMultisig.ts new file mode 100644 index 000000000..4bf983b7f --- /dev/null +++ b/packages/state/recoil/selectors/contracts/Cw3FixedMultisig.ts @@ -0,0 +1,146 @@ +import { selectorFamily } from 'recoil' + +import { WithChainId } from '@dao-dao/types' +import { + ProposalListResponseForEmpty, + ProposalResponseForEmpty, + ThresholdResponse, + VoteListResponse, + VoteResponse, + VoterListResponse, + VoterResponse, +} from '@dao-dao/types/contracts/Cw3FixedMultisig' + +import { Cw3FixedMultisigQueryClient } from '../../../contracts/Cw3FixedMultisig' +import { cosmWasmClientForChainSelector } from '../chain' + +type QueryClientParams = WithChainId<{ + contractAddress: string +}> + +export const queryClient = selectorFamily< + Cw3FixedMultisigQueryClient, + QueryClientParams +>({ + key: 'cw3FixedMultisigQueryClient', + get: + ({ contractAddress, chainId }) => + ({ get }) => { + const client = get(cosmWasmClientForChainSelector(chainId)) + return new Cw3FixedMultisigQueryClient(client, contractAddress) + }, + dangerouslyAllowMutability: true, +}) + +export const thresholdSelector = selectorFamily< + ThresholdResponse, + QueryClientParams & { + params: Parameters + } +>({ + key: 'cw3FixedMultisigThreshold', + get: + ({ params, ...queryClientParams }) => + async ({ get }) => { + const client = get(queryClient(queryClientParams)) + return await client.threshold(...params) + }, +}) +export const proposalSelector = selectorFamily< + ProposalResponseForEmpty, + QueryClientParams & { + params: Parameters + } +>({ + key: 'cw3FixedMultisigProposal', + get: + ({ params, ...queryClientParams }) => + async ({ get }) => { + const client = get(queryClient(queryClientParams)) + return await client.proposal(...params) + }, +}) +export const listProposalsSelector = selectorFamily< + ProposalListResponseForEmpty, + QueryClientParams & { + params: Parameters + } +>({ + key: 'cw3FixedMultisigListProposals', + get: + ({ params, ...queryClientParams }) => + async ({ get }) => { + const client = get(queryClient(queryClientParams)) + return await client.listProposals(...params) + }, +}) +export const reverseProposalsSelector = selectorFamily< + ProposalListResponseForEmpty, + QueryClientParams & { + params: Parameters + } +>({ + key: 'cw3FixedMultisigReverseProposals', + get: + ({ params, ...queryClientParams }) => + async ({ get }) => { + const client = get(queryClient(queryClientParams)) + return await client.reverseProposals(...params) + }, +}) +export const getVoteSelector = selectorFamily< + VoteResponse, + QueryClientParams & { + params: Parameters + } +>({ + key: 'cw3FixedMultisigVote', + get: + ({ params, ...queryClientParams }) => + async ({ get }) => { + const client = get(queryClient(queryClientParams)) + return await client.getVote(...params) + }, +}) +export const listVotesSelector = selectorFamily< + VoteListResponse, + QueryClientParams & { + params: Parameters + } +>({ + key: 'cw3FixedMultisigListVotes', + get: + ({ params, ...queryClientParams }) => + async ({ get }) => { + const client = get(queryClient(queryClientParams)) + return await client.listVotes(...params) + }, +}) +export const voterSelector = selectorFamily< + VoterResponse, + QueryClientParams & { + params: Parameters + } +>({ + key: 'cw3FixedMultisigVoter', + get: + ({ params, ...queryClientParams }) => + async ({ get }) => { + const client = get(queryClient(queryClientParams)) + return await client.voter(...params) + }, +}) +export const listVotersSelector = selectorFamily< + VoterListResponse, + QueryClientParams & { + params: Parameters + } +>({ + key: 'cw3FixedMultisigListVoters', + get: + ({ params, ...queryClientParams }) => + async ({ get }) => { + const client = get(queryClient(queryClientParams)) + return await client.listVoters(...params) + }, +}) diff --git a/packages/state/recoil/selectors/contracts/Cw3FlexMultisig.ts b/packages/state/recoil/selectors/contracts/Cw3FlexMultisig.ts new file mode 100644 index 000000000..bf04404f0 --- /dev/null +++ b/packages/state/recoil/selectors/contracts/Cw3FlexMultisig.ts @@ -0,0 +1,203 @@ +import { selectorFamily } from 'recoil' + +import { WithChainId } from '@dao-dao/types' +import { + Config, + ProposalListResponseForEmpty, + ProposalResponseForEmpty, + ThresholdResponse, + VoteListResponse, + VoteResponse, + VoterListResponse, + VoterResponse, +} from '@dao-dao/types/contracts/Cw3FlexMultisig' + +import { Cw3FlexMultisigQueryClient } from '../../../contracts/Cw3FlexMultisig' +import { cosmWasmClientForChainSelector } from '../chain' + +type QueryClientParams = WithChainId<{ + contractAddress: string +}> + +export const queryClient = selectorFamily< + Cw3FlexMultisigQueryClient, + QueryClientParams +>({ + key: 'cw3FlexMultisigQueryClient', + get: + ({ contractAddress, chainId }) => + ({ get }) => { + const client = get(cosmWasmClientForChainSelector(chainId)) + return new Cw3FlexMultisigQueryClient(client, contractAddress) + }, + dangerouslyAllowMutability: true, +}) + +export const thresholdSelector = selectorFamily< + ThresholdResponse, + QueryClientParams & { + params: Parameters + } +>({ + key: 'cw3FlexMultisigThreshold', + get: + ({ params, ...queryClientParams }) => + async ({ get }) => { + const client = get(queryClient(queryClientParams)) + return await client.threshold(...params) + }, +}) +export const proposalSelector = selectorFamily< + ProposalResponseForEmpty, + QueryClientParams & { + params: Parameters + } +>({ + key: 'cw3FlexMultisigProposal', + get: + ({ params, ...queryClientParams }) => + async ({ get }) => { + const client = get(queryClient(queryClientParams)) + return await client.proposal(...params) + }, +}) +export const listProposalsSelector = selectorFamily< + ProposalListResponseForEmpty, + QueryClientParams & { + params: Parameters + } +>({ + key: 'cw3FlexMultisigListProposals', + get: + ({ params, ...queryClientParams }) => + async ({ get }) => { + const client = get(queryClient(queryClientParams)) + return await client.listProposals(...params) + }, +}) +export const reverseProposalsSelector = selectorFamily< + ProposalListResponseForEmpty, + QueryClientParams & { + params: Parameters + } +>({ + key: 'cw3FlexMultisigReverseProposals', + get: + ({ params, ...queryClientParams }) => + async ({ get }) => { + const client = get(queryClient(queryClientParams)) + return await client.reverseProposals(...params) + }, +}) +export const getVoteSelector = selectorFamily< + VoteResponse, + QueryClientParams & { + params: Parameters + } +>({ + key: 'cw3FlexMultisigVote', + get: + ({ params, ...queryClientParams }) => + async ({ get }) => { + const client = get(queryClient(queryClientParams)) + return await client.getVote(...params) + }, +}) +export const listVotesSelector = selectorFamily< + VoteListResponse, + QueryClientParams & { + params: Parameters + } +>({ + key: 'cw3FlexMultisigListVotes', + get: + ({ params, ...queryClientParams }) => + async ({ get }) => { + const client = get(queryClient(queryClientParams)) + return await client.listVotes(...params) + }, +}) +export const voterSelector = selectorFamily< + VoterResponse, + QueryClientParams & { + params: Parameters + } +>({ + key: 'cw3FlexMultisigVoter', + get: + ({ params, ...queryClientParams }) => + async ({ get }) => { + const client = get(queryClient(queryClientParams)) + return await client.voter(...params) + }, +}) +export const listVotersSelector = selectorFamily< + VoterListResponse, + QueryClientParams & { + params: Parameters + } +>({ + key: 'cw3FlexMultisigListVoters', + get: + ({ params, ...queryClientParams }) => + async ({ get }) => { + const client = get(queryClient(queryClientParams)) + return await client.listVoters(...params) + }, +}) +export const configSelector = selectorFamily< + Config, + QueryClientParams & { + params: Parameters + } +>({ + key: 'cw3FlexMultisigConfig', + get: + ({ params, ...queryClientParams }) => + async ({ get }) => { + const client = get(queryClient(queryClientParams)) + return await client.config(...params) + }, +}) + +// Custom + +const LIST_VOTERS_LIMIT = 30 +export const listAllVotersSelector = selectorFamily< + VoterListResponse, + QueryClientParams +>({ + key: 'cw3FlexMultisigListAllVoters', + get: + (queryClientParams) => + async ({ get }) => { + const voters: VoterListResponse['voters'] = [] + + while (true) { + const response = await get( + listVotersSelector({ + ...queryClientParams, + params: [ + { + limit: LIST_VOTERS_LIMIT, + startAfter: + voters.length > 0 + ? voters[voters.length - 1].addr + : undefined, + }, + ], + }) + ) + + voters.push(...response.voters) + + if (response.voters.length < LIST_VOTERS_LIMIT) { + break + } + } + + return { + voters, + } + }, +}) diff --git a/packages/state/recoil/selectors/contracts/index.ts b/packages/state/recoil/selectors/contracts/index.ts index 64ef95d23..2b658fc7b 100644 --- a/packages/state/recoil/selectors/contracts/index.ts +++ b/packages/state/recoil/selectors/contracts/index.ts @@ -1,5 +1,7 @@ export * as CommonNftSelectors from './CommonNft' export * as Cw1WhitelistSelectors from './Cw1Whitelist' +export * as Cw3FixedMultisigSelectors from './Cw3FixedMultisig' +export * as Cw3FlexMultisigSelectors from './Cw3FlexMultisig' export * as Cw4GroupSelectors from './Cw4Group' export * as Cw20BaseSelectors from './Cw20Base' export * as Cw20StakeSelectors from './Cw20Stake' diff --git a/packages/stateful/components/dao/ImportMultisigModal.tsx b/packages/stateful/components/dao/ImportMultisigModal.tsx index 62c4915d6..a10b802c0 100644 --- a/packages/stateful/components/dao/ImportMultisigModal.tsx +++ b/packages/stateful/components/dao/ImportMultisigModal.tsx @@ -1,6 +1,6 @@ import { FormProvider, useForm } from 'react-hook-form' -import { cryptographicMultisigDetailsSelector } from '@dao-dao/state/recoil' +import { multisigDetailsSelector } from '@dao-dao/state/recoil' import { ChainProvider, ImportMultisigModal as StatelessImportMultisigModal, @@ -32,7 +32,7 @@ export const ImportMultisigModal = ( chainId && address && isValidBech32Address(address, getChainForChainId(chainId).bech32_prefix) - ? cryptographicMultisigDetailsSelector({ + ? multisigDetailsSelector({ chainId, address, }) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/components/NewProposal.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/components/NewProposal.tsx index ba066ab86..3881c1e1c 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/components/NewProposal.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/components/NewProposal.tsx @@ -17,6 +17,7 @@ import { useCachedLoadable, useChain, useDaoInfoContext, + useProcessTQ, } from '@dao-dao/stateless' import { BaseNewProposalProps, @@ -38,7 +39,6 @@ import { SimulateProposal, UsePublishProposal, } from '../../types' -import { useProcessTQ } from '../hooks' import { NewProposalMain } from './NewProposalMain' import { NewProposalPreview } from './NewProposalPreview' diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/index.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/index.ts index b7d7cc7ce..1221c1e3f 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/index.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/index.ts @@ -1,2 +1 @@ export * from './makeUsePublishProposal' -export * from './useProcessTQ' diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingVotesInfo.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingVotesInfo.ts index 67c22a0b9..67fbe7286 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingVotesInfo.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingVotesInfo.ts @@ -1,6 +1,6 @@ +import { useProcessTQ } from '@dao-dao/stateless' import { LoadingData, ProcessedTQType } from '@dao-dao/types' -import { useProcessTQ } from '../common/hooks/useProcessTQ' import { VotesInfo } from '../types' import { useLoadingProposal } from './useLoadingProposal' diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalDaoInfoCards.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalDaoInfoCards.tsx index 9b276559f..0f8ac3d86 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalDaoInfoCards.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalDaoInfoCards.tsx @@ -9,6 +9,7 @@ import { import { TokenAmountDisplay, useCachedLoadingWithError, + useProcessTQ, } from '@dao-dao/stateless' import { DaoInfoCard, @@ -24,7 +25,7 @@ import { import { EntityDisplay } from '../../../../components' import { useProposalModuleAdapterCommonContext } from '../../../react/context' -import { anyoneCanProposeSelector, useProcessTQ } from '../common' +import { anyoneCanProposeSelector } from '../common' export const useProposalDaoInfoCards = (): DaoInfoCard[] => { const { t } = useTranslation() diff --git a/packages/stateless/components/dao/create/ImportMultisigModal.tsx b/packages/stateless/components/dao/create/ImportMultisigModal.tsx index 65f0efd3d..1285cbb93 100644 --- a/packages/stateless/components/dao/create/ImportMultisigModal.tsx +++ b/packages/stateless/components/dao/create/ImportMultisigModal.tsx @@ -2,14 +2,19 @@ import { fromBech32 } from '@cosmjs/encoding' import { useFormContext } from 'react-hook-form' import { useTranslation } from 'react-i18next' -import { ImportMultisigForm, ImportMultisigModalProps } from '@dao-dao/types' import { + ImportMultisigForm, + ImportMultisigModalProps, + ProcessedTQType, +} from '@dao-dao/types' +import { + formatPercentOf100, getConfiguredChains, isValidBech32Address, makeValidateAddress, } from '@dao-dao/utils' -import { useChain } from '../../../hooks' +import { useChain, useProcessTQ } from '../../../hooks' import { Button } from '../../buttons' import { InputErrorMessage, InputLabel } from '../../inputs' import { Loader } from '../../logo' @@ -34,14 +39,36 @@ export const ImportMultisigModal = ({ const { chain_id: chainId, bech32_prefix: bech32Prefix } = useChain() + const processTQ = useProcessTQ() + const processedMultisigTQ = + loadingMultisig.loading || loadingMultisig.errored + ? undefined + : processTQ(loadingMultisig.data.threshold) + + const multisigType = + loadingMultisig.loading || loadingMultisig.errored || !processedMultisigTQ + ? 'unknown' + : processedMultisigTQ.threshold.type === ProcessedTQType.Absolute + ? t('info.xOfYMultisig', { + x: processedMultisigTQ.threshold.display, + y: loadingMultisig.data.totalWeight, + }) + : [ + t('title.threshold') + ': ' + processedMultisigTQ.threshold.display, + processedMultisigTQ.quorum && + t('info.quorum') + ': ' + processedMultisigTQ.quorum.display, + ] + .filter(Boolean) + .join(', ') + return (
@@ -114,19 +141,25 @@ export const ImportMultisigModal = ({
{t('title.type')} -

- {t('info.xOfYMultisig', { - x: loadingMultisig.data.threshold, - y: loadingMultisig.data.addresses.length, - })} -

+

{multisigType}

{t('title.members')} - {loadingMultisig.data.addresses.map((address) => ( - + {loadingMultisig.data.members.map(({ address, weight }) => ( +
+ + +

+ {formatPercentOf100( + (weight / loadingMultisig.data.totalWeight) * 100 + )} +

+
))}
diff --git a/packages/stateless/components/dao/create/pages/CreateDaoStart.tsx b/packages/stateless/components/dao/create/pages/CreateDaoStart.tsx index 4133a92ce..6b59b7d59 100644 --- a/packages/stateless/components/dao/create/pages/CreateDaoStart.tsx +++ b/packages/stateless/components/dao/create/pages/CreateDaoStart.tsx @@ -84,13 +84,31 @@ export const CreateDaoStart = ({

{t('title.importFrom')}

- +
+ + + + + +

{t('title.orChooseAStructure')} @@ -132,35 +150,43 @@ export const CreateDaoStart = ({ setImportMultisigVisible(false)} - onImport={({ chainId, address, addresses, threshold }) => { - // Convert addresses to the current chain's bech32 format. - const members = addresses.map((address) => ({ - address: transformBech32Address(address, daoChainId), - })) + onImport={({ chainId, address, members, threshold, totalWeight }) => { + // Group members by weight and sort descending. + const groupedMembers = Object.entries( + members.reduce( + (acc, { address, weight }) => ({ + ...acc, + [weight]: [...(acc[weight] || []), address], + }), + {} as Record + ) + ).sort(([a], [b]) => Number(b) - Number(a)) // Make new DAO to erase stale data. const newDao = makeDefaultNewDao(daoChainId) newDao.name = data.name || 'Imported Multisig' newDao.description = - data.description || - `A DAO replica of ${address} (a ${threshold}-of-${ - members.length - } multisig on ${getDisplayNameForChainId(chainId)}).` + !data.description || data.description.includes('A DAO based on') + ? `A DAO based on ${address} (a multisig on ${getDisplayNameForChainId( + chainId + )}).` + : data.description newDao.imageUrl = data.imageUrl newDao.creator = { id: MembershipBasedCreatorId, data: { - tiers: [ - { - name: 'Members', - weight: 1, - members, - }, - ], + tiers: groupedMembers.map(([weight, addresses]) => ({ + name: + groupedMembers.length === 1 ? 'Members' : `Weight: ${weight}`, + members: addresses.map((address) => ({ + // Convert address to the current chain's bech32 format. + address: transformBech32Address(address, daoChainId), + })), + weight: Number(weight), + })), }, } - // Disable single choice proposal module quorum. const singleChoiceIndex = newDao.proposalModuleAdapters.findIndex( ({ id }) => id === DaoProposalSingleAdapterId ) @@ -168,29 +194,79 @@ export const CreateDaoStart = ({ throw new Error('Single choice proposal module not found') } - newDao.proposalModuleAdapters[singleChoiceIndex].data.quorumEnabled = - false - // Disable multiple choice proposals since they work slightly - // differently from a typical multisig with an absolute threshold. + // differently from a typical multisig. newDao.votingConfig.enableMultipleChoice = false - // Intelligently choose threshold to use for this multisig. If the - // current threshold is the simple majority of the given multisig, use - // majority since that is likely the desired behavior. Otherwise, if - // threshold is configured to any other value, use its percentage. - const isMajority = threshold === Math.floor(members.length / 2) + 1 - - const thresholdConfig: PercentOrMajorityValue = { - majority: isMajority, - // The percentage is the floor of the threshold. For example, a 5/7 - // multisig needs a threshold of 71%, not 72% (the ceiling), since - // 5/7=0.7142857143. - value: Math.floor(threshold / members.length), - } + if ('absolute_count' in threshold) { + // No quorum. + newDao.proposalModuleAdapters[ + singleChoiceIndex + ].data.quorumEnabled = false - newDao.proposalModuleAdapters[singleChoiceIndex].data.threshold = - thresholdConfig + // Intelligently choose threshold to use for this multisig. If the + // current threshold is the simple majority of the given multisig, + // use majority since that is likely the desired behavior. + // Otherwise, if threshold is configured to any other value, use its + // percentage. + const thresholdConfig: PercentOrMajorityValue = { + majority: + Number(threshold.absolute_count.threshold) === + Math.floor(totalWeight / 2) + 1, + // The percentage is the floor of the threshold. For example, a + // 5/7 multisig needs a threshold of 71%, not 72% (the ceiling), + // since 5/7=0.7142857143. + value: Math.floor( + (Number(threshold.absolute_count.threshold) / totalWeight) * 100 + ), + } + + newDao.proposalModuleAdapters[singleChoiceIndex].data.threshold = + thresholdConfig + } else if ('absolute_percentage' in threshold) { + // No quorum. + newDao.proposalModuleAdapters[ + singleChoiceIndex + ].data.quorumEnabled = false + + const thresholdConfig: PercentOrMajorityValue = { + majority: 'majority' in threshold.absolute_percentage.percentage, + value: + 'majority' in threshold.absolute_percentage.percentage + ? // Default that will not be used unless they manually disable majority. + 67 + : Number(threshold.absolute_percentage.percentage.percent) * + 100, + } + newDao.proposalModuleAdapters[singleChoiceIndex].data.threshold = + thresholdConfig + } else if ('threshold_quorum' in threshold) { + // Set quorum. + newDao.proposalModuleAdapters[ + singleChoiceIndex + ].data.quorumEnabled = true + + const quorumConfig: PercentOrMajorityValue = { + majority: 'majority' in threshold.threshold_quorum.quorum, + value: + 'majority' in threshold.threshold_quorum.quorum + ? // Default that will not be used unless they manually disable majority. + 20 + : Number(threshold.threshold_quorum.quorum.percent) * 100, + } + newDao.votingConfig.quorum = quorumConfig + + const thresholdConfig: PercentOrMajorityValue = { + majority: 'majority' in threshold.threshold_quorum.threshold, + value: + 'majority' in threshold.threshold_quorum.threshold + ? // Default that will not be used unless they manually disable majority. + 67 + : Number(threshold.threshold_quorum.threshold.percent) * 100, + } + newDao.proposalModuleAdapters[singleChoiceIndex].data.threshold = + thresholdConfig + } reset(newDao) setImportMultisigVisible(false) diff --git a/packages/stateless/hooks/index.ts b/packages/stateless/hooks/index.ts index 9f7b542a1..c1ebc75f5 100644 --- a/packages/stateless/hooks/index.ts +++ b/packages/stateless/hooks/index.ts @@ -13,6 +13,7 @@ export * from './useInfiniteScroll' export * from './useLoadingGovProposalTimestampInfo' export * from './useMountedInBrowser' export * from './usePlatform' +export * from './useProcessTQ' export * from './useQuerySyncedState' export * from './useSearchFilter' export * from './useServiceWorker' diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/useProcessTQ.ts b/packages/stateless/hooks/useProcessTQ.ts similarity index 100% rename from packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/useProcessTQ.ts rename to packages/stateless/hooks/useProcessTQ.ts diff --git a/packages/types/account.ts b/packages/types/account.ts index e9eed46b1..05686e7a0 100644 --- a/packages/types/account.ts +++ b/packages/types/account.ts @@ -1,6 +1,7 @@ import { ComponentType } from 'react' import { ActionKeyAndData } from './actions' +import { Threshold } from './contracts/DaoProposalSingle.common' /** * The type of account given whatever the relevant context is. @@ -73,9 +74,9 @@ export type AccountTxSave = AccountTxForm & { } /** - * The details that describe a cryptographic multisig. + * The details that describe a multisig membership and threshold. */ -export type CryptographicMultisigDetails = { +export type MultisigDetails = { /** * The multisig's chain ID. */ @@ -85,11 +86,18 @@ export type CryptographicMultisigDetails = { */ address: string /** - * The member addresses of the multisig. + * The members of the multisig. */ - addresses: string[] + members: { + address: string + weight: number + }[] /** - * The number of members that must sign a transaction for it to be valid. + * The threshold of members that must sign a transaction for it to be valid. */ - threshold: number + threshold: Threshold + /** + * The sum of all members' weights. + */ + totalWeight: number } diff --git a/packages/types/components/ImportMultisigModal.ts b/packages/types/components/ImportMultisigModal.ts index 70a2a5c5e..ed18dc39f 100644 --- a/packages/types/components/ImportMultisigModal.ts +++ b/packages/types/components/ImportMultisigModal.ts @@ -1,6 +1,6 @@ import { ComponentType } from 'react' -import { CryptographicMultisigDetails } from '../account' +import { MultisigDetails } from '../account' import { LoadingDataWithError } from '../misc' import { AddressInputProps } from './AddressInput' import { StatefulEntityDisplayProps } from './EntityDisplay' @@ -13,11 +13,11 @@ export type ImportMultisigModalProps = Pick< /** * Multisig details loading from the entered address. */ - loadingMultisig: LoadingDataWithError + loadingMultisig: LoadingDataWithError /** * Import callback. */ - onImport: (details: CryptographicMultisigDetails) => void + onImport: (details: MultisigDetails) => void /** * The stateful address input component. */ diff --git a/packages/types/contracts/Cw3FixedMultisig.ts b/packages/types/contracts/Cw3FixedMultisig.ts new file mode 100644 index 000000000..8fe9619b4 --- /dev/null +++ b/packages/types/contracts/Cw3FixedMultisig.ts @@ -0,0 +1,267 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +export type Duration = + | { + height: number + } + | { + time: number + } +export type Threshold = + | { + absolute_count: { + weight: number + } + } + | { + absolute_percentage: { + percentage: Decimal + } + } + | { + threshold_quorum: { + quorum: Decimal + threshold: Decimal + } + } +export type Decimal = string +export interface InstantiateMsg { + max_voting_period: Duration + threshold: Threshold + voters: Voter[] +} +export interface Voter { + addr: string + weight: number +} +export type ExecuteMsg = + | { + propose: { + description: string + latest?: Expiration | null + msgs: CosmosMsgForEmpty[] + title: string + } + } + | { + vote: { + proposal_id: number + vote: Vote + } + } + | { + execute: { + proposal_id: number + } + } + | { + close: { + proposal_id: number + } + } +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export type Timestamp = Uint64 +export type Uint64 = string +export type CosmosMsgForEmpty = + | { + bank: BankMsg + } + | { + custom: Empty + } + | { + wasm: WasmMsg + } +export type BankMsg = + | { + send: { + amount: Coin[] + to_address: string + [k: string]: unknown + } + } + | { + burn: { + amount: Coin[] + [k: string]: unknown + } + } +export type Uint128 = string +export type WasmMsg = + | { + execute: { + contract_addr: string + funds: Coin[] + msg: Binary + [k: string]: unknown + } + } + | { + instantiate: { + admin?: string | null + code_id: number + funds: Coin[] + label: string + msg: Binary + [k: string]: unknown + } + } + | { + migrate: { + contract_addr: string + msg: Binary + new_code_id: number + [k: string]: unknown + } + } + | { + update_admin: { + admin: string + contract_addr: string + [k: string]: unknown + } + } + | { + clear_admin: { + contract_addr: string + [k: string]: unknown + } + } +export type Binary = string +export type Vote = 'yes' | 'no' | 'abstain' | 'veto' +export interface Coin { + amount: Uint128 + denom: string + [k: string]: unknown +} +export interface Empty { + [k: string]: unknown +} +export type QueryMsg = + | { + threshold: {} + } + | { + proposal: { + proposal_id: number + } + } + | { + list_proposals: { + limit?: number | null + start_after?: number | null + } + } + | { + reverse_proposals: { + limit?: number | null + start_before?: number | null + } + } + | { + vote: { + proposal_id: number + voter: string + } + } + | { + list_votes: { + limit?: number | null + proposal_id: number + start_after?: string | null + } + } + | { + voter: { + address: string + } + } + | { + list_voters: { + limit?: number | null + start_after?: string | null + } + } +export type Denom = + | { + native: string + } + | { + cw20: Addr + } +export type Addr = string +export type Status = 'pending' | 'open' | 'rejected' | 'passed' | 'executed' +export type ThresholdResponse = + | { + absolute_count: { + total_weight: number + weight: number + } + } + | { + absolute_percentage: { + percentage: Decimal + total_weight: number + } + } + | { + threshold_quorum: { + quorum: Decimal + threshold: Decimal + total_weight: number + } + } +export interface ProposalListResponseForEmpty { + proposals: ProposalResponseForEmpty[] +} +export interface ProposalResponseForEmpty { + deposit?: DepositInfo | null + description: string + expires: Expiration + id: number + msgs: CosmosMsgForEmpty[] + proposer: Addr + status: Status + threshold: ThresholdResponse + title: string +} +export interface DepositInfo { + amount: Uint128 + denom: Denom + refund_failed_proposals: boolean +} +export interface VoterListResponse { + voters: VoterDetail[] +} +export interface VoterDetail { + addr: string + weight: number +} +export interface VoteListResponse { + votes: VoteInfo[] +} +export interface VoteInfo { + proposal_id: number + vote: Vote + voter: string + weight: number +} +export interface VoteResponse { + vote?: VoteInfo | null +} +export interface VoterResponse { + weight?: number | null +} diff --git a/packages/types/contracts/Cw3FlexMultisig.ts b/packages/types/contracts/Cw3FlexMultisig.ts new file mode 100644 index 000000000..215284515 --- /dev/null +++ b/packages/types/contracts/Cw3FlexMultisig.ts @@ -0,0 +1,304 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +export type Executor = + | 'member' + | { + only: Addr + } +export type Addr = string +export type Duration = + | { + height: number + } + | { + time: number + } +export type Uint128 = string +export type UncheckedDenom = + | { + native: string + } + | { + cw20: string + } +export type Threshold = + | { + absolute_count: { + weight: number + } + } + | { + absolute_percentage: { + percentage: Decimal + } + } + | { + threshold_quorum: { + quorum: Decimal + threshold: Decimal + } + } +export type Decimal = string +export interface InstantiateMsg { + executor?: Executor | null + group_addr: string + max_voting_period: Duration + proposal_deposit?: UncheckedDepositInfo | null + threshold: Threshold +} +export interface UncheckedDepositInfo { + amount: Uint128 + denom: UncheckedDenom + refund_failed_proposals: boolean +} +export type ExecuteMsg = + | { + propose: { + description: string + latest?: Expiration | null + msgs: CosmosMsgForEmpty[] + title: string + } + } + | { + vote: { + proposal_id: number + vote: Vote + } + } + | { + execute: { + proposal_id: number + } + } + | { + close: { + proposal_id: number + } + } + | { + member_changed_hook: MemberChangedHookMsg + } +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export type Timestamp = Uint64 +export type Uint64 = string +export type CosmosMsgForEmpty = + | { + bank: BankMsg + } + | { + custom: Empty + } + | { + wasm: WasmMsg + } +export type BankMsg = + | { + send: { + amount: Coin[] + to_address: string + [k: string]: unknown + } + } + | { + burn: { + amount: Coin[] + [k: string]: unknown + } + } +export type WasmMsg = + | { + execute: { + contract_addr: string + funds: Coin[] + msg: Binary + [k: string]: unknown + } + } + | { + instantiate: { + admin?: string | null + code_id: number + funds: Coin[] + label: string + msg: Binary + [k: string]: unknown + } + } + | { + migrate: { + contract_addr: string + msg: Binary + new_code_id: number + [k: string]: unknown + } + } + | { + update_admin: { + admin: string + contract_addr: string + [k: string]: unknown + } + } + | { + clear_admin: { + contract_addr: string + [k: string]: unknown + } + } +export type Binary = string +export type Vote = 'yes' | 'no' | 'abstain' | 'veto' +export interface Coin { + amount: Uint128 + denom: string + [k: string]: unknown +} +export interface Empty { + [k: string]: unknown +} +export interface MemberChangedHookMsg { + diffs: MemberDiff[] +} +export interface MemberDiff { + key: string + new?: number | null + old?: number | null +} +export type QueryMsg = + | { + threshold: {} + } + | { + proposal: { + proposal_id: number + } + } + | { + list_proposals: { + limit?: number | null + start_after?: number | null + } + } + | { + reverse_proposals: { + limit?: number | null + start_before?: number | null + } + } + | { + vote: { + proposal_id: number + voter: string + } + } + | { + list_votes: { + limit?: number | null + proposal_id: number + start_after?: string | null + } + } + | { + voter: { + address: string + } + } + | { + list_voters: { + limit?: number | null + start_after?: string | null + } + } + | { + config: {} + } +export type Cw4Contract = Addr +export type Denom = + | { + native: string + } + | { + cw20: Addr + } +export interface Config { + executor?: Executor | null + group_addr: Cw4Contract + max_voting_period: Duration + proposal_deposit?: DepositInfo | null + threshold: Threshold +} +export interface DepositInfo { + amount: Uint128 + denom: Denom + refund_failed_proposals: boolean +} +export type Status = 'pending' | 'open' | 'rejected' | 'passed' | 'executed' +export type ThresholdResponse = + | { + absolute_count: { + total_weight: number + weight: number + } + } + | { + absolute_percentage: { + percentage: Decimal + total_weight: number + } + } + | { + threshold_quorum: { + quorum: Decimal + threshold: Decimal + total_weight: number + } + } +export interface ProposalListResponseForEmpty { + proposals: ProposalResponseForEmpty[] +} +export interface ProposalResponseForEmpty { + deposit?: DepositInfo | null + description: string + expires: Expiration + id: number + msgs: CosmosMsgForEmpty[] + proposer: Addr + status: Status + threshold: ThresholdResponse + title: string +} +export interface VoterListResponse { + voters: VoterDetail[] +} +export interface VoterDetail { + addr: string + weight: number +} +export interface VoteListResponse { + votes: VoteInfo[] +} +export interface VoteInfo { + proposal_id: number + vote: Vote + voter: string + weight: number +} +export interface VoteResponse { + vote?: VoteInfo | null +} +export interface VoterResponse { + weight?: number | null +} diff --git a/packages/utils/constants/contracts.ts b/packages/utils/constants/contracts.ts index 44196df4c..67a9ff871 100644 --- a/packages/utils/constants/contracts.ts +++ b/packages/utils/constants/contracts.ts @@ -1,6 +1,8 @@ // These are all used elsewhere in the codebase. export enum ContractName { Cw1Whitelist = 'crates.io:cw1-whitelist', + Cw3FixedMultisig = 'crates.io:cw3-fixed-multisig', + Cw3FlexMultisig = 'crates.io:cw3-flex-multisig', CwTokenSwap = 'crates.io:cw-token-swap', CwTokenfactoryIssuer = 'crates.io:cw-tokenfactory-issuer', PolytoneProxy = 'crates.io:polytone-proxy', From 3fd60bb53dcf53a54ea8e3c7243952ee2c1978d3 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 29 Feb 2024 12:34:02 -0800 Subject: [PATCH 002/438] fixed multisig threshold type check --- .../components/dao/create/ImportMultisigModal.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/stateless/components/dao/create/ImportMultisigModal.tsx b/packages/stateless/components/dao/create/ImportMultisigModal.tsx index 1285cbb93..f7092990f 100644 --- a/packages/stateless/components/dao/create/ImportMultisigModal.tsx +++ b/packages/stateless/components/dao/create/ImportMultisigModal.tsx @@ -2,11 +2,7 @@ import { fromBech32 } from '@cosmjs/encoding' import { useFormContext } from 'react-hook-form' import { useTranslation } from 'react-i18next' -import { - ImportMultisigForm, - ImportMultisigModalProps, - ProcessedTQType, -} from '@dao-dao/types' +import { ImportMultisigForm, ImportMultisigModalProps } from '@dao-dao/types' import { formatPercentOf100, getConfiguredChains, @@ -48,7 +44,7 @@ export const ImportMultisigModal = ({ const multisigType = loadingMultisig.loading || loadingMultisig.errored || !processedMultisigTQ ? 'unknown' - : processedMultisigTQ.threshold.type === ProcessedTQType.Absolute + : 'absolute_count' in loadingMultisig.data.threshold ? t('info.xOfYMultisig', { x: processedMultisigTQ.threshold.display, y: loadingMultisig.data.totalWeight, From 359d927a0fea68d8d66f29e4b6ed8edea2dbded1 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 1 Mar 2024 10:01:12 -0800 Subject: [PATCH 003/438] fixed cw20 vesting amount type --- packages/stateful/actions/core/treasury/ManageVesting/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stateful/actions/core/treasury/ManageVesting/index.tsx b/packages/stateful/actions/core/treasury/ManageVesting/index.tsx index d9945c288..e666ab491 100644 --- a/packages/stateful/actions/core/treasury/ManageVesting/index.tsx +++ b/packages/stateful/actions/core/treasury/ManageVesting/index.tsx @@ -701,7 +701,7 @@ export const makeManageVestingAction: ActionMaker = ( funds: [], msg: { send: { - amount: total, + amount: BigInt(total).toString(), contract: vestingSource.factory, msg: encodeMessageAsBase64({ instantiate_payroll_contract: msg, From f5d724ac893fc0f659aff04f9fe5d8b6e11d4eb6 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 1 Mar 2024 10:36:27 -0800 Subject: [PATCH 004/438] fixed stargaze name NFT load failure --- .../actions/core/nfts/BurnNft/Component.tsx | 4 +- .../nfts/TransferNft/Component.stories.tsx | 6 +- .../core/nfts/TransferNft/Component.tsx | 12 +++- .../actions/core/nfts/TransferNft/index.tsx | 4 +- packages/stateful/recoil/selectors/nft.ts | 59 ++++++++++--------- .../components/HorizontalNftCard.tsx | 19 ++++++ 6 files changed, 68 insertions(+), 36 deletions(-) diff --git a/packages/stateful/actions/core/nfts/BurnNft/Component.tsx b/packages/stateful/actions/core/nfts/BurnNft/Component.tsx index 4cef1ee32..d6df4441a 100644 --- a/packages/stateful/actions/core/nfts/BurnNft/Component.tsx +++ b/packages/stateful/actions/core/nfts/BurnNft/Component.tsx @@ -6,8 +6,8 @@ import { useTranslation } from 'react-i18next' import { Button, HorizontalNftCard, + HorizontalNftCardLoader, InputErrorMessage, - Loader, } from '@dao-dao/stateless' import { ActionComponent, @@ -86,7 +86,7 @@ export const BurnNft: ActionComponent = ({ <>

{nftInfo.loading ? ( - + ) : !nftInfo.errored && nftInfo.data ? ( ) : ( diff --git a/packages/stateful/actions/core/nfts/TransferNft/Component.stories.tsx b/packages/stateful/actions/core/nfts/TransferNft/Component.stories.tsx index 733fd9cbd..4ad4a597a 100644 --- a/packages/stateful/actions/core/nfts/TransferNft/Component.stories.tsx +++ b/packages/stateful/actions/core/nfts/TransferNft/Component.stories.tsx @@ -40,7 +40,11 @@ Default.args = { isCreating: true, errors: {}, options: { - nftInfo: selected, + nftInfo: { + loading: false, + errored: false, + data: selected, + }, options: { loading: false, errored: false, diff --git a/packages/stateful/actions/core/nfts/TransferNft/Component.tsx b/packages/stateful/actions/core/nfts/TransferNft/Component.tsx index 48e62476b..d06ebcaad 100644 --- a/packages/stateful/actions/core/nfts/TransferNft/Component.tsx +++ b/packages/stateful/actions/core/nfts/TransferNft/Component.tsx @@ -8,8 +8,10 @@ import { Button, ChainProvider, CodeMirrorInput, + ErrorPage, FormSwitchCard, HorizontalNftCard, + HorizontalNftCardLoader, InputErrorMessage, InputLabel, } from '@dao-dao/stateless' @@ -44,7 +46,7 @@ export interface TransferNftOptions { // The set of NFTs that may be transfered as part of this action. options: LoadingDataWithError // Information about the NFT currently selected. - nftInfo: NftCardInfo | undefined + nftInfo: LoadingDataWithError AddressInput: ComponentType> NftSelectionModal: ComponentType @@ -182,7 +184,13 @@ export const TransferNftComponent: ActionComponent = ({
- {nftInfo && } + {nftInfo.loading ? ( + + ) : nftInfo.errored ? ( + + ) : ( + nftInfo.data && + )} {isCreating && (
) }) + +export const HorizontalNftCardLoader = () => ( +
+
+ +
+

+ LOADING +

+ +
+
+

LOADING

+

LOADING

+
+
+
+
+) From efa57854f404c390bac64106ef5a72fc89ba23a1 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 1 Mar 2024 13:59:06 -0800 Subject: [PATCH 005/438] switch to polkachu's juno servers --- packages/utils/constants/chains.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index d97117ab9..f0f621f65 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -1205,8 +1205,8 @@ export const CHAIN_ENDPOINTS: Partial< > > = { [ChainId.JunoMainnet]: { - rpc: 'https://juno-rpc.reece.sh', - rest: 'https://juno-api.reece.sh', + rpc: 'https://juno-rpc.polkachu.com', + rest: 'https://juno-api.polkachu.com', }, [ChainId.JunoTestnet]: { rpc: 'https://juno-testnet-rpc.polkachu.com', From a66eed527942607d3a796000ee59921522d709f0 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 1 Mar 2024 14:46:52 -0800 Subject: [PATCH 006/438] hide treasury history graph for neutron DAO --- .../components/dao/tabs/TreasuryTab.tsx | 40 +++++++++++++------ 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/packages/stateless/components/dao/tabs/TreasuryTab.tsx b/packages/stateless/components/dao/tabs/TreasuryTab.tsx index a6f45c9d0..a51e5476a 100644 --- a/packages/stateless/components/dao/tabs/TreasuryTab.tsx +++ b/packages/stateless/components/dao/tabs/TreasuryTab.tsx @@ -6,6 +6,7 @@ import { useTranslation } from 'react-i18next' import { AccountType, ButtonLinkProps, + ChainId, DaoFiatDepositModalProps, LoadingData, LoadingDataWithError, @@ -15,6 +16,7 @@ import { TreasuryHistoryGraphProps, } from '@dao-dao/types' import { + NEUTRON_GOVERNANCE_DAO, concatAddressStartEnd, getDisplayNameForChainId, getImageUrlForChainId, @@ -202,20 +204,32 @@ export const TreasuryTab = ({ /> - -

{t('title.treasuryValue')}

+ { + // Don't show the treasury history graph for the Neutron DAO for + // performance reasons. + !( + daoChainId === ChainId.NeutronMainnet && + coreAddress === NEUTRON_GOVERNANCE_DAO + ) && ( + +

{t('title.treasuryValue')}

- - - } - registerTokenColors={setTokenSourceColorMap} - /> + + + } + registerTokenColors={setTokenSourceColorMap} + /> + ) + }

{t('title.tokens')}

From 87f84e75bb4ba15739fd37ca2a02dba7d9018020 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 1 Mar 2024 17:58:33 -0800 Subject: [PATCH 007/438] fixed contract not found error not being detected --- packages/utils/constants/other.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/utils/constants/other.ts b/packages/utils/constants/other.ts index d7144047b..c37f411b5 100644 --- a/packages/utils/constants/other.ts +++ b/packages/utils/constants/other.ts @@ -178,7 +178,7 @@ export const CHAIN_SUBDAOS: Record = { export const INVALID_CONTRACT_ERROR_SUBSTRINGS = [ 'Error parsing into type', 'no such contract', - 'not found: invalid request', + 'not found', 'unknown query path', 'decoding bech32 failed', ] From d850d9dae5699d30cb2363c79e024d44df9a3d07 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sat, 2 Mar 2024 13:38:06 -0800 Subject: [PATCH 008/438] fixed setting cross-chain vesting owner --- .../core/treasury/ManageVesting/BeginVesting.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/stateful/actions/core/treasury/ManageVesting/BeginVesting.tsx b/packages/stateful/actions/core/treasury/ManageVesting/BeginVesting.tsx index 95451e182..08a2bfee2 100644 --- a/packages/stateful/actions/core/treasury/ManageVesting/BeginVesting.tsx +++ b/packages/stateful/actions/core/treasury/ManageVesting/BeginVesting.tsx @@ -263,10 +263,17 @@ export const BeginVesting: ActionComponent = ({ actionOptions, chainId ) + const vestingManagerExists = !!widgetData.factories?.[chainId] || // Old single-chain factory support. (chainId === nativeChainId && !!widgetData.factory) + const vestingManagerVersion = widgetData.factories + ? widgetData.factories[chainId]?.version + : // Old single-chain factory support. + chainId === nativeChainId && !!widgetData.factory + ? widgetData.version + : undefined const crossChainAccountActionExists = allActionsWithData.some( (action) => action.actionKey === ActionKey.ConfigureVestingPayments @@ -429,8 +436,8 @@ export const BeginVesting: ActionComponent = ({ { // V1 and later can set the owner. - !!widgetData.version && - widgetData.version >= VestingContractVersion.V1 && ( + !!vestingManagerVersion && + vestingManagerVersion >= VestingContractVersion.V1 && (
From 5ad5dec7e38566c8c2859c104770df13a2aaba67 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 3 Mar 2024 12:21:02 -0800 Subject: [PATCH 009/438] fixed markdown renderer address detection, and support loading entities from any chain --- .../stateful/components/EntityDisplay.tsx | 19 ++++--- .../dao/DaoApproverProposalContentDisplay.tsx | 4 +- .../stateful/components/dao/DaoMemberCard.tsx | 4 +- ...eProposeApprovalProposalContentDisplay.tsx | 4 +- .../dao/DaoProposalContentDisplay.tsx | 4 +- .../gov/GovProposalContentDisplay.tsx | 2 +- .../components/gov/NewGovProposal.tsx | 2 +- .../components/vesting/VestingPaymentCard.tsx | 2 +- packages/stateful/hooks/useEntity.ts | 56 +++++++++++++++++-- .../stateful/hooks/useProposalVetoState.tsx | 2 +- .../common/components/NewProposalPreview.tsx | 2 +- .../common/components/NewProposalPreview.tsx | 2 +- .../components/stateful/ContributionForm.tsx | 2 +- .../stateful/ProposalCreationForm.tsx | 2 +- .../stateless/components/MarkdownRenderer.tsx | 4 ++ 15 files changed, 82 insertions(+), 29 deletions(-) diff --git a/packages/stateful/components/EntityDisplay.tsx b/packages/stateful/components/EntityDisplay.tsx index 996c8a060..c0df0ab64 100644 --- a/packages/stateful/components/EntityDisplay.tsx +++ b/packages/stateful/components/EntityDisplay.tsx @@ -1,6 +1,9 @@ import { useRouter } from 'next/router' -import { EntityDisplay as StatelessEntityDisplay } from '@dao-dao/stateless' +import { + ChainProvider, + EntityDisplay as StatelessEntityDisplay, +} from '@dao-dao/stateless' import { StatefulEntityDisplayProps } from '@dao-dao/types' import { useEntity } from '../hooks' @@ -10,7 +13,7 @@ export const EntityDisplay = ({ openInNewTab, ...props }: StatefulEntityDisplayProps) => { - const loadingEntity = useEntity(props.address) + const { chainId, entity } = useEntity(props.address) // If on proposal creation page, default to open in new tab to avoid // accidentally redirecting away from the proposal while editing. @@ -18,10 +21,12 @@ export const EntityDisplay = ({ openInNewTab ??= asPath.includes('/proposals/create') ? true : undefined return ( - + + + ) } diff --git a/packages/stateful/components/dao/DaoApproverProposalContentDisplay.tsx b/packages/stateful/components/dao/DaoApproverProposalContentDisplay.tsx index 33008e56e..32addc7cf 100644 --- a/packages/stateful/components/dao/DaoApproverProposalContentDisplay.tsx +++ b/packages/stateful/components/dao/DaoApproverProposalContentDisplay.tsx @@ -100,7 +100,7 @@ export const DaoApproverProposalContentDisplay = ({ } const creatorAddress = proposalInfo.createdByAddress - const entity = useEntity(creatorAddress) + const { entity } = useEntity(creatorAddress) const innerProps: InnerDaoApproverProposalContentDisplayProps = { creator: { @@ -177,7 +177,7 @@ const InnerDaoApproverProposalContentDisplayWithInnerContent = ({ // Fallback to approval proposal creator passed in from main component. props.creator?.address || '' - const entity = useEntity(creatorAddress) + const { entity } = useEntity(creatorAddress) if (!PreProposeApprovalInnerContentDisplay) { return diff --git a/packages/stateful/components/dao/DaoMemberCard.tsx b/packages/stateful/components/dao/DaoMemberCard.tsx index 8b96d0cbf..4d9964652 100644 --- a/packages/stateful/components/dao/DaoMemberCard.tsx +++ b/packages/stateful/components/dao/DaoMemberCard.tsx @@ -5,13 +5,13 @@ import { useEntity } from '../../hooks' import { ButtonLink } from '../ButtonLink' export const DaoMemberCard = (props: StatefulDaoMemberCardProps) => { - const loadingEntity = useEntity(props.address) + const { entity } = useEntity(props.address) return ( ) } diff --git a/packages/stateful/components/dao/DaoPreProposeApprovalProposalContentDisplay.tsx b/packages/stateful/components/dao/DaoPreProposeApprovalProposalContentDisplay.tsx index 4735e80a1..ed805d990 100644 --- a/packages/stateful/components/dao/DaoPreProposeApprovalProposalContentDisplay.tsx +++ b/packages/stateful/components/dao/DaoPreProposeApprovalProposalContentDisplay.tsx @@ -44,7 +44,7 @@ export const DaoPreProposeApprovalProposalContentDisplay = ({ useLoadingPreProposeApprovalProposal() const creatorAddress = proposalInfo.createdByAddress - const loadingEntity = useEntity(creatorAddress) + const { entity } = useEntity(creatorAddress) const { refreshProposal, refreshing } = useProposalRefreshers() @@ -93,7 +93,7 @@ export const DaoPreProposeApprovalProposalContentDisplay = ({ } creator={{ address: creatorAddress, - entity: loadingEntity, + entity, }} description={proposalInfo.description} duplicateUrl={duplicateUrl} diff --git a/packages/stateful/components/dao/DaoProposalContentDisplay.tsx b/packages/stateful/components/dao/DaoProposalContentDisplay.tsx index e7d0ab832..c36970203 100644 --- a/packages/stateful/components/dao/DaoProposalContentDisplay.tsx +++ b/packages/stateful/components/dao/DaoProposalContentDisplay.tsx @@ -42,7 +42,7 @@ export const DaoProposalContentDisplay = ({ proposalModule.prePropose?.type === PreProposeModuleType.Approver ? proposalModule.prePropose.config.approvalDao : proposalInfo.createdByAddress - const loadingEntity = useEntity(creatorAddress) + const { entity } = useEntity(creatorAddress) const { refreshProposal, refreshing } = useProposalRefreshers() @@ -74,7 +74,7 @@ export const DaoProposalContentDisplay = ({ } creator={{ address: creatorAddress, - entity: loadingEntity, + entity, }} description={proposalInfo.description} duplicateUrl={duplicateUrl} diff --git a/packages/stateful/components/gov/GovProposalContentDisplay.tsx b/packages/stateful/components/gov/GovProposalContentDisplay.tsx index ced6b7ad1..b5be57fc9 100644 --- a/packages/stateful/components/gov/GovProposalContentDisplay.tsx +++ b/packages/stateful/components/gov/GovProposalContentDisplay.tsx @@ -26,7 +26,7 @@ export const GovProposalContentDisplay = ({ (proposal.version === GovProposalVersion.V1 && proposal.proposal.proposer) || '' - const entity = useEntity(proposerAddress) + const { entity } = useEntity(proposerAddress) const loadingProposal = useLoadingGovProposal(proposal.id.toString()) const setRefreshProposal = useSetRecoilState(refreshGovProposalsAtom(chainId)) diff --git a/packages/stateful/components/gov/NewGovProposal.tsx b/packages/stateful/components/gov/NewGovProposal.tsx index 6029c70ef..00a8afc5e 100644 --- a/packages/stateful/components/gov/NewGovProposal.tsx +++ b/packages/stateful/components/gov/NewGovProposal.tsx @@ -143,7 +143,7 @@ const InnerNewGovProposal = ({ const [submitError, setSubmitError] = useState('') const { walletAddress = '' } = useWalletInfo() - const entity = useEntity(walletAddress) + const { entity } = useEntity(walletAddress) const [govProposalCreatedCardProps, setGovProposalCreatedCardProps] = useRecoilState(govProposalCreatedCardPropsAtom) diff --git a/packages/stateful/components/vesting/VestingPaymentCard.tsx b/packages/stateful/components/vesting/VestingPaymentCard.tsx index 30b2f2937..91519bce0 100644 --- a/packages/stateful/components/vesting/VestingPaymentCard.tsx +++ b/packages/stateful/components/vesting/VestingPaymentCard.tsx @@ -56,7 +56,7 @@ export const VestingPaymentCard = (vestingInfo: VestingInfo) => { steps, } = vestingInfo - const recipientEntity = useEntity(vest.recipient) + const { entity: recipientEntity } = useEntity(vest.recipient) const recipientIsDao = !recipientEntity.loading && recipientEntity.data.type === EntityType.Dao diff --git a/packages/stateful/hooks/useEntity.ts b/packages/stateful/hooks/useEntity.ts index 9e2b228c1..fcaa512fc 100644 --- a/packages/stateful/hooks/useEntity.ts +++ b/packages/stateful/hooks/useEntity.ts @@ -1,15 +1,54 @@ +import { fromBech32 } from '@cosmjs/encoding' +import { useMemo } from 'react' + import { useCachedLoading, useChain } from '@dao-dao/stateless' import { Entity, EntityType, LoadingData } from '@dao-dao/types' -import { getFallbackImage } from '@dao-dao/utils' +import { getConfiguredChains, getFallbackImage } from '@dao-dao/utils' import { entitySelector } from '../recoil' -// Supports wallets from any chain and DAOs from the current chain or DAOs from -// another chain with a polytone account on the current chain. -export const useEntity = (address: string): LoadingData => { - const { chain_id: chainId } = useChain() +export type UseEntityReturn = { + /** + * The chain ID detected for the address based on its prefix. + */ + chainId: string + /** + * The entity for the address on the detected chain. + */ + entity: LoadingData +} + +/** + * Fetch entity for the given address. Attempts to autodetect the chain based on + * the address prefix, which means it should load entities for wallets and DAOs + * from any chain. It should even correctly load a DAO given a cross-chain + * (polytone) account address. + */ +export const useEntity = (address: string): UseEntityReturn => { + const { chain_id: currentChainId, bech32_prefix: currentBech32Prefix } = + useChain() + const chainId = useMemo(() => { + try { + const prefix = fromBech32(address).prefix + if (prefix === currentBech32Prefix) { + return currentChainId + } + + // If prefix mismatch, try to find matching chain for prefix and use that + // one instead. + const matchingChainId = getConfiguredChains().find( + ({ chain }) => chain.bech32_prefix === prefix + )?.chainId - return useCachedLoading( + if (matchingChainId) { + return matchingChainId + } + } catch {} + + return currentChainId + }, [address, currentBech32Prefix, currentChainId]) + + const entity = useCachedLoading( address ? entitySelector({ chainId, @@ -25,4 +64,9 @@ export const useEntity = (address: string): LoadingData => { imageUrl: getFallbackImage(address), } ) + + return { + chainId, + entity, + } } diff --git a/packages/stateful/hooks/useProposalVetoState.tsx b/packages/stateful/hooks/useProposalVetoState.tsx index a73c946b7..ac4bc77eb 100644 --- a/packages/stateful/hooks/useProposalVetoState.tsx +++ b/packages/stateful/hooks/useProposalVetoState.tsx @@ -77,7 +77,7 @@ export const useProposalVetoState = ({ const [vetoLoading, setVetoLoading] = useState< 'veto' | 'earlyExecute' | false >(false) - const vetoerEntity = useEntity( + const { entity: vetoerEntity } = useEntity( vetoConfig?.vetoer || neutronTimelockOverrule?.dao || '' ) // Flatten vetoer entities in case a cw1-whitelist is the vetoer. diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/components/NewProposalPreview.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/components/NewProposalPreview.tsx index 10060b23f..7193c648a 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/components/NewProposalPreview.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/components/NewProposalPreview.tsx @@ -19,7 +19,7 @@ export const NewProposalPreview = () => { const { loadedActions } = useLoadedActionsAndCategories() const { walletAddress = '' } = useWalletInfo() - const entity = useEntity(walletAddress) + const { entity } = useEntity(walletAddress) const proposalDescription = watch('description') const proposalTitle = watch('title') diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/components/NewProposalPreview.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/components/NewProposalPreview.tsx index 5b42c8a20..be2bfaa30 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/components/NewProposalPreview.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/components/NewProposalPreview.tsx @@ -12,7 +12,7 @@ export const NewProposalPreview = () => { const { watch } = useFormContext() const { walletAddress = '' } = useWalletInfo() - const entity = useEntity(walletAddress) + const { entity } = useEntity(walletAddress) const proposalDescription = watch('description') const proposalTitle = watch('title') diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/ContributionForm.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/ContributionForm.tsx index 231ed506f..2b9c92a12 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/ContributionForm.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/ContributionForm.tsx @@ -35,7 +35,7 @@ export const ContributionForm = () => { } = useWallet({ loadAccount: true, }) - const walletEntity = useEntity(walletAddress) + const { entity: walletEntity } = useEntity(walletAddress) const postRequest = usePostRequest() diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/ProposalCreationForm.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/ProposalCreationForm.tsx index b5d00112d..8caf20915 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/ProposalCreationForm.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/ProposalCreationForm.tsx @@ -136,7 +136,7 @@ export const ProposalCreationForm = ({ data }: ProposalCreationFormProps) => { ) : undefined ) - const walletEntity = useEntity(walletAddress) + const { entity: walletEntity } = useEntity(walletAddress) return ( { const words = value.split(' ') const newNodes = words.reduce((nodes, word) => { + // Strip non alphanumeric characters, in case address is surrounded by + // punctuation. + word = word.replace(/[^a-zA-Z0-9]/gi, '') + if (isValidBech32Address(word)) { // Append entity display node. nodes.push({ From cfcad8be12d9ef6bc8253b4bdf72a28347949d64 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 3 Mar 2024 13:03:11 -0800 Subject: [PATCH 010/438] fixxed missing punctuation in markdown --- packages/stateless/components/MarkdownRenderer.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/stateless/components/MarkdownRenderer.tsx b/packages/stateless/components/MarkdownRenderer.tsx index 042959abe..743bf47d8 100644 --- a/packages/stateless/components/MarkdownRenderer.tsx +++ b/packages/stateless/components/MarkdownRenderer.tsx @@ -167,16 +167,16 @@ const remarkEntityDisplay = () => { const newNodes = words.reduce((nodes, word) => { // Strip non alphanumeric characters, in case address is surrounded by // punctuation. - word = word.replace(/[^a-zA-Z0-9]/gi, '') + const strippedWord = word.replace(/[^a-zA-Z0-9]/gi, '') - if (isValidBech32Address(word)) { + if (isValidBech32Address(strippedWord)) { // Append entity display node. nodes.push({ type: 'element', tagName: ENTITY_DISPLAY_NODE_TAG, children: [], properties: { - address: word, + address: strippedWord, className: clsx( '!inline-flex', // If surrounded by other words, add some margin and From ef882d444ee204225159bd97caff847c82e61288 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 3 Mar 2024 13:05:34 -0800 Subject: [PATCH 011/438] fixed creation modal too large on mobile --- packages/stateless/components/modals/ItemCreatedModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stateless/components/modals/ItemCreatedModal.tsx b/packages/stateless/components/modals/ItemCreatedModal.tsx index 107a36128..48b85b897 100644 --- a/packages/stateless/components/modals/ItemCreatedModal.tsx +++ b/packages/stateless/components/modals/ItemCreatedModal.tsx @@ -45,7 +45,7 @@ export const ItemCreatedModal = < return ( From c7ca5096a9420ac3656b5c865278aaa437518f25 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 4 Mar 2024 11:13:13 -0800 Subject: [PATCH 012/438] fixed polytone UI not detecting multiple cross-chain msgs, and now display timed out polytone state --- packages/i18n/locales/en/translation.json | 1 + .../core/advanced/CrossChainExecute/index.tsx | 2 +- .../hooks/useProposalPolytoneState.ts | 76 +++++++++++++++---- packages/stateless/components/InfoCard.tsx | 7 +- .../ProposalCrossChainRelayStatus.tsx | 6 +- packages/types/proposal.ts | 36 ++++++--- 6 files changed, 98 insertions(+), 30 deletions(-) diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index e7a95a4ca..f3000d55f 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -372,6 +372,7 @@ "couldntFindProposal": "We couldn't find a proposal with that ID.", "couldntFindWallet": "We couldn't find a wallet with that address.", "counterpartyBalanceInsufficient": "The counterparty's balance of {{amount}} ${{tokenSymbol}} is insufficient. They may be unable to complete this swap.", + "crossChainMessagesTimedOut": "One or more cross-chain messages timed out and thus did not get executed on the destination chain.", "daoAccountNotFound": "The DAO account could not be found for this chain.", "daoAndSubDaosAlreadyOnV2": "This DAO (and all of its SubDAOs, if it has any) have already been upgraded.", "daoCreationIncomplete": "DAO creation is incomplete. Ensure all required fields have been filled out.", diff --git a/packages/stateful/actions/core/advanced/CrossChainExecute/index.tsx b/packages/stateful/actions/core/advanced/CrossChainExecute/index.tsx index 572a2fa9e..a7c68e246 100644 --- a/packages/stateful/actions/core/advanced/CrossChainExecute/index.tsx +++ b/packages/stateful/actions/core/advanced/CrossChainExecute/index.tsx @@ -126,7 +126,7 @@ export const makeCrossChainExecuteAction: ActionMaker< const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( msg: Record ) => { - const decodedPolytone = decodePolytoneExecuteMsg(currentChainId, msg) + const decodedPolytone = decodePolytoneExecuteMsg(currentChainId, msg, 'any') return decodedPolytone.match ? { diff --git a/packages/stateful/hooks/useProposalPolytoneState.ts b/packages/stateful/hooks/useProposalPolytoneState.ts index 11b9afc2f..2486f8903 100644 --- a/packages/stateful/hooks/useProposalPolytoneState.ts +++ b/packages/stateful/hooks/useProposalPolytoneState.ts @@ -34,6 +34,7 @@ import { decodeMessage, decodePolytoneExecuteMsg, makeWasmMessage, + objectMatchesStructure, } from '@dao-dao/utils' export type UseProposalPolytoneStateOptions = { @@ -90,7 +91,7 @@ export const useProposalPolytoneState = ({ () => msgs .map((msg) => - decodePolytoneExecuteMsg(srcChainId, decodeMessage(msg), 'oneOrZero') + decodePolytoneExecuteMsg(srcChainId, decodeMessage(msg), 'any') ) .flatMap((decoded) => (decoded.match ? [decoded] : [])), [srcChainId, msgs] @@ -166,13 +167,59 @@ export const useProposalPolytoneState = ({ [] ) - // If any packets or acks are not received, or any callbacks failed to load, - // refresh the data. - const anyUnrelayed = - (!unreceivedPackets.loading && unreceivedPackets.data.flat().length > 0) || - (!unreceivedAcks.loading && unreceivedAcks.data.flat().length > 0) || - (!polytoneResults.loading && - polytoneResults.data.some(({ state }) => state === 'hasError')) + // Get unrelayed and timed-out messages. + const { relayedMsgs, unrelayedMsgs, timedOutMsgs } = useMemo(() => { + const relayedMsgs = !polytoneResults.loading + ? polytoneResults.data.flatMap((loadable, index) => + loadable.state === 'hasValue' && + objectMatchesStructure(loadable.contents, { + callback: { + result: { + execute: { + Ok: {}, + }, + }, + }, + }) + ? polytoneMessages[index].initiatorMsg + : [] + ) + : [] + const unrelayedMsgs = !polytoneResults.loading + ? polytoneResults.data.flatMap((loadable, index) => + loadable.state === 'hasError' && + loadable.contents instanceof Error && + loadable.contents.message.includes( + 'polytone::callbacks::CallbackMessage not found' + ) + ? polytoneMessages[index].initiatorMsg + : [] + ) + : [] + const timedOutMsgs = !polytoneResults.loading + ? polytoneResults.data.flatMap((loadable, index) => + loadable.state === 'hasValue' && + objectMatchesStructure(loadable.contents, { + callback: { + result: { + execute: { + Err: {}, + }, + }, + }, + }) && + (loadable.contents.callback.result as any).execute.Err === 'timeout' + ? polytoneMessages[index].initiatorMsg + : [] + ) + : [] + + return { + relayedMsgs, + unrelayedMsgs, + timedOutMsgs, + } + }, [polytoneResults, polytoneMessages]) // Refresh every 10 seconds while anything is unrelayed. const refreshUnreceivedIbcData = useRecoilCallback( @@ -186,6 +233,7 @@ export const useProposalPolytoneState = ({ }, useDeepCompareMemoize([srcChainId, dstChainIds]) ) + const anyUnrelayed = unrelayedMsgs.length > 0 useEffect(() => { if (!anyUnrelayed) { return @@ -203,16 +251,12 @@ export const useProposalPolytoneState = ({ const polytoneMessagesNeedingSelfRelay = polytoneResults.loading ? undefined : polytoneMessages.filter( - ({ polytoneConnection: { needsSelfRelay } }, index) => + ({ polytoneConnection: { needsSelfRelay }, initiatorMsg }) => // Needs self-relay or does not need self-relay but was executed a few // minutes ago and still has not been relayed. (!!needsSelfRelay || executedOverFiveMinutesAgo) && // Not yet relayed. - polytoneResults.data[index].state === 'hasError' && - polytoneResults.data[index].errorOrThrow() instanceof Error && - ( - polytoneResults.data[index].errorOrThrow() as Error - ).message.includes('polytone::callbacks::CallbackMessage not found') + unrelayedMsgs.includes(initiatorMsg) ) const hasPolytoneMessagesNeedingSelfRelay = !!polytoneMessagesNeedingSelfRelay?.length @@ -260,7 +304,9 @@ export const useProposalPolytoneState = ({ loading: false, data: { hasPolytoneMessages: polytoneMessages.length > 0, - anyUnrelayed, + relayedMsgs, + unrelayedMsgs, + timedOutMsgs, needsSelfRelay: hasPolytoneMessagesNeedingSelfRelay, openPolytoneRelay: () => status === ProposalStatusEnum.Executed && !loadingTxHash.loading diff --git a/packages/stateless/components/InfoCard.tsx b/packages/stateless/components/InfoCard.tsx index fca84fea6..ddcabd775 100644 --- a/packages/stateless/components/InfoCard.tsx +++ b/packages/stateless/components/InfoCard.tsx @@ -1,11 +1,11 @@ -import { Check, InfoOutlined } from '@mui/icons-material' +import { Check, InfoOutlined, WarningRounded } from '@mui/icons-material' import clsx from 'clsx' import { Loader } from './logo' export type InfoCardProps = { content: string - style?: 'info' | 'loading' | 'success' + style?: 'info' | 'loading' | 'success' | 'warning' className?: string textClassName?: string } @@ -27,6 +27,9 @@ export const InfoCard = ({ )} {style === 'success' && } {style === 'loading' && } + {style === 'warning' && ( + + )}

{content}

diff --git a/packages/stateless/components/proposal/ProposalCrossChainRelayStatus.tsx b/packages/stateless/components/proposal/ProposalCrossChainRelayStatus.tsx index 9741e9424..a43690609 100644 --- a/packages/stateless/components/proposal/ProposalCrossChainRelayStatus.tsx +++ b/packages/stateless/components/proposal/ProposalCrossChainRelayStatus.tsx @@ -9,7 +9,7 @@ export type ProposalCrossChainRelayStatusProps = { } export const ProposalCrossChainRelayStatus = ({ - state: { hasPolytoneMessages, anyUnrelayed, needsSelfRelay }, + state: { hasPolytoneMessages, needsSelfRelay, unrelayedMsgs, timedOutMsgs }, }: ProposalCrossChainRelayStatusProps) => { const { t } = useTranslation() @@ -17,13 +17,15 @@ export const ProposalCrossChainRelayStatus = ({ return null } - return anyUnrelayed ? ( + return unrelayedMsgs.length > 0 ? ( !needsSelfRelay ? ( ) : null + ) : timedOutMsgs.length > 0 ? ( + ) : ( export type ProposalPolytoneState = { - // Whether or not there are any polytone messages. + /** + * Whether or not there are any polytone messages. + */ hasPolytoneMessages: boolean - // Whether or not there are polytone messages that have not been relayed. - anyUnrelayed: boolean - // Whether or not there are polytone messages that need to be self-relayed. - // Most chains have relayers set up, so no need to self-relay on those chains. - // After a few minutes if there are still messages that need to be relayed, - // they can be self-relayed. This will be true when unrelayed messages exist - // on a chain with no relayers or when there are still unrelayed messages - // after a few minutes. + /** + * The initiator msgs that relayed successfully. + */ + relayedMsgs: string[] + /** + * The initiator msgs that are unrelayed. + */ + unrelayedMsgs: string[] + /** + * The initiator msgs that timed out. + */ + timedOutMsgs: string[] + /** + * Whether or not there are polytone messages that need to be self-relayed. + * Most chains have relayers set up, so no need to self-relay on those chains. + * After a few minutes if there are still messages that need to be relayed, + * they can be self-relayed. This will be true when unrelayed messages exist + * on a chain with no relayers or when there are still unrelayed messages + * after a few minutes. + */ needsSelfRelay: boolean - // Opens the execute and self-relay modal. + /** + * Opens the execute and self-relay modal. + */ openPolytoneRelay: () => void } From 760652fd170743a296b3df343b4582fff0ef8cf8 Mon Sep 17 00:00:00 2001 From: noah Date: Mon, 4 Mar 2024 18:04:33 -0800 Subject: [PATCH 013/438] Profile Refactor (#1742) --- apps/dapp/next.config.js | 5 + apps/dapp/package.json | 3 +- apps/sda/package.json | 1 - packages/config/tailwind/animation.js | 3 + packages/config/tailwind/keyframes.js | 9 + packages/i18n/locales/bad/translation.json | 2 +- packages/i18n/locales/dog/translation.json | 2 +- packages/i18n/locales/en/translation.json | 38 +- packages/state/index.ts | 1 - packages/state/package.json | 1 - packages/state/recoil/atoms/misc.ts | 5 + packages/state/recoil/atoms/refresh.ts | 3 +- packages/state/recoil/selectors/profile.ts | 29 +- packages/state/recoil/selectors/skip.ts | 141 +- packages/state/recoil/selectors/token.ts | 30 +- packages/state/skip/client.ts | 5 - packages/state/skip/index.ts | 1 - .../actions/core/treasury/Spend/Component.tsx | 18 +- .../actions/core/treasury/Spend/index.tsx | 35 +- packages/stateful/actions/react/provider.tsx | 6 +- .../stateful/command/contexts/generic/dao.tsx | 2 +- packages/stateful/components/DappLayout.tsx | 14 +- packages/stateful/components/NavWallet.tsx | 20 +- .../components/PfpkNftSelectionModal.tsx | 123 +- .../components/SelfRelayExecuteModal.tsx | 68 +- .../stateful/components/dao/CreateDaoForm.tsx | 4 +- .../components/dao/DaoTokenDepositModal.tsx | 4 +- .../stateful/components/dao/tabs/AppsTab.tsx | 29 +- .../components/gov/NewGovProposal.tsx | 5 +- .../components/nft/NftSelectionModal.tsx | 104 +- .../stateful/components/pages/Account.tsx | 19 +- .../stateful/components/pages/AccountDaos.tsx | 41 +- packages/stateful/components/pages/Me.tsx | 94 +- .../stateful/components/pages/MeBalances.tsx | 17 - packages/stateful/components/pages/MeDaos.tsx | 33 - packages/stateful/components/pages/index.ts | 3 - .../components/profile/MergeProfilesModal.tsx | 182 + .../ProfileActions.tsx} | 12 +- .../components/profile/ProfileAddChains.tsx | 75 + .../components/profile/ProfileDaos.tsx | 42 + .../profile/ProfileProposalCard.tsx | 11 +- .../components/profile/ProfileWallet.tsx | 57 + packages/stateful/components/profile/index.ts | 6 + .../stateful/components/profile/index.tsx | 1 - .../components/vesting/VestingPaymentCard.tsx | 4 +- .../wallet/ConnectedWalletDisplay.tsx | 54 - .../components/wallet/DisconnectWallet.tsx | 23 +- .../components/wallet/WalletBalances.tsx | 122 - .../components/wallet/WalletChainSwitcher.tsx | 30 +- .../stateful/components/wallet/WalletDaos.tsx | 24 +- .../components/wallet/WalletLazyNftCard.tsx | 32 +- .../components/wallet/WalletModals.tsx | 6 +- .../components/wallet/WalletProvider.tsx | 6 +- .../components/wallet/WalletStakingModal.tsx | 4 +- .../components/wallet/WalletTokenCard.tsx | 4 +- .../components/wallet/WalletUiConnected.tsx | 20 +- packages/stateful/components/wallet/index.ts | 2 - .../feed/sources/OpenProposals/index.ts | 54 +- .../feed/sources/VetoableProposals/index.ts | 52 +- packages/stateful/hooks/index.ts | 5 +- .../hooks/useCfWorkerAuthPostRequest.ts | 140 +- packages/stateful/hooks/useEntity.ts | 3 +- packages/stateful/hooks/useFollowingDaos.ts | 33 +- packages/stateful/hooks/useInbox.ts | 20 +- .../stateful/hooks/useLoadingDaoCardInfos.ts | 42 +- packages/stateful/hooks/useManageProfile.ts | 416 ++ packages/stateful/hooks/useProfile.ts | 152 + packages/stateful/hooks/useRefreshProfile.ts | 42 + .../hooks/useSupportedChainWallets.ts | 116 - packages/stateful/hooks/useWallet.ts | 16 +- packages/stateful/hooks/useWalletBalances.ts | 79 + packages/stateful/hooks/useWalletInfo.tsx | 275 - packages/stateful/package.json | 5 +- .../common/components/NewProposalPreview.tsx | 4 +- .../common/components/NewProposalPreview.tsx | 4 +- packages/stateful/recoil/selectors/entity.ts | 14 +- packages/stateful/recoil/selectors/profile.ts | 141 +- packages/stateful/recoil/selectors/wallet.ts | 99 +- .../components/ProfileCardMemberInfo.tsx | 4 +- .../components/StakingModal.tsx | 4 +- .../components/ProfileCardMemberInfo.tsx | 4 +- .../components/ProfileCardMemberInfo.tsx | 4 +- .../components/StakingModal.tsx | 4 +- .../components/ProfileCardMemberInfo.tsx | 4 +- .../components/StakingModal.tsx | 4 +- .../components/StakingModal.tsx | 4 +- .../stateless/components/EntityDisplay.tsx | 1 + .../components/IbcDestinationChainPicker.tsx | 3 +- packages/stateless/components/LinkWrapper.tsx | 2 + packages/stateless/components/WarningCard.tsx | 5 + .../components/buttons/Buttonifier.tsx | 7 +- .../stateless/components/chain/ChainLabel.tsx | 23 +- packages/stateless/components/dao/DaoCard.tsx | 1 + .../components/dao/tabs/TreasuryTab.tsx | 2 +- .../inputs/DaoSupportedChainPickerInput.tsx | 4 +- .../components/layout/NavWallet.stories.tsx | 2 +- .../stateless/components/layout/NavWallet.tsx | 27 +- .../stateless/components/modals/Modal.tsx | 22 +- .../components/popup/ButtonPopup.tsx | 2 +- .../components/popup/ChainPickerPopup.tsx | 202 +- .../components/popup/FilterableItemPopup.tsx | 6 +- packages/stateless/components/popup/Popup.tsx | 3 +- .../profile/ProfileActions.stories.tsx} | 15 +- .../profile/ProfileActions.tsx} | 41 +- .../components/profile/ProfileAddChains.tsx | 159 + .../profile/ProfileCantVoteCard.stories.tsx | 5 +- .../profile/ProfileCardWrapper.stories.tsx | 23 +- .../components/profile/ProfileCardWrapper.tsx | 28 +- .../components/profile/ProfileImage.tsx | 25 +- .../profile/ProfileMemberCard.stories.tsx | 7 +- .../profile/ProfileNameDisplayAndEditor.tsx | 80 +- .../profile/ProfileVoteCard.stories.tsx | 5 +- .../profile/ProfileWallet.stories.tsx | 53 + .../components/profile/ProfileWallet.tsx | 182 + .../profile/{index.tsx => index.ts} | 3 + .../components/vesting/VestingPaymentCard.tsx | 2 +- .../components/wallet/DisconnectWallet.tsx | 15 +- .../wallet/NavWalletConnected.stories.tsx | 1 - .../components/wallet/NavWalletConnected.tsx | 259 +- .../wallet/WalletBalances.stories.tsx | 59 - .../components/wallet/WalletBalances.tsx | 123 - .../components/wallet/WalletDaos.tsx | 28 +- .../components/wallet/WalletProfileHeader.tsx | 51 +- .../components/wallet/{index.tsx => index.ts} | 1 - packages/stateless/hooks/useAddToken.ts | 5 +- .../stateless/hooks/useTokenSortOptions.ts | 26 +- packages/stateless/package.json | 3 +- packages/stateless/pages/Account.tsx | 2 +- packages/stateless/pages/Me.stories.tsx | 46 - packages/stateless/pages/Profile.stories.tsx | 31 + .../stateless/pages/{Me.tsx => Profile.tsx} | 57 +- packages/stateless/pages/index.ts | 3 +- packages/storybook/utils.ts | 32 +- packages/types/account.ts | 4 +- packages/types/actions.ts | 2 + packages/types/components/ButtonPopup.ts | 4 +- packages/types/components/ChainPickerPopup.ts | 120 + packages/types/components/EntityDisplay.tsx | 2 + packages/types/components/LinkWrapper.ts | 37 +- .../types/components/NavWalletConnected.ts | 34 +- packages/types/components/Popup.ts | 4 + packages/types/components/ProfileAddChains.ts | 73 + .../types/components/ProfileCardWrapper.ts | 7 +- packages/types/components/ProfileWallet.ts | 29 + packages/types/components/WalletBalances.ts | 17 - packages/types/components/WalletDaos.tsx | 27 +- .../types/components/WalletProfileHeader.ts | 37 +- packages/types/components/index.ts | 4 +- packages/types/index.ts | 1 + packages/types/profile.ts | 128 +- packages/types/skip.ts | 65 + packages/utils/actions.ts | 5 +- packages/utils/assets.ts | 4 +- packages/utils/auth.ts | 116 + packages/utils/chain.ts | 9 +- packages/utils/constants/other.ts | 8 +- packages/utils/index.ts | 2 + packages/utils/keplr.ts | 51 +- packages/utils/misc.ts | 37 + packages/utils/package.json | 3 +- packages/utils/token.ts | 30 + packages/utils/url.ts | 2 +- yarn.lock | 4749 ++--------------- 163 files changed, 4057 insertions(+), 6615 deletions(-) delete mode 100644 packages/state/skip/client.ts delete mode 100644 packages/state/skip/index.ts delete mode 100644 packages/stateful/components/pages/MeBalances.tsx delete mode 100644 packages/stateful/components/pages/MeDaos.tsx create mode 100644 packages/stateful/components/profile/MergeProfilesModal.tsx rename packages/stateful/components/{pages/MeTransactionBuilder.tsx => profile/ProfileActions.tsx} (95%) create mode 100644 packages/stateful/components/profile/ProfileAddChains.tsx create mode 100644 packages/stateful/components/profile/ProfileDaos.tsx create mode 100644 packages/stateful/components/profile/ProfileWallet.tsx create mode 100644 packages/stateful/components/profile/index.ts delete mode 100644 packages/stateful/components/profile/index.tsx delete mode 100644 packages/stateful/components/wallet/ConnectedWalletDisplay.tsx delete mode 100644 packages/stateful/components/wallet/WalletBalances.tsx create mode 100644 packages/stateful/hooks/useManageProfile.ts create mode 100644 packages/stateful/hooks/useProfile.ts create mode 100644 packages/stateful/hooks/useRefreshProfile.ts delete mode 100644 packages/stateful/hooks/useSupportedChainWallets.ts create mode 100644 packages/stateful/hooks/useWalletBalances.ts delete mode 100644 packages/stateful/hooks/useWalletInfo.tsx rename packages/stateless/{pages/MeTransactionBuilder.stories.tsx => components/profile/ProfileActions.stories.tsx} (84%) rename packages/stateless/{pages/MeTransactionBuilder.tsx => components/profile/ProfileActions.tsx} (92%) create mode 100644 packages/stateless/components/profile/ProfileAddChains.tsx create mode 100644 packages/stateless/components/profile/ProfileWallet.stories.tsx create mode 100644 packages/stateless/components/profile/ProfileWallet.tsx rename packages/stateless/components/profile/{index.tsx => index.ts} (71%) delete mode 100644 packages/stateless/components/wallet/WalletBalances.stories.tsx delete mode 100644 packages/stateless/components/wallet/WalletBalances.tsx rename packages/stateless/components/wallet/{index.tsx => index.ts} (85%) delete mode 100644 packages/stateless/pages/Me.stories.tsx create mode 100644 packages/stateless/pages/Profile.stories.tsx rename packages/stateless/pages/{Me.tsx => Profile.tsx} (50%) create mode 100644 packages/types/components/ChainPickerPopup.ts create mode 100644 packages/types/components/ProfileAddChains.ts create mode 100644 packages/types/components/ProfileWallet.ts delete mode 100644 packages/types/components/WalletBalances.ts create mode 100644 packages/types/skip.ts create mode 100644 packages/utils/auth.ts create mode 100644 packages/utils/misc.ts diff --git a/apps/dapp/next.config.js b/apps/dapp/next.config.js index 45ea4a81a..273e795bf 100644 --- a/apps/dapp/next.config.js +++ b/apps/dapp/next.config.js @@ -82,6 +82,11 @@ const config = { process.env.NEXT_PUBLIC_LEGACY_URL_PREFIX + '/multisig/:slug*', permanent: false, }, + { + source: '/me/tx', + destination: '/me/actions', + permanent: false, + }, ], // Only upload source maps to Sentry in CI action when token is provided. sentry: { diff --git a/apps/dapp/package.json b/apps/dapp/package.json index 760632532..e2f4889da 100644 --- a/apps/dapp/package.json +++ b/apps/dapp/package.json @@ -31,7 +31,6 @@ "@keplr-wallet/common": "^0.11.49", "@keplr-wallet/cosmos": "^0.11.49", "@keplr-wallet/provider": "^0.11.49", - "@keplr-wallet/stores": "^0.11.49", "@keplr-wallet/types": "^0.11.49", "@mui/icons-material": "^5.10.3", "@sentry/nextjs": "^7.80.0", @@ -53,7 +52,7 @@ }, "devDependencies": { "@dao-dao/config": "2.2.0", - "@next/bundle-analyzer": "^12.1.0", + "@next/bundle-analyzer": "^14.1.0", "@sentry/cli": "^2.21.3", "@solana/web3.js": "^1.75.0", "@types/cors": "^2.8.13", diff --git a/apps/sda/package.json b/apps/sda/package.json index 62333506c..b2e4ba038 100644 --- a/apps/sda/package.json +++ b/apps/sda/package.json @@ -29,7 +29,6 @@ "@keplr-wallet/common": "^0.11.49", "@keplr-wallet/cosmos": "^0.11.49", "@keplr-wallet/provider": "^0.11.49", - "@keplr-wallet/stores": "^0.11.49", "@keplr-wallet/types": "^0.11.49", "@mui/icons-material": "^5.10.3", "@sentry/nextjs": "^7.80.0", diff --git a/packages/config/tailwind/animation.js b/packages/config/tailwind/animation.js index b2bd100f6..04673d90b 100644 --- a/packages/config/tailwind/animation.js +++ b/packages/config/tailwind/animation.js @@ -8,6 +8,9 @@ const animation = { spin: 'spin 200ms ease-in-out', 'spin-slow': `spin 10s cubic-bezier(.6,1.15,.89,.81) infinite`, 'spin-medium': `spin 3s cubic-bezier(.6,1.15,.89,.81) infinite`, + // Modal + 'expand-in': `expand-in 0.2s cubic-bezier(0.4, 0, 0.2, 1)`, + 'contract-out': `contract-out 0.2s cubic-bezier(0.4, 0, 0.2, 1)`, // Dropdown menu 'scale-in': `scale-in 0.2s ease-in-out`, 'slide-down': `slide-down 0.6s cubic-bezier(0.16, 1, 0.3, 1)`, diff --git a/packages/config/tailwind/keyframes.js b/packages/config/tailwind/keyframes.js index 38a5b6286..8b6c7352f 100644 --- a/packages/config/tailwind/keyframes.js +++ b/packages/config/tailwind/keyframes.js @@ -7,6 +7,15 @@ const keyframes = { '75%': { transform: 'translate(-2px, 0px) rotate(3deg)' }, '100%': { transform: 'translate(0px, 2px) rotate(0deg)' }, }, + // Moodal + 'expand-in': { + '0%': { transform: 'scale(0.9)' }, + '100%': { transform: 'scale(1)' }, + }, + 'contract-out': { + '0%': { transform: 'scale(1)' }, + '100%': { transform: 'scale(0.9)' }, + }, // Dropdown menu 'scale-in': { '0%': { opacity: 0, transform: 'scale(0)' }, diff --git a/packages/i18n/locales/bad/translation.json b/packages/i18n/locales/bad/translation.json index dd41011d8..1560acd1f 100644 --- a/packages/i18n/locales/bad/translation.json +++ b/packages/i18n/locales/bad/translation.json @@ -875,7 +875,7 @@ "configureWalletModalExplanation": "bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad", "connectedTo": "bad bad bad", "copiedAddressToClipboard": "bad bad bad bad", - "copiedDaoChainAddress": "bad bad bad", + "copiedChainAddress": "bad bad bad", "copiedLinkToClipboard": "bad bad bad bad", "copiedToClipboard": "bad bad bad", "copyWalletAddressTooltip": "bad bad bad", diff --git a/packages/i18n/locales/dog/translation.json b/packages/i18n/locales/dog/translation.json index 5ea8481b6..ad8c0cfae 100644 --- a/packages/i18n/locales/dog/translation.json +++ b/packages/i18n/locales/dog/translation.json @@ -273,7 +273,7 @@ "configureWalletModalExplanation": "u hav keplr installd, but it dont seem lyke uv set oop a wallit. 2 continue, oopen da keplr extenshun n set oop a wallit. 2 oopen da keplr extenshun,press da puzzul icon in da top rite ov ur browzer n den press da keplr buttun. wunce uv dun dat, a new pag will oopen wer ull be abbl 2 create a new accoont. configur ur wallit 2 continue", "considerReturningHome": "considar retorning homm", "copiedAddressToClipboard": "copy adress 2 clipboar", - "copiedDaoChainAddress": "coppied {{chain}} addres", + "copiedChainAddress": "coppied {{chain}} addres", "copiedLinkToClipboard": "coopied link 2 clibpoard", "copiedToClipboard": "coopied 2 clipboar", "copyWalletAddressTooltip": "copy wallit adress", diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index f3000d55f..6784bf135 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -46,6 +46,7 @@ "addAllowance": "Add allowance", "addAnotherAction": "Add another {{action}} action", "addAttribute": "Add attribute", + "addChains": "Add chains", "addCollection": "Add collection", "addMember": "Add a member", "addMembers": "Add members", @@ -55,6 +56,7 @@ "addStep": "Add step", "addTier": "Add a tier", "addToKeplr": "Add token to Keplr", + "addToProfile": "Add to profile", "addToken": "Add token", "addUpdateWidget": "Add/update widget", "addVestingManagerSetupAction": "Add vesting manager setup action", @@ -154,6 +156,7 @@ "manageStake": "Manage your ${{tokenSymbol}} stake", "manageStaking": "Manage staking", "manageYourStake": "Manage your stake", + "mergeProfiles": "Merge profiles", "metadataUploaded": "Metadata uploaded", "migrate": "Migrate", "more": "More", @@ -254,7 +257,8 @@ "viewProposals": "View proposals", "withDecodedModuleMessages": "with Decoded Module Messages", "withdrawAvailableBalance": "Withdraw available balance", - "withdrawFiat": "Withdraw fiat" + "withdrawFiat": "Withdraw fiat", + "yourProfile": "Your profile" }, "daoCreator": { "MembershipBased": { @@ -388,8 +392,10 @@ "enterAtLeastTwoAccounts": "Enter at least two accounts.", "errorOccurredOnPage": "An error occurred on this page.", "failedParsingCoreVersion": "Failed to determine core version.", + "failedToConnect": "Failed to connect.", "failedToFindGovernanceProposal": "Failed to find governance proposal with ID {{id}}.", "failedToFindMatchingProposalModule": "Failed to find matching proposal module.", + "failedToGetAccountFromWallet": "Failed to get account from wallet.", "failedToGetFactoryTokenInfo": "Failed to get factory token info. Please enter a valid factory denom.", "failedToGetTokenInfo": "Failed to get token info. Please enter a valid {{tokenType}} contract address.", "failedToLoadWidget": "Failed to load widget.", @@ -497,10 +503,14 @@ "treasuryNoTokensCannotStake": "The treasury has no ${{tokenSymbol}}, so you can't stake any tokens.", "txNotFound": "Transaction not found.", "unexpectedError": "An unexpected error occurred.", + "unexpectedlyMissingChains": "Unexpectedly missing chains: {{chains}}. Please contact support.", "unknownDenom": "Unknown denomination {{denom}}.", "unknownError": "An unknown error occurred.", "unknownInboxType": "Unknown inbox item type.", - "unsupportedApprovalFailedRender": "Failed to render approval proposal. Unsupported module." + "unsupportedApprovalFailedRender": "Failed to render approval proposal. Unsupported module.", + "unsupportedChains_one": "Unsupported chain: {{chains}}.", + "unsupportedChains_other": "Unsupported chains: {{chains}}.", + "unsupportedWallet": "Unsupported wallet. Please use a different wallet." }, "form": { "addAnImage": "Add an image", @@ -616,7 +626,7 @@ "ibcTimeoutTooltip_blocks": "In rare cases, an IBC transaction may fail to relay to the destination chain. A timeout is required to prevent failed transactions from retrying forever and unexpectedly executing in the future. A good timeout is probably a few days to a week after execution. Since passing a proposal takes time, make sure this timeout is long enough to cover the entire voting period. This DAO uses a block height-based voting period, so the timeout cannot be added automatically.", "ibcTimeoutTooltip_created": "In rare cases, an IBC transaction may fail to relay to the destination chain. A timeout is required to prevent failed transactions from retrying forever and unexpectedly executing in the future. A good timeout is probably a few days to a week after execution.", "image": "Image", - "imageUrlTooltip": "A link to an image. For example: https://moonphase.is/image.svg", + "imageUrlTooltip": "A link to an image.", "initialDeposit": "Initial deposit", "initialSupply": "Total token supply", "instantiatedAddress": "Instantiated address", @@ -844,10 +854,15 @@ "activeThresholdDescription": "The amount of voting power that needs to be staked in order for the DAO to become active and thus allow proposals to be created.", "addCw20ToTreasuryActionDescription": "Display the DAO's balance of a CW20 token in the treasury view.", "addCw721ToTreasuryActionDescription": "Display the NFTs owned by the DAO from a CW721 NFT collection in the treasury view.", + "addToProfileExplanation": "Add the current wallet to your profile shown below.", + "addWalletToProfile": "Add this wallet to your profile.", + "addWalletToProfileToEdit": "You cannot edit your profile until you add this wallet. Click to add it.", "addedToDaoFollowPrompt": "You were added as a member to this DAO. Follow it to receive updates.", "advancedVotingConfigWarning": "These are advanced features. If you configure them without fully understanding how they work, you can lock your DAO, making it impossible for proposals to pass.", "allChains": "All chains", "allCrossChainAccountsCreated": "All available cross-chain accounts have been created. If you want to request support for other chains, please reach out to us on Discord.", + "allNftSupportedChainsAddedPrompt": "NFTs loaded from all DAO DAO-supported chains.", + "allNftSupportedChainsAddedPromptTooltip": "You have added all chains that DAO DAO supports to your profile.", "amountWillBeReceived": "Amount that will be received", "andNumMore": "and {{count}} more", "anyone": "Anyone", @@ -881,7 +896,8 @@ "bypassSimulationExplanation": "Simulating the proposal failed. If you don't know what this means, one of the actions above is probably misconfigured. If you are sure you want to publish it anyway, click the button again.", "cannotRemoveNoneOption": "You cannot remove this option. It will be added to the end of the list.", "catchingUp": "Catching up...", - "chooseProfilePictureSubtitle": "Use an NFT you own on any of DAO DAO's supported chains to represent your identity, or upload a new one.", + "chainTokensNotShowingUpPrompt": "Are your tokens not showing up? Add more chains.", + "chooseProfilePictureSubtitle": "Use an NFT you own to represent your identity, or upload an image.", "chooseTokenToPayWith": "Choose token to pay with", "claimToReceiveUnstaked": "Claim them to receive your unstaked tokens.", "claimedRewards": "Claimed rewards", @@ -895,7 +911,7 @@ "configureWalletModalExplanation": "You have a wallet extension installed, but it doesn't seem like you've set up a wallet. Create a wallet to continue.", "connectedTo": "Connected to {{name}}", "copiedAddressToClipboard": "Copy address to clipboard", - "copiedDaoChainAddress": "Copied {{chain}} address", + "copiedChainAddress": "Copied {{chain}} address.", "copiedLinkToClipboard": "Copied link to clipboard.", "copiedToClipboard": "Copied to clipboard.", "copyWalletAddressTooltip": "Copy wallet address", @@ -1033,6 +1049,8 @@ "membershipDaoNotMemberInfo_dao": "You are not a member of {{daoName}}. To become a member, existing members must vote to add you.", "membershipDaoNotMemberInfo_proposal": "You were not a member of {{daoName}} when this proposal was created, so you cannot vote on it.", "memoPlaceholder": "Enter a memo (optional)...", + "mergeProfilesExplanation": "Select the profile you want to keep (the rest will be merged into it).", + "mergeProfilesTooltip": "Your wallet is attached to multiple profiles. Merge them to avoid confusion.", "migrateFollowingDescription": "Followed DAOs require a migration to a new storage mechanism.", "migrateSmartContractActionDescription": "Migrate a CosmWasm contract to a new code ID.", "minimumOutputRequiredDescription_dao": "Before the proposal is passed and executed, the swap price will fluctuate. If the price drops and no longer satisfies this minimum output required, the swap will not occur.", @@ -1057,6 +1075,8 @@ "noCompletedCyclesYet": "No completed cycles yet.", "noDaosFollowedYet": "You have not yet followed any DAOs.", "noDisplayName": "no display name", + "noDisplayNameTooltip": "Set a display name on your profile page.", + "noEditUntilProfileMerge": "Your wallet is attached to multiple profiles. You cannot edit your profile until they are merged. Click to merge them.", "noFeaturedDaosYet": "There are no featured DAOs yet.", "noFundsDuringInstantiation": "No funds will be transferred during instantiation.", "noGovernanceProposalsNeedDeposit": "There are no governance proposals that need deposits.", @@ -1238,6 +1258,9 @@ "submitGovernanceProposalDescription": "Submit a proposal to chain governance.", "submitUpgradeProposal": "Submit a proposal to upgrade the DAO?", "submitted": "Submitted", + "supportedChainDaosNotShowingUpPrompt": "Are your DAOs not showing up? Add other DAO DAO-supported chains.", + "supportedChainNftsNotShowingUpPrompt": "Find NFTs on other DAO DAO-supported chains", + "supportedChainNftsNotShowingUpPromptTooltip": "You have not added all chains that DAO DAO supports to your profile. Add them to find more NFTs to use as your profile picture.", "supportsMarkdown": "Supports Markdown", "testnet": "Testnet", "tierMemberGovTokenAllocationTooltip": "This member will receive {{tokens}} ${{tokenSymbol}} when the DAO is created.", @@ -1400,6 +1423,7 @@ "yes": "Yes" }, "success": { + "addedChainsToProfile": "Chains added to profile.", "addedToken": "Added token to Keplr.", "claimedRewards": "Claimed rewards.", "compensationCycleCompleted": "Compensation cycle completed. Redirecting to proposal...", @@ -1412,6 +1436,7 @@ "depositedTokenIntoDao": "Deposited {{amount}} ${{tokenSymbol}} into the {{daoName}} treasury.", "discordNotifierEnabled": "Discord notifier setup successfully. Your notifier list will be updated shortly.", "discordNotifierRemoved": "Discord notifier removed. Your notifier list will be updated shortly.", + "mergedProfiles": "Merged profiles successfully.", "multisigImported": "Import successful. Review your new DAO's configuration, and make sure to set an image, name, and description.", "nftCollectionContractInstantiated": "NFT collection created successfully.", "nominationSubmitted": "Contributor nominated for this compensation cycle.", @@ -1445,6 +1470,7 @@ "activeThreshold": "Active threshold", "addCw20ToTreasury": "Display Token Balance in Treasury", "addCw721ToTreasury": "Display NFT Collection in Treasury", + "addToProfile": "Add to Profile", "advancedConfiguration": "Advanced configuration", "all": "All", "allNfts": "All NFTs", @@ -1609,6 +1635,7 @@ "memberOfDao": "Member of {{daoName}}", "members": "Members", "membership": "Membership", + "mergeProfiles": "Merge Profiles", "migrateFollowing": "Migrate Followed DAOs", "migrateSmartContract": "Migrate Smart Contract", "minimumOutputRequired": "Minimum output required", @@ -1816,6 +1843,7 @@ "votingTimeLeft": "Voting time left", "votingVaults": "Voting Vaults", "votingWeight": "Voting weight", + "wallet": "Wallet", "walletConnect": "WalletConnect", "watchOut": "Watch out!", "website": "Website", diff --git a/packages/state/index.ts b/packages/state/index.ts index 3521aa10b..3af884ad4 100644 --- a/packages/state/index.ts +++ b/packages/state/index.ts @@ -2,5 +2,4 @@ export * from './contracts' export * from './graphql' export * from './indexer' export * from './recoil' -export * from './skip' export * from './utils' diff --git a/packages/state/package.json b/packages/state/package.json index 27a1301e9..a6aef34da 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -16,7 +16,6 @@ "@cosmjs/proto-signing": "^0.32.1", "@cosmjs/stargate": "^0.32.1", "@dao-dao/utils": "2.2.0", - "@skip-router/core": "^1.1.3", "graphql": "^16.8.1", "json5": "^2.2.0", "lodash.uniq": "^4.5.0", diff --git a/packages/state/recoil/atoms/misc.ts b/packages/state/recoil/atoms/misc.ts index 9fb99b7a0..6a74ad8c5 100644 --- a/packages/state/recoil/atoms/misc.ts +++ b/packages/state/recoil/atoms/misc.ts @@ -35,6 +35,11 @@ export const updateProfileNftVisibleAtom = atom({ default: false, }) +export const mergeProfilesVisibleAtom = atom({ + key: 'mergeProfilesVisible', + default: false, +}) + export const web3AuthPromptAtom = atom({ key: 'web3AuthPrompt', default: undefined, diff --git a/packages/state/recoil/atoms/refresh.ts b/packages/state/recoil/atoms/refresh.ts index 607976c71..a743ede53 100644 --- a/packages/state/recoil/atoms/refresh.ts +++ b/packages/state/recoil/atoms/refresh.ts @@ -50,7 +50,8 @@ export const refreshWalletStargazeNftsAtom = atomFamily({ default: 0, }) -// Change this to refresh the profile for a wallet. +// Change this to refresh the profile for a wallet. The argument is the address' +// bech32 data hash. export const refreshWalletProfileAtom = atomFamily({ key: 'refreshWalletProfile', default: 0, diff --git a/packages/state/recoil/selectors/profile.ts b/packages/state/recoil/selectors/profile.ts index e64375778..d80b3f7a0 100644 --- a/packages/state/recoil/selectors/profile.ts +++ b/packages/state/recoil/selectors/profile.ts @@ -1,12 +1,12 @@ import { selectorFamily, waitForAll } from 'recoil' -import { ProfileSearchHit, WithChainId } from '@dao-dao/types' -import { PFPK_API_BASE, getChainForChainId, processError } from '@dao-dao/utils' +import { ResolvedProfile, WithChainId } from '@dao-dao/types' +import { PFPK_API_BASE, processError, toBech32Hash } from '@dao-dao/utils' import { refreshWalletProfileAtom } from '../atoms/refresh' export const searchProfilesByNamePrefixSelector = selectorFamily< - ProfileSearchHit[], + ResolvedProfile[], WithChainId<{ namePrefix: string }> >({ key: 'searchProfilesByNamePrefix', @@ -17,18 +17,17 @@ export const searchProfilesByNamePrefixSelector = selectorFamily< return [] } - // Load hits from PFPK API. - let hits: ProfileSearchHit[] = [] + // Load profiles from PFPK API. + let profiles: ResolvedProfile[] = [] try { const response = await fetch( - PFPK_API_BASE + - `/search/${getChainForChainId(chainId).bech32_prefix}/${namePrefix}` + PFPK_API_BASE + `/search/${chainId}/${namePrefix}` ) if (response.ok) { - const { profiles: _hits } = (await response.json()) as { - profiles: ProfileSearchHit[] + const { profiles: _profiles } = (await response.json()) as { + profiles: ResolvedProfile[] } - hits = _hits + profiles = _profiles } else { console.error(await response.json()) } @@ -37,12 +36,16 @@ export const searchProfilesByNamePrefixSelector = selectorFamily< } // Add refresher dependencies. - if (hits.length > 0) { + if (profiles.length > 0) { get( - waitForAll(hits.map((hit) => refreshWalletProfileAtom(hit.address))) + waitForAll( + profiles.map((hit) => + refreshWalletProfileAtom(toBech32Hash(hit.address)) + ) + ) ) } - return hits + return profiles }, }) diff --git a/packages/state/recoil/selectors/skip.ts b/packages/state/recoil/selectors/skip.ts index d97d717ac..5f7c44210 100644 --- a/packages/state/recoil/selectors/skip.ts +++ b/packages/state/recoil/selectors/skip.ts @@ -1,29 +1,31 @@ -import { - Asset, - AssetRecommendation, - MultiChainMsg, - Asset as SkipAsset, - Chain as SkipChain, - RouteResponse as SkipRoute, -} from '@skip-router/core' -import { selector, selectorFamily, waitForAll } from 'recoil' +import { selectorFamily, waitForAll } from 'recoil' -import { GenericToken, TokenType } from '@dao-dao/types' +import { + GenericToken, + SkipAsset, + SkipAssetRecommendation, + SkipChain, + SkipMultiChainMsg, + SkipRoute, + TokenType, +} from '@dao-dao/types' +import { SKIP_API_BASE } from '@dao-dao/utils' -import { skipClient } from '../../skip' import { querySnapperSelector } from './indexer' -export const skipChainsSelector = selector({ - key: 'skipChains', - get: async () => await skipClient.chains(), -}) - export const skipChainSelector = selectorFamily({ key: 'skipChain', get: (chainId) => ({ get }) => - get(skipChainsSelector).find((chain) => chain.chainID === chainId), + get( + querySnapperSelector({ + query: 'skip-chain', + parameters: { + chainId, + }, + }) + ), }) /** @@ -55,7 +57,7 @@ export const skipChainPfmEnabledSelector = selectorFamily({ (chainId) => ({ get }) => { const chain = get(skipChainSelector(chainId)) - return chain?.pfmEnabled || false + return chain?.ibc_capabilities?.cosmos_pfm ?? chain?.pfm_enabled ?? false }, }) @@ -78,7 +80,7 @@ export const skipAllChainsPfmEnabledSelector = selectorFamily< }) export const skipRecommendedAssetsSelector = selectorFamily< - AssetRecommendation[], + SkipAssetRecommendation[], { fromChainId: string denom: string @@ -88,30 +90,21 @@ export const skipRecommendedAssetsSelector = selectorFamily< key: 'skipRecommendedAssets', get: ({ fromChainId, denom, toChainId }) => - async () => { - try { - return await skipClient.recommendAssets({ - sourceAssetChainID: fromChainId, - sourceAssetDenom: denom, - destChainID: toChainId, + ({ get }) => + get( + querySnapperSelector({ + query: 'skip-recommended-assets', + parameters: { + sourceAssetChainId: fromChainId, + sourceAssetDenom: denom, + destChainId: toChainId, + }, }) - } catch (err) { - if ( - err instanceof Error && - (err.message.toLowerCase().includes('not found') || - err.message.includes('no recommendation found')) - ) { - return [] - } - - // Rethrow other errors. - throw err - } - }, + ), }) export const skipRecommendedAssetSelector = selectorFamily< - AssetRecommendation | undefined, + SkipAssetRecommendation | undefined, { fromChainId: string denom: string @@ -169,15 +162,23 @@ export const skipRouteSelector = selectorFamily< throw new Error('No recommended asset found.') } - const route = await skipClient.route({ - sourceAssetChainID: fromChainId, - sourceAssetDenom: sourceDenom, - destAssetChainID: toChainId, - destAssetDenom: asset.denom, - amountIn: BigInt(amountIn).toString(), - }) + const route: SkipRoute = await ( + await fetch(SKIP_API_BASE + '/v2/fungible/route', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + source_asset_chain_id: fromChainId, + source_asset_denom: sourceDenom, + dest_asset_chain_id: toChainId, + dest_asset_denom: asset.denom, + amount_in: BigInt(amountIn).toString(), + }), + }) + ).json() - if (route.doesSwap) { + if (route.does_swap) { throw new Error('Route requires a swap.') } @@ -189,7 +190,7 @@ export const skipRouteSelector = selectorFamily< // be executed to move funds between the two chains using the chain addresses as // the source or intermediate addresses. export const skipRouteMessageSelector = selectorFamily< - MultiChainMsg, + SkipMultiChainMsg, { // Map chain ID to address on that chain that can serve as the source or // intermediate address for transfers. @@ -223,7 +224,7 @@ export const skipRouteMessageSelector = selectorFamily< ) const addressList = [ - ...route.chainIDs + ...route.chain_ids .slice(0, -1) .map((chainId) => chainAddresses[chainId]), toAddress, @@ -231,27 +232,51 @@ export const skipRouteMessageSelector = selectorFamily< if (!addressList.every(Boolean)) { throw new Error( `Missing accounts for chain(s): ${addressList - .flatMap((address, index) => (address ? [] : route.chainIDs[index])) + .flatMap((address, index) => + address ? [] : route.chain_ids[index] + ) .join(', ')}.` ) } - const msgs = await skipClient.messages({ - ...route, - addressList: addressList as string[], - slippageTolerancePercent: '0', - }) + const { + msgs, + }: { + msgs: { + multi_chain_msg: SkipMultiChainMsg + }[] + } = await ( + await fetch(SKIP_API_BASE + '/v2/fungible/msgs', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + source_asset_chain_id: route.source_asset_chain_id, + source_asset_denom: route.source_asset_denom, + dest_asset_chain_id: route.dest_asset_chain_id, + dest_asset_denom: route.dest_asset_denom, + amount_in: route.amount_in, + amount_out: route.amount_out, + operations: route.operations, + estimated_amount_out: route.estimated_amount_out, + + addressList: addressList as string[], + slippage_tolerance_percent: '0', + }), + }) + ).json() if (msgs.length !== 1) { throw new Error('Route requires multiple messages.') } const msg = msgs[0] - if (!('multiChainMsg' in msg)) { + if (!('multi_chain_msg' in msg)) { throw new Error('Route requires invalid message type.') } - return msg.multiChainMsg + return msg.multi_chain_msg }, }) @@ -259,7 +284,7 @@ export const skipRouteMessageSelector = selectorFamily< * Get the recommended asset for a token on a given chain. */ export const skipRecommendedAssetForGenericTokenSelector = selectorFamily< - Asset | undefined, + SkipAsset | undefined, Pick & { sourceChainId: string targetChainId: string diff --git a/packages/state/recoil/selectors/token.ts b/packages/state/recoil/selectors/token.ts index 1861e7827..b24bad9c6 100644 --- a/packages/state/recoil/selectors/token.ts +++ b/packages/state/recoil/selectors/token.ts @@ -71,14 +71,14 @@ export const genericTokenSelector = selectorFamily< if (skipAsset) { return { - chainId: skipAsset.chainID, - type: skipAsset.isCW20 ? TokenType.Cw20 : TokenType.Native, + chainId: skipAsset.chain_id, + type: skipAsset.is_cw20 ? TokenType.Cw20 : TokenType.Native, denomOrAddress: - (skipAsset.isCW20 && skipAsset.tokenContract) || skipAsset.denom, + (skipAsset.is_cw20 && skipAsset.token_contract) || skipAsset.denom, symbol: - skipAsset.recommendedSymbol || skipAsset.symbol || skipAsset.denom, + skipAsset.recommended_symbol || skipAsset.symbol || skipAsset.denom, decimals: skipAsset.decimals || 0, - imageUrl: skipAsset.logoURI || getFallbackImage(denomOrAddress), + imageUrl: skipAsset.logo_uri || getFallbackImage(denomOrAddress), source, } } else if (source.chainId !== chainId) { @@ -93,12 +93,12 @@ export const genericTokenSelector = selectorFamily< type, denomOrAddress, symbol: - skipSourceAsset.recommendedSymbol || + skipSourceAsset.recommended_symbol || skipSourceAsset.symbol || skipSourceAsset.denom, decimals: skipSourceAsset.decimals || 0, imageUrl: - skipSourceAsset.logoURI || getFallbackImage(denomOrAddress), + skipSourceAsset.logo_uri || getFallbackImage(denomOrAddress), source, } } @@ -202,14 +202,14 @@ export const coinGeckoUsdPriceSelector = selectorFamily< // Resolve Skip asset to retrieve coingecko ID. const asset = get(skipAssetSelector(params)) - if (!asset?.coingeckoID) { + if (!asset?.coingecko_id) { return } const usdPrice: number | undefined = get( querySnapperSelector({ query: 'coingecko-price', parameters: { - id: asset.coingeckoID, + id: asset.coingecko_id, }, }) ) @@ -582,16 +582,16 @@ export const genericTokenSourceSelector = selectorFamily< ) if (skipAsset) { - const sourceType = skipAsset.originDenom.startsWith('cw20:') + const sourceType = skipAsset.origin_denom.startsWith('cw20:') ? TokenType.Cw20 : TokenType.Native return { - chainId: skipAsset.originChainID, + chainId: skipAsset.origin_chain_id, type: sourceType, denomOrAddress: sourceType === TokenType.Cw20 - ? skipAsset.originDenom.replace(/^cw20:/, '') - : skipAsset.originDenom, + ? skipAsset.origin_denom.replace(/^cw20:/, '') + : skipAsset.origin_denom, } } @@ -673,7 +673,7 @@ export const historicalUsdPriceSelector = selectorFamily< }) ) - if (!asset?.coingeckoID) { + if (!asset?.coingecko_id) { return } @@ -682,7 +682,7 @@ export const historicalUsdPriceSelector = selectorFamily< querySnapperSelector({ query: 'coingecko-price-history', parameters: { - id: asset.coingeckoID, + id: asset.coingecko_id, range, }, }) diff --git a/packages/state/skip/client.ts b/packages/state/skip/client.ts deleted file mode 100644 index 63defb26b..000000000 --- a/packages/state/skip/client.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { SKIP_API_URL, SkipRouter } from '@skip-router/core' - -export const skipClient = new SkipRouter({ - apiURL: SKIP_API_URL, -}) diff --git a/packages/state/skip/index.ts b/packages/state/skip/index.ts deleted file mode 100644 index 83dae7638..000000000 --- a/packages/state/skip/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './client' diff --git a/packages/stateful/actions/core/treasury/Spend/Component.tsx b/packages/stateful/actions/core/treasury/Spend/Component.tsx index cfc5e211c..24405d64e 100644 --- a/packages/stateful/actions/core/treasury/Spend/Component.tsx +++ b/packages/stateful/actions/core/treasury/Spend/Component.tsx @@ -2,7 +2,6 @@ import { ArrowRightAltRounded, SubdirectoryArrowRightRounded, } from '@mui/icons-material' -import { MultiChainMsg } from '@skip-router/core' import clsx from 'clsx' import { ComponentType, RefAttributes, useCallback, useEffect } from 'react' import { useFormContext } from 'react-hook-form' @@ -37,6 +36,7 @@ import { GenericTokenBalanceWithOwner, LoadingData, LoadingDataWithError, + SkipMultiChainMsg, TokenType, } from '@dao-dao/types' import { @@ -86,7 +86,7 @@ export interface SpendData { _error?: string // Defined once loaded for IBC transfers. Needed for transforming. - _skipIbcTransferMsg?: LoadingDataWithError + _skipIbcTransferMsg?: LoadingDataWithError // Loaded from IBC transfer message on decode. _ibcData?: { @@ -198,10 +198,12 @@ export const SpendComponent: ActionComponent = ({ // Convert wallet address to destination chain's format. if (currentEntity.type === EntityType.Wallet) { - newRecipient = transformBech32Address( - currentEntity.address, - toChain.chain_id - ) + newRecipient = + // Use profile address if set, falling back to transforming the address + // (which is unreliable due to different chains using different HD + // paths). + currentEntity.profile?.chains[toChain.chain_id]?.address || + transformBech32Address(currentEntity.address, toChain.chain_id) } // Get DAO core address or its corresponding polytone proxy. Clear if no // account on the destination chain. @@ -789,6 +791,10 @@ const NobleTariff = ({ ? Math.min(Number((amount * feeDecimal).toFixed(decimals)), maxFee) : 0 + if (fee === 0) { + return null + } + return (

{t('info.nobleTariffApplied', { diff --git a/packages/stateful/actions/core/treasury/Spend/index.tsx b/packages/stateful/actions/core/treasury/Spend/index.tsx index 671ae58d1..566a08206 100644 --- a/packages/stateful/actions/core/treasury/Spend/index.tsx +++ b/packages/stateful/actions/core/treasury/Spend/index.tsx @@ -298,13 +298,13 @@ const Component: ActionComponent = (props) => { skipRoute.loading || skipRoute.errored || // Cannot use skip route if more than one TX is required. - skipRoute.data.txsRequired > 1 + skipRoute.data.txs_required > 1 ? undefined : accountsSelector({ chainId: currentChainId, address, // Only need ICA for intermediate accounts. - includeIcaChains: skipRoute.data.chainIDs.slice(1, -1), + includeIcaChains: skipRoute.data.chain_ids.slice(1, -1), }) ) // Get account for each skip route chain. @@ -312,18 +312,19 @@ const Component: ActionComponent = (props) => { skipRoute.loading || skipRoute.errored || // Cannot use skip route if more than one TX is required. - skipRoute.data.txsRequired > 1 || + skipRoute.data.txs_required > 1 || accounts.loading || accounts.errored ? undefined - : skipRoute.data.chainIDs.slice(0, -1).map((chainId, index) => + : skipRoute.data.chain_ids.slice(0, -1).map((chainId, index) => // For source, use from address. This should always match the first // chain ID. index === 0 ? from - : // Transform bech32 wallet address to chain. + : // Use profile address if set, falling back to transforming the address (which is unreliable due to different chains using different HD paths). context.type === ActionContextType.Wallet - ? transformBech32Address(address, chainId) + ? context.profile?.chains[chainId]?.address || + transformBech32Address(address, chainId) : // Otherwise try to find an account (DAOs and gov). getAccountAddress({ accounts: accounts.data, @@ -340,7 +341,7 @@ const Component: ActionComponent = (props) => { !routeAddresses || skipRoute.loading || skipRoute.errored ? undefined : routeAddresses.flatMap((address, index) => - address ? [] : [skipRoute.data.chainIDs[index]] + address ? [] : [skipRoute.data.chain_ids[index]] ) // Load Skip route message if IBC transfer. @@ -352,7 +353,7 @@ const Component: ActionComponent = (props) => { !skipRoute.loading && !skipRoute.errored && // Can only use skip route if only one TX is required. - skipRoute.data.txsRequired === 1 && + skipRoute.data.txs_required === 1 && routeAddresses && missingAccountChainIds && missingAccountChainIds.length === 0 && @@ -361,7 +362,7 @@ const Component: ActionComponent = (props) => { chainAddresses: routeAddresses.reduce( (acc, address, index) => ({ ...acc, - [skipRoute.data.chainIDs[index]]: address, + [skipRoute.data.chain_ids[index]]: address, }), {} as Record ), @@ -386,7 +387,7 @@ const Component: ActionComponent = (props) => { !skipRoute.loading && !skipRoute.errored && // Can only use skip route if only one TX is required. - skipRoute.data.txsRequired === 1 && + skipRoute.data.txs_required === 1 && // Only use skip IBC path if loads message successfully. !skipRouteMessageLoading.loading && !skipRouteMessageLoading.errored @@ -394,7 +395,7 @@ const Component: ActionComponent = (props) => { loading: false, errored: false, updating: skipRoute.updating, - data: skipRoute.data.chainIDs, + data: skipRoute.data.chain_ids, } : !props.isCreating && pfmChainPath?.length ? { @@ -432,7 +433,7 @@ const Component: ActionComponent = (props) => { errored: false, updating: skipRoute.updating, data: convertMicroDenomToDenomWithDecimals( - skipRoute.data.amountOut, + skipRoute.data.amount_out, selectedToken.token.decimals ), } @@ -527,9 +528,9 @@ const Component: ActionComponent = (props) => { : { loading: false, data: - skipRoute.data.txsRequired === 1 + skipRoute.data.txs_required === 1 ? undefined - : skipRoute.data.chainIDs, + : skipRoute.data.chain_ids, }, missingAccountChainIds, nobleTariff, @@ -695,11 +696,11 @@ const useTransformToCosmos: UseTransformToCosmos = () => { }) } else { if ( - _skipIbcTransferMsg.data.msgTypeURL !== MsgTransfer.typeUrl && - _skipIbcTransferMsg.data.msgTypeURL !== NeutronMsgTransfer.typeUrl + _skipIbcTransferMsg.data.msg_type_url !== MsgTransfer.typeUrl && + _skipIbcTransferMsg.data.msg_type_url !== NeutronMsgTransfer.typeUrl ) { throw new Error( - `Unexpected Skip transfer message type: ${_skipIbcTransferMsg.data.msgTypeURL}` + `Unexpected Skip transfer message type: ${_skipIbcTransferMsg.data.msg_type_url}` ) } diff --git a/packages/stateful/actions/react/provider.tsx b/packages/stateful/actions/react/provider.tsx index c7481b708..2367907ef 100644 --- a/packages/stateful/actions/react/provider.tsx +++ b/packages/stateful/actions/react/provider.tsx @@ -22,6 +22,7 @@ import { IActionsContext, } from '@dao-dao/types' +import { useProfile } from '../../hooks' import { useWallet } from '../../hooks/useWallet' import { matchAndLoadCommon } from '../../proposal-module-adapter' import { useVotingModuleAdapter } from '../../voting-module-adapter' @@ -200,7 +201,9 @@ export const WalletActionsProvider = ({ const address = overrideAddress || connectedAddress - if (!address) { + const { profile } = useProfile({ address }) + + if (!address || profile.loading) { return } @@ -209,6 +212,7 @@ export const WalletActionsProvider = ({ address={address} context={{ type: ActionContextType.Wallet, + profile: profile.data, }} > {children} diff --git a/packages/stateful/command/contexts/generic/dao.tsx b/packages/stateful/command/contexts/generic/dao.tsx index 8e4f28044..1969ea4c3 100644 --- a/packages/stateful/command/contexts/generic/dao.tsx +++ b/packages/stateful/command/contexts/generic/dao.tsx @@ -138,7 +138,7 @@ export const makeGenericDaoContext: CommandModalContextMaker<{ ...accounts.map(({ chainId, address }) => ({ name: copied === chainId - ? t('info.copiedDaoChainAddress', { + ? t('info.copiedChainAddress', { chain: getDisplayNameForChainId(chainId), }) : t('button.copyDaoChainAddress', { diff --git a/packages/stateful/components/DappLayout.tsx b/packages/stateful/components/DappLayout.tsx index a2af59ea2..de06c887a 100644 --- a/packages/stateful/components/DappLayout.tsx +++ b/packages/stateful/components/DappLayout.tsx @@ -26,7 +26,7 @@ import { import { getSupportedChains, maybeGetChainForChainId } from '@dao-dao/utils' import { CommandModal } from '../command' -import { useAutoRefreshData, useWallet, useWalletInfo } from '../hooks' +import { useAutoRefreshData, useProfile, useWallet } from '../hooks' import { daoCreatedCardPropsAtom, followingDaoDropdownInfosSelector, @@ -79,7 +79,6 @@ export const DappLayout = ({ children }: { children: ReactNode }) => { } const { openView, isWalletConnected } = useWallet() - const { walletHexPublicKey } = useWalletInfo() //! COMMAND MODAL // Hide modal when we nav away. @@ -128,13 +127,16 @@ export const DappLayout = ({ children }: { children: ReactNode }) => { useAutoRefreshData() //! Following DAOs + const { chains } = useProfile({ + onlySupported: true, + }) const followingDaoDropdownInfos = useCachedLoading( - walletHexPublicKey + !chains.loading ? waitForAll( - getSupportedChains().map(({ chain }) => + chains.data.map(({ chainId, publicKey }) => followingDaoDropdownInfosSelector({ - chainId: chain.chain_id, - walletPublicKey: walletHexPublicKey, + chainId, + walletPublicKey: publicKey, // If not compact, remove any SubDAO from the top level that // exists as a SubDAO of another followed DAO at the top level. // When compact, SubDAOs aren't visible, so we should show diff --git a/packages/stateful/components/NavWallet.tsx b/packages/stateful/components/NavWallet.tsx index d839f3629..0c94630bc 100644 --- a/packages/stateful/components/NavWallet.tsx +++ b/packages/stateful/components/NavWallet.tsx @@ -1,19 +1,21 @@ import { useSetRecoilState } from 'recoil' -import { updateProfileNftVisibleAtom } from '@dao-dao/state' +import { mergeProfilesVisibleAtom } from '@dao-dao/state' import { NavWallet as StatelessNavWallet } from '@dao-dao/stateless' import { StatefulNavWalletProps } from '@dao-dao/types' -import { useInboxApiWithUi, useWallet, useWalletInfo } from '../hooks' +import { useInboxApiWithUi, useManageProfile, useWallet } from '../hooks' +import { ButtonLink } from './ButtonLink' import { InboxMainItemRenderer } from './inbox' import { SuspenseLoader } from './SuspenseLoader' export const NavWallet = (props: StatefulNavWalletProps) => { const { openView, isWalletConnected, address, wallet, disconnect } = useWallet() - const { walletProfileData, updateProfileName } = useWalletInfo() - const setUpdateProfileNftVisible = useSetRecoilState( - updateProfileNftVisibleAtom + const { profile, otherProfiles } = useManageProfile() + + const setMergeProfilesModalVisible = useSetRecoilState( + mergeProfilesVisibleAtom ) // Ignore errors loading inbox because the SDA does not have an inbox. @@ -33,15 +35,15 @@ export const NavWallet = (props: StatefulNavWalletProps) => { > {isWalletConnected && address && wallet ? ( setUpdateProfileNftVisible(true)} - updateProfileName={updateProfileName} + onMergeProfiles={() => setMergeProfilesModalVisible(true)} + otherProfilesExist={otherProfiles.length > 0} + profile={profile} wallet={wallet} - walletAddress={address} - walletProfileData={walletProfileData} {...props} /> ) : ( diff --git a/packages/stateful/components/PfpkNftSelectionModal.tsx b/packages/stateful/components/PfpkNftSelectionModal.tsx index ee760ad98..860beffd4 100644 --- a/packages/stateful/components/PfpkNftSelectionModal.tsx +++ b/packages/stateful/components/PfpkNftSelectionModal.tsx @@ -1,5 +1,5 @@ import { Image } from '@mui/icons-material' -import { useCallback, useEffect, useState } from 'react' +import { useCallback, useEffect, useRef, useState } from 'react' import { useForm } from 'react-hook-form' import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' @@ -28,18 +28,21 @@ import { getDisplayNameForChainId, getNftKey, getSupportedChainConfig, + getSupportedChains, processError, uploadNft, } from '@dao-dao/utils' import { useInstantiateAndExecute, - useSupportedChainWallets, + useManageProfile, + useProfile, useWallet, - useWalletInfo, + useWalletBalances, } from '../hooks' import { allWalletNftsSelector } from '../recoil' import { NftSelectionModal } from './nft' +import { ProfileAddChains } from './profile' import { SuspenseLoader } from './SuspenseLoader' import { Trans } from './Trans' @@ -61,41 +64,45 @@ export const InnerPfpkNftSelectionModal = ({ attemptConnection: visible, }) - const chainWallets = useSupportedChainWallets({ - attemptConnection: visible, + const { chains } = useProfile({ + onlySupported: true, }) + const allChainsAdded = + !chains.loading && chains.data.length === getSupportedChains().length + + // Don't load NFTs until visible for the first time. This avoids having to use + // visible directly in the cached loading hook below, which causes a flicker + // on close. + const wasVisibleOnce = useRef(visible) + if (visible) { + wasVisibleOnce.current = true + } + const nfts = useCachedLoadingWithError( - // Don't load NFTs until visible. - visible && chainWallets.every(({ chainWallet: { address } }) => address) + wasVisibleOnce.current && !chains.loading ? // Load NFTs for all DAO DAO-supported chains. allWalletNftsSelector( - chainWallets.flatMap(({ chainWallet: { chain, address } }) => - address - ? { - chainId: chain.chain_id, - walletAddress: address, - } - : [] - ) + chains.data.map(({ chainId, address }) => ({ + chainId, + walletAddress: address, + })) ) : undefined ) const { - walletProfileData, - updateProfileNft, - updatingProfile, - backupImageUrl, - refreshBalances, - } = useWalletInfo() + profile, + updateProfile: { updating: updatingProfile, go: updateProfile }, + } = useManageProfile() + const { refreshBalances } = useWalletBalances() // Initialize to selected NFT. const [selectedKey, setSelectedKey] = useState( - !walletProfileData.loading && walletProfileData.profile.nft + !profile.loading && profile.data.nft ? getNftKey( - walletProfileData.profile.nft.chainId, - walletProfileData.profile.nft.collectionAddress, - walletProfileData.profile.nft.tokenId + profile.data.nft.chainId, + profile.data.nft.collectionAddress, + profile.data.nft.tokenId ) : undefined ) @@ -105,50 +112,45 @@ export const InnerPfpkNftSelectionModal = ({ : undefined // If nonce changes, set selected NFT. const [lastNonce, setLastNonce] = useState( - walletProfileData.loading ? 0 : walletProfileData.profile.nonce + profile.loading ? 0 : profile.data.nonce ) useEffect(() => { if ( - !walletProfileData.loading && - walletProfileData.profile.nft && - walletProfileData.profile.nonce > lastNonce + !profile.loading && + profile.data.nft && + profile.data.nonce > lastNonce ) { setSelectedKey( getNftKey( - walletProfileData.profile.nft.chainId, - walletProfileData.profile.nft.collectionAddress, - walletProfileData.profile.nft.tokenId + profile.data.nft.chainId, + profile.data.nft.collectionAddress, + profile.data.nft.tokenId ) ) - setLastNonce(walletProfileData.profile.nonce) + setLastNonce(profile.data.nonce) } - }, [lastNonce, walletProfileData]) + }, [lastNonce, profile]) const onAction = useCallback(async () => { - if (nfts.loading) { - toast.error(t('error.noNftsSelected')) - return - } - // Only give error about no NFTs if something should be selected. This // should never happen... - if (selectedKey && !selectedNft) { + if (nfts.loading || (selectedKey && !selectedNft)) { toast.error(t('error.noNftsSelected')) return } try { // Update NFT only. - await updateProfileNft( - selectedNft + await updateProfile({ + nft: selectedNft ? { chainId: selectedNft.chainId, collectionAddress: selectedNft.collectionAddress, tokenId: selectedNft.tokenId, } : // Clear NFT if nothing selected. - null - ) + null, + }) // Close on successful update. onClose() } catch (err) { @@ -159,7 +161,7 @@ export const InnerPfpkNftSelectionModal = ({ }) ) } - }, [nfts, selectedKey, selectedNft, t, updateProfileNft, onClose]) + }, [nfts.loading, selectedKey, selectedNft, t, updateProfile, onClose]) const [showImageSelector, setShowImageSelector] = useState(false) const { register, setValue, watch } = useForm<{ image: string }>() @@ -281,6 +283,26 @@ export const InnerPfpkNftSelectionModal = ({ title: t('title.chooseProfilePicture'), subtitle: t('info.chooseProfilePictureSubtitle'), }} + headerContent={ + chains.loading ? undefined : ( + + ) + } nfts={ isWalletError && walletErrorMessage ? { @@ -322,16 +344,19 @@ export const InnerPfpkNftSelectionModal = ({ !nfts.loading ? selectedNft ? nftCardInfosForKey[selectedNft.key]?.imageUrl - : backupImageUrl + : profile.loading + ? undefined + : profile.data.backupImageUrl : undefined } loading={ nfts.loading || // If selected NFT but info not yet loaded, we're loading. - (selectedNft && - !nftCardInfosForKey[selectedNft.key]?.imageUrl) + (selectedNft + ? !nftCardInfosForKey[selectedNft.key]?.imageUrl + : profile.loading) } - size="sm" + size="md" />

diff --git a/packages/stateful/components/SelfRelayExecuteModal.tsx b/packages/stateful/components/SelfRelayExecuteModal.tsx index 9837c25e0..9521ce043 100644 --- a/packages/stateful/components/SelfRelayExecuteModal.tsx +++ b/packages/stateful/components/SelfRelayExecuteModal.tsx @@ -16,7 +16,7 @@ import { coins, fromTendermintEvent, } from '@cosmjs/stargate' -import { useChains } from '@cosmos-kit/react-lite' +import { ChainWalletBase } from '@cosmos-kit/core' import { Check, Close, Send, Verified } from '@mui/icons-material' import { MsgGrant as MsgGrantEncoder } from 'cosmjs-types/cosmos/authz/v1beta1/tx' import uniq from 'lodash.uniq' @@ -67,6 +67,8 @@ import { MsgGrant } from '@dao-dao/utils/protobuf/codegen/cosmos/authz/v1beta1/t import { SendAuthorization } from '@dao-dao/utils/protobuf/codegen/cosmos/bank/v1beta1/authz' import { toTimestamp } from '@dao-dao/utils/protobuf/codegen/helpers' +import { useWallet } from '../hooks' + enum RelayStatus { Uninitialized, Initializing, @@ -129,9 +131,11 @@ export const SelfRelayExecuteModal = ({ // All chains, including current. const chainIds = [currentChainId, ..._chainIds] const chains = uniq(chainIds).map(getChainForChainId) - const wallets = useChains(chains.map(({ chain_name }) => chain_name)) - const allWalletsConnected = Object.values(wallets).every( - (wallet) => wallet.isWalletConnected + + const { isWalletConnected, chainWallet } = useWallet() + const chainWalletList = chainWallet?.mainWallet?.getChainWalletList(false) + const chainWallets = chainIds.map((chainId) => + chainWalletList?.find((cw) => cw.chainId === chainId) ) const [status, setStatus] = useState(RelayStatus.Uninitialized) @@ -274,13 +278,37 @@ export const SelfRelayExecuteModal = ({ return } - if (!allWalletsConnected) { - toast.error(t('error.chainNotConnected')) + // Should never happen... + const unsupportedChains = chains.filter((_, index) => !chainWallets[index]) + if (unsupportedChains.length > 0) { + toast.error( + t('error.unsupportedChains', { + count: unsupportedChains.length, + chains: unsupportedChains.join(', '), + }) + ) return } - // Make sure all wallets are connected by trying to connect first one. - Object.values(wallets)[0]?.connect() + // Connect to all disconnected chain wallets. + const relayerChainWallets = chainWallets as ChainWalletBase[] + try { + await Promise.all( + relayerChainWallets.map( + async (wallet) => + wallet.isWalletConnected || (await wallet.connect(false)) + ) + ) + + // Make sure all wallets are connected. Should never happen... + if (relayerChainWallets.some((wallet) => !wallet.isWalletConnected)) { + throw new Error('unexpected wallet not connected') + } + } catch (err) { + console.error(err) + toast.error(t('error.failedToConnect')) + return + } setStatus(RelayStatus.Initializing) try { @@ -290,7 +318,7 @@ export const SelfRelayExecuteModal = ({ (await DirectSecp256k1HdWallet.generate(24)).mnemonic const relayers = await Promise.all( - chains.map(async (chain): Promise => { + chains.map(async (chain, index): Promise => { const chainImageUrl = getImageUrlForChainId(chain.chain_id) || getFallbackImage(chain.chain_id) @@ -308,12 +336,13 @@ export const SelfRelayExecuteModal = ({ } // Connect wallet to chain so we can send tokens. - const connectedWallet = wallets[chain.chain_name] - if (!connectedWallet?.address) { + const { address, getSigningStargateClient } = + relayerChainWallets[index] + if (!address) { throw new Error(t('error.chainNotConnected')) } - const signingStargateClient = - await connectedWallet.getSigningStargateClient() + + const signingStargateClient = await getSigningStargateClient() // Create relayer signer. const signer = await DirectSecp256k1HdWallet.fromMnemonic(mnemonic, { @@ -342,7 +371,7 @@ export const SelfRelayExecuteModal = ({ chainImageUrl, feeToken, wallet: { - address: connectedWallet.address, + address, // cosmos-kit has an older version of the package. This is a // workaround. signingStargateClient: @@ -945,16 +974,9 @@ export const SelfRelayExecuteModal = ({ ), diff --git a/packages/stateful/components/dao/CreateDaoForm.tsx b/packages/stateful/components/dao/CreateDaoForm.tsx index b1bfff9de..41c27b9d6 100644 --- a/packages/stateful/components/dao/CreateDaoForm.tsx +++ b/packages/stateful/components/dao/CreateDaoForm.tsx @@ -66,7 +66,7 @@ import { useFollowingDaos, useQuerySyncedRecoilState, useWallet, - useWalletInfo, + useWalletBalances, } from '../../hooks' import { getAdapterById as getProposalModuleAdapterById } from '../../proposal-module-adapter' import { @@ -389,7 +389,7 @@ export const InnerCreateDaoForm = ({ const [creating, setCreating] = useState(false) const { isWalletConnected, address: walletAddress } = useWallet() - const { refreshBalances } = useWalletInfo() + const { refreshBalances } = useWalletBalances() const instantiateWithFactory = CwAdminFactoryHooks.useInstantiateWithAdminFactory({ diff --git a/packages/stateful/components/dao/DaoTokenDepositModal.tsx b/packages/stateful/components/dao/DaoTokenDepositModal.tsx index 82bb38a99..0cfa0ffa6 100644 --- a/packages/stateful/components/dao/DaoTokenDepositModal.tsx +++ b/packages/stateful/components/dao/DaoTokenDepositModal.tsx @@ -24,7 +24,7 @@ import { processError, } from '@dao-dao/utils' -import { Cw20BaseHooks, useWallet, useWalletInfo } from '../../hooks' +import { Cw20BaseHooks, useWallet, useWalletBalances } from '../../hooks' import { ConnectWallet } from '../ConnectWallet' export type DaoTokenDepositModalProps = Pick< @@ -47,7 +47,7 @@ export const DaoTokenDepositModal = ({ // Only attempt connection when the modal is visible. attemptConnection: props.visible, }) - const { refreshBalances: refreshWalletBalances } = useWalletInfo({ + const { refreshBalances: refreshWalletBalances } = useWalletBalances({ chainId: token.chainId, }) diff --git a/packages/stateful/components/dao/tabs/AppsTab.tsx b/packages/stateful/components/dao/tabs/AppsTab.tsx index a5cec2b8a..8e1dc1a8b 100644 --- a/packages/stateful/components/dao/tabs/AppsTab.tsx +++ b/packages/stateful/components/dao/tabs/AppsTab.tsx @@ -18,6 +18,8 @@ import { import { Loader, Modal, + ProfileImage, + ProfileNameDisplayAndEditor, AppsTab as StatelessAppsTab, WarningCard, useDaoInfoContext, @@ -46,7 +48,7 @@ import { import { TxBody } from '@dao-dao/utils/protobuf/codegen/cosmos/tx/v1beta1/tx' import { useActionsForMatching } from '../../../actions' -import { useWallet } from '../../../hooks/useWallet' +import { useProfile } from '../../../hooks' import { ProposalModuleAdapterCommonProvider, matchAdapter as matchProposalModuleAdapter, @@ -55,7 +57,6 @@ import { NewProposalForm as NewSingleChoiceProposalForm } from '../../../proposa import { useProposalModuleAdapterCommonContext } from '../../../proposal-module-adapter/react/context' import { ConnectWallet } from '../../ConnectWallet' import { SuspenseLoader } from '../../SuspenseLoader' -import { ConnectedWalletDisplay, DisconnectWallet } from '../../wallet' import { ProposalDaoInfoCards } from '../ProposalDaoInfoCards' export const AppsTab = () => { @@ -335,7 +336,7 @@ const ActionMatcherAndProposer = ({ }: ActionMatcherAndProposerProps) => { const { t } = useTranslation() const { coreAddress } = useDaoInfoContext() - const { isWalletConnected } = useWallet() + const { connected, profile } = useProfile() const { id: proposalModuleAdapterCommonId, @@ -522,18 +523,24 @@ const ActionMatcherAndProposer = ({ - - +
+ {/* Image */} + + + {/* Name */} + +
) : ( - <> -
- - + ) } header={{ diff --git a/packages/stateful/components/gov/NewGovProposal.tsx b/packages/stateful/components/gov/NewGovProposal.tsx index 00a8afc5e..7e0325bd1 100644 --- a/packages/stateful/components/gov/NewGovProposal.tsx +++ b/packages/stateful/components/gov/NewGovProposal.tsx @@ -79,7 +79,6 @@ import { WalletActionsProvider } from '../../actions' import { makeGovernanceProposalAction } from '../../actions/core/chain_governance/GovernanceProposal' import { useEntity } from '../../hooks' import { useWallet } from '../../hooks/useWallet' -import { useWalletInfo } from '../../hooks/useWalletInfo' import { EntityDisplay } from '../EntityDisplay' import { SuspenseLoader } from '../SuspenseLoader' import { GovProposalActionDisplay } from './GovProposalActionDisplay' @@ -93,7 +92,7 @@ export const NewGovProposal = () => { const { t } = useTranslation() const chainContext = useConfiguredChainContext() - const { walletAddress = '' } = useWalletInfo() + const { address: walletAddress = '' } = useWallet() const governanceProposalAction = makeGovernanceProposalAction({ t, @@ -142,7 +141,7 @@ const InnerNewGovProposal = ({ const [showSubmitErrorNote, setShowSubmitErrorNote] = useState(false) const [submitError, setSubmitError] = useState('') - const { walletAddress = '' } = useWalletInfo() + const { address: walletAddress = '' } = useWallet() const { entity } = useEntity(walletAddress) const [govProposalCreatedCardProps, setGovProposalCreatedCardProps] = diff --git a/packages/stateful/components/nft/NftSelectionModal.tsx b/packages/stateful/components/nft/NftSelectionModal.tsx index f80228417..dc3f4fd2e 100644 --- a/packages/stateful/components/nft/NftSelectionModal.tsx +++ b/packages/stateful/components/nft/NftSelectionModal.tsx @@ -49,6 +49,7 @@ export const NftSelectionModal = ({ allowSelectingNone, selectedDisplay, headerDisplay, + headerContent, noneDisplay, ...modalProps }: NftSelectionModalProps) => { @@ -149,6 +150,9 @@ export const NftSelectionModal = ({ Math.ceil(filteredSearchedNfts.length / NFTS_PER_PAGE) ) + const showHeaderNftControls = + nfts.loading || nfts.errored || nfts.data.length > 0 + return ( } headerContent={ - headerDisplay || - nfts.loading || - nfts.errored || - nfts.data.length > 0 ? ( + headerDisplay || showHeaderNftControls || headerContent ? (
{headerDisplay} - + {showHeaderNftControls && ( + <> + -
- {showSelectAll && ( - - )} + {showSelectAll && ( + + )} -
- -
-
+
+ +
+
- + + + )} + + {headerContent} ) : undefined } diff --git a/packages/stateful/components/pages/Account.tsx b/packages/stateful/components/pages/Account.tsx index efe59a13c..d0806dc4f 100644 --- a/packages/stateful/components/pages/Account.tsx +++ b/packages/stateful/components/pages/Account.tsx @@ -4,7 +4,6 @@ import { NextSeo } from 'next-seo' import { useRouter } from 'next/router' import { useEffect } from 'react' import { useTranslation } from 'react-i18next' -import { useRecoilValue } from 'recoil' import { averageColorSelector, @@ -14,6 +13,7 @@ import { ChainProvider, Account as StatelessAccount, useCachedLoadable, + useCachedLoading, useCachedLoadingWithError, useThemeContext, } from '@dao-dao/stateless' @@ -27,7 +27,7 @@ import { transformBech32Address, } from '@dao-dao/utils' -import { walletProfileDataSelector } from '../../recoil' +import { makeEmptyUnifiedProfile, profileSelector } from '../../recoil' import { ButtonLink } from '../ButtonLink' import { PageHeaderContent } from '../PageHeaderContent' import { SuspenseLoader } from '../SuspenseLoader' @@ -53,6 +53,8 @@ export const Account: NextPage = () => { const configuredChain = getConfiguredChains().find(({ chain }) => chain.bech32_prefix === prefix) || getConfiguredChains()[0] + // Transform just in case there was no chain found and we defaulted to the + // first configured chain. const accountAddress = transformBech32Address( address as string, configuredChain.chainId @@ -65,19 +67,18 @@ export const Account: NextPage = () => { }) ) - const profileData = useRecoilValue( - walletProfileDataSelector({ + const profile = useCachedLoading( + profileSelector({ chainId: configuredChain.chain.chain_id, address: accountAddress, - }) + }), + makeEmptyUnifiedProfile(accountAddress) ) const { setAccentColor, theme } = useThemeContext() // Get average color of image URL. const averageImgColorLoadable = useCachedLoadable( - profileData.loading - ? undefined - : averageColorSelector(profileData.profile.imageUrl) + profile.loading ? undefined : averageColorSelector(profile.data.imageUrl) ) // Set theme's accentColor. @@ -140,7 +141,7 @@ export const Account: NextPage = () => { SuspenseLoader={SuspenseLoader} address={accountAddress} hexPublicKey={hexPublicKey} - profileData={profileData} + profile={profile} /> diff --git a/packages/stateful/components/pages/AccountDaos.tsx b/packages/stateful/components/pages/AccountDaos.tsx index fb62192a5..054f383a2 100644 --- a/packages/stateful/components/pages/AccountDaos.tsx +++ b/packages/stateful/components/pages/AccountDaos.tsx @@ -1,7 +1,8 @@ import { useRouter } from 'next/router' -import { getSupportedChains, transformBech32Address } from '@dao-dao/utils' +import { useChain } from '@dao-dao/stateless' +import { useProfile } from '../../hooks' import { WalletDaos } from '../wallet' export const AccountDaos = () => { @@ -12,20 +13,36 @@ export const AccountDaos = () => { throw new Error('Invalid address.') } - // Get wallets on all DAO DAO-supported chains. Once we support chains with - // other HD paths (coin types), we need to re-think this. - const chainWallets = getSupportedChains().map(({ chain }) => ({ - chainId: chain.chain_id, - walletAddress: transformBech32Address(address, chain.chain_id), - })) + const { chain_id: chainId } = useChain() + const { chains } = useProfile({ + address, + onlySupported: true, + }) return ( ) } diff --git a/packages/stateful/components/pages/Me.tsx b/packages/stateful/components/pages/Me.tsx index 26e013ae0..96f40fd9e 100644 --- a/packages/stateful/components/pages/Me.tsx +++ b/packages/stateful/components/pages/Me.tsx @@ -1,12 +1,18 @@ +import { + ExtensionRounded, + GroupRounded, + WalletRounded, +} from '@mui/icons-material' import { NextPage } from 'next' import { NextSeo } from 'next-seo' import { useRouter } from 'next/router' import { useEffect } from 'react' import { useTranslation } from 'react-i18next' -import { useSetRecoilState } from 'recoil' +import { useRecoilState, useSetRecoilState } from 'recoil' import { averageColorSelector, + mergeProfilesVisibleAtom, updateProfileNftVisibleAtom, walletChainIdAtom, } from '@dao-dao/state/recoil' @@ -15,14 +21,14 @@ import { Loader, LogInRequiredPage, PageLoader, - Me as StatelessMe, + Profile as StatelessProfile, useCachedLoadable, useThemeContext, } from '@dao-dao/stateless' -import { Theme } from '@dao-dao/types' +import { AccountTab, AccountTabId, Theme } from '@dao-dao/types' import { - ME_PAGE_DESCRIPTION, - ME_PAGE_TITLE, + PROFILE_PAGE_DESCRIPTION, + PROFILE_PAGE_TITLE, SITE_URL, getConfiguredChainConfig, getConfiguredChains, @@ -30,35 +36,53 @@ import { } from '@dao-dao/utils' import { WalletActionsProvider } from '../../actions/react/provider' -import { useQuerySyncedRecoilState } from '../../hooks' +import { useManageProfile } from '../../hooks' import { useWallet } from '../../hooks/useWallet' -import { useWalletInfo } from '../../hooks/useWalletInfo' import { ConnectWallet } from '../ConnectWallet' import { PageHeaderContent } from '../PageHeaderContent' +import { ProfileActions, ProfileWallet } from '../profile' +import { ProfileDaos } from '../profile/ProfileDaos' import { SuspenseLoader } from '../SuspenseLoader' -import { WalletConfiguredChainSwitcherHeader } from '../wallet/WalletChainSwitcher' -import { MeBalances } from './MeBalances' -import { MeDaos } from './MeDaos' -import { MeTransactionBuilder } from './MeTransactionBuilder' export const Me: NextPage = () => { const { t } = useTranslation() const router = useRouter() + const tabs: AccountTab[] = [ + { + id: AccountTabId.Home, + label: t('title.wallet'), + Icon: WalletRounded, + Component: ProfileWallet, + }, + { + id: AccountTabId.Daos, + label: t('title.daos'), + Icon: GroupRounded, + Component: ProfileDaos, + }, + { + id: AccountTabId.Actions, + label: t('title.actions'), + Icon: ExtensionRounded, + Component: ProfileActions, + }, + ] + const { address: walletAddress = '', isWalletConnected, isWalletConnecting, } = useWallet() - const { walletProfileData: profileData, updateProfileName } = useWalletInfo() + const { + profile, + otherProfiles, + updateProfile: { go: updateProfile }, + } = useManageProfile() - // Sync chain ID in query param. - const [chainId, setWalletChainId] = useQuerySyncedRecoilState({ - param: 'chain', - atom: walletChainIdAtom, - }) + const [walletChainId, setWalletChainId] = useRecoilState(walletChainIdAtom) // Switch to a valid chain if not configured. - const configuredChainConfig = getConfiguredChainConfig(chainId) + const configuredChainConfig = getConfiguredChainConfig(walletChainId) useEffect(() => { if (!configuredChainConfig) { setWalletChainId(getConfiguredChains()[0].chainId) @@ -68,14 +92,13 @@ export const Me: NextPage = () => { const { setAccentColor, theme } = useThemeContext() // Get average color of image URL. const averageImgColorLoadable = useCachedLoadable( - profileData.loading - ? undefined - : averageColorSelector(profileData.profile.imageUrl) + profile.loading ? undefined : averageColorSelector(profile.data.imageUrl) ) const setUpdateProfileNftVisible = useSetRecoilState( updateProfileNftVisibleAtom ) + const setMergeProfilesVisible = useSetRecoilState(mergeProfilesVisibleAtom) // Set theme's accentColor. useEffect(() => { @@ -113,42 +136,39 @@ export const Me: NextPage = () => { return ( <> - } - title={t('title.account')} - /> + {!configuredChainConfig ? ( ) : isWalletConnected ? ( // Refresh all children when chain changes since state varies by chain. - + {/* Suspend to prevent hydration error since we load state on first render from localStorage. */} }> - setMergeProfilesVisible(true)} openProfileNftUpdate={() => setUpdateProfileNftVisible(true)} - profileData={profileData} - updateProfileName={updateProfileName} + otherProfilesExist={otherProfiles.length > 0} + profile={profile} + tabs={tabs} + updateProfile={updateProfile} /> diff --git a/packages/stateful/components/pages/MeBalances.tsx b/packages/stateful/components/pages/MeBalances.tsx deleted file mode 100644 index fd7b08741..000000000 --- a/packages/stateful/components/pages/MeBalances.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { useWallet } from '../../hooks' -import { WalletBalances, WalletLazyNftCard } from '../wallet' - -export const MeBalances = () => { - const { address: walletAddress, hexPublicKey } = useWallet({ - loadAccount: true, - }) - - return ( - - ) -} diff --git a/packages/stateful/components/pages/MeDaos.tsx b/packages/stateful/components/pages/MeDaos.tsx deleted file mode 100644 index 9d6e5edfd..000000000 --- a/packages/stateful/components/pages/MeDaos.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { useSupportedChainWallets } from '../../hooks' -import { WalletDaos } from '../wallet' - -export const MeDaos = () => { - const chainWallets = useSupportedChainWallets({ - attemptConnection: true, - }) - - return ( - address) - ? { - loading: false, - errored: false, - data: chainWallets.flatMap( - ({ chainWallet: { chain, address } }) => - address - ? { - chainId: chain.chain_id, - walletAddress: address, - } - : [] - ), - } - : { - loading: true, - errored: false, - } - } - /> - ) -} diff --git a/packages/stateful/components/pages/index.ts b/packages/stateful/components/pages/index.ts index fb72565a0..b60d4d455 100644 --- a/packages/stateful/components/pages/index.ts +++ b/packages/stateful/components/pages/index.ts @@ -6,8 +6,5 @@ export * from './ErrorPage404' export * from './Home' export * from './Inbox' export * from './Me' -export * from './MeBalances' -export * from './MeDaos' -export * from './MeTransactionBuilder' export * from './NeutronGovernanceHome' export * from './Status' diff --git a/packages/stateful/components/profile/MergeProfilesModal.tsx b/packages/stateful/components/profile/MergeProfilesModal.tsx new file mode 100644 index 000000000..4411ce207 --- /dev/null +++ b/packages/stateful/components/profile/MergeProfilesModal.tsx @@ -0,0 +1,182 @@ +import { Add } from '@mui/icons-material' +import { useEffect, useState } from 'react' +import toast from 'react-hot-toast' +import { useTranslation } from 'react-i18next' +import { useRecoilState } from 'recoil' + +import { mergeProfilesVisibleAtom } from '@dao-dao/state' +import { + Button, + ChainProvider, + Modal, + ProfileImage, + ProfileNameDisplayAndEditor, + RadioInputNoForm, +} from '@dao-dao/stateless' +import { processError } from '@dao-dao/utils' + +import { useManageProfile, useWallet } from '../../hooks' +import { useRefreshProfile } from '../../hooks/useRefreshProfile' + +export const MergeProfilesModal = () => { + const { t } = useTranslation() + const { + chain: { chain_id: walletChainId }, + address = '', + } = useWallet() + const { profile, otherProfiles } = useManageProfile() + + const [visible, setVisible] = useRecoilState(mergeProfilesVisibleAtom) + + const currentProfileEmpty = + !profile.loading && + (profile.data.nonce === 0 || (!profile.data.name && !profile.data.nft)) + const addingToOneProfile = currentProfileEmpty && otherProfiles.length === 1 + + const profiles = [ + // Don't allow choosing the current profile if it's unused. This modal can + // only be shown if other profiles exist, so it's safe to ignore the current + // one here. + ...(currentProfileEmpty || profile.loading + ? [] + : [ + { + chainId: walletChainId, + address, + profile: profile.data, + }, + ]), + ...otherProfiles, + ].sort((a, b) => { + // Prioritize those with a name set, and then an NFT. + if (a.profile.name && !b.profile.name) { + return -1 + } else if (!a.profile.name && b.profile.name) { + return 1 + } else if (a.profile.nft && !b.profile.nft) { + return -1 + } else if (!a.profile.nft && b.profile.nft) { + return 1 + } + + // Sort by nonce as a heuristic for which is most used if both have a + // name/NFT or both don't. + return b.profile.nonce - a.profile.nonce + }) + + const [selectedProfileChainId, setSelectedProfileChainId] = useState< + string | undefined + >() + // Reset selection back to the first one when modal becomes visible. + useEffect(() => { + if (visible) { + setSelectedProfileChainId(profiles[0]?.chainId) + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [visible]) + + if (profile.loading || !address) { + return null + } + + return ( + setVisible(false)} + visible={visible} + > + + className="!flex-col !gap-1" + onChange={(chainId) => setSelectedProfileChainId(chainId)} + options={profiles.map((profile) => ({ + value: profile.chainId, + display: ( +
+ + +
+ ), + }))} + selected={selectedProfileChainId} + /> + + + {/* Re-render on chain change to clear profile cache so the button loads the relevant wallet for the chosen profile immediately. */} + setVisible(false)} + /> + +
+ ) +} + +type PerformMergeProps = { + addingToOneProfile: boolean + onClose: () => void +} + +const PerformMerge = ({ addingToOneProfile, onClose }: PerformMergeProps) => { + const { t } = useTranslation() + + const { addChains, otherProfiles } = useManageProfile() + const refreshProfiles = useRefreshProfile( + otherProfiles.map(({ address }) => address), + { + loading: false, + data: otherProfiles.map(({ profile }) => profile), + } + ) + + const chainsToAdd = otherProfiles.map(({ chainId }) => chainId) + + return ( + + ) +} diff --git a/packages/stateful/components/pages/MeTransactionBuilder.tsx b/packages/stateful/components/profile/ProfileActions.tsx similarity index 95% rename from packages/stateful/components/pages/MeTransactionBuilder.tsx rename to packages/stateful/components/profile/ProfileActions.tsx index 426a4d9a1..9c89b11c6 100644 --- a/packages/stateful/components/pages/MeTransactionBuilder.tsx +++ b/packages/stateful/components/profile/ProfileActions.tsx @@ -10,8 +10,8 @@ import { useRecoilState, useSetRecoilState } from 'recoil' import { meTransactionAtom, refreshSavedTxsAtom } from '@dao-dao/state' import { useLoadedActionsAndCategories } from '@dao-dao/stateful/actions' import { - MeTransactionBuilderProps, - MeTransactionBuilder as StatelessMeTransactionBuilder, + ProfileActionsProps, + ProfileActions as StatelessProfileActions, useCachedLoading, } from '@dao-dao/stateless' import { AccountTxForm, AccountTxSave } from '@dao-dao/types' @@ -29,8 +29,9 @@ import { temporarySavedTxsAtom, } from '../../recoil/selectors/wallet' import { SuspenseLoader } from '../SuspenseLoader' +import { WalletChainSwitcher } from '../wallet' -export const MeTransactionBuilder = () => { +export const ProfileActions = () => { const { t } = useTranslation() const { @@ -88,7 +89,7 @@ export const MeTransactionBuilder = () => { const [loading, setLoading] = useState(false) const [error, setError] = useState('') const [txHash, setTxHash] = useState('') - const execute: MeTransactionBuilderProps['execute'] = useCallback( + const execute: ProfileActionsProps['execute'] = useCallback( async (data) => { if (!walletAddress) { setError(t('error.logInToContinue')) @@ -218,8 +219,9 @@ export const MeTransactionBuilder = () => { } return ( - { + const { t } = useTranslation() + + const { chains } = useProfile() + const { otherProfiles, addChains } = useManageProfile() + + const form = useForm({ + defaultValues: { + chains: [], + }, + }) + + // Cannot add chains while conflicting profiles exist. + if (otherProfiles.length > 0) { + return null + } + + const onAddChains: SubmitHandler = async ({ + chains, + }) => { + const chainIds = chains + .filter(({ checked }) => checked) + .map(({ chainId }) => chainId) + + const chainIdToFormIndex = Object.fromEntries( + chains.map(({ chainId }, index) => [chainId, index]) + ) + + try { + await addChains.go(chainIds, { + setChainStatus: (chainId, status) => { + const formIndex = chainIdToFormIndex[chainId] + if (formIndex !== undefined) { + form.setValue(`chains.${formIndex}.status`, status) + } + }, + }) + + // On success... + + // Clear form. + form.reset() + + // Show success toast. + toast.success(t('success.addedChainsToProfile')) + } catch (err) { + console.error(err) + toast.error(processError(err)) + } + } + + return ( + + + + ) +} diff --git a/packages/stateful/components/profile/ProfileDaos.tsx b/packages/stateful/components/profile/ProfileDaos.tsx new file mode 100644 index 000000000..692a72225 --- /dev/null +++ b/packages/stateful/components/profile/ProfileDaos.tsx @@ -0,0 +1,42 @@ +import { useTranslation } from 'react-i18next' + +import { getSupportedChains } from '@dao-dao/utils' + +import { useProfile } from '../../hooks' +import { WalletDaos } from '../wallet' +import { ProfileAddChains } from './ProfileAddChains' + +export const ProfileDaos = () => { + const { t } = useTranslation() + + const { chains } = useProfile({ + onlySupported: true, + }) + + const missingChains = + !chains.loading && chains.data.length < getSupportedChains().length + + return ( + <> + + + {missingChains && ( + + )} + + ) +} diff --git a/packages/stateful/components/profile/ProfileProposalCard.tsx b/packages/stateful/components/profile/ProfileProposalCard.tsx index 616114479..ae30b5ccb 100644 --- a/packages/stateful/components/profile/ProfileProposalCard.tsx +++ b/packages/stateful/components/profile/ProfileProposalCard.tsx @@ -12,7 +12,7 @@ import { } from '@dao-dao/stateless' import { CheckedDepositInfo } from '@dao-dao/types/contracts/common' -import { useMembership, useWalletInfo } from '../../hooks' +import { useManageProfile, useMembership } from '../../hooks' import { matchAndLoadCommon, useProposalModuleAdapter, @@ -27,7 +27,10 @@ export interface ProfileProposalCardProps { export const ProfileProposalCard = () => { const chain = useChain() const { coreAddress, name: daoName, proposalModules } = useDaoInfoContext() - const { walletProfileData, updateProfileName } = useWalletInfo() + const { + profile, + updateProfile: { go: updateProfile }, + } = useManageProfile() const setUpdateProfileNftVisible = useSetRecoilState( updateProfileNftVisibleAtom ) @@ -99,9 +102,9 @@ export const ProfileProposalCard = () => { const commonProps = { votingPower: votingPowerPercent, daoName, - walletProfileData, + profile, showUpdateProfileNft: () => setUpdateProfileNftVisible(true), - updateProfileName, + updateProfile, } return couldVote ? ( diff --git a/packages/stateful/components/profile/ProfileWallet.tsx b/packages/stateful/components/profile/ProfileWallet.tsx new file mode 100644 index 000000000..bfaef9f70 --- /dev/null +++ b/packages/stateful/components/profile/ProfileWallet.tsx @@ -0,0 +1,57 @@ +import { constSelector, waitForAny } from 'recoil' + +import { + ProfileWallet as StatelessProfileWallet, + useCachedLoadingWithError, +} from '@dao-dao/stateless' + +import { useProfile } from '../../hooks' +import { + hiddenBalancesSelector, + walletTokenCardInfosSelector, +} from '../../recoil' +import { WalletTokenLine } from '../wallet/WalletTokenLine' +import { ProfileAddChains } from './ProfileAddChains' + +export const ProfileWallet = () => { + const { chains, uniquePublicKeys } = useProfile() + + const tokens = useCachedLoadingWithError( + chains.loading + ? undefined + : chains.data.length > 0 + ? waitForAny( + chains.data.map(({ chainId, address }) => + walletTokenCardInfosSelector({ + chainId, + walletAddress: address, + }) + ) + ) + : constSelector([]), + (chainLoadables) => chainLoadables.flatMap((l) => l.valueMaybe() || []) + ) + + const hiddenTokens = useCachedLoadingWithError( + uniquePublicKeys.loading + ? undefined + : uniquePublicKeys.data.length > 0 + ? waitForAny( + uniquePublicKeys.data.map((publicKey) => + hiddenBalancesSelector(publicKey) + ) + ) + : constSelector([]), + (chainLoadables) => chainLoadables.flatMap((l) => l.valueMaybe() || []) + ) + + return ( + + ) +} diff --git a/packages/stateful/components/profile/index.ts b/packages/stateful/components/profile/index.ts new file mode 100644 index 000000000..a4c3f04cd --- /dev/null +++ b/packages/stateful/components/profile/index.ts @@ -0,0 +1,6 @@ +export * from './MergeProfilesModal' +export * from './ProfileActions' +export * from './ProfileAddChains' +export * from './ProfileDaos' +export * from './ProfileProposalCard' +export * from './ProfileWallet' diff --git a/packages/stateful/components/profile/index.tsx b/packages/stateful/components/profile/index.tsx deleted file mode 100644 index b8d30cccb..000000000 --- a/packages/stateful/components/profile/index.tsx +++ /dev/null @@ -1 +0,0 @@ -export * from './ProfileProposalCard' diff --git a/packages/stateful/components/vesting/VestingPaymentCard.tsx b/packages/stateful/components/vesting/VestingPaymentCard.tsx index 91519bce0..1e0a8694c 100644 --- a/packages/stateful/components/vesting/VestingPaymentCard.tsx +++ b/packages/stateful/components/vesting/VestingPaymentCard.tsx @@ -27,7 +27,7 @@ import { useAwaitNextBlock, useEntity, useWallet, - useWalletInfo, + useWalletBalances, } from '../../hooks' import { useDistribute, @@ -42,7 +42,7 @@ export const VestingPaymentCard = (vestingInfo: VestingInfo) => { const { t } = useTranslation() const { chain_id: chainId } = useChain() const { goToDaoProposal } = useDaoNavHelpers() - const { isWalletConnected, refreshBalances } = useWalletInfo() + const { isWalletConnected, refreshBalances } = useWalletBalances() const { vestingContractAddress, diff --git a/packages/stateful/components/wallet/ConnectedWalletDisplay.tsx b/packages/stateful/components/wallet/ConnectedWalletDisplay.tsx deleted file mode 100644 index cc37b6518..000000000 --- a/packages/stateful/components/wallet/ConnectedWalletDisplay.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import clsx from 'clsx' -import { useSetRecoilState } from 'recoil' - -import { updateProfileNftVisibleAtom } from '@dao-dao/state/recoil' -import { - CopyableAddress, - ProfileImage, - ProfileNameDisplayAndEditor, -} from '@dao-dao/stateless' - -import { useWallet, useWalletInfo } from '../../hooks' - -export type ConnectedWalletDisplayProps = { - className?: string -} - -export const ConnectedWalletDisplay = ({ - className, -}: ConnectedWalletDisplayProps) => { - const { address = '' } = useWallet() - const { walletProfileData, updateProfileName } = useWalletInfo() - const setUpdateProfileNftVisible = useSetRecoilState( - updateProfileNftVisibleAtom - ) - - return ( -
- {/* Image */} - setUpdateProfileNftVisible(true)} - size="sm" - /> - -
- {/* Name */} - - - {/* Address */} - -
-
- ) -} diff --git a/packages/stateful/components/wallet/DisconnectWallet.tsx b/packages/stateful/components/wallet/DisconnectWallet.tsx index 994af3cba..8a4bd476a 100644 --- a/packages/stateful/components/wallet/DisconnectWallet.tsx +++ b/packages/stateful/components/wallet/DisconnectWallet.tsx @@ -1,15 +1,30 @@ -import { DisconnectWallet as StatelessDisconnectWallet } from '@dao-dao/stateless' +import clsx from 'clsx' + +import { + DisconnectWalletProps, + DisconnectWallet as StatelessDisconnectWallet, +} from '@dao-dao/stateless' import { useWallet } from '../../hooks' -export const DisconnectWallet = () => { +export type StatefulDisconnectWalletProps = Omit< + DisconnectWalletProps, + 'onDisconnect' +> + +export const DisconnectWallet = ({ + className, + variant = 'secondary', + ...props +}: StatefulDisconnectWalletProps) => { const { disconnect } = useWallet() return ( ) } diff --git a/packages/stateful/components/wallet/WalletBalances.tsx b/packages/stateful/components/wallet/WalletBalances.tsx deleted file mode 100644 index 992d33b09..000000000 --- a/packages/stateful/components/wallet/WalletBalances.tsx +++ /dev/null @@ -1,122 +0,0 @@ -import { ComponentType } from 'react' -import { waitForAny } from 'recoil' - -import { - WalletBalances as StatelessWalletBalances, - useCachedLoading, - useCachedLoadingWithError, - useChain, -} from '@dao-dao/stateless' -import { - LazyNftCardInfo, - LoadingData, - LoadingDataWithError, - TokenCardInfo, -} from '@dao-dao/types' -import { loadableToLoadingData } from '@dao-dao/utils' - -import { - allWalletNftsSelector, - hiddenBalancesSelector, - tokenCardLazyInfoSelector, - walletTokenCardInfosSelector, -} from '../../recoil' -import { WalletTokenLine } from './WalletTokenLine' -import { WalletTokenLineReadonly } from './WalletTokenLineReadonly' - -export type WalletBalancesProps = { - address: string | undefined - hexPublicKey: LoadingData - NftCard: ComponentType - // If true, use token card that has edit actions. - editable: boolean -} - -export const WalletBalances = ({ - address, - hexPublicKey, - NftCard, - editable, -}: WalletBalancesProps) => { - const { chain_id: chainId } = useChain() - - const tokensWithoutLazyInfo = useCachedLoadingWithError( - address - ? walletTokenCardInfosSelector({ - chainId, - walletAddress: address, - }) - : undefined - ) - - // Load separately so they cache separately. - const tokenLazyInfos = useCachedLoadingWithError( - !tokensWithoutLazyInfo.loading && !tokensWithoutLazyInfo.errored && address - ? waitForAny( - tokensWithoutLazyInfo.data.map(({ token, unstakedBalance }) => - tokenCardLazyInfoSelector({ - owner: address, - token, - unstakedBalance, - }) - ) - ) - : undefined - ) - - const tokens: LoadingDataWithError = - tokensWithoutLazyInfo.loading || tokensWithoutLazyInfo.errored - ? tokensWithoutLazyInfo - : { - loading: false, - errored: false, - updating: - tokensWithoutLazyInfo.updating || - (!tokenLazyInfos.loading && - !tokenLazyInfos.errored && - tokenLazyInfos.updating), - data: tokensWithoutLazyInfo.data.map( - (token, i): TokenCardInfo => ({ - ...token, - lazyInfo: - tokenLazyInfos.loading || - tokenLazyInfos.errored || - tokensWithoutLazyInfo.data.length !== tokenLazyInfos.data.length - ? { loading: true } - : loadableToLoadingData(tokenLazyInfos.data[i], { - usdUnitPrice: undefined, - stakingInfo: undefined, - totalBalance: token.unstakedBalance, - }), - }) - ), - } - - const nfts = useCachedLoadingWithError( - address - ? allWalletNftsSelector([ - { - chainId, - walletAddress: address, - }, - ]) - : undefined - ) - - const hiddenTokens = useCachedLoading( - !hexPublicKey.loading - ? hiddenBalancesSelector(hexPublicKey.data) - : undefined, - [] - ) - - return ( - - ) -} diff --git a/packages/stateful/components/wallet/WalletChainSwitcher.tsx b/packages/stateful/components/wallet/WalletChainSwitcher.tsx index 30130dafb..15f06ff63 100644 --- a/packages/stateful/components/wallet/WalletChainSwitcher.tsx +++ b/packages/stateful/components/wallet/WalletChainSwitcher.tsx @@ -2,30 +2,8 @@ import { useWallet } from '@cosmos-kit/react-lite' import { useRecoilState } from 'recoil' import { walletChainIdAtom } from '@dao-dao/state/recoil' -import { ChainPickerPopup, ChainPickerPopupProps } from '@dao-dao/stateless' - -export type WalletChainSwitcherProps = { - /** - * The chain type to show. Supported chains have native DAO DAO deployments, - * whereas configured chains include supported chains and others which show up - * in the UI in various places, such as the governance UI. - */ - type?: 'supported' | 'configured' - /** - * Chain IDs to exclude. - */ - excludeChainIds?: string[] -} & Omit< - ChainPickerPopupProps, - | 'chains' - | 'selectedChainId' - | 'onSelect' - | 'labelMode' - | 'showNone' - | 'noneLabel' - | 'NoneIcon' -> & - Partial> +import { ChainPickerPopup } from '@dao-dao/stateless' +import { WalletChainSwitcherProps } from '@dao-dao/types' /** * A chain switcher that shows only supported chains and controls the global @@ -69,7 +47,3 @@ export const WalletChainSwitcher = ({ /> ) } - -export const WalletConfiguredChainSwitcherHeader = ( - props: Omit -) => diff --git a/packages/stateful/components/wallet/WalletDaos.tsx b/packages/stateful/components/wallet/WalletDaos.tsx index 3178d733b..bd365666b 100644 --- a/packages/stateful/components/wallet/WalletDaos.tsx +++ b/packages/stateful/components/wallet/WalletDaos.tsx @@ -1,22 +1,40 @@ +import { waitForAny } from 'recoil' + import { WalletDaos as StatelessWalletDaos, useCachedLoadingWithError, } from '@dao-dao/stateless' import { StatefulWalletDaosProps } from '@dao-dao/types' +import { transformLoadingDataWithError } from '@dao-dao/utils' -import { allWalletDaosSelector } from '../../recoil' +import { walletDaosSelector } from '../../recoil' import { LazyDaoCard } from '../dao' -export const WalletDaos = ({ chainWallets }: StatefulWalletDaosProps) => { +export const WalletDaos = ({ + chainWallets, + ...props +}: StatefulWalletDaosProps) => { const walletDaos = useCachedLoadingWithError( chainWallets.loading || chainWallets.errored ? undefined - : allWalletDaosSelector(chainWallets.data) + : waitForAny( + chainWallets.data.map((chainWallet) => + walletDaosSelector(chainWallet) + ) + ), + (data) => + data + .flatMap((loadable) => loadable.valueMaybe() || []) + .sort((a, b) => a.name.localeCompare(b.name)) ) return ( + data.map(({ chainId }) => chainId) + )} daos={chainWallets.errored ? chainWallets : walletDaos} /> ) diff --git a/packages/stateful/components/wallet/WalletLazyNftCard.tsx b/packages/stateful/components/wallet/WalletLazyNftCard.tsx index abc27f41c..8a963bc6d 100644 --- a/packages/stateful/components/wallet/WalletLazyNftCard.tsx +++ b/packages/stateful/components/wallet/WalletLazyNftCard.tsx @@ -14,7 +14,7 @@ import { getMeTxPrefillPath, processError } from '@dao-dao/utils' import { useActionForKey } from '../../actions' import { TransferNftData } from '../../actions/core/nfts/TransferNft/Component' -import { useWalletInfo } from '../../hooks' +import { useManageProfile } from '../../hooks' import { ButtonLink } from '../ButtonLink' import { LazyNftCard } from '../nft' @@ -22,15 +22,19 @@ export const WalletLazyNftCard = ( props: ComponentProps ) => { const { t } = useTranslation() - const { walletProfileData, updatingProfile, updateProfileNft } = - useWalletInfo() + const { + profile, + updateProfile: { updating: updatingProfile, go: updateProfile }, + } = useManageProfile() const setProfilePhoto = async () => { try { - await updateProfileNft({ - chainId: props.chainId, - collectionAddress: props.collectionAddress, - tokenId: props.tokenId, + await updateProfile({ + nft: { + chainId: props.chainId, + collectionAddress: props.collectionAddress, + tokenId: props.tokenId, + }, }) } catch (err) { console.error(err) @@ -43,7 +47,7 @@ export const WalletLazyNftCard = ( } const unsetProfilePhoto = async () => { try { - await updateProfileNft(null) + await updateProfile({ nft: null }) } catch (err) { console.error(err) toast.error( @@ -55,10 +59,10 @@ export const WalletLazyNftCard = ( } const currentProfilePhoto = - walletProfileData.profile.nft?.chainId === props.chainId && - walletProfileData.profile.nft?.collectionAddress === - props.collectionAddress && - walletProfileData.profile.nft?.tokenId === props.tokenId + !profile.loading && + profile.data.nft?.chainId === props.chainId && + profile.data.nft?.collectionAddress === props.collectionAddress && + profile.data.nft?.tokenId === props.tokenId const transferActionDefaults = useActionForKey( ActionKey.TransferNft @@ -66,7 +70,7 @@ export const WalletLazyNftCard = ( // Setup actions for popup. Prefill with cw20 related actions. const buttonPopupSections: ButtonPopupSection[] = [ - ...(!walletProfileData.loading && walletProfileData.profile.nonce >= 0 + ...(!profile.loading && profile.data.nonce >= 0 ? [ { label: t('title.profile'), @@ -83,7 +87,7 @@ export const WalletLazyNftCard = ( Icon: NoAccounts, label: t('button.unsetProfilePhoto'), loading: updatingProfile, - disabled: !walletProfileData.profile.nft, + disabled: !profile.data.nft, closeOnClick: false, onClick: unsetProfilePhoto, }, diff --git a/packages/stateful/components/wallet/WalletModals.tsx b/packages/stateful/components/wallet/WalletModals.tsx index a38c0b77f..3e3bc3a3d 100644 --- a/packages/stateful/components/wallet/WalletModals.tsx +++ b/packages/stateful/components/wallet/WalletModals.tsx @@ -1,9 +1,13 @@ import { PfpkNftSelectionModal } from '../PfpkNftSelectionModal' +import { MergeProfilesModal } from '../profile' import { Web3AuthPromptModal } from './Web3AuthPromptModal' export const WalletModals = () => ( <> - {/* The wallet modal may open above this, so this must be after that. And it may need the Web3AuthPromptModal to confirm, so this must be before that. */} + {/* This may need the Web3AuthPromptModal to confirm, so this must be before that. */} + + + {/* This may need the Web3AuthPromptModal to confirm, so this must be before that. */} {/* For rejecting/approving web3auth wallet transactions. Must be last. */} diff --git a/packages/stateful/components/wallet/WalletProvider.tsx b/packages/stateful/components/wallet/WalletProvider.tsx index 6cf1677b9..5fa50c107 100644 --- a/packages/stateful/components/wallet/WalletProvider.tsx +++ b/packages/stateful/components/wallet/WalletProvider.tsx @@ -37,6 +37,7 @@ import { SITE_URL, WEB3AUTH_CLIENT_ID, getChainForChainId, + getKeplrFromWindow, getSignerOptions, } from '@dao-dao/utils' @@ -118,10 +119,7 @@ export const WalletProvider = ({ children }: WalletProviderProps) => { } ;(async () => { - setIsKeplrMobileWeb( - (await (await import('@keplr-wallet/stores')).getKeplrFromWindow()) - ?.mode === 'mobile-web' - ) + setIsKeplrMobileWeb((await getKeplrFromWindow())?.mode === 'mobile-web') })() }, [mountedInBrowser, setIsKeplrMobileWeb]) diff --git a/packages/stateful/components/wallet/WalletStakingModal.tsx b/packages/stateful/components/wallet/WalletStakingModal.tsx index 1e4c0fa60..a94f65803 100644 --- a/packages/stateful/components/wallet/WalletStakingModal.tsx +++ b/packages/stateful/components/wallet/WalletStakingModal.tsx @@ -25,7 +25,7 @@ import { processError, } from '@dao-dao/utils' -import { useAwaitNextBlock, useWallet, useWalletInfo } from '../../hooks' +import { useAwaitNextBlock, useWallet, useWalletBalances } from '../../hooks' export type WalletStakingModalProps = Pick< StakingModalProps, @@ -45,7 +45,7 @@ export const WalletStakingModal = (props: WalletStakingModalProps) => { throw new Error(t('error.missingNativeToken')) } - const { walletBalance, refreshBalances } = useWalletInfo() + const { walletBalance, refreshBalances } = useWalletBalances() // Refreshes validator balances. const setRefreshValidatorBalances = useSetRecoilState( refreshWalletBalancesIdAtom('') diff --git a/packages/stateful/components/wallet/WalletTokenCard.tsx b/packages/stateful/components/wallet/WalletTokenCard.tsx index 222a99dd6..8d2fd938a 100644 --- a/packages/stateful/components/wallet/WalletTokenCard.tsx +++ b/packages/stateful/components/wallet/WalletTokenCard.tsx @@ -39,7 +39,7 @@ import { useAwaitNextBlock, useCfWorkerAuthPostRequest, useWallet, - useWalletInfo, + useWalletBalances, } from '../../hooks' import { hiddenBalancesSelector, @@ -62,7 +62,7 @@ export const WalletTokenCard = (props: TokenCardInfo) => { chainId: props.token.chainId, loadAccount: true, }) - const { refreshBalances } = useWalletInfo({ + const { refreshBalances } = useWalletBalances({ chainId: props.token.chainId, }) diff --git a/packages/stateful/components/wallet/WalletUiConnected.tsx b/packages/stateful/components/wallet/WalletUiConnected.tsx index 743fbfd8c..f81868a82 100644 --- a/packages/stateful/components/wallet/WalletUiConnected.tsx +++ b/packages/stateful/components/wallet/WalletUiConnected.tsx @@ -9,7 +9,6 @@ import { useSetRecoilState } from 'recoil' import { updateProfileNftVisibleAtom } from '@dao-dao/state/recoil' import { Button, - CopyableAddress, ProfileImage, ProfileNameDisplayAndEditor, Tooltip, @@ -17,7 +16,7 @@ import { WarningCard, } from '@dao-dao/stateless' -import { useWalletInfo } from '../../hooks' +import { useManageProfile } from '../../hooks' const keplrExtensionWallet = keplrExtensionWallets[0] @@ -26,7 +25,10 @@ export const WalletUiConnected = ({ }: Pick) => { const { t } = useTranslation() - const { walletProfileData, updateProfileName } = useWalletInfo() + const { + profile, + updateProfile: { go: updateProfile }, + } = useManageProfile() const setUpdateProfileNftVisible = useSetRecoilState( updateProfileNftVisibleAtom ) @@ -50,9 +52,9 @@ export const WalletUiConnected = ({ {/* Image */}
setUpdateProfileNftVisible(true)} + imageUrl={profile.loading ? undefined : profile.data.imageUrl} + loading={profile.loading} + onClick={() => setUpdateProfileNftVisible(true)} size="lg" /> - {/* Address */} -
{/* In Keplr mobile web, the wallet is force connected and cannot be logged out of, so only show the log out button for all other options. */} diff --git a/packages/stateful/components/wallet/index.ts b/packages/stateful/components/wallet/index.ts index f4dfbb99e..755d0edca 100644 --- a/packages/stateful/components/wallet/index.ts +++ b/packages/stateful/components/wallet/index.ts @@ -1,6 +1,4 @@ -export * from './ConnectedWalletDisplay' export * from './DisconnectWallet' -export * from './WalletBalances' export * from './WalletChainSwitcher' export * from './WalletDaos' export * from './WalletFiatRampModal' diff --git a/packages/stateful/feed/sources/OpenProposals/index.ts b/packages/stateful/feed/sources/OpenProposals/index.ts index 5b0c993d8..3e377d0b2 100644 --- a/packages/stateful/feed/sources/OpenProposals/index.ts +++ b/packages/stateful/feed/sources/OpenProposals/index.ts @@ -12,7 +12,7 @@ import { FeedSource, StatefulProposalLineProps } from '@dao-dao/types' import { webSocketChannelNameForDao } from '@dao-dao/utils' import { ProposalLine } from '../../../components/ProposalLine' -import { useOnWebSocketMessage, useSupportedChainWallets } from '../../../hooks' +import { useOnWebSocketMessage, useProfile } from '../../../hooks' import { followingDaosSelector } from '../../../recoil' import { feedOpenProposalsSelector } from './state' @@ -23,39 +23,37 @@ export const OpenProposals: FeedSource = { const setRefresh = useSetRecoilState(refreshOpenProposalsAtom) const refresh = useCallback(() => setRefresh((id) => id + 1), [setRefresh]) - const supportedChainWallets = useSupportedChainWallets().filter( - ({ chainWallet: { chain } }) => - !filter?.chainId || chain.chain_id === filter.chainId - ) + const { chains } = useProfile({ + onlySupported: true, + }) + const filteredChains = chains.loading + ? [] + : chains.data.filter( + ({ chainId }) => !filter?.chainId || chainId === filter.chainId + ) const daosWithItemsLoadable = useCachedLoadable( - supportedChainWallets.every(({ hexPublicKey }) => hexPublicKey) + !chains.loading ? waitForAll( - supportedChainWallets.flatMap( - ({ chainWallet: { chain, address }, hexPublicKey }) => - address && hexPublicKey - ? feedOpenProposalsSelector({ - chainId: chain.chain_id, - address, - hexPublicKey, - }) - : [] + filteredChains.map(({ chainId, publicKey, address }) => + feedOpenProposalsSelector({ + chainId, + address, + hexPublicKey: publicKey, + }) ) ) : undefined ) const followingDaosLoadable = useRecoilValueLoadable( - supportedChainWallets.every(({ hexPublicKey }) => hexPublicKey) + !chains.loading ? waitForAll( - supportedChainWallets.flatMap( - ({ chainWallet: { chain }, hexPublicKey }) => - hexPublicKey - ? followingDaosSelector({ - chainId: chain.chain_id, - walletPublicKey: hexPublicKey, - }) - : [] + filteredChains.map(({ chainId, publicKey }) => + followingDaosSelector({ + chainId, + walletPublicKey: publicKey, + }) ) ) : constSelector([]) @@ -64,13 +62,13 @@ export const OpenProposals: FeedSource = { // Refresh when any proposal or vote is updated for any of the followed // DAOs. useOnWebSocketMessage( - followingDaosLoadable.state === 'hasValue' - ? supportedChainWallets.flatMap( - ({ chainWallet: { chain } }, index) => + !chains.loading && followingDaosLoadable.state === 'hasValue' + ? filteredChains.flatMap( + ({ chainId }, index) => followingDaosLoadable.contents[index]?.map((coreAddress) => webSocketChannelNameForDao({ coreAddress, - chainId: chain.chain_id, + chainId, }) ) || [] ) diff --git a/packages/stateful/feed/sources/VetoableProposals/index.ts b/packages/stateful/feed/sources/VetoableProposals/index.ts index cdc79f978..5097f9671 100644 --- a/packages/stateful/feed/sources/VetoableProposals/index.ts +++ b/packages/stateful/feed/sources/VetoableProposals/index.ts @@ -15,7 +15,7 @@ import { import { FeedSource, StatefulProposalLineProps } from '@dao-dao/types' import { webSocketChannelNameForDao } from '@dao-dao/utils' -import { useOnWebSocketMessage, useSupportedChainWallets } from '../../../hooks' +import { useOnWebSocketMessage, useProfile } from '../../../hooks' import { followingDaosSelector } from '../../../recoil' import { feedVetoableProposalsSelector } from './state' @@ -28,38 +28,36 @@ export const VetoableProposals: FeedSource< const setRefresh = useSetRecoilState(refreshOpenProposalsAtom) const refresh = useCallback(() => setRefresh((id) => id + 1), [setRefresh]) - const supportedChainWallets = useSupportedChainWallets().filter( - ({ chainWallet: { chain } }) => - !filter?.chainId || chain.chain_id === filter.chainId - ) + const { chains } = useProfile({ + onlySupported: true, + }) + const filteredChains = chains.loading + ? [] + : chains.data.filter( + ({ chainId }) => !filter?.chainId || chainId === filter.chainId + ) const daosWithItemsLoadable = useCachedLoadable( - supportedChainWallets.every(({ hexPublicKey }) => hexPublicKey) + !chains.loading ? waitForAll( - supportedChainWallets.flatMap( - ({ chainWallet: { chain }, hexPublicKey }) => - hexPublicKey - ? feedVetoableProposalsSelector({ - chainId: chain.chain_id, - hexPublicKey, - }) - : [] + filteredChains.map(({ chainId, publicKey }) => + feedVetoableProposalsSelector({ + chainId, + hexPublicKey: publicKey, + }) ) ) : undefined ) const followingDaosLoadable = useRecoilValueLoadable( - supportedChainWallets.every(({ hexPublicKey }) => hexPublicKey) + !chains.loading ? waitForAll( - supportedChainWallets.flatMap( - ({ chainWallet: { chain }, hexPublicKey }) => - hexPublicKey - ? followingDaosSelector({ - chainId: chain.chain_id, - walletPublicKey: hexPublicKey, - }) - : [] + filteredChains.map(({ chainId, publicKey }) => + followingDaosSelector({ + chainId, + walletPublicKey: publicKey, + }) ) ) : constSelector([]) @@ -68,13 +66,13 @@ export const VetoableProposals: FeedSource< // Refresh when any proposal or vote is updated for any of the followed // DAOs. useOnWebSocketMessage( - followingDaosLoadable.state === 'hasValue' - ? supportedChainWallets.flatMap( - ({ chainWallet: { chain } }, index) => + !chains.loading && followingDaosLoadable.state === 'hasValue' + ? filteredChains.flatMap( + ({ chainId }, index) => followingDaosLoadable.contents[index]?.map((coreAddress) => webSocketChannelNameForDao({ coreAddress, - chainId: chain.chain_id, + chainId, }) ) || [] ) diff --git a/packages/stateful/hooks/index.ts b/packages/stateful/hooks/index.ts index ab9b9e233..3760dee90 100644 --- a/packages/stateful/hooks/index.ts +++ b/packages/stateful/hooks/index.ts @@ -16,16 +16,17 @@ export * from './useInstantiateAndExecute' export * from './useLoadingDaoCardInfos' export * from './useLoadingGovProposal' export * from './useLoadingGovProposalWalletVoteInfo' +export * from './useManageProfile' export * from './useMembership' +export * from './useProfile' export * from './useProposalActionState' export * from './useProposalPolytoneState' export * from './useProposalVetoState' export * from './useQuerySyncedRecoilState' export * from './useSimulateCosmosMsgs' -export * from './useSupportedChainWallets' export * from './useSyncWalletSigner' export * from './useTokenSwapStatusInfoForContract' export * from './useUpdateNavigatingHref' export * from './useWallet' -export * from './useWalletInfo' +export * from './useWalletBalances' export * from './useWebSocket' diff --git a/packages/stateful/hooks/useCfWorkerAuthPostRequest.ts b/packages/stateful/hooks/useCfWorkerAuthPostRequest.ts index 2a41c48ff..bc08eeb65 100644 --- a/packages/stateful/hooks/useCfWorkerAuthPostRequest.ts +++ b/packages/stateful/hooks/useCfWorkerAuthPostRequest.ts @@ -1,8 +1,7 @@ -import { makeSignDoc } from '@cosmjs/amino' import { useCallback } from 'react' import { useTranslation } from 'react-i18next' -import { getNativeTokenForChainId } from '@dao-dao/utils' +import { signOffChainAuth } from '@dao-dao/utils' import { useWallet } from './useWallet' @@ -11,21 +10,49 @@ import { useWallet } from './useWallet' // a global variable so it persists across all hook uses. const lastSuccessfulNonceForApi: Record = {} +/** + * Hook that makes it easy to interact with our various Cloudflare Workers that + * use off-chain wallet auth. + */ export const useCfWorkerAuthPostRequest = ( apiBase: string, defaultSignatureType: string ) => { const { t } = useTranslation() - const { - getOfflineSignerAmino, - chain, - hexPublicKey, - address: walletAddress, - } = useWallet({ + const { getOfflineSignerAmino, chain, hexPublicKey } = useWallet({ loadAccount: true, }) - const ready = !hexPublicKey.loading && !!walletAddress + const ready = !hexPublicKey.loading + + const getNonce = useCallback(async () => { + if (!ready) { + throw new Error(t('error.logInToContinue')) + } + + // Fetch nonce. + const nonceResponse: { nonce: number } = await ( + await fetch(`${apiBase}/nonce/${hexPublicKey.data}`, { + cache: 'no-store', + }) + ).json() + if ( + !('nonce' in nonceResponse) || + typeof nonceResponse.nonce !== 'number' + ) { + console.error('Failed to fetch nonce.', nonceResponse, hexPublicKey.data) + throw new Error(t('error.loadingData')) + } + + // If nonce was already used, manually increment. + let nonce = nonceResponse.nonce + const lastSuccessfulNonce = lastSuccessfulNonceForApi[apiBase] ?? -1 + if (nonce <= lastSuccessfulNonce) { + nonce = lastSuccessfulNonce + 1 + } + + return nonce + }, [apiBase, hexPublicKey, ready, t]) const postRequest = useCallback( async ( @@ -38,78 +65,16 @@ export const useCfWorkerAuthPostRequest = ( } // Fetch nonce. - const nonceResponse: { nonce: number } = await ( - await fetch(`${apiBase}/nonce/${hexPublicKey.data}`, { - cache: 'no-store', - }) - ).json() - if ( - !('nonce' in nonceResponse) || - typeof nonceResponse.nonce !== 'number' - ) { - console.error( - 'Failed to fetch nonce.', - nonceResponse, - hexPublicKey.data - ) - throw new Error(t('error.loadingData')) - } - - // If nonce was already used, manually increment. - let nonce = nonceResponse.nonce - const lastSuccessfulNonce = lastSuccessfulNonceForApi[apiBase] ?? -1 - if (nonce <= lastSuccessfulNonce) { - nonce = lastSuccessfulNonce + 1 - } - - const dataWithAuth = { - ...data, - auth: { - type: signatureType, - nonce, - chainId: chain.chain_id, - chainFeeDenom: getNativeTokenForChainId(chain.chain_id) - .denomOrAddress, - chainBech32Prefix: chain.bech32_prefix, - publicKey: hexPublicKey.data, - }, - } - - // Sign data. - const signDocAmino = makeSignDoc( - [ - { - type: dataWithAuth.auth.type, - value: { - signer: walletAddress, - data: JSON.stringify(dataWithAuth, undefined, 2), - }, - }, - ], - { - gas: '0', - amount: [ - { - denom: dataWithAuth.auth.chainFeeDenom, - amount: '0', - }, - ], - }, - chain.chain_id, - '', - 0, - 0 - ) - const { - signature: { signature }, - } = await ( - await getOfflineSignerAmino() - ).signAmino(walletAddress, signDocAmino) - - const body = { - data: dataWithAuth, - signature, - } + const nonce = await getNonce() + + const body = await signOffChainAuth({ + type: signatureType, + nonce, + chainId: chain.chain_id, + hexPublicKey: hexPublicKey.data, + data, + offlineSignerAmino: await getOfflineSignerAmino(), + }) // Send request. const response = await fetch(apiBase + endpoint, { @@ -141,15 +106,18 @@ export const useCfWorkerAuthPostRequest = ( [ defaultSignatureType, ready, - apiBase, - hexPublicKey, + getNonce, chain.chain_id, - chain.bech32_prefix, - walletAddress, + hexPublicKey, getOfflineSignerAmino, + apiBase, t, ] ) - return { ready, postRequest } + return { + ready, + postRequest, + getNonce, + } } diff --git a/packages/stateful/hooks/useEntity.ts b/packages/stateful/hooks/useEntity.ts index fcaa512fc..1c6ebf27b 100644 --- a/packages/stateful/hooks/useEntity.ts +++ b/packages/stateful/hooks/useEntity.ts @@ -5,7 +5,7 @@ import { useCachedLoading, useChain } from '@dao-dao/stateless' import { Entity, EntityType, LoadingData } from '@dao-dao/types' import { getConfiguredChains, getFallbackImage } from '@dao-dao/utils' -import { entitySelector } from '../recoil' +import { entitySelector, makeEmptyUnifiedProfile } from '../recoil' export type UseEntityReturn = { /** @@ -62,6 +62,7 @@ export const useEntity = (address: string): UseEntityReturn => { address, name: null, imageUrl: getFallbackImage(address), + profile: makeEmptyUnifiedProfile(address), } ) diff --git a/packages/stateful/hooks/useFollowingDaos.ts b/packages/stateful/hooks/useFollowingDaos.ts index e779b97ad..51744921b 100644 --- a/packages/stateful/hooks/useFollowingDaos.ts +++ b/packages/stateful/hooks/useFollowingDaos.ts @@ -1,5 +1,5 @@ import uniq from 'lodash.uniq' -import { useCallback, useState } from 'react' +import { useCallback, useRef, useState } from 'react' import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' import { useSetRecoilState } from 'recoil' @@ -18,6 +18,7 @@ import { temporaryFollowingDaosAtom, } from '../recoil/selectors/dao/following' import { useCfWorkerAuthPostRequest } from './useCfWorkerAuthPostRequest' +import { useManageProfile } from './useManageProfile' import { useWallet } from './useWallet' export type UseFollowingDaosReturn = { @@ -75,19 +76,34 @@ export const useFollowingDaos = (chainId: string): UseFollowingDaosReturn => { 'Update Following' ) + const { profile, addChains } = useManageProfile() + + // Turn this into a reference so we can use it in `setFollowing` without + // memoizing. + const addChainsRef = useRef(addChains) + addChainsRef.current = addChains + const setFollowing = useCallback( async (coreAddressOrAddresses: string | string[]) => { - if (!ready) { + const addChains = addChainsRef.current + + if (!ready || !addChains.ready || profile.loading) { toast.error(t('error.logInToFollow')) return false } - if (updating) { + if (updating || addChains.status !== 'idle') { return false } setUpdating(true) try { + // If chain not added to profile, add it so that we know to load + // followed DAOs from the public key on this chain later. + if (!profile.data.chains[chainId]) { + await addChains.go([chainId]) + } + const daos = [coreAddressOrAddresses].flat() await postRequest('/setMany', { data: daos.map((coreAddress) => ({ @@ -114,7 +130,16 @@ export const useFollowingDaos = (chainId: string): UseFollowingDaosReturn => { setUpdating(false) } }, - [chainId, postRequest, ready, refreshFollowing, setTemporary, t, updating] + [ + chainId, + postRequest, + profile, + ready, + refreshFollowing, + setTemporary, + t, + updating, + ] ) const setUnfollowing = useCallback( diff --git a/packages/stateful/hooks/useInbox.ts b/packages/stateful/hooks/useInbox.ts index ea259c98a..3d030eb90 100644 --- a/packages/stateful/hooks/useInbox.ts +++ b/packages/stateful/hooks/useInbox.ts @@ -9,7 +9,7 @@ import { import { useCachedLoading } from '@dao-dao/stateless' import { InboxState } from '@dao-dao/types' -import { useSupportedChainWallets } from './useSupportedChainWallets' +import { useProfile } from './useProfile' import { useWallet } from './useWallet' import { useOnWebSocketMessage } from './useWebSocket' @@ -29,17 +29,17 @@ export const useInbox = (): InboxState => { return () => clearInterval(interval) }, [refresh]) - const supportedChainWallets = useSupportedChainWallets() + const { chains } = useProfile({ + onlySupported: true, + }) const itemsLoading = useCachedLoading( - supportedChainWallets.every(({ chainWallet: { address } }) => address) + !chains.loading ? waitForAll( - supportedChainWallets.flatMap(({ chainWallet: { chain, address } }) => - address - ? inboxItemsSelector({ - walletAddress: address, - chainId: chain.chain_id, - }) - : [] + chains.data.map(({ chainId, address }) => + inboxItemsSelector({ + chainId, + walletAddress: address, + }) ) ) : undefined, diff --git a/packages/stateful/hooks/useLoadingDaoCardInfos.ts b/packages/stateful/hooks/useLoadingDaoCardInfos.ts index 85c6ace62..9e3aff2ec 100644 --- a/packages/stateful/hooks/useLoadingDaoCardInfos.ts +++ b/packages/stateful/hooks/useLoadingDaoCardInfos.ts @@ -6,7 +6,7 @@ import { DaoCardInfo, LoadingData } from '@dao-dao/types' import { getSupportedChains } from '@dao-dao/utils' import { daoCardInfoSelector, followingDaosSelector } from '../recoil' -import { useSupportedChainWallets } from './useSupportedChainWallets' +import { useProfile } from './useProfile' export const useLoadingDaoCardInfos = ( daos: LoadingData< @@ -84,21 +84,21 @@ export const useLoadingFollowingDaoCardInfos = ( // from all chains. chainId?: string ): LoadingData => { - const supportedChainWallets = useSupportedChainWallets().filter( - ({ chainWallet: { chain } }) => !chainId || chain.chain_id === chainId - ) + const { chains } = useProfile({ + onlySupported: true, + }) + const filteredChains = chains.loading + ? [] + : chains.data.filter((chain) => !chainId || chainId === chain.chainId) const followingDaosLoading = useRecoilValueLoadable( - supportedChainWallets.some(({ hexPublicKey }) => hexPublicKey) + !chains.loading ? waitForAll( - supportedChainWallets.map( - ({ chainWallet: { chain }, hexPublicKey }) => - hexPublicKey - ? followingDaosSelector({ - chainId: chain.chain_id, - walletPublicKey: hexPublicKey, - }) - : constSelector([]) + filteredChains.map(({ chainId, publicKey }) => + followingDaosSelector({ + chainId, + walletPublicKey: publicKey, + }) ) ) : constSelector([]) @@ -111,13 +111,15 @@ export const useLoadingFollowingDaoCardInfos = ( ? { loading: false, data: [] } : { loading: false, - data: supportedChainWallets.flatMap( - ({ chainWallet: { chain } }, index) => - followingDaosLoading.contents[index]?.map((coreAddress) => ({ - chainId: chain.chain_id, - coreAddress, - })) || [] - ), + data: chains.loading + ? [] + : filteredChains.flatMap( + ({ chainId }, index) => + followingDaosLoading.contents[index]?.map((coreAddress) => ({ + chainId, + coreAddress, + })) || [] + ), }, // Alphabetize. true diff --git a/packages/stateful/hooks/useManageProfile.ts b/packages/stateful/hooks/useManageProfile.ts new file mode 100644 index 000000000..7dbc8f997 --- /dev/null +++ b/packages/stateful/hooks/useManageProfile.ts @@ -0,0 +1,416 @@ +import { toHex } from '@cosmjs/encoding' +import { useCallback, useEffect, useRef, useState } from 'react' +import { useTranslation } from 'react-i18next' +import { waitForNone } from 'recoil' + +import { useCachedLoading, useCachedLoadingWithError } from '@dao-dao/stateless' +import { + AddChainsFunction, + AddChainsStatus, + LoadingData, + PfpkProfileUpdate, + PfpkProfileUpdateFunction, + UnifiedProfile, +} from '@dao-dao/types' +import { + PFPK_API_BASE, + SignedBody, + getDisplayNameForChainId, + makeManuallyResolvedPromise, + signOffChainAuth, +} from '@dao-dao/utils' + +import { makeEmptyUnifiedProfile, profileSelector } from '../recoil' +import { useCfWorkerAuthPostRequest } from './useCfWorkerAuthPostRequest' +import { useRefreshProfile } from './useRefreshProfile' +import { useWallet } from './useWallet' + +export type UseManageProfileOptions = { + /** + * Optionally specify the chain to load the profile for on the currently + * connected wallet. A wallet has different addresses/public keys on different + * chains, so there may be multiple profiles for the same wallet. Defaults to + * the current chain context. + */ + chainId?: string +} + +export type UseManageProfileReturn = { + /** + * Whether or not the current wallet is connected. When an address is passed, + * this will be false. + */ + connected: boolean + /** + * The profile for the currently connected wallet. If not connected and no + * address was passed, this will be in the loading state. The unified profile + * loads data from backup sources in case profile information is missing and + * substitutes a default profile on error. + */ + profile: LoadingData + /** + * Refresh the profile for the currently connected wallet. + */ + refreshProfile: () => void + /** + * Update profile information. + */ + updateProfile: { + /** + * Whether or not the profile is loaded and ready to be updated. + */ + ready: boolean + /** + * Whether or not the profile is being updated. + */ + updating: boolean + /** + * Update profile information. + */ + go: PfpkProfileUpdateFunction + } + /** + * Add chains to the profile. + */ + addChains: { + /** + * Whether or not the add chains process is ready. + */ + ready: boolean + /** + * Add chain process status. + */ + status: AddChainsStatus + /** + * Add chains to the profile. + */ + go: AddChainsFunction + } + /** + * Profiles on the other chains the current wallet is connected to. + */ + otherProfiles: { + chainId: string + address: string + profile: UnifiedProfile + }[] +} + +/** + * A hook to help manage the profile for the currently connected wallet. + */ +export const useManageProfile = ({ + chainId, +}: UseManageProfileOptions = {}): UseManageProfileReturn => { + const { t } = useTranslation() + const { + address = '', + isWalletConnected, + chain: { chain_id: walletChainId }, + chainWallet: currentChainWallet, + hexPublicKey: currentHexPublicKey, + } = useWallet({ + chainId, + loadAccount: true, + }) + + const profile = useCachedLoading( + profileSelector({ + chainId: walletChainId, + address, + }), + makeEmptyUnifiedProfile(address) + ) + + const refreshProfile = useRefreshProfile(address, profile) + + const pfpkApi = useCfWorkerAuthPostRequest(PFPK_API_BASE, '') + + const ready = + !profile.loading && + !profile.updating && + // Ensure we have a profile loaded from the server. The nonce is -1 if it + // failed to load. + profile.data.nonce >= 0 && + !!currentChainWallet && + !currentHexPublicKey.loading && + pfpkApi.ready + + const [updating, setUpdating] = useState(false) + const [updatingNonce, setUpdatingNonce] = useState() + const onUpdateRef = useRef<() => void>() + + const profileNonce = profile.loading ? -1 : profile.data.nonce + // eslint-disable-next-line react-hooks/exhaustive-deps + const updateProfile = useCallback( + // Delay resolving the profile update promise until the new profile is + // loaded in state after a successful refresh. + makeManuallyResolvedPromise( + async (profileUpdates: Omit) => { + if (!ready || profileNonce < 0) { + return false + } + + setUpdating(true) + try { + const profileUpdate: PfpkProfileUpdate = { + ...profileUpdates, + nonce: profileNonce, + } + + await pfpkApi.postRequest( + '/', + { + profile: profileUpdate, + }, + 'DAO DAO Profile | Update' + ) + + refreshProfile() + + // On success, the updating state is cleared when the promise + // resolves. + } catch (err) { + setUpdating(false) + + // Rethrow error. + throw err + } + }, + (resolve) => { + // Set onUpdate handler. + onUpdateRef.current = () => { + resolve() + setUpdating(false) + } + setUpdatingNonce(profileNonce) + } + ), + [pfpkApi, profileNonce, ready, refreshProfile] + ) + + // Listen for nonce to incremenent to clear updating state, since we want the + // new profile to be ready on the same render that we stop loading. + useEffect(() => { + if (updatingNonce === undefined || profile.loading) { + return + } + + // If nonce incremented, clear updating state and call onUpdate handler if + // exists. + if (profile.data.nonce > updatingNonce) { + onUpdateRef.current?.() + onUpdateRef.current = undefined + + setUpdatingNonce(undefined) + } + }, [updatingNonce, profile]) + + const [addChainsStatus, setAddChainsStatus] = + useState('idle') + const addChains: AddChainsFunction = async ( + chainIds, + { setChainStatus } = {} + ) => { + if (!currentChainWallet) { + throw new Error(t('error.logInToContinue')) + } + + // Type-check. + if (!ready || currentHexPublicKey.loading) { + throw new Error(t('error.loadingData')) + } + + if (chainIds.length > 0) { + setAddChainsStatus('chains') + + let error: unknown + try { + // Get chain wallets. + const allChainWallets = + currentChainWallet.mainWallet.getChainWalletList(false) + const chainWallets = chainIds.map( + (chainId) => allChainWallets.find((cw) => cw.chainId === chainId)! + ) + + // Stop if missing chain wallets. + const missingChainWallets = chainIds.filter( + (_, index) => !chainWallets[index] + ) + if (missingChainWallets.length > 0) { + throw new Error( + t('error.unexpectedlyMissingChains', { + chains: missingChainWallets + .map((chainId) => getDisplayNameForChainId(chainId)) + .join(', '), + }) + ) + } + + // Load nonce from API. + const nonce = await pfpkApi.getNonce() + + const allowances: SignedBody<{}>[] = [] + + // For each chain, sign allowance. + for (const chainWallet of chainWallets) { + setChainStatus?.(chainWallet.chainId, 'loading') + + // Make sure the chain is connected. + if (!chainWallet.isWalletConnected) { + await chainWallet.connect(false) + } + + // If still not connected, error. + if (!chainWallet.isWalletConnected) { + throw new Error(t('error.failedToConnect')) + } + + // Get the account public key. + const pubkeyData = ( + await chainWallet.client.getAccount?.(chainWallet.chainId) + )?.pubkey + if (!pubkeyData) { + throw new Error(t('error.failedToGetAccountFromWallet')) + } + + const offlineSignerAmino = + await chainWallet.client.getOfflineSignerAmino?.( + chainWallet.chainId + ) + // If no amino signer, error that wallet is unsupported. This should + // only happen if there's no amino signer getter defined. + if (!offlineSignerAmino) { + throw new Error(t('error.unsupportedWallet')) + } + + const hexPublicKey = toHex(pubkeyData) + + // Sign allowance for main wallet to register this public key for this + // chain. + const body = await signOffChainAuth({ + type: 'DAO DAO Profile | Add Chain Allowance', + nonce, + chainId: chainWallet.chainId, + hexPublicKey, + data: { + allow: currentHexPublicKey.data, + chainIds: [chainWallet.chainId], + }, + offlineSignerAmino, + // No signature required if we're registering a new chain for the + // same public key already attached to the profile, which is the + // public key signing the entire registration request. + generateOnly: hexPublicKey === currentHexPublicKey.data, + }) + + allowances.push(body) + + setChainStatus?.(chainWallet.chainId, 'done') + } + + setAddChainsStatus('registering') + + // Submit allowances. Throws error on failure. + await pfpkApi.postRequest( + '/register', + { + publicKeys: allowances, + }, + 'DAO DAO Profile | Add Chains' + ) + } catch (err) { + // Reset all chain statuses on error. + if (setChainStatus) { + chainIds.forEach((chainId) => setChainStatus?.(chainId, 'idle')) + } + + // Set error to be thrown after finally block. + error = err + } finally { + // Refresh profile. + refreshProfile() + + // Reset status. + setAddChainsStatus('idle') + } + + // Throw error on failure. This allows the finally block above to run by + // throwing the error after the entire try clause. + if (error) { + throw error + } + } + } + + // Find whichever other chain wallets are currently connected so we can check + // all the profiles attached to the current wallet. Different chains may use + // different public keys, so we need to check all of them in order to prompt + // to merge them. + const otherConnectedChainWallets = ( + currentChainWallet?.mainWallet.getChainWalletList() || [] + ).filter( + (chainWallet) => + !!chainWallet.isWalletConnected && + !!chainWallet.address && + chainWallet.chainId !== walletChainId + ) + const otherChainWalletProfiles = useCachedLoadingWithError( + waitForNone( + otherConnectedChainWallets.map((chainWallet) => + profileSelector({ + chainId: chainWallet.chainId, + address: chainWallet.address!, + }) + ) + ) + ) + + // Get all profiles attached to this wallet on the other chains which do not + // have the current chain wallet registered. + const otherProfiles = + currentChainWallet && + !profile.loading && + !otherChainWalletProfiles.loading && + !otherChainWalletProfiles.errored + ? otherChainWalletProfiles.data.flatMap((loadable, index) => { + const profile = loadable.valueMaybe() + const thisChainWallet = otherConnectedChainWallets[index] + if ( + !profile || + // Ignore if the current chain wallet is registered on this profile, + // indicating that these are the same profile. + profile.chains[currentChainWallet.chainId]?.address === address || + // Type-check. + !thisChainWallet.address + ) { + return [] + } + + return { + chainId: thisChainWallet.chainId, + address: thisChainWallet.address, + profile, + } + }) + : [] + + return { + // Connected is only relevant when using the currently connected wallet. If + // an address is passed, set connected to false. + connected: address ? false : isWalletConnected, + profile, + refreshProfile, + updateProfile: { + ready, + updating, + go: updateProfile, + }, + addChains: { + ready, + status: addChainsStatus, + go: addChains, + }, + otherProfiles, + } +} diff --git a/packages/stateful/hooks/useProfile.ts b/packages/stateful/hooks/useProfile.ts new file mode 100644 index 000000000..c7d09fe09 --- /dev/null +++ b/packages/stateful/hooks/useProfile.ts @@ -0,0 +1,152 @@ +import uniq from 'lodash.uniq' + +import { useCachedLoading } from '@dao-dao/stateless' +import { LoadingData, ProfileChain, UnifiedProfile } from '@dao-dao/types' +import { + MAINNET, + getDisplayNameForChainId, + isSupportedChain, + maybeGetChainForChainId, +} from '@dao-dao/utils' + +import { makeEmptyUnifiedProfile, profileSelector } from '../recoil' +import { useRefreshProfile } from './useRefreshProfile' +import { useWallet } from './useWallet' + +export type UseProfileOptions = { + /** + * The wallet address to get profile information for. Defaults to the + * currently connected wallet. + */ + address?: string + /** + * Whether or not to only load supported chains. Defaults to false. + */ + onlySupported?: boolean +} + +export type UseProfileReturn = { + /** + * Whether or not the current wallet is connected. When an address is passed, + * this will be false. + */ + connected: boolean + /** + * The profile for the currently connected wallet. If not connected and no + * address was passed, this will be in the loading state. The unified profile + * loads data from backup sources in case profile information is missing and + * substitutes a default profile on error. + */ + profile: LoadingData + /** + * Refresh the profile for the currently connected wallet. + */ + refreshProfile: () => void + /** + * Chain information for the profile. If not connected and no address was + * passed, this will be in the loading state. If no profile has been created + * for the current wallet, this will only contain the currently connected + * wallet chain information. + */ + chains: LoadingData + /** + * Unique public keys for the profile's chains. If not connected and no + * address was passed, this will be in the loading state. + */ + uniquePublicKeys: LoadingData +} + +/** + * A hook to get profile information for a wallet. If no wallet is passed, + * defaults to the currently connected wallet. + */ +export const useProfile = ({ + address, + onlySupported = false, +}: UseProfileOptions = {}): UseProfileReturn => { + const { + chain: { chain_id: walletChainId }, + address: currentAddress = '', + hexPublicKey, + isWalletConnected, + } = useWallet({ + loadAccount: true, + }) + + const profileAddress = address || currentAddress + + const profile = useCachedLoading( + profileSelector({ + chainId: walletChainId, + address: currentAddress, + }), + makeEmptyUnifiedProfile(currentAddress) + ) + + const refreshProfile = useRefreshProfile(profileAddress, profile) + + const chains: LoadingData = + (!address && !isWalletConnected) || profile.loading + ? { loading: true } + : { + loading: false, + data: Object.entries({ + ...profile.data.chains, + // Add wallet-connected account if not already in the profile. This + // should only be the case if no profile exists yet and an empty + // profile with no chains is being returned. + ...(!profile.data.chains[walletChainId] && + !hexPublicKey.loading && + currentAddress + ? { + [walletChainId]: { + publicKey: hexPublicKey.data, + address: currentAddress, + }, + } + : {}), + }) + .flatMap(([chainId, { address, publicKey }]): ProfileChain | [] => { + const chain = maybeGetChainForChainId(chainId) + const supported = chain ? isSupportedChain(chainId) : false + + return chain && + // Only include chains that are on the right network type. + (chain.network_type === 'mainnet') === MAINNET && + // Filter by onlySupported filter. + (!onlySupported || supported) + ? { + chainId, + chain, + supported, + address, + publicKey, + } + : [] + }) + .sort((a, b) => + getDisplayNameForChainId(a.chainId).localeCompare( + getDisplayNameForChainId(b.chainId) + ) + ), + } + + const uniquePublicKeys: LoadingData = chains.loading + ? { + loading: true, + } + : { + loading: false, + data: uniq(chains.data.map((c) => c.publicKey)), + } + + return { + // Connected is only relevant when using the currently connected wallet. If + // an address is passed, set connected to false. + connected: address ? false : isWalletConnected, + profile, + refreshProfile, + chains, + uniquePublicKeys, + } +} diff --git a/packages/stateful/hooks/useRefreshProfile.ts b/packages/stateful/hooks/useRefreshProfile.ts new file mode 100644 index 000000000..79b4e2f45 --- /dev/null +++ b/packages/stateful/hooks/useRefreshProfile.ts @@ -0,0 +1,42 @@ +import uniq from 'lodash.uniq' +import { useRecoilCallback } from 'recoil' + +import { refreshWalletProfileAtom } from '@dao-dao/state/recoil' +import { LoadingData, UnifiedProfile } from '@dao-dao/types' +import { toBech32Hash } from '@dao-dao/utils' + +/** + * A hook that generates a function to refresh the given profile(s). + * + * @param address The wallet address(es) attached to the profile(s). + * @param profile The profile(s) loaded for the address(es) that will be + * refreshed. + */ +export const useRefreshProfile = ( + address: string | string[], + profile: LoadingData +) => + useRecoilCallback( + ({ set }) => + () => { + // Refresh all hashes in the profile(s). This ensures updates made by + // one public key propagate to the other public keys in the profile(s). + const hashes = uniq( + [ + ...[address].flat(), + ...(profile.loading + ? [] + : [profile.data] + .flat() + .flatMap((profile) => + Object.values(profile.chains).map(({ address }) => address) + )), + ].flatMap((address) => toBech32Hash(address) || []) + ) + + hashes.forEach((hash) => + set(refreshWalletProfileAtom(hash), (id) => id + 1) + ) + }, + [profile] + ) diff --git a/packages/stateful/hooks/useSupportedChainWallets.ts b/packages/stateful/hooks/useSupportedChainWallets.ts deleted file mode 100644 index 7f90a6e4f..000000000 --- a/packages/stateful/hooks/useSupportedChainWallets.ts +++ /dev/null @@ -1,116 +0,0 @@ -import { toHex } from '@cosmjs/encoding' -import { ChainContext, WalletAccount } from '@cosmos-kit/core' -import { useChains } from '@cosmos-kit/react-lite' -import { useEffect, useRef, useState } from 'react' -import toast from 'react-hot-toast' - -import { getSupportedChains, processError } from '@dao-dao/utils' - -import { useWallet } from './useWallet' - -export type UseSupportedChainWalletsOptions = { - /** - * If true, attempt connection if wallet is connected to a different chain but - * not the current one. - */ - attemptConnection?: boolean -} - -export type UseSupportedChainWalletsReturn = { - chainWallet: ChainContext - // Populated once loaded. - account?: WalletAccount - hexPublicKey?: string -}[] - -export const useSupportedChainWallets = ({ - attemptConnection = false, -}: UseSupportedChainWalletsOptions = {}): UseSupportedChainWalletsReturn => { - const mainWallet = useWallet({ - attemptConnection, - }) - const chainWallets = Object.values( - useChains( - getSupportedChains().map(({ chain }) => chain.chain_name), - false - ) - ) - const chainWalletsRef = useRef(chainWallets) - chainWalletsRef.current = chainWallets - - const [accounts, setAccounts] = useState< - Record< - string, - { - account: WalletAccount - hexPublicKey: string - } - > - >({}) - - const connected = chainWallets.every((w) => w.isWalletConnected) - - // Connect to chains if not connected. Connecting one connects all. - const attemptedConnection = useRef(false) - useEffect(() => { - if (mainWallet.isWalletConnected && !connected) { - Promise.all( - chainWalletsRef.current.map((w) => - w.walletRepo.wallets.some((w) => w.isWalletConnected) - ? Promise.resolve() - : w.walletRepo.connect(mainWallet.wallet?.name) - ) - ).catch((err) => { - console.error(err) - toast.error( - processError(err, { - forceCapture: false, - }) - ) - }) - attemptedConnection.current = true - } - }, [ - attemptConnection, - connected, - mainWallet.isWalletConnected, - mainWallet.wallet?.name, - ]) - - useEffect(() => { - if (!connected) { - setAccounts({}) - return - } - - ;(async () => { - try { - const connectedChains = chainWalletsRef.current.filter( - (w) => w.isWalletConnected - ) - const accounts = await Promise.all( - connectedChains.map((w) => w.getAccount()) - ) - setAccounts((prev) => - connectedChains.reduce( - (acc, { chain }, index) => ({ - ...acc, - [chain.chain_id]: { - account: accounts[index], - hexPublicKey: toHex(accounts[index].pubkey), - }, - }), - prev - ) - ) - } catch (err) { - console.error('Supported wallet account loading error', err) - } - })() - }, [connected]) - - return chainWallets.map((chainWallet) => ({ - chainWallet, - ...accounts[chainWallet.chain.chain_id], - })) -} diff --git a/packages/stateful/hooks/useWallet.ts b/packages/stateful/hooks/useWallet.ts index 4ad1dddb2..20bce1e26 100644 --- a/packages/stateful/hooks/useWallet.ts +++ b/packages/stateful/hooks/useWallet.ts @@ -17,13 +17,19 @@ import { LoadingData } from '@dao-dao/types' import { getSupportedChains, maybeGetChainForChainId } from '@dao-dao/utils' export type UseWalletOptions = { - // If undefined, defaults to current chain context. If not in a chain context, - // falls back to first supported chain. + /** + * If undefined, defaults to current chain context. If not in a chain context, + * falls back to first supported chain. + */ chainId?: string - // If true, will return `account` and `hexPublicKey` in response. + /** + * If true, will return `account` and `hexPublicKey` in response. + */ loadAccount?: boolean - // If true, attempt connection if wallet is connected to a different chain but - // not the current one. + /** + * If true, attempt connection if wallet is connected to a different chain but + * not the current one. + */ attemptConnection?: boolean } diff --git a/packages/stateful/hooks/useWalletBalances.ts b/packages/stateful/hooks/useWalletBalances.ts new file mode 100644 index 000000000..d16ad6bc6 --- /dev/null +++ b/packages/stateful/hooks/useWalletBalances.ts @@ -0,0 +1,79 @@ +import { useCallback } from 'react' +import { useSetRecoilState } from 'recoil' + +import { + nativeBalanceSelector, + refreshNativeTokenStakingInfoAtom, + refreshWalletBalancesIdAtom, +} from '@dao-dao/state' +import { useCachedLoadable } from '@dao-dao/stateless' +import { + convertMicroDenomToDenomWithDecimals, + getNativeTokenForChainId, +} from '@dao-dao/utils' + +import { useWallet } from './useWallet' + +export type UseWalletInfoOptions = { + chainId?: string +} + +export type UseWalletInfoReturn = { + isWalletConnected: boolean + walletBalance: number | undefined + refreshBalances: () => void +} + +export const useWalletBalances = ({ + chainId, +}: UseWalletInfoOptions = {}): UseWalletInfoReturn => { + const { + chain: walletChain, + address, + isWalletConnected, + } = useWallet({ + chainId, + }) + chainId ||= walletChain.chain_id + + const nativeToken = getNativeTokenForChainId(chainId) + + // Fetch wallet balance. + const { + state: walletNativeBalanceState, + contents: walletNativeBalanceContents, + } = useCachedLoadable( + address + ? nativeBalanceSelector({ + address, + chainId, + }) + : undefined + ) + const walletBalance = + walletNativeBalanceState === 'hasValue' && + walletNativeBalanceContents && + nativeToken + ? convertMicroDenomToDenomWithDecimals( + walletNativeBalanceContents.amount, + nativeToken.decimals + ) + : undefined + + const setRefreshWalletBalancesId = useSetRecoilState( + refreshWalletBalancesIdAtom(address ?? '') + ) + const setRefreshStakingId = useSetRecoilState( + refreshNativeTokenStakingInfoAtom(address ?? '') + ) + const refreshBalances = useCallback(() => { + setRefreshWalletBalancesId((id) => id + 1) + setRefreshStakingId((id) => id + 1) + }, [setRefreshStakingId, setRefreshWalletBalancesId]) + + return { + isWalletConnected, + walletBalance, + refreshBalances, + } +} diff --git a/packages/stateful/hooks/useWalletInfo.tsx b/packages/stateful/hooks/useWalletInfo.tsx deleted file mode 100644 index 2ad27cf48..000000000 --- a/packages/stateful/hooks/useWalletInfo.tsx +++ /dev/null @@ -1,275 +0,0 @@ -import { Chain } from '@chain-registry/types' -import { useCallback, useEffect, useRef, useState } from 'react' -import { useRecoilValue, useSetRecoilState } from 'recoil' - -import { - nativeBalanceSelector, - nativeBalancesFetchedAtSelector, - nativeDelegatedBalanceSelector, - refreshNativeTokenStakingInfoAtom, - refreshWalletBalancesIdAtom, - refreshWalletProfileAtom, -} from '@dao-dao/state' -import { useCachedLoadable } from '@dao-dao/stateless' -import { WalletProfileData, WalletProfileUpdate } from '@dao-dao/types' -import { - PFPK_API_BASE, - convertMicroDenomToDenomWithDecimals, - getNativeTokenForChainId, -} from '@dao-dao/utils' - -import { walletProfileDataSelector } from '../recoil' -import { useCfWorkerAuthPostRequest } from './useCfWorkerAuthPostRequest' -import { useWallet } from './useWallet' - -export type UseWalletInfoOptions = { - chainId?: string -} - -export type UseWalletInfoReturn = { - isWalletConnected: boolean - walletAddress: string | undefined - walletHexPublicKey: string | undefined - walletBalance: number | undefined - walletStakedBalance: number | undefined - walletChain: Chain | undefined - dateBalancesFetched: Date | undefined - refreshBalances: () => void - - walletProfileData: WalletProfileData - updateProfile: (profile: Omit) => Promise - updateProfileName: ( - name: Required['name'] - ) => Promise - updateProfileNft: (nft: Required['nft']) => Promise - updatingProfile: boolean - backupImageUrl: string -} - -export const useWalletInfo = ({ - chainId, -}: UseWalletInfoOptions = {}): UseWalletInfoReturn => { - const { - chain: walletChain, - address, - hexPublicKey, - isWalletConnected, - } = useWallet({ - chainId, - loadAccount: true, - }) - chainId ||= walletChain.chain_id - - const nativeToken = getNativeTokenForChainId(chainId) - - // Fetch wallet balance. - const { - state: walletNativeBalanceState, - contents: walletNativeBalanceContents, - } = useCachedLoadable( - address - ? nativeBalanceSelector({ - address, - chainId, - }) - : undefined - ) - const walletBalance = - walletNativeBalanceState === 'hasValue' && - walletNativeBalanceContents && - nativeToken - ? convertMicroDenomToDenomWithDecimals( - walletNativeBalanceContents.amount, - nativeToken.decimals - ) - : undefined - - // Fetch staked wallet balance. - const { - state: walletStakedNativeBalanceState, - contents: walletStakedNativeBalanceContents, - } = useCachedLoadable( - address - ? nativeDelegatedBalanceSelector({ - address, - chainId, - }) - : undefined - ) - const walletStakedBalance = - walletStakedNativeBalanceState === 'hasValue' && - walletStakedNativeBalanceContents && - nativeToken - ? convertMicroDenomToDenomWithDecimals( - walletStakedNativeBalanceContents.amount, - nativeToken.decimals - ) - : undefined - - // Get balance fetch time. - const { - state: nativeBalancesFetchedAtState, - contents: nativeBalancesFetchedAtContents, - } = useCachedLoadable( - address - ? nativeBalancesFetchedAtSelector({ - address, - chainId, - }) - : undefined - ) - const dateBalancesFetched = - nativeBalancesFetchedAtState === 'hasValue' - ? nativeBalancesFetchedAtContents - : undefined - - const setRefreshWalletBalancesId = useSetRecoilState( - refreshWalletBalancesIdAtom(address ?? '') - ) - const setRefreshStakingId = useSetRecoilState( - refreshNativeTokenStakingInfoAtom(address ?? '') - ) - const refreshBalances = useCallback(() => { - setRefreshWalletBalancesId((id) => id + 1) - setRefreshStakingId((id) => id + 1) - }, [setRefreshStakingId, setRefreshWalletBalancesId]) - - const setRefreshWalletProfile = useSetRecoilState( - refreshWalletProfileAtom(address ?? '') - ) - const refreshWalletProfile = useCallback( - () => setRefreshWalletProfile((id) => id + 1), - [setRefreshWalletProfile] - ) - - const walletProfileDataValue = useRecoilValue( - walletProfileDataSelector({ - address: address ?? '', - chainId, - }) - ) - - const [cachedProfileData, setCachedProfileData] = useState< - WalletProfileData | undefined - >() - // Clear cached profile data when address changes. - useEffect(() => { - setCachedProfileData(undefined) - }, [address]) - // Cache profile data when it's loaded. - useEffect(() => { - if (!walletProfileDataValue.loading) { - setCachedProfileData(walletProfileDataValue) - } - }, [walletProfileDataValue]) - const walletProfileData = cachedProfileData || walletProfileDataValue - - const { - loading: profileLoading, - profile: walletProfile, - backupImageUrl, - } = walletProfileData - - const [updatingNonce, setUpdatingNonce] = useState() - const onUpdateRef = useRef<() => void>() - const { ready: pfpkApiReady, postRequest: postPfpkRequest } = - useCfWorkerAuthPostRequest(PFPK_API_BASE, 'PFPK Verification') - const _updateProfile = useCallback( - async ( - profileUpdates: Omit, - onUpdate?: () => void - ): Promise => { - if ( - !pfpkApiReady || - profileLoading || - // Disallow editing if we don't have correct nonce from server. - walletProfile.nonce < 0 - ) { - return - } - - // Set onUpdate handler. - onUpdateRef.current = onUpdate - setUpdatingNonce(walletProfile.nonce) - - try { - const profile: WalletProfileUpdate = { - ...profileUpdates, - nonce: walletProfile.nonce, - } - - await postPfpkRequest('/', { - profile, - }) - - refreshWalletProfile() - } catch (err) { - // If errored, clear updating state since we did not update. - onUpdateRef.current = undefined - setUpdatingNonce(undefined) - - // Rethrow error. - throw err - } - }, - [ - pfpkApiReady, - profileLoading, - walletProfile.nonce, - postPfpkRequest, - refreshWalletProfile, - ] - ) - // Listen for nonce to incremenent to clear updating state, since we want the - // new profile to be ready on the same render that we stop loading. - useEffect(() => { - if (updatingNonce === undefined || profileLoading) { - return - } - - // If nonce incremented, clear updating state and call onUpdate handler if - // exists. - if (walletProfile.nonce > updatingNonce) { - onUpdateRef.current?.() - onUpdateRef.current = undefined - - setUpdatingNonce(undefined) - } - }, [updatingNonce, walletProfile, profileLoading]) - - // Promisified updateProfile. - const updateProfile = useCallback( - (profile: Omit) => - new Promise((resolve, reject) => - _updateProfile(profile, resolve).catch(reject) - ), - [_updateProfile] - ) - - const updateProfileName = useCallback( - (name: Required['name']) => updateProfile({ name }), - [updateProfile] - ) - const updateProfileNft = useCallback( - (nft: Required['nft']) => updateProfile({ nft }), - [updateProfile] - ) - - return { - isWalletConnected, - walletAddress: address, - walletHexPublicKey: hexPublicKey.loading ? undefined : hexPublicKey.data, - walletBalance, - walletStakedBalance, - walletChain, - dateBalancesFetched, - refreshBalances, - - walletProfileData, - updateProfile, - updateProfileName, - updateProfileNft, - updatingProfile: updatingNonce !== undefined, - backupImageUrl, - } -} diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 8464c820c..a1ef4c750 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -40,14 +40,11 @@ "@dao-dao/utils": "2.2.0", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", - "@keplr-wallet/stores": "^0.11.49", "@mui/icons-material": "^5.10.3", "@mui/material": "^5.10.3", - "@skip-router/core": "^1.1.3", "@walletconnect/browser-utils": "^1.8.0", - "axios": "^0.26.1", "buffer": "^6.0.3", - "chain-registry": "^1.26.0", + "chain-registry": "^1.28.6", "clsx": "^1.1.1", "file-saver": "^2.0.5", "fuse.js": "^6.6.2", diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/components/NewProposalPreview.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/components/NewProposalPreview.tsx index 7193c648a..1b4aed653 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/components/NewProposalPreview.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/components/NewProposalPreview.tsx @@ -8,7 +8,7 @@ import { convertActionsToMessages } from '@dao-dao/utils' import { useLoadedActionsAndCategories } from '../../../../../actions' import { EntityDisplay, SuspenseLoader } from '../../../../../components' -import { useEntity, useWalletInfo } from '../../../../../hooks' +import { useEntity, useWallet } from '../../../../../hooks' import { MULTIPLE_CHOICE_OPTION_COLORS } from '../../components/MultipleChoiceOptionEditor' import { MultipleChoiceOptionViewer } from '../../components/MultipleChoiceOptionViewer' import { NewProposalForm } from '../../types' @@ -18,7 +18,7 @@ export const NewProposalPreview = () => { const { watch } = useFormContext() const { loadedActions } = useLoadedActionsAndCategories() - const { walletAddress = '' } = useWalletInfo() + const { address: walletAddress = '' } = useWallet() const { entity } = useEntity(walletAddress) const proposalDescription = watch('description') diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/components/NewProposalPreview.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/components/NewProposalPreview.tsx index be2bfaa30..4281f0a39 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/components/NewProposalPreview.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/components/NewProposalPreview.tsx @@ -4,14 +4,14 @@ import { ProposalContentDisplay, RawActionsRenderer } from '@dao-dao/stateless' import { useLoadedActionsAndCategories } from '../../../../../actions' import { EntityDisplay } from '../../../../../components' -import { useEntity, useWalletInfo } from '../../../../../hooks' +import { useEntity, useWallet } from '../../../../../hooks' import { NewProposalForm } from '../../types' export const NewProposalPreview = () => { const { loadedActions } = useLoadedActionsAndCategories() const { watch } = useFormContext() - const { walletAddress = '' } = useWalletInfo() + const { address: walletAddress = '' } = useWallet() const { entity } = useEntity(walletAddress) const proposalDescription = watch('description') diff --git a/packages/stateful/recoil/selectors/entity.ts b/packages/stateful/recoil/selectors/entity.ts index c91696797..71ae57bd6 100644 --- a/packages/stateful/recoil/selectors/entity.ts +++ b/packages/stateful/recoil/selectors/entity.ts @@ -21,7 +21,7 @@ import { } from '@dao-dao/utils' import { daoInfoFromPolytoneProxySelector, daoInfoSelector } from './dao' -import { walletProfileDataSelector } from './profile' +import { profileSelector } from './profile' // Load entity from address on chain, whether it's a wallet address, a DAO, or a // DAO's polytone account. @@ -78,7 +78,7 @@ export const entitySelector: ( const [ daoInfoLoadable, daoInfoFromPolytoneProxyLoadable, - walletProfileDataLoadable, + profileLoadable, cw1WhitelistEntitiesLoadable, ] = get( waitForAllSettled([ @@ -97,7 +97,7 @@ export const entitySelector: ( : constSelector(undefined), // Try to load profile assuming the address is a wallet. address && isValidWalletAddress(address, bech32Prefix) - ? walletProfileDataSelector({ + ? profileSelector({ address, chainId, }) @@ -131,7 +131,7 @@ export const entitySelector: ( const daoInfo = daoInfoLoadable.valueMaybe() const daoInfoFromPolytoneProxy = daoInfoFromPolytoneProxyLoadable.valueMaybe() - const walletProfileData = walletProfileDataLoadable.valueMaybe() + const profile = profileLoadable.valueMaybe() const cw1WhitelistEntities = cw1WhitelistEntitiesLoadable.valueMaybe() if (daoInfo) { @@ -172,9 +172,9 @@ export const entitySelector: ( type: EntityType.Wallet, chainId, address, - name: walletProfileData?.profile.name || null, - imageUrl: - walletProfileData?.profile.imageUrl || getFallbackImage(address), + name: profile?.name || null, + imageUrl: profile?.imageUrl || getFallbackImage(address), + profile: profile, } } }, diff --git a/packages/stateful/recoil/selectors/profile.ts b/packages/stateful/recoil/selectors/profile.ts index 5b1e23e22..3e48ef163 100644 --- a/packages/stateful/recoil/selectors/profile.ts +++ b/packages/stateful/recoil/selectors/profile.ts @@ -1,4 +1,5 @@ -import { noWait, selectorFamily } from 'recoil' +import uniq from 'lodash.uniq' +import { noWait, selectorFamily, waitForAll } from 'recoil' import { cosmWasmClientForChainSelector, @@ -6,9 +7,8 @@ import { } from '@dao-dao/state/recoil' import { ChainId, - PfpkWalletProfile, - WalletProfile, - WalletProfileData, + PfpkProfile, + UnifiedProfile, WithChainId, } from '@dao-dao/types' import { @@ -18,41 +18,81 @@ import { getChainForChainId, getFallbackImage, objectMatchesStructure, + toBech32Hash, transformBech32Address, } from '@dao-dao/utils' import { nftCardInfoSelector } from './nft' -export const EMPTY_WALLET_PROFILE: WalletProfile = { +export const EMPTY_PFPK_PROFILE: PfpkProfile = { // Disallows editing if we don't have correct nonce from server. nonce: -1, name: null, - nameSource: 'pfpk', - imageUrl: '', nft: null, + chains: {}, } -// Get profile from PFPK API. -export const pfpkProfileSelector = selectorFamily< - PfpkWalletProfile | null, - string ->({ +export const makeEmptyUnifiedProfile = (address: string): UnifiedProfile => ({ + ...EMPTY_PFPK_PROFILE, + nameSource: 'pfpk', + imageUrl: getFallbackImage(address), + backupImageUrl: getFallbackImage(address), +}) + +/** + * Get profile from PFPK given a wallet address on any chain. + */ +export const pfpkProfileSelector = selectorFamily({ key: 'pfpkProfile', get: (walletAddress) => + ({ get }) => + get( + pfpkProfileForBech32HashSelector( + walletAddress && toBech32Hash(walletAddress) + ) + ), +}) + +/** + * Get profile from PFPK given a wallet address's bech32 hash. + */ +export const pfpkProfileForBech32HashSelector = selectorFamily< + PfpkProfile, + string +>({ + key: 'pfpkProfileForBech32Hash', + get: + (bech32Hash) => async ({ get }) => { - if (!walletAddress) { - return null + if (!bech32Hash) { + return { ...EMPTY_PFPK_PROFILE } } - get(refreshWalletProfileAtom(walletAddress)) + get(refreshWalletProfileAtom(bech32Hash)) try { - const response = await fetch( - PFPK_API_BASE + `/address/${walletAddress}` - ) + const response = await fetch(PFPK_API_BASE + `/bech32/${bech32Hash}`) if (response.ok) { - return await response.json() + const profile: PfpkProfile = await response.json() + + // If profile found, add refresher dependencies on the other public + // keys in the profile. This ensures that the profile will update for + // all other public keys when any of the other public keys update the + // profile. + if (profile?.chains) { + get( + waitForAll( + uniq( + Object.values(profile.chains).map(({ address }) => + toBech32Hash(address) + ) + ).map((bech32Hash) => refreshWalletProfileAtom(bech32Hash)) + ) + ) + } + + return profile } else { console.error(await response.json().catch(() => response.statusText)) } @@ -60,7 +100,7 @@ export const pfpkProfileSelector = selectorFamily< console.error(err) } - return null + return { ...EMPTY_PFPK_PROFILE } }, }) @@ -140,54 +180,40 @@ export const stargazeNameImageForAddressSelector = selectorFamily< }, }) -export const makeDefaultWalletProfileData = ( - address: string, - loading = false -): WalletProfileData => ({ - loading, - address, - profile: { ...EMPTY_WALLET_PROFILE }, - backupImageUrl: getFallbackImage(address), -}) - -// This selector returns the profile for a wallet with some helpful metadata, -// such as its loading state and a backup image. It is designed to not wait for -// any data, returning a default profile immediately and filling in data as it -// comes in. Thus, it should be safe to use in any component without suspending -// it. -export const walletProfileDataSelector = selectorFamily< - WalletProfileData, +export const profileSelector = selectorFamily< + UnifiedProfile, WithChainId<{ address: string }> >({ - key: 'walletProfileData', + key: 'profile', get: ({ address, chainId }) => ({ get }) => { if (!address) { - return makeDefaultWalletProfileData(address) + return makeEmptyUnifiedProfile(address) } - get(refreshWalletProfileAtom(address)) + get(refreshWalletProfileAtom(toBech32Hash(address))) - let profile = { ...EMPTY_WALLET_PROFILE } + const profile = makeEmptyUnifiedProfile(address) - const pfpkProfileLoadable = get(noWait(pfpkProfileSelector(address))) - const pfpkProfile = - pfpkProfileLoadable.state === 'hasValue' - ? pfpkProfileLoadable.contents - : null + const pfpkProfile = get(pfpkProfileSelector(address)) if (pfpkProfile) { profile.nonce = pfpkProfile.nonce profile.name = pfpkProfile.name profile.nft = pfpkProfile.nft + profile.chains = pfpkProfile.chains } - // Load Stargaze name as backup if no PFPK set. + // Load Stargaze name as backup if no PFPK name set. if (!profile.name) { const stargazeNameLoadable = get( noWait( stargazeNameSelector( - transformBech32Address(address, ChainId.StargazeMainnet) + // Use profile address for Stargaze if set, falling back to + // transforming the address (which is unreliable due to different + // chains using different HD paths). + profile.chains[ChainId.StargazeMainnet]?.address || + transformBech32Address(address, ChainId.StargazeMainnet) ) ) ) @@ -203,10 +229,8 @@ export const walletProfileDataSelector = selectorFamily< } } - const backupImageUrl = getFallbackImage(address) - // Set `imageUrl` to PFPK image, defaulting to fallback image. - profile.imageUrl = pfpkProfile?.nft?.imageUrl || backupImageUrl + profile.imageUrl = pfpkProfile?.nft?.imageUrl || profile.backupImageUrl // If NFT present from PFPK, get image from token once loaded. if (pfpkProfile?.nft) { @@ -229,12 +253,16 @@ export const walletProfileDataSelector = selectorFamily< profile.imageUrl = nftInfoLoadable.contents.imageUrl } - // Load Stargaze name image if no PFPK. + // Load Stargaze name image if no PFPK image. } else if (profile.nameSource === 'stargaze') { const stargazeNameImageLoadable = get( noWait( stargazeNameImageForAddressSelector( - transformBech32Address(address, ChainId.StargazeMainnet) + // Use profile address for Stargaze if set, falling back to + // transforming the address (which is unreliable due to different + // chains using different HD paths). + profile.chains[ChainId.StargazeMainnet]?.address || + transformBech32Address(address, ChainId.StargazeMainnet) ) ) ) @@ -246,11 +274,6 @@ export const walletProfileDataSelector = selectorFamily< } } - return { - loading: pfpkProfileLoadable.state === 'loading', - address, - profile, - backupImageUrl, - } + return profile }, }) diff --git a/packages/stateful/recoil/selectors/wallet.ts b/packages/stateful/recoil/selectors/wallet.ts index 20f2ea9b0..e672e8cce 100644 --- a/packages/stateful/recoil/selectors/wallet.ts +++ b/packages/stateful/recoil/selectors/wallet.ts @@ -4,6 +4,7 @@ import { noWait, selectorFamily, waitForAll, + waitForAny, } from 'recoil' import { @@ -34,12 +35,14 @@ import { convertMicroDenomToDenomWithDecimals, getFallbackImage, getNativeTokenForChainId, + loadableToLoadingData, } from '@dao-dao/utils' import { walletLazyNftCardInfosSelector, walletStakedLazyNftCardInfosSelector, } from './nft' +import { tokenCardLazyInfoSelector } from './token' // This doesn't update right away due to Cloudflare KV Store latency, so this // serves to keep track of all successful updates for the current session. This @@ -219,13 +222,15 @@ export const walletTokenCardInfosSelector = selectorFamily< ? cw20ContractsLoadable.contents ?? [] : [] const cw20s = get( - waitForAll( - cw20Contracts.map((c) => - genericTokenSelector({ - type: TokenType.Cw20, - denomOrAddress: c.contractAddress, - chainId, - }) + noWait( + waitForAny( + cw20Contracts.map((c) => + genericTokenSelector({ + type: TokenType.Cw20, + denomOrAddress: c.contractAddress, + chainId, + }) + ) ) ) ) @@ -252,25 +257,55 @@ export const walletTokenCardInfosSelector = selectorFamily< ).amount ) > 0 + const owner = allAccounts[accountIndex] + + const lazyInfo = get( + noWait( + tokenCardLazyInfoSelector({ + owner: owner.address, + token, + unstakedBalance, + }) + ) + ) + const info: TokenCardInfo = { - owner: allAccounts[accountIndex], + owner, token, isGovernanceToken: false, unstakedBalance, hasStakingInfo, - - lazyInfo: { loading: true }, + lazyInfo: loadableToLoadingData(lazyInfo, { + usdUnitPrice: undefined, + stakingInfo: undefined, + totalBalance: unstakedBalance, + }), } return info }) ), - ...cw20s.map((token, index) => { + ...(cw20s.valueMaybe() || []).flatMap((tokenLoadable, index) => { + const token = tokenLoadable.valueMaybe() + if (!token) { + return [] + } + const unstakedBalance = convertMicroDenomToDenomWithDecimals( cw20Contracts[index].balance || '0', token.decimals ) + const lazyInfo = get( + noWait( + tokenCardLazyInfoSelector({ + owner: walletAddress, + token, + unstakedBalance, + }) + ) + ) + const info: TokenCardInfo = { owner: { type: AccountType.Native, @@ -282,8 +317,11 @@ export const walletTokenCardInfosSelector = selectorFamily< unstakedBalance, // No unstaking info for CW20. hasStakingInfo: false, - - lazyInfo: { loading: true }, + lazyInfo: loadableToLoadingData(lazyInfo, { + usdUnitPrice: undefined, + stakingInfo: undefined, + totalBalance: unstakedBalance, + }), } return info @@ -344,11 +382,11 @@ export const allWalletNftsSelector = selectorFamily< export const walletDaosSelector = selectorFamily< LazyDaoCardProps[], // Can be any wallet address. - WithChainId<{ walletAddress: string }> + WithChainId<{ address: string }> >({ key: 'walletDaos', get: - ({ chainId, walletAddress }) => + ({ chainId, address }) => ({ get }) => { const daos: { dao: string @@ -357,7 +395,7 @@ export const walletDaosSelector = selectorFamily< }[] = get( queryWalletIndexerSelector({ chainId, - walletAddress, + walletAddress: address, formula: 'daos/memberOf', }) ) @@ -382,32 +420,3 @@ export const walletDaosSelector = selectorFamily< return lazyDaoCards }, }) - -// Get DAOs for a wallet on many chains. -export const allWalletDaosSelector = selectorFamily< - LazyDaoCardProps[], - { - chainId: string - walletAddress: string - }[] ->({ - key: 'allWalletDaos', - get: - (chainWallets) => - ({ get }) => { - const allLazyDaoCards = get( - waitForAll( - chainWallets.map(({ chainId, walletAddress }) => - walletDaosSelector({ - chainId, - walletAddress, - }) - ) - ) - ) - .flat() - .sort((a, b) => a.name.localeCompare(b.name)) - - return allLazyDaoCards - }, -}) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/ProfileCardMemberInfo.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/ProfileCardMemberInfo.tsx index 748095689..4abe28230 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/ProfileCardMemberInfo.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/ProfileCardMemberInfo.tsx @@ -29,7 +29,7 @@ import { Cw20StakeHooks, useAwaitNextBlock, useWallet, - useWalletInfo, + useWalletBalances, } from '../../../../hooks' import { ProfileCardMemberInfoTokens } from '../../../components' import { useGovernanceTokenInfo, useStakingInfo } from '../hooks' @@ -43,7 +43,7 @@ export const ProfileCardMemberInfo = ({ const { chain_id: chainId } = useChain() const { name: daoName } = useDaoInfoContext() const { address: walletAddress, isWalletConnected } = useWallet() - const { refreshBalances } = useWalletInfo() + const { refreshBalances } = useWalletBalances() const [showStakingModal, setShowStakingModal] = useState(false) const [claimingLoading, setClaimingLoading] = useState(false) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/StakingModal.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/StakingModal.tsx index 129e87506..31e610e0a 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/StakingModal.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/StakingModal.tsx @@ -33,7 +33,7 @@ import { Cw20StakeHooks, useAwaitNextBlock, useWallet, - useWalletInfo, + useWalletBalances, } from '../../../../hooks' import { useVotingModuleAdapterOptions } from '../../../react/context' import { useGovernanceTokenInfo, useStakingInfo } from '../hooks' @@ -54,7 +54,7 @@ const InnerStakingModal = ({ }: BaseStakingModalProps) => { const { t } = useTranslation() const { address: walletAddress, isWalletConnected } = useWallet() - const { refreshBalances } = useWalletInfo() + const { refreshBalances } = useWalletBalances() const { chainId, coreAddress } = useVotingModuleAdapterOptions() const [stakingLoading, setStakingLoading] = useRecoilState(stakingLoadingAtom) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/ProfileCardMemberInfo.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/ProfileCardMemberInfo.tsx index 18d1bbe58..bb063c0b4 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/ProfileCardMemberInfo.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/ProfileCardMemberInfo.tsx @@ -28,7 +28,7 @@ import { DaoVotingCw721StakedHooks, useAwaitNextBlock, useWallet, - useWalletInfo, + useWalletBalances, } from '../../../../hooks' import { ProfileCardMemberInfoTokens } from '../../../components' import { useGovernanceCollectionInfo, useStakingInfo } from '../hooks' @@ -42,7 +42,7 @@ export const ProfileCardMemberInfo = ({ const { chain_id: chainId } = useChain() const { name: daoName } = useDaoInfoContext() const { address: walletAddress, isWalletConnected } = useWallet() - const { refreshBalances } = useWalletInfo() + const { refreshBalances } = useWalletBalances() const [showStakingModal, setShowStakingModal] = useState(false) const [claimingLoading, setClaimingLoading] = useState(false) const stakingLoading = useRecoilValue(stakingLoadingAtom) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/ProfileCardMemberInfo.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/ProfileCardMemberInfo.tsx index a4d814282..ec24c6a3e 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/ProfileCardMemberInfo.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/ProfileCardMemberInfo.tsx @@ -25,7 +25,7 @@ import { DaoVotingNativeStakedHooks, useAwaitNextBlock, useWallet, - useWalletInfo, + useWalletBalances, } from '../../../../hooks' import { ProfileCardMemberInfoTokens } from '../../../components' import { useVotingModuleAdapterOptions } from '../../../react/context' @@ -42,7 +42,7 @@ export const ProfileCardMemberInfo = ({ const { address: walletAddress, isWalletConnected } = useWallet({ chainId, }) - const { refreshBalances } = useWalletInfo({ + const { refreshBalances } = useWalletBalances({ chainId, }) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/StakingModal.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/StakingModal.tsx index 0cf7d82cf..f2b145df2 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/StakingModal.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/StakingModal.tsx @@ -28,7 +28,7 @@ import { DaoVotingNativeStakedHooks, useAwaitNextBlock, useWallet, - useWalletInfo, + useWalletBalances, } from '../../../../hooks' import { useVotingModuleAdapterOptions } from '../../../react/context' import { useGovernanceTokenInfo, useStakingInfo } from '../hooks' @@ -49,7 +49,7 @@ const InnerStakingModal = ({ }: BaseStakingModalProps) => { const { t } = useTranslation() const { address: walletAddress, isWalletConnected } = useWallet() - const { refreshBalances } = useWalletInfo() + const { refreshBalances } = useWalletBalances() const { coreAddress, votingModuleAddress } = useVotingModuleAdapterOptions() const [stakingLoading, setStakingLoading] = useRecoilState(stakingLoadingAtom) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/ProfileCardMemberInfo.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/ProfileCardMemberInfo.tsx index b7f9558c1..487ae2d3a 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/ProfileCardMemberInfo.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/ProfileCardMemberInfo.tsx @@ -25,7 +25,7 @@ import { DaoVotingTokenStakedHooks, useAwaitNextBlock, useWallet, - useWalletInfo, + useWalletBalances, } from '../../../../hooks' import { ProfileCardMemberInfoTokens } from '../../../components' import { useVotingModuleAdapterOptions } from '../../../react/context' @@ -42,7 +42,7 @@ export const ProfileCardMemberInfo = ({ const { address: walletAddress, isWalletConnected } = useWallet({ chainId, }) - const { refreshBalances } = useWalletInfo({ + const { refreshBalances } = useWalletBalances({ chainId, }) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/StakingModal.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/StakingModal.tsx index 74086bb4c..95bb64378 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/StakingModal.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/StakingModal.tsx @@ -28,7 +28,7 @@ import { DaoVotingTokenStakedHooks, useAwaitNextBlock, useWallet, - useWalletInfo, + useWalletBalances, } from '../../../../hooks' import { useVotingModuleAdapterOptions } from '../../../react/context' import { useGovernanceTokenInfo, useStakingInfo } from '../hooks' @@ -49,7 +49,7 @@ const InnerStakingModal = ({ }: BaseStakingModalProps) => { const { t } = useTranslation() const { address: walletAddress, isWalletConnected } = useWallet() - const { refreshBalances } = useWalletInfo() + const { refreshBalances } = useWalletBalances() const { coreAddress, votingModuleAddress } = useVotingModuleAdapterOptions() const [stakingLoading, setStakingLoading] = useRecoilState(stakingLoadingAtom) diff --git a/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/StakingModal.tsx b/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/StakingModal.tsx index 5dfd5d1bc..283949b55 100644 --- a/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/StakingModal.tsx +++ b/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/StakingModal.tsx @@ -33,7 +33,7 @@ import { NeutronVaultHooks, useAwaitNextBlock, useWallet, - useWalletInfo, + useWalletBalances, } from '../../../../hooks' import { useVotingModuleAdapterOptions } from '../../../react/context' import { useVotingModule } from '../hooks' @@ -53,7 +53,7 @@ const InnerStakingModal = ({ }: BaseStakingModalProps) => { const { t } = useTranslation() const { address = '', isWalletConnected } = useWallet() - const { refreshBalances } = useWalletInfo() + const { refreshBalances } = useWalletBalances() const { coreAddress, chainId } = useVotingModuleAdapterOptions() const { loadingVaults } = useVotingModule() diff --git a/packages/stateless/components/EntityDisplay.tsx b/packages/stateless/components/EntityDisplay.tsx index 0a9cb20e3..5a98fc16f 100644 --- a/packages/stateless/components/EntityDisplay.tsx +++ b/packages/stateless/components/EntityDisplay.tsx @@ -95,6 +95,7 @@ export const EntityDisplay = ({ href={noLink ? undefined : href} onClick={(e) => !noLink && e.stopPropagation()} openInNewTab={openInNewTab} + prefetch variant={noUnderline || noLink || !href ? 'none' : 'underline'} > {!hideImage && ( diff --git a/packages/stateless/components/IbcDestinationChainPicker.tsx b/packages/stateless/components/IbcDestinationChainPicker.tsx index 4d57e0fa3..f24453f8e 100644 --- a/packages/stateless/components/IbcDestinationChainPicker.tsx +++ b/packages/stateless/components/IbcDestinationChainPicker.tsx @@ -2,13 +2,14 @@ import { ibc } from 'chain-registry' import { useMemo } from 'react' import { useDeepCompareMemoize } from 'use-deep-compare-effect' +import { ChainPickerPopupProps } from '@dao-dao/types' import { getChainForChainId, getChainForChainName, maybeGetChainForChainName, } from '@dao-dao/utils' -import { ChainPickerPopup, ChainPickerPopupProps } from './popup' +import { ChainPickerPopup } from './popup' export type IbcDestinationChainPickerProps = { /** diff --git a/packages/stateless/components/LinkWrapper.tsx b/packages/stateless/components/LinkWrapper.tsx index 64d75dca2..8a648dc3f 100644 --- a/packages/stateless/components/LinkWrapper.tsx +++ b/packages/stateless/components/LinkWrapper.tsx @@ -17,6 +17,7 @@ export const LinkWrapper = forwardRef( openInNewTab: _openInNewTab, shallow, replace, + prefetch = false, ...props }, ref @@ -63,6 +64,7 @@ export const LinkWrapper = forwardRef( className={contentClassName} href={href ?? '#'} onClick={onClick} + prefetch={prefetch} replace={replace} shallow={shallow} > diff --git a/packages/stateless/components/WarningCard.tsx b/packages/stateless/components/WarningCard.tsx index 445de3863..5fba1a540 100644 --- a/packages/stateless/components/WarningCard.tsx +++ b/packages/stateless/components/WarningCard.tsx @@ -10,6 +10,7 @@ export type WarningCardProps = { textClassName?: string size?: 'sm' | 'default' contentContainerClassName?: string + onClick?: () => void } export const WarningCard = ({ @@ -20,13 +21,17 @@ export const WarningCard = ({ textClassName, size = 'default', contentContainerClassName, + onClick, }: WarningCardProps) => (
( +export const ChainLabel = ({ + chainId, + header, + title, + className, +}: ChainLabelProps) => (
( ) : ( - + )} -

+

{getDisplayNameForChainId(chainId)}

diff --git a/packages/stateless/components/dao/DaoCard.tsx b/packages/stateless/components/dao/DaoCard.tsx index 1e892bc65..408c31a1a 100644 --- a/packages/stateless/components/dao/DaoCard.tsx +++ b/packages/stateless/components/dao/DaoCard.tsx @@ -48,6 +48,7 @@ export const DaoCard = ({ href={getDaoPath(coreAddress)} onMouseLeave={onMouseLeave} onMouseOver={onMouseOver} + prefetch >
{showIsMember && !lazyData.loading && lazyData.data.isMember ? ( diff --git a/packages/stateless/components/dao/tabs/TreasuryTab.tsx b/packages/stateless/components/dao/tabs/TreasuryTab.tsx index a51e5476a..6ff8ea466 100644 --- a/packages/stateless/components/dao/tabs/TreasuryTab.tsx +++ b/packages/stateless/components/dao/tabs/TreasuryTab.tsx @@ -181,7 +181,7 @@ export const TreasuryTab = ({ onSelect={({ chainId, address }) => { navigator.clipboard.writeText(address) toast.success( - t('info.copiedDaoChainAddress', { + t('info.copiedChainAddress', { chain: getDisplayNameForChainId(chainId), }) ) diff --git a/packages/stateless/components/inputs/DaoSupportedChainPickerInput.tsx b/packages/stateless/components/inputs/DaoSupportedChainPickerInput.tsx index 64075bd11..4d9358c64 100644 --- a/packages/stateless/components/inputs/DaoSupportedChainPickerInput.tsx +++ b/packages/stateless/components/inputs/DaoSupportedChainPickerInput.tsx @@ -2,8 +2,10 @@ import clsx from 'clsx' import { useFormContext } from 'react-hook-form' import { useTranslation } from 'react-i18next' +import { ChainPickerPopupProps } from '@dao-dao/types' + import { useChainContext, useDaoInfoContextIfAvailable } from '../../hooks' -import { ChainPickerPopup, ChainPickerPopupProps } from '../popup' +import { ChainPickerPopup } from '../popup' import { InputLabel } from './InputLabel' export type DaoSupportedChainPickerInputProps = { diff --git a/packages/stateless/components/layout/NavWallet.stories.tsx b/packages/stateless/components/layout/NavWallet.stories.tsx index 8992319ac..435d9d042 100644 --- a/packages/stateless/components/layout/NavWallet.stories.tsx +++ b/packages/stateless/components/layout/NavWallet.stories.tsx @@ -14,7 +14,7 @@ const Template: ComponentStory = (args) => ( export const Connected = Template.bind({}) Connected.args = { connected: true, - walletAddress: 'juno123abc987zyx', + disconnect: () => {}, } export const Connecting = Template.bind({}) diff --git a/packages/stateless/components/layout/NavWallet.tsx b/packages/stateless/components/layout/NavWallet.tsx index 3e591225c..0f66acd54 100644 --- a/packages/stateless/components/layout/NavWallet.tsx +++ b/packages/stateless/components/layout/NavWallet.tsx @@ -4,7 +4,7 @@ import clsx from 'clsx' import { NavWalletProps } from '@dao-dao/types' -import { ConnectWallet, NavWalletConnected } from '../wallet' +import { ConnectWallet, DisconnectWallet, NavWalletConnected } from '../wallet' export const NavWallet = ({ mode, ...props }: NavWalletProps) => (
( mode === 'sidebar' && '-mx-6 border-b border-border-secondary px-6 py-3 md:hidden', mode === 'header' && - 'min-w-72 hidden self-stretch border-l border-border-secondary pl-3 md:flex lg:pl-4' + 'hidden self-stretch border-l border-border-secondary pl-3 md:flex lg:pl-4' )} > {props.connected ? ( - + mode === 'sidebar' ? ( + + ) : ( + + ) ) : (
0 && 'border-t border-border-secondary', sectionClassName )} diff --git a/packages/stateless/components/popup/ChainPickerPopup.tsx b/packages/stateless/components/popup/ChainPickerPopup.tsx index 76563557c..a35b6dfc9 100644 --- a/packages/stateless/components/popup/ChainPickerPopup.tsx +++ b/packages/stateless/components/popup/ChainPickerPopup.tsx @@ -1,9 +1,10 @@ import { ArrowDropDown } from '@mui/icons-material' import clsx from 'clsx' -import { ComponentType, useMemo } from 'react' +import { useMemo } from 'react' import { useTranslation } from 'react-i18next' import { useDeepCompareMemoize } from 'use-deep-compare-effect' +import { ChainPickerPopupProps } from '@dao-dao/types' import { getConfiguredChains, getDisplayNameForChainId, @@ -14,97 +15,7 @@ import { toAccessibleImageUrl, } from '@dao-dao/utils' -import { FilterableItem, FilterableItemPopup } from '.' - -export type ChainPickerPopupProps = { - /** - * The chains to include in the picker. - */ - chains: - | { - /** - * Supported chains have native DAO DAO deployments. - */ - type: 'supported' - /** - * Chain IDs to exclude. - */ - excludeChainIds?: string[] - } - | { - /** - * Configured chains include supported chains and others which show up - * in the UI in various places, such as the governance UI. - */ - type: 'configured' - /** - * Chain IDs to exclude. - */ - excludeChainIds?: string[] - /** - * Only include chains with a governance module. This uses the `noGov` - * flag in chain config. - */ - onlyGov?: boolean - } - | { - /** - * Set any chains explicitly - */ - type: 'custom' - chainIds: string[] - } - /** - * The selected chain ID. If undefined, will select the none option if exists. - */ - selectedChainId?: string - /** - * Handler for when a chain is selected. If the none option is selected, the - * handler will be called with `undefined`. - */ - onSelect: (chainId?: string) => void | Promise - /** - * Whether to use the chain name or the native token symbol as the label. - * Defaults to 'chain'. - */ - labelMode?: 'chain' | 'token' - /** - * Whether or not to show a loading indicator. - */ - loading?: boolean - /** - * Whether or not chain selection is disabled. - */ - disabled?: boolean - /** - * Optional class name applied to the button. - */ - buttonClassName?: string - /** - * If true, a button will be shown at the top that represents none. - */ - showNone?: boolean - /** - * If defined, this will be the label of the none button. - */ - noneLabel?: string - /** - * If defined, this will be the icon of the none button. - */ - NoneIcon?: ComponentType<{ className?: string }> - /** - * If true, will make the button more like a text header instead. - */ - headerMode?: boolean - /** - * Optional class name applied to the selected chain icon. - */ - selectedIconClassName?: string - /** - * Optional class name applied to the selected chain label. - */ - selectedLabelClassName?: string -} +import { FilterableItem, FilterableItemPopup } from './FilterableItemPopup' /** * A popup that allows the user to select a chain. @@ -123,6 +34,7 @@ export const ChainPickerPopup = ({ headerMode, selectedIconClassName, selectedLabelClassName, + trigger, }: ChainPickerPopupProps) => { const { t } = useTranslation() @@ -194,60 +106,62 @@ export const ChainPickerPopup = ({ ? t('info.searchForChain') : t('info.searchForToken') } - trigger={{ - type: 'button', - tooltip: t('button.switchChain'), - props: { - className: buttonClassName, - contentContainerClassName: clsx( - 'justify-between text-icon-primary', - headerMode ? '!gap-1' : '!gap-4' - ), - loading, - disabled, - size: 'lg', - variant: headerMode ? 'none' : 'ghost_outline', - children: ( - <> -
- {selectedChain - ? !!selectedChain.iconUrl && ( -
- ) - : showNone && - NoneIcon && ( - - )} + trigger={ + trigger || { + type: 'button', + tooltip: t('button.switchChain'), + props: { + className: buttonClassName, + contentContainerClassName: clsx( + 'justify-between text-icon-primary', + headerMode ? '!gap-1' : '!gap-4' + ), + loading, + disabled, + size: 'lg', + variant: headerMode ? 'none' : 'ghost_outline', + children: ( + <> +
+ {selectedChain + ? !!selectedChain.iconUrl && ( +
+ ) + : showNone && + NoneIcon && ( + + )} -

- {selectedChain?.label || - (showNone && noneLabel) || - (labelMode === 'chain' - ? t('button.selectChain') - : t('button.selectToken'))} -

-
+

+ {selectedChain?.label || + (showNone && noneLabel) || + (labelMode === 'chain' + ? t('button.selectChain') + : t('button.selectToken'))} +

+
- {!disabled && } - - ), - }, - }} + {!disabled && } + + ), + }, + } + } /> ) } diff --git a/packages/stateless/components/popup/FilterableItemPopup.tsx b/packages/stateless/components/popup/FilterableItemPopup.tsx index 6b9d923d9..bfebdc4cf 100644 --- a/packages/stateless/components/popup/FilterableItemPopup.tsx +++ b/packages/stateless/components/popup/FilterableItemPopup.tsx @@ -22,7 +22,7 @@ import { Modal } from '../modals' import { NoContent } from '../NoContent' import { TriggerRenderer } from './Popup' -export interface FilterableItem { +export type FilterableItem = { key: string | number Icon?: ComponentType<{ className?: string }> iconUrl?: string @@ -35,9 +35,9 @@ export interface FilterableItem { contentContainerClassName?: string } -export interface FilterableItemPopupProps< +export type FilterableItemPopupProps< T extends FilterableItem = FilterableItem -> { +> = { trigger: PopupTrigger items: T[] filterableItemKeys: Fuse.FuseOptionKey[] diff --git a/packages/stateless/components/popup/Popup.tsx b/packages/stateless/components/popup/Popup.tsx index c68b3c524..a748813d5 100644 --- a/packages/stateless/components/popup/Popup.tsx +++ b/packages/stateless/components/popup/Popup.tsx @@ -22,6 +22,7 @@ export const Popup = ({ onClose, openRef, setOpenRef, + topOffset = 0, }: PopupProps) => { const wrapperRef = useRef(null) @@ -122,7 +123,7 @@ export const Popup = ({ // Track button to position the dropdown. const { onDropdownRef, onTrackRef } = useTrackDropdown({ // Offset for outline of Trigger. - top: (rect) => rect.bottom + 4, + top: (rect) => rect.bottom + 4 + topOffset, left: position === 'right' ? (rect) => rect.left - 2 diff --git a/packages/stateless/pages/MeTransactionBuilder.stories.tsx b/packages/stateless/components/profile/ProfileActions.stories.tsx similarity index 84% rename from packages/stateless/pages/MeTransactionBuilder.stories.tsx rename to packages/stateless/components/profile/ProfileActions.stories.tsx index fbd2c9112..a8196403f 100644 --- a/packages/stateless/pages/MeTransactionBuilder.stories.tsx +++ b/packages/stateless/components/profile/ProfileActions.stories.tsx @@ -1,7 +1,7 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' import { useForm } from 'react-hook-form' -import { SuspenseLoader } from '@dao-dao/stateful' +import { SuspenseLoader, WalletChainSwitcher } from '@dao-dao/stateful' import { useLoadedActionsAndCategories } from '@dao-dao/stateful/actions' import { WalletActionsProviderDecorator, @@ -10,19 +10,19 @@ import { } from '@dao-dao/storybook/decorators' import { AccountTxForm, ActionKey } from '@dao-dao/types' -import { MeTransactionBuilder } from './MeTransactionBuilder' +import { ProfileActions } from './ProfileActions' export default { - title: 'DAO DAO / packages / stateless / pages / MeTransactionBuilder', - component: MeTransactionBuilder, + title: 'DAO DAO / packages / stateless / pages / ProfileActions', + component: ProfileActions, decorators: [ WalletProviderDecorator, makeDappLayoutDecorator(), WalletActionsProviderDecorator, ], -} as ComponentMeta +} as ComponentMeta -const Template: ComponentStory = (args) => { +const Template: ComponentStory = (args) => { const { loadedActions, categories } = useLoadedActionsAndCategories() const formMethods = useForm({ @@ -33,7 +33,7 @@ const Template: ComponentStory = (args) => { }) return ( - @@ -65,9 +60,10 @@ export type MeTransactionBuilderProps = { save: (save: AccountTxSave) => Promise deleteSave: (save: AccountTxSave) => Promise saving: boolean + WalletChainSwitcher: ComponentType } -export const MeTransactionBuilder = ({ +export const ProfileActions = ({ categories, loadedActions, formMethods, @@ -80,7 +76,8 @@ export const MeTransactionBuilder = ({ save, deleteSave, saving, -}: MeTransactionBuilderProps) => { + WalletChainSwitcher, +}: ProfileActionsProps) => { const { t } = useTranslation() const { config } = useChainContext() @@ -167,9 +164,13 @@ export const MeTransactionBuilder = ({ return (
-

- {t('info.transactionBuilderDescription')} -

+
+

+ {t('info.transactionBuilderDescription')} +

+ + +
{ + const { t } = useTranslation() + + const { control, watch, setValue, handleSubmit } = + useFormContext() + const chainsBeingAdded = watch('chains') + const { append: appendChain } = useFieldArray({ + control, + name: 'chains', + }) + + return ( + + chainId)), + ...chainsBeingAdded.map(({ chainId }) => chainId), + ], + }} + onSelect={(chainId) => { + // Type-check. None option is disabled so should not be possible. + if (!chainId || chainsBeingAdded.some((c) => c.chainId === chainId)) { + return + } + + appendChain({ + chainId, + checked: true, + status: 'idle', + }) + + if (onAddChains && autoAdd) { + handleSubmit(onAddChains)() + } + }} + trigger={{ + type: 'button', + tooltip: promptTooltip, + props: { + className: 'self-start', + contentContainerClassName: clsx('!secondary-text', promptClassName), + variant: 'underline', + children: ( + <> + {!!promptTooltip && ( + // Show info icon to indicate tooltip is available. + + )} + + {prompt} + + ), + disabled, + }, + }} + /> + + {chainsBeingAdded.length > 0 && ( +
+
+ {chainsBeingAdded.map(({ chainId, checked, status }, index) => ( +
setValue(`chains.${index}.checked`, !checked)} + > + {status === 'idle' ? ( + + ) : status === 'loading' ? ( +
+ +
+ ) : status === 'done' ? ( + + ) : null} + + +
+ ))} +
+ + +
+ )} + + ) +} diff --git a/packages/stateless/components/profile/ProfileCantVoteCard.stories.tsx b/packages/stateless/components/profile/ProfileCantVoteCard.stories.tsx index 4805ca61d..74ee7792c 100644 --- a/packages/stateless/components/profile/ProfileCantVoteCard.stories.tsx +++ b/packages/stateless/components/profile/ProfileCantVoteCard.stories.tsx @@ -24,7 +24,10 @@ const Template: ComponentStory = (args) => ( export const Default = Template.bind({}) Default.args = { daoName: 'Dog Dao', - walletProfileData: WALLET_PROFILE_DATA, + profile: { + loading: false, + data: WALLET_PROFILE_DATA, + }, isMember: false, membershipInfo: ( = (args) => ( export const Default = Template.bind({}) Default.args = { - walletProfileData: WALLET_PROFILE_DATA, + profile: { + loading: false, + data: WALLET_PROFILE_DATA, + }, underHeaderComponent: , children:

Content!

, } @@ -36,12 +36,17 @@ Default.parameters = { export const DefaultLoading = Template.bind({}) DefaultLoading.args = { ...Default.args, - walletProfileData: WALLET_PROFILE_DATA_LOADING, + profile: { + loading: true, + }, } export const Compact = Template.bind({}) Compact.args = { - walletProfileData: WALLET_PROFILE_DATA, + profile: { + loading: false, + data: WALLET_PROFILE_DATA, + }, compact: true, children:

Content!

, } @@ -55,5 +60,7 @@ Compact.parameters = { export const CompactLoading = Template.bind({}) CompactLoading.args = { ...Compact.args, - walletProfileData: WALLET_PROFILE_DATA_LOADING, + profile: { + loading: true, + }, } diff --git a/packages/stateless/components/profile/ProfileCardWrapper.tsx b/packages/stateless/components/profile/ProfileCardWrapper.tsx index c4df0b5e3..22b216503 100644 --- a/packages/stateless/components/profile/ProfileCardWrapper.tsx +++ b/packages/stateless/components/profile/ProfileCardWrapper.tsx @@ -10,9 +10,7 @@ import { ProfileNameDisplayAndEditor } from './ProfileNameDisplayAndEditor' export const ProfileCardWrapper = ({ children, - walletProfileData, - showUpdateProfileNft, - updateProfileName, + profile, compact = false, underHeaderComponent, childContainerClassName, @@ -20,9 +18,9 @@ export const ProfileCardWrapper = ({ }: ProfileCardWrapperProps) => { // Get average color of image URL if in compact mode. const averageImgColorLoadable = useCachedLoadable( - !compact || walletProfileData.loading + !compact || profile.loading ? undefined - : averageColorSelector(walletProfileData.profile.imageUrl) + : averageColorSelector(profile.data.imageUrl) ) const averageImgColor = averageImgColorLoadable.state === 'hasValue' && @@ -32,8 +30,6 @@ export const ProfileCardWrapper = ({ (averageImgColorLoadable.contents.length === 7 ? '33' : '') : undefined - const canEdit = walletProfileData.profile.nonce >= 0 - return (
{underHeaderComponent}
@@ -69,16 +63,14 @@ export const ProfileCardWrapper = ({
{underHeaderComponent}
diff --git a/packages/stateless/components/profile/ProfileImage.tsx b/packages/stateless/components/profile/ProfileImage.tsx index 219fa19a4..07cc05dbd 100644 --- a/packages/stateless/components/profile/ProfileImage.tsx +++ b/packages/stateless/components/profile/ProfileImage.tsx @@ -4,14 +4,13 @@ import { forwardRef, useEffect, useState } from 'react' import { toAccessibleImageUrl } from '@dao-dao/utils' -export interface ProfileImageProps { +export type ProfileImageProps = { imageUrl?: string loading?: boolean - size: 'xs' | 'sm' | 'lg' | 'xl' + size: 'xs' | 'sm' | 'md' | 'lg' | 'header' className?: string fallbackIconClassName?: string onClick?: () => void - onEdit?: () => void rounded?: boolean disabled?: boolean } @@ -25,7 +24,6 @@ export const ProfileImage = forwardRef( className, fallbackIconClassName, onClick, - onEdit, rounded, }, ref @@ -53,9 +51,10 @@ export const ProfileImage = forwardRef( const sizingRoundingClassNames = clsx( { 'h-6 w-6 rounded-full': size === 'xs', - 'h-10 w-10 rounded-xl': size === 'sm', + 'h-8 w-8 rounded-lg': size === 'sm', + 'h-10 w-10 rounded-xl': size === 'md', 'h-16 w-16 rounded-2xl': size === 'lg', - 'h-24 w-24 rounded-full': size === 'xl', + 'h-24 w-24 rounded-full': size === 'header', }, rounded && '!rounded-full' ) @@ -71,10 +70,8 @@ export const ProfileImage = forwardRef( sizingRoundingClassNames, // Pulse person placeholder when loading. loadingImage && 'animate-pulse !border-border-interactive-disabled', - // Make clickable for onClick and onEdit. - (onClick || onEdit) && 'cursor-pointer', - // Enable group events for onEdit. - onEdit && 'group/profileimage', + // Make clickable for onClick. Enale group events. + onClick && 'group/profileimage cursor-pointer', className )} @@ -85,7 +82,7 @@ export const ProfileImage = forwardRef(
( )} /> - {/* Edit icon */} - {onEdit && ( + {/* Click icon */} + {onClick && (
( showingPlaceholder ? 'opacity-70' : 'opacity-0', sizingRoundingClassNames )} - onClick={onEdit} + onClick={onClick} > {!loadingImage && ( diff --git a/packages/stateless/components/profile/ProfileMemberCard.stories.tsx b/packages/stateless/components/profile/ProfileMemberCard.stories.tsx index 727bb3c64..4e548cbe1 100644 --- a/packages/stateless/components/profile/ProfileMemberCard.stories.tsx +++ b/packages/stateless/components/profile/ProfileMemberCard.stories.tsx @@ -24,14 +24,15 @@ const makeProps = ( ...args: Parameters ): ProfileMemberCardProps => ({ daoName: 'A Very Real DAO', - walletProfileData: WALLET_PROFILE_DATA, + profile: { + loading: false, + data: WALLET_PROFILE_DATA, + }, membershipInfo: ( ), - showUpdateProfileNft: () => {}, - updateProfileName: async () => {}, }) export const Default = Template.bind({}) diff --git a/packages/stateless/components/profile/ProfileNameDisplayAndEditor.tsx b/packages/stateless/components/profile/ProfileNameDisplayAndEditor.tsx index ab0103388..fee62b2d7 100644 --- a/packages/stateless/components/profile/ProfileNameDisplayAndEditor.tsx +++ b/packages/stateless/components/profile/ProfileNameDisplayAndEditor.tsx @@ -4,7 +4,12 @@ import { useCallback, useState } from 'react' import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' -import { ChainId, WalletProfileData } from '@dao-dao/types' +import { + ChainId, + LoadingData, + PfpkProfileUpdateFunction, + UnifiedProfile, +} from '@dao-dao/types' import { processError } from '@dao-dao/utils' import { Button } from '../buttons' @@ -12,32 +17,30 @@ import { ChainLogo } from '../chain/ChainLogo' import { IconButton } from '../icon_buttons' import { TextInput } from '../inputs' import { Loader } from '../logo' -import { Tooltip } from '../tooltip' +import { Tooltip, TooltipInfoIcon } from '../tooltip' export type ProfileNameDisplayAndEditorProps = { - walletProfileData: WalletProfileData + profile: LoadingData compact?: boolean - updateProfileName?: (name: string | null) => Promise + updateProfile?: PfpkProfileUpdateFunction className?: string - nameClassName?: string - // The height of this should match the line-height of the name. - editingContainerClassName?: string + header?: boolean editingClassName?: string + hideNoNameTooltip?: boolean } export const ProfileNameDisplayAndEditor = ({ compact, - walletProfileData, - updateProfileName, + profile, + updateProfile, className, - nameClassName = '!title-text', - // h-5 matches the line-height of title-text. - editingContainerClassName = 'h-5', + header, editingClassName, + hideNoNameTooltip, }: ProfileNameDisplayAndEditorProps) => { const { t } = useTranslation() - const canEdit = !!updateProfileName && walletProfileData.profile.nonce >= 0 + const canEdit = !!updateProfile && !profile.loading && profile.data.nonce >= 0 // If set, will show edit input. const [editingName, setEditingName] = useState() @@ -51,7 +54,7 @@ export const ProfileNameDisplayAndEditor = ({ setSavingName(true) try { // Empty names unset. - await updateProfileName(editingName.trim() || null) + await updateProfile({ name: editingName.trim() || null }) // Stop editing on success. setEditingName(undefined) } catch (err) { @@ -64,10 +67,13 @@ export const ProfileNameDisplayAndEditor = ({ } finally { setSavingName(false) } - }, [canEdit, editingName, updateProfileName]) + }, [canEdit, editingName, updateProfile]) - const noNameSet = - !walletProfileData.loading && walletProfileData.profile.name === null + const noNameSet = !profile.loading && profile.data.name === null + + const nameClassName = clsx('title-text', header && '!text-2xl !font-bold') + // Height should match text line-height. + const editingContainerClassName = header ? 'h-8 !min-w-72' : 'h-5' return (
@@ -134,43 +140,51 @@ export const ProfileNameDisplayAndEditor = ({ contentContainerClassName={clsx(canEdit && compact && 'pr-6')} disabled={!canEdit} onClick={() => - !walletProfileData.loading && + !profile.loading && setEditingName( // Prefill name editor with current name from PFPK. If name from // other name service, allow overriding name, but default to // empty. - walletProfileData.profile.nameSource === 'pfpk' - ? walletProfileData.profile.name ?? '' - : '' + profile.data.nameSource === 'pfpk' ? profile.data.name ?? '' : '' ) } variant="none" > - {!walletProfileData.loading && - walletProfileData.profile.nameSource === 'stargaze' && ( - - - - )} + {!profile.loading && profile.data.nameSource === 'stargaze' && ( + + + + )}

- {walletProfileData.loading + {profile.loading ? '...' : noNameSet ? canEdit ? t('button.setDisplayName') : t('info.noDisplayName') - : walletProfileData.profile.name} + : profile.data.name}

+ {!canEdit && !profile.loading && noNameSet && !hideNoNameTooltip && ( + + )} + {canEdit && ( , } diff --git a/packages/stateless/components/profile/ProfileWallet.stories.tsx b/packages/stateless/components/profile/ProfileWallet.stories.tsx new file mode 100644 index 000000000..785878525 --- /dev/null +++ b/packages/stateless/components/profile/ProfileWallet.stories.tsx @@ -0,0 +1,53 @@ +import { ComponentMeta, ComponentStory } from '@storybook/react' + +import { ProfileAddChains, WalletTokenLine } from '@dao-dao/stateful' +import { TokenCardProps } from '@dao-dao/types' + +import { makeProps as makeTokenCardProps } from '../token/TokenCard.stories' +import { ProfileWallet } from './ProfileWallet' + +export default { + title: 'DAO DAO / packages / stateless / pages / profile / ProfileWallet', + component: ProfileWallet, +} as ComponentMeta> + +const Template: ComponentStory> = ( + args +) => + +export const Default = Template.bind({}) +Default.args = { + chains: { + loading: false, + data: [], + }, + tokens: { + loading: false, + errored: false, + data: [makeTokenCardProps(true), makeTokenCardProps()], + }, + hiddenTokens: { + loading: false, + errored: false, + data: [], + }, + TokenLine: WalletTokenLine, + ProfileAddChains, +} + +export const Loading = Template.bind({}) +Loading.args = { + chains: { + loading: true, + }, + tokens: { + loading: true, + errored: false, + }, + hiddenTokens: { + loading: true, + errored: false, + }, + TokenLine: WalletTokenLine, + ProfileAddChains, +} diff --git a/packages/stateless/components/profile/ProfileWallet.tsx b/packages/stateless/components/profile/ProfileWallet.tsx new file mode 100644 index 000000000..31fcf8403 --- /dev/null +++ b/packages/stateless/components/profile/ProfileWallet.tsx @@ -0,0 +1,182 @@ +import { CopyAll, WarningRounded } from '@mui/icons-material' +import clsx from 'clsx' +import { useState } from 'react' +import toast from 'react-hot-toast' +import { useTranslation } from 'react-i18next' + +import { ProfileWalletProps, TokenCardInfo } from '@dao-dao/types' +import { + concatAddressStartEnd, + getDisplayNameForChainId, + getImageUrlForChainId, + sortTokensValueDescending, +} from '@dao-dao/utils' + +import { Button } from '../buttons' +import { ErrorPage } from '../error' +import { DropdownIconButton } from '../icon_buttons' +import { LineLoaders } from '../LineLoader' +import { NoContent } from '../NoContent' +import { FilterableItemPopup } from '../popup' +import { TokenLineHeader } from '../token/TokenLineHeader' + +export const ProfileWallet = ({ + chains, + tokens, + hiddenTokens, + TokenLine, + ProfileAddChains, +}: ProfileWalletProps) => { + const { t } = useTranslation() + + const visibleBalances = + tokens.loading || + tokens.errored || + hiddenTokens.loading || + hiddenTokens.errored + ? [] + : tokens.data + .filter( + ({ token }) => !hiddenTokens.data.includes(token.denomOrAddress) + ) + .sort(sortTokensValueDescending) + const hiddenBalances = + tokens.loading || + tokens.errored || + hiddenTokens.loading || + hiddenTokens.errored + ? [] + : tokens.data + .filter(({ token }) => + hiddenTokens.data.includes(token.denomOrAddress) + ) + .sort(sortTokensValueDescending) + + const [showingHidden, setShowingHidden] = useState(false) + + return ( +
+
+

{t('title.tokens')}

+ + ({ + key: chainId + address, + label: getDisplayNameForChainId(chainId), + iconUrl: getImageUrlForChainId(chainId), + rightNode: ( +

+ {concatAddressStartEnd(address, 10, 6)} +

+ ), + iconClassName: '!h-8 !w-8', + contentContainerClassName: '!gap-4', + chainId, + address, + })) + } + onSelect={({ chainId, address }) => { + navigator.clipboard.writeText(address) + toast.success( + t('info.copiedChainAddress', { + chain: getDisplayNameForChainId(chainId), + }) + ) + }} + searchPlaceholder={t('info.searchForChain')} + trigger={{ + type: 'button', + props: { + className: 'self-start', + variant: 'secondary', + contentContainerClassName: '!gap-1', + children: ( + <> + + {t('button.copyAddress')} + + ), + }, + }} + /> +
+ +
+ {tokens.loading || + hiddenTokens.loading || + (!tokens.errored && tokens.data.length > 0) ? ( +
+ + + {tokens.loading || hiddenTokens.loading ? ( + + ) : ( +
+ {visibleBalances.map((props, index) => ( + + ))} +
+ )} +
+ ) : tokens.errored ? ( + + ) : ( + + )} + + {hiddenBalances.length > 0 && ( +
+
+ setShowingHidden((s) => !s)} + /> + + +
+ +
+ {hiddenBalances.map((props, index) => ( + + ))} +
+
+ )} +
+ + +
+ ) +} + +const FILTERABLE_KEYS = ['label', 'chainId', 'address'] diff --git a/packages/stateless/components/profile/index.tsx b/packages/stateless/components/profile/index.ts similarity index 71% rename from packages/stateless/components/profile/index.tsx rename to packages/stateless/components/profile/index.ts index 16e25d741..8e54383ab 100644 --- a/packages/stateless/components/profile/index.tsx +++ b/packages/stateless/components/profile/index.ts @@ -1,7 +1,10 @@ export * from './MembershipPill' +export * from './ProfileAddChains' +export * from './ProfileActions' export * from './ProfileCantVoteCard' export * from './ProfileCardWrapper' export * from './ProfileImage' export * from './ProfileMemberCard' export * from './ProfileNameDisplayAndEditor' export * from './ProfileVoteCard' +export * from './ProfileWallet' diff --git a/packages/stateless/components/vesting/VestingPaymentCard.tsx b/packages/stateless/components/vesting/VestingPaymentCard.tsx index a494b6e4e..a2e1f9490 100644 --- a/packages/stateless/components/vesting/VestingPaymentCard.tsx +++ b/packages/stateless/components/vesting/VestingPaymentCard.tsx @@ -287,7 +287,7 @@ export const VestingPaymentCard = ({ )} diff --git a/packages/stateless/components/wallet/DisconnectWallet.tsx b/packages/stateless/components/wallet/DisconnectWallet.tsx index 113b1ffe2..81a9328ae 100644 --- a/packages/stateless/components/wallet/DisconnectWallet.tsx +++ b/packages/stateless/components/wallet/DisconnectWallet.tsx @@ -1,4 +1,5 @@ import { SensorsOff } from '@mui/icons-material' +import clsx from 'clsx' import { forwardRef } from 'react' import { useTranslation } from 'react-i18next' @@ -7,7 +8,7 @@ import { ButtonProps } from '@dao-dao/types' import { Button } from '../buttons' export interface DisconnectWalletProps - extends Partial> { + extends Partial> { onDisconnect?: () => void className?: string } @@ -15,12 +16,18 @@ export interface DisconnectWalletProps export const DisconnectWallet = forwardRef< HTMLButtonElement, DisconnectWalletProps ->(function DisconnectWallet({ onDisconnect, ...props }, ref) { +>(function DisconnectWallet({ onDisconnect, size = 'lg', ...props }, ref) { const { t } = useTranslation() return ( - ) diff --git a/packages/stateless/components/wallet/NavWalletConnected.stories.tsx b/packages/stateless/components/wallet/NavWalletConnected.stories.tsx index d5bc59c5f..62863acf5 100644 --- a/packages/stateless/components/wallet/NavWalletConnected.stories.tsx +++ b/packages/stateless/components/wallet/NavWalletConnected.stories.tsx @@ -16,5 +16,4 @@ const Template: ComponentStory = (args) => ( export const Default = Template.bind({}) Default.args = { wallet: keplrWallets[0].walletInfo, - walletAddress: 'juno123abx789xyz', } diff --git a/packages/stateless/components/wallet/NavWalletConnected.tsx b/packages/stateless/components/wallet/NavWalletConnected.tsx index cd98bd2f8..ab8bf4fa2 100644 --- a/packages/stateless/components/wallet/NavWalletConnected.tsx +++ b/packages/stateless/components/wallet/NavWalletConnected.tsx @@ -1,34 +1,36 @@ -import { fromBech32 } from '@cosmjs/encoding' import { - Check, Logout, NotificationsOutlined, - Wallet as WalletIcon, + Person, + WarningAmberRounded, } from '@mui/icons-material' import clsx from 'clsx' -import { useEffect, useState } from 'react' +import { useCallback, useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' -import { DaoPageMode, NavWalletConnectedProps } from '@dao-dao/types' +import { + DaoPageMode, + NavWalletConnectedProps, + PopupTriggerCustomComponent, +} from '@dao-dao/types' -import { CopyableAddress } from '../CopyableAddress' import { IconButton } from '../icon_buttons' import { useAppContextIfAvailable } from '../layout/AppContext' import { Notifications } from '../Notifications' -import { Popup } from '../popup' -import { ProfileImage, ProfileNameDisplayAndEditor } from '../profile' +import { ButtonPopup, Popup } from '../popup' +import { ProfileImage } from '../profile' import { Tooltip } from '../tooltip' import { WalletLogo } from './WalletLogo' export const NavWalletConnected = ({ wallet, - walletAddress, - walletProfileData, - updateProfileName, - onEditProfileImage, + profile, + otherProfilesExist, + onMergeProfiles, disconnect, className, mode, + ButtonLink, ...notificationsProps }: NavWalletConnectedProps) => { const { t } = useTranslation() @@ -44,11 +46,43 @@ export const NavWalletConnected = ({ return () => clearTimeout(timeout) }, [copied]) - // Try to get wallet prefix length so we shorten the address well. - let prefixLength = 5 - try { - prefixLength = fromBech32(walletAddress).prefix.length - } catch {} + const ProfileImagePopup: PopupTriggerCustomComponent = useCallback( + ({ onClick }) => ( +
+ + + + + +
+ ), + [mode, t, wallet, profile] + ) return (
- {/* Icon overflows a bit on the bottom, so add extra room with pb-1. */} -
- {/* Image */} -
- - - 0 + ? t('title.notificationsWithCount', { + count: inbox.items.length, + }) + : t('title.notifications'), + props: { + Icon: NotificationsOutlined, + className: 'text-icon-secondary relative', + variant: 'ghost', + size: 'sm', + // Show badge when notifications exist. + children: !inbox.loading && inbox.items.length > 0 && ( +
+ ), + }, + }} > - -
-
+
+

{t('title.notifications')}

- {mode !== 'dock' && ( -
- +
+ {notificationsProps.inbox.buttons.refresh} + {notificationsProps.inbox.buttons.clear} + {notificationsProps.inbox.buttons.settings} +
+
- setCopied(true)} - takeStartEnd={{ start: prefixLength + 5, end: 5 }} - textClassName="!legend-text" + -
+ )} -
- - {/* Buttons */} - {mode !== 'dock' && ( - <> - {/* Notification popup */} - {appMode === DaoPageMode.Dapp && inbox && notificationsProps.inbox && ( - 0 - ? t('title.notificationsWithCount', { - count: inbox.items.length, - }) - : t('title.notifications'), - props: { - Icon: NotificationsOutlined, - className: 'text-icon-secondary relative', - variant: 'ghost', - size: 'sm', - // Show badge when notifications exist. - children: !inbox.loading && inbox.items.length > 0 && ( -
- ), - }, - }} - > -
-

{t('title.notifications')}

- -
- {notificationsProps.inbox.buttons.refresh} - {notificationsProps.inbox.buttons.clear} - {notificationsProps.inbox.buttons.settings} -
-
- - -
- )} - {/* Log out */} - + {mode !== 'dock' && + !profile.loading && + profile.data.nonce > -1 && + otherProfilesExist && ( + - - )} + )} + + {/* Icon overflows a bit on the bottom, so add extra room with pb-1. */} +
+ {/* Image */} + +
) } diff --git a/packages/stateless/components/wallet/WalletBalances.stories.tsx b/packages/stateless/components/wallet/WalletBalances.stories.tsx deleted file mode 100644 index 457013d41..000000000 --- a/packages/stateless/components/wallet/WalletBalances.stories.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import { ComponentMeta, ComponentStory } from '@storybook/react' - -import { WalletTokenLine } from '@dao-dao/stateful' -import { TokenCardProps } from '@dao-dao/types' - -import { NftCard, NftCardProps } from '../nft/NftCard' -import { makeProps as makeNftCardProps } from '../nft/NftCard.stories' -import { makeProps as makeTokenCardProps } from '../token/TokenCard.stories' -import { WalletBalances } from './WalletBalances' - -export default { - title: 'DAO DAO / packages / stateless / pages / WalletBalances', - component: WalletBalances, -} as ComponentMeta> - -const Template: ComponentStory< - typeof WalletBalances -> = (args) => - -export const Default = Template.bind({}) -Default.args = { - tokens: { - loading: false, - errored: false, - data: [makeTokenCardProps(true), makeTokenCardProps()], - }, - hiddenTokens: { - loading: false, - data: [], - }, - TokenLine: WalletTokenLine, - nfts: { - loading: false, - errored: false, - data: [ - makeNftCardProps(), - makeNftCardProps(), - makeNftCardProps(), - makeNftCardProps(), - makeNftCardProps(), - ], - }, - NftCard, -} - -export const Loading = Template.bind({}) -Loading.args = { - tokens: { - loading: true, - errored: false, - }, - hiddenTokens: { loading: true }, - TokenLine: WalletTokenLine, - nfts: { - loading: true, - errored: false, - }, - NftCard, -} diff --git a/packages/stateless/components/wallet/WalletBalances.tsx b/packages/stateless/components/wallet/WalletBalances.tsx deleted file mode 100644 index 1aa831204..000000000 --- a/packages/stateless/components/wallet/WalletBalances.tsx +++ /dev/null @@ -1,123 +0,0 @@ -import clsx from 'clsx' -import { useState } from 'react' -import { useTranslation } from 'react-i18next' - -import { - LazyNftCardInfo, - TokenCardInfo, - WalletBalancesProps, -} from '@dao-dao/types' - -import { useButtonPopupSorter, useTokenSortOptions } from '../../hooks' -import { Button } from '../buttons' -import { ErrorPage } from '../error' -import { DropdownIconButton } from '../icon_buttons' -import { LineLoaders } from '../LineLoader' -import { NftSection } from '../nft/NftSection' -import { ButtonPopup } from '../popup' -import { TokenLineHeader } from '../token/TokenLineHeader' - -export const WalletBalances = < - T extends TokenCardInfo, - N extends LazyNftCardInfo ->({ - tokens, - hiddenTokens, - TokenLine, - nfts, - NftCard, -}: WalletBalancesProps) => { - const { t } = useTranslation() - - const tokenSortOptions = useTokenSortOptions() - const { - sortedData: sortedTokens, - buttonPopupProps: sortTokenButtonPopupProps, - } = useButtonPopupSorter({ - data: tokens.loading || tokens.errored ? undefined : tokens.data, - options: tokenSortOptions, - }) - - const visibleBalances = hiddenTokens.loading - ? [] - : sortedTokens.filter( - ({ token }) => !hiddenTokens.data.includes(token.denomOrAddress) - ) - const hiddenBalances = hiddenTokens.loading - ? [] - : sortedTokens.filter(({ token }) => - hiddenTokens.data.includes(token.denomOrAddress) - ) - - const [showingHidden, setShowingHidden] = useState(false) - - return ( -
-
- {tokens.loading || - hiddenTokens.loading || - (!tokens.errored && tokens.data.length > 0) ? ( -
-
- -
- - - - {tokens.loading || hiddenTokens.loading ? ( - - ) : ( -
- {visibleBalances.map((props, index) => ( - - ))} -
- )} -
- ) : tokens.errored ? ( - - ) : ( -

{t('info.nothingFound')}

- )} - - {hiddenBalances.length > 0 && ( -
-
- setShowingHidden((s) => !s)} - /> - - -
- -
- {hiddenBalances.map((props, index) => ( - - ))} -
-
- )} -
- - -
- ) -} diff --git a/packages/stateless/components/wallet/WalletDaos.tsx b/packages/stateless/components/wallet/WalletDaos.tsx index cf6b13e17..16229686d 100644 --- a/packages/stateless/components/wallet/WalletDaos.tsx +++ b/packages/stateless/components/wallet/WalletDaos.tsx @@ -1,9 +1,9 @@ import { WarningRounded } from '@mui/icons-material' import Fuse from 'fuse.js' -import { ComponentType, useState } from 'react' +import { useState } from 'react' import { useTranslation } from 'react-i18next' -import { LazyDaoCardProps, LoadingDataWithError } from '@dao-dao/types' +import { LazyDaoCardProps, WalletDaosProps } from '@dao-dao/types' import { useQuerySyncedState, useSearchFilter } from '../../hooks' import { Collapsible } from '../Collapsible' @@ -15,12 +15,12 @@ import { Logo } from '../logo' import { NoContent } from '../NoContent' import { ChainPickerPopup } from '../popup' -export type WalletDaosProps = { - daos: LoadingDataWithError - LazyDaoCard: ComponentType -} - -export const WalletDaos = ({ daos, LazyDaoCard }: WalletDaosProps) => { +export const WalletDaos = ({ + chainIds, + daos, + LazyDaoCard, + onChainSelect, +}: WalletDaosProps) => { const { t } = useTranslation() const allDaos = daos.loading || daos.errored || !daos.data ? [] : daos.data @@ -55,9 +55,17 @@ export const WalletDaos = ({ daos, LazyDaoCard }: WalletDaosProps) => { { + setChainId(chainId) + if (chainId) { + onChainSelect?.(chainId) + } + }} selectedChainId={chainId} showNone /> diff --git a/packages/stateless/components/wallet/WalletProfileHeader.tsx b/packages/stateless/components/wallet/WalletProfileHeader.tsx index 85407db97..46f980384 100644 --- a/packages/stateless/components/wallet/WalletProfileHeader.tsx +++ b/packages/stateless/components/wallet/WalletProfileHeader.tsx @@ -1,19 +1,27 @@ import clsx from 'clsx' +import { useTranslation } from 'react-i18next' import { WalletProfileHeaderProps } from '@dao-dao/types' import { ProfileImage, ProfileNameDisplayAndEditor } from '../profile' +import { WarningCard } from '../WarningCard' export const WalletProfileHeader = ({ editable, - profileData, - updateProfileName, + profile, + otherProfilesExist, + openMergeProfilesModal, + updateProfile, openProfileNftUpdate, className, children, }: WalletProfileHeaderProps) => { + const { t } = useTranslation() const canEditProfile = - editable && !profileData.loading && profileData.profile.nonce >= 0 + editable && + !profile.loading && + profile.data.nonce >= 0 && + !otherProfilesExist return (
+ {editable && + !profile.loading && + profile.data.nonce > -1 && + otherProfilesExist && ( + + )} + {children} diff --git a/packages/stateless/components/wallet/index.tsx b/packages/stateless/components/wallet/index.ts similarity index 85% rename from packages/stateless/components/wallet/index.tsx rename to packages/stateless/components/wallet/index.ts index 70a0b1212..c1be0ef89 100644 --- a/packages/stateless/components/wallet/index.tsx +++ b/packages/stateless/components/wallet/index.ts @@ -1,7 +1,6 @@ export * from './ConnectWallet' export * from './DisconnectWallet' export * from './NavWalletConnected' -export * from './WalletBalances' export * from './WalletDaos' export * from './WalletLogo' export * from './WalletProfileHeader' diff --git a/packages/stateless/hooks/useAddToken.ts b/packages/stateless/hooks/useAddToken.ts index d8ed2724e..8b5c552ba 100644 --- a/packages/stateless/hooks/useAddToken.ts +++ b/packages/stateless/hooks/useAddToken.ts @@ -15,10 +15,7 @@ export const useAddToken = () => { // Can only add tokens to Keplr on mainnet. MAINNET ? async (address: string) => { - const keplr = await ( - await import('@keplr-wallet/stores') - ).getKeplrFromWindow() - if (keplr && (await suggestToken(chainId, keplr, address))) { + if (await suggestToken(chainId, address)) { toast.success(t('success.addedToken')) } else { toast.error(t('error.logInToContinue')) diff --git a/packages/stateless/hooks/useTokenSortOptions.ts b/packages/stateless/hooks/useTokenSortOptions.ts index 4545e2d8e..28594ffe2 100644 --- a/packages/stateless/hooks/useTokenSortOptions.ts +++ b/packages/stateless/hooks/useTokenSortOptions.ts @@ -1,6 +1,7 @@ import { useTranslation } from 'react-i18next' import { SortFn, TokenCardInfo, TypedOption } from '@dao-dao/types' +import { sortTokensValueDescending } from '@dao-dao/utils' /** * Options to use with the `useButtonPopupSorter` hook and the `ButtonPopup` @@ -14,30 +15,7 @@ export const useTokenSortOptions = (): TypedOption< return [ { label: t('info.highestUsdValue'), - value: (a, b) => { - // If loading or no price, show at bottom. - const aPrice = - a.lazyInfo.loading || !a.lazyInfo.data.usdUnitPrice?.usdPrice - ? undefined - : a.lazyInfo.data.totalBalance * - a.lazyInfo.data.usdUnitPrice.usdPrice - const bPrice = - b.lazyInfo.loading || !b.lazyInfo.data.usdUnitPrice?.usdPrice - ? undefined - : b.lazyInfo.data.totalBalance * - b.lazyInfo.data.usdUnitPrice.usdPrice - - // If prices are equal, sort alphabetically by symbol. - return aPrice === bPrice - ? a.token.symbol - .toLocaleLowerCase() - .localeCompare(b.token.symbol.toLocaleLowerCase()) - : aPrice === undefined - ? 1 - : bPrice === undefined - ? -1 - : bPrice - aPrice - }, + value: sortTokensValueDescending, }, { label: t('info.lowestUsdValue'), diff --git a/packages/stateless/package.json b/packages/stateless/package.json index 2670fcd07..5e32bc7a9 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -13,13 +13,12 @@ "@dao-dao/utils": "2.2.0", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", - "@keplr-wallet/stores": "^0.11.49", "@mui/icons-material": "^5.10.3", "@mui/material": "^5.10.3", "@types/remove-markdown": "^0.3.1", "@walletconnect/browser-utils": "^1.8.0", "a11y-react-emoji": "^1.2.0", - "chain-registry": "^1.26.0", + "chain-registry": "^1.28.6", "chart.js": "^4.4.0", "chartjs-adapter-date-fns": "^3.0.0", "chartjs-plugin-annotation": "^3.0.1", diff --git a/packages/stateless/pages/Account.tsx b/packages/stateless/pages/Account.tsx index ed5f418d8..7e0268a17 100644 --- a/packages/stateless/pages/Account.tsx +++ b/packages/stateless/pages/Account.tsx @@ -27,7 +27,7 @@ export type AccountProps = { AccountDaos: ComponentType SuspenseLoader: ComponentType ButtonLink: ComponentType -} & Pick +} & Pick export const Account = ({ address, diff --git a/packages/stateless/pages/Me.stories.tsx b/packages/stateless/pages/Me.stories.tsx deleted file mode 100644 index 888220de6..000000000 --- a/packages/stateless/pages/Me.stories.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import { ComponentMeta, ComponentStory } from '@storybook/react' - -import { WALLET_PROFILE_DATA } from '@dao-dao/storybook' -import { - WalletActionsProviderDecorator, - WalletProviderDecorator, - makeDappLayoutDecorator, -} from '@dao-dao/storybook/decorators' -import { TokenCardProps, WalletBalancesProps } from '@dao-dao/types' - -import { NftCardProps } from '../components' -import { Default as WalletBalancesStory } from '../components/wallet/WalletBalances.stories' -import { Me } from './Me' -import { MeTransactionBuilderProps } from './MeTransactionBuilder' -import { Default as MeTransactionBuilderStory } from './MeTransactionBuilder.stories' - -export default { - title: 'DAO DAO / packages / stateless / pages / Me', - component: Me, - decorators: [ - WalletProviderDecorator, - makeDappLayoutDecorator(), - WalletActionsProviderDecorator, - ], -} as ComponentMeta - -const Template: ComponentStory = (args) => - -export const Default = Template.bind({}) -Default.args = { - MeBalances: () => ( - )} - /> - ), - MeTransactionBuilder: () => ( - - ), - MeDaos: () =>
, - profileData: WALLET_PROFILE_DATA, -} diff --git a/packages/stateless/pages/Profile.stories.tsx b/packages/stateless/pages/Profile.stories.tsx new file mode 100644 index 000000000..320c1a690 --- /dev/null +++ b/packages/stateless/pages/Profile.stories.tsx @@ -0,0 +1,31 @@ +import { ComponentMeta, ComponentStory } from '@storybook/react' + +import { WALLET_PROFILE_DATA } from '@dao-dao/storybook' +import { + WalletActionsProviderDecorator, + WalletProviderDecorator, + makeDappLayoutDecorator, +} from '@dao-dao/storybook/decorators' + +import { Profile } from './Profile' + +export default { + title: 'DAO DAO / packages / stateless / pages / Profile', + component: Profile, + decorators: [ + WalletProviderDecorator, + makeDappLayoutDecorator(), + WalletActionsProviderDecorator, + ], +} as ComponentMeta + +const Template: ComponentStory = (args) => + +export const Default = Template.bind({}) +Default.args = { + tabs: [], + profile: { + loading: false, + data: WALLET_PROFILE_DATA, + }, +} diff --git a/packages/stateless/pages/Me.tsx b/packages/stateless/pages/Profile.tsx similarity index 50% rename from packages/stateless/pages/Me.tsx rename to packages/stateless/pages/Profile.tsx index b4c643840..c49df9b5d 100644 --- a/packages/stateless/pages/Me.tsx +++ b/packages/stateless/pages/Profile.tsx @@ -1,11 +1,5 @@ -import { - GroupRounded, - ReceiptRounded, - WalletRounded, -} from '@mui/icons-material' import { useRouter } from 'next/router' -import { ComponentType, useEffect } from 'react' -import { useTranslation } from 'react-i18next' +import { useEffect } from 'react' import { AccountTab, @@ -13,47 +7,22 @@ import { WalletProfileHeaderProps, } from '@dao-dao/types' -import { CopyableAddress, TabBar, WalletProfileHeader } from '../components' +import { TabBar, WalletProfileHeader } from '../components' -export type MeProps = { - MeBalances: ComponentType - MeTransactionBuilder: ComponentType - MeDaos: ComponentType +export type ProfileProps = { + tabs: AccountTab[] } & Pick< WalletProfileHeaderProps, - 'openProfileNftUpdate' | 'profileData' | 'updateProfileName' + | 'openProfileNftUpdate' + | 'profile' + | 'updateProfile' + | 'otherProfilesExist' + | 'openMergeProfilesModal' > -export const Me = ({ - MeBalances, - MeTransactionBuilder, - MeDaos, - ...headerProps -}: MeProps) => { - const { t } = useTranslation() +export const Profile = ({ tabs, ...headerProps }: ProfileProps) => { const router = useRouter() - const tabs: AccountTab[] = [ - { - id: AccountTabId.Balances, - label: t('title.balances'), - Icon: WalletRounded, - Component: MeBalances, - }, - { - id: AccountTabId.Daos, - label: t('title.daos'), - Icon: GroupRounded, - Component: MeDaos, - }, - { - id: AccountTabId.TransactionBuilder, - label: t('title.transactionBuilder'), - Icon: ReceiptRounded, - Component: MeTransactionBuilder, - }, - ] - // Pre-fetch tabs. useEffect(() => { Object.values(AccountTabId).forEach((tab) => { @@ -65,7 +34,7 @@ export const Me = ({ const tabPath = _tab && Array.isArray(_tab) ? _tab[0] : undefined const selectedTabId = // If tabPath is not a valid tab, default to first tab. This ensures that - // the default `/me` page will render the first tab, and also that an + // the default `/profile` page will render the first tab, and also that an // invalid tab was not passed, though that should be impossible because Next // will render any invalid tabs (not in the `getStaticPaths` function) with // a 404 page. @@ -76,9 +45,7 @@ export const Me = ({ return (
- - - + diff --git a/packages/stateless/pages/index.ts b/packages/stateless/pages/index.ts index ad286844a..989a1729e 100644 --- a/packages/stateless/pages/index.ts +++ b/packages/stateless/pages/index.ts @@ -6,7 +6,6 @@ export * from './GovernanceDaos' export * from './Home' export * from './Inbox' export * from './LogInRequiredPage' -export * from './Me' -export * from './MeTransactionBuilder' +export * from './Profile' export * from './Proposal' export * from './Status' diff --git a/packages/storybook/utils.ts b/packages/storybook/utils.ts index c1f456096..88f8bc2ac 100644 --- a/packages/storybook/utils.ts +++ b/packages/storybook/utils.ts @@ -1,30 +1,14 @@ -import { ChainId, WalletProfileData } from '@dao-dao/types' +import { ChainId, UnifiedProfile } from '@dao-dao/types' // Use Juno mainnet as storybook chains. export const CHAIN_ID = ChainId.JunoMainnet -export const WALLET_PROFILE_DATA: WalletProfileData = { - loading: false, - address: '0x123', - profile: { - nonce: 0, - imageUrl: '/noah.jpg', - name: '@Modern-Edamame', - nameSource: 'pfpk', - nft: null, - }, - backupImageUrl: '/placeholder/1.svg', -} - -export const WALLET_PROFILE_DATA_LOADING: WalletProfileData = { - loading: true, - address: '0x123', - profile: { - nonce: 0, - imageUrl: '/placeholder/1.svg', - name: null, - nameSource: 'pfpk', - nft: null, - }, +export const WALLET_PROFILE_DATA: UnifiedProfile = { + nonce: 0, + name: '@Modern-Edamame', + nft: null, + chains: {}, + imageUrl: '/noah.jpg', + nameSource: 'pfpk', backupImageUrl: '/placeholder/1.svg', } diff --git a/packages/types/account.ts b/packages/types/account.ts index 05686e7a0..9e5a222df 100644 --- a/packages/types/account.ts +++ b/packages/types/account.ts @@ -52,9 +52,9 @@ export type Account = NativeAccount | PolytoneAccount | IcaAccount * Unique identifier for account tabs, which is used in the URL path. */ export enum AccountTabId { - Balances = 'balances', + Home = 'home', Daos = 'daos', - TransactionBuilder = 'tx', + Actions = 'actions', } export type AccountTab = { diff --git a/packages/types/actions.ts b/packages/types/actions.ts index ddfce32e4..9b57b3bb0 100644 --- a/packages/types/actions.ts +++ b/packages/types/actions.ts @@ -12,6 +12,7 @@ import { import { CosmosMsgFor_Empty } from './contracts/common' import { DaoInfo } from './dao' import { AllGovParams } from './gov' +import { PfpkProfile } from './profile' export enum ActionCategoryKey { CommonlyUsed = 'commonlyUsed', @@ -234,6 +235,7 @@ export type ActionContext = } | { type: ActionContextType.Wallet + profile?: PfpkProfile } | { type: ActionContextType.Gov diff --git a/packages/types/components/ButtonPopup.ts b/packages/types/components/ButtonPopup.ts index 55a88982c..a463b0650 100644 --- a/packages/types/components/ButtonPopup.ts +++ b/packages/types/components/ButtonPopup.ts @@ -9,7 +9,9 @@ export type ButtonPopupSectionButton = { loading?: boolean disabled?: boolean pressed?: boolean - // Default: true. + /** + * Whether or not to close the popup on click. Defaults to `true`. + */ closeOnClick?: boolean } & ( | { diff --git a/packages/types/components/ChainPickerPopup.ts b/packages/types/components/ChainPickerPopup.ts new file mode 100644 index 000000000..38af21cc1 --- /dev/null +++ b/packages/types/components/ChainPickerPopup.ts @@ -0,0 +1,120 @@ +import { ComponentType } from 'react' + +import { PopupTrigger } from './Popup' + +export type ChainPickerPopupProps = { + /** + * The chains to include in the picker. + */ + chains: + | { + /** + * Supported chains have native DAO DAO deployments. + */ + type: 'supported' + /** + * Chain IDs to exclude. + */ + excludeChainIds?: string[] + } + | { + /** + * Configured chains include supported chains and others which show up + * in the UI in various places, such as the governance UI. + */ + type: 'configured' + /** + * Chain IDs to exclude. + */ + excludeChainIds?: string[] + /** + * Only include chains with a governance module. This uses the `noGov` + * flag in chain config. + */ + onlyGov?: boolean + } + | { + /** + * Set any chains explicitly + */ + type: 'custom' + chainIds: string[] + } + /** + * The selected chain ID. If undefined, will select the none option if exists. + */ + selectedChainId?: string + /** + * Handler for when a chain is selected. If the none option is selected, the + * handler will be called with `undefined`. + */ + onSelect: (chainId?: string) => void | Promise + /** + * Whether to use the chain name or the native token symbol as the label. + * Defaults to 'chain'. + */ + labelMode?: 'chain' | 'token' + /** + * Whether or not to show a loading indicator. + */ + loading?: boolean + /** + * Whether or not chain selection is disabled. + */ + disabled?: boolean + /** + * Optional class name applied to the button. + */ + buttonClassName?: string + /** + * If true, a button will be shown at the top that represents none. + */ + showNone?: boolean + /** + * If defined, this will be the label of the none button. + */ + noneLabel?: string + /** + * If defined, this will be the icon of the none button. + */ + NoneIcon?: ComponentType<{ className?: string }> + /** + * If true, will make the button more like a text header instead. + */ + headerMode?: boolean + /** + * Optional class name applied to the selected chain icon. + */ + selectedIconClassName?: string + /** + * Optional class name applied to the selected chain label. + */ + selectedLabelClassName?: string + /** + * Optionally override the picker trigger entirely. + */ + trigger?: PopupTrigger +} + +export type WalletChainSwitcherProps = { + /** + * The chain type to show. Supported chains have native DAO DAO deployments, + * whereas configured chains include supported chains and others which show up + * in the UI in various places, such as the governance UI. + */ + type?: 'supported' | 'configured' + /** + * Chain IDs to exclude. + */ + excludeChainIds?: string[] +} & Omit< + ChainPickerPopupProps, + | 'chains' + | 'selectedChainId' + | 'onSelect' + | 'labelMode' + | 'showNone' + | 'noneLabel' + | 'NoneIcon' +> & + Partial> diff --git a/packages/types/components/EntityDisplay.tsx b/packages/types/components/EntityDisplay.tsx index ebf2cddcf..7056fb0fe 100644 --- a/packages/types/components/EntityDisplay.tsx +++ b/packages/types/components/EntityDisplay.tsx @@ -1,5 +1,6 @@ import { DaoInfo } from '../dao' import { LoadingData } from '../misc' +import { UnifiedProfile } from '../profile' export enum EntityType { Dao = 'dao', @@ -19,6 +20,7 @@ export type Entity = { } & ( | { type: EntityType.Wallet + profile?: UnifiedProfile } | { type: EntityType.Module diff --git a/packages/types/components/LinkWrapper.ts b/packages/types/components/LinkWrapper.ts index f60fe1150..413548c61 100644 --- a/packages/types/components/LinkWrapper.ts +++ b/packages/types/components/LinkWrapper.ts @@ -5,19 +5,40 @@ export type LinkWrapperProps = Omit< 'onClick' > & Pick, 'onClick'> & { + /** + * Href. + */ href?: string + /** + * Optional class name applied to the container. + */ containerClassName?: string - // Pulse loading if navigating locally. + /** + * Pulse loading if navigating locally. + */ loading?: boolean + /** + * Disable link. + */ disabled?: boolean - // If not set, will fallback to detecting if url is relative or absolute. If - // starts with `http`, it will open in a new tab. + /** + * If not set, will fallback to detecting if url is relative or absolute. If + * starts with `http`, it will open in a new tab. + */ openInNewTab?: boolean - // If true, will use shallow routing - // (https://nextjs.org/docs/routing/shallow-routing) for local links. + /** + * If true, will use shallow routing + * (https://nextjs.org/docs/routing/shallow-routing) for local links. + */ shallow?: boolean - // If true, will replace the current route - // (https://nextjs.org/docs/pages/api-reference/components/link#replace) for - // local links. + /** + * If true, will replace the current route + * (https://nextjs.org/docs/pages/api-reference/components/link#replace) for + * local links. + */ replace?: boolean + /** + * If true, will prefetch the link. Defaults to false. + */ + prefetch?: boolean } diff --git a/packages/types/components/NavWalletConnected.ts b/packages/types/components/NavWalletConnected.ts index aa03456e3..77e5c2434 100644 --- a/packages/types/components/NavWalletConnected.ts +++ b/packages/types/components/NavWalletConnected.ts @@ -1,15 +1,33 @@ import { Wallet } from '@cosmos-kit/core' +import { ComponentType } from 'react' -import { WalletProfileData } from '../profile' +import { LoadingData } from '../misc' +import { UnifiedProfile } from '../profile' +import { ButtonLinkProps } from './Buttonifier' import { NotificationsProps } from './Notifications' export type NavWalletConnectedProps = { + /** + * The currently connected wallet. + */ wallet: Wallet - walletAddress: string - walletProfileData: WalletProfileData - updateProfileName: (name: string | null) => Promise - onEditProfileImage: () => void - disconnect: () => Promise + /** + * The unified profile data. + */ + profile: LoadingData + /** + * Disconnect the wallet. + */ + disconnect: () => void | Promise + /** + * If set, show a tooltip that explains there are multiple profiles attached + * to the current wallet and prompt to merge them. + */ + otherProfilesExist?: boolean + /** + * Callback to show merge profiles modal. + */ + onMergeProfiles: () => void /** * Optional container class name. */ @@ -19,5 +37,9 @@ export type NavWalletConnectedProps = { * small screens, and dock on small screens. */ mode: 'header' | 'sidebar' | 'dock' + /** + * Stateful button link component. + */ + ButtonLink: ComponentType } & Partial> & Pick diff --git a/packages/types/components/Popup.ts b/packages/types/components/Popup.ts index 2a98869ac..1e0922c9e 100644 --- a/packages/types/components/Popup.ts +++ b/packages/types/components/Popup.ts @@ -25,6 +25,10 @@ export interface PopupProps { // Give parent a way to access and control open and setOpen. openRef?: MutableRefObject setOpenRef?: MutableRefObject> | null> + /** + * Optionally add offset to the top of the popup. + */ + topOffset?: number } export type PopupTriggerOptions = { diff --git a/packages/types/components/ProfileAddChains.ts b/packages/types/components/ProfileAddChains.ts new file mode 100644 index 000000000..007a798e1 --- /dev/null +++ b/packages/types/components/ProfileAddChains.ts @@ -0,0 +1,73 @@ +import { SubmitHandler } from 'react-hook-form' + +import { LoadingData } from '../misc' +import { AddChainsChainStatus, AddChainsStatus, ProfileChain } from '../profile' + +export type ProfileAddChainsProps = { + /** + * Prompt text that opens the chain picker popup. + */ + prompt: string + /** + * Optional tooltip next to prompt text. + */ + promptTooltip?: string + /** + * Optional class name applied to the prompt text. + */ + promptClassName?: string + /** + * Whether or not the prompt to add new chains is disabled. Defaults to + * `false`. + */ + disabled?: boolean + /** + * List of profile chains. + */ + chains: LoadingData + /** + * Add chains form submit handler. If undefined, it is not yet ready. + */ + onAddChains: SubmitHandler | undefined + /** + * Add chain process status. + * + * - `idle` - nothing loading + * - `chains` - connecting and signing each chain's allowance + * - `registering` - signing registration and firing request + */ + status: AddChainsStatus + /** + * The size of the UI. + */ + size?: 'sm' | 'default' + /** + * Whether or not to only show supported chains. Defaults to `false`. + */ + onlySupported?: boolean + /** + * Whether or not to auto-add when a chain is selected instead of allowing + * multiple and showing checkboxes. Defaults to `false`. + */ + autoAdd?: boolean + /** + * Optional container class name. + */ + className?: string +} + +export type ProfileAddChainsForm = { + chains: { + chainId: string + checked: boolean + /** + * Status to display while submitting. + */ + status: AddChainsChainStatus + }[] +} + +export type StatefulProfileAddChainsProps = Omit< + ProfileAddChainsProps, + 'chains' | 'onAddChains' | 'status' +> diff --git a/packages/types/components/ProfileCardWrapper.ts b/packages/types/components/ProfileCardWrapper.ts index f048e424f..982a170cd 100644 --- a/packages/types/components/ProfileCardWrapper.ts +++ b/packages/types/components/ProfileCardWrapper.ts @@ -1,12 +1,11 @@ import { ReactNode } from 'react' -import { WalletProfileData } from '../profile' +import { LoadingData } from '../misc' +import { UnifiedProfile } from '../profile' export type ProfileCardWrapperProps = { children?: ReactNode | ReactNode[] - walletProfileData: WalletProfileData - showUpdateProfileNft: () => void - updateProfileName: (name: string | null) => Promise + profile: LoadingData underHeaderComponent: ReactNode childContainerClassName?: string compact?: boolean diff --git a/packages/types/components/ProfileWallet.ts b/packages/types/components/ProfileWallet.ts new file mode 100644 index 000000000..fd946f517 --- /dev/null +++ b/packages/types/components/ProfileWallet.ts @@ -0,0 +1,29 @@ +import { ComponentType } from 'react' + +import { LoadingData, LoadingDataWithError } from '../misc' +import { ProfileChain } from '../profile' +import { TokenCardInfo } from '../token' +import { StatefulProfileAddChainsProps } from './ProfileAddChains' + +export type ProfileWalletProps = { + /** + * List of profile chains. + */ + chains: LoadingData + /** + * List of tokens on all chains. + */ + tokens: LoadingDataWithError + /** + * List of token `denomOrAddress` fields that should be hidden. + */ + hiddenTokens: LoadingDataWithError + /** + * Stateful token line component. + */ + TokenLine: ComponentType + /** + * Stateful profile add chains component. + */ + ProfileAddChains: ComponentType +} diff --git a/packages/types/components/WalletBalances.ts b/packages/types/components/WalletBalances.ts deleted file mode 100644 index 936c352e1..000000000 --- a/packages/types/components/WalletBalances.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { ComponentType } from 'react' - -import { LoadingData, LoadingDataWithError } from '../misc' -import { LazyNftCardInfo } from '../nft' -import { TokenCardInfo } from '../token' - -export type WalletBalancesProps< - T extends TokenCardInfo, - N extends LazyNftCardInfo -> = { - tokens: LoadingDataWithError - // List of token denomOrAddress fields that should be hidden. - hiddenTokens: LoadingData - TokenLine: ComponentType - nfts: LoadingDataWithError - NftCard: ComponentType -} diff --git a/packages/types/components/WalletDaos.tsx b/packages/types/components/WalletDaos.tsx index 3c78d8a19..737f54a19 100644 --- a/packages/types/components/WalletDaos.tsx +++ b/packages/types/components/WalletDaos.tsx @@ -1,10 +1,33 @@ +import { ComponentType } from 'react' + import { LoadingDataWithError } from '../misc' +import { LazyDaoCardProps } from './DaoCard' + +export type WalletDaosProps = { + /** + * All chains the DAOs are on. + */ + chainIds: LoadingDataWithError + /** + * All DAOs. + */ + daos: LoadingDataWithError + /** + * Stateful lazy DAO card component. + */ + LazyDaoCard: ComponentType + /** + * Chain selection callback. This may be used to attempt to connect to a chain + * if not already connected. + */ + onChainSelect?: (chainId: string) => void +} -export type StatefulWalletDaosProps = { +export type StatefulWalletDaosProps = Pick & { chainWallets: LoadingDataWithError< { chainId: string - walletAddress: string + address: string }[] > } diff --git a/packages/types/components/WalletProfileHeader.ts b/packages/types/components/WalletProfileHeader.ts index b3780184e..f10d7356a 100644 --- a/packages/types/components/WalletProfileHeader.ts +++ b/packages/types/components/WalletProfileHeader.ts @@ -1,12 +1,43 @@ import { ReactNode } from 'react' -import { WalletProfileData } from '../profile' +import { LoadingData } from '../misc' +import { PfpkProfileUpdateFunction, UnifiedProfile } from '../profile' export type WalletProfileHeaderProps = { + /** + * Whether or not to show edit buttons for the profile name and NFT. + */ editable: boolean - profileData: WalletProfileData - updateProfileName?: (name: string | null) => Promise + /** + * The profile being displayed. + */ + profile: LoadingData + /** + * Whether or not other profiles are attached to the current wallet. Only + * relevant when editable is true. This is used to prompt the user to merge + * their profiles, and it prevents editing until that is done. + */ + otherProfilesExist?: boolean + /** + * Function to open merge profiles modal. This is only used if + * editable is true and otherProfilesExist is true. + */ + openMergeProfilesModal?: () => void + /** + * Function to update the profile. This is only used if editable is true. + */ + updateProfile?: PfpkProfileUpdateFunction + /** + * Function to open the profile NFT update modal. This is only used if + * editable is true. + */ openProfileNftUpdate?: () => void + /** + * Optional container class name. + */ className?: string + /** + * Optionally add more components below the header. + */ children?: ReactNode } diff --git a/packages/types/components/index.ts b/packages/types/components/index.ts index fda467078..bd1df02fe 100644 --- a/packages/types/components/index.ts +++ b/packages/types/components/index.ts @@ -3,6 +3,7 @@ export * from './AppContext' export * from './Breadcrumbs' export * from './Buttonifier' export * from './ButtonPopup' +export * from './ChainPickerPopup' export * from './ChainStatus' export * from './Collapsible' export * from './CommandModal' @@ -33,8 +34,10 @@ export * from './Notifications' export * from './PageHeader' export * from './PayEntityDisplay' export * from './Popup' +export * from './ProfileAddChains' export * from './ProfileCardWrapper' export * from './ProfileVoteCard' +export * from './ProfileWallet' export * from './ProposalCard' export * from './ProposalLine' export * from './ProposalVoter' @@ -53,6 +56,5 @@ export * from './TokenSwapStatus' export * from './Trans' export * from './TreasuryHistoryGraph' export * from './ValidatorPicker' -export * from './WalletBalances' export * from './WalletDaos' export * from './WalletProfileHeader' diff --git a/packages/types/index.ts b/packages/types/index.ts index 5cfbdac94..97dc7c43b 100644 --- a/packages/types/index.ts +++ b/packages/types/index.ts @@ -17,6 +17,7 @@ export * from './nft' export * from './profile' export * from './proposal-module-adapter' export * from './proposal' +export * from './skip' export * from './sortFilter' export * from './token' export * from './units' diff --git a/packages/types/profile.ts b/packages/types/profile.ts index 1c6d19db8..66a938a65 100644 --- a/packages/types/profile.ts +++ b/packages/types/profile.ts @@ -1,4 +1,6 @@ -export interface PfpkWalletProfile { +import { Chain } from '@chain-registry/types' + +export type PfpkProfile = { nonce: number name: string | null nft: { @@ -7,21 +9,21 @@ export interface PfpkWalletProfile { tokenId: string collectionAddress: string } | null + /** + * Map chain ID to public key and address. + */ + chains: Record< + string, + { + publicKey: string + address: string + } + > } -export type WalletProfileNameSource = 'pfpk' | 'stargaze' - -// Move `imageUrl` out of `NFT` in case we use the Keplr profile image API or a -// fallback image as backup. -export interface WalletProfile extends PfpkWalletProfile { - imageUrl: string - // Whether or not the name is loaded from PFPK or Stargaze names. - nameSource: WalletProfileNameSource -} - -export interface WalletProfileUpdate { +export type PfpkProfileUpdate = { nonce: number - name?: WalletProfile['name'] + name?: string | null nft?: { chainId: string tokenId: string @@ -29,7 +31,39 @@ export interface WalletProfileUpdate { } | null } -export interface KeplrWalletProfile { +/** + * Function used to update a profile. Throws an error on failure. + */ +export type PfpkProfileUpdateFunction = ( + updates: Omit +) => Promise + +/** + * The source of the name in the unified profile. + */ +export type UnifiedProfileNameSource = 'pfpk' | 'stargaze' + +/** + * A unified profile that uses information from backup sources when missing from + * PFPK. + */ +export type UnifiedProfile = PfpkProfile & { + /** + * Image URL to use, which takes into account backup data sources if PFPK does + * not have an NFT set. + */ + imageUrl: string + /** + * The source of the name. + */ + nameSource: UnifiedProfileNameSource + /** + * Backup image URL that will be used if no PFPK NFT is set. + */ + backupImageUrl: string +} + +export type KeplrWalletProfile = { profile: | {} | { @@ -38,24 +72,60 @@ export interface KeplrWalletProfile { } } -export interface ProfileSearchHit { +export type ResolvedProfile = { publicKey: string address: string - profile: { - name: string | null - nft: { - chainId: string - collectionAddress: string - tokenId: string - imageUrl: string - } | null - } + name: string | null + nft: { + chainId: string + collectionAddress: string + tokenId: string + imageUrl: string + } | null } -// Meta info about wallet profile, including loading state and a fallback image. -export type WalletProfileData = { - loading: boolean +export type ProfileChain = { + /** + * The chain ID of the chain. + */ + chainId: string + /** + * The chain object. + */ + chain: Chain + /** + * Whether or not this is a DAO DAO-supported chain. + */ + supported: boolean + /** + * The address for the profile on this chain. + */ address: string - profile: WalletProfile - backupImageUrl: string + /** + * The hex public key for the profile on this chain. + */ + publicKey: string } + +export type AddChainsStatus = 'idle' | 'chains' | 'registering' +export type AddChainsChainStatus = 'idle' | 'loading' | 'done' + +/** + * Function used to add chains to a profile. Throws an error on failure. + */ +export type AddChainsFunction = ( + /** + * Chain IDs to add to the profile. + */ + chainIds: string[], + /** + * Callbacks. + */ + callbacks?: { + /** + * Callback for handling status updates for displaying in the UI while the + * chains are being added. + */ + setChainStatus?: (chainId: string, status: AddChainsChainStatus) => void + } +) => Promise diff --git a/packages/types/skip.ts b/packages/types/skip.ts new file mode 100644 index 000000000..2a76e2771 --- /dev/null +++ b/packages/types/skip.ts @@ -0,0 +1,65 @@ +export type SkipChain = { + chain_name: string + chain_id: string + pfm_enabled: boolean + cosmos_module_support: Record + supports_memo: boolean + logo_uri: string + bech32_prefix: string + fee_assets: { + denom: string + gas_price: { + low: string + average: string + high: string + } + }[] + chain_type: string + ibc_capabilities: Record +} + +export type SkipAsset = { + denom: string + chain_id: string + origin_denom: string + origin_chain_id: string + trace: string + is_cw20: boolean + is_evm: boolean + symbol: string + name: string + logo_uri: string + decimals: number + description: string + coingecko_id?: string + token_contract?: string + recommended_symbol: string +} + +export type SkipAssetRecommendation = { + asset: SkipAsset + reason: string +} + +export type SkipRoute = { + source_asset_denom: string + source_asset_chain_id: string + dest_asset_denom: string + dest_asset_chain_id: string + amount_in: string + amount_out: string + operations: any[] + chain_ids: string[] + does_swap: boolean + estimated_amount_out: string + txs_required: number + usd_amount_in: string + usd_amount_out: string +} + +export type SkipMultiChainMsg = { + chain_id: string + path: string[] + msg: string + msg_type_url: string +} diff --git a/packages/utils/actions.ts b/packages/utils/actions.ts index 3e36d7721..19fee1506 100644 --- a/packages/utils/actions.ts +++ b/packages/utils/actions.ts @@ -6,7 +6,6 @@ import { LoadedActions, } from '@dao-dao/types' -import { transformBech32Address } from './conversion' import { getAccountAddress } from './dao' // Convert action data to a Cosmos message given all loaded actions. @@ -77,7 +76,7 @@ export const getChainAddressForActionOptions = ( accounts: context.info.accounts, chainId, }) - : // If on different chain, return wallet's transformed bech32 address. + : // If on different chain, return wallet's chain profile address if set. context.type === ActionContextType.Wallet - ? transformBech32Address(address, chainId) + ? context.profile?.chains[chainId]?.address : undefined diff --git a/packages/utils/assets.ts b/packages/utils/assets.ts index a54b7536a..953b7e3f5 100644 --- a/packages/utils/assets.ts +++ b/packages/utils/assets.ts @@ -1,5 +1,5 @@ -import { asset_lists } from '@chain-registry/assets' import { fromBech32 } from '@cosmjs/encoding' +import { assets } from 'chain-registry' import { GenericToken, TokenType } from '@dao-dao/types' @@ -20,7 +20,7 @@ const chainAssetsMap: Record< export const getChainAssets = (chainId: string) => { if (!chainAssetsMap[chainId]) { chainAssetsMap[chainId] = - asset_lists + assets .find( ({ chain_name }) => chain_name === getChainForChainId(chainId).chain_name diff --git a/packages/utils/auth.ts b/packages/utils/auth.ts new file mode 100644 index 000000000..c5d503fe8 --- /dev/null +++ b/packages/utils/auth.ts @@ -0,0 +1,116 @@ +import { OfflineAminoSigner, makeSignDoc } from '@cosmjs/amino' + +import { + getChainForChainId, + getNativeTokenForChainId, + secp256k1PublicKeyToBech32Address, +} from '@dao-dao/utils' + +export type SignatureOptions< + Data extends Record | undefined = Record +> = { + type: string + nonce: number + chainId: string + hexPublicKey: string + data: Data + offlineSignerAmino: OfflineAminoSigner + /** + * If true, don't sign the message and leave the signature field blank. + * Defaults to false. + */ + generateOnly?: boolean +} + +export type Auth = { + type: string + nonce: number + chainId: string + chainFeeDenom: string + chainBech32Prefix: string + publicKey: string +} + +export type SignedBody< + Data extends Record | undefined = Record +> = { + data: { + auth: Auth + } & Data + signature: string +} + +/** + * Function to sign a message as a wallet in the format expected by our various + * off-chain services. + */ +export const signOffChainAuth = async < + Data extends Record | undefined = Record +>({ + type, + nonce, + chainId, + hexPublicKey, + data, + offlineSignerAmino, + generateOnly = false, +}: SignatureOptions): Promise> => { + const chain = getChainForChainId(chainId) + + const dataWithAuth: SignedBody['data'] = { + ...data, + auth: { + type, + nonce, + chainId, + chainFeeDenom: getNativeTokenForChainId(chainId).denomOrAddress, + chainBech32Prefix: chain.bech32_prefix, + publicKey: hexPublicKey, + }, + } + + const signer = await secp256k1PublicKeyToBech32Address( + hexPublicKey, + chain.bech32_prefix + ) + + // Generate data to sign. + const signDocAmino = makeSignDoc( + [ + { + type: dataWithAuth.auth.type, + value: { + signer, + data: JSON.stringify(dataWithAuth, undefined, 2), + }, + }, + ], + { + gas: '0', + amount: [ + { + denom: dataWithAuth.auth.chainFeeDenom, + amount: '0', + }, + ], + }, + chain.chain_id, + '', + 0, + 0 + ) + + let signature = '' + // Sign data. + if (!generateOnly) { + signature = (await offlineSignerAmino.signAmino(signer, signDocAmino)) + .signature.signature + } + + const signedBody: SignedBody = { + data: dataWithAuth, + signature, + } + + return signedBody +} diff --git a/packages/utils/chain.ts b/packages/utils/chain.ts index 63788d88b..3f3b7f491 100644 --- a/packages/utils/chain.ts +++ b/packages/utils/chain.ts @@ -1,6 +1,5 @@ import { Buffer } from 'buffer' -import { asset_lists } from '@chain-registry/assets' import { AssetList, Chain, IBCInfo } from '@chain-registry/types' import { fromBech32, fromHex, toBech32 } from '@cosmjs/encoding' import { GasPrice } from '@cosmjs/stargate' @@ -167,7 +166,7 @@ export const maybeGetAssetListForChainId = ( ): AssetList | undefined => { const { chain_name: name } = maybeGetChainForChainId(chainId) ?? {} if (name) { - cachedAssetListsById[chainId] ||= asset_lists.find( + cachedAssetListsById[chainId] ||= assets.find( ({ chain_name }) => chain_name === name ) } @@ -488,6 +487,12 @@ export const mustGetSupportedChainConfig = ( return config } +/** + * Whether or not this chain is supported. + */ +export const isSupportedChain = (chainId: string): boolean => + getSupportedChainConfig(chainId) !== undefined + export const getSupportedChains = ({ mainnet = MAINNET, }: { diff --git a/packages/utils/constants/other.ts b/packages/utils/constants/other.ts index c37f411b5..c03216c86 100644 --- a/packages/utils/constants/other.ts +++ b/packages/utils/constants/other.ts @@ -15,9 +15,9 @@ export const ACCOUNT_PAGE_DESCRIPTION = export const NOTIFICATIONS_PAGE_TITLE = 'Notifications' export const NOTIFICATIONS_PAGE_DESCRIPTION = 'View notifications in your followed DAOs.' -export const ME_PAGE_TITLE = 'Account' -export const ME_PAGE_DESCRIPTION = - 'View your tokens, NFTs, and DAOs, or execute transactions from your wallet.' +export const PROFILE_PAGE_TITLE = 'Profile' +export const PROFILE_PAGE_DESCRIPTION = + 'View your tokens, NFTs, and DAOs, and perform actions from your wallet.' export const STATUS_PAGE_TITLE = 'Status' export const STATUS_PAGE_DESCRIPTION = "Check the status of DAO DAO's services." @@ -106,6 +106,8 @@ export const NEUTRON_SECURITY_SUBDAO = export const IPFS_GATEWAY_TEMPLATE = 'https://ipfs.daodao.zone/ipfs/PATH' +export const SKIP_API_BASE = 'https://api.skip.money' + // DAOs with these names will be excluded from search. export const INACTIVE_DAO_NAMES = ['[archived]', '[deleted]'] diff --git a/packages/utils/index.ts b/packages/utils/index.ts index 71e4cf1cb..1d25691c8 100644 --- a/packages/utils/index.ts +++ b/packages/utils/index.ts @@ -5,6 +5,7 @@ export * from './account' export * from './actions' export * from './address' export * from './assets' +export * from './auth' export * from './batch' export * from './browser' export * from './chain' @@ -22,6 +23,7 @@ export * from './getFallbackImage' export * from './gov' export * from './isValidUrl' export * from './keplr' +export * from './misc' export * from './nft' export * from './network' export * from './objectMatchesStructure' diff --git a/packages/utils/keplr.ts b/packages/utils/keplr.ts index ee35b78b6..e80185f8f 100644 --- a/packages/utils/keplr.ts +++ b/packages/utils/keplr.ts @@ -5,12 +5,49 @@ declare global { } // Suggest a token to the user. -export const suggestToken = async ( - chainId: string, - keplr: Keplr, - address: string -) => - keplr - .suggestToken(chainId, address) +export const suggestToken = async (chainId: string, address: string) => + (await getKeplrFromWindow()) + ?.suggestToken(chainId, address) .then(() => true) .catch(() => false) + +export const getKeplrFromWindow: () => Promise< + Keplr | undefined +> = async () => { + if (typeof window === 'undefined') { + return + } + + const keplr = (window as KeplrWindow).keplr + + if (keplr) { + return keplr + } + + if (document.readyState === 'complete') { + if (keplr) { + return keplr + } else { + throw new Error('Keplr not found') + } + } + + return new Promise((resolve, reject) => { + const documentStateChange = (event: Event) => { + if ( + event.target && + (event.target as Document).readyState === 'complete' + ) { + const keplr = (window as KeplrWindow).keplr + if (keplr) { + resolve(keplr) + } else { + reject(new Error('Keplr not found')) + } + document.removeEventListener('readystatechange', documentStateChange) + } + } + + document.addEventListener('readystatechange', documentStateChange) + }) +} diff --git a/packages/utils/misc.ts b/packages/utils/misc.ts new file mode 100644 index 000000000..26c6c06bd --- /dev/null +++ b/packages/utils/misc.ts @@ -0,0 +1,37 @@ +/** + * Wrap a promise and give the caller the responsibility to resolve it after the + * promise succeeds. + * + * @param execute Async function to execute. If it throws an error, the promise + * will be rejected with the error. If it returns false, the promise returns + * immediately. Otherwise (if it does not return or returns true/undefined), it + * will be the caller's responsibility to resolve the promise using the resolve + * function passed into `onComplete`. + * @param onComplete Once the async function completes without error, this + * callback is called with the promise's resolve function, allowing the caller + * to manually trigger the resolve function when ready. + * @returns Promise that resolves when caller calls the resolve function, which + * is only possible after the async function completes. + */ +export const makeManuallyResolvedPromise = + ( + execute: (...args: Params) => Promise, + onComplete: (resolve: () => void) => void + ) => + (...args: Params) => + new Promise(async (resolve, reject) => { + try { + const result = await execute(...args) + + // If returns false, resolve immediately and return. + if (result === false) { + resolve() + return + } + + // On completion, store resolve for later use. + onComplete(resolve) + } catch (err) { + reject(err) + } + }) diff --git a/packages/utils/package.json b/packages/utils/package.json index 12384cdc6..e00c1db0b 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -12,7 +12,6 @@ "protobuf": "npm run protobuf:codegen && npm run protobuf:patch" }, "dependencies": { - "@chain-registry/assets": "^1.26.1", "@cosmjs/amino": "^0.32.1", "@cosmjs/cosmwasm-stargate": "^0.32.1", "@cosmjs/encoding": "^0.32.1", @@ -20,7 +19,7 @@ "@cosmjs/tendermint-rpc": "^0.32.1", "@sentry/nextjs": "^7.7.0", "ajv": "^8.11.0", - "chain-registry": "^1.26.0", + "chain-registry": "^1.28.6", "json5": "^2.2.0", "lodash.clonedeep": "^4.5.0", "long": "^5.2.1", diff --git a/packages/utils/token.ts b/packages/utils/token.ts index 4ee3fff1d..3ffffd985 100644 --- a/packages/utils/token.ts +++ b/packages/utils/token.ts @@ -5,6 +5,8 @@ import { GenericTokenSource, LooseGenericToken, PfmMemo, + SortFn, + TokenCardInfo, } from '@dao-dao/types' import { getChainForChainName, getIbcTransferInfoFromChannel } from './chain' @@ -113,3 +115,31 @@ export const getPfmFinalReceiverFromMemo = (memo: PfmMemo): string => memo.forward.next ? getPfmFinalReceiverFromMemo(memo.forward.next) : memo.forward.receiver + +/** + * Function to sort token lists descending by USD value. + */ +export const sortTokensValueDescending: SortFn< + Pick +> = (a, b) => { + // If loading or no price, show at bottom. + const aPrice = + a.lazyInfo.loading || !a.lazyInfo.data.usdUnitPrice?.usdPrice + ? undefined + : a.lazyInfo.data.totalBalance * a.lazyInfo.data.usdUnitPrice.usdPrice + const bPrice = + b.lazyInfo.loading || !b.lazyInfo.data.usdUnitPrice?.usdPrice + ? undefined + : b.lazyInfo.data.totalBalance * b.lazyInfo.data.usdUnitPrice.usdPrice + + // If prices are equal, sort alphabetically by symbol. + return aPrice === bPrice + ? a.token.symbol + .toLocaleLowerCase() + .localeCompare(b.token.symbol.toLocaleLowerCase()) + : aPrice === undefined + ? 1 + : bPrice === undefined + ? -1 + : bPrice - aPrice +} diff --git a/packages/utils/url.ts b/packages/utils/url.ts index a374df5dd..79947c060 100644 --- a/packages/utils/url.ts +++ b/packages/utils/url.ts @@ -75,7 +75,7 @@ export const getAccountPath = ( // Create a path for the Me page transaction builder with a pre-filled // transaction form. export const getMeTxPrefillPath = (actions: ActionKeyAndDataNoId[]) => { - const base = '/me/tx' + const base = '/me/actions' const query = `?${queryString.stringify({ prefill: JSON.stringify({ actions: actions.map((action, index) => ({ diff --git a/yarn.lock b/yarn.lock index bea0702c5..8048715df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,25 +2,12 @@ # yarn lockfile v1 -"@adraffy/ens-normalize@1.10.0": - version "1.10.0" - resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.0.tgz#d2a39395c587e092d77cbbc80acf956a54f38bf7" - integrity sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q== - "@alloc/quick-lru@^5.2.0": version "5.2.0" resolved "https://registry.yarnpkg.com/@alloc/quick-lru/-/quick-lru-5.2.0.tgz#7bf68b20c0a350f936915fcae06f58e32007ce30" integrity sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw== -"@ampproject/remapping@^2.1.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d" - integrity sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w== - dependencies: - "@jridgewell/gen-mapping" "^0.1.0" - "@jridgewell/trace-mapping" "^0.3.9" - -"@ampproject/remapping@^2.2.0": +"@ampproject/remapping@^2.1.0", "@ampproject/remapping@^2.2.0": version "2.2.1" resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg== @@ -28,12 +15,7 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@apocentre/alias-sampling@^0.5.3": - version "0.5.3" - resolved "https://registry.yarnpkg.com/@apocentre/alias-sampling/-/alias-sampling-0.5.3.tgz#897ff181b48ad7b2bcb4ecf29400214888244f08" - integrity sha512-7UDWIIF9hIeJqfKXkNIzkVandlwLf1FWTSdrb9iXvOP8oF544JRXQjCbiTmCv2c9n44n/FIWtehhBfNuAx2CZA== - -"@apollo/client@^3.5.8": +"@apollo/client@^3.8.7": version "3.8.8" resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.8.8.tgz#1a004b2e6de4af38668249a7d7790f6a3431e475" integrity sha512-omjd9ryGDkadZrKW6l5ktUAdS4SNaFOccYQ4ZST0HLW83y8kQaSZOCTNlpkoBUK8cv6qP8+AxOKwLm2ho8qQ+Q== @@ -51,25 +33,6 @@ tslib "^2.3.0" zen-observable-ts "^1.2.5" -"@apollo/client@^3.8.7": - version "3.8.7" - resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.8.7.tgz#090b1518f513503b9a6a690ee3eaec49529822e1" - integrity sha512-DnQtFkQrCyxHTSa9gR84YRLmU/al6HeXcLZazVe+VxKBmx/Hj4rV8xWtzfWYX5ijartsqDR7SJgV037MATEecA== - dependencies: - "@graphql-typed-document-node/core" "^3.1.1" - "@wry/context" "^0.7.3" - "@wry/equality" "^0.5.6" - "@wry/trie" "^0.4.3" - graphql-tag "^2.12.6" - hoist-non-react-statics "^3.3.2" - optimism "^0.17.5" - prop-types "^15.7.2" - response-iterator "^0.2.6" - symbol-observable "^4.0.0" - ts-invariant "^0.10.3" - tslib "^2.3.0" - zen-observable-ts "^1.2.5" - "@ardatan/relay-compiler@12.0.0": version "12.0.0" resolved "https://registry.yarnpkg.com/@ardatan/relay-compiler/-/relay-compiler-12.0.0.tgz#2e4cca43088e807adc63450e8cab037020e91106" @@ -838,74 +801,7 @@ "@aws-sdk/types" "3.347.0" tslib "^2.5.0" -"@axelar-network/axelar-cgp-solidity@^4.5.0": - version "4.5.0" - resolved "https://registry.yarnpkg.com/@axelar-network/axelar-cgp-solidity/-/axelar-cgp-solidity-4.5.0.tgz#f0456a2a6665302613a4d5243282ce1b18842348" - integrity sha512-4F4rmHei0cmzeUR7/mW4Bap5rc/KlPV2crD9HA7HTRfl15mVcN6/3z8p+pAm9We6bOrQplNW9KBZ3HJFP3C1Gw== - -"@axelar-network/axelarjs-sdk@^0.13.6": - version "0.13.7" - resolved "https://registry.yarnpkg.com/@axelar-network/axelarjs-sdk/-/axelarjs-sdk-0.13.7.tgz#953b1866ae0c1efdf8e3abd0adbda71bcf3543f3" - integrity sha512-fqb31pXE/NoAmVUWIz+Dd5b+YYA893OD0ghZqlPicXagaozDnZZZVgPv0deythh4DWAqWl9D0dz0exbbkrL83A== - dependencies: - "@axelar-network/axelar-cgp-solidity" "^4.5.0" - "@axelar-network/axelarjs-types" "^0.33.0" - "@cosmjs/json-rpc" "^0.30.1" - "@cosmjs/stargate" "0.31.0-alpha.1" - "@ethersproject/abstract-provider" "^5.7.0" - "@ethersproject/networks" "^5.7.1" - "@ethersproject/providers" "^5.7.2" - "@types/uuid" "^8.3.1" - bech32 "^2.0.0" - clone-deep "^4.0.1" - cross-fetch "^3.1.5" - ethers "^5.7.2" - socket.io-client "^4.6.1" - standard-http-error "^2.0.1" - string-similarity-js "^2.1.4" - uuid "^8.3.2" - ws "^8.13.0" - -"@axelar-network/axelarjs-types@^0.33.0": - version "0.33.0" - resolved "https://registry.yarnpkg.com/@axelar-network/axelarjs-types/-/axelarjs-types-0.33.0.tgz#070ffbaec6be57259b64a41ee14f98804907732e" - integrity sha512-aCbX/5G+tgWPjr9tl3dQfJftWwRMkILz61ytach7dKqxtO9G9jlxpNvELJQ6gKVOodUtSY8qBCO/fWU19v4hdQ== - dependencies: - long "^5.2.0" - protobufjs "^7.0.0" - -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.18.6", "@babel/code-frame@^7.5.5", "@babel/code-frame@^7.8.3": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" - integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== - dependencies: - "@babel/highlight" "^7.18.6" - -"@babel/code-frame@^7.22.10", "@babel/code-frame@^7.22.5": - version "7.22.10" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.10.tgz#1c20e612b768fefa75f6e90d6ecb86329247f0a3" - integrity sha512-/KKIMG4UEL35WmI9OlvMhurwtytjvXoFcGNrOvyG9zIzA8YmPjVtIZUf7b05+TPO7G7/GEmLHDaoCgACHl9hhA== - dependencies: - "@babel/highlight" "^7.22.10" - chalk "^2.4.2" - -"@babel/code-frame@^7.22.13": - version "7.22.13" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e" - integrity sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w== - dependencies: - "@babel/highlight" "^7.22.13" - chalk "^2.4.2" - -"@babel/code-frame@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.23.4.tgz#03ae5af150be94392cb5c7ccd97db5a19a5da6aa" - integrity sha512-r1IONyb6Ia+jYR2vvIDhdWdlTGhqbBoFqLTQidzZ4kepUFH15ejXvFHxCVbtl7BOXIudsIubf4E81xeA3h3IXA== - dependencies: - "@babel/highlight" "^7.23.4" - chalk "^2.4.2" - -"@babel/code-frame@^7.23.5": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.18.6", "@babel/code-frame@^7.22.13", "@babel/code-frame@^7.23.5", "@babel/code-frame@^7.5.5", "@babel/code-frame@^7.8.3": version "7.23.5" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.23.5.tgz#9009b69a8c602293476ad598ff53e4562e15c244" integrity sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA== @@ -913,21 +809,11 @@ "@babel/highlight" "^7.23.4" chalk "^2.4.2" -"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.18.6.tgz#8b37d24e88e8e21c499d4328db80577d8882fa53" - integrity sha512-tzulrgDT0QD6U7BJ4TKVk2SDDg7wlP39P9yAx1RfLy7vP/7rsDRlWVfbWxElslu56+r7QOhB2NSDsabYYruoZQ== - "@babel/compat-data@^7.17.7", "@babel/compat-data@^7.18.8", "@babel/compat-data@^7.20.5", "@babel/compat-data@^7.22.9": version "7.22.9" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.9.tgz#71cdb00a1ce3a329ce4cbec3a44f9fef35669730" integrity sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ== -"@babel/compat-data@^7.20.0": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.5.tgz#86f172690b093373a933223b4745deeb6049e733" - integrity sha512-KZXo2t10+/jxmkhNXc7pZTqRvSOIvVv/+lJwHS+B2rErwOyjuVRh60yVpb7liQ1U5t7lLJ1bz+t8tSypUZdm0g== - "@babel/core@7.12.9": version "7.12.9" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.9.tgz#fd450c4ec10cdbb980e2928b7aa7a28484593fc8" @@ -971,49 +857,7 @@ json5 "^2.2.1" semver "^6.3.0" -"@babel/core@^7.1.0", "@babel/core@^7.12.10", "@babel/core@^7.12.3", "@babel/core@^7.7.5": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.18.6.tgz#54a107a3c298aee3fe5e1947a6464b9b6faca03d" - integrity sha512-cQbWBpxcbbs/IUredIPkHiAGULLV8iwgNRMFzvbhEXISp4f3rUUXE5+TIw6KwUWUR3DwyI6gmBRnmAtYaWehwQ== - dependencies: - "@ampproject/remapping" "^2.1.0" - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.18.6" - "@babel/helper-compilation-targets" "^7.18.6" - "@babel/helper-module-transforms" "^7.18.6" - "@babel/helpers" "^7.18.6" - "@babel/parser" "^7.18.6" - "@babel/template" "^7.18.6" - "@babel/traverse" "^7.18.6" - "@babel/types" "^7.18.6" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.1" - semver "^6.3.0" - -"@babel/core@^7.11.6": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.5.tgz#45e2114dc6cd4ab167f81daf7820e8fa1250d113" - integrity sha512-UdOWmk4pNWTm/4DlPUl/Pt4Gz4rcEMb7CY0Y3eJl5Yz1vI8ZJGmHWaVE55LoxRjdpx0z259GE9U5STA9atUinQ== - dependencies: - "@ampproject/remapping" "^2.1.0" - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.20.5" - "@babel/helper-compilation-targets" "^7.20.0" - "@babel/helper-module-transforms" "^7.20.2" - "@babel/helpers" "^7.20.5" - "@babel/parser" "^7.20.5" - "@babel/template" "^7.18.10" - "@babel/traverse" "^7.20.5" - "@babel/types" "^7.20.5" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.1" - semver "^6.3.0" - -"@babel/core@^7.14.0", "@babel/core@^7.22.9": +"@babel/core@^7.1.0", "@babel/core@^7.11.6", "@babel/core@^7.12.10", "@babel/core@^7.12.3", "@babel/core@^7.14.0", "@babel/core@^7.22.9", "@babel/core@^7.7.5": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.23.3.tgz#5ec09c8803b91f51cc887dedc2654a35852849c9" integrity sha512-Jg+msLuNuCJDyBvFv5+OKOUjWMZgd85bKjbICd3zWrKAo+bJ49HJufi7CQE0q0uR8NGyO6xkCACScNqyjHSZew== @@ -1043,45 +887,7 @@ "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" -"@babel/generator@^7.12.11", "@babel/generator@^7.12.5", "@babel/generator@^7.18.6", "@babel/generator@^7.7.2": - version "7.18.7" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.18.7.tgz#2aa78da3c05aadfc82dbac16c99552fc802284bd" - integrity sha512-shck+7VLlY72a2w9c3zYWuE1pwOKEiQHV7GTUbSnhyl5eu3i04t30tBY82ZRWrDfo3gkakCFtevExnxbkf2a3A== - dependencies: - "@babel/types" "^7.18.7" - "@jridgewell/gen-mapping" "^0.3.2" - jsesc "^2.5.1" - -"@babel/generator@^7.14.0", "@babel/generator@^7.18.13", "@babel/generator@^7.23.3", "@babel/generator@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.4.tgz#4a41377d8566ec18f807f42962a7f3551de83d1c" - integrity sha512-esuS49Cga3HcThFNebGhlgsrVLkvhqvYDTzgjfFFlHJcIfLe5jFmRRfCQ1KuBfc4Jrtn3ndLgKWAKjBE+IraYQ== - dependencies: - "@babel/types" "^7.23.4" - "@jridgewell/gen-mapping" "^0.3.2" - "@jridgewell/trace-mapping" "^0.3.17" - jsesc "^2.5.1" - -"@babel/generator@^7.18.10", "@babel/generator@^7.22.10": - version "7.22.10" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.22.10.tgz#c92254361f398e160645ac58831069707382b722" - integrity sha512-79KIf7YiWjjdZ81JnLujDRApWtl7BxTqWD88+FFdQEIOG8LJ0etDOM7CXuIgGJa55sGOwZVwuEsaLEm0PJ5/+A== - dependencies: - "@babel/types" "^7.22.10" - "@jridgewell/gen-mapping" "^0.3.2" - "@jridgewell/trace-mapping" "^0.3.17" - jsesc "^2.5.1" - -"@babel/generator@^7.20.5": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.5.tgz#cb25abee3178adf58d6814b68517c62bdbfdda95" - integrity sha512-jl7JY2Ykn9S0yj4DQP82sYvPU+T3g0HFcWTqDLqiuA9tGRNIj9VfbtXGAYTTkyNEnQk1jkMGOdYka8aG/lulCA== - dependencies: - "@babel/types" "^7.20.5" - "@jridgewell/gen-mapping" "^0.3.2" - jsesc "^2.5.1" - -"@babel/generator@^7.23.6": +"@babel/generator@^7.12.11", "@babel/generator@^7.12.5", "@babel/generator@^7.14.0", "@babel/generator@^7.18.10", "@babel/generator@^7.18.13", "@babel/generator@^7.23.3", "@babel/generator@^7.23.6", "@babel/generator@^7.7.2": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.6.tgz#9e1fca4811c77a10580d17d26b57b036133f3c2e" integrity sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw== @@ -1091,14 +897,7 @@ "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" -"@babel/helper-annotate-as-pure@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz#eaa49f6f80d5a33f9a5dd2276e6d6e451be0a6bb" - integrity sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-annotate-as-pure@^7.22.5": +"@babel/helper-annotate-as-pure@^7.18.6", "@babel/helper-annotate-as-pure@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" integrity sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg== @@ -1113,38 +912,7 @@ "@babel/helper-explode-assignable-expression" "^7.18.6" "@babel/types" "^7.18.6" -"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.6.tgz#18d35bfb9f83b1293c22c55b3d576c1315b6ed96" - integrity sha512-vFjbfhNCzqdeAtZflUFrG5YIFqGTqsctrtkZ1D/NB0mDW9TwW3GmmUepYY4G9wCET5rY5ugz4OGTcLd614IzQg== - dependencies: - "@babel/compat-data" "^7.18.6" - "@babel/helper-validator-option" "^7.18.6" - browserslist "^4.20.2" - semver "^6.3.0" - -"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.20.7", "@babel/helper-compilation-targets@^7.22.5", "@babel/helper-compilation-targets@^7.22.6": - version "7.22.10" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.10.tgz#01d648bbc25dd88f513d862ee0df27b7d4e67024" - integrity sha512-JMSwHD4J7SLod0idLq5PKgI+6g/hLD/iuWBq08ZX49xE14VpVEojJ5rHWptpirV2j020MvypRLAXAO50igCJ5Q== - dependencies: - "@babel/compat-data" "^7.22.9" - "@babel/helper-validator-option" "^7.22.5" - browserslist "^4.21.9" - lru-cache "^5.1.1" - semver "^6.3.1" - -"@babel/helper-compilation-targets@^7.20.0": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.0.tgz#6bf5374d424e1b3922822f1d9bdaa43b1a139d0a" - integrity sha512-0jp//vDGp9e8hZzBc6N/KwA5ZK3Wsm/pfm4CrY7vzegkVxc65SgSn6wYOnwHe9Js9HRQ1YTCKLGPzDtaS3RoLQ== - dependencies: - "@babel/compat-data" "^7.20.0" - "@babel/helper-validator-option" "^7.18.6" - browserslist "^4.21.3" - semver "^6.3.0" - -"@babel/helper-compilation-targets@^7.22.15": +"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.20.7", "@babel/helper-compilation-targets@^7.22.15": version "7.22.15" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz#0698fc44551a26cf29f18d4662d5bf545a6cfc52" integrity sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw== @@ -1155,20 +923,7 @@ lru-cache "^5.1.1" semver "^6.3.1" -"@babel/helper-create-class-features-plugin@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.18.6.tgz#6f15f8459f3b523b39e00a99982e2c040871ed72" - integrity sha512-YfDzdnoxHGV8CzqHGyCbFvXg5QESPFkXlHtvdCkesLjjVMT2Adxe4FGUR5ChIb3DxSaXO12iIOCWoXdsUVwnqw== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-environment-visitor" "^7.18.6" - "@babel/helper-function-name" "^7.18.6" - "@babel/helper-member-expression-to-functions" "^7.18.6" - "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/helper-replace-supers" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - -"@babel/helper-create-class-features-plugin@^7.22.10": +"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.22.10": version "7.22.10" resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.10.tgz#dd2612d59eac45588021ac3d6fa976d08f4e95a3" integrity sha512-5IBb77txKYQPpOEdUdIhBx8VrZyDCQ+H82H0+5dX1TmuscP5vJKEE3cKurjtIw/vFwzbVH48VweE78kVDBrqjA== @@ -1205,20 +960,6 @@ resolve "^1.14.2" semver "^6.1.2" -"@babel/helper-define-polyfill-provider@^0.3.1": - version "0.3.1" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.1.tgz#52411b445bdb2e676869e5a74960d2d3826d2665" - integrity sha512-J9hGMpJQmtWmj46B3kBHmL38UhJGhYX7eqkcq+2gsstyYt341HmPeWspihX43yVRA0mS+8GGk2Gckc7bY/HCmA== - dependencies: - "@babel/helper-compilation-targets" "^7.13.0" - "@babel/helper-module-imports" "^7.12.13" - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/traverse" "^7.13.0" - debug "^4.1.1" - lodash.debounce "^4.0.8" - resolve "^1.14.2" - semver "^6.1.2" - "@babel/helper-define-polyfill-provider@^0.3.2", "@babel/helper-define-polyfill-provider@^0.3.3": version "0.3.3" resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.3.tgz#8612e55be5d51f0cd1f36b4a5a83924e89884b7a" @@ -1231,26 +972,11 @@ resolve "^1.14.2" semver "^6.1.2" -"@babel/helper-environment-visitor@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.6.tgz#b7eee2b5b9d70602e59d1a6cad7dd24de7ca6cd7" - integrity sha512-8n6gSfn2baOY+qlp+VSzsosjCVGFqWKmDF0cCWOybh52Dw3SEyoWR1KrhMJASjLwIEkkAufZ0xvr+SxLHSpy2Q== - -"@babel/helper-environment-visitor@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" - integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== - -"@babel/helper-environment-visitor@^7.22.20": +"@babel/helper-environment-visitor@^7.18.9", "@babel/helper-environment-visitor@^7.22.20", "@babel/helper-environment-visitor@^7.22.5": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== -"@babel/helper-environment-visitor@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz#f06dd41b7c1f44e1f8da6c4055b41ab3a09a7e98" - integrity sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q== - "@babel/helper-explode-assignable-expression@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.18.6.tgz#41f8228ef0a6f1a036b8dfdfec7ce94f9a6bc096" @@ -1258,31 +984,7 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-function-name@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.18.6.tgz#8334fecb0afba66e6d87a7e8c6bb7fed79926b83" - integrity sha512-0mWMxV1aC97dhjCah5U5Ua7668r5ZmSC2DLfH2EZnf9c3/dHZKiFa5pRLMH5tjSl471tY6496ZWk/kjNONBxhw== - dependencies: - "@babel/template" "^7.18.6" - "@babel/types" "^7.18.6" - -"@babel/helper-function-name@^7.18.9", "@babel/helper-function-name@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz#ede300828905bb15e582c037162f99d5183af1be" - integrity sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ== - dependencies: - "@babel/template" "^7.22.5" - "@babel/types" "^7.22.5" - -"@babel/helper-function-name@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz#941574ed5390682e872e52d3f38ce9d1bef4648c" - integrity sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w== - dependencies: - "@babel/template" "^7.18.10" - "@babel/types" "^7.19.0" - -"@babel/helper-function-name@^7.23.0": +"@babel/helper-function-name@^7.18.9", "@babel/helper-function-name@^7.22.5", "@babel/helper-function-name@^7.23.0": version "7.23.0" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== @@ -1290,102 +992,28 @@ "@babel/template" "^7.22.15" "@babel/types" "^7.23.0" -"@babel/helper-hoist-variables@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" - integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-hoist-variables@^7.22.5": +"@babel/helper-hoist-variables@^7.18.6", "@babel/helper-hoist-variables@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== dependencies: "@babel/types" "^7.22.5" -"@babel/helper-member-expression-to-functions@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.18.6.tgz#44802d7d602c285e1692db0bad9396d007be2afc" - integrity sha512-CeHxqwwipekotzPDUuJOfIMtcIHBuc7WAzLmTYWctVigqS5RktNMQ5bEwQSuGewzYnCtTWa3BARXeiLxDTv+Ng== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-member-expression-to-functions@^7.22.15": +"@babel/helper-member-expression-to-functions@^7.22.15", "@babel/helper-member-expression-to-functions@^7.22.5": version "7.23.0" resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.23.0.tgz#9263e88cc5e41d39ec18c9a3e0eced59a3e7d366" integrity sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA== dependencies: "@babel/types" "^7.23.0" -"@babel/helper-member-expression-to-functions@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.22.5.tgz#0a7c56117cad3372fbf8d2fb4bf8f8d64a1e76b2" - integrity sha512-aBiH1NKMG0H2cGZqspNvsaBe6wNGjbJjuLy29aU+eDZjSbbN53BaxlpB02xm9v34pLTZ1nIQPFYn2qMZoa5BQQ== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.16.7", "@babel/helper-module-imports@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz#1e3ebdbbd08aad1437b428c50204db13c5a3ca6e" - integrity sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-module-imports@^7.22.15": +"@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.16.7", "@babel/helper-module-imports@^7.18.6", "@babel/helper-module-imports@^7.22.15": version "7.22.15" resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz#16146307acdc40cc00c3b2c647713076464bdbf0" integrity sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w== dependencies: "@babel/types" "^7.22.15" -"@babel/helper-module-imports@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz#1a8f4c9f4027d23f520bd76b364d44434a72660c" - integrity sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-module-transforms@^7.12.1", "@babel/helper-module-transforms@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.18.6.tgz#57e3ca669e273d55c3cda55e6ebf552f37f483c8" - integrity sha512-L//phhB4al5uucwzlimruukHB3jRd5JGClwRMD/ROrVjXfLqovYnvQrK/JK36WYyVwGGO7OD3kMyVTjx+WVPhw== - dependencies: - "@babel/helper-environment-visitor" "^7.18.6" - "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-simple-access" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/helper-validator-identifier" "^7.18.6" - "@babel/template" "^7.18.6" - "@babel/traverse" "^7.18.6" - "@babel/types" "^7.18.6" - -"@babel/helper-module-transforms@^7.18.9", "@babel/helper-module-transforms@^7.22.5": - version "7.22.9" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.22.9.tgz#92dfcb1fbbb2bc62529024f72d942a8c97142129" - integrity sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ== - dependencies: - "@babel/helper-environment-visitor" "^7.22.5" - "@babel/helper-module-imports" "^7.22.5" - "@babel/helper-simple-access" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/helper-validator-identifier" "^7.22.5" - -"@babel/helper-module-transforms@^7.20.2": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.20.2.tgz#ac53da669501edd37e658602a21ba14c08748712" - integrity sha512-zvBKyJXRbmK07XhMuujYoJ48B5yvvmM6+wcpv6Ivj4Yg6qO7NOZOSnvZN9CRl1zz1Z4cKf8YejmCMh8clOoOeA== - dependencies: - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-simple-access" "^7.20.2" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/helper-validator-identifier" "^7.19.1" - "@babel/template" "^7.18.10" - "@babel/traverse" "^7.20.1" - "@babel/types" "^7.20.2" - -"@babel/helper-module-transforms@^7.23.3": +"@babel/helper-module-transforms@^7.12.1", "@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.18.9", "@babel/helper-module-transforms@^7.22.5", "@babel/helper-module-transforms@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" integrity sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ== @@ -1396,13 +1024,6 @@ "@babel/helper-split-export-declaration" "^7.22.6" "@babel/helper-validator-identifier" "^7.22.20" -"@babel/helper-optimise-call-expression@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz#9369aa943ee7da47edab2cb4e838acf09d290ffe" - integrity sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA== - dependencies: - "@babel/types" "^7.18.6" - "@babel/helper-optimise-call-expression@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz#f21531a9ccbff644fdd156b4077c16ff0c3f609e" @@ -1415,27 +1036,12 @@ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375" integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg== -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.18.6.tgz#9448974dd4fb1d80fefe72e8a0af37809cd30d6d" - integrity sha512-gvZnm1YAAxh13eJdkb9EWHBnF3eAub3XTLCZEehHT2kWxiKVRL64+ae5Y6Ivne0mVHmMYKT+xWgZO+gQhuLUBg== - -"@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.20.2", "@babel/helper-plugin-utils@^7.22.5": +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.20.2", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz#dd7ee3735e8a313b9f7b05a773d892e88e6d7295" integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== -"@babel/helper-remap-async-to-generator@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.6.tgz#fa1f81acd19daee9d73de297c0308783cd3cfc23" - integrity sha512-z5wbmV55TveUPZlCLZvxWHtrjuJd+8inFhk7DG0WW87/oJuGDcjDiu7HIvGcpf5464L6xKCg3vNkmlVVz9hwyQ== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-environment-visitor" "^7.18.6" - "@babel/helper-wrap-function" "^7.18.6" - "@babel/types" "^7.18.6" - -"@babel/helper-remap-async-to-generator@^7.18.9": +"@babel/helper-remap-async-to-generator@^7.18.6", "@babel/helper-remap-async-to-generator@^7.18.9": version "7.22.9" resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.9.tgz#53a25b7484e722d7efb9c350c75c032d4628de82" integrity sha512-8WWC4oR4Px+tr+Fp0X3RHDVfINGpF3ad1HIbrc8A77epiR6eMMc6jsgozkzT2uDiOOdoS9cLIQ+XD2XvI2WSmQ== @@ -1444,18 +1050,7 @@ "@babel/helper-environment-visitor" "^7.22.5" "@babel/helper-wrap-function" "^7.22.9" -"@babel/helper-replace-supers@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.18.6.tgz#efedf51cfccea7b7b8c0f00002ab317e7abfe420" - integrity sha512-fTf7zoXnUGl9gF25fXCWE26t7Tvtyn6H4hkLSYhATwJvw2uYxd3aoXplMSe0g9XbwK7bmxNes7+FGO0rB/xC0g== - dependencies: - "@babel/helper-environment-visitor" "^7.18.6" - "@babel/helper-member-expression-to-functions" "^7.18.6" - "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/traverse" "^7.18.6" - "@babel/types" "^7.18.6" - -"@babel/helper-replace-supers@^7.22.20": +"@babel/helper-replace-supers@^7.18.6", "@babel/helper-replace-supers@^7.22.20", "@babel/helper-replace-supers@^7.22.9": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.22.20.tgz#e37d367123ca98fe455a9887734ed2e16eb7a793" integrity sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw== @@ -1464,29 +1059,6 @@ "@babel/helper-member-expression-to-functions" "^7.22.15" "@babel/helper-optimise-call-expression" "^7.22.5" -"@babel/helper-replace-supers@^7.22.5", "@babel/helper-replace-supers@^7.22.9": - version "7.22.9" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.22.9.tgz#cbdc27d6d8d18cd22c81ae4293765a5d9afd0779" - integrity sha512-LJIKvvpgPOPUThdYqcX6IXRuIcTkcAub0IaDRGCZH0p5GPUp7PhRU9QVgFcDDd51BaPkk77ZjqFwh6DZTAEmGg== - dependencies: - "@babel/helper-environment-visitor" "^7.22.5" - "@babel/helper-member-expression-to-functions" "^7.22.5" - "@babel/helper-optimise-call-expression" "^7.22.5" - -"@babel/helper-simple-access@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.18.6.tgz#d6d8f51f4ac2978068df934b569f08f29788c7ea" - integrity sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-simple-access@^7.20.2": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz#0ab452687fe0c2cfb1e2b9e0015de07fc2d62dd9" - integrity sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA== - dependencies: - "@babel/types" "^7.20.2" - "@babel/helper-simple-access@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz#4938357dc7d782b80ed6dbb03a0fba3d22b1d5de" @@ -1494,13 +1066,6 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-skip-transparent-expression-wrappers@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.18.6.tgz#7dff00a5320ca4cf63270e5a0eca4b268b7380d9" - integrity sha512-4KoLhwGS9vGethZpAhYnMejWkX64wsnHPDwvOsKWU6Fg4+AlK2Jz3TyjQLMEPvz+1zemi/WBdkYxCD0bAfIkiw== - dependencies: - "@babel/types" "^7.18.6" - "@babel/helper-skip-transparent-expression-wrappers@^7.20.0", "@babel/helper-skip-transparent-expression-wrappers@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz#007f15240b5751c537c40e77abb4e89eeaaa8847" @@ -1508,80 +1073,28 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-split-export-declaration@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075" - integrity sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA== - dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-split-export-declaration@^7.22.6": +"@babel/helper-split-export-declaration@^7.18.6", "@babel/helper-split-export-declaration@^7.22.6": version "7.22.6" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== dependencies: "@babel/types" "^7.22.5" -"@babel/helper-string-parser@^7.18.10", "@babel/helper-string-parser@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" - integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== - -"@babel/helper-string-parser@^7.19.4": - version "7.19.4" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63" - integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== - -"@babel/helper-string-parser@^7.23.4": +"@babel/helper-string-parser@^7.18.10", "@babel/helper-string-parser@^7.23.4": version "7.23.4" resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== -"@babel/helper-validator-identifier@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz#9c97e30d31b2b8c72a1d08984f2ca9b574d7a076" - integrity sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g== - -"@babel/helper-validator-identifier@^7.19.1": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" - integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== - -"@babel/helper-validator-identifier@^7.22.20": +"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.22.20", "@babel/helper-validator-identifier@^7.22.5": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== -"@babel/helper-validator-identifier@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193" - integrity sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ== - -"@babel/helper-validator-option@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8" - integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== - -"@babel/helper-validator-option@^7.22.15": +"@babel/helper-validator-option@^7.18.6", "@babel/helper-validator-option@^7.22.15", "@babel/helper-validator-option@^7.22.5": version "7.22.15" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz#694c30dfa1d09a6534cdfcafbe56789d36aba040" integrity sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA== -"@babel/helper-validator-option@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz#de52000a15a177413c8234fa3a8af4ee8102d0ac" - integrity sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw== - -"@babel/helper-wrap-function@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.18.6.tgz#ec44ea4ad9d8988b90c3e465ba2382f4de81a073" - integrity sha512-I5/LZfozwMNbwr/b1vhhuYD+J/mU+gfGAj5td7l5Rv9WYmH6i3Om69WGKNmlIpsVW/mF6O5bvTKbvDQZVgjqOw== - dependencies: - "@babel/helper-function-name" "^7.18.6" - "@babel/template" "^7.18.6" - "@babel/traverse" "^7.18.6" - "@babel/types" "^7.18.6" - "@babel/helper-wrap-function@^7.22.9": version "7.22.10" resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.22.10.tgz#d845e043880ed0b8c18bd194a12005cb16d2f614" @@ -1591,68 +1104,14 @@ "@babel/template" "^7.22.5" "@babel/types" "^7.22.10" -"@babel/helpers@^7.12.5", "@babel/helpers@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.18.6.tgz#4c966140eaa1fcaa3d5a8c09d7db61077d4debfd" - integrity sha512-vzSiiqbQOghPngUYt/zWGvK3LAsPhz55vc9XNN0xAl2gV4ieShI2OQli5duxWHD+72PZPTKAcfcZDE1Cwc5zsQ== +"@babel/helpers@^7.12.5", "@babel/helpers@^7.18.9", "@babel/helpers@^7.23.2": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.23.4.tgz#7d2cfb969aa43222032193accd7329851facf3c1" + integrity sha512-HfcMizYz10cr3h29VqyfGL6ZWIjTwWfvYBMsBVGwpcbhNGe3wQ1ZXZRPzZoAHhd9OqHadHqjQ89iVKINXnbzuw== dependencies: - "@babel/template" "^7.18.6" - "@babel/traverse" "^7.18.6" - "@babel/types" "^7.18.6" - -"@babel/helpers@^7.18.9": - version "7.22.10" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.22.10.tgz#ae6005c539dfbcb5cd71fb51bfc8a52ba63bc37a" - integrity sha512-a41J4NW8HyZa1I1vAndrraTlPZ/eZoga2ZgS7fEr0tZJGVU4xqdE80CEm0CcNjha5EZ8fTBYLKHF0kqDUuAwQw== - dependencies: - "@babel/template" "^7.22.5" - "@babel/traverse" "^7.22.10" - "@babel/types" "^7.22.10" - -"@babel/helpers@^7.20.5": - version "7.20.6" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.20.6.tgz#e64778046b70e04779dfbdf924e7ebb45992c763" - integrity sha512-Pf/OjgfgFRW5bApskEz5pvidpim7tEDPlFtKcNRXWmfHGn9IEI2W2flqRQXTFb7gIPTyK++N6rVHuwKut4XK6w== - dependencies: - "@babel/template" "^7.18.10" - "@babel/traverse" "^7.20.5" - "@babel/types" "^7.20.5" - -"@babel/helpers@^7.23.2": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.23.4.tgz#7d2cfb969aa43222032193accd7329851facf3c1" - integrity sha512-HfcMizYz10cr3h29VqyfGL6ZWIjTwWfvYBMsBVGwpcbhNGe3wQ1ZXZRPzZoAHhd9OqHadHqjQ89iVKINXnbzuw== - dependencies: - "@babel/template" "^7.22.15" - "@babel/traverse" "^7.23.4" - "@babel/types" "^7.23.4" - -"@babel/highlight@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" - integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== - dependencies: - "@babel/helper-validator-identifier" "^7.18.6" - chalk "^2.0.0" - js-tokens "^4.0.0" - -"@babel/highlight@^7.22.10": - version "7.22.10" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.10.tgz#02a3f6d8c1cb4521b2fd0ab0da8f4739936137d7" - integrity sha512-78aUtVcT7MUscr0K5mIEnkwxPE0MaxkR5RxRwuHaQ+JuU5AmTPhY+do2mdzVTnIJJpyBglql2pehuBIWHug+WQ== - dependencies: - "@babel/helper-validator-identifier" "^7.22.5" - chalk "^2.4.2" - js-tokens "^4.0.0" - -"@babel/highlight@^7.22.13": - version "7.22.20" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.20.tgz#4ca92b71d80554b01427815e06f2df965b9c1f54" - integrity sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg== - dependencies: - "@babel/helper-validator-identifier" "^7.22.20" - chalk "^2.4.2" - js-tokens "^4.0.0" + "@babel/template" "^7.22.15" + "@babel/traverse" "^7.23.4" + "@babel/types" "^7.23.4" "@babel/highlight@^7.23.4": version "7.23.4" @@ -1668,32 +1127,7 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.11.tgz#68bb07ab3d380affa9a3f96728df07969645d2d9" integrity sha512-9JKn5vN+hDt0Hdqn1PiJ2guflwP+B6Ga8qbDuoF0PzzVhrzsKIJo8yGqVk6CmMHiMei9w1C1Bp9IMJSIK+HPIQ== -"@babel/parser@^7.1.0", "@babel/parser@^7.12.11", "@babel/parser@^7.12.7", "@babel/parser@^7.14.7", "@babel/parser@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.6.tgz#845338edecad65ebffef058d3be851f1d28a63bc" - integrity sha512-uQVSa9jJUe/G/304lXspfWVpKpK4euFLgGiMQFOCpM/bgcAdeoHwi/OQz23O9GK2osz26ZiXRRV9aV+Yl1O8tw== - -"@babel/parser@^7.14.0", "@babel/parser@^7.16.8", "@babel/parser@^7.23.3", "@babel/parser@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.4.tgz#409fbe690c333bb70187e2de4021e1e47a026661" - integrity sha512-vf3Xna6UEprW+7t6EtOmFpHNAuxw3xqPZghy+brsnusscJRW5BMUzzHZc5ICjULee81WeUV2jjakG09MDglJXQ== - -"@babel/parser@^7.18.10", "@babel/parser@^7.20.5": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.5.tgz#7f3c7335fe417665d929f34ae5dceae4c04015e8" - integrity sha512-r27t/cy/m9uKLXQNWWebeCUHgnAZq0CpG1OwKRxzJMP1vpSU4bSIK2hq+/cp0bQxetkXx38n09rNu8jVkcK/zA== - -"@babel/parser@^7.18.11", "@babel/parser@^7.22.10", "@babel/parser@^7.22.5": - version "7.22.10" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.10.tgz#e37634f9a12a1716136c44624ef54283cabd3f55" - integrity sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ== - -"@babel/parser@^7.22.15": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.3.tgz#0ce0be31a4ca4f1884b5786057cadcb6c3be58f9" - integrity sha512-uVsWNvlVsIninV2prNz/3lHCb+5CJ+e+IUBfbjToAHODtfGYLfCFuY4AU7TskI+dAKk+njsPiBjq1gKTvZOBaw== - -"@babel/parser@^7.23.6": +"@babel/parser@^7.1.0", "@babel/parser@^7.12.11", "@babel/parser@^7.12.7", "@babel/parser@^7.14.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.8", "@babel/parser@^7.18.10", "@babel/parser@^7.18.11", "@babel/parser@^7.22.15", "@babel/parser@^7.23.3", "@babel/parser@^7.23.6": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.6.tgz#ba1c9e512bda72a47e285ae42aff9d2a635a9e3b" integrity sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ== @@ -1705,15 +1139,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.18.6.tgz#b4e4dbc2cd1acd0133479918f7c6412961c9adb8" - integrity sha512-Udgu8ZRgrBrttVz6A0EVL0SJ1z+RLbIeqsu632SA1hf0awEppD6TvdznoH+orIF8wtFFAV/Enmw9Y+9oV8TQcw== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/helper-skip-transparent-expression-wrappers" "^7.18.6" - "@babel/plugin-proposal-optional-chaining" "^7.18.6" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.18.9": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.22.5.tgz#fef09f9499b1f1c930da8a0c419db42167d792ca" @@ -1733,16 +1158,6 @@ "@babel/helper-remap-async-to-generator" "^7.18.9" "@babel/plugin-syntax-async-generators" "^7.8.4" -"@babel/plugin-proposal-async-generator-functions@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.18.6.tgz#aedac81e6fc12bb643374656dd5f2605bf743d17" - integrity sha512-WAz4R9bvozx4qwf74M+sfqPMKfSqwM0phxPTR6iJIi8robgzXwkEgmeJG1gEKhm6sDqT/U9aV3lfcqybIpev8w== - dependencies: - "@babel/helper-environment-visitor" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/helper-remap-async-to-generator" "^7.18.6" - "@babel/plugin-syntax-async-generators" "^7.8.4" - "@babel/plugin-proposal-class-properties@7.18.6", "@babel/plugin-proposal-class-properties@^7.0.0", "@babel/plugin-proposal-class-properties@^7.12.1", "@babel/plugin-proposal-class-properties@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz#b110f59741895f7ec21a6fff696ec46265c446a3" @@ -1779,7 +1194,7 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-dynamic-import" "^7.8.3" -"@babel/plugin-proposal-export-default-from@7.18.10": +"@babel/plugin-proposal-export-default-from@7.18.10", "@babel/plugin-proposal-export-default-from@^7.12.1": version "7.18.10" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.18.10.tgz#091f4794dbce4027c03cf4ebc64d3fb96b75c206" integrity sha512-5H2N3R2aQFxkV4PIBUR/i7PUSwgTZjouJKzI8eKswfIjT0PhvzkPn0t0wIS5zn6maQuvtT0t1oHtMUz61LOuow== @@ -1787,22 +1202,6 @@ "@babel/helper-plugin-utils" "^7.18.9" "@babel/plugin-syntax-export-default-from" "^7.18.6" -"@babel/plugin-proposal-export-default-from@^7.12.1": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.18.6.tgz#121b3ba0152d0020865bc86271c8150e5115abc7" - integrity sha512-oTvzWB16T9cB4j5kX8c8DuUHo/4QtR2P9vnUNKed9xqFP8Jos/IRniz1FiIryn6luDYoltDJSYF7RCpbm2doMg== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-export-default-from" "^7.18.6" - -"@babel/plugin-proposal-export-namespace-from@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.18.6.tgz#1016f0aa5ab383bbf8b3a85a2dcaedf6c8ee7491" - integrity sha512-zr/QcUlUo7GPo6+X1wC98NJADqmy5QTFWWhqeQWiki4XHafJtLl/YMGkmRB2szDD2IYJCCdBTd4ElwhId9T7Xw== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-proposal-export-namespace-from@^7.18.9": version "7.18.9" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.18.9.tgz#5f7313ab348cdb19d590145f9247540e94761203" @@ -1819,14 +1218,6 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-json-strings" "^7.8.3" -"@babel/plugin-proposal-logical-assignment-operators@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.18.6.tgz#3b9cac6f1ffc2aa459d111df80c12020dfc6b665" - integrity sha512-zMo66azZth/0tVd7gmkxOkOjs2rpHyhpcFo565PUP37hSp6hSd9uUKIfTDFMz58BwqgQKhJ9YxtM5XddjXVn+Q== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - "@babel/plugin-proposal-logical-assignment-operators@^7.18.9": version "7.20.7" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.20.7.tgz#dfbcaa8f7b4d37b51e8bfb46d94a5aea2bb89d83" @@ -1871,7 +1262,7 @@ "@babel/plugin-syntax-object-rest-spread" "^7.8.3" "@babel/plugin-transform-parameters" "^7.18.8" -"@babel/plugin-proposal-object-rest-spread@^7.0.0", "@babel/plugin-proposal-object-rest-spread@^7.18.9": +"@babel/plugin-proposal-object-rest-spread@^7.0.0", "@babel/plugin-proposal-object-rest-spread@^7.12.1", "@babel/plugin-proposal-object-rest-spread@^7.18.9": version "7.20.7" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz#aa662940ef425779c75534a5c41e9d936edc390a" integrity sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg== @@ -1882,17 +1273,6 @@ "@babel/plugin-syntax-object-rest-spread" "^7.8.3" "@babel/plugin-transform-parameters" "^7.20.7" -"@babel/plugin-proposal-object-rest-spread@^7.12.1", "@babel/plugin-proposal-object-rest-spread@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.18.6.tgz#ec93bba06bfb3e15ebd7da73e953d84b094d5daf" - integrity sha512-9yuM6wr4rIsKa1wlUAbZEazkCrgw2sMPEXCr4Rnwetu7cEW1NydkCWytLuYletbf8vFxdJxFhwEZqMpOx2eZyw== - dependencies: - "@babel/compat-data" "^7.18.6" - "@babel/helper-compilation-targets" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.18.6" - "@babel/plugin-proposal-optional-catch-binding@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.18.6.tgz#f9400d0e6a3ea93ba9ef70b09e72dd6da638a2cb" @@ -1901,16 +1281,7 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" -"@babel/plugin-proposal-optional-chaining@^7.12.7", "@babel/plugin-proposal-optional-chaining@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.18.6.tgz#46d4f2ffc20e87fad1d98bc4fa5d466366f6aa0b" - integrity sha512-PatI6elL5eMzoypFAiYDpYQyMtXTn+iMhuxxQt5mAXD4fEmKorpSI3PHd+i3JXBJN3xyA6MvJv7at23HffFHwA== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/helper-skip-transparent-expression-wrappers" "^7.18.6" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - -"@babel/plugin-proposal-optional-chaining@^7.18.9": +"@babel/plugin-proposal-optional-chaining@^7.12.7", "@babel/plugin-proposal-optional-chaining@^7.18.9": version "7.21.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.21.0.tgz#886f5c8978deb7d30f678b2e24346b287234d3ea" integrity sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA== @@ -2008,21 +1379,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-syntax-flow@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.18.6.tgz#774d825256f2379d06139be0c723c4dd444f3ca1" - integrity sha512-LUbR+KNTBWCUAqRG9ex5Gnzu2IOkt8jRJbHHXFT9q+L9zm7M/QQbEqXyw1n1pohYvOyWC8CjeyjrSaIwiYjK7A== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-syntax-import-assertions@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.18.6.tgz#cd6190500a4fa2fe31990a963ffab4b63e4505e4" - integrity sha512-/DU3RXad9+bZwrgWJQKbr39gYbJpLJHezqEzRzi/BHRlJ9zsQb4CK2CA/5apllXNomwA1qHwzvHl+AdEmC5krQ== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-syntax-import-assertions@^7.20.0": +"@babel/plugin-syntax-import-assertions@^7.18.6", "@babel/plugin-syntax-import-assertions@^7.20.0": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.23.3.tgz#9c05a7f592982aff1a2768260ad84bcd3f0c77fc" integrity sha512-lPgDSU+SJLK3xmFDTV2ZRQAiM7UuUjGidwBywFavObCiZc1BeAAcMtHJKUya92hPHO+at63JJPLygilZard8jw== @@ -2050,27 +1407,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-syntax-jsx@^7.0.0", "@babel/plugin-syntax-jsx@^7.23.3": +"@babel/plugin-syntax-jsx@^7.0.0", "@babel/plugin-syntax-jsx@^7.17.12", "@babel/plugin-syntax-jsx@^7.22.5", "@babel/plugin-syntax-jsx@^7.23.3", "@babel/plugin-syntax-jsx@^7.7.2": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz#8f2e4f8a9b5f9aa16067e142c1ac9cd9f810f473" integrity sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg== dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-syntax-jsx@^7.17.12", "@babel/plugin-syntax-jsx@^7.18.6", "@babel/plugin-syntax-jsx@^7.7.2": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz#a8feef63b010150abd97f1649ec296e849943ca0" - integrity sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-syntax-jsx@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz#a6b68e84fb76e759fc3b93e901876ffabbe1d918" - integrity sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-logical-assignment-operators@^7.10.4", "@babel/plugin-syntax-logical-assignment-operators@^7.8.3": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" @@ -2127,34 +1470,20 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-typescript@^7.18.6", "@babel/plugin-syntax-typescript@^7.7.2": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.18.6.tgz#1c09cd25795c7c2b8a4ba9ae49394576d4133285" - integrity sha512-mAWAuq4rvOepWCBid55JuRNvpTNf2UGVgoz4JV0fXEKolsVZDzsa4NqCef758WZJj/GDu0gVGItjKFiClTAmZA== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-syntax-typescript@^7.22.5": +"@babel/plugin-syntax-typescript@^7.22.5", "@babel/plugin-syntax-typescript@^7.7.2": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz#aac8d383b062c5072c647a31ef990c1d0af90272" integrity sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ== dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-arrow-functions@^7.0.0": +"@babel/plugin-transform-arrow-functions@^7.0.0", "@babel/plugin-transform-arrow-functions@^7.12.1", "@babel/plugin-transform-arrow-functions@^7.18.6": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.23.3.tgz#94c6dcfd731af90f27a79509f9ab7fb2120fc38b" integrity sha512-NzQcQrzaQPkaEwoTm4Mhyl8jI1huEL/WWIEvudjTCMJ9aBZNpsJbMASx7EQECtQQPS/DcnFpo0FIh3LvEO9cxQ== dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-arrow-functions@^7.12.1", "@babel/plugin-transform-arrow-functions@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.18.6.tgz#19063fcf8771ec7b31d742339dac62433d0611fe" - integrity sha512-9S9X9RUefzrsHZmKMbDXxweEH+YlE8JJEuat9FdvW9Qh1cw7W64jELCtWNkPBPX5En45uy28KGvA/AySqUh8CQ== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-transform-async-to-generator@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.18.6.tgz#ccda3d1ab9d5ced5265fdb13f1882d5476c71615" @@ -2164,42 +1493,21 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/helper-remap-async-to-generator" "^7.18.6" -"@babel/plugin-transform-block-scoped-functions@^7.0.0": +"@babel/plugin-transform-block-scoped-functions@^7.0.0", "@babel/plugin-transform-block-scoped-functions@^7.18.6": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.23.3.tgz#fe1177d715fb569663095e04f3598525d98e8c77" integrity sha512-vI+0sIaPIO6CNuM9Kk5VmXcMVRiOpDh7w2zZt9GXzmE/9KD70CUEVhvPR/etAeNK/FAEkhxQtXOzVF3EuRL41A== dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-block-scoped-functions@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.18.6.tgz#9187bf4ba302635b9d70d986ad70f038726216a8" - integrity sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-block-scoping@^7.0.0": +"@babel/plugin-transform-block-scoping@^7.0.0", "@babel/plugin-transform-block-scoping@^7.12.12", "@babel/plugin-transform-block-scoping@^7.18.9": version "7.23.4" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.23.4.tgz#b2d38589531c6c80fbe25e6b58e763622d2d3cf5" integrity sha512-0QqbP6B6HOh7/8iNR4CQU2Th/bbRtBp4KS9vcaZd1fZ0wSh5Fyssg0UCIHwxh+ka+pNDREbVLQnHCMHKZfPwfw== dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-block-scoping@^7.12.12", "@babel/plugin-transform-block-scoping@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.18.6.tgz#b5f78318914615397d86a731ef2cc668796a726c" - integrity sha512-pRqwb91C42vs1ahSAWJkxOxU1RHWDn16XAa6ggQ72wjLlWyYeAcLvTtE0aM8ph3KNydy9CQF2nLYcjq1WysgxQ== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-block-scoping@^7.18.9": - version "7.22.10" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.22.10.tgz#88a1dccc3383899eb5e660534a76a22ecee64faa" - integrity sha512-1+kVpGAOOI1Albt6Vse7c8pHzcZQdQKW+wJH+g8mCaszOdDVwRXa/slHPqIw+oJAJANTKDMuM2cBdV0Dg618Vg== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-classes@^7.0.0": +"@babel/plugin-transform-classes@^7.0.0", "@babel/plugin-transform-classes@^7.12.1", "@babel/plugin-transform-classes@^7.18.9": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.23.3.tgz#73380c632c095b03e8503c24fd38f95ad41ffacb" integrity sha512-FGEQmugvAEu2QtgtU0uTASXevfLMFfBeVCIIdcQhn/uBQsMTjBajdnAtanQlOcuihWh10PZ7+HWvc7NtBwP74w== @@ -2214,36 +1522,7 @@ "@babel/helper-split-export-declaration" "^7.22.6" globals "^11.1.0" -"@babel/plugin-transform-classes@^7.12.1", "@babel/plugin-transform-classes@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.18.6.tgz#3501a8f3f4c7d5697c27a3eedbee71d68312669f" - integrity sha512-XTg8XW/mKpzAF3actL554Jl/dOYoJtv3l8fxaEczpgz84IeeVf+T1u2CSvPHuZbt0w3JkIx4rdn/MRQI7mo0HQ== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-environment-visitor" "^7.18.6" - "@babel/helper-function-name" "^7.18.6" - "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/helper-replace-supers" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - globals "^11.1.0" - -"@babel/plugin-transform-classes@^7.18.9": - version "7.22.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.22.6.tgz#e04d7d804ed5b8501311293d1a0e6d43e94c3363" - integrity sha512-58EgM6nuPNG6Py4Z3zSuu0xWu2VfodiMi72Jt5Kj2FECmaYk1RrTXA45z6KBFsu9tRgwQDwIiY4FXTt+YsSFAQ== - dependencies: - "@babel/helper-annotate-as-pure" "^7.22.5" - "@babel/helper-compilation-targets" "^7.22.6" - "@babel/helper-environment-visitor" "^7.22.5" - "@babel/helper-function-name" "^7.22.5" - "@babel/helper-optimise-call-expression" "^7.22.5" - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-replace-supers" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" - globals "^11.1.0" - -"@babel/plugin-transform-computed-properties@^7.0.0": +"@babel/plugin-transform-computed-properties@^7.0.0", "@babel/plugin-transform-computed-properties@^7.18.9": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.23.3.tgz#652e69561fcc9d2b50ba4f7ac7f60dcf65e86474" integrity sha512-dTj83UVTLw/+nbiHqQSFdwO9CbTtwq1DsDqm3CUEtDrZNET5rT5E6bIdTlOftDTDLMYxvxHNEYO4B9SLl8SLZw== @@ -2251,42 +1530,13 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/template" "^7.22.15" -"@babel/plugin-transform-computed-properties@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.18.6.tgz#5d15eb90e22e69604f3348344c91165c5395d032" - integrity sha512-9repI4BhNrR0KenoR9vm3/cIc1tSBIo+u1WVjKCAynahj25O8zfbiE6JtAtHPGQSs4yZ+bA8mRasRP+qc+2R5A== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-computed-properties@^7.18.9": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.22.5.tgz#cd1e994bf9f316bd1c2dafcd02063ec261bb3869" - integrity sha512-4GHWBgRf0krxPX+AaPtgBAlTgTeZmqDynokHOX7aqqAB4tHs3U2Y02zH6ETFdLZGcg9UQSD1WCmkVrE9ErHeOg== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/template" "^7.22.5" - -"@babel/plugin-transform-destructuring@^7.0.0": +"@babel/plugin-transform-destructuring@^7.0.0", "@babel/plugin-transform-destructuring@^7.12.1", "@babel/plugin-transform-destructuring@^7.18.9": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.23.3.tgz#8c9ee68228b12ae3dff986e56ed1ba4f3c446311" integrity sha512-n225npDqjDIr967cMScVKHXJs7rout1q+tt50inyBCPkyZ8KxeI6d+GIbSBTT/w/9WdlWDOej3V9HE5Lgk57gw== dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-destructuring@^7.12.1", "@babel/plugin-transform-destructuring@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.18.6.tgz#a98b0e42c7ffbf5eefcbcf33280430f230895c6f" - integrity sha512-tgy3u6lRp17ilY8r1kP4i2+HDUwxlVqq3RTc943eAWSzGgpU1qhiKpqZ5CMyHReIYPHdo3Kg8v8edKtDqSVEyQ== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-destructuring@^7.18.9": - version "7.22.10" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.22.10.tgz#38e2273814a58c810b6c34ea293be4973c4eb5e2" - integrity sha512-dPJrL0VOyxqLM9sritNbMSGx/teueHF/htMKrPT7DNxccXxRDPYqlgPFFdr8u+F+qUZOkZoXue/6rL5O5GduEw== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-transform-dotall-regex@^7.18.6", "@babel/plugin-transform-dotall-regex@^7.4.4": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.18.6.tgz#b286b3e7aae6c7b861e45bed0a2fafd6b1a4fef8" @@ -2295,13 +1545,6 @@ "@babel/helper-create-regexp-features-plugin" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-duplicate-keys@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.18.6.tgz#e6c94e8cd3c9dd8a88144f7b78ae22975a7ff473" - integrity sha512-NJU26U/208+sxYszf82nmGYqVF9QN8py2HFTblPT9hbawi8+1C5a9JubODLTGFuT0qlkqVinmkwOD13s0sZktg== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-transform-duplicate-keys@^7.18.9": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.22.5.tgz#b6e6428d9416f5f0bba19c70d1e6e7e0b88ab285" @@ -2317,7 +1560,7 @@ "@babel/helper-builder-binary-assignment-operator-visitor" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-flow-strip-types@^7.0.0": +"@babel/plugin-transform-flow-strip-types@^7.0.0", "@babel/plugin-transform-flow-strip-types@^7.18.6": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.23.3.tgz#cfa7ca159cc3306fab526fc67091556b51af26ff" integrity sha512-26/pQTf9nQSNVJCrLB1IkHUKyPxR+lMrH2QDPG89+Znu9rAMbtrybdbWeE9bb7gzjmE5iXHEY+e0HUwM6Co93Q== @@ -2325,36 +1568,14 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-flow" "^7.23.3" -"@babel/plugin-transform-flow-strip-types@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.18.6.tgz#6d3dd9f9c0fe13349428569fef00b31310bb3f9f" - integrity sha512-wE0xtA7csz+hw4fKPwxmu5jnzAsXPIO57XnRwzXP3T19jWh1BODnPGoG9xKYwvAwusP7iUktHayRFbMPGtODaQ== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-flow" "^7.18.6" - -"@babel/plugin-transform-for-of@^7.0.0": +"@babel/plugin-transform-for-of@^7.0.0", "@babel/plugin-transform-for-of@^7.12.1", "@babel/plugin-transform-for-of@^7.18.8": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.23.3.tgz#afe115ff0fbce735e02868d41489093c63e15559" integrity sha512-X8jSm8X1CMwxmK878qsUGJRmbysKNbdpTv/O1/v0LuY/ZkZrng5WYiekYSdg9m09OTmDDUWeEDsTE+17WYbAZw== dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-for-of@^7.12.1", "@babel/plugin-transform-for-of@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.18.6.tgz#e0fdb813be908e91ccc9ec87b30cc2eabf046f7c" - integrity sha512-WAjoMf4wIiSsy88KmG7tgj2nFdEK7E46tArVtcgED7Bkj6Fg/tG5SbvNIOKxbFS2VFgNh6+iaPswBeQZm4ox8w== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-for-of@^7.18.8": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.22.5.tgz#ab1b8a200a8f990137aff9a084f8de4099ab173f" - integrity sha512-3kxQjX1dU9uudwSshyLeEipvrLjBCVthCgeTp6CzE/9JYrlAIaeekVxRpCWsDDfYTfRZRoCeZatCQvwo+wvK8A== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-function-name@^7.0.0": +"@babel/plugin-transform-function-name@^7.0.0", "@babel/plugin-transform-function-name@^7.18.9": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.23.3.tgz#8f424fcd862bf84cb9a1a6b42bc2f47ed630f8dc" integrity sha512-I1QXp1LxIvt8yLaib49dRW5Okt7Q4oaxao6tFVKS/anCdEOMtYwWVKoiOA1p34GOWIZjUK0E+zCp7+l1pfQyiw== @@ -2363,59 +1584,20 @@ "@babel/helper-function-name" "^7.23.0" "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-function-name@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.18.6.tgz#6a7e4ae2893d336fd1b8f64c9f92276391d0f1b4" - integrity sha512-kJha/Gbs5RjzIu0CxZwf5e3aTTSlhZnHMT8zPWnJMjNpLOUgqevg+PN5oMH68nMCXnfiMo4Bhgxqj59KHTlAnA== - dependencies: - "@babel/helper-compilation-targets" "^7.18.6" - "@babel/helper-function-name" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-function-name@^7.18.9": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.22.5.tgz#935189af68b01898e0d6d99658db6b164205c143" - integrity sha512-UIzQNMS0p0HHiQm3oelztj+ECwFnj+ZRV4KnguvlsD2of1whUeM6o7wGNj6oLwcDoAXQ8gEqfgC24D+VdIcevg== - dependencies: - "@babel/helper-compilation-targets" "^7.22.5" - "@babel/helper-function-name" "^7.22.5" - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-literals@^7.0.0": +"@babel/plugin-transform-literals@^7.0.0", "@babel/plugin-transform-literals@^7.18.9": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.23.3.tgz#8214665f00506ead73de157eba233e7381f3beb4" integrity sha512-wZ0PIXRxnwZvl9AYpqNUxpZ5BiTGrYt7kueGQ+N5FiQ7RCOD4cm8iShd6S6ggfVIWaJf2EMk8eRzAh52RfP4rQ== dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-literals@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.18.6.tgz#9d6af353b5209df72960baf4492722d56f39a205" - integrity sha512-x3HEw0cJZVDoENXOp20HlypIHfl0zMIhMVZEBVTfmqbObIpsMxMbmU5nOEO8R7LYT+z5RORKPlTI5Hj4OsO9/Q== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-literals@^7.18.9": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.22.5.tgz#e9341f4b5a167952576e23db8d435849b1dd7920" - integrity sha512-fTLj4D79M+mepcw3dgFBTIDYpbcB9Sm0bpm4ppXPaO+U+PKFFyV9MGRvS0gvGw62sd10kT5lRMKXAADb9pWy8g== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-member-expression-literals@^7.0.0": +"@babel/plugin-transform-member-expression-literals@^7.0.0", "@babel/plugin-transform-member-expression-literals@^7.18.6": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.23.3.tgz#e37b3f0502289f477ac0e776b05a833d853cabcc" integrity sha512-sC3LdDBDi5x96LA+Ytekz2ZPk8i/Ck+DEuDbRAll5rknJ5XRTSaPKEYwomLcs1AA8wg9b3KjIQRsnApj+q51Ag== dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-member-expression-literals@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.18.6.tgz#ac9fdc1a118620ac49b7e7a5d2dc177a1bfee88e" - integrity sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-transform-modules-amd@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.18.6.tgz#8c91f8c5115d2202f277549848874027d7172d21" @@ -2425,7 +1607,7 @@ "@babel/helper-plugin-utils" "^7.18.6" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-commonjs@^7.0.0": +"@babel/plugin-transform-modules-commonjs@^7.0.0", "@babel/plugin-transform-modules-commonjs@^7.18.6", "@babel/plugin-transform-modules-commonjs@^7.22.5": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.23.3.tgz#661ae831b9577e52be57dd8356b734f9700b53b4" integrity sha512-aVS0F65LKsdNOtcz6FRCpE4OgsP2OFnW46qNxNIX9h3wuzaNcSQsJysuMwqSibC98HPrf2vCgtxKNwS0DAlgcA== @@ -2434,36 +1616,6 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-simple-access" "^7.22.5" -"@babel/plugin-transform-modules-commonjs@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.18.6.tgz#afd243afba166cca69892e24a8fd8c9f2ca87883" - integrity sha512-Qfv2ZOWikpvmedXQJDSbxNqy7Xr/j2Y8/KfijM0iJyKkBTmWuvCA1yeH1yDM7NJhBW/2aXxeucLj6i80/LAJ/Q== - dependencies: - "@babel/helper-module-transforms" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/helper-simple-access" "^7.18.6" - babel-plugin-dynamic-import-node "^2.3.3" - -"@babel/plugin-transform-modules-commonjs@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.22.5.tgz#7d9875908d19b8c0536085af7b053fd5bd651bfa" - integrity sha512-B4pzOXj+ONRmuaQTg05b3y/4DuFz3WcCNAXPLb2Q0GT0TrGKGxNKV4jwsXts+StaM0LQczZbOpj8o1DLPDJIiA== - dependencies: - "@babel/helper-module-transforms" "^7.22.5" - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-simple-access" "^7.22.5" - -"@babel/plugin-transform-modules-systemjs@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.18.6.tgz#026511b7657d63bf5d4cf2fd4aeb963139914a54" - integrity sha512-UbPYpXxLjTw6w6yXX2BYNxF3p6QY225wcTkfQCy3OMnSlS/C3xGtwUjEzGkldb/sy6PWLiCQ3NbYfjWUTI3t4g== - dependencies: - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-module-transforms" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/helper-validator-identifier" "^7.18.6" - babel-plugin-dynamic-import-node "^2.3.3" - "@babel/plugin-transform-modules-systemjs@^7.18.9": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.22.5.tgz#18c31410b5e579a0092638f95c896c2a98a5d496" @@ -2497,7 +1649,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-object-super@^7.0.0": +"@babel/plugin-transform-object-super@^7.0.0", "@babel/plugin-transform-object-super@^7.18.6": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.23.3.tgz#81fdb636dcb306dd2e4e8fd80db5b2362ed2ebcd" integrity sha512-BwQ8q0x2JG+3lxCVFohg+KbQM7plfpBwThdW9A6TMtWwLsbDA01Ek2Zb/AgDN39BiZsExm4qrXxjk+P1/fzGrA== @@ -2505,14 +1657,6 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-replace-supers" "^7.22.20" -"@babel/plugin-transform-object-super@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.18.6.tgz#fb3c6ccdd15939b6ff7939944b51971ddc35912c" - integrity sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/helper-replace-supers" "^7.18.6" - "@babel/plugin-transform-optional-chaining@^7.22.5": version "7.22.10" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.10.tgz#076d28a7e074392e840d4ae587d83445bac0372a" @@ -2522,55 +1666,27 @@ "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" "@babel/plugin-syntax-optional-chaining" "^7.8.3" -"@babel/plugin-transform-parameters@^7.0.0": +"@babel/plugin-transform-parameters@^7.0.0", "@babel/plugin-transform-parameters@^7.12.1", "@babel/plugin-transform-parameters@^7.18.8", "@babel/plugin-transform-parameters@^7.20.7": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.23.3.tgz#83ef5d1baf4b1072fa6e54b2b0999a7b2527e2af" integrity sha512-09lMt6UsUb3/34BbECKVbVwrT9bO6lILWln237z7sLaWnMsTi7Yc9fhX5DLpkJzAGfaReXI22wP41SZmnAA3Vw== dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-parameters@^7.12.1", "@babel/plugin-transform-parameters@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.18.6.tgz#cbe03d5a4c6385dd756034ac1baa63c04beab8dc" - integrity sha512-FjdqgMv37yVl/gwvzkcB+wfjRI8HQmc5EgOG9iGNvUY1ok+TjsoaMP7IqCDZBhkFcM5f3OPVMs6Dmp03C5k4/A== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-parameters@^7.18.8", "@babel/plugin-transform-parameters@^7.20.7": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.5.tgz#c3542dd3c39b42c8069936e48717a8d179d63a18" - integrity sha512-AVkFUBurORBREOmHRKo06FjHYgjrabpdqRSwq6+C7R5iTCZOsM4QbcB27St0a4U6fffyAOqh3s/qEfybAhfivg== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-property-literals@^7.0.0": +"@babel/plugin-transform-property-literals@^7.0.0", "@babel/plugin-transform-property-literals@^7.18.6": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.23.3.tgz#54518f14ac4755d22b92162e4a852d308a560875" integrity sha512-jR3Jn3y7cZp4oEWPFAlRsSWjxKe4PZILGBSd4nis1TsC5qeSpb+nrtihJuDhNI7QHiVbUaiXa0X2RZY3/TI6Nw== dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-property-literals@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.18.6.tgz#e22498903a483448e94e032e9bbb9c5ccbfc93a3" - integrity sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-react-display-name@^7.0.0": +"@babel/plugin-transform-react-display-name@^7.0.0", "@babel/plugin-transform-react-display-name@^7.18.6": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.23.3.tgz#70529f034dd1e561045ad3c8152a267f0d7b6200" integrity sha512-GnvhtVfA2OAtzdX58FJxU19rhoGeQzyVndw3GgtdECQvQFXPEZIOVULHVZGAYmOgmqjXpVpfocAbSjh99V/Fqw== dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-react-display-name@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.18.6.tgz#8b1125f919ef36ebdfff061d664e266c666b9415" - integrity sha512-TV4sQ+T013n61uMoygyMRm+xf04Bd5oqFpv2jAEQwSZ8NwQA7zeRPg1LMVg2PWi3zWBz+CLKD+v5bcpZ/BS0aA== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-transform-react-jsx-development@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.18.6.tgz#dbe5c972811e49c7405b630e4d0d2e1380c0ddc5" @@ -2578,7 +1694,7 @@ dependencies: "@babel/plugin-transform-react-jsx" "^7.18.6" -"@babel/plugin-transform-react-jsx@^7.0.0": +"@babel/plugin-transform-react-jsx@^7.0.0", "@babel/plugin-transform-react-jsx@^7.12.12", "@babel/plugin-transform-react-jsx@^7.18.6": version "7.23.4" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.23.4.tgz#393f99185110cea87184ea47bcb4a7b0c2e39312" integrity sha512-5xOpoPguCZCRbo/JeHlloSkTA8Bld1J/E1/kLfD1nsuiW1m8tduTA1ERCgIZokDflX/IBzKcqR3l7VlRgiIfHA== @@ -2589,17 +1705,6 @@ "@babel/plugin-syntax-jsx" "^7.23.3" "@babel/types" "^7.23.4" -"@babel/plugin-transform-react-jsx@^7.12.12", "@babel/plugin-transform-react-jsx@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.18.6.tgz#2721e96d31df96e3b7ad48ff446995d26bc028ff" - integrity sha512-Mz7xMPxoy9kPS/JScj6fJs03TZ/fZ1dJPlMjRAgTaxaS0fUBk8FV/A2rRgfPsVCZqALNwMexD+0Uaf5zlcKPpw== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-jsx" "^7.18.6" - "@babel/types" "^7.18.6" - "@babel/plugin-transform-react-pure-annotations@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.18.6.tgz#561af267f19f3e5d59291f9950fd7b9663d0d844" @@ -2635,21 +1740,14 @@ babel-plugin-polyfill-regenerator "^0.4.0" semver "^6.3.0" -"@babel/plugin-transform-shorthand-properties@^7.0.0": +"@babel/plugin-transform-shorthand-properties@^7.0.0", "@babel/plugin-transform-shorthand-properties@^7.12.1", "@babel/plugin-transform-shorthand-properties@^7.18.6": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.23.3.tgz#97d82a39b0e0c24f8a981568a8ed851745f59210" integrity sha512-ED2fgqZLmexWiN+YNFX26fx4gh5qHDhn1O2gvEhreLW2iI63Sqm4llRLCXALKrCnbN4Jy0VcMQZl/SAzqug/jg== dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-shorthand-properties@^7.12.1", "@babel/plugin-transform-shorthand-properties@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.18.6.tgz#6d6df7983d67b195289be24909e3f12a8f664dc9" - integrity sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-spread@^7.0.0": +"@babel/plugin-transform-spread@^7.0.0", "@babel/plugin-transform-spread@^7.12.1", "@babel/plugin-transform-spread@^7.18.9": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.23.3.tgz#41d17aacb12bde55168403c6f2d6bdca563d362c" integrity sha512-VvfVYlrlBVu+77xVTOAoxQ6mZbnIq5FM0aGBSFEcIh03qHf+zNqA4DC/3XMUozTg7bZV3e3mZQ0i13VB6v5yUg== @@ -2657,22 +1755,6 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" -"@babel/plugin-transform-spread@^7.12.1", "@babel/plugin-transform-spread@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.18.6.tgz#82b080241965f1689f0a60ecc6f1f6575dbdb9d6" - integrity sha512-ayT53rT/ENF8WWexIRg9AiV9h0aIteyWn5ptfZTZQrjk/+f3WdrJGCY4c9wcgl2+MKkKPhzbYp97FTsquZpDCw== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/helper-skip-transparent-expression-wrappers" "^7.18.6" - -"@babel/plugin-transform-spread@^7.18.9": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.22.5.tgz#6487fd29f229c95e284ba6c98d65eafb893fea6b" - integrity sha512-5ZzDQIGyvN4w8+dMmpohL6MBo+l2G7tfC/O2Dg7/hjpgeWvUx8FzfeOKxGog9IimPa4YekaQ9PlDqTLOljkcxg== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" - "@babel/plugin-transform-sticky-regex@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.18.6.tgz#c6706eb2b1524028e317720339583ad0f444adcc" @@ -2680,34 +1762,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-template-literals@^7.0.0": +"@babel/plugin-transform-template-literals@^7.0.0", "@babel/plugin-transform-template-literals@^7.12.1", "@babel/plugin-transform-template-literals@^7.18.9": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.23.3.tgz#5f0f028eb14e50b5d0f76be57f90045757539d07" integrity sha512-Flok06AYNp7GV2oJPZZcP9vZdszev6vPBkHLwxwSpaIqx75wn6mUd3UFWsSsA0l8nXAKkyCmL/sR02m8RYGeHg== dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-template-literals@^7.12.1", "@babel/plugin-transform-template-literals@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.6.tgz#b763f4dc9d11a7cce58cf9a490d82e80547db9c2" - integrity sha512-UuqlRrQmT2SWRvahW46cGSany0uTlcj8NYOS5sRGYi8FxPYPoLd5DDmMd32ZXEj2Jq+06uGVQKHxa/hJx2EzKw== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-transform-template-literals@^7.18.9": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.22.5.tgz#8f38cf291e5f7a8e60e9f733193f0bcc10909bff" - integrity sha512-5ciOehRNf+EyUeewo8NkbQiUs4d6ZxiHo6BcBcnFlgiJfu16q0bQUw9Jvo0b0gBKFG1SMhDSjeKXSYuJLeFSMA== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/plugin-transform-typeof-symbol@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.18.6.tgz#486bb39d5a18047358e0d04dc0d2f322f0b92e92" - integrity sha512-7m71iS/QhsPk85xSjFPovHPcH3H9qeyzsujhTc+vcdnsXavoWYJ74zx0lP5RhpC5+iDnVLO+PPMHzC11qels1g== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-transform-typeof-symbol@^7.18.9": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.22.5.tgz#5e2ba478da4b603af8673ff7c54f75a97b716b34" @@ -2715,15 +1776,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-typescript@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.18.6.tgz#8f4ade1a9cf253e5cf7c7c20173082c2c08a50a7" - integrity sha512-ijHNhzIrLj5lQCnI6aaNVRtGVuUZhOXFLRVFs7lLrkXTHip4FKty5oAuQdk4tywG0/WjXmjTfQCWmuzrvFer1w== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-typescript" "^7.18.6" - "@babel/plugin-transform-typescript@^7.22.5": version "7.22.10" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.22.10.tgz#aadd98fab871f0bb5717bcc24c31aaaa455af923" @@ -2741,13 +1793,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-unicode-escapes@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.18.6.tgz#0d01fb7fb2243ae1c033f65f6e3b4be78db75f27" - integrity sha512-XNRwQUXYMP7VLuy54cr/KS/WeL3AZeORhrmeZ7iewgu+X2eBqmpaLI/hzqr9ZxCeUoq0ASK4GUzSM0BDhZkLFw== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-transform-unicode-regex@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.18.6.tgz#194317225d8c201bbae103364ffe9e2cea36cdca" @@ -2756,7 +1801,7 @@ "@babel/helper-create-regexp-features-plugin" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" -"@babel/preset-env@7.18.10": +"@babel/preset-env@7.18.10", "@babel/preset-env@^7.12.11": version "7.18.10" resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.18.10.tgz#83b8dfe70d7eea1aae5a10635ab0a5fe60dfc0f4" integrity sha512-wVxs1yjFdW3Z/XkNfXKoblxoHgbtUF7/l3PvvP4m02Qz9TZ6uZGxRVYjSQeR87oQmHco9zWitW5J82DJ7sCjvA== @@ -2837,87 +1882,6 @@ core-js-compat "^3.22.1" semver "^6.3.0" -"@babel/preset-env@^7.12.11": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.18.6.tgz#953422e98a5f66bc56cd0b9074eaea127ec86ace" - integrity sha512-WrthhuIIYKrEFAwttYzgRNQ5hULGmwTj+D6l7Zdfsv5M7IWV/OZbUfbeL++Qrzx1nVJwWROIFhCHRYQV4xbPNw== - dependencies: - "@babel/compat-data" "^7.18.6" - "@babel/helper-compilation-targets" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/helper-validator-option" "^7.18.6" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.18.6" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.18.6" - "@babel/plugin-proposal-async-generator-functions" "^7.18.6" - "@babel/plugin-proposal-class-properties" "^7.18.6" - "@babel/plugin-proposal-class-static-block" "^7.18.6" - "@babel/plugin-proposal-dynamic-import" "^7.18.6" - "@babel/plugin-proposal-export-namespace-from" "^7.18.6" - "@babel/plugin-proposal-json-strings" "^7.18.6" - "@babel/plugin-proposal-logical-assignment-operators" "^7.18.6" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.18.6" - "@babel/plugin-proposal-numeric-separator" "^7.18.6" - "@babel/plugin-proposal-object-rest-spread" "^7.18.6" - "@babel/plugin-proposal-optional-catch-binding" "^7.18.6" - "@babel/plugin-proposal-optional-chaining" "^7.18.6" - "@babel/plugin-proposal-private-methods" "^7.18.6" - "@babel/plugin-proposal-private-property-in-object" "^7.18.6" - "@babel/plugin-proposal-unicode-property-regex" "^7.18.6" - "@babel/plugin-syntax-async-generators" "^7.8.4" - "@babel/plugin-syntax-class-properties" "^7.12.13" - "@babel/plugin-syntax-class-static-block" "^7.14.5" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-syntax-import-assertions" "^7.18.6" - "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" - "@babel/plugin-syntax-top-level-await" "^7.14.5" - "@babel/plugin-transform-arrow-functions" "^7.18.6" - "@babel/plugin-transform-async-to-generator" "^7.18.6" - "@babel/plugin-transform-block-scoped-functions" "^7.18.6" - "@babel/plugin-transform-block-scoping" "^7.18.6" - "@babel/plugin-transform-classes" "^7.18.6" - "@babel/plugin-transform-computed-properties" "^7.18.6" - "@babel/plugin-transform-destructuring" "^7.18.6" - "@babel/plugin-transform-dotall-regex" "^7.18.6" - "@babel/plugin-transform-duplicate-keys" "^7.18.6" - "@babel/plugin-transform-exponentiation-operator" "^7.18.6" - "@babel/plugin-transform-for-of" "^7.18.6" - "@babel/plugin-transform-function-name" "^7.18.6" - "@babel/plugin-transform-literals" "^7.18.6" - "@babel/plugin-transform-member-expression-literals" "^7.18.6" - "@babel/plugin-transform-modules-amd" "^7.18.6" - "@babel/plugin-transform-modules-commonjs" "^7.18.6" - "@babel/plugin-transform-modules-systemjs" "^7.18.6" - "@babel/plugin-transform-modules-umd" "^7.18.6" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.18.6" - "@babel/plugin-transform-new-target" "^7.18.6" - "@babel/plugin-transform-object-super" "^7.18.6" - "@babel/plugin-transform-parameters" "^7.18.6" - "@babel/plugin-transform-property-literals" "^7.18.6" - "@babel/plugin-transform-regenerator" "^7.18.6" - "@babel/plugin-transform-reserved-words" "^7.18.6" - "@babel/plugin-transform-shorthand-properties" "^7.18.6" - "@babel/plugin-transform-spread" "^7.18.6" - "@babel/plugin-transform-sticky-regex" "^7.18.6" - "@babel/plugin-transform-template-literals" "^7.18.6" - "@babel/plugin-transform-typeof-symbol" "^7.18.6" - "@babel/plugin-transform-unicode-escapes" "^7.18.6" - "@babel/plugin-transform-unicode-regex" "^7.18.6" - "@babel/preset-modules" "^0.1.5" - "@babel/types" "^7.18.6" - babel-plugin-polyfill-corejs2 "^0.3.1" - babel-plugin-polyfill-corejs3 "^0.5.2" - babel-plugin-polyfill-regenerator "^0.3.1" - core-js-compat "^3.22.1" - semver "^6.3.0" - "@babel/preset-flow@^7.12.1": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/preset-flow/-/preset-flow-7.18.6.tgz#83f7602ba566e72a9918beefafef8ef16d2810cb" @@ -2950,16 +1914,7 @@ "@babel/plugin-transform-react-jsx-development" "^7.18.6" "@babel/plugin-transform-react-pure-annotations" "^7.18.6" -"@babel/preset-typescript@^7.12.7": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.18.6.tgz#ce64be3e63eddc44240c6358daefac17b3186399" - integrity sha512-s9ik86kXBAnD760aybBucdpnLsAt0jK1xqJn2juOn9lkOvSHV60os5hxoVJsPzMQxvnUJFAlkont2DvvaYEBtQ== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/helper-validator-option" "^7.18.6" - "@babel/plugin-transform-typescript" "^7.18.6" - -"@babel/preset-typescript@^7.18.6": +"@babel/preset-typescript@^7.12.7", "@babel/preset-typescript@^7.18.6": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.22.5.tgz#16367d8b01d640e9a507577ed4ee54e0101e51c8" integrity sha512-YbPaal9LxztSGhmndR46FmAbkJ/1fAsw293tSU+I5E5h+cnJ3d4GTwyUgGYmOXJYdGA+uNePle4qbaRzj2NISQ== @@ -2989,67 +1944,14 @@ core-js-pure "^3.20.2" regenerator-runtime "^0.13.4" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.10.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.17", "@babel/runtime@^7.14.5", "@babel/runtime@^7.17.8", "@babel/runtime@^7.18.3", "@babel/runtime@^7.5.0", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.6.tgz#6a1ef59f838debd670421f8c7f2cbb8da9751580" - integrity sha512-t9wi7/AW6XtKahAe20Yw0/mMljKq0B1r2fPdvaAdV/KPDZewFXdaaa6K7lxmZBZ8FBNpCiAT6iHPmd6QO9bKfQ== - dependencies: - regenerator-runtime "^0.13.4" - -"@babel/runtime@^7.1.2": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.13.17", "@babel/runtime@^7.14.5", "@babel/runtime@^7.17.2", "@babel/runtime@^7.17.8", "@babel/runtime@^7.18.3", "@babel/runtime@^7.18.9", "@babel/runtime@^7.21.0", "@babel/runtime@^7.21.5", "@babel/runtime@^7.22.6", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.6.tgz#c05e610dc228855dc92ef1b53d07389ed8ab521d" integrity sha512-zHd0eUrf5GZoOWVCXp6koAKQTfZV07eit6bGPmJgnZdnSAvvZee6zniW2XMF7Cmc4ISOOnPy3QaSiIJGJkVEDQ== dependencies: regenerator-runtime "^0.14.0" -"@babel/runtime@^7.11.2": - version "7.22.10" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.10.tgz#ae3e9631fd947cb7e3610d3e9d8fef5f76696682" - integrity sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ== - dependencies: - regenerator-runtime "^0.14.0" - -"@babel/runtime@^7.13.10": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.5.tgz#8564dd588182ce0047d55d7a75e93921107b57ec" - integrity sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA== - dependencies: - regenerator-runtime "^0.13.11" - -"@babel/runtime@^7.17.2", "@babel/runtime@^7.21.0", "@babel/runtime@^7.21.5", "@babel/runtime@^7.22.6": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.15.tgz#38f46494ccf6cf020bd4eed7124b425e83e523b8" - integrity sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA== - dependencies: - regenerator-runtime "^0.14.0" - -"@babel/runtime@^7.18.9", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.7": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.9.tgz#b4fcfce55db3d2e5e080d2490f608a3b9f407f4a" - integrity sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw== - dependencies: - regenerator-runtime "^0.13.4" - -"@babel/template@^7.12.7", "@babel/template@^7.18.6", "@babel/template@^7.3.3": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.18.6.tgz#1283f4993e00b929d6e2d3c72fdc9168a2977a31" - integrity sha512-JoDWzPe+wgBsTTgdnIma3iHNFC7YVJoPssVBDjiHfNlyt4YcunDtcDOUmfVDfCK5MfdsaIoX9PkijPhjH3nYUw== - dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/parser" "^7.18.6" - "@babel/types" "^7.18.6" - -"@babel/template@^7.18.10": - version "7.18.10" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.18.10.tgz#6f9134835970d1dbf0835c0d100c9f38de0c5e71" - integrity sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA== - dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/parser" "^7.18.10" - "@babel/types" "^7.18.10" - -"@babel/template@^7.20.7", "@babel/template@^7.22.15": +"@babel/template@^7.12.7", "@babel/template@^7.18.10", "@babel/template@^7.20.7", "@babel/template@^7.22.15", "@babel/template@^7.22.5", "@babel/template@^7.3.3": version "7.22.15" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== @@ -3058,15 +1960,6 @@ "@babel/parser" "^7.22.15" "@babel/types" "^7.22.15" -"@babel/template@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.5.tgz#0c8c4d944509875849bd0344ff0050756eefc6ec" - integrity sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw== - dependencies: - "@babel/code-frame" "^7.22.5" - "@babel/parser" "^7.22.5" - "@babel/types" "^7.22.5" - "@babel/traverse@7.18.11": version "7.18.11" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.18.11.tgz#3d51f2afbd83ecf9912bcbb5c4d94e3d2ddaa16f" @@ -3083,7 +1976,7 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/traverse@7.23.6": +"@babel/traverse@7.23.6", "@babel/traverse@^7.1.6", "@babel/traverse@^7.12.11", "@babel/traverse@^7.12.9", "@babel/traverse@^7.13.0", "@babel/traverse@^7.14.0", "@babel/traverse@^7.16.8", "@babel/traverse@^7.18.10", "@babel/traverse@^7.23.3", "@babel/traverse@^7.23.4", "@babel/traverse@^7.7.2": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.6.tgz#b53526a2367a0dd6edc423637f3d2d0f2521abc5" integrity sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ== @@ -3099,70 +1992,6 @@ debug "^4.3.1" globals "^11.1.0" -"@babel/traverse@^7.1.6", "@babel/traverse@^7.12.11", "@babel/traverse@^7.12.9", "@babel/traverse@^7.13.0", "@babel/traverse@^7.18.6", "@babel/traverse@^7.7.2": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.18.6.tgz#a228562d2f46e89258efa4ddd0416942e2fd671d" - integrity sha512-zS/OKyqmD7lslOtFqbscH6gMLFYOfG1YPqCKfAW5KrTeolKqvB8UelR49Fpr6y93kYkW2Ik00mT1LOGiAGvizw== - dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.18.6" - "@babel/helper-environment-visitor" "^7.18.6" - "@babel/helper-function-name" "^7.18.6" - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.18.6" - "@babel/types" "^7.18.6" - debug "^4.1.0" - globals "^11.1.0" - -"@babel/traverse@^7.14.0", "@babel/traverse@^7.16.8", "@babel/traverse@^7.23.3", "@babel/traverse@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.4.tgz#c2790f7edf106d059a0098770fe70801417f3f85" - integrity sha512-IYM8wSUwunWTB6tFC2dkKZhxbIjHoWemdK+3f8/wq8aKhbUscxD5MX72ubd90fxvFknaLPeGw5ycU84V1obHJg== - dependencies: - "@babel/code-frame" "^7.23.4" - "@babel/generator" "^7.23.4" - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-function-name" "^7.23.0" - "@babel/helper-hoist-variables" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/parser" "^7.23.4" - "@babel/types" "^7.23.4" - debug "^4.1.0" - globals "^11.1.0" - -"@babel/traverse@^7.18.10", "@babel/traverse@^7.22.10": - version "7.22.10" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.10.tgz#20252acb240e746d27c2e82b4484f199cf8141aa" - integrity sha512-Q/urqV4pRByiNNpb/f5OSv28ZlGJiFiiTh+GAHktbIrkPhPbl90+uW6SmpoLyZqutrg9AEaEf3Q/ZBRHBXgxig== - dependencies: - "@babel/code-frame" "^7.22.10" - "@babel/generator" "^7.22.10" - "@babel/helper-environment-visitor" "^7.22.5" - "@babel/helper-function-name" "^7.22.5" - "@babel/helper-hoist-variables" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/parser" "^7.22.10" - "@babel/types" "^7.22.10" - debug "^4.1.0" - globals "^11.1.0" - -"@babel/traverse@^7.20.1", "@babel/traverse@^7.20.5": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.5.tgz#78eb244bea8270fdda1ef9af22a5d5e5b7e57133" - integrity sha512-WM5ZNN3JITQIq9tFZaw1ojLU3WgWdtkxnhM1AegMS+PvHjkM5IXjmYEGY7yukz5XS4sJyEf2VzWjI8uAavhxBQ== - dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.20.5" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.19.0" - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.20.5" - "@babel/types" "^7.20.5" - debug "^4.1.0" - globals "^11.1.0" - "@babel/types@7.18.10": version "7.18.10" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.18.10.tgz#4908e81b6b339ca7c6b7a555a5fc29446f26dde6" @@ -3172,7 +2001,7 @@ "@babel/helper-validator-identifier" "^7.18.6" to-fast-properties "^2.0.0" -"@babel/types@7.23.6", "@babel/types@^7.23.6": +"@babel/types@7.23.6", "@babel/types@^7.0.0", "@babel/types@^7.12.11", "@babel/types@^7.12.7", "@babel/types@^7.16.8", "@babel/types@^7.18.10", "@babel/types@^7.18.13", "@babel/types@^7.18.6", "@babel/types@^7.2.0", "@babel/types@^7.22.10", "@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.3", "@babel/types@^7.23.4", "@babel/types@^7.23.6", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.6.tgz#be33fdb151e1f5a56877d704492c240fc71c7ccd" integrity sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg== @@ -3181,50 +2010,6 @@ "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" -"@babel/types@^7.0.0", "@babel/types@^7.12.11", "@babel/types@^7.12.7", "@babel/types@^7.18.6", "@babel/types@^7.18.7", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": - version "7.18.7" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.18.7.tgz#a4a2c910c15040ea52cdd1ddb1614a65c8041726" - integrity sha512-QG3yxTcTIBoAcQmkCs+wAPYZhu7Dk9rXKacINfNbdJDNERTbLQbHGyVG8q/YGMPeCJRIhSY0+fTc5+xuh6WPSQ== - dependencies: - "@babel/helper-validator-identifier" "^7.18.6" - to-fast-properties "^2.0.0" - -"@babel/types@^7.16.8", "@babel/types@^7.18.13", "@babel/types@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.4.tgz#7206a1810fc512a7f7f7d4dace4cb4c1c9dbfb8e" - integrity sha512-7uIFwVYpoplT5jp/kVv6EF93VaJ8H+Yn5IczYiaAi98ajzjfoZfslet/e0sLh+wVBjb2qqIut1b0S26VSafsSQ== - dependencies: - "@babel/helper-string-parser" "^7.23.4" - "@babel/helper-validator-identifier" "^7.22.20" - to-fast-properties "^2.0.0" - -"@babel/types@^7.18.10", "@babel/types@^7.19.0", "@babel/types@^7.20.2", "@babel/types@^7.20.5": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.5.tgz#e206ae370b5393d94dfd1d04cd687cace53efa84" - integrity sha512-c9fst/h2/dcF7H+MJKZ2T0KjEQ8hY/BNnDk/H3XY8C4Aw/eWQXWn/lWntHF9ooUBnGmEvbfGrTgLWc+um0YDUg== - dependencies: - "@babel/helper-string-parser" "^7.19.4" - "@babel/helper-validator-identifier" "^7.19.1" - to-fast-properties "^2.0.0" - -"@babel/types@^7.22.10", "@babel/types@^7.22.5": - version "7.22.10" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.10.tgz#4a9e76446048f2c66982d1a989dd12b8a2d2dc03" - integrity sha512-obaoigiLrlDZ7TUQln/8m4mSqIW2QFeOrCQc9r+xsaHGNoplVNYlRVpsfE8Vj35GEm2ZH4ZhrNYogs/3fj85kg== - dependencies: - "@babel/helper-string-parser" "^7.22.5" - "@babel/helper-validator-identifier" "^7.22.5" - to-fast-properties "^2.0.0" - -"@babel/types@^7.22.15", "@babel/types@^7.23.0", "@babel/types@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.3.tgz#d5ea892c07f2ec371ac704420f4dcdb07b5f9598" - integrity sha512-OZnvoH2l8PK5eUvEcUyCt/sXgr/h+UWpVuBbOljwcrAgUl6lpchoQ++PHGyQy1AtYnVA6CEq3y5xeEI10brpXw== - dependencies: - "@babel/helper-string-parser" "^7.22.5" - "@babel/helper-validator-identifier" "^7.22.20" - to-fast-properties "^2.0.0" - "@base2/pretty-print-object@1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@base2/pretty-print-object/-/pretty-print-object-1.0.1.tgz#371ba8be66d556812dc7fb169ebc3c08378f69d4" @@ -3235,14 +2020,6 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@chain-registry/assets@^1.26.1": - version "1.26.1" - resolved "https://registry.yarnpkg.com/@chain-registry/assets/-/assets-1.26.1.tgz#e22a4da9a00a6bebfca622f47f058b921de27aaf" - integrity sha512-PdM9fWEnGoZk88GT1VeCWdSBPdt+vJxLEgRhYwYfOh+GSS1YGWciqp83BbHCHML6KybN822PV4WF9RDUCH2DfQ== - dependencies: - "@babel/runtime" "^7.21.0" - "@chain-registry/types" "^0.17.1" - "@chain-registry/cosmostation@1.26.0": version "1.26.0" resolved "https://registry.yarnpkg.com/@chain-registry/cosmostation/-/cosmostation-1.26.0.tgz#0d3967b8d320168a5c9c7b56b3352dcf3f2945b0" @@ -3274,27 +2051,27 @@ "@keplr-wallet/crypto" "0.12.28" semver "^7.5.0" -"@chain-registry/types@0.17.0", "@chain-registry/types@^0.17.0": +"@chain-registry/types@0.17.0": version "0.17.0" resolved "https://registry.yarnpkg.com/@chain-registry/types/-/types-0.17.0.tgz#bbe9176a6d30a491259fab1fcdcee2b7edf6141f" integrity sha512-lavACU4oDxioUy8lZOFZN0Vrr2qR+Dg2yEh/mkrPfOldcioavREXJou0elDyyXwq4pGLC5YQ+IISCtQ4Du0bdw== dependencies: "@babel/runtime" "^7.21.0" -"@chain-registry/types@^0.16.0": - version "0.16.0" - resolved "https://registry.yarnpkg.com/@chain-registry/types/-/types-0.16.0.tgz#f76409186899a976d33693d7f458c33d71a66730" - integrity sha512-4j6vq2Vqn/nF+UBjvRPUVs6eM3+5rJ+dPmEWpd/OoNH3wTy1k6aoilcSTZRR//vGcI5EOVGsxhhJxUzo2qqweA== - dependencies: - "@babel/runtime" "^7.21.0" - -"@chain-registry/types@^0.17.1": +"@chain-registry/types@^0.17.0", "@chain-registry/types@^0.17.1": version "0.17.1" resolved "https://registry.yarnpkg.com/@chain-registry/types/-/types-0.17.1.tgz#0ac7bda6178d3917834578627f232a247fe5def8" integrity sha512-O0CgrtJgIlqXvZm1CqDZe/7jZz068O/uuCIoyDXCegFHK03rdHacKcDGwEIUuI0MNUf8YV3jdE4xHQMSAX+79w== dependencies: "@babel/runtime" "^7.21.0" +"@chain-registry/types@^0.18.1": + version "0.18.1" + resolved "https://registry.yarnpkg.com/@chain-registry/types/-/types-0.18.1.tgz#bd926ddf204f2ae986a79b42f0cfe85764e2977a" + integrity sha512-H/UnOyd7WdcWHa2FGKxy4MclDDFrbE2rFwaUh9oubNJOey7UBI4dNF10oZIWM/1by15LUgDz45fVbh6uA6W5Tg== + dependencies: + "@babel/runtime" "^7.21.0" + "@chain-registry/utils@^1.15.0", "@chain-registry/utils@^1.17.0": version "1.17.0" resolved "https://registry.yarnpkg.com/@chain-registry/utils/-/utils-1.17.0.tgz#f3072c2ca59bc81516f8fac0994ac05d9236a60a" @@ -3353,27 +2130,7 @@ triple-beam "1.3.0" winston "3.3.3" -"@cosmjs/amino@^0.30.1": - version "0.30.1" - resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.30.1.tgz#7c18c14627361ba6c88e3495700ceea1f76baace" - integrity sha512-yNHnzmvAlkETDYIpeCTdVqgvrdt1qgkOXwuRVi8s27UKI5hfqyE9fJ/fuunXE6ZZPnKkjIecDznmuUOMrMvw4w== - dependencies: - "@cosmjs/crypto" "^0.30.1" - "@cosmjs/encoding" "^0.30.1" - "@cosmjs/math" "^0.30.1" - "@cosmjs/utils" "^0.30.1" - -"@cosmjs/amino@^0.31.0": - version "0.31.1" - resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.31.1.tgz#e6b4adc3ebe19ddfd953c67ee04b1eae488238af" - integrity sha512-kkB9IAkNEUFtjp/uwHv95TgM8VGJ4VWfZwrTyLNqBDD1EpSX2dsNrmUe7k8OMPzKlZUFcKmD4iA0qGvIwzjbGA== - dependencies: - "@cosmjs/crypto" "^0.31.1" - "@cosmjs/encoding" "^0.31.1" - "@cosmjs/math" "^0.31.1" - "@cosmjs/utils" "^0.31.1" - -"@cosmjs/amino@^0.31.0-alpha.1", "@cosmjs/amino@^0.31.1", "@cosmjs/amino@^0.31.3": +"@cosmjs/amino@^0.31.0", "@cosmjs/amino@^0.31.3": version "0.31.3" resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.31.3.tgz#0f4aa6bd68331c71bd51b187fa64f00eb075db0a" integrity sha512-36emtUq895sPRX8PTSOnG+lhJDCVyIcE0Tr5ct59sUbgQiI14y43vj/4WAlJ/utSOxy+Zhj9wxcs4AZfu0BHsw== @@ -3393,23 +2150,6 @@ "@cosmjs/math" "^0.32.2" "@cosmjs/utils" "^0.32.2" -"@cosmjs/cosmwasm-stargate@^0.31.1": - version "0.31.3" - resolved "https://registry.yarnpkg.com/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.31.3.tgz#13066822f111832d57c2c5acc9e697ed389713f8" - integrity sha512-Uv9TmCn3650gdFeZm7SEfUZF3uX3lfJfFhXOk6I2ZLr/FrKximnlb+vwAfZaZnWYvlA7qrKtHIjeRNHvT23zcw== - dependencies: - "@cosmjs/amino" "^0.31.3" - "@cosmjs/crypto" "^0.31.3" - "@cosmjs/encoding" "^0.31.3" - "@cosmjs/math" "^0.31.3" - "@cosmjs/proto-signing" "^0.31.3" - "@cosmjs/stargate" "^0.31.3" - "@cosmjs/tendermint-rpc" "^0.31.3" - "@cosmjs/utils" "^0.31.3" - cosmjs-types "^0.8.0" - long "^4.0.0" - pako "^2.0.2" - "@cosmjs/cosmwasm-stargate@^0.32.1": version "0.32.2" resolved "https://registry.yarnpkg.com/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.32.2.tgz#32aca8b4c2043cd1bc91cf4d0225b268c166e421" @@ -3426,32 +2166,6 @@ cosmjs-types "^0.9.0" pako "^2.0.2" -"@cosmjs/crypto@^0.30.1": - version "0.30.1" - resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.30.1.tgz#21e94d5ca8f8ded16eee1389d2639cb5c43c3eb5" - integrity sha512-rAljUlake3MSXs9xAm87mu34GfBLN0h/1uPPV6jEwClWjNkAMotzjC0ab9MARy5FFAvYHL3lWb57bhkbt2GtzQ== - dependencies: - "@cosmjs/encoding" "^0.30.1" - "@cosmjs/math" "^0.30.1" - "@cosmjs/utils" "^0.30.1" - "@noble/hashes" "^1" - bn.js "^5.2.0" - elliptic "^6.5.4" - libsodium-wrappers "^0.7.6" - -"@cosmjs/crypto@^0.31.0", "@cosmjs/crypto@^0.31.1": - version "0.31.1" - resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.31.1.tgz#ce4917df0f7b38f0909a32020907ccff04acefe6" - integrity sha512-4R/SqdzdVzd4E5dpyEh1IKm5GbTqwDogutyIyyb1bcOXiX/x3CrvPI9Tb4WSIMDLvlb5TVzu2YnUV51Q1+6mMA== - dependencies: - "@cosmjs/encoding" "^0.31.1" - "@cosmjs/math" "^0.31.1" - "@cosmjs/utils" "^0.31.1" - "@noble/hashes" "^1" - bn.js "^5.2.0" - elliptic "^6.5.4" - libsodium-wrappers-sumo "^0.7.11" - "@cosmjs/crypto@^0.31.3": version "0.31.3" resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.31.3.tgz#c752cb6d682fdc735dcb45a2519f89c56ba16c26" @@ -3478,34 +2192,7 @@ elliptic "^6.5.4" libsodium-wrappers-sumo "^0.7.11" -"@cosmjs/encoding@^0.20.0": - version "0.20.1" - resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.20.1.tgz#1d1162b3eca51b7244cd45102e313612cea77281" - integrity sha512-aBp153iq2LD4GwDGwodDWZk/eyAUZ8J8bbiqZ1uK8rrylzm9Rdw84aa6JxykezJe+uBPtoI4lx9eH7VQXCGDXw== - dependencies: - base64-js "^1.3.0" - bech32 "^1.1.4" - readonly-date "^1.0.0" - -"@cosmjs/encoding@^0.30.1": - version "0.30.1" - resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.30.1.tgz#b5c4e0ef7ceb1f2753688eb96400ed70f35c6058" - integrity sha512-rXmrTbgqwihORwJ3xYhIgQFfMSrwLu1s43RIK9I8EBudPx3KmnmyAKzMOVsRDo9edLFNuZ9GIvysUCwQfq3WlQ== - dependencies: - base64-js "^1.3.0" - bech32 "^1.1.4" - readonly-date "^1.0.0" - -"@cosmjs/encoding@^0.31.0", "@cosmjs/encoding@^0.31.1": - version "0.31.1" - resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.31.1.tgz#0041b2650c443d883e22f27c7d3cd7b844c6d0ec" - integrity sha512-IuxP6ewwX6vg9sUJ8ocJD92pkerI4lyG8J5ynAM3NaX3q+n+uMoPRSQXNeL9bnlrv01FF1kIm8if/f5F7ZPtkA== - dependencies: - base64-js "^1.3.0" - bech32 "^1.1.4" - readonly-date "^1.0.0" - -"@cosmjs/encoding@^0.31.0-alpha.1", "@cosmjs/encoding@^0.31.3": +"@cosmjs/encoding@^0.31.3": version "0.31.3" resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.31.3.tgz#2519d9c9ae48368424971f253775c4580b54c5aa" integrity sha512-6IRtG0fiVYwyP7n+8e54uTx2pLYijO48V3t9TLiROERm5aUAIzIlz6Wp0NYaI5he9nh1lcEGJ1lkquVKFw3sUg== @@ -3530,22 +2217,6 @@ dependencies: axios "^1.6.0" -"@cosmjs/json-rpc@^0.30.1": - version "0.30.1" - resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.30.1.tgz#16f21305fc167598c8a23a45549b85106b2372bc" - integrity sha512-pitfC/2YN9t+kXZCbNuyrZ6M8abnCC2n62m+JtU9vQUfaEtVsgy+1Fk4TRQ175+pIWSdBMFi2wT8FWVEE4RhxQ== - dependencies: - "@cosmjs/stream" "^0.30.1" - xstream "^11.14.0" - -"@cosmjs/json-rpc@^0.31.3": - version "0.31.3" - resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.31.3.tgz#11e5cf0f6d9ab426dff470bb8d68d5d31cd6ab13" - integrity sha512-7LVYerXjnm69qqYR3uA6LGCrBW2EO5/F7lfJxAmY+iII2C7xO3a0vAjMSt5zBBh29PXrJVS6c2qRP22W1Le2Wg== - dependencies: - "@cosmjs/stream" "^0.31.3" - xstream "^11.14.0" - "@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" @@ -3554,28 +2225,7 @@ "@cosmjs/stream" "^0.32.2" xstream "^11.14.0" -"@cosmjs/math@^0.20.0": - version "0.20.1" - resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.20.1.tgz#c3c2be821b8b5dbbb9b2c0401bd9f1472e821f2a" - integrity sha512-xt7BmpSw2OVGM2+JhlJvKv9OJs9+3DqgVL6+byUDC355CSISrZhFjJg9GFko1EFssDXz5YgvBZR5FkifC0xazw== - dependencies: - bn.js "^4.11.8" - -"@cosmjs/math@^0.30.1": - version "0.30.1" - resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.30.1.tgz#8b816ef4de5d3afa66cb9fdfb5df2357a7845b8a" - integrity sha512-yaoeI23pin9ZiPHIisa6qqLngfnBR/25tSaWpkTm8Cy10MX70UF5oN4+/t1heLaM6SSmRrhk3psRkV4+7mH51Q== - dependencies: - bn.js "^5.2.0" - -"@cosmjs/math@^0.31.0", "@cosmjs/math@^0.31.1": - version "0.31.1" - resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.31.1.tgz#74c02cf237c2996b77661b636b014168b18d95e6" - integrity sha512-kiuHV6m6DSB8/4UV1qpFhlc4ul8SgLXTGRlYkYiIIP4l0YNeJ+OpPYaOlEgx4Unk2mW3/O2FWYj7Jc93+BWXng== - dependencies: - bn.js "^5.2.0" - -"@cosmjs/math@^0.31.0-alpha.1", "@cosmjs/math@^0.31.3": +"@cosmjs/math@^0.31.3": version "0.31.3" resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.31.3.tgz#767f7263d12ba1b9ed2f01f68d857597839fd957" integrity sha512-kZ2C6glA5HDb9hLz1WrftAjqdTBb3fWQsRR+Us2HsjAYdeE6M3VdXMsYCP5M3yiihal1WDwAY2U7HmfJw7Uh4A== @@ -3589,33 +2239,7 @@ dependencies: bn.js "^5.2.0" -"@cosmjs/proto-signing@^0.30.1": - version "0.30.1" - resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.30.1.tgz#f0dda372488df9cd2677150b89b3e9c72b3cb713" - integrity sha512-tXh8pPYXV4aiJVhTKHGyeZekjj+K9s2KKojMB93Gcob2DxUjfKapFYBMJSgfKPuWUPEmyr8Q9km2hplI38ILgQ== - dependencies: - "@cosmjs/amino" "^0.30.1" - "@cosmjs/crypto" "^0.30.1" - "@cosmjs/encoding" "^0.30.1" - "@cosmjs/math" "^0.30.1" - "@cosmjs/utils" "^0.30.1" - cosmjs-types "^0.7.1" - long "^4.0.0" - "@cosmjs/proto-signing@^0.31.0": - version "0.31.0" - resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.31.0.tgz#7056963457cd967f53f56c2ab4491638e5ade2c0" - integrity sha512-JNlyOJRkn8EKB9mCthkjr6lVX6eyVQ09PFdmB4/DR874E62dFTvQ+YvyKMAgN7K7Dcjj26dVlAD3f6Xs7YOGDg== - dependencies: - "@cosmjs/amino" "^0.31.0" - "@cosmjs/crypto" "^0.31.0" - "@cosmjs/encoding" "^0.31.0" - "@cosmjs/math" "^0.31.0" - "@cosmjs/utils" "^0.31.0" - cosmjs-types "^0.8.0" - long "^4.0.0" - -"@cosmjs/proto-signing@^0.31.0-alpha.1", "@cosmjs/proto-signing@^0.31.1", "@cosmjs/proto-signing@^0.31.3": version "0.31.3" resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.31.3.tgz#20440b7b96fb2cd924256a10e656fd8d4481cdcd" integrity sha512-24+10/cGl6lLS4VCrGTCJeDRPQTn1K5JfknzXzDIHOx8THR31JxA7/HV5eWGHqWgAbudA7ccdSvEK08lEHHtLA== @@ -3640,26 +2264,6 @@ "@cosmjs/utils" "^0.32.2" cosmjs-types "^0.9.0" -"@cosmjs/socket@^0.30.1": - version "0.30.1" - resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.30.1.tgz#00b22f4b5e2ab01f4d82ccdb7b2e59536bfe5ce0" - integrity sha512-r6MpDL+9N+qOS/D5VaxnPaMJ3flwQ36G+vPvYJsXArj93BjgyFB7BwWwXCQDzZ+23cfChPUfhbINOenr8N2Kow== - dependencies: - "@cosmjs/stream" "^0.30.1" - isomorphic-ws "^4.0.1" - ws "^7" - xstream "^11.14.0" - -"@cosmjs/socket@^0.31.3": - version "0.31.3" - resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.31.3.tgz#52086380f4de2fc3514b90b0484b4b1c4c50e39e" - integrity sha512-aqrDGGi7os/hsz5p++avI4L0ZushJ+ItnzbqA7C6hamFSCJwgOkXaOUs+K9hXZdX4rhY7rXO4PH9IH8q09JkTw== - dependencies: - "@cosmjs/stream" "^0.31.3" - isomorphic-ws "^4.0.1" - ws "^7" - xstream "^11.14.0" - "@cosmjs/socket@^0.32.2": version "0.32.2" resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.32.2.tgz#a66be3863d03bf2d8df0433af476df010ff10e8c" @@ -3670,60 +2274,6 @@ ws "^7" xstream "^11.14.0" -"@cosmjs/stargate@0.31.0-alpha.1": - version "0.31.0-alpha.1" - resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.31.0-alpha.1.tgz#85b9d41cd5e73c3b8db73115aa1c9cd6eb5914fd" - integrity sha512-kCTUT3niB2hvcHjhlxpM8cNw1KOVmgZROdJUQaO8Ts4j22OyRZRFdwRPrOIuAKpqhVW2I1vI2HQL9Bg7pk9Glw== - dependencies: - "@confio/ics23" "^0.6.8" - "@cosmjs/amino" "^0.31.0-alpha.1" - "@cosmjs/encoding" "^0.31.0-alpha.1" - "@cosmjs/math" "^0.31.0-alpha.1" - "@cosmjs/proto-signing" "^0.31.0-alpha.1" - "@cosmjs/stream" "^0.31.0-alpha.1" - "@cosmjs/tendermint-rpc" "^0.31.0-alpha.1" - "@cosmjs/utils" "^0.31.0-alpha.1" - cosmjs-types "^0.8.0" - long "^4.0.0" - protobufjs "~6.11.3" - xstream "^11.14.0" - -"@cosmjs/stargate@^0.30.1": - version "0.30.1" - resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.30.1.tgz#e1b22e1226cffc6e93914a410755f1f61057ba04" - integrity sha512-RdbYKZCGOH8gWebO7r6WvNnQMxHrNXInY/gPHPzMjbQF6UatA6fNM2G2tdgS5j5u7FTqlCI10stNXrknaNdzog== - dependencies: - "@confio/ics23" "^0.6.8" - "@cosmjs/amino" "^0.30.1" - "@cosmjs/encoding" "^0.30.1" - "@cosmjs/math" "^0.30.1" - "@cosmjs/proto-signing" "^0.30.1" - "@cosmjs/stream" "^0.30.1" - "@cosmjs/tendermint-rpc" "^0.30.1" - "@cosmjs/utils" "^0.30.1" - cosmjs-types "^0.7.1" - long "^4.0.0" - protobufjs "~6.11.3" - xstream "^11.14.0" - -"@cosmjs/stargate@^0.31.1", "@cosmjs/stargate@^0.31.3": - version "0.31.3" - resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.31.3.tgz#a2b38e398097a00f897dbd8f02d4d347d8fed818" - integrity sha512-53NxnzmB9FfXpG4KjOUAYAvWLYKdEmZKsutcat/u2BrDXNZ7BN8jim/ENcpwXfs9/Og0K24lEIdvA4gsq3JDQw== - dependencies: - "@confio/ics23" "^0.6.8" - "@cosmjs/amino" "^0.31.3" - "@cosmjs/encoding" "^0.31.3" - "@cosmjs/math" "^0.31.3" - "@cosmjs/proto-signing" "^0.31.3" - "@cosmjs/stream" "^0.31.3" - "@cosmjs/tendermint-rpc" "^0.31.3" - "@cosmjs/utils" "^0.31.3" - cosmjs-types "^0.8.0" - long "^4.0.0" - protobufjs "~6.11.3" - xstream "^11.14.0" - "@cosmjs/stargate@^0.32.1", "@cosmjs/stargate@^0.32.2": version "0.32.2" resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.32.2.tgz#73718c5c6a3ae138682ee9987333d911eca22a13" @@ -3740,20 +2290,6 @@ cosmjs-types "^0.9.0" xstream "^11.14.0" -"@cosmjs/stream@^0.30.1": - version "0.30.1" - resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.30.1.tgz#ba038a2aaf41343696b1e6e759d8e03a9516ec1a" - integrity sha512-Fg0pWz1zXQdoxQZpdHRMGvUH5RqS6tPv+j9Eh7Q953UjMlrwZVo0YFLC8OTf/HKVf10E4i0u6aM8D69Q6cNkgQ== - dependencies: - xstream "^11.14.0" - -"@cosmjs/stream@^0.31.0-alpha.1", "@cosmjs/stream@^0.31.3": - version "0.31.3" - resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.31.3.tgz#53428fd62487ec08fc3886a50a3feeb8b2af2e66" - integrity sha512-8keYyI7X0RjsLyVcZuBeNjSv5FA4IHwbFKx7H60NHFXszN8/MvXL6aZbNIvxtcIHHsW7K9QSQos26eoEWlAd+w== - dependencies: - xstream "^11.14.0" - "@cosmjs/stream@^0.32.1", "@cosmjs/stream@^0.32.2": version "0.32.2" resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.32.2.tgz#b1e8f977d25313d659f1aa89ad21614b5391cd93" @@ -3761,38 +2297,6 @@ dependencies: xstream "^11.14.0" -"@cosmjs/tendermint-rpc@^0.30.1": - version "0.30.1" - resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.30.1.tgz#c16378892ba1ac63f72803fdf7567eab9d4f0aa0" - integrity sha512-Z3nCwhXSbPZJ++v85zHObeUggrEHVfm1u18ZRwXxFE9ZMl5mXTybnwYhczuYOl7KRskgwlB+rID0WYACxj4wdQ== - dependencies: - "@cosmjs/crypto" "^0.30.1" - "@cosmjs/encoding" "^0.30.1" - "@cosmjs/json-rpc" "^0.30.1" - "@cosmjs/math" "^0.30.1" - "@cosmjs/socket" "^0.30.1" - "@cosmjs/stream" "^0.30.1" - "@cosmjs/utils" "^0.30.1" - axios "^0.21.2" - readonly-date "^1.0.0" - xstream "^11.14.0" - -"@cosmjs/tendermint-rpc@^0.31.0-alpha.1", "@cosmjs/tendermint-rpc@^0.31.1", "@cosmjs/tendermint-rpc@^0.31.3": - version "0.31.3" - resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.31.3.tgz#d1a2bc5b3c98743631c9b55888589d352403c9b3" - integrity sha512-s3TiWkPCW4QceTQjpYqn4xttUJH36mTPqplMl+qyocdqk5+X5mergzExU/pHZRWQ4pbby8bnR7kMvG4OC1aZ8g== - dependencies: - "@cosmjs/crypto" "^0.31.3" - "@cosmjs/encoding" "^0.31.3" - "@cosmjs/json-rpc" "^0.31.3" - "@cosmjs/math" "^0.31.3" - "@cosmjs/socket" "^0.31.3" - "@cosmjs/stream" "^0.31.3" - "@cosmjs/utils" "^0.31.3" - axios "^0.21.2" - readonly-date "^1.0.0" - xstream "^11.14.0" - "@cosmjs/tendermint-rpc@^0.32.1", "@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" @@ -3809,22 +2313,7 @@ readonly-date "^1.0.0" xstream "^11.14.0" -"@cosmjs/utils@^0.20.0": - version "0.20.1" - resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.20.1.tgz#4d239b7d93c15523cdf109f225cbf61326fb69cd" - integrity sha512-xl9YnIrAAaBd6nFffwFbyrnKjqjD9zKGP8OBKxzyglxamHfqAS+PcJPEiaEpt+oUt7HAIOyhL3KK75Dh52hGvA== - -"@cosmjs/utils@^0.30.1": - version "0.30.1" - resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.30.1.tgz#6d92582341be3c2ec8d82090253cfa4b7f959edb" - integrity sha512-KvvX58MGMWh7xA+N+deCfunkA/ZNDvFLw4YbOmX3f/XBIkqrVY7qlotfy2aNb1kgp6h4B6Yc8YawJPDTfvWX7g== - -"@cosmjs/utils@^0.31.0", "@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.31.0-alpha.1", "@cosmjs/utils@^0.31.3": +"@cosmjs/utils@^0.31.3": version "0.31.3" resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.31.3.tgz#f97bbfda35ad69e80cd5c7fe0a270cbda16db1ed" integrity sha512-VBhAgzrrYdIe0O5IbKRqwszbQa7ZyQLx9nEQuHQ3HUplQW7P44COG/ye2n6AzCudtqxmwdX7nyX8ta1J07GoqA== @@ -4304,7 +2793,7 @@ enabled "2.0.x" kuler "^2.0.0" -"@discoveryjs/json-ext@^0.5.3": +"@discoveryjs/json-ext@0.5.7", "@discoveryjs/json-ext@^0.5.3": version "0.5.7" resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== @@ -4422,16 +2911,6 @@ resolved "https://registry.yarnpkg.com/@endo/env-options/-/env-options-0.1.4.tgz#e516bc3864f00b154944e444fb8996a9a0c23a45" integrity sha512-Ol8ct0aW8VK1ZaqntnUJfrYT59P6Xn36XPbHzkqQhsYkpudKDn5ILYEwGmSO/Ff+XJjv/pReNI0lhOyyrDa9mg== -"@ensdomains/ens-validation@^0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@ensdomains/ens-validation/-/ens-validation-0.1.0.tgz#9ebfe66016fbf069a6ebca70c043714f6f02fbe6" - integrity sha512-rbDh2K6GfqXvBcJUISaTTYEt3f079WA4ohTE5Lh4/8EaaPAk/9vk3EisMUQV2UVxeFIZQEEyRCIOmRTpqN0W7A== - -"@ensdomains/eth-ens-namehash@^2.0.15": - version "2.0.15" - resolved "https://registry.yarnpkg.com/@ensdomains/eth-ens-namehash/-/eth-ens-namehash-2.0.15.tgz#5e5f2f24ba802aff8bc19edd822c9a11200cdf4a" - integrity sha512-JRDFP6+Hczb1E0/HhIg0PONgBYasfGfDheujmfxaZaAv/NAH4jE6Kf48WbqfRZdxt4IZI3jl3Ri7sZ1nP09lgw== - "@eslint-community/eslint-utils@^4.4.0": version "4.4.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" @@ -4459,14 +2938,6 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@ethereumjs/common@^2.6.3", "@ethereumjs/common@^2.6.4", "@ethereumjs/common@^2.6.5": - version "2.6.5" - resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-2.6.5.tgz#0a75a22a046272579d91919cb12d84f2756e8d30" - integrity sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA== - dependencies: - crc-32 "^1.2.0" - ethereumjs-util "^7.1.5" - "@ethereumjs/common@^3.2.0": version "3.2.0" resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-3.2.0.tgz#b71df25845caf5456449163012074a55f048e0a0" @@ -4480,22 +2951,6 @@ resolved "https://registry.yarnpkg.com/@ethereumjs/rlp/-/rlp-4.0.1.tgz#626fabfd9081baab3d0a3074b0c7ecaf674aaa41" integrity sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw== -"@ethereumjs/tx@3.5.1": - version "3.5.1" - resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.5.1.tgz#8d941b83a602b4a89949c879615f7ea9a90e6671" - integrity sha512-xzDrTiu4sqZXUcaBxJ4n4W5FrppwxLxZB4ZDGVLtxSQR4lVuOnFR6RcUHdg1mpUhAPVrmnzLJpxaeXnPxIyhWA== - dependencies: - "@ethereumjs/common" "^2.6.3" - ethereumjs-util "^7.1.4" - -"@ethereumjs/tx@^3.5.2": - version "3.5.2" - resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.5.2.tgz#197b9b6299582ad84f9527ca961466fce2296c1c" - integrity sha512-gQDNJWKrSDGu2w7w0PzVXVBNMzb7wwdDOmOqczmhNjqFxFuIbhVJDwiGEnxFNC2/b8ifcZzY7MLcluizohRzNw== - dependencies: - "@ethereumjs/common" "^2.6.4" - ethereumjs-util "^7.1.5" - "@ethereumjs/tx@^4.1.2", "@ethereumjs/tx@^4.2.0": version "4.2.0" resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-4.2.0.tgz#5988ae15daf5a3b3c815493bc6b495e76009e853" @@ -4515,7 +2970,7 @@ ethereum-cryptography "^2.0.0" micro-ftch "^0.3.1" -"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.5.0", "@ethersproject/abi@^5.7.0": +"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== @@ -4684,7 +3139,7 @@ resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== -"@ethersproject/networks@5.7.1", "@ethersproject/networks@^5.7.0", "@ethersproject/networks@^5.7.1": +"@ethersproject/networks@5.7.1", "@ethersproject/networks@^5.7.0": version "5.7.1" resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.1.tgz#118e1a981d757d45ccea6bb58d9fd3d9db14ead6" integrity sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ== @@ -4706,7 +3161,7 @@ dependencies: "@ethersproject/logger" "^5.7.0" -"@ethersproject/providers@5.7.2", "@ethersproject/providers@^5.7.2": +"@ethersproject/providers@5.7.2": version "5.7.2" resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.7.2.tgz#f8b1a4f275d7ce58cf0a2eec222269a08beb18cb" integrity sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg== @@ -4740,7 +3195,7 @@ "@ethersproject/bytes" "^5.7.0" "@ethersproject/logger" "^5.7.0" -"@ethersproject/rlp@5.7.0", "@ethersproject/rlp@^5.5.0", "@ethersproject/rlp@^5.7.0": +"@ethersproject/rlp@5.7.0", "@ethersproject/rlp@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== @@ -4814,7 +3269,7 @@ "@ethersproject/constants" "^5.7.0" "@ethersproject/logger" "^5.7.0" -"@ethersproject/wallet@5.7.0", "@ethersproject/wallet@^5.7.0": +"@ethersproject/wallet@5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.7.0.tgz#4e5d0790d96fe21d61d38fb40324e6c7ef350b2d" integrity sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA== @@ -5339,18 +3794,6 @@ resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.2.0.tgz#5f3d96ec6b2354ad6d8a28bf216a1d97b5426861" integrity sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ== -"@hapi/hoek@^9.0.0": - version "9.3.0" - resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.3.0.tgz#8368869dcb735be2e7f5cb7647de78e167a251fb" - integrity sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ== - -"@hapi/topo@^5.0.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-5.1.0.tgz#dc448e332c6c6e37a4dc02fd84ba8d44b9afb012" - integrity sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg== - dependencies: - "@hapi/hoek" "^9.0.0" - "@humanwhocodes/config-array@^0.10.4": version "0.10.4" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.10.4.tgz#01e7366e57d2ad104feea63e72248f22015c520c" @@ -5387,223 +3830,6 @@ dependencies: browser-headers "^0.4.1" -"@injectivelabs/core-proto-ts@^0.0.18": - version "0.0.18" - resolved "https://registry.yarnpkg.com/@injectivelabs/core-proto-ts/-/core-proto-ts-0.0.18.tgz#aa60ffde2b52cbbf80a18ba77833ecad605d8fd6" - integrity sha512-WSZS7SQ+I/m8jdc7fhzkMTUhA7i5nVTeKbN6QGqKmOwQ/F+PqM75vDHD9Y9NbLPx9P+m7hyUzSHz4zmajth5jw== - dependencies: - "@injectivelabs/grpc-web" "^0.0.1" - google-protobuf "^3.14.0" - protobufjs "^7.0.0" - rxjs "^7.4.0" - -"@injectivelabs/dmm-proto-ts@1.0.19": - version "1.0.19" - resolved "https://registry.yarnpkg.com/@injectivelabs/dmm-proto-ts/-/dmm-proto-ts-1.0.19.tgz#fbb3432df9a3a6465a19fe68f3ebbfeb532fbd56" - integrity sha512-2FCzCziy1RhzmnkAVIU+Asby/GXAVQqKt5/o1s52j0LJXfJMpiCrV6soLfnjTebj61T+1WvJBPFoZCCiVYBpcw== - dependencies: - "@injectivelabs/grpc-web" "^0.0.1" - google-protobuf "^3.14.0" - protobufjs "^7.0.0" - rxjs "^7.4.0" - -"@injectivelabs/exceptions@^1.14.4": - version "1.14.4" - resolved "https://registry.yarnpkg.com/@injectivelabs/exceptions/-/exceptions-1.14.4.tgz#cb882530e8618d627cbc8fbb4c21d521bc73d00a" - integrity sha512-mJVzDsw+anL85NzXl0l1Ortk7MEgHdD5EQwFp/XaI1U3cupsHKUfHpAuXjggD+XQVFeWoYOFzk4CJPCBgz6u+w== - dependencies: - "@injectivelabs/grpc-web" "^0.0.1" - "@injectivelabs/ts-types" "^1.14.4" - http-status-codes "^2.2.0" - link-module-alias "^1.2.0" - shx "^0.3.2" - -"@injectivelabs/grpc-web-node-http-transport@^0.0.2": - version "0.0.2" - resolved "https://registry.yarnpkg.com/@injectivelabs/grpc-web-node-http-transport/-/grpc-web-node-http-transport-0.0.2.tgz#87c9bbd4db1f70cf18d6a55b54b2cf17d3cf30c0" - integrity sha512-rpyhXLiGY/UMs6v6YmgWHJHiO9l0AgDyVNv+jcutNVt4tQrmNvnpvz2wCAGOFtq5LuX/E9ChtTVpk3gWGqXcGA== - -"@injectivelabs/grpc-web-react-native-transport@^0.0.2": - version "0.0.2" - resolved "https://registry.yarnpkg.com/@injectivelabs/grpc-web-react-native-transport/-/grpc-web-react-native-transport-0.0.2.tgz#07601b76bf1f165c7a9b97ee42d0d42b9e2b76fa" - integrity sha512-mk+aukQXnYNgPsPnu3KBi+FD0ZHQpazIlaBZ2jNZG7QAVmxTWtv3R66Zoq99Wx2dnE946NsZBYAoa0K5oSjnow== - -"@injectivelabs/grpc-web@^0.0.1": - version "0.0.1" - resolved "https://registry.yarnpkg.com/@injectivelabs/grpc-web/-/grpc-web-0.0.1.tgz#24c028f6db50e589e30505efd2077110c8b492ba" - integrity sha512-Pu5YgaZp+OvR5UWfqbrPdHer3+gDf+b5fQoY+t2VZx1IAVHX8bzbN9EreYTvTYtFeDpYRWM8P7app2u4EX5wTw== - dependencies: - browser-headers "^0.4.1" - -"@injectivelabs/indexer-proto-ts@1.11.22": - version "1.11.22" - resolved "https://registry.yarnpkg.com/@injectivelabs/indexer-proto-ts/-/indexer-proto-ts-1.11.22.tgz#e00f625d47e972ab2adb871466ff072b28560a36" - integrity sha512-Mx90Q6F2lW03FlqXqw6MKCtKl3Rxuhla2CBlhhXe6XrmZWt+LpkiYinlZCyQDnmwjuqzCqurlMx4/sEjuy5WhA== - dependencies: - "@injectivelabs/grpc-web" "^0.0.1" - google-protobuf "^3.14.0" - protobufjs "^7.0.0" - rxjs "^7.4.0" - -"@injectivelabs/mito-proto-ts@1.0.52": - version "1.0.52" - resolved "https://registry.yarnpkg.com/@injectivelabs/mito-proto-ts/-/mito-proto-ts-1.0.52.tgz#2073d52a087795e0365a40c0a11638543c3cfd53" - integrity sha512-esqrLXy9GheL5DAGTSxhUYOJZXE8g/3NnYVqz/x9MxZHQwYhj3LoV2G8CWB0Ly2i7VEOc0osesgJk08hrgLa+w== - dependencies: - "@injectivelabs/grpc-web" "^0.0.1" - google-protobuf "^3.14.0" - protobufjs "^7.0.0" - rxjs "^7.4.0" - -"@injectivelabs/networks@^1.14.4": - version "1.14.4" - resolved "https://registry.yarnpkg.com/@injectivelabs/networks/-/networks-1.14.4.tgz#1603a2050c82ee4be5984d9a9978214b03d87fa8" - integrity sha512-2DbbaiI/v5PY+X90zhFMstVcVokpxEytMWZZvRKls6YqSBERhE3lxUF696lk0TEecfZ37CikuxZ7E9hx+eXg2A== - dependencies: - "@injectivelabs/exceptions" "^1.14.4" - "@injectivelabs/ts-types" "^1.14.4" - "@injectivelabs/utils" "^1.14.4" - link-module-alias "^1.2.0" - shx "^0.3.2" - -"@injectivelabs/sdk-ts@^1.12.1": - version "1.14.4" - resolved "https://registry.yarnpkg.com/@injectivelabs/sdk-ts/-/sdk-ts-1.14.4.tgz#0ec1669c707aadc07f272b1622c5f75baaed20de" - integrity sha512-Iw4y2YRxZ//p8lumqnSTUpXdoQGpt91wofm8R+eM65KOXX/T0p+6rpPYITWPxjT6E+koH4HXh9InnzzN4UzJQw== - dependencies: - "@apollo/client" "^3.5.8" - "@cosmjs/amino" "^0.30.1" - "@cosmjs/proto-signing" "^0.30.1" - "@cosmjs/stargate" "^0.30.1" - "@ensdomains/ens-validation" "^0.1.0" - "@ensdomains/eth-ens-namehash" "^2.0.15" - "@ethersproject/bytes" "^5.7.0" - "@injectivelabs/core-proto-ts" "^0.0.18" - "@injectivelabs/dmm-proto-ts" "1.0.19" - "@injectivelabs/exceptions" "^1.14.4" - "@injectivelabs/grpc-web" "^0.0.1" - "@injectivelabs/grpc-web-node-http-transport" "^0.0.2" - "@injectivelabs/grpc-web-react-native-transport" "^0.0.2" - "@injectivelabs/indexer-proto-ts" "1.11.22" - "@injectivelabs/mito-proto-ts" "1.0.52" - "@injectivelabs/networks" "^1.14.4" - "@injectivelabs/test-utils" "^1.14.3" - "@injectivelabs/token-metadata" "^1.14.4" - "@injectivelabs/ts-types" "^1.14.4" - "@injectivelabs/utils" "^1.14.4" - "@metamask/eth-sig-util" "^4.0.0" - axios "^0.27.2" - bech32 "^2.0.0" - bip39 "^3.0.4" - cosmjs-types "^0.7.1" - ethereumjs-util "^7.1.4" - ethers "^5.7.2" - google-protobuf "^3.21.0" - graphql "^16.3.0" - http-status-codes "^2.2.0" - js-sha3 "^0.8.0" - jscrypto "^1.0.3" - keccak256 "^1.0.6" - link-module-alias "^1.2.0" - rxjs "^7.8.0" - secp256k1 "^4.0.3" - shx "^0.3.2" - snakecase-keys "^5.4.1" - -"@injectivelabs/test-utils@^1.14.3": - version "1.14.3" - resolved "https://registry.yarnpkg.com/@injectivelabs/test-utils/-/test-utils-1.14.3.tgz#3c78b5f34669917f484aa8ac4a88df7bbc376f88" - integrity sha512-dVe262sACa7YkRr7mfXx58yI/ieuQqm3IMGq7EMweFKI6Kh2gh8FAM2bsDgm1cGewEIhJ9tWh6OM5uNheeVamg== - dependencies: - axios "^0.21.1" - bignumber.js "^9.0.1" - link-module-alias "^1.2.0" - shx "^0.3.2" - snakecase-keys "^5.1.2" - store2 "^2.12.0" - -"@injectivelabs/token-metadata@^1.14.4": - version "1.14.4" - resolved "https://registry.yarnpkg.com/@injectivelabs/token-metadata/-/token-metadata-1.14.4.tgz#42642172c45be8607df15a99840c178f145abfcb" - integrity sha512-g0jrIFpEdQ4kjUUaMcXWmXWu5owpIGE6GQPj7Gx07kkPTDNDiIfcaHUQ0nzTmcG02h0AhFx1eSpkHZFLSwyG/Q== - dependencies: - "@injectivelabs/exceptions" "^1.14.4" - "@injectivelabs/networks" "^1.14.4" - "@injectivelabs/ts-types" "^1.14.4" - "@injectivelabs/utils" "^1.14.4" - "@types/lodash.values" "^4.3.6" - copyfiles "^2.4.1" - jsonschema "^1.4.0" - link-module-alias "^1.2.0" - lodash "^4.17.21" - lodash.values "^4.3.0" - shx "^0.3.2" - -"@injectivelabs/ts-types@^1.14.4": - version "1.14.4" - resolved "https://registry.yarnpkg.com/@injectivelabs/ts-types/-/ts-types-1.14.4.tgz#d0c29289e167de2018a90b521bfa3a96f69a735c" - integrity sha512-c8g81bdrOQoi6S1CbeERRifkwNhjyLWB8lmF7liwRnPjyDciVHfHjikZjVWFLS9tJegNm44N9PWsM4RN9g0rXQ== - dependencies: - link-module-alias "^1.2.0" - shx "^0.3.2" - -"@injectivelabs/utils@^1.14.4": - version "1.14.4" - resolved "https://registry.yarnpkg.com/@injectivelabs/utils/-/utils-1.14.4.tgz#81e45e3504dc305d5b74ad60e26b62596f54cb72" - integrity sha512-eyx6XpgqdmEhEhdwNT4zEDYx+wXOhW01foCGC6e0Dmmrcxv5Bjd+R2BuLopKJ9h22OYNJm6dAX3ZtcoFwpFYbQ== - dependencies: - "@injectivelabs/exceptions" "^1.14.4" - "@injectivelabs/ts-types" "^1.14.4" - axios "^0.21.1" - bignumber.js "^9.0.1" - http-status-codes "^2.2.0" - link-module-alias "^1.2.0" - shx "^0.3.2" - snakecase-keys "^5.1.2" - store2 "^2.12.0" - -"@iov/crypto@2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@iov/crypto/-/crypto-2.1.0.tgz#10e91b6692e154958c11626dfd096a80e8a481a4" - integrity sha512-jnb4XuK50admolm7fBxOcxfAW2TO+wYrZlhDWiMETItY/Y5gNNa1zaDSO2wNIjjfGng+8nQ1yqnNhqy7busV2Q== - dependencies: - "@iov/encoding" "^2.1.0" - bip39 "^3.0.2" - bn.js "^4.11.8" - elliptic "^6.4.0" - js-sha3 "^0.8.0" - libsodium-wrappers "^0.7.6" - pbkdf2 "^3.0.16" - ripemd160 "^2.0.2" - sha.js "^2.4.11" - type-tagger "^1.0.0" - unorm "^1.5.0" - -"@iov/encoding@2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@iov/encoding/-/encoding-2.1.0.tgz#434203c39874c68bc1d96e1278251f0feb23be07" - integrity sha512-5IOdLO7Xg/uRykuiCqeMYghQ3IjWDtGxv7NTWXkgpHuna0aewx43mRpT2NPCpOZd1tpuorDtQ7/zbDNRaIIF/w== - dependencies: - base64-js "^1.3.0" - bech32 "^1.1.3" - bn.js "^4.11.8" - readonly-date "^1.0.0" - -"@iov/encoding@^2.1.0": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@iov/encoding/-/encoding-2.5.0.tgz#9612e529f45e63633b2375c13db28b9330ce6293" - integrity sha512-HGHLlQEvD23rFjW5PQrxD2B/6LiBHVSxqX6gjOz9KfcmIMIftRA0qROrTITfjjjUr/yZZEeNk4qjuBls9TaYcA== - dependencies: - "@cosmjs/encoding" "^0.20.0" - "@cosmjs/math" "^0.20.0" - "@cosmjs/utils" "^0.20.0" - readonly-date "^1.0.0" - -"@iov/utils@2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@iov/utils/-/utils-2.0.2.tgz#3527f376d26100e07ac823bf87bebd0f24680d1c" - integrity sha512-4D8MEvTcFc/DVy5q25vHxRItmgJyeX85dixMH+MxdKr+yy71h3sYk+sVBEIn70uqGP7VqAJkGOPNFs08/XYELw== - "@ipld/car@^3.0.1", "@ipld/car@^3.2.3": version "3.2.4" resolved "https://registry.yarnpkg.com/@ipld/car/-/car-3.2.4.tgz#115951ba2255ec51d865773a074e422c169fb01c" @@ -5725,13 +3951,6 @@ "@types/node" "*" jest-mock "^29.5.0" -"@jest/expect-utils@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.3.1.tgz#531f737039e9b9e27c42449798acb5bba01935b6" - integrity sha512-wlrznINZI5sMjwvUoLVk617ll/UYfGIZNxmbU+Pa7wmkL4vYzhV9R2pwVqUh4NWWuLQWkI8+8mOkxs//prKQ3g== - dependencies: - jest-get-type "^29.2.0" - "@jest/expect-utils@^29.5.0": version "29.5.0" resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.5.0.tgz#f74fad6b6e20f924582dc8ecbf2cb800fe43a036" @@ -5806,13 +4025,6 @@ dependencies: "@sinclair/typebox" "^0.24.1" -"@jest/schemas@^29.0.0": - version "29.0.0" - resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.0.0.tgz#5f47f5994dd4ef067fb7b4188ceac45f77fe952a" - integrity sha512-3Ab5HgYIIAnS0HjqJHQYZS+zXc4tUmTmBH3z83ajI6afXp8X3ZtdLX+nXx+I7LNkJD7uN9LAVhgnjDgZa2z0kA== - dependencies: - "@sinclair/typebox" "^0.24.1" - "@jest/schemas@^29.4.3": version "29.4.3" resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.4.3.tgz#39cf1b8469afc40b6f5a2baaa146e332c4151788" @@ -5935,18 +4147,6 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" -"@jest/types@^29.3.1": - version "29.3.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.3.1.tgz#7c5a80777cb13e703aeec6788d044150341147e3" - integrity sha512-d0S0jmmTpjnhCmNpApgX3jrUZgZ22ivKJRvL2lli5hpCRoNnp1f85r2/wpKfXuYu8E7Jjh1hGfhPyup1NM5AmA== - dependencies: - "@jest/schemas" "^29.0.0" - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^17.0.8" - chalk "^4.0.0" - "@jest/types@^29.5.0": version "29.5.0" resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.5.0.tgz#f59ef9b031ced83047c67032700d8c807d6e1593" @@ -5959,14 +4159,6 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" -"@jridgewell/gen-mapping@^0.1.0": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" - integrity sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w== - dependencies: - "@jridgewell/set-array" "^1.0.0" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": version "0.3.2" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" @@ -5976,22 +4168,12 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/resolve-uri@3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" - integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== - -"@jridgewell/resolve-uri@^3.0.3": - version "3.0.8" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.0.8.tgz#687cc2bbf243f4e9a868ecf2262318e2658873a1" - integrity sha512-YK5G9LaddzGbcucK4c8h5tWFmMPBvRZ/uyWmN1/SbBdIvqGUdWGkJ5BAaccgs6XbzVLsqbPJrBSFwKv3kT9i7w== - -"@jridgewell/resolve-uri@^3.1.0": +"@jridgewell/resolve-uri@^3.0.3", "@jridgewell/resolve-uri@^3.1.0": version "3.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== -"@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1": +"@jridgewell/set-array@^1.0.1": version "1.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== @@ -6004,12 +4186,7 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10": - version "1.4.14" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" - integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== - -"@jridgewell/sourcemap-codec@^1.4.13", "@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.4.15": +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.13", "@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.4.15": version "1.4.15" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== @@ -6022,15 +4199,7 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.7", "@jridgewell/trace-mapping@^0.3.9": - version "0.3.14" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz#b231a081d8f66796e475ad588a1ef473112701ed" - integrity sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@jridgewell/trace-mapping@^0.3.13", "@jridgewell/trace-mapping@^0.3.17": +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.13", "@jridgewell/trace-mapping@^0.3.14", "@jridgewell/trace-mapping@^0.3.15", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9": version "0.3.19" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz#f8a3249862f91be48d3127c3cfe992f79b4b8811" integrity sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw== @@ -6038,84 +4207,11 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" -"@jridgewell/trace-mapping@^0.3.14": - version "0.3.15" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz#aba35c48a38d3fd84b37e66c9c0423f9744f9774" - integrity sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@jridgewell/trace-mapping@^0.3.15": - version "0.3.17" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" - integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g== - dependencies: - "@jridgewell/resolve-uri" "3.1.0" - "@jridgewell/sourcemap-codec" "1.4.14" - "@jsdevtools/ono@^7.1.3": version "7.1.3" resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== -"@keplr-wallet/background@0.11.49": - version "0.11.49" - resolved "https://registry.yarnpkg.com/@keplr-wallet/background/-/background-0.11.49.tgz#408c266c41576208c2fdac276f24079674ac5ec0" - integrity sha512-PsAjf1hg5c9ophPoSSGP9urrZNGOPxQF+PYRfNxmx6yBcp6G1GMeJHFVCkq7BThQGZ94+nhpH2GExnQlpeoB7A== - dependencies: - "@ethereumjs/common" "^2.6.5" - "@ethereumjs/tx" "^3.5.2" - "@ethersproject/address" "^5.6.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/wallet" "^5.7.0" - "@keplr-wallet/chain-validator" "0.11.49" - "@keplr-wallet/common" "0.11.49" - "@keplr-wallet/cosmos" "0.11.49" - "@keplr-wallet/crypto" "0.11.49" - "@keplr-wallet/ledger-cosmos" "0.11.49" - "@keplr-wallet/popup" "0.11.49" - "@keplr-wallet/proto-types" "0.11.49" - "@keplr-wallet/router" "0.11.49" - "@keplr-wallet/types" "0.11.49" - "@keplr-wallet/unit" "0.11.49" - "@keystonehq/base-eth-keyring" "^0.6.4" - "@keystonehq/bc-ur-registry" "^0.5.1" - "@keystonehq/bc-ur-registry-cosmos" "^0.1.1" - "@keystonehq/bc-ur-registry-eth" "^0.11.4" - "@keystonehq/cosmos-keyring" "^0.0.3" - "@keystonehq/evm-keyring" "^0.1.1" - "@ledgerhq/hw-app-eth" "^6.29.3" - "@ledgerhq/hw-transport" "^6.20.0" - "@ledgerhq/hw-transport-webhid" "^6.20.0" - "@ledgerhq/hw-transport-webusb" "^6.20.0" - aes-js "^3.1.2" - axios "^0.27.2" - big-integer "^1.6.48" - bip39 "^3.0.2" - buffer "^6.0.3" - delay "^4.4.0" - joi "^17.5.0" - long "^4.0.0" - pbkdf2 "^3.1.2" - secp256k1 "^4.0.2" - secretjs "0.17.7" - utility-types "^3.10.0" - -"@keplr-wallet/chain-validator@0.11.49": - version "0.11.49" - resolved "https://registry.yarnpkg.com/@keplr-wallet/chain-validator/-/chain-validator-0.11.49.tgz#616467e8cedb4d6346e83f25f9d1a9c87dd4b8da" - integrity sha512-7T5X8W8qmc82VPv+zIS9Kn3ABvyDta31b05B97QlCz1Cyy0DObkckfpZWumzzkna9RC3FEs6avNfBOoymi884A== - dependencies: - "@keplr-wallet/cosmos" "0.11.49" - "@keplr-wallet/types" "0.11.49" - axios "^0.27.2" - joi "^17.5.0" - utility-types "^3.10.0" - "@keplr-wallet/common@0.11.49", "@keplr-wallet/common@^0.11.49": version "0.11.49" resolved "https://registry.yarnpkg.com/@keplr-wallet/common/-/common-0.11.49.tgz#28529935f3a38a89f72c5f1625f436253d9233ce" @@ -6136,23 +4232,6 @@ delay "^4.4.0" mobx "^6.1.7" -"@keplr-wallet/cosmos@0.11.49", "@keplr-wallet/cosmos@^0.11.49": - version "0.11.49" - resolved "https://registry.yarnpkg.com/@keplr-wallet/cosmos/-/cosmos-0.11.49.tgz#defe809facb6591e5021ed82917e8ab6611f234c" - integrity sha512-oQR4EfK3sjWr2Qf/TB7IxbGi3G4gWMFdhSv5iZ5mFC/a1daO06VzYpBBHnmqgd9Oks7pkjU9T4v7UvYmrONWFw== - dependencies: - "@ethersproject/address" "^5.6.0" - "@keplr-wallet/common" "0.11.49" - "@keplr-wallet/crypto" "0.11.49" - "@keplr-wallet/proto-types" "0.11.49" - "@keplr-wallet/types" "0.11.49" - "@keplr-wallet/unit" "0.11.49" - axios "^0.27.2" - bech32 "^1.1.4" - buffer "^6.0.3" - long "^4.0.0" - protobufjs "^6.11.2" - "@keplr-wallet/cosmos@0.12.28": version "0.12.28" resolved "https://registry.yarnpkg.com/@keplr-wallet/cosmos/-/cosmos-0.12.28.tgz#d56e73468256e7276a66bb41f145449dbf11efa1" @@ -6170,6 +4249,23 @@ long "^4.0.0" protobufjs "^6.11.2" +"@keplr-wallet/cosmos@^0.11.49": + version "0.11.49" + resolved "https://registry.yarnpkg.com/@keplr-wallet/cosmos/-/cosmos-0.11.49.tgz#defe809facb6591e5021ed82917e8ab6611f234c" + integrity sha512-oQR4EfK3sjWr2Qf/TB7IxbGi3G4gWMFdhSv5iZ5mFC/a1daO06VzYpBBHnmqgd9Oks7pkjU9T4v7UvYmrONWFw== + dependencies: + "@ethersproject/address" "^5.6.0" + "@keplr-wallet/common" "0.11.49" + "@keplr-wallet/crypto" "0.11.49" + "@keplr-wallet/proto-types" "0.11.49" + "@keplr-wallet/types" "0.11.49" + "@keplr-wallet/unit" "0.11.49" + axios "^0.27.2" + bech32 "^1.1.4" + buffer "^6.0.3" + long "^4.0.0" + protobufjs "^6.11.2" + "@keplr-wallet/crypto@0.11.49": version "0.11.49" resolved "https://registry.yarnpkg.com/@keplr-wallet/crypto/-/crypto-0.11.49.tgz#549d34105a28023bd5b473d11d902c6c2ccfbf05" @@ -6198,18 +4294,6 @@ elliptic "^6.5.3" sha.js "^2.4.11" -"@keplr-wallet/ledger-cosmos@0.11.49": - version "0.11.49" - resolved "https://registry.yarnpkg.com/@keplr-wallet/ledger-cosmos/-/ledger-cosmos-0.11.49.tgz#a68e058511fdf66d52cbd30b9970111a4af281f3" - integrity sha512-EOQqfj1ouM1zukN0p0Om2qo8Dh15nKJ+H12UFC10RZThv/QH/SVXog8FqoyvqHCItDQ/3P/6GoE+R46H8zUmgg== - dependencies: - buffer "^6.0.3" - -"@keplr-wallet/popup@0.11.49": - version "0.11.49" - resolved "https://registry.yarnpkg.com/@keplr-wallet/popup/-/popup-0.11.49.tgz#47133b0f4f64df5d02064a61f4442c87a9f0b1ae" - integrity sha512-bpVB7qEz0DZU93XivKJNau/tMh+eVQlGLy3dg+miXgyiFG88Muq/p7dfiirHpKv2/sIRZx7YMUK+qh1WBa3zaQ== - "@keplr-wallet/proto-types@0.11.49": version "0.11.49" resolved "https://registry.yarnpkg.com/@keplr-wallet/proto-types/-/proto-types-0.11.49.tgz#13c5cc8560e2345812a919a36b26dfd3320e9092" @@ -6255,29 +4339,7 @@ resolved "https://registry.yarnpkg.com/@keplr-wallet/simple-fetch/-/simple-fetch-0.12.28.tgz#44225df5b329c823076280df1ec9930a21b1373e" integrity sha512-T2CiKS2B5n0ZA7CWw0CA6qIAH0XYI1siE50MP+i+V0ZniCGBeL+BMcDw64vFJUcEH+1L5X4sDAzV37fQxGwllA== -"@keplr-wallet/stores@^0.11.49": - version "0.11.49" - resolved "https://registry.yarnpkg.com/@keplr-wallet/stores/-/stores-0.11.49.tgz#d0d998183ba20dcf52638bcd707fd59908edd21b" - integrity sha512-UDESpVTxntYDpPLRpSqC7duW8RCoQJ9mLI3hl98UlwEA2djPFjoGZF5+iqemMtqK5EWb6DWqnNj4ZC8dc8AFnw== - dependencies: - "@keplr-wallet/background" "0.11.49" - "@keplr-wallet/common" "0.11.49" - "@keplr-wallet/cosmos" "0.11.49" - "@keplr-wallet/crypto" "0.11.49" - "@keplr-wallet/proto-types" "0.11.49" - "@keplr-wallet/router" "0.11.49" - "@keplr-wallet/types" "0.11.49" - "@keplr-wallet/unit" "0.11.49" - axios "^0.27.2" - buffer "^6.0.3" - deepmerge "^4.2.2" - eventemitter3 "^4.0.7" - mobx "^6.1.7" - mobx-utils "^6.0.3" - p-queue "^6.6.2" - utility-types "^3.10.0" - -"@keplr-wallet/types@0.11.49", "@keplr-wallet/types@^0.11.49": +"@keplr-wallet/types@0.11.49": version "0.11.49" resolved "https://registry.yarnpkg.com/@keplr-wallet/types/-/types-0.11.49.tgz#bd88a8da711e56faa0684917aae9d7befee57e74" integrity sha512-+TS3XkNMfE/s8iN008eOeWzfWGxzY/pKoX+/I44rAJW382NGUzpIW9GLlmraardTsEp40joon1KVVPV/ApNpaw== @@ -6299,6 +4361,14 @@ dependencies: long "^4.0.0" +"@keplr-wallet/types@^0.11.49": + version "0.11.64" + resolved "https://registry.yarnpkg.com/@keplr-wallet/types/-/types-0.11.64.tgz#5a308c8c019b4e18f894e0f35f0904b60134d605" + integrity sha512-GgzeLDHHfZFyne3O7UIfFHj/uYqVbxAZI31RbBwt460OBbvwQzjrlZwvJW3vieWRAgxKSITjzEDBl2WneFTQdQ== + dependencies: + axios "^0.27.2" + long "^4.0.0" + "@keplr-wallet/unit@0.11.49": version "0.11.49" resolved "https://registry.yarnpkg.com/@keplr-wallet/unit/-/unit-0.11.49.tgz#af9ac1c55a3aa7e06a68566fe232ddb5b334d54b" @@ -6317,85 +4387,6 @@ big-integer "^1.6.48" utility-types "^3.10.0" -"@keystonehq/base-eth-keyring@^0.6.4": - version "0.6.4" - resolved "https://registry.yarnpkg.com/@keystonehq/base-eth-keyring/-/base-eth-keyring-0.6.4.tgz#16a8b280861a70d096444bbeba236c0001d709d9" - integrity sha512-pHTqD9CeBdTmeMIVa5ZnK7aMDb5SsHtp4uYRxa+SyYDO3kHcrqhlds43MIx5WFeDrgOStJ11w2Zji+7hbCAZLA== - dependencies: - "@ethereumjs/tx" "3.5.1" - "@keystonehq/bc-ur-registry-eth" "^0.11.4" - ethereumjs-util "^7.0.8" - hdkey "^2.0.1" - uuid "^8.3.2" - -"@keystonehq/bc-ur-registry-cosmos@^0.1.1": - version "0.1.6" - resolved "https://registry.yarnpkg.com/@keystonehq/bc-ur-registry-cosmos/-/bc-ur-registry-cosmos-0.1.6.tgz#5da37dae6144796bb02c7f5a8bb033abdbaf58ee" - integrity sha512-n/yJLs2oAPT9VTIHhHVbszpUJh7uqI7+CWTOT+RvcbxClqhVOhsb0KKv3qbdR9a6XohpF6+HZbHGaRciWl3ysQ== - dependencies: - "@keystonehq/bc-ur-registry" "0.5.4" - bs58check "^2.1.2" - uuid "^8.3.2" - -"@keystonehq/bc-ur-registry-eth@^0.11.4": - version "0.11.4" - resolved "https://registry.yarnpkg.com/@keystonehq/bc-ur-registry-eth/-/bc-ur-registry-eth-0.11.4.tgz#01d1669ea1bc7a591ae90923c30fde960c24c876" - integrity sha512-iXf5hLd0j0VuQdWUh6h7wi5j1PAkH6AGyUr1ZAYMtPflQRW/AzXEOw5GFB3dF5xi8uVoP36gPPnYFBmcFOFzqg== - dependencies: - "@keystonehq/bc-ur-registry" "^0.5.0-alpha.5" - ethereumjs-util "^7.0.8" - hdkey "^2.0.1" - uuid "^8.3.2" - -"@keystonehq/bc-ur-registry-evm@^0.1.2": - version "0.1.2" - resolved "https://registry.yarnpkg.com/@keystonehq/bc-ur-registry-evm/-/bc-ur-registry-evm-0.1.2.tgz#5e65bf8bfc8a58f6446a02a842c61a0c0cd235e1" - integrity sha512-mLgLnaxhQpupojuclb3YWri8fZas2z2dg5JqUpNtT6KlB8OfRnos7LMAot5qBMQgqVWVcJtn2Lf0Yn64k51DNw== - dependencies: - "@keystonehq/bc-ur-registry" "0.5.4" - bs58check "^2.1.2" - uuid "^9.0.0" - -"@keystonehq/bc-ur-registry@0.5.4", "@keystonehq/bc-ur-registry@^0.5.0", "@keystonehq/bc-ur-registry@^0.5.0-alpha.5", "@keystonehq/bc-ur-registry@^0.5.1": - version "0.5.4" - resolved "https://registry.yarnpkg.com/@keystonehq/bc-ur-registry/-/bc-ur-registry-0.5.4.tgz#5802486a29f5d772520d15579d40fba02860e27f" - integrity sha512-z7bZe10I5k0zz9znmDTXh+o3Rzb5XsRVpwAzexubOaLxVdZ0F7aMbe2LoEsw766Hpox/7zARi7UGmLz5C8BAzA== - dependencies: - "@ngraveio/bc-ur" "^1.1.5" - bs58check "^2.1.2" - tslib "^2.3.0" - -"@keystonehq/cosmos-keyring@^0.0.3": - version "0.0.3" - resolved "https://registry.yarnpkg.com/@keystonehq/cosmos-keyring/-/cosmos-keyring-0.0.3.tgz#af64d681524511b3e466d3bb02fcf46690466dfc" - integrity sha512-mNE9/0gzD7wzHK4K/cqPV4VaCg7O3WOT8tnQ1fuIebGFqb2/gCjynfbGvm2HA2aX+clf2KsstYkImWmIUJzXew== - dependencies: - "@keystonehq/bc-ur-registry" "^0.5.0" - "@keystonehq/bc-ur-registry-cosmos" "^0.1.1" - "@keystonehq/sdk" "^0.15.2" - uuid "^8.3.2" - -"@keystonehq/evm-keyring@^0.1.1": - version "0.1.2" - resolved "https://registry.yarnpkg.com/@keystonehq/evm-keyring/-/evm-keyring-0.1.2.tgz#0d29d87b62af3fc9a7c0c45b4cae2278db7d2a72" - integrity sha512-xX4YQ/nDj17VgV4gi8GoJOz0UAig7rsKqvvH1zQMKSpTsN+10J6iZR0bOgCBofVp1nLGmiorDlBcf+4yjR5bSw== - dependencies: - "@keystonehq/bc-ur-registry" "^0.5.0" - "@keystonehq/bc-ur-registry-evm" "^0.1.2" - "@keystonehq/sdk" "^0.15.7" - uuid "^9.0.0" - -"@keystonehq/sdk@^0.15.2", "@keystonehq/sdk@^0.15.7": - version "0.15.7" - resolved "https://registry.yarnpkg.com/@keystonehq/sdk/-/sdk-0.15.7.tgz#bf33bad9bb6b808cb4297120b6e6d6bd177ad0b6" - integrity sha512-jy3DBFaNOgbjAyVG08foM+Si7xItYkLtCi51L1iOyq95IrfhmyxpUWfjFW5K+YznfOT21TwYcJ/uktli6jqOZg== - dependencies: - "@ngraveio/bc-ur" "^1.0.0" - qrcode.react "^1.0.1" - react-modal "^3.12.1" - react-qr-reader "^2.2.1" - rxjs "^6.6.3" - "@kurkle/color@^0.3.0": version "0.3.2" resolved "https://registry.yarnpkg.com/@kurkle/color/-/color-0.3.2.tgz#5acd38242e8bde4f9986e7913c8fdf49d3aa199f" @@ -6411,33 +4402,6 @@ bignumber.js "^9.1.2" long "^5.2.3" -"@ledgerhq/cryptoassets@^9.1.0": - version "9.1.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-9.1.0.tgz#d1b77a2ad4ba12ce8bcdc74e6230312692e719cf" - integrity sha512-tzcZbjJDzZBUKct/4dLGy+HHMwRHw3/cnYLeDMj4+KIbE2+MXK3czkqsZbZVOPIxnJgkwHONICqQ4VUpaIQhXQ== - dependencies: - invariant "2" - -"@ledgerhq/devices@^6.27.1": - version "6.27.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-6.27.1.tgz#3b13ab1d1ba8201e9e74a08f390560483978c962" - integrity sha512-jX++oy89jtv7Dp2X6gwt3MMkoajel80JFWcdc0HCouwDsV1mVJ3SQdwl/bQU0zd8HI6KebvUP95QTwbQLLK/RQ== - dependencies: - "@ledgerhq/errors" "^6.10.0" - "@ledgerhq/logs" "^6.10.0" - rxjs "6" - semver "^7.3.5" - -"@ledgerhq/devices@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-8.0.0.tgz#8fe9f9e442e28b7a20bcdf4c2eed06ce7b8f76ae" - integrity sha512-gSnRT0KPca+LIpaC6D/WZQjOAlSI5uCvK1dmxXtKhODLAj735rX5Z3SnGnLUavRCHNbUi44FzgvloF5BKTkh7A== - dependencies: - "@ledgerhq/errors" "^6.12.3" - "@ledgerhq/logs" "^6.10.1" - rxjs "6" - semver "^7.3.5" - "@ledgerhq/devices@^8.0.7": version "8.0.7" resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-8.0.7.tgz#206434dbd8a097529bbfc95f5eef94c2923c7578" @@ -6448,16 +4412,6 @@ rxjs "6" semver "^7.3.5" -"@ledgerhq/errors@^6.10.0": - version "6.10.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-6.10.0.tgz#dda9127b65f653fbb2f74a55e8f0e550d69de6e4" - integrity sha512-fQFnl2VIXh9Yd41lGjReCeK+Q2hwxQJvLZfqHnKqWapTz68NHOv5QcI0OHuZVNEbv0xhgdLhi5b65kgYeQSUVg== - -"@ledgerhq/errors@^6.12.3": - version "6.12.3" - resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-6.12.3.tgz#a610caae1eeeb7cb038525e5212fe03217dda683" - integrity sha512-djiMSgB/7hnK3aLR/c5ZMMivxjcI7o2+y3VKcsZZpydPoVf9+FXqeJPRfOwmJ0JxbQ//LinUfWpIfHew8LkaVw== - "@ledgerhq/errors@^6.14.0": version "6.14.0" resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-6.14.0.tgz#0bf253983773ef12eebce2091f463bc719223b37" @@ -6472,40 +4426,6 @@ "@ledgerhq/hw-transport" "^6.28.8" bip32-path "^0.4.2" -"@ledgerhq/hw-app-eth@^6.29.3": - version "6.32.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-6.32.1.tgz#8c1999d7228902c556c5f3d93759072816daa206" - integrity sha512-Bw2VIN8IxQfKOFSIFSkETi3aaJPOxZ9jwGyibmhFdnfcMFuWVc9DErk7X1zr35kRl8FABais1sZUof7fCXppew== - dependencies: - "@ethersproject/abi" "^5.5.0" - "@ethersproject/rlp" "^5.5.0" - "@ledgerhq/cryptoassets" "^9.1.0" - "@ledgerhq/errors" "^6.12.3" - "@ledgerhq/hw-transport" "^6.28.1" - "@ledgerhq/hw-transport-mocker" "^6.27.12" - "@ledgerhq/logs" "^6.10.1" - axios "^0.26.1" - bignumber.js "^9.1.0" - crypto-js "^4.1.1" - -"@ledgerhq/hw-transport-mocker@^6.27.12": - version "6.27.12" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-mocker/-/hw-transport-mocker-6.27.12.tgz#057045ffe305c22a9e5bf1831404ed0c74962d2a" - integrity sha512-sJu4gJibdxR2qvsrqhCG474g5KhD5Acnfgtb7jdFrMeHbIEgb+XMeNzBGICPdNByUKW1lLgWN/lV1yJyCcCJ8A== - dependencies: - "@ledgerhq/hw-transport" "^6.28.1" - "@ledgerhq/logs" "^6.10.1" - -"@ledgerhq/hw-transport-webhid@^6.20.0": - version "6.27.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-webhid/-/hw-transport-webhid-6.27.1.tgz#8fd1710d23b6bd7cbe2382dd02054dfabe788447" - integrity sha512-u74rBYlibpbyGblSn74fRs2pMM19gEAkYhfVibq0RE1GNFjxDMFC1n7Sb+93Jqmz8flyfB4UFJsxs8/l1tm2Kw== - dependencies: - "@ledgerhq/devices" "^6.27.1" - "@ledgerhq/errors" "^6.10.0" - "@ledgerhq/hw-transport" "^6.27.1" - "@ledgerhq/logs" "^6.10.0" - "@ledgerhq/hw-transport-webhid@^6.27.15": version "6.27.19" resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-webhid/-/hw-transport-webhid-6.27.19.tgz#5a655b497258d94ec6494db7b56e17dd0c610638" @@ -6516,16 +4436,6 @@ "@ledgerhq/hw-transport" "^6.28.8" "@ledgerhq/logs" "^6.10.1" -"@ledgerhq/hw-transport-webusb@^6.20.0": - version "6.27.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-webusb/-/hw-transport-webusb-6.27.1.tgz#62be3b2e5f0d54ae06d066571e4408a807d0f01f" - integrity sha512-n0ygJSeRpznrUfwtbDCLQOM5mA23YT/ngYY8HU46dzsVJHrHQ4jwBNJU48iKB+a9GhHyPAUpPNlWGTogvoVUxg== - dependencies: - "@ledgerhq/devices" "^6.27.1" - "@ledgerhq/errors" "^6.10.0" - "@ledgerhq/hw-transport" "^6.27.1" - "@ledgerhq/logs" "^6.10.0" - "@ledgerhq/hw-transport-webusb@^6.27.15": version "6.27.19" resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-webusb/-/hw-transport-webusb-6.27.19.tgz#30a95c2122bcab6709665fda700276622087a930" @@ -6536,24 +4446,6 @@ "@ledgerhq/hw-transport" "^6.28.8" "@ledgerhq/logs" "^6.10.1" -"@ledgerhq/hw-transport@^6.20.0", "@ledgerhq/hw-transport@^6.27.1": - version "6.27.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.27.1.tgz#88072278f69c279cb6569352acd4ae2fec33ace3" - integrity sha512-hnE4/Fq1YzQI4PA1W0H8tCkI99R3UWDb3pJeZd6/Xs4Qw/q1uiQO+vNLC6KIPPhK0IajUfuI/P2jk0qWcMsuAQ== - dependencies: - "@ledgerhq/devices" "^6.27.1" - "@ledgerhq/errors" "^6.10.0" - events "^3.3.0" - -"@ledgerhq/hw-transport@^6.28.1": - version "6.28.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.28.1.tgz#cb22fe9bc23af4682c30f2aac7fe6f7ab13ed65a" - integrity sha512-RaZe+abn0zBIz82cE9tp7Y7aZkHWWbEaE2yJpfxT8AhFz3fx+BU0kLYzuRN9fmA7vKueNJ1MTVUCY+Ex9/CHSQ== - dependencies: - "@ledgerhq/devices" "^8.0.0" - "@ledgerhq/errors" "^6.12.3" - events "^3.3.0" - "@ledgerhq/hw-transport@^6.28.8": version "6.28.8" resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.28.8.tgz#f99a5c71c5c09591e9bfb1b970c42aafbe81351f" @@ -6563,11 +4455,6 @@ "@ledgerhq/errors" "^6.14.0" events "^3.3.0" -"@ledgerhq/logs@^6.10.0": - version "6.10.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-6.10.0.tgz#c012c1ecc1a0e53d50e6af381618dca5268461c1" - integrity sha512-lLseUPEhSFUXYTKj6q7s2O3s2vW2ebgA11vMAlKodXGf5AFw4zUoEbTz9CoFOC9jS6xY4Qr8BmRnxP/odT4Uuw== - "@ledgerhq/logs@^6.10.1": version "6.10.1" resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-6.10.1.tgz#5bd16082261d7364eabb511c788f00937dac588d" @@ -7303,17 +5190,6 @@ resolved "https://registry.yarnpkg.com/@mdx-js/util/-/util-1.6.22.tgz#219dfd89ae5b97a8801f015323ffa4b62f45718b" integrity sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA== -"@metamask/eth-sig-util@^4.0.0": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz#3ad61f6ea9ad73ba5b19db780d40d9aae5157088" - integrity sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ== - dependencies: - ethereumjs-abi "^0.6.8" - ethereumjs-util "^6.2.1" - ethjs-util "^0.1.6" - tweetnacl "^1.0.3" - tweetnacl-util "^0.15.1" - "@metamask/eth-sig-util@^6.0.0": version "6.0.0" resolved "https://registry.yarnpkg.com/@metamask/eth-sig-util/-/eth-sig-util-6.0.0.tgz#083321dc7285a9aa6e066db7c49be6e94c5e03a3" @@ -7497,6 +5373,13 @@ dependencies: webpack-bundle-analyzer "4.3.0" +"@next/bundle-analyzer@^14.1.0": + version "14.1.0" + resolved "https://registry.yarnpkg.com/@next/bundle-analyzer/-/bundle-analyzer-14.1.0.tgz#da146eb713283c2a28d32c98dbd0d63ae7d42d30" + integrity sha512-RJWjnlMp/1WSW0ahAdawV22WgJiC6BVaFS5Xfhw6gP7NJEX3cAJjh4JqSHKGr8GnLNRaFCVTQdDPoX84E421BA== + dependencies: + webpack-bundle-analyzer "4.10.1" + "@next/env@13.3.0": version "13.3.0" resolved "https://registry.yarnpkg.com/@next/env/-/env-13.3.0.tgz#cc2e49f03060a4684ce7ec7fd617a21bc5b9edba" @@ -7554,19 +5437,6 @@ resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.3.0.tgz#db7b55fee834dc8c2c484c696469e65bae2ee770" integrity sha512-Reer6rkLLcoOvB0dd66+Y7WrWVFH7sEEkF/4bJCIfsSKnTStTYaHtwIJAwbqnt9I392Tqvku0KkoqZOryWV9LQ== -"@ngraveio/bc-ur@^1.0.0", "@ngraveio/bc-ur@^1.1.5": - version "1.1.6" - resolved "https://registry.yarnpkg.com/@ngraveio/bc-ur/-/bc-ur-1.1.6.tgz#8f8c75fff22f6a5e4dfbc5a6b540d7fe8f42cd39" - integrity sha512-G+2XgjXde2IOcEQeCwR250aS43/Swi7gw0FuETgJy2c3HqF8f88SXDMsIGgJlZ8jXd0GeHR4aX0MfjXf523UZg== - dependencies: - "@apocentre/alias-sampling" "^0.5.3" - assert "^2.0.0" - bignumber.js "^9.0.1" - cbor-sync "^1.0.4" - crc "^3.8.0" - jsbi "^3.1.5" - sha.js "^2.4.11" - "@noble/curves@1.1.0", "@noble/curves@~1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.1.0.tgz#f13fc667c89184bc04cccb9b11e8e7bae27d8c3d" @@ -7574,43 +5444,23 @@ dependencies: "@noble/hashes" "1.3.1" -"@noble/curves@1.2.0", "@noble/curves@^1.0.0", "@noble/curves@~1.2.0": +"@noble/curves@^1.0.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== dependencies: "@noble/hashes" "1.3.2" -"@noble/ed25519@^1.7.0": - version "1.7.3" - resolved "https://registry.yarnpkg.com/@noble/ed25519/-/ed25519-1.7.3.tgz#57e1677bf6885354b466c38e2b620c62f45a7123" - integrity sha512-iR8GBkDt0Q3GyaVcIu7mSsVIqnFbkbRzGLWlvhwunacoLwt4J3swfKhfaM6rN6WY+TBGoYT1GtT1mIh2/jGbRQ== - "@noble/hashes@1.3.1": version "1.3.1" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.1.tgz#8831ef002114670c603c458ab8b11328406953a9" integrity sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA== -"@noble/hashes@1.3.2", "@noble/hashes@^1", "@noble/hashes@^1.2.0", "@noble/hashes@^1.3.1", "@noble/hashes@~1.3.0", "@noble/hashes@~1.3.1", "@noble/hashes@~1.3.2": +"@noble/hashes@1.3.2", "@noble/hashes@^1", "@noble/hashes@^1.0.0", "@noble/hashes@^1.2.0", "@noble/hashes@^1.3.1", "@noble/hashes@~1.3.0", "@noble/hashes@~1.3.1": version "1.3.2" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== -"@noble/hashes@^1.0.0": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.2.tgz#e9e035b9b166ca0af657a7848eb2718f0f22f183" - integrity sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA== - -"@noble/hashes@^1.1.2": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.0.tgz#085fd70f6d7d9d109671090ccae1d3bec62554a1" - integrity sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg== - -"@noble/secp256k1@^1.6.3": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.1.tgz#b251c70f824ce3ca7f8dc3df08d58f005cc0507c" - integrity sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw== - "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -7980,10 +5830,10 @@ schema-utils "^3.0.0" source-map "^0.7.3" -"@polka/url@^1.0.0-next.20": - version "1.0.0-next.21" - resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1" - integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g== +"@polka/url@^1.0.0-next.20", "@polka/url@^1.0.0-next.24": + version "1.0.0-next.24" + resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.24.tgz#58601079e11784d20f82d0585865bb42305c4df3" + integrity sha512-2LuNTFBIO0m7kKIQvvPHN6UE63VjpmL9rnEEaOOaiSPbZK+zUOYIzBAWcED+3XYzhYsd/0mD57VdxAEqqV52CQ== "@popperjs/core@^2.11.6": version "2.11.6" @@ -8264,7 +6114,7 @@ resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.1.4.tgz#0c8b74c50f29ee44f423f7416829c0bf8bb5eb27" integrity sha512-LwzQKA4vzIct1zNZzBmRKI9QuNpLgTQMEjsQLf3BXuGYb3QPTP4Yjf6mkdX+X1mYttZ808QpOwAzZjv28kq7DA== -"@scure/base@~1.1.0", "@scure/base@~1.1.2": +"@scure/base@~1.1.0": version "1.1.3" resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.3.tgz#8584115565228290a6c6c4961973e0903bb3df2f" integrity sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q== @@ -8278,15 +6128,6 @@ "@noble/hashes" "~1.3.1" "@scure/base" "~1.1.0" -"@scure/bip32@1.3.2": - version "1.3.2" - resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.3.2.tgz#90e78c027d5e30f0b22c1f8d50ff12f3fb7559f8" - integrity sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA== - dependencies: - "@noble/curves" "~1.2.0" - "@noble/hashes" "~1.3.2" - "@scure/base" "~1.1.2" - "@scure/bip39@1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.2.1.tgz#5cee8978656b272a917b7871c981e0541ad6ac2a" @@ -8443,23 +6284,6 @@ "@sentry/cli" "^1.74.6" webpack-sources "^2.0.0 || ^3.0.0" -"@sideway/address@^4.1.3": - version "4.1.4" - resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.4.tgz#03dccebc6ea47fdc226f7d3d1ad512955d4783f0" - integrity sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw== - dependencies: - "@hapi/hoek" "^9.0.0" - -"@sideway/formula@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@sideway/formula/-/formula-3.0.0.tgz#fe158aee32e6bd5de85044be615bc08478a0a13c" - integrity sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg== - -"@sideway/pinpoint@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@sideway/pinpoint/-/pinpoint-2.0.0.tgz#cff8ffadc372ad29fd3f78277aeb29e632cc70df" - integrity sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ== - "@sinclair/typebox@^0.24.1": version "0.24.51" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.51.tgz#645f33fe4e02defe26f2f5c0410e1c094eac7f5f" @@ -8484,28 +6308,6 @@ dependencies: "@sinonjs/commons" "^2.0.0" -"@skip-router/core@^1.1.3": - version "1.1.3" - resolved "https://registry.yarnpkg.com/@skip-router/core/-/core-1.1.3.tgz#70f6ebed56c9f0605fe99cb709681b1465ca154a" - integrity sha512-/u0dd3mk97nbzy7HjlFNZoGxL+I9FZdwbSuLRvLYgbxczM+b/KO5fHIrqs1KVTeF78ldL4QfAlV2ZlCbpwATdQ== - dependencies: - "@axelar-network/axelarjs-sdk" "^0.13.6" - "@cosmjs/amino" "^0.31.1" - "@cosmjs/cosmwasm-stargate" "^0.31.1" - "@cosmjs/encoding" "^0.31.1" - "@cosmjs/math" "^0.31.1" - "@cosmjs/proto-signing" "^0.31.1" - "@cosmjs/stargate" "^0.31.1" - "@cosmjs/tendermint-rpc" "^0.31.1" - "@injectivelabs/core-proto-ts" "^0.0.18" - "@injectivelabs/sdk-ts" "^1.12.1" - axios "^1.4.0" - chain-registry "^1.19.0" - cosmjs-types "^0.8.0" - faker "^6.6.6" - keccak256 "^1.0.6" - viem "^1.12.2" - "@smithy/protocol-http@^1.0.1": version "1.1.0" resolved "https://registry.yarnpkg.com/@smithy/protocol-http/-/protocol-http-1.1.0.tgz#caf22e01cb825d7490a4915e03d6fa64954ff535" @@ -8533,29 +6335,7 @@ dependencies: buffer "~6.0.3" -"@solana/web3.js@^1.75.0": - version "1.75.0" - resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.75.0.tgz#824c6f78865007bca758ca18f268d6f7363b42e5" - integrity sha512-rHQgdo1EWfb+nPUpHe4O7i8qJPELHKNR5PAZRK+a7XxiykqOfbaAlPt5boDWAGPnYbSv0ziWZv5mq9DlFaQCxg== - dependencies: - "@babel/runtime" "^7.12.5" - "@noble/ed25519" "^1.7.0" - "@noble/hashes" "^1.1.2" - "@noble/secp256k1" "^1.6.3" - "@solana/buffer-layout" "^4.0.0" - agentkeepalive "^4.2.1" - bigint-buffer "^1.1.5" - bn.js "^5.0.0" - borsh "^0.7.0" - bs58 "^4.0.1" - buffer "6.0.3" - fast-stable-stringify "^1.0.0" - jayson "^3.4.4" - node-fetch "^2.6.7" - rpc-websockets "^7.5.1" - superstruct "^0.14.2" - -"@solana/web3.js@^1.77.3": +"@solana/web3.js@^1.75.0", "@solana/web3.js@^1.77.3": version "1.78.4" resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.78.4.tgz#e8ca9abe4ec2af5fc540c1d272efee24aaffedb3" integrity sha512-up5VG1dK+GPhykmuMIozJZBbVqpm77vbOG6/r5dS7NBGZonwHfTLdBbsYc3rjmaQ4DpCXUa3tUc4RZHRORvZrw== @@ -8905,24 +6685,7 @@ prop-types "^15.7.2" regenerator-runtime "^0.13.7" -"@storybook/addons@6.5.10", "@storybook/addons@^6.4.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-6.5.10.tgz#bff2f8fb8453e9df04fa6dbc41341fd05f4cdeba" - integrity sha512-VD4tBCQ23PkSeDoxuHcKy0RfhIs3oMYjBacOZx7d0bvOzK9WjPyvE2ysDAh7r/ceqnwmWHAScIpE+I1RU7gl+g== - dependencies: - "@storybook/api" "6.5.10" - "@storybook/channels" "6.5.10" - "@storybook/client-logger" "6.5.10" - "@storybook/core-events" "6.5.10" - "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/router" "6.5.10" - "@storybook/theming" "6.5.10" - "@types/webpack-env" "^1.16.0" - core-js "^3.8.2" - global "^4.4.0" - regenerator-runtime "^0.13.7" - -"@storybook/addons@6.5.12", "@storybook/addons@^6.0.0": +"@storybook/addons@6.5.12": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-6.5.12.tgz#891767b5f88ea99b956cf19e9e2893594068adc7" integrity sha512-y3cgxZq41YGnuIlBJEuJjSFdMsm8wnvlNOGUP9Q+Er2dgfx8rJz4Q22o4hPjpvpaj4XdBtxCJXI2NeFpN59+Cw== @@ -8939,7 +6702,7 @@ global "^4.4.0" regenerator-runtime "^0.13.7" -"@storybook/addons@^6.5.12": +"@storybook/addons@^6.0.0", "@storybook/addons@^6.4.10", "@storybook/addons@^6.5.12": version "6.5.13" resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-6.5.13.tgz#61ec5eab07879400d423d60bb397880d10ee5e73" integrity sha512-18CqzNnrGMfeZtiKz+R/3rHtSNnfNwz6y6prIQIbWseK16jY8ELTfIFGviwO5V2OqpbHDQi5+xQQ63QAIb89YA== @@ -8956,30 +6719,7 @@ global "^4.4.0" regenerator-runtime "^0.13.7" -"@storybook/api@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.5.10.tgz#215623844648f0da2ac646fdcdd1345c2e1a8490" - integrity sha512-AkmgSPNEGdKp4oZA4KQ+RJsacw7GwfvjsVDnCkcXqS9zmSr/RNL0fhpcd60KKkmx/hGKPTDFpK3ZayxDrJ/h4A== - dependencies: - "@storybook/channels" "6.5.10" - "@storybook/client-logger" "6.5.10" - "@storybook/core-events" "6.5.10" - "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/router" "6.5.10" - "@storybook/semver" "^7.3.2" - "@storybook/theming" "6.5.10" - core-js "^3.8.2" - fast-deep-equal "^3.1.3" - global "^4.4.0" - lodash "^4.17.21" - memoizerific "^1.11.3" - regenerator-runtime "^0.13.7" - store2 "^2.12.0" - telejson "^6.0.8" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - -"@storybook/api@6.5.12", "@storybook/api@^6.0.0": +"@storybook/api@6.5.12": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.5.12.tgz#7cc82087fc9298be03f15bf4ab9c4aab294b3bac" integrity sha512-DuUZmMlQxkFNU9Vgkp9aNfCkAongU76VVmygvCuSpMVDI9HQ2lG0ydL+ppL4XKoSMCCoXTY6+rg4hJANnH+1AQ== @@ -9002,7 +6742,7 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/api@6.5.13": +"@storybook/api@6.5.13", "@storybook/api@^6.0.0": version "6.5.13" resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.5.13.tgz#8671e580721ff68d209fcde2975f967ae79b7d64" integrity sha512-xVSmB7/IuFd6G7eiJjbI2MuS7SZunoUM6d+YCWpjiehfMeX47MXt1gZtOwFrgJC1ShZlefXFahq/dvxwtmWs+w== @@ -9010,73 +6750,20 @@ "@storybook/channels" "6.5.13" "@storybook/client-logger" "6.5.13" "@storybook/core-events" "6.5.13" - "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/router" "6.5.13" - "@storybook/semver" "^7.3.2" - "@storybook/theming" "6.5.13" - core-js "^3.8.2" - fast-deep-equal "^3.1.3" - global "^4.4.0" - lodash "^4.17.21" - memoizerific "^1.11.3" - regenerator-runtime "^0.13.7" - store2 "^2.12.0" - telejson "^6.0.8" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - -"@storybook/builder-webpack4@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/builder-webpack4/-/builder-webpack4-6.5.10.tgz#79e95323577a37349ab3c81193fa249ac5c50173" - integrity sha512-AoKjsCNoQQoZXYwBDxO8s+yVEd5FjBJAaysEuUTHq2fb81jwLrGcEOo6hjw4jqfugZQIzYUEjPazlvubS78zpw== - dependencies: - "@babel/core" "^7.12.10" - "@storybook/addons" "6.5.10" - "@storybook/api" "6.5.10" - "@storybook/channel-postmessage" "6.5.10" - "@storybook/channels" "6.5.10" - "@storybook/client-api" "6.5.10" - "@storybook/client-logger" "6.5.10" - "@storybook/components" "6.5.10" - "@storybook/core-common" "6.5.10" - "@storybook/core-events" "6.5.10" - "@storybook/node-logger" "6.5.10" - "@storybook/preview-web" "6.5.10" - "@storybook/router" "6.5.10" - "@storybook/semver" "^7.3.2" - "@storybook/store" "6.5.10" - "@storybook/theming" "6.5.10" - "@storybook/ui" "6.5.10" - "@types/node" "^14.0.10 || ^16.0.0" - "@types/webpack" "^4.41.26" - autoprefixer "^9.8.6" - babel-loader "^8.0.0" - case-sensitive-paths-webpack-plugin "^2.3.0" - core-js "^3.8.2" - css-loader "^3.6.0" - file-loader "^6.2.0" - find-up "^5.0.0" - fork-ts-checker-webpack-plugin "^4.1.6" - glob "^7.1.6" - glob-promise "^3.4.0" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/router" "6.5.13" + "@storybook/semver" "^7.3.2" + "@storybook/theming" "6.5.13" + core-js "^3.8.2" + fast-deep-equal "^3.1.3" global "^4.4.0" - html-webpack-plugin "^4.0.0" - pnp-webpack-plugin "1.6.4" - postcss "^7.0.36" - postcss-flexbugs-fixes "^4.2.1" - postcss-loader "^4.2.0" - raw-loader "^4.0.2" - stable "^0.1.8" - style-loader "^1.3.0" - terser-webpack-plugin "^4.2.3" + lodash "^4.17.21" + memoizerific "^1.11.3" + regenerator-runtime "^0.13.7" + store2 "^2.12.0" + telejson "^6.0.8" ts-dedent "^2.0.0" - url-loader "^4.1.1" util-deprecate "^1.0.2" - webpack "4" - webpack-dev-middleware "^3.7.3" - webpack-filter-warnings-plugin "^1.2.1" - webpack-hot-middleware "^2.25.1" - webpack-virtual-modules "^0.2.2" "@storybook/builder-webpack4@6.5.12": version "6.5.12" @@ -9175,19 +6862,6 @@ webpack-hot-middleware "^2.25.1" webpack-virtual-modules "^0.4.1" -"@storybook/channel-postmessage@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-6.5.10.tgz#be8971b4b7f91b664bb2c6965fdfb073d541a03e" - integrity sha512-t9PTA0UzFvYa3IlOfpBOolfrRMPTjUMIeCQ6FNyM0aj5GqLKSvoQzP8NeoRpIrvyf6ljFKKdaMaZ3fiCvh45ag== - dependencies: - "@storybook/channels" "6.5.10" - "@storybook/client-logger" "6.5.10" - "@storybook/core-events" "6.5.10" - core-js "^3.8.2" - global "^4.4.0" - qs "^6.10.0" - telejson "^6.0.8" - "@storybook/channel-postmessage@6.5.12": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-6.5.12.tgz#045c5920eb6924b11411d1d5f6475a0d83c982e3" @@ -9201,17 +6875,6 @@ qs "^6.10.0" telejson "^6.0.8" -"@storybook/channel-websocket@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/channel-websocket/-/channel-websocket-6.5.10.tgz#bd1316a9b555229b215e5054a76b57c503dd8adc" - integrity sha512-RTXMZbMWCS3xU+4GVIdfnUXsKcwg/WTozy88/5OxaKjGw6KgRedqLAQJKJ6Y5XlnwIcWelirkHj/COwTTXhbPg== - dependencies: - "@storybook/channels" "6.5.10" - "@storybook/client-logger" "6.5.10" - core-js "^3.8.2" - global "^4.4.0" - telejson "^6.0.8" - "@storybook/channel-websocket@6.5.12": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/channel-websocket/-/channel-websocket-6.5.12.tgz#4796e2436900d73fb867591f7d7cf8f94898d51b" @@ -9223,15 +6886,6 @@ global "^4.4.0" telejson "^6.0.8" -"@storybook/channels@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-6.5.10.tgz#fca5b0d1ea8d30b022e805301ed436407c867ac4" - integrity sha512-lo26YZ6kWpHXLhuHJF4P/bICY7jD/rXEZqReKtGOSk1Lv99/xvG6pqmcy3hWLf3v3Dy/8otjRPSR7izFVIIZgQ== - dependencies: - core-js "^3.8.2" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - "@storybook/channels@6.5.12": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-6.5.12.tgz#98baf01691d263e2ac341853361ec69c1a6621bc" @@ -9250,32 +6904,6 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/client-api@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-6.5.10.tgz#0bc3f68ce014ce1ffd560472a893ba04be370f09" - integrity sha512-3wBWZl3NvMFgMovgEh+euiARAT2FXzpvTF4Q1gerGMNNDlrGxHnFvSuy4FHg/irtOGLa4yLz43ULFbYtpKw0Lg== - dependencies: - "@storybook/addons" "6.5.10" - "@storybook/channel-postmessage" "6.5.10" - "@storybook/channels" "6.5.10" - "@storybook/client-logger" "6.5.10" - "@storybook/core-events" "6.5.10" - "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/store" "6.5.10" - "@types/qs" "^6.9.5" - "@types/webpack-env" "^1.16.0" - core-js "^3.8.2" - fast-deep-equal "^3.1.3" - global "^4.4.0" - lodash "^4.17.21" - memoizerific "^1.11.3" - qs "^6.10.0" - regenerator-runtime "^0.13.7" - store2 "^2.12.0" - synchronous-promise "^2.0.15" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - "@storybook/client-api@6.5.12": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-6.5.12.tgz#9d02b2a8f5d4137918257742d72ae10c6a70a477" @@ -9302,14 +6930,6 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/client-logger@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-6.5.10.tgz#cfea823a5b8444409daa74f854c5d05367986b34" - integrity sha512-/xA0MHOevXev68hyLMQw8Qo8KczSIdXOxliAgrycMTkDmw5eKeA8TP7B8zP3wGuq/e3MrdD9/8MWhb/IQBNC3w== - dependencies: - core-js "^3.8.2" - global "^4.4.0" - "@storybook/client-logger@6.5.12": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-6.5.12.tgz#d9809e13dc7939eb61452a5e94b1ccb61c4a022c" @@ -9326,20 +6946,6 @@ core-js "^3.8.2" global "^4.4.0" -"@storybook/components@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/components/-/components-6.5.10.tgz#268e1269bc3d262f7dcec13f96c3b844919687b8" - integrity sha512-9OhgB8YQfGwOKjo/N96N5mrtJ6qDVVoEM1zuhea32tJUd2eYf0aSWpryA9VnOM0V1q/8DAoCg5rPBMYWMBU5uw== - dependencies: - "@storybook/client-logger" "6.5.10" - "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/theming" "6.5.10" - core-js "^3.8.2" - memoizerific "^1.11.3" - qs "^6.10.0" - regenerator-runtime "^0.13.7" - util-deprecate "^1.0.2" - "@storybook/components@6.5.12", "@storybook/components@^6.0.0": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/components/-/components-6.5.12.tgz#e137f0683ea92e22de116bfa62cfd65ce4efe01d" @@ -9354,32 +6960,6 @@ regenerator-runtime "^0.13.7" util-deprecate "^1.0.2" -"@storybook/core-client@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/core-client/-/core-client-6.5.10.tgz#90c86923236c8efff33d454a0dc552f6df4346b1" - integrity sha512-THsIjNrOrampTl0Lgfjvfjk1JnktKb4CQLOM80KpQb4cjDqorBjJmErzUkUQ2y3fXvrDmQ/kUREkShET4XEdtA== - dependencies: - "@storybook/addons" "6.5.10" - "@storybook/channel-postmessage" "6.5.10" - "@storybook/channel-websocket" "6.5.10" - "@storybook/client-api" "6.5.10" - "@storybook/client-logger" "6.5.10" - "@storybook/core-events" "6.5.10" - "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/preview-web" "6.5.10" - "@storybook/store" "6.5.10" - "@storybook/ui" "6.5.10" - airbnb-js-shims "^2.2.1" - ansi-to-html "^0.6.11" - core-js "^3.8.2" - global "^4.4.0" - lodash "^4.17.21" - qs "^6.10.0" - regenerator-runtime "^0.13.7" - ts-dedent "^2.0.0" - unfetch "^4.2.0" - util-deprecate "^1.0.2" - "@storybook/core-client@6.5.12": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/core-client/-/core-client-6.5.12.tgz#1a3889604b92292d210d956c46f86a64dd7a9483" @@ -9406,62 +6986,6 @@ unfetch "^4.2.0" util-deprecate "^1.0.2" -"@storybook/core-common@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/core-common/-/core-common-6.5.10.tgz#6b93449548b0890f5c68d89f0ca78e092026182c" - integrity sha512-Bx+VKkfWdrAmD8T51Sjq/mMhRaiapBHcpG4cU5bc3DMbg+LF2/yrgqv/cjVu+m5gHAzYCac5D7gqzBgvG7Myww== - dependencies: - "@babel/core" "^7.12.10" - "@babel/plugin-proposal-class-properties" "^7.12.1" - "@babel/plugin-proposal-decorators" "^7.12.12" - "@babel/plugin-proposal-export-default-from" "^7.12.1" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.12.1" - "@babel/plugin-proposal-object-rest-spread" "^7.12.1" - "@babel/plugin-proposal-optional-chaining" "^7.12.7" - "@babel/plugin-proposal-private-methods" "^7.12.1" - "@babel/plugin-proposal-private-property-in-object" "^7.12.1" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - "@babel/plugin-transform-arrow-functions" "^7.12.1" - "@babel/plugin-transform-block-scoping" "^7.12.12" - "@babel/plugin-transform-classes" "^7.12.1" - "@babel/plugin-transform-destructuring" "^7.12.1" - "@babel/plugin-transform-for-of" "^7.12.1" - "@babel/plugin-transform-parameters" "^7.12.1" - "@babel/plugin-transform-shorthand-properties" "^7.12.1" - "@babel/plugin-transform-spread" "^7.12.1" - "@babel/preset-env" "^7.12.11" - "@babel/preset-react" "^7.12.10" - "@babel/preset-typescript" "^7.12.7" - "@babel/register" "^7.12.1" - "@storybook/node-logger" "6.5.10" - "@storybook/semver" "^7.3.2" - "@types/node" "^14.0.10 || ^16.0.0" - "@types/pretty-hrtime" "^1.0.0" - babel-loader "^8.0.0" - babel-plugin-macros "^3.0.1" - babel-plugin-polyfill-corejs3 "^0.1.0" - chalk "^4.1.0" - core-js "^3.8.2" - express "^4.17.1" - file-system-cache "^1.0.5" - find-up "^5.0.0" - fork-ts-checker-webpack-plugin "^6.0.4" - fs-extra "^9.0.1" - glob "^7.1.6" - handlebars "^4.7.7" - interpret "^2.2.0" - json5 "^2.1.3" - lazy-universal-dotenv "^3.0.1" - picomatch "^2.3.0" - pkg-dir "^5.0.0" - pretty-hrtime "^1.0.3" - resolve-from "^5.0.0" - slash "^3.0.0" - telejson "^6.0.8" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - webpack "4" - "@storybook/core-common@6.5.12": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/core-common/-/core-common-6.5.12.tgz#9f8d5cb3812382c49c84dcfb4279a39e228a1b83" @@ -9518,78 +7042,20 @@ util-deprecate "^1.0.2" webpack "4" -"@storybook/core-events@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.5.10.tgz#66d87c8ea18db8e448018a16a3d0198ddbcbc683" - integrity sha512-EVb1gO1172klVIAABLOoigFMx0V88uctY0K/qVCO8n6v+wd2+0Ccn63kl+gTxsAC3WZ8XhXh9q2w5ImHklVECw== - dependencies: - core-js "^3.8.2" - -"@storybook/core-events@6.5.12", "@storybook/core-events@^6.0.0": +"@storybook/core-events@6.5.12": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.5.12.tgz#28bd727cc4216012409bfac412fcb708346c56bc" integrity sha512-0AMyMM19R/lHsYRfWqM8zZTXthasTAK2ExkSRzYi2GkIaVMxRKtM33YRwxKIpJ6KmIKIs8Ru3QCXu1mfCmGzNg== dependencies: core-js "^3.8.2" -"@storybook/core-events@6.5.13": +"@storybook/core-events@6.5.13", "@storybook/core-events@^6.0.0": version "6.5.13" resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.5.13.tgz#a8c0cc92694f09981ca6501d5c5ef328db18db8a" integrity sha512-kL745tPpRKejzHToA3/CoBNbI+NPRVk186vGxXBmk95OEg0TlwgQExP8BnqEtLlRZMbW08e4+6kilc1M1M4N5w== dependencies: core-js "^3.8.2" -"@storybook/core-server@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/core-server/-/core-server-6.5.10.tgz#ada3d647833c02cb8c742281c1f314ff866f96f8" - integrity sha512-jqwpA0ccA8X5ck4esWBid04+cEIVqirdAcqJeNb9IZAD+bRreO4Im8ilzr7jc5AmQ9fkqHs2NByFKh9TITp8NQ== - dependencies: - "@discoveryjs/json-ext" "^0.5.3" - "@storybook/builder-webpack4" "6.5.10" - "@storybook/core-client" "6.5.10" - "@storybook/core-common" "6.5.10" - "@storybook/core-events" "6.5.10" - "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/csf-tools" "6.5.10" - "@storybook/manager-webpack4" "6.5.10" - "@storybook/node-logger" "6.5.10" - "@storybook/semver" "^7.3.2" - "@storybook/store" "6.5.10" - "@storybook/telemetry" "6.5.10" - "@types/node" "^14.0.10 || ^16.0.0" - "@types/node-fetch" "^2.5.7" - "@types/pretty-hrtime" "^1.0.0" - "@types/webpack" "^4.41.26" - better-opn "^2.1.1" - boxen "^5.1.2" - chalk "^4.1.0" - cli-table3 "^0.6.1" - commander "^6.2.1" - compression "^1.7.4" - core-js "^3.8.2" - cpy "^8.1.2" - detect-port "^1.3.0" - express "^4.17.1" - fs-extra "^9.0.1" - global "^4.4.0" - globby "^11.0.2" - ip "^2.0.0" - lodash "^4.17.21" - node-fetch "^2.6.7" - open "^8.4.0" - pretty-hrtime "^1.0.3" - prompts "^2.4.0" - regenerator-runtime "^0.13.7" - serve-favicon "^2.5.0" - slash "^3.0.0" - telejson "^6.0.8" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - watchpack "^2.2.0" - webpack "4" - ws "^8.2.3" - x-default-browser "^0.4.0" - "@storybook/core-server@6.5.12": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/core-server/-/core-server-6.5.12.tgz#bc47a2af4972f7c9cddb8b5961bd5f04a3f7f09f" @@ -9641,14 +7107,6 @@ ws "^8.2.3" x-default-browser "^0.4.0" -"@storybook/core@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/core/-/core-6.5.10.tgz#15ec8be85943251e25c2c24e80e20dcacc4fed65" - integrity sha512-K86yYa0tYlMxADlwQTculYvPROokQau09SCVqpsLg3wJCTvYFL4+SIqcYoyBSbFmHOdnYbJgPydjN33MYLiOZQ== - dependencies: - "@storybook/core-client" "6.5.10" - "@storybook/core-server" "6.5.10" - "@storybook/core@6.5.12": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/core/-/core-6.5.12.tgz#b12456a76de584ee3b0818b5f50c35338ac66f93" @@ -9657,26 +7115,6 @@ "@storybook/core-client" "6.5.12" "@storybook/core-server" "6.5.12" -"@storybook/csf-tools@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/csf-tools/-/csf-tools-6.5.10.tgz#ae6f1ebd4951e8978c8fe3e08ddd2bd269bf922b" - integrity sha512-H77kZQEisu7+skzeIbNZwmE09OqLjwJTeFhLN1pcjxKVa30LEI3pBHcNBxVKqgxl+Yg3KkB7W/ArLO2N+i2ohw== - dependencies: - "@babel/core" "^7.12.10" - "@babel/generator" "^7.12.11" - "@babel/parser" "^7.12.11" - "@babel/plugin-transform-react-jsx" "^7.12.12" - "@babel/preset-env" "^7.12.11" - "@babel/traverse" "^7.12.11" - "@babel/types" "^7.12.11" - "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/mdx1-csf" "^0.0.1" - core-js "^3.8.2" - fs-extra "^9.0.1" - global "^4.4.0" - regenerator-runtime "^0.13.7" - ts-dedent "^2.0.0" - "@storybook/csf-tools@6.5.12": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/csf-tools/-/csf-tools-6.5.12.tgz#7740becd059686001d4c1b4db3f43e792362d918" @@ -9711,19 +7149,6 @@ dependencies: lodash "^4.17.15" -"@storybook/docs-tools@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/docs-tools/-/docs-tools-6.5.10.tgz#30baa62c1ca3a18b13625b6b305e23e39f404416" - integrity sha512-/bvYgOO+CxMEcHifkjJg0A60OTGOhcjGxnsB1h0gJuxMrqA/7Qwc108bFmPiX0eiD1BovFkZLJV4O6OY7zP5Vw== - dependencies: - "@babel/core" "^7.12.10" - "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/store" "6.5.10" - core-js "^3.8.2" - doctrine "^3.0.0" - lodash "^4.17.21" - regenerator-runtime "^0.13.7" - "@storybook/docs-tools@6.5.12": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/docs-tools/-/docs-tools-6.5.12.tgz#22138cc810e8790b21d518cd48a3e2716d43c751" @@ -9737,47 +7162,6 @@ lodash "^4.17.21" regenerator-runtime "^0.13.7" -"@storybook/manager-webpack4@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/manager-webpack4/-/manager-webpack4-6.5.10.tgz#41bae252b863484f293954ef2d2dc80bf3e028f1" - integrity sha512-N/TlNDhuhARuFipR/ZJ/xEVESz23iIbCsZ4VNehLHm8PpiGlQUehk+jMjWmz5XV0bJItwjRclY+CU3GjZKblfQ== - dependencies: - "@babel/core" "^7.12.10" - "@babel/plugin-transform-template-literals" "^7.12.1" - "@babel/preset-react" "^7.12.10" - "@storybook/addons" "6.5.10" - "@storybook/core-client" "6.5.10" - "@storybook/core-common" "6.5.10" - "@storybook/node-logger" "6.5.10" - "@storybook/theming" "6.5.10" - "@storybook/ui" "6.5.10" - "@types/node" "^14.0.10 || ^16.0.0" - "@types/webpack" "^4.41.26" - babel-loader "^8.0.0" - case-sensitive-paths-webpack-plugin "^2.3.0" - chalk "^4.1.0" - core-js "^3.8.2" - css-loader "^3.6.0" - express "^4.17.1" - file-loader "^6.2.0" - find-up "^5.0.0" - fs-extra "^9.0.1" - html-webpack-plugin "^4.0.0" - node-fetch "^2.6.7" - pnp-webpack-plugin "1.6.4" - read-pkg-up "^7.0.1" - regenerator-runtime "^0.13.7" - resolve-from "^5.0.0" - style-loader "^1.3.0" - telejson "^6.0.8" - terser-webpack-plugin "^4.2.3" - ts-dedent "^2.0.0" - url-loader "^4.1.1" - util-deprecate "^1.0.2" - webpack "4" - webpack-dev-middleware "^3.7.3" - webpack-virtual-modules "^0.2.2" - "@storybook/manager-webpack4@6.5.12": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/manager-webpack4/-/manager-webpack4-6.5.12.tgz#7e0ae21455e1c070d291942c18373ceaa58c0e05" @@ -9874,17 +7258,6 @@ prettier ">=2.2.1 <=2.3.0" ts-dedent "^2.0.0" -"@storybook/node-logger@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-6.5.10.tgz#bce4c04009c4b62d6d2fb617176d7ef0084e9e89" - integrity sha512-bYswXIKV7Stru8vYfkjUMNN8UhF7Qg7NRsUvG5Djt5lLIae1XmUIgnH40mU/nW4X4BSfcR9MKxsSsngvn2WmQg== - dependencies: - "@types/npmlog" "^4.1.2" - chalk "^4.1.0" - core-js "^3.8.2" - npmlog "^5.0.1" - pretty-hrtime "^1.0.3" - "@storybook/node-logger@6.5.12": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-6.5.12.tgz#0f9efcd1a37c7aae493b22fe33cacca87c135b9b" @@ -9897,33 +7270,11 @@ pretty-hrtime "^1.0.3" "@storybook/postinstall@6.5.12": - version "6.5.12" - resolved "https://registry.yarnpkg.com/@storybook/postinstall/-/postinstall-6.5.12.tgz#9ff47c254899949be4934b021c37491b247d3266" - integrity sha512-6K73f9c2UO+w4Wtyo2BxEpEsnhPvMgqHSaJ9Yt6Tc90LaDGUbcVgy6PNibsRyuJ/KQ543WeiRO5rSZfm2uJU9A== - dependencies: - core-js "^3.8.2" - -"@storybook/preview-web@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/preview-web/-/preview-web-6.5.10.tgz#81bf5d3f5fca9e26099c057206bd8e684225989b" - integrity sha512-sTC/o5gkvALOtcNgtApGKGN9EavvSxRHBeBh+5BQjV2qQ8ap+26RsfUizNBECAa2Jrn4osaDYn9HRhJLFL69WA== - dependencies: - "@storybook/addons" "6.5.10" - "@storybook/channel-postmessage" "6.5.10" - "@storybook/client-logger" "6.5.10" - "@storybook/core-events" "6.5.10" - "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/store" "6.5.10" - ansi-to-html "^0.6.11" - core-js "^3.8.2" - global "^4.4.0" - lodash "^4.17.21" - qs "^6.10.0" - regenerator-runtime "^0.13.7" - synchronous-promise "^2.0.15" - ts-dedent "^2.0.0" - unfetch "^4.2.0" - util-deprecate "^1.0.2" + version "6.5.12" + resolved "https://registry.yarnpkg.com/@storybook/postinstall/-/postinstall-6.5.12.tgz#9ff47c254899949be4934b021c37491b247d3266" + integrity sha512-6K73f9c2UO+w4Wtyo2BxEpEsnhPvMgqHSaJ9Yt6Tc90LaDGUbcVgy6PNibsRyuJ/KQ543WeiRO5rSZfm2uJU9A== + dependencies: + core-js "^3.8.2" "@storybook/preview-web@6.5.12": version "6.5.12" @@ -9960,48 +7311,7 @@ react-docgen-typescript "^2.1.1" tslib "^2.0.0" -"@storybook/react@^6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/react/-/react-6.5.10.tgz#6e9f5cf5e4c81d966774c08c87fb2414052db454" - integrity sha512-m8S1qQrwA7pDGwdKEvL6LV3YKvSzVUY297Fq+xcTU3irnAy4sHDuFoLqV6Mi1510mErK1r8+rf+0R5rEXB219g== - dependencies: - "@babel/preset-flow" "^7.12.1" - "@babel/preset-react" "^7.12.10" - "@pmmmwh/react-refresh-webpack-plugin" "^0.5.3" - "@storybook/addons" "6.5.10" - "@storybook/client-logger" "6.5.10" - "@storybook/core" "6.5.10" - "@storybook/core-common" "6.5.10" - "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/docs-tools" "6.5.10" - "@storybook/node-logger" "6.5.10" - "@storybook/react-docgen-typescript-plugin" "1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0" - "@storybook/semver" "^7.3.2" - "@storybook/store" "6.5.10" - "@types/estree" "^0.0.51" - "@types/node" "^14.14.20 || ^16.0.0" - "@types/webpack-env" "^1.16.0" - acorn "^7.4.1" - acorn-jsx "^5.3.1" - acorn-walk "^7.2.0" - babel-plugin-add-react-displayname "^0.0.5" - babel-plugin-react-docgen "^4.2.1" - core-js "^3.8.2" - escodegen "^2.0.0" - fs-extra "^9.0.1" - global "^4.4.0" - html-tags "^3.1.0" - lodash "^4.17.21" - prop-types "^15.7.2" - react-element-to-jsx-string "^14.3.4" - react-refresh "^0.11.0" - read-pkg-up "^7.0.1" - regenerator-runtime "^0.13.7" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - webpack ">=4.43.0 <6.0.0" - -"@storybook/react@^6.5.12": +"@storybook/react@^6.5.10", "@storybook/react@^6.5.12": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/react/-/react-6.5.12.tgz#0c6b02a583f478ace6cd957a358d84a728a8d232" integrity sha512-1tG8EdSfp+OZAKAWPT2UrexF4o007jEMwQFFXw1atIQrQOADzSnZ7lTYJ08o5TyJwksswtr18tH3oJJ9sG3KPw== @@ -10042,17 +7352,6 @@ util-deprecate "^1.0.2" webpack ">=4.43.0 <6.0.0" -"@storybook/router@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/router/-/router-6.5.10.tgz#b0c342e080c1d2b5344603bc43a6c75734a4a879" - integrity sha512-O+vNW/eEpYFF8eCg5jZjNQ6q2DKQVxqDRPCy9pJdEbvavMDZn6AFYgVK+VJe5F4211WW2yncOu922xObCxXJYg== - dependencies: - "@storybook/client-logger" "6.5.10" - core-js "^3.8.2" - memoizerific "^1.11.3" - qs "^6.10.0" - regenerator-runtime "^0.13.7" - "@storybook/router@6.5.12": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/router/-/router-6.5.12.tgz#58efbc1f2f301c8584802af1c710b2f6f03f948c" @@ -10099,27 +7398,6 @@ prettier ">=2.2.1 <=2.3.0" regenerator-runtime "^0.13.7" -"@storybook/store@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/store/-/store-6.5.10.tgz#85df17a8d57af0cba3934b3c6046537e2bca9abd" - integrity sha512-RswrSYh2IiKkytFPxP9AvP+hekjrvHK2ILvyDk2ZgduCN4n5ivsekOb+N3M2t+dq1eLuW9or5n2T4OWwAwjxxQ== - dependencies: - "@storybook/addons" "6.5.10" - "@storybook/client-logger" "6.5.10" - "@storybook/core-events" "6.5.10" - "@storybook/csf" "0.0.2--canary.4566f4d.1" - core-js "^3.8.2" - fast-deep-equal "^3.1.3" - global "^4.4.0" - lodash "^4.17.21" - memoizerific "^1.11.3" - regenerator-runtime "^0.13.7" - slash "^3.0.0" - stable "^0.1.8" - synchronous-promise "^2.0.15" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" - "@storybook/store@6.5.12": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/store/-/store-6.5.12.tgz#f1624ba942162cb9627a2ddcac72bfc9062e17a2" @@ -10141,24 +7419,6 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/telemetry@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/telemetry/-/telemetry-6.5.10.tgz#742b05a55dfe8470ce4cb371f3f3f2c02f96e816" - integrity sha512-+M5HILDFS8nDumLxeSeAwi1MTzIuV6UWzV4yB2wcsEXOBTdplcl9oYqFKtlst78oOIdGtpPYxYfivDlqxC2K4g== - dependencies: - "@storybook/client-logger" "6.5.10" - "@storybook/core-common" "6.5.10" - chalk "^4.1.0" - core-js "^3.8.2" - detect-package-manager "^2.0.1" - fetch-retry "^5.0.2" - fs-extra "^9.0.1" - global "^4.4.0" - isomorphic-unfetch "^3.1.0" - nanoid "^3.3.1" - read-pkg-up "^7.0.1" - regenerator-runtime "^0.13.7" - "@storybook/telemetry@6.5.12": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/telemetry/-/telemetry-6.5.12.tgz#12b0a2bcfe47d57ee6e6344ac789a905a5912747" @@ -10177,17 +7437,7 @@ read-pkg-up "^7.0.1" regenerator-runtime "^0.13.7" -"@storybook/theming@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-6.5.10.tgz#052100979c1270fc8f60653c1a13a6f047318109" - integrity sha512-BvTQBBcSEwKKcsVmF+Ol6v0RIQUr+bxP7gb10wtfBd23mZTEFA0C1N5FnZr/dDeiBKG1pvf1UKvoYA731y0BsA== - dependencies: - "@storybook/client-logger" "6.5.10" - core-js "^3.8.2" - memoizerific "^1.11.3" - regenerator-runtime "^0.13.7" - -"@storybook/theming@6.5.12", "@storybook/theming@^6.0.0": +"@storybook/theming@6.5.12": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-6.5.12.tgz#7df1b52913d49c5e84fc1f2e837c02d9fa8cc639" integrity sha512-uWOo84qMQ2R6c1C0faZ4Q0nY01uNaX7nXoJKieoiJ6ZqY9PSYxJl1kZLi3uPYnrxLZjzjVyXX8MgdxzbppYItA== @@ -10197,7 +7447,7 @@ memoizerific "^1.11.3" regenerator-runtime "^0.13.7" -"@storybook/theming@6.5.13": +"@storybook/theming@6.5.13", "@storybook/theming@^6.0.0": version "6.5.13" resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-6.5.13.tgz#3f905eb9f72ddc28d096384290999057987f3083" integrity sha512-oif5NGFAUQhizo50r+ctw2hZNLWV4dPHai+L/gFvbaSeRBeHSNkIcMoZ2FlrO566HdGZTDutYXcR+xus8rI28g== @@ -10207,26 +7457,6 @@ memoizerific "^1.11.3" regenerator-runtime "^0.13.7" -"@storybook/ui@6.5.10": - version "6.5.10" - resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-6.5.10.tgz#f56095a1a39ae5a203f2ac7f3dba86341a5927d5" - integrity sha512-6iaoaRAiTqB1inTw35vao+5hjcDE0Qa0A3a9ZIeNa6yHvpB1k0lO/N/0PMrRdVvySYpXVD1iry4z4QYdo1rU+w== - dependencies: - "@storybook/addons" "6.5.10" - "@storybook/api" "6.5.10" - "@storybook/channels" "6.5.10" - "@storybook/client-logger" "6.5.10" - "@storybook/components" "6.5.10" - "@storybook/core-events" "6.5.10" - "@storybook/router" "6.5.10" - "@storybook/semver" "^7.3.2" - "@storybook/theming" "6.5.10" - core-js "^3.8.2" - memoizerific "^1.11.3" - qs "^6.10.0" - regenerator-runtime "^0.13.7" - resolve-from "^5.0.0" - "@storybook/ui@6.5.12": version "6.5.12" resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-6.5.12.tgz#25ccd6e6d5aae227ba6561c2b8e9cfda9b0ad4de" @@ -10574,20 +7804,6 @@ dependencies: "@babel/types" "^7.3.0" -"@types/bn.js@^4.11.3": - version "4.11.6" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" - integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== - dependencies: - "@types/node" "*" - -"@types/bn.js@^5.1.0": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.1.tgz#b51e1b55920a4ca26e9285ff79936bbdec910682" - integrity sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g== - dependencies: - "@types/node" "*" - "@types/connect@^3.4.33": version "3.4.36" resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.36.tgz#e511558c15a39cb29bd5357eebb57bd1459cd1ab" @@ -10602,14 +7818,7 @@ dependencies: "@types/node" "*" -"@types/debug@^4.0.0": - version "4.1.7" - resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.7.tgz#7cc0ea761509124709b8b2d1090d8f6c17aadb82" - integrity sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg== - dependencies: - "@types/ms" "*" - -"@types/debug@^4.1.7": +"@types/debug@^4.0.0", "@types/debug@^4.1.7": version "4.1.8" resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.8.tgz#cef723a5d0a90990313faec2d1e22aee5eecb317" integrity sha512-/vPO1EPOs306Cvhwv7KfVfYvOJqA/S/AXjaHQiJboCZzcNDb+TIJFN9/2C9DZ//ijSKWioNyUxD792QmDJ+HKQ== @@ -10632,21 +7841,16 @@ "@types/estree" "*" "@types/json-schema" "*" -"@types/estree@*": - version "0.0.52" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.52.tgz#7f1f57ad5b741f3d5b210d3b1f145640d89bf8fe" - integrity sha512-BZWrtCU0bMVAIliIV+HJO1f1PR41M7NKjfxrFJwwhKI1KwhwOxYw1SXg9ao+CIMt774nFuGiG6eU+udtbEI9oQ== +"@types/estree@*", "@types/estree@^1.0.0": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" + integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== "@types/estree@^0.0.51": version "0.0.51" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== -"@types/estree@^1.0.0": - version "1.0.5" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" - integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== - "@types/express-serve-static-core@4.17.28": version "4.17.28" resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz#c47def9f34ec81dc6328d0b1b5303d1ec98d86b8" @@ -10750,17 +7954,7 @@ resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-4.0.9.tgz#cd82382c4f902fed9691a2ed79ec68c5898af4c2" integrity sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg== -"@types/json-schema@*", "@types/json-schema@^7.0.4", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": - version "7.0.11" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" - integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== - -"@types/json-schema@^7.0.11": - version "7.0.12" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.12.tgz#d70faba7039d5fca54c83c7dbab41051d2b6f6cb" - integrity sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA== - -"@types/json-schema@^7.0.12": +"@types/json-schema@*", "@types/json-schema@^7.0.11", "@types/json-schema@^7.0.12", "@types/json-schema@^7.0.4", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": version "7.0.15" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== @@ -10796,19 +7990,7 @@ dependencies: "@types/lodash" "*" -"@types/lodash.values@^4.3.6": - version "4.3.9" - resolved "https://registry.yarnpkg.com/@types/lodash.values/-/lodash.values-4.3.9.tgz#a30e7d7cb715b1a01726838844da1dfbca549c2e" - integrity sha512-IJ20OEfqNwm3k8ENwoM3q0yOs4UMpgtD4GqxB4lwBHToGthHWqhyh5DdSgQjioocz0QK2SSBkJfCq95ZTV8BTw== - dependencies: - "@types/lodash" "*" - -"@types/lodash@*", "@types/lodash@^4.14.167": - version "4.14.182" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.182.tgz#05301a4d5e62963227eaafe0ce04dd77c54ea5c2" - integrity sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q== - -"@types/lodash@^4.14.182": +"@types/lodash@*", "@types/lodash@^4.14.167", "@types/lodash@^4.14.182": version "4.14.197" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.197.tgz#e95c5ddcc814ec3e84c891910a01e0c8a378c54b" integrity sha512-BMVOiWs0uNxHVlHBgzTIqJYmj+PgCo4euloGF+5m4okL3rEYzM2EEv78mw8zWSMM57dM7kVIgJ2QDvwHSoCI5g== @@ -10910,19 +8092,7 @@ resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-5.0.3.tgz#e7b5aebbac150f8b5fdd4a46e7f0bd8e65e19109" integrity sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw== -"@types/pbkdf2@^3.0.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.0.tgz#039a0e9b67da0cdc4ee5dab865caa6b267bb66b1" - integrity sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ== - dependencies: - "@types/node" "*" - -"@types/prettier@^2.1.5": - version "2.6.3" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.6.3.tgz#68ada76827b0010d0db071f739314fa429943d0a" - integrity sha512-ymZk3LEC/fsut+/Q5qejp6R9O1rMxz3XaRHDV6kX8MrGAhOSPqVARbDi+EZvInBpw+BnCX3TD240byVkOfQsHg== - -"@types/prettier@^2.6.1": +"@types/prettier@^2.1.5", "@types/prettier@^2.6.1": version "2.7.3" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.3.tgz#3e51a17e291d01d17d3fc61422015a933af7a08f" integrity sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA== @@ -11013,13 +8183,6 @@ resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew== -"@types/secp256k1@^4.0.1": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.3.tgz#1b8e55d8e00f08ee7220b4d59a6abe89c37a901c" - integrity sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w== - dependencies: - "@types/node" "*" - "@types/semver@^7.5.0", "@types/semver@^7.5.6": version "7.5.6" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.6.tgz#c65b2bfce1bec346582c07724e3f8c1017a20339" @@ -11062,11 +8225,6 @@ resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d" integrity sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ== -"@types/uuid@^8.3.1": - version "8.3.4" - resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.4.tgz#bd86a43617df0594787d38b735f55c805becf1bc" - integrity sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw== - "@types/uuid@^9.0.1": version "9.0.1" resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.1.tgz#98586dc36aee8dacc98cc396dbca8d0429647aa6" @@ -11533,12 +8691,12 @@ query-string "7.1.3" uint8arrays "^3.1.0" -"@walletconnect/window-getters@1.0.0", "@walletconnect/window-getters@^1.0.0": +"@walletconnect/window-getters@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@walletconnect/window-getters/-/window-getters-1.0.0.tgz#1053224f77e725dfd611c83931b5f6c98c32bfc8" integrity sha512-xB0SQsLaleIYIkSsl43vm8EwETpBzJ2gnzk7e0wMF3ktqiTGS6TFHxcprMl5R44KKh4tCcHCJwolMCaDSwtAaA== -"@walletconnect/window-getters@^1.0.1": +"@walletconnect/window-getters@^1.0.0", "@walletconnect/window-getters@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@walletconnect/window-getters/-/window-getters-1.0.1.tgz#f36d1c72558a7f6b87ecc4451fc8bd44f63cbbdc" integrity sha512-vHp+HqzGxORPAN8gY03qnbTMnhqIwjeRJNOMOAzePRg4xVEEE2WvYsI9G2NMjOknA8hnuYbU3/hwLcKbjhc8+Q== @@ -12032,7 +9190,7 @@ dependencies: tslib "^2.3.0" -"@wry/context@^0.7.0", "@wry/context@^0.7.3": +"@wry/context@^0.7.0": version "0.7.4" resolved "https://registry.yarnpkg.com/@wry/context/-/context-0.7.4.tgz#e32d750fa075955c4ab2cfb8c48095e1d42d5990" integrity sha512-jmT7Sb4ZQWI5iyu3lobQxICu2nC/vbUhP0vIdd6tHC9PTfenmRmuIFqktc6GH9cgi+ZHnsLWPvfSvc4DrYmKiQ== @@ -12123,11 +9281,6 @@ abbrev@1, abbrev@^1.0.0: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== -abitype@0.9.8: - version "0.9.8" - resolved "https://registry.yarnpkg.com/abitype/-/abitype-0.9.8.tgz#1f120b6b717459deafd213dfbf3a3dd1bf10ae8c" - integrity sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ== - abort-controller@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" @@ -12182,12 +9335,7 @@ acorn@^7.0.0, acorn@^7.4.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.0.4, acorn@^8.4.1, acorn@^8.5.0: - version "8.7.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.1.tgz#0197122c843d1bf6d0a5e83220a788f278f63c30" - integrity sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A== - -acorn@^8.7.1, acorn@^8.8.0: +acorn@^8.0.4, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0: version "8.8.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== @@ -12215,11 +9363,6 @@ aes-js@3.0.0: resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" integrity sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw== -aes-js@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.1.2.tgz#db9aabde85d5caabbfc0d4f2a4446960f627146a" - integrity sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ== - agent-base@6, agent-base@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" @@ -12302,7 +9445,7 @@ ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.2, ajv@^6.12.4, ajv@^6.12.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.1: +ajv@^8.0.1, ajv@^8.11.0: version "8.12.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.12.0.tgz#d1a0527323e22f53562c567c00991577dfbe19d1" integrity sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA== @@ -12312,16 +9455,6 @@ ajv@^8.0.1: require-from-string "^2.0.2" uri-js "^4.2.2" -ajv@^8.11.0: - version "8.11.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.11.0.tgz#977e91dd96ca669f54a11e23e378e33b884a565f" - integrity sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg== - dependencies: - fast-deep-equal "^3.1.1" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" - uri-js "^4.2.2" - ansi-align@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" @@ -12778,27 +9911,6 @@ axe-core@^4.4.2: resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.4.2.tgz#dcf7fb6dea866166c3eab33d68208afe4d5f670c" integrity sha512-LVAaGp/wkkgYJcjmHsoKx4juT1aQvJyPcW09MLCjVTh3V2cc6PnyempiLMNH5iMdfIX/zdbjUx2KDjMLCTdPeA== -axios@0.21.1: - version "0.21.1" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" - integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA== - dependencies: - follow-redirects "^1.10.0" - -axios@^0.21.1, axios@^0.21.2: - version "0.21.4" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" - integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== - dependencies: - follow-redirects "^1.14.0" - -axios@^0.26.1: - version "0.26.1" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.26.1.tgz#1ede41c51fcf51bbbd6fd43669caaa4f0495aaa9" - integrity sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA== - dependencies: - follow-redirects "^1.14.8" - axios@^0.27.2: version "0.27.2" resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" @@ -12807,25 +9919,7 @@ axios@^0.27.2: follow-redirects "^1.14.9" form-data "^4.0.0" -axios@^1.0.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.2.2.tgz#72681724c6e6a43a9fea860fc558127dbe32f9f1" - integrity sha512-bz/J4gS2S3I7mpN/YZfGFTqhXTYzRho8Ay38w2otuuDR322KzFIWm/4W2K6gIwvWaws5n+mnb7D1lN9uD+QH6Q== - dependencies: - follow-redirects "^1.15.0" - form-data "^4.0.0" - proxy-from-env "^1.1.0" - -axios@^1.4.0: - version "1.6.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.2.tgz#de67d42c755b571d3e698df1b6504cde9b0ee9f2" - integrity sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A== - dependencies: - follow-redirects "^1.15.0" - form-data "^4.0.0" - proxy-from-env "^1.1.0" - -axios@^1.6.0, axios@^1.6.7: +axios@^1.0.0, axios@^1.6.0, axios@^1.6.7: version "1.6.7" resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.7.tgz#7b48c2e27c96f9c68a2f8f31e2ab19f59b06b0a7" integrity sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA== @@ -12924,15 +10018,6 @@ babel-plugin-named-exports-order@^0.0.2: resolved "https://registry.yarnpkg.com/babel-plugin-named-exports-order/-/babel-plugin-named-exports-order-0.0.2.tgz#ae14909521cf9606094a2048239d69847540cb09" integrity sha512-OgOYHOLoRK+/mvXU9imKHlG6GkPLYrUCvFXG/CM93R/aNNO8pOOF4aS+S8CCHMDQoNSeiOYEZb/G6RwL95Jktw== -babel-plugin-polyfill-corejs2@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.1.tgz#440f1b70ccfaabc6b676d196239b138f8a2cfba5" - integrity sha512-v7/T6EQcNfVLfcN2X8Lulb7DjprieyLWJK/zOWH5DUYcAgex9sP3h25Q+DLsX9TloXe3y1O8l2q2Jv9q8UVB9w== - dependencies: - "@babel/compat-data" "^7.13.11" - "@babel/helper-define-polyfill-provider" "^0.3.1" - semver "^6.1.1" - babel-plugin-polyfill-corejs2@^0.3.2: version "0.3.3" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.3.tgz#5d1bd3836d0a19e1b84bbf2d9640ccb6f951c122" @@ -12950,14 +10035,6 @@ babel-plugin-polyfill-corejs3@^0.1.0: "@babel/helper-define-polyfill-provider" "^0.1.5" core-js-compat "^3.8.1" -babel-plugin-polyfill-corejs3@^0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.2.tgz#aabe4b2fa04a6e038b688c5e55d44e78cd3a5f72" - integrity sha512-G3uJih0XWiID451fpeFaYGVuxHEjzKTHtc9uGFEjR6hHrvNzeS/PX+LLLcetJcytsB5m4j+K3o/EpXJNb/5IEQ== - dependencies: - "@babel/helper-define-polyfill-provider" "^0.3.1" - core-js-compat "^3.21.0" - babel-plugin-polyfill-corejs3@^0.5.3: version "0.5.3" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.3.tgz#d7e09c9a899079d71a8b670c6181af56ec19c5c7" @@ -12966,13 +10043,6 @@ babel-plugin-polyfill-corejs3@^0.5.3: "@babel/helper-define-polyfill-provider" "^0.3.2" core-js-compat "^3.21.0" -babel-plugin-polyfill-regenerator@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.1.tgz#2c0678ea47c75c8cc2fbb1852278d8fb68233990" - integrity sha512-Y2B06tvgHYt1x0yz17jGkGeeMr5FeKUu+ASJ+N6nB5lQ8Dapfg42i0OVrf8PNGJ3zKL4A23snMi1IRwrqqND7A== - dependencies: - "@babel/helper-define-polyfill-provider" "^0.3.1" - babel-plugin-polyfill-regenerator@^0.4.0: version "0.4.1" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.1.tgz#390f91c38d90473592ed43351e801a9d3e0fd747" @@ -13103,7 +10173,7 @@ base@^0.11.1: mixin-deep "^1.2.0" pascalcase "^0.1.1" -bech32@1.1.4, bech32@^1.1.3, bech32@^1.1.4: +bech32@1.1.4, bech32@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== @@ -13142,7 +10212,7 @@ bigint-buffer@^1.1.5: dependencies: bindings "^1.3.0" -bignumber.js@9.1.1, bignumber.js@^9.0.1, bignumber.js@^9.1.0: +bignumber.js@9.1.1: version "9.1.1" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.1.tgz#c4df7dc496bd849d4c9464344c1aa74228b4dac6" integrity sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig== @@ -13204,7 +10274,7 @@ bip32@^2.0.6: typeforce "^1.11.5" wif "^2.0.6" -bip39@^3.0.2, bip39@^3.0.3, bip39@^3.0.4: +bip39@^3.0.3: version "3.1.0" resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.1.0.tgz#c55a418deaf48826a6ceb34ac55b3ee1577e18a3" integrity sha512-c9kiwdk45Do5GL0vJMe7tS95VjCii65mYAH7DfWl3uW8AVzXKQVUm64i3hzVybBDMp9r7j9iNxR85+ul8MdN/A== @@ -13229,11 +10299,6 @@ bl@^5.0.0: inherits "^2.0.4" readable-stream "^3.4.0" -blakejs@^1.1.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.2.1.tgz#5057e4206eadb4a97f7c0b6e197a505042fc3814" - integrity sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ== - blob-to-it@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/blob-to-it/-/blob-to-it-1.0.4.tgz#f6caf7a4e90b7bb9215fa6a318ed6bd8ad9898cb" @@ -13260,12 +10325,12 @@ bluebird@^3.5.5: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.0, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.12.0: +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.12.0: version "4.12.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== -bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: +bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.2.0, bn.js@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== @@ -13386,7 +10451,7 @@ browser-readablestream-to-it@^1.0.1, browser-readablestream-to-it@^1.0.2, browse resolved "https://registry.yarnpkg.com/browser-readablestream-to-it/-/browser-readablestream-to-it-1.0.3.tgz#ac3e406c7ee6cdf0a502dd55db33bab97f7fba76" integrity sha512-+12sHB+Br8HIh6VAMVEG5r3UXCyESIgDW7kzk3BjIXa43DVqVwL7GC5TW3jeh+72dtcH99pPVpw0X8i0jt+/kw== -browserify-aes@^1.0.0, browserify-aes@^1.0.4, browserify-aes@^1.2.0: +browserify-aes@^1.0.0, browserify-aes@^1.0.4: version "1.2.0" resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== @@ -13447,27 +10512,7 @@ browserify-zlib@^0.2.0: dependencies: pako "~1.0.5" -browserslist@^4.12.0, browserslist@^4.14.5, browserslist@^4.20.2, browserslist@^4.21.0: - version "4.21.1" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.1.tgz#c9b9b0a54c7607e8dc3e01a0d311727188011a00" - integrity sha512-Nq8MFCSrnJXSc88yliwlzQe3qNe3VntIjhsArW9IJOEPSHNx23FalwApUVbzAWABLhYJJ7y8AynWI/XM8OdfjQ== - dependencies: - caniuse-lite "^1.0.30001359" - electron-to-chromium "^1.4.172" - node-releases "^2.0.5" - update-browserslist-db "^1.0.4" - -browserslist@^4.21.3: - version "4.21.4" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.4.tgz#e7496bbc67b9e39dd0f98565feccdcb0d4ff6987" - integrity sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw== - dependencies: - caniuse-lite "^1.0.30001400" - electron-to-chromium "^1.4.251" - node-releases "^2.0.6" - update-browserslist-db "^1.0.9" - -browserslist@^4.21.9: +browserslist@^4.12.0, browserslist@^4.14.5, browserslist@^4.21.0, browserslist@^4.21.9: version "4.21.10" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.10.tgz#dbbac576628c13d3b2231332cb2ec5a46e015bb0" integrity sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ== @@ -13541,7 +10586,7 @@ buffer@^4.3.0: ieee754 "^1.1.4" isarray "^1.0.0" -buffer@^5.1.0, buffer@^5.5.0: +buffer@^5.5.0: version "5.7.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== @@ -13549,14 +10594,6 @@ buffer@^5.1.0, buffer@^5.5.0: base64-js "^1.3.1" ieee754 "^1.1.13" -buffer@~5.4.3: - version "5.4.3" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.4.3.tgz#3fbc9c69eb713d323e3fc1a895eee0710c072115" - integrity sha512-zvj65TkFeIt3i6aj5bIvJDzjjQQGs4o/sNoezg1F1kYap9Nu2jcUdpwzRSJTHMMzG0H7bZkn4rNQpImhuxWX2A== - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - bufferutil@^4.0.1, bufferutil@^4.0.3: version "4.0.7" resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.7.tgz#60c0d19ba2c992dd8273d3f73772ffc894c153ad" @@ -13705,15 +10742,7 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" -call-bind@^1.0.0, call-bind@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" - integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== - dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.2" - -call-bind@^1.0.5: +call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.5.tgz#6fa2b7845ce0ea49bf4d8b9ef64727a2c2e2e513" integrity sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ== @@ -13777,7 +10806,7 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001359, caniuse-lite@^1.0.30001400, caniuse-lite@^1.0.30001406, caniuse-lite@^1.0.30001517: +caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001406, caniuse-lite@^1.0.30001517: version "1.0.30001570" resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001570.tgz" integrity sha512-+3e0ASu4sw1SWaoCtvPeyXp+5PsjigkSt8OXZbF9StH5pQWbxEjLAZE3n8Aup5udop1uRiKA7a4utUk/uoSpUw== @@ -13818,11 +10847,6 @@ case@1.6.3: resolved "https://registry.yarnpkg.com/case/-/case-1.6.3.tgz#0a4386e3e9825351ca2e6216c60467ff5f1ea1c9" integrity sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ== -cbor-sync@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/cbor-sync/-/cbor-sync-1.0.4.tgz#5a11a1ab75c2a14d1af1b237fd84aa8c1593662f" - integrity sha512-GWlXN4wiz0vdWWXBU71Dvc1q3aBo0HytqwAZnXF1wOwjqNnDWA1vZ1gDMFLlqohak31VQzmhiYfiCX5QSSfagA== - cborg@^1.5.4, cborg@^1.6.0: version "1.9.6" resolved "https://registry.yarnpkg.com/cborg/-/cborg-1.9.6.tgz#bf90de6541d10735db878b60b4af824209b77435" @@ -13838,21 +10862,13 @@ ccount@^2.0.0: resolved "https://registry.yarnpkg.com/ccount/-/ccount-2.0.1.tgz#17a3bf82302e0870d6da43a01311a8bc02a3ecf5" integrity sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg== -chain-registry@^1.19.0: - version "1.19.0" - resolved "https://registry.yarnpkg.com/chain-registry/-/chain-registry-1.19.0.tgz#6d2d56b56efebee0d15ced8f9bd8329a099ce04d" - integrity sha512-7Ax0cRurfS+I0Oru3Td8NqBY/2YRCv570XM555E5vu3ib3f/k5SELwxsSalTtQj+Furx6quEyKWuOjrNwPpcQg== +chain-registry@^1.28.6: + version "1.28.6" + resolved "https://registry.yarnpkg.com/chain-registry/-/chain-registry-1.28.6.tgz#823bded9c70c64b3f4d0d32139cfd19b8fcb004e" + integrity sha512-RO5Ua/8KyuRBzrsGE82lyt04DI1vF20XnWTcVUw56aQEk/BiscoC5/nnqIsdqQkPZTi4gIMoJXrYCYeckc4vlQ== dependencies: "@babel/runtime" "^7.21.0" - "@chain-registry/types" "^0.16.0" - -chain-registry@^1.26.0: - version "1.26.0" - resolved "https://registry.yarnpkg.com/chain-registry/-/chain-registry-1.26.0.tgz#7422ed037bf9cb58c66f9ae00f91726b796977c7" - integrity sha512-GGcB1tHFBvpfBf5HIZ76kko+KvbK8ukG9a0fKNvnjoPRLxz8/7lTNebCCMr1DN/Y6lqpzWjzZRUmjFrUewWmsg== - dependencies: - "@babel/runtime" "^7.21.0" - "@chain-registry/types" "^0.17.1" + "@chain-registry/types" "^0.18.1" chalk@3.0.0: version "3.0.0" @@ -13881,7 +10897,7 @@ chalk@^1.0.0, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.2, chalk@^2.4.1, chalk@^2.4.2: +chalk@^2.0.1, chalk@^2.3.2, chalk@^2.4.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -13976,11 +10992,6 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -charenc@~0.0.1: - version "0.0.2" - resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" - integrity sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA== - chart.js@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/chart.js/-/chart.js-4.4.0.tgz#df843fdd9ec6bd88d7f07e2b95348d221bd2698c" @@ -14052,12 +11063,7 @@ ci-info@^2.0.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== -ci-info@^3.2.0: - version "3.3.2" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.3.2.tgz#6d2967ffa407466481c6c90b6e16b3098f080128" - integrity sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg== - -ci-info@^3.7.0: +ci-info@^3.2.0, ci-info@^3.7.0: version "3.9.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== @@ -14217,12 +11223,7 @@ clone@^1.0.2: resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== -clsx@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.1.1.tgz#98b3134f9abbdf23b2663491ace13c5c03a73188" - integrity sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA== - -clsx@^1.2.1: +clsx@^1.1.1, clsx@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.2.1.tgz#0ddc4a20a549b59c93a4116bb26f5294ca17dc12" integrity sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg== @@ -14393,6 +11394,11 @@ commander@^6.2.0, commander@^6.2.1: resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== +commander@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" + integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== + commander@^8.0.0, commander@^8.3.0: version "8.3.0" resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" @@ -14657,19 +11663,6 @@ copy-to-clipboard@^3.3.1: dependencies: toggle-selection "^1.0.6" -copyfiles@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/copyfiles/-/copyfiles-2.4.1.tgz#d2dcff60aaad1015f09d0b66e7f0f1c5cd3c5da5" - integrity sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg== - dependencies: - glob "^7.0.5" - minimatch "^3.0.3" - mkdirp "^1.0.4" - noms "0.0.0" - through2 "^2.0.1" - untildify "^4.0.0" - yargs "^16.1.0" - core-js-compat@^3.21.0, core-js-compat@^3.22.1, core-js-compat@^3.8.1: version "3.23.3" resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.23.3.tgz#7d8503185be76bb6d8d592c291a4457a8e440aa9" @@ -14733,14 +11726,6 @@ cosmiconfig@^8.1.0, cosmiconfig@^8.1.3: parse-json "^5.2.0" path-type "^4.0.0" -cosmjs-types@^0.7.1: - version "0.7.2" - resolved "https://registry.yarnpkg.com/cosmjs-types/-/cosmjs-types-0.7.2.tgz#a757371abd340949c5bd5d49c6f8379ae1ffd7e2" - integrity sha512-vf2uLyktjr/XVAgEq0DjMxeAWh1yYREe7AMHDKd7EiHVqxBPCaBS+qEEQUkXbR9ndnckqr1sUG8BQhazh4X5lA== - dependencies: - long "^4.0.0" - protobufjs "~6.11.2" - cosmjs-types@^0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/cosmjs-types/-/cosmjs-types-0.8.0.tgz#2ed78f3e990f770229726f95f3ef5bf9e2b6859b" @@ -14784,13 +11769,6 @@ crc-32@^1.2.0: resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.2.tgz#3cad35a934b8bf71f25ca524b6da51fb7eace2ff" integrity sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ== -crc@^3.8.0: - version "3.8.0" - resolved "https://registry.yarnpkg.com/crc/-/crc-3.8.0.tgz#ad60269c2c856f8c299e2c4cc0de4556914056c6" - integrity sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ== - dependencies: - buffer "^5.1.0" - create-ecdh@^4.0.0: version "4.0.4" resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e" @@ -14861,11 +11839,6 @@ cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -crypt@~0.0.1: - version "0.0.2" - resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" - integrity sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow== - crypto-browserify@^3.11.0, crypto-browserify@^3.12.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" @@ -14883,7 +11856,7 @@ crypto-browserify@^3.11.0, crypto-browserify@^3.12.0: randombytes "^2.0.0" randomfill "^1.0.3" -crypto-js@^4.0.0, crypto-js@^4.1.1: +crypto-js@^4.0.0: version "4.1.1" resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.1.1.tgz#9e485bcf03521041bd85844786b83fb7619736cf" integrity sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw== @@ -14959,12 +11932,7 @@ cssesc@^3.0.0: resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== -csstype@^3.0.2, csstype@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.0.tgz#4ddcac3718d787cf9df0d1b7d15033925c8f29f2" - integrity sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA== - -csstype@^3.1.2: +csstype@^3.0.2, csstype@^3.1.0, csstype@^3.1.2: version "3.1.3" resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81" integrity sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw== @@ -14976,11 +11944,6 @@ currently-unhandled@^0.4.1: dependencies: array-find-index "^1.0.1" -curve25519-js@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/curve25519-js/-/curve25519-js-0.0.4.tgz#e6ad967e8cd284590d657bbfc90d8b50e49ba060" - integrity sha512-axn2UMEnkhyDUPWOwVKBMVIzSQy2ejH2xRGy1wq81dqRwApXfIzfbE3hIX0ZRFBIihf/KDqK158DLwESu4AK1w== - cyclist@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" @@ -15026,7 +11989,7 @@ dateformat@^3.0.0: resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== -debounce@^1.2.0: +debounce@^1.2.0, debounce@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.2.1.tgz#38881d8f4166a5c5848020c11827b834bcb3e0a5" integrity sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug== @@ -15082,12 +12045,7 @@ decode-named-character-reference@^1.0.0: dependencies: character-entities "^2.0.0" -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og== - -decode-uri-component@^0.2.2: +decode-uri-component@^0.2.0, decode-uri-component@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== @@ -15114,21 +12072,16 @@ deep-is@^0.1.3, deep-is@~0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== -deepmerge@4.2.2, deepmerge@^4.2.2: +deepmerge@4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== -deepmerge@4.3.1: +deepmerge@4.3.1, deepmerge@^4.0.0, deepmerge@^4.2.2: version "4.3.1" resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== -deepmerge@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.0.tgz#65491893ec47756d44719ae520e0e2609233b59b" - integrity sha512-z2wJZXrmeHdvYJp/Ux55wIjqo81G5Bp4c+oELTW+7ar6SogWHajt5a9gO3s3IDaGSAXjDk0vlQKN3rms8ab3og== - default-browser-id@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/default-browser-id/-/default-browser-id-1.0.4.tgz#e59d09a5d157b828b876c26816e61c3d2a2c203a" @@ -15159,15 +12112,7 @@ define-lazy-prop@^2.0.0: resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og== -define-properties@^1.1.2, define-properties@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.4.tgz#0b14d7bd7fbeb2f3572c3a7eda80ea5d57fb05b1" - integrity sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA== - dependencies: - has-property-descriptors "^1.0.0" - object-keys "^1.1.1" - -define-properties@^1.1.3: +define-properties@^1.1.2, define-properties@^1.1.3, define-properties@^1.1.4: version "1.2.0" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.0.tgz#52988570670c9eacedd8064f4a990f2405849bd5" integrity sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA== @@ -15237,12 +12182,7 @@ deprecation@^2.0.0, deprecation@^2.3.1: resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== -dequal@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.2.tgz#85ca22025e3a87e65ef75a7a437b35284a7e319d" - integrity sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug== - -dequal@^2.0.2: +dequal@^2.0.0, dequal@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be" integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA== @@ -15342,11 +12282,6 @@ didyoumean@^1.2.2: resolved "https://registry.yarnpkg.com/didyoumean/-/didyoumean-1.2.2.tgz#989346ffe9e839b4555ecf5666edea0d3e8ad037" integrity sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw== -diff-sequences@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.3.1.tgz#104b5b95fe725932421a9c6e5b4bef84c3f2249e" - integrity sha512-hlM3QR272NXCi4pq+N4Kok4kOp6EsgOM3ZSpJI7Da3UAs+Ttsi8MRmB6trM/lhyzUxGfOgnpkHtgqm5Q/CTcfQ== - diff-sequences@^29.4.3: version "29.4.3" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.4.3.tgz#9314bc1fabe09267ffeca9cbafc457d8499a13f2" @@ -15609,22 +12544,12 @@ electron-fetch@^1.7.2: dependencies: encoding "^0.1.13" -electron-to-chromium@^1.4.172: - version "1.4.174" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.174.tgz#ffdf57f26dd4558c5aabdb4b190c47af1c4e443b" - integrity sha512-JER+w+9MV2MBVFOXxP036bLlNOnzbYAWrWU8sNUwoOO69T3w4564WhM5H5atd8VVS8U4vpi0i0kdoYzm1NPQgQ== - -electron-to-chromium@^1.4.251: - version "1.4.284" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz#61046d1e4cab3a25238f6bf7413795270f125592" - integrity sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA== - electron-to-chromium@^1.4.477: version "1.4.490" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.490.tgz#d99286f6e915667fa18ea4554def1aa60eb4d5f1" integrity sha512-6s7NVJz+sATdYnIwhdshx/N/9O6rvMxmhVoDSDFdj6iA45gHR8EQje70+RYsF4GeB+k0IeNSBnP7yG9ZXJFr7A== -elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.3, elliptic@^6.5.4: +elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.3, elliptic@^6.5.4: version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== @@ -15720,7 +12645,7 @@ enhanced-resolve@^4.5.0: memory-fs "^0.5.0" tapable "^1.0.0" -enhanced-resolve@^5.10.0, enhanced-resolve@^5.7.0, enhanced-resolve@^5.9.3: +enhanced-resolve@^5.10.0, enhanced-resolve@^5.7.0: version "5.10.0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz#0dc579c3bb2a1032e357ac45b8f3a6f3ad4fb1e6" integrity sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ== @@ -16185,12 +13110,7 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-visitor-keys@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" - integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== - -eslint-visitor-keys@^3.4.1: +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: version "3.4.3" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== @@ -16314,27 +13234,6 @@ eth-rpc-errors@^4.0.2, eth-rpc-errors@^4.0.3: dependencies: fast-safe-stringify "^2.0.6" -ethereum-cryptography@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz#8d6143cfc3d74bf79bbd8edecdf29e4ae20dd191" - integrity sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ== - dependencies: - "@types/pbkdf2" "^3.0.0" - "@types/secp256k1" "^4.0.1" - blakejs "^1.1.0" - browserify-aes "^1.2.0" - bs58check "^2.1.2" - create-hash "^1.2.0" - create-hmac "^1.1.7" - hash.js "^1.1.7" - keccak "^3.0.0" - pbkdf2 "^3.0.17" - randombytes "^2.1.0" - safe-buffer "^5.1.2" - scrypt-js "^3.0.0" - secp256k1 "^4.0.1" - setimmediate "^1.0.5" - ethereum-cryptography@^2.0.0, ethereum-cryptography@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-2.1.2.tgz#18fa7108622e56481157a5cb7c01c0c6a672eb67" @@ -16345,38 +13244,6 @@ ethereum-cryptography@^2.0.0, ethereum-cryptography@^2.1.2: "@scure/bip32" "1.3.1" "@scure/bip39" "1.2.1" -ethereumjs-abi@^0.6.8: - version "0.6.8" - resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae" - integrity sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA== - dependencies: - bn.js "^4.11.8" - ethereumjs-util "^6.0.0" - -ethereumjs-util@^6.0.0, ethereumjs-util@^6.2.1: - version "6.2.1" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz#fcb4e4dd5ceacb9d2305426ab1a5cd93e3163b69" - integrity sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw== - dependencies: - "@types/bn.js" "^4.11.3" - bn.js "^4.11.0" - create-hash "^1.1.2" - elliptic "^6.5.2" - ethereum-cryptography "^0.1.3" - ethjs-util "0.1.6" - rlp "^2.2.3" - -ethereumjs-util@^7.0.8, ethereumjs-util@^7.1.4, ethereumjs-util@^7.1.5: - version "7.1.5" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz#9ecf04861e4fbbeed7465ece5f23317ad1129181" - integrity sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg== - dependencies: - "@types/bn.js" "^5.1.0" - bn.js "^5.1.2" - create-hash "^1.1.2" - ethereum-cryptography "^0.1.3" - rlp "^2.2.4" - ethers@^5.7.2: version "5.7.2" resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" @@ -16413,7 +13280,7 @@ ethers@^5.7.2: "@ethersproject/web" "5.7.1" "@ethersproject/wordlists" "5.7.0" -ethjs-util@0.1.6, ethjs-util@^0.1.6: +ethjs-util@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w== @@ -16485,11 +13352,6 @@ execa@^5.0.0, execa@^5.1.1: signal-exit "^3.0.3" strip-final-newline "^2.0.0" -exenv@^1.2.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/exenv/-/exenv-1.2.2.tgz#2ae78e85d9894158670b03d47bec1f03bd91bb9d" - integrity sha512-Z+ktTxTwv9ILfgKCk32OX3n/doe+OcLTRtqK9pcL+JsP3J1/VW8Uvl4ZjLlKqeW4rzK4oesDOGMEMRIZqtP4Iw== - exit@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" @@ -16513,18 +13375,7 @@ expand-template@^2.0.3: resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c" integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg== -expect@^29.0.0: - version "29.3.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.3.1.tgz#92877aad3f7deefc2e3f6430dd195b92295554a6" - integrity sha512-gGb1yTgU30Q0O/tQq+z30KBWv24ApkMgFUpvKBkyLUBL68Wv8dHdJxTBZFl/iT8K/bqDHvUYRH6IIN3rToopPA== - dependencies: - "@jest/expect-utils" "^29.3.1" - jest-get-type "^29.2.0" - jest-matcher-utils "^29.3.1" - jest-message-util "^29.3.1" - jest-util "^29.3.1" - -expect@^29.5.0: +expect@^29.0.0, expect@^29.5.0: version "29.5.0" resolved "https://registry.yarnpkg.com/expect/-/expect-29.5.0.tgz#68c0509156cb2a0adb8865d413b137eeaae682f7" integrity sha512-yM7xqUrCO2JdpFo4XpM82t+PJBFybdqoQuJLDGeDX2ij8NZzqRHyu3Hp188/JX7SWqud+7t4MUdvcgGBICMHZg== @@ -16648,21 +13499,11 @@ eyes@^0.1.8: resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" integrity sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ== -faker@^6.6.6: - version "6.6.6" - resolved "https://registry.yarnpkg.com/faker/-/faker-6.6.6.tgz#e9529da0109dca4c7c5dbfeaadbd9234af943033" - integrity sha512-9tCqYEDHI5RYFQigXFwF1hnCwcWCOJl/hmll0lr5D2Ljjb0o4wphb69wikeJDz5qCEzXCoPvG6ss5SDP6IfOdg== - fast-decode-uri-component@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz#46f8b6c22b30ff7a81357d4f59abfae938202543" integrity sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg== -fast-deep-equal@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" - integrity sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA== - fast-deep-equal@^3.0.0, fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -16696,34 +13537,12 @@ fast-glob@^2.2.6: dependencies: "@mrmlnc/readdir-enhanced" "^2.2.1" "@nodelib/fs.stat" "^1.1.2" - glob-parent "^3.1.0" - is-glob "^4.0.0" - merge2 "^1.2.3" - micromatch "^3.1.10" - -fast-glob@^3.2.11, fast-glob@^3.2.9: - version "3.2.11" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9" - integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - -fast-glob@^3.2.12, fast-glob@^3.2.5: - version "3.2.12" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" - integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" + glob-parent "^3.1.0" + is-glob "^4.0.0" + merge2 "^1.2.3" + micromatch "^3.1.10" -fast-glob@^3.3.0: +fast-glob@^3.2.11, fast-glob@^3.2.12, fast-glob@^3.2.5, fast-glob@^3.2.9, fast-glob@^3.3.0: version "3.3.2" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== @@ -17040,17 +13859,7 @@ fn.name@1.x.x: resolved "https://registry.yarnpkg.com/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc" integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== -follow-redirects@^1.10.0, follow-redirects@^1.14.9, follow-redirects@^1.15.0: - version "1.15.2" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" - integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== - -follow-redirects@^1.14.0, follow-redirects@^1.14.8: - version "1.15.1" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.1.tgz#0ca6a452306c9b276e4d3127483e29575e207ad5" - integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA== - -follow-redirects@^1.15.4: +follow-redirects@^1.14.9, 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== @@ -17241,12 +14050,7 @@ fsevents@^2.1.2, fsevents@^2.3.2, fsevents@~2.3.2: resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -function-bind@^1.1.2: +function-bind@^1.1.1, function-bind@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== @@ -17315,26 +14119,7 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3: - version "1.2.1" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.1.tgz#d295644fed4505fc9cde952c37ee12b477a83d82" - integrity sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-proto "^1.0.1" - has-symbols "^1.0.3" - -get-intrinsic@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.2.tgz#336975123e05ad0b7ba41f152ee4aadbea6cf598" - integrity sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.3" - -get-intrinsic@^1.2.1: +get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.2.tgz#281b7622971123e1ef4b3c90fd7539306da93f3b" integrity sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA== @@ -17533,7 +14318,7 @@ glob@7.1.7: once "^1.3.0" path-is-absolute "^1.0.0" -glob@8.0.3, glob@^8.0.1: +glob@8.0.3: version "8.0.3" resolved "https://registry.yarnpkg.com/glob/-/glob-8.0.3.tgz#415c6eb2deed9e502c68fa44a272e6da6eeca42e" integrity sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ== @@ -17544,18 +14329,7 @@ glob@8.0.3, glob@^8.0.1: minimatch "^5.0.1" once "^1.3.0" -glob@^10.0.0: - version "10.3.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-10.3.3.tgz#8360a4ffdd6ed90df84aa8d52f21f452e86a123b" - integrity sha512-92vPiMb/iqpmEgsOoIDvTjc50wf9CCCvMzsi6W0JLPeUKE8TWP1a73PgqSrqy7iAZxaSD1YdzU7QZR5LF51MJw== - dependencies: - foreground-child "^3.1.0" - jackspeak "^2.0.3" - minimatch "^9.0.1" - minipass "^5.0.0 || ^6.0.2 || ^7.0.0" - path-scurry "^1.10.1" - -glob@^10.3.10: +glob@^10.0.0, glob@^10.3.10: version "10.3.10" resolved "https://registry.yarnpkg.com/glob/-/glob-10.3.10.tgz#0351ebb809fd187fe421ab96af83d3a70715df4b" integrity sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g== @@ -17566,7 +14340,7 @@ glob@^10.3.10: minipass "^5.0.0 || ^6.0.2 || ^7.0.0" path-scurry "^1.10.1" -glob@^7.0.0, glob@^7.0.5, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.2.0: +glob@^7.0.0, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.2.0: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== @@ -17578,7 +14352,7 @@ glob@^7.0.0, glob@^7.0.5, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, gl once "^1.3.0" path-is-absolute "^1.0.0" -glob@^8.0.3, glob@^8.1.0: +glob@^8.0.1, glob@^8.0.3, glob@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== @@ -17647,7 +14421,7 @@ goober@^2.1.1: resolved "https://registry.yarnpkg.com/goober/-/goober-2.1.10.tgz#058def43ba1e3b06f973dbb372a4978aa42f1049" integrity sha512-7PpuQMH10jaTWm33sQgBQvz45pHR8N4l3Cu3WMGEWmHShAcTuuP7I+5/DwKo39fwti5A80WAjvqgz6SSlgWmGA== -google-protobuf@^3.14.0, google-protobuf@^3.17.3, google-protobuf@^3.21.0: +google-protobuf@^3.17.3: version "3.21.2" resolved "https://registry.yarnpkg.com/google-protobuf/-/google-protobuf-3.21.2.tgz#4580a2bea8bbb291ee579d1fefb14d6fa3070ea4" integrity sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA== @@ -17711,7 +14485,7 @@ graphql-ws@^5.14.0: resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.14.2.tgz#7db6f6138717a544d9480f0213f65f2841ed1c52" integrity sha512-LycmCwhZ+Op2GlHz4BZDsUYHKRiiUz+3r9wbhBATMETNlORQJAaFlAgTFoeRh6xQoQegwYwIylVD1Qns9/DA3w== -graphql@^16.3.0, graphql@^16.8.1: +graphql@^16.8.1: version "16.8.1" resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.8.1.tgz#1930a965bef1170603702acdb68aedd3f3cf6f07" integrity sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw== @@ -17863,7 +14637,7 @@ hash-base@^3.0.0: readable-stream "^3.6.0" safe-buffer "^5.2.0" -hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7, hash.js@~1.1.7: +hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3: version "1.1.7" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== @@ -17958,16 +14732,6 @@ hastscript@^6.0.0: property-information "^5.0.0" space-separated-tokens "^1.0.0" -hdkey@^2.0.1: - version "2.1.0" - resolved "https://registry.yarnpkg.com/hdkey/-/hdkey-2.1.0.tgz#755b30b73f54e93c31919c1b2f19205a8e57cb92" - integrity sha512-i9Wzi0Dy49bNS4tXXeGeu0vIcn86xXdPQUpEYg+SO1YiO8HtomjmmRMaRyqL0r59QfcD4PfVbSF3qmsWFwAemA== - dependencies: - bs58check "^2.1.2" - ripemd160 "^2.0.2" - safe-buffer "^5.1.1" - secp256k1 "^4.0.0" - he@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" @@ -18041,7 +14805,7 @@ html-entities@^2.1.0: resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-2.3.3.tgz#117d7626bece327fc8baace8868fa6f5ef856e46" integrity sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA== -html-escaper@^2.0.0: +html-escaper@^2.0.0, html-escaper@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== @@ -18199,11 +14963,6 @@ http-proxy-agent@^7.0.0: agent-base "^7.1.0" debug "^4.3.4" -http-status-codes@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/http-status-codes/-/http-status-codes-2.3.0.tgz#987fefb28c69f92a43aecc77feec2866349a8bfc" - integrity sha512-RJ8XvFvpPM/Dmc5SV+dC4y5PCeOhT3x1Hq0NU3rjGeg5a/CqlhZ7uudknPwZFz4aeAXDcbAyaeP7GAo9lvngtA== - https-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" @@ -18332,17 +15091,7 @@ ignore@^4.0.3: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -ignore@^5.0.4: - version "5.2.4" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" - integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== - -ignore@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" - integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== - -ignore@^5.2.4: +ignore@^5.0.4, ignore@^5.2.0, ignore@^5.2.4: version "5.3.0" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.0.tgz#67418ae40d34d6999c95ff56016759c718c82f78" integrity sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg== @@ -18518,7 +15267,7 @@ inquirer@^6.0.0: strip-ansi "^5.1.0" through "^2.3.6" -inquirer@^8.0.0: +inquirer@^8.0.0, inquirer@^8.2.4: version "8.2.6" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-8.2.6.tgz#733b74888195d8d400a67ac332011b5fae5ea562" integrity sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg== @@ -18539,27 +15288,6 @@ inquirer@^8.0.0: through "^2.3.6" wrap-ansi "^6.0.1" -inquirer@^8.2.4: - version "8.2.5" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-8.2.5.tgz#d8654a7542c35a9b9e069d27e2df4858784d54f8" - integrity sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ== - dependencies: - ansi-escapes "^4.2.1" - chalk "^4.1.1" - cli-cursor "^3.1.0" - cli-width "^3.0.0" - external-editor "^3.0.3" - figures "^3.0.0" - lodash "^4.17.21" - mute-stream "0.0.8" - ora "^5.4.1" - run-async "^2.4.0" - rxjs "^7.5.5" - string-width "^4.1.0" - strip-ansi "^6.0.0" - through "^2.3.6" - wrap-ansi "^7.0.0" - inquirerer@0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/inquirerer/-/inquirerer-0.1.3.tgz#ecf91dc672b3bf45211d7f64bf5e8d5e171fd2ad" @@ -18624,7 +15352,7 @@ intl-messageformat-parser@^5.4.0: dependencies: "@formatjs/intl-numberformat" "^5.5.2" -invariant@2, invariant@^2.2.4: +invariant@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== @@ -18865,7 +15593,7 @@ is-boolean-object@^1.1.0: call-bind "^1.0.2" has-tostringtag "^1.0.0" -is-buffer@^1.1.5, is-buffer@~1.1.1: +is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== @@ -18875,16 +15603,11 @@ is-buffer@^2.0.0: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== -is-callable@^1.1.3: +is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.4: version "1.2.7" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== -is-callable@^1.1.4, is-callable@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" - integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== - is-ci@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" @@ -18892,27 +15615,13 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" -is-core-module@^2.13.0: +is-core-module@^2.13.0, is-core-module@^2.5.0, is-core-module@^2.8.1, is-core-module@^2.9.0: version "2.13.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.0.tgz#bb52aa6e2cbd49a30c2ba68c42bf3435ba6072db" integrity sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ== dependencies: has "^1.0.3" -is-core-module@^2.5.0: - version "2.11.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" - integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== - dependencies: - has "^1.0.3" - -is-core-module@^2.8.1, is-core-module@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.9.0.tgz#e1c34429cd51c6dd9e09e0799e396e27b19a9c69" - integrity sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A== - dependencies: - has "^1.0.3" - is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" @@ -19303,11 +16012,6 @@ is-wsl@^2.1.1, is-wsl@^2.2.0: dependencies: is-docker "^2.0.0" -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ== - isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -19363,11 +16067,6 @@ isomorphic-ws@^4.0.1: resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc" integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w== -isows@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/isows/-/isows-1.0.3.tgz#93c1cf0575daf56e7120bab5c8c448b0809d0d74" - integrity sha512-2cKei4vlmg2cxEjm3wVSqn8pcoRF/LX/wpifuuNquFO4SQmPwarClT+SUCA2lt+l581tTeZIPIZuIDo2jWN1fg== - istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" @@ -19500,15 +16199,6 @@ iterate-value@^1.0.2: es-get-iterator "^1.0.2" iterate-iterator "^1.0.1" -jackspeak@^2.0.3: - version "2.2.3" - resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.2.3.tgz#ac63c57c18d254dc78a1f4ecd1cdeb4daeb6e616" - integrity sha512-pF0kfjmg8DJLxDrizHoCZGUFz4P4czQ3HyfW4BU0ffebYkzAVlBywp5zaxW/TM+r0sGbmrQdi8EQQVTJFxnGsQ== - dependencies: - "@isaacs/cliui" "^8.0.2" - optionalDependencies: - "@pkgjs/parseargs" "^0.11.0" - jackspeak@^2.3.5: version "2.3.6" resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.3.6.tgz#647ecc472238aee4b06ac0e461acc21a8c505ca8" @@ -19528,25 +16218,6 @@ jake@^10.8.5: filelist "^1.0.1" minimatch "^3.0.4" -jayson@^3.4.4: - version "3.7.0" - resolved "https://registry.yarnpkg.com/jayson/-/jayson-3.7.0.tgz#b735b12d06d348639ae8230d7a1e2916cb078f25" - integrity sha512-tfy39KJMrrXJ+mFcMpxwBvFDetS8LAID93+rycFglIQM4kl3uNR3W4lBLE/FFhsoUCEox5Dt2adVpDm/XtebbQ== - dependencies: - "@types/connect" "^3.4.33" - "@types/node" "^12.12.54" - "@types/ws" "^7.4.4" - JSONStream "^1.3.5" - commander "^2.20.3" - delay "^5.0.0" - es6-promisify "^5.0.0" - eyes "^0.1.8" - isomorphic-ws "^4.0.1" - json-stringify-safe "^5.0.1" - lodash "^4.17.20" - uuid "^8.3.2" - ws "^7.4.5" - jayson@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/jayson/-/jayson-4.1.0.tgz#60dc946a85197317f2b1439d672a8b0a99cea2f9" @@ -19655,16 +16326,6 @@ jest-diff@^22.0.3: jest-get-type "^22.4.3" pretty-format "^22.4.3" -jest-diff@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.3.1.tgz#d8215b72fed8f1e647aed2cae6c752a89e757527" - integrity sha512-vU8vyiO7568tmin2lA3r2DP8oRvzhvRcD4DjpXc6uGveQodyk7CKLhQlCSiwgx3g0pFaE88/KLZ0yaTWMc4Uiw== - dependencies: - chalk "^4.0.0" - diff-sequences "^29.3.1" - jest-get-type "^29.2.0" - pretty-format "^29.3.1" - jest-diff@^29.5.0: version "29.5.0" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.5.0.tgz#e0d83a58eb5451dcc1fa61b1c3ee4e8f5a290d63" @@ -19710,11 +16371,6 @@ jest-get-type@^22.4.3: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.4.3.tgz#e3a8504d8479342dd4420236b322869f18900ce4" integrity sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w== -jest-get-type@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.2.0.tgz#726646f927ef61d583a3b3adb1ab13f3a5036408" - integrity sha512-uXNJlg8hKFEnDgFsrCjznB+sTxdkuqiCL6zMgA75qEbAJjJYTs9XPrvDctrEig2GDow22T/LvHgO57iJhXB/UA== - jest-get-type@^29.4.3: version "29.4.3" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.4.3.tgz#1ab7a5207c995161100b5187159ca82dd48b3dd5" @@ -19787,16 +16443,6 @@ jest-leak-detector@^29.5.0: jest-get-type "^29.4.3" pretty-format "^29.5.0" -jest-matcher-utils@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.3.1.tgz#6e7f53512f80e817dfa148672bd2d5d04914a572" - integrity sha512-fkRMZUAScup3txIKfMe3AIZZmPEjWEdsPJFK3AIy5qRohWqQFg1qrmKfYXR9qEkNc7OdAu2N4KPHibEmy4HPeQ== - dependencies: - chalk "^4.0.0" - jest-diff "^29.3.1" - jest-get-type "^29.2.0" - pretty-format "^29.3.1" - jest-matcher-utils@^29.5.0: version "29.5.0" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.5.0.tgz#d957af7f8c0692c5453666705621ad4abc2c59c5" @@ -19807,21 +16453,6 @@ jest-matcher-utils@^29.5.0: jest-get-type "^29.4.3" pretty-format "^29.5.0" -jest-message-util@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.3.1.tgz#37bc5c468dfe5120712053dd03faf0f053bd6adb" - integrity sha512-lMJTbgNcDm5z+6KDxWtqOFWlGQxD6XaYwBqHR8kmpkP+WWWG90I35kdtQHY67Ay5CSuydkTBbJG+tH9JShFCyA== - dependencies: - "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.3.1" - "@types/stack-utils" "^2.0.0" - chalk "^4.0.0" - graceful-fs "^4.2.9" - micromatch "^4.0.4" - pretty-format "^29.3.1" - slash "^3.0.0" - stack-utils "^2.0.3" - jest-message-util@^29.5.0: version "29.5.0" resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.5.0.tgz#1f776cac3aca332ab8dd2e3b41625435085c900e" @@ -20005,19 +16636,7 @@ jest-util@^28.1.3: graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-util@^29.0.0, jest-util@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.3.1.tgz#1dda51e378bbcb7e3bc9d8ab651445591ed373e1" - integrity sha512-7YOVZaiX7RJLv76ZfHt4nbNEzzTRiMW/IiOG7ZOKmTXmoGBxUDefgMAxQubu6WPVqP5zSzAdZG0FfLcC7HOIFQ== - dependencies: - "@jest/types" "^29.3.1" - "@types/node" "*" - chalk "^4.0.0" - ci-info "^3.2.0" - graceful-fs "^4.2.9" - picomatch "^2.2.3" - -jest-util@^29.5.0: +jest-util@^29.0.0, jest-util@^29.5.0: version "29.5.0" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.5.0.tgz#24a4d3d92fc39ce90425311b23c27a6e0ef16b8f" integrity sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ== @@ -20107,17 +16726,6 @@ jiti@^1.17.1, jiti@^1.18.2, jiti@^1.19.1: resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.21.0.tgz#7c97f8fe045724e136a397f7340475244156105d" integrity sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q== -joi@^17.5.0: - version "17.6.0" - resolved "https://registry.yarnpkg.com/joi/-/joi-17.6.0.tgz#0bb54f2f006c09a96e75ce687957bd04290054b2" - integrity sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw== - dependencies: - "@hapi/hoek" "^9.0.0" - "@hapi/topo" "^5.0.0" - "@sideway/address" "^4.1.3" - "@sideway/formula" "^3.0.0" - "@sideway/pinpoint" "^2.0.0" - jose@^5.0.0: version "5.1.1" resolved "https://registry.yarnpkg.com/jose/-/jose-5.1.1.tgz#d61b923baa6bdeb01040afae8295a084c4b9eb58" @@ -20138,58 +16746,12 @@ js-cookie@^2.2.1: resolved "https://registry.yarnpkg.com/js-cookie/-/js-cookie-2.2.1.tgz#69e106dc5d5806894562902aa5baec3744e9b2b8" integrity sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ== -js-crypto-env@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/js-crypto-env/-/js-crypto-env-0.3.2.tgz#02195723469da14449338ca2789fd7ff6784c533" - integrity sha512-F1uHiCkSOo36qBuuZABA4sBf+xeFBzhJZ0Sd7af8FAruszIhm1Xxv+Zr5Ne90Zlh7/fnxCsrdkj0N8f0a3lVlQ== - -js-crypto-hash@^0.6.3: - version "0.6.3" - resolved "https://registry.yarnpkg.com/js-crypto-hash/-/js-crypto-hash-0.6.3.tgz#748e3e1853f69dad714636db3290736825506641" - integrity sha512-SG8c9tM8y3sUb4k7WvpVfu5vU7zfPvX+eaYR5578TvehkehdaQbqAc+y+1FwxnqQ3WZ0gsYoOKp/mW+mqtNoWA== - dependencies: - buffer "~5.4.3" - hash.js "~1.1.7" - js-crypto-env "^0.3.2" - md5 "~2.2.1" - sha3 "~2.1.0" - -js-crypto-hkdf@0.7.3: - version "0.7.3" - resolved "https://registry.yarnpkg.com/js-crypto-hkdf/-/js-crypto-hkdf-0.7.3.tgz#537c394a2e65bca80032daa07d2ffe7e4f78d32f" - integrity sha512-eAaVArAjS2GCacWGXY4hjBiexrLQYlI0PMOcbwtrSEj84XU3kUfMYZm9bpTyaTXgdHC/eQoXe/Of6biG+RSEaQ== - dependencies: - js-crypto-env "^0.3.2" - js-crypto-hmac "^0.6.3" - js-crypto-random "^0.4.3" - js-encoding-utils "0.5.6" - -js-crypto-hmac@^0.6.3: - version "0.6.3" - resolved "https://registry.yarnpkg.com/js-crypto-hmac/-/js-crypto-hmac-0.6.3.tgz#c33352c1ee6076b17b8f4cb0e2167814b2b77d6d" - integrity sha512-T0pKOaHACOSG6Xs6/06G8RDDeZouQwIQNBq9L/zoUGsd4F67gAjpT3q2lGigAGpUd1hiyy7vnhvLpz7VDt6DbA== - dependencies: - js-crypto-env "^0.3.2" - js-crypto-hash "^0.6.3" - -js-crypto-random@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/js-crypto-random/-/js-crypto-random-0.4.3.tgz#898c2d91991eead02b4e461005e878fa9827fd74" - integrity sha512-C3gzphPPfw9jfQ9Q/LjhJMZxQNp3AaoVRDvyZkiB+zYltfs8tKQPsskWkXACpg1Nzh01PtSRUvVijjptd2qGHQ== - dependencies: - js-crypto-env "^0.3.2" - -js-encoding-utils@0.5.6: - version "0.5.6" - resolved "https://registry.yarnpkg.com/js-encoding-utils/-/js-encoding-utils-0.5.6.tgz#517351d8f4a85b2ad121183d41df8319981bee03" - integrity sha512-qnAGsUIWrmzh5n+3AXqbxX1KsB9hkQmJZf3aA9DLAS7GpL/NEHCBreFFbW+imramoU+Q0TDyvkwhRbBRH1TVkg== - js-sdsl@^4.1.4: version "4.1.4" resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.1.4.tgz#78793c90f80e8430b7d8dc94515b6c77d98a26a6" integrity sha512-Y2/yD55y5jteOAmY50JbUZYwk3CP3wnLPEZnlR1w9oKhITrBEtAxwuWKebFf8hMrPMgbYwFoWK/lH2sBkErELw== -js-sha3@0.8.0, js-sha3@^0.8.0: +js-sha3@0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== @@ -20226,12 +16788,7 @@ js-yaml@^3.10.0, js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" -jsbi@^3.1.5: - version "3.2.5" - resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-3.2.5.tgz#b37bb90e0e5c2814c1c2a1bcd8c729888a2e37d6" - integrity sha512-aBE4n43IPvjaddScbvWRA2YlTzKEynHzu7MqOyTipdHucf/VxS63ViCjxYRg86M8Rxwbt/GfzHl1kKERkt45fQ== - -jscrypto@^1.0.1, jscrypto@^1.0.3: +jscrypto@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/jscrypto/-/jscrypto-1.0.3.tgz#598febca2a939d6f679c54f56e1fe364cef30cc9" integrity sha512-lryZl0flhodv4SZHOqyb1bx5sKcJxj0VBo0Kzb4QMAg3L021IC9uGpl0RCZa+9KJwlRGSK2C80ITcwbe19OKLQ== @@ -20292,7 +16849,7 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== -json-stable-stringify@^1.0.1: +json-stable-stringify@^1.0.1, json-stable-stringify@^1.0.2: version "1.1.0" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.1.0.tgz#43d39c7c8da34bfaf785a61a56808b0def9f747d" integrity sha512-zfA+5SuwYN2VWqN1/5HZaDzQKLJHaBVMZIIM+wuYjdptkaQsqzDdqjqf+lZZJUuJq1aanHiY8LhH8LmH+qBYJA== @@ -20302,13 +16859,6 @@ json-stable-stringify@^1.0.1: jsonify "^0.0.1" object-keys "^1.1.1" -json-stable-stringify@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.2.tgz#e06f23128e0bbe342dc996ed5a19e28b57b580e0" - integrity sha512-eunSSaEnxV12z+Z73y/j5N37/In40GK4GmsSy+tEHJMxknvqnA7/djeYtAgW0GsWHUfg+847WJjKaEylk2y09g== - dependencies: - jsonify "^0.0.1" - json-stringify-nice@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/json-stringify-nice/-/json-stringify-nice-1.1.4.tgz#2c937962b80181d3f317dd39aa323e14f5a60a67" @@ -20334,12 +16884,7 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" -json5@^2.1.2, json5@^2.1.3, json5@^2.2.0, json5@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" - integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== - -json5@^2.2.2, json5@^2.2.3: +json5@^2.1.2, json5@^2.1.3, json5@^2.2.0, json5@^2.2.1, json5@^2.2.2, json5@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== @@ -20376,16 +16921,11 @@ jsonparse@^1.2.0, jsonparse@^1.3.1: resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== -jsonschema@^1.4.0, jsonschema@^1.4.1: +jsonschema@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/jsonschema/-/jsonschema-1.4.1.tgz#cc4c3f0077fb4542982973d8a083b6b34f482dab" integrity sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ== -jsqr@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/jsqr/-/jsqr-1.4.0.tgz#8efb8d0a7cc6863cb6d95116b9069123ce9eb2d1" - integrity sha512-dxLob7q65Xg2DvstYkRpkYtmKm2sPJ9oFhrhmudT1dZvNFFTlroai3AWSpLey/w5vMcLBXRgOJsbXpdN9HzU/A== - "jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.1.tgz#a3e0f1cb7e230954eab4dcbce9f6288a78f8ba44" @@ -20423,7 +16963,7 @@ keccak256@^1.0.6: buffer "^6.0.3" keccak "^3.0.2" -keccak@^3.0.0, keccak@^3.0.2, keccak@^3.0.3: +keccak@^3.0.2, keccak@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.3.tgz#4bc35ad917be1ef54ff246f904c2bbbf9ac61276" integrity sha512-JZrLIAJWuZxKbCilMpNz5Vj7Vtb4scDG3dMXLOsbzBmQGyjwE61BbW7bJkfKKCShXiQZt3T6sBgALRtmd+nZaQ== @@ -20601,18 +17141,6 @@ libsodium-wrappers-sumo@^0.7.11: dependencies: libsodium-sumo "^0.7.11" -libsodium-wrappers@^0.7.6: - version "0.7.11" - resolved "https://registry.yarnpkg.com/libsodium-wrappers/-/libsodium-wrappers-0.7.11.tgz#53bd20606dffcc54ea2122133c7da38218f575f7" - integrity sha512-SrcLtXj7BM19vUKtQuyQKiQCRJPgbpauzl3s0rSwD+60wtHqSUuqcoawlMDheCJga85nKOQwxNYQxf/CKAvs6Q== - dependencies: - libsodium "^0.7.11" - -libsodium@^0.7.11: - version "0.7.11" - resolved "https://registry.yarnpkg.com/libsodium/-/libsodium-0.7.11.tgz#cd10aae7bcc34a300cc6ad0ac88fcca674cfbc2e" - integrity sha512-WPfJ7sS53I2s4iM58QxY3Inb83/6mjlYgcmZs7DJsvDlnmVUwNinBCi5vBT43P6bHRy01O4zsMU2CoVR6xJ40A== - lie@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" @@ -20620,17 +17148,7 @@ lie@3.1.1: dependencies: immediate "~3.0.5" -lilconfig@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.0.5.tgz#19e57fd06ccc3848fd1891655b5a447092225b25" - integrity sha512-xaYmXZtTHPAw5m+xLN8ab9C+3a8YmV3asNSPOATITbtwrfbwaLJj8h66H1WMIpALCkqsIzK3h7oQ+PdX+LQ9Eg== - -lilconfig@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.0.6.tgz#32a384558bd58af3d4c6e077dd1ad1d397bc69d4" - integrity sha512-9JROoBW7pobfsx+Sq2JsASvCo6Pfo6WWoUW79HuB1BCoBXD4PLWJPqDF6fNj67pqBYTbAHkE57M1kS/+L1neOg== - -lilconfig@^2.1.0: +lilconfig@^2.0.5, lilconfig@^2.0.6, lilconfig@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52" integrity sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ== @@ -20650,13 +17168,6 @@ lines-and-columns@~2.0.3: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-2.0.3.tgz#b2f0badedb556b747020ab8ea7f0373e22efac1b" integrity sha512-cNOjgCnLB+FnvWWtyRTzmB3POJ+cXxTA81LoW7u8JdmhfXzriropYwpjShnz1QLLWsQwY7nIxoDmcPTwphDK9w== -link-module-alias@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/link-module-alias/-/link-module-alias-1.2.0.tgz#6a3b7b014cfe18b2759a1222fffce6a40fc120e4" - integrity sha512-ahPjXepbSVKbahTB6LxR//VHm8HPfI+QQygCH+E82spBY4HR5VPJTvlhKBc9F7muVxnS6C1rRfoPOXAbWO/fyw== - dependencies: - chalk "^2.4.1" - listr2@^4.0.5: version "4.0.5" resolved "https://registry.yarnpkg.com/listr2/-/listr2-4.0.5.tgz#9dcc50221583e8b4c71c43f9c7dfd0ef546b75d5" @@ -20909,11 +17420,6 @@ lodash.uniq@4.5.0, lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ== -lodash.values@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/lodash.values/-/lodash.values-4.3.0.tgz#a3a6c2b0ebecc5c2cba1c17e6e620fe81b53d347" - integrity sha512-r0RwvdCv8id9TUblb/O7rYPwVy6lerCbcawrfdo9iC/1t1wsNMJknO79WNBgwkH0hIeJ08jmvvESbFpNb4jH0Q== - lodash@4.17.21, lodash@^4.17.12, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.3.0, lodash@~4.17.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" @@ -20966,16 +17472,11 @@ long@^4.0.0: resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== -long@^5.0.0, long@^5.2.0, long@^5.2.3: +long@^5.2.0, long@^5.2.1, long@^5.2.3: version "5.2.3" resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1" integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q== -long@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/long/-/long-5.2.1.tgz#e27595d0083d103d2fa2c20c7699f8e0c92b897f" - integrity sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A== - longest-streak@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-3.1.0.tgz#62fa67cd958742a1574af9f39866364102d90cd4" @@ -21122,7 +17623,7 @@ map-obj@^1.0.0, map-obj@^1.0.1: resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" integrity sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg== -map-obj@^4.0.0, map-obj@^4.1.0: +map-obj@^4.0.0: version "4.3.0" resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== @@ -21158,15 +17659,6 @@ md5.js@^1.3.4: inherits "^2.0.1" safe-buffer "^5.1.2" -md5@~2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/md5/-/md5-2.2.1.tgz#53ab38d5fe3c8891ba465329ea23fac0540126f9" - integrity sha512-PlGG4z5mBANDGCKsYQe0CaUYHdZYZt8ZPZLmEt+Urf0W4GlpTX4HescwHU+dc9+Z/G/vZKYZYFrwgm9VxK6QOQ== - dependencies: - charenc "~0.0.1" - crypt "~0.0.1" - is-buffer "~1.1.1" - mdast-squeeze-paragraphs@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/mdast-squeeze-paragraphs/-/mdast-squeeze-paragraphs-4.0.0.tgz#7c4c114679c3bee27ef10b58e2e015be79f1ef97" @@ -21881,14 +18373,14 @@ minimatch@3.0.5: dependencies: brace-expansion "^1.1.7" -minimatch@5.1.0, minimatch@^5.1.0: +minimatch@5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.0.tgz#1717b464f4971b144f6aabe8f2d0b8e4511e09c7" integrity sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg== dependencies: brace-expansion "^2.0.1" -minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: +minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -21902,7 +18394,7 @@ minimatch@^4.2.3: dependencies: brace-expansion "^1.1.7" -minimatch@^5.0.1: +minimatch@^5.0.1, minimatch@^5.1.0: version "5.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.2.tgz#0939d7d6f0898acbd1508abe534d1929368a8fff" integrity sha512-bNH9mmM9qsJ2X4r2Nat1B//1dJVcn3+iBLa3IgqJ7EbGaDNepL9QSHOxN4ng33s52VMMhhIfgCYDk3C4ZmlDAg== @@ -21925,12 +18417,12 @@ minimist-options@4.1.0: is-plain-obj "^1.1.0" kind-of "^6.0.3" -minimist@1.2.6, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5: +minimist@1.2.6: version "1.2.6" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== -minimist@1.2.8, minimist@^1.2.6: +minimist@1.2.8, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5, minimist@^1.2.6: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== @@ -21982,14 +18474,7 @@ minipass-sized@^1.0.3: dependencies: minipass "^3.0.0" -minipass@^3.0.0, minipass@^3.1.1: - version "3.3.4" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.3.4.tgz#ca99f95dd77c43c7a76bf51e6d200025eee0ffae" - integrity sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw== - dependencies: - yallist "^4.0.0" - -minipass@^3.1.6: +minipass@^3.0.0, minipass@^3.1.1, minipass@^3.1.6: version "3.3.6" resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.3.6.tgz#7bba384db3a1520d18c9c0e5251c3444e95dd94a" integrity sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw== @@ -22016,11 +18501,6 @@ minizlib@^2.1.1, minizlib@^2.1.2: minipass "^3.0.0" yallist "^4.0.0" -miscreant@0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/miscreant/-/miscreant-0.3.2.tgz#a91c046566cca70bd6b5e9fbdd3f67617fa85034" - integrity sha512-fL9KxsQz9BJB2KGPMHFrReioywkiomBiuaLk6EuChijK0BsJsIKJXdVomR+/bPj5mvbFD6wM0CM3bZio9g7OHA== - mississippi@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022" @@ -22076,11 +18556,6 @@ mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.5: dependencies: minimist "^1.2.6" -mobx-utils@^6.0.3: - version "6.0.5" - resolved "https://registry.yarnpkg.com/mobx-utils/-/mobx-utils-6.0.5.tgz#0cce9afb07fbba1fb559f959f8cea1f44baa7252" - integrity sha512-QOduwicYedD4mwYZRl8+c3BalljFDcubg+PUGqBkn8tOuBoj2q7GhjXBP6JXM9J+Zh+2mePK8IoToeLfqr3Z/w== - mobx@^6.1.7: version "6.6.1" resolved "https://registry.yarnpkg.com/mobx/-/mobx-6.6.1.tgz#70ee6aa82f25aeb7e7d522bd621207434e509318" @@ -22120,6 +18595,11 @@ mrmime@^1.0.0: resolved "https://registry.yarnpkg.com/mrmime/-/mrmime-1.0.1.tgz#5f90c825fad4bdd41dc914eff5d1a8cfdaf24f27" integrity sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw== +mrmime@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mrmime/-/mrmime-2.0.0.tgz#151082a6e06e59a9a39b46b3e14d5cfe92b3abb4" + integrity sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw== + ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -22199,12 +18679,7 @@ mz@^2.7.0: object-assign "^4.0.1" thenify-all "^1.0.0" -nan@^2.12.1: - version "2.16.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.16.0.tgz#664f43e45460fb98faf00edca0bb0d7b8dce7916" - integrity sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA== - -nan@^2.13.2: +nan@^2.12.1, nan@^2.13.2: version "2.17.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.17.0.tgz#c0150a2368a182f033e9aa5195ec76ea41a199cb" integrity sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ== @@ -22223,17 +18698,7 @@ nano-css@^5.6.1: stacktrace-js "^2.0.2" stylis "^4.3.0" -nanoid@^3.0.2, nanoid@^3.1.20, nanoid@^3.1.23, nanoid@^3.3.1, nanoid@^3.3.4: - version "3.3.4" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" - integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== - -nanoid@^3.3.6: - version "3.3.6" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c" - integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== - -nanoid@^3.3.7: +nanoid@^3.0.2, nanoid@^3.1.20, nanoid@^3.1.23, nanoid@^3.3.1, nanoid@^3.3.4, nanoid@^3.3.7: version "3.3.7" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== @@ -22408,14 +18873,14 @@ node-dir@^0.1.10: dependencies: minimatch "^3.0.2" -node-fetch@2.6.7, node-fetch@^2.6.1: +node-fetch@2.6.7: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== dependencies: whatwg-url "^5.0.0" -node-fetch@^2.6.12, node-fetch@^2.6.7: +node-fetch@^2.6.1, node-fetch@^2.6.12, node-fetch@^2.6.7: version "2.7.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== @@ -22486,16 +18951,6 @@ node-releases@^2.0.13: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.13.tgz#d5ed1627c23e3461e819b02e57b75e4899b1c81d" integrity sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ== -node-releases@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.5.tgz#280ed5bc3eba0d96ce44897d8aee478bfb3d9666" - integrity sha512-U9h1NLROZTq9uE1SNffn6WuPDg8icmi3ns4rEl/oTfIle4iLjTliCzgTsbaIFMq/Xn078/lfY/BL0GWZ+psK4Q== - -node-releases@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503" - integrity sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg== - nomnom@^1.5.x: version "1.8.1" resolved "https://registry.yarnpkg.com/nomnom/-/nomnom-1.8.1.tgz#2151f722472ba79e50a76fc125bb8c8f2e4dc2a7" @@ -22504,14 +18959,6 @@ nomnom@^1.5.x: chalk "~0.4.0" underscore "~1.6.0" -noms@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/noms/-/noms-0.0.0.tgz#da8ebd9f3af9d6760919b27d9cdc8092a7332859" - integrity sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow== - dependencies: - inherits "^2.0.1" - readable-stream "~1.0.31" - nopt@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/nopt/-/nopt-5.0.0.tgz#530942bb58a512fccafe53fe210f13a25355dc88" @@ -22767,12 +19214,7 @@ object-hash@^3.0.0: resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-3.0.0.tgz#73f97f753e7baffc0e2cc9d6e079079744ac82e9" integrity sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw== -object-inspect@^1.12.0: - version "1.12.2" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" - integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== - -object-inspect@^1.9.0: +object-inspect@^1.12.0, object-inspect@^1.9.0: version "1.12.3" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== @@ -22936,15 +19378,6 @@ opener@^1.5.2: resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A== -optimism@^0.17.5: - version "0.17.5" - resolved "https://registry.yarnpkg.com/optimism/-/optimism-0.17.5.tgz#a4c78b3ad12c58623abedbebb4f2f2c19b8e8816" - integrity sha512-TEcp8ZwK1RczmvMnvktxHSF2tKgMWjJ71xEFGX5ApLh67VsMSTy1ZUlipJw8W+KaqgOmQ+4pqwkeivY89j+4Vw== - dependencies: - "@wry/context" "^0.7.0" - "@wry/trie" "^0.4.3" - tslib "^2.3.0" - optimism@^0.18.0: version "0.18.0" resolved "https://registry.yarnpkg.com/optimism/-/optimism-0.18.0.tgz#e7bb38b24715f3fdad8a9a7fc18e999144bbfa63" @@ -23208,16 +19641,16 @@ pacote@^13.0.3, pacote@^13.6.1: ssri "^9.0.0" tar "^6.1.11" -pako@1.0.11, pako@~1.0.5: - version "1.0.11" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" - integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== - pako@^2.0.2: version "2.0.4" resolved "https://registry.yarnpkg.com/pako/-/pako-2.0.4.tgz#6cebc4bbb0b6c73b0d5b8d7e8476e2b2fbea576d" integrity sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg== +pako@~1.0.5: + version "1.0.11" + resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" + integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== + papaparse@^5.4.1: version "5.4.1" resolved "https://registry.yarnpkg.com/papaparse/-/papaparse-5.4.1.tgz#f45c0f871853578bd3a30f92d96fdcfb6ebea127" @@ -23503,7 +19936,7 @@ path@^0.12.7: process "^0.11.1" util "^0.10.3" -pbkdf2@^3.0.16, pbkdf2@^3.0.17, pbkdf2@^3.0.3, pbkdf2@^3.1.2: +pbkdf2@^3.0.3: version "3.1.2" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== @@ -23682,14 +20115,7 @@ postcss-import@^15.1.0: read-cache "^1.0.0" resolve "^1.1.7" -postcss-js@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/postcss-js/-/postcss-js-4.0.0.tgz#31db79889531b80dc7bc9b0ad283e418dce0ac00" - integrity sha512-77QESFBwgX4irogGVPgQ5s07vLvFqWr228qZY+w6lW599cRlK/HmnlivnnVUxkjHnCu4J16PDMHcH+e+2HbvTQ== - dependencies: - camelcase-css "^2.0.1" - -postcss-js@^4.0.1: +postcss-js@^4.0.0, postcss-js@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/postcss-js/-/postcss-js-4.0.1.tgz#61598186f3703bab052f1c4f7d805f3991bee9d2" integrity sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw== @@ -23802,13 +20228,6 @@ postcss-modules-values@^4.0.0: dependencies: icss-utils "^5.0.0" -postcss-nested@5.0.6: - version "5.0.6" - resolved "https://registry.yarnpkg.com/postcss-nested/-/postcss-nested-5.0.6.tgz#466343f7fc8d3d46af3e7dba3fcd47d052a945bc" - integrity sha512-rKqm2Fk0KbA8Vt3AdGN0FB9OBOMDVajMG6ZCf/GoHgdxUJ4sBFp0A/uMIRm+MJUdo33YXEtjqIz8u7DAp8B7DA== - dependencies: - postcss-selector-parser "^6.0.6" - postcss-nested@6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/postcss-nested/-/postcss-nested-6.0.0.tgz#1572f1984736578f360cffc7eb7dca69e30d1735" @@ -23823,15 +20242,7 @@ postcss-nested@^6.0.1: dependencies: postcss-selector-parser "^6.0.11" -postcss-selector-parser@^6.0.0, postcss-selector-parser@^6.0.10, postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4, postcss-selector-parser@^6.0.6: - version "6.0.10" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz#79b61e2c0d1bfc2602d549e11d0876256f8df88d" - integrity sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w== - dependencies: - cssesc "^3.0.0" - util-deprecate "^1.0.2" - -postcss-selector-parser@^6.0.11: +postcss-selector-parser@^6.0.0, postcss-selector-parser@^6.0.10, postcss-selector-parser@^6.0.11, postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4: version "6.0.13" resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz#d05d8d76b1e8e173257ef9d60b706a8e5e99bf1b" integrity sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ== @@ -23844,7 +20255,7 @@ postcss-value-parser@^4.0.0, postcss-value-parser@^4.1.0, postcss-value-parser@^ resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== -postcss@8.4.14, postcss@^8.4.14: +postcss@8.4.14: version "8.4.14" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf" integrity sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig== @@ -23870,25 +20281,7 @@ postcss@^7.0.14, postcss@^7.0.26, postcss@^7.0.32, postcss@^7.0.36, postcss@^7.0 picocolors "^0.2.1" source-map "^0.6.1" -postcss@^8.0.9: - version "8.4.24" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.24.tgz#f714dba9b2284be3cc07dbd2fc57ee4dc972d2df" - integrity sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg== - dependencies: - nanoid "^3.3.6" - picocolors "^1.0.0" - source-map-js "^1.0.2" - -postcss@^8.2.14, postcss@^8.2.15, postcss@^8.4.16: - version "8.4.16" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.16.tgz#33a1d675fac39941f5f445db0de4db2b6e01d43c" - integrity sha512-ipHE1XBvKzm5xI7hiHCZJCSugxvsdq2mPnsq5+UF+VHCjiBvtDrlxJfMBToWaP9D5XlgNmcFGqoHmUn0EYEaRQ== - dependencies: - nanoid "^3.3.4" - picocolors "^1.0.0" - source-map-js "^1.0.2" - -postcss@^8.4.23: +postcss@^8.0.9, postcss@^8.2.14, postcss@^8.2.15, postcss@^8.4.16, postcss@^8.4.23, postcss@^8.4.4, postcss@^8.4.5: version "8.4.33" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.33.tgz#1378e859c9f69bf6f638b990a0212f43e2aaa742" integrity sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg== @@ -23897,15 +20290,6 @@ postcss@^8.4.23: picocolors "^1.0.0" source-map-js "^1.0.2" -postcss@^8.4.4, postcss@^8.4.5: - version "8.4.18" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.18.tgz#6d50046ea7d3d66a85e0e782074e7203bc7fbca2" - integrity sha512-Wi8mWhncLJm11GATDaQKobXSNEYGUHeQLiQqDFG1qQ5UTDPTEvKw0Xt5NsTpktGTwLps3ByrWsBrG0rB8YQ9oA== - dependencies: - nanoid "^3.3.4" - picocolors "^1.0.0" - source-map-js "^1.0.2" - prebuild-install@^7.1.1: version "7.1.1" resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-7.1.1.tgz#de97d5b34a70a0c81334fd24641f2a1702352e45" @@ -23975,16 +20359,7 @@ pretty-format@^22.0.3, pretty-format@^22.4.3: ansi-regex "^3.0.0" ansi-styles "^3.2.0" -pretty-format@^29.0.0, pretty-format@^29.3.1: - version "29.3.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.3.1.tgz#1841cac822b02b4da8971dacb03e8a871b4722da" - integrity sha512-FyLnmb1cYJV8biEIiRyzRFvs2lry7PPIvOqKVe1GCUEYg4YGmlx1qG9EJNMxArYm7piII4qb8UV1Pncq5dxmcg== - dependencies: - "@jest/schemas" "^29.0.0" - ansi-styles "^5.0.0" - react-is "^18.0.0" - -pretty-format@^29.5.0: +pretty-format@^29.0.0, pretty-format@^29.5.0: version "29.5.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.5.0.tgz#283134e74f70e2e3e7229336de0e4fce94ccde5a" integrity sha512-V2mGkI31qdttvTFX7Mt4efOqHXqJWMu4/r66Xh3Z3BwZaPfPJgp6/gbwoujRpPUtfEF6AUUWx3Jim3GCw5g/Qw== @@ -24105,7 +20480,7 @@ promzard@^0.3.0: dependencies: read "1" -prop-types@^15.0.0, prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: +prop-types@^15.0.0, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: version "15.8.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== @@ -24126,53 +20501,15 @@ property-information@^6.0.0: resolved "https://registry.yarnpkg.com/property-information/-/property-information-6.1.1.tgz#5ca85510a3019726cb9afed4197b7b8ac5926a22" integrity sha512-hrzC564QIl0r0vy4l6MvRLhafmUowhO/O3KgVSoXIbbA2Sz4j8HGpJc6T2cubRVwMwpdiG/vKGfhT4IixmKN9w== -proto-list@~1.2.1: - version "1.2.4" - resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" - integrity sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA== - -protobufjs@6.11.3, protobufjs@^6.10.2, protobufjs@^6.8.8, protobufjs@~6.11.3: - version "6.11.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.3.tgz#637a527205a35caa4f3e2a9a4a13ddffe0e7af74" - integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg== - 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" - -protobufjs@^6.11.2, protobufjs@~6.11.2: - version "6.11.4" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.4.tgz#29a412c38bf70d89e537b6d02d904a6f448173aa" - integrity sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw== - 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" - -protobufjs@^7.0.0: - version "7.2.5" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.2.5.tgz#45d5c57387a6d29a17aab6846dcc283f9b8e7f2d" - integrity sha512-gGXRSXvxQ7UiPgfw8gevrfRWcTlSbOFg+p/N+JVJEK5VhueL2miT6qTymqAmjr1Q5WbOCyJbyrk6JfWKwlFn6A== +proto-list@~1.2.1: + version "1.2.4" + resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" + integrity sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA== + +protobufjs@^6.10.2, protobufjs@^6.11.2, protobufjs@^6.8.8, protobufjs@~6.11.2: + version "6.11.4" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.4.tgz#29a412c38bf70d89e537b6d02d904a6f448173aa" + integrity sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw== dependencies: "@protobufjs/aspromise" "^1.1.2" "@protobufjs/base64" "^1.1.2" @@ -24184,8 +20521,9 @@ protobufjs@^7.0.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 "^5.0.0" + long "^4.0.0" protocols@^2.0.0, protocols@^2.0.1: version "2.0.1" @@ -24252,11 +20590,6 @@ pumpify@^1.3.3: inherits "^2.0.3" pump "^2.0.0" -punycode@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - integrity sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw== - punycode@^1.2.4, punycode@^1.3.2, punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" @@ -24298,20 +20631,6 @@ q@^1.5.1: resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw== -qr.js@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/qr.js/-/qr.js-0.0.0.tgz#cace86386f59a0db8050fa90d9b6b0e88a1e364f" - integrity sha512-c4iYnWb+k2E+vYpRimHqSu575b1/wKl4XFeJGpFmrJQz5I88v9aY2czh7s0w36srfCM1sXgC/xpoJz5dJfq+OQ== - -qrcode.react@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/qrcode.react/-/qrcode.react-1.0.1.tgz#2834bb50e5e275ffe5af6906eff15391fe9e38a5" - integrity sha512-8d3Tackk8IRLXTo67Y+c1rpaiXjoz/Dd2HpcMdW//62/x8J1Nbho14Kh8x974t9prsLHN6XqVgcnRiBGFptQmg== - dependencies: - loose-envify "^1.4.0" - prop-types "^15.6.0" - qr.js "0.0.0" - qrcode.react@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/qrcode.react/-/qrcode.react-3.1.0.tgz#5c91ddc0340f768316fbdb8fff2765134c2aecd8" @@ -24329,14 +20648,7 @@ qs@6.9.3: resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.3.tgz#bfadcd296c2d549f1dffa560619132c977f5008e" integrity sha512-EbZYNarm6138UKKq46tdx08Yo/q9ZhFoAXAI1meAFd2GtbRDhbZY2WQSICskT0c5q99aFzLG1D4nvTk9tqfXIw== -qs@^6.10.0: - version "6.11.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" - integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== - dependencies: - side-channel "^1.0.4" - -qs@^6.11.0: +qs@^6.10.0, qs@^6.11.0: version "6.11.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.2.tgz#64bea51f12c1f5da1bc01496f48ffcff7c69d7d9" integrity sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA== @@ -24358,11 +20670,6 @@ querystring-es3@^0.2.0: resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" integrity sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA== -querystring@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - integrity sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g== - querystring@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.1.tgz#40d77615bb09d16902a85c3e38aa8b5ed761c2dd" @@ -24579,11 +20886,6 @@ react-is@^18.0.0, react-is@^18.2.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== -react-lifecycles-compat@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" - integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA== - react-markdown@^8.0.0: version "8.0.3" resolved "https://registry.yarnpkg.com/react-markdown/-/react-markdown-8.0.3.tgz#e8aba0d2f5a1b2124d476ee1fff9448a2f57e4b3" @@ -24605,16 +20907,6 @@ react-markdown@^8.0.0: unist-util-visit "^4.0.0" vfile "^5.0.0" -react-modal@^3.12.1: - version "3.16.1" - resolved "https://registry.yarnpkg.com/react-modal/-/react-modal-3.16.1.tgz#34018528fc206561b1a5467fc3beeaddafb39b2b" - integrity sha512-VStHgI3BVcGo7OXczvnJN7yT2TWHJPDXZWyI/a0ssFNhGZWsPmB8cF0z33ewDXq4VfYMO1vXgiv/g8Nj9NDyWg== - dependencies: - exenv "^1.2.0" - prop-types "^15.7.2" - react-lifecycles-compat "^3.0.0" - warning "^4.0.3" - react-native-fetch-api@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/react-native-fetch-api/-/react-native-fetch-api-2.0.0.tgz#c4af188b4fce3f3eaf1f1ff4e61dae1a00d4ffa0" @@ -24638,15 +20930,6 @@ react-property@2.0.0: resolved "https://registry.yarnpkg.com/react-property/-/react-property-2.0.0.tgz#2156ba9d85fa4741faf1918b38efc1eae3c6a136" integrity sha512-kzmNjIgU32mO4mmH5+iUyrqlpFQhF8K2k7eZ4fdLSOPFrD1XgEuSBv9LDEgxRXTMBqMd8ppT0x6TIzqE5pdGdw== -react-qr-reader@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/react-qr-reader/-/react-qr-reader-2.2.1.tgz#dc89046d1c1a1da837a683dd970de5926817d55b" - integrity sha512-EL5JEj53u2yAOgtpAKAVBzD/SiKWn0Bl7AZy6ZrSf1lub7xHwtaXe6XSx36Wbhl1VMGmvmrwYMRwO1aSCT2fwA== - dependencies: - jsqr "^1.2.0" - prop-types "^15.7.2" - webrtc-adapter "^7.2.1" - react-refresh@^0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.11.0.tgz#77198b944733f0f1f1a90e791de4541f9f074046" @@ -24802,16 +21085,7 @@ read@1, read@^1.0.7: string_decoder "~1.1.1" util-deprecate "~1.0.1" -readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.4.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -readable-stream@^3.1.1, readable-stream@^3.6.0, readable-stream@^3.6.2: +readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0, readable-stream@^3.6.2: version "3.6.2" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== @@ -24831,16 +21105,6 @@ readable-stream@^4.4.2: process "^0.11.10" string_decoder "^1.3.0" -readable-stream@~1.0.31: - version "1.0.34" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" - integrity sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - readdir-scoped-modules@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz#8d45407b4f870a0dcaebc0e28670d18e74514309" @@ -24926,16 +21190,11 @@ regenerate@^1.4.2: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== -regenerator-runtime@^0.13.11, regenerator-runtime@^0.13.4: +regenerator-runtime@^0.13.4, regenerator-runtime@^0.13.7: version "0.13.11" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== -regenerator-runtime@^0.13.7: - version "0.13.9" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" - integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== - regenerator-runtime@^0.14.0: version "0.14.0" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45" @@ -25246,7 +21505,7 @@ resolve.exports@^2.0.0: resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.1.tgz#cee884cd4e3f355660e501fa3276b27d7ffe5a20" integrity sha512-OEJWVeimw8mgQuj3HfkNl4KqRevH7lzeQNaWRPfx0PPse7Jk6ozcsG4FKVgtzDsC1KUF+YlTHh17NcgHOPykLw== -resolve@1.22.8, resolve@^1.22.2: +resolve@1.22.8, resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.0, resolve@^1.22.1, resolve@^1.22.2, resolve@^1.3.2: version "1.22.8" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== @@ -25255,24 +21514,6 @@ resolve@1.22.8, resolve@^1.22.2: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" -resolve@^1.1.6: - version "1.22.4" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.4.tgz#1dc40df46554cdaf8948a486a10f6ba1e2026c34" - integrity sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg== - dependencies: - is-core-module "^2.13.0" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - -resolve@^1.1.7, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.0, resolve@^1.22.1, resolve@^1.3.2: - version "1.22.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" - integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== - dependencies: - is-core-module "^2.9.0" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - resolve@^2.0.0-next.3: version "2.0.0-next.4" resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.4.tgz#3d37a113d6429f496ec4752d2a2e58efb1fd4660" @@ -25362,13 +21603,6 @@ ripemd160@^2.0.0, ripemd160@^2.0.1, ripemd160@^2.0.2: hash-base "^3.0.0" inherits "^2.0.1" -rlp@^2.2.3, rlp@^2.2.4: - version "2.2.7" - resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.7.tgz#33f31c4afac81124ac4b283e2bd4d9720b30beaf" - integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ== - dependencies: - bn.js "^5.2.0" - rollup@2.78.0: version "2.78.0" resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.78.0.tgz#00995deae70c0f712ea79ad904d5f6b033209d9e" @@ -25394,13 +21628,6 @@ rsvp@^4.8.4: resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== -rtcpeerconnection-shim@^1.2.15: - version "1.2.15" - resolved "https://registry.yarnpkg.com/rtcpeerconnection-shim/-/rtcpeerconnection-shim-1.2.15.tgz#e7cc189a81b435324c4949aa3dfb51888684b243" - integrity sha512-C6DxhXt7bssQ1nHb154lqeL0SXz5Dx4RczXZu2Aa/L1NJFnEVDxFwCBo3fqtuljhHIGceg5JKBV4XJ0gW5JKyw== - dependencies: - sdp "^2.6.0" - rtl-css-js@^1.16.1: version "1.16.1" resolved "https://registry.yarnpkg.com/rtl-css-js/-/rtl-css-js-1.16.1.tgz#4b48b4354b0ff917a30488d95100fbf7219a3e80" @@ -25439,27 +21666,20 @@ rx-lite@*, rx-lite@^4.0.8: resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" integrity sha512-Cun9QucwK6MIrp3mry/Y7hqD1oFqTYLQ4pGxaHTjIdaFDWRGGLikqp6u8LcWJnzpoALg9hap+JGk8sFIUuEGNA== -rxjs@6, rxjs@^6.4.0, rxjs@^6.6.3: +rxjs@6, rxjs@^6.4.0: version "6.6.7" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== dependencies: tslib "^1.9.0" -rxjs@^7.4.0, rxjs@^7.8.0: +rxjs@^7.5.5: version "7.8.1" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== dependencies: tslib "^2.1.0" -rxjs@^7.5.5: - version "7.8.0" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.0.tgz#90a938862a82888ff4c7359811a595e14e1e09a4" - integrity sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg== - dependencies: - tslib "^2.1.0" - sade@^1.7.3: version "1.8.1" resolved "https://registry.yarnpkg.com/sade/-/sade-1.8.1.tgz#0a78e81d658d394887be57d2a409bf703a3b2701" @@ -25580,7 +21800,7 @@ screenfull@^5.1.0: resolved "https://registry.yarnpkg.com/screenfull/-/screenfull-5.2.0.tgz#6533d524d30621fc1283b9692146f3f13a93d1ba" integrity sha512-9BakfsO2aUQN2K9Fdbj87RJIEZ82Q9IGim7FqM5OsebfoFC6ZHXgDq/KvniuLTPdeM8wY2o6Dj3WQ7KeQCj3cA== -scrypt-js@3.0.1, scrypt-js@^3.0.0: +scrypt-js@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== @@ -25590,12 +21810,7 @@ scuid@^1.1.0: resolved "https://registry.yarnpkg.com/scuid/-/scuid-1.1.0.tgz#d3f9f920956e737a60f72d0e4ad280bf324d5dab" integrity sha512-MuCAyrGZcTLfQoH2XoBlQ8C6bzwN88XT/0slOGz0pn8+gIP85BOAfYa44ZXQUTOwRwPU0QvgU+V+OSajl/59Xg== -sdp@^2.12.0, sdp@^2.6.0: - version "2.12.0" - resolved "https://registry.yarnpkg.com/sdp/-/sdp-2.12.0.tgz#338a106af7560c86e4523f858349680350d53b22" - integrity sha512-jhXqQAQVM+8Xj5EjJGVweuEzgtGWb3tmEEpl3CLP3cStInSbVHSg0QWOGQzNq8pSID4JkpeV2mPqlMDLrm0/Vw== - -secp256k1@^4.0.0, secp256k1@^4.0.1, secp256k1@^4.0.2, secp256k1@^4.0.3: +secp256k1@^4.0.2: version "4.0.3" resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.3.tgz#c4559ecd1b8d3c1827ed2d1b94190d69ce267303" integrity sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA== @@ -25604,28 +21819,6 @@ secp256k1@^4.0.0, secp256k1@^4.0.1, secp256k1@^4.0.2, secp256k1@^4.0.3: node-addon-api "^2.0.0" node-gyp-build "^4.2.0" -secretjs@0.17.7: - version "0.17.7" - resolved "https://registry.yarnpkg.com/secretjs/-/secretjs-0.17.7.tgz#a1aef5866a35cf673be9ddd717d20729afd056ac" - integrity sha512-j39l9+vR2A8067QBqDDejS7LmRLgdkG4uRw2Ar6HMfzDGo26eTh7cIXVlVu/yHBumxtQzKun20epOXwuYHXjQg== - dependencies: - "@iov/crypto" "2.1.0" - "@iov/encoding" "2.1.0" - "@iov/utils" "2.0.2" - axios "0.21.1" - curve25519-js "0.0.4" - fast-deep-equal "3.1.1" - js-crypto-hkdf "0.7.3" - miscreant "0.3.2" - pako "1.0.11" - protobufjs "6.11.3" - secure-random "1.1.2" - -secure-random@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/secure-random/-/secure-random-1.1.2.tgz#ed103b460a851632d420d46448b2a900a41e7f7c" - integrity sha512-H2bdSKERKdBV1SwoqYm6C0y+9EA94v6SUBOWO8kDndc4NoUih7Dv6Tsgma7zO1lv27wIvjlD0ZpMQk7um5dheQ== - selderee@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/selderee/-/selderee-0.10.0.tgz#ec83d6044d9026668dc9bd2561acfde99a4e3a1c" @@ -25650,37 +21843,18 @@ semver@7.3.4: dependencies: lru-cache "^6.0.0" -semver@7.x, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7: - version "7.3.7" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" - integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== +semver@7.x, semver@^7.0.0, semver@^7.1.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.0, semver@^7.5.3, semver@^7.5.4: + version "7.5.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== dependencies: lru-cache "^6.0.0" -semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -semver@^6.3.1: +semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0, semver@^6.3.1: version "6.3.1" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.0.0, semver@^7.1.1: - version "7.3.8" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" - integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== - dependencies: - lru-cache "^6.0.0" - -semver@^7.3.8, semver@^7.5.0, semver@^7.5.3, semver@^7.5.4: - version "7.5.4" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" - integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== - dependencies: - lru-cache "^6.0.0" - send@0.18.0: version "0.18.0" resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" @@ -25806,13 +21980,6 @@ sha.js@^2.4.0, sha.js@^2.4.11, sha.js@^2.4.8: inherits "^2.0.1" safe-buffer "^5.0.1" -sha3@~2.1.0: - version "2.1.4" - resolved "https://registry.yarnpkg.com/sha3/-/sha3-2.1.4.tgz#000fac0fe7c2feac1f48a25e7a31b52a6492cc8f" - integrity sha512-S8cNxbyb0UGUM2VhRD4Poe5N58gJnJsLJ5vC7FYWGUmGhcsj4++WaIOBFVDxlG0W3To6xBuiRh+i0Qp2oNCOtg== - dependencies: - buffer "6.0.3" - shallow-clone@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" @@ -25863,7 +22030,7 @@ shell-quote@^1.7.3: resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.8.1.tgz#6dbf4db75515ad5bac63b4f1894c3a154c766680" integrity sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA== -shelljs@0.8.5, shelljs@^0.8.5: +shelljs@0.8.5: version "0.8.5" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.5.tgz#de055408d8361bed66c669d2f000538ced8ee20c" integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow== @@ -25872,14 +22039,6 @@ shelljs@0.8.5, shelljs@^0.8.5: interpret "^1.0.0" rechoir "^0.6.2" -shx@^0.3.2: - version "0.3.4" - resolved "https://registry.yarnpkg.com/shx/-/shx-0.3.4.tgz#74289230b4b663979167f94e1935901406e40f02" - integrity sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g== - dependencies: - minimist "^1.2.3" - shelljs "^0.8.5" - side-channel@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" @@ -25939,6 +22098,15 @@ sirv@^1.0.7: mrmime "^1.0.0" totalist "^1.0.0" +sirv@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/sirv/-/sirv-2.0.4.tgz#5dd9a725c578e34e449f332703eb2a74e46a29b0" + integrity sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ== + dependencies: + "@polka/url" "^1.0.0-next.24" + mrmime "^2.0.0" + totalist "^3.0.0" + sisteransi@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" @@ -25985,15 +22153,6 @@ snake-case@^3.0.4: dot-case "^3.0.4" tslib "^2.0.3" -snakecase-keys@^5.1.2, snakecase-keys@^5.4.1: - version "5.5.0" - resolved "https://registry.yarnpkg.com/snakecase-keys/-/snakecase-keys-5.5.0.tgz#fbf9ca4a47fcc37c7496d00c6d9e455da9750403" - integrity sha512-r3kRtnoPu3FxGJ3fny6PKNnU3pteb29o6qAa0ugzhSseKNWRkw1dw8nIjXMyyKaU9vQxxVIE62Mb3bKbdrgpiw== - dependencies: - map-obj "^4.1.0" - snake-case "^3.0.4" - type-fest "^3.12.0" - snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" @@ -26300,18 +22459,6 @@ stacktrace-parser@^0.1.10: dependencies: type-fest "^0.7.1" -"standard-error@>= 1.1.0 < 2": - version "1.1.0" - resolved "https://registry.yarnpkg.com/standard-error/-/standard-error-1.1.0.tgz#23e5168fa1c0820189e5812701a79058510d0d34" - integrity sha512-4v7qzU7oLJfMI5EltUSHCaaOd65J6S4BqKRWgzMi4EYaE5fvNabPxmAPGdxpGXqrcWjhDGI/H09CIdEuUOUeXg== - -standard-http-error@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/standard-http-error/-/standard-http-error-2.0.1.tgz#f8ae9172e3cef9cb38d2e7084a1925f57a7c34bd" - integrity sha512-DX/xPIoyXQTuY6BMZK4Utyi4l3A4vFoafsfqrU6/dO4Oe/59c7PyqPd2IQj9m+ZieDg2K3RL9xOYJsabcD9IUA== - dependencies: - standard-error ">= 1.1.0 < 2" - state-toggle@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.3.tgz#e123b16a88e143139b09c6852221bc9815917dfe" @@ -26445,11 +22592,6 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -string-similarity-js@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/string-similarity-js/-/string-similarity-js-2.1.4.tgz#73716330691946f2ebc435859aba8327afd31307" - integrity sha512-uApODZNjCHGYROzDSAdCmAHf60L/pMDHnP/yk6TAbvGg7JSPZlSto/ceCI7hZEqzc53/juU2aOJFkM2yUVTMTA== - "string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -26533,11 +22675,6 @@ string_decoder@^1.0.0, string_decoder@^1.1.1, string_decoder@^1.3.0: dependencies: safe-buffer "~5.2.0" -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - integrity sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ== - string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" @@ -26842,35 +22979,7 @@ tailwindcss@3.2.7: quick-lru "^5.1.1" resolve "^1.22.1" -tailwindcss@^3.1.3: - version "3.1.8" - resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.1.8.tgz#4f8520550d67a835d32f2f4021580f9fddb7b741" - integrity sha512-YSneUCZSFDYMwk+TGq8qYFdCA3yfBRdBlS7txSq0LUmzyeqRe3a8fBQzbz9M3WS/iFT4BNf/nmw9mEzrnSaC0g== - dependencies: - arg "^5.0.2" - chokidar "^3.5.3" - color-name "^1.1.4" - detective "^5.2.1" - didyoumean "^1.2.2" - dlv "^1.1.3" - fast-glob "^3.2.11" - glob-parent "^6.0.2" - is-glob "^4.0.3" - lilconfig "^2.0.6" - normalize-path "^3.0.0" - object-hash "^3.0.0" - picocolors "^1.0.0" - postcss "^8.4.14" - postcss-import "^14.1.0" - postcss-js "^4.0.0" - postcss-load-config "^3.1.4" - postcss-nested "5.0.6" - postcss-selector-parser "^6.0.10" - postcss-value-parser "^4.2.0" - quick-lru "^5.1.1" - resolve "^1.22.1" - -tailwindcss@^3.4.1: +tailwindcss@^3.1.3, tailwindcss@^3.4.1: version "3.4.1" resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.4.1.tgz#f512ca5d1dd4c9503c7d3d28a968f1ad8f5c839d" integrity sha512-qAYmXRfk3ENzuPBakNK0SRrUDipP8NQnEY6772uDhflcQz5EhRdD7JNZxyrFHVQNCwULPBn6FNPp9brpO7ctcA== @@ -26929,19 +23038,7 @@ tar-stream@^2.1.4, tar-stream@~2.2.0: inherits "^2.0.3" readable-stream "^3.1.1" -tar@^6.0.2: - version "6.1.11" - resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621" - integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA== - dependencies: - chownr "^2.0.0" - fs-minipass "^2.0.0" - minipass "^3.0.0" - minizlib "^2.1.1" - mkdirp "^1.0.3" - yallist "^4.0.0" - -tar@^6.1.0, tar@^6.1.11, tar@^6.1.2: +tar@^6.0.2, tar@^6.1.0, tar@^6.1.11, tar@^6.1.2: version "6.1.13" resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.13.tgz#46e22529000f612180601a6fe0680e7da508847b" integrity sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw== @@ -27009,7 +23106,7 @@ terser-webpack-plugin@^4.2.3: terser "^5.3.4" webpack-sources "^1.4.3" -terser-webpack-plugin@^5.0.3: +terser-webpack-plugin@^5.0.3, terser-webpack-plugin@^5.1.3: version "5.3.4" resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.4.tgz#f4d31e265883d20fda3ca9c0fc6a53f173ae62e3" integrity sha512-SmnkUhBxLDcBfTIeaq+ZqJXLVEyXxSaNcCeSezECdKjfkMrTTnPvapBILylYwyEvHFZAn2cJ8dtiXel5XnfOfQ== @@ -27020,17 +23117,6 @@ terser-webpack-plugin@^5.0.3: serialize-javascript "^6.0.0" terser "^5.14.1" -terser-webpack-plugin@^5.1.3: - version "5.3.3" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.3.tgz#8033db876dd5875487213e87c627bca323e5ed90" - integrity sha512-Fx60G5HNYknNTNQnzQ1VePRuu89ZVYWfjRAeT5rITuCY/1b08s49e5kSQwHDirKZWuoKOBRFS98EUUoZ9kLEwQ== - dependencies: - "@jridgewell/trace-mapping" "^0.3.7" - jest-worker "^27.4.5" - schema-utils "^3.1.1" - serialize-javascript "^6.0.0" - terser "^5.7.2" - terser@^4.1.2, terser@^4.6.3: version "4.8.0" resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.0.tgz#63056343d7c70bb29f3af665865a46fe03a0df17" @@ -27040,17 +23126,7 @@ terser@^4.1.2, terser@^4.6.3: source-map "~0.6.1" source-map-support "~0.5.12" -terser@^5.10.0, terser@^5.14.1: - version "5.14.2" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.14.2.tgz#9ac9f22b06994d736174f4091aa368db896f1c10" - integrity sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA== - dependencies: - "@jridgewell/source-map" "^0.3.2" - acorn "^8.5.0" - commander "^2.20.0" - source-map-support "~0.5.20" - -terser@^5.3.4: +terser@^5.10.0, terser@^5.14.1, terser@^5.3.4: version "5.15.0" resolved "https://registry.yarnpkg.com/terser/-/terser-5.15.0.tgz#e16967894eeba6e1091509ec83f0c60e179f2425" integrity sha512-L1BJiXVmheAQQy+as0oF3Pwtlo4s3Wi1X2zNZ2NxOB4wx9bdS9Vk67XQENLFdLYGCK/Z2di53mTj/hBafR+dTA== @@ -27060,16 +23136,6 @@ terser@^5.3.4: commander "^2.20.0" source-map-support "~0.5.20" -terser@^5.7.2: - version "5.14.1" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.14.1.tgz#7c95eec36436cb11cf1902cc79ac564741d19eca" - integrity sha512-+ahUAE+iheqBTDxXhTisdA8hgvbEG1hHOQ9xmNjeUJSoi6DU/gMrKNcfZjHkyY6Alnuyc+ikYJaxxfHkT3+WuQ== - dependencies: - "@jridgewell/source-map" "^0.3.2" - acorn "^8.5.0" - commander "^2.20.0" - source-map-support "~0.5.20" - test-exclude@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" @@ -27130,7 +23196,7 @@ throttled-queue@^2.1.2: resolved "https://registry.yarnpkg.com/throttled-queue/-/throttled-queue-2.1.4.tgz#4e2008c73ab3f72ba1bb09496c3cc9c5b745dbee" integrity sha512-YGdk8sdmr4ge3g+doFj/7RLF5kLM+Mi7DEciu9PHxnMJZMeVuZeTj31g4VE7ekUffx/IdbvrtOCiz62afg0mkg== -through2@^2.0.0, through2@^2.0.1: +through2@^2.0.0: version "2.0.5" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== @@ -27267,6 +23333,11 @@ totalist@^1.0.0: resolved "https://registry.yarnpkg.com/totalist/-/totalist-1.1.0.tgz#a4d65a3e546517701e3e5c37a47a70ac97fe56df" integrity sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g== +totalist@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/totalist/-/totalist-3.0.1.tgz#ba3a3d600c915b1a97872348f79c127475f6acf8" + integrity sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ== + tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" @@ -27421,16 +23492,7 @@ tsconfig-paths@^3.14.1: minimist "^1.2.6" strip-bom "^3.0.0" -tsconfig-paths@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-4.1.0.tgz#f8ef7d467f08ae3a695335bf1ece088c5538d2c1" - integrity sha512-AHx4Euop/dXFC+Vx589alFba8QItjF+8hf8LtmuiCwHyI4rHXQtOOENaM8kvYf5fR0dRChy3wzWIZ9WbB7FWow== - dependencies: - json5 "^2.2.1" - minimist "^1.2.6" - strip-bom "^3.0.0" - -tsconfig-paths@^4.1.2: +tsconfig-paths@^4.0.0, tsconfig-paths@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-4.1.2.tgz#4819f861eef82e6da52fb4af1e8c930a39ed979a" integrity sha512-uhxiMgnXQp1IR622dUXI+9Ehnws7i/y6xvpZB9IbUVOPy0muvdvgXeZOn88UcGPiT98Vp3rJPTa8bFoalZ3Qhw== @@ -27444,21 +23506,16 @@ tslib@1.14.1, tslib@^1.11.1, tslib@^1.8.1, tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.0, tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" - integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== +tslib@^2.0.0, tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.0, tslib@^2.3.1, tslib@^2.4.0, tslib@^2.5.0, tslib@^2.6.1, tslib@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" + integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== -tslib@^2.3.1, tslib@^2.5.0, tslib@~2.5.0: +tslib@~2.5.0: version "2.5.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.3.tgz#24944ba2d990940e6e982c4bea147aba80209913" integrity sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w== -tslib@^2.4.0, tslib@^2.6.1, tslib@^2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" - integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== - tsutils@^3.21.0: version "3.21.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" @@ -27651,11 +23708,6 @@ type-fest@^0.8.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== -type-fest@^3.12.0: - version "3.13.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-3.13.1.tgz#bb744c1f0678bea7543a2d1ec24e83e68e8c8706" - integrity sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g== - type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" @@ -27664,11 +23716,6 @@ type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" -type-tagger@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/type-tagger/-/type-tagger-1.0.0.tgz#dc6297e52e17097c1b92b42c16816a18f631e7f4" - integrity sha512-FIPqqpmDgdaulCnRoKv1/d3U4xVBUrYn42QXWNP3XYmgfPUDuBUsgFOb9ntT0aIe0UsUP+lknpQ5d9Kn36RssA== - type@^1.0.1: version "1.2.0" resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" @@ -27922,15 +23969,7 @@ unist-util-visit-parents@^3.0.0: "@types/unist" "^2.0.0" unist-util-is "^4.0.0" -unist-util-visit-parents@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-5.1.0.tgz#44bbc5d25f2411e7dfc5cecff12de43296aa8521" - integrity sha512-y+QVLcY5eR/YVpqDsLf/xh9R3Q2Y4HxkZTp7ViLDU6WtJCEcPmRzW1gpdWDCDIqIlhuPDXOgttqPlykrHYDekg== - dependencies: - "@types/unist" "^2.0.0" - unist-util-is "^5.0.0" - -unist-util-visit-parents@^5.1.3: +unist-util-visit-parents@^5.0.0, unist-util-visit-parents@^5.1.3: version "5.1.3" resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz#b4520811b0ca34285633785045df7a8d6776cfeb" integrity sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg== @@ -27978,11 +24017,6 @@ unload@^2.4.1: resolved "https://registry.yarnpkg.com/unload/-/unload-2.4.1.tgz#b0c5b7fb44e17fcbf50dcb8fb53929c59dd226a5" integrity sha512-IViSAm8Z3sRBYA+9wc0fLQmU9Nrxb16rcDmIiR6Y9LJSZzI7QY5QsDhqPpKOjAn0O9/kfK1TfNEMMAGPTIraPw== -unorm@^1.5.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/unorm/-/unorm-1.6.0.tgz#029b289661fba714f1a9af439eb51d9b16c205af" - integrity sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA== - unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" @@ -28003,11 +24037,6 @@ untildify@^2.0.0: dependencies: os-homedir "^1.0.0" -untildify@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/untildify/-/untildify-4.0.0.tgz#2bc947b953652487e4600949fb091e3ae8cd919b" - integrity sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw== - upath@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894" @@ -28026,22 +24055,6 @@ update-browserslist-db@^1.0.11: escalade "^3.1.1" picocolors "^1.0.0" -update-browserslist-db@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.4.tgz#dbfc5a789caa26b1db8990796c2c8ebbce304824" - integrity sha512-jnmO2BEGUjsMOe/Fg9u0oczOe/ppIDZPebzccl1yDWGLFP16Pa1/RM5wEoKYPG2zstNcDuAStejyxsOuKINdGA== - dependencies: - escalade "^3.1.1" - picocolors "^1.0.0" - -update-browserslist-db@^1.0.9: - version "1.0.10" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz#0f54b876545726f17d00cd9a2561e6dade943ff3" - integrity sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ== - dependencies: - escalade "^3.1.1" - picocolors "^1.0.0" - upper-case-first@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/upper-case-first/-/upper-case-first-2.0.2.tgz#992c3273f882abd19d1e02894cc147117f844324" @@ -28077,15 +24090,7 @@ url-loader@^4.1.1: mime-types "^2.1.27" schema-utils "^3.0.0" -url@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - integrity sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ== - dependencies: - punycode "1.3.2" - querystring "0.2.0" - -url@^0.11.1: +url@^0.11.0, url@^0.11.1: version "0.11.1" resolved "https://registry.yarnpkg.com/url/-/url-0.11.1.tgz#26f90f615427eca1b9f4d6a28288c147e2302a32" integrity sha512-rWS3H04/+mzzJkv0eZ7vEDGiQbgquI1fGfOad6zKvgYQi1SzMmhl7c/DdRGxhaWrVH6z0qWITo8rpnxK/RfEhA== @@ -28198,12 +24203,7 @@ uuid@^8.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -uuid@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5" - integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg== - -uuid@^9.0.1: +uuid@^9.0.0, uuid@^9.0.1: version "9.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== @@ -28315,20 +24315,6 @@ vfile@^5.0.0: unist-util-stringify-position "^3.0.0" vfile-message "^3.0.0" -viem@^1.12.2: - version "1.19.11" - resolved "https://registry.yarnpkg.com/viem/-/viem-1.19.11.tgz#de4ee7537ee036894bd818aa316a8faecaf017e9" - integrity sha512-dbsXEWDBZkByuzJXAs/e01j7dpUJ5ICF5WcyntFwf8Y97n5vnC/91lAleSa6DA5V4WJvYZbhDpYeTctsMAQnhA== - dependencies: - "@adraffy/ens-normalize" "1.10.0" - "@noble/curves" "1.2.0" - "@noble/hashes" "1.3.2" - "@scure/bip32" "1.3.2" - "@scure/bip39" "1.2.1" - abitype "0.9.8" - isows "1.0.3" - ws "8.13.0" - vm-browserify@^1.0.1: version "1.1.2" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" @@ -28351,13 +24337,6 @@ walker@^1.0.7, walker@^1.0.8, walker@~1.0.5: dependencies: makeerror "1.0.12" -warning@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/warning/-/warning-4.0.3.tgz#16e9e077eb8a86d6af7d64aa1e05fd85b4678ca3" - integrity sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w== - dependencies: - loose-envify "^1.0.0" - wasm-ast-types@^0.25.0: version "0.25.0" resolved "https://registry.yarnpkg.com/wasm-ast-types/-/wasm-ast-types-0.25.0.tgz#9f4056803c99fae6899c1f226e46cf730d9fe2db" @@ -28388,7 +24367,7 @@ watchpack@^1.7.4: chokidar "^3.4.1" watchpack-chokidar2 "^2.0.1" -watchpack@^2.2.0, watchpack@^2.3.1, watchpack@^2.4.0: +watchpack@^2.2.0, watchpack@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d" integrity sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg== @@ -28443,6 +24422,25 @@ webidl-conversions@^3.0.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== +webpack-bundle-analyzer@4.10.1: + version "4.10.1" + resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.10.1.tgz#84b7473b630a7b8c21c741f81d8fe4593208b454" + integrity sha512-s3P7pgexgT/HTUSYgxJyn28A+99mmLq4HsJepMPzu0R8ImJc52QNqaFYW1Z2z2uIb1/J3eYgaAWVpaC+v/1aAQ== + dependencies: + "@discoveryjs/json-ext" "0.5.7" + acorn "^8.0.4" + acorn-walk "^8.0.0" + commander "^7.2.0" + debounce "^1.2.1" + escape-string-regexp "^4.0.0" + gzip-size "^6.0.0" + html-escaper "^2.0.2" + is-plain-object "^5.0.0" + opener "^1.5.2" + picocolors "^1.0.0" + sirv "^2.0.3" + ws "^7.3.1" + webpack-bundle-analyzer@4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.3.0.tgz#2f3c0ca9041d5ee47fa418693cf56b4a518b578b" @@ -28558,37 +24556,7 @@ webpack@4: watchpack "^1.7.4" webpack-sources "^1.4.1" -"webpack@>=4.43.0 <6.0.0": - version "5.73.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.73.0.tgz#bbd17738f8a53ee5760ea2f59dce7f3431d35d38" - integrity sha512-svjudQRPPa0YiOYa2lM/Gacw0r6PvxptHj4FuEKQ2kX05ZLkjbVc5MnPs6its5j7IZljnIqSVo/OsY2X0IpHGA== - dependencies: - "@types/eslint-scope" "^3.7.3" - "@types/estree" "^0.0.51" - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/wasm-edit" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - acorn "^8.4.1" - acorn-import-assertions "^1.7.6" - browserslist "^4.14.5" - chrome-trace-event "^1.0.2" - enhanced-resolve "^5.9.3" - es-module-lexer "^0.9.0" - eslint-scope "5.1.1" - events "^3.2.0" - glob-to-regexp "^0.4.1" - graceful-fs "^4.2.9" - json-parse-even-better-errors "^2.3.1" - loader-runner "^4.2.0" - mime-types "^2.1.27" - neo-async "^2.6.2" - schema-utils "^3.1.0" - tapable "^2.1.1" - terser-webpack-plugin "^5.1.3" - watchpack "^2.3.1" - webpack-sources "^3.2.3" - -webpack@^5.9.0: +"webpack@>=4.43.0 <6.0.0", webpack@^5.9.0: version "5.74.0" resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.74.0.tgz#02a5dac19a17e0bb47093f2be67c695102a55980" integrity sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA== @@ -28618,14 +24586,6 @@ webpack@^5.9.0: watchpack "^2.4.0" webpack-sources "^3.2.3" -webrtc-adapter@^7.2.1: - version "7.7.1" - resolved "https://registry.yarnpkg.com/webrtc-adapter/-/webrtc-adapter-7.7.1.tgz#b2c227a6144983b35057df67bd984a7d4bfd17f1" - integrity sha512-TbrbBmiQBL9n0/5bvDdORc6ZfRY/Z7JnEj+EYOD1ghseZdpJ+nF2yx14k3LgQKc7JZnG7HAcL+zHnY25So9d7A== - dependencies: - rtcpeerconnection-shim "^1.2.15" - sdp "^2.12.0" - whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" @@ -28841,36 +24801,16 @@ ws@7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== -ws@8.13.0: - version "8.13.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" - integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== - -ws@8.14.2, ws@^8.12.0, ws@^8.13.0: +ws@8.14.2, ws@^8.12.0, ws@^8.13.0, ws@^8.2.3, ws@^8.5.0: version "8.14.2" resolved "https://registry.yarnpkg.com/ws/-/ws-8.14.2.tgz#6c249a806eb2db7a20d26d51e7709eab7b2e6c7f" integrity sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g== -ws@^7, ws@^7.3.1: - version "7.5.8" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.8.tgz#ac2729881ab9e7cbaf8787fe3469a48c5c7f636a" - integrity sha512-ri1Id1WinAX5Jqn9HejiGb8crfRio0Qgu8+MtL36rlTA6RLsMdWt1Az/19A2Qij6uSHUMphEFaTKa4WG+UNHNw== - -ws@^7.4.5, ws@^7.5.1, ws@^7.5.9: +ws@^7, ws@^7.3.1, ws@^7.4.5, ws@^7.5.1, ws@^7.5.9: version "7.5.9" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== -ws@^8.2.3: - version "8.8.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.8.0.tgz#8e71c75e2f6348dbf8d78005107297056cb77769" - integrity sha512-JDAgSYQ1ksuwqfChJusw1LSJ8BizJ2e/vVu5Lxjq3YvNJNlROv1ui4i+c/kUUrPheBvQl4c5UbERhTwKa6QBJQ== - -ws@^8.5.0: - version "8.14.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.14.0.tgz#6c5792c5316dc9266ba8e780433fc45e6680aecd" - integrity sha512-WR0RJE9Ehsio6U4TuM+LmunEsjQ5ncHlw4sn9ihD6RoJKZrVyH9FWV3dmnwu8B2aNib1OvG2X6adUCyFpQyWcg== - ws@~8.11.0: version "8.11.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.11.0.tgz#6a0d36b8edfd9f96d8b25683db2f8d7de6e8e143" @@ -28981,7 +24921,7 @@ yargs@^15.3.1: y18n "^4.0.0" yargs-parser "^18.1.2" -yargs@^16.1.0, yargs@^16.2.0: +yargs@^16.2.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== @@ -28994,7 +24934,7 @@ yargs@^16.1.0, yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" -yargs@^17.0.0: +yargs@^17.0.0, yargs@^17.3.1, yargs@^17.6.2: version "17.7.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== @@ -29007,19 +24947,6 @@ yargs@^17.0.0: y18n "^5.0.5" yargs-parser "^21.1.1" -yargs@^17.3.1, yargs@^17.6.2: - version "17.6.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.6.2.tgz#2e23f2944e976339a1ee00f18c77fedee8332541" - integrity sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw== - dependencies: - cliui "^8.0.1" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.3" - y18n "^5.0.5" - yargs-parser "^21.1.1" - yn@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" From cb776494cdda173684156ba62b643df51bc9f7d8 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 4 Mar 2024 18:59:27 -0800 Subject: [PATCH 014/438] make DAO card load membership status from profile account --- packages/stateful/components/dao/DaoCard.tsx | 10 +++++++--- packages/stateful/hooks/useProfile.ts | 15 +++++++++++---- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/packages/stateful/components/dao/DaoCard.tsx b/packages/stateful/components/dao/DaoCard.tsx index e3226f522..abccbc3fa 100644 --- a/packages/stateful/components/dao/DaoCard.tsx +++ b/packages/stateful/components/dao/DaoCard.tsx @@ -4,12 +4,14 @@ import { } from '@dao-dao/stateless' import { DaoCardInfo } from '@dao-dao/types/components/DaoCard' -import { useFollowingDaos, useWallet } from '../../hooks' +import { useFollowingDaos, useProfile } from '../../hooks' import { daoCardInfoLazyDataSelector } from '../../recoil' import { LinkWrapper } from '../LinkWrapper' export const DaoCard = (props: DaoCardInfo) => { - const { address: walletAddress } = useWallet({ chainId: props.chainId }) + const { chains } = useProfile({ + chainId: props.chainId, + }) const { isFollowing, setFollowing, setUnfollowing, updatingFollowing } = useFollowingDaos(props.chainId) @@ -17,7 +19,9 @@ export const DaoCard = (props: DaoCardInfo) => { daoCardInfoLazyDataSelector({ coreAddress: props.coreAddress, chainId: props.chainId, - walletAddress, + walletAddress: chains.loading + ? undefined + : chains.data.find((chain) => chain.chainId === props.chainId)?.address, }), { isMember: false, diff --git a/packages/stateful/hooks/useProfile.ts b/packages/stateful/hooks/useProfile.ts index c7d09fe09..b1ac22604 100644 --- a/packages/stateful/hooks/useProfile.ts +++ b/packages/stateful/hooks/useProfile.ts @@ -14,6 +14,11 @@ import { useRefreshProfile } from './useRefreshProfile' import { useWallet } from './useWallet' export type UseProfileOptions = { + /** + * The chain ID to load the profile for. Defaults to the current chain + * context. + */ + chainId?: string /** * The wallet address to get profile information for. Defaults to the * currently connected wallet. @@ -61,6 +66,7 @@ export type UseProfileReturn = { * defaults to the currently connected wallet. */ export const useProfile = ({ + chainId, address, onlySupported = false, }: UseProfileOptions = {}): UseProfileReturn => { @@ -70,6 +76,7 @@ export const useProfile = ({ hexPublicKey, isWalletConnected, } = useWallet({ + chainId, loadAccount: true, }) @@ -78,9 +85,9 @@ export const useProfile = ({ const profile = useCachedLoading( profileSelector({ chainId: walletChainId, - address: currentAddress, + address: profileAddress, }), - makeEmptyUnifiedProfile(currentAddress) + makeEmptyUnifiedProfile(profileAddress) ) const refreshProfile = useRefreshProfile(profileAddress, profile) @@ -97,11 +104,11 @@ export const useProfile = ({ // profile with no chains is being returned. ...(!profile.data.chains[walletChainId] && !hexPublicKey.loading && - currentAddress + profileAddress ? { [walletChainId]: { publicKey: hexPublicKey.data, - address: currentAddress, + address: profileAddress, }, } : {}), From edc4a01ee866b67519a3d6b6e7267cbd42f054c9 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 4 Mar 2024 19:02:50 -0800 Subject: [PATCH 015/438] remove migrate following modal --- packages/stateful/components/DappLayout.tsx | 2 - .../components/MigrateFollowingModal.tsx | 82 ------------------- packages/stateful/components/index.ts | 1 - .../modals/MigrateFollowingModal.stories.tsx | 39 --------- .../modals/MigrateFollowingModal.tsx | 47 ----------- packages/stateless/components/modals/index.ts | 1 - 6 files changed, 172 deletions(-) delete mode 100644 packages/stateful/components/MigrateFollowingModal.tsx delete mode 100644 packages/stateless/components/modals/MigrateFollowingModal.stories.tsx delete mode 100644 packages/stateless/components/modals/MigrateFollowingModal.tsx diff --git a/packages/stateful/components/DappLayout.tsx b/packages/stateful/components/DappLayout.tsx index de06c887a..1d1accb8d 100644 --- a/packages/stateful/components/DappLayout.tsx +++ b/packages/stateful/components/DappLayout.tsx @@ -34,7 +34,6 @@ import { import { ButtonLink } from './ButtonLink' import { DaoCreatedModal } from './DaoCreatedModal' import { LinkWrapper } from './LinkWrapper' -import { MigrateFollowingModal } from './MigrateFollowingModal' import { DockWallet, SidebarWallet } from './NavWallet' import { WalletModals } from './wallet' @@ -205,7 +204,6 @@ export const DappLayout = ({ children }: { children: ReactNode }) => { visible={commandModalVisible} /> )} - {daoCreatedCardProps && ( { - const { daos, setFollowing, ready, updatingFollowing } = - useFollowingDaos(junoChainId) - - const [oldFollowing, setOldFollowing] = useState([] as string[]) - const [loading, setLoading] = useState(false) - const { address } = useWallet({ chainId: junoChainId }) - useEffect(() => { - if (!address) { - return - } - - ;(async () => { - try { - const { following } = await ( - await fetch( - `https://following.daodao.zone/following/${junoChainId}/${address}` - ) - ).json() - - if (following && Array.isArray(following) && following.length > 0) { - setOldFollowing(following) - } - } catch (e) { - console.error(e) - } - })() - }, [address]) - - const { ready: postRequestReady, postRequest } = useCfWorkerAuthPostRequest( - 'https://following.daodao.zone', - 'Migrate Following' - ) - - return postRequestReady && - ready && - !daos.loading && - daos.data.length === 0 && - oldFollowing.length > 0 ? ( - - { - setLoading(true) - try { - await setFollowing(oldFollowing) - await postRequest('/unfollow-all') - setOldFollowing([]) - } catch (err) { - console.error(err) - toast.error(processError(err)) - } finally { - setLoading(false) - } - }} - visible - /> - - ) : null -} diff --git a/packages/stateful/components/index.ts b/packages/stateful/components/index.ts index 0575558ad..ab8597dca 100644 --- a/packages/stateful/components/index.ts +++ b/packages/stateful/components/index.ts @@ -18,7 +18,6 @@ export * from './DiscordRedirect' export * from './EntityDisplay' export * from './IconButtonLink' export * from './LinkWrapper' -export * from './MigrateFollowingModal' export * from './NavWallet' export * from './PageHeaderContent' export * from './PayEntityDisplay' diff --git a/packages/stateless/components/modals/MigrateFollowingModal.stories.tsx b/packages/stateless/components/modals/MigrateFollowingModal.stories.tsx deleted file mode 100644 index 92fa2984f..000000000 --- a/packages/stateless/components/modals/MigrateFollowingModal.stories.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import { ComponentMeta, ComponentStory } from '@storybook/react' - -import { EntityDisplay } from '@dao-dao/stateful' - -import { MigrateFollowingModal } from './MigrateFollowingModal' - -export default { - title: - 'DAO DAO / packages / stateless / components / modals / MigrateFollowingModal', - component: MigrateFollowingModal, -} as ComponentMeta - -const Template: ComponentStory = (args) => ( - -) - -export const Default = Template.bind({}) -Default.args = { - visible: true, - onMigrate: () => alert('migrate'), - migrating: false, - followedDaos: [ - 'juno10h0hc64jv006rr8qy0zhlu4jsxct8qwa0vtaleayh0ujz0zynf2s2r7v8q', - 'juno1xz54y0ktew0dcm00f9vjw0p7x29pa4j5p9rwq6zerkytugzg27qs4shxnt', - 'juno1rw92sps9q4mm7ll3x9apnunlckchmn3v7cttchsf48dcdyajzj2sajfxcn', - 'juno1gpwekludv6vu8pkpnp2hwwf7f84a7mcvgm9t2cvp92hvpxk07kdq8z4xj2', - 'juno1q7ufzamrmwfw4w35azzkcxd5l44vy8zngm9ufcgryk2dt8clqznsp88lhd', - 'juno1c5v6jkmre5xa9vf9aas6yxewc7aqmjy0rlkkyk4d88pnwuhclyhsrhhns6', - 'juno1czh5dy2kxwwt5hlw6rr2q25clj96sheftsdccswg9qe34m3wzgdswmw8ju', - 'juno1u6zrwaq8e2nug8hvehl3chh8shm0uv7dewku373w82enagghk62svzd3sq', - 'juno1kvtefw5v6w0vlgurvhgjvmu2ny8vg8vy2lwdk9k3h547plh7j6gqvjcqaz', - 'juno1svduqrvcmzpl5g74q8rkm6rhcjnhch2yaagzu4ljuv2u9tf86ltqx9a54s', - 'juno1wgqy9pqcj558wy9xcrv52h3hwd0336q69r2p5x2awyrmztcsw4wsspu97h', - 'juno1m895hnfqhmv9p2jy99c8j32fz7p5y9tvg75wvkyfdu2j2xnc3xesdx6gv6', - 'juno1tr4t593vy37qtqqh28tarmj34yae9za9zlj7xeegx3k8rgvp3xeqv02tu5', - 'juno1z3zqgz7t0hcu2fx4wusuyjq0gc2m33la8l64saunfz7vmqwa2d5sz6jnep', - ], - EntityDisplay, -} diff --git a/packages/stateless/components/modals/MigrateFollowingModal.tsx b/packages/stateless/components/modals/MigrateFollowingModal.tsx deleted file mode 100644 index ef660a955..000000000 --- a/packages/stateless/components/modals/MigrateFollowingModal.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import { ComponentType } from 'react' -import { useTranslation } from 'react-i18next' - -import { StatefulEntityDisplayProps } from '@dao-dao/types' - -import { Button } from '../buttons' -import { Modal, ModalProps } from './Modal' - -export type MigrateFollowingModalProps = Pick & { - onMigrate: () => void - migrating: boolean - followedDaos: string[] - EntityDisplay: ComponentType -} - -export const MigrateFollowingModal = ({ - visible, - onMigrate, - migrating, - followedDaos, - EntityDisplay, -}: MigrateFollowingModalProps) => { - const { t } = useTranslation() - - return ( - - -
- } - header={{ - title: t('title.migrateFollowing'), - subtitle: t('info.migrateFollowingDescription'), - }} - visible={visible} - > -
- {followedDaos.map((dao) => ( - - ))} -
- - ) -} diff --git a/packages/stateless/components/modals/index.ts b/packages/stateless/components/modals/index.ts index b733797b5..bf1553886 100644 --- a/packages/stateless/components/modals/index.ts +++ b/packages/stateless/components/modals/index.ts @@ -3,6 +3,5 @@ export * from './DiscordNotifierConfigureModal' export * from './InboxSettingsModal' export * from './ItemCreatedModal' export * from './KadoModal' -export * from './MigrateFollowingModal' export * from './Modal' export * from './TokenDepositModal' From 8011e7966c06d07cdc0c529a23ba6b1dedd4f93d Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 4 Mar 2024 19:28:04 -0800 Subject: [PATCH 016/438] clean up and use profile in more places --- packages/stateful/components/NavWallet.tsx | 5 +-- .../components/profile/MergeProfilesModal.tsx | 2 +- .../components/profile/ProfileWallet.tsx | 2 +- .../components/wallet/WalletTokenCard.tsx | 6 ++- .../hooks/useCfWorkerAuthPostRequest.ts | 5 ++- packages/stateful/hooks/useFollowingDaos.ts | 27 ++++++++----- packages/stateful/hooks/useInbox.ts | 18 +++++---- packages/stateful/hooks/useManageProfile.ts | 2 +- packages/stateful/hooks/useProfile.ts | 38 +++++++++++++++---- .../DaoProposalMultiple/hooks/useCastVote.ts | 2 +- 10 files changed, 73 insertions(+), 34 deletions(-) diff --git a/packages/stateful/components/NavWallet.tsx b/packages/stateful/components/NavWallet.tsx index 0c94630bc..ede41cb41 100644 --- a/packages/stateful/components/NavWallet.tsx +++ b/packages/stateful/components/NavWallet.tsx @@ -10,8 +10,7 @@ import { InboxMainItemRenderer } from './inbox' import { SuspenseLoader } from './SuspenseLoader' export const NavWallet = (props: StatefulNavWalletProps) => { - const { openView, isWalletConnected, address, wallet, disconnect } = - useWallet() + const { openView, isWalletConnected, wallet, disconnect } = useWallet() const { profile, otherProfiles } = useManageProfile() const setMergeProfilesModalVisible = useSetRecoilState( @@ -33,7 +32,7 @@ export const NavWallet = (props: StatefulNavWalletProps) => { } > - {isWalletConnected && address && wallet ? ( + {isWalletConnected && wallet ? ( { // eslint-disable-next-line react-hooks/exhaustive-deps }, [visible]) - if (profile.loading || !address) { + if (profile.loading) { return null } diff --git a/packages/stateful/components/profile/ProfileWallet.tsx b/packages/stateful/components/profile/ProfileWallet.tsx index bfaef9f70..5d9acbf93 100644 --- a/packages/stateful/components/profile/ProfileWallet.tsx +++ b/packages/stateful/components/profile/ProfileWallet.tsx @@ -37,7 +37,7 @@ export const ProfileWallet = () => { ? undefined : uniquePublicKeys.data.length > 0 ? waitForAny( - uniquePublicKeys.data.map((publicKey) => + uniquePublicKeys.data.map(({ publicKey }) => hiddenBalancesSelector(publicKey) ) ) diff --git a/packages/stateful/components/wallet/WalletTokenCard.tsx b/packages/stateful/components/wallet/WalletTokenCard.tsx index 8d2fd938a..9f40f0ad3 100644 --- a/packages/stateful/components/wallet/WalletTokenCard.tsx +++ b/packages/stateful/components/wallet/WalletTokenCard.tsx @@ -89,7 +89,11 @@ export const WalletTokenCard = (props: TokenCardInfo) => { ) const { ready: hiddenBalancesReady, postRequest: postHiddenBalancesRequest } = - useCfWorkerAuthPostRequest(KVPK_API_BASE, 'Hidden Balances') + useCfWorkerAuthPostRequest( + KVPK_API_BASE, + 'Hidden Balances', + props.token.chainId + ) const setRefreshHidden = useSetRecoilState(refreshHiddenBalancesAtom) const refreshHidden = useCallback( diff --git a/packages/stateful/hooks/useCfWorkerAuthPostRequest.ts b/packages/stateful/hooks/useCfWorkerAuthPostRequest.ts index bc08eeb65..cf6fd6967 100644 --- a/packages/stateful/hooks/useCfWorkerAuthPostRequest.ts +++ b/packages/stateful/hooks/useCfWorkerAuthPostRequest.ts @@ -16,10 +16,13 @@ const lastSuccessfulNonceForApi: Record = {} */ export const useCfWorkerAuthPostRequest = ( apiBase: string, - defaultSignatureType: string + defaultSignatureType: string, + // Optionally override the current chain context. + chainId?: string ) => { const { t } = useTranslation() const { getOfflineSignerAmino, chain, hexPublicKey } = useWallet({ + chainId, loadAccount: true, }) diff --git a/packages/stateful/hooks/useFollowingDaos.ts b/packages/stateful/hooks/useFollowingDaos.ts index 51744921b..4287a3dec 100644 --- a/packages/stateful/hooks/useFollowingDaos.ts +++ b/packages/stateful/hooks/useFollowingDaos.ts @@ -19,7 +19,7 @@ import { } from '../recoil/selectors/dao/following' import { useCfWorkerAuthPostRequest } from './useCfWorkerAuthPostRequest' import { useManageProfile } from './useManageProfile' -import { useWallet } from './useWallet' +import { useProfile } from './useProfile' export type UseFollowingDaosReturn = { daos: LoadingData @@ -35,23 +35,29 @@ export type UseFollowingDaosReturn = { export const useFollowingDaos = (chainId: string): UseFollowingDaosReturn => { const { t } = useTranslation() - const { isWalletConnected, isWalletConnecting, hexPublicKey } = useWallet({ + const { connected, connecting, chains } = useProfile({ chainId, - loadAccount: true, }) + // Get current hex public key from profile's chains, falling back to the + // profile's first chain if the current chain is not found. + const currentHexPublicKey = chains.loading + ? undefined + : (chains.data.find((chain) => chain.chainId === chainId) || chains.data[0]) + ?.publicKey + // Following API doesn't update right away, so this serves to keep track of // all successful updates for the current session. This will be reset on page // refresh. const setTemporary = useSetRecoilState( - temporaryFollowingDaosAtom(hexPublicKey.loading ? '' : hexPublicKey.data) + temporaryFollowingDaosAtom(currentHexPublicKey || '') ) const followingDaosLoading = useCachedLoading( - !hexPublicKey.loading + currentHexPublicKey ? followingDaosSelector({ chainId, - walletPublicKey: hexPublicKey.data, + walletPublicKey: currentHexPublicKey, }) : undefined, [] @@ -73,7 +79,8 @@ export const useFollowingDaos = (chainId: string): UseFollowingDaosReturn => { const [updating, setUpdating] = useState(false) const { ready, postRequest } = useCfWorkerAuthPostRequest( KVPK_API_BASE, - 'Update Following' + 'Update Following', + chainId ) const { profile, addChains } = useManageProfile() @@ -192,11 +199,11 @@ export const useFollowingDaos = (chainId: string): UseFollowingDaosReturn => { setUnfollowing, updatingFollowing: // If wallet connecting, following is not yet loaded. - isWalletConnecting || + connecting || // Updating if wallet connected and following is loading or update is in // progress or hex public key not yet loaded. - (isWalletConnected && - (!hexPublicKey || followingDaosLoading.loading || updating)), + (connected && + (!currentHexPublicKey || followingDaosLoading.loading || updating)), ready, } } diff --git a/packages/stateful/hooks/useInbox.ts b/packages/stateful/hooks/useInbox.ts index 3d030eb90..a9b98e82f 100644 --- a/packages/stateful/hooks/useInbox.ts +++ b/packages/stateful/hooks/useInbox.ts @@ -1,4 +1,3 @@ -import { fromBech32, toHex } from '@cosmjs/encoding' import { useCallback, useEffect } from 'react' import { useSetRecoilState, waitForAll } from 'recoil' @@ -10,18 +9,24 @@ import { useCachedLoading } from '@dao-dao/stateless' import { InboxState } from '@dao-dao/types' import { useProfile } from './useProfile' -import { useWallet } from './useWallet' import { useOnWebSocketMessage } from './useWebSocket' export const useInbox = (): InboxState => { - const { address } = useWallet() - const bech32Hex = address && toHex(fromBech32(address).data) + const { chains, uniquePublicKeys } = useProfile({ + onlySupported: true, + }) const setRefresh = useSetRecoilState(refreshInboxItemsAtom) const refresh = useCallback(() => setRefresh((id) => id + 1), [setRefresh]) // Refresh when any inbox items are added. - useOnWebSocketMessage(bech32Hex ? [`inbox_${bech32Hex}`] : [], 'add', refresh) + useOnWebSocketMessage( + uniquePublicKeys.loading + ? [] + : uniquePublicKeys.data.map(({ bech32Hash }) => `inbox_${bech32Hash}`), + 'add', + refresh + ) // Refresh every minute. useEffect(() => { @@ -29,9 +34,6 @@ export const useInbox = (): InboxState => { return () => clearInterval(interval) }, [refresh]) - const { chains } = useProfile({ - onlySupported: true, - }) const itemsLoading = useCachedLoading( !chains.loading ? waitForAll( diff --git a/packages/stateful/hooks/useManageProfile.ts b/packages/stateful/hooks/useManageProfile.ts index 7dbc8f997..370c85972 100644 --- a/packages/stateful/hooks/useManageProfile.ts +++ b/packages/stateful/hooks/useManageProfile.ts @@ -124,7 +124,7 @@ export const useManageProfile = ({ const refreshProfile = useRefreshProfile(address, profile) - const pfpkApi = useCfWorkerAuthPostRequest(PFPK_API_BASE, '') + const pfpkApi = useCfWorkerAuthPostRequest(PFPK_API_BASE, '', chainId) const ready = !profile.loading && diff --git a/packages/stateful/hooks/useProfile.ts b/packages/stateful/hooks/useProfile.ts index b1ac22604..1d27d47c6 100644 --- a/packages/stateful/hooks/useProfile.ts +++ b/packages/stateful/hooks/useProfile.ts @@ -1,5 +1,3 @@ -import uniq from 'lodash.uniq' - import { useCachedLoading } from '@dao-dao/stateless' import { LoadingData, ProfileChain, UnifiedProfile } from '@dao-dao/types' import { @@ -7,6 +5,7 @@ import { getDisplayNameForChainId, isSupportedChain, maybeGetChainForChainId, + toBech32Hash, } from '@dao-dao/utils' import { makeEmptyUnifiedProfile, profileSelector } from '../recoil' @@ -36,6 +35,11 @@ export type UseProfileReturn = { * this will be false. */ connected: boolean + /** + * Whether or not the current wallet is connecting. When an address is passed, + * this will be false. + */ + connecting: boolean /** * The profile for the currently connected wallet. If not connected and no * address was passed, this will be in the loading state. The unified profile @@ -58,7 +62,12 @@ export type UseProfileReturn = { * Unique public keys for the profile's chains. If not connected and no * address was passed, this will be in the loading state. */ - uniquePublicKeys: LoadingData + uniquePublicKeys: LoadingData< + { + publicKey: string + bech32Hash: string + }[] + > } /** @@ -75,6 +84,7 @@ export const useProfile = ({ address: currentAddress = '', hexPublicKey, isWalletConnected, + isWalletConnecting, } = useWallet({ chainId, loadAccount: true, @@ -138,19 +148,33 @@ export const useProfile = ({ ), } - const uniquePublicKeys: LoadingData = chains.loading + const uniquePublicKeys: LoadingData< + { + publicKey: string + bech32Hash: string + }[] + > = chains.loading ? { loading: true, } : { loading: false, - data: uniq(chains.data.map((c) => c.publicKey)), + // Convert to object and back to array to get unique public keys only. + // All addresses for the same public key have the same bech32 hash, so + // it doesn't matter which address is used for that conversion. + data: Object.entries( + Object.fromEntries(chains.data.map((c) => [c.publicKey, c.address])) + ).map(([publicKey, address]) => ({ + publicKey, + bech32Hash: toBech32Hash(address), + })), } return { - // Connected is only relevant when using the currently connected wallet. If - // an address is passed, set connected to false. + // Connected and connecting are only relevant when using the currently + // connected wallet. If an address is passed, set connected to false. connected: address ? false : isWalletConnected, + connecting: address ? false : isWalletConnecting, profile, refreshProfile, chains, diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useCastVote.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useCastVote.ts index 247bea5a1..c35fa5a06 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useCastVote.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useCastVote.ts @@ -15,7 +15,7 @@ export const useCastVote = (onSuccess?: () => void | Promise) => { const _castVote = DaoProposalMultipleHooks.useVote({ contractAddress: proposalModule.address, - sender: walletAddress ?? '', + sender: walletAddress, }) const [castingVote, setCastingVote] = useState(false) From d1c1b7d867ef84edc4299e1a31419b70c0b63a6e Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 4 Mar 2024 19:30:57 -0800 Subject: [PATCH 017/438] fixed not loading correct profile --- packages/stateful/components/dao/DaoCard.tsx | 8 +++++--- packages/stateful/hooks/useFollowingDaos.ts | 8 +++++--- packages/stateful/hooks/useProfile.ts | 7 ------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/packages/stateful/components/dao/DaoCard.tsx b/packages/stateful/components/dao/DaoCard.tsx index abccbc3fa..a0afd74d8 100644 --- a/packages/stateful/components/dao/DaoCard.tsx +++ b/packages/stateful/components/dao/DaoCard.tsx @@ -9,9 +9,11 @@ import { daoCardInfoLazyDataSelector } from '../../recoil' import { LinkWrapper } from '../LinkWrapper' export const DaoCard = (props: DaoCardInfo) => { - const { chains } = useProfile({ - chainId: props.chainId, - }) + // Don't load chain-specific profile because the wallet may not be connected + // to that chain and thus the correct profile won't load. Instead, fetch the + // chains from the currently connected profile and find the correct one. + const { chains } = useProfile() + const { isFollowing, setFollowing, setUnfollowing, updatingFollowing } = useFollowingDaos(props.chainId) diff --git a/packages/stateful/hooks/useFollowingDaos.ts b/packages/stateful/hooks/useFollowingDaos.ts index 4287a3dec..f15b14102 100644 --- a/packages/stateful/hooks/useFollowingDaos.ts +++ b/packages/stateful/hooks/useFollowingDaos.ts @@ -35,9 +35,11 @@ export type UseFollowingDaosReturn = { export const useFollowingDaos = (chainId: string): UseFollowingDaosReturn => { const { t } = useTranslation() - const { connected, connecting, chains } = useProfile({ - chainId, - }) + + // Don't load chain-specific profile because the wallet may not be connected + // to that chain and thus the correct profile won't load. Instead, fetch the + // chains from the currently connected profile and find the correct one. + const { connected, connecting, chains } = useProfile() // Get current hex public key from profile's chains, falling back to the // profile's first chain if the current chain is not found. diff --git a/packages/stateful/hooks/useProfile.ts b/packages/stateful/hooks/useProfile.ts index 1d27d47c6..22ea6cd65 100644 --- a/packages/stateful/hooks/useProfile.ts +++ b/packages/stateful/hooks/useProfile.ts @@ -13,11 +13,6 @@ import { useRefreshProfile } from './useRefreshProfile' import { useWallet } from './useWallet' export type UseProfileOptions = { - /** - * The chain ID to load the profile for. Defaults to the current chain - * context. - */ - chainId?: string /** * The wallet address to get profile information for. Defaults to the * currently connected wallet. @@ -75,7 +70,6 @@ export type UseProfileReturn = { * defaults to the currently connected wallet. */ export const useProfile = ({ - chainId, address, onlySupported = false, }: UseProfileOptions = {}): UseProfileReturn => { @@ -86,7 +80,6 @@ export const useProfile = ({ isWalletConnected, isWalletConnecting, } = useWallet({ - chainId, loadAccount: true, }) From 6322d9e7b0f0c25f29f28c330297667aff8ae202 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 5 Mar 2024 17:07:49 -0800 Subject: [PATCH 018/438] fixed profile bugs and improved UX drastically --- packages/i18n/locales/en/translation.json | 4 +- packages/stateful/components/NavWallet.tsx | 13 +- .../components/PfpkNftSelectionModal.tsx | 2 + .../stateful/components/pages/Account.tsx | 6 +- packages/stateful/components/pages/Me.tsx | 10 +- .../components/profile/MergeProfilesModal.tsx | 65 ++---- .../components/profile/ProfileAddChains.tsx | 12 +- .../components/profile/ProfileDaos.tsx | 5 +- packages/stateful/hooks/index.ts | 1 + packages/stateful/hooks/useEntity.ts | 2 +- packages/stateful/hooks/useManageProfile.ts | 197 ++++++++++++++---- packages/stateful/hooks/useProfile.ts | 2 +- packages/stateful/package.json | 2 + packages/stateful/recoil/selectors/profile.ts | 21 +- .../components/layout/DappLayout.tsx | 4 +- .../components/layout/DappNavigation.tsx | 2 +- .../components/profile/ProfileAddChains.tsx | 196 +++++++++-------- .../components/profile/ProfileWallet.tsx | 5 +- .../components/wallet/NavWalletConnected.tsx | 11 +- .../components/wallet/WalletProfileHeader.tsx | 16 +- packages/stateless/pages/Profile.tsx | 2 +- packages/storybook/utils.ts | 4 + .../types/components/NavWalletConnected.ts | 5 +- packages/types/components/ProfileAddChains.ts | 5 +- .../types/components/WalletProfileHeader.ts | 12 +- packages/types/profile.ts | 31 +++ yarn.lock | 7 + 27 files changed, 408 insertions(+), 234 deletions(-) diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 6784bf135..4dcfa1a59 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -1259,7 +1259,7 @@ "submitUpgradeProposal": "Submit a proposal to upgrade the DAO?", "submitted": "Submitted", "supportedChainDaosNotShowingUpPrompt": "Are your DAOs not showing up? Add other DAO DAO-supported chains.", - "supportedChainNftsNotShowingUpPrompt": "Find NFTs on other DAO DAO-supported chains", + "supportedChainNftsNotShowingUpPrompt": "Click to find NFTs on other DAO DAO-supported chains", "supportedChainNftsNotShowingUpPromptTooltip": "You have not added all chains that DAO DAO supports to your profile. Add them to find more NFTs to use as your profile picture.", "supportsMarkdown": "Supports Markdown", "testnet": "Testnet", @@ -1424,6 +1424,7 @@ }, "success": { "addedChainsToProfile": "Chains added to profile.", + "addedToProfile": "Added to profile successfully.", "addedToken": "Added token to Keplr.", "claimedRewards": "Claimed rewards.", "compensationCycleCompleted": "Compensation cycle completed. Redirecting to proposal...", @@ -1436,7 +1437,6 @@ "depositedTokenIntoDao": "Deposited {{amount}} ${{tokenSymbol}} into the {{daoName}} treasury.", "discordNotifierEnabled": "Discord notifier setup successfully. Your notifier list will be updated shortly.", "discordNotifierRemoved": "Discord notifier removed. Your notifier list will be updated shortly.", - "mergedProfiles": "Merged profiles successfully.", "multisigImported": "Import successful. Review your new DAO's configuration, and make sure to set an image, name, and description.", "nftCollectionContractInstantiated": "NFT collection created successfully.", "nominationSubmitted": "Contributor nominated for this compensation cycle.", diff --git a/packages/stateful/components/NavWallet.tsx b/packages/stateful/components/NavWallet.tsx index ede41cb41..e3f85bab3 100644 --- a/packages/stateful/components/NavWallet.tsx +++ b/packages/stateful/components/NavWallet.tsx @@ -11,7 +11,10 @@ import { SuspenseLoader } from './SuspenseLoader' export const NavWallet = (props: StatefulNavWalletProps) => { const { openView, isWalletConnected, wallet, disconnect } = useWallet() - const { profile, otherProfiles } = useManageProfile() + const { + profile, + merge: { options: profileMergeOptions }, + } = useManageProfile() const setMergeProfilesModalVisible = useSetRecoilState( mergeProfilesVisibleAtom @@ -39,8 +42,14 @@ export const NavWallet = (props: StatefulNavWalletProps) => { connected disconnect={disconnect} inbox={inbox} + mergeProfileType={ + profileMergeOptions.length === 0 + ? undefined + : profileMergeOptions.length === 1 + ? 'add' + : 'merge' + } onMergeProfiles={() => setMergeProfilesModalVisible(true)} - otherProfilesExist={otherProfiles.length > 0} profile={profile} wallet={wallet} {...props} diff --git a/packages/stateful/components/PfpkNftSelectionModal.tsx b/packages/stateful/components/PfpkNftSelectionModal.tsx index 860beffd4..839ebe7a7 100644 --- a/packages/stateful/components/PfpkNftSelectionModal.tsx +++ b/packages/stateful/components/PfpkNftSelectionModal.tsx @@ -286,6 +286,7 @@ export const InnerPfpkNftSelectionModal = ({ headerContent={ chains.loading ? undefined : ( ) } diff --git a/packages/stateful/components/pages/Account.tsx b/packages/stateful/components/pages/Account.tsx index d0806dc4f..5fe672e8e 100644 --- a/packages/stateful/components/pages/Account.tsx +++ b/packages/stateful/components/pages/Account.tsx @@ -62,17 +62,17 @@ export const Account: NextPage = () => { const hexPublicKey = useCachedLoadingWithError( walletHexPublicKeySelector({ - chainId: configuredChain.chain.chain_id, + chainId: configuredChain.chainId, walletAddress: accountAddress, }) ) const profile = useCachedLoading( profileSelector({ - chainId: configuredChain.chain.chain_id, + chainId: configuredChain.chainId, address: accountAddress, }), - makeEmptyUnifiedProfile(accountAddress) + makeEmptyUnifiedProfile(configuredChain.chainId, accountAddress) ) const { setAccentColor, theme } = useThemeContext() diff --git a/packages/stateful/components/pages/Me.tsx b/packages/stateful/components/pages/Me.tsx index 96f40fd9e..b96bd790b 100644 --- a/packages/stateful/components/pages/Me.tsx +++ b/packages/stateful/components/pages/Me.tsx @@ -76,8 +76,8 @@ export const Me: NextPage = () => { } = useWallet() const { profile, - otherProfiles, updateProfile: { go: updateProfile }, + merge: { options: profileMergeOptions }, } = useManageProfile() const [walletChainId, setWalletChainId] = useRecoilState(walletChainIdAtom) @@ -163,9 +163,15 @@ export const Me: NextPage = () => { {/* Suspend to prevent hydration error since we load state on first render from localStorage. */} }> setMergeProfilesVisible(true)} openProfileNftUpdate={() => setUpdateProfileNftVisible(true)} - otherProfilesExist={otherProfiles.length > 0} profile={profile} tabs={tabs} updateProfile={updateProfile} diff --git a/packages/stateful/components/profile/MergeProfilesModal.tsx b/packages/stateful/components/profile/MergeProfilesModal.tsx index 52774aa28..e3b4bcfe0 100644 --- a/packages/stateful/components/profile/MergeProfilesModal.tsx +++ b/packages/stateful/components/profile/MergeProfilesModal.tsx @@ -15,62 +15,27 @@ import { } from '@dao-dao/stateless' import { processError } from '@dao-dao/utils' -import { useManageProfile, useWallet } from '../../hooks' -import { useRefreshProfile } from '../../hooks/useRefreshProfile' +import { useManageProfile, useRefreshProfile } from '../../hooks' export const MergeProfilesModal = () => { const { t } = useTranslation() + const { - chain: { chain_id: walletChainId }, - address = '', - } = useWallet() - const { profile, otherProfiles } = useManageProfile() + chainId: walletChainId, + profile, + merge: { options }, + } = useManageProfile() + const addingToOneProfile = options.length === 1 const [visible, setVisible] = useRecoilState(mergeProfilesVisibleAtom) - const currentProfileEmpty = - !profile.loading && - (profile.data.nonce === 0 || (!profile.data.name && !profile.data.nft)) - const addingToOneProfile = currentProfileEmpty && otherProfiles.length === 1 - - const profiles = [ - // Don't allow choosing the current profile if it's unused. This modal can - // only be shown if other profiles exist, so it's safe to ignore the current - // one here. - ...(currentProfileEmpty || profile.loading - ? [] - : [ - { - chainId: walletChainId, - address, - profile: profile.data, - }, - ]), - ...otherProfiles, - ].sort((a, b) => { - // Prioritize those with a name set, and then an NFT. - if (a.profile.name && !b.profile.name) { - return -1 - } else if (!a.profile.name && b.profile.name) { - return 1 - } else if (a.profile.nft && !b.profile.nft) { - return -1 - } else if (!a.profile.nft && b.profile.nft) { - return 1 - } - - // Sort by nonce as a heuristic for which is most used if both have a - // name/NFT or both don't. - return b.profile.nonce - a.profile.nonce - }) - const [selectedProfileChainId, setSelectedProfileChainId] = useState< string | undefined >() // Reset selection back to the first one when modal becomes visible. useEffect(() => { if (visible) { - setSelectedProfileChainId(profiles[0]?.chainId) + setSelectedProfileChainId(options[0]?.chainId) } // eslint-disable-next-line react-hooks/exhaustive-deps }, [visible]) @@ -95,12 +60,14 @@ export const MergeProfilesModal = () => { className="!flex-col !gap-1" onChange={(chainId) => setSelectedProfileChainId(chainId)} - options={profiles.map((profile) => ({ + options={options.map((profile) => ({ value: profile.chainId, display: (
@@ -112,7 +79,7 @@ export const MergeProfilesModal = () => { {/* Re-render on chain change to clear profile cache so the button loads the relevant wallet for the chosen profile immediately. */} setVisible(false)} /> @@ -129,7 +96,11 @@ type PerformMergeProps = { const PerformMerge = ({ addingToOneProfile, onClose }: PerformMergeProps) => { const { t } = useTranslation() - const { addChains, otherProfiles } = useManageProfile() + const { + addChains, + merge: { otherProfiles }, + } = useManageProfile() + const refreshProfiles = useRefreshProfile( otherProfiles.map(({ address }) => address), { @@ -157,7 +128,7 @@ const PerformMerge = ({ addingToOneProfile, onClose }: PerformMergeProps) => { refreshProfiles() // Show success toast. - toast.success(t('success.mergedProfiles')) + toast.success(t('success.addedToProfile')) // Close modal. onClose() diff --git a/packages/stateful/components/profile/ProfileAddChains.tsx b/packages/stateful/components/profile/ProfileAddChains.tsx index 82caf511e..ab13c2d00 100644 --- a/packages/stateful/components/profile/ProfileAddChains.tsx +++ b/packages/stateful/components/profile/ProfileAddChains.tsx @@ -15,7 +15,10 @@ export const ProfileAddChains = (props: StatefulProfileAddChainsProps) => { const { t } = useTranslation() const { chains } = useProfile() - const { otherProfiles, addChains } = useManageProfile() + const { + addChains, + merge: { otherProfiles }, + } = useManageProfile() const form = useForm({ defaultValues: { @@ -23,7 +26,7 @@ export const ProfileAddChains = (props: StatefulProfileAddChainsProps) => { }, }) - // Cannot add chains while conflicting profiles exist. + // Cannot add chains while profiles that need merging exist. if (otherProfiles.length > 0) { return null } @@ -31,10 +34,7 @@ export const ProfileAddChains = (props: StatefulProfileAddChainsProps) => { const onAddChains: SubmitHandler = async ({ chains, }) => { - const chainIds = chains - .filter(({ checked }) => checked) - .map(({ chainId }) => chainId) - + const chainIds = chains.map(({ chainId }) => chainId) const chainIdToFormIndex = Object.fromEntries( chains.map(({ chainId }, index) => [chainId, index]) ) diff --git a/packages/stateful/components/profile/ProfileDaos.tsx b/packages/stateful/components/profile/ProfileDaos.tsx index 692a72225..762684738 100644 --- a/packages/stateful/components/profile/ProfileDaos.tsx +++ b/packages/stateful/components/profile/ProfileDaos.tsx @@ -32,9 +32,10 @@ export const ProfileDaos = () => { {missingChains && ( )} diff --git a/packages/stateful/hooks/index.ts b/packages/stateful/hooks/index.ts index 3760dee90..72d77ad14 100644 --- a/packages/stateful/hooks/index.ts +++ b/packages/stateful/hooks/index.ts @@ -23,6 +23,7 @@ export * from './useProposalActionState' export * from './useProposalPolytoneState' export * from './useProposalVetoState' export * from './useQuerySyncedRecoilState' +export * from './useRefreshProfile' export * from './useSimulateCosmosMsgs' export * from './useSyncWalletSigner' export * from './useTokenSwapStatusInfoForContract' diff --git a/packages/stateful/hooks/useEntity.ts b/packages/stateful/hooks/useEntity.ts index 1c6ebf27b..0d6d2a69f 100644 --- a/packages/stateful/hooks/useEntity.ts +++ b/packages/stateful/hooks/useEntity.ts @@ -62,7 +62,7 @@ export const useEntity = (address: string): UseEntityReturn => { address, name: null, imageUrl: getFallbackImage(address), - profile: makeEmptyUnifiedProfile(address), + profile: makeEmptyUnifiedProfile(chainId, address), } ) diff --git a/packages/stateful/hooks/useManageProfile.ts b/packages/stateful/hooks/useManageProfile.ts index 370c85972..4ad7a7b40 100644 --- a/packages/stateful/hooks/useManageProfile.ts +++ b/packages/stateful/hooks/useManageProfile.ts @@ -1,5 +1,6 @@ import { toHex } from '@cosmjs/encoding' -import { useCallback, useEffect, useRef, useState } from 'react' +import isEqual from 'lodash.isequal' +import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' import { waitForNone } from 'recoil' @@ -8,6 +9,7 @@ import { AddChainsFunction, AddChainsStatus, LoadingData, + OtherProfile, PfpkProfileUpdate, PfpkProfileUpdateFunction, UnifiedProfile, @@ -36,6 +38,10 @@ export type UseManageProfileOptions = { } export type UseManageProfileReturn = { + /** + * The current chain the profile is loading from for the connected wallet. + */ + chainId: string /** * Whether or not the current wallet is connected. When an address is passed, * this will be false. @@ -87,13 +93,33 @@ export type UseManageProfileReturn = { go: AddChainsFunction } /** - * Profiles on the other chains the current wallet is connected to. + * Data required to merge profiles. */ - otherProfiles: { - chainId: string - address: string - profile: UnifiedProfile - }[] + merge: { + /** + * Profiles on all the chains the current wallet is connected to where the + * current chain wallet is not registered. These are all the profiles that + * should be merged into this one if chosen. + * + * This may include the current chain wallet if it has not yet been added to + * the current profile. This can occur because a public key resolves to a + * profile even when that public key hasn't been assigned to this particular + * chain. Thus, an address on a chain will resolve to a profile when + * searched by public key or address, regardless of if that public + * key/address has been added for that chain. + */ + otherProfiles: OtherProfile[] + /** + * The merge options presented to the user based on all the profiles found. + * This combines the current profile and the other profiles, de-dupes them, + * and prioritizes based on a few heuristics, such as a name being set and + * the number of chains added to a profile. + * + * This is only populated if other profiles exist. Otherwise, this will be + * empty. + */ + options: OtherProfile[] + } } /** @@ -119,12 +145,12 @@ export const useManageProfile = ({ chainId: walletChainId, address, }), - makeEmptyUnifiedProfile(address) + makeEmptyUnifiedProfile(walletChainId, address) ) const refreshProfile = useRefreshProfile(address, profile) - const pfpkApi = useCfWorkerAuthPostRequest(PFPK_API_BASE, '', chainId) + const pfpkApi = useCfWorkerAuthPostRequest(PFPK_API_BASE, '', walletChainId) const ready = !profile.loading && @@ -343,17 +369,18 @@ export const useManageProfile = ({ } } - // Find whichever other chain wallets are currently connected so we can check - // all the profiles attached to the current wallet. Different chains may use + // Find whichever chain wallets are currently connected so we can check all + // the profiles attached to the current wallet. Different chains may use // different public keys, so we need to check all of them in order to prompt - // to merge them. + // to merge them. Also check the same chain as the current chain wallet in + // case the current chain has not yet been added to the profile. Profiles + // resolve by public key / bech32 hash, which means a profile may resolve for + // an address even if the address has not yet been added. We should still + // prompt to add the current chain wallet to its profile if it's missing. const otherConnectedChainWallets = ( currentChainWallet?.mainWallet.getChainWalletList() || [] ).filter( - (chainWallet) => - !!chainWallet.isWalletConnected && - !!chainWallet.address && - chainWallet.chainId !== walletChainId + (chainWallet) => !!chainWallet.isWalletConnected && !!chainWallet.address ) const otherChainWalletProfiles = useCachedLoadingWithError( waitForNone( @@ -366,36 +393,124 @@ export const useManageProfile = ({ ) ) - // Get all profiles attached to this wallet on the other chains which do not - // have the current chain wallet registered. - const otherProfiles = - currentChainWallet && - !profile.loading && - !otherChainWalletProfiles.loading && - !otherChainWalletProfiles.errored - ? otherChainWalletProfiles.data.flatMap((loadable, index) => { - const profile = loadable.valueMaybe() - const thisChainWallet = otherConnectedChainWallets[index] - if ( - !profile || - // Ignore if the current chain wallet is registered on this profile, - // indicating that these are the same profile. - profile.chains[currentChainWallet.chainId]?.address === address || - // Type-check. - !thisChainWallet.address - ) { - return [] + const merge: UseManageProfileReturn['merge'] = useMemo(() => { + // Get all profiles attached to this wallet which do not have the current + // chain wallet registered. + const otherProfiles = + currentChainWallet && + !profile.loading && + !otherChainWalletProfiles.loading && + !otherChainWalletProfiles.errored + ? otherChainWalletProfiles.data.flatMap((loadable) => { + const chainProfile = loadable.valueMaybe() + if ( + !chainProfile || + // Ignore if the current chain wallet is registered on this + // chain's profile, indicating that these are the same profile. + chainProfile.chains[currentChainWallet.chainId]?.address === + address || + // Ignore if the current profile has registered this chain wallet, + // indicating that these are the same profile. + profile.data.chains[chainProfile.source.chainId]?.address === + chainProfile.source.address + ) { + return [] + } + + return { + ...chainProfile.source, + profile: chainProfile, + } + }) + : [] + + // Merge options are only needed if other profiles exist. + let options: OtherProfile[] = [] + if (otherProfiles.length > 0) { + options = [ + ...(profile.loading + ? [] + : [ + { + chainId: walletChainId, + address, + profile: profile.data, + }, + ]), + ...otherProfiles, + ] + .sort((a, b) => { + // Priority: + // - name set + // - NFT set + // - number of chains + if (a.profile.name && !b.profile.name) { + return -1 + } else if (!a.profile.name && b.profile.name) { + return 1 + } else if (a.profile.nft && !b.profile.nft) { + return -1 + } else if (!a.profile.nft && b.profile.nft) { + return 1 } - return { - chainId: thisChainWallet.chainId, - address: thisChainWallet.address, - profile, + const aChains = Object.keys(a.profile.chains).length + const bChains = Object.keys(b.profile.chains).length + if (aChains > bChains) { + return -1 + } else if (aChains < bChains) { + return 1 } + + // If all else equal, sort by nonce as a heuristic for which is older. + return b.profile.nonce - a.profile.nonce }) - : [] + // Remove duplicates by detecting which profiles have the same chains. + // Since they are all the same profile, we only need one. + .reduce((acc, otherProfile) => { + if ( + !acc.some( + ({ chainId, address, profile }) => + (chainId === otherProfile.chainId && + address === otherProfile.address) || + // Make sure chains exist and this isn't an empty profile. + (Object.keys(profile.chains).length > 0 && + // Deep compare chains. + isEqual(profile.chains, otherProfile.profile.chains)) + ) + ) { + acc.push(otherProfile) + } + + return acc + }, [] as OtherProfile[]) + + // If any profiles in the list have been used before, remove any that + // haven't. + if (options.some(({ profile }) => profile.nonce > 0)) { + options = options.filter(({ profile }) => profile.nonce > 0) + } + // If no profile in the list has been used before, remove all but one + // since it doesn't matter which is chosen. + else { + options = options.slice(0, 1) + } + } + + return { + otherProfiles, + options, + } + }, [ + address, + currentChainWallet, + otherChainWalletProfiles, + profile, + walletChainId, + ]) return { + chainId: walletChainId, // Connected is only relevant when using the currently connected wallet. If // an address is passed, set connected to false. connected: address ? false : isWalletConnected, @@ -411,6 +526,6 @@ export const useManageProfile = ({ status: addChainsStatus, go: addChains, }, - otherProfiles, + merge, } } diff --git a/packages/stateful/hooks/useProfile.ts b/packages/stateful/hooks/useProfile.ts index 22ea6cd65..d7f5202cb 100644 --- a/packages/stateful/hooks/useProfile.ts +++ b/packages/stateful/hooks/useProfile.ts @@ -90,7 +90,7 @@ export const useProfile = ({ chainId: walletChainId, address: profileAddress, }), - makeEmptyUnifiedProfile(profileAddress) + makeEmptyUnifiedProfile(walletChainId, profileAddress) ) const refreshProfile = useRefreshProfile(profileAddress, profile) diff --git a/packages/stateful/package.json b/packages/stateful/package.json index a1ef4c750..9d769fa67 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -51,6 +51,7 @@ "i18next": "^21.8.10", "json5": "^2.2.0", "lodash.clonedeep": "^4.5.0", + "lodash.isequal": "^4.5.0", "lodash.merge": "^4.6.2", "lodash.uniq": "^4.5.0", "next-seo": "^5.4.0", @@ -75,6 +76,7 @@ "@storybook/react": "^6.5.10", "@types/file-saver": "^2.0.5", "@types/lodash.clonedeep": "^4.5.0", + "@types/lodash.isequal": "^4.5.8", "@types/lodash.merge": "^4.6.7", "@types/lodash.uniq": "^4.5.7", "@types/papaparse": "^5.3.7", diff --git a/packages/stateful/recoil/selectors/profile.ts b/packages/stateful/recoil/selectors/profile.ts index 3e48ef163..69f0719f8 100644 --- a/packages/stateful/recoil/selectors/profile.ts +++ b/packages/stateful/recoil/selectors/profile.ts @@ -32,8 +32,15 @@ export const EMPTY_PFPK_PROFILE: PfpkProfile = { chains: {}, } -export const makeEmptyUnifiedProfile = (address: string): UnifiedProfile => ({ +export const makeEmptyUnifiedProfile = ( + chainId: string, + address: string +): UnifiedProfile => ({ ...EMPTY_PFPK_PROFILE, + source: { + chainId, + address, + }, nameSource: 'pfpk', imageUrl: getFallbackImage(address), backupImageUrl: getFallbackImage(address), @@ -76,10 +83,9 @@ export const pfpkProfileForBech32HashSelector = selectorFamily< if (response.ok) { const profile: PfpkProfile = await response.json() - // If profile found, add refresher dependencies on the other public - // keys in the profile. This ensures that the profile will update for - // all other public keys when any of the other public keys update the - // profile. + // If profile found, add refresher dependencies for the other chains + // in the profile. This ensures that the profile will update for all + // other chains when any of the other chains update the profile. if (profile?.chains) { get( waitForAll( @@ -188,14 +194,13 @@ export const profileSelector = selectorFamily< get: ({ address, chainId }) => ({ get }) => { + const profile = makeEmptyUnifiedProfile(chainId, address) if (!address) { - return makeEmptyUnifiedProfile(address) + return profile } get(refreshWalletProfileAtom(toBech32Hash(address))) - const profile = makeEmptyUnifiedProfile(address) - const pfpkProfile = get(pfpkProfileSelector(address)) if (pfpkProfile) { profile.nonce = pfpkProfile.nonce diff --git a/packages/stateless/components/layout/DappLayout.tsx b/packages/stateless/components/layout/DappLayout.tsx index 637d82681..6eeb0cf97 100644 --- a/packages/stateless/components/layout/DappLayout.tsx +++ b/packages/stateless/components/layout/DappLayout.tsx @@ -131,10 +131,10 @@ export const DappLayout = ({ navigationProps.inboxCount.data > 0, }, { - key: 'account', + key: 'profile', href: '/me', pathnames: ['/me/[[...tab]]'], - labelI18nKey: 'title.account', + labelI18nKey: 'title.profile', IconUnselected: DockWallet, IconSelected: DockWallet, compact: true, diff --git a/packages/stateless/components/layout/DappNavigation.tsx b/packages/stateless/components/layout/DappNavigation.tsx index edcb354c2..a3285f1b6 100644 --- a/packages/stateless/components/layout/DappNavigation.tsx +++ b/packages/stateless/components/layout/DappNavigation.tsx @@ -214,7 +214,7 @@ export const DappNavigation = ({ LinkWrapper={LinkWrapper} compact={compact} href="/me" - label={t('title.account')} + label={t('title.profile')} selected={asPath.startsWith('/me')} /> diff --git a/packages/stateless/components/profile/ProfileAddChains.tsx b/packages/stateless/components/profile/ProfileAddChains.tsx index 323c9c150..cfab9ce8f 100644 --- a/packages/stateless/components/profile/ProfileAddChains.tsx +++ b/packages/stateless/components/profile/ProfileAddChains.tsx @@ -1,4 +1,4 @@ -import { Check, InfoOutlined } from '@mui/icons-material' +import { Add, Check, Close, InfoOutlined } from '@mui/icons-material' import clsx from 'clsx' import { useFieldArray, useFormContext } from 'react-hook-form' import { useTranslation } from 'react-i18next' @@ -7,7 +7,7 @@ import { ProfileAddChainsForm, ProfileAddChainsProps } from '@dao-dao/types' import { Button } from '../buttons' import { ChainLabel } from '../chain' -import { FormCheckbox } from '../inputs' +import { IconButton } from '../icon_buttons' import { Loader } from '../logo' import { ChainPickerPopup } from '../popup' @@ -22,30 +22,81 @@ export const ProfileAddChains = ({ size = 'default', onlySupported = false, autoAdd = false, + textPrompt = false, className, }: ProfileAddChainsProps) => { const { t } = useTranslation() - const { control, watch, setValue, handleSubmit } = + const { control, watch, handleSubmit } = useFormContext() const chainsBeingAdded = watch('chains') - const { append: appendChain } = useFieldArray({ + const { append: appendChain, remove: removeChain } = useFieldArray({ control, name: 'chains', }) + const formActive = chainsBeingAdded.length > 0 + return (
+ {formActive && ( +
+ {chainsBeingAdded.map(({ chainId, status }, index) => ( +
+ + + {status === 'idle' ? ( + removeChain(index)} + size="xs" + variant="ghost" + /> + ) : status === 'loading' ? ( +
+ +
+ ) : status === 'done' ? ( + + ) : null} +
+ ))} +
+ )} + - {!!promptTooltip && ( - // Show info icon to indicate tooltip is available. - - )} + trigger={ + chainsBeingAdded.length === 0 + ? { + type: 'button', + tooltip: promptTooltip, + props: { + className: 'self-end', + contentContainerClassName: clsx( + textPrompt && '!secondary-text', + promptClassName + ), + children: ( + <> + {!!promptTooltip && ( + // Show info icon to indicate tooltip is available. + + )} - {prompt} - - ), - disabled, - }, - }} + {prompt} + + ), + variant: textPrompt ? 'none' : 'brand', + size: 'lg', + disabled, + }, + } + : { + type: 'icon_button', + props: { + // Round to match checkbox. + className: clsx('self-end !rounded', { + '-mt-1': size === 'sm', + '-mt-3': size === 'default', + }), + Icon: Add, + variant: 'primary', + size: 'xs', + disabled: status !== 'idle', + }, + } + } /> - {chainsBeingAdded.length > 0 && ( -
-
- {chainsBeingAdded.map(({ chainId, checked, status }, index) => ( -
setValue(`chains.${index}.checked`, !checked)} - > - {status === 'idle' ? ( - - ) : status === 'loading' ? ( -
- -
- ) : status === 'done' ? ( - - ) : null} - - -
- ))} -
- - -
+ {t('button.addChains')} + )} ) diff --git a/packages/stateless/components/profile/ProfileWallet.tsx b/packages/stateless/components/profile/ProfileWallet.tsx index 31fcf8403..e4c42ce9e 100644 --- a/packages/stateless/components/profile/ProfileWallet.tsx +++ b/packages/stateless/components/profile/ProfileWallet.tsx @@ -172,8 +172,9 @@ export const ProfileWallet = ({
) diff --git a/packages/stateless/components/wallet/NavWalletConnected.tsx b/packages/stateless/components/wallet/NavWalletConnected.tsx index ab8bf4fa2..2e9772611 100644 --- a/packages/stateless/components/wallet/NavWalletConnected.tsx +++ b/packages/stateless/components/wallet/NavWalletConnected.tsx @@ -25,7 +25,7 @@ import { WalletLogo } from './WalletLogo' export const NavWalletConnected = ({ wallet, profile, - otherProfilesExist, + mergeProfileType, onMergeProfiles, disconnect, className, @@ -141,15 +141,10 @@ export const NavWalletConnected = ({ {mode !== 'dock' && !profile.loading && profile.data.nonce > -1 && - otherProfilesExist && ( + mergeProfileType && ( { const { t } = useTranslation() const canEditProfile = - editable && - !profile.loading && - profile.data.nonce >= 0 && - !otherProfilesExist + editable && !profile.loading && profile.data.nonce >= 0 && !mergeProfileType return (
-1 && - otherProfilesExist && ( + mergeProfileType && ( diff --git a/packages/storybook/utils.ts b/packages/storybook/utils.ts index 88f8bc2ac..d20e026a7 100644 --- a/packages/storybook/utils.ts +++ b/packages/storybook/utils.ts @@ -8,6 +8,10 @@ export const WALLET_PROFILE_DATA: UnifiedProfile = { name: '@Modern-Edamame', nft: null, chains: {}, + source: { + chainId: CHAIN_ID, + address: 'address', + }, imageUrl: '/noah.jpg', nameSource: 'pfpk', backupImageUrl: '/placeholder/1.svg', diff --git a/packages/types/components/NavWalletConnected.ts b/packages/types/components/NavWalletConnected.ts index 77e5c2434..168208c21 100644 --- a/packages/types/components/NavWalletConnected.ts +++ b/packages/types/components/NavWalletConnected.ts @@ -21,9 +21,10 @@ export type NavWalletConnectedProps = { disconnect: () => void | Promise /** * If set, show a tooltip that explains there are multiple profiles attached - * to the current wallet and prompt to merge them. + * to the current wallet and prompt to merge them. The type determines the + * text to show based on the context. */ - otherProfilesExist?: boolean + mergeProfileType?: 'add' | 'merge' /** * Callback to show merge profiles modal. */ diff --git a/packages/types/components/ProfileAddChains.ts b/packages/types/components/ProfileAddChains.ts index 007a798e1..85804e34a 100644 --- a/packages/types/components/ProfileAddChains.ts +++ b/packages/types/components/ProfileAddChains.ts @@ -50,6 +50,10 @@ export type ProfileAddChainsProps = { * multiple and showing checkboxes. Defaults to `false`. */ autoAdd?: boolean + /** + * Optionally use text button style for prompt. Defaults to `false`. + */ + textPrompt?: boolean /** * Optional container class name. */ @@ -59,7 +63,6 @@ export type ProfileAddChainsProps = { export type ProfileAddChainsForm = { chains: { chainId: string - checked: boolean /** * Status to display while submitting. */ diff --git a/packages/types/components/WalletProfileHeader.ts b/packages/types/components/WalletProfileHeader.ts index f10d7356a..28dc11ecb 100644 --- a/packages/types/components/WalletProfileHeader.ts +++ b/packages/types/components/WalletProfileHeader.ts @@ -13,14 +13,14 @@ export type WalletProfileHeaderProps = { */ profile: LoadingData /** - * Whether or not other profiles are attached to the current wallet. Only - * relevant when editable is true. This is used to prompt the user to merge - * their profiles, and it prevents editing until that is done. + * If set, show a tooltip that explains there are multiple profiles attached + * to the current wallet and prompt to merge them. The type determines the + * text to show based on the context. */ - otherProfilesExist?: boolean + mergeProfileType?: 'add' | 'merge' /** - * Function to open merge profiles modal. This is only used if - * editable is true and otherProfilesExist is true. + * Function to open merge profiles modal. This is only used if editable is + * true and mergeProfileType is defined. */ openMergeProfilesModal?: () => void /** diff --git a/packages/types/profile.ts b/packages/types/profile.ts index 66a938a65..0a7b87695 100644 --- a/packages/types/profile.ts +++ b/packages/types/profile.ts @@ -48,6 +48,19 @@ export type UnifiedProfileNameSource = 'pfpk' | 'stargaze' * PFPK. */ export type UnifiedProfile = PfpkProfile & { + /** + * The source chain and address used to load the profile. + */ + source: { + /** + * The chain ID of the source. + */ + chainId: string + /** + * The address of the source. + */ + address: string + } /** * Image URL to use, which takes into account backup data sources if PFPK does * not have an NFT set. @@ -129,3 +142,21 @@ export type AddChainsFunction = ( setChainStatus?: (chainId: string, status: AddChainsChainStatus) => void } ) => Promise + +/** + * Another profile connected on the same wallet. Used in `useManageProfile`. + */ +export type OtherProfile = { + /** + * The chain ID of the chain. + */ + chainId: string + /** + * The address for the profile on this chain. + */ + address: string + /** + * The profile. + */ + profile: UnifiedProfile +} diff --git a/yarn.lock b/yarn.lock index 8048715df..1bca5398e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7976,6 +7976,13 @@ dependencies: "@types/lodash" "*" +"@types/lodash.isequal@^4.5.8": + version "4.5.8" + resolved "https://registry.yarnpkg.com/@types/lodash.isequal/-/lodash.isequal-4.5.8.tgz#b30bb6ff6a5f6c19b3daf389d649ac7f7a250499" + integrity sha512-uput6pg4E/tj2LGxCZo9+y27JNyB2OZuuI/T5F+ylVDYuqICLG2/ktjxx0v6GvVntAf8TvEzeQLcV0ffRirXuA== + dependencies: + "@types/lodash" "*" + "@types/lodash.merge@^4.6.7": version "4.6.7" resolved "https://registry.yarnpkg.com/@types/lodash.merge/-/lodash.merge-4.6.7.tgz#0af6555dd8bc6568ef73e5e0d820a027362946b1" From c4bda7b8071ad6e8b14b89d664fd421075f2c68f Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 5 Mar 2024 20:35:17 -0800 Subject: [PATCH 019/438] fixed wallet token card claiming and hiding --- .../components/wallet/WalletTokenCard.tsx | 40 +++++++----- .../hooks/useCfWorkerAuthPostRequest.ts | 64 +++++++++++++++---- packages/stateful/hooks/useWallet.ts | 9 +++ 3 files changed, 83 insertions(+), 30 deletions(-) diff --git a/packages/stateful/components/wallet/WalletTokenCard.tsx b/packages/stateful/components/wallet/WalletTokenCard.tsx index 9f40f0ad3..7fea81f75 100644 --- a/packages/stateful/components/wallet/WalletTokenCard.tsx +++ b/packages/stateful/components/wallet/WalletTokenCard.tsx @@ -38,6 +38,7 @@ import { import { useAwaitNextBlock, useCfWorkerAuthPostRequest, + useProfile, useWallet, useWalletBalances, } from '../../hooks' @@ -53,14 +54,14 @@ import { WalletStakingModal } from './WalletStakingModal' export const WalletTokenCard = (props: TokenCardInfo) => { const { t } = useTranslation() - const nativeToken = getNativeTokenForChainId(props.token.chainId) - const { - address: walletAddress = '', - hexPublicKey, - getSigningCosmWasmClient, - } = useWallet({ + const { chains } = useProfile() + + const profileChain = chains.loading + ? undefined + : chains.data.find((c) => c.chainId === props.token.chainId) + + const { chainWallet } = useWallet({ chainId: props.token.chainId, - loadAccount: true, }) const { refreshBalances } = useWalletBalances({ chainId: props.token.chainId, @@ -81,7 +82,7 @@ export const WalletTokenCard = (props: TokenCardInfo) => { // Refresh staking info. const setRefreshNativeTokenStakingInfo = useSetRecoilState( - refreshNativeTokenStakingInfoAtom(walletAddress) + refreshNativeTokenStakingInfoAtom(profileChain?.address) ) const refreshNativeTokenStakingInfo = useCallback( () => setRefreshNativeTokenStakingInfo((id) => id + 1), @@ -102,12 +103,10 @@ export const WalletTokenCard = (props: TokenCardInfo) => { ) const setTemporaryHiddenBalances = useSetRecoilState( - temporaryHiddenBalancesAtom(hexPublicKey.loading ? '' : hexPublicKey.data) + temporaryHiddenBalancesAtom(profileChain?.publicKey || '') ) const hiddenBalancesLoadable = useCachedLoadable( - !hexPublicKey.loading - ? hiddenBalancesSelector(hexPublicKey.data) - : undefined + profileChain ? hiddenBalancesSelector(profileChain.publicKey) : undefined ) const isHidden = hiddenBalancesLoadable.state === 'hasValue' @@ -119,6 +118,7 @@ export const WalletTokenCard = (props: TokenCardInfo) => { const setBalanceHidden = async (hidden: boolean) => { if (!hiddenBalancesReady) { toast.error(t('error.logInToContinue')) + return } setSavingHidden(true) @@ -145,6 +145,7 @@ export const WalletTokenCard = (props: TokenCardInfo) => { } } + const nativeToken = getNativeTokenForChainId(props.token.chainId) const isNative = props.token.type === TokenType.Native && props.token.denomOrAddress === nativeToken.denomOrAddress @@ -168,16 +169,23 @@ export const WalletTokenCard = (props: TokenCardInfo) => { if (!claimReady) { return } - if (!walletAddress) { + if (!chainWallet) { toast.error(t('error.logInToContinue')) return } setClaimLoading(true) try { - const signingCosmWasmClient = await getSigningCosmWasmClient() + if (!chainWallet.isWalletConnected) { + await chainWallet.connect(false) + } + if (!chainWallet.address) { + throw new Error(t('error.logInToContinue')) + } + + const signingCosmWasmClient = await chainWallet.getSigningCosmWasmClient() await signingCosmWasmClient.signAndBroadcast( - walletAddress, + chainWallet.address, (lazyInfo.loading ? [] : lazyInfo.data.stakingInfo!.stakes).map( ({ validator }) => cwMsgToEncodeObject( @@ -188,7 +196,7 @@ export const WalletTokenCard = (props: TokenCardInfo) => { }, }, }, - walletAddress + chainWallet.address! ) ), CHAIN_GAS_MULTIPLIER diff --git a/packages/stateful/hooks/useCfWorkerAuthPostRequest.ts b/packages/stateful/hooks/useCfWorkerAuthPostRequest.ts index cf6fd6967..0328a2c1e 100644 --- a/packages/stateful/hooks/useCfWorkerAuthPostRequest.ts +++ b/packages/stateful/hooks/useCfWorkerAuthPostRequest.ts @@ -1,3 +1,4 @@ +import { toHex } from '@cosmjs/encoding' import { useCallback } from 'react' import { useTranslation } from 'react-i18next' @@ -21,21 +22,51 @@ export const useCfWorkerAuthPostRequest = ( chainId?: string ) => { const { t } = useTranslation() - const { getOfflineSignerAmino, chain, hexPublicKey } = useWallet({ + const { chain, hexPublicKey, chainWallet } = useWallet({ chainId, loadAccount: true, }) - const ready = !hexPublicKey.loading + // Either the hex public key loaded, or we have a chain wallet that we can + // attempt connection to. + const ready = !hexPublicKey.loading || !!chainWallet - const getNonce = useCallback(async () => { - if (!ready) { + const getHexPublicKey = useCallback(async () => { + if (!hexPublicKey.loading) { + return hexPublicKey.data + } + + // If hex public key not loaded, load it from the wallet. + if (!chainWallet) { + throw new Error(t('error.loadingData')) + } + + // Attempt to connect if needed. + if (!chainWallet.isWalletConnected) { + await chainWallet.connect(false) + } + + // If still disconnected, throw. + if (!chainWallet.isWalletConnected) { throw new Error(t('error.logInToContinue')) } + // Get public key from wallet client, if possible. + const publicKey = (await chainWallet.client.getAccount?.(chain.chain_id)) + ?.pubkey + if (!publicKey) { + throw new Error(t('error.unsupportedWallet')) + } + + return toHex(publicKey) + }, [chain.chain_id, chainWallet, hexPublicKey, t]) + + const getNonce = useCallback(async () => { + const hexPublicKey = await getHexPublicKey() + // Fetch nonce. const nonceResponse: { nonce: number } = await ( - await fetch(`${apiBase}/nonce/${hexPublicKey.data}`, { + await fetch(`${apiBase}/nonce/${hexPublicKey}`, { cache: 'no-store', }) ).json() @@ -43,7 +74,7 @@ export const useCfWorkerAuthPostRequest = ( !('nonce' in nonceResponse) || typeof nonceResponse.nonce !== 'number' ) { - console.error('Failed to fetch nonce.', nonceResponse, hexPublicKey.data) + console.error('Failed to fetch nonce.', nonceResponse, hexPublicKey) throw new Error(t('error.loadingData')) } @@ -55,7 +86,7 @@ export const useCfWorkerAuthPostRequest = ( } return nonce - }, [apiBase, hexPublicKey, ready, t]) + }, [apiBase, getHexPublicKey, t]) const postRequest = useCallback( async ( @@ -63,8 +94,14 @@ export const useCfWorkerAuthPostRequest = ( data?: Record, signatureType = defaultSignatureType ): Promise => { - if (!ready) { - throw new Error(t('error.logInToContinue')) + const hexPublicKey = await getHexPublicKey() + + const offlineSignerAmino = + await chainWallet?.client.getOfflineSignerAmino?.bind( + chainWallet.client + )?.(chain.chain_id) + if (!offlineSignerAmino) { + throw new Error(t('error.unsupportedWallet')) } // Fetch nonce. @@ -74,9 +111,9 @@ export const useCfWorkerAuthPostRequest = ( type: signatureType, nonce, chainId: chain.chain_id, - hexPublicKey: hexPublicKey.data, + hexPublicKey, data, - offlineSignerAmino: await getOfflineSignerAmino(), + offlineSignerAmino, }) // Send request. @@ -108,11 +145,10 @@ export const useCfWorkerAuthPostRequest = ( }, [ defaultSignatureType, - ready, + getHexPublicKey, + chainWallet, getNonce, chain.chain_id, - hexPublicKey, - getOfflineSignerAmino, apiBase, t, ] diff --git a/packages/stateful/hooks/useWallet.ts b/packages/stateful/hooks/useWallet.ts index 20bce1e26..db5184434 100644 --- a/packages/stateful/hooks/useWallet.ts +++ b/packages/stateful/hooks/useWallet.ts @@ -169,6 +169,15 @@ export const useWallet = ({ const response = useMemo( (): UseWalletReturn => ({ ...walletChainRef.current, + chainWallet: + walletChainRef.current.chainWallet || + // Fallback to getting chain wallet from repo if not set on walletChain. + // This won't be set if the walletChain is disconnected. + (mainWalletRef.current + ? getWalletRepo(chain.chain_name).getWallet( + mainWalletRef.current.walletName + ) + : undefined), connect, // Use chain from our version of the chain-registry. chain, From 61d57ae09c63c8b345141f9c684e20948e70f05e Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 5 Mar 2024 22:48:09 -0800 Subject: [PATCH 020/438] removed ugly log in required page --- packages/i18n/locales/en/translation.json | 1 + .../stateful/components/ConnectWallet.tsx | 2 +- packages/stateful/components/pages/Inbox.tsx | 12 +++--- packages/stateful/components/pages/Me.tsx | 13 +++--- .../components/wallet/WalletProfileHeader.tsx | 27 ++++++++---- .../pages/LogInRequiredPage.stories.tsx | 29 ------------- .../stateless/pages/LogInRequiredPage.tsx | 20 --------- packages/stateless/pages/Profile.tsx | 43 ++++++++++++++++--- packages/stateless/pages/index.ts | 1 - .../types/components/WalletProfileHeader.ts | 4 +- 10 files changed, 73 insertions(+), 79 deletions(-) delete mode 100644 packages/stateless/pages/LogInRequiredPage.stories.tsx delete mode 100644 packages/stateless/pages/LogInRequiredPage.tsx diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 4dcfa1a59..9d1489289 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -1027,6 +1027,7 @@ "loadingMembership": "Loading membership...", "loadingProposalStatus": "The proposal is loading...", "logInToViewMembership": "Log in to view your membership status in the DAO.", + "logInToViewPage": "Log in to view this page.", "logo": "Logo", "lowestUsdValue": "Lowest USD value", "majority": "Majority (>50%)", diff --git a/packages/stateful/components/ConnectWallet.tsx b/packages/stateful/components/ConnectWallet.tsx index dbe8b0d60..c75a0d2a1 100644 --- a/packages/stateful/components/ConnectWallet.tsx +++ b/packages/stateful/components/ConnectWallet.tsx @@ -56,7 +56,7 @@ export const ConnectWallet = (props: StatefulConnectWalletProps) => { : undefined ) } - variant="primary" + variant="brand" {...props} /> diff --git a/packages/stateful/components/pages/Inbox.tsx b/packages/stateful/components/pages/Inbox.tsx index cf40b4645..5d1a1f970 100644 --- a/packages/stateful/components/pages/Inbox.tsx +++ b/packages/stateful/components/pages/Inbox.tsx @@ -4,7 +4,7 @@ import { NextSeo } from 'next-seo' import { useRouter } from 'next/router' import { useTranslation } from 'react-i18next' -import { LogInRequiredPage, Inbox as StatelessInbox } from '@dao-dao/stateless' +import { Inbox as StatelessInbox, WarningCard } from '@dao-dao/stateless' import { NOTIFICATIONS_PAGE_DESCRIPTION, NOTIFICATIONS_PAGE_TITLE, @@ -14,14 +14,13 @@ import { } from '@dao-dao/utils' import { useInboxApiWithUi, useWallet } from '../../hooks' -import { ConnectWallet } from '../ConnectWallet' import { InboxMainItemRenderer } from '../inbox' import { PageHeaderContent } from '../PageHeaderContent' export const Inbox: NextPage = () => { const { t } = useTranslation() const { asPath } = useRouter() - const { isWalletConnected, isWalletConnecting } = useWallet() + const { isWalletConnected, connect } = useWallet() const inbox = useInboxApiWithUi({ mode: 'page', @@ -64,9 +63,10 @@ export const Inbox: NextPage = () => { inbox={inbox} /> ) : ( - } - connecting={isWalletConnecting} + )}
diff --git a/packages/stateful/components/pages/Me.tsx b/packages/stateful/components/pages/Me.tsx index b96bd790b..0c58c2e0a 100644 --- a/packages/stateful/components/pages/Me.tsx +++ b/packages/stateful/components/pages/Me.tsx @@ -19,7 +19,6 @@ import { import { ChainProvider, Loader, - LogInRequiredPage, PageLoader, Profile as StatelessProfile, useCachedLoadable, @@ -72,7 +71,7 @@ export const Me: NextPage = () => { const { address: walletAddress = '', isWalletConnected, - isWalletConnecting, + connect, } = useWallet() const { profile, @@ -163,6 +162,7 @@ export const Me: NextPage = () => { {/* Suspend to prevent hydration error since we load state on first render from localStorage. */} }> { ) : ( - } - connecting={isWalletConnecting} + )} diff --git a/packages/stateless/components/wallet/WalletProfileHeader.tsx b/packages/stateless/components/wallet/WalletProfileHeader.tsx index 7ee87a48f..6c8c65794 100644 --- a/packages/stateless/components/wallet/WalletProfileHeader.tsx +++ b/packages/stateless/components/wallet/WalletProfileHeader.tsx @@ -18,7 +18,11 @@ export const WalletProfileHeader = ({ }: WalletProfileHeaderProps) => { const { t } = useTranslation() const canEditProfile = - editable && !profile.loading && profile.data.nonce >= 0 && !mergeProfileType + editable && + profile && + !profile.loading && + profile.data.nonce >= 0 && + !mergeProfileType return (
{editable && + profile && !profile.loading && profile.data.nonce > -1 && mergeProfileType && ( @@ -44,18 +49,22 @@ export const WalletProfileHeader = ({ )} - + {profile && ( + + )} {children}
diff --git a/packages/stateless/pages/LogInRequiredPage.stories.tsx b/packages/stateless/pages/LogInRequiredPage.stories.tsx deleted file mode 100644 index 3c09cb3a0..000000000 --- a/packages/stateless/pages/LogInRequiredPage.stories.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { ComponentMeta, ComponentStory } from '@storybook/react' - -import { - WalletProviderDecorator, - makeDappLayoutDecorator, -} from '@dao-dao/storybook/decorators' -import { ConnectWalletProps } from '@dao-dao/types' - -import { ConnectWallet } from '../components' -import { Default as ConnectWalletStory } from '../components/wallet/ConnectWallet.stories' -import { LogInRequiredPage } from './LogInRequiredPage' - -export default { - title: 'DAO DAO / packages / stateless / pages / LogInRequiredPage', - component: LogInRequiredPage, - decorators: [WalletProviderDecorator, makeDappLayoutDecorator()], -} as ComponentMeta - -const Template: ComponentStory = (args) => ( - -) - -export const Default = Template.bind({}) -Default.args = { - connectWalletButton: ( - - ), - connecting: false, -} diff --git a/packages/stateless/pages/LogInRequiredPage.tsx b/packages/stateless/pages/LogInRequiredPage.tsx deleted file mode 100644 index c526da1c7..000000000 --- a/packages/stateless/pages/LogInRequiredPage.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { ReactNode } from 'react' - -import { PageLoader } from '../components' - -export type LogInRequiredPageProps = { - connectWalletButton: ReactNode - connecting: boolean -} - -export const LogInRequiredPage = ({ - connectWalletButton, - connecting, -}: LogInRequiredPageProps) => - connecting ? ( - - ) : ( -
- {connectWalletButton} -
- ) diff --git a/packages/stateless/pages/Profile.tsx b/packages/stateless/pages/Profile.tsx index b9758706c..97d92ff9f 100644 --- a/packages/stateless/pages/Profile.tsx +++ b/packages/stateless/pages/Profile.tsx @@ -1,13 +1,15 @@ import { useRouter } from 'next/router' -import { useEffect } from 'react' +import { ComponentType, useEffect } from 'react' +import { useTranslation } from 'react-i18next' import { AccountTab, AccountTabId, + StatefulConnectWalletProps, WalletProfileHeaderProps, } from '@dao-dao/types' -import { TabBar, WalletProfileHeader } from '../components' +import { TabBar, WalletProfileHeader, WarningCard } from '../components' export type ProfileProps = { tabs: AccountTab[] @@ -18,9 +20,28 @@ export type ProfileProps = { | 'updateProfile' | 'mergeProfileType' | 'openMergeProfilesModal' -> +> & + ( + | { + connected: false + connect: () => Promise + ConnectWallet: ComponentType + } + | { + connected: true + connect?: never + ConnectWallet?: never + } + ) -export const Profile = ({ tabs, ...headerProps }: ProfileProps) => { +export const Profile = ({ + tabs, + connected, + connect, + ConnectWallet, + ...headerProps +}: ProfileProps) => { + const { t } = useTranslation() const router = useRouter() // Pre-fetch tabs. @@ -45,7 +66,9 @@ export const Profile = ({ tabs, ...headerProps }: ProfileProps) => { return (
- + + {!connected && } + @@ -56,7 +79,15 @@ export const Profile = ({ tabs, ...headerProps }: ProfileProps) => { /> {/* Don't render a tab unless it is visible. */} - {selectedTab && } + {connected ? ( + selectedTab && + ) : ( + + )}
) } diff --git a/packages/stateless/pages/index.ts b/packages/stateless/pages/index.ts index 989a1729e..27c94d607 100644 --- a/packages/stateless/pages/index.ts +++ b/packages/stateless/pages/index.ts @@ -5,7 +5,6 @@ export * from './DaoSdaWrappedTab' export * from './GovernanceDaos' export * from './Home' export * from './Inbox' -export * from './LogInRequiredPage' export * from './Profile' export * from './Proposal' export * from './Status' diff --git a/packages/types/components/WalletProfileHeader.ts b/packages/types/components/WalletProfileHeader.ts index 28dc11ecb..7b60b7a3d 100644 --- a/packages/types/components/WalletProfileHeader.ts +++ b/packages/types/components/WalletProfileHeader.ts @@ -9,9 +9,9 @@ export type WalletProfileHeaderProps = { */ editable: boolean /** - * The profile being displayed. + * The profile being displayed. If undefined, show logged in. */ - profile: LoadingData + profile: LoadingData | undefined /** * If set, show a tooltip that explains there are multiple profiles attached * to the current wallet and prompt to merge them. The type determines the From f78b168770e5b7a565de8dc9726b80fc1d37c321 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 5 Mar 2024 22:57:32 -0800 Subject: [PATCH 021/438] fixed downloading paginated votes and multiple choice votes CSV --- .../components/ProposalVotes/index.tsx | 11 +++++++- .../components/ProposalVotes/index.tsx | 2 ++ .../proposal/ProposalVotes.stories.tsx | 12 +++++++++ .../components/proposal/ProposalVotes.tsx | 25 ++++++++++++++++--- 4 files changed, 46 insertions(+), 4 deletions(-) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx index 7632cc829..99a938e88 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx @@ -9,7 +9,7 @@ import { import { EntityDisplay } from '../../../../../components/EntityDisplay' import { useProposalModuleAdapterOptions } from '../../../../react/context' -import { useLoadingProposal } from '../../hooks' +import { useLoadingProposal, useLoadingVoteOptions } from '../../hooks' import { VoteDisplay } from './VoteDisplay' const VOTES_PER_PAGE = 20 @@ -22,6 +22,7 @@ export const ProposalVotes = () => { } = useProposalModuleAdapterOptions() const loadingProposal = useLoadingProposal() + const voteOptions = useLoadingVoteOptions() const totalPower = loadingProposal.loading ? 0 @@ -67,6 +68,14 @@ export const ProposalVotes = () => { + voteOptions.loading + ? 'LOADING_ERROR' + : voteOptions.data.find( + (option) => option.value.option_id === vote.option_id + )?.label || 'UNKNOWN_ERROR' + } pagination={{ page, setPage, diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx index f81e8a292..7681791d5 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx @@ -67,6 +67,8 @@ export const ProposalVotes = () => { vote} pagination={{ page, setPage, diff --git a/packages/stateless/components/proposal/ProposalVotes.stories.tsx b/packages/stateless/components/proposal/ProposalVotes.stories.tsx index 66a5affb1..0cf115a65 100644 --- a/packages/stateless/components/proposal/ProposalVotes.stories.tsx +++ b/packages/stateless/components/proposal/ProposalVotes.stories.tsx @@ -36,6 +36,18 @@ export const makeProps = (): ProposalVotesProps => ({ votedAt: new Date(Date.now() - Math.random() * 5 * 24 * 60 * 60 * 1000), })), }, + allVotes: { + loading: false, + errored: false, + data: [...Array(10)].map(() => ({ + voterAddress: 'juno123ihuprfiuosdjfiu98349fi0ewjgui', + // 25% chance of No, 75% chance of Yes + vote: Math.random() < 0.25 ? Vote.No : Vote.Yes, + votingPowerPercent: 0.0432, + // Within the past 5 days. + votedAt: new Date(Date.now() - Math.random() * 5 * 24 * 60 * 60 * 1000), + })), + }, votingOpen: true, EntityDisplay: (props) => ( { footer?: ReactNode hideVotedAt?: boolean hideDownload?: boolean + /** + * All votes (non-paginated) for downloading the CSV. + */ + allVotes: LoadingDataWithError[]> + /** + * A function to convert the vote type into a string for the CSV. + */ + exportVoteTransformer: (vote: Vote) => string } export const ProposalVotes = ({ @@ -53,6 +61,8 @@ export const ProposalVotes = ({ footer, hideVotedAt, hideDownload, + allVotes, + exportVoteTransformer, }: ProposalVotesProps) => { const { t } = useTranslation() @@ -68,6 +78,15 @@ export const ProposalVotes = ({ (b.votedAt?.getTime() ?? -Infinity) - (a.votedAt?.getTime() ?? -Infinity) ) + const allVotesWithDate = + allVotes.loading || allVotes.errored + ? [] + : allVotes.data.sort( + (a, b) => + // Sort descending by date, and those without a date last. + (b.votedAt?.getTime() ?? -Infinity) - + (a.votedAt?.getTime() ?? -Infinity) + ) // If a new vote is added to existing votes and the window is scrolled to the // bottom, scroll to the bottom again to show the new vote. @@ -209,7 +228,7 @@ export const ProposalVotes = ({ {!hideDownload && ( - ) - } - task={task} - /> - ))} -
- - )} - -
- - -

{t('title.numTasks', { count: unstaking.length })}

-
- - {unstaking.length > 0 && ( -
- {unstaking.map((task, index) => ( - - ))} -
- )} - - {claimed.length > 0 && ( + ) : ( <> -
+ {/* Only show if something is ready to claim. */} + {readyToClaim.length > 0 && ( + <> +
+ {readyToClaim.map((task, index) => ( + + {t('button.claim')} + + ) + } + task={task} + /> + ))} +
+ + )} + +
-

- {claimed.length === 0 ? t('title.noHistory') : t('title.history')} -

+

{t('title.numTasks', { count: unstaking.length })}

-
- {claimed.map((task, index) => ( - - ))} -
+ {unstaking.length > 0 && ( +
+ {unstaking.map((task, index) => ( + + ))} +
+ )} + + {claimed.length > 0 && ( + <> +
+ + +

+ {claimed.length === 0 + ? t('title.noHistory') + : t('title.history')} +

+
+ +
+ {claimed.map((task, index) => ( + + ))} +
+ + )} )} diff --git a/packages/stateless/components/token/UnstakingStatus.tsx b/packages/stateless/components/token/UnstakingStatus.tsx index 5f74d3acd..59d1d6a52 100644 --- a/packages/stateless/components/token/UnstakingStatus.tsx +++ b/packages/stateless/components/token/UnstakingStatus.tsx @@ -22,7 +22,7 @@ export const UnstakingStatus = ({ status }: UnstakingStatusProps) => { Icon={Icon} iconClassName={clsx('!h-[19px] !w-[19px]', iconClassName)} label={t(`info.unstakingStatus.${status}`)} - labelClassName={clsx('w-10', textClassName)} + labelClassName={textClassName} /> ) } diff --git a/packages/types/contracts/OraichainCw20Staking.ts b/packages/types/contracts/OraichainCw20Staking.ts new file mode 100644 index 000000000..38a935329 --- /dev/null +++ b/packages/types/contracts/OraichainCw20Staking.ts @@ -0,0 +1,183 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +export type Addr = string +export interface InstantiateMsg { + owner?: Addr | null + rewarder: Addr +} +export type ExecuteMsg = + | { + receive: Cw20ReceiveMsg + } + | { + update_config: { + owner?: Addr | null + rewarder?: Addr | null + } + } + | { + register_asset: { + staking_token: Addr + unbonding_period?: number | null + } + } + | { + update_rewards_per_sec: { + assets: Asset[] + staking_token: Addr + } + } + | { + deposit_reward: { + rewards: RewardMsg[] + } + } + | { + unbond: { + amount: Uint128 + staking_token: Addr + } + } + | { + withdraw: { + staking_token?: Addr | null + } + } + | { + withdraw_others: { + staker_addrs: Addr[] + staking_token?: Addr | null + } + } +export type Uint128 = string +export type Binary = string +export type AssetInfo = + | { + token: { + contract_addr: Addr + } + } + | { + native_token: { + denom: string + } + } +export interface Cw20ReceiveMsg { + amount: Uint128 + msg: Binary + sender: string +} +export interface Asset { + amount: Uint128 + info: AssetInfo +} +export interface RewardMsg { + staking_token: Addr + total_accumulation_amount: Uint128 +} +export type QueryMsg = + | { + config: {} + } + | { + pool_info: { + staking_token: Addr + } + } + | { + rewards_per_sec: { + staking_token: Addr + } + } + | { + reward_info: { + staker_addr: Addr + staking_token?: Addr | null + } + } + | { + reward_infos: { + limit?: number | null + order?: number | null + staking_token: Addr + start_after?: Addr | null + } + } + | { + get_pools_information: {} + } + | { + lock_infos: { + limit?: number | null + order?: number | null + staker_addr: Addr + staking_token: Addr + start_after?: number | null + } + } + | { + staked_balance_at_height: { + address: string + asset_key: Addr + height?: number | null + } + } + | { + total_staked_at_height: { + asset_key: Addr + height?: number | null + } + } +export interface MigrateMsg {} +export interface ConfigResponse { + owner: Addr + rewarder: Addr +} +export type Decimal = string +export type ArrayOfQueryPoolInfoResponse = QueryPoolInfoResponse[] +export interface QueryPoolInfoResponse { + asset_key: string + pool_info: PoolInfoResponse +} +export interface PoolInfoResponse { + pending_reward: Uint128 + reward_index: Decimal + staking_token: Addr + total_bond_amount: Uint128 + unbonding_period?: number | null +} +export interface LockInfosResponse { + lock_infos: LockInfoResponse[] + staker_addr: Addr + staking_token: Addr +} +export interface LockInfoResponse { + amount: Uint128 + unlock_time: number +} +export interface RewardInfoResponse { + reward_infos: RewardInfoResponseItem[] + staker_addr: Addr +} +export interface RewardInfoResponseItem { + bond_amount: Uint128 + pending_reward: Uint128 + pending_withdraw: Asset[] + staking_token: Addr +} +export type ArrayOfRewardInfoResponse = RewardInfoResponse[] +export interface RewardsPerSecResponse { + assets: Asset[] +} +export interface StakedBalanceAtHeightResponse { + balance: Uint128 + height: number +} +export interface TotalStakedAtHeightResponse { + height: number + total: Uint128 +} diff --git a/packages/types/contracts/OraichainCw20StakingProxySnapshot.ts b/packages/types/contracts/OraichainCw20StakingProxySnapshot.ts new file mode 100644 index 000000000..d7161cde3 --- /dev/null +++ b/packages/types/contracts/OraichainCw20StakingProxySnapshot.ts @@ -0,0 +1,63 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +export type Addr = string +export interface InstantiateMsg { + asset_key: Addr + owner?: Addr | null + staking_contract: Addr +} +export type ExecuteMsg = { + update_config: { + asset_key?: Addr | null + owner?: Addr | null + staking_contract?: Addr | null + } +} +export type QueryMsg = + | { + get_config: {} + } + | { + config: {} + } + | { + staked_balance_at_height: { + address: string + height?: number | null + } + } + | { + total_staked_at_height: { + height?: number | null + } + } +export interface MigrateMsg {} +export interface ConfigResponse { + asset_key: Addr + owner: Addr + staking_contract: Addr +} +export type Duration = + | { + height: number + } + | { + time: number + } +export interface ConfigTokenStakingResponse { + token_address: Addr + unstaking_duration?: Duration | null +} +export type Uint128 = string +export interface StakedBalanceAtHeightResponse { + balance: Uint128 + height: number +} +export interface TotalStakedAtHeightResponse { + height: number + total: Uint128 +} diff --git a/packages/utils/constants/contracts.ts b/packages/utils/constants/contracts.ts index 67a9ff871..5b44efc31 100644 --- a/packages/utils/constants/contracts.ts +++ b/packages/utils/constants/contracts.ts @@ -13,6 +13,8 @@ export enum ContractName { NeutronCwdSubdaoPreProposeSingle = 'crates.io:cwd-subdao-pre-propose-single', NeutronCwdSubdaoTimelockSingle = 'crates.io:cwd-subdao-timelock-single', NeutronCwdPreProposeSingleOverrule = 'crates.io:cwd-pre-propose-single-overrule', + // https://github.com/oraichain/cw20-staking/tree/master/contracts/proxy-snapshot + OraichainCw20StakingProxySnapshot = 'cw20-staking-proxy-snapshot', } export const NEUTRON_SUBDAO_CORE_CONTRACT_NAMES = [ From 6cc5292346b99ce768d4a92cdd13d6a238697631 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 7 Mar 2024 11:47:19 -0800 Subject: [PATCH 029/438] show all profile account addresses in copy --- .../components/profile/ProfileWallet.tsx | 16 +++++++++++++++- .../components/profile/ProfileWallet.stories.tsx | 6 ++++-- .../components/profile/ProfileWallet.tsx | 16 +++++++++++----- packages/types/components/ProfileWallet.ts | 8 ++++---- 4 files changed, 34 insertions(+), 12 deletions(-) diff --git a/packages/stateful/components/profile/ProfileWallet.tsx b/packages/stateful/components/profile/ProfileWallet.tsx index 5d9acbf93..20b5143b5 100644 --- a/packages/stateful/components/profile/ProfileWallet.tsx +++ b/packages/stateful/components/profile/ProfileWallet.tsx @@ -1,5 +1,6 @@ import { constSelector, waitForAny } from 'recoil' +import { accountsSelector } from '@dao-dao/state/recoil' import { ProfileWallet as StatelessProfileWallet, useCachedLoadingWithError, @@ -15,6 +16,19 @@ import { ProfileAddChains } from './ProfileAddChains' export const ProfileWallet = () => { const { chains, uniquePublicKeys } = useProfile() + const accounts = useCachedLoadingWithError( + chains.loading + ? undefined + : waitForAny( + chains.data.map(({ chainId, address }) => + accountsSelector({ + chainId, + address, + }) + ) + ), + (chainLoadables) => chainLoadables.flatMap((l) => l.valueMaybe() || []) + ) const tokens = useCachedLoadingWithError( chains.loading @@ -49,7 +63,7 @@ export const ProfileWallet = () => { diff --git a/packages/stateless/components/profile/ProfileWallet.stories.tsx b/packages/stateless/components/profile/ProfileWallet.stories.tsx index 785878525..34d20cf06 100644 --- a/packages/stateless/components/profile/ProfileWallet.stories.tsx +++ b/packages/stateless/components/profile/ProfileWallet.stories.tsx @@ -17,8 +17,9 @@ const Template: ComponentStory> = ( export const Default = Template.bind({}) Default.args = { - chains: { + accounts: { loading: false, + errored: false, data: [], }, tokens: { @@ -37,8 +38,9 @@ Default.args = { export const Loading = Template.bind({}) Loading.args = { - chains: { + accounts: { loading: true, + errored: false, }, tokens: { loading: true, diff --git a/packages/stateless/components/profile/ProfileWallet.tsx b/packages/stateless/components/profile/ProfileWallet.tsx index e4c42ce9e..e527be8ac 100644 --- a/packages/stateless/components/profile/ProfileWallet.tsx +++ b/packages/stateless/components/profile/ProfileWallet.tsx @@ -21,7 +21,7 @@ import { FilterableItemPopup } from '../popup' import { TokenLineHeader } from '../token/TokenLineHeader' export const ProfileWallet = ({ - chains, + accounts, tokens, hiddenTokens, TokenLine, @@ -62,15 +62,16 @@ export const ProfileWallet = ({ ({ + : accounts.data.map(({ type, chainId, address }) => ({ key: chainId + address, label: getDisplayNameForChainId(chainId), iconUrl: getImageUrlForChainId(chainId), + description: concatAddressStartEnd(address, 10, 6), rightNode: ( -

- {concatAddressStartEnd(address, 10, 6)} +

+ {t(`accountTypeLabel.${type}`)}

), iconClassName: '!h-8 !w-8', @@ -94,6 +95,11 @@ export const ProfileWallet = ({ className: 'self-start', variant: 'secondary', contentContainerClassName: '!gap-1', + loading: accounts.loading, + disabled: + accounts.loading || + accounts.errored || + accounts.data.length === 0, children: ( <> diff --git a/packages/types/components/ProfileWallet.ts b/packages/types/components/ProfileWallet.ts index fd946f517..717ecf471 100644 --- a/packages/types/components/ProfileWallet.ts +++ b/packages/types/components/ProfileWallet.ts @@ -1,15 +1,15 @@ import { ComponentType } from 'react' -import { LoadingData, LoadingDataWithError } from '../misc' -import { ProfileChain } from '../profile' +import { Account } from '../account' +import { LoadingDataWithError } from '../misc' import { TokenCardInfo } from '../token' import { StatefulProfileAddChainsProps } from './ProfileAddChains' export type ProfileWalletProps = { /** - * List of profile chains. + * List of accounts for profile. */ - chains: LoadingData + accounts: LoadingDataWithError /** * List of tokens on all chains. */ From c2c45b94126a70ececadcdf97bfa4ad06792ab41 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 7 Mar 2024 11:51:35 -0800 Subject: [PATCH 030/438] fixed Link deprecation warning --- packages/stateless/components/LinkWrapper.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/stateless/components/LinkWrapper.tsx b/packages/stateless/components/LinkWrapper.tsx index 8a648dc3f..dc0f03143 100644 --- a/packages/stateless/components/LinkWrapper.tsx +++ b/packages/stateless/components/LinkWrapper.tsx @@ -64,7 +64,11 @@ export const LinkWrapper = forwardRef( className={contentClassName} href={href ?? '#'} onClick={onClick} - prefetch={prefetch} + prefetch={ + // Deprecation warning when `prefetch` is set to true. Undefined + // is default behavior, which is to prefetch. + prefetch ? undefined : false + } replace={replace} shallow={shallow} > From 0ec304e515dfcaf0119b18f7677b9ee104c1fc43 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 7 Mar 2024 15:38:56 -0800 Subject: [PATCH 031/438] fix chihuahua self-relaying and upgrade to fix relay failures --- .../stateful/components/SelfRelayExecuteModal.tsx | 9 ++++++--- packages/stateful/package.json | 2 +- yarn.lock | 11 +++++------ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/stateful/components/SelfRelayExecuteModal.tsx b/packages/stateful/components/SelfRelayExecuteModal.tsx index 9521ce043..0b8b2ca01 100644 --- a/packages/stateful/components/SelfRelayExecuteModal.tsx +++ b/packages/stateful/components/SelfRelayExecuteModal.tsx @@ -91,6 +91,7 @@ const RELAYER_FUNDS_NEEDED: Partial> = { [ChainId.MigalooMainnet]: 2000000, [ChainId.KujiraMainnet]: 100000, [ChainId.OraichainMainnet]: 100000, + [ChainId.ChihuahuaMainnet]: 1000000000, } type Relayer = { @@ -132,7 +133,7 @@ export const SelfRelayExecuteModal = ({ const chainIds = [currentChainId, ..._chainIds] const chains = uniq(chainIds).map(getChainForChainId) - const { isWalletConnected, chainWallet } = useWallet() + const { isWalletConnected, chainWallet, connect } = useWallet() const chainWalletList = chainWallet?.mainWallet?.getChainWalletList(false) const chainWallets = chainIds.map((chainId) => chainWalletList?.find((cw) => cw.chainId === chainId) @@ -284,7 +285,9 @@ export const SelfRelayExecuteModal = ({ toast.error( t('error.unsupportedChains', { count: unsupportedChains.length, - chains: unsupportedChains.join(', '), + chains: unsupportedChains + .map(({ chain_id }) => getDisplayNameForChainId(chain_id)) + .join(', '), }) ) return @@ -974,7 +977,7 @@ export const SelfRelayExecuteModal = ({ diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 3b5ea10b2..7ef600eaf 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -9,7 +9,7 @@ "test": "jest" }, "dependencies": { - "@confio/relayer": "^0.11.3", + "@confio/relayer": "^0.12.0", "@cosmjs/cosmwasm-stargate": "^0.32.1", "@cosmjs/encoding": "^0.32.1", "@cosmjs/proto-signing": "^0.32.1", diff --git a/yarn.lock b/yarn.lock index 43f990a7b..c2426f8fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2131,10 +2131,10 @@ "@noble/hashes" "^1.0.0" protobufjs "^6.8.8" -"@confio/relayer@^0.11.3": - version "0.11.3" - resolved "https://registry.yarnpkg.com/@confio/relayer/-/relayer-0.11.3.tgz#549488757872e4176fddd4e4e0be36a059151f3b" - integrity sha512-dhARxp3SDcBlwcYZD2keZ2QCa9jmDqM6BdqM8Pu1STfOENXnii853/DcTJ9vrea9KCkU/eAiATl8FjlENwyUZA== +"@confio/relayer@^0.12.0": + version "0.12.0" + resolved "https://registry.yarnpkg.com/@confio/relayer/-/relayer-0.12.0.tgz#c63ec1aae7c6f14518a7958d491d135b39bb91c8" + integrity sha512-oLoE0VbW0TNt5RWQ7m87b5NfZ8ffY2O80OIM9y1G8S1CV7oNUi0iw0/yZRT0thSmSzHVTMGxTu1YB+jy0CqmVw== dependencies: "@cosmjs/cosmwasm-stargate" "^0.32.1" "@cosmjs/crypto" "^0.32.1" @@ -2152,7 +2152,6 @@ cosmjs-types "^0.9.0" fast-safe-stringify "2.0.4" js-yaml "4.0.0" - lodash "4.17.21" prom-client "13.1.0" table "^6.7.1" triple-beam "1.3.0" @@ -17983,7 +17982,7 @@ lodash.uniq@4.5.0, lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ== -lodash@4.17.21, lodash@^4.17.12, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.3.0, lodash@~4.17.0: +lodash@^4.17.12, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.3.0, lodash@~4.17.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== From 625e2ca53271c7444ba9b34ecabbb2a223ec1401 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 8 Mar 2024 02:12:51 -0800 Subject: [PATCH 032/438] fixed authz exec DAO spend --- .../actions/core/treasury/Spend/index.tsx | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/packages/stateful/actions/core/treasury/Spend/index.tsx b/packages/stateful/actions/core/treasury/Spend/index.tsx index 566a08206..dcc80bdc5 100644 --- a/packages/stateful/actions/core/treasury/Spend/index.tsx +++ b/packages/stateful/actions/core/treasury/Spend/index.tsx @@ -87,10 +87,13 @@ const useDefaults: UseDefaults = () => { } = useActionOptions() const { address: walletAddress = '' } = useWallet() - // Should always be defined if in a DAO. + // Should always be defined if in a DAO proposal. Even for a DAO, it may not + // be defined if being authz executed or something similar. const maxVotingPeriodSelector = useProposalModuleAdapterCommonContextIfAvailable()?.common?.selectors - ?.maxVotingPeriod + ?.maxVotingPeriod || + // If no selector, default to 0 time (likely in authz context). + constSelector({ time: 0 }) const proposalModuleMaxVotingPeriod = useCachedLoadingWithError( context.type === ActionContextType.Dao ? maxVotingPeriodSelector @@ -193,10 +196,13 @@ const Component: ActionComponent = (props) => { ], }) - // Should always be defined if in a DAO. + // Should always be defined if in a DAO proposal. Even for a DAO, it may not + // be defined if being authz executed or something similar. const maxVotingPeriodSelector = useProposalModuleAdapterCommonContextIfAvailable()?.common?.selectors - ?.maxVotingPeriod + ?.maxVotingPeriod || + // If no selector, default to 0 time (likely in authz context). + constSelector({ time: 0 }) const proposalModuleMaxVotingPeriod = useRecoilValue( context.type === ActionContextType.Dao ? maxVotingPeriodSelector || constSelector(undefined) @@ -562,10 +568,13 @@ const useTransformToCosmos: UseTransformToCosmos = () => { undefined ) - // Should always be defined if in a DAO. + // Should always be defined if in a DAO proposal. Even for a DAO, it may not + // be defined if being authz executed or something similar. const maxVotingPeriodSelector = useProposalModuleAdapterCommonContextIfAvailable()?.common?.selectors - ?.maxVotingPeriod + ?.maxVotingPeriod || + // If no selector, default to 0 time (likely in authz context). + constSelector({ time: 0 }) const proposalModuleMaxVotingPeriod = useCachedLoadingWithError( options.context.type === ActionContextType.Dao ? maxVotingPeriodSelector From f7eda8ece1ac12c0f014d82323dde89b15235ce8 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 8 Mar 2024 02:44:56 -0800 Subject: [PATCH 033/438] fix PFM timeout timestamp in DAO props --- .../stateful/actions/core/treasury/Spend/index.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/stateful/actions/core/treasury/Spend/index.tsx b/packages/stateful/actions/core/treasury/Spend/index.tsx index dcc80bdc5..9c677d14a 100644 --- a/packages/stateful/actions/core/treasury/Spend/index.tsx +++ b/packages/stateful/actions/core/treasury/Spend/index.tsx @@ -726,9 +726,14 @@ const useTransformToCosmos: UseTransformToCosmos = () => { : MsgTransfer ).fromAmino({ ...skipTransferMsgValue, - // If no memo, use empty string. This will be undefined if PFM - // is not used and it's only a single hop. - memo: skipTransferMsgValue.memo || '', + // Replace all forwarding timeouts with our own. If no memo, + // use empty string. This will be undefined if PFM is not used + // and it's only a single hop. + memo: + skipTransferMsgValue.memo.replace( + /"timeout":\d+/g, + `"timeout":${timeoutTimestamp.toString()}` + ) || '', timeout_timestamp: timeoutTimestamp, timeout_height: undefined, }), From f50a8dfcd367a1f3acebd7aa028b499507fa390c Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 8 Mar 2024 02:45:07 -0800 Subject: [PATCH 034/438] added missing oraichain <> cosmos hub IBC channel --- .../components/IbcDestinationChainPicker.tsx | 2 +- packages/utils/chain.ts | 3 +- packages/utils/constants/chains.ts | 38 ++++++++++++++++++- 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/packages/stateless/components/IbcDestinationChainPicker.tsx b/packages/stateless/components/IbcDestinationChainPicker.tsx index f24453f8e..30b707b20 100644 --- a/packages/stateless/components/IbcDestinationChainPicker.tsx +++ b/packages/stateless/components/IbcDestinationChainPicker.tsx @@ -1,4 +1,3 @@ -import { ibc } from 'chain-registry' import { useMemo } from 'react' import { useDeepCompareMemoize } from 'use-deep-compare-effect' @@ -6,6 +5,7 @@ import { ChainPickerPopupProps } from '@dao-dao/types' import { getChainForChainId, getChainForChainName, + ibc, maybeGetChainForChainName, } from '@dao-dao/utils' diff --git a/packages/utils/chain.ts b/packages/utils/chain.ts index 3f3b7f491..33d062bff 100644 --- a/packages/utils/chain.ts +++ b/packages/utils/chain.ts @@ -3,7 +3,7 @@ import { Buffer } from 'buffer' import { AssetList, Chain, IBCInfo } from '@chain-registry/types' import { fromBech32, fromHex, toBech32 } from '@cosmjs/encoding' import { GasPrice } from '@cosmjs/stargate' -import { assets, chains, ibc } from 'chain-registry' +import { assets, chains } from 'chain-registry' import RIPEMD160 from 'ripemd160' import semverGte from 'semver/functions/gte' @@ -25,6 +25,7 @@ import { CONFIGURED_CHAINS, MAINNET, SUPPORTED_CHAINS, + ibc, } from './constants' import { getFallbackImage } from './getFallbackImage' import { aminoTypes, typesRegistry } from './messages/protobuf' diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index f0f621f65..7d1e40d0a 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -1,4 +1,5 @@ -import { chains } from 'chain-registry' +import { IBCInfo } from '@chain-registry/types' +import { ibc as chainRegistryIbc, chains } from 'chain-registry' import { BaseChainConfig, @@ -8,6 +9,41 @@ import { SupportedChainConfig, } from '@dao-dao/types' +export const ibc: IBCInfo[] = [ + ...chainRegistryIbc, + // Oraichain <-> Cosmos Hub + { + chain_1: { + chain_name: 'oraichain', + client_id: '07-tendermint-47', + connection_id: 'connection-22', + }, + chain_2: { + chain_name: 'cosmoshub', + client_id: '07-tendermint-651', + connection_id: 'connection-497', + }, + channels: [ + { + chain_1: { + channel_id: 'channel-15', + port_id: 'transfer', + }, + chain_2: { + channel_id: 'channel-301', + port_id: 'transfer', + }, + ordering: 'unordered', + version: 'ics20-1', + tags: { + status: 'live', + preferred: true, + }, + }, + ], + }, +] + // Chains which DAO DAO DAOs exist on. export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ { From 04b79ce1c647eb3c5a85049daa9f8d90515b6676 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 8 Mar 2024 03:19:43 -0800 Subject: [PATCH 035/438] added force execute for profile actions by holding shift, and direct signing by holding alt --- packages/i18n/locales/en/translation.json | 5 +- packages/state/package.json | 1 + packages/state/recoil/atoms/wallet.ts | 2 - .../components/profile/ProfileActions.tsx | 57 +++++++++++- .../components/profile/ProfileActions.tsx | 88 ++++++++++++++++--- .../components/proposal/NewProposal.tsx | 8 +- 6 files changed, 139 insertions(+), 22 deletions(-) diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 9d1489289..96ab13860 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -127,6 +127,7 @@ "enable": "Enable", "execute": "Execute", "follow": "Follow", + "forceExecute": "Force execute", "forcePublish": "Force publish", "fund": "Fund", "fundAndExecute": "Fund and execute", @@ -959,6 +960,7 @@ "depositToGovernanceProposalDescription": "Deposit to a chain governance proposal in the deposit period.", "depositTokenSubtitle": "Tokens will be sent from your wallet.", "depositTokenWarning": "Tokens will be sent from your wallet to the DAO. You cannot undo a deposit. You will not gain voting power by depositing tokens.", + "direct": "direct", "disableVetoerDaoDescription": "Stop displaying proposals from a DAO on the home page when they are vetoable.", "disabled": "Disabled", "discordNotifierExplanation": "The Discord Notifier broadcasts a message to registered Discord channels when a proposal is created. Clicking the button below begins the registration process; it will take you to Discord's website and prompt you to choose a server and channel. You will then be redirected back here and prompted to authorize with your wallet. Once this is done, proposal notifications are enabled.", @@ -992,7 +994,8 @@ "finishedAt": "Finished at", "finishesAt": "Finishes at", "followTooltip": "Follow this DAO to show it in your feed and receive proposal notifications according to your settings.", - "forcePublishTooltip": "Ignore form errors and attempt to publish the proposal anyway. The proposal actions will still be simulated on-chain as a final test that the actions are valid.", + "forceExecuteTooltip": "Ignore form errors and attempt to execute the transaction anyway. The transaction will still be simulated on-chain as a final verification that the actions are valid.", + "forcePublishTooltip": "Ignore form errors and attempt to publish the proposal anyway. The proposal actions will still be simulated on-chain as a final verification that the actions are valid.", "funded": "Funded", "getTokensOn": "Get tokens on {{name}}.", "goToParent": "Go to parent DAO", diff --git a/packages/state/package.json b/packages/state/package.json index a6aef34da..dc1235e88 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -24,6 +24,7 @@ "recoil": "^0.7.2" }, "devDependencies": { + "@cosmos-kit/core": "^2.8.9", "@dao-dao/config": "2.2.0", "@dao-dao/types": "2.2.0", "@graphql-codegen/cli": "^5.0.0", diff --git a/packages/state/recoil/atoms/wallet.ts b/packages/state/recoil/atoms/wallet.ts index d9e6da4b4..1f4d9c89a 100644 --- a/packages/state/recoil/atoms/wallet.ts +++ b/packages/state/recoil/atoms/wallet.ts @@ -1,5 +1,3 @@ -// Store each subDAO creation state separately. Main DAO creation state uses an - import { atomFamily } from 'recoil' import { AccountTxForm } from '@dao-dao/types' diff --git a/packages/stateful/components/profile/ProfileActions.tsx b/packages/stateful/components/profile/ProfileActions.tsx index 9c89b11c6..c8b3a7aa1 100644 --- a/packages/stateful/components/profile/ProfileActions.tsx +++ b/packages/stateful/components/profile/ProfileActions.tsx @@ -1,3 +1,4 @@ +import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate' import { toHex } from '@cosmjs/encoding' import cloneDeep from 'lodash.clonedeep' import { useRouter } from 'next/router' @@ -20,6 +21,8 @@ import { KVPK_API_BASE, ME_SAVED_TX_PREFIX, cwMsgToEncodeObject, + getRpcForChainId, + getSignerOptions, processError, } from '@dao-dao/utils' @@ -37,7 +40,8 @@ export const ProfileActions = () => { const { address: walletAddress = '', hexPublicKey, - getSigningCosmWasmClient, + getOfflineSignerAmino, + getOfflineSignerDirect, chain, } = useWallet({ loadAccount: true, @@ -86,6 +90,35 @@ export const ProfileActions = () => { return () => clearTimeout(timeout) }, [setWalletTransactionAtom, meTransaction]) + const [holdAltForDirectSign, setHoldAltForDirectSign] = useState(false) + // Unset holding alt after 3 seconds, in case it got stuck. + useEffect(() => { + if (holdAltForDirectSign) { + const timeout = setTimeout(() => setHoldAltForDirectSign(false), 3000) + return () => clearTimeout(timeout) + } + }, [holdAltForDirectSign]) + // Detect keys. + useEffect(() => { + const handleKeyDown = (event: KeyboardEvent) => { + if (event.key === 'Alt') { + setHoldAltForDirectSign(true) + } + } + const handleKeyUp = (event: KeyboardEvent) => { + if (event.key === 'Alt') { + setHoldAltForDirectSign(false) + } + } + + document.addEventListener('keydown', handleKeyDown) + document.addEventListener('keyup', handleKeyUp) + return () => { + document.removeEventListener('keydown', handleKeyDown) + document.removeEventListener('keyup', handleKeyUp) + } + }, []) + const [loading, setLoading] = useState(false) const [error, setError] = useState('') const [txHash, setTxHash] = useState('') @@ -101,7 +134,17 @@ export const ProfileActions = () => { setTxHash('') try { - const signingCosmWasmClient = await getSigningCosmWasmClient() + const signer = holdAltForDirectSign + ? getOfflineSignerDirect() + : getOfflineSignerAmino() + + const signingCosmWasmClient = + await SigningCosmWasmClient.connectWithSigner( + getRpcForChainId(chain.chain_id), + signer, + getSignerOptions(chain) + ) + const encodeObjects = data.map((msg) => cwMsgToEncodeObject(msg, walletAddress) ) @@ -121,7 +164,14 @@ export const ProfileActions = () => { setLoading(false) } }, - [getSigningCosmWasmClient, t, walletAddress] + [ + chain, + getOfflineSignerAmino, + getOfflineSignerDirect, + holdAltForDirectSign, + t, + walletAddress, + ] ) const { ready: txSavesReady, postRequest: postTxSavesRequest } = @@ -227,6 +277,7 @@ export const ProfileActions = () => { error={error} execute={execute} formMethods={formMethods} + holdAltForDirectSign={holdAltForDirectSign} loadedActions={loadedActions} loading={loading} save={save} diff --git a/packages/stateless/components/profile/ProfileActions.tsx b/packages/stateless/components/profile/ProfileActions.tsx index ccf0e8bc9..5e464c53c 100644 --- a/packages/stateless/components/profile/ProfileActions.tsx +++ b/packages/stateless/components/profile/ProfileActions.tsx @@ -7,7 +7,7 @@ import { VisibilityOff, } from '@mui/icons-material' import cloneDeep from 'lodash.clonedeep' -import { ComponentType, useCallback, useState } from 'react' +import { ComponentType, useCallback, useEffect, useState } from 'react' import { FormProvider, SubmitErrorHandler, @@ -60,6 +60,7 @@ export type ProfileActionsProps = { save: (save: AccountTxSave) => Promise deleteSave: (save: AccountTxSave) => Promise saving: boolean + holdAltForDirectSign: boolean WalletChainSwitcher: ComponentType } @@ -76,6 +77,7 @@ export const ProfileActions = ({ save, deleteSave, saving, + holdAltForDirectSign, WalletChainSwitcher, }: ProfileActionsProps) => { const { t } = useTranslation() @@ -86,6 +88,7 @@ export const ProfileActions = ({ watch, formState: { errors }, reset, + getValues, } = formMethods const actionData = watch('actions') || [] @@ -94,6 +97,35 @@ export const ProfileActions = ({ const [showSubmitErrorNote, setShowSubmitErrorNote] = useState(false) const [submitError, setSubmitError] = useState('') + const [holdingShiftForForce, setHoldingShiftForForce] = useState(false) + // Unset holding shift after delay, in case it got stuck. + useEffect(() => { + if (holdingShiftForForce) { + const timeout = setTimeout(() => setHoldingShiftForForce(false), 6000) + return () => clearTimeout(timeout) + } + }, [holdingShiftForForce]) + // Detect keys. + useEffect(() => { + const handleKeyDown = (event: KeyboardEvent) => { + if (event.key === 'Shift') { + setHoldingShiftForForce(true) + } + } + const handleKeyUp = (event: KeyboardEvent) => { + if (event.key === 'Shift') { + setHoldingShiftForForce(false) + } + } + + document.addEventListener('keydown', handleKeyDown) + document.addEventListener('keyup', handleKeyUp) + return () => { + document.removeEventListener('keydown', handleKeyDown) + document.removeEventListener('keyup', handleKeyUp) + } + }, []) + const onSubmitForm: SubmitHandler = useCallback( ({ actions }, event) => { setShowSubmitErrorNote(false) @@ -129,10 +161,30 @@ export const ProfileActions = ({ (errors) => { console.error('Form errors', errors) - setShowSubmitErrorNote(true) - setSubmitError('') + // Attempt submit anyways if forcing. + if (holdingShiftForForce) { + let msgs + try { + msgs = convertActionsToMessages(loadedActions, getValues('actions')) + } catch (err) { + console.error(err) + setSubmitError( + processError(err, { + forceCapture: false, + }) + ) + return + } + + execute(msgs) + + // If not forcing, show error to check for errors. + } else { + setShowSubmitErrorNote(true) + setSubmitError('') + } }, - [setShowSubmitErrorNote] + [execute, getValues, holdingShiftForForce, loadedActions] ) const [saveModalVisible, setSaveModalVisible] = useState(false) @@ -175,6 +227,7 @@ export const ProfileActions = ({
- + +
diff --git a/packages/stateless/components/proposal/NewProposal.tsx b/packages/stateless/components/proposal/NewProposal.tsx index afa1f0bf0..e59201505 100644 --- a/packages/stateless/components/proposal/NewProposal.tsx +++ b/packages/stateless/components/proposal/NewProposal.tsx @@ -113,16 +113,16 @@ export const NewProposal = < const [holdingAltForSimulation, setHoldingAltForSimulation] = useState(false) const [holdingShiftForForce, setHoldingShiftForForce] = useState(false) - // Unset holding alt/shift after 3 seconds, in case it got stuck. + // Unset holding alt/shift after delay, in case it got stuck. useEffect(() => { if (holdingAltForSimulation) { - const timeout = setTimeout(() => setHoldingAltForSimulation(false), 3000) + const timeout = setTimeout(() => setHoldingAltForSimulation(false), 6000) return () => clearTimeout(timeout) } }, [holdingAltForSimulation]) useEffect(() => { if (holdingShiftForForce) { - const timeout = setTimeout(() => setHoldingShiftForForce(false), 3000) + const timeout = setTimeout(() => setHoldingShiftForForce(false), 6000) return () => clearTimeout(timeout) } }, [holdingShiftForForce]) @@ -216,7 +216,7 @@ export const NewProposal = < createProposal(data) - // If not simulating or creating, show error to check for errors. + // If not simulating or forcing, show error to check for errors. } else { setSubmitError(t('error.correctErrorsAbove')) } From 4496ea7af19fe9d800a6317758fa66fbdaf88650 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 8 Mar 2024 13:14:36 -0800 Subject: [PATCH 036/438] fix authz exec infinite spinning --- .../stateful/actions/core/authorizations/AuthzExec/index.tsx | 5 +++-- packages/stateful/actions/react/provider.tsx | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/stateful/actions/core/authorizations/AuthzExec/index.tsx b/packages/stateful/actions/core/authorizations/AuthzExec/index.tsx index d63008e7e..5eb1913dd 100644 --- a/packages/stateful/actions/core/authorizations/AuthzExec/index.tsx +++ b/packages/stateful/actions/core/authorizations/AuthzExec/index.tsx @@ -133,7 +133,7 @@ const Component: ActionComponent = (props) => { // Load DAO info for chosen DAO. const { watch } = useFormContext() - const address = watch((props.fieldNamePrefix + 'address') as 'address') + const address = watch((props.fieldNamePrefix + 'address') as 'address') || '' const msgsPerSender = watch((props.fieldNamePrefix + '_msgs') as '_msgs') ?? [] @@ -152,7 +152,8 @@ const Component: ActionComponent = (props) => { /> )} - + {/* Re-render when chain changes so hooks and state reset. */} + {props.isCreating ? ( { const { address: connectedAddress } = useWallet() - const address = overrideAddress || connectedAddress + const address = + overrideAddress === undefined ? connectedAddress : overrideAddress const { profile } = useProfile({ address }) - if (!address || profile.loading) { + if (address === undefined || profile.loading) { return } From 85724cf0892519438e10f77ae2b40f6257509cdc Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sat, 9 Mar 2024 10:21:44 -0800 Subject: [PATCH 037/438] don't proxy allowed URLs --- packages/utils/conversion.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/utils/conversion.ts b/packages/utils/conversion.ts index 6e525dbff..12bb2d1b5 100644 --- a/packages/utils/conversion.ts +++ b/packages/utils/conversion.ts @@ -364,7 +364,13 @@ export const toAccessibleImageUrl = ( // of our NextJS allowed image sources. Thus proxy it through a whitelisted // domain. This only needs to be used for images that are displayed in the // NextJS Image component, which is why it is optional and off by default. - if (proxy && url.startsWith('http')) { + if ( + proxy && + url.startsWith('http') && + !url.includes('ipfs.daodao.zone') && + !url.includes('ipfs.stargaze.zone') && + !url.includes('ipfs-gw.stargaze-apis.com') + ) { url = `https://img-proxy.daodao.zone/?url=${encodeURIComponent(url)}` } From 7e77cd8aecb2177cfca58f54d8d4c1a4ff261152 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sat, 9 Mar 2024 17:00:54 -0800 Subject: [PATCH 038/438] added ability to set custom cw20 staking address when creating cw20 DAO --- packages/i18n/locales/en/translation.json | 1 + .../components/profile/ProfileActions.tsx | 36 +----- .../UnstakingDurationVotingConfigItem.tsx | 121 +++++++++++++----- .../stateful/creators/TokenBased/mutate.ts | 21 ++- .../stateful/creators/TokenBased/types.ts | 5 + .../components/profile/ProfileActions.tsx | 39 +----- .../components/proposal/NewProposal.tsx | 44 +------ packages/stateless/hooks/index.ts | 1 + packages/stateless/hooks/useHoldingKey.ts | 65 ++++++++++ 9 files changed, 191 insertions(+), 142 deletions(-) create mode 100644 packages/stateless/hooks/useHoldingKey.ts diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 96ab13860..574e200bd 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -569,6 +569,7 @@ "createValidatorMessage": "Create validator message", "createValidatorMessageTooltip": "Create a validator controlled by your DAO. Note: you will need to run a validator node (on a server for example). Be sure to use that node's public key ( tendermint show-validator).", "currentValue": "Current value", + "customStakingContract": "Custom staking contract", "cw20Token": "CW20 Token", "cw20Tokens": "CW20 tokens", "daoDescriptionPlaceholder": "Give your DAO a description...", diff --git a/packages/stateful/components/profile/ProfileActions.tsx b/packages/stateful/components/profile/ProfileActions.tsx index c8b3a7aa1..0b3958af4 100644 --- a/packages/stateful/components/profile/ProfileActions.tsx +++ b/packages/stateful/components/profile/ProfileActions.tsx @@ -14,6 +14,7 @@ import { ProfileActionsProps, ProfileActions as StatelessProfileActions, useCachedLoading, + useHoldingKey, } from '@dao-dao/stateless' import { AccountTxForm, AccountTxSave } from '@dao-dao/types' import { @@ -90,34 +91,7 @@ export const ProfileActions = () => { return () => clearTimeout(timeout) }, [setWalletTransactionAtom, meTransaction]) - const [holdAltForDirectSign, setHoldAltForDirectSign] = useState(false) - // Unset holding alt after 3 seconds, in case it got stuck. - useEffect(() => { - if (holdAltForDirectSign) { - const timeout = setTimeout(() => setHoldAltForDirectSign(false), 3000) - return () => clearTimeout(timeout) - } - }, [holdAltForDirectSign]) - // Detect keys. - useEffect(() => { - const handleKeyDown = (event: KeyboardEvent) => { - if (event.key === 'Alt') { - setHoldAltForDirectSign(true) - } - } - const handleKeyUp = (event: KeyboardEvent) => { - if (event.key === 'Alt') { - setHoldAltForDirectSign(false) - } - } - - document.addEventListener('keydown', handleKeyDown) - document.addEventListener('keyup', handleKeyUp) - return () => { - document.removeEventListener('keydown', handleKeyDown) - document.removeEventListener('keyup', handleKeyUp) - } - }, []) + const holdingAltForDirectSign = useHoldingKey({ key: 'alt' }) const [loading, setLoading] = useState(false) const [error, setError] = useState('') @@ -134,7 +108,7 @@ export const ProfileActions = () => { setTxHash('') try { - const signer = holdAltForDirectSign + const signer = holdingAltForDirectSign ? getOfflineSignerDirect() : getOfflineSignerAmino() @@ -168,7 +142,7 @@ export const ProfileActions = () => { chain, getOfflineSignerAmino, getOfflineSignerDirect, - holdAltForDirectSign, + holdingAltForDirectSign, t, walletAddress, ] @@ -277,7 +251,7 @@ export const ProfileActions = () => { error={error} execute={execute} formMethods={formMethods} - holdAltForDirectSign={holdAltForDirectSign} + holdingAltForDirectSign={holdingAltForDirectSign} loadedActions={loadedActions} loading={loading} save={save} diff --git a/packages/stateful/creators/TokenBased/UnstakingDurationVotingConfigItem.tsx b/packages/stateful/creators/TokenBased/UnstakingDurationVotingConfigItem.tsx index a9ab15af8..ea5964bf1 100644 --- a/packages/stateful/creators/TokenBased/UnstakingDurationVotingConfigItem.tsx +++ b/packages/stateful/creators/TokenBased/UnstakingDurationVotingConfigItem.tsx @@ -1,6 +1,15 @@ +import { UseFormWatch } from 'react-hook-form' import { useTranslation } from 'react-i18next' -import { ClockEmoji, NumberInput, SelectInput } from '@dao-dao/stateless' +import { + ClockEmoji, + InputErrorMessage, + NumberInput, + SelectInput, + SwitchCard, + useHoldingKey, + useSupportedChainContext, +} from '@dao-dao/stateless' import { DaoCreationVotingConfigItem, DaoCreationVotingConfigItemInputProps, @@ -9,14 +18,16 @@ import { } from '@dao-dao/types' import { convertDurationWithUnitsToHumanReadableString, + makeValidateAddress, validatePositive, validateRequired, } from '@dao-dao/utils' -import { CreatorData } from './types' +import { AddressInput } from '../../components/AddressInput' +import { CreatorData, GovernanceTokenType } from './types' export const UnstakingDurationInput = ({ - data: { unstakingDuration }, + data: { tokenType, unstakingDuration, customStakingAddress }, register, setValue, watch, @@ -24,36 +35,84 @@ export const UnstakingDurationInput = ({ }: DaoCreationVotingConfigItemInputProps) => { const { t } = useTranslation() + const holdingAltForCustomStaking = useHoldingKey({ key: 'alt' }) + + const { + chain: { bech32_prefix: bech32Prefix }, + config: { createWithCw20 }, + } = useSupportedChainContext() + + const showCustomStakingAddress = + createWithCw20 && customStakingAddress !== undefined + return ( -
- + <> + {createWithCw20 && + tokenType === GovernanceTokenType.Existing && + (holdingAltForCustomStaking || showCustomStakingAddress) && ( + + setValue( + 'customStakingAddress', + customStakingAddress === undefined ? '' : undefined + ) + } + sizing="sm" + /> + )} + + {showCustomStakingAddress ? ( +
+ } + /> + + +
+ ) : ( +
+ - - {DurationUnitsValues.map((type, idx) => ( - - ))} - -
+ + {DurationUnitsValues.map((type, idx) => ( + + ))} + +
+ )} + ) } diff --git a/packages/stateful/creators/TokenBased/mutate.ts b/packages/stateful/creators/TokenBased/mutate.ts index ad2b09cd4..741f6741f 100644 --- a/packages/stateful/creators/TokenBased/mutate.ts +++ b/packages/stateful/creators/TokenBased/mutate.ts @@ -27,6 +27,7 @@ export const mutate: DaoCreatorMutate = ( newInfo: { initialSupply, imageUrl, symbol, name }, existingTokenDenomOrAddress, unstakingDuration, + customStakingAddress, activeThreshold, tokenFactoryDenomCreationFee, }, @@ -144,13 +145,19 @@ export const mutate: DaoCreatorMutate = ( token_info: { existing: { address: existingTokenDenomOrAddress, - staking_contract: { - new: { - staking_code_id: codeIds.Cw20Stake ?? -1, - unstaking_duration: - convertDurationWithUnitsToDuration(unstakingDuration), - }, - }, + staking_contract: customStakingAddress + ? { + existing: { + staking_contract_address: customStakingAddress, + }, + } + : { + new: { + staking_code_id: codeIds.Cw20Stake ?? -1, + unstaking_duration: + convertDurationWithUnitsToDuration(unstakingDuration), + }, + }, }, }, } diff --git a/packages/stateful/creators/TokenBased/types.ts b/packages/stateful/creators/TokenBased/types.ts index 70fcf958f..95414e70f 100644 --- a/packages/stateful/creators/TokenBased/types.ts +++ b/packages/stateful/creators/TokenBased/types.ts @@ -31,6 +31,11 @@ export type CreatorData = { } existingTokenSupply?: string unstakingDuration: DurationWithUnits + /** + * If defined, use a custom cw20 staking contract instead of creating a new + * one with the specified unstaking duration. Does not work for native. + */ + customStakingAddress?: string // If token factory denom requires a creation fee, this should be set. tokenFactoryDenomCreationFee?: Coin[] } & DaoCreationVotingConfigWithActiveThreshold diff --git a/packages/stateless/components/profile/ProfileActions.tsx b/packages/stateless/components/profile/ProfileActions.tsx index 5e464c53c..bd74241d1 100644 --- a/packages/stateless/components/profile/ProfileActions.tsx +++ b/packages/stateless/components/profile/ProfileActions.tsx @@ -7,7 +7,7 @@ import { VisibilityOff, } from '@mui/icons-material' import cloneDeep from 'lodash.clonedeep' -import { ComponentType, useCallback, useEffect, useState } from 'react' +import { ComponentType, useCallback, useState } from 'react' import { FormProvider, SubmitErrorHandler, @@ -33,7 +33,7 @@ import { validateRequired, } from '@dao-dao/utils' -import { useChainContext } from '../../hooks' +import { useChainContext, useHoldingKey } from '../../hooks' import { ActionsEditor, RawActionsRenderer } from '../actions' import { Button, ButtonLink } from '../buttons' import { CopyToClipboard } from '../CopyToClipboard' @@ -60,7 +60,7 @@ export type ProfileActionsProps = { save: (save: AccountTxSave) => Promise deleteSave: (save: AccountTxSave) => Promise saving: boolean - holdAltForDirectSign: boolean + holdingAltForDirectSign: boolean WalletChainSwitcher: ComponentType } @@ -77,7 +77,7 @@ export const ProfileActions = ({ save, deleteSave, saving, - holdAltForDirectSign, + holdingAltForDirectSign, WalletChainSwitcher, }: ProfileActionsProps) => { const { t } = useTranslation() @@ -97,34 +97,7 @@ export const ProfileActions = ({ const [showSubmitErrorNote, setShowSubmitErrorNote] = useState(false) const [submitError, setSubmitError] = useState('') - const [holdingShiftForForce, setHoldingShiftForForce] = useState(false) - // Unset holding shift after delay, in case it got stuck. - useEffect(() => { - if (holdingShiftForForce) { - const timeout = setTimeout(() => setHoldingShiftForForce(false), 6000) - return () => clearTimeout(timeout) - } - }, [holdingShiftForForce]) - // Detect keys. - useEffect(() => { - const handleKeyDown = (event: KeyboardEvent) => { - if (event.key === 'Shift') { - setHoldingShiftForForce(true) - } - } - const handleKeyUp = (event: KeyboardEvent) => { - if (event.key === 'Shift') { - setHoldingShiftForForce(false) - } - } - - document.addEventListener('keydown', handleKeyDown) - document.addEventListener('keyup', handleKeyUp) - return () => { - document.removeEventListener('keydown', handleKeyDown) - document.removeEventListener('keyup', handleKeyUp) - } - }, []) + const holdingShiftForForce = useHoldingKey({ key: 'shift' }) const onSubmitForm: SubmitHandler = useCallback( ({ actions }, event) => { @@ -279,7 +252,7 @@ export const ProfileActions = ({ {(holdingShiftForForce ? t('button.forceExecute') : t('button.execute')) + - (holdAltForDirectSign ? ` (${t('info.direct')})` : '')} + (holdingAltForDirectSign ? ` (${t('info.direct')})` : '')} diff --git a/packages/stateless/components/proposal/NewProposal.tsx b/packages/stateless/components/proposal/NewProposal.tsx index e59201505..bf5672741 100644 --- a/packages/stateless/components/proposal/NewProposal.tsx +++ b/packages/stateless/components/proposal/NewProposal.tsx @@ -7,7 +7,7 @@ import { } from '@mui/icons-material' import clsx from 'clsx' import Fuse from 'fuse.js' -import { ComponentType, useEffect, useState } from 'react' +import { ComponentType, useState } from 'react' import { FieldValues, SubmitErrorHandler, @@ -30,6 +30,7 @@ import { processError, } from '@dao-dao/utils' +import { useHoldingKey } from '../../hooks' import { Button } from '../buttons' import { IconButton } from '../icon_buttons' import { FilterableItem, FilterableItemPopup } from '../popup' @@ -111,45 +112,8 @@ export const NewProposal = < const [showPreview, setShowPreview] = useState(false) const [submitError, setSubmitError] = useState('') - const [holdingAltForSimulation, setHoldingAltForSimulation] = useState(false) - const [holdingShiftForForce, setHoldingShiftForForce] = useState(false) - // Unset holding alt/shift after delay, in case it got stuck. - useEffect(() => { - if (holdingAltForSimulation) { - const timeout = setTimeout(() => setHoldingAltForSimulation(false), 6000) - return () => clearTimeout(timeout) - } - }, [holdingAltForSimulation]) - useEffect(() => { - if (holdingShiftForForce) { - const timeout = setTimeout(() => setHoldingShiftForForce(false), 6000) - return () => clearTimeout(timeout) - } - }, [holdingShiftForForce]) - // Detect keys. - useEffect(() => { - const handleKeyDown = (event: KeyboardEvent) => { - if (event.key === 'Alt') { - setHoldingAltForSimulation(true) - } else if (event.key === 'Shift') { - setHoldingShiftForForce(true) - } - } - const handleKeyUp = (event: KeyboardEvent) => { - if (event.key === 'Alt') { - setHoldingAltForSimulation(false) - } else if (event.key === 'Shift') { - setHoldingShiftForForce(false) - } - } - - document.addEventListener('keydown', handleKeyDown) - document.addEventListener('keyup', handleKeyUp) - return () => { - document.removeEventListener('keydown', handleKeyDown) - document.removeEventListener('keyup', handleKeyUp) - } - }, []) + const holdingAltForSimulation = useHoldingKey({ key: 'alt' }) + const holdingShiftForForce = useHoldingKey({ key: 'shift' }) const onSubmitForm: SubmitHandler = (formData, event) => { setSubmitError('') diff --git a/packages/stateless/hooks/index.ts b/packages/stateless/hooks/index.ts index c1ebc75f5..0251fd407 100644 --- a/packages/stateless/hooks/index.ts +++ b/packages/stateless/hooks/index.ts @@ -9,6 +9,7 @@ export * from './useDaoNavHelpers' export * from './useDetectTruncate' export * from './useDetectWrap' export * from './useGovProposalVoteOptions' +export * from './useHoldingKey' export * from './useInfiniteScroll' export * from './useLoadingGovProposalTimestampInfo' export * from './useMountedInBrowser' diff --git a/packages/stateless/hooks/useHoldingKey.ts b/packages/stateless/hooks/useHoldingKey.ts new file mode 100644 index 000000000..34b3c2156 --- /dev/null +++ b/packages/stateless/hooks/useHoldingKey.ts @@ -0,0 +1,65 @@ +import { useEffect, useRef, useState } from 'react' + +export type UseHoldingKeyOptions = { + /** + * The key to check. + */ + key: 'alt' | 'shift' | 'ctrl' | 'meta' +} + +/** + * A hook that returns a boolean whether or not a key is being held. + */ +export const useHoldingKey = ({ key }: UseHoldingKeyOptions): boolean => { + const [holding, setHolding] = useState(false) + const timerRef = useRef(null) + + // Detect key. + useEffect(() => { + const handleEvent = (event: MouseEvent | KeyboardEvent | TouchEvent) => { + // Cancel active timer, potentially restarting it below. + if (timerRef.current !== null) { + clearTimeout(timerRef.current) + } + + const holding = + key === 'alt' + ? event.altKey + : key === 'shift' + ? event.shiftKey + : key === 'ctrl' + ? event.ctrlKey + : key === 'meta' + ? event.metaKey + : false + + setHolding(holding) + + // Start timer to unset holding after 10 seconds. This will restart each + // time one of the events are triggered if the key is still held, which is + // hopefully often enough to prevent false positives. False positives + // occur when window switching or other behavior disrupts the expected + // ordering/execution of events. + if (holding) { + timerRef.current = window.setTimeout(() => { + setHolding(false) + timerRef.current = null + }, 10 * 1000) + } + } + + // Listen on mouse and touch events since sometimes + document.addEventListener('keydown', handleEvent) + document.addEventListener('keyup', handleEvent) + document.addEventListener('mousemove', handleEvent) + document.addEventListener('touchmove', handleEvent) + return () => { + document.removeEventListener('keydown', handleEvent) + document.removeEventListener('keyup', handleEvent) + document.removeEventListener('mousemove', handleEvent) + document.removeEventListener('touchmove', handleEvent) + } + }, [key]) + + return holding +} From b4177b8d1287487d534490eb6608a27a5a48bf8d Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sat, 9 Mar 2024 17:12:49 -0800 Subject: [PATCH 039/438] improved check --- .../stateful/creators/TokenBased/mutate.ts | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/packages/stateful/creators/TokenBased/mutate.ts b/packages/stateful/creators/TokenBased/mutate.ts index 741f6741f..bf9248818 100644 --- a/packages/stateful/creators/TokenBased/mutate.ts +++ b/packages/stateful/creators/TokenBased/mutate.ts @@ -145,19 +145,20 @@ export const mutate: DaoCreatorMutate = ( token_info: { existing: { address: existingTokenDenomOrAddress, - staking_contract: customStakingAddress - ? { - existing: { - staking_contract_address: customStakingAddress, + staking_contract: + customStakingAddress !== undefined + ? { + existing: { + staking_contract_address: customStakingAddress, + }, + } + : { + new: { + staking_code_id: codeIds.Cw20Stake ?? -1, + unstaking_duration: + convertDurationWithUnitsToDuration(unstakingDuration), + }, }, - } - : { - new: { - staking_code_id: codeIds.Cw20Stake ?? -1, - unstaking_duration: - convertDurationWithUnitsToDuration(unstakingDuration), - }, - }, }, }, } From 7a16c8a326cdadcbb02665c60dd4b0b861dcdd7c Mon Sep 17 00:00:00 2001 From: noah Date: Sat, 9 Mar 2024 23:26:21 -0800 Subject: [PATCH 040/438] Add image upload to retroactive compensation surveys (#1751) --- packages/i18n/locales/en/translation.json | 1 + .../components/stateful/ContributionForm.tsx | 10 ++- .../components/stateful/RatingForm.tsx | 5 +- .../stateless/ContributionForm.stories.tsx | 2 + .../components/stateless/ContributionForm.tsx | 61 ++++++++----- .../stateless/ContributionFormInput.tsx | 88 +++++++++++++----- .../stateless/RatingForm.stories.tsx | 7 +- .../components/stateless/RatingForm.tsx | 90 +++++++++---------- .../RetroactiveCompensation/Renderer/types.ts | 8 ++ .../RetroactiveCompensation/Renderer/utils.ts | 22 +++++ .../stateless/components/MarkdownRenderer.tsx | 9 +- .../components/inputs/ImageDropInput.tsx | 11 ++- 12 files changed, 217 insertions(+), 97 deletions(-) diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 574e200bd..ae8c55091 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -48,6 +48,7 @@ "addAttribute": "Add attribute", "addChains": "Add chains", "addCollection": "Add collection", + "addImage": "Add image", "addMember": "Add a member", "addMembers": "Add members", "addNewOption": "Add a new option", diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/ContributionForm.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/ContributionForm.tsx index 2b9c92a12..42bc442fe 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/ContributionForm.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/ContributionForm.tsx @@ -16,13 +16,15 @@ import { ConnectWallet, EntityDisplay, SuspenseLoader, + Trans, } from '../../../../../../components' import { useEntity, useWallet } from '../../../../../../hooks' import { refreshStatusAtom } from '../../atoms' import { usePostRequest } from '../../hooks/usePostRequest' import { statusSelector } from '../../selectors' +import { ContributionFormData } from '../../types' +import { prepareContributionFormData } from '../../utils' import { ContributionForm as StatelessContributionForm } from '../stateless/ContributionForm' -import { ContributionFormData } from '../stateless/ContributionFormInput' export const ContributionForm = () => { const { t } = useTranslation() @@ -57,7 +59,10 @@ export const ContributionForm = () => { setLoading(true) try { - await postRequest(`/${coreAddress}/contribution`, data) + await postRequest( + `/${coreAddress}/contribution`, + prepareContributionFormData(data) + ) toast.success(t('success.contributionSubmitted')) // Reload status on success. setRefreshStatus((id) => id + 1) @@ -114,6 +119,7 @@ export const ContributionForm = () => { loadingEntity={walletEntity} /> )} + Trans={Trans} connected={isWalletConnected} loading={loading || statusLoadable.updating} loadingEntity={walletEntity} diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/RatingForm.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/RatingForm.tsx index a5cd15679..05826a970 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/RatingForm.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/RatingForm.tsx @@ -20,12 +20,14 @@ import { AddressInput, EntityDisplay, SuspenseLoader, + Trans, } from '../../../../../../components' import { useWallet } from '../../../../../../hooks/useWallet' import { refreshStatusAtom } from '../../atoms' import { usePostRequest } from '../../hooks/usePostRequest' import { statusSelector } from '../../selectors' import { RatingsFormData } from '../../types' +import { prepareContributionFormData } from '../../utils' import { ContributionRatingData, NominationForm, @@ -122,7 +124,7 @@ export const RatingForm = ({ data, reloadData }: RatingFormProps) => { // Nominate. await postRequest(`/${coreAddress}/nominate`, { - ...formData, + ...prepareContributionFormData(formData), contributor: contributorPublicKey, }) toast.success(t('success.nominationSubmitted')) @@ -154,6 +156,7 @@ export const RatingForm = ({ data, reloadData }: RatingFormProps) => { ), ConnectWallet: () => , + Trans, } diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionForm.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionForm.tsx index 1296cb3d1..84ddb7f1c 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionForm.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionForm.tsx @@ -1,17 +1,19 @@ import { Publish } from '@mui/icons-material' import { ComponentType } from 'react' -import { useForm } from 'react-hook-form' +import { FormProvider, useForm } from 'react-hook-form' import { useTranslation } from 'react-i18next' import { Button, Loader, MarkdownRenderer, Tooltip } from '@dao-dao/stateless' -import { Entity, GenericTokenWithUsdPrice, LoadingData } from '@dao-dao/types' +import { + Entity, + GenericTokenWithUsdPrice, + LoadingData, + TransProps, +} from '@dao-dao/types' import { formatDateTimeTz } from '@dao-dao/utils' -import { Status, SurveyStatus } from '../../types' -import { - ContributionFormData, - ContributionFormInput, -} from './ContributionFormInput' +import { ContributionFormData, Status, SurveyStatus } from '../../types' +import { ContributionFormInput } from './ContributionFormInput' export interface ContributionFormProps { connected: boolean @@ -22,6 +24,7 @@ export interface ContributionFormProps { tokenPrices: GenericTokenWithUsdPrice[] EntityDisplay: ComponentType ConnectWallet: ComponentType + Trans: ComponentType } export const ContributionForm = ({ @@ -36,18 +39,34 @@ export const ContributionForm = ({ loadingEntity, EntityDisplay, ConnectWallet, + Trans, }: ContributionFormProps) => { const { t } = useTranslation() - const { - register, - watch, - setValue, - handleSubmit, - formState: { errors }, - } = useForm({ + let defaultContribution = existingContribution || '' + // Pull images out of the contribution text. + const defaultImages = defaultContribution + ? defaultContribution + .split('\n\n') + .pop() + ?.split('\n') + .map((part) => + part.startsWith('![') ? part.split('](')[1].slice(0, -1) : undefined + ) + .flatMap((url) => (url ? { url } : [])) + : [] + // If images were found, remove them from the text. + if (defaultImages?.length) { + defaultContribution = defaultContribution + .split('\n\n') + .slice(0, -1) + .join('\n\n') + } + + const formMethods = useForm({ defaultValues: { - contribution: existingContribution || '', + contribution: defaultContribution, + images: defaultImages, ratings: contributionSelfRatings || survey.attributes.map(() => null), }, }) @@ -71,7 +90,7 @@ export const ContributionForm = ({ return ( {/* Hidden on small screens. Moves below so it is centered with the column. */}
@@ -110,13 +129,9 @@ export const ContributionForm = ({ )}
- + + + {contributed && (

diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionFormInput.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionFormInput.tsx index 7fde4ebd9..53add6133 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionFormInput.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionFormInput.tsx @@ -1,46 +1,57 @@ -import { - FormState, - UseFormRegister, - UseFormSetValue, - UseFormWatch, -} from 'react-hook-form' +import { Close } from '@mui/icons-material' +import { ComponentType } from 'react' +import { useFieldArray, useFormContext } from 'react-hook-form' import { useTranslation } from 'react-i18next' import { + Button, Checkbox, + IconButton, + ImageUploadInput, InputErrorMessage, InputLabel, RangeInput, TextAreaInput, } from '@dao-dao/stateless' -import { validateRequired } from '@dao-dao/utils' - -import { Survey } from '../../types' +import { TransProps } from '@dao-dao/types' +import { + transformIpfsUrlToHttpsIfNecessary, + validateRequired, +} from '@dao-dao/utils' -export type ContributionFormData = { - contribution: string - ratings: (number | null)[] -} +import { ContributionFormData, Survey } from '../../types' export type ContributionFormInputProps = { survey: Survey - register: UseFormRegister - watch: UseFormWatch - setValue: UseFormSetValue - errors: FormState['errors'] thirdPerson?: boolean + Trans: ComponentType } export const ContributionFormInput = ({ survey, - register, - watch, - setValue, - errors, thirdPerson, + Trans, }: ContributionFormInputProps) => { const { t } = useTranslation() + const { + control, + register, + setValue, + watch, + formState: { errors }, + } = useFormContext() + + const { + fields: imageFields, + append: appendImage, + remove: removeImage, + } = useFieldArray({ + control, + name: 'images', + }) + const images = watch('images') + const ratings = watch('ratings', []) const allRatingsAbstain = ratings.every((rating) => rating === null) const toggleAbstain = () => @@ -68,6 +79,41 @@ export const ContributionFormInput = ({

+
+ {imageFields.map(({ id }, index) => ( +
+ {images?.[index].url ? ( + // eslint-disable-next-line @next/next/no-img-element + {images[index].url} + ) : ( + setValue(`images.${index}.url`, url)} + /> + )} + + removeImage(index)} + size="sm" + variant="ghost" + /> +
+ ))} + + +
+

diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/RatingForm.stories.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/RatingForm.stories.tsx index e45e1fbd4..35ee43adc 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/RatingForm.stories.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/RatingForm.stories.tsx @@ -4,7 +4,11 @@ import { CHAIN_ID } from '@dao-dao/storybook' import { TokenType } from '@dao-dao/types' import { getNativeTokenForChainId } from '@dao-dao/utils' -import { AddressInput, EntityDisplay } from '../../../../../../components' +import { + AddressInput, + EntityDisplay, + Trans, +} from '../../../../../../components' import { makeSurvey } from './ContributionForm.stories' import { RatingForm } from './RatingForm' @@ -58,6 +62,7 @@ Default.args = { loadingSubmit: false, EntityDisplay, AddressInput, + Trans, tokenPrices: [ { token: { diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/RatingForm.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/RatingForm.tsx index 2889eaea8..5afbc71b9 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/RatingForm.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/RatingForm.tsx @@ -1,6 +1,6 @@ import { Publish } from '@mui/icons-material' import { ComponentType, useEffect, useMemo } from 'react' -import { useForm } from 'react-hook-form' +import { FormProvider, useForm } from 'react-hook-form' import { useTranslation } from 'react-i18next' import { @@ -17,6 +17,7 @@ import { AddressInputProps, GenericTokenWithUsdPrice, StatefulEntityDisplayProps, + TransProps, } from '@dao-dao/types' import { convertMicroDenomToDenomWithDecimals, @@ -28,15 +29,13 @@ import { import { Contribution, ContributionCompensation, + ContributionFormData, ContributionRating, RatingsFormData, Status, } from '../../types' import { computeCompensation } from '../../utils' -import { - ContributionFormData, - ContributionFormInput, -} from './ContributionFormInput' +import { ContributionFormInput } from './ContributionFormInput' export interface ContributionRatingData { contributions: Contribution[] @@ -54,6 +53,7 @@ export interface RatingFormProps { loadingSubmit: boolean EntityDisplay: ComponentType AddressInput: ComponentType> + Trans: ComponentType tokenPrices: GenericTokenWithUsdPrice[] onNominate: (data: NominationForm) => Promise loadingNominate: boolean @@ -66,6 +66,7 @@ export const RatingForm = ({ loadingSubmit, EntityDisplay, AddressInput, + Trans, tokenPrices, onNominate, loadingNominate, @@ -121,15 +122,10 @@ export const RatingForm = ({ [tokenPrices] ) - const { - watch: nominationWatch, - register: nominationRegister, - handleSubmit: nominationHandleSubmit, - formState: { errors: nominationErrors }, - setValue: nominationSetValue, - } = useForm({ + const nominationFormMethods = useForm({ defaultValues: { contribution: '', + images: [], ratings: survey.attributes.map(() => null), }, }) @@ -335,43 +331,43 @@ export const RatingForm = ({

{t('title.nominateContributor')}

- -
- - - -
+ + +
+ + + +
- + - - + + +
) diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/types.ts b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/types.ts index 5c6e4c915..795094832 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/types.ts +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/types.ts @@ -143,3 +143,11 @@ export type CompletedSurvey = Omit & { export interface StatefulOpenSurveySectionProps { status: Status } + +export type ContributionFormData = { + contribution: string + images?: { + url?: string + }[] + ratings: (number | null)[] +} diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts index 1d9c6f76f..d125f7b76 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts @@ -2,6 +2,7 @@ import { AnyToken, Attribute, ContributionCompensation, + ContributionFormData, ContributionRating, } from './types' @@ -102,3 +103,24 @@ export const computeCompensation = ( return compensationPerContribution } + +/** + * Prepare contribution form data by combining text and images into the + * contribution text and removing the images. + */ +export const prepareContributionFormData = ( + data: D +): D => { + const formData: D = { + ...data, + // Add Markdown image lines to bottom of contribution if they exist. + contribution: [ + data.contribution, + data.images?.flatMap(({ url }) => `![${url}](${url})` || []).join('\n'), + ] + .filter(Boolean) + .join('\n\n'), + } + delete formData.images + return formData +} diff --git a/packages/stateless/components/MarkdownRenderer.tsx b/packages/stateless/components/MarkdownRenderer.tsx index 743bf47d8..cd4b3e249 100644 --- a/packages/stateless/components/MarkdownRenderer.tsx +++ b/packages/stateless/components/MarkdownRenderer.tsx @@ -19,7 +19,10 @@ import { Node } from 'unist' import { visitParents } from 'unist-util-visit-parents' import { StatefulEntityDisplayProps } from '@dao-dao/types' -import { isValidBech32Address } from '@dao-dao/utils' +import { + isValidBech32Address, + transformIpfsUrlToHttpsIfNecessary, +} from '@dao-dao/utils' import { IconButton } from './icon_buttons/IconButton' @@ -82,6 +85,10 @@ export const MarkdownRenderer = forwardRef< ...(EntityDisplay ? [remarkEntityDisplay] : []), ]} remarkPlugins={[remarkGfm]} + transformImageUri={ + // Support IPFS images. + (src, alt) => transformIpfsUrlToHttpsIfNecessary(src || alt) + } > {markdown} diff --git a/packages/stateless/components/inputs/ImageDropInput.tsx b/packages/stateless/components/inputs/ImageDropInput.tsx index e57bcefe0..04bc0909e 100644 --- a/packages/stateless/components/inputs/ImageDropInput.tsx +++ b/packages/stateless/components/inputs/ImageDropInput.tsx @@ -4,6 +4,7 @@ import { ComponentType, useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import { TransProps } from '@dao-dao/types' +import { transformIpfsUrlToHttpsIfNecessary } from '@dao-dao/utils' import { FileDropInput, FileDropInputProps } from './FileDropInput' @@ -56,7 +57,15 @@ export const ImageDropInput = ({ hideText={!!image} loading={loading} onSelect={onSelect} - style={image ? { backgroundImage: `url(${image})` } : undefined} + style={ + image + ? { + backgroundImage: `url(${transformIpfsUrlToHttpsIfNecessary( + image + )})`, + } + : undefined + } /> ) } From d5bdda45a734be86c130d5627e75cb9f9f4e1ca7 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 10 Mar 2024 00:07:13 -0800 Subject: [PATCH 041/438] fixed approved proposal status info line offset --- .../stateless/components/proposal/ProposalStatusAndInfo.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stateless/components/proposal/ProposalStatusAndInfo.tsx b/packages/stateless/components/proposal/ProposalStatusAndInfo.tsx index 08e95a917..0327ecfb8 100644 --- a/packages/stateless/components/proposal/ProposalStatusAndInfo.tsx +++ b/packages/stateless/components/proposal/ProposalStatusAndInfo.tsx @@ -97,7 +97,7 @@ export const ProposalStatusAndInfo = ({

{label}

- + ))}
From b59800683983a8a2abdf7e10cc359942ba77f7f4 Mon Sep 17 00:00:00 2001 From: noah Date: Sun, 10 Mar 2024 00:11:15 -0800 Subject: [PATCH 042/438] cleaned up todos (#1752) --- .vscode/settings.json | 8 +- .../dao/DaoApproverProposalContentDisplay.tsx | 1 - .../useLoadingPreProposeApprovalProposal.ts | 75 ++---- .../hooks/useLoadingProposal.tsx | 186 +++------------ .../adapters/DaoProposalSingle/selectors.ts | 213 ++++++++++++++++++ .../actions/Mint/index.tsx | 22 +- .../components/MembersTab.tsx | 8 +- .../components/ProfileCardMemberInfo.tsx | 10 +- .../components/StakingModal.tsx | 10 +- .../hooks/useGovernanceTokenInfo.ts | 33 ++- .../hooks/useMainDaoInfoCards.tsx | 11 +- .../hooks/useVotingModuleRelevantAddresses.ts | 5 +- .../adapters/DaoVotingCw20Staked/types.ts | 47 +++- .../actions/Mint/index.tsx | 27 ++- .../components/MembersTab.tsx | 8 +- .../components/ProfileCardMemberInfo.tsx | 10 +- .../components/StakingModal.tsx | 10 +- .../hooks/useGovernanceTokenInfo.ts | 21 +- .../hooks/useMainDaoInfoCards.tsx | 5 +- .../adapters/DaoVotingNativeStaked/types.ts | 45 +++- .../actions/Mint/index.tsx | 8 +- .../actions/UpdateMinterAllowance/index.tsx | 8 +- .../components/MembersTab.tsx | 8 +- .../components/ProfileCardMemberInfo.tsx | 10 +- .../components/StakingModal.tsx | 10 +- .../hooks/useGovernanceTokenInfo.ts | 25 +- .../hooks/useMainDaoInfoCards.tsx | 5 +- .../adapters/DaoVotingTokenStaked/types.ts | 53 +++-- packages/types/proposal-module-adapter.ts | 26 ++- packages/types/token.ts | 27 ++- 30 files changed, 543 insertions(+), 392 deletions(-) create mode 100644 packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/selectors.ts diff --git a/.vscode/settings.json b/.vscode/settings.json index 2ca8c06f4..f99f36fd9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -42,5 +42,11 @@ "typescriptreact" ], "typescript.tsdk": "node_modules/typescript/lib", - "typescript.tsserver.experimental.enableProjectDiagnostics": true + "typescript.tsserver.experimental.enableProjectDiagnostics": true, + "todo-tree.filtering.excludeGlobs": [ + "**/dist/**/*", + "**/.next/**/*", + "**/node_modules/*/**", + "**/packages/utils/protobuf/**/*" + ] } diff --git a/packages/stateful/components/dao/DaoApproverProposalContentDisplay.tsx b/packages/stateful/components/dao/DaoApproverProposalContentDisplay.tsx index 32addc7cf..09fc98c70 100644 --- a/packages/stateful/components/dao/DaoApproverProposalContentDisplay.tsx +++ b/packages/stateful/components/dao/DaoApproverProposalContentDisplay.tsx @@ -82,7 +82,6 @@ export const DaoApproverProposalContentDisplay = ({ params: [ { msg: { - // pending_proposal_id_for_approval_proposal_id: { pre_propose_approval_id_for_approver_proposal_id: { id: proposalNumber, }, diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingPreProposeApprovalProposal.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingPreProposeApprovalProposal.ts index 4363569bf..38d6b4615 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingPreProposeApprovalProposal.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingPreProposeApprovalProposal.ts @@ -1,10 +1,8 @@ import { useTranslation } from 'react-i18next' +import { constSelector } from 'recoil' -import { - DaoPreProposeApprovalSingleSelectors, - DaoPreProposeApproverSelectors, -} from '@dao-dao/state/recoil' -import { useCachedLoading } from '@dao-dao/stateless' +import { DaoPreProposeApprovalSingleSelectors } from '@dao-dao/state/recoil' +import { useCachedLoading, useCachedLoadingWithError } from '@dao-dao/stateless' import { LoadingData, PreProposeApprovalProposalWithMeteadata, @@ -14,8 +12,8 @@ import { import { Proposal as DaoPreProposeApprovalSingleProposal } from '@dao-dao/types/contracts/DaoPreProposeApprovalSingle' import { formatDate, formatDateTimeTz } from '@dao-dao/utils' -import { daoCoreProposalModulesSelector } from '../../../../recoil' import { useProposalModuleAdapterOptions } from '../../../react' +import { approverIdForPreProposeApprovalIdSelector } from '../selectors' export const useLoadingPreProposeApprovalProposal = (): LoadingData => { @@ -46,62 +44,26 @@ export const useLoadingPreProposeApprovalProposal = (err) => console.error(err) ) as LoadingData - // TODO(approver): turn this into one selector - const usesApprover = + // Retrieve proposal ID in approver DAO if exists. + const approverProposalId = useCachedLoadingWithError( prePropose?.type === PreProposeModuleType.Approval && - !!prePropose.config.preProposeApproverContract - const approverDaoProposalModules = useCachedLoading( - usesApprover - ? daoCoreProposalModulesSelector({ + !!prePropose.config.preProposeApproverContract + ? approverIdForPreProposeApprovalIdSelector({ chainId, - coreAddress: prePropose.config.approver, + preProposeAddress: prePropose.address, + proposalNumber, + isPreProposeApprovalProposal: true, + approver: prePropose.config.approver, + preProposeApproverContract: + prePropose.config.preProposeApproverContract, }) - : undefined, - undefined + : constSelector(undefined) ) - // Get prefix of proposal module with dao-pre-propose-approver attached so - // we can link to the approver proposal. - const approverDaoApproverProposalModulePrefix = - approverDaoProposalModules.loading || !usesApprover - ? undefined - : approverDaoProposalModules.data?.find( - (approverDaoProposalModule) => - approverDaoProposalModule.prePropose?.type === - PreProposeModuleType.Approver && - approverDaoProposalModule.prePropose.address === - prePropose.config.preProposeApproverContract - )?.prefix - // Get approver proposal ID that was created to approve this pre-propose - // proposal. - const approverProposalNumber = useCachedLoading( - usesApprover && prePropose.config.preProposeApproverContract - ? DaoPreProposeApproverSelectors.queryExtensionSelector({ - chainId, - contractAddress: prePropose.config.preProposeApproverContract, - params: [ - { - msg: { - approver_proposal_id_for_pre_propose_approval_id: { - id: proposalNumber, - }, - }, - }, - ], - }) - : undefined, - undefined - ) as LoadingData - const approverProposalId = - approverDaoApproverProposalModulePrefix && - !approverProposalNumber.loading && - approverProposalNumber.data - ? `${approverDaoApproverProposalModulePrefix}${approverProposalNumber.data}` - : undefined if ( loadingProposal.loading || !loadingProposal.data || - (usesApprover && !approverProposalId) + approverProposalId.loading ) { return { loading: true } } @@ -134,7 +96,10 @@ export const useLoadingPreProposeApprovalProposal = data: { ...loadingProposal.data, timestampDisplay, - approverProposalId, + // On error, just return undefined so we still render the proposal. + approverProposalId: approverProposalId.errored + ? undefined + : approverProposalId.data, }, } } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingProposal.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingProposal.tsx index 7641e8980..b8ca94b82 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingProposal.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingProposal.tsx @@ -3,8 +3,6 @@ import TimeAgo from 'react-timeago' import { constSelector, waitForAll } from 'recoil' import { - DaoPreProposeApprovalSingleSelectors, - DaoPreProposeApproverSelectors, DaoProposalSingleCommonSelectors, NeutronCwdSubdaoTimelockSingleSelectors, blockHeightSelector, @@ -13,6 +11,7 @@ import { import { useCachedLoadable, useCachedLoading, + useCachedLoadingWithError, useTranslatedTimeDeltaFormatter, } from '@dao-dao/stateless' import { @@ -23,7 +22,6 @@ import { ProposalStatusEnum, ProposalTimestampInfo, } from '@dao-dao/types' -import { Proposal as DaoPreProposeApprovalSingleProposal } from '@dao-dao/types/contracts/DaoPreProposeApprovalSingle' import { convertExpirationToDate, formatDate, @@ -31,11 +29,12 @@ import { isFeatureSupportedByVersion, } from '@dao-dao/utils' -import { - daoCoreProposalModulesSelector, - neutronOverruleProposalForTimelockedProposalSelector, -} from '../../../../recoil' +import { neutronOverruleProposalForTimelockedProposalSelector } from '../../../../recoil' import { useProposalModuleAdapterOptions } from '../../../react' +import { + approvedIdForPreProposeApproverIdSelector, + approverIdForPreProposeApprovalIdSelector, +} from '../selectors' import { ProposalWithMetadata } from '../types' // Returns a proposal wrapped in a LoadingData object to allow the UI to respond @@ -130,164 +129,45 @@ export const useLoadingProposal = (): LoadingData => { }) ) - // TODO(approver): turn this into one selector - //! If this is proposal was approved by another proposal via the + //! If this proposal was approved by another proposal via the //! pre-propose-approver setup. - const usesApprover = + const approverProposalId = useCachedLoadingWithError( prePropose?.type === PreProposeModuleType.Approval && - !!prePropose.config.preProposeApproverContract - const approverDaoProposalModules = useCachedLoading( - usesApprover - ? daoCoreProposalModulesSelector({ + !!prePropose.config.preProposeApproverContract + ? approverIdForPreProposeApprovalIdSelector({ chainId, - coreAddress: prePropose.config.approver, + preProposeAddress: prePropose.address, + proposalNumber, + isPreProposeApprovalProposal: false, + approver: prePropose.config.approver, + preProposeApproverContract: + prePropose.config.preProposeApproverContract, }) - : undefined, - undefined + : constSelector(undefined) ) - // Get prefix of proposal module with dao-pre-propose-approver attached so - // we can link to the approver proposal. - const approverDaoApproverProposalModulePrefix = - approverDaoProposalModules.loading || !usesApprover - ? undefined - : approverDaoProposalModules.data?.find( - (approverDaoProposalModule) => - approverDaoProposalModule.prePropose?.type === - PreProposeModuleType.Approver && - approverDaoProposalModule.prePropose.address === - prePropose.config.preProposeApproverContract - )?.prefix - // Get pre-propose proposal ID that was accepted to create this proposal. - const preProposeApprovalProposalId = useCachedLoading( - usesApprover - ? DaoPreProposeApprovalSingleSelectors.queryExtensionSelector({ - chainId, - contractAddress: prePropose.address, - params: [ - { - msg: { - completed_proposal_id_for_created_proposal_id: { - id: proposalNumber, - }, - }, - }, - ], - }) - : undefined, - undefined - ) as LoadingData - // Get approver proposal ID that was created to approve the pre-propose - // proposal. - const approverProposalNumber = useCachedLoading( - usesApprover && - prePropose.config.preProposeApproverContract && - !preProposeApprovalProposalId.loading && - preProposeApprovalProposalId.data - ? DaoPreProposeApproverSelectors.queryExtensionSelector({ - chainId, - contractAddress: prePropose.config.preProposeApproverContract, - params: [ - { - msg: { - approver_proposal_id_for_pre_propose_approval_id: { - id: preProposeApprovalProposalId.data, - }, - }, - }, - ], - }) - : undefined, - undefined - ) as LoadingData - const approverProposalId = - approverDaoApproverProposalModulePrefix && - !approverProposalNumber.loading && - approverProposalNumber.data - ? `${approverDaoApproverProposalModulePrefix}${approverProposalNumber.data}` - : undefined - // TODO(approver): turn this into one selector //! If this is an approver proposal that approved another proposal. - const approvedAnotherProposal = + const approvedProposalId = useCachedLoadingWithError( prePropose?.type === PreProposeModuleType.Approver && - proposalStatus === ProposalStatusEnum.Executed - const approvalDaoProposalModules = useCachedLoading( - approvedAnotherProposal - ? daoCoreProposalModulesSelector({ + proposalStatus === ProposalStatusEnum.Executed + ? approvedIdForPreProposeApproverIdSelector({ chainId, - coreAddress: prePropose.config.approvalDao, + preProposeAddress: prePropose.address, + proposalNumber, + approvalDao: prePropose.config.approvalDao, + preProposeApprovalContract: + prePropose.config.preProposeApprovalContract, }) - : undefined, - undefined + : constSelector(undefined) ) - // Get prefix of proposal module with dao-pre-propose-approval attached so we - // can link to the created proposal. - const approvalDaoApprovalProposalModulePrefix = - approvalDaoProposalModules.loading || !approvedAnotherProposal - ? undefined - : approvalDaoProposalModules.data?.find( - (approvalDaoProposalModule) => - approvalDaoProposalModule.prePropose?.type === - PreProposeModuleType.Approval && - approvalDaoProposalModule.prePropose.address === - prePropose.config.preProposeApprovalContract - )?.prefix - // Get pre-propose-approval proposal ID that was approved by this proposal. - const approvalProposalNumber = useCachedLoading( - approvedAnotherProposal - ? DaoPreProposeApproverSelectors.queryExtensionSelector({ - chainId, - contractAddress: prePropose.address, - params: [ - { - msg: { - pre_propose_approval_id_for_approver_proposal_id: { - id: proposalNumber, - }, - }, - }, - ], - }) - : undefined, - undefined - ) as LoadingData - // Get completed pre-propose proposal ID so we can extract the created - // proposal ID. - const completedPreProposeApprovalProposal = useCachedLoading( - approvedAnotherProposal && - !approvalProposalNumber.loading && - approvalProposalNumber.data - ? DaoPreProposeApprovalSingleSelectors.queryExtensionSelector({ - chainId, - contractAddress: prePropose.config.preProposeApprovalContract, - params: [ - { - msg: { - completed_proposal: { - id: approvalProposalNumber.data, - }, - }, - }, - ], - }) - : undefined, - undefined - ) as LoadingData - const approvedProposalId = - approvalDaoApprovalProposalModulePrefix && - !completedPreProposeApprovalProposal.loading && - completedPreProposeApprovalProposal.data && - 'approved' in completedPreProposeApprovalProposal.data.status - ? `${approvalDaoApprovalProposalModulePrefix}${completedPreProposeApprovalProposal.data.status.approved.created_proposal_id}` - : undefined if ( loadingProposalResponse.loading || !loadingProposalResponse.data || blocksPerYearLoadable.state !== 'hasValue' || blockHeightLoadable.state !== 'hasValue' || - (usesApprover && !approverProposalId) || - (approvedAnotherProposal && !approvedProposalId) || + approverProposalId.loading || + approvedProposalId.loading || loadingNeutronTimelockInfo.loading ) { return { loading: true } @@ -392,8 +272,14 @@ export const useLoadingProposal = (): LoadingData => { votingOpen, executedAt: typeof executedAt === 'string' ? new Date(executedAt) : undefined, - approverProposalId, - approvedProposalId, + // On error, just return undefined so we still render the proposal. + approverProposalId: approverProposalId.errored + ? undefined + : approverProposalId.data, + // On error, just return undefined so we still render the proposal. + approvedProposalId: approvedProposalId.errored + ? undefined + : approvedProposalId.data, vetoTimelockExpiration, neutronTimelockOverrule: loadingNeutronTimelockInfo.data?.[1], }, diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/selectors.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/selectors.ts new file mode 100644 index 000000000..175ff378b --- /dev/null +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/selectors.ts @@ -0,0 +1,213 @@ +import { RecoilValueReadOnly, selectorFamily, waitForAll } from 'recoil' + +import { + DaoPreProposeApprovalSingleSelectors, + DaoPreProposeApproverSelectors, +} from '@dao-dao/state' +import { PreProposeModuleType, WithChainId } from '@dao-dao/types' +import { Proposal as DaoPreProposeApprovalSingleProposal } from '@dao-dao/types/contracts/DaoPreProposeApprovalSingle' + +import { daoCoreProposalModulesSelector } from '../../../recoil' + +/** + * Given the pre-propose approval ID of a pending proposal that has its approver + * set to a pre-propose-approver contract, retrieve the automatically-created + * proposal's ID in the approver's DAO. + */ +export const approverIdForPreProposeApprovalIdSelector = selectorFamily< + string, + WithChainId<{ + // From proposal module (should be a dao-pre-propose-approval-single + // contract) + preProposeAddress: string + // From proposal module + proposalNumber: number + // Whether or not this proposal number refers to a pre-propose-approval + // proposal (as opposed to a proposal that was already approved and can be + // voted on). + isPreProposeApprovalProposal: boolean + // From PreProposeModuleApprovalConfig + approver: string + // From PreProposeModuleApprovalConfig + preProposeApproverContract: string + }> +>({ + key: 'daoProposalSingleApproverIdForPreProposeApprovalId', + get: + ({ + chainId, + preProposeAddress, + proposalNumber, + isPreProposeApprovalProposal, + approver, + preProposeApproverContract, + }) => + ({ get }) => { + const preProposeApprovalNumber = isPreProposeApprovalProposal + ? proposalNumber + : get( + // Get pre-propose proposal ID that was accepted to create this + // proposal. + DaoPreProposeApprovalSingleSelectors.queryExtensionSelector({ + chainId, + contractAddress: preProposeAddress, + params: [ + { + msg: { + completed_proposal_id_for_created_proposal_id: { + id: proposalNumber, + }, + }, + }, + ], + }) + ) + const [approverDaoProposalModules, approverProposalNumber] = get( + waitForAll([ + // Get approver DAO's proposal modules to extract the prefix. + daoCoreProposalModulesSelector({ + chainId, + coreAddress: approver, + }), + // Get approver proposal ID that was created to approve this + // pre-propose proposal. + DaoPreProposeApproverSelectors.queryExtensionSelector({ + chainId, + contractAddress: preProposeApproverContract, + params: [ + { + msg: { + approver_proposal_id_for_pre_propose_approval_id: { + id: preProposeApprovalNumber, + }, + }, + }, + ], + }) as RecoilValueReadOnly, + ]) + ) + + // Get prefix of proposal module with dao-pre-propose-approver attached + // so we can link to the approver proposal. + const approverDaoApproverProposalModulePrefix = + approverDaoProposalModules.find( + (approverDaoProposalModule) => + approverDaoProposalModule.prePropose?.type === + PreProposeModuleType.Approver && + approverDaoProposalModule.prePropose.address === + preProposeApproverContract + )?.prefix + + // The approver proposal module will not be found if it was disabled, so + // error since we can't determine the prefix. + if (!approverDaoApproverProposalModulePrefix) { + throw new Error( + `failed to find approver proposal module for ${approver}` + ) + } + + return `${approverDaoApproverProposalModulePrefix}${approverProposalNumber}` + }, +}) + +/** + * Given an approver's proposal that approved a pre-propose approval proposal, + * retrieve the approved (completed) pre-propose approval proposal ID. + */ +export const approvedIdForPreProposeApproverIdSelector = selectorFamily< + string, + WithChainId<{ + // From proposal module (should be a dao-pre-propose-approver contract) + preProposeAddress: string + // From proposal module + proposalNumber: number + // From PreProposeModuleApproverConfig + approvalDao: string + // From PreProposeModuleApprovalConfig + preProposeApprovalContract: string + }> +>({ + key: 'daoProposalSingleApprovedIdForPreProposeApproverId', + get: + ({ + chainId, + preProposeAddress, + proposalNumber, + approvalDao, + preProposeApprovalContract, + }) => + ({ get }) => { + const [approvalDaoProposalModules, approvalProposalNumber] = get( + waitForAll([ + // Get approval DAO's proposal modules to extract the prefix. + daoCoreProposalModulesSelector({ + chainId, + coreAddress: approvalDao, + }), + // Get pre-propose-approval proposal ID that was approved by this + // proposal. + DaoPreProposeApproverSelectors.queryExtensionSelector({ + chainId, + contractAddress: preProposeAddress, + params: [ + { + msg: { + pre_propose_approval_id_for_approver_proposal_id: { + id: proposalNumber, + }, + }, + }, + ], + }) as RecoilValueReadOnly, + ]) + ) + + // Get prefix of proposal module with dao-pre-propose-approval attached so + // we can link to the created proposal. + const approvalDaoApprovalProposalModulePrefix = + approvalDaoProposalModules.find( + (approvalDaoProposalModule) => + approvalDaoProposalModule.prePropose?.type === + PreProposeModuleType.Approval && + approvalDaoProposalModule.prePropose.address === + preProposeApprovalContract + )?.prefix + + // The approval proposal module will not be found if it was disabled, so + // error since we can't determine the prefix. + if (!approvalDaoApprovalProposalModulePrefix) { + throw new Error( + `failed to find approval proposal module for ${approvalDao}` + ) + } + + // Get completed pre-propose proposal ID so we can extract the created + // proposal ID. + const completedPreProposeApprovalProposal: DaoPreProposeApprovalSingleProposal = + get( + DaoPreProposeApprovalSingleSelectors.queryExtensionSelector({ + chainId, + contractAddress: preProposeApprovalContract, + params: [ + { + msg: { + completed_proposal: { + id: approvalProposalNumber, + }, + }, + }, + ], + }) + ) + + // Should never happen if the passed in approver proposal ID was executed + // and the proposal was created. Type-check for below. + if (!('approved' in completedPreProposeApprovalProposal.status)) { + throw new Error( + `pre-propose approval proposal ${approvalProposalNumber} was not approved` + ) + } + + return `${approvalDaoApprovalProposalModulePrefix}${completedPreProposeApprovalProposal.status.approved.created_proposal_id}` + }, +}) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/Mint/index.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/Mint/index.tsx index abfcac6c5..dbb260bf0 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/Mint/index.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/Mint/index.tsx @@ -26,29 +26,27 @@ export interface MintData { } const useTransformToCosmos: UseTransformToCosmos = () => { - const { governanceTokenAddress, governanceTokenInfo } = - useGovernanceTokenInfo() + const { governanceToken } = useGovernanceTokenInfo() return useCallback( (data: MintData) => { const amount = convertDenomToMicroDenomWithDecimals( data.amount, - governanceTokenInfo.decimals + governanceToken.decimals ) return makeExecutableMintMessage( makeMintMessage(amount.toString(), data.to), - governanceTokenAddress + governanceToken.denomOrAddress ) }, - [governanceTokenAddress, governanceTokenInfo.decimals] + [governanceToken] ) } const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( msg: Record ) => { - const { governanceTokenAddress, governanceTokenInfo } = - useGovernanceTokenInfo() + const { governanceToken } = useGovernanceTokenInfo() return useMemo(() => { if ( @@ -57,7 +55,7 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( 'contract_addr' in msg.wasm.execute && // Mint action only supports minting our own governance token. Let // custom action handle the rest of the mint messages for now. - msg.wasm.execute.contract_addr === governanceTokenAddress && + msg.wasm.execute.contract_addr === governanceToken.denomOrAddress && 'mint' in msg.wasm.execute.msg && 'amount' in msg.wasm.execute.msg.mint && 'recipient' in msg.wasm.execute.msg.mint @@ -68,24 +66,24 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( to: msg.wasm.execute.msg.mint.recipient, amount: convertMicroDenomToDenomWithDecimals( msg.wasm.execute.msg.mint.amount, - governanceTokenInfo.decimals + governanceToken.decimals ), }, } } return { match: false } - }, [governanceTokenAddress, governanceTokenInfo.decimals, msg]) + }, [governanceToken, msg]) } const Component: ActionComponent = (props) => { - const { token } = useGovernanceTokenInfo() + const { governanceToken } = useGovernanceTokenInfo() return ( diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/MembersTab.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/MembersTab.tsx index f23551a47..1611f9921 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/MembersTab.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/MembersTab.tsx @@ -19,7 +19,7 @@ import { useGovernanceTokenInfo } from '../hooks/useGovernanceTokenInfo' export const MembersTab = () => { const { t } = useTranslation() const { chainId, votingModuleAddress } = useVotingModuleAdapterOptions() - const { token } = useGovernanceTokenInfo() + const { governanceToken } = useGovernanceTokenInfo() const members = useCachedLoadingWithError( DaoVotingCw20StakedSelectors.topStakersSelector({ @@ -36,14 +36,14 @@ export const MembersTab = () => { address, balance: { label: t('title.staked'), - unit: '$' + token.symbol, + unit: '$' + governanceToken.symbol, value: { loading: false, data: convertMicroDenomToDenomWithDecimals( balance, - token.decimals + governanceToken.decimals ).toLocaleString(undefined, { - maximumFractionDigits: token.decimals, + maximumFractionDigits: governanceToken.decimals, }), }, }, diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/ProfileCardMemberInfo.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/ProfileCardMemberInfo.tsx index cceb0302b..cd8fbf531 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/ProfileCardMemberInfo.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/ProfileCardMemberInfo.tsx @@ -51,12 +51,10 @@ export const ProfileCardMemberInfo = ({ const [claimingLoading, setClaimingLoading] = useState(false) const stakingLoading = useRecoilValue(stakingLoadingAtom) - const { - token: governanceToken, - loadingWalletBalance: loadingUnstakedBalance, - } = useGovernanceTokenInfo({ - fetchWalletBalance: true, - }) + const { governanceToken, loadingWalletBalance: loadingUnstakedBalance } = + useGovernanceTokenInfo({ + fetchWalletBalance: true, + }) const { stakingContractAddress, diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/StakingModal.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/StakingModal.tsx index 0180c5a50..6b8624c8c 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/StakingModal.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/StakingModal.tsx @@ -63,12 +63,10 @@ const InnerStakingModal = ({ const [stakingLoading, setStakingLoading] = useRecoilState(stakingLoadingAtom) - const { - token: governanceToken, - loadingWalletBalance: loadingUnstakedBalance, - } = useGovernanceTokenInfo({ - fetchWalletBalance: true, - }) + const { governanceToken, loadingWalletBalance: loadingUnstakedBalance } = + useGovernanceTokenInfo({ + fetchWalletBalance: true, + }) const { stakingContractAddress, unstakingDuration, diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useGovernanceTokenInfo.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useGovernanceTokenInfo.ts index 6ce6500cc..ec0eff630 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useGovernanceTokenInfo.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useGovernanceTokenInfo.ts @@ -3,10 +3,12 @@ import { constSelector, useRecoilValue, waitForAll } from 'recoil' import { Cw20BaseSelectors, DaoVotingCw20StakedSelectors, + genericTokenSelector, usdPriceSelector, } from '@dao-dao/state' import { useCachedLoading } from '@dao-dao/stateless' import { TokenType } from '@dao-dao/types' +import { convertMicroDenomToDenomWithDecimals } from '@dao-dao/utils' import { useWallet } from '../../../../hooks/useWallet' import { useVotingModuleAdapterOptions } from '../../../react/context' @@ -39,16 +41,17 @@ export const useGovernanceTokenInfo = ({ ]) ) - const [governanceTokenInfo, governanceTokenLogoUrl] = useRecoilValue( + const [governanceToken, cw20TokenInfo] = useRecoilValue( waitForAll([ - Cw20BaseSelectors.tokenInfoSelector({ + genericTokenSelector({ chainId, - contractAddress: governanceTokenAddress, - params: [], + type: TokenType.Cw20, + denomOrAddress: governanceTokenAddress, }), - Cw20BaseSelectors.logoUrlSelector({ + Cw20BaseSelectors.tokenInfoSelector({ chainId, contractAddress: governanceTokenAddress, + params: [], }), ]) ) @@ -92,22 +95,12 @@ export const useGovernanceTokenInfo = ({ ) return { + governanceToken, + supply: convertMicroDenomToDenomWithDecimals( + cw20TokenInfo.total_supply, + governanceToken.decimals + ), stakingContractAddress, - governanceTokenAddress, - governanceTokenInfo, - token: { - chainId, - type: TokenType.Cw20, - denomOrAddress: governanceTokenAddress, - symbol: governanceTokenInfo.symbol, - decimals: governanceTokenInfo.decimals, - imageUrl: governanceTokenLogoUrl, - source: { - chainId, - type: TokenType.Cw20, - denomOrAddress: governanceTokenAddress, - }, - }, /// Optional // Wallet balance loadingWalletBalance: loadingWalletBalance.loading diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useMainDaoInfoCards.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useMainDaoInfoCards.tsx index 928ecf93b..0ed6b96d2 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useMainDaoInfoCards.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useMainDaoInfoCards.tsx @@ -7,8 +7,8 @@ import { } from '@dao-dao/stateless' import { DaoInfoCard } from '@dao-dao/types' import { + convertDenomToMicroDenomWithDecimals, convertDurationToHumanReadableString, - convertMicroDenomToDenomWithDecimals, formatPercentOf100, } from '@dao-dao/utils' @@ -28,7 +28,8 @@ export const useMainDaoInfoCards = (): DaoInfoCard[] => { const { unstakingDuration } = useStakingInfo() const { - governanceTokenInfo: { decimals, symbol, total_supply }, + governanceToken: { decimals, symbol }, + supply, } = useGovernanceTokenInfo() const loadingMembers = useCachedLoadingWithError( @@ -56,7 +57,7 @@ export const useMainDaoInfoCards = (): DaoInfoCard[] => { }), value: ( @@ -72,7 +73,9 @@ export const useMainDaoInfoCards = (): DaoInfoCard[] => { totalVotingWeight === undefined ? undefined : formatPercentOf100( - (totalVotingWeight / Number(total_supply)) * 100 + (totalVotingWeight / + convertDenomToMicroDenomWithDecimals(supply, decimals)) * + 100 ), }, { diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useVotingModuleRelevantAddresses.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useVotingModuleRelevantAddresses.ts index 3536645e3..ffe4fa35e 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useVotingModuleRelevantAddresses.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useVotingModuleRelevantAddresses.ts @@ -8,13 +8,12 @@ export const useVotingModuleRelevantAddresses = (): VotingModuleRelevantAddress[] => { const { t } = useTranslation() - const { stakingContractAddress, governanceTokenAddress } = - useGovernanceTokenInfo() + const { governanceToken, stakingContractAddress } = useGovernanceTokenInfo() return [ { label: t('info.govTokenAddress'), - address: governanceTokenAddress, + address: governanceToken.denomOrAddress, }, { label: t('info.stakingAddress'), diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/types.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/types.ts index 92bffd83a..728507d54 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/types.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/types.ts @@ -4,7 +4,6 @@ import { GenericTokenWithUsdPrice, LoadingData, } from '@dao-dao/types' -import { TokenInfoResponse } from '@dao-dao/types/contracts/Cw20Base' import { Claim } from '@dao-dao/types/contracts/Cw20Stake' export interface UseStakingInfoOptions { @@ -32,22 +31,50 @@ export interface UseStakingInfoResponse { loadingWalletStakedValue?: LoadingData } -export interface UseGovernanceTokenInfoOptions { +export type UseGovernanceTokenInfoOptions = { + /** + * Optionally fetch wallet balance. Defaults to false. + */ fetchWalletBalance?: boolean + /** + * Optionally fetch treasury balance. Defaults to false. + */ fetchTreasuryBalance?: boolean + /** + * Optionally fetch USDC price. Defaults to false. + */ fetchUsdcPrice?: boolean } -export interface UseGovernanceTokenInfoResponse { +export type UseGovernanceTokenInfoResponse = { + /** + * The generic governance token. + */ + governanceToken: GenericToken + /** + * The supply of the governance token converted to the appropriate decimals. + */ + supply: number + /** + * The staking contract address for the governance token. + */ stakingContractAddress: string - governanceTokenAddress: string - governanceTokenInfo: TokenInfoResponse - token: GenericToken - /// Optional - // Wallet balance + + // Optional, defined if options are set to true. + + /** + * Unstaked governance token balance. Only defined if a wallet is connected + * and the option to fetch this is true. + */ loadingWalletBalance?: LoadingData - // Treasury balance + /** + * The treasury balance of the governance token. Only defined if the option to + * fetch this is true. + */ loadingTreasuryBalance?: LoadingData - // Price + /** + * The price of the governance token. Only defined if the option to fetch this + * is true. + */ loadingPrice?: LoadingData } diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/actions/Mint/index.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/actions/Mint/index.tsx index 3cae868fa..85b1a60ac 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/actions/Mint/index.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/actions/Mint/index.tsx @@ -32,8 +32,7 @@ const useDefaults: UseDefaults = () => ({ const useTransformToCosmos: UseTransformToCosmos = () => { const { address } = useActionOptions() - const { governanceTokenAddress, governanceTokenInfo } = - useGovernanceTokenInfo() + const { governanceToken } = useGovernanceTokenInfo() return useCallback( (data: MintData) => { @@ -45,25 +44,22 @@ const useTransformToCosmos: UseTransformToCosmos = () => { amount: coin( convertDenomToMicroDenomStringWithDecimals( data.amount, - governanceTokenInfo.decimals + governanceToken.decimals ), - governanceTokenAddress + governanceToken.denomOrAddress ), } as MsgMint, }, }) }, - [address, governanceTokenAddress, governanceTokenInfo.decimals] + [address, governanceToken] ) } const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( msg: Record ) => { - const { - governanceTokenAddress, - governanceTokenInfo: { decimals }, - } = useGovernanceTokenInfo() + const { governanceToken } = useGovernanceTokenInfo() return useMemo(() => { if ( @@ -77,27 +73,30 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( const { denom, amount } = msg.stargate.value.amount as Coin - return governanceTokenAddress === denom + return governanceToken.denomOrAddress === denom ? { match: true, data: { - amount: convertMicroDenomToDenomWithDecimals(amount, decimals), + amount: convertMicroDenomToDenomWithDecimals( + amount, + governanceToken.decimals + ), }, } : { match: false, } - }, [governanceTokenAddress, decimals, msg]) + }, [governanceToken, msg]) } const Component: ActionComponent = (props) => { - const { token } = useGovernanceTokenInfo() + const { governanceToken } = useGovernanceTokenInfo() return ( ) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/MembersTab.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/MembersTab.tsx index 501fccbd4..c09fa8ba5 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/MembersTab.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/MembersTab.tsx @@ -19,7 +19,7 @@ import { useGovernanceTokenInfo } from '../hooks/useGovernanceTokenInfo' export const MembersTab = () => { const { t } = useTranslation() const { chainId, votingModuleAddress } = useVotingModuleAdapterOptions() - const { token } = useGovernanceTokenInfo() + const { governanceToken } = useGovernanceTokenInfo() const members = useCachedLoadingWithError( DaoVotingNativeStakedSelectors.topStakersSelector({ @@ -36,14 +36,14 @@ export const MembersTab = () => { address, balance: { label: t('title.staked'), - unit: '$' + token.symbol, + unit: '$' + governanceToken.symbol, value: { loading: false, data: convertMicroDenomToDenomWithDecimals( balance, - token.decimals + governanceToken.decimals ).toLocaleString(undefined, { - maximumFractionDigits: token.decimals, + maximumFractionDigits: governanceToken.decimals, }), }, }, diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/ProfileCardMemberInfo.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/ProfileCardMemberInfo.tsx index ec24c6a3e..0da757f3d 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/ProfileCardMemberInfo.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/ProfileCardMemberInfo.tsx @@ -50,12 +50,10 @@ export const ProfileCardMemberInfo = ({ const [claimingLoading, setClaimingLoading] = useState(false) const stakingLoading = useRecoilValue(stakingLoadingAtom) - const { - token: governanceToken, - loadingWalletBalance: loadingUnstakedBalance, - } = useGovernanceTokenInfo({ - fetchWalletBalance: true, - }) + const { governanceToken, loadingWalletBalance: loadingUnstakedBalance } = + useGovernanceTokenInfo({ + fetchWalletBalance: true, + }) const { unstakingDuration, diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/StakingModal.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/StakingModal.tsx index f2b145df2..f0a77c88d 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/StakingModal.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/StakingModal.tsx @@ -54,12 +54,10 @@ const InnerStakingModal = ({ const [stakingLoading, setStakingLoading] = useRecoilState(stakingLoadingAtom) - const { - token: governanceToken, - loadingWalletBalance: loadingUnstakedBalance, - } = useGovernanceTokenInfo({ - fetchWalletBalance: true, - }) + const { governanceToken, loadingWalletBalance: loadingUnstakedBalance } = + useGovernanceTokenInfo({ + fetchWalletBalance: true, + }) const { unstakingDuration, refreshTotals, diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/hooks/useGovernanceTokenInfo.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/hooks/useGovernanceTokenInfo.ts index 3f5d92523..ae3dc0be4 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/hooks/useGovernanceTokenInfo.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/hooks/useGovernanceTokenInfo.ts @@ -9,7 +9,7 @@ import { } from '@dao-dao/state' import { useCachedLoading } from '@dao-dao/stateless' import { TokenType } from '@dao-dao/types' -import { TokenInfoResponse } from '@dao-dao/types/contracts/Cw20Base' +import { convertMicroDenomToDenomWithDecimals } from '@dao-dao/utils' import { useWallet } from '../../../../hooks/useWallet' import { useVotingModuleAdapterOptions } from '../../../react/context' @@ -37,7 +37,7 @@ export const useGovernanceTokenInfo = ({ }) ) - const [token, supply] = useRecoilValue( + const [governanceToken, supply] = useRecoilValue( waitForAll([ genericTokenSelector({ chainId, @@ -50,12 +50,6 @@ export const useGovernanceTokenInfo = ({ }), ]) ) - const governanceTokenInfo: TokenInfoResponse = { - decimals: token.decimals, - name: token.symbol, - symbol: token.symbol, - total_supply: supply.toString(), - } /// Optional @@ -85,7 +79,7 @@ export const useGovernanceTokenInfo = ({ // Price info const loadingPrice = useCachedLoading( - fetchUsdcPrice && governanceTokenInfo + fetchUsdcPrice ? usdPriceSelector({ type: TokenType.Native, chainId, @@ -96,10 +90,11 @@ export const useGovernanceTokenInfo = ({ ) return { - stakingContractAddress: '', - governanceTokenAddress: denom, - governanceTokenInfo, - token, + governanceToken, + supply: convertMicroDenomToDenomWithDecimals( + supply, + governanceToken.decimals + ), /// Optional // Wallet balance loadingWalletBalance: loadingWalletBalance.loading diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/hooks/useMainDaoInfoCards.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/hooks/useMainDaoInfoCards.tsx index cdefa1dc5..83d64c2a1 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/hooks/useMainDaoInfoCards.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/hooks/useMainDaoInfoCards.tsx @@ -27,7 +27,8 @@ export const useMainDaoInfoCards = (): DaoInfoCard[] => { } const { - governanceTokenInfo: { decimals, symbol, total_supply }, + governanceToken: { decimals, symbol }, + supply, } = useGovernanceTokenInfo() const loadingMembers = useCachedLoadingWithError( @@ -55,7 +56,7 @@ export const useMainDaoInfoCards = (): DaoInfoCard[] => { }), value: ( diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/types.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/types.ts index 47d89c039..53d2b3660 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/types.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/types.ts @@ -5,7 +5,6 @@ import { GenericTokenWithUsdPrice, LoadingData, } from '@dao-dao/types' -import { TokenInfoResponse } from '@dao-dao/types/contracts/Cw20Base' import { Claim } from '@dao-dao/types/contracts/DaoVotingNativeStaked' export interface DaoCreationConfig { @@ -39,22 +38,46 @@ export interface UseStakingInfoResponse { loadingWalletStakedValue?: LoadingData } -export interface UseGovernanceTokenInfoOptions { +export type UseGovernanceTokenInfoOptions = { + /** + * Optionally fetch wallet balance. Defaults to false. + */ fetchWalletBalance?: boolean + /** + * Optionally fetch treasury balance. Defaults to false. + */ fetchTreasuryBalance?: boolean + /** + * Optionally fetch USDC price. Defaults to false. + */ fetchUsdcPrice?: boolean } -export interface UseGovernanceTokenInfoResponse { - stakingContractAddress: string - governanceTokenAddress: string - governanceTokenInfo: TokenInfoResponse - token: GenericToken - /// Optional - // Wallet balance +export type UseGovernanceTokenInfoResponse = { + /** + * The generic governance token. + */ + governanceToken: GenericToken + /** + * The supply of the governance token converted to the appropriate decimals. + */ + supply: number + + // Optional, defined if options are set to true. + + /** + * Unstaked governance token balance. Only defined if a wallet is connected + * and the option to fetch this is true. + */ loadingWalletBalance?: LoadingData - // Treasury balance + /** + * The treasury balance of the governance token. Only defined if the option to + * fetch this is true. + */ loadingTreasuryBalance?: LoadingData - // Price + /** + * The price of the governance token. Only defined if the option to fetch this + * is true. + */ loadingPrice?: LoadingData } diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/Mint/index.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/Mint/index.tsx index c05a8c332..47da816dc 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/Mint/index.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/Mint/index.tsx @@ -29,7 +29,7 @@ import { const useTransformToCosmos: UseTransformToCosmos = () => { const { tokenFactoryIssuerAddress, - governanceTokenInfo: { decimals }, + governanceToken: { decimals }, } = useGovernanceTokenInfo() return useCallback( @@ -60,7 +60,7 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( ) => { const { tokenFactoryIssuerAddress, - governanceTokenInfo: { decimals }, + governanceToken: { decimals }, } = useGovernanceTokenInfo() return objectMatchesStructure(msg, { @@ -92,13 +92,13 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( } const Component: ActionComponent = (props) => { - const { token } = useGovernanceTokenInfo() + const { governanceToken } = useGovernanceTokenInfo() return ( diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/UpdateMinterAllowance/index.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/UpdateMinterAllowance/index.tsx index 025fb31c3..825fb19e1 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/UpdateMinterAllowance/index.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/UpdateMinterAllowance/index.tsx @@ -31,7 +31,7 @@ const useTransformToCosmos: UseTransformToCosmos< > = () => { const { tokenFactoryIssuerAddress, - governanceTokenInfo: { decimals }, + governanceToken: { decimals }, } = useGovernanceTokenInfo() return useCallback( @@ -62,7 +62,7 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( ) => { const { tokenFactoryIssuerAddress, - governanceTokenInfo: { decimals }, + governanceToken: { decimals }, } = useGovernanceTokenInfo() return objectMatchesStructure(msg, { @@ -94,13 +94,13 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( } const Component: ActionComponent = (props) => { - const { token } = useGovernanceTokenInfo() + const { governanceToken } = useGovernanceTokenInfo() return ( diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/MembersTab.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/MembersTab.tsx index 505429cde..3a2c66a1f 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/MembersTab.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/MembersTab.tsx @@ -19,7 +19,7 @@ import { useGovernanceTokenInfo } from '../hooks/useGovernanceTokenInfo' export const MembersTab = () => { const { t } = useTranslation() const { chainId, votingModuleAddress } = useVotingModuleAdapterOptions() - const { token } = useGovernanceTokenInfo() + const { governanceToken } = useGovernanceTokenInfo() const members = useCachedLoadingWithError( DaoVotingTokenStakedSelectors.topStakersSelector({ @@ -36,14 +36,14 @@ export const MembersTab = () => { address, balance: { label: t('title.staked'), - unit: '$' + token.symbol, + unit: '$' + governanceToken.symbol, value: { loading: false, data: convertMicroDenomToDenomWithDecimals( balance, - token.decimals + governanceToken.decimals ).toLocaleString(undefined, { - maximumFractionDigits: token.decimals, + maximumFractionDigits: governanceToken.decimals, }), }, }, diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/ProfileCardMemberInfo.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/ProfileCardMemberInfo.tsx index 487ae2d3a..22341d9b6 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/ProfileCardMemberInfo.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/ProfileCardMemberInfo.tsx @@ -50,12 +50,10 @@ export const ProfileCardMemberInfo = ({ const [claimingLoading, setClaimingLoading] = useState(false) const stakingLoading = useRecoilValue(stakingLoadingAtom) - const { - token: governanceToken, - loadingWalletBalance: loadingUnstakedBalance, - } = useGovernanceTokenInfo({ - fetchWalletBalance: true, - }) + const { governanceToken, loadingWalletBalance: loadingUnstakedBalance } = + useGovernanceTokenInfo({ + fetchWalletBalance: true, + }) const { unstakingDuration, diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/StakingModal.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/StakingModal.tsx index 95bb64378..8959aecea 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/StakingModal.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/StakingModal.tsx @@ -54,12 +54,10 @@ const InnerStakingModal = ({ const [stakingLoading, setStakingLoading] = useRecoilState(stakingLoadingAtom) - const { - token: governanceToken, - loadingWalletBalance: loadingUnstakedBalance, - } = useGovernanceTokenInfo({ - fetchWalletBalance: true, - }) + const { governanceToken, loadingWalletBalance: loadingUnstakedBalance } = + useGovernanceTokenInfo({ + fetchWalletBalance: true, + }) const { unstakingDuration, refreshTotals, diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/hooks/useGovernanceTokenInfo.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/hooks/useGovernanceTokenInfo.ts index d431bd45f..eccc8a861 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/hooks/useGovernanceTokenInfo.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/hooks/useGovernanceTokenInfo.ts @@ -9,7 +9,7 @@ import { } from '@dao-dao/state' import { useCachedLoading } from '@dao-dao/stateless' import { TokenType } from '@dao-dao/types' -import { TokenInfoResponse } from '@dao-dao/types/contracts/Cw20Base' +import { convertMicroDenomToDenomWithDecimals } from '@dao-dao/utils' import { useWallet } from '../../../../hooks/useWallet' import { useVotingModuleAdapterOptions } from '../../../react/context' @@ -37,10 +37,7 @@ export const useGovernanceTokenInfo = ({ }) ) - // Token factory issuer - const isFactory = denom.startsWith('factory/') - - const [token, supply, tokenFactoryIssuerAddress] = useRecoilValue( + const [governanceToken, supply, tokenFactoryIssuerAddress] = useRecoilValue( waitForAll([ genericTokenSelector({ chainId, @@ -59,12 +56,6 @@ export const useGovernanceTokenInfo = ({ ), ]) ) - const governanceTokenInfo: TokenInfoResponse = { - decimals: token.decimals, - name: token.symbol, - symbol: token.symbol, - total_supply: supply.toString(), - } /// Optional @@ -94,7 +85,7 @@ export const useGovernanceTokenInfo = ({ // Price info const loadingPrice = useCachedLoading( - fetchUsdcPrice && governanceTokenInfo + fetchUsdcPrice ? usdPriceSelector({ type: TokenType.Native, chainId, @@ -105,12 +96,12 @@ export const useGovernanceTokenInfo = ({ ) return { - stakingContractAddress: '', - governanceTokenAddress: denom, - governanceTokenInfo, - isFactory, tokenFactoryIssuerAddress, - token, + governanceToken, + supply: convertMicroDenomToDenomWithDecimals( + supply, + governanceToken.decimals + ), /// Optional // Wallet balance loadingWalletBalance: loadingWalletBalance.loading diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/hooks/useMainDaoInfoCards.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/hooks/useMainDaoInfoCards.tsx index 5a5f30ed4..abfff5623 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/hooks/useMainDaoInfoCards.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/hooks/useMainDaoInfoCards.tsx @@ -27,7 +27,8 @@ export const useMainDaoInfoCards = (): DaoInfoCard[] => { } const { - governanceTokenInfo: { decimals, symbol, total_supply }, + governanceToken: { decimals, symbol }, + supply, } = useGovernanceTokenInfo() const loadingMembers = useCachedLoadingWithError( @@ -55,7 +56,7 @@ export const useMainDaoInfoCards = (): DaoInfoCard[] => { }), value: ( diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/types.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/types.ts index 7ef1bcfe7..af650b924 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/types.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/types.ts @@ -5,7 +5,6 @@ import { GenericTokenWithUsdPrice, LoadingData, } from '@dao-dao/types' -import { TokenInfoResponse } from '@dao-dao/types/contracts/Cw20Base' import { Claim } from '@dao-dao/types/contracts/DaoVotingNativeStaked' export interface DaoCreationConfig { @@ -39,27 +38,51 @@ export interface UseStakingInfoResponse { loadingWalletStakedValue?: LoadingData } -export interface UseGovernanceTokenInfoOptions { +export type UseGovernanceTokenInfoOptions = { + /** + * Optionally fetch wallet balance. Defaults to false. + */ fetchWalletBalance?: boolean + /** + * Optionally fetch treasury balance. Defaults to false. + */ fetchTreasuryBalance?: boolean + /** + * Optionally fetch USDC price. Defaults to false. + */ fetchUsdcPrice?: boolean } -// TODO: Make improved standard that covers native tokens and custom info. -export interface UseGovernanceTokenInfoResponse { - stakingContractAddress: string - governanceTokenAddress: string - isFactory: boolean - // Will be defined if the governance token is a token factory denom and a - // token factory issuer contract exists. +export type UseGovernanceTokenInfoResponse = { + /** + * The token factory issuer contract address, if the governance token is a + * token factory denom and a token factory issuer contract exists. + */ tokenFactoryIssuerAddress: string | undefined - governanceTokenInfo: TokenInfoResponse - token: GenericToken - /// Optional - // Wallet balance + /** + * The generic governance token. + */ + governanceToken: GenericToken + /** + * The supply of the governance token converted to the appropriate decimals. + */ + supply: number + + // Optional, defined if options are set to true. + + /** + * Unstaked governance token balance. Only defined if a wallet is connected + * and the option to fetch this is true. + */ loadingWalletBalance?: LoadingData - // Treasury balance + /** + * The treasury balance of the governance token. Only defined if the option to + * fetch this is true. + */ loadingTreasuryBalance?: LoadingData - // Price + /** + * The price of the governance token. Only defined if the option to fetch this + * is true. + */ loadingPrice?: LoadingData } diff --git a/packages/types/proposal-module-adapter.ts b/packages/types/proposal-module-adapter.ts index d2be1e599..38eae7abc 100644 --- a/packages/types/proposal-module-adapter.ts +++ b/packages/types/proposal-module-adapter.ts @@ -158,14 +158,34 @@ export type IProposalModuleAdapterCommonInitialOptions = Omit< > export type IProposalModuleAdapterOptions = { + /** + * The DAO's native chain. + */ chain: Chain + /** + * The DAO's core contract address. + */ coreAddress: string + /** + * The proposal module. + */ proposalModule: ProposalModule + /** + * The proposal ID unique across all proposal modules. They include the + * proposal module's prefix, the proposal number within the proposal module, + * and potentially an asterisk in the middle to indicate a + * pre-propose-approval proposal. + */ proposalId: string + /** + * The proposal number used by the proposal module to identify this proposal. + */ proposalNumber: number - // Whether or not this refers to a pre-propose-approval proposal. If this is - // true, the proposal ID should contain an asterisk (*) between the proposal - // module prefix and proposal number. + /** + * Whether or not this refers to a pre-propose-approval proposal. If this is + * true, the proposal ID should contain an asterisk (*) between the proposal + * module prefix and proposal number. + */ isPreProposeApprovalProposal: boolean } diff --git a/packages/types/token.ts b/packages/types/token.ts index 69a19052d..eace00466 100644 --- a/packages/types/token.ts +++ b/packages/types/token.ts @@ -24,15 +24,36 @@ export type GenericTokenSource = Pick< // A native or CW20 token. export type GenericToken = { - // What chain this token lives on. + /** + * What chain this token exists on. + */ chainId: string + /** + * The type of this token. + */ type: TokenType + /** + * The native denom or contract address for this token. Denom when type is + * native, and contract address when type is cw20/cw721. + */ denomOrAddress: string + /** + * The symbol for this token. + */ symbol: string + /** + * The decimals for this token. + */ decimals: number + /** + * The image URL for this token. + */ imageUrl: string | undefined - // The source chain and base denom. For IBC assets, this should differ from - // the main fields. + /** + * The source chain and base denom. For IBC assets, this should differ from + * the main fields. If the source chain ID is the same as the main chain ID, + * then the type and denomOrAddress should be the same too. + */ source: GenericTokenSource } From c1ce82189ca31a1ce3ab60788699f8bff91aafca Mon Sep 17 00:00:00 2001 From: ismellike Date: Sun, 10 Mar 2024 03:13:16 -0500 Subject: [PATCH 043/438] Dynamically load react-codemirror2 (#1749) Fixes error when trying to run development instance: Error [ReferenceError]: document is not defined https://nextjs.org/docs/pages/building-your-application/optimizing/lazy-loading#with-no-ssr --- .../stateless/components/CosmosMessageDisplay.tsx | 9 ++++++++- .../stateless/components/inputs/CodeMirrorInput.tsx | 12 +++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/packages/stateless/components/CosmosMessageDisplay.tsx b/packages/stateless/components/CosmosMessageDisplay.tsx index e52dcd09c..db518b6c0 100644 --- a/packages/stateless/components/CosmosMessageDisplay.tsx +++ b/packages/stateless/components/CosmosMessageDisplay.tsx @@ -3,10 +3,17 @@ import 'codemirror/theme/material-ocean.css' import 'codemirror/theme/material.css' import clsx from 'clsx' -import { UnControlled as CodeMirror } from 'react-codemirror2' +import dynamic from 'next/dynamic' import { Theme, useThemeContext } from '../theme' +const CodeMirror = dynamic( + () => import('react-codemirror2').then((module) => module.UnControlled), + { + ssr: false, + } +) + // This check is to prevent this import to be server side rendered. if (typeof window !== 'undefined' && typeof window.navigator !== 'undefined') { require('codemirror/mode/javascript/javascript.js') diff --git a/packages/stateless/components/inputs/CodeMirrorInput.tsx b/packages/stateless/components/inputs/CodeMirrorInput.tsx index 572d56e31..561d68e42 100644 --- a/packages/stateless/components/inputs/CodeMirrorInput.tsx +++ b/packages/stateless/components/inputs/CodeMirrorInput.tsx @@ -1,7 +1,7 @@ import 'codemirror/lib/codemirror.css' import 'codemirror/theme/material.css' -import { Controlled as CodeMirror } from 'react-codemirror2' +import dynamic from 'next/dynamic' import { Control, Controller, @@ -14,6 +14,13 @@ import { import { useThemeContext } from '../../theme' +const CodeMirror = dynamic( + () => import('react-codemirror2').then((module) => module.Controlled), + { + ssr: false, + } +) + // This check is to prevent this import to be server side rendered. if (typeof window !== 'undefined' && typeof window.navigator !== 'undefined') { require('codemirror/mode/javascript/javascript.js') @@ -71,13 +78,12 @@ export function CodeMirrorInput>({ ( + render={({ field: { onChange, onBlur, value } }) => ( onChange(value)} onBlur={(_instance, _event) => onBlur()} options={cmOptions} - ref={ref} value={transform ? transform(value) : value} /> )} From 0e44db05bb87d49be87a20cd44240e7e4b5251c0 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 10 Mar 2024 00:43:22 -0800 Subject: [PATCH 044/438] updated unstaking mechanics translation --- packages/i18n/locales/en/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index ae8c55091..6a1d4e4f5 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -1307,7 +1307,7 @@ "unstake": "Unstake", "unstakingDurationExplanation": "It takes {{duration}} to unstake tokens.", "unstakingDurationNoneExplanation": "Your tokens will unstake immediately.", - "unstakingMechanics": "It will take {{humanReadableTime}} from the time you unstake your tokens before they are able to be redeemed by you. During that time, you will not receive staking rewards. You will not be able to cancel the unbonding.", + "unstakingMechanics": "It will take {{humanReadableTime}} from when you unstake your tokens until you can withdrawn them. During that time, you will not receive voting power for the unstaking tokens, nor will you be able to cancel the unstaking process.", "unstakingPeriodTooltip": "The amount of time you must wait after unstaking ${{tokenSymbol}} before you can withdraw.", "unstakingPeriodTooltip_noToken": "The amount of time you must wait after unstaking before you can withdraw.", "unstakingStatus": { From d3773eb7e2d29eec70ba4124d27b4debfce6f464 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 10 Mar 2024 01:05:27 -0800 Subject: [PATCH 045/438] hide following DAOs expand button when none being followed --- packages/stateless/components/layout/DappNavigation.tsx | 3 +++ packages/stateless/components/layout/Row.tsx | 5 +++-- packages/types/components/Row.ts | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/stateless/components/layout/DappNavigation.tsx b/packages/stateless/components/layout/DappNavigation.tsx index a3285f1b6..fae934f83 100644 --- a/packages/stateless/components/layout/DappNavigation.tsx +++ b/packages/stateless/components/layout/DappNavigation.tsx @@ -239,6 +239,9 @@ export const DappNavigation = ({ LinkWrapper={LinkWrapper} compact={compact} defaultExpanded + hideExpand={ + !followingDaos.loading && followingDaos.data.length === 0 + } label={t('title.following')} loading={followingDaos.loading || followingDaos.updating} > diff --git a/packages/stateless/components/layout/Row.tsx b/packages/stateless/components/layout/Row.tsx index a64c9927d..7b8aa8eed 100644 --- a/packages/stateless/components/layout/Row.tsx +++ b/packages/stateless/components/layout/Row.tsx @@ -20,6 +20,7 @@ export const Row = ({ href, defaultExpanded = false, forceExpanded = false, + hideExpand = false, compact = false, loading = false, selected = false, @@ -113,7 +114,7 @@ export const Row = ({ {loading ? ( ) : // If children exist and not forcing expanded, display expand button. - children && !forceExpanded ? ( + children && !forceExpanded && !hideExpand ? ( - {children && ( + {children && !hideExpand && ( // Load in background even when hidden.
{children}
)} diff --git a/packages/types/components/Row.ts b/packages/types/components/Row.ts index a9eb99396..8de053d36 100644 --- a/packages/types/components/Row.ts +++ b/packages/types/components/Row.ts @@ -13,6 +13,7 @@ export interface RowProps { href?: string defaultExpanded?: boolean forceExpanded?: boolean + hideExpand?: boolean compact?: boolean loading?: boolean selected?: boolean From 28fa2d9c078e34ba3ef4059840fa39a728caab4d Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 10 Mar 2024 16:08:39 -0700 Subject: [PATCH 046/438] fixed missing community pool spend tokens --- .../GovernanceProposal/Component.stories.tsx | 1 + .../GovernanceProposal/Component.tsx | 29 +++++++++++++------ .../GovernanceProposal/index.tsx | 9 ++++++ 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.stories.tsx b/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.stories.tsx index f9de48db7..6ad4a1ea3 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.stories.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.stories.tsx @@ -74,6 +74,7 @@ Default.args = { options: { supportsV1GovProposals: true, minDeposits: { loading: false, data: [] }, + communityPoolBalances: { loading: false, data: [] }, TokenAmountDisplay, AddressInput, GovProposalActionDisplay, diff --git a/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.tsx b/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.tsx index 559679803..f55ce184c 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.tsx @@ -30,6 +30,7 @@ import { GOVERNANCE_PROPOSAL_TYPE_CUSTOM, GenericToken, GenericTokenBalance, + GenericTokenBalanceWithOwner, GovProposalActionDisplayProps, GovernanceProposalActionData, LoadingData, @@ -59,6 +60,7 @@ export type GovernanceProposalOptions = { min: string })[] > + communityPoolBalances: LoadingData TokenAmountDisplay: ComponentType AddressInput: ComponentType> GovProposalActionDisplay: ComponentType @@ -75,6 +77,7 @@ export const GovernanceProposalComponent: ActionComponent< options: { supportsV1GovProposals, minDeposits, + communityPoolBalances, GovProposalActionDisplay, TokenAmountDisplay, AddressInput, @@ -128,15 +131,23 @@ export const GovernanceProposalComponent: ActionComponent< name: (fieldNamePrefix + 'legacy.spends') as 'legacy.spends', }) - const availableTokens: GenericToken[] = [ - // First native. - ...(nativeToken ? [nativeToken] : []), - // Then the chain assets. - ...getChainAssets(chainId).filter( - ({ denomOrAddress }) => - !nativeToken || denomOrAddress !== nativeToken.denomOrAddress - ), - ] + const availableTokens: GenericToken[] = Object.values( + Object.fromEntries( + [ + // First native. + ...(nativeToken ? [nativeToken] : []), + // Then community pool tokens. + ...(!communityPoolBalances.loading + ? communityPoolBalances.data.map(({ token }) => token) + : []), + // Then the chain assets. + ...getChainAssets(chainId).filter( + ({ denomOrAddress }) => + !nativeToken || denomOrAddress !== nativeToken.denomOrAddress + ), + ].map((token) => [token.denomOrAddress, token]) + ) + ) // When any legacy fields change, encode and store it. const legacy = watch((fieldNamePrefix + 'legacy') as 'legacy') diff --git a/packages/stateful/actions/core/chain_governance/GovernanceProposal/index.tsx b/packages/stateful/actions/core/chain_governance/GovernanceProposal/index.tsx index 599df09d8..6bdda1b37 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceProposal/index.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceProposal/index.tsx @@ -5,6 +5,7 @@ import { useRecoilValue, waitForAll } from 'recoil' import { chainSupportsV1GovModuleSelector, + communityPoolBalancesSelector, genericTokenBalanceSelector, genericTokenSelector, govParamsSelector, @@ -132,6 +133,13 @@ const InnerComponent = ({ }) ) + const communityPoolBalances = useCachedLoading( + communityPoolBalancesSelector({ + chainId, + }), + [] + ) + // Update version in data. useEffect(() => { setValue( @@ -220,6 +228,7 @@ const InnerComponent = ({ min: minDepositParams[index].amount, })), }, + communityPoolBalances, categories, loadedActions, TokenAmountDisplay, From d0cf4325fd083db0fe060f133799416ed8960aad Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 11 Mar 2024 10:41:26 -0700 Subject: [PATCH 047/438] fixed IBC transfer --- .../stateful/actions/core/treasury/Spend/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/stateful/actions/core/treasury/Spend/index.tsx b/packages/stateful/actions/core/treasury/Spend/index.tsx index 9c677d14a..799261a09 100644 --- a/packages/stateful/actions/core/treasury/Spend/index.tsx +++ b/packages/stateful/actions/core/treasury/Spend/index.tsx @@ -730,10 +730,12 @@ const useTransformToCosmos: UseTransformToCosmos = () => { // use empty string. This will be undefined if PFM is not used // and it's only a single hop. memo: - skipTransferMsgValue.memo.replace( - /"timeout":\d+/g, - `"timeout":${timeoutTimestamp.toString()}` - ) || '', + (typeof skipTransferMsgValue.memo === 'string' && + skipTransferMsgValue.memo.replace( + /"timeout":\d+/g, + `"timeout":${timeoutTimestamp.toString()}` + )) || + '', timeout_timestamp: timeoutTimestamp, timeout_height: undefined, }), From f6e0e8c4a95d2a6dfa1af1ae53fe737318bb0ef1 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 12 Mar 2024 12:02:18 +0100 Subject: [PATCH 048/438] added oraichain<>juno polytone connections --- packages/utils/constants/chains.ts | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 7d1e40d0a..f90b4eb7b 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -203,6 +203,24 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // kujira remoteChannel: 'channel-129', }, + [ChainId.OraichainMainnet]: { + // juno + note: 'juno1slr28gq9acpjj2dqt90svs6dwlmaev77uupg9fysy6200vkssjfsca266k', + // juno + listener: + 'juno1r2hez8nr6yqcxcadpyp6ckjsapn0dxkhgf50mspvez74fhwq4ymqfl776u', + // oraichain + voice: + 'orai1chmwuwq4akxcpm0dv2w5rc5qr0d9c7ufpwacrzn7uheyd5c2wxvsff4vsv', + // juno + localConnection: 'connection-521', + // oraichain + remoteConnection: 'connection-150', + // juno + localChannel: 'channel-529', + // oraichain + remoteChannel: 'channel-229', + }, }, }, { @@ -1049,6 +1067,24 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // osmosis remoteChannel: 'channel-20862', }, + [ChainId.JunoMainnet]: { + // oraichain + note: 'orai1nu034cg5w2eax65n5nx9q92gaahywehjwfagf2cutwndt3jw66rsuj9n5a', + // oraichain + listener: + 'orai10urjh074nxcmy98sxl98rj63gyexdjvx5w7ttrtwsqsur3ucpk6qftv9ek', + // juno + voice: + 'juno1r9uz5a35ru3tpsjktd3a7kgj3afmrq993trkpmmxxlxwmtethc0s6s7v2y', + // oraichain + localConnection: 'connection-150', + // juno + remoteConnection: 'connection-521', + // oraichain + localChannel: 'channel-230', + // juno + remoteChannel: 'channel-530', + }, }, }, { From f5b98d4da655f27fb1386434f146152fdb6e759b Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 12 Mar 2024 12:49:20 +0100 Subject: [PATCH 049/438] fixed IBC transfer info getter --- packages/utils/chain.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/utils/chain.ts b/packages/utils/chain.ts index 33d062bff..cf18920ec 100644 --- a/packages/utils/chain.ts +++ b/packages/utils/chain.ts @@ -312,16 +312,16 @@ export const getIbcTransferInfoBetweenChains = ( const info = ibc.find( ({ chain_1, chain_2, channels }) => - (chain_1.chain_name === srcChainName && + ((chain_1.chain_name === srcChainName && chain_2.chain_name === destChainName) || - (chain_1.chain_name === destChainName && - chain_2.chain_name === srcChainName && - channels.some( - ({ chain_1, chain_2, version }) => - version === 'ics20-1' && - chain_1.port_id === 'transfer' && - chain_2.port_id === 'transfer' - )) + (chain_1.chain_name === destChainName && + chain_2.chain_name === srcChainName)) && + channels.some( + ({ chain_1, chain_2, version }) => + version === 'ics20-1' && + chain_1.port_id === 'transfer' && + chain_2.port_id === 'transfer' + ) ) if (!info) { throw new Error( From 6e6067e622f478708ad30d2f331b8d81397f58b9 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 12 Mar 2024 15:33:25 +0100 Subject: [PATCH 050/438] updated versions to 2.4.0-rc.0 and published --- apps/dapp/package.json | 16 ++++++++-------- apps/sda/package.json | 16 ++++++++-------- lerna.json | 2 +- package.json | 2 +- packages/config/package.json | 2 +- packages/email/package.json | 6 +++--- packages/i18n/package.json | 4 ++-- packages/state/package.json | 8 ++++---- packages/stateful/package.json | 16 ++++++++-------- packages/stateless/package.json | 12 ++++++------ packages/storybook/package.json | 16 ++++++++-------- packages/types/package.json | 4 ++-- packages/utils/package.json | 6 +++--- 13 files changed, 55 insertions(+), 55 deletions(-) diff --git a/apps/dapp/package.json b/apps/dapp/package.json index d5b658a1b..f4ad0a70e 100644 --- a/apps/dapp/package.json +++ b/apps/dapp/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/dapp", - "version": "2.2.0", + "version": "2.4.0-rc.0", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -19,12 +19,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.2.0", - "@dao-dao/state": "2.2.0", - "@dao-dao/stateful": "2.2.0", - "@dao-dao/stateless": "2.2.0", - "@dao-dao/types": "2.2.0", - "@dao-dao/utils": "2.2.0", + "@dao-dao/i18n": "2.4.0-rc.0", + "@dao-dao/state": "2.4.0-rc.0", + "@dao-dao/stateful": "2.4.0-rc.0", + "@dao-dao/stateless": "2.4.0-rc.0", + "@dao-dao/types": "2.4.0-rc.0", + "@dao-dao/utils": "2.4.0-rc.0", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -50,7 +50,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.2.0", + "@dao-dao/config": "2.4.0-rc.0", "@next/bundle-analyzer": "^14.1.0", "@sentry/cli": "^2.21.3", "@solana/web3.js": "^1.75.0", diff --git a/apps/sda/package.json b/apps/sda/package.json index e97332a11..05add6b39 100644 --- a/apps/sda/package.json +++ b/apps/sda/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/sda", - "version": "2.2.0", + "version": "2.4.0-rc.0", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -17,12 +17,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.2.0", - "@dao-dao/state": "2.2.0", - "@dao-dao/stateful": "2.2.0", - "@dao-dao/stateless": "2.2.0", - "@dao-dao/types": "2.2.0", - "@dao-dao/utils": "2.2.0", + "@dao-dao/i18n": "2.4.0-rc.0", + "@dao-dao/state": "2.4.0-rc.0", + "@dao-dao/stateful": "2.4.0-rc.0", + "@dao-dao/stateless": "2.4.0-rc.0", + "@dao-dao/types": "2.4.0-rc.0", + "@dao-dao/utils": "2.4.0-rc.0", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -48,7 +48,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.2.0", + "@dao-dao/config": "2.4.0-rc.0", "@next/bundle-analyzer": "^12.1.0", "@sentry/cli": "^2.21.3", "@solana/web3.js": "^1.75.0", diff --git a/lerna.json b/lerna.json index 0ab20380a..35342e80d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", "useWorkspaces": true, - "version": "2.2.0" + "version": "2.4.0-rc.0" } diff --git a/package.json b/package.json index ae98ea82d..7174da64d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dao-dao-ui", - "version": "2.2.0", + "version": "2.4.0-rc.0", "workspaces": [ "apps/*", "packages/*" diff --git a/packages/config/package.json b/packages/config/package.json index abfbe9de2..1f8a9af1e 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/config", - "version": "2.2.0", + "version": "2.4.0-rc.0", "license": "BSD-3-Clause-Clear", "dependencies": { "@tailwindcss/typography": "^0.5.1", diff --git a/packages/email/package.json b/packages/email/package.json index 16e1c5beb..dcb410797 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/email", - "version": "2.2.0", + "version": "2.4.0-rc.0", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -10,8 +10,8 @@ }, "devDependencies": { "@aws-sdk/client-ses": "^3.354.0", - "@dao-dao/config": "2.2.0", - "@dao-dao/types": "2.2.0", + "@dao-dao/config": "2.4.0-rc.0", + "@dao-dao/types": "2.4.0-rc.0", "@react-email/components": "^0.0.7", "@react-email/render": "0.0.7", "commander": "^11.0.0", diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 1693398dc..99f3d7506 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/i18n", - "version": "2.2.0", + "version": "2.4.0-rc.0", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -17,7 +17,7 @@ "react-i18next": "^11.0.0" }, "devDependencies": { - "@dao-dao/config": "2.2.0", + "@dao-dao/config": "2.4.0-rc.0", "eslint-plugin-i18n-json": "^3.1.0", "i18n-unused": "^0.10.0" }, diff --git a/packages/state/package.json b/packages/state/package.json index dc1235e88..32d70a5ec 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/state", - "version": "2.2.0", + "version": "2.4.0-rc.0", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc && npm run build:gql", @@ -15,7 +15,7 @@ "@cosmjs/encoding": "^0.32.1", "@cosmjs/proto-signing": "^0.32.1", "@cosmjs/stargate": "^0.32.1", - "@dao-dao/utils": "2.2.0", + "@dao-dao/utils": "2.4.0-rc.0", "graphql": "^16.8.1", "json5": "^2.2.0", "lodash.uniq": "^4.5.0", @@ -25,8 +25,8 @@ }, "devDependencies": { "@cosmos-kit/core": "^2.8.9", - "@dao-dao/config": "2.2.0", - "@dao-dao/types": "2.2.0", + "@dao-dao/config": "2.4.0-rc.0", + "@dao-dao/types": "2.4.0-rc.0", "@graphql-codegen/cli": "^5.0.0", "@graphql-codegen/client-preset": "^4.1.0", "@graphql-typed-document-node/core": "^3.2.0", diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 7ef600eaf..3ecd0ff02 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateful", - "version": "2.2.0", + "version": "2.4.0-rc.0", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -38,10 +38,10 @@ "@cosmos-kit/vectis": "^2.6.9", "@cosmos-kit/web3auth": "^2.5.9", "@cosmos-kit/xdefi": "^2.5.9", - "@dao-dao/i18n": "2.2.0", - "@dao-dao/state": "2.2.0", - "@dao-dao/stateless": "2.2.0", - "@dao-dao/utils": "2.2.0", + "@dao-dao/i18n": "2.4.0-rc.0", + "@dao-dao/state": "2.4.0-rc.0", + "@dao-dao/stateless": "2.4.0-rc.0", + "@dao-dao/utils": "2.4.0-rc.0", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -75,8 +75,8 @@ "devDependencies": { "@chain-registry/types": "^0.17.1", "@cosmjs/amino": "^0.32.1", - "@dao-dao/config": "2.2.0", - "@dao-dao/types": "2.2.0", + "@dao-dao/config": "2.4.0-rc.0", + "@dao-dao/types": "2.4.0-rc.0", "@storybook/react": "^6.5.10", "@types/file-saver": "^2.0.5", "@types/lodash.clonedeep": "^4.5.0", @@ -96,7 +96,7 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/storybook": "2.2.0", + "@dao-dao/storybook": "2.4.0-rc.0", "next": "^12 || ^13", "react": "^17 || ^18" }, diff --git a/packages/stateless/package.json b/packages/stateless/package.json index e46cae46e..033aa5152 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateless", - "version": "2.2.0", + "version": "2.4.0-rc.0", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -9,8 +9,8 @@ }, "dependencies": { "@cosmjs/encoding": "^0.32.1", - "@dao-dao/types": "2.2.0", - "@dao-dao/utils": "2.2.0", + "@dao-dao/types": "2.4.0-rc.0", + "@dao-dao/utils": "2.4.0-rc.0", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -45,7 +45,7 @@ "devDependencies": { "@chain-registry/types": "^0.17.1", "@cosmos-kit/core": "^2.8.9", - "@dao-dao/config": "2.2.0", + "@dao-dao/config": "2.4.0-rc.0", "@storybook/react": "^6.5.10", "@types/lodash.clonedeep": "^4.5.0", "@types/react": "^17.0.37", @@ -68,8 +68,8 @@ "unist-util-visit-parents": "^5.1.3" }, "peerDependencies": { - "@dao-dao/stateful": "2.2.0", - "@dao-dao/storybook": "2.2.0", + "@dao-dao/stateful": "2.4.0-rc.0", + "@dao-dao/storybook": "2.4.0-rc.0", "next": "^12 || ^13", "react": "^17 || ^18", "react-dom": "^17 || ^18" diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 587a2a1de..1c53b8f92 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/storybook", - "version": "2.2.0", + "version": "2.4.0-rc.0", "license": "BSD-3-Clause-Clear", "scripts": { "build": "build-storybook", @@ -8,10 +8,10 @@ "generate": "ts-node --esm ./scripts/generate.ts" }, "devDependencies": { - "@dao-dao/config": "2.2.0", - "@dao-dao/i18n": "2.2.0", - "@dao-dao/types": "2.2.0", - "@dao-dao/utils": "2.2.0", + "@dao-dao/config": "2.4.0-rc.0", + "@dao-dao/i18n": "2.4.0-rc.0", + "@dao-dao/types": "2.4.0-rc.0", + "@dao-dao/utils": "2.4.0-rc.0", "@storybook/addon-actions": "^6.5.12", "@storybook/addon-essentials": "^6.5.12", "@storybook/addon-links": "^6.5.12", @@ -45,9 +45,9 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/state": "2.2.0", - "@dao-dao/stateful": "2.2.0", - "@dao-dao/stateless": "2.2.0" + "@dao-dao/state": "2.4.0-rc.0", + "@dao-dao/stateful": "2.4.0-rc.0", + "@dao-dao/stateless": "2.4.0-rc.0" }, "prettier": "@dao-dao/config/prettier" } diff --git a/packages/types/package.json b/packages/types/package.json index 7c0664c8d..3fa4a10d7 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/types", - "version": "2.2.0", + "version": "2.4.0-rc.0", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -11,7 +11,7 @@ "@chain-registry/types": "^0.17.1", "@cosmjs/cosmwasm-stargate": "^0.32.1", "@cosmos-kit/web3auth": "^2.5.9", - "@dao-dao/config": "2.2.0", + "@dao-dao/config": "2.4.0-rc.0", "next-i18next": "^11.0.0", "pusher-js": "^7.6.0", "react": "^18.2.0", diff --git a/packages/utils/package.json b/packages/utils/package.json index e00c1db0b..05792b87d 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/utils", - "version": "2.2.0", + "version": "2.4.0-rc.0", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -35,8 +35,8 @@ "@chain-registry/types": "^0.17.1", "@cosmjs/proto-signing": "^0.32.1", "@cosmology/telescope": "^1.4.12", - "@dao-dao/config": "2.2.0", - "@dao-dao/types": "2.2.0", + "@dao-dao/config": "2.4.0-rc.0", + "@dao-dao/types": "2.4.0-rc.0", "@types/lodash.clonedeep": "^4.5.0", "@types/ripemd160": "^2.0.0", "@types/semver": "^7.5.6", From f9de63bfa28e223acb5cc07bc7a412b8324248e0 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 12 Mar 2024 15:34:13 +0100 Subject: [PATCH 051/438] published --- packages/config/package.json | 3 ++- packages/email/package.json | 3 ++- packages/i18n/package.json | 3 ++- packages/state/package.json | 3 ++- packages/stateful/package.json | 3 ++- packages/stateless/package.json | 3 ++- packages/storybook/package.json | 3 ++- packages/types/package.json | 4 ++-- packages/utils/package.json | 3 ++- 9 files changed, 18 insertions(+), 10 deletions(-) diff --git a/packages/config/package.json b/packages/config/package.json index 1f8a9af1e..c21ee8f8f 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -24,5 +24,6 @@ "tailwindcss-safe-area": "^0.4.1", "typescript": "5.3.3" }, - "prettier": "./prettier/index.js" + "prettier": "./prettier/index.js", + "gitHead": "6e6067e622f478708ad30d2f331b8d81397f58b9" } diff --git a/packages/email/package.json b/packages/email/package.json index dcb410797..9254301af 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -24,5 +24,6 @@ "peerDependencies": { "react": "^17 || ^18" }, - "prettier": "@dao-dao/config/prettier" + "prettier": "@dao-dao/config/prettier", + "gitHead": "6e6067e622f478708ad30d2f331b8d81397f58b9" } diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 99f3d7506..37ddc325c 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -21,5 +21,6 @@ "eslint-plugin-i18n-json": "^3.1.0", "i18n-unused": "^0.10.0" }, - "prettier": "@dao-dao/config/prettier" + "prettier": "@dao-dao/config/prettier", + "gitHead": "6e6067e622f478708ad30d2f331b8d81397f58b9" } diff --git a/packages/state/package.json b/packages/state/package.json index 32d70a5ec..0835ee9a4 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -33,5 +33,6 @@ "@types/lodash.uniq": "^4.5.7", "typescript": "5.3.3" }, - "prettier": "@dao-dao/config/prettier" + "prettier": "@dao-dao/config/prettier", + "gitHead": "6e6067e622f478708ad30d2f331b8d81397f58b9" } diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 3ecd0ff02..c3b25a5bd 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -100,5 +100,6 @@ "next": "^12 || ^13", "react": "^17 || ^18" }, - "prettier": "@dao-dao/config/prettier" + "prettier": "@dao-dao/config/prettier", + "gitHead": "6e6067e622f478708ad30d2f331b8d81397f58b9" } diff --git a/packages/stateless/package.json b/packages/stateless/package.json index 033aa5152..a19821149 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -74,5 +74,6 @@ "react": "^17 || ^18", "react-dom": "^17 || ^18" }, - "prettier": "@dao-dao/config/prettier" + "prettier": "@dao-dao/config/prettier", + "gitHead": "6e6067e622f478708ad30d2f331b8d81397f58b9" } diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 1c53b8f92..2f9d037e5 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -49,5 +49,6 @@ "@dao-dao/stateful": "2.4.0-rc.0", "@dao-dao/stateless": "2.4.0-rc.0" }, - "prettier": "@dao-dao/config/prettier" + "prettier": "@dao-dao/config/prettier", + "gitHead": "6e6067e622f478708ad30d2f331b8d81397f58b9" } diff --git a/packages/types/package.json b/packages/types/package.json index 3fa4a10d7..798d26978 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -6,7 +6,6 @@ "format": "eslint . --fix", "lint": "eslint ." }, - "dependencies": {}, "devDependencies": { "@chain-registry/types": "^0.17.1", "@cosmjs/cosmwasm-stargate": "^0.32.1", @@ -24,5 +23,6 @@ "next": "^12 || ^13", "react": "^17 || ^18" }, - "prettier": "@dao-dao/config/prettier" + "prettier": "@dao-dao/config/prettier", + "gitHead": "6e6067e622f478708ad30d2f331b8d81397f58b9" } diff --git a/packages/utils/package.json b/packages/utils/package.json index 05792b87d..78fdcf96b 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -52,5 +52,6 @@ "next": "^12 || ^13", "react": "^17 || ^18" }, - "prettier": "@dao-dao/config/prettier" + "prettier": "@dao-dao/config/prettier", + "gitHead": "6e6067e622f478708ad30d2f331b8d81397f58b9" } From bd677d09eafd9675aadb3fb1d220e4737fe21a0f Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 12 Mar 2024 15:43:06 +0100 Subject: [PATCH 052/438] updated versions to 2.4.0-rc.1 for publish --- apps/dapp/package.json | 16 ++++++++-------- apps/sda/package.json | 16 ++++++++-------- lerna.json | 2 +- package.json | 2 +- packages/config/package.json | 2 +- packages/email/package.json | 8 ++++---- packages/i18n/package.json | 4 ++-- packages/state/package.json | 10 +++++----- packages/stateful/package.json | 18 +++++++++--------- packages/stateless/package.json | 14 +++++++------- packages/storybook/package.json | 18 +++++++++--------- packages/types/package.json | 4 ++-- packages/utils/package.json | 8 ++++---- 13 files changed, 61 insertions(+), 61 deletions(-) diff --git a/apps/dapp/package.json b/apps/dapp/package.json index f4ad0a70e..dccd75397 100644 --- a/apps/dapp/package.json +++ b/apps/dapp/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/dapp", - "version": "2.4.0-rc.0", + "version": "2.4.0-rc.1", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -19,12 +19,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.4.0-rc.0", - "@dao-dao/state": "2.4.0-rc.0", - "@dao-dao/stateful": "2.4.0-rc.0", - "@dao-dao/stateless": "2.4.0-rc.0", - "@dao-dao/types": "2.4.0-rc.0", - "@dao-dao/utils": "2.4.0-rc.0", + "@dao-dao/i18n": "2.4.0-rc.1", + "@dao-dao/state": "2.4.0-rc.1", + "@dao-dao/stateful": "2.4.0-rc.1", + "@dao-dao/stateless": "2.4.0-rc.1", + "@dao-dao/types": "2.4.0-rc.1", + "@dao-dao/utils": "2.4.0-rc.1", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -50,7 +50,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.0", + "@dao-dao/config": "2.4.0-rc.1", "@next/bundle-analyzer": "^14.1.0", "@sentry/cli": "^2.21.3", "@solana/web3.js": "^1.75.0", diff --git a/apps/sda/package.json b/apps/sda/package.json index 05add6b39..d9e2dbab5 100644 --- a/apps/sda/package.json +++ b/apps/sda/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/sda", - "version": "2.4.0-rc.0", + "version": "2.4.0-rc.1", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -17,12 +17,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.4.0-rc.0", - "@dao-dao/state": "2.4.0-rc.0", - "@dao-dao/stateful": "2.4.0-rc.0", - "@dao-dao/stateless": "2.4.0-rc.0", - "@dao-dao/types": "2.4.0-rc.0", - "@dao-dao/utils": "2.4.0-rc.0", + "@dao-dao/i18n": "2.4.0-rc.1", + "@dao-dao/state": "2.4.0-rc.1", + "@dao-dao/stateful": "2.4.0-rc.1", + "@dao-dao/stateless": "2.4.0-rc.1", + "@dao-dao/types": "2.4.0-rc.1", + "@dao-dao/utils": "2.4.0-rc.1", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -48,7 +48,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.0", + "@dao-dao/config": "2.4.0-rc.1", "@next/bundle-analyzer": "^12.1.0", "@sentry/cli": "^2.21.3", "@solana/web3.js": "^1.75.0", diff --git a/lerna.json b/lerna.json index 35342e80d..e45187042 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", "useWorkspaces": true, - "version": "2.4.0-rc.0" + "version": "2.4.0-rc.1" } diff --git a/package.json b/package.json index 7174da64d..9115b5d14 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dao-dao-ui", - "version": "2.4.0-rc.0", + "version": "2.4.0-rc.1", "workspaces": [ "apps/*", "packages/*" diff --git a/packages/config/package.json b/packages/config/package.json index c21ee8f8f..496033831 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/config", - "version": "2.4.0-rc.0", + "version": "2.4.0-rc.1", "license": "BSD-3-Clause-Clear", "dependencies": { "@tailwindcss/typography": "^0.5.1", diff --git a/packages/email/package.json b/packages/email/package.json index 9254301af..9645b501b 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/email", - "version": "2.4.0-rc.0", + "version": "2.4.0-rc.1", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -10,8 +10,8 @@ }, "devDependencies": { "@aws-sdk/client-ses": "^3.354.0", - "@dao-dao/config": "2.4.0-rc.0", - "@dao-dao/types": "2.4.0-rc.0", + "@dao-dao/config": "2.4.0-rc.1", + "@dao-dao/types": "2.4.0-rc.1", "@react-email/components": "^0.0.7", "@react-email/render": "0.0.7", "commander": "^11.0.0", @@ -25,5 +25,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "6e6067e622f478708ad30d2f331b8d81397f58b9" + "gitHead": "f9de63bfa28e223acb5cc07bc7a412b8324248e0" } diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 37ddc325c..648aba8d8 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/i18n", - "version": "2.4.0-rc.0", + "version": "2.4.0-rc.1", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -17,7 +17,7 @@ "react-i18next": "^11.0.0" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.0", + "@dao-dao/config": "2.4.0-rc.1", "eslint-plugin-i18n-json": "^3.1.0", "i18n-unused": "^0.10.0" }, diff --git a/packages/state/package.json b/packages/state/package.json index 0835ee9a4..f37fd20ce 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/state", - "version": "2.4.0-rc.0", + "version": "2.4.0-rc.1", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc && npm run build:gql", @@ -15,7 +15,7 @@ "@cosmjs/encoding": "^0.32.1", "@cosmjs/proto-signing": "^0.32.1", "@cosmjs/stargate": "^0.32.1", - "@dao-dao/utils": "2.4.0-rc.0", + "@dao-dao/utils": "2.4.0-rc.1", "graphql": "^16.8.1", "json5": "^2.2.0", "lodash.uniq": "^4.5.0", @@ -25,8 +25,8 @@ }, "devDependencies": { "@cosmos-kit/core": "^2.8.9", - "@dao-dao/config": "2.4.0-rc.0", - "@dao-dao/types": "2.4.0-rc.0", + "@dao-dao/config": "2.4.0-rc.1", + "@dao-dao/types": "2.4.0-rc.1", "@graphql-codegen/cli": "^5.0.0", "@graphql-codegen/client-preset": "^4.1.0", "@graphql-typed-document-node/core": "^3.2.0", @@ -34,5 +34,5 @@ "typescript": "5.3.3" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "6e6067e622f478708ad30d2f331b8d81397f58b9" + "gitHead": "f9de63bfa28e223acb5cc07bc7a412b8324248e0" } diff --git a/packages/stateful/package.json b/packages/stateful/package.json index c3b25a5bd..0747cdc59 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateful", - "version": "2.4.0-rc.0", + "version": "2.4.0-rc.1", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -38,10 +38,10 @@ "@cosmos-kit/vectis": "^2.6.9", "@cosmos-kit/web3auth": "^2.5.9", "@cosmos-kit/xdefi": "^2.5.9", - "@dao-dao/i18n": "2.4.0-rc.0", - "@dao-dao/state": "2.4.0-rc.0", - "@dao-dao/stateless": "2.4.0-rc.0", - "@dao-dao/utils": "2.4.0-rc.0", + "@dao-dao/i18n": "2.4.0-rc.1", + "@dao-dao/state": "2.4.0-rc.1", + "@dao-dao/stateless": "2.4.0-rc.1", + "@dao-dao/utils": "2.4.0-rc.1", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -75,8 +75,8 @@ "devDependencies": { "@chain-registry/types": "^0.17.1", "@cosmjs/amino": "^0.32.1", - "@dao-dao/config": "2.4.0-rc.0", - "@dao-dao/types": "2.4.0-rc.0", + "@dao-dao/config": "2.4.0-rc.1", + "@dao-dao/types": "2.4.0-rc.1", "@storybook/react": "^6.5.10", "@types/file-saver": "^2.0.5", "@types/lodash.clonedeep": "^4.5.0", @@ -96,10 +96,10 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/storybook": "2.4.0-rc.0", + "@dao-dao/storybook": "2.4.0-rc.1", "next": "^12 || ^13", "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "6e6067e622f478708ad30d2f331b8d81397f58b9" + "gitHead": "f9de63bfa28e223acb5cc07bc7a412b8324248e0" } diff --git a/packages/stateless/package.json b/packages/stateless/package.json index a19821149..677f56c2f 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateless", - "version": "2.4.0-rc.0", + "version": "2.4.0-rc.1", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -9,8 +9,8 @@ }, "dependencies": { "@cosmjs/encoding": "^0.32.1", - "@dao-dao/types": "2.4.0-rc.0", - "@dao-dao/utils": "2.4.0-rc.0", + "@dao-dao/types": "2.4.0-rc.1", + "@dao-dao/utils": "2.4.0-rc.1", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -45,7 +45,7 @@ "devDependencies": { "@chain-registry/types": "^0.17.1", "@cosmos-kit/core": "^2.8.9", - "@dao-dao/config": "2.4.0-rc.0", + "@dao-dao/config": "2.4.0-rc.1", "@storybook/react": "^6.5.10", "@types/lodash.clonedeep": "^4.5.0", "@types/react": "^17.0.37", @@ -68,12 +68,12 @@ "unist-util-visit-parents": "^5.1.3" }, "peerDependencies": { - "@dao-dao/stateful": "2.4.0-rc.0", - "@dao-dao/storybook": "2.4.0-rc.0", + "@dao-dao/stateful": "2.4.0-rc.1", + "@dao-dao/storybook": "2.4.0-rc.1", "next": "^12 || ^13", "react": "^17 || ^18", "react-dom": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "6e6067e622f478708ad30d2f331b8d81397f58b9" + "gitHead": "f9de63bfa28e223acb5cc07bc7a412b8324248e0" } diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 2f9d037e5..5dffc8a60 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/storybook", - "version": "2.4.0-rc.0", + "version": "2.4.0-rc.1", "license": "BSD-3-Clause-Clear", "scripts": { "build": "build-storybook", @@ -8,10 +8,10 @@ "generate": "ts-node --esm ./scripts/generate.ts" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.0", - "@dao-dao/i18n": "2.4.0-rc.0", - "@dao-dao/types": "2.4.0-rc.0", - "@dao-dao/utils": "2.4.0-rc.0", + "@dao-dao/config": "2.4.0-rc.1", + "@dao-dao/i18n": "2.4.0-rc.1", + "@dao-dao/types": "2.4.0-rc.1", + "@dao-dao/utils": "2.4.0-rc.1", "@storybook/addon-actions": "^6.5.12", "@storybook/addon-essentials": "^6.5.12", "@storybook/addon-links": "^6.5.12", @@ -45,10 +45,10 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/state": "2.4.0-rc.0", - "@dao-dao/stateful": "2.4.0-rc.0", - "@dao-dao/stateless": "2.4.0-rc.0" + "@dao-dao/state": "2.4.0-rc.1", + "@dao-dao/stateful": "2.4.0-rc.1", + "@dao-dao/stateless": "2.4.0-rc.1" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "6e6067e622f478708ad30d2f331b8d81397f58b9" + "gitHead": "f9de63bfa28e223acb5cc07bc7a412b8324248e0" } diff --git a/packages/types/package.json b/packages/types/package.json index 798d26978..0a768d1de 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/types", - "version": "2.4.0-rc.0", + "version": "2.4.0-rc.1", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -10,7 +10,7 @@ "@chain-registry/types": "^0.17.1", "@cosmjs/cosmwasm-stargate": "^0.32.1", "@cosmos-kit/web3auth": "^2.5.9", - "@dao-dao/config": "2.4.0-rc.0", + "@dao-dao/config": "2.4.0-rc.1", "next-i18next": "^11.0.0", "pusher-js": "^7.6.0", "react": "^18.2.0", diff --git a/packages/utils/package.json b/packages/utils/package.json index 78fdcf96b..6d6ced666 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/utils", - "version": "2.4.0-rc.0", + "version": "2.4.0-rc.1", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -35,8 +35,8 @@ "@chain-registry/types": "^0.17.1", "@cosmjs/proto-signing": "^0.32.1", "@cosmology/telescope": "^1.4.12", - "@dao-dao/config": "2.4.0-rc.0", - "@dao-dao/types": "2.4.0-rc.0", + "@dao-dao/config": "2.4.0-rc.1", + "@dao-dao/types": "2.4.0-rc.1", "@types/lodash.clonedeep": "^4.5.0", "@types/ripemd160": "^2.0.0", "@types/semver": "^7.5.6", @@ -53,5 +53,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "6e6067e622f478708ad30d2f331b8d81397f58b9" + "gitHead": "f9de63bfa28e223acb5cc07bc7a412b8324248e0" } From 254dfb8cd226f6f408aec4de08f88e9470806ef2 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 12 Mar 2024 15:44:07 +0100 Subject: [PATCH 053/438] published --- packages/config/package.json | 2 +- packages/email/package.json | 2 +- packages/i18n/package.json | 2 +- packages/state/package.json | 2 +- packages/stateful/package.json | 2 +- packages/stateless/package.json | 2 +- packages/storybook/package.json | 2 +- packages/types/package.json | 2 +- packages/utils/package.json | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/config/package.json b/packages/config/package.json index 496033831..30ba1b219 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -25,5 +25,5 @@ "typescript": "5.3.3" }, "prettier": "./prettier/index.js", - "gitHead": "6e6067e622f478708ad30d2f331b8d81397f58b9" + "gitHead": "bd677d09eafd9675aadb3fb1d220e4737fe21a0f" } diff --git a/packages/email/package.json b/packages/email/package.json index 9645b501b..dfffe5a83 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -25,5 +25,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "f9de63bfa28e223acb5cc07bc7a412b8324248e0" + "gitHead": "bd677d09eafd9675aadb3fb1d220e4737fe21a0f" } diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 648aba8d8..5fb43c535 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -22,5 +22,5 @@ "i18n-unused": "^0.10.0" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "6e6067e622f478708ad30d2f331b8d81397f58b9" + "gitHead": "bd677d09eafd9675aadb3fb1d220e4737fe21a0f" } diff --git a/packages/state/package.json b/packages/state/package.json index f37fd20ce..bb3fafd49 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -34,5 +34,5 @@ "typescript": "5.3.3" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "f9de63bfa28e223acb5cc07bc7a412b8324248e0" + "gitHead": "bd677d09eafd9675aadb3fb1d220e4737fe21a0f" } diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 0747cdc59..98fef51c8 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -101,5 +101,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "f9de63bfa28e223acb5cc07bc7a412b8324248e0" + "gitHead": "bd677d09eafd9675aadb3fb1d220e4737fe21a0f" } diff --git a/packages/stateless/package.json b/packages/stateless/package.json index 677f56c2f..44ceaa7e4 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -75,5 +75,5 @@ "react-dom": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "f9de63bfa28e223acb5cc07bc7a412b8324248e0" + "gitHead": "bd677d09eafd9675aadb3fb1d220e4737fe21a0f" } diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 5dffc8a60..e00b00b35 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -50,5 +50,5 @@ "@dao-dao/stateless": "2.4.0-rc.1" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "f9de63bfa28e223acb5cc07bc7a412b8324248e0" + "gitHead": "bd677d09eafd9675aadb3fb1d220e4737fe21a0f" } diff --git a/packages/types/package.json b/packages/types/package.json index 0a768d1de..5d056a31e 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -24,5 +24,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "6e6067e622f478708ad30d2f331b8d81397f58b9" + "gitHead": "bd677d09eafd9675aadb3fb1d220e4737fe21a0f" } diff --git a/packages/utils/package.json b/packages/utils/package.json index 6d6ced666..5765535a0 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -53,5 +53,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "f9de63bfa28e223acb5cc07bc7a412b8324248e0" + "gitHead": "bd677d09eafd9675aadb3fb1d220e4737fe21a0f" } From 8f3a8f6aefbb2779fdda1f59c37e8bfacc87428d Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 12 Mar 2024 16:06:01 +0100 Subject: [PATCH 054/438] 2.4.0-rc.3 --- apps/dapp/package.json | 16 +- apps/sda/package.json | 16 +- lerna.json | 2 +- package.json | 2 +- packages/config/package.json | 2 +- packages/email/package.json | 6 +- packages/i18n/package.json | 4 +- packages/state/package.json | 8 +- packages/stateful/package.json | 16 +- packages/stateless/package.json | 12 +- packages/storybook/package.json | 16 +- packages/types/package.json | 6 +- packages/utils/package.json | 21 ++- yarn.lock | 325 +++++++++++++++++++++++++++++++- 14 files changed, 391 insertions(+), 61 deletions(-) diff --git a/apps/dapp/package.json b/apps/dapp/package.json index dccd75397..1dab773a3 100644 --- a/apps/dapp/package.json +++ b/apps/dapp/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/dapp", - "version": "2.4.0-rc.1", + "version": "2.4.0-rc.3", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -19,12 +19,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.4.0-rc.1", - "@dao-dao/state": "2.4.0-rc.1", - "@dao-dao/stateful": "2.4.0-rc.1", - "@dao-dao/stateless": "2.4.0-rc.1", - "@dao-dao/types": "2.4.0-rc.1", - "@dao-dao/utils": "2.4.0-rc.1", + "@dao-dao/i18n": "2.4.0-rc.3", + "@dao-dao/state": "2.4.0-rc.3", + "@dao-dao/stateful": "2.4.0-rc.3", + "@dao-dao/stateless": "2.4.0-rc.3", + "@dao-dao/types": "2.4.0-rc.3", + "@dao-dao/utils": "2.4.0-rc.3", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -50,7 +50,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.1", + "@dao-dao/config": "2.4.0-rc.3", "@next/bundle-analyzer": "^14.1.0", "@sentry/cli": "^2.21.3", "@solana/web3.js": "^1.75.0", diff --git a/apps/sda/package.json b/apps/sda/package.json index d9e2dbab5..eca5ff93a 100644 --- a/apps/sda/package.json +++ b/apps/sda/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/sda", - "version": "2.4.0-rc.1", + "version": "2.4.0-rc.3", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -17,12 +17,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.4.0-rc.1", - "@dao-dao/state": "2.4.0-rc.1", - "@dao-dao/stateful": "2.4.0-rc.1", - "@dao-dao/stateless": "2.4.0-rc.1", - "@dao-dao/types": "2.4.0-rc.1", - "@dao-dao/utils": "2.4.0-rc.1", + "@dao-dao/i18n": "2.4.0-rc.3", + "@dao-dao/state": "2.4.0-rc.3", + "@dao-dao/stateful": "2.4.0-rc.3", + "@dao-dao/stateless": "2.4.0-rc.3", + "@dao-dao/types": "2.4.0-rc.3", + "@dao-dao/utils": "2.4.0-rc.3", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -48,7 +48,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.1", + "@dao-dao/config": "2.4.0-rc.3", "@next/bundle-analyzer": "^12.1.0", "@sentry/cli": "^2.21.3", "@solana/web3.js": "^1.75.0", diff --git a/lerna.json b/lerna.json index e45187042..48b132931 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", "useWorkspaces": true, - "version": "2.4.0-rc.1" + "version": "2.4.0-rc.3" } diff --git a/package.json b/package.json index 9115b5d14..91d0bb3a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dao-dao-ui", - "version": "2.4.0-rc.1", + "version": "2.4.0-rc.3", "workspaces": [ "apps/*", "packages/*" diff --git a/packages/config/package.json b/packages/config/package.json index 30ba1b219..7921f35ba 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/config", - "version": "2.4.0-rc.1", + "version": "2.4.0-rc.3", "license": "BSD-3-Clause-Clear", "dependencies": { "@tailwindcss/typography": "^0.5.1", diff --git a/packages/email/package.json b/packages/email/package.json index dfffe5a83..9a47ad95d 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/email", - "version": "2.4.0-rc.1", + "version": "2.4.0-rc.3", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -10,8 +10,8 @@ }, "devDependencies": { "@aws-sdk/client-ses": "^3.354.0", - "@dao-dao/config": "2.4.0-rc.1", - "@dao-dao/types": "2.4.0-rc.1", + "@dao-dao/config": "2.4.0-rc.3", + "@dao-dao/types": "2.4.0-rc.3", "@react-email/components": "^0.0.7", "@react-email/render": "0.0.7", "commander": "^11.0.0", diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 5fb43c535..06a1b3392 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/i18n", - "version": "2.4.0-rc.1", + "version": "2.4.0-rc.3", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -17,7 +17,7 @@ "react-i18next": "^11.0.0" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.1", + "@dao-dao/config": "2.4.0-rc.3", "eslint-plugin-i18n-json": "^3.1.0", "i18n-unused": "^0.10.0" }, diff --git a/packages/state/package.json b/packages/state/package.json index bb3fafd49..4a527cdf1 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/state", - "version": "2.4.0-rc.1", + "version": "2.4.0-rc.3", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc && npm run build:gql", @@ -15,7 +15,7 @@ "@cosmjs/encoding": "^0.32.1", "@cosmjs/proto-signing": "^0.32.1", "@cosmjs/stargate": "^0.32.1", - "@dao-dao/utils": "2.4.0-rc.1", + "@dao-dao/utils": "2.4.0-rc.3", "graphql": "^16.8.1", "json5": "^2.2.0", "lodash.uniq": "^4.5.0", @@ -25,8 +25,8 @@ }, "devDependencies": { "@cosmos-kit/core": "^2.8.9", - "@dao-dao/config": "2.4.0-rc.1", - "@dao-dao/types": "2.4.0-rc.1", + "@dao-dao/config": "2.4.0-rc.3", + "@dao-dao/types": "2.4.0-rc.3", "@graphql-codegen/cli": "^5.0.0", "@graphql-codegen/client-preset": "^4.1.0", "@graphql-typed-document-node/core": "^3.2.0", diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 98fef51c8..e972cd687 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateful", - "version": "2.4.0-rc.1", + "version": "2.4.0-rc.3", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -38,10 +38,10 @@ "@cosmos-kit/vectis": "^2.6.9", "@cosmos-kit/web3auth": "^2.5.9", "@cosmos-kit/xdefi": "^2.5.9", - "@dao-dao/i18n": "2.4.0-rc.1", - "@dao-dao/state": "2.4.0-rc.1", - "@dao-dao/stateless": "2.4.0-rc.1", - "@dao-dao/utils": "2.4.0-rc.1", + "@dao-dao/i18n": "2.4.0-rc.3", + "@dao-dao/state": "2.4.0-rc.3", + "@dao-dao/stateless": "2.4.0-rc.3", + "@dao-dao/utils": "2.4.0-rc.3", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -75,8 +75,8 @@ "devDependencies": { "@chain-registry/types": "^0.17.1", "@cosmjs/amino": "^0.32.1", - "@dao-dao/config": "2.4.0-rc.1", - "@dao-dao/types": "2.4.0-rc.1", + "@dao-dao/config": "2.4.0-rc.3", + "@dao-dao/types": "2.4.0-rc.3", "@storybook/react": "^6.5.10", "@types/file-saver": "^2.0.5", "@types/lodash.clonedeep": "^4.5.0", @@ -96,7 +96,7 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/storybook": "2.4.0-rc.1", + "@dao-dao/storybook": "2.4.0-rc.3", "next": "^12 || ^13", "react": "^17 || ^18" }, diff --git a/packages/stateless/package.json b/packages/stateless/package.json index 44ceaa7e4..9ceff729b 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateless", - "version": "2.4.0-rc.1", + "version": "2.4.0-rc.3", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -9,8 +9,8 @@ }, "dependencies": { "@cosmjs/encoding": "^0.32.1", - "@dao-dao/types": "2.4.0-rc.1", - "@dao-dao/utils": "2.4.0-rc.1", + "@dao-dao/types": "2.4.0-rc.3", + "@dao-dao/utils": "2.4.0-rc.3", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -45,7 +45,7 @@ "devDependencies": { "@chain-registry/types": "^0.17.1", "@cosmos-kit/core": "^2.8.9", - "@dao-dao/config": "2.4.0-rc.1", + "@dao-dao/config": "2.4.0-rc.3", "@storybook/react": "^6.5.10", "@types/lodash.clonedeep": "^4.5.0", "@types/react": "^17.0.37", @@ -68,8 +68,8 @@ "unist-util-visit-parents": "^5.1.3" }, "peerDependencies": { - "@dao-dao/stateful": "2.4.0-rc.1", - "@dao-dao/storybook": "2.4.0-rc.1", + "@dao-dao/stateful": "2.4.0-rc.3", + "@dao-dao/storybook": "2.4.0-rc.3", "next": "^12 || ^13", "react": "^17 || ^18", "react-dom": "^17 || ^18" diff --git a/packages/storybook/package.json b/packages/storybook/package.json index e00b00b35..14c603fed 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/storybook", - "version": "2.4.0-rc.1", + "version": "2.4.0-rc.3", "license": "BSD-3-Clause-Clear", "scripts": { "build": "build-storybook", @@ -8,10 +8,10 @@ "generate": "ts-node --esm ./scripts/generate.ts" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.1", - "@dao-dao/i18n": "2.4.0-rc.1", - "@dao-dao/types": "2.4.0-rc.1", - "@dao-dao/utils": "2.4.0-rc.1", + "@dao-dao/config": "2.4.0-rc.3", + "@dao-dao/i18n": "2.4.0-rc.3", + "@dao-dao/types": "2.4.0-rc.3", + "@dao-dao/utils": "2.4.0-rc.3", "@storybook/addon-actions": "^6.5.12", "@storybook/addon-essentials": "^6.5.12", "@storybook/addon-links": "^6.5.12", @@ -45,9 +45,9 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/state": "2.4.0-rc.1", - "@dao-dao/stateful": "2.4.0-rc.1", - "@dao-dao/stateless": "2.4.0-rc.1" + "@dao-dao/state": "2.4.0-rc.3", + "@dao-dao/stateful": "2.4.0-rc.3", + "@dao-dao/stateless": "2.4.0-rc.3" }, "prettier": "@dao-dao/config/prettier", "gitHead": "bd677d09eafd9675aadb3fb1d220e4737fe21a0f" diff --git a/packages/types/package.json b/packages/types/package.json index 5d056a31e..2963bced7 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,16 +1,16 @@ { "name": "@dao-dao/types", - "version": "2.4.0-rc.1", + "version": "2.4.0-rc.3", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", "lint": "eslint ." }, - "devDependencies": { + "dependencies": { "@chain-registry/types": "^0.17.1", "@cosmjs/cosmwasm-stargate": "^0.32.1", "@cosmos-kit/web3auth": "^2.5.9", - "@dao-dao/config": "2.4.0-rc.1", + "@dao-dao/config": "2.4.0-rc.3", "next-i18next": "^11.0.0", "pusher-js": "^7.6.0", "react": "^18.2.0", diff --git a/packages/utils/package.json b/packages/utils/package.json index 5765535a0..780b49ed0 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,7 +1,8 @@ { "name": "@dao-dao/utils", - "version": "2.4.0-rc.1", + "version": "2.4.0-rc.3", "license": "BSD-3-Clause-Clear", + "main": "dist/index.js", "scripts": { "format": "eslint . --fix", "lint": "eslint .", @@ -9,7 +10,8 @@ "protobuf:codegen": "node protobuf/scripts/codegen.js", "protobuf:patch": "git apply protobuf/patches.diff", "protobuf:patch:update": "cd protobuf && npm run protobuf:codegen && git diff -R codegen/ > patches.diff && npm run protobuf:patch", - "protobuf": "npm run protobuf:codegen && npm run protobuf:patch" + "protobuf": "npm run protobuf:codegen && npm run protobuf:patch", + "build": "tsup --dts" }, "dependencies": { "@cosmjs/amino": "^0.32.1", @@ -17,7 +19,9 @@ "@cosmjs/encoding": "^0.32.1", "@cosmjs/stargate": "^0.32.1", "@cosmjs/tendermint-rpc": "^0.32.1", + "@dao-dao/types": "2.4.0-rc.3", "@sentry/nextjs": "^7.7.0", + "@types/semver": "^7.5.6", "ajv": "^8.11.0", "chain-registry": "^1.28.6", "json5": "^2.2.0", @@ -27,6 +31,7 @@ "query-string": "^7.1.3", "react-hot-toast": "^2.1.1", "react-i18next": "^11.0.0", + "recoil": "^0.7.2", "ripemd160": "^2.0.2", "semver": "^7.5.4", "uuid": "^9.0.0" @@ -35,17 +40,15 @@ "@chain-registry/types": "^0.17.1", "@cosmjs/proto-signing": "^0.32.1", "@cosmology/telescope": "^1.4.12", - "@dao-dao/config": "2.4.0-rc.1", - "@dao-dao/types": "2.4.0-rc.1", + "@dao-dao/config": "2.4.0-rc.3", "@types/lodash.clonedeep": "^4.5.0", "@types/ripemd160": "^2.0.0", - "@types/semver": "^7.5.6", "cosmjs-types": "^0.9.0", "jest": "^29.1.1", "next": "^13.3.0", "nft.storage": "^7.0.0", "react": "^18.2.0", - "recoil": "^0.7.2", + "tsup": "^8.0.2", "typescript": "5.3.3" }, "peerDependencies": { @@ -53,5 +56,11 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", + "tsup": { + "entry": ["index.ts"], + "splitting": false, + "sourcemap": true, + "clean": true + }, "gitHead": "bd677d09eafd9675aadb3fb1d220e4737fe21a0f" } diff --git a/yarn.lock b/yarn.lock index c2426f8fe..261f890e8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3016,6 +3016,121 @@ resolved "https://registry.yarnpkg.com/@endo/env-options/-/env-options-0.1.4.tgz#e516bc3864f00b154944e444fb8996a9a0c23a45" integrity sha512-Ol8ct0aW8VK1ZaqntnUJfrYT59P6Xn36XPbHzkqQhsYkpudKDn5ILYEwGmSO/Ff+XJjv/pReNI0lhOyyrDa9mg== +"@esbuild/aix-ppc64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz#d1bc06aedb6936b3b6d313bf809a5a40387d2b7f" + integrity sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA== + +"@esbuild/android-arm64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz#7ad65a36cfdb7e0d429c353e00f680d737c2aed4" + integrity sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA== + +"@esbuild/android-arm@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.19.12.tgz#b0c26536f37776162ca8bde25e42040c203f2824" + integrity sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w== + +"@esbuild/android-x64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.19.12.tgz#cb13e2211282012194d89bf3bfe7721273473b3d" + integrity sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew== + +"@esbuild/darwin-arm64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz#cbee41e988020d4b516e9d9e44dd29200996275e" + integrity sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g== + +"@esbuild/darwin-x64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz#e37d9633246d52aecf491ee916ece709f9d5f4cd" + integrity sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A== + +"@esbuild/freebsd-arm64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz#1ee4d8b682ed363b08af74d1ea2b2b4dbba76487" + integrity sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA== + +"@esbuild/freebsd-x64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz#37a693553d42ff77cd7126764b535fb6cc28a11c" + integrity sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg== + +"@esbuild/linux-arm64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz#be9b145985ec6c57470e0e051d887b09dddb2d4b" + integrity sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA== + +"@esbuild/linux-arm@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz#207ecd982a8db95f7b5279207d0ff2331acf5eef" + integrity sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w== + +"@esbuild/linux-ia32@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz#d0d86b5ca1562523dc284a6723293a52d5860601" + integrity sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA== + +"@esbuild/linux-loong64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz#9a37f87fec4b8408e682b528391fa22afd952299" + integrity sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA== + +"@esbuild/linux-mips64el@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz#4ddebd4e6eeba20b509d8e74c8e30d8ace0b89ec" + integrity sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w== + +"@esbuild/linux-ppc64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz#adb67dadb73656849f63cd522f5ecb351dd8dee8" + integrity sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg== + +"@esbuild/linux-riscv64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz#11bc0698bf0a2abf8727f1c7ace2112612c15adf" + integrity sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg== + +"@esbuild/linux-s390x@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz#e86fb8ffba7c5c92ba91fc3b27ed5a70196c3cc8" + integrity sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg== + +"@esbuild/linux-x64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz#5f37cfdc705aea687dfe5dfbec086a05acfe9c78" + integrity sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg== + +"@esbuild/netbsd-x64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz#29da566a75324e0d0dd7e47519ba2f7ef168657b" + integrity sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA== + +"@esbuild/openbsd-x64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz#306c0acbdb5a99c95be98bdd1d47c916e7dc3ff0" + integrity sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw== + +"@esbuild/sunos-x64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz#0933eaab9af8b9b2c930236f62aae3fc593faf30" + integrity sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA== + +"@esbuild/win32-arm64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz#773bdbaa1971b36db2f6560088639ccd1e6773ae" + integrity sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A== + +"@esbuild/win32-ia32@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz#000516cad06354cc84a73f0943a4aa690ef6fd67" + integrity sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ== + +"@esbuild/win32-x64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz#c57c8afbb4054a3ab8317591a0b7320360b444ae" + integrity sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA== + "@eslint-community/eslint-utils@^4.4.0": version "4.4.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" @@ -6371,6 +6486,71 @@ estree-walker "^2.0.2" picomatch "^2.3.1" +"@rollup/rollup-android-arm-eabi@4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.13.0.tgz#b98786c1304b4ff8db3a873180b778649b5dff2b" + integrity sha512-5ZYPOuaAqEH/W3gYsRkxQATBW3Ii1MfaT4EQstTnLKViLi2gLSQmlmtTpGucNP3sXEpOiI5tdGhjdE111ekyEg== + +"@rollup/rollup-android-arm64@4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.13.0.tgz#8833679af11172b1bf1ab7cb3bad84df4caf0c9e" + integrity sha512-BSbaCmn8ZadK3UAQdlauSvtaJjhlDEjS5hEVVIN3A4bbl3X+otyf/kOJV08bYiRxfejP3DXFzO2jz3G20107+Q== + +"@rollup/rollup-darwin-arm64@4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.13.0.tgz#ef02d73e0a95d406e0eb4fd61a53d5d17775659b" + integrity sha512-Ovf2evVaP6sW5Ut0GHyUSOqA6tVKfrTHddtmxGQc1CTQa1Cw3/KMCDEEICZBbyppcwnhMwcDce9ZRxdWRpVd6g== + +"@rollup/rollup-darwin-x64@4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.13.0.tgz#3ce5b9bcf92b3341a5c1c58a3e6bcce0ea9e7455" + integrity sha512-U+Jcxm89UTK592vZ2J9st9ajRv/hrwHdnvyuJpa5A2ngGSVHypigidkQJP+YiGL6JODiUeMzkqQzbCG3At81Gg== + +"@rollup/rollup-linux-arm-gnueabihf@4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.13.0.tgz#3d3d2c018bdd8e037c6bfedd52acfff1c97e4be4" + integrity sha512-8wZidaUJUTIR5T4vRS22VkSMOVooG0F4N+JSwQXWSRiC6yfEsFMLTYRFHvby5mFFuExHa/yAp9juSphQQJAijQ== + +"@rollup/rollup-linux-arm64-gnu@4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.13.0.tgz#5fc8cc978ff396eaa136d7bfe05b5b9138064143" + integrity sha512-Iu0Kno1vrD7zHQDxOmvweqLkAzjxEVqNhUIXBsZ8hu8Oak7/5VTPrxOEZXYC1nmrBVJp0ZcL2E7lSuuOVaE3+w== + +"@rollup/rollup-linux-arm64-musl@4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.13.0.tgz#f2ae7d7bed416ffa26d6b948ac5772b520700eef" + integrity sha512-C31QrW47llgVyrRjIwiOwsHFcaIwmkKi3PCroQY5aVq4H0A5v/vVVAtFsI1nfBngtoRpeREvZOkIhmRwUKkAdw== + +"@rollup/rollup-linux-riscv64-gnu@4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.13.0.tgz#303d57a328ee9a50c85385936f31cf62306d30b6" + integrity sha512-Oq90dtMHvthFOPMl7pt7KmxzX7E71AfyIhh+cPhLY9oko97Zf2C9tt/XJD4RgxhaGeAraAXDtqxvKE1y/j35lA== + +"@rollup/rollup-linux-x64-gnu@4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.13.0.tgz#f672f6508f090fc73f08ba40ff76c20b57424778" + integrity sha512-yUD/8wMffnTKuiIsl6xU+4IA8UNhQ/f1sAnQebmE/lyQ8abjsVyDkyRkWop0kdMhKMprpNIhPmYlCxgHrPoXoA== + +"@rollup/rollup-linux-x64-musl@4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.13.0.tgz#d2f34b1b157f3e7f13925bca3288192a66755a89" + integrity sha512-9RyNqoFNdF0vu/qqX63fKotBh43fJQeYC98hCaf89DYQpv+xu0D8QFSOS0biA7cGuqJFOc1bJ+m2rhhsKcw1hw== + +"@rollup/rollup-win32-arm64-msvc@4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.13.0.tgz#8ffecc980ae4d9899eb2f9c4ae471a8d58d2da6b" + integrity sha512-46ue8ymtm/5PUU6pCvjlic0z82qWkxv54GTJZgHrQUuZnVH+tvvSP0LsozIDsCBFO4VjJ13N68wqrKSeScUKdA== + +"@rollup/rollup-win32-ia32-msvc@4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.13.0.tgz#a7505884f415662e088365b9218b2b03a88fc6f2" + integrity sha512-P5/MqLdLSlqxbeuJ3YDeX37srC8mCflSyTrUsgbU1c/U9j6l2g2GiIdYaGD9QjdMQPMSgYm7hgg0551wHyIluw== + +"@rollup/rollup-win32-x64-msvc@4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.13.0.tgz#6abd79db7ff8d01a58865ba20a63cfd23d9e2a10" + integrity sha512-UKXUQNbO3DOhzLRwHSpa0HnhhCgNODvfoPWv2FCXme8N/ANFfhIPMGuOT+QuKd16+B5yxZ0HdpNlqPvTMS1qfw== + "@rushstack/eslint-patch@^1.1.3": version "1.1.4" resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.1.4.tgz#0c8b74c50f29ee44f423f7416829c0bf8bb5eb27" @@ -8107,7 +8287,7 @@ "@types/estree" "*" "@types/json-schema" "*" -"@types/estree@*", "@types/estree@^1.0.0": +"@types/estree@*", "@types/estree@1.0.5", "@types/estree@^1.0.0": version "1.0.5" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== @@ -10941,6 +11121,13 @@ builtins@^5.0.0: dependencies: semver "^7.0.0" +bundle-require@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/bundle-require/-/bundle-require-4.0.2.tgz#65fc74ff14eabbba36d26c9a6161bd78fff6b29e" + integrity sha512-jwzPOChofl67PSTW2SGubV9HBQAhhR2i6nskiOThauo9dzwDUgOWQScFVaJkjEfYX+UXiD+LEx8EblQMc2wIag== + dependencies: + load-tsconfig "^0.2.3" + busboy@1.6.0, busboy@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" @@ -10981,6 +11168,11 @@ c8@^7.6.0: yargs "^16.2.0" yargs-parser "^20.2.9" +cac@^6.7.12: + version "6.7.14" + resolved "https://registry.yarnpkg.com/cac/-/cac-6.7.14.tgz#804e1e6f506ee363cb0e3ccbb09cad5dd9870959" + integrity sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ== + cacache@^12.0.2: version "12.0.4" resolved "https://registry.yarnpkg.com/cacache/-/cacache-12.0.4.tgz#668bcbd105aeb5f1d92fe25570ec9525c8faa40c" @@ -11377,6 +11569,21 @@ chokidar@^3.4.1, chokidar@^3.4.2, chokidar@^3.5.3: optionalDependencies: fsevents "~2.3.2" +chokidar@^3.5.1: + version "3.6.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" + integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + chownr@^1.1.1: version "1.1.4" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" @@ -13263,6 +13470,35 @@ es6-weak-map@^2.0.3: es6-iterator "^2.0.3" es6-symbol "^3.1.1" +esbuild@^0.19.2: + version "0.19.12" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.19.12.tgz#dc82ee5dc79e82f5a5c3b4323a2a641827db3e04" + integrity sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg== + optionalDependencies: + "@esbuild/aix-ppc64" "0.19.12" + "@esbuild/android-arm" "0.19.12" + "@esbuild/android-arm64" "0.19.12" + "@esbuild/android-x64" "0.19.12" + "@esbuild/darwin-arm64" "0.19.12" + "@esbuild/darwin-x64" "0.19.12" + "@esbuild/freebsd-arm64" "0.19.12" + "@esbuild/freebsd-x64" "0.19.12" + "@esbuild/linux-arm" "0.19.12" + "@esbuild/linux-arm64" "0.19.12" + "@esbuild/linux-ia32" "0.19.12" + "@esbuild/linux-loong64" "0.19.12" + "@esbuild/linux-mips64el" "0.19.12" + "@esbuild/linux-ppc64" "0.19.12" + "@esbuild/linux-riscv64" "0.19.12" + "@esbuild/linux-s390x" "0.19.12" + "@esbuild/linux-x64" "0.19.12" + "@esbuild/netbsd-x64" "0.19.12" + "@esbuild/openbsd-x64" "0.19.12" + "@esbuild/sunos-x64" "0.19.12" + "@esbuild/win32-arm64" "0.19.12" + "@esbuild/win32-ia32" "0.19.12" + "@esbuild/win32-x64" "0.19.12" + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -17266,6 +17502,11 @@ jose@^5.0.0: resolved "https://registry.yarnpkg.com/jose/-/jose-5.1.1.tgz#d61b923baa6bdeb01040afae8295a084c4b9eb58" integrity sha512-bfB+lNxowY49LfrBO0ITUn93JbUhxUN8I11K6oI5hJu/G6PO6fEUddVLjqdD0cQ9SXIHWXuWh7eJYwZF7Z0N/g== +joycon@^3.0.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/joycon/-/joycon-3.1.1.tgz#bce8596d6ae808f8b68168f5fc69280996894f03" + integrity sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw== + js-beautify@^1.6.12: version "1.14.8" resolved "https://registry.yarnpkg.com/js-beautify/-/js-beautify-1.14.8.tgz#e0c570c15b5445b006de6d9a3e70fb62f9e408e9" @@ -17799,6 +18040,11 @@ load-script@^1.0.0: resolved "https://registry.yarnpkg.com/load-script/-/load-script-1.0.0.tgz#0491939e0bee5643ee494a7e3da3d2bac70c6ca4" integrity sha512-kPEjMFtZvwL9TaZo0uZ2ml+Ye9HUMmPwbYRJ324qF9tqMejwykJ5ggTyvzmrbBeapCAbk98BSbTeovHEEP1uCA== +load-tsconfig@^0.2.3: + version "0.2.5" + resolved "https://registry.yarnpkg.com/load-tsconfig/-/load-tsconfig-0.2.5.tgz#453b8cd8961bfb912dea77eb6c168fe8cca3d3a1" + integrity sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg== + loader-runner@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" @@ -22283,6 +22529,28 @@ rollup@2.78.0: optionalDependencies: fsevents "~2.3.2" +rollup@^4.0.2: + version "4.13.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.13.0.tgz#dd2ae144b4cdc2ea25420477f68d4937a721237a" + integrity sha512-3YegKemjoQnYKmsBlOHfMLVPPA5xLkQ8MHLLSw/fBrFaVkEayL51DilPpNNLq1exr98F2B1TzrV0FUlN3gWRPg== + dependencies: + "@types/estree" "1.0.5" + optionalDependencies: + "@rollup/rollup-android-arm-eabi" "4.13.0" + "@rollup/rollup-android-arm64" "4.13.0" + "@rollup/rollup-darwin-arm64" "4.13.0" + "@rollup/rollup-darwin-x64" "4.13.0" + "@rollup/rollup-linux-arm-gnueabihf" "4.13.0" + "@rollup/rollup-linux-arm64-gnu" "4.13.0" + "@rollup/rollup-linux-arm64-musl" "4.13.0" + "@rollup/rollup-linux-riscv64-gnu" "4.13.0" + "@rollup/rollup-linux-x64-gnu" "4.13.0" + "@rollup/rollup-linux-x64-musl" "4.13.0" + "@rollup/rollup-win32-arm64-msvc" "4.13.0" + "@rollup/rollup-win32-ia32-msvc" "4.13.0" + "@rollup/rollup-win32-x64-msvc" "4.13.0" + fsevents "~2.3.2" + rpc-websockets@^7.5.1: version "7.6.0" resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.6.0.tgz#d3f4c0dac108ca35566b0e31552c32e58928cd04" @@ -22976,6 +23244,13 @@ source-map@0.6.1, source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, sourc resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +source-map@0.8.0-beta.0: + version "0.8.0-beta.0" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.8.0-beta.0.tgz#d4c1bb42c3f7ee925f005927ba10709e0d1d1f11" + integrity sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA== + dependencies: + whatwg-url "^7.0.0" + source-map@^0.5.0, source-map@^0.5.6, source-map@^0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" @@ -23541,7 +23816,7 @@ stylis@^4.3.0: resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.3.0.tgz#abe305a669fc3d8777e10eefcfc73ad861c5588c" integrity sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ== -sucrase@^3.32.0: +sucrase@^3.20.3, sucrase@^3.32.0: version "3.35.0" resolved "https://registry.yarnpkg.com/sucrase/-/sucrase-3.35.0.tgz#57f17a3d7e19b36d8995f06679d121be914ae263" integrity sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA== @@ -24036,11 +24311,23 @@ totalist@^3.0.0: resolved "https://registry.yarnpkg.com/totalist/-/totalist-3.0.1.tgz#ba3a3d600c915b1a97872348f79c127475f6acf8" integrity sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ== +tr46@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" + integrity sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA== + dependencies: + punycode "^2.1.0" + tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== +tree-kill@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" + integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== + treeverse@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/treeverse/-/treeverse-2.0.0.tgz#036dcef04bc3fd79a9b79a68d4da03e882d8a9ca" @@ -24214,6 +24501,26 @@ tslib@~2.5.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.3.tgz#24944ba2d990940e6e982c4bea147aba80209913" integrity sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w== +tsup@^8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/tsup/-/tsup-8.0.2.tgz#c63192a08386515103e2c44ac5a23bdff75c5fa1" + integrity sha512-NY8xtQXdH7hDUAZwcQdY/Vzlw9johQsaqf7iwZ6g1DOUlFYQ5/AtVAjTvihhEyeRlGo4dLRVHtrRaL35M1daqQ== + dependencies: + bundle-require "^4.0.0" + cac "^6.7.12" + chokidar "^3.5.1" + debug "^4.3.1" + esbuild "^0.19.2" + execa "^5.0.0" + globby "^11.0.3" + joycon "^3.0.1" + postcss-load-config "^4.0.1" + resolve-from "^5.0.0" + rollup "^4.0.2" + source-map "0.8.0-beta.0" + sucrase "^3.20.3" + tree-kill "^1.2.2" + tsutils@^3.21.0: version "3.21.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" @@ -25172,6 +25479,11 @@ webidl-conversions@^3.0.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== +webidl-conversions@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" + integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== + webpack-bundle-analyzer@4.10.1: version "4.10.1" resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.10.1.tgz#84b7473b630a7b8c21c741f81d8fe4593208b454" @@ -25344,6 +25656,15 @@ whatwg-url@^5.0.0: tr46 "~0.0.3" webidl-conversions "^3.0.0" +whatwg-url@^7.0.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06" + integrity sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg== + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" From d75c30b539e503e7f45e110e8416c76cbf88454e Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 12 Mar 2024 16:07:40 +0100 Subject: [PATCH 055/438] published --- packages/config/package.json | 2 +- packages/email/package.json | 2 +- packages/i18n/package.json | 2 +- packages/state/package.json | 2 +- packages/stateful/package.json | 2 +- packages/stateless/package.json | 2 +- packages/storybook/package.json | 2 +- packages/types/package.json | 2 +- packages/utils/package.json | 6 ++++-- 9 files changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/config/package.json b/packages/config/package.json index 7921f35ba..4646a1b6a 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -25,5 +25,5 @@ "typescript": "5.3.3" }, "prettier": "./prettier/index.js", - "gitHead": "bd677d09eafd9675aadb3fb1d220e4737fe21a0f" + "gitHead": "8f3a8f6aefbb2779fdda1f59c37e8bfacc87428d" } diff --git a/packages/email/package.json b/packages/email/package.json index 9a47ad95d..33cb96ba1 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -25,5 +25,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "bd677d09eafd9675aadb3fb1d220e4737fe21a0f" + "gitHead": "8f3a8f6aefbb2779fdda1f59c37e8bfacc87428d" } diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 06a1b3392..527abdbc2 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -22,5 +22,5 @@ "i18n-unused": "^0.10.0" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "bd677d09eafd9675aadb3fb1d220e4737fe21a0f" + "gitHead": "8f3a8f6aefbb2779fdda1f59c37e8bfacc87428d" } diff --git a/packages/state/package.json b/packages/state/package.json index 4a527cdf1..c62e1eb83 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -34,5 +34,5 @@ "typescript": "5.3.3" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "bd677d09eafd9675aadb3fb1d220e4737fe21a0f" + "gitHead": "8f3a8f6aefbb2779fdda1f59c37e8bfacc87428d" } diff --git a/packages/stateful/package.json b/packages/stateful/package.json index e972cd687..940656d66 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -101,5 +101,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "bd677d09eafd9675aadb3fb1d220e4737fe21a0f" + "gitHead": "8f3a8f6aefbb2779fdda1f59c37e8bfacc87428d" } diff --git a/packages/stateless/package.json b/packages/stateless/package.json index 9ceff729b..4e8fd2506 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -75,5 +75,5 @@ "react-dom": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "bd677d09eafd9675aadb3fb1d220e4737fe21a0f" + "gitHead": "8f3a8f6aefbb2779fdda1f59c37e8bfacc87428d" } diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 14c603fed..7d0d95e34 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -50,5 +50,5 @@ "@dao-dao/stateless": "2.4.0-rc.3" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "bd677d09eafd9675aadb3fb1d220e4737fe21a0f" + "gitHead": "8f3a8f6aefbb2779fdda1f59c37e8bfacc87428d" } diff --git a/packages/types/package.json b/packages/types/package.json index 2963bced7..f86996c5a 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -24,5 +24,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "bd677d09eafd9675aadb3fb1d220e4737fe21a0f" + "gitHead": "8f3a8f6aefbb2779fdda1f59c37e8bfacc87428d" } diff --git a/packages/utils/package.json b/packages/utils/package.json index 780b49ed0..dfa4e3174 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -57,10 +57,12 @@ }, "prettier": "@dao-dao/config/prettier", "tsup": { - "entry": ["index.ts"], + "entry": [ + "index.ts" + ], "splitting": false, "sourcemap": true, "clean": true }, - "gitHead": "bd677d09eafd9675aadb3fb1d220e4737fe21a0f" + "gitHead": "8f3a8f6aefbb2779fdda1f59c37e8bfacc87428d" } From 22cbcfbf8def9fddfecac5f48f38abf06b8e6a44 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 12 Mar 2024 16:11:48 +0100 Subject: [PATCH 056/438] 2.4.0-rc.4 --- apps/dapp/package.json | 16 ++++++++-------- apps/sda/package.json | 16 ++++++++-------- lerna.json | 2 +- package.json | 2 +- packages/config/package.json | 2 +- packages/email/package.json | 6 +++--- packages/i18n/package.json | 4 ++-- packages/state/package.json | 8 ++++---- packages/stateful/package.json | 16 ++++++++-------- packages/stateless/package.json | 12 ++++++------ packages/storybook/package.json | 16 ++++++++-------- packages/types/package.json | 7 ++++--- packages/utils/package.json | 6 +++--- 13 files changed, 57 insertions(+), 56 deletions(-) diff --git a/apps/dapp/package.json b/apps/dapp/package.json index 1dab773a3..860c3f758 100644 --- a/apps/dapp/package.json +++ b/apps/dapp/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/dapp", - "version": "2.4.0-rc.3", + "version": "2.4.0-rc.4", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -19,12 +19,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.4.0-rc.3", - "@dao-dao/state": "2.4.0-rc.3", - "@dao-dao/stateful": "2.4.0-rc.3", - "@dao-dao/stateless": "2.4.0-rc.3", - "@dao-dao/types": "2.4.0-rc.3", - "@dao-dao/utils": "2.4.0-rc.3", + "@dao-dao/i18n": "2.4.0-rc.4", + "@dao-dao/state": "2.4.0-rc.4", + "@dao-dao/stateful": "2.4.0-rc.4", + "@dao-dao/stateless": "2.4.0-rc.4", + "@dao-dao/types": "2.4.0-rc.4", + "@dao-dao/utils": "2.4.0-rc.4", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -50,7 +50,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.3", + "@dao-dao/config": "2.4.0-rc.4", "@next/bundle-analyzer": "^14.1.0", "@sentry/cli": "^2.21.3", "@solana/web3.js": "^1.75.0", diff --git a/apps/sda/package.json b/apps/sda/package.json index eca5ff93a..536b8cd42 100644 --- a/apps/sda/package.json +++ b/apps/sda/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/sda", - "version": "2.4.0-rc.3", + "version": "2.4.0-rc.4", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -17,12 +17,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.4.0-rc.3", - "@dao-dao/state": "2.4.0-rc.3", - "@dao-dao/stateful": "2.4.0-rc.3", - "@dao-dao/stateless": "2.4.0-rc.3", - "@dao-dao/types": "2.4.0-rc.3", - "@dao-dao/utils": "2.4.0-rc.3", + "@dao-dao/i18n": "2.4.0-rc.4", + "@dao-dao/state": "2.4.0-rc.4", + "@dao-dao/stateful": "2.4.0-rc.4", + "@dao-dao/stateless": "2.4.0-rc.4", + "@dao-dao/types": "2.4.0-rc.4", + "@dao-dao/utils": "2.4.0-rc.4", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -48,7 +48,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.3", + "@dao-dao/config": "2.4.0-rc.4", "@next/bundle-analyzer": "^12.1.0", "@sentry/cli": "^2.21.3", "@solana/web3.js": "^1.75.0", diff --git a/lerna.json b/lerna.json index 48b132931..33fb2ab36 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", "useWorkspaces": true, - "version": "2.4.0-rc.3" + "version": "2.4.0-rc.4" } diff --git a/package.json b/package.json index 91d0bb3a3..6b71afa84 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dao-dao-ui", - "version": "2.4.0-rc.3", + "version": "2.4.0-rc.4", "workspaces": [ "apps/*", "packages/*" diff --git a/packages/config/package.json b/packages/config/package.json index 4646a1b6a..cfc322ef2 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/config", - "version": "2.4.0-rc.3", + "version": "2.4.0-rc.4", "license": "BSD-3-Clause-Clear", "dependencies": { "@tailwindcss/typography": "^0.5.1", diff --git a/packages/email/package.json b/packages/email/package.json index 33cb96ba1..4aa07da4a 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/email", - "version": "2.4.0-rc.3", + "version": "2.4.0-rc.4", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -10,8 +10,8 @@ }, "devDependencies": { "@aws-sdk/client-ses": "^3.354.0", - "@dao-dao/config": "2.4.0-rc.3", - "@dao-dao/types": "2.4.0-rc.3", + "@dao-dao/config": "2.4.0-rc.4", + "@dao-dao/types": "2.4.0-rc.4", "@react-email/components": "^0.0.7", "@react-email/render": "0.0.7", "commander": "^11.0.0", diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 527abdbc2..0b5d758fc 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/i18n", - "version": "2.4.0-rc.3", + "version": "2.4.0-rc.4", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -17,7 +17,7 @@ "react-i18next": "^11.0.0" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.3", + "@dao-dao/config": "2.4.0-rc.4", "eslint-plugin-i18n-json": "^3.1.0", "i18n-unused": "^0.10.0" }, diff --git a/packages/state/package.json b/packages/state/package.json index c62e1eb83..5d0ac1bf8 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/state", - "version": "2.4.0-rc.3", + "version": "2.4.0-rc.4", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc && npm run build:gql", @@ -15,7 +15,7 @@ "@cosmjs/encoding": "^0.32.1", "@cosmjs/proto-signing": "^0.32.1", "@cosmjs/stargate": "^0.32.1", - "@dao-dao/utils": "2.4.0-rc.3", + "@dao-dao/utils": "2.4.0-rc.4", "graphql": "^16.8.1", "json5": "^2.2.0", "lodash.uniq": "^4.5.0", @@ -25,8 +25,8 @@ }, "devDependencies": { "@cosmos-kit/core": "^2.8.9", - "@dao-dao/config": "2.4.0-rc.3", - "@dao-dao/types": "2.4.0-rc.3", + "@dao-dao/config": "2.4.0-rc.4", + "@dao-dao/types": "2.4.0-rc.4", "@graphql-codegen/cli": "^5.0.0", "@graphql-codegen/client-preset": "^4.1.0", "@graphql-typed-document-node/core": "^3.2.0", diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 940656d66..f35f9ecef 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateful", - "version": "2.4.0-rc.3", + "version": "2.4.0-rc.4", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -38,10 +38,10 @@ "@cosmos-kit/vectis": "^2.6.9", "@cosmos-kit/web3auth": "^2.5.9", "@cosmos-kit/xdefi": "^2.5.9", - "@dao-dao/i18n": "2.4.0-rc.3", - "@dao-dao/state": "2.4.0-rc.3", - "@dao-dao/stateless": "2.4.0-rc.3", - "@dao-dao/utils": "2.4.0-rc.3", + "@dao-dao/i18n": "2.4.0-rc.4", + "@dao-dao/state": "2.4.0-rc.4", + "@dao-dao/stateless": "2.4.0-rc.4", + "@dao-dao/utils": "2.4.0-rc.4", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -75,8 +75,8 @@ "devDependencies": { "@chain-registry/types": "^0.17.1", "@cosmjs/amino": "^0.32.1", - "@dao-dao/config": "2.4.0-rc.3", - "@dao-dao/types": "2.4.0-rc.3", + "@dao-dao/config": "2.4.0-rc.4", + "@dao-dao/types": "2.4.0-rc.4", "@storybook/react": "^6.5.10", "@types/file-saver": "^2.0.5", "@types/lodash.clonedeep": "^4.5.0", @@ -96,7 +96,7 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/storybook": "2.4.0-rc.3", + "@dao-dao/storybook": "2.4.0-rc.4", "next": "^12 || ^13", "react": "^17 || ^18" }, diff --git a/packages/stateless/package.json b/packages/stateless/package.json index 4e8fd2506..b439a9afb 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateless", - "version": "2.4.0-rc.3", + "version": "2.4.0-rc.4", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -9,8 +9,8 @@ }, "dependencies": { "@cosmjs/encoding": "^0.32.1", - "@dao-dao/types": "2.4.0-rc.3", - "@dao-dao/utils": "2.4.0-rc.3", + "@dao-dao/types": "2.4.0-rc.4", + "@dao-dao/utils": "2.4.0-rc.4", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -45,7 +45,7 @@ "devDependencies": { "@chain-registry/types": "^0.17.1", "@cosmos-kit/core": "^2.8.9", - "@dao-dao/config": "2.4.0-rc.3", + "@dao-dao/config": "2.4.0-rc.4", "@storybook/react": "^6.5.10", "@types/lodash.clonedeep": "^4.5.0", "@types/react": "^17.0.37", @@ -68,8 +68,8 @@ "unist-util-visit-parents": "^5.1.3" }, "peerDependencies": { - "@dao-dao/stateful": "2.4.0-rc.3", - "@dao-dao/storybook": "2.4.0-rc.3", + "@dao-dao/stateful": "2.4.0-rc.4", + "@dao-dao/storybook": "2.4.0-rc.4", "next": "^12 || ^13", "react": "^17 || ^18", "react-dom": "^17 || ^18" diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 7d0d95e34..8a66cd832 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/storybook", - "version": "2.4.0-rc.3", + "version": "2.4.0-rc.4", "license": "BSD-3-Clause-Clear", "scripts": { "build": "build-storybook", @@ -8,10 +8,10 @@ "generate": "ts-node --esm ./scripts/generate.ts" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.3", - "@dao-dao/i18n": "2.4.0-rc.3", - "@dao-dao/types": "2.4.0-rc.3", - "@dao-dao/utils": "2.4.0-rc.3", + "@dao-dao/config": "2.4.0-rc.4", + "@dao-dao/i18n": "2.4.0-rc.4", + "@dao-dao/types": "2.4.0-rc.4", + "@dao-dao/utils": "2.4.0-rc.4", "@storybook/addon-actions": "^6.5.12", "@storybook/addon-essentials": "^6.5.12", "@storybook/addon-links": "^6.5.12", @@ -45,9 +45,9 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/state": "2.4.0-rc.3", - "@dao-dao/stateful": "2.4.0-rc.3", - "@dao-dao/stateless": "2.4.0-rc.3" + "@dao-dao/state": "2.4.0-rc.4", + "@dao-dao/stateful": "2.4.0-rc.4", + "@dao-dao/stateless": "2.4.0-rc.4" }, "prettier": "@dao-dao/config/prettier", "gitHead": "8f3a8f6aefbb2779fdda1f59c37e8bfacc87428d" diff --git a/packages/types/package.json b/packages/types/package.json index f86996c5a..e4ffa3960 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/types", - "version": "2.4.0-rc.3", + "version": "2.4.0-rc.4", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -8,9 +8,7 @@ }, "dependencies": { "@chain-registry/types": "^0.17.1", - "@cosmjs/cosmwasm-stargate": "^0.32.1", "@cosmos-kit/web3auth": "^2.5.9", - "@dao-dao/config": "2.4.0-rc.3", "next-i18next": "^11.0.0", "pusher-js": "^7.6.0", "react": "^18.2.0", @@ -19,6 +17,9 @@ "recoil": "^0.7.2", "typescript": "5.3.3" }, + "devDependencies": { + "@dao-dao/config": "2.4.0-rc.4" + }, "peerDependencies": { "next": "^12 || ^13", "react": "^17 || ^18" diff --git a/packages/utils/package.json b/packages/utils/package.json index dfa4e3174..ab604bac5 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/utils", - "version": "2.4.0-rc.3", + "version": "2.4.0-rc.4", "license": "BSD-3-Clause-Clear", "main": "dist/index.js", "scripts": { @@ -19,7 +19,7 @@ "@cosmjs/encoding": "^0.32.1", "@cosmjs/stargate": "^0.32.1", "@cosmjs/tendermint-rpc": "^0.32.1", - "@dao-dao/types": "2.4.0-rc.3", + "@dao-dao/types": "2.4.0-rc.4", "@sentry/nextjs": "^7.7.0", "@types/semver": "^7.5.6", "ajv": "^8.11.0", @@ -40,7 +40,7 @@ "@chain-registry/types": "^0.17.1", "@cosmjs/proto-signing": "^0.32.1", "@cosmology/telescope": "^1.4.12", - "@dao-dao/config": "2.4.0-rc.3", + "@dao-dao/config": "2.4.0-rc.4", "@types/lodash.clonedeep": "^4.5.0", "@types/ripemd160": "^2.0.0", "cosmjs-types": "^0.9.0", From 22c0f894fe268440f851d51a5b6c3937215196dc Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 12 Mar 2024 16:12:10 +0100 Subject: [PATCH 057/438] published --- packages/config/package.json | 2 +- packages/email/package.json | 2 +- packages/i18n/package.json | 2 +- packages/state/package.json | 2 +- packages/stateful/package.json | 2 +- packages/stateless/package.json | 2 +- packages/storybook/package.json | 2 +- packages/types/package.json | 2 +- packages/utils/package.json | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/config/package.json b/packages/config/package.json index cfc322ef2..48afb3b93 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -25,5 +25,5 @@ "typescript": "5.3.3" }, "prettier": "./prettier/index.js", - "gitHead": "8f3a8f6aefbb2779fdda1f59c37e8bfacc87428d" + "gitHead": "22cbcfbf8def9fddfecac5f48f38abf06b8e6a44" } diff --git a/packages/email/package.json b/packages/email/package.json index 4aa07da4a..7e631a122 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -25,5 +25,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "8f3a8f6aefbb2779fdda1f59c37e8bfacc87428d" + "gitHead": "22cbcfbf8def9fddfecac5f48f38abf06b8e6a44" } diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 0b5d758fc..d30b5f077 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -22,5 +22,5 @@ "i18n-unused": "^0.10.0" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "8f3a8f6aefbb2779fdda1f59c37e8bfacc87428d" + "gitHead": "22cbcfbf8def9fddfecac5f48f38abf06b8e6a44" } diff --git a/packages/state/package.json b/packages/state/package.json index 5d0ac1bf8..649912ba1 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -34,5 +34,5 @@ "typescript": "5.3.3" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "8f3a8f6aefbb2779fdda1f59c37e8bfacc87428d" + "gitHead": "22cbcfbf8def9fddfecac5f48f38abf06b8e6a44" } diff --git a/packages/stateful/package.json b/packages/stateful/package.json index f35f9ecef..be2d6f8a3 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -101,5 +101,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "8f3a8f6aefbb2779fdda1f59c37e8bfacc87428d" + "gitHead": "22cbcfbf8def9fddfecac5f48f38abf06b8e6a44" } diff --git a/packages/stateless/package.json b/packages/stateless/package.json index b439a9afb..0835d387d 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -75,5 +75,5 @@ "react-dom": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "8f3a8f6aefbb2779fdda1f59c37e8bfacc87428d" + "gitHead": "22cbcfbf8def9fddfecac5f48f38abf06b8e6a44" } diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 8a66cd832..8fe73de27 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -50,5 +50,5 @@ "@dao-dao/stateless": "2.4.0-rc.4" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "8f3a8f6aefbb2779fdda1f59c37e8bfacc87428d" + "gitHead": "22cbcfbf8def9fddfecac5f48f38abf06b8e6a44" } diff --git a/packages/types/package.json b/packages/types/package.json index e4ffa3960..58bed7b8d 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -25,5 +25,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "8f3a8f6aefbb2779fdda1f59c37e8bfacc87428d" + "gitHead": "22cbcfbf8def9fddfecac5f48f38abf06b8e6a44" } diff --git a/packages/utils/package.json b/packages/utils/package.json index ab604bac5..8e1348b0a 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -64,5 +64,5 @@ "sourcemap": true, "clean": true }, - "gitHead": "8f3a8f6aefbb2779fdda1f59c37e8bfacc87428d" + "gitHead": "22cbcfbf8def9fddfecac5f48f38abf06b8e6a44" } From 87f56f4a7bd755824e207e3d4c495c2bc9271eef Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 12 Mar 2024 16:23:53 +0100 Subject: [PATCH 058/438] moved types to types package --- packages/state/recoil/selectors/chain.ts | 17 +------- .../recoil/selectors/contracts/CwVesting.ts | 42 +++---------------- packages/types/chain.ts | 16 +++++++ packages/types/vesting.ts | 35 ++++++++++++++++ packages/utils/vesting.test.ts | 6 +-- packages/utils/vesting.ts | 4 +- 6 files changed, 62 insertions(+), 58 deletions(-) diff --git a/packages/state/recoil/selectors/chain.ts b/packages/state/recoil/selectors/chain.ts index 66a1e7e47..29eb362cb 100644 --- a/packages/state/recoil/selectors/chain.ts +++ b/packages/state/recoil/selectors/chain.ts @@ -27,6 +27,7 @@ import { TokenType, UnbondingDelegation, Validator, + ValidatorSlash, WithChainId, } from '@dao-dao/types' import { @@ -1508,22 +1509,6 @@ export const walletHexPublicKeySelector = selectorFamily< }, }) -export type ValidatorSlash = { - registeredBlockHeight: string - registeredBlockTimeUnixMs: string - infractionBlockHeight: string - // Slash fraction applied to validator's undelegating and redelegating tokens. - slashFactor: string - amountSlashed: string - // Slash fraction applied to validator's current delegations. It may be less - // than `slashFactor`. - effectiveFraction: string - // Amount of tokens slashed from delegations. This should be `amountSlashed` - // minus the amount slashed from the validator's undelegating and redelegating - // tokens. - stakedTokensBurned: string -} - // TODO(indexer): Use TX events indexer for this instead. export const validatorSlashesSelector = selectorFamily< ValidatorSlash[], diff --git a/packages/state/recoil/selectors/contracts/CwVesting.ts b/packages/state/recoil/selectors/contracts/CwVesting.ts index 99c1d4ba8..d53f4356f 100644 --- a/packages/state/recoil/selectors/contracts/CwVesting.ts +++ b/packages/state/recoil/selectors/contracts/CwVesting.ts @@ -1,6 +1,11 @@ import { selectorFamily } from 'recoil' -import { Uint128, Uint64, WithChainId } from '@dao-dao/types' +import { + CwVestingStakeHistory, + Uint128, + Uint64, + WithChainId, +} from '@dao-dao/types' import { OwnershipForAddr, Vest } from '@dao-dao/types/contracts/CwVesting' import { @@ -170,41 +175,6 @@ export const stakeSelector = selectorFamily< //! Custom selectors -export type CwVestingStakeEvent = { - blockHeight: string - blockTimeUnixMs: string -} & ( - | { - type: 'delegate' - validator: string - amount: string - } - | { - type: 'undelegate' - validator: string - amount: string - } - | { - type: 'redelegate' - fromValidator: string - toValidator: string - amount: string - } -) - -export type CwVestingSlashRegistration = { - validator: string - // Nanoseconds. - time: string - amount: string - duringUnbonding: boolean -} - -export type CwVestingStakeHistory = { - stakeEvents: CwVestingStakeEvent[] - slashRegistrations: CwVestingSlashRegistration[] -} - // TODO(indexer): Use TX events indexer for this instead. export const stakeHistorySelector = selectorFamily< CwVestingStakeHistory | null, diff --git a/packages/types/chain.ts b/packages/types/chain.ts index a1687b63d..598721785 100644 --- a/packages/types/chain.ts +++ b/packages/types/chain.ts @@ -237,3 +237,19 @@ export type CreateCw1Whitelist = ( admins: string[], mutable?: boolean ) => Promise + +export type ValidatorSlash = { + registeredBlockHeight: string + registeredBlockTimeUnixMs: string + infractionBlockHeight: string + // Slash fraction applied to validator's undelegating and redelegating tokens. + slashFactor: string + amountSlashed: string + // Slash fraction applied to validator's current delegations. It may be less + // than `slashFactor`. + effectiveFraction: string + // Amount of tokens slashed from delegations. This should be `amountSlashed` + // minus the amount slashed from the validator's undelegating and redelegating + // tokens. + stakedTokensBurned: string +} diff --git a/packages/types/vesting.ts b/packages/types/vesting.ts index c4a9146d8..8708e9e9c 100644 --- a/packages/types/vesting.ts +++ b/packages/types/vesting.ts @@ -136,3 +136,38 @@ export type VestingStep = { // Total amount vested at this timestamp. amount: number } + +export type CwVestingStakeEvent = { + blockHeight: string + blockTimeUnixMs: string +} & ( + | { + type: 'delegate' + validator: string + amount: string + } + | { + type: 'undelegate' + validator: string + amount: string + } + | { + type: 'redelegate' + fromValidator: string + toValidator: string + amount: string + } +) + +export type CwVestingSlashRegistration = { + validator: string + // Nanoseconds. + time: string + amount: string + duringUnbonding: boolean +} + +export type CwVestingStakeHistory = { + stakeEvents: CwVestingStakeEvent[] + slashRegistrations: CwVestingSlashRegistration[] +} diff --git a/packages/utils/vesting.test.ts b/packages/utils/vesting.test.ts index 7c84f01e8..fc5c67e80 100644 --- a/packages/utils/vesting.test.ts +++ b/packages/utils/vesting.test.ts @@ -1,9 +1,9 @@ -import { ValidatorSlash } from '@dao-dao/state/recoil' import { CwVestingSlashRegistration, CwVestingStakeEvent, -} from '@dao-dao/state/recoil/selectors/contracts/CwVesting' -import { VestingValidatorSlash } from '@dao-dao/types' + ValidatorSlash, + VestingValidatorSlash, +} from '@dao-dao/types' import { getSlashedStakedUnstaking, diff --git a/packages/utils/vesting.ts b/packages/utils/vesting.ts index b98c4b1ca..50f4f58a0 100644 --- a/packages/utils/vesting.ts +++ b/packages/utils/vesting.ts @@ -1,9 +1,7 @@ -import { ValidatorSlash } from '@dao-dao/state/recoil' import { CwVestingStakeEvent, CwVestingStakeHistory, -} from '@dao-dao/state/recoil/selectors/contracts/CwVesting' -import { + ValidatorSlash, VestingValidatorSlash, VestingValidatorWithSlashes, } from '@dao-dao/types' From e88c8a0c97b9e800617620617814d2313346b7fc Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 12 Mar 2024 16:24:00 +0100 Subject: [PATCH 059/438] 2.4.0-rc.5 --- apps/dapp/package.json | 16 ++++++++-------- apps/sda/package.json | 16 ++++++++-------- lerna.json | 2 +- package.json | 2 +- packages/config/package.json | 2 +- packages/email/package.json | 6 +++--- packages/i18n/package.json | 4 ++-- packages/state/package.json | 8 ++++---- packages/stateful/package.json | 16 ++++++++-------- packages/stateless/package.json | 12 ++++++------ packages/storybook/package.json | 16 ++++++++-------- packages/types/package.json | 4 ++-- packages/utils/package.json | 10 ++++++---- 13 files changed, 58 insertions(+), 56 deletions(-) diff --git a/apps/dapp/package.json b/apps/dapp/package.json index 860c3f758..27d9225ec 100644 --- a/apps/dapp/package.json +++ b/apps/dapp/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/dapp", - "version": "2.4.0-rc.4", + "version": "2.4.0-rc.5", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -19,12 +19,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.4.0-rc.4", - "@dao-dao/state": "2.4.0-rc.4", - "@dao-dao/stateful": "2.4.0-rc.4", - "@dao-dao/stateless": "2.4.0-rc.4", - "@dao-dao/types": "2.4.0-rc.4", - "@dao-dao/utils": "2.4.0-rc.4", + "@dao-dao/i18n": "2.4.0-rc.5", + "@dao-dao/state": "2.4.0-rc.5", + "@dao-dao/stateful": "2.4.0-rc.5", + "@dao-dao/stateless": "2.4.0-rc.5", + "@dao-dao/types": "2.4.0-rc.5", + "@dao-dao/utils": "2.4.0-rc.5", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -50,7 +50,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.4", + "@dao-dao/config": "2.4.0-rc.5", "@next/bundle-analyzer": "^14.1.0", "@sentry/cli": "^2.21.3", "@solana/web3.js": "^1.75.0", diff --git a/apps/sda/package.json b/apps/sda/package.json index 536b8cd42..28478f1ce 100644 --- a/apps/sda/package.json +++ b/apps/sda/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/sda", - "version": "2.4.0-rc.4", + "version": "2.4.0-rc.5", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -17,12 +17,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.4.0-rc.4", - "@dao-dao/state": "2.4.0-rc.4", - "@dao-dao/stateful": "2.4.0-rc.4", - "@dao-dao/stateless": "2.4.0-rc.4", - "@dao-dao/types": "2.4.0-rc.4", - "@dao-dao/utils": "2.4.0-rc.4", + "@dao-dao/i18n": "2.4.0-rc.5", + "@dao-dao/state": "2.4.0-rc.5", + "@dao-dao/stateful": "2.4.0-rc.5", + "@dao-dao/stateless": "2.4.0-rc.5", + "@dao-dao/types": "2.4.0-rc.5", + "@dao-dao/utils": "2.4.0-rc.5", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -48,7 +48,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.4", + "@dao-dao/config": "2.4.0-rc.5", "@next/bundle-analyzer": "^12.1.0", "@sentry/cli": "^2.21.3", "@solana/web3.js": "^1.75.0", diff --git a/lerna.json b/lerna.json index 33fb2ab36..b5ab338f2 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", "useWorkspaces": true, - "version": "2.4.0-rc.4" + "version": "2.4.0-rc.5" } diff --git a/package.json b/package.json index 6b71afa84..1d8e428a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dao-dao-ui", - "version": "2.4.0-rc.4", + "version": "2.4.0-rc.5", "workspaces": [ "apps/*", "packages/*" diff --git a/packages/config/package.json b/packages/config/package.json index 48afb3b93..1dc839a1f 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/config", - "version": "2.4.0-rc.4", + "version": "2.4.0-rc.5", "license": "BSD-3-Clause-Clear", "dependencies": { "@tailwindcss/typography": "^0.5.1", diff --git a/packages/email/package.json b/packages/email/package.json index 7e631a122..e331152e5 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/email", - "version": "2.4.0-rc.4", + "version": "2.4.0-rc.5", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -10,8 +10,8 @@ }, "devDependencies": { "@aws-sdk/client-ses": "^3.354.0", - "@dao-dao/config": "2.4.0-rc.4", - "@dao-dao/types": "2.4.0-rc.4", + "@dao-dao/config": "2.4.0-rc.5", + "@dao-dao/types": "2.4.0-rc.5", "@react-email/components": "^0.0.7", "@react-email/render": "0.0.7", "commander": "^11.0.0", diff --git a/packages/i18n/package.json b/packages/i18n/package.json index d30b5f077..24061bfbe 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/i18n", - "version": "2.4.0-rc.4", + "version": "2.4.0-rc.5", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -17,7 +17,7 @@ "react-i18next": "^11.0.0" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.4", + "@dao-dao/config": "2.4.0-rc.5", "eslint-plugin-i18n-json": "^3.1.0", "i18n-unused": "^0.10.0" }, diff --git a/packages/state/package.json b/packages/state/package.json index 649912ba1..92791ca5b 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/state", - "version": "2.4.0-rc.4", + "version": "2.4.0-rc.5", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc && npm run build:gql", @@ -15,7 +15,7 @@ "@cosmjs/encoding": "^0.32.1", "@cosmjs/proto-signing": "^0.32.1", "@cosmjs/stargate": "^0.32.1", - "@dao-dao/utils": "2.4.0-rc.4", + "@dao-dao/utils": "2.4.0-rc.5", "graphql": "^16.8.1", "json5": "^2.2.0", "lodash.uniq": "^4.5.0", @@ -25,8 +25,8 @@ }, "devDependencies": { "@cosmos-kit/core": "^2.8.9", - "@dao-dao/config": "2.4.0-rc.4", - "@dao-dao/types": "2.4.0-rc.4", + "@dao-dao/config": "2.4.0-rc.5", + "@dao-dao/types": "2.4.0-rc.5", "@graphql-codegen/cli": "^5.0.0", "@graphql-codegen/client-preset": "^4.1.0", "@graphql-typed-document-node/core": "^3.2.0", diff --git a/packages/stateful/package.json b/packages/stateful/package.json index be2d6f8a3..9ae74c158 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateful", - "version": "2.4.0-rc.4", + "version": "2.4.0-rc.5", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -38,10 +38,10 @@ "@cosmos-kit/vectis": "^2.6.9", "@cosmos-kit/web3auth": "^2.5.9", "@cosmos-kit/xdefi": "^2.5.9", - "@dao-dao/i18n": "2.4.0-rc.4", - "@dao-dao/state": "2.4.0-rc.4", - "@dao-dao/stateless": "2.4.0-rc.4", - "@dao-dao/utils": "2.4.0-rc.4", + "@dao-dao/i18n": "2.4.0-rc.5", + "@dao-dao/state": "2.4.0-rc.5", + "@dao-dao/stateless": "2.4.0-rc.5", + "@dao-dao/utils": "2.4.0-rc.5", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -75,8 +75,8 @@ "devDependencies": { "@chain-registry/types": "^0.17.1", "@cosmjs/amino": "^0.32.1", - "@dao-dao/config": "2.4.0-rc.4", - "@dao-dao/types": "2.4.0-rc.4", + "@dao-dao/config": "2.4.0-rc.5", + "@dao-dao/types": "2.4.0-rc.5", "@storybook/react": "^6.5.10", "@types/file-saver": "^2.0.5", "@types/lodash.clonedeep": "^4.5.0", @@ -96,7 +96,7 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/storybook": "2.4.0-rc.4", + "@dao-dao/storybook": "2.4.0-rc.5", "next": "^12 || ^13", "react": "^17 || ^18" }, diff --git a/packages/stateless/package.json b/packages/stateless/package.json index 0835d387d..cfce38f86 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateless", - "version": "2.4.0-rc.4", + "version": "2.4.0-rc.5", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -9,8 +9,8 @@ }, "dependencies": { "@cosmjs/encoding": "^0.32.1", - "@dao-dao/types": "2.4.0-rc.4", - "@dao-dao/utils": "2.4.0-rc.4", + "@dao-dao/types": "2.4.0-rc.5", + "@dao-dao/utils": "2.4.0-rc.5", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -45,7 +45,7 @@ "devDependencies": { "@chain-registry/types": "^0.17.1", "@cosmos-kit/core": "^2.8.9", - "@dao-dao/config": "2.4.0-rc.4", + "@dao-dao/config": "2.4.0-rc.5", "@storybook/react": "^6.5.10", "@types/lodash.clonedeep": "^4.5.0", "@types/react": "^17.0.37", @@ -68,8 +68,8 @@ "unist-util-visit-parents": "^5.1.3" }, "peerDependencies": { - "@dao-dao/stateful": "2.4.0-rc.4", - "@dao-dao/storybook": "2.4.0-rc.4", + "@dao-dao/stateful": "2.4.0-rc.5", + "@dao-dao/storybook": "2.4.0-rc.5", "next": "^12 || ^13", "react": "^17 || ^18", "react-dom": "^17 || ^18" diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 8fe73de27..755e55bf6 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/storybook", - "version": "2.4.0-rc.4", + "version": "2.4.0-rc.5", "license": "BSD-3-Clause-Clear", "scripts": { "build": "build-storybook", @@ -8,10 +8,10 @@ "generate": "ts-node --esm ./scripts/generate.ts" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.4", - "@dao-dao/i18n": "2.4.0-rc.4", - "@dao-dao/types": "2.4.0-rc.4", - "@dao-dao/utils": "2.4.0-rc.4", + "@dao-dao/config": "2.4.0-rc.5", + "@dao-dao/i18n": "2.4.0-rc.5", + "@dao-dao/types": "2.4.0-rc.5", + "@dao-dao/utils": "2.4.0-rc.5", "@storybook/addon-actions": "^6.5.12", "@storybook/addon-essentials": "^6.5.12", "@storybook/addon-links": "^6.5.12", @@ -45,9 +45,9 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/state": "2.4.0-rc.4", - "@dao-dao/stateful": "2.4.0-rc.4", - "@dao-dao/stateless": "2.4.0-rc.4" + "@dao-dao/state": "2.4.0-rc.5", + "@dao-dao/stateful": "2.4.0-rc.5", + "@dao-dao/stateless": "2.4.0-rc.5" }, "prettier": "@dao-dao/config/prettier", "gitHead": "22cbcfbf8def9fddfecac5f48f38abf06b8e6a44" diff --git a/packages/types/package.json b/packages/types/package.json index 58bed7b8d..c96a8a7dd 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/types", - "version": "2.4.0-rc.4", + "version": "2.4.0-rc.5", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -18,7 +18,7 @@ "typescript": "5.3.3" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.4" + "@dao-dao/config": "2.4.0-rc.5" }, "peerDependencies": { "next": "^12 || ^13", diff --git a/packages/utils/package.json b/packages/utils/package.json index 8e1348b0a..053be5894 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,8 +1,10 @@ { "name": "@dao-dao/utils", - "version": "2.4.0-rc.4", + "version": "2.4.0-rc.5", "license": "BSD-3-Clause-Clear", - "main": "dist/index.js", + "files": [ + "dist" + ], "scripts": { "format": "eslint . --fix", "lint": "eslint .", @@ -19,7 +21,7 @@ "@cosmjs/encoding": "^0.32.1", "@cosmjs/stargate": "^0.32.1", "@cosmjs/tendermint-rpc": "^0.32.1", - "@dao-dao/types": "2.4.0-rc.4", + "@dao-dao/types": "2.4.0-rc.5", "@sentry/nextjs": "^7.7.0", "@types/semver": "^7.5.6", "ajv": "^8.11.0", @@ -40,7 +42,7 @@ "@chain-registry/types": "^0.17.1", "@cosmjs/proto-signing": "^0.32.1", "@cosmology/telescope": "^1.4.12", - "@dao-dao/config": "2.4.0-rc.4", + "@dao-dao/config": "2.4.0-rc.5", "@types/lodash.clonedeep": "^4.5.0", "@types/ripemd160": "^2.0.0", "cosmjs-types": "^0.9.0", From fac3ff4f0a0060d2c668225c12b283072726d28f Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 12 Mar 2024 16:27:03 +0100 Subject: [PATCH 060/438] published --- packages/config/package.json | 2 +- packages/email/package.json | 2 +- packages/i18n/package.json | 2 +- packages/state/package.json | 2 +- packages/stateful/package.json | 2 +- packages/stateless/package.json | 2 +- packages/storybook/package.json | 2 +- packages/types/package.json | 2 +- packages/utils/package.json | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/config/package.json b/packages/config/package.json index 1dc839a1f..b2e52d353 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -25,5 +25,5 @@ "typescript": "5.3.3" }, "prettier": "./prettier/index.js", - "gitHead": "22cbcfbf8def9fddfecac5f48f38abf06b8e6a44" + "gitHead": "e88c8a0c97b9e800617620617814d2313346b7fc" } diff --git a/packages/email/package.json b/packages/email/package.json index e331152e5..ad80918a8 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -25,5 +25,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "22cbcfbf8def9fddfecac5f48f38abf06b8e6a44" + "gitHead": "e88c8a0c97b9e800617620617814d2313346b7fc" } diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 24061bfbe..9e0fa902a 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -22,5 +22,5 @@ "i18n-unused": "^0.10.0" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "22cbcfbf8def9fddfecac5f48f38abf06b8e6a44" + "gitHead": "e88c8a0c97b9e800617620617814d2313346b7fc" } diff --git a/packages/state/package.json b/packages/state/package.json index 92791ca5b..49bcb09c1 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -34,5 +34,5 @@ "typescript": "5.3.3" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "22cbcfbf8def9fddfecac5f48f38abf06b8e6a44" + "gitHead": "e88c8a0c97b9e800617620617814d2313346b7fc" } diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 9ae74c158..0f37d8703 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -101,5 +101,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "22cbcfbf8def9fddfecac5f48f38abf06b8e6a44" + "gitHead": "e88c8a0c97b9e800617620617814d2313346b7fc" } diff --git a/packages/stateless/package.json b/packages/stateless/package.json index cfce38f86..07278180f 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -75,5 +75,5 @@ "react-dom": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "22cbcfbf8def9fddfecac5f48f38abf06b8e6a44" + "gitHead": "e88c8a0c97b9e800617620617814d2313346b7fc" } diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 755e55bf6..821bbe90e 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -50,5 +50,5 @@ "@dao-dao/stateless": "2.4.0-rc.5" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "22cbcfbf8def9fddfecac5f48f38abf06b8e6a44" + "gitHead": "e88c8a0c97b9e800617620617814d2313346b7fc" } diff --git a/packages/types/package.json b/packages/types/package.json index c96a8a7dd..80f8162d7 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -25,5 +25,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "22cbcfbf8def9fddfecac5f48f38abf06b8e6a44" + "gitHead": "e88c8a0c97b9e800617620617814d2313346b7fc" } diff --git a/packages/utils/package.json b/packages/utils/package.json index 053be5894..f47f03150 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -66,5 +66,5 @@ "sourcemap": true, "clean": true }, - "gitHead": "22cbcfbf8def9fddfecac5f48f38abf06b8e6a44" + "gitHead": "e88c8a0c97b9e800617620617814d2313346b7fc" } From 5fe79ba6ec467126321581d9a92d3389c96c8220 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 12 Mar 2024 16:32:21 +0100 Subject: [PATCH 061/438] 2.4.0-rc.6 --- apps/dapp/package.json | 16 ++++++++-------- apps/sda/package.json | 16 ++++++++-------- lerna.json | 2 +- package.json | 2 +- packages/config/package.json | 2 +- packages/email/package.json | 6 +++--- packages/i18n/package.json | 4 ++-- packages/state/package.json | 8 ++++---- packages/stateful/package.json | 16 ++++++++-------- packages/stateless/package.json | 12 ++++++------ packages/storybook/package.json | 16 ++++++++-------- packages/types/package.json | 4 ++-- packages/utils/package.json | 12 ++++-------- 13 files changed, 56 insertions(+), 60 deletions(-) diff --git a/apps/dapp/package.json b/apps/dapp/package.json index 27d9225ec..b4a23569d 100644 --- a/apps/dapp/package.json +++ b/apps/dapp/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/dapp", - "version": "2.4.0-rc.5", + "version": "2.4.0-rc.6", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -19,12 +19,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.4.0-rc.5", - "@dao-dao/state": "2.4.0-rc.5", - "@dao-dao/stateful": "2.4.0-rc.5", - "@dao-dao/stateless": "2.4.0-rc.5", - "@dao-dao/types": "2.4.0-rc.5", - "@dao-dao/utils": "2.4.0-rc.5", + "@dao-dao/i18n": "2.4.0-rc.6", + "@dao-dao/state": "2.4.0-rc.6", + "@dao-dao/stateful": "2.4.0-rc.6", + "@dao-dao/stateless": "2.4.0-rc.6", + "@dao-dao/types": "2.4.0-rc.6", + "@dao-dao/utils": "2.4.0-rc.6", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -50,7 +50,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.5", + "@dao-dao/config": "2.4.0-rc.6", "@next/bundle-analyzer": "^14.1.0", "@sentry/cli": "^2.21.3", "@solana/web3.js": "^1.75.0", diff --git a/apps/sda/package.json b/apps/sda/package.json index 28478f1ce..91e9ab2f7 100644 --- a/apps/sda/package.json +++ b/apps/sda/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/sda", - "version": "2.4.0-rc.5", + "version": "2.4.0-rc.6", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -17,12 +17,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.4.0-rc.5", - "@dao-dao/state": "2.4.0-rc.5", - "@dao-dao/stateful": "2.4.0-rc.5", - "@dao-dao/stateless": "2.4.0-rc.5", - "@dao-dao/types": "2.4.0-rc.5", - "@dao-dao/utils": "2.4.0-rc.5", + "@dao-dao/i18n": "2.4.0-rc.6", + "@dao-dao/state": "2.4.0-rc.6", + "@dao-dao/stateful": "2.4.0-rc.6", + "@dao-dao/stateless": "2.4.0-rc.6", + "@dao-dao/types": "2.4.0-rc.6", + "@dao-dao/utils": "2.4.0-rc.6", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -48,7 +48,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.5", + "@dao-dao/config": "2.4.0-rc.6", "@next/bundle-analyzer": "^12.1.0", "@sentry/cli": "^2.21.3", "@solana/web3.js": "^1.75.0", diff --git a/lerna.json b/lerna.json index b5ab338f2..79433881b 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", "useWorkspaces": true, - "version": "2.4.0-rc.5" + "version": "2.4.0-rc.6" } diff --git a/package.json b/package.json index 1d8e428a2..c035c219b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dao-dao-ui", - "version": "2.4.0-rc.5", + "version": "2.4.0-rc.6", "workspaces": [ "apps/*", "packages/*" diff --git a/packages/config/package.json b/packages/config/package.json index b2e52d353..372e74a86 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/config", - "version": "2.4.0-rc.5", + "version": "2.4.0-rc.6", "license": "BSD-3-Clause-Clear", "dependencies": { "@tailwindcss/typography": "^0.5.1", diff --git a/packages/email/package.json b/packages/email/package.json index ad80918a8..e1b931936 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/email", - "version": "2.4.0-rc.5", + "version": "2.4.0-rc.6", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -10,8 +10,8 @@ }, "devDependencies": { "@aws-sdk/client-ses": "^3.354.0", - "@dao-dao/config": "2.4.0-rc.5", - "@dao-dao/types": "2.4.0-rc.5", + "@dao-dao/config": "2.4.0-rc.6", + "@dao-dao/types": "2.4.0-rc.6", "@react-email/components": "^0.0.7", "@react-email/render": "0.0.7", "commander": "^11.0.0", diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 9e0fa902a..19ead8d53 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/i18n", - "version": "2.4.0-rc.5", + "version": "2.4.0-rc.6", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -17,7 +17,7 @@ "react-i18next": "^11.0.0" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.5", + "@dao-dao/config": "2.4.0-rc.6", "eslint-plugin-i18n-json": "^3.1.0", "i18n-unused": "^0.10.0" }, diff --git a/packages/state/package.json b/packages/state/package.json index 49bcb09c1..399b20be7 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/state", - "version": "2.4.0-rc.5", + "version": "2.4.0-rc.6", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc && npm run build:gql", @@ -15,7 +15,7 @@ "@cosmjs/encoding": "^0.32.1", "@cosmjs/proto-signing": "^0.32.1", "@cosmjs/stargate": "^0.32.1", - "@dao-dao/utils": "2.4.0-rc.5", + "@dao-dao/utils": "2.4.0-rc.6", "graphql": "^16.8.1", "json5": "^2.2.0", "lodash.uniq": "^4.5.0", @@ -25,8 +25,8 @@ }, "devDependencies": { "@cosmos-kit/core": "^2.8.9", - "@dao-dao/config": "2.4.0-rc.5", - "@dao-dao/types": "2.4.0-rc.5", + "@dao-dao/config": "2.4.0-rc.6", + "@dao-dao/types": "2.4.0-rc.6", "@graphql-codegen/cli": "^5.0.0", "@graphql-codegen/client-preset": "^4.1.0", "@graphql-typed-document-node/core": "^3.2.0", diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 0f37d8703..cb5894a5c 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateful", - "version": "2.4.0-rc.5", + "version": "2.4.0-rc.6", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -38,10 +38,10 @@ "@cosmos-kit/vectis": "^2.6.9", "@cosmos-kit/web3auth": "^2.5.9", "@cosmos-kit/xdefi": "^2.5.9", - "@dao-dao/i18n": "2.4.0-rc.5", - "@dao-dao/state": "2.4.0-rc.5", - "@dao-dao/stateless": "2.4.0-rc.5", - "@dao-dao/utils": "2.4.0-rc.5", + "@dao-dao/i18n": "2.4.0-rc.6", + "@dao-dao/state": "2.4.0-rc.6", + "@dao-dao/stateless": "2.4.0-rc.6", + "@dao-dao/utils": "2.4.0-rc.6", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -75,8 +75,8 @@ "devDependencies": { "@chain-registry/types": "^0.17.1", "@cosmjs/amino": "^0.32.1", - "@dao-dao/config": "2.4.0-rc.5", - "@dao-dao/types": "2.4.0-rc.5", + "@dao-dao/config": "2.4.0-rc.6", + "@dao-dao/types": "2.4.0-rc.6", "@storybook/react": "^6.5.10", "@types/file-saver": "^2.0.5", "@types/lodash.clonedeep": "^4.5.0", @@ -96,7 +96,7 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/storybook": "2.4.0-rc.5", + "@dao-dao/storybook": "2.4.0-rc.6", "next": "^12 || ^13", "react": "^17 || ^18" }, diff --git a/packages/stateless/package.json b/packages/stateless/package.json index 07278180f..b55477aa7 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateless", - "version": "2.4.0-rc.5", + "version": "2.4.0-rc.6", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -9,8 +9,8 @@ }, "dependencies": { "@cosmjs/encoding": "^0.32.1", - "@dao-dao/types": "2.4.0-rc.5", - "@dao-dao/utils": "2.4.0-rc.5", + "@dao-dao/types": "2.4.0-rc.6", + "@dao-dao/utils": "2.4.0-rc.6", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -45,7 +45,7 @@ "devDependencies": { "@chain-registry/types": "^0.17.1", "@cosmos-kit/core": "^2.8.9", - "@dao-dao/config": "2.4.0-rc.5", + "@dao-dao/config": "2.4.0-rc.6", "@storybook/react": "^6.5.10", "@types/lodash.clonedeep": "^4.5.0", "@types/react": "^17.0.37", @@ -68,8 +68,8 @@ "unist-util-visit-parents": "^5.1.3" }, "peerDependencies": { - "@dao-dao/stateful": "2.4.0-rc.5", - "@dao-dao/storybook": "2.4.0-rc.5", + "@dao-dao/stateful": "2.4.0-rc.6", + "@dao-dao/storybook": "2.4.0-rc.6", "next": "^12 || ^13", "react": "^17 || ^18", "react-dom": "^17 || ^18" diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 821bbe90e..8616630ab 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/storybook", - "version": "2.4.0-rc.5", + "version": "2.4.0-rc.6", "license": "BSD-3-Clause-Clear", "scripts": { "build": "build-storybook", @@ -8,10 +8,10 @@ "generate": "ts-node --esm ./scripts/generate.ts" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.5", - "@dao-dao/i18n": "2.4.0-rc.5", - "@dao-dao/types": "2.4.0-rc.5", - "@dao-dao/utils": "2.4.0-rc.5", + "@dao-dao/config": "2.4.0-rc.6", + "@dao-dao/i18n": "2.4.0-rc.6", + "@dao-dao/types": "2.4.0-rc.6", + "@dao-dao/utils": "2.4.0-rc.6", "@storybook/addon-actions": "^6.5.12", "@storybook/addon-essentials": "^6.5.12", "@storybook/addon-links": "^6.5.12", @@ -45,9 +45,9 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/state": "2.4.0-rc.5", - "@dao-dao/stateful": "2.4.0-rc.5", - "@dao-dao/stateless": "2.4.0-rc.5" + "@dao-dao/state": "2.4.0-rc.6", + "@dao-dao/stateful": "2.4.0-rc.6", + "@dao-dao/stateless": "2.4.0-rc.6" }, "prettier": "@dao-dao/config/prettier", "gitHead": "e88c8a0c97b9e800617620617814d2313346b7fc" diff --git a/packages/types/package.json b/packages/types/package.json index 80f8162d7..7d1412c95 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/types", - "version": "2.4.0-rc.5", + "version": "2.4.0-rc.6", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -18,7 +18,7 @@ "typescript": "5.3.3" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.5" + "@dao-dao/config": "2.4.0-rc.6" }, "peerDependencies": { "next": "^12 || ^13", diff --git a/packages/utils/package.json b/packages/utils/package.json index f47f03150..8c2d9a8cc 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,10 +1,7 @@ { "name": "@dao-dao/utils", - "version": "2.4.0-rc.5", + "version": "2.4.0-rc.6", "license": "BSD-3-Clause-Clear", - "files": [ - "dist" - ], "scripts": { "format": "eslint . --fix", "lint": "eslint .", @@ -12,8 +9,7 @@ "protobuf:codegen": "node protobuf/scripts/codegen.js", "protobuf:patch": "git apply protobuf/patches.diff", "protobuf:patch:update": "cd protobuf && npm run protobuf:codegen && git diff -R codegen/ > patches.diff && npm run protobuf:patch", - "protobuf": "npm run protobuf:codegen && npm run protobuf:patch", - "build": "tsup --dts" + "protobuf": "npm run protobuf:codegen && npm run protobuf:patch" }, "dependencies": { "@cosmjs/amino": "^0.32.1", @@ -21,7 +17,7 @@ "@cosmjs/encoding": "^0.32.1", "@cosmjs/stargate": "^0.32.1", "@cosmjs/tendermint-rpc": "^0.32.1", - "@dao-dao/types": "2.4.0-rc.5", + "@dao-dao/types": "2.4.0-rc.6", "@sentry/nextjs": "^7.7.0", "@types/semver": "^7.5.6", "ajv": "^8.11.0", @@ -42,7 +38,7 @@ "@chain-registry/types": "^0.17.1", "@cosmjs/proto-signing": "^0.32.1", "@cosmology/telescope": "^1.4.12", - "@dao-dao/config": "2.4.0-rc.5", + "@dao-dao/config": "2.4.0-rc.6", "@types/lodash.clonedeep": "^4.5.0", "@types/ripemd160": "^2.0.0", "cosmjs-types": "^0.9.0", From 0e2802580829eef2a36573427d323500a8185cdc Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 12 Mar 2024 16:33:49 +0100 Subject: [PATCH 062/438] published --- packages/config/package.json | 2 +- packages/email/package.json | 2 +- packages/i18n/package.json | 2 +- packages/state/package.json | 2 +- packages/stateful/package.json | 2 +- packages/stateless/package.json | 2 +- packages/storybook/package.json | 2 +- packages/types/package.json | 2 +- packages/utils/package.json | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/config/package.json b/packages/config/package.json index 372e74a86..236d9d777 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -25,5 +25,5 @@ "typescript": "5.3.3" }, "prettier": "./prettier/index.js", - "gitHead": "e88c8a0c97b9e800617620617814d2313346b7fc" + "gitHead": "5fe79ba6ec467126321581d9a92d3389c96c8220" } diff --git a/packages/email/package.json b/packages/email/package.json index e1b931936..c5f21ecbd 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -25,5 +25,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "e88c8a0c97b9e800617620617814d2313346b7fc" + "gitHead": "5fe79ba6ec467126321581d9a92d3389c96c8220" } diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 19ead8d53..82abbdcca 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -22,5 +22,5 @@ "i18n-unused": "^0.10.0" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "e88c8a0c97b9e800617620617814d2313346b7fc" + "gitHead": "5fe79ba6ec467126321581d9a92d3389c96c8220" } diff --git a/packages/state/package.json b/packages/state/package.json index 399b20be7..7e00d4b27 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -34,5 +34,5 @@ "typescript": "5.3.3" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "e88c8a0c97b9e800617620617814d2313346b7fc" + "gitHead": "5fe79ba6ec467126321581d9a92d3389c96c8220" } diff --git a/packages/stateful/package.json b/packages/stateful/package.json index cb5894a5c..b78048bca 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -101,5 +101,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "e88c8a0c97b9e800617620617814d2313346b7fc" + "gitHead": "5fe79ba6ec467126321581d9a92d3389c96c8220" } diff --git a/packages/stateless/package.json b/packages/stateless/package.json index b55477aa7..b8d207d82 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -75,5 +75,5 @@ "react-dom": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "e88c8a0c97b9e800617620617814d2313346b7fc" + "gitHead": "5fe79ba6ec467126321581d9a92d3389c96c8220" } diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 8616630ab..6c21fe806 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -50,5 +50,5 @@ "@dao-dao/stateless": "2.4.0-rc.6" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "e88c8a0c97b9e800617620617814d2313346b7fc" + "gitHead": "5fe79ba6ec467126321581d9a92d3389c96c8220" } diff --git a/packages/types/package.json b/packages/types/package.json index 7d1412c95..ad0a2db3a 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -25,5 +25,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "e88c8a0c97b9e800617620617814d2313346b7fc" + "gitHead": "5fe79ba6ec467126321581d9a92d3389c96c8220" } diff --git a/packages/utils/package.json b/packages/utils/package.json index 8c2d9a8cc..8a431d9d8 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -62,5 +62,5 @@ "sourcemap": true, "clean": true }, - "gitHead": "e88c8a0c97b9e800617620617814d2313346b7fc" + "gitHead": "5fe79ba6ec467126321581d9a92d3389c96c8220" } From 5b85f85ecee36798d50576ccb358e377268c5321 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 12 Mar 2024 16:35:29 +0100 Subject: [PATCH 063/438] removed tsup --- packages/utils/package.json | 9 - yarn.lock | 325 +----------------------------------- 2 files changed, 2 insertions(+), 332 deletions(-) diff --git a/packages/utils/package.json b/packages/utils/package.json index 8a431d9d8..5e24f7674 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -46,7 +46,6 @@ "next": "^13.3.0", "nft.storage": "^7.0.0", "react": "^18.2.0", - "tsup": "^8.0.2", "typescript": "5.3.3" }, "peerDependencies": { @@ -54,13 +53,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "tsup": { - "entry": [ - "index.ts" - ], - "splitting": false, - "sourcemap": true, - "clean": true - }, "gitHead": "5fe79ba6ec467126321581d9a92d3389c96c8220" } diff --git a/yarn.lock b/yarn.lock index 261f890e8..c2426f8fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3016,121 +3016,6 @@ resolved "https://registry.yarnpkg.com/@endo/env-options/-/env-options-0.1.4.tgz#e516bc3864f00b154944e444fb8996a9a0c23a45" integrity sha512-Ol8ct0aW8VK1ZaqntnUJfrYT59P6Xn36XPbHzkqQhsYkpudKDn5ILYEwGmSO/Ff+XJjv/pReNI0lhOyyrDa9mg== -"@esbuild/aix-ppc64@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz#d1bc06aedb6936b3b6d313bf809a5a40387d2b7f" - integrity sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA== - -"@esbuild/android-arm64@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz#7ad65a36cfdb7e0d429c353e00f680d737c2aed4" - integrity sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA== - -"@esbuild/android-arm@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.19.12.tgz#b0c26536f37776162ca8bde25e42040c203f2824" - integrity sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w== - -"@esbuild/android-x64@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.19.12.tgz#cb13e2211282012194d89bf3bfe7721273473b3d" - integrity sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew== - -"@esbuild/darwin-arm64@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz#cbee41e988020d4b516e9d9e44dd29200996275e" - integrity sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g== - -"@esbuild/darwin-x64@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz#e37d9633246d52aecf491ee916ece709f9d5f4cd" - integrity sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A== - -"@esbuild/freebsd-arm64@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz#1ee4d8b682ed363b08af74d1ea2b2b4dbba76487" - integrity sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA== - -"@esbuild/freebsd-x64@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz#37a693553d42ff77cd7126764b535fb6cc28a11c" - integrity sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg== - -"@esbuild/linux-arm64@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz#be9b145985ec6c57470e0e051d887b09dddb2d4b" - integrity sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA== - -"@esbuild/linux-arm@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz#207ecd982a8db95f7b5279207d0ff2331acf5eef" - integrity sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w== - -"@esbuild/linux-ia32@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz#d0d86b5ca1562523dc284a6723293a52d5860601" - integrity sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA== - -"@esbuild/linux-loong64@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz#9a37f87fec4b8408e682b528391fa22afd952299" - integrity sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA== - -"@esbuild/linux-mips64el@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz#4ddebd4e6eeba20b509d8e74c8e30d8ace0b89ec" - integrity sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w== - -"@esbuild/linux-ppc64@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz#adb67dadb73656849f63cd522f5ecb351dd8dee8" - integrity sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg== - -"@esbuild/linux-riscv64@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz#11bc0698bf0a2abf8727f1c7ace2112612c15adf" - integrity sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg== - -"@esbuild/linux-s390x@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz#e86fb8ffba7c5c92ba91fc3b27ed5a70196c3cc8" - integrity sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg== - -"@esbuild/linux-x64@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz#5f37cfdc705aea687dfe5dfbec086a05acfe9c78" - integrity sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg== - -"@esbuild/netbsd-x64@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz#29da566a75324e0d0dd7e47519ba2f7ef168657b" - integrity sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA== - -"@esbuild/openbsd-x64@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz#306c0acbdb5a99c95be98bdd1d47c916e7dc3ff0" - integrity sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw== - -"@esbuild/sunos-x64@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz#0933eaab9af8b9b2c930236f62aae3fc593faf30" - integrity sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA== - -"@esbuild/win32-arm64@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz#773bdbaa1971b36db2f6560088639ccd1e6773ae" - integrity sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A== - -"@esbuild/win32-ia32@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz#000516cad06354cc84a73f0943a4aa690ef6fd67" - integrity sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ== - -"@esbuild/win32-x64@0.19.12": - version "0.19.12" - resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz#c57c8afbb4054a3ab8317591a0b7320360b444ae" - integrity sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA== - "@eslint-community/eslint-utils@^4.4.0": version "4.4.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" @@ -6486,71 +6371,6 @@ estree-walker "^2.0.2" picomatch "^2.3.1" -"@rollup/rollup-android-arm-eabi@4.13.0": - version "4.13.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.13.0.tgz#b98786c1304b4ff8db3a873180b778649b5dff2b" - integrity sha512-5ZYPOuaAqEH/W3gYsRkxQATBW3Ii1MfaT4EQstTnLKViLi2gLSQmlmtTpGucNP3sXEpOiI5tdGhjdE111ekyEg== - -"@rollup/rollup-android-arm64@4.13.0": - version "4.13.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.13.0.tgz#8833679af11172b1bf1ab7cb3bad84df4caf0c9e" - integrity sha512-BSbaCmn8ZadK3UAQdlauSvtaJjhlDEjS5hEVVIN3A4bbl3X+otyf/kOJV08bYiRxfejP3DXFzO2jz3G20107+Q== - -"@rollup/rollup-darwin-arm64@4.13.0": - version "4.13.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.13.0.tgz#ef02d73e0a95d406e0eb4fd61a53d5d17775659b" - integrity sha512-Ovf2evVaP6sW5Ut0GHyUSOqA6tVKfrTHddtmxGQc1CTQa1Cw3/KMCDEEICZBbyppcwnhMwcDce9ZRxdWRpVd6g== - -"@rollup/rollup-darwin-x64@4.13.0": - version "4.13.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.13.0.tgz#3ce5b9bcf92b3341a5c1c58a3e6bcce0ea9e7455" - integrity sha512-U+Jcxm89UTK592vZ2J9st9ajRv/hrwHdnvyuJpa5A2ngGSVHypigidkQJP+YiGL6JODiUeMzkqQzbCG3At81Gg== - -"@rollup/rollup-linux-arm-gnueabihf@4.13.0": - version "4.13.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.13.0.tgz#3d3d2c018bdd8e037c6bfedd52acfff1c97e4be4" - integrity sha512-8wZidaUJUTIR5T4vRS22VkSMOVooG0F4N+JSwQXWSRiC6yfEsFMLTYRFHvby5mFFuExHa/yAp9juSphQQJAijQ== - -"@rollup/rollup-linux-arm64-gnu@4.13.0": - version "4.13.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.13.0.tgz#5fc8cc978ff396eaa136d7bfe05b5b9138064143" - integrity sha512-Iu0Kno1vrD7zHQDxOmvweqLkAzjxEVqNhUIXBsZ8hu8Oak7/5VTPrxOEZXYC1nmrBVJp0ZcL2E7lSuuOVaE3+w== - -"@rollup/rollup-linux-arm64-musl@4.13.0": - version "4.13.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.13.0.tgz#f2ae7d7bed416ffa26d6b948ac5772b520700eef" - integrity sha512-C31QrW47llgVyrRjIwiOwsHFcaIwmkKi3PCroQY5aVq4H0A5v/vVVAtFsI1nfBngtoRpeREvZOkIhmRwUKkAdw== - -"@rollup/rollup-linux-riscv64-gnu@4.13.0": - version "4.13.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.13.0.tgz#303d57a328ee9a50c85385936f31cf62306d30b6" - integrity sha512-Oq90dtMHvthFOPMl7pt7KmxzX7E71AfyIhh+cPhLY9oko97Zf2C9tt/XJD4RgxhaGeAraAXDtqxvKE1y/j35lA== - -"@rollup/rollup-linux-x64-gnu@4.13.0": - version "4.13.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.13.0.tgz#f672f6508f090fc73f08ba40ff76c20b57424778" - integrity sha512-yUD/8wMffnTKuiIsl6xU+4IA8UNhQ/f1sAnQebmE/lyQ8abjsVyDkyRkWop0kdMhKMprpNIhPmYlCxgHrPoXoA== - -"@rollup/rollup-linux-x64-musl@4.13.0": - version "4.13.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.13.0.tgz#d2f34b1b157f3e7f13925bca3288192a66755a89" - integrity sha512-9RyNqoFNdF0vu/qqX63fKotBh43fJQeYC98hCaf89DYQpv+xu0D8QFSOS0biA7cGuqJFOc1bJ+m2rhhsKcw1hw== - -"@rollup/rollup-win32-arm64-msvc@4.13.0": - version "4.13.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.13.0.tgz#8ffecc980ae4d9899eb2f9c4ae471a8d58d2da6b" - integrity sha512-46ue8ymtm/5PUU6pCvjlic0z82qWkxv54GTJZgHrQUuZnVH+tvvSP0LsozIDsCBFO4VjJ13N68wqrKSeScUKdA== - -"@rollup/rollup-win32-ia32-msvc@4.13.0": - version "4.13.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.13.0.tgz#a7505884f415662e088365b9218b2b03a88fc6f2" - integrity sha512-P5/MqLdLSlqxbeuJ3YDeX37srC8mCflSyTrUsgbU1c/U9j6l2g2GiIdYaGD9QjdMQPMSgYm7hgg0551wHyIluw== - -"@rollup/rollup-win32-x64-msvc@4.13.0": - version "4.13.0" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.13.0.tgz#6abd79db7ff8d01a58865ba20a63cfd23d9e2a10" - integrity sha512-UKXUQNbO3DOhzLRwHSpa0HnhhCgNODvfoPWv2FCXme8N/ANFfhIPMGuOT+QuKd16+B5yxZ0HdpNlqPvTMS1qfw== - "@rushstack/eslint-patch@^1.1.3": version "1.1.4" resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.1.4.tgz#0c8b74c50f29ee44f423f7416829c0bf8bb5eb27" @@ -8287,7 +8107,7 @@ "@types/estree" "*" "@types/json-schema" "*" -"@types/estree@*", "@types/estree@1.0.5", "@types/estree@^1.0.0": +"@types/estree@*", "@types/estree@^1.0.0": version "1.0.5" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== @@ -11121,13 +10941,6 @@ builtins@^5.0.0: dependencies: semver "^7.0.0" -bundle-require@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/bundle-require/-/bundle-require-4.0.2.tgz#65fc74ff14eabbba36d26c9a6161bd78fff6b29e" - integrity sha512-jwzPOChofl67PSTW2SGubV9HBQAhhR2i6nskiOThauo9dzwDUgOWQScFVaJkjEfYX+UXiD+LEx8EblQMc2wIag== - dependencies: - load-tsconfig "^0.2.3" - busboy@1.6.0, busboy@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" @@ -11168,11 +10981,6 @@ c8@^7.6.0: yargs "^16.2.0" yargs-parser "^20.2.9" -cac@^6.7.12: - version "6.7.14" - resolved "https://registry.yarnpkg.com/cac/-/cac-6.7.14.tgz#804e1e6f506ee363cb0e3ccbb09cad5dd9870959" - integrity sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ== - cacache@^12.0.2: version "12.0.4" resolved "https://registry.yarnpkg.com/cacache/-/cacache-12.0.4.tgz#668bcbd105aeb5f1d92fe25570ec9525c8faa40c" @@ -11569,21 +11377,6 @@ chokidar@^3.4.1, chokidar@^3.4.2, chokidar@^3.5.3: optionalDependencies: fsevents "~2.3.2" -chokidar@^3.5.1: - version "3.6.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" - integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" - chownr@^1.1.1: version "1.1.4" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" @@ -13470,35 +13263,6 @@ es6-weak-map@^2.0.3: es6-iterator "^2.0.3" es6-symbol "^3.1.1" -esbuild@^0.19.2: - version "0.19.12" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.19.12.tgz#dc82ee5dc79e82f5a5c3b4323a2a641827db3e04" - integrity sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg== - optionalDependencies: - "@esbuild/aix-ppc64" "0.19.12" - "@esbuild/android-arm" "0.19.12" - "@esbuild/android-arm64" "0.19.12" - "@esbuild/android-x64" "0.19.12" - "@esbuild/darwin-arm64" "0.19.12" - "@esbuild/darwin-x64" "0.19.12" - "@esbuild/freebsd-arm64" "0.19.12" - "@esbuild/freebsd-x64" "0.19.12" - "@esbuild/linux-arm" "0.19.12" - "@esbuild/linux-arm64" "0.19.12" - "@esbuild/linux-ia32" "0.19.12" - "@esbuild/linux-loong64" "0.19.12" - "@esbuild/linux-mips64el" "0.19.12" - "@esbuild/linux-ppc64" "0.19.12" - "@esbuild/linux-riscv64" "0.19.12" - "@esbuild/linux-s390x" "0.19.12" - "@esbuild/linux-x64" "0.19.12" - "@esbuild/netbsd-x64" "0.19.12" - "@esbuild/openbsd-x64" "0.19.12" - "@esbuild/sunos-x64" "0.19.12" - "@esbuild/win32-arm64" "0.19.12" - "@esbuild/win32-ia32" "0.19.12" - "@esbuild/win32-x64" "0.19.12" - escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -17502,11 +17266,6 @@ jose@^5.0.0: resolved "https://registry.yarnpkg.com/jose/-/jose-5.1.1.tgz#d61b923baa6bdeb01040afae8295a084c4b9eb58" integrity sha512-bfB+lNxowY49LfrBO0ITUn93JbUhxUN8I11K6oI5hJu/G6PO6fEUddVLjqdD0cQ9SXIHWXuWh7eJYwZF7Z0N/g== -joycon@^3.0.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/joycon/-/joycon-3.1.1.tgz#bce8596d6ae808f8b68168f5fc69280996894f03" - integrity sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw== - js-beautify@^1.6.12: version "1.14.8" resolved "https://registry.yarnpkg.com/js-beautify/-/js-beautify-1.14.8.tgz#e0c570c15b5445b006de6d9a3e70fb62f9e408e9" @@ -18040,11 +17799,6 @@ load-script@^1.0.0: resolved "https://registry.yarnpkg.com/load-script/-/load-script-1.0.0.tgz#0491939e0bee5643ee494a7e3da3d2bac70c6ca4" integrity sha512-kPEjMFtZvwL9TaZo0uZ2ml+Ye9HUMmPwbYRJ324qF9tqMejwykJ5ggTyvzmrbBeapCAbk98BSbTeovHEEP1uCA== -load-tsconfig@^0.2.3: - version "0.2.5" - resolved "https://registry.yarnpkg.com/load-tsconfig/-/load-tsconfig-0.2.5.tgz#453b8cd8961bfb912dea77eb6c168fe8cca3d3a1" - integrity sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg== - loader-runner@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" @@ -22529,28 +22283,6 @@ rollup@2.78.0: optionalDependencies: fsevents "~2.3.2" -rollup@^4.0.2: - version "4.13.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.13.0.tgz#dd2ae144b4cdc2ea25420477f68d4937a721237a" - integrity sha512-3YegKemjoQnYKmsBlOHfMLVPPA5xLkQ8MHLLSw/fBrFaVkEayL51DilPpNNLq1exr98F2B1TzrV0FUlN3gWRPg== - dependencies: - "@types/estree" "1.0.5" - optionalDependencies: - "@rollup/rollup-android-arm-eabi" "4.13.0" - "@rollup/rollup-android-arm64" "4.13.0" - "@rollup/rollup-darwin-arm64" "4.13.0" - "@rollup/rollup-darwin-x64" "4.13.0" - "@rollup/rollup-linux-arm-gnueabihf" "4.13.0" - "@rollup/rollup-linux-arm64-gnu" "4.13.0" - "@rollup/rollup-linux-arm64-musl" "4.13.0" - "@rollup/rollup-linux-riscv64-gnu" "4.13.0" - "@rollup/rollup-linux-x64-gnu" "4.13.0" - "@rollup/rollup-linux-x64-musl" "4.13.0" - "@rollup/rollup-win32-arm64-msvc" "4.13.0" - "@rollup/rollup-win32-ia32-msvc" "4.13.0" - "@rollup/rollup-win32-x64-msvc" "4.13.0" - fsevents "~2.3.2" - rpc-websockets@^7.5.1: version "7.6.0" resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.6.0.tgz#d3f4c0dac108ca35566b0e31552c32e58928cd04" @@ -23244,13 +22976,6 @@ source-map@0.6.1, source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, sourc resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -source-map@0.8.0-beta.0: - version "0.8.0-beta.0" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.8.0-beta.0.tgz#d4c1bb42c3f7ee925f005927ba10709e0d1d1f11" - integrity sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA== - dependencies: - whatwg-url "^7.0.0" - source-map@^0.5.0, source-map@^0.5.6, source-map@^0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" @@ -23816,7 +23541,7 @@ stylis@^4.3.0: resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.3.0.tgz#abe305a669fc3d8777e10eefcfc73ad861c5588c" integrity sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ== -sucrase@^3.20.3, sucrase@^3.32.0: +sucrase@^3.32.0: version "3.35.0" resolved "https://registry.yarnpkg.com/sucrase/-/sucrase-3.35.0.tgz#57f17a3d7e19b36d8995f06679d121be914ae263" integrity sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA== @@ -24311,23 +24036,11 @@ totalist@^3.0.0: resolved "https://registry.yarnpkg.com/totalist/-/totalist-3.0.1.tgz#ba3a3d600c915b1a97872348f79c127475f6acf8" integrity sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ== -tr46@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" - integrity sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA== - dependencies: - punycode "^2.1.0" - tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== -tree-kill@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" - integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== - treeverse@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/treeverse/-/treeverse-2.0.0.tgz#036dcef04bc3fd79a9b79a68d4da03e882d8a9ca" @@ -24501,26 +24214,6 @@ tslib@~2.5.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.3.tgz#24944ba2d990940e6e982c4bea147aba80209913" integrity sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w== -tsup@^8.0.2: - version "8.0.2" - resolved "https://registry.yarnpkg.com/tsup/-/tsup-8.0.2.tgz#c63192a08386515103e2c44ac5a23bdff75c5fa1" - integrity sha512-NY8xtQXdH7hDUAZwcQdY/Vzlw9johQsaqf7iwZ6g1DOUlFYQ5/AtVAjTvihhEyeRlGo4dLRVHtrRaL35M1daqQ== - dependencies: - bundle-require "^4.0.0" - cac "^6.7.12" - chokidar "^3.5.1" - debug "^4.3.1" - esbuild "^0.19.2" - execa "^5.0.0" - globby "^11.0.3" - joycon "^3.0.1" - postcss-load-config "^4.0.1" - resolve-from "^5.0.0" - rollup "^4.0.2" - source-map "0.8.0-beta.0" - sucrase "^3.20.3" - tree-kill "^1.2.2" - tsutils@^3.21.0: version "3.21.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" @@ -25479,11 +25172,6 @@ webidl-conversions@^3.0.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== -webidl-conversions@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" - integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== - webpack-bundle-analyzer@4.10.1: version "4.10.1" resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.10.1.tgz#84b7473b630a7b8c21c741f81d8fe4593208b454" @@ -25656,15 +25344,6 @@ whatwg-url@^5.0.0: tr46 "~0.0.3" webidl-conversions "^3.0.0" -whatwg-url@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06" - integrity sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg== - dependencies: - lodash.sortby "^4.7.0" - tr46 "^1.0.1" - webidl-conversions "^4.0.2" - which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" From 67c8ffb27c34ee37b9367d3fde6856085081f40c Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 12 Mar 2024 16:36:39 +0100 Subject: [PATCH 064/438] 2.4.0-rc.7 --- apps/dapp/package.json | 16 ++++++++-------- apps/sda/package.json | 16 ++++++++-------- lerna.json | 2 +- package.json | 2 +- packages/config/package.json | 2 +- packages/email/package.json | 6 +++--- packages/i18n/package.json | 4 ++-- packages/state/package.json | 8 ++++---- packages/stateful/package.json | 16 ++++++++-------- packages/stateless/package.json | 12 ++++++------ packages/storybook/package.json | 16 ++++++++-------- packages/types/package.json | 4 ++-- packages/utils/package.json | 11 ++++++----- 13 files changed, 58 insertions(+), 57 deletions(-) diff --git a/apps/dapp/package.json b/apps/dapp/package.json index b4a23569d..edd438b1e 100644 --- a/apps/dapp/package.json +++ b/apps/dapp/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/dapp", - "version": "2.4.0-rc.6", + "version": "2.4.0-rc.7", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -19,12 +19,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.4.0-rc.6", - "@dao-dao/state": "2.4.0-rc.6", - "@dao-dao/stateful": "2.4.0-rc.6", - "@dao-dao/stateless": "2.4.0-rc.6", - "@dao-dao/types": "2.4.0-rc.6", - "@dao-dao/utils": "2.4.0-rc.6", + "@dao-dao/i18n": "2.4.0-rc.7", + "@dao-dao/state": "2.4.0-rc.7", + "@dao-dao/stateful": "2.4.0-rc.7", + "@dao-dao/stateless": "2.4.0-rc.7", + "@dao-dao/types": "2.4.0-rc.7", + "@dao-dao/utils": "2.4.0-rc.7", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -50,7 +50,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.6", + "@dao-dao/config": "2.4.0-rc.7", "@next/bundle-analyzer": "^14.1.0", "@sentry/cli": "^2.21.3", "@solana/web3.js": "^1.75.0", diff --git a/apps/sda/package.json b/apps/sda/package.json index 91e9ab2f7..2f6af80a7 100644 --- a/apps/sda/package.json +++ b/apps/sda/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/sda", - "version": "2.4.0-rc.6", + "version": "2.4.0-rc.7", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -17,12 +17,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.4.0-rc.6", - "@dao-dao/state": "2.4.0-rc.6", - "@dao-dao/stateful": "2.4.0-rc.6", - "@dao-dao/stateless": "2.4.0-rc.6", - "@dao-dao/types": "2.4.0-rc.6", - "@dao-dao/utils": "2.4.0-rc.6", + "@dao-dao/i18n": "2.4.0-rc.7", + "@dao-dao/state": "2.4.0-rc.7", + "@dao-dao/stateful": "2.4.0-rc.7", + "@dao-dao/stateless": "2.4.0-rc.7", + "@dao-dao/types": "2.4.0-rc.7", + "@dao-dao/utils": "2.4.0-rc.7", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -48,7 +48,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.6", + "@dao-dao/config": "2.4.0-rc.7", "@next/bundle-analyzer": "^12.1.0", "@sentry/cli": "^2.21.3", "@solana/web3.js": "^1.75.0", diff --git a/lerna.json b/lerna.json index 79433881b..5a979b0b2 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", "useWorkspaces": true, - "version": "2.4.0-rc.6" + "version": "2.4.0-rc.7" } diff --git a/package.json b/package.json index c035c219b..5c45cfaf5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dao-dao-ui", - "version": "2.4.0-rc.6", + "version": "2.4.0-rc.7", "workspaces": [ "apps/*", "packages/*" diff --git a/packages/config/package.json b/packages/config/package.json index 236d9d777..f00a1e60b 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/config", - "version": "2.4.0-rc.6", + "version": "2.4.0-rc.7", "license": "BSD-3-Clause-Clear", "dependencies": { "@tailwindcss/typography": "^0.5.1", diff --git a/packages/email/package.json b/packages/email/package.json index c5f21ecbd..422d92f9e 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/email", - "version": "2.4.0-rc.6", + "version": "2.4.0-rc.7", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -10,8 +10,8 @@ }, "devDependencies": { "@aws-sdk/client-ses": "^3.354.0", - "@dao-dao/config": "2.4.0-rc.6", - "@dao-dao/types": "2.4.0-rc.6", + "@dao-dao/config": "2.4.0-rc.7", + "@dao-dao/types": "2.4.0-rc.7", "@react-email/components": "^0.0.7", "@react-email/render": "0.0.7", "commander": "^11.0.0", diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 82abbdcca..d8868c045 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/i18n", - "version": "2.4.0-rc.6", + "version": "2.4.0-rc.7", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -17,7 +17,7 @@ "react-i18next": "^11.0.0" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.6", + "@dao-dao/config": "2.4.0-rc.7", "eslint-plugin-i18n-json": "^3.1.0", "i18n-unused": "^0.10.0" }, diff --git a/packages/state/package.json b/packages/state/package.json index 7e00d4b27..dcceb1b9c 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/state", - "version": "2.4.0-rc.6", + "version": "2.4.0-rc.7", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc && npm run build:gql", @@ -15,7 +15,7 @@ "@cosmjs/encoding": "^0.32.1", "@cosmjs/proto-signing": "^0.32.1", "@cosmjs/stargate": "^0.32.1", - "@dao-dao/utils": "2.4.0-rc.6", + "@dao-dao/utils": "2.4.0-rc.7", "graphql": "^16.8.1", "json5": "^2.2.0", "lodash.uniq": "^4.5.0", @@ -25,8 +25,8 @@ }, "devDependencies": { "@cosmos-kit/core": "^2.8.9", - "@dao-dao/config": "2.4.0-rc.6", - "@dao-dao/types": "2.4.0-rc.6", + "@dao-dao/config": "2.4.0-rc.7", + "@dao-dao/types": "2.4.0-rc.7", "@graphql-codegen/cli": "^5.0.0", "@graphql-codegen/client-preset": "^4.1.0", "@graphql-typed-document-node/core": "^3.2.0", diff --git a/packages/stateful/package.json b/packages/stateful/package.json index b78048bca..319607adc 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateful", - "version": "2.4.0-rc.6", + "version": "2.4.0-rc.7", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -38,10 +38,10 @@ "@cosmos-kit/vectis": "^2.6.9", "@cosmos-kit/web3auth": "^2.5.9", "@cosmos-kit/xdefi": "^2.5.9", - "@dao-dao/i18n": "2.4.0-rc.6", - "@dao-dao/state": "2.4.0-rc.6", - "@dao-dao/stateless": "2.4.0-rc.6", - "@dao-dao/utils": "2.4.0-rc.6", + "@dao-dao/i18n": "2.4.0-rc.7", + "@dao-dao/state": "2.4.0-rc.7", + "@dao-dao/stateless": "2.4.0-rc.7", + "@dao-dao/utils": "2.4.0-rc.7", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -75,8 +75,8 @@ "devDependencies": { "@chain-registry/types": "^0.17.1", "@cosmjs/amino": "^0.32.1", - "@dao-dao/config": "2.4.0-rc.6", - "@dao-dao/types": "2.4.0-rc.6", + "@dao-dao/config": "2.4.0-rc.7", + "@dao-dao/types": "2.4.0-rc.7", "@storybook/react": "^6.5.10", "@types/file-saver": "^2.0.5", "@types/lodash.clonedeep": "^4.5.0", @@ -96,7 +96,7 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/storybook": "2.4.0-rc.6", + "@dao-dao/storybook": "2.4.0-rc.7", "next": "^12 || ^13", "react": "^17 || ^18" }, diff --git a/packages/stateless/package.json b/packages/stateless/package.json index b8d207d82..f0c1b4d2b 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateless", - "version": "2.4.0-rc.6", + "version": "2.4.0-rc.7", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -9,8 +9,8 @@ }, "dependencies": { "@cosmjs/encoding": "^0.32.1", - "@dao-dao/types": "2.4.0-rc.6", - "@dao-dao/utils": "2.4.0-rc.6", + "@dao-dao/types": "2.4.0-rc.7", + "@dao-dao/utils": "2.4.0-rc.7", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -45,7 +45,7 @@ "devDependencies": { "@chain-registry/types": "^0.17.1", "@cosmos-kit/core": "^2.8.9", - "@dao-dao/config": "2.4.0-rc.6", + "@dao-dao/config": "2.4.0-rc.7", "@storybook/react": "^6.5.10", "@types/lodash.clonedeep": "^4.5.0", "@types/react": "^17.0.37", @@ -68,8 +68,8 @@ "unist-util-visit-parents": "^5.1.3" }, "peerDependencies": { - "@dao-dao/stateful": "2.4.0-rc.6", - "@dao-dao/storybook": "2.4.0-rc.6", + "@dao-dao/stateful": "2.4.0-rc.7", + "@dao-dao/storybook": "2.4.0-rc.7", "next": "^12 || ^13", "react": "^17 || ^18", "react-dom": "^17 || ^18" diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 6c21fe806..8582c0ff9 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/storybook", - "version": "2.4.0-rc.6", + "version": "2.4.0-rc.7", "license": "BSD-3-Clause-Clear", "scripts": { "build": "build-storybook", @@ -8,10 +8,10 @@ "generate": "ts-node --esm ./scripts/generate.ts" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.6", - "@dao-dao/i18n": "2.4.0-rc.6", - "@dao-dao/types": "2.4.0-rc.6", - "@dao-dao/utils": "2.4.0-rc.6", + "@dao-dao/config": "2.4.0-rc.7", + "@dao-dao/i18n": "2.4.0-rc.7", + "@dao-dao/types": "2.4.0-rc.7", + "@dao-dao/utils": "2.4.0-rc.7", "@storybook/addon-actions": "^6.5.12", "@storybook/addon-essentials": "^6.5.12", "@storybook/addon-links": "^6.5.12", @@ -45,9 +45,9 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/state": "2.4.0-rc.6", - "@dao-dao/stateful": "2.4.0-rc.6", - "@dao-dao/stateless": "2.4.0-rc.6" + "@dao-dao/state": "2.4.0-rc.7", + "@dao-dao/stateful": "2.4.0-rc.7", + "@dao-dao/stateless": "2.4.0-rc.7" }, "prettier": "@dao-dao/config/prettier", "gitHead": "5fe79ba6ec467126321581d9a92d3389c96c8220" diff --git a/packages/types/package.json b/packages/types/package.json index ad0a2db3a..f6640bb59 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/types", - "version": "2.4.0-rc.6", + "version": "2.4.0-rc.7", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -18,7 +18,7 @@ "typescript": "5.3.3" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.6" + "@dao-dao/config": "2.4.0-rc.7" }, "peerDependencies": { "next": "^12 || ^13", diff --git a/packages/utils/package.json b/packages/utils/package.json index 5e24f7674..802d726cc 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/utils", - "version": "2.4.0-rc.6", + "version": "2.4.0-rc.7", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -17,9 +17,12 @@ "@cosmjs/encoding": "^0.32.1", "@cosmjs/stargate": "^0.32.1", "@cosmjs/tendermint-rpc": "^0.32.1", - "@dao-dao/types": "2.4.0-rc.6", + "@dao-dao/types": "2.4.0-rc.7", "@sentry/nextjs": "^7.7.0", + "@types/lodash.clonedeep": "^4.5.0", + "@types/ripemd160": "^2.0.0", "@types/semver": "^7.5.6", + "@types/uuid": "^9.0.1", "ajv": "^8.11.0", "chain-registry": "^1.28.6", "json5": "^2.2.0", @@ -38,9 +41,7 @@ "@chain-registry/types": "^0.17.1", "@cosmjs/proto-signing": "^0.32.1", "@cosmology/telescope": "^1.4.12", - "@dao-dao/config": "2.4.0-rc.6", - "@types/lodash.clonedeep": "^4.5.0", - "@types/ripemd160": "^2.0.0", + "@dao-dao/config": "2.4.0-rc.7", "cosmjs-types": "^0.9.0", "jest": "^29.1.1", "next": "^13.3.0", From dfc5a50f102567e9eccbe3ef87b99136add634c4 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 12 Mar 2024 16:36:55 +0100 Subject: [PATCH 065/438] published --- packages/config/package.json | 2 +- packages/email/package.json | 2 +- packages/i18n/package.json | 2 +- packages/state/package.json | 2 +- packages/stateful/package.json | 2 +- packages/stateless/package.json | 2 +- packages/storybook/package.json | 2 +- packages/types/package.json | 2 +- packages/utils/package.json | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/config/package.json b/packages/config/package.json index f00a1e60b..47c279dcf 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -25,5 +25,5 @@ "typescript": "5.3.3" }, "prettier": "./prettier/index.js", - "gitHead": "5fe79ba6ec467126321581d9a92d3389c96c8220" + "gitHead": "67c8ffb27c34ee37b9367d3fde6856085081f40c" } diff --git a/packages/email/package.json b/packages/email/package.json index 422d92f9e..249dc3362 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -25,5 +25,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "5fe79ba6ec467126321581d9a92d3389c96c8220" + "gitHead": "67c8ffb27c34ee37b9367d3fde6856085081f40c" } diff --git a/packages/i18n/package.json b/packages/i18n/package.json index d8868c045..a3c868a74 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -22,5 +22,5 @@ "i18n-unused": "^0.10.0" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "5fe79ba6ec467126321581d9a92d3389c96c8220" + "gitHead": "67c8ffb27c34ee37b9367d3fde6856085081f40c" } diff --git a/packages/state/package.json b/packages/state/package.json index dcceb1b9c..e9f5ff930 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -34,5 +34,5 @@ "typescript": "5.3.3" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "5fe79ba6ec467126321581d9a92d3389c96c8220" + "gitHead": "67c8ffb27c34ee37b9367d3fde6856085081f40c" } diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 319607adc..a74ed680e 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -101,5 +101,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "5fe79ba6ec467126321581d9a92d3389c96c8220" + "gitHead": "67c8ffb27c34ee37b9367d3fde6856085081f40c" } diff --git a/packages/stateless/package.json b/packages/stateless/package.json index f0c1b4d2b..f78f77216 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -75,5 +75,5 @@ "react-dom": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "5fe79ba6ec467126321581d9a92d3389c96c8220" + "gitHead": "67c8ffb27c34ee37b9367d3fde6856085081f40c" } diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 8582c0ff9..ec5f426b2 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -50,5 +50,5 @@ "@dao-dao/stateless": "2.4.0-rc.7" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "5fe79ba6ec467126321581d9a92d3389c96c8220" + "gitHead": "67c8ffb27c34ee37b9367d3fde6856085081f40c" } diff --git a/packages/types/package.json b/packages/types/package.json index f6640bb59..bec1baabf 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -25,5 +25,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "5fe79ba6ec467126321581d9a92d3389c96c8220" + "gitHead": "67c8ffb27c34ee37b9367d3fde6856085081f40c" } diff --git a/packages/utils/package.json b/packages/utils/package.json index 802d726cc..afd0d5413 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -54,5 +54,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "5fe79ba6ec467126321581d9a92d3389c96c8220" + "gitHead": "67c8ffb27c34ee37b9367d3fde6856085081f40c" } From 1dee87646ef7e8a6153955ec9834e3740023357f Mon Sep 17 00:00:00 2001 From: noah Date: Thu, 14 Mar 2024 09:39:20 -0700 Subject: [PATCH 066/438] add atlas app (#1737) --- apps/dapp/public/apps/atlas.jpg | Bin 0 -> 81723 bytes apps/sda/public/apps/atlas.jpg | Bin 0 -> 81723 bytes packages/utils/constants/apps.ts | 7 +++++++ 3 files changed, 7 insertions(+) create mode 100644 apps/dapp/public/apps/atlas.jpg create mode 100644 apps/sda/public/apps/atlas.jpg diff --git a/apps/dapp/public/apps/atlas.jpg b/apps/dapp/public/apps/atlas.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2b5e8d34507cd2c90d21d216feb41b9c8da01dd4 GIT binary patch literal 81723 zcmeEtXIK+mw{`>-K?PBQ(iKD?h}0-WKtXyZ38C}QAt)$as!BCdq)7)Ufh063p%*Ek zN(&tUY0?pp-oiIN?|aVo{rRrzocH&$VJDNxp2@5=v)8)Uz1BV(J)5B;D|p)5fIu1= zAP5Kqx&*p-?mCDP*g6ONfzC05F8sX>0_mM&`R{GhbG-i^LjeL&-1xuaL+nB4|2-Z! z=ig2F-=F{WPW2H4q5}4u7ZMQ>jym_R?Q;~ApwIucUsy=!^SS?f#?KW0b;b*z&y@eQ zP0^Qq@!wCuq2L92&KN|Q)1OI5?9}WDYf&ae- z&c1^JLFfK%6z702oPvUa@;oKb&R;nHr(L*s;qP|w-;L_;cIi)}{_pnZaNxl6z(4iH z3m5-;|NnU7Y!Zm;wa>nS=r2+9T>w#@;{;LApQEHdch+()6Cfcj{Obz;OAO#TfeWL$ zL``$~8i?W?B_+jq$_v2t0waC@PzmShFI>MP{Pf}t9djzqR}3O=qcSdW$rU$(b^AB( zids0oqo!fJd5eje`yLN3A4ClL@R7KLr2I1lMI~hwRTvzhhtxMPw6wCev9+^DxwyKy zdw9O~3J44e4hemaj*f|q`xKv$n3S27jmgQy;_xM-Tp*Vk@@;ucadCpOI z0G*Ql{DnKh7q36np)!AUgHz<~B?h^ujN(RWE>Yc0u!VC!4dY$08Sbq=BK3_;aFFBMLN7+E zyXHl8N+KU;i;vi?m{)P3CkPF8TVF6?}dCXZ^@? z@v%GebbChFBiEuFAJMr6+5?Q-s78t7W=D{JbMXoPb~W{?`+)W*o+}|2yxfb@+N@&n zt87e1RI~>n9~#H6`)sbAfs_V*|CUw37DYei+lnzFH5s8AmcK;ExV#7LIcOouW=4^*9vOLD;3^dyiCK>*lP##78KtIQ|5w*L1fXsT^nTPb7 z?K?dA{{Bk>)V_10gj^u|C>Sby(-+V!-a+?ot|EC9A1W{zgdsNgl{!?%tTrr#TOQJr6&wCjBw*? z2Nq-CcasUe2=OtFJNH!{M-M%Wk%n+i5$OF@$D~+$aCgk7vILiP94QhTNFkz0hjvP_K72Vuj;(H8dsR8E*@?L?^?v?B>zX;bCG9&EdPwb~;#H9+ z`JyK96+-dK%vK1$nD`PTpbfpW7;^BbBXj@jKYWQ~L-l)zD3TQg%-}{ND91v$-nA zh^w=)LQqoF7zI@(koK=m$M$1HVjeB9q_kd%K^3-X3y%wi^3EIGr@<)yqWl&(LB1 zHVl7^!++Ri&-zY5t>W0kSM7O4Y)|0mGmv&&i7fF^C`4o-lZzG6{Xsj9ssM_(wi<^H z&?#BRwR2{^8UPzF#p_3)d9zZltzJ?F(_5hAJ`X;xT!yV*+6%DDL`&mñ=QY6>H ztFtAszF_t5o*cVp=wMXuJCfMdY??Ie>UxwJT{av2Yh-b@ zu=~VBup_@FORlVTlY#J_Flp)yDrL47*9^p1^RR(-njq7n__RoW5Y+Q@p$2+@S z9GiuYkOxJx;VSAjiyd0ZZ?pzojz+@8Mp+TaN*;`pJa2Owg29VW*~MYt+>=)^d8ohi zYxljiMNi9Ooy)*fwB)c)j34yr&wF*_Ldsk9RSQ}I%{Sf}kTlR}6=C?;_Dp;mvG@?V3aCx1XuHx}&q7ZF3lV zDLz{WqdVH?fZfZ$gqyKUyfthF7A!3N2!u*8}{@B=HCaLY3I{mE|W(8n}y zw@A6;RN|zTo!JCsHhUB$Y+aH{=#)I@w1-{FO7OV*V_gw&A`xhUw$Ha%A+e((Mdf9^ z99?Yx3&7aE2_WIAc5~m+sY>*ta4#jmynFbkrznJzYFT%j?(aH7WPab*LHuX|L$@V- zL`9fXr0~#zQ3BFQu*1yGvP53&ac12 zH>>{o2KcI-awk>FnyRG4R|W&f;*fOt z0gQI`Bs>U{1@`-3MAT=dXKlpkwF_N=6p4v-UuZl{GfOU4YV@0oG(e0yi0 zRo9}gm05Q@AtRAr_W($z*5M-PL~G#qp-e}?r*ZuPgU*xxv~!&GpI(1?ZZ?lT0y1#T z3w~d(fi$Fj2BJ;lDb~h;nT&^G!d$cwkatI2#gq@ku}rV@CcNNRMEDhSqF3Y6F$%D# zDD=DZGK;+#?Fz%Bk2_i8m%m?w8HvxPDm-vz(|a1AqG{91FfP&V_72U9TM%_qp?urQ z*Z3A|hjo7DZP7-`My{do<>OJB3bv47%_=(%)l_y|24#UV9mb^-7hf(Gty&&ETO1Ij zo8O{GYxAJEPwC}F$O$spA@(MF9B<{<`C$>8>n-}fI0v`TLm>t_`(GToWkw=ImA=24 zs`|;2P;0d0MOtOlq)Mnf(j}Y*_>L5DO9s%@DDB186H=^(zYQ}H^q=>_ypwfhkYJ7M z(6EbUJ+*Vks%D1rxQ+<^%v+tIOJ^X1ytd*W60m&(e@SeoY<)xO%QoHUEXfb-E{Ibc z;yK?dcdimCo*@54Jk8sT3Nl~FG=G$2faM1K-p*0qw$~|Bmkd9#F3F6mfd4PLZ)<*U zXq?h>d7kwSo`Hh-KRya{NeY}i(!24Ezi$5ZQ0a+rnHxu!R{L5**-V%P1N`V5!g^@l zFQ>|^YzzIN*J~zKZ`U>kd4td4p;O&<+OEMb{RqNG8_VICZfMVB1fQOm`q$Hy$Zj@# z@ZN@6!+1%Ye6-u;dfPfhEByE6nxtYE30wFVBeC(&2F#;-UtA=3;II9fGMCk~i@U8M zA!7JTy@=ErQt=7CN+KU4%A-x)E!RB?OPGdV9YA*sa(%yQvj*XOl2rkw?)5UBSq~CO z<15oqOOgJfqaeDlX1B;+mm12B0f$AR zOQPB1P>Nf4$Gc61Z4%%&(O!tMcyPY;=#;3W_##I$(Matbe~Jo-FQG;0A>v9zN614!G^QTLtM?$4lO>? zbwqu{LYZ{=?S`PRtKAxz=y6e~E?_Fl76st!9F(_mgD++<)E03T$h59xNQ18zFQE(v zQl`Li03gj0b-N8{BvHYv3>qXylom~cfX&}P;J2B_;F9LrUve+z!U7P%5TcAr=8Xr6 zLw=0&dg>bJ29_%p5iXv?#SMQ&n32%=@dkA}3DB zjOVWmlu@(nGO=Rra!Oj(G6QBXALgx>NEwzIr%zf*95%liLYH@nq6&VtUMl?YbP!Wg z6EQnkE+S+t6X;r$ILnF`&zH*Sb-LeL4Q1#*x}#uz;A9xmA}Pk4FMc|E^3~nEnP#GB z5nq;acZM4;tD6hu#VP%jiH2MTl>HyUP}wumDfPC3P&=f2OQnI-&_CtsA1G^Jb$rSf z$GENWfQ}UgyE&}?yO|aKY%WGoK~bOnt)cf*?^m}LGF-;9u|`a@k#_8(FYbsllqK{s zcx&&?GlXEo=LlkR;N0??<+n2fc{nmquicYZVwptu*99}cqW=>ul z_D@vbex*GYFOji8XQ(Ao`r!!Xkrdn?lla-j&?yBHv8}kRy}~4k*${`RkKv8FA8Z?R zW(4FLZ%Z%xObsc^7CaV$e!%{O z?~;HUpO;Fz1cY?iUAlLT2jfgrSO=IBp$vUrw>0yB5KxKVBKtgh+*LM71U`5ZZvYE` z1xz5I&v$X~IgA~iMKMz#WDSLQ?z)Viq|^f9fA{6mZPX|UVN-A!N6N)FiU`nM=%)cx4`d#TKT}fCAA>YOg zR%G%0p%)BACpz`9gXoy!){5QV!S-tM)euEr1EJ`g{tMyasdV)hIRwOg$2@ufRpGI& zidbD&Og0Zi`QPRx%`>~>a|%f>WoaCGpFu|fmGgqR4)Cl6mfBNLxv(e_n&0l*xX7CN zEoL_)4qU@Lq&}n`4SdfKRSPltGdTu|tMTG|D-cwWrZ^6N*gXd;=42nTHX`Wah;SPx z=DIG`mnhQ1tJ;8HwtnslIqV4?f@Z~lv#t={MOzfyjg3g?Egl)4v_!AEuB*2;CvEfQ zwt)*S%z%6K;(98P(w%(kyW)?_zxp6Ku;U4%?}YUk4NHlABk=0*@{C(*5iF%NO@XO= zui2;Qgw<47Uo=?~tX28(gU{~;`FwMfKT&H35D!xLHXHxyOSi!+&vbc3JZjYJDcE?cDR4F$=K%I@eAb3vrvY=af5d1URzU$gKa|)(jk1bc?;t z!EcDwoaUW^7nKfZR~dbpRT{?g{-zvRm(rhiv7F*+dQp+iBquiPqTJqmqF5Xdz@ju3 zB3yOz)pUyID3bJ}(B`+@vQnuk7!z8~q2cJ`3taInL?a+{yWL zuf#@3fkC}BDENU>Kvc;WX`aNp$lx1aEXLY{Cyp5tAUE7 zo~6Y&)0VO-u|8)}H3QX*o_Y0Lv0tf>2F*Cm;$?k_B^OPcWJ7@(V&%y706m0@T(ikmCR?Y#K9j>H`$-!#49`@Z$xbld%`J5Y zvstfGyU@Hz8R*&rv&khKHYHctYl0TCxV>qNml(cQt*cbw$`H6%e8e9+`+{Mx6Y*X? zVyEU)MrKh;KU@I~xe`T6;~2)NFhc@ke_DvItDk3&CFmq(V&4NGN8kzVR2-z-0U`Qy zaJmI%m#0;XvdVb7hl{IW#%W$rumh%S(DW-(Hm%f?aMWuqa}}xjzCU>aN<{Pa_D$R046hYb(y*MR!9SZ=vPo z`7tf748qcCS6qdA#2oTE%h$fgwYA`Vi9JMMA$*}CT;6k-JM;5|T}QzKC+5IidI61& z>;kTT6JKFHp~Jv~TpkX~fCKLpFlabHh4U*sXzj-`STg9&52J0i@Vpif?WfB+!5l;_ zkQ+D~mE8Jyg|DhjN3#GSZ>`POIhxaN1PT6vvv~P*Sxb+Ipkm{jIdzcFfrj&5mxv%W zYBi|(M0GfRH#+aF_tJbkoAycLvc|*k8Ifs!)kG_z_LZxutmuK1<#3pWb)HUdL~t=B z87u-IuMl-eDyxUJgYMNQMYl)TO98_x12NX=XAZ&WuSP5MZ5h%gX<~XF$4d|7o^F$G z6$wSGvg(By1_;U+xcVKpLut)swD%1*yoTB?D;gH#H8Tra^SA}xclK#$urQ)lOpoP zsza{mo5JdtTkc#J>tim52%Q3N~jH`3ILL%&}EeDMD0FC7I2(0|a+oedtFamGHB zL^xpt{6CZX&Oqscj)qhA$3$JgZ-?Oa-g!n43ueP-^PKiDQ@nfG-p;LCid))_hLkkY zIMa!APi#lG=u3uVBKsiQtDRK7nl_aE^ZxZ`d0#B(7&>{g#y@-yVt`#fN957gEM?RF zSckovWIr1(LHngF@U2e#8eiPw7Ri9Fw817{`>@ev9k=|${ttL%Gg5-47fDCuTPNZ< z15C{#>%IdYLfGxS3I$+_vNDU~C;-zcI%YiBQq&?S zD5%+p6j+!{>pHRFB_XWexV8NNRHL4m@vXZ(PDSkK&2>pwGn)9V6;>={!8b#clK^wB zZ|Ha0-e0{=inz)Rj_Z+7FIEusB=RJ@gTFZg<$s*HageZc4({AG_7oeN?>v+@5uItX z#=k6h&aZ=`OsgeOEtRTi|6zF~X%)uV#On1{a6{|#m>jp;7T`afa8#RSdV8toBmSHPX>8_?6vfaxgf6^cQbS3x2(oY`gzX^aaDcR^M_{R(c0lPxiavP z14lmt>;w1D9Xnvd1y6zGuIi{eG7+7*zwaV9{DH^zuc9&UX5rkux}aYToX$o%wI5sC zrY`wl8?IIsz25xMO!v<3qDej7=BG&WjjJg}rQ~f2hee02NsdF8i{ziDzHPsl1p7** zu`%CXx#GNBG>YOf>zDP(wrgVRT82`tMrt2^9PL$nGC#Q0ALO>zaEbh2MchQHNpgPd zSM`fwS?R!t(+)RAa9^D?rHeVjr)Qkt#dL$VX;SMe=eDuI zbgJaY+NZ}Hex2+P*j~eh(b1~qdr79mw!W`jC&gwm2c=}{@J$!w55ae}3VC)tKiqhJ z7gtkqRjiLO zfP4mOUU)_|6yz;#{Nu8bDom@3eC`0r;E8Ohf;e{ziROYwK5d?XzRr32@g(%?+|A>p zwrsw$)cKU-Ei0^|z)NLMRtCnQ@aQGx2&OBba#?`^;qob)VR|9?2@xsD2j}_Y053}O z&4jM-D}Nh@O5LF1!~i(k_?i*}q0Ht5GZ76D+Sz={s)x7fwAjH>9u2zcz26fH>!KV7 zJSjdBYh!a-qZ&AO}d3Wn|v!!?`tg;xI< zjPkJVIe3DQSQQ(dhTmG$a}Yo*eBZU`jBv@V8Qi?$%j#En+rjq02O)n$cbC3FCI$jZ z?_s#Eqmr@iygOF36$tDfv~FSbGczUz*LTbAxhh)4PPf3lKgCB3m07)D+T*5M)w=%b zE%B*>9pKd+Ty#Tr@v$}G_SCMDceMMi59ZzD7kr%?Qa~FDhw8~m!dG7^8Ma*??1Daz z8emE;p0s?6oUP-JaERZQhFB+G3_0Hu+Vh=ls64;j6H02!H=1m@JxFh3wpZgzhx#2` zC0=l;=$0$=db67$TiL6tQd#x!Ps^)Vc5pBK7gN&v8(P0`S5%fIcT~xv<4qRLl6|J#16Ef^USl$2_W*Rt)A2Ol$)fs0@cW^V z6RM=`N)}Re>O+%gN_|Tl&rL?}O4KJ0r6oc^i-&vvq{6m%&|S|sW@j#v7VoVF;7nCF5Fvf0_+NIqv!P=aPc}aJBj&tX z-Cu^}(?z9|&11P=+loh6I?MwNfZvpxI&%Msf7>nVJm{_KTXO%D5A_8I;aOd?zTa5? zzyLSuX6a@h)vOW#-|{y!nT;>MIZQzGdQ57$jRV42WlY#}l`M6x&E~J(6%lGFGeXsREeEU-d&`b=T(w zaWIpGeHpwwDi$BaF!>dxb_AE$69&+9Y~Wk%d6J%EMsn0WU^>_Xqx2ko-?LM~-&kaH zWam$OOO+#nO=GVN`z$`j-{@BcQBuT@!XLU+J=D*v@Zp#~1KspI0~xZjZQhG_%l|P? zc_CI&PyGz!6ZuJ)d@SG>Z#afDGoZI)c%G?Q%EQAYUw+Dj?JX_ubEY?m-^ zV=#5|QiH!(ZS`pvZ0$g*S^YTFwky`$TE`z+aAEb49lv|sNo04$Cti!~TbI5fQq)x+n?`Hx78ai(0Y{@-I84kZK|XM3YPE{_DO6~l8crQL`%Jd*8^@G$+nT0Pl!#R!z z;C2;HNMQBb)(etMUTV*L8TmsO1>dK_lOo-rsv6pY6NL&JDl4dr8n(QF+;@+etLB#6 zif~e{vzd%j6>WeyGD6#(9P-d&}m~GJW29UFYB0?5(&r z>pY*$HBre6y(zy8!%R_KjKp!}q&fE-Nh==>XESH89U)Vc+)+Co^}AuecSm<$jt!V- z=~N6Gc;2hN?CaucW*c)QObGrv+gB19so)!6C~OwhHu@? zOT?v}fm-TsRg^Wve5xCuE>20Yyl*~UwBrWdv~7tz;7+SJ?`-D7vL$BtZmYaYUyIZ1 zb5$V2W7o->v-~^1e&}*#EE^41H{)1I7_*zfWQLvfYCw6vi#Ka^W^Ph#UHF;sS7r`* zLe_(S-|?aD8K`0~KI(*cqH(~zN? zmTq#4%ttx7wxM-nF`lBkkaVxTO#s+=+_?O@pnl`P<Ws^Y4}kitov^q5a} z-Iy%m!h*jPOSicAhS_IXhKA{6e~#MA^=F_)x$mtHFNr2o&YQg5a1i|qaK+p*P4#p` zWg14!M_G1;r`booJN{n7EBD^Hoq@_VDJ>&D({Gp=1bkZ>L1qDuec>eC+?3$v@#C4J z`ZkHCo)61zzZy0>yh{K@81ee@p;)hZ=2A?>P31&JBB=RRPQyjerHH%g5BGqeCH0TX zRn>biANx6q6pbE+UJh5g!PlOP@bapc9G(D58*~kgx6pQgX)Az-5BB|BC93p#1xKR# zmHTCgquG~UHuEpbSN3+0@IG~wm@7)AaV3dmDE%^4k6c|>RsL40fINaVCzTzuF|0)QYh2+|lIFJ-bA`O?AHXo^ zMJ1MetP;D(84a-MkHViG|Iwk2j*+60`aS*3JW?=cnPzK$yoDD;h+JmHfg%8On0GXg z{$=9VoB}AZrEob_<0MA~0Vk$pT;vZ;TB$*}UPlt{6EA+J3YwWXKodB|L=@DFJ13D1 zknkCBfs35+uknrTxm3GAZopGH{dF!Cm{vi+F|nU|G}(CoUkCVoLtLs*qBIZ|-zJyU z5MMB{(Wic(P>q#n1H(8!5!9E%)oy+=cEgbjztJivv$_`sx+yA>G`kG1O#*X7yu?M1 zQT4v-0M>&sDY;ciys-MJ>G+ZG#m^Zd#Y@dg{_REF5zd6%3v+^#`PNUJ*qD~ITf}RK zqdRjsv04wiYXMBWHM7exqqk-jS177EZ1pyP-xB=Y@W+_hbVumCY>OlZwy<(R*L2;f z_V{sL=3vft0=nux+ydg{Z~-sjXb3``KY#)3%+*z zzk$?OR+zJqSo-o2NBw3GH@qp&l@ZNblqB;8a7dv4Z9f}6nng$Y6L?=uHPlS>9`?p| zoa4egSitTJNam(QxB|Ra$}NkG%ybhp%zwk^GCDAW47Gcv1 zge+b+F&i)p4n$7YurupHr;>7=c?9{&X7 znkv$A?l6sir*sB+azkx4B=i&DN*6FxK?R!Bgn$=6_oQiMU(p{W`qP}U9~d0p_v=l+ zV5K47RLyLPvXh)%5<88#{WlK0}J- zBK()t>a@^P@R7RT={zyA4D~n2?G0sAtqc+S&Eq#l?Mt>#Gw=&N6Lbh9yKCBa%W?lY zv+VTC4bv$c)IPk$D;$harW1sxkVctQ{@O*U7xIg$Qr9-h&Ojcl$RGRT^U-WQW9!D< zJ^3z;MZKl$Vr{c^qcRFV8-9@WWb-TKmnNGe1n{%wyGb7kv_gJrc$c4nIHXLvrD@xm zWiIu{G}qG%th~_S@3Ep+ z)&PSY=nol|ZLnn6!6^{*r-&0pC z#q)8F)OZn17ou0$m$nci5u4cf=cp{LUTDeyb0I0+a0fTjdoM?Ft^W~4)+6!!@?=t` zeI%)l##M^diNQYcFemZ-(kla*SJ~SdZf&$yTc4nhn^(2Aiw)TAbE!QGhR$=pf2ijS zK~%D>GH8rr4D62?Ua;!aR@`cZkc^{@e|IgRn$(pH-<$Uw>6hl97Yf^4l?)fII}SNY zjCvG$CAg3>!X=j+PbKy8Zw9(TTNNH<6kIB#b1??L%&iIjW++wTed1Bj<*O1)>(FCa zCB3S7xt8|oYv?BLkuket|B7C9^Mgy!)Hy+_6UhS{#^3xzwf{b$3)U~lX+U$FM_;A9 z_7vP9?~5M(pxt`Wp*`=@YBw9x?q$(j)0pO2P7GDn2bG-Kfxd%~*+(ZgC}()y8>*dw zf+Qz5f^(f}UbvCd?bDy=zaIpqqW+UL{^^F$hE1*Xai_0RzwVdWov7F)wj7CN>U~{K ze(h6rQOR1+tnLdcKVhMo#pFdi>xc&H21m%TaaZqA)j=fKmr4zM>V~c$(?8%>C2~7@VvolU9z8LbnzmOGpmB_=EcXS)b%LDGYq~Lc{?$}DT zf9}{WUpvRsJE(0Fc`~*Arp82l@~ny9sJotn!B>EsnBmzi(v4@C#$;6=`bQlOOD(Cj ziTl6RO(L&rku`;6X$GeU$Jp}rytc{ICes1w#h!CIkptgK%ADpItN0rZxOHGP8UQ(R zN+vb?FIACh?6+(#oYwdNS1N@*;@(;p47t#~tQ)_o!x6QET*0)RT>swEAF$`oy1X8_ zv0QQa4D@*-X~7A&>V$L#F4$@6Y#ptc#^xmP)U?`uOOeVNw&_3bIYbWgd97jcv-hW@ z*6+l_Y+6b9TcYo(_ZjH?)M-Y+`(uHgx2{wg6~7g=ruTjfR|>%PXisrFy-9+!jefGr zJ>+ruLn#H5o$YU2v*vdD z61Z3(?VOo~0g`t4Rsc`HeRV}x6FYQjPu(^NWY;WpiIqPQELJQ*ile<gpdi{yjNmkPfpRyDw12j6Q&|~VuqIM|&O&D-A$gnQxm3}VHF8P-qnk^t_>xqdTO^`*;HqJm?NtD?z!545`y>Rm+YAMU+4(E=SR zv7wea2~=W<=73fB8bk4i)~mV~FIL|X%@JMG_~SB}gVB@fQ`Z4bA{dy!oMj)1M`$t! zn&%3h-D1BWS$#v&k`v(L)euLnfAWD#VG*Hl9=ZquqymG?%2gc_Exb|n+PV#FeYbJ8 zr1@yDa}kS|G#7Q|j~0j4*!%TIq31|X`-UnPAWzrTJ}nwU*hgm4Z%x@hiZU6mXTEnu zw7tEk;)HrjUTN!{KtA!shW}!sEdLp((m(g7S)$&)f|q+?gX-|layKiBY)kO=VZHnn zx%zL%>`b#0iYBs?tL%BXCzQLU=);(qhF0u?{!ThWz0$KvX{FL*?~wue4pwZ*GkN|i z?Izzf z|2R33W7}`_#xFx4#epEl0;nJv+r=iSJ3oYa`F$#P{KmH~0JzH*JgwCY2FvvICNg62 zV+e>PZyO*O`dAjhi+-txNz!jcvo$Yxu;|W~f zzht6$_cGQ;how-=>6mBTX&2NIAJnkuR6x0TRMYLW%B&c4feL5i*}d?nFL$Tmo z4E~K`WWj?kN;n^#+JL5q8t=>x9XHx{eh(fBbL=OQ-__Q(NjJ@K`8*r+FKipzv<*pI zyoT5_kYPj!WZ4_?4{P?Dh8J;dyDLTTek=L%jLjev!SQ|?*?$J2ZmW&LL>{0!vP;7DfhYv(AfXmp{?$Xv?HLw#|EvKifk1-Cv@ z%zuonkNRAcxd9Dv>2h6OH%qap=Q#~yka0SRKRk(CdvNK9i5ELEYm8`Eo)jE**86S$ z^icU^{s0MBs=founb=63gXTPqS%-`+gYjRb#q4cVy|G^JR&tLC`->rBW>hD#e-H)b zfPk38rPlL|I`{b_eY4VAvnmIZ3ms^^TcuaGC){6rXswyG^?#7=+(*XE_+4-JbWShr z5Gu~aR8=JJCfBB8*5{o}P%Zn*`Zs}6uiZFkuepJ9Z$w-wGnL+>M=>j=Nt@}Yu1||3 zyo!w9uC1CdbX6xaGPz~$m*J;5a4NK|02%!pLG^LJNH?5?{i=@;7$~uY zBuhY7`ZJ^Ehg&?jU%QaiJMZt`ee>aVga*JL!&k`N4yqXIiQrgM07qH|fBVMoJ&#NtZlnkeb}d`cnB+!R8wamga{hKh*7N^Z9|=>4|szVAV-l98y=|biGvT5pA$>k6q=HJn_w&?~1)@IZFK}VzZo-f5ZdaSVh#q>8#-B@!rSH;f46- z>nQr7ld=KZ;Gdp*lPqVTIl{Ezeu$64jFRv{u4WCXU0n8g#it3|+^HzAKbKjbx+#B@ zEV`^=M)>%dpTaPA*jBl^$lQ`MKPjt49EduvQy^Lle@NJ0>~$p(BD7z z{BbAq#Je8U3vx{gyK=YuEYWU$zYij3kYBY}RBgAE0?Tjl^oMFddIK%e|-QxIB_6hS_bPUn8^)=AwLZ&`YmNL3TX+FABKph-Ohhf zDf3T&j9;rnQD3(QnR*xh&a81tkWghdqjs$KzF}itpyCX~TEsZgU~vW-zo~F#uUexV zACNJy!TB-$;C$1KlhuK&)EP|K$j`&klM&I)0JM-ZwE}=nP2nKbp`fut)4hR2 zxk6^+goH|&ZiCYv;y9mN^rLgcN8{C8+L${tp}8SoFt{W!-v(ek1}dO->6V#b6)d(Q z$$d*N+qKnlDZ71L&8XF;(;X;MNV$c60UlsVy@prj7*4H1G4sRw2bf|2milVTD=oTJ zz3dlE`qAho&V1Bdp9?Gjh(V>Jah}=DRZ;1g4d6;$6;kOF{uFmxxi-lG=;8{H8F5v# zeFpq^CSAl;W&TW2$*envy@uK?F9G<}36L?Gm!$bnpjRXeEXw3s;s7-*D?Fpk3yq!< zS#xdj{lHKKr6^{F4^`X3A;xiL0P2v2gad2nlve`7J%0e`<*&*U{tI`BhDrtZ69+Ui zCYFz4o_!54Q}Gc!sPmZlUG1Kgxc2_IZeUWjIhRx~7wp4|l(+TS`m#`4+x#Hclr=`F zDsF-Bg@8a^FEtyA95#8RQ!R#p z0rc~lXC&x*I&kOjOoDAsXw_db7x@~Ah$(xIW8KAP5}zsrcwdbUX^@Awd33lQ z=@G-Hg5&Syx#Auj!|^$$V>d#impzUVzB|B8FddC_)M^-y72g1I_m2eB^0msj@3Qao zVr~Px9%lW@q#i?TS-NVPvu|b7yR64Lk8#xS)K4NmT!lgDpJhpP`!l_36~|9~5WM88 zo2kd&Wn@W(18aI;*~!+eO^ULWk@^$CD}IoX zvRF^SrB}qNNCEY(_{&ZB+?YjMYNV< zMv%fsq`xhsp3QF0i#z%Z)Wt9U>9+4^g#M|9o$<=E&8t=#&I;CDQuJo*^9zRyzj~)I zkwMHl86oH}&irUS6?YZ855UqLuivqTn{qQwIQ{a4-an2aL5KrQyN zGQO(2v$z_MychfU!U}os z!tq}R#Xiq|U~W~2dyXJH-$aGZ!$T*wb!Q!@_3Lw~#`Ci*u()=dyd}CxN16tx+^j(a z`q1=TQBaL`FEmgpUh2oA?h?$c!OxPU0*?Vw)Wa3khbKB@wJqcEBlgIBQoyB!dv z0y#qX%uCV6JnB~w!BsO*b?)zdBlnln2+WJB74ob@u{DbY&Z{q95!EZi!5#M{*7{nE zEDO}etJr|p^OcH+p6=3ap~_6JMX*Sl2V+)5F2*!cXSVjxiB9!PMT=V@lR5or|F`EJ zttW`rj__^czXsoIXiC0WQ;=&CdvTw1oD6HHlgMXzFP$h#7VHD za-rW$y@iA7tU3B?Wy}{q-I8gvoYlN)4z$R<3vHI+pkHt!p`$^G3Gui>KvOIp^KkJj&Ee+SK! z1WI7{&1Q=PUp#%Ys$HI=w579qDWSHpfX-6udUa%-A-!k00&6*c(;0{$Bsu#wZ!Sys zHQf91v7Q=k=S4+C;Vg?~Tu9#*0xF=?%zitvbBi(2+AkMdS%KCXEOhvKu~LZzj~E&K z%cg2djr}bW3X9~{K&G{6;7%@`CPOEC-DX%=JpAWMf1oCgZY5Y$Ue($YKcL1^p2oQ4 zEr)mYmC5x_zxOsyv*l9zCi>--O`aSs}O*%dhc1%*=3Rl~^ z(PyHvxgTb&>$g-}szkZUZz5 zsT=O(+ChIN&ey2PFk7{5_#E#UsQv!#Q94IhiW`blu{GJ^zw(oRN4yZbP)Vpo&XH}q zW@|wm+$YStTtKM{;S7{r^zB5izO@ zAxoK6{@6^bYg((}MC^RL$Z@adHqeVHTR!b2 zQ^?pd?fBs1HY?j3c&Ipts%B9Ka|3AiIWw$b#ajQdtblRgcdi|unKw|c(-Q5KhuzdJzwIsQDM z3vA>Bsuf4-J!AGv4~Axj>@!GnL*{04134;{yT8A8z1jhd1gt!KbOik|3Qd0fJeTz~ zlD=)8#^ZKFSg$KqaeDXukeOLcGRSe0WGUvT@k*LIG>d|5a zxm)Ncedb9ZZ}N1E3!~Cdj9n^#6%SB<_`0k~7g5&9Z>PQ#))7GY6-Z10t4CZFeIr8u z6gL+J_F&ZkPM*NeCX@gyAkoOI2n4?M4MeMA5K(=r7}5NaTHa^!8RI?@-9yPa%14TL&|A;Mr@#Z7Wkjh09Z%1C~Q#Z9iDZ!0J7&VsNP$ z#fiv4xW|mc?(L0=7z+Jk`W5L*>xan6B*!ee|;e1 zl)uRscBM5OlRdn;Yibtd1>lU^N7De;0Qw(v%Cr8XcR+Rq^T-9c=N)wh64QJ(2$xEV zd9|#)INDv}1*ro+$e_)Kl2P`y)`Z>mq zSw&1xzU;at{pe%BF44Ak^u1>1TD*%+?NB(RY2PG$t(rmPhsx=9<@rk4Sjg_W49jVv zznwqh$rQ(?OqGbcZP~-s!-<53I2UB=0H(lz_h^j09QM(2Ya?DT15#AR`SUzm z-c=9mu?^qEN(!ARSv@^K@7*|!tH1vYKXt`ZHfTN{f4{0A#vz?Nc^NvtX({xom&%?D zGy{+LNH#%FNKzEoeKVX&5XL*mgCBN~)g@B?c5CW&(fjID>_xq^-JX;43SCF2I-f^- zHm9FY{4X4!zRH#N@tnKg8<3=QyfpiHdeN$%9DV|T@QjZuGjH~-cvSZ?5FK3D9-li~ ziX2NiP4}NyOeLqa_>_qqx~uq4EEFGRmDwmgzRz}l`*pX$R>38{lQf;6qo+!YC+xrl z-*j+Ty!xrd6dN$6&}qv@|!8=4bu(>P50{fZqM|M_^$I(q2a z^}v64U+|&GeRwf-Fj`LY`$(f9C;i$hGZjU|>7Yw%(2vvpaK#Vu7ZOcQb$@Gk5{1MX zxd4@I+x15q*PCO4t(cl!!ZX?WJ$^mD&|?gmmsw2B8~wvjjEQb3T;IpK8s8lED*ENT zJ=BP7l<>rLAyI*Lt1?Q2=l6;po=Rj>E#D}mdt^lc|D;{=vHg7^-hSy~RPO{aii<`>rx$(cL#PFLe&3`K#kgAKX zKg2y1l!aNeI#zZpK<;Gkl2s#GWz4%hVF+4-W4$jA!uI_U%9B5=STszz0Hohv@jB)B zB~gQc3{O_>!G}M{ivej53@v}dyu@p`ELtWC`g*<@ixP?f=_gfL^8WB3=rZCk<#&Oj zb8Hb^2%F-950#MIuM5zD>>i0qo)%BSN&^L5{>+Qe1;QBpn(zJ~F>LcP=hX^YWr~8b zX?5KBr<=2PK@XzxfaF7@D99AnlO31xyX`a*;5W31VG@u#86_63vFX`QR5ZVM{XSz!!ljSui@MjuyO79MwpDsb z+N10hv+KcM@kn##+*mlrwXiPYXlQXnH*co(=5VkPl~ud1tSC-z{Hz=6PTTQy$ime5`mgE zh9Z+S6{E}zyAb2DF#ucdD|ogIed(86P*YUnyxD>l_3K0$RfSY|f4}CtE3OcoD#k!C zu;R07uQ_xHfIie586?*RUd;Nf^{DUk6Yu-1qRg4b zyDtU_-+a=s(x|t87@WSGL40V}-5{0*b$=}*72kcJ=qSbD9KX`{fTk~vX6dqyNZ4co z1NPE(|48GZ0EFGNuYT}#Gn%3>^+eg;WBsPtlR~rD5O60NGQH3|y+MwBxyiYPww(B} zl5$9lB&pVM)q75Ni0F?WeAx3ikfdi*7oG-PAC=ZEtx9E_zM9GqRIB1YHhukO}g#Qt}fUqjXhi#O6Jr+l9|WA)od2<2s|Kz7f$z@Q8t@3?8i zX;xXXkHa5^xD%z|!}$9Kzq|LUuJm=VU+2c7to9TBRig_h9wpMb#m@P|D{qa<^waC! zT+wJ(H<&_ZHM_4bCwR zM}{?2>y{i+y?RSj9y5XNJx6e*e-Z?7VS32wrJ zeSjL|BQWlK_L95(0N{UoI!XqaVvsA2res}YE2xhNtRE`^n3$OMLSrHwFJ2`8Za zP)=?RkP}}uQEstwrAW;5AqTxN>)^@eKlUhVt%0o5Yi^Q&6!Ul4br&laoPW5B=oL~G zyzxP`Y%`f(vSZ5f)4SMpn?szrfc?_60>TCyX{A2aQt!oa7HBm4?~|})fRbi z(yE_w2-w5!9V|y38|57QVMsl5rz?hx3W!b7m&qAoXGSqIRVD{2o9^F3lYc0(4y{xM ztV`?EGAm6!m1v43Kg^sPry5>b{@}}K^lAUK(xlj1CCJ&&euIx!os}|PIbxK;c6Y?l zX#u#U%+EgjAA_db(Z9d@OtGJs@_95(^0B4{oG;Wp?SP?AjK~Ls*po)J&DFm|+Se-Y zJUMIaIw2Uc5%)jFd~3q5`t2c3Q~Y(I=IFrly)&^#wWfEq4_j{4x9S0ZHYTt&E#xrd zo0W~y&a$s3!%5s@=veObEekR1O)EguWfbU}5^zx_O=&Hq_U5j8%+$*4VOH1M?~(xn z);k~rGom_oN2YyW_(qam5acXPO7}qM55tPz=Z?7;Mirm&Dw?#kQeNDR15|I|jRV;Y z>t^wH8&;tn(PA#jPIfn?Pj{H?%t20R@%j25qgMc0_C8ZvF=6i&3b*(B zl_XcJb~<=PtcDP?sW#;e_!%bSvu=qY%qWeJzMalpO=F?@7b~1;AV9Sg#JsWXkL=#B+=w&O($W2Kpd_j5DXFye7l@P#IulQBq z?0fegh9=pjljKx20P8N<3=098pPAFx@`om(JAXy%Cj@nz?sgJ_CeI}*!S`LR26i=- zk>3t$PGwzK@N&BvxcU0C-E=|cQcHv0SdLF38%EJdTV%EZbSh{l3QDk(P8p zG*_Ecg1dNjW|meNJM2*M-eZ`*>Pg>Al_!VyK$2sUZ-PwcP4}^mx9TlF*M~}zGNWTYEi(-Nvc5;L z^0mix-$f&v`c}>&_B!4Q{k0fpNJGgivMajAxrYQ*)NCA#+vn#b#JHM5qBfW3RMV4% zc+wFqt3tZ+AK7?@akPlq6I@7Gw?x3qKe)xQBm{cG?fE#R<iCzR`&XngttzzM zzYo-7>@_+@)_(2+!JM>)qKrgb7R|WNEeJ-X zLcDg@WpIme9E5ASe5>8709O;p4y%^Ya$_+MNoM)2U;#W&tdULSeB?@A`8*ZhkOiPx z=uB<@^69)v{wjFk(0ABSLq3FP%Hu(XCwf|U;**VMM#jRaL@D0Efd+B`2(hY*!$=V` zoy@Ptc5+;L{6c}4>-Qq+CGpd1UT7sK_WOPA;b!s7uoUZQ-0PGFaz-o+s}_0$x1PV8 z!=AkN%I82MvRCy|h@U|^CR0&=7zASk$sC*7!)Pn}SGzB<&BD8Omve{j&GVJs`J8D8 z7EYmP&t*r>$7(Go?_WF7uQvihbS~=_Kksgr7ClTid^d_$2_*aV3pjDyZqXkG7(UFjtzT}? zjNKFynlDI@%0}46g=*;#Me27EYu9`Toil?P0*_OFQ7&UiYHTGubt(brZ&mw*#+coSLnSGdAHleZGWf%SRq0^hJ zn#8k3ptG2)FW>T8_eUyFHbLPEyBMi2W3lrCKe*#3o+IUH!_%-(g$*#27k!4Ic|0g! z+q}B)s%f8IX4AL>>(&ek9x4+UV2}a*x+)#p1)0|r*l*B}I|eVOBn zm_d^(Xu1$JC_Qk6gjkP(=j{)#Tm1d~kW;R6DN9d~kfB?-G-G)Hbk~KhTSL9yeL4M* zUM_{(UkPrG#w3Lb{?S2UvCZ)cESvef{Zam-$ahP_OX#=p`qRZm0h$eHo_}h3l;ysF z7n??wmn|JVbusUjvb~EH3E`cX_e0{n{eT7yvz4{#qO5&Ja}3hAcsu_kzpB-=j<@b? z(5G;4LvAo-Hw)7>ne^3t?D^(}tL|odjd!6Zi0vO3U~c$I`ltr$k*`sFSCgeP?30(z z;J72g*Ft@!)?>wI<`cq4vCvL_|DJ!23~AKMdIDMHGduXCx*)g*^kA5NnUfKn|gHmB80Q&;I`~MSOqy&&DZ(05VhfRjShw;HQck7dbDVrS}iIZ z*awIbbGu;F60IfU7IeVp&&Q8}!LZ?8E{zqjMrETWXBt;Z>`nMTcedUAx`4lOGKtE*XrLyIjC|8A|Q_>@#7&Cw?s|5o&;!T8}g^ z+mC0s8!5^S{G^v69lw-DF1(dnq(4ggIe70CEU9$5L8o-a-Qt0o2PC-=a@{nT=UlMi z4001G9i7S<%JOt*S{_jg{mg3Lr}sf(eE0~VRt{#MxI8z!>WHq)K)Mfp&3BhD^+O1i zPvbmY7zpIcG8At^Qs3NQGk?6Fa%L()*I@xl_VeVQCAc{K2DGHc(bwfj=9RMS6^e-( zs{xmx6v4IPLNnp zt!1wQ6LP<)c((rS+y6C1RSf=~Vy1m%5n;)-7_E%;F|tYdS;&k*eiE`qWXgLG4P|lR zC8|08bH#G|g*>jNqixg@L@VsZBS-H=1joz}K3eq~E1-@S@0KA@PVddiWfvKHfgz12 ze2x)$KMOw`4Qzog#XkV!Kfm@QL;>k1f-fOp$=ZbCoIIfm6-uidMKR?D0l5_~r-pYN z21r@Z)H20BjlIZlRvc35YF6m8?n{Q-6jd8~;#&mMY+PZPH%??3@yf9<7mIt! zX+NsVEe~RTRwA z6T6GqvND}n7rJn#A(D;ci$Htbsi|+pG*>q$ojQiC&8Gv8@{Nkzwbz#sGHy~>XA~@% zZ#uhSywBd451b$SipuN7b-`56RX^nG8!60eC^u@Kltur@{CS zHB7eWCB_oo#CC-<8G?2ppXs=a%`4$OxnC}Kgv8%AMcXydk7y5of=4AZ94ux+KeJu6 zP%b*_RpB;4gg5aO79EPAgm_R7_w%+9nd=jv((ISZ+@%)NI77c)pRVT(QwuD5aogZ! z`xlhe=wD*z_vwX=*&V$@Y{~w%WrFqdA!aR+!_@`g#KfSDd|MSB}YEvUV)VR12S zNJ=|bvDMP^c4ql^eB{)~ABJ%v_x5o~EBSg3G&M2jQg$BWg7egm4!cK0&7T#9*RiYPpw=$S0RQu{wgGihS=?>T?aI>}>!yv02kyE4 zh$<()CtItq$r_ib$mI*cLi;wY%zqd{FfsAvF*lunXa1UU;cTeGU#B*rITNcJF@Bl6 z?#Wb&{vK@F^YpdKrQ0v^DpvHqnTl57<^O0p1Ra&BPvvgwW@Yf2)W%a2hYZ`m711iV1MvHxK~C_4#E7M5i;>vO4D>TEO7e}m!QoG6q+>c) zZNa~ehvg+Sxaw(9^_{xnTRRlU$2U(_Ej^u2m>0|c3lIpkw|uC;Y*2FKFv)l055qUz zsZRkSz+g@m0nnUb?QCK zn_QV*uD)UvbhGcIY0?;AQnq98|5L7s(w~8|zFXFYd4rLqgYS}ICsk@UgYLE7biVt! zIIrPc(cOeyVhIp?To(QVTwbC&q8X1gFh@cZA#_a&W{0?=ASV-VVgq^*R|YzT=$%!J zaTVk+&z{cZ*cD!2b_o1diGaKFbVUY#Vymz?P9xd64W_jE?+}W9O&Zj!B1ZReQ!|}3 z-gh(531vsrpTl%QCR$y6y8sa*l9_npxp2{U4v=vZ&Qm2l9{*A`(3h|(h%w}>WBw3q z;gQ;EK;$*2=ZG@UQ*?Y`7aj&Cj$KGYFkO91l-$-9S=7II3B#7!W>C1Lk$>wv5T}c} zuM3(`;n^zGvbmfqDo#NG5yJ7KwA_pC$IpxvF@@Hxm75Li^x6QkuE^i&}+89LjFiRFmk!Rq-auT{ja%QE=- z9-QQziu}%uNSB)xhCV@crcP0t`iWg$hWOrjyo%(Fsmq0Jm!ZD>cL)+*uwTqc^0mVr z?(0`}2)ZmDH&u)*E<+nL41X4fsa}k|HmE_ZvcVR%agcs$Z4r9K?_%+CUd0itUy2sl zzmSHtwwLrv67SFnH)12Hi9SX1GHu0EHLWrUHiUQkL_m%O?@5?MJ-ZPOxgAT$m7ayK z#v|@x#_#2H-2)K!>H(9)LqLu8Qp7j`a&YP|7|u)rpZ?$z3}|`fh&xXT4A% zt^V{O2^%2&lkmBnML59=_tSkSGsIT@W$7z<#3A2>$nH;TXNi5 zp$XHPwpTY5F3>p!Ohqh)e$&(%yh{M&lNHLyJ~z`qF05e}#?&}n>;|AEjgFU_E;Kk6 za%g0{sPB48OKhvmS=WcH%e$JkUTu>Lujj2$H7hY+wz6wL_>}<1E_c#wu8IMLZc}kE zQDht~imt!PwSWb)aK&3rzeP)!ts5F|TbzO7VH3`YyK2?magC5z?*$&D3o z&2`N0rFk1f?BK&}HQD?i2Wc%D53OUI7-WCW^gcwGzxIsE|IyK7@XETS-|6QDd{DWX zBQGcDC+0P#WVe{Z^SO98w4L3Mx57)ruy;s|Sqq=p>OwrGJ#i?$5uCQM;A!pwD{(2Z zZgAISnsL{O*wM)#J;$P{<+?W#fpIC}bw%fmE^jW|rt&D5Z^Z^vrtKX-$OR}becC2t z)m`8_J=_ORTj`B)FzvhdF{`C7u0L^$l!<5>;oItJniRrjvDhmLjdXMc@J(iMmrLA6 zkw12p<~J-9>tcH(hEaKo2*CJ!-{33siCltD8xqL@LA|}QqNZgCUCN5cWC>|CMf?2z z?mBN6D(TI9%}#}HneFKTgtd#gj*158O+N zIkr#;UU6g9G^2dRp?P@OY$)#eF3F8Qa-{0@4UOE!gc#&TCQ&gp=+X)!%U{r#1156c zsp1}3wT1iGJs}lDTlfw;^v3B{1d|(qOd7tC!0VcJvS>9x!qBYS*)(;4YTk5aA48y& z_xPB%70sV*kR708#2U`XQJm>T z#3K|=CugajVD*`pdt|tuw*HRfNf=`+X$6@a8NHkP95`r;xQh&|us9l6AIc7_$h*e% zo6Tm%h-KgLM}ssn3hTrX+DD_iJ%eqf@-5$g3r8OIw&qP`Sup!K3@@Wf;O28z(H z@Fxa8RZye@C{H3sc(9(Nx77X)VST6pf|M0(DYHQYwBlrY9N&NWuXvPYJ-*8v`e`Wk zQw^c}gjS&I9%p!0G%)c-JQyO;lHE8n_JUzEtX0N?&@K^k@abN&%fVW{D z`l@SRKt7HgI#ko==1Ng;79XmeQeP}c0n3f9t|M>GN1^UlJswze!`N0~IaUi|q|zpwsSQfYy_c=HG)3QVQOW^qtN_#@#tF7Ul-_?uK+`25f^ zHW4x!Mb8@S{yFW(ooSyZfkCQe8Te-I!lR=b%TxWofDoJdz9B>LZbRw$hJ+NX48hC-F4_}s`k6((d^9w)3o2$XSqu5PMicF2^|fVn&6IlUZL)DaS5F`z5@S=GM* z3elmL+rGYvG-|2KshQKlL4oENQzIE{A|Z`gd8Y$>Qy{#H(kSQ<^Z|X6swSn7!Yq3Q zK3)qeY!gwtU%hNX)m?5bPLu!}{D{XOgwmPu0^M>*|9GH?-c0o4(sg5mlbl_LN_nSB z79hE!K)B=iL3f|g`3C78-imH+vSZ9@c(1`xO(_A3clO%H4=tCFRGd!(~&sT_~B}$Jfu3LXO~kv9d)Tt zGYt0IF>`RVeM%pwGPj`f>dYTy)X(KJ|GY<<_n72ld zMJsnmUUM7M#Tbu;QK|$?pmEiNYBk*mJ&*2B>xkRIYI{8m_L4(3fiI!_PCNjxEdWx| zc!V-~Fau|_bSWE;U!8zYcde;$uuW9*>6_gbj#o3MP3JpaZs>C7d%e##R4+3*)WI_R z=~IvQ0rE91a5rh+Q`IcX^w*285-aL{%dU;S^{c=78{x4&b zTR_Q4XYPz!rxIiW=RLe0TJG~il4zrzq(IFQqmlIuqOmpM-eT7wz=e*0+CHrtM!slj z#WX#4`iX55JKP~M6<(7iaag$yWmcUG1Q-W)?x^qbxTf`o8#R-~EtE4MJD7-z?vdf) zE7pK6aAav%0bN)!z(jwAgLixJEz5$`D~qcJ{>B>$1quEEQ#R+j z0h^>|DC6Ji6DdF4nEBjU1bX-CSqFfOjV*LeOAUo0Q#{ONb3TK(a8{Mc0mrnSu*yn6x=aQ z_b7y@F9XOOzSLtG$x0<$V=*x_BY((S}A2? zaF^T+HnYXM;>uj5%>La6F!NyY$NTRuH~gM@m?s6~j2OdpKzUaJV*o*}>EY;Bi~^I| z&*N*L)>A7!RdU*KW>)MzjxD8?t>Vz+^!fkf^9uSiboK*c5D<33MgUqF$j3yoAU-eV)W0h=}Dz{2XtH1W5rBhSz9*dNI)(ln^~q%uge#;+OS{ z9H8Ey2d>mYVDZcK;K&`k(W5DSiGVI`p`p}zL(Vda7bWciPg?NNKn3eiubqNHUPv*D z=yndF4g^tNcxzvLXAfi)6-R+`SBc?aTGU0M`i zH!06{tL-eCmv(gCHquJ?ew&AedwN;yZ+qV+xOe9G=hCZrRF^$~Jh>BCi9VbkFif%@ zFRAZz2ZorPg+!hgb$cNOBCQ;-p2MA4U^2ZOE^WLF<}$xP(WwFlFPis^I3jA!S7AB9 zf42@VskGrkyXAmtBX7fFwCv$Zar`pxB>!_MZaFvviJUEooEch9%Ww{VLXi&LdgL%C zWK<=)Y*^f);@0NAI8r1)E7l$C9`TK!eu#m`_qgbrFO6Osl+)FRFdB)s^nBVW{I&e3 zC%a?$X!oI)-;^o%CpsY6N4`>M+XLuqSU-r({?UGD3PbRC?)bGM}kX zmXmdt3{To}f%?2BqxM7SLxyHI6fueZ3pAT67<%!GJ_5n>{PyL1 zv#-nMcE26I?T_b7MJFP?ODvJ;(&?xS6@Qtzirb9~k`%Y@e{p&{>ZH~SFi*Q4Q@Y4H z3RJ=}+*<5b%lIjx&>4ORitv)8n6ct{5E>~rS|!MQzM9!ju?DfW08+@pXk9JlcV8E6I@2RT~7LrGy!`>Ck@k{tOHq!f)e z|8vr$b>z=Xe{4m;piZPapR4QWkQR-Dv(PRJ^g*OWSRMwPO1%vNgZgnZ*Af#&S|Cx$ z3ejTEu_Lw}7O~@>rBjyBnSP0dEPbn*!{Co{E|oE+iX)85=H%bkwfgqH_e(WI{e-w{M6mI)pHHH%9}S- zt6wwvA8NC6o*R`R*$82bWeR*CxZZi0ES$EJ1C|W9QY9l4#Rswx}UwjUjK`Ak2Di+%5Egtu;Wzl=w(e?aS_z zp8(7>baTP;81K|CLmzzWlCjaY^#P$Qq1q1}d0JhHGM_P{BP}`X?Qo>f&ks zN>)Llcr1co-{S%wmylch*_h>3K3Vib9+}vrg~;fQ?Hyr_wfr#kJHN6P>$w!g5!9>` zg!84~yhbGb+nYk)&|mi}$V(mbHNjC7uha~@-;iwJ%l|R>epHthUrEsb zki7g&0aNannE**%AOuq$1vPk6Q~SB9g#HUQamWiEiho1#ro;=!HklS-23m1XETn$* z2nsx#@D9Vfju4Mg9&#K;!}-$&@j4-L5XT7BW#mMK0pJT!yH+kg5^8%~VF0uQ{X2x4S@2zZ{tm)! z36sK7T@@y^8U#nS!gs%H$S-Yk^mHk!+@3_?;Xtz8p1J+>641t`4U#vXoUiqxSX{HXh(bOE)+n>6`QU<}d7cF*%vNh(XLv)VS z2}UUYf8Os!zqXH9GRo>5(&mo#P>s!V)#m>2Mn$JehKD9E@Q)`R>2?|VDqPNC`dX}W z0Hl5N2E|?TjT|4~bDgeu_GR8v-dnjqGjj~`O?T0p+H;6VNJkoEW7sweo|SR=X1u4o zU|MpKD@kPYR=edORsRxSKZw8)O0_QijeG9%S>qMum8K|$+9kwURD&ZCJh1STx5Bev zZ5wS-U#Uf0m-VRT#D6&-FVWfGL`KHOX#mmzC+Fe*b*M&KlP3>x0{(e^I%MQ;21Y_L=oa2|dNV{h) z*R9pXIJ`;vct9?8EJ&`-IyY0J!2X|_?(UWSXLz*8ko91UNt*vtsy|3o^ zBPVx_x&w$+nU7CU{P=&3(snjB2l;M%Alv$0uFQEtW~W(QoUZUwY#c*>KY4tLUXfV3 z9afB=HT_X7Sl?=xMS?aC*(_V42pt2c;TQJy0fJn1k^ygAyIl8^!P}-)+q)#ut-y*^ zgKR&KU!blwK#0H3^{Rx5CN9TvNk^``de<82MrPhlr-I z5}~XE6}$UN*8MqmG@P$Y0&Eh8EDY(e*<4g3biUL>7oId1GRiy3Tu4(Oip=*IA}lA7 z&Wt%M(LohQ`g>)@EN@&R-}hkilgqZG)E8AIis8wbiR~YvHdy4%AFLbNSlu2LnA+_! z$L@oEhzvof7SlWfTX)P~W3I9vteYhrg;5`%JMYx5n{HTb4;B34&-7UHyOcyweSof` z?xz3kZh6U}aFzdZZ3l~?!?JP5HD8%XX~n|cdR0Rg*p6<9|LZ;K?dwsfuNa+DBP@Ez zd1P+&%A26w4* zyd;DdTm~%~6neH0M4Wlcsm(?_`hbocuSN1u_#`y~kvI+Yrhb$KmaTc^6xa$GxwuYEmZwT}iFcZlmlWm(0T9RvBuPaoBT;5oPFNSfn?(x$r`o2Bw; zzaz8)Qwj#eXrSd6eIZ`l0J(F%e_T-7nrkl zvZDm56IlTuZ_+lK3{QU@!5rP=7?&+11e;L36aOVaU&Z^0#{>SrZ}E>%Y-=2+!qG!@ zFTfYW`cyyziBWm2;R;JC@jQr^Zy@*6s(-i^_L1V97Ljo;jGr1J4RqnDhH{H9<+wY< za7x`puM)7kLRqb*^B#WS4GNd7iz#V~j_1V64cdJg=q&^*j;5J>@LV)8>`K$HJs}D@ zl$m`?O<2wm%IeQ9(u}AxN@m?`h5xAjv_)Dn!pbH7Bnhq?OS4YnbmeD;?)Q9!P3WZl zSO$><6`+C+UXdk|`$cGc(p`!6r}x%IuXoY{?s?rY_$O2A4f>A518CUhb;?9oAlNOf zyUva^X7XmZ%kiuPx&_uWQZ=O=ai?vK{C;s(xjfJfbcWdDv^qa8(;@%xmXr6a*YTcc z2B()|L>m0RN#|f1dHQ9Q37Tu~JRauz_Ut{2Z#V83aj>Qow$Xt{4KhdWN_{N)7B(?d{H$v?^yakwTfW^=$f-K$FvpdQ z-nWxR#kZa9kb;VB%d4)rt?1Iyj+psWkAqk__mzRrLt)jlW3@&3Gr>OKVlwePA7G=q zSrj4fK4tueVaO5r{cNN-&|^ix75?`=*)+M2cCk_3s8K^~8?sZEl@m_a4dI`v&~!Oo z2?}M}G;1!|@I<@r2mz~9X%1kPN9{qTOEG;k;bqI9L$O1~@|@9Aj__&5?=#E9W~FuV zM)7Z}Xe*W{-_Z}J&yIjqr|4}c@RYz`3J#hJ({W9QL4d6V5UkB;&3xG!J5yWgDrjj6 z6Jl6S3R(IQ1YZ(SeBdvcd|n~2bu(3Mo7{S$Aj8kQ+h({hm>3ZC3~(V^ZOMpps@}@q zLa!;=(GNl=KU7fi$w11=S`XjBpx+ouyXM0~nz-iK%=@5NatrzHKEoLZ;u1Bdl)Tuw zMdCc=`a(P~ZfSVg)WxR|F=-CdwlXbkNb`F zih#}1ioa`(B$n`%xdb2Dq6X@~(cBIHO5CM*sa-4b9TfGrt^~*3KTRsrZa*5h zX&&TNc|=N*3@PK2&vrGA?-Z}ZrM*T9{1^*$*S(5K5PaxMgqXBE5Ee?Vu;~&9Lz6sS z`$_$}Uly6S4?>!h3>9j~l6(ymTvXD8t3tyXI6_(@%s1l+8LB4b0WluR9gw8>WFZ>(cL>@@uW zO_A8^udYY#qBe$Zcw_HYd48vTtwmNo;h_=jE$`ez&5JWdODz0l)AHzmg6`t^Uh7&UBjZZen(U!LixH-s#6X^7* z5~9>X%#`=FLd|#KUBltC#KYDbZz8kS?=AHFEIZ?%jTj!JHjd^23w^WJ$(@K;AQo)j--WG>VBxTbk1U5>^|x%W6!(0 zx@)7-XK$gupg$Tf@f?^=k4yuZvY^$9LoeGVAY*v_?JIvm_0u-fgkoG4Y z<``d)eBlu2wYkFvq$qB)>v2yN&M?lv-Uyp$?-;w-2@WTsm*S8b3D zhf#CMSRnf@!+Ae|{5^x~(X$0nv7S#tQ#W6z(FZptq8cBZ=pVdY1qf`*3Qt$gKMYBb zaU=d=HQvG20j|^aursVlw}9~UE3W^zSKPjc659)*lkV2#{b)r+fBuap_MT&I6FpXk zFP!}k13y`JLuZ3-osG#|e3ZRm8v*MB->r9L4w_)9X_80H9epo%(l7VBYV`K1CwWvt zEO+h6yD~}*BG4rhT^w592ga=_0joEca9T5 zgCB;W+-hGa>i^tD7QWlTU%cE9VGG7Gr!KF(y3dGHTA^1cc0+)8erTrg-kTozmCnRa zHPfIt1t_Y`^i4Pz%AR6|@3_D5b4v}U{$;bd_yu2ujB@7Shfeu!2Rp5{EnOV1#!hkY zIq)T!r>!Hvaevh8naopmz*0p=ab53VpN-u``fE*Agobuayxy#zSQsIB=*5tCq;_Q|E*gQLvUTD-1 zc-Cur%MSM+uZ7|&Ex&pg|7kEITnu+M3pY`oFnx}blc z!%XY?F0l4$vr8xWC7ogeo199vE`aon@x7Q52jJh~3OVB>enWqytt0h1!q}B0;2!r1wqoHBU031V zH|2lxSV$}2lYFMqzvJhk7(Br$C4U&q8Mm;2Wh+!*WAieX-yYDw#m3BnF(z$`h#nni zV;0ME+VCTXsX_(1@A`>wQ#i9M8hBNwgrIwi#T$N8l|Jkf2RDE$Pm~`pBaoK-rGw9u z8?lVcXW!&k&#sx&c1;W&XGHyhmrBM!hLuBPbIoa*ztrSuyk#xWU1~c`17|Q6MD~+i*VxHF z;1|u@I5Ao1?|9H-pLO5ztfRKT;?a*=aTq42*_hp{^lA&uJ*NY_Q~b*$)TGCj=wp}T zITfpUE2lN7(4Xt(pcAR)o+&4=UYotySnmmy*2n|s!s)57;%i42`6x4~tY=3be8>vN z2C~B3=Q{>2{5--A9xY$X^>lXst2BV+#qtQ_yLvOeWO{>O4`3B@G*0$8lA8*jw~~$C zAP{KR^_37V9VempBPTA#v|Gtfv-OEW*T^>mJH{CXx5YxmNFEOAQ-FmG9`c8Q_eaQv z<6%}y6T{g(ABc2=AKxmJZDw?FrZfB6D(^)+aOHkfKu>Nf-fEeG73=COyEN1B$pZzO z{2gb#4$H3Cihs-2EZW}6xf+PHK<5u{^w@YXxm7rbHbLfY&8KAuapX;EhFg;(*R$aL zVJoiYaPwHyRP9b)wtF{Y_U{QV5|#?&X`zz8dt=j)V-0K9LFVtLh-xJ(NV%M!b9G%} zrXy;wNn~0uhb+ajQZANb4*SfPBTB-q|48h8q;+QEY9RM!$hVF#@`v)(=Xf4^1HU?L zZ+fl>@}gg@ecEmJZs5lQF}f2a{}UE7a~u- z_SPF1ayagbu^cR^M^0^838lYTg)EP&HQUxdVp@wSC7m$RHEoVn^6nhnIPscL;$7Si zpEW0*&7R=HTKT?B2%lhCUL9!CGrEYv8t?ggX;dyD%5uO{P>3;>`^VYJX3>8i_vI$> zP8ri;u)~r+B9JGYueRp`1+?3c-o#iD`|0#@pYiU4weUX-kDn{ShpobbE>wu8Jg=(| zI`bV9zp(KJJ%{##>yC%WB2frF4x@HA=t_hVu%?qeS1zz5h+(zn#m684ScvtegRpnviqKe9Js+r>8KQAH0>f~h$k6CN`o)Y^9Fo`d%Fm=Gi`>6|K zlm{$mYv|C7HQMhF!R{{UXNE12Uv^K*;C=#)leEvOC5|Z>2w6+Y3jO`@`=Zfz?9SL( z;?mT-6Eh-K)|#3-THZC6qU&y%0dDhj7M3kE-;M;7r>`*Onfap6Tow^FXNj+l=!6bS zoM`y{$c7Sx00*6fFu8;oK!#_S_qf!VY+ZFV)oLKT%c3?!{-xYTDzXDWlP_P3Ipq*c zms$K0ZcL-1BYPJ0GZXfg^_sL$C8`Qo;n)FDUp&SLv_g$&|Mn5U-i74p4RF26Fv)<+ zM$SGI4L#O)OB~0qzXim5I0^=?x}j^MFcEc3Dr~46j-3ZwU6t``#rI@askzo^s|7cV zo&H;~h?IzDj_8@y6#@bLVeEg_UVUJh7tiF&fBA(3v)z;++Y|4z*cHJi!e5TPu@&mC z-6TGq9?tw>a1-dr>Hr-!Z5p02Gm@7SZBzdjU+*2%RQ#>|qKGIWNQnYc6qJ$(ihy(w zk=`L8(xpq2-kXTDh#*a>^n`>ELT}O`6anc~rMJ*aDAK&!-#KUIy?4%g{|Ljt#sOz% zKi{?1vp&yGx|WHAK$c^}WtINAmohI8e*uMixmj?_1&b~7uok7-uM6A!po^x%&920u zU+1E`vL6Aa`leuI7Raon!0=x8m$@;KGokSve3;CGigNv1K5JyKF&|4vpM@Uk<(Z1{|i*2yo96Kkat*jDcKj;x(~@&V*hih%(7Ydc*eG^Hs18rQZ;pWj5wE zz3=6UOtD=DTW_HcWFxu1EYk*W*&uJZb`={eR7icV?MzMM)FCL}UkEXL!AecWH~)mf zt%ogVWu#Ai@U}lRQ;rRytPnFY$9w{p>|oXF3+Uax=Qr|x1{7$?odrZ-cd)wkQSZKO zAkNhJy@HP}e)=(OstjWV>yF*a@j@4Us`n0YH{Yk044n)<7K(e>O2Lx|-ee4X z*!(4<(Zh68~AmMOfWaH}NC>Z{NyrlC-Iq7KvUPz54XCsCx{;VY>$-1Ukl3Un2p z2)dy}@MtZa(PGlIBD~ZaDo)}|fwHU@7?bQQdY9#fkuMb?&ruR1)Jfx1Ut{&ddGmXS z+D~CaHR!Ic;wf0He$0bD;0Ki~4XM9=(zn_)8Chd*pq5if=1_fCfCN|{Vab4fE@xw~ zNY}N)9$d5j3+81y|7~?d+7E>2tyzT9+%!H!GkFzHl#e0xN{xs*Z_Nqniel&qEBFiB z9M$Z;UhrtcCZRkc3K2ID1O5uaKd`D)(iOwsJ>x!h-+d%}vQ#ipd7EPwc*@-t2ks<| zJ9i(l_cpzN%w06Nt z(Ht+NuaOS%@8&sZT~aDm6x`H$oNJcatt-~-D`c6koIzV%heb{(cFhjW2kKwPA4kmD zE1=dQmIEd4^S`AH<|VzCCtl!UkF-SotYZw!R_mfq6!BNSRD1of_`(dg%!?`f?#Dsw z>T1Eax;w_wy~l1~u|Z~B%e!JKLtgR1^zI`pHOb@+?rH)OEEUO2v*Sr!KNMq%CG*w| zOH58!7Px9URhvM4BIIARCD$E(c^4zb{*p0u_xTpxft5P@A}SeOM)M{Pdid3%lHUV|E+&}BvB}zPvK8Smn>YalYk3fedF+7ow@bE z*nEA2gpVwHC+lmLC1Hjz03Z}Oc8&bj9fpls9Px^3mR*^zVh3=d^DjS!Hh%j?8%6EH zyuLrKwd=pT4|ld);AZ-Ro!_k&p&STHHnIXjUC!j)-<83gQ2`otq36cPpztPXM=6_0 z4r#ALb`jzie0+z?{D!A)ftX`p14d=%FIfksoM5Pd8x}pQnBYnbe4v3dHOB}22x1wf zE3T(36e;?uP`UjhOYZ4e+r<@}DcpSFvTNn8X(-ZX`X$#2o^2L8aKVUM8r~AkqzZGM zZwWSycz;~pocU-+q^oLII^pM4F%_jgpkk=yJS!l!92V>Nh#XxcEPV7|7abN6R>K;E zPu@?G&!c@&fY_&H3AhGO|FR5^&G)*G(lx!-fulO>MdZwLf4CQeWcgw{#Fqq+%Y0r< z-^lJyYz0fYMp-jk{Iln+`R%q#4futM` z!ylU0K!Fm7RrRg>zHgS{pmDnb3RmO6rYmq5DpL;h6+S?6*;@^y-C1a-Y@0$hYz2F1 zPEwxUY&omD03D`%ZU!yFS2~gfep=(p8`&Iq40hTd{;;Y(9}aE~+P;uP9RIl2x>|^r zKap*X9zSxXd<+8){-#RafQ@Hn=l{3YzwOHZOz5S;J9id=GX(Z2Fk;Dg4oqcM zpEK&{)V46;2GUC(@;>lDheo?=0nZP50gy0|&8E1kW2FnYas85+>9-lv{~V&r_(Z7= z-ZZG`mOk5^O0OUB52JX8H~d)gr`tPoq<1;J#!@();5QP{EAx2=Xr~MZVkdI%74CTx zR434Px5n}EIT>ja;aHUp`#xYII+4SGDC2E1L_U!$hyV6Jf!TsK29>f*m^CF3IpDGM z;+xPUhhJ^YyX$T8{GEP<=l1J(`}~Ep!<|8?!a6$f1rSL3WEe7;!w?tt+*gDvgBl83 z8;n7bznXQ`9!|$SYv2`l&(eAMzZxS*)n`KKtBhk}L``&a_b-RCMD+-U5bdFa1QnB# zm)#^PUR1T}2%!|0VTp(VwwH>YaWG{(Pdua@HFZ z3i^|<8+^F8>mA8ra(7OhQlVVjtnxc(>z5yTi4zzDq!Z2jTQ2S{*ZxXq)vJ(AC4w%3 zqJ+{K1-{BgW#!A#UkIH&J65th#IxGF{#0%g{K>N|02D875C1eVypwj==b4|`Tw2It zNcCt6e-iw9k|TNZW|dk8d*>E_aJWPrxIWjQrZeK1PV|)4^%Zz)D;{s~>KgzSv5Vz7 zfr)&SrU-`b1cyw@7}(bkHVb|6o_X;l$Gv13x}#Ag#pDRqNJRRMd0ycQh!y zcrt4&o$n9lr+g?$7nTYxhYVRtK^JKb=sJ7~58HrPS4#U>JCHP^zjVY8$*=VyFSL4rk23ohgLJTe$X#Pd*~I*l@F!BORol<1+nw5r9Hr1=WwKrnq{p&wK1g z;_E%!IY8uF0++>r*QpWjq7fuJ^&?&=-_uRt$WdV3g?1Rs6Z+XU0)Dc9KopC0a$?1n zzj1E(c`U-sL)9@|U1&%yHR(Sqf0n2#gX+7_^lM^)b_r#@&~CLVhoe==xYNR<9oiDj zcE5%^`QyO(>It41G%>Q%Yay~=YrxOybVs%DqW(RO_lH!OAx8}RqaA$Y+4Xry)(s!j zBsHxr?`u!I2Qfw+LY8Gv< zpIdb#(;e#d&v8eN<6qm{5tG$*tgsAEyUZ-$&m|WbowT>IOxuI_PpvvRAI?%~usa!2 zR=u*H=oFcunm z#ebdOHoMOS)|S_g`5=>0vP(yHb97=7ka(K4Kk+?=T&&|Jwz$t^SL>w|uggS0TJwlK zvUG9N-@ZZ!Wi8Pl^VMd$Kk)BkhI7*E#bx7KtmFOjWup_ZK-b|QEEZ8M=F#d;lQcsN z0t1TunRM>+UcC57WBey@>M&zYg1oWV!R8#A#?8AYy&m0|X4y@QlbFNK;qJC8h14~; zzucvy@`eLhC6$#CSLXvA7PPLc{w2HpD7eD$yOBfOQL}v7wYbM znI?tJgc7nQW2U-Sc4k#l4z&-EO+F(h{Mbtwi>*fP3Va1HIayrXLhyx6gWZK_59}a( zf@|ST?_||Ff=Jr0KrG$k!Fi0SUuRUw{K|tNPWjJIY9RsfHG=O|@{zvCJ|fmCovHu> zRD6cV^40NOyuuDU%A=p&;5T~|IF#g^_^(+|S|N>M*OAqmEeampWh^`l4)5QQnaWLI zn*Y)S;P@{8|5oE8|E0Mys+~I{faao}1EY}qeR)!G4>^&j1aVif$Ls)wObeJ?K(k?)8))us-U*;Tia7@}E6Dms~orc2~}NvzbP zO02IBvAtr2#o~Q_BXr%m+#c^SVhcn=H(;Hy6&Sxl z20r*PT|$YHGx9NWr)WCVWxV|7T6reu2)^w&{MI^r`gYCNB(7-d)JT}NWW3MiMz&+Z zsiTij%e={*xgmjSv;ed}o}WuvBF36)(53N!lp)$Wu`z@%Z600@et+Q46$^?+zK|Ma zi!H5Jm^Y(6R#QnZ*_B>=cH5OU%`SyA)_g6HY`IBXM(|=rD!~amVq84(r{GXT!DLGLzDjCCwyIWYyxX z;bm}&!n#>)k-A;Wi?lM6+h1fvL78RmTPf{JO8sDj571ojQs$Fg2b+!jQg=k60^Ezr zK`KMv3vn-lIDiejlQLC1~Uzb{NqzFTon$L4sVG z(5qspU>M7|rB74a|Hufu0lN2b3P-`6$puO;aPHek7l%ObC9`gz~vd8>ToTb|6OO7DzUL?3Ybbbjm>d8?vmlV@^zc zg%)8}hvjA_u{klPwU#URfi1E}UeXzL*g8pc$1$=MN_k-!hq3`Eu9qIpB1hc=-E{?) zD@afTlzP2DXrSN~N{+F$7G(9#Z{)%2`MMmTkv!ufB}>>>@ID}x#SV2z@{>8xJe{Wt zMEwkJbOUxEPy5hi6hYHaSj#kzF9R~Yp`Lifj9BlRuZo%vKsw`Jer%=YKqNIA#ZQB&XH1)>@~27x3|i5d z04wZ6LF-QF{3lKhV3s#NhKYZD^hHMf!NHQ)70ZzbN|7d{S+|`;AA=KEj&c~Z&#D%u z*D>I+*dP^&QP7l%m!%vt4puEGJH%HtIX1oD@d<{-F5LN$eI4cS^pE#W$CIj~z8^c3 zmnCEJN|L#b2?5|@N%+1O&vgkAHt@tWbNypFgwEXSpt2 z+9;d5UVm7J*ynLr7b7`Np(-l2qLBF$(Ak{gs!sS1ar}*nky6Ck#(~tOP*Yfds5_7P z(KmirUUQJN5CK@QE$w2)-yW*B1~`g`0Z5y7Bo)SIvcIJjoG0ueV%=7d*0{ zfo#COHDDdAVDrA>ZuZE|uYl`ngPOvqgu5C4r)Ct+@=Lx1hsCkC;c1NssX8P;>tV%U zStHc~XeTzj(t>K=?B%hZK6p(I-|rr9^@|vn4k4X`xt^Ie;_P|my&=7~S%q71u%Hch z&v@C_L3^<;0wG-sv#w@uv{0Q3+vLBGUoZ4SRt&SY`k1~0<1=H-p~&w0_gAlh{X<9m zgFprXg5R^sGk1rV29A5zsnBD~;X@*?i6%D_Xl}Z@uums_vvEZnPIoY-5)Jh@%9Bpu z3I$!=Pk{YNY34m-U{jLEm%d5@qs;Bt>TY}g%!t*iNgj_YzBvs3CF8eHJZr`tw4X`T zotlL@MlI&1{3Y8?h+Q(N3^Fmzdi2YmW4zWW*dd}oug>frF(Pj2|F*#t{CD)f1XETv z+`0xZ4A28t+K~Z;YTdneVDd4PG?=C`CxalIs7q(!Q6}U8KE9RV1tb1lx*=crZN-ALYwh!??%Fa_U+GXJLWJ(9n&8iIfegzlg+tS^^gcL z5uId2;{qZi9FR{gOmwboNmrp;v4cV~D+0@jINa%)$K6PMn^~E;ju?+~g+A15ZRmYE zu!q&FP2e28V>(*64t<~wZ;FVC_+*&+d>7VlSjjnRngK7@D6p{V#kV zaYFAdijOo+%lXajd3O#jj0waBVNKi1ikxAQVLub7=4n6bIn1!;zu)#_W{2)b>Dy~~ zWwP}_sR-zi6l?y;1Gfc1kJYwJY?(BC0{)}vj;vi)1P2wp+I7^$@F>*P)=>@|OvIi~ zbXJ?$1E|uKP0xiHwnufcVci3y@jqUzGfi=R0ejJ}{kdf-ciX2OdkucLxtk5tbIb+; z!0x2vy~m>$AGeiO#H%^ry7rgjLMeXej+_ho0 z#y*IPIWOS|=j_>_7j;}A=#y8|OjKo(A+O`yeZeoKudnPe{w3RdOl#mt>!NgaDY&D) zd0Ns_gf1iVpu!D%rampMwJ$Vc*6IChy;=<+>AHs953)^L5ja!8m{zT)np~i2ImAwe zqGEAQYLAdN;|8hAGQ1RfOjSE^ini`!&*5z?5SYbKKP ztGUOCbehxP$k%qKk!bt&(+6*^^UV=#DW%t7!K&%Zs&PJmM50)|G4kxA0%=c^IGZ1M zV8{_gtk9%%l*O!8+*HPOHgL%T5=g`;O;mmqv0*o(`aY3fLf`AMA76GTL89Dc0|Kau zHZ@;SZGnymvAThuL#{zlVrxJEVe>!lS*J=GSNPoiwks}2}3NZ zElyG23R44__#-0UDHxy)Tun++*L2Y^bcQ!pKym~&si`lWA+4Jia{vp!X==S;k1ZgY zeiCQ@O%-O#8VD|b>;ylB`oVvgRTZ?|UoeZf4a{Unk=6DxcXe(a4)&(GS5v!)pGrl@boH6V z9EZj`eMD8w3}0MoNt*+y2K0CY=@oq~^bFR7h=pvZVw zSg@*<7#p=W)9hHHUffWv&$2Z5Opn#&jrbBxr^!uVvzyS+=c=QXHXObfQ^C52@~%4i zN(Q8eS7#oqeEzkpHQ+__+ev|O+MeP{MH@VS}C0sdJd z>wKagI}v3s>&@Muq&Ol0RG@|?Ti5VfgZNm`ti?`2mgzH@^qoWG_vrCK8TyeUC*$$X zX^sXmT;QcS4S5O|hq>|qx_Jxzg6Uw|gNXM&zgX#_{o(Ov<~t{E*d^;6tbaNO-QIir z{Nd?rAS=gEWjzDh?E}kp&@;O>y&cokdF2kn4$HSI7pc8Zn-cKrW|=xcowvV9%XaO! z3m2Nt#O=SlGWNUNg~I&Bv$XN**Vpi98NUw|lIL_gvwpiKCbg2~MC02@0^@onBLVCX zRa*Vnk}i8^h7H=#Y8mgaX^uZjK#btP)dq`yPtG6fYCrWRI{uRN!t3EHsTJa`^hyW# zYx*lacCwJbAHWzEo)LHtkTbIX<#p-bwk}W+UdYOZ{r6}W_xjzxwrqIw{aL8mSibW& zZNwn6Mi{rNnu3>};jNeF_Ci31_H9M03#9Ib9`nCOZUb03o@ZSh`L?2C*44CG6F?~AL@qH6Yf=TPNu|1p0&kotbg?qqNC zGW051wGt1W9ebAJYl~{N9kGd-7FioAk^55xnQ0|_YVKWlfR#6mc0~kC*9%^(H!Zl z_PC?#n7aRyTeM`Q`pZCurrF{^UB7)5GqSa&syWL~42lTBbtyvZ;>Xyr`hJ7+;vi1@ z*T{wupjWgq{g9GlTV{L7%=g{SM{&$sA6~zvz1m%|?K^I1!EMV~`A$IQjawEvnL*y^ zdgk00u}*ypkkY&hq_y4}I8h7i_(}2ko+I5de4kkc%Y+>(oUQK*nH=Y!k3Ur(hhO-& z`m1q00Z24Kt7jB$dp-#-xM+M1@dIVfSMOiVe5z@xrf>vUia4&P9`_+KQzTd$oz2=5 z{$$AoD4iDt-9JvXD%lxed6?&Vno#G(zDL)2c7+xf5QrApByGEUY;twE^|pWE8A<3q zb0`a@JBInXbP^E-JcxkX5`_C_&+$`Fjf-P0v-eZVC;2`e#{e0;k^9uff7X9Dt)qGt zUFZ!|h}w6RSS`L81endX962Fncb>>1t@;*ZZ^UqxITQYpos5z^)-BjGVt2&z;0%vT z+-)X1?VTro4i)z-XfV05rEtJy=M099hsKYc^kQ{2JX@2z4{zql-@54fOZMPI*Y~AY zQFnk%@cU~Kb6M*K+Y2|^j&6&baE`xp@jPWydyJo0^`ccxdY#(1CU`=%@Nm})?PK6d zYQBJ_i$;oE4>~IfW|##s2G{7xk;ZL~%+hENd}Z z6t&~jU($Y&9_%I&O1a0F7!UcG++@7Fu~#jVLEH5j&bN#~{lQMvVXR5> zq^NN%{tsTtlcH`6@%BQpIBVbBggz3%)BgsW8ciH>1&@22=CAMaS$CVU;j;vHWWreN z)ABZQE!vn%7>`u;?&S7tXvn#PsBZz~0mk*=u&_76=dD=LF26E+PJ7=luzy+*MLC24 zMEu;|mo5==r)?zUlqwrX)TKNq`YOb%D@=Ye47^o!fF;AYSL~G^bE6;LxO0g!A6^*J zg^{B~y4Nt(B+H+SATE+#3X+3>SX-57Omb)p=>!e15MZSww2LBrh?p1#7J|M6yye}$ zr-pv|$Ohydcls6K0L;Pn_JsGes)p}aq0K8u_0Kl|!-&Seht$G7PV<-~c1h?Wxegs- z^<&9!sd2O}wD+l?_P9ES{6L;$E)N?)QBe`xAw-ZHMr;&t4Yl>>7)|8>LTlGSWB)D2 z-DG5P!+Zrp9&=#Q=~o3@TFMMs)rs4hL+QS)ym5dP0CPSSH2r$pzsBy6w`K!eX%dvA z6HW^v>cx@7?2;y418pkHq2dO(>vV&J?!ZyWFyASZG8B=S3wUdxR{j&dZ=e9g6QBjW zl^oSK4g^fQ{qD4!JgmR~$q@+YLO}+k5ssl#*acP?;!~&J^kezPk6i!OqyAGd>pkNM zD{(bJg-S;^+N2k@mrwpy9MEEj#u7L;Jh=uioHZ~p5xm{AZgM|(Lh2lse)@+m(L-#p z1heSin~#HTovDllahSvt3wkbM`2deaRoTtMJ=^Hzr{uv^I8#eAOjC74+uS?{`5S=m zP_f!lGsNc6GcS>D_rodUROy-JAw8|?85Rg^J{yc_>7g}*S`VKn5thZ^n#j7_K<07} z4^o$QT?-)cb-B8wMe$YpGUDQUUcj)qwkVX`1;P#T0LietQ&C-N^93rTb@IrJZ~Aokv8~HqX#xT+7z? zouH|$ou>&uavUHl4|a-WVyu0{T8hUtzjX+jDp-1m6_2%Uqkst12fm{@mQ%vmA4$Y1 zk!fXuk7BZSG`wK-C#K-M#+orJG-`9#bWm*&TqZJ@0Fk_B;0(=Ivy-WBp`kkxYI^0D0`_a3(T z`l38@_TFb%1LF$;@@kVkUp>xgFKd{^9msG*hIVa1RLQGB6iW$qejiROW1Nsa!P`GU z7m3F;1pnQn(ZM|u($*4P;&u)HqDnGP{}8nN%z2-BJcsD^wz_!}Mrp^Pl>l2RiX+9g z+`!dU5^68RfV6;sI5Ty4*UYuz`qJ3Ahf07Wwo%(_F29(}l?*+Iavt+r#*CGzFA1RE zD)cY>Mx3JcE)qMqn2M()Q=Wo(^YNPTbl2B)#5Z-JT4N1{YVzXI`AnN~MD1`cq`xqY zH>aO*TBt8Z!9Ve4ZVx%~v1Sq(aPWtfn=apVx6;IA@*S8Km?mw_Y0MLV+kdK!pC48BfXQSP5?Wsw?y<<)5VXHccAJ{urzc*u(Wa4|W1Y~o>5AnVI2-#|m4q7&5M`4wO zwlUgfM0=Jn{uE9v8a#7JaNDfTMfAPzmNQ6S`24HrVF4;r&HKox_YC_{%A~ujV|D*j z_2WjHkzZ4opXr6t`bw1VcLP2N;VOn?0Qx9w*X%B6)Z-hA70*(Ndi~-6so#*VOsh*QJqq`1^`N%r~|Rd zGTukIs{(^}Rc+Uy93Z7c#F}^FJpn||?y5WH_Nf^-k+*-G3=<6DLIi?}o;|{AR~u$5 zNI?NWZ{*!UD;UE8#;)ioq>2)wF`1NweBQ=cl$k`~J!Ff2j@PF9CtE?4GYXl9%p1_p zo`nZCng@mrVB6Y=uZY!RmT%nVZ@@91y*bx2Xhl6_(81)j#icP z7brz;#0cqgAYUjd0_n_LGp%Li=Tk-J;6Y}l!rrHlK~%p3Eho#nXqL=8Kr+RIerA6! zdSd_Vv=VZF@&af)gZbY{I>QJE>Mq;hzn1aW>tRMAg-8|VmZCL&s;DtGa@F0Humi0K zzwI;M^)K-T%E8~3skvfb;3{I(;rmDPH@Wn7rmKDDHl3cCPG~)>Y&}uC!5H9A|5O@# zw4h$|q_X#e(2DwpWIaFWveSxX?d+Xw53M(SJwRO&hg!K$( zgRDXwF~RgM$~fbn#*K?{rOjcU@47jio5jABRwwM5bOnFLGs$;AA|7G; zUa&{*tlR0NjrE%>M?IE#wQcJA_IH@)l=|rdy`gW&U!zy|MrsopLOm3lD2|dz(v($fWUaX3#l8-81Nf#ovJ9P{qazw#?VvomjHzy z~@oSKI7H`A{mn=2wW4lsqcI~>OHs|3F+Iz>Z8AS5()B9GzA z+ZI)(7>b9WP4hvWq$pT}-GM1mGX)<^6@ymGd5e@MSk9~&27R&=z+ko5aJahUF9xqT zIb$|D-$C|H58s_PSO-hC&Rlubnvu8mqe;l?FPWm^EUgNw`xzw0;lPcJhop{$ND!- zmUBc+@Czm7@$-Uae3$d5;3_Qw2cq$9f}QLk`{!RbBt^kL8tREP-V4Wyqnqy`i<@x6 z5fT4MPc}u{noO^m2l0a5UI#Xg@j;d0d)^`!VLr~YG+J@IV}%Ws)`$5OW^*w;q_zsJgPq?!dP^D3b*fp43;)c02JP4fqbc?T1=9`viLmq zTg-vM(gvi8QCD& z6+;Wi7efg!L)8ym6dqs|Ho<&DJ0YDvNjk_)?POfy%~8&|&z|V$O6{6Wb%6O;nD0dO zFz?}$ZkQXNC>oTT`^oZoiB+GFZ{fuoly7B0i7-^h*%u)CYxfY8mJ!I8NQFB`BKO7D zp#g(RY2fpC$VBp+Len>SeT@DO*xQ?G(Z5DtieaRBUDG0zvur;4_wfcB7A&8R03mK3 zQHRP^#geXCH1?=DHG?|dh?g}SV<;N?cfhVHK)@vo36qoSQgWh!7ODc!Y{rhTHJ;>Nol%?36qy~FyfKd})~8m_?`L+P?!v?xhMkOia{X-efOJv7u+CG3?3HVJtNs&CU1m5~LW5yYCF~^a;C|`W zoPlAEd8i(6==`?IAupe!(h0h05CrI!1W!YR6;O&5E7E{l*0n{a@h?(0=e~F11RFP% z+tQr;pjr+z&;Uyjkfsud!lRjlDZ9-iJmr6Yf~(UU%Y*=BW`R1BF8*pfLd&9$iGvcc z7dzF|lGiy?K6<`X=3Kv1k1ZsuFQWIhBF;}77p59ygoZ&AZysAqHl`NdiytDgT>ngZ zgVc?d-A*v$Ao$vjxx`19X63jc62-MvjH6j~;dZ+WEuu{~&pffmG=IrtY~s8h7HjQt zvI1?o9WjLLg0V@k6bG#?&C?}w)$440yxH$x0}3-SJE|IIH1v?;Bjx}Likmtahp3O?+WD3eF-tCmh2UjLkkAu}5?+SOF7}ia`AKnKUNkqHO9-?Ahh#N~;bljQFCaH9 ziNWal_{XivfFZkVygO+7oh@l^T;~Q2yfbx?$e$JB(c&eq!+1<&gGKYbQnWuyz4k{6+QtuM6!? zOYHo*8XY1_I1|{fHS#hN2%Xj(h5Z89f%~xO=VEwd!OO_un!^B?(w98%evnT7ZrwYH#f3wq(Bx-Z}g0X6dkfp++`MNop&K%8H3){p|FTao_w!(60 z&*5CJ;att3l@QpJYFO47wjybiiA@{z>an&kFrpDU8ByrBpA!C&qVwpE$o2Rf{+LPt z0Sw6%j!79*E_sy}4bXCtXhYRWT?x?Bxn$6tG<(#7dKZpS!&14-dOmeI4PUQE9a{M& z+kxfb*X8sCnACT>&xa^X+9~~(hLGE+tPp#mFR+L=@kvMEt)VEt&dj!2Q?yO2g{+my zuZp$o2Lwsqyordi$5w+0(9o0Nwv`4OV#0=6dY_oePb7?9uZ>)#xo=1Sa8+{lKJ5kFp`3Hxwsma zMfLFB3F+iS>i0qArwa5!4JzDKrEk3Phb4)Fls!S#65~>F{SODqA~Ikf#6%4IM)TR$ zV{93Ft`qeH#JW&8a(;Uu9HII4Vs_{_|y>K}#Ds$A1zBb07 z7iQX8Ku*pG3`1RX9r)BrJH_8!Az|J%6UZz>^uU*1eb*PHU}8MsQ-plc<HksR@*S_0Ls6{jb|M;gVX$Ne+QWOaZTmJfHz}7!&5+8D&;=Y zg#ttLvKc=td*wi^W;$0;5=ecec+xwDI!9Jgojxc2{_|NLyss zV9_%fiu1;^n}@-mH#3Yy2}g#bO%uhDs{%!xU0UB-XO5SG0v1@|Ti%_IFUt~S-y4pH z;kf8$rm{yIDVarYXIHiSB{Sjr&9Pt>{+EpFo%YhJ%LNmAvZ@zu^TthU6Wwx-2THv* zByoFpk9)Zp+6X5frFh_1A(N7|)FVgWRB3oG@7yC{1(l&=KGFnDoSXpn;!}$%9IEqj zt+Lgo;f`ALB{_nA>g1GG3N}=tK1->k~H+Q%oX-EAxOwPVLEcH=s$MyM-hi!`+&bQBzWJEdGSEfuU zzx|1C+&DJzj^dJ4JzL&USZ1bi*xC-OZjuTP3sNB*KmJ`lU)p_hmV$@9 z(TXA~Uhc37pEIGk#>JsC6r~H}tKrDo`62_gW{I2T7b4LkItN6A$2^RjG-v`=TVzcm z4seLGc^%h)q6E1mK!)jXkYsOyeR)?`|-bpBmAFmc(jl~opqu7W0l-m zauvFV^YL|W@@@fJ1nxuG#ShQj_9WS6hef~@yZv7UV?tKBtr)ojNQ=%;vWz{xm-0fK zgQ6ih4ST8uTw&XS6Ra1RL#bua|Kf&eGV{~bsqtPM9WgZN5rQ}!rVf#Kd%d-~ifwmy zw`CRU&s*MJYp;N{j+1b*%S}~5F*8a4T`6_i`-b^N@3X^9=L%U8UgIy>ja^9l3})tW zPu8|X&!2$gqo&6uIG+N7-^xeN^iRRli+$Q1MdQzgwRr95P)fWE0_6@E`@C-$Jb6_< z`SE}R4Am0#a;2BZ5vV|kH6c9|Q%9*D;2yp(;{x4%CNXmJG18+oZjwr$ z`w_*9p%a)_e9j|>oad{bIQ8T61pJ{7JAphVF2pGC6?(U3sEr&fO&$1ZH?V0JH^`#T z&+HGi(Q3tR3Aa99H!QS4NJmAdqLQTx=@%-6d~q-c3-8m8c^}lMv(R++8f3g&^H!fxN=kNm561UwgA>k#GKYX zyMPl{pktuHI;8)I1`GgLvS+E5&~DJOM|e5?CSua4uXrg-eDY7hb0+PkMpZWP^i8y+{DE3(aA02 zIOl89#R~2Nm@)&M5M?aF(^}j^Z0QMmk{Fo>s&E0Pd{q;YmC@`*bHIO(i3wT64ZMr= z6@d>CA#f&^j%T+rsKOI7MjR)ASP~0|YsN~_g%W%cRBIo!6f+(biNuJ3XaV>#I%5GC z`Y;UVXtrJN?t9)T8%^JIY;~~KA&44xSVGh zVj9MqImXU*%^n*#Rq`8Lo;ga?Q~DMW^8t2gT@RSr0HsFW&+IBllQ;p6F+(bthCT34 z@p$o1CUi4_@`d2X*l!U>eu!RELaz_!`a|h1F^Ltf;0&A_U=y#$R`M=IAm#Lc&YMTx zK*0dewEMO84(P+PAnI9a>Dpl6s;>^2r7jXCEV~=ULvKznlv7PC!FDs@A9tD-XbSQt zl&UqFWT&1{vijb6P%8KH$jw>ZiwwTONa;XsCKEJ1LlZnFbFA1XFuX8>K89BOC3~!2 zns9k8cr)|1&IOTeeeZ|V_di7N?zC)Nj6?WgV#R8ZEYz`qVDM(g1q?omJkD(Z@fnlQ zXrNQVd+EE^Na6HYHgt?nnP?a7HSFsgUou5l!9Xro& zW{2b^NFfG?I&)uXA+|}_7)40;2C5tM+b&rOvHf1g`wkne$G}!qoaxG3`ZS!o(Pr>% zE$eudkJ}M-r5iG5w>Fv;Si{ zOlJ&lH^J;ZntBD%Kno%%k}}cjB-_g{XTR-B6O(M%9~D(?wDu%QF@l4V`$ic{T16mi z$I|drKkixdO1jr{=y}BYAC48%VKbJqC*z8-^Zs6+=f#6PfRpxYkP_$+7NGANe(1S9 zm^J!~BGo_Oa_BTmKwWV1KOW(3f7Soq+4}EYx&P9U|FUCDr%=3@@k2_{fT;$e!T{&3 zN8IO5q7D>b^ud0D27XvM6Vr`MRDqmp29`@K(Dt9SAFc0c3&easq09Nlgq&X_`{09M0E4c>GRbr@_@$; zRK^b8g$hZSMQYa-WlCjW6vZyfi*ISV?NeZ|`?l6|o-Jr@t9bjt(;i4xYRZxHyA85g z>PyY|&Bu94gPSXrTwhmiRo#}Q4qjO>JGEG!dAl+<&3hboaIL=SGNA59!QY$u_Y4nt z*Z*nJn)}*G{r_mu((j*G!2{W3^LJ#$uCdHWn=ShyJRulO;_cvjLDlUcn>5r|~S{ zP>uZapu6zXJ;u(@m!LpN@>?@%bvRpj4`v(uJ-ni?2w!WMTIqL|ZDU;6rT(DYO*x=c0%O~ zBauNCC8%A#`VdsI?@0-WF5z+=m-?t&d_1M0xoZr#Hdr+(E7JkS=uAZs%CBfV8n~RE zFYdZx!z3G3YM9S>HVKP<0!ee6Lw7S; zjpmykFgi@(6;p~?;-yZ?Iam&{krnNlqn>b3r>Nxa+Yfo=%_|u)U3J+hlzx0;Ab`9_;P^C6*%9~u)^hYI6gWfR|sC>kU_wO32YPMv(>JqFz1z3)^@buto_^GBTqdA5E%j4JEd4y$$ zDKdZTtvq1h7Ig9R;%c57?KT=uc-s;oKX3})KXiEKW51Q~vmj^Jp!mkb$gmB(LkyL4 zwJ0tQ5s3kGn{1>e5>`VbSZEZILN@B-yO8z$1UuLrlDH{&gK4wlCZ|D3AU zk~{e|hWdW0AJ4h=n}Z`|Sf+d@CMQDA%;xObXjRXD)ML&`-rVqHeC`5Q_Ht#Yo_d9% z?`lwR>X59x%%%05G_if6X~OBNW0&7V7TQ>+aY=c*{j9U7I~TpObY}O?uI(}*)-Gj= z;fDkD+6K=wj*T$K3Qug(IG#>q4iom3V%sg6J{^xmjO_D{5l}x1=HA4 zRtrqyDySD*ns5)Zp`>%n4*tbFbsevNmrmg;``0!EiCK1(i*^gK|66t&=f?o7=YFuA zsz9AD2AZls)W3YUWPOKe0UddNsEot=_>JrK_pXxvC9AI&2?}mMy%{LKBWt|RSv!y~ zlb|T8c#+iBo?>b*wVrc|k6+ru*G1}7=z6APye@{@Bf8sp#`!7{|~<( z?lo}qg1@|V^X=_i5Eltu2=sL`M=Ic+!g34;=zdk#AHG0M?ll~h*oDqTkche0GX5W~ z-aDS^`0XDT87ZNhvK30s(J-@Rb7VV?Eh`)=**i)&8CfaW`{0~I9I`i2)-hA|UKt%i z==<`yfA{^k@82KiJPwc3IOn|2b-k|V^&G#^(cApJqq!cTAl(!9+G8ADZ$IzTseL(+ zX*)3E*65CC`-j-RVRn(-`NB{4k*;miknuppgV0(0YtE~+J8|fxU95{Lt?Y3ER}H&O zUHJ_C3T*r0JhGGP%CXH(au>S((GU5P$%fjrE;pLL<%PeWu66w&3qb_2OH-G0_)cSO zAZ4DJ_4~^q-CQR%*p#P(hjLMAA?!I3W!YFqmy?mn(>Ekl*v|Di`p8qBgPg67j60wI zDlh)9i&NH--Ee4XjTA?0?(vR&tg{{dB&ru*20QU@o^iBV>7tK7M{_5rJ0zI!rr3tC z50^kIJU-Uh@FtcOUuxfV+!ZVq>Jdcm^FNwMmx|&|FMino1F6}7k56lW^H0Kf$^$-( z@)R$BZk|m%6Df-+O}tj4_Y>B<8YsFB8U?)1MWHXPQK%T~6w9 zN2IU&f+sx=(9pR~D&Ry3jnCCuQFzwU^Nr>>3hD|E3!D;aV`9;s>Y#Vs0s^Y&Do27N zhkIVcHIZrTgU_3~37RIMIZEMOAct7P0@d z6$7@jXKBY@!#EiK*G3*&PmCz+dHMa?!@v5~caZ?!%1~gx$dnyf1S#{w6tk9#-PWU% z%+`OYZ|Gq{6HkvSiy$E3pWYa=?>QT5B||TJJfneK|N;@>1%zg^#?tp;|d4fHj9KP8~Y{wHS*_9 zpHgL@53XeK0doM)qLNR7EB=-IF#z1+q?Cz8U6(1TO47D|rIxmn8kVt~8l6VFRd{u* ztvMzR721z_JMvWeX#Y3ap3n&ah}q`@Tb)e5`NBqb~9c|KaU{b zBcxX)CC6l}XUyWVuy_2=8E=!Y%n^{; z`P)7%Y!jYaZcq)D34;YL_;Jlig)DVp=&@eYl|bRklh-Yiqa$A~5*p=%3#gSoe&G2> z=H!1wdm>Z4YAD)&=^&&l_fz!OZ9@ zO~f^ivDgT0Cq6g$nt&bd_V+_(Tx^e-yG8nSkJgSyq)D;)Ut@(1)xJEbJ28?r9sc*? z+`r&W5(f^YgRZX9(^<^mKvucTOpLx0pXg3X#1;*ABYOLFepni*Lkk)wA`p1lUg<>s zKyFT$vR&z6e(={o=AB0w#3}R12XrB_U?%YzVvnCKCpMWhlKHj;s=M|Al3vr?H2rUV zuPfsRQ*QPMA-M^k+3oGPc787y?~lUu7n7~3lg1ZLc0;BuA8^KOT2M2$G~j2zO!r27#^Tl-v* zn{Gz45Ma6TtD2gG7mJVGFbt2bvxTgU6ckcZmmg7?qLcYM^B$_M(zL7+-+kUX=fw3R z7*bj9kz%l$d9pBnXkEv8TmU{SaoLDHZ~CjO!?}iRB4=pZ2jUsX`M+=fOR06nTF1_x zaoWroP0oR(3>V77t6-#q`RlX18NDG>X1qdbIj<<&aPq}H+{B%hn7sS~Ir0WcH6=vU z97ll4c4Lgk92bMxt^AlI7l9!;+Q{6*Q;H^elijaOj3Ps2N{@^`#FD>|;3bjK9_yUo z~en5nN8mA&Y>fSK#!IOd#U;;t*H;0oTmZ!)Rf|tK46M;pyuC z$evE9IDQl4^^k_ z{XszZM2)BFtSG9|1#N?Ui*bi}_WkfzWe{TS_*%H2 zI(bPQQ3~+cTwANdg=-ngmi%AGCSL>zz$45bRUWeU$0nP9EGww6U)2H5ub))SB^5uE z15VES-dIY#sNq~IjdQwJv`yen?3ZD_U0EHxw2|c^6EPplur?HG&3-ow0(yne6*&(S z5;H23bPaOM!TGslK@n84{MKd&v|O4Mou|B|qcNUPU}l4kytJbq+DU0A9BUe@o2ah` zoe$N|vls2>8;Fv+`KA5|qTS3xQ*CDyr^@M+kyjcgi+vPBXQ4!<*Tou3$Y=6ijIs-~ zS!Ce|>XUnm10KhcSW^b23_{TLX#M$E#%r=}!qu9ePrY34<7hEQ(wmzE+3G zkII_6d=lD?8_b82(aV8ZK&|zL>hzpXbUH1?X&OXK?eH5J_S^}4%jiL5W zr}kgK@POV&%?{iHb4s8RIN^70+0ba(bSg>}YH>`s(!Rvg4h(}&(b}^If@T#G?+HSr zqM%}TVwM8XWJJFQ-#w<>&+SD}q&Ra?$+I&P8w~pnI<|Hu_J{_0O?ob021>hH5PKvz ze1oF-rO#I3o@nCSA@BzBz5RWTj06PXK{_)oXJWI#u(CCZ2^#We1Tp`D(= z9C$vZsl}PV?_g(QKRbhp;@~NNHelH#ZXxnG*6O_+&vnAyVX)#UJj`>I+3fVKMarX< zxtkVLg6X7cky&PT!;vO3)-SK@+)WuMDv_P@dH%yT<%|EwxEiU(j{~>)_GOwl*{Iw;hH8jkh7?Zj44sbSI@6@0zM3gZ6Ys=OFCozQxBh`587n z=yklKJ#jaVEAsh$7kU>BuS2fr4jHIql|u66R}7DC#J=Ku6<{FH(D5uYb-eg%tnwLY zzE8?P;Byvjhgu%+Q|VApxpNLWtjYs1%#S=C&t}whaQ;z){i`mBUb+d^?^Vt~Q2tWd zSxH0+D{BD~==JBx#!|j(L?c}adS62}bjA-$o$1{MenoOO%(sFhl;q#H<2;|kz8^~j zRN_S^Mh3TQlIiF_2U3?ZFT`aeA3fYQ?bvj5XQW%TOqjYfA|~Wv=^7}wa{;Z^7XSJ8-)lHNsppZ&1c)r@uW^zj#n zDEmNtDmhJTjKD_*Gp+Mz?AWD6KTCL+G_A@EvUL7>H%ZP3$lc~%$DDA?{*s%RVdDDk zedu`&aNlVDzRf}3Im2oH`$qA9wOY7WwSeP&vrioN>O3FzybT%-gF7rUEVJu#5!7|% z%#hjV`O11;r2QwMY8Y5?J`R4Nzy7;$|Jw=Xddq0VG5pee z!s6;fLW90^t;t?LaDTs}<)#h&YEv>vdgb4Jc)#QOT@z_p?zu~{#^JuDii6H|jbD!j zcDH^=?PqIRYs9_$M@EnHF$Qt5T5H1XeGM)HafeUyg2ADH@z9^b@`Ij~)RkfBn48@v zP)Xp%9VoWFes|WaI79zkmvY@YzgObkF(hG-t4-RneebulK{;ePXC*}mO=QjG^C#ZX zwAX&MZkg3$c38_OZ0G#+)9n<9%6ztUQJ#@dU1jmB*OxG=r! z1<;88D9iUQx-b7i8aO>fyi8T!NNNC>wPK$U8qhIpGuYe;(?2X!4O)qsvRVRhG*N zbd`07bD!j(q4Q3c03=LYAxGco%GXFG%gJL*O}6TnH|kM~(&VNz8+j4IZm`OL8D-z5 ze7c5<5GZDVx_4+{x*(1&y{56#6E(LG>=k$>eKmD3F}-0&v{&)5l(;uj%bN}1YS~5I zZz;XVK<%nf!#};f0-aExhO|i*X6j!Z$FuV_m>X>HuX32EmBf1WOJbjk&u>8IZu5WT zFj8Ab>xn}R&YQ7TMM@s&sf3jlFRz+aeCUuszsW#N+=Je-Xv;TM-ZIln(~G}7tRK0n z>b#AzV}`IsrKEm@jO~S0&c2@(i@)TmxelsY5n9nDCuqIP3K=HTJOT&Wclj_oD&L~s9|13JlaGu_~2Me zSM%P)Urx@ar$oJiO;paX&o%n6@YJG3a+tA2Qie)Ay!5D_q4J_TA6}7UqGgvF%G#bF zH4EX}lD#ZYg9XMPkp3T|dqszSz|=u~)#gW=(sBPuRg;|q=>XR#6(~d??|%OkYt&kA zTE~^Tdy8wgqhGiP2->H`4>fFdSLgY=@J%VOkWcLVZ7h33Y#JUin6`q=RV zkhg5Dwo?~R`H#h4WnQpQD-of{-1xpA&X{@R?a_YsnEH=>%=<%udol{aogw#k0ij_| zydvD>O{b2DmnG(K{OeBxC0lEp&^!TY*9G72@1_0rz+JcO%Ml{s9CML->>YA~gchAd zmw#-ih(qVkFqjEdC!KZnJS5jOfOezp%WoJi0_n(igLa*C_)PhkVSh8OxW|kgS^io! zM%)nzyl3_3#QZ>YZZu5o{lmw|)rT(v5ur?9rjieGx2M~w z_~J6*C(H+yb4@}_Q6Gs-iO1@*n`T7mdJZ3Wet%i8_yPI-NLiM+E)(7Wg3LYX$0egq z?%k^+xqrWI##=H>ieH=Y-n0x3l-}|Ap0E6Lz5uqgH9z(DBa3=~Zy<;<2-Z|(TSmt|-FzJLLK?YN=`Hna zS8|eb5xcBz^Y@E9U^+A@k$!Xxi>%xq${Q>>eZqSDy*%g>1qol@cx^hUu0_mt*J|?m z$+qu_pe3v$N#@J&X7*pX*Wz_ZjACsQ_~$PBLjY^;a&X`Op2E%^hy1s~=uy=1J@5-p zC2v}%pb0O*Bg2JiTV=4^CF#DH64ov6#%ROCK*0FbaU0Jf%+{*qgVQ0o%BOF(ueQEu z`Lt}=q;lWl*M9GbJ)e34_fS%|jvBk~nttc?tBJKz zy`X|vuTu`O-0r&i*Ccpow26wOvK{v--&k5Ri0f-Kqy5#8uZCRHa=X1DGpeDM5lEjD z|Cr&Flusg`dO9Y@7eBmTNYLg@>=w1R+__vnH|e_EZgTQ_!D*eehr&^M`m`sgxQ zGy6Fm`OAKyr*ppdXF4rgSQJ`x{*=J`@_>qL-#nKir!k-^fc`NDg8Oq3p)$|6mkG{o!7a4rTZeN2Ro<|I)2rwQ# z=3Rpi@}q=JC+>aQg@rdX32{OjCP|4^OQpsIeEC7w=qc?mB%{Y%P=#LEwY~(nXAC;; zm(!0|cXMQVL`p@+NyV;nc^>G3-i#nvZL%=2@UfE^G?%kA&t|Gv${Y6u7vae*_;I&* z1MEr04FIJImj=2X^A_MuG^j00BlMm-;h5?6-8h zveHtu!fJClU(Ykohw2D67iOSpByg`{i``j4dDWB4SAD!5MjHiknAu|YDxHlvL>o6H z(OEDeuo+6r5}CeNseezn+$eifvxQU=Y%Z?YffN$i&lli=n->!CG(jl4Dw)?#a;VVJ z@|5yATHo*(7gej9D^QZj<8S_k`W?JB($=ctWt?-Rcbja?JteOuhQZ)>FS_ws*PxyX zszS{AXy&d=#-S?Tx%!WJrYboZBDEqfA(?)wr9nKr2IhFmWRtxF=&j6OR7C2%v1O-S z_KWJ!7peJnE1oomy_EqA*jUxN)<&=ru<8;B`sP(dW?g9HK46G{E5pA|19{mle8GBJ zQPfH{S+Xq_depY6&1hZb73*kC`-Xu7+S+A!jSK!>h0=O0ZMPU{bWlQ@W)S)aL+(E& zU7Ys2NaU_o$+%weK12v74(a7LTTH@9Aj>e#UF4~`niLOQ2zyL7-oznqJA8%hc4a(<&|KbKHLFoImEwn!+E=wP0pMH+2^F}LlbD5lg62Mx>hn8d|2X+SO&X*FK#9&cDW~$LE8!{$ zLvIpugmk9YLUR}INv!H1ZFSdX=fG;=q9?|Zm=*jUuYi^*rU^Z=1_X*_CZO&&ACBLc zoqH67qLS%=PkWaD1Jsokhk*AE@%rrhg~N9NgQ9)Es2w=M6?df>{0cy0%}IlsIxk+$ z7(jTy4)vKhZp~qzUoo3eLZXQIw_akX4l?LY27x(TX_*fV99wI|AwMA5YkD#9Y)AV1 z+9K&NBaX^Bm1Tk|+%FFo$%CT-opX5Q^(>%Yp_mp~L?+^)w@Ivg^1Y_f_UO`==sM;T zSYIhgGV4t|?Qk^(*1lb^!?F1RW#Fiop$sj}P_>Rp6}HR2yPAE+)VnR3^`O4fgtL=_ z?ZN#UqbHxX1t-c~BH$}`yYhp5QnghA#u523UvQwPgjZP!^*-LncVJj*mqxJ)hfJDU0anD zn4mJ*5V=+=p?8i0cDQtcYqH~FJncOdG`=g{tJqpwQN3@N^RxVhtCLgovueT6Om!VM z3&n7fxLZ`RV~}CppLbIs+uGf}%V8O8CwSV1zLM%=ig|9a9o^4gdQI&5frrXm+4&@8Cs|@fXs3DBaPm5x=@P@$nUR2@81z#6s(L3+CEt#){hNXTpfmg`fbU-;uDAl zF%XtBc=6n;T064$xs?9aHK%?z)N=X-683HjzHdeyH*UL@A`&x__wCzGd~=|M%|m12EK~z+AdItvvpIv?;B_`H05=Sa}e_Kyxih&T->qgY=dRXDR4td z)iN`(B?59peQBAo(`xvXIEa_q-3UNzH}(XUxV~P@O~c?Tg3nL+HFDNg@|_s8L=2{! zDSDZ{H^SEMzqrnls8h8UE7mm-k7ysphr1Et2E@s$Z`*12t#8{Chjo>MpN1#_pyK}! z*17&$0VN;yAMXxaP(YZ z+KBHA^gEcG%?!1;kk}!)bh{=|(Ab3H_2-WqGV%U(HlbUgmi?;j^pO^P2ibE!@GQPn z^PAVJW8TR?41$K0PnqOf@m9YyJ-OIqMSV-=<6`ZBW%0E2Ke7@+mHzw9Eb7G=xsMNb z9?CqRPMa{!yuW#!uP5$r@AQfkfKUICxd+E`ss4OOzGyLhEvcME{sFQmBAf^mF!N{qtsvpubrDcuCxUdMoes*l$%s(fIuy^**lh|BE zaMX=Cb9=YS(EN-|W)ueomjpNF^dvCApi2)rp(-+K1TT4xC`wQi)pfjZk=!}29|CNS zi=b-4Q50S~gnDW=6j)1V1LKy2YTqa38C||Z?|>fXOmg7}cequZZxZ{h`i9Qhc%M;Z zF1u<58OCt3yBRX1Tp$P>Da<3*7*f6I(H&Po3mbvwwgj?dcC%SNoD1_9z zKP!gym8AY7<6j)@vs6S^Z~v`Uo~yb!z+>4oHc{(Rsw#Tpu_t7C_}kO|dsQyN+;?wJ z$<^lI^3yI%;Qd^*7z9_%gxah8et+XVN){`AR-!qfjUrwn&ALr}I%<=!Lkmme^Er`3 zLg34FtzE|xySF>q+3|}({7M!h*aft7ym9S@rO8v|+s33uH4;{vS9bwz@jZU?d&)xS zfZidZZ~^W1PUg=3x8TVnu>ieSB<7MSBU0{H&ZKlh&XJ^jR__+W`tnsc@cz=4;z>^) zk%8)D5bh{A&Qkj)m_;`C!#}7{-ern53#X8#eNQH-2MyJ`(_L!E!{7LF;E6%8M8R;R z)R^>#uVU(8Lo1XoADX)SRM`JY;S{ErcU>9uf%ApoleDeVo?#T5M#dP_PJn&3W{aHi?fDV?B9 zUVz1g18Jp%u?ddO0PZ`)x+ifq^jEHqW<3`sVTvm_VT}ngwKQS5{t4Nxgp~nRf;>ab zCL;5U-j4NWIO8|Aa#A8~LiNCJ&$6<0WzwX*Zg@=OtZKOeHTA^Se@5NNT@;v}Z;C^} z=xWN@z#QL%icLyOBc8SA1{%hiO&viF{=JI~+7P1ugE)Ece`i_)#2MG**e^FLb(LMt zdnr4Bmu6gl4a~GUItE~GszVR|BsmH(cIT6ChIk9EB6Nb2{cjFImaM%cXDaV?!n7zs zSTkIU(n;ZSM_{9vYHoy~2)5;->9fn{O5c+;LkP}-9f4YQFrM+Y<{#B8F!VHmxm3#P zHKYjz`~8h*!nuEq3QV}lo>f`PVA{Q$Oq{?=;J*p`IRuGa=97Oai1v9?PdD?AEb5f5 z37BV*ce{~dG^J~Dq=n*p)Y-h$ZJb41>q}^Zib=TC0UOBSQzr|Zz(H>(H=b38f#~^e z(d^^K)8Xlghi^ijx^ZP*S{HB=sT=t1Xc9Y6;^Ue}@m5?t=gUC1B zYxCq)Sj+q;3Vt1^A7bKot@s6G)VQ(w%MNdU&+$%JzYFgS7kqu=wluO_IrCw3f&YG- z`yb5!t_VDNGCtF@B#d^f)B))Wg%Q@`-gfEAmTza|DDsK!#f1WbrvyG+S~!?$${#s& zhU_NcWBZ?_4ah1&wDn1G&8$0?_fwD7+fu6z23tt@K1*^ZasHQqb zPQr4Z=5*7ikz*wK3O`lD(O;$V1HudpPciktG=kieU;Fq|jr=ZGZV-^(*^Vt7dP^*R z?l9euxwSgIc*s>a>k^gwb;LQ?)s!&}Im|_73$B$(qW_P7WVa!|*(N3(|0Ebqt5{`F z3xdlxJ?$)ezb68%5_46Tr>WyeF5ez^NVgsFn2A;4iIV<2% z|8x7FkV%Em{~DAZk%KQQ|Ei8*fd}m!oMPvc?6!Sd4BfH%d<>jUs7F@1d;H$~$uNg; z14LeQeepBxcxri@Ro0?}LoUR7+BW`cWcyIA=19pcW*lBA#w7#*4-a#Ht{?5Sniv}^ z4QY!+Twr$)GRk}eJN$K0*yNxYvLCgRovA(TGCL{q$w-l}M{uC`#y_$QoKy(;aqdCI z+CMTv;byqoPCC!FTbOmmblZSzRZ$P3BjAyK(bYyK#Sz$05+}y2gyv>Tm6di0=N|V6+fDAz~(fs~vMb zPgeIZ@BvI5f<7OZR|yI~X;;+NUa1-VDefDAkvb4IiC{4Kp~9=>+hO3%6|Q}gv}usG zkIRcaxEs&Lxu@ALj`_J?92+p^b%!KF>&|VHh~W5)c|U_tm1%$#-`Om@!Y6GYLn#rf z4Y`;x@?DEBNPIlB7h%&2@9h$`sEr@d;sIPgdvRuna0UvqFs6jGsZDbh1To#LVBI{X zo&|W{hESoj9TWNF>(&Ak9m4kcMi4W`MqwFAY@ghJ8W2L_{4))Y4eiZ8rMYy`vy!+ipO`8 z3|stZ>*LQ2AS&MsAo8m5V!nwzm^b_aei$Mrbhnk-q>N`DXKW~57!|cWF!+$#)Z$ z#~%rIJf@<$Lv}7y1B}9X8)WwAv}b~k5nFml>5SJm_3y)DR5Ue>K731-G(bxf+=nMi z4tRWf2f$(b@?If#;=8w=h38g{7#>TyYp6;3>kVr^0c+n+3$=sGg{(10)^+^3-`lzr zuFbe3G7F$>U_r^eFqW^$IZ3njfK&v1dKS%U-2fGo`6lfJE1v_q(fy)0a=^R!^K6jY zm4JwqzyMJnV44yOuL5Klo#W95HNgW;=;mPTOYmGaW(@Pf@MXUaAEIix3J-rAF;l0! z8+QQX8O>*WwFyAwSbzPqm1QbJ8f{o!@Cb)<{12LNVBYgF5A<28vjLdmt%spL_R-4* zV|g!Y$wuu4Hcct&kz3`QYUK4lk(iO?kJf8f(0wL9WWe1eP14@^c zVMC=G88FniozuK9KW8WVk7_QlAXxBtAR)q8qStN06W=dv><}<+;CZe1`8nLXA?99> zswQ8gI(X@a-tKq%3tDn>D|Kif!zTC1YwF~I$+1lqzPkeB8e~YvA)2*RU%el7l6HLk zuTG#)%IxwRnu_`e;Z>7_EI$F)@)yk^Oj@$)xhtzfm(FpPH~{99@iWy~%jCJ=&~cN& zcB{p&ch=(kX85fg>SY|J?i%MFbRAS|=XS|a)&~@U(2@vSXD{=6nh9A_xpuBL@2<}W z3KdOW{bO;N#aK0UzazvLtWn1{yz+xb0Dfs`e!-fsgNtAjiwE3%s8+;Mz{S^HjBpj3 z;6TiSHdu}JZVb*L6(1oQfTcFCde^hxV_*HbI^A32QaJ~n4R5dTKvny3^wpD)S$w3Y z@G+O{h)rJZ5uR_TYLb4zlHuSAPBZEcVpU@{r0`1z;>K@1Ftnvm{Dyw1VCfVzaepXn zsNjiZ?q9VC=gVF~L=8+d3Yu$1f9`O9xA{V*B(EZon!EueG_YN+Ge8Ow3uLs&&NZ8P znY#1w!i#3S3h~|p!v;w=#YOkZxST+#ps@O}!A8bmTA-h1rJJJtZSjw6)@cLcJoYgz z*EjQKOis|qOc2tw&uPPrVr_Y02?(~YW1hbk-M=2Xr*$>;m?wI7c#b430TbTrN zRu+3R=|NamhS!~fmi!0af4_w~jfrqP>I9C^OFyT{32$V_BFYU1#!vF=*;r9knO7^5 zPCBuFOPVF`4m-7l{4n53P1XLsd&TSGYUHey?qT&mGLwdR%`yVWQwP12e5#Dg^$kP$ z>4l-Cs3t0kZT$TM`uv~cMktkiVJ3`F^IAxFZr|(yC#+DQH*L3jwm4Ad(;@hz?#CZh zUz|CtFwu{lXsY2n0nHU1Oahnx|Bny!{{;{JcXMq%F9Va^-S5|`O!!BplYAo#GRd3p zKuMY7dn_5`cU)KIMBQv$^Jg}#;eu1*XwQ<2*huJG`|J;m8~mq#_zny*U^|NQKAVC& zQuEj$)w#NCs`uDh4zV9F=l3f{oOV_x%k$CUCZ{Fa8Y>^$f!S1aaU=d!h^vP2{UaX^ zi3ZQOkA%1{2g@Dbn)qGA?@u8t?VOw1kNkP36I56FyR;AP*uRz*zXkA#7KhwXH!6d* zs}%dzTpY1=*Iv)0_johsbVJWVbvN_s&O4hlZ7`urDmy|}nvg!r zPkclzGES3vPKwjCKcKn6getMjnJg%?R>3K3uC`tfX|w?13ElM(*1o+iT6`dA?E+14 z`-}lD0AVjZSGStmn54$OUu^pa^K%DbneU|+H3{dv!diTqEWB4-8ZhR`IC)-S8EjjD z1i0xj0x3OL>)5_k$e4`ihggAb`7u5--@ApQ+?)nPyB+BzCZ@)Ky_#<>E=^5+UX&6J zd~;XBBNz5fWlCWqtWi_4>#*R(Bg}0D)+mX*RC4y~zWLRcw`7lxxzAu5A zy8`WSN&M1`6?fSdFAF7_k9-j+T>ghvm5y(Uv^rww09){pi2Vkm9!l`E^`F%zvfFwH>3 zIvUuJ(>^1627MIKAcu+_NsNE<;TnDZ9Yy_c*`%3>26gF$bK<#AN;u8$wV=;0AjkQ| z{1I{Y;_ii-Vb5Bkp*O2$Au+6`XV~C?qeCRC&>izOnHu}>2?oxnS-gB#=t`cx`&r90 zEQUO%bsfR21m;c|?dOEt(C5`41=4eE^NY zNQ{D5K#`^o@g9yEjemI?!{DA8TOc2*UdOB+n}dFCBl=Y)*3VTFp38@ZKc5$k=N;Bn zR@w*r0@zJn2(XX>b{*BGm*6k#aViPS)81Kp}h=>ol39mWh3l4h)yM8cz(7i zy+})qI)TE&<3s^X2aKid_W}@x5~9Kx1fbz|m-#781*8>h`7*V`^q^3RXN=s5F5ctG zXwAhdB+*;HQUda)nlsEqqT|s?36?Vn^0sX>F&_e0fA!ZQoVg$DIs)EmnB-h3C=d=V z=g+z%m_@T}=L$^EJy!d|EeC_&2Hif2AQUku`+{Inv1Yg_O>7)!+ zPnY5{erag0{qzBuObG@Md6xt_wO}QmIAA+JcU4E8=nhR>vTnK^GE>A=HXo?7ebT?l zx1G@3J*O$eFtM0iySR5z4N1Nv!WFzUN&StwSAd7T_6C0RqhN>EQ2_IISNBjetq#!O0@h(`m<3k(Uz~2ktQ) zhg;bQ!ObBpdLZPPbZ~Q?>%da((p_5LhwWp$=JL#kA`M#BMqQ`94L^WiRl=_~xt-T{ zshWs=baNY=ekuCj%I@tX92Sn=?+s~lv^n5-id-C~byytfBGHlaQ%pryO29n_WeCraG1D?`mL2$UgERZcEENyIT zifXt<-jdo^;g8cDJWiS}P+rUF_vJe+QnJ9V+X2OH4) zs-D8~8@qD&V$tB*!X8%VNTa#7&D89sezbMN(myhdPnDm8tXmXtMN3PMB>l!|4~}NI zIvZ8CCs$(;+>O-(IF*uFJ}o>-DfeW$cAD5E+&&e1Q{9;)m*vaG!aT>FX-=D@tL$&T zd4`po`(HQe|4PcMzds+hd13p{%uFBmy`~#APS}R9eUT;V{D_3}> zQyjxV>@OG_o05>G^u`qt-Jc*(XF+=tWOh)VA0gz*y*i~zDXaJ!S6n+cr#t;cLC&*j zvut{$qy--vEO|=gVmOs?;@;}G8YyzXCRXct{v?Cl)752Y80L;|I@nYQ>f8M1XwtC{kw*V0}Ujy z`e9jlY_tU2`#_xC4f2sEx0E_B_!t<4?vjbsDAW>KK47p;bT|o=H`VDNn zw2G#Qz(NA<5E@GbEy)QcDAir_3fYmQ`ND5=$)3dXb%)Q4C~MZhx2 ztwrB_4*i$`Z6g)q0+6<1k~3e{_TFM)o+|57!ds)Xi-^ifj zY_HfFO02QhnNOAvl|jMD0P2kB@KAp*VdS7Vm5RR%NnwTq}$l+kDJCnrey?~N?=zA8yJZb(%?utv5xg-up5lJl6GU z<{=d9v?Ts!Kv9iMBZ6Sd%`?e)2Xp-J`GujW-2bqER&}nX#(!j|Mb}=Dy2${VuM@}F zPV?z1cwvuP^W>*;F~d&`5zKQDSxeYkk6w~vZ>*Y$T0|HyT2YfB7FH1q!O4D9&tUBx z8j8gU!vm3q>7TnHAL&r0W8da^{SA&-pBXNGo?-2%`a4qX^2ce;LwF*4;3t7u*L1(3 zgmyaL&4l*&kC=VkYtXC`%|){ool*&FPWhEt*3lhi=V zztBL`h%A$Dp;x<3yhp(_V|e4xBHx$K%w%peT|yuXwb+-oJ9G2b7n{&cOFD3RR+F=t z{cCi5KK_{Bm8&!3>J`hCJQup>bszFTWq7l1&cllfL&fz}iwtd&!{L`Sr8K=@5 zB+2`=! zi5|53w=b$dzPt@$r!d;X(xz?e|B73M>Mx-a0Ompv0eAo7*C+?XhHn6ISNjKFTPEe* zrR|89$5`!-OP_bUzg_cV7dha$8*6yux$h*w58p=5?EAHSN@j3{c-Z7x$V)TFF7cngnkw6+OwAnjA-v$k zso>6fC@4yrL{N3E22E_d20m6|&?Z#r3F_;9@h_<{z45hBj+1Lhf|)Kj69C!m}q8`z{m0)~^KP0RFNXv3cupiDH!J7Q=lCDAZGZuYa!JuBit z4w~PC+Y~%beUcsq!Upx;>%*7QmGwTL)LvzC@Dr?4byx@0@)UKGNEr0oM+1if`ARfA zb0U|2Ro;htoWR+p|5numPOH_c`-~(JoLpLYe*DIaN}RDqTPytlbv{!!qd8DALjUe^R7i#I(a0a9~scn{GSmJH!^uHO7_P;GQxZbd1YDzoO6Z zo@0t>eX1kDJX$V{M z*jw%1sXf^Vo@7BIbuo`uJEhx`>^+L`otF6_!E%);&GeT}hvmqn6}P22#A8H1hLAL( z14mN^;%}w*_=^ZbtA{3QAS8JwPCcUBYdx5sgSgq>W zdnHGt6`RhH61N-rMh?&1O#~UMn#vs>pIT$-E*FeMfa%b-Q_xJg@&`??mzdCHL5mKS zNiMlJ1^%)h?$LDkXGF-sEJO=6zUWt>MDJ?bx8+hddQAlPi?>lCSIn^nu_zN$;r6cbJF zKZ73B)6YdO^>}MT+})ygrhDJ4aMnV~`ST5A(Sa_y@BKc$^|$D+%!-98gIoxw%=*6^ z{l}zg%VW=YBd_X^-z&AwO&e-W@l@roZ#~n$cut%{)E9m)wYD6BZ=Xfze~vb1$D6Yo z*T0dCN6Qe9@Efk84Uq}?ynOr{T*yXb`ds<4z~Zgadw|M-8V`{{VzbCOlZ|63joj)G znfYF-HaJTARdjgcCj10NO~T%Y{d|{p>&!va5nvA_exBM?*cVk%&A*70RRr7CncF9W zS^z?9)euBReIx{z!sB!$u)kk{%h!?`d3?7kQgLv9}Gqr7r!W`?;E>0(wk@8n-4!rJ5 zmDX`g@m=TvH1v1zh;;2pc&uatt7l#eYQxdO%Opj*mT*tN(GU`FISIOqE-M-L#HoLo z!3ZKe^v|t6;t1EG0&W}6#q)1E8raSy6d-<>ZNBd@WFnI^C~jCSuEAiKtDh7Ct07UO zD0t^I$2(`EJ@a$W9TgH9S-Q&i==1IQSuUu^Kp!RFdOFVVN~DfXL-_{J_m10bpnNhU zlbC)o8uHf}rZ>Mvzb(uc!9d_o#DH}2DnGnMbAo>ufnhCBFhIK)6)-W+5j2@1G5O~T zKCG zQFNH;uai^iCW5G$bbiv=dEE%CLiylC8k+ZEz6G2~g;>FUX6#H1KUS?MCw1Bz5E}F@ zX45I0p!A!IB*(l&{D-YUD^>u4t_ZBcY4W5xD&V~lqhK@G;2He#I|4NRRsE z>GOybdurY?pmyJ-&u(pw1Q=64$`5R3VnIyTEA6bdp&Q;?h}8{`4uxe3$OI!i{67JkJdGrT9HnKe*ouj&(s|fe>)Hzf<+(u zkW&s=6*7U!>+E)RPt|fZxoaVM#efkaBx!NL@gitM1vk2n44UoHi%BuW75Gc?(i?Nx z6a*99L^H^OYrM4}5vL&QJYux=Q*_?i){Cfo&;=ik_%&)9MCsV_$7!itTXC?k216}x zs$(bsg0g52Hrn@!JjFKGvj}~Z9{VS-EW!%x_r}jZWp(KgJbV>PMT=f?@keSp{(09V z2rBW=%)Y9oJ+Zb#Ho50J2~<(!0?X33qd*WXVwmn!QhuHcmRy0W?QCM{|Gsx1;`NRv z3-{>@JMF@T$}^b~+^0?|ryYUAl_2j69EgPDEF{7nocHgMj~PD|$9D>MfulXI=Q|s) zvUmMQ7PfTyt$W5Yx>j`)He2G(`Ema9X%}XL?EI*+4I8iQA8)6Zrz5q%=cfr{YBBN~ zx!L_!l71p{Uw_A^mF<@Hrk@Mle)JYmM(gXJ(ZX2o3jDhnFGKEzX|j6lKv>6tvzNL_ z^mGO0M}pzl>7;kcNu5p0j@--n^aVuOyFUr_LCC|6kn`y0(1p9b_HlyG?4o7_&IziC z)!WyK%WzyqL_9t3T_RXT4>=`St#K`K3e!QKKT8;&u67+68t)Ou$x^pa)v~G1lQ*PE z$EA1ZulRGO--Zp6{2uX4)Q3E-Zx558l7S6X`uSTops#3h@x9lpTCP8M?q1`x>PGo< zb^zJK$(dy5ZmH%gG{0=}^*UfQUKNTuqT8-rxE76Ec^KOH*G_iiuzVZ0ETnpXT=i)i zZ0x2dgoyfnRD5?glb>ZGM>Sh1kCo(hak(Ep8}?)@Xx8o@nVQL|XIJ<0%h}ti>nL z;dDAgaPqVoi9e@ezqo%CD+ez=amry!e*kMTv4ewL_u84h@j6DK`S`~rOo)$+G(ZXW z_6`Ssvwf&OKr^mjZ1{)EqBtyL1$5bc=Wtyd?tS)|dRgUs`4&ofN*mCh?qlgD*-N7( z1A*=%`4+A5NOpsj&p2av7o|FF3FsC8-2m2eAFek%?@jY~yJ$x1#k6QPCXn}JG6MQX z^ad#>jN``Y_+czk}pKXyMhdw9%!+kL&R*Y&)f*HhFsE=LHe za2zjss7)C_Akfc!l|V0+(Ao6cTK3IabV%dh3?A8LNg;J!Ve6i|w9jM|`iR?0MJ(%&` zI`%z~^QFc;|8Z*D0PxE@GuxMU8WJh{2$;0F%%<7bH_7>efT`L~FWSDmN?DrgPv&Mj zf9O13Y88g@ z)OtaP3ebK?c8w(=GD6O%#%{@cGnQ>!T%2=ddL@RBkA*tWSY+3B1cXI}TKe?fy>(z7 zv*&6te~ys7%{%DqV0zKj!&Wb`3bH~@nAK2nB?v>d^WHL^q+2wtSr2Ix{HUZdgY%%TyZCdRkOSI>2v6E{nD0YSa*|G{*z-nV| z)?U~HqgBqq7LRT+qoRf6EYf}#)O|3>ra877?{sm=X2KSomzdr3H?T`#L$9eNl}Cwm z`7bCCW2bdV!v#UMqrW@x(0;v4h8ZJfxM1fN8ywx;@VxB~*X4-3lIfyk@?@YE+5;nJ zUFB?I`015d_WJc$?Cg!ebhm-88?w-ai~fc?U-2*gwz_lT52XexzIt@_Zfz+Y{K zte`{wteN4TFaCC4belib8nLMjXuUVQ(0=x~gg^~2R8M;?A+{ooe>xv?4PgkL-1 zOe3u?ewyQim68+Fi(GEc@}_{*LqwFsI6Gb%Hlw!P6;mI-kk!^vJ?sd}T$Sz9laJa^ zt=r@}uVd%PP2YZnO#|?h0N}Z@D9CZ6$82xQEri8Xxpmd6^?l0^9sgK;G1XFI9As29 z1!aU~(+;%#8YW*;{TMzbdX@goxye6m^VcnpABxPo7k6+un!8OM8bF{88w+=lPhNOX z;k0|rJ5Xw4ZL7Kqdj$Kp$7GC|_sO-O9#>;fXwJj`zry@5M*@0S%S7MvsoRgE|3=az z5Bq;j28N7y$&(Paz@qsqwig6N8g1g5iMXn8S~KmT{ZzHlSA21a)4y=kZm|o;U}2nn z5Acwb1(385B#y06`guocLC$O-{5|~(<#}+6lSd~;vHEJiZ@4z*a+Y1|d1xpZ>YO4o zGMB)_l#Ievo0Ui>g!`VS+?|5$*>(iXXfGa%QbiCSQ%-5zk#i)T4kIhz?VeeVlpR)l zL^2lFhrGH&R1w#}Oc85vgQw@JBX`OWo>K|u%pp&)TCJan((mkCXUY^-iV)q759E?U zyFj9R3m|fjrN(WQ8_C$C)1k4_lVkv}Ja-PpN7J*Uy_7}Ju*&PQY~nq=4f1d#MtBKR zEia|olaP0aew1=({;7=!A`@(&06`x`2)u@Bw-g6($z6@!k~IdISvXU_5%6Ku z{9il)LiF%H3rJoWW-dX=EL&jF8TZUr63A&glIJz{vh>`N`hud8>;P0T zN5eWJ&Sd~_M%={!z(vhu$e}Ih&@R|Op#)QXpf!v_yH@%Hn9aUq&DkWS<~8*l1kRuB z@FX)k7e?P}q-1wdvn>;$=t)I=T80Yd49)=@wRcn$nYVLzIRFanSKE+WmeI-rcUkIs z$){zqM4a6ywJ$Ls^>WJ5o4Vgs4KmT7ba74rFPV4pN&lsSIz@@+8Wmt6@ma)x^NNqp z6u{dib(#x%I9PfkcJK)lp}S9hvvPch8mjd^ap|om-NQCfph$$NY8{I`I`>$4#FJi* z6!x&(VS$ts%WBh0DpH`ShB=3tN(>dzRI5*Fr<~85p&#fHLf^&BiTQs3%{6|oy%Obq zEi0HRASEc*&kZNv)>pagXY90R=(JYVt{XSqyD_)UUjD?N+Vp}GD+d!03nnnteq$Sb z+8UBRG0X8-E8nr&J2ow0%i(L6uQ0eH@brF%Wm@I?+6x+ebuaZc?&$jtjuR`pZ#J@A zyi<|i0@jBed|RT`a`ok1;zrmaf!+`cDwES`viMI3F|xPPX)!) zZ)L68JjUt_K$*3)s#V(W2w`!yOL+p(Vz7TKoZfcg;pHfwJ*$8CwjjC-1ol+Sci1AV zaSSamg}P%Jg|#^QhtF`#N$uNnLr&3|hB!a(>YA8p`PlMSRbug5H;%&p%{qcZPfZJYOPok7#N zAC@mKdX>g@RGKwRyw_4_Xno?n5~;H}yV%e-f0%I196$FYnuDEPl{L3W=azrKN~2iL zp8~5HPJ6rKg-J0bI@dp*U3HQ${SiQujfKNr^%bW~oyKN6n7yO1%^z&@dA*^Anr3jJ zsh4_urXed|Ayzk$YcI~^3i*Gzp=Q{Tn-pm?q%=EPuJ|K0X(iGZcx*@KW6yO@^i5R` zPs}!7xLeiMO^W^;-EnVcE~Ep`5op-9c>ivNnD4BX*H*7&Wb)Y=4n1Hs)V=@f+xjAG zdQl|k#<5C_fN1UbaY)L3E0pURLyD31)e1Dr?Y*IY-n1}(@n}I{H0wb@{Tr^)zIDuD z0|&=RY|Z6LjVm294_#LA&Y4qU@3!ue#OzC!!T0$2|EDGQa2}BK9yLV#5BheB2!Zs( z(40XLwo`t(0T|0u6rCj(D3sT`Gir`D+O6eLzl4ph9tiJO9Z*}L;F8vdctqBIiSn7! zpCUtbS7YJDr2$2$U(p7vTU1O_wr1L{kSYE{}AVbi7=eH^y~Ins4xlFCqDX z9E^0L_$bYKxo8A;Lmp{e)PMX*qEfke=^C04YnNz=JA5eRn>A5qZt{pSnrix#dXI!6 zmfHa2eV$A>XWUl?;$}mh2Xz_k)6%1RoS}Q5Vub~2XBF>-@~LZ}6s8{GX!wEZP8HeC zBxUJwTl9N%4SVT!B3ZdpyVxeqIBm{aGuX^FZ!$qzqnW63sh}dD%MxrtzsYjTW=Gy; z@)Us%0fGvU5YqUhCrOZfBz_~7<$odoi+FRya>Br}hMF;w%$9s+$JdllZGtA`5cuc_ zOQX~1NVqb8rnQL<5b@0+j;hc29}E30WI(Xs>&den#{(rnND>u4OA>3;E<#M5q|}i6 zcvV$hNT5Q`mKwA|>8cU>B$hF;oqPDk@@L_pT+xMsc zt*u+4V%BNWCW|GTJe;2>xf{Xd*d=%Bc1uC!k(@*;+sy6vgw7%@{a^(<<`a3*Fu1VR zgJ5@WkBXnk0$;Kwn!oe_Blz~9Yg3sj9+kdb^?jQ&RJACqb(?9HUYl)MxQC}ejq0R0 zCE58fQW3-nCAJ~c4$@R6Z7Pe5B!)nt^$CJ)DUOBFE|q4@A)LcY6R)vsw+S$^&I|-7 z922rPCgRjV zRI9MdPD{|&f%cfsh$|n5XGiH?pPMd+VO~?o&)Ci_WMdaZ_DsXEE->v{xKc0j_yn!8 zBLtQK(2-rX4%tY6`wqE_6?fIKjr(e0#|jr{^<mkPWPX@36a`TwwNO-ACl~_jRm` zw_CDrcPM+|LjKTb#5xcJda!Dqx&n1n;~wnfLpC#txJ$A4852f+HcpuNzG{=|$l~B< z8uoXAnxW+_WB;eG!Z~hDN*mC}Z#u_wSCwO0U{H&+uX91TU{Uvg*No?B=}T#5Zl9O3 zS#GUv8~Yxg4LrWQQ8N%fp=Bt-JdrT+Dg?KuftkFHUHbZ+)A@P7?%RnvbpG+Cu&>`j z7p{;D94QNR)W{G^!wk$u{nTP?u%k97MW&Ogt}O=Jth~e6x@4EsJ2cv!BExw$stcXH zf29ZOTipJR?k|G!nqds2y7eA@N7pazT=K|)bx<0Xbw8yYbsVG8nU(Ul&E8|)&dwFfvDt6fp% zYW#ucvVWI?VJ)$(wOiNd6S6J829mS}3)dqPDn1S7OQeIEjH5FB+9oeUf=6fm`}ot# zVfpbjwy4F_RE+?+ItbjGhmaLdDG-J=m}Nmw1d}Xy7P}$Ab5>6Vud*?2)!5)KbzODd znBRkf1M@@q!B|0>J~X%74vzasC>zIyYe)2Z`^pYtP;VCB9FookmAmk(`xxTdJI{`)tt4T2>AG#}4Q4lQm&fI408d_JaHbih@VQ`$*^=O^+-Dpr1;Q{{C(+Y&)om?Qab4J_TZ-gjH!q`1BI(RBDiWQ#V$=?qhG{R zH4z7Z5sz$RzGE49;0LuN8*h2p25P}2`NdjEJ0b_3Sqq*?@yz5=P4q7w4pxRh!S5Cw zC?K2(f| z4fS9%oe%O==ShN}nr#$)VRVG`WqXxIQhU1p?CiqK1oXp(0)M_W9?3C6dwq<0F zY#OJy#iWV|mpj_WLiO5Ku^HIC;jQ;nZ@;Ek9V=hcI+Yd$yE|#&C8+&pg;_%~S zUxcJv?8P{a(;hJ)ZzB!DP{I$wnsX>zFA^jfPn7?5dj;DrR`7yjurlG6J41e*c-|PN zLo4VBeKZp&{2oTBlB53YV6nVd3otKIm8?6~;i9Hc$dC&n9OKOImg-w+P{l{2e0VWb z_gg&85NM`&tcyp_KcG1@Eg$|D{(U5IPf<41-KDv_);@za$WqY8qp3QwzMI<2xN1fB%gY`DP-5k~*$X0MAD9Y0g94`G$#ho?qg-6s!CSjG>yL$)kp#wR#O zU~XgnjgC#l`+qm>gLJZ&;Ru1$W{&VLI$QJWs{b1H4`0F^;SIOrNne*$+4Acl6?A4y zUX-uAL{No`hh5A!uJAP0Psiv_A5 zsO#fSPb-xs+^QNXx~PBnpmHq<@=MDhF;htv(Fax)re=|w0h@&C^uR?$^V?5ER+|6t zMdb@F3DoPq?NF+2XNbGK2kwq&Y%)@Za-}ocmvcU;?A6C_QuD4$lgoQH6D;I^w(fcx z`7U%LmaelJRs8ra@?@K>P{bG2ntcWb>%xDRd~w{|Bea#Zb+u<@(f>Dfi+|Ir@ml0S z$af-dkYt`A8r+%xH74+$8~*9zWTv1>h5i>TPr{PN@~BY3@ba{GUr7iQ2(^x{j_qla zwY$o~IQA8%AIx zN&hiDltvCWR2!b1aaQ=ZEaQ8YZm76lw(I4c@ zC5AH6k6nahd00cPNdcWOo9*zzOWNGsdEou)BpnqkWhp7piux#292L{#OiETTF2fCtIOfrHjw9zgPv$@6s2 zfJ0uvztYK+9s+sPJdn2&mp*2UkhE0;uPp!=7Vi}#IlBucw-_T%RydAnsA|+m#98-T zFR1g7=pk9Yv1W9__5*4tiuKmnp9DFh%K_mcjU*+3eA-+P{0Us{+#!CuhYZ^jz6+Gg zU$U6J#gQX;MPMD5X0+%44CJ_yAiljGCF1W^C#e#j`m;epjsH;oE-O+~k75MHe6;jX z^q>QAJ8XbtzJB`fuI;toRjah4GnYXqSJf#G*K(Pt-TBQnGL{x++N$BV1t`G4#p=JC z{-c-d0m|^npdKXB8P=pkLS|>$Ai@uO)rm6!3Z94*(#4*Py$Dk4Bg$}=EhY*D(RRTS zlE7^-*?GO1ZO=~JX4>Kk`nBz++8fKI@&#UrVvcf1rbL|})ky>kg%F|kHWP(zaBes- zQRER?n!8=*ZBVyA*y(5wYop&~3`2y(rAa@j*2bVQCFm7ids+G2Pl{$D=1l^0C&ErN z=qa@4opLetnLW#~8wylO*QBFXULw6Fm-~_X;J8uavBwp|ZqL=H_o@pctM<&~gZh+@ z24Hz73Z7h87<#722Wd~lyj45|;bEidP83dz>LLVm(3C9N&7pchEs$Jq)9XOoTX)Bx zx??O1%G)u22rZmb_eYT{9oa|E8?&6Nb5{X6YPb<+fA*|@f(*ETSC9KIOqq$vvSqhLpd{K&wy%~|b>!VA>nuq8gzLj^Kq4SF7oD)kS_FJciUNnE;)~;TB5H88lpiZBB+SN3_9%H2JKl}FZ?Ai(Z&E`@lz19bUUyO*4N zEacbaFP#?Ps9jPT54sK|L+=hK2v(32;dAaenG2u;uf%6gT$LD4LNAf0(|CU^^LROv3HEjpuREq56E**lNcf3bXRsf`L9F5a0 zr8re;f)i(GW-y_uqG&svDMIVHod`+v2p`^#kj&4v?coQenvkeH0IwYGO@muoz!ZQO z1gL3}_8wqL^-n+!B|~_JODQWFIg#&@PRDCZ%22Gb2xZAEm?Q^&i8P@vIb}Z|n$Ps6K84k#c zKs}uU!8vn%WI+0kN%_kLsTQTSz(MFlJKZtM;8vf9`jpuZ+{;t=Q1Mke-^)v^-r^`R znOnxhkrJ~uN83LcB@m}0=K8SfhEleabxEA z-mAR@;^!nWnd&Pi8OChK;ImJ#9iEH`xL(+0lXM??+wN)$QD~v8&SbsYzErqOSR~X| zbdZz?sk=W@4jLD)X)$I4)MqZ;8GHIo))z`sAg}FW!fvsdUq_^Tj^k)O#K9gZT-C=} zQs9OCw{v7?UH2~`O{w|!j)s?wdbUJfb9QL4%}T*oA@6`>*F&i_l$P^nT{l(R%f)n2 zj2&S9$bmNkkAV7l(zEzkSv;g=1cc!?>Ovnt2!jbF^hd2#JtO4zjPip{y3^J(hbQD8`?>!smmgQ>|I#&@T_NW7ob-Ji76!P5N3silc z_uwPwZK147QLX?Lwa-?E51ozm&!}X=Dyp2PSZ;*bO)J_PHSxjG?X($2U_A&UAs-SVLWd zPs8rICuZ3*cl|8y-RcUp`dQpPlS=BkR62d_hLVHjAHG${i>*)BNanHp)`N+1LNS%X zYo9FjAcK{c<15)`J`$g0Xi}c(m#eKqmI5K>Q2N1s;ts-K?PBQ(iKD?h}0-WKtXyZ38C}QAt)$as!BCdq)7)Ufh063p%*Ek zN(&tUY0?pp-oiIN?|aVo{rRrzocH&$VJDNxp2@5=v)8)Uz1BV(J)5B;D|p)5fIu1= zAP5Kqx&*p-?mCDP*g6ONfzC05F8sX>0_mM&`R{GhbG-i^LjeL&-1xuaL+nB4|2-Z! z=ig2F-=F{WPW2H4q5}4u7ZMQ>jym_R?Q;~ApwIucUsy=!^SS?f#?KW0b;b*z&y@eQ zP0^Qq@!wCuq2L92&KN|Q)1OI5?9}WDYf&ae- z&c1^JLFfK%6z702oPvUa@;oKb&R;nHr(L*s;qP|w-;L_;cIi)}{_pnZaNxl6z(4iH z3m5-;|NnU7Y!Zm;wa>nS=r2+9T>w#@;{;LApQEHdch+()6Cfcj{Obz;OAO#TfeWL$ zL``$~8i?W?B_+jq$_v2t0waC@PzmShFI>MP{Pf}t9djzqR}3O=qcSdW$rU$(b^AB( zids0oqo!fJd5eje`yLN3A4ClL@R7KLr2I1lMI~hwRTvzhhtxMPw6wCev9+^DxwyKy zdw9O~3J44e4hemaj*f|q`xKv$n3S27jmgQy;_xM-Tp*Vk@@;ucadCpOI z0G*Ql{DnKh7q36np)!AUgHz<~B?h^ujN(RWE>Yc0u!VC!4dY$08Sbq=BK3_;aFFBMLN7+E zyXHl8N+KU;i;vi?m{)P3CkPF8TVF6?}dCXZ^@? z@v%GebbChFBiEuFAJMr6+5?Q-s78t7W=D{JbMXoPb~W{?`+)W*o+}|2yxfb@+N@&n zt87e1RI~>n9~#H6`)sbAfs_V*|CUw37DYei+lnzFH5s8AmcK;ExV#7LIcOouW=4^*9vOLD;3^dyiCK>*lP##78KtIQ|5w*L1fXsT^nTPb7 z?K?dA{{Bk>)V_10gj^u|C>Sby(-+V!-a+?ot|EC9A1W{zgdsNgl{!?%tTrr#TOQJr6&wCjBw*? z2Nq-CcasUe2=OtFJNH!{M-M%Wk%n+i5$OF@$D~+$aCgk7vILiP94QhTNFkz0hjvP_K72Vuj;(H8dsR8E*@?L?^?v?B>zX;bCG9&EdPwb~;#H9+ z`JyK96+-dK%vK1$nD`PTpbfpW7;^BbBXj@jKYWQ~L-l)zD3TQg%-}{ND91v$-nA zh^w=)LQqoF7zI@(koK=m$M$1HVjeB9q_kd%K^3-X3y%wi^3EIGr@<)yqWl&(LB1 zHVl7^!++Ri&-zY5t>W0kSM7O4Y)|0mGmv&&i7fF^C`4o-lZzG6{Xsj9ssM_(wi<^H z&?#BRwR2{^8UPzF#p_3)d9zZltzJ?F(_5hAJ`X;xT!yV*+6%DDL`&mñ=QY6>H ztFtAszF_t5o*cVp=wMXuJCfMdY??Ie>UxwJT{av2Yh-b@ zu=~VBup_@FORlVTlY#J_Flp)yDrL47*9^p1^RR(-njq7n__RoW5Y+Q@p$2+@S z9GiuYkOxJx;VSAjiyd0ZZ?pzojz+@8Mp+TaN*;`pJa2Owg29VW*~MYt+>=)^d8ohi zYxljiMNi9Ooy)*fwB)c)j34yr&wF*_Ldsk9RSQ}I%{Sf}kTlR}6=C?;_Dp;mvG@?V3aCx1XuHx}&q7ZF3lV zDLz{WqdVH?fZfZ$gqyKUyfthF7A!3N2!u*8}{@B=HCaLY3I{mE|W(8n}y zw@A6;RN|zTo!JCsHhUB$Y+aH{=#)I@w1-{FO7OV*V_gw&A`xhUw$Ha%A+e((Mdf9^ z99?Yx3&7aE2_WIAc5~m+sY>*ta4#jmynFbkrznJzYFT%j?(aH7WPab*LHuX|L$@V- zL`9fXr0~#zQ3BFQu*1yGvP53&ac12 zH>>{o2KcI-awk>FnyRG4R|W&f;*fOt z0gQI`Bs>U{1@`-3MAT=dXKlpkwF_N=6p4v-UuZl{GfOU4YV@0oG(e0yi0 zRo9}gm05Q@AtRAr_W($z*5M-PL~G#qp-e}?r*ZuPgU*xxv~!&GpI(1?ZZ?lT0y1#T z3w~d(fi$Fj2BJ;lDb~h;nT&^G!d$cwkatI2#gq@ku}rV@CcNNRMEDhSqF3Y6F$%D# zDD=DZGK;+#?Fz%Bk2_i8m%m?w8HvxPDm-vz(|a1AqG{91FfP&V_72U9TM%_qp?urQ z*Z3A|hjo7DZP7-`My{do<>OJB3bv47%_=(%)l_y|24#UV9mb^-7hf(Gty&&ETO1Ij zo8O{GYxAJEPwC}F$O$spA@(MF9B<{<`C$>8>n-}fI0v`TLm>t_`(GToWkw=ImA=24 zs`|;2P;0d0MOtOlq)Mnf(j}Y*_>L5DO9s%@DDB186H=^(zYQ}H^q=>_ypwfhkYJ7M z(6EbUJ+*Vks%D1rxQ+<^%v+tIOJ^X1ytd*W60m&(e@SeoY<)xO%QoHUEXfb-E{Ibc z;yK?dcdimCo*@54Jk8sT3Nl~FG=G$2faM1K-p*0qw$~|Bmkd9#F3F6mfd4PLZ)<*U zXq?h>d7kwSo`Hh-KRya{NeY}i(!24Ezi$5ZQ0a+rnHxu!R{L5**-V%P1N`V5!g^@l zFQ>|^YzzIN*J~zKZ`U>kd4td4p;O&<+OEMb{RqNG8_VICZfMVB1fQOm`q$Hy$Zj@# z@ZN@6!+1%Ye6-u;dfPfhEByE6nxtYE30wFVBeC(&2F#;-UtA=3;II9fGMCk~i@U8M zA!7JTy@=ErQt=7CN+KU4%A-x)E!RB?OPGdV9YA*sa(%yQvj*XOl2rkw?)5UBSq~CO z<15oqOOgJfqaeDlX1B;+mm12B0f$AR zOQPB1P>Nf4$Gc61Z4%%&(O!tMcyPY;=#;3W_##I$(Matbe~Jo-FQG;0A>v9zN614!G^QTLtM?$4lO>? zbwqu{LYZ{=?S`PRtKAxz=y6e~E?_Fl76st!9F(_mgD++<)E03T$h59xNQ18zFQE(v zQl`Li03gj0b-N8{BvHYv3>qXylom~cfX&}P;J2B_;F9LrUve+z!U7P%5TcAr=8Xr6 zLw=0&dg>bJ29_%p5iXv?#SMQ&n32%=@dkA}3DB zjOVWmlu@(nGO=Rra!Oj(G6QBXALgx>NEwzIr%zf*95%liLYH@nq6&VtUMl?YbP!Wg z6EQnkE+S+t6X;r$ILnF`&zH*Sb-LeL4Q1#*x}#uz;A9xmA}Pk4FMc|E^3~nEnP#GB z5nq;acZM4;tD6hu#VP%jiH2MTl>HyUP}wumDfPC3P&=f2OQnI-&_CtsA1G^Jb$rSf z$GENWfQ}UgyE&}?yO|aKY%WGoK~bOnt)cf*?^m}LGF-;9u|`a@k#_8(FYbsllqK{s zcx&&?GlXEo=LlkR;N0??<+n2fc{nmquicYZVwptu*99}cqW=>ul z_D@vbex*GYFOji8XQ(Ao`r!!Xkrdn?lla-j&?yBHv8}kRy}~4k*${`RkKv8FA8Z?R zW(4FLZ%Z%xObsc^7CaV$e!%{O z?~;HUpO;Fz1cY?iUAlLT2jfgrSO=IBp$vUrw>0yB5KxKVBKtgh+*LM71U`5ZZvYE` z1xz5I&v$X~IgA~iMKMz#WDSLQ?z)Viq|^f9fA{6mZPX|UVN-A!N6N)FiU`nM=%)cx4`d#TKT}fCAA>YOg zR%G%0p%)BACpz`9gXoy!){5QV!S-tM)euEr1EJ`g{tMyasdV)hIRwOg$2@ufRpGI& zidbD&Og0Zi`QPRx%`>~>a|%f>WoaCGpFu|fmGgqR4)Cl6mfBNLxv(e_n&0l*xX7CN zEoL_)4qU@Lq&}n`4SdfKRSPltGdTu|tMTG|D-cwWrZ^6N*gXd;=42nTHX`Wah;SPx z=DIG`mnhQ1tJ;8HwtnslIqV4?f@Z~lv#t={MOzfyjg3g?Egl)4v_!AEuB*2;CvEfQ zwt)*S%z%6K;(98P(w%(kyW)?_zxp6Ku;U4%?}YUk4NHlABk=0*@{C(*5iF%NO@XO= zui2;Qgw<47Uo=?~tX28(gU{~;`FwMfKT&H35D!xLHXHxyOSi!+&vbc3JZjYJDcE?cDR4F$=K%I@eAb3vrvY=af5d1URzU$gKa|)(jk1bc?;t z!EcDwoaUW^7nKfZR~dbpRT{?g{-zvRm(rhiv7F*+dQp+iBquiPqTJqmqF5Xdz@ju3 zB3yOz)pUyID3bJ}(B`+@vQnuk7!z8~q2cJ`3taInL?a+{yWL zuf#@3fkC}BDENU>Kvc;WX`aNp$lx1aEXLY{Cyp5tAUE7 zo~6Y&)0VO-u|8)}H3QX*o_Y0Lv0tf>2F*Cm;$?k_B^OPcWJ7@(V&%y706m0@T(ikmCR?Y#K9j>H`$-!#49`@Z$xbld%`J5Y zvstfGyU@Hz8R*&rv&khKHYHctYl0TCxV>qNml(cQt*cbw$`H6%e8e9+`+{Mx6Y*X? zVyEU)MrKh;KU@I~xe`T6;~2)NFhc@ke_DvItDk3&CFmq(V&4NGN8kzVR2-z-0U`Qy zaJmI%m#0;XvdVb7hl{IW#%W$rumh%S(DW-(Hm%f?aMWuqa}}xjzCU>aN<{Pa_D$R046hYb(y*MR!9SZ=vPo z`7tf748qcCS6qdA#2oTE%h$fgwYA`Vi9JMMA$*}CT;6k-JM;5|T}QzKC+5IidI61& z>;kTT6JKFHp~Jv~TpkX~fCKLpFlabHh4U*sXzj-`STg9&52J0i@Vpif?WfB+!5l;_ zkQ+D~mE8Jyg|DhjN3#GSZ>`POIhxaN1PT6vvv~P*Sxb+Ipkm{jIdzcFfrj&5mxv%W zYBi|(M0GfRH#+aF_tJbkoAycLvc|*k8Ifs!)kG_z_LZxutmuK1<#3pWb)HUdL~t=B z87u-IuMl-eDyxUJgYMNQMYl)TO98_x12NX=XAZ&WuSP5MZ5h%gX<~XF$4d|7o^F$G z6$wSGvg(By1_;U+xcVKpLut)swD%1*yoTB?D;gH#H8Tra^SA}xclK#$urQ)lOpoP zsza{mo5JdtTkc#J>tim52%Q3N~jH`3ILL%&}EeDMD0FC7I2(0|a+oedtFamGHB zL^xpt{6CZX&Oqscj)qhA$3$JgZ-?Oa-g!n43ueP-^PKiDQ@nfG-p;LCid))_hLkkY zIMa!APi#lG=u3uVBKsiQtDRK7nl_aE^ZxZ`d0#B(7&>{g#y@-yVt`#fN957gEM?RF zSckovWIr1(LHngF@U2e#8eiPw7Ri9Fw817{`>@ev9k=|${ttL%Gg5-47fDCuTPNZ< z15C{#>%IdYLfGxS3I$+_vNDU~C;-zcI%YiBQq&?S zD5%+p6j+!{>pHRFB_XWexV8NNRHL4m@vXZ(PDSkK&2>pwGn)9V6;>={!8b#clK^wB zZ|Ha0-e0{=inz)Rj_Z+7FIEusB=RJ@gTFZg<$s*HageZc4({AG_7oeN?>v+@5uItX z#=k6h&aZ=`OsgeOEtRTi|6zF~X%)uV#On1{a6{|#m>jp;7T`afa8#RSdV8toBmSHPX>8_?6vfaxgf6^cQbS3x2(oY`gzX^aaDcR^M_{R(c0lPxiavP z14lmt>;w1D9Xnvd1y6zGuIi{eG7+7*zwaV9{DH^zuc9&UX5rkux}aYToX$o%wI5sC zrY`wl8?IIsz25xMO!v<3qDej7=BG&WjjJg}rQ~f2hee02NsdF8i{ziDzHPsl1p7** zu`%CXx#GNBG>YOf>zDP(wrgVRT82`tMrt2^9PL$nGC#Q0ALO>zaEbh2MchQHNpgPd zSM`fwS?R!t(+)RAa9^D?rHeVjr)Qkt#dL$VX;SMe=eDuI zbgJaY+NZ}Hex2+P*j~eh(b1~qdr79mw!W`jC&gwm2c=}{@J$!w55ae}3VC)tKiqhJ z7gtkqRjiLO zfP4mOUU)_|6yz;#{Nu8bDom@3eC`0r;E8Ohf;e{ziROYwK5d?XzRr32@g(%?+|A>p zwrsw$)cKU-Ei0^|z)NLMRtCnQ@aQGx2&OBba#?`^;qob)VR|9?2@xsD2j}_Y053}O z&4jM-D}Nh@O5LF1!~i(k_?i*}q0Ht5GZ76D+Sz={s)x7fwAjH>9u2zcz26fH>!KV7 zJSjdBYh!a-qZ&AO}d3Wn|v!!?`tg;xI< zjPkJVIe3DQSQQ(dhTmG$a}Yo*eBZU`jBv@V8Qi?$%j#En+rjq02O)n$cbC3FCI$jZ z?_s#Eqmr@iygOF36$tDfv~FSbGczUz*LTbAxhh)4PPf3lKgCB3m07)D+T*5M)w=%b zE%B*>9pKd+Ty#Tr@v$}G_SCMDceMMi59ZzD7kr%?Qa~FDhw8~m!dG7^8Ma*??1Daz z8emE;p0s?6oUP-JaERZQhFB+G3_0Hu+Vh=ls64;j6H02!H=1m@JxFh3wpZgzhx#2` zC0=l;=$0$=db67$TiL6tQd#x!Ps^)Vc5pBK7gN&v8(P0`S5%fIcT~xv<4qRLl6|J#16Ef^USl$2_W*Rt)A2Ol$)fs0@cW^V z6RM=`N)}Re>O+%gN_|Tl&rL?}O4KJ0r6oc^i-&vvq{6m%&|S|sW@j#v7VoVF;7nCF5Fvf0_+NIqv!P=aPc}aJBj&tX z-Cu^}(?z9|&11P=+loh6I?MwNfZvpxI&%Msf7>nVJm{_KTXO%D5A_8I;aOd?zTa5? zzyLSuX6a@h)vOW#-|{y!nT;>MIZQzGdQ57$jRV42WlY#}l`M6x&E~J(6%lGFGeXsREeEU-d&`b=T(w zaWIpGeHpwwDi$BaF!>dxb_AE$69&+9Y~Wk%d6J%EMsn0WU^>_Xqx2ko-?LM~-&kaH zWam$OOO+#nO=GVN`z$`j-{@BcQBuT@!XLU+J=D*v@Zp#~1KspI0~xZjZQhG_%l|P? zc_CI&PyGz!6ZuJ)d@SG>Z#afDGoZI)c%G?Q%EQAYUw+Dj?JX_ubEY?m-^ zV=#5|QiH!(ZS`pvZ0$g*S^YTFwky`$TE`z+aAEb49lv|sNo04$Cti!~TbI5fQq)x+n?`Hx78ai(0Y{@-I84kZK|XM3YPE{_DO6~l8crQL`%Jd*8^@G$+nT0Pl!#R!z z;C2;HNMQBb)(etMUTV*L8TmsO1>dK_lOo-rsv6pY6NL&JDl4dr8n(QF+;@+etLB#6 zif~e{vzd%j6>WeyGD6#(9P-d&}m~GJW29UFYB0?5(&r z>pY*$HBre6y(zy8!%R_KjKp!}q&fE-Nh==>XESH89U)Vc+)+Co^}AuecSm<$jt!V- z=~N6Gc;2hN?CaucW*c)QObGrv+gB19so)!6C~OwhHu@? zOT?v}fm-TsRg^Wve5xCuE>20Yyl*~UwBrWdv~7tz;7+SJ?`-D7vL$BtZmYaYUyIZ1 zb5$V2W7o->v-~^1e&}*#EE^41H{)1I7_*zfWQLvfYCw6vi#Ka^W^Ph#UHF;sS7r`* zLe_(S-|?aD8K`0~KI(*cqH(~zN? zmTq#4%ttx7wxM-nF`lBkkaVxTO#s+=+_?O@pnl`P<Ws^Y4}kitov^q5a} z-Iy%m!h*jPOSicAhS_IXhKA{6e~#MA^=F_)x$mtHFNr2o&YQg5a1i|qaK+p*P4#p` zWg14!M_G1;r`booJN{n7EBD^Hoq@_VDJ>&D({Gp=1bkZ>L1qDuec>eC+?3$v@#C4J z`ZkHCo)61zzZy0>yh{K@81ee@p;)hZ=2A?>P31&JBB=RRPQyjerHH%g5BGqeCH0TX zRn>biANx6q6pbE+UJh5g!PlOP@bapc9G(D58*~kgx6pQgX)Az-5BB|BC93p#1xKR# zmHTCgquG~UHuEpbSN3+0@IG~wm@7)AaV3dmDE%^4k6c|>RsL40fINaVCzTzuF|0)QYh2+|lIFJ-bA`O?AHXo^ zMJ1MetP;D(84a-MkHViG|Iwk2j*+60`aS*3JW?=cnPzK$yoDD;h+JmHfg%8On0GXg z{$=9VoB}AZrEob_<0MA~0Vk$pT;vZ;TB$*}UPlt{6EA+J3YwWXKodB|L=@DFJ13D1 zknkCBfs35+uknrTxm3GAZopGH{dF!Cm{vi+F|nU|G}(CoUkCVoLtLs*qBIZ|-zJyU z5MMB{(Wic(P>q#n1H(8!5!9E%)oy+=cEgbjztJivv$_`sx+yA>G`kG1O#*X7yu?M1 zQT4v-0M>&sDY;ciys-MJ>G+ZG#m^Zd#Y@dg{_REF5zd6%3v+^#`PNUJ*qD~ITf}RK zqdRjsv04wiYXMBWHM7exqqk-jS177EZ1pyP-xB=Y@W+_hbVumCY>OlZwy<(R*L2;f z_V{sL=3vft0=nux+ydg{Z~-sjXb3``KY#)3%+*z zzk$?OR+zJqSo-o2NBw3GH@qp&l@ZNblqB;8a7dv4Z9f}6nng$Y6L?=uHPlS>9`?p| zoa4egSitTJNam(QxB|Ra$}NkG%ybhp%zwk^GCDAW47Gcv1 zge+b+F&i)p4n$7YurupHr;>7=c?9{&X7 znkv$A?l6sir*sB+azkx4B=i&DN*6FxK?R!Bgn$=6_oQiMU(p{W`qP}U9~d0p_v=l+ zV5K47RLyLPvXh)%5<88#{WlK0}J- zBK()t>a@^P@R7RT={zyA4D~n2?G0sAtqc+S&Eq#l?Mt>#Gw=&N6Lbh9yKCBa%W?lY zv+VTC4bv$c)IPk$D;$harW1sxkVctQ{@O*U7xIg$Qr9-h&Ojcl$RGRT^U-WQW9!D< zJ^3z;MZKl$Vr{c^qcRFV8-9@WWb-TKmnNGe1n{%wyGb7kv_gJrc$c4nIHXLvrD@xm zWiIu{G}qG%th~_S@3Ep+ z)&PSY=nol|ZLnn6!6^{*r-&0pC z#q)8F)OZn17ou0$m$nci5u4cf=cp{LUTDeyb0I0+a0fTjdoM?Ft^W~4)+6!!@?=t` zeI%)l##M^diNQYcFemZ-(kla*SJ~SdZf&$yTc4nhn^(2Aiw)TAbE!QGhR$=pf2ijS zK~%D>GH8rr4D62?Ua;!aR@`cZkc^{@e|IgRn$(pH-<$Uw>6hl97Yf^4l?)fII}SNY zjCvG$CAg3>!X=j+PbKy8Zw9(TTNNH<6kIB#b1??L%&iIjW++wTed1Bj<*O1)>(FCa zCB3S7xt8|oYv?BLkuket|B7C9^Mgy!)Hy+_6UhS{#^3xzwf{b$3)U~lX+U$FM_;A9 z_7vP9?~5M(pxt`Wp*`=@YBw9x?q$(j)0pO2P7GDn2bG-Kfxd%~*+(ZgC}()y8>*dw zf+Qz5f^(f}UbvCd?bDy=zaIpqqW+UL{^^F$hE1*Xai_0RzwVdWov7F)wj7CN>U~{K ze(h6rQOR1+tnLdcKVhMo#pFdi>xc&H21m%TaaZqA)j=fKmr4zM>V~c$(?8%>C2~7@VvolU9z8LbnzmOGpmB_=EcXS)b%LDGYq~Lc{?$}DT zf9}{WUpvRsJE(0Fc`~*Arp82l@~ny9sJotn!B>EsnBmzi(v4@C#$;6=`bQlOOD(Cj ziTl6RO(L&rku`;6X$GeU$Jp}rytc{ICes1w#h!CIkptgK%ADpItN0rZxOHGP8UQ(R zN+vb?FIACh?6+(#oYwdNS1N@*;@(;p47t#~tQ)_o!x6QET*0)RT>swEAF$`oy1X8_ zv0QQa4D@*-X~7A&>V$L#F4$@6Y#ptc#^xmP)U?`uOOeVNw&_3bIYbWgd97jcv-hW@ z*6+l_Y+6b9TcYo(_ZjH?)M-Y+`(uHgx2{wg6~7g=ruTjfR|>%PXisrFy-9+!jefGr zJ>+ruLn#H5o$YU2v*vdD z61Z3(?VOo~0g`t4Rsc`HeRV}x6FYQjPu(^NWY;WpiIqPQELJQ*ile<gpdi{yjNmkPfpRyDw12j6Q&|~VuqIM|&O&D-A$gnQxm3}VHF8P-qnk^t_>xqdTO^`*;HqJm?NtD?z!545`y>Rm+YAMU+4(E=SR zv7wea2~=W<=73fB8bk4i)~mV~FIL|X%@JMG_~SB}gVB@fQ`Z4bA{dy!oMj)1M`$t! zn&%3h-D1BWS$#v&k`v(L)euLnfAWD#VG*Hl9=ZquqymG?%2gc_Exb|n+PV#FeYbJ8 zr1@yDa}kS|G#7Q|j~0j4*!%TIq31|X`-UnPAWzrTJ}nwU*hgm4Z%x@hiZU6mXTEnu zw7tEk;)HrjUTN!{KtA!shW}!sEdLp((m(g7S)$&)f|q+?gX-|layKiBY)kO=VZHnn zx%zL%>`b#0iYBs?tL%BXCzQLU=);(qhF0u?{!ThWz0$KvX{FL*?~wue4pwZ*GkN|i z?Izzf z|2R33W7}`_#xFx4#epEl0;nJv+r=iSJ3oYa`F$#P{KmH~0JzH*JgwCY2FvvICNg62 zV+e>PZyO*O`dAjhi+-txNz!jcvo$Yxu;|W~f zzht6$_cGQ;how-=>6mBTX&2NIAJnkuR6x0TRMYLW%B&c4feL5i*}d?nFL$Tmo z4E~K`WWj?kN;n^#+JL5q8t=>x9XHx{eh(fBbL=OQ-__Q(NjJ@K`8*r+FKipzv<*pI zyoT5_kYPj!WZ4_?4{P?Dh8J;dyDLTTek=L%jLjev!SQ|?*?$J2ZmW&LL>{0!vP;7DfhYv(AfXmp{?$Xv?HLw#|EvKifk1-Cv@ z%zuonkNRAcxd9Dv>2h6OH%qap=Q#~yka0SRKRk(CdvNK9i5ELEYm8`Eo)jE**86S$ z^icU^{s0MBs=founb=63gXTPqS%-`+gYjRb#q4cVy|G^JR&tLC`->rBW>hD#e-H)b zfPk38rPlL|I`{b_eY4VAvnmIZ3ms^^TcuaGC){6rXswyG^?#7=+(*XE_+4-JbWShr z5Gu~aR8=JJCfBB8*5{o}P%Zn*`Zs}6uiZFkuepJ9Z$w-wGnL+>M=>j=Nt@}Yu1||3 zyo!w9uC1CdbX6xaGPz~$m*J;5a4NK|02%!pLG^LJNH?5?{i=@;7$~uY zBuhY7`ZJ^Ehg&?jU%QaiJMZt`ee>aVga*JL!&k`N4yqXIiQrgM07qH|fBVMoJ&#NtZlnkeb}d`cnB+!R8wamga{hKh*7N^Z9|=>4|szVAV-l98y=|biGvT5pA$>k6q=HJn_w&?~1)@IZFK}VzZo-f5ZdaSVh#q>8#-B@!rSH;f46- z>nQr7ld=KZ;Gdp*lPqVTIl{Ezeu$64jFRv{u4WCXU0n8g#it3|+^HzAKbKjbx+#B@ zEV`^=M)>%dpTaPA*jBl^$lQ`MKPjt49EduvQy^Lle@NJ0>~$p(BD7z z{BbAq#Je8U3vx{gyK=YuEYWU$zYij3kYBY}RBgAE0?Tjl^oMFddIK%e|-QxIB_6hS_bPUn8^)=AwLZ&`YmNL3TX+FABKph-Ohhf zDf3T&j9;rnQD3(QnR*xh&a81tkWghdqjs$KzF}itpyCX~TEsZgU~vW-zo~F#uUexV zACNJy!TB-$;C$1KlhuK&)EP|K$j`&klM&I)0JM-ZwE}=nP2nKbp`fut)4hR2 zxk6^+goH|&ZiCYv;y9mN^rLgcN8{C8+L${tp}8SoFt{W!-v(ek1}dO->6V#b6)d(Q z$$d*N+qKnlDZ71L&8XF;(;X;MNV$c60UlsVy@prj7*4H1G4sRw2bf|2milVTD=oTJ zz3dlE`qAho&V1Bdp9?Gjh(V>Jah}=DRZ;1g4d6;$6;kOF{uFmxxi-lG=;8{H8F5v# zeFpq^CSAl;W&TW2$*envy@uK?F9G<}36L?Gm!$bnpjRXeEXw3s;s7-*D?Fpk3yq!< zS#xdj{lHKKr6^{F4^`X3A;xiL0P2v2gad2nlve`7J%0e`<*&*U{tI`BhDrtZ69+Ui zCYFz4o_!54Q}Gc!sPmZlUG1Kgxc2_IZeUWjIhRx~7wp4|l(+TS`m#`4+x#Hclr=`F zDsF-Bg@8a^FEtyA95#8RQ!R#p z0rc~lXC&x*I&kOjOoDAsXw_db7x@~Ah$(xIW8KAP5}zsrcwdbUX^@Awd33lQ z=@G-Hg5&Syx#Auj!|^$$V>d#impzUVzB|B8FddC_)M^-y72g1I_m2eB^0msj@3Qao zVr~Px9%lW@q#i?TS-NVPvu|b7yR64Lk8#xS)K4NmT!lgDpJhpP`!l_36~|9~5WM88 zo2kd&Wn@W(18aI;*~!+eO^ULWk@^$CD}IoX zvRF^SrB}qNNCEY(_{&ZB+?YjMYNV< zMv%fsq`xhsp3QF0i#z%Z)Wt9U>9+4^g#M|9o$<=E&8t=#&I;CDQuJo*^9zRyzj~)I zkwMHl86oH}&irUS6?YZ855UqLuivqTn{qQwIQ{a4-an2aL5KrQyN zGQO(2v$z_MychfU!U}os z!tq}R#Xiq|U~W~2dyXJH-$aGZ!$T*wb!Q!@_3Lw~#`Ci*u()=dyd}CxN16tx+^j(a z`q1=TQBaL`FEmgpUh2oA?h?$c!OxPU0*?Vw)Wa3khbKB@wJqcEBlgIBQoyB!dv z0y#qX%uCV6JnB~w!BsO*b?)zdBlnln2+WJB74ob@u{DbY&Z{q95!EZi!5#M{*7{nE zEDO}etJr|p^OcH+p6=3ap~_6JMX*Sl2V+)5F2*!cXSVjxiB9!PMT=V@lR5or|F`EJ zttW`rj__^czXsoIXiC0WQ;=&CdvTw1oD6HHlgMXzFP$h#7VHD za-rW$y@iA7tU3B?Wy}{q-I8gvoYlN)4z$R<3vHI+pkHt!p`$^G3Gui>KvOIp^KkJj&Ee+SK! z1WI7{&1Q=PUp#%Ys$HI=w579qDWSHpfX-6udUa%-A-!k00&6*c(;0{$Bsu#wZ!Sys zHQf91v7Q=k=S4+C;Vg?~Tu9#*0xF=?%zitvbBi(2+AkMdS%KCXEOhvKu~LZzj~E&K z%cg2djr}bW3X9~{K&G{6;7%@`CPOEC-DX%=JpAWMf1oCgZY5Y$Ue($YKcL1^p2oQ4 zEr)mYmC5x_zxOsyv*l9zCi>--O`aSs}O*%dhc1%*=3Rl~^ z(PyHvxgTb&>$g-}szkZUZz5 zsT=O(+ChIN&ey2PFk7{5_#E#UsQv!#Q94IhiW`blu{GJ^zw(oRN4yZbP)Vpo&XH}q zW@|wm+$YStTtKM{;S7{r^zB5izO@ zAxoK6{@6^bYg((}MC^RL$Z@adHqeVHTR!b2 zQ^?pd?fBs1HY?j3c&Ipts%B9Ka|3AiIWw$b#ajQdtblRgcdi|unKw|c(-Q5KhuzdJzwIsQDM z3vA>Bsuf4-J!AGv4~Axj>@!GnL*{04134;{yT8A8z1jhd1gt!KbOik|3Qd0fJeTz~ zlD=)8#^ZKFSg$KqaeDXukeOLcGRSe0WGUvT@k*LIG>d|5a zxm)Ncedb9ZZ}N1E3!~Cdj9n^#6%SB<_`0k~7g5&9Z>PQ#))7GY6-Z10t4CZFeIr8u z6gL+J_F&ZkPM*NeCX@gyAkoOI2n4?M4MeMA5K(=r7}5NaTHa^!8RI?@-9yPa%14TL&|A;Mr@#Z7Wkjh09Z%1C~Q#Z9iDZ!0J7&VsNP$ z#fiv4xW|mc?(L0=7z+Jk`W5L*>xan6B*!ee|;e1 zl)uRscBM5OlRdn;Yibtd1>lU^N7De;0Qw(v%Cr8XcR+Rq^T-9c=N)wh64QJ(2$xEV zd9|#)INDv}1*ro+$e_)Kl2P`y)`Z>mq zSw&1xzU;at{pe%BF44Ak^u1>1TD*%+?NB(RY2PG$t(rmPhsx=9<@rk4Sjg_W49jVv zznwqh$rQ(?OqGbcZP~-s!-<53I2UB=0H(lz_h^j09QM(2Ya?DT15#AR`SUzm z-c=9mu?^qEN(!ARSv@^K@7*|!tH1vYKXt`ZHfTN{f4{0A#vz?Nc^NvtX({xom&%?D zGy{+LNH#%FNKzEoeKVX&5XL*mgCBN~)g@B?c5CW&(fjID>_xq^-JX;43SCF2I-f^- zHm9FY{4X4!zRH#N@tnKg8<3=QyfpiHdeN$%9DV|T@QjZuGjH~-cvSZ?5FK3D9-li~ ziX2NiP4}NyOeLqa_>_qqx~uq4EEFGRmDwmgzRz}l`*pX$R>38{lQf;6qo+!YC+xrl z-*j+Ty!xrd6dN$6&}qv@|!8=4bu(>P50{fZqM|M_^$I(q2a z^}v64U+|&GeRwf-Fj`LY`$(f9C;i$hGZjU|>7Yw%(2vvpaK#Vu7ZOcQb$@Gk5{1MX zxd4@I+x15q*PCO4t(cl!!ZX?WJ$^mD&|?gmmsw2B8~wvjjEQb3T;IpK8s8lED*ENT zJ=BP7l<>rLAyI*Lt1?Q2=l6;po=Rj>E#D}mdt^lc|D;{=vHg7^-hSy~RPO{aii<`>rx$(cL#PFLe&3`K#kgAKX zKg2y1l!aNeI#zZpK<;Gkl2s#GWz4%hVF+4-W4$jA!uI_U%9B5=STszz0Hohv@jB)B zB~gQc3{O_>!G}M{ivej53@v}dyu@p`ELtWC`g*<@ixP?f=_gfL^8WB3=rZCk<#&Oj zb8Hb^2%F-950#MIuM5zD>>i0qo)%BSN&^L5{>+Qe1;QBpn(zJ~F>LcP=hX^YWr~8b zX?5KBr<=2PK@XzxfaF7@D99AnlO31xyX`a*;5W31VG@u#86_63vFX`QR5ZVM{XSz!!ljSui@MjuyO79MwpDsb z+N10hv+KcM@kn##+*mlrwXiPYXlQXnH*co(=5VkPl~ud1tSC-z{Hz=6PTTQy$ime5`mgE zh9Z+S6{E}zyAb2DF#ucdD|ogIed(86P*YUnyxD>l_3K0$RfSY|f4}CtE3OcoD#k!C zu;R07uQ_xHfIie586?*RUd;Nf^{DUk6Yu-1qRg4b zyDtU_-+a=s(x|t87@WSGL40V}-5{0*b$=}*72kcJ=qSbD9KX`{fTk~vX6dqyNZ4co z1NPE(|48GZ0EFGNuYT}#Gn%3>^+eg;WBsPtlR~rD5O60NGQH3|y+MwBxyiYPww(B} zl5$9lB&pVM)q75Ni0F?WeAx3ikfdi*7oG-PAC=ZEtx9E_zM9GqRIB1YHhukO}g#Qt}fUqjXhi#O6Jr+l9|WA)od2<2s|Kz7f$z@Q8t@3?8i zX;xXXkHa5^xD%z|!}$9Kzq|LUuJm=VU+2c7to9TBRig_h9wpMb#m@P|D{qa<^waC! zT+wJ(H<&_ZHM_4bCwR zM}{?2>y{i+y?RSj9y5XNJx6e*e-Z?7VS32wrJ zeSjL|BQWlK_L95(0N{UoI!XqaVvsA2res}YE2xhNtRE`^n3$OMLSrHwFJ2`8Za zP)=?RkP}}uQEstwrAW;5AqTxN>)^@eKlUhVt%0o5Yi^Q&6!Ul4br&laoPW5B=oL~G zyzxP`Y%`f(vSZ5f)4SMpn?szrfc?_60>TCyX{A2aQt!oa7HBm4?~|})fRbi z(yE_w2-w5!9V|y38|57QVMsl5rz?hx3W!b7m&qAoXGSqIRVD{2o9^F3lYc0(4y{xM ztV`?EGAm6!m1v43Kg^sPry5>b{@}}K^lAUK(xlj1CCJ&&euIx!os}|PIbxK;c6Y?l zX#u#U%+EgjAA_db(Z9d@OtGJs@_95(^0B4{oG;Wp?SP?AjK~Ls*po)J&DFm|+Se-Y zJUMIaIw2Uc5%)jFd~3q5`t2c3Q~Y(I=IFrly)&^#wWfEq4_j{4x9S0ZHYTt&E#xrd zo0W~y&a$s3!%5s@=veObEekR1O)EguWfbU}5^zx_O=&Hq_U5j8%+$*4VOH1M?~(xn z);k~rGom_oN2YyW_(qam5acXPO7}qM55tPz=Z?7;Mirm&Dw?#kQeNDR15|I|jRV;Y z>t^wH8&;tn(PA#jPIfn?Pj{H?%t20R@%j25qgMc0_C8ZvF=6i&3b*(B zl_XcJb~<=PtcDP?sW#;e_!%bSvu=qY%qWeJzMalpO=F?@7b~1;AV9Sg#JsWXkL=#B+=w&O($W2Kpd_j5DXFye7l@P#IulQBq z?0fegh9=pjljKx20P8N<3=098pPAFx@`om(JAXy%Cj@nz?sgJ_CeI}*!S`LR26i=- zk>3t$PGwzK@N&BvxcU0C-E=|cQcHv0SdLF38%EJdTV%EZbSh{l3QDk(P8p zG*_Ecg1dNjW|meNJM2*M-eZ`*>Pg>Al_!VyK$2sUZ-PwcP4}^mx9TlF*M~}zGNWTYEi(-Nvc5;L z^0mix-$f&v`c}>&_B!4Q{k0fpNJGgivMajAxrYQ*)NCA#+vn#b#JHM5qBfW3RMV4% zc+wFqt3tZ+AK7?@akPlq6I@7Gw?x3qKe)xQBm{cG?fE#R<iCzR`&XngttzzM zzYo-7>@_+@)_(2+!JM>)qKrgb7R|WNEeJ-X zLcDg@WpIme9E5ASe5>8709O;p4y%^Ya$_+MNoM)2U;#W&tdULSeB?@A`8*ZhkOiPx z=uB<@^69)v{wjFk(0ABSLq3FP%Hu(XCwf|U;**VMM#jRaL@D0Efd+B`2(hY*!$=V` zoy@Ptc5+;L{6c}4>-Qq+CGpd1UT7sK_WOPA;b!s7uoUZQ-0PGFaz-o+s}_0$x1PV8 z!=AkN%I82MvRCy|h@U|^CR0&=7zASk$sC*7!)Pn}SGzB<&BD8Omve{j&GVJs`J8D8 z7EYmP&t*r>$7(Go?_WF7uQvihbS~=_Kksgr7ClTid^d_$2_*aV3pjDyZqXkG7(UFjtzT}? zjNKFynlDI@%0}46g=*;#Me27EYu9`Toil?P0*_OFQ7&UiYHTGubt(brZ&mw*#+coSLnSGdAHleZGWf%SRq0^hJ zn#8k3ptG2)FW>T8_eUyFHbLPEyBMi2W3lrCKe*#3o+IUH!_%-(g$*#27k!4Ic|0g! z+q}B)s%f8IX4AL>>(&ek9x4+UV2}a*x+)#p1)0|r*l*B}I|eVOBn zm_d^(Xu1$JC_Qk6gjkP(=j{)#Tm1d~kW;R6DN9d~kfB?-G-G)Hbk~KhTSL9yeL4M* zUM_{(UkPrG#w3Lb{?S2UvCZ)cESvef{Zam-$ahP_OX#=p`qRZm0h$eHo_}h3l;ysF z7n??wmn|JVbusUjvb~EH3E`cX_e0{n{eT7yvz4{#qO5&Ja}3hAcsu_kzpB-=j<@b? z(5G;4LvAo-Hw)7>ne^3t?D^(}tL|odjd!6Zi0vO3U~c$I`ltr$k*`sFSCgeP?30(z z;J72g*Ft@!)?>wI<`cq4vCvL_|DJ!23~AKMdIDMHGduXCx*)g*^kA5NnUfKn|gHmB80Q&;I`~MSOqy&&DZ(05VhfRjShw;HQck7dbDVrS}iIZ z*awIbbGu;F60IfU7IeVp&&Q8}!LZ?8E{zqjMrETWXBt;Z>`nMTcedUAx`4lOGKtE*XrLyIjC|8A|Q_>@#7&Cw?s|5o&;!T8}g^ z+mC0s8!5^S{G^v69lw-DF1(dnq(4ggIe70CEU9$5L8o-a-Qt0o2PC-=a@{nT=UlMi z4001G9i7S<%JOt*S{_jg{mg3Lr}sf(eE0~VRt{#MxI8z!>WHq)K)Mfp&3BhD^+O1i zPvbmY7zpIcG8At^Qs3NQGk?6Fa%L()*I@xl_VeVQCAc{K2DGHc(bwfj=9RMS6^e-( zs{xmx6v4IPLNnp zt!1wQ6LP<)c((rS+y6C1RSf=~Vy1m%5n;)-7_E%;F|tYdS;&k*eiE`qWXgLG4P|lR zC8|08bH#G|g*>jNqixg@L@VsZBS-H=1joz}K3eq~E1-@S@0KA@PVddiWfvKHfgz12 ze2x)$KMOw`4Qzog#XkV!Kfm@QL;>k1f-fOp$=ZbCoIIfm6-uidMKR?D0l5_~r-pYN z21r@Z)H20BjlIZlRvc35YF6m8?n{Q-6jd8~;#&mMY+PZPH%??3@yf9<7mIt! zX+NsVEe~RTRwA z6T6GqvND}n7rJn#A(D;ci$Htbsi|+pG*>q$ojQiC&8Gv8@{Nkzwbz#sGHy~>XA~@% zZ#uhSywBd451b$SipuN7b-`56RX^nG8!60eC^u@Kltur@{CS zHB7eWCB_oo#CC-<8G?2ppXs=a%`4$OxnC}Kgv8%AMcXydk7y5of=4AZ94ux+KeJu6 zP%b*_RpB;4gg5aO79EPAgm_R7_w%+9nd=jv((ISZ+@%)NI77c)pRVT(QwuD5aogZ! z`xlhe=wD*z_vwX=*&V$@Y{~w%WrFqdA!aR+!_@`g#KfSDd|MSB}YEvUV)VR12S zNJ=|bvDMP^c4ql^eB{)~ABJ%v_x5o~EBSg3G&M2jQg$BWg7egm4!cK0&7T#9*RiYPpw=$S0RQu{wgGihS=?>T?aI>}>!yv02kyE4 zh$<()CtItq$r_ib$mI*cLi;wY%zqd{FfsAvF*lunXa1UU;cTeGU#B*rITNcJF@Bl6 z?#Wb&{vK@F^YpdKrQ0v^DpvHqnTl57<^O0p1Ra&BPvvgwW@Yf2)W%a2hYZ`m711iV1MvHxK~C_4#E7M5i;>vO4D>TEO7e}m!QoG6q+>c) zZNa~ehvg+Sxaw(9^_{xnTRRlU$2U(_Ej^u2m>0|c3lIpkw|uC;Y*2FKFv)l055qUz zsZRkSz+g@m0nnUb?QCK zn_QV*uD)UvbhGcIY0?;AQnq98|5L7s(w~8|zFXFYd4rLqgYS}ICsk@UgYLE7biVt! zIIrPc(cOeyVhIp?To(QVTwbC&q8X1gFh@cZA#_a&W{0?=ASV-VVgq^*R|YzT=$%!J zaTVk+&z{cZ*cD!2b_o1diGaKFbVUY#Vymz?P9xd64W_jE?+}W9O&Zj!B1ZReQ!|}3 z-gh(531vsrpTl%QCR$y6y8sa*l9_npxp2{U4v=vZ&Qm2l9{*A`(3h|(h%w}>WBw3q z;gQ;EK;$*2=ZG@UQ*?Y`7aj&Cj$KGYFkO91l-$-9S=7II3B#7!W>C1Lk$>wv5T}c} zuM3(`;n^zGvbmfqDo#NG5yJ7KwA_pC$IpxvF@@Hxm75Li^x6QkuE^i&}+89LjFiRFmk!Rq-auT{ja%QE=- z9-QQziu}%uNSB)xhCV@crcP0t`iWg$hWOrjyo%(Fsmq0Jm!ZD>cL)+*uwTqc^0mVr z?(0`}2)ZmDH&u)*E<+nL41X4fsa}k|HmE_ZvcVR%agcs$Z4r9K?_%+CUd0itUy2sl zzmSHtwwLrv67SFnH)12Hi9SX1GHu0EHLWrUHiUQkL_m%O?@5?MJ-ZPOxgAT$m7ayK z#v|@x#_#2H-2)K!>H(9)LqLu8Qp7j`a&YP|7|u)rpZ?$z3}|`fh&xXT4A% zt^V{O2^%2&lkmBnML59=_tSkSGsIT@W$7z<#3A2>$nH;TXNi5 zp$XHPwpTY5F3>p!Ohqh)e$&(%yh{M&lNHLyJ~z`qF05e}#?&}n>;|AEjgFU_E;Kk6 za%g0{sPB48OKhvmS=WcH%e$JkUTu>Lujj2$H7hY+wz6wL_>}<1E_c#wu8IMLZc}kE zQDht~imt!PwSWb)aK&3rzeP)!ts5F|TbzO7VH3`YyK2?magC5z?*$&D3o z&2`N0rFk1f?BK&}HQD?i2Wc%D53OUI7-WCW^gcwGzxIsE|IyK7@XETS-|6QDd{DWX zBQGcDC+0P#WVe{Z^SO98w4L3Mx57)ruy;s|Sqq=p>OwrGJ#i?$5uCQM;A!pwD{(2Z zZgAISnsL{O*wM)#J;$P{<+?W#fpIC}bw%fmE^jW|rt&D5Z^Z^vrtKX-$OR}becC2t z)m`8_J=_ORTj`B)FzvhdF{`C7u0L^$l!<5>;oItJniRrjvDhmLjdXMc@J(iMmrLA6 zkw12p<~J-9>tcH(hEaKo2*CJ!-{33siCltD8xqL@LA|}QqNZgCUCN5cWC>|CMf?2z z?mBN6D(TI9%}#}HneFKTgtd#gj*158O+N zIkr#;UU6g9G^2dRp?P@OY$)#eF3F8Qa-{0@4UOE!gc#&TCQ&gp=+X)!%U{r#1156c zsp1}3wT1iGJs}lDTlfw;^v3B{1d|(qOd7tC!0VcJvS>9x!qBYS*)(;4YTk5aA48y& z_xPB%70sV*kR708#2U`XQJm>T z#3K|=CugajVD*`pdt|tuw*HRfNf=`+X$6@a8NHkP95`r;xQh&|us9l6AIc7_$h*e% zo6Tm%h-KgLM}ssn3hTrX+DD_iJ%eqf@-5$g3r8OIw&qP`Sup!K3@@Wf;O28z(H z@Fxa8RZye@C{H3sc(9(Nx77X)VST6pf|M0(DYHQYwBlrY9N&NWuXvPYJ-*8v`e`Wk zQw^c}gjS&I9%p!0G%)c-JQyO;lHE8n_JUzEtX0N?&@K^k@abN&%fVW{D z`l@SRKt7HgI#ko==1Ng;79XmeQeP}c0n3f9t|M>GN1^UlJswze!`N0~IaUi|q|zpwsSQfYy_c=HG)3QVQOW^qtN_#@#tF7Ul-_?uK+`25f^ zHW4x!Mb8@S{yFW(ooSyZfkCQe8Te-I!lR=b%TxWofDoJdz9B>LZbRw$hJ+NX48hC-F4_}s`k6((d^9w)3o2$XSqu5PMicF2^|fVn&6IlUZL)DaS5F`z5@S=GM* z3elmL+rGYvG-|2KshQKlL4oENQzIE{A|Z`gd8Y$>Qy{#H(kSQ<^Z|X6swSn7!Yq3Q zK3)qeY!gwtU%hNX)m?5bPLu!}{D{XOgwmPu0^M>*|9GH?-c0o4(sg5mlbl_LN_nSB z79hE!K)B=iL3f|g`3C78-imH+vSZ9@c(1`xO(_A3clO%H4=tCFRGd!(~&sT_~B}$Jfu3LXO~kv9d)Tt zGYt0IF>`RVeM%pwGPj`f>dYTy)X(KJ|GY<<_n72ld zMJsnmUUM7M#Tbu;QK|$?pmEiNYBk*mJ&*2B>xkRIYI{8m_L4(3fiI!_PCNjxEdWx| zc!V-~Fau|_bSWE;U!8zYcde;$uuW9*>6_gbj#o3MP3JpaZs>C7d%e##R4+3*)WI_R z=~IvQ0rE91a5rh+Q`IcX^w*285-aL{%dU;S^{c=78{x4&b zTR_Q4XYPz!rxIiW=RLe0TJG~il4zrzq(IFQqmlIuqOmpM-eT7wz=e*0+CHrtM!slj z#WX#4`iX55JKP~M6<(7iaag$yWmcUG1Q-W)?x^qbxTf`o8#R-~EtE4MJD7-z?vdf) zE7pK6aAav%0bN)!z(jwAgLixJEz5$`D~qcJ{>B>$1quEEQ#R+j z0h^>|DC6Ji6DdF4nEBjU1bX-CSqFfOjV*LeOAUo0Q#{ONb3TK(a8{Mc0mrnSu*yn6x=aQ z_b7y@F9XOOzSLtG$x0<$V=*x_BY((S}A2? zaF^T+HnYXM;>uj5%>La6F!NyY$NTRuH~gM@m?s6~j2OdpKzUaJV*o*}>EY;Bi~^I| z&*N*L)>A7!RdU*KW>)MzjxD8?t>Vz+^!fkf^9uSiboK*c5D<33MgUqF$j3yoAU-eV)W0h=}Dz{2XtH1W5rBhSz9*dNI)(ln^~q%uge#;+OS{ z9H8Ey2d>mYVDZcK;K&`k(W5DSiGVI`p`p}zL(Vda7bWciPg?NNKn3eiubqNHUPv*D z=yndF4g^tNcxzvLXAfi)6-R+`SBc?aTGU0M`i zH!06{tL-eCmv(gCHquJ?ew&AedwN;yZ+qV+xOe9G=hCZrRF^$~Jh>BCi9VbkFif%@ zFRAZz2ZorPg+!hgb$cNOBCQ;-p2MA4U^2ZOE^WLF<}$xP(WwFlFPis^I3jA!S7AB9 zf42@VskGrkyXAmtBX7fFwCv$Zar`pxB>!_MZaFvviJUEooEch9%Ww{VLXi&LdgL%C zWK<=)Y*^f);@0NAI8r1)E7l$C9`TK!eu#m`_qgbrFO6Osl+)FRFdB)s^nBVW{I&e3 zC%a?$X!oI)-;^o%CpsY6N4`>M+XLuqSU-r({?UGD3PbRC?)bGM}kX zmXmdt3{To}f%?2BqxM7SLxyHI6fueZ3pAT67<%!GJ_5n>{PyL1 zv#-nMcE26I?T_b7MJFP?ODvJ;(&?xS6@Qtzirb9~k`%Y@e{p&{>ZH~SFi*Q4Q@Y4H z3RJ=}+*<5b%lIjx&>4ORitv)8n6ct{5E>~rS|!MQzM9!ju?DfW08+@pXk9JlcV8E6I@2RT~7LrGy!`>Ck@k{tOHq!f)e z|8vr$b>z=Xe{4m;piZPapR4QWkQR-Dv(PRJ^g*OWSRMwPO1%vNgZgnZ*Af#&S|Cx$ z3ejTEu_Lw}7O~@>rBjyBnSP0dEPbn*!{Co{E|oE+iX)85=H%bkwfgqH_e(WI{e-w{M6mI)pHHH%9}S- zt6wwvA8NC6o*R`R*$82bWeR*CxZZi0ES$EJ1C|W9QY9l4#Rswx}UwjUjK`Ak2Di+%5Egtu;Wzl=w(e?aS_z zp8(7>baTP;81K|CLmzzWlCjaY^#P$Qq1q1}d0JhHGM_P{BP}`X?Qo>f&ks zN>)Llcr1co-{S%wmylch*_h>3K3Vib9+}vrg~;fQ?Hyr_wfr#kJHN6P>$w!g5!9>` zg!84~yhbGb+nYk)&|mi}$V(mbHNjC7uha~@-;iwJ%l|R>epHthUrEsb zki7g&0aNannE**%AOuq$1vPk6Q~SB9g#HUQamWiEiho1#ro;=!HklS-23m1XETn$* z2nsx#@D9Vfju4Mg9&#K;!}-$&@j4-L5XT7BW#mMK0pJT!yH+kg5^8%~VF0uQ{X2x4S@2zZ{tm)! z36sK7T@@y^8U#nS!gs%H$S-Yk^mHk!+@3_?;Xtz8p1J+>641t`4U#vXoUiqxSX{HXh(bOE)+n>6`QU<}d7cF*%vNh(XLv)VS z2}UUYf8Os!zqXH9GRo>5(&mo#P>s!V)#m>2Mn$JehKD9E@Q)`R>2?|VDqPNC`dX}W z0Hl5N2E|?TjT|4~bDgeu_GR8v-dnjqGjj~`O?T0p+H;6VNJkoEW7sweo|SR=X1u4o zU|MpKD@kPYR=edORsRxSKZw8)O0_QijeG9%S>qMum8K|$+9kwURD&ZCJh1STx5Bev zZ5wS-U#Uf0m-VRT#D6&-FVWfGL`KHOX#mmzC+Fe*b*M&KlP3>x0{(e^I%MQ;21Y_L=oa2|dNV{h) z*R9pXIJ`;vct9?8EJ&`-IyY0J!2X|_?(UWSXLz*8ko91UNt*vtsy|3o^ zBPVx_x&w$+nU7CU{P=&3(snjB2l;M%Alv$0uFQEtW~W(QoUZUwY#c*>KY4tLUXfV3 z9afB=HT_X7Sl?=xMS?aC*(_V42pt2c;TQJy0fJn1k^ygAyIl8^!P}-)+q)#ut-y*^ zgKR&KU!blwK#0H3^{Rx5CN9TvNk^``de<82MrPhlr-I z5}~XE6}$UN*8MqmG@P$Y0&Eh8EDY(e*<4g3biUL>7oId1GRiy3Tu4(Oip=*IA}lA7 z&Wt%M(LohQ`g>)@EN@&R-}hkilgqZG)E8AIis8wbiR~YvHdy4%AFLbNSlu2LnA+_! z$L@oEhzvof7SlWfTX)P~W3I9vteYhrg;5`%JMYx5n{HTb4;B34&-7UHyOcyweSof` z?xz3kZh6U}aFzdZZ3l~?!?JP5HD8%XX~n|cdR0Rg*p6<9|LZ;K?dwsfuNa+DBP@Ez zd1P+&%A26w4* zyd;DdTm~%~6neH0M4Wlcsm(?_`hbocuSN1u_#`y~kvI+Yrhb$KmaTc^6xa$GxwuYEmZwT}iFcZlmlWm(0T9RvBuPaoBT;5oPFNSfn?(x$r`o2Bw; zzaz8)Qwj#eXrSd6eIZ`l0J(F%e_T-7nrkl zvZDm56IlTuZ_+lK3{QU@!5rP=7?&+11e;L36aOVaU&Z^0#{>SrZ}E>%Y-=2+!qG!@ zFTfYW`cyyziBWm2;R;JC@jQr^Zy@*6s(-i^_L1V97Ljo;jGr1J4RqnDhH{H9<+wY< za7x`puM)7kLRqb*^B#WS4GNd7iz#V~j_1V64cdJg=q&^*j;5J>@LV)8>`K$HJs}D@ zl$m`?O<2wm%IeQ9(u}AxN@m?`h5xAjv_)Dn!pbH7Bnhq?OS4YnbmeD;?)Q9!P3WZl zSO$><6`+C+UXdk|`$cGc(p`!6r}x%IuXoY{?s?rY_$O2A4f>A518CUhb;?9oAlNOf zyUva^X7XmZ%kiuPx&_uWQZ=O=ai?vK{C;s(xjfJfbcWdDv^qa8(;@%xmXr6a*YTcc z2B()|L>m0RN#|f1dHQ9Q37Tu~JRauz_Ut{2Z#V83aj>Qow$Xt{4KhdWN_{N)7B(?d{H$v?^yakwTfW^=$f-K$FvpdQ z-nWxR#kZa9kb;VB%d4)rt?1Iyj+psWkAqk__mzRrLt)jlW3@&3Gr>OKVlwePA7G=q zSrj4fK4tueVaO5r{cNN-&|^ix75?`=*)+M2cCk_3s8K^~8?sZEl@m_a4dI`v&~!Oo z2?}M}G;1!|@I<@r2mz~9X%1kPN9{qTOEG;k;bqI9L$O1~@|@9Aj__&5?=#E9W~FuV zM)7Z}Xe*W{-_Z}J&yIjqr|4}c@RYz`3J#hJ({W9QL4d6V5UkB;&3xG!J5yWgDrjj6 z6Jl6S3R(IQ1YZ(SeBdvcd|n~2bu(3Mo7{S$Aj8kQ+h({hm>3ZC3~(V^ZOMpps@}@q zLa!;=(GNl=KU7fi$w11=S`XjBpx+ouyXM0~nz-iK%=@5NatrzHKEoLZ;u1Bdl)Tuw zMdCc=`a(P~ZfSVg)WxR|F=-CdwlXbkNb`F zih#}1ioa`(B$n`%xdb2Dq6X@~(cBIHO5CM*sa-4b9TfGrt^~*3KTRsrZa*5h zX&&TNc|=N*3@PK2&vrGA?-Z}ZrM*T9{1^*$*S(5K5PaxMgqXBE5Ee?Vu;~&9Lz6sS z`$_$}Uly6S4?>!h3>9j~l6(ymTvXD8t3tyXI6_(@%s1l+8LB4b0WluR9gw8>WFZ>(cL>@@uW zO_A8^udYY#qBe$Zcw_HYd48vTtwmNo;h_=jE$`ez&5JWdODz0l)AHzmg6`t^Uh7&UBjZZen(U!LixH-s#6X^7* z5~9>X%#`=FLd|#KUBltC#KYDbZz8kS?=AHFEIZ?%jTj!JHjd^23w^WJ$(@K;AQo)j--WG>VBxTbk1U5>^|x%W6!(0 zx@)7-XK$gupg$Tf@f?^=k4yuZvY^$9LoeGVAY*v_?JIvm_0u-fgkoG4Y z<``d)eBlu2wYkFvq$qB)>v2yN&M?lv-Uyp$?-;w-2@WTsm*S8b3D zhf#CMSRnf@!+Ae|{5^x~(X$0nv7S#tQ#W6z(FZptq8cBZ=pVdY1qf`*3Qt$gKMYBb zaU=d=HQvG20j|^aursVlw}9~UE3W^zSKPjc659)*lkV2#{b)r+fBuap_MT&I6FpXk zFP!}k13y`JLuZ3-osG#|e3ZRm8v*MB->r9L4w_)9X_80H9epo%(l7VBYV`K1CwWvt zEO+h6yD~}*BG4rhT^w592ga=_0joEca9T5 zgCB;W+-hGa>i^tD7QWlTU%cE9VGG7Gr!KF(y3dGHTA^1cc0+)8erTrg-kTozmCnRa zHPfIt1t_Y`^i4Pz%AR6|@3_D5b4v}U{$;bd_yu2ujB@7Shfeu!2Rp5{EnOV1#!hkY zIq)T!r>!Hvaevh8naopmz*0p=ab53VpN-u``fE*Agobuayxy#zSQsIB=*5tCq;_Q|E*gQLvUTD-1 zc-Cur%MSM+uZ7|&Ex&pg|7kEITnu+M3pY`oFnx}blc z!%XY?F0l4$vr8xWC7ogeo199vE`aon@x7Q52jJh~3OVB>enWqytt0h1!q}B0;2!r1wqoHBU031V zH|2lxSV$}2lYFMqzvJhk7(Br$C4U&q8Mm;2Wh+!*WAieX-yYDw#m3BnF(z$`h#nni zV;0ME+VCTXsX_(1@A`>wQ#i9M8hBNwgrIwi#T$N8l|Jkf2RDE$Pm~`pBaoK-rGw9u z8?lVcXW!&k&#sx&c1;W&XGHyhmrBM!hLuBPbIoa*ztrSuyk#xWU1~c`17|Q6MD~+i*VxHF z;1|u@I5Ao1?|9H-pLO5ztfRKT;?a*=aTq42*_hp{^lA&uJ*NY_Q~b*$)TGCj=wp}T zITfpUE2lN7(4Xt(pcAR)o+&4=UYotySnmmy*2n|s!s)57;%i42`6x4~tY=3be8>vN z2C~B3=Q{>2{5--A9xY$X^>lXst2BV+#qtQ_yLvOeWO{>O4`3B@G*0$8lA8*jw~~$C zAP{KR^_37V9VempBPTA#v|Gtfv-OEW*T^>mJH{CXx5YxmNFEOAQ-FmG9`c8Q_eaQv z<6%}y6T{g(ABc2=AKxmJZDw?FrZfB6D(^)+aOHkfKu>Nf-fEeG73=COyEN1B$pZzO z{2gb#4$H3Cihs-2EZW}6xf+PHK<5u{^w@YXxm7rbHbLfY&8KAuapX;EhFg;(*R$aL zVJoiYaPwHyRP9b)wtF{Y_U{QV5|#?&X`zz8dt=j)V-0K9LFVtLh-xJ(NV%M!b9G%} zrXy;wNn~0uhb+ajQZANb4*SfPBTB-q|48h8q;+QEY9RM!$hVF#@`v)(=Xf4^1HU?L zZ+fl>@}gg@ecEmJZs5lQF}f2a{}UE7a~u- z_SPF1ayagbu^cR^M^0^838lYTg)EP&HQUxdVp@wSC7m$RHEoVn^6nhnIPscL;$7Si zpEW0*&7R=HTKT?B2%lhCUL9!CGrEYv8t?ggX;dyD%5uO{P>3;>`^VYJX3>8i_vI$> zP8ri;u)~r+B9JGYueRp`1+?3c-o#iD`|0#@pYiU4weUX-kDn{ShpobbE>wu8Jg=(| zI`bV9zp(KJJ%{##>yC%WB2frF4x@HA=t_hVu%?qeS1zz5h+(zn#m684ScvtegRpnviqKe9Js+r>8KQAH0>f~h$k6CN`o)Y^9Fo`d%Fm=Gi`>6|K zlm{$mYv|C7HQMhF!R{{UXNE12Uv^K*;C=#)leEvOC5|Z>2w6+Y3jO`@`=Zfz?9SL( z;?mT-6Eh-K)|#3-THZC6qU&y%0dDhj7M3kE-;M;7r>`*Onfap6Tow^FXNj+l=!6bS zoM`y{$c7Sx00*6fFu8;oK!#_S_qf!VY+ZFV)oLKT%c3?!{-xYTDzXDWlP_P3Ipq*c zms$K0ZcL-1BYPJ0GZXfg^_sL$C8`Qo;n)FDUp&SLv_g$&|Mn5U-i74p4RF26Fv)<+ zM$SGI4L#O)OB~0qzXim5I0^=?x}j^MFcEc3Dr~46j-3ZwU6t``#rI@askzo^s|7cV zo&H;~h?IzDj_8@y6#@bLVeEg_UVUJh7tiF&fBA(3v)z;++Y|4z*cHJi!e5TPu@&mC z-6TGq9?tw>a1-dr>Hr-!Z5p02Gm@7SZBzdjU+*2%RQ#>|qKGIWNQnYc6qJ$(ihy(w zk=`L8(xpq2-kXTDh#*a>^n`>ELT}O`6anc~rMJ*aDAK&!-#KUIy?4%g{|Ljt#sOz% zKi{?1vp&yGx|WHAK$c^}WtINAmohI8e*uMixmj?_1&b~7uok7-uM6A!po^x%&920u zU+1E`vL6Aa`leuI7Raon!0=x8m$@;KGokSve3;CGigNv1K5JyKF&|4vpM@Uk<(Z1{|i*2yo96Kkat*jDcKj;x(~@&V*hih%(7Ydc*eG^Hs18rQZ;pWj5wE zz3=6UOtD=DTW_HcWFxu1EYk*W*&uJZb`={eR7icV?MzMM)FCL}UkEXL!AecWH~)mf zt%ogVWu#Ai@U}lRQ;rRytPnFY$9w{p>|oXF3+Uax=Qr|x1{7$?odrZ-cd)wkQSZKO zAkNhJy@HP}e)=(OstjWV>yF*a@j@4Us`n0YH{Yk044n)<7K(e>O2Lx|-ee4X z*!(4<(Zh68~AmMOfWaH}NC>Z{NyrlC-Iq7KvUPz54XCsCx{;VY>$-1Ukl3Un2p z2)dy}@MtZa(PGlIBD~ZaDo)}|fwHU@7?bQQdY9#fkuMb?&ruR1)Jfx1Ut{&ddGmXS z+D~CaHR!Ic;wf0He$0bD;0Ki~4XM9=(zn_)8Chd*pq5if=1_fCfCN|{Vab4fE@xw~ zNY}N)9$d5j3+81y|7~?d+7E>2tyzT9+%!H!GkFzHl#e0xN{xs*Z_Nqniel&qEBFiB z9M$Z;UhrtcCZRkc3K2ID1O5uaKd`D)(iOwsJ>x!h-+d%}vQ#ipd7EPwc*@-t2ks<| zJ9i(l_cpzN%w06Nt z(Ht+NuaOS%@8&sZT~aDm6x`H$oNJcatt-~-D`c6koIzV%heb{(cFhjW2kKwPA4kmD zE1=dQmIEd4^S`AH<|VzCCtl!UkF-SotYZw!R_mfq6!BNSRD1of_`(dg%!?`f?#Dsw z>T1Eax;w_wy~l1~u|Z~B%e!JKLtgR1^zI`pHOb@+?rH)OEEUO2v*Sr!KNMq%CG*w| zOH58!7Px9URhvM4BIIARCD$E(c^4zb{*p0u_xTpxft5P@A}SeOM)M{Pdid3%lHUV|E+&}BvB}zPvK8Smn>YalYk3fedF+7ow@bE z*nEA2gpVwHC+lmLC1Hjz03Z}Oc8&bj9fpls9Px^3mR*^zVh3=d^DjS!Hh%j?8%6EH zyuLrKwd=pT4|ld);AZ-Ro!_k&p&STHHnIXjUC!j)-<83gQ2`otq36cPpztPXM=6_0 z4r#ALb`jzie0+z?{D!A)ftX`p14d=%FIfksoM5Pd8x}pQnBYnbe4v3dHOB}22x1wf zE3T(36e;?uP`UjhOYZ4e+r<@}DcpSFvTNn8X(-ZX`X$#2o^2L8aKVUM8r~AkqzZGM zZwWSycz;~pocU-+q^oLII^pM4F%_jgpkk=yJS!l!92V>Nh#XxcEPV7|7abN6R>K;E zPu@?G&!c@&fY_&H3AhGO|FR5^&G)*G(lx!-fulO>MdZwLf4CQeWcgw{#Fqq+%Y0r< z-^lJyYz0fYMp-jk{Iln+`R%q#4futM` z!ylU0K!Fm7RrRg>zHgS{pmDnb3RmO6rYmq5DpL;h6+S?6*;@^y-C1a-Y@0$hYz2F1 zPEwxUY&omD03D`%ZU!yFS2~gfep=(p8`&Iq40hTd{;;Y(9}aE~+P;uP9RIl2x>|^r zKap*X9zSxXd<+8){-#RafQ@Hn=l{3YzwOHZOz5S;J9id=GX(Z2Fk;Dg4oqcM zpEK&{)V46;2GUC(@;>lDheo?=0nZP50gy0|&8E1kW2FnYas85+>9-lv{~V&r_(Z7= z-ZZG`mOk5^O0OUB52JX8H~d)gr`tPoq<1;J#!@();5QP{EAx2=Xr~MZVkdI%74CTx zR434Px5n}EIT>ja;aHUp`#xYII+4SGDC2E1L_U!$hyV6Jf!TsK29>f*m^CF3IpDGM z;+xPUhhJ^YyX$T8{GEP<=l1J(`}~Ep!<|8?!a6$f1rSL3WEe7;!w?tt+*gDvgBl83 z8;n7bznXQ`9!|$SYv2`l&(eAMzZxS*)n`KKtBhk}L``&a_b-RCMD+-U5bdFa1QnB# zm)#^PUR1T}2%!|0VTp(VwwH>YaWG{(Pdua@HFZ z3i^|<8+^F8>mA8ra(7OhQlVVjtnxc(>z5yTi4zzDq!Z2jTQ2S{*ZxXq)vJ(AC4w%3 zqJ+{K1-{BgW#!A#UkIH&J65th#IxGF{#0%g{K>N|02D875C1eVypwj==b4|`Tw2It zNcCt6e-iw9k|TNZW|dk8d*>E_aJWPrxIWjQrZeK1PV|)4^%Zz)D;{s~>KgzSv5Vz7 zfr)&SrU-`b1cyw@7}(bkHVb|6o_X;l$Gv13x}#Ag#pDRqNJRRMd0ycQh!y zcrt4&o$n9lr+g?$7nTYxhYVRtK^JKb=sJ7~58HrPS4#U>JCHP^zjVY8$*=VyFSL4rk23ohgLJTe$X#Pd*~I*l@F!BORol<1+nw5r9Hr1=WwKrnq{p&wK1g z;_E%!IY8uF0++>r*QpWjq7fuJ^&?&=-_uRt$WdV3g?1Rs6Z+XU0)Dc9KopC0a$?1n zzj1E(c`U-sL)9@|U1&%yHR(Sqf0n2#gX+7_^lM^)b_r#@&~CLVhoe==xYNR<9oiDj zcE5%^`QyO(>It41G%>Q%Yay~=YrxOybVs%DqW(RO_lH!OAx8}RqaA$Y+4Xry)(s!j zBsHxr?`u!I2Qfw+LY8Gv< zpIdb#(;e#d&v8eN<6qm{5tG$*tgsAEyUZ-$&m|WbowT>IOxuI_PpvvRAI?%~usa!2 zR=u*H=oFcunm z#ebdOHoMOS)|S_g`5=>0vP(yHb97=7ka(K4Kk+?=T&&|Jwz$t^SL>w|uggS0TJwlK zvUG9N-@ZZ!Wi8Pl^VMd$Kk)BkhI7*E#bx7KtmFOjWup_ZK-b|QEEZ8M=F#d;lQcsN z0t1TunRM>+UcC57WBey@>M&zYg1oWV!R8#A#?8AYy&m0|X4y@QlbFNK;qJC8h14~; zzucvy@`eLhC6$#CSLXvA7PPLc{w2HpD7eD$yOBfOQL}v7wYbM znI?tJgc7nQW2U-Sc4k#l4z&-EO+F(h{Mbtwi>*fP3Va1HIayrXLhyx6gWZK_59}a( zf@|ST?_||Ff=Jr0KrG$k!Fi0SUuRUw{K|tNPWjJIY9RsfHG=O|@{zvCJ|fmCovHu> zRD6cV^40NOyuuDU%A=p&;5T~|IF#g^_^(+|S|N>M*OAqmEeampWh^`l4)5QQnaWLI zn*Y)S;P@{8|5oE8|E0Mys+~I{faao}1EY}qeR)!G4>^&j1aVif$Ls)wObeJ?K(k?)8))us-U*;Tia7@}E6Dms~orc2~}NvzbP zO02IBvAtr2#o~Q_BXr%m+#c^SVhcn=H(;Hy6&Sxl z20r*PT|$YHGx9NWr)WCVWxV|7T6reu2)^w&{MI^r`gYCNB(7-d)JT}NWW3MiMz&+Z zsiTij%e={*xgmjSv;ed}o}WuvBF36)(53N!lp)$Wu`z@%Z600@et+Q46$^?+zK|Ma zi!H5Jm^Y(6R#QnZ*_B>=cH5OU%`SyA)_g6HY`IBXM(|=rD!~amVq84(r{GXT!DLGLzDjCCwyIWYyxX z;bm}&!n#>)k-A;Wi?lM6+h1fvL78RmTPf{JO8sDj571ojQs$Fg2b+!jQg=k60^Ezr zK`KMv3vn-lIDiejlQLC1~Uzb{NqzFTon$L4sVG z(5qspU>M7|rB74a|Hufu0lN2b3P-`6$puO;aPHek7l%ObC9`gz~vd8>ToTb|6OO7DzUL?3Ybbbjm>d8?vmlV@^zc zg%)8}hvjA_u{klPwU#URfi1E}UeXzL*g8pc$1$=MN_k-!hq3`Eu9qIpB1hc=-E{?) zD@afTlzP2DXrSN~N{+F$7G(9#Z{)%2`MMmTkv!ufB}>>>@ID}x#SV2z@{>8xJe{Wt zMEwkJbOUxEPy5hi6hYHaSj#kzF9R~Yp`Lifj9BlRuZo%vKsw`Jer%=YKqNIA#ZQB&XH1)>@~27x3|i5d z04wZ6LF-QF{3lKhV3s#NhKYZD^hHMf!NHQ)70ZzbN|7d{S+|`;AA=KEj&c~Z&#D%u z*D>I+*dP^&QP7l%m!%vt4puEGJH%HtIX1oD@d<{-F5LN$eI4cS^pE#W$CIj~z8^c3 zmnCEJN|L#b2?5|@N%+1O&vgkAHt@tWbNypFgwEXSpt2 z+9;d5UVm7J*ynLr7b7`Np(-l2qLBF$(Ak{gs!sS1ar}*nky6Ck#(~tOP*Yfds5_7P z(KmirUUQJN5CK@QE$w2)-yW*B1~`g`0Z5y7Bo)SIvcIJjoG0ueV%=7d*0{ zfo#COHDDdAVDrA>ZuZE|uYl`ngPOvqgu5C4r)Ct+@=Lx1hsCkC;c1NssX8P;>tV%U zStHc~XeTzj(t>K=?B%hZK6p(I-|rr9^@|vn4k4X`xt^Ie;_P|my&=7~S%q71u%Hch z&v@C_L3^<;0wG-sv#w@uv{0Q3+vLBGUoZ4SRt&SY`k1~0<1=H-p~&w0_gAlh{X<9m zgFprXg5R^sGk1rV29A5zsnBD~;X@*?i6%D_Xl}Z@uums_vvEZnPIoY-5)Jh@%9Bpu z3I$!=Pk{YNY34m-U{jLEm%d5@qs;Bt>TY}g%!t*iNgj_YzBvs3CF8eHJZr`tw4X`T zotlL@MlI&1{3Y8?h+Q(N3^Fmzdi2YmW4zWW*dd}oug>frF(Pj2|F*#t{CD)f1XETv z+`0xZ4A28t+K~Z;YTdneVDd4PG?=C`CxalIs7q(!Q6}U8KE9RV1tb1lx*=crZN-ALYwh!??%Fa_U+GXJLWJ(9n&8iIfegzlg+tS^^gcL z5uId2;{qZi9FR{gOmwboNmrp;v4cV~D+0@jINa%)$K6PMn^~E;ju?+~g+A15ZRmYE zu!q&FP2e28V>(*64t<~wZ;FVC_+*&+d>7VlSjjnRngK7@D6p{V#kV zaYFAdijOo+%lXajd3O#jj0waBVNKi1ikxAQVLub7=4n6bIn1!;zu)#_W{2)b>Dy~~ zWwP}_sR-zi6l?y;1Gfc1kJYwJY?(BC0{)}vj;vi)1P2wp+I7^$@F>*P)=>@|OvIi~ zbXJ?$1E|uKP0xiHwnufcVci3y@jqUzGfi=R0ejJ}{kdf-ciX2OdkucLxtk5tbIb+; z!0x2vy~m>$AGeiO#H%^ry7rgjLMeXej+_ho0 z#y*IPIWOS|=j_>_7j;}A=#y8|OjKo(A+O`yeZeoKudnPe{w3RdOl#mt>!NgaDY&D) zd0Ns_gf1iVpu!D%rampMwJ$Vc*6IChy;=<+>AHs953)^L5ja!8m{zT)np~i2ImAwe zqGEAQYLAdN;|8hAGQ1RfOjSE^ini`!&*5z?5SYbKKP ztGUOCbehxP$k%qKk!bt&(+6*^^UV=#DW%t7!K&%Zs&PJmM50)|G4kxA0%=c^IGZ1M zV8{_gtk9%%l*O!8+*HPOHgL%T5=g`;O;mmqv0*o(`aY3fLf`AMA76GTL89Dc0|Kau zHZ@;SZGnymvAThuL#{zlVrxJEVe>!lS*J=GSNPoiwks}2}3NZ zElyG23R44__#-0UDHxy)Tun++*L2Y^bcQ!pKym~&si`lWA+4Jia{vp!X==S;k1ZgY zeiCQ@O%-O#8VD|b>;ylB`oVvgRTZ?|UoeZf4a{Unk=6DxcXe(a4)&(GS5v!)pGrl@boH6V z9EZj`eMD8w3}0MoNt*+y2K0CY=@oq~^bFR7h=pvZVw zSg@*<7#p=W)9hHHUffWv&$2Z5Opn#&jrbBxr^!uVvzyS+=c=QXHXObfQ^C52@~%4i zN(Q8eS7#oqeEzkpHQ+__+ev|O+MeP{MH@VS}C0sdJd z>wKagI}v3s>&@Muq&Ol0RG@|?Ti5VfgZNm`ti?`2mgzH@^qoWG_vrCK8TyeUC*$$X zX^sXmT;QcS4S5O|hq>|qx_Jxzg6Uw|gNXM&zgX#_{o(Ov<~t{E*d^;6tbaNO-QIir z{Nd?rAS=gEWjzDh?E}kp&@;O>y&cokdF2kn4$HSI7pc8Zn-cKrW|=xcowvV9%XaO! z3m2Nt#O=SlGWNUNg~I&Bv$XN**Vpi98NUw|lIL_gvwpiKCbg2~MC02@0^@onBLVCX zRa*Vnk}i8^h7H=#Y8mgaX^uZjK#btP)dq`yPtG6fYCrWRI{uRN!t3EHsTJa`^hyW# zYx*lacCwJbAHWzEo)LHtkTbIX<#p-bwk}W+UdYOZ{r6}W_xjzxwrqIw{aL8mSibW& zZNwn6Mi{rNnu3>};jNeF_Ci31_H9M03#9Ib9`nCOZUb03o@ZSh`L?2C*44CG6F?~AL@qH6Yf=TPNu|1p0&kotbg?qqNC zGW051wGt1W9ebAJYl~{N9kGd-7FioAk^55xnQ0|_YVKWlfR#6mc0~kC*9%^(H!Zl z_PC?#n7aRyTeM`Q`pZCurrF{^UB7)5GqSa&syWL~42lTBbtyvZ;>Xyr`hJ7+;vi1@ z*T{wupjWgq{g9GlTV{L7%=g{SM{&$sA6~zvz1m%|?K^I1!EMV~`A$IQjawEvnL*y^ zdgk00u}*ypkkY&hq_y4}I8h7i_(}2ko+I5de4kkc%Y+>(oUQK*nH=Y!k3Ur(hhO-& z`m1q00Z24Kt7jB$dp-#-xM+M1@dIVfSMOiVe5z@xrf>vUia4&P9`_+KQzTd$oz2=5 z{$$AoD4iDt-9JvXD%lxed6?&Vno#G(zDL)2c7+xf5QrApByGEUY;twE^|pWE8A<3q zb0`a@JBInXbP^E-JcxkX5`_C_&+$`Fjf-P0v-eZVC;2`e#{e0;k^9uff7X9Dt)qGt zUFZ!|h}w6RSS`L81endX962Fncb>>1t@;*ZZ^UqxITQYpos5z^)-BjGVt2&z;0%vT z+-)X1?VTro4i)z-XfV05rEtJy=M099hsKYc^kQ{2JX@2z4{zql-@54fOZMPI*Y~AY zQFnk%@cU~Kb6M*K+Y2|^j&6&baE`xp@jPWydyJo0^`ccxdY#(1CU`=%@Nm})?PK6d zYQBJ_i$;oE4>~IfW|##s2G{7xk;ZL~%+hENd}Z z6t&~jU($Y&9_%I&O1a0F7!UcG++@7Fu~#jVLEH5j&bN#~{lQMvVXR5> zq^NN%{tsTtlcH`6@%BQpIBVbBggz3%)BgsW8ciH>1&@22=CAMaS$CVU;j;vHWWreN z)ABZQE!vn%7>`u;?&S7tXvn#PsBZz~0mk*=u&_76=dD=LF26E+PJ7=luzy+*MLC24 zMEu;|mo5==r)?zUlqwrX)TKNq`YOb%D@=Ye47^o!fF;AYSL~G^bE6;LxO0g!A6^*J zg^{B~y4Nt(B+H+SATE+#3X+3>SX-57Omb)p=>!e15MZSww2LBrh?p1#7J|M6yye}$ zr-pv|$Ohydcls6K0L;Pn_JsGes)p}aq0K8u_0Kl|!-&Seht$G7PV<-~c1h?Wxegs- z^<&9!sd2O}wD+l?_P9ES{6L;$E)N?)QBe`xAw-ZHMr;&t4Yl>>7)|8>LTlGSWB)D2 z-DG5P!+Zrp9&=#Q=~o3@TFMMs)rs4hL+QS)ym5dP0CPSSH2r$pzsBy6w`K!eX%dvA z6HW^v>cx@7?2;y418pkHq2dO(>vV&J?!ZyWFyASZG8B=S3wUdxR{j&dZ=e9g6QBjW zl^oSK4g^fQ{qD4!JgmR~$q@+YLO}+k5ssl#*acP?;!~&J^kezPk6i!OqyAGd>pkNM zD{(bJg-S;^+N2k@mrwpy9MEEj#u7L;Jh=uioHZ~p5xm{AZgM|(Lh2lse)@+m(L-#p z1heSin~#HTovDllahSvt3wkbM`2deaRoTtMJ=^Hzr{uv^I8#eAOjC74+uS?{`5S=m zP_f!lGsNc6GcS>D_rodUROy-JAw8|?85Rg^J{yc_>7g}*S`VKn5thZ^n#j7_K<07} z4^o$QT?-)cb-B8wMe$YpGUDQUUcj)qwkVX`1;P#T0LietQ&C-N^93rTb@IrJZ~Aokv8~HqX#xT+7z? zouH|$ou>&uavUHl4|a-WVyu0{T8hUtzjX+jDp-1m6_2%Uqkst12fm{@mQ%vmA4$Y1 zk!fXuk7BZSG`wK-C#K-M#+orJG-`9#bWm*&TqZJ@0Fk_B;0(=Ivy-WBp`kkxYI^0D0`_a3(T z`l38@_TFb%1LF$;@@kVkUp>xgFKd{^9msG*hIVa1RLQGB6iW$qejiROW1Nsa!P`GU z7m3F;1pnQn(ZM|u($*4P;&u)HqDnGP{}8nN%z2-BJcsD^wz_!}Mrp^Pl>l2RiX+9g z+`!dU5^68RfV6;sI5Ty4*UYuz`qJ3Ahf07Wwo%(_F29(}l?*+Iavt+r#*CGzFA1RE zD)cY>Mx3JcE)qMqn2M()Q=Wo(^YNPTbl2B)#5Z-JT4N1{YVzXI`AnN~MD1`cq`xqY zH>aO*TBt8Z!9Ve4ZVx%~v1Sq(aPWtfn=apVx6;IA@*S8Km?mw_Y0MLV+kdK!pC48BfXQSP5?Wsw?y<<)5VXHccAJ{urzc*u(Wa4|W1Y~o>5AnVI2-#|m4q7&5M`4wO zwlUgfM0=Jn{uE9v8a#7JaNDfTMfAPzmNQ6S`24HrVF4;r&HKox_YC_{%A~ujV|D*j z_2WjHkzZ4opXr6t`bw1VcLP2N;VOn?0Qx9w*X%B6)Z-hA70*(Ndi~-6so#*VOsh*QJqq`1^`N%r~|Rd zGTukIs{(^}Rc+Uy93Z7c#F}^FJpn||?y5WH_Nf^-k+*-G3=<6DLIi?}o;|{AR~u$5 zNI?NWZ{*!UD;UE8#;)ioq>2)wF`1NweBQ=cl$k`~J!Ff2j@PF9CtE?4GYXl9%p1_p zo`nZCng@mrVB6Y=uZY!RmT%nVZ@@91y*bx2Xhl6_(81)j#icP z7brz;#0cqgAYUjd0_n_LGp%Li=Tk-J;6Y}l!rrHlK~%p3Eho#nXqL=8Kr+RIerA6! zdSd_Vv=VZF@&af)gZbY{I>QJE>Mq;hzn1aW>tRMAg-8|VmZCL&s;DtGa@F0Humi0K zzwI;M^)K-T%E8~3skvfb;3{I(;rmDPH@Wn7rmKDDHl3cCPG~)>Y&}uC!5H9A|5O@# zw4h$|q_X#e(2DwpWIaFWveSxX?d+Xw53M(SJwRO&hg!K$( zgRDXwF~RgM$~fbn#*K?{rOjcU@47jio5jABRwwM5bOnFLGs$;AA|7G; zUa&{*tlR0NjrE%>M?IE#wQcJA_IH@)l=|rdy`gW&U!zy|MrsopLOm3lD2|dz(v($fWUaX3#l8-81Nf#ovJ9P{qazw#?VvomjHzy z~@oSKI7H`A{mn=2wW4lsqcI~>OHs|3F+Iz>Z8AS5()B9GzA z+ZI)(7>b9WP4hvWq$pT}-GM1mGX)<^6@ymGd5e@MSk9~&27R&=z+ko5aJahUF9xqT zIb$|D-$C|H58s_PSO-hC&Rlubnvu8mqe;l?FPWm^EUgNw`xzw0;lPcJhop{$ND!- zmUBc+@Czm7@$-Uae3$d5;3_Qw2cq$9f}QLk`{!RbBt^kL8tREP-V4Wyqnqy`i<@x6 z5fT4MPc}u{noO^m2l0a5UI#Xg@j;d0d)^`!VLr~YG+J@IV}%Ws)`$5OW^*w;q_zsJgPq?!dP^D3b*fp43;)c02JP4fqbc?T1=9`viLmq zTg-vM(gvi8QCD& z6+;Wi7efg!L)8ym6dqs|Ho<&DJ0YDvNjk_)?POfy%~8&|&z|V$O6{6Wb%6O;nD0dO zFz?}$ZkQXNC>oTT`^oZoiB+GFZ{fuoly7B0i7-^h*%u)CYxfY8mJ!I8NQFB`BKO7D zp#g(RY2fpC$VBp+Len>SeT@DO*xQ?G(Z5DtieaRBUDG0zvur;4_wfcB7A&8R03mK3 zQHRP^#geXCH1?=DHG?|dh?g}SV<;N?cfhVHK)@vo36qoSQgWh!7ODc!Y{rhTHJ;>Nol%?36qy~FyfKd})~8m_?`L+P?!v?xhMkOia{X-efOJv7u+CG3?3HVJtNs&CU1m5~LW5yYCF~^a;C|`W zoPlAEd8i(6==`?IAupe!(h0h05CrI!1W!YR6;O&5E7E{l*0n{a@h?(0=e~F11RFP% z+tQr;pjr+z&;Uyjkfsud!lRjlDZ9-iJmr6Yf~(UU%Y*=BW`R1BF8*pfLd&9$iGvcc z7dzF|lGiy?K6<`X=3Kv1k1ZsuFQWIhBF;}77p59ygoZ&AZysAqHl`NdiytDgT>ngZ zgVc?d-A*v$Ao$vjxx`19X63jc62-MvjH6j~;dZ+WEuu{~&pffmG=IrtY~s8h7HjQt zvI1?o9WjLLg0V@k6bG#?&C?}w)$440yxH$x0}3-SJE|IIH1v?;Bjx}Likmtahp3O?+WD3eF-tCmh2UjLkkAu}5?+SOF7}ia`AKnKUNkqHO9-?Ahh#N~;bljQFCaH9 ziNWal_{XivfFZkVygO+7oh@l^T;~Q2yfbx?$e$JB(c&eq!+1<&gGKYbQnWuyz4k{6+QtuM6!? zOYHo*8XY1_I1|{fHS#hN2%Xj(h5Z89f%~xO=VEwd!OO_un!^B?(w98%evnT7ZrwYH#f3wq(Bx-Z}g0X6dkfp++`MNop&K%8H3){p|FTao_w!(60 z&*5CJ;att3l@QpJYFO47wjybiiA@{z>an&kFrpDU8ByrBpA!C&qVwpE$o2Rf{+LPt z0Sw6%j!79*E_sy}4bXCtXhYRWT?x?Bxn$6tG<(#7dKZpS!&14-dOmeI4PUQE9a{M& z+kxfb*X8sCnACT>&xa^X+9~~(hLGE+tPp#mFR+L=@kvMEt)VEt&dj!2Q?yO2g{+my zuZp$o2Lwsqyordi$5w+0(9o0Nwv`4OV#0=6dY_oePb7?9uZ>)#xo=1Sa8+{lKJ5kFp`3Hxwsma zMfLFB3F+iS>i0qArwa5!4JzDKrEk3Phb4)Fls!S#65~>F{SODqA~Ikf#6%4IM)TR$ zV{93Ft`qeH#JW&8a(;Uu9HII4Vs_{_|y>K}#Ds$A1zBb07 z7iQX8Ku*pG3`1RX9r)BrJH_8!Az|J%6UZz>^uU*1eb*PHU}8MsQ-plc<HksR@*S_0Ls6{jb|M;gVX$Ne+QWOaZTmJfHz}7!&5+8D&;=Y zg#ttLvKc=td*wi^W;$0;5=ecec+xwDI!9Jgojxc2{_|NLyss zV9_%fiu1;^n}@-mH#3Yy2}g#bO%uhDs{%!xU0UB-XO5SG0v1@|Ti%_IFUt~S-y4pH z;kf8$rm{yIDVarYXIHiSB{Sjr&9Pt>{+EpFo%YhJ%LNmAvZ@zu^TthU6Wwx-2THv* zByoFpk9)Zp+6X5frFh_1A(N7|)FVgWRB3oG@7yC{1(l&=KGFnDoSXpn;!}$%9IEqj zt+Lgo;f`ALB{_nA>g1GG3N}=tK1->k~H+Q%oX-EAxOwPVLEcH=s$MyM-hi!`+&bQBzWJEdGSEfuU zzx|1C+&DJzj^dJ4JzL&USZ1bi*xC-OZjuTP3sNB*KmJ`lU)p_hmV$@9 z(TXA~Uhc37pEIGk#>JsC6r~H}tKrDo`62_gW{I2T7b4LkItN6A$2^RjG-v`=TVzcm z4seLGc^%h)q6E1mK!)jXkYsOyeR)?`|-bpBmAFmc(jl~opqu7W0l-m zauvFV^YL|W@@@fJ1nxuG#ShQj_9WS6hef~@yZv7UV?tKBtr)ojNQ=%;vWz{xm-0fK zgQ6ih4ST8uTw&XS6Ra1RL#bua|Kf&eGV{~bsqtPM9WgZN5rQ}!rVf#Kd%d-~ifwmy zw`CRU&s*MJYp;N{j+1b*%S}~5F*8a4T`6_i`-b^N@3X^9=L%U8UgIy>ja^9l3})tW zPu8|X&!2$gqo&6uIG+N7-^xeN^iRRli+$Q1MdQzgwRr95P)fWE0_6@E`@C-$Jb6_< z`SE}R4Am0#a;2BZ5vV|kH6c9|Q%9*D;2yp(;{x4%CNXmJG18+oZjwr$ z`w_*9p%a)_e9j|>oad{bIQ8T61pJ{7JAphVF2pGC6?(U3sEr&fO&$1ZH?V0JH^`#T z&+HGi(Q3tR3Aa99H!QS4NJmAdqLQTx=@%-6d~q-c3-8m8c^}lMv(R++8f3g&^H!fxN=kNm561UwgA>k#GKYX zyMPl{pktuHI;8)I1`GgLvS+E5&~DJOM|e5?CSua4uXrg-eDY7hb0+PkMpZWP^i8y+{DE3(aA02 zIOl89#R~2Nm@)&M5M?aF(^}j^Z0QMmk{Fo>s&E0Pd{q;YmC@`*bHIO(i3wT64ZMr= z6@d>CA#f&^j%T+rsKOI7MjR)ASP~0|YsN~_g%W%cRBIo!6f+(biNuJ3XaV>#I%5GC z`Y;UVXtrJN?t9)T8%^JIY;~~KA&44xSVGh zVj9MqImXU*%^n*#Rq`8Lo;ga?Q~DMW^8t2gT@RSr0HsFW&+IBllQ;p6F+(bthCT34 z@p$o1CUi4_@`d2X*l!U>eu!RELaz_!`a|h1F^Ltf;0&A_U=y#$R`M=IAm#Lc&YMTx zK*0dewEMO84(P+PAnI9a>Dpl6s;>^2r7jXCEV~=ULvKznlv7PC!FDs@A9tD-XbSQt zl&UqFWT&1{vijb6P%8KH$jw>ZiwwTONa;XsCKEJ1LlZnFbFA1XFuX8>K89BOC3~!2 zns9k8cr)|1&IOTeeeZ|V_di7N?zC)Nj6?WgV#R8ZEYz`qVDM(g1q?omJkD(Z@fnlQ zXrNQVd+EE^Na6HYHgt?nnP?a7HSFsgUou5l!9Xro& zW{2b^NFfG?I&)uXA+|}_7)40;2C5tM+b&rOvHf1g`wkne$G}!qoaxG3`ZS!o(Pr>% zE$eudkJ}M-r5iG5w>Fv;Si{ zOlJ&lH^J;ZntBD%Kno%%k}}cjB-_g{XTR-B6O(M%9~D(?wDu%QF@l4V`$ic{T16mi z$I|drKkixdO1jr{=y}BYAC48%VKbJqC*z8-^Zs6+=f#6PfRpxYkP_$+7NGANe(1S9 zm^J!~BGo_Oa_BTmKwWV1KOW(3f7Soq+4}EYx&P9U|FUCDr%=3@@k2_{fT;$e!T{&3 zN8IO5q7D>b^ud0D27XvM6Vr`MRDqmp29`@K(Dt9SAFc0c3&easq09Nlgq&X_`{09M0E4c>GRbr@_@$; zRK^b8g$hZSMQYa-WlCjW6vZyfi*ISV?NeZ|`?l6|o-Jr@t9bjt(;i4xYRZxHyA85g z>PyY|&Bu94gPSXrTwhmiRo#}Q4qjO>JGEG!dAl+<&3hboaIL=SGNA59!QY$u_Y4nt z*Z*nJn)}*G{r_mu((j*G!2{W3^LJ#$uCdHWn=ShyJRulO;_cvjLDlUcn>5r|~S{ zP>uZapu6zXJ;u(@m!LpN@>?@%bvRpj4`v(uJ-ni?2w!WMTIqL|ZDU;6rT(DYO*x=c0%O~ zBauNCC8%A#`VdsI?@0-WF5z+=m-?t&d_1M0xoZr#Hdr+(E7JkS=uAZs%CBfV8n~RE zFYdZx!z3G3YM9S>HVKP<0!ee6Lw7S; zjpmykFgi@(6;p~?;-yZ?Iam&{krnNlqn>b3r>Nxa+Yfo=%_|u)U3J+hlzx0;Ab`9_;P^C6*%9~u)^hYI6gWfR|sC>kU_wO32YPMv(>JqFz1z3)^@buto_^GBTqdA5E%j4JEd4y$$ zDKdZTtvq1h7Ig9R;%c57?KT=uc-s;oKX3})KXiEKW51Q~vmj^Jp!mkb$gmB(LkyL4 zwJ0tQ5s3kGn{1>e5>`VbSZEZILN@B-yO8z$1UuLrlDH{&gK4wlCZ|D3AU zk~{e|hWdW0AJ4h=n}Z`|Sf+d@CMQDA%;xObXjRXD)ML&`-rVqHeC`5Q_Ht#Yo_d9% z?`lwR>X59x%%%05G_if6X~OBNW0&7V7TQ>+aY=c*{j9U7I~TpObY}O?uI(}*)-Gj= z;fDkD+6K=wj*T$K3Qug(IG#>q4iom3V%sg6J{^xmjO_D{5l}x1=HA4 zRtrqyDySD*ns5)Zp`>%n4*tbFbsevNmrmg;``0!EiCK1(i*^gK|66t&=f?o7=YFuA zsz9AD2AZls)W3YUWPOKe0UddNsEot=_>JrK_pXxvC9AI&2?}mMy%{LKBWt|RSv!y~ zlb|T8c#+iBo?>b*wVrc|k6+ru*G1}7=z6APye@{@Bf8sp#`!7{|~<( z?lo}qg1@|V^X=_i5Eltu2=sL`M=Ic+!g34;=zdk#AHG0M?ll~h*oDqTkche0GX5W~ z-aDS^`0XDT87ZNhvK30s(J-@Rb7VV?Eh`)=**i)&8CfaW`{0~I9I`i2)-hA|UKt%i z==<`yfA{^k@82KiJPwc3IOn|2b-k|V^&G#^(cApJqq!cTAl(!9+G8ADZ$IzTseL(+ zX*)3E*65CC`-j-RVRn(-`NB{4k*;miknuppgV0(0YtE~+J8|fxU95{Lt?Y3ER}H&O zUHJ_C3T*r0JhGGP%CXH(au>S((GU5P$%fjrE;pLL<%PeWu66w&3qb_2OH-G0_)cSO zAZ4DJ_4~^q-CQR%*p#P(hjLMAA?!I3W!YFqmy?mn(>Ekl*v|Di`p8qBgPg67j60wI zDlh)9i&NH--Ee4XjTA?0?(vR&tg{{dB&ru*20QU@o^iBV>7tK7M{_5rJ0zI!rr3tC z50^kIJU-Uh@FtcOUuxfV+!ZVq>Jdcm^FNwMmx|&|FMino1F6}7k56lW^H0Kf$^$-( z@)R$BZk|m%6Df-+O}tj4_Y>B<8YsFB8U?)1MWHXPQK%T~6w9 zN2IU&f+sx=(9pR~D&Ry3jnCCuQFzwU^Nr>>3hD|E3!D;aV`9;s>Y#Vs0s^Y&Do27N zhkIVcHIZrTgU_3~37RIMIZEMOAct7P0@d z6$7@jXKBY@!#EiK*G3*&PmCz+dHMa?!@v5~caZ?!%1~gx$dnyf1S#{w6tk9#-PWU% z%+`OYZ|Gq{6HkvSiy$E3pWYa=?>QT5B||TJJfneK|N;@>1%zg^#?tp;|d4fHj9KP8~Y{wHS*_9 zpHgL@53XeK0doM)qLNR7EB=-IF#z1+q?Cz8U6(1TO47D|rIxmn8kVt~8l6VFRd{u* ztvMzR721z_JMvWeX#Y3ap3n&ah}q`@Tb)e5`NBqb~9c|KaU{b zBcxX)CC6l}XUyWVuy_2=8E=!Y%n^{; z`P)7%Y!jYaZcq)D34;YL_;Jlig)DVp=&@eYl|bRklh-Yiqa$A~5*p=%3#gSoe&G2> z=H!1wdm>Z4YAD)&=^&&l_fz!OZ9@ zO~f^ivDgT0Cq6g$nt&bd_V+_(Tx^e-yG8nSkJgSyq)D;)Ut@(1)xJEbJ28?r9sc*? z+`r&W5(f^YgRZX9(^<^mKvucTOpLx0pXg3X#1;*ABYOLFepni*Lkk)wA`p1lUg<>s zKyFT$vR&z6e(={o=AB0w#3}R12XrB_U?%YzVvnCKCpMWhlKHj;s=M|Al3vr?H2rUV zuPfsRQ*QPMA-M^k+3oGPc787y?~lUu7n7~3lg1ZLc0;BuA8^KOT2M2$G~j2zO!r27#^Tl-v* zn{Gz45Ma6TtD2gG7mJVGFbt2bvxTgU6ckcZmmg7?qLcYM^B$_M(zL7+-+kUX=fw3R z7*bj9kz%l$d9pBnXkEv8TmU{SaoLDHZ~CjO!?}iRB4=pZ2jUsX`M+=fOR06nTF1_x zaoWroP0oR(3>V77t6-#q`RlX18NDG>X1qdbIj<<&aPq}H+{B%hn7sS~Ir0WcH6=vU z97ll4c4Lgk92bMxt^AlI7l9!;+Q{6*Q;H^elijaOj3Ps2N{@^`#FD>|;3bjK9_yUo z~en5nN8mA&Y>fSK#!IOd#U;;t*H;0oTmZ!)Rf|tK46M;pyuC z$evE9IDQl4^^k_ z{XszZM2)BFtSG9|1#N?Ui*bi}_WkfzWe{TS_*%H2 zI(bPQQ3~+cTwANdg=-ngmi%AGCSL>zz$45bRUWeU$0nP9EGww6U)2H5ub))SB^5uE z15VES-dIY#sNq~IjdQwJv`yen?3ZD_U0EHxw2|c^6EPplur?HG&3-ow0(yne6*&(S z5;H23bPaOM!TGslK@n84{MKd&v|O4Mou|B|qcNUPU}l4kytJbq+DU0A9BUe@o2ah` zoe$N|vls2>8;Fv+`KA5|qTS3xQ*CDyr^@M+kyjcgi+vPBXQ4!<*Tou3$Y=6ijIs-~ zS!Ce|>XUnm10KhcSW^b23_{TLX#M$E#%r=}!qu9ePrY34<7hEQ(wmzE+3G zkII_6d=lD?8_b82(aV8ZK&|zL>hzpXbUH1?X&OXK?eH5J_S^}4%jiL5W zr}kgK@POV&%?{iHb4s8RIN^70+0ba(bSg>}YH>`s(!Rvg4h(}&(b}^If@T#G?+HSr zqM%}TVwM8XWJJFQ-#w<>&+SD}q&Ra?$+I&P8w~pnI<|Hu_J{_0O?ob021>hH5PKvz ze1oF-rO#I3o@nCSA@BzBz5RWTj06PXK{_)oXJWI#u(CCZ2^#We1Tp`D(= z9C$vZsl}PV?_g(QKRbhp;@~NNHelH#ZXxnG*6O_+&vnAyVX)#UJj`>I+3fVKMarX< zxtkVLg6X7cky&PT!;vO3)-SK@+)WuMDv_P@dH%yT<%|EwxEiU(j{~>)_GOwl*{Iw;hH8jkh7?Zj44sbSI@6@0zM3gZ6Ys=OFCozQxBh`587n z=yklKJ#jaVEAsh$7kU>BuS2fr4jHIql|u66R}7DC#J=Ku6<{FH(D5uYb-eg%tnwLY zzE8?P;Byvjhgu%+Q|VApxpNLWtjYs1%#S=C&t}whaQ;z){i`mBUb+d^?^Vt~Q2tWd zSxH0+D{BD~==JBx#!|j(L?c}adS62}bjA-$o$1{MenoOO%(sFhl;q#H<2;|kz8^~j zRN_S^Mh3TQlIiF_2U3?ZFT`aeA3fYQ?bvj5XQW%TOqjYfA|~Wv=^7}wa{;Z^7XSJ8-)lHNsppZ&1c)r@uW^zj#n zDEmNtDmhJTjKD_*Gp+Mz?AWD6KTCL+G_A@EvUL7>H%ZP3$lc~%$DDA?{*s%RVdDDk zedu`&aNlVDzRf}3Im2oH`$qA9wOY7WwSeP&vrioN>O3FzybT%-gF7rUEVJu#5!7|% z%#hjV`O11;r2QwMY8Y5?J`R4Nzy7;$|Jw=Xddq0VG5pee z!s6;fLW90^t;t?LaDTs}<)#h&YEv>vdgb4Jc)#QOT@z_p?zu~{#^JuDii6H|jbD!j zcDH^=?PqIRYs9_$M@EnHF$Qt5T5H1XeGM)HafeUyg2ADH@z9^b@`Ij~)RkfBn48@v zP)Xp%9VoWFes|WaI79zkmvY@YzgObkF(hG-t4-RneebulK{;ePXC*}mO=QjG^C#ZX zwAX&MZkg3$c38_OZ0G#+)9n<9%6ztUQJ#@dU1jmB*OxG=r! z1<;88D9iUQx-b7i8aO>fyi8T!NNNC>wPK$U8qhIpGuYe;(?2X!4O)qsvRVRhG*N zbd`07bD!j(q4Q3c03=LYAxGco%GXFG%gJL*O}6TnH|kM~(&VNz8+j4IZm`OL8D-z5 ze7c5<5GZDVx_4+{x*(1&y{56#6E(LG>=k$>eKmD3F}-0&v{&)5l(;uj%bN}1YS~5I zZz;XVK<%nf!#};f0-aExhO|i*X6j!Z$FuV_m>X>HuX32EmBf1WOJbjk&u>8IZu5WT zFj8Ab>xn}R&YQ7TMM@s&sf3jlFRz+aeCUuszsW#N+=Je-Xv;TM-ZIln(~G}7tRK0n z>b#AzV}`IsrKEm@jO~S0&c2@(i@)TmxelsY5n9nDCuqIP3K=HTJOT&Wclj_oD&L~s9|13JlaGu_~2Me zSM%P)Urx@ar$oJiO;paX&o%n6@YJG3a+tA2Qie)Ay!5D_q4J_TA6}7UqGgvF%G#bF zH4EX}lD#ZYg9XMPkp3T|dqszSz|=u~)#gW=(sBPuRg;|q=>XR#6(~d??|%OkYt&kA zTE~^Tdy8wgqhGiP2->H`4>fFdSLgY=@J%VOkWcLVZ7h33Y#JUin6`q=RV zkhg5Dwo?~R`H#h4WnQpQD-of{-1xpA&X{@R?a_YsnEH=>%=<%udol{aogw#k0ij_| zydvD>O{b2DmnG(K{OeBxC0lEp&^!TY*9G72@1_0rz+JcO%Ml{s9CML->>YA~gchAd zmw#-ih(qVkFqjEdC!KZnJS5jOfOezp%WoJi0_n(igLa*C_)PhkVSh8OxW|kgS^io! zM%)nzyl3_3#QZ>YZZu5o{lmw|)rT(v5ur?9rjieGx2M~w z_~J6*C(H+yb4@}_Q6Gs-iO1@*n`T7mdJZ3Wet%i8_yPI-NLiM+E)(7Wg3LYX$0egq z?%k^+xqrWI##=H>ieH=Y-n0x3l-}|Ap0E6Lz5uqgH9z(DBa3=~Zy<;<2-Z|(TSmt|-FzJLLK?YN=`Hna zS8|eb5xcBz^Y@E9U^+A@k$!Xxi>%xq${Q>>eZqSDy*%g>1qol@cx^hUu0_mt*J|?m z$+qu_pe3v$N#@J&X7*pX*Wz_ZjACsQ_~$PBLjY^;a&X`Op2E%^hy1s~=uy=1J@5-p zC2v}%pb0O*Bg2JiTV=4^CF#DH64ov6#%ROCK*0FbaU0Jf%+{*qgVQ0o%BOF(ueQEu z`Lt}=q;lWl*M9GbJ)e34_fS%|jvBk~nttc?tBJKz zy`X|vuTu`O-0r&i*Ccpow26wOvK{v--&k5Ri0f-Kqy5#8uZCRHa=X1DGpeDM5lEjD z|Cr&Flusg`dO9Y@7eBmTNYLg@>=w1R+__vnH|e_EZgTQ_!D*eehr&^M`m`sgxQ zGy6Fm`OAKyr*ppdXF4rgSQJ`x{*=J`@_>qL-#nKir!k-^fc`NDg8Oq3p)$|6mkG{o!7a4rTZeN2Ro<|I)2rwQ# z=3Rpi@}q=JC+>aQg@rdX32{OjCP|4^OQpsIeEC7w=qc?mB%{Y%P=#LEwY~(nXAC;; zm(!0|cXMQVL`p@+NyV;nc^>G3-i#nvZL%=2@UfE^G?%kA&t|Gv${Y6u7vae*_;I&* z1MEr04FIJImj=2X^A_MuG^j00BlMm-;h5?6-8h zveHtu!fJClU(Ykohw2D67iOSpByg`{i``j4dDWB4SAD!5MjHiknAu|YDxHlvL>o6H z(OEDeuo+6r5}CeNseezn+$eifvxQU=Y%Z?YffN$i&lli=n->!CG(jl4Dw)?#a;VVJ z@|5yATHo*(7gej9D^QZj<8S_k`W?JB($=ctWt?-Rcbja?JteOuhQZ)>FS_ws*PxyX zszS{AXy&d=#-S?Tx%!WJrYboZBDEqfA(?)wr9nKr2IhFmWRtxF=&j6OR7C2%v1O-S z_KWJ!7peJnE1oomy_EqA*jUxN)<&=ru<8;B`sP(dW?g9HK46G{E5pA|19{mle8GBJ zQPfH{S+Xq_depY6&1hZb73*kC`-Xu7+S+A!jSK!>h0=O0ZMPU{bWlQ@W)S)aL+(E& zU7Ys2NaU_o$+%weK12v74(a7LTTH@9Aj>e#UF4~`niLOQ2zyL7-oznqJA8%hc4a(<&|KbKHLFoImEwn!+E=wP0pMH+2^F}LlbD5lg62Mx>hn8d|2X+SO&X*FK#9&cDW~$LE8!{$ zLvIpugmk9YLUR}INv!H1ZFSdX=fG;=q9?|Zm=*jUuYi^*rU^Z=1_X*_CZO&&ACBLc zoqH67qLS%=PkWaD1Jsokhk*AE@%rrhg~N9NgQ9)Es2w=M6?df>{0cy0%}IlsIxk+$ z7(jTy4)vKhZp~qzUoo3eLZXQIw_akX4l?LY27x(TX_*fV99wI|AwMA5YkD#9Y)AV1 z+9K&NBaX^Bm1Tk|+%FFo$%CT-opX5Q^(>%Yp_mp~L?+^)w@Ivg^1Y_f_UO`==sM;T zSYIhgGV4t|?Qk^(*1lb^!?F1RW#Fiop$sj}P_>Rp6}HR2yPAE+)VnR3^`O4fgtL=_ z?ZN#UqbHxX1t-c~BH$}`yYhp5QnghA#u523UvQwPgjZP!^*-LncVJj*mqxJ)hfJDU0anD zn4mJ*5V=+=p?8i0cDQtcYqH~FJncOdG`=g{tJqpwQN3@N^RxVhtCLgovueT6Om!VM z3&n7fxLZ`RV~}CppLbIs+uGf}%V8O8CwSV1zLM%=ig|9a9o^4gdQI&5frrXm+4&@8Cs|@fXs3DBaPm5x=@P@$nUR2@81z#6s(L3+CEt#){hNXTpfmg`fbU-;uDAl zF%XtBc=6n;T064$xs?9aHK%?z)N=X-683HjzHdeyH*UL@A`&x__wCzGd~=|M%|m12EK~z+AdItvvpIv?;B_`H05=Sa}e_Kyxih&T->qgY=dRXDR4td z)iN`(B?59peQBAo(`xvXIEa_q-3UNzH}(XUxV~P@O~c?Tg3nL+HFDNg@|_s8L=2{! zDSDZ{H^SEMzqrnls8h8UE7mm-k7ysphr1Et2E@s$Z`*12t#8{Chjo>MpN1#_pyK}! z*17&$0VN;yAMXxaP(YZ z+KBHA^gEcG%?!1;kk}!)bh{=|(Ab3H_2-WqGV%U(HlbUgmi?;j^pO^P2ibE!@GQPn z^PAVJW8TR?41$K0PnqOf@m9YyJ-OIqMSV-=<6`ZBW%0E2Ke7@+mHzw9Eb7G=xsMNb z9?CqRPMa{!yuW#!uP5$r@AQfkfKUICxd+E`ss4OOzGyLhEvcME{sFQmBAf^mF!N{qtsvpubrDcuCxUdMoes*l$%s(fIuy^**lh|BE zaMX=Cb9=YS(EN-|W)ueomjpNF^dvCApi2)rp(-+K1TT4xC`wQi)pfjZk=!}29|CNS zi=b-4Q50S~gnDW=6j)1V1LKy2YTqa38C||Z?|>fXOmg7}cequZZxZ{h`i9Qhc%M;Z zF1u<58OCt3yBRX1Tp$P>Da<3*7*f6I(H&Po3mbvwwgj?dcC%SNoD1_9z zKP!gym8AY7<6j)@vs6S^Z~v`Uo~yb!z+>4oHc{(Rsw#Tpu_t7C_}kO|dsQyN+;?wJ z$<^lI^3yI%;Qd^*7z9_%gxah8et+XVN){`AR-!qfjUrwn&ALr}I%<=!Lkmme^Er`3 zLg34FtzE|xySF>q+3|}({7M!h*aft7ym9S@rO8v|+s33uH4;{vS9bwz@jZU?d&)xS zfZidZZ~^W1PUg=3x8TVnu>ieSB<7MSBU0{H&ZKlh&XJ^jR__+W`tnsc@cz=4;z>^) zk%8)D5bh{A&Qkj)m_;`C!#}7{-ern53#X8#eNQH-2MyJ`(_L!E!{7LF;E6%8M8R;R z)R^>#uVU(8Lo1XoADX)SRM`JY;S{ErcU>9uf%ApoleDeVo?#T5M#dP_PJn&3W{aHi?fDV?B9 zUVz1g18Jp%u?ddO0PZ`)x+ifq^jEHqW<3`sVTvm_VT}ngwKQS5{t4Nxgp~nRf;>ab zCL;5U-j4NWIO8|Aa#A8~LiNCJ&$6<0WzwX*Zg@=OtZKOeHTA^Se@5NNT@;v}Z;C^} z=xWN@z#QL%icLyOBc8SA1{%hiO&viF{=JI~+7P1ugE)Ece`i_)#2MG**e^FLb(LMt zdnr4Bmu6gl4a~GUItE~GszVR|BsmH(cIT6ChIk9EB6Nb2{cjFImaM%cXDaV?!n7zs zSTkIU(n;ZSM_{9vYHoy~2)5;->9fn{O5c+;LkP}-9f4YQFrM+Y<{#B8F!VHmxm3#P zHKYjz`~8h*!nuEq3QV}lo>f`PVA{Q$Oq{?=;J*p`IRuGa=97Oai1v9?PdD?AEb5f5 z37BV*ce{~dG^J~Dq=n*p)Y-h$ZJb41>q}^Zib=TC0UOBSQzr|Zz(H>(H=b38f#~^e z(d^^K)8Xlghi^ijx^ZP*S{HB=sT=t1Xc9Y6;^Ue}@m5?t=gUC1B zYxCq)Sj+q;3Vt1^A7bKot@s6G)VQ(w%MNdU&+$%JzYFgS7kqu=wluO_IrCw3f&YG- z`yb5!t_VDNGCtF@B#d^f)B))Wg%Q@`-gfEAmTza|DDsK!#f1WbrvyG+S~!?$${#s& zhU_NcWBZ?_4ah1&wDn1G&8$0?_fwD7+fu6z23tt@K1*^ZasHQqb zPQr4Z=5*7ikz*wK3O`lD(O;$V1HudpPciktG=kieU;Fq|jr=ZGZV-^(*^Vt7dP^*R z?l9euxwSgIc*s>a>k^gwb;LQ?)s!&}Im|_73$B$(qW_P7WVa!|*(N3(|0Ebqt5{`F z3xdlxJ?$)ezb68%5_46Tr>WyeF5ez^NVgsFn2A;4iIV<2% z|8x7FkV%Em{~DAZk%KQQ|Ei8*fd}m!oMPvc?6!Sd4BfH%d<>jUs7F@1d;H$~$uNg; z14LeQeepBxcxri@Ro0?}LoUR7+BW`cWcyIA=19pcW*lBA#w7#*4-a#Ht{?5Sniv}^ z4QY!+Twr$)GRk}eJN$K0*yNxYvLCgRovA(TGCL{q$w-l}M{uC`#y_$QoKy(;aqdCI z+CMTv;byqoPCC!FTbOmmblZSzRZ$P3BjAyK(bYyK#Sz$05+}y2gyv>Tm6di0=N|V6+fDAz~(fs~vMb zPgeIZ@BvI5f<7OZR|yI~X;;+NUa1-VDefDAkvb4IiC{4Kp~9=>+hO3%6|Q}gv}usG zkIRcaxEs&Lxu@ALj`_J?92+p^b%!KF>&|VHh~W5)c|U_tm1%$#-`Om@!Y6GYLn#rf z4Y`;x@?DEBNPIlB7h%&2@9h$`sEr@d;sIPgdvRuna0UvqFs6jGsZDbh1To#LVBI{X zo&|W{hESoj9TWNF>(&Ak9m4kcMi4W`MqwFAY@ghJ8W2L_{4))Y4eiZ8rMYy`vy!+ipO`8 z3|stZ>*LQ2AS&MsAo8m5V!nwzm^b_aei$Mrbhnk-q>N`DXKW~57!|cWF!+$#)Z$ z#~%rIJf@<$Lv}7y1B}9X8)WwAv}b~k5nFml>5SJm_3y)DR5Ue>K731-G(bxf+=nMi z4tRWf2f$(b@?If#;=8w=h38g{7#>TyYp6;3>kVr^0c+n+3$=sGg{(10)^+^3-`lzr zuFbe3G7F$>U_r^eFqW^$IZ3njfK&v1dKS%U-2fGo`6lfJE1v_q(fy)0a=^R!^K6jY zm4JwqzyMJnV44yOuL5Klo#W95HNgW;=;mPTOYmGaW(@Pf@MXUaAEIix3J-rAF;l0! z8+QQX8O>*WwFyAwSbzPqm1QbJ8f{o!@Cb)<{12LNVBYgF5A<28vjLdmt%spL_R-4* zV|g!Y$wuu4Hcct&kz3`QYUK4lk(iO?kJf8f(0wL9WWe1eP14@^c zVMC=G88FniozuK9KW8WVk7_QlAXxBtAR)q8qStN06W=dv><}<+;CZe1`8nLXA?99> zswQ8gI(X@a-tKq%3tDn>D|Kif!zTC1YwF~I$+1lqzPkeB8e~YvA)2*RU%el7l6HLk zuTG#)%IxwRnu_`e;Z>7_EI$F)@)yk^Oj@$)xhtzfm(FpPH~{99@iWy~%jCJ=&~cN& zcB{p&ch=(kX85fg>SY|J?i%MFbRAS|=XS|a)&~@U(2@vSXD{=6nh9A_xpuBL@2<}W z3KdOW{bO;N#aK0UzazvLtWn1{yz+xb0Dfs`e!-fsgNtAjiwE3%s8+;Mz{S^HjBpj3 z;6TiSHdu}JZVb*L6(1oQfTcFCde^hxV_*HbI^A32QaJ~n4R5dTKvny3^wpD)S$w3Y z@G+O{h)rJZ5uR_TYLb4zlHuSAPBZEcVpU@{r0`1z;>K@1Ftnvm{Dyw1VCfVzaepXn zsNjiZ?q9VC=gVF~L=8+d3Yu$1f9`O9xA{V*B(EZon!EueG_YN+Ge8Ow3uLs&&NZ8P znY#1w!i#3S3h~|p!v;w=#YOkZxST+#ps@O}!A8bmTA-h1rJJJtZSjw6)@cLcJoYgz z*EjQKOis|qOc2tw&uPPrVr_Y02?(~YW1hbk-M=2Xr*$>;m?wI7c#b430TbTrN zRu+3R=|NamhS!~fmi!0af4_w~jfrqP>I9C^OFyT{32$V_BFYU1#!vF=*;r9knO7^5 zPCBuFOPVF`4m-7l{4n53P1XLsd&TSGYUHey?qT&mGLwdR%`yVWQwP12e5#Dg^$kP$ z>4l-Cs3t0kZT$TM`uv~cMktkiVJ3`F^IAxFZr|(yC#+DQH*L3jwm4Ad(;@hz?#CZh zUz|CtFwu{lXsY2n0nHU1Oahnx|Bny!{{;{JcXMq%F9Va^-S5|`O!!BplYAo#GRd3p zKuMY7dn_5`cU)KIMBQv$^Jg}#;eu1*XwQ<2*huJG`|J;m8~mq#_zny*U^|NQKAVC& zQuEj$)w#NCs`uDh4zV9F=l3f{oOV_x%k$CUCZ{Fa8Y>^$f!S1aaU=d!h^vP2{UaX^ zi3ZQOkA%1{2g@Dbn)qGA?@u8t?VOw1kNkP36I56FyR;AP*uRz*zXkA#7KhwXH!6d* zs}%dzTpY1=*Iv)0_johsbVJWVbvN_s&O4hlZ7`urDmy|}nvg!r zPkclzGES3vPKwjCKcKn6getMjnJg%?R>3K3uC`tfX|w?13ElM(*1o+iT6`dA?E+14 z`-}lD0AVjZSGStmn54$OUu^pa^K%DbneU|+H3{dv!diTqEWB4-8ZhR`IC)-S8EjjD z1i0xj0x3OL>)5_k$e4`ihggAb`7u5--@ApQ+?)nPyB+BzCZ@)Ky_#<>E=^5+UX&6J zd~;XBBNz5fWlCWqtWi_4>#*R(Bg}0D)+mX*RC4y~zWLRcw`7lxxzAu5A zy8`WSN&M1`6?fSdFAF7_k9-j+T>ghvm5y(Uv^rww09){pi2Vkm9!l`E^`F%zvfFwH>3 zIvUuJ(>^1627MIKAcu+_NsNE<;TnDZ9Yy_c*`%3>26gF$bK<#AN;u8$wV=;0AjkQ| z{1I{Y;_ii-Vb5Bkp*O2$Au+6`XV~C?qeCRC&>izOnHu}>2?oxnS-gB#=t`cx`&r90 zEQUO%bsfR21m;c|?dOEt(C5`41=4eE^NY zNQ{D5K#`^o@g9yEjemI?!{DA8TOc2*UdOB+n}dFCBl=Y)*3VTFp38@ZKc5$k=N;Bn zR@w*r0@zJn2(XX>b{*BGm*6k#aViPS)81Kp}h=>ol39mWh3l4h)yM8cz(7i zy+})qI)TE&<3s^X2aKid_W}@x5~9Kx1fbz|m-#781*8>h`7*V`^q^3RXN=s5F5ctG zXwAhdB+*;HQUda)nlsEqqT|s?36?Vn^0sX>F&_e0fA!ZQoVg$DIs)EmnB-h3C=d=V z=g+z%m_@T}=L$^EJy!d|EeC_&2Hif2AQUku`+{Inv1Yg_O>7)!+ zPnY5{erag0{qzBuObG@Md6xt_wO}QmIAA+JcU4E8=nhR>vTnK^GE>A=HXo?7ebT?l zx1G@3J*O$eFtM0iySR5z4N1Nv!WFzUN&StwSAd7T_6C0RqhN>EQ2_IISNBjetq#!O0@h(`m<3k(Uz~2ktQ) zhg;bQ!ObBpdLZPPbZ~Q?>%da((p_5LhwWp$=JL#kA`M#BMqQ`94L^WiRl=_~xt-T{ zshWs=baNY=ekuCj%I@tX92Sn=?+s~lv^n5-id-C~byytfBGHlaQ%pryO29n_WeCraG1D?`mL2$UgERZcEENyIT zifXt<-jdo^;g8cDJWiS}P+rUF_vJe+QnJ9V+X2OH4) zs-D8~8@qD&V$tB*!X8%VNTa#7&D89sezbMN(myhdPnDm8tXmXtMN3PMB>l!|4~}NI zIvZ8CCs$(;+>O-(IF*uFJ}o>-DfeW$cAD5E+&&e1Q{9;)m*vaG!aT>FX-=D@tL$&T zd4`po`(HQe|4PcMzds+hd13p{%uFBmy`~#APS}R9eUT;V{D_3}> zQyjxV>@OG_o05>G^u`qt-Jc*(XF+=tWOh)VA0gz*y*i~zDXaJ!S6n+cr#t;cLC&*j zvut{$qy--vEO|=gVmOs?;@;}G8YyzXCRXct{v?Cl)752Y80L;|I@nYQ>f8M1XwtC{kw*V0}Ujy z`e9jlY_tU2`#_xC4f2sEx0E_B_!t<4?vjbsDAW>KK47p;bT|o=H`VDNn zw2G#Qz(NA<5E@GbEy)QcDAir_3fYmQ`ND5=$)3dXb%)Q4C~MZhx2 ztwrB_4*i$`Z6g)q0+6<1k~3e{_TFM)o+|57!ds)Xi-^ifj zY_HfFO02QhnNOAvl|jMD0P2kB@KAp*VdS7Vm5RR%NnwTq}$l+kDJCnrey?~N?=zA8yJZb(%?utv5xg-up5lJl6GU z<{=d9v?Ts!Kv9iMBZ6Sd%`?e)2Xp-J`GujW-2bqER&}nX#(!j|Mb}=Dy2${VuM@}F zPV?z1cwvuP^W>*;F~d&`5zKQDSxeYkk6w~vZ>*Y$T0|HyT2YfB7FH1q!O4D9&tUBx z8j8gU!vm3q>7TnHAL&r0W8da^{SA&-pBXNGo?-2%`a4qX^2ce;LwF*4;3t7u*L1(3 zgmyaL&4l*&kC=VkYtXC`%|){ool*&FPWhEt*3lhi=V zztBL`h%A$Dp;x<3yhp(_V|e4xBHx$K%w%peT|yuXwb+-oJ9G2b7n{&cOFD3RR+F=t z{cCi5KK_{Bm8&!3>J`hCJQup>bszFTWq7l1&cllfL&fz}iwtd&!{L`Sr8K=@5 zB+2`=! zi5|53w=b$dzPt@$r!d;X(xz?e|B73M>Mx-a0Ompv0eAo7*C+?XhHn6ISNjKFTPEe* zrR|89$5`!-OP_bUzg_cV7dha$8*6yux$h*w58p=5?EAHSN@j3{c-Z7x$V)TFF7cngnkw6+OwAnjA-v$k zso>6fC@4yrL{N3E22E_d20m6|&?Z#r3F_;9@h_<{z45hBj+1Lhf|)Kj69C!m}q8`z{m0)~^KP0RFNXv3cupiDH!J7Q=lCDAZGZuYa!JuBit z4w~PC+Y~%beUcsq!Upx;>%*7QmGwTL)LvzC@Dr?4byx@0@)UKGNEr0oM+1if`ARfA zb0U|2Ro;htoWR+p|5numPOH_c`-~(JoLpLYe*DIaN}RDqTPytlbv{!!qd8DALjUe^R7i#I(a0a9~scn{GSmJH!^uHO7_P;GQxZbd1YDzoO6Z zo@0t>eX1kDJX$V{M z*jw%1sXf^Vo@7BIbuo`uJEhx`>^+L`otF6_!E%);&GeT}hvmqn6}P22#A8H1hLAL( z14mN^;%}w*_=^ZbtA{3QAS8JwPCcUBYdx5sgSgq>W zdnHGt6`RhH61N-rMh?&1O#~UMn#vs>pIT$-E*FeMfa%b-Q_xJg@&`??mzdCHL5mKS zNiMlJ1^%)h?$LDkXGF-sEJO=6zUWt>MDJ?bx8+hddQAlPi?>lCSIn^nu_zN$;r6cbJF zKZ73B)6YdO^>}MT+})ygrhDJ4aMnV~`ST5A(Sa_y@BKc$^|$D+%!-98gIoxw%=*6^ z{l}zg%VW=YBd_X^-z&AwO&e-W@l@roZ#~n$cut%{)E9m)wYD6BZ=Xfze~vb1$D6Yo z*T0dCN6Qe9@Efk84Uq}?ynOr{T*yXb`ds<4z~Zgadw|M-8V`{{VzbCOlZ|63joj)G znfYF-HaJTARdjgcCj10NO~T%Y{d|{p>&!va5nvA_exBM?*cVk%&A*70RRr7CncF9W zS^z?9)euBReIx{z!sB!$u)kk{%h!?`d3?7kQgLv9}Gqr7r!W`?;E>0(wk@8n-4!rJ5 zmDX`g@m=TvH1v1zh;;2pc&uatt7l#eYQxdO%Opj*mT*tN(GU`FISIOqE-M-L#HoLo z!3ZKe^v|t6;t1EG0&W}6#q)1E8raSy6d-<>ZNBd@WFnI^C~jCSuEAiKtDh7Ct07UO zD0t^I$2(`EJ@a$W9TgH9S-Q&i==1IQSuUu^Kp!RFdOFVVN~DfXL-_{J_m10bpnNhU zlbC)o8uHf}rZ>Mvzb(uc!9d_o#DH}2DnGnMbAo>ufnhCBFhIK)6)-W+5j2@1G5O~T zKCG zQFNH;uai^iCW5G$bbiv=dEE%CLiylC8k+ZEz6G2~g;>FUX6#H1KUS?MCw1Bz5E}F@ zX45I0p!A!IB*(l&{D-YUD^>u4t_ZBcY4W5xD&V~lqhK@G;2He#I|4NRRsE z>GOybdurY?pmyJ-&u(pw1Q=64$`5R3VnIyTEA6bdp&Q;?h}8{`4uxe3$OI!i{67JkJdGrT9HnKe*ouj&(s|fe>)Hzf<+(u zkW&s=6*7U!>+E)RPt|fZxoaVM#efkaBx!NL@gitM1vk2n44UoHi%BuW75Gc?(i?Nx z6a*99L^H^OYrM4}5vL&QJYux=Q*_?i){Cfo&;=ik_%&)9MCsV_$7!itTXC?k216}x zs$(bsg0g52Hrn@!JjFKGvj}~Z9{VS-EW!%x_r}jZWp(KgJbV>PMT=f?@keSp{(09V z2rBW=%)Y9oJ+Zb#Ho50J2~<(!0?X33qd*WXVwmn!QhuHcmRy0W?QCM{|Gsx1;`NRv z3-{>@JMF@T$}^b~+^0?|ryYUAl_2j69EgPDEF{7nocHgMj~PD|$9D>MfulXI=Q|s) zvUmMQ7PfTyt$W5Yx>j`)He2G(`Ema9X%}XL?EI*+4I8iQA8)6Zrz5q%=cfr{YBBN~ zx!L_!l71p{Uw_A^mF<@Hrk@Mle)JYmM(gXJ(ZX2o3jDhnFGKEzX|j6lKv>6tvzNL_ z^mGO0M}pzl>7;kcNu5p0j@--n^aVuOyFUr_LCC|6kn`y0(1p9b_HlyG?4o7_&IziC z)!WyK%WzyqL_9t3T_RXT4>=`St#K`K3e!QKKT8;&u67+68t)Ou$x^pa)v~G1lQ*PE z$EA1ZulRGO--Zp6{2uX4)Q3E-Zx558l7S6X`uSTops#3h@x9lpTCP8M?q1`x>PGo< zb^zJK$(dy5ZmH%gG{0=}^*UfQUKNTuqT8-rxE76Ec^KOH*G_iiuzVZ0ETnpXT=i)i zZ0x2dgoyfnRD5?glb>ZGM>Sh1kCo(hak(Ep8}?)@Xx8o@nVQL|XIJ<0%h}ti>nL z;dDAgaPqVoi9e@ezqo%CD+ez=amry!e*kMTv4ewL_u84h@j6DK`S`~rOo)$+G(ZXW z_6`Ssvwf&OKr^mjZ1{)EqBtyL1$5bc=Wtyd?tS)|dRgUs`4&ofN*mCh?qlgD*-N7( z1A*=%`4+A5NOpsj&p2av7o|FF3FsC8-2m2eAFek%?@jY~yJ$x1#k6QPCXn}JG6MQX z^ad#>jN``Y_+czk}pKXyMhdw9%!+kL&R*Y&)f*HhFsE=LHe za2zjss7)C_Akfc!l|V0+(Ao6cTK3IabV%dh3?A8LNg;J!Ve6i|w9jM|`iR?0MJ(%&` zI`%z~^QFc;|8Z*D0PxE@GuxMU8WJh{2$;0F%%<7bH_7>efT`L~FWSDmN?DrgPv&Mj zf9O13Y88g@ z)OtaP3ebK?c8w(=GD6O%#%{@cGnQ>!T%2=ddL@RBkA*tWSY+3B1cXI}TKe?fy>(z7 zv*&6te~ys7%{%DqV0zKj!&Wb`3bH~@nAK2nB?v>d^WHL^q+2wtSr2Ix{HUZdgY%%TyZCdRkOSI>2v6E{nD0YSa*|G{*z-nV| z)?U~HqgBqq7LRT+qoRf6EYf}#)O|3>ra877?{sm=X2KSomzdr3H?T`#L$9eNl}Cwm z`7bCCW2bdV!v#UMqrW@x(0;v4h8ZJfxM1fN8ywx;@VxB~*X4-3lIfyk@?@YE+5;nJ zUFB?I`015d_WJc$?Cg!ebhm-88?w-ai~fc?U-2*gwz_lT52XexzIt@_Zfz+Y{K zte`{wteN4TFaCC4belib8nLMjXuUVQ(0=x~gg^~2R8M;?A+{ooe>xv?4PgkL-1 zOe3u?ewyQim68+Fi(GEc@}_{*LqwFsI6Gb%Hlw!P6;mI-kk!^vJ?sd}T$Sz9laJa^ zt=r@}uVd%PP2YZnO#|?h0N}Z@D9CZ6$82xQEri8Xxpmd6^?l0^9sgK;G1XFI9As29 z1!aU~(+;%#8YW*;{TMzbdX@goxye6m^VcnpABxPo7k6+un!8OM8bF{88w+=lPhNOX z;k0|rJ5Xw4ZL7Kqdj$Kp$7GC|_sO-O9#>;fXwJj`zry@5M*@0S%S7MvsoRgE|3=az z5Bq;j28N7y$&(Paz@qsqwig6N8g1g5iMXn8S~KmT{ZzHlSA21a)4y=kZm|o;U}2nn z5Acwb1(385B#y06`guocLC$O-{5|~(<#}+6lSd~;vHEJiZ@4z*a+Y1|d1xpZ>YO4o zGMB)_l#Ievo0Ui>g!`VS+?|5$*>(iXXfGa%QbiCSQ%-5zk#i)T4kIhz?VeeVlpR)l zL^2lFhrGH&R1w#}Oc85vgQw@JBX`OWo>K|u%pp&)TCJan((mkCXUY^-iV)q759E?U zyFj9R3m|fjrN(WQ8_C$C)1k4_lVkv}Ja-PpN7J*Uy_7}Ju*&PQY~nq=4f1d#MtBKR zEia|olaP0aew1=({;7=!A`@(&06`x`2)u@Bw-g6($z6@!k~IdISvXU_5%6Ku z{9il)LiF%H3rJoWW-dX=EL&jF8TZUr63A&glIJz{vh>`N`hud8>;P0T zN5eWJ&Sd~_M%={!z(vhu$e}Ih&@R|Op#)QXpf!v_yH@%Hn9aUq&DkWS<~8*l1kRuB z@FX)k7e?P}q-1wdvn>;$=t)I=T80Yd49)=@wRcn$nYVLzIRFanSKE+WmeI-rcUkIs z$){zqM4a6ywJ$Ls^>WJ5o4Vgs4KmT7ba74rFPV4pN&lsSIz@@+8Wmt6@ma)x^NNqp z6u{dib(#x%I9PfkcJK)lp}S9hvvPch8mjd^ap|om-NQCfph$$NY8{I`I`>$4#FJi* z6!x&(VS$ts%WBh0DpH`ShB=3tN(>dzRI5*Fr<~85p&#fHLf^&BiTQs3%{6|oy%Obq zEi0HRASEc*&kZNv)>pagXY90R=(JYVt{XSqyD_)UUjD?N+Vp}GD+d!03nnnteq$Sb z+8UBRG0X8-E8nr&J2ow0%i(L6uQ0eH@brF%Wm@I?+6x+ebuaZc?&$jtjuR`pZ#J@A zyi<|i0@jBed|RT`a`ok1;zrmaf!+`cDwES`viMI3F|xPPX)!) zZ)L68JjUt_K$*3)s#V(W2w`!yOL+p(Vz7TKoZfcg;pHfwJ*$8CwjjC-1ol+Sci1AV zaSSamg}P%Jg|#^QhtF`#N$uNnLr&3|hB!a(>YA8p`PlMSRbug5H;%&p%{qcZPfZJYOPok7#N zAC@mKdX>g@RGKwRyw_4_Xno?n5~;H}yV%e-f0%I196$FYnuDEPl{L3W=azrKN~2iL zp8~5HPJ6rKg-J0bI@dp*U3HQ${SiQujfKNr^%bW~oyKN6n7yO1%^z&@dA*^Anr3jJ zsh4_urXed|Ayzk$YcI~^3i*Gzp=Q{Tn-pm?q%=EPuJ|K0X(iGZcx*@KW6yO@^i5R` zPs}!7xLeiMO^W^;-EnVcE~Ep`5op-9c>ivNnD4BX*H*7&Wb)Y=4n1Hs)V=@f+xjAG zdQl|k#<5C_fN1UbaY)L3E0pURLyD31)e1Dr?Y*IY-n1}(@n}I{H0wb@{Tr^)zIDuD z0|&=RY|Z6LjVm294_#LA&Y4qU@3!ue#OzC!!T0$2|EDGQa2}BK9yLV#5BheB2!Zs( z(40XLwo`t(0T|0u6rCj(D3sT`Gir`D+O6eLzl4ph9tiJO9Z*}L;F8vdctqBIiSn7! zpCUtbS7YJDr2$2$U(p7vTU1O_wr1L{kSYE{}AVbi7=eH^y~Ins4xlFCqDX z9E^0L_$bYKxo8A;Lmp{e)PMX*qEfke=^C04YnNz=JA5eRn>A5qZt{pSnrix#dXI!6 zmfHa2eV$A>XWUl?;$}mh2Xz_k)6%1RoS}Q5Vub~2XBF>-@~LZ}6s8{GX!wEZP8HeC zBxUJwTl9N%4SVT!B3ZdpyVxeqIBm{aGuX^FZ!$qzqnW63sh}dD%MxrtzsYjTW=Gy; z@)Us%0fGvU5YqUhCrOZfBz_~7<$odoi+FRya>Br}hMF;w%$9s+$JdllZGtA`5cuc_ zOQX~1NVqb8rnQL<5b@0+j;hc29}E30WI(Xs>&den#{(rnND>u4OA>3;E<#M5q|}i6 zcvV$hNT5Q`mKwA|>8cU>B$hF;oqPDk@@L_pT+xMsc zt*u+4V%BNWCW|GTJe;2>xf{Xd*d=%Bc1uC!k(@*;+sy6vgw7%@{a^(<<`a3*Fu1VR zgJ5@WkBXnk0$;Kwn!oe_Blz~9Yg3sj9+kdb^?jQ&RJACqb(?9HUYl)MxQC}ejq0R0 zCE58fQW3-nCAJ~c4$@R6Z7Pe5B!)nt^$CJ)DUOBFE|q4@A)LcY6R)vsw+S$^&I|-7 z922rPCgRjV zRI9MdPD{|&f%cfsh$|n5XGiH?pPMd+VO~?o&)Ci_WMdaZ_DsXEE->v{xKc0j_yn!8 zBLtQK(2-rX4%tY6`wqE_6?fIKjr(e0#|jr{^<mkPWPX@36a`TwwNO-ACl~_jRm` zw_CDrcPM+|LjKTb#5xcJda!Dqx&n1n;~wnfLpC#txJ$A4852f+HcpuNzG{=|$l~B< z8uoXAnxW+_WB;eG!Z~hDN*mC}Z#u_wSCwO0U{H&+uX91TU{Uvg*No?B=}T#5Zl9O3 zS#GUv8~Yxg4LrWQQ8N%fp=Bt-JdrT+Dg?KuftkFHUHbZ+)A@P7?%RnvbpG+Cu&>`j z7p{;D94QNR)W{G^!wk$u{nTP?u%k97MW&Ogt}O=Jth~e6x@4EsJ2cv!BExw$stcXH zf29ZOTipJR?k|G!nqds2y7eA@N7pazT=K|)bx<0Xbw8yYbsVG8nU(Ul&E8|)&dwFfvDt6fp% zYW#ucvVWI?VJ)$(wOiNd6S6J829mS}3)dqPDn1S7OQeIEjH5FB+9oeUf=6fm`}ot# zVfpbjwy4F_RE+?+ItbjGhmaLdDG-J=m}Nmw1d}Xy7P}$Ab5>6Vud*?2)!5)KbzODd znBRkf1M@@q!B|0>J~X%74vzasC>zIyYe)2Z`^pYtP;VCB9FookmAmk(`xxTdJI{`)tt4T2>AG#}4Q4lQm&fI408d_JaHbih@VQ`$*^=O^+-Dpr1;Q{{C(+Y&)om?Qab4J_TZ-gjH!q`1BI(RBDiWQ#V$=?qhG{R zH4z7Z5sz$RzGE49;0LuN8*h2p25P}2`NdjEJ0b_3Sqq*?@yz5=P4q7w4pxRh!S5Cw zC?K2(f| z4fS9%oe%O==ShN}nr#$)VRVG`WqXxIQhU1p?CiqK1oXp(0)M_W9?3C6dwq<0F zY#OJy#iWV|mpj_WLiO5Ku^HIC;jQ;nZ@;Ek9V=hcI+Yd$yE|#&C8+&pg;_%~S zUxcJv?8P{a(;hJ)ZzB!DP{I$wnsX>zFA^jfPn7?5dj;DrR`7yjurlG6J41e*c-|PN zLo4VBeKZp&{2oTBlB53YV6nVd3otKIm8?6~;i9Hc$dC&n9OKOImg-w+P{l{2e0VWb z_gg&85NM`&tcyp_KcG1@Eg$|D{(U5IPf<41-KDv_);@za$WqY8qp3QwzMI<2xN1fB%gY`DP-5k~*$X0MAD9Y0g94`G$#ho?qg-6s!CSjG>yL$)kp#wR#O zU~XgnjgC#l`+qm>gLJZ&;Ru1$W{&VLI$QJWs{b1H4`0F^;SIOrNne*$+4Acl6?A4y zUX-uAL{No`hh5A!uJAP0Psiv_A5 zsO#fSPb-xs+^QNXx~PBnpmHq<@=MDhF;htv(Fax)re=|w0h@&C^uR?$^V?5ER+|6t zMdb@F3DoPq?NF+2XNbGK2kwq&Y%)@Za-}ocmvcU;?A6C_QuD4$lgoQH6D;I^w(fcx z`7U%LmaelJRs8ra@?@K>P{bG2ntcWb>%xDRd~w{|Bea#Zb+u<@(f>Dfi+|Ir@ml0S z$af-dkYt`A8r+%xH74+$8~*9zWTv1>h5i>TPr{PN@~BY3@ba{GUr7iQ2(^x{j_qla zwY$o~IQA8%AIx zN&hiDltvCWR2!b1aaQ=ZEaQ8YZm76lw(I4c@ zC5AH6k6nahd00cPNdcWOo9*zzOWNGsdEou)BpnqkWhp7piux#292L{#OiETTF2fCtIOfrHjw9zgPv$@6s2 zfJ0uvztYK+9s+sPJdn2&mp*2UkhE0;uPp!=7Vi}#IlBucw-_T%RydAnsA|+m#98-T zFR1g7=pk9Yv1W9__5*4tiuKmnp9DFh%K_mcjU*+3eA-+P{0Us{+#!CuhYZ^jz6+Gg zU$U6J#gQX;MPMD5X0+%44CJ_yAiljGCF1W^C#e#j`m;epjsH;oE-O+~k75MHe6;jX z^q>QAJ8XbtzJB`fuI;toRjah4GnYXqSJf#G*K(Pt-TBQnGL{x++N$BV1t`G4#p=JC z{-c-d0m|^npdKXB8P=pkLS|>$Ai@uO)rm6!3Z94*(#4*Py$Dk4Bg$}=EhY*D(RRTS zlE7^-*?GO1ZO=~JX4>Kk`nBz++8fKI@&#UrVvcf1rbL|})ky>kg%F|kHWP(zaBes- zQRER?n!8=*ZBVyA*y(5wYop&~3`2y(rAa@j*2bVQCFm7ids+G2Pl{$D=1l^0C&ErN z=qa@4opLetnLW#~8wylO*QBFXULw6Fm-~_X;J8uavBwp|ZqL=H_o@pctM<&~gZh+@ z24Hz73Z7h87<#722Wd~lyj45|;bEidP83dz>LLVm(3C9N&7pchEs$Jq)9XOoTX)Bx zx??O1%G)u22rZmb_eYT{9oa|E8?&6Nb5{X6YPb<+fA*|@f(*ETSC9KIOqq$vvSqhLpd{K&wy%~|b>!VA>nuq8gzLj^Kq4SF7oD)kS_FJciUNnE;)~;TB5H88lpiZBB+SN3_9%H2JKl}FZ?Ai(Z&E`@lz19bUUyO*4N zEacbaFP#?Ps9jPT54sK|L+=hK2v(32;dAaenG2u;uf%6gT$LD4LNAf0(|CU^^LROv3HEjpuREq56E**lNcf3bXRsf`L9F5a0 zr8re;f)i(GW-y_uqG&svDMIVHod`+v2p`^#kj&4v?coQenvkeH0IwYGO@muoz!ZQO z1gL3}_8wqL^-n+!B|~_JODQWFIg#&@PRDCZ%22Gb2xZAEm?Q^&i8P@vIb}Z|n$Ps6K84k#c zKs}uU!8vn%WI+0kN%_kLsTQTSz(MFlJKZtM;8vf9`jpuZ+{;t=Q1Mke-^)v^-r^`R znOnxhkrJ~uN83LcB@m}0=K8SfhEleabxEA z-mAR@;^!nWnd&Pi8OChK;ImJ#9iEH`xL(+0lXM??+wN)$QD~v8&SbsYzErqOSR~X| zbdZz?sk=W@4jLD)X)$I4)MqZ;8GHIo))z`sAg}FW!fvsdUq_^Tj^k)O#K9gZT-C=} zQs9OCw{v7?UH2~`O{w|!j)s?wdbUJfb9QL4%}T*oA@6`>*F&i_l$P^nT{l(R%f)n2 zj2&S9$bmNkkAV7l(zEzkSv;g=1cc!?>Ovnt2!jbF^hd2#JtO4zjPip{y3^J(hbQD8`?>!smmgQ>|I#&@T_NW7ob-Ji76!P5N3silc z_uwPwZK147QLX?Lwa-?E51ozm&!}X=Dyp2PSZ;*bO)J_PHSxjG?X($2U_A&UAs-SVLWd zPs8rICuZ3*cl|8y-RcUp`dQpPlS=BkR62d_hLVHjAHG${i>*)BNanHp)`N+1LNS%X zYo9FjAcK{c<15)`J`$g0Xi}c(m#eKqmI5K>Q2N1s;ts Date: Thu, 14 Mar 2024 10:58:20 -0700 Subject: [PATCH 067/438] moved generated protobuf types and some dependent utils to types package (#1756) --- packages/state/recoil/selectors/account.ts | 6 +- packages/state/recoil/selectors/chain.ts | 42 +- packages/state/recoil/selectors/ica.ts | 4 +- .../actions/core/advanced/CreateIca/index.tsx | 6 +- .../core/advanced/Custom/Component.tsx | 4 +- .../actions/core/advanced/Custom/index.tsx | 3 +- .../core/authorizations/AuthzExec/index.tsx | 8 +- .../AuthzGrantRevoke/Component.stories.tsx | 8 +- .../AuthzGrantRevoke/Component.tsx | 22 +- .../authorizations/AuthzGrantRevoke/index.tsx | 33 +- .../authorizations/AuthzGrantRevoke/types.ts | 16 +- .../GovernanceDeposit/Component.stories.tsx | 4 +- .../GovernanceDeposit/index.tsx | 7 +- .../GovernanceProposal/Component.stories.tsx | 4 +- .../GovernanceProposal/Component.tsx | 8 +- .../GovernanceProposal/index.tsx | 24 +- .../GovernanceVote/Component.tsx | 4 +- .../chain_governance/GovernanceVote/index.tsx | 18 +- .../ValidatorActions/Component.tsx | 12 +- .../ValidatorActions/index.tsx | 17 +- .../FeeShare/Component.stories.tsx | 2 +- .../smart_contracting/FeeShare/Component.tsx | 4 +- .../core/smart_contracting/FeeShare/index.tsx | 6 +- .../smart_contracting/Instantiate2/index.tsx | 5 +- .../smart_contracting/UploadCode/index.tsx | 4 +- .../treasury/CommunityPoolDeposit/index.tsx | 10 +- .../treasury/CommunityPoolSpend/index.tsx | 10 +- .../core/treasury/ManageStaking/index.tsx | 22 +- .../actions/core/treasury/Spend/Component.tsx | 2 +- .../actions/core/treasury/Spend/index.tsx | 8 +- .../components/SelfRelayExecuteModal.tsx | 8 +- .../stateful/components/dao/tabs/AppsTab.tsx | 8 +- .../stateful/components/gov/GovProposal.tsx | 2 +- .../gov/GovProposalActionDisplay.tsx | 4 +- .../components/gov/GovProposalLine.tsx | 2 +- .../components/gov/GovProposalList.tsx | 2 +- .../gov/GovProposalStatusAndInfo.tsx | 10 +- .../components/gov/GovProposalVoteTally.tsx | 2 +- .../components/gov/GovProposalVoter.tsx | 6 +- .../components/gov/GovProposalVotes.tsx | 2 +- .../components/gov/NewGovProposal.tsx | 10 +- .../components/profile/ProfileActions.tsx | 7 +- .../components/wallet/WalletStakingModal.tsx | 2 +- .../components/wallet/WalletTokenCard.tsx | 8 +- .../components/wallet/Web3AuthPromptModal.tsx | 6 +- .../hooks/useInstantiateAndExecute.ts | 8 +- .../stateful/hooks/useProposalVetoState.tsx | 2 +- .../stateful/hooks/useSimulateCosmosMsgs.ts | 22 +- .../stateful/server/makeGetDaoStaticProps.ts | 2 +- .../stateful/server/makeGetGovStaticProps.ts | 2 +- .../actions/Mint/index.tsx | 4 +- .../components/proposal/GovProposalStatus.tsx | 2 +- .../proposal/GovProposalVoteDisplay.tsx | 2 +- .../proposal/GovProposalWalletVote.tsx | 2 +- .../proposal/GovernanceProposal.tsx | 2 +- .../hooks/useGovProposalVoteOptions.ts | 2 +- .../useLoadingGovProposalTimestampInfo.tsx | 2 +- packages/{utils => types}/.eslintignore | 0 packages/types/README.md | 43 +- packages/types/components/ValidatorPicker.ts | 5 +- packages/types/gov.ts | 30 +- packages/types/index.ts | 1 + packages/types/nft.ts | 2 +- packages/types/package.json | 9 +- packages/types/proposal-module-adapter.ts | 3 +- packages/types/proposal.ts | 11 + .../codegen/alliance/alliance/alliance.ts | 0 .../codegen/alliance/alliance/delegations.ts | 0 .../codegen/alliance/alliance/events.ts | 0 .../codegen/alliance/alliance/genesis.ts | 0 .../protobuf/codegen/alliance/alliance/gov.ts | 0 .../codegen/alliance/alliance/params.ts | 0 .../alliance/alliance/query.rpc.Query.ts | 0 .../codegen/alliance/alliance/query.ts | 0 .../alliance/alliance/redelegations.ts | 0 .../codegen/alliance/alliance/tx.amino.ts | 0 .../codegen/alliance/alliance/tx.registry.ts | 0 .../codegen/alliance/alliance/tx.rpc.msg.ts | 0 .../protobuf/codegen/alliance/alliance/tx.ts | 0 .../codegen/alliance/alliance/unbonding.ts | 0 .../protobuf/codegen/alliance/bundle.ts | 0 .../protobuf/codegen/alliance/client.ts | 0 .../protobuf/codegen/alliance/rpc.query.ts | 0 .../protobuf/codegen/alliance/rpc.tx.ts | 0 .../protobuf/codegen/amino/amino.ts | 0 .../protobuf/codegen/amino/bundle.ts | 0 .../protobuf/codegen/binary.ts | 0 .../protobuf/codegen/circle/bundle.ts | 0 .../codegen/circle/cctp/v1/attester.ts | 0 .../codegen/circle/cctp/v1/burn_message.ts | 0 .../cctp/v1/burning_and_minting_paused.ts | 0 .../protobuf/codegen/circle/cctp/v1/events.ts | 0 .../codegen/circle/cctp/v1/genesis.ts | 0 .../circle/cctp/v1/max_message_body_size.ts | 0 .../codegen/circle/cctp/v1/message.ts | 0 .../protobuf/codegen/circle/cctp/v1/nonce.ts | 0 .../protobuf/codegen/circle/cctp/v1/params.ts | 0 .../circle/cctp/v1/per_message_burn_limit.ts | 0 .../codegen/circle/cctp/v1/query.rpc.Query.ts | 0 .../protobuf/codegen/circle/cctp/v1/query.ts | 0 .../circle/cctp/v1/remote_token_messenger.ts | 0 .../sending_and_receiving_messages_paused.ts | 0 .../circle/cctp/v1/signature_threshold.ts | 0 .../codegen/circle/cctp/v1/token_pair.ts | 0 .../codegen/circle/cctp/v1/tx.amino.ts | 0 .../codegen/circle/cctp/v1/tx.registry.ts | 0 .../codegen/circle/cctp/v1/tx.rpc.msg.ts | 0 .../protobuf/codegen/circle/cctp/v1/tx.ts | 0 .../protobuf/codegen/circle/client.ts | 0 .../protobuf/codegen/circle/rpc.query.ts | 0 .../protobuf/codegen/circle/rpc.tx.ts | 0 .../codegen/cosmos/auth/v1beta1/auth.ts | 0 .../codegen/cosmos/auth/v1beta1/genesis.ts | 0 .../cosmos/auth/v1beta1/query.rpc.Query.ts | 0 .../codegen/cosmos/auth/v1beta1/query.ts | 0 .../codegen/cosmos/auth/v1beta1/tx.amino.ts | 0 .../cosmos/auth/v1beta1/tx.registry.ts | 0 .../codegen/cosmos/auth/v1beta1/tx.rpc.msg.ts | 0 .../codegen/cosmos/auth/v1beta1/tx.ts | 0 .../codegen/cosmos/authz/v1beta1/authz.ts | 0 .../codegen/cosmos/authz/v1beta1/event.ts | 0 .../codegen/cosmos/authz/v1beta1/genesis.ts | 0 .../cosmos/authz/v1beta1/query.rpc.Query.ts | 0 .../codegen/cosmos/authz/v1beta1/query.ts | 0 .../codegen/cosmos/authz/v1beta1/tx.amino.ts | 0 .../cosmos/authz/v1beta1/tx.registry.ts | 0 .../cosmos/authz/v1beta1/tx.rpc.msg.ts | 0 .../codegen/cosmos/authz/v1beta1/tx.ts | 757 ++++ .../codegen/cosmos/bank/v1beta1/authz.ts | 0 .../codegen/cosmos/bank/v1beta1/bank.ts | 0 .../codegen/cosmos/bank/v1beta1/genesis.ts | 0 .../cosmos/bank/v1beta1/query.rpc.Query.ts | 0 .../codegen/cosmos/bank/v1beta1/query.ts | 0 .../codegen/cosmos/bank/v1beta1/tx.amino.ts | 0 .../cosmos/bank/v1beta1/tx.registry.ts | 0 .../codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts | 0 .../codegen/cosmos/bank/v1beta1/tx.ts | 0 .../codegen/cosmos/base/abci/v1beta1/abci.ts | 0 .../cosmos/base/query/v1beta1/pagination.ts | 0 .../tendermint/v1beta1/query.rpc.Service.ts | 0 .../cosmos/base/tendermint/v1beta1/query.ts | 0 .../cosmos/base/tendermint/v1beta1/types.ts | 0 .../codegen/cosmos/base/v1beta1/coin.ts | 0 .../protobuf/codegen/cosmos/bundle.ts | 0 .../protobuf/codegen/cosmos/client.ts | 0 .../codegen/cosmos/crypto/ed25519/keys.ts | 0 .../codegen/cosmos/crypto/multisig/keys.ts | 0 .../crypto/multisig/v1beta1/multisig.ts | 0 .../codegen/cosmos/crypto/secp256k1/keys.ts | 0 .../distribution/v1beta1/distribution.ts | 0 .../cosmos/distribution/v1beta1/genesis.ts | 0 .../distribution/v1beta1/query.rpc.Query.ts | 0 .../cosmos/distribution/v1beta1/query.ts | 0 .../cosmos/distribution/v1beta1/tx.amino.ts | 0 .../distribution/v1beta1/tx.registry.ts | 0 .../cosmos/distribution/v1beta1/tx.rpc.msg.ts | 0 .../codegen/cosmos/distribution/v1beta1/tx.ts | 0 .../protobuf/codegen/cosmos/gov/v1/genesis.ts | 0 .../protobuf/codegen/cosmos/gov/v1/gov.ts | 0 .../codegen/cosmos/gov/v1/query.rpc.Query.ts | 0 .../protobuf/codegen/cosmos/gov/v1/query.ts | 0 .../codegen/cosmos/gov/v1/tx.amino.ts | 0 .../codegen/cosmos/gov/v1/tx.registry.ts | 0 .../codegen/cosmos/gov/v1/tx.rpc.msg.ts | 0 .../protobuf/codegen/cosmos/gov/v1/tx.ts | 3365 +++++++++++++++++ .../codegen/cosmos/gov/v1beta1/genesis.ts | 0 .../codegen/cosmos/gov/v1beta1/gov.ts | 0 .../cosmos/gov/v1beta1/query.rpc.Query.ts | 0 .../codegen/cosmos/gov/v1beta1/query.ts | 0 .../codegen/cosmos/gov/v1beta1/tx.amino.ts | 0 .../codegen/cosmos/gov/v1beta1/tx.registry.ts | 0 .../codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts | 0 .../protobuf/codegen/cosmos/gov/v1beta1/tx.ts | 0 .../codegen/cosmos/mint/v1beta1/genesis.ts | 0 .../codegen/cosmos/mint/v1beta1/mint.ts | 0 .../cosmos/mint/v1beta1/query.rpc.Query.ts | 0 .../codegen/cosmos/mint/v1beta1/query.ts | 0 .../codegen/cosmos/mint/v1beta1/tx.amino.ts | 0 .../cosmos/mint/v1beta1/tx.registry.ts | 0 .../codegen/cosmos/mint/v1beta1/tx.rpc.msg.ts | 0 .../codegen/cosmos/mint/v1beta1/tx.ts | 0 .../protobuf/codegen/cosmos/msg/v1/msg.ts | 0 .../protobuf/codegen/cosmos/orm/v1/orm.ts | 0 .../codegen/cosmos/params/v1beta1/params.ts | 0 .../cosmos/params/v1beta1/query.rpc.Query.ts | 0 .../codegen/cosmos/params/v1beta1/query.ts | 0 .../protobuf/codegen/cosmos/query/v1/query.ts | 0 .../protobuf/codegen/cosmos/rpc.query.ts | 0 .../protobuf/codegen/cosmos/rpc.tx.ts | 0 .../cosmos/slashing/v1beta1/genesis.ts | 0 .../slashing/v1beta1/query.rpc.Query.ts | 0 .../codegen/cosmos/slashing/v1beta1/query.ts | 0 .../cosmos/slashing/v1beta1/slashing.ts | 0 .../cosmos/slashing/v1beta1/tx.amino.ts | 0 .../cosmos/slashing/v1beta1/tx.registry.ts | 0 .../cosmos/slashing/v1beta1/tx.rpc.msg.ts | 0 .../codegen/cosmos/slashing/v1beta1/tx.ts | 0 .../codegen/cosmos/staking/v1beta1/authz.ts | 0 .../codegen/cosmos/staking/v1beta1/genesis.ts | 0 .../cosmos/staking/v1beta1/query.rpc.Query.ts | 0 .../codegen/cosmos/staking/v1beta1/query.ts | 0 .../codegen/cosmos/staking/v1beta1/staking.ts | 0 .../cosmos/staking/v1beta1/tx.amino.ts | 0 .../cosmos/staking/v1beta1/tx.registry.ts | 0 .../cosmos/staking/v1beta1/tx.rpc.msg.ts | 0 .../codegen/cosmos/staking/v1beta1/tx.ts | 0 .../cosmos/tx/signing/v1beta1/signing.ts | 0 .../cosmos/tx/v1beta1/service.rpc.Service.ts | 0 .../codegen/cosmos/tx/v1beta1/service.ts | 0 .../protobuf/codegen/cosmos/tx/v1beta1/tx.ts | 0 .../cosmos/upgrade/v1beta1/query.rpc.Query.ts | 0 .../codegen/cosmos/upgrade/v1beta1/query.ts | 0 .../cosmos/upgrade/v1beta1/tx.amino.ts | 0 .../cosmos/upgrade/v1beta1/tx.registry.ts | 0 .../cosmos/upgrade/v1beta1/tx.rpc.msg.ts | 0 .../codegen/cosmos/upgrade/v1beta1/tx.ts | 0 .../codegen/cosmos/upgrade/v1beta1/upgrade.ts | 0 .../protobuf/codegen/cosmos_proto/bundle.ts | 0 .../protobuf/codegen/cosmos_proto/cosmos.ts | 0 .../protobuf/codegen/cosmwasm/bundle.ts | 0 .../protobuf/codegen/cosmwasm/client.ts | 0 .../protobuf/codegen/cosmwasm/rpc.query.ts | 0 .../protobuf/codegen/cosmwasm/rpc.tx.ts | 0 .../tokenfactory/v1beta1/authorityMetadata.ts | 0 .../cosmwasm/tokenfactory/v1beta1/genesis.ts | 0 .../cosmwasm/tokenfactory/v1beta1/params.ts | 0 .../tokenfactory/v1beta1/query.rpc.Query.ts | 0 .../cosmwasm/tokenfactory/v1beta1/query.ts | 0 .../cosmwasm/tokenfactory/v1beta1/tx.amino.ts | 0 .../tokenfactory/v1beta1/tx.registry.ts | 0 .../tokenfactory/v1beta1/tx.rpc.msg.ts | 0 .../cosmwasm/tokenfactory/v1beta1/tx.ts | 0 .../codegen/cosmwasm/wasm/v1/authz.ts | 0 .../codegen/cosmwasm/wasm/v1/genesis.ts | 0 .../protobuf/codegen/cosmwasm/wasm/v1/ibc.ts | 0 .../codegen/cosmwasm/wasm/v1/proposal.ts | 0 .../cosmwasm/wasm/v1/query.rpc.Query.ts | 0 .../codegen/cosmwasm/wasm/v1/query.ts | 0 .../codegen/cosmwasm/wasm/v1/tx.amino.ts | 0 .../codegen/cosmwasm/wasm/v1/tx.registry.ts | 0 .../codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts | 0 .../protobuf/codegen/cosmwasm/wasm/v1/tx.ts | 0 .../codegen/cosmwasm/wasm/v1/types.ts | 0 .../protobuf/codegen/gaia/bundle.ts | 0 .../protobuf/codegen/gaia/client.ts | 0 .../codegen/gaia/globalfee/v1beta1/genesis.ts | 0 .../gaia/globalfee/v1beta1/query.rpc.Query.ts | 0 .../codegen/gaia/globalfee/v1beta1/query.ts | 0 .../gaia/globalfee/v1beta1/tx.amino.ts | 0 .../gaia/globalfee/v1beta1/tx.registry.ts | 0 .../gaia/globalfee/v1beta1/tx.rpc.msg.ts | 0 .../codegen/gaia/globalfee/v1beta1/tx.ts | 0 .../protobuf/codegen/gaia/rpc.query.ts | 0 .../protobuf/codegen/gaia/rpc.tx.ts | 0 .../protobuf/codegen/gogoproto/bundle.ts | 0 .../protobuf/codegen/gogoproto/gogo.ts | 0 .../codegen/google/api/annotations.ts | 0 .../protobuf/codegen/google/api/http.ts | 0 .../protobuf/codegen/google/bundle.ts | 0 .../protobuf/codegen/google/protobuf/any.ts | 0 .../codegen/google/protobuf/descriptor.ts | 0 .../codegen/google/protobuf/duration.ts | 0 .../protobuf/codegen/google/protobuf/empty.ts | 0 .../codegen/google/protobuf/timestamp.ts | 0 .../protobuf/codegen/helpers.ts | 0 .../controller/v1/controller.ts | 0 .../controller/v1/query.rpc.Query.ts | 0 .../controller/v1/query.ts | 0 .../controller/v1/tx.amino.ts | 0 .../controller/v1/tx.registry.ts | 0 .../controller/v1/tx.rpc.msg.ts | 0 .../interchain_accounts/controller/v1/tx.ts | 0 .../interchain_accounts/host/v1/host.ts | 0 .../host/v1/query.rpc.Query.ts | 0 .../interchain_accounts/host/v1/query.ts | 0 .../interchain_accounts/host/v1/tx.amino.ts | 0 .../host/v1/tx.registry.ts | 0 .../interchain_accounts/host/v1/tx.rpc.msg.ts | 0 .../interchain_accounts/host/v1/tx.ts | 0 .../interchain_accounts/v1/account.ts | 0 .../interchain_accounts/v1/metadata.ts | 0 .../interchain_accounts/v1/packet.ts | 0 .../ibc/applications/transfer/v1/authz.ts | 0 .../ibc/applications/transfer/v1/genesis.ts | 0 .../transfer/v1/query.rpc.Query.ts | 0 .../ibc/applications/transfer/v1/query.ts | 0 .../ibc/applications/transfer/v1/transfer.ts | 0 .../ibc/applications/transfer/v1/tx.amino.ts | 0 .../applications/transfer/v1/tx.registry.ts | 0 .../applications/transfer/v1/tx.rpc.msg.ts | 0 .../ibc/applications/transfer/v1/tx.ts | 0 .../protobuf/codegen/ibc/bundle.ts | 0 .../protobuf/codegen/ibc/client.ts | 0 .../codegen/ibc/core/channel/v1/channel.ts | 0 .../codegen/ibc/core/channel/v1/genesis.ts | 0 .../ibc/core/channel/v1/query.rpc.Query.ts | 0 .../codegen/ibc/core/channel/v1/query.ts | 0 .../codegen/ibc/core/channel/v1/tx.amino.ts | 0 .../ibc/core/channel/v1/tx.registry.ts | 0 .../codegen/ibc/core/channel/v1/tx.rpc.msg.ts | 0 .../codegen/ibc/core/channel/v1/tx.ts | 0 .../codegen/ibc/core/client/v1/client.ts | 0 .../protobuf/codegen/ibc/rpc.query.ts | 0 .../protobuf/codegen/ibc/rpc.tx.ts | 0 .../protobuf/codegen/index.ts | 0 .../protobuf/codegen/juno/bundle.ts | 0 .../protobuf/codegen/juno/client.ts | 0 .../codegen/juno/feeshare/v1/feeshare.ts | 0 .../codegen/juno/feeshare/v1/genesis.ts | 0 .../juno/feeshare/v1/query.rpc.Query.ts | 0 .../codegen/juno/feeshare/v1/query.ts | 0 .../codegen/juno/feeshare/v1/tx.amino.ts | 0 .../codegen/juno/feeshare/v1/tx.registry.ts | 0 .../codegen/juno/feeshare/v1/tx.rpc.msg.ts | 0 .../protobuf/codegen/juno/feeshare/v1/tx.ts | 0 .../protobuf/codegen/juno/mint/genesis.ts | 0 .../protobuf/codegen/juno/mint/mint.ts | 0 .../codegen/juno/mint/query.rpc.Query.ts | 0 .../protobuf/codegen/juno/mint/query.ts | 0 .../protobuf/codegen/juno/mint/tx.amino.ts | 0 .../protobuf/codegen/juno/mint/tx.registry.ts | 0 .../protobuf/codegen/juno/mint/tx.rpc.msg.ts | 0 .../protobuf/codegen/juno/mint/tx.ts | 0 .../protobuf/codegen/juno/rpc.query.ts | 0 .../protobuf/codegen/juno/rpc.tx.ts | 0 .../protobuf/codegen/neutron/bundle.ts | 0 .../protobuf/codegen/neutron/client.ts | 0 .../neutron/contractmanager/failure.ts | 0 .../neutron/contractmanager/genesis.ts | 0 .../codegen/neutron/contractmanager/params.ts | 0 .../contractmanager/query.rpc.Query.ts | 0 .../codegen/neutron/contractmanager/query.ts | 0 .../neutron/contractmanager/tx.amino.ts | 0 .../neutron/contractmanager/tx.registry.ts | 0 .../neutron/contractmanager/tx.rpc.msg.ts | 0 .../codegen/neutron/contractmanager/tx.ts | 0 .../neutron/contractmanager/v1/failure.ts | 0 .../protobuf/codegen/neutron/cron/genesis.ts | 0 .../protobuf/codegen/neutron/cron/params.ts | 0 .../codegen/neutron/cron/query.rpc.Query.ts | 0 .../protobuf/codegen/neutron/cron/query.ts | 0 .../protobuf/codegen/neutron/cron/schedule.ts | 0 .../protobuf/codegen/neutron/cron/tx.amino.ts | 0 .../codegen/neutron/cron/tx.registry.ts | 0 .../codegen/neutron/cron/tx.rpc.msg.ts | 0 .../protobuf/codegen/neutron/cron/tx.ts | 0 .../codegen/neutron/dex/deposit_record.ts | 0 .../protobuf/codegen/neutron/dex/genesis.ts | 0 .../neutron/dex/limit_order_expiration.ts | 0 .../neutron/dex/limit_order_tranche.ts | 0 .../neutron/dex/limit_order_tranche_user.ts | 0 .../protobuf/codegen/neutron/dex/pair_id.ts | 0 .../protobuf/codegen/neutron/dex/params.ts | 0 .../protobuf/codegen/neutron/dex/pool.ts | 0 .../codegen/neutron/dex/pool_metadata.ts | 0 .../codegen/neutron/dex/pool_reserves.ts | 0 .../codegen/neutron/dex/query.rpc.Query.ts | 0 .../protobuf/codegen/neutron/dex/query.ts | 0 .../codegen/neutron/dex/tick_liquidity.ts | 0 .../codegen/neutron/dex/trade_pair_id.ts | 0 .../protobuf/codegen/neutron/dex/tx.amino.ts | 0 .../codegen/neutron/dex/tx.registry.ts | 0 .../codegen/neutron/dex/tx.rpc.msg.ts | 0 .../protobuf/codegen/neutron/dex/tx.ts | 0 .../codegen/neutron/feeburner/genesis.ts | 0 .../codegen/neutron/feeburner/params.ts | 0 .../neutron/feeburner/query.rpc.Query.ts | 0 .../codegen/neutron/feeburner/query.ts | 0 .../feeburner/total_burned_neutrons_amount.ts | 0 .../codegen/neutron/feeburner/tx.amino.ts | 0 .../codegen/neutron/feeburner/tx.registry.ts | 0 .../codegen/neutron/feeburner/tx.rpc.msg.ts | 0 .../protobuf/codegen/neutron/feeburner/tx.ts | 0 .../codegen/neutron/feerefunder/fee.ts | 0 .../codegen/neutron/feerefunder/genesis.ts | 0 .../codegen/neutron/feerefunder/params.ts | 0 .../neutron/feerefunder/query.rpc.Query.ts | 0 .../codegen/neutron/feerefunder/query.ts | 0 .../codegen/neutron/feerefunder/tx.amino.ts | 0 .../neutron/feerefunder/tx.registry.ts | 0 .../codegen/neutron/feerefunder/tx.rpc.msg.ts | 0 .../codegen/neutron/feerefunder/tx.ts | 0 .../neutron/interchainqueries/genesis.ts | 0 .../neutron/interchainqueries/params.ts | 0 .../interchainqueries/query.rpc.Query.ts | 0 .../neutron/interchainqueries/query.ts | 0 .../neutron/interchainqueries/tx.amino.ts | 0 .../neutron/interchainqueries/tx.registry.ts | 0 .../neutron/interchainqueries/tx.rpc.msg.ts | 0 .../codegen/neutron/interchainqueries/tx.ts | 0 .../neutron/interchaintxs/v1/genesis.ts | 0 .../neutron/interchaintxs/v1/params.ts | 0 .../interchaintxs/v1/query.rpc.Query.ts | 0 .../codegen/neutron/interchaintxs/v1/query.ts | 0 .../neutron/interchaintxs/v1/tx.amino.ts | 0 .../neutron/interchaintxs/v1/tx.registry.ts | 0 .../neutron/interchaintxs/v1/tx.rpc.msg.ts | 0 .../codegen/neutron/interchaintxs/v1/tx.ts | 0 .../protobuf/codegen/neutron/rpc.query.ts | 0 .../protobuf/codegen/neutron/rpc.tx.ts | 0 .../neutron/transfer/v1/query.rpc.Query.ts | 0 .../codegen/neutron/transfer/v1/query.ts | 0 .../codegen/neutron/transfer/v1/tx.amino.ts | 0 .../neutron/transfer/v1/tx.registry.ts | 0 .../codegen/neutron/transfer/v1/tx.rpc.msg.ts | 0 .../codegen/neutron/transfer/v1/tx.ts | 0 .../protobuf/codegen/noble/bundle.ts | 0 .../protobuf/codegen/noble/rpc.query.ts | 0 .../codegen/osmosis/accum/v1beta1/accum.ts | 0 .../protobuf/codegen/osmosis/bundle.ts | 0 .../protobuf/codegen/osmosis/client.ts | 0 .../osmosis/concentrated-liquidity/genesis.ts | 0 .../osmosis/concentrated-liquidity/gov.ts | 0 .../incentive_record.ts | 0 .../osmosis/concentrated-liquidity/params.ts | 0 .../pool-model/concentrated/tx.amino.ts | 0 .../pool-model/concentrated/tx.registry.ts | 0 .../pool-model/concentrated/tx.rpc.msg.ts | 0 .../pool-model/concentrated/tx.ts | 0 .../osmosis/concentrated-liquidity/pool.ts | 0 .../concentrated-liquidity/position.ts | 0 .../concentrated-liquidity/query.rpc.Query.ts | 0 .../osmosis/concentrated-liquidity/query.ts | 0 .../concentrated-liquidity/tickInfo.ts | 0 .../concentrated-liquidity/tx.amino.ts | 0 .../concentrated-liquidity/tx.registry.ts | 0 .../concentrated-liquidity/tx.rpc.msg.ts | 0 .../osmosis/concentrated-liquidity/tx.ts | 0 .../osmosis/concentratedliquidity/params.ts | 0 .../concentrated/v1beta1/tx.amino.ts | 0 .../concentrated/v1beta1/tx.registry.ts | 0 .../concentrated/v1beta1/tx.rpc.msg.ts | 0 .../poolmodel/concentrated/v1beta1/tx.ts | 0 .../concentratedliquidity/v1beta1/genesis.ts | 0 .../concentratedliquidity/v1beta1/gov.ts | 0 .../v1beta1/incentive_record.ts | 0 .../concentratedliquidity/v1beta1/pool.ts | 0 .../concentratedliquidity/v1beta1/position.ts | 0 .../v1beta1/query.rpc.Query.ts | 0 .../concentratedliquidity/v1beta1/query.ts | 0 .../concentratedliquidity/v1beta1/tickInfo.ts | 0 .../concentratedliquidity/v1beta1/tx.amino.ts | 0 .../v1beta1/tx.registry.ts | 0 .../v1beta1/tx.rpc.msg.ts | 0 .../concentratedliquidity/v1beta1/tx.ts | 0 .../osmosis/cosmwasmpool/v1beta1/genesis.ts | 0 .../osmosis/cosmwasmpool/v1beta1/gov.ts | 0 .../v1beta1/model/instantiate_msg.ts | 0 .../v1beta1/model/module_query_msg.ts | 0 .../v1beta1/model/module_sudo_msg.ts | 0 .../cosmwasmpool/v1beta1/model/pool.ts | 0 .../v1beta1/model/pool_query_msg.ts | 0 .../v1beta1/model/transmuter_msgs.ts | 0 .../osmosis/cosmwasmpool/v1beta1/model/tx.ts | 0 .../osmosis/cosmwasmpool/v1beta1/params.ts | 0 .../cosmwasmpool/v1beta1/query.rpc.Query.ts | 0 .../osmosis/cosmwasmpool/v1beta1/query.ts | 0 .../osmosis/cosmwasmpool/v1beta1/tx.ts | 0 .../gamm/pool-models/balancer/balancerPool.ts | 0 .../gamm/pool-models/balancer/tx/tx.amino.ts | 0 .../pool-models/balancer/tx/tx.registry.ts | 0 .../pool-models/balancer/tx/tx.rpc.msg.ts | 0 .../gamm/pool-models/balancer/tx/tx.ts | 0 .../pool-models/stableswap/stableswap_pool.ts | 0 .../gamm/pool-models/stableswap/tx.amino.ts | 0 .../pool-models/stableswap/tx.registry.ts | 0 .../gamm/pool-models/stableswap/tx.rpc.msg.ts | 0 .../osmosis/gamm/pool-models/stableswap/tx.ts | 0 .../codegen/osmosis/gamm/v1beta1/genesis.ts | 0 .../codegen/osmosis/gamm/v1beta1/gov.ts | 0 .../osmosis/gamm/v1beta1/query.rpc.Query.ts | 0 .../codegen/osmosis/gamm/v1beta1/query.ts | 0 .../codegen/osmosis/gamm/v1beta1/shared.ts | 0 .../codegen/osmosis/gamm/v1beta1/tx.amino.ts | 0 .../osmosis/gamm/v1beta1/tx.registry.ts | 0 .../osmosis/gamm/v1beta1/tx.rpc.msg.ts | 0 .../codegen/osmosis/gamm/v1beta1/tx.ts | 0 .../codegen/osmosis/incentives/gauge.ts | 0 .../codegen/osmosis/incentives/genesis.ts | 0 .../codegen/osmosis/incentives/gov.ts | 0 .../codegen/osmosis/incentives/group.ts | 0 .../codegen/osmosis/incentives/params.ts | 0 .../osmosis/incentives/query.rpc.Query.ts | 0 .../codegen/osmosis/incentives/query.ts | 0 .../codegen/osmosis/incentives/tx.amino.ts | 0 .../codegen/osmosis/incentives/tx.registry.ts | 0 .../codegen/osmosis/incentives/tx.rpc.msg.ts | 0 .../protobuf/codegen/osmosis/incentives/tx.ts | 0 .../codegen/osmosis/lockup/genesis.ts | 0 .../protobuf/codegen/osmosis/lockup/lock.ts | 0 .../protobuf/codegen/osmosis/lockup/params.ts | 0 .../codegen/osmosis/lockup/query.rpc.Query.ts | 0 .../protobuf/codegen/osmosis/lockup/query.ts | 0 .../codegen/osmosis/lockup/tx.amino.ts | 0 .../codegen/osmosis/lockup/tx.registry.ts | 0 .../codegen/osmosis/lockup/tx.rpc.msg.ts | 0 .../protobuf/codegen/osmosis/lockup/tx.ts | 0 .../pool-incentives/v1beta1/genesis.ts | 0 .../osmosis/pool-incentives/v1beta1/gov.ts | 0 .../pool-incentives/v1beta1/incentives.ts | 0 .../v1beta1/query.rpc.Query.ts | 0 .../osmosis/pool-incentives/v1beta1/query.ts | 0 .../osmosis/pool-incentives/v1beta1/shared.ts | 0 .../osmosis/poolmanager/v1beta1/genesis.ts | 0 .../osmosis/poolmanager/v1beta1/gov.ts | 0 .../poolmanager/v1beta1/module_route.ts | 0 .../poolmanager/v1beta1/query.rpc.Query.ts | 0 .../osmosis/poolmanager/v1beta1/query.ts | 0 .../osmosis/poolmanager/v1beta1/swap_route.ts | 0 .../osmosis/poolmanager/v1beta1/tx.amino.ts | 0 .../poolmanager/v1beta1/tx.registry.ts | 0 .../osmosis/poolmanager/v1beta1/tx.rpc.msg.ts | 0 .../codegen/osmosis/poolmanager/v1beta1/tx.ts | 0 .../osmosis/protorev/v1beta1/genesis.ts | 0 .../codegen/osmosis/protorev/v1beta1/gov.ts | 0 .../osmosis/protorev/v1beta1/params.ts | 0 .../osmosis/protorev/v1beta1/protorev.ts | 0 .../protorev/v1beta1/query.rpc.Query.ts | 0 .../codegen/osmosis/protorev/v1beta1/query.ts | 0 .../osmosis/protorev/v1beta1/tx.amino.ts | 0 .../osmosis/protorev/v1beta1/tx.registry.ts | 0 .../osmosis/protorev/v1beta1/tx.rpc.msg.ts | 0 .../codegen/osmosis/protorev/v1beta1/tx.ts | 0 .../protobuf/codegen/osmosis/rpc.query.ts | 0 .../protobuf/codegen/osmosis/rpc.tx.ts | 0 .../codegen/osmosis/superfluid/genesis.ts | 0 .../codegen/osmosis/superfluid/params.ts | 0 .../osmosis/superfluid/query.rpc.Query.ts | 0 .../codegen/osmosis/superfluid/query.ts | 0 .../codegen/osmosis/superfluid/superfluid.ts | 0 .../codegen/osmosis/superfluid/tx.amino.ts | 0 .../codegen/osmosis/superfluid/tx.registry.ts | 0 .../codegen/osmosis/superfluid/tx.rpc.msg.ts | 0 .../protobuf/codegen/osmosis/superfluid/tx.ts | 0 .../codegen/osmosis/superfluid/v1beta1/gov.ts | 0 .../tokenfactory/v1beta1/authorityMetadata.ts | 0 .../osmosis/tokenfactory/v1beta1/genesis.ts | 0 .../osmosis/tokenfactory/v1beta1/params.ts | 0 .../tokenfactory/v1beta1/query.rpc.Query.ts | 0 .../osmosis/tokenfactory/v1beta1/query.ts | 0 .../osmosis/tokenfactory/v1beta1/tx.amino.ts | 0 .../tokenfactory/v1beta1/tx.registry.ts | 0 .../tokenfactory/v1beta1/tx.rpc.msg.ts | 0 .../osmosis/tokenfactory/v1beta1/tx.ts | 0 .../osmosis/txfees/v1beta1/feetoken.ts | 0 .../codegen/osmosis/txfees/v1beta1/genesis.ts | 0 .../codegen/osmosis/txfees/v1beta1/gov.ts | 0 .../osmosis/txfees/v1beta1/query.rpc.Query.ts | 0 .../codegen/osmosis/txfees/v1beta1/query.ts | 0 .../valset-pref/v1beta1/query.rpc.Query.ts | 0 .../osmosis/valset-pref/v1beta1/query.ts | 0 .../osmosis/valset-pref/v1beta1/state.ts | 0 .../osmosis/valset-pref/v1beta1/tx.amino.ts | 0 .../valset-pref/v1beta1/tx.registry.ts | 0 .../osmosis/valset-pref/v1beta1/tx.rpc.msg.ts | 0 .../codegen/osmosis/valset-pref/v1beta1/tx.ts | 0 .../protobuf/codegen/publicawesome/bundle.ts | 0 .../protobuf/codegen/publicawesome/client.ts | 0 .../codegen/publicawesome/rpc.query.ts | 0 .../protobuf/codegen/publicawesome/rpc.tx.ts | 0 .../stargaze/alloc/v1beta1/genesis.ts | 0 .../stargaze/alloc/v1beta1/params.ts | 0 .../stargaze/alloc/v1beta1/query.rpc.Query.ts | 0 .../stargaze/alloc/v1beta1/query.ts | 0 .../stargaze/alloc/v1beta1/tx.amino.ts | 0 .../stargaze/alloc/v1beta1/tx.registry.ts | 0 .../stargaze/alloc/v1beta1/tx.rpc.msg.ts | 0 .../stargaze/alloc/v1beta1/tx.ts | 0 .../publicawesome/stargaze/cron/v1/cron.ts | 0 .../publicawesome/stargaze/cron/v1/genesis.ts | 0 .../stargaze/cron/v1/proposal.ts | 0 .../stargaze/cron/v1/query.rpc.Query.ts | 0 .../publicawesome/stargaze/cron/v1/query.ts | 0 .../stargaze/cron/v1/tx.amino.ts | 0 .../stargaze/cron/v1/tx.registry.ts | 0 .../stargaze/cron/v1/tx.rpc.msg.ts | 0 .../publicawesome/stargaze/cron/v1/tx.ts | 0 .../stargaze/globalfee/v1/genesis.ts | 0 .../stargaze/globalfee/v1/globalfee.ts | 0 .../stargaze/globalfee/v1/proposal.ts | 0 .../stargaze/globalfee/v1/query.rpc.Query.ts | 0 .../stargaze/globalfee/v1/query.ts | 0 .../stargaze/globalfee/v1/tx.amino.ts | 0 .../stargaze/globalfee/v1/tx.registry.ts | 0 .../stargaze/globalfee/v1/tx.rpc.msg.ts | 0 .../publicawesome/stargaze/globalfee/v1/tx.ts | 0 .../stargaze/mint/v1beta1/genesis.ts | 0 .../stargaze/mint/v1beta1/mint.ts | 0 .../stargaze/mint/v1beta1/query.rpc.Query.ts | 0 .../stargaze/mint/v1beta1/query.ts | 0 .../publicawesome/stargaze/mint/v1beta1/tx.ts | 0 .../protobuf/codegen/regen/bundle.ts | 0 .../protobuf/codegen/regen/client.ts | 0 .../protobuf/codegen/regen/data/v1/events.ts | 0 .../protobuf/codegen/regen/data/v1/state.ts | 0 .../codegen/regen/data/v1/tx.amino.ts | 0 .../codegen/regen/data/v1/tx.registry.ts | 0 .../codegen/regen/data/v1/tx.rpc.msg.ts | 0 .../protobuf/codegen/regen/data/v1/tx.ts | 0 .../protobuf/codegen/regen/data/v1/types.ts | 0 .../protobuf/codegen/regen/data/v2/events.ts | 0 .../protobuf/codegen/regen/data/v2/state.ts | 0 .../codegen/regen/data/v2/tx.amino.ts | 0 .../codegen/regen/data/v2/tx.registry.ts | 0 .../codegen/regen/data/v2/tx.rpc.msg.ts | 0 .../protobuf/codegen/regen/data/v2/tx.ts | 0 .../protobuf/codegen/regen/data/v2/types.ts | 0 .../regen/ecocredit/basket/v1/events.ts | 0 .../regen/ecocredit/basket/v1/state.ts | 0 .../regen/ecocredit/basket/v1/tx.amino.ts | 0 .../regen/ecocredit/basket/v1/tx.registry.ts | 0 .../regen/ecocredit/basket/v1/tx.rpc.msg.ts | 0 .../codegen/regen/ecocredit/basket/v1/tx.ts | 0 .../regen/ecocredit/basket/v1/types.ts | 0 .../regen/ecocredit/marketplace/v1/events.ts | 0 .../regen/ecocredit/marketplace/v1/state.ts | 0 .../ecocredit/marketplace/v1/tx.amino.ts | 0 .../ecocredit/marketplace/v1/tx.registry.ts | 0 .../ecocredit/marketplace/v1/tx.rpc.msg.ts | 0 .../regen/ecocredit/marketplace/v1/tx.ts | 0 .../regen/ecocredit/marketplace/v1/types.ts | 0 .../ecocredit/orderbook/v1alpha1/memory.ts | 0 .../codegen/regen/ecocredit/v1/events.ts | 0 .../codegen/regen/ecocredit/v1/state.ts | 0 .../codegen/regen/ecocredit/v1/tx.amino.ts | 0 .../codegen/regen/ecocredit/v1/tx.registry.ts | 0 .../codegen/regen/ecocredit/v1/tx.rpc.msg.ts | 0 .../protobuf/codegen/regen/ecocredit/v1/tx.ts | 0 .../codegen/regen/ecocredit/v1/types.ts | 0 .../regen/ecocredit/v1alpha1/events.ts | 0 .../regen/ecocredit/v1alpha1/genesis.ts | 0 .../regen/ecocredit/v1alpha1/tx.amino.ts | 0 .../regen/ecocredit/v1alpha1/tx.registry.ts | 0 .../regen/ecocredit/v1alpha1/tx.rpc.msg.ts | 0 .../codegen/regen/ecocredit/v1alpha1/tx.ts | 0 .../codegen/regen/ecocredit/v1alpha1/types.ts | 0 .../regen/intertx/v1/query.rpc.Query.ts | 0 .../codegen/regen/intertx/v1/query.ts | 0 .../codegen/regen/intertx/v1/tx.amino.ts | 0 .../codegen/regen/intertx/v1/tx.registry.ts | 0 .../codegen/regen/intertx/v1/tx.rpc.msg.ts | 0 .../protobuf/codegen/regen/intertx/v1/tx.ts | 0 .../protobuf/codegen/regen/rpc.query.ts | 0 .../protobuf/codegen/regen/rpc.tx.ts | 0 .../protobuf/codegen/tariff/genesis.ts | 0 .../protobuf/codegen/tariff/params.ts | 0 .../codegen/tariff/query.rpc.Query.ts | 0 .../protobuf/codegen/tariff/query.ts | 0 .../protobuf/codegen/tendermint/abci/types.ts | 0 .../protobuf/codegen/tendermint/bundle.ts | 0 .../codegen/tendermint/crypto/keys.ts | 0 .../codegen/tendermint/crypto/proof.ts | 0 .../protobuf/codegen/tendermint/p2p/types.ts | 0 .../codegen/tendermint/types/block.ts | 0 .../codegen/tendermint/types/evidence.ts | 0 .../codegen/tendermint/types/params.ts | 0 .../codegen/tendermint/types/types.ts | 0 .../codegen/tendermint/types/validator.ts | 0 .../codegen/tendermint/version/types.ts | 0 .../{utils => types}/protobuf/codegen/utf8.ts | 0 .../protobuf/codegen/varint.ts | 0 packages/{utils => types}/protobuf/index.ts | 1 + .../{utils => types}/protobuf/patches.diff | 0 .../proto/alliance/alliance/alliance.proto | 0 .../proto/alliance/alliance/delegations.proto | 0 .../proto/alliance/alliance/events.proto | 0 .../proto/alliance/alliance/genesis.proto | 0 .../proto/alliance/alliance/gov.proto | 0 .../proto/alliance/alliance/params.proto | 0 .../proto/alliance/alliance/query.proto | 0 .../alliance/alliance/redelegations.proto | 0 .../protobuf/proto/alliance/alliance/tx.proto | 0 .../proto/alliance/alliance/unbonding.proto | 0 .../protobuf/proto/amino/LICENSE | 0 .../protobuf/proto/amino/README.md | 0 .../protobuf/proto/amino/amino.proto | 0 .../proto/capability/v1/capability.proto | 0 .../proto/capability/v1/genesis.proto | 0 .../proto/circle/cctp/v1/attester.proto | 0 .../proto/circle/cctp/v1/burn_message.proto | 0 .../cctp/v1/burning_and_minting_paused.proto | 0 .../proto/circle/cctp/v1/events.proto | 0 .../proto/circle/cctp/v1/genesis.proto | 0 .../cctp/v1/max_message_body_size.proto | 0 .../proto/circle/cctp/v1/message.proto | 0 .../protobuf/proto/circle/cctp/v1/nonce.proto | 0 .../proto/circle/cctp/v1/params.proto | 0 .../cctp/v1/per_message_burn_limit.proto | 0 .../protobuf/proto/circle/cctp/v1/query.proto | 0 .../cctp/v1/remote_token_messenger.proto | 0 ...ending_and_receiving_messages_paused.proto | 0 .../circle/cctp/v1/signature_threshold.proto | 0 .../proto/circle/cctp/v1/token_pair.proto | 0 .../protobuf/proto/circle/cctp/v1/tx.proto | 0 .../cosmos/app/runtime/v1alpha1/module.proto | 0 .../proto/cosmos/app/v1alpha1/config.proto | 0 .../proto/cosmos/app/v1alpha1/module.proto | 0 .../proto/cosmos/app/v1alpha1/query.proto | 0 .../proto/cosmos/auth/module/v1/module.proto | 0 .../proto/cosmos/auth/v1beta1/auth.proto | 0 .../proto/cosmos/auth/v1beta1/genesis.proto | 0 .../proto/cosmos/auth/v1beta1/query.proto | 0 .../proto/cosmos/auth/v1beta1/tx.proto | 0 .../proto/cosmos/authz/module/v1/module.proto | 0 .../proto/cosmos/authz/v1beta1/authz.proto | 0 .../proto/cosmos/authz/v1beta1/event.proto | 0 .../proto/cosmos/authz/v1beta1/genesis.proto | 0 .../proto/cosmos/authz/v1beta1/query.proto | 0 .../proto/cosmos/authz/v1beta1/tx.proto | 0 .../proto/cosmos/autocli/v1/options.proto | 0 .../proto/cosmos/autocli/v1/query.proto | 0 .../proto/cosmos/bank/module/v1/module.proto | 0 .../proto/cosmos/bank/v1beta1/authz.proto | 0 .../proto/cosmos/bank/v1beta1/bank.proto | 0 .../proto/cosmos/bank/v1beta1/genesis.proto | 0 .../proto/cosmos/bank/v1beta1/query.proto | 0 .../proto/cosmos/bank/v1beta1/tx.proto | 0 .../proto/cosmos/base/abci/v1beta1/abci.proto | 0 .../cosmos/base/node/v1beta1/query.proto | 0 .../base/query/v1beta1/pagination.proto | 0 .../base/reflection/v1beta1/reflection.proto | 0 .../base/reflection/v2alpha1/reflection.proto | 0 .../base/tendermint/v1beta1/query.proto | 0 .../base/tendermint/v1beta1/types.proto | 0 .../proto/cosmos/base/v1beta1/coin.proto | 0 .../cosmos/circuit/module/v1/module.proto | 0 .../proto/cosmos/circuit/v1/query.proto | 0 .../protobuf/proto/cosmos/circuit/v1/tx.proto | 0 .../proto/cosmos/circuit/v1/types.proto | 0 .../cosmos/consensus/module/v1/module.proto | 0 .../proto/cosmos/consensus/v1/query.proto | 0 .../proto/cosmos/consensus/v1/tx.proto | 0 .../cosmos/crisis/module/v1/module.proto | 0 .../proto/cosmos/crisis/v1beta1/genesis.proto | 0 .../proto/cosmos/crisis/v1beta1/tx.proto | 0 .../proto/cosmos/crypto/ed25519/keys.proto | 0 .../proto/cosmos/crypto/hd/v1/hd.proto | 0 .../cosmos/crypto/keyring/v1/record.proto | 0 .../proto/cosmos/crypto/multisig/keys.proto | 0 .../crypto/multisig/v1beta1/multisig.proto | 0 .../proto/cosmos/crypto/secp256k1/keys.proto | 0 .../proto/cosmos/crypto/secp256r1/keys.proto | 0 .../distribution/module/v1/module.proto | 0 .../distribution/v1beta1/distribution.proto | 0 .../cosmos/distribution/v1beta1/genesis.proto | 0 .../cosmos/distribution/v1beta1/query.proto | 0 .../cosmos/distribution/v1beta1/tx.proto | 0 .../cosmos/evidence/module/v1/module.proto | 0 .../cosmos/evidence/v1beta1/evidence.proto | 0 .../cosmos/evidence/v1beta1/genesis.proto | 0 .../proto/cosmos/evidence/v1beta1/query.proto | 0 .../proto/cosmos/evidence/v1beta1/tx.proto | 0 .../cosmos/feegrant/module/v1/module.proto | 0 .../cosmos/feegrant/v1beta1/feegrant.proto | 0 .../cosmos/feegrant/v1beta1/genesis.proto | 0 .../proto/cosmos/feegrant/v1beta1/query.proto | 0 .../proto/cosmos/feegrant/v1beta1/tx.proto | 0 .../cosmos/genutil/module/v1/module.proto | 0 .../cosmos/genutil/v1beta1/genesis.proto | 0 .../proto/cosmos/gov/module/v1/module.proto | 0 .../proto/cosmos/gov/v1/genesis.proto | 0 .../protobuf/proto/cosmos/gov/v1/gov.proto | 0 .../protobuf/proto/cosmos/gov/v1/query.proto | 0 .../protobuf/proto/cosmos/gov/v1/tx.proto | 0 .../proto/cosmos/gov/v1beta1/genesis.proto | 0 .../proto/cosmos/gov/v1beta1/gov.proto | 0 .../proto/cosmos/gov/v1beta1/query.proto | 0 .../proto/cosmos/gov/v1beta1/tx.proto | 0 .../proto/cosmos/group/module/v1/module.proto | 0 .../proto/cosmos/group/v1/events.proto | 0 .../proto/cosmos/group/v1/genesis.proto | 0 .../proto/cosmos/group/v1/query.proto | 0 .../protobuf/proto/cosmos/group/v1/tx.proto | 0 .../proto/cosmos/group/v1/types.proto | 0 .../proto/cosmos/ics23/v1/proofs.proto | 0 .../proto/cosmos/mint/module/v1/module.proto | 0 .../proto/cosmos/mint/v1beta1/genesis.proto | 0 .../proto/cosmos/mint/v1beta1/mint.proto | 0 .../proto/cosmos/mint/v1beta1/query.proto | 0 .../proto/cosmos/mint/v1beta1/tx.proto | 0 .../proto/cosmos/msg/textual/v1/textual.proto | 0 .../protobuf/proto/cosmos/msg/v1/msg.proto | 0 .../proto/cosmos/nft/module/v1/module.proto | 0 .../proto/cosmos/nft/v1beta1/event.proto | 0 .../proto/cosmos/nft/v1beta1/genesis.proto | 0 .../proto/cosmos/nft/v1beta1/nft.proto | 0 .../proto/cosmos/nft/v1beta1/query.proto | 0 .../proto/cosmos/nft/v1beta1/tx.proto | 0 .../cosmos/orm/module/v1alpha1/module.proto | 0 .../cosmos/orm/query/v1alpha1/query.proto | 0 .../protobuf/proto/cosmos/orm/v1/orm.proto | 0 .../proto/cosmos/orm/v1alpha1/schema.proto | 0 .../cosmos/params/module/v1/module.proto | 0 .../proto/cosmos/params/v1beta1/params.proto | 0 .../proto/cosmos/params/v1beta1/query.proto | 0 .../proto/cosmos/query/v1/query.proto | 0 .../cosmos/reflection/v1/reflection.proto | 0 .../cosmos/slashing/module/v1/module.proto | 0 .../cosmos/slashing/v1beta1/genesis.proto | 0 .../proto/cosmos/slashing/v1beta1/query.proto | 0 .../cosmos/slashing/v1beta1/slashing.proto | 0 .../proto/cosmos/slashing/v1beta1/tx.proto | 0 .../cosmos/staking/module/v1/module.proto | 0 .../proto/cosmos/staking/v1beta1/authz.proto | 0 .../cosmos/staking/v1beta1/genesis.proto | 0 .../proto/cosmos/staking/v1beta1/query.proto | 0 .../cosmos/staking/v1beta1/staking.proto | 0 .../proto/cosmos/staking/v1beta1/tx.proto | 0 .../cosmos/store/internal/kv/v1beta1/kv.proto | 0 .../cosmos/store/snapshots/v1/snapshot.proto | 0 .../cosmos/store/streaming/abci/grpc.proto | 0 .../cosmos/store/v1beta1/commit_info.proto | 0 .../cosmos/store/v1beta1/listening.proto | 0 .../proto/cosmos/tx/config/v1/config.proto | 0 .../cosmos/tx/signing/v1beta1/signing.proto | 0 .../proto/cosmos/tx/v1beta1/service.proto | 0 .../protobuf/proto/cosmos/tx/v1beta1/tx.proto | 0 .../cosmos/upgrade/module/v1/module.proto | 0 .../proto/cosmos/upgrade/v1beta1/query.proto | 0 .../proto/cosmos/upgrade/v1beta1/tx.proto | 0 .../cosmos/upgrade/v1beta1/upgrade.proto | 0 .../cosmos/vesting/module/v1/module.proto | 0 .../proto/cosmos/vesting/v1beta1/tx.proto | 0 .../cosmos/vesting/v1beta1/vesting.proto | 0 .../protobuf/proto/cosmos_proto/LICENSE | 0 .../protobuf/proto/cosmos_proto/README.md | 0 .../protobuf/proto/cosmos_proto/cosmos.proto | 0 .../protobuf/proto/cosmwasm/LICENSE | 0 .../protobuf/proto/cosmwasm/README.md | 0 .../v1beta1/authorityMetadata.proto | 0 .../tokenfactory/v1beta1/genesis.proto | 0 .../tokenfactory/v1beta1/params.proto | 0 .../cosmwasm/tokenfactory/v1beta1/query.proto | 0 .../cosmwasm/tokenfactory/v1beta1/tx.proto | 0 .../proto/cosmwasm/wasm/v1/authz.proto | 0 .../proto/cosmwasm/wasm/v1/genesis.proto | 0 .../protobuf/proto/cosmwasm/wasm/v1/ibc.proto | 0 .../proto/cosmwasm/wasm/v1/proposal.proto | 0 .../proto/cosmwasm/wasm/v1/query.proto | 0 .../protobuf/proto/cosmwasm/wasm/v1/tx.proto | 0 .../proto/cosmwasm/wasm/v1/types.proto | 0 .../gaia/globalfee/v1beta1/genesis.proto | 0 .../proto/gaia/globalfee/v1beta1/query.proto | 0 .../proto/gaia/globalfee/v1beta1/tx.proto | 0 .../protobuf/proto/gogoproto/LICENSE | 0 .../protobuf/proto/gogoproto/README.md | 0 .../protobuf/proto/gogoproto/gogo.proto | 0 .../protobuf/proto/google/LICENSE | 0 .../protobuf/proto/google/README.md | 0 .../proto/google/api/annotations.proto | 0 .../protobuf/proto/google/api/http.proto | 0 .../protobuf/proto/google/protobuf/any.proto | 0 .../proto/google/protobuf/descriptor.proto | 0 .../proto/google/protobuf/duration.proto | 0 .../proto/google/protobuf/empty.proto | 0 .../proto/google/protobuf/timestamp.proto | 0 .../proto/ibc/applications/fee/v1/ack.proto | 0 .../proto/ibc/applications/fee/v1/fee.proto | 0 .../ibc/applications/fee/v1/genesis.proto | 0 .../ibc/applications/fee/v1/metadata.proto | 0 .../proto/ibc/applications/fee/v1/query.proto | 0 .../proto/ibc/applications/fee/v1/tx.proto | 0 .../controller/v1/controller.proto | 0 .../controller/v1/query.proto | 0 .../controller/v1/tx.proto | 0 .../genesis/v1/genesis.proto | 0 .../interchain_accounts/host/v1/host.proto | 0 .../interchain_accounts/host/v1/query.proto | 0 .../interchain_accounts/host/v1/tx.proto | 0 .../interchain_accounts/v1/account.proto | 0 .../interchain_accounts/v1/metadata.proto | 0 .../interchain_accounts/v1/packet.proto | 0 .../ibc/applications/transfer/v1/authz.proto | 0 .../applications/transfer/v1/genesis.proto | 0 .../ibc/applications/transfer/v1/query.proto | 0 .../applications/transfer/v1/transfer.proto | 0 .../ibc/applications/transfer/v1/tx.proto | 0 .../ibc/applications/transfer/v2/packet.proto | 0 .../proto/ibc/core/channel/v1/channel.proto | 0 .../proto/ibc/core/channel/v1/genesis.proto | 0 .../proto/ibc/core/channel/v1/query.proto | 0 .../proto/ibc/core/channel/v1/tx.proto | 0 .../proto/ibc/core/client/v1/client.proto | 0 .../proto/ibc/core/client/v1/genesis.proto | 0 .../proto/ibc/core/client/v1/query.proto | 0 .../proto/ibc/core/client/v1/tx.proto | 0 .../ibc/core/commitment/v1/commitment.proto | 0 .../ibc/core/connection/v1/connection.proto | 0 .../ibc/core/connection/v1/genesis.proto | 0 .../proto/ibc/core/connection/v1/query.proto | 0 .../proto/ibc/core/connection/v1/tx.proto | 0 .../proto/ibc/core/types/v1/genesis.proto | 0 .../lightclients/localhost/v2/localhost.proto | 0 .../solomachine/v2/solomachine.proto | 0 .../solomachine/v3/solomachine.proto | 0 .../tendermint/v1/tendermint.proto | 0 .../proto/juno/feeshare/v1/feeshare.proto | 0 .../proto/juno/feeshare/v1/genesis.proto | 0 .../proto/juno/feeshare/v1/query.proto | 0 .../protobuf/proto/juno/feeshare/v1/tx.proto | 0 .../protobuf/proto/juno/mint/genesis.proto | 0 .../protobuf/proto/juno/mint/mint.proto | 0 .../protobuf/proto/juno/mint/query.proto | 0 .../protobuf/proto/juno/mint/tx.proto | 0 .../neutron/contractmanager/failure.proto | 0 .../neutron/contractmanager/genesis.proto | 0 .../neutron/contractmanager/params.proto | 0 .../proto/neutron/contractmanager/query.proto | 0 .../proto/neutron/contractmanager/tx.proto | 0 .../neutron/contractmanager/v1/failure.proto | 0 .../protobuf/proto/neutron/cron/genesis.proto | 0 .../protobuf/proto/neutron/cron/params.proto | 0 .../protobuf/proto/neutron/cron/query.proto | 0 .../proto/neutron/cron/schedule.proto | 0 .../protobuf/proto/neutron/cron/tx.proto | 0 .../proto/neutron/dex/deposit_record.proto | 0 .../protobuf/proto/neutron/dex/genesis.proto | 0 .../neutron/dex/limit_order_expiration.proto | 0 .../neutron/dex/limit_order_tranche.proto | 0 .../dex/limit_order_tranche_user.proto | 0 .../protobuf/proto/neutron/dex/pair_id.proto | 0 .../protobuf/proto/neutron/dex/params.proto | 0 .../protobuf/proto/neutron/dex/pool.proto | 0 .../proto/neutron/dex/pool_metadata.proto | 0 .../proto/neutron/dex/pool_reserves.proto | 0 .../protobuf/proto/neutron/dex/query.proto | 0 .../proto/neutron/dex/tick_liquidity.proto | 0 .../proto/neutron/dex/trade_pair_id.proto | 0 .../protobuf/proto/neutron/dex/tx.proto | 0 .../proto/neutron/feeburner/genesis.proto | 0 .../proto/neutron/feeburner/params.proto | 0 .../proto/neutron/feeburner/query.proto | 0 .../total_burned_neutrons_amount.proto | 0 .../protobuf/proto/neutron/feeburner/tx.proto | 0 .../proto/neutron/feerefunder/fee.proto | 0 .../proto/neutron/feerefunder/genesis.proto | 0 .../proto/neutron/feerefunder/params.proto | 0 .../proto/neutron/feerefunder/query.proto | 0 .../proto/neutron/feerefunder/tx.proto | 0 .../neutron/interchainqueries/genesis.proto | 0 .../neutron/interchainqueries/params.proto | 0 .../neutron/interchainqueries/query.proto | 0 .../proto/neutron/interchainqueries/tx.proto | 0 .../neutron/interchaintxs/v1/genesis.proto | 0 .../neutron/interchaintxs/v1/params.proto | 0 .../neutron/interchaintxs/v1/query.proto | 0 .../proto/neutron/interchaintxs/v1/tx.proto | 0 .../proto/neutron/transfer/v1/query.proto | 0 .../proto/neutron/transfer/v1/tx.proto | 0 .../proto/osmosis/accum/v1beta1/accum.proto | 0 .../concentratedliquidity/params.proto | 0 .../poolmodel/concentrated/v1beta1/tx.proto | 0 .../v1beta1/genesis.proto | 0 .../concentratedliquidity/v1beta1/gov.proto | 0 .../v1beta1/incentive_record.proto | 0 .../concentratedliquidity/v1beta1/pool.proto | 0 .../v1beta1/position.proto | 0 .../concentratedliquidity/v1beta1/query.proto | 0 .../concentratedliquidity/v1beta1/query.yml | 0 .../v1beta1/tickInfo.proto | 0 .../concentratedliquidity/v1beta1/tx.proto | 0 .../cosmwasmpool/v1beta1/genesis.proto | 0 .../osmosis/cosmwasmpool/v1beta1/gov.proto | 0 .../v1beta1/model/instantiate_msg.proto | 0 .../v1beta1/model/module_query_msg.proto | 0 .../v1beta1/model/module_sudo_msg.proto | 0 .../cosmwasmpool/v1beta1/model/pool.proto | 0 .../v1beta1/model/pool_query_msg.proto | 0 .../v1beta1/model/transmuter_msgs.proto | 0 .../cosmwasmpool/v1beta1/model/tx.proto | 0 .../osmosis/cosmwasmpool/v1beta1/params.proto | 0 .../osmosis/cosmwasmpool/v1beta1/query.proto | 0 .../osmosis/cosmwasmpool/v1beta1/query.yml | 0 .../osmosis/cosmwasmpool/v1beta1/tx.proto | 0 .../v1beta1/downtime_duration.proto | 0 .../downtime-detector/v1beta1/genesis.proto | 0 .../downtime-detector/v1beta1/query.proto | 0 .../downtime-detector/v1beta1/query.yml | 0 .../proto/osmosis/epochs/genesis.proto | 0 .../protobuf/proto/osmosis/epochs/query.proto | 0 .../pool-models/balancer/balancerPool.proto | 0 .../gamm/pool-models/balancer/tx/tx.proto | 0 .../stableswap/stableswap_pool.proto | 0 .../gamm/pool-models/stableswap/tx.proto | 0 .../proto/osmosis/gamm/v1beta1/genesis.proto | 0 .../proto/osmosis/gamm/v1beta1/gov.proto | 0 .../proto/osmosis/gamm/v1beta1/query.proto | 0 .../proto/osmosis/gamm/v1beta1/shared.proto | 0 .../proto/osmosis/gamm/v1beta1/tx.proto | 0 .../proto/osmosis/gamm/v2/query.proto | 0 .../proto/osmosis/ibc-hooks/genesis.proto | 0 .../proto/osmosis/ibc-hooks/params.proto | 0 .../protobuf/proto/osmosis/ibc-hooks/tx.proto | 0 .../ibc-rate-limit/v1beta1/genesis.proto | 0 .../ibc-rate-limit/v1beta1/params.proto | 0 .../ibc-rate-limit/v1beta1/query.proto | 0 .../osmosis/ibc-rate-limit/v1beta1/query.yml | 0 .../proto/osmosis/incentives/gauge.proto | 0 .../proto/osmosis/incentives/genesis.proto | 0 .../proto/osmosis/incentives/gov.proto | 0 .../proto/osmosis/incentives/group.proto | 0 .../proto/osmosis/incentives/params.proto | 0 .../proto/osmosis/incentives/query.proto | 0 .../proto/osmosis/incentives/tx.proto | 0 .../proto/osmosis/lockup/genesis.proto | 0 .../protobuf/proto/osmosis/lockup/lock.proto | 0 .../proto/osmosis/lockup/params.proto | 0 .../protobuf/proto/osmosis/lockup/query.proto | 0 .../protobuf/proto/osmosis/lockup/tx.proto | 0 .../proto/osmosis/mint/v1beta1/genesis.proto | 0 .../proto/osmosis/mint/v1beta1/mint.proto | 0 .../proto/osmosis/mint/v1beta1/query.proto | 0 .../pool-incentives/v1beta1/genesis.proto | 0 .../osmosis/pool-incentives/v1beta1/gov.proto | 0 .../pool-incentives/v1beta1/incentives.proto | 0 .../pool-incentives/v1beta1/query.proto | 0 .../pool-incentives/v1beta1/shared.proto | 0 .../osmosis/poolmanager/v1beta1/genesis.proto | 0 .../osmosis/poolmanager/v1beta1/gov.proto | 0 .../poolmanager/v1beta1/module_route.proto | 0 .../osmosis/poolmanager/v1beta1/query.proto | 0 .../osmosis/poolmanager/v1beta1/query.yml | 0 .../poolmanager/v1beta1/swap_route.proto | 0 .../osmosis/poolmanager/v1beta1/tx.proto | 0 .../osmosis/protorev/v1beta1/genesis.proto | 0 .../proto/osmosis/protorev/v1beta1/gov.proto | 0 .../osmosis/protorev/v1beta1/params.proto | 0 .../osmosis/protorev/v1beta1/protorev.proto | 0 .../osmosis/protorev/v1beta1/query.proto | 0 .../proto/osmosis/protorev/v1beta1/tx.proto | 0 .../proto/osmosis/sumtree/v1beta1/tree.proto | 0 .../proto/osmosis/superfluid/genesis.proto | 0 .../proto/osmosis/superfluid/params.proto | 0 .../proto/osmosis/superfluid/query.proto | 0 .../proto/osmosis/superfluid/superfluid.proto | 0 .../proto/osmosis/superfluid/tx.proto | 0 .../osmosis/superfluid/v1beta1/gov.proto | 0 .../v1beta1/authorityMetadata.proto | 0 .../tokenfactory/v1beta1/genesis.proto | 0 .../osmosis/tokenfactory/v1beta1/params.proto | 0 .../osmosis/tokenfactory/v1beta1/query.proto | 0 .../osmosis/tokenfactory/v1beta1/tx.proto | 0 .../proto/osmosis/twap/v1beta1/genesis.proto | 0 .../proto/osmosis/twap/v1beta1/query.proto | 0 .../proto/osmosis/twap/v1beta1/query.yml | 0 .../osmosis/twap/v1beta1/twap_record.proto | 0 .../osmosis/txfees/v1beta1/feetoken.proto | 0 .../osmosis/txfees/v1beta1/genesis.proto | 0 .../proto/osmosis/txfees/v1beta1/gov.proto | 0 .../proto/osmosis/txfees/v1beta1/query.proto | 0 .../osmosis/valset-pref/v1beta1/query.proto | 0 .../osmosis/valset-pref/v1beta1/query.yml | 0 .../osmosis/valset-pref/v1beta1/state.proto | 0 .../osmosis/valset-pref/v1beta1/tx.proto | 0 .../stargaze/alloc/v1beta1/genesis.proto | 0 .../stargaze/alloc/v1beta1/params.proto | 0 .../stargaze/alloc/v1beta1/query.proto | 0 .../stargaze/alloc/v1beta1/tx.proto | 0 .../publicawesome/stargaze/cron/v1/cron.proto | 0 .../stargaze/cron/v1/genesis.proto | 0 .../stargaze/cron/v1/proposal.proto | 0 .../stargaze/cron/v1/query.proto | 0 .../publicawesome/stargaze/cron/v1/tx.proto | 0 .../stargaze/globalfee/v1/genesis.proto | 0 .../stargaze/globalfee/v1/globalfee.proto | 0 .../stargaze/globalfee/v1/proposal.proto | 0 .../stargaze/globalfee/v1/query.proto | 0 .../stargaze/globalfee/v1/tx.proto | 0 .../stargaze/mint/v1beta1/genesis.proto | 0 .../stargaze/mint/v1beta1/mint.proto | 0 .../stargaze/mint/v1beta1/query.proto | 0 .../stargaze/mint/v1beta1/tx.proto | 0 .../protobuf/proto/regen/data/v1/events.proto | 0 .../protobuf/proto/regen/data/v1/state.proto | 0 .../protobuf/proto/regen/data/v1/tx.proto | 0 .../protobuf/proto/regen/data/v1/types.proto | 0 .../protobuf/proto/regen/data/v2/events.proto | 0 .../protobuf/proto/regen/data/v2/state.proto | 0 .../protobuf/proto/regen/data/v2/tx.proto | 0 .../protobuf/proto/regen/data/v2/types.proto | 0 .../regen/ecocredit/basket/v1/events.proto | 0 .../regen/ecocredit/basket/v1/state.proto | 0 .../proto/regen/ecocredit/basket/v1/tx.proto | 0 .../regen/ecocredit/basket/v1/types.proto | 0 .../ecocredit/marketplace/v1/events.proto | 0 .../ecocredit/marketplace/v1/state.proto | 0 .../regen/ecocredit/marketplace/v1/tx.proto | 0 .../ecocredit/marketplace/v1/types.proto | 0 .../ecocredit/orderbook/v1alpha1/memory.proto | 0 .../proto/regen/ecocredit/v1/events.proto | 0 .../proto/regen/ecocredit/v1/state.proto | 0 .../proto/regen/ecocredit/v1/tx.proto | 0 .../proto/regen/ecocredit/v1/types.proto | 0 .../regen/ecocredit/v1alpha1/events.proto | 0 .../regen/ecocredit/v1alpha1/genesis.proto | 0 .../proto/regen/ecocredit/v1alpha1/tx.proto | 0 .../regen/ecocredit/v1alpha1/types.proto | 0 .../proto/regen/intertx/v1/query.proto | 0 .../protobuf/proto/regen/intertx/v1/tx.proto | 0 .../protobuf/proto/tariff/genesis.proto | 0 .../protobuf/proto/tariff/params.proto | 0 .../protobuf/proto/tariff/query.proto | 0 .../proto/tendermint/abci/types.proto | 0 .../proto/tendermint/crypto/keys.proto | 0 .../proto/tendermint/crypto/proof.proto | 0 .../proto/tendermint/libs/bits/types.proto | 0 .../protobuf/proto/tendermint/p2p/types.proto | 0 .../proto/tendermint/types/block.proto | 0 .../proto/tendermint/types/evidence.proto | 0 .../proto/tendermint/types/params.proto | 0 .../proto/tendermint/types/types.proto | 0 .../proto/tendermint/types/validator.proto | 0 .../proto/tendermint/version/types.proto | 0 .../protobuf/scripts/codegen.js | 0 packages/types/protobuf/utils.ts | 733 ++++ packages/types/vesting.ts | 4 +- packages/utils/README.md | 41 +- packages/utils/auth.ts | 2 +- packages/utils/chain.ts | 13 +- packages/utils/contracts.ts | 4 +- packages/utils/gov.ts | 38 +- packages/utils/messages/cw.ts | 31 +- packages/utils/messages/protobuf.ts | 699 +--- packages/utils/package.json | 7 +- packages/utils/pagination.ts | 2 +- .../codegen/cosmos/authz/v1beta1/tx.ts | 643 ---- .../protobuf/codegen/cosmos/gov/v1/tx.ts | 2180 ----------- 1127 files changed, 5196 insertions(+), 3882 deletions(-) rename packages/{utils => types}/.eslintignore (100%) rename packages/{utils => types}/protobuf/codegen/alliance/alliance/alliance.ts (100%) rename packages/{utils => types}/protobuf/codegen/alliance/alliance/delegations.ts (100%) rename packages/{utils => types}/protobuf/codegen/alliance/alliance/events.ts (100%) rename packages/{utils => types}/protobuf/codegen/alliance/alliance/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/alliance/alliance/gov.ts (100%) rename packages/{utils => types}/protobuf/codegen/alliance/alliance/params.ts (100%) rename packages/{utils => types}/protobuf/codegen/alliance/alliance/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/alliance/alliance/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/alliance/alliance/redelegations.ts (100%) rename packages/{utils => types}/protobuf/codegen/alliance/alliance/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/alliance/alliance/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/alliance/alliance/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/alliance/alliance/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/alliance/alliance/unbonding.ts (100%) rename packages/{utils => types}/protobuf/codegen/alliance/bundle.ts (100%) rename packages/{utils => types}/protobuf/codegen/alliance/client.ts (100%) rename packages/{utils => types}/protobuf/codegen/alliance/rpc.query.ts (100%) rename packages/{utils => types}/protobuf/codegen/alliance/rpc.tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/amino/amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/amino/bundle.ts (100%) rename packages/{utils => types}/protobuf/codegen/binary.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/bundle.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/cctp/v1/attester.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/cctp/v1/burn_message.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/cctp/v1/burning_and_minting_paused.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/cctp/v1/events.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/cctp/v1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/cctp/v1/max_message_body_size.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/cctp/v1/message.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/cctp/v1/nonce.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/cctp/v1/params.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/cctp/v1/per_message_burn_limit.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/cctp/v1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/cctp/v1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/cctp/v1/remote_token_messenger.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/cctp/v1/sending_and_receiving_messages_paused.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/cctp/v1/signature_threshold.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/cctp/v1/token_pair.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/cctp/v1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/cctp/v1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/cctp/v1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/cctp/v1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/client.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/rpc.query.ts (100%) rename packages/{utils => types}/protobuf/codegen/circle/rpc.tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/auth/v1beta1/auth.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/auth/v1beta1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/auth/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/auth/v1beta1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/auth/v1beta1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/auth/v1beta1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/auth/v1beta1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/authz/v1beta1/authz.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/authz/v1beta1/event.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/authz/v1beta1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/authz/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/authz/v1beta1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/authz/v1beta1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/authz/v1beta1/tx.rpc.msg.ts (100%) create mode 100644 packages/types/protobuf/codegen/cosmos/authz/v1beta1/tx.ts rename packages/{utils => types}/protobuf/codegen/cosmos/bank/v1beta1/authz.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/bank/v1beta1/bank.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/bank/v1beta1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/bank/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/bank/v1beta1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/bank/v1beta1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/bank/v1beta1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/base/abci/v1beta1/abci.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/base/query/v1beta1/pagination.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/base/tendermint/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/base/tendermint/v1beta1/types.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/base/v1beta1/coin.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/bundle.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/client.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/crypto/ed25519/keys.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/crypto/multisig/keys.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/crypto/multisig/v1beta1/multisig.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/crypto/secp256k1/keys.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/distribution/v1beta1/distribution.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/distribution/v1beta1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/distribution/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/distribution/v1beta1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/distribution/v1beta1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/distribution/v1beta1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/gov/v1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/gov/v1/gov.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/gov/v1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/gov/v1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/gov/v1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/gov/v1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/gov/v1/tx.rpc.msg.ts (100%) create mode 100644 packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts rename packages/{utils => types}/protobuf/codegen/cosmos/gov/v1beta1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/gov/v1beta1/gov.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/gov/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/gov/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/gov/v1beta1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/gov/v1beta1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/gov/v1beta1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/mint/v1beta1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/mint/v1beta1/mint.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/mint/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/mint/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/mint/v1beta1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/mint/v1beta1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/mint/v1beta1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/mint/v1beta1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/msg/v1/msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/orm/v1/orm.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/params/v1beta1/params.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/params/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/params/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/query/v1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/rpc.query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/rpc.tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/slashing/v1beta1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/slashing/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/slashing/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/slashing/v1beta1/slashing.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/slashing/v1beta1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/slashing/v1beta1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/slashing/v1beta1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/slashing/v1beta1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/staking/v1beta1/authz.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/staking/v1beta1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/staking/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/staking/v1beta1/staking.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/staking/v1beta1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/staking/v1beta1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/staking/v1beta1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/tx/signing/v1beta1/signing.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/tx/v1beta1/service.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/tx/v1beta1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/upgrade/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/upgrade/v1beta1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/upgrade/v1beta1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/upgrade/v1beta1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos/upgrade/v1beta1/upgrade.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos_proto/bundle.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmos_proto/cosmos.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/bundle.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/client.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/rpc.query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/rpc.tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/authorityMetadata.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/params.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/wasm/v1/authz.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/wasm/v1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/wasm/v1/ibc.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/wasm/v1/proposal.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/wasm/v1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/wasm/v1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/wasm/v1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/wasm/v1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/wasm/v1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/cosmwasm/wasm/v1/types.ts (100%) rename packages/{utils => types}/protobuf/codegen/gaia/bundle.ts (100%) rename packages/{utils => types}/protobuf/codegen/gaia/client.ts (100%) rename packages/{utils => types}/protobuf/codegen/gaia/globalfee/v1beta1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/gaia/globalfee/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/gaia/globalfee/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/gaia/globalfee/v1beta1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/gaia/globalfee/v1beta1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/gaia/globalfee/v1beta1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/gaia/globalfee/v1beta1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/gaia/rpc.query.ts (100%) rename packages/{utils => types}/protobuf/codegen/gaia/rpc.tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/gogoproto/bundle.ts (100%) rename packages/{utils => types}/protobuf/codegen/gogoproto/gogo.ts (100%) rename packages/{utils => types}/protobuf/codegen/google/api/annotations.ts (100%) rename packages/{utils => types}/protobuf/codegen/google/api/http.ts (100%) rename packages/{utils => types}/protobuf/codegen/google/bundle.ts (100%) rename packages/{utils => types}/protobuf/codegen/google/protobuf/any.ts (100%) rename packages/{utils => types}/protobuf/codegen/google/protobuf/descriptor.ts (100%) rename packages/{utils => types}/protobuf/codegen/google/protobuf/duration.ts (100%) rename packages/{utils => types}/protobuf/codegen/google/protobuf/empty.ts (100%) rename packages/{utils => types}/protobuf/codegen/google/protobuf/timestamp.ts (100%) rename packages/{utils => types}/protobuf/codegen/helpers.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/controller.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/host.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/interchain_accounts/v1/account.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/interchain_accounts/v1/metadata.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/interchain_accounts/v1/packet.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/transfer/v1/authz.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/transfer/v1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/transfer/v1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/transfer/v1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/transfer/v1/transfer.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/transfer/v1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/transfer/v1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/transfer/v1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/applications/transfer/v1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/bundle.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/client.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/core/channel/v1/channel.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/core/channel/v1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/core/channel/v1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/core/channel/v1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/core/channel/v1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/core/channel/v1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/core/channel/v1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/core/channel/v1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/core/client/v1/client.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/rpc.query.ts (100%) rename packages/{utils => types}/protobuf/codegen/ibc/rpc.tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/index.ts (100%) rename packages/{utils => types}/protobuf/codegen/juno/bundle.ts (100%) rename packages/{utils => types}/protobuf/codegen/juno/client.ts (100%) rename packages/{utils => types}/protobuf/codegen/juno/feeshare/v1/feeshare.ts (100%) rename packages/{utils => types}/protobuf/codegen/juno/feeshare/v1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/juno/feeshare/v1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/juno/feeshare/v1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/juno/feeshare/v1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/juno/feeshare/v1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/juno/feeshare/v1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/juno/feeshare/v1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/juno/mint/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/juno/mint/mint.ts (100%) rename packages/{utils => types}/protobuf/codegen/juno/mint/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/juno/mint/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/juno/mint/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/juno/mint/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/juno/mint/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/juno/mint/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/juno/rpc.query.ts (100%) rename packages/{utils => types}/protobuf/codegen/juno/rpc.tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/bundle.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/client.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/contractmanager/failure.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/contractmanager/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/contractmanager/params.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/contractmanager/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/contractmanager/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/contractmanager/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/contractmanager/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/contractmanager/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/contractmanager/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/contractmanager/v1/failure.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/cron/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/cron/params.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/cron/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/cron/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/cron/schedule.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/cron/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/cron/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/cron/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/cron/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/dex/deposit_record.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/dex/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/dex/limit_order_expiration.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/dex/limit_order_tranche.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/dex/limit_order_tranche_user.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/dex/pair_id.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/dex/params.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/dex/pool.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/dex/pool_metadata.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/dex/pool_reserves.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/dex/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/dex/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/dex/tick_liquidity.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/dex/trade_pair_id.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/dex/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/dex/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/dex/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/dex/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/feeburner/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/feeburner/params.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/feeburner/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/feeburner/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/feeburner/total_burned_neutrons_amount.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/feeburner/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/feeburner/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/feeburner/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/feeburner/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/feerefunder/fee.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/feerefunder/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/feerefunder/params.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/feerefunder/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/feerefunder/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/feerefunder/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/feerefunder/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/feerefunder/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/feerefunder/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/interchainqueries/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/interchainqueries/params.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/interchainqueries/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/interchainqueries/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/interchainqueries/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/interchainqueries/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/interchainqueries/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/interchainqueries/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/interchaintxs/v1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/interchaintxs/v1/params.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/interchaintxs/v1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/interchaintxs/v1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/interchaintxs/v1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/interchaintxs/v1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/interchaintxs/v1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/interchaintxs/v1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/rpc.query.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/rpc.tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/transfer/v1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/transfer/v1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/transfer/v1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/transfer/v1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/transfer/v1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/neutron/transfer/v1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/noble/bundle.ts (100%) rename packages/{utils => types}/protobuf/codegen/noble/rpc.query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/accum/v1beta1/accum.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/bundle.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/client.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentrated-liquidity/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentrated-liquidity/gov.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentrated-liquidity/incentive_record.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentrated-liquidity/params.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentrated-liquidity/pool.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentrated-liquidity/position.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentrated-liquidity/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentrated-liquidity/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentrated-liquidity/tickInfo.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentrated-liquidity/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentrated-liquidity/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentrated-liquidity/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentrated-liquidity/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentratedliquidity/params.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/gov.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/incentive_record.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/pool.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/position.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tickInfo.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/pool.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/params.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/gamm/pool-models/balancer/balancerPool.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/gamm/pool-models/balancer/tx/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/gamm/pool-models/balancer/tx/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/gamm/pool-models/balancer/tx/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/gamm/pool-models/stableswap/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/gamm/pool-models/stableswap/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/gamm/pool-models/stableswap/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/gamm/pool-models/stableswap/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/gamm/v1beta1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/gamm/v1beta1/gov.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/gamm/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/gamm/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/gamm/v1beta1/shared.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/gamm/v1beta1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/gamm/v1beta1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/gamm/v1beta1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/gamm/v1beta1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/incentives/gauge.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/incentives/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/incentives/gov.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/incentives/group.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/incentives/params.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/incentives/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/incentives/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/incentives/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/incentives/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/incentives/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/incentives/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/lockup/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/lockup/lock.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/lockup/params.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/lockup/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/lockup/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/lockup/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/lockup/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/lockup/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/lockup/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/pool-incentives/v1beta1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/pool-incentives/v1beta1/gov.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/pool-incentives/v1beta1/incentives.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/pool-incentives/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/pool-incentives/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/pool-incentives/v1beta1/shared.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/poolmanager/v1beta1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/poolmanager/v1beta1/gov.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/poolmanager/v1beta1/module_route.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/poolmanager/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/poolmanager/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/poolmanager/v1beta1/swap_route.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/poolmanager/v1beta1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/poolmanager/v1beta1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/poolmanager/v1beta1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/poolmanager/v1beta1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/protorev/v1beta1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/protorev/v1beta1/gov.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/protorev/v1beta1/params.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/protorev/v1beta1/protorev.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/protorev/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/protorev/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/protorev/v1beta1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/protorev/v1beta1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/protorev/v1beta1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/protorev/v1beta1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/rpc.query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/rpc.tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/superfluid/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/superfluid/params.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/superfluid/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/superfluid/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/superfluid/superfluid.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/superfluid/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/superfluid/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/superfluid/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/superfluid/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/superfluid/v1beta1/gov.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/tokenfactory/v1beta1/authorityMetadata.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/tokenfactory/v1beta1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/tokenfactory/v1beta1/params.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/tokenfactory/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/tokenfactory/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/tokenfactory/v1beta1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/tokenfactory/v1beta1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/tokenfactory/v1beta1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/tokenfactory/v1beta1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/txfees/v1beta1/feetoken.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/txfees/v1beta1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/txfees/v1beta1/gov.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/txfees/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/txfees/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/valset-pref/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/valset-pref/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/valset-pref/v1beta1/state.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/valset-pref/v1beta1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/valset-pref/v1beta1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/valset-pref/v1beta1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/osmosis/valset-pref/v1beta1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/bundle.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/client.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/rpc.query.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/rpc.tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/params.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/cron/v1/cron.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/cron/v1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/cron/v1/proposal.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/cron/v1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/cron/v1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/cron/v1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/cron/v1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/cron/v1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/cron/v1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/globalfee/v1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/globalfee/v1/globalfee.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/globalfee/v1/proposal.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/globalfee/v1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/globalfee/v1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/globalfee/v1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/globalfee/v1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/globalfee/v1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/globalfee/v1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/mint.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/bundle.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/client.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/data/v1/events.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/data/v1/state.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/data/v1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/data/v1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/data/v1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/data/v1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/data/v1/types.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/data/v2/events.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/data/v2/state.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/data/v2/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/data/v2/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/data/v2/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/data/v2/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/data/v2/types.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/basket/v1/events.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/basket/v1/state.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/basket/v1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/basket/v1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/basket/v1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/basket/v1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/basket/v1/types.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/marketplace/v1/events.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/marketplace/v1/state.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/marketplace/v1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/marketplace/v1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/marketplace/v1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/marketplace/v1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/marketplace/v1/types.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/orderbook/v1alpha1/memory.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/v1/events.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/v1/state.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/v1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/v1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/v1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/v1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/v1/types.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/v1alpha1/events.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/v1alpha1/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/v1alpha1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/v1alpha1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/v1alpha1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/v1alpha1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/ecocredit/v1alpha1/types.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/intertx/v1/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/intertx/v1/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/intertx/v1/tx.amino.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/intertx/v1/tx.registry.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/intertx/v1/tx.rpc.msg.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/intertx/v1/tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/rpc.query.ts (100%) rename packages/{utils => types}/protobuf/codegen/regen/rpc.tx.ts (100%) rename packages/{utils => types}/protobuf/codegen/tariff/genesis.ts (100%) rename packages/{utils => types}/protobuf/codegen/tariff/params.ts (100%) rename packages/{utils => types}/protobuf/codegen/tariff/query.rpc.Query.ts (100%) rename packages/{utils => types}/protobuf/codegen/tariff/query.ts (100%) rename packages/{utils => types}/protobuf/codegen/tendermint/abci/types.ts (100%) rename packages/{utils => types}/protobuf/codegen/tendermint/bundle.ts (100%) rename packages/{utils => types}/protobuf/codegen/tendermint/crypto/keys.ts (100%) rename packages/{utils => types}/protobuf/codegen/tendermint/crypto/proof.ts (100%) rename packages/{utils => types}/protobuf/codegen/tendermint/p2p/types.ts (100%) rename packages/{utils => types}/protobuf/codegen/tendermint/types/block.ts (100%) rename packages/{utils => types}/protobuf/codegen/tendermint/types/evidence.ts (100%) rename packages/{utils => types}/protobuf/codegen/tendermint/types/params.ts (100%) rename packages/{utils => types}/protobuf/codegen/tendermint/types/types.ts (100%) rename packages/{utils => types}/protobuf/codegen/tendermint/types/validator.ts (100%) rename packages/{utils => types}/protobuf/codegen/tendermint/version/types.ts (100%) rename packages/{utils => types}/protobuf/codegen/utf8.ts (100%) rename packages/{utils => types}/protobuf/codegen/varint.ts (100%) rename packages/{utils => types}/protobuf/index.ts (52%) rename packages/{utils => types}/protobuf/patches.diff (100%) rename packages/{utils => types}/protobuf/proto/alliance/alliance/alliance.proto (100%) rename packages/{utils => types}/protobuf/proto/alliance/alliance/delegations.proto (100%) rename packages/{utils => types}/protobuf/proto/alliance/alliance/events.proto (100%) rename packages/{utils => types}/protobuf/proto/alliance/alliance/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/alliance/alliance/gov.proto (100%) rename packages/{utils => types}/protobuf/proto/alliance/alliance/params.proto (100%) rename packages/{utils => types}/protobuf/proto/alliance/alliance/query.proto (100%) rename packages/{utils => types}/protobuf/proto/alliance/alliance/redelegations.proto (100%) rename packages/{utils => types}/protobuf/proto/alliance/alliance/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/alliance/alliance/unbonding.proto (100%) rename packages/{utils => types}/protobuf/proto/amino/LICENSE (100%) rename packages/{utils => types}/protobuf/proto/amino/README.md (100%) rename packages/{utils => types}/protobuf/proto/amino/amino.proto (100%) rename packages/{utils => types}/protobuf/proto/capability/v1/capability.proto (100%) rename packages/{utils => types}/protobuf/proto/capability/v1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/circle/cctp/v1/attester.proto (100%) rename packages/{utils => types}/protobuf/proto/circle/cctp/v1/burn_message.proto (100%) rename packages/{utils => types}/protobuf/proto/circle/cctp/v1/burning_and_minting_paused.proto (100%) rename packages/{utils => types}/protobuf/proto/circle/cctp/v1/events.proto (100%) rename packages/{utils => types}/protobuf/proto/circle/cctp/v1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/circle/cctp/v1/max_message_body_size.proto (100%) rename packages/{utils => types}/protobuf/proto/circle/cctp/v1/message.proto (100%) rename packages/{utils => types}/protobuf/proto/circle/cctp/v1/nonce.proto (100%) rename packages/{utils => types}/protobuf/proto/circle/cctp/v1/params.proto (100%) rename packages/{utils => types}/protobuf/proto/circle/cctp/v1/per_message_burn_limit.proto (100%) rename packages/{utils => types}/protobuf/proto/circle/cctp/v1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/circle/cctp/v1/remote_token_messenger.proto (100%) rename packages/{utils => types}/protobuf/proto/circle/cctp/v1/sending_and_receiving_messages_paused.proto (100%) rename packages/{utils => types}/protobuf/proto/circle/cctp/v1/signature_threshold.proto (100%) rename packages/{utils => types}/protobuf/proto/circle/cctp/v1/token_pair.proto (100%) rename packages/{utils => types}/protobuf/proto/circle/cctp/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/app/runtime/v1alpha1/module.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/app/v1alpha1/config.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/app/v1alpha1/module.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/app/v1alpha1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/auth/module/v1/module.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/auth/v1beta1/auth.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/auth/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/auth/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/auth/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/authz/module/v1/module.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/authz/v1beta1/authz.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/authz/v1beta1/event.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/authz/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/authz/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/authz/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/autocli/v1/options.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/autocli/v1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/bank/module/v1/module.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/bank/v1beta1/authz.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/bank/v1beta1/bank.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/bank/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/bank/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/bank/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/base/abci/v1beta1/abci.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/base/node/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/base/query/v1beta1/pagination.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/base/reflection/v1beta1/reflection.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/base/reflection/v2alpha1/reflection.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/base/tendermint/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/base/tendermint/v1beta1/types.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/base/v1beta1/coin.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/circuit/module/v1/module.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/circuit/v1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/circuit/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/circuit/v1/types.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/consensus/module/v1/module.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/consensus/v1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/consensus/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/crisis/module/v1/module.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/crisis/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/crisis/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/crypto/ed25519/keys.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/crypto/hd/v1/hd.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/crypto/keyring/v1/record.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/crypto/multisig/keys.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/crypto/multisig/v1beta1/multisig.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/crypto/secp256k1/keys.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/crypto/secp256r1/keys.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/distribution/module/v1/module.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/distribution/v1beta1/distribution.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/distribution/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/distribution/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/distribution/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/evidence/module/v1/module.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/evidence/v1beta1/evidence.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/evidence/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/evidence/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/evidence/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/feegrant/module/v1/module.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/feegrant/v1beta1/feegrant.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/feegrant/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/feegrant/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/feegrant/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/genutil/module/v1/module.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/genutil/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/gov/module/v1/module.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/gov/v1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/gov/v1/gov.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/gov/v1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/gov/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/gov/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/gov/v1beta1/gov.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/gov/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/gov/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/group/module/v1/module.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/group/v1/events.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/group/v1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/group/v1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/group/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/group/v1/types.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/ics23/v1/proofs.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/mint/module/v1/module.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/mint/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/mint/v1beta1/mint.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/mint/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/mint/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/msg/textual/v1/textual.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/msg/v1/msg.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/nft/module/v1/module.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/nft/v1beta1/event.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/nft/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/nft/v1beta1/nft.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/nft/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/nft/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/orm/module/v1alpha1/module.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/orm/query/v1alpha1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/orm/v1/orm.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/orm/v1alpha1/schema.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/params/module/v1/module.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/params/v1beta1/params.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/params/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/query/v1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/reflection/v1/reflection.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/slashing/module/v1/module.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/slashing/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/slashing/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/slashing/v1beta1/slashing.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/slashing/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/staking/module/v1/module.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/staking/v1beta1/authz.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/staking/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/staking/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/staking/v1beta1/staking.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/staking/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/store/internal/kv/v1beta1/kv.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/store/snapshots/v1/snapshot.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/store/streaming/abci/grpc.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/store/v1beta1/commit_info.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/store/v1beta1/listening.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/tx/config/v1/config.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/tx/signing/v1beta1/signing.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/tx/v1beta1/service.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/tx/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/upgrade/module/v1/module.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/upgrade/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/upgrade/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/upgrade/v1beta1/upgrade.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/vesting/module/v1/module.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/vesting/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos/vesting/v1beta1/vesting.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmos_proto/LICENSE (100%) rename packages/{utils => types}/protobuf/proto/cosmos_proto/README.md (100%) rename packages/{utils => types}/protobuf/proto/cosmos_proto/cosmos.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmwasm/LICENSE (100%) rename packages/{utils => types}/protobuf/proto/cosmwasm/README.md (100%) rename packages/{utils => types}/protobuf/proto/cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmwasm/tokenfactory/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmwasm/tokenfactory/v1beta1/params.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmwasm/tokenfactory/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmwasm/tokenfactory/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmwasm/wasm/v1/authz.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmwasm/wasm/v1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmwasm/wasm/v1/ibc.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmwasm/wasm/v1/proposal.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmwasm/wasm/v1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmwasm/wasm/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/cosmwasm/wasm/v1/types.proto (100%) rename packages/{utils => types}/protobuf/proto/gaia/globalfee/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/gaia/globalfee/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/gaia/globalfee/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/gogoproto/LICENSE (100%) rename packages/{utils => types}/protobuf/proto/gogoproto/README.md (100%) rename packages/{utils => types}/protobuf/proto/gogoproto/gogo.proto (100%) rename packages/{utils => types}/protobuf/proto/google/LICENSE (100%) rename packages/{utils => types}/protobuf/proto/google/README.md (100%) rename packages/{utils => types}/protobuf/proto/google/api/annotations.proto (100%) rename packages/{utils => types}/protobuf/proto/google/api/http.proto (100%) rename packages/{utils => types}/protobuf/proto/google/protobuf/any.proto (100%) rename packages/{utils => types}/protobuf/proto/google/protobuf/descriptor.proto (100%) rename packages/{utils => types}/protobuf/proto/google/protobuf/duration.proto (100%) rename packages/{utils => types}/protobuf/proto/google/protobuf/empty.proto (100%) rename packages/{utils => types}/protobuf/proto/google/protobuf/timestamp.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/applications/fee/v1/ack.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/applications/fee/v1/fee.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/applications/fee/v1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/applications/fee/v1/metadata.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/applications/fee/v1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/applications/fee/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/applications/interchain_accounts/controller/v1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/applications/interchain_accounts/host/v1/host.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/applications/interchain_accounts/host/v1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/applications/interchain_accounts/host/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/applications/interchain_accounts/v1/account.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/applications/interchain_accounts/v1/metadata.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/applications/interchain_accounts/v1/packet.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/applications/transfer/v1/authz.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/applications/transfer/v1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/applications/transfer/v1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/applications/transfer/v1/transfer.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/applications/transfer/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/applications/transfer/v2/packet.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/core/channel/v1/channel.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/core/channel/v1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/core/channel/v1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/core/channel/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/core/client/v1/client.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/core/client/v1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/core/client/v1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/core/client/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/core/commitment/v1/commitment.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/core/connection/v1/connection.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/core/connection/v1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/core/connection/v1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/core/connection/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/core/types/v1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/lightclients/localhost/v2/localhost.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/lightclients/solomachine/v2/solomachine.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/lightclients/solomachine/v3/solomachine.proto (100%) rename packages/{utils => types}/protobuf/proto/ibc/lightclients/tendermint/v1/tendermint.proto (100%) rename packages/{utils => types}/protobuf/proto/juno/feeshare/v1/feeshare.proto (100%) rename packages/{utils => types}/protobuf/proto/juno/feeshare/v1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/juno/feeshare/v1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/juno/feeshare/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/juno/mint/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/juno/mint/mint.proto (100%) rename packages/{utils => types}/protobuf/proto/juno/mint/query.proto (100%) rename packages/{utils => types}/protobuf/proto/juno/mint/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/contractmanager/failure.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/contractmanager/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/contractmanager/params.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/contractmanager/query.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/contractmanager/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/contractmanager/v1/failure.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/cron/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/cron/params.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/cron/query.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/cron/schedule.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/cron/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/dex/deposit_record.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/dex/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/dex/limit_order_expiration.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/dex/limit_order_tranche.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/dex/limit_order_tranche_user.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/dex/pair_id.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/dex/params.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/dex/pool.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/dex/pool_metadata.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/dex/pool_reserves.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/dex/query.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/dex/tick_liquidity.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/dex/trade_pair_id.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/dex/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/feeburner/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/feeburner/params.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/feeburner/query.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/feeburner/total_burned_neutrons_amount.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/feeburner/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/feerefunder/fee.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/feerefunder/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/feerefunder/params.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/feerefunder/query.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/feerefunder/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/interchainqueries/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/interchainqueries/params.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/interchainqueries/query.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/interchainqueries/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/interchaintxs/v1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/interchaintxs/v1/params.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/interchaintxs/v1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/interchaintxs/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/transfer/v1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/neutron/transfer/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/accum/v1beta1/accum.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/concentratedliquidity/params.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/concentratedliquidity/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/concentratedliquidity/v1beta1/gov.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/concentratedliquidity/v1beta1/incentive_record.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/concentratedliquidity/v1beta1/pool.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/concentratedliquidity/v1beta1/position.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/concentratedliquidity/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/concentratedliquidity/v1beta1/query.yml (100%) rename packages/{utils => types}/protobuf/proto/osmosis/concentratedliquidity/v1beta1/tickInfo.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/concentratedliquidity/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/cosmwasmpool/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/cosmwasmpool/v1beta1/gov.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/pool.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/cosmwasmpool/v1beta1/params.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/cosmwasmpool/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/cosmwasmpool/v1beta1/query.yml (100%) rename packages/{utils => types}/protobuf/proto/osmosis/cosmwasmpool/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/downtime-detector/v1beta1/downtime_duration.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/downtime-detector/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/downtime-detector/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/downtime-detector/v1beta1/query.yml (100%) rename packages/{utils => types}/protobuf/proto/osmosis/epochs/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/epochs/query.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/gamm/pool-models/balancer/tx/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/gamm/pool-models/stableswap/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/gamm/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/gamm/v1beta1/gov.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/gamm/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/gamm/v1beta1/shared.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/gamm/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/gamm/v2/query.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/ibc-hooks/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/ibc-hooks/params.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/ibc-hooks/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/ibc-rate-limit/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/ibc-rate-limit/v1beta1/params.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/ibc-rate-limit/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/ibc-rate-limit/v1beta1/query.yml (100%) rename packages/{utils => types}/protobuf/proto/osmosis/incentives/gauge.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/incentives/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/incentives/gov.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/incentives/group.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/incentives/params.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/incentives/query.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/incentives/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/lockup/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/lockup/lock.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/lockup/params.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/lockup/query.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/lockup/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/mint/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/mint/v1beta1/mint.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/mint/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/pool-incentives/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/pool-incentives/v1beta1/gov.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/pool-incentives/v1beta1/incentives.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/pool-incentives/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/pool-incentives/v1beta1/shared.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/poolmanager/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/poolmanager/v1beta1/gov.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/poolmanager/v1beta1/module_route.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/poolmanager/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/poolmanager/v1beta1/query.yml (100%) rename packages/{utils => types}/protobuf/proto/osmosis/poolmanager/v1beta1/swap_route.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/poolmanager/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/protorev/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/protorev/v1beta1/gov.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/protorev/v1beta1/params.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/protorev/v1beta1/protorev.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/protorev/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/protorev/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/sumtree/v1beta1/tree.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/superfluid/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/superfluid/params.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/superfluid/query.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/superfluid/superfluid.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/superfluid/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/superfluid/v1beta1/gov.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/tokenfactory/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/tokenfactory/v1beta1/params.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/tokenfactory/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/tokenfactory/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/twap/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/twap/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/twap/v1beta1/query.yml (100%) rename packages/{utils => types}/protobuf/proto/osmosis/twap/v1beta1/twap_record.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/txfees/v1beta1/feetoken.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/txfees/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/txfees/v1beta1/gov.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/txfees/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/valset-pref/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/valset-pref/v1beta1/query.yml (100%) rename packages/{utils => types}/protobuf/proto/osmosis/valset-pref/v1beta1/state.proto (100%) rename packages/{utils => types}/protobuf/proto/osmosis/valset-pref/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/publicawesome/stargaze/alloc/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/publicawesome/stargaze/alloc/v1beta1/params.proto (100%) rename packages/{utils => types}/protobuf/proto/publicawesome/stargaze/alloc/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/publicawesome/stargaze/alloc/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/publicawesome/stargaze/cron/v1/cron.proto (100%) rename packages/{utils => types}/protobuf/proto/publicawesome/stargaze/cron/v1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/publicawesome/stargaze/cron/v1/proposal.proto (100%) rename packages/{utils => types}/protobuf/proto/publicawesome/stargaze/cron/v1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/publicawesome/stargaze/cron/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/publicawesome/stargaze/globalfee/v1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/publicawesome/stargaze/globalfee/v1/globalfee.proto (100%) rename packages/{utils => types}/protobuf/proto/publicawesome/stargaze/globalfee/v1/proposal.proto (100%) rename packages/{utils => types}/protobuf/proto/publicawesome/stargaze/globalfee/v1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/publicawesome/stargaze/globalfee/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/publicawesome/stargaze/mint/v1beta1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/publicawesome/stargaze/mint/v1beta1/mint.proto (100%) rename packages/{utils => types}/protobuf/proto/publicawesome/stargaze/mint/v1beta1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/publicawesome/stargaze/mint/v1beta1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/data/v1/events.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/data/v1/state.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/data/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/data/v1/types.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/data/v2/events.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/data/v2/state.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/data/v2/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/data/v2/types.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/ecocredit/basket/v1/events.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/ecocredit/basket/v1/state.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/ecocredit/basket/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/ecocredit/basket/v1/types.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/ecocredit/marketplace/v1/events.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/ecocredit/marketplace/v1/state.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/ecocredit/marketplace/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/ecocredit/marketplace/v1/types.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/ecocredit/orderbook/v1alpha1/memory.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/ecocredit/v1/events.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/ecocredit/v1/state.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/ecocredit/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/ecocredit/v1/types.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/ecocredit/v1alpha1/events.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/ecocredit/v1alpha1/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/ecocredit/v1alpha1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/ecocredit/v1alpha1/types.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/intertx/v1/query.proto (100%) rename packages/{utils => types}/protobuf/proto/regen/intertx/v1/tx.proto (100%) rename packages/{utils => types}/protobuf/proto/tariff/genesis.proto (100%) rename packages/{utils => types}/protobuf/proto/tariff/params.proto (100%) rename packages/{utils => types}/protobuf/proto/tariff/query.proto (100%) rename packages/{utils => types}/protobuf/proto/tendermint/abci/types.proto (100%) rename packages/{utils => types}/protobuf/proto/tendermint/crypto/keys.proto (100%) rename packages/{utils => types}/protobuf/proto/tendermint/crypto/proof.proto (100%) rename packages/{utils => types}/protobuf/proto/tendermint/libs/bits/types.proto (100%) rename packages/{utils => types}/protobuf/proto/tendermint/p2p/types.proto (100%) rename packages/{utils => types}/protobuf/proto/tendermint/types/block.proto (100%) rename packages/{utils => types}/protobuf/proto/tendermint/types/evidence.proto (100%) rename packages/{utils => types}/protobuf/proto/tendermint/types/params.proto (100%) rename packages/{utils => types}/protobuf/proto/tendermint/types/types.proto (100%) rename packages/{utils => types}/protobuf/proto/tendermint/types/validator.proto (100%) rename packages/{utils => types}/protobuf/proto/tendermint/version/types.proto (100%) rename packages/{utils => types}/protobuf/scripts/codegen.js (100%) create mode 100644 packages/types/protobuf/utils.ts delete mode 100644 packages/utils/protobuf/codegen/cosmos/authz/v1beta1/tx.ts delete mode 100644 packages/utils/protobuf/codegen/cosmos/gov/v1/tx.ts diff --git a/packages/state/recoil/selectors/account.ts b/packages/state/recoil/selectors/account.ts index b99a032b9..d180bea25 100644 --- a/packages/state/recoil/selectors/account.ts +++ b/packages/state/recoil/selectors/account.ts @@ -17,6 +17,9 @@ import { WithChainId, } from '@dao-dao/types' import { Threshold } from '@dao-dao/types/contracts/DaoProposalSingle.common' +import { BaseAccount } from '@dao-dao/types/protobuf/codegen/cosmos/auth/v1beta1/auth' +import { LegacyAminoPubKey } from '@dao-dao/types/protobuf/codegen/cosmos/crypto/multisig/keys' +import { PubKey } from '@dao-dao/types/protobuf/codegen/cosmos/crypto/secp256k1/keys' import { ContractName, ICA_CHAINS_TX_PREFIX, @@ -25,9 +28,6 @@ import { secp256k1PublicKeyToBech32Address, tokensEqual, } from '@dao-dao/utils' -import { BaseAccount } from '@dao-dao/utils/protobuf/codegen/cosmos/auth/v1beta1/auth' -import { LegacyAminoPubKey } from '@dao-dao/utils/protobuf/codegen/cosmos/crypto/multisig/keys' -import { PubKey } from '@dao-dao/utils/protobuf/codegen/cosmos/crypto/secp256k1/keys' import { cosmosRpcClientForChainSelector } from './chain' import { diff --git a/packages/state/recoil/selectors/chain.ts b/packages/state/recoil/selectors/chain.ts index 29eb362cb..bfea27eb4 100644 --- a/packages/state/recoil/selectors/chain.ts +++ b/packages/state/recoil/selectors/chain.ts @@ -30,19 +30,6 @@ import { ValidatorSlash, WithChainId, } from '@dao-dao/types' -import { - addressIsModule, - cosmWasmClientRouter, - cosmosSdkVersionIs46OrHigher, - cosmosSdkVersionIs47OrHigher, - cosmosValidatorToValidator, - decodeGovProposal, - getAllRpcResponse, - getNativeTokenForChainId, - getRpcForChainId, - retry, - stargateClientRouter, -} from '@dao-dao/utils' import { cosmos, cosmwasm, @@ -51,22 +38,35 @@ import { neutron, noble, osmosis, -} from '@dao-dao/utils/protobuf' -import { ModuleAccount } from '@dao-dao/utils/protobuf/codegen/cosmos/auth/v1beta1/auth' -import { Metadata } from '@dao-dao/utils/protobuf/codegen/cosmos/bank/v1beta1/bank' -import { DecCoin } from '@dao-dao/utils/protobuf/codegen/cosmos/base/v1beta1/coin' +} from '@dao-dao/types/protobuf' +import { ModuleAccount } from '@dao-dao/types/protobuf/codegen/cosmos/auth/v1beta1/auth' +import { Metadata } from '@dao-dao/types/protobuf/codegen/cosmos/bank/v1beta1/bank' +import { DecCoin } from '@dao-dao/types/protobuf/codegen/cosmos/base/v1beta1/coin' import { ProposalStatus, TallyResult, Vote, WeightedVoteOption, -} from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/gov' +} from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' import { Pool, Validator as RpcValidator, -} from '@dao-dao/utils/protobuf/codegen/cosmos/staking/v1beta1/staking' -import { Fee as NeutronFee } from '@dao-dao/utils/protobuf/codegen/neutron/feerefunder/fee' -import { Params as NobleTariffParams } from '@dao-dao/utils/protobuf/codegen/tariff/params' +} from '@dao-dao/types/protobuf/codegen/cosmos/staking/v1beta1/staking' +import { Fee as NeutronFee } from '@dao-dao/types/protobuf/codegen/neutron/feerefunder/fee' +import { Params as NobleTariffParams } from '@dao-dao/types/protobuf/codegen/tariff/params' +import { + addressIsModule, + cosmWasmClientRouter, + cosmosSdkVersionIs46OrHigher, + cosmosSdkVersionIs47OrHigher, + cosmosValidatorToValidator, + decodeGovProposal, + getAllRpcResponse, + getNativeTokenForChainId, + getRpcForChainId, + retry, + stargateClientRouter, +} from '@dao-dao/utils' import { refreshBlockHeightAtom, diff --git a/packages/state/recoil/selectors/ica.ts b/packages/state/recoil/selectors/ica.ts index 2ff833d39..b6f1f5364 100644 --- a/packages/state/recoil/selectors/ica.ts +++ b/packages/state/recoil/selectors/ica.ts @@ -1,9 +1,9 @@ import { selectorFamily } from 'recoil' import { WithChainId } from '@dao-dao/types' +import { MsgSend } from '@dao-dao/types/protobuf/codegen/cosmos/bank/v1beta1/tx' +import { MsgTransfer } from '@dao-dao/types/protobuf/codegen/ibc/applications/transfer/v1/tx' import { getIbcTransferInfoBetweenChains } from '@dao-dao/utils' -import { MsgSend } from '@dao-dao/utils/protobuf/codegen/cosmos/bank/v1beta1/tx' -import { MsgTransfer } from '@dao-dao/utils/protobuf/codegen/ibc/applications/transfer/v1/tx' import { ibcRpcClientForChainSelector } from './chain' diff --git a/packages/stateful/actions/core/advanced/CreateIca/index.tsx b/packages/stateful/actions/core/advanced/CreateIca/index.tsx index 7fe270860..f37e5d19f 100644 --- a/packages/stateful/actions/core/advanced/CreateIca/index.tsx +++ b/packages/stateful/actions/core/advanced/CreateIca/index.tsx @@ -16,17 +16,17 @@ import { UseDefaults, UseHideFromPicker, UseTransformToCosmos, + makeStargateMessage, } from '@dao-dao/types' +import { MsgRegisterInterchainAccount } from '@dao-dao/types/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx' +import { Metadata } from '@dao-dao/types/protobuf/codegen/ibc/applications/interchain_accounts/v1/metadata' import { getChainForChainName, getDisplayNameForChainId, getIbcTransferInfoBetweenChains, getIbcTransferInfoFromConnection, isDecodedStargateMsg, - makeStargateMessage, } from '@dao-dao/utils' -import { MsgRegisterInterchainAccount } from '@dao-dao/utils/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx' -import { Metadata } from '@dao-dao/utils/protobuf/codegen/ibc/applications/interchain_accounts/v1/metadata' import { useActionOptions } from '../../../react' import { CreateIcaComponent, CreateIcaData } from './Component' diff --git a/packages/stateful/actions/core/advanced/Custom/Component.tsx b/packages/stateful/actions/core/advanced/Custom/Component.tsx index fbe2594b0..7ab55668f 100644 --- a/packages/stateful/actions/core/advanced/Custom/Component.tsx +++ b/packages/stateful/actions/core/advanced/Custom/Component.tsx @@ -9,11 +9,9 @@ import { FilterableItemPopup, useChain, } from '@dao-dao/stateless' -import { ChainId } from '@dao-dao/types' +import { ChainId, PROTOBUF_TYPES, makeStargateMessage } from '@dao-dao/types' import { ActionComponent } from '@dao-dao/types/actions' import { - PROTOBUF_TYPES, - makeStargateMessage, makeWasmMessage, objectMatchesStructure, validateCosmosMsg, diff --git a/packages/stateful/actions/core/advanced/Custom/index.tsx b/packages/stateful/actions/core/advanced/Custom/index.tsx index f23b3ebdc..ac4ddaad0 100644 --- a/packages/stateful/actions/core/advanced/Custom/index.tsx +++ b/packages/stateful/actions/core/advanced/Custom/index.tsx @@ -2,6 +2,7 @@ import JSON5 from 'json5' import { useCallback, useMemo } from 'react' import { RobotEmoji } from '@dao-dao/stateless' +import { makeStargateMessage } from '@dao-dao/types' import { ActionKey, ActionMaker, @@ -9,7 +10,7 @@ import { UseDefaults, UseTransformToCosmos, } from '@dao-dao/types/actions' -import { makeStargateMessage, makeWasmMessage } from '@dao-dao/utils' +import { makeWasmMessage } from '@dao-dao/utils' import { CustomComponent as Component, CustomData } from './Component' diff --git a/packages/stateful/actions/core/authorizations/AuthzExec/index.tsx b/packages/stateful/actions/core/authorizations/AuthzExec/index.tsx index 5eb1913dd..c879c162a 100644 --- a/packages/stateful/actions/core/authorizations/AuthzExec/index.tsx +++ b/packages/stateful/actions/core/authorizations/AuthzExec/index.tsx @@ -18,18 +18,18 @@ import { UseDecodedCosmosMsg, UseDefaults, UseTransformToCosmos, + cwMsgToProtobuf, + makeStargateMessage, + protobufToCwMsg, } from '@dao-dao/types' +import { MsgExec } from '@dao-dao/types/protobuf/codegen/cosmos/authz/v1beta1/tx' import { - cwMsgToProtobuf, decodePolytoneExecuteMsg, getChainAddressForActionOptions, isDecodedStargateMsg, - makeStargateMessage, maybeMakePolytoneExecuteMessage, objectMatchesStructure, - protobufToCwMsg, } from '@dao-dao/utils' -import { MsgExec } from '@dao-dao/utils/protobuf/codegen/cosmos/authz/v1beta1/tx' import { AddressInput, diff --git a/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/Component.stories.tsx b/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/Component.stories.tsx index 66eae0e0a..622ecd3ef 100644 --- a/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/Component.stories.tsx +++ b/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/Component.stories.tsx @@ -8,13 +8,13 @@ import { makeReactHookFormDecorator, } from '@dao-dao/storybook/decorators' import { TokenType } from '@dao-dao/types' -import { getNativeTokenForChainId } from '@dao-dao/utils' -import { GenericAuthorization } from '@dao-dao/utils/protobuf/codegen/cosmos/authz/v1beta1/authz' -import { MsgDelegate } from '@dao-dao/utils/protobuf/codegen/cosmos/staking/v1beta1/tx' +import { GenericAuthorization } from '@dao-dao/types/protobuf/codegen/cosmos/authz/v1beta1/authz' +import { MsgDelegate } from '@dao-dao/types/protobuf/codegen/cosmos/staking/v1beta1/tx' import { AllowAllMessagesFilter, MaxCallsLimit, -} from '@dao-dao/utils/protobuf/codegen/cosmwasm/wasm/v1/authz' +} from '@dao-dao/types/protobuf/codegen/cosmwasm/wasm/v1/authz' +import { getNativeTokenForChainId } from '@dao-dao/utils' import { AuthzGrantRevokeComponent } from './Component' import { AuthzGrantRevokeData } from './types' diff --git a/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/Component.tsx b/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/Component.tsx index cc9b4246a..fe1f79950 100644 --- a/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/Component.tsx +++ b/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/Component.tsx @@ -26,16 +26,8 @@ import { LoadingData, } from '@dao-dao/types' import { ActionComponent } from '@dao-dao/types/actions' -import { - getNativeTokenForChainId, - makeValidateAddress, - makeWasmMessage, - validateCosmosMsg, - validateNonNegative, - validateRequired, -} from '@dao-dao/utils' -import { GenericAuthorization } from '@dao-dao/utils/protobuf/codegen/cosmos/authz/v1beta1/authz' -import { SendAuthorization } from '@dao-dao/utils/protobuf/codegen/cosmos/bank/v1beta1/authz' +import { GenericAuthorization } from '@dao-dao/types/protobuf/codegen/cosmos/authz/v1beta1/authz' +import { SendAuthorization } from '@dao-dao/types/protobuf/codegen/cosmos/bank/v1beta1/authz' import { AcceptedMessageKeysFilter, AcceptedMessagesFilter, @@ -44,7 +36,15 @@ import { ContractMigrationAuthorization, MaxCallsLimit, MaxFundsLimit, -} from '@dao-dao/utils/protobuf/codegen/cosmwasm/wasm/v1/authz' +} from '@dao-dao/types/protobuf/codegen/cosmwasm/wasm/v1/authz' +import { + getNativeTokenForChainId, + makeValidateAddress, + makeWasmMessage, + validateCosmosMsg, + validateNonNegative, + validateRequired, +} from '@dao-dao/utils' import { ACTION_TYPES, diff --git a/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/index.tsx b/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/index.tsx index 8f8d6a9c7..62ffe7f04 100644 --- a/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/index.tsx +++ b/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/index.tsx @@ -9,7 +9,7 @@ import { KeyEmoji, Loader, } from '@dao-dao/stateless' -import { Coin } from '@dao-dao/types' +import { Coin, makeStargateMessage } from '@dao-dao/types' import { ActionComponent, ActionContextType, @@ -19,23 +19,12 @@ import { UseDefaults, UseTransformToCosmos, } from '@dao-dao/types/actions' -import { - convertDenomToMicroDenomWithDecimals, - convertMicroDenomToDenomWithDecimals, - decodePolytoneExecuteMsg, - getChainAddressForActionOptions, - getTokenForChainIdAndDenom, - isDecodedStargateMsg, - makeStargateMessage, - maybeMakePolytoneExecuteMessage, - objectMatchesStructure, -} from '@dao-dao/utils' -import { GenericAuthorization } from '@dao-dao/utils/protobuf/codegen/cosmos/authz/v1beta1/authz' +import { GenericAuthorization } from '@dao-dao/types/protobuf/codegen/cosmos/authz/v1beta1/authz' import { MsgGrant, MsgRevoke, -} from '@dao-dao/utils/protobuf/codegen/cosmos/authz/v1beta1/tx' -import { SendAuthorization } from '@dao-dao/utils/protobuf/codegen/cosmos/bank/v1beta1/authz' +} from '@dao-dao/types/protobuf/codegen/cosmos/authz/v1beta1/tx' +import { SendAuthorization } from '@dao-dao/types/protobuf/codegen/cosmos/bank/v1beta1/authz' import { AcceptedMessageKeysFilter, AcceptedMessagesFilter, @@ -44,8 +33,18 @@ import { ContractGrant, ContractMigrationAuthorization, MaxCallsLimit, -} from '@dao-dao/utils/protobuf/codegen/cosmwasm/wasm/v1/authz' -import { Any } from '@dao-dao/utils/protobuf/codegen/google/protobuf/any' +} from '@dao-dao/types/protobuf/codegen/cosmwasm/wasm/v1/authz' +import { Any } from '@dao-dao/types/protobuf/codegen/google/protobuf/any' +import { + convertDenomToMicroDenomWithDecimals, + convertMicroDenomToDenomWithDecimals, + decodePolytoneExecuteMsg, + getChainAddressForActionOptions, + getTokenForChainIdAndDenom, + isDecodedStargateMsg, + maybeMakePolytoneExecuteMessage, + objectMatchesStructure, +} from '@dao-dao/utils' import { AddressInput, SuspenseLoader } from '../../../../components' import { useTokenBalances } from '../../../hooks' diff --git a/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/types.ts b/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/types.ts index 498124862..416434df3 100644 --- a/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/types.ts +++ b/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/types.ts @@ -1,13 +1,13 @@ -import { GenericAuthorization } from '@dao-dao/utils/protobuf/codegen/cosmos/authz/v1beta1/authz' -import { SendAuthorization } from '@dao-dao/utils/protobuf/codegen/cosmos/bank/v1beta1/authz' -import { MsgSend } from '@dao-dao/utils/protobuf/codegen/cosmos/bank/v1beta1/tx' -import { MsgWithdrawDelegatorReward } from '@dao-dao/utils/protobuf/codegen/cosmos/distribution/v1beta1/tx' -import { MsgVote } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/tx' +import { GenericAuthorization } from '@dao-dao/types/protobuf/codegen/cosmos/authz/v1beta1/authz' +import { SendAuthorization } from '@dao-dao/types/protobuf/codegen/cosmos/bank/v1beta1/authz' +import { MsgSend } from '@dao-dao/types/protobuf/codegen/cosmos/bank/v1beta1/tx' +import { MsgWithdrawDelegatorReward } from '@dao-dao/types/protobuf/codegen/cosmos/distribution/v1beta1/tx' +import { MsgVote } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/tx' import { MsgBeginRedelegate, MsgDelegate, MsgUndelegate, -} from '@dao-dao/utils/protobuf/codegen/cosmos/staking/v1beta1/tx' +} from '@dao-dao/types/protobuf/codegen/cosmos/staking/v1beta1/tx' import { AcceptedMessageKeysFilter, AcceptedMessagesFilter, @@ -17,11 +17,11 @@ import { ContractMigrationAuthorization, MaxCallsLimit, MaxFundsLimit, -} from '@dao-dao/utils/protobuf/codegen/cosmwasm/wasm/v1/authz' +} from '@dao-dao/types/protobuf/codegen/cosmwasm/wasm/v1/authz' import { MsgExecuteContract, MsgMigrateContract, -} from '@dao-dao/utils/protobuf/codegen/cosmwasm/wasm/v1/tx' +} from '@dao-dao/types/protobuf/codegen/cosmwasm/wasm/v1/tx' export type AuthzGrantRevokeData = { chainId: string diff --git a/packages/stateful/actions/core/chain_governance/GovernanceDeposit/Component.stories.tsx b/packages/stateful/actions/core/chain_governance/GovernanceDeposit/Component.stories.tsx index 0db902b51..4fb498047 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceDeposit/Component.stories.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceDeposit/Component.stories.tsx @@ -5,8 +5,8 @@ import { GovProposalVersion, GovProposalWithDecodedContent, } from '@dao-dao/types' -import { ProposalStatus } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/gov' -import { SoftwareUpgradeProposal } from '@dao-dao/utils/protobuf/codegen/cosmos/upgrade/v1beta1/upgrade' +import { ProposalStatus } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' +import { SoftwareUpgradeProposal } from '@dao-dao/types/protobuf/codegen/cosmos/upgrade/v1beta1/upgrade' import { GovProposalActionDisplay } from '../../../../components' import { TokenAmountDisplay } from '../../../../components/TokenAmountDisplay' diff --git a/packages/stateful/actions/core/chain_governance/GovernanceDeposit/index.tsx b/packages/stateful/actions/core/chain_governance/GovernanceDeposit/index.tsx index 279c003b8..72e343a32 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceDeposit/index.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceDeposit/index.tsx @@ -16,7 +16,7 @@ import { useCachedLoading, useChain, } from '@dao-dao/stateless' -import { ChainId, TokenType } from '@dao-dao/types' +import { ChainId, TokenType, makeStargateMessage } from '@dao-dao/types' import { ActionComponent, ActionContextType, @@ -26,16 +26,15 @@ import { UseDefaults, UseTransformToCosmos, } from '@dao-dao/types/actions' +import { ProposalStatus } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' +import { MsgDeposit } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/tx' import { decodePolytoneExecuteMsg, getChainAddressForActionOptions, isDecodedStargateMsg, - makeStargateMessage, maybeMakePolytoneExecuteMessage, objectMatchesStructure, } from '@dao-dao/utils' -import { ProposalStatus } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/gov' -import { MsgDeposit } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/tx' import { GovProposalActionDisplay } from '../../../../components' import { SuspenseLoader } from '../../../../components/SuspenseLoader' diff --git a/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.stories.tsx b/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.stories.tsx index 6ad4a1ea3..2b55b385d 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.stories.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.stories.tsx @@ -2,8 +2,8 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' import { CHAIN_ID, ReactHookFormDecorator } from '@dao-dao/storybook' import { GovProposalVersion } from '@dao-dao/types' -import { SoftwareUpgradeProposal } from '@dao-dao/utils/protobuf/codegen/cosmos/upgrade/v1beta1/upgrade' -import { Any } from '@dao-dao/utils/protobuf/codegen/google/protobuf/any' +import { SoftwareUpgradeProposal } from '@dao-dao/types/protobuf/codegen/cosmos/upgrade/v1beta1/upgrade' +import { Any } from '@dao-dao/types/protobuf/codegen/google/protobuf/any' import { GovProposalActionDisplay, diff --git a/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.tsx b/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.tsx index f55ce184c..91fb2ceca 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.tsx @@ -37,6 +37,10 @@ import { StatefulTokenAmountDisplayProps, } from '@dao-dao/types' import { ActionComponent, ActionContextType } from '@dao-dao/types/actions' +import { CommunityPoolSpendProposal } from '@dao-dao/types/protobuf/codegen/cosmos/distribution/v1beta1/distribution' +import { Cosmos_govv1beta1Content_FromAmino } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' +import { ParameterChangeProposal } from '@dao-dao/types/protobuf/codegen/cosmos/params/v1beta1/params' +import { SoftwareUpgradeProposal } from '@dao-dao/types/protobuf/codegen/cosmos/upgrade/v1beta1/upgrade' import { convertMicroDenomToDenomWithDecimals, getChainAssets, @@ -46,10 +50,6 @@ import { validateJSON, validateRequired, } from '@dao-dao/utils' -import { CommunityPoolSpendProposal } from '@dao-dao/utils/protobuf/codegen/cosmos/distribution/v1beta1/distribution' -import { Cosmos_govv1beta1Content_FromAmino } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/gov' -import { ParameterChangeProposal } from '@dao-dao/utils/protobuf/codegen/cosmos/params/v1beta1/params' -import { SoftwareUpgradeProposal } from '@dao-dao/utils/protobuf/codegen/cosmos/upgrade/v1beta1/upgrade' import { useActionOptions } from '../../../react' diff --git a/packages/stateful/actions/core/chain_governance/GovernanceProposal/index.tsx b/packages/stateful/actions/core/chain_governance/GovernanceProposal/index.tsx index 6bdda1b37..2e0f88998 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceProposal/index.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceProposal/index.tsx @@ -32,28 +32,28 @@ import { UseDecodedCosmosMsg, UseDefaults, UseTransformToCosmos, + cwMsgToProtobuf, + makeStargateMessage, } from '@dao-dao/types' +import { CommunityPoolSpendProposal } from '@dao-dao/types/protobuf/codegen/cosmos/distribution/v1beta1/distribution' +import { + MsgExecLegacyContent, + MsgSubmitProposal as MsgSubmitProposalV1, +} from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1/tx' +import { TextProposal } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' +import { MsgSubmitProposal as MsgSubmitProposalV1Beta1 } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/tx' +import { ParameterChangeProposal } from '@dao-dao/types/protobuf/codegen/cosmos/params/v1beta1/params' +import { SoftwareUpgradeProposal } from '@dao-dao/types/protobuf/codegen/cosmos/upgrade/v1beta1/upgrade' +import { Any } from '@dao-dao/types/protobuf/codegen/google/protobuf/any' import { - cwMsgToProtobuf, decodeGovProposalV1Messages, decodePolytoneExecuteMsg, getChainAddressForActionOptions, getNativeTokenForChainId, isDecodedStargateMsg, - makeStargateMessage, maybeMakePolytoneExecuteMessage, objectMatchesStructure, } from '@dao-dao/utils' -import { CommunityPoolSpendProposal } from '@dao-dao/utils/protobuf/codegen/cosmos/distribution/v1beta1/distribution' -import { - MsgExecLegacyContent, - MsgSubmitProposal as MsgSubmitProposalV1, -} from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1/tx' -import { TextProposal } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/gov' -import { MsgSubmitProposal as MsgSubmitProposalV1Beta1 } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/tx' -import { ParameterChangeProposal } from '@dao-dao/utils/protobuf/codegen/cosmos/params/v1beta1/params' -import { SoftwareUpgradeProposal } from '@dao-dao/utils/protobuf/codegen/cosmos/upgrade/v1beta1/upgrade' -import { Any } from '@dao-dao/utils/protobuf/codegen/google/protobuf/any' import { GovProposalActionDisplay } from '../../../../components' import { AddressInput } from '../../../../components/AddressInput' diff --git a/packages/stateful/actions/core/chain_governance/GovernanceVote/Component.tsx b/packages/stateful/actions/core/chain_governance/GovernanceVote/Component.tsx index 0f61d9e4f..025c6867c 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceVote/Component.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceVote/Component.tsx @@ -28,11 +28,11 @@ import { ActionComponentProps, ActionContextType, } from '@dao-dao/types/actions' -import { formatPercentOf100, validateRequired } from '@dao-dao/utils' import { VoteOption, WeightedVoteOption, -} from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/gov' +} from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' +import { formatPercentOf100, validateRequired } from '@dao-dao/utils' import { useActionOptions } from '../../../react' diff --git a/packages/stateful/actions/core/chain_governance/GovernanceVote/index.tsx b/packages/stateful/actions/core/chain_governance/GovernanceVote/index.tsx index 243435463..9f60ec18d 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceVote/index.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceVote/index.tsx @@ -13,7 +13,11 @@ import { DaoSupportedChainPickerInput, Loader, } from '@dao-dao/stateless' -import { ChainId } from '@dao-dao/types' +import { + ChainId, + cwVoteOptionToGovVoteOption, + govVoteOptionToCwVoteOption, +} from '@dao-dao/types' import { ActionComponent, ActionContextType, @@ -24,20 +28,18 @@ import { UseTransformToCosmos, } from '@dao-dao/types/actions' import { - cwVoteOptionToGovVoteOption, + ProposalStatus, + VoteOption, +} from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' +import { MsgVote } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/tx' +import { decodePolytoneExecuteMsg, getChainAddressForActionOptions, - govVoteOptionToCwVoteOption, isDecodedStargateMsg, loadableToLoadingData, maybeMakePolytoneExecuteMessage, objectMatchesStructure, } from '@dao-dao/utils' -import { - ProposalStatus, - VoteOption, -} from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/gov' -import { MsgVote } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/tx' import { GovProposalActionDisplay, diff --git a/packages/stateful/actions/core/chain_governance/ValidatorActions/Component.tsx b/packages/stateful/actions/core/chain_governance/ValidatorActions/Component.tsx index 47017f712..51e064731 100644 --- a/packages/stateful/actions/core/chain_governance/ValidatorActions/Component.tsx +++ b/packages/stateful/actions/core/chain_governance/ValidatorActions/Component.tsx @@ -9,6 +9,12 @@ import { SelectInput, } from '@dao-dao/stateless' import { ActionComponent, ActionContextType } from '@dao-dao/types/actions' +import { MsgWithdrawValidatorCommission } from '@dao-dao/types/protobuf/codegen/cosmos/distribution/v1beta1/tx' +import { MsgUnjail } from '@dao-dao/types/protobuf/codegen/cosmos/slashing/v1beta1/tx' +import { + MsgCreateValidator, + MsgEditValidator, +} from '@dao-dao/types/protobuf/codegen/cosmos/staking/v1beta1/tx' import { getChainAddressForActionOptions, getChainForChainId, @@ -16,12 +22,6 @@ import { toValidatorAddress, validateJSON, } from '@dao-dao/utils' -import { MsgWithdrawValidatorCommission } from '@dao-dao/utils/protobuf/codegen/cosmos/distribution/v1beta1/tx' -import { MsgUnjail } from '@dao-dao/utils/protobuf/codegen/cosmos/slashing/v1beta1/tx' -import { - MsgCreateValidator, - MsgEditValidator, -} from '@dao-dao/utils/protobuf/codegen/cosmos/staking/v1beta1/tx' import { useActionOptions } from '../../../react' diff --git a/packages/stateful/actions/core/chain_governance/ValidatorActions/index.tsx b/packages/stateful/actions/core/chain_governance/ValidatorActions/index.tsx index 88ebb142e..b4ee954d6 100644 --- a/packages/stateful/actions/core/chain_governance/ValidatorActions/index.tsx +++ b/packages/stateful/actions/core/chain_governance/ValidatorActions/index.tsx @@ -3,7 +3,7 @@ import cloneDeep from 'lodash.clonedeep' import { useCallback } from 'react' import { PickEmoji } from '@dao-dao/stateless' -import { ChainId } from '@dao-dao/types' +import { ChainId, makeStargateMessage } from '@dao-dao/types' import { ActionContextType, ActionKey, @@ -12,23 +12,22 @@ import { UseDefaults, UseTransformToCosmos, } from '@dao-dao/types/actions' +import { PubKey } from '@dao-dao/types/protobuf/codegen/cosmos/crypto/ed25519/keys' +import { MsgWithdrawValidatorCommission } from '@dao-dao/types/protobuf/codegen/cosmos/distribution/v1beta1/tx' +import { MsgUnjail } from '@dao-dao/types/protobuf/codegen/cosmos/slashing/v1beta1/tx' +import { + MsgCreateValidator, + MsgEditValidator, +} from '@dao-dao/types/protobuf/codegen/cosmos/staking/v1beta1/tx' import { decodePolytoneExecuteMsg, getChainAddressForActionOptions, getChainForChainId, getNativeTokenForChainId, isDecodedStargateMsg, - makeStargateMessage, maybeMakePolytoneExecuteMessage, toValidatorAddress, } from '@dao-dao/utils' -import { PubKey } from '@dao-dao/utils/protobuf/codegen/cosmos/crypto/ed25519/keys' -import { MsgWithdrawValidatorCommission } from '@dao-dao/utils/protobuf/codegen/cosmos/distribution/v1beta1/tx' -import { MsgUnjail } from '@dao-dao/utils/protobuf/codegen/cosmos/slashing/v1beta1/tx' -import { - MsgCreateValidator, - MsgEditValidator, -} from '@dao-dao/utils/protobuf/codegen/cosmos/staking/v1beta1/tx' import { ValidatorActionsComponent as Component, diff --git a/packages/stateful/actions/core/smart_contracting/FeeShare/Component.stories.tsx b/packages/stateful/actions/core/smart_contracting/FeeShare/Component.stories.tsx index f9fe3dbfd..1194a88fe 100644 --- a/packages/stateful/actions/core/smart_contracting/FeeShare/Component.stories.tsx +++ b/packages/stateful/actions/core/smart_contracting/FeeShare/Component.stories.tsx @@ -1,7 +1,7 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' import { makeReactHookFormDecorator } from '@dao-dao/storybook' -import { MsgRegisterFeeShare } from '@dao-dao/utils/protobuf/codegen/juno/feeshare/v1/tx' +import { MsgRegisterFeeShare } from '@dao-dao/types/protobuf/codegen/juno/feeshare/v1/tx' import { AddressInput } from '../../../../components/AddressInput' import { FeeShareComponent, FeeShareData } from './Component' diff --git a/packages/stateful/actions/core/smart_contracting/FeeShare/Component.tsx b/packages/stateful/actions/core/smart_contracting/FeeShare/Component.tsx index fb8f00a44..ac7f44458 100644 --- a/packages/stateful/actions/core/smart_contracting/FeeShare/Component.tsx +++ b/packages/stateful/actions/core/smart_contracting/FeeShare/Component.tsx @@ -10,11 +10,11 @@ import { } from '@dao-dao/stateless' import { AddressInputProps } from '@dao-dao/types' import { ActionComponent } from '@dao-dao/types/actions' -import { makeValidateAddress } from '@dao-dao/utils' import { MsgRegisterFeeShare, MsgUpdateFeeShare, -} from '@dao-dao/utils/protobuf/codegen/juno/feeshare/v1/tx' +} from '@dao-dao/types/protobuf/codegen/juno/feeshare/v1/tx' +import { makeValidateAddress } from '@dao-dao/utils' import { useActionOptions } from '../../../react' diff --git a/packages/stateful/actions/core/smart_contracting/FeeShare/index.tsx b/packages/stateful/actions/core/smart_contracting/FeeShare/index.tsx index 3b4d242cb..799d583d7 100644 --- a/packages/stateful/actions/core/smart_contracting/FeeShare/index.tsx +++ b/packages/stateful/actions/core/smart_contracting/FeeShare/index.tsx @@ -1,7 +1,7 @@ import { useCallback, useMemo } from 'react' import { GasEmoji } from '@dao-dao/stateless' -import { ChainId } from '@dao-dao/types' +import { ChainId, makeStargateMessage } from '@dao-dao/types' import { ActionComponent, ActionKey, @@ -10,11 +10,11 @@ import { UseDefaults, UseTransformToCosmos, } from '@dao-dao/types/actions' -import { isDecodedStargateMsg, makeStargateMessage } from '@dao-dao/utils' import { MsgRegisterFeeShare, MsgUpdateFeeShare, -} from '@dao-dao/utils/protobuf/codegen/juno/feeshare/v1/tx' +} from '@dao-dao/types/protobuf/codegen/juno/feeshare/v1/tx' +import { isDecodedStargateMsg } from '@dao-dao/utils' import { AddressInput } from '../../../../components/AddressInput' import { FeeShareComponent, FeeShareData } from './Component' diff --git a/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx b/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx index e8cd7750e..84315db6c 100644 --- a/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx +++ b/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx @@ -13,7 +13,7 @@ import { ChainProvider, DaoSupportedChainPickerInput, } from '@dao-dao/stateless' -import { TokenType } from '@dao-dao/types' +import { TokenType, makeStargateMessage } from '@dao-dao/types' import { ActionComponent, ActionContextType, @@ -23,6 +23,7 @@ import { UseDefaults, UseTransformToCosmos, } from '@dao-dao/types/actions' +import { MsgInstantiateContract2 } from '@dao-dao/types/protobuf/codegen/cosmwasm/wasm/v1/tx' import { convertDenomToMicroDenomStringWithDecimals, convertMicroDenomToDenomWithDecimals, @@ -31,12 +32,10 @@ import { getChainAddressForActionOptions, getNativeTokenForChainId, isDecodedStargateMsg, - makeStargateMessage, maybeMakePolytoneExecuteMessage, objectMatchesStructure, parseEncodedMessage, } from '@dao-dao/utils' -import { MsgInstantiateContract2 } from '@dao-dao/utils/protobuf/codegen/cosmwasm/wasm/v1/tx' import { useTokenBalances } from '../../../hooks' import { useActionOptions } from '../../../react' diff --git a/packages/stateful/actions/core/smart_contracting/UploadCode/index.tsx b/packages/stateful/actions/core/smart_contracting/UploadCode/index.tsx index 574369902..5219ee1b3 100644 --- a/packages/stateful/actions/core/smart_contracting/UploadCode/index.tsx +++ b/packages/stateful/actions/core/smart_contracting/UploadCode/index.tsx @@ -6,6 +6,7 @@ import { ComputerDiskEmoji, DaoSupportedChainPickerInput, } from '@dao-dao/stateless' +import { makeStargateMessage } from '@dao-dao/types' import { ActionComponent, ActionContextType, @@ -15,14 +16,13 @@ import { UseDefaults, UseTransformToCosmos, } from '@dao-dao/types/actions' +import { MsgStoreCode } from '@dao-dao/types/protobuf/codegen/cosmwasm/wasm/v1/tx' import { decodePolytoneExecuteMsg, getChainAddressForActionOptions, isDecodedStargateMsg, - makeStargateMessage, maybeMakePolytoneExecuteMessage, } from '@dao-dao/utils' -import { MsgStoreCode } from '@dao-dao/utils/protobuf/codegen/cosmwasm/wasm/v1/tx' import { useActionOptions } from '../../../react' import { UploadCodeComponent, UploadCodeData } from './Component' diff --git a/packages/stateful/actions/core/treasury/CommunityPoolDeposit/index.tsx b/packages/stateful/actions/core/treasury/CommunityPoolDeposit/index.tsx index b9bb7c906..16256ac05 100644 --- a/packages/stateful/actions/core/treasury/CommunityPoolDeposit/index.tsx +++ b/packages/stateful/actions/core/treasury/CommunityPoolDeposit/index.tsx @@ -4,7 +4,12 @@ import { useFormContext } from 'react-hook-form' import { genericTokenSelector } from '@dao-dao/state/recoil' import { DownArrowEmoji, useCachedLoadingWithError } from '@dao-dao/stateless' -import { ChainId, TokenType, UseDecodedCosmosMsg } from '@dao-dao/types' +import { + ChainId, + TokenType, + UseDecodedCosmosMsg, + makeStargateMessage, +} from '@dao-dao/types' import { ActionComponent, ActionKey, @@ -12,16 +17,15 @@ import { UseDefaults, UseTransformToCosmos, } from '@dao-dao/types/actions' +import { MsgFundCommunityPool } from '@dao-dao/types/protobuf/codegen/cosmos/distribution/v1beta1/tx' import { convertDenomToMicroDenomStringWithDecimals, convertMicroDenomToDenomWithDecimals, decodePolytoneExecuteMsg, isDecodedStargateMsg, - makeStargateMessage, maybeMakePolytoneExecuteMessage, objectMatchesStructure, } from '@dao-dao/utils' -import { MsgFundCommunityPool } from '@dao-dao/utils/protobuf/codegen/cosmos/distribution/v1beta1/tx' import { useTokenBalances } from '../../../hooks' import { diff --git a/packages/stateful/actions/core/treasury/CommunityPoolSpend/index.tsx b/packages/stateful/actions/core/treasury/CommunityPoolSpend/index.tsx index c0463a877..187e864da 100644 --- a/packages/stateful/actions/core/treasury/CommunityPoolSpend/index.tsx +++ b/packages/stateful/actions/core/treasury/CommunityPoolSpend/index.tsx @@ -1,7 +1,7 @@ import { useCallback } from 'react' import { MoneyEmoji } from '@dao-dao/stateless' -import { UseDecodedCosmosMsg } from '@dao-dao/types' +import { UseDecodedCosmosMsg, makeStargateMessage } from '@dao-dao/types' import { ActionComponent, ActionContextType, @@ -10,12 +10,8 @@ import { UseDefaults, UseTransformToCosmos, } from '@dao-dao/types/actions' -import { - isDecodedStargateMsg, - makeStargateMessage, - objectMatchesStructure, -} from '@dao-dao/utils' -import { MsgCommunityPoolSpend } from '@dao-dao/utils/protobuf/codegen/cosmos/distribution/v1beta1/tx' +import { MsgCommunityPoolSpend } from '@dao-dao/types/protobuf/codegen/cosmos/distribution/v1beta1/tx' +import { isDecodedStargateMsg, objectMatchesStructure } from '@dao-dao/utils' import { PayEntityDisplay } from '../../../../components/PayEntityDisplay' import { diff --git a/packages/stateful/actions/core/treasury/ManageStaking/index.tsx b/packages/stateful/actions/core/treasury/ManageStaking/index.tsx index 0be6c9d0e..5a97402cc 100644 --- a/packages/stateful/actions/core/treasury/ManageStaking/index.tsx +++ b/packages/stateful/actions/core/treasury/ManageStaking/index.tsx @@ -23,6 +23,8 @@ import { CosmosMsgForEmpty, LoadingData, TokenType, + decodedStakingStargateMsgToCw, + makeStargateMessage, } from '@dao-dao/types' import { ActionComponent, @@ -33,27 +35,25 @@ import { UseDefaults, UseTransformToCosmos, } from '@dao-dao/types/actions' +import { + MsgSetWithdrawAddress, + MsgWithdrawDelegatorReward, +} from '@dao-dao/types/protobuf/codegen/cosmos/distribution/v1beta1/tx' +import { + MsgBeginRedelegate, + MsgDelegate, + MsgUndelegate, +} from '@dao-dao/types/protobuf/codegen/cosmos/staking/v1beta1/tx' import { StakingActionType, convertDenomToMicroDenomWithDecimals, convertMicroDenomToDenomWithDecimals, decodePolytoneExecuteMsg, - decodedStakingStargateMsgToCw, getChainAddressForActionOptions, getNativeTokenForChainId, isDecodedStargateMsg, - makeStargateMessage, maybeMakePolytoneExecuteMessage, } from '@dao-dao/utils' -import { - MsgSetWithdrawAddress, - MsgWithdrawDelegatorReward, -} from '@dao-dao/utils/protobuf/codegen/cosmos/distribution/v1beta1/tx' -import { - MsgBeginRedelegate, - MsgDelegate, - MsgUndelegate, -} from '@dao-dao/utils/protobuf/codegen/cosmos/staking/v1beta1/tx' import { AddressInput } from '../../../../components/AddressInput' import { SuspenseLoader } from '../../../../components/SuspenseLoader' diff --git a/packages/stateful/actions/core/treasury/Spend/Component.tsx b/packages/stateful/actions/core/treasury/Spend/Component.tsx index 24405d64e..69a3e563b 100644 --- a/packages/stateful/actions/core/treasury/Spend/Component.tsx +++ b/packages/stateful/actions/core/treasury/Spend/Component.tsx @@ -44,6 +44,7 @@ import { ActionContextType, ActionKey, } from '@dao-dao/types/actions' +import { Params as NobleTariffParams } from '@dao-dao/types/protobuf/codegen/tariff/params' import { convertDenomToMicroDenomWithDecimals, convertMicroDenomToDenomWithDecimals, @@ -59,7 +60,6 @@ import { validatePositive, validateRequired, } from '@dao-dao/utils' -import { Params as NobleTariffParams } from '@dao-dao/utils/protobuf/codegen/tariff/params' import { useActionOptions } from '../../../react' diff --git a/packages/stateful/actions/core/treasury/Spend/index.tsx b/packages/stateful/actions/core/treasury/Spend/index.tsx index 799261a09..fb7226486 100644 --- a/packages/stateful/actions/core/treasury/Spend/index.tsx +++ b/packages/stateful/actions/core/treasury/Spend/index.tsx @@ -28,6 +28,7 @@ import { LoadingDataWithError, TokenType, UseDecodedCosmosMsg, + makeStargateMessage, } from '@dao-dao/types' import { ActionComponent, @@ -37,6 +38,9 @@ import { UseDefaults, UseTransformToCosmos, } from '@dao-dao/types/actions' +import { MsgCommunityPoolSpend } from '@dao-dao/types/protobuf/codegen/cosmos/distribution/v1beta1/tx' +import { MsgTransfer } from '@dao-dao/types/protobuf/codegen/ibc/applications/transfer/v1/tx' +import { MsgTransfer as NeutronMsgTransfer } from '@dao-dao/types/protobuf/codegen/neutron/transfer/v1/tx' import { MAINNET, convertDenomToMicroDenomStringWithDecimals, @@ -55,7 +59,6 @@ import { isDecodedStargateMsg, isValidBech32Address, makeBankMessage, - makeStargateMessage, makeWasmMessage, maybeGetNativeTokenForChainId, maybeMakeIcaExecuteMessage, @@ -64,9 +67,6 @@ import { parseValidPfmMemo, transformBech32Address, } from '@dao-dao/utils' -import { MsgCommunityPoolSpend } from '@dao-dao/utils/protobuf/codegen/cosmos/distribution/v1beta1/tx' -import { MsgTransfer } from '@dao-dao/utils/protobuf/codegen/ibc/applications/transfer/v1/tx' -import { MsgTransfer as NeutronMsgTransfer } from '@dao-dao/utils/protobuf/codegen/neutron/transfer/v1/tx' import { AddressInput } from '../../../../components' import { useWallet } from '../../../../hooks/useWallet' diff --git a/packages/stateful/components/SelfRelayExecuteModal.tsx b/packages/stateful/components/SelfRelayExecuteModal.tsx index 0b8b2ca01..11485b648 100644 --- a/packages/stateful/components/SelfRelayExecuteModal.tsx +++ b/packages/stateful/components/SelfRelayExecuteModal.tsx @@ -49,11 +49,14 @@ import { PolytoneConnection, SelfRelayExecuteModalProps, TokenType, + cwMsgToEncodeObject, } from '@dao-dao/types' +import { MsgGrant } from '@dao-dao/types/protobuf/codegen/cosmos/authz/v1beta1/tx' +import { SendAuthorization } from '@dao-dao/types/protobuf/codegen/cosmos/bank/v1beta1/authz' +import { toTimestamp } from '@dao-dao/types/protobuf/codegen/helpers' import { CHAIN_GAS_MULTIPLIER, convertMicroDenomToDenomWithDecimals, - cwMsgToEncodeObject, getChainForChainId, getDisplayNameForChainId, getFallbackImage, @@ -63,9 +66,6 @@ import { makeBankMessage, processError, } from '@dao-dao/utils' -import { MsgGrant } from '@dao-dao/utils/protobuf/codegen/cosmos/authz/v1beta1/tx' -import { SendAuthorization } from '@dao-dao/utils/protobuf/codegen/cosmos/bank/v1beta1/authz' -import { toTimestamp } from '@dao-dao/utils/protobuf/codegen/helpers' import { useWallet } from '../hooks' diff --git a/packages/stateful/components/dao/tabs/AppsTab.tsx b/packages/stateful/components/dao/tabs/AppsTab.tsx index d4c5c4417..2e2a7f858 100644 --- a/packages/stateful/components/dao/tabs/AppsTab.tsx +++ b/packages/stateful/components/dao/tabs/AppsTab.tsx @@ -30,22 +30,22 @@ import { BaseNewProposalProps, CosmosMsgFor_Empty, ProposalDraft, + aminoTypes, + decodedStargateMsgToCw, + protobufToCwMsg, } from '@dao-dao/types' +import { TxBody } from '@dao-dao/types/protobuf/codegen/cosmos/tx/v1beta1/tx' import { DaoProposalSingleAdapterId, SITE_URL, - aminoTypes, decodeMessages, - decodedStargateMsgToCw, getAccountAddress, getAccountChainId, getDisplayNameForChainId, getFallbackImage, maybeMakePolytoneExecuteMessage, - protobufToCwMsg, toAccessibleImageUrl, } from '@dao-dao/utils' -import { TxBody } from '@dao-dao/utils/protobuf/codegen/cosmos/tx/v1beta1/tx' import { useActionsForMatching } from '../../../actions' import { useProfile } from '../../../hooks' diff --git a/packages/stateful/components/gov/GovProposal.tsx b/packages/stateful/components/gov/GovProposal.tsx index 8c0c16b60..071714817 100644 --- a/packages/stateful/components/gov/GovProposal.tsx +++ b/packages/stateful/components/gov/GovProposal.tsx @@ -11,7 +11,7 @@ import { useChain, } from '@dao-dao/stateless' import { DaoTabId, GovProposalWithDecodedContent } from '@dao-dao/types' -import { ProposalStatus } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1/gov' +import { ProposalStatus } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1/gov' import { GovActionsProvider } from '../../actions' import { useLoadingGovProposal } from '../../hooks' diff --git a/packages/stateful/components/gov/GovProposalActionDisplay.tsx b/packages/stateful/components/gov/GovProposalActionDisplay.tsx index 4ce349e1d..6c20300c4 100644 --- a/packages/stateful/components/gov/GovProposalActionDisplay.tsx +++ b/packages/stateful/components/gov/GovProposalActionDisplay.tsx @@ -12,13 +12,13 @@ import { GovProposalActionDisplayProps, GovProposalVersion, } from '@dao-dao/types' +import { CommunityPoolSpendProposal } from '@dao-dao/types/protobuf/codegen/cosmos/distribution/v1beta1/distribution' +import { TextProposal } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' import { decodeMessages, decodeRawDataForDisplay, objectMatchesStructure, } from '@dao-dao/utils' -import { CommunityPoolSpendProposal } from '@dao-dao/utils/protobuf/codegen/cosmos/distribution/v1beta1/distribution' -import { TextProposal } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/gov' import { useActionsForMatching } from '../../actions' import { PayEntityDisplay } from '../PayEntityDisplay' diff --git a/packages/stateful/components/gov/GovProposalLine.tsx b/packages/stateful/components/gov/GovProposalLine.tsx index fd8c419ee..8da4f1b18 100644 --- a/packages/stateful/components/gov/GovProposalLine.tsx +++ b/packages/stateful/components/gov/GovProposalLine.tsx @@ -6,8 +6,8 @@ import { useLoadingGovProposalTimestampInfo, } from '@dao-dao/stateless' import { GovProposalWithDecodedContent } from '@dao-dao/types' +import { ProposalStatus } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' import { getGovProposalPath } from '@dao-dao/utils' -import { ProposalStatus } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/gov' import { useLoadingGovProposalWalletVoteInfo } from '../../hooks' import { LinkWrapper } from '../LinkWrapper' diff --git a/packages/stateful/components/gov/GovProposalList.tsx b/packages/stateful/components/gov/GovProposalList.tsx index 8b6342111..17395f9e3 100644 --- a/packages/stateful/components/gov/GovProposalList.tsx +++ b/packages/stateful/components/gov/GovProposalList.tsx @@ -8,7 +8,7 @@ import { useCachedLoading, useChain, } from '@dao-dao/stateless' -import { ProposalStatus } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/gov' +import { ProposalStatus } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' import { LinkWrapper } from '../LinkWrapper' import { GovProposalLine, GovProposalLineProps } from './GovProposalLine' diff --git a/packages/stateful/components/gov/GovProposalStatusAndInfo.tsx b/packages/stateful/components/gov/GovProposalStatusAndInfo.tsx index 50ded8843..4ba4fc71b 100644 --- a/packages/stateful/components/gov/GovProposalStatusAndInfo.tsx +++ b/packages/stateful/components/gov/GovProposalStatusAndInfo.tsx @@ -34,6 +34,11 @@ import { GovProposalWithMetadata, TokenType, } from '@dao-dao/types' +import { + ProposalStatus, + Vote, +} from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' +import { MsgDeposit } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/tx' import { CHAIN_GAS_MULTIPLIER, convertDenomToMicroDenomStringWithDecimals, @@ -42,11 +47,6 @@ import { getGovPath, processError, } from '@dao-dao/utils' -import { - ProposalStatus, - Vote, -} from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/gov' -import { MsgDeposit } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/tx' import { useLoadingGovProposal, useWallet } from '../../hooks' import { ButtonLink } from '../ButtonLink' diff --git a/packages/stateful/components/gov/GovProposalVoteTally.tsx b/packages/stateful/components/gov/GovProposalVoteTally.tsx index 792cbb7ab..187184d09 100644 --- a/packages/stateful/components/gov/GovProposalVoteTally.tsx +++ b/packages/stateful/components/gov/GovProposalVoteTally.tsx @@ -3,8 +3,8 @@ import { useTranslation } from 'react-i18next' import { ProgressBar, Tooltip, TooltipInfoIcon } from '@dao-dao/stateless' import { GovProposalWithMetadata, ProcessedTQType } from '@dao-dao/types' +import { ProposalStatus } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' import { formatPercentOf100 } from '@dao-dao/utils' -import { ProposalStatus } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/gov' import { useLoadingGovProposal } from '../../hooks/useLoadingGovProposal' import { SuspenseLoader } from '../SuspenseLoader' diff --git a/packages/stateful/components/gov/GovProposalVoter.tsx b/packages/stateful/components/gov/GovProposalVoter.tsx index e8a5bf762..90ef6327b 100644 --- a/packages/stateful/components/gov/GovProposalVoter.tsx +++ b/packages/stateful/components/gov/GovProposalVoter.tsx @@ -12,12 +12,12 @@ import { useGovProposalVoteOptions, } from '@dao-dao/stateless' import { GovProposalWithMetadata, ProposalVoterProps } from '@dao-dao/types' -import { CHAIN_GAS_MULTIPLIER, processError } from '@dao-dao/utils' import { ProposalStatus, VoteOption, -} from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/gov' -import { MsgVote } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/tx' +} from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' +import { MsgVote } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/tx' +import { CHAIN_GAS_MULTIPLIER, processError } from '@dao-dao/utils' import { useLoadingGovProposal, useWallet } from '../../hooks' import { SuspenseLoader } from '../SuspenseLoader' diff --git a/packages/stateful/components/gov/GovProposalVotes.tsx b/packages/stateful/components/gov/GovProposalVotes.tsx index c59c2bd2e..637651551 100644 --- a/packages/stateful/components/gov/GovProposalVotes.tsx +++ b/packages/stateful/components/gov/GovProposalVotes.tsx @@ -16,7 +16,7 @@ import { import { VoteOption, voteOptionToJSON, -} from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1/gov' +} from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1/gov' import { EntityDisplay } from '../EntityDisplay' import { SuspenseLoader } from '../SuspenseLoader' diff --git a/packages/stateful/components/gov/NewGovProposal.tsx b/packages/stateful/components/gov/NewGovProposal.tsx index 7e0325bd1..dc7d4b95d 100644 --- a/packages/stateful/components/gov/NewGovProposal.tsx +++ b/packages/stateful/components/gov/NewGovProposal.tsx @@ -57,6 +57,11 @@ import { GovernanceProposalActionData, ProposalDraft, } from '@dao-dao/types' +import { BinaryReader } from '@dao-dao/types/protobuf' +import { MsgSubmitProposal as MsgSubmitProposalV1 } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1/tx' +import { ProposalStatus } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' +import { MsgSubmitProposal as MsgSubmitProposalV1Beta1 } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/tx' +import { Any } from '@dao-dao/types/protobuf/codegen/google/protobuf/any' import { CHAIN_GAS_MULTIPLIER, dateToWdhms, @@ -69,11 +74,6 @@ import { isCosmWasmStargateMsg, processError, } from '@dao-dao/utils' -import { BinaryReader } from '@dao-dao/utils/protobuf' -import { MsgSubmitProposal as MsgSubmitProposalV1 } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1/tx' -import { ProposalStatus } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/gov' -import { MsgSubmitProposal as MsgSubmitProposalV1Beta1 } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/tx' -import { Any } from '@dao-dao/utils/protobuf/codegen/google/protobuf/any' import { WalletActionsProvider } from '../../actions' import { makeGovernanceProposalAction } from '../../actions/core/chain_governance/GovernanceProposal' diff --git a/packages/stateful/components/profile/ProfileActions.tsx b/packages/stateful/components/profile/ProfileActions.tsx index 0b3958af4..b5cafa520 100644 --- a/packages/stateful/components/profile/ProfileActions.tsx +++ b/packages/stateful/components/profile/ProfileActions.tsx @@ -16,12 +16,15 @@ import { useCachedLoading, useHoldingKey, } from '@dao-dao/stateless' -import { AccountTxForm, AccountTxSave } from '@dao-dao/types' +import { + AccountTxForm, + AccountTxSave, + cwMsgToEncodeObject, +} from '@dao-dao/types' import { CHAIN_GAS_MULTIPLIER, KVPK_API_BASE, ME_SAVED_TX_PREFIX, - cwMsgToEncodeObject, getRpcForChainId, getSignerOptions, processError, diff --git a/packages/stateful/components/wallet/WalletStakingModal.tsx b/packages/stateful/components/wallet/WalletStakingModal.tsx index a94f65803..fe86d64b8 100644 --- a/packages/stateful/components/wallet/WalletStakingModal.tsx +++ b/packages/stateful/components/wallet/WalletStakingModal.tsx @@ -17,11 +17,11 @@ import { useCachedLoadable, useChainContext, } from '@dao-dao/stateless' +import { cwMsgToEncodeObject } from '@dao-dao/types' import { CHAIN_GAS_MULTIPLIER, convertDenomToMicroDenomStringWithDecimals, convertMicroDenomToDenomWithDecimals, - cwMsgToEncodeObject, processError, } from '@dao-dao/utils' diff --git a/packages/stateful/components/wallet/WalletTokenCard.tsx b/packages/stateful/components/wallet/WalletTokenCard.tsx index 7fea81f75..ed62c2156 100644 --- a/packages/stateful/components/wallet/WalletTokenCard.tsx +++ b/packages/stateful/components/wallet/WalletTokenCard.tsx @@ -22,12 +22,16 @@ import { useCachedLoadable, useCachedLoading, } from '@dao-dao/stateless' -import { ActionKey, TokenCardInfo, TokenType } from '@dao-dao/types' +import { + ActionKey, + TokenCardInfo, + TokenType, + cwMsgToEncodeObject, +} from '@dao-dao/types' import { CHAIN_GAS_MULTIPLIER, HIDDEN_BALANCE_PREFIX, KVPK_API_BASE, - cwMsgToEncodeObject, getMeTxPrefillPath, getNativeTokenForChainId, getSupportedChainConfig, diff --git a/packages/stateful/components/wallet/Web3AuthPromptModal.tsx b/packages/stateful/components/wallet/Web3AuthPromptModal.tsx index 08468c42d..615964517 100644 --- a/packages/stateful/components/wallet/Web3AuthPromptModal.tsx +++ b/packages/stateful/components/wallet/Web3AuthPromptModal.tsx @@ -10,9 +10,9 @@ import { CosmosMessageDisplay, Modal, } from '@dao-dao/stateless' -import { ActionAndData } from '@dao-dao/types' -import { decodeMessages, protobufToCwMsg } from '@dao-dao/utils' -import { TxBody } from '@dao-dao/utils/protobuf/codegen/cosmos/tx/v1beta1/tx' +import { ActionAndData, protobufToCwMsg } from '@dao-dao/types' +import { TxBody } from '@dao-dao/types/protobuf/codegen/cosmos/tx/v1beta1/tx' +import { decodeMessages } from '@dao-dao/utils' import { useActionsForMatching } from '../../actions' import { WalletActionsProvider } from '../../actions/react/provider' diff --git a/packages/stateful/hooks/useInstantiateAndExecute.ts b/packages/stateful/hooks/useInstantiateAndExecute.ts index 7d088ccc4..f6a7da63c 100644 --- a/packages/stateful/hooks/useInstantiateAndExecute.ts +++ b/packages/stateful/hooks/useInstantiateAndExecute.ts @@ -9,12 +9,8 @@ import { v4 as uuidv4 } from 'uuid' import { codeDetailsSelector } from '@dao-dao/state/recoil' import { useCachedLoadable } from '@dao-dao/stateless' -import { Coin, CosmosMsgFor_Empty } from '@dao-dao/types' -import { - CHAIN_GAS_MULTIPLIER, - cwMsgToEncodeObject, - makeWasmMessage, -} from '@dao-dao/utils' +import { Coin, CosmosMsgFor_Empty, cwMsgToEncodeObject } from '@dao-dao/types' +import { CHAIN_GAS_MULTIPLIER, makeWasmMessage } from '@dao-dao/utils' import { useWallet } from './useWallet' diff --git a/packages/stateful/hooks/useProposalVetoState.tsx b/packages/stateful/hooks/useProposalVetoState.tsx index ac4bc77eb..9c546d60e 100644 --- a/packages/stateful/hooks/useProposalVetoState.tsx +++ b/packages/stateful/hooks/useProposalVetoState.tsx @@ -20,11 +20,11 @@ import { NeutronTimelockOverrule, ProposalStatusEnum, ProposalStatusKey, + cwMsgToEncodeObject, } from '@dao-dao/types' import { VetoConfig } from '@dao-dao/types/contracts/DaoProposalSingle.v2' import { CHAIN_GAS_MULTIPLIER, - cwMsgToEncodeObject, getDaoProposalSinglePrefill, makeCw1WhitelistExecuteMessage, makeWasmMessage, diff --git a/packages/stateful/hooks/useSimulateCosmosMsgs.ts b/packages/stateful/hooks/useSimulateCosmosMsgs.ts index 190fa5b90..80f10452d 100644 --- a/packages/stateful/hooks/useSimulateCosmosMsgs.ts +++ b/packages/stateful/hooks/useSimulateCosmosMsgs.ts @@ -5,24 +5,26 @@ import { cosmosRpcClientForChainSelector, } from '@dao-dao/state/recoil' import { useChain } from '@dao-dao/stateless' -import { CosmosMsgFor_Empty } from '@dao-dao/types' import { + CosmosMsgFor_Empty, cwMsgToEncodeObject, - decodeMessages, - decodePolytoneExecuteMsg, - isValidBech32Address, typesRegistry, -} from '@dao-dao/utils' -import { cosmos } from '@dao-dao/utils/protobuf' -import { SignMode } from '@dao-dao/utils/protobuf/codegen/cosmos/tx/signing/v1beta1/signing' -import { SimulateRequest } from '@dao-dao/utils/protobuf/codegen/cosmos/tx/v1beta1/service' +} from '@dao-dao/types' +import { cosmos } from '@dao-dao/types/protobuf' +import { SignMode } from '@dao-dao/types/protobuf/codegen/cosmos/tx/signing/v1beta1/signing' +import { SimulateRequest } from '@dao-dao/types/protobuf/codegen/cosmos/tx/v1beta1/service' import { AuthInfo, Fee, Tx, TxBody, -} from '@dao-dao/utils/protobuf/codegen/cosmos/tx/v1beta1/tx' -import { Any } from '@dao-dao/utils/protobuf/codegen/google/protobuf/any' +} from '@dao-dao/types/protobuf/codegen/cosmos/tx/v1beta1/tx' +import { Any } from '@dao-dao/types/protobuf/codegen/google/protobuf/any' +import { + decodeMessages, + decodePolytoneExecuteMsg, + isValidBech32Address, +} from '@dao-dao/utils' // Simulate executing Cosmos messages on-chain. We can't just use the simulate // function on SigningCosmWasmClient or SigningStargateClient because they diff --git a/packages/stateful/server/makeGetDaoStaticProps.ts b/packages/stateful/server/makeGetDaoStaticProps.ts index 87529a018..7e4fd67ba 100644 --- a/packages/stateful/server/makeGetDaoStaticProps.ts +++ b/packages/stateful/server/makeGetDaoStaticProps.ts @@ -32,6 +32,7 @@ import { ListItemsResponse, ProposalModuleWithInfo, } from '@dao-dao/types/contracts/DaoCore.v2' +import { cosmos } from '@dao-dao/types/protobuf' import { CHAIN_SUBDAOS, CI, @@ -59,7 +60,6 @@ import { processError, retry, } from '@dao-dao/utils' -import { cosmos } from '@dao-dao/utils/protobuf' import { DaoPageWrapperProps } from '../components' import { diff --git a/packages/stateful/server/makeGetGovStaticProps.ts b/packages/stateful/server/makeGetGovStaticProps.ts index 755f5b8f2..b82ae09c0 100644 --- a/packages/stateful/server/makeGetGovStaticProps.ts +++ b/packages/stateful/server/makeGetGovStaticProps.ts @@ -16,6 +16,7 @@ import { ProposalV1Beta1, SupportedFeatureMap, } from '@dao-dao/types' +import { cosmos } from '@dao-dao/types/protobuf' import { CI, DAO_STATIC_PROPS_CACHE_SECONDS, @@ -30,7 +31,6 @@ import { processError, retry, } from '@dao-dao/utils' -import { cosmos } from '@dao-dao/utils/protobuf' import { GovPageWrapperProps } from '../components' diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/actions/Mint/index.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/actions/Mint/index.tsx index 85b1a60ac..1d1ce5bfe 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/actions/Mint/index.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/actions/Mint/index.tsx @@ -2,6 +2,7 @@ import { Coin, coin } from '@cosmjs/stargate' import { useCallback, useMemo } from 'react' import { HerbEmoji } from '@dao-dao/stateless' +import { makeStargateMessage } from '@dao-dao/types' import { ActionComponent, ActionKey, @@ -10,13 +11,12 @@ import { UseDefaults, UseTransformToCosmos, } from '@dao-dao/types/actions' +import { MsgMint } from '@dao-dao/types/protobuf/codegen/osmosis/tokenfactory/v1beta1/tx' import { convertDenomToMicroDenomStringWithDecimals, convertMicroDenomToDenomWithDecimals, isDecodedStargateMsg, - makeStargateMessage, } from '@dao-dao/utils' -import { MsgMint } from '@dao-dao/utils/protobuf/codegen/osmosis/tokenfactory/v1beta1/tx' import { useActionOptions } from '../../../../../actions' import { useGovernanceTokenInfo } from '../../hooks' diff --git a/packages/stateless/components/proposal/GovProposalStatus.tsx b/packages/stateless/components/proposal/GovProposalStatus.tsx index a0904e46f..715ee7dc1 100644 --- a/packages/stateless/components/proposal/GovProposalStatus.tsx +++ b/packages/stateless/components/proposal/GovProposalStatus.tsx @@ -9,7 +9,7 @@ import { ReactElement } from 'react' import { useTranslation } from 'react-i18next' import { StatusDisplay, StatusDisplayProps } from '@dao-dao/stateless' -import { ProposalStatus } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/gov' +import { ProposalStatus } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' export type GovProposalStatusProps = { status: ProposalStatus diff --git a/packages/stateless/components/proposal/GovProposalVoteDisplay.tsx b/packages/stateless/components/proposal/GovProposalVoteDisplay.tsx index 236bdfddf..e58afabfd 100644 --- a/packages/stateless/components/proposal/GovProposalVoteDisplay.tsx +++ b/packages/stateless/components/proposal/GovProposalVoteDisplay.tsx @@ -2,7 +2,7 @@ import clsx from 'clsx' import { useTranslation } from 'react-i18next' import { useGovProposalVoteOptions } from '@dao-dao/stateless' -import { VoteOption } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1/gov' +import { VoteOption } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1/gov' export type GovProposalVoteDisplayProps = { vote: VoteOption diff --git a/packages/stateless/components/proposal/GovProposalWalletVote.tsx b/packages/stateless/components/proposal/GovProposalWalletVote.tsx index 155955711..4c3bb63ac 100644 --- a/packages/stateless/components/proposal/GovProposalWalletVote.tsx +++ b/packages/stateless/components/proposal/GovProposalWalletVote.tsx @@ -1,6 +1,6 @@ import { useTranslation } from 'react-i18next' -import { VoteOption } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/gov' +import { VoteOption } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' import { ProposalWalletVote } from './ProposalWalletVote' diff --git a/packages/stateless/components/proposal/GovernanceProposal.tsx b/packages/stateless/components/proposal/GovernanceProposal.tsx index 2716b801b..965d080c2 100644 --- a/packages/stateless/components/proposal/GovernanceProposal.tsx +++ b/packages/stateless/components/proposal/GovernanceProposal.tsx @@ -17,8 +17,8 @@ import { GovProposalWithDecodedContent, StatefulTokenAmountDisplayProps, } from '@dao-dao/types' +import { ProposalStatus } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' import { formatDateTimeTz, govProposalToDecodedContent } from '@dao-dao/utils' -import { ProposalStatus } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/gov' import { useChainContext, useTranslatedTimeDeltaFormatter } from '../../hooks' import { IconButtonLink } from '../icon_buttons' diff --git a/packages/stateless/hooks/useGovProposalVoteOptions.ts b/packages/stateless/hooks/useGovProposalVoteOptions.ts index d14d43db6..7f087dcb3 100644 --- a/packages/stateless/hooks/useGovProposalVoteOptions.ts +++ b/packages/stateless/hooks/useGovProposalVoteOptions.ts @@ -2,7 +2,7 @@ import { Block, Check, Close, Texture } from '@mui/icons-material' import { useTranslation } from 'react-i18next' import { ProposalVoteOption } from '@dao-dao/types' -import { VoteOption } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1/gov' +import { VoteOption } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1/gov' export const useGovProposalVoteOptions = (): ProposalVoteOption[] => { diff --git a/packages/stateless/hooks/useLoadingGovProposalTimestampInfo.tsx b/packages/stateless/hooks/useLoadingGovProposalTimestampInfo.tsx index 2e7cf4402..ed46ac417 100644 --- a/packages/stateless/hooks/useLoadingGovProposalTimestampInfo.tsx +++ b/packages/stateless/hooks/useLoadingGovProposalTimestampInfo.tsx @@ -2,8 +2,8 @@ import { useTranslation } from 'react-i18next' import TimeAgo from 'react-timeago' import { GovProposal, LoadingData, ProposalTimestampInfo } from '@dao-dao/types' +import { ProposalStatus } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' import { formatDate, formatDateTimeTz } from '@dao-dao/utils' -import { ProposalStatus } from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/gov' import { useTranslatedTimeDeltaFormatter } from './useTranslatedTimeDeltaFormatter' diff --git a/packages/utils/.eslintignore b/packages/types/.eslintignore similarity index 100% rename from packages/utils/.eslintignore rename to packages/types/.eslintignore diff --git a/packages/types/README.md b/packages/types/README.md index d6bc07ad0..d124a1e26 100644 --- a/packages/types/README.md +++ b/packages/types/README.md @@ -6,8 +6,9 @@ A collection of types used across packages. | Location | Summary | | ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| [components](./components) | Types related to both stateless and stateful components and the respective packages. | | [contracts](./contracts) | Smart contract types generated by [`@cosmwasm/ts-codegen`](https://github.com/CosmWasm/ts-codegen). | -| [stateless](./stateless) | Types related to the [`@dao-dao/stateless`](../stateless) package. Mostly React component prop types. | +| [protobuf](./protobuf) | Protobuf types generated by [`@cosmology/telescope`](https://github.com/cosmology-tech/telescope). | | [actions.ts](./actions.ts) | Types related to the [`@dao-dao/stateful/actions`](../stateful/actions) system. | | [chain.ts](./chain.ts) | Types related to the chain. | | [command.ts](./command.ts) | Types related to the [`@dao-dao/stateful/command`](../stateful/command) system. | @@ -19,6 +20,44 @@ A collection of types used across packages. | [proposal.ts](./proposal.ts) | Types related to proposals. | | [state.ts](./state.ts) | Types related to the [`@dao-dao/state`](../state) package. | | [units.ts](./units.ts) | Types related to units. | -| [utils.ts](./utils.ts) | Types related to the [`@dao-dao/utils`](../utils) package. | | [voting-module-adapter.ts](./voting-module-adapter.ts) | Types related to the [`@dao-dao/stateful/voting-module-adapter`](../stateful/voting-module-adapter) system. | | [wallet.ts](./wallet.ts) | Types related to wallets. | + +## Protobufs + +This package contains Cosmos SDK protobuf definitions generated by Cosmology's +[Telescope](https://github.com/cosmology-tech/telescope). + +To generate protobufs: + +```bash +yarn protobuf +``` + +Sometimes definitions need to be manually fixed due to bugs and other +discrepancies. There is a patch file that records these modifications in +`protobuf/patches.diff`. + +To update the patch file when new changes are made: + +1. Commit the changes so that the current branch is up-to-date with the desired + changes. + +2. Run: + + ```bash + yarn protobuf:patch:update + ``` + + This will regenerate the protobufs, undoing all patches. Then, it records + the reverse diff between the committed changes and the regenerated protobufs + (since we want to undo the current changes). Lastly, it reapplies the latest + patches, and all changes should be made. If this works, only the + `patches.diff` file should have changes. + +3. Update the previous commit with the new patches. + + ```bash + git add protobuf/patches.diff + git commit --amend + ``` diff --git a/packages/types/components/ValidatorPicker.ts b/packages/types/components/ValidatorPicker.ts index 66da0083e..f3343ddc9 100644 --- a/packages/types/components/ValidatorPicker.ts +++ b/packages/types/components/ValidatorPicker.ts @@ -1,6 +1,7 @@ -import { GenericToken, TokenStake, Validator } from '@dao-dao/types' +import { Validator } from '../chain' +import { GenericToken, TokenStake } from '../token' -export interface ValidatorPickerProps { +export type ValidatorPickerProps = { validators: Validator[] stakes?: TokenStake[] selectedAddress?: string diff --git a/packages/types/gov.ts b/packages/types/gov.ts index e38d2d557..322cd6482 100644 --- a/packages/types/gov.ts +++ b/packages/types/gov.ts @@ -1,25 +1,22 @@ -import { ReactNode } from 'react' - -import { CommunityPoolSpendProposal } from '@dao-dao/utils/protobuf/codegen/cosmos/distribution/v1beta1/distribution' +import { NestedActionsEditorFormData } from './actions' +import { Coin, CosmosMsgFor_Empty } from './contracts' +import { LoadingData } from './misc' +import { ProcessedTQ, ProposalTimestampInfo } from './proposal' +import { CommunityPoolSpendProposal } from './protobuf/codegen/cosmos/distribution/v1beta1/distribution' import { Params as GovParamsV1, Proposal as ProposalV1, WeightedVoteOption, -} from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1/gov' +} from './protobuf/codegen/cosmos/gov/v1/gov' import { Proposal as ProposalV1Beta1, TextProposal, -} from '@dao-dao/utils/protobuf/codegen/cosmos/gov/v1beta1/gov' -import { ParameterChangeProposal } from '@dao-dao/utils/protobuf/codegen/cosmos/params/v1beta1/params' +} from './protobuf/codegen/cosmos/gov/v1beta1/gov' +import { ParameterChangeProposal } from './protobuf/codegen/cosmos/params/v1beta1/params' import { CancelSoftwareUpgradeProposal, SoftwareUpgradeProposal, -} from '@dao-dao/utils/protobuf/codegen/cosmos/upgrade/v1beta1/upgrade' - -import { NestedActionsEditorFormData } from './actions' -import { Coin, CosmosMsgFor_Empty } from './contracts' -import { LoadingData } from './misc' -import { ProcessedTQ } from './proposal' +} from './protobuf/codegen/cosmos/upgrade/v1beta1/upgrade' export { ProposalV1Beta1, ProposalV1 } @@ -85,15 +82,6 @@ export type GovProposalWithMetadata = GovProposal & { minDeposit: Coin[] } -export type ProposalTimestampInfo = { - display?: { - label: string - tooltip?: string - content: ReactNode - } - expirationDate: Date -} - export type GovProposalVotesInfo = { threshold: ProcessedTQ quorum: ProcessedTQ diff --git a/packages/types/index.ts b/packages/types/index.ts index 97dc7c43b..6b5dacd99 100644 --- a/packages/types/index.ts +++ b/packages/types/index.ts @@ -17,6 +17,7 @@ export * from './nft' export * from './profile' export * from './proposal-module-adapter' export * from './proposal' +export * from './protobuf/utils' export * from './skip' export * from './sortFilter' export * from './token' diff --git a/packages/types/nft.ts b/packages/types/nft.ts index 80fb36da5..75845ce64 100644 --- a/packages/types/nft.ts +++ b/packages/types/nft.ts @@ -1,6 +1,5 @@ import { ComponentType, ReactNode, RefAttributes } from 'react' -import { GenericToken } from '.' import { ChainId, WithChainId } from './chain' import { ButtonLinkProps, @@ -10,6 +9,7 @@ import { } from './components' import { ContractInfoResponse } from './contracts/Cw721Base' import { LoadingDataWithError } from './misc' +import { GenericToken } from './token' // Shape of type returned from Stargaze GraphQL indexer queries in // @dao-dao/state diff --git a/packages/types/package.json b/packages/types/package.json index bec1baabf..7f3e88bcc 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -3,8 +3,12 @@ "version": "2.4.0-rc.7", "license": "BSD-3-Clause-Clear", "scripts": { + "lint": "eslint .", "format": "eslint . --fix", - "lint": "eslint ." + "protobuf:codegen": "node src/protobuf/scripts/codegen.js", + "protobuf:patch": "git apply src/protobuf/patches.diff", + "protobuf:patch:update": "cd src/protobuf && npm run protobuf:codegen && git diff -R codegen/ > patches.diff && npm run protobuf:patch", + "protobuf": "npm run protobuf:codegen && npm run protobuf:patch" }, "dependencies": { "@chain-registry/types": "^0.17.1", @@ -18,7 +22,8 @@ "typescript": "5.3.3" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.7" + "@dao-dao/config": "2.4.0-rc.7", + "@cosmology/telescope": "^1.4.12" }, "peerDependencies": { "next": "^12 || ^13", diff --git a/packages/types/proposal-module-adapter.ts b/packages/types/proposal-module-adapter.ts index 38eae7abc..9a24c5578 100644 --- a/packages/types/proposal-module-adapter.ts +++ b/packages/types/proposal-module-adapter.ts @@ -26,9 +26,8 @@ import { ProposalModule, } from './dao' import { ContractVersion } from './features' -import { ProposalTimestampInfo } from './gov' import { LoadingData } from './misc' -import { ProposalCreatedCardProps } from './proposal' +import { ProposalCreatedCardProps, ProposalTimestampInfo } from './proposal' export type IProposalModuleAdapterCommon = { // Fields diff --git a/packages/types/proposal.ts b/packages/types/proposal.ts index f120973cf..0130f9d79 100644 --- a/packages/types/proposal.ts +++ b/packages/types/proposal.ts @@ -1,3 +1,5 @@ +import { ReactNode } from 'react' + import { PolytoneConnection } from './chain' import { ProposalCardProps } from './components/ProposalCard' import { CosmosMsgFor_Empty, ProposalStatus } from './contracts' @@ -156,3 +158,12 @@ export type NeutronTimelockOverrule = { proposalModulePrefix: string proposal: ProposalResponse } + +export type ProposalTimestampInfo = { + display?: { + label: string + tooltip?: string + content: ReactNode + } + expirationDate: Date +} diff --git a/packages/utils/protobuf/codegen/alliance/alliance/alliance.ts b/packages/types/protobuf/codegen/alliance/alliance/alliance.ts similarity index 100% rename from packages/utils/protobuf/codegen/alliance/alliance/alliance.ts rename to packages/types/protobuf/codegen/alliance/alliance/alliance.ts diff --git a/packages/utils/protobuf/codegen/alliance/alliance/delegations.ts b/packages/types/protobuf/codegen/alliance/alliance/delegations.ts similarity index 100% rename from packages/utils/protobuf/codegen/alliance/alliance/delegations.ts rename to packages/types/protobuf/codegen/alliance/alliance/delegations.ts diff --git a/packages/utils/protobuf/codegen/alliance/alliance/events.ts b/packages/types/protobuf/codegen/alliance/alliance/events.ts similarity index 100% rename from packages/utils/protobuf/codegen/alliance/alliance/events.ts rename to packages/types/protobuf/codegen/alliance/alliance/events.ts diff --git a/packages/utils/protobuf/codegen/alliance/alliance/genesis.ts b/packages/types/protobuf/codegen/alliance/alliance/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/alliance/alliance/genesis.ts rename to packages/types/protobuf/codegen/alliance/alliance/genesis.ts diff --git a/packages/utils/protobuf/codegen/alliance/alliance/gov.ts b/packages/types/protobuf/codegen/alliance/alliance/gov.ts similarity index 100% rename from packages/utils/protobuf/codegen/alliance/alliance/gov.ts rename to packages/types/protobuf/codegen/alliance/alliance/gov.ts diff --git a/packages/utils/protobuf/codegen/alliance/alliance/params.ts b/packages/types/protobuf/codegen/alliance/alliance/params.ts similarity index 100% rename from packages/utils/protobuf/codegen/alliance/alliance/params.ts rename to packages/types/protobuf/codegen/alliance/alliance/params.ts diff --git a/packages/utils/protobuf/codegen/alliance/alliance/query.rpc.Query.ts b/packages/types/protobuf/codegen/alliance/alliance/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/alliance/alliance/query.rpc.Query.ts rename to packages/types/protobuf/codegen/alliance/alliance/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/alliance/alliance/query.ts b/packages/types/protobuf/codegen/alliance/alliance/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/alliance/alliance/query.ts rename to packages/types/protobuf/codegen/alliance/alliance/query.ts diff --git a/packages/utils/protobuf/codegen/alliance/alliance/redelegations.ts b/packages/types/protobuf/codegen/alliance/alliance/redelegations.ts similarity index 100% rename from packages/utils/protobuf/codegen/alliance/alliance/redelegations.ts rename to packages/types/protobuf/codegen/alliance/alliance/redelegations.ts diff --git a/packages/utils/protobuf/codegen/alliance/alliance/tx.amino.ts b/packages/types/protobuf/codegen/alliance/alliance/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/alliance/alliance/tx.amino.ts rename to packages/types/protobuf/codegen/alliance/alliance/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/alliance/alliance/tx.registry.ts b/packages/types/protobuf/codegen/alliance/alliance/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/alliance/alliance/tx.registry.ts rename to packages/types/protobuf/codegen/alliance/alliance/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/alliance/alliance/tx.rpc.msg.ts b/packages/types/protobuf/codegen/alliance/alliance/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/alliance/alliance/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/alliance/alliance/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/alliance/alliance/tx.ts b/packages/types/protobuf/codegen/alliance/alliance/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/alliance/alliance/tx.ts rename to packages/types/protobuf/codegen/alliance/alliance/tx.ts diff --git a/packages/utils/protobuf/codegen/alliance/alliance/unbonding.ts b/packages/types/protobuf/codegen/alliance/alliance/unbonding.ts similarity index 100% rename from packages/utils/protobuf/codegen/alliance/alliance/unbonding.ts rename to packages/types/protobuf/codegen/alliance/alliance/unbonding.ts diff --git a/packages/utils/protobuf/codegen/alliance/bundle.ts b/packages/types/protobuf/codegen/alliance/bundle.ts similarity index 100% rename from packages/utils/protobuf/codegen/alliance/bundle.ts rename to packages/types/protobuf/codegen/alliance/bundle.ts diff --git a/packages/utils/protobuf/codegen/alliance/client.ts b/packages/types/protobuf/codegen/alliance/client.ts similarity index 100% rename from packages/utils/protobuf/codegen/alliance/client.ts rename to packages/types/protobuf/codegen/alliance/client.ts diff --git a/packages/utils/protobuf/codegen/alliance/rpc.query.ts b/packages/types/protobuf/codegen/alliance/rpc.query.ts similarity index 100% rename from packages/utils/protobuf/codegen/alliance/rpc.query.ts rename to packages/types/protobuf/codegen/alliance/rpc.query.ts diff --git a/packages/utils/protobuf/codegen/alliance/rpc.tx.ts b/packages/types/protobuf/codegen/alliance/rpc.tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/alliance/rpc.tx.ts rename to packages/types/protobuf/codegen/alliance/rpc.tx.ts diff --git a/packages/utils/protobuf/codegen/amino/amino.ts b/packages/types/protobuf/codegen/amino/amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/amino/amino.ts rename to packages/types/protobuf/codegen/amino/amino.ts diff --git a/packages/utils/protobuf/codegen/amino/bundle.ts b/packages/types/protobuf/codegen/amino/bundle.ts similarity index 100% rename from packages/utils/protobuf/codegen/amino/bundle.ts rename to packages/types/protobuf/codegen/amino/bundle.ts diff --git a/packages/utils/protobuf/codegen/binary.ts b/packages/types/protobuf/codegen/binary.ts similarity index 100% rename from packages/utils/protobuf/codegen/binary.ts rename to packages/types/protobuf/codegen/binary.ts diff --git a/packages/utils/protobuf/codegen/circle/bundle.ts b/packages/types/protobuf/codegen/circle/bundle.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/bundle.ts rename to packages/types/protobuf/codegen/circle/bundle.ts diff --git a/packages/utils/protobuf/codegen/circle/cctp/v1/attester.ts b/packages/types/protobuf/codegen/circle/cctp/v1/attester.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/cctp/v1/attester.ts rename to packages/types/protobuf/codegen/circle/cctp/v1/attester.ts diff --git a/packages/utils/protobuf/codegen/circle/cctp/v1/burn_message.ts b/packages/types/protobuf/codegen/circle/cctp/v1/burn_message.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/cctp/v1/burn_message.ts rename to packages/types/protobuf/codegen/circle/cctp/v1/burn_message.ts diff --git a/packages/utils/protobuf/codegen/circle/cctp/v1/burning_and_minting_paused.ts b/packages/types/protobuf/codegen/circle/cctp/v1/burning_and_minting_paused.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/cctp/v1/burning_and_minting_paused.ts rename to packages/types/protobuf/codegen/circle/cctp/v1/burning_and_minting_paused.ts diff --git a/packages/utils/protobuf/codegen/circle/cctp/v1/events.ts b/packages/types/protobuf/codegen/circle/cctp/v1/events.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/cctp/v1/events.ts rename to packages/types/protobuf/codegen/circle/cctp/v1/events.ts diff --git a/packages/utils/protobuf/codegen/circle/cctp/v1/genesis.ts b/packages/types/protobuf/codegen/circle/cctp/v1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/cctp/v1/genesis.ts rename to packages/types/protobuf/codegen/circle/cctp/v1/genesis.ts diff --git a/packages/utils/protobuf/codegen/circle/cctp/v1/max_message_body_size.ts b/packages/types/protobuf/codegen/circle/cctp/v1/max_message_body_size.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/cctp/v1/max_message_body_size.ts rename to packages/types/protobuf/codegen/circle/cctp/v1/max_message_body_size.ts diff --git a/packages/utils/protobuf/codegen/circle/cctp/v1/message.ts b/packages/types/protobuf/codegen/circle/cctp/v1/message.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/cctp/v1/message.ts rename to packages/types/protobuf/codegen/circle/cctp/v1/message.ts diff --git a/packages/utils/protobuf/codegen/circle/cctp/v1/nonce.ts b/packages/types/protobuf/codegen/circle/cctp/v1/nonce.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/cctp/v1/nonce.ts rename to packages/types/protobuf/codegen/circle/cctp/v1/nonce.ts diff --git a/packages/utils/protobuf/codegen/circle/cctp/v1/params.ts b/packages/types/protobuf/codegen/circle/cctp/v1/params.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/cctp/v1/params.ts rename to packages/types/protobuf/codegen/circle/cctp/v1/params.ts diff --git a/packages/utils/protobuf/codegen/circle/cctp/v1/per_message_burn_limit.ts b/packages/types/protobuf/codegen/circle/cctp/v1/per_message_burn_limit.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/cctp/v1/per_message_burn_limit.ts rename to packages/types/protobuf/codegen/circle/cctp/v1/per_message_burn_limit.ts diff --git a/packages/utils/protobuf/codegen/circle/cctp/v1/query.rpc.Query.ts b/packages/types/protobuf/codegen/circle/cctp/v1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/cctp/v1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/circle/cctp/v1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/circle/cctp/v1/query.ts b/packages/types/protobuf/codegen/circle/cctp/v1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/cctp/v1/query.ts rename to packages/types/protobuf/codegen/circle/cctp/v1/query.ts diff --git a/packages/utils/protobuf/codegen/circle/cctp/v1/remote_token_messenger.ts b/packages/types/protobuf/codegen/circle/cctp/v1/remote_token_messenger.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/cctp/v1/remote_token_messenger.ts rename to packages/types/protobuf/codegen/circle/cctp/v1/remote_token_messenger.ts diff --git a/packages/utils/protobuf/codegen/circle/cctp/v1/sending_and_receiving_messages_paused.ts b/packages/types/protobuf/codegen/circle/cctp/v1/sending_and_receiving_messages_paused.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/cctp/v1/sending_and_receiving_messages_paused.ts rename to packages/types/protobuf/codegen/circle/cctp/v1/sending_and_receiving_messages_paused.ts diff --git a/packages/utils/protobuf/codegen/circle/cctp/v1/signature_threshold.ts b/packages/types/protobuf/codegen/circle/cctp/v1/signature_threshold.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/cctp/v1/signature_threshold.ts rename to packages/types/protobuf/codegen/circle/cctp/v1/signature_threshold.ts diff --git a/packages/utils/protobuf/codegen/circle/cctp/v1/token_pair.ts b/packages/types/protobuf/codegen/circle/cctp/v1/token_pair.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/cctp/v1/token_pair.ts rename to packages/types/protobuf/codegen/circle/cctp/v1/token_pair.ts diff --git a/packages/utils/protobuf/codegen/circle/cctp/v1/tx.amino.ts b/packages/types/protobuf/codegen/circle/cctp/v1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/cctp/v1/tx.amino.ts rename to packages/types/protobuf/codegen/circle/cctp/v1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/circle/cctp/v1/tx.registry.ts b/packages/types/protobuf/codegen/circle/cctp/v1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/cctp/v1/tx.registry.ts rename to packages/types/protobuf/codegen/circle/cctp/v1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/circle/cctp/v1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/circle/cctp/v1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/cctp/v1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/circle/cctp/v1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/circle/cctp/v1/tx.ts b/packages/types/protobuf/codegen/circle/cctp/v1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/cctp/v1/tx.ts rename to packages/types/protobuf/codegen/circle/cctp/v1/tx.ts diff --git a/packages/utils/protobuf/codegen/circle/client.ts b/packages/types/protobuf/codegen/circle/client.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/client.ts rename to packages/types/protobuf/codegen/circle/client.ts diff --git a/packages/utils/protobuf/codegen/circle/rpc.query.ts b/packages/types/protobuf/codegen/circle/rpc.query.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/rpc.query.ts rename to packages/types/protobuf/codegen/circle/rpc.query.ts diff --git a/packages/utils/protobuf/codegen/circle/rpc.tx.ts b/packages/types/protobuf/codegen/circle/rpc.tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/circle/rpc.tx.ts rename to packages/types/protobuf/codegen/circle/rpc.tx.ts diff --git a/packages/utils/protobuf/codegen/cosmos/auth/v1beta1/auth.ts b/packages/types/protobuf/codegen/cosmos/auth/v1beta1/auth.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/auth/v1beta1/auth.ts rename to packages/types/protobuf/codegen/cosmos/auth/v1beta1/auth.ts diff --git a/packages/utils/protobuf/codegen/cosmos/auth/v1beta1/genesis.ts b/packages/types/protobuf/codegen/cosmos/auth/v1beta1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/auth/v1beta1/genesis.ts rename to packages/types/protobuf/codegen/cosmos/auth/v1beta1/genesis.ts diff --git a/packages/utils/protobuf/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/auth/v1beta1/query.ts b/packages/types/protobuf/codegen/cosmos/auth/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/auth/v1beta1/query.ts rename to packages/types/protobuf/codegen/cosmos/auth/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/auth/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/cosmos/auth/v1beta1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/auth/v1beta1/tx.amino.ts rename to packages/types/protobuf/codegen/cosmos/auth/v1beta1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/cosmos/auth/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/cosmos/auth/v1beta1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/auth/v1beta1/tx.registry.ts rename to packages/types/protobuf/codegen/cosmos/auth/v1beta1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/cosmos/auth/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/cosmos/auth/v1beta1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/auth/v1beta1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/cosmos/auth/v1beta1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/cosmos/auth/v1beta1/tx.ts b/packages/types/protobuf/codegen/cosmos/auth/v1beta1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/auth/v1beta1/tx.ts rename to packages/types/protobuf/codegen/cosmos/auth/v1beta1/tx.ts diff --git a/packages/utils/protobuf/codegen/cosmos/authz/v1beta1/authz.ts b/packages/types/protobuf/codegen/cosmos/authz/v1beta1/authz.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/authz/v1beta1/authz.ts rename to packages/types/protobuf/codegen/cosmos/authz/v1beta1/authz.ts diff --git a/packages/utils/protobuf/codegen/cosmos/authz/v1beta1/event.ts b/packages/types/protobuf/codegen/cosmos/authz/v1beta1/event.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/authz/v1beta1/event.ts rename to packages/types/protobuf/codegen/cosmos/authz/v1beta1/event.ts diff --git a/packages/utils/protobuf/codegen/cosmos/authz/v1beta1/genesis.ts b/packages/types/protobuf/codegen/cosmos/authz/v1beta1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/authz/v1beta1/genesis.ts rename to packages/types/protobuf/codegen/cosmos/authz/v1beta1/genesis.ts diff --git a/packages/utils/protobuf/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/authz/v1beta1/query.ts b/packages/types/protobuf/codegen/cosmos/authz/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/authz/v1beta1/query.ts rename to packages/types/protobuf/codegen/cosmos/authz/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/authz/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/cosmos/authz/v1beta1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/authz/v1beta1/tx.amino.ts rename to packages/types/protobuf/codegen/cosmos/authz/v1beta1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/cosmos/authz/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/cosmos/authz/v1beta1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/authz/v1beta1/tx.registry.ts rename to packages/types/protobuf/codegen/cosmos/authz/v1beta1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/cosmos/authz/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/cosmos/authz/v1beta1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/authz/v1beta1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/cosmos/authz/v1beta1/tx.rpc.msg.ts diff --git a/packages/types/protobuf/codegen/cosmos/authz/v1beta1/tx.ts b/packages/types/protobuf/codegen/cosmos/authz/v1beta1/tx.ts new file mode 100644 index 000000000..8fbd2256d --- /dev/null +++ b/packages/types/protobuf/codegen/cosmos/authz/v1beta1/tx.ts @@ -0,0 +1,757 @@ +//@ts-nocheck +import { aminoToRawProtobufMsg, rawProtobufMsgToAmino } from '../../../../utils' +import { BinaryReader, BinaryWriter } from '../../../binary' +import { + Any, + AnyAmino, + AnyProtoMsg, + AnySDKType, +} from '../../../google/protobuf/any' +import { base64FromBytes, bytesFromBase64 } from '../../../helpers' +import { Grant, GrantAmino, GrantSDKType } from './authz' +/** + * MsgGrant is a request type for Grant method. It declares authorization to the grantee + * on behalf of the granter with the provided expiration time. + */ +export interface MsgGrant { + granter: string + grantee: string + grant: Grant | undefined +} +export interface MsgGrantProtoMsg { + typeUrl: '/cosmos.authz.v1beta1.MsgGrant' + value: Uint8Array +} +/** + * MsgGrant is a request type for Grant method. It declares authorization to the grantee + * on behalf of the granter with the provided expiration time. + */ +export interface MsgGrantAmino { + granter?: string + grantee?: string + grant: GrantAmino | undefined +} +export interface MsgGrantAminoMsg { + type: 'cosmos-sdk/MsgGrant' + value: MsgGrantAmino +} +/** + * MsgGrant is a request type for Grant method. It declares authorization to the grantee + * on behalf of the granter with the provided expiration time. + */ +export interface MsgGrantSDKType { + granter: string + grantee: string + grant: GrantSDKType | undefined +} +/** MsgGrantResponse defines the Msg/MsgGrant response type. */ +export interface MsgGrantResponse {} +export interface MsgGrantResponseProtoMsg { + typeUrl: '/cosmos.authz.v1beta1.MsgGrantResponse' + value: Uint8Array +} +/** MsgGrantResponse defines the Msg/MsgGrant response type. */ +export interface MsgGrantResponseAmino {} +export interface MsgGrantResponseAminoMsg { + type: 'cosmos-sdk/MsgGrantResponse' + value: MsgGrantResponseAmino +} +/** MsgGrantResponse defines the Msg/MsgGrant response type. */ +export interface MsgGrantResponseSDKType {} +/** + * MsgExec attempts to execute the provided messages using + * authorizations granted to the grantee. Each message should have only + * one signer corresponding to the granter of the authorization. + */ +export interface MsgExec { + grantee: string + /** + * Execute Msg. + * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) + * triple and validate it. + */ + msgs: Any[] | Any[] +} +export interface MsgExecProtoMsg { + typeUrl: '/cosmos.authz.v1beta1.MsgExec' + value: Uint8Array +} +export type MsgExecEncoded = Omit & { + /** + * Execute Msg. + * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) + * triple and validate it. + */ + msgs: AnyProtoMsg[] +} +/** + * MsgExec attempts to execute the provided messages using + * authorizations granted to the grantee. Each message should have only + * one signer corresponding to the granter of the authorization. + */ +export interface MsgExecAmino { + grantee?: string + /** + * Execute Msg. + * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) + * triple and validate it. + */ + msgs?: AnyAmino[] +} +export interface MsgExecAminoMsg { + type: 'cosmos-sdk/MsgExec' + value: MsgExecAmino +} +/** + * MsgExec attempts to execute the provided messages using + * authorizations granted to the grantee. Each message should have only + * one signer corresponding to the granter of the authorization. + */ +export interface MsgExecSDKType { + grantee: string + msgs: AnySDKType[] +} +/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ +export interface MsgExecResponse { + results: Uint8Array[] +} +export interface MsgExecResponseProtoMsg { + typeUrl: '/cosmos.authz.v1beta1.MsgExecResponse' + value: Uint8Array +} +/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ +export interface MsgExecResponseAmino { + results?: string[] +} +export interface MsgExecResponseAminoMsg { + type: 'cosmos-sdk/MsgExecResponse' + value: MsgExecResponseAmino +} +/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ +export interface MsgExecResponseSDKType { + results: Uint8Array[] +} +/** + * MsgRevoke revokes any authorization with the provided sdk.Msg type on the + * granter's account with that has been granted to the grantee. + */ +export interface MsgRevoke { + granter: string + grantee: string + msgTypeUrl: string +} +export interface MsgRevokeProtoMsg { + typeUrl: '/cosmos.authz.v1beta1.MsgRevoke' + value: Uint8Array +} +/** + * MsgRevoke revokes any authorization with the provided sdk.Msg type on the + * granter's account with that has been granted to the grantee. + */ +export interface MsgRevokeAmino { + granter?: string + grantee?: string + msg_type_url?: string +} +export interface MsgRevokeAminoMsg { + type: 'cosmos-sdk/MsgRevoke' + value: MsgRevokeAmino +} +/** + * MsgRevoke revokes any authorization with the provided sdk.Msg type on the + * granter's account with that has been granted to the grantee. + */ +export interface MsgRevokeSDKType { + granter: string + grantee: string + msg_type_url: string +} +/** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ +export interface MsgRevokeResponse {} +export interface MsgRevokeResponseProtoMsg { + typeUrl: '/cosmos.authz.v1beta1.MsgRevokeResponse' + value: Uint8Array +} +/** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ +export interface MsgRevokeResponseAmino {} +export interface MsgRevokeResponseAminoMsg { + type: 'cosmos-sdk/MsgRevokeResponse' + value: MsgRevokeResponseAmino +} +/** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ +export interface MsgRevokeResponseSDKType {} +function createBaseMsgGrant(): MsgGrant { + return { + granter: '', + grantee: '', + grant: Grant.fromPartial({}), + } +} +export const MsgGrant = { + typeUrl: '/cosmos.authz.v1beta1.MsgGrant', + encode( + message: MsgGrant, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.granter !== '') { + writer.uint32(10).string(message.granter) + } + if (message.grantee !== '') { + writer.uint32(18).string(message.grantee) + } + if (message.grant !== undefined) { + Grant.encode(message.grant, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + useInterfaces: boolean = false + ): MsgGrant { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgGrant() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.granter = reader.string() + break + case 2: + message.grantee = reader.string() + break + case 3: + message.grant = Grant.decode(reader, reader.uint32(), useInterfaces) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgGrant { + const message = createBaseMsgGrant() + message.granter = object.granter ?? '' + message.grantee = object.grantee ?? '' + message.grant = + object.grant !== undefined && object.grant !== null + ? Grant.fromPartial(object.grant) + : undefined + return message + }, + fromAmino(object: MsgGrantAmino): MsgGrant { + const message = createBaseMsgGrant() + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee + } + if (object.grant !== undefined && object.grant !== null) { + message.grant = Grant.fromAmino(object.grant) + } + return message + }, + toAmino(message: MsgGrant, useInterfaces: boolean = false): MsgGrantAmino { + const obj: any = {} + obj.granter = message.granter + obj.grantee = message.grantee + obj.grant = message.grant + ? Grant.toAmino(message.grant, useInterfaces) + : Grant.fromPartial({}) + return obj + }, + fromAminoMsg(object: MsgGrantAminoMsg): MsgGrant { + return MsgGrant.fromAmino(object.value) + }, + toAminoMsg( + message: MsgGrant, + useInterfaces: boolean = false + ): MsgGrantAminoMsg { + return { + type: 'cosmos-sdk/MsgGrant', + value: MsgGrant.toAmino(message, useInterfaces), + } + }, + fromProtoMsg( + message: MsgGrantProtoMsg, + useInterfaces: boolean = false + ): MsgGrant { + return MsgGrant.decode(message.value, undefined, useInterfaces) + }, + toProto(message: MsgGrant): Uint8Array { + return MsgGrant.encode(message).finish() + }, + toProtoMsg(message: MsgGrant): MsgGrantProtoMsg { + return { + typeUrl: '/cosmos.authz.v1beta1.MsgGrant', + value: MsgGrant.encode(message).finish(), + } + }, +} +function createBaseMsgGrantResponse(): MsgGrantResponse { + return {} +} +export const MsgGrantResponse = { + typeUrl: '/cosmos.authz.v1beta1.MsgGrantResponse', + encode( + _: MsgGrantResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + useInterfaces: boolean = false + ): MsgGrantResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgGrantResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgGrantResponse { + const message = createBaseMsgGrantResponse() + return message + }, + fromAmino(_: MsgGrantResponseAmino): MsgGrantResponse { + const message = createBaseMsgGrantResponse() + return message + }, + toAmino( + _: MsgGrantResponse, + useInterfaces: boolean = false + ): MsgGrantResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg(object: MsgGrantResponseAminoMsg): MsgGrantResponse { + return MsgGrantResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgGrantResponse, + useInterfaces: boolean = false + ): MsgGrantResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgGrantResponse', + value: MsgGrantResponse.toAmino(message, useInterfaces), + } + }, + fromProtoMsg( + message: MsgGrantResponseProtoMsg, + useInterfaces: boolean = false + ): MsgGrantResponse { + return MsgGrantResponse.decode(message.value, undefined, useInterfaces) + }, + toProto(message: MsgGrantResponse): Uint8Array { + return MsgGrantResponse.encode(message).finish() + }, + toProtoMsg(message: MsgGrantResponse): MsgGrantResponseProtoMsg { + return { + typeUrl: '/cosmos.authz.v1beta1.MsgGrantResponse', + value: MsgGrantResponse.encode(message).finish(), + } + }, +} +function createBaseMsgExec(): MsgExec { + return { + grantee: '', + msgs: [], + } +} +export const MsgExec = { + typeUrl: '/cosmos.authz.v1beta1.MsgExec', + encode( + message: MsgExec, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.grantee !== '') { + writer.uint32(10).string(message.grantee) + } + for (const v of message.msgs) { + Any.encode(v! as Any, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + useInterfaces: boolean = false + ): MsgExec { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgExec() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.grantee = reader.string() + break + case 2: + message.msgs.push( + useInterfaces + ? (Cosmos_basev1beta1Msg_InterfaceDecoder(reader) as Any) + : Any.decode(reader, reader.uint32(), useInterfaces) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgExec { + const message = createBaseMsgExec() + message.grantee = object.grantee ?? '' + message.msgs = object.msgs?.map((e) => Any.fromPartial(e)) || [] + return message + }, + fromAmino(object: MsgExecAmino): MsgExec { + const message = createBaseMsgExec() + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee + } + message.msgs = object.msgs?.map((e) => aminoToRawProtobufMsg(e)) || [] + return message + }, + toAmino(message: MsgExec, useInterfaces: boolean = false): MsgExecAmino { + const obj: any = {} + obj.grantee = message.grantee + if (message.msgs) { + obj.msgs = message.msgs.map((e) => + e ? rawProtobufMsgToAmino(e as Any, useInterfaces) : undefined + ) + } else { + obj.msgs = [] + } + return obj + }, + fromAminoMsg(object: MsgExecAminoMsg): MsgExec { + return MsgExec.fromAmino(object.value) + }, + toAminoMsg( + message: MsgExec, + useInterfaces: boolean = false + ): MsgExecAminoMsg { + return { + type: 'cosmos-sdk/MsgExec', + value: MsgExec.toAmino(message, useInterfaces), + } + }, + fromProtoMsg( + message: MsgExecProtoMsg, + useInterfaces: boolean = false + ): MsgExec { + return MsgExec.decode(message.value, undefined, useInterfaces) + }, + toProto(message: MsgExec): Uint8Array { + return MsgExec.encode(message).finish() + }, + toProtoMsg(message: MsgExec): MsgExecProtoMsg { + return { + typeUrl: '/cosmos.authz.v1beta1.MsgExec', + value: MsgExec.encode(message).finish(), + } + }, +} +function createBaseMsgExecResponse(): MsgExecResponse { + return { + results: [], + } +} +export const MsgExecResponse = { + typeUrl: '/cosmos.authz.v1beta1.MsgExecResponse', + encode( + message: MsgExecResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.results) { + writer.uint32(10).bytes(v!) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + useInterfaces: boolean = false + ): MsgExecResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgExecResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.results.push(reader.bytes()) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgExecResponse { + const message = createBaseMsgExecResponse() + message.results = object.results?.map((e) => e) || [] + return message + }, + fromAmino(object: MsgExecResponseAmino): MsgExecResponse { + const message = createBaseMsgExecResponse() + message.results = object.results?.map((e) => bytesFromBase64(e)) || [] + return message + }, + toAmino( + message: MsgExecResponse, + useInterfaces: boolean = false + ): MsgExecResponseAmino { + const obj: any = {} + if (message.results) { + obj.results = message.results.map((e) => base64FromBytes(e)) + } else { + obj.results = [] + } + return obj + }, + fromAminoMsg(object: MsgExecResponseAminoMsg): MsgExecResponse { + return MsgExecResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgExecResponse, + useInterfaces: boolean = false + ): MsgExecResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgExecResponse', + value: MsgExecResponse.toAmino(message, useInterfaces), + } + }, + fromProtoMsg( + message: MsgExecResponseProtoMsg, + useInterfaces: boolean = false + ): MsgExecResponse { + return MsgExecResponse.decode(message.value, undefined, useInterfaces) + }, + toProto(message: MsgExecResponse): Uint8Array { + return MsgExecResponse.encode(message).finish() + }, + toProtoMsg(message: MsgExecResponse): MsgExecResponseProtoMsg { + return { + typeUrl: '/cosmos.authz.v1beta1.MsgExecResponse', + value: MsgExecResponse.encode(message).finish(), + } + }, +} +function createBaseMsgRevoke(): MsgRevoke { + return { + granter: '', + grantee: '', + msgTypeUrl: '', + } +} +export const MsgRevoke = { + typeUrl: '/cosmos.authz.v1beta1.MsgRevoke', + encode( + message: MsgRevoke, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.granter !== '') { + writer.uint32(10).string(message.granter) + } + if (message.grantee !== '') { + writer.uint32(18).string(message.grantee) + } + if (message.msgTypeUrl !== '') { + writer.uint32(26).string(message.msgTypeUrl) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + useInterfaces: boolean = false + ): MsgRevoke { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRevoke() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.granter = reader.string() + break + case 2: + message.grantee = reader.string() + break + case 3: + message.msgTypeUrl = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgRevoke { + const message = createBaseMsgRevoke() + message.granter = object.granter ?? '' + message.grantee = object.grantee ?? '' + message.msgTypeUrl = object.msgTypeUrl ?? '' + return message + }, + fromAmino(object: MsgRevokeAmino): MsgRevoke { + const message = createBaseMsgRevoke() + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee + } + if (object.msg_type_url !== undefined && object.msg_type_url !== null) { + message.msgTypeUrl = object.msg_type_url + } + return message + }, + toAmino(message: MsgRevoke, useInterfaces: boolean = false): MsgRevokeAmino { + const obj: any = {} + obj.granter = message.granter + obj.grantee = message.grantee + obj.msg_type_url = message.msgTypeUrl + return obj + }, + fromAminoMsg(object: MsgRevokeAminoMsg): MsgRevoke { + return MsgRevoke.fromAmino(object.value) + }, + toAminoMsg( + message: MsgRevoke, + useInterfaces: boolean = false + ): MsgRevokeAminoMsg { + return { + type: 'cosmos-sdk/MsgRevoke', + value: MsgRevoke.toAmino(message, useInterfaces), + } + }, + fromProtoMsg( + message: MsgRevokeProtoMsg, + useInterfaces: boolean = false + ): MsgRevoke { + return MsgRevoke.decode(message.value, undefined, useInterfaces) + }, + toProto(message: MsgRevoke): Uint8Array { + return MsgRevoke.encode(message).finish() + }, + toProtoMsg(message: MsgRevoke): MsgRevokeProtoMsg { + return { + typeUrl: '/cosmos.authz.v1beta1.MsgRevoke', + value: MsgRevoke.encode(message).finish(), + } + }, +} +function createBaseMsgRevokeResponse(): MsgRevokeResponse { + return {} +} +export const MsgRevokeResponse = { + typeUrl: '/cosmos.authz.v1beta1.MsgRevokeResponse', + encode( + _: MsgRevokeResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + useInterfaces: boolean = false + ): MsgRevokeResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgRevokeResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgRevokeResponse { + const message = createBaseMsgRevokeResponse() + return message + }, + fromAmino(_: MsgRevokeResponseAmino): MsgRevokeResponse { + const message = createBaseMsgRevokeResponse() + return message + }, + toAmino( + _: MsgRevokeResponse, + useInterfaces: boolean = false + ): MsgRevokeResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg(object: MsgRevokeResponseAminoMsg): MsgRevokeResponse { + return MsgRevokeResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgRevokeResponse, + useInterfaces: boolean = false + ): MsgRevokeResponseAminoMsg { + return { + type: 'cosmos-sdk/MsgRevokeResponse', + value: MsgRevokeResponse.toAmino(message, useInterfaces), + } + }, + fromProtoMsg( + message: MsgRevokeResponseProtoMsg, + useInterfaces: boolean = false + ): MsgRevokeResponse { + return MsgRevokeResponse.decode(message.value, undefined, useInterfaces) + }, + toProto(message: MsgRevokeResponse): Uint8Array { + return MsgRevokeResponse.encode(message).finish() + }, + toProtoMsg(message: MsgRevokeResponse): MsgRevokeResponseProtoMsg { + return { + typeUrl: '/cosmos.authz.v1beta1.MsgRevokeResponse', + value: MsgRevokeResponse.encode(message).finish(), + } + }, +} +export const Cosmos_basev1beta1Msg_InterfaceDecoder = ( + input: BinaryReader | Uint8Array +): Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input) + const data = Any.decode(reader, reader.uint32(), true) + switch (data.typeUrl) { + default: + return data + } +} +export const Cosmos_basev1beta1Msg_FromAmino = (content: AnyAmino) => { + return Any.fromAmino(content) +} +export const Cosmos_basev1beta1Msg_ToAmino = ( + content: Any, + useInterfaces: boolean = false +) => { + return Any.toAmino(content, useInterfaces) +} diff --git a/packages/utils/protobuf/codegen/cosmos/bank/v1beta1/authz.ts b/packages/types/protobuf/codegen/cosmos/bank/v1beta1/authz.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/bank/v1beta1/authz.ts rename to packages/types/protobuf/codegen/cosmos/bank/v1beta1/authz.ts diff --git a/packages/utils/protobuf/codegen/cosmos/bank/v1beta1/bank.ts b/packages/types/protobuf/codegen/cosmos/bank/v1beta1/bank.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/bank/v1beta1/bank.ts rename to packages/types/protobuf/codegen/cosmos/bank/v1beta1/bank.ts diff --git a/packages/utils/protobuf/codegen/cosmos/bank/v1beta1/genesis.ts b/packages/types/protobuf/codegen/cosmos/bank/v1beta1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/bank/v1beta1/genesis.ts rename to packages/types/protobuf/codegen/cosmos/bank/v1beta1/genesis.ts diff --git a/packages/utils/protobuf/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/bank/v1beta1/query.ts b/packages/types/protobuf/codegen/cosmos/bank/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/bank/v1beta1/query.ts rename to packages/types/protobuf/codegen/cosmos/bank/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/bank/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/cosmos/bank/v1beta1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/bank/v1beta1/tx.amino.ts rename to packages/types/protobuf/codegen/cosmos/bank/v1beta1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/cosmos/bank/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/cosmos/bank/v1beta1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/bank/v1beta1/tx.registry.ts rename to packages/types/protobuf/codegen/cosmos/bank/v1beta1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/cosmos/bank/v1beta1/tx.ts b/packages/types/protobuf/codegen/cosmos/bank/v1beta1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/bank/v1beta1/tx.ts rename to packages/types/protobuf/codegen/cosmos/bank/v1beta1/tx.ts diff --git a/packages/utils/protobuf/codegen/cosmos/base/abci/v1beta1/abci.ts b/packages/types/protobuf/codegen/cosmos/base/abci/v1beta1/abci.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/base/abci/v1beta1/abci.ts rename to packages/types/protobuf/codegen/cosmos/base/abci/v1beta1/abci.ts diff --git a/packages/utils/protobuf/codegen/cosmos/base/query/v1beta1/pagination.ts b/packages/types/protobuf/codegen/cosmos/base/query/v1beta1/pagination.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/base/query/v1beta1/pagination.ts rename to packages/types/protobuf/codegen/cosmos/base/query/v1beta1/pagination.ts diff --git a/packages/utils/protobuf/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.ts b/packages/types/protobuf/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.ts rename to packages/types/protobuf/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.ts diff --git a/packages/utils/protobuf/codegen/cosmos/base/tendermint/v1beta1/query.ts b/packages/types/protobuf/codegen/cosmos/base/tendermint/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/base/tendermint/v1beta1/query.ts rename to packages/types/protobuf/codegen/cosmos/base/tendermint/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/base/tendermint/v1beta1/types.ts b/packages/types/protobuf/codegen/cosmos/base/tendermint/v1beta1/types.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/base/tendermint/v1beta1/types.ts rename to packages/types/protobuf/codegen/cosmos/base/tendermint/v1beta1/types.ts diff --git a/packages/utils/protobuf/codegen/cosmos/base/v1beta1/coin.ts b/packages/types/protobuf/codegen/cosmos/base/v1beta1/coin.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/base/v1beta1/coin.ts rename to packages/types/protobuf/codegen/cosmos/base/v1beta1/coin.ts diff --git a/packages/utils/protobuf/codegen/cosmos/bundle.ts b/packages/types/protobuf/codegen/cosmos/bundle.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/bundle.ts rename to packages/types/protobuf/codegen/cosmos/bundle.ts diff --git a/packages/utils/protobuf/codegen/cosmos/client.ts b/packages/types/protobuf/codegen/cosmos/client.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/client.ts rename to packages/types/protobuf/codegen/cosmos/client.ts diff --git a/packages/utils/protobuf/codegen/cosmos/crypto/ed25519/keys.ts b/packages/types/protobuf/codegen/cosmos/crypto/ed25519/keys.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/crypto/ed25519/keys.ts rename to packages/types/protobuf/codegen/cosmos/crypto/ed25519/keys.ts diff --git a/packages/utils/protobuf/codegen/cosmos/crypto/multisig/keys.ts b/packages/types/protobuf/codegen/cosmos/crypto/multisig/keys.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/crypto/multisig/keys.ts rename to packages/types/protobuf/codegen/cosmos/crypto/multisig/keys.ts diff --git a/packages/utils/protobuf/codegen/cosmos/crypto/multisig/v1beta1/multisig.ts b/packages/types/protobuf/codegen/cosmos/crypto/multisig/v1beta1/multisig.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/crypto/multisig/v1beta1/multisig.ts rename to packages/types/protobuf/codegen/cosmos/crypto/multisig/v1beta1/multisig.ts diff --git a/packages/utils/protobuf/codegen/cosmos/crypto/secp256k1/keys.ts b/packages/types/protobuf/codegen/cosmos/crypto/secp256k1/keys.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/crypto/secp256k1/keys.ts rename to packages/types/protobuf/codegen/cosmos/crypto/secp256k1/keys.ts diff --git a/packages/utils/protobuf/codegen/cosmos/distribution/v1beta1/distribution.ts b/packages/types/protobuf/codegen/cosmos/distribution/v1beta1/distribution.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/distribution/v1beta1/distribution.ts rename to packages/types/protobuf/codegen/cosmos/distribution/v1beta1/distribution.ts diff --git a/packages/utils/protobuf/codegen/cosmos/distribution/v1beta1/genesis.ts b/packages/types/protobuf/codegen/cosmos/distribution/v1beta1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/distribution/v1beta1/genesis.ts rename to packages/types/protobuf/codegen/cosmos/distribution/v1beta1/genesis.ts diff --git a/packages/utils/protobuf/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/distribution/v1beta1/query.ts b/packages/types/protobuf/codegen/cosmos/distribution/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/distribution/v1beta1/query.ts rename to packages/types/protobuf/codegen/cosmos/distribution/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/distribution/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/cosmos/distribution/v1beta1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/distribution/v1beta1/tx.amino.ts rename to packages/types/protobuf/codegen/cosmos/distribution/v1beta1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/cosmos/distribution/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/cosmos/distribution/v1beta1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/distribution/v1beta1/tx.registry.ts rename to packages/types/protobuf/codegen/cosmos/distribution/v1beta1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/cosmos/distribution/v1beta1/tx.ts b/packages/types/protobuf/codegen/cosmos/distribution/v1beta1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/distribution/v1beta1/tx.ts rename to packages/types/protobuf/codegen/cosmos/distribution/v1beta1/tx.ts diff --git a/packages/utils/protobuf/codegen/cosmos/gov/v1/genesis.ts b/packages/types/protobuf/codegen/cosmos/gov/v1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/gov/v1/genesis.ts rename to packages/types/protobuf/codegen/cosmos/gov/v1/genesis.ts diff --git a/packages/utils/protobuf/codegen/cosmos/gov/v1/gov.ts b/packages/types/protobuf/codegen/cosmos/gov/v1/gov.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/gov/v1/gov.ts rename to packages/types/protobuf/codegen/cosmos/gov/v1/gov.ts diff --git a/packages/utils/protobuf/codegen/cosmos/gov/v1/query.rpc.Query.ts b/packages/types/protobuf/codegen/cosmos/gov/v1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/gov/v1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/cosmos/gov/v1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/gov/v1/query.ts b/packages/types/protobuf/codegen/cosmos/gov/v1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/gov/v1/query.ts rename to packages/types/protobuf/codegen/cosmos/gov/v1/query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/gov/v1/tx.amino.ts b/packages/types/protobuf/codegen/cosmos/gov/v1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/gov/v1/tx.amino.ts rename to packages/types/protobuf/codegen/cosmos/gov/v1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/cosmos/gov/v1/tx.registry.ts b/packages/types/protobuf/codegen/cosmos/gov/v1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/gov/v1/tx.registry.ts rename to packages/types/protobuf/codegen/cosmos/gov/v1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/cosmos/gov/v1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/cosmos/gov/v1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/gov/v1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/cosmos/gov/v1/tx.rpc.msg.ts diff --git a/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts b/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts new file mode 100644 index 000000000..e6b8c31ff --- /dev/null +++ b/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts @@ -0,0 +1,3365 @@ +//@ts-nocheck +import { aminoToRawProtobufMsg, rawProtobufMsgToAmino } from '../../../../utils' +import { + MsgCreateAllianceProposal, + MsgCreateAllianceProposalProtoMsg, + MsgCreateAllianceProposalSDKType, + MsgDeleteAllianceProposal, + MsgDeleteAllianceProposalProtoMsg, + MsgDeleteAllianceProposalSDKType, + MsgUpdateAllianceProposal, + MsgUpdateAllianceProposalProtoMsg, + MsgUpdateAllianceProposalSDKType, +} from '../../../alliance/alliance/gov' +import { BinaryReader, BinaryWriter } from '../../../binary' +import { + ClearAdminProposal, + ClearAdminProposalProtoMsg, + ClearAdminProposalSDKType, + ExecuteContractProposal, + ExecuteContractProposalProtoMsg, + ExecuteContractProposalSDKType, + InstantiateContract2Proposal, + InstantiateContract2ProposalProtoMsg, + InstantiateContract2ProposalSDKType, + InstantiateContractProposal, + InstantiateContractProposalProtoMsg, + InstantiateContractProposalSDKType, + MigrateContractProposal, + MigrateContractProposalProtoMsg, + MigrateContractProposalSDKType, + PinCodesProposal, + PinCodesProposalProtoMsg, + PinCodesProposalSDKType, + StoreAndInstantiateContractProposal, + StoreAndInstantiateContractProposalProtoMsg, + StoreAndInstantiateContractProposalSDKType, + StoreCodeProposal, + StoreCodeProposalProtoMsg, + StoreCodeProposalSDKType, + SudoContractProposal, + SudoContractProposalProtoMsg, + SudoContractProposalSDKType, + UnpinCodesProposal, + UnpinCodesProposalProtoMsg, + UnpinCodesProposalSDKType, + UpdateAdminProposal, + UpdateAdminProposalProtoMsg, + UpdateAdminProposalSDKType, + UpdateInstantiateConfigProposal, + UpdateInstantiateConfigProposalProtoMsg, + UpdateInstantiateConfigProposalSDKType, +} from '../../../cosmwasm/wasm/v1/proposal' +import { + Any, + AnyAmino, + AnyProtoMsg, + AnySDKType, +} from '../../../google/protobuf/any' +import { Timestamp } from '../../../google/protobuf/timestamp' +import { fromTimestamp, toTimestamp } from '../../../helpers' +import { + ClientUpdateProposal, + ClientUpdateProposalProtoMsg, + ClientUpdateProposalSDKType, + UpgradeProposal, + UpgradeProposalProtoMsg, + UpgradeProposalSDKType, +} from '../../../ibc/core/client/v1/client' +import { + CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal, + CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg, + CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType, + ReplaceMigrationRecordsProposal, + ReplaceMigrationRecordsProposalProtoMsg, + ReplaceMigrationRecordsProposalSDKType, + SetScalingFactorControllerProposal, + SetScalingFactorControllerProposalProtoMsg, + SetScalingFactorControllerProposalSDKType, + UpdateMigrationRecordsProposal, + UpdateMigrationRecordsProposalProtoMsg, + UpdateMigrationRecordsProposalSDKType, +} from '../../../osmosis/gamm/v1beta1/gov' +import { + CreateGroupsProposal, + CreateGroupsProposalProtoMsg, + CreateGroupsProposalSDKType, +} from '../../../osmosis/incentives/gov' +import { + ReplacePoolIncentivesProposal, + ReplacePoolIncentivesProposalProtoMsg, + ReplacePoolIncentivesProposalSDKType, + UpdatePoolIncentivesProposal, + UpdatePoolIncentivesProposalProtoMsg, + UpdatePoolIncentivesProposalSDKType, +} from '../../../osmosis/pool-incentives/v1beta1/gov' +import { + SetProtoRevAdminAccountProposal, + SetProtoRevAdminAccountProposalProtoMsg, + SetProtoRevAdminAccountProposalSDKType, + SetProtoRevEnabledProposal, + SetProtoRevEnabledProposalProtoMsg, + SetProtoRevEnabledProposalSDKType, +} from '../../../osmosis/protorev/v1beta1/gov' +import { + RemoveSuperfluidAssetsProposal, + RemoveSuperfluidAssetsProposalProtoMsg, + RemoveSuperfluidAssetsProposalSDKType, + SetSuperfluidAssetsProposal, + SetSuperfluidAssetsProposalProtoMsg, + SetSuperfluidAssetsProposalSDKType, + UpdateUnpoolWhiteListProposal, + UpdateUnpoolWhiteListProposalProtoMsg, + UpdateUnpoolWhiteListProposalSDKType, +} from '../../../osmosis/superfluid/v1beta1/gov' +import { + UpdateFeeTokenProposal, + UpdateFeeTokenProposalProtoMsg, + UpdateFeeTokenProposalSDKType, +} from '../../../osmosis/txfees/v1beta1/gov' +import { + DemotePrivilegedContractProposal, + DemotePrivilegedContractProposalProtoMsg, + DemotePrivilegedContractProposalSDKType, + PromoteToPrivilegedContractProposal, + PromoteToPrivilegedContractProposalProtoMsg, + PromoteToPrivilegedContractProposalSDKType, +} from '../../../publicawesome/stargaze/cron/v1/proposal' +import { + RemoveCodeAuthorizationProposal, + RemoveCodeAuthorizationProposalProtoMsg, + RemoveCodeAuthorizationProposalSDKType, + RemoveContractAuthorizationProposal, + RemoveContractAuthorizationProposalProtoMsg, + RemoveContractAuthorizationProposalSDKType, + SetCodeAuthorizationProposal, + SetCodeAuthorizationProposalProtoMsg, + SetCodeAuthorizationProposalSDKType, + SetContractAuthorizationProposal, + SetContractAuthorizationProposalProtoMsg, + SetContractAuthorizationProposalSDKType, +} from '../../../publicawesome/stargaze/globalfee/v1/proposal' +import { + AllowDenomProposal, + AllowDenomProposalProtoMsg, + AllowDenomProposalSDKType, +} from '../../../regen/ecocredit/marketplace/v1/types' +import { + CreditTypeProposal, + CreditTypeProposalProtoMsg, + CreditTypeProposalSDKType, +} from '../../../regen/ecocredit/v1/types' +import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin' +import { + CommunityPoolSpendProposal, + CommunityPoolSpendProposalProtoMsg, + CommunityPoolSpendProposalSDKType, + CommunityPoolSpendProposalWithDeposit, + CommunityPoolSpendProposalWithDepositProtoMsg, + CommunityPoolSpendProposalWithDepositSDKType, +} from '../../distribution/v1beta1/distribution' +import { + ParameterChangeProposal, + ParameterChangeProposalProtoMsg, + ParameterChangeProposalSDKType, +} from '../../params/v1beta1/params' +import { + CancelSoftwareUpgradeProposal, + CancelSoftwareUpgradeProposalProtoMsg, + CancelSoftwareUpgradeProposalSDKType, + SoftwareUpgradeProposal, + SoftwareUpgradeProposalProtoMsg, + SoftwareUpgradeProposalSDKType, +} from '../../upgrade/v1beta1/upgrade' +import { + TextProposal, + TextProposalProtoMsg, + TextProposalSDKType, +} from '../v1beta1/gov' +import { + Params, + ParamsAmino, + ParamsSDKType, + VoteOption, + WeightedVoteOption, + WeightedVoteOptionAmino, + WeightedVoteOptionSDKType, +} from './gov' +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposal { + /** messages are the arbitrary messages to be executed if proposal passes. */ + messages: Any[] + /** initial_deposit is the deposit value that must be paid at proposal submission. */ + initialDeposit: Coin[] + /** proposer is the account address of the proposer. */ + proposer: string + /** metadata is any arbitrary metadata attached to the proposal. */ + metadata: string + /** + * title is the title of the proposal. + * + * Since: cosmos-sdk 0.47 + */ + title: string + /** + * summary is the summary of the proposal + * + * Since: cosmos-sdk 0.47 + */ + summary: string + /** + * expedited defines if the proposal is expedited or not + * + * Since: cosmos-sdk 0.50 + */ + expedited: boolean +} +export interface MsgSubmitProposalProtoMsg { + typeUrl: '/cosmos.gov.v1.MsgSubmitProposal' + value: Uint8Array +} +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposalAmino { + /** messages are the arbitrary messages to be executed if proposal passes. */ + messages?: AnyAmino[] + /** initial_deposit is the deposit value that must be paid at proposal submission. */ + initial_deposit: CoinAmino[] + /** proposer is the account address of the proposer. */ + proposer?: string + /** metadata is any arbitrary metadata attached to the proposal. */ + metadata?: string + /** + * title is the title of the proposal. + * + * Since: cosmos-sdk 0.47 + */ + title?: string + /** + * summary is the summary of the proposal + * + * Since: cosmos-sdk 0.47 + */ + summary?: string + /** + * expedited defines if the proposal is expedited or not + * + * Since: cosmos-sdk 0.50 + */ + expedited?: boolean +} +export interface MsgSubmitProposalAminoMsg { + type: 'cosmos-sdk/v1/MsgSubmitProposal' + value: MsgSubmitProposalAmino +} +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposalSDKType { + messages: AnySDKType[] + initial_deposit: CoinSDKType[] + proposer: string + metadata: string + title: string + summary: string + expedited: boolean +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponse { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint +} +export interface MsgSubmitProposalResponseProtoMsg { + typeUrl: '/cosmos.gov.v1.MsgSubmitProposalResponse' + value: Uint8Array +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponseAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string +} +export interface MsgSubmitProposalResponseAminoMsg { + type: 'cosmos-sdk/v1/MsgSubmitProposalResponse' + value: MsgSubmitProposalResponseAmino +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponseSDKType { + proposal_id: bigint +} +/** + * MsgExecLegacyContent is used to wrap the legacy content field into a message. + * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. + */ +export interface MsgExecLegacyContent { + /** content is the proposal's content. */ + content?: + | (MsgCreateAllianceProposal & + MsgUpdateAllianceProposal & + MsgDeleteAllianceProposal & + CommunityPoolSpendProposal & + CommunityPoolSpendProposalWithDeposit & + TextProposal & + ParameterChangeProposal & + SoftwareUpgradeProposal & + CancelSoftwareUpgradeProposal & + StoreCodeProposal & + InstantiateContractProposal & + InstantiateContract2Proposal & + MigrateContractProposal & + SudoContractProposal & + ExecuteContractProposal & + UpdateAdminProposal & + ClearAdminProposal & + PinCodesProposal & + UnpinCodesProposal & + UpdateInstantiateConfigProposal & + StoreAndInstantiateContractProposal & + ClientUpdateProposal & + UpgradeProposal & + ReplaceMigrationRecordsProposal & + UpdateMigrationRecordsProposal & + CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal & + SetScalingFactorControllerProposal & + CreateGroupsProposal & + ReplacePoolIncentivesProposal & + UpdatePoolIncentivesProposal & + SetProtoRevEnabledProposal & + SetProtoRevAdminAccountProposal & + SetSuperfluidAssetsProposal & + RemoveSuperfluidAssetsProposal & + UpdateUnpoolWhiteListProposal & + UpdateFeeTokenProposal & + PromoteToPrivilegedContractProposal & + DemotePrivilegedContractProposal & + SetCodeAuthorizationProposal & + RemoveCodeAuthorizationProposal & + SetContractAuthorizationProposal & + RemoveContractAuthorizationProposal & + AllowDenomProposal & + CreditTypeProposal & + Any) + | undefined + /** authority must be the gov module address. */ + authority: string +} +export interface MsgExecLegacyContentProtoMsg { + typeUrl: '/cosmos.gov.v1.MsgExecLegacyContent' + value: Uint8Array +} +export type MsgExecLegacyContentEncoded = Omit< + MsgExecLegacyContent, + 'content' +> & { + /** content is the proposal's content. */ content?: + | MsgCreateAllianceProposalProtoMsg + | MsgUpdateAllianceProposalProtoMsg + | MsgDeleteAllianceProposalProtoMsg + | CommunityPoolSpendProposalProtoMsg + | CommunityPoolSpendProposalWithDepositProtoMsg + | TextProposalProtoMsg + | ParameterChangeProposalProtoMsg + | SoftwareUpgradeProposalProtoMsg + | CancelSoftwareUpgradeProposalProtoMsg + | StoreCodeProposalProtoMsg + | InstantiateContractProposalProtoMsg + | InstantiateContract2ProposalProtoMsg + | MigrateContractProposalProtoMsg + | SudoContractProposalProtoMsg + | ExecuteContractProposalProtoMsg + | UpdateAdminProposalProtoMsg + | ClearAdminProposalProtoMsg + | PinCodesProposalProtoMsg + | UnpinCodesProposalProtoMsg + | UpdateInstantiateConfigProposalProtoMsg + | StoreAndInstantiateContractProposalProtoMsg + | ClientUpdateProposalProtoMsg + | UpgradeProposalProtoMsg + | ReplaceMigrationRecordsProposalProtoMsg + | UpdateMigrationRecordsProposalProtoMsg + | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg + | SetScalingFactorControllerProposalProtoMsg + | CreateGroupsProposalProtoMsg + | ReplacePoolIncentivesProposalProtoMsg + | UpdatePoolIncentivesProposalProtoMsg + | SetProtoRevEnabledProposalProtoMsg + | SetProtoRevAdminAccountProposalProtoMsg + | SetSuperfluidAssetsProposalProtoMsg + | RemoveSuperfluidAssetsProposalProtoMsg + | UpdateUnpoolWhiteListProposalProtoMsg + | UpdateFeeTokenProposalProtoMsg + | PromoteToPrivilegedContractProposalProtoMsg + | DemotePrivilegedContractProposalProtoMsg + | SetCodeAuthorizationProposalProtoMsg + | RemoveCodeAuthorizationProposalProtoMsg + | SetContractAuthorizationProposalProtoMsg + | RemoveContractAuthorizationProposalProtoMsg + | AllowDenomProposalProtoMsg + | CreditTypeProposalProtoMsg + | AnyProtoMsg + | undefined +} +/** + * MsgExecLegacyContent is used to wrap the legacy content field into a message. + * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. + */ +export interface MsgExecLegacyContentAmino { + /** content is the proposal's content. */ + content?: AnyAmino | undefined + /** authority must be the gov module address. */ + authority?: string +} +export interface MsgExecLegacyContentAminoMsg { + type: 'cosmos-sdk/v1/MsgExecLegacyContent' + value: MsgExecLegacyContentAmino +} +/** + * MsgExecLegacyContent is used to wrap the legacy content field into a message. + * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. + */ +export interface MsgExecLegacyContentSDKType { + content?: + | MsgCreateAllianceProposalSDKType + | MsgUpdateAllianceProposalSDKType + | MsgDeleteAllianceProposalSDKType + | CommunityPoolSpendProposalSDKType + | CommunityPoolSpendProposalWithDepositSDKType + | TextProposalSDKType + | ParameterChangeProposalSDKType + | SoftwareUpgradeProposalSDKType + | CancelSoftwareUpgradeProposalSDKType + | StoreCodeProposalSDKType + | InstantiateContractProposalSDKType + | InstantiateContract2ProposalSDKType + | MigrateContractProposalSDKType + | SudoContractProposalSDKType + | ExecuteContractProposalSDKType + | UpdateAdminProposalSDKType + | ClearAdminProposalSDKType + | PinCodesProposalSDKType + | UnpinCodesProposalSDKType + | UpdateInstantiateConfigProposalSDKType + | StoreAndInstantiateContractProposalSDKType + | ClientUpdateProposalSDKType + | UpgradeProposalSDKType + | ReplaceMigrationRecordsProposalSDKType + | UpdateMigrationRecordsProposalSDKType + | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType + | SetScalingFactorControllerProposalSDKType + | CreateGroupsProposalSDKType + | ReplacePoolIncentivesProposalSDKType + | UpdatePoolIncentivesProposalSDKType + | SetProtoRevEnabledProposalSDKType + | SetProtoRevAdminAccountProposalSDKType + | SetSuperfluidAssetsProposalSDKType + | RemoveSuperfluidAssetsProposalSDKType + | UpdateUnpoolWhiteListProposalSDKType + | UpdateFeeTokenProposalSDKType + | PromoteToPrivilegedContractProposalSDKType + | DemotePrivilegedContractProposalSDKType + | SetCodeAuthorizationProposalSDKType + | RemoveCodeAuthorizationProposalSDKType + | SetContractAuthorizationProposalSDKType + | RemoveContractAuthorizationProposalSDKType + | AllowDenomProposalSDKType + | CreditTypeProposalSDKType + | AnySDKType + | undefined + authority: string +} +/** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ +export interface MsgExecLegacyContentResponse {} +export interface MsgExecLegacyContentResponseProtoMsg { + typeUrl: '/cosmos.gov.v1.MsgExecLegacyContentResponse' + value: Uint8Array +} +/** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ +export interface MsgExecLegacyContentResponseAmino {} +export interface MsgExecLegacyContentResponseAminoMsg { + type: 'cosmos-sdk/v1/MsgExecLegacyContentResponse' + value: MsgExecLegacyContentResponseAmino +} +/** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ +export interface MsgExecLegacyContentResponseSDKType {} +/** MsgVote defines a message to cast a vote. */ +export interface MsgVote { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint + /** voter is the voter address for the proposal. */ + voter: string + /** option defines the vote option. */ + option: VoteOption + /** metadata is any arbitrary metadata attached to the Vote. */ + metadata: string +} +export interface MsgVoteProtoMsg { + typeUrl: '/cosmos.gov.v1.MsgVote' + value: Uint8Array +} +/** MsgVote defines a message to cast a vote. */ +export interface MsgVoteAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id: string + /** voter is the voter address for the proposal. */ + voter?: string + /** option defines the vote option. */ + option?: VoteOption + /** metadata is any arbitrary metadata attached to the Vote. */ + metadata?: string +} +export interface MsgVoteAminoMsg { + type: 'cosmos-sdk/v1/MsgVote' + value: MsgVoteAmino +} +/** MsgVote defines a message to cast a vote. */ +export interface MsgVoteSDKType { + proposal_id: bigint + voter: string + option: VoteOption + metadata: string +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponse {} +export interface MsgVoteResponseProtoMsg { + typeUrl: '/cosmos.gov.v1.MsgVoteResponse' + value: Uint8Array +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponseAmino {} +export interface MsgVoteResponseAminoMsg { + type: 'cosmos-sdk/v1/MsgVoteResponse' + value: MsgVoteResponseAmino +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponseSDKType {} +/** MsgVoteWeighted defines a message to cast a vote. */ +export interface MsgVoteWeighted { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint + /** voter is the voter address for the proposal. */ + voter: string + /** options defines the weighted vote options. */ + options: WeightedVoteOption[] + /** metadata is any arbitrary metadata attached to the VoteWeighted. */ + metadata: string +} +export interface MsgVoteWeightedProtoMsg { + typeUrl: '/cosmos.gov.v1.MsgVoteWeighted' + value: Uint8Array +} +/** MsgVoteWeighted defines a message to cast a vote. */ +export interface MsgVoteWeightedAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id: string + /** voter is the voter address for the proposal. */ + voter?: string + /** options defines the weighted vote options. */ + options?: WeightedVoteOptionAmino[] + /** metadata is any arbitrary metadata attached to the VoteWeighted. */ + metadata?: string +} +export interface MsgVoteWeightedAminoMsg { + type: 'cosmos-sdk/v1/MsgVoteWeighted' + value: MsgVoteWeightedAmino +} +/** MsgVoteWeighted defines a message to cast a vote. */ +export interface MsgVoteWeightedSDKType { + proposal_id: bigint + voter: string + options: WeightedVoteOptionSDKType[] + metadata: string +} +/** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ +export interface MsgVoteWeightedResponse {} +export interface MsgVoteWeightedResponseProtoMsg { + typeUrl: '/cosmos.gov.v1.MsgVoteWeightedResponse' + value: Uint8Array +} +/** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ +export interface MsgVoteWeightedResponseAmino {} +export interface MsgVoteWeightedResponseAminoMsg { + type: 'cosmos-sdk/v1/MsgVoteWeightedResponse' + value: MsgVoteWeightedResponseAmino +} +/** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ +export interface MsgVoteWeightedResponseSDKType {} +/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ +export interface MsgDeposit { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint + /** depositor defines the deposit addresses from the proposals. */ + depositor: string + /** amount to be deposited by depositor. */ + amount: Coin[] +} +export interface MsgDepositProtoMsg { + typeUrl: '/cosmos.gov.v1.MsgDeposit' + value: Uint8Array +} +/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ +export interface MsgDepositAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id: string + /** depositor defines the deposit addresses from the proposals. */ + depositor?: string + /** amount to be deposited by depositor. */ + amount: CoinAmino[] +} +export interface MsgDepositAminoMsg { + type: 'cosmos-sdk/v1/MsgDeposit' + value: MsgDepositAmino +} +/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ +export interface MsgDepositSDKType { + proposal_id: bigint + depositor: string + amount: CoinSDKType[] +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponse {} +export interface MsgDepositResponseProtoMsg { + typeUrl: '/cosmos.gov.v1.MsgDepositResponse' + value: Uint8Array +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponseAmino {} +export interface MsgDepositResponseAminoMsg { + type: 'cosmos-sdk/v1/MsgDepositResponse' + value: MsgDepositResponseAmino +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponseSDKType {} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string + /** + * params defines the x/gov parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params | undefined +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: '/cosmos.gov.v1.MsgUpdateParams' + value: Uint8Array +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string + /** + * params defines the x/gov parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino | undefined +} +export interface MsgUpdateParamsAminoMsg { + type: 'cosmos-sdk/x/gov/v1/MsgUpdateParams' + value: MsgUpdateParamsAmino +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsSDKType { + authority: string + params: ParamsSDKType | undefined +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: '/cosmos.gov.v1.MsgUpdateParamsResponse' + value: Uint8Array +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: 'cosmos-sdk/v1/MsgUpdateParamsResponse' + value: MsgUpdateParamsResponseAmino +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseSDKType {} +/** + * MsgCancelProposal is the Msg/CancelProposal request type. + * + * Since: cosmos-sdk 0.50 + */ +export interface MsgCancelProposal { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint + /** proposer is the account address of the proposer. */ + proposer: string +} +export interface MsgCancelProposalProtoMsg { + typeUrl: '/cosmos.gov.v1.MsgCancelProposal' + value: Uint8Array +} +/** + * MsgCancelProposal is the Msg/CancelProposal request type. + * + * Since: cosmos-sdk 0.50 + */ +export interface MsgCancelProposalAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string + /** proposer is the account address of the proposer. */ + proposer?: string +} +export interface MsgCancelProposalAminoMsg { + type: 'cosmos-sdk/v1/MsgCancelProposal' + value: MsgCancelProposalAmino +} +/** + * MsgCancelProposal is the Msg/CancelProposal request type. + * + * Since: cosmos-sdk 0.50 + */ +export interface MsgCancelProposalSDKType { + proposal_id: bigint + proposer: string +} +/** + * MsgCancelProposalResponse defines the response structure for executing a + * MsgCancelProposal message. + * + * Since: cosmos-sdk 0.50 + */ +export interface MsgCancelProposalResponse { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint + /** canceled_time is the time when proposal is canceled. */ + canceledTime: Date | undefined + /** canceled_height defines the block height at which the proposal is canceled. */ + canceledHeight: bigint +} +export interface MsgCancelProposalResponseProtoMsg { + typeUrl: '/cosmos.gov.v1.MsgCancelProposalResponse' + value: Uint8Array +} +/** + * MsgCancelProposalResponse defines the response structure for executing a + * MsgCancelProposal message. + * + * Since: cosmos-sdk 0.50 + */ +export interface MsgCancelProposalResponseAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string + /** canceled_time is the time when proposal is canceled. */ + canceled_time?: string | undefined + /** canceled_height defines the block height at which the proposal is canceled. */ + canceled_height?: string +} +export interface MsgCancelProposalResponseAminoMsg { + type: 'cosmos-sdk/v1/MsgCancelProposalResponse' + value: MsgCancelProposalResponseAmino +} +/** + * MsgCancelProposalResponse defines the response structure for executing a + * MsgCancelProposal message. + * + * Since: cosmos-sdk 0.50 + */ +export interface MsgCancelProposalResponseSDKType { + proposal_id: bigint + canceled_time: Date | undefined + canceled_height: bigint +} +function createBaseMsgSubmitProposal(): MsgSubmitProposal { + return { + messages: [], + initialDeposit: [], + proposer: '', + metadata: '', + title: '', + summary: '', + expedited: false, + } +} +export const MsgSubmitProposal = { + typeUrl: '/cosmos.gov.v1.MsgSubmitProposal', + encode( + message: MsgSubmitProposal, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + for (const v of message.messages) { + Any.encode(v!, writer.uint32(10).fork()).ldelim() + } + for (const v of message.initialDeposit) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim() + } + if (message.proposer !== '') { + writer.uint32(26).string(message.proposer) + } + if (message.metadata !== '') { + writer.uint32(34).string(message.metadata) + } + if (message.title !== '') { + writer.uint32(42).string(message.title) + } + if (message.summary !== '') { + writer.uint32(50).string(message.summary) + } + if (message.expedited === true) { + writer.uint32(56).bool(message.expedited) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + useInterfaces: boolean = false + ): MsgSubmitProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSubmitProposal() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.messages.push( + Any.decode(reader, reader.uint32(), useInterfaces) + ) + break + case 2: + message.initialDeposit.push( + Coin.decode(reader, reader.uint32(), useInterfaces) + ) + break + case 3: + message.proposer = reader.string() + break + case 4: + message.metadata = reader.string() + break + case 5: + message.title = reader.string() + break + case 6: + message.summary = reader.string() + break + case 7: + message.expedited = reader.bool() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal() + message.messages = object.messages?.map((e) => Any.fromPartial(e)) || [] + message.initialDeposit = + object.initialDeposit?.map((e) => Coin.fromPartial(e)) || [] + message.proposer = object.proposer ?? '' + message.metadata = object.metadata ?? '' + message.title = object.title ?? '' + message.summary = object.summary ?? '' + message.expedited = object.expedited ?? false + return message + }, + fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal() + message.messages = + object.messages?.map((e) => aminoToRawProtobufMsg(e)) || [] + message.initialDeposit = + object.initial_deposit?.map((e) => Coin.fromAmino(e)) || [] + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = object.proposer + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata + } + if (object.title !== undefined && object.title !== null) { + message.title = object.title + } + if (object.summary !== undefined && object.summary !== null) { + message.summary = object.summary + } + if (object.expedited !== undefined && object.expedited !== null) { + message.expedited = object.expedited + } + return message + }, + toAmino( + message: MsgSubmitProposal, + useInterfaces: boolean = false + ): MsgSubmitProposalAmino { + const obj: any = {} + if (message.messages.length) { + obj.messages = message.messages.map((e) => + e ? rawProtobufMsgToAmino(e, false) : undefined + ) + } + if (message.initialDeposit) { + obj.initial_deposit = message.initialDeposit.map((e) => + e ? Coin.toAmino(e, useInterfaces) : undefined + ) + } else { + obj.initial_deposit = [] + } + obj.proposer = message.proposer + obj.metadata = message.metadata + obj.title = message.title + obj.summary = message.summary + if (message.expedited) { + obj.expedited = message.expedited + } + return obj + }, + fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { + return MsgSubmitProposal.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSubmitProposal, + useInterfaces: boolean = false + ): MsgSubmitProposalAminoMsg { + return { + type: 'cosmos-sdk/v1/MsgSubmitProposal', + value: MsgSubmitProposal.toAmino(message, useInterfaces), + } + }, + fromProtoMsg( + message: MsgSubmitProposalProtoMsg, + useInterfaces: boolean = false + ): MsgSubmitProposal { + return MsgSubmitProposal.decode(message.value, undefined, useInterfaces) + }, + toProto(message: MsgSubmitProposal): Uint8Array { + return MsgSubmitProposal.encode(message).finish() + }, + toProtoMsg(message: MsgSubmitProposal): MsgSubmitProposalProtoMsg { + return { + typeUrl: '/cosmos.gov.v1.MsgSubmitProposal', + value: MsgSubmitProposal.encode(message).finish(), + } + }, +} +function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { + return { + proposalId: BigInt(0), + } +} +export const MsgSubmitProposalResponse = { + typeUrl: '/cosmos.gov.v1.MsgSubmitProposalResponse', + encode( + message: MsgSubmitProposalResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + useInterfaces: boolean = false + ): MsgSubmitProposalResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgSubmitProposalResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgSubmitProposalResponse { + const message = createBaseMsgSubmitProposalResponse() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? BigInt(object.proposalId.toString()) + : BigInt(0) + return message + }, + fromAmino(object: MsgSubmitProposalResponseAmino): MsgSubmitProposalResponse { + const message = createBaseMsgSubmitProposalResponse() + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id) + } + return message + }, + toAmino( + message: MsgSubmitProposalResponse, + useInterfaces: boolean = false + ): MsgSubmitProposalResponseAmino { + const obj: any = {} + obj.proposal_id = message.proposalId + ? message.proposalId.toString() + : undefined + return obj + }, + fromAminoMsg( + object: MsgSubmitProposalResponseAminoMsg + ): MsgSubmitProposalResponse { + return MsgSubmitProposalResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgSubmitProposalResponse, + useInterfaces: boolean = false + ): MsgSubmitProposalResponseAminoMsg { + return { + type: 'cosmos-sdk/v1/MsgSubmitProposalResponse', + value: MsgSubmitProposalResponse.toAmino(message, useInterfaces), + } + }, + fromProtoMsg( + message: MsgSubmitProposalResponseProtoMsg, + useInterfaces: boolean = false + ): MsgSubmitProposalResponse { + return MsgSubmitProposalResponse.decode( + message.value, + undefined, + useInterfaces + ) + }, + toProto(message: MsgSubmitProposalResponse): Uint8Array { + return MsgSubmitProposalResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgSubmitProposalResponse + ): MsgSubmitProposalResponseProtoMsg { + return { + typeUrl: '/cosmos.gov.v1.MsgSubmitProposalResponse', + value: MsgSubmitProposalResponse.encode(message).finish(), + } + }, +} +function createBaseMsgExecLegacyContent(): MsgExecLegacyContent { + return { + content: undefined, + authority: '', + } +} +export const MsgExecLegacyContent = { + typeUrl: '/cosmos.gov.v1.MsgExecLegacyContent', + encode( + message: MsgExecLegacyContent, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.content !== undefined) { + Any.encode(message.content as Any, writer.uint32(10).fork()).ldelim() + } + if (message.authority !== '') { + writer.uint32(18).string(message.authority) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + useInterfaces: boolean = false + ): MsgExecLegacyContent { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgExecLegacyContent() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.content = useInterfaces + ? (Cosmos_govv1beta1Content_InterfaceDecoder(reader) as Any) + : Any.decode(reader, reader.uint32(), useInterfaces) + break + case 2: + message.authority = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgExecLegacyContent { + const message = createBaseMsgExecLegacyContent() + message.content = + object.content !== undefined && object.content !== null + ? Any.fromPartial(object.content) + : undefined + message.authority = object.authority ?? '' + return message + }, + fromAmino(object: MsgExecLegacyContentAmino): MsgExecLegacyContent { + const message = createBaseMsgExecLegacyContent() + if (object.content !== undefined && object.content !== null) { + message.content = Cosmos_govv1beta1Content_FromAmino(object.content) + } + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority + } + return message + }, + toAmino( + message: MsgExecLegacyContent, + useInterfaces: boolean = false + ): MsgExecLegacyContentAmino { + const obj: any = {} + obj.content = message.content + ? Cosmos_govv1beta1Content_ToAmino(message.content as Any, useInterfaces) + : undefined + obj.authority = message.authority + return obj + }, + fromAminoMsg(object: MsgExecLegacyContentAminoMsg): MsgExecLegacyContent { + return MsgExecLegacyContent.fromAmino(object.value) + }, + toAminoMsg( + message: MsgExecLegacyContent, + useInterfaces: boolean = false + ): MsgExecLegacyContentAminoMsg { + return { + type: 'cosmos-sdk/v1/MsgExecLegacyContent', + value: MsgExecLegacyContent.toAmino(message, useInterfaces), + } + }, + fromProtoMsg( + message: MsgExecLegacyContentProtoMsg, + useInterfaces: boolean = false + ): MsgExecLegacyContent { + return MsgExecLegacyContent.decode(message.value, undefined, useInterfaces) + }, + toProto(message: MsgExecLegacyContent): Uint8Array { + return MsgExecLegacyContent.encode(message).finish() + }, + toProtoMsg(message: MsgExecLegacyContent): MsgExecLegacyContentProtoMsg { + return { + typeUrl: '/cosmos.gov.v1.MsgExecLegacyContent', + value: MsgExecLegacyContent.encode(message).finish(), + } + }, +} +function createBaseMsgExecLegacyContentResponse(): MsgExecLegacyContentResponse { + return {} +} +export const MsgExecLegacyContentResponse = { + typeUrl: '/cosmos.gov.v1.MsgExecLegacyContentResponse', + encode( + _: MsgExecLegacyContentResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + useInterfaces: boolean = false + ): MsgExecLegacyContentResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgExecLegacyContentResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + _: Partial + ): MsgExecLegacyContentResponse { + const message = createBaseMsgExecLegacyContentResponse() + return message + }, + fromAmino( + _: MsgExecLegacyContentResponseAmino + ): MsgExecLegacyContentResponse { + const message = createBaseMsgExecLegacyContentResponse() + return message + }, + toAmino( + _: MsgExecLegacyContentResponse, + useInterfaces: boolean = false + ): MsgExecLegacyContentResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgExecLegacyContentResponseAminoMsg + ): MsgExecLegacyContentResponse { + return MsgExecLegacyContentResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgExecLegacyContentResponse, + useInterfaces: boolean = false + ): MsgExecLegacyContentResponseAminoMsg { + return { + type: 'cosmos-sdk/v1/MsgExecLegacyContentResponse', + value: MsgExecLegacyContentResponse.toAmino(message, useInterfaces), + } + }, + fromProtoMsg( + message: MsgExecLegacyContentResponseProtoMsg, + useInterfaces: boolean = false + ): MsgExecLegacyContentResponse { + return MsgExecLegacyContentResponse.decode( + message.value, + undefined, + useInterfaces + ) + }, + toProto(message: MsgExecLegacyContentResponse): Uint8Array { + return MsgExecLegacyContentResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgExecLegacyContentResponse + ): MsgExecLegacyContentResponseProtoMsg { + return { + typeUrl: '/cosmos.gov.v1.MsgExecLegacyContentResponse', + value: MsgExecLegacyContentResponse.encode(message).finish(), + } + }, +} +function createBaseMsgVote(): MsgVote { + return { + proposalId: BigInt(0), + voter: '', + option: 0, + metadata: '', + } +} +export const MsgVote = { + typeUrl: '/cosmos.gov.v1.MsgVote', + encode( + message: MsgVote, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId) + } + if (message.voter !== '') { + writer.uint32(18).string(message.voter) + } + if (message.option !== 0) { + writer.uint32(24).int32(message.option) + } + if (message.metadata !== '') { + writer.uint32(34).string(message.metadata) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + useInterfaces: boolean = false + ): MsgVote { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgVote() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() + break + case 2: + message.voter = reader.string() + break + case 3: + message.option = reader.int32() as any + break + case 4: + message.metadata = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgVote { + const message = createBaseMsgVote() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? BigInt(object.proposalId.toString()) + : BigInt(0) + message.voter = object.voter ?? '' + message.option = object.option ?? 0 + message.metadata = object.metadata ?? '' + return message + }, + fromAmino(object: MsgVoteAmino): MsgVote { + const message = createBaseMsgVote() + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id) + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter + } + if (object.option !== undefined && object.option !== null) { + message.option = object.option + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata + } + return message + }, + toAmino(message: MsgVote, useInterfaces: boolean = false): MsgVoteAmino { + const obj: any = {} + obj.proposal_id = message.proposalId ? message.proposalId.toString() : '0' + obj.voter = message.voter + obj.option = message.option + obj.metadata = message.metadata + return obj + }, + fromAminoMsg(object: MsgVoteAminoMsg): MsgVote { + return MsgVote.fromAmino(object.value) + }, + toAminoMsg( + message: MsgVote, + useInterfaces: boolean = false + ): MsgVoteAminoMsg { + return { + type: 'cosmos-sdk/v1/MsgVote', + value: MsgVote.toAmino(message, useInterfaces), + } + }, + fromProtoMsg( + message: MsgVoteProtoMsg, + useInterfaces: boolean = false + ): MsgVote { + return MsgVote.decode(message.value, undefined, useInterfaces) + }, + toProto(message: MsgVote): Uint8Array { + return MsgVote.encode(message).finish() + }, + toProtoMsg(message: MsgVote): MsgVoteProtoMsg { + return { + typeUrl: '/cosmos.gov.v1.MsgVote', + value: MsgVote.encode(message).finish(), + } + }, +} +function createBaseMsgVoteResponse(): MsgVoteResponse { + return {} +} +export const MsgVoteResponse = { + typeUrl: '/cosmos.gov.v1.MsgVoteResponse', + encode( + _: MsgVoteResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + useInterfaces: boolean = false + ): MsgVoteResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgVoteResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgVoteResponse { + const message = createBaseMsgVoteResponse() + return message + }, + fromAmino(_: MsgVoteResponseAmino): MsgVoteResponse { + const message = createBaseMsgVoteResponse() + return message + }, + toAmino( + _: MsgVoteResponse, + useInterfaces: boolean = false + ): MsgVoteResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg(object: MsgVoteResponseAminoMsg): MsgVoteResponse { + return MsgVoteResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgVoteResponse, + useInterfaces: boolean = false + ): MsgVoteResponseAminoMsg { + return { + type: 'cosmos-sdk/v1/MsgVoteResponse', + value: MsgVoteResponse.toAmino(message, useInterfaces), + } + }, + fromProtoMsg( + message: MsgVoteResponseProtoMsg, + useInterfaces: boolean = false + ): MsgVoteResponse { + return MsgVoteResponse.decode(message.value, undefined, useInterfaces) + }, + toProto(message: MsgVoteResponse): Uint8Array { + return MsgVoteResponse.encode(message).finish() + }, + toProtoMsg(message: MsgVoteResponse): MsgVoteResponseProtoMsg { + return { + typeUrl: '/cosmos.gov.v1.MsgVoteResponse', + value: MsgVoteResponse.encode(message).finish(), + } + }, +} +function createBaseMsgVoteWeighted(): MsgVoteWeighted { + return { + proposalId: BigInt(0), + voter: '', + options: [], + metadata: '', + } +} +export const MsgVoteWeighted = { + typeUrl: '/cosmos.gov.v1.MsgVoteWeighted', + encode( + message: MsgVoteWeighted, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId) + } + if (message.voter !== '') { + writer.uint32(18).string(message.voter) + } + for (const v of message.options) { + WeightedVoteOption.encode(v!, writer.uint32(26).fork()).ldelim() + } + if (message.metadata !== '') { + writer.uint32(34).string(message.metadata) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + useInterfaces: boolean = false + ): MsgVoteWeighted { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgVoteWeighted() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() + break + case 2: + message.voter = reader.string() + break + case 3: + message.options.push( + WeightedVoteOption.decode(reader, reader.uint32(), useInterfaces) + ) + break + case 4: + message.metadata = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgVoteWeighted { + const message = createBaseMsgVoteWeighted() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? BigInt(object.proposalId.toString()) + : BigInt(0) + message.voter = object.voter ?? '' + message.options = + object.options?.map((e) => WeightedVoteOption.fromPartial(e)) || [] + message.metadata = object.metadata ?? '' + return message + }, + fromAmino(object: MsgVoteWeightedAmino): MsgVoteWeighted { + const message = createBaseMsgVoteWeighted() + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id) + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter + } + message.options = + object.options?.map((e) => WeightedVoteOption.fromAmino(e)) || [] + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata + } + return message + }, + toAmino( + message: MsgVoteWeighted, + useInterfaces: boolean = false + ): MsgVoteWeightedAmino { + const obj: any = {} + obj.proposal_id = message.proposalId ? message.proposalId.toString() : '0' + obj.voter = message.voter + if (message.options) { + obj.options = message.options.map((e) => + e ? WeightedVoteOption.toAmino(e, useInterfaces) : undefined + ) + } else { + obj.options = [] + } + obj.metadata = message.metadata + return obj + }, + fromAminoMsg(object: MsgVoteWeightedAminoMsg): MsgVoteWeighted { + return MsgVoteWeighted.fromAmino(object.value) + }, + toAminoMsg( + message: MsgVoteWeighted, + useInterfaces: boolean = false + ): MsgVoteWeightedAminoMsg { + return { + type: 'cosmos-sdk/v1/MsgVoteWeighted', + value: MsgVoteWeighted.toAmino(message, useInterfaces), + } + }, + fromProtoMsg( + message: MsgVoteWeightedProtoMsg, + useInterfaces: boolean = false + ): MsgVoteWeighted { + return MsgVoteWeighted.decode(message.value, undefined, useInterfaces) + }, + toProto(message: MsgVoteWeighted): Uint8Array { + return MsgVoteWeighted.encode(message).finish() + }, + toProtoMsg(message: MsgVoteWeighted): MsgVoteWeightedProtoMsg { + return { + typeUrl: '/cosmos.gov.v1.MsgVoteWeighted', + value: MsgVoteWeighted.encode(message).finish(), + } + }, +} +function createBaseMsgVoteWeightedResponse(): MsgVoteWeightedResponse { + return {} +} +export const MsgVoteWeightedResponse = { + typeUrl: '/cosmos.gov.v1.MsgVoteWeightedResponse', + encode( + _: MsgVoteWeightedResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + useInterfaces: boolean = false + ): MsgVoteWeightedResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgVoteWeightedResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgVoteWeightedResponse { + const message = createBaseMsgVoteWeightedResponse() + return message + }, + fromAmino(_: MsgVoteWeightedResponseAmino): MsgVoteWeightedResponse { + const message = createBaseMsgVoteWeightedResponse() + return message + }, + toAmino( + _: MsgVoteWeightedResponse, + useInterfaces: boolean = false + ): MsgVoteWeightedResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgVoteWeightedResponseAminoMsg + ): MsgVoteWeightedResponse { + return MsgVoteWeightedResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgVoteWeightedResponse, + useInterfaces: boolean = false + ): MsgVoteWeightedResponseAminoMsg { + return { + type: 'cosmos-sdk/v1/MsgVoteWeightedResponse', + value: MsgVoteWeightedResponse.toAmino(message, useInterfaces), + } + }, + fromProtoMsg( + message: MsgVoteWeightedResponseProtoMsg, + useInterfaces: boolean = false + ): MsgVoteWeightedResponse { + return MsgVoteWeightedResponse.decode( + message.value, + undefined, + useInterfaces + ) + }, + toProto(message: MsgVoteWeightedResponse): Uint8Array { + return MsgVoteWeightedResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgVoteWeightedResponse + ): MsgVoteWeightedResponseProtoMsg { + return { + typeUrl: '/cosmos.gov.v1.MsgVoteWeightedResponse', + value: MsgVoteWeightedResponse.encode(message).finish(), + } + }, +} +function createBaseMsgDeposit(): MsgDeposit { + return { + proposalId: BigInt(0), + depositor: '', + amount: [], + } +} +export const MsgDeposit = { + typeUrl: '/cosmos.gov.v1.MsgDeposit', + encode( + message: MsgDeposit, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId) + } + if (message.depositor !== '') { + writer.uint32(18).string(message.depositor) + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + useInterfaces: boolean = false + ): MsgDeposit { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgDeposit() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() + break + case 2: + message.depositor = reader.string() + break + case 3: + message.amount.push( + Coin.decode(reader, reader.uint32(), useInterfaces) + ) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgDeposit { + const message = createBaseMsgDeposit() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? BigInt(object.proposalId.toString()) + : BigInt(0) + message.depositor = object.depositor ?? '' + message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [] + return message + }, + fromAmino(object: MsgDepositAmino): MsgDeposit { + const message = createBaseMsgDeposit() + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id) + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor + } + message.amount = object.amount?.map((e) => Coin.fromAmino(e)) || [] + return message + }, + toAmino( + message: MsgDeposit, + useInterfaces: boolean = false + ): MsgDepositAmino { + const obj: any = {} + obj.proposal_id = message.proposalId ? message.proposalId.toString() : '0' + obj.depositor = message.depositor + if (message.amount) { + obj.amount = message.amount.map((e) => + e ? Coin.toAmino(e, useInterfaces) : undefined + ) + } else { + obj.amount = [] + } + return obj + }, + fromAminoMsg(object: MsgDepositAminoMsg): MsgDeposit { + return MsgDeposit.fromAmino(object.value) + }, + toAminoMsg( + message: MsgDeposit, + useInterfaces: boolean = false + ): MsgDepositAminoMsg { + return { + type: 'cosmos-sdk/v1/MsgDeposit', + value: MsgDeposit.toAmino(message, useInterfaces), + } + }, + fromProtoMsg( + message: MsgDepositProtoMsg, + useInterfaces: boolean = false + ): MsgDeposit { + return MsgDeposit.decode(message.value, undefined, useInterfaces) + }, + toProto(message: MsgDeposit): Uint8Array { + return MsgDeposit.encode(message).finish() + }, + toProtoMsg(message: MsgDeposit): MsgDepositProtoMsg { + return { + typeUrl: '/cosmos.gov.v1.MsgDeposit', + value: MsgDeposit.encode(message).finish(), + } + }, +} +function createBaseMsgDepositResponse(): MsgDepositResponse { + return {} +} +export const MsgDepositResponse = { + typeUrl: '/cosmos.gov.v1.MsgDepositResponse', + encode( + _: MsgDepositResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + useInterfaces: boolean = false + ): MsgDepositResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgDepositResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgDepositResponse { + const message = createBaseMsgDepositResponse() + return message + }, + fromAmino(_: MsgDepositResponseAmino): MsgDepositResponse { + const message = createBaseMsgDepositResponse() + return message + }, + toAmino( + _: MsgDepositResponse, + useInterfaces: boolean = false + ): MsgDepositResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg(object: MsgDepositResponseAminoMsg): MsgDepositResponse { + return MsgDepositResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgDepositResponse, + useInterfaces: boolean = false + ): MsgDepositResponseAminoMsg { + return { + type: 'cosmos-sdk/v1/MsgDepositResponse', + value: MsgDepositResponse.toAmino(message, useInterfaces), + } + }, + fromProtoMsg( + message: MsgDepositResponseProtoMsg, + useInterfaces: boolean = false + ): MsgDepositResponse { + return MsgDepositResponse.decode(message.value, undefined, useInterfaces) + }, + toProto(message: MsgDepositResponse): Uint8Array { + return MsgDepositResponse.encode(message).finish() + }, + toProtoMsg(message: MsgDepositResponse): MsgDepositResponseProtoMsg { + return { + typeUrl: '/cosmos.gov.v1.MsgDepositResponse', + value: MsgDepositResponse.encode(message).finish(), + } + }, +} +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: '', + params: Params.fromPartial({}), + } +} +export const MsgUpdateParams = { + typeUrl: '/cosmos.gov.v1.MsgUpdateParams', + encode( + message: MsgUpdateParams, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.authority !== '') { + writer.uint32(10).string(message.authority) + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim() + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + useInterfaces: boolean = false + ): MsgUpdateParams { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgUpdateParams() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.authority = reader.string() + break + case 2: + message.params = Params.decode(reader, reader.uint32(), useInterfaces) + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams() + message.authority = object.authority ?? '' + message.params = + object.params !== undefined && object.params !== null + ? Params.fromPartial(object.params) + : undefined + return message + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams() + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params) + } + return message + }, + toAmino( + message: MsgUpdateParams, + useInterfaces: boolean = false + ): MsgUpdateParamsAmino { + const obj: any = {} + obj.authority = message.authority + obj.params = message.params + ? Params.toAmino(message.params, useInterfaces) + : Params.fromPartial({}) + return obj + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value) + }, + toAminoMsg( + message: MsgUpdateParams, + useInterfaces: boolean = false + ): MsgUpdateParamsAminoMsg { + return { + type: 'cosmos-sdk/x/gov/v1/MsgUpdateParams', + value: MsgUpdateParams.toAmino(message, useInterfaces), + } + }, + fromProtoMsg( + message: MsgUpdateParamsProtoMsg, + useInterfaces: boolean = false + ): MsgUpdateParams { + return MsgUpdateParams.decode(message.value, undefined, useInterfaces) + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish() + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: '/cosmos.gov.v1.MsgUpdateParams', + value: MsgUpdateParams.encode(message).finish(), + } + }, +} +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {} +} +export const MsgUpdateParamsResponse = { + typeUrl: '/cosmos.gov.v1.MsgUpdateParamsResponse', + encode( + _: MsgUpdateParamsResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + useInterfaces: boolean = false + ): MsgUpdateParamsResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgUpdateParamsResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse() + return message + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse() + return message + }, + toAmino( + _: MsgUpdateParamsResponse, + useInterfaces: boolean = false + ): MsgUpdateParamsResponseAmino { + const obj: any = {} + return obj + }, + fromAminoMsg( + object: MsgUpdateParamsResponseAminoMsg + ): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgUpdateParamsResponse, + useInterfaces: boolean = false + ): MsgUpdateParamsResponseAminoMsg { + return { + type: 'cosmos-sdk/v1/MsgUpdateParamsResponse', + value: MsgUpdateParamsResponse.toAmino(message, useInterfaces), + } + }, + fromProtoMsg( + message: MsgUpdateParamsResponseProtoMsg, + useInterfaces: boolean = false + ): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode( + message.value, + undefined, + useInterfaces + ) + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgUpdateParamsResponse + ): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: '/cosmos.gov.v1.MsgUpdateParamsResponse', + value: MsgUpdateParamsResponse.encode(message).finish(), + } + }, +} +function createBaseMsgCancelProposal(): MsgCancelProposal { + return { + proposalId: BigInt(0), + proposer: '', + } +} +export const MsgCancelProposal = { + typeUrl: '/cosmos.gov.v1.MsgCancelProposal', + encode( + message: MsgCancelProposal, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId) + } + if (message.proposer !== '') { + writer.uint32(18).string(message.proposer) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + useInterfaces: boolean = false + ): MsgCancelProposal { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCancelProposal() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() + break + case 2: + message.proposer = reader.string() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial(object: Partial): MsgCancelProposal { + const message = createBaseMsgCancelProposal() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? BigInt(object.proposalId.toString()) + : BigInt(0) + message.proposer = object.proposer ?? '' + return message + }, + fromAmino(object: MsgCancelProposalAmino): MsgCancelProposal { + const message = createBaseMsgCancelProposal() + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id) + } + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = object.proposer + } + return message + }, + toAmino( + message: MsgCancelProposal, + useInterfaces: boolean = false + ): MsgCancelProposalAmino { + const obj: any = {} + obj.proposal_id = message.proposalId + ? message.proposalId.toString() + : undefined + obj.proposer = message.proposer + return obj + }, + fromAminoMsg(object: MsgCancelProposalAminoMsg): MsgCancelProposal { + return MsgCancelProposal.fromAmino(object.value) + }, + toAminoMsg( + message: MsgCancelProposal, + useInterfaces: boolean = false + ): MsgCancelProposalAminoMsg { + return { + type: 'cosmos-sdk/v1/MsgCancelProposal', + value: MsgCancelProposal.toAmino(message, useInterfaces), + } + }, + fromProtoMsg( + message: MsgCancelProposalProtoMsg, + useInterfaces: boolean = false + ): MsgCancelProposal { + return MsgCancelProposal.decode(message.value, undefined, useInterfaces) + }, + toProto(message: MsgCancelProposal): Uint8Array { + return MsgCancelProposal.encode(message).finish() + }, + toProtoMsg(message: MsgCancelProposal): MsgCancelProposalProtoMsg { + return { + typeUrl: '/cosmos.gov.v1.MsgCancelProposal', + value: MsgCancelProposal.encode(message).finish(), + } + }, +} +function createBaseMsgCancelProposalResponse(): MsgCancelProposalResponse { + return { + proposalId: BigInt(0), + canceledTime: new Date(), + canceledHeight: BigInt(0), + } +} +export const MsgCancelProposalResponse = { + typeUrl: '/cosmos.gov.v1.MsgCancelProposalResponse', + encode( + message: MsgCancelProposalResponse, + writer: BinaryWriter = BinaryWriter.create() + ): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId) + } + if (message.canceledTime !== undefined) { + Timestamp.encode( + toTimestamp(message.canceledTime), + writer.uint32(18).fork() + ).ldelim() + } + if (message.canceledHeight !== BigInt(0)) { + writer.uint32(24).uint64(message.canceledHeight) + } + return writer + }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + useInterfaces: boolean = false + ): MsgCancelProposalResponse { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input) + let end = length === undefined ? reader.len : reader.pos + length + const message = createBaseMsgCancelProposalResponse() + while (reader.pos < end) { + const tag = reader.uint32() + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() + break + case 2: + message.canceledTime = fromTimestamp( + Timestamp.decode(reader, reader.uint32()) + ) + break + case 3: + message.canceledHeight = reader.uint64() + break + default: + reader.skipType(tag & 7) + break + } + } + return message + }, + fromPartial( + object: Partial + ): MsgCancelProposalResponse { + const message = createBaseMsgCancelProposalResponse() + message.proposalId = + object.proposalId !== undefined && object.proposalId !== null + ? BigInt(object.proposalId.toString()) + : BigInt(0) + message.canceledTime = object.canceledTime ?? undefined + message.canceledHeight = + object.canceledHeight !== undefined && object.canceledHeight !== null + ? BigInt(object.canceledHeight.toString()) + : BigInt(0) + return message + }, + fromAmino(object: MsgCancelProposalResponseAmino): MsgCancelProposalResponse { + const message = createBaseMsgCancelProposalResponse() + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id) + } + if (object.canceled_time !== undefined && object.canceled_time !== null) { + message.canceledTime = fromTimestamp( + Timestamp.fromAmino(object.canceled_time) + ) + } + if ( + object.canceled_height !== undefined && + object.canceled_height !== null + ) { + message.canceledHeight = BigInt(object.canceled_height) + } + return message + }, + toAmino( + message: MsgCancelProposalResponse, + useInterfaces: boolean = false + ): MsgCancelProposalResponseAmino { + const obj: any = {} + obj.proposal_id = message.proposalId + ? message.proposalId.toString() + : undefined + obj.canceled_time = message.canceledTime + ? Timestamp.toAmino(toTimestamp(message.canceledTime)) + : undefined + obj.canceled_height = message.canceledHeight + ? message.canceledHeight.toString() + : undefined + return obj + }, + fromAminoMsg( + object: MsgCancelProposalResponseAminoMsg + ): MsgCancelProposalResponse { + return MsgCancelProposalResponse.fromAmino(object.value) + }, + toAminoMsg( + message: MsgCancelProposalResponse, + useInterfaces: boolean = false + ): MsgCancelProposalResponseAminoMsg { + return { + type: 'cosmos-sdk/v1/MsgCancelProposalResponse', + value: MsgCancelProposalResponse.toAmino(message, useInterfaces), + } + }, + fromProtoMsg( + message: MsgCancelProposalResponseProtoMsg, + useInterfaces: boolean = false + ): MsgCancelProposalResponse { + return MsgCancelProposalResponse.decode( + message.value, + undefined, + useInterfaces + ) + }, + toProto(message: MsgCancelProposalResponse): Uint8Array { + return MsgCancelProposalResponse.encode(message).finish() + }, + toProtoMsg( + message: MsgCancelProposalResponse + ): MsgCancelProposalResponseProtoMsg { + return { + typeUrl: '/cosmos.gov.v1.MsgCancelProposalResponse', + value: MsgCancelProposalResponse.encode(message).finish(), + } + }, +} +export const Cosmos_govv1beta1Content_InterfaceDecoder = ( + input: BinaryReader | Uint8Array +): + | MsgCreateAllianceProposal + | MsgUpdateAllianceProposal + | MsgDeleteAllianceProposal + | CommunityPoolSpendProposal + | CommunityPoolSpendProposalWithDeposit + | TextProposal + | ParameterChangeProposal + | SoftwareUpgradeProposal + | CancelSoftwareUpgradeProposal + | StoreCodeProposal + | InstantiateContractProposal + | InstantiateContract2Proposal + | MigrateContractProposal + | SudoContractProposal + | ExecuteContractProposal + | UpdateAdminProposal + | ClearAdminProposal + | PinCodesProposal + | UnpinCodesProposal + | UpdateInstantiateConfigProposal + | StoreAndInstantiateContractProposal + | ClientUpdateProposal + | UpgradeProposal + | ReplaceMigrationRecordsProposal + | UpdateMigrationRecordsProposal + | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal + | SetScalingFactorControllerProposal + | CreateGroupsProposal + | ReplacePoolIncentivesProposal + | UpdatePoolIncentivesProposal + | SetProtoRevEnabledProposal + | SetProtoRevAdminAccountProposal + | SetSuperfluidAssetsProposal + | RemoveSuperfluidAssetsProposal + | UpdateUnpoolWhiteListProposal + | UpdateFeeTokenProposal + | PromoteToPrivilegedContractProposal + | DemotePrivilegedContractProposal + | SetCodeAuthorizationProposal + | RemoveCodeAuthorizationProposal + | SetContractAuthorizationProposal + | RemoveContractAuthorizationProposal + | AllowDenomProposal + | CreditTypeProposal + | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input) + const data = Any.decode(reader, reader.uint32(), true) + switch (data.typeUrl) { + case '/alliance.alliance.MsgCreateAllianceProposal': + return MsgCreateAllianceProposal.decode(data.value, undefined, true) + case '/alliance.alliance.MsgUpdateAllianceProposal': + return MsgUpdateAllianceProposal.decode(data.value, undefined, true) + case '/alliance.alliance.MsgDeleteAllianceProposal': + return MsgDeleteAllianceProposal.decode(data.value, undefined, true) + case '/cosmos.distribution.v1beta1.CommunityPoolSpendProposal': + return CommunityPoolSpendProposal.decode(data.value, undefined, true) + case '/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit': + return CommunityPoolSpendProposalWithDeposit.decode( + data.value, + undefined, + true + ) + case '/cosmos.gov.v1beta1.TextProposal': + return TextProposal.decode(data.value, undefined, true) + case '/cosmos.params.v1beta1.ParameterChangeProposal': + return ParameterChangeProposal.decode(data.value, undefined, true) + case '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal': + return SoftwareUpgradeProposal.decode(data.value, undefined, true) + case '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal': + return CancelSoftwareUpgradeProposal.decode(data.value, undefined, true) + case '/cosmwasm.wasm.v1.StoreCodeProposal': + return StoreCodeProposal.decode(data.value, undefined, true) + case '/cosmwasm.wasm.v1.InstantiateContractProposal': + return InstantiateContractProposal.decode(data.value, undefined, true) + case '/cosmwasm.wasm.v1.InstantiateContract2Proposal': + return InstantiateContract2Proposal.decode(data.value, undefined, true) + case '/cosmwasm.wasm.v1.MigrateContractProposal': + return MigrateContractProposal.decode(data.value, undefined, true) + case '/cosmwasm.wasm.v1.SudoContractProposal': + return SudoContractProposal.decode(data.value, undefined, true) + case '/cosmwasm.wasm.v1.ExecuteContractProposal': + return ExecuteContractProposal.decode(data.value, undefined, true) + case '/cosmwasm.wasm.v1.UpdateAdminProposal': + return UpdateAdminProposal.decode(data.value, undefined, true) + case '/cosmwasm.wasm.v1.ClearAdminProposal': + return ClearAdminProposal.decode(data.value, undefined, true) + case '/cosmwasm.wasm.v1.PinCodesProposal': + return PinCodesProposal.decode(data.value, undefined, true) + case '/cosmwasm.wasm.v1.UnpinCodesProposal': + return UnpinCodesProposal.decode(data.value, undefined, true) + case '/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal': + return UpdateInstantiateConfigProposal.decode(data.value, undefined, true) + case '/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal': + return StoreAndInstantiateContractProposal.decode( + data.value, + undefined, + true + ) + case '/ibc.core.client.v1.ClientUpdateProposal': + return ClientUpdateProposal.decode(data.value, undefined, true) + case '/ibc.core.client.v1.UpgradeProposal': + return UpgradeProposal.decode(data.value, undefined, true) + case '/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal': + return ReplaceMigrationRecordsProposal.decode(data.value, undefined, true) + case '/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal': + return UpdateMigrationRecordsProposal.decode(data.value, undefined, true) + case '/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal': + return CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.decode( + data.value, + undefined, + true + ) + case '/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal': + return SetScalingFactorControllerProposal.decode( + data.value, + undefined, + true + ) + case '/osmosis.incentives.CreateGroupsProposal': + return CreateGroupsProposal.decode(data.value, undefined, true) + case '/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal': + return ReplacePoolIncentivesProposal.decode(data.value, undefined, true) + case '/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal': + return UpdatePoolIncentivesProposal.decode(data.value, undefined, true) + case '/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal': + return SetProtoRevEnabledProposal.decode(data.value, undefined, true) + case '/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal': + return SetProtoRevAdminAccountProposal.decode(data.value, undefined, true) + case '/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal': + return SetSuperfluidAssetsProposal.decode(data.value, undefined, true) + case '/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal': + return RemoveSuperfluidAssetsProposal.decode(data.value, undefined, true) + case '/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal': + return UpdateUnpoolWhiteListProposal.decode(data.value, undefined, true) + case '/osmosis.txfees.v1beta1.UpdateFeeTokenProposal': + return UpdateFeeTokenProposal.decode(data.value, undefined, true) + case '/publicawesome.stargaze.cron.v1.PromoteToPrivilegedContractProposal': + return PromoteToPrivilegedContractProposal.decode( + data.value, + undefined, + true + ) + case '/publicawesome.stargaze.cron.v1.DemotePrivilegedContractProposal': + return DemotePrivilegedContractProposal.decode( + data.value, + undefined, + true + ) + case '/publicawesome.stargaze.globalfee.v1.SetCodeAuthorizationProposal': + return SetCodeAuthorizationProposal.decode(data.value, undefined, true) + case '/publicawesome.stargaze.globalfee.v1.RemoveCodeAuthorizationProposal': + return RemoveCodeAuthorizationProposal.decode(data.value, undefined, true) + case '/publicawesome.stargaze.globalfee.v1.SetContractAuthorizationProposal': + return SetContractAuthorizationProposal.decode( + data.value, + undefined, + true + ) + case '/publicawesome.stargaze.globalfee.v1.RemoveContractAuthorizationProposal': + return RemoveContractAuthorizationProposal.decode( + data.value, + undefined, + true + ) + case '/regen.ecocredit.marketplace.v1.AllowDenomProposal': + return AllowDenomProposal.decode(data.value, undefined, true) + case '/regen.ecocredit.v1.CreditTypeProposal': + return CreditTypeProposal.decode(data.value, undefined, true) + default: + return data + } +} +export const Cosmos_govv1beta1Content_FromAmino = (content: AnyAmino) => { + switch (content.type) { + case '/alliance.alliance.MsgCreateAllianceProposal': + return Any.fromPartial({ + typeUrl: '/alliance.alliance.MsgCreateAllianceProposal', + value: MsgCreateAllianceProposal.encode( + MsgCreateAllianceProposal.fromPartial( + MsgCreateAllianceProposal.fromAmino(content.value) + ) + ).finish(), + }) + case '/alliance.alliance.MsgUpdateAllianceProposal': + return Any.fromPartial({ + typeUrl: '/alliance.alliance.MsgUpdateAllianceProposal', + value: MsgUpdateAllianceProposal.encode( + MsgUpdateAllianceProposal.fromPartial( + MsgUpdateAllianceProposal.fromAmino(content.value) + ) + ).finish(), + }) + case '/alliance.alliance.MsgDeleteAllianceProposal': + return Any.fromPartial({ + typeUrl: '/alliance.alliance.MsgDeleteAllianceProposal', + value: MsgDeleteAllianceProposal.encode( + MsgDeleteAllianceProposal.fromPartial( + MsgDeleteAllianceProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'cosmos-sdk/v1/CommunityPoolSpendProposal': + return Any.fromPartial({ + typeUrl: '/cosmos.distribution.v1beta1.CommunityPoolSpendProposal', + value: CommunityPoolSpendProposal.encode( + CommunityPoolSpendProposal.fromPartial( + CommunityPoolSpendProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'cosmos-sdk/v1/CommunityPoolSpendProposalWithDeposit': + return Any.fromPartial({ + typeUrl: + '/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit', + value: CommunityPoolSpendProposalWithDeposit.encode( + CommunityPoolSpendProposalWithDeposit.fromPartial( + CommunityPoolSpendProposalWithDeposit.fromAmino(content.value) + ) + ).finish(), + }) + case 'cosmos-sdk/TextProposal': + return Any.fromPartial({ + typeUrl: '/cosmos.gov.v1beta1.TextProposal', + value: TextProposal.encode( + TextProposal.fromPartial(TextProposal.fromAmino(content.value)) + ).finish(), + }) + case 'cosmos-sdk/ParameterChangeProposal': + return Any.fromPartial({ + typeUrl: '/cosmos.params.v1beta1.ParameterChangeProposal', + value: ParameterChangeProposal.encode( + ParameterChangeProposal.fromPartial( + ParameterChangeProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'cosmos-sdk/SoftwareUpgradeProposal': + return Any.fromPartial({ + typeUrl: '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal', + value: SoftwareUpgradeProposal.encode( + SoftwareUpgradeProposal.fromPartial( + SoftwareUpgradeProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'cosmos-sdk/CancelSoftwareUpgradeProposal': + return Any.fromPartial({ + typeUrl: '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal', + value: CancelSoftwareUpgradeProposal.encode( + CancelSoftwareUpgradeProposal.fromPartial( + CancelSoftwareUpgradeProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'wasm/StoreCodeProposal': + return Any.fromPartial({ + typeUrl: '/cosmwasm.wasm.v1.StoreCodeProposal', + value: StoreCodeProposal.encode( + StoreCodeProposal.fromPartial( + StoreCodeProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'wasm/InstantiateContractProposal': + return Any.fromPartial({ + typeUrl: '/cosmwasm.wasm.v1.InstantiateContractProposal', + value: InstantiateContractProposal.encode( + InstantiateContractProposal.fromPartial( + InstantiateContractProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'wasm/InstantiateContract2Proposal': + return Any.fromPartial({ + typeUrl: '/cosmwasm.wasm.v1.InstantiateContract2Proposal', + value: InstantiateContract2Proposal.encode( + InstantiateContract2Proposal.fromPartial( + InstantiateContract2Proposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'wasm/MigrateContractProposal': + return Any.fromPartial({ + typeUrl: '/cosmwasm.wasm.v1.MigrateContractProposal', + value: MigrateContractProposal.encode( + MigrateContractProposal.fromPartial( + MigrateContractProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'wasm/SudoContractProposal': + return Any.fromPartial({ + typeUrl: '/cosmwasm.wasm.v1.SudoContractProposal', + value: SudoContractProposal.encode( + SudoContractProposal.fromPartial( + SudoContractProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'wasm/ExecuteContractProposal': + return Any.fromPartial({ + typeUrl: '/cosmwasm.wasm.v1.ExecuteContractProposal', + value: ExecuteContractProposal.encode( + ExecuteContractProposal.fromPartial( + ExecuteContractProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'wasm/UpdateAdminProposal': + return Any.fromPartial({ + typeUrl: '/cosmwasm.wasm.v1.UpdateAdminProposal', + value: UpdateAdminProposal.encode( + UpdateAdminProposal.fromPartial( + UpdateAdminProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'wasm/ClearAdminProposal': + return Any.fromPartial({ + typeUrl: '/cosmwasm.wasm.v1.ClearAdminProposal', + value: ClearAdminProposal.encode( + ClearAdminProposal.fromPartial( + ClearAdminProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'wasm/PinCodesProposal': + return Any.fromPartial({ + typeUrl: '/cosmwasm.wasm.v1.PinCodesProposal', + value: PinCodesProposal.encode( + PinCodesProposal.fromPartial( + PinCodesProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'wasm/UnpinCodesProposal': + return Any.fromPartial({ + typeUrl: '/cosmwasm.wasm.v1.UnpinCodesProposal', + value: UnpinCodesProposal.encode( + UnpinCodesProposal.fromPartial( + UnpinCodesProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'wasm/UpdateInstantiateConfigProposal': + return Any.fromPartial({ + typeUrl: '/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal', + value: UpdateInstantiateConfigProposal.encode( + UpdateInstantiateConfigProposal.fromPartial( + UpdateInstantiateConfigProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'wasm/StoreAndInstantiateContractProposal': + return Any.fromPartial({ + typeUrl: '/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal', + value: StoreAndInstantiateContractProposal.encode( + StoreAndInstantiateContractProposal.fromPartial( + StoreAndInstantiateContractProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'cosmos-sdk/ClientUpdateProposal': + return Any.fromPartial({ + typeUrl: '/ibc.core.client.v1.ClientUpdateProposal', + value: ClientUpdateProposal.encode( + ClientUpdateProposal.fromPartial( + ClientUpdateProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'cosmos-sdk/UpgradeProposal': + return Any.fromPartial({ + typeUrl: '/ibc.core.client.v1.UpgradeProposal', + value: UpgradeProposal.encode( + UpgradeProposal.fromPartial(UpgradeProposal.fromAmino(content.value)) + ).finish(), + }) + case 'osmosis/ReplaceMigrationRecordsProposal': + return Any.fromPartial({ + typeUrl: '/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal', + value: ReplaceMigrationRecordsProposal.encode( + ReplaceMigrationRecordsProposal.fromPartial( + ReplaceMigrationRecordsProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'osmosis/UpdateMigrationRecordsProposal': + return Any.fromPartial({ + typeUrl: '/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal', + value: UpdateMigrationRecordsProposal.encode( + UpdateMigrationRecordsProposal.fromPartial( + UpdateMigrationRecordsProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'osmosis/CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal': + return Any.fromPartial({ + typeUrl: + '/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal', + value: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.encode( + CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.fromPartial( + CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.fromAmino( + content.value + ) + ) + ).finish(), + }) + case 'osmosis/SetScalingFactorControllerProposal': + return Any.fromPartial({ + typeUrl: '/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal', + value: SetScalingFactorControllerProposal.encode( + SetScalingFactorControllerProposal.fromPartial( + SetScalingFactorControllerProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'osmosis/incentives/create-groups-proposal': + return Any.fromPartial({ + typeUrl: '/osmosis.incentives.CreateGroupsProposal', + value: CreateGroupsProposal.encode( + CreateGroupsProposal.fromPartial( + CreateGroupsProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'osmosis/ReplacePoolIncentivesProposal': + return Any.fromPartial({ + typeUrl: + '/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal', + value: ReplacePoolIncentivesProposal.encode( + ReplacePoolIncentivesProposal.fromPartial( + ReplacePoolIncentivesProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'osmosis/UpdatePoolIncentivesProposal': + return Any.fromPartial({ + typeUrl: '/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal', + value: UpdatePoolIncentivesProposal.encode( + UpdatePoolIncentivesProposal.fromPartial( + UpdatePoolIncentivesProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'osmosis/SetProtoRevEnabledProposal': + return Any.fromPartial({ + typeUrl: '/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal', + value: SetProtoRevEnabledProposal.encode( + SetProtoRevEnabledProposal.fromPartial( + SetProtoRevEnabledProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'osmosis/SetProtoRevAdminAccountProposal': + return Any.fromPartial({ + typeUrl: '/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal', + value: SetProtoRevAdminAccountProposal.encode( + SetProtoRevAdminAccountProposal.fromPartial( + SetProtoRevAdminAccountProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'osmosis/set-superfluid-assets-proposal': + return Any.fromPartial({ + typeUrl: '/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal', + value: SetSuperfluidAssetsProposal.encode( + SetSuperfluidAssetsProposal.fromPartial( + SetSuperfluidAssetsProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'osmosis/del-superfluid-assets-proposal': + return Any.fromPartial({ + typeUrl: '/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal', + value: RemoveSuperfluidAssetsProposal.encode( + RemoveSuperfluidAssetsProposal.fromPartial( + RemoveSuperfluidAssetsProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'osmosis/update-unpool-whitelist': + return Any.fromPartial({ + typeUrl: '/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal', + value: UpdateUnpoolWhiteListProposal.encode( + UpdateUnpoolWhiteListProposal.fromPartial( + UpdateUnpoolWhiteListProposal.fromAmino(content.value) + ) + ).finish(), + }) + case 'osmosis/UpdateFeeTokenProposal': + return Any.fromPartial({ + typeUrl: '/osmosis.txfees.v1beta1.UpdateFeeTokenProposal', + value: UpdateFeeTokenProposal.encode( + UpdateFeeTokenProposal.fromPartial( + UpdateFeeTokenProposal.fromAmino(content.value) + ) + ).finish(), + }) + case '/publicawesome.stargaze.cron.v1.PromoteToPrivilegedContractProposal': + return Any.fromPartial({ + typeUrl: + '/publicawesome.stargaze.cron.v1.PromoteToPrivilegedContractProposal', + value: PromoteToPrivilegedContractProposal.encode( + PromoteToPrivilegedContractProposal.fromPartial( + PromoteToPrivilegedContractProposal.fromAmino(content.value) + ) + ).finish(), + }) + case '/publicawesome.stargaze.cron.v1.DemotePrivilegedContractProposal': + return Any.fromPartial({ + typeUrl: + '/publicawesome.stargaze.cron.v1.DemotePrivilegedContractProposal', + value: DemotePrivilegedContractProposal.encode( + DemotePrivilegedContractProposal.fromPartial( + DemotePrivilegedContractProposal.fromAmino(content.value) + ) + ).finish(), + }) + case '/publicawesome.stargaze.globalfee.v1.SetCodeAuthorizationProposal': + return Any.fromPartial({ + typeUrl: + '/publicawesome.stargaze.globalfee.v1.SetCodeAuthorizationProposal', + value: SetCodeAuthorizationProposal.encode( + SetCodeAuthorizationProposal.fromPartial( + SetCodeAuthorizationProposal.fromAmino(content.value) + ) + ).finish(), + }) + case '/publicawesome.stargaze.globalfee.v1.RemoveCodeAuthorizationProposal': + return Any.fromPartial({ + typeUrl: + '/publicawesome.stargaze.globalfee.v1.RemoveCodeAuthorizationProposal', + value: RemoveCodeAuthorizationProposal.encode( + RemoveCodeAuthorizationProposal.fromPartial( + RemoveCodeAuthorizationProposal.fromAmino(content.value) + ) + ).finish(), + }) + case '/publicawesome.stargaze.globalfee.v1.SetContractAuthorizationProposal': + return Any.fromPartial({ + typeUrl: + '/publicawesome.stargaze.globalfee.v1.SetContractAuthorizationProposal', + value: SetContractAuthorizationProposal.encode( + SetContractAuthorizationProposal.fromPartial( + SetContractAuthorizationProposal.fromAmino(content.value) + ) + ).finish(), + }) + case '/publicawesome.stargaze.globalfee.v1.RemoveContractAuthorizationProposal': + return Any.fromPartial({ + typeUrl: + '/publicawesome.stargaze.globalfee.v1.RemoveContractAuthorizationProposal', + value: RemoveContractAuthorizationProposal.encode( + RemoveContractAuthorizationProposal.fromPartial( + RemoveContractAuthorizationProposal.fromAmino(content.value) + ) + ).finish(), + }) + case '/regen.ecocredit.marketplace.v1.AllowDenomProposal': + return Any.fromPartial({ + typeUrl: '/regen.ecocredit.marketplace.v1.AllowDenomProposal', + value: AllowDenomProposal.encode( + AllowDenomProposal.fromPartial( + AllowDenomProposal.fromAmino(content.value) + ) + ).finish(), + }) + case '/regen.ecocredit.v1.CreditTypeProposal': + return Any.fromPartial({ + typeUrl: '/regen.ecocredit.v1.CreditTypeProposal', + value: CreditTypeProposal.encode( + CreditTypeProposal.fromPartial( + CreditTypeProposal.fromAmino(content.value) + ) + ).finish(), + }) + default: + return Any.fromAmino(content) + } +} +export const Cosmos_govv1beta1Content_ToAmino = ( + content: Any, + useInterfaces: boolean = false +) => { + switch (content.typeUrl) { + case '/alliance.alliance.MsgCreateAllianceProposal': + return { + type: '/alliance.alliance.MsgCreateAllianceProposal', + value: MsgCreateAllianceProposal.toAmino( + MsgCreateAllianceProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/alliance.alliance.MsgUpdateAllianceProposal': + return { + type: '/alliance.alliance.MsgUpdateAllianceProposal', + value: MsgUpdateAllianceProposal.toAmino( + MsgUpdateAllianceProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/alliance.alliance.MsgDeleteAllianceProposal': + return { + type: '/alliance.alliance.MsgDeleteAllianceProposal', + value: MsgDeleteAllianceProposal.toAmino( + MsgDeleteAllianceProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/cosmos.distribution.v1beta1.CommunityPoolSpendProposal': + return { + type: 'cosmos-sdk/v1/CommunityPoolSpendProposal', + value: CommunityPoolSpendProposal.toAmino( + CommunityPoolSpendProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit': + return { + type: 'cosmos-sdk/v1/CommunityPoolSpendProposalWithDeposit', + value: CommunityPoolSpendProposalWithDeposit.toAmino( + CommunityPoolSpendProposalWithDeposit.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/cosmos.gov.v1beta1.TextProposal': + return { + type: 'cosmos-sdk/TextProposal', + value: TextProposal.toAmino( + TextProposal.decode(content.value, undefined, useInterfaces), + useInterfaces + ), + } + case '/cosmos.params.v1beta1.ParameterChangeProposal': + return { + type: 'cosmos-sdk/ParameterChangeProposal', + value: ParameterChangeProposal.toAmino( + ParameterChangeProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal': + return { + type: 'cosmos-sdk/SoftwareUpgradeProposal', + value: SoftwareUpgradeProposal.toAmino( + SoftwareUpgradeProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal': + return { + type: 'cosmos-sdk/CancelSoftwareUpgradeProposal', + value: CancelSoftwareUpgradeProposal.toAmino( + CancelSoftwareUpgradeProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/cosmwasm.wasm.v1.StoreCodeProposal': + return { + type: 'wasm/StoreCodeProposal', + value: StoreCodeProposal.toAmino( + StoreCodeProposal.decode(content.value, undefined, useInterfaces), + useInterfaces + ), + } + case '/cosmwasm.wasm.v1.InstantiateContractProposal': + return { + type: 'wasm/InstantiateContractProposal', + value: InstantiateContractProposal.toAmino( + InstantiateContractProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/cosmwasm.wasm.v1.InstantiateContract2Proposal': + return { + type: 'wasm/InstantiateContract2Proposal', + value: InstantiateContract2Proposal.toAmino( + InstantiateContract2Proposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/cosmwasm.wasm.v1.MigrateContractProposal': + return { + type: 'wasm/MigrateContractProposal', + value: MigrateContractProposal.toAmino( + MigrateContractProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/cosmwasm.wasm.v1.SudoContractProposal': + return { + type: 'wasm/SudoContractProposal', + value: SudoContractProposal.toAmino( + SudoContractProposal.decode(content.value, undefined, useInterfaces), + useInterfaces + ), + } + case '/cosmwasm.wasm.v1.ExecuteContractProposal': + return { + type: 'wasm/ExecuteContractProposal', + value: ExecuteContractProposal.toAmino( + ExecuteContractProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/cosmwasm.wasm.v1.UpdateAdminProposal': + return { + type: 'wasm/UpdateAdminProposal', + value: UpdateAdminProposal.toAmino( + UpdateAdminProposal.decode(content.value, undefined, useInterfaces), + useInterfaces + ), + } + case '/cosmwasm.wasm.v1.ClearAdminProposal': + return { + type: 'wasm/ClearAdminProposal', + value: ClearAdminProposal.toAmino( + ClearAdminProposal.decode(content.value, undefined, useInterfaces), + useInterfaces + ), + } + case '/cosmwasm.wasm.v1.PinCodesProposal': + return { + type: 'wasm/PinCodesProposal', + value: PinCodesProposal.toAmino( + PinCodesProposal.decode(content.value, undefined, useInterfaces), + useInterfaces + ), + } + case '/cosmwasm.wasm.v1.UnpinCodesProposal': + return { + type: 'wasm/UnpinCodesProposal', + value: UnpinCodesProposal.toAmino( + UnpinCodesProposal.decode(content.value, undefined, useInterfaces), + useInterfaces + ), + } + case '/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal': + return { + type: 'wasm/UpdateInstantiateConfigProposal', + value: UpdateInstantiateConfigProposal.toAmino( + UpdateInstantiateConfigProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal': + return { + type: 'wasm/StoreAndInstantiateContractProposal', + value: StoreAndInstantiateContractProposal.toAmino( + StoreAndInstantiateContractProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/ibc.core.client.v1.ClientUpdateProposal': + return { + type: 'cosmos-sdk/ClientUpdateProposal', + value: ClientUpdateProposal.toAmino( + ClientUpdateProposal.decode(content.value, undefined, useInterfaces), + useInterfaces + ), + } + case '/ibc.core.client.v1.UpgradeProposal': + return { + type: 'cosmos-sdk/UpgradeProposal', + value: UpgradeProposal.toAmino( + UpgradeProposal.decode(content.value, undefined, useInterfaces), + useInterfaces + ), + } + case '/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal': + return { + type: 'osmosis/ReplaceMigrationRecordsProposal', + value: ReplaceMigrationRecordsProposal.toAmino( + ReplaceMigrationRecordsProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal': + return { + type: 'osmosis/UpdateMigrationRecordsProposal', + value: UpdateMigrationRecordsProposal.toAmino( + UpdateMigrationRecordsProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal': + return { + type: 'osmosis/CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal', + value: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.toAmino( + CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal': + return { + type: 'osmosis/SetScalingFactorControllerProposal', + value: SetScalingFactorControllerProposal.toAmino( + SetScalingFactorControllerProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/osmosis.incentives.CreateGroupsProposal': + return { + type: 'osmosis/incentives/create-groups-proposal', + value: CreateGroupsProposal.toAmino( + CreateGroupsProposal.decode(content.value, undefined, useInterfaces), + useInterfaces + ), + } + case '/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal': + return { + type: 'osmosis/ReplacePoolIncentivesProposal', + value: ReplacePoolIncentivesProposal.toAmino( + ReplacePoolIncentivesProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal': + return { + type: 'osmosis/UpdatePoolIncentivesProposal', + value: UpdatePoolIncentivesProposal.toAmino( + UpdatePoolIncentivesProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal': + return { + type: 'osmosis/SetProtoRevEnabledProposal', + value: SetProtoRevEnabledProposal.toAmino( + SetProtoRevEnabledProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal': + return { + type: 'osmosis/SetProtoRevAdminAccountProposal', + value: SetProtoRevAdminAccountProposal.toAmino( + SetProtoRevAdminAccountProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal': + return { + type: 'osmosis/set-superfluid-assets-proposal', + value: SetSuperfluidAssetsProposal.toAmino( + SetSuperfluidAssetsProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal': + return { + type: 'osmosis/del-superfluid-assets-proposal', + value: RemoveSuperfluidAssetsProposal.toAmino( + RemoveSuperfluidAssetsProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal': + return { + type: 'osmosis/update-unpool-whitelist', + value: UpdateUnpoolWhiteListProposal.toAmino( + UpdateUnpoolWhiteListProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/osmosis.txfees.v1beta1.UpdateFeeTokenProposal': + return { + type: 'osmosis/UpdateFeeTokenProposal', + value: UpdateFeeTokenProposal.toAmino( + UpdateFeeTokenProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/publicawesome.stargaze.cron.v1.PromoteToPrivilegedContractProposal': + return { + type: '/publicawesome.stargaze.cron.v1.PromoteToPrivilegedContractProposal', + value: PromoteToPrivilegedContractProposal.toAmino( + PromoteToPrivilegedContractProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/publicawesome.stargaze.cron.v1.DemotePrivilegedContractProposal': + return { + type: '/publicawesome.stargaze.cron.v1.DemotePrivilegedContractProposal', + value: DemotePrivilegedContractProposal.toAmino( + DemotePrivilegedContractProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/publicawesome.stargaze.globalfee.v1.SetCodeAuthorizationProposal': + return { + type: '/publicawesome.stargaze.globalfee.v1.SetCodeAuthorizationProposal', + value: SetCodeAuthorizationProposal.toAmino( + SetCodeAuthorizationProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/publicawesome.stargaze.globalfee.v1.RemoveCodeAuthorizationProposal': + return { + type: '/publicawesome.stargaze.globalfee.v1.RemoveCodeAuthorizationProposal', + value: RemoveCodeAuthorizationProposal.toAmino( + RemoveCodeAuthorizationProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/publicawesome.stargaze.globalfee.v1.SetContractAuthorizationProposal': + return { + type: '/publicawesome.stargaze.globalfee.v1.SetContractAuthorizationProposal', + value: SetContractAuthorizationProposal.toAmino( + SetContractAuthorizationProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/publicawesome.stargaze.globalfee.v1.RemoveContractAuthorizationProposal': + return { + type: '/publicawesome.stargaze.globalfee.v1.RemoveContractAuthorizationProposal', + value: RemoveContractAuthorizationProposal.toAmino( + RemoveContractAuthorizationProposal.decode( + content.value, + undefined, + useInterfaces + ), + useInterfaces + ), + } + case '/regen.ecocredit.marketplace.v1.AllowDenomProposal': + return { + type: '/regen.ecocredit.marketplace.v1.AllowDenomProposal', + value: AllowDenomProposal.toAmino( + AllowDenomProposal.decode(content.value, undefined, useInterfaces), + useInterfaces + ), + } + case '/regen.ecocredit.v1.CreditTypeProposal': + return { + type: '/regen.ecocredit.v1.CreditTypeProposal', + value: CreditTypeProposal.toAmino( + CreditTypeProposal.decode(content.value, undefined, useInterfaces), + useInterfaces + ), + } + default: + return Any.toAmino(content, useInterfaces) + } +} diff --git a/packages/utils/protobuf/codegen/cosmos/gov/v1beta1/genesis.ts b/packages/types/protobuf/codegen/cosmos/gov/v1beta1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/gov/v1beta1/genesis.ts rename to packages/types/protobuf/codegen/cosmos/gov/v1beta1/genesis.ts diff --git a/packages/utils/protobuf/codegen/cosmos/gov/v1beta1/gov.ts b/packages/types/protobuf/codegen/cosmos/gov/v1beta1/gov.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/gov/v1beta1/gov.ts rename to packages/types/protobuf/codegen/cosmos/gov/v1beta1/gov.ts diff --git a/packages/utils/protobuf/codegen/cosmos/gov/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/cosmos/gov/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/gov/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/cosmos/gov/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/gov/v1beta1/query.ts b/packages/types/protobuf/codegen/cosmos/gov/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/gov/v1beta1/query.ts rename to packages/types/protobuf/codegen/cosmos/gov/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/gov/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/cosmos/gov/v1beta1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/gov/v1beta1/tx.amino.ts rename to packages/types/protobuf/codegen/cosmos/gov/v1beta1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/cosmos/gov/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/cosmos/gov/v1beta1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/gov/v1beta1/tx.registry.ts rename to packages/types/protobuf/codegen/cosmos/gov/v1beta1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/cosmos/gov/v1beta1/tx.ts b/packages/types/protobuf/codegen/cosmos/gov/v1beta1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/gov/v1beta1/tx.ts rename to packages/types/protobuf/codegen/cosmos/gov/v1beta1/tx.ts diff --git a/packages/utils/protobuf/codegen/cosmos/mint/v1beta1/genesis.ts b/packages/types/protobuf/codegen/cosmos/mint/v1beta1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/mint/v1beta1/genesis.ts rename to packages/types/protobuf/codegen/cosmos/mint/v1beta1/genesis.ts diff --git a/packages/utils/protobuf/codegen/cosmos/mint/v1beta1/mint.ts b/packages/types/protobuf/codegen/cosmos/mint/v1beta1/mint.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/mint/v1beta1/mint.ts rename to packages/types/protobuf/codegen/cosmos/mint/v1beta1/mint.ts diff --git a/packages/utils/protobuf/codegen/cosmos/mint/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/cosmos/mint/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/mint/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/cosmos/mint/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/mint/v1beta1/query.ts b/packages/types/protobuf/codegen/cosmos/mint/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/mint/v1beta1/query.ts rename to packages/types/protobuf/codegen/cosmos/mint/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/mint/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/cosmos/mint/v1beta1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/mint/v1beta1/tx.amino.ts rename to packages/types/protobuf/codegen/cosmos/mint/v1beta1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/cosmos/mint/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/cosmos/mint/v1beta1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/mint/v1beta1/tx.registry.ts rename to packages/types/protobuf/codegen/cosmos/mint/v1beta1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/cosmos/mint/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/cosmos/mint/v1beta1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/mint/v1beta1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/cosmos/mint/v1beta1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/cosmos/mint/v1beta1/tx.ts b/packages/types/protobuf/codegen/cosmos/mint/v1beta1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/mint/v1beta1/tx.ts rename to packages/types/protobuf/codegen/cosmos/mint/v1beta1/tx.ts diff --git a/packages/utils/protobuf/codegen/cosmos/msg/v1/msg.ts b/packages/types/protobuf/codegen/cosmos/msg/v1/msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/msg/v1/msg.ts rename to packages/types/protobuf/codegen/cosmos/msg/v1/msg.ts diff --git a/packages/utils/protobuf/codegen/cosmos/orm/v1/orm.ts b/packages/types/protobuf/codegen/cosmos/orm/v1/orm.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/orm/v1/orm.ts rename to packages/types/protobuf/codegen/cosmos/orm/v1/orm.ts diff --git a/packages/utils/protobuf/codegen/cosmos/params/v1beta1/params.ts b/packages/types/protobuf/codegen/cosmos/params/v1beta1/params.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/params/v1beta1/params.ts rename to packages/types/protobuf/codegen/cosmos/params/v1beta1/params.ts diff --git a/packages/utils/protobuf/codegen/cosmos/params/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/cosmos/params/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/params/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/cosmos/params/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/params/v1beta1/query.ts b/packages/types/protobuf/codegen/cosmos/params/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/params/v1beta1/query.ts rename to packages/types/protobuf/codegen/cosmos/params/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/query/v1/query.ts b/packages/types/protobuf/codegen/cosmos/query/v1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/query/v1/query.ts rename to packages/types/protobuf/codegen/cosmos/query/v1/query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/rpc.query.ts b/packages/types/protobuf/codegen/cosmos/rpc.query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/rpc.query.ts rename to packages/types/protobuf/codegen/cosmos/rpc.query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/rpc.tx.ts b/packages/types/protobuf/codegen/cosmos/rpc.tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/rpc.tx.ts rename to packages/types/protobuf/codegen/cosmos/rpc.tx.ts diff --git a/packages/utils/protobuf/codegen/cosmos/slashing/v1beta1/genesis.ts b/packages/types/protobuf/codegen/cosmos/slashing/v1beta1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/slashing/v1beta1/genesis.ts rename to packages/types/protobuf/codegen/cosmos/slashing/v1beta1/genesis.ts diff --git a/packages/utils/protobuf/codegen/cosmos/slashing/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/cosmos/slashing/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/slashing/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/cosmos/slashing/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/slashing/v1beta1/query.ts b/packages/types/protobuf/codegen/cosmos/slashing/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/slashing/v1beta1/query.ts rename to packages/types/protobuf/codegen/cosmos/slashing/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/slashing/v1beta1/slashing.ts b/packages/types/protobuf/codegen/cosmos/slashing/v1beta1/slashing.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/slashing/v1beta1/slashing.ts rename to packages/types/protobuf/codegen/cosmos/slashing/v1beta1/slashing.ts diff --git a/packages/utils/protobuf/codegen/cosmos/slashing/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/cosmos/slashing/v1beta1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/slashing/v1beta1/tx.amino.ts rename to packages/types/protobuf/codegen/cosmos/slashing/v1beta1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/cosmos/slashing/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/cosmos/slashing/v1beta1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/slashing/v1beta1/tx.registry.ts rename to packages/types/protobuf/codegen/cosmos/slashing/v1beta1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/cosmos/slashing/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/cosmos/slashing/v1beta1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/slashing/v1beta1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/cosmos/slashing/v1beta1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/cosmos/slashing/v1beta1/tx.ts b/packages/types/protobuf/codegen/cosmos/slashing/v1beta1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/slashing/v1beta1/tx.ts rename to packages/types/protobuf/codegen/cosmos/slashing/v1beta1/tx.ts diff --git a/packages/utils/protobuf/codegen/cosmos/staking/v1beta1/authz.ts b/packages/types/protobuf/codegen/cosmos/staking/v1beta1/authz.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/staking/v1beta1/authz.ts rename to packages/types/protobuf/codegen/cosmos/staking/v1beta1/authz.ts diff --git a/packages/utils/protobuf/codegen/cosmos/staking/v1beta1/genesis.ts b/packages/types/protobuf/codegen/cosmos/staking/v1beta1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/staking/v1beta1/genesis.ts rename to packages/types/protobuf/codegen/cosmos/staking/v1beta1/genesis.ts diff --git a/packages/utils/protobuf/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/staking/v1beta1/query.ts b/packages/types/protobuf/codegen/cosmos/staking/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/staking/v1beta1/query.ts rename to packages/types/protobuf/codegen/cosmos/staking/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/staking/v1beta1/staking.ts b/packages/types/protobuf/codegen/cosmos/staking/v1beta1/staking.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/staking/v1beta1/staking.ts rename to packages/types/protobuf/codegen/cosmos/staking/v1beta1/staking.ts diff --git a/packages/utils/protobuf/codegen/cosmos/staking/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/cosmos/staking/v1beta1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/staking/v1beta1/tx.amino.ts rename to packages/types/protobuf/codegen/cosmos/staking/v1beta1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/cosmos/staking/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/cosmos/staking/v1beta1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/staking/v1beta1/tx.registry.ts rename to packages/types/protobuf/codegen/cosmos/staking/v1beta1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/cosmos/staking/v1beta1/tx.ts b/packages/types/protobuf/codegen/cosmos/staking/v1beta1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/staking/v1beta1/tx.ts rename to packages/types/protobuf/codegen/cosmos/staking/v1beta1/tx.ts diff --git a/packages/utils/protobuf/codegen/cosmos/tx/signing/v1beta1/signing.ts b/packages/types/protobuf/codegen/cosmos/tx/signing/v1beta1/signing.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/tx/signing/v1beta1/signing.ts rename to packages/types/protobuf/codegen/cosmos/tx/signing/v1beta1/signing.ts diff --git a/packages/utils/protobuf/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts b/packages/types/protobuf/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts rename to packages/types/protobuf/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts diff --git a/packages/utils/protobuf/codegen/cosmos/tx/v1beta1/service.ts b/packages/types/protobuf/codegen/cosmos/tx/v1beta1/service.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/tx/v1beta1/service.ts rename to packages/types/protobuf/codegen/cosmos/tx/v1beta1/service.ts diff --git a/packages/utils/protobuf/codegen/cosmos/tx/v1beta1/tx.ts b/packages/types/protobuf/codegen/cosmos/tx/v1beta1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/tx/v1beta1/tx.ts rename to packages/types/protobuf/codegen/cosmos/tx/v1beta1/tx.ts diff --git a/packages/utils/protobuf/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/upgrade/v1beta1/query.ts b/packages/types/protobuf/codegen/cosmos/upgrade/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/upgrade/v1beta1/query.ts rename to packages/types/protobuf/codegen/cosmos/upgrade/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/cosmos/upgrade/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/cosmos/upgrade/v1beta1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/upgrade/v1beta1/tx.amino.ts rename to packages/types/protobuf/codegen/cosmos/upgrade/v1beta1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/cosmos/upgrade/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/cosmos/upgrade/v1beta1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/upgrade/v1beta1/tx.registry.ts rename to packages/types/protobuf/codegen/cosmos/upgrade/v1beta1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/cosmos/upgrade/v1beta1/tx.ts b/packages/types/protobuf/codegen/cosmos/upgrade/v1beta1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/upgrade/v1beta1/tx.ts rename to packages/types/protobuf/codegen/cosmos/upgrade/v1beta1/tx.ts diff --git a/packages/utils/protobuf/codegen/cosmos/upgrade/v1beta1/upgrade.ts b/packages/types/protobuf/codegen/cosmos/upgrade/v1beta1/upgrade.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos/upgrade/v1beta1/upgrade.ts rename to packages/types/protobuf/codegen/cosmos/upgrade/v1beta1/upgrade.ts diff --git a/packages/utils/protobuf/codegen/cosmos_proto/bundle.ts b/packages/types/protobuf/codegen/cosmos_proto/bundle.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos_proto/bundle.ts rename to packages/types/protobuf/codegen/cosmos_proto/bundle.ts diff --git a/packages/utils/protobuf/codegen/cosmos_proto/cosmos.ts b/packages/types/protobuf/codegen/cosmos_proto/cosmos.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmos_proto/cosmos.ts rename to packages/types/protobuf/codegen/cosmos_proto/cosmos.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/bundle.ts b/packages/types/protobuf/codegen/cosmwasm/bundle.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/bundle.ts rename to packages/types/protobuf/codegen/cosmwasm/bundle.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/client.ts b/packages/types/protobuf/codegen/cosmwasm/client.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/client.ts rename to packages/types/protobuf/codegen/cosmwasm/client.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/rpc.query.ts b/packages/types/protobuf/codegen/cosmwasm/rpc.query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/rpc.query.ts rename to packages/types/protobuf/codegen/cosmwasm/rpc.query.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/rpc.tx.ts b/packages/types/protobuf/codegen/cosmwasm/rpc.tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/rpc.tx.ts rename to packages/types/protobuf/codegen/cosmwasm/rpc.tx.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/authorityMetadata.ts b/packages/types/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/authorityMetadata.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/authorityMetadata.ts rename to packages/types/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/authorityMetadata.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/genesis.ts b/packages/types/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/genesis.ts rename to packages/types/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/genesis.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/params.ts b/packages/types/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/params.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/params.ts rename to packages/types/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/params.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/query.ts b/packages/types/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/query.ts rename to packages/types/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/tx.amino.ts rename to packages/types/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/tx.registry.ts rename to packages/types/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/tx.ts b/packages/types/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/tx.ts rename to packages/types/protobuf/codegen/cosmwasm/tokenfactory/v1beta1/tx.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/wasm/v1/authz.ts b/packages/types/protobuf/codegen/cosmwasm/wasm/v1/authz.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/wasm/v1/authz.ts rename to packages/types/protobuf/codegen/cosmwasm/wasm/v1/authz.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/wasm/v1/genesis.ts b/packages/types/protobuf/codegen/cosmwasm/wasm/v1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/wasm/v1/genesis.ts rename to packages/types/protobuf/codegen/cosmwasm/wasm/v1/genesis.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/wasm/v1/ibc.ts b/packages/types/protobuf/codegen/cosmwasm/wasm/v1/ibc.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/wasm/v1/ibc.ts rename to packages/types/protobuf/codegen/cosmwasm/wasm/v1/ibc.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/wasm/v1/proposal.ts b/packages/types/protobuf/codegen/cosmwasm/wasm/v1/proposal.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/wasm/v1/proposal.ts rename to packages/types/protobuf/codegen/cosmwasm/wasm/v1/proposal.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/wasm/v1/query.rpc.Query.ts b/packages/types/protobuf/codegen/cosmwasm/wasm/v1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/wasm/v1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/cosmwasm/wasm/v1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/wasm/v1/query.ts b/packages/types/protobuf/codegen/cosmwasm/wasm/v1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/wasm/v1/query.ts rename to packages/types/protobuf/codegen/cosmwasm/wasm/v1/query.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/wasm/v1/tx.amino.ts b/packages/types/protobuf/codegen/cosmwasm/wasm/v1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/wasm/v1/tx.amino.ts rename to packages/types/protobuf/codegen/cosmwasm/wasm/v1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/wasm/v1/tx.registry.ts b/packages/types/protobuf/codegen/cosmwasm/wasm/v1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/wasm/v1/tx.registry.ts rename to packages/types/protobuf/codegen/cosmwasm/wasm/v1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/wasm/v1/tx.ts b/packages/types/protobuf/codegen/cosmwasm/wasm/v1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/wasm/v1/tx.ts rename to packages/types/protobuf/codegen/cosmwasm/wasm/v1/tx.ts diff --git a/packages/utils/protobuf/codegen/cosmwasm/wasm/v1/types.ts b/packages/types/protobuf/codegen/cosmwasm/wasm/v1/types.ts similarity index 100% rename from packages/utils/protobuf/codegen/cosmwasm/wasm/v1/types.ts rename to packages/types/protobuf/codegen/cosmwasm/wasm/v1/types.ts diff --git a/packages/utils/protobuf/codegen/gaia/bundle.ts b/packages/types/protobuf/codegen/gaia/bundle.ts similarity index 100% rename from packages/utils/protobuf/codegen/gaia/bundle.ts rename to packages/types/protobuf/codegen/gaia/bundle.ts diff --git a/packages/utils/protobuf/codegen/gaia/client.ts b/packages/types/protobuf/codegen/gaia/client.ts similarity index 100% rename from packages/utils/protobuf/codegen/gaia/client.ts rename to packages/types/protobuf/codegen/gaia/client.ts diff --git a/packages/utils/protobuf/codegen/gaia/globalfee/v1beta1/genesis.ts b/packages/types/protobuf/codegen/gaia/globalfee/v1beta1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/gaia/globalfee/v1beta1/genesis.ts rename to packages/types/protobuf/codegen/gaia/globalfee/v1beta1/genesis.ts diff --git a/packages/utils/protobuf/codegen/gaia/globalfee/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/gaia/globalfee/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/gaia/globalfee/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/gaia/globalfee/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/gaia/globalfee/v1beta1/query.ts b/packages/types/protobuf/codegen/gaia/globalfee/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/gaia/globalfee/v1beta1/query.ts rename to packages/types/protobuf/codegen/gaia/globalfee/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/gaia/globalfee/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/gaia/globalfee/v1beta1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/gaia/globalfee/v1beta1/tx.amino.ts rename to packages/types/protobuf/codegen/gaia/globalfee/v1beta1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/gaia/globalfee/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/gaia/globalfee/v1beta1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/gaia/globalfee/v1beta1/tx.registry.ts rename to packages/types/protobuf/codegen/gaia/globalfee/v1beta1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/gaia/globalfee/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/gaia/globalfee/v1beta1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/gaia/globalfee/v1beta1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/gaia/globalfee/v1beta1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/gaia/globalfee/v1beta1/tx.ts b/packages/types/protobuf/codegen/gaia/globalfee/v1beta1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/gaia/globalfee/v1beta1/tx.ts rename to packages/types/protobuf/codegen/gaia/globalfee/v1beta1/tx.ts diff --git a/packages/utils/protobuf/codegen/gaia/rpc.query.ts b/packages/types/protobuf/codegen/gaia/rpc.query.ts similarity index 100% rename from packages/utils/protobuf/codegen/gaia/rpc.query.ts rename to packages/types/protobuf/codegen/gaia/rpc.query.ts diff --git a/packages/utils/protobuf/codegen/gaia/rpc.tx.ts b/packages/types/protobuf/codegen/gaia/rpc.tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/gaia/rpc.tx.ts rename to packages/types/protobuf/codegen/gaia/rpc.tx.ts diff --git a/packages/utils/protobuf/codegen/gogoproto/bundle.ts b/packages/types/protobuf/codegen/gogoproto/bundle.ts similarity index 100% rename from packages/utils/protobuf/codegen/gogoproto/bundle.ts rename to packages/types/protobuf/codegen/gogoproto/bundle.ts diff --git a/packages/utils/protobuf/codegen/gogoproto/gogo.ts b/packages/types/protobuf/codegen/gogoproto/gogo.ts similarity index 100% rename from packages/utils/protobuf/codegen/gogoproto/gogo.ts rename to packages/types/protobuf/codegen/gogoproto/gogo.ts diff --git a/packages/utils/protobuf/codegen/google/api/annotations.ts b/packages/types/protobuf/codegen/google/api/annotations.ts similarity index 100% rename from packages/utils/protobuf/codegen/google/api/annotations.ts rename to packages/types/protobuf/codegen/google/api/annotations.ts diff --git a/packages/utils/protobuf/codegen/google/api/http.ts b/packages/types/protobuf/codegen/google/api/http.ts similarity index 100% rename from packages/utils/protobuf/codegen/google/api/http.ts rename to packages/types/protobuf/codegen/google/api/http.ts diff --git a/packages/utils/protobuf/codegen/google/bundle.ts b/packages/types/protobuf/codegen/google/bundle.ts similarity index 100% rename from packages/utils/protobuf/codegen/google/bundle.ts rename to packages/types/protobuf/codegen/google/bundle.ts diff --git a/packages/utils/protobuf/codegen/google/protobuf/any.ts b/packages/types/protobuf/codegen/google/protobuf/any.ts similarity index 100% rename from packages/utils/protobuf/codegen/google/protobuf/any.ts rename to packages/types/protobuf/codegen/google/protobuf/any.ts diff --git a/packages/utils/protobuf/codegen/google/protobuf/descriptor.ts b/packages/types/protobuf/codegen/google/protobuf/descriptor.ts similarity index 100% rename from packages/utils/protobuf/codegen/google/protobuf/descriptor.ts rename to packages/types/protobuf/codegen/google/protobuf/descriptor.ts diff --git a/packages/utils/protobuf/codegen/google/protobuf/duration.ts b/packages/types/protobuf/codegen/google/protobuf/duration.ts similarity index 100% rename from packages/utils/protobuf/codegen/google/protobuf/duration.ts rename to packages/types/protobuf/codegen/google/protobuf/duration.ts diff --git a/packages/utils/protobuf/codegen/google/protobuf/empty.ts b/packages/types/protobuf/codegen/google/protobuf/empty.ts similarity index 100% rename from packages/utils/protobuf/codegen/google/protobuf/empty.ts rename to packages/types/protobuf/codegen/google/protobuf/empty.ts diff --git a/packages/utils/protobuf/codegen/google/protobuf/timestamp.ts b/packages/types/protobuf/codegen/google/protobuf/timestamp.ts similarity index 100% rename from packages/utils/protobuf/codegen/google/protobuf/timestamp.ts rename to packages/types/protobuf/codegen/google/protobuf/timestamp.ts diff --git a/packages/utils/protobuf/codegen/helpers.ts b/packages/types/protobuf/codegen/helpers.ts similarity index 100% rename from packages/utils/protobuf/codegen/helpers.ts rename to packages/types/protobuf/codegen/helpers.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/controller.ts b/packages/types/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/controller.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/controller.ts rename to packages/types/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/controller.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/query.rpc.Query.ts b/packages/types/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/query.ts b/packages/types/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/query.ts rename to packages/types/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/query.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts b/packages/types/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts rename to packages/types/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts b/packages/types/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts rename to packages/types/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx.ts b/packages/types/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx.ts rename to packages/types/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/host.ts b/packages/types/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/host.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/host.ts rename to packages/types/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/host.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/query.rpc.Query.ts b/packages/types/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/query.ts b/packages/types/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/query.ts rename to packages/types/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/query.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/tx.amino.ts b/packages/types/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/tx.amino.ts rename to packages/types/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/tx.registry.ts b/packages/types/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/tx.registry.ts rename to packages/types/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/tx.ts b/packages/types/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/tx.ts rename to packages/types/protobuf/codegen/ibc/applications/interchain_accounts/host/v1/tx.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/v1/account.ts b/packages/types/protobuf/codegen/ibc/applications/interchain_accounts/v1/account.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/v1/account.ts rename to packages/types/protobuf/codegen/ibc/applications/interchain_accounts/v1/account.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/v1/metadata.ts b/packages/types/protobuf/codegen/ibc/applications/interchain_accounts/v1/metadata.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/v1/metadata.ts rename to packages/types/protobuf/codegen/ibc/applications/interchain_accounts/v1/metadata.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/v1/packet.ts b/packages/types/protobuf/codegen/ibc/applications/interchain_accounts/v1/packet.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/interchain_accounts/v1/packet.ts rename to packages/types/protobuf/codegen/ibc/applications/interchain_accounts/v1/packet.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/transfer/v1/authz.ts b/packages/types/protobuf/codegen/ibc/applications/transfer/v1/authz.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/transfer/v1/authz.ts rename to packages/types/protobuf/codegen/ibc/applications/transfer/v1/authz.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/transfer/v1/genesis.ts b/packages/types/protobuf/codegen/ibc/applications/transfer/v1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/transfer/v1/genesis.ts rename to packages/types/protobuf/codegen/ibc/applications/transfer/v1/genesis.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/transfer/v1/query.rpc.Query.ts b/packages/types/protobuf/codegen/ibc/applications/transfer/v1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/transfer/v1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/ibc/applications/transfer/v1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/transfer/v1/query.ts b/packages/types/protobuf/codegen/ibc/applications/transfer/v1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/transfer/v1/query.ts rename to packages/types/protobuf/codegen/ibc/applications/transfer/v1/query.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/transfer/v1/transfer.ts b/packages/types/protobuf/codegen/ibc/applications/transfer/v1/transfer.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/transfer/v1/transfer.ts rename to packages/types/protobuf/codegen/ibc/applications/transfer/v1/transfer.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/transfer/v1/tx.amino.ts b/packages/types/protobuf/codegen/ibc/applications/transfer/v1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/transfer/v1/tx.amino.ts rename to packages/types/protobuf/codegen/ibc/applications/transfer/v1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/transfer/v1/tx.registry.ts b/packages/types/protobuf/codegen/ibc/applications/transfer/v1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/transfer/v1/tx.registry.ts rename to packages/types/protobuf/codegen/ibc/applications/transfer/v1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/transfer/v1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/ibc/applications/transfer/v1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/transfer/v1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/ibc/applications/transfer/v1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/ibc/applications/transfer/v1/tx.ts b/packages/types/protobuf/codegen/ibc/applications/transfer/v1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/applications/transfer/v1/tx.ts rename to packages/types/protobuf/codegen/ibc/applications/transfer/v1/tx.ts diff --git a/packages/utils/protobuf/codegen/ibc/bundle.ts b/packages/types/protobuf/codegen/ibc/bundle.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/bundle.ts rename to packages/types/protobuf/codegen/ibc/bundle.ts diff --git a/packages/utils/protobuf/codegen/ibc/client.ts b/packages/types/protobuf/codegen/ibc/client.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/client.ts rename to packages/types/protobuf/codegen/ibc/client.ts diff --git a/packages/utils/protobuf/codegen/ibc/core/channel/v1/channel.ts b/packages/types/protobuf/codegen/ibc/core/channel/v1/channel.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/core/channel/v1/channel.ts rename to packages/types/protobuf/codegen/ibc/core/channel/v1/channel.ts diff --git a/packages/utils/protobuf/codegen/ibc/core/channel/v1/genesis.ts b/packages/types/protobuf/codegen/ibc/core/channel/v1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/core/channel/v1/genesis.ts rename to packages/types/protobuf/codegen/ibc/core/channel/v1/genesis.ts diff --git a/packages/utils/protobuf/codegen/ibc/core/channel/v1/query.rpc.Query.ts b/packages/types/protobuf/codegen/ibc/core/channel/v1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/core/channel/v1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/ibc/core/channel/v1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/ibc/core/channel/v1/query.ts b/packages/types/protobuf/codegen/ibc/core/channel/v1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/core/channel/v1/query.ts rename to packages/types/protobuf/codegen/ibc/core/channel/v1/query.ts diff --git a/packages/utils/protobuf/codegen/ibc/core/channel/v1/tx.amino.ts b/packages/types/protobuf/codegen/ibc/core/channel/v1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/core/channel/v1/tx.amino.ts rename to packages/types/protobuf/codegen/ibc/core/channel/v1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/ibc/core/channel/v1/tx.registry.ts b/packages/types/protobuf/codegen/ibc/core/channel/v1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/core/channel/v1/tx.registry.ts rename to packages/types/protobuf/codegen/ibc/core/channel/v1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/ibc/core/channel/v1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/ibc/core/channel/v1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/core/channel/v1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/ibc/core/channel/v1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/ibc/core/channel/v1/tx.ts b/packages/types/protobuf/codegen/ibc/core/channel/v1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/core/channel/v1/tx.ts rename to packages/types/protobuf/codegen/ibc/core/channel/v1/tx.ts diff --git a/packages/utils/protobuf/codegen/ibc/core/client/v1/client.ts b/packages/types/protobuf/codegen/ibc/core/client/v1/client.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/core/client/v1/client.ts rename to packages/types/protobuf/codegen/ibc/core/client/v1/client.ts diff --git a/packages/utils/protobuf/codegen/ibc/rpc.query.ts b/packages/types/protobuf/codegen/ibc/rpc.query.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/rpc.query.ts rename to packages/types/protobuf/codegen/ibc/rpc.query.ts diff --git a/packages/utils/protobuf/codegen/ibc/rpc.tx.ts b/packages/types/protobuf/codegen/ibc/rpc.tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/ibc/rpc.tx.ts rename to packages/types/protobuf/codegen/ibc/rpc.tx.ts diff --git a/packages/utils/protobuf/codegen/index.ts b/packages/types/protobuf/codegen/index.ts similarity index 100% rename from packages/utils/protobuf/codegen/index.ts rename to packages/types/protobuf/codegen/index.ts diff --git a/packages/utils/protobuf/codegen/juno/bundle.ts b/packages/types/protobuf/codegen/juno/bundle.ts similarity index 100% rename from packages/utils/protobuf/codegen/juno/bundle.ts rename to packages/types/protobuf/codegen/juno/bundle.ts diff --git a/packages/utils/protobuf/codegen/juno/client.ts b/packages/types/protobuf/codegen/juno/client.ts similarity index 100% rename from packages/utils/protobuf/codegen/juno/client.ts rename to packages/types/protobuf/codegen/juno/client.ts diff --git a/packages/utils/protobuf/codegen/juno/feeshare/v1/feeshare.ts b/packages/types/protobuf/codegen/juno/feeshare/v1/feeshare.ts similarity index 100% rename from packages/utils/protobuf/codegen/juno/feeshare/v1/feeshare.ts rename to packages/types/protobuf/codegen/juno/feeshare/v1/feeshare.ts diff --git a/packages/utils/protobuf/codegen/juno/feeshare/v1/genesis.ts b/packages/types/protobuf/codegen/juno/feeshare/v1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/juno/feeshare/v1/genesis.ts rename to packages/types/protobuf/codegen/juno/feeshare/v1/genesis.ts diff --git a/packages/utils/protobuf/codegen/juno/feeshare/v1/query.rpc.Query.ts b/packages/types/protobuf/codegen/juno/feeshare/v1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/juno/feeshare/v1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/juno/feeshare/v1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/juno/feeshare/v1/query.ts b/packages/types/protobuf/codegen/juno/feeshare/v1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/juno/feeshare/v1/query.ts rename to packages/types/protobuf/codegen/juno/feeshare/v1/query.ts diff --git a/packages/utils/protobuf/codegen/juno/feeshare/v1/tx.amino.ts b/packages/types/protobuf/codegen/juno/feeshare/v1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/juno/feeshare/v1/tx.amino.ts rename to packages/types/protobuf/codegen/juno/feeshare/v1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/juno/feeshare/v1/tx.registry.ts b/packages/types/protobuf/codegen/juno/feeshare/v1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/juno/feeshare/v1/tx.registry.ts rename to packages/types/protobuf/codegen/juno/feeshare/v1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/juno/feeshare/v1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/juno/feeshare/v1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/juno/feeshare/v1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/juno/feeshare/v1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/juno/feeshare/v1/tx.ts b/packages/types/protobuf/codegen/juno/feeshare/v1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/juno/feeshare/v1/tx.ts rename to packages/types/protobuf/codegen/juno/feeshare/v1/tx.ts diff --git a/packages/utils/protobuf/codegen/juno/mint/genesis.ts b/packages/types/protobuf/codegen/juno/mint/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/juno/mint/genesis.ts rename to packages/types/protobuf/codegen/juno/mint/genesis.ts diff --git a/packages/utils/protobuf/codegen/juno/mint/mint.ts b/packages/types/protobuf/codegen/juno/mint/mint.ts similarity index 100% rename from packages/utils/protobuf/codegen/juno/mint/mint.ts rename to packages/types/protobuf/codegen/juno/mint/mint.ts diff --git a/packages/utils/protobuf/codegen/juno/mint/query.rpc.Query.ts b/packages/types/protobuf/codegen/juno/mint/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/juno/mint/query.rpc.Query.ts rename to packages/types/protobuf/codegen/juno/mint/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/juno/mint/query.ts b/packages/types/protobuf/codegen/juno/mint/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/juno/mint/query.ts rename to packages/types/protobuf/codegen/juno/mint/query.ts diff --git a/packages/utils/protobuf/codegen/juno/mint/tx.amino.ts b/packages/types/protobuf/codegen/juno/mint/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/juno/mint/tx.amino.ts rename to packages/types/protobuf/codegen/juno/mint/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/juno/mint/tx.registry.ts b/packages/types/protobuf/codegen/juno/mint/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/juno/mint/tx.registry.ts rename to packages/types/protobuf/codegen/juno/mint/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/juno/mint/tx.rpc.msg.ts b/packages/types/protobuf/codegen/juno/mint/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/juno/mint/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/juno/mint/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/juno/mint/tx.ts b/packages/types/protobuf/codegen/juno/mint/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/juno/mint/tx.ts rename to packages/types/protobuf/codegen/juno/mint/tx.ts diff --git a/packages/utils/protobuf/codegen/juno/rpc.query.ts b/packages/types/protobuf/codegen/juno/rpc.query.ts similarity index 100% rename from packages/utils/protobuf/codegen/juno/rpc.query.ts rename to packages/types/protobuf/codegen/juno/rpc.query.ts diff --git a/packages/utils/protobuf/codegen/juno/rpc.tx.ts b/packages/types/protobuf/codegen/juno/rpc.tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/juno/rpc.tx.ts rename to packages/types/protobuf/codegen/juno/rpc.tx.ts diff --git a/packages/utils/protobuf/codegen/neutron/bundle.ts b/packages/types/protobuf/codegen/neutron/bundle.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/bundle.ts rename to packages/types/protobuf/codegen/neutron/bundle.ts diff --git a/packages/utils/protobuf/codegen/neutron/client.ts b/packages/types/protobuf/codegen/neutron/client.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/client.ts rename to packages/types/protobuf/codegen/neutron/client.ts diff --git a/packages/utils/protobuf/codegen/neutron/contractmanager/failure.ts b/packages/types/protobuf/codegen/neutron/contractmanager/failure.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/contractmanager/failure.ts rename to packages/types/protobuf/codegen/neutron/contractmanager/failure.ts diff --git a/packages/utils/protobuf/codegen/neutron/contractmanager/genesis.ts b/packages/types/protobuf/codegen/neutron/contractmanager/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/contractmanager/genesis.ts rename to packages/types/protobuf/codegen/neutron/contractmanager/genesis.ts diff --git a/packages/utils/protobuf/codegen/neutron/contractmanager/params.ts b/packages/types/protobuf/codegen/neutron/contractmanager/params.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/contractmanager/params.ts rename to packages/types/protobuf/codegen/neutron/contractmanager/params.ts diff --git a/packages/utils/protobuf/codegen/neutron/contractmanager/query.rpc.Query.ts b/packages/types/protobuf/codegen/neutron/contractmanager/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/contractmanager/query.rpc.Query.ts rename to packages/types/protobuf/codegen/neutron/contractmanager/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/neutron/contractmanager/query.ts b/packages/types/protobuf/codegen/neutron/contractmanager/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/contractmanager/query.ts rename to packages/types/protobuf/codegen/neutron/contractmanager/query.ts diff --git a/packages/utils/protobuf/codegen/neutron/contractmanager/tx.amino.ts b/packages/types/protobuf/codegen/neutron/contractmanager/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/contractmanager/tx.amino.ts rename to packages/types/protobuf/codegen/neutron/contractmanager/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/neutron/contractmanager/tx.registry.ts b/packages/types/protobuf/codegen/neutron/contractmanager/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/contractmanager/tx.registry.ts rename to packages/types/protobuf/codegen/neutron/contractmanager/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/neutron/contractmanager/tx.rpc.msg.ts b/packages/types/protobuf/codegen/neutron/contractmanager/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/contractmanager/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/neutron/contractmanager/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/neutron/contractmanager/tx.ts b/packages/types/protobuf/codegen/neutron/contractmanager/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/contractmanager/tx.ts rename to packages/types/protobuf/codegen/neutron/contractmanager/tx.ts diff --git a/packages/utils/protobuf/codegen/neutron/contractmanager/v1/failure.ts b/packages/types/protobuf/codegen/neutron/contractmanager/v1/failure.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/contractmanager/v1/failure.ts rename to packages/types/protobuf/codegen/neutron/contractmanager/v1/failure.ts diff --git a/packages/utils/protobuf/codegen/neutron/cron/genesis.ts b/packages/types/protobuf/codegen/neutron/cron/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/cron/genesis.ts rename to packages/types/protobuf/codegen/neutron/cron/genesis.ts diff --git a/packages/utils/protobuf/codegen/neutron/cron/params.ts b/packages/types/protobuf/codegen/neutron/cron/params.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/cron/params.ts rename to packages/types/protobuf/codegen/neutron/cron/params.ts diff --git a/packages/utils/protobuf/codegen/neutron/cron/query.rpc.Query.ts b/packages/types/protobuf/codegen/neutron/cron/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/cron/query.rpc.Query.ts rename to packages/types/protobuf/codegen/neutron/cron/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/neutron/cron/query.ts b/packages/types/protobuf/codegen/neutron/cron/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/cron/query.ts rename to packages/types/protobuf/codegen/neutron/cron/query.ts diff --git a/packages/utils/protobuf/codegen/neutron/cron/schedule.ts b/packages/types/protobuf/codegen/neutron/cron/schedule.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/cron/schedule.ts rename to packages/types/protobuf/codegen/neutron/cron/schedule.ts diff --git a/packages/utils/protobuf/codegen/neutron/cron/tx.amino.ts b/packages/types/protobuf/codegen/neutron/cron/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/cron/tx.amino.ts rename to packages/types/protobuf/codegen/neutron/cron/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/neutron/cron/tx.registry.ts b/packages/types/protobuf/codegen/neutron/cron/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/cron/tx.registry.ts rename to packages/types/protobuf/codegen/neutron/cron/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/neutron/cron/tx.rpc.msg.ts b/packages/types/protobuf/codegen/neutron/cron/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/cron/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/neutron/cron/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/neutron/cron/tx.ts b/packages/types/protobuf/codegen/neutron/cron/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/cron/tx.ts rename to packages/types/protobuf/codegen/neutron/cron/tx.ts diff --git a/packages/utils/protobuf/codegen/neutron/dex/deposit_record.ts b/packages/types/protobuf/codegen/neutron/dex/deposit_record.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/dex/deposit_record.ts rename to packages/types/protobuf/codegen/neutron/dex/deposit_record.ts diff --git a/packages/utils/protobuf/codegen/neutron/dex/genesis.ts b/packages/types/protobuf/codegen/neutron/dex/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/dex/genesis.ts rename to packages/types/protobuf/codegen/neutron/dex/genesis.ts diff --git a/packages/utils/protobuf/codegen/neutron/dex/limit_order_expiration.ts b/packages/types/protobuf/codegen/neutron/dex/limit_order_expiration.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/dex/limit_order_expiration.ts rename to packages/types/protobuf/codegen/neutron/dex/limit_order_expiration.ts diff --git a/packages/utils/protobuf/codegen/neutron/dex/limit_order_tranche.ts b/packages/types/protobuf/codegen/neutron/dex/limit_order_tranche.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/dex/limit_order_tranche.ts rename to packages/types/protobuf/codegen/neutron/dex/limit_order_tranche.ts diff --git a/packages/utils/protobuf/codegen/neutron/dex/limit_order_tranche_user.ts b/packages/types/protobuf/codegen/neutron/dex/limit_order_tranche_user.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/dex/limit_order_tranche_user.ts rename to packages/types/protobuf/codegen/neutron/dex/limit_order_tranche_user.ts diff --git a/packages/utils/protobuf/codegen/neutron/dex/pair_id.ts b/packages/types/protobuf/codegen/neutron/dex/pair_id.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/dex/pair_id.ts rename to packages/types/protobuf/codegen/neutron/dex/pair_id.ts diff --git a/packages/utils/protobuf/codegen/neutron/dex/params.ts b/packages/types/protobuf/codegen/neutron/dex/params.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/dex/params.ts rename to packages/types/protobuf/codegen/neutron/dex/params.ts diff --git a/packages/utils/protobuf/codegen/neutron/dex/pool.ts b/packages/types/protobuf/codegen/neutron/dex/pool.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/dex/pool.ts rename to packages/types/protobuf/codegen/neutron/dex/pool.ts diff --git a/packages/utils/protobuf/codegen/neutron/dex/pool_metadata.ts b/packages/types/protobuf/codegen/neutron/dex/pool_metadata.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/dex/pool_metadata.ts rename to packages/types/protobuf/codegen/neutron/dex/pool_metadata.ts diff --git a/packages/utils/protobuf/codegen/neutron/dex/pool_reserves.ts b/packages/types/protobuf/codegen/neutron/dex/pool_reserves.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/dex/pool_reserves.ts rename to packages/types/protobuf/codegen/neutron/dex/pool_reserves.ts diff --git a/packages/utils/protobuf/codegen/neutron/dex/query.rpc.Query.ts b/packages/types/protobuf/codegen/neutron/dex/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/dex/query.rpc.Query.ts rename to packages/types/protobuf/codegen/neutron/dex/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/neutron/dex/query.ts b/packages/types/protobuf/codegen/neutron/dex/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/dex/query.ts rename to packages/types/protobuf/codegen/neutron/dex/query.ts diff --git a/packages/utils/protobuf/codegen/neutron/dex/tick_liquidity.ts b/packages/types/protobuf/codegen/neutron/dex/tick_liquidity.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/dex/tick_liquidity.ts rename to packages/types/protobuf/codegen/neutron/dex/tick_liquidity.ts diff --git a/packages/utils/protobuf/codegen/neutron/dex/trade_pair_id.ts b/packages/types/protobuf/codegen/neutron/dex/trade_pair_id.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/dex/trade_pair_id.ts rename to packages/types/protobuf/codegen/neutron/dex/trade_pair_id.ts diff --git a/packages/utils/protobuf/codegen/neutron/dex/tx.amino.ts b/packages/types/protobuf/codegen/neutron/dex/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/dex/tx.amino.ts rename to packages/types/protobuf/codegen/neutron/dex/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/neutron/dex/tx.registry.ts b/packages/types/protobuf/codegen/neutron/dex/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/dex/tx.registry.ts rename to packages/types/protobuf/codegen/neutron/dex/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/neutron/dex/tx.rpc.msg.ts b/packages/types/protobuf/codegen/neutron/dex/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/dex/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/neutron/dex/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/neutron/dex/tx.ts b/packages/types/protobuf/codegen/neutron/dex/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/dex/tx.ts rename to packages/types/protobuf/codegen/neutron/dex/tx.ts diff --git a/packages/utils/protobuf/codegen/neutron/feeburner/genesis.ts b/packages/types/protobuf/codegen/neutron/feeburner/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/feeburner/genesis.ts rename to packages/types/protobuf/codegen/neutron/feeburner/genesis.ts diff --git a/packages/utils/protobuf/codegen/neutron/feeburner/params.ts b/packages/types/protobuf/codegen/neutron/feeburner/params.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/feeburner/params.ts rename to packages/types/protobuf/codegen/neutron/feeburner/params.ts diff --git a/packages/utils/protobuf/codegen/neutron/feeburner/query.rpc.Query.ts b/packages/types/protobuf/codegen/neutron/feeburner/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/feeburner/query.rpc.Query.ts rename to packages/types/protobuf/codegen/neutron/feeburner/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/neutron/feeburner/query.ts b/packages/types/protobuf/codegen/neutron/feeburner/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/feeburner/query.ts rename to packages/types/protobuf/codegen/neutron/feeburner/query.ts diff --git a/packages/utils/protobuf/codegen/neutron/feeburner/total_burned_neutrons_amount.ts b/packages/types/protobuf/codegen/neutron/feeburner/total_burned_neutrons_amount.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/feeburner/total_burned_neutrons_amount.ts rename to packages/types/protobuf/codegen/neutron/feeburner/total_burned_neutrons_amount.ts diff --git a/packages/utils/protobuf/codegen/neutron/feeburner/tx.amino.ts b/packages/types/protobuf/codegen/neutron/feeburner/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/feeburner/tx.amino.ts rename to packages/types/protobuf/codegen/neutron/feeburner/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/neutron/feeburner/tx.registry.ts b/packages/types/protobuf/codegen/neutron/feeburner/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/feeburner/tx.registry.ts rename to packages/types/protobuf/codegen/neutron/feeburner/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/neutron/feeburner/tx.rpc.msg.ts b/packages/types/protobuf/codegen/neutron/feeburner/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/feeburner/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/neutron/feeburner/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/neutron/feeburner/tx.ts b/packages/types/protobuf/codegen/neutron/feeburner/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/feeburner/tx.ts rename to packages/types/protobuf/codegen/neutron/feeburner/tx.ts diff --git a/packages/utils/protobuf/codegen/neutron/feerefunder/fee.ts b/packages/types/protobuf/codegen/neutron/feerefunder/fee.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/feerefunder/fee.ts rename to packages/types/protobuf/codegen/neutron/feerefunder/fee.ts diff --git a/packages/utils/protobuf/codegen/neutron/feerefunder/genesis.ts b/packages/types/protobuf/codegen/neutron/feerefunder/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/feerefunder/genesis.ts rename to packages/types/protobuf/codegen/neutron/feerefunder/genesis.ts diff --git a/packages/utils/protobuf/codegen/neutron/feerefunder/params.ts b/packages/types/protobuf/codegen/neutron/feerefunder/params.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/feerefunder/params.ts rename to packages/types/protobuf/codegen/neutron/feerefunder/params.ts diff --git a/packages/utils/protobuf/codegen/neutron/feerefunder/query.rpc.Query.ts b/packages/types/protobuf/codegen/neutron/feerefunder/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/feerefunder/query.rpc.Query.ts rename to packages/types/protobuf/codegen/neutron/feerefunder/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/neutron/feerefunder/query.ts b/packages/types/protobuf/codegen/neutron/feerefunder/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/feerefunder/query.ts rename to packages/types/protobuf/codegen/neutron/feerefunder/query.ts diff --git a/packages/utils/protobuf/codegen/neutron/feerefunder/tx.amino.ts b/packages/types/protobuf/codegen/neutron/feerefunder/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/feerefunder/tx.amino.ts rename to packages/types/protobuf/codegen/neutron/feerefunder/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/neutron/feerefunder/tx.registry.ts b/packages/types/protobuf/codegen/neutron/feerefunder/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/feerefunder/tx.registry.ts rename to packages/types/protobuf/codegen/neutron/feerefunder/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/neutron/feerefunder/tx.rpc.msg.ts b/packages/types/protobuf/codegen/neutron/feerefunder/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/feerefunder/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/neutron/feerefunder/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/neutron/feerefunder/tx.ts b/packages/types/protobuf/codegen/neutron/feerefunder/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/feerefunder/tx.ts rename to packages/types/protobuf/codegen/neutron/feerefunder/tx.ts diff --git a/packages/utils/protobuf/codegen/neutron/interchainqueries/genesis.ts b/packages/types/protobuf/codegen/neutron/interchainqueries/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/interchainqueries/genesis.ts rename to packages/types/protobuf/codegen/neutron/interchainqueries/genesis.ts diff --git a/packages/utils/protobuf/codegen/neutron/interchainqueries/params.ts b/packages/types/protobuf/codegen/neutron/interchainqueries/params.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/interchainqueries/params.ts rename to packages/types/protobuf/codegen/neutron/interchainqueries/params.ts diff --git a/packages/utils/protobuf/codegen/neutron/interchainqueries/query.rpc.Query.ts b/packages/types/protobuf/codegen/neutron/interchainqueries/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/interchainqueries/query.rpc.Query.ts rename to packages/types/protobuf/codegen/neutron/interchainqueries/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/neutron/interchainqueries/query.ts b/packages/types/protobuf/codegen/neutron/interchainqueries/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/interchainqueries/query.ts rename to packages/types/protobuf/codegen/neutron/interchainqueries/query.ts diff --git a/packages/utils/protobuf/codegen/neutron/interchainqueries/tx.amino.ts b/packages/types/protobuf/codegen/neutron/interchainqueries/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/interchainqueries/tx.amino.ts rename to packages/types/protobuf/codegen/neutron/interchainqueries/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/neutron/interchainqueries/tx.registry.ts b/packages/types/protobuf/codegen/neutron/interchainqueries/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/interchainqueries/tx.registry.ts rename to packages/types/protobuf/codegen/neutron/interchainqueries/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/neutron/interchainqueries/tx.rpc.msg.ts b/packages/types/protobuf/codegen/neutron/interchainqueries/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/interchainqueries/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/neutron/interchainqueries/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/neutron/interchainqueries/tx.ts b/packages/types/protobuf/codegen/neutron/interchainqueries/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/interchainqueries/tx.ts rename to packages/types/protobuf/codegen/neutron/interchainqueries/tx.ts diff --git a/packages/utils/protobuf/codegen/neutron/interchaintxs/v1/genesis.ts b/packages/types/protobuf/codegen/neutron/interchaintxs/v1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/interchaintxs/v1/genesis.ts rename to packages/types/protobuf/codegen/neutron/interchaintxs/v1/genesis.ts diff --git a/packages/utils/protobuf/codegen/neutron/interchaintxs/v1/params.ts b/packages/types/protobuf/codegen/neutron/interchaintxs/v1/params.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/interchaintxs/v1/params.ts rename to packages/types/protobuf/codegen/neutron/interchaintxs/v1/params.ts diff --git a/packages/utils/protobuf/codegen/neutron/interchaintxs/v1/query.rpc.Query.ts b/packages/types/protobuf/codegen/neutron/interchaintxs/v1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/interchaintxs/v1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/neutron/interchaintxs/v1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/neutron/interchaintxs/v1/query.ts b/packages/types/protobuf/codegen/neutron/interchaintxs/v1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/interchaintxs/v1/query.ts rename to packages/types/protobuf/codegen/neutron/interchaintxs/v1/query.ts diff --git a/packages/utils/protobuf/codegen/neutron/interchaintxs/v1/tx.amino.ts b/packages/types/protobuf/codegen/neutron/interchaintxs/v1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/interchaintxs/v1/tx.amino.ts rename to packages/types/protobuf/codegen/neutron/interchaintxs/v1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/neutron/interchaintxs/v1/tx.registry.ts b/packages/types/protobuf/codegen/neutron/interchaintxs/v1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/interchaintxs/v1/tx.registry.ts rename to packages/types/protobuf/codegen/neutron/interchaintxs/v1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/neutron/interchaintxs/v1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/neutron/interchaintxs/v1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/interchaintxs/v1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/neutron/interchaintxs/v1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/neutron/interchaintxs/v1/tx.ts b/packages/types/protobuf/codegen/neutron/interchaintxs/v1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/interchaintxs/v1/tx.ts rename to packages/types/protobuf/codegen/neutron/interchaintxs/v1/tx.ts diff --git a/packages/utils/protobuf/codegen/neutron/rpc.query.ts b/packages/types/protobuf/codegen/neutron/rpc.query.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/rpc.query.ts rename to packages/types/protobuf/codegen/neutron/rpc.query.ts diff --git a/packages/utils/protobuf/codegen/neutron/rpc.tx.ts b/packages/types/protobuf/codegen/neutron/rpc.tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/rpc.tx.ts rename to packages/types/protobuf/codegen/neutron/rpc.tx.ts diff --git a/packages/utils/protobuf/codegen/neutron/transfer/v1/query.rpc.Query.ts b/packages/types/protobuf/codegen/neutron/transfer/v1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/transfer/v1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/neutron/transfer/v1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/neutron/transfer/v1/query.ts b/packages/types/protobuf/codegen/neutron/transfer/v1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/transfer/v1/query.ts rename to packages/types/protobuf/codegen/neutron/transfer/v1/query.ts diff --git a/packages/utils/protobuf/codegen/neutron/transfer/v1/tx.amino.ts b/packages/types/protobuf/codegen/neutron/transfer/v1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/transfer/v1/tx.amino.ts rename to packages/types/protobuf/codegen/neutron/transfer/v1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/neutron/transfer/v1/tx.registry.ts b/packages/types/protobuf/codegen/neutron/transfer/v1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/transfer/v1/tx.registry.ts rename to packages/types/protobuf/codegen/neutron/transfer/v1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/neutron/transfer/v1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/neutron/transfer/v1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/transfer/v1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/neutron/transfer/v1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/neutron/transfer/v1/tx.ts b/packages/types/protobuf/codegen/neutron/transfer/v1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/neutron/transfer/v1/tx.ts rename to packages/types/protobuf/codegen/neutron/transfer/v1/tx.ts diff --git a/packages/utils/protobuf/codegen/noble/bundle.ts b/packages/types/protobuf/codegen/noble/bundle.ts similarity index 100% rename from packages/utils/protobuf/codegen/noble/bundle.ts rename to packages/types/protobuf/codegen/noble/bundle.ts diff --git a/packages/utils/protobuf/codegen/noble/rpc.query.ts b/packages/types/protobuf/codegen/noble/rpc.query.ts similarity index 100% rename from packages/utils/protobuf/codegen/noble/rpc.query.ts rename to packages/types/protobuf/codegen/noble/rpc.query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/accum/v1beta1/accum.ts b/packages/types/protobuf/codegen/osmosis/accum/v1beta1/accum.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/accum/v1beta1/accum.ts rename to packages/types/protobuf/codegen/osmosis/accum/v1beta1/accum.ts diff --git a/packages/utils/protobuf/codegen/osmosis/bundle.ts b/packages/types/protobuf/codegen/osmosis/bundle.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/bundle.ts rename to packages/types/protobuf/codegen/osmosis/bundle.ts diff --git a/packages/utils/protobuf/codegen/osmosis/client.ts b/packages/types/protobuf/codegen/osmosis/client.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/client.ts rename to packages/types/protobuf/codegen/osmosis/client.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/genesis.ts b/packages/types/protobuf/codegen/osmosis/concentrated-liquidity/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/genesis.ts rename to packages/types/protobuf/codegen/osmosis/concentrated-liquidity/genesis.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/gov.ts b/packages/types/protobuf/codegen/osmosis/concentrated-liquidity/gov.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/gov.ts rename to packages/types/protobuf/codegen/osmosis/concentrated-liquidity/gov.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/incentive_record.ts b/packages/types/protobuf/codegen/osmosis/concentrated-liquidity/incentive_record.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/incentive_record.ts rename to packages/types/protobuf/codegen/osmosis/concentrated-liquidity/incentive_record.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/params.ts b/packages/types/protobuf/codegen/osmosis/concentrated-liquidity/params.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/params.ts rename to packages/types/protobuf/codegen/osmosis/concentrated-liquidity/params.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.amino.ts b/packages/types/protobuf/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.amino.ts rename to packages/types/protobuf/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.registry.ts b/packages/types/protobuf/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.registry.ts rename to packages/types/protobuf/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.rpc.msg.ts b/packages/types/protobuf/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.ts b/packages/types/protobuf/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.ts rename to packages/types/protobuf/codegen/osmosis/concentrated-liquidity/pool-model/concentrated/tx.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/pool.ts b/packages/types/protobuf/codegen/osmosis/concentrated-liquidity/pool.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/pool.ts rename to packages/types/protobuf/codegen/osmosis/concentrated-liquidity/pool.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/position.ts b/packages/types/protobuf/codegen/osmosis/concentrated-liquidity/position.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/position.ts rename to packages/types/protobuf/codegen/osmosis/concentrated-liquidity/position.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/query.rpc.Query.ts b/packages/types/protobuf/codegen/osmosis/concentrated-liquidity/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/query.rpc.Query.ts rename to packages/types/protobuf/codegen/osmosis/concentrated-liquidity/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/query.ts b/packages/types/protobuf/codegen/osmosis/concentrated-liquidity/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/query.ts rename to packages/types/protobuf/codegen/osmosis/concentrated-liquidity/query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/tickInfo.ts b/packages/types/protobuf/codegen/osmosis/concentrated-liquidity/tickInfo.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/tickInfo.ts rename to packages/types/protobuf/codegen/osmosis/concentrated-liquidity/tickInfo.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/tx.amino.ts b/packages/types/protobuf/codegen/osmosis/concentrated-liquidity/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/tx.amino.ts rename to packages/types/protobuf/codegen/osmosis/concentrated-liquidity/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/tx.registry.ts b/packages/types/protobuf/codegen/osmosis/concentrated-liquidity/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/tx.registry.ts rename to packages/types/protobuf/codegen/osmosis/concentrated-liquidity/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/tx.rpc.msg.ts b/packages/types/protobuf/codegen/osmosis/concentrated-liquidity/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/osmosis/concentrated-liquidity/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/tx.ts b/packages/types/protobuf/codegen/osmosis/concentrated-liquidity/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentrated-liquidity/tx.ts rename to packages/types/protobuf/codegen/osmosis/concentrated-liquidity/tx.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentratedliquidity/params.ts b/packages/types/protobuf/codegen/osmosis/concentratedliquidity/params.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentratedliquidity/params.ts rename to packages/types/protobuf/codegen/osmosis/concentratedliquidity/params.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino.ts rename to packages/types/protobuf/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry.ts rename to packages/types/protobuf/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.ts b/packages/types/protobuf/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.ts rename to packages/types/protobuf/codegen/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/genesis.ts b/packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/genesis.ts rename to packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/genesis.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/gov.ts b/packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/gov.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/gov.ts rename to packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/gov.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/incentive_record.ts b/packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/incentive_record.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/incentive_record.ts rename to packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/incentive_record.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/pool.ts b/packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/pool.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/pool.ts rename to packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/pool.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/position.ts b/packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/position.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/position.ts rename to packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/position.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/query.ts b/packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/query.ts rename to packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tickInfo.ts b/packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tickInfo.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tickInfo.ts rename to packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tickInfo.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tx.amino.ts rename to packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tx.registry.ts rename to packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tx.ts b/packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tx.ts rename to packages/types/protobuf/codegen/osmosis/concentratedliquidity/v1beta1/tx.ts diff --git a/packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/genesis.ts b/packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/genesis.ts rename to packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/genesis.ts diff --git a/packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts b/packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts rename to packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts diff --git a/packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.ts b/packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.ts rename to packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.ts diff --git a/packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.ts b/packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.ts rename to packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.ts diff --git a/packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.ts b/packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.ts rename to packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.ts diff --git a/packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/pool.ts b/packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/pool.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/pool.ts rename to packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/pool.ts diff --git a/packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.ts b/packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.ts rename to packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.ts diff --git a/packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.ts b/packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.ts rename to packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.ts diff --git a/packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/tx.ts b/packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/tx.ts rename to packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/model/tx.ts diff --git a/packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/params.ts b/packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/params.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/params.ts rename to packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/params.ts diff --git a/packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/query.ts b/packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/query.ts rename to packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/tx.ts b/packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/tx.ts rename to packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/tx.ts diff --git a/packages/utils/protobuf/codegen/osmosis/gamm/pool-models/balancer/balancerPool.ts b/packages/types/protobuf/codegen/osmosis/gamm/pool-models/balancer/balancerPool.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/gamm/pool-models/balancer/balancerPool.ts rename to packages/types/protobuf/codegen/osmosis/gamm/pool-models/balancer/balancerPool.ts diff --git a/packages/utils/protobuf/codegen/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts b/packages/types/protobuf/codegen/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts rename to packages/types/protobuf/codegen/osmosis/gamm/pool-models/balancer/tx/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/osmosis/gamm/pool-models/balancer/tx/tx.registry.ts b/packages/types/protobuf/codegen/osmosis/gamm/pool-models/balancer/tx/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/gamm/pool-models/balancer/tx/tx.registry.ts rename to packages/types/protobuf/codegen/osmosis/gamm/pool-models/balancer/tx/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/osmosis/gamm/pool-models/balancer/tx/tx.rpc.msg.ts b/packages/types/protobuf/codegen/osmosis/gamm/pool-models/balancer/tx/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/gamm/pool-models/balancer/tx/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/osmosis/gamm/pool-models/balancer/tx/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/osmosis/gamm/pool-models/balancer/tx/tx.ts b/packages/types/protobuf/codegen/osmosis/gamm/pool-models/balancer/tx/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/gamm/pool-models/balancer/tx/tx.ts rename to packages/types/protobuf/codegen/osmosis/gamm/pool-models/balancer/tx/tx.ts diff --git a/packages/utils/protobuf/codegen/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts b/packages/types/protobuf/codegen/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts rename to packages/types/protobuf/codegen/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts diff --git a/packages/utils/protobuf/codegen/osmosis/gamm/pool-models/stableswap/tx.amino.ts b/packages/types/protobuf/codegen/osmosis/gamm/pool-models/stableswap/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/gamm/pool-models/stableswap/tx.amino.ts rename to packages/types/protobuf/codegen/osmosis/gamm/pool-models/stableswap/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/osmosis/gamm/pool-models/stableswap/tx.registry.ts b/packages/types/protobuf/codegen/osmosis/gamm/pool-models/stableswap/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/gamm/pool-models/stableswap/tx.registry.ts rename to packages/types/protobuf/codegen/osmosis/gamm/pool-models/stableswap/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/osmosis/gamm/pool-models/stableswap/tx.rpc.msg.ts b/packages/types/protobuf/codegen/osmosis/gamm/pool-models/stableswap/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/gamm/pool-models/stableswap/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/osmosis/gamm/pool-models/stableswap/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/osmosis/gamm/pool-models/stableswap/tx.ts b/packages/types/protobuf/codegen/osmosis/gamm/pool-models/stableswap/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/gamm/pool-models/stableswap/tx.ts rename to packages/types/protobuf/codegen/osmosis/gamm/pool-models/stableswap/tx.ts diff --git a/packages/utils/protobuf/codegen/osmosis/gamm/v1beta1/genesis.ts b/packages/types/protobuf/codegen/osmosis/gamm/v1beta1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/gamm/v1beta1/genesis.ts rename to packages/types/protobuf/codegen/osmosis/gamm/v1beta1/genesis.ts diff --git a/packages/utils/protobuf/codegen/osmosis/gamm/v1beta1/gov.ts b/packages/types/protobuf/codegen/osmosis/gamm/v1beta1/gov.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/gamm/v1beta1/gov.ts rename to packages/types/protobuf/codegen/osmosis/gamm/v1beta1/gov.ts diff --git a/packages/utils/protobuf/codegen/osmosis/gamm/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/osmosis/gamm/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/gamm/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/osmosis/gamm/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/gamm/v1beta1/query.ts b/packages/types/protobuf/codegen/osmosis/gamm/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/gamm/v1beta1/query.ts rename to packages/types/protobuf/codegen/osmosis/gamm/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/gamm/v1beta1/shared.ts b/packages/types/protobuf/codegen/osmosis/gamm/v1beta1/shared.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/gamm/v1beta1/shared.ts rename to packages/types/protobuf/codegen/osmosis/gamm/v1beta1/shared.ts diff --git a/packages/utils/protobuf/codegen/osmosis/gamm/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/osmosis/gamm/v1beta1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/gamm/v1beta1/tx.amino.ts rename to packages/types/protobuf/codegen/osmosis/gamm/v1beta1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/osmosis/gamm/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/osmosis/gamm/v1beta1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/gamm/v1beta1/tx.registry.ts rename to packages/types/protobuf/codegen/osmosis/gamm/v1beta1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/osmosis/gamm/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/osmosis/gamm/v1beta1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/gamm/v1beta1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/osmosis/gamm/v1beta1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/osmosis/gamm/v1beta1/tx.ts b/packages/types/protobuf/codegen/osmosis/gamm/v1beta1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/gamm/v1beta1/tx.ts rename to packages/types/protobuf/codegen/osmosis/gamm/v1beta1/tx.ts diff --git a/packages/utils/protobuf/codegen/osmosis/incentives/gauge.ts b/packages/types/protobuf/codegen/osmosis/incentives/gauge.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/incentives/gauge.ts rename to packages/types/protobuf/codegen/osmosis/incentives/gauge.ts diff --git a/packages/utils/protobuf/codegen/osmosis/incentives/genesis.ts b/packages/types/protobuf/codegen/osmosis/incentives/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/incentives/genesis.ts rename to packages/types/protobuf/codegen/osmosis/incentives/genesis.ts diff --git a/packages/utils/protobuf/codegen/osmosis/incentives/gov.ts b/packages/types/protobuf/codegen/osmosis/incentives/gov.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/incentives/gov.ts rename to packages/types/protobuf/codegen/osmosis/incentives/gov.ts diff --git a/packages/utils/protobuf/codegen/osmosis/incentives/group.ts b/packages/types/protobuf/codegen/osmosis/incentives/group.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/incentives/group.ts rename to packages/types/protobuf/codegen/osmosis/incentives/group.ts diff --git a/packages/utils/protobuf/codegen/osmosis/incentives/params.ts b/packages/types/protobuf/codegen/osmosis/incentives/params.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/incentives/params.ts rename to packages/types/protobuf/codegen/osmosis/incentives/params.ts diff --git a/packages/utils/protobuf/codegen/osmosis/incentives/query.rpc.Query.ts b/packages/types/protobuf/codegen/osmosis/incentives/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/incentives/query.rpc.Query.ts rename to packages/types/protobuf/codegen/osmosis/incentives/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/incentives/query.ts b/packages/types/protobuf/codegen/osmosis/incentives/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/incentives/query.ts rename to packages/types/protobuf/codegen/osmosis/incentives/query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/incentives/tx.amino.ts b/packages/types/protobuf/codegen/osmosis/incentives/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/incentives/tx.amino.ts rename to packages/types/protobuf/codegen/osmosis/incentives/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/osmosis/incentives/tx.registry.ts b/packages/types/protobuf/codegen/osmosis/incentives/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/incentives/tx.registry.ts rename to packages/types/protobuf/codegen/osmosis/incentives/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/osmosis/incentives/tx.rpc.msg.ts b/packages/types/protobuf/codegen/osmosis/incentives/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/incentives/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/osmosis/incentives/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/osmosis/incentives/tx.ts b/packages/types/protobuf/codegen/osmosis/incentives/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/incentives/tx.ts rename to packages/types/protobuf/codegen/osmosis/incentives/tx.ts diff --git a/packages/utils/protobuf/codegen/osmosis/lockup/genesis.ts b/packages/types/protobuf/codegen/osmosis/lockup/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/lockup/genesis.ts rename to packages/types/protobuf/codegen/osmosis/lockup/genesis.ts diff --git a/packages/utils/protobuf/codegen/osmosis/lockup/lock.ts b/packages/types/protobuf/codegen/osmosis/lockup/lock.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/lockup/lock.ts rename to packages/types/protobuf/codegen/osmosis/lockup/lock.ts diff --git a/packages/utils/protobuf/codegen/osmosis/lockup/params.ts b/packages/types/protobuf/codegen/osmosis/lockup/params.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/lockup/params.ts rename to packages/types/protobuf/codegen/osmosis/lockup/params.ts diff --git a/packages/utils/protobuf/codegen/osmosis/lockup/query.rpc.Query.ts b/packages/types/protobuf/codegen/osmosis/lockup/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/lockup/query.rpc.Query.ts rename to packages/types/protobuf/codegen/osmosis/lockup/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/lockup/query.ts b/packages/types/protobuf/codegen/osmosis/lockup/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/lockup/query.ts rename to packages/types/protobuf/codegen/osmosis/lockup/query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/lockup/tx.amino.ts b/packages/types/protobuf/codegen/osmosis/lockup/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/lockup/tx.amino.ts rename to packages/types/protobuf/codegen/osmosis/lockup/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/osmosis/lockup/tx.registry.ts b/packages/types/protobuf/codegen/osmosis/lockup/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/lockup/tx.registry.ts rename to packages/types/protobuf/codegen/osmosis/lockup/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/osmosis/lockup/tx.rpc.msg.ts b/packages/types/protobuf/codegen/osmosis/lockup/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/lockup/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/osmosis/lockup/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/osmosis/lockup/tx.ts b/packages/types/protobuf/codegen/osmosis/lockup/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/lockup/tx.ts rename to packages/types/protobuf/codegen/osmosis/lockup/tx.ts diff --git a/packages/utils/protobuf/codegen/osmosis/pool-incentives/v1beta1/genesis.ts b/packages/types/protobuf/codegen/osmosis/pool-incentives/v1beta1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/pool-incentives/v1beta1/genesis.ts rename to packages/types/protobuf/codegen/osmosis/pool-incentives/v1beta1/genesis.ts diff --git a/packages/utils/protobuf/codegen/osmosis/pool-incentives/v1beta1/gov.ts b/packages/types/protobuf/codegen/osmosis/pool-incentives/v1beta1/gov.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/pool-incentives/v1beta1/gov.ts rename to packages/types/protobuf/codegen/osmosis/pool-incentives/v1beta1/gov.ts diff --git a/packages/utils/protobuf/codegen/osmosis/pool-incentives/v1beta1/incentives.ts b/packages/types/protobuf/codegen/osmosis/pool-incentives/v1beta1/incentives.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/pool-incentives/v1beta1/incentives.ts rename to packages/types/protobuf/codegen/osmosis/pool-incentives/v1beta1/incentives.ts diff --git a/packages/utils/protobuf/codegen/osmosis/pool-incentives/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/osmosis/pool-incentives/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/pool-incentives/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/osmosis/pool-incentives/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/pool-incentives/v1beta1/query.ts b/packages/types/protobuf/codegen/osmosis/pool-incentives/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/pool-incentives/v1beta1/query.ts rename to packages/types/protobuf/codegen/osmosis/pool-incentives/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/pool-incentives/v1beta1/shared.ts b/packages/types/protobuf/codegen/osmosis/pool-incentives/v1beta1/shared.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/pool-incentives/v1beta1/shared.ts rename to packages/types/protobuf/codegen/osmosis/pool-incentives/v1beta1/shared.ts diff --git a/packages/utils/protobuf/codegen/osmosis/poolmanager/v1beta1/genesis.ts b/packages/types/protobuf/codegen/osmosis/poolmanager/v1beta1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/poolmanager/v1beta1/genesis.ts rename to packages/types/protobuf/codegen/osmosis/poolmanager/v1beta1/genesis.ts diff --git a/packages/utils/protobuf/codegen/osmosis/poolmanager/v1beta1/gov.ts b/packages/types/protobuf/codegen/osmosis/poolmanager/v1beta1/gov.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/poolmanager/v1beta1/gov.ts rename to packages/types/protobuf/codegen/osmosis/poolmanager/v1beta1/gov.ts diff --git a/packages/utils/protobuf/codegen/osmosis/poolmanager/v1beta1/module_route.ts b/packages/types/protobuf/codegen/osmosis/poolmanager/v1beta1/module_route.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/poolmanager/v1beta1/module_route.ts rename to packages/types/protobuf/codegen/osmosis/poolmanager/v1beta1/module_route.ts diff --git a/packages/utils/protobuf/codegen/osmosis/poolmanager/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/osmosis/poolmanager/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/poolmanager/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/osmosis/poolmanager/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/poolmanager/v1beta1/query.ts b/packages/types/protobuf/codegen/osmosis/poolmanager/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/poolmanager/v1beta1/query.ts rename to packages/types/protobuf/codegen/osmosis/poolmanager/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/poolmanager/v1beta1/swap_route.ts b/packages/types/protobuf/codegen/osmosis/poolmanager/v1beta1/swap_route.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/poolmanager/v1beta1/swap_route.ts rename to packages/types/protobuf/codegen/osmosis/poolmanager/v1beta1/swap_route.ts diff --git a/packages/utils/protobuf/codegen/osmosis/poolmanager/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/osmosis/poolmanager/v1beta1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/poolmanager/v1beta1/tx.amino.ts rename to packages/types/protobuf/codegen/osmosis/poolmanager/v1beta1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/osmosis/poolmanager/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/osmosis/poolmanager/v1beta1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/poolmanager/v1beta1/tx.registry.ts rename to packages/types/protobuf/codegen/osmosis/poolmanager/v1beta1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/osmosis/poolmanager/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/osmosis/poolmanager/v1beta1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/poolmanager/v1beta1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/osmosis/poolmanager/v1beta1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/osmosis/poolmanager/v1beta1/tx.ts b/packages/types/protobuf/codegen/osmosis/poolmanager/v1beta1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/poolmanager/v1beta1/tx.ts rename to packages/types/protobuf/codegen/osmosis/poolmanager/v1beta1/tx.ts diff --git a/packages/utils/protobuf/codegen/osmosis/protorev/v1beta1/genesis.ts b/packages/types/protobuf/codegen/osmosis/protorev/v1beta1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/protorev/v1beta1/genesis.ts rename to packages/types/protobuf/codegen/osmosis/protorev/v1beta1/genesis.ts diff --git a/packages/utils/protobuf/codegen/osmosis/protorev/v1beta1/gov.ts b/packages/types/protobuf/codegen/osmosis/protorev/v1beta1/gov.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/protorev/v1beta1/gov.ts rename to packages/types/protobuf/codegen/osmosis/protorev/v1beta1/gov.ts diff --git a/packages/utils/protobuf/codegen/osmosis/protorev/v1beta1/params.ts b/packages/types/protobuf/codegen/osmosis/protorev/v1beta1/params.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/protorev/v1beta1/params.ts rename to packages/types/protobuf/codegen/osmosis/protorev/v1beta1/params.ts diff --git a/packages/utils/protobuf/codegen/osmosis/protorev/v1beta1/protorev.ts b/packages/types/protobuf/codegen/osmosis/protorev/v1beta1/protorev.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/protorev/v1beta1/protorev.ts rename to packages/types/protobuf/codegen/osmosis/protorev/v1beta1/protorev.ts diff --git a/packages/utils/protobuf/codegen/osmosis/protorev/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/osmosis/protorev/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/protorev/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/osmosis/protorev/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/protorev/v1beta1/query.ts b/packages/types/protobuf/codegen/osmosis/protorev/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/protorev/v1beta1/query.ts rename to packages/types/protobuf/codegen/osmosis/protorev/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/protorev/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/osmosis/protorev/v1beta1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/protorev/v1beta1/tx.amino.ts rename to packages/types/protobuf/codegen/osmosis/protorev/v1beta1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/osmosis/protorev/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/osmosis/protorev/v1beta1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/protorev/v1beta1/tx.registry.ts rename to packages/types/protobuf/codegen/osmosis/protorev/v1beta1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/osmosis/protorev/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/osmosis/protorev/v1beta1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/protorev/v1beta1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/osmosis/protorev/v1beta1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/osmosis/protorev/v1beta1/tx.ts b/packages/types/protobuf/codegen/osmosis/protorev/v1beta1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/protorev/v1beta1/tx.ts rename to packages/types/protobuf/codegen/osmosis/protorev/v1beta1/tx.ts diff --git a/packages/utils/protobuf/codegen/osmosis/rpc.query.ts b/packages/types/protobuf/codegen/osmosis/rpc.query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/rpc.query.ts rename to packages/types/protobuf/codegen/osmosis/rpc.query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/rpc.tx.ts b/packages/types/protobuf/codegen/osmosis/rpc.tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/rpc.tx.ts rename to packages/types/protobuf/codegen/osmosis/rpc.tx.ts diff --git a/packages/utils/protobuf/codegen/osmosis/superfluid/genesis.ts b/packages/types/protobuf/codegen/osmosis/superfluid/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/superfluid/genesis.ts rename to packages/types/protobuf/codegen/osmosis/superfluid/genesis.ts diff --git a/packages/utils/protobuf/codegen/osmosis/superfluid/params.ts b/packages/types/protobuf/codegen/osmosis/superfluid/params.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/superfluid/params.ts rename to packages/types/protobuf/codegen/osmosis/superfluid/params.ts diff --git a/packages/utils/protobuf/codegen/osmosis/superfluid/query.rpc.Query.ts b/packages/types/protobuf/codegen/osmosis/superfluid/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/superfluid/query.rpc.Query.ts rename to packages/types/protobuf/codegen/osmosis/superfluid/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/superfluid/query.ts b/packages/types/protobuf/codegen/osmosis/superfluid/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/superfluid/query.ts rename to packages/types/protobuf/codegen/osmosis/superfluid/query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/superfluid/superfluid.ts b/packages/types/protobuf/codegen/osmosis/superfluid/superfluid.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/superfluid/superfluid.ts rename to packages/types/protobuf/codegen/osmosis/superfluid/superfluid.ts diff --git a/packages/utils/protobuf/codegen/osmosis/superfluid/tx.amino.ts b/packages/types/protobuf/codegen/osmosis/superfluid/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/superfluid/tx.amino.ts rename to packages/types/protobuf/codegen/osmosis/superfluid/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/osmosis/superfluid/tx.registry.ts b/packages/types/protobuf/codegen/osmosis/superfluid/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/superfluid/tx.registry.ts rename to packages/types/protobuf/codegen/osmosis/superfluid/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/osmosis/superfluid/tx.rpc.msg.ts b/packages/types/protobuf/codegen/osmosis/superfluid/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/superfluid/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/osmosis/superfluid/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/osmosis/superfluid/tx.ts b/packages/types/protobuf/codegen/osmosis/superfluid/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/superfluid/tx.ts rename to packages/types/protobuf/codegen/osmosis/superfluid/tx.ts diff --git a/packages/utils/protobuf/codegen/osmosis/superfluid/v1beta1/gov.ts b/packages/types/protobuf/codegen/osmosis/superfluid/v1beta1/gov.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/superfluid/v1beta1/gov.ts rename to packages/types/protobuf/codegen/osmosis/superfluid/v1beta1/gov.ts diff --git a/packages/utils/protobuf/codegen/osmosis/tokenfactory/v1beta1/authorityMetadata.ts b/packages/types/protobuf/codegen/osmosis/tokenfactory/v1beta1/authorityMetadata.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/tokenfactory/v1beta1/authorityMetadata.ts rename to packages/types/protobuf/codegen/osmosis/tokenfactory/v1beta1/authorityMetadata.ts diff --git a/packages/utils/protobuf/codegen/osmosis/tokenfactory/v1beta1/genesis.ts b/packages/types/protobuf/codegen/osmosis/tokenfactory/v1beta1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/tokenfactory/v1beta1/genesis.ts rename to packages/types/protobuf/codegen/osmosis/tokenfactory/v1beta1/genesis.ts diff --git a/packages/utils/protobuf/codegen/osmosis/tokenfactory/v1beta1/params.ts b/packages/types/protobuf/codegen/osmosis/tokenfactory/v1beta1/params.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/tokenfactory/v1beta1/params.ts rename to packages/types/protobuf/codegen/osmosis/tokenfactory/v1beta1/params.ts diff --git a/packages/utils/protobuf/codegen/osmosis/tokenfactory/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/osmosis/tokenfactory/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/tokenfactory/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/osmosis/tokenfactory/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/tokenfactory/v1beta1/query.ts b/packages/types/protobuf/codegen/osmosis/tokenfactory/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/tokenfactory/v1beta1/query.ts rename to packages/types/protobuf/codegen/osmosis/tokenfactory/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/tokenfactory/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/osmosis/tokenfactory/v1beta1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/tokenfactory/v1beta1/tx.amino.ts rename to packages/types/protobuf/codegen/osmosis/tokenfactory/v1beta1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/osmosis/tokenfactory/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/osmosis/tokenfactory/v1beta1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/tokenfactory/v1beta1/tx.registry.ts rename to packages/types/protobuf/codegen/osmosis/tokenfactory/v1beta1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/osmosis/tokenfactory/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/osmosis/tokenfactory/v1beta1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/tokenfactory/v1beta1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/osmosis/tokenfactory/v1beta1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/osmosis/tokenfactory/v1beta1/tx.ts b/packages/types/protobuf/codegen/osmosis/tokenfactory/v1beta1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/tokenfactory/v1beta1/tx.ts rename to packages/types/protobuf/codegen/osmosis/tokenfactory/v1beta1/tx.ts diff --git a/packages/utils/protobuf/codegen/osmosis/txfees/v1beta1/feetoken.ts b/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/feetoken.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/txfees/v1beta1/feetoken.ts rename to packages/types/protobuf/codegen/osmosis/txfees/v1beta1/feetoken.ts diff --git a/packages/utils/protobuf/codegen/osmosis/txfees/v1beta1/genesis.ts b/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/txfees/v1beta1/genesis.ts rename to packages/types/protobuf/codegen/osmosis/txfees/v1beta1/genesis.ts diff --git a/packages/utils/protobuf/codegen/osmosis/txfees/v1beta1/gov.ts b/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/gov.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/txfees/v1beta1/gov.ts rename to packages/types/protobuf/codegen/osmosis/txfees/v1beta1/gov.ts diff --git a/packages/utils/protobuf/codegen/osmosis/txfees/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/txfees/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/osmosis/txfees/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/txfees/v1beta1/query.ts b/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/txfees/v1beta1/query.ts rename to packages/types/protobuf/codegen/osmosis/txfees/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/valset-pref/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/osmosis/valset-pref/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/valset-pref/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/osmosis/valset-pref/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/valset-pref/v1beta1/query.ts b/packages/types/protobuf/codegen/osmosis/valset-pref/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/valset-pref/v1beta1/query.ts rename to packages/types/protobuf/codegen/osmosis/valset-pref/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/osmosis/valset-pref/v1beta1/state.ts b/packages/types/protobuf/codegen/osmosis/valset-pref/v1beta1/state.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/valset-pref/v1beta1/state.ts rename to packages/types/protobuf/codegen/osmosis/valset-pref/v1beta1/state.ts diff --git a/packages/utils/protobuf/codegen/osmosis/valset-pref/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/osmosis/valset-pref/v1beta1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/valset-pref/v1beta1/tx.amino.ts rename to packages/types/protobuf/codegen/osmosis/valset-pref/v1beta1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/osmosis/valset-pref/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/osmosis/valset-pref/v1beta1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/valset-pref/v1beta1/tx.registry.ts rename to packages/types/protobuf/codegen/osmosis/valset-pref/v1beta1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/osmosis/valset-pref/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/osmosis/valset-pref/v1beta1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/valset-pref/v1beta1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/osmosis/valset-pref/v1beta1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/osmosis/valset-pref/v1beta1/tx.ts b/packages/types/protobuf/codegen/osmosis/valset-pref/v1beta1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/osmosis/valset-pref/v1beta1/tx.ts rename to packages/types/protobuf/codegen/osmosis/valset-pref/v1beta1/tx.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/bundle.ts b/packages/types/protobuf/codegen/publicawesome/bundle.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/bundle.ts rename to packages/types/protobuf/codegen/publicawesome/bundle.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/client.ts b/packages/types/protobuf/codegen/publicawesome/client.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/client.ts rename to packages/types/protobuf/codegen/publicawesome/client.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/rpc.query.ts b/packages/types/protobuf/codegen/publicawesome/rpc.query.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/rpc.query.ts rename to packages/types/protobuf/codegen/publicawesome/rpc.query.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/rpc.tx.ts b/packages/types/protobuf/codegen/publicawesome/rpc.tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/rpc.tx.ts rename to packages/types/protobuf/codegen/publicawesome/rpc.tx.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/genesis.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/genesis.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/genesis.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/params.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/params.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/params.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/params.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/query.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/query.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/tx.amino.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/tx.registry.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/tx.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/tx.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/alloc/v1beta1/tx.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/cron/v1/cron.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/cron/v1/cron.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/cron/v1/cron.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/cron/v1/cron.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/cron/v1/genesis.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/cron/v1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/cron/v1/genesis.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/cron/v1/genesis.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/cron/v1/proposal.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/cron/v1/proposal.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/cron/v1/proposal.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/cron/v1/proposal.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/cron/v1/query.rpc.Query.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/cron/v1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/cron/v1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/cron/v1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/cron/v1/query.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/cron/v1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/cron/v1/query.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/cron/v1/query.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/cron/v1/tx.amino.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/cron/v1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/cron/v1/tx.amino.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/cron/v1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/cron/v1/tx.registry.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/cron/v1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/cron/v1/tx.registry.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/cron/v1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/cron/v1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/cron/v1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/cron/v1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/cron/v1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/cron/v1/tx.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/cron/v1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/cron/v1/tx.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/cron/v1/tx.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/globalfee/v1/genesis.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/globalfee/v1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/globalfee/v1/genesis.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/globalfee/v1/genesis.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/globalfee/v1/globalfee.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/globalfee/v1/globalfee.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/globalfee/v1/globalfee.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/globalfee/v1/globalfee.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/globalfee/v1/proposal.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/globalfee/v1/proposal.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/globalfee/v1/proposal.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/globalfee/v1/proposal.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/globalfee/v1/query.rpc.Query.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/globalfee/v1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/globalfee/v1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/globalfee/v1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/globalfee/v1/query.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/globalfee/v1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/globalfee/v1/query.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/globalfee/v1/query.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/globalfee/v1/tx.amino.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/globalfee/v1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/globalfee/v1/tx.amino.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/globalfee/v1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/globalfee/v1/tx.registry.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/globalfee/v1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/globalfee/v1/tx.registry.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/globalfee/v1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/globalfee/v1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/globalfee/v1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/globalfee/v1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/globalfee/v1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/globalfee/v1/tx.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/globalfee/v1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/globalfee/v1/tx.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/globalfee/v1/tx.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/genesis.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/genesis.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/genesis.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/mint.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/mint.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/mint.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/mint.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/query.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/query.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/query.ts diff --git a/packages/utils/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/tx.ts b/packages/types/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/tx.ts rename to packages/types/protobuf/codegen/publicawesome/stargaze/mint/v1beta1/tx.ts diff --git a/packages/utils/protobuf/codegen/regen/bundle.ts b/packages/types/protobuf/codegen/regen/bundle.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/bundle.ts rename to packages/types/protobuf/codegen/regen/bundle.ts diff --git a/packages/utils/protobuf/codegen/regen/client.ts b/packages/types/protobuf/codegen/regen/client.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/client.ts rename to packages/types/protobuf/codegen/regen/client.ts diff --git a/packages/utils/protobuf/codegen/regen/data/v1/events.ts b/packages/types/protobuf/codegen/regen/data/v1/events.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/data/v1/events.ts rename to packages/types/protobuf/codegen/regen/data/v1/events.ts diff --git a/packages/utils/protobuf/codegen/regen/data/v1/state.ts b/packages/types/protobuf/codegen/regen/data/v1/state.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/data/v1/state.ts rename to packages/types/protobuf/codegen/regen/data/v1/state.ts diff --git a/packages/utils/protobuf/codegen/regen/data/v1/tx.amino.ts b/packages/types/protobuf/codegen/regen/data/v1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/data/v1/tx.amino.ts rename to packages/types/protobuf/codegen/regen/data/v1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/regen/data/v1/tx.registry.ts b/packages/types/protobuf/codegen/regen/data/v1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/data/v1/tx.registry.ts rename to packages/types/protobuf/codegen/regen/data/v1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/regen/data/v1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/regen/data/v1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/data/v1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/regen/data/v1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/regen/data/v1/tx.ts b/packages/types/protobuf/codegen/regen/data/v1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/data/v1/tx.ts rename to packages/types/protobuf/codegen/regen/data/v1/tx.ts diff --git a/packages/utils/protobuf/codegen/regen/data/v1/types.ts b/packages/types/protobuf/codegen/regen/data/v1/types.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/data/v1/types.ts rename to packages/types/protobuf/codegen/regen/data/v1/types.ts diff --git a/packages/utils/protobuf/codegen/regen/data/v2/events.ts b/packages/types/protobuf/codegen/regen/data/v2/events.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/data/v2/events.ts rename to packages/types/protobuf/codegen/regen/data/v2/events.ts diff --git a/packages/utils/protobuf/codegen/regen/data/v2/state.ts b/packages/types/protobuf/codegen/regen/data/v2/state.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/data/v2/state.ts rename to packages/types/protobuf/codegen/regen/data/v2/state.ts diff --git a/packages/utils/protobuf/codegen/regen/data/v2/tx.amino.ts b/packages/types/protobuf/codegen/regen/data/v2/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/data/v2/tx.amino.ts rename to packages/types/protobuf/codegen/regen/data/v2/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/regen/data/v2/tx.registry.ts b/packages/types/protobuf/codegen/regen/data/v2/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/data/v2/tx.registry.ts rename to packages/types/protobuf/codegen/regen/data/v2/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/regen/data/v2/tx.rpc.msg.ts b/packages/types/protobuf/codegen/regen/data/v2/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/data/v2/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/regen/data/v2/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/regen/data/v2/tx.ts b/packages/types/protobuf/codegen/regen/data/v2/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/data/v2/tx.ts rename to packages/types/protobuf/codegen/regen/data/v2/tx.ts diff --git a/packages/utils/protobuf/codegen/regen/data/v2/types.ts b/packages/types/protobuf/codegen/regen/data/v2/types.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/data/v2/types.ts rename to packages/types/protobuf/codegen/regen/data/v2/types.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/basket/v1/events.ts b/packages/types/protobuf/codegen/regen/ecocredit/basket/v1/events.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/basket/v1/events.ts rename to packages/types/protobuf/codegen/regen/ecocredit/basket/v1/events.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/basket/v1/state.ts b/packages/types/protobuf/codegen/regen/ecocredit/basket/v1/state.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/basket/v1/state.ts rename to packages/types/protobuf/codegen/regen/ecocredit/basket/v1/state.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/basket/v1/tx.amino.ts b/packages/types/protobuf/codegen/regen/ecocredit/basket/v1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/basket/v1/tx.amino.ts rename to packages/types/protobuf/codegen/regen/ecocredit/basket/v1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/basket/v1/tx.registry.ts b/packages/types/protobuf/codegen/regen/ecocredit/basket/v1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/basket/v1/tx.registry.ts rename to packages/types/protobuf/codegen/regen/ecocredit/basket/v1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/basket/v1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/regen/ecocredit/basket/v1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/basket/v1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/regen/ecocredit/basket/v1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/basket/v1/tx.ts b/packages/types/protobuf/codegen/regen/ecocredit/basket/v1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/basket/v1/tx.ts rename to packages/types/protobuf/codegen/regen/ecocredit/basket/v1/tx.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/basket/v1/types.ts b/packages/types/protobuf/codegen/regen/ecocredit/basket/v1/types.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/basket/v1/types.ts rename to packages/types/protobuf/codegen/regen/ecocredit/basket/v1/types.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/marketplace/v1/events.ts b/packages/types/protobuf/codegen/regen/ecocredit/marketplace/v1/events.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/marketplace/v1/events.ts rename to packages/types/protobuf/codegen/regen/ecocredit/marketplace/v1/events.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/marketplace/v1/state.ts b/packages/types/protobuf/codegen/regen/ecocredit/marketplace/v1/state.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/marketplace/v1/state.ts rename to packages/types/protobuf/codegen/regen/ecocredit/marketplace/v1/state.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/marketplace/v1/tx.amino.ts b/packages/types/protobuf/codegen/regen/ecocredit/marketplace/v1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/marketplace/v1/tx.amino.ts rename to packages/types/protobuf/codegen/regen/ecocredit/marketplace/v1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/marketplace/v1/tx.registry.ts b/packages/types/protobuf/codegen/regen/ecocredit/marketplace/v1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/marketplace/v1/tx.registry.ts rename to packages/types/protobuf/codegen/regen/ecocredit/marketplace/v1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/marketplace/v1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/regen/ecocredit/marketplace/v1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/marketplace/v1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/regen/ecocredit/marketplace/v1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/marketplace/v1/tx.ts b/packages/types/protobuf/codegen/regen/ecocredit/marketplace/v1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/marketplace/v1/tx.ts rename to packages/types/protobuf/codegen/regen/ecocredit/marketplace/v1/tx.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/marketplace/v1/types.ts b/packages/types/protobuf/codegen/regen/ecocredit/marketplace/v1/types.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/marketplace/v1/types.ts rename to packages/types/protobuf/codegen/regen/ecocredit/marketplace/v1/types.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/orderbook/v1alpha1/memory.ts b/packages/types/protobuf/codegen/regen/ecocredit/orderbook/v1alpha1/memory.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/orderbook/v1alpha1/memory.ts rename to packages/types/protobuf/codegen/regen/ecocredit/orderbook/v1alpha1/memory.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/v1/events.ts b/packages/types/protobuf/codegen/regen/ecocredit/v1/events.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/v1/events.ts rename to packages/types/protobuf/codegen/regen/ecocredit/v1/events.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/v1/state.ts b/packages/types/protobuf/codegen/regen/ecocredit/v1/state.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/v1/state.ts rename to packages/types/protobuf/codegen/regen/ecocredit/v1/state.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/v1/tx.amino.ts b/packages/types/protobuf/codegen/regen/ecocredit/v1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/v1/tx.amino.ts rename to packages/types/protobuf/codegen/regen/ecocredit/v1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/v1/tx.registry.ts b/packages/types/protobuf/codegen/regen/ecocredit/v1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/v1/tx.registry.ts rename to packages/types/protobuf/codegen/regen/ecocredit/v1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/v1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/regen/ecocredit/v1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/v1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/regen/ecocredit/v1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/v1/tx.ts b/packages/types/protobuf/codegen/regen/ecocredit/v1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/v1/tx.ts rename to packages/types/protobuf/codegen/regen/ecocredit/v1/tx.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/v1/types.ts b/packages/types/protobuf/codegen/regen/ecocredit/v1/types.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/v1/types.ts rename to packages/types/protobuf/codegen/regen/ecocredit/v1/types.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/v1alpha1/events.ts b/packages/types/protobuf/codegen/regen/ecocredit/v1alpha1/events.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/v1alpha1/events.ts rename to packages/types/protobuf/codegen/regen/ecocredit/v1alpha1/events.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/v1alpha1/genesis.ts b/packages/types/protobuf/codegen/regen/ecocredit/v1alpha1/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/v1alpha1/genesis.ts rename to packages/types/protobuf/codegen/regen/ecocredit/v1alpha1/genesis.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/v1alpha1/tx.amino.ts b/packages/types/protobuf/codegen/regen/ecocredit/v1alpha1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/v1alpha1/tx.amino.ts rename to packages/types/protobuf/codegen/regen/ecocredit/v1alpha1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/v1alpha1/tx.registry.ts b/packages/types/protobuf/codegen/regen/ecocredit/v1alpha1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/v1alpha1/tx.registry.ts rename to packages/types/protobuf/codegen/regen/ecocredit/v1alpha1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/v1alpha1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/regen/ecocredit/v1alpha1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/v1alpha1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/regen/ecocredit/v1alpha1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/v1alpha1/tx.ts b/packages/types/protobuf/codegen/regen/ecocredit/v1alpha1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/v1alpha1/tx.ts rename to packages/types/protobuf/codegen/regen/ecocredit/v1alpha1/tx.ts diff --git a/packages/utils/protobuf/codegen/regen/ecocredit/v1alpha1/types.ts b/packages/types/protobuf/codegen/regen/ecocredit/v1alpha1/types.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/ecocredit/v1alpha1/types.ts rename to packages/types/protobuf/codegen/regen/ecocredit/v1alpha1/types.ts diff --git a/packages/utils/protobuf/codegen/regen/intertx/v1/query.rpc.Query.ts b/packages/types/protobuf/codegen/regen/intertx/v1/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/intertx/v1/query.rpc.Query.ts rename to packages/types/protobuf/codegen/regen/intertx/v1/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/regen/intertx/v1/query.ts b/packages/types/protobuf/codegen/regen/intertx/v1/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/intertx/v1/query.ts rename to packages/types/protobuf/codegen/regen/intertx/v1/query.ts diff --git a/packages/utils/protobuf/codegen/regen/intertx/v1/tx.amino.ts b/packages/types/protobuf/codegen/regen/intertx/v1/tx.amino.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/intertx/v1/tx.amino.ts rename to packages/types/protobuf/codegen/regen/intertx/v1/tx.amino.ts diff --git a/packages/utils/protobuf/codegen/regen/intertx/v1/tx.registry.ts b/packages/types/protobuf/codegen/regen/intertx/v1/tx.registry.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/intertx/v1/tx.registry.ts rename to packages/types/protobuf/codegen/regen/intertx/v1/tx.registry.ts diff --git a/packages/utils/protobuf/codegen/regen/intertx/v1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/regen/intertx/v1/tx.rpc.msg.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/intertx/v1/tx.rpc.msg.ts rename to packages/types/protobuf/codegen/regen/intertx/v1/tx.rpc.msg.ts diff --git a/packages/utils/protobuf/codegen/regen/intertx/v1/tx.ts b/packages/types/protobuf/codegen/regen/intertx/v1/tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/intertx/v1/tx.ts rename to packages/types/protobuf/codegen/regen/intertx/v1/tx.ts diff --git a/packages/utils/protobuf/codegen/regen/rpc.query.ts b/packages/types/protobuf/codegen/regen/rpc.query.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/rpc.query.ts rename to packages/types/protobuf/codegen/regen/rpc.query.ts diff --git a/packages/utils/protobuf/codegen/regen/rpc.tx.ts b/packages/types/protobuf/codegen/regen/rpc.tx.ts similarity index 100% rename from packages/utils/protobuf/codegen/regen/rpc.tx.ts rename to packages/types/protobuf/codegen/regen/rpc.tx.ts diff --git a/packages/utils/protobuf/codegen/tariff/genesis.ts b/packages/types/protobuf/codegen/tariff/genesis.ts similarity index 100% rename from packages/utils/protobuf/codegen/tariff/genesis.ts rename to packages/types/protobuf/codegen/tariff/genesis.ts diff --git a/packages/utils/protobuf/codegen/tariff/params.ts b/packages/types/protobuf/codegen/tariff/params.ts similarity index 100% rename from packages/utils/protobuf/codegen/tariff/params.ts rename to packages/types/protobuf/codegen/tariff/params.ts diff --git a/packages/utils/protobuf/codegen/tariff/query.rpc.Query.ts b/packages/types/protobuf/codegen/tariff/query.rpc.Query.ts similarity index 100% rename from packages/utils/protobuf/codegen/tariff/query.rpc.Query.ts rename to packages/types/protobuf/codegen/tariff/query.rpc.Query.ts diff --git a/packages/utils/protobuf/codegen/tariff/query.ts b/packages/types/protobuf/codegen/tariff/query.ts similarity index 100% rename from packages/utils/protobuf/codegen/tariff/query.ts rename to packages/types/protobuf/codegen/tariff/query.ts diff --git a/packages/utils/protobuf/codegen/tendermint/abci/types.ts b/packages/types/protobuf/codegen/tendermint/abci/types.ts similarity index 100% rename from packages/utils/protobuf/codegen/tendermint/abci/types.ts rename to packages/types/protobuf/codegen/tendermint/abci/types.ts diff --git a/packages/utils/protobuf/codegen/tendermint/bundle.ts b/packages/types/protobuf/codegen/tendermint/bundle.ts similarity index 100% rename from packages/utils/protobuf/codegen/tendermint/bundle.ts rename to packages/types/protobuf/codegen/tendermint/bundle.ts diff --git a/packages/utils/protobuf/codegen/tendermint/crypto/keys.ts b/packages/types/protobuf/codegen/tendermint/crypto/keys.ts similarity index 100% rename from packages/utils/protobuf/codegen/tendermint/crypto/keys.ts rename to packages/types/protobuf/codegen/tendermint/crypto/keys.ts diff --git a/packages/utils/protobuf/codegen/tendermint/crypto/proof.ts b/packages/types/protobuf/codegen/tendermint/crypto/proof.ts similarity index 100% rename from packages/utils/protobuf/codegen/tendermint/crypto/proof.ts rename to packages/types/protobuf/codegen/tendermint/crypto/proof.ts diff --git a/packages/utils/protobuf/codegen/tendermint/p2p/types.ts b/packages/types/protobuf/codegen/tendermint/p2p/types.ts similarity index 100% rename from packages/utils/protobuf/codegen/tendermint/p2p/types.ts rename to packages/types/protobuf/codegen/tendermint/p2p/types.ts diff --git a/packages/utils/protobuf/codegen/tendermint/types/block.ts b/packages/types/protobuf/codegen/tendermint/types/block.ts similarity index 100% rename from packages/utils/protobuf/codegen/tendermint/types/block.ts rename to packages/types/protobuf/codegen/tendermint/types/block.ts diff --git a/packages/utils/protobuf/codegen/tendermint/types/evidence.ts b/packages/types/protobuf/codegen/tendermint/types/evidence.ts similarity index 100% rename from packages/utils/protobuf/codegen/tendermint/types/evidence.ts rename to packages/types/protobuf/codegen/tendermint/types/evidence.ts diff --git a/packages/utils/protobuf/codegen/tendermint/types/params.ts b/packages/types/protobuf/codegen/tendermint/types/params.ts similarity index 100% rename from packages/utils/protobuf/codegen/tendermint/types/params.ts rename to packages/types/protobuf/codegen/tendermint/types/params.ts diff --git a/packages/utils/protobuf/codegen/tendermint/types/types.ts b/packages/types/protobuf/codegen/tendermint/types/types.ts similarity index 100% rename from packages/utils/protobuf/codegen/tendermint/types/types.ts rename to packages/types/protobuf/codegen/tendermint/types/types.ts diff --git a/packages/utils/protobuf/codegen/tendermint/types/validator.ts b/packages/types/protobuf/codegen/tendermint/types/validator.ts similarity index 100% rename from packages/utils/protobuf/codegen/tendermint/types/validator.ts rename to packages/types/protobuf/codegen/tendermint/types/validator.ts diff --git a/packages/utils/protobuf/codegen/tendermint/version/types.ts b/packages/types/protobuf/codegen/tendermint/version/types.ts similarity index 100% rename from packages/utils/protobuf/codegen/tendermint/version/types.ts rename to packages/types/protobuf/codegen/tendermint/version/types.ts diff --git a/packages/utils/protobuf/codegen/utf8.ts b/packages/types/protobuf/codegen/utf8.ts similarity index 100% rename from packages/utils/protobuf/codegen/utf8.ts rename to packages/types/protobuf/codegen/utf8.ts diff --git a/packages/utils/protobuf/codegen/varint.ts b/packages/types/protobuf/codegen/varint.ts similarity index 100% rename from packages/utils/protobuf/codegen/varint.ts rename to packages/types/protobuf/codegen/varint.ts diff --git a/packages/utils/protobuf/index.ts b/packages/types/protobuf/index.ts similarity index 52% rename from packages/utils/protobuf/index.ts rename to packages/types/protobuf/index.ts index d9f40319f..44cb47adb 100644 --- a/packages/utils/protobuf/index.ts +++ b/packages/types/protobuf/index.ts @@ -1 +1,2 @@ export * from './codegen' +export * from './utils' diff --git a/packages/utils/protobuf/patches.diff b/packages/types/protobuf/patches.diff similarity index 100% rename from packages/utils/protobuf/patches.diff rename to packages/types/protobuf/patches.diff diff --git a/packages/utils/protobuf/proto/alliance/alliance/alliance.proto b/packages/types/protobuf/proto/alliance/alliance/alliance.proto similarity index 100% rename from packages/utils/protobuf/proto/alliance/alliance/alliance.proto rename to packages/types/protobuf/proto/alliance/alliance/alliance.proto diff --git a/packages/utils/protobuf/proto/alliance/alliance/delegations.proto b/packages/types/protobuf/proto/alliance/alliance/delegations.proto similarity index 100% rename from packages/utils/protobuf/proto/alliance/alliance/delegations.proto rename to packages/types/protobuf/proto/alliance/alliance/delegations.proto diff --git a/packages/utils/protobuf/proto/alliance/alliance/events.proto b/packages/types/protobuf/proto/alliance/alliance/events.proto similarity index 100% rename from packages/utils/protobuf/proto/alliance/alliance/events.proto rename to packages/types/protobuf/proto/alliance/alliance/events.proto diff --git a/packages/utils/protobuf/proto/alliance/alliance/genesis.proto b/packages/types/protobuf/proto/alliance/alliance/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/alliance/alliance/genesis.proto rename to packages/types/protobuf/proto/alliance/alliance/genesis.proto diff --git a/packages/utils/protobuf/proto/alliance/alliance/gov.proto b/packages/types/protobuf/proto/alliance/alliance/gov.proto similarity index 100% rename from packages/utils/protobuf/proto/alliance/alliance/gov.proto rename to packages/types/protobuf/proto/alliance/alliance/gov.proto diff --git a/packages/utils/protobuf/proto/alliance/alliance/params.proto b/packages/types/protobuf/proto/alliance/alliance/params.proto similarity index 100% rename from packages/utils/protobuf/proto/alliance/alliance/params.proto rename to packages/types/protobuf/proto/alliance/alliance/params.proto diff --git a/packages/utils/protobuf/proto/alliance/alliance/query.proto b/packages/types/protobuf/proto/alliance/alliance/query.proto similarity index 100% rename from packages/utils/protobuf/proto/alliance/alliance/query.proto rename to packages/types/protobuf/proto/alliance/alliance/query.proto diff --git a/packages/utils/protobuf/proto/alliance/alliance/redelegations.proto b/packages/types/protobuf/proto/alliance/alliance/redelegations.proto similarity index 100% rename from packages/utils/protobuf/proto/alliance/alliance/redelegations.proto rename to packages/types/protobuf/proto/alliance/alliance/redelegations.proto diff --git a/packages/utils/protobuf/proto/alliance/alliance/tx.proto b/packages/types/protobuf/proto/alliance/alliance/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/alliance/alliance/tx.proto rename to packages/types/protobuf/proto/alliance/alliance/tx.proto diff --git a/packages/utils/protobuf/proto/alliance/alliance/unbonding.proto b/packages/types/protobuf/proto/alliance/alliance/unbonding.proto similarity index 100% rename from packages/utils/protobuf/proto/alliance/alliance/unbonding.proto rename to packages/types/protobuf/proto/alliance/alliance/unbonding.proto diff --git a/packages/utils/protobuf/proto/amino/LICENSE b/packages/types/protobuf/proto/amino/LICENSE similarity index 100% rename from packages/utils/protobuf/proto/amino/LICENSE rename to packages/types/protobuf/proto/amino/LICENSE diff --git a/packages/utils/protobuf/proto/amino/README.md b/packages/types/protobuf/proto/amino/README.md similarity index 100% rename from packages/utils/protobuf/proto/amino/README.md rename to packages/types/protobuf/proto/amino/README.md diff --git a/packages/utils/protobuf/proto/amino/amino.proto b/packages/types/protobuf/proto/amino/amino.proto similarity index 100% rename from packages/utils/protobuf/proto/amino/amino.proto rename to packages/types/protobuf/proto/amino/amino.proto diff --git a/packages/utils/protobuf/proto/capability/v1/capability.proto b/packages/types/protobuf/proto/capability/v1/capability.proto similarity index 100% rename from packages/utils/protobuf/proto/capability/v1/capability.proto rename to packages/types/protobuf/proto/capability/v1/capability.proto diff --git a/packages/utils/protobuf/proto/capability/v1/genesis.proto b/packages/types/protobuf/proto/capability/v1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/capability/v1/genesis.proto rename to packages/types/protobuf/proto/capability/v1/genesis.proto diff --git a/packages/utils/protobuf/proto/circle/cctp/v1/attester.proto b/packages/types/protobuf/proto/circle/cctp/v1/attester.proto similarity index 100% rename from packages/utils/protobuf/proto/circle/cctp/v1/attester.proto rename to packages/types/protobuf/proto/circle/cctp/v1/attester.proto diff --git a/packages/utils/protobuf/proto/circle/cctp/v1/burn_message.proto b/packages/types/protobuf/proto/circle/cctp/v1/burn_message.proto similarity index 100% rename from packages/utils/protobuf/proto/circle/cctp/v1/burn_message.proto rename to packages/types/protobuf/proto/circle/cctp/v1/burn_message.proto diff --git a/packages/utils/protobuf/proto/circle/cctp/v1/burning_and_minting_paused.proto b/packages/types/protobuf/proto/circle/cctp/v1/burning_and_minting_paused.proto similarity index 100% rename from packages/utils/protobuf/proto/circle/cctp/v1/burning_and_minting_paused.proto rename to packages/types/protobuf/proto/circle/cctp/v1/burning_and_minting_paused.proto diff --git a/packages/utils/protobuf/proto/circle/cctp/v1/events.proto b/packages/types/protobuf/proto/circle/cctp/v1/events.proto similarity index 100% rename from packages/utils/protobuf/proto/circle/cctp/v1/events.proto rename to packages/types/protobuf/proto/circle/cctp/v1/events.proto diff --git a/packages/utils/protobuf/proto/circle/cctp/v1/genesis.proto b/packages/types/protobuf/proto/circle/cctp/v1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/circle/cctp/v1/genesis.proto rename to packages/types/protobuf/proto/circle/cctp/v1/genesis.proto diff --git a/packages/utils/protobuf/proto/circle/cctp/v1/max_message_body_size.proto b/packages/types/protobuf/proto/circle/cctp/v1/max_message_body_size.proto similarity index 100% rename from packages/utils/protobuf/proto/circle/cctp/v1/max_message_body_size.proto rename to packages/types/protobuf/proto/circle/cctp/v1/max_message_body_size.proto diff --git a/packages/utils/protobuf/proto/circle/cctp/v1/message.proto b/packages/types/protobuf/proto/circle/cctp/v1/message.proto similarity index 100% rename from packages/utils/protobuf/proto/circle/cctp/v1/message.proto rename to packages/types/protobuf/proto/circle/cctp/v1/message.proto diff --git a/packages/utils/protobuf/proto/circle/cctp/v1/nonce.proto b/packages/types/protobuf/proto/circle/cctp/v1/nonce.proto similarity index 100% rename from packages/utils/protobuf/proto/circle/cctp/v1/nonce.proto rename to packages/types/protobuf/proto/circle/cctp/v1/nonce.proto diff --git a/packages/utils/protobuf/proto/circle/cctp/v1/params.proto b/packages/types/protobuf/proto/circle/cctp/v1/params.proto similarity index 100% rename from packages/utils/protobuf/proto/circle/cctp/v1/params.proto rename to packages/types/protobuf/proto/circle/cctp/v1/params.proto diff --git a/packages/utils/protobuf/proto/circle/cctp/v1/per_message_burn_limit.proto b/packages/types/protobuf/proto/circle/cctp/v1/per_message_burn_limit.proto similarity index 100% rename from packages/utils/protobuf/proto/circle/cctp/v1/per_message_burn_limit.proto rename to packages/types/protobuf/proto/circle/cctp/v1/per_message_burn_limit.proto diff --git a/packages/utils/protobuf/proto/circle/cctp/v1/query.proto b/packages/types/protobuf/proto/circle/cctp/v1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/circle/cctp/v1/query.proto rename to packages/types/protobuf/proto/circle/cctp/v1/query.proto diff --git a/packages/utils/protobuf/proto/circle/cctp/v1/remote_token_messenger.proto b/packages/types/protobuf/proto/circle/cctp/v1/remote_token_messenger.proto similarity index 100% rename from packages/utils/protobuf/proto/circle/cctp/v1/remote_token_messenger.proto rename to packages/types/protobuf/proto/circle/cctp/v1/remote_token_messenger.proto diff --git a/packages/utils/protobuf/proto/circle/cctp/v1/sending_and_receiving_messages_paused.proto b/packages/types/protobuf/proto/circle/cctp/v1/sending_and_receiving_messages_paused.proto similarity index 100% rename from packages/utils/protobuf/proto/circle/cctp/v1/sending_and_receiving_messages_paused.proto rename to packages/types/protobuf/proto/circle/cctp/v1/sending_and_receiving_messages_paused.proto diff --git a/packages/utils/protobuf/proto/circle/cctp/v1/signature_threshold.proto b/packages/types/protobuf/proto/circle/cctp/v1/signature_threshold.proto similarity index 100% rename from packages/utils/protobuf/proto/circle/cctp/v1/signature_threshold.proto rename to packages/types/protobuf/proto/circle/cctp/v1/signature_threshold.proto diff --git a/packages/utils/protobuf/proto/circle/cctp/v1/token_pair.proto b/packages/types/protobuf/proto/circle/cctp/v1/token_pair.proto similarity index 100% rename from packages/utils/protobuf/proto/circle/cctp/v1/token_pair.proto rename to packages/types/protobuf/proto/circle/cctp/v1/token_pair.proto diff --git a/packages/utils/protobuf/proto/circle/cctp/v1/tx.proto b/packages/types/protobuf/proto/circle/cctp/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/circle/cctp/v1/tx.proto rename to packages/types/protobuf/proto/circle/cctp/v1/tx.proto diff --git a/packages/utils/protobuf/proto/cosmos/app/runtime/v1alpha1/module.proto b/packages/types/protobuf/proto/cosmos/app/runtime/v1alpha1/module.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/app/runtime/v1alpha1/module.proto rename to packages/types/protobuf/proto/cosmos/app/runtime/v1alpha1/module.proto diff --git a/packages/utils/protobuf/proto/cosmos/app/v1alpha1/config.proto b/packages/types/protobuf/proto/cosmos/app/v1alpha1/config.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/app/v1alpha1/config.proto rename to packages/types/protobuf/proto/cosmos/app/v1alpha1/config.proto diff --git a/packages/utils/protobuf/proto/cosmos/app/v1alpha1/module.proto b/packages/types/protobuf/proto/cosmos/app/v1alpha1/module.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/app/v1alpha1/module.proto rename to packages/types/protobuf/proto/cosmos/app/v1alpha1/module.proto diff --git a/packages/utils/protobuf/proto/cosmos/app/v1alpha1/query.proto b/packages/types/protobuf/proto/cosmos/app/v1alpha1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/app/v1alpha1/query.proto rename to packages/types/protobuf/proto/cosmos/app/v1alpha1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/auth/module/v1/module.proto b/packages/types/protobuf/proto/cosmos/auth/module/v1/module.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/auth/module/v1/module.proto rename to packages/types/protobuf/proto/cosmos/auth/module/v1/module.proto diff --git a/packages/utils/protobuf/proto/cosmos/auth/v1beta1/auth.proto b/packages/types/protobuf/proto/cosmos/auth/v1beta1/auth.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/auth/v1beta1/auth.proto rename to packages/types/protobuf/proto/cosmos/auth/v1beta1/auth.proto diff --git a/packages/utils/protobuf/proto/cosmos/auth/v1beta1/genesis.proto b/packages/types/protobuf/proto/cosmos/auth/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/auth/v1beta1/genesis.proto rename to packages/types/protobuf/proto/cosmos/auth/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/cosmos/auth/v1beta1/query.proto b/packages/types/protobuf/proto/cosmos/auth/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/auth/v1beta1/query.proto rename to packages/types/protobuf/proto/cosmos/auth/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/auth/v1beta1/tx.proto b/packages/types/protobuf/proto/cosmos/auth/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/auth/v1beta1/tx.proto rename to packages/types/protobuf/proto/cosmos/auth/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/cosmos/authz/module/v1/module.proto b/packages/types/protobuf/proto/cosmos/authz/module/v1/module.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/authz/module/v1/module.proto rename to packages/types/protobuf/proto/cosmos/authz/module/v1/module.proto diff --git a/packages/utils/protobuf/proto/cosmos/authz/v1beta1/authz.proto b/packages/types/protobuf/proto/cosmos/authz/v1beta1/authz.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/authz/v1beta1/authz.proto rename to packages/types/protobuf/proto/cosmos/authz/v1beta1/authz.proto diff --git a/packages/utils/protobuf/proto/cosmos/authz/v1beta1/event.proto b/packages/types/protobuf/proto/cosmos/authz/v1beta1/event.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/authz/v1beta1/event.proto rename to packages/types/protobuf/proto/cosmos/authz/v1beta1/event.proto diff --git a/packages/utils/protobuf/proto/cosmos/authz/v1beta1/genesis.proto b/packages/types/protobuf/proto/cosmos/authz/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/authz/v1beta1/genesis.proto rename to packages/types/protobuf/proto/cosmos/authz/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/cosmos/authz/v1beta1/query.proto b/packages/types/protobuf/proto/cosmos/authz/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/authz/v1beta1/query.proto rename to packages/types/protobuf/proto/cosmos/authz/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/authz/v1beta1/tx.proto b/packages/types/protobuf/proto/cosmos/authz/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/authz/v1beta1/tx.proto rename to packages/types/protobuf/proto/cosmos/authz/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/cosmos/autocli/v1/options.proto b/packages/types/protobuf/proto/cosmos/autocli/v1/options.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/autocli/v1/options.proto rename to packages/types/protobuf/proto/cosmos/autocli/v1/options.proto diff --git a/packages/utils/protobuf/proto/cosmos/autocli/v1/query.proto b/packages/types/protobuf/proto/cosmos/autocli/v1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/autocli/v1/query.proto rename to packages/types/protobuf/proto/cosmos/autocli/v1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/bank/module/v1/module.proto b/packages/types/protobuf/proto/cosmos/bank/module/v1/module.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/bank/module/v1/module.proto rename to packages/types/protobuf/proto/cosmos/bank/module/v1/module.proto diff --git a/packages/utils/protobuf/proto/cosmos/bank/v1beta1/authz.proto b/packages/types/protobuf/proto/cosmos/bank/v1beta1/authz.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/bank/v1beta1/authz.proto rename to packages/types/protobuf/proto/cosmos/bank/v1beta1/authz.proto diff --git a/packages/utils/protobuf/proto/cosmos/bank/v1beta1/bank.proto b/packages/types/protobuf/proto/cosmos/bank/v1beta1/bank.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/bank/v1beta1/bank.proto rename to packages/types/protobuf/proto/cosmos/bank/v1beta1/bank.proto diff --git a/packages/utils/protobuf/proto/cosmos/bank/v1beta1/genesis.proto b/packages/types/protobuf/proto/cosmos/bank/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/bank/v1beta1/genesis.proto rename to packages/types/protobuf/proto/cosmos/bank/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/cosmos/bank/v1beta1/query.proto b/packages/types/protobuf/proto/cosmos/bank/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/bank/v1beta1/query.proto rename to packages/types/protobuf/proto/cosmos/bank/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/bank/v1beta1/tx.proto b/packages/types/protobuf/proto/cosmos/bank/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/bank/v1beta1/tx.proto rename to packages/types/protobuf/proto/cosmos/bank/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/cosmos/base/abci/v1beta1/abci.proto b/packages/types/protobuf/proto/cosmos/base/abci/v1beta1/abci.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/base/abci/v1beta1/abci.proto rename to packages/types/protobuf/proto/cosmos/base/abci/v1beta1/abci.proto diff --git a/packages/utils/protobuf/proto/cosmos/base/node/v1beta1/query.proto b/packages/types/protobuf/proto/cosmos/base/node/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/base/node/v1beta1/query.proto rename to packages/types/protobuf/proto/cosmos/base/node/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/base/query/v1beta1/pagination.proto b/packages/types/protobuf/proto/cosmos/base/query/v1beta1/pagination.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/base/query/v1beta1/pagination.proto rename to packages/types/protobuf/proto/cosmos/base/query/v1beta1/pagination.proto diff --git a/packages/utils/protobuf/proto/cosmos/base/reflection/v1beta1/reflection.proto b/packages/types/protobuf/proto/cosmos/base/reflection/v1beta1/reflection.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/base/reflection/v1beta1/reflection.proto rename to packages/types/protobuf/proto/cosmos/base/reflection/v1beta1/reflection.proto diff --git a/packages/utils/protobuf/proto/cosmos/base/reflection/v2alpha1/reflection.proto b/packages/types/protobuf/proto/cosmos/base/reflection/v2alpha1/reflection.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/base/reflection/v2alpha1/reflection.proto rename to packages/types/protobuf/proto/cosmos/base/reflection/v2alpha1/reflection.proto diff --git a/packages/utils/protobuf/proto/cosmos/base/tendermint/v1beta1/query.proto b/packages/types/protobuf/proto/cosmos/base/tendermint/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/base/tendermint/v1beta1/query.proto rename to packages/types/protobuf/proto/cosmos/base/tendermint/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/base/tendermint/v1beta1/types.proto b/packages/types/protobuf/proto/cosmos/base/tendermint/v1beta1/types.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/base/tendermint/v1beta1/types.proto rename to packages/types/protobuf/proto/cosmos/base/tendermint/v1beta1/types.proto diff --git a/packages/utils/protobuf/proto/cosmos/base/v1beta1/coin.proto b/packages/types/protobuf/proto/cosmos/base/v1beta1/coin.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/base/v1beta1/coin.proto rename to packages/types/protobuf/proto/cosmos/base/v1beta1/coin.proto diff --git a/packages/utils/protobuf/proto/cosmos/circuit/module/v1/module.proto b/packages/types/protobuf/proto/cosmos/circuit/module/v1/module.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/circuit/module/v1/module.proto rename to packages/types/protobuf/proto/cosmos/circuit/module/v1/module.proto diff --git a/packages/utils/protobuf/proto/cosmos/circuit/v1/query.proto b/packages/types/protobuf/proto/cosmos/circuit/v1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/circuit/v1/query.proto rename to packages/types/protobuf/proto/cosmos/circuit/v1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/circuit/v1/tx.proto b/packages/types/protobuf/proto/cosmos/circuit/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/circuit/v1/tx.proto rename to packages/types/protobuf/proto/cosmos/circuit/v1/tx.proto diff --git a/packages/utils/protobuf/proto/cosmos/circuit/v1/types.proto b/packages/types/protobuf/proto/cosmos/circuit/v1/types.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/circuit/v1/types.proto rename to packages/types/protobuf/proto/cosmos/circuit/v1/types.proto diff --git a/packages/utils/protobuf/proto/cosmos/consensus/module/v1/module.proto b/packages/types/protobuf/proto/cosmos/consensus/module/v1/module.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/consensus/module/v1/module.proto rename to packages/types/protobuf/proto/cosmos/consensus/module/v1/module.proto diff --git a/packages/utils/protobuf/proto/cosmos/consensus/v1/query.proto b/packages/types/protobuf/proto/cosmos/consensus/v1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/consensus/v1/query.proto rename to packages/types/protobuf/proto/cosmos/consensus/v1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/consensus/v1/tx.proto b/packages/types/protobuf/proto/cosmos/consensus/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/consensus/v1/tx.proto rename to packages/types/protobuf/proto/cosmos/consensus/v1/tx.proto diff --git a/packages/utils/protobuf/proto/cosmos/crisis/module/v1/module.proto b/packages/types/protobuf/proto/cosmos/crisis/module/v1/module.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/crisis/module/v1/module.proto rename to packages/types/protobuf/proto/cosmos/crisis/module/v1/module.proto diff --git a/packages/utils/protobuf/proto/cosmos/crisis/v1beta1/genesis.proto b/packages/types/protobuf/proto/cosmos/crisis/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/crisis/v1beta1/genesis.proto rename to packages/types/protobuf/proto/cosmos/crisis/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/cosmos/crisis/v1beta1/tx.proto b/packages/types/protobuf/proto/cosmos/crisis/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/crisis/v1beta1/tx.proto rename to packages/types/protobuf/proto/cosmos/crisis/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/cosmos/crypto/ed25519/keys.proto b/packages/types/protobuf/proto/cosmos/crypto/ed25519/keys.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/crypto/ed25519/keys.proto rename to packages/types/protobuf/proto/cosmos/crypto/ed25519/keys.proto diff --git a/packages/utils/protobuf/proto/cosmos/crypto/hd/v1/hd.proto b/packages/types/protobuf/proto/cosmos/crypto/hd/v1/hd.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/crypto/hd/v1/hd.proto rename to packages/types/protobuf/proto/cosmos/crypto/hd/v1/hd.proto diff --git a/packages/utils/protobuf/proto/cosmos/crypto/keyring/v1/record.proto b/packages/types/protobuf/proto/cosmos/crypto/keyring/v1/record.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/crypto/keyring/v1/record.proto rename to packages/types/protobuf/proto/cosmos/crypto/keyring/v1/record.proto diff --git a/packages/utils/protobuf/proto/cosmos/crypto/multisig/keys.proto b/packages/types/protobuf/proto/cosmos/crypto/multisig/keys.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/crypto/multisig/keys.proto rename to packages/types/protobuf/proto/cosmos/crypto/multisig/keys.proto diff --git a/packages/utils/protobuf/proto/cosmos/crypto/multisig/v1beta1/multisig.proto b/packages/types/protobuf/proto/cosmos/crypto/multisig/v1beta1/multisig.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/crypto/multisig/v1beta1/multisig.proto rename to packages/types/protobuf/proto/cosmos/crypto/multisig/v1beta1/multisig.proto diff --git a/packages/utils/protobuf/proto/cosmos/crypto/secp256k1/keys.proto b/packages/types/protobuf/proto/cosmos/crypto/secp256k1/keys.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/crypto/secp256k1/keys.proto rename to packages/types/protobuf/proto/cosmos/crypto/secp256k1/keys.proto diff --git a/packages/utils/protobuf/proto/cosmos/crypto/secp256r1/keys.proto b/packages/types/protobuf/proto/cosmos/crypto/secp256r1/keys.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/crypto/secp256r1/keys.proto rename to packages/types/protobuf/proto/cosmos/crypto/secp256r1/keys.proto diff --git a/packages/utils/protobuf/proto/cosmos/distribution/module/v1/module.proto b/packages/types/protobuf/proto/cosmos/distribution/module/v1/module.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/distribution/module/v1/module.proto rename to packages/types/protobuf/proto/cosmos/distribution/module/v1/module.proto diff --git a/packages/utils/protobuf/proto/cosmos/distribution/v1beta1/distribution.proto b/packages/types/protobuf/proto/cosmos/distribution/v1beta1/distribution.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/distribution/v1beta1/distribution.proto rename to packages/types/protobuf/proto/cosmos/distribution/v1beta1/distribution.proto diff --git a/packages/utils/protobuf/proto/cosmos/distribution/v1beta1/genesis.proto b/packages/types/protobuf/proto/cosmos/distribution/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/distribution/v1beta1/genesis.proto rename to packages/types/protobuf/proto/cosmos/distribution/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/cosmos/distribution/v1beta1/query.proto b/packages/types/protobuf/proto/cosmos/distribution/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/distribution/v1beta1/query.proto rename to packages/types/protobuf/proto/cosmos/distribution/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/distribution/v1beta1/tx.proto b/packages/types/protobuf/proto/cosmos/distribution/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/distribution/v1beta1/tx.proto rename to packages/types/protobuf/proto/cosmos/distribution/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/cosmos/evidence/module/v1/module.proto b/packages/types/protobuf/proto/cosmos/evidence/module/v1/module.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/evidence/module/v1/module.proto rename to packages/types/protobuf/proto/cosmos/evidence/module/v1/module.proto diff --git a/packages/utils/protobuf/proto/cosmos/evidence/v1beta1/evidence.proto b/packages/types/protobuf/proto/cosmos/evidence/v1beta1/evidence.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/evidence/v1beta1/evidence.proto rename to packages/types/protobuf/proto/cosmos/evidence/v1beta1/evidence.proto diff --git a/packages/utils/protobuf/proto/cosmos/evidence/v1beta1/genesis.proto b/packages/types/protobuf/proto/cosmos/evidence/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/evidence/v1beta1/genesis.proto rename to packages/types/protobuf/proto/cosmos/evidence/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/cosmos/evidence/v1beta1/query.proto b/packages/types/protobuf/proto/cosmos/evidence/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/evidence/v1beta1/query.proto rename to packages/types/protobuf/proto/cosmos/evidence/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/evidence/v1beta1/tx.proto b/packages/types/protobuf/proto/cosmos/evidence/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/evidence/v1beta1/tx.proto rename to packages/types/protobuf/proto/cosmos/evidence/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/cosmos/feegrant/module/v1/module.proto b/packages/types/protobuf/proto/cosmos/feegrant/module/v1/module.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/feegrant/module/v1/module.proto rename to packages/types/protobuf/proto/cosmos/feegrant/module/v1/module.proto diff --git a/packages/utils/protobuf/proto/cosmos/feegrant/v1beta1/feegrant.proto b/packages/types/protobuf/proto/cosmos/feegrant/v1beta1/feegrant.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/feegrant/v1beta1/feegrant.proto rename to packages/types/protobuf/proto/cosmos/feegrant/v1beta1/feegrant.proto diff --git a/packages/utils/protobuf/proto/cosmos/feegrant/v1beta1/genesis.proto b/packages/types/protobuf/proto/cosmos/feegrant/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/feegrant/v1beta1/genesis.proto rename to packages/types/protobuf/proto/cosmos/feegrant/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/cosmos/feegrant/v1beta1/query.proto b/packages/types/protobuf/proto/cosmos/feegrant/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/feegrant/v1beta1/query.proto rename to packages/types/protobuf/proto/cosmos/feegrant/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/feegrant/v1beta1/tx.proto b/packages/types/protobuf/proto/cosmos/feegrant/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/feegrant/v1beta1/tx.proto rename to packages/types/protobuf/proto/cosmos/feegrant/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/cosmos/genutil/module/v1/module.proto b/packages/types/protobuf/proto/cosmos/genutil/module/v1/module.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/genutil/module/v1/module.proto rename to packages/types/protobuf/proto/cosmos/genutil/module/v1/module.proto diff --git a/packages/utils/protobuf/proto/cosmos/genutil/v1beta1/genesis.proto b/packages/types/protobuf/proto/cosmos/genutil/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/genutil/v1beta1/genesis.proto rename to packages/types/protobuf/proto/cosmos/genutil/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/cosmos/gov/module/v1/module.proto b/packages/types/protobuf/proto/cosmos/gov/module/v1/module.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/gov/module/v1/module.proto rename to packages/types/protobuf/proto/cosmos/gov/module/v1/module.proto diff --git a/packages/utils/protobuf/proto/cosmos/gov/v1/genesis.proto b/packages/types/protobuf/proto/cosmos/gov/v1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/gov/v1/genesis.proto rename to packages/types/protobuf/proto/cosmos/gov/v1/genesis.proto diff --git a/packages/utils/protobuf/proto/cosmos/gov/v1/gov.proto b/packages/types/protobuf/proto/cosmos/gov/v1/gov.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/gov/v1/gov.proto rename to packages/types/protobuf/proto/cosmos/gov/v1/gov.proto diff --git a/packages/utils/protobuf/proto/cosmos/gov/v1/query.proto b/packages/types/protobuf/proto/cosmos/gov/v1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/gov/v1/query.proto rename to packages/types/protobuf/proto/cosmos/gov/v1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/gov/v1/tx.proto b/packages/types/protobuf/proto/cosmos/gov/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/gov/v1/tx.proto rename to packages/types/protobuf/proto/cosmos/gov/v1/tx.proto diff --git a/packages/utils/protobuf/proto/cosmos/gov/v1beta1/genesis.proto b/packages/types/protobuf/proto/cosmos/gov/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/gov/v1beta1/genesis.proto rename to packages/types/protobuf/proto/cosmos/gov/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/cosmos/gov/v1beta1/gov.proto b/packages/types/protobuf/proto/cosmos/gov/v1beta1/gov.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/gov/v1beta1/gov.proto rename to packages/types/protobuf/proto/cosmos/gov/v1beta1/gov.proto diff --git a/packages/utils/protobuf/proto/cosmos/gov/v1beta1/query.proto b/packages/types/protobuf/proto/cosmos/gov/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/gov/v1beta1/query.proto rename to packages/types/protobuf/proto/cosmos/gov/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/gov/v1beta1/tx.proto b/packages/types/protobuf/proto/cosmos/gov/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/gov/v1beta1/tx.proto rename to packages/types/protobuf/proto/cosmos/gov/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/cosmos/group/module/v1/module.proto b/packages/types/protobuf/proto/cosmos/group/module/v1/module.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/group/module/v1/module.proto rename to packages/types/protobuf/proto/cosmos/group/module/v1/module.proto diff --git a/packages/utils/protobuf/proto/cosmos/group/v1/events.proto b/packages/types/protobuf/proto/cosmos/group/v1/events.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/group/v1/events.proto rename to packages/types/protobuf/proto/cosmos/group/v1/events.proto diff --git a/packages/utils/protobuf/proto/cosmos/group/v1/genesis.proto b/packages/types/protobuf/proto/cosmos/group/v1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/group/v1/genesis.proto rename to packages/types/protobuf/proto/cosmos/group/v1/genesis.proto diff --git a/packages/utils/protobuf/proto/cosmos/group/v1/query.proto b/packages/types/protobuf/proto/cosmos/group/v1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/group/v1/query.proto rename to packages/types/protobuf/proto/cosmos/group/v1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/group/v1/tx.proto b/packages/types/protobuf/proto/cosmos/group/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/group/v1/tx.proto rename to packages/types/protobuf/proto/cosmos/group/v1/tx.proto diff --git a/packages/utils/protobuf/proto/cosmos/group/v1/types.proto b/packages/types/protobuf/proto/cosmos/group/v1/types.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/group/v1/types.proto rename to packages/types/protobuf/proto/cosmos/group/v1/types.proto diff --git a/packages/utils/protobuf/proto/cosmos/ics23/v1/proofs.proto b/packages/types/protobuf/proto/cosmos/ics23/v1/proofs.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/ics23/v1/proofs.proto rename to packages/types/protobuf/proto/cosmos/ics23/v1/proofs.proto diff --git a/packages/utils/protobuf/proto/cosmos/mint/module/v1/module.proto b/packages/types/protobuf/proto/cosmos/mint/module/v1/module.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/mint/module/v1/module.proto rename to packages/types/protobuf/proto/cosmos/mint/module/v1/module.proto diff --git a/packages/utils/protobuf/proto/cosmos/mint/v1beta1/genesis.proto b/packages/types/protobuf/proto/cosmos/mint/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/mint/v1beta1/genesis.proto rename to packages/types/protobuf/proto/cosmos/mint/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/cosmos/mint/v1beta1/mint.proto b/packages/types/protobuf/proto/cosmos/mint/v1beta1/mint.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/mint/v1beta1/mint.proto rename to packages/types/protobuf/proto/cosmos/mint/v1beta1/mint.proto diff --git a/packages/utils/protobuf/proto/cosmos/mint/v1beta1/query.proto b/packages/types/protobuf/proto/cosmos/mint/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/mint/v1beta1/query.proto rename to packages/types/protobuf/proto/cosmos/mint/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/mint/v1beta1/tx.proto b/packages/types/protobuf/proto/cosmos/mint/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/mint/v1beta1/tx.proto rename to packages/types/protobuf/proto/cosmos/mint/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/cosmos/msg/textual/v1/textual.proto b/packages/types/protobuf/proto/cosmos/msg/textual/v1/textual.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/msg/textual/v1/textual.proto rename to packages/types/protobuf/proto/cosmos/msg/textual/v1/textual.proto diff --git a/packages/utils/protobuf/proto/cosmos/msg/v1/msg.proto b/packages/types/protobuf/proto/cosmos/msg/v1/msg.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/msg/v1/msg.proto rename to packages/types/protobuf/proto/cosmos/msg/v1/msg.proto diff --git a/packages/utils/protobuf/proto/cosmos/nft/module/v1/module.proto b/packages/types/protobuf/proto/cosmos/nft/module/v1/module.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/nft/module/v1/module.proto rename to packages/types/protobuf/proto/cosmos/nft/module/v1/module.proto diff --git a/packages/utils/protobuf/proto/cosmos/nft/v1beta1/event.proto b/packages/types/protobuf/proto/cosmos/nft/v1beta1/event.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/nft/v1beta1/event.proto rename to packages/types/protobuf/proto/cosmos/nft/v1beta1/event.proto diff --git a/packages/utils/protobuf/proto/cosmos/nft/v1beta1/genesis.proto b/packages/types/protobuf/proto/cosmos/nft/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/nft/v1beta1/genesis.proto rename to packages/types/protobuf/proto/cosmos/nft/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/cosmos/nft/v1beta1/nft.proto b/packages/types/protobuf/proto/cosmos/nft/v1beta1/nft.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/nft/v1beta1/nft.proto rename to packages/types/protobuf/proto/cosmos/nft/v1beta1/nft.proto diff --git a/packages/utils/protobuf/proto/cosmos/nft/v1beta1/query.proto b/packages/types/protobuf/proto/cosmos/nft/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/nft/v1beta1/query.proto rename to packages/types/protobuf/proto/cosmos/nft/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/nft/v1beta1/tx.proto b/packages/types/protobuf/proto/cosmos/nft/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/nft/v1beta1/tx.proto rename to packages/types/protobuf/proto/cosmos/nft/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/cosmos/orm/module/v1alpha1/module.proto b/packages/types/protobuf/proto/cosmos/orm/module/v1alpha1/module.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/orm/module/v1alpha1/module.proto rename to packages/types/protobuf/proto/cosmos/orm/module/v1alpha1/module.proto diff --git a/packages/utils/protobuf/proto/cosmos/orm/query/v1alpha1/query.proto b/packages/types/protobuf/proto/cosmos/orm/query/v1alpha1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/orm/query/v1alpha1/query.proto rename to packages/types/protobuf/proto/cosmos/orm/query/v1alpha1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/orm/v1/orm.proto b/packages/types/protobuf/proto/cosmos/orm/v1/orm.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/orm/v1/orm.proto rename to packages/types/protobuf/proto/cosmos/orm/v1/orm.proto diff --git a/packages/utils/protobuf/proto/cosmos/orm/v1alpha1/schema.proto b/packages/types/protobuf/proto/cosmos/orm/v1alpha1/schema.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/orm/v1alpha1/schema.proto rename to packages/types/protobuf/proto/cosmos/orm/v1alpha1/schema.proto diff --git a/packages/utils/protobuf/proto/cosmos/params/module/v1/module.proto b/packages/types/protobuf/proto/cosmos/params/module/v1/module.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/params/module/v1/module.proto rename to packages/types/protobuf/proto/cosmos/params/module/v1/module.proto diff --git a/packages/utils/protobuf/proto/cosmos/params/v1beta1/params.proto b/packages/types/protobuf/proto/cosmos/params/v1beta1/params.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/params/v1beta1/params.proto rename to packages/types/protobuf/proto/cosmos/params/v1beta1/params.proto diff --git a/packages/utils/protobuf/proto/cosmos/params/v1beta1/query.proto b/packages/types/protobuf/proto/cosmos/params/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/params/v1beta1/query.proto rename to packages/types/protobuf/proto/cosmos/params/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/query/v1/query.proto b/packages/types/protobuf/proto/cosmos/query/v1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/query/v1/query.proto rename to packages/types/protobuf/proto/cosmos/query/v1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/reflection/v1/reflection.proto b/packages/types/protobuf/proto/cosmos/reflection/v1/reflection.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/reflection/v1/reflection.proto rename to packages/types/protobuf/proto/cosmos/reflection/v1/reflection.proto diff --git a/packages/utils/protobuf/proto/cosmos/slashing/module/v1/module.proto b/packages/types/protobuf/proto/cosmos/slashing/module/v1/module.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/slashing/module/v1/module.proto rename to packages/types/protobuf/proto/cosmos/slashing/module/v1/module.proto diff --git a/packages/utils/protobuf/proto/cosmos/slashing/v1beta1/genesis.proto b/packages/types/protobuf/proto/cosmos/slashing/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/slashing/v1beta1/genesis.proto rename to packages/types/protobuf/proto/cosmos/slashing/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/cosmos/slashing/v1beta1/query.proto b/packages/types/protobuf/proto/cosmos/slashing/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/slashing/v1beta1/query.proto rename to packages/types/protobuf/proto/cosmos/slashing/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/slashing/v1beta1/slashing.proto b/packages/types/protobuf/proto/cosmos/slashing/v1beta1/slashing.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/slashing/v1beta1/slashing.proto rename to packages/types/protobuf/proto/cosmos/slashing/v1beta1/slashing.proto diff --git a/packages/utils/protobuf/proto/cosmos/slashing/v1beta1/tx.proto b/packages/types/protobuf/proto/cosmos/slashing/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/slashing/v1beta1/tx.proto rename to packages/types/protobuf/proto/cosmos/slashing/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/cosmos/staking/module/v1/module.proto b/packages/types/protobuf/proto/cosmos/staking/module/v1/module.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/staking/module/v1/module.proto rename to packages/types/protobuf/proto/cosmos/staking/module/v1/module.proto diff --git a/packages/utils/protobuf/proto/cosmos/staking/v1beta1/authz.proto b/packages/types/protobuf/proto/cosmos/staking/v1beta1/authz.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/staking/v1beta1/authz.proto rename to packages/types/protobuf/proto/cosmos/staking/v1beta1/authz.proto diff --git a/packages/utils/protobuf/proto/cosmos/staking/v1beta1/genesis.proto b/packages/types/protobuf/proto/cosmos/staking/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/staking/v1beta1/genesis.proto rename to packages/types/protobuf/proto/cosmos/staking/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/cosmos/staking/v1beta1/query.proto b/packages/types/protobuf/proto/cosmos/staking/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/staking/v1beta1/query.proto rename to packages/types/protobuf/proto/cosmos/staking/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/staking/v1beta1/staking.proto b/packages/types/protobuf/proto/cosmos/staking/v1beta1/staking.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/staking/v1beta1/staking.proto rename to packages/types/protobuf/proto/cosmos/staking/v1beta1/staking.proto diff --git a/packages/utils/protobuf/proto/cosmos/staking/v1beta1/tx.proto b/packages/types/protobuf/proto/cosmos/staking/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/staking/v1beta1/tx.proto rename to packages/types/protobuf/proto/cosmos/staking/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/cosmos/store/internal/kv/v1beta1/kv.proto b/packages/types/protobuf/proto/cosmos/store/internal/kv/v1beta1/kv.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/store/internal/kv/v1beta1/kv.proto rename to packages/types/protobuf/proto/cosmos/store/internal/kv/v1beta1/kv.proto diff --git a/packages/utils/protobuf/proto/cosmos/store/snapshots/v1/snapshot.proto b/packages/types/protobuf/proto/cosmos/store/snapshots/v1/snapshot.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/store/snapshots/v1/snapshot.proto rename to packages/types/protobuf/proto/cosmos/store/snapshots/v1/snapshot.proto diff --git a/packages/utils/protobuf/proto/cosmos/store/streaming/abci/grpc.proto b/packages/types/protobuf/proto/cosmos/store/streaming/abci/grpc.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/store/streaming/abci/grpc.proto rename to packages/types/protobuf/proto/cosmos/store/streaming/abci/grpc.proto diff --git a/packages/utils/protobuf/proto/cosmos/store/v1beta1/commit_info.proto b/packages/types/protobuf/proto/cosmos/store/v1beta1/commit_info.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/store/v1beta1/commit_info.proto rename to packages/types/protobuf/proto/cosmos/store/v1beta1/commit_info.proto diff --git a/packages/utils/protobuf/proto/cosmos/store/v1beta1/listening.proto b/packages/types/protobuf/proto/cosmos/store/v1beta1/listening.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/store/v1beta1/listening.proto rename to packages/types/protobuf/proto/cosmos/store/v1beta1/listening.proto diff --git a/packages/utils/protobuf/proto/cosmos/tx/config/v1/config.proto b/packages/types/protobuf/proto/cosmos/tx/config/v1/config.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/tx/config/v1/config.proto rename to packages/types/protobuf/proto/cosmos/tx/config/v1/config.proto diff --git a/packages/utils/protobuf/proto/cosmos/tx/signing/v1beta1/signing.proto b/packages/types/protobuf/proto/cosmos/tx/signing/v1beta1/signing.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/tx/signing/v1beta1/signing.proto rename to packages/types/protobuf/proto/cosmos/tx/signing/v1beta1/signing.proto diff --git a/packages/utils/protobuf/proto/cosmos/tx/v1beta1/service.proto b/packages/types/protobuf/proto/cosmos/tx/v1beta1/service.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/tx/v1beta1/service.proto rename to packages/types/protobuf/proto/cosmos/tx/v1beta1/service.proto diff --git a/packages/utils/protobuf/proto/cosmos/tx/v1beta1/tx.proto b/packages/types/protobuf/proto/cosmos/tx/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/tx/v1beta1/tx.proto rename to packages/types/protobuf/proto/cosmos/tx/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/cosmos/upgrade/module/v1/module.proto b/packages/types/protobuf/proto/cosmos/upgrade/module/v1/module.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/upgrade/module/v1/module.proto rename to packages/types/protobuf/proto/cosmos/upgrade/module/v1/module.proto diff --git a/packages/utils/protobuf/proto/cosmos/upgrade/v1beta1/query.proto b/packages/types/protobuf/proto/cosmos/upgrade/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/upgrade/v1beta1/query.proto rename to packages/types/protobuf/proto/cosmos/upgrade/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/cosmos/upgrade/v1beta1/tx.proto b/packages/types/protobuf/proto/cosmos/upgrade/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/upgrade/v1beta1/tx.proto rename to packages/types/protobuf/proto/cosmos/upgrade/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/cosmos/upgrade/v1beta1/upgrade.proto b/packages/types/protobuf/proto/cosmos/upgrade/v1beta1/upgrade.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/upgrade/v1beta1/upgrade.proto rename to packages/types/protobuf/proto/cosmos/upgrade/v1beta1/upgrade.proto diff --git a/packages/utils/protobuf/proto/cosmos/vesting/module/v1/module.proto b/packages/types/protobuf/proto/cosmos/vesting/module/v1/module.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/vesting/module/v1/module.proto rename to packages/types/protobuf/proto/cosmos/vesting/module/v1/module.proto diff --git a/packages/utils/protobuf/proto/cosmos/vesting/v1beta1/tx.proto b/packages/types/protobuf/proto/cosmos/vesting/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/vesting/v1beta1/tx.proto rename to packages/types/protobuf/proto/cosmos/vesting/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/cosmos/vesting/v1beta1/vesting.proto b/packages/types/protobuf/proto/cosmos/vesting/v1beta1/vesting.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos/vesting/v1beta1/vesting.proto rename to packages/types/protobuf/proto/cosmos/vesting/v1beta1/vesting.proto diff --git a/packages/utils/protobuf/proto/cosmos_proto/LICENSE b/packages/types/protobuf/proto/cosmos_proto/LICENSE similarity index 100% rename from packages/utils/protobuf/proto/cosmos_proto/LICENSE rename to packages/types/protobuf/proto/cosmos_proto/LICENSE diff --git a/packages/utils/protobuf/proto/cosmos_proto/README.md b/packages/types/protobuf/proto/cosmos_proto/README.md similarity index 100% rename from packages/utils/protobuf/proto/cosmos_proto/README.md rename to packages/types/protobuf/proto/cosmos_proto/README.md diff --git a/packages/utils/protobuf/proto/cosmos_proto/cosmos.proto b/packages/types/protobuf/proto/cosmos_proto/cosmos.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmos_proto/cosmos.proto rename to packages/types/protobuf/proto/cosmos_proto/cosmos.proto diff --git a/packages/utils/protobuf/proto/cosmwasm/LICENSE b/packages/types/protobuf/proto/cosmwasm/LICENSE similarity index 100% rename from packages/utils/protobuf/proto/cosmwasm/LICENSE rename to packages/types/protobuf/proto/cosmwasm/LICENSE diff --git a/packages/utils/protobuf/proto/cosmwasm/README.md b/packages/types/protobuf/proto/cosmwasm/README.md similarity index 100% rename from packages/utils/protobuf/proto/cosmwasm/README.md rename to packages/types/protobuf/proto/cosmwasm/README.md diff --git a/packages/utils/protobuf/proto/cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto b/packages/types/protobuf/proto/cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto rename to packages/types/protobuf/proto/cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto diff --git a/packages/utils/protobuf/proto/cosmwasm/tokenfactory/v1beta1/genesis.proto b/packages/types/protobuf/proto/cosmwasm/tokenfactory/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmwasm/tokenfactory/v1beta1/genesis.proto rename to packages/types/protobuf/proto/cosmwasm/tokenfactory/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/cosmwasm/tokenfactory/v1beta1/params.proto b/packages/types/protobuf/proto/cosmwasm/tokenfactory/v1beta1/params.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmwasm/tokenfactory/v1beta1/params.proto rename to packages/types/protobuf/proto/cosmwasm/tokenfactory/v1beta1/params.proto diff --git a/packages/utils/protobuf/proto/cosmwasm/tokenfactory/v1beta1/query.proto b/packages/types/protobuf/proto/cosmwasm/tokenfactory/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmwasm/tokenfactory/v1beta1/query.proto rename to packages/types/protobuf/proto/cosmwasm/tokenfactory/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/cosmwasm/tokenfactory/v1beta1/tx.proto b/packages/types/protobuf/proto/cosmwasm/tokenfactory/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmwasm/tokenfactory/v1beta1/tx.proto rename to packages/types/protobuf/proto/cosmwasm/tokenfactory/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/cosmwasm/wasm/v1/authz.proto b/packages/types/protobuf/proto/cosmwasm/wasm/v1/authz.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmwasm/wasm/v1/authz.proto rename to packages/types/protobuf/proto/cosmwasm/wasm/v1/authz.proto diff --git a/packages/utils/protobuf/proto/cosmwasm/wasm/v1/genesis.proto b/packages/types/protobuf/proto/cosmwasm/wasm/v1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmwasm/wasm/v1/genesis.proto rename to packages/types/protobuf/proto/cosmwasm/wasm/v1/genesis.proto diff --git a/packages/utils/protobuf/proto/cosmwasm/wasm/v1/ibc.proto b/packages/types/protobuf/proto/cosmwasm/wasm/v1/ibc.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmwasm/wasm/v1/ibc.proto rename to packages/types/protobuf/proto/cosmwasm/wasm/v1/ibc.proto diff --git a/packages/utils/protobuf/proto/cosmwasm/wasm/v1/proposal.proto b/packages/types/protobuf/proto/cosmwasm/wasm/v1/proposal.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmwasm/wasm/v1/proposal.proto rename to packages/types/protobuf/proto/cosmwasm/wasm/v1/proposal.proto diff --git a/packages/utils/protobuf/proto/cosmwasm/wasm/v1/query.proto b/packages/types/protobuf/proto/cosmwasm/wasm/v1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmwasm/wasm/v1/query.proto rename to packages/types/protobuf/proto/cosmwasm/wasm/v1/query.proto diff --git a/packages/utils/protobuf/proto/cosmwasm/wasm/v1/tx.proto b/packages/types/protobuf/proto/cosmwasm/wasm/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmwasm/wasm/v1/tx.proto rename to packages/types/protobuf/proto/cosmwasm/wasm/v1/tx.proto diff --git a/packages/utils/protobuf/proto/cosmwasm/wasm/v1/types.proto b/packages/types/protobuf/proto/cosmwasm/wasm/v1/types.proto similarity index 100% rename from packages/utils/protobuf/proto/cosmwasm/wasm/v1/types.proto rename to packages/types/protobuf/proto/cosmwasm/wasm/v1/types.proto diff --git a/packages/utils/protobuf/proto/gaia/globalfee/v1beta1/genesis.proto b/packages/types/protobuf/proto/gaia/globalfee/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/gaia/globalfee/v1beta1/genesis.proto rename to packages/types/protobuf/proto/gaia/globalfee/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/gaia/globalfee/v1beta1/query.proto b/packages/types/protobuf/proto/gaia/globalfee/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/gaia/globalfee/v1beta1/query.proto rename to packages/types/protobuf/proto/gaia/globalfee/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/gaia/globalfee/v1beta1/tx.proto b/packages/types/protobuf/proto/gaia/globalfee/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/gaia/globalfee/v1beta1/tx.proto rename to packages/types/protobuf/proto/gaia/globalfee/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/gogoproto/LICENSE b/packages/types/protobuf/proto/gogoproto/LICENSE similarity index 100% rename from packages/utils/protobuf/proto/gogoproto/LICENSE rename to packages/types/protobuf/proto/gogoproto/LICENSE diff --git a/packages/utils/protobuf/proto/gogoproto/README.md b/packages/types/protobuf/proto/gogoproto/README.md similarity index 100% rename from packages/utils/protobuf/proto/gogoproto/README.md rename to packages/types/protobuf/proto/gogoproto/README.md diff --git a/packages/utils/protobuf/proto/gogoproto/gogo.proto b/packages/types/protobuf/proto/gogoproto/gogo.proto similarity index 100% rename from packages/utils/protobuf/proto/gogoproto/gogo.proto rename to packages/types/protobuf/proto/gogoproto/gogo.proto diff --git a/packages/utils/protobuf/proto/google/LICENSE b/packages/types/protobuf/proto/google/LICENSE similarity index 100% rename from packages/utils/protobuf/proto/google/LICENSE rename to packages/types/protobuf/proto/google/LICENSE diff --git a/packages/utils/protobuf/proto/google/README.md b/packages/types/protobuf/proto/google/README.md similarity index 100% rename from packages/utils/protobuf/proto/google/README.md rename to packages/types/protobuf/proto/google/README.md diff --git a/packages/utils/protobuf/proto/google/api/annotations.proto b/packages/types/protobuf/proto/google/api/annotations.proto similarity index 100% rename from packages/utils/protobuf/proto/google/api/annotations.proto rename to packages/types/protobuf/proto/google/api/annotations.proto diff --git a/packages/utils/protobuf/proto/google/api/http.proto b/packages/types/protobuf/proto/google/api/http.proto similarity index 100% rename from packages/utils/protobuf/proto/google/api/http.proto rename to packages/types/protobuf/proto/google/api/http.proto diff --git a/packages/utils/protobuf/proto/google/protobuf/any.proto b/packages/types/protobuf/proto/google/protobuf/any.proto similarity index 100% rename from packages/utils/protobuf/proto/google/protobuf/any.proto rename to packages/types/protobuf/proto/google/protobuf/any.proto diff --git a/packages/utils/protobuf/proto/google/protobuf/descriptor.proto b/packages/types/protobuf/proto/google/protobuf/descriptor.proto similarity index 100% rename from packages/utils/protobuf/proto/google/protobuf/descriptor.proto rename to packages/types/protobuf/proto/google/protobuf/descriptor.proto diff --git a/packages/utils/protobuf/proto/google/protobuf/duration.proto b/packages/types/protobuf/proto/google/protobuf/duration.proto similarity index 100% rename from packages/utils/protobuf/proto/google/protobuf/duration.proto rename to packages/types/protobuf/proto/google/protobuf/duration.proto diff --git a/packages/utils/protobuf/proto/google/protobuf/empty.proto b/packages/types/protobuf/proto/google/protobuf/empty.proto similarity index 100% rename from packages/utils/protobuf/proto/google/protobuf/empty.proto rename to packages/types/protobuf/proto/google/protobuf/empty.proto diff --git a/packages/utils/protobuf/proto/google/protobuf/timestamp.proto b/packages/types/protobuf/proto/google/protobuf/timestamp.proto similarity index 100% rename from packages/utils/protobuf/proto/google/protobuf/timestamp.proto rename to packages/types/protobuf/proto/google/protobuf/timestamp.proto diff --git a/packages/utils/protobuf/proto/ibc/applications/fee/v1/ack.proto b/packages/types/protobuf/proto/ibc/applications/fee/v1/ack.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/applications/fee/v1/ack.proto rename to packages/types/protobuf/proto/ibc/applications/fee/v1/ack.proto diff --git a/packages/utils/protobuf/proto/ibc/applications/fee/v1/fee.proto b/packages/types/protobuf/proto/ibc/applications/fee/v1/fee.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/applications/fee/v1/fee.proto rename to packages/types/protobuf/proto/ibc/applications/fee/v1/fee.proto diff --git a/packages/utils/protobuf/proto/ibc/applications/fee/v1/genesis.proto b/packages/types/protobuf/proto/ibc/applications/fee/v1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/applications/fee/v1/genesis.proto rename to packages/types/protobuf/proto/ibc/applications/fee/v1/genesis.proto diff --git a/packages/utils/protobuf/proto/ibc/applications/fee/v1/metadata.proto b/packages/types/protobuf/proto/ibc/applications/fee/v1/metadata.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/applications/fee/v1/metadata.proto rename to packages/types/protobuf/proto/ibc/applications/fee/v1/metadata.proto diff --git a/packages/utils/protobuf/proto/ibc/applications/fee/v1/query.proto b/packages/types/protobuf/proto/ibc/applications/fee/v1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/applications/fee/v1/query.proto rename to packages/types/protobuf/proto/ibc/applications/fee/v1/query.proto diff --git a/packages/utils/protobuf/proto/ibc/applications/fee/v1/tx.proto b/packages/types/protobuf/proto/ibc/applications/fee/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/applications/fee/v1/tx.proto rename to packages/types/protobuf/proto/ibc/applications/fee/v1/tx.proto diff --git a/packages/utils/protobuf/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto b/packages/types/protobuf/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto rename to packages/types/protobuf/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto diff --git a/packages/utils/protobuf/proto/ibc/applications/interchain_accounts/controller/v1/query.proto b/packages/types/protobuf/proto/ibc/applications/interchain_accounts/controller/v1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/applications/interchain_accounts/controller/v1/query.proto rename to packages/types/protobuf/proto/ibc/applications/interchain_accounts/controller/v1/query.proto diff --git a/packages/utils/protobuf/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto b/packages/types/protobuf/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto rename to packages/types/protobuf/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto diff --git a/packages/utils/protobuf/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto b/packages/types/protobuf/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto rename to packages/types/protobuf/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto diff --git a/packages/utils/protobuf/proto/ibc/applications/interchain_accounts/host/v1/host.proto b/packages/types/protobuf/proto/ibc/applications/interchain_accounts/host/v1/host.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/applications/interchain_accounts/host/v1/host.proto rename to packages/types/protobuf/proto/ibc/applications/interchain_accounts/host/v1/host.proto diff --git a/packages/utils/protobuf/proto/ibc/applications/interchain_accounts/host/v1/query.proto b/packages/types/protobuf/proto/ibc/applications/interchain_accounts/host/v1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/applications/interchain_accounts/host/v1/query.proto rename to packages/types/protobuf/proto/ibc/applications/interchain_accounts/host/v1/query.proto diff --git a/packages/utils/protobuf/proto/ibc/applications/interchain_accounts/host/v1/tx.proto b/packages/types/protobuf/proto/ibc/applications/interchain_accounts/host/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/applications/interchain_accounts/host/v1/tx.proto rename to packages/types/protobuf/proto/ibc/applications/interchain_accounts/host/v1/tx.proto diff --git a/packages/utils/protobuf/proto/ibc/applications/interchain_accounts/v1/account.proto b/packages/types/protobuf/proto/ibc/applications/interchain_accounts/v1/account.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/applications/interchain_accounts/v1/account.proto rename to packages/types/protobuf/proto/ibc/applications/interchain_accounts/v1/account.proto diff --git a/packages/utils/protobuf/proto/ibc/applications/interchain_accounts/v1/metadata.proto b/packages/types/protobuf/proto/ibc/applications/interchain_accounts/v1/metadata.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/applications/interchain_accounts/v1/metadata.proto rename to packages/types/protobuf/proto/ibc/applications/interchain_accounts/v1/metadata.proto diff --git a/packages/utils/protobuf/proto/ibc/applications/interchain_accounts/v1/packet.proto b/packages/types/protobuf/proto/ibc/applications/interchain_accounts/v1/packet.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/applications/interchain_accounts/v1/packet.proto rename to packages/types/protobuf/proto/ibc/applications/interchain_accounts/v1/packet.proto diff --git a/packages/utils/protobuf/proto/ibc/applications/transfer/v1/authz.proto b/packages/types/protobuf/proto/ibc/applications/transfer/v1/authz.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/applications/transfer/v1/authz.proto rename to packages/types/protobuf/proto/ibc/applications/transfer/v1/authz.proto diff --git a/packages/utils/protobuf/proto/ibc/applications/transfer/v1/genesis.proto b/packages/types/protobuf/proto/ibc/applications/transfer/v1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/applications/transfer/v1/genesis.proto rename to packages/types/protobuf/proto/ibc/applications/transfer/v1/genesis.proto diff --git a/packages/utils/protobuf/proto/ibc/applications/transfer/v1/query.proto b/packages/types/protobuf/proto/ibc/applications/transfer/v1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/applications/transfer/v1/query.proto rename to packages/types/protobuf/proto/ibc/applications/transfer/v1/query.proto diff --git a/packages/utils/protobuf/proto/ibc/applications/transfer/v1/transfer.proto b/packages/types/protobuf/proto/ibc/applications/transfer/v1/transfer.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/applications/transfer/v1/transfer.proto rename to packages/types/protobuf/proto/ibc/applications/transfer/v1/transfer.proto diff --git a/packages/utils/protobuf/proto/ibc/applications/transfer/v1/tx.proto b/packages/types/protobuf/proto/ibc/applications/transfer/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/applications/transfer/v1/tx.proto rename to packages/types/protobuf/proto/ibc/applications/transfer/v1/tx.proto diff --git a/packages/utils/protobuf/proto/ibc/applications/transfer/v2/packet.proto b/packages/types/protobuf/proto/ibc/applications/transfer/v2/packet.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/applications/transfer/v2/packet.proto rename to packages/types/protobuf/proto/ibc/applications/transfer/v2/packet.proto diff --git a/packages/utils/protobuf/proto/ibc/core/channel/v1/channel.proto b/packages/types/protobuf/proto/ibc/core/channel/v1/channel.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/core/channel/v1/channel.proto rename to packages/types/protobuf/proto/ibc/core/channel/v1/channel.proto diff --git a/packages/utils/protobuf/proto/ibc/core/channel/v1/genesis.proto b/packages/types/protobuf/proto/ibc/core/channel/v1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/core/channel/v1/genesis.proto rename to packages/types/protobuf/proto/ibc/core/channel/v1/genesis.proto diff --git a/packages/utils/protobuf/proto/ibc/core/channel/v1/query.proto b/packages/types/protobuf/proto/ibc/core/channel/v1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/core/channel/v1/query.proto rename to packages/types/protobuf/proto/ibc/core/channel/v1/query.proto diff --git a/packages/utils/protobuf/proto/ibc/core/channel/v1/tx.proto b/packages/types/protobuf/proto/ibc/core/channel/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/core/channel/v1/tx.proto rename to packages/types/protobuf/proto/ibc/core/channel/v1/tx.proto diff --git a/packages/utils/protobuf/proto/ibc/core/client/v1/client.proto b/packages/types/protobuf/proto/ibc/core/client/v1/client.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/core/client/v1/client.proto rename to packages/types/protobuf/proto/ibc/core/client/v1/client.proto diff --git a/packages/utils/protobuf/proto/ibc/core/client/v1/genesis.proto b/packages/types/protobuf/proto/ibc/core/client/v1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/core/client/v1/genesis.proto rename to packages/types/protobuf/proto/ibc/core/client/v1/genesis.proto diff --git a/packages/utils/protobuf/proto/ibc/core/client/v1/query.proto b/packages/types/protobuf/proto/ibc/core/client/v1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/core/client/v1/query.proto rename to packages/types/protobuf/proto/ibc/core/client/v1/query.proto diff --git a/packages/utils/protobuf/proto/ibc/core/client/v1/tx.proto b/packages/types/protobuf/proto/ibc/core/client/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/core/client/v1/tx.proto rename to packages/types/protobuf/proto/ibc/core/client/v1/tx.proto diff --git a/packages/utils/protobuf/proto/ibc/core/commitment/v1/commitment.proto b/packages/types/protobuf/proto/ibc/core/commitment/v1/commitment.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/core/commitment/v1/commitment.proto rename to packages/types/protobuf/proto/ibc/core/commitment/v1/commitment.proto diff --git a/packages/utils/protobuf/proto/ibc/core/connection/v1/connection.proto b/packages/types/protobuf/proto/ibc/core/connection/v1/connection.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/core/connection/v1/connection.proto rename to packages/types/protobuf/proto/ibc/core/connection/v1/connection.proto diff --git a/packages/utils/protobuf/proto/ibc/core/connection/v1/genesis.proto b/packages/types/protobuf/proto/ibc/core/connection/v1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/core/connection/v1/genesis.proto rename to packages/types/protobuf/proto/ibc/core/connection/v1/genesis.proto diff --git a/packages/utils/protobuf/proto/ibc/core/connection/v1/query.proto b/packages/types/protobuf/proto/ibc/core/connection/v1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/core/connection/v1/query.proto rename to packages/types/protobuf/proto/ibc/core/connection/v1/query.proto diff --git a/packages/utils/protobuf/proto/ibc/core/connection/v1/tx.proto b/packages/types/protobuf/proto/ibc/core/connection/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/core/connection/v1/tx.proto rename to packages/types/protobuf/proto/ibc/core/connection/v1/tx.proto diff --git a/packages/utils/protobuf/proto/ibc/core/types/v1/genesis.proto b/packages/types/protobuf/proto/ibc/core/types/v1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/core/types/v1/genesis.proto rename to packages/types/protobuf/proto/ibc/core/types/v1/genesis.proto diff --git a/packages/utils/protobuf/proto/ibc/lightclients/localhost/v2/localhost.proto b/packages/types/protobuf/proto/ibc/lightclients/localhost/v2/localhost.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/lightclients/localhost/v2/localhost.proto rename to packages/types/protobuf/proto/ibc/lightclients/localhost/v2/localhost.proto diff --git a/packages/utils/protobuf/proto/ibc/lightclients/solomachine/v2/solomachine.proto b/packages/types/protobuf/proto/ibc/lightclients/solomachine/v2/solomachine.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/lightclients/solomachine/v2/solomachine.proto rename to packages/types/protobuf/proto/ibc/lightclients/solomachine/v2/solomachine.proto diff --git a/packages/utils/protobuf/proto/ibc/lightclients/solomachine/v3/solomachine.proto b/packages/types/protobuf/proto/ibc/lightclients/solomachine/v3/solomachine.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/lightclients/solomachine/v3/solomachine.proto rename to packages/types/protobuf/proto/ibc/lightclients/solomachine/v3/solomachine.proto diff --git a/packages/utils/protobuf/proto/ibc/lightclients/tendermint/v1/tendermint.proto b/packages/types/protobuf/proto/ibc/lightclients/tendermint/v1/tendermint.proto similarity index 100% rename from packages/utils/protobuf/proto/ibc/lightclients/tendermint/v1/tendermint.proto rename to packages/types/protobuf/proto/ibc/lightclients/tendermint/v1/tendermint.proto diff --git a/packages/utils/protobuf/proto/juno/feeshare/v1/feeshare.proto b/packages/types/protobuf/proto/juno/feeshare/v1/feeshare.proto similarity index 100% rename from packages/utils/protobuf/proto/juno/feeshare/v1/feeshare.proto rename to packages/types/protobuf/proto/juno/feeshare/v1/feeshare.proto diff --git a/packages/utils/protobuf/proto/juno/feeshare/v1/genesis.proto b/packages/types/protobuf/proto/juno/feeshare/v1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/juno/feeshare/v1/genesis.proto rename to packages/types/protobuf/proto/juno/feeshare/v1/genesis.proto diff --git a/packages/utils/protobuf/proto/juno/feeshare/v1/query.proto b/packages/types/protobuf/proto/juno/feeshare/v1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/juno/feeshare/v1/query.proto rename to packages/types/protobuf/proto/juno/feeshare/v1/query.proto diff --git a/packages/utils/protobuf/proto/juno/feeshare/v1/tx.proto b/packages/types/protobuf/proto/juno/feeshare/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/juno/feeshare/v1/tx.proto rename to packages/types/protobuf/proto/juno/feeshare/v1/tx.proto diff --git a/packages/utils/protobuf/proto/juno/mint/genesis.proto b/packages/types/protobuf/proto/juno/mint/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/juno/mint/genesis.proto rename to packages/types/protobuf/proto/juno/mint/genesis.proto diff --git a/packages/utils/protobuf/proto/juno/mint/mint.proto b/packages/types/protobuf/proto/juno/mint/mint.proto similarity index 100% rename from packages/utils/protobuf/proto/juno/mint/mint.proto rename to packages/types/protobuf/proto/juno/mint/mint.proto diff --git a/packages/utils/protobuf/proto/juno/mint/query.proto b/packages/types/protobuf/proto/juno/mint/query.proto similarity index 100% rename from packages/utils/protobuf/proto/juno/mint/query.proto rename to packages/types/protobuf/proto/juno/mint/query.proto diff --git a/packages/utils/protobuf/proto/juno/mint/tx.proto b/packages/types/protobuf/proto/juno/mint/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/juno/mint/tx.proto rename to packages/types/protobuf/proto/juno/mint/tx.proto diff --git a/packages/utils/protobuf/proto/neutron/contractmanager/failure.proto b/packages/types/protobuf/proto/neutron/contractmanager/failure.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/contractmanager/failure.proto rename to packages/types/protobuf/proto/neutron/contractmanager/failure.proto diff --git a/packages/utils/protobuf/proto/neutron/contractmanager/genesis.proto b/packages/types/protobuf/proto/neutron/contractmanager/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/contractmanager/genesis.proto rename to packages/types/protobuf/proto/neutron/contractmanager/genesis.proto diff --git a/packages/utils/protobuf/proto/neutron/contractmanager/params.proto b/packages/types/protobuf/proto/neutron/contractmanager/params.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/contractmanager/params.proto rename to packages/types/protobuf/proto/neutron/contractmanager/params.proto diff --git a/packages/utils/protobuf/proto/neutron/contractmanager/query.proto b/packages/types/protobuf/proto/neutron/contractmanager/query.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/contractmanager/query.proto rename to packages/types/protobuf/proto/neutron/contractmanager/query.proto diff --git a/packages/utils/protobuf/proto/neutron/contractmanager/tx.proto b/packages/types/protobuf/proto/neutron/contractmanager/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/contractmanager/tx.proto rename to packages/types/protobuf/proto/neutron/contractmanager/tx.proto diff --git a/packages/utils/protobuf/proto/neutron/contractmanager/v1/failure.proto b/packages/types/protobuf/proto/neutron/contractmanager/v1/failure.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/contractmanager/v1/failure.proto rename to packages/types/protobuf/proto/neutron/contractmanager/v1/failure.proto diff --git a/packages/utils/protobuf/proto/neutron/cron/genesis.proto b/packages/types/protobuf/proto/neutron/cron/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/cron/genesis.proto rename to packages/types/protobuf/proto/neutron/cron/genesis.proto diff --git a/packages/utils/protobuf/proto/neutron/cron/params.proto b/packages/types/protobuf/proto/neutron/cron/params.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/cron/params.proto rename to packages/types/protobuf/proto/neutron/cron/params.proto diff --git a/packages/utils/protobuf/proto/neutron/cron/query.proto b/packages/types/protobuf/proto/neutron/cron/query.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/cron/query.proto rename to packages/types/protobuf/proto/neutron/cron/query.proto diff --git a/packages/utils/protobuf/proto/neutron/cron/schedule.proto b/packages/types/protobuf/proto/neutron/cron/schedule.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/cron/schedule.proto rename to packages/types/protobuf/proto/neutron/cron/schedule.proto diff --git a/packages/utils/protobuf/proto/neutron/cron/tx.proto b/packages/types/protobuf/proto/neutron/cron/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/cron/tx.proto rename to packages/types/protobuf/proto/neutron/cron/tx.proto diff --git a/packages/utils/protobuf/proto/neutron/dex/deposit_record.proto b/packages/types/protobuf/proto/neutron/dex/deposit_record.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/dex/deposit_record.proto rename to packages/types/protobuf/proto/neutron/dex/deposit_record.proto diff --git a/packages/utils/protobuf/proto/neutron/dex/genesis.proto b/packages/types/protobuf/proto/neutron/dex/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/dex/genesis.proto rename to packages/types/protobuf/proto/neutron/dex/genesis.proto diff --git a/packages/utils/protobuf/proto/neutron/dex/limit_order_expiration.proto b/packages/types/protobuf/proto/neutron/dex/limit_order_expiration.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/dex/limit_order_expiration.proto rename to packages/types/protobuf/proto/neutron/dex/limit_order_expiration.proto diff --git a/packages/utils/protobuf/proto/neutron/dex/limit_order_tranche.proto b/packages/types/protobuf/proto/neutron/dex/limit_order_tranche.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/dex/limit_order_tranche.proto rename to packages/types/protobuf/proto/neutron/dex/limit_order_tranche.proto diff --git a/packages/utils/protobuf/proto/neutron/dex/limit_order_tranche_user.proto b/packages/types/protobuf/proto/neutron/dex/limit_order_tranche_user.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/dex/limit_order_tranche_user.proto rename to packages/types/protobuf/proto/neutron/dex/limit_order_tranche_user.proto diff --git a/packages/utils/protobuf/proto/neutron/dex/pair_id.proto b/packages/types/protobuf/proto/neutron/dex/pair_id.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/dex/pair_id.proto rename to packages/types/protobuf/proto/neutron/dex/pair_id.proto diff --git a/packages/utils/protobuf/proto/neutron/dex/params.proto b/packages/types/protobuf/proto/neutron/dex/params.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/dex/params.proto rename to packages/types/protobuf/proto/neutron/dex/params.proto diff --git a/packages/utils/protobuf/proto/neutron/dex/pool.proto b/packages/types/protobuf/proto/neutron/dex/pool.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/dex/pool.proto rename to packages/types/protobuf/proto/neutron/dex/pool.proto diff --git a/packages/utils/protobuf/proto/neutron/dex/pool_metadata.proto b/packages/types/protobuf/proto/neutron/dex/pool_metadata.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/dex/pool_metadata.proto rename to packages/types/protobuf/proto/neutron/dex/pool_metadata.proto diff --git a/packages/utils/protobuf/proto/neutron/dex/pool_reserves.proto b/packages/types/protobuf/proto/neutron/dex/pool_reserves.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/dex/pool_reserves.proto rename to packages/types/protobuf/proto/neutron/dex/pool_reserves.proto diff --git a/packages/utils/protobuf/proto/neutron/dex/query.proto b/packages/types/protobuf/proto/neutron/dex/query.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/dex/query.proto rename to packages/types/protobuf/proto/neutron/dex/query.proto diff --git a/packages/utils/protobuf/proto/neutron/dex/tick_liquidity.proto b/packages/types/protobuf/proto/neutron/dex/tick_liquidity.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/dex/tick_liquidity.proto rename to packages/types/protobuf/proto/neutron/dex/tick_liquidity.proto diff --git a/packages/utils/protobuf/proto/neutron/dex/trade_pair_id.proto b/packages/types/protobuf/proto/neutron/dex/trade_pair_id.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/dex/trade_pair_id.proto rename to packages/types/protobuf/proto/neutron/dex/trade_pair_id.proto diff --git a/packages/utils/protobuf/proto/neutron/dex/tx.proto b/packages/types/protobuf/proto/neutron/dex/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/dex/tx.proto rename to packages/types/protobuf/proto/neutron/dex/tx.proto diff --git a/packages/utils/protobuf/proto/neutron/feeburner/genesis.proto b/packages/types/protobuf/proto/neutron/feeburner/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/feeburner/genesis.proto rename to packages/types/protobuf/proto/neutron/feeburner/genesis.proto diff --git a/packages/utils/protobuf/proto/neutron/feeburner/params.proto b/packages/types/protobuf/proto/neutron/feeburner/params.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/feeburner/params.proto rename to packages/types/protobuf/proto/neutron/feeburner/params.proto diff --git a/packages/utils/protobuf/proto/neutron/feeburner/query.proto b/packages/types/protobuf/proto/neutron/feeburner/query.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/feeburner/query.proto rename to packages/types/protobuf/proto/neutron/feeburner/query.proto diff --git a/packages/utils/protobuf/proto/neutron/feeburner/total_burned_neutrons_amount.proto b/packages/types/protobuf/proto/neutron/feeburner/total_burned_neutrons_amount.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/feeburner/total_burned_neutrons_amount.proto rename to packages/types/protobuf/proto/neutron/feeburner/total_burned_neutrons_amount.proto diff --git a/packages/utils/protobuf/proto/neutron/feeburner/tx.proto b/packages/types/protobuf/proto/neutron/feeburner/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/feeburner/tx.proto rename to packages/types/protobuf/proto/neutron/feeburner/tx.proto diff --git a/packages/utils/protobuf/proto/neutron/feerefunder/fee.proto b/packages/types/protobuf/proto/neutron/feerefunder/fee.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/feerefunder/fee.proto rename to packages/types/protobuf/proto/neutron/feerefunder/fee.proto diff --git a/packages/utils/protobuf/proto/neutron/feerefunder/genesis.proto b/packages/types/protobuf/proto/neutron/feerefunder/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/feerefunder/genesis.proto rename to packages/types/protobuf/proto/neutron/feerefunder/genesis.proto diff --git a/packages/utils/protobuf/proto/neutron/feerefunder/params.proto b/packages/types/protobuf/proto/neutron/feerefunder/params.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/feerefunder/params.proto rename to packages/types/protobuf/proto/neutron/feerefunder/params.proto diff --git a/packages/utils/protobuf/proto/neutron/feerefunder/query.proto b/packages/types/protobuf/proto/neutron/feerefunder/query.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/feerefunder/query.proto rename to packages/types/protobuf/proto/neutron/feerefunder/query.proto diff --git a/packages/utils/protobuf/proto/neutron/feerefunder/tx.proto b/packages/types/protobuf/proto/neutron/feerefunder/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/feerefunder/tx.proto rename to packages/types/protobuf/proto/neutron/feerefunder/tx.proto diff --git a/packages/utils/protobuf/proto/neutron/interchainqueries/genesis.proto b/packages/types/protobuf/proto/neutron/interchainqueries/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/interchainqueries/genesis.proto rename to packages/types/protobuf/proto/neutron/interchainqueries/genesis.proto diff --git a/packages/utils/protobuf/proto/neutron/interchainqueries/params.proto b/packages/types/protobuf/proto/neutron/interchainqueries/params.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/interchainqueries/params.proto rename to packages/types/protobuf/proto/neutron/interchainqueries/params.proto diff --git a/packages/utils/protobuf/proto/neutron/interchainqueries/query.proto b/packages/types/protobuf/proto/neutron/interchainqueries/query.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/interchainqueries/query.proto rename to packages/types/protobuf/proto/neutron/interchainqueries/query.proto diff --git a/packages/utils/protobuf/proto/neutron/interchainqueries/tx.proto b/packages/types/protobuf/proto/neutron/interchainqueries/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/interchainqueries/tx.proto rename to packages/types/protobuf/proto/neutron/interchainqueries/tx.proto diff --git a/packages/utils/protobuf/proto/neutron/interchaintxs/v1/genesis.proto b/packages/types/protobuf/proto/neutron/interchaintxs/v1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/interchaintxs/v1/genesis.proto rename to packages/types/protobuf/proto/neutron/interchaintxs/v1/genesis.proto diff --git a/packages/utils/protobuf/proto/neutron/interchaintxs/v1/params.proto b/packages/types/protobuf/proto/neutron/interchaintxs/v1/params.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/interchaintxs/v1/params.proto rename to packages/types/protobuf/proto/neutron/interchaintxs/v1/params.proto diff --git a/packages/utils/protobuf/proto/neutron/interchaintxs/v1/query.proto b/packages/types/protobuf/proto/neutron/interchaintxs/v1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/interchaintxs/v1/query.proto rename to packages/types/protobuf/proto/neutron/interchaintxs/v1/query.proto diff --git a/packages/utils/protobuf/proto/neutron/interchaintxs/v1/tx.proto b/packages/types/protobuf/proto/neutron/interchaintxs/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/interchaintxs/v1/tx.proto rename to packages/types/protobuf/proto/neutron/interchaintxs/v1/tx.proto diff --git a/packages/utils/protobuf/proto/neutron/transfer/v1/query.proto b/packages/types/protobuf/proto/neutron/transfer/v1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/transfer/v1/query.proto rename to packages/types/protobuf/proto/neutron/transfer/v1/query.proto diff --git a/packages/utils/protobuf/proto/neutron/transfer/v1/tx.proto b/packages/types/protobuf/proto/neutron/transfer/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/neutron/transfer/v1/tx.proto rename to packages/types/protobuf/proto/neutron/transfer/v1/tx.proto diff --git a/packages/utils/protobuf/proto/osmosis/accum/v1beta1/accum.proto b/packages/types/protobuf/proto/osmosis/accum/v1beta1/accum.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/accum/v1beta1/accum.proto rename to packages/types/protobuf/proto/osmosis/accum/v1beta1/accum.proto diff --git a/packages/utils/protobuf/proto/osmosis/concentratedliquidity/params.proto b/packages/types/protobuf/proto/osmosis/concentratedliquidity/params.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/concentratedliquidity/params.proto rename to packages/types/protobuf/proto/osmosis/concentratedliquidity/params.proto diff --git a/packages/utils/protobuf/proto/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.proto b/packages/types/protobuf/proto/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.proto rename to packages/types/protobuf/proto/osmosis/concentratedliquidity/poolmodel/concentrated/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/osmosis/concentratedliquidity/v1beta1/genesis.proto b/packages/types/protobuf/proto/osmosis/concentratedliquidity/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/concentratedliquidity/v1beta1/genesis.proto rename to packages/types/protobuf/proto/osmosis/concentratedliquidity/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/osmosis/concentratedliquidity/v1beta1/gov.proto b/packages/types/protobuf/proto/osmosis/concentratedliquidity/v1beta1/gov.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/concentratedliquidity/v1beta1/gov.proto rename to packages/types/protobuf/proto/osmosis/concentratedliquidity/v1beta1/gov.proto diff --git a/packages/utils/protobuf/proto/osmosis/concentratedliquidity/v1beta1/incentive_record.proto b/packages/types/protobuf/proto/osmosis/concentratedliquidity/v1beta1/incentive_record.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/concentratedliquidity/v1beta1/incentive_record.proto rename to packages/types/protobuf/proto/osmosis/concentratedliquidity/v1beta1/incentive_record.proto diff --git a/packages/utils/protobuf/proto/osmosis/concentratedliquidity/v1beta1/pool.proto b/packages/types/protobuf/proto/osmosis/concentratedliquidity/v1beta1/pool.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/concentratedliquidity/v1beta1/pool.proto rename to packages/types/protobuf/proto/osmosis/concentratedliquidity/v1beta1/pool.proto diff --git a/packages/utils/protobuf/proto/osmosis/concentratedliquidity/v1beta1/position.proto b/packages/types/protobuf/proto/osmosis/concentratedliquidity/v1beta1/position.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/concentratedliquidity/v1beta1/position.proto rename to packages/types/protobuf/proto/osmosis/concentratedliquidity/v1beta1/position.proto diff --git a/packages/utils/protobuf/proto/osmosis/concentratedliquidity/v1beta1/query.proto b/packages/types/protobuf/proto/osmosis/concentratedliquidity/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/concentratedliquidity/v1beta1/query.proto rename to packages/types/protobuf/proto/osmosis/concentratedliquidity/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/osmosis/concentratedliquidity/v1beta1/query.yml b/packages/types/protobuf/proto/osmosis/concentratedliquidity/v1beta1/query.yml similarity index 100% rename from packages/utils/protobuf/proto/osmosis/concentratedliquidity/v1beta1/query.yml rename to packages/types/protobuf/proto/osmosis/concentratedliquidity/v1beta1/query.yml diff --git a/packages/utils/protobuf/proto/osmosis/concentratedliquidity/v1beta1/tickInfo.proto b/packages/types/protobuf/proto/osmosis/concentratedliquidity/v1beta1/tickInfo.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/concentratedliquidity/v1beta1/tickInfo.proto rename to packages/types/protobuf/proto/osmosis/concentratedliquidity/v1beta1/tickInfo.proto diff --git a/packages/utils/protobuf/proto/osmosis/concentratedliquidity/v1beta1/tx.proto b/packages/types/protobuf/proto/osmosis/concentratedliquidity/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/concentratedliquidity/v1beta1/tx.proto rename to packages/types/protobuf/proto/osmosis/concentratedliquidity/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/genesis.proto b/packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/genesis.proto rename to packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/gov.proto b/packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/gov.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/gov.proto rename to packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/gov.proto diff --git a/packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.proto b/packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.proto rename to packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/instantiate_msg.proto diff --git a/packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.proto b/packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.proto rename to packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/module_query_msg.proto diff --git a/packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.proto b/packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.proto rename to packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/module_sudo_msg.proto diff --git a/packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/pool.proto b/packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/pool.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/pool.proto rename to packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/pool.proto diff --git a/packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.proto b/packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.proto rename to packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/pool_query_msg.proto diff --git a/packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.proto b/packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.proto rename to packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/transmuter_msgs.proto diff --git a/packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/tx.proto b/packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/tx.proto rename to packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/model/tx.proto diff --git a/packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/params.proto b/packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/params.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/params.proto rename to packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/params.proto diff --git a/packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/query.proto b/packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/query.proto rename to packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/query.yml b/packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/query.yml similarity index 100% rename from packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/query.yml rename to packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/query.yml diff --git a/packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/tx.proto b/packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/cosmwasmpool/v1beta1/tx.proto rename to packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/osmosis/downtime-detector/v1beta1/downtime_duration.proto b/packages/types/protobuf/proto/osmosis/downtime-detector/v1beta1/downtime_duration.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/downtime-detector/v1beta1/downtime_duration.proto rename to packages/types/protobuf/proto/osmosis/downtime-detector/v1beta1/downtime_duration.proto diff --git a/packages/utils/protobuf/proto/osmosis/downtime-detector/v1beta1/genesis.proto b/packages/types/protobuf/proto/osmosis/downtime-detector/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/downtime-detector/v1beta1/genesis.proto rename to packages/types/protobuf/proto/osmosis/downtime-detector/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/osmosis/downtime-detector/v1beta1/query.proto b/packages/types/protobuf/proto/osmosis/downtime-detector/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/downtime-detector/v1beta1/query.proto rename to packages/types/protobuf/proto/osmosis/downtime-detector/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/osmosis/downtime-detector/v1beta1/query.yml b/packages/types/protobuf/proto/osmosis/downtime-detector/v1beta1/query.yml similarity index 100% rename from packages/utils/protobuf/proto/osmosis/downtime-detector/v1beta1/query.yml rename to packages/types/protobuf/proto/osmosis/downtime-detector/v1beta1/query.yml diff --git a/packages/utils/protobuf/proto/osmosis/epochs/genesis.proto b/packages/types/protobuf/proto/osmosis/epochs/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/epochs/genesis.proto rename to packages/types/protobuf/proto/osmosis/epochs/genesis.proto diff --git a/packages/utils/protobuf/proto/osmosis/epochs/query.proto b/packages/types/protobuf/proto/osmosis/epochs/query.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/epochs/query.proto rename to packages/types/protobuf/proto/osmosis/epochs/query.proto diff --git a/packages/utils/protobuf/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto b/packages/types/protobuf/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto rename to packages/types/protobuf/proto/osmosis/gamm/pool-models/balancer/balancerPool.proto diff --git a/packages/utils/protobuf/proto/osmosis/gamm/pool-models/balancer/tx/tx.proto b/packages/types/protobuf/proto/osmosis/gamm/pool-models/balancer/tx/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/gamm/pool-models/balancer/tx/tx.proto rename to packages/types/protobuf/proto/osmosis/gamm/pool-models/balancer/tx/tx.proto diff --git a/packages/utils/protobuf/proto/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto b/packages/types/protobuf/proto/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto rename to packages/types/protobuf/proto/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto diff --git a/packages/utils/protobuf/proto/osmosis/gamm/pool-models/stableswap/tx.proto b/packages/types/protobuf/proto/osmosis/gamm/pool-models/stableswap/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/gamm/pool-models/stableswap/tx.proto rename to packages/types/protobuf/proto/osmosis/gamm/pool-models/stableswap/tx.proto diff --git a/packages/utils/protobuf/proto/osmosis/gamm/v1beta1/genesis.proto b/packages/types/protobuf/proto/osmosis/gamm/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/gamm/v1beta1/genesis.proto rename to packages/types/protobuf/proto/osmosis/gamm/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/osmosis/gamm/v1beta1/gov.proto b/packages/types/protobuf/proto/osmosis/gamm/v1beta1/gov.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/gamm/v1beta1/gov.proto rename to packages/types/protobuf/proto/osmosis/gamm/v1beta1/gov.proto diff --git a/packages/utils/protobuf/proto/osmosis/gamm/v1beta1/query.proto b/packages/types/protobuf/proto/osmosis/gamm/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/gamm/v1beta1/query.proto rename to packages/types/protobuf/proto/osmosis/gamm/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/osmosis/gamm/v1beta1/shared.proto b/packages/types/protobuf/proto/osmosis/gamm/v1beta1/shared.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/gamm/v1beta1/shared.proto rename to packages/types/protobuf/proto/osmosis/gamm/v1beta1/shared.proto diff --git a/packages/utils/protobuf/proto/osmosis/gamm/v1beta1/tx.proto b/packages/types/protobuf/proto/osmosis/gamm/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/gamm/v1beta1/tx.proto rename to packages/types/protobuf/proto/osmosis/gamm/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/osmosis/gamm/v2/query.proto b/packages/types/protobuf/proto/osmosis/gamm/v2/query.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/gamm/v2/query.proto rename to packages/types/protobuf/proto/osmosis/gamm/v2/query.proto diff --git a/packages/utils/protobuf/proto/osmosis/ibc-hooks/genesis.proto b/packages/types/protobuf/proto/osmosis/ibc-hooks/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/ibc-hooks/genesis.proto rename to packages/types/protobuf/proto/osmosis/ibc-hooks/genesis.proto diff --git a/packages/utils/protobuf/proto/osmosis/ibc-hooks/params.proto b/packages/types/protobuf/proto/osmosis/ibc-hooks/params.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/ibc-hooks/params.proto rename to packages/types/protobuf/proto/osmosis/ibc-hooks/params.proto diff --git a/packages/utils/protobuf/proto/osmosis/ibc-hooks/tx.proto b/packages/types/protobuf/proto/osmosis/ibc-hooks/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/ibc-hooks/tx.proto rename to packages/types/protobuf/proto/osmosis/ibc-hooks/tx.proto diff --git a/packages/utils/protobuf/proto/osmosis/ibc-rate-limit/v1beta1/genesis.proto b/packages/types/protobuf/proto/osmosis/ibc-rate-limit/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/ibc-rate-limit/v1beta1/genesis.proto rename to packages/types/protobuf/proto/osmosis/ibc-rate-limit/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/osmosis/ibc-rate-limit/v1beta1/params.proto b/packages/types/protobuf/proto/osmosis/ibc-rate-limit/v1beta1/params.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/ibc-rate-limit/v1beta1/params.proto rename to packages/types/protobuf/proto/osmosis/ibc-rate-limit/v1beta1/params.proto diff --git a/packages/utils/protobuf/proto/osmosis/ibc-rate-limit/v1beta1/query.proto b/packages/types/protobuf/proto/osmosis/ibc-rate-limit/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/ibc-rate-limit/v1beta1/query.proto rename to packages/types/protobuf/proto/osmosis/ibc-rate-limit/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/osmosis/ibc-rate-limit/v1beta1/query.yml b/packages/types/protobuf/proto/osmosis/ibc-rate-limit/v1beta1/query.yml similarity index 100% rename from packages/utils/protobuf/proto/osmosis/ibc-rate-limit/v1beta1/query.yml rename to packages/types/protobuf/proto/osmosis/ibc-rate-limit/v1beta1/query.yml diff --git a/packages/utils/protobuf/proto/osmosis/incentives/gauge.proto b/packages/types/protobuf/proto/osmosis/incentives/gauge.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/incentives/gauge.proto rename to packages/types/protobuf/proto/osmosis/incentives/gauge.proto diff --git a/packages/utils/protobuf/proto/osmosis/incentives/genesis.proto b/packages/types/protobuf/proto/osmosis/incentives/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/incentives/genesis.proto rename to packages/types/protobuf/proto/osmosis/incentives/genesis.proto diff --git a/packages/utils/protobuf/proto/osmosis/incentives/gov.proto b/packages/types/protobuf/proto/osmosis/incentives/gov.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/incentives/gov.proto rename to packages/types/protobuf/proto/osmosis/incentives/gov.proto diff --git a/packages/utils/protobuf/proto/osmosis/incentives/group.proto b/packages/types/protobuf/proto/osmosis/incentives/group.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/incentives/group.proto rename to packages/types/protobuf/proto/osmosis/incentives/group.proto diff --git a/packages/utils/protobuf/proto/osmosis/incentives/params.proto b/packages/types/protobuf/proto/osmosis/incentives/params.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/incentives/params.proto rename to packages/types/protobuf/proto/osmosis/incentives/params.proto diff --git a/packages/utils/protobuf/proto/osmosis/incentives/query.proto b/packages/types/protobuf/proto/osmosis/incentives/query.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/incentives/query.proto rename to packages/types/protobuf/proto/osmosis/incentives/query.proto diff --git a/packages/utils/protobuf/proto/osmosis/incentives/tx.proto b/packages/types/protobuf/proto/osmosis/incentives/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/incentives/tx.proto rename to packages/types/protobuf/proto/osmosis/incentives/tx.proto diff --git a/packages/utils/protobuf/proto/osmosis/lockup/genesis.proto b/packages/types/protobuf/proto/osmosis/lockup/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/lockup/genesis.proto rename to packages/types/protobuf/proto/osmosis/lockup/genesis.proto diff --git a/packages/utils/protobuf/proto/osmosis/lockup/lock.proto b/packages/types/protobuf/proto/osmosis/lockup/lock.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/lockup/lock.proto rename to packages/types/protobuf/proto/osmosis/lockup/lock.proto diff --git a/packages/utils/protobuf/proto/osmosis/lockup/params.proto b/packages/types/protobuf/proto/osmosis/lockup/params.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/lockup/params.proto rename to packages/types/protobuf/proto/osmosis/lockup/params.proto diff --git a/packages/utils/protobuf/proto/osmosis/lockup/query.proto b/packages/types/protobuf/proto/osmosis/lockup/query.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/lockup/query.proto rename to packages/types/protobuf/proto/osmosis/lockup/query.proto diff --git a/packages/utils/protobuf/proto/osmosis/lockup/tx.proto b/packages/types/protobuf/proto/osmosis/lockup/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/lockup/tx.proto rename to packages/types/protobuf/proto/osmosis/lockup/tx.proto diff --git a/packages/utils/protobuf/proto/osmosis/mint/v1beta1/genesis.proto b/packages/types/protobuf/proto/osmosis/mint/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/mint/v1beta1/genesis.proto rename to packages/types/protobuf/proto/osmosis/mint/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/osmosis/mint/v1beta1/mint.proto b/packages/types/protobuf/proto/osmosis/mint/v1beta1/mint.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/mint/v1beta1/mint.proto rename to packages/types/protobuf/proto/osmosis/mint/v1beta1/mint.proto diff --git a/packages/utils/protobuf/proto/osmosis/mint/v1beta1/query.proto b/packages/types/protobuf/proto/osmosis/mint/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/mint/v1beta1/query.proto rename to packages/types/protobuf/proto/osmosis/mint/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/osmosis/pool-incentives/v1beta1/genesis.proto b/packages/types/protobuf/proto/osmosis/pool-incentives/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/pool-incentives/v1beta1/genesis.proto rename to packages/types/protobuf/proto/osmosis/pool-incentives/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/osmosis/pool-incentives/v1beta1/gov.proto b/packages/types/protobuf/proto/osmosis/pool-incentives/v1beta1/gov.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/pool-incentives/v1beta1/gov.proto rename to packages/types/protobuf/proto/osmosis/pool-incentives/v1beta1/gov.proto diff --git a/packages/utils/protobuf/proto/osmosis/pool-incentives/v1beta1/incentives.proto b/packages/types/protobuf/proto/osmosis/pool-incentives/v1beta1/incentives.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/pool-incentives/v1beta1/incentives.proto rename to packages/types/protobuf/proto/osmosis/pool-incentives/v1beta1/incentives.proto diff --git a/packages/utils/protobuf/proto/osmosis/pool-incentives/v1beta1/query.proto b/packages/types/protobuf/proto/osmosis/pool-incentives/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/pool-incentives/v1beta1/query.proto rename to packages/types/protobuf/proto/osmosis/pool-incentives/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/osmosis/pool-incentives/v1beta1/shared.proto b/packages/types/protobuf/proto/osmosis/pool-incentives/v1beta1/shared.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/pool-incentives/v1beta1/shared.proto rename to packages/types/protobuf/proto/osmosis/pool-incentives/v1beta1/shared.proto diff --git a/packages/utils/protobuf/proto/osmosis/poolmanager/v1beta1/genesis.proto b/packages/types/protobuf/proto/osmosis/poolmanager/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/poolmanager/v1beta1/genesis.proto rename to packages/types/protobuf/proto/osmosis/poolmanager/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/osmosis/poolmanager/v1beta1/gov.proto b/packages/types/protobuf/proto/osmosis/poolmanager/v1beta1/gov.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/poolmanager/v1beta1/gov.proto rename to packages/types/protobuf/proto/osmosis/poolmanager/v1beta1/gov.proto diff --git a/packages/utils/protobuf/proto/osmosis/poolmanager/v1beta1/module_route.proto b/packages/types/protobuf/proto/osmosis/poolmanager/v1beta1/module_route.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/poolmanager/v1beta1/module_route.proto rename to packages/types/protobuf/proto/osmosis/poolmanager/v1beta1/module_route.proto diff --git a/packages/utils/protobuf/proto/osmosis/poolmanager/v1beta1/query.proto b/packages/types/protobuf/proto/osmosis/poolmanager/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/poolmanager/v1beta1/query.proto rename to packages/types/protobuf/proto/osmosis/poolmanager/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/osmosis/poolmanager/v1beta1/query.yml b/packages/types/protobuf/proto/osmosis/poolmanager/v1beta1/query.yml similarity index 100% rename from packages/utils/protobuf/proto/osmosis/poolmanager/v1beta1/query.yml rename to packages/types/protobuf/proto/osmosis/poolmanager/v1beta1/query.yml diff --git a/packages/utils/protobuf/proto/osmosis/poolmanager/v1beta1/swap_route.proto b/packages/types/protobuf/proto/osmosis/poolmanager/v1beta1/swap_route.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/poolmanager/v1beta1/swap_route.proto rename to packages/types/protobuf/proto/osmosis/poolmanager/v1beta1/swap_route.proto diff --git a/packages/utils/protobuf/proto/osmosis/poolmanager/v1beta1/tx.proto b/packages/types/protobuf/proto/osmosis/poolmanager/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/poolmanager/v1beta1/tx.proto rename to packages/types/protobuf/proto/osmosis/poolmanager/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/osmosis/protorev/v1beta1/genesis.proto b/packages/types/protobuf/proto/osmosis/protorev/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/protorev/v1beta1/genesis.proto rename to packages/types/protobuf/proto/osmosis/protorev/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/osmosis/protorev/v1beta1/gov.proto b/packages/types/protobuf/proto/osmosis/protorev/v1beta1/gov.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/protorev/v1beta1/gov.proto rename to packages/types/protobuf/proto/osmosis/protorev/v1beta1/gov.proto diff --git a/packages/utils/protobuf/proto/osmosis/protorev/v1beta1/params.proto b/packages/types/protobuf/proto/osmosis/protorev/v1beta1/params.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/protorev/v1beta1/params.proto rename to packages/types/protobuf/proto/osmosis/protorev/v1beta1/params.proto diff --git a/packages/utils/protobuf/proto/osmosis/protorev/v1beta1/protorev.proto b/packages/types/protobuf/proto/osmosis/protorev/v1beta1/protorev.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/protorev/v1beta1/protorev.proto rename to packages/types/protobuf/proto/osmosis/protorev/v1beta1/protorev.proto diff --git a/packages/utils/protobuf/proto/osmosis/protorev/v1beta1/query.proto b/packages/types/protobuf/proto/osmosis/protorev/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/protorev/v1beta1/query.proto rename to packages/types/protobuf/proto/osmosis/protorev/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/osmosis/protorev/v1beta1/tx.proto b/packages/types/protobuf/proto/osmosis/protorev/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/protorev/v1beta1/tx.proto rename to packages/types/protobuf/proto/osmosis/protorev/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/osmosis/sumtree/v1beta1/tree.proto b/packages/types/protobuf/proto/osmosis/sumtree/v1beta1/tree.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/sumtree/v1beta1/tree.proto rename to packages/types/protobuf/proto/osmosis/sumtree/v1beta1/tree.proto diff --git a/packages/utils/protobuf/proto/osmosis/superfluid/genesis.proto b/packages/types/protobuf/proto/osmosis/superfluid/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/superfluid/genesis.proto rename to packages/types/protobuf/proto/osmosis/superfluid/genesis.proto diff --git a/packages/utils/protobuf/proto/osmosis/superfluid/params.proto b/packages/types/protobuf/proto/osmosis/superfluid/params.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/superfluid/params.proto rename to packages/types/protobuf/proto/osmosis/superfluid/params.proto diff --git a/packages/utils/protobuf/proto/osmosis/superfluid/query.proto b/packages/types/protobuf/proto/osmosis/superfluid/query.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/superfluid/query.proto rename to packages/types/protobuf/proto/osmosis/superfluid/query.proto diff --git a/packages/utils/protobuf/proto/osmosis/superfluid/superfluid.proto b/packages/types/protobuf/proto/osmosis/superfluid/superfluid.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/superfluid/superfluid.proto rename to packages/types/protobuf/proto/osmosis/superfluid/superfluid.proto diff --git a/packages/utils/protobuf/proto/osmosis/superfluid/tx.proto b/packages/types/protobuf/proto/osmosis/superfluid/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/superfluid/tx.proto rename to packages/types/protobuf/proto/osmosis/superfluid/tx.proto diff --git a/packages/utils/protobuf/proto/osmosis/superfluid/v1beta1/gov.proto b/packages/types/protobuf/proto/osmosis/superfluid/v1beta1/gov.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/superfluid/v1beta1/gov.proto rename to packages/types/protobuf/proto/osmosis/superfluid/v1beta1/gov.proto diff --git a/packages/utils/protobuf/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto b/packages/types/protobuf/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto rename to packages/types/protobuf/proto/osmosis/tokenfactory/v1beta1/authorityMetadata.proto diff --git a/packages/utils/protobuf/proto/osmosis/tokenfactory/v1beta1/genesis.proto b/packages/types/protobuf/proto/osmosis/tokenfactory/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/tokenfactory/v1beta1/genesis.proto rename to packages/types/protobuf/proto/osmosis/tokenfactory/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/osmosis/tokenfactory/v1beta1/params.proto b/packages/types/protobuf/proto/osmosis/tokenfactory/v1beta1/params.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/tokenfactory/v1beta1/params.proto rename to packages/types/protobuf/proto/osmosis/tokenfactory/v1beta1/params.proto diff --git a/packages/utils/protobuf/proto/osmosis/tokenfactory/v1beta1/query.proto b/packages/types/protobuf/proto/osmosis/tokenfactory/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/tokenfactory/v1beta1/query.proto rename to packages/types/protobuf/proto/osmosis/tokenfactory/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/osmosis/tokenfactory/v1beta1/tx.proto b/packages/types/protobuf/proto/osmosis/tokenfactory/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/tokenfactory/v1beta1/tx.proto rename to packages/types/protobuf/proto/osmosis/tokenfactory/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/osmosis/twap/v1beta1/genesis.proto b/packages/types/protobuf/proto/osmosis/twap/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/twap/v1beta1/genesis.proto rename to packages/types/protobuf/proto/osmosis/twap/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/osmosis/twap/v1beta1/query.proto b/packages/types/protobuf/proto/osmosis/twap/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/twap/v1beta1/query.proto rename to packages/types/protobuf/proto/osmosis/twap/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/osmosis/twap/v1beta1/query.yml b/packages/types/protobuf/proto/osmosis/twap/v1beta1/query.yml similarity index 100% rename from packages/utils/protobuf/proto/osmosis/twap/v1beta1/query.yml rename to packages/types/protobuf/proto/osmosis/twap/v1beta1/query.yml diff --git a/packages/utils/protobuf/proto/osmosis/twap/v1beta1/twap_record.proto b/packages/types/protobuf/proto/osmosis/twap/v1beta1/twap_record.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/twap/v1beta1/twap_record.proto rename to packages/types/protobuf/proto/osmosis/twap/v1beta1/twap_record.proto diff --git a/packages/utils/protobuf/proto/osmosis/txfees/v1beta1/feetoken.proto b/packages/types/protobuf/proto/osmosis/txfees/v1beta1/feetoken.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/txfees/v1beta1/feetoken.proto rename to packages/types/protobuf/proto/osmosis/txfees/v1beta1/feetoken.proto diff --git a/packages/utils/protobuf/proto/osmosis/txfees/v1beta1/genesis.proto b/packages/types/protobuf/proto/osmosis/txfees/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/txfees/v1beta1/genesis.proto rename to packages/types/protobuf/proto/osmosis/txfees/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/osmosis/txfees/v1beta1/gov.proto b/packages/types/protobuf/proto/osmosis/txfees/v1beta1/gov.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/txfees/v1beta1/gov.proto rename to packages/types/protobuf/proto/osmosis/txfees/v1beta1/gov.proto diff --git a/packages/utils/protobuf/proto/osmosis/txfees/v1beta1/query.proto b/packages/types/protobuf/proto/osmosis/txfees/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/txfees/v1beta1/query.proto rename to packages/types/protobuf/proto/osmosis/txfees/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/osmosis/valset-pref/v1beta1/query.proto b/packages/types/protobuf/proto/osmosis/valset-pref/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/valset-pref/v1beta1/query.proto rename to packages/types/protobuf/proto/osmosis/valset-pref/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/osmosis/valset-pref/v1beta1/query.yml b/packages/types/protobuf/proto/osmosis/valset-pref/v1beta1/query.yml similarity index 100% rename from packages/utils/protobuf/proto/osmosis/valset-pref/v1beta1/query.yml rename to packages/types/protobuf/proto/osmosis/valset-pref/v1beta1/query.yml diff --git a/packages/utils/protobuf/proto/osmosis/valset-pref/v1beta1/state.proto b/packages/types/protobuf/proto/osmosis/valset-pref/v1beta1/state.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/valset-pref/v1beta1/state.proto rename to packages/types/protobuf/proto/osmosis/valset-pref/v1beta1/state.proto diff --git a/packages/utils/protobuf/proto/osmosis/valset-pref/v1beta1/tx.proto b/packages/types/protobuf/proto/osmosis/valset-pref/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/osmosis/valset-pref/v1beta1/tx.proto rename to packages/types/protobuf/proto/osmosis/valset-pref/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/publicawesome/stargaze/alloc/v1beta1/genesis.proto b/packages/types/protobuf/proto/publicawesome/stargaze/alloc/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/publicawesome/stargaze/alloc/v1beta1/genesis.proto rename to packages/types/protobuf/proto/publicawesome/stargaze/alloc/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/publicawesome/stargaze/alloc/v1beta1/params.proto b/packages/types/protobuf/proto/publicawesome/stargaze/alloc/v1beta1/params.proto similarity index 100% rename from packages/utils/protobuf/proto/publicawesome/stargaze/alloc/v1beta1/params.proto rename to packages/types/protobuf/proto/publicawesome/stargaze/alloc/v1beta1/params.proto diff --git a/packages/utils/protobuf/proto/publicawesome/stargaze/alloc/v1beta1/query.proto b/packages/types/protobuf/proto/publicawesome/stargaze/alloc/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/publicawesome/stargaze/alloc/v1beta1/query.proto rename to packages/types/protobuf/proto/publicawesome/stargaze/alloc/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/publicawesome/stargaze/alloc/v1beta1/tx.proto b/packages/types/protobuf/proto/publicawesome/stargaze/alloc/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/publicawesome/stargaze/alloc/v1beta1/tx.proto rename to packages/types/protobuf/proto/publicawesome/stargaze/alloc/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/publicawesome/stargaze/cron/v1/cron.proto b/packages/types/protobuf/proto/publicawesome/stargaze/cron/v1/cron.proto similarity index 100% rename from packages/utils/protobuf/proto/publicawesome/stargaze/cron/v1/cron.proto rename to packages/types/protobuf/proto/publicawesome/stargaze/cron/v1/cron.proto diff --git a/packages/utils/protobuf/proto/publicawesome/stargaze/cron/v1/genesis.proto b/packages/types/protobuf/proto/publicawesome/stargaze/cron/v1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/publicawesome/stargaze/cron/v1/genesis.proto rename to packages/types/protobuf/proto/publicawesome/stargaze/cron/v1/genesis.proto diff --git a/packages/utils/protobuf/proto/publicawesome/stargaze/cron/v1/proposal.proto b/packages/types/protobuf/proto/publicawesome/stargaze/cron/v1/proposal.proto similarity index 100% rename from packages/utils/protobuf/proto/publicawesome/stargaze/cron/v1/proposal.proto rename to packages/types/protobuf/proto/publicawesome/stargaze/cron/v1/proposal.proto diff --git a/packages/utils/protobuf/proto/publicawesome/stargaze/cron/v1/query.proto b/packages/types/protobuf/proto/publicawesome/stargaze/cron/v1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/publicawesome/stargaze/cron/v1/query.proto rename to packages/types/protobuf/proto/publicawesome/stargaze/cron/v1/query.proto diff --git a/packages/utils/protobuf/proto/publicawesome/stargaze/cron/v1/tx.proto b/packages/types/protobuf/proto/publicawesome/stargaze/cron/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/publicawesome/stargaze/cron/v1/tx.proto rename to packages/types/protobuf/proto/publicawesome/stargaze/cron/v1/tx.proto diff --git a/packages/utils/protobuf/proto/publicawesome/stargaze/globalfee/v1/genesis.proto b/packages/types/protobuf/proto/publicawesome/stargaze/globalfee/v1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/publicawesome/stargaze/globalfee/v1/genesis.proto rename to packages/types/protobuf/proto/publicawesome/stargaze/globalfee/v1/genesis.proto diff --git a/packages/utils/protobuf/proto/publicawesome/stargaze/globalfee/v1/globalfee.proto b/packages/types/protobuf/proto/publicawesome/stargaze/globalfee/v1/globalfee.proto similarity index 100% rename from packages/utils/protobuf/proto/publicawesome/stargaze/globalfee/v1/globalfee.proto rename to packages/types/protobuf/proto/publicawesome/stargaze/globalfee/v1/globalfee.proto diff --git a/packages/utils/protobuf/proto/publicawesome/stargaze/globalfee/v1/proposal.proto b/packages/types/protobuf/proto/publicawesome/stargaze/globalfee/v1/proposal.proto similarity index 100% rename from packages/utils/protobuf/proto/publicawesome/stargaze/globalfee/v1/proposal.proto rename to packages/types/protobuf/proto/publicawesome/stargaze/globalfee/v1/proposal.proto diff --git a/packages/utils/protobuf/proto/publicawesome/stargaze/globalfee/v1/query.proto b/packages/types/protobuf/proto/publicawesome/stargaze/globalfee/v1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/publicawesome/stargaze/globalfee/v1/query.proto rename to packages/types/protobuf/proto/publicawesome/stargaze/globalfee/v1/query.proto diff --git a/packages/utils/protobuf/proto/publicawesome/stargaze/globalfee/v1/tx.proto b/packages/types/protobuf/proto/publicawesome/stargaze/globalfee/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/publicawesome/stargaze/globalfee/v1/tx.proto rename to packages/types/protobuf/proto/publicawesome/stargaze/globalfee/v1/tx.proto diff --git a/packages/utils/protobuf/proto/publicawesome/stargaze/mint/v1beta1/genesis.proto b/packages/types/protobuf/proto/publicawesome/stargaze/mint/v1beta1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/publicawesome/stargaze/mint/v1beta1/genesis.proto rename to packages/types/protobuf/proto/publicawesome/stargaze/mint/v1beta1/genesis.proto diff --git a/packages/utils/protobuf/proto/publicawesome/stargaze/mint/v1beta1/mint.proto b/packages/types/protobuf/proto/publicawesome/stargaze/mint/v1beta1/mint.proto similarity index 100% rename from packages/utils/protobuf/proto/publicawesome/stargaze/mint/v1beta1/mint.proto rename to packages/types/protobuf/proto/publicawesome/stargaze/mint/v1beta1/mint.proto diff --git a/packages/utils/protobuf/proto/publicawesome/stargaze/mint/v1beta1/query.proto b/packages/types/protobuf/proto/publicawesome/stargaze/mint/v1beta1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/publicawesome/stargaze/mint/v1beta1/query.proto rename to packages/types/protobuf/proto/publicawesome/stargaze/mint/v1beta1/query.proto diff --git a/packages/utils/protobuf/proto/publicawesome/stargaze/mint/v1beta1/tx.proto b/packages/types/protobuf/proto/publicawesome/stargaze/mint/v1beta1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/publicawesome/stargaze/mint/v1beta1/tx.proto rename to packages/types/protobuf/proto/publicawesome/stargaze/mint/v1beta1/tx.proto diff --git a/packages/utils/protobuf/proto/regen/data/v1/events.proto b/packages/types/protobuf/proto/regen/data/v1/events.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/data/v1/events.proto rename to packages/types/protobuf/proto/regen/data/v1/events.proto diff --git a/packages/utils/protobuf/proto/regen/data/v1/state.proto b/packages/types/protobuf/proto/regen/data/v1/state.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/data/v1/state.proto rename to packages/types/protobuf/proto/regen/data/v1/state.proto diff --git a/packages/utils/protobuf/proto/regen/data/v1/tx.proto b/packages/types/protobuf/proto/regen/data/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/data/v1/tx.proto rename to packages/types/protobuf/proto/regen/data/v1/tx.proto diff --git a/packages/utils/protobuf/proto/regen/data/v1/types.proto b/packages/types/protobuf/proto/regen/data/v1/types.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/data/v1/types.proto rename to packages/types/protobuf/proto/regen/data/v1/types.proto diff --git a/packages/utils/protobuf/proto/regen/data/v2/events.proto b/packages/types/protobuf/proto/regen/data/v2/events.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/data/v2/events.proto rename to packages/types/protobuf/proto/regen/data/v2/events.proto diff --git a/packages/utils/protobuf/proto/regen/data/v2/state.proto b/packages/types/protobuf/proto/regen/data/v2/state.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/data/v2/state.proto rename to packages/types/protobuf/proto/regen/data/v2/state.proto diff --git a/packages/utils/protobuf/proto/regen/data/v2/tx.proto b/packages/types/protobuf/proto/regen/data/v2/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/data/v2/tx.proto rename to packages/types/protobuf/proto/regen/data/v2/tx.proto diff --git a/packages/utils/protobuf/proto/regen/data/v2/types.proto b/packages/types/protobuf/proto/regen/data/v2/types.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/data/v2/types.proto rename to packages/types/protobuf/proto/regen/data/v2/types.proto diff --git a/packages/utils/protobuf/proto/regen/ecocredit/basket/v1/events.proto b/packages/types/protobuf/proto/regen/ecocredit/basket/v1/events.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/ecocredit/basket/v1/events.proto rename to packages/types/protobuf/proto/regen/ecocredit/basket/v1/events.proto diff --git a/packages/utils/protobuf/proto/regen/ecocredit/basket/v1/state.proto b/packages/types/protobuf/proto/regen/ecocredit/basket/v1/state.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/ecocredit/basket/v1/state.proto rename to packages/types/protobuf/proto/regen/ecocredit/basket/v1/state.proto diff --git a/packages/utils/protobuf/proto/regen/ecocredit/basket/v1/tx.proto b/packages/types/protobuf/proto/regen/ecocredit/basket/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/ecocredit/basket/v1/tx.proto rename to packages/types/protobuf/proto/regen/ecocredit/basket/v1/tx.proto diff --git a/packages/utils/protobuf/proto/regen/ecocredit/basket/v1/types.proto b/packages/types/protobuf/proto/regen/ecocredit/basket/v1/types.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/ecocredit/basket/v1/types.proto rename to packages/types/protobuf/proto/regen/ecocredit/basket/v1/types.proto diff --git a/packages/utils/protobuf/proto/regen/ecocredit/marketplace/v1/events.proto b/packages/types/protobuf/proto/regen/ecocredit/marketplace/v1/events.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/ecocredit/marketplace/v1/events.proto rename to packages/types/protobuf/proto/regen/ecocredit/marketplace/v1/events.proto diff --git a/packages/utils/protobuf/proto/regen/ecocredit/marketplace/v1/state.proto b/packages/types/protobuf/proto/regen/ecocredit/marketplace/v1/state.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/ecocredit/marketplace/v1/state.proto rename to packages/types/protobuf/proto/regen/ecocredit/marketplace/v1/state.proto diff --git a/packages/utils/protobuf/proto/regen/ecocredit/marketplace/v1/tx.proto b/packages/types/protobuf/proto/regen/ecocredit/marketplace/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/ecocredit/marketplace/v1/tx.proto rename to packages/types/protobuf/proto/regen/ecocredit/marketplace/v1/tx.proto diff --git a/packages/utils/protobuf/proto/regen/ecocredit/marketplace/v1/types.proto b/packages/types/protobuf/proto/regen/ecocredit/marketplace/v1/types.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/ecocredit/marketplace/v1/types.proto rename to packages/types/protobuf/proto/regen/ecocredit/marketplace/v1/types.proto diff --git a/packages/utils/protobuf/proto/regen/ecocredit/orderbook/v1alpha1/memory.proto b/packages/types/protobuf/proto/regen/ecocredit/orderbook/v1alpha1/memory.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/ecocredit/orderbook/v1alpha1/memory.proto rename to packages/types/protobuf/proto/regen/ecocredit/orderbook/v1alpha1/memory.proto diff --git a/packages/utils/protobuf/proto/regen/ecocredit/v1/events.proto b/packages/types/protobuf/proto/regen/ecocredit/v1/events.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/ecocredit/v1/events.proto rename to packages/types/protobuf/proto/regen/ecocredit/v1/events.proto diff --git a/packages/utils/protobuf/proto/regen/ecocredit/v1/state.proto b/packages/types/protobuf/proto/regen/ecocredit/v1/state.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/ecocredit/v1/state.proto rename to packages/types/protobuf/proto/regen/ecocredit/v1/state.proto diff --git a/packages/utils/protobuf/proto/regen/ecocredit/v1/tx.proto b/packages/types/protobuf/proto/regen/ecocredit/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/ecocredit/v1/tx.proto rename to packages/types/protobuf/proto/regen/ecocredit/v1/tx.proto diff --git a/packages/utils/protobuf/proto/regen/ecocredit/v1/types.proto b/packages/types/protobuf/proto/regen/ecocredit/v1/types.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/ecocredit/v1/types.proto rename to packages/types/protobuf/proto/regen/ecocredit/v1/types.proto diff --git a/packages/utils/protobuf/proto/regen/ecocredit/v1alpha1/events.proto b/packages/types/protobuf/proto/regen/ecocredit/v1alpha1/events.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/ecocredit/v1alpha1/events.proto rename to packages/types/protobuf/proto/regen/ecocredit/v1alpha1/events.proto diff --git a/packages/utils/protobuf/proto/regen/ecocredit/v1alpha1/genesis.proto b/packages/types/protobuf/proto/regen/ecocredit/v1alpha1/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/ecocredit/v1alpha1/genesis.proto rename to packages/types/protobuf/proto/regen/ecocredit/v1alpha1/genesis.proto diff --git a/packages/utils/protobuf/proto/regen/ecocredit/v1alpha1/tx.proto b/packages/types/protobuf/proto/regen/ecocredit/v1alpha1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/ecocredit/v1alpha1/tx.proto rename to packages/types/protobuf/proto/regen/ecocredit/v1alpha1/tx.proto diff --git a/packages/utils/protobuf/proto/regen/ecocredit/v1alpha1/types.proto b/packages/types/protobuf/proto/regen/ecocredit/v1alpha1/types.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/ecocredit/v1alpha1/types.proto rename to packages/types/protobuf/proto/regen/ecocredit/v1alpha1/types.proto diff --git a/packages/utils/protobuf/proto/regen/intertx/v1/query.proto b/packages/types/protobuf/proto/regen/intertx/v1/query.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/intertx/v1/query.proto rename to packages/types/protobuf/proto/regen/intertx/v1/query.proto diff --git a/packages/utils/protobuf/proto/regen/intertx/v1/tx.proto b/packages/types/protobuf/proto/regen/intertx/v1/tx.proto similarity index 100% rename from packages/utils/protobuf/proto/regen/intertx/v1/tx.proto rename to packages/types/protobuf/proto/regen/intertx/v1/tx.proto diff --git a/packages/utils/protobuf/proto/tariff/genesis.proto b/packages/types/protobuf/proto/tariff/genesis.proto similarity index 100% rename from packages/utils/protobuf/proto/tariff/genesis.proto rename to packages/types/protobuf/proto/tariff/genesis.proto diff --git a/packages/utils/protobuf/proto/tariff/params.proto b/packages/types/protobuf/proto/tariff/params.proto similarity index 100% rename from packages/utils/protobuf/proto/tariff/params.proto rename to packages/types/protobuf/proto/tariff/params.proto diff --git a/packages/utils/protobuf/proto/tariff/query.proto b/packages/types/protobuf/proto/tariff/query.proto similarity index 100% rename from packages/utils/protobuf/proto/tariff/query.proto rename to packages/types/protobuf/proto/tariff/query.proto diff --git a/packages/utils/protobuf/proto/tendermint/abci/types.proto b/packages/types/protobuf/proto/tendermint/abci/types.proto similarity index 100% rename from packages/utils/protobuf/proto/tendermint/abci/types.proto rename to packages/types/protobuf/proto/tendermint/abci/types.proto diff --git a/packages/utils/protobuf/proto/tendermint/crypto/keys.proto b/packages/types/protobuf/proto/tendermint/crypto/keys.proto similarity index 100% rename from packages/utils/protobuf/proto/tendermint/crypto/keys.proto rename to packages/types/protobuf/proto/tendermint/crypto/keys.proto diff --git a/packages/utils/protobuf/proto/tendermint/crypto/proof.proto b/packages/types/protobuf/proto/tendermint/crypto/proof.proto similarity index 100% rename from packages/utils/protobuf/proto/tendermint/crypto/proof.proto rename to packages/types/protobuf/proto/tendermint/crypto/proof.proto diff --git a/packages/utils/protobuf/proto/tendermint/libs/bits/types.proto b/packages/types/protobuf/proto/tendermint/libs/bits/types.proto similarity index 100% rename from packages/utils/protobuf/proto/tendermint/libs/bits/types.proto rename to packages/types/protobuf/proto/tendermint/libs/bits/types.proto diff --git a/packages/utils/protobuf/proto/tendermint/p2p/types.proto b/packages/types/protobuf/proto/tendermint/p2p/types.proto similarity index 100% rename from packages/utils/protobuf/proto/tendermint/p2p/types.proto rename to packages/types/protobuf/proto/tendermint/p2p/types.proto diff --git a/packages/utils/protobuf/proto/tendermint/types/block.proto b/packages/types/protobuf/proto/tendermint/types/block.proto similarity index 100% rename from packages/utils/protobuf/proto/tendermint/types/block.proto rename to packages/types/protobuf/proto/tendermint/types/block.proto diff --git a/packages/utils/protobuf/proto/tendermint/types/evidence.proto b/packages/types/protobuf/proto/tendermint/types/evidence.proto similarity index 100% rename from packages/utils/protobuf/proto/tendermint/types/evidence.proto rename to packages/types/protobuf/proto/tendermint/types/evidence.proto diff --git a/packages/utils/protobuf/proto/tendermint/types/params.proto b/packages/types/protobuf/proto/tendermint/types/params.proto similarity index 100% rename from packages/utils/protobuf/proto/tendermint/types/params.proto rename to packages/types/protobuf/proto/tendermint/types/params.proto diff --git a/packages/utils/protobuf/proto/tendermint/types/types.proto b/packages/types/protobuf/proto/tendermint/types/types.proto similarity index 100% rename from packages/utils/protobuf/proto/tendermint/types/types.proto rename to packages/types/protobuf/proto/tendermint/types/types.proto diff --git a/packages/utils/protobuf/proto/tendermint/types/validator.proto b/packages/types/protobuf/proto/tendermint/types/validator.proto similarity index 100% rename from packages/utils/protobuf/proto/tendermint/types/validator.proto rename to packages/types/protobuf/proto/tendermint/types/validator.proto diff --git a/packages/utils/protobuf/proto/tendermint/version/types.proto b/packages/types/protobuf/proto/tendermint/version/types.proto similarity index 100% rename from packages/utils/protobuf/proto/tendermint/version/types.proto rename to packages/types/protobuf/proto/tendermint/version/types.proto diff --git a/packages/utils/protobuf/scripts/codegen.js b/packages/types/protobuf/scripts/codegen.js similarity index 100% rename from packages/utils/protobuf/scripts/codegen.js rename to packages/types/protobuf/scripts/codegen.js diff --git a/packages/types/protobuf/utils.ts b/packages/types/protobuf/utils.ts new file mode 100644 index 000000000..c74da0e42 --- /dev/null +++ b/packages/types/protobuf/utils.ts @@ -0,0 +1,733 @@ +// Some generated protobuf types need the `rawProtobufMsgToAmino` and +// `aminoToRawProtobufMsg` functions to properly encode nested protobufs. To +// prevent needing to import from @dao-dao/utils and cause circular package +// dependencies, we need all the utils below to exist in this package +// (@dao-dao/types) where the protobuf types are. Ideally we can move these +// to @dao-dao/utils when telescope internally handles a type registry that can +// encode the nested types like we do below. + +import { AminoMsg } from '@cosmjs/amino' +import { fromBase64, toBase64 } from '@cosmjs/encoding' +import { EncodeObject, GeneratedType, Registry } from '@cosmjs/proto-signing' +import { AminoTypes } from '@cosmjs/stargate' + +import { DecodedStargateMsg } from '../chain' +import { + CosmosMsgFor_Empty, + VoteOption as CwVoteOption, + StargateMsg, +} from '../contracts' +import { + allianceAminoConverters, + allianceProtoRegistry, + circleAminoConverters, + circleProtoRegistry, + cosmosAminoConverters, + cosmosProtoRegistry, + cosmwasmAminoConverters, + cosmwasmProtoRegistry, + gaiaAminoConverters, + gaiaProtoRegistry, + google, + ibcAminoConverters, + ibcProtoRegistry, + junoAminoConverters, + junoProtoRegistry, + neutronAminoConverters, + neutronProtoRegistry, + osmosisAminoConverters, + osmosisProtoRegistry, + regenAminoConverters, + regenProtoRegistry, + publicawesomeAminoConverters as stargazeAminoConverters, + publicawesomeProtoRegistry as stargazeProtoRegistry, +} from './codegen' +import { + MsgCreateAllianceProposal, + MsgDeleteAllianceProposal, + MsgUpdateAllianceProposal, +} from './codegen/alliance/alliance/gov' +import { MsgSend } from './codegen/cosmos/bank/v1beta1/tx' +import { + MsgSetWithdrawAddress, + MsgWithdrawDelegatorReward, +} from './codegen/cosmos/distribution/v1beta1/tx' +import { VoteOption as GovVoteOption } from './codegen/cosmos/gov/v1/gov' +import { MsgVote } from './codegen/cosmos/gov/v1beta1/tx' +import { ParameterChangeProposal } from './codegen/cosmos/params/v1beta1/params' +import { + MsgBeginRedelegate, + MsgDelegate, + MsgUndelegate, +} from './codegen/cosmos/staking/v1beta1/tx' +import { + MsgClearAdmin, + MsgExecuteContract, + MsgInstantiateContract, + MsgInstantiateContract2, + MsgMigrateContract, + MsgUpdateAdmin, +} from './codegen/cosmwasm/wasm/v1/tx' +import { Any } from './codegen/google/protobuf/any' +import { UploadCosmWasmPoolCodeAndWhiteListProposal } from './codegen/osmosis/cosmwasmpool/v1beta1/gov' + +// Convert CosmWasm message to its encoded protobuf equivalent. +export const cwMsgToProtobuf = ( + ...params: Parameters +): Any => { + const { typeUrl, value } = cwMsgToEncodeObject(...params) + return { + typeUrl, + value: encodeProtobufValue(typeUrl, value), + } +} + +// Convert protobuf to its CosmWasm message equivalent. +export const protobufToCwMsg = ( + ...params: Parameters +): { + msg: CosmosMsgFor_Empty + sender: string +} => decodedStargateMsgToCw(decodeRawProtobufMsg(...params)) + +export const cwMsgToEncodeObject = ( + msg: CosmosMsgFor_Empty, + sender: string +): EncodeObject => { + if ('bank' in msg) { + const bankMsg = msg.bank + + if ('send' in bankMsg) { + const encodeObject: EncodeObject = { + typeUrl: MsgSend.typeUrl, + value: { + fromAddress: sender, + toAddress: bankMsg.send.to_address, + amount: bankMsg.send.amount, + }, + } + + return encodeObject + } + + // burn does not exist? + + throw new Error('Unsupported bank module message.') + } + + if ('staking' in msg) { + const stakingMsg = msg.staking + + if ('delegate' in stakingMsg) { + const encodeObject: EncodeObject = { + typeUrl: MsgDelegate.typeUrl, + value: { + delegatorAddress: sender, + validatorAddress: stakingMsg.delegate.validator, + amount: stakingMsg.delegate.amount, + }, + } + return encodeObject + } + + if ('undelegate' in stakingMsg) { + const encodeObject: EncodeObject = { + typeUrl: MsgUndelegate.typeUrl, + value: { + delegatorAddress: sender, + validatorAddress: stakingMsg.undelegate.validator, + amount: stakingMsg.undelegate.amount, + }, + } + return encodeObject + } + + if ('redelegate' in stakingMsg) { + const encodeObject: EncodeObject = { + typeUrl: MsgBeginRedelegate.typeUrl, + value: { + delegatorAddress: sender, + validatorSrcAddress: stakingMsg.redelegate.src_validator, + validatorDstAddress: stakingMsg.redelegate.dst_validator, + amount: stakingMsg.redelegate.amount, + }, + } + return encodeObject + } + + throw new Error('Unsupported staking module message.') + } + + if ('distribution' in msg) { + const distributionMsg = msg.distribution + + if ('withdraw_delegator_reward' in distributionMsg) { + const encodeObject: EncodeObject = { + typeUrl: MsgWithdrawDelegatorReward.typeUrl, + value: { + delegatorAddress: sender, + validatorAddress: distributionMsg.withdraw_delegator_reward.validator, + }, + } + return encodeObject + } + + if ('set_withdraw_address' in distributionMsg) { + const encodeObject: EncodeObject = { + typeUrl: MsgSetWithdrawAddress.typeUrl, + value: { + delegatorAddress: sender, + withdrawAddress: distributionMsg.set_withdraw_address.address, + }, + } + return encodeObject + } + + throw new Error('Unsupported distribution module message.') + } + + if ('stargate' in msg) { + return decodeStargateMessage(msg, false).stargate + } + + if ('wasm' in msg) { + const wasmMsg = msg.wasm + + // MsgStoreCodeEncodeObject missing from CosmosMsgFor_Empty. + + if ('execute' in wasmMsg) { + const encodeObject: EncodeObject = { + typeUrl: MsgExecuteContract.typeUrl, + value: { + sender, + contract: wasmMsg.execute.contract_addr, + funds: wasmMsg.execute.funds, + msg: fromBase64(wasmMsg.execute.msg), + }, + } + return encodeObject + } + + if ('instantiate' in wasmMsg) { + const encodeObject: EncodeObject = { + typeUrl: MsgInstantiateContract.typeUrl, + value: { + sender, + admin: wasmMsg.instantiate.admin ?? undefined, + codeId: BigInt(wasmMsg.instantiate.code_id), + label: wasmMsg.instantiate.label, + msg: fromBase64(wasmMsg.instantiate.msg), + funds: wasmMsg.instantiate.funds, + }, + } + return encodeObject + } + + if ('instantiate2' in wasmMsg) { + const encodeObject: EncodeObject = { + typeUrl: MsgInstantiateContract2.typeUrl, + value: { + sender, + admin: wasmMsg.instantiate2.admin ?? undefined, + codeId: BigInt(wasmMsg.instantiate2.code_id), + label: wasmMsg.instantiate2.label, + msg: fromBase64(wasmMsg.instantiate2.msg), + funds: wasmMsg.instantiate2.funds, + salt: fromBase64(wasmMsg.instantiate2.salt), + fixMsg: wasmMsg.instantiate2.fix_msg, + }, + } + return encodeObject + } + + if ('migrate' in wasmMsg) { + const encodeObject: EncodeObject = { + typeUrl: MsgMigrateContract.typeUrl, + value: { + sender, + contract: wasmMsg.migrate.contract_addr, + codeId: BigInt(wasmMsg.migrate.new_code_id), + msg: fromBase64(wasmMsg.migrate.msg), + }, + } + return encodeObject + } + + if ('update_admin' in wasmMsg) { + const encodeObject: EncodeObject = { + typeUrl: MsgUpdateAdmin.typeUrl, + value: { + sender, + newAdmin: wasmMsg.update_admin.admin, + contract: wasmMsg.update_admin.contract_addr, + }, + } + return encodeObject + } + + if ('clear_admin' in wasmMsg) { + const encodeObject: EncodeObject = { + typeUrl: MsgClearAdmin.typeUrl, + value: { + sender, + contract: wasmMsg.clear_admin.contract_addr, + }, + } + return encodeObject + } + + throw new Error('Unsupported wasm module message.') + } + + if ('gov' in msg) { + const govMsg = msg.gov + + // MsgDepositEncodeObject and MsgSubmitProposalEncodeObject missing from + // CosmosMsgFor_Empty. + + if ('vote' in govMsg) { + const encodeObject: EncodeObject = { + typeUrl: MsgVote.typeUrl, + value: { + proposalId: BigInt(govMsg.vote.proposal_id), + voter: sender, + option: cwVoteOptionToGovVoteOption(govMsg.vote.vote), + }, + } + return encodeObject + } + + throw new Error('Unsupported gov module message.') + } + + throw new Error('Unsupported cosmos message.') +} + +// This should mirror the encoder function above. Do not use this function to +// convert messages that were decoded with `recursive = true`, like in the +// `useDecodedCosmosMsg` hook in actions. That's because the default case with +// `makeStargateMessage` needs a non-recursively encoded message due to +// technicalities with nested protobufs. +export const decodedStargateMsgToCw = ({ + typeUrl, + value, +}: DecodedStargateMsg['stargate']): { + msg: CosmosMsgFor_Empty + sender: string +} => { + let msg: CosmosMsgFor_Empty + let sender = '' + switch (typeUrl) { + case MsgSend.typeUrl: + msg = { + bank: { + send: { + amount: value.amount, + to_address: value.toAddress, + }, + }, + } + sender = value.fromAddress + break + case MsgDelegate.typeUrl: + msg = { + staking: { + delegate: { + amount: value.amount, + validator: value.validatorAddress, + }, + }, + } + sender = value.delegatorAddress + break + case MsgUndelegate.typeUrl: + msg = { + staking: { + undelegate: { + amount: value.amount, + validator: value.validatorAddress, + }, + }, + } + sender = value.delegatorAddress + break + case MsgBeginRedelegate.typeUrl: + msg = { + staking: { + redelegate: { + amount: value.amount, + src_validator: value.validatorSrcAddress, + dst_validator: value.validatorDstAddress, + }, + }, + } + sender = value.delegatorAddress + break + case MsgWithdrawDelegatorReward.typeUrl: + msg = { + distribution: { + withdraw_delegator_reward: { + validator: value.validatorAddress, + }, + }, + } + sender = value.delegatorAddress + break + case MsgSetWithdrawAddress.typeUrl: + msg = { + distribution: { + set_withdraw_address: { + address: value.withdrawAddress, + }, + }, + } + sender = value.delegatorAddress + break + case MsgExecuteContract.typeUrl: + msg = { + wasm: { + execute: { + contract_addr: value.contract, + funds: value.funds, + msg: toBase64(value.msg), + }, + }, + } + sender = value.sender + break + case MsgInstantiateContract.typeUrl: + msg = { + wasm: { + instantiate: { + admin: value.admin, + code_id: Number(value.codeId), + label: value.label, + msg: toBase64(value.msg), + funds: value.funds, + }, + }, + } + sender = value.sender + break + case MsgInstantiateContract2.typeUrl: + msg = { + wasm: { + instantiate2: { + admin: value.admin, + code_id: Number(value.codeId), + label: value.label, + msg: toBase64(value.msg), + funds: value.funds, + fix_msg: value.fixMsg, + salt: toBase64(value.salt), + }, + }, + } + sender = value.sender + break + case MsgMigrateContract.typeUrl: + msg = { + wasm: { + migrate: { + contract_addr: value.contract, + new_code_id: Number(value.codeId), + msg: toBase64(value.msg), + }, + }, + } + sender = value.sender + break + case MsgUpdateAdmin.typeUrl: + msg = { + wasm: { + update_admin: { + admin: value.newAdmin, + contract_addr: value.contract, + }, + }, + } + sender = value.sender + break + case MsgClearAdmin.typeUrl: + msg = { + wasm: { + clear_admin: { + contract_addr: value.contract, + }, + }, + } + sender = value.sender + break + case MsgVote.typeUrl: + msg = { + gov: { + vote: { + proposal_id: Number(value.proposalId), + vote: govVoteOptionToCwVoteOption(value.option), + }, + }, + } + sender = value.voter + break + default: + msg = makeStargateMessage({ + stargate: { + typeUrl, + value, + }, + }) + break + } + + return { + msg, + sender, + } +} + +// Convert staking-related stargate msg to CosmWasm format. Returns undefined if +// not a staking-related message. +export const decodedStakingStargateMsgToCw = ({ + typeUrl, + value, +}: DecodedStargateMsg['stargate']): CosmosMsgFor_Empty | undefined => { + switch (typeUrl) { + case MsgDelegate.typeUrl: + return { + staking: { + delegate: { + amount: value.amount, + validator: value.validatorAddress, + }, + }, + } + case MsgUndelegate.typeUrl: + return { + staking: { + undelegate: { + amount: value.amount, + validator: value.validatorAddress, + }, + }, + } + case MsgBeginRedelegate.typeUrl: + return { + staking: { + redelegate: { + amount: value.amount, + src_validator: value.validatorSrcAddress, + dst_validator: value.validatorDstAddress, + }, + }, + } + case MsgWithdrawDelegatorReward.typeUrl: + return { + distribution: { + withdraw_delegator_reward: { + validator: value.validatorAddress, + }, + }, + } + case MsgSetWithdrawAddress.typeUrl: + return { + distribution: { + set_withdraw_address: { + address: value.withdrawAddress, + }, + }, + } + } +} + +export const PROTOBUF_TYPES: ReadonlyArray<[string, GeneratedType]> = [ + ...cosmosProtoRegistry, + ...cosmwasmProtoRegistry, + ['/google.protobuf.Timestamp', google.protobuf.Timestamp as GeneratedType], + ...junoProtoRegistry, + ...osmosisProtoRegistry, + ...ibcProtoRegistry, + ...stargazeProtoRegistry, + ...gaiaProtoRegistry, + ...neutronProtoRegistry, + ...regenProtoRegistry, + ...allianceProtoRegistry, + ...circleProtoRegistry, + // Not a query or TX so it isn't included in any of the registries. But we + // want to decode this because it appears in gov props. We need to find a + // better way to collect all generated types in a single registry... + [ParameterChangeProposal.typeUrl, ParameterChangeProposal as GeneratedType], + [ + UploadCosmWasmPoolCodeAndWhiteListProposal.typeUrl, + UploadCosmWasmPoolCodeAndWhiteListProposal as GeneratedType, + ], + // alliance.alliance + [ + MsgCreateAllianceProposal.typeUrl, + MsgCreateAllianceProposal as GeneratedType, + ], + [ + MsgUpdateAllianceProposal.typeUrl, + MsgUpdateAllianceProposal as GeneratedType, + ], + [ + MsgDeleteAllianceProposal.typeUrl, + MsgDeleteAllianceProposal as GeneratedType, + ], +] +export const typesRegistry = new Registry(PROTOBUF_TYPES) + +export const aminoTypes = new AminoTypes({ + ...cosmosAminoConverters, + ...cosmwasmAminoConverters, + ...junoAminoConverters, + ...osmosisAminoConverters, + ...ibcAminoConverters, + ...stargazeAminoConverters, + ...gaiaAminoConverters, + ...neutronAminoConverters, + ...regenAminoConverters, + ...allianceAminoConverters, + ...circleAminoConverters, +}) + +// Encodes a protobuf message value from its JSON representation into a byte +// array. +export const encodeProtobufValue = ( + typeUrl: string, + value: any +): Uint8Array => { + const type = typesRegistry.lookupType(typeUrl) + if (!type) { + throw new Error(`Type ${typeUrl} not found in registry.`) + } + const encodedValue = type.encode(value).finish() + return encodedValue +} + +// Decodes an encoded protobuf message's value from a Uint8Array or base64 +// string into its JSON representation. +export const decodeProtobufValue = ( + typeUrl: string, + encodedValue: string | Uint8Array, + // Recursively decode nested protobufs. This is useful for automatically + // decoding `Any` types where protobuf interfaces exist. + recursive = true +): any => { + const type = typesRegistry.lookupType(typeUrl) + if (!type) { + throw new Error(`Type ${typeUrl} not found in registry.`) + } + + const decodedValue = type.decode( + typeof encodedValue === 'string' ? fromBase64(encodedValue) : encodedValue, + undefined, + // The types in the registry take an extra parameter for recursive + // decoding even though the registry itself is unaware of this type. Thus, + // tell TypeScript to ignore it. + // @ts-ignore + recursive + ) + return decodedValue +} + +// Decodes a protobuf message from `Any` into its JSON representation. +export const decodeRawProtobufMsg = ( + { typeUrl, value }: Any, + recursive = true +): DecodedStargateMsg['stargate'] => ({ + typeUrl, + value: decodeProtobufValue(typeUrl, value, recursive), +}) + +// Convert protobuf Any into its Amino msg. +export const rawProtobufMsgToAmino = ( + ...params: Parameters +): AminoMsg => aminoTypes.toAmino(decodeRawProtobufMsg(...params)) + +// Convert Amino msg into raw protobuf Any. +export const aminoToRawProtobufMsg = (msg: AminoMsg): Any => { + const { typeUrl, value } = aminoTypes.fromAmino(msg) + return { + typeUrl, + value: encodeProtobufValue(typeUrl, value), + } +} + +// Encodes a protobuf message from its JSON representation into a `StargateMsg` +// that `CosmWasm` understands. +export const makeStargateMessage = ({ + stargate: { typeUrl, value }, +}: DecodedStargateMsg): StargateMsg => ({ + stargate: { + type_url: typeUrl, + value: toBase64(encodeProtobufValue(typeUrl, prepareProtobufJson(value))), + }, +}) + +// Decodes an encoded protobuf message from CosmWasm's `StargateMsg` into its +// JSON representation. +export const decodeStargateMessage = ( + { stargate: { type_url, value } }: StargateMsg, + recursive = true +): DecodedStargateMsg => ({ + stargate: { + typeUrl: type_url, + value: decodeProtobufValue(type_url, value, recursive), + }, +}) + +// Prepare JSON for protobuf encoding. Some fields, like Dates, need special +// handling so that any protobuf type can be encoded. +// +// Rules: +// (1) Strings with the 'DATE:' prefix are converted to Dates. +export const prepareProtobufJson = (msg: any): any => + msg instanceof Uint8Array + ? msg + : Array.isArray(msg) + ? msg.map(prepareProtobufJson) + : // Rule (1) + typeof msg === 'string' && msg.startsWith('DATE:') + ? new Date(msg.replace('DATE:', '')) + : typeof msg !== 'object' || msg === null || msg.constructor !== Object + ? msg + : Object.entries(msg).reduce( + (acc, [key, value]) => ({ + ...acc, + [key]: prepareProtobufJson(value), + }), + {} as Record + ) + +export const cwVoteOptionToGovVoteOption = ( + cwVote: CwVoteOption +): GovVoteOption => + cwVote === 'yes' + ? GovVoteOption.VOTE_OPTION_YES + : cwVote === 'no' + ? GovVoteOption.VOTE_OPTION_NO + : cwVote === 'abstain' + ? GovVoteOption.VOTE_OPTION_ABSTAIN + : cwVote === 'no_with_veto' + ? GovVoteOption.VOTE_OPTION_NO_WITH_VETO + : GovVoteOption.VOTE_OPTION_UNSPECIFIED + +export const govVoteOptionToCwVoteOption = ( + govVote: GovVoteOption +): CwVoteOption => { + const cwVote: CwVoteOption | undefined = + govVote === GovVoteOption.VOTE_OPTION_YES + ? 'yes' + : govVote === GovVoteOption.VOTE_OPTION_NO + ? 'no' + : govVote === GovVoteOption.VOTE_OPTION_ABSTAIN + ? 'abstain' + : govVote === GovVoteOption.VOTE_OPTION_NO_WITH_VETO + ? 'no_with_veto' + : undefined + if (!cwVote) { + throw new Error('Invalid vote option') + } + + return cwVote +} diff --git a/packages/types/vesting.ts b/packages/types/vesting.ts index 8708e9e9c..025e2ea4b 100644 --- a/packages/types/vesting.ts +++ b/packages/types/vesting.ts @@ -1,5 +1,5 @@ -import { GenericToken } from '@dao-dao/types' -import { Vest } from '@dao-dao/types/contracts/CwVesting' +import { Vest } from './contracts/CwVesting' +import { GenericToken } from './token' export enum VestingContractVersion { /** diff --git a/packages/utils/README.md b/packages/utils/README.md index 474312f04..f32823bc7 100644 --- a/packages/utils/README.md +++ b/packages/utils/README.md @@ -2,51 +2,12 @@ A collection of simple utility functions used across packages. -## Protobufs - -This package contains Cosmos SDK protobuf definitions generated by Cosmology's -[Telescope](https://github.com/cosmology-tech/telescope). - -To generate protobufs: - -```bash -yarn protobuf -``` - -Sometimes definitions need to be manually fixed due to bugs and other -discrepancies. There is a patch file that records these modifications in -`protobuf/patches.diff`. - -To update the patch file when new changes are made: - -1. Commit the changes so that the current branch is up-to-date with the desired - changes. - -2. Run: - - ```bash - yarn protobuf:patch:update - ``` - - This will regenerate the protobufs, undoing all patches. Then, it records - the reverse diff between the committed changes and the regenerated protobufs - (since we want to undo the current changes). Lastly, it reapplies the latest - patches, and all changes should be made. If this works, only the - `patches.diff` file should have changes. - -3. Update the previous commit with the new patches. - - ```bash - git add protobuf/patches.diff - git commit --amend - ``` - ## Miscellaneous ### Log Code IDs To log the Code IDs from their config object in -[`constants/chains.ts`](./constants/chains.ts) in a format to put into a +[`src/constants/chains.ts`](./src/constants/chains.ts) in a format to put into a [dao-contracts](https://github.com/DA0-DA0/dao-contracts/releases) tagged release: diff --git a/packages/utils/auth.ts b/packages/utils/auth.ts index c5d503fe8..be9bb2909 100644 --- a/packages/utils/auth.ts +++ b/packages/utils/auth.ts @@ -4,7 +4,7 @@ import { getChainForChainId, getNativeTokenForChainId, secp256k1PublicKeyToBech32Address, -} from '@dao-dao/utils' +} from './chain' export type SignatureOptions< Data extends Record | undefined = Record diff --git a/packages/utils/chain.ts b/packages/utils/chain.ts index cf18920ec..4d8a9aa67 100644 --- a/packages/utils/chain.ts +++ b/packages/utils/chain.ts @@ -17,7 +17,12 @@ import { TokenType, Validator, } from '@dao-dao/types' -import { cosmos } from '@dao-dao/utils/protobuf' +import { aminoTypes, cosmos, typesRegistry } from '@dao-dao/types/protobuf' +import { ModuleAccount } from '@dao-dao/types/protobuf/codegen/cosmos/auth/v1beta1/auth' +import { + Validator as RpcValidator, + bondStatusToJSON, +} from '@dao-dao/types/protobuf/codegen/cosmos/staking/v1beta1/staking' import { getChainAssets } from './assets' import { @@ -28,12 +33,6 @@ import { ibc, } from './constants' import { getFallbackImage } from './getFallbackImage' -import { aminoTypes, typesRegistry } from './messages/protobuf' -import { ModuleAccount } from './protobuf/codegen/cosmos/auth/v1beta1/auth' -import { - Validator as RpcValidator, - bondStatusToJSON, -} from './protobuf/codegen/cosmos/staking/v1beta1/staking' export const getRpcForChainId = ( chainId: string, diff --git a/packages/utils/contracts.ts b/packages/utils/contracts.ts index 9b6887978..5477ce0b2 100644 --- a/packages/utils/contracts.ts +++ b/packages/utils/contracts.ts @@ -2,10 +2,10 @@ import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate' import { Coin, SigningStargateClient } from '@cosmjs/stargate' import { findAttribute, parseRawLog } from '@cosmjs/stargate/build/logs' -import { ContractVersion } from '@dao-dao/types' +import { ContractVersion, cwMsgToEncodeObject } from '@dao-dao/types' import { CHAIN_GAS_MULTIPLIER } from './constants' -import { cwMsgToEncodeObject, encodeMessageAsBase64 } from './messages' +import { encodeMessageAsBase64 } from './messages' const CONTRACT_VERSIONS = Object.values(ContractVersion) diff --git a/packages/utils/gov.ts b/packages/utils/gov.ts index 3508d6f39..ccc2d9b0b 100644 --- a/packages/utils/gov.ts +++ b/packages/utils/gov.ts @@ -1,14 +1,11 @@ import { - VoteOption as CwVoteOption, GOVERNANCE_PROPOSAL_TYPES, GovProposalDecodedContent, GovProposalVersion, GovProposalWithDecodedContent, GovernanceProposalActionData, } from '@dao-dao/types' - -import { VoteOption as GovVoteOption } from './protobuf/codegen/cosmos/gov/v1/gov' -import { Cosmos_govv1beta1Content_ToAmino } from './protobuf/codegen/cosmos/gov/v1beta1/tx' +import { Cosmos_govv1beta1Content_ToAmino } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/tx' export const govProposalToDecodedContent = ( proposal: GovProposalWithDecodedContent @@ -65,36 +62,3 @@ export const govProposalActionDataToDecodedContent = ( decodedMessages: data.msgs, legacyContent: [], } - -export const cwVoteOptionToGovVoteOption = ( - cwVote: CwVoteOption -): GovVoteOption => - cwVote === 'yes' - ? GovVoteOption.VOTE_OPTION_YES - : cwVote === 'no' - ? GovVoteOption.VOTE_OPTION_NO - : cwVote === 'abstain' - ? GovVoteOption.VOTE_OPTION_ABSTAIN - : cwVote === 'no_with_veto' - ? GovVoteOption.VOTE_OPTION_NO_WITH_VETO - : GovVoteOption.VOTE_OPTION_UNSPECIFIED - -export const govVoteOptionToCwVoteOption = ( - govVote: GovVoteOption -): CwVoteOption => { - const cwVote: CwVoteOption | undefined = - govVote === GovVoteOption.VOTE_OPTION_YES - ? 'yes' - : govVote === GovVoteOption.VOTE_OPTION_NO - ? 'no' - : govVote === GovVoteOption.VOTE_OPTION_ABSTAIN - ? 'abstain' - : govVote === GovVoteOption.VOTE_OPTION_NO_WITH_VETO - ? 'no_with_veto' - : undefined - if (!cwVote) { - throw new Error('Invalid vote option') - } - - return cwVote -} diff --git a/packages/utils/messages/cw.ts b/packages/utils/messages/cw.ts index e9c9e4869..f951aa89a 100644 --- a/packages/utils/messages/cw.ts +++ b/packages/utils/messages/cw.ts @@ -2,7 +2,14 @@ import { toBase64, toUtf8 } from '@cosmjs/encoding' import { Coin } from '@cosmjs/proto-signing' import { v4 as uuidv4 } from 'uuid' -import { DecodedIcaMsg, DecodedPolytoneMsg } from '@dao-dao/types' +import { + DecodedIcaMsg, + DecodedPolytoneMsg, + cwMsgToProtobuf, + decodeStargateMessage, + makeStargateMessage, + protobufToCwMsg, +} from '@dao-dao/types' import { BankMsg, CosmosMsgFor_Empty, @@ -10,6 +17,13 @@ import { StargateMsg, WasmMsg, } from '@dao-dao/types/contracts/common' +import { MsgSendTx } from '@dao-dao/types/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx' +import { + CosmosTx, + InterchainAccountPacketData, + Type, +} from '@dao-dao/types/protobuf/codegen/ibc/applications/interchain_accounts/v1/packet' +import { MsgTransfer } from '@dao-dao/types/protobuf/codegen/ibc/applications/transfer/v1/tx' import { getChainForChainName, @@ -20,21 +34,8 @@ import { import { IBC_TIMEOUT_SECONDS } from '../constants' import { processError } from '../error' import { objectMatchesStructure } from '../objectMatchesStructure' -import { MsgSendTx } from '../protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx' -import { - CosmosTx, - InterchainAccountPacketData, - Type, -} from '../protobuf/codegen/ibc/applications/interchain_accounts/v1/packet' -import { MsgTransfer } from '../protobuf/codegen/ibc/applications/transfer/v1/tx' import { encodeMessageAsBase64, parseEncodedMessage } from './encoding' -import { - cwMsgToProtobuf, - decodeStargateMessage, - isDecodedStargateMsg, - makeStargateMessage, - protobufToCwMsg, -} from './protobuf' +import { isDecodedStargateMsg } from './protobuf' type WasmMsgType = | 'execute' diff --git a/packages/utils/messages/protobuf.ts b/packages/utils/messages/protobuf.ts index 5b07089db..943b94e1a 100644 --- a/packages/utils/messages/protobuf.ts +++ b/packages/utils/messages/protobuf.ts @@ -1,689 +1,27 @@ -import { AminoMsg } from '@cosmjs/amino' -import { fromBase64, toBase64 } from '@cosmjs/encoding' -import { EncodeObject, GeneratedType, Registry } from '@cosmjs/proto-signing' -import { AminoTypes } from '@cosmjs/stargate' +import { toBase64 } from '@cosmjs/encoding' import Long from 'long' import { - CosmosMsgFor_Empty, DecodedStargateMsg, GovProposal, GovProposalV1, GovProposalV1DecodedMessages, GovProposalVersion, GovProposalWithDecodedContent, - StargateMsg, + decodeRawProtobufMsg, + decodeStargateMessage, + protobufToCwMsg, } from '@dao-dao/types' +import { MsgExecLegacyContent } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1/tx' +import { TextProposal } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' +import { Any } from '@dao-dao/types/protobuf/codegen/google/protobuf/any' import { transformIpfsUrlToHttpsIfNecessary } from '../conversion' import { processError } from '../error' -import { - cwVoteOptionToGovVoteOption, - govVoteOptionToCwVoteOption, -} from '../gov' import { isValidUrl } from '../isValidUrl' import { objectMatchesStructure } from '../objectMatchesStructure' -import { - allianceAminoConverters, - allianceProtoRegistry, - circleAminoConverters, - circleProtoRegistry, - cosmosAminoConverters, - cosmosProtoRegistry, - cosmwasmAminoConverters, - cosmwasmProtoRegistry, - gaiaAminoConverters, - gaiaProtoRegistry, - google, - ibcAminoConverters, - ibcProtoRegistry, - junoAminoConverters, - junoProtoRegistry, - neutronAminoConverters, - neutronProtoRegistry, - osmosisAminoConverters, - osmosisProtoRegistry, - regenAminoConverters, - regenProtoRegistry, - publicawesomeAminoConverters as stargazeAminoConverters, - publicawesomeProtoRegistry as stargazeProtoRegistry, -} from '../protobuf' -import { - MsgCreateAllianceProposal, - MsgDeleteAllianceProposal, - MsgUpdateAllianceProposal, -} from '../protobuf/codegen/alliance/alliance/gov' -import { MsgSend } from '../protobuf/codegen/cosmos/bank/v1beta1/tx' -import { - MsgSetWithdrawAddress, - MsgWithdrawDelegatorReward, -} from '../protobuf/codegen/cosmos/distribution/v1beta1/tx' -import { MsgExecLegacyContent } from '../protobuf/codegen/cosmos/gov/v1/tx' -import { TextProposal } from '../protobuf/codegen/cosmos/gov/v1beta1/gov' -import { MsgVote } from '../protobuf/codegen/cosmos/gov/v1beta1/tx' -import { ParameterChangeProposal } from '../protobuf/codegen/cosmos/params/v1beta1/params' -import { - MsgBeginRedelegate, - MsgDelegate, - MsgUndelegate, -} from '../protobuf/codegen/cosmos/staking/v1beta1/tx' -import { - MsgClearAdmin, - MsgExecuteContract, - MsgInstantiateContract, - MsgInstantiateContract2, - MsgMigrateContract, - MsgUpdateAdmin, -} from '../protobuf/codegen/cosmwasm/wasm/v1/tx' -import { Any } from '../protobuf/codegen/google/protobuf/any' -import { UploadCosmWasmPoolCodeAndWhiteListProposal } from '../protobuf/codegen/osmosis/cosmwasmpool/v1beta1/gov' import { isCosmWasmStargateMsg } from './cw' -// Convert CosmWasm message to its encoded protobuf equivalent. -export const cwMsgToProtobuf = ( - ...params: Parameters -): Any => { - const { typeUrl, value } = cwMsgToEncodeObject(...params) - return { - typeUrl, - value: encodeProtobufValue(typeUrl, value), - } -} - -// Convert protobuf to its CosmWasm message equivalent. -export const protobufToCwMsg = ( - ...params: Parameters -): { - msg: CosmosMsgFor_Empty - sender: string -} => decodedStargateMsgToCw(decodeRawProtobufMsg(...params)) - -export const cwMsgToEncodeObject = ( - msg: CosmosMsgFor_Empty, - sender: string -): EncodeObject => { - if ('bank' in msg) { - const bankMsg = msg.bank - - if ('send' in bankMsg) { - const encodeObject: EncodeObject = { - typeUrl: MsgSend.typeUrl, - value: { - fromAddress: sender, - toAddress: bankMsg.send.to_address, - amount: bankMsg.send.amount, - }, - } - - return encodeObject - } - - // burn does not exist? - - throw new Error('Unsupported bank module message.') - } - - if ('staking' in msg) { - const stakingMsg = msg.staking - - if ('delegate' in stakingMsg) { - const encodeObject: EncodeObject = { - typeUrl: MsgDelegate.typeUrl, - value: { - delegatorAddress: sender, - validatorAddress: stakingMsg.delegate.validator, - amount: stakingMsg.delegate.amount, - }, - } - return encodeObject - } - - if ('undelegate' in stakingMsg) { - const encodeObject: EncodeObject = { - typeUrl: MsgUndelegate.typeUrl, - value: { - delegatorAddress: sender, - validatorAddress: stakingMsg.undelegate.validator, - amount: stakingMsg.undelegate.amount, - }, - } - return encodeObject - } - - if ('redelegate' in stakingMsg) { - const encodeObject: EncodeObject = { - typeUrl: MsgBeginRedelegate.typeUrl, - value: { - delegatorAddress: sender, - validatorSrcAddress: stakingMsg.redelegate.src_validator, - validatorDstAddress: stakingMsg.redelegate.dst_validator, - amount: stakingMsg.redelegate.amount, - }, - } - return encodeObject - } - - throw new Error('Unsupported staking module message.') - } - - if ('distribution' in msg) { - const distributionMsg = msg.distribution - - if ('withdraw_delegator_reward' in distributionMsg) { - const encodeObject: EncodeObject = { - typeUrl: MsgWithdrawDelegatorReward.typeUrl, - value: { - delegatorAddress: sender, - validatorAddress: distributionMsg.withdraw_delegator_reward.validator, - }, - } - return encodeObject - } - - if ('set_withdraw_address' in distributionMsg) { - const encodeObject: EncodeObject = { - typeUrl: MsgSetWithdrawAddress.typeUrl, - value: { - delegatorAddress: sender, - withdrawAddress: distributionMsg.set_withdraw_address.address, - }, - } - return encodeObject - } - - throw new Error('Unsupported distribution module message.') - } - - if ('stargate' in msg) { - return decodeStargateMessage(msg, false).stargate - } - - if ('wasm' in msg) { - const wasmMsg = msg.wasm - - // MsgStoreCodeEncodeObject missing from CosmosMsgFor_Empty. - - if ('execute' in wasmMsg) { - const encodeObject: EncodeObject = { - typeUrl: MsgExecuteContract.typeUrl, - value: { - sender, - contract: wasmMsg.execute.contract_addr, - funds: wasmMsg.execute.funds, - msg: fromBase64(wasmMsg.execute.msg), - }, - } - return encodeObject - } - - if ('instantiate' in wasmMsg) { - const encodeObject: EncodeObject = { - typeUrl: MsgInstantiateContract.typeUrl, - value: { - sender, - admin: wasmMsg.instantiate.admin ?? undefined, - codeId: BigInt(wasmMsg.instantiate.code_id), - label: wasmMsg.instantiate.label, - msg: fromBase64(wasmMsg.instantiate.msg), - funds: wasmMsg.instantiate.funds, - }, - } - return encodeObject - } - - if ('instantiate2' in wasmMsg) { - const encodeObject: EncodeObject = { - typeUrl: MsgInstantiateContract2.typeUrl, - value: { - sender, - admin: wasmMsg.instantiate2.admin ?? undefined, - codeId: BigInt(wasmMsg.instantiate2.code_id), - label: wasmMsg.instantiate2.label, - msg: fromBase64(wasmMsg.instantiate2.msg), - funds: wasmMsg.instantiate2.funds, - salt: fromBase64(wasmMsg.instantiate2.salt), - fixMsg: wasmMsg.instantiate2.fix_msg, - }, - } - return encodeObject - } - - if ('migrate' in wasmMsg) { - const encodeObject: EncodeObject = { - typeUrl: MsgMigrateContract.typeUrl, - value: { - sender, - contract: wasmMsg.migrate.contract_addr, - codeId: BigInt(wasmMsg.migrate.new_code_id), - msg: fromBase64(wasmMsg.migrate.msg), - }, - } - return encodeObject - } - - if ('update_admin' in wasmMsg) { - const encodeObject: EncodeObject = { - typeUrl: MsgUpdateAdmin.typeUrl, - value: { - sender, - newAdmin: wasmMsg.update_admin.admin, - contract: wasmMsg.update_admin.contract_addr, - }, - } - return encodeObject - } - - if ('clear_admin' in wasmMsg) { - const encodeObject: EncodeObject = { - typeUrl: MsgClearAdmin.typeUrl, - value: { - sender, - contract: wasmMsg.clear_admin.contract_addr, - }, - } - return encodeObject - } - - throw new Error('Unsupported wasm module message.') - } - - if ('gov' in msg) { - const govMsg = msg.gov - - // MsgDepositEncodeObject and MsgSubmitProposalEncodeObject missing from - // CosmosMsgFor_Empty. - - if ('vote' in govMsg) { - const encodeObject: EncodeObject = { - typeUrl: MsgVote.typeUrl, - value: { - proposalId: BigInt(govMsg.vote.proposal_id), - voter: sender, - option: cwVoteOptionToGovVoteOption(govMsg.vote.vote), - }, - } - return encodeObject - } - - throw new Error('Unsupported gov module message.') - } - - throw new Error('Unsupported cosmos message.') -} - -// This should mirror the encoder function above. Do not use this function to -// convert messages that were decoded with `recursive = true`, like in the -// `useDecodedCosmosMsg` hook in actions. That's because the default case with -// `makeStargateMessage` needs a non-recursively encoded message due to -// technicalities with nested protobufs. -export const decodedStargateMsgToCw = ({ - typeUrl, - value, -}: DecodedStargateMsg['stargate']): { - msg: CosmosMsgFor_Empty - sender: string -} => { - let msg: CosmosMsgFor_Empty - let sender = '' - switch (typeUrl) { - case MsgSend.typeUrl: - msg = { - bank: { - send: { - amount: value.amount, - to_address: value.toAddress, - }, - }, - } - sender = value.fromAddress - break - case MsgDelegate.typeUrl: - msg = { - staking: { - delegate: { - amount: value.amount, - validator: value.validatorAddress, - }, - }, - } - sender = value.delegatorAddress - break - case MsgUndelegate.typeUrl: - msg = { - staking: { - undelegate: { - amount: value.amount, - validator: value.validatorAddress, - }, - }, - } - sender = value.delegatorAddress - break - case MsgBeginRedelegate.typeUrl: - msg = { - staking: { - redelegate: { - amount: value.amount, - src_validator: value.validatorSrcAddress, - dst_validator: value.validatorDstAddress, - }, - }, - } - sender = value.delegatorAddress - break - case MsgWithdrawDelegatorReward.typeUrl: - msg = { - distribution: { - withdraw_delegator_reward: { - validator: value.validatorAddress, - }, - }, - } - sender = value.delegatorAddress - break - case MsgSetWithdrawAddress.typeUrl: - msg = { - distribution: { - set_withdraw_address: { - address: value.withdrawAddress, - }, - }, - } - sender = value.delegatorAddress - break - case MsgExecuteContract.typeUrl: - msg = { - wasm: { - execute: { - contract_addr: value.contract, - funds: value.funds, - msg: toBase64(value.msg), - }, - }, - } - sender = value.sender - break - case MsgInstantiateContract.typeUrl: - msg = { - wasm: { - instantiate: { - admin: value.admin, - code_id: Number(value.codeId), - label: value.label, - msg: toBase64(value.msg), - funds: value.funds, - }, - }, - } - sender = value.sender - break - case MsgInstantiateContract2.typeUrl: - msg = { - wasm: { - instantiate2: { - admin: value.admin, - code_id: Number(value.codeId), - label: value.label, - msg: toBase64(value.msg), - funds: value.funds, - fix_msg: value.fixMsg, - salt: toBase64(value.salt), - }, - }, - } - sender = value.sender - break - case MsgMigrateContract.typeUrl: - msg = { - wasm: { - migrate: { - contract_addr: value.contract, - new_code_id: Number(value.codeId), - msg: toBase64(value.msg), - }, - }, - } - sender = value.sender - break - case MsgUpdateAdmin.typeUrl: - msg = { - wasm: { - update_admin: { - admin: value.newAdmin, - contract_addr: value.contract, - }, - }, - } - sender = value.sender - break - case MsgClearAdmin.typeUrl: - msg = { - wasm: { - clear_admin: { - contract_addr: value.contract, - }, - }, - } - sender = value.sender - break - case MsgVote.typeUrl: - msg = { - gov: { - vote: { - proposal_id: Number(value.proposalId), - vote: govVoteOptionToCwVoteOption(value.option), - }, - }, - } - sender = value.voter - break - default: - msg = makeStargateMessage({ - stargate: { - typeUrl, - value, - }, - }) - break - } - - return { - msg, - sender, - } -} - -// Convert staking-related stargate msg to CosmWasm format. Returns undefined if -// not a staking-related message. -export const decodedStakingStargateMsgToCw = ({ - typeUrl, - value, -}: DecodedStargateMsg['stargate']): CosmosMsgFor_Empty | undefined => { - switch (typeUrl) { - case MsgDelegate.typeUrl: - return { - staking: { - delegate: { - amount: value.amount, - validator: value.validatorAddress, - }, - }, - } - case MsgUndelegate.typeUrl: - return { - staking: { - undelegate: { - amount: value.amount, - validator: value.validatorAddress, - }, - }, - } - case MsgBeginRedelegate.typeUrl: - return { - staking: { - redelegate: { - amount: value.amount, - src_validator: value.validatorSrcAddress, - dst_validator: value.validatorDstAddress, - }, - }, - } - case MsgWithdrawDelegatorReward.typeUrl: - return { - distribution: { - withdraw_delegator_reward: { - validator: value.validatorAddress, - }, - }, - } - case MsgSetWithdrawAddress.typeUrl: - return { - distribution: { - set_withdraw_address: { - address: value.withdrawAddress, - }, - }, - } - } -} - -export const PROTOBUF_TYPES: ReadonlyArray<[string, GeneratedType]> = [ - ...cosmosProtoRegistry, - ...cosmwasmProtoRegistry, - ['/google.protobuf.Timestamp', google.protobuf.Timestamp as GeneratedType], - ...junoProtoRegistry, - ...osmosisProtoRegistry, - ...ibcProtoRegistry, - ...stargazeProtoRegistry, - ...gaiaProtoRegistry, - ...neutronProtoRegistry, - ...regenProtoRegistry, - ...allianceProtoRegistry, - ...circleProtoRegistry, - // Not a query or TX so it isn't included in any of the registries. But we - // want to decode this because it appears in gov props. We need to find a - // better way to collect all generated types in a single registry... - [ParameterChangeProposal.typeUrl, ParameterChangeProposal as GeneratedType], - [ - UploadCosmWasmPoolCodeAndWhiteListProposal.typeUrl, - UploadCosmWasmPoolCodeAndWhiteListProposal as GeneratedType, - ], - // alliance.alliance - [ - MsgCreateAllianceProposal.typeUrl, - MsgCreateAllianceProposal as GeneratedType, - ], - [ - MsgUpdateAllianceProposal.typeUrl, - MsgUpdateAllianceProposal as GeneratedType, - ], - [ - MsgDeleteAllianceProposal.typeUrl, - MsgDeleteAllianceProposal as GeneratedType, - ], -] -export const typesRegistry = new Registry(PROTOBUF_TYPES) - -export const aminoTypes = new AminoTypes({ - ...cosmosAminoConverters, - ...cosmwasmAminoConverters, - ...junoAminoConverters, - ...osmosisAminoConverters, - ...ibcAminoConverters, - ...stargazeAminoConverters, - ...gaiaAminoConverters, - ...neutronAminoConverters, - ...regenAminoConverters, - ...allianceAminoConverters, - ...circleAminoConverters, -}) - -// Encodes a protobuf message value from its JSON representation into a byte -// array. -export const encodeProtobufValue = ( - typeUrl: string, - value: any -): Uint8Array => { - const type = typesRegistry.lookupType(typeUrl) - if (!type) { - throw new Error(`Type ${typeUrl} not found in registry.`) - } - const encodedValue = type.encode(value).finish() - return encodedValue -} - -// Decodes an encoded protobuf message's value from a Uint8Array or base64 -// string into its JSON representation. -export const decodeProtobufValue = ( - typeUrl: string, - encodedValue: string | Uint8Array, - // Recursively decode nested protobufs. This is useful for automatically - // decoding `Any` types where protobuf interfaces exist. - recursive = true -): any => { - const type = typesRegistry.lookupType(typeUrl) - if (!type) { - throw new Error(`Type ${typeUrl} not found in registry.`) - } - - const decodedValue = type.decode( - typeof encodedValue === 'string' ? fromBase64(encodedValue) : encodedValue, - undefined, - // The types in the registry take an extra parameter for recursive - // decoding even though the registry itself is unaware of this type. Thus, - // tell TypeScript to ignore it. - // @ts-ignore - recursive - ) - return decodedValue -} - -// Decodes a protobuf message from `Any` into its JSON representation. -export const decodeRawProtobufMsg = ( - { typeUrl, value }: Any, - recursive = true -): DecodedStargateMsg['stargate'] => ({ - typeUrl, - value: decodeProtobufValue(typeUrl, value, recursive), -}) - -// Convert protobuf Any into its Amino msg. -export const rawProtobufMsgToAmino = ( - ...params: Parameters -): AminoMsg => aminoTypes.toAmino(decodeRawProtobufMsg(...params)) - -// Convert Amino msg into raw protobuf Any. -export const aminoToRawProtobufMsg = (msg: AminoMsg): Any => { - const { typeUrl, value } = aminoTypes.fromAmino(msg) - return { - typeUrl, - value: encodeProtobufValue(typeUrl, value), - } -} - -// Encodes a protobuf message from its JSON representation into a `StargateMsg` -// that `CosmWasm` understands. -export const makeStargateMessage = ({ - stargate: { typeUrl, value }, -}: DecodedStargateMsg): StargateMsg => ({ - stargate: { - type_url: typeUrl, - value: toBase64(encodeProtobufValue(typeUrl, prepareProtobufJson(value))), - }, -}) - -// Decodes an encoded protobuf message from CosmWasm's `StargateMsg` into its -// JSON representation. -export const decodeStargateMessage = ( - { stargate: { type_url, value } }: StargateMsg, - recursive = true -): DecodedStargateMsg => ({ - stargate: { - typeUrl: type_url, - value: decodeProtobufValue(type_url, value, recursive), - }, -}) - // Decode governance proposal v1 messages using a protobuf. export const decodeGovProposalV1Messages = ( messages: GovProposalV1['proposal']['messages'] @@ -838,26 +176,3 @@ export const decodeRawDataForDisplay = (msg: any): any => }), {} as Record ) - -// Prepare JSON for protobuf encoding. Some fields, like Dates, need special -// handling so that any protobuf type can be encoded. -// -// Rules: -// (1) Strings with the 'DATE:' prefix are converted to Dates. -export const prepareProtobufJson = (msg: any): any => - msg instanceof Uint8Array - ? msg - : Array.isArray(msg) - ? msg.map(prepareProtobufJson) - : // Rule (1) - typeof msg === 'string' && msg.startsWith('DATE:') - ? new Date(msg.replace('DATE:', '')) - : typeof msg !== 'object' || msg === null || msg.constructor !== Object - ? msg - : Object.entries(msg).reduce( - (acc, [key, value]) => ({ - ...acc, - [key]: prepareProtobufJson(value), - }), - {} as Record - ) diff --git a/packages/utils/package.json b/packages/utils/package.json index afd0d5413..ec4012005 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -5,11 +5,7 @@ "scripts": { "format": "eslint . --fix", "lint": "eslint .", - "test": "jest", - "protobuf:codegen": "node protobuf/scripts/codegen.js", - "protobuf:patch": "git apply protobuf/patches.diff", - "protobuf:patch:update": "cd protobuf && npm run protobuf:codegen && git diff -R codegen/ > patches.diff && npm run protobuf:patch", - "protobuf": "npm run protobuf:codegen && npm run protobuf:patch" + "test": "jest" }, "dependencies": { "@cosmjs/amino": "^0.32.1", @@ -40,7 +36,6 @@ "devDependencies": { "@chain-registry/types": "^0.17.1", "@cosmjs/proto-signing": "^0.32.1", - "@cosmology/telescope": "^1.4.12", "@dao-dao/config": "2.4.0-rc.7", "cosmjs-types": "^0.9.0", "jest": "^29.1.1", diff --git a/packages/utils/pagination.ts b/packages/utils/pagination.ts index a8c85eaa3..61658e65e 100644 --- a/packages/utils/pagination.ts +++ b/packages/utils/pagination.ts @@ -1,7 +1,7 @@ import { PageRequest, PageResponse, -} from './protobuf/codegen/cosmos/base/query/v1beta1/pagination' +} from '@dao-dao/types/protobuf/codegen/cosmos/base/query/v1beta1/pagination' export const getAllRpcResponse = async < P extends { pagination?: PageRequest; [key: string]: any }, diff --git a/packages/utils/protobuf/codegen/cosmos/authz/v1beta1/tx.ts b/packages/utils/protobuf/codegen/cosmos/authz/v1beta1/tx.ts deleted file mode 100644 index 98853e53d..000000000 --- a/packages/utils/protobuf/codegen/cosmos/authz/v1beta1/tx.ts +++ /dev/null @@ -1,643 +0,0 @@ -//@ts-nocheck -import { Grant, GrantAmino, GrantSDKType } from "./authz"; -import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { BinaryReader, BinaryWriter } from "../../../binary"; -import { bytesFromBase64, base64FromBytes } from "../../../helpers"; -import { aminoToRawProtobufMsg, rawProtobufMsgToAmino } from '../../../../../messages/protobuf' -/** - * MsgGrant is a request type for Grant method. It declares authorization to the grantee - * on behalf of the granter with the provided expiration time. - */ -export interface MsgGrant { - granter: string; - grantee: string; - grant: Grant | undefined; -} -export interface MsgGrantProtoMsg { - typeUrl: "/cosmos.authz.v1beta1.MsgGrant"; - value: Uint8Array; -} -/** - * MsgGrant is a request type for Grant method. It declares authorization to the grantee - * on behalf of the granter with the provided expiration time. - */ -export interface MsgGrantAmino { - granter?: string; - grantee?: string; - grant: GrantAmino | undefined; -} -export interface MsgGrantAminoMsg { - type: "cosmos-sdk/MsgGrant"; - value: MsgGrantAmino; -} -/** - * MsgGrant is a request type for Grant method. It declares authorization to the grantee - * on behalf of the granter with the provided expiration time. - */ -export interface MsgGrantSDKType { - granter: string; - grantee: string; - grant: GrantSDKType | undefined; -} -/** MsgGrantResponse defines the Msg/MsgGrant response type. */ -export interface MsgGrantResponse {} -export interface MsgGrantResponseProtoMsg { - typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse"; - value: Uint8Array; -} -/** MsgGrantResponse defines the Msg/MsgGrant response type. */ -export interface MsgGrantResponseAmino {} -export interface MsgGrantResponseAminoMsg { - type: "cosmos-sdk/MsgGrantResponse"; - value: MsgGrantResponseAmino; -} -/** MsgGrantResponse defines the Msg/MsgGrant response type. */ -export interface MsgGrantResponseSDKType {} -/** - * MsgExec attempts to execute the provided messages using - * authorizations granted to the grantee. Each message should have only - * one signer corresponding to the granter of the authorization. - */ -export interface MsgExec { - grantee: string; - /** - * Execute Msg. - * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) - * triple and validate it. - */ - msgs: (Any)[] | Any[]; -} -export interface MsgExecProtoMsg { - typeUrl: "/cosmos.authz.v1beta1.MsgExec"; - value: Uint8Array; -} -export type MsgExecEncoded = Omit & { - /** - * Execute Msg. - * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) - * triple and validate it. - */ - msgs: (AnyProtoMsg)[]; -}; -/** - * MsgExec attempts to execute the provided messages using - * authorizations granted to the grantee. Each message should have only - * one signer corresponding to the granter of the authorization. - */ -export interface MsgExecAmino { - grantee?: string; - /** - * Execute Msg. - * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) - * triple and validate it. - */ - msgs?: AnyAmino[]; -} -export interface MsgExecAminoMsg { - type: "cosmos-sdk/MsgExec"; - value: MsgExecAmino; -} -/** - * MsgExec attempts to execute the provided messages using - * authorizations granted to the grantee. Each message should have only - * one signer corresponding to the granter of the authorization. - */ -export interface MsgExecSDKType { - grantee: string; - msgs: (AnySDKType)[]; -} -/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ -export interface MsgExecResponse { - results: Uint8Array[]; -} -export interface MsgExecResponseProtoMsg { - typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse"; - value: Uint8Array; -} -/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ -export interface MsgExecResponseAmino { - results?: string[]; -} -export interface MsgExecResponseAminoMsg { - type: "cosmos-sdk/MsgExecResponse"; - value: MsgExecResponseAmino; -} -/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ -export interface MsgExecResponseSDKType { - results: Uint8Array[]; -} -/** - * MsgRevoke revokes any authorization with the provided sdk.Msg type on the - * granter's account with that has been granted to the grantee. - */ -export interface MsgRevoke { - granter: string; - grantee: string; - msgTypeUrl: string; -} -export interface MsgRevokeProtoMsg { - typeUrl: "/cosmos.authz.v1beta1.MsgRevoke"; - value: Uint8Array; -} -/** - * MsgRevoke revokes any authorization with the provided sdk.Msg type on the - * granter's account with that has been granted to the grantee. - */ -export interface MsgRevokeAmino { - granter?: string; - grantee?: string; - msg_type_url?: string; -} -export interface MsgRevokeAminoMsg { - type: "cosmos-sdk/MsgRevoke"; - value: MsgRevokeAmino; -} -/** - * MsgRevoke revokes any authorization with the provided sdk.Msg type on the - * granter's account with that has been granted to the grantee. - */ -export interface MsgRevokeSDKType { - granter: string; - grantee: string; - msg_type_url: string; -} -/** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ -export interface MsgRevokeResponse {} -export interface MsgRevokeResponseProtoMsg { - typeUrl: "/cosmos.authz.v1beta1.MsgRevokeResponse"; - value: Uint8Array; -} -/** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ -export interface MsgRevokeResponseAmino {} -export interface MsgRevokeResponseAminoMsg { - type: "cosmos-sdk/MsgRevokeResponse"; - value: MsgRevokeResponseAmino; -} -/** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ -export interface MsgRevokeResponseSDKType {} -function createBaseMsgGrant(): MsgGrant { - return { - granter: "", - grantee: "", - grant: Grant.fromPartial({}) - }; -} -export const MsgGrant = { - typeUrl: "/cosmos.authz.v1beta1.MsgGrant", - encode(message: MsgGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.granter !== "") { - writer.uint32(10).string(message.granter); - } - if (message.grantee !== "") { - writer.uint32(18).string(message.grantee); - } - if (message.grant !== undefined) { - Grant.encode(message.grant, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgGrant { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgGrant(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.granter = reader.string(); - break; - case 2: - message.grantee = reader.string(); - break; - case 3: - message.grant = Grant.decode(reader, reader.uint32(), useInterfaces); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): MsgGrant { - const message = createBaseMsgGrant(); - message.granter = object.granter ?? ""; - message.grantee = object.grantee ?? ""; - message.grant = object.grant !== undefined && object.grant !== null ? Grant.fromPartial(object.grant) : undefined; - return message; - }, - fromAmino(object: MsgGrantAmino): MsgGrant { - const message = createBaseMsgGrant(); - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } - if (object.grant !== undefined && object.grant !== null) { - message.grant = Grant.fromAmino(object.grant); - } - return message; - }, - toAmino(message: MsgGrant, useInterfaces: boolean = false): MsgGrantAmino { - const obj: any = {}; - obj.granter = message.granter; - obj.grantee = message.grantee; - obj.grant = message.grant ? Grant.toAmino(message.grant, useInterfaces) : Grant.fromPartial({}); - return obj; - }, - fromAminoMsg(object: MsgGrantAminoMsg): MsgGrant { - return MsgGrant.fromAmino(object.value); - }, - toAminoMsg(message: MsgGrant, useInterfaces: boolean = false): MsgGrantAminoMsg { - return { - type: "cosmos-sdk/MsgGrant", - value: MsgGrant.toAmino(message, useInterfaces) - }; - }, - fromProtoMsg(message: MsgGrantProtoMsg, useInterfaces: boolean = false): MsgGrant { - return MsgGrant.decode(message.value, undefined, useInterfaces); - }, - toProto(message: MsgGrant): Uint8Array { - return MsgGrant.encode(message).finish(); - }, - toProtoMsg(message: MsgGrant): MsgGrantProtoMsg { - return { - typeUrl: "/cosmos.authz.v1beta1.MsgGrant", - value: MsgGrant.encode(message).finish() - }; - } -}; -function createBaseMsgGrantResponse(): MsgGrantResponse { - return {}; -} -export const MsgGrantResponse = { - typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse", - encode(_: MsgGrantResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgGrantResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgGrantResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(_: Partial): MsgGrantResponse { - const message = createBaseMsgGrantResponse(); - return message; - }, - fromAmino(_: MsgGrantResponseAmino): MsgGrantResponse { - const message = createBaseMsgGrantResponse(); - return message; - }, - toAmino(_: MsgGrantResponse, useInterfaces: boolean = false): MsgGrantResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgGrantResponseAminoMsg): MsgGrantResponse { - return MsgGrantResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgGrantResponse, useInterfaces: boolean = false): MsgGrantResponseAminoMsg { - return { - type: "cosmos-sdk/MsgGrantResponse", - value: MsgGrantResponse.toAmino(message, useInterfaces) - }; - }, - fromProtoMsg(message: MsgGrantResponseProtoMsg, useInterfaces: boolean = false): MsgGrantResponse { - return MsgGrantResponse.decode(message.value, undefined, useInterfaces); - }, - toProto(message: MsgGrantResponse): Uint8Array { - return MsgGrantResponse.encode(message).finish(); - }, - toProtoMsg(message: MsgGrantResponse): MsgGrantResponseProtoMsg { - return { - typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse", - value: MsgGrantResponse.encode(message).finish() - }; - } -}; -function createBaseMsgExec(): MsgExec { - return { - grantee: "", - msgs: [] - }; -} -export const MsgExec = { - typeUrl: "/cosmos.authz.v1beta1.MsgExec", - encode(message: MsgExec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.grantee !== "") { - writer.uint32(10).string(message.grantee); - } - for (const v of message.msgs) { - Any.encode((v! as Any), writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgExec { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgExec(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.grantee = reader.string(); - break; - case 2: - message.msgs.push(useInterfaces ? (Cosmos_basev1beta1Msg_InterfaceDecoder(reader) as Any) : Any.decode(reader, reader.uint32(), useInterfaces)); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): MsgExec { - const message = createBaseMsgExec(); - message.grantee = object.grantee ?? ""; - message.msgs = object.msgs?.map(e => Any.fromPartial(e)) || []; - return message; - }, - fromAmino(object: MsgExecAmino): MsgExec { - const message = createBaseMsgExec(); - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } - message.msgs = object.msgs?.map(e => aminoToRawProtobufMsg(e)) || []; - return message; - }, - toAmino(message: MsgExec, useInterfaces: boolean = false): MsgExecAmino { - const obj: any = {}; - obj.grantee = message.grantee; - if (message.msgs) { - obj.msgs = message.msgs.map(e => e ? rawProtobufMsgToAmino((e as Any), useInterfaces) : undefined); - } else { - obj.msgs = []; - } - return obj; - }, - fromAminoMsg(object: MsgExecAminoMsg): MsgExec { - return MsgExec.fromAmino(object.value); - }, - toAminoMsg(message: MsgExec, useInterfaces: boolean = false): MsgExecAminoMsg { - return { - type: "cosmos-sdk/MsgExec", - value: MsgExec.toAmino(message, useInterfaces) - }; - }, - fromProtoMsg(message: MsgExecProtoMsg, useInterfaces: boolean = false): MsgExec { - return MsgExec.decode(message.value, undefined, useInterfaces); - }, - toProto(message: MsgExec): Uint8Array { - return MsgExec.encode(message).finish(); - }, - toProtoMsg(message: MsgExec): MsgExecProtoMsg { - return { - typeUrl: "/cosmos.authz.v1beta1.MsgExec", - value: MsgExec.encode(message).finish() - }; - } -}; -function createBaseMsgExecResponse(): MsgExecResponse { - return { - results: [] - }; -} -export const MsgExecResponse = { - typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse", - encode(message: MsgExecResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.results) { - writer.uint32(10).bytes(v!); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgExecResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgExecResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.results.push(reader.bytes()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): MsgExecResponse { - const message = createBaseMsgExecResponse(); - message.results = object.results?.map(e => e) || []; - return message; - }, - fromAmino(object: MsgExecResponseAmino): MsgExecResponse { - const message = createBaseMsgExecResponse(); - message.results = object.results?.map(e => bytesFromBase64(e)) || []; - return message; - }, - toAmino(message: MsgExecResponse, useInterfaces: boolean = false): MsgExecResponseAmino { - const obj: any = {}; - if (message.results) { - obj.results = message.results.map(e => base64FromBytes(e)); - } else { - obj.results = []; - } - return obj; - }, - fromAminoMsg(object: MsgExecResponseAminoMsg): MsgExecResponse { - return MsgExecResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgExecResponse, useInterfaces: boolean = false): MsgExecResponseAminoMsg { - return { - type: "cosmos-sdk/MsgExecResponse", - value: MsgExecResponse.toAmino(message, useInterfaces) - }; - }, - fromProtoMsg(message: MsgExecResponseProtoMsg, useInterfaces: boolean = false): MsgExecResponse { - return MsgExecResponse.decode(message.value, undefined, useInterfaces); - }, - toProto(message: MsgExecResponse): Uint8Array { - return MsgExecResponse.encode(message).finish(); - }, - toProtoMsg(message: MsgExecResponse): MsgExecResponseProtoMsg { - return { - typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse", - value: MsgExecResponse.encode(message).finish() - }; - } -}; -function createBaseMsgRevoke(): MsgRevoke { - return { - granter: "", - grantee: "", - msgTypeUrl: "" - }; -} -export const MsgRevoke = { - typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", - encode(message: MsgRevoke, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.granter !== "") { - writer.uint32(10).string(message.granter); - } - if (message.grantee !== "") { - writer.uint32(18).string(message.grantee); - } - if (message.msgTypeUrl !== "") { - writer.uint32(26).string(message.msgTypeUrl); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRevoke { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgRevoke(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.granter = reader.string(); - break; - case 2: - message.grantee = reader.string(); - break; - case 3: - message.msgTypeUrl = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): MsgRevoke { - const message = createBaseMsgRevoke(); - message.granter = object.granter ?? ""; - message.grantee = object.grantee ?? ""; - message.msgTypeUrl = object.msgTypeUrl ?? ""; - return message; - }, - fromAmino(object: MsgRevokeAmino): MsgRevoke { - const message = createBaseMsgRevoke(); - if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter; - } - if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee; - } - if (object.msg_type_url !== undefined && object.msg_type_url !== null) { - message.msgTypeUrl = object.msg_type_url; - } - return message; - }, - toAmino(message: MsgRevoke, useInterfaces: boolean = false): MsgRevokeAmino { - const obj: any = {}; - obj.granter = message.granter; - obj.grantee = message.grantee; - obj.msg_type_url = message.msgTypeUrl; - return obj; - }, - fromAminoMsg(object: MsgRevokeAminoMsg): MsgRevoke { - return MsgRevoke.fromAmino(object.value); - }, - toAminoMsg(message: MsgRevoke, useInterfaces: boolean = false): MsgRevokeAminoMsg { - return { - type: "cosmos-sdk/MsgRevoke", - value: MsgRevoke.toAmino(message, useInterfaces) - }; - }, - fromProtoMsg(message: MsgRevokeProtoMsg, useInterfaces: boolean = false): MsgRevoke { - return MsgRevoke.decode(message.value, undefined, useInterfaces); - }, - toProto(message: MsgRevoke): Uint8Array { - return MsgRevoke.encode(message).finish(); - }, - toProtoMsg(message: MsgRevoke): MsgRevokeProtoMsg { - return { - typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", - value: MsgRevoke.encode(message).finish() - }; - } -}; -function createBaseMsgRevokeResponse(): MsgRevokeResponse { - return {}; -} -export const MsgRevokeResponse = { - typeUrl: "/cosmos.authz.v1beta1.MsgRevokeResponse", - encode(_: MsgRevokeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRevokeResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgRevokeResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(_: Partial): MsgRevokeResponse { - const message = createBaseMsgRevokeResponse(); - return message; - }, - fromAmino(_: MsgRevokeResponseAmino): MsgRevokeResponse { - const message = createBaseMsgRevokeResponse(); - return message; - }, - toAmino(_: MsgRevokeResponse, useInterfaces: boolean = false): MsgRevokeResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgRevokeResponseAminoMsg): MsgRevokeResponse { - return MsgRevokeResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgRevokeResponse, useInterfaces: boolean = false): MsgRevokeResponseAminoMsg { - return { - type: "cosmos-sdk/MsgRevokeResponse", - value: MsgRevokeResponse.toAmino(message, useInterfaces) - }; - }, - fromProtoMsg(message: MsgRevokeResponseProtoMsg, useInterfaces: boolean = false): MsgRevokeResponse { - return MsgRevokeResponse.decode(message.value, undefined, useInterfaces); - }, - toProto(message: MsgRevokeResponse): Uint8Array { - return MsgRevokeResponse.encode(message).finish(); - }, - toProtoMsg(message: MsgRevokeResponse): MsgRevokeResponseProtoMsg { - return { - typeUrl: "/cosmos.authz.v1beta1.MsgRevokeResponse", - value: MsgRevokeResponse.encode(message).finish() - }; - } -}; -export const Cosmos_basev1beta1Msg_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32(), true); - switch (data.typeUrl) { - default: - return data; - } -}; -export const Cosmos_basev1beta1Msg_FromAmino = (content: AnyAmino) => { - return Any.fromAmino(content); -}; -export const Cosmos_basev1beta1Msg_ToAmino = (content: Any, useInterfaces: boolean = false) => { - return Any.toAmino(content, useInterfaces); -}; \ No newline at end of file diff --git a/packages/utils/protobuf/codegen/cosmos/gov/v1/tx.ts b/packages/utils/protobuf/codegen/cosmos/gov/v1/tx.ts deleted file mode 100644 index 99099f81a..000000000 --- a/packages/utils/protobuf/codegen/cosmos/gov/v1/tx.ts +++ /dev/null @@ -1,2180 +0,0 @@ -//@ts-nocheck -import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import { VoteOption, WeightedVoteOption, WeightedVoteOptionAmino, WeightedVoteOptionSDKType, Params, ParamsAmino, ParamsSDKType } from "./gov"; -import { Timestamp } from "../../../google/protobuf/timestamp"; -import { MsgCreateAllianceProposal, MsgCreateAllianceProposalProtoMsg, MsgCreateAllianceProposalSDKType, MsgUpdateAllianceProposal, MsgUpdateAllianceProposalProtoMsg, MsgUpdateAllianceProposalSDKType, MsgDeleteAllianceProposal, MsgDeleteAllianceProposalProtoMsg, MsgDeleteAllianceProposalSDKType } from "../../../alliance/alliance/gov"; -import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalSDKType, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg, CommunityPoolSpendProposalWithDepositSDKType } from "../../distribution/v1beta1/distribution"; -import { TextProposal, TextProposalProtoMsg, TextProposalSDKType } from "../v1beta1/gov"; -import { ParameterChangeProposal, ParameterChangeProposalProtoMsg, ParameterChangeProposalSDKType } from "../../params/v1beta1/params"; -import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, SoftwareUpgradeProposalSDKType, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposalSDKType } from "../../upgrade/v1beta1/upgrade"; -import { StoreCodeProposal, StoreCodeProposalProtoMsg, StoreCodeProposalSDKType, InstantiateContractProposal, InstantiateContractProposalProtoMsg, InstantiateContractProposalSDKType, InstantiateContract2Proposal, InstantiateContract2ProposalProtoMsg, InstantiateContract2ProposalSDKType, MigrateContractProposal, MigrateContractProposalProtoMsg, MigrateContractProposalSDKType, SudoContractProposal, SudoContractProposalProtoMsg, SudoContractProposalSDKType, ExecuteContractProposal, ExecuteContractProposalProtoMsg, ExecuteContractProposalSDKType, UpdateAdminProposal, UpdateAdminProposalProtoMsg, UpdateAdminProposalSDKType, ClearAdminProposal, ClearAdminProposalProtoMsg, ClearAdminProposalSDKType, PinCodesProposal, PinCodesProposalProtoMsg, PinCodesProposalSDKType, UnpinCodesProposal, UnpinCodesProposalProtoMsg, UnpinCodesProposalSDKType, UpdateInstantiateConfigProposal, UpdateInstantiateConfigProposalProtoMsg, UpdateInstantiateConfigProposalSDKType, StoreAndInstantiateContractProposal, StoreAndInstantiateContractProposalProtoMsg, StoreAndInstantiateContractProposalSDKType } from "../../../cosmwasm/wasm/v1/proposal"; -import { ClientUpdateProposal, ClientUpdateProposalProtoMsg, ClientUpdateProposalSDKType, UpgradeProposal, UpgradeProposalProtoMsg, UpgradeProposalSDKType } from "../../../ibc/core/client/v1/client"; -import { ReplaceMigrationRecordsProposal, ReplaceMigrationRecordsProposalProtoMsg, ReplaceMigrationRecordsProposalSDKType, UpdateMigrationRecordsProposal, UpdateMigrationRecordsProposalProtoMsg, UpdateMigrationRecordsProposalSDKType, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType, SetScalingFactorControllerProposal, SetScalingFactorControllerProposalProtoMsg, SetScalingFactorControllerProposalSDKType } from "../../../osmosis/gamm/v1beta1/gov"; -import { CreateGroupsProposal, CreateGroupsProposalProtoMsg, CreateGroupsProposalSDKType } from "../../../osmosis/incentives/gov"; -import { ReplacePoolIncentivesProposal, ReplacePoolIncentivesProposalProtoMsg, ReplacePoolIncentivesProposalSDKType, UpdatePoolIncentivesProposal, UpdatePoolIncentivesProposalProtoMsg, UpdatePoolIncentivesProposalSDKType } from "../../../osmosis/pool-incentives/v1beta1/gov"; -import { SetProtoRevEnabledProposal, SetProtoRevEnabledProposalProtoMsg, SetProtoRevEnabledProposalSDKType, SetProtoRevAdminAccountProposal, SetProtoRevAdminAccountProposalProtoMsg, SetProtoRevAdminAccountProposalSDKType } from "../../../osmosis/protorev/v1beta1/gov"; -import { SetSuperfluidAssetsProposal, SetSuperfluidAssetsProposalProtoMsg, SetSuperfluidAssetsProposalSDKType, RemoveSuperfluidAssetsProposal, RemoveSuperfluidAssetsProposalProtoMsg, RemoveSuperfluidAssetsProposalSDKType, UpdateUnpoolWhiteListProposal, UpdateUnpoolWhiteListProposalProtoMsg, UpdateUnpoolWhiteListProposalSDKType } from "../../../osmosis/superfluid/v1beta1/gov"; -import { UpdateFeeTokenProposal, UpdateFeeTokenProposalProtoMsg, UpdateFeeTokenProposalSDKType } from "../../../osmosis/txfees/v1beta1/gov"; -import { PromoteToPrivilegedContractProposal, PromoteToPrivilegedContractProposalProtoMsg, PromoteToPrivilegedContractProposalSDKType, DemotePrivilegedContractProposal, DemotePrivilegedContractProposalProtoMsg, DemotePrivilegedContractProposalSDKType } from "../../../publicawesome/stargaze/cron/v1/proposal"; -import { SetCodeAuthorizationProposal, SetCodeAuthorizationProposalProtoMsg, SetCodeAuthorizationProposalSDKType, RemoveCodeAuthorizationProposal, RemoveCodeAuthorizationProposalProtoMsg, RemoveCodeAuthorizationProposalSDKType, SetContractAuthorizationProposal, SetContractAuthorizationProposalProtoMsg, SetContractAuthorizationProposalSDKType, RemoveContractAuthorizationProposal, RemoveContractAuthorizationProposalProtoMsg, RemoveContractAuthorizationProposalSDKType } from "../../../publicawesome/stargaze/globalfee/v1/proposal"; -import { AllowDenomProposal, AllowDenomProposalProtoMsg, AllowDenomProposalSDKType } from "../../../regen/ecocredit/marketplace/v1/types"; -import { CreditTypeProposal, CreditTypeProposalProtoMsg, CreditTypeProposalSDKType } from "../../../regen/ecocredit/v1/types"; -import { BinaryReader, BinaryWriter } from "../../../binary"; -import { toTimestamp, fromTimestamp } from "../../../helpers"; -import { aminoToRawProtobufMsg, rawProtobufMsgToAmino } from "../../../../../messages"; -/** - * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary - * proposal Content. - */ -export interface MsgSubmitProposal { - /** messages are the arbitrary messages to be executed if proposal passes. */ - messages: Any[]; - /** initial_deposit is the deposit value that must be paid at proposal submission. */ - initialDeposit: Coin[]; - /** proposer is the account address of the proposer. */ - proposer: string; - /** metadata is any arbitrary metadata attached to the proposal. */ - metadata: string; - /** - * title is the title of the proposal. - * - * Since: cosmos-sdk 0.47 - */ - title: string; - /** - * summary is the summary of the proposal - * - * Since: cosmos-sdk 0.47 - */ - summary: string; - /** - * expedited defines if the proposal is expedited or not - * - * Since: cosmos-sdk 0.50 - */ - expedited: boolean; -} -export interface MsgSubmitProposalProtoMsg { - typeUrl: "/cosmos.gov.v1.MsgSubmitProposal"; - value: Uint8Array; -} -/** - * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary - * proposal Content. - */ -export interface MsgSubmitProposalAmino { - /** messages are the arbitrary messages to be executed if proposal passes. */ - messages?: AnyAmino[]; - /** initial_deposit is the deposit value that must be paid at proposal submission. */ - initial_deposit: CoinAmino[]; - /** proposer is the account address of the proposer. */ - proposer?: string; - /** metadata is any arbitrary metadata attached to the proposal. */ - metadata?: string; - /** - * title is the title of the proposal. - * - * Since: cosmos-sdk 0.47 - */ - title?: string; - /** - * summary is the summary of the proposal - * - * Since: cosmos-sdk 0.47 - */ - summary?: string; - /** - * expedited defines if the proposal is expedited or not - * - * Since: cosmos-sdk 0.50 - */ - expedited?: boolean; -} -export interface MsgSubmitProposalAminoMsg { - type: "cosmos-sdk/v1/MsgSubmitProposal"; - value: MsgSubmitProposalAmino; -} -/** - * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary - * proposal Content. - */ -export interface MsgSubmitProposalSDKType { - messages: AnySDKType[]; - initial_deposit: CoinSDKType[]; - proposer: string; - metadata: string; - title: string; - summary: string; - expedited: boolean; -} -/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ -export interface MsgSubmitProposalResponse { - /** proposal_id defines the unique id of the proposal. */ - proposalId: bigint; -} -export interface MsgSubmitProposalResponseProtoMsg { - typeUrl: "/cosmos.gov.v1.MsgSubmitProposalResponse"; - value: Uint8Array; -} -/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ -export interface MsgSubmitProposalResponseAmino { - /** proposal_id defines the unique id of the proposal. */ - proposal_id?: string; -} -export interface MsgSubmitProposalResponseAminoMsg { - type: "cosmos-sdk/v1/MsgSubmitProposalResponse"; - value: MsgSubmitProposalResponseAmino; -} -/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ -export interface MsgSubmitProposalResponseSDKType { - proposal_id: bigint; -} -/** - * MsgExecLegacyContent is used to wrap the legacy content field into a message. - * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. - */ -export interface MsgExecLegacyContent { - /** content is the proposal's content. */ - content?: (MsgCreateAllianceProposal & MsgUpdateAllianceProposal & MsgDeleteAllianceProposal & CommunityPoolSpendProposal & CommunityPoolSpendProposalWithDeposit & TextProposal & ParameterChangeProposal & SoftwareUpgradeProposal & CancelSoftwareUpgradeProposal & StoreCodeProposal & InstantiateContractProposal & InstantiateContract2Proposal & MigrateContractProposal & SudoContractProposal & ExecuteContractProposal & UpdateAdminProposal & ClearAdminProposal & PinCodesProposal & UnpinCodesProposal & UpdateInstantiateConfigProposal & StoreAndInstantiateContractProposal & ClientUpdateProposal & UpgradeProposal & ReplaceMigrationRecordsProposal & UpdateMigrationRecordsProposal & CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal & SetScalingFactorControllerProposal & CreateGroupsProposal & ReplacePoolIncentivesProposal & UpdatePoolIncentivesProposal & SetProtoRevEnabledProposal & SetProtoRevAdminAccountProposal & SetSuperfluidAssetsProposal & RemoveSuperfluidAssetsProposal & UpdateUnpoolWhiteListProposal & UpdateFeeTokenProposal & PromoteToPrivilegedContractProposal & DemotePrivilegedContractProposal & SetCodeAuthorizationProposal & RemoveCodeAuthorizationProposal & SetContractAuthorizationProposal & RemoveContractAuthorizationProposal & AllowDenomProposal & CreditTypeProposal & Any) | undefined; - /** authority must be the gov module address. */ - authority: string; -} -export interface MsgExecLegacyContentProtoMsg { - typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent"; - value: Uint8Array; -} -export type MsgExecLegacyContentEncoded = Omit & { - /** content is the proposal's content. */content?: MsgCreateAllianceProposalProtoMsg | MsgUpdateAllianceProposalProtoMsg | MsgDeleteAllianceProposalProtoMsg | CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | ParameterChangeProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | ClientUpdateProposalProtoMsg | UpgradeProposalProtoMsg | ReplaceMigrationRecordsProposalProtoMsg | UpdateMigrationRecordsProposalProtoMsg | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg | SetScalingFactorControllerProposalProtoMsg | CreateGroupsProposalProtoMsg | ReplacePoolIncentivesProposalProtoMsg | UpdatePoolIncentivesProposalProtoMsg | SetProtoRevEnabledProposalProtoMsg | SetProtoRevAdminAccountProposalProtoMsg | SetSuperfluidAssetsProposalProtoMsg | RemoveSuperfluidAssetsProposalProtoMsg | UpdateUnpoolWhiteListProposalProtoMsg | UpdateFeeTokenProposalProtoMsg | PromoteToPrivilegedContractProposalProtoMsg | DemotePrivilegedContractProposalProtoMsg | SetCodeAuthorizationProposalProtoMsg | RemoveCodeAuthorizationProposalProtoMsg | SetContractAuthorizationProposalProtoMsg | RemoveContractAuthorizationProposalProtoMsg | AllowDenomProposalProtoMsg | CreditTypeProposalProtoMsg | AnyProtoMsg | undefined; -}; -/** - * MsgExecLegacyContent is used to wrap the legacy content field into a message. - * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. - */ -export interface MsgExecLegacyContentAmino { - /** content is the proposal's content. */ - content?: AnyAmino | undefined; - /** authority must be the gov module address. */ - authority?: string; -} -export interface MsgExecLegacyContentAminoMsg { - type: "cosmos-sdk/v1/MsgExecLegacyContent"; - value: MsgExecLegacyContentAmino; -} -/** - * MsgExecLegacyContent is used to wrap the legacy content field into a message. - * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. - */ -export interface MsgExecLegacyContentSDKType { - content?: MsgCreateAllianceProposalSDKType | MsgUpdateAllianceProposalSDKType | MsgDeleteAllianceProposalSDKType | CommunityPoolSpendProposalSDKType | CommunityPoolSpendProposalWithDepositSDKType | TextProposalSDKType | ParameterChangeProposalSDKType | SoftwareUpgradeProposalSDKType | CancelSoftwareUpgradeProposalSDKType | StoreCodeProposalSDKType | InstantiateContractProposalSDKType | InstantiateContract2ProposalSDKType | MigrateContractProposalSDKType | SudoContractProposalSDKType | ExecuteContractProposalSDKType | UpdateAdminProposalSDKType | ClearAdminProposalSDKType | PinCodesProposalSDKType | UnpinCodesProposalSDKType | UpdateInstantiateConfigProposalSDKType | StoreAndInstantiateContractProposalSDKType | ClientUpdateProposalSDKType | UpgradeProposalSDKType | ReplaceMigrationRecordsProposalSDKType | UpdateMigrationRecordsProposalSDKType | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType | SetScalingFactorControllerProposalSDKType | CreateGroupsProposalSDKType | ReplacePoolIncentivesProposalSDKType | UpdatePoolIncentivesProposalSDKType | SetProtoRevEnabledProposalSDKType | SetProtoRevAdminAccountProposalSDKType | SetSuperfluidAssetsProposalSDKType | RemoveSuperfluidAssetsProposalSDKType | UpdateUnpoolWhiteListProposalSDKType | UpdateFeeTokenProposalSDKType | PromoteToPrivilegedContractProposalSDKType | DemotePrivilegedContractProposalSDKType | SetCodeAuthorizationProposalSDKType | RemoveCodeAuthorizationProposalSDKType | SetContractAuthorizationProposalSDKType | RemoveContractAuthorizationProposalSDKType | AllowDenomProposalSDKType | CreditTypeProposalSDKType | AnySDKType | undefined; - authority: string; -} -/** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ -export interface MsgExecLegacyContentResponse {} -export interface MsgExecLegacyContentResponseProtoMsg { - typeUrl: "/cosmos.gov.v1.MsgExecLegacyContentResponse"; - value: Uint8Array; -} -/** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ -export interface MsgExecLegacyContentResponseAmino {} -export interface MsgExecLegacyContentResponseAminoMsg { - type: "cosmos-sdk/v1/MsgExecLegacyContentResponse"; - value: MsgExecLegacyContentResponseAmino; -} -/** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ -export interface MsgExecLegacyContentResponseSDKType {} -/** MsgVote defines a message to cast a vote. */ -export interface MsgVote { - /** proposal_id defines the unique id of the proposal. */ - proposalId: bigint; - /** voter is the voter address for the proposal. */ - voter: string; - /** option defines the vote option. */ - option: VoteOption; - /** metadata is any arbitrary metadata attached to the Vote. */ - metadata: string; -} -export interface MsgVoteProtoMsg { - typeUrl: "/cosmos.gov.v1.MsgVote"; - value: Uint8Array; -} -/** MsgVote defines a message to cast a vote. */ -export interface MsgVoteAmino { - /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; - /** voter is the voter address for the proposal. */ - voter?: string; - /** option defines the vote option. */ - option?: VoteOption; - /** metadata is any arbitrary metadata attached to the Vote. */ - metadata?: string; -} -export interface MsgVoteAminoMsg { - type: "cosmos-sdk/v1/MsgVote"; - value: MsgVoteAmino; -} -/** MsgVote defines a message to cast a vote. */ -export interface MsgVoteSDKType { - proposal_id: bigint; - voter: string; - option: VoteOption; - metadata: string; -} -/** MsgVoteResponse defines the Msg/Vote response type. */ -export interface MsgVoteResponse {} -export interface MsgVoteResponseProtoMsg { - typeUrl: "/cosmos.gov.v1.MsgVoteResponse"; - value: Uint8Array; -} -/** MsgVoteResponse defines the Msg/Vote response type. */ -export interface MsgVoteResponseAmino {} -export interface MsgVoteResponseAminoMsg { - type: "cosmos-sdk/v1/MsgVoteResponse"; - value: MsgVoteResponseAmino; -} -/** MsgVoteResponse defines the Msg/Vote response type. */ -export interface MsgVoteResponseSDKType {} -/** MsgVoteWeighted defines a message to cast a vote. */ -export interface MsgVoteWeighted { - /** proposal_id defines the unique id of the proposal. */ - proposalId: bigint; - /** voter is the voter address for the proposal. */ - voter: string; - /** options defines the weighted vote options. */ - options: WeightedVoteOption[]; - /** metadata is any arbitrary metadata attached to the VoteWeighted. */ - metadata: string; -} -export interface MsgVoteWeightedProtoMsg { - typeUrl: "/cosmos.gov.v1.MsgVoteWeighted"; - value: Uint8Array; -} -/** MsgVoteWeighted defines a message to cast a vote. */ -export interface MsgVoteWeightedAmino { - /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; - /** voter is the voter address for the proposal. */ - voter?: string; - /** options defines the weighted vote options. */ - options?: WeightedVoteOptionAmino[]; - /** metadata is any arbitrary metadata attached to the VoteWeighted. */ - metadata?: string; -} -export interface MsgVoteWeightedAminoMsg { - type: "cosmos-sdk/v1/MsgVoteWeighted"; - value: MsgVoteWeightedAmino; -} -/** MsgVoteWeighted defines a message to cast a vote. */ -export interface MsgVoteWeightedSDKType { - proposal_id: bigint; - voter: string; - options: WeightedVoteOptionSDKType[]; - metadata: string; -} -/** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ -export interface MsgVoteWeightedResponse {} -export interface MsgVoteWeightedResponseProtoMsg { - typeUrl: "/cosmos.gov.v1.MsgVoteWeightedResponse"; - value: Uint8Array; -} -/** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ -export interface MsgVoteWeightedResponseAmino {} -export interface MsgVoteWeightedResponseAminoMsg { - type: "cosmos-sdk/v1/MsgVoteWeightedResponse"; - value: MsgVoteWeightedResponseAmino; -} -/** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ -export interface MsgVoteWeightedResponseSDKType {} -/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ -export interface MsgDeposit { - /** proposal_id defines the unique id of the proposal. */ - proposalId: bigint; - /** depositor defines the deposit addresses from the proposals. */ - depositor: string; - /** amount to be deposited by depositor. */ - amount: Coin[]; -} -export interface MsgDepositProtoMsg { - typeUrl: "/cosmos.gov.v1.MsgDeposit"; - value: Uint8Array; -} -/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ -export interface MsgDepositAmino { - /** proposal_id defines the unique id of the proposal. */ - proposal_id: string; - /** depositor defines the deposit addresses from the proposals. */ - depositor?: string; - /** amount to be deposited by depositor. */ - amount: CoinAmino[]; -} -export interface MsgDepositAminoMsg { - type: "cosmos-sdk/v1/MsgDeposit"; - value: MsgDepositAmino; -} -/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ -export interface MsgDepositSDKType { - proposal_id: bigint; - depositor: string; - amount: CoinSDKType[]; -} -/** MsgDepositResponse defines the Msg/Deposit response type. */ -export interface MsgDepositResponse {} -export interface MsgDepositResponseProtoMsg { - typeUrl: "/cosmos.gov.v1.MsgDepositResponse"; - value: Uint8Array; -} -/** MsgDepositResponse defines the Msg/Deposit response type. */ -export interface MsgDepositResponseAmino {} -export interface MsgDepositResponseAminoMsg { - type: "cosmos-sdk/v1/MsgDepositResponse"; - value: MsgDepositResponseAmino; -} -/** MsgDepositResponse defines the Msg/Deposit response type. */ -export interface MsgDepositResponseSDKType {} -/** - * MsgUpdateParams is the Msg/UpdateParams request type. - * - * Since: cosmos-sdk 0.47 - */ -export interface MsgUpdateParams { - /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ - authority: string; - /** - * params defines the x/gov parameters to update. - * - * NOTE: All parameters must be supplied. - */ - params: Params | undefined; -} -export interface MsgUpdateParamsProtoMsg { - typeUrl: "/cosmos.gov.v1.MsgUpdateParams"; - value: Uint8Array; -} -/** - * MsgUpdateParams is the Msg/UpdateParams request type. - * - * Since: cosmos-sdk 0.47 - */ -export interface MsgUpdateParamsAmino { - /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ - authority?: string; - /** - * params defines the x/gov parameters to update. - * - * NOTE: All parameters must be supplied. - */ - params: ParamsAmino | undefined; -} -export interface MsgUpdateParamsAminoMsg { - type: "cosmos-sdk/x/gov/v1/MsgUpdateParams"; - value: MsgUpdateParamsAmino; -} -/** - * MsgUpdateParams is the Msg/UpdateParams request type. - * - * Since: cosmos-sdk 0.47 - */ -export interface MsgUpdateParamsSDKType { - authority: string; - params: ParamsSDKType | undefined; -} -/** - * MsgUpdateParamsResponse defines the response structure for executing a - * MsgUpdateParams message. - * - * Since: cosmos-sdk 0.47 - */ -export interface MsgUpdateParamsResponse {} -export interface MsgUpdateParamsResponseProtoMsg { - typeUrl: "/cosmos.gov.v1.MsgUpdateParamsResponse"; - value: Uint8Array; -} -/** - * MsgUpdateParamsResponse defines the response structure for executing a - * MsgUpdateParams message. - * - * Since: cosmos-sdk 0.47 - */ -export interface MsgUpdateParamsResponseAmino {} -export interface MsgUpdateParamsResponseAminoMsg { - type: "cosmos-sdk/v1/MsgUpdateParamsResponse"; - value: MsgUpdateParamsResponseAmino; -} -/** - * MsgUpdateParamsResponse defines the response structure for executing a - * MsgUpdateParams message. - * - * Since: cosmos-sdk 0.47 - */ -export interface MsgUpdateParamsResponseSDKType {} -/** - * MsgCancelProposal is the Msg/CancelProposal request type. - * - * Since: cosmos-sdk 0.50 - */ -export interface MsgCancelProposal { - /** proposal_id defines the unique id of the proposal. */ - proposalId: bigint; - /** proposer is the account address of the proposer. */ - proposer: string; -} -export interface MsgCancelProposalProtoMsg { - typeUrl: "/cosmos.gov.v1.MsgCancelProposal"; - value: Uint8Array; -} -/** - * MsgCancelProposal is the Msg/CancelProposal request type. - * - * Since: cosmos-sdk 0.50 - */ -export interface MsgCancelProposalAmino { - /** proposal_id defines the unique id of the proposal. */ - proposal_id?: string; - /** proposer is the account address of the proposer. */ - proposer?: string; -} -export interface MsgCancelProposalAminoMsg { - type: "cosmos-sdk/v1/MsgCancelProposal"; - value: MsgCancelProposalAmino; -} -/** - * MsgCancelProposal is the Msg/CancelProposal request type. - * - * Since: cosmos-sdk 0.50 - */ -export interface MsgCancelProposalSDKType { - proposal_id: bigint; - proposer: string; -} -/** - * MsgCancelProposalResponse defines the response structure for executing a - * MsgCancelProposal message. - * - * Since: cosmos-sdk 0.50 - */ -export interface MsgCancelProposalResponse { - /** proposal_id defines the unique id of the proposal. */ - proposalId: bigint; - /** canceled_time is the time when proposal is canceled. */ - canceledTime: Date | undefined; - /** canceled_height defines the block height at which the proposal is canceled. */ - canceledHeight: bigint; -} -export interface MsgCancelProposalResponseProtoMsg { - typeUrl: "/cosmos.gov.v1.MsgCancelProposalResponse"; - value: Uint8Array; -} -/** - * MsgCancelProposalResponse defines the response structure for executing a - * MsgCancelProposal message. - * - * Since: cosmos-sdk 0.50 - */ -export interface MsgCancelProposalResponseAmino { - /** proposal_id defines the unique id of the proposal. */ - proposal_id?: string; - /** canceled_time is the time when proposal is canceled. */ - canceled_time?: string | undefined; - /** canceled_height defines the block height at which the proposal is canceled. */ - canceled_height?: string; -} -export interface MsgCancelProposalResponseAminoMsg { - type: "cosmos-sdk/v1/MsgCancelProposalResponse"; - value: MsgCancelProposalResponseAmino; -} -/** - * MsgCancelProposalResponse defines the response structure for executing a - * MsgCancelProposal message. - * - * Since: cosmos-sdk 0.50 - */ -export interface MsgCancelProposalResponseSDKType { - proposal_id: bigint; - canceled_time: Date | undefined; - canceled_height: bigint; -} -function createBaseMsgSubmitProposal(): MsgSubmitProposal { - return { - messages: [], - initialDeposit: [], - proposer: "", - metadata: "", - title: "", - summary: "", - expedited: false - }; -} -export const MsgSubmitProposal = { - typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", - encode(message: MsgSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.messages) { - Any.encode(v!, writer.uint32(10).fork()).ldelim(); - } - for (const v of message.initialDeposit) { - Coin.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.proposer !== "") { - writer.uint32(26).string(message.proposer); - } - if (message.metadata !== "") { - writer.uint32(34).string(message.metadata); - } - if (message.title !== "") { - writer.uint32(42).string(message.title); - } - if (message.summary !== "") { - writer.uint32(50).string(message.summary); - } - if (message.expedited === true) { - writer.uint32(56).bool(message.expedited); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSubmitProposal { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSubmitProposal(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.messages.push(Any.decode(reader, reader.uint32(), useInterfaces)); - break; - case 2: - message.initialDeposit.push(Coin.decode(reader, reader.uint32(), useInterfaces)); - break; - case 3: - message.proposer = reader.string(); - break; - case 4: - message.metadata = reader.string(); - break; - case 5: - message.title = reader.string(); - break; - case 6: - message.summary = reader.string(); - break; - case 7: - message.expedited = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): MsgSubmitProposal { - const message = createBaseMsgSubmitProposal(); - message.messages = object.messages?.map(e => Any.fromPartial(e)) || []; - message.initialDeposit = object.initialDeposit?.map(e => Coin.fromPartial(e)) || []; - message.proposer = object.proposer ?? ""; - message.metadata = object.metadata ?? ""; - message.title = object.title ?? ""; - message.summary = object.summary ?? ""; - message.expedited = object.expedited ?? false; - return message; - }, - fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { - const message = createBaseMsgSubmitProposal(); - message.messages = object.messages?.map(e => aminoToRawProtobufMsg(e)) || []; - message.initialDeposit = object.initial_deposit?.map(e => Coin.fromAmino(e)) || []; - if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = object.proposer; - } - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata; - } - if (object.title !== undefined && object.title !== null) { - message.title = object.title; - } - if (object.summary !== undefined && object.summary !== null) { - message.summary = object.summary; - } - if (object.expedited !== undefined && object.expedited !== null) { - message.expedited = object.expedited; - } - return message; - }, - toAmino(message: MsgSubmitProposal, useInterfaces: boolean = false): MsgSubmitProposalAmino { - const obj: any = {}; - if (message.messages.length) { - obj.messages = message.messages.map(e => e ? rawProtobufMsgToAmino(e, false) : undefined); - } - if (message.initialDeposit) { - obj.initial_deposit = message.initialDeposit.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); - } else { - obj.initial_deposit = []; - } - obj.proposer = message.proposer; - obj.metadata = message.metadata; - obj.title = message.title; - obj.summary = message.summary; - if (message.expedited) { - obj.expedited = message.expedited; - } - return obj; - }, - fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { - return MsgSubmitProposal.fromAmino(object.value); - }, - toAminoMsg(message: MsgSubmitProposal, useInterfaces: boolean = false): MsgSubmitProposalAminoMsg { - return { - type: "cosmos-sdk/v1/MsgSubmitProposal", - value: MsgSubmitProposal.toAmino(message, useInterfaces) - }; - }, - fromProtoMsg(message: MsgSubmitProposalProtoMsg, useInterfaces: boolean = false): MsgSubmitProposal { - return MsgSubmitProposal.decode(message.value, undefined, useInterfaces); - }, - toProto(message: MsgSubmitProposal): Uint8Array { - return MsgSubmitProposal.encode(message).finish(); - }, - toProtoMsg(message: MsgSubmitProposal): MsgSubmitProposalProtoMsg { - return { - typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", - value: MsgSubmitProposal.encode(message).finish() - }; - } -}; -function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { - return { - proposalId: BigInt(0) - }; -} -export const MsgSubmitProposalResponse = { - typeUrl: "/cosmos.gov.v1.MsgSubmitProposalResponse", - encode(message: MsgSubmitProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.proposalId !== BigInt(0)) { - writer.uint32(8).uint64(message.proposalId); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSubmitProposalResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSubmitProposalResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposalId = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): MsgSubmitProposalResponse { - const message = createBaseMsgSubmitProposalResponse(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); - return message; - }, - fromAmino(object: MsgSubmitProposalResponseAmino): MsgSubmitProposalResponse { - const message = createBaseMsgSubmitProposalResponse(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - return message; - }, - toAmino(message: MsgSubmitProposalResponse, useInterfaces: boolean = false): MsgSubmitProposalResponseAmino { - const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - return obj; - }, - fromAminoMsg(object: MsgSubmitProposalResponseAminoMsg): MsgSubmitProposalResponse { - return MsgSubmitProposalResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgSubmitProposalResponse, useInterfaces: boolean = false): MsgSubmitProposalResponseAminoMsg { - return { - type: "cosmos-sdk/v1/MsgSubmitProposalResponse", - value: MsgSubmitProposalResponse.toAmino(message, useInterfaces) - }; - }, - fromProtoMsg(message: MsgSubmitProposalResponseProtoMsg, useInterfaces: boolean = false): MsgSubmitProposalResponse { - return MsgSubmitProposalResponse.decode(message.value, undefined, useInterfaces); - }, - toProto(message: MsgSubmitProposalResponse): Uint8Array { - return MsgSubmitProposalResponse.encode(message).finish(); - }, - toProtoMsg(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseProtoMsg { - return { - typeUrl: "/cosmos.gov.v1.MsgSubmitProposalResponse", - value: MsgSubmitProposalResponse.encode(message).finish() - }; - } -}; -function createBaseMsgExecLegacyContent(): MsgExecLegacyContent { - return { - content: undefined, - authority: "" - }; -} -export const MsgExecLegacyContent = { - typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", - encode(message: MsgExecLegacyContent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.content !== undefined) { - Any.encode((message.content as Any), writer.uint32(10).fork()).ldelim(); - } - if (message.authority !== "") { - writer.uint32(18).string(message.authority); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgExecLegacyContent { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgExecLegacyContent(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.content = useInterfaces ? (Cosmos_govv1beta1Content_InterfaceDecoder(reader) as Any) : Any.decode(reader, reader.uint32(), useInterfaces); - break; - case 2: - message.authority = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): MsgExecLegacyContent { - const message = createBaseMsgExecLegacyContent(); - message.content = object.content !== undefined && object.content !== null ? Any.fromPartial(object.content) : undefined; - message.authority = object.authority ?? ""; - return message; - }, - fromAmino(object: MsgExecLegacyContentAmino): MsgExecLegacyContent { - const message = createBaseMsgExecLegacyContent(); - if (object.content !== undefined && object.content !== null) { - message.content = Cosmos_govv1beta1Content_FromAmino(object.content); - } - if (object.authority !== undefined && object.authority !== null) { - message.authority = object.authority; - } - return message; - }, - toAmino(message: MsgExecLegacyContent, useInterfaces: boolean = false): MsgExecLegacyContentAmino { - const obj: any = {}; - obj.content = message.content ? Cosmos_govv1beta1Content_ToAmino((message.content as Any), useInterfaces) : undefined; - obj.authority = message.authority; - return obj; - }, - fromAminoMsg(object: MsgExecLegacyContentAminoMsg): MsgExecLegacyContent { - return MsgExecLegacyContent.fromAmino(object.value); - }, - toAminoMsg(message: MsgExecLegacyContent, useInterfaces: boolean = false): MsgExecLegacyContentAminoMsg { - return { - type: "cosmos-sdk/v1/MsgExecLegacyContent", - value: MsgExecLegacyContent.toAmino(message, useInterfaces) - }; - }, - fromProtoMsg(message: MsgExecLegacyContentProtoMsg, useInterfaces: boolean = false): MsgExecLegacyContent { - return MsgExecLegacyContent.decode(message.value, undefined, useInterfaces); - }, - toProto(message: MsgExecLegacyContent): Uint8Array { - return MsgExecLegacyContent.encode(message).finish(); - }, - toProtoMsg(message: MsgExecLegacyContent): MsgExecLegacyContentProtoMsg { - return { - typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", - value: MsgExecLegacyContent.encode(message).finish() - }; - } -}; -function createBaseMsgExecLegacyContentResponse(): MsgExecLegacyContentResponse { - return {}; -} -export const MsgExecLegacyContentResponse = { - typeUrl: "/cosmos.gov.v1.MsgExecLegacyContentResponse", - encode(_: MsgExecLegacyContentResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgExecLegacyContentResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgExecLegacyContentResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(_: Partial): MsgExecLegacyContentResponse { - const message = createBaseMsgExecLegacyContentResponse(); - return message; - }, - fromAmino(_: MsgExecLegacyContentResponseAmino): MsgExecLegacyContentResponse { - const message = createBaseMsgExecLegacyContentResponse(); - return message; - }, - toAmino(_: MsgExecLegacyContentResponse, useInterfaces: boolean = false): MsgExecLegacyContentResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgExecLegacyContentResponseAminoMsg): MsgExecLegacyContentResponse { - return MsgExecLegacyContentResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgExecLegacyContentResponse, useInterfaces: boolean = false): MsgExecLegacyContentResponseAminoMsg { - return { - type: "cosmos-sdk/v1/MsgExecLegacyContentResponse", - value: MsgExecLegacyContentResponse.toAmino(message, useInterfaces) - }; - }, - fromProtoMsg(message: MsgExecLegacyContentResponseProtoMsg, useInterfaces: boolean = false): MsgExecLegacyContentResponse { - return MsgExecLegacyContentResponse.decode(message.value, undefined, useInterfaces); - }, - toProto(message: MsgExecLegacyContentResponse): Uint8Array { - return MsgExecLegacyContentResponse.encode(message).finish(); - }, - toProtoMsg(message: MsgExecLegacyContentResponse): MsgExecLegacyContentResponseProtoMsg { - return { - typeUrl: "/cosmos.gov.v1.MsgExecLegacyContentResponse", - value: MsgExecLegacyContentResponse.encode(message).finish() - }; - } -}; -function createBaseMsgVote(): MsgVote { - return { - proposalId: BigInt(0), - voter: "", - option: 0, - metadata: "" - }; -} -export const MsgVote = { - typeUrl: "/cosmos.gov.v1.MsgVote", - encode(message: MsgVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.proposalId !== BigInt(0)) { - writer.uint32(8).uint64(message.proposalId); - } - if (message.voter !== "") { - writer.uint32(18).string(message.voter); - } - if (message.option !== 0) { - writer.uint32(24).int32(message.option); - } - if (message.metadata !== "") { - writer.uint32(34).string(message.metadata); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgVote { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgVote(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposalId = reader.uint64(); - break; - case 2: - message.voter = reader.string(); - break; - case 3: - message.option = (reader.int32() as any); - break; - case 4: - message.metadata = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): MsgVote { - const message = createBaseMsgVote(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); - message.voter = object.voter ?? ""; - message.option = object.option ?? 0; - message.metadata = object.metadata ?? ""; - return message; - }, - fromAmino(object: MsgVoteAmino): MsgVote { - const message = createBaseMsgVote(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } - if (object.option !== undefined && object.option !== null) { - message.option = object.option; - } - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata; - } - return message; - }, - toAmino(message: MsgVote, useInterfaces: boolean = false): MsgVoteAmino { - const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; - obj.voter = message.voter; - obj.option = message.option; - obj.metadata = message.metadata; - return obj; - }, - fromAminoMsg(object: MsgVoteAminoMsg): MsgVote { - return MsgVote.fromAmino(object.value); - }, - toAminoMsg(message: MsgVote, useInterfaces: boolean = false): MsgVoteAminoMsg { - return { - type: "cosmos-sdk/v1/MsgVote", - value: MsgVote.toAmino(message, useInterfaces) - }; - }, - fromProtoMsg(message: MsgVoteProtoMsg, useInterfaces: boolean = false): MsgVote { - return MsgVote.decode(message.value, undefined, useInterfaces); - }, - toProto(message: MsgVote): Uint8Array { - return MsgVote.encode(message).finish(); - }, - toProtoMsg(message: MsgVote): MsgVoteProtoMsg { - return { - typeUrl: "/cosmos.gov.v1.MsgVote", - value: MsgVote.encode(message).finish() - }; - } -}; -function createBaseMsgVoteResponse(): MsgVoteResponse { - return {}; -} -export const MsgVoteResponse = { - typeUrl: "/cosmos.gov.v1.MsgVoteResponse", - encode(_: MsgVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgVoteResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgVoteResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(_: Partial): MsgVoteResponse { - const message = createBaseMsgVoteResponse(); - return message; - }, - fromAmino(_: MsgVoteResponseAmino): MsgVoteResponse { - const message = createBaseMsgVoteResponse(); - return message; - }, - toAmino(_: MsgVoteResponse, useInterfaces: boolean = false): MsgVoteResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgVoteResponseAminoMsg): MsgVoteResponse { - return MsgVoteResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgVoteResponse, useInterfaces: boolean = false): MsgVoteResponseAminoMsg { - return { - type: "cosmos-sdk/v1/MsgVoteResponse", - value: MsgVoteResponse.toAmino(message, useInterfaces) - }; - }, - fromProtoMsg(message: MsgVoteResponseProtoMsg, useInterfaces: boolean = false): MsgVoteResponse { - return MsgVoteResponse.decode(message.value, undefined, useInterfaces); - }, - toProto(message: MsgVoteResponse): Uint8Array { - return MsgVoteResponse.encode(message).finish(); - }, - toProtoMsg(message: MsgVoteResponse): MsgVoteResponseProtoMsg { - return { - typeUrl: "/cosmos.gov.v1.MsgVoteResponse", - value: MsgVoteResponse.encode(message).finish() - }; - } -}; -function createBaseMsgVoteWeighted(): MsgVoteWeighted { - return { - proposalId: BigInt(0), - voter: "", - options: [], - metadata: "" - }; -} -export const MsgVoteWeighted = { - typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", - encode(message: MsgVoteWeighted, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.proposalId !== BigInt(0)) { - writer.uint32(8).uint64(message.proposalId); - } - if (message.voter !== "") { - writer.uint32(18).string(message.voter); - } - for (const v of message.options) { - WeightedVoteOption.encode(v!, writer.uint32(26).fork()).ldelim(); - } - if (message.metadata !== "") { - writer.uint32(34).string(message.metadata); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgVoteWeighted { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgVoteWeighted(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposalId = reader.uint64(); - break; - case 2: - message.voter = reader.string(); - break; - case 3: - message.options.push(WeightedVoteOption.decode(reader, reader.uint32(), useInterfaces)); - break; - case 4: - message.metadata = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): MsgVoteWeighted { - const message = createBaseMsgVoteWeighted(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); - message.voter = object.voter ?? ""; - message.options = object.options?.map(e => WeightedVoteOption.fromPartial(e)) || []; - message.metadata = object.metadata ?? ""; - return message; - }, - fromAmino(object: MsgVoteWeightedAmino): MsgVoteWeighted { - const message = createBaseMsgVoteWeighted(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter; - } - message.options = object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; - if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata; - } - return message; - }, - toAmino(message: MsgVoteWeighted, useInterfaces: boolean = false): MsgVoteWeightedAmino { - const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; - obj.voter = message.voter; - if (message.options) { - obj.options = message.options.map(e => e ? WeightedVoteOption.toAmino(e, useInterfaces) : undefined); - } else { - obj.options = []; - } - obj.metadata = message.metadata; - return obj; - }, - fromAminoMsg(object: MsgVoteWeightedAminoMsg): MsgVoteWeighted { - return MsgVoteWeighted.fromAmino(object.value); - }, - toAminoMsg(message: MsgVoteWeighted, useInterfaces: boolean = false): MsgVoteWeightedAminoMsg { - return { - type: "cosmos-sdk/v1/MsgVoteWeighted", - value: MsgVoteWeighted.toAmino(message, useInterfaces) - }; - }, - fromProtoMsg(message: MsgVoteWeightedProtoMsg, useInterfaces: boolean = false): MsgVoteWeighted { - return MsgVoteWeighted.decode(message.value, undefined, useInterfaces); - }, - toProto(message: MsgVoteWeighted): Uint8Array { - return MsgVoteWeighted.encode(message).finish(); - }, - toProtoMsg(message: MsgVoteWeighted): MsgVoteWeightedProtoMsg { - return { - typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", - value: MsgVoteWeighted.encode(message).finish() - }; - } -}; -function createBaseMsgVoteWeightedResponse(): MsgVoteWeightedResponse { - return {}; -} -export const MsgVoteWeightedResponse = { - typeUrl: "/cosmos.gov.v1.MsgVoteWeightedResponse", - encode(_: MsgVoteWeightedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgVoteWeightedResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgVoteWeightedResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(_: Partial): MsgVoteWeightedResponse { - const message = createBaseMsgVoteWeightedResponse(); - return message; - }, - fromAmino(_: MsgVoteWeightedResponseAmino): MsgVoteWeightedResponse { - const message = createBaseMsgVoteWeightedResponse(); - return message; - }, - toAmino(_: MsgVoteWeightedResponse, useInterfaces: boolean = false): MsgVoteWeightedResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgVoteWeightedResponseAminoMsg): MsgVoteWeightedResponse { - return MsgVoteWeightedResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgVoteWeightedResponse, useInterfaces: boolean = false): MsgVoteWeightedResponseAminoMsg { - return { - type: "cosmos-sdk/v1/MsgVoteWeightedResponse", - value: MsgVoteWeightedResponse.toAmino(message, useInterfaces) - }; - }, - fromProtoMsg(message: MsgVoteWeightedResponseProtoMsg, useInterfaces: boolean = false): MsgVoteWeightedResponse { - return MsgVoteWeightedResponse.decode(message.value, undefined, useInterfaces); - }, - toProto(message: MsgVoteWeightedResponse): Uint8Array { - return MsgVoteWeightedResponse.encode(message).finish(); - }, - toProtoMsg(message: MsgVoteWeightedResponse): MsgVoteWeightedResponseProtoMsg { - return { - typeUrl: "/cosmos.gov.v1.MsgVoteWeightedResponse", - value: MsgVoteWeightedResponse.encode(message).finish() - }; - } -}; -function createBaseMsgDeposit(): MsgDeposit { - return { - proposalId: BigInt(0), - depositor: "", - amount: [] - }; -} -export const MsgDeposit = { - typeUrl: "/cosmos.gov.v1.MsgDeposit", - encode(message: MsgDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.proposalId !== BigInt(0)) { - writer.uint32(8).uint64(message.proposalId); - } - if (message.depositor !== "") { - writer.uint32(18).string(message.depositor); - } - for (const v of message.amount) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgDeposit { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDeposit(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposalId = reader.uint64(); - break; - case 2: - message.depositor = reader.string(); - break; - case 3: - message.amount.push(Coin.decode(reader, reader.uint32(), useInterfaces)); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): MsgDeposit { - const message = createBaseMsgDeposit(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); - message.depositor = object.depositor ?? ""; - message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; - return message; - }, - fromAmino(object: MsgDepositAmino): MsgDeposit { - const message = createBaseMsgDeposit(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = object.depositor; - } - message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; - return message; - }, - toAmino(message: MsgDeposit, useInterfaces: boolean = false): MsgDepositAmino { - const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; - obj.depositor = message.depositor; - if (message.amount) { - obj.amount = message.amount.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); - } else { - obj.amount = []; - } - return obj; - }, - fromAminoMsg(object: MsgDepositAminoMsg): MsgDeposit { - return MsgDeposit.fromAmino(object.value); - }, - toAminoMsg(message: MsgDeposit, useInterfaces: boolean = false): MsgDepositAminoMsg { - return { - type: "cosmos-sdk/v1/MsgDeposit", - value: MsgDeposit.toAmino(message, useInterfaces) - }; - }, - fromProtoMsg(message: MsgDepositProtoMsg, useInterfaces: boolean = false): MsgDeposit { - return MsgDeposit.decode(message.value, undefined, useInterfaces); - }, - toProto(message: MsgDeposit): Uint8Array { - return MsgDeposit.encode(message).finish(); - }, - toProtoMsg(message: MsgDeposit): MsgDepositProtoMsg { - return { - typeUrl: "/cosmos.gov.v1.MsgDeposit", - value: MsgDeposit.encode(message).finish() - }; - } -}; -function createBaseMsgDepositResponse(): MsgDepositResponse { - return {}; -} -export const MsgDepositResponse = { - typeUrl: "/cosmos.gov.v1.MsgDepositResponse", - encode(_: MsgDepositResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgDepositResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDepositResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(_: Partial): MsgDepositResponse { - const message = createBaseMsgDepositResponse(); - return message; - }, - fromAmino(_: MsgDepositResponseAmino): MsgDepositResponse { - const message = createBaseMsgDepositResponse(); - return message; - }, - toAmino(_: MsgDepositResponse, useInterfaces: boolean = false): MsgDepositResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgDepositResponseAminoMsg): MsgDepositResponse { - return MsgDepositResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgDepositResponse, useInterfaces: boolean = false): MsgDepositResponseAminoMsg { - return { - type: "cosmos-sdk/v1/MsgDepositResponse", - value: MsgDepositResponse.toAmino(message, useInterfaces) - }; - }, - fromProtoMsg(message: MsgDepositResponseProtoMsg, useInterfaces: boolean = false): MsgDepositResponse { - return MsgDepositResponse.decode(message.value, undefined, useInterfaces); - }, - toProto(message: MsgDepositResponse): Uint8Array { - return MsgDepositResponse.encode(message).finish(); - }, - toProtoMsg(message: MsgDepositResponse): MsgDepositResponseProtoMsg { - return { - typeUrl: "/cosmos.gov.v1.MsgDepositResponse", - value: MsgDepositResponse.encode(message).finish() - }; - } -}; -function createBaseMsgUpdateParams(): MsgUpdateParams { - return { - authority: "", - params: Params.fromPartial({}) - }; -} -export const MsgUpdateParams = { - typeUrl: "/cosmos.gov.v1.MsgUpdateParams", - encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.authority !== "") { - writer.uint32(10).string(message.authority); - } - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateParams { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateParams(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.authority = reader.string(); - break; - case 2: - message.params = Params.decode(reader, reader.uint32(), useInterfaces); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): MsgUpdateParams { - const message = createBaseMsgUpdateParams(); - message.authority = object.authority ?? ""; - message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; - return message; - }, - fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { - const message = createBaseMsgUpdateParams(); - if (object.authority !== undefined && object.authority !== null) { - message.authority = object.authority; - } - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromAmino(object.params); - } - return message; - }, - toAmino(message: MsgUpdateParams, useInterfaces: boolean = false): MsgUpdateParamsAmino { - const obj: any = {}; - obj.authority = message.authority; - obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : Params.fromPartial({}); - return obj; - }, - fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { - return MsgUpdateParams.fromAmino(object.value); - }, - toAminoMsg(message: MsgUpdateParams, useInterfaces: boolean = false): MsgUpdateParamsAminoMsg { - return { - type: "cosmos-sdk/x/gov/v1/MsgUpdateParams", - value: MsgUpdateParams.toAmino(message, useInterfaces) - }; - }, - fromProtoMsg(message: MsgUpdateParamsProtoMsg, useInterfaces: boolean = false): MsgUpdateParams { - return MsgUpdateParams.decode(message.value, undefined, useInterfaces); - }, - toProto(message: MsgUpdateParams): Uint8Array { - return MsgUpdateParams.encode(message).finish(); - }, - toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { - return { - typeUrl: "/cosmos.gov.v1.MsgUpdateParams", - value: MsgUpdateParams.encode(message).finish() - }; - } -}; -function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { - return {}; -} -export const MsgUpdateParamsResponse = { - typeUrl: "/cosmos.gov.v1.MsgUpdateParamsResponse", - encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateParamsResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateParamsResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(_: Partial): MsgUpdateParamsResponse { - const message = createBaseMsgUpdateParamsResponse(); - return message; - }, - fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { - const message = createBaseMsgUpdateParamsResponse(); - return message; - }, - toAmino(_: MsgUpdateParamsResponse, useInterfaces: boolean = false): MsgUpdateParamsResponseAmino { - const obj: any = {}; - return obj; - }, - fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { - return MsgUpdateParamsResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgUpdateParamsResponse, useInterfaces: boolean = false): MsgUpdateParamsResponseAminoMsg { - return { - type: "cosmos-sdk/v1/MsgUpdateParamsResponse", - value: MsgUpdateParamsResponse.toAmino(message, useInterfaces) - }; - }, - fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg, useInterfaces: boolean = false): MsgUpdateParamsResponse { - return MsgUpdateParamsResponse.decode(message.value, undefined, useInterfaces); - }, - toProto(message: MsgUpdateParamsResponse): Uint8Array { - return MsgUpdateParamsResponse.encode(message).finish(); - }, - toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { - return { - typeUrl: "/cosmos.gov.v1.MsgUpdateParamsResponse", - value: MsgUpdateParamsResponse.encode(message).finish() - }; - } -}; -function createBaseMsgCancelProposal(): MsgCancelProposal { - return { - proposalId: BigInt(0), - proposer: "" - }; -} -export const MsgCancelProposal = { - typeUrl: "/cosmos.gov.v1.MsgCancelProposal", - encode(message: MsgCancelProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.proposalId !== BigInt(0)) { - writer.uint32(8).uint64(message.proposalId); - } - if (message.proposer !== "") { - writer.uint32(18).string(message.proposer); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgCancelProposal { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCancelProposal(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposalId = reader.uint64(); - break; - case 2: - message.proposer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): MsgCancelProposal { - const message = createBaseMsgCancelProposal(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); - message.proposer = object.proposer ?? ""; - return message; - }, - fromAmino(object: MsgCancelProposalAmino): MsgCancelProposal { - const message = createBaseMsgCancelProposal(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = object.proposer; - } - return message; - }, - toAmino(message: MsgCancelProposal, useInterfaces: boolean = false): MsgCancelProposalAmino { - const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.proposer = message.proposer; - return obj; - }, - fromAminoMsg(object: MsgCancelProposalAminoMsg): MsgCancelProposal { - return MsgCancelProposal.fromAmino(object.value); - }, - toAminoMsg(message: MsgCancelProposal, useInterfaces: boolean = false): MsgCancelProposalAminoMsg { - return { - type: "cosmos-sdk/v1/MsgCancelProposal", - value: MsgCancelProposal.toAmino(message, useInterfaces) - }; - }, - fromProtoMsg(message: MsgCancelProposalProtoMsg, useInterfaces: boolean = false): MsgCancelProposal { - return MsgCancelProposal.decode(message.value, undefined, useInterfaces); - }, - toProto(message: MsgCancelProposal): Uint8Array { - return MsgCancelProposal.encode(message).finish(); - }, - toProtoMsg(message: MsgCancelProposal): MsgCancelProposalProtoMsg { - return { - typeUrl: "/cosmos.gov.v1.MsgCancelProposal", - value: MsgCancelProposal.encode(message).finish() - }; - } -}; -function createBaseMsgCancelProposalResponse(): MsgCancelProposalResponse { - return { - proposalId: BigInt(0), - canceledTime: new Date(), - canceledHeight: BigInt(0) - }; -} -export const MsgCancelProposalResponse = { - typeUrl: "/cosmos.gov.v1.MsgCancelProposalResponse", - encode(message: MsgCancelProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.proposalId !== BigInt(0)) { - writer.uint32(8).uint64(message.proposalId); - } - if (message.canceledTime !== undefined) { - Timestamp.encode(toTimestamp(message.canceledTime), writer.uint32(18).fork()).ldelim(); - } - if (message.canceledHeight !== BigInt(0)) { - writer.uint32(24).uint64(message.canceledHeight); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgCancelProposalResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCancelProposalResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.proposalId = reader.uint64(); - break; - case 2: - message.canceledTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; - case 3: - message.canceledHeight = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): MsgCancelProposalResponse { - const message = createBaseMsgCancelProposalResponse(); - message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); - message.canceledTime = object.canceledTime ?? undefined; - message.canceledHeight = object.canceledHeight !== undefined && object.canceledHeight !== null ? BigInt(object.canceledHeight.toString()) : BigInt(0); - return message; - }, - fromAmino(object: MsgCancelProposalResponseAmino): MsgCancelProposalResponse { - const message = createBaseMsgCancelProposalResponse(); - if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id); - } - if (object.canceled_time !== undefined && object.canceled_time !== null) { - message.canceledTime = fromTimestamp(Timestamp.fromAmino(object.canceled_time)); - } - if (object.canceled_height !== undefined && object.canceled_height !== null) { - message.canceledHeight = BigInt(object.canceled_height); - } - return message; - }, - toAmino(message: MsgCancelProposalResponse, useInterfaces: boolean = false): MsgCancelProposalResponseAmino { - const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; - obj.canceled_time = message.canceledTime ? Timestamp.toAmino(toTimestamp(message.canceledTime)) : undefined; - obj.canceled_height = message.canceledHeight ? message.canceledHeight.toString() : undefined; - return obj; - }, - fromAminoMsg(object: MsgCancelProposalResponseAminoMsg): MsgCancelProposalResponse { - return MsgCancelProposalResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgCancelProposalResponse, useInterfaces: boolean = false): MsgCancelProposalResponseAminoMsg { - return { - type: "cosmos-sdk/v1/MsgCancelProposalResponse", - value: MsgCancelProposalResponse.toAmino(message, useInterfaces) - }; - }, - fromProtoMsg(message: MsgCancelProposalResponseProtoMsg, useInterfaces: boolean = false): MsgCancelProposalResponse { - return MsgCancelProposalResponse.decode(message.value, undefined, useInterfaces); - }, - toProto(message: MsgCancelProposalResponse): Uint8Array { - return MsgCancelProposalResponse.encode(message).finish(); - }, - toProtoMsg(message: MsgCancelProposalResponse): MsgCancelProposalResponseProtoMsg { - return { - typeUrl: "/cosmos.gov.v1.MsgCancelProposalResponse", - value: MsgCancelProposalResponse.encode(message).finish() - }; - } -}; -export const Cosmos_govv1beta1Content_InterfaceDecoder = (input: BinaryReader | Uint8Array): MsgCreateAllianceProposal | MsgUpdateAllianceProposal | MsgDeleteAllianceProposal | CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | ClientUpdateProposal | UpgradeProposal | ReplaceMigrationRecordsProposal | UpdateMigrationRecordsProposal | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal | SetScalingFactorControllerProposal | CreateGroupsProposal | ReplacePoolIncentivesProposal | UpdatePoolIncentivesProposal | SetProtoRevEnabledProposal | SetProtoRevAdminAccountProposal | SetSuperfluidAssetsProposal | RemoveSuperfluidAssetsProposal | UpdateUnpoolWhiteListProposal | UpdateFeeTokenProposal | PromoteToPrivilegedContractProposal | DemotePrivilegedContractProposal | SetCodeAuthorizationProposal | RemoveCodeAuthorizationProposal | SetContractAuthorizationProposal | RemoveContractAuthorizationProposal | AllowDenomProposal | CreditTypeProposal | Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const data = Any.decode(reader, reader.uint32(), true); - switch (data.typeUrl) { - case "/alliance.alliance.MsgCreateAllianceProposal": - return MsgCreateAllianceProposal.decode(data.value, undefined, true); - case "/alliance.alliance.MsgUpdateAllianceProposal": - return MsgUpdateAllianceProposal.decode(data.value, undefined, true); - case "/alliance.alliance.MsgDeleteAllianceProposal": - return MsgDeleteAllianceProposal.decode(data.value, undefined, true); - case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal": - return CommunityPoolSpendProposal.decode(data.value, undefined, true); - case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit": - return CommunityPoolSpendProposalWithDeposit.decode(data.value, undefined, true); - case "/cosmos.gov.v1beta1.TextProposal": - return TextProposal.decode(data.value, undefined, true); - case "/cosmos.params.v1beta1.ParameterChangeProposal": - return ParameterChangeProposal.decode(data.value, undefined, true); - case "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal": - return SoftwareUpgradeProposal.decode(data.value, undefined, true); - case "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal": - return CancelSoftwareUpgradeProposal.decode(data.value, undefined, true); - case "/cosmwasm.wasm.v1.StoreCodeProposal": - return StoreCodeProposal.decode(data.value, undefined, true); - case "/cosmwasm.wasm.v1.InstantiateContractProposal": - return InstantiateContractProposal.decode(data.value, undefined, true); - case "/cosmwasm.wasm.v1.InstantiateContract2Proposal": - return InstantiateContract2Proposal.decode(data.value, undefined, true); - case "/cosmwasm.wasm.v1.MigrateContractProposal": - return MigrateContractProposal.decode(data.value, undefined, true); - case "/cosmwasm.wasm.v1.SudoContractProposal": - return SudoContractProposal.decode(data.value, undefined, true); - case "/cosmwasm.wasm.v1.ExecuteContractProposal": - return ExecuteContractProposal.decode(data.value, undefined, true); - case "/cosmwasm.wasm.v1.UpdateAdminProposal": - return UpdateAdminProposal.decode(data.value, undefined, true); - case "/cosmwasm.wasm.v1.ClearAdminProposal": - return ClearAdminProposal.decode(data.value, undefined, true); - case "/cosmwasm.wasm.v1.PinCodesProposal": - return PinCodesProposal.decode(data.value, undefined, true); - case "/cosmwasm.wasm.v1.UnpinCodesProposal": - return UnpinCodesProposal.decode(data.value, undefined, true); - case "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal": - return UpdateInstantiateConfigProposal.decode(data.value, undefined, true); - case "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal": - return StoreAndInstantiateContractProposal.decode(data.value, undefined, true); - case "/ibc.core.client.v1.ClientUpdateProposal": - return ClientUpdateProposal.decode(data.value, undefined, true); - case "/ibc.core.client.v1.UpgradeProposal": - return UpgradeProposal.decode(data.value, undefined, true); - case "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal": - return ReplaceMigrationRecordsProposal.decode(data.value, undefined, true); - case "/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal": - return UpdateMigrationRecordsProposal.decode(data.value, undefined, true); - case "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal": - return CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.decode(data.value, undefined, true); - case "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal": - return SetScalingFactorControllerProposal.decode(data.value, undefined, true); - case "/osmosis.incentives.CreateGroupsProposal": - return CreateGroupsProposal.decode(data.value, undefined, true); - case "/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal": - return ReplacePoolIncentivesProposal.decode(data.value, undefined, true); - case "/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal": - return UpdatePoolIncentivesProposal.decode(data.value, undefined, true); - case "/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal": - return SetProtoRevEnabledProposal.decode(data.value, undefined, true); - case "/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal": - return SetProtoRevAdminAccountProposal.decode(data.value, undefined, true); - case "/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal": - return SetSuperfluidAssetsProposal.decode(data.value, undefined, true); - case "/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal": - return RemoveSuperfluidAssetsProposal.decode(data.value, undefined, true); - case "/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal": - return UpdateUnpoolWhiteListProposal.decode(data.value, undefined, true); - case "/osmosis.txfees.v1beta1.UpdateFeeTokenProposal": - return UpdateFeeTokenProposal.decode(data.value, undefined, true); - case "/publicawesome.stargaze.cron.v1.PromoteToPrivilegedContractProposal": - return PromoteToPrivilegedContractProposal.decode(data.value, undefined, true); - case "/publicawesome.stargaze.cron.v1.DemotePrivilegedContractProposal": - return DemotePrivilegedContractProposal.decode(data.value, undefined, true); - case "/publicawesome.stargaze.globalfee.v1.SetCodeAuthorizationProposal": - return SetCodeAuthorizationProposal.decode(data.value, undefined, true); - case "/publicawesome.stargaze.globalfee.v1.RemoveCodeAuthorizationProposal": - return RemoveCodeAuthorizationProposal.decode(data.value, undefined, true); - case "/publicawesome.stargaze.globalfee.v1.SetContractAuthorizationProposal": - return SetContractAuthorizationProposal.decode(data.value, undefined, true); - case "/publicawesome.stargaze.globalfee.v1.RemoveContractAuthorizationProposal": - return RemoveContractAuthorizationProposal.decode(data.value, undefined, true); - case "/regen.ecocredit.marketplace.v1.AllowDenomProposal": - return AllowDenomProposal.decode(data.value, undefined, true); - case "/regen.ecocredit.v1.CreditTypeProposal": - return CreditTypeProposal.decode(data.value, undefined, true); - default: - return data; - } -}; -export const Cosmos_govv1beta1Content_FromAmino = (content: AnyAmino) => { - switch (content.type) { - case "/alliance.alliance.MsgCreateAllianceProposal": - return Any.fromPartial({ - typeUrl: "/alliance.alliance.MsgCreateAllianceProposal", - value: MsgCreateAllianceProposal.encode(MsgCreateAllianceProposal.fromPartial(MsgCreateAllianceProposal.fromAmino(content.value))).finish() - }); - case "/alliance.alliance.MsgUpdateAllianceProposal": - return Any.fromPartial({ - typeUrl: "/alliance.alliance.MsgUpdateAllianceProposal", - value: MsgUpdateAllianceProposal.encode(MsgUpdateAllianceProposal.fromPartial(MsgUpdateAllianceProposal.fromAmino(content.value))).finish() - }); - case "/alliance.alliance.MsgDeleteAllianceProposal": - return Any.fromPartial({ - typeUrl: "/alliance.alliance.MsgDeleteAllianceProposal", - value: MsgDeleteAllianceProposal.encode(MsgDeleteAllianceProposal.fromPartial(MsgDeleteAllianceProposal.fromAmino(content.value))).finish() - }); - case "cosmos-sdk/v1/CommunityPoolSpendProposal": - return Any.fromPartial({ - typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal", - value: CommunityPoolSpendProposal.encode(CommunityPoolSpendProposal.fromPartial(CommunityPoolSpendProposal.fromAmino(content.value))).finish() - }); - case "cosmos-sdk/v1/CommunityPoolSpendProposalWithDeposit": - return Any.fromPartial({ - typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", - value: CommunityPoolSpendProposalWithDeposit.encode(CommunityPoolSpendProposalWithDeposit.fromPartial(CommunityPoolSpendProposalWithDeposit.fromAmino(content.value))).finish() - }); - case "cosmos-sdk/TextProposal": - return Any.fromPartial({ - typeUrl: "/cosmos.gov.v1beta1.TextProposal", - value: TextProposal.encode(TextProposal.fromPartial(TextProposal.fromAmino(content.value))).finish() - }); - case "cosmos-sdk/ParameterChangeProposal": - return Any.fromPartial({ - typeUrl: "/cosmos.params.v1beta1.ParameterChangeProposal", - value: ParameterChangeProposal.encode(ParameterChangeProposal.fromPartial(ParameterChangeProposal.fromAmino(content.value))).finish() - }); - case "cosmos-sdk/SoftwareUpgradeProposal": - return Any.fromPartial({ - typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", - value: SoftwareUpgradeProposal.encode(SoftwareUpgradeProposal.fromPartial(SoftwareUpgradeProposal.fromAmino(content.value))).finish() - }); - case "cosmos-sdk/CancelSoftwareUpgradeProposal": - return Any.fromPartial({ - typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", - value: CancelSoftwareUpgradeProposal.encode(CancelSoftwareUpgradeProposal.fromPartial(CancelSoftwareUpgradeProposal.fromAmino(content.value))).finish() - }); - case "wasm/StoreCodeProposal": - return Any.fromPartial({ - typeUrl: "/cosmwasm.wasm.v1.StoreCodeProposal", - value: StoreCodeProposal.encode(StoreCodeProposal.fromPartial(StoreCodeProposal.fromAmino(content.value))).finish() - }); - case "wasm/InstantiateContractProposal": - return Any.fromPartial({ - typeUrl: "/cosmwasm.wasm.v1.InstantiateContractProposal", - value: InstantiateContractProposal.encode(InstantiateContractProposal.fromPartial(InstantiateContractProposal.fromAmino(content.value))).finish() - }); - case "wasm/InstantiateContract2Proposal": - return Any.fromPartial({ - typeUrl: "/cosmwasm.wasm.v1.InstantiateContract2Proposal", - value: InstantiateContract2Proposal.encode(InstantiateContract2Proposal.fromPartial(InstantiateContract2Proposal.fromAmino(content.value))).finish() - }); - case "wasm/MigrateContractProposal": - return Any.fromPartial({ - typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal", - value: MigrateContractProposal.encode(MigrateContractProposal.fromPartial(MigrateContractProposal.fromAmino(content.value))).finish() - }); - case "wasm/SudoContractProposal": - return Any.fromPartial({ - typeUrl: "/cosmwasm.wasm.v1.SudoContractProposal", - value: SudoContractProposal.encode(SudoContractProposal.fromPartial(SudoContractProposal.fromAmino(content.value))).finish() - }); - case "wasm/ExecuteContractProposal": - return Any.fromPartial({ - typeUrl: "/cosmwasm.wasm.v1.ExecuteContractProposal", - value: ExecuteContractProposal.encode(ExecuteContractProposal.fromPartial(ExecuteContractProposal.fromAmino(content.value))).finish() - }); - case "wasm/UpdateAdminProposal": - return Any.fromPartial({ - typeUrl: "/cosmwasm.wasm.v1.UpdateAdminProposal", - value: UpdateAdminProposal.encode(UpdateAdminProposal.fromPartial(UpdateAdminProposal.fromAmino(content.value))).finish() - }); - case "wasm/ClearAdminProposal": - return Any.fromPartial({ - typeUrl: "/cosmwasm.wasm.v1.ClearAdminProposal", - value: ClearAdminProposal.encode(ClearAdminProposal.fromPartial(ClearAdminProposal.fromAmino(content.value))).finish() - }); - case "wasm/PinCodesProposal": - return Any.fromPartial({ - typeUrl: "/cosmwasm.wasm.v1.PinCodesProposal", - value: PinCodesProposal.encode(PinCodesProposal.fromPartial(PinCodesProposal.fromAmino(content.value))).finish() - }); - case "wasm/UnpinCodesProposal": - return Any.fromPartial({ - typeUrl: "/cosmwasm.wasm.v1.UnpinCodesProposal", - value: UnpinCodesProposal.encode(UnpinCodesProposal.fromPartial(UnpinCodesProposal.fromAmino(content.value))).finish() - }); - case "wasm/UpdateInstantiateConfigProposal": - return Any.fromPartial({ - typeUrl: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal", - value: UpdateInstantiateConfigProposal.encode(UpdateInstantiateConfigProposal.fromPartial(UpdateInstantiateConfigProposal.fromAmino(content.value))).finish() - }); - case "wasm/StoreAndInstantiateContractProposal": - return Any.fromPartial({ - typeUrl: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal", - value: StoreAndInstantiateContractProposal.encode(StoreAndInstantiateContractProposal.fromPartial(StoreAndInstantiateContractProposal.fromAmino(content.value))).finish() - }); - case "cosmos-sdk/ClientUpdateProposal": - return Any.fromPartial({ - typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", - value: ClientUpdateProposal.encode(ClientUpdateProposal.fromPartial(ClientUpdateProposal.fromAmino(content.value))).finish() - }); - case "cosmos-sdk/UpgradeProposal": - return Any.fromPartial({ - typeUrl: "/ibc.core.client.v1.UpgradeProposal", - value: UpgradeProposal.encode(UpgradeProposal.fromPartial(UpgradeProposal.fromAmino(content.value))).finish() - }); - case "osmosis/ReplaceMigrationRecordsProposal": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal", - value: ReplaceMigrationRecordsProposal.encode(ReplaceMigrationRecordsProposal.fromPartial(ReplaceMigrationRecordsProposal.fromAmino(content.value))).finish() - }); - case "osmosis/UpdateMigrationRecordsProposal": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal", - value: UpdateMigrationRecordsProposal.encode(UpdateMigrationRecordsProposal.fromPartial(UpdateMigrationRecordsProposal.fromAmino(content.value))).finish() - }); - case "osmosis/CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal", - value: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.encode(CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.fromPartial(CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.fromAmino(content.value))).finish() - }); - case "osmosis/SetScalingFactorControllerProposal": - return Any.fromPartial({ - typeUrl: "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal", - value: SetScalingFactorControllerProposal.encode(SetScalingFactorControllerProposal.fromPartial(SetScalingFactorControllerProposal.fromAmino(content.value))).finish() - }); - case "osmosis/incentives/create-groups-proposal": - return Any.fromPartial({ - typeUrl: "/osmosis.incentives.CreateGroupsProposal", - value: CreateGroupsProposal.encode(CreateGroupsProposal.fromPartial(CreateGroupsProposal.fromAmino(content.value))).finish() - }); - case "osmosis/ReplacePoolIncentivesProposal": - return Any.fromPartial({ - typeUrl: "/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal", - value: ReplacePoolIncentivesProposal.encode(ReplacePoolIncentivesProposal.fromPartial(ReplacePoolIncentivesProposal.fromAmino(content.value))).finish() - }); - case "osmosis/UpdatePoolIncentivesProposal": - return Any.fromPartial({ - typeUrl: "/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal", - value: UpdatePoolIncentivesProposal.encode(UpdatePoolIncentivesProposal.fromPartial(UpdatePoolIncentivesProposal.fromAmino(content.value))).finish() - }); - case "osmosis/SetProtoRevEnabledProposal": - return Any.fromPartial({ - typeUrl: "/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal", - value: SetProtoRevEnabledProposal.encode(SetProtoRevEnabledProposal.fromPartial(SetProtoRevEnabledProposal.fromAmino(content.value))).finish() - }); - case "osmosis/SetProtoRevAdminAccountProposal": - return Any.fromPartial({ - typeUrl: "/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal", - value: SetProtoRevAdminAccountProposal.encode(SetProtoRevAdminAccountProposal.fromPartial(SetProtoRevAdminAccountProposal.fromAmino(content.value))).finish() - }); - case "osmosis/set-superfluid-assets-proposal": - return Any.fromPartial({ - typeUrl: "/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal", - value: SetSuperfluidAssetsProposal.encode(SetSuperfluidAssetsProposal.fromPartial(SetSuperfluidAssetsProposal.fromAmino(content.value))).finish() - }); - case "osmosis/del-superfluid-assets-proposal": - return Any.fromPartial({ - typeUrl: "/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal", - value: RemoveSuperfluidAssetsProposal.encode(RemoveSuperfluidAssetsProposal.fromPartial(RemoveSuperfluidAssetsProposal.fromAmino(content.value))).finish() - }); - case "osmosis/update-unpool-whitelist": - return Any.fromPartial({ - typeUrl: "/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal", - value: UpdateUnpoolWhiteListProposal.encode(UpdateUnpoolWhiteListProposal.fromPartial(UpdateUnpoolWhiteListProposal.fromAmino(content.value))).finish() - }); - case "osmosis/UpdateFeeTokenProposal": - return Any.fromPartial({ - typeUrl: "/osmosis.txfees.v1beta1.UpdateFeeTokenProposal", - value: UpdateFeeTokenProposal.encode(UpdateFeeTokenProposal.fromPartial(UpdateFeeTokenProposal.fromAmino(content.value))).finish() - }); - case "/publicawesome.stargaze.cron.v1.PromoteToPrivilegedContractProposal": - return Any.fromPartial({ - typeUrl: "/publicawesome.stargaze.cron.v1.PromoteToPrivilegedContractProposal", - value: PromoteToPrivilegedContractProposal.encode(PromoteToPrivilegedContractProposal.fromPartial(PromoteToPrivilegedContractProposal.fromAmino(content.value))).finish() - }); - case "/publicawesome.stargaze.cron.v1.DemotePrivilegedContractProposal": - return Any.fromPartial({ - typeUrl: "/publicawesome.stargaze.cron.v1.DemotePrivilegedContractProposal", - value: DemotePrivilegedContractProposal.encode(DemotePrivilegedContractProposal.fromPartial(DemotePrivilegedContractProposal.fromAmino(content.value))).finish() - }); - case "/publicawesome.stargaze.globalfee.v1.SetCodeAuthorizationProposal": - return Any.fromPartial({ - typeUrl: "/publicawesome.stargaze.globalfee.v1.SetCodeAuthorizationProposal", - value: SetCodeAuthorizationProposal.encode(SetCodeAuthorizationProposal.fromPartial(SetCodeAuthorizationProposal.fromAmino(content.value))).finish() - }); - case "/publicawesome.stargaze.globalfee.v1.RemoveCodeAuthorizationProposal": - return Any.fromPartial({ - typeUrl: "/publicawesome.stargaze.globalfee.v1.RemoveCodeAuthorizationProposal", - value: RemoveCodeAuthorizationProposal.encode(RemoveCodeAuthorizationProposal.fromPartial(RemoveCodeAuthorizationProposal.fromAmino(content.value))).finish() - }); - case "/publicawesome.stargaze.globalfee.v1.SetContractAuthorizationProposal": - return Any.fromPartial({ - typeUrl: "/publicawesome.stargaze.globalfee.v1.SetContractAuthorizationProposal", - value: SetContractAuthorizationProposal.encode(SetContractAuthorizationProposal.fromPartial(SetContractAuthorizationProposal.fromAmino(content.value))).finish() - }); - case "/publicawesome.stargaze.globalfee.v1.RemoveContractAuthorizationProposal": - return Any.fromPartial({ - typeUrl: "/publicawesome.stargaze.globalfee.v1.RemoveContractAuthorizationProposal", - value: RemoveContractAuthorizationProposal.encode(RemoveContractAuthorizationProposal.fromPartial(RemoveContractAuthorizationProposal.fromAmino(content.value))).finish() - }); - case "/regen.ecocredit.marketplace.v1.AllowDenomProposal": - return Any.fromPartial({ - typeUrl: "/regen.ecocredit.marketplace.v1.AllowDenomProposal", - value: AllowDenomProposal.encode(AllowDenomProposal.fromPartial(AllowDenomProposal.fromAmino(content.value))).finish() - }); - case "/regen.ecocredit.v1.CreditTypeProposal": - return Any.fromPartial({ - typeUrl: "/regen.ecocredit.v1.CreditTypeProposal", - value: CreditTypeProposal.encode(CreditTypeProposal.fromPartial(CreditTypeProposal.fromAmino(content.value))).finish() - }); - default: - return Any.fromAmino(content); - } -}; -export const Cosmos_govv1beta1Content_ToAmino = (content: Any, useInterfaces: boolean = false) => { - switch (content.typeUrl) { - case "/alliance.alliance.MsgCreateAllianceProposal": - return { - type: "/alliance.alliance.MsgCreateAllianceProposal", - value: MsgCreateAllianceProposal.toAmino(MsgCreateAllianceProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/alliance.alliance.MsgUpdateAllianceProposal": - return { - type: "/alliance.alliance.MsgUpdateAllianceProposal", - value: MsgUpdateAllianceProposal.toAmino(MsgUpdateAllianceProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/alliance.alliance.MsgDeleteAllianceProposal": - return { - type: "/alliance.alliance.MsgDeleteAllianceProposal", - value: MsgDeleteAllianceProposal.toAmino(MsgDeleteAllianceProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal": - return { - type: "cosmos-sdk/v1/CommunityPoolSpendProposal", - value: CommunityPoolSpendProposal.toAmino(CommunityPoolSpendProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit": - return { - type: "cosmos-sdk/v1/CommunityPoolSpendProposalWithDeposit", - value: CommunityPoolSpendProposalWithDeposit.toAmino(CommunityPoolSpendProposalWithDeposit.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/cosmos.gov.v1beta1.TextProposal": - return { - type: "cosmos-sdk/TextProposal", - value: TextProposal.toAmino(TextProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/cosmos.params.v1beta1.ParameterChangeProposal": - return { - type: "cosmos-sdk/ParameterChangeProposal", - value: ParameterChangeProposal.toAmino(ParameterChangeProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal": - return { - type: "cosmos-sdk/SoftwareUpgradeProposal", - value: SoftwareUpgradeProposal.toAmino(SoftwareUpgradeProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal": - return { - type: "cosmos-sdk/CancelSoftwareUpgradeProposal", - value: CancelSoftwareUpgradeProposal.toAmino(CancelSoftwareUpgradeProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/cosmwasm.wasm.v1.StoreCodeProposal": - return { - type: "wasm/StoreCodeProposal", - value: StoreCodeProposal.toAmino(StoreCodeProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/cosmwasm.wasm.v1.InstantiateContractProposal": - return { - type: "wasm/InstantiateContractProposal", - value: InstantiateContractProposal.toAmino(InstantiateContractProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/cosmwasm.wasm.v1.InstantiateContract2Proposal": - return { - type: "wasm/InstantiateContract2Proposal", - value: InstantiateContract2Proposal.toAmino(InstantiateContract2Proposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/cosmwasm.wasm.v1.MigrateContractProposal": - return { - type: "wasm/MigrateContractProposal", - value: MigrateContractProposal.toAmino(MigrateContractProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/cosmwasm.wasm.v1.SudoContractProposal": - return { - type: "wasm/SudoContractProposal", - value: SudoContractProposal.toAmino(SudoContractProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/cosmwasm.wasm.v1.ExecuteContractProposal": - return { - type: "wasm/ExecuteContractProposal", - value: ExecuteContractProposal.toAmino(ExecuteContractProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/cosmwasm.wasm.v1.UpdateAdminProposal": - return { - type: "wasm/UpdateAdminProposal", - value: UpdateAdminProposal.toAmino(UpdateAdminProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/cosmwasm.wasm.v1.ClearAdminProposal": - return { - type: "wasm/ClearAdminProposal", - value: ClearAdminProposal.toAmino(ClearAdminProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/cosmwasm.wasm.v1.PinCodesProposal": - return { - type: "wasm/PinCodesProposal", - value: PinCodesProposal.toAmino(PinCodesProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/cosmwasm.wasm.v1.UnpinCodesProposal": - return { - type: "wasm/UnpinCodesProposal", - value: UnpinCodesProposal.toAmino(UnpinCodesProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal": - return { - type: "wasm/UpdateInstantiateConfigProposal", - value: UpdateInstantiateConfigProposal.toAmino(UpdateInstantiateConfigProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal": - return { - type: "wasm/StoreAndInstantiateContractProposal", - value: StoreAndInstantiateContractProposal.toAmino(StoreAndInstantiateContractProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/ibc.core.client.v1.ClientUpdateProposal": - return { - type: "cosmos-sdk/ClientUpdateProposal", - value: ClientUpdateProposal.toAmino(ClientUpdateProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/ibc.core.client.v1.UpgradeProposal": - return { - type: "cosmos-sdk/UpgradeProposal", - value: UpgradeProposal.toAmino(UpgradeProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal": - return { - type: "osmosis/ReplaceMigrationRecordsProposal", - value: ReplaceMigrationRecordsProposal.toAmino(ReplaceMigrationRecordsProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal": - return { - type: "osmosis/UpdateMigrationRecordsProposal", - value: UpdateMigrationRecordsProposal.toAmino(UpdateMigrationRecordsProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal": - return { - type: "osmosis/CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal", - value: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.toAmino(CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal": - return { - type: "osmosis/SetScalingFactorControllerProposal", - value: SetScalingFactorControllerProposal.toAmino(SetScalingFactorControllerProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/osmosis.incentives.CreateGroupsProposal": - return { - type: "osmosis/incentives/create-groups-proposal", - value: CreateGroupsProposal.toAmino(CreateGroupsProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal": - return { - type: "osmosis/ReplacePoolIncentivesProposal", - value: ReplacePoolIncentivesProposal.toAmino(ReplacePoolIncentivesProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal": - return { - type: "osmosis/UpdatePoolIncentivesProposal", - value: UpdatePoolIncentivesProposal.toAmino(UpdatePoolIncentivesProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal": - return { - type: "osmosis/SetProtoRevEnabledProposal", - value: SetProtoRevEnabledProposal.toAmino(SetProtoRevEnabledProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal": - return { - type: "osmosis/SetProtoRevAdminAccountProposal", - value: SetProtoRevAdminAccountProposal.toAmino(SetProtoRevAdminAccountProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal": - return { - type: "osmosis/set-superfluid-assets-proposal", - value: SetSuperfluidAssetsProposal.toAmino(SetSuperfluidAssetsProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal": - return { - type: "osmosis/del-superfluid-assets-proposal", - value: RemoveSuperfluidAssetsProposal.toAmino(RemoveSuperfluidAssetsProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal": - return { - type: "osmosis/update-unpool-whitelist", - value: UpdateUnpoolWhiteListProposal.toAmino(UpdateUnpoolWhiteListProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/osmosis.txfees.v1beta1.UpdateFeeTokenProposal": - return { - type: "osmosis/UpdateFeeTokenProposal", - value: UpdateFeeTokenProposal.toAmino(UpdateFeeTokenProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/publicawesome.stargaze.cron.v1.PromoteToPrivilegedContractProposal": - return { - type: "/publicawesome.stargaze.cron.v1.PromoteToPrivilegedContractProposal", - value: PromoteToPrivilegedContractProposal.toAmino(PromoteToPrivilegedContractProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/publicawesome.stargaze.cron.v1.DemotePrivilegedContractProposal": - return { - type: "/publicawesome.stargaze.cron.v1.DemotePrivilegedContractProposal", - value: DemotePrivilegedContractProposal.toAmino(DemotePrivilegedContractProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/publicawesome.stargaze.globalfee.v1.SetCodeAuthorizationProposal": - return { - type: "/publicawesome.stargaze.globalfee.v1.SetCodeAuthorizationProposal", - value: SetCodeAuthorizationProposal.toAmino(SetCodeAuthorizationProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/publicawesome.stargaze.globalfee.v1.RemoveCodeAuthorizationProposal": - return { - type: "/publicawesome.stargaze.globalfee.v1.RemoveCodeAuthorizationProposal", - value: RemoveCodeAuthorizationProposal.toAmino(RemoveCodeAuthorizationProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/publicawesome.stargaze.globalfee.v1.SetContractAuthorizationProposal": - return { - type: "/publicawesome.stargaze.globalfee.v1.SetContractAuthorizationProposal", - value: SetContractAuthorizationProposal.toAmino(SetContractAuthorizationProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/publicawesome.stargaze.globalfee.v1.RemoveContractAuthorizationProposal": - return { - type: "/publicawesome.stargaze.globalfee.v1.RemoveContractAuthorizationProposal", - value: RemoveContractAuthorizationProposal.toAmino(RemoveContractAuthorizationProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/regen.ecocredit.marketplace.v1.AllowDenomProposal": - return { - type: "/regen.ecocredit.marketplace.v1.AllowDenomProposal", - value: AllowDenomProposal.toAmino(AllowDenomProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - case "/regen.ecocredit.v1.CreditTypeProposal": - return { - type: "/regen.ecocredit.v1.CreditTypeProposal", - value: CreditTypeProposal.toAmino(CreditTypeProposal.decode(content.value, undefined, useInterfaces), useInterfaces) - }; - default: - return Any.toAmino(content, useInterfaces); - } -}; \ No newline at end of file From 1d6bb442a60f45f9f1d1c2c82fb100131a5ac4a7 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 14 Mar 2024 19:00:31 +0100 Subject: [PATCH 068/438] 2.4.0-rc.8 --- apps/dapp/package.json | 16 ++++++++-------- apps/sda/package.json | 16 ++++++++-------- lerna.json | 2 +- package.json | 2 +- packages/config/package.json | 2 +- packages/email/package.json | 6 +++--- packages/i18n/package.json | 4 ++-- packages/state/package.json | 8 ++++---- packages/stateful/package.json | 16 ++++++++-------- packages/stateless/package.json | 12 ++++++------ packages/storybook/package.json | 16 ++++++++-------- packages/types/package.json | 4 ++-- packages/utils/package.json | 6 +++--- 13 files changed, 55 insertions(+), 55 deletions(-) diff --git a/apps/dapp/package.json b/apps/dapp/package.json index edd438b1e..8811f51ff 100644 --- a/apps/dapp/package.json +++ b/apps/dapp/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/dapp", - "version": "2.4.0-rc.7", + "version": "2.4.0-rc.8", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -19,12 +19,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.4.0-rc.7", - "@dao-dao/state": "2.4.0-rc.7", - "@dao-dao/stateful": "2.4.0-rc.7", - "@dao-dao/stateless": "2.4.0-rc.7", - "@dao-dao/types": "2.4.0-rc.7", - "@dao-dao/utils": "2.4.0-rc.7", + "@dao-dao/i18n": "2.4.0-rc.8", + "@dao-dao/state": "2.4.0-rc.8", + "@dao-dao/stateful": "2.4.0-rc.8", + "@dao-dao/stateless": "2.4.0-rc.8", + "@dao-dao/types": "2.4.0-rc.8", + "@dao-dao/utils": "2.4.0-rc.8", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -50,7 +50,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.7", + "@dao-dao/config": "2.4.0-rc.8", "@next/bundle-analyzer": "^14.1.0", "@sentry/cli": "^2.21.3", "@solana/web3.js": "^1.75.0", diff --git a/apps/sda/package.json b/apps/sda/package.json index 2f6af80a7..9e81b2fb6 100644 --- a/apps/sda/package.json +++ b/apps/sda/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/sda", - "version": "2.4.0-rc.7", + "version": "2.4.0-rc.8", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -17,12 +17,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.4.0-rc.7", - "@dao-dao/state": "2.4.0-rc.7", - "@dao-dao/stateful": "2.4.0-rc.7", - "@dao-dao/stateless": "2.4.0-rc.7", - "@dao-dao/types": "2.4.0-rc.7", - "@dao-dao/utils": "2.4.0-rc.7", + "@dao-dao/i18n": "2.4.0-rc.8", + "@dao-dao/state": "2.4.0-rc.8", + "@dao-dao/stateful": "2.4.0-rc.8", + "@dao-dao/stateless": "2.4.0-rc.8", + "@dao-dao/types": "2.4.0-rc.8", + "@dao-dao/utils": "2.4.0-rc.8", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -48,7 +48,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.7", + "@dao-dao/config": "2.4.0-rc.8", "@next/bundle-analyzer": "^12.1.0", "@sentry/cli": "^2.21.3", "@solana/web3.js": "^1.75.0", diff --git a/lerna.json b/lerna.json index 5a979b0b2..db03e707f 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", "useWorkspaces": true, - "version": "2.4.0-rc.7" + "version": "2.4.0-rc.8" } diff --git a/package.json b/package.json index 5c45cfaf5..192520cc4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dao-dao-ui", - "version": "2.4.0-rc.7", + "version": "2.4.0-rc.8", "workspaces": [ "apps/*", "packages/*" diff --git a/packages/config/package.json b/packages/config/package.json index 47c279dcf..f0f4b6755 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/config", - "version": "2.4.0-rc.7", + "version": "2.4.0-rc.8", "license": "BSD-3-Clause-Clear", "dependencies": { "@tailwindcss/typography": "^0.5.1", diff --git a/packages/email/package.json b/packages/email/package.json index 249dc3362..ead86e5aa 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/email", - "version": "2.4.0-rc.7", + "version": "2.4.0-rc.8", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -10,8 +10,8 @@ }, "devDependencies": { "@aws-sdk/client-ses": "^3.354.0", - "@dao-dao/config": "2.4.0-rc.7", - "@dao-dao/types": "2.4.0-rc.7", + "@dao-dao/config": "2.4.0-rc.8", + "@dao-dao/types": "2.4.0-rc.8", "@react-email/components": "^0.0.7", "@react-email/render": "0.0.7", "commander": "^11.0.0", diff --git a/packages/i18n/package.json b/packages/i18n/package.json index a3c868a74..e12a72e62 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/i18n", - "version": "2.4.0-rc.7", + "version": "2.4.0-rc.8", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -17,7 +17,7 @@ "react-i18next": "^11.0.0" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.7", + "@dao-dao/config": "2.4.0-rc.8", "eslint-plugin-i18n-json": "^3.1.0", "i18n-unused": "^0.10.0" }, diff --git a/packages/state/package.json b/packages/state/package.json index e9f5ff930..0af27c450 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/state", - "version": "2.4.0-rc.7", + "version": "2.4.0-rc.8", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc && npm run build:gql", @@ -15,7 +15,7 @@ "@cosmjs/encoding": "^0.32.1", "@cosmjs/proto-signing": "^0.32.1", "@cosmjs/stargate": "^0.32.1", - "@dao-dao/utils": "2.4.0-rc.7", + "@dao-dao/utils": "2.4.0-rc.8", "graphql": "^16.8.1", "json5": "^2.2.0", "lodash.uniq": "^4.5.0", @@ -25,8 +25,8 @@ }, "devDependencies": { "@cosmos-kit/core": "^2.8.9", - "@dao-dao/config": "2.4.0-rc.7", - "@dao-dao/types": "2.4.0-rc.7", + "@dao-dao/config": "2.4.0-rc.8", + "@dao-dao/types": "2.4.0-rc.8", "@graphql-codegen/cli": "^5.0.0", "@graphql-codegen/client-preset": "^4.1.0", "@graphql-typed-document-node/core": "^3.2.0", diff --git a/packages/stateful/package.json b/packages/stateful/package.json index a74ed680e..061371abc 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateful", - "version": "2.4.0-rc.7", + "version": "2.4.0-rc.8", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -38,10 +38,10 @@ "@cosmos-kit/vectis": "^2.6.9", "@cosmos-kit/web3auth": "^2.5.9", "@cosmos-kit/xdefi": "^2.5.9", - "@dao-dao/i18n": "2.4.0-rc.7", - "@dao-dao/state": "2.4.0-rc.7", - "@dao-dao/stateless": "2.4.0-rc.7", - "@dao-dao/utils": "2.4.0-rc.7", + "@dao-dao/i18n": "2.4.0-rc.8", + "@dao-dao/state": "2.4.0-rc.8", + "@dao-dao/stateless": "2.4.0-rc.8", + "@dao-dao/utils": "2.4.0-rc.8", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -75,8 +75,8 @@ "devDependencies": { "@chain-registry/types": "^0.17.1", "@cosmjs/amino": "^0.32.1", - "@dao-dao/config": "2.4.0-rc.7", - "@dao-dao/types": "2.4.0-rc.7", + "@dao-dao/config": "2.4.0-rc.8", + "@dao-dao/types": "2.4.0-rc.8", "@storybook/react": "^6.5.10", "@types/file-saver": "^2.0.5", "@types/lodash.clonedeep": "^4.5.0", @@ -96,7 +96,7 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/storybook": "2.4.0-rc.7", + "@dao-dao/storybook": "2.4.0-rc.8", "next": "^12 || ^13", "react": "^17 || ^18" }, diff --git a/packages/stateless/package.json b/packages/stateless/package.json index f78f77216..cdfe7f32c 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateless", - "version": "2.4.0-rc.7", + "version": "2.4.0-rc.8", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -9,8 +9,8 @@ }, "dependencies": { "@cosmjs/encoding": "^0.32.1", - "@dao-dao/types": "2.4.0-rc.7", - "@dao-dao/utils": "2.4.0-rc.7", + "@dao-dao/types": "2.4.0-rc.8", + "@dao-dao/utils": "2.4.0-rc.8", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -45,7 +45,7 @@ "devDependencies": { "@chain-registry/types": "^0.17.1", "@cosmos-kit/core": "^2.8.9", - "@dao-dao/config": "2.4.0-rc.7", + "@dao-dao/config": "2.4.0-rc.8", "@storybook/react": "^6.5.10", "@types/lodash.clonedeep": "^4.5.0", "@types/react": "^17.0.37", @@ -68,8 +68,8 @@ "unist-util-visit-parents": "^5.1.3" }, "peerDependencies": { - "@dao-dao/stateful": "2.4.0-rc.7", - "@dao-dao/storybook": "2.4.0-rc.7", + "@dao-dao/stateful": "2.4.0-rc.8", + "@dao-dao/storybook": "2.4.0-rc.8", "next": "^12 || ^13", "react": "^17 || ^18", "react-dom": "^17 || ^18" diff --git a/packages/storybook/package.json b/packages/storybook/package.json index ec5f426b2..c2fcf9c7e 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/storybook", - "version": "2.4.0-rc.7", + "version": "2.4.0-rc.8", "license": "BSD-3-Clause-Clear", "scripts": { "build": "build-storybook", @@ -8,10 +8,10 @@ "generate": "ts-node --esm ./scripts/generate.ts" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.7", - "@dao-dao/i18n": "2.4.0-rc.7", - "@dao-dao/types": "2.4.0-rc.7", - "@dao-dao/utils": "2.4.0-rc.7", + "@dao-dao/config": "2.4.0-rc.8", + "@dao-dao/i18n": "2.4.0-rc.8", + "@dao-dao/types": "2.4.0-rc.8", + "@dao-dao/utils": "2.4.0-rc.8", "@storybook/addon-actions": "^6.5.12", "@storybook/addon-essentials": "^6.5.12", "@storybook/addon-links": "^6.5.12", @@ -45,9 +45,9 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/state": "2.4.0-rc.7", - "@dao-dao/stateful": "2.4.0-rc.7", - "@dao-dao/stateless": "2.4.0-rc.7" + "@dao-dao/state": "2.4.0-rc.8", + "@dao-dao/stateful": "2.4.0-rc.8", + "@dao-dao/stateless": "2.4.0-rc.8" }, "prettier": "@dao-dao/config/prettier", "gitHead": "67c8ffb27c34ee37b9367d3fde6856085081f40c" diff --git a/packages/types/package.json b/packages/types/package.json index 7f3e88bcc..37bdcee52 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/types", - "version": "2.4.0-rc.7", + "version": "2.4.0-rc.8", "license": "BSD-3-Clause-Clear", "scripts": { "lint": "eslint .", @@ -22,7 +22,7 @@ "typescript": "5.3.3" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.7", + "@dao-dao/config": "2.4.0-rc.8", "@cosmology/telescope": "^1.4.12" }, "peerDependencies": { diff --git a/packages/utils/package.json b/packages/utils/package.json index ec4012005..533ac8b07 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/utils", - "version": "2.4.0-rc.7", + "version": "2.4.0-rc.8", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -13,7 +13,7 @@ "@cosmjs/encoding": "^0.32.1", "@cosmjs/stargate": "^0.32.1", "@cosmjs/tendermint-rpc": "^0.32.1", - "@dao-dao/types": "2.4.0-rc.7", + "@dao-dao/types": "2.4.0-rc.8", "@sentry/nextjs": "^7.7.0", "@types/lodash.clonedeep": "^4.5.0", "@types/ripemd160": "^2.0.0", @@ -36,7 +36,7 @@ "devDependencies": { "@chain-registry/types": "^0.17.1", "@cosmjs/proto-signing": "^0.32.1", - "@dao-dao/config": "2.4.0-rc.7", + "@dao-dao/config": "2.4.0-rc.8", "cosmjs-types": "^0.9.0", "jest": "^29.1.1", "next": "^13.3.0", From 32939319c3e8ecae0b7872565ca31abca314179a Mon Sep 17 00:00:00 2001 From: ismellike Date: Thu, 14 Mar 2024 18:41:31 -0500 Subject: [PATCH 069/438] Nft unstaking duration (#1694) --- .../components/nft/NftSelectionModal.tsx | 32 ++++++++++++++++++- .../components/StakingModal.tsx | 2 ++ packages/types/nft.ts | 2 ++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/packages/stateful/components/nft/NftSelectionModal.tsx b/packages/stateful/components/nft/NftSelectionModal.tsx index dc3f4fd2e..339ab0295 100644 --- a/packages/stateful/components/nft/NftSelectionModal.tsx +++ b/packages/stateful/components/nft/NftSelectionModal.tsx @@ -17,6 +17,7 @@ import { PAGINATION_MIN_PAGE, Pagination, SearchBar, + TooltipInfoIcon, } from '@dao-dao/stateless' import { useButtonPopupFilter, useSearchFilter } from '@dao-dao/stateless/hooks' import { @@ -26,7 +27,11 @@ import { NftSelectionModalProps, TypedOption, } from '@dao-dao/types' -import { getChainForChainId, getDisplayNameForChainId } from '@dao-dao/utils' +import { + convertDurationToHumanReadableString, + getChainForChainId, + getDisplayNameForChainId, +} from '@dao-dao/utils' import { LazyNftCard } from './LazyNftCard' @@ -51,6 +56,7 @@ export const NftSelectionModal = ({ headerDisplay, headerContent, noneDisplay, + unstakingDuration, ...modalProps }: NftSelectionModalProps) => { const { t } = useTranslation() @@ -204,6 +210,30 @@ export const NftSelectionModal = ({ headerContent={ headerDisplay || showHeaderNftControls || headerContent ? (
+ {unstakingDuration && + ('height' in unstakingDuration + ? unstakingDuration.height + : unstakingDuration.time) > 0 && ( +
+

+ {t('title.unstakingPeriod') + + `: ${convertDurationToHumanReadableString( + t, + unstakingDuration + )}`} +

+ +
+ )} + {headerDisplay} {showHeaderNftControls && ( diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/StakingModal.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/StakingModal.tsx index 77f1f8df6..103f2962b 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/StakingModal.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/StakingModal.tsx @@ -73,6 +73,7 @@ const InnerStakingModal = ({ refreshClaims, loadingWalletStakedNfts, loadingWalletUnstakedNfts, + unstakingDuration, } = useStakingInfo({ fetchClaims: true, fetchTotalStakedValue: false, @@ -284,6 +285,7 @@ const InnerStakingModal = ({ selectedKeys={currentTokenIds.map((tokenId) => getNftKey(chainId, collectionAddress, tokenId) )} + unstakingDuration={unstakingDuration} visible={visible} /> ) diff --git a/packages/types/nft.ts b/packages/types/nft.ts index 75845ce64..aabdac3ba 100644 --- a/packages/types/nft.ts +++ b/packages/types/nft.ts @@ -7,6 +7,7 @@ import { ModalProps, StatefulEntityDisplayProps, } from './components' +import { Duration } from './contracts/common' import { ContractInfoResponse } from './contracts/Cw721Base' import { LoadingDataWithError } from './misc' import { GenericToken } from './token' @@ -164,4 +165,5 @@ export type NftSelectionModalProps = Omit & headerDisplay?: ReactNode // What displays when there are no NFTs. noneDisplay?: ReactNode + unstakingDuration?: Duration | null } From 32b24a31ba642188eff4490f813b9b9bf3f35b36 Mon Sep 17 00:00:00 2001 From: noah Date: Fri, 15 Mar 2024 08:34:11 -0700 Subject: [PATCH 070/438] Add Migaloo token factory migration action (#1698) --- packages/i18n/locales/en/translation.json | 4 + packages/state/recoil/selectors/contract.ts | 27 ++-- .../stateful/creators/TokenBased/mutate.ts | 2 +- .../Component.stories.tsx | 28 ++++ .../Component.tsx | 15 +++ .../MigrateMigalooV4TokenFactory/README.md | 20 +++ .../MigrateMigalooV4TokenFactory/index.tsx | 127 ++++++++++++++++++ .../actions/Mint/index.tsx | 28 +++- .../DaoVotingTokenStaked/actions/index.ts | 1 + .../adapters/DaoVotingTokenStaked/index.ts | 7 + .../components/actions/ActionLibrary.tsx | 113 +++++++++------- packages/stateless/components/emoji.tsx | 4 + packages/types/actions.ts | 7 + packages/types/chain.ts | 5 +- packages/utils/constants/chains.ts | 24 ++-- packages/utils/constants/contracts.ts | 3 +- 16 files changed, 337 insertions(+), 78 deletions(-) create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/MigrateMigalooV4TokenFactory/Component.stories.tsx create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/MigrateMigalooV4TokenFactory/Component.tsx create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/MigrateMigalooV4TokenFactory/README.md create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/MigrateMigalooV4TokenFactory/index.tsx diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 6a1d4e4f5..628ad965a 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -336,6 +336,7 @@ "pick": "Mining pick", "playPause": "Play pause", "printer": "Printer", + "pufferfish": "Pufferfish", "raisedHand": "Raised hand", "recycle": "Recycle", "robot": "Robot", @@ -1058,7 +1059,9 @@ "mergeProfilesExplanation": "Select the profile you want to keep (the rest will be merged into it).", "mergeProfilesTooltip": "Your wallet is attached to multiple profiles. Merge them to avoid confusion.", "migrateFollowingDescription": "Followed DAOs require a migration to a new storage mechanism.", + "migrateMigalooV4TokenFactoryExplanation": "The token factory module on Migaloo has been migrated to a new version that is more actively maintained. Because this DAO created a new token before the migration, the DAO's token factory contract that interacts with the chain module must now be upgraded. This action upgrades the token factory contract to a version that supports the new token factory module.", "migrateSmartContractActionDescription": "Migrate a CosmWasm contract to a new code ID.", + "migrateTokenFactoryModuleDescription": "Update the DAO to support the new token factory module.", "minimumOutputRequiredDescription_dao": "Before the proposal is passed and executed, the swap price will fluctuate. If the price drops and no longer satisfies this minimum output required, the swap will not occur.", "minimumOutputRequiredDescription_gov": "Before the proposal is passed and executed, the swap price will fluctuate. If the price drops and no longer satisfies this minimum output required, the swap will not occur.", "minimumOutputRequiredDescription_wallet": "The exact swap price will fluctuate during the transaction, but the minimum output amount is guaranteed. If the price drops and no longer satisfies this minimum output required, the swap will not occur.", @@ -1644,6 +1647,7 @@ "mergeProfiles": "Merge Profiles", "migrateFollowing": "Migrate Followed DAOs", "migrateSmartContract": "Migrate Smart Contract", + "migrateTokenFactoryModule": "Migrate Token Factory Module", "minimumOutputRequired": "Minimum output required", "mint": "Mint", "mintNft": "Mint NFT", diff --git a/packages/state/recoil/selectors/contract.ts b/packages/state/recoil/selectors/contract.ts index d22177079..f08194e25 100644 --- a/packages/state/recoil/selectors/contract.ts +++ b/packages/state/recoil/selectors/contract.ts @@ -1,4 +1,4 @@ -import { CodeDetails } from '@cosmjs/cosmwasm-stargate' +import { CodeDetails, Contract } from '@cosmjs/cosmwasm-stargate' import { fromUtf8, toUtf8 } from '@cosmjs/encoding' import { selectorFamily } from 'recoil' @@ -58,25 +58,30 @@ export const contractInstantiateTimeSelector = selectorFamily< }, }) -export const contractAdminSelector = selectorFamily< - string | undefined, +export const contractDetailsSelector = selectorFamily< + Contract, WithChainId<{ contractAddress: string }> >({ - key: 'contractAdmin', + key: 'contractDetails', get: ({ contractAddress, chainId }) => async ({ get }) => { const client = get(cosmWasmClientForChainSelector(chainId)) - - try { - const contract = await client.getContract(contractAddress) - return contract.admin - } catch (_) { - return undefined - } + return await client.getContract(contractAddress) }, }) +export const contractAdminSelector = selectorFamily< + string | undefined, + WithChainId<{ contractAddress: string }> +>({ + key: 'contractAdmin', + get: + (params) => + ({ get }) => + get(contractDetailsSelector(params))?.admin, +}) + export const codeDetailsSelector = selectorFamily< CodeDetails, WithChainId<{ codeId: number }> diff --git a/packages/stateful/creators/TokenBased/mutate.ts b/packages/stateful/creators/TokenBased/mutate.ts index bf9248818..82f0e31f4 100644 --- a/packages/stateful/creators/TokenBased/mutate.ts +++ b/packages/stateful/creators/TokenBased/mutate.ts @@ -82,7 +82,7 @@ export const mutate: DaoCreatorMutate = ( active_threshold, token_info: { new: { - token_issuer_code_id: codeIds.CwTokenfactoryIssuer, + token_issuer_code_id: codeIds.CwTokenfactoryIssuerOsmosis, subdenom: symbol.toLowerCase(), initial_balances: microInitialBalances, initial_dao_balance: microInitialTreasuryBalance, diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/MigrateMigalooV4TokenFactory/Component.stories.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/MigrateMigalooV4TokenFactory/Component.stories.tsx new file mode 100644 index 000000000..dad35aed0 --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/MigrateMigalooV4TokenFactory/Component.stories.tsx @@ -0,0 +1,28 @@ +import { ComponentMeta, ComponentStory } from '@storybook/react' + +import { makeReactHookFormDecorator } from '@dao-dao/storybook' + +import { + MigrateMigalooV4TokenFactoryComponent, + MigrateMigalooV4TokenFactoryData, +} from './Component' + +export default { + title: + 'DAO DAO / packages / stateful / voting-module-adapter / adapters / DaoVotingTokenStaked / actions / MigrateMigalooV4TokenFactory', + component: MigrateMigalooV4TokenFactoryComponent, + decorators: [makeReactHookFormDecorator()], +} as ComponentMeta + +const Template: ComponentStory = ( + args +) => + +export const Default = Template.bind({}) +Default.args = { + fieldNamePrefix: '', + allActionsWithData: [], + index: 0, + data: {}, + isCreating: true, +} diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/MigrateMigalooV4TokenFactory/Component.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/MigrateMigalooV4TokenFactory/Component.tsx new file mode 100644 index 000000000..498018679 --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/MigrateMigalooV4TokenFactory/Component.tsx @@ -0,0 +1,15 @@ +import { useTranslation } from 'react-i18next' + +import { ActionComponent } from '@dao-dao/types' + +export type MigrateMigalooV4TokenFactoryData = {} + +export const MigrateMigalooV4TokenFactoryComponent: ActionComponent = () => { + const { t } = useTranslation() + + return ( +

+ {t('info.migrateMigalooV4TokenFactoryExplanation')} +

+ ) +} diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/MigrateMigalooV4TokenFactory/README.md b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/MigrateMigalooV4TokenFactory/README.md new file mode 100644 index 000000000..5d1b05472 --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/MigrateMigalooV4TokenFactory/README.md @@ -0,0 +1,20 @@ +# MigrateMigalooV4TokenFactory + +Migrate `cw-tokenfactory-issuer` from the CosmWasm x/tokenfactory implementation +to Osmosis's x/tokenfactory. Migaloo is migrating tokenfactory modules, so this +is needed to help DAO's update to the latest contract. + +## Bulk import format + +This is relevant when bulk importing actions, as described in [this +guide](https://github.com/DA0-DA0/dao-dao-ui/wiki/Bulk-importing-actions). + +### Key + +`migrateMigalooV4TokenFactory` + +### Data format + +```json +{} +``` diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/MigrateMigalooV4TokenFactory/index.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/MigrateMigalooV4TokenFactory/index.tsx new file mode 100644 index 000000000..38a79c099 --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/MigrateMigalooV4TokenFactory/index.tsx @@ -0,0 +1,127 @@ +import { useCallback } from 'react' + +import { + DaoVotingTokenStakedSelectors, + contractDetailsSelector, +} from '@dao-dao/state/recoil' +import { PufferfishEmoji, useCachedLoadable } from '@dao-dao/stateless' +import { ChainId } from '@dao-dao/types' +import { + ActionChainContextType, + ActionKey, + ActionMaker, + UseDecodedCosmosMsg, + UseDefaults, + UseHideFromPicker, + UseTransformToCosmos, +} from '@dao-dao/types/actions' +import { makeWasmMessage, objectMatchesStructure } from '@dao-dao/utils' + +import { useVotingModuleAdapterOptions } from '../../../../react/context' +import { useGovernanceTokenInfo } from '../../hooks' +import { + MigrateMigalooV4TokenFactoryComponent, + MigrateMigalooV4TokenFactoryData, +} from './Component' + +const useDefaults: UseDefaults = () => ({}) + +export const makeMigrateMigalooV4TokenFactoryAction: ActionMaker< + MigrateMigalooV4TokenFactoryData +> = ({ t, chainContext }) => { + // Only Migaloo DAOs need to migrate. + if ( + chainContext.chainId !== ChainId.MigalooMainnet || + chainContext.type !== ActionChainContextType.Supported + ) { + return null + } + + const useTransformToCosmos: UseTransformToCosmos< + MigrateMigalooV4TokenFactoryData + > = () => { + const { tokenFactoryIssuerAddress } = useGovernanceTokenInfo() + + return useCallback( + () => + makeWasmMessage({ + wasm: { + migrate: { + contract_addr: tokenFactoryIssuerAddress, + new_code_id: + chainContext.config.codeIds.CwTokenfactoryIssuerOsmosis, + msg: {}, + }, + }, + }), + [tokenFactoryIssuerAddress] + ) + } + + const useDecodedCosmosMsg: UseDecodedCosmosMsg< + MigrateMigalooV4TokenFactoryData + > = (msg: Record) => { + const { tokenFactoryIssuerAddress } = useGovernanceTokenInfo() + + return objectMatchesStructure(msg, { + wasm: { + migrate: { + contract_addr: {}, + new_code_id: {}, + msg: {}, + }, + }, + }) && msg.wasm.migrate.contract_addr === tokenFactoryIssuerAddress + ? { + match: true, + data: {}, + } + : { + match: false, + } + } + + // Only show in picker if using cw-tokenfactory-issuer contract and it's on the + // old version of the contract. + const useHideFromPicker: UseHideFromPicker = () => { + const { chainId, votingModuleAddress } = useVotingModuleAdapterOptions() + + const tfIssuer = useCachedLoadable( + DaoVotingTokenStakedSelectors.validatedTokenfactoryIssuerContractSelector( + { + contractAddress: votingModuleAddress, + chainId, + } + ) + ) + const tfIssuerContract = useCachedLoadable( + tfIssuer.state === 'hasValue' && tfIssuer.contents + ? contractDetailsSelector({ + contractAddress: tfIssuer.contents, + chainId, + }) + : undefined + ) + + return ( + !chainContext.config.codeIds.CwTokenfactoryIssuerCosmWasm || + tfIssuerContract.state !== 'hasValue' || + tfIssuerContract.contents.codeId !== + chainContext.config.codeIds.CwTokenfactoryIssuerCosmWasm + ) + } + + return { + key: ActionKey.MigrateMigalooV4TokenFactory, + Icon: PufferfishEmoji, + label: t('title.migrateTokenFactoryModule'), + description: t('info.migrateTokenFactoryModuleDescription'), + Component: MigrateMigalooV4TokenFactoryComponent, + useDefaults, + useTransformToCosmos, + useDecodedCosmosMsg, + useHideFromPicker, + // Show at the top. + order: 1000, + } +} diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/Mint/index.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/Mint/index.tsx index 47da816dc..c013cc160 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/Mint/index.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/Mint/index.tsx @@ -1,8 +1,13 @@ import { useCallback } from 'react' -import { DaoVotingTokenStakedSelectors } from '@dao-dao/state/recoil' +import { + DaoVotingTokenStakedSelectors, + contractDetailsSelector, +} from '@dao-dao/state/recoil' import { HerbEmoji, useCachedLoadable } from '@dao-dao/stateless' +import { ChainId } from '@dao-dao/types' import { + ActionChainContextType, ActionComponent, ActionKey, ActionMaker, @@ -18,6 +23,7 @@ import { objectMatchesStructure, } from '@dao-dao/utils' +import { useActionOptions } from '../../../../../actions' import { AddressInput } from '../../../../../components/AddressInput' import { useVotingModuleAdapterOptions } from '../../../../react/context' import { useGovernanceTokenInfo } from '../../hooks' @@ -108,6 +114,7 @@ const Component: ActionComponent = (props) => { // Only show in picker if using cw-tokenfactory-issuer contract. const useHideFromPicker: UseHideFromPicker = () => { const { chainId, votingModuleAddress } = useVotingModuleAdapterOptions() + const { chainContext } = useActionOptions() const tfIssuer = useCachedLoadable( DaoVotingTokenStakedSelectors.validatedTokenfactoryIssuerContractSelector({ @@ -115,8 +122,25 @@ const useHideFromPicker: UseHideFromPicker = () => { chainId, }) ) + const tfIssuerContract = useCachedLoadable( + tfIssuer.state === 'hasValue' && tfIssuer.contents + ? contractDetailsSelector({ + contractAddress: tfIssuer.contents, + chainId, + }) + : undefined + ) - return tfIssuer.state !== 'hasValue' || !tfIssuer.contents + return ( + tfIssuer.state !== 'hasValue' || + !tfIssuer.contents || + // Disallow minting on Miagloo if cw-tokenfactory-issuer is on old version. + (chainContext.chainId === ChainId.MigalooMainnet && + chainContext.type === ActionChainContextType.Supported && + (tfIssuerContract.state !== 'hasValue' || + tfIssuerContract.contents.codeId === + chainContext.config.codeIds.CwTokenfactoryIssuerCosmWasm)) + ) } export const makeMintAction: ActionMaker = ({ t, address }) => { diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/index.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/index.ts index 8775b26d2..d3f20b749 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/index.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/index.ts @@ -1,3 +1,4 @@ +export * from './MigrateMigalooV4TokenFactory' export * from './Mint' export * from './UpdateMinterAllowance' export * from './UpdateStakingConfig' diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/index.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/index.ts index 29d22aa27..7d21353f0 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/index.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/index.ts @@ -12,6 +12,7 @@ import { } from '@dao-dao/utils' import { + makeMigrateMigalooV4TokenFactoryAction, makeMintAction, makeUpdateMinterAllowanceAction, makeUpdateStakingConfigAction, @@ -51,6 +52,11 @@ export const DaoVotingTokenStakedAdapter: VotingModuleAdapter = { // Functions fields: { actionCategoryMakers: [ + () => ({ + // Add to Commonly Used category. + key: ActionCategoryKey.CommonlyUsed, + actionMakers: [makeMigrateMigalooV4TokenFactoryAction], + }), () => ({ // Add to DAO Governance category. key: ActionCategoryKey.DaoGovernance, @@ -58,6 +64,7 @@ export const DaoVotingTokenStakedAdapter: VotingModuleAdapter = { makeMintAction, makeUpdateMinterAllowanceAction, makeUpdateStakingConfigAction, + makeMigrateMigalooV4TokenFactoryAction, ], }), ], diff --git a/packages/stateless/components/actions/ActionLibrary.tsx b/packages/stateless/components/actions/ActionLibrary.tsx index 00ea0be1b..dffcd0b7e 100644 --- a/packages/stateless/components/actions/ActionLibrary.tsx +++ b/packages/stateless/components/actions/ActionLibrary.tsx @@ -130,9 +130,30 @@ export const ActionLibrary = ({ ? categories.find((c) => c.key === categoryKeySelected) : undefined - const showingActions = categoryKeySelected - ? (selectedCategory || categories[0]).actions - : filteredActions.slice(0, 10).map(({ item }) => item) + const showingActions = ( + categoryKeySelected + ? (selectedCategory || categories[0]).actions + : filteredActions.slice(0, 10).map(({ item }) => item) + ) + .filter( + (action) => + // Never show programmatic actions. + !action.programmaticOnly && + // Show if reusable or not already used. + (!action.notReusable || + !actionData.some((a) => a.actionKey === action.key)) + ) + .sort((a, b) => + a.order !== undefined && b.order !== undefined + ? a.order - b.order + : // Prioritize the action with an order set. + a.order + ? -1 + : b.order + ? 1 + : // Leave them sorted by the original order in the category definition. + 0 + ) // Ensure selected item is scrolled into view. useEffect(() => { @@ -284,54 +305,44 @@ export const ActionLibrary = ({ className="flex min-w-0 grow flex-col gap-2 pt-1 md:pb-1" ref={itemsListRef} > - {showingActions - .filter( - (action) => - // Never show programmatic actions. - !action.programmaticOnly && - // Show if reusable or not already used. - (!action.notReusable || - !actionData.some((a) => a.actionKey === action.key)) - ) - .map((action, index) => ( - - ))} + {showingActions.map((action, index) => ( + + ))}
diff --git a/packages/stateless/components/emoji.tsx b/packages/stateless/components/emoji.tsx index 345820d70..229082db6 100644 --- a/packages/stateless/components/emoji.tsx +++ b/packages/stateless/components/emoji.tsx @@ -272,3 +272,7 @@ export const ComputerDiskEmoji = () => ( export const PlayPauseEmoji = () => ( ) + +export const PufferfishEmoji = () => ( + +) diff --git a/packages/types/actions.ts b/packages/types/actions.ts index 9b57b3bb0..095ed8237 100644 --- a/packages/types/actions.ts +++ b/packages/types/actions.ts @@ -81,6 +81,7 @@ export enum ActionKey { ManageSubDaoPause = 'manageSubDaoPause', UpdatePreProposeConfig = 'updatePreProposeConfig', UpdateProposalConfig = 'updateProposalConfig', + MigrateMigalooV4TokenFactory = 'migrateMigalooV4TokenFactory', // Press CreatePost = 'createPost', UpdatePost = 'updatePost', @@ -191,6 +192,12 @@ export interface Action { // and `notReusable`, while also preventing the user from going back to the // category action picker or removing the action. programmaticOnly?: boolean + /** + * Order of this action in the list of actions. A greater number will be shown + * first. If no order specified, actions will be sorted based on their + * position in the category definition. + */ + order?: number // Hook to get default fields for form display. useDefaults: UseDefaults // Hook to make function to convert action data to CosmosMsgFor_Empty. diff --git a/packages/types/chain.ts b/packages/types/chain.ts index 598721785..94eb32d8e 100644 --- a/packages/types/chain.ts +++ b/packages/types/chain.ts @@ -175,7 +175,7 @@ export type CodeIdConfig = { // https://github.com/DA0-DA0/dao-contracts CwPayrollFactory: number CwTokenSwap: number - CwTokenfactoryIssuer: number + CwTokenfactoryIssuerOsmosis: number CwVesting: number DaoCore: number DaoMigrator: number @@ -189,6 +189,9 @@ export type CodeIdConfig = { DaoVotingCw721Staked: number DaoVotingTokenStaked: number + // For migrating Migaloo DAOs from cosmwasm to osmosis x/tokenfactory. + CwTokenfactoryIssuerCosmWasm?: number + // For migrating v1 to v2 DAOs, and some chains use CW20s. Cw20Base?: number Cw20Stake?: number diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index f90b4eb7b..2fc09b8f0 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -72,7 +72,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 4042, CwTokenSwap: 4043, - CwTokenfactoryIssuer: 4045, + CwTokenfactoryIssuerOsmosis: 4045, CwVesting: 4046, DaoCore: 4047, DaoMigrator: 4048, @@ -249,7 +249,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 353, CwTokenSwap: 354, - CwTokenfactoryIssuer: 364, + CwTokenfactoryIssuerOsmosis: 364, CwVesting: 355, DaoCore: 365, DaoMigrator: -1, // not needed since only v2 DAOs exist @@ -441,7 +441,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 553, CwTokenSwap: 564, - CwTokenfactoryIssuer: 565, + CwTokenfactoryIssuerOsmosis: 565, CwVesting: 703, DaoCore: 567, DaoMigrator: -1, // not needed since only v2 DAOs exist @@ -572,7 +572,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 148, CwTokenSwap: 149, - CwTokenfactoryIssuer: 150, + CwTokenfactoryIssuerOsmosis: 150, CwVesting: 151, DaoCore: 153, DaoMigrator: -1, // not needed since only v2 DAOs exist @@ -742,7 +742,8 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 286, CwTokenSwap: 287, - CwTokenfactoryIssuer: 288, + CwTokenfactoryIssuerOsmosis: 401, + CwTokenfactoryIssuerCosmWasm: 288, CwVesting: 290, DaoCore: 291, DaoMigrator: -1, @@ -897,7 +898,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 2631, CwTokenSwap: 2632, - CwTokenfactoryIssuer: 2633, + CwTokenfactoryIssuerOsmosis: 2633, CwVesting: 2634, DaoCore: 2635, DaoMigrator: -1, @@ -1029,7 +1030,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 1550, CwTokenSwap: 1551, - CwTokenfactoryIssuer: 1552, + CwTokenfactoryIssuerOsmosis: 1552, CwVesting: 1553, DaoCore: 1554, DaoMigrator: -1, @@ -1110,7 +1111,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 4062, CwTokenSwap: 4063, - CwTokenfactoryIssuer: 4065, + CwTokenfactoryIssuerOsmosis: 4065, CwVesting: 4066, DaoCore: 4067, DaoMigrator: 4068, @@ -1158,7 +1159,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 5841, CwTokenSwap: 5842, - CwTokenfactoryIssuer: 5843, + CwTokenfactoryIssuerOsmosis: 5843, CwVesting: 5844, DaoCore: 5845, DaoMigrator: -1, // not needed since only v2 DAOs exist @@ -1200,7 +1201,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 3461, CwTokenSwap: 3462, - CwTokenfactoryIssuer: 3463, + CwTokenfactoryIssuerOsmosis: 3463, CwVesting: 3464, DaoCore: 3465, DaoMigrator: -1, // not needed since only v2 DAOs exist @@ -1244,7 +1245,8 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 3, CwTokenSwap: 4, - CwTokenfactoryIssuer: 5, + CwTokenfactoryIssuerOsmosis: 65, + CwTokenfactoryIssuerCosmWasm: 5, CwVesting: 6, DaoCore: 7, DaoMigrator: -1, diff --git a/packages/utils/constants/contracts.ts b/packages/utils/constants/contracts.ts index 5b44efc31..aadd5e4e7 100644 --- a/packages/utils/constants/contracts.ts +++ b/packages/utils/constants/contracts.ts @@ -4,7 +4,8 @@ export enum ContractName { Cw3FixedMultisig = 'crates.io:cw3-fixed-multisig', Cw3FlexMultisig = 'crates.io:cw3-flex-multisig', CwTokenSwap = 'crates.io:cw-token-swap', - CwTokenfactoryIssuer = 'crates.io:cw-tokenfactory-issuer', + // This contract left out the `crates.io:` prefix. + CwTokenfactoryIssuer = 'cw-tokenfactory-issuer', PolytoneProxy = 'crates.io:polytone-proxy', PreProposeSingle = 'crates.io:dao-pre-propose-single', PreProposeApprovalSingle = 'crates.io:dao-pre-propose-approval-single', From af1f8e7e31f8ab9a345d8064ef5b4003d9f15e9e Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 18 Mar 2024 15:11:24 +0100 Subject: [PATCH 071/438] fix chain ID bug --- .../components/inbox/InboxMainItemRenderer.tsx | 12 ++++++++++-- .../components/inbox/renderers/JoinedDao.tsx | 5 +++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/stateful/components/inbox/InboxMainItemRenderer.tsx b/packages/stateful/components/inbox/InboxMainItemRenderer.tsx index 26fd51da2..7ca8709c7 100644 --- a/packages/stateful/components/inbox/InboxMainItemRenderer.tsx +++ b/packages/stateful/components/inbox/InboxMainItemRenderer.tsx @@ -3,7 +3,7 @@ import clsx from 'clsx' import { ComponentType, useCallback } from 'react' import { useTranslation } from 'react-i18next' -import { IconButton, Tooltip, WarningCard } from '@dao-dao/stateless' +import { IconButton, Loader, Tooltip, WarningCard } from '@dao-dao/stateless' import { InboxItemRendererProps, InboxItemType, @@ -11,6 +11,7 @@ import { } from '@dao-dao/types' import { useInboxApi } from '../../hooks' +import { SuspenseLoader } from '../SuspenseLoader' import { JoinedDaoRenderer, ProposalRenderer } from './renderers' export const InboxMainItemRenderer = ({ @@ -29,7 +30,14 @@ export const InboxMainItemRenderer = ({
- + }> + +
) => { + // `chainId` is occasionally undefined. + if (item.chainId && !chainId) { + chainId = item.chainId + } + const { t } = useTranslation() const { getDaoPath } = useDaoNavHelpers() const { setFollowing, updatingFollowing } = useFollowingDaos(chainId) From 198872a576b9de988ac9700a80b7e1fcb21727ee Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 18 Mar 2024 16:08:24 +0100 Subject: [PATCH 072/438] ignored sentry error --- apps/dapp/sentry.client.config.js | 1 + apps/sda/sentry.client.config.js | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/dapp/sentry.client.config.js b/apps/dapp/sentry.client.config.js index 13c97f099..79bbacf03 100644 --- a/apps/dapp/sentry.client.config.js +++ b/apps/dapp/sentry.client.config.js @@ -39,5 +39,6 @@ Sentry.init({ "Cannot assign to read only property 'keplr' of object '#'", 'out of gas in location', 'Load failed', + "'defineProperty' on proxy: trap returned falsish for property 'request'", ], }) diff --git a/apps/sda/sentry.client.config.js b/apps/sda/sentry.client.config.js index 93bcc81d1..586e685d6 100644 --- a/apps/sda/sentry.client.config.js +++ b/apps/sda/sentry.client.config.js @@ -39,5 +39,6 @@ Sentry.init({ "Cannot assign to read only property 'keplr' of object '#'", 'out of gas in location', 'Load failed', + "'defineProperty' on proxy: trap returned falsish for property 'request'", ], }) From ce9e2ce9c24ffe9cd3c9d6069ea736fdc05cdf4b Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 18 Mar 2024 17:20:51 +0100 Subject: [PATCH 073/438] fixed unsetting NFT staked voting module owner for old contracts when updating unstaking duration --- packages/state/contracts/NeutronVault.ts | 3 +-- .../actions/UpdateStakingConfig/index.ts | 20 ++++++++++++---- .../hooks/useStakingInfo.ts | 24 ++++++++++++------- .../adapters/DaoVotingCw721Staked/types.ts | 2 ++ packages/types/contracts/NeutronVault.ts | 7 ------ packages/types/features.ts | 4 ++++ packages/utils/features.ts | 1 + 7 files changed, 40 insertions(+), 21 deletions(-) diff --git a/packages/state/contracts/NeutronVault.ts b/packages/state/contracts/NeutronVault.ts index 3fe371715..92a877342 100644 --- a/packages/state/contracts/NeutronVault.ts +++ b/packages/state/contracts/NeutronVault.ts @@ -11,12 +11,11 @@ import { SigningCosmWasmClient, } from '@cosmjs/cosmwasm-stargate' -import { Addr, Uint128 } from '@dao-dao/types' +import { Addr, InfoResponse, Uint128 } from '@dao-dao/types' import { ArrayOfTupleOfAddrAndUint128, BondingStatusResponse, Config, - InfoResponse, TotalPowerAtHeightResponse, VotingPowerAtHeightResponse, } from '@dao-dao/types/contracts/NeutronVault' diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/actions/UpdateStakingConfig/index.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/actions/UpdateStakingConfig/index.ts index bddfdf908..82faab0c9 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/actions/UpdateStakingConfig/index.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/actions/UpdateStakingConfig/index.ts @@ -1,7 +1,7 @@ import { useCallback } from 'react' -import { GearEmoji } from '@dao-dao/stateless' -import { DurationUnits } from '@dao-dao/types' +import { GearEmoji, useDaoInfoContext } from '@dao-dao/stateless' +import { DurationUnits, Feature } from '@dao-dao/types' import { ActionKey, ActionMaker, @@ -12,6 +12,7 @@ import { import { convertDurationToDurationWithUnits, convertDurationWithUnitsToDuration, + isFeatureSupportedByVersion, makeWasmMessage, objectMatchesStructure, } from '@dao-dao/utils' @@ -39,7 +40,8 @@ const useDefaults: UseDefaults = () => { const useTransformToCosmos: UseTransformToCosmos< UpdateStakingConfigData > = () => { - const { stakingContractAddress } = useStakingInfo() + const { coreAddress } = useDaoInfoContext() + const { stakingContractVersion, stakingContractAddress } = useStakingInfo() return useCallback( ({ unstakingDurationEnabled, unstakingDuration }) => @@ -50,6 +52,16 @@ const useTransformToCosmos: UseTransformToCosmos< funds: [], msg: { update_config: { + // Prevent unsetting the NFT contract owner when updating config + // if using an old contract version. + ...(!isFeatureSupportedByVersion( + Feature.DaoVotingCw721StakedNoOwner, + stakingContractVersion + ) + ? { + owner: coreAddress, + } + : {}), duration: unstakingDurationEnabled ? convertDurationWithUnitsToDuration(unstakingDuration) : null, @@ -58,7 +70,7 @@ const useTransformToCosmos: UseTransformToCosmos< }, }, }), - [stakingContractAddress] + [coreAddress, stakingContractAddress, stakingContractVersion] ) } diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/hooks/useStakingInfo.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/hooks/useStakingInfo.ts index cfec44008..6d7f91727 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/hooks/useStakingInfo.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/hooks/useStakingInfo.ts @@ -10,6 +10,7 @@ import { CommonNftSelectors, DaoVotingCw721StakedSelectors, blockHeightSelector, + contractVersionSelector, refreshClaimsIdAtom, refreshWalletBalancesIdAtom, } from '@dao-dao/state' @@ -41,14 +42,20 @@ export const useStakingInfo = ({ const { collectionAddress: governanceTokenAddress } = useGovernanceCollectionInfo() - const unstakingDuration = + const [stakingContractVersion, { unstaking_duration: unstakingDuration }] = useRecoilValue( - DaoVotingCw721StakedSelectors.configSelector({ - chainId, - contractAddress: votingModuleAddress, - params: [], - }) - ).unstaking_duration ?? undefined + waitForAll([ + contractVersionSelector({ + chainId, + contractAddress: votingModuleAddress, + }), + DaoVotingCw721StakedSelectors.configSelector({ + chainId, + contractAddress: votingModuleAddress, + params: [], + }), + ]) + ) const setRefreshTotalBalancesId = useSetRecoilState( refreshWalletBalancesIdAtom(undefined) @@ -181,8 +188,9 @@ export const useStakingInfo = ({ ) return { + stakingContractVersion, stakingContractAddress: votingModuleAddress, - unstakingDuration, + unstakingDuration: unstakingDuration ?? undefined, refreshTotals, /// Optional // Claims diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/types.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/types.ts index 12c8875d8..825de80f9 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/types.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/types.ts @@ -1,4 +1,5 @@ import { + ContractVersion, Duration, GenericToken, LoadingData, @@ -15,6 +16,7 @@ export interface UseStakingInfoOptions { } export interface UseStakingInfoResponse { + stakingContractVersion: ContractVersion stakingContractAddress: string unstakingDuration?: Duration refreshTotals: () => void diff --git a/packages/types/contracts/NeutronVault.ts b/packages/types/contracts/NeutronVault.ts index 6a60a2257..3fa82a695 100644 --- a/packages/types/contracts/NeutronVault.ts +++ b/packages/types/contracts/NeutronVault.ts @@ -78,13 +78,6 @@ export interface Config { name: string owner: Addr } -export interface InfoResponse { - info: ContractVersion -} -export interface ContractVersion { - contract: string - version: string -} export type ArrayOfTupleOfAddrAndUint128 = [Addr, Uint128][] export interface TotalPowerAtHeightResponse { height: number diff --git a/packages/types/features.ts b/packages/types/features.ts index 0f8797e8c..b7c79dbd8 100644 --- a/packages/types/features.ts +++ b/packages/types/features.ts @@ -61,6 +61,10 @@ export enum Feature { * outcome has already been determined. */ VoteUntilExpiration, + /** + * Owner was removed from dao-voting-cw721-staked. + */ + DaoVotingCw721StakedNoOwner, /** * A `funds` field was added to module instantiate messages (such as when * adding proposal modules). diff --git a/packages/utils/features.ts b/packages/utils/features.ts index e6de67b49..4c6ab5a73 100644 --- a/packages/utils/features.ts +++ b/packages/utils/features.ts @@ -23,6 +23,7 @@ export const isFeatureSupportedByVersion = ( case Feature.StaticProposalModulePrefixes: case Feature.VoteUntilExpiration: return versionGte(version, ContractVersion.V2Alpha) + case Feature.DaoVotingCw721StakedNoOwner: case Feature.ModuleInstantiateFunds: return versionGte(version, ContractVersion.V230) case Feature.VotingModuleTokenTypeFix: From a1198342bd6c178b7780164f4f109f5ac6dcd94d Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 19 Mar 2024 11:34:21 +0100 Subject: [PATCH 074/438] sort proposal modules in update config --- .../dao_governance/UpdatePreProposeConfig/index.tsx | 11 +++++++---- .../dao_governance/UpdateProposalConfig/index.tsx | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/stateful/actions/core/dao_governance/UpdatePreProposeConfig/index.tsx b/packages/stateful/actions/core/dao_governance/UpdatePreProposeConfig/index.tsx index a9e67faab..0af2225e3 100644 --- a/packages/stateful/actions/core/dao_governance/UpdatePreProposeConfig/index.tsx +++ b/packages/stateful/actions/core/dao_governance/UpdatePreProposeConfig/index.tsx @@ -26,8 +26,8 @@ const useUpdatePreProposeConfigActions = (): ProposalModuleWithAction[] => { const proposalModuleActions = useMemo( () => - proposalModules.flatMap( - (proposalModule): ProposalModuleWithAction | [] => { + proposalModules + .flatMap((proposalModule): ProposalModuleWithAction | [] => { const action = matchAndLoadCommon(proposalModule, { chain: options.chain, coreAddress, @@ -39,8 +39,11 @@ const useUpdatePreProposeConfigActions = (): ProposalModuleWithAction[] => { action, } : [] - } - ), + }) + // Sort proposal modules by prefix. + .sort((a, b) => + a.proposalModule.prefix.localeCompare(b.proposalModule.prefix) + ), [coreAddress, options, proposalModules] ) diff --git a/packages/stateful/actions/core/dao_governance/UpdateProposalConfig/index.tsx b/packages/stateful/actions/core/dao_governance/UpdateProposalConfig/index.tsx index c8e606cb6..46a55fc1b 100644 --- a/packages/stateful/actions/core/dao_governance/UpdateProposalConfig/index.tsx +++ b/packages/stateful/actions/core/dao_governance/UpdateProposalConfig/index.tsx @@ -26,8 +26,8 @@ const useUpdateProposalConfigActions = (): ProposalModuleWithAction[] => { const proposalModuleActions = useMemo( () => - proposalModules.flatMap( - (proposalModule): ProposalModuleWithAction | [] => { + proposalModules + .flatMap((proposalModule): ProposalModuleWithAction | [] => { const action = matchAndLoadCommon(proposalModule, { chain: options.chain, coreAddress, @@ -39,8 +39,11 @@ const useUpdateProposalConfigActions = (): ProposalModuleWithAction[] => { action, } : [] - } - ), + }) + // Sort proposal modules by prefix. + .sort((a, b) => + a.proposalModule.prefix.localeCompare(b.proposalModule.prefix) + ), [coreAddress, options, proposalModules] ) From 5585aed1862a784c051a635a031f0335c0f009a3 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 19 Mar 2024 16:22:46 +0100 Subject: [PATCH 075/438] use different migaloo RPC --- packages/utils/constants/chains.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 2fc09b8f0..c4825d3ec 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -1315,8 +1315,8 @@ export const CHAIN_ENDPOINTS: Partial< rest: 'https://terra-api.polkachu.com', }, [ChainId.MigalooMainnet]: { - rpc: 'https://migaloo-rpc.polkachu.com', - rest: 'https://migaloo-api.polkachu.com', + rpc: 'https://rpc.cosmos.directory/migaloo', + rest: 'https://rest.cosmos.directory/migaloo', }, [ChainId.MigalooTestnet]: { rpc: 'https://migaloo-testnet-rpc.polkachu.com', From 8f6422621de323e97c6c7a40c8c6252140469f6e Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 20 Mar 2024 11:50:39 +0100 Subject: [PATCH 076/438] Revert "use different migaloo RPC" This reverts commit 5585aed1862a784c051a635a031f0335c0f009a3. --- packages/utils/constants/chains.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index c4825d3ec..2fc09b8f0 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -1315,8 +1315,8 @@ export const CHAIN_ENDPOINTS: Partial< rest: 'https://terra-api.polkachu.com', }, [ChainId.MigalooMainnet]: { - rpc: 'https://rpc.cosmos.directory/migaloo', - rest: 'https://rest.cosmos.directory/migaloo', + rpc: 'https://migaloo-rpc.polkachu.com', + rest: 'https://migaloo-api.polkachu.com', }, [ChainId.MigalooTestnet]: { rpc: 'https://migaloo-testnet-rpc.polkachu.com', From 841cd0069aca897da268991b928d7563322e74f8 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 21 Mar 2024 11:09:14 +0100 Subject: [PATCH 077/438] load TVL from snapper --- packages/state/recoil/selectors/treasury.ts | 60 ++++--------------- .../components/dao/MainDaoInfoCards.tsx | 8 +-- .../stateful/recoil/selectors/dao/cards.ts | 18 +----- 3 files changed, 14 insertions(+), 72 deletions(-) diff --git a/packages/state/recoil/selectors/treasury.ts b/packages/state/recoil/selectors/treasury.ts index a8a3678d2..1d96fdff5 100644 --- a/packages/state/recoil/selectors/treasury.ts +++ b/packages/state/recoil/selectors/treasury.ts @@ -1,6 +1,6 @@ import { parseCoins } from '@cosmjs/proto-signing' import { IndexedTx } from '@cosmjs/stargate' -import { selectorFamily, waitForAll, waitForAllSettled } from 'recoil' +import { selectorFamily, waitForAll } from 'recoil' import { AmountWithTimestamp, WithChainId } from '@dao-dao/types' import { @@ -8,13 +8,12 @@ import { getTokenForChainIdAndDenom, } from '@dao-dao/utils' -import { allBalancesSelector } from './account' import { blockHeightTimestampSafeSelector, communityPoolBalancesSelector, cosmWasmClientForChainSelector, } from './chain' -import { allNftUsdValueSelector } from './nft' +import { querySnapperSelector } from './indexer' import { usdPriceSelector } from './token' type TreasuryTransactionsParams = WithChainId<{ @@ -165,63 +164,24 @@ export const daoTvlSelector = selectorFamily< AmountWithTimestamp, WithChainId<{ coreAddress: string - cw20GovernanceTokenAddress?: string }> >({ key: 'daoTvl', get: - ({ chainId, coreAddress, cw20GovernanceTokenAddress }) => + ({ chainId, coreAddress }) => ({ get }) => { const timestamp = new Date() - const allBalances = get( - allBalancesSelector({ - chainId, - address: coreAddress, - cw20GovernanceTokenAddress, + const amount = get( + querySnapperSelector({ + query: 'daodao-tvl', + parameters: { + chainId, + address: coreAddress, + }, }) ) - const usdPrices = get( - waitForAllSettled( - allBalances.map(({ token }) => - usdPriceSelector({ - type: token.type, - denomOrAddress: token.denomOrAddress, - chainId: token.chainId, - }) - ) - ) - ) - - const nftAmount = get( - allNftUsdValueSelector({ - chainId, - address: coreAddress, - }) - ) - - const amount = - nftAmount + - allBalances - .map(({ token, balance }, index) => { - // Don't calculate price if could not load token decimals correctly. - if (token.decimals === 0) { - return 0 - } - - const price = - (usdPrices[index].state === 'hasValue' && - usdPrices[index].getValue()?.usdPrice) || - 0 - return ( - price && - convertMicroDenomToDenomWithDecimals(balance, token.decimals) * - price - ) - }) - .reduce((price, total) => price + total, 0) - return { amount, timestamp, diff --git a/packages/stateful/components/dao/MainDaoInfoCards.tsx b/packages/stateful/components/dao/MainDaoInfoCards.tsx index d76d940ce..fb3a6e5a9 100644 --- a/packages/stateful/components/dao/MainDaoInfoCards.tsx +++ b/packages/stateful/components/dao/MainDaoInfoCards.tsx @@ -17,10 +17,7 @@ import { formatPercentOf100, } from '@dao-dao/utils' -import { - useCw20CommonGovernanceTokenInfoIfExists, - useVotingModuleAdapter, -} from '../../voting-module-adapter' +import { useVotingModuleAdapter } from '../../voting-module-adapter' import { EntityDisplay } from '../EntityDisplay' import { SuspenseLoader } from '../SuspenseLoader' @@ -46,15 +43,12 @@ const InnerMainDaoInfoCards = () => { const { coreAddress, activeThreshold, created, proposalModules } = useDaoInfoContext() - const { denomOrAddress: cw20GovernanceTokenAddress } = - useCw20CommonGovernanceTokenInfoIfExists() ?? {} const tokenInfo = useCommonGovernanceTokenInfo?.() const treasuryUsdcValueLoading = useCachedLoading( daoTvlSelector({ coreAddress, chainId, - cw20GovernanceTokenAddress, }), { amount: -1, diff --git a/packages/stateful/recoil/selectors/dao/cards.ts b/packages/stateful/recoil/selectors/dao/cards.ts index 7505222df..faebb3efd 100644 --- a/packages/stateful/recoil/selectors/dao/cards.ts +++ b/packages/stateful/recoil/selectors/dao/cards.ts @@ -38,11 +38,7 @@ import { } from '@dao-dao/utils' import { proposalModuleAdapterProposalCountSelector } from '../../../proposal-module-adapter' -import { - daoCoreProposalModulesSelector, - daoCw20GovernanceTokenAddressSelector, - daoInfoSelector, -} from './misc' +import { daoCoreProposalModulesSelector, daoInfoSelector } from './misc' export const daoCardInfoSelector = selectorFamily< DaoCardInfo | undefined, @@ -237,20 +233,12 @@ export const daoCardInfoLazyDataSelector = selectorFamily< get: ({ coreAddress, chainId, walletAddress }) => ({ get }) => { - const cw20GovernanceTokenAddress = get( - daoCw20GovernanceTokenAddressSelector({ - coreAddress, - chainId, - }) - ) - - const tvl = get( + const { amount: tvl } = get( daoTvlSelector({ coreAddress, chainId, - cw20GovernanceTokenAddress, }) - ).amount + ) const walletVotingWeight = walletAddress ? Number( From 39c1dc973f4ca88ffed369868ce3eb14eadfd894 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 21 Mar 2024 11:28:04 +0100 Subject: [PATCH 078/438] fixed TVL selector --- packages/state/recoil/selectors/treasury.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/state/recoil/selectors/treasury.ts b/packages/state/recoil/selectors/treasury.ts index 1d96fdff5..3708f1ca5 100644 --- a/packages/state/recoil/selectors/treasury.ts +++ b/packages/state/recoil/selectors/treasury.ts @@ -172,7 +172,7 @@ export const daoTvlSelector = selectorFamily< ({ get }) => { const timestamp = new Date() - const amount = get( + const { total: amount } = get( querySnapperSelector({ query: 'daodao-tvl', parameters: { From 16d061b4449b4feec14831e65587073789ef44f1 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 25 Mar 2024 14:56:51 +0100 Subject: [PATCH 079/438] added metadata field to v1 gov creation --- packages/i18n/locales/en/translation.json | 1 + .../GovernanceProposal/Component.tsx | 27 +++++++++++++++++++ .../GovernanceProposal/index.tsx | 7 ++++- packages/types/gov.ts | 1 + 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 628ad965a..855bffb00 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -1645,6 +1645,7 @@ "members": "Members", "membership": "Membership", "mergeProfiles": "Merge Profiles", + "metadata": "Metadata", "migrateFollowing": "Migrate Followed DAOs", "migrateSmartContract": "Migrate Smart Contract", "migrateTokenFactoryModule": "Migrate Token Factory Module", diff --git a/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.tsx b/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.tsx index 91fb2ceca..7bfaab360 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.tsx @@ -290,6 +290,33 @@ export const GovernanceProposalComponent: ActionComponent<
+ {supportsV1GovProposals && ( +
+ + +
+ + +
+
+ )} + { // Support expedited field on Osmosis. (chainId === ChainId.OsmosisMainnet || diff --git a/packages/stateful/actions/core/chain_governance/GovernanceProposal/index.tsx b/packages/stateful/actions/core/chain_governance/GovernanceProposal/index.tsx index 2e0f88998..caf5e2940 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceProposal/index.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceProposal/index.tsx @@ -327,6 +327,7 @@ export const makeGovernanceProposalAction: ActionMaker< : GovProposalVersion.V1_BETA_1, title: '', description: '', + metadata: '', deposit: deposit ? [ { @@ -365,6 +366,7 @@ export const makeGovernanceProposalAction: ActionMaker< version, title, description, + metadata, deposit, legacyContent, msgs, @@ -414,7 +416,8 @@ export const makeGovernanceProposalAction: ActionMaker< summary: description, // In case it's undefined, default to false. expedited: expedited || false, - metadata: title, + // Metadata must be set, so just use the title as a fallback. + metadata: metadata.trim() || title, } as MsgSubmitProposalV1, }, }) @@ -482,6 +485,7 @@ export const makeGovernanceProposalAction: ActionMaker< version: GovProposalVersion.V1_BETA_1, title: proposal.content.title, description: proposal.content.description, + metadata: '', deposit: proposal.initialDeposit.map(({ amount, ...coin }) => ({ ...coin, amount: Number(amount), @@ -528,6 +532,7 @@ export const makeGovernanceProposalAction: ActionMaker< version: GovProposalVersion.V1, title: proposal.title, description: proposal.summary, + metadata: proposal.metadata, deposit: proposal.initialDeposit.map(({ amount, ...coin }) => ({ ...coin, amount: Number(amount), diff --git a/packages/types/gov.ts b/packages/types/gov.ts index 322cd6482..4b209ecea 100644 --- a/packages/types/gov.ts +++ b/packages/types/gov.ts @@ -148,6 +148,7 @@ export type GovernanceProposalActionData = { version: GovProposalVersion title: string description: string + metadata: string deposit: { amount: number denom: string From a8667dca75f2e4d1beca58bd0dd58c3c28600abc Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 25 Mar 2024 15:45:28 +0100 Subject: [PATCH 080/438] fixed stories --- .../chain_governance/GovernanceProposal/Component.stories.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.stories.tsx b/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.stories.tsx index 2b55b385d..5a19132d7 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.stories.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceProposal/Component.stories.tsx @@ -35,6 +35,7 @@ Default.args = { title: 'Upgrade to v10 Alpha 1', description: 'Full details on the testnets github. Target binary is v10.0.0-alpha.2', + metadata: '', deposit: [ { amount: 100, From 9760667f05c5893f02b42127468672eb66a8713c Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 25 Mar 2024 15:52:07 +0100 Subject: [PATCH 081/438] fixed wrong token balance --- packages/state/recoil/selectors/token.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/state/recoil/selectors/token.ts b/packages/state/recoil/selectors/token.ts index b24bad9c6..4e34cfcc7 100644 --- a/packages/state/recoil/selectors/token.ts +++ b/packages/state/recoil/selectors/token.ts @@ -31,10 +31,10 @@ import { astroportUsdPriceSelector } from './astroport' import { denomMetadataSelector, ibcRpcClientForChainSelector, - nativeBalanceSelector, nativeBalancesSelector, nativeDelegatedBalanceSelector, nativeDelegationInfoSelector, + nativeDenomBalanceSelector, } from './chain' import { isDaoSelector } from './contract' import { Cw20BaseSelectors, DaoCoreV2Selectors } from './contracts' @@ -406,9 +406,10 @@ export const genericTokenBalanceSelector = selectorFamily< let balance = '0' if (token.type === TokenType.Native) { balance = get( - nativeBalanceSelector({ - address, + nativeDenomBalanceSelector({ chainId: params.chainId, + walletAddress: address, + denom: params.denomOrAddress, }) ).amount } else if (token.type === TokenType.Cw20) { From 097066b4bbb5db40928d762f3cbe4ae06988e78d Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 25 Mar 2024 17:42:12 +0100 Subject: [PATCH 082/438] hold alt to submit gov prop with direct signing --- .../components/gov/NewGovProposal.tsx | 37 +++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/packages/stateful/components/gov/NewGovProposal.tsx b/packages/stateful/components/gov/NewGovProposal.tsx index dc7d4b95d..00da46585 100644 --- a/packages/stateful/components/gov/NewGovProposal.tsx +++ b/packages/stateful/components/gov/NewGovProposal.tsx @@ -1,5 +1,6 @@ import { fromBase64 } from '@cosmjs/encoding' import { EncodeObject } from '@cosmjs/proto-signing' +import { SigningStargateClient } from '@cosmjs/stargate' import { BookOutlined, Close, @@ -48,6 +49,7 @@ import { ProposalContentDisplay, Tooltip, useConfiguredChainContext, + useHoldingKey, } from '@dao-dao/stateless' import { Action, @@ -70,6 +72,8 @@ import { formatTime, getGovProposalPath, getImageUrlForChainId, + getRpcForChainId, + getSignerOptions, govProposalActionDataToDecodedContent, isCosmWasmStargateMsg, processError, @@ -132,8 +136,13 @@ const InnerNewGovProposal = ({ const { t } = useTranslation() const router = useRouter() const chainContext = useConfiguredChainContext() - const { isWalletConnected, getSigningStargateClient, chain, chainWallet } = - useWallet() + const { + isWalletConnected, + getOfflineSignerAmino, + getOfflineSignerDirect, + chain, + chainWallet, + } = useWallet() const [loading, setLoading] = useState(false) @@ -174,6 +183,8 @@ const InnerNewGovProposal = ({ }) ) + const holdingAltForDirectSign = useHoldingKey({ key: 'alt' }) + const onSubmitError: SubmitErrorHandler = useCallback(() => { setShowSubmitErrorNote(true) @@ -270,9 +281,16 @@ const InnerNewGovProposal = ({ setLoading(true) try { - const { events } = await ( - await getSigningStargateClient() - ).signAndBroadcast( + const signer = holdingAltForDirectSign + ? getOfflineSignerDirect() + : getOfflineSignerAmino() + const signingClient = await SigningStargateClient.connectWithSigner( + getRpcForChainId(chain.chain_id), + signer, + getSignerOptions(chain) + ) + + const { events } = await signingClient.signAndBroadcast( walletAddress, [encodeObject], CHAIN_GAS_MULTIPLIER @@ -371,7 +389,9 @@ const InnerNewGovProposal = ({ t, transformGovernanceProposalActionDataToCosmos, walletAddress, - getSigningStargateClient, + getOfflineSignerAmino, + getOfflineSignerDirect, + holdingAltForDirectSign, chainContext.chainId, chainContext.chain.pretty_name, chainContext.config.name, @@ -561,7 +581,10 @@ const InnerNewGovProposal = ({ type="submit" value={ProposeSubmitValue.Submit} > -

{t('button.publish')}

+

+ {t('button.publish') + + (holdingAltForDirectSign ? ` (${t('info.direct')})` : '')} +

From 48e41ef1db0e19e90851488ff4550925e3741cb1 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 27 Mar 2024 01:51:30 +0100 Subject: [PATCH 083/438] improved DAO member card UX --- packages/config/tailwind/colors.js | 4 ++ .../components/MembersTab.tsx | 14 ++-- .../actions/ManageMembers/index.tsx | 2 + .../DaoVotingCw4/components/MembersTab.tsx | 8 +-- .../components/MembersTab.tsx | 14 ++-- .../components/MembersTab.tsx | 14 ++-- .../components/MembersTab.tsx | 14 ++-- .../stateless/ProposalCreationForm.tsx | 2 + .../components/dao/DaoMemberCard.stories.tsx | 28 +++++--- .../components/dao/DaoMemberCard.tsx | 71 +++++++++++++------ .../components/dao/tabs/MembersTab.tsx | 11 +-- packages/stateless/styles/index.css | 5 ++ packages/types/components/DaoMemberCard.ts | 11 +-- .../types/components/TokenAmountDisplay.ts | 4 +- packages/utils/conversion.ts | 24 +++++-- 15 files changed, 143 insertions(+), 83 deletions(-) diff --git a/packages/config/tailwind/colors.js b/packages/config/tailwind/colors.js index 28d112f47..78e4bc8f5 100644 --- a/packages/config/tailwind/colors.js +++ b/packages/config/tailwind/colors.js @@ -7,6 +7,7 @@ const colors = [ 'color-light-transparent', 'color-white', 'color-brand', + 'color-brand-secondary', 'color-active', 'color-error', 'color-valid', @@ -19,6 +20,7 @@ const colors = [ 'text-tertiary', 'text-quaternary', 'text-brand', + 'text-brand-secondary', 'text-interactive-disabled', 'text-interactive-active', 'text-interactive-error', @@ -35,6 +37,7 @@ const colors = [ 'icon-secondary', 'icon-tertiary', 'icon-brand', + 'icon-brand-secondary', 'icon-interactive-disabled', 'icon-interactive-active', 'icon-interactive-error', @@ -92,6 +95,7 @@ const colors = [ 'component-pill', 'component-badge-primary', 'component-badge-brand', + 'component-badge-brand-secondary', 'component-badge-valid', 'component-badge-error', ].reduce( diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/MembersTab.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/MembersTab.tsx index 1611f9921..3cddc5a6e 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/MembersTab.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/MembersTab.tsx @@ -34,17 +34,15 @@ export const MembersTab = () => { votingPowerPercent, }): StatefulDaoMemberCardProps => ({ address, + balanceLabel: t('title.staked'), balance: { - label: t('title.staked'), - unit: '$' + governanceToken.symbol, - value: { - loading: false, - data: convertMicroDenomToDenomWithDecimals( + loading: false, + data: { + token: governanceToken, + amount: convertMicroDenomToDenomWithDecimals( balance, governanceToken.decimals - ).toLocaleString(undefined, { - maximumFractionDigits: governanceToken.decimals, - }), + ), }, }, votingPowerPercent: { diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/actions/ManageMembers/index.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/actions/ManageMembers/index.tsx index 45c2ae612..8843d5430 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/actions/ManageMembers/index.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/actions/ManageMembers/index.tsx @@ -128,5 +128,7 @@ export const makeManageMembersAction: ActionMaker = ({ useDefaults, useTransformToCosmos, useDecodedCosmosMsg, + // Show at the top. + order: 1, } } diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/MembersTab.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/MembersTab.tsx index 9c9a4d99a..e71b31fbd 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/MembersTab.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/MembersTab.tsx @@ -39,11 +39,11 @@ export const MembersTab = () => { data: votingModule.data.members?.map(({ addr, weight }) => ({ address: addr, + balanceLabel: t('title.votingWeight'), balance: { - label: t('title.votingWeight'), - value: { - loading: false, - data: weight.toLocaleString(), + loading: false, + data: { + amount: weight, }, }, votingPowerPercent: diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/MembersTab.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/MembersTab.tsx index 9a68645fd..c7475d452 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/MembersTab.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/MembersTab.tsx @@ -13,12 +13,12 @@ import { EntityDisplay, } from '../../../../components' import { useVotingModuleAdapterOptions } from '../../../react/context' -import { useGovernanceCollectionInfo } from '../hooks' +import { useCommonGovernanceTokenInfo } from '../hooks' export const MembersTab = () => { const { t } = useTranslation() const { chainId, votingModuleAddress } = useVotingModuleAdapterOptions() - const { collectionInfo } = useGovernanceCollectionInfo() + const token = useCommonGovernanceTokenInfo() const members = useCachedLoadingWithError( DaoVotingCw721StakedSelectors.topStakersSelector({ @@ -33,12 +33,12 @@ export const MembersTab = () => { votingPowerPercent, }): StatefulDaoMemberCardProps => ({ address, + balanceLabel: t('title.staked'), balance: { - label: t('title.staked'), - unit: '$' + collectionInfo.symbol, - value: { - loading: false, - data: count.toLocaleString(), + loading: false, + data: { + amount: count, + token, }, }, votingPowerPercent: { diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/MembersTab.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/MembersTab.tsx index c09fa8ba5..a13c1dfc6 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/MembersTab.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/MembersTab.tsx @@ -34,17 +34,15 @@ export const MembersTab = () => { votingPowerPercent, }): StatefulDaoMemberCardProps => ({ address, + balanceLabel: t('title.staked'), balance: { - label: t('title.staked'), - unit: '$' + governanceToken.symbol, - value: { - loading: false, - data: convertMicroDenomToDenomWithDecimals( + loading: false, + data: { + amount: convertMicroDenomToDenomWithDecimals( balance, governanceToken.decimals - ).toLocaleString(undefined, { - maximumFractionDigits: governanceToken.decimals, - }), + ), + token: governanceToken, }, }, votingPowerPercent: { diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/MembersTab.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/MembersTab.tsx index 3a2c66a1f..0d36aa018 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/MembersTab.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/MembersTab.tsx @@ -34,17 +34,15 @@ export const MembersTab = () => { votingPowerPercent, }): StatefulDaoMemberCardProps => ({ address, + balanceLabel: t('title.staked'), balance: { - label: t('title.staked'), - unit: '$' + governanceToken.symbol, - value: { - loading: false, - data: convertMicroDenomToDenomWithDecimals( + loading: false, + data: { + amount: convertMicroDenomToDenomWithDecimals( balance, governanceToken.decimals - ).toLocaleString(undefined, { - maximumFractionDigits: governanceToken.decimals, - }), + ), + token: governanceToken, }, }, votingPowerPercent: { diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ProposalCreationForm.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ProposalCreationForm.tsx index adb817a76..86c2747ab 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ProposalCreationForm.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ProposalCreationForm.tsx @@ -169,6 +169,7 @@ export const ProposalCreationForm = ({ (contribution, contributionIndex) => { // Every other row. const backgroundClassName = + // eslint-disable-next-line i18next/no-literal-string contributionIndex % 2 !== 0 && 'bg-background-tertiary' return ( @@ -291,6 +292,7 @@ export const ProposalCreationForm = ({ ({ id, contributor, compensation }, contributionIndex) => { // Every other row. const backgroundClassName = + // eslint-disable-next-line i18next/no-literal-string contributionIndex % 2 !== 0 && 'bg-background-tertiary' const tokens = compensation.compensationPerAttribute diff --git a/packages/stateless/components/dao/DaoMemberCard.stories.tsx b/packages/stateless/components/dao/DaoMemberCard.stories.tsx index 76402d42c..a824ab19a 100644 --- a/packages/stateless/components/dao/DaoMemberCard.stories.tsx +++ b/packages/stateless/components/dao/DaoMemberCard.stories.tsx @@ -1,7 +1,7 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' import { CHAIN_ID } from '@dao-dao/storybook' -import { EntityType } from '@dao-dao/types' +import { EntityType, TokenType } from '@dao-dao/types' import { DaoMemberCardProps } from '@dao-dao/types/components/DaoMemberCard' import { ButtonLink } from '../buttons' @@ -22,16 +22,24 @@ const Template: ComponentStory = (args) => ( export const makeProps = (): DaoMemberCardProps => ({ address: 'juno1abczhsdyechxcjz90y', // Random number between 0 and 100,000 with 6 decimals. + balanceLabel: 'Staked', balance: { - label: 'Staked', - unit: 'DAO', - value: { - loading: false, - data: ( - Math.floor(Math.random() * (100000 * 1e6) + 1e6) / 1e6 - ).toLocaleString(undefined, { - maximumFractionDigits: 6, - }), + loading: false, + data: { + amount: Math.floor(Math.random() * (100000 * 1e6) + 1e6) / 1e6, + token: { + chainId: CHAIN_ID, + type: TokenType.Native, + denomOrAddress: 'udao', + decimals: 6, + symbol: 'DAO', + imageUrl: 'https://daodao.zone/daodao.png', + source: { + chainId: CHAIN_ID, + type: TokenType.Native, + denomOrAddress: 'udao', + }, + }, }, }, // Random number between 0 and 31 with 2 decimals. diff --git a/packages/stateless/components/dao/DaoMemberCard.tsx b/packages/stateless/components/dao/DaoMemberCard.tsx index bf898bebd..5b27bfb81 100644 --- a/packages/stateless/components/dao/DaoMemberCard.tsx +++ b/packages/stateless/components/dao/DaoMemberCard.tsx @@ -3,26 +3,33 @@ import { useTranslation } from 'react-i18next' import { EntityType } from '@dao-dao/types' import { DaoMemberCardProps } from '@dao-dao/types/components/DaoMemberCard' -import { formatPercentOf100 } from '@dao-dao/utils' +import { formatPercentOf100, intelligentAddressConcat } from '@dao-dao/utils' import { useDaoNavHelpers } from '../../hooks' import { ButtonLink } from '../buttons' -import { CopyableAddress } from '../CopyableAddress' +import { CopyToClipboard } from '../CopyToClipboard' import { ProfileImage } from '../profile' +import { TokenAmountDisplay } from '../token' export const DaoMemberCard = ({ address, balance, + balanceLabel, votingPowerPercent, loadingEntity, }: DaoMemberCardProps) => { const { t } = useTranslation() const { getDaoPath } = useDaoNavHelpers() - const title = ( + const loadingOrHasName = + loadingEntity.loading || + (loadingEntity.updating && !loadingEntity.data.name) || + loadingEntity.data.name + + const title = loadingOrHasName ? (

@@ -31,11 +38,15 @@ export const DaoMemberCard = ({ ? '...' : loadingEntity.data.name}

+ ) : ( +

+ {intelligentAddressConcat(address)} +

) return (
-
+
{/* Image */} {/* Name */} -
+
{!loadingEntity.loading && loadingEntity.data.type === EntityType.Dao ? ( @@ -59,20 +70,30 @@ export const DaoMemberCard = ({ ) : ( title )} -
- {/* Address */} - + {!loadingEntity.loading && + loadingEntity.data.type !== EntityType.Dao && ( + + )} +
{/* Voting power */}
-

{t('title.votingPower')}

+

{t('title.votingPower')}

@@ -84,17 +105,23 @@ export const DaoMemberCard = ({ {/* Balance */}

-

{balance.label}

-

- {balance.value.loading - ? '...' - : balance.value.data + (balance.unit ? ' ' + balance.unit : '')} -

+

{balanceLabel}

+ +
diff --git a/packages/stateless/components/dao/tabs/MembersTab.tsx b/packages/stateless/components/dao/tabs/MembersTab.tsx index 4c7d9f1d9..26641a7b5 100644 --- a/packages/stateless/components/dao/tabs/MembersTab.tsx +++ b/packages/stateless/components/dao/tabs/MembersTab.tsx @@ -247,7 +247,7 @@ export const MembersTab = ({ ) : members.data.length ? ( <> - + {members.data .slice( (membersPage - 1) * MEMBERS_PER_PAGE, @@ -287,9 +287,10 @@ export const MembersTab = ({ [ 'Member', members.data.length - ? members.data[0].balance.label + - (members.data[0].balance.unit - ? ` (${members.data[0].balance.unit})` + ? members.data[0].balanceLabel + + (!members.data[0].balance.loading && + members.data[0].balance.data.token + ? ` (${members.data[0].balance.data.token.symbol})` : '') : 'Balance', 'Voting power', @@ -297,7 +298,7 @@ export const MembersTab = ({ ...members.data.map( ({ address, balance, votingPowerPercent }) => [ address, - balance.value.loading ? '...' : balance.value.data, + balance.loading ? '...' : balance.data.amount.toString(), votingPowerPercent.loading ? '...' : votingPowerPercent.data, ] ), diff --git a/packages/stateless/styles/index.css b/packages/stateless/styles/index.css index 3f365a189..49872c237 100644 --- a/packages/stateless/styles/index.css +++ b/packages/stateless/styles/index.css @@ -72,6 +72,7 @@ input[type='number']::-webkit-outer-spin-button { --light: 243, 246, 248; --white: 255, 255, 255; --brand: 123, 97, 255; + --brand-secondary: 252, 129, 164; --active: 179, 160, 255; --error: 199, 62, 89; --valid: 57, 166, 153; @@ -84,6 +85,7 @@ input[type='number']::-webkit-outer-spin-button { --color-light-transparent: rgba(var(--light), 0.5); --color-white: rgb(var(--white)); --color-brand: rgb(var(--brand)); + --color-brand-secondary: rgb(var(--brand-secondary)); --color-active: rgb(var(--active)); --color-error: rgb(var(--error)); --color-valid: rgb(var(--valid)); @@ -99,6 +101,7 @@ input[type='number']::-webkit-outer-spin-button { --text-tertiary: rgba(var(--dark), 0.5); --text-quaternary: rgba(var(--dark), 0.35); --text-brand: rgba(var(--brand), 0.95); + --text-brand-secondary: rgba(var(--brand-secondary), 0.95); --text-interactive-disabled: rgba(var(--dark), 0.2); --text-interactive-active: rgba(var(--brand), 0.95); --text-interactive-error: rgba(var(--error), 0.95); @@ -117,6 +120,7 @@ input[type='number']::-webkit-outer-spin-button { --icon-secondary: rgba(var(--dark), 0.6); --icon-tertiary: rgba(var(--dark), 0.45); --icon-brand: rgba(var(--brand), 0.9); + --icon-brand-secondary: rgba(var(--brand-secondary), 0.9); --icon-interactive-disabled: rgba(var(--dark), 0.15); --icon-interactive-active: rgba(var(--brand), 0.9); --icon-interactive-error: rgba(var(--error), 0.9); @@ -176,6 +180,7 @@ input[type='number']::-webkit-outer-spin-button { --component-pill: rgba(var(--brand), 0.8); --component-badge-primary: rgba(var(--dark), 0.25); --component-badge-brand: rgba(var(--brand), 0.4); + --component-badge-brand-secondary: rgba(var(--brand-secondary), 0.4); --component-badge-valid: rgba(var(--valid), 0.45); --component-badge-error: rgba(var(--error), 0.45); } diff --git a/packages/types/components/DaoMemberCard.ts b/packages/types/components/DaoMemberCard.ts index 499714924..c4c93ed6e 100644 --- a/packages/types/components/DaoMemberCard.ts +++ b/packages/types/components/DaoMemberCard.ts @@ -1,16 +1,17 @@ import { ComponentType } from 'react' import { LoadingData } from '../misc' +import { GenericToken } from '../token' import { ButtonLinkProps } from './Buttonifier' import { Entity } from './EntityDisplay' export type DaoMemberCardProps = { address: string - balance: { - label: string - unit?: string - value: LoadingData - } + balanceLabel: string + balance: LoadingData<{ + amount: number + token?: GenericToken + }> votingPowerPercent: LoadingData loadingEntity: LoadingData ButtonLink: ComponentType diff --git a/packages/types/components/TokenAmountDisplay.ts b/packages/types/components/TokenAmountDisplay.ts index 8d7e887ce..84931aad4 100644 --- a/packages/types/components/TokenAmountDisplay.ts +++ b/packages/types/components/TokenAmountDisplay.ts @@ -33,8 +33,8 @@ export type TokenAmountDisplayProps = Omit< } // Alow hiding symbol. | { - symbol?: never - hideSymbol: true + symbol?: string + hideSymbol: boolean // Full decimal precision of the value. decimals: number estimatedUsdValue?: false diff --git a/packages/utils/conversion.ts b/packages/utils/conversion.ts index 12bb2d1b5..f003f5c56 100644 --- a/packages/utils/conversion.ts +++ b/packages/utils/conversion.ts @@ -15,10 +15,10 @@ import { Expiration } from '@dao-dao/types/contracts/common' import { getChainForChainId } from './chain' import { IPFS_GATEWAY_TEMPLATE, SITE_URL } from './constants' -export function convertMicroDenomToDenomWithDecimals( +export const convertMicroDenomToDenomWithDecimals = ( amount: number | string, decimals: number -) { +) => { if (typeof amount === 'string') { amount = Number(amount) } @@ -26,10 +26,10 @@ export function convertMicroDenomToDenomWithDecimals( return isNaN(amount) ? 0 : amount } -export function convertDenomToMicroDenomWithDecimals( +export const convertDenomToMicroDenomWithDecimals = ( amount: number | string, decimals: number -) { +) => { if (typeof amount === 'string') { amount = Number(amount) } @@ -408,6 +408,22 @@ export const concatAddressStartEnd = ( export const concatAddressBoth = (address: string, takeN = 7): string => address && concatAddressStartEnd(address, takeN, takeN) +export const intelligentAddressConcat = ( + address: string, + takeN = 4 +): string => { + // Use bech32 prefix length to determine how much to truncate from beginning. + let prefixLength + try { + prefixLength = fromBech32(address).prefix.length + } catch (e) { + // Conservative estimate. + prefixLength = 6 + } + + return concatAddressStartEnd(address, prefixLength + takeN, takeN) +} + /** * Transform an address from one chain to another sharing the same bech32 data. * From 154cde54680c47e7f58edd7a651acfee3634fdc1 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 27 Mar 2024 14:28:08 +0100 Subject: [PATCH 084/438] add apps tab iframe handshake --- .../stateless/components/dao/tabs/AppsTab.tsx | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/stateless/components/dao/tabs/AppsTab.tsx b/packages/stateless/components/dao/tabs/AppsTab.tsx index f6756f471..f4420857d 100644 --- a/packages/stateless/components/dao/tabs/AppsTab.tsx +++ b/packages/stateless/components/dao/tabs/AppsTab.tsx @@ -69,7 +69,7 @@ const InnerAppsTab = ({ setUrl(url) } - // On first iframe mount, go to url + // On first iframe mount, go to URL. useEffect(() => { try { if (iframe && (url === '' || (url && new URL(url).href))) { @@ -80,6 +80,25 @@ const InnerAppsTab = ({ } }, [iframe, url]) + // Add event handler to inform iframe that it's wrapped in DAO DAO if it asks. + useEffect(() => { + if (!iframe?.contentWindow) { + return + } + + const listener = ({ data }: MessageEvent) => { + if (data === 'isDaoDao') { + iframe.contentWindow?.postMessage('amDaoDao') + } + } + + iframe.contentWindow.addEventListener('message', listener) + + return () => { + iframe.contentWindow?.removeEventListener('message', listener) + } + }, [iframe]) + // Update the input field to match the URL if it changes in the parent // component. This should handle the URL being updated from the query params. useEffect(() => { From 52a52c37903817bd6a6d5cf720692af8b51083e7 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 1 Apr 2024 09:32:27 -0700 Subject: [PATCH 085/438] added copy to clipboard to walletconnect QR modal --- .../components/wallet/WalletUiConnectQr.tsx | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/packages/stateful/components/wallet/WalletUiConnectQr.tsx b/packages/stateful/components/wallet/WalletUiConnectQr.tsx index e7f5c1fa9..ce8e09221 100644 --- a/packages/stateful/components/wallet/WalletUiConnectQr.tsx +++ b/packages/stateful/components/wallet/WalletUiConnectQr.tsx @@ -1,18 +1,31 @@ import { WalletModalProps } from '@cosmos-kit/core' import QRCode from 'qrcode.react' +import { useTranslation } from 'react-i18next' + +import { CopyToClipboard } from '@dao-dao/stateless' export const WalletUiConnectQr = ({ walletRepo, }: Pick) => { + const { t } = useTranslation() + if (!walletRepo?.current?.qrUrl?.data) { return null } return ( - +
+ + + +
) } From 927f631d66e9182abe504a7d34dc38447ab7c516 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 1 Apr 2024 15:35:29 -0700 Subject: [PATCH 086/438] added instantiate permission config to upload code action --- packages/i18n/locales/en/translation.json | 4 + .../UploadCode/Component.tsx | 124 +++++++++++++++++- .../smart_contracting/UploadCode/index.tsx | 59 ++++++--- packages/utils/messages/protobuf.ts | 18 ++- 4 files changed, 175 insertions(+), 30 deletions(-) diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 855bffb00..4ee883d9b 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -662,7 +662,9 @@ "nftMintInstructions": "Create a unique token ID for the NFT and enter the address of the initial owner below.", "nftUploadMetadataInstructions": "Input the NFT's metadata, and then press 'Upload' to store it on IPFS.", "noOne": "No one", + "nobody": "Nobody", "oneOneCollection": "1/1 Collection", + "oneOrMoreAccounts": "One or more accounts", "onlyMembersExecuteTitle": "Only members execute", "onlyMembersExecuteTooltip": "If enabled, only members may execute passed proposals.", "openDate": "Open date", @@ -744,6 +746,7 @@ "unjailValidatorMessage": "Unjail validator message", "unjailValidatorMessageTooltip": "When a validator is 'jailed' for downtime, you must submit an Unjail transaction from the operator account in order to be able to get block proposer rewards again.", "unlockPercent": "Unlock percent", + "unspecified": "Unspecified", "unstakingDurationDescription": "In order to vote, members must stake their tokens with the DAO. Members who would like to leave the DAO or trade their governance tokens must first unstake them. This setting configures how long members have to wait after unstaking their tokens for those tokens to become available. The longer you set this duration, the more sure you can be sure that people who register their tokens are keen to participate in your DAO's governance.", "unstakingDurationTitle": "Unstaking period", "updateAdminDescription": "This will update the admin for the selected contract. The new admin will have complete control over the contract. Take care.", @@ -777,6 +780,7 @@ "whoAreYouQuestion": "Who are you?", "whoCanCancelPayment": "Who can cancel this payment?", "whoCanMint": "Who can mint an NFT?", + "whoCanUseContract": "Who can use this contract?", "whoCanVetoProposals": "Who can veto proposals?", "whoIsCounterparty": "Who is the counterparty?", "whoTransferNftQuestion": "Where would you like to transfer the NFT?", diff --git a/packages/stateful/actions/core/smart_contracting/UploadCode/Component.tsx b/packages/stateful/actions/core/smart_contracting/UploadCode/Component.tsx index 88d3a5199..121a0c840 100644 --- a/packages/stateful/actions/core/smart_contracting/UploadCode/Component.tsx +++ b/packages/stateful/actions/core/smart_contracting/UploadCode/Component.tsx @@ -1,33 +1,67 @@ import { fromBase64, toBase64, toHex } from '@cosmjs/encoding' -import { DownloadDone } from '@mui/icons-material' +import { Add, Close, DownloadDone } from '@mui/icons-material' import clsx from 'clsx' import { ComponentType, useCallback, useEffect, useState } from 'react' -import { useFormContext } from 'react-hook-form' +import { useFieldArray, useFormContext } from 'react-hook-form' import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' -import { CopyToClipboard, FileDropInput, InputLabel } from '@dao-dao/stateless' -import { TransProps } from '@dao-dao/types' +import { + Button, + CopyToClipboard, + FileDropInput, + IconButton, + InputLabel, + RadioInput, + RadioInputOption, + useChain, +} from '@dao-dao/stateless' +import { AddressInputProps, TransProps } from '@dao-dao/types' import { ActionComponent } from '@dao-dao/types/actions' -import { processError } from '@dao-dao/utils' +import { AccessType } from '@dao-dao/types/protobuf/codegen/cosmwasm/wasm/v1/types' +import { + makeValidateAddress, + processError, + validateRequired, +} from '@dao-dao/utils' export type UploadCodeData = { chainId: string // Set when file is chosen. data?: string + accessType: AccessType + // Only used when accessType === AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES + allowedAddresses: { + address: string + }[] } export type UploadCodeOptions = { Trans: ComponentType + AddressInput: ComponentType> } export const UploadCodeComponent: ActionComponent = ({ isCreating, fieldNamePrefix, - options: { Trans }, + options: { Trans, AddressInput }, + errors, }) => { const { t } = useTranslation() - const { setValue, watch } = useFormContext() + const { setValue, watch, control, register } = + useFormContext() + + const { bech32_prefix: bech32Prefix } = useChain() + + const accessType = watch((fieldNamePrefix + 'accessType') as 'accessType') + const { + fields: allowedAddressesFields, + append: appendAllowedAddress, + remove: removeAllowedAddress, + } = useFieldArray({ + control, + name: (fieldNamePrefix + 'allowedAddresses') as 'allowedAddresses', + }) const data = watch((fieldNamePrefix + 'data') as 'data') const [fileName, setFileName] = useState() @@ -123,6 +157,82 @@ export const UploadCodeComponent: ActionComponent = ({ onSelect={onSelect} /> )} + +
+ + + [] + ) + // Only show the selected option once created. + .filter(({ value }) => isCreating || value === accessType)} + setValue={setValue} + watch={watch} + /> + + {accessType === AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES && ( +
+ {allowedAddressesFields.map(({ id }, index) => ( +
+ + + {isCreating && ( + removeAllowedAddress(index)} + size="sm" + variant="ghost" + /> + )} +
+ ))} + + {isCreating && ( + + )} +
+ )} +
) } diff --git a/packages/stateful/actions/core/smart_contracting/UploadCode/index.tsx b/packages/stateful/actions/core/smart_contracting/UploadCode/index.tsx index 5219ee1b3..9ba79d009 100644 --- a/packages/stateful/actions/core/smart_contracting/UploadCode/index.tsx +++ b/packages/stateful/actions/core/smart_contracting/UploadCode/index.tsx @@ -17,6 +17,7 @@ import { UseTransformToCosmos, } from '@dao-dao/types/actions' import { MsgStoreCode } from '@dao-dao/types/protobuf/codegen/cosmwasm/wasm/v1/tx' +import { AccessType } from '@dao-dao/types/protobuf/codegen/cosmwasm/wasm/v1/types' import { decodePolytoneExecuteMsg, getChainAddressForActionOptions, @@ -24,6 +25,7 @@ import { maybeMakePolytoneExecuteMessage, } from '@dao-dao/utils' +import { AddressInput } from '../../../../components' import { useActionOptions } from '../../../react' import { UploadCodeComponent, UploadCodeData } from './Component' @@ -43,6 +45,7 @@ const Component: ActionComponent = (props) => { {...props} options={{ Trans, + AddressInput, }} /> @@ -52,34 +55,47 @@ const Component: ActionComponent = (props) => { export const makeUploadCodeAction: ActionMaker = (options) => { const { t, + address, chain: { chain_id: currentChainId }, context, } = options const useDefaults: UseDefaults = () => ({ chainId: currentChainId, + accessType: AccessType.ACCESS_TYPE_EVERYBODY, + allowedAddresses: [{ address }], }) const useTransformToCosmos: UseTransformToCosmos = () => - useCallback(({ chainId, data }: UploadCodeData) => { - if (!data) { - return - } + useCallback( + ({ chainId, data, accessType, allowedAddresses }: UploadCodeData) => { + if (!data) { + return + } - return maybeMakePolytoneExecuteMessage( - currentChainId, - chainId, - makeStargateMessage({ - stargate: { - typeUrl: MsgStoreCode.typeUrl, - value: { - sender: getChainAddressForActionOptions(options, chainId), - wasmByteCode: fromBase64(data), - } as MsgStoreCode, - }, - }) - ) - }, []) + return maybeMakePolytoneExecuteMessage( + currentChainId, + chainId, + makeStargateMessage({ + stargate: { + typeUrl: MsgStoreCode.typeUrl, + value: { + sender: getChainAddressForActionOptions(options, chainId), + wasmByteCode: fromBase64(data), + instantiatePermission: { + permission: accessType, + addresses: + accessType === AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES + ? allowedAddresses.map(({ address }) => address) + : [], + }, + } as MsgStoreCode, + }, + }) + ) + }, + [] + ) const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( msg: Record @@ -105,6 +121,13 @@ export const makeUploadCodeAction: ActionMaker = (options) => { data: { chainId, data: toBase64(msg.stargate.value.wasmByteCode), + accessType: + msg.stargate.value.instantiatePermission?.permission ?? + AccessType.UNRECOGNIZED, + allowedAddresses: + msg.stargate.value.instantiatePermission?.addresses?.map( + (address: string) => ({ address }) + ) ?? [], }, } } diff --git a/packages/utils/messages/protobuf.ts b/packages/utils/messages/protobuf.ts index 943b94e1a..b51b323c3 100644 --- a/packages/utils/messages/protobuf.ts +++ b/packages/utils/messages/protobuf.ts @@ -139,10 +139,15 @@ export const isDecodedStargateMsg = (msg: any): msg is DecodedStargateMsg => }, }) && typeof msg.stargate.value === 'object' -// Decode any nested protobufs into JSON. Also decodes longs since those show up -// often. +/** + * Decode raw JSON data for displaying. Decode any nested protobufs into JSON. + * Also decodes longs since those show up often. + */ export const decodeRawDataForDisplay = (msg: any): any => - typeof msg !== 'object' || msg === null + // Truncate long strings. + typeof msg === 'string' && msg.length > 5000 + ? msg.slice(0, 100) + `...<${msg.length - 200} more>...` + msg.slice(-100) + : typeof msg !== 'object' || msg === null ? msg : msg instanceof Uint8Array ? toBase64(msg) @@ -161,7 +166,7 @@ export const decodeRawDataForDisplay = (msg: any): any => (msg as Any).value instanceof Uint8Array ? (() => { try { - return decodeRawProtobufMsg(msg as Any) + return decodeRawDataForDisplay(decodeRawProtobufMsg(msg as Any)) } catch { return msg } @@ -172,7 +177,10 @@ export const decodeRawDataForDisplay = (msg: any): any => : Object.entries(msg).reduce( (acc, [key, value]) => ({ ...acc, - [key]: decodeRawDataForDisplay(value), + [key]: + key === 'wasmByteCode' + ? '[TOO LARGE TO SHOW]' + : decodeRawDataForDisplay(value), }), {} as Record ) From 0163bc2217a8e729bca1488b5903a463b13aebbe Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 1 Apr 2024 23:38:29 -0700 Subject: [PATCH 087/438] fixed instantiate2 encoding --- .../actions/core/smart_contracting/Instantiate2/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx b/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx index 84315db6c..a1922fae6 100644 --- a/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx +++ b/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx @@ -182,7 +182,7 @@ export const makeInstantiate2Action: ActionMaker = ( typeUrl: MsgInstantiateContract2.typeUrl, value: { sender: getChainAddressForActionOptions(options, chainId), - admin: admin || null, + admin: admin || '', codeId: codeId ? BigInt(codeId) : 0n, label, msg: toUtf8(JSON.stringify(msg)), From a6af7e496ba49af24dd837988418fd7871467a58 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 1 Apr 2024 23:45:06 -0700 Subject: [PATCH 088/438] fixed instantiate2 cross-chain address calculation --- .../smart_contracting/Instantiate2/Component.tsx | 13 ++++++++----- .../core/smart_contracting/Instantiate2/index.tsx | 15 ++++++++------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/packages/stateful/actions/core/smart_contracting/Instantiate2/Component.tsx b/packages/stateful/actions/core/smart_contracting/Instantiate2/Component.tsx index b995ea878..37a89081d 100644 --- a/packages/stateful/actions/core/smart_contracting/Instantiate2/Component.tsx +++ b/packages/stateful/actions/core/smart_contracting/Instantiate2/Component.tsx @@ -57,15 +57,18 @@ export const Instantiate2Component: ActionComponent = ( return ( <> - {!!instantiatedAddress && ( -
- +
+ + + {instantiatedAddress ? ( -
- )} + ) : ( +

...

+ )} +
diff --git a/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx b/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx index a1922fae6..22a5514c7 100644 --- a/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx +++ b/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx @@ -32,6 +32,7 @@ import { getChainAddressForActionOptions, getNativeTokenForChainId, isDecodedStargateMsg, + maybeGetChainForChainId, maybeMakePolytoneExecuteMessage, objectMatchesStructure, parseEncodedMessage, @@ -52,11 +53,7 @@ type Instantiate2Data = { } const Component: ActionComponent = (props) => { - const { - context, - address, - chain: { bech32_prefix: bech32Prefix }, - } = useActionOptions() + const { context, address } = useActionOptions() const { watch, setValue } = useFormContext() const chainId = watch((props.fieldNamePrefix + 'chainId') as 'chainId') @@ -88,13 +85,17 @@ const Component: ActionComponent = (props) => { })), }) + const chain = maybeGetChainForChainId(chainId) + const instantiatedAddress = - codeDetailsLoadable.state === 'hasValue' && codeDetailsLoadable.contents + codeDetailsLoadable.state === 'hasValue' && + codeDetailsLoadable.contents && + chain ? instantiate2Address( fromHex(codeDetailsLoadable.contents.checksum), address, toUtf8(salt), - bech32Prefix + chain.bech32_prefix ) : undefined From b5828f9663776b3aae6d4ae8138db797be712e92 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 2 Apr 2024 17:40:18 -0700 Subject: [PATCH 089/438] fixed instantiate with no admin --- .../actions/core/smart_contracting/Instantiate/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stateful/actions/core/smart_contracting/Instantiate/index.tsx b/packages/stateful/actions/core/smart_contracting/Instantiate/index.tsx index 0465d9fdf..ba4c6f568 100644 --- a/packages/stateful/actions/core/smart_contracting/Instantiate/index.tsx +++ b/packages/stateful/actions/core/smart_contracting/Instantiate/index.tsx @@ -273,7 +273,7 @@ export const makeInstantiateAction: ActionMaker = ({ makeWasmMessage({ wasm: { instantiate: { - admin: admin || null, + admin: admin || '', code_id: codeId, funds: funds.map(({ denom, amount }, index) => ({ denom, From 8a0878b9a5abe2277a414e6819a11a09fae332f8 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 2 Apr 2024 18:16:31 -0700 Subject: [PATCH 090/438] added copy link to draft button to DAO proposal creation --- packages/i18n/locales/en/translation.json | 1 + .../components/dao/CreateDaoProposal.tsx | 22 ++++++- packages/stateless/pages/CreateProposal.tsx | 58 ++++++++++++++++--- 3 files changed, 71 insertions(+), 10 deletions(-) diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 4ee883d9b..cdded351c 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -103,6 +103,7 @@ "copyDaoAddress": "Copy DAO address", "copyDaoChainAddress": "Copy {{chain}} address", "copyIdToClipboard": "Copy ID to clipboard", + "copyLinkToProposalDraft": "Copy link to proposal draft", "copyToClipboard": "Copy to clipboard", "create": "Create", "createAProposal": "Create a proposal", diff --git a/packages/stateful/components/dao/CreateDaoProposal.tsx b/packages/stateful/components/dao/CreateDaoProposal.tsx index 8bf16916a..1045cf1f9 100644 --- a/packages/stateful/components/dao/CreateDaoProposal.tsx +++ b/packages/stateful/components/dao/CreateDaoProposal.tsx @@ -32,7 +32,11 @@ import { ProposalModule, ProposalPrefill, } from '@dao-dao/types' -import { ContractName, DaoProposalSingleAdapterId } from '@dao-dao/utils' +import { + ContractName, + DaoProposalSingleAdapterId, + SITE_URL, +} from '@dao-dao/utils' import { ProposalModuleAdapterCommonProvider, @@ -87,7 +91,7 @@ const InnerCreateDaoProposal = ({ setSelectedProposalModule, }: InnerCreateDaoProposalProps) => { const { t } = useTranslation() - const { goToDaoProposal, router } = useDaoNavHelpers() + const { goToDaoProposal, router, getDaoProposalPath } = useDaoNavHelpers() const daoInfo = useDaoInfoContext() // Set once prefill has been assessed, indicating NewProposal can load now. @@ -330,6 +334,19 @@ const InnerCreateDaoProposal = ({ ] ) + const copyDraftLink = () => { + navigator.clipboard.writeText( + SITE_URL + + getDaoProposalPath(daoInfo.coreAddress, 'create', { + prefill: JSON.stringify({ + id: proposalModuleAdapterCommonId, + data: proposalData, + }), + }) + ) + toast.success(t('info.copiedLinkToClipboard')) + } + return ( <> } diff --git a/packages/stateless/pages/CreateProposal.tsx b/packages/stateless/pages/CreateProposal.tsx index a04ec46ba..1f3ff436e 100644 --- a/packages/stateless/pages/CreateProposal.tsx +++ b/packages/stateless/pages/CreateProposal.tsx @@ -1,27 +1,69 @@ -import { Clear } from '@mui/icons-material' -import { ReactNode } from 'react' +import { Check, Clear, CopyAll } from '@mui/icons-material' +import { ReactNode, useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import { IconButton, Tooltip } from '../components' export type CreateProposalProps = { + /** + * The rendered new proposal form. + */ newProposal: ReactNode + /** + * Optionally show a button that copies a link to the current draft. + */ + copyDraftLink?: () => void + /** + * Optionally show a button that clears the form. + */ clear?: () => void } -export const CreateProposal = ({ newProposal, clear }: CreateProposalProps) => { +export const CreateProposal = ({ + newProposal, + copyDraftLink, + clear, +}: CreateProposalProps) => { const { t } = useTranslation() + const [copied, setCopied] = useState(false) + // Clear copied after 2 seconds. + useEffect(() => { + const timeout = setTimeout(() => setCopied(false), 2000) + return () => clearTimeout(timeout) + }, [copied]) + return (

{t('title.newProposal')}

- {clear && ( - - - - )} +
+ {copyDraftLink && ( + + { + copyDraftLink() + setCopied(true) + }} + variant="ghost" + /> + + )} + + {clear && ( + + + + )} +
{newProposal} From ffc127552b95b4628af1e41473b5b1eb03c208e0 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 2 Apr 2024 18:43:03 -0700 Subject: [PATCH 091/438] made local storage proposal save behavior more reliable --- .../components/dao/CreateDaoProposal.tsx | 27 +++++++++++++---- .../components/gov/NewGovProposal.tsx | 29 ++++++++++++++----- 2 files changed, 42 insertions(+), 14 deletions(-) diff --git a/packages/stateful/components/dao/CreateDaoProposal.tsx b/packages/stateful/components/dao/CreateDaoProposal.tsx index 1045cf1f9..801ddd57b 100644 --- a/packages/stateful/components/dao/CreateDaoProposal.tsx +++ b/packages/stateful/components/dao/CreateDaoProposal.tsx @@ -5,6 +5,7 @@ import { useCallback, useEffect, useMemo, + useRef, useState, } from 'react' import { FormProvider, useForm } from 'react-hook-form' @@ -130,6 +131,15 @@ const InnerCreateDaoProposal = ({ useRecoilState(proposalCreatedCardPropsAtom) const proposalData = formMethods.watch() + + const saveQueuedRef = useRef(false) + const saveLatestProposalRef = useRef(() => {}) + saveLatestProposalRef.current = () => + setLatestProposalSave( + // If created proposal, clear latest proposal save. + proposalCreatedCardProps ? {} : cloneDeep(proposalData) + ) + // Save latest data to atom and thus localStorage every second. useEffect(() => { // If created proposal, don't save. @@ -137,12 +147,17 @@ const InnerCreateDaoProposal = ({ return } - // Deep clone to prevent values from becoming readOnly. - const timeout = setTimeout( - () => setLatestProposalSave(cloneDeep(proposalData)), - 1000 - ) - return () => clearTimeout(timeout) + // Queue save in 1 second if not already queued. + if (saveQueuedRef.current) { + return + } + saveQueuedRef.current = true + + // Save in one second. + setTimeout(() => { + saveLatestProposalRef.current() + saveQueuedRef.current = false + }, 1000) }, [proposalCreatedCardProps, setLatestProposalSave, proposalData]) const loadPrefill = useCallback( diff --git a/packages/stateful/components/gov/NewGovProposal.tsx b/packages/stateful/components/gov/NewGovProposal.tsx index 00da46585..d09b8d778 100644 --- a/packages/stateful/components/gov/NewGovProposal.tsx +++ b/packages/stateful/components/gov/NewGovProposal.tsx @@ -14,7 +14,7 @@ import clsx from 'clsx' import Fuse from 'fuse.js' import cloneDeep from 'lodash.clonedeep' import { useRouter } from 'next/router' -import { useCallback, useEffect, useState } from 'react' +import { useCallback, useEffect, useRef, useState } from 'react' import { FormProvider, SubmitErrorHandler, @@ -405,19 +405,32 @@ const InnerNewGovProposal = ({ ) const proposalData = watch() - // Save latest data to atom and thus localStorage every 10 seconds. + const saveQueuedRef = useRef(false) + const saveLatestProposalRef = useRef(() => {}) + saveLatestProposalRef.current = () => + setLatestProposalSave( + // If created proposal, clear latest proposal save. + govProposalCreatedCardProps ? {} : cloneDeep(proposalData) + ) + + // Save latest data to atom and thus localStorage every second. useEffect(() => { // If created proposal, don't save. if (govProposalCreatedCardProps) { return } - // Deep clone to prevent values from becoming readOnly. - const timeout = setTimeout( - () => setLatestProposalSave(cloneDeep(proposalData)), - 10000 - ) - return () => clearTimeout(timeout) + // Queue save in 1 second if not already queued. + if (saveQueuedRef.current) { + return + } + saveQueuedRef.current = true + + // Save in one second. + setTimeout(() => { + saveLatestProposalRef.current() + saveQueuedRef.current = false + }, 1000) }, [govProposalCreatedCardProps, setLatestProposalSave, proposalData]) const [drafts, setDrafts] = useRecoilState( From 56b014f7007416d6bc299139114b408d520df354 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 3 Apr 2024 11:43:30 -0700 Subject: [PATCH 092/438] allow DAOs to hide from search --- packages/state/indexer/search.ts | 2 ++ packages/types/indexer.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/state/indexer/search.ts b/packages/state/indexer/search.ts index 226ebf7a8..9d1f920d8 100644 --- a/packages/state/indexer/search.ts +++ b/packages/state/indexer/search.ts @@ -56,6 +56,8 @@ export const searchDaos = async ({ filter: [ // Exclude inactive DAOs. `NOT value.config.name IN ["${INACTIVE_DAO_NAMES.join('", "')}"]`, + // Exclude hidden DAOs. + 'value.hideFromSearch != true', ...(exclude?.length ? // Exclude DAOs that are in the exclude list. [`NOT id IN ["${exclude.join('", "')}"]`] diff --git a/packages/types/indexer.ts b/packages/types/indexer.ts index c55eb1a71..60ca47089 100644 --- a/packages/types/indexer.ts +++ b/packages/types/indexer.ts @@ -27,6 +27,8 @@ export interface IndexerDumpState proposalCount?: number // Map polytone note address to remote address. polytoneProxies?: Record + // Hide from search if storage item `hideFromSearch` exists. + hideFromSearch?: boolean } export type IndexerUpBlock = { From 8d53a313aaed18d182c276f75fcc3d84731b1942 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 3 Apr 2024 11:59:43 -0700 Subject: [PATCH 093/438] fixed authz revoke not showing custom msg type URL --- .../core/authorizations/AuthzGrantRevoke/index.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/index.tsx b/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/index.tsx index 62ffe7f04..4793ff1d7 100644 --- a/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/index.tsx +++ b/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/index.tsx @@ -286,15 +286,19 @@ export const makeAuthzGrantRevokeAction: ActionMaker = ( return { match: false } } } else if (msg.stargate.typeUrl === MsgRevoke.typeUrl) { + const msgTypeUrl = msg.stargate.value.msgTypeUrl + return { match: true, data: { ...defaults, chainId, mode: 'revoke', - customTypeUrl: false, + customTypeUrl: !ACTION_TYPES.some( + ({ type: { typeUrl } }) => typeUrl === msgTypeUrl + ), grantee: msg.stargate.value.grantee, - msgTypeUrl: msg.stargate.value.msgTypeUrl, + msgTypeUrl, }, } } From c5bd0e29bfa7c3e828a150255eba3cb08c20079f Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 3 Apr 2024 13:10:49 -0700 Subject: [PATCH 094/438] don't clear DAO admin exec data automatically --- .../dao_governance/DaoAdminExec/index.tsx | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/packages/stateful/actions/core/dao_governance/DaoAdminExec/index.tsx b/packages/stateful/actions/core/dao_governance/DaoAdminExec/index.tsx index aa1952b00..c915ff491 100644 --- a/packages/stateful/actions/core/dao_governance/DaoAdminExec/index.tsx +++ b/packages/stateful/actions/core/dao_governance/DaoAdminExec/index.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect } from 'react' +import { useCallback } from 'react' import { useFormContext } from 'react-hook-form' import { constSelector, useRecoilValueLoadable } from 'recoil' @@ -89,31 +89,11 @@ const Component: ActionComponent = (props) => { chain: { chain_id: chainId, bech32_prefix: bech32Prefix }, } = useActionOptions() - // Load DAO info for chosen DAO. - const { watch, setValue, clearErrors } = useFormContext() + const { watch } = useFormContext() const coreAddress = watch( (props.fieldNamePrefix + 'coreAddress') as 'coreAddress' ) - // Reset actions when core address changes during creation. - useEffect(() => { - if (props.isCreating) { - setValue((props.fieldNamePrefix + 'msgs') as 'msgs', []) - clearErrors((props.fieldNamePrefix + 'msgs') as 'msgs') - setValue( - (props.fieldNamePrefix + '_actionData') as '_actionData', - undefined - ) - clearErrors((props.fieldNamePrefix + '_actionData') as '_actionData') - } - }, [ - clearErrors, - coreAddress, - props.fieldNamePrefix, - props.isCreating, - setValue, - ]) - const daoSubDaosLoadable = useCachedLoadable( context.type === ActionContextType.Dao ? DaoCoreV2Selectors.listAllSubDaosSelector({ From b02660da294939eff82b0af00ef1e25de66d1444 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 3 Apr 2024 14:32:17 -0700 Subject: [PATCH 095/438] fixed search --- packages/state/indexer/search.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/state/indexer/search.ts b/packages/state/indexer/search.ts index 9d1f920d8..4bdd0e44e 100644 --- a/packages/state/indexer/search.ts +++ b/packages/state/indexer/search.ts @@ -57,7 +57,7 @@ export const searchDaos = async ({ // Exclude inactive DAOs. `NOT value.config.name IN ["${INACTIVE_DAO_NAMES.join('", "')}"]`, // Exclude hidden DAOs. - 'value.hideFromSearch != true', + 'value.hideFromSearch NOT EXISTS OR value.hideFromSearch != true', ...(exclude?.length ? // Exclude DAOs that are in the exclude list. [`NOT id IN ["${exclude.join('", "')}"]`] From 07f9fbee20654bcebb0130bb6a12a8bd52ba1181 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 4 Apr 2024 19:25:43 -0700 Subject: [PATCH 096/438] added ibc client protobufs --- packages/types/package.json | 6 +- .../types/protobuf/codegen/alliance/bundle.ts | 24 +- .../types/protobuf/codegen/circle/bundle.ts | 24 +- .../types/protobuf/codegen/cosmos/bundle.ts | 180 +- .../types/protobuf/codegen/cosmwasm/bundle.ts | 40 +- .../types/protobuf/codegen/gaia/bundle.ts | 24 +- packages/types/protobuf/codegen/ibc/bundle.ts | 80 +- packages/types/protobuf/codegen/ibc/client.ts | 7 +- .../codegen/ibc/core/client/v1/genesis.ts | 425 ++++ .../ibc/core/client/v1/query.rpc.Query.ts | 126 ++ .../codegen/ibc/core/client/v1/query.ts | 1963 +++++++++++++++++ .../codegen/ibc/core/client/v1/tx.amino.ts | 28 + .../codegen/ibc/core/client/v1/tx.registry.ts | 107 + .../codegen/ibc/core/client/v1/tx.rpc.msg.ts | 52 + .../protobuf/codegen/ibc/core/client/v1/tx.ts | 1076 +++++++++ .../types/protobuf/codegen/ibc/rpc.query.ts | 3 + packages/types/protobuf/codegen/ibc/rpc.tx.ts | 3 + .../types/protobuf/codegen/juno/bundle.ts | 68 +- .../types/protobuf/codegen/neutron/bundle.ts | 204 +- .../types/protobuf/codegen/neutron/client.ts | 7 +- .../types/protobuf/codegen/noble/bundle.ts | 20 +- .../types/protobuf/codegen/osmosis/bundle.ts | 412 ++-- .../protobuf/codegen/publicawesome/bundle.ts | 120 +- .../types/protobuf/codegen/regen/bundle.ts | 178 +- .../protobuf/codegen/tendermint/bundle.ts | 38 +- packages/types/protobuf/scripts/codegen.js | 1 + 26 files changed, 4507 insertions(+), 709 deletions(-) create mode 100644 packages/types/protobuf/codegen/ibc/core/client/v1/genesis.ts create mode 100644 packages/types/protobuf/codegen/ibc/core/client/v1/query.rpc.Query.ts create mode 100644 packages/types/protobuf/codegen/ibc/core/client/v1/query.ts create mode 100644 packages/types/protobuf/codegen/ibc/core/client/v1/tx.amino.ts create mode 100644 packages/types/protobuf/codegen/ibc/core/client/v1/tx.registry.ts create mode 100644 packages/types/protobuf/codegen/ibc/core/client/v1/tx.rpc.msg.ts create mode 100644 packages/types/protobuf/codegen/ibc/core/client/v1/tx.ts diff --git a/packages/types/package.json b/packages/types/package.json index 37bdcee52..d0112e091 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -5,9 +5,9 @@ "scripts": { "lint": "eslint .", "format": "eslint . --fix", - "protobuf:codegen": "node src/protobuf/scripts/codegen.js", - "protobuf:patch": "git apply src/protobuf/patches.diff", - "protobuf:patch:update": "cd src/protobuf && npm run protobuf:codegen && git diff -R codegen/ > patches.diff && npm run protobuf:patch", + "protobuf:codegen": "node protobuf/scripts/codegen.js", + "protobuf:patch": "git apply protobuf/patches.diff", + "protobuf:patch:update": "cd protobuf && npm run protobuf:codegen && git diff -R codegen/ > patches.diff && npm run protobuf:patch", "protobuf": "npm run protobuf:codegen && npm run protobuf:patch" }, "dependencies": { diff --git a/packages/types/protobuf/codegen/alliance/bundle.ts b/packages/types/protobuf/codegen/alliance/bundle.ts index 53e3e9e69..c97fd10db 100644 --- a/packages/types/protobuf/codegen/alliance/bundle.ts +++ b/packages/types/protobuf/codegen/alliance/bundle.ts @@ -8,12 +8,12 @@ import * as _6 from "./alliance/query"; import * as _7 from "./alliance/redelegations"; import * as _8 from "./alliance/tx"; import * as _9 from "./alliance/unbonding"; -import * as _301 from "./alliance/tx.amino"; -import * as _302 from "./alliance/tx.registry"; -import * as _303 from "./alliance/query.rpc.Query"; -import * as _304 from "./alliance/tx.rpc.msg"; -import * as _496 from "./rpc.query"; -import * as _497 from "./rpc.tx"; +import * as _304 from "./alliance/tx.amino"; +import * as _305 from "./alliance/tx.registry"; +import * as _306 from "./alliance/query.rpc.Query"; +import * as _307 from "./alliance/tx.rpc.msg"; +import * as _503 from "./rpc.query"; +import * as _504 from "./rpc.tx"; export namespace alliance { export const alliance = { ..._0, @@ -26,13 +26,13 @@ export namespace alliance { ..._7, ..._8, ..._9, - ..._301, - ..._302, - ..._303, - ..._304 + ..._304, + ..._305, + ..._306, + ..._307 }; export const ClientFactory = { - ..._496, - ..._497 + ..._503, + ..._504 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/circle/bundle.ts b/packages/types/protobuf/codegen/circle/bundle.ts index c674aad88..2c8937393 100644 --- a/packages/types/protobuf/codegen/circle/bundle.ts +++ b/packages/types/protobuf/codegen/circle/bundle.ts @@ -14,12 +14,12 @@ import * as _23 from "./cctp/v1/sending_and_receiving_messages_paused"; import * as _24 from "./cctp/v1/signature_threshold"; import * as _25 from "./cctp/v1/token_pair"; import * as _26 from "./cctp/v1/tx"; -import * as _305 from "./cctp/v1/tx.amino"; -import * as _306 from "./cctp/v1/tx.registry"; -import * as _307 from "./cctp/v1/query.rpc.Query"; -import * as _308 from "./cctp/v1/tx.rpc.msg"; -import * as _498 from "./rpc.query"; -import * as _499 from "./rpc.tx"; +import * as _308 from "./cctp/v1/tx.amino"; +import * as _309 from "./cctp/v1/tx.registry"; +import * as _310 from "./cctp/v1/query.rpc.Query"; +import * as _311 from "./cctp/v1/tx.rpc.msg"; +import * as _505 from "./rpc.query"; +import * as _506 from "./rpc.tx"; export namespace circle { export namespace cctp { export const v1 = { @@ -39,14 +39,14 @@ export namespace circle { ..._24, ..._25, ..._26, - ..._305, - ..._306, - ..._307, - ..._308 + ..._308, + ..._309, + ..._310, + ..._311 }; } export const ClientFactory = { - ..._498, - ..._499 + ..._505, + ..._506 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/bundle.ts b/packages/types/protobuf/codegen/cosmos/bundle.ts index 8fc16e6b3..1787e1986 100644 --- a/packages/types/protobuf/codegen/cosmos/bundle.ts +++ b/packages/types/protobuf/codegen/cosmos/bundle.ts @@ -56,51 +56,51 @@ import * as _82 from "./tx/v1beta1/tx"; import * as _83 from "./upgrade/v1beta1/query"; import * as _84 from "./upgrade/v1beta1/tx"; import * as _85 from "./upgrade/v1beta1/upgrade"; -import * as _309 from "./auth/v1beta1/tx.amino"; -import * as _310 from "./authz/v1beta1/tx.amino"; -import * as _311 from "./bank/v1beta1/tx.amino"; -import * as _312 from "./distribution/v1beta1/tx.amino"; -import * as _313 from "./gov/v1/tx.amino"; -import * as _314 from "./gov/v1beta1/tx.amino"; -import * as _315 from "./mint/v1beta1/tx.amino"; -import * as _316 from "./slashing/v1beta1/tx.amino"; -import * as _317 from "./staking/v1beta1/tx.amino"; -import * as _318 from "./upgrade/v1beta1/tx.amino"; -import * as _319 from "./auth/v1beta1/tx.registry"; -import * as _320 from "./authz/v1beta1/tx.registry"; -import * as _321 from "./bank/v1beta1/tx.registry"; -import * as _322 from "./distribution/v1beta1/tx.registry"; -import * as _323 from "./gov/v1/tx.registry"; -import * as _324 from "./gov/v1beta1/tx.registry"; -import * as _325 from "./mint/v1beta1/tx.registry"; -import * as _326 from "./slashing/v1beta1/tx.registry"; -import * as _327 from "./staking/v1beta1/tx.registry"; -import * as _328 from "./upgrade/v1beta1/tx.registry"; -import * as _329 from "./auth/v1beta1/query.rpc.Query"; -import * as _330 from "./authz/v1beta1/query.rpc.Query"; -import * as _331 from "./bank/v1beta1/query.rpc.Query"; -import * as _332 from "./base/tendermint/v1beta1/query.rpc.Service"; -import * as _333 from "./distribution/v1beta1/query.rpc.Query"; -import * as _334 from "./gov/v1/query.rpc.Query"; -import * as _335 from "./gov/v1beta1/query.rpc.Query"; -import * as _336 from "./mint/v1beta1/query.rpc.Query"; -import * as _337 from "./params/v1beta1/query.rpc.Query"; -import * as _338 from "./slashing/v1beta1/query.rpc.Query"; -import * as _339 from "./staking/v1beta1/query.rpc.Query"; -import * as _340 from "./tx/v1beta1/service.rpc.Service"; -import * as _341 from "./upgrade/v1beta1/query.rpc.Query"; -import * as _342 from "./auth/v1beta1/tx.rpc.msg"; -import * as _343 from "./authz/v1beta1/tx.rpc.msg"; -import * as _344 from "./bank/v1beta1/tx.rpc.msg"; -import * as _345 from "./distribution/v1beta1/tx.rpc.msg"; -import * as _346 from "./gov/v1/tx.rpc.msg"; -import * as _347 from "./gov/v1beta1/tx.rpc.msg"; -import * as _348 from "./mint/v1beta1/tx.rpc.msg"; -import * as _349 from "./slashing/v1beta1/tx.rpc.msg"; -import * as _350 from "./staking/v1beta1/tx.rpc.msg"; -import * as _351 from "./upgrade/v1beta1/tx.rpc.msg"; -import * as _500 from "./rpc.query"; -import * as _501 from "./rpc.tx"; +import * as _312 from "./auth/v1beta1/tx.amino"; +import * as _313 from "./authz/v1beta1/tx.amino"; +import * as _314 from "./bank/v1beta1/tx.amino"; +import * as _315 from "./distribution/v1beta1/tx.amino"; +import * as _316 from "./gov/v1/tx.amino"; +import * as _317 from "./gov/v1beta1/tx.amino"; +import * as _318 from "./mint/v1beta1/tx.amino"; +import * as _319 from "./slashing/v1beta1/tx.amino"; +import * as _320 from "./staking/v1beta1/tx.amino"; +import * as _321 from "./upgrade/v1beta1/tx.amino"; +import * as _322 from "./auth/v1beta1/tx.registry"; +import * as _323 from "./authz/v1beta1/tx.registry"; +import * as _324 from "./bank/v1beta1/tx.registry"; +import * as _325 from "./distribution/v1beta1/tx.registry"; +import * as _326 from "./gov/v1/tx.registry"; +import * as _327 from "./gov/v1beta1/tx.registry"; +import * as _328 from "./mint/v1beta1/tx.registry"; +import * as _329 from "./slashing/v1beta1/tx.registry"; +import * as _330 from "./staking/v1beta1/tx.registry"; +import * as _331 from "./upgrade/v1beta1/tx.registry"; +import * as _332 from "./auth/v1beta1/query.rpc.Query"; +import * as _333 from "./authz/v1beta1/query.rpc.Query"; +import * as _334 from "./bank/v1beta1/query.rpc.Query"; +import * as _335 from "./base/tendermint/v1beta1/query.rpc.Service"; +import * as _336 from "./distribution/v1beta1/query.rpc.Query"; +import * as _337 from "./gov/v1/query.rpc.Query"; +import * as _338 from "./gov/v1beta1/query.rpc.Query"; +import * as _339 from "./mint/v1beta1/query.rpc.Query"; +import * as _340 from "./params/v1beta1/query.rpc.Query"; +import * as _341 from "./slashing/v1beta1/query.rpc.Query"; +import * as _342 from "./staking/v1beta1/query.rpc.Query"; +import * as _343 from "./tx/v1beta1/service.rpc.Service"; +import * as _344 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _345 from "./auth/v1beta1/tx.rpc.msg"; +import * as _346 from "./authz/v1beta1/tx.rpc.msg"; +import * as _347 from "./bank/v1beta1/tx.rpc.msg"; +import * as _348 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _349 from "./gov/v1/tx.rpc.msg"; +import * as _350 from "./gov/v1beta1/tx.rpc.msg"; +import * as _351 from "./mint/v1beta1/tx.rpc.msg"; +import * as _352 from "./slashing/v1beta1/tx.rpc.msg"; +import * as _353 from "./staking/v1beta1/tx.rpc.msg"; +import * as _354 from "./upgrade/v1beta1/tx.rpc.msg"; +import * as _507 from "./rpc.query"; +import * as _508 from "./rpc.tx"; export namespace cosmos { export namespace auth { export const v1beta1 = { @@ -108,10 +108,10 @@ export namespace cosmos { ..._29, ..._30, ..._31, - ..._309, - ..._319, - ..._329, - ..._342 + ..._312, + ..._322, + ..._332, + ..._345 }; } export namespace authz { @@ -121,10 +121,10 @@ export namespace cosmos { ..._34, ..._35, ..._36, - ..._310, - ..._320, - ..._330, - ..._343 + ..._313, + ..._323, + ..._333, + ..._346 }; } export namespace bank { @@ -134,10 +134,10 @@ export namespace cosmos { ..._39, ..._40, ..._41, - ..._311, - ..._321, - ..._331, - ..._344 + ..._314, + ..._324, + ..._334, + ..._347 }; } export namespace base { @@ -155,7 +155,7 @@ export namespace cosmos { export const v1beta1 = { ..._44, ..._45, - ..._332 + ..._335 }; } export const v1beta1 = { @@ -179,10 +179,10 @@ export namespace cosmos { ..._51, ..._52, ..._53, - ..._312, - ..._322, - ..._333, - ..._345 + ..._315, + ..._325, + ..._336, + ..._348 }; } export namespace gov { @@ -191,20 +191,20 @@ export namespace cosmos { ..._55, ..._56, ..._57, - ..._313, - ..._323, - ..._334, - ..._346 + ..._316, + ..._326, + ..._337, + ..._349 }; export const v1beta1 = { ..._58, ..._59, ..._60, ..._61, - ..._314, - ..._324, - ..._335, - ..._347 + ..._317, + ..._327, + ..._338, + ..._350 }; } export namespace mint { @@ -213,10 +213,10 @@ export namespace cosmos { ..._63, ..._64, ..._65, - ..._315, - ..._325, - ..._336, - ..._348 + ..._318, + ..._328, + ..._339, + ..._351 }; } export namespace msg { @@ -233,7 +233,7 @@ export namespace cosmos { export const v1beta1 = { ..._68, ..._69, - ..._337 + ..._340 }; } export namespace query { @@ -247,10 +247,10 @@ export namespace cosmos { ..._72, ..._73, ..._74, - ..._316, - ..._326, - ..._338, - ..._349 + ..._319, + ..._329, + ..._341, + ..._352 }; } export namespace staking { @@ -260,10 +260,10 @@ export namespace cosmos { ..._77, ..._78, ..._79, - ..._317, - ..._327, - ..._339, - ..._350 + ..._320, + ..._330, + ..._342, + ..._353 }; } export namespace tx { @@ -275,7 +275,7 @@ export namespace cosmos { export const v1beta1 = { ..._81, ..._82, - ..._340 + ..._343 }; } export namespace upgrade { @@ -283,14 +283,14 @@ export namespace cosmos { ..._83, ..._84, ..._85, - ..._318, - ..._328, - ..._341, - ..._351 + ..._321, + ..._331, + ..._344, + ..._354 }; } export const ClientFactory = { - ..._500, - ..._501 + ..._507, + ..._508 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmwasm/bundle.ts b/packages/types/protobuf/codegen/cosmwasm/bundle.ts index 795915649..9040f1d83 100644 --- a/packages/types/protobuf/codegen/cosmwasm/bundle.ts +++ b/packages/types/protobuf/codegen/cosmwasm/bundle.ts @@ -10,16 +10,16 @@ import * as _94 from "./wasm/v1/proposal"; import * as _95 from "./wasm/v1/query"; import * as _96 from "./wasm/v1/tx"; import * as _97 from "./wasm/v1/types"; -import * as _352 from "./tokenfactory/v1beta1/tx.amino"; -import * as _353 from "./wasm/v1/tx.amino"; -import * as _354 from "./tokenfactory/v1beta1/tx.registry"; -import * as _355 from "./wasm/v1/tx.registry"; -import * as _356 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _357 from "./wasm/v1/query.rpc.Query"; -import * as _358 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _359 from "./wasm/v1/tx.rpc.msg"; -import * as _502 from "./rpc.query"; -import * as _503 from "./rpc.tx"; +import * as _355 from "./tokenfactory/v1beta1/tx.amino"; +import * as _356 from "./wasm/v1/tx.amino"; +import * as _357 from "./tokenfactory/v1beta1/tx.registry"; +import * as _358 from "./wasm/v1/tx.registry"; +import * as _359 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _360 from "./wasm/v1/query.rpc.Query"; +import * as _361 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _362 from "./wasm/v1/tx.rpc.msg"; +import * as _509 from "./rpc.query"; +import * as _510 from "./rpc.tx"; export namespace cosmwasm { export namespace tokenfactory { export const v1beta1 = { @@ -28,10 +28,10 @@ export namespace cosmwasm { ..._88, ..._89, ..._90, - ..._352, - ..._354, - ..._356, - ..._358 + ..._355, + ..._357, + ..._359, + ..._361 }; } export namespace wasm { @@ -43,14 +43,14 @@ export namespace cosmwasm { ..._95, ..._96, ..._97, - ..._353, - ..._355, - ..._357, - ..._359 + ..._356, + ..._358, + ..._360, + ..._362 }; } export const ClientFactory = { - ..._502, - ..._503 + ..._509, + ..._510 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/gaia/bundle.ts b/packages/types/protobuf/codegen/gaia/bundle.ts index efedf35e4..6cff66f4d 100644 --- a/packages/types/protobuf/codegen/gaia/bundle.ts +++ b/packages/types/protobuf/codegen/gaia/bundle.ts @@ -1,26 +1,26 @@ import * as _98 from "./globalfee/v1beta1/genesis"; import * as _99 from "./globalfee/v1beta1/query"; import * as _100 from "./globalfee/v1beta1/tx"; -import * as _360 from "./globalfee/v1beta1/tx.amino"; -import * as _361 from "./globalfee/v1beta1/tx.registry"; -import * as _362 from "./globalfee/v1beta1/query.rpc.Query"; -import * as _363 from "./globalfee/v1beta1/tx.rpc.msg"; -import * as _504 from "./rpc.query"; -import * as _505 from "./rpc.tx"; +import * as _363 from "./globalfee/v1beta1/tx.amino"; +import * as _364 from "./globalfee/v1beta1/tx.registry"; +import * as _365 from "./globalfee/v1beta1/query.rpc.Query"; +import * as _366 from "./globalfee/v1beta1/tx.rpc.msg"; +import * as _511 from "./rpc.query"; +import * as _512 from "./rpc.tx"; export namespace gaia { export namespace globalfee { export const v1beta1 = { ..._98, ..._99, ..._100, - ..._360, - ..._361, - ..._362, - ..._363 + ..._363, + ..._364, + ..._365, + ..._366 }; } export const ClientFactory = { - ..._504, - ..._505 + ..._511, + ..._512 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/bundle.ts b/packages/types/protobuf/codegen/ibc/bundle.ts index 0b9f55d0b..1aaf3c32c 100644 --- a/packages/types/protobuf/codegen/ibc/bundle.ts +++ b/packages/types/protobuf/codegen/ibc/bundle.ts @@ -17,24 +17,31 @@ import * as _124 from "./core/channel/v1/genesis"; import * as _125 from "./core/channel/v1/query"; import * as _126 from "./core/channel/v1/tx"; import * as _127 from "./core/client/v1/client"; -import * as _364 from "./applications/interchain_accounts/controller/v1/tx.amino"; -import * as _365 from "./applications/interchain_accounts/host/v1/tx.amino"; -import * as _366 from "./applications/transfer/v1/tx.amino"; -import * as _367 from "./core/channel/v1/tx.amino"; -import * as _368 from "./applications/interchain_accounts/controller/v1/tx.registry"; -import * as _369 from "./applications/interchain_accounts/host/v1/tx.registry"; -import * as _370 from "./applications/transfer/v1/tx.registry"; -import * as _371 from "./core/channel/v1/tx.registry"; -import * as _372 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; -import * as _373 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; -import * as _374 from "./applications/transfer/v1/query.rpc.Query"; -import * as _375 from "./core/channel/v1/query.rpc.Query"; -import * as _376 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; -import * as _377 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; -import * as _378 from "./applications/transfer/v1/tx.rpc.msg"; -import * as _379 from "./core/channel/v1/tx.rpc.msg"; -import * as _506 from "./rpc.query"; -import * as _507 from "./rpc.tx"; +import * as _128 from "./core/client/v1/genesis"; +import * as _129 from "./core/client/v1/query"; +import * as _130 from "./core/client/v1/tx"; +import * as _367 from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as _368 from "./applications/interchain_accounts/host/v1/tx.amino"; +import * as _369 from "./applications/transfer/v1/tx.amino"; +import * as _370 from "./core/channel/v1/tx.amino"; +import * as _371 from "./core/client/v1/tx.amino"; +import * as _372 from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as _373 from "./applications/interchain_accounts/host/v1/tx.registry"; +import * as _374 from "./applications/transfer/v1/tx.registry"; +import * as _375 from "./core/channel/v1/tx.registry"; +import * as _376 from "./core/client/v1/tx.registry"; +import * as _377 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; +import * as _378 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; +import * as _379 from "./applications/transfer/v1/query.rpc.Query"; +import * as _380 from "./core/channel/v1/query.rpc.Query"; +import * as _381 from "./core/client/v1/query.rpc.Query"; +import * as _382 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; +import * as _383 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; +import * as _384 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _385 from "./core/channel/v1/tx.rpc.msg"; +import * as _386 from "./core/client/v1/tx.rpc.msg"; +import * as _513 from "./rpc.query"; +import * as _514 from "./rpc.tx"; export namespace ibc { export namespace applications { export namespace interchain_accounts { @@ -43,10 +50,10 @@ export namespace ibc { ..._109, ..._110, ..._111, - ..._364, - ..._368, + ..._367, ..._372, - ..._376 + ..._377, + ..._382 }; } export namespace host { @@ -54,10 +61,10 @@ export namespace ibc { ..._112, ..._113, ..._114, - ..._365, - ..._369, + ..._368, ..._373, - ..._377 + ..._378, + ..._383 }; } export const v1 = { @@ -73,10 +80,10 @@ export namespace ibc { ..._120, ..._121, ..._122, - ..._366, - ..._370, + ..._369, ..._374, - ..._378 + ..._379, + ..._384 }; } } @@ -87,20 +94,27 @@ export namespace ibc { ..._124, ..._125, ..._126, - ..._367, - ..._371, + ..._370, ..._375, - ..._379 + ..._380, + ..._385 }; } export namespace client { export const v1 = { - ..._127 + ..._127, + ..._128, + ..._129, + ..._130, + ..._371, + ..._376, + ..._381, + ..._386 }; } } export const ClientFactory = { - ..._506, - ..._507 + ..._513, + ..._514 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/client.ts b/packages/types/protobuf/codegen/ibc/client.ts index c756ed587..3498ab06f 100644 --- a/packages/types/protobuf/codegen/ibc/client.ts +++ b/packages/types/protobuf/codegen/ibc/client.ts @@ -5,17 +5,20 @@ import * as ibcApplicationsInterchainAccountsControllerV1TxRegistry from "./appl import * as ibcApplicationsInterchainAccountsHostV1TxRegistry from "./applications/interchain_accounts/host/v1/tx.registry"; import * as ibcApplicationsTransferV1TxRegistry from "./applications/transfer/v1/tx.registry"; import * as ibcCoreChannelV1TxRegistry from "./core/channel/v1/tx.registry"; +import * as ibcCoreClientV1TxRegistry from "./core/client/v1/tx.registry"; import * as ibcApplicationsInterchainAccountsControllerV1TxAmino from "./applications/interchain_accounts/controller/v1/tx.amino"; import * as ibcApplicationsInterchainAccountsHostV1TxAmino from "./applications/interchain_accounts/host/v1/tx.amino"; import * as ibcApplicationsTransferV1TxAmino from "./applications/transfer/v1/tx.amino"; import * as ibcCoreChannelV1TxAmino from "./core/channel/v1/tx.amino"; +import * as ibcCoreClientV1TxAmino from "./core/client/v1/tx.amino"; export const ibcAminoConverters = { ...ibcApplicationsInterchainAccountsControllerV1TxAmino.AminoConverter, ...ibcApplicationsInterchainAccountsHostV1TxAmino.AminoConverter, ...ibcApplicationsTransferV1TxAmino.AminoConverter, - ...ibcCoreChannelV1TxAmino.AminoConverter + ...ibcCoreChannelV1TxAmino.AminoConverter, + ...ibcCoreClientV1TxAmino.AminoConverter }; -export const ibcProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...ibcApplicationsInterchainAccountsControllerV1TxRegistry.registry, ...ibcApplicationsInterchainAccountsHostV1TxRegistry.registry, ...ibcApplicationsTransferV1TxRegistry.registry, ...ibcCoreChannelV1TxRegistry.registry]; +export const ibcProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...ibcApplicationsInterchainAccountsControllerV1TxRegistry.registry, ...ibcApplicationsInterchainAccountsHostV1TxRegistry.registry, ...ibcApplicationsTransferV1TxRegistry.registry, ...ibcCoreChannelV1TxRegistry.registry, ...ibcCoreClientV1TxRegistry.registry]; export const getSigningIbcClientOptions = ({ defaultTypes = defaultRegistryTypes }: { diff --git a/packages/types/protobuf/codegen/ibc/core/client/v1/genesis.ts b/packages/types/protobuf/codegen/ibc/core/client/v1/genesis.ts new file mode 100644 index 000000000..e595a98b9 --- /dev/null +++ b/packages/types/protobuf/codegen/ibc/core/client/v1/genesis.ts @@ -0,0 +1,425 @@ +//@ts-nocheck +import { IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType, ClientConsensusStates, ClientConsensusStatesAmino, ClientConsensusStatesSDKType, Params, ParamsAmino, ParamsSDKType } from "./client"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** GenesisState defines the ibc client submodule's genesis state. */ +export interface GenesisState { + /** client states with their corresponding identifiers */ + clients: IdentifiedClientState[]; + /** consensus states from each client */ + clientsConsensus: ClientConsensusStates[]; + /** metadata from each client */ + clientsMetadata: IdentifiedGenesisMetadata[]; + params: Params | undefined; + /** + * Deprecated: create_localhost has been deprecated. + * The localhost client is automatically created at genesis. + */ + /** @deprecated */ + createLocalhost: boolean; + /** the sequence for the next generated client identifier */ + nextClientSequence: bigint; +} +export interface GenesisStateProtoMsg { + typeUrl: "/ibc.core.client.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the ibc client submodule's genesis state. */ +export interface GenesisStateAmino { + /** client states with their corresponding identifiers */ + clients?: IdentifiedClientStateAmino[]; + /** consensus states from each client */ + clients_consensus?: ClientConsensusStatesAmino[]; + /** metadata from each client */ + clients_metadata?: IdentifiedGenesisMetadataAmino[]; + params?: ParamsAmino | undefined; + /** + * Deprecated: create_localhost has been deprecated. + * The localhost client is automatically created at genesis. + */ + /** @deprecated */ + create_localhost?: boolean; + /** the sequence for the next generated client identifier */ + next_client_sequence?: string; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the ibc client submodule's genesis state. */ +export interface GenesisStateSDKType { + clients: IdentifiedClientStateSDKType[]; + clients_consensus: ClientConsensusStatesSDKType[]; + clients_metadata: IdentifiedGenesisMetadataSDKType[]; + params: ParamsSDKType | undefined; + /** @deprecated */ + create_localhost: boolean; + next_client_sequence: bigint; +} +/** + * GenesisMetadata defines the genesis type for metadata that clients may return + * with ExportMetadata + */ +export interface GenesisMetadata { + /** store key of metadata without clientID-prefix */ + key: Uint8Array; + /** metadata value */ + value: Uint8Array; +} +export interface GenesisMetadataProtoMsg { + typeUrl: "/ibc.core.client.v1.GenesisMetadata"; + value: Uint8Array; +} +/** + * GenesisMetadata defines the genesis type for metadata that clients may return + * with ExportMetadata + */ +export interface GenesisMetadataAmino { + /** store key of metadata without clientID-prefix */ + key?: string; + /** metadata value */ + value?: string; +} +export interface GenesisMetadataAminoMsg { + type: "cosmos-sdk/GenesisMetadata"; + value: GenesisMetadataAmino; +} +/** + * GenesisMetadata defines the genesis type for metadata that clients may return + * with ExportMetadata + */ +export interface GenesisMetadataSDKType { + key: Uint8Array; + value: Uint8Array; +} +/** + * IdentifiedGenesisMetadata has the client metadata with the corresponding + * client id. + */ +export interface IdentifiedGenesisMetadata { + clientId: string; + clientMetadata: GenesisMetadata[]; +} +export interface IdentifiedGenesisMetadataProtoMsg { + typeUrl: "/ibc.core.client.v1.IdentifiedGenesisMetadata"; + value: Uint8Array; +} +/** + * IdentifiedGenesisMetadata has the client metadata with the corresponding + * client id. + */ +export interface IdentifiedGenesisMetadataAmino { + client_id?: string; + client_metadata?: GenesisMetadataAmino[]; +} +export interface IdentifiedGenesisMetadataAminoMsg { + type: "cosmos-sdk/IdentifiedGenesisMetadata"; + value: IdentifiedGenesisMetadataAmino; +} +/** + * IdentifiedGenesisMetadata has the client metadata with the corresponding + * client id. + */ +export interface IdentifiedGenesisMetadataSDKType { + client_id: string; + client_metadata: GenesisMetadataSDKType[]; +} +function createBaseGenesisState(): GenesisState { + return { + clients: [], + clientsConsensus: [], + clientsMetadata: [], + params: Params.fromPartial({}), + createLocalhost: false, + nextClientSequence: BigInt(0) + }; +} +export const GenesisState = { + typeUrl: "/ibc.core.client.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.clients) { + IdentifiedClientState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.clientsConsensus) { + ClientConsensusStates.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.clientsMetadata) { + IdentifiedGenesisMetadata.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(34).fork()).ldelim(); + } + if (message.createLocalhost === true) { + writer.uint32(40).bool(message.createLocalhost); + } + if (message.nextClientSequence !== BigInt(0)) { + writer.uint32(48).uint64(message.nextClientSequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clients.push(IdentifiedClientState.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.clientsConsensus.push(ClientConsensusStates.decode(reader, reader.uint32(), useInterfaces)); + break; + case 3: + message.clientsMetadata.push(IdentifiedGenesisMetadata.decode(reader, reader.uint32(), useInterfaces)); + break; + case 4: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + case 5: + message.createLocalhost = reader.bool(); + break; + case 6: + message.nextClientSequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.clients = object.clients?.map(e => IdentifiedClientState.fromPartial(e)) || []; + message.clientsConsensus = object.clientsConsensus?.map(e => ClientConsensusStates.fromPartial(e)) || []; + message.clientsMetadata = object.clientsMetadata?.map(e => IdentifiedGenesisMetadata.fromPartial(e)) || []; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.createLocalhost = object.createLocalhost ?? false; + message.nextClientSequence = object.nextClientSequence !== undefined && object.nextClientSequence !== null ? BigInt(object.nextClientSequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.clients = object.clients?.map(e => IdentifiedClientState.fromAmino(e)) || []; + message.clientsConsensus = object.clients_consensus?.map(e => ClientConsensusStates.fromAmino(e)) || []; + message.clientsMetadata = object.clients_metadata?.map(e => IdentifiedGenesisMetadata.fromAmino(e)) || []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.create_localhost !== undefined && object.create_localhost !== null) { + message.createLocalhost = object.create_localhost; + } + if (object.next_client_sequence !== undefined && object.next_client_sequence !== null) { + message.nextClientSequence = BigInt(object.next_client_sequence); + } + return message; + }, + toAmino(message: GenesisState, useInterfaces: boolean = false): GenesisStateAmino { + const obj: any = {}; + if (message.clients) { + obj.clients = message.clients.map(e => e ? IdentifiedClientState.toAmino(e, useInterfaces) : undefined); + } else { + obj.clients = []; + } + if (message.clientsConsensus) { + obj.clients_consensus = message.clientsConsensus.map(e => e ? ClientConsensusStates.toAmino(e, useInterfaces) : undefined); + } else { + obj.clients_consensus = []; + } + if (message.clientsMetadata) { + obj.clients_metadata = message.clientsMetadata.map(e => e ? IdentifiedGenesisMetadata.toAmino(e, useInterfaces) : undefined); + } else { + obj.clients_metadata = []; + } + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + obj.create_localhost = message.createLocalhost; + obj.next_client_sequence = message.nextClientSequence ? message.nextClientSequence.toString() : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState, useInterfaces: boolean = false): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg, useInterfaces: boolean = false): GenesisState { + return GenesisState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +function createBaseGenesisMetadata(): GenesisMetadata { + return { + key: new Uint8Array(), + value: new Uint8Array() + }; +} +export const GenesisMetadata = { + typeUrl: "/ibc.core.client.v1.GenesisMetadata", + encode(message: GenesisMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisMetadata { + const message = createBaseGenesisMetadata(); + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + return message; + }, + fromAmino(object: GenesisMetadataAmino): GenesisMetadata { + const message = createBaseGenesisMetadata(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; + }, + toAmino(message: GenesisMetadata, useInterfaces: boolean = false): GenesisMetadataAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisMetadataAminoMsg): GenesisMetadata { + return GenesisMetadata.fromAmino(object.value); + }, + toAminoMsg(message: GenesisMetadata, useInterfaces: boolean = false): GenesisMetadataAminoMsg { + return { + type: "cosmos-sdk/GenesisMetadata", + value: GenesisMetadata.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: GenesisMetadataProtoMsg, useInterfaces: boolean = false): GenesisMetadata { + return GenesisMetadata.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisMetadata): Uint8Array { + return GenesisMetadata.encode(message).finish(); + }, + toProtoMsg(message: GenesisMetadata): GenesisMetadataProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.GenesisMetadata", + value: GenesisMetadata.encode(message).finish() + }; + } +}; +function createBaseIdentifiedGenesisMetadata(): IdentifiedGenesisMetadata { + return { + clientId: "", + clientMetadata: [] + }; +} +export const IdentifiedGenesisMetadata = { + typeUrl: "/ibc.core.client.v1.IdentifiedGenesisMetadata", + encode(message: IdentifiedGenesisMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.clientMetadata) { + GenesisMetadata.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): IdentifiedGenesisMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdentifiedGenesisMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientMetadata.push(GenesisMetadata.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IdentifiedGenesisMetadata { + const message = createBaseIdentifiedGenesisMetadata(); + message.clientId = object.clientId ?? ""; + message.clientMetadata = object.clientMetadata?.map(e => GenesisMetadata.fromPartial(e)) || []; + return message; + }, + fromAmino(object: IdentifiedGenesisMetadataAmino): IdentifiedGenesisMetadata { + const message = createBaseIdentifiedGenesisMetadata(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.clientMetadata = object.client_metadata?.map(e => GenesisMetadata.fromAmino(e)) || []; + return message; + }, + toAmino(message: IdentifiedGenesisMetadata, useInterfaces: boolean = false): IdentifiedGenesisMetadataAmino { + const obj: any = {}; + obj.client_id = message.clientId; + if (message.clientMetadata) { + obj.client_metadata = message.clientMetadata.map(e => e ? GenesisMetadata.toAmino(e, useInterfaces) : undefined); + } else { + obj.client_metadata = []; + } + return obj; + }, + fromAminoMsg(object: IdentifiedGenesisMetadataAminoMsg): IdentifiedGenesisMetadata { + return IdentifiedGenesisMetadata.fromAmino(object.value); + }, + toAminoMsg(message: IdentifiedGenesisMetadata, useInterfaces: boolean = false): IdentifiedGenesisMetadataAminoMsg { + return { + type: "cosmos-sdk/IdentifiedGenesisMetadata", + value: IdentifiedGenesisMetadata.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: IdentifiedGenesisMetadataProtoMsg, useInterfaces: boolean = false): IdentifiedGenesisMetadata { + return IdentifiedGenesisMetadata.decode(message.value, undefined, useInterfaces); + }, + toProto(message: IdentifiedGenesisMetadata): Uint8Array { + return IdentifiedGenesisMetadata.encode(message).finish(); + }, + toProtoMsg(message: IdentifiedGenesisMetadata): IdentifiedGenesisMetadataProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.IdentifiedGenesisMetadata", + value: IdentifiedGenesisMetadata.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/core/client/v1/query.rpc.Query.ts b/packages/types/protobuf/codegen/ibc/core/client/v1/query.rpc.Query.ts new file mode 100644 index 000000000..b6c9c48c4 --- /dev/null +++ b/packages/types/protobuf/codegen/ibc/core/client/v1/query.rpc.Query.ts @@ -0,0 +1,126 @@ +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryClientStateRequest, QueryClientStateResponse, QueryClientStatesRequest, QueryClientStatesResponse, QueryConsensusStateRequest, QueryConsensusStateResponse, QueryConsensusStatesRequest, QueryConsensusStatesResponse, QueryConsensusStateHeightsRequest, QueryConsensusStateHeightsResponse, QueryClientStatusRequest, QueryClientStatusResponse, QueryClientParamsRequest, QueryClientParamsResponse, QueryUpgradedClientStateRequest, QueryUpgradedClientStateResponse, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponse } from "./query"; +/** Query provides defines the gRPC querier service */ +export interface Query { + /** ClientState queries an IBC light client. */ + clientState(request: QueryClientStateRequest): Promise; + /** ClientStates queries all the IBC light clients of a chain. */ + clientStates(request?: QueryClientStatesRequest): Promise; + /** + * ConsensusState queries a consensus state associated with a client state at + * a given height. + */ + consensusState(request: QueryConsensusStateRequest): Promise; + /** + * ConsensusStates queries all the consensus state associated with a given + * client. + */ + consensusStates(request: QueryConsensusStatesRequest): Promise; + /** ConsensusStateHeights queries the height of every consensus states associated with a given client. */ + consensusStateHeights(request: QueryConsensusStateHeightsRequest): Promise; + /** Status queries the status of an IBC client. */ + clientStatus(request: QueryClientStatusRequest): Promise; + /** ClientParams queries all parameters of the ibc client submodule. */ + clientParams(request?: QueryClientParamsRequest): Promise; + /** UpgradedClientState queries an Upgraded IBC light client. */ + upgradedClientState(request?: QueryUpgradedClientStateRequest): Promise; + /** UpgradedConsensusState queries an Upgraded IBC consensus state. */ + upgradedConsensusState(request?: QueryUpgradedConsensusStateRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.clientState = this.clientState.bind(this); + this.clientStates = this.clientStates.bind(this); + this.consensusState = this.consensusState.bind(this); + this.consensusStates = this.consensusStates.bind(this); + this.consensusStateHeights = this.consensusStateHeights.bind(this); + this.clientStatus = this.clientStatus.bind(this); + this.clientParams = this.clientParams.bind(this); + this.upgradedClientState = this.upgradedClientState.bind(this); + this.upgradedConsensusState = this.upgradedConsensusState.bind(this); + } + clientState(request: QueryClientStateRequest, useInterfaces: boolean = true): Promise { + const data = QueryClientStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientState", data); + return promise.then(data => QueryClientStateResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + clientStates(request: QueryClientStatesRequest = { + pagination: undefined + }, useInterfaces: boolean = true): Promise { + const data = QueryClientStatesRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientStates", data); + return promise.then(data => QueryClientStatesResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + consensusState(request: QueryConsensusStateRequest, useInterfaces: boolean = true): Promise { + const data = QueryConsensusStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ConsensusState", data); + return promise.then(data => QueryConsensusStateResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + consensusStates(request: QueryConsensusStatesRequest, useInterfaces: boolean = true): Promise { + const data = QueryConsensusStatesRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ConsensusStates", data); + return promise.then(data => QueryConsensusStatesResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + consensusStateHeights(request: QueryConsensusStateHeightsRequest, useInterfaces: boolean = true): Promise { + const data = QueryConsensusStateHeightsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ConsensusStateHeights", data); + return promise.then(data => QueryConsensusStateHeightsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + clientStatus(request: QueryClientStatusRequest, useInterfaces: boolean = true): Promise { + const data = QueryClientStatusRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientStatus", data); + return promise.then(data => QueryClientStatusResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + clientParams(request: QueryClientParamsRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryClientParamsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientParams", data); + return promise.then(data => QueryClientParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + upgradedClientState(request: QueryUpgradedClientStateRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryUpgradedClientStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "UpgradedClientState", data); + return promise.then(data => QueryUpgradedClientStateResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + upgradedConsensusState(request: QueryUpgradedConsensusStateRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryUpgradedConsensusStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "UpgradedConsensusState", data); + return promise.then(data => QueryUpgradedConsensusStateResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + clientState(request: QueryClientStateRequest, useInterfaces: boolean = true): Promise { + return queryService.clientState(request, useInterfaces); + }, + clientStates(request?: QueryClientStatesRequest, useInterfaces: boolean = true): Promise { + return queryService.clientStates(request, useInterfaces); + }, + consensusState(request: QueryConsensusStateRequest, useInterfaces: boolean = true): Promise { + return queryService.consensusState(request, useInterfaces); + }, + consensusStates(request: QueryConsensusStatesRequest, useInterfaces: boolean = true): Promise { + return queryService.consensusStates(request, useInterfaces); + }, + consensusStateHeights(request: QueryConsensusStateHeightsRequest, useInterfaces: boolean = true): Promise { + return queryService.consensusStateHeights(request, useInterfaces); + }, + clientStatus(request: QueryClientStatusRequest, useInterfaces: boolean = true): Promise { + return queryService.clientStatus(request, useInterfaces); + }, + clientParams(request?: QueryClientParamsRequest, useInterfaces: boolean = true): Promise { + return queryService.clientParams(request, useInterfaces); + }, + upgradedClientState(request?: QueryUpgradedClientStateRequest, useInterfaces: boolean = true): Promise { + return queryService.upgradedClientState(request, useInterfaces); + }, + upgradedConsensusState(request?: QueryUpgradedConsensusStateRequest, useInterfaces: boolean = true): Promise { + return queryService.upgradedConsensusState(request, useInterfaces); + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/core/client/v1/query.ts b/packages/types/protobuf/codegen/ibc/core/client/v1/query.ts new file mode 100644 index 000000000..d6c0273b4 --- /dev/null +++ b/packages/types/protobuf/codegen/ibc/core/client/v1/query.ts @@ -0,0 +1,1963 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../../cosmos/base/query/v1beta1/pagination"; +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { Height, HeightAmino, HeightSDKType, IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType, ConsensusStateWithHeight, ConsensusStateWithHeightAmino, ConsensusStateWithHeightSDKType, Params, ParamsAmino, ParamsSDKType } from "./client"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * QueryClientStateRequest is the request type for the Query/ClientState RPC + * method + */ +export interface QueryClientStateRequest { + /** client state unique identifier */ + clientId: string; +} +export interface QueryClientStateRequestProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryClientStateRequest"; + value: Uint8Array; +} +/** + * QueryClientStateRequest is the request type for the Query/ClientState RPC + * method + */ +export interface QueryClientStateRequestAmino { + /** client state unique identifier */ + client_id?: string; +} +export interface QueryClientStateRequestAminoMsg { + type: "cosmos-sdk/QueryClientStateRequest"; + value: QueryClientStateRequestAmino; +} +/** + * QueryClientStateRequest is the request type for the Query/ClientState RPC + * method + */ +export interface QueryClientStateRequestSDKType { + client_id: string; +} +/** + * QueryClientStateResponse is the response type for the Query/ClientState RPC + * method. Besides the client state, it includes a proof and the height from + * which the proof was retrieved. + */ +export interface QueryClientStateResponse { + /** client state associated with the request identifier */ + clientState?: Any | undefined; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height | undefined; +} +export interface QueryClientStateResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryClientStateResponse"; + value: Uint8Array; +} +/** + * QueryClientStateResponse is the response type for the Query/ClientState RPC + * method. Besides the client state, it includes a proof and the height from + * which the proof was retrieved. + */ +export interface QueryClientStateResponseAmino { + /** client state associated with the request identifier */ + client_state?: AnyAmino | undefined; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino | undefined; +} +export interface QueryClientStateResponseAminoMsg { + type: "cosmos-sdk/QueryClientStateResponse"; + value: QueryClientStateResponseAmino; +} +/** + * QueryClientStateResponse is the response type for the Query/ClientState RPC + * method. Besides the client state, it includes a proof and the height from + * which the proof was retrieved. + */ +export interface QueryClientStateResponseSDKType { + client_state?: AnySDKType | undefined; + proof: Uint8Array; + proof_height: HeightSDKType | undefined; +} +/** + * QueryClientStatesRequest is the request type for the Query/ClientStates RPC + * method + */ +export interface QueryClientStatesRequest { + /** pagination request */ + pagination?: PageRequest | undefined; +} +export interface QueryClientStatesRequestProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryClientStatesRequest"; + value: Uint8Array; +} +/** + * QueryClientStatesRequest is the request type for the Query/ClientStates RPC + * method + */ +export interface QueryClientStatesRequestAmino { + /** pagination request */ + pagination?: PageRequestAmino | undefined; +} +export interface QueryClientStatesRequestAminoMsg { + type: "cosmos-sdk/QueryClientStatesRequest"; + value: QueryClientStatesRequestAmino; +} +/** + * QueryClientStatesRequest is the request type for the Query/ClientStates RPC + * method + */ +export interface QueryClientStatesRequestSDKType { + pagination?: PageRequestSDKType | undefined; +} +/** + * QueryClientStatesResponse is the response type for the Query/ClientStates RPC + * method. + */ +export interface QueryClientStatesResponse { + /** list of stored ClientStates of the chain. */ + clientStates: IdentifiedClientState[]; + /** pagination response */ + pagination?: PageResponse | undefined; +} +export interface QueryClientStatesResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryClientStatesResponse"; + value: Uint8Array; +} +/** + * QueryClientStatesResponse is the response type for the Query/ClientStates RPC + * method. + */ +export interface QueryClientStatesResponseAmino { + /** list of stored ClientStates of the chain. */ + client_states?: IdentifiedClientStateAmino[]; + /** pagination response */ + pagination?: PageResponseAmino | undefined; +} +export interface QueryClientStatesResponseAminoMsg { + type: "cosmos-sdk/QueryClientStatesResponse"; + value: QueryClientStatesResponseAmino; +} +/** + * QueryClientStatesResponse is the response type for the Query/ClientStates RPC + * method. + */ +export interface QueryClientStatesResponseSDKType { + client_states: IdentifiedClientStateSDKType[]; + pagination?: PageResponseSDKType | undefined; +} +/** + * QueryConsensusStateRequest is the request type for the Query/ConsensusState + * RPC method. Besides the consensus state, it includes a proof and the height + * from which the proof was retrieved. + */ +export interface QueryConsensusStateRequest { + /** client identifier */ + clientId: string; + /** consensus state revision number */ + revisionNumber: bigint; + /** consensus state revision height */ + revisionHeight: bigint; + /** + * latest_height overrrides the height field and queries the latest stored + * ConsensusState + */ + latestHeight: boolean; +} +export interface QueryConsensusStateRequestProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryConsensusStateRequest"; + value: Uint8Array; +} +/** + * QueryConsensusStateRequest is the request type for the Query/ConsensusState + * RPC method. Besides the consensus state, it includes a proof and the height + * from which the proof was retrieved. + */ +export interface QueryConsensusStateRequestAmino { + /** client identifier */ + client_id?: string; + /** consensus state revision number */ + revision_number?: string; + /** consensus state revision height */ + revision_height?: string; + /** + * latest_height overrrides the height field and queries the latest stored + * ConsensusState + */ + latest_height?: boolean; +} +export interface QueryConsensusStateRequestAminoMsg { + type: "cosmos-sdk/QueryConsensusStateRequest"; + value: QueryConsensusStateRequestAmino; +} +/** + * QueryConsensusStateRequest is the request type for the Query/ConsensusState + * RPC method. Besides the consensus state, it includes a proof and the height + * from which the proof was retrieved. + */ +export interface QueryConsensusStateRequestSDKType { + client_id: string; + revision_number: bigint; + revision_height: bigint; + latest_height: boolean; +} +/** + * QueryConsensusStateResponse is the response type for the Query/ConsensusState + * RPC method + */ +export interface QueryConsensusStateResponse { + /** consensus state associated with the client identifier at the given height */ + consensusState?: Any | undefined; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height | undefined; +} +export interface QueryConsensusStateResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryConsensusStateResponse"; + value: Uint8Array; +} +/** + * QueryConsensusStateResponse is the response type for the Query/ConsensusState + * RPC method + */ +export interface QueryConsensusStateResponseAmino { + /** consensus state associated with the client identifier at the given height */ + consensus_state?: AnyAmino | undefined; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino | undefined; +} +export interface QueryConsensusStateResponseAminoMsg { + type: "cosmos-sdk/QueryConsensusStateResponse"; + value: QueryConsensusStateResponseAmino; +} +/** + * QueryConsensusStateResponse is the response type for the Query/ConsensusState + * RPC method + */ +export interface QueryConsensusStateResponseSDKType { + consensus_state?: AnySDKType | undefined; + proof: Uint8Array; + proof_height: HeightSDKType | undefined; +} +/** + * QueryConsensusStatesRequest is the request type for the Query/ConsensusStates + * RPC method. + */ +export interface QueryConsensusStatesRequest { + /** client identifier */ + clientId: string; + /** pagination request */ + pagination?: PageRequest | undefined; +} +export interface QueryConsensusStatesRequestProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryConsensusStatesRequest"; + value: Uint8Array; +} +/** + * QueryConsensusStatesRequest is the request type for the Query/ConsensusStates + * RPC method. + */ +export interface QueryConsensusStatesRequestAmino { + /** client identifier */ + client_id?: string; + /** pagination request */ + pagination?: PageRequestAmino | undefined; +} +export interface QueryConsensusStatesRequestAminoMsg { + type: "cosmos-sdk/QueryConsensusStatesRequest"; + value: QueryConsensusStatesRequestAmino; +} +/** + * QueryConsensusStatesRequest is the request type for the Query/ConsensusStates + * RPC method. + */ +export interface QueryConsensusStatesRequestSDKType { + client_id: string; + pagination?: PageRequestSDKType | undefined; +} +/** + * QueryConsensusStatesResponse is the response type for the + * Query/ConsensusStates RPC method + */ +export interface QueryConsensusStatesResponse { + /** consensus states associated with the identifier */ + consensusStates: ConsensusStateWithHeight[]; + /** pagination response */ + pagination?: PageResponse | undefined; +} +export interface QueryConsensusStatesResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryConsensusStatesResponse"; + value: Uint8Array; +} +/** + * QueryConsensusStatesResponse is the response type for the + * Query/ConsensusStates RPC method + */ +export interface QueryConsensusStatesResponseAmino { + /** consensus states associated with the identifier */ + consensus_states?: ConsensusStateWithHeightAmino[]; + /** pagination response */ + pagination?: PageResponseAmino | undefined; +} +export interface QueryConsensusStatesResponseAminoMsg { + type: "cosmos-sdk/QueryConsensusStatesResponse"; + value: QueryConsensusStatesResponseAmino; +} +/** + * QueryConsensusStatesResponse is the response type for the + * Query/ConsensusStates RPC method + */ +export interface QueryConsensusStatesResponseSDKType { + consensus_states: ConsensusStateWithHeightSDKType[]; + pagination?: PageResponseSDKType | undefined; +} +/** + * QueryConsensusStateHeightsRequest is the request type for Query/ConsensusStateHeights + * RPC method. + */ +export interface QueryConsensusStateHeightsRequest { + /** client identifier */ + clientId: string; + /** pagination request */ + pagination?: PageRequest | undefined; +} +export interface QueryConsensusStateHeightsRequestProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryConsensusStateHeightsRequest"; + value: Uint8Array; +} +/** + * QueryConsensusStateHeightsRequest is the request type for Query/ConsensusStateHeights + * RPC method. + */ +export interface QueryConsensusStateHeightsRequestAmino { + /** client identifier */ + client_id?: string; + /** pagination request */ + pagination?: PageRequestAmino | undefined; +} +export interface QueryConsensusStateHeightsRequestAminoMsg { + type: "cosmos-sdk/QueryConsensusStateHeightsRequest"; + value: QueryConsensusStateHeightsRequestAmino; +} +/** + * QueryConsensusStateHeightsRequest is the request type for Query/ConsensusStateHeights + * RPC method. + */ +export interface QueryConsensusStateHeightsRequestSDKType { + client_id: string; + pagination?: PageRequestSDKType | undefined; +} +/** + * QueryConsensusStateHeightsResponse is the response type for the + * Query/ConsensusStateHeights RPC method + */ +export interface QueryConsensusStateHeightsResponse { + /** consensus state heights */ + consensusStateHeights: Height[]; + /** pagination response */ + pagination?: PageResponse | undefined; +} +export interface QueryConsensusStateHeightsResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryConsensusStateHeightsResponse"; + value: Uint8Array; +} +/** + * QueryConsensusStateHeightsResponse is the response type for the + * Query/ConsensusStateHeights RPC method + */ +export interface QueryConsensusStateHeightsResponseAmino { + /** consensus state heights */ + consensus_state_heights?: HeightAmino[]; + /** pagination response */ + pagination?: PageResponseAmino | undefined; +} +export interface QueryConsensusStateHeightsResponseAminoMsg { + type: "cosmos-sdk/QueryConsensusStateHeightsResponse"; + value: QueryConsensusStateHeightsResponseAmino; +} +/** + * QueryConsensusStateHeightsResponse is the response type for the + * Query/ConsensusStateHeights RPC method + */ +export interface QueryConsensusStateHeightsResponseSDKType { + consensus_state_heights: HeightSDKType[]; + pagination?: PageResponseSDKType | undefined; +} +/** + * QueryClientStatusRequest is the request type for the Query/ClientStatus RPC + * method + */ +export interface QueryClientStatusRequest { + /** client unique identifier */ + clientId: string; +} +export interface QueryClientStatusRequestProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryClientStatusRequest"; + value: Uint8Array; +} +/** + * QueryClientStatusRequest is the request type for the Query/ClientStatus RPC + * method + */ +export interface QueryClientStatusRequestAmino { + /** client unique identifier */ + client_id?: string; +} +export interface QueryClientStatusRequestAminoMsg { + type: "cosmos-sdk/QueryClientStatusRequest"; + value: QueryClientStatusRequestAmino; +} +/** + * QueryClientStatusRequest is the request type for the Query/ClientStatus RPC + * method + */ +export interface QueryClientStatusRequestSDKType { + client_id: string; +} +/** + * QueryClientStatusResponse is the response type for the Query/ClientStatus RPC + * method. It returns the current status of the IBC client. + */ +export interface QueryClientStatusResponse { + status: string; +} +export interface QueryClientStatusResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryClientStatusResponse"; + value: Uint8Array; +} +/** + * QueryClientStatusResponse is the response type for the Query/ClientStatus RPC + * method. It returns the current status of the IBC client. + */ +export interface QueryClientStatusResponseAmino { + status?: string; +} +export interface QueryClientStatusResponseAminoMsg { + type: "cosmos-sdk/QueryClientStatusResponse"; + value: QueryClientStatusResponseAmino; +} +/** + * QueryClientStatusResponse is the response type for the Query/ClientStatus RPC + * method. It returns the current status of the IBC client. + */ +export interface QueryClientStatusResponseSDKType { + status: string; +} +/** + * QueryClientParamsRequest is the request type for the Query/ClientParams RPC + * method. + */ +export interface QueryClientParamsRequest {} +export interface QueryClientParamsRequestProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryClientParamsRequest"; + value: Uint8Array; +} +/** + * QueryClientParamsRequest is the request type for the Query/ClientParams RPC + * method. + */ +export interface QueryClientParamsRequestAmino {} +export interface QueryClientParamsRequestAminoMsg { + type: "cosmos-sdk/QueryClientParamsRequest"; + value: QueryClientParamsRequestAmino; +} +/** + * QueryClientParamsRequest is the request type for the Query/ClientParams RPC + * method. + */ +export interface QueryClientParamsRequestSDKType {} +/** + * QueryClientParamsResponse is the response type for the Query/ClientParams RPC + * method. + */ +export interface QueryClientParamsResponse { + /** params defines the parameters of the module. */ + params?: Params | undefined; +} +export interface QueryClientParamsResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryClientParamsResponse"; + value: Uint8Array; +} +/** + * QueryClientParamsResponse is the response type for the Query/ClientParams RPC + * method. + */ +export interface QueryClientParamsResponseAmino { + /** params defines the parameters of the module. */ + params?: ParamsAmino | undefined; +} +export interface QueryClientParamsResponseAminoMsg { + type: "cosmos-sdk/QueryClientParamsResponse"; + value: QueryClientParamsResponseAmino; +} +/** + * QueryClientParamsResponse is the response type for the Query/ClientParams RPC + * method. + */ +export interface QueryClientParamsResponseSDKType { + params?: ParamsSDKType | undefined; +} +/** + * QueryUpgradedClientStateRequest is the request type for the + * Query/UpgradedClientState RPC method + */ +export interface QueryUpgradedClientStateRequest {} +export interface QueryUpgradedClientStateRequestProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryUpgradedClientStateRequest"; + value: Uint8Array; +} +/** + * QueryUpgradedClientStateRequest is the request type for the + * Query/UpgradedClientState RPC method + */ +export interface QueryUpgradedClientStateRequestAmino {} +export interface QueryUpgradedClientStateRequestAminoMsg { + type: "cosmos-sdk/QueryUpgradedClientStateRequest"; + value: QueryUpgradedClientStateRequestAmino; +} +/** + * QueryUpgradedClientStateRequest is the request type for the + * Query/UpgradedClientState RPC method + */ +export interface QueryUpgradedClientStateRequestSDKType {} +/** + * QueryUpgradedClientStateResponse is the response type for the + * Query/UpgradedClientState RPC method. + */ +export interface QueryUpgradedClientStateResponse { + /** client state associated with the request identifier */ + upgradedClientState?: Any | undefined; +} +export interface QueryUpgradedClientStateResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryUpgradedClientStateResponse"; + value: Uint8Array; +} +/** + * QueryUpgradedClientStateResponse is the response type for the + * Query/UpgradedClientState RPC method. + */ +export interface QueryUpgradedClientStateResponseAmino { + /** client state associated with the request identifier */ + upgraded_client_state?: AnyAmino | undefined; +} +export interface QueryUpgradedClientStateResponseAminoMsg { + type: "cosmos-sdk/QueryUpgradedClientStateResponse"; + value: QueryUpgradedClientStateResponseAmino; +} +/** + * QueryUpgradedClientStateResponse is the response type for the + * Query/UpgradedClientState RPC method. + */ +export interface QueryUpgradedClientStateResponseSDKType { + upgraded_client_state?: AnySDKType | undefined; +} +/** + * QueryUpgradedConsensusStateRequest is the request type for the + * Query/UpgradedConsensusState RPC method + */ +export interface QueryUpgradedConsensusStateRequest {} +export interface QueryUpgradedConsensusStateRequestProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryUpgradedConsensusStateRequest"; + value: Uint8Array; +} +/** + * QueryUpgradedConsensusStateRequest is the request type for the + * Query/UpgradedConsensusState RPC method + */ +export interface QueryUpgradedConsensusStateRequestAmino {} +export interface QueryUpgradedConsensusStateRequestAminoMsg { + type: "cosmos-sdk/QueryUpgradedConsensusStateRequest"; + value: QueryUpgradedConsensusStateRequestAmino; +} +/** + * QueryUpgradedConsensusStateRequest is the request type for the + * Query/UpgradedConsensusState RPC method + */ +export interface QueryUpgradedConsensusStateRequestSDKType {} +/** + * QueryUpgradedConsensusStateResponse is the response type for the + * Query/UpgradedConsensusState RPC method. + */ +export interface QueryUpgradedConsensusStateResponse { + /** Consensus state associated with the request identifier */ + upgradedConsensusState?: Any | undefined; +} +export interface QueryUpgradedConsensusStateResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryUpgradedConsensusStateResponse"; + value: Uint8Array; +} +/** + * QueryUpgradedConsensusStateResponse is the response type for the + * Query/UpgradedConsensusState RPC method. + */ +export interface QueryUpgradedConsensusStateResponseAmino { + /** Consensus state associated with the request identifier */ + upgraded_consensus_state?: AnyAmino | undefined; +} +export interface QueryUpgradedConsensusStateResponseAminoMsg { + type: "cosmos-sdk/QueryUpgradedConsensusStateResponse"; + value: QueryUpgradedConsensusStateResponseAmino; +} +/** + * QueryUpgradedConsensusStateResponse is the response type for the + * Query/UpgradedConsensusState RPC method. + */ +export interface QueryUpgradedConsensusStateResponseSDKType { + upgraded_consensus_state?: AnySDKType | undefined; +} +function createBaseQueryClientStateRequest(): QueryClientStateRequest { + return { + clientId: "" + }; +} +export const QueryClientStateRequest = { + typeUrl: "/ibc.core.client.v1.QueryClientStateRequest", + encode(message: QueryClientStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryClientStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClientStateRequest { + const message = createBaseQueryClientStateRequest(); + message.clientId = object.clientId ?? ""; + return message; + }, + fromAmino(object: QueryClientStateRequestAmino): QueryClientStateRequest { + const message = createBaseQueryClientStateRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + return message; + }, + toAmino(message: QueryClientStateRequest, useInterfaces: boolean = false): QueryClientStateRequestAmino { + const obj: any = {}; + obj.client_id = message.clientId; + return obj; + }, + fromAminoMsg(object: QueryClientStateRequestAminoMsg): QueryClientStateRequest { + return QueryClientStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryClientStateRequest, useInterfaces: boolean = false): QueryClientStateRequestAminoMsg { + return { + type: "cosmos-sdk/QueryClientStateRequest", + value: QueryClientStateRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryClientStateRequestProtoMsg, useInterfaces: boolean = false): QueryClientStateRequest { + return QueryClientStateRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryClientStateRequest): Uint8Array { + return QueryClientStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryClientStateRequest): QueryClientStateRequestProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryClientStateRequest", + value: QueryClientStateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryClientStateResponse(): QueryClientStateResponse { + return { + clientState: undefined, + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryClientStateResponse = { + typeUrl: "/ibc.core.client.v1.QueryClientStateResponse", + encode(message: QueryClientStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryClientStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientState = Any.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClientStateResponse { + const message = createBaseQueryClientStateResponse(); + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryClientStateResponseAmino): QueryClientStateResponse { + const message = createBaseQueryClientStateResponse(); + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryClientStateResponse, useInterfaces: boolean = false): QueryClientStateResponseAmino { + const obj: any = {}; + obj.client_state = message.clientState ? Any.toAmino(message.clientState, useInterfaces) : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight, useInterfaces) : {}; + return obj; + }, + fromAminoMsg(object: QueryClientStateResponseAminoMsg): QueryClientStateResponse { + return QueryClientStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryClientStateResponse, useInterfaces: boolean = false): QueryClientStateResponseAminoMsg { + return { + type: "cosmos-sdk/QueryClientStateResponse", + value: QueryClientStateResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryClientStateResponseProtoMsg, useInterfaces: boolean = false): QueryClientStateResponse { + return QueryClientStateResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryClientStateResponse): Uint8Array { + return QueryClientStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryClientStateResponse): QueryClientStateResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryClientStateResponse", + value: QueryClientStateResponse.encode(message).finish() + }; + } +}; +function createBaseQueryClientStatesRequest(): QueryClientStatesRequest { + return { + pagination: undefined + }; +} +export const QueryClientStatesRequest = { + typeUrl: "/ibc.core.client.v1.QueryClientStatesRequest", + encode(message: QueryClientStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryClientStatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientStatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClientStatesRequest { + const message = createBaseQueryClientStatesRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryClientStatesRequestAmino): QueryClientStatesRequest { + const message = createBaseQueryClientStatesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryClientStatesRequest, useInterfaces: boolean = false): QueryClientStatesRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryClientStatesRequestAminoMsg): QueryClientStatesRequest { + return QueryClientStatesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryClientStatesRequest, useInterfaces: boolean = false): QueryClientStatesRequestAminoMsg { + return { + type: "cosmos-sdk/QueryClientStatesRequest", + value: QueryClientStatesRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryClientStatesRequestProtoMsg, useInterfaces: boolean = false): QueryClientStatesRequest { + return QueryClientStatesRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryClientStatesRequest): Uint8Array { + return QueryClientStatesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryClientStatesRequest): QueryClientStatesRequestProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryClientStatesRequest", + value: QueryClientStatesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryClientStatesResponse(): QueryClientStatesResponse { + return { + clientStates: [], + pagination: undefined + }; +} +export const QueryClientStatesResponse = { + typeUrl: "/ibc.core.client.v1.QueryClientStatesResponse", + encode(message: QueryClientStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.clientStates) { + IdentifiedClientState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryClientStatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientStatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientStates.push(IdentifiedClientState.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClientStatesResponse { + const message = createBaseQueryClientStatesResponse(); + message.clientStates = object.clientStates?.map(e => IdentifiedClientState.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryClientStatesResponseAmino): QueryClientStatesResponse { + const message = createBaseQueryClientStatesResponse(); + message.clientStates = object.client_states?.map(e => IdentifiedClientState.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryClientStatesResponse, useInterfaces: boolean = false): QueryClientStatesResponseAmino { + const obj: any = {}; + if (message.clientStates) { + obj.client_states = message.clientStates.map(e => e ? IdentifiedClientState.toAmino(e, useInterfaces) : undefined); + } else { + obj.client_states = []; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryClientStatesResponseAminoMsg): QueryClientStatesResponse { + return QueryClientStatesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryClientStatesResponse, useInterfaces: boolean = false): QueryClientStatesResponseAminoMsg { + return { + type: "cosmos-sdk/QueryClientStatesResponse", + value: QueryClientStatesResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryClientStatesResponseProtoMsg, useInterfaces: boolean = false): QueryClientStatesResponse { + return QueryClientStatesResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryClientStatesResponse): Uint8Array { + return QueryClientStatesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryClientStatesResponse): QueryClientStatesResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryClientStatesResponse", + value: QueryClientStatesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryConsensusStateRequest(): QueryConsensusStateRequest { + return { + clientId: "", + revisionNumber: BigInt(0), + revisionHeight: BigInt(0), + latestHeight: false + }; +} +export const QueryConsensusStateRequest = { + typeUrl: "/ibc.core.client.v1.QueryConsensusStateRequest", + encode(message: QueryConsensusStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.revisionNumber !== BigInt(0)) { + writer.uint32(16).uint64(message.revisionNumber); + } + if (message.revisionHeight !== BigInt(0)) { + writer.uint32(24).uint64(message.revisionHeight); + } + if (message.latestHeight === true) { + writer.uint32(32).bool(message.latestHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryConsensusStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConsensusStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.revisionNumber = reader.uint64(); + break; + case 3: + message.revisionHeight = reader.uint64(); + break; + case 4: + message.latestHeight = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConsensusStateRequest { + const message = createBaseQueryConsensusStateRequest(); + message.clientId = object.clientId ?? ""; + message.revisionNumber = object.revisionNumber !== undefined && object.revisionNumber !== null ? BigInt(object.revisionNumber.toString()) : BigInt(0); + message.revisionHeight = object.revisionHeight !== undefined && object.revisionHeight !== null ? BigInt(object.revisionHeight.toString()) : BigInt(0); + message.latestHeight = object.latestHeight ?? false; + return message; + }, + fromAmino(object: QueryConsensusStateRequestAmino): QueryConsensusStateRequest { + const message = createBaseQueryConsensusStateRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.revision_number !== undefined && object.revision_number !== null) { + message.revisionNumber = BigInt(object.revision_number); + } + if (object.revision_height !== undefined && object.revision_height !== null) { + message.revisionHeight = BigInt(object.revision_height); + } + if (object.latest_height !== undefined && object.latest_height !== null) { + message.latestHeight = object.latest_height; + } + return message; + }, + toAmino(message: QueryConsensusStateRequest, useInterfaces: boolean = false): QueryConsensusStateRequestAmino { + const obj: any = {}; + obj.client_id = message.clientId; + obj.revision_number = message.revisionNumber ? message.revisionNumber.toString() : undefined; + obj.revision_height = message.revisionHeight ? message.revisionHeight.toString() : undefined; + obj.latest_height = message.latestHeight; + return obj; + }, + fromAminoMsg(object: QueryConsensusStateRequestAminoMsg): QueryConsensusStateRequest { + return QueryConsensusStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryConsensusStateRequest, useInterfaces: boolean = false): QueryConsensusStateRequestAminoMsg { + return { + type: "cosmos-sdk/QueryConsensusStateRequest", + value: QueryConsensusStateRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryConsensusStateRequestProtoMsg, useInterfaces: boolean = false): QueryConsensusStateRequest { + return QueryConsensusStateRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryConsensusStateRequest): Uint8Array { + return QueryConsensusStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryConsensusStateRequest): QueryConsensusStateRequestProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryConsensusStateRequest", + value: QueryConsensusStateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryConsensusStateResponse(): QueryConsensusStateResponse { + return { + consensusState: undefined, + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryConsensusStateResponse = { + typeUrl: "/ibc.core.client.v1.QueryConsensusStateResponse", + encode(message: QueryConsensusStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryConsensusStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConsensusStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusState = Any.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConsensusStateResponse { + const message = createBaseQueryConsensusStateResponse(); + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryConsensusStateResponseAmino): QueryConsensusStateResponse { + const message = createBaseQueryConsensusStateResponse(); + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryConsensusStateResponse, useInterfaces: boolean = false): QueryConsensusStateResponseAmino { + const obj: any = {}; + obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState, useInterfaces) : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight, useInterfaces) : {}; + return obj; + }, + fromAminoMsg(object: QueryConsensusStateResponseAminoMsg): QueryConsensusStateResponse { + return QueryConsensusStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryConsensusStateResponse, useInterfaces: boolean = false): QueryConsensusStateResponseAminoMsg { + return { + type: "cosmos-sdk/QueryConsensusStateResponse", + value: QueryConsensusStateResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryConsensusStateResponseProtoMsg, useInterfaces: boolean = false): QueryConsensusStateResponse { + return QueryConsensusStateResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryConsensusStateResponse): Uint8Array { + return QueryConsensusStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryConsensusStateResponse): QueryConsensusStateResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryConsensusStateResponse", + value: QueryConsensusStateResponse.encode(message).finish() + }; + } +}; +function createBaseQueryConsensusStatesRequest(): QueryConsensusStatesRequest { + return { + clientId: "", + pagination: undefined + }; +} +export const QueryConsensusStatesRequest = { + typeUrl: "/ibc.core.client.v1.QueryConsensusStatesRequest", + encode(message: QueryConsensusStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryConsensusStatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConsensusStatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConsensusStatesRequest { + const message = createBaseQueryConsensusStatesRequest(); + message.clientId = object.clientId ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryConsensusStatesRequestAmino): QueryConsensusStatesRequest { + const message = createBaseQueryConsensusStatesRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryConsensusStatesRequest, useInterfaces: boolean = false): QueryConsensusStatesRequestAmino { + const obj: any = {}; + obj.client_id = message.clientId; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryConsensusStatesRequestAminoMsg): QueryConsensusStatesRequest { + return QueryConsensusStatesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryConsensusStatesRequest, useInterfaces: boolean = false): QueryConsensusStatesRequestAminoMsg { + return { + type: "cosmos-sdk/QueryConsensusStatesRequest", + value: QueryConsensusStatesRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryConsensusStatesRequestProtoMsg, useInterfaces: boolean = false): QueryConsensusStatesRequest { + return QueryConsensusStatesRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryConsensusStatesRequest): Uint8Array { + return QueryConsensusStatesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryConsensusStatesRequest): QueryConsensusStatesRequestProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryConsensusStatesRequest", + value: QueryConsensusStatesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryConsensusStatesResponse(): QueryConsensusStatesResponse { + return { + consensusStates: [], + pagination: undefined + }; +} +export const QueryConsensusStatesResponse = { + typeUrl: "/ibc.core.client.v1.QueryConsensusStatesResponse", + encode(message: QueryConsensusStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.consensusStates) { + ConsensusStateWithHeight.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryConsensusStatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConsensusStatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusStates.push(ConsensusStateWithHeight.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConsensusStatesResponse { + const message = createBaseQueryConsensusStatesResponse(); + message.consensusStates = object.consensusStates?.map(e => ConsensusStateWithHeight.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryConsensusStatesResponseAmino): QueryConsensusStatesResponse { + const message = createBaseQueryConsensusStatesResponse(); + message.consensusStates = object.consensus_states?.map(e => ConsensusStateWithHeight.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryConsensusStatesResponse, useInterfaces: boolean = false): QueryConsensusStatesResponseAmino { + const obj: any = {}; + if (message.consensusStates) { + obj.consensus_states = message.consensusStates.map(e => e ? ConsensusStateWithHeight.toAmino(e, useInterfaces) : undefined); + } else { + obj.consensus_states = []; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryConsensusStatesResponseAminoMsg): QueryConsensusStatesResponse { + return QueryConsensusStatesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryConsensusStatesResponse, useInterfaces: boolean = false): QueryConsensusStatesResponseAminoMsg { + return { + type: "cosmos-sdk/QueryConsensusStatesResponse", + value: QueryConsensusStatesResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryConsensusStatesResponseProtoMsg, useInterfaces: boolean = false): QueryConsensusStatesResponse { + return QueryConsensusStatesResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryConsensusStatesResponse): Uint8Array { + return QueryConsensusStatesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryConsensusStatesResponse): QueryConsensusStatesResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryConsensusStatesResponse", + value: QueryConsensusStatesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryConsensusStateHeightsRequest(): QueryConsensusStateHeightsRequest { + return { + clientId: "", + pagination: undefined + }; +} +export const QueryConsensusStateHeightsRequest = { + typeUrl: "/ibc.core.client.v1.QueryConsensusStateHeightsRequest", + encode(message: QueryConsensusStateHeightsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryConsensusStateHeightsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConsensusStateHeightsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConsensusStateHeightsRequest { + const message = createBaseQueryConsensusStateHeightsRequest(); + message.clientId = object.clientId ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryConsensusStateHeightsRequestAmino): QueryConsensusStateHeightsRequest { + const message = createBaseQueryConsensusStateHeightsRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryConsensusStateHeightsRequest, useInterfaces: boolean = false): QueryConsensusStateHeightsRequestAmino { + const obj: any = {}; + obj.client_id = message.clientId; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryConsensusStateHeightsRequestAminoMsg): QueryConsensusStateHeightsRequest { + return QueryConsensusStateHeightsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryConsensusStateHeightsRequest, useInterfaces: boolean = false): QueryConsensusStateHeightsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryConsensusStateHeightsRequest", + value: QueryConsensusStateHeightsRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryConsensusStateHeightsRequestProtoMsg, useInterfaces: boolean = false): QueryConsensusStateHeightsRequest { + return QueryConsensusStateHeightsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryConsensusStateHeightsRequest): Uint8Array { + return QueryConsensusStateHeightsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryConsensusStateHeightsRequest): QueryConsensusStateHeightsRequestProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryConsensusStateHeightsRequest", + value: QueryConsensusStateHeightsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryConsensusStateHeightsResponse(): QueryConsensusStateHeightsResponse { + return { + consensusStateHeights: [], + pagination: undefined + }; +} +export const QueryConsensusStateHeightsResponse = { + typeUrl: "/ibc.core.client.v1.QueryConsensusStateHeightsResponse", + encode(message: QueryConsensusStateHeightsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.consensusStateHeights) { + Height.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryConsensusStateHeightsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConsensusStateHeightsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusStateHeights.push(Height.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConsensusStateHeightsResponse { + const message = createBaseQueryConsensusStateHeightsResponse(); + message.consensusStateHeights = object.consensusStateHeights?.map(e => Height.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryConsensusStateHeightsResponseAmino): QueryConsensusStateHeightsResponse { + const message = createBaseQueryConsensusStateHeightsResponse(); + message.consensusStateHeights = object.consensus_state_heights?.map(e => Height.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryConsensusStateHeightsResponse, useInterfaces: boolean = false): QueryConsensusStateHeightsResponseAmino { + const obj: any = {}; + if (message.consensusStateHeights) { + obj.consensus_state_heights = message.consensusStateHeights.map(e => e ? Height.toAmino(e, useInterfaces) : undefined); + } else { + obj.consensus_state_heights = []; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryConsensusStateHeightsResponseAminoMsg): QueryConsensusStateHeightsResponse { + return QueryConsensusStateHeightsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryConsensusStateHeightsResponse, useInterfaces: boolean = false): QueryConsensusStateHeightsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryConsensusStateHeightsResponse", + value: QueryConsensusStateHeightsResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryConsensusStateHeightsResponseProtoMsg, useInterfaces: boolean = false): QueryConsensusStateHeightsResponse { + return QueryConsensusStateHeightsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryConsensusStateHeightsResponse): Uint8Array { + return QueryConsensusStateHeightsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryConsensusStateHeightsResponse): QueryConsensusStateHeightsResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryConsensusStateHeightsResponse", + value: QueryConsensusStateHeightsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryClientStatusRequest(): QueryClientStatusRequest { + return { + clientId: "" + }; +} +export const QueryClientStatusRequest = { + typeUrl: "/ibc.core.client.v1.QueryClientStatusRequest", + encode(message: QueryClientStatusRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryClientStatusRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientStatusRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClientStatusRequest { + const message = createBaseQueryClientStatusRequest(); + message.clientId = object.clientId ?? ""; + return message; + }, + fromAmino(object: QueryClientStatusRequestAmino): QueryClientStatusRequest { + const message = createBaseQueryClientStatusRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + return message; + }, + toAmino(message: QueryClientStatusRequest, useInterfaces: boolean = false): QueryClientStatusRequestAmino { + const obj: any = {}; + obj.client_id = message.clientId; + return obj; + }, + fromAminoMsg(object: QueryClientStatusRequestAminoMsg): QueryClientStatusRequest { + return QueryClientStatusRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryClientStatusRequest, useInterfaces: boolean = false): QueryClientStatusRequestAminoMsg { + return { + type: "cosmos-sdk/QueryClientStatusRequest", + value: QueryClientStatusRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryClientStatusRequestProtoMsg, useInterfaces: boolean = false): QueryClientStatusRequest { + return QueryClientStatusRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryClientStatusRequest): Uint8Array { + return QueryClientStatusRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryClientStatusRequest): QueryClientStatusRequestProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryClientStatusRequest", + value: QueryClientStatusRequest.encode(message).finish() + }; + } +}; +function createBaseQueryClientStatusResponse(): QueryClientStatusResponse { + return { + status: "" + }; +} +export const QueryClientStatusResponse = { + typeUrl: "/ibc.core.client.v1.QueryClientStatusResponse", + encode(message: QueryClientStatusResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== "") { + writer.uint32(10).string(message.status); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryClientStatusResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientStatusResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClientStatusResponse { + const message = createBaseQueryClientStatusResponse(); + message.status = object.status ?? ""; + return message; + }, + fromAmino(object: QueryClientStatusResponseAmino): QueryClientStatusResponse { + const message = createBaseQueryClientStatusResponse(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + return message; + }, + toAmino(message: QueryClientStatusResponse, useInterfaces: boolean = false): QueryClientStatusResponseAmino { + const obj: any = {}; + obj.status = message.status; + return obj; + }, + fromAminoMsg(object: QueryClientStatusResponseAminoMsg): QueryClientStatusResponse { + return QueryClientStatusResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryClientStatusResponse, useInterfaces: boolean = false): QueryClientStatusResponseAminoMsg { + return { + type: "cosmos-sdk/QueryClientStatusResponse", + value: QueryClientStatusResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryClientStatusResponseProtoMsg, useInterfaces: boolean = false): QueryClientStatusResponse { + return QueryClientStatusResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryClientStatusResponse): Uint8Array { + return QueryClientStatusResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryClientStatusResponse): QueryClientStatusResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryClientStatusResponse", + value: QueryClientStatusResponse.encode(message).finish() + }; + } +}; +function createBaseQueryClientParamsRequest(): QueryClientParamsRequest { + return {}; +} +export const QueryClientParamsRequest = { + typeUrl: "/ibc.core.client.v1.QueryClientParamsRequest", + encode(_: QueryClientParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryClientParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryClientParamsRequest { + const message = createBaseQueryClientParamsRequest(); + return message; + }, + fromAmino(_: QueryClientParamsRequestAmino): QueryClientParamsRequest { + const message = createBaseQueryClientParamsRequest(); + return message; + }, + toAmino(_: QueryClientParamsRequest, useInterfaces: boolean = false): QueryClientParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryClientParamsRequestAminoMsg): QueryClientParamsRequest { + return QueryClientParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryClientParamsRequest, useInterfaces: boolean = false): QueryClientParamsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryClientParamsRequest", + value: QueryClientParamsRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryClientParamsRequestProtoMsg, useInterfaces: boolean = false): QueryClientParamsRequest { + return QueryClientParamsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryClientParamsRequest): Uint8Array { + return QueryClientParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryClientParamsRequest): QueryClientParamsRequestProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryClientParamsRequest", + value: QueryClientParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryClientParamsResponse(): QueryClientParamsResponse { + return { + params: undefined + }; +} +export const QueryClientParamsResponse = { + typeUrl: "/ibc.core.client.v1.QueryClientParamsResponse", + encode(message: QueryClientParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryClientParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClientParamsResponse { + const message = createBaseQueryClientParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryClientParamsResponseAmino): QueryClientParamsResponse { + const message = createBaseQueryClientParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryClientParamsResponse, useInterfaces: boolean = false): QueryClientParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryClientParamsResponseAminoMsg): QueryClientParamsResponse { + return QueryClientParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryClientParamsResponse, useInterfaces: boolean = false): QueryClientParamsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryClientParamsResponse", + value: QueryClientParamsResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryClientParamsResponseProtoMsg, useInterfaces: boolean = false): QueryClientParamsResponse { + return QueryClientParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryClientParamsResponse): Uint8Array { + return QueryClientParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryClientParamsResponse): QueryClientParamsResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryClientParamsResponse", + value: QueryClientParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryUpgradedClientStateRequest(): QueryUpgradedClientStateRequest { + return {}; +} +export const QueryUpgradedClientStateRequest = { + typeUrl: "/ibc.core.client.v1.QueryUpgradedClientStateRequest", + encode(_: QueryUpgradedClientStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryUpgradedClientStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradedClientStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryUpgradedClientStateRequest { + const message = createBaseQueryUpgradedClientStateRequest(); + return message; + }, + fromAmino(_: QueryUpgradedClientStateRequestAmino): QueryUpgradedClientStateRequest { + const message = createBaseQueryUpgradedClientStateRequest(); + return message; + }, + toAmino(_: QueryUpgradedClientStateRequest, useInterfaces: boolean = false): QueryUpgradedClientStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryUpgradedClientStateRequestAminoMsg): QueryUpgradedClientStateRequest { + return QueryUpgradedClientStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryUpgradedClientStateRequest, useInterfaces: boolean = false): QueryUpgradedClientStateRequestAminoMsg { + return { + type: "cosmos-sdk/QueryUpgradedClientStateRequest", + value: QueryUpgradedClientStateRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryUpgradedClientStateRequestProtoMsg, useInterfaces: boolean = false): QueryUpgradedClientStateRequest { + return QueryUpgradedClientStateRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryUpgradedClientStateRequest): Uint8Array { + return QueryUpgradedClientStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUpgradedClientStateRequest): QueryUpgradedClientStateRequestProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryUpgradedClientStateRequest", + value: QueryUpgradedClientStateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryUpgradedClientStateResponse(): QueryUpgradedClientStateResponse { + return { + upgradedClientState: undefined + }; +} +export const QueryUpgradedClientStateResponse = { + typeUrl: "/ibc.core.client.v1.QueryUpgradedClientStateResponse", + encode(message: QueryUpgradedClientStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryUpgradedClientStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradedClientStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.upgradedClientState = Any.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUpgradedClientStateResponse { + const message = createBaseQueryUpgradedClientStateResponse(); + message.upgradedClientState = object.upgradedClientState !== undefined && object.upgradedClientState !== null ? Any.fromPartial(object.upgradedClientState) : undefined; + return message; + }, + fromAmino(object: QueryUpgradedClientStateResponseAmino): QueryUpgradedClientStateResponse { + const message = createBaseQueryUpgradedClientStateResponse(); + if (object.upgraded_client_state !== undefined && object.upgraded_client_state !== null) { + message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); + } + return message; + }, + toAmino(message: QueryUpgradedClientStateResponse, useInterfaces: boolean = false): QueryUpgradedClientStateResponseAmino { + const obj: any = {}; + obj.upgraded_client_state = message.upgradedClientState ? Any.toAmino(message.upgradedClientState, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryUpgradedClientStateResponseAminoMsg): QueryUpgradedClientStateResponse { + return QueryUpgradedClientStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryUpgradedClientStateResponse, useInterfaces: boolean = false): QueryUpgradedClientStateResponseAminoMsg { + return { + type: "cosmos-sdk/QueryUpgradedClientStateResponse", + value: QueryUpgradedClientStateResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryUpgradedClientStateResponseProtoMsg, useInterfaces: boolean = false): QueryUpgradedClientStateResponse { + return QueryUpgradedClientStateResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryUpgradedClientStateResponse): Uint8Array { + return QueryUpgradedClientStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUpgradedClientStateResponse): QueryUpgradedClientStateResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryUpgradedClientStateResponse", + value: QueryUpgradedClientStateResponse.encode(message).finish() + }; + } +}; +function createBaseQueryUpgradedConsensusStateRequest(): QueryUpgradedConsensusStateRequest { + return {}; +} +export const QueryUpgradedConsensusStateRequest = { + typeUrl: "/ibc.core.client.v1.QueryUpgradedConsensusStateRequest", + encode(_: QueryUpgradedConsensusStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryUpgradedConsensusStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradedConsensusStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryUpgradedConsensusStateRequest { + const message = createBaseQueryUpgradedConsensusStateRequest(); + return message; + }, + fromAmino(_: QueryUpgradedConsensusStateRequestAmino): QueryUpgradedConsensusStateRequest { + const message = createBaseQueryUpgradedConsensusStateRequest(); + return message; + }, + toAmino(_: QueryUpgradedConsensusStateRequest, useInterfaces: boolean = false): QueryUpgradedConsensusStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryUpgradedConsensusStateRequestAminoMsg): QueryUpgradedConsensusStateRequest { + return QueryUpgradedConsensusStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryUpgradedConsensusStateRequest, useInterfaces: boolean = false): QueryUpgradedConsensusStateRequestAminoMsg { + return { + type: "cosmos-sdk/QueryUpgradedConsensusStateRequest", + value: QueryUpgradedConsensusStateRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryUpgradedConsensusStateRequestProtoMsg, useInterfaces: boolean = false): QueryUpgradedConsensusStateRequest { + return QueryUpgradedConsensusStateRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryUpgradedConsensusStateRequest): Uint8Array { + return QueryUpgradedConsensusStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUpgradedConsensusStateRequest): QueryUpgradedConsensusStateRequestProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryUpgradedConsensusStateRequest", + value: QueryUpgradedConsensusStateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryUpgradedConsensusStateResponse(): QueryUpgradedConsensusStateResponse { + return { + upgradedConsensusState: undefined + }; +} +export const QueryUpgradedConsensusStateResponse = { + typeUrl: "/ibc.core.client.v1.QueryUpgradedConsensusStateResponse", + encode(message: QueryUpgradedConsensusStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.upgradedConsensusState !== undefined) { + Any.encode(message.upgradedConsensusState, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryUpgradedConsensusStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradedConsensusStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.upgradedConsensusState = Any.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUpgradedConsensusStateResponse { + const message = createBaseQueryUpgradedConsensusStateResponse(); + message.upgradedConsensusState = object.upgradedConsensusState !== undefined && object.upgradedConsensusState !== null ? Any.fromPartial(object.upgradedConsensusState) : undefined; + return message; + }, + fromAmino(object: QueryUpgradedConsensusStateResponseAmino): QueryUpgradedConsensusStateResponse { + const message = createBaseQueryUpgradedConsensusStateResponse(); + if (object.upgraded_consensus_state !== undefined && object.upgraded_consensus_state !== null) { + message.upgradedConsensusState = Any.fromAmino(object.upgraded_consensus_state); + } + return message; + }, + toAmino(message: QueryUpgradedConsensusStateResponse, useInterfaces: boolean = false): QueryUpgradedConsensusStateResponseAmino { + const obj: any = {}; + obj.upgraded_consensus_state = message.upgradedConsensusState ? Any.toAmino(message.upgradedConsensusState, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryUpgradedConsensusStateResponseAminoMsg): QueryUpgradedConsensusStateResponse { + return QueryUpgradedConsensusStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryUpgradedConsensusStateResponse, useInterfaces: boolean = false): QueryUpgradedConsensusStateResponseAminoMsg { + return { + type: "cosmos-sdk/QueryUpgradedConsensusStateResponse", + value: QueryUpgradedConsensusStateResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryUpgradedConsensusStateResponseProtoMsg, useInterfaces: boolean = false): QueryUpgradedConsensusStateResponse { + return QueryUpgradedConsensusStateResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryUpgradedConsensusStateResponse): Uint8Array { + return QueryUpgradedConsensusStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUpgradedConsensusStateResponse): QueryUpgradedConsensusStateResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryUpgradedConsensusStateResponse", + value: QueryUpgradedConsensusStateResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/core/client/v1/tx.amino.ts b/packages/types/protobuf/codegen/ibc/core/client/v1/tx.amino.ts new file mode 100644 index 000000000..1b5dda001 --- /dev/null +++ b/packages/types/protobuf/codegen/ibc/core/client/v1/tx.amino.ts @@ -0,0 +1,28 @@ +import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgUpdateParams } from "./tx"; +export const AminoConverter = { + "/ibc.core.client.v1.MsgCreateClient": { + aminoType: "cosmos-sdk/MsgCreateClient", + toAmino: MsgCreateClient.toAmino, + fromAmino: MsgCreateClient.fromAmino + }, + "/ibc.core.client.v1.MsgUpdateClient": { + aminoType: "cosmos-sdk/MsgUpdateClient", + toAmino: MsgUpdateClient.toAmino, + fromAmino: MsgUpdateClient.fromAmino + }, + "/ibc.core.client.v1.MsgUpgradeClient": { + aminoType: "cosmos-sdk/MsgUpgradeClient", + toAmino: MsgUpgradeClient.toAmino, + fromAmino: MsgUpgradeClient.fromAmino + }, + "/ibc.core.client.v1.MsgSubmitMisbehaviour": { + aminoType: "cosmos-sdk/MsgSubmitMisbehaviour", + toAmino: MsgSubmitMisbehaviour.toAmino, + fromAmino: MsgSubmitMisbehaviour.fromAmino + }, + "/ibc.core.client.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/core/client/v1/tx.registry.ts b/packages/types/protobuf/codegen/ibc/core/client/v1/tx.registry.ts new file mode 100644 index 000000000..dc4b9dcae --- /dev/null +++ b/packages/types/protobuf/codegen/ibc/core/client/v1/tx.registry.ts @@ -0,0 +1,107 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.client.v1.MsgCreateClient", MsgCreateClient], ["/ibc.core.client.v1.MsgUpdateClient", MsgUpdateClient], ["/ibc.core.client.v1.MsgUpgradeClient", MsgUpgradeClient], ["/ibc.core.client.v1.MsgSubmitMisbehaviour", MsgSubmitMisbehaviour], ["/ibc.core.client.v1.MsgUpdateParams", MsgUpdateParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createClient(value: MsgCreateClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgCreateClient", + value: MsgCreateClient.encode(value).finish() + }; + }, + updateClient(value: MsgUpdateClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + value: MsgUpdateClient.encode(value).finish() + }; + }, + upgradeClient(value: MsgUpgradeClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + value: MsgUpgradeClient.encode(value).finish() + }; + }, + submitMisbehaviour(value: MsgSubmitMisbehaviour) { + return { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + value: MsgSubmitMisbehaviour.encode(value).finish() + }; + }, + updateClientParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + createClient(value: MsgCreateClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgCreateClient", + value + }; + }, + updateClient(value: MsgUpdateClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + value + }; + }, + upgradeClient(value: MsgUpgradeClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + value + }; + }, + submitMisbehaviour(value: MsgSubmitMisbehaviour) { + return { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + value + }; + }, + updateClientParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + value + }; + } + }, + fromPartial: { + createClient(value: MsgCreateClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgCreateClient", + value: MsgCreateClient.fromPartial(value) + }; + }, + updateClient(value: MsgUpdateClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + value: MsgUpdateClient.fromPartial(value) + }; + }, + upgradeClient(value: MsgUpgradeClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + value: MsgUpgradeClient.fromPartial(value) + }; + }, + submitMisbehaviour(value: MsgSubmitMisbehaviour) { + return { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + value: MsgSubmitMisbehaviour.fromPartial(value) + }; + }, + updateClientParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/core/client/v1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/ibc/core/client/v1/tx.rpc.msg.ts new file mode 100644 index 000000000..6ba6ec14c --- /dev/null +++ b/packages/types/protobuf/codegen/ibc/core/client/v1/tx.rpc.msg.ts @@ -0,0 +1,52 @@ +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { MsgCreateClient, MsgCreateClientResponse, MsgUpdateClient, MsgUpdateClientResponse, MsgUpgradeClient, MsgUpgradeClientResponse, MsgSubmitMisbehaviour, MsgSubmitMisbehaviourResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; +/** Msg defines the ibc/client Msg service. */ +export interface Msg { + /** CreateClient defines a rpc handler method for MsgCreateClient. */ + createClient(request: MsgCreateClient): Promise; + /** UpdateClient defines a rpc handler method for MsgUpdateClient. */ + updateClient(request: MsgUpdateClient): Promise; + /** UpgradeClient defines a rpc handler method for MsgUpgradeClient. */ + upgradeClient(request: MsgUpgradeClient): Promise; + /** SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. */ + submitMisbehaviour(request: MsgSubmitMisbehaviour): Promise; + /** UpdateClientParams defines a rpc handler method for MsgUpdateParams. */ + updateClientParams(request: MsgUpdateParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.createClient = this.createClient.bind(this); + this.updateClient = this.updateClient.bind(this); + this.upgradeClient = this.upgradeClient.bind(this); + this.submitMisbehaviour = this.submitMisbehaviour.bind(this); + this.updateClientParams = this.updateClientParams.bind(this); + } + createClient(request: MsgCreateClient, useInterfaces: boolean = true): Promise { + const data = MsgCreateClient.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "CreateClient", data); + return promise.then(data => MsgCreateClientResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + updateClient(request: MsgUpdateClient, useInterfaces: boolean = true): Promise { + const data = MsgUpdateClient.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "UpdateClient", data); + return promise.then(data => MsgUpdateClientResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + upgradeClient(request: MsgUpgradeClient, useInterfaces: boolean = true): Promise { + const data = MsgUpgradeClient.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "UpgradeClient", data); + return promise.then(data => MsgUpgradeClientResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + submitMisbehaviour(request: MsgSubmitMisbehaviour, useInterfaces: boolean = true): Promise { + const data = MsgSubmitMisbehaviour.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "SubmitMisbehaviour", data); + return promise.then(data => MsgSubmitMisbehaviourResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + updateClientParams(request: MsgUpdateParams, useInterfaces: boolean = true): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "UpdateClientParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/core/client/v1/tx.ts b/packages/types/protobuf/codegen/ibc/core/client/v1/tx.ts new file mode 100644 index 000000000..4a43beed3 --- /dev/null +++ b/packages/types/protobuf/codegen/ibc/core/client/v1/tx.ts @@ -0,0 +1,1076 @@ +//@ts-nocheck +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { Params, ParamsAmino, ParamsSDKType } from "./client"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** MsgCreateClient defines a message to create an IBC client */ +export interface MsgCreateClient { + /** light client state */ + clientState?: Any | undefined; + /** + * consensus state associated with the client that corresponds to a given + * height. + */ + consensusState?: Any | undefined; + /** signer address */ + signer: string; +} +export interface MsgCreateClientProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgCreateClient"; + value: Uint8Array; +} +/** MsgCreateClient defines a message to create an IBC client */ +export interface MsgCreateClientAmino { + /** light client state */ + client_state?: AnyAmino | undefined; + /** + * consensus state associated with the client that corresponds to a given + * height. + */ + consensus_state?: AnyAmino | undefined; + /** signer address */ + signer?: string; +} +export interface MsgCreateClientAminoMsg { + type: "cosmos-sdk/MsgCreateClient"; + value: MsgCreateClientAmino; +} +/** MsgCreateClient defines a message to create an IBC client */ +export interface MsgCreateClientSDKType { + client_state?: AnySDKType | undefined; + consensus_state?: AnySDKType | undefined; + signer: string; +} +/** MsgCreateClientResponse defines the Msg/CreateClient response type. */ +export interface MsgCreateClientResponse {} +export interface MsgCreateClientResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgCreateClientResponse"; + value: Uint8Array; +} +/** MsgCreateClientResponse defines the Msg/CreateClient response type. */ +export interface MsgCreateClientResponseAmino {} +export interface MsgCreateClientResponseAminoMsg { + type: "cosmos-sdk/MsgCreateClientResponse"; + value: MsgCreateClientResponseAmino; +} +/** MsgCreateClientResponse defines the Msg/CreateClient response type. */ +export interface MsgCreateClientResponseSDKType {} +/** + * MsgUpdateClient defines an sdk.Msg to update a IBC client state using + * the given client message. + */ +export interface MsgUpdateClient { + /** client unique identifier */ + clientId: string; + /** client message to update the light client */ + clientMessage?: Any | undefined; + /** signer address */ + signer: string; +} +export interface MsgUpdateClientProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient"; + value: Uint8Array; +} +/** + * MsgUpdateClient defines an sdk.Msg to update a IBC client state using + * the given client message. + */ +export interface MsgUpdateClientAmino { + /** client unique identifier */ + client_id?: string; + /** client message to update the light client */ + client_message?: AnyAmino | undefined; + /** signer address */ + signer?: string; +} +export interface MsgUpdateClientAminoMsg { + type: "cosmos-sdk/MsgUpdateClient"; + value: MsgUpdateClientAmino; +} +/** + * MsgUpdateClient defines an sdk.Msg to update a IBC client state using + * the given client message. + */ +export interface MsgUpdateClientSDKType { + client_id: string; + client_message?: AnySDKType | undefined; + signer: string; +} +/** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ +export interface MsgUpdateClientResponse {} +export interface MsgUpdateClientResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpdateClientResponse"; + value: Uint8Array; +} +/** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ +export interface MsgUpdateClientResponseAmino {} +export interface MsgUpdateClientResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateClientResponse"; + value: MsgUpdateClientResponseAmino; +} +/** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ +export interface MsgUpdateClientResponseSDKType {} +/** + * MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client + * state + */ +export interface MsgUpgradeClient { + /** client unique identifier */ + clientId: string; + /** upgraded client state */ + clientState?: Any | undefined; + /** + * upgraded consensus state, only contains enough information to serve as a + * basis of trust in update logic + */ + consensusState?: Any | undefined; + /** proof that old chain committed to new client */ + proofUpgradeClient: Uint8Array; + /** proof that old chain committed to new consensus state */ + proofUpgradeConsensusState: Uint8Array; + /** signer address */ + signer: string; +} +export interface MsgUpgradeClientProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient"; + value: Uint8Array; +} +/** + * MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client + * state + */ +export interface MsgUpgradeClientAmino { + /** client unique identifier */ + client_id?: string; + /** upgraded client state */ + client_state?: AnyAmino | undefined; + /** + * upgraded consensus state, only contains enough information to serve as a + * basis of trust in update logic + */ + consensus_state?: AnyAmino | undefined; + /** proof that old chain committed to new client */ + proof_upgrade_client?: string; + /** proof that old chain committed to new consensus state */ + proof_upgrade_consensus_state?: string; + /** signer address */ + signer?: string; +} +export interface MsgUpgradeClientAminoMsg { + type: "cosmos-sdk/MsgUpgradeClient"; + value: MsgUpgradeClientAmino; +} +/** + * MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client + * state + */ +export interface MsgUpgradeClientSDKType { + client_id: string; + client_state?: AnySDKType | undefined; + consensus_state?: AnySDKType | undefined; + proof_upgrade_client: Uint8Array; + proof_upgrade_consensus_state: Uint8Array; + signer: string; +} +/** MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. */ +export interface MsgUpgradeClientResponse {} +export interface MsgUpgradeClientResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClientResponse"; + value: Uint8Array; +} +/** MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. */ +export interface MsgUpgradeClientResponseAmino {} +export interface MsgUpgradeClientResponseAminoMsg { + type: "cosmos-sdk/MsgUpgradeClientResponse"; + value: MsgUpgradeClientResponseAmino; +} +/** MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. */ +export interface MsgUpgradeClientResponseSDKType {} +/** + * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for + * light client misbehaviour. + * This message has been deprecated. Use MsgUpdateClient instead. + */ +/** @deprecated */ +export interface MsgSubmitMisbehaviour { + /** client unique identifier */ + clientId: string; + /** misbehaviour used for freezing the light client */ + misbehaviour?: Any | undefined; + /** signer address */ + signer: string; +} +export interface MsgSubmitMisbehaviourProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour"; + value: Uint8Array; +} +/** + * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for + * light client misbehaviour. + * This message has been deprecated. Use MsgUpdateClient instead. + */ +/** @deprecated */ +export interface MsgSubmitMisbehaviourAmino { + /** client unique identifier */ + client_id?: string; + /** misbehaviour used for freezing the light client */ + misbehaviour?: AnyAmino | undefined; + /** signer address */ + signer?: string; +} +export interface MsgSubmitMisbehaviourAminoMsg { + type: "cosmos-sdk/MsgSubmitMisbehaviour"; + value: MsgSubmitMisbehaviourAmino; +} +/** + * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for + * light client misbehaviour. + * This message has been deprecated. Use MsgUpdateClient instead. + */ +/** @deprecated */ +export interface MsgSubmitMisbehaviourSDKType { + client_id: string; + misbehaviour?: AnySDKType | undefined; + signer: string; +} +/** + * MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response + * type. + */ +export interface MsgSubmitMisbehaviourResponse {} +export interface MsgSubmitMisbehaviourResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviourResponse"; + value: Uint8Array; +} +/** + * MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response + * type. + */ +export interface MsgSubmitMisbehaviourResponseAmino {} +export interface MsgSubmitMisbehaviourResponseAminoMsg { + type: "cosmos-sdk/MsgSubmitMisbehaviourResponse"; + value: MsgSubmitMisbehaviourResponseAmino; +} +/** + * MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response + * type. + */ +export interface MsgSubmitMisbehaviourResponseSDKType {} +/** MsgUpdateParams defines the sdk.Msg type to update the client parameters. */ +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the client parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params | undefined; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams defines the sdk.Msg type to update the client parameters. */ +export interface MsgUpdateParamsAmino { + /** authority is the address of the governance account. */ + authority?: string; + /** + * params defines the client parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino | undefined; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams defines the sdk.Msg type to update the client parameters. */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType | undefined; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseSDKType {} +function createBaseMsgCreateClient(): MsgCreateClient { + return { + clientState: undefined, + consensusState: undefined, + signer: "" + }; +} +export const MsgCreateClient = { + typeUrl: "/ibc.core.client.v1.MsgCreateClient", + encode(message: MsgCreateClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(10).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgCreateClient { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientState = Any.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.consensusState = Any.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateClient { + const message = createBaseMsgCreateClient(); + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgCreateClientAmino): MsgCreateClient { + const message = createBaseMsgCreateClient(); + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgCreateClient, useInterfaces: boolean = false): MsgCreateClientAmino { + const obj: any = {}; + obj.client_state = message.clientState ? Any.toAmino(message.clientState, useInterfaces) : undefined; + obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState, useInterfaces) : undefined; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgCreateClientAminoMsg): MsgCreateClient { + return MsgCreateClient.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateClient, useInterfaces: boolean = false): MsgCreateClientAminoMsg { + return { + type: "cosmos-sdk/MsgCreateClient", + value: MsgCreateClient.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgCreateClientProtoMsg, useInterfaces: boolean = false): MsgCreateClient { + return MsgCreateClient.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgCreateClient): Uint8Array { + return MsgCreateClient.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateClient): MsgCreateClientProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgCreateClient", + value: MsgCreateClient.encode(message).finish() + }; + } +}; +function createBaseMsgCreateClientResponse(): MsgCreateClientResponse { + return {}; +} +export const MsgCreateClientResponse = { + typeUrl: "/ibc.core.client.v1.MsgCreateClientResponse", + encode(_: MsgCreateClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgCreateClientResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateClientResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCreateClientResponse { + const message = createBaseMsgCreateClientResponse(); + return message; + }, + fromAmino(_: MsgCreateClientResponseAmino): MsgCreateClientResponse { + const message = createBaseMsgCreateClientResponse(); + return message; + }, + toAmino(_: MsgCreateClientResponse, useInterfaces: boolean = false): MsgCreateClientResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreateClientResponseAminoMsg): MsgCreateClientResponse { + return MsgCreateClientResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateClientResponse, useInterfaces: boolean = false): MsgCreateClientResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCreateClientResponse", + value: MsgCreateClientResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgCreateClientResponseProtoMsg, useInterfaces: boolean = false): MsgCreateClientResponse { + return MsgCreateClientResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgCreateClientResponse): Uint8Array { + return MsgCreateClientResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateClientResponse): MsgCreateClientResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgCreateClientResponse", + value: MsgCreateClientResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateClient(): MsgUpdateClient { + return { + clientId: "", + clientMessage: undefined, + signer: "" + }; +} +export const MsgUpdateClient = { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + encode(message: MsgUpdateClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.clientMessage !== undefined) { + Any.encode(message.clientMessage, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateClient { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientMessage = Any.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateClient { + const message = createBaseMsgUpdateClient(); + message.clientId = object.clientId ?? ""; + message.clientMessage = object.clientMessage !== undefined && object.clientMessage !== null ? Any.fromPartial(object.clientMessage) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgUpdateClientAmino): MsgUpdateClient { + const message = createBaseMsgUpdateClient(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.client_message !== undefined && object.client_message !== null) { + message.clientMessage = Any.fromAmino(object.client_message); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgUpdateClient, useInterfaces: boolean = false): MsgUpdateClientAmino { + const obj: any = {}; + obj.client_id = message.clientId; + obj.client_message = message.clientMessage ? Any.toAmino(message.clientMessage, useInterfaces) : undefined; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgUpdateClientAminoMsg): MsgUpdateClient { + return MsgUpdateClient.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateClient, useInterfaces: boolean = false): MsgUpdateClientAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateClient", + value: MsgUpdateClient.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgUpdateClientProtoMsg, useInterfaces: boolean = false): MsgUpdateClient { + return MsgUpdateClient.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateClient): Uint8Array { + return MsgUpdateClient.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateClient): MsgUpdateClientProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + value: MsgUpdateClient.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateClientResponse(): MsgUpdateClientResponse { + return {}; +} +export const MsgUpdateClientResponse = { + typeUrl: "/ibc.core.client.v1.MsgUpdateClientResponse", + encode(_: MsgUpdateClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateClientResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateClientResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateClientResponse { + const message = createBaseMsgUpdateClientResponse(); + return message; + }, + fromAmino(_: MsgUpdateClientResponseAmino): MsgUpdateClientResponse { + const message = createBaseMsgUpdateClientResponse(); + return message; + }, + toAmino(_: MsgUpdateClientResponse, useInterfaces: boolean = false): MsgUpdateClientResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateClientResponseAminoMsg): MsgUpdateClientResponse { + return MsgUpdateClientResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateClientResponse, useInterfaces: boolean = false): MsgUpdateClientResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateClientResponse", + value: MsgUpdateClientResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgUpdateClientResponseProtoMsg, useInterfaces: boolean = false): MsgUpdateClientResponse { + return MsgUpdateClientResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateClientResponse): Uint8Array { + return MsgUpdateClientResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateClientResponse): MsgUpdateClientResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateClientResponse", + value: MsgUpdateClientResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpgradeClient(): MsgUpgradeClient { + return { + clientId: "", + clientState: undefined, + consensusState: undefined, + proofUpgradeClient: new Uint8Array(), + proofUpgradeConsensusState: new Uint8Array(), + signer: "" + }; +} +export const MsgUpgradeClient = { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + encode(message: MsgUpgradeClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(18).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(26).fork()).ldelim(); + } + if (message.proofUpgradeClient.length !== 0) { + writer.uint32(34).bytes(message.proofUpgradeClient); + } + if (message.proofUpgradeConsensusState.length !== 0) { + writer.uint32(42).bytes(message.proofUpgradeConsensusState); + } + if (message.signer !== "") { + writer.uint32(50).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpgradeClient { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpgradeClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = Any.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.consensusState = Any.decode(reader, reader.uint32(), useInterfaces); + break; + case 4: + message.proofUpgradeClient = reader.bytes(); + break; + case 5: + message.proofUpgradeConsensusState = reader.bytes(); + break; + case 6: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpgradeClient { + const message = createBaseMsgUpgradeClient(); + message.clientId = object.clientId ?? ""; + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; + message.proofUpgradeClient = object.proofUpgradeClient ?? new Uint8Array(); + message.proofUpgradeConsensusState = object.proofUpgradeConsensusState ?? new Uint8Array(); + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgUpgradeClientAmino): MsgUpgradeClient { + const message = createBaseMsgUpgradeClient(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.proof_upgrade_client !== undefined && object.proof_upgrade_client !== null) { + message.proofUpgradeClient = bytesFromBase64(object.proof_upgrade_client); + } + if (object.proof_upgrade_consensus_state !== undefined && object.proof_upgrade_consensus_state !== null) { + message.proofUpgradeConsensusState = bytesFromBase64(object.proof_upgrade_consensus_state); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgUpgradeClient, useInterfaces: boolean = false): MsgUpgradeClientAmino { + const obj: any = {}; + obj.client_id = message.clientId; + obj.client_state = message.clientState ? Any.toAmino(message.clientState, useInterfaces) : undefined; + obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState, useInterfaces) : undefined; + obj.proof_upgrade_client = message.proofUpgradeClient ? base64FromBytes(message.proofUpgradeClient) : undefined; + obj.proof_upgrade_consensus_state = message.proofUpgradeConsensusState ? base64FromBytes(message.proofUpgradeConsensusState) : undefined; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgUpgradeClientAminoMsg): MsgUpgradeClient { + return MsgUpgradeClient.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpgradeClient, useInterfaces: boolean = false): MsgUpgradeClientAminoMsg { + return { + type: "cosmos-sdk/MsgUpgradeClient", + value: MsgUpgradeClient.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgUpgradeClientProtoMsg, useInterfaces: boolean = false): MsgUpgradeClient { + return MsgUpgradeClient.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpgradeClient): Uint8Array { + return MsgUpgradeClient.encode(message).finish(); + }, + toProtoMsg(message: MsgUpgradeClient): MsgUpgradeClientProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + value: MsgUpgradeClient.encode(message).finish() + }; + } +}; +function createBaseMsgUpgradeClientResponse(): MsgUpgradeClientResponse { + return {}; +} +export const MsgUpgradeClientResponse = { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClientResponse", + encode(_: MsgUpgradeClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpgradeClientResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpgradeClientResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpgradeClientResponse { + const message = createBaseMsgUpgradeClientResponse(); + return message; + }, + fromAmino(_: MsgUpgradeClientResponseAmino): MsgUpgradeClientResponse { + const message = createBaseMsgUpgradeClientResponse(); + return message; + }, + toAmino(_: MsgUpgradeClientResponse, useInterfaces: boolean = false): MsgUpgradeClientResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpgradeClientResponseAminoMsg): MsgUpgradeClientResponse { + return MsgUpgradeClientResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpgradeClientResponse, useInterfaces: boolean = false): MsgUpgradeClientResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpgradeClientResponse", + value: MsgUpgradeClientResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgUpgradeClientResponseProtoMsg, useInterfaces: boolean = false): MsgUpgradeClientResponse { + return MsgUpgradeClientResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpgradeClientResponse): Uint8Array { + return MsgUpgradeClientResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpgradeClientResponse): MsgUpgradeClientResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClientResponse", + value: MsgUpgradeClientResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSubmitMisbehaviour(): MsgSubmitMisbehaviour { + return { + clientId: "", + misbehaviour: undefined, + signer: "" + }; +} +export const MsgSubmitMisbehaviour = { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + encode(message: MsgSubmitMisbehaviour, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.misbehaviour !== undefined) { + Any.encode(message.misbehaviour, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSubmitMisbehaviour { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitMisbehaviour(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.misbehaviour = Any.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSubmitMisbehaviour { + const message = createBaseMsgSubmitMisbehaviour(); + message.clientId = object.clientId ?? ""; + message.misbehaviour = object.misbehaviour !== undefined && object.misbehaviour !== null ? Any.fromPartial(object.misbehaviour) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgSubmitMisbehaviourAmino): MsgSubmitMisbehaviour { + const message = createBaseMsgSubmitMisbehaviour(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.misbehaviour !== undefined && object.misbehaviour !== null) { + message.misbehaviour = Any.fromAmino(object.misbehaviour); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgSubmitMisbehaviour, useInterfaces: boolean = false): MsgSubmitMisbehaviourAmino { + const obj: any = {}; + obj.client_id = message.clientId; + obj.misbehaviour = message.misbehaviour ? Any.toAmino(message.misbehaviour, useInterfaces) : undefined; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgSubmitMisbehaviourAminoMsg): MsgSubmitMisbehaviour { + return MsgSubmitMisbehaviour.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitMisbehaviour, useInterfaces: boolean = false): MsgSubmitMisbehaviourAminoMsg { + return { + type: "cosmos-sdk/MsgSubmitMisbehaviour", + value: MsgSubmitMisbehaviour.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgSubmitMisbehaviourProtoMsg, useInterfaces: boolean = false): MsgSubmitMisbehaviour { + return MsgSubmitMisbehaviour.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSubmitMisbehaviour): Uint8Array { + return MsgSubmitMisbehaviour.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitMisbehaviour): MsgSubmitMisbehaviourProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + value: MsgSubmitMisbehaviour.encode(message).finish() + }; + } +}; +function createBaseMsgSubmitMisbehaviourResponse(): MsgSubmitMisbehaviourResponse { + return {}; +} +export const MsgSubmitMisbehaviourResponse = { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviourResponse", + encode(_: MsgSubmitMisbehaviourResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSubmitMisbehaviourResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitMisbehaviourResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSubmitMisbehaviourResponse { + const message = createBaseMsgSubmitMisbehaviourResponse(); + return message; + }, + fromAmino(_: MsgSubmitMisbehaviourResponseAmino): MsgSubmitMisbehaviourResponse { + const message = createBaseMsgSubmitMisbehaviourResponse(); + return message; + }, + toAmino(_: MsgSubmitMisbehaviourResponse, useInterfaces: boolean = false): MsgSubmitMisbehaviourResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSubmitMisbehaviourResponseAminoMsg): MsgSubmitMisbehaviourResponse { + return MsgSubmitMisbehaviourResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitMisbehaviourResponse, useInterfaces: boolean = false): MsgSubmitMisbehaviourResponseAminoMsg { + return { + type: "cosmos-sdk/MsgSubmitMisbehaviourResponse", + value: MsgSubmitMisbehaviourResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgSubmitMisbehaviourResponseProtoMsg, useInterfaces: boolean = false): MsgSubmitMisbehaviourResponse { + return MsgSubmitMisbehaviourResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSubmitMisbehaviourResponse): Uint8Array { + return MsgSubmitMisbehaviourResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitMisbehaviourResponse): MsgSubmitMisbehaviourResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviourResponse", + value: MsgSubmitMisbehaviourResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams, useInterfaces: boolean = false): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams, useInterfaces: boolean = false): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg, useInterfaces: boolean = false): MsgUpdateParams { + return MsgUpdateParams.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.core.client.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse, useInterfaces: boolean = false): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse, useInterfaces: boolean = false): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg, useInterfaces: boolean = false): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/rpc.query.ts b/packages/types/protobuf/codegen/ibc/rpc.query.ts index 42f8f0c80..493f63885 100644 --- a/packages/types/protobuf/codegen/ibc/rpc.query.ts +++ b/packages/types/protobuf/codegen/ibc/rpc.query.ts @@ -66,6 +66,9 @@ export const createRPCQueryClient = async ({ core: { channel: { v1: (await import("./core/channel/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, + client: { + v1: (await import("./core/client/v1/query.rpc.Query")).createRpcQueryExtension(client) } } } diff --git a/packages/types/protobuf/codegen/ibc/rpc.tx.ts b/packages/types/protobuf/codegen/ibc/rpc.tx.ts index f78765d34..c7236772f 100644 --- a/packages/types/protobuf/codegen/ibc/rpc.tx.ts +++ b/packages/types/protobuf/codegen/ibc/rpc.tx.ts @@ -51,6 +51,9 @@ export const createRPCMsgClient = async ({ core: { channel: { v1: new (await import("./core/channel/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + client: { + v1: new (await import("./core/client/v1/tx.rpc.msg")).MsgClientImpl(rpc) } } } diff --git a/packages/types/protobuf/codegen/juno/bundle.ts b/packages/types/protobuf/codegen/juno/bundle.ts index 8d7f5964a..f701e7159 100644 --- a/packages/types/protobuf/codegen/juno/bundle.ts +++ b/packages/types/protobuf/codegen/juno/bundle.ts @@ -1,46 +1,46 @@ -import * as _128 from "./feeshare/v1/feeshare"; -import * as _129 from "./feeshare/v1/genesis"; -import * as _130 from "./feeshare/v1/query"; -import * as _131 from "./feeshare/v1/tx"; -import * as _132 from "./mint/genesis"; -import * as _133 from "./mint/mint"; -import * as _134 from "./mint/query"; -import * as _135 from "./mint/tx"; -import * as _380 from "./feeshare/v1/tx.amino"; -import * as _381 from "./mint/tx.amino"; -import * as _382 from "./feeshare/v1/tx.registry"; -import * as _383 from "./mint/tx.registry"; -import * as _384 from "./feeshare/v1/query.rpc.Query"; -import * as _385 from "./mint/query.rpc.Query"; -import * as _386 from "./feeshare/v1/tx.rpc.msg"; -import * as _387 from "./mint/tx.rpc.msg"; -import * as _508 from "./rpc.query"; -import * as _509 from "./rpc.tx"; +import * as _131 from "./feeshare/v1/feeshare"; +import * as _132 from "./feeshare/v1/genesis"; +import * as _133 from "./feeshare/v1/query"; +import * as _134 from "./feeshare/v1/tx"; +import * as _135 from "./mint/genesis"; +import * as _136 from "./mint/mint"; +import * as _137 from "./mint/query"; +import * as _138 from "./mint/tx"; +import * as _387 from "./feeshare/v1/tx.amino"; +import * as _388 from "./mint/tx.amino"; +import * as _389 from "./feeshare/v1/tx.registry"; +import * as _390 from "./mint/tx.registry"; +import * as _391 from "./feeshare/v1/query.rpc.Query"; +import * as _392 from "./mint/query.rpc.Query"; +import * as _393 from "./feeshare/v1/tx.rpc.msg"; +import * as _394 from "./mint/tx.rpc.msg"; +import * as _515 from "./rpc.query"; +import * as _516 from "./rpc.tx"; export namespace juno { export namespace feeshare { export const v1 = { - ..._128, - ..._129, - ..._130, ..._131, - ..._380, - ..._382, - ..._384, - ..._386 + ..._132, + ..._133, + ..._134, + ..._387, + ..._389, + ..._391, + ..._393 }; } export const mint = { - ..._132, - ..._133, - ..._134, ..._135, - ..._381, - ..._383, - ..._385, - ..._387 + ..._136, + ..._137, + ..._138, + ..._388, + ..._390, + ..._392, + ..._394 }; export const ClientFactory = { - ..._508, - ..._509 + ..._515, + ..._516 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/neutron/bundle.ts b/packages/types/protobuf/codegen/neutron/bundle.ts index d0158e3e0..7da0815cb 100644 --- a/packages/types/protobuf/codegen/neutron/bundle.ts +++ b/packages/types/protobuf/codegen/neutron/bundle.ts @@ -1,88 +1,85 @@ -import * as _136 from "./contractmanager/v1/failure"; -import * as _137 from "./cron/genesis"; -import * as _138 from "./cron/params"; -import * as _139 from "./cron/query"; -import * as _140 from "./cron/schedule"; -import * as _141 from "./cron/tx"; -import * as _142 from "./dex/deposit_record"; -import * as _143 from "./dex/genesis"; -import * as _144 from "./dex/limit_order_expiration"; -import * as _145 from "./dex/limit_order_tranche_user"; -import * as _146 from "./dex/limit_order_tranche"; -import * as _147 from "./dex/pair_id"; -import * as _148 from "./dex/params"; -import * as _149 from "./dex/pool_metadata"; -import * as _150 from "./dex/pool_reserves"; -import * as _151 from "./dex/pool"; -import * as _152 from "./dex/query"; -import * as _153 from "./dex/tick_liquidity"; -import * as _154 from "./dex/trade_pair_id"; -import * as _155 from "./dex/tx"; -import * as _156 from "./feeburner/genesis"; -import * as _157 from "./feeburner/params"; -import * as _158 from "./feeburner/query"; -import * as _159 from "./feeburner/total_burned_neutrons_amount"; -import * as _160 from "./feeburner/tx"; -import * as _161 from "./feerefunder/fee"; -import * as _162 from "./feerefunder/genesis"; -import * as _163 from "./feerefunder/params"; -import * as _164 from "./feerefunder/query"; -import * as _165 from "./feerefunder/tx"; -import * as _166 from "./interchainqueries/genesis"; -import * as _167 from "./interchainqueries/params"; -import * as _168 from "./interchainqueries/query"; -import * as _169 from "./interchainqueries/tx"; -import * as _170 from "./interchaintxs/v1/genesis"; -import * as _171 from "./interchaintxs/v1/params"; -import * as _172 from "./interchaintxs/v1/query"; -import * as _173 from "./interchaintxs/v1/tx"; -import * as _388 from "./cron/tx.amino"; -import * as _389 from "./dex/tx.amino"; -import * as _390 from "./feeburner/tx.amino"; -import * as _391 from "./feerefunder/tx.amino"; -import * as _392 from "./interchainqueries/tx.amino"; -import * as _393 from "./interchaintxs/v1/tx.amino"; -import * as _394 from "./cron/tx.registry"; -import * as _395 from "./dex/tx.registry"; -import * as _396 from "./feeburner/tx.registry"; -import * as _397 from "./feerefunder/tx.registry"; -import * as _398 from "./interchainqueries/tx.registry"; -import * as _399 from "./interchaintxs/v1/tx.registry"; -import * as _400 from "./cron/query.rpc.Query"; -import * as _401 from "./dex/query.rpc.Query"; -import * as _402 from "./feeburner/query.rpc.Query"; -import * as _403 from "./feerefunder/query.rpc.Query"; -import * as _404 from "./interchainqueries/query.rpc.Query"; -import * as _405 from "./interchaintxs/v1/query.rpc.Query"; -import * as _406 from "./cron/tx.rpc.msg"; -import * as _407 from "./dex/tx.rpc.msg"; -import * as _408 from "./feeburner/tx.rpc.msg"; -import * as _409 from "./feerefunder/tx.rpc.msg"; -import * as _410 from "./interchainqueries/tx.rpc.msg"; -import * as _411 from "./interchaintxs/v1/tx.rpc.msg"; -import * as _510 from "./rpc.query"; -import * as _511 from "./rpc.tx"; +import * as _139 from "./contractmanager/v1/failure"; +import * as _140 from "./cron/genesis"; +import * as _141 from "./cron/params"; +import * as _142 from "./cron/query"; +import * as _143 from "./cron/schedule"; +import * as _144 from "./cron/tx"; +import * as _145 from "./dex/deposit_record"; +import * as _146 from "./dex/genesis"; +import * as _147 from "./dex/limit_order_expiration"; +import * as _148 from "./dex/limit_order_tranche_user"; +import * as _149 from "./dex/limit_order_tranche"; +import * as _150 from "./dex/pair_id"; +import * as _151 from "./dex/params"; +import * as _152 from "./dex/pool_metadata"; +import * as _153 from "./dex/pool_reserves"; +import * as _154 from "./dex/pool"; +import * as _155 from "./dex/query"; +import * as _156 from "./dex/tick_liquidity"; +import * as _157 from "./dex/trade_pair_id"; +import * as _158 from "./dex/tx"; +import * as _159 from "./feeburner/genesis"; +import * as _160 from "./feeburner/params"; +import * as _161 from "./feeburner/query"; +import * as _162 from "./feeburner/total_burned_neutrons_amount"; +import * as _163 from "./feeburner/tx"; +import * as _164 from "./feerefunder/fee"; +import * as _165 from "./feerefunder/genesis"; +import * as _166 from "./feerefunder/params"; +import * as _167 from "./feerefunder/query"; +import * as _168 from "./feerefunder/tx"; +import * as _169 from "./interchainqueries/genesis"; +import * as _170 from "./interchainqueries/params"; +import * as _171 from "./interchainqueries/query"; +import * as _172 from "./interchainqueries/tx"; +import * as _173 from "./interchaintxs/v1/genesis"; +import * as _174 from "./interchaintxs/v1/params"; +import * as _175 from "./interchaintxs/v1/query"; +import * as _176 from "./interchaintxs/v1/tx"; +import * as _395 from "./cron/tx.amino"; +import * as _396 from "./dex/tx.amino"; +import * as _397 from "./feeburner/tx.amino"; +import * as _398 from "./feerefunder/tx.amino"; +import * as _399 from "./interchainqueries/tx.amino"; +import * as _400 from "./interchaintxs/v1/tx.amino"; +import * as _401 from "./cron/tx.registry"; +import * as _402 from "./dex/tx.registry"; +import * as _403 from "./feeburner/tx.registry"; +import * as _404 from "./feerefunder/tx.registry"; +import * as _405 from "./interchainqueries/tx.registry"; +import * as _406 from "./interchaintxs/v1/tx.registry"; +import * as _407 from "./cron/query.rpc.Query"; +import * as _408 from "./dex/query.rpc.Query"; +import * as _409 from "./feeburner/query.rpc.Query"; +import * as _410 from "./feerefunder/query.rpc.Query"; +import * as _411 from "./interchainqueries/query.rpc.Query"; +import * as _412 from "./interchaintxs/v1/query.rpc.Query"; +import * as _413 from "./cron/tx.rpc.msg"; +import * as _414 from "./dex/tx.rpc.msg"; +import * as _415 from "./feeburner/tx.rpc.msg"; +import * as _416 from "./feerefunder/tx.rpc.msg"; +import * as _417 from "./interchainqueries/tx.rpc.msg"; +import * as _418 from "./interchaintxs/v1/tx.rpc.msg"; +import * as _517 from "./rpc.query"; +import * as _518 from "./rpc.tx"; export namespace neutron { export namespace contractmanager { export const v1 = { - ..._136 + ..._139 }; } export const cron = { - ..._137, - ..._138, - ..._139, ..._140, ..._141, - ..._388, - ..._394, - ..._400, - ..._406 - }; - export const dex = { ..._142, ..._143, ..._144, + ..._395, + ..._401, + ..._407, + ..._413 + }; + export const dex = { ..._145, ..._146, ..._147, @@ -94,57 +91,60 @@ export namespace neutron { ..._153, ..._154, ..._155, - ..._389, - ..._395, - ..._401, - ..._407 - }; - export const feeburner = { ..._156, ..._157, ..._158, - ..._159, - ..._160, - ..._390, ..._396, ..._402, - ..._408 + ..._408, + ..._414 }; - export const feerefunder = { + export const feeburner = { + ..._159, + ..._160, ..._161, ..._162, ..._163, - ..._164, - ..._165, - ..._391, ..._397, ..._403, - ..._409 + ..._409, + ..._415 }; - export const interchainqueries = { + export const feerefunder = { + ..._164, + ..._165, ..._166, ..._167, ..._168, - ..._169, - ..._392, ..._398, ..._404, - ..._410 + ..._410, + ..._416 + }; + export const interchainqueries = { + ..._169, + ..._170, + ..._171, + ..._172, + ..._399, + ..._405, + ..._411, + ..._417 }; export namespace interchaintxs { export const v1 = { - ..._170, - ..._171, - ..._172, ..._173, - ..._393, - ..._399, - ..._405, - ..._411 + ..._174, + ..._175, + ..._176, + ..._400, + ..._406, + ..._412, + ..._418 }; } export const ClientFactory = { - ..._510, - ..._511 + ..._517, + ..._518 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/neutron/client.ts b/packages/types/protobuf/codegen/neutron/client.ts index 9d864d753..1caf8781d 100644 --- a/packages/types/protobuf/codegen/neutron/client.ts +++ b/packages/types/protobuf/codegen/neutron/client.ts @@ -7,24 +7,21 @@ import * as neutronFeeburnerTxRegistry from "./feeburner/tx.registry"; import * as neutronFeerefunderTxRegistry from "./feerefunder/tx.registry"; import * as neutronInterchainqueriesTxRegistry from "./interchainqueries/tx.registry"; import * as neutronInterchaintxsV1TxRegistry from "./interchaintxs/v1/tx.registry"; -import * as neutronTransferV1TxRegistry from "./transfer/v1/tx.registry"; import * as neutronCronTxAmino from "./cron/tx.amino"; import * as neutronDexTxAmino from "./dex/tx.amino"; import * as neutronFeeburnerTxAmino from "./feeburner/tx.amino"; import * as neutronFeerefunderTxAmino from "./feerefunder/tx.amino"; import * as neutronInterchainqueriesTxAmino from "./interchainqueries/tx.amino"; import * as neutronInterchaintxsV1TxAmino from "./interchaintxs/v1/tx.amino"; -import * as neutronTransferV1TxAmino from "./transfer/v1/tx.amino"; export const neutronAminoConverters = { ...neutronCronTxAmino.AminoConverter, ...neutronDexTxAmino.AminoConverter, ...neutronFeeburnerTxAmino.AminoConverter, ...neutronFeerefunderTxAmino.AminoConverter, ...neutronInterchainqueriesTxAmino.AminoConverter, - ...neutronInterchaintxsV1TxAmino.AminoConverter, - ...neutronTransferV1TxAmino.AminoConverter, + ...neutronInterchaintxsV1TxAmino.AminoConverter }; -export const neutronProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...neutronCronTxRegistry.registry, ...neutronDexTxRegistry.registry, ...neutronFeeburnerTxRegistry.registry, ...neutronFeerefunderTxRegistry.registry, ...neutronInterchainqueriesTxRegistry.registry, ...neutronInterchaintxsV1TxRegistry.registry, ...neutronTransferV1TxRegistry.registry]; +export const neutronProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...neutronCronTxRegistry.registry, ...neutronDexTxRegistry.registry, ...neutronFeeburnerTxRegistry.registry, ...neutronFeerefunderTxRegistry.registry, ...neutronInterchainqueriesTxRegistry.registry, ...neutronInterchaintxsV1TxRegistry.registry]; export const getSigningNeutronClientOptions = ({ defaultTypes = defaultRegistryTypes }: { diff --git a/packages/types/protobuf/codegen/noble/bundle.ts b/packages/types/protobuf/codegen/noble/bundle.ts index e97722648..31998b425 100644 --- a/packages/types/protobuf/codegen/noble/bundle.ts +++ b/packages/types/protobuf/codegen/noble/bundle.ts @@ -1,16 +1,16 @@ -import * as _288 from "../tariff/genesis"; -import * as _289 from "../tariff/params"; -import * as _290 from "../tariff/query"; -import * as _495 from "../tariff/query.rpc.Query"; -import * as _518 from "./rpc.query"; +import * as _291 from "../tariff/genesis"; +import * as _292 from "../tariff/params"; +import * as _293 from "../tariff/query"; +import * as _502 from "../tariff/query.rpc.Query"; +import * as _525 from "./rpc.query"; export namespace noble { export const tariff = { - ..._288, - ..._289, - ..._290, - ..._495 + ..._291, + ..._292, + ..._293, + ..._502 }; export const ClientFactory = { - ..._518 + ..._525 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/bundle.ts b/packages/types/protobuf/codegen/osmosis/bundle.ts index 2a4fc436b..e869eaea4 100644 --- a/packages/types/protobuf/codegen/osmosis/bundle.ts +++ b/packages/types/protobuf/codegen/osmosis/bundle.ts @@ -1,151 +1,148 @@ -import * as _174 from "./accum/v1beta1/accum"; -import * as _175 from "./concentratedliquidity/params"; -import * as _176 from "./cosmwasmpool/v1beta1/genesis"; -import * as _177 from "./cosmwasmpool/v1beta1/gov"; -import * as _178 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; -import * as _179 from "./cosmwasmpool/v1beta1/model/module_query_msg"; -import * as _180 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; -import * as _181 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; -import * as _182 from "./cosmwasmpool/v1beta1/model/pool"; -import * as _183 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; -import * as _184 from "./cosmwasmpool/v1beta1/model/tx"; -import * as _185 from "./cosmwasmpool/v1beta1/params"; -import * as _186 from "./cosmwasmpool/v1beta1/query"; -import * as _187 from "./cosmwasmpool/v1beta1/tx"; -import * as _188 from "./gamm/pool-models/balancer/balancerPool"; -import * as _189 from "./gamm/v1beta1/genesis"; -import * as _190 from "./gamm/v1beta1/gov"; -import * as _191 from "./gamm/v1beta1/query"; -import * as _192 from "./gamm/v1beta1/shared"; -import * as _193 from "./gamm/v1beta1/tx"; -import * as _194 from "./gamm/pool-models/balancer/tx/tx"; -import * as _195 from "./gamm/pool-models/stableswap/stableswap_pool"; -import * as _196 from "./gamm/pool-models/stableswap/tx"; -import * as _197 from "./incentives/gauge"; -import * as _198 from "./incentives/genesis"; -import * as _199 from "./incentives/gov"; -import * as _200 from "./incentives/group"; -import * as _201 from "./incentives/params"; -import * as _202 from "./incentives/query"; -import * as _203 from "./incentives/tx"; -import * as _204 from "./lockup/genesis"; -import * as _205 from "./lockup/lock"; -import * as _206 from "./lockup/params"; -import * as _207 from "./lockup/query"; -import * as _208 from "./lockup/tx"; -import * as _209 from "./pool-incentives/v1beta1/genesis"; -import * as _210 from "./pool-incentives/v1beta1/gov"; -import * as _211 from "./pool-incentives/v1beta1/incentives"; -import * as _212 from "./pool-incentives/v1beta1/query"; -import * as _213 from "./pool-incentives/v1beta1/shared"; -import * as _214 from "./poolmanager/v1beta1/genesis"; -import * as _215 from "./poolmanager/v1beta1/gov"; -import * as _216 from "./poolmanager/v1beta1/module_route"; -import * as _217 from "./poolmanager/v1beta1/query"; -import * as _218 from "./poolmanager/v1beta1/swap_route"; -import * as _219 from "./poolmanager/v1beta1/tx"; -import * as _220 from "./protorev/v1beta1/genesis"; -import * as _221 from "./protorev/v1beta1/gov"; -import * as _222 from "./protorev/v1beta1/params"; -import * as _223 from "./protorev/v1beta1/protorev"; -import * as _224 from "./protorev/v1beta1/query"; -import * as _225 from "./protorev/v1beta1/tx"; -import * as _226 from "./superfluid/genesis"; -import * as _227 from "./superfluid/params"; -import * as _228 from "./superfluid/query"; -import * as _229 from "./superfluid/superfluid"; -import * as _230 from "./superfluid/tx"; -import * as _231 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _232 from "./tokenfactory/v1beta1/genesis"; -import * as _233 from "./tokenfactory/v1beta1/params"; -import * as _234 from "./tokenfactory/v1beta1/query"; -import * as _235 from "./tokenfactory/v1beta1/tx"; -import * as _236 from "./txfees/v1beta1/feetoken"; -import * as _237 from "./txfees/v1beta1/genesis"; -import * as _238 from "./txfees/v1beta1/gov"; -import * as _239 from "./txfees/v1beta1/query"; -import * as _240 from "./valset-pref/v1beta1/query"; -import * as _241 from "./valset-pref/v1beta1/state"; -import * as _242 from "./valset-pref/v1beta1/tx"; -import * as _412 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; -import * as _413 from "./concentratedliquidity/v1beta1/tx.amino"; -import * as _414 from "./gamm/pool-models/balancer/tx/tx.amino"; -import * as _415 from "./gamm/pool-models/stableswap/tx.amino"; -import * as _416 from "./gamm/v1beta1/tx.amino"; -import * as _417 from "./incentives/tx.amino"; -import * as _418 from "./lockup/tx.amino"; -import * as _419 from "./poolmanager/v1beta1/tx.amino"; -import * as _420 from "./protorev/v1beta1/tx.amino"; -import * as _421 from "./superfluid/tx.amino"; -import * as _422 from "./tokenfactory/v1beta1/tx.amino"; -import * as _423 from "./valset-pref/v1beta1/tx.amino"; -import * as _424 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; -import * as _425 from "./concentratedliquidity/v1beta1/tx.registry"; -import * as _426 from "./gamm/pool-models/balancer/tx/tx.registry"; -import * as _427 from "./gamm/pool-models/stableswap/tx.registry"; -import * as _428 from "./gamm/v1beta1/tx.registry"; -import * as _429 from "./incentives/tx.registry"; -import * as _430 from "./lockup/tx.registry"; -import * as _431 from "./poolmanager/v1beta1/tx.registry"; -import * as _432 from "./protorev/v1beta1/tx.registry"; -import * as _433 from "./superfluid/tx.registry"; -import * as _434 from "./tokenfactory/v1beta1/tx.registry"; -import * as _435 from "./valset-pref/v1beta1/tx.registry"; -import * as _436 from "./concentratedliquidity/v1beta1/query.rpc.Query"; -import * as _437 from "./cosmwasmpool/v1beta1/query.rpc.Query"; -import * as _438 from "./gamm/v1beta1/query.rpc.Query"; -import * as _439 from "./incentives/query.rpc.Query"; -import * as _440 from "./lockup/query.rpc.Query"; -import * as _441 from "./pool-incentives/v1beta1/query.rpc.Query"; -import * as _442 from "./poolmanager/v1beta1/query.rpc.Query"; -import * as _443 from "./protorev/v1beta1/query.rpc.Query"; -import * as _444 from "./superfluid/query.rpc.Query"; -import * as _445 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _446 from "./txfees/v1beta1/query.rpc.Query"; -import * as _447 from "./valset-pref/v1beta1/query.rpc.Query"; -import * as _448 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; -import * as _449 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; -import * as _450 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; -import * as _451 from "./gamm/pool-models/stableswap/tx.rpc.msg"; -import * as _452 from "./gamm/v1beta1/tx.rpc.msg"; -import * as _453 from "./incentives/tx.rpc.msg"; -import * as _454 from "./lockup/tx.rpc.msg"; -import * as _455 from "./poolmanager/v1beta1/tx.rpc.msg"; -import * as _456 from "./protorev/v1beta1/tx.rpc.msg"; -import * as _457 from "./superfluid/tx.rpc.msg"; -import * as _458 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _459 from "./valset-pref/v1beta1/tx.rpc.msg"; -import * as _512 from "./rpc.query"; -import * as _513 from "./rpc.tx"; +import * as _177 from "./accum/v1beta1/accum"; +import * as _178 from "./concentratedliquidity/params"; +import * as _179 from "./cosmwasmpool/v1beta1/genesis"; +import * as _180 from "./cosmwasmpool/v1beta1/gov"; +import * as _181 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; +import * as _182 from "./cosmwasmpool/v1beta1/model/module_query_msg"; +import * as _183 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; +import * as _184 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; +import * as _185 from "./cosmwasmpool/v1beta1/model/pool"; +import * as _186 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; +import * as _187 from "./cosmwasmpool/v1beta1/model/tx"; +import * as _188 from "./cosmwasmpool/v1beta1/params"; +import * as _189 from "./cosmwasmpool/v1beta1/query"; +import * as _190 from "./cosmwasmpool/v1beta1/tx"; +import * as _191 from "./gamm/pool-models/balancer/balancerPool"; +import * as _192 from "./gamm/v1beta1/genesis"; +import * as _193 from "./gamm/v1beta1/gov"; +import * as _194 from "./gamm/v1beta1/query"; +import * as _195 from "./gamm/v1beta1/shared"; +import * as _196 from "./gamm/v1beta1/tx"; +import * as _197 from "./gamm/pool-models/balancer/tx/tx"; +import * as _198 from "./gamm/pool-models/stableswap/stableswap_pool"; +import * as _199 from "./gamm/pool-models/stableswap/tx"; +import * as _200 from "./incentives/gauge"; +import * as _201 from "./incentives/genesis"; +import * as _202 from "./incentives/gov"; +import * as _203 from "./incentives/group"; +import * as _204 from "./incentives/params"; +import * as _205 from "./incentives/query"; +import * as _206 from "./incentives/tx"; +import * as _207 from "./lockup/genesis"; +import * as _208 from "./lockup/lock"; +import * as _209 from "./lockup/params"; +import * as _210 from "./lockup/query"; +import * as _211 from "./lockup/tx"; +import * as _212 from "./pool-incentives/v1beta1/genesis"; +import * as _213 from "./pool-incentives/v1beta1/gov"; +import * as _214 from "./pool-incentives/v1beta1/incentives"; +import * as _215 from "./pool-incentives/v1beta1/query"; +import * as _216 from "./pool-incentives/v1beta1/shared"; +import * as _217 from "./poolmanager/v1beta1/genesis"; +import * as _218 from "./poolmanager/v1beta1/gov"; +import * as _219 from "./poolmanager/v1beta1/module_route"; +import * as _220 from "./poolmanager/v1beta1/query"; +import * as _221 from "./poolmanager/v1beta1/swap_route"; +import * as _222 from "./poolmanager/v1beta1/tx"; +import * as _223 from "./protorev/v1beta1/genesis"; +import * as _224 from "./protorev/v1beta1/gov"; +import * as _225 from "./protorev/v1beta1/params"; +import * as _226 from "./protorev/v1beta1/protorev"; +import * as _227 from "./protorev/v1beta1/query"; +import * as _228 from "./protorev/v1beta1/tx"; +import * as _229 from "./superfluid/genesis"; +import * as _230 from "./superfluid/params"; +import * as _231 from "./superfluid/query"; +import * as _232 from "./superfluid/superfluid"; +import * as _233 from "./superfluid/tx"; +import * as _234 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _235 from "./tokenfactory/v1beta1/genesis"; +import * as _236 from "./tokenfactory/v1beta1/params"; +import * as _237 from "./tokenfactory/v1beta1/query"; +import * as _238 from "./tokenfactory/v1beta1/tx"; +import * as _239 from "./txfees/v1beta1/feetoken"; +import * as _240 from "./txfees/v1beta1/genesis"; +import * as _241 from "./txfees/v1beta1/gov"; +import * as _242 from "./txfees/v1beta1/query"; +import * as _243 from "./valset-pref/v1beta1/query"; +import * as _244 from "./valset-pref/v1beta1/state"; +import * as _245 from "./valset-pref/v1beta1/tx"; +import * as _419 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; +import * as _420 from "./concentratedliquidity/v1beta1/tx.amino"; +import * as _421 from "./gamm/pool-models/balancer/tx/tx.amino"; +import * as _422 from "./gamm/pool-models/stableswap/tx.amino"; +import * as _423 from "./gamm/v1beta1/tx.amino"; +import * as _424 from "./incentives/tx.amino"; +import * as _425 from "./lockup/tx.amino"; +import * as _426 from "./poolmanager/v1beta1/tx.amino"; +import * as _427 from "./protorev/v1beta1/tx.amino"; +import * as _428 from "./superfluid/tx.amino"; +import * as _429 from "./tokenfactory/v1beta1/tx.amino"; +import * as _430 from "./valset-pref/v1beta1/tx.amino"; +import * as _431 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; +import * as _432 from "./concentratedliquidity/v1beta1/tx.registry"; +import * as _433 from "./gamm/pool-models/balancer/tx/tx.registry"; +import * as _434 from "./gamm/pool-models/stableswap/tx.registry"; +import * as _435 from "./gamm/v1beta1/tx.registry"; +import * as _436 from "./incentives/tx.registry"; +import * as _437 from "./lockup/tx.registry"; +import * as _438 from "./poolmanager/v1beta1/tx.registry"; +import * as _439 from "./protorev/v1beta1/tx.registry"; +import * as _440 from "./superfluid/tx.registry"; +import * as _441 from "./tokenfactory/v1beta1/tx.registry"; +import * as _442 from "./valset-pref/v1beta1/tx.registry"; +import * as _443 from "./concentratedliquidity/v1beta1/query.rpc.Query"; +import * as _444 from "./cosmwasmpool/v1beta1/query.rpc.Query"; +import * as _445 from "./gamm/v1beta1/query.rpc.Query"; +import * as _446 from "./incentives/query.rpc.Query"; +import * as _447 from "./lockup/query.rpc.Query"; +import * as _448 from "./pool-incentives/v1beta1/query.rpc.Query"; +import * as _449 from "./poolmanager/v1beta1/query.rpc.Query"; +import * as _450 from "./protorev/v1beta1/query.rpc.Query"; +import * as _451 from "./superfluid/query.rpc.Query"; +import * as _452 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _453 from "./txfees/v1beta1/query.rpc.Query"; +import * as _454 from "./valset-pref/v1beta1/query.rpc.Query"; +import * as _455 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; +import * as _456 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; +import * as _457 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; +import * as _458 from "./gamm/pool-models/stableswap/tx.rpc.msg"; +import * as _459 from "./gamm/v1beta1/tx.rpc.msg"; +import * as _460 from "./incentives/tx.rpc.msg"; +import * as _461 from "./lockup/tx.rpc.msg"; +import * as _462 from "./poolmanager/v1beta1/tx.rpc.msg"; +import * as _463 from "./protorev/v1beta1/tx.rpc.msg"; +import * as _464 from "./superfluid/tx.rpc.msg"; +import * as _465 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _466 from "./valset-pref/v1beta1/tx.rpc.msg"; +import * as _519 from "./rpc.query"; +import * as _520 from "./rpc.tx"; export namespace osmosis { export namespace accum { export const v1beta1 = { - ..._174 + ..._177 }; } export const concentratedliquidity = { - ..._175, + ..._178, poolmodel: { concentrated: { v1beta1: { - ..._412, - ..._424, - ..._448 + ..._419, + ..._431, + ..._455 } } }, v1beta1: { - ..._413, - ..._425, - ..._436, - ..._449 + ..._420, + ..._432, + ..._443, + ..._456 } }; export namespace cosmwasmpool { export const v1beta1 = { - ..._176, - ..._177, - ..._178, ..._179, ..._180, ..._181, @@ -155,150 +152,153 @@ export namespace osmosis { ..._185, ..._186, ..._187, - ..._437 + ..._188, + ..._189, + ..._190, + ..._444 }; } export namespace gamm { export const v1beta1 = { - ..._188, - ..._189, - ..._190, ..._191, ..._192, ..._193, - ..._416, - ..._428, - ..._438, - ..._452 + ..._194, + ..._195, + ..._196, + ..._423, + ..._435, + ..._445, + ..._459 }; export namespace poolmodels { export namespace balancer { export const v1beta1 = { - ..._194, - ..._414, - ..._426, - ..._450 + ..._197, + ..._421, + ..._433, + ..._457 }; } export namespace stableswap { export const v1beta1 = { - ..._195, - ..._196, - ..._415, - ..._427, - ..._451 + ..._198, + ..._199, + ..._422, + ..._434, + ..._458 }; } } } export const incentives = { - ..._197, - ..._198, - ..._199, ..._200, ..._201, ..._202, ..._203, - ..._417, - ..._429, - ..._439, - ..._453 - }; - export const lockup = { ..._204, ..._205, ..._206, + ..._424, + ..._436, + ..._446, + ..._460 + }; + export const lockup = { ..._207, ..._208, - ..._418, - ..._430, - ..._440, - ..._454 + ..._209, + ..._210, + ..._211, + ..._425, + ..._437, + ..._447, + ..._461 }; export namespace poolincentives { export const v1beta1 = { - ..._209, - ..._210, - ..._211, ..._212, ..._213, - ..._441 + ..._214, + ..._215, + ..._216, + ..._448 }; } export namespace poolmanager { export const v1beta1 = { - ..._214, - ..._215, - ..._216, ..._217, ..._218, ..._219, - ..._419, - ..._431, - ..._442, - ..._455 + ..._220, + ..._221, + ..._222, + ..._426, + ..._438, + ..._449, + ..._462 }; } export namespace protorev { export const v1beta1 = { - ..._220, - ..._221, - ..._222, ..._223, ..._224, ..._225, - ..._420, - ..._432, - ..._443, - ..._456 + ..._226, + ..._227, + ..._228, + ..._427, + ..._439, + ..._450, + ..._463 }; } export const superfluid = { - ..._226, - ..._227, - ..._228, ..._229, ..._230, - ..._421, - ..._433, - ..._444, - ..._457 + ..._231, + ..._232, + ..._233, + ..._428, + ..._440, + ..._451, + ..._464 }; export namespace tokenfactory { export const v1beta1 = { - ..._231, - ..._232, - ..._233, ..._234, ..._235, - ..._422, - ..._434, - ..._445, - ..._458 - }; - } - export namespace txfees { - export const v1beta1 = { ..._236, ..._237, ..._238, - ..._239, - ..._446 + ..._429, + ..._441, + ..._452, + ..._465 }; } - export namespace valsetpref { + export namespace txfees { export const v1beta1 = { + ..._239, ..._240, ..._241, ..._242, - ..._423, - ..._435, - ..._447, - ..._459 + ..._453 + }; + } + export namespace valsetpref { + export const v1beta1 = { + ..._243, + ..._244, + ..._245, + ..._430, + ..._442, + ..._454, + ..._466 }; } export const ClientFactory = { - ..._512, - ..._513 + ..._519, + ..._520 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/publicawesome/bundle.ts b/packages/types/protobuf/codegen/publicawesome/bundle.ts index 4642bcef4..47b417380 100644 --- a/packages/types/protobuf/codegen/publicawesome/bundle.ts +++ b/packages/types/protobuf/codegen/publicawesome/bundle.ts @@ -1,88 +1,88 @@ -import * as _243 from "./stargaze/alloc/v1beta1/genesis"; -import * as _244 from "./stargaze/alloc/v1beta1/params"; -import * as _245 from "./stargaze/alloc/v1beta1/query"; -import * as _246 from "./stargaze/alloc/v1beta1/tx"; -import * as _247 from "./stargaze/cron/v1/cron"; -import * as _248 from "./stargaze/cron/v1/genesis"; -import * as _249 from "./stargaze/cron/v1/proposal"; -import * as _250 from "./stargaze/cron/v1/query"; -import * as _251 from "./stargaze/cron/v1/tx"; -import * as _252 from "./stargaze/globalfee/v1/genesis"; -import * as _253 from "./stargaze/globalfee/v1/globalfee"; -import * as _254 from "./stargaze/globalfee/v1/proposal"; -import * as _255 from "./stargaze/globalfee/v1/query"; -import * as _256 from "./stargaze/globalfee/v1/tx"; -import * as _257 from "./stargaze/mint/v1beta1/genesis"; -import * as _258 from "./stargaze/mint/v1beta1/mint"; -import * as _259 from "./stargaze/mint/v1beta1/query"; -import * as _260 from "./stargaze/mint/v1beta1/tx"; -import * as _460 from "./stargaze/alloc/v1beta1/tx.amino"; -import * as _461 from "./stargaze/cron/v1/tx.amino"; -import * as _462 from "./stargaze/globalfee/v1/tx.amino"; -import * as _463 from "./stargaze/alloc/v1beta1/tx.registry"; -import * as _464 from "./stargaze/cron/v1/tx.registry"; -import * as _465 from "./stargaze/globalfee/v1/tx.registry"; -import * as _466 from "./stargaze/alloc/v1beta1/query.rpc.Query"; -import * as _467 from "./stargaze/cron/v1/query.rpc.Query"; -import * as _468 from "./stargaze/globalfee/v1/query.rpc.Query"; -import * as _469 from "./stargaze/mint/v1beta1/query.rpc.Query"; -import * as _470 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; -import * as _471 from "./stargaze/cron/v1/tx.rpc.msg"; -import * as _472 from "./stargaze/globalfee/v1/tx.rpc.msg"; -import * as _514 from "./rpc.query"; -import * as _515 from "./rpc.tx"; +import * as _246 from "./stargaze/alloc/v1beta1/genesis"; +import * as _247 from "./stargaze/alloc/v1beta1/params"; +import * as _248 from "./stargaze/alloc/v1beta1/query"; +import * as _249 from "./stargaze/alloc/v1beta1/tx"; +import * as _250 from "./stargaze/cron/v1/cron"; +import * as _251 from "./stargaze/cron/v1/genesis"; +import * as _252 from "./stargaze/cron/v1/proposal"; +import * as _253 from "./stargaze/cron/v1/query"; +import * as _254 from "./stargaze/cron/v1/tx"; +import * as _255 from "./stargaze/globalfee/v1/genesis"; +import * as _256 from "./stargaze/globalfee/v1/globalfee"; +import * as _257 from "./stargaze/globalfee/v1/proposal"; +import * as _258 from "./stargaze/globalfee/v1/query"; +import * as _259 from "./stargaze/globalfee/v1/tx"; +import * as _260 from "./stargaze/mint/v1beta1/genesis"; +import * as _261 from "./stargaze/mint/v1beta1/mint"; +import * as _262 from "./stargaze/mint/v1beta1/query"; +import * as _263 from "./stargaze/mint/v1beta1/tx"; +import * as _467 from "./stargaze/alloc/v1beta1/tx.amino"; +import * as _468 from "./stargaze/cron/v1/tx.amino"; +import * as _469 from "./stargaze/globalfee/v1/tx.amino"; +import * as _470 from "./stargaze/alloc/v1beta1/tx.registry"; +import * as _471 from "./stargaze/cron/v1/tx.registry"; +import * as _472 from "./stargaze/globalfee/v1/tx.registry"; +import * as _473 from "./stargaze/alloc/v1beta1/query.rpc.Query"; +import * as _474 from "./stargaze/cron/v1/query.rpc.Query"; +import * as _475 from "./stargaze/globalfee/v1/query.rpc.Query"; +import * as _476 from "./stargaze/mint/v1beta1/query.rpc.Query"; +import * as _477 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; +import * as _478 from "./stargaze/cron/v1/tx.rpc.msg"; +import * as _479 from "./stargaze/globalfee/v1/tx.rpc.msg"; +import * as _521 from "./rpc.query"; +import * as _522 from "./rpc.tx"; export namespace publicawesome { export namespace stargaze { export namespace alloc { export const v1beta1 = { - ..._243, - ..._244, - ..._245, ..._246, - ..._460, - ..._463, - ..._466, - ..._470 - }; - } - export namespace cron { - export const v1 = { ..._247, ..._248, ..._249, - ..._250, - ..._251, - ..._461, - ..._464, ..._467, - ..._471 + ..._470, + ..._473, + ..._477 }; } - export namespace globalfee { + export namespace cron { export const v1 = { + ..._250, + ..._251, ..._252, ..._253, ..._254, - ..._255, - ..._256, - ..._462, - ..._465, ..._468, - ..._472 + ..._471, + ..._474, + ..._478 }; } - export namespace mint { - export const v1beta1 = { + export namespace globalfee { + export const v1 = { + ..._255, + ..._256, ..._257, ..._258, ..._259, + ..._469, + ..._472, + ..._475, + ..._479 + }; + } + export namespace mint { + export const v1beta1 = { ..._260, - ..._469 + ..._261, + ..._262, + ..._263, + ..._476 }; } } export const ClientFactory = { - ..._514, - ..._515 + ..._521, + ..._522 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/regen/bundle.ts b/packages/types/protobuf/codegen/regen/bundle.ts index c1f42d7bf..6d1b1209c 100644 --- a/packages/types/protobuf/codegen/regen/bundle.ts +++ b/packages/types/protobuf/codegen/regen/bundle.ts @@ -1,134 +1,134 @@ -import * as _261 from "./data/v1/events"; -import * as _262 from "./data/v1/state"; -import * as _263 from "./data/v1/tx"; -import * as _264 from "./data/v1/types"; -import * as _265 from "./data/v2/events"; -import * as _266 from "./data/v2/state"; -import * as _267 from "./data/v2/tx"; -import * as _268 from "./data/v2/types"; -import * as _269 from "./ecocredit/basket/v1/events"; -import * as _270 from "./ecocredit/basket/v1/state"; -import * as _271 from "./ecocredit/basket/v1/tx"; -import * as _272 from "./ecocredit/basket/v1/types"; -import * as _273 from "./ecocredit/marketplace/v1/events"; -import * as _274 from "./ecocredit/marketplace/v1/state"; -import * as _275 from "./ecocredit/marketplace/v1/tx"; -import * as _276 from "./ecocredit/marketplace/v1/types"; -import * as _277 from "./ecocredit/orderbook/v1alpha1/memory"; -import * as _278 from "./ecocredit/v1/events"; -import * as _279 from "./ecocredit/v1/state"; -import * as _280 from "./ecocredit/v1/tx"; -import * as _281 from "./ecocredit/v1/types"; -import * as _282 from "./ecocredit/v1alpha1/events"; -import * as _283 from "./ecocredit/v1alpha1/genesis"; -import * as _284 from "./ecocredit/v1alpha1/tx"; -import * as _285 from "./ecocredit/v1alpha1/types"; -import * as _286 from "./intertx/v1/query"; -import * as _287 from "./intertx/v1/tx"; -import * as _473 from "./data/v1/tx.amino"; -import * as _474 from "./data/v2/tx.amino"; -import * as _475 from "./ecocredit/basket/v1/tx.amino"; -import * as _476 from "./ecocredit/marketplace/v1/tx.amino"; -import * as _477 from "./ecocredit/v1/tx.amino"; -import * as _478 from "./ecocredit/v1alpha1/tx.amino"; -import * as _479 from "./intertx/v1/tx.amino"; -import * as _480 from "./data/v1/tx.registry"; -import * as _481 from "./data/v2/tx.registry"; -import * as _482 from "./ecocredit/basket/v1/tx.registry"; -import * as _483 from "./ecocredit/marketplace/v1/tx.registry"; -import * as _484 from "./ecocredit/v1/tx.registry"; -import * as _485 from "./ecocredit/v1alpha1/tx.registry"; -import * as _486 from "./intertx/v1/tx.registry"; -import * as _487 from "./intertx/v1/query.rpc.Query"; -import * as _488 from "./data/v1/tx.rpc.msg"; -import * as _489 from "./data/v2/tx.rpc.msg"; -import * as _490 from "./ecocredit/basket/v1/tx.rpc.msg"; -import * as _491 from "./ecocredit/marketplace/v1/tx.rpc.msg"; -import * as _492 from "./ecocredit/v1/tx.rpc.msg"; -import * as _493 from "./ecocredit/v1alpha1/tx.rpc.msg"; -import * as _494 from "./intertx/v1/tx.rpc.msg"; -import * as _516 from "./rpc.query"; -import * as _517 from "./rpc.tx"; +import * as _264 from "./data/v1/events"; +import * as _265 from "./data/v1/state"; +import * as _266 from "./data/v1/tx"; +import * as _267 from "./data/v1/types"; +import * as _268 from "./data/v2/events"; +import * as _269 from "./data/v2/state"; +import * as _270 from "./data/v2/tx"; +import * as _271 from "./data/v2/types"; +import * as _272 from "./ecocredit/basket/v1/events"; +import * as _273 from "./ecocredit/basket/v1/state"; +import * as _274 from "./ecocredit/basket/v1/tx"; +import * as _275 from "./ecocredit/basket/v1/types"; +import * as _276 from "./ecocredit/marketplace/v1/events"; +import * as _277 from "./ecocredit/marketplace/v1/state"; +import * as _278 from "./ecocredit/marketplace/v1/tx"; +import * as _279 from "./ecocredit/marketplace/v1/types"; +import * as _280 from "./ecocredit/orderbook/v1alpha1/memory"; +import * as _281 from "./ecocredit/v1/events"; +import * as _282 from "./ecocredit/v1/state"; +import * as _283 from "./ecocredit/v1/tx"; +import * as _284 from "./ecocredit/v1/types"; +import * as _285 from "./ecocredit/v1alpha1/events"; +import * as _286 from "./ecocredit/v1alpha1/genesis"; +import * as _287 from "./ecocredit/v1alpha1/tx"; +import * as _288 from "./ecocredit/v1alpha1/types"; +import * as _289 from "./intertx/v1/query"; +import * as _290 from "./intertx/v1/tx"; +import * as _480 from "./data/v1/tx.amino"; +import * as _481 from "./data/v2/tx.amino"; +import * as _482 from "./ecocredit/basket/v1/tx.amino"; +import * as _483 from "./ecocredit/marketplace/v1/tx.amino"; +import * as _484 from "./ecocredit/v1/tx.amino"; +import * as _485 from "./ecocredit/v1alpha1/tx.amino"; +import * as _486 from "./intertx/v1/tx.amino"; +import * as _487 from "./data/v1/tx.registry"; +import * as _488 from "./data/v2/tx.registry"; +import * as _489 from "./ecocredit/basket/v1/tx.registry"; +import * as _490 from "./ecocredit/marketplace/v1/tx.registry"; +import * as _491 from "./ecocredit/v1/tx.registry"; +import * as _492 from "./ecocredit/v1alpha1/tx.registry"; +import * as _493 from "./intertx/v1/tx.registry"; +import * as _494 from "./intertx/v1/query.rpc.Query"; +import * as _495 from "./data/v1/tx.rpc.msg"; +import * as _496 from "./data/v2/tx.rpc.msg"; +import * as _497 from "./ecocredit/basket/v1/tx.rpc.msg"; +import * as _498 from "./ecocredit/marketplace/v1/tx.rpc.msg"; +import * as _499 from "./ecocredit/v1/tx.rpc.msg"; +import * as _500 from "./ecocredit/v1alpha1/tx.rpc.msg"; +import * as _501 from "./intertx/v1/tx.rpc.msg"; +import * as _523 from "./rpc.query"; +import * as _524 from "./rpc.tx"; export namespace regen { export namespace data { export const v1 = { - ..._261, - ..._262, - ..._263, ..._264, - ..._473, - ..._480, - ..._488 - }; - export const v2 = { ..._265, ..._266, ..._267, + ..._480, + ..._487, + ..._495 + }; + export const v2 = { ..._268, - ..._474, + ..._269, + ..._270, + ..._271, ..._481, - ..._489 + ..._488, + ..._496 }; } export namespace ecocredit { export namespace basket { export const v1 = { - ..._269, - ..._270, - ..._271, ..._272, - ..._475, + ..._273, + ..._274, + ..._275, ..._482, - ..._490 + ..._489, + ..._497 }; } export namespace marketplace { export const v1 = { - ..._273, - ..._274, - ..._275, ..._276, - ..._476, + ..._277, + ..._278, + ..._279, ..._483, - ..._491 + ..._490, + ..._498 }; } export namespace orderbook { export const v1alpha1 = { - ..._277 + ..._280 }; } export const v1 = { - ..._278, - ..._279, - ..._280, ..._281, - ..._477, - ..._484, - ..._492 - }; - export const v1alpha1 = { ..._282, ..._283, ..._284, + ..._484, + ..._491, + ..._499 + }; + export const v1alpha1 = { ..._285, - ..._478, + ..._286, + ..._287, + ..._288, ..._485, - ..._493 + ..._492, + ..._500 }; } export namespace intertx { export const v1 = { - ..._286, - ..._287, - ..._479, + ..._289, + ..._290, ..._486, - ..._487, - ..._494 + ..._493, + ..._494, + ..._501 }; } export const ClientFactory = { - ..._516, - ..._517 + ..._523, + ..._524 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/tendermint/bundle.ts b/packages/types/protobuf/codegen/tendermint/bundle.ts index a8ae0e761..f2fd77b7b 100644 --- a/packages/types/protobuf/codegen/tendermint/bundle.ts +++ b/packages/types/protobuf/codegen/tendermint/bundle.ts @@ -1,32 +1,32 @@ -import * as _291 from "./abci/types"; -import * as _292 from "./crypto/keys"; -import * as _293 from "./crypto/proof"; -import * as _294 from "./p2p/types"; -import * as _295 from "./types/block"; -import * as _296 from "./types/evidence"; -import * as _297 from "./types/params"; -import * as _298 from "./types/types"; -import * as _299 from "./types/validator"; -import * as _300 from "./version/types"; +import * as _294 from "./abci/types"; +import * as _295 from "./crypto/keys"; +import * as _296 from "./crypto/proof"; +import * as _297 from "./p2p/types"; +import * as _298 from "./types/block"; +import * as _299 from "./types/evidence"; +import * as _300 from "./types/params"; +import * as _301 from "./types/types"; +import * as _302 from "./types/validator"; +import * as _303 from "./version/types"; export namespace tendermint { export const abci = { - ..._291 + ..._294 }; export const crypto = { - ..._292, - ..._293 + ..._295, + ..._296 }; export const p2p = { - ..._294 + ..._297 }; export const types = { - ..._295, - ..._296, - ..._297, ..._298, - ..._299 + ..._299, + ..._300, + ..._301, + ..._302 }; export const version = { - ..._300 + ..._303 }; } \ No newline at end of file diff --git a/packages/types/protobuf/scripts/codegen.js b/packages/types/protobuf/scripts/codegen.js index 3b99e91d9..cc5e20549 100644 --- a/packages/types/protobuf/scripts/codegen.js +++ b/packages/types/protobuf/scripts/codegen.js @@ -64,6 +64,7 @@ telescope({ 'ibc.applications.interchain_accounts.host.v1', 'ibc.applications.interchain_accounts.controller.v1', 'ibc.core.channel.v1', + 'ibc.core.client.v1', 'juno.feeshare.v1', 'juno.mint', 'neutron.contractmanager.v1', From d48ba48f4690a19a7a4def6b3a9cfd748953ed61 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 4 Apr 2024 19:33:25 -0700 Subject: [PATCH 097/438] fixed protobuf types --- .../codegen/cosmos/authz/v1beta1/tx.ts | 784 ++-- .../protobuf/codegen/cosmos/gov/v1/tx.ts | 3887 ++++++----------- .../types/protobuf/codegen/neutron/client.ts | 7 +- packages/types/protobuf/patches.diff | 88 +- 4 files changed, 1731 insertions(+), 3035 deletions(-) diff --git a/packages/types/protobuf/codegen/cosmos/authz/v1beta1/tx.ts b/packages/types/protobuf/codegen/cosmos/authz/v1beta1/tx.ts index 8fbd2256d..63b9a7cb8 100644 --- a/packages/types/protobuf/codegen/cosmos/authz/v1beta1/tx.ts +++ b/packages/types/protobuf/codegen/cosmos/authz/v1beta1/tx.ts @@ -1,60 +1,55 @@ //@ts-nocheck import { aminoToRawProtobufMsg, rawProtobufMsgToAmino } from '../../../../utils' -import { BinaryReader, BinaryWriter } from '../../../binary' -import { - Any, - AnyAmino, - AnyProtoMsg, - AnySDKType, -} from '../../../google/protobuf/any' -import { base64FromBytes, bytesFromBase64 } from '../../../helpers' -import { Grant, GrantAmino, GrantSDKType } from './authz' +import { Grant, GrantAmino, GrantSDKType } from "./authz"; +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; /** * MsgGrant is a request type for Grant method. It declares authorization to the grantee * on behalf of the granter with the provided expiration time. */ export interface MsgGrant { - granter: string - grantee: string - grant: Grant | undefined + granter: string; + grantee: string; + grant: Grant | undefined; } export interface MsgGrantProtoMsg { - typeUrl: '/cosmos.authz.v1beta1.MsgGrant' - value: Uint8Array + typeUrl: "/cosmos.authz.v1beta1.MsgGrant"; + value: Uint8Array; } /** * MsgGrant is a request type for Grant method. It declares authorization to the grantee * on behalf of the granter with the provided expiration time. */ export interface MsgGrantAmino { - granter?: string - grantee?: string - grant: GrantAmino | undefined + granter?: string; + grantee?: string; + grant: GrantAmino | undefined; } export interface MsgGrantAminoMsg { - type: 'cosmos-sdk/MsgGrant' - value: MsgGrantAmino + type: "cosmos-sdk/MsgGrant"; + value: MsgGrantAmino; } /** * MsgGrant is a request type for Grant method. It declares authorization to the grantee * on behalf of the granter with the provided expiration time. */ export interface MsgGrantSDKType { - granter: string - grantee: string - grant: GrantSDKType | undefined + granter: string; + grantee: string; + grant: GrantSDKType | undefined; } /** MsgGrantResponse defines the Msg/MsgGrant response type. */ export interface MsgGrantResponse {} export interface MsgGrantResponseProtoMsg { - typeUrl: '/cosmos.authz.v1beta1.MsgGrantResponse' - value: Uint8Array + typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse"; + value: Uint8Array; } /** MsgGrantResponse defines the Msg/MsgGrant response type. */ export interface MsgGrantResponseAmino {} export interface MsgGrantResponseAminoMsg { - type: 'cosmos-sdk/MsgGrantResponse' - value: MsgGrantResponseAmino + type: "cosmos-sdk/MsgGrantResponse"; + value: MsgGrantResponseAmino; } /** MsgGrantResponse defines the Msg/MsgGrant response type. */ export interface MsgGrantResponseSDKType {} @@ -64,43 +59,43 @@ export interface MsgGrantResponseSDKType {} * one signer corresponding to the granter of the authorization. */ export interface MsgExec { - grantee: string + grantee: string; /** * Execute Msg. * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) * triple and validate it. */ - msgs: Any[] | Any[] + msgs: (Any)[] | Any[]; } export interface MsgExecProtoMsg { - typeUrl: '/cosmos.authz.v1beta1.MsgExec' - value: Uint8Array + typeUrl: "/cosmos.authz.v1beta1.MsgExec"; + value: Uint8Array; } -export type MsgExecEncoded = Omit & { +export type MsgExecEncoded = Omit & { /** * Execute Msg. * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) * triple and validate it. */ - msgs: AnyProtoMsg[] -} + msgs: (AnyProtoMsg)[]; +}; /** * MsgExec attempts to execute the provided messages using * authorizations granted to the grantee. Each message should have only * one signer corresponding to the granter of the authorization. */ export interface MsgExecAmino { - grantee?: string + grantee?: string; /** * Execute Msg. * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) * triple and validate it. */ - msgs?: AnyAmino[] + msgs?: AnyAmino[]; } export interface MsgExecAminoMsg { - type: 'cosmos-sdk/MsgExec' - value: MsgExecAmino + type: "cosmos-sdk/MsgExec"; + value: MsgExecAmino; } /** * MsgExec attempts to execute the provided messages using @@ -108,650 +103,541 @@ export interface MsgExecAminoMsg { * one signer corresponding to the granter of the authorization. */ export interface MsgExecSDKType { - grantee: string - msgs: AnySDKType[] + grantee: string; + msgs: (AnySDKType)[]; } /** MsgExecResponse defines the Msg/MsgExecResponse response type. */ export interface MsgExecResponse { - results: Uint8Array[] + results: Uint8Array[]; } export interface MsgExecResponseProtoMsg { - typeUrl: '/cosmos.authz.v1beta1.MsgExecResponse' - value: Uint8Array + typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse"; + value: Uint8Array; } /** MsgExecResponse defines the Msg/MsgExecResponse response type. */ export interface MsgExecResponseAmino { - results?: string[] + results?: string[]; } export interface MsgExecResponseAminoMsg { - type: 'cosmos-sdk/MsgExecResponse' - value: MsgExecResponseAmino + type: "cosmos-sdk/MsgExecResponse"; + value: MsgExecResponseAmino; } /** MsgExecResponse defines the Msg/MsgExecResponse response type. */ export interface MsgExecResponseSDKType { - results: Uint8Array[] + results: Uint8Array[]; } /** * MsgRevoke revokes any authorization with the provided sdk.Msg type on the * granter's account with that has been granted to the grantee. */ export interface MsgRevoke { - granter: string - grantee: string - msgTypeUrl: string + granter: string; + grantee: string; + msgTypeUrl: string; } export interface MsgRevokeProtoMsg { - typeUrl: '/cosmos.authz.v1beta1.MsgRevoke' - value: Uint8Array + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke"; + value: Uint8Array; } /** * MsgRevoke revokes any authorization with the provided sdk.Msg type on the * granter's account with that has been granted to the grantee. */ export interface MsgRevokeAmino { - granter?: string - grantee?: string - msg_type_url?: string + granter?: string; + grantee?: string; + msg_type_url?: string; } export interface MsgRevokeAminoMsg { - type: 'cosmos-sdk/MsgRevoke' - value: MsgRevokeAmino + type: "cosmos-sdk/MsgRevoke"; + value: MsgRevokeAmino; } /** * MsgRevoke revokes any authorization with the provided sdk.Msg type on the * granter's account with that has been granted to the grantee. */ export interface MsgRevokeSDKType { - granter: string - grantee: string - msg_type_url: string + granter: string; + grantee: string; + msg_type_url: string; } /** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ export interface MsgRevokeResponse {} export interface MsgRevokeResponseProtoMsg { - typeUrl: '/cosmos.authz.v1beta1.MsgRevokeResponse' - value: Uint8Array + typeUrl: "/cosmos.authz.v1beta1.MsgRevokeResponse"; + value: Uint8Array; } /** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ export interface MsgRevokeResponseAmino {} export interface MsgRevokeResponseAminoMsg { - type: 'cosmos-sdk/MsgRevokeResponse' - value: MsgRevokeResponseAmino + type: "cosmos-sdk/MsgRevokeResponse"; + value: MsgRevokeResponseAmino; } /** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */ export interface MsgRevokeResponseSDKType {} function createBaseMsgGrant(): MsgGrant { return { - granter: '', - grantee: '', - grant: Grant.fromPartial({}), - } + granter: "", + grantee: "", + grant: Grant.fromPartial({}) + }; } export const MsgGrant = { - typeUrl: '/cosmos.authz.v1beta1.MsgGrant', - encode( - message: MsgGrant, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { - if (message.granter !== '') { - writer.uint32(10).string(message.granter) + typeUrl: "/cosmos.authz.v1beta1.MsgGrant", + encode(message: MsgGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); } - if (message.grantee !== '') { - writer.uint32(18).string(message.grantee) + if (message.grantee !== "") { + writer.uint32(18).string(message.grantee); } if (message.grant !== undefined) { - Grant.encode(message.grant, writer.uint32(26).fork()).ldelim() + Grant.encode(message.grant, writer.uint32(26).fork()).ldelim(); } - return writer - }, - decode( - input: BinaryReader | Uint8Array, - length?: number, - useInterfaces: boolean = false - ): MsgGrant { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input) - let end = length === undefined ? reader.len : reader.pos + length - const message = createBaseMsgGrant() + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgGrant(); while (reader.pos < end) { - const tag = reader.uint32() + const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.granter = reader.string() - break + message.granter = reader.string(); + break; case 2: - message.grantee = reader.string() - break + message.grantee = reader.string(); + break; case 3: - message.grant = Grant.decode(reader, reader.uint32(), useInterfaces) - break + message.grant = Grant.decode(reader, reader.uint32(), useInterfaces); + break; default: - reader.skipType(tag & 7) - break + reader.skipType(tag & 7); + break; } } - return message + return message; }, fromPartial(object: Partial): MsgGrant { - const message = createBaseMsgGrant() - message.granter = object.granter ?? '' - message.grantee = object.grantee ?? '' - message.grant = - object.grant !== undefined && object.grant !== null - ? Grant.fromPartial(object.grant) - : undefined - return message + const message = createBaseMsgGrant(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + message.grant = object.grant !== undefined && object.grant !== null ? Grant.fromPartial(object.grant) : undefined; + return message; }, fromAmino(object: MsgGrantAmino): MsgGrant { - const message = createBaseMsgGrant() + const message = createBaseMsgGrant(); if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter + message.granter = object.granter; } if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee + message.grantee = object.grantee; } if (object.grant !== undefined && object.grant !== null) { - message.grant = Grant.fromAmino(object.grant) + message.grant = Grant.fromAmino(object.grant); } - return message + return message; }, toAmino(message: MsgGrant, useInterfaces: boolean = false): MsgGrantAmino { - const obj: any = {} - obj.granter = message.granter - obj.grantee = message.grantee - obj.grant = message.grant - ? Grant.toAmino(message.grant, useInterfaces) - : Grant.fromPartial({}) - return obj + const obj: any = {}; + obj.granter = message.granter; + obj.grantee = message.grantee; + obj.grant = message.grant ? Grant.toAmino(message.grant, useInterfaces) : Grant.fromPartial({}); + return obj; }, fromAminoMsg(object: MsgGrantAminoMsg): MsgGrant { - return MsgGrant.fromAmino(object.value) + return MsgGrant.fromAmino(object.value); }, - toAminoMsg( - message: MsgGrant, - useInterfaces: boolean = false - ): MsgGrantAminoMsg { + toAminoMsg(message: MsgGrant, useInterfaces: boolean = false): MsgGrantAminoMsg { return { - type: 'cosmos-sdk/MsgGrant', - value: MsgGrant.toAmino(message, useInterfaces), - } + type: "cosmos-sdk/MsgGrant", + value: MsgGrant.toAmino(message, useInterfaces) + }; }, - fromProtoMsg( - message: MsgGrantProtoMsg, - useInterfaces: boolean = false - ): MsgGrant { - return MsgGrant.decode(message.value, undefined, useInterfaces) + fromProtoMsg(message: MsgGrantProtoMsg, useInterfaces: boolean = false): MsgGrant { + return MsgGrant.decode(message.value, undefined, useInterfaces); }, toProto(message: MsgGrant): Uint8Array { - return MsgGrant.encode(message).finish() + return MsgGrant.encode(message).finish(); }, toProtoMsg(message: MsgGrant): MsgGrantProtoMsg { return { - typeUrl: '/cosmos.authz.v1beta1.MsgGrant', - value: MsgGrant.encode(message).finish(), - } - }, -} + typeUrl: "/cosmos.authz.v1beta1.MsgGrant", + value: MsgGrant.encode(message).finish() + }; + } +}; function createBaseMsgGrantResponse(): MsgGrantResponse { - return {} + return {}; } export const MsgGrantResponse = { - typeUrl: '/cosmos.authz.v1beta1.MsgGrantResponse', - encode( - _: MsgGrantResponse, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { - return writer - }, - decode( - input: BinaryReader | Uint8Array, - length?: number, - useInterfaces: boolean = false - ): MsgGrantResponse { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input) - let end = length === undefined ? reader.len : reader.pos + length - const message = createBaseMsgGrantResponse() + typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse", + encode(_: MsgGrantResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgGrantResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgGrantResponse(); while (reader.pos < end) { - const tag = reader.uint32() + const tag = reader.uint32(); switch (tag >>> 3) { default: - reader.skipType(tag & 7) - break + reader.skipType(tag & 7); + break; } } - return message + return message; }, fromPartial(_: Partial): MsgGrantResponse { - const message = createBaseMsgGrantResponse() - return message + const message = createBaseMsgGrantResponse(); + return message; }, fromAmino(_: MsgGrantResponseAmino): MsgGrantResponse { - const message = createBaseMsgGrantResponse() - return message + const message = createBaseMsgGrantResponse(); + return message; }, - toAmino( - _: MsgGrantResponse, - useInterfaces: boolean = false - ): MsgGrantResponseAmino { - const obj: any = {} - return obj + toAmino(_: MsgGrantResponse, useInterfaces: boolean = false): MsgGrantResponseAmino { + const obj: any = {}; + return obj; }, fromAminoMsg(object: MsgGrantResponseAminoMsg): MsgGrantResponse { - return MsgGrantResponse.fromAmino(object.value) + return MsgGrantResponse.fromAmino(object.value); }, - toAminoMsg( - message: MsgGrantResponse, - useInterfaces: boolean = false - ): MsgGrantResponseAminoMsg { + toAminoMsg(message: MsgGrantResponse, useInterfaces: boolean = false): MsgGrantResponseAminoMsg { return { - type: 'cosmos-sdk/MsgGrantResponse', - value: MsgGrantResponse.toAmino(message, useInterfaces), - } + type: "cosmos-sdk/MsgGrantResponse", + value: MsgGrantResponse.toAmino(message, useInterfaces) + }; }, - fromProtoMsg( - message: MsgGrantResponseProtoMsg, - useInterfaces: boolean = false - ): MsgGrantResponse { - return MsgGrantResponse.decode(message.value, undefined, useInterfaces) + fromProtoMsg(message: MsgGrantResponseProtoMsg, useInterfaces: boolean = false): MsgGrantResponse { + return MsgGrantResponse.decode(message.value, undefined, useInterfaces); }, toProto(message: MsgGrantResponse): Uint8Array { - return MsgGrantResponse.encode(message).finish() + return MsgGrantResponse.encode(message).finish(); }, toProtoMsg(message: MsgGrantResponse): MsgGrantResponseProtoMsg { return { - typeUrl: '/cosmos.authz.v1beta1.MsgGrantResponse', - value: MsgGrantResponse.encode(message).finish(), - } - }, -} + typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse", + value: MsgGrantResponse.encode(message).finish() + }; + } +}; function createBaseMsgExec(): MsgExec { return { - grantee: '', - msgs: [], - } + grantee: "", + msgs: [] + }; } export const MsgExec = { - typeUrl: '/cosmos.authz.v1beta1.MsgExec', - encode( - message: MsgExec, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { - if (message.grantee !== '') { - writer.uint32(10).string(message.grantee) + typeUrl: "/cosmos.authz.v1beta1.MsgExec", + encode(message: MsgExec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.grantee !== "") { + writer.uint32(10).string(message.grantee); } for (const v of message.msgs) { - Any.encode(v! as Any, writer.uint32(18).fork()).ldelim() + Any.encode((v! as Any), writer.uint32(18).fork()).ldelim(); } - return writer - }, - decode( - input: BinaryReader | Uint8Array, - length?: number, - useInterfaces: boolean = false - ): MsgExec { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input) - let end = length === undefined ? reader.len : reader.pos + length - const message = createBaseMsgExec() + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgExec { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExec(); while (reader.pos < end) { - const tag = reader.uint32() + const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.grantee = reader.string() - break + message.grantee = reader.string(); + break; case 2: - message.msgs.push( - useInterfaces - ? (Cosmos_basev1beta1Msg_InterfaceDecoder(reader) as Any) - : Any.decode(reader, reader.uint32(), useInterfaces) - ) - break + message.msgs.push(useInterfaces ? (Cosmos_basev1beta1Msg_InterfaceDecoder(reader) as Any) : Any.decode(reader, reader.uint32(), useInterfaces)); + break; default: - reader.skipType(tag & 7) - break + reader.skipType(tag & 7); + break; } } - return message + return message; }, fromPartial(object: Partial): MsgExec { - const message = createBaseMsgExec() - message.grantee = object.grantee ?? '' - message.msgs = object.msgs?.map((e) => Any.fromPartial(e)) || [] - return message + const message = createBaseMsgExec(); + message.grantee = object.grantee ?? ""; + message.msgs = object.msgs?.map(e => Any.fromPartial(e)) || []; + return message; }, fromAmino(object: MsgExecAmino): MsgExec { - const message = createBaseMsgExec() + const message = createBaseMsgExec(); if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee + message.grantee = object.grantee; } - message.msgs = object.msgs?.map((e) => aminoToRawProtobufMsg(e)) || [] - return message + message.msgs = object.msgs?.map(e => aminoToRawProtobufMsg(e)) || []; + return message; }, toAmino(message: MsgExec, useInterfaces: boolean = false): MsgExecAmino { - const obj: any = {} - obj.grantee = message.grantee + const obj: any = {}; + obj.grantee = message.grantee; if (message.msgs) { - obj.msgs = message.msgs.map((e) => - e ? rawProtobufMsgToAmino(e as Any, useInterfaces) : undefined - ) + obj.msgs = message.msgs.map(e => e ? rawProtobufMsgToAmino((e as Any), useInterfaces) : undefined); } else { - obj.msgs = [] + obj.msgs = []; } - return obj + return obj; }, fromAminoMsg(object: MsgExecAminoMsg): MsgExec { - return MsgExec.fromAmino(object.value) + return MsgExec.fromAmino(object.value); }, - toAminoMsg( - message: MsgExec, - useInterfaces: boolean = false - ): MsgExecAminoMsg { + toAminoMsg(message: MsgExec, useInterfaces: boolean = false): MsgExecAminoMsg { return { - type: 'cosmos-sdk/MsgExec', - value: MsgExec.toAmino(message, useInterfaces), - } + type: "cosmos-sdk/MsgExec", + value: MsgExec.toAmino(message, useInterfaces) + }; }, - fromProtoMsg( - message: MsgExecProtoMsg, - useInterfaces: boolean = false - ): MsgExec { - return MsgExec.decode(message.value, undefined, useInterfaces) + fromProtoMsg(message: MsgExecProtoMsg, useInterfaces: boolean = false): MsgExec { + return MsgExec.decode(message.value, undefined, useInterfaces); }, toProto(message: MsgExec): Uint8Array { - return MsgExec.encode(message).finish() + return MsgExec.encode(message).finish(); }, toProtoMsg(message: MsgExec): MsgExecProtoMsg { return { - typeUrl: '/cosmos.authz.v1beta1.MsgExec', - value: MsgExec.encode(message).finish(), - } - }, -} + typeUrl: "/cosmos.authz.v1beta1.MsgExec", + value: MsgExec.encode(message).finish() + }; + } +}; function createBaseMsgExecResponse(): MsgExecResponse { return { - results: [], - } + results: [] + }; } export const MsgExecResponse = { - typeUrl: '/cosmos.authz.v1beta1.MsgExecResponse', - encode( - message: MsgExecResponse, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { + typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse", + encode(message: MsgExecResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.results) { - writer.uint32(10).bytes(v!) + writer.uint32(10).bytes(v!); } - return writer - }, - decode( - input: BinaryReader | Uint8Array, - length?: number, - useInterfaces: boolean = false - ): MsgExecResponse { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input) - let end = length === undefined ? reader.len : reader.pos + length - const message = createBaseMsgExecResponse() + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgExecResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecResponse(); while (reader.pos < end) { - const tag = reader.uint32() + const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.results.push(reader.bytes()) - break + message.results.push(reader.bytes()); + break; default: - reader.skipType(tag & 7) - break + reader.skipType(tag & 7); + break; } } - return message + return message; }, fromPartial(object: Partial): MsgExecResponse { - const message = createBaseMsgExecResponse() - message.results = object.results?.map((e) => e) || [] - return message + const message = createBaseMsgExecResponse(); + message.results = object.results?.map(e => e) || []; + return message; }, fromAmino(object: MsgExecResponseAmino): MsgExecResponse { - const message = createBaseMsgExecResponse() - message.results = object.results?.map((e) => bytesFromBase64(e)) || [] - return message - }, - toAmino( - message: MsgExecResponse, - useInterfaces: boolean = false - ): MsgExecResponseAmino { - const obj: any = {} + const message = createBaseMsgExecResponse(); + message.results = object.results?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: MsgExecResponse, useInterfaces: boolean = false): MsgExecResponseAmino { + const obj: any = {}; if (message.results) { - obj.results = message.results.map((e) => base64FromBytes(e)) + obj.results = message.results.map(e => base64FromBytes(e)); } else { - obj.results = [] + obj.results = []; } - return obj + return obj; }, fromAminoMsg(object: MsgExecResponseAminoMsg): MsgExecResponse { - return MsgExecResponse.fromAmino(object.value) + return MsgExecResponse.fromAmino(object.value); }, - toAminoMsg( - message: MsgExecResponse, - useInterfaces: boolean = false - ): MsgExecResponseAminoMsg { + toAminoMsg(message: MsgExecResponse, useInterfaces: boolean = false): MsgExecResponseAminoMsg { return { - type: 'cosmos-sdk/MsgExecResponse', - value: MsgExecResponse.toAmino(message, useInterfaces), - } + type: "cosmos-sdk/MsgExecResponse", + value: MsgExecResponse.toAmino(message, useInterfaces) + }; }, - fromProtoMsg( - message: MsgExecResponseProtoMsg, - useInterfaces: boolean = false - ): MsgExecResponse { - return MsgExecResponse.decode(message.value, undefined, useInterfaces) + fromProtoMsg(message: MsgExecResponseProtoMsg, useInterfaces: boolean = false): MsgExecResponse { + return MsgExecResponse.decode(message.value, undefined, useInterfaces); }, toProto(message: MsgExecResponse): Uint8Array { - return MsgExecResponse.encode(message).finish() + return MsgExecResponse.encode(message).finish(); }, toProtoMsg(message: MsgExecResponse): MsgExecResponseProtoMsg { return { - typeUrl: '/cosmos.authz.v1beta1.MsgExecResponse', - value: MsgExecResponse.encode(message).finish(), - } - }, -} + typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse", + value: MsgExecResponse.encode(message).finish() + }; + } +}; function createBaseMsgRevoke(): MsgRevoke { return { - granter: '', - grantee: '', - msgTypeUrl: '', - } + granter: "", + grantee: "", + msgTypeUrl: "" + }; } export const MsgRevoke = { - typeUrl: '/cosmos.authz.v1beta1.MsgRevoke', - encode( - message: MsgRevoke, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { - if (message.granter !== '') { - writer.uint32(10).string(message.granter) + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", + encode(message: MsgRevoke, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); } - if (message.grantee !== '') { - writer.uint32(18).string(message.grantee) + if (message.grantee !== "") { + writer.uint32(18).string(message.grantee); } - if (message.msgTypeUrl !== '') { - writer.uint32(26).string(message.msgTypeUrl) + if (message.msgTypeUrl !== "") { + writer.uint32(26).string(message.msgTypeUrl); } - return writer - }, - decode( - input: BinaryReader | Uint8Array, - length?: number, - useInterfaces: boolean = false - ): MsgRevoke { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input) - let end = length === undefined ? reader.len : reader.pos + length - const message = createBaseMsgRevoke() + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRevoke { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevoke(); while (reader.pos < end) { - const tag = reader.uint32() + const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.granter = reader.string() - break + message.granter = reader.string(); + break; case 2: - message.grantee = reader.string() - break + message.grantee = reader.string(); + break; case 3: - message.msgTypeUrl = reader.string() - break + message.msgTypeUrl = reader.string(); + break; default: - reader.skipType(tag & 7) - break + reader.skipType(tag & 7); + break; } } - return message + return message; }, fromPartial(object: Partial): MsgRevoke { - const message = createBaseMsgRevoke() - message.granter = object.granter ?? '' - message.grantee = object.grantee ?? '' - message.msgTypeUrl = object.msgTypeUrl ?? '' - return message + const message = createBaseMsgRevoke(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + message.msgTypeUrl = object.msgTypeUrl ?? ""; + return message; }, fromAmino(object: MsgRevokeAmino): MsgRevoke { - const message = createBaseMsgRevoke() + const message = createBaseMsgRevoke(); if (object.granter !== undefined && object.granter !== null) { - message.granter = object.granter + message.granter = object.granter; } if (object.grantee !== undefined && object.grantee !== null) { - message.grantee = object.grantee + message.grantee = object.grantee; } if (object.msg_type_url !== undefined && object.msg_type_url !== null) { - message.msgTypeUrl = object.msg_type_url + message.msgTypeUrl = object.msg_type_url; } - return message + return message; }, toAmino(message: MsgRevoke, useInterfaces: boolean = false): MsgRevokeAmino { - const obj: any = {} - obj.granter = message.granter - obj.grantee = message.grantee - obj.msg_type_url = message.msgTypeUrl - return obj + const obj: any = {}; + obj.granter = message.granter; + obj.grantee = message.grantee; + obj.msg_type_url = message.msgTypeUrl; + return obj; }, fromAminoMsg(object: MsgRevokeAminoMsg): MsgRevoke { - return MsgRevoke.fromAmino(object.value) + return MsgRevoke.fromAmino(object.value); }, - toAminoMsg( - message: MsgRevoke, - useInterfaces: boolean = false - ): MsgRevokeAminoMsg { + toAminoMsg(message: MsgRevoke, useInterfaces: boolean = false): MsgRevokeAminoMsg { return { - type: 'cosmos-sdk/MsgRevoke', - value: MsgRevoke.toAmino(message, useInterfaces), - } + type: "cosmos-sdk/MsgRevoke", + value: MsgRevoke.toAmino(message, useInterfaces) + }; }, - fromProtoMsg( - message: MsgRevokeProtoMsg, - useInterfaces: boolean = false - ): MsgRevoke { - return MsgRevoke.decode(message.value, undefined, useInterfaces) + fromProtoMsg(message: MsgRevokeProtoMsg, useInterfaces: boolean = false): MsgRevoke { + return MsgRevoke.decode(message.value, undefined, useInterfaces); }, toProto(message: MsgRevoke): Uint8Array { - return MsgRevoke.encode(message).finish() + return MsgRevoke.encode(message).finish(); }, toProtoMsg(message: MsgRevoke): MsgRevokeProtoMsg { return { - typeUrl: '/cosmos.authz.v1beta1.MsgRevoke', - value: MsgRevoke.encode(message).finish(), - } - }, -} + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", + value: MsgRevoke.encode(message).finish() + }; + } +}; function createBaseMsgRevokeResponse(): MsgRevokeResponse { - return {} + return {}; } export const MsgRevokeResponse = { - typeUrl: '/cosmos.authz.v1beta1.MsgRevokeResponse', - encode( - _: MsgRevokeResponse, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { - return writer - }, - decode( - input: BinaryReader | Uint8Array, - length?: number, - useInterfaces: boolean = false - ): MsgRevokeResponse { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input) - let end = length === undefined ? reader.len : reader.pos + length - const message = createBaseMsgRevokeResponse() + typeUrl: "/cosmos.authz.v1beta1.MsgRevokeResponse", + encode(_: MsgRevokeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRevokeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeResponse(); while (reader.pos < end) { - const tag = reader.uint32() + const tag = reader.uint32(); switch (tag >>> 3) { default: - reader.skipType(tag & 7) - break + reader.skipType(tag & 7); + break; } } - return message + return message; }, fromPartial(_: Partial): MsgRevokeResponse { - const message = createBaseMsgRevokeResponse() - return message + const message = createBaseMsgRevokeResponse(); + return message; }, fromAmino(_: MsgRevokeResponseAmino): MsgRevokeResponse { - const message = createBaseMsgRevokeResponse() - return message + const message = createBaseMsgRevokeResponse(); + return message; }, - toAmino( - _: MsgRevokeResponse, - useInterfaces: boolean = false - ): MsgRevokeResponseAmino { - const obj: any = {} - return obj + toAmino(_: MsgRevokeResponse, useInterfaces: boolean = false): MsgRevokeResponseAmino { + const obj: any = {}; + return obj; }, fromAminoMsg(object: MsgRevokeResponseAminoMsg): MsgRevokeResponse { - return MsgRevokeResponse.fromAmino(object.value) + return MsgRevokeResponse.fromAmino(object.value); }, - toAminoMsg( - message: MsgRevokeResponse, - useInterfaces: boolean = false - ): MsgRevokeResponseAminoMsg { + toAminoMsg(message: MsgRevokeResponse, useInterfaces: boolean = false): MsgRevokeResponseAminoMsg { return { - type: 'cosmos-sdk/MsgRevokeResponse', - value: MsgRevokeResponse.toAmino(message, useInterfaces), - } + type: "cosmos-sdk/MsgRevokeResponse", + value: MsgRevokeResponse.toAmino(message, useInterfaces) + }; }, - fromProtoMsg( - message: MsgRevokeResponseProtoMsg, - useInterfaces: boolean = false - ): MsgRevokeResponse { - return MsgRevokeResponse.decode(message.value, undefined, useInterfaces) + fromProtoMsg(message: MsgRevokeResponseProtoMsg, useInterfaces: boolean = false): MsgRevokeResponse { + return MsgRevokeResponse.decode(message.value, undefined, useInterfaces); }, toProto(message: MsgRevokeResponse): Uint8Array { - return MsgRevokeResponse.encode(message).finish() + return MsgRevokeResponse.encode(message).finish(); }, toProtoMsg(message: MsgRevokeResponse): MsgRevokeResponseProtoMsg { return { - typeUrl: '/cosmos.authz.v1beta1.MsgRevokeResponse', - value: MsgRevokeResponse.encode(message).finish(), - } - }, -} -export const Cosmos_basev1beta1Msg_InterfaceDecoder = ( - input: BinaryReader | Uint8Array -): Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input) - const data = Any.decode(reader, reader.uint32(), true) + typeUrl: "/cosmos.authz.v1beta1.MsgRevokeResponse", + value: MsgRevokeResponse.encode(message).finish() + }; + } +}; +export const Cosmos_basev1beta1Msg_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { default: - return data + return data; } -} +}; export const Cosmos_basev1beta1Msg_FromAmino = (content: AnyAmino) => { - return Any.fromAmino(content) -} -export const Cosmos_basev1beta1Msg_ToAmino = ( - content: Any, - useInterfaces: boolean = false -) => { - return Any.toAmino(content, useInterfaces) -} + return Any.fromAmino(content); +}; +export const Cosmos_basev1beta1Msg_ToAmino = (content: Any, useInterfaces: boolean = false) => { + return Any.toAmino(content, useInterfaces); +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts b/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts index e6b8c31ff..72e20f771 100644 --- a/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts +++ b/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts @@ -1,225 +1,63 @@ -//@ts-nocheck -import { aminoToRawProtobufMsg, rawProtobufMsgToAmino } from '../../../../utils' -import { - MsgCreateAllianceProposal, - MsgCreateAllianceProposalProtoMsg, - MsgCreateAllianceProposalSDKType, - MsgDeleteAllianceProposal, - MsgDeleteAllianceProposalProtoMsg, - MsgDeleteAllianceProposalSDKType, - MsgUpdateAllianceProposal, - MsgUpdateAllianceProposalProtoMsg, - MsgUpdateAllianceProposalSDKType, -} from '../../../alliance/alliance/gov' -import { BinaryReader, BinaryWriter } from '../../../binary' -import { - ClearAdminProposal, - ClearAdminProposalProtoMsg, - ClearAdminProposalSDKType, - ExecuteContractProposal, - ExecuteContractProposalProtoMsg, - ExecuteContractProposalSDKType, - InstantiateContract2Proposal, - InstantiateContract2ProposalProtoMsg, - InstantiateContract2ProposalSDKType, - InstantiateContractProposal, - InstantiateContractProposalProtoMsg, - InstantiateContractProposalSDKType, - MigrateContractProposal, - MigrateContractProposalProtoMsg, - MigrateContractProposalSDKType, - PinCodesProposal, - PinCodesProposalProtoMsg, - PinCodesProposalSDKType, - StoreAndInstantiateContractProposal, - StoreAndInstantiateContractProposalProtoMsg, - StoreAndInstantiateContractProposalSDKType, - StoreCodeProposal, - StoreCodeProposalProtoMsg, - StoreCodeProposalSDKType, - SudoContractProposal, - SudoContractProposalProtoMsg, - SudoContractProposalSDKType, - UnpinCodesProposal, - UnpinCodesProposalProtoMsg, - UnpinCodesProposalSDKType, - UpdateAdminProposal, - UpdateAdminProposalProtoMsg, - UpdateAdminProposalSDKType, - UpdateInstantiateConfigProposal, - UpdateInstantiateConfigProposalProtoMsg, - UpdateInstantiateConfigProposalSDKType, -} from '../../../cosmwasm/wasm/v1/proposal' -import { - Any, - AnyAmino, - AnyProtoMsg, - AnySDKType, -} from '../../../google/protobuf/any' -import { Timestamp } from '../../../google/protobuf/timestamp' -import { fromTimestamp, toTimestamp } from '../../../helpers' -import { - ClientUpdateProposal, - ClientUpdateProposalProtoMsg, - ClientUpdateProposalSDKType, - UpgradeProposal, - UpgradeProposalProtoMsg, - UpgradeProposalSDKType, -} from '../../../ibc/core/client/v1/client' -import { - CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal, - CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg, - CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType, - ReplaceMigrationRecordsProposal, - ReplaceMigrationRecordsProposalProtoMsg, - ReplaceMigrationRecordsProposalSDKType, - SetScalingFactorControllerProposal, - SetScalingFactorControllerProposalProtoMsg, - SetScalingFactorControllerProposalSDKType, - UpdateMigrationRecordsProposal, - UpdateMigrationRecordsProposalProtoMsg, - UpdateMigrationRecordsProposalSDKType, -} from '../../../osmosis/gamm/v1beta1/gov' -import { - CreateGroupsProposal, - CreateGroupsProposalProtoMsg, - CreateGroupsProposalSDKType, -} from '../../../osmosis/incentives/gov' -import { - ReplacePoolIncentivesProposal, - ReplacePoolIncentivesProposalProtoMsg, - ReplacePoolIncentivesProposalSDKType, - UpdatePoolIncentivesProposal, - UpdatePoolIncentivesProposalProtoMsg, - UpdatePoolIncentivesProposalSDKType, -} from '../../../osmosis/pool-incentives/v1beta1/gov' -import { - SetProtoRevAdminAccountProposal, - SetProtoRevAdminAccountProposalProtoMsg, - SetProtoRevAdminAccountProposalSDKType, - SetProtoRevEnabledProposal, - SetProtoRevEnabledProposalProtoMsg, - SetProtoRevEnabledProposalSDKType, -} from '../../../osmosis/protorev/v1beta1/gov' -import { - RemoveSuperfluidAssetsProposal, - RemoveSuperfluidAssetsProposalProtoMsg, - RemoveSuperfluidAssetsProposalSDKType, - SetSuperfluidAssetsProposal, - SetSuperfluidAssetsProposalProtoMsg, - SetSuperfluidAssetsProposalSDKType, - UpdateUnpoolWhiteListProposal, - UpdateUnpoolWhiteListProposalProtoMsg, - UpdateUnpoolWhiteListProposalSDKType, -} from '../../../osmosis/superfluid/v1beta1/gov' -import { - UpdateFeeTokenProposal, - UpdateFeeTokenProposalProtoMsg, - UpdateFeeTokenProposalSDKType, -} from '../../../osmosis/txfees/v1beta1/gov' -import { - DemotePrivilegedContractProposal, - DemotePrivilegedContractProposalProtoMsg, - DemotePrivilegedContractProposalSDKType, - PromoteToPrivilegedContractProposal, - PromoteToPrivilegedContractProposalProtoMsg, - PromoteToPrivilegedContractProposalSDKType, -} from '../../../publicawesome/stargaze/cron/v1/proposal' -import { - RemoveCodeAuthorizationProposal, - RemoveCodeAuthorizationProposalProtoMsg, - RemoveCodeAuthorizationProposalSDKType, - RemoveContractAuthorizationProposal, - RemoveContractAuthorizationProposalProtoMsg, - RemoveContractAuthorizationProposalSDKType, - SetCodeAuthorizationProposal, - SetCodeAuthorizationProposalProtoMsg, - SetCodeAuthorizationProposalSDKType, - SetContractAuthorizationProposal, - SetContractAuthorizationProposalProtoMsg, - SetContractAuthorizationProposalSDKType, -} from '../../../publicawesome/stargaze/globalfee/v1/proposal' -import { - AllowDenomProposal, - AllowDenomProposalProtoMsg, - AllowDenomProposalSDKType, -} from '../../../regen/ecocredit/marketplace/v1/types' -import { - CreditTypeProposal, - CreditTypeProposalProtoMsg, - CreditTypeProposalSDKType, -} from '../../../regen/ecocredit/v1/types' -import { Coin, CoinAmino, CoinSDKType } from '../../base/v1beta1/coin' -import { - CommunityPoolSpendProposal, - CommunityPoolSpendProposalProtoMsg, - CommunityPoolSpendProposalSDKType, - CommunityPoolSpendProposalWithDeposit, - CommunityPoolSpendProposalWithDepositProtoMsg, - CommunityPoolSpendProposalWithDepositSDKType, -} from '../../distribution/v1beta1/distribution' -import { - ParameterChangeProposal, - ParameterChangeProposalProtoMsg, - ParameterChangeProposalSDKType, -} from '../../params/v1beta1/params' -import { - CancelSoftwareUpgradeProposal, - CancelSoftwareUpgradeProposalProtoMsg, - CancelSoftwareUpgradeProposalSDKType, - SoftwareUpgradeProposal, - SoftwareUpgradeProposalProtoMsg, - SoftwareUpgradeProposalSDKType, -} from '../../upgrade/v1beta1/upgrade' -import { - TextProposal, - TextProposalProtoMsg, - TextProposalSDKType, -} from '../v1beta1/gov' -import { - Params, - ParamsAmino, - ParamsSDKType, - VoteOption, - WeightedVoteOption, - WeightedVoteOptionAmino, - WeightedVoteOptionSDKType, -} from './gov' +// @ts-nocheck +import { aminoToRawProtobufMsg, rawProtobufMsgToAmino } from "../../../../utils"; +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { VoteOption, WeightedVoteOption, WeightedVoteOptionAmino, WeightedVoteOptionSDKType, Params, ParamsAmino, ParamsSDKType } from "./gov"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { MsgCreateAllianceProposal, MsgCreateAllianceProposalProtoMsg, MsgCreateAllianceProposalSDKType, MsgUpdateAllianceProposal, MsgUpdateAllianceProposalProtoMsg, MsgUpdateAllianceProposalSDKType, MsgDeleteAllianceProposal, MsgDeleteAllianceProposalProtoMsg, MsgDeleteAllianceProposalSDKType } from "../../../alliance/alliance/gov"; +import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalSDKType, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg, CommunityPoolSpendProposalWithDepositSDKType } from "../../distribution/v1beta1/distribution"; +import { TextProposal, TextProposalProtoMsg, TextProposalSDKType } from "../v1beta1/gov"; +import { ParameterChangeProposal, ParameterChangeProposalProtoMsg, ParameterChangeProposalSDKType } from "../../params/v1beta1/params"; +import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, SoftwareUpgradeProposalSDKType, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposalSDKType } from "../../upgrade/v1beta1/upgrade"; +import { StoreCodeProposal, StoreCodeProposalProtoMsg, StoreCodeProposalSDKType, InstantiateContractProposal, InstantiateContractProposalProtoMsg, InstantiateContractProposalSDKType, InstantiateContract2Proposal, InstantiateContract2ProposalProtoMsg, InstantiateContract2ProposalSDKType, MigrateContractProposal, MigrateContractProposalProtoMsg, MigrateContractProposalSDKType, SudoContractProposal, SudoContractProposalProtoMsg, SudoContractProposalSDKType, ExecuteContractProposal, ExecuteContractProposalProtoMsg, ExecuteContractProposalSDKType, UpdateAdminProposal, UpdateAdminProposalProtoMsg, UpdateAdminProposalSDKType, ClearAdminProposal, ClearAdminProposalProtoMsg, ClearAdminProposalSDKType, PinCodesProposal, PinCodesProposalProtoMsg, PinCodesProposalSDKType, UnpinCodesProposal, UnpinCodesProposalProtoMsg, UnpinCodesProposalSDKType, UpdateInstantiateConfigProposal, UpdateInstantiateConfigProposalProtoMsg, UpdateInstantiateConfigProposalSDKType, StoreAndInstantiateContractProposal, StoreAndInstantiateContractProposalProtoMsg, StoreAndInstantiateContractProposalSDKType } from "../../../cosmwasm/wasm/v1/proposal"; +import { ClientUpdateProposal, ClientUpdateProposalProtoMsg, ClientUpdateProposalSDKType, UpgradeProposal, UpgradeProposalProtoMsg, UpgradeProposalSDKType } from "../../../ibc/core/client/v1/client"; +import { ReplaceMigrationRecordsProposal, ReplaceMigrationRecordsProposalProtoMsg, ReplaceMigrationRecordsProposalSDKType, UpdateMigrationRecordsProposal, UpdateMigrationRecordsProposalProtoMsg, UpdateMigrationRecordsProposalSDKType, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType, SetScalingFactorControllerProposal, SetScalingFactorControllerProposalProtoMsg, SetScalingFactorControllerProposalSDKType } from "../../../osmosis/gamm/v1beta1/gov"; +import { CreateGroupsProposal, CreateGroupsProposalProtoMsg, CreateGroupsProposalSDKType } from "../../../osmosis/incentives/gov"; +import { ReplacePoolIncentivesProposal, ReplacePoolIncentivesProposalProtoMsg, ReplacePoolIncentivesProposalSDKType, UpdatePoolIncentivesProposal, UpdatePoolIncentivesProposalProtoMsg, UpdatePoolIncentivesProposalSDKType } from "../../../osmosis/pool-incentives/v1beta1/gov"; +import { SetProtoRevEnabledProposal, SetProtoRevEnabledProposalProtoMsg, SetProtoRevEnabledProposalSDKType, SetProtoRevAdminAccountProposal, SetProtoRevAdminAccountProposalProtoMsg, SetProtoRevAdminAccountProposalSDKType } from "../../../osmosis/protorev/v1beta1/gov"; +import { SetSuperfluidAssetsProposal, SetSuperfluidAssetsProposalProtoMsg, SetSuperfluidAssetsProposalSDKType, RemoveSuperfluidAssetsProposal, RemoveSuperfluidAssetsProposalProtoMsg, RemoveSuperfluidAssetsProposalSDKType, UpdateUnpoolWhiteListProposal, UpdateUnpoolWhiteListProposalProtoMsg, UpdateUnpoolWhiteListProposalSDKType } from "../../../osmosis/superfluid/v1beta1/gov"; +import { UpdateFeeTokenProposal, UpdateFeeTokenProposalProtoMsg, UpdateFeeTokenProposalSDKType } from "../../../osmosis/txfees/v1beta1/gov"; +import { PromoteToPrivilegedContractProposal, PromoteToPrivilegedContractProposalProtoMsg, PromoteToPrivilegedContractProposalSDKType, DemotePrivilegedContractProposal, DemotePrivilegedContractProposalProtoMsg, DemotePrivilegedContractProposalSDKType } from "../../../publicawesome/stargaze/cron/v1/proposal"; +import { SetCodeAuthorizationProposal, SetCodeAuthorizationProposalProtoMsg, SetCodeAuthorizationProposalSDKType, RemoveCodeAuthorizationProposal, RemoveCodeAuthorizationProposalProtoMsg, RemoveCodeAuthorizationProposalSDKType, SetContractAuthorizationProposal, SetContractAuthorizationProposalProtoMsg, SetContractAuthorizationProposalSDKType, RemoveContractAuthorizationProposal, RemoveContractAuthorizationProposalProtoMsg, RemoveContractAuthorizationProposalSDKType } from "../../../publicawesome/stargaze/globalfee/v1/proposal"; +import { AllowDenomProposal, AllowDenomProposalProtoMsg, AllowDenomProposalSDKType } from "../../../regen/ecocredit/marketplace/v1/types"; +import { CreditTypeProposal, CreditTypeProposalProtoMsg, CreditTypeProposalSDKType } from "../../../regen/ecocredit/v1/types"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary * proposal Content. */ export interface MsgSubmitProposal { /** messages are the arbitrary messages to be executed if proposal passes. */ - messages: Any[] + messages: Any[]; /** initial_deposit is the deposit value that must be paid at proposal submission. */ - initialDeposit: Coin[] + initialDeposit: Coin[]; /** proposer is the account address of the proposer. */ - proposer: string + proposer: string; /** metadata is any arbitrary metadata attached to the proposal. */ - metadata: string + metadata: string; /** * title is the title of the proposal. - * + * * Since: cosmos-sdk 0.47 */ - title: string + title: string; /** * summary is the summary of the proposal - * + * * Since: cosmos-sdk 0.47 */ - summary: string + summary: string; /** * expedited defines if the proposal is expedited or not - * + * * Since: cosmos-sdk 0.50 */ - expedited: boolean + expedited: boolean; } export interface MsgSubmitProposalProtoMsg { - typeUrl: '/cosmos.gov.v1.MsgSubmitProposal' - value: Uint8Array + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal"; + value: Uint8Array; } /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary @@ -227,70 +65,70 @@ export interface MsgSubmitProposalProtoMsg { */ export interface MsgSubmitProposalAmino { /** messages are the arbitrary messages to be executed if proposal passes. */ - messages?: AnyAmino[] + messages?: AnyAmino[]; /** initial_deposit is the deposit value that must be paid at proposal submission. */ - initial_deposit: CoinAmino[] + initial_deposit: CoinAmino[]; /** proposer is the account address of the proposer. */ - proposer?: string + proposer?: string; /** metadata is any arbitrary metadata attached to the proposal. */ - metadata?: string + metadata?: string; /** * title is the title of the proposal. - * + * * Since: cosmos-sdk 0.47 */ - title?: string + title?: string; /** * summary is the summary of the proposal - * + * * Since: cosmos-sdk 0.47 */ - summary?: string + summary?: string; /** * expedited defines if the proposal is expedited or not - * + * * Since: cosmos-sdk 0.50 */ - expedited?: boolean + expedited?: boolean; } export interface MsgSubmitProposalAminoMsg { - type: 'cosmos-sdk/v1/MsgSubmitProposal' - value: MsgSubmitProposalAmino + type: "cosmos-sdk/v1/MsgSubmitProposal"; + value: MsgSubmitProposalAmino; } /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary * proposal Content. */ export interface MsgSubmitProposalSDKType { - messages: AnySDKType[] - initial_deposit: CoinSDKType[] - proposer: string - metadata: string - title: string - summary: string - expedited: boolean + messages: AnySDKType[]; + initial_deposit: CoinSDKType[]; + proposer: string; + metadata: string; + title: string; + summary: string; + expedited: boolean; } /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponse { /** proposal_id defines the unique id of the proposal. */ - proposalId: bigint + proposalId: bigint; } export interface MsgSubmitProposalResponseProtoMsg { - typeUrl: '/cosmos.gov.v1.MsgSubmitProposalResponse' - value: Uint8Array + typeUrl: "/cosmos.gov.v1.MsgSubmitProposalResponse"; + value: Uint8Array; } /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponseAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id?: string + proposal_id?: string; } export interface MsgSubmitProposalResponseAminoMsg { - type: 'cosmos-sdk/v1/MsgSubmitProposalResponse' - value: MsgSubmitProposalResponseAmino + type: "cosmos-sdk/v1/MsgSubmitProposalResponse"; + value: MsgSubmitProposalResponseAmino; } /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponseSDKType { - proposal_id: bigint + proposal_id: bigint; } /** * MsgExecLegacyContent is used to wrap the legacy content field into a message. @@ -298,3068 +136,2047 @@ export interface MsgSubmitProposalResponseSDKType { */ export interface MsgExecLegacyContent { /** content is the proposal's content. */ - content?: - | (MsgCreateAllianceProposal & - MsgUpdateAllianceProposal & - MsgDeleteAllianceProposal & - CommunityPoolSpendProposal & - CommunityPoolSpendProposalWithDeposit & - TextProposal & - ParameterChangeProposal & - SoftwareUpgradeProposal & - CancelSoftwareUpgradeProposal & - StoreCodeProposal & - InstantiateContractProposal & - InstantiateContract2Proposal & - MigrateContractProposal & - SudoContractProposal & - ExecuteContractProposal & - UpdateAdminProposal & - ClearAdminProposal & - PinCodesProposal & - UnpinCodesProposal & - UpdateInstantiateConfigProposal & - StoreAndInstantiateContractProposal & - ClientUpdateProposal & - UpgradeProposal & - ReplaceMigrationRecordsProposal & - UpdateMigrationRecordsProposal & - CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal & - SetScalingFactorControllerProposal & - CreateGroupsProposal & - ReplacePoolIncentivesProposal & - UpdatePoolIncentivesProposal & - SetProtoRevEnabledProposal & - SetProtoRevAdminAccountProposal & - SetSuperfluidAssetsProposal & - RemoveSuperfluidAssetsProposal & - UpdateUnpoolWhiteListProposal & - UpdateFeeTokenProposal & - PromoteToPrivilegedContractProposal & - DemotePrivilegedContractProposal & - SetCodeAuthorizationProposal & - RemoveCodeAuthorizationProposal & - SetContractAuthorizationProposal & - RemoveContractAuthorizationProposal & - AllowDenomProposal & - CreditTypeProposal & - Any) - | undefined + content?: (MsgCreateAllianceProposal & MsgUpdateAllianceProposal & MsgDeleteAllianceProposal & CommunityPoolSpendProposal & CommunityPoolSpendProposalWithDeposit & TextProposal & ParameterChangeProposal & SoftwareUpgradeProposal & CancelSoftwareUpgradeProposal & StoreCodeProposal & InstantiateContractProposal & InstantiateContract2Proposal & MigrateContractProposal & SudoContractProposal & ExecuteContractProposal & UpdateAdminProposal & ClearAdminProposal & PinCodesProposal & UnpinCodesProposal & UpdateInstantiateConfigProposal & StoreAndInstantiateContractProposal & ClientUpdateProposal & UpgradeProposal & ReplaceMigrationRecordsProposal & UpdateMigrationRecordsProposal & CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal & SetScalingFactorControllerProposal & CreateGroupsProposal & ReplacePoolIncentivesProposal & UpdatePoolIncentivesProposal & SetProtoRevEnabledProposal & SetProtoRevAdminAccountProposal & SetSuperfluidAssetsProposal & RemoveSuperfluidAssetsProposal & UpdateUnpoolWhiteListProposal & UpdateFeeTokenProposal & PromoteToPrivilegedContractProposal & DemotePrivilegedContractProposal & SetCodeAuthorizationProposal & RemoveCodeAuthorizationProposal & SetContractAuthorizationProposal & RemoveContractAuthorizationProposal & AllowDenomProposal & CreditTypeProposal & Any) | undefined; /** authority must be the gov module address. */ - authority: string + authority: string; } export interface MsgExecLegacyContentProtoMsg { - typeUrl: '/cosmos.gov.v1.MsgExecLegacyContent' - value: Uint8Array -} -export type MsgExecLegacyContentEncoded = Omit< - MsgExecLegacyContent, - 'content' -> & { - /** content is the proposal's content. */ content?: - | MsgCreateAllianceProposalProtoMsg - | MsgUpdateAllianceProposalProtoMsg - | MsgDeleteAllianceProposalProtoMsg - | CommunityPoolSpendProposalProtoMsg - | CommunityPoolSpendProposalWithDepositProtoMsg - | TextProposalProtoMsg - | ParameterChangeProposalProtoMsg - | SoftwareUpgradeProposalProtoMsg - | CancelSoftwareUpgradeProposalProtoMsg - | StoreCodeProposalProtoMsg - | InstantiateContractProposalProtoMsg - | InstantiateContract2ProposalProtoMsg - | MigrateContractProposalProtoMsg - | SudoContractProposalProtoMsg - | ExecuteContractProposalProtoMsg - | UpdateAdminProposalProtoMsg - | ClearAdminProposalProtoMsg - | PinCodesProposalProtoMsg - | UnpinCodesProposalProtoMsg - | UpdateInstantiateConfigProposalProtoMsg - | StoreAndInstantiateContractProposalProtoMsg - | ClientUpdateProposalProtoMsg - | UpgradeProposalProtoMsg - | ReplaceMigrationRecordsProposalProtoMsg - | UpdateMigrationRecordsProposalProtoMsg - | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg - | SetScalingFactorControllerProposalProtoMsg - | CreateGroupsProposalProtoMsg - | ReplacePoolIncentivesProposalProtoMsg - | UpdatePoolIncentivesProposalProtoMsg - | SetProtoRevEnabledProposalProtoMsg - | SetProtoRevAdminAccountProposalProtoMsg - | SetSuperfluidAssetsProposalProtoMsg - | RemoveSuperfluidAssetsProposalProtoMsg - | UpdateUnpoolWhiteListProposalProtoMsg - | UpdateFeeTokenProposalProtoMsg - | PromoteToPrivilegedContractProposalProtoMsg - | DemotePrivilegedContractProposalProtoMsg - | SetCodeAuthorizationProposalProtoMsg - | RemoveCodeAuthorizationProposalProtoMsg - | SetContractAuthorizationProposalProtoMsg - | RemoveContractAuthorizationProposalProtoMsg - | AllowDenomProposalProtoMsg - | CreditTypeProposalProtoMsg - | AnyProtoMsg - | undefined + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent"; + value: Uint8Array; } +export type MsgExecLegacyContentEncoded = Omit & { + /** content is the proposal's content. */content?: MsgCreateAllianceProposalProtoMsg | MsgUpdateAllianceProposalProtoMsg | MsgDeleteAllianceProposalProtoMsg | CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | ParameterChangeProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | ClientUpdateProposalProtoMsg | UpgradeProposalProtoMsg | ReplaceMigrationRecordsProposalProtoMsg | UpdateMigrationRecordsProposalProtoMsg | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg | SetScalingFactorControllerProposalProtoMsg | CreateGroupsProposalProtoMsg | ReplacePoolIncentivesProposalProtoMsg | UpdatePoolIncentivesProposalProtoMsg | SetProtoRevEnabledProposalProtoMsg | SetProtoRevAdminAccountProposalProtoMsg | SetSuperfluidAssetsProposalProtoMsg | RemoveSuperfluidAssetsProposalProtoMsg | UpdateUnpoolWhiteListProposalProtoMsg | UpdateFeeTokenProposalProtoMsg | PromoteToPrivilegedContractProposalProtoMsg | DemotePrivilegedContractProposalProtoMsg | SetCodeAuthorizationProposalProtoMsg | RemoveCodeAuthorizationProposalProtoMsg | SetContractAuthorizationProposalProtoMsg | RemoveContractAuthorizationProposalProtoMsg | AllowDenomProposalProtoMsg | CreditTypeProposalProtoMsg | AnyProtoMsg | undefined; +}; /** * MsgExecLegacyContent is used to wrap the legacy content field into a message. * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. */ export interface MsgExecLegacyContentAmino { /** content is the proposal's content. */ - content?: AnyAmino | undefined + content?: AnyAmino | undefined; /** authority must be the gov module address. */ - authority?: string + authority?: string; } export interface MsgExecLegacyContentAminoMsg { - type: 'cosmos-sdk/v1/MsgExecLegacyContent' - value: MsgExecLegacyContentAmino + type: "cosmos-sdk/v1/MsgExecLegacyContent"; + value: MsgExecLegacyContentAmino; } /** * MsgExecLegacyContent is used to wrap the legacy content field into a message. * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. */ export interface MsgExecLegacyContentSDKType { - content?: - | MsgCreateAllianceProposalSDKType - | MsgUpdateAllianceProposalSDKType - | MsgDeleteAllianceProposalSDKType - | CommunityPoolSpendProposalSDKType - | CommunityPoolSpendProposalWithDepositSDKType - | TextProposalSDKType - | ParameterChangeProposalSDKType - | SoftwareUpgradeProposalSDKType - | CancelSoftwareUpgradeProposalSDKType - | StoreCodeProposalSDKType - | InstantiateContractProposalSDKType - | InstantiateContract2ProposalSDKType - | MigrateContractProposalSDKType - | SudoContractProposalSDKType - | ExecuteContractProposalSDKType - | UpdateAdminProposalSDKType - | ClearAdminProposalSDKType - | PinCodesProposalSDKType - | UnpinCodesProposalSDKType - | UpdateInstantiateConfigProposalSDKType - | StoreAndInstantiateContractProposalSDKType - | ClientUpdateProposalSDKType - | UpgradeProposalSDKType - | ReplaceMigrationRecordsProposalSDKType - | UpdateMigrationRecordsProposalSDKType - | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType - | SetScalingFactorControllerProposalSDKType - | CreateGroupsProposalSDKType - | ReplacePoolIncentivesProposalSDKType - | UpdatePoolIncentivesProposalSDKType - | SetProtoRevEnabledProposalSDKType - | SetProtoRevAdminAccountProposalSDKType - | SetSuperfluidAssetsProposalSDKType - | RemoveSuperfluidAssetsProposalSDKType - | UpdateUnpoolWhiteListProposalSDKType - | UpdateFeeTokenProposalSDKType - | PromoteToPrivilegedContractProposalSDKType - | DemotePrivilegedContractProposalSDKType - | SetCodeAuthorizationProposalSDKType - | RemoveCodeAuthorizationProposalSDKType - | SetContractAuthorizationProposalSDKType - | RemoveContractAuthorizationProposalSDKType - | AllowDenomProposalSDKType - | CreditTypeProposalSDKType - | AnySDKType - | undefined - authority: string + content?: MsgCreateAllianceProposalSDKType | MsgUpdateAllianceProposalSDKType | MsgDeleteAllianceProposalSDKType | CommunityPoolSpendProposalSDKType | CommunityPoolSpendProposalWithDepositSDKType | TextProposalSDKType | ParameterChangeProposalSDKType | SoftwareUpgradeProposalSDKType | CancelSoftwareUpgradeProposalSDKType | StoreCodeProposalSDKType | InstantiateContractProposalSDKType | InstantiateContract2ProposalSDKType | MigrateContractProposalSDKType | SudoContractProposalSDKType | ExecuteContractProposalSDKType | UpdateAdminProposalSDKType | ClearAdminProposalSDKType | PinCodesProposalSDKType | UnpinCodesProposalSDKType | UpdateInstantiateConfigProposalSDKType | StoreAndInstantiateContractProposalSDKType | ClientUpdateProposalSDKType | UpgradeProposalSDKType | ReplaceMigrationRecordsProposalSDKType | UpdateMigrationRecordsProposalSDKType | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType | SetScalingFactorControllerProposalSDKType | CreateGroupsProposalSDKType | ReplacePoolIncentivesProposalSDKType | UpdatePoolIncentivesProposalSDKType | SetProtoRevEnabledProposalSDKType | SetProtoRevAdminAccountProposalSDKType | SetSuperfluidAssetsProposalSDKType | RemoveSuperfluidAssetsProposalSDKType | UpdateUnpoolWhiteListProposalSDKType | UpdateFeeTokenProposalSDKType | PromoteToPrivilegedContractProposalSDKType | DemotePrivilegedContractProposalSDKType | SetCodeAuthorizationProposalSDKType | RemoveCodeAuthorizationProposalSDKType | SetContractAuthorizationProposalSDKType | RemoveContractAuthorizationProposalSDKType | AllowDenomProposalSDKType | CreditTypeProposalSDKType | AnySDKType | undefined; + authority: string; } /** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ export interface MsgExecLegacyContentResponse {} export interface MsgExecLegacyContentResponseProtoMsg { - typeUrl: '/cosmos.gov.v1.MsgExecLegacyContentResponse' - value: Uint8Array + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContentResponse"; + value: Uint8Array; } /** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ export interface MsgExecLegacyContentResponseAmino {} export interface MsgExecLegacyContentResponseAminoMsg { - type: 'cosmos-sdk/v1/MsgExecLegacyContentResponse' - value: MsgExecLegacyContentResponseAmino + type: "cosmos-sdk/v1/MsgExecLegacyContentResponse"; + value: MsgExecLegacyContentResponseAmino; } /** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ export interface MsgExecLegacyContentResponseSDKType {} /** MsgVote defines a message to cast a vote. */ export interface MsgVote { /** proposal_id defines the unique id of the proposal. */ - proposalId: bigint + proposalId: bigint; /** voter is the voter address for the proposal. */ - voter: string + voter: string; /** option defines the vote option. */ - option: VoteOption + option: VoteOption; /** metadata is any arbitrary metadata attached to the Vote. */ - metadata: string + metadata: string; } export interface MsgVoteProtoMsg { - typeUrl: '/cosmos.gov.v1.MsgVote' - value: Uint8Array + typeUrl: "/cosmos.gov.v1.MsgVote"; + value: Uint8Array; } /** MsgVote defines a message to cast a vote. */ export interface MsgVoteAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string + proposal_id: string; /** voter is the voter address for the proposal. */ - voter?: string + voter?: string; /** option defines the vote option. */ - option?: VoteOption + option?: VoteOption; /** metadata is any arbitrary metadata attached to the Vote. */ - metadata?: string + metadata?: string; } export interface MsgVoteAminoMsg { - type: 'cosmos-sdk/v1/MsgVote' - value: MsgVoteAmino + type: "cosmos-sdk/v1/MsgVote"; + value: MsgVoteAmino; } /** MsgVote defines a message to cast a vote. */ export interface MsgVoteSDKType { - proposal_id: bigint - voter: string - option: VoteOption - metadata: string + proposal_id: bigint; + voter: string; + option: VoteOption; + metadata: string; } /** MsgVoteResponse defines the Msg/Vote response type. */ export interface MsgVoteResponse {} export interface MsgVoteResponseProtoMsg { - typeUrl: '/cosmos.gov.v1.MsgVoteResponse' - value: Uint8Array + typeUrl: "/cosmos.gov.v1.MsgVoteResponse"; + value: Uint8Array; } /** MsgVoteResponse defines the Msg/Vote response type. */ export interface MsgVoteResponseAmino {} export interface MsgVoteResponseAminoMsg { - type: 'cosmos-sdk/v1/MsgVoteResponse' - value: MsgVoteResponseAmino + type: "cosmos-sdk/v1/MsgVoteResponse"; + value: MsgVoteResponseAmino; } /** MsgVoteResponse defines the Msg/Vote response type. */ export interface MsgVoteResponseSDKType {} /** MsgVoteWeighted defines a message to cast a vote. */ export interface MsgVoteWeighted { /** proposal_id defines the unique id of the proposal. */ - proposalId: bigint + proposalId: bigint; /** voter is the voter address for the proposal. */ - voter: string + voter: string; /** options defines the weighted vote options. */ - options: WeightedVoteOption[] + options: WeightedVoteOption[]; /** metadata is any arbitrary metadata attached to the VoteWeighted. */ - metadata: string + metadata: string; } export interface MsgVoteWeightedProtoMsg { - typeUrl: '/cosmos.gov.v1.MsgVoteWeighted' - value: Uint8Array + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted"; + value: Uint8Array; } /** MsgVoteWeighted defines a message to cast a vote. */ export interface MsgVoteWeightedAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string + proposal_id: string; /** voter is the voter address for the proposal. */ - voter?: string + voter?: string; /** options defines the weighted vote options. */ - options?: WeightedVoteOptionAmino[] + options?: WeightedVoteOptionAmino[]; /** metadata is any arbitrary metadata attached to the VoteWeighted. */ - metadata?: string + metadata?: string; } export interface MsgVoteWeightedAminoMsg { - type: 'cosmos-sdk/v1/MsgVoteWeighted' - value: MsgVoteWeightedAmino + type: "cosmos-sdk/v1/MsgVoteWeighted"; + value: MsgVoteWeightedAmino; } /** MsgVoteWeighted defines a message to cast a vote. */ export interface MsgVoteWeightedSDKType { - proposal_id: bigint - voter: string - options: WeightedVoteOptionSDKType[] - metadata: string + proposal_id: bigint; + voter: string; + options: WeightedVoteOptionSDKType[]; + metadata: string; } /** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ export interface MsgVoteWeightedResponse {} export interface MsgVoteWeightedResponseProtoMsg { - typeUrl: '/cosmos.gov.v1.MsgVoteWeightedResponse' - value: Uint8Array + typeUrl: "/cosmos.gov.v1.MsgVoteWeightedResponse"; + value: Uint8Array; } /** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ export interface MsgVoteWeightedResponseAmino {} export interface MsgVoteWeightedResponseAminoMsg { - type: 'cosmos-sdk/v1/MsgVoteWeightedResponse' - value: MsgVoteWeightedResponseAmino + type: "cosmos-sdk/v1/MsgVoteWeightedResponse"; + value: MsgVoteWeightedResponseAmino; } /** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ export interface MsgVoteWeightedResponseSDKType {} /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDeposit { /** proposal_id defines the unique id of the proposal. */ - proposalId: bigint + proposalId: bigint; /** depositor defines the deposit addresses from the proposals. */ - depositor: string + depositor: string; /** amount to be deposited by depositor. */ - amount: Coin[] + amount: Coin[]; } export interface MsgDepositProtoMsg { - typeUrl: '/cosmos.gov.v1.MsgDeposit' - value: Uint8Array + typeUrl: "/cosmos.gov.v1.MsgDeposit"; + value: Uint8Array; } /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDepositAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id: string + proposal_id: string; /** depositor defines the deposit addresses from the proposals. */ - depositor?: string + depositor?: string; /** amount to be deposited by depositor. */ - amount: CoinAmino[] + amount: CoinAmino[]; } export interface MsgDepositAminoMsg { - type: 'cosmos-sdk/v1/MsgDeposit' - value: MsgDepositAmino + type: "cosmos-sdk/v1/MsgDeposit"; + value: MsgDepositAmino; } /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDepositSDKType { - proposal_id: bigint - depositor: string - amount: CoinSDKType[] + proposal_id: bigint; + depositor: string; + amount: CoinSDKType[]; } /** MsgDepositResponse defines the Msg/Deposit response type. */ export interface MsgDepositResponse {} export interface MsgDepositResponseProtoMsg { - typeUrl: '/cosmos.gov.v1.MsgDepositResponse' - value: Uint8Array + typeUrl: "/cosmos.gov.v1.MsgDepositResponse"; + value: Uint8Array; } /** MsgDepositResponse defines the Msg/Deposit response type. */ export interface MsgDepositResponseAmino {} export interface MsgDepositResponseAminoMsg { - type: 'cosmos-sdk/v1/MsgDepositResponse' - value: MsgDepositResponseAmino + type: "cosmos-sdk/v1/MsgDepositResponse"; + value: MsgDepositResponseAmino; } /** MsgDepositResponse defines the Msg/Deposit response type. */ export interface MsgDepositResponseSDKType {} /** * MsgUpdateParams is the Msg/UpdateParams request type. - * + * * Since: cosmos-sdk 0.47 */ export interface MsgUpdateParams { /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ - authority: string + authority: string; /** * params defines the x/gov parameters to update. - * + * * NOTE: All parameters must be supplied. */ - params: Params | undefined + params: Params | undefined; } export interface MsgUpdateParamsProtoMsg { - typeUrl: '/cosmos.gov.v1.MsgUpdateParams' - value: Uint8Array + typeUrl: "/cosmos.gov.v1.MsgUpdateParams"; + value: Uint8Array; } /** * MsgUpdateParams is the Msg/UpdateParams request type. - * + * * Since: cosmos-sdk 0.47 */ export interface MsgUpdateParamsAmino { /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ - authority?: string + authority?: string; /** * params defines the x/gov parameters to update. - * + * * NOTE: All parameters must be supplied. */ - params: ParamsAmino | undefined + params: ParamsAmino | undefined; } export interface MsgUpdateParamsAminoMsg { - type: 'cosmos-sdk/x/gov/v1/MsgUpdateParams' - value: MsgUpdateParamsAmino + type: "cosmos-sdk/x/gov/v1/MsgUpdateParams"; + value: MsgUpdateParamsAmino; } /** * MsgUpdateParams is the Msg/UpdateParams request type. - * + * * Since: cosmos-sdk 0.47 */ export interface MsgUpdateParamsSDKType { - authority: string - params: ParamsSDKType | undefined + authority: string; + params: ParamsSDKType | undefined; } /** * MsgUpdateParamsResponse defines the response structure for executing a * MsgUpdateParams message. - * + * * Since: cosmos-sdk 0.47 */ export interface MsgUpdateParamsResponse {} export interface MsgUpdateParamsResponseProtoMsg { - typeUrl: '/cosmos.gov.v1.MsgUpdateParamsResponse' - value: Uint8Array + typeUrl: "/cosmos.gov.v1.MsgUpdateParamsResponse"; + value: Uint8Array; } /** * MsgUpdateParamsResponse defines the response structure for executing a * MsgUpdateParams message. - * + * * Since: cosmos-sdk 0.47 */ export interface MsgUpdateParamsResponseAmino {} export interface MsgUpdateParamsResponseAminoMsg { - type: 'cosmos-sdk/v1/MsgUpdateParamsResponse' - value: MsgUpdateParamsResponseAmino + type: "cosmos-sdk/v1/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; } /** * MsgUpdateParamsResponse defines the response structure for executing a * MsgUpdateParams message. - * + * * Since: cosmos-sdk 0.47 */ export interface MsgUpdateParamsResponseSDKType {} /** * MsgCancelProposal is the Msg/CancelProposal request type. - * + * * Since: cosmos-sdk 0.50 */ export interface MsgCancelProposal { /** proposal_id defines the unique id of the proposal. */ - proposalId: bigint + proposalId: bigint; /** proposer is the account address of the proposer. */ - proposer: string + proposer: string; } export interface MsgCancelProposalProtoMsg { - typeUrl: '/cosmos.gov.v1.MsgCancelProposal' - value: Uint8Array + typeUrl: "/cosmos.gov.v1.MsgCancelProposal"; + value: Uint8Array; } /** * MsgCancelProposal is the Msg/CancelProposal request type. - * + * * Since: cosmos-sdk 0.50 */ export interface MsgCancelProposalAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id?: string + proposal_id?: string; /** proposer is the account address of the proposer. */ - proposer?: string + proposer?: string; } export interface MsgCancelProposalAminoMsg { - type: 'cosmos-sdk/v1/MsgCancelProposal' - value: MsgCancelProposalAmino + type: "cosmos-sdk/v1/MsgCancelProposal"; + value: MsgCancelProposalAmino; } /** * MsgCancelProposal is the Msg/CancelProposal request type. - * + * * Since: cosmos-sdk 0.50 */ export interface MsgCancelProposalSDKType { - proposal_id: bigint - proposer: string + proposal_id: bigint; + proposer: string; } /** * MsgCancelProposalResponse defines the response structure for executing a * MsgCancelProposal message. - * + * * Since: cosmos-sdk 0.50 */ export interface MsgCancelProposalResponse { /** proposal_id defines the unique id of the proposal. */ - proposalId: bigint + proposalId: bigint; /** canceled_time is the time when proposal is canceled. */ - canceledTime: Date | undefined + canceledTime: Date | undefined; /** canceled_height defines the block height at which the proposal is canceled. */ - canceledHeight: bigint + canceledHeight: bigint; } export interface MsgCancelProposalResponseProtoMsg { - typeUrl: '/cosmos.gov.v1.MsgCancelProposalResponse' - value: Uint8Array + typeUrl: "/cosmos.gov.v1.MsgCancelProposalResponse"; + value: Uint8Array; } /** * MsgCancelProposalResponse defines the response structure for executing a * MsgCancelProposal message. - * + * * Since: cosmos-sdk 0.50 */ export interface MsgCancelProposalResponseAmino { /** proposal_id defines the unique id of the proposal. */ - proposal_id?: string + proposal_id?: string; /** canceled_time is the time when proposal is canceled. */ - canceled_time?: string | undefined + canceled_time?: string | undefined; /** canceled_height defines the block height at which the proposal is canceled. */ - canceled_height?: string + canceled_height?: string; } export interface MsgCancelProposalResponseAminoMsg { - type: 'cosmos-sdk/v1/MsgCancelProposalResponse' - value: MsgCancelProposalResponseAmino + type: "cosmos-sdk/v1/MsgCancelProposalResponse"; + value: MsgCancelProposalResponseAmino; } /** * MsgCancelProposalResponse defines the response structure for executing a * MsgCancelProposal message. - * + * * Since: cosmos-sdk 0.50 */ export interface MsgCancelProposalResponseSDKType { - proposal_id: bigint - canceled_time: Date | undefined - canceled_height: bigint + proposal_id: bigint; + canceled_time: Date | undefined; + canceled_height: bigint; } function createBaseMsgSubmitProposal(): MsgSubmitProposal { return { messages: [], initialDeposit: [], - proposer: '', - metadata: '', - title: '', - summary: '', - expedited: false, - } + proposer: "", + metadata: "", + title: "", + summary: "", + expedited: false + }; } export const MsgSubmitProposal = { - typeUrl: '/cosmos.gov.v1.MsgSubmitProposal', - encode( - message: MsgSubmitProposal, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", + encode(message: MsgSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.messages) { - Any.encode(v!, writer.uint32(10).fork()).ldelim() + Any.encode(v!, writer.uint32(10).fork()).ldelim(); } for (const v of message.initialDeposit) { - Coin.encode(v!, writer.uint32(18).fork()).ldelim() + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); } - if (message.proposer !== '') { - writer.uint32(26).string(message.proposer) + if (message.proposer !== "") { + writer.uint32(26).string(message.proposer); } - if (message.metadata !== '') { - writer.uint32(34).string(message.metadata) + if (message.metadata !== "") { + writer.uint32(34).string(message.metadata); } - if (message.title !== '') { - writer.uint32(42).string(message.title) + if (message.title !== "") { + writer.uint32(42).string(message.title); } - if (message.summary !== '') { - writer.uint32(50).string(message.summary) + if (message.summary !== "") { + writer.uint32(50).string(message.summary); } if (message.expedited === true) { - writer.uint32(56).bool(message.expedited) - } - return writer - }, - decode( - input: BinaryReader | Uint8Array, - length?: number, - useInterfaces: boolean = false - ): MsgSubmitProposal { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input) - let end = length === undefined ? reader.len : reader.pos + length - const message = createBaseMsgSubmitProposal() + writer.uint32(56).bool(message.expedited); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSubmitProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitProposal(); while (reader.pos < end) { - const tag = reader.uint32() + const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.messages.push( - Any.decode(reader, reader.uint32(), useInterfaces) - ) - break + message.messages.push(Any.decode(reader, reader.uint32(), useInterfaces)); + break; case 2: - message.initialDeposit.push( - Coin.decode(reader, reader.uint32(), useInterfaces) - ) - break + message.initialDeposit.push(Coin.decode(reader, reader.uint32(), useInterfaces)); + break; case 3: - message.proposer = reader.string() - break + message.proposer = reader.string(); + break; case 4: - message.metadata = reader.string() - break + message.metadata = reader.string(); + break; case 5: - message.title = reader.string() - break + message.title = reader.string(); + break; case 6: - message.summary = reader.string() - break + message.summary = reader.string(); + break; case 7: - message.expedited = reader.bool() - break + message.expedited = reader.bool(); + break; default: - reader.skipType(tag & 7) - break + reader.skipType(tag & 7); + break; } } - return message + return message; }, fromPartial(object: Partial): MsgSubmitProposal { - const message = createBaseMsgSubmitProposal() - message.messages = object.messages?.map((e) => Any.fromPartial(e)) || [] - message.initialDeposit = - object.initialDeposit?.map((e) => Coin.fromPartial(e)) || [] - message.proposer = object.proposer ?? '' - message.metadata = object.metadata ?? '' - message.title = object.title ?? '' - message.summary = object.summary ?? '' - message.expedited = object.expedited ?? false - return message + const message = createBaseMsgSubmitProposal(); + message.messages = object.messages?.map(e => Any.fromPartial(e)) || []; + message.initialDeposit = object.initialDeposit?.map(e => Coin.fromPartial(e)) || []; + message.proposer = object.proposer ?? ""; + message.metadata = object.metadata ?? ""; + message.title = object.title ?? ""; + message.summary = object.summary ?? ""; + message.expedited = object.expedited ?? false; + return message; }, fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { - const message = createBaseMsgSubmitProposal() - message.messages = - object.messages?.map((e) => aminoToRawProtobufMsg(e)) || [] - message.initialDeposit = - object.initial_deposit?.map((e) => Coin.fromAmino(e)) || [] + const message = createBaseMsgSubmitProposal(); + message.messages = object.messages?.map(e => aminoToRawProtobufMsg(e)) || []; + message.initialDeposit = object.initial_deposit?.map(e => Coin.fromAmino(e)) || []; if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = object.proposer + message.proposer = object.proposer; } if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata + message.metadata = object.metadata; } if (object.title !== undefined && object.title !== null) { - message.title = object.title + message.title = object.title; } if (object.summary !== undefined && object.summary !== null) { - message.summary = object.summary + message.summary = object.summary; } if (object.expedited !== undefined && object.expedited !== null) { - message.expedited = object.expedited + message.expedited = object.expedited; } - return message + return message; }, - toAmino( - message: MsgSubmitProposal, - useInterfaces: boolean = false - ): MsgSubmitProposalAmino { - const obj: any = {} + toAmino(message: MsgSubmitProposal, useInterfaces: boolean = false): MsgSubmitProposalAmino { + const obj: any = {}; if (message.messages.length) { - obj.messages = message.messages.map((e) => - e ? rawProtobufMsgToAmino(e, false) : undefined - ) + obj.messages = message.messages.map(e => e ? rawProtobufMsgToAmino(e, false) : undefined); + } else { + obj.messages = []; } if (message.initialDeposit) { - obj.initial_deposit = message.initialDeposit.map((e) => - e ? Coin.toAmino(e, useInterfaces) : undefined - ) + obj.initial_deposit = message.initialDeposit.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); } else { - obj.initial_deposit = [] + obj.initial_deposit = []; } - obj.proposer = message.proposer - obj.metadata = message.metadata - obj.title = message.title - obj.summary = message.summary + obj.proposer = message.proposer; + obj.metadata = message.metadata; + obj.title = message.title; + obj.summary = message.summary; if (message.expedited) { - obj.expedited = message.expedited + obj.expedited = message.expedited; } - return obj + return obj; }, fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { - return MsgSubmitProposal.fromAmino(object.value) + return MsgSubmitProposal.fromAmino(object.value); }, - toAminoMsg( - message: MsgSubmitProposal, - useInterfaces: boolean = false - ): MsgSubmitProposalAminoMsg { + toAminoMsg(message: MsgSubmitProposal, useInterfaces: boolean = false): MsgSubmitProposalAminoMsg { return { - type: 'cosmos-sdk/v1/MsgSubmitProposal', - value: MsgSubmitProposal.toAmino(message, useInterfaces), - } + type: "cosmos-sdk/v1/MsgSubmitProposal", + value: MsgSubmitProposal.toAmino(message, useInterfaces) + }; }, - fromProtoMsg( - message: MsgSubmitProposalProtoMsg, - useInterfaces: boolean = false - ): MsgSubmitProposal { - return MsgSubmitProposal.decode(message.value, undefined, useInterfaces) + fromProtoMsg(message: MsgSubmitProposalProtoMsg, useInterfaces: boolean = false): MsgSubmitProposal { + return MsgSubmitProposal.decode(message.value, undefined, useInterfaces); }, toProto(message: MsgSubmitProposal): Uint8Array { - return MsgSubmitProposal.encode(message).finish() + return MsgSubmitProposal.encode(message).finish(); }, toProtoMsg(message: MsgSubmitProposal): MsgSubmitProposalProtoMsg { return { - typeUrl: '/cosmos.gov.v1.MsgSubmitProposal', - value: MsgSubmitProposal.encode(message).finish(), - } - }, -} + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", + value: MsgSubmitProposal.encode(message).finish() + }; + } +}; function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { return { - proposalId: BigInt(0), - } + proposalId: BigInt(0) + }; } export const MsgSubmitProposalResponse = { - typeUrl: '/cosmos.gov.v1.MsgSubmitProposalResponse', - encode( - message: MsgSubmitProposalResponse, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposalResponse", + encode(message: MsgSubmitProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { - writer.uint32(8).uint64(message.proposalId) - } - return writer - }, - decode( - input: BinaryReader | Uint8Array, - length?: number, - useInterfaces: boolean = false - ): MsgSubmitProposalResponse { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input) - let end = length === undefined ? reader.len : reader.pos + length - const message = createBaseMsgSubmitProposalResponse() + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSubmitProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitProposalResponse(); while (reader.pos < end) { - const tag = reader.uint32() + const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() - break + message.proposalId = reader.uint64(); + break; default: - reader.skipType(tag & 7) - break + reader.skipType(tag & 7); + break; } } - return message + return message; }, - fromPartial( - object: Partial - ): MsgSubmitProposalResponse { - const message = createBaseMsgSubmitProposalResponse() - message.proposalId = - object.proposalId !== undefined && object.proposalId !== null - ? BigInt(object.proposalId.toString()) - : BigInt(0) - return message + fromPartial(object: Partial): MsgSubmitProposalResponse { + const message = createBaseMsgSubmitProposalResponse(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; }, fromAmino(object: MsgSubmitProposalResponseAmino): MsgSubmitProposalResponse { - const message = createBaseMsgSubmitProposalResponse() + const message = createBaseMsgSubmitProposalResponse(); if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id) - } - return message - }, - toAmino( - message: MsgSubmitProposalResponse, - useInterfaces: boolean = false - ): MsgSubmitProposalResponseAmino { - const obj: any = {} - obj.proposal_id = message.proposalId - ? message.proposalId.toString() - : undefined - return obj - }, - fromAminoMsg( - object: MsgSubmitProposalResponseAminoMsg - ): MsgSubmitProposalResponse { - return MsgSubmitProposalResponse.fromAmino(object.value) - }, - toAminoMsg( - message: MsgSubmitProposalResponse, - useInterfaces: boolean = false - ): MsgSubmitProposalResponseAminoMsg { - return { - type: 'cosmos-sdk/v1/MsgSubmitProposalResponse', - value: MsgSubmitProposalResponse.toAmino(message, useInterfaces), + message.proposalId = BigInt(object.proposal_id); } + return message; }, - fromProtoMsg( - message: MsgSubmitProposalResponseProtoMsg, - useInterfaces: boolean = false - ): MsgSubmitProposalResponse { - return MsgSubmitProposalResponse.decode( - message.value, - undefined, - useInterfaces - ) + toAmino(message: MsgSubmitProposalResponse, useInterfaces: boolean = false): MsgSubmitProposalResponseAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + return obj; }, - toProto(message: MsgSubmitProposalResponse): Uint8Array { - return MsgSubmitProposalResponse.encode(message).finish() + fromAminoMsg(object: MsgSubmitProposalResponseAminoMsg): MsgSubmitProposalResponse { + return MsgSubmitProposalResponse.fromAmino(object.value); }, - toProtoMsg( - message: MsgSubmitProposalResponse - ): MsgSubmitProposalResponseProtoMsg { + toAminoMsg(message: MsgSubmitProposalResponse, useInterfaces: boolean = false): MsgSubmitProposalResponseAminoMsg { return { - typeUrl: '/cosmos.gov.v1.MsgSubmitProposalResponse', - value: MsgSubmitProposalResponse.encode(message).finish(), - } + type: "cosmos-sdk/v1/MsgSubmitProposalResponse", + value: MsgSubmitProposalResponse.toAmino(message, useInterfaces) + }; }, -} + fromProtoMsg(message: MsgSubmitProposalResponseProtoMsg, useInterfaces: boolean = false): MsgSubmitProposalResponse { + return MsgSubmitProposalResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSubmitProposalResponse): Uint8Array { + return MsgSubmitProposalResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposalResponse", + value: MsgSubmitProposalResponse.encode(message).finish() + }; + } +}; function createBaseMsgExecLegacyContent(): MsgExecLegacyContent { return { content: undefined, - authority: '', - } + authority: "" + }; } export const MsgExecLegacyContent = { - typeUrl: '/cosmos.gov.v1.MsgExecLegacyContent', - encode( - message: MsgExecLegacyContent, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", + encode(message: MsgExecLegacyContent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.content !== undefined) { - Any.encode(message.content as Any, writer.uint32(10).fork()).ldelim() - } - if (message.authority !== '') { - writer.uint32(18).string(message.authority) - } - return writer - }, - decode( - input: BinaryReader | Uint8Array, - length?: number, - useInterfaces: boolean = false - ): MsgExecLegacyContent { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input) - let end = length === undefined ? reader.len : reader.pos + length - const message = createBaseMsgExecLegacyContent() + Any.encode((message.content as Any), writer.uint32(10).fork()).ldelim(); + } + if (message.authority !== "") { + writer.uint32(18).string(message.authority); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgExecLegacyContent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecLegacyContent(); while (reader.pos < end) { - const tag = reader.uint32() + const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.content = useInterfaces - ? (Cosmos_govv1beta1Content_InterfaceDecoder(reader) as Any) - : Any.decode(reader, reader.uint32(), useInterfaces) - break + message.content = useInterfaces ? (Cosmos_govv1beta1Content_InterfaceDecoder(reader) as Any) : Any.decode(reader, reader.uint32(), useInterfaces); + break; case 2: - message.authority = reader.string() - break + message.authority = reader.string(); + break; default: - reader.skipType(tag & 7) - break + reader.skipType(tag & 7); + break; } } - return message + return message; }, fromPartial(object: Partial): MsgExecLegacyContent { - const message = createBaseMsgExecLegacyContent() - message.content = - object.content !== undefined && object.content !== null - ? Any.fromPartial(object.content) - : undefined - message.authority = object.authority ?? '' - return message + const message = createBaseMsgExecLegacyContent(); + message.content = object.content !== undefined && object.content !== null ? Any.fromPartial(object.content) : undefined; + message.authority = object.authority ?? ""; + return message; }, fromAmino(object: MsgExecLegacyContentAmino): MsgExecLegacyContent { - const message = createBaseMsgExecLegacyContent() + const message = createBaseMsgExecLegacyContent(); if (object.content !== undefined && object.content !== null) { - message.content = Cosmos_govv1beta1Content_FromAmino(object.content) + message.content = Cosmos_govv1beta1Content_FromAmino(object.content); } if (object.authority !== undefined && object.authority !== null) { - message.authority = object.authority + message.authority = object.authority; } - return message + return message; }, - toAmino( - message: MsgExecLegacyContent, - useInterfaces: boolean = false - ): MsgExecLegacyContentAmino { - const obj: any = {} - obj.content = message.content - ? Cosmos_govv1beta1Content_ToAmino(message.content as Any, useInterfaces) - : undefined - obj.authority = message.authority - return obj + toAmino(message: MsgExecLegacyContent, useInterfaces: boolean = false): MsgExecLegacyContentAmino { + const obj: any = {}; + obj.content = message.content ? Cosmos_govv1beta1Content_ToAmino((message.content as Any), useInterfaces) : undefined; + obj.authority = message.authority; + return obj; }, fromAminoMsg(object: MsgExecLegacyContentAminoMsg): MsgExecLegacyContent { - return MsgExecLegacyContent.fromAmino(object.value) + return MsgExecLegacyContent.fromAmino(object.value); }, - toAminoMsg( - message: MsgExecLegacyContent, - useInterfaces: boolean = false - ): MsgExecLegacyContentAminoMsg { + toAminoMsg(message: MsgExecLegacyContent, useInterfaces: boolean = false): MsgExecLegacyContentAminoMsg { return { - type: 'cosmos-sdk/v1/MsgExecLegacyContent', - value: MsgExecLegacyContent.toAmino(message, useInterfaces), - } + type: "cosmos-sdk/v1/MsgExecLegacyContent", + value: MsgExecLegacyContent.toAmino(message, useInterfaces) + }; }, - fromProtoMsg( - message: MsgExecLegacyContentProtoMsg, - useInterfaces: boolean = false - ): MsgExecLegacyContent { - return MsgExecLegacyContent.decode(message.value, undefined, useInterfaces) + fromProtoMsg(message: MsgExecLegacyContentProtoMsg, useInterfaces: boolean = false): MsgExecLegacyContent { + return MsgExecLegacyContent.decode(message.value, undefined, useInterfaces); }, toProto(message: MsgExecLegacyContent): Uint8Array { - return MsgExecLegacyContent.encode(message).finish() + return MsgExecLegacyContent.encode(message).finish(); }, toProtoMsg(message: MsgExecLegacyContent): MsgExecLegacyContentProtoMsg { return { - typeUrl: '/cosmos.gov.v1.MsgExecLegacyContent', - value: MsgExecLegacyContent.encode(message).finish(), - } - }, -} + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", + value: MsgExecLegacyContent.encode(message).finish() + }; + } +}; function createBaseMsgExecLegacyContentResponse(): MsgExecLegacyContentResponse { - return {} + return {}; } export const MsgExecLegacyContentResponse = { - typeUrl: '/cosmos.gov.v1.MsgExecLegacyContentResponse', - encode( - _: MsgExecLegacyContentResponse, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { - return writer - }, - decode( - input: BinaryReader | Uint8Array, - length?: number, - useInterfaces: boolean = false - ): MsgExecLegacyContentResponse { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input) - let end = length === undefined ? reader.len : reader.pos + length - const message = createBaseMsgExecLegacyContentResponse() + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContentResponse", + encode(_: MsgExecLegacyContentResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgExecLegacyContentResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecLegacyContentResponse(); while (reader.pos < end) { - const tag = reader.uint32() + const tag = reader.uint32(); switch (tag >>> 3) { default: - reader.skipType(tag & 7) - break + reader.skipType(tag & 7); + break; } } - return message - }, - fromPartial( - _: Partial - ): MsgExecLegacyContentResponse { - const message = createBaseMsgExecLegacyContentResponse() - return message - }, - fromAmino( - _: MsgExecLegacyContentResponseAmino - ): MsgExecLegacyContentResponse { - const message = createBaseMsgExecLegacyContentResponse() - return message - }, - toAmino( - _: MsgExecLegacyContentResponse, - useInterfaces: boolean = false - ): MsgExecLegacyContentResponseAmino { - const obj: any = {} - return obj - }, - fromAminoMsg( - object: MsgExecLegacyContentResponseAminoMsg - ): MsgExecLegacyContentResponse { - return MsgExecLegacyContentResponse.fromAmino(object.value) - }, - toAminoMsg( - message: MsgExecLegacyContentResponse, - useInterfaces: boolean = false - ): MsgExecLegacyContentResponseAminoMsg { + return message; + }, + fromPartial(_: Partial): MsgExecLegacyContentResponse { + const message = createBaseMsgExecLegacyContentResponse(); + return message; + }, + fromAmino(_: MsgExecLegacyContentResponseAmino): MsgExecLegacyContentResponse { + const message = createBaseMsgExecLegacyContentResponse(); + return message; + }, + toAmino(_: MsgExecLegacyContentResponse, useInterfaces: boolean = false): MsgExecLegacyContentResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgExecLegacyContentResponseAminoMsg): MsgExecLegacyContentResponse { + return MsgExecLegacyContentResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgExecLegacyContentResponse, useInterfaces: boolean = false): MsgExecLegacyContentResponseAminoMsg { return { - type: 'cosmos-sdk/v1/MsgExecLegacyContentResponse', - value: MsgExecLegacyContentResponse.toAmino(message, useInterfaces), - } + type: "cosmos-sdk/v1/MsgExecLegacyContentResponse", + value: MsgExecLegacyContentResponse.toAmino(message, useInterfaces) + }; }, - fromProtoMsg( - message: MsgExecLegacyContentResponseProtoMsg, - useInterfaces: boolean = false - ): MsgExecLegacyContentResponse { - return MsgExecLegacyContentResponse.decode( - message.value, - undefined, - useInterfaces - ) + fromProtoMsg(message: MsgExecLegacyContentResponseProtoMsg, useInterfaces: boolean = false): MsgExecLegacyContentResponse { + return MsgExecLegacyContentResponse.decode(message.value, undefined, useInterfaces); }, toProto(message: MsgExecLegacyContentResponse): Uint8Array { - return MsgExecLegacyContentResponse.encode(message).finish() + return MsgExecLegacyContentResponse.encode(message).finish(); }, - toProtoMsg( - message: MsgExecLegacyContentResponse - ): MsgExecLegacyContentResponseProtoMsg { + toProtoMsg(message: MsgExecLegacyContentResponse): MsgExecLegacyContentResponseProtoMsg { return { - typeUrl: '/cosmos.gov.v1.MsgExecLegacyContentResponse', - value: MsgExecLegacyContentResponse.encode(message).finish(), - } - }, -} + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContentResponse", + value: MsgExecLegacyContentResponse.encode(message).finish() + }; + } +}; function createBaseMsgVote(): MsgVote { return { proposalId: BigInt(0), - voter: '', + voter: "", option: 0, - metadata: '', - } + metadata: "" + }; } export const MsgVote = { - typeUrl: '/cosmos.gov.v1.MsgVote', - encode( - message: MsgVote, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { + typeUrl: "/cosmos.gov.v1.MsgVote", + encode(message: MsgVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { - writer.uint32(8).uint64(message.proposalId) + writer.uint32(8).uint64(message.proposalId); } - if (message.voter !== '') { - writer.uint32(18).string(message.voter) + if (message.voter !== "") { + writer.uint32(18).string(message.voter); } if (message.option !== 0) { - writer.uint32(24).int32(message.option) - } - if (message.metadata !== '') { - writer.uint32(34).string(message.metadata) - } - return writer - }, - decode( - input: BinaryReader | Uint8Array, - length?: number, - useInterfaces: boolean = false - ): MsgVote { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input) - let end = length === undefined ? reader.len : reader.pos + length - const message = createBaseMsgVote() + writer.uint32(24).int32(message.option); + } + if (message.metadata !== "") { + writer.uint32(34).string(message.metadata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVote(); while (reader.pos < end) { - const tag = reader.uint32() + const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() - break + message.proposalId = reader.uint64(); + break; case 2: - message.voter = reader.string() - break + message.voter = reader.string(); + break; case 3: - message.option = reader.int32() as any - break + message.option = (reader.int32() as any); + break; case 4: - message.metadata = reader.string() - break + message.metadata = reader.string(); + break; default: - reader.skipType(tag & 7) - break + reader.skipType(tag & 7); + break; } } - return message + return message; }, fromPartial(object: Partial): MsgVote { - const message = createBaseMsgVote() - message.proposalId = - object.proposalId !== undefined && object.proposalId !== null - ? BigInt(object.proposalId.toString()) - : BigInt(0) - message.voter = object.voter ?? '' - message.option = object.option ?? 0 - message.metadata = object.metadata ?? '' - return message + const message = createBaseMsgVote(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.voter = object.voter ?? ""; + message.option = object.option ?? 0; + message.metadata = object.metadata ?? ""; + return message; }, fromAmino(object: MsgVoteAmino): MsgVote { - const message = createBaseMsgVote() + const message = createBaseMsgVote(); if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id) + message.proposalId = BigInt(object.proposal_id); } if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter + message.voter = object.voter; } if (object.option !== undefined && object.option !== null) { - message.option = object.option + message.option = object.option; } if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata + message.metadata = object.metadata; } - return message + return message; }, toAmino(message: MsgVote, useInterfaces: boolean = false): MsgVoteAmino { - const obj: any = {} - obj.proposal_id = message.proposalId ? message.proposalId.toString() : '0' - obj.voter = message.voter - obj.option = message.option - obj.metadata = message.metadata - return obj + const obj: any = {}; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + obj.voter = message.voter; + obj.option = message.option; + obj.metadata = message.metadata; + return obj; }, fromAminoMsg(object: MsgVoteAminoMsg): MsgVote { - return MsgVote.fromAmino(object.value) + return MsgVote.fromAmino(object.value); }, - toAminoMsg( - message: MsgVote, - useInterfaces: boolean = false - ): MsgVoteAminoMsg { + toAminoMsg(message: MsgVote, useInterfaces: boolean = false): MsgVoteAminoMsg { return { - type: 'cosmos-sdk/v1/MsgVote', - value: MsgVote.toAmino(message, useInterfaces), - } + type: "cosmos-sdk/v1/MsgVote", + value: MsgVote.toAmino(message, useInterfaces) + }; }, - fromProtoMsg( - message: MsgVoteProtoMsg, - useInterfaces: boolean = false - ): MsgVote { - return MsgVote.decode(message.value, undefined, useInterfaces) + fromProtoMsg(message: MsgVoteProtoMsg, useInterfaces: boolean = false): MsgVote { + return MsgVote.decode(message.value, undefined, useInterfaces); }, toProto(message: MsgVote): Uint8Array { - return MsgVote.encode(message).finish() + return MsgVote.encode(message).finish(); }, toProtoMsg(message: MsgVote): MsgVoteProtoMsg { return { - typeUrl: '/cosmos.gov.v1.MsgVote', - value: MsgVote.encode(message).finish(), - } - }, -} + typeUrl: "/cosmos.gov.v1.MsgVote", + value: MsgVote.encode(message).finish() + }; + } +}; function createBaseMsgVoteResponse(): MsgVoteResponse { - return {} + return {}; } export const MsgVoteResponse = { - typeUrl: '/cosmos.gov.v1.MsgVoteResponse', - encode( - _: MsgVoteResponse, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { - return writer - }, - decode( - input: BinaryReader | Uint8Array, - length?: number, - useInterfaces: boolean = false - ): MsgVoteResponse { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input) - let end = length === undefined ? reader.len : reader.pos + length - const message = createBaseMsgVoteResponse() + typeUrl: "/cosmos.gov.v1.MsgVoteResponse", + encode(_: MsgVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgVoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVoteResponse(); while (reader.pos < end) { - const tag = reader.uint32() + const tag = reader.uint32(); switch (tag >>> 3) { default: - reader.skipType(tag & 7) - break + reader.skipType(tag & 7); + break; } } - return message + return message; }, fromPartial(_: Partial): MsgVoteResponse { - const message = createBaseMsgVoteResponse() - return message + const message = createBaseMsgVoteResponse(); + return message; }, fromAmino(_: MsgVoteResponseAmino): MsgVoteResponse { - const message = createBaseMsgVoteResponse() - return message + const message = createBaseMsgVoteResponse(); + return message; }, - toAmino( - _: MsgVoteResponse, - useInterfaces: boolean = false - ): MsgVoteResponseAmino { - const obj: any = {} - return obj + toAmino(_: MsgVoteResponse, useInterfaces: boolean = false): MsgVoteResponseAmino { + const obj: any = {}; + return obj; }, fromAminoMsg(object: MsgVoteResponseAminoMsg): MsgVoteResponse { - return MsgVoteResponse.fromAmino(object.value) + return MsgVoteResponse.fromAmino(object.value); }, - toAminoMsg( - message: MsgVoteResponse, - useInterfaces: boolean = false - ): MsgVoteResponseAminoMsg { + toAminoMsg(message: MsgVoteResponse, useInterfaces: boolean = false): MsgVoteResponseAminoMsg { return { - type: 'cosmos-sdk/v1/MsgVoteResponse', - value: MsgVoteResponse.toAmino(message, useInterfaces), - } + type: "cosmos-sdk/v1/MsgVoteResponse", + value: MsgVoteResponse.toAmino(message, useInterfaces) + }; }, - fromProtoMsg( - message: MsgVoteResponseProtoMsg, - useInterfaces: boolean = false - ): MsgVoteResponse { - return MsgVoteResponse.decode(message.value, undefined, useInterfaces) + fromProtoMsg(message: MsgVoteResponseProtoMsg, useInterfaces: boolean = false): MsgVoteResponse { + return MsgVoteResponse.decode(message.value, undefined, useInterfaces); }, toProto(message: MsgVoteResponse): Uint8Array { - return MsgVoteResponse.encode(message).finish() + return MsgVoteResponse.encode(message).finish(); }, toProtoMsg(message: MsgVoteResponse): MsgVoteResponseProtoMsg { return { - typeUrl: '/cosmos.gov.v1.MsgVoteResponse', - value: MsgVoteResponse.encode(message).finish(), - } - }, -} + typeUrl: "/cosmos.gov.v1.MsgVoteResponse", + value: MsgVoteResponse.encode(message).finish() + }; + } +}; function createBaseMsgVoteWeighted(): MsgVoteWeighted { return { proposalId: BigInt(0), - voter: '', + voter: "", options: [], - metadata: '', - } + metadata: "" + }; } export const MsgVoteWeighted = { - typeUrl: '/cosmos.gov.v1.MsgVoteWeighted', - encode( - message: MsgVoteWeighted, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", + encode(message: MsgVoteWeighted, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { - writer.uint32(8).uint64(message.proposalId) + writer.uint32(8).uint64(message.proposalId); } - if (message.voter !== '') { - writer.uint32(18).string(message.voter) + if (message.voter !== "") { + writer.uint32(18).string(message.voter); } for (const v of message.options) { - WeightedVoteOption.encode(v!, writer.uint32(26).fork()).ldelim() - } - if (message.metadata !== '') { - writer.uint32(34).string(message.metadata) - } - return writer - }, - decode( - input: BinaryReader | Uint8Array, - length?: number, - useInterfaces: boolean = false - ): MsgVoteWeighted { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input) - let end = length === undefined ? reader.len : reader.pos + length - const message = createBaseMsgVoteWeighted() + WeightedVoteOption.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.metadata !== "") { + writer.uint32(34).string(message.metadata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgVoteWeighted { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVoteWeighted(); while (reader.pos < end) { - const tag = reader.uint32() + const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() - break + message.proposalId = reader.uint64(); + break; case 2: - message.voter = reader.string() - break + message.voter = reader.string(); + break; case 3: - message.options.push( - WeightedVoteOption.decode(reader, reader.uint32(), useInterfaces) - ) - break + message.options.push(WeightedVoteOption.decode(reader, reader.uint32(), useInterfaces)); + break; case 4: - message.metadata = reader.string() - break + message.metadata = reader.string(); + break; default: - reader.skipType(tag & 7) - break + reader.skipType(tag & 7); + break; } } - return message + return message; }, fromPartial(object: Partial): MsgVoteWeighted { - const message = createBaseMsgVoteWeighted() - message.proposalId = - object.proposalId !== undefined && object.proposalId !== null - ? BigInt(object.proposalId.toString()) - : BigInt(0) - message.voter = object.voter ?? '' - message.options = - object.options?.map((e) => WeightedVoteOption.fromPartial(e)) || [] - message.metadata = object.metadata ?? '' - return message + const message = createBaseMsgVoteWeighted(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.voter = object.voter ?? ""; + message.options = object.options?.map(e => WeightedVoteOption.fromPartial(e)) || []; + message.metadata = object.metadata ?? ""; + return message; }, fromAmino(object: MsgVoteWeightedAmino): MsgVoteWeighted { - const message = createBaseMsgVoteWeighted() + const message = createBaseMsgVoteWeighted(); if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id) + message.proposalId = BigInt(object.proposal_id); } if (object.voter !== undefined && object.voter !== null) { - message.voter = object.voter + message.voter = object.voter; } - message.options = - object.options?.map((e) => WeightedVoteOption.fromAmino(e)) || [] + message.options = object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; if (object.metadata !== undefined && object.metadata !== null) { - message.metadata = object.metadata + message.metadata = object.metadata; } - return message + return message; }, - toAmino( - message: MsgVoteWeighted, - useInterfaces: boolean = false - ): MsgVoteWeightedAmino { - const obj: any = {} - obj.proposal_id = message.proposalId ? message.proposalId.toString() : '0' - obj.voter = message.voter + toAmino(message: MsgVoteWeighted, useInterfaces: boolean = false): MsgVoteWeightedAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + obj.voter = message.voter; if (message.options) { - obj.options = message.options.map((e) => - e ? WeightedVoteOption.toAmino(e, useInterfaces) : undefined - ) + obj.options = message.options.map(e => e ? WeightedVoteOption.toAmino(e, useInterfaces) : undefined); } else { - obj.options = [] + obj.options = []; } - obj.metadata = message.metadata - return obj + obj.metadata = message.metadata; + return obj; }, fromAminoMsg(object: MsgVoteWeightedAminoMsg): MsgVoteWeighted { - return MsgVoteWeighted.fromAmino(object.value) + return MsgVoteWeighted.fromAmino(object.value); }, - toAminoMsg( - message: MsgVoteWeighted, - useInterfaces: boolean = false - ): MsgVoteWeightedAminoMsg { + toAminoMsg(message: MsgVoteWeighted, useInterfaces: boolean = false): MsgVoteWeightedAminoMsg { return { - type: 'cosmos-sdk/v1/MsgVoteWeighted', - value: MsgVoteWeighted.toAmino(message, useInterfaces), - } + type: "cosmos-sdk/v1/MsgVoteWeighted", + value: MsgVoteWeighted.toAmino(message, useInterfaces) + }; }, - fromProtoMsg( - message: MsgVoteWeightedProtoMsg, - useInterfaces: boolean = false - ): MsgVoteWeighted { - return MsgVoteWeighted.decode(message.value, undefined, useInterfaces) + fromProtoMsg(message: MsgVoteWeightedProtoMsg, useInterfaces: boolean = false): MsgVoteWeighted { + return MsgVoteWeighted.decode(message.value, undefined, useInterfaces); }, toProto(message: MsgVoteWeighted): Uint8Array { - return MsgVoteWeighted.encode(message).finish() + return MsgVoteWeighted.encode(message).finish(); }, toProtoMsg(message: MsgVoteWeighted): MsgVoteWeightedProtoMsg { return { - typeUrl: '/cosmos.gov.v1.MsgVoteWeighted', - value: MsgVoteWeighted.encode(message).finish(), - } - }, -} + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", + value: MsgVoteWeighted.encode(message).finish() + }; + } +}; function createBaseMsgVoteWeightedResponse(): MsgVoteWeightedResponse { - return {} + return {}; } export const MsgVoteWeightedResponse = { - typeUrl: '/cosmos.gov.v1.MsgVoteWeightedResponse', - encode( - _: MsgVoteWeightedResponse, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { - return writer - }, - decode( - input: BinaryReader | Uint8Array, - length?: number, - useInterfaces: boolean = false - ): MsgVoteWeightedResponse { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input) - let end = length === undefined ? reader.len : reader.pos + length - const message = createBaseMsgVoteWeightedResponse() + typeUrl: "/cosmos.gov.v1.MsgVoteWeightedResponse", + encode(_: MsgVoteWeightedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgVoteWeightedResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVoteWeightedResponse(); while (reader.pos < end) { - const tag = reader.uint32() + const tag = reader.uint32(); switch (tag >>> 3) { default: - reader.skipType(tag & 7) - break + reader.skipType(tag & 7); + break; } } - return message + return message; }, fromPartial(_: Partial): MsgVoteWeightedResponse { - const message = createBaseMsgVoteWeightedResponse() - return message + const message = createBaseMsgVoteWeightedResponse(); + return message; }, fromAmino(_: MsgVoteWeightedResponseAmino): MsgVoteWeightedResponse { - const message = createBaseMsgVoteWeightedResponse() - return message - }, - toAmino( - _: MsgVoteWeightedResponse, - useInterfaces: boolean = false - ): MsgVoteWeightedResponseAmino { - const obj: any = {} - return obj - }, - fromAminoMsg( - object: MsgVoteWeightedResponseAminoMsg - ): MsgVoteWeightedResponse { - return MsgVoteWeightedResponse.fromAmino(object.value) - }, - toAminoMsg( - message: MsgVoteWeightedResponse, - useInterfaces: boolean = false - ): MsgVoteWeightedResponseAminoMsg { + const message = createBaseMsgVoteWeightedResponse(); + return message; + }, + toAmino(_: MsgVoteWeightedResponse, useInterfaces: boolean = false): MsgVoteWeightedResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgVoteWeightedResponseAminoMsg): MsgVoteWeightedResponse { + return MsgVoteWeightedResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgVoteWeightedResponse, useInterfaces: boolean = false): MsgVoteWeightedResponseAminoMsg { return { - type: 'cosmos-sdk/v1/MsgVoteWeightedResponse', - value: MsgVoteWeightedResponse.toAmino(message, useInterfaces), - } + type: "cosmos-sdk/v1/MsgVoteWeightedResponse", + value: MsgVoteWeightedResponse.toAmino(message, useInterfaces) + }; }, - fromProtoMsg( - message: MsgVoteWeightedResponseProtoMsg, - useInterfaces: boolean = false - ): MsgVoteWeightedResponse { - return MsgVoteWeightedResponse.decode( - message.value, - undefined, - useInterfaces - ) + fromProtoMsg(message: MsgVoteWeightedResponseProtoMsg, useInterfaces: boolean = false): MsgVoteWeightedResponse { + return MsgVoteWeightedResponse.decode(message.value, undefined, useInterfaces); }, toProto(message: MsgVoteWeightedResponse): Uint8Array { - return MsgVoteWeightedResponse.encode(message).finish() + return MsgVoteWeightedResponse.encode(message).finish(); }, - toProtoMsg( - message: MsgVoteWeightedResponse - ): MsgVoteWeightedResponseProtoMsg { + toProtoMsg(message: MsgVoteWeightedResponse): MsgVoteWeightedResponseProtoMsg { return { - typeUrl: '/cosmos.gov.v1.MsgVoteWeightedResponse', - value: MsgVoteWeightedResponse.encode(message).finish(), - } - }, -} + typeUrl: "/cosmos.gov.v1.MsgVoteWeightedResponse", + value: MsgVoteWeightedResponse.encode(message).finish() + }; + } +}; function createBaseMsgDeposit(): MsgDeposit { return { proposalId: BigInt(0), - depositor: '', - amount: [], - } + depositor: "", + amount: [] + }; } export const MsgDeposit = { - typeUrl: '/cosmos.gov.v1.MsgDeposit', - encode( - message: MsgDeposit, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { + typeUrl: "/cosmos.gov.v1.MsgDeposit", + encode(message: MsgDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { - writer.uint32(8).uint64(message.proposalId) + writer.uint32(8).uint64(message.proposalId); } - if (message.depositor !== '') { - writer.uint32(18).string(message.depositor) + if (message.depositor !== "") { + writer.uint32(18).string(message.depositor); } for (const v of message.amount) { - Coin.encode(v!, writer.uint32(26).fork()).ldelim() - } - return writer - }, - decode( - input: BinaryReader | Uint8Array, - length?: number, - useInterfaces: boolean = false - ): MsgDeposit { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input) - let end = length === undefined ? reader.len : reader.pos + length - const message = createBaseMsgDeposit() + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgDeposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeposit(); while (reader.pos < end) { - const tag = reader.uint32() + const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() - break + message.proposalId = reader.uint64(); + break; case 2: - message.depositor = reader.string() - break + message.depositor = reader.string(); + break; case 3: - message.amount.push( - Coin.decode(reader, reader.uint32(), useInterfaces) - ) - break + message.amount.push(Coin.decode(reader, reader.uint32(), useInterfaces)); + break; default: - reader.skipType(tag & 7) - break + reader.skipType(tag & 7); + break; } } - return message + return message; }, fromPartial(object: Partial): MsgDeposit { - const message = createBaseMsgDeposit() - message.proposalId = - object.proposalId !== undefined && object.proposalId !== null - ? BigInt(object.proposalId.toString()) - : BigInt(0) - message.depositor = object.depositor ?? '' - message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [] - return message + const message = createBaseMsgDeposit(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.depositor = object.depositor ?? ""; + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; }, fromAmino(object: MsgDepositAmino): MsgDeposit { - const message = createBaseMsgDeposit() + const message = createBaseMsgDeposit(); if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id) + message.proposalId = BigInt(object.proposal_id); } if (object.depositor !== undefined && object.depositor !== null) { - message.depositor = object.depositor - } - message.amount = object.amount?.map((e) => Coin.fromAmino(e)) || [] - return message - }, - toAmino( - message: MsgDeposit, - useInterfaces: boolean = false - ): MsgDepositAmino { - const obj: any = {} - obj.proposal_id = message.proposalId ? message.proposalId.toString() : '0' - obj.depositor = message.depositor + message.depositor = object.depositor; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgDeposit, useInterfaces: boolean = false): MsgDepositAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + obj.depositor = message.depositor; if (message.amount) { - obj.amount = message.amount.map((e) => - e ? Coin.toAmino(e, useInterfaces) : undefined - ) + obj.amount = message.amount.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); } else { - obj.amount = [] + obj.amount = []; } - return obj + return obj; }, fromAminoMsg(object: MsgDepositAminoMsg): MsgDeposit { - return MsgDeposit.fromAmino(object.value) + return MsgDeposit.fromAmino(object.value); }, - toAminoMsg( - message: MsgDeposit, - useInterfaces: boolean = false - ): MsgDepositAminoMsg { + toAminoMsg(message: MsgDeposit, useInterfaces: boolean = false): MsgDepositAminoMsg { return { - type: 'cosmos-sdk/v1/MsgDeposit', - value: MsgDeposit.toAmino(message, useInterfaces), - } + type: "cosmos-sdk/v1/MsgDeposit", + value: MsgDeposit.toAmino(message, useInterfaces) + }; }, - fromProtoMsg( - message: MsgDepositProtoMsg, - useInterfaces: boolean = false - ): MsgDeposit { - return MsgDeposit.decode(message.value, undefined, useInterfaces) + fromProtoMsg(message: MsgDepositProtoMsg, useInterfaces: boolean = false): MsgDeposit { + return MsgDeposit.decode(message.value, undefined, useInterfaces); }, toProto(message: MsgDeposit): Uint8Array { - return MsgDeposit.encode(message).finish() + return MsgDeposit.encode(message).finish(); }, toProtoMsg(message: MsgDeposit): MsgDepositProtoMsg { return { - typeUrl: '/cosmos.gov.v1.MsgDeposit', - value: MsgDeposit.encode(message).finish(), - } - }, -} + typeUrl: "/cosmos.gov.v1.MsgDeposit", + value: MsgDeposit.encode(message).finish() + }; + } +}; function createBaseMsgDepositResponse(): MsgDepositResponse { - return {} + return {}; } export const MsgDepositResponse = { - typeUrl: '/cosmos.gov.v1.MsgDepositResponse', - encode( - _: MsgDepositResponse, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { - return writer - }, - decode( - input: BinaryReader | Uint8Array, - length?: number, - useInterfaces: boolean = false - ): MsgDepositResponse { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input) - let end = length === undefined ? reader.len : reader.pos + length - const message = createBaseMsgDepositResponse() + typeUrl: "/cosmos.gov.v1.MsgDepositResponse", + encode(_: MsgDepositResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgDepositResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositResponse(); while (reader.pos < end) { - const tag = reader.uint32() + const tag = reader.uint32(); switch (tag >>> 3) { default: - reader.skipType(tag & 7) - break + reader.skipType(tag & 7); + break; } } - return message + return message; }, fromPartial(_: Partial): MsgDepositResponse { - const message = createBaseMsgDepositResponse() - return message + const message = createBaseMsgDepositResponse(); + return message; }, fromAmino(_: MsgDepositResponseAmino): MsgDepositResponse { - const message = createBaseMsgDepositResponse() - return message + const message = createBaseMsgDepositResponse(); + return message; }, - toAmino( - _: MsgDepositResponse, - useInterfaces: boolean = false - ): MsgDepositResponseAmino { - const obj: any = {} - return obj + toAmino(_: MsgDepositResponse, useInterfaces: boolean = false): MsgDepositResponseAmino { + const obj: any = {}; + return obj; }, fromAminoMsg(object: MsgDepositResponseAminoMsg): MsgDepositResponse { - return MsgDepositResponse.fromAmino(object.value) + return MsgDepositResponse.fromAmino(object.value); }, - toAminoMsg( - message: MsgDepositResponse, - useInterfaces: boolean = false - ): MsgDepositResponseAminoMsg { + toAminoMsg(message: MsgDepositResponse, useInterfaces: boolean = false): MsgDepositResponseAminoMsg { return { - type: 'cosmos-sdk/v1/MsgDepositResponse', - value: MsgDepositResponse.toAmino(message, useInterfaces), - } + type: "cosmos-sdk/v1/MsgDepositResponse", + value: MsgDepositResponse.toAmino(message, useInterfaces) + }; }, - fromProtoMsg( - message: MsgDepositResponseProtoMsg, - useInterfaces: boolean = false - ): MsgDepositResponse { - return MsgDepositResponse.decode(message.value, undefined, useInterfaces) + fromProtoMsg(message: MsgDepositResponseProtoMsg, useInterfaces: boolean = false): MsgDepositResponse { + return MsgDepositResponse.decode(message.value, undefined, useInterfaces); }, toProto(message: MsgDepositResponse): Uint8Array { - return MsgDepositResponse.encode(message).finish() + return MsgDepositResponse.encode(message).finish(); }, toProtoMsg(message: MsgDepositResponse): MsgDepositResponseProtoMsg { return { - typeUrl: '/cosmos.gov.v1.MsgDepositResponse', - value: MsgDepositResponse.encode(message).finish(), - } - }, -} + typeUrl: "/cosmos.gov.v1.MsgDepositResponse", + value: MsgDepositResponse.encode(message).finish() + }; + } +}; function createBaseMsgUpdateParams(): MsgUpdateParams { return { - authority: '', - params: Params.fromPartial({}), - } + authority: "", + params: Params.fromPartial({}) + }; } export const MsgUpdateParams = { - typeUrl: '/cosmos.gov.v1.MsgUpdateParams', - encode( - message: MsgUpdateParams, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { - if (message.authority !== '') { - writer.uint32(10).string(message.authority) + typeUrl: "/cosmos.gov.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(18).fork()).ldelim() - } - return writer - }, - decode( - input: BinaryReader | Uint8Array, - length?: number, - useInterfaces: boolean = false - ): MsgUpdateParams { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input) - let end = length === undefined ? reader.len : reader.pos + length - const message = createBaseMsgUpdateParams() + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); while (reader.pos < end) { - const tag = reader.uint32() + const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.authority = reader.string() - break + message.authority = reader.string(); + break; case 2: - message.params = Params.decode(reader, reader.uint32(), useInterfaces) - break + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; default: - reader.skipType(tag & 7) - break + reader.skipType(tag & 7); + break; } } - return message + return message; }, fromPartial(object: Partial): MsgUpdateParams { - const message = createBaseMsgUpdateParams() - message.authority = object.authority ?? '' - message.params = - object.params !== undefined && object.params !== null - ? Params.fromPartial(object.params) - : undefined - return message + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; }, fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { - const message = createBaseMsgUpdateParams() + const message = createBaseMsgUpdateParams(); if (object.authority !== undefined && object.authority !== null) { - message.authority = object.authority + message.authority = object.authority; } if (object.params !== undefined && object.params !== null) { - message.params = Params.fromAmino(object.params) + message.params = Params.fromAmino(object.params); } - return message + return message; }, - toAmino( - message: MsgUpdateParams, - useInterfaces: boolean = false - ): MsgUpdateParamsAmino { - const obj: any = {} - obj.authority = message.authority - obj.params = message.params - ? Params.toAmino(message.params, useInterfaces) - : Params.fromPartial({}) - return obj + toAmino(message: MsgUpdateParams, useInterfaces: boolean = false): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : Params.fromPartial({}); + return obj; }, fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { - return MsgUpdateParams.fromAmino(object.value) + return MsgUpdateParams.fromAmino(object.value); }, - toAminoMsg( - message: MsgUpdateParams, - useInterfaces: boolean = false - ): MsgUpdateParamsAminoMsg { + toAminoMsg(message: MsgUpdateParams, useInterfaces: boolean = false): MsgUpdateParamsAminoMsg { return { - type: 'cosmos-sdk/x/gov/v1/MsgUpdateParams', - value: MsgUpdateParams.toAmino(message, useInterfaces), - } + type: "cosmos-sdk/x/gov/v1/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message, useInterfaces) + }; }, - fromProtoMsg( - message: MsgUpdateParamsProtoMsg, - useInterfaces: boolean = false - ): MsgUpdateParams { - return MsgUpdateParams.decode(message.value, undefined, useInterfaces) + fromProtoMsg(message: MsgUpdateParamsProtoMsg, useInterfaces: boolean = false): MsgUpdateParams { + return MsgUpdateParams.decode(message.value, undefined, useInterfaces); }, toProto(message: MsgUpdateParams): Uint8Array { - return MsgUpdateParams.encode(message).finish() + return MsgUpdateParams.encode(message).finish(); }, toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { return { - typeUrl: '/cosmos.gov.v1.MsgUpdateParams', - value: MsgUpdateParams.encode(message).finish(), - } - }, -} + typeUrl: "/cosmos.gov.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { - return {} + return {}; } export const MsgUpdateParamsResponse = { - typeUrl: '/cosmos.gov.v1.MsgUpdateParamsResponse', - encode( - _: MsgUpdateParamsResponse, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { - return writer - }, - decode( - input: BinaryReader | Uint8Array, - length?: number, - useInterfaces: boolean = false - ): MsgUpdateParamsResponse { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input) - let end = length === undefined ? reader.len : reader.pos + length - const message = createBaseMsgUpdateParamsResponse() + typeUrl: "/cosmos.gov.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); while (reader.pos < end) { - const tag = reader.uint32() + const tag = reader.uint32(); switch (tag >>> 3) { default: - reader.skipType(tag & 7) - break + reader.skipType(tag & 7); + break; } } - return message + return message; }, fromPartial(_: Partial): MsgUpdateParamsResponse { - const message = createBaseMsgUpdateParamsResponse() - return message + const message = createBaseMsgUpdateParamsResponse(); + return message; }, fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { - const message = createBaseMsgUpdateParamsResponse() - return message - }, - toAmino( - _: MsgUpdateParamsResponse, - useInterfaces: boolean = false - ): MsgUpdateParamsResponseAmino { - const obj: any = {} - return obj - }, - fromAminoMsg( - object: MsgUpdateParamsResponseAminoMsg - ): MsgUpdateParamsResponse { - return MsgUpdateParamsResponse.fromAmino(object.value) - }, - toAminoMsg( - message: MsgUpdateParamsResponse, - useInterfaces: boolean = false - ): MsgUpdateParamsResponseAminoMsg { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse, useInterfaces: boolean = false): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse, useInterfaces: boolean = false): MsgUpdateParamsResponseAminoMsg { return { - type: 'cosmos-sdk/v1/MsgUpdateParamsResponse', - value: MsgUpdateParamsResponse.toAmino(message, useInterfaces), - } + type: "cosmos-sdk/v1/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message, useInterfaces) + }; }, - fromProtoMsg( - message: MsgUpdateParamsResponseProtoMsg, - useInterfaces: boolean = false - ): MsgUpdateParamsResponse { - return MsgUpdateParamsResponse.decode( - message.value, - undefined, - useInterfaces - ) + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg, useInterfaces: boolean = false): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value, undefined, useInterfaces); }, toProto(message: MsgUpdateParamsResponse): Uint8Array { - return MsgUpdateParamsResponse.encode(message).finish() + return MsgUpdateParamsResponse.encode(message).finish(); }, - toProtoMsg( - message: MsgUpdateParamsResponse - ): MsgUpdateParamsResponseProtoMsg { + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { return { - typeUrl: '/cosmos.gov.v1.MsgUpdateParamsResponse', - value: MsgUpdateParamsResponse.encode(message).finish(), - } - }, -} + typeUrl: "/cosmos.gov.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; function createBaseMsgCancelProposal(): MsgCancelProposal { return { proposalId: BigInt(0), - proposer: '', - } + proposer: "" + }; } export const MsgCancelProposal = { - typeUrl: '/cosmos.gov.v1.MsgCancelProposal', - encode( - message: MsgCancelProposal, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { + typeUrl: "/cosmos.gov.v1.MsgCancelProposal", + encode(message: MsgCancelProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { - writer.uint32(8).uint64(message.proposalId) - } - if (message.proposer !== '') { - writer.uint32(18).string(message.proposer) - } - return writer - }, - decode( - input: BinaryReader | Uint8Array, - length?: number, - useInterfaces: boolean = false - ): MsgCancelProposal { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input) - let end = length === undefined ? reader.len : reader.pos + length - const message = createBaseMsgCancelProposal() + writer.uint32(8).uint64(message.proposalId); + } + if (message.proposer !== "") { + writer.uint32(18).string(message.proposer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgCancelProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelProposal(); while (reader.pos < end) { - const tag = reader.uint32() + const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() - break + message.proposalId = reader.uint64(); + break; case 2: - message.proposer = reader.string() - break + message.proposer = reader.string(); + break; default: - reader.skipType(tag & 7) - break + reader.skipType(tag & 7); + break; } } - return message + return message; }, fromPartial(object: Partial): MsgCancelProposal { - const message = createBaseMsgCancelProposal() - message.proposalId = - object.proposalId !== undefined && object.proposalId !== null - ? BigInt(object.proposalId.toString()) - : BigInt(0) - message.proposer = object.proposer ?? '' - return message + const message = createBaseMsgCancelProposal(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.proposer = object.proposer ?? ""; + return message; }, fromAmino(object: MsgCancelProposalAmino): MsgCancelProposal { - const message = createBaseMsgCancelProposal() + const message = createBaseMsgCancelProposal(); if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id) + message.proposalId = BigInt(object.proposal_id); } if (object.proposer !== undefined && object.proposer !== null) { - message.proposer = object.proposer + message.proposer = object.proposer; } - return message + return message; }, - toAmino( - message: MsgCancelProposal, - useInterfaces: boolean = false - ): MsgCancelProposalAmino { - const obj: any = {} - obj.proposal_id = message.proposalId - ? message.proposalId.toString() - : undefined - obj.proposer = message.proposer - return obj + toAmino(message: MsgCancelProposal, useInterfaces: boolean = false): MsgCancelProposalAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.proposer = message.proposer; + return obj; }, fromAminoMsg(object: MsgCancelProposalAminoMsg): MsgCancelProposal { - return MsgCancelProposal.fromAmino(object.value) + return MsgCancelProposal.fromAmino(object.value); }, - toAminoMsg( - message: MsgCancelProposal, - useInterfaces: boolean = false - ): MsgCancelProposalAminoMsg { + toAminoMsg(message: MsgCancelProposal, useInterfaces: boolean = false): MsgCancelProposalAminoMsg { return { - type: 'cosmos-sdk/v1/MsgCancelProposal', - value: MsgCancelProposal.toAmino(message, useInterfaces), - } + type: "cosmos-sdk/v1/MsgCancelProposal", + value: MsgCancelProposal.toAmino(message, useInterfaces) + }; }, - fromProtoMsg( - message: MsgCancelProposalProtoMsg, - useInterfaces: boolean = false - ): MsgCancelProposal { - return MsgCancelProposal.decode(message.value, undefined, useInterfaces) + fromProtoMsg(message: MsgCancelProposalProtoMsg, useInterfaces: boolean = false): MsgCancelProposal { + return MsgCancelProposal.decode(message.value, undefined, useInterfaces); }, toProto(message: MsgCancelProposal): Uint8Array { - return MsgCancelProposal.encode(message).finish() + return MsgCancelProposal.encode(message).finish(); }, toProtoMsg(message: MsgCancelProposal): MsgCancelProposalProtoMsg { return { - typeUrl: '/cosmos.gov.v1.MsgCancelProposal', - value: MsgCancelProposal.encode(message).finish(), - } - }, -} + typeUrl: "/cosmos.gov.v1.MsgCancelProposal", + value: MsgCancelProposal.encode(message).finish() + }; + } +}; function createBaseMsgCancelProposalResponse(): MsgCancelProposalResponse { return { proposalId: BigInt(0), canceledTime: new Date(), - canceledHeight: BigInt(0), - } + canceledHeight: BigInt(0) + }; } export const MsgCancelProposalResponse = { - typeUrl: '/cosmos.gov.v1.MsgCancelProposalResponse', - encode( - message: MsgCancelProposalResponse, - writer: BinaryWriter = BinaryWriter.create() - ): BinaryWriter { + typeUrl: "/cosmos.gov.v1.MsgCancelProposalResponse", + encode(message: MsgCancelProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalId !== BigInt(0)) { - writer.uint32(8).uint64(message.proposalId) + writer.uint32(8).uint64(message.proposalId); } if (message.canceledTime !== undefined) { - Timestamp.encode( - toTimestamp(message.canceledTime), - writer.uint32(18).fork() - ).ldelim() + Timestamp.encode(toTimestamp(message.canceledTime), writer.uint32(18).fork()).ldelim(); } if (message.canceledHeight !== BigInt(0)) { - writer.uint32(24).uint64(message.canceledHeight) - } - return writer - }, - decode( - input: BinaryReader | Uint8Array, - length?: number, - useInterfaces: boolean = false - ): MsgCancelProposalResponse { - const reader = - input instanceof BinaryReader ? input : new BinaryReader(input) - let end = length === undefined ? reader.len : reader.pos + length - const message = createBaseMsgCancelProposalResponse() + writer.uint32(24).uint64(message.canceledHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgCancelProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelProposalResponse(); while (reader.pos < end) { - const tag = reader.uint32() + const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() - break + message.proposalId = reader.uint64(); + break; case 2: - message.canceledTime = fromTimestamp( - Timestamp.decode(reader, reader.uint32()) - ) - break + message.canceledTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; case 3: - message.canceledHeight = reader.uint64() - break + message.canceledHeight = reader.uint64(); + break; default: - reader.skipType(tag & 7) - break + reader.skipType(tag & 7); + break; } } - return message - }, - fromPartial( - object: Partial - ): MsgCancelProposalResponse { - const message = createBaseMsgCancelProposalResponse() - message.proposalId = - object.proposalId !== undefined && object.proposalId !== null - ? BigInt(object.proposalId.toString()) - : BigInt(0) - message.canceledTime = object.canceledTime ?? undefined - message.canceledHeight = - object.canceledHeight !== undefined && object.canceledHeight !== null - ? BigInt(object.canceledHeight.toString()) - : BigInt(0) - return message + return message; + }, + fromPartial(object: Partial): MsgCancelProposalResponse { + const message = createBaseMsgCancelProposalResponse(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.canceledTime = object.canceledTime ?? undefined; + message.canceledHeight = object.canceledHeight !== undefined && object.canceledHeight !== null ? BigInt(object.canceledHeight.toString()) : BigInt(0); + return message; }, fromAmino(object: MsgCancelProposalResponseAmino): MsgCancelProposalResponse { - const message = createBaseMsgCancelProposalResponse() + const message = createBaseMsgCancelProposalResponse(); if (object.proposal_id !== undefined && object.proposal_id !== null) { - message.proposalId = BigInt(object.proposal_id) + message.proposalId = BigInt(object.proposal_id); } if (object.canceled_time !== undefined && object.canceled_time !== null) { - message.canceledTime = fromTimestamp( - Timestamp.fromAmino(object.canceled_time) - ) - } - if ( - object.canceled_height !== undefined && - object.canceled_height !== null - ) { - message.canceledHeight = BigInt(object.canceled_height) - } - return message - }, - toAmino( - message: MsgCancelProposalResponse, - useInterfaces: boolean = false - ): MsgCancelProposalResponseAmino { - const obj: any = {} - obj.proposal_id = message.proposalId - ? message.proposalId.toString() - : undefined - obj.canceled_time = message.canceledTime - ? Timestamp.toAmino(toTimestamp(message.canceledTime)) - : undefined - obj.canceled_height = message.canceledHeight - ? message.canceledHeight.toString() - : undefined - return obj - }, - fromAminoMsg( - object: MsgCancelProposalResponseAminoMsg - ): MsgCancelProposalResponse { - return MsgCancelProposalResponse.fromAmino(object.value) - }, - toAminoMsg( - message: MsgCancelProposalResponse, - useInterfaces: boolean = false - ): MsgCancelProposalResponseAminoMsg { - return { - type: 'cosmos-sdk/v1/MsgCancelProposalResponse', - value: MsgCancelProposalResponse.toAmino(message, useInterfaces), + message.canceledTime = fromTimestamp(Timestamp.fromAmino(object.canceled_time)); + } + if (object.canceled_height !== undefined && object.canceled_height !== null) { + message.canceledHeight = BigInt(object.canceled_height); } + return message; }, - fromProtoMsg( - message: MsgCancelProposalResponseProtoMsg, - useInterfaces: boolean = false - ): MsgCancelProposalResponse { - return MsgCancelProposalResponse.decode( - message.value, - undefined, - useInterfaces - ) + toAmino(message: MsgCancelProposalResponse, useInterfaces: boolean = false): MsgCancelProposalResponseAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + obj.canceled_time = message.canceledTime ? Timestamp.toAmino(toTimestamp(message.canceledTime)) : undefined; + obj.canceled_height = message.canceledHeight ? message.canceledHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgCancelProposalResponseAminoMsg): MsgCancelProposalResponse { + return MsgCancelProposalResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelProposalResponse, useInterfaces: boolean = false): MsgCancelProposalResponseAminoMsg { + return { + type: "cosmos-sdk/v1/MsgCancelProposalResponse", + value: MsgCancelProposalResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgCancelProposalResponseProtoMsg, useInterfaces: boolean = false): MsgCancelProposalResponse { + return MsgCancelProposalResponse.decode(message.value, undefined, useInterfaces); }, toProto(message: MsgCancelProposalResponse): Uint8Array { - return MsgCancelProposalResponse.encode(message).finish() + return MsgCancelProposalResponse.encode(message).finish(); }, - toProtoMsg( - message: MsgCancelProposalResponse - ): MsgCancelProposalResponseProtoMsg { + toProtoMsg(message: MsgCancelProposalResponse): MsgCancelProposalResponseProtoMsg { return { - typeUrl: '/cosmos.gov.v1.MsgCancelProposalResponse', - value: MsgCancelProposalResponse.encode(message).finish(), - } - }, -} -export const Cosmos_govv1beta1Content_InterfaceDecoder = ( - input: BinaryReader | Uint8Array -): - | MsgCreateAllianceProposal - | MsgUpdateAllianceProposal - | MsgDeleteAllianceProposal - | CommunityPoolSpendProposal - | CommunityPoolSpendProposalWithDeposit - | TextProposal - | ParameterChangeProposal - | SoftwareUpgradeProposal - | CancelSoftwareUpgradeProposal - | StoreCodeProposal - | InstantiateContractProposal - | InstantiateContract2Proposal - | MigrateContractProposal - | SudoContractProposal - | ExecuteContractProposal - | UpdateAdminProposal - | ClearAdminProposal - | PinCodesProposal - | UnpinCodesProposal - | UpdateInstantiateConfigProposal - | StoreAndInstantiateContractProposal - | ClientUpdateProposal - | UpgradeProposal - | ReplaceMigrationRecordsProposal - | UpdateMigrationRecordsProposal - | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal - | SetScalingFactorControllerProposal - | CreateGroupsProposal - | ReplacePoolIncentivesProposal - | UpdatePoolIncentivesProposal - | SetProtoRevEnabledProposal - | SetProtoRevAdminAccountProposal - | SetSuperfluidAssetsProposal - | RemoveSuperfluidAssetsProposal - | UpdateUnpoolWhiteListProposal - | UpdateFeeTokenProposal - | PromoteToPrivilegedContractProposal - | DemotePrivilegedContractProposal - | SetCodeAuthorizationProposal - | RemoveCodeAuthorizationProposal - | SetContractAuthorizationProposal - | RemoveContractAuthorizationProposal - | AllowDenomProposal - | CreditTypeProposal - | Any => { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input) - const data = Any.decode(reader, reader.uint32(), true) + typeUrl: "/cosmos.gov.v1.MsgCancelProposalResponse", + value: MsgCancelProposalResponse.encode(message).finish() + }; + } +}; +export const Cosmos_govv1beta1Content_InterfaceDecoder = (input: BinaryReader | Uint8Array): MsgCreateAllianceProposal | MsgUpdateAllianceProposal | MsgDeleteAllianceProposal | CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | ClientUpdateProposal | UpgradeProposal | ReplaceMigrationRecordsProposal | UpdateMigrationRecordsProposal | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal | SetScalingFactorControllerProposal | CreateGroupsProposal | ReplacePoolIncentivesProposal | UpdatePoolIncentivesProposal | SetProtoRevEnabledProposal | SetProtoRevAdminAccountProposal | SetSuperfluidAssetsProposal | RemoveSuperfluidAssetsProposal | UpdateUnpoolWhiteListProposal | UpdateFeeTokenProposal | PromoteToPrivilegedContractProposal | DemotePrivilegedContractProposal | SetCodeAuthorizationProposal | RemoveCodeAuthorizationProposal | SetContractAuthorizationProposal | RemoveContractAuthorizationProposal | AllowDenomProposal | CreditTypeProposal | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { - case '/alliance.alliance.MsgCreateAllianceProposal': - return MsgCreateAllianceProposal.decode(data.value, undefined, true) - case '/alliance.alliance.MsgUpdateAllianceProposal': - return MsgUpdateAllianceProposal.decode(data.value, undefined, true) - case '/alliance.alliance.MsgDeleteAllianceProposal': - return MsgDeleteAllianceProposal.decode(data.value, undefined, true) - case '/cosmos.distribution.v1beta1.CommunityPoolSpendProposal': - return CommunityPoolSpendProposal.decode(data.value, undefined, true) - case '/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit': - return CommunityPoolSpendProposalWithDeposit.decode( - data.value, - undefined, - true - ) - case '/cosmos.gov.v1beta1.TextProposal': - return TextProposal.decode(data.value, undefined, true) - case '/cosmos.params.v1beta1.ParameterChangeProposal': - return ParameterChangeProposal.decode(data.value, undefined, true) - case '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal': - return SoftwareUpgradeProposal.decode(data.value, undefined, true) - case '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal': - return CancelSoftwareUpgradeProposal.decode(data.value, undefined, true) - case '/cosmwasm.wasm.v1.StoreCodeProposal': - return StoreCodeProposal.decode(data.value, undefined, true) - case '/cosmwasm.wasm.v1.InstantiateContractProposal': - return InstantiateContractProposal.decode(data.value, undefined, true) - case '/cosmwasm.wasm.v1.InstantiateContract2Proposal': - return InstantiateContract2Proposal.decode(data.value, undefined, true) - case '/cosmwasm.wasm.v1.MigrateContractProposal': - return MigrateContractProposal.decode(data.value, undefined, true) - case '/cosmwasm.wasm.v1.SudoContractProposal': - return SudoContractProposal.decode(data.value, undefined, true) - case '/cosmwasm.wasm.v1.ExecuteContractProposal': - return ExecuteContractProposal.decode(data.value, undefined, true) - case '/cosmwasm.wasm.v1.UpdateAdminProposal': - return UpdateAdminProposal.decode(data.value, undefined, true) - case '/cosmwasm.wasm.v1.ClearAdminProposal': - return ClearAdminProposal.decode(data.value, undefined, true) - case '/cosmwasm.wasm.v1.PinCodesProposal': - return PinCodesProposal.decode(data.value, undefined, true) - case '/cosmwasm.wasm.v1.UnpinCodesProposal': - return UnpinCodesProposal.decode(data.value, undefined, true) - case '/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal': - return UpdateInstantiateConfigProposal.decode(data.value, undefined, true) - case '/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal': - return StoreAndInstantiateContractProposal.decode( - data.value, - undefined, - true - ) - case '/ibc.core.client.v1.ClientUpdateProposal': - return ClientUpdateProposal.decode(data.value, undefined, true) - case '/ibc.core.client.v1.UpgradeProposal': - return UpgradeProposal.decode(data.value, undefined, true) - case '/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal': - return ReplaceMigrationRecordsProposal.decode(data.value, undefined, true) - case '/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal': - return UpdateMigrationRecordsProposal.decode(data.value, undefined, true) - case '/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal': - return CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.decode( - data.value, - undefined, - true - ) - case '/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal': - return SetScalingFactorControllerProposal.decode( - data.value, - undefined, - true - ) - case '/osmosis.incentives.CreateGroupsProposal': - return CreateGroupsProposal.decode(data.value, undefined, true) - case '/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal': - return ReplacePoolIncentivesProposal.decode(data.value, undefined, true) - case '/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal': - return UpdatePoolIncentivesProposal.decode(data.value, undefined, true) - case '/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal': - return SetProtoRevEnabledProposal.decode(data.value, undefined, true) - case '/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal': - return SetProtoRevAdminAccountProposal.decode(data.value, undefined, true) - case '/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal': - return SetSuperfluidAssetsProposal.decode(data.value, undefined, true) - case '/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal': - return RemoveSuperfluidAssetsProposal.decode(data.value, undefined, true) - case '/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal': - return UpdateUnpoolWhiteListProposal.decode(data.value, undefined, true) - case '/osmosis.txfees.v1beta1.UpdateFeeTokenProposal': - return UpdateFeeTokenProposal.decode(data.value, undefined, true) - case '/publicawesome.stargaze.cron.v1.PromoteToPrivilegedContractProposal': - return PromoteToPrivilegedContractProposal.decode( - data.value, - undefined, - true - ) - case '/publicawesome.stargaze.cron.v1.DemotePrivilegedContractProposal': - return DemotePrivilegedContractProposal.decode( - data.value, - undefined, - true - ) - case '/publicawesome.stargaze.globalfee.v1.SetCodeAuthorizationProposal': - return SetCodeAuthorizationProposal.decode(data.value, undefined, true) - case '/publicawesome.stargaze.globalfee.v1.RemoveCodeAuthorizationProposal': - return RemoveCodeAuthorizationProposal.decode(data.value, undefined, true) - case '/publicawesome.stargaze.globalfee.v1.SetContractAuthorizationProposal': - return SetContractAuthorizationProposal.decode( - data.value, - undefined, - true - ) - case '/publicawesome.stargaze.globalfee.v1.RemoveContractAuthorizationProposal': - return RemoveContractAuthorizationProposal.decode( - data.value, - undefined, - true - ) - case '/regen.ecocredit.marketplace.v1.AllowDenomProposal': - return AllowDenomProposal.decode(data.value, undefined, true) - case '/regen.ecocredit.v1.CreditTypeProposal': - return CreditTypeProposal.decode(data.value, undefined, true) + case "/alliance.alliance.MsgCreateAllianceProposal": + return MsgCreateAllianceProposal.decode(data.value, undefined, true); + case "/alliance.alliance.MsgUpdateAllianceProposal": + return MsgUpdateAllianceProposal.decode(data.value, undefined, true); + case "/alliance.alliance.MsgDeleteAllianceProposal": + return MsgDeleteAllianceProposal.decode(data.value, undefined, true); + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal": + return CommunityPoolSpendProposal.decode(data.value, undefined, true); + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit": + return CommunityPoolSpendProposalWithDeposit.decode(data.value, undefined, true); + case "/cosmos.gov.v1beta1.TextProposal": + return TextProposal.decode(data.value, undefined, true); + case "/cosmos.params.v1beta1.ParameterChangeProposal": + return ParameterChangeProposal.decode(data.value, undefined, true); + case "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal": + return SoftwareUpgradeProposal.decode(data.value, undefined, true); + case "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal": + return CancelSoftwareUpgradeProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.StoreCodeProposal": + return StoreCodeProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.InstantiateContractProposal": + return InstantiateContractProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.InstantiateContract2Proposal": + return InstantiateContract2Proposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.MigrateContractProposal": + return MigrateContractProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.SudoContractProposal": + return SudoContractProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.ExecuteContractProposal": + return ExecuteContractProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.UpdateAdminProposal": + return UpdateAdminProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.ClearAdminProposal": + return ClearAdminProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.PinCodesProposal": + return PinCodesProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.UnpinCodesProposal": + return UnpinCodesProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal": + return UpdateInstantiateConfigProposal.decode(data.value, undefined, true); + case "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal": + return StoreAndInstantiateContractProposal.decode(data.value, undefined, true); + case "/ibc.core.client.v1.ClientUpdateProposal": + return ClientUpdateProposal.decode(data.value, undefined, true); + case "/ibc.core.client.v1.UpgradeProposal": + return UpgradeProposal.decode(data.value, undefined, true); + case "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal": + return ReplaceMigrationRecordsProposal.decode(data.value, undefined, true); + case "/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal": + return UpdateMigrationRecordsProposal.decode(data.value, undefined, true); + case "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal": + return CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.decode(data.value, undefined, true); + case "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal": + return SetScalingFactorControllerProposal.decode(data.value, undefined, true); + case "/osmosis.incentives.CreateGroupsProposal": + return CreateGroupsProposal.decode(data.value, undefined, true); + case "/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal": + return ReplacePoolIncentivesProposal.decode(data.value, undefined, true); + case "/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal": + return UpdatePoolIncentivesProposal.decode(data.value, undefined, true); + case "/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal": + return SetProtoRevEnabledProposal.decode(data.value, undefined, true); + case "/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal": + return SetProtoRevAdminAccountProposal.decode(data.value, undefined, true); + case "/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal": + return SetSuperfluidAssetsProposal.decode(data.value, undefined, true); + case "/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal": + return RemoveSuperfluidAssetsProposal.decode(data.value, undefined, true); + case "/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal": + return UpdateUnpoolWhiteListProposal.decode(data.value, undefined, true); + case "/osmosis.txfees.v1beta1.UpdateFeeTokenProposal": + return UpdateFeeTokenProposal.decode(data.value, undefined, true); + case "/publicawesome.stargaze.cron.v1.PromoteToPrivilegedContractProposal": + return PromoteToPrivilegedContractProposal.decode(data.value, undefined, true); + case "/publicawesome.stargaze.cron.v1.DemotePrivilegedContractProposal": + return DemotePrivilegedContractProposal.decode(data.value, undefined, true); + case "/publicawesome.stargaze.globalfee.v1.SetCodeAuthorizationProposal": + return SetCodeAuthorizationProposal.decode(data.value, undefined, true); + case "/publicawesome.stargaze.globalfee.v1.RemoveCodeAuthorizationProposal": + return RemoveCodeAuthorizationProposal.decode(data.value, undefined, true); + case "/publicawesome.stargaze.globalfee.v1.SetContractAuthorizationProposal": + return SetContractAuthorizationProposal.decode(data.value, undefined, true); + case "/publicawesome.stargaze.globalfee.v1.RemoveContractAuthorizationProposal": + return RemoveContractAuthorizationProposal.decode(data.value, undefined, true); + case "/regen.ecocredit.marketplace.v1.AllowDenomProposal": + return AllowDenomProposal.decode(data.value, undefined, true); + case "/regen.ecocredit.v1.CreditTypeProposal": + return CreditTypeProposal.decode(data.value, undefined, true); default: - return data + return data; } -} +}; export const Cosmos_govv1beta1Content_FromAmino = (content: AnyAmino) => { switch (content.type) { - case '/alliance.alliance.MsgCreateAllianceProposal': + case "/alliance.alliance.MsgCreateAllianceProposal": return Any.fromPartial({ - typeUrl: '/alliance.alliance.MsgCreateAllianceProposal', - value: MsgCreateAllianceProposal.encode( - MsgCreateAllianceProposal.fromPartial( - MsgCreateAllianceProposal.fromAmino(content.value) - ) - ).finish(), - }) - case '/alliance.alliance.MsgUpdateAllianceProposal': + typeUrl: "/alliance.alliance.MsgCreateAllianceProposal", + value: MsgCreateAllianceProposal.encode(MsgCreateAllianceProposal.fromPartial(MsgCreateAllianceProposal.fromAmino(content.value))).finish() + }); + case "/alliance.alliance.MsgUpdateAllianceProposal": return Any.fromPartial({ - typeUrl: '/alliance.alliance.MsgUpdateAllianceProposal', - value: MsgUpdateAllianceProposal.encode( - MsgUpdateAllianceProposal.fromPartial( - MsgUpdateAllianceProposal.fromAmino(content.value) - ) - ).finish(), - }) - case '/alliance.alliance.MsgDeleteAllianceProposal': + typeUrl: "/alliance.alliance.MsgUpdateAllianceProposal", + value: MsgUpdateAllianceProposal.encode(MsgUpdateAllianceProposal.fromPartial(MsgUpdateAllianceProposal.fromAmino(content.value))).finish() + }); + case "/alliance.alliance.MsgDeleteAllianceProposal": return Any.fromPartial({ - typeUrl: '/alliance.alliance.MsgDeleteAllianceProposal', - value: MsgDeleteAllianceProposal.encode( - MsgDeleteAllianceProposal.fromPartial( - MsgDeleteAllianceProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'cosmos-sdk/v1/CommunityPoolSpendProposal': + typeUrl: "/alliance.alliance.MsgDeleteAllianceProposal", + value: MsgDeleteAllianceProposal.encode(MsgDeleteAllianceProposal.fromPartial(MsgDeleteAllianceProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/v1/CommunityPoolSpendProposal": return Any.fromPartial({ - typeUrl: '/cosmos.distribution.v1beta1.CommunityPoolSpendProposal', - value: CommunityPoolSpendProposal.encode( - CommunityPoolSpendProposal.fromPartial( - CommunityPoolSpendProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'cosmos-sdk/v1/CommunityPoolSpendProposalWithDeposit': + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal", + value: CommunityPoolSpendProposal.encode(CommunityPoolSpendProposal.fromPartial(CommunityPoolSpendProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/v1/CommunityPoolSpendProposalWithDeposit": return Any.fromPartial({ - typeUrl: - '/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit', - value: CommunityPoolSpendProposalWithDeposit.encode( - CommunityPoolSpendProposalWithDeposit.fromPartial( - CommunityPoolSpendProposalWithDeposit.fromAmino(content.value) - ) - ).finish(), - }) - case 'cosmos-sdk/TextProposal': + typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", + value: CommunityPoolSpendProposalWithDeposit.encode(CommunityPoolSpendProposalWithDeposit.fromPartial(CommunityPoolSpendProposalWithDeposit.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/TextProposal": return Any.fromPartial({ - typeUrl: '/cosmos.gov.v1beta1.TextProposal', - value: TextProposal.encode( - TextProposal.fromPartial(TextProposal.fromAmino(content.value)) - ).finish(), - }) - case 'cosmos-sdk/ParameterChangeProposal': + typeUrl: "/cosmos.gov.v1beta1.TextProposal", + value: TextProposal.encode(TextProposal.fromPartial(TextProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/ParameterChangeProposal": return Any.fromPartial({ - typeUrl: '/cosmos.params.v1beta1.ParameterChangeProposal', - value: ParameterChangeProposal.encode( - ParameterChangeProposal.fromPartial( - ParameterChangeProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'cosmos-sdk/SoftwareUpgradeProposal': + typeUrl: "/cosmos.params.v1beta1.ParameterChangeProposal", + value: ParameterChangeProposal.encode(ParameterChangeProposal.fromPartial(ParameterChangeProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/SoftwareUpgradeProposal": return Any.fromPartial({ - typeUrl: '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal', - value: SoftwareUpgradeProposal.encode( - SoftwareUpgradeProposal.fromPartial( - SoftwareUpgradeProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'cosmos-sdk/CancelSoftwareUpgradeProposal': + typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", + value: SoftwareUpgradeProposal.encode(SoftwareUpgradeProposal.fromPartial(SoftwareUpgradeProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/CancelSoftwareUpgradeProposal": return Any.fromPartial({ - typeUrl: '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal', - value: CancelSoftwareUpgradeProposal.encode( - CancelSoftwareUpgradeProposal.fromPartial( - CancelSoftwareUpgradeProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'wasm/StoreCodeProposal': + typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", + value: CancelSoftwareUpgradeProposal.encode(CancelSoftwareUpgradeProposal.fromPartial(CancelSoftwareUpgradeProposal.fromAmino(content.value))).finish() + }); + case "wasm/StoreCodeProposal": return Any.fromPartial({ - typeUrl: '/cosmwasm.wasm.v1.StoreCodeProposal', - value: StoreCodeProposal.encode( - StoreCodeProposal.fromPartial( - StoreCodeProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'wasm/InstantiateContractProposal': + typeUrl: "/cosmwasm.wasm.v1.StoreCodeProposal", + value: StoreCodeProposal.encode(StoreCodeProposal.fromPartial(StoreCodeProposal.fromAmino(content.value))).finish() + }); + case "wasm/InstantiateContractProposal": return Any.fromPartial({ - typeUrl: '/cosmwasm.wasm.v1.InstantiateContractProposal', - value: InstantiateContractProposal.encode( - InstantiateContractProposal.fromPartial( - InstantiateContractProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'wasm/InstantiateContract2Proposal': + typeUrl: "/cosmwasm.wasm.v1.InstantiateContractProposal", + value: InstantiateContractProposal.encode(InstantiateContractProposal.fromPartial(InstantiateContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/InstantiateContract2Proposal": return Any.fromPartial({ - typeUrl: '/cosmwasm.wasm.v1.InstantiateContract2Proposal', - value: InstantiateContract2Proposal.encode( - InstantiateContract2Proposal.fromPartial( - InstantiateContract2Proposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'wasm/MigrateContractProposal': + typeUrl: "/cosmwasm.wasm.v1.InstantiateContract2Proposal", + value: InstantiateContract2Proposal.encode(InstantiateContract2Proposal.fromPartial(InstantiateContract2Proposal.fromAmino(content.value))).finish() + }); + case "wasm/MigrateContractProposal": return Any.fromPartial({ - typeUrl: '/cosmwasm.wasm.v1.MigrateContractProposal', - value: MigrateContractProposal.encode( - MigrateContractProposal.fromPartial( - MigrateContractProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'wasm/SudoContractProposal': + typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal", + value: MigrateContractProposal.encode(MigrateContractProposal.fromPartial(MigrateContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/SudoContractProposal": return Any.fromPartial({ - typeUrl: '/cosmwasm.wasm.v1.SudoContractProposal', - value: SudoContractProposal.encode( - SudoContractProposal.fromPartial( - SudoContractProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'wasm/ExecuteContractProposal': + typeUrl: "/cosmwasm.wasm.v1.SudoContractProposal", + value: SudoContractProposal.encode(SudoContractProposal.fromPartial(SudoContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/ExecuteContractProposal": return Any.fromPartial({ - typeUrl: '/cosmwasm.wasm.v1.ExecuteContractProposal', - value: ExecuteContractProposal.encode( - ExecuteContractProposal.fromPartial( - ExecuteContractProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'wasm/UpdateAdminProposal': + typeUrl: "/cosmwasm.wasm.v1.ExecuteContractProposal", + value: ExecuteContractProposal.encode(ExecuteContractProposal.fromPartial(ExecuteContractProposal.fromAmino(content.value))).finish() + }); + case "wasm/UpdateAdminProposal": return Any.fromPartial({ - typeUrl: '/cosmwasm.wasm.v1.UpdateAdminProposal', - value: UpdateAdminProposal.encode( - UpdateAdminProposal.fromPartial( - UpdateAdminProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'wasm/ClearAdminProposal': + typeUrl: "/cosmwasm.wasm.v1.UpdateAdminProposal", + value: UpdateAdminProposal.encode(UpdateAdminProposal.fromPartial(UpdateAdminProposal.fromAmino(content.value))).finish() + }); + case "wasm/ClearAdminProposal": return Any.fromPartial({ - typeUrl: '/cosmwasm.wasm.v1.ClearAdminProposal', - value: ClearAdminProposal.encode( - ClearAdminProposal.fromPartial( - ClearAdminProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'wasm/PinCodesProposal': + typeUrl: "/cosmwasm.wasm.v1.ClearAdminProposal", + value: ClearAdminProposal.encode(ClearAdminProposal.fromPartial(ClearAdminProposal.fromAmino(content.value))).finish() + }); + case "wasm/PinCodesProposal": return Any.fromPartial({ - typeUrl: '/cosmwasm.wasm.v1.PinCodesProposal', - value: PinCodesProposal.encode( - PinCodesProposal.fromPartial( - PinCodesProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'wasm/UnpinCodesProposal': + typeUrl: "/cosmwasm.wasm.v1.PinCodesProposal", + value: PinCodesProposal.encode(PinCodesProposal.fromPartial(PinCodesProposal.fromAmino(content.value))).finish() + }); + case "wasm/UnpinCodesProposal": return Any.fromPartial({ - typeUrl: '/cosmwasm.wasm.v1.UnpinCodesProposal', - value: UnpinCodesProposal.encode( - UnpinCodesProposal.fromPartial( - UnpinCodesProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'wasm/UpdateInstantiateConfigProposal': + typeUrl: "/cosmwasm.wasm.v1.UnpinCodesProposal", + value: UnpinCodesProposal.encode(UnpinCodesProposal.fromPartial(UnpinCodesProposal.fromAmino(content.value))).finish() + }); + case "wasm/UpdateInstantiateConfigProposal": return Any.fromPartial({ - typeUrl: '/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal', - value: UpdateInstantiateConfigProposal.encode( - UpdateInstantiateConfigProposal.fromPartial( - UpdateInstantiateConfigProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'wasm/StoreAndInstantiateContractProposal': + typeUrl: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal", + value: UpdateInstantiateConfigProposal.encode(UpdateInstantiateConfigProposal.fromPartial(UpdateInstantiateConfigProposal.fromAmino(content.value))).finish() + }); + case "wasm/StoreAndInstantiateContractProposal": return Any.fromPartial({ - typeUrl: '/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal', - value: StoreAndInstantiateContractProposal.encode( - StoreAndInstantiateContractProposal.fromPartial( - StoreAndInstantiateContractProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'cosmos-sdk/ClientUpdateProposal': + typeUrl: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal", + value: StoreAndInstantiateContractProposal.encode(StoreAndInstantiateContractProposal.fromPartial(StoreAndInstantiateContractProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/ClientUpdateProposal": return Any.fromPartial({ - typeUrl: '/ibc.core.client.v1.ClientUpdateProposal', - value: ClientUpdateProposal.encode( - ClientUpdateProposal.fromPartial( - ClientUpdateProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'cosmos-sdk/UpgradeProposal': + typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", + value: ClientUpdateProposal.encode(ClientUpdateProposal.fromPartial(ClientUpdateProposal.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/UpgradeProposal": return Any.fromPartial({ - typeUrl: '/ibc.core.client.v1.UpgradeProposal', - value: UpgradeProposal.encode( - UpgradeProposal.fromPartial(UpgradeProposal.fromAmino(content.value)) - ).finish(), - }) - case 'osmosis/ReplaceMigrationRecordsProposal': + typeUrl: "/ibc.core.client.v1.UpgradeProposal", + value: UpgradeProposal.encode(UpgradeProposal.fromPartial(UpgradeProposal.fromAmino(content.value))).finish() + }); + case "osmosis/ReplaceMigrationRecordsProposal": return Any.fromPartial({ - typeUrl: '/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal', - value: ReplaceMigrationRecordsProposal.encode( - ReplaceMigrationRecordsProposal.fromPartial( - ReplaceMigrationRecordsProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'osmosis/UpdateMigrationRecordsProposal': + typeUrl: "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal", + value: ReplaceMigrationRecordsProposal.encode(ReplaceMigrationRecordsProposal.fromPartial(ReplaceMigrationRecordsProposal.fromAmino(content.value))).finish() + }); + case "osmosis/UpdateMigrationRecordsProposal": return Any.fromPartial({ - typeUrl: '/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal', - value: UpdateMigrationRecordsProposal.encode( - UpdateMigrationRecordsProposal.fromPartial( - UpdateMigrationRecordsProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'osmosis/CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal': + typeUrl: "/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal", + value: UpdateMigrationRecordsProposal.encode(UpdateMigrationRecordsProposal.fromPartial(UpdateMigrationRecordsProposal.fromAmino(content.value))).finish() + }); + case "osmosis/CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal": return Any.fromPartial({ - typeUrl: - '/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal', - value: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.encode( - CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.fromPartial( - CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.fromAmino( - content.value - ) - ) - ).finish(), - }) - case 'osmosis/SetScalingFactorControllerProposal': + typeUrl: "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal", + value: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.encode(CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.fromPartial(CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.fromAmino(content.value))).finish() + }); + case "osmosis/SetScalingFactorControllerProposal": return Any.fromPartial({ - typeUrl: '/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal', - value: SetScalingFactorControllerProposal.encode( - SetScalingFactorControllerProposal.fromPartial( - SetScalingFactorControllerProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'osmosis/incentives/create-groups-proposal': + typeUrl: "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal", + value: SetScalingFactorControllerProposal.encode(SetScalingFactorControllerProposal.fromPartial(SetScalingFactorControllerProposal.fromAmino(content.value))).finish() + }); + case "osmosis/incentives/create-groups-proposal": return Any.fromPartial({ - typeUrl: '/osmosis.incentives.CreateGroupsProposal', - value: CreateGroupsProposal.encode( - CreateGroupsProposal.fromPartial( - CreateGroupsProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'osmosis/ReplacePoolIncentivesProposal': + typeUrl: "/osmosis.incentives.CreateGroupsProposal", + value: CreateGroupsProposal.encode(CreateGroupsProposal.fromPartial(CreateGroupsProposal.fromAmino(content.value))).finish() + }); + case "osmosis/ReplacePoolIncentivesProposal": return Any.fromPartial({ - typeUrl: - '/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal', - value: ReplacePoolIncentivesProposal.encode( - ReplacePoolIncentivesProposal.fromPartial( - ReplacePoolIncentivesProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'osmosis/UpdatePoolIncentivesProposal': + typeUrl: "/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal", + value: ReplacePoolIncentivesProposal.encode(ReplacePoolIncentivesProposal.fromPartial(ReplacePoolIncentivesProposal.fromAmino(content.value))).finish() + }); + case "osmosis/UpdatePoolIncentivesProposal": return Any.fromPartial({ - typeUrl: '/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal', - value: UpdatePoolIncentivesProposal.encode( - UpdatePoolIncentivesProposal.fromPartial( - UpdatePoolIncentivesProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'osmosis/SetProtoRevEnabledProposal': + typeUrl: "/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal", + value: UpdatePoolIncentivesProposal.encode(UpdatePoolIncentivesProposal.fromPartial(UpdatePoolIncentivesProposal.fromAmino(content.value))).finish() + }); + case "osmosis/SetProtoRevEnabledProposal": return Any.fromPartial({ - typeUrl: '/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal', - value: SetProtoRevEnabledProposal.encode( - SetProtoRevEnabledProposal.fromPartial( - SetProtoRevEnabledProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'osmosis/SetProtoRevAdminAccountProposal': + typeUrl: "/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal", + value: SetProtoRevEnabledProposal.encode(SetProtoRevEnabledProposal.fromPartial(SetProtoRevEnabledProposal.fromAmino(content.value))).finish() + }); + case "osmosis/SetProtoRevAdminAccountProposal": return Any.fromPartial({ - typeUrl: '/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal', - value: SetProtoRevAdminAccountProposal.encode( - SetProtoRevAdminAccountProposal.fromPartial( - SetProtoRevAdminAccountProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'osmosis/set-superfluid-assets-proposal': + typeUrl: "/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal", + value: SetProtoRevAdminAccountProposal.encode(SetProtoRevAdminAccountProposal.fromPartial(SetProtoRevAdminAccountProposal.fromAmino(content.value))).finish() + }); + case "osmosis/set-superfluid-assets-proposal": return Any.fromPartial({ - typeUrl: '/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal', - value: SetSuperfluidAssetsProposal.encode( - SetSuperfluidAssetsProposal.fromPartial( - SetSuperfluidAssetsProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'osmosis/del-superfluid-assets-proposal': + typeUrl: "/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal", + value: SetSuperfluidAssetsProposal.encode(SetSuperfluidAssetsProposal.fromPartial(SetSuperfluidAssetsProposal.fromAmino(content.value))).finish() + }); + case "osmosis/del-superfluid-assets-proposal": return Any.fromPartial({ - typeUrl: '/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal', - value: RemoveSuperfluidAssetsProposal.encode( - RemoveSuperfluidAssetsProposal.fromPartial( - RemoveSuperfluidAssetsProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'osmosis/update-unpool-whitelist': + typeUrl: "/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal", + value: RemoveSuperfluidAssetsProposal.encode(RemoveSuperfluidAssetsProposal.fromPartial(RemoveSuperfluidAssetsProposal.fromAmino(content.value))).finish() + }); + case "osmosis/update-unpool-whitelist": return Any.fromPartial({ - typeUrl: '/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal', - value: UpdateUnpoolWhiteListProposal.encode( - UpdateUnpoolWhiteListProposal.fromPartial( - UpdateUnpoolWhiteListProposal.fromAmino(content.value) - ) - ).finish(), - }) - case 'osmosis/UpdateFeeTokenProposal': + typeUrl: "/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal", + value: UpdateUnpoolWhiteListProposal.encode(UpdateUnpoolWhiteListProposal.fromPartial(UpdateUnpoolWhiteListProposal.fromAmino(content.value))).finish() + }); + case "osmosis/UpdateFeeTokenProposal": return Any.fromPartial({ - typeUrl: '/osmosis.txfees.v1beta1.UpdateFeeTokenProposal', - value: UpdateFeeTokenProposal.encode( - UpdateFeeTokenProposal.fromPartial( - UpdateFeeTokenProposal.fromAmino(content.value) - ) - ).finish(), - }) - case '/publicawesome.stargaze.cron.v1.PromoteToPrivilegedContractProposal': + typeUrl: "/osmosis.txfees.v1beta1.UpdateFeeTokenProposal", + value: UpdateFeeTokenProposal.encode(UpdateFeeTokenProposal.fromPartial(UpdateFeeTokenProposal.fromAmino(content.value))).finish() + }); + case "/publicawesome.stargaze.cron.v1.PromoteToPrivilegedContractProposal": return Any.fromPartial({ - typeUrl: - '/publicawesome.stargaze.cron.v1.PromoteToPrivilegedContractProposal', - value: PromoteToPrivilegedContractProposal.encode( - PromoteToPrivilegedContractProposal.fromPartial( - PromoteToPrivilegedContractProposal.fromAmino(content.value) - ) - ).finish(), - }) - case '/publicawesome.stargaze.cron.v1.DemotePrivilegedContractProposal': + typeUrl: "/publicawesome.stargaze.cron.v1.PromoteToPrivilegedContractProposal", + value: PromoteToPrivilegedContractProposal.encode(PromoteToPrivilegedContractProposal.fromPartial(PromoteToPrivilegedContractProposal.fromAmino(content.value))).finish() + }); + case "/publicawesome.stargaze.cron.v1.DemotePrivilegedContractProposal": return Any.fromPartial({ - typeUrl: - '/publicawesome.stargaze.cron.v1.DemotePrivilegedContractProposal', - value: DemotePrivilegedContractProposal.encode( - DemotePrivilegedContractProposal.fromPartial( - DemotePrivilegedContractProposal.fromAmino(content.value) - ) - ).finish(), - }) - case '/publicawesome.stargaze.globalfee.v1.SetCodeAuthorizationProposal': + typeUrl: "/publicawesome.stargaze.cron.v1.DemotePrivilegedContractProposal", + value: DemotePrivilegedContractProposal.encode(DemotePrivilegedContractProposal.fromPartial(DemotePrivilegedContractProposal.fromAmino(content.value))).finish() + }); + case "/publicawesome.stargaze.globalfee.v1.SetCodeAuthorizationProposal": return Any.fromPartial({ - typeUrl: - '/publicawesome.stargaze.globalfee.v1.SetCodeAuthorizationProposal', - value: SetCodeAuthorizationProposal.encode( - SetCodeAuthorizationProposal.fromPartial( - SetCodeAuthorizationProposal.fromAmino(content.value) - ) - ).finish(), - }) - case '/publicawesome.stargaze.globalfee.v1.RemoveCodeAuthorizationProposal': + typeUrl: "/publicawesome.stargaze.globalfee.v1.SetCodeAuthorizationProposal", + value: SetCodeAuthorizationProposal.encode(SetCodeAuthorizationProposal.fromPartial(SetCodeAuthorizationProposal.fromAmino(content.value))).finish() + }); + case "/publicawesome.stargaze.globalfee.v1.RemoveCodeAuthorizationProposal": return Any.fromPartial({ - typeUrl: - '/publicawesome.stargaze.globalfee.v1.RemoveCodeAuthorizationProposal', - value: RemoveCodeAuthorizationProposal.encode( - RemoveCodeAuthorizationProposal.fromPartial( - RemoveCodeAuthorizationProposal.fromAmino(content.value) - ) - ).finish(), - }) - case '/publicawesome.stargaze.globalfee.v1.SetContractAuthorizationProposal': + typeUrl: "/publicawesome.stargaze.globalfee.v1.RemoveCodeAuthorizationProposal", + value: RemoveCodeAuthorizationProposal.encode(RemoveCodeAuthorizationProposal.fromPartial(RemoveCodeAuthorizationProposal.fromAmino(content.value))).finish() + }); + case "/publicawesome.stargaze.globalfee.v1.SetContractAuthorizationProposal": return Any.fromPartial({ - typeUrl: - '/publicawesome.stargaze.globalfee.v1.SetContractAuthorizationProposal', - value: SetContractAuthorizationProposal.encode( - SetContractAuthorizationProposal.fromPartial( - SetContractAuthorizationProposal.fromAmino(content.value) - ) - ).finish(), - }) - case '/publicawesome.stargaze.globalfee.v1.RemoveContractAuthorizationProposal': + typeUrl: "/publicawesome.stargaze.globalfee.v1.SetContractAuthorizationProposal", + value: SetContractAuthorizationProposal.encode(SetContractAuthorizationProposal.fromPartial(SetContractAuthorizationProposal.fromAmino(content.value))).finish() + }); + case "/publicawesome.stargaze.globalfee.v1.RemoveContractAuthorizationProposal": return Any.fromPartial({ - typeUrl: - '/publicawesome.stargaze.globalfee.v1.RemoveContractAuthorizationProposal', - value: RemoveContractAuthorizationProposal.encode( - RemoveContractAuthorizationProposal.fromPartial( - RemoveContractAuthorizationProposal.fromAmino(content.value) - ) - ).finish(), - }) - case '/regen.ecocredit.marketplace.v1.AllowDenomProposal': + typeUrl: "/publicawesome.stargaze.globalfee.v1.RemoveContractAuthorizationProposal", + value: RemoveContractAuthorizationProposal.encode(RemoveContractAuthorizationProposal.fromPartial(RemoveContractAuthorizationProposal.fromAmino(content.value))).finish() + }); + case "/regen.ecocredit.marketplace.v1.AllowDenomProposal": return Any.fromPartial({ - typeUrl: '/regen.ecocredit.marketplace.v1.AllowDenomProposal', - value: AllowDenomProposal.encode( - AllowDenomProposal.fromPartial( - AllowDenomProposal.fromAmino(content.value) - ) - ).finish(), - }) - case '/regen.ecocredit.v1.CreditTypeProposal': + typeUrl: "/regen.ecocredit.marketplace.v1.AllowDenomProposal", + value: AllowDenomProposal.encode(AllowDenomProposal.fromPartial(AllowDenomProposal.fromAmino(content.value))).finish() + }); + case "/regen.ecocredit.v1.CreditTypeProposal": return Any.fromPartial({ - typeUrl: '/regen.ecocredit.v1.CreditTypeProposal', - value: CreditTypeProposal.encode( - CreditTypeProposal.fromPartial( - CreditTypeProposal.fromAmino(content.value) - ) - ).finish(), - }) + typeUrl: "/regen.ecocredit.v1.CreditTypeProposal", + value: CreditTypeProposal.encode(CreditTypeProposal.fromPartial(CreditTypeProposal.fromAmino(content.value))).finish() + }); default: - return Any.fromAmino(content) + return Any.fromAmino(content); } -} -export const Cosmos_govv1beta1Content_ToAmino = ( - content: Any, - useInterfaces: boolean = false -) => { +}; +export const Cosmos_govv1beta1Content_ToAmino = (content: Any, useInterfaces: boolean = false) => { switch (content.typeUrl) { - case '/alliance.alliance.MsgCreateAllianceProposal': + case "/alliance.alliance.MsgCreateAllianceProposal": return { - type: '/alliance.alliance.MsgCreateAllianceProposal', - value: MsgCreateAllianceProposal.toAmino( - MsgCreateAllianceProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/alliance.alliance.MsgUpdateAllianceProposal': + type: "/alliance.alliance.MsgCreateAllianceProposal", + value: MsgCreateAllianceProposal.toAmino(MsgCreateAllianceProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/alliance.alliance.MsgUpdateAllianceProposal": return { - type: '/alliance.alliance.MsgUpdateAllianceProposal', - value: MsgUpdateAllianceProposal.toAmino( - MsgUpdateAllianceProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/alliance.alliance.MsgDeleteAllianceProposal': + type: "/alliance.alliance.MsgUpdateAllianceProposal", + value: MsgUpdateAllianceProposal.toAmino(MsgUpdateAllianceProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/alliance.alliance.MsgDeleteAllianceProposal": return { - type: '/alliance.alliance.MsgDeleteAllianceProposal', - value: MsgDeleteAllianceProposal.toAmino( - MsgDeleteAllianceProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/cosmos.distribution.v1beta1.CommunityPoolSpendProposal': + type: "/alliance.alliance.MsgDeleteAllianceProposal", + value: MsgDeleteAllianceProposal.toAmino(MsgDeleteAllianceProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal": return { - type: 'cosmos-sdk/v1/CommunityPoolSpendProposal', - value: CommunityPoolSpendProposal.toAmino( - CommunityPoolSpendProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit': + type: "cosmos-sdk/v1/CommunityPoolSpendProposal", + value: CommunityPoolSpendProposal.toAmino(CommunityPoolSpendProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit": return { - type: 'cosmos-sdk/v1/CommunityPoolSpendProposalWithDeposit', - value: CommunityPoolSpendProposalWithDeposit.toAmino( - CommunityPoolSpendProposalWithDeposit.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/cosmos.gov.v1beta1.TextProposal': + type: "cosmos-sdk/v1/CommunityPoolSpendProposalWithDeposit", + value: CommunityPoolSpendProposalWithDeposit.toAmino(CommunityPoolSpendProposalWithDeposit.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/cosmos.gov.v1beta1.TextProposal": return { - type: 'cosmos-sdk/TextProposal', - value: TextProposal.toAmino( - TextProposal.decode(content.value, undefined, useInterfaces), - useInterfaces - ), - } - case '/cosmos.params.v1beta1.ParameterChangeProposal': + type: "cosmos-sdk/TextProposal", + value: TextProposal.toAmino(TextProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/cosmos.params.v1beta1.ParameterChangeProposal": return { - type: 'cosmos-sdk/ParameterChangeProposal', - value: ParameterChangeProposal.toAmino( - ParameterChangeProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal': + type: "cosmos-sdk/ParameterChangeProposal", + value: ParameterChangeProposal.toAmino(ParameterChangeProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal": return { - type: 'cosmos-sdk/SoftwareUpgradeProposal', - value: SoftwareUpgradeProposal.toAmino( - SoftwareUpgradeProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal': + type: "cosmos-sdk/SoftwareUpgradeProposal", + value: SoftwareUpgradeProposal.toAmino(SoftwareUpgradeProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal": return { - type: 'cosmos-sdk/CancelSoftwareUpgradeProposal', - value: CancelSoftwareUpgradeProposal.toAmino( - CancelSoftwareUpgradeProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/cosmwasm.wasm.v1.StoreCodeProposal': + type: "cosmos-sdk/CancelSoftwareUpgradeProposal", + value: CancelSoftwareUpgradeProposal.toAmino(CancelSoftwareUpgradeProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/cosmwasm.wasm.v1.StoreCodeProposal": return { - type: 'wasm/StoreCodeProposal', - value: StoreCodeProposal.toAmino( - StoreCodeProposal.decode(content.value, undefined, useInterfaces), - useInterfaces - ), - } - case '/cosmwasm.wasm.v1.InstantiateContractProposal': + type: "wasm/StoreCodeProposal", + value: StoreCodeProposal.toAmino(StoreCodeProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/cosmwasm.wasm.v1.InstantiateContractProposal": return { - type: 'wasm/InstantiateContractProposal', - value: InstantiateContractProposal.toAmino( - InstantiateContractProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/cosmwasm.wasm.v1.InstantiateContract2Proposal': + type: "wasm/InstantiateContractProposal", + value: InstantiateContractProposal.toAmino(InstantiateContractProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/cosmwasm.wasm.v1.InstantiateContract2Proposal": return { - type: 'wasm/InstantiateContract2Proposal', - value: InstantiateContract2Proposal.toAmino( - InstantiateContract2Proposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/cosmwasm.wasm.v1.MigrateContractProposal': + type: "wasm/InstantiateContract2Proposal", + value: InstantiateContract2Proposal.toAmino(InstantiateContract2Proposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/cosmwasm.wasm.v1.MigrateContractProposal": return { - type: 'wasm/MigrateContractProposal', - value: MigrateContractProposal.toAmino( - MigrateContractProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/cosmwasm.wasm.v1.SudoContractProposal': + type: "wasm/MigrateContractProposal", + value: MigrateContractProposal.toAmino(MigrateContractProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/cosmwasm.wasm.v1.SudoContractProposal": return { - type: 'wasm/SudoContractProposal', - value: SudoContractProposal.toAmino( - SudoContractProposal.decode(content.value, undefined, useInterfaces), - useInterfaces - ), - } - case '/cosmwasm.wasm.v1.ExecuteContractProposal': + type: "wasm/SudoContractProposal", + value: SudoContractProposal.toAmino(SudoContractProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/cosmwasm.wasm.v1.ExecuteContractProposal": return { - type: 'wasm/ExecuteContractProposal', - value: ExecuteContractProposal.toAmino( - ExecuteContractProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/cosmwasm.wasm.v1.UpdateAdminProposal': + type: "wasm/ExecuteContractProposal", + value: ExecuteContractProposal.toAmino(ExecuteContractProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/cosmwasm.wasm.v1.UpdateAdminProposal": return { - type: 'wasm/UpdateAdminProposal', - value: UpdateAdminProposal.toAmino( - UpdateAdminProposal.decode(content.value, undefined, useInterfaces), - useInterfaces - ), - } - case '/cosmwasm.wasm.v1.ClearAdminProposal': + type: "wasm/UpdateAdminProposal", + value: UpdateAdminProposal.toAmino(UpdateAdminProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/cosmwasm.wasm.v1.ClearAdminProposal": return { - type: 'wasm/ClearAdminProposal', - value: ClearAdminProposal.toAmino( - ClearAdminProposal.decode(content.value, undefined, useInterfaces), - useInterfaces - ), - } - case '/cosmwasm.wasm.v1.PinCodesProposal': + type: "wasm/ClearAdminProposal", + value: ClearAdminProposal.toAmino(ClearAdminProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/cosmwasm.wasm.v1.PinCodesProposal": return { - type: 'wasm/PinCodesProposal', - value: PinCodesProposal.toAmino( - PinCodesProposal.decode(content.value, undefined, useInterfaces), - useInterfaces - ), - } - case '/cosmwasm.wasm.v1.UnpinCodesProposal': + type: "wasm/PinCodesProposal", + value: PinCodesProposal.toAmino(PinCodesProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/cosmwasm.wasm.v1.UnpinCodesProposal": return { - type: 'wasm/UnpinCodesProposal', - value: UnpinCodesProposal.toAmino( - UnpinCodesProposal.decode(content.value, undefined, useInterfaces), - useInterfaces - ), - } - case '/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal': + type: "wasm/UnpinCodesProposal", + value: UnpinCodesProposal.toAmino(UnpinCodesProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal": return { - type: 'wasm/UpdateInstantiateConfigProposal', - value: UpdateInstantiateConfigProposal.toAmino( - UpdateInstantiateConfigProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal': + type: "wasm/UpdateInstantiateConfigProposal", + value: UpdateInstantiateConfigProposal.toAmino(UpdateInstantiateConfigProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal": return { - type: 'wasm/StoreAndInstantiateContractProposal', - value: StoreAndInstantiateContractProposal.toAmino( - StoreAndInstantiateContractProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/ibc.core.client.v1.ClientUpdateProposal': + type: "wasm/StoreAndInstantiateContractProposal", + value: StoreAndInstantiateContractProposal.toAmino(StoreAndInstantiateContractProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/ibc.core.client.v1.ClientUpdateProposal": return { - type: 'cosmos-sdk/ClientUpdateProposal', - value: ClientUpdateProposal.toAmino( - ClientUpdateProposal.decode(content.value, undefined, useInterfaces), - useInterfaces - ), - } - case '/ibc.core.client.v1.UpgradeProposal': + type: "cosmos-sdk/ClientUpdateProposal", + value: ClientUpdateProposal.toAmino(ClientUpdateProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/ibc.core.client.v1.UpgradeProposal": return { - type: 'cosmos-sdk/UpgradeProposal', - value: UpgradeProposal.toAmino( - UpgradeProposal.decode(content.value, undefined, useInterfaces), - useInterfaces - ), - } - case '/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal': + type: "cosmos-sdk/UpgradeProposal", + value: UpgradeProposal.toAmino(UpgradeProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal": return { - type: 'osmosis/ReplaceMigrationRecordsProposal', - value: ReplaceMigrationRecordsProposal.toAmino( - ReplaceMigrationRecordsProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal': + type: "osmosis/ReplaceMigrationRecordsProposal", + value: ReplaceMigrationRecordsProposal.toAmino(ReplaceMigrationRecordsProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal": return { - type: 'osmosis/UpdateMigrationRecordsProposal', - value: UpdateMigrationRecordsProposal.toAmino( - UpdateMigrationRecordsProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal': + type: "osmosis/UpdateMigrationRecordsProposal", + value: UpdateMigrationRecordsProposal.toAmino(UpdateMigrationRecordsProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/osmosis.gamm.v1beta1.CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal": return { - type: 'osmosis/CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal', - value: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.toAmino( - CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal': + type: "osmosis/CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal", + value: CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.toAmino(CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/osmosis.gamm.v1beta1.SetScalingFactorControllerProposal": return { - type: 'osmosis/SetScalingFactorControllerProposal', - value: SetScalingFactorControllerProposal.toAmino( - SetScalingFactorControllerProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/osmosis.incentives.CreateGroupsProposal': + type: "osmosis/SetScalingFactorControllerProposal", + value: SetScalingFactorControllerProposal.toAmino(SetScalingFactorControllerProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/osmosis.incentives.CreateGroupsProposal": return { - type: 'osmosis/incentives/create-groups-proposal', - value: CreateGroupsProposal.toAmino( - CreateGroupsProposal.decode(content.value, undefined, useInterfaces), - useInterfaces - ), - } - case '/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal': + type: "osmosis/incentives/create-groups-proposal", + value: CreateGroupsProposal.toAmino(CreateGroupsProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal": return { - type: 'osmosis/ReplacePoolIncentivesProposal', - value: ReplacePoolIncentivesProposal.toAmino( - ReplacePoolIncentivesProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal': + type: "osmosis/ReplacePoolIncentivesProposal", + value: ReplacePoolIncentivesProposal.toAmino(ReplacePoolIncentivesProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal": return { - type: 'osmosis/UpdatePoolIncentivesProposal', - value: UpdatePoolIncentivesProposal.toAmino( - UpdatePoolIncentivesProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal': + type: "osmosis/UpdatePoolIncentivesProposal", + value: UpdatePoolIncentivesProposal.toAmino(UpdatePoolIncentivesProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/osmosis.protorev.v1beta1.SetProtoRevEnabledProposal": return { - type: 'osmosis/SetProtoRevEnabledProposal', - value: SetProtoRevEnabledProposal.toAmino( - SetProtoRevEnabledProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal': + type: "osmosis/SetProtoRevEnabledProposal", + value: SetProtoRevEnabledProposal.toAmino(SetProtoRevEnabledProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/osmosis.protorev.v1beta1.SetProtoRevAdminAccountProposal": return { - type: 'osmosis/SetProtoRevAdminAccountProposal', - value: SetProtoRevAdminAccountProposal.toAmino( - SetProtoRevAdminAccountProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal': + type: "osmosis/SetProtoRevAdminAccountProposal", + value: SetProtoRevAdminAccountProposal.toAmino(SetProtoRevAdminAccountProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal": return { - type: 'osmosis/set-superfluid-assets-proposal', - value: SetSuperfluidAssetsProposal.toAmino( - SetSuperfluidAssetsProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal': + type: "osmosis/set-superfluid-assets-proposal", + value: SetSuperfluidAssetsProposal.toAmino(SetSuperfluidAssetsProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal": return { - type: 'osmosis/del-superfluid-assets-proposal', - value: RemoveSuperfluidAssetsProposal.toAmino( - RemoveSuperfluidAssetsProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal': + type: "osmosis/del-superfluid-assets-proposal", + value: RemoveSuperfluidAssetsProposal.toAmino(RemoveSuperfluidAssetsProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal": return { - type: 'osmosis/update-unpool-whitelist', - value: UpdateUnpoolWhiteListProposal.toAmino( - UpdateUnpoolWhiteListProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/osmosis.txfees.v1beta1.UpdateFeeTokenProposal': + type: "osmosis/update-unpool-whitelist", + value: UpdateUnpoolWhiteListProposal.toAmino(UpdateUnpoolWhiteListProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/osmosis.txfees.v1beta1.UpdateFeeTokenProposal": return { - type: 'osmosis/UpdateFeeTokenProposal', - value: UpdateFeeTokenProposal.toAmino( - UpdateFeeTokenProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/publicawesome.stargaze.cron.v1.PromoteToPrivilegedContractProposal': + type: "osmosis/UpdateFeeTokenProposal", + value: UpdateFeeTokenProposal.toAmino(UpdateFeeTokenProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/publicawesome.stargaze.cron.v1.PromoteToPrivilegedContractProposal": return { - type: '/publicawesome.stargaze.cron.v1.PromoteToPrivilegedContractProposal', - value: PromoteToPrivilegedContractProposal.toAmino( - PromoteToPrivilegedContractProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/publicawesome.stargaze.cron.v1.DemotePrivilegedContractProposal': + type: "/publicawesome.stargaze.cron.v1.PromoteToPrivilegedContractProposal", + value: PromoteToPrivilegedContractProposal.toAmino(PromoteToPrivilegedContractProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/publicawesome.stargaze.cron.v1.DemotePrivilegedContractProposal": return { - type: '/publicawesome.stargaze.cron.v1.DemotePrivilegedContractProposal', - value: DemotePrivilegedContractProposal.toAmino( - DemotePrivilegedContractProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/publicawesome.stargaze.globalfee.v1.SetCodeAuthorizationProposal': + type: "/publicawesome.stargaze.cron.v1.DemotePrivilegedContractProposal", + value: DemotePrivilegedContractProposal.toAmino(DemotePrivilegedContractProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/publicawesome.stargaze.globalfee.v1.SetCodeAuthorizationProposal": return { - type: '/publicawesome.stargaze.globalfee.v1.SetCodeAuthorizationProposal', - value: SetCodeAuthorizationProposal.toAmino( - SetCodeAuthorizationProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/publicawesome.stargaze.globalfee.v1.RemoveCodeAuthorizationProposal': + type: "/publicawesome.stargaze.globalfee.v1.SetCodeAuthorizationProposal", + value: SetCodeAuthorizationProposal.toAmino(SetCodeAuthorizationProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/publicawesome.stargaze.globalfee.v1.RemoveCodeAuthorizationProposal": return { - type: '/publicawesome.stargaze.globalfee.v1.RemoveCodeAuthorizationProposal', - value: RemoveCodeAuthorizationProposal.toAmino( - RemoveCodeAuthorizationProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/publicawesome.stargaze.globalfee.v1.SetContractAuthorizationProposal': + type: "/publicawesome.stargaze.globalfee.v1.RemoveCodeAuthorizationProposal", + value: RemoveCodeAuthorizationProposal.toAmino(RemoveCodeAuthorizationProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/publicawesome.stargaze.globalfee.v1.SetContractAuthorizationProposal": return { - type: '/publicawesome.stargaze.globalfee.v1.SetContractAuthorizationProposal', - value: SetContractAuthorizationProposal.toAmino( - SetContractAuthorizationProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/publicawesome.stargaze.globalfee.v1.RemoveContractAuthorizationProposal': + type: "/publicawesome.stargaze.globalfee.v1.SetContractAuthorizationProposal", + value: SetContractAuthorizationProposal.toAmino(SetContractAuthorizationProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/publicawesome.stargaze.globalfee.v1.RemoveContractAuthorizationProposal": return { - type: '/publicawesome.stargaze.globalfee.v1.RemoveContractAuthorizationProposal', - value: RemoveContractAuthorizationProposal.toAmino( - RemoveContractAuthorizationProposal.decode( - content.value, - undefined, - useInterfaces - ), - useInterfaces - ), - } - case '/regen.ecocredit.marketplace.v1.AllowDenomProposal': + type: "/publicawesome.stargaze.globalfee.v1.RemoveContractAuthorizationProposal", + value: RemoveContractAuthorizationProposal.toAmino(RemoveContractAuthorizationProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/regen.ecocredit.marketplace.v1.AllowDenomProposal": return { - type: '/regen.ecocredit.marketplace.v1.AllowDenomProposal', - value: AllowDenomProposal.toAmino( - AllowDenomProposal.decode(content.value, undefined, useInterfaces), - useInterfaces - ), - } - case '/regen.ecocredit.v1.CreditTypeProposal': + type: "/regen.ecocredit.marketplace.v1.AllowDenomProposal", + value: AllowDenomProposal.toAmino(AllowDenomProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/regen.ecocredit.v1.CreditTypeProposal": return { - type: '/regen.ecocredit.v1.CreditTypeProposal', - value: CreditTypeProposal.toAmino( - CreditTypeProposal.decode(content.value, undefined, useInterfaces), - useInterfaces - ), - } + type: "/regen.ecocredit.v1.CreditTypeProposal", + value: CreditTypeProposal.toAmino(CreditTypeProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; default: - return Any.toAmino(content, useInterfaces) + return Any.toAmino(content, useInterfaces); } -} +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/neutron/client.ts b/packages/types/protobuf/codegen/neutron/client.ts index 1caf8781d..9d864d753 100644 --- a/packages/types/protobuf/codegen/neutron/client.ts +++ b/packages/types/protobuf/codegen/neutron/client.ts @@ -7,21 +7,24 @@ import * as neutronFeeburnerTxRegistry from "./feeburner/tx.registry"; import * as neutronFeerefunderTxRegistry from "./feerefunder/tx.registry"; import * as neutronInterchainqueriesTxRegistry from "./interchainqueries/tx.registry"; import * as neutronInterchaintxsV1TxRegistry from "./interchaintxs/v1/tx.registry"; +import * as neutronTransferV1TxRegistry from "./transfer/v1/tx.registry"; import * as neutronCronTxAmino from "./cron/tx.amino"; import * as neutronDexTxAmino from "./dex/tx.amino"; import * as neutronFeeburnerTxAmino from "./feeburner/tx.amino"; import * as neutronFeerefunderTxAmino from "./feerefunder/tx.amino"; import * as neutronInterchainqueriesTxAmino from "./interchainqueries/tx.amino"; import * as neutronInterchaintxsV1TxAmino from "./interchaintxs/v1/tx.amino"; +import * as neutronTransferV1TxAmino from "./transfer/v1/tx.amino"; export const neutronAminoConverters = { ...neutronCronTxAmino.AminoConverter, ...neutronDexTxAmino.AminoConverter, ...neutronFeeburnerTxAmino.AminoConverter, ...neutronFeerefunderTxAmino.AminoConverter, ...neutronInterchainqueriesTxAmino.AminoConverter, - ...neutronInterchaintxsV1TxAmino.AminoConverter + ...neutronInterchaintxsV1TxAmino.AminoConverter, + ...neutronTransferV1TxAmino.AminoConverter, }; -export const neutronProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...neutronCronTxRegistry.registry, ...neutronDexTxRegistry.registry, ...neutronFeeburnerTxRegistry.registry, ...neutronFeerefunderTxRegistry.registry, ...neutronInterchainqueriesTxRegistry.registry, ...neutronInterchaintxsV1TxRegistry.registry]; +export const neutronProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...neutronCronTxRegistry.registry, ...neutronDexTxRegistry.registry, ...neutronFeeburnerTxRegistry.registry, ...neutronFeerefunderTxRegistry.registry, ...neutronInterchainqueriesTxRegistry.registry, ...neutronInterchaintxsV1TxRegistry.registry, ...neutronTransferV1TxRegistry.registry]; export const getSigningNeutronClientOptions = ({ defaultTypes = defaultRegistryTypes }: { diff --git a/packages/types/protobuf/patches.diff b/packages/types/protobuf/patches.diff index 4b49c5ab2..b135b8c65 100644 --- a/packages/types/protobuf/patches.diff +++ b/packages/types/protobuf/patches.diff @@ -1,15 +1,13 @@ -diff --git b/packages/utils/protobuf/codegen/cosmos/authz/v1beta1/tx.ts a/packages/utils/protobuf/codegen/cosmos/authz/v1beta1/tx.ts -index c04740c22..98853e53d 100644 ---- b/packages/utils/protobuf/codegen/cosmos/authz/v1beta1/tx.ts -+++ a/packages/utils/protobuf/codegen/cosmos/authz/v1beta1/tx.ts -@@ -3,6 +3,7 @@ import { Grant, GrantAmino, GrantSDKType } from "./authz"; +diff --git b/packages/types/protobuf/codegen/cosmos/authz/v1beta1/tx.ts a/packages/types/protobuf/codegen/cosmos/authz/v1beta1/tx.ts +index c04740c22..63b9a7cb8 100644 +--- b/packages/types/protobuf/codegen/cosmos/authz/v1beta1/tx.ts ++++ a/packages/types/protobuf/codegen/cosmos/authz/v1beta1/tx.ts +@@ -1,4 +1,5 @@ + //@ts-nocheck ++import { aminoToRawProtobufMsg, rawProtobufMsgToAmino } from '../../../../utils' + import { Grant, GrantAmino, GrantSDKType } from "./authz"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; - import { bytesFromBase64, base64FromBytes } from "../../../helpers"; -+import { aminoToRawProtobufMsg, rawProtobufMsgToAmino } from '../../../../../messages/protobuf' - /** - * MsgGrant is a request type for Grant method. It declares authorization to the grantee - * on behalf of the granter with the provided expiration time. @@ -371,14 +372,14 @@ export const MsgExec = { if (object.grantee !== undefined && object.grantee !== null) { message.grantee = object.grantee; @@ -27,10 +25,10 @@ index c04740c22..98853e53d 100644 } else { obj.msgs = []; } -diff --git b/packages/utils/protobuf/codegen/cosmos/bank/v1beta1/bank.ts a/packages/utils/protobuf/codegen/cosmos/bank/v1beta1/bank.ts +diff --git b/packages/types/protobuf/codegen/cosmos/bank/v1beta1/bank.ts a/packages/types/protobuf/codegen/cosmos/bank/v1beta1/bank.ts index 9eb780900..70b01f2fc 100644 ---- b/packages/utils/protobuf/codegen/cosmos/bank/v1beta1/bank.ts -+++ a/packages/utils/protobuf/codegen/cosmos/bank/v1beta1/bank.ts +--- b/packages/types/protobuf/codegen/cosmos/bank/v1beta1/bank.ts ++++ a/packages/types/protobuf/codegen/cosmos/bank/v1beta1/bank.ts @@ -930,7 +930,9 @@ export const Metadata = { }, toAmino(message: Metadata, useInterfaces: boolean = false): MetadataAmino { @@ -57,12 +55,14 @@ index 9eb780900..70b01f2fc 100644 return obj; }, fromAminoMsg(object: MetadataAminoMsg): Metadata { -diff --git b/packages/utils/protobuf/codegen/cosmos/gov/v1/tx.ts a/packages/utils/protobuf/codegen/cosmos/gov/v1/tx.ts -index 6c5cc594d..99099f81a 100644 ---- b/packages/utils/protobuf/codegen/cosmos/gov/v1/tx.ts -+++ a/packages/utils/protobuf/codegen/cosmos/gov/v1/tx.ts -@@ -1,7 +1,7 @@ - //@ts-nocheck +diff --git b/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts a/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts +index 6c5cc594d..72e20f771 100644 +--- b/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts ++++ a/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts +@@ -1,7 +1,8 @@ +-//@ts-nocheck ++// @ts-nocheck ++import { aminoToRawProtobufMsg, rawProtobufMsgToAmino } from "../../../../utils"; import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import { VoteOption, WeightedVoteOption, WeightedVoteOptionAmino, WeightedVoteOptionSDKType, Params, ParamsAmino, ParamsSDKType, voteOptionFromJSON } from "./gov"; @@ -70,14 +70,6 @@ index 6c5cc594d..99099f81a 100644 import { Timestamp } from "../../../google/protobuf/timestamp"; import { MsgCreateAllianceProposal, MsgCreateAllianceProposalProtoMsg, MsgCreateAllianceProposalSDKType, MsgUpdateAllianceProposal, MsgUpdateAllianceProposalProtoMsg, MsgUpdateAllianceProposalSDKType, MsgDeleteAllianceProposal, MsgDeleteAllianceProposalProtoMsg, MsgDeleteAllianceProposalSDKType } from "../../../alliance/alliance/gov"; import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalSDKType, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg, CommunityPoolSpendProposalWithDepositSDKType } from "../../distribution/v1beta1/distribution"; -@@ -22,6 +22,7 @@ import { AllowDenomProposal, AllowDenomProposalProtoMsg, AllowDenomProposalSDKTy - import { CreditTypeProposal, CreditTypeProposalProtoMsg, CreditTypeProposalSDKType } from "../../../regen/ecocredit/v1/types"; - import { BinaryReader, BinaryWriter } from "../../../binary"; - import { toTimestamp, fromTimestamp } from "../../../helpers"; -+import { aminoToRawProtobufMsg, rawProtobufMsgToAmino } from "../../../../../messages"; - /** - * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary - * proposal Content. @@ -577,7 +578,7 @@ export const MsgSubmitProposal = { }, fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { @@ -87,20 +79,18 @@ index 6c5cc594d..99099f81a 100644 message.initialDeposit = object.initial_deposit?.map(e => Coin.fromAmino(e)) || []; if (object.proposer !== undefined && object.proposer !== null) { message.proposer = object.proposer; -@@ -598,10 +599,8 @@ export const MsgSubmitProposal = { +@@ -598,8 +599,8 @@ export const MsgSubmitProposal = { }, toAmino(message: MsgSubmitProposal, useInterfaces: boolean = false): MsgSubmitProposalAmino { const obj: any = {}; - if (message.messages) { - obj.messages = message.messages.map(e => e ? Any.toAmino(e, useInterfaces) : undefined); -- } else { -- obj.messages = []; + if (message.messages.length) { + obj.messages = message.messages.map(e => e ? rawProtobufMsgToAmino(e, false) : undefined); + } else { + obj.messages = []; } - if (message.initialDeposit) { - obj.initial_deposit = message.initialDeposit.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); -@@ -612,7 +611,9 @@ export const MsgSubmitProposal = { +@@ -612,7 +613,9 @@ export const MsgSubmitProposal = { obj.metadata = message.metadata; obj.title = message.title; obj.summary = message.summary; @@ -111,7 +101,7 @@ index 6c5cc594d..99099f81a 100644 return obj; }, fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { -@@ -911,7 +912,7 @@ export const MsgVote = { +@@ -911,7 +914,7 @@ export const MsgVote = { message.voter = object.voter; } if (object.option !== undefined && object.option !== null) { @@ -120,10 +110,10 @@ index 6c5cc594d..99099f81a 100644 } if (object.metadata !== undefined && object.metadata !== null) { message.metadata = object.metadata; -diff --git b/packages/utils/protobuf/codegen/cosmos/gov/v1beta1/tx.ts a/packages/utils/protobuf/codegen/cosmos/gov/v1beta1/tx.ts +diff --git b/packages/types/protobuf/codegen/cosmos/gov/v1beta1/tx.ts a/packages/types/protobuf/codegen/cosmos/gov/v1beta1/tx.ts index 0a7aa8cc5..2451cbfd8 100644 ---- b/packages/utils/protobuf/codegen/cosmos/gov/v1beta1/tx.ts -+++ a/packages/utils/protobuf/codegen/cosmos/gov/v1beta1/tx.ts +--- b/packages/types/protobuf/codegen/cosmos/gov/v1beta1/tx.ts ++++ a/packages/types/protobuf/codegen/cosmos/gov/v1beta1/tx.ts @@ -1,7 +1,7 @@ //@ts-nocheck import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; @@ -142,10 +132,10 @@ index 0a7aa8cc5..2451cbfd8 100644 } return message; }, -diff --git b/packages/utils/protobuf/codegen/cosmwasm/wasm/v1/tx.ts a/packages/utils/protobuf/codegen/cosmwasm/wasm/v1/tx.ts +diff --git b/packages/types/protobuf/codegen/cosmwasm/wasm/v1/tx.ts a/packages/types/protobuf/codegen/cosmwasm/wasm/v1/tx.ts index 11d5dba92..e5ef23ea1 100644 ---- b/packages/utils/protobuf/codegen/cosmwasm/wasm/v1/tx.ts -+++ a/packages/utils/protobuf/codegen/cosmwasm/wasm/v1/tx.ts +--- b/packages/types/protobuf/codegen/cosmwasm/wasm/v1/tx.ts ++++ a/packages/types/protobuf/codegen/cosmwasm/wasm/v1/tx.ts @@ -1770,7 +1770,9 @@ export const MsgInstantiateContract2 = { obj.funds = []; } @@ -157,10 +147,10 @@ index 11d5dba92..e5ef23ea1 100644 return obj; }, fromAminoMsg(object: MsgInstantiateContract2AminoMsg): MsgInstantiateContract2 { -diff --git b/packages/utils/protobuf/codegen/neutron/client.ts a/packages/utils/protobuf/codegen/neutron/client.ts +diff --git b/packages/types/protobuf/codegen/neutron/client.ts a/packages/types/protobuf/codegen/neutron/client.ts index 1caf8781d..9d864d753 100644 ---- b/packages/utils/protobuf/codegen/neutron/client.ts -+++ a/packages/utils/protobuf/codegen/neutron/client.ts +--- b/packages/types/protobuf/codegen/neutron/client.ts ++++ a/packages/types/protobuf/codegen/neutron/client.ts @@ -7,21 +7,24 @@ import * as neutronFeeburnerTxRegistry from "./feeburner/tx.registry"; import * as neutronFeerefunderTxRegistry from "./feerefunder/tx.registry"; import * as neutronInterchainqueriesTxRegistry from "./interchainqueries/tx.registry"; @@ -188,10 +178,10 @@ index 1caf8781d..9d864d753 100644 export const getSigningNeutronClientOptions = ({ defaultTypes = defaultRegistryTypes }: { -diff --git b/packages/utils/protobuf/codegen/regen/data/v1/tx.ts a/packages/utils/protobuf/codegen/regen/data/v1/tx.ts +diff --git b/packages/types/protobuf/codegen/regen/data/v1/tx.ts a/packages/types/protobuf/codegen/regen/data/v1/tx.ts index 640c2bcef..5bd95374c 100644 ---- b/packages/utils/protobuf/codegen/regen/data/v1/tx.ts -+++ a/packages/utils/protobuf/codegen/regen/data/v1/tx.ts +--- b/packages/types/protobuf/codegen/regen/data/v1/tx.ts ++++ a/packages/types/protobuf/codegen/regen/data/v1/tx.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { ContentHash, ContentHashAmino, ContentHashSDKType, ContentHash_Graph } from "./types"; @@ -199,10 +189,10 @@ index 640c2bcef..5bd95374c 100644 import { Timestamp } from "../../../google/protobuf/timestamp"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { toTimestamp, fromTimestamp } from "../../../helpers"; -diff --git b/packages/utils/protobuf/codegen/regen/data/v2/tx.ts a/packages/utils/protobuf/codegen/regen/data/v2/tx.ts +diff --git b/packages/types/protobuf/codegen/regen/data/v2/tx.ts a/packages/types/protobuf/codegen/regen/data/v2/tx.ts index fe58afb74..f0e94453b 100644 ---- b/packages/utils/protobuf/codegen/regen/data/v2/tx.ts -+++ a/packages/utils/protobuf/codegen/regen/data/v2/tx.ts +--- b/packages/types/protobuf/codegen/regen/data/v2/tx.ts ++++ a/packages/types/protobuf/codegen/regen/data/v2/tx.ts @@ -1,5 +1,5 @@ //@ts-nocheck -import { ContentHash, ContentHashAmino, ContentHashSDKType, ContentHash_Graph } from "./types"; From 3d0384aa8a9a0ff958df7148a5f1b2ffa9132454 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 4 Apr 2024 20:21:17 -0700 Subject: [PATCH 098/438] fix v1beta1 gov prop decoding --- packages/state/recoil/selectors/chain.ts | 47 ++++++++++++------- .../stateful/server/makeGetGovStaticProps.ts | 13 +++-- packages/utils/messages/protobuf.ts | 1 + packages/utils/pagination.ts | 28 ++++++----- 4 files changed, 55 insertions(+), 34 deletions(-) diff --git a/packages/state/recoil/selectors/chain.ts b/packages/state/recoil/selectors/chain.ts index bfea27eb4..11e1318ed 100644 --- a/packages/state/recoil/selectors/chain.ts +++ b/packages/state/recoil/selectors/chain.ts @@ -759,7 +759,7 @@ export const govProposalsSelector = selectorFamily< v1Beta1Proposals = indexerProposals.flatMap( ({ data }): ProposalV1Beta1 | [] => { try { - return ProposalV1Beta1.decode(fromBase64(data)) + return ProposalV1Beta1.decode(fromBase64(data), undefined, true) } catch { return [] } @@ -824,22 +824,26 @@ export const govProposalsSelector = selectorFamily< pagination: undefined, }, 'proposals', + true, true ) total = v1Beta1Proposals.length } else { - const response = await client.gov.v1beta1.proposals({ - proposalStatus: status, - voter: '', - depositor: '', - pagination: { - key: new Uint8Array(), - offset: BigInt(offset || 0), - limit: BigInt(limit || 0), - countTotal: true, - reverse: true, + const response = await client.gov.v1beta1.proposals( + { + proposalStatus: status, + voter: '', + depositor: '', + pagination: { + key: new Uint8Array(), + offset: BigInt(offset || 0), + limit: BigInt(limit || 0), + countTotal: true, + reverse: true, + }, }, - }) + true + ) v1Beta1Proposals = response.proposals total = Number(response.pagination?.total || 0) } @@ -911,7 +915,11 @@ export const govProposalSelector = selectorFamily< return await decodeGovProposal({ version: GovProposalVersion.V1_BETA_1, id: BigInt(proposalId), - proposal: ProposalV1Beta1.decode(fromBase64(indexerProposal.data)), + proposal: ProposalV1Beta1.decode( + fromBase64(indexerProposal.data), + undefined, + true + ), }) } } @@ -933,7 +941,7 @@ export const govProposalSelector = selectorFamily< return await decodeGovProposal({ version: GovProposalVersion.V1, id: BigInt(proposalId), - proposal: proposal, + proposal, }) } catch (err) { // Fallback to v1beta1 query if v1 not supported. @@ -948,9 +956,12 @@ export const govProposalSelector = selectorFamily< } const proposal = ( - await client.gov.v1beta1.proposal({ - proposalId: BigInt(proposalId), - }) + await client.gov.v1beta1.proposal( + { + proposalId: BigInt(proposalId), + }, + true + ) ).proposal if (!proposal) { throw new Error('Proposal not found') @@ -959,7 +970,7 @@ export const govProposalSelector = selectorFamily< return await decodeGovProposal({ version: GovProposalVersion.V1_BETA_1, id: BigInt(proposalId), - proposal: proposal, + proposal, }) }, }) diff --git a/packages/stateful/server/makeGetGovStaticProps.ts b/packages/stateful/server/makeGetGovStaticProps.ts index b82ae09c0..d1febf824 100644 --- a/packages/stateful/server/makeGetGovStaticProps.ts +++ b/packages/stateful/server/makeGetGovStaticProps.ts @@ -237,7 +237,9 @@ export const makeGetGovProposalStaticProps = ({ version: GovProposalVersion.V1_BETA_1, id: BigInt(proposalId), proposal: ProposalV1Beta1.decode( - fromBase64(indexerProposal.data) + fromBase64(indexerProposal.data), + undefined, + true ), }) } @@ -281,9 +283,12 @@ export const makeGetGovProposalStaticProps = ({ if (!proposal) { const proposalV1Beta1 = ( - await client.gov.v1beta1.proposal({ - proposalId: BigInt(proposalId), - }) + await client.gov.v1beta1.proposal( + { + proposalId: BigInt(proposalId), + }, + true + ) ).proposal if (!proposalV1Beta1) { throw new Error('NOT_FOUND') diff --git a/packages/utils/messages/protobuf.ts b/packages/utils/messages/protobuf.ts index b51b323c3..7d846e95e 100644 --- a/packages/utils/messages/protobuf.ts +++ b/packages/utils/messages/protobuf.ts @@ -48,6 +48,7 @@ export const decodeGovProposal = async ( if (govProposal.version === GovProposalVersion.V1_BETA_1) { let title = govProposal.proposal.content?.title || '' let description = govProposal.proposal.content?.description || '' + // If content not decoded and stuck as Any, decode as TextProposal to get // the title and description. if ( diff --git a/packages/utils/pagination.ts b/packages/utils/pagination.ts index 61658e65e..7f02dd312 100644 --- a/packages/utils/pagination.ts +++ b/packages/utils/pagination.ts @@ -8,26 +8,30 @@ export const getAllRpcResponse = async < R extends { pagination?: PageResponse; [key: string]: any }, K extends keyof R >( - queryFn: (params: P) => Promise, + queryFn: (params: P, useInterfaces?: boolean) => Promise, params: P, key: K, - reverse = false + reverse = false, + useInterfaces = false ): Promise => { let pagination: Partial | undefined const data = [] as any[] do { - const response = await queryFn({ - ...params, - pagination: { - key: new Uint8Array(), - ...pagination, - reverse, - // Get all. - offset: 0n, - limit: BigInt(Number.MAX_SAFE_INTEGER), + const response = await queryFn( + { + ...params, + pagination: { + key: new Uint8Array(), + ...pagination, + reverse, + // Get all. + offset: 0n, + limit: BigInt(Number.MAX_SAFE_INTEGER), + }, }, - }) + useInterfaces + ) pagination = response.pagination?.nextKey?.length ? { From d8ac389977e220deb7feb45e1c15ae597f216c19 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 5 Apr 2024 10:50:29 -0700 Subject: [PATCH 099/438] fixed gov proposal total and deposit period loading --- packages/state/recoil/selectors/chain.ts | 84 +++++++++++++------ .../components/gov/GovProposalList.tsx | 11 ++- 2 files changed, 67 insertions(+), 28 deletions(-) diff --git a/packages/state/recoil/selectors/chain.ts b/packages/state/recoil/selectors/chain.ts index 11e1318ed..8bfd5eca8 100644 --- a/packages/state/recoil/selectors/chain.ts +++ b/packages/state/recoil/selectors/chain.ts @@ -729,42 +729,76 @@ export const govProposalsSelector = selectorFamily< let total = 0 // Try to load from indexer first. - const indexerProposals: { - id: string - data: string - }[] = - get( - queryGenericIndexerSelector({ - chainId, - formula: 'gov/reverseProposals', - args: { - limit, - offset, - }, - }) - )?.proposals ?? [] + const indexerProposals: + | { + proposals: { + id: string + data: string + }[] + total: number + } + | undefined = get( + queryGenericIndexerSelector({ + chainId, + formula: 'gov/reverseProposals', + args: { + limit, + offset, + }, + }) + ) - if (indexerProposals.length) { + if (indexerProposals?.proposals.length) { if (supportsV1Gov) { - v1Proposals = indexerProposals.flatMap( + v1Proposals = indexerProposals.proposals.flatMap( ({ data }): ProposalV1 | [] => { try { - return ProposalV1.decode(fromBase64(data)) - } catch { - return [] - } + const proposal = ProposalV1.decode(fromBase64(data)) + + if ( + status === ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED || + proposal.status === status + ) { + return proposal + } + } catch {} + + return [] } ) + + if (status === ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED) { + total = indexerProposals.total + } else { + total = v1Proposals.length + } } else { - v1Beta1Proposals = indexerProposals.flatMap( + v1Beta1Proposals = indexerProposals.proposals.flatMap( ({ data }): ProposalV1Beta1 | [] => { try { - return ProposalV1Beta1.decode(fromBase64(data), undefined, true) - } catch { - return [] - } + const proposal = ProposalV1Beta1.decode( + fromBase64(data), + undefined, + true + ) + + if ( + status === ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED || + proposal.status === status + ) { + return proposal + } + } catch {} + + return [] } ) + + if (status === ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED) { + total = indexerProposals.total + } else { + total = v1Beta1Proposals.length + } } // Fallback to querying chain if indexer failed. diff --git a/packages/stateful/components/gov/GovProposalList.tsx b/packages/stateful/components/gov/GovProposalList.tsx index 17395f9e3..7f466effb 100644 --- a/packages/stateful/components/gov/GovProposalList.tsx +++ b/packages/stateful/components/gov/GovProposalList.tsx @@ -148,9 +148,14 @@ export const GovProposalList = () => { (a.proposal.proposal.depositEndTime ?? new Date(0)).getTime() ) - const historyCount = loadingAllGovProposals.loading - ? 0 - : loadingAllGovProposals.data.total - openProposals.length + const historyCount = + loadingAllGovProposals.loading || + openGovProposalsVotingPeriod.loading || + govProposalsDepositPeriod.loading + ? 0 + : loadingAllGovProposals.data.total - + openGovProposalsVotingPeriod.data.total - + govProposalsDepositPeriod.data.total return ( Date: Fri, 5 Apr 2024 23:40:16 -0700 Subject: [PATCH 100/438] standardized color of voting power displays and improved fonts --- .../ProfileCardMemberInfo/ProfileCardMemberInfo.tsx | 6 +++--- .../components/ProfileCardMemberInfoTokens.tsx | 2 +- .../stateless/components/profile/ProfileCantVoteCard.tsx | 2 +- packages/stateless/components/profile/ProfileVoteCard.tsx | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/ProfileCardMemberInfo/ProfileCardMemberInfo.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/ProfileCardMemberInfo/ProfileCardMemberInfo.tsx index 7e76b83a7..825940c6c 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/ProfileCardMemberInfo/ProfileCardMemberInfo.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/ProfileCardMemberInfo/ProfileCardMemberInfo.tsx @@ -18,11 +18,11 @@ export const ProfileCardMemberInfo = ({ const { t } = useTranslation() return votingPower.loading || votingPower.data > 0 ? ( -
+

{t('title.votingPower')}

@@ -30,7 +30,7 @@ export const ProfileCardMemberInfo = ({

) : ( -

+

{t('info.membershipDaoNotMemberInfo', { daoName, context: cantVoteOnProposal ? 'proposal' : 'dao', diff --git a/packages/stateful/voting-module-adapter/components/ProfileCardMemberInfoTokens.tsx b/packages/stateful/voting-module-adapter/components/ProfileCardMemberInfoTokens.tsx index 89a74c94d..a01fdbe4e 100644 --- a/packages/stateful/voting-module-adapter/components/ProfileCardMemberInfoTokens.tsx +++ b/packages/stateful/voting-module-adapter/components/ProfileCardMemberInfoTokens.tsx @@ -210,7 +210,7 @@ export const ProfileCardMemberInfoTokens = ({ 'text-right font-mono', loadingVotingPower.loading ? 'animate-pulse text-text-tertiary' - : 'text-text-primary' + : 'text-text-brand-secondary' )} > {loadingVotingPower.loading diff --git a/packages/stateless/components/profile/ProfileCantVoteCard.tsx b/packages/stateless/components/profile/ProfileCantVoteCard.tsx index 8d43d6cdd..1792276a4 100644 --- a/packages/stateless/components/profile/ProfileCantVoteCard.tsx +++ b/packages/stateless/components/profile/ProfileCantVoteCard.tsx @@ -55,7 +55,7 @@ export const ProfileCantVoteCard = ({ />

-

0%

+

0%

diff --git a/packages/stateless/components/profile/ProfileVoteCard.tsx b/packages/stateless/components/profile/ProfileVoteCard.tsx index 3cb3fa932..ba6781ec2 100644 --- a/packages/stateless/components/profile/ProfileVoteCard.tsx +++ b/packages/stateless/components/profile/ProfileVoteCard.tsx @@ -47,7 +47,7 @@ export const ProfileVoteCard = ({ />
-

+

{formatPercentOf100(votingPower)}

From 4a15253dadd58d5c27ba5664256258693c83ed35 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 2 Apr 2024 18:22:36 -0700 Subject: [PATCH 101/438] added copy proposal draft to gov UI --- .../components/gov/CreateGovProposal.tsx | 11 +- .../components/gov/NewGovProposal.tsx | 117 ++++++++++++++++-- 2 files changed, 116 insertions(+), 12 deletions(-) diff --git a/packages/stateful/components/gov/CreateGovProposal.tsx b/packages/stateful/components/gov/CreateGovProposal.tsx index b43ca3708..aa7278b8a 100644 --- a/packages/stateful/components/gov/CreateGovProposal.tsx +++ b/packages/stateful/components/gov/CreateGovProposal.tsx @@ -1,3 +1,4 @@ +import { useRef } from 'react' import { useTranslation } from 'react-i18next' import { CreateProposal, PageLoader } from '@dao-dao/stateless' @@ -11,6 +12,9 @@ import { NewGovProposal } from './NewGovProposal' export const CreateGovProposal = () => { const { t } = useTranslation() + const clearRef = useRef(() => {}) + const copyDraftLinkRef = useRef(() => {}) + return ( <> { /> clearRef.current()} + copyDraftLink={() => copyDraftLinkRef.current()} newProposal={ }> - + } diff --git a/packages/stateful/components/gov/NewGovProposal.tsx b/packages/stateful/components/gov/NewGovProposal.tsx index d09b8d778..e76550243 100644 --- a/packages/stateful/components/gov/NewGovProposal.tsx +++ b/packages/stateful/components/gov/NewGovProposal.tsx @@ -14,7 +14,13 @@ import clsx from 'clsx' import Fuse from 'fuse.js' import cloneDeep from 'lodash.clonedeep' import { useRouter } from 'next/router' -import { useCallback, useEffect, useRef, useState } from 'react' +import { + MutableRefObject, + useCallback, + useEffect, + useRef, + useState, +} from 'react' import { FormProvider, SubmitErrorHandler, @@ -66,6 +72,7 @@ import { MsgSubmitProposal as MsgSubmitProposalV1Beta1 } from '@dao-dao/types/pr import { Any } from '@dao-dao/types/protobuf/codegen/google/protobuf/any' import { CHAIN_GAS_MULTIPLIER, + SITE_URL, dateToWdhms, formatDateTime, formatPercentOf100, @@ -92,8 +99,14 @@ enum ProposeSubmitValue { Submit = 'Submit', } -export const NewGovProposal = () => { +export type NewGovProposalProps = Pick< + InnerNewGovProposalProps, + 'clearRef' | 'copyDraftLinkRef' +> + +export const NewGovProposal = (innerProps: NewGovProposalProps) => { const { t } = useTranslation() + const router = useRouter() const chainContext = useConfiguredChainContext() const { address: walletAddress = '' } = useWallet() @@ -112,26 +125,95 @@ export const NewGovProposal = () => { })! const defaults = governanceProposalAction.useDefaults() - return !defaults ? ( + const localStorageKey = `gov_${chainContext.chainId}` + const latestProposalSave = useRecoilValue( + latestProposalSaveAtom(localStorageKey) + ) + + // Set once prefill has been assessed, indicating NewProposal can load now. + const [prefillChecked, setPrefillChecked] = useState(false) + const [usePrefill, setUsePrefill] = useState(false) + // Prefill form with data from parameter once ready. + useEffect(() => { + if (!router.isReady || prefillChecked) { + return + } + + try { + const potentialDefaultValue = router.query.prefill + if (typeof potentialDefaultValue !== 'string') { + return + } + + const prefillData = JSON.parse(potentialDefaultValue) + if ( + prefillData.constructor.name === 'Object' && + 'chainId' in prefillData + ) { + setUsePrefill(true) + } + // If failed to parse, do nothing. + } catch (error) { + console.error(error) + } finally { + setPrefillChecked(true) + } + }, [router.query.prefill, router.isReady, prefillChecked]) + + return !defaults || !prefillChecked ? ( ) : defaults instanceof Error ? ( ) : ( ) } type InnerNewGovProposalProps = { + /** + * The local storage key to use for saving the current form. + */ + localStorageKey: string + /** + * The default values to use form the form on initial load, taking into + * account save state and prefill. + */ defaults: GovernanceProposalActionData + /** + * Used to reset the form back to default. + */ + realDefaults: GovernanceProposalActionData + /** + * The governance proposal creation action. + */ action: Action + /** + * A function ref that the parent uses to clear the form. + */ + clearRef: MutableRefObject<() => void> + /** + * A function ref that copies a link to the current draft. + */ + copyDraftLinkRef: MutableRefObject<() => void> } const InnerNewGovProposal = ({ + localStorageKey, defaults, + realDefaults, action, + clearRef, + copyDraftLinkRef, }: InnerNewGovProposalProps) => { const { t } = useTranslation() const router = useRouter() @@ -156,8 +238,7 @@ const InnerNewGovProposal = ({ const [govProposalCreatedCardProps, setGovProposalCreatedCardProps] = useRecoilState(govProposalCreatedCardPropsAtom) - const localStorageKey = `gov_${chainContext.chainId}` - const [latestProposalSave, setLatestProposalSave] = useRecoilState( + const setLatestProposalSave = useSetRecoilState( latestProposalSaveAtom(localStorageKey) ) @@ -165,10 +246,7 @@ const InnerNewGovProposal = ({ action.useTransformToCosmos() const formMethods = useForm({ mode: 'onChange', - defaultValues: { - ...defaults, - ...cloneDeep(latestProposalSave), - }, + defaultValues: defaults, }) const { handleSubmit, @@ -405,6 +483,23 @@ const InnerNewGovProposal = ({ ) const proposalData = watch() + // Reset form to defaults and clear latest proposal save. + clearRef.current = () => { + formMethods.reset(cloneDeep(realDefaults)) + setLatestProposalSave({}) + } + + // Copy link to current draft. + copyDraftLinkRef.current = () => { + navigator.clipboard.writeText( + SITE_URL + + getGovProposalPath(chainContext.config.name, 'create', { + prefill: JSON.stringify(proposalData), + }) + ) + toast.success(t('info.copiedLinkToClipboard')) + } + const saveQueuedRef = useRef(false) const saveLatestProposalRef = useRef(() => {}) saveLatestProposalRef.current = () => @@ -453,7 +548,7 @@ const InnerNewGovProposal = ({ toast.error(t('error.loadingData')) } // Deep clone to prevent values from being readOnly. - reset(draft.proposal.data) + reset(cloneDeep(draft.proposal.data)) setDraftIndex(loadIndex) }, [draftIndex, drafts, reset, t] From 192767113e736fe7818da617bb252411fd31e946 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sat, 6 Apr 2024 15:36:02 -0700 Subject: [PATCH 102/438] use base64 encoding for prefill links --- .../dao_governance/SetUpApprover/index.tsx | 12 ++-- .../dao_governance/UpgradeV1ToV2/index.tsx | 4 +- .../actions/core/nfts/TransferNft/index.tsx | 8 +-- .../core/smart_contracting/Execute/index.tsx | 8 +-- .../smart_contracting/Instantiate2/index.tsx | 4 +- .../core/treasury/ManageVesting/index.tsx | 10 ++-- .../token_swap/PerformTokenSwap/index.tsx | 8 +-- .../stateful/components/dao/CreateDaoForm.tsx | 4 +- .../components/dao/CreateDaoProposal.tsx | 51 ++++++++++------ .../components/gov/NewGovProposal.tsx | 59 +++++++++++++------ .../creators/MembershipBased/mutate.ts | 4 +- packages/stateful/creators/NftBased/mutate.ts | 4 +- .../stateful/creators/TokenBased/mutate.ts | 4 +- .../daoCreation/getInstantiateInfo.ts | 6 +- .../daoCreation/getInstantiateInfo.ts | 6 +- .../components/StakingModal.tsx | 4 +- .../dao/create/pages/CreateDaoReview.tsx | 8 +-- packages/utils/contracts.ts | 4 +- packages/utils/messages/cw.ts | 16 +++-- packages/utils/messages/encoding.ts | 15 +++-- 20 files changed, 141 insertions(+), 98 deletions(-) diff --git a/packages/stateful/actions/core/dao_governance/SetUpApprover/index.tsx b/packages/stateful/actions/core/dao_governance/SetUpApprover/index.tsx index c9771cf7f..3d24f25f8 100644 --- a/packages/stateful/actions/core/dao_governance/SetUpApprover/index.tsx +++ b/packages/stateful/actions/core/dao_governance/SetUpApprover/index.tsx @@ -26,10 +26,10 @@ import { InstantiateMsg as DaoPreProposeApproverInstantiateMsg } from '@dao-dao/ import { InstantiateMsg as DaoProposalSingleInstantiateMsg } from '@dao-dao/types/contracts/DaoProposalSingle.v2' import { DaoProposalSingleAdapterId, - encodeMessageAsBase64, + decodeJsonFromBase64, + encodeJsonToBase64, makeWasmMessage, objectMatchesStructure, - parseEncodedMessage, } from '@dao-dao/utils' import { EntityDisplay } from '../../../../components/EntityDisplay' @@ -82,7 +82,7 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( } } - const parsedMsg = parseEncodedMessage(info.msg) + const parsedMsg = decodeJsonFromBase64(info.msg) if ( !info.label.endsWith(`${DaoProposalSingleAdapterId}_approver`) || !objectMatchesStructure(parsedMsg, { @@ -103,7 +103,7 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( } } - const parsedPreProposeMsg = parseEncodedMessage( + const parsedPreProposeMsg = decodeJsonFromBase64( parsedMsg.pre_propose_info.module_may_propose.info.msg ) if ( @@ -218,7 +218,7 @@ export const makeSetUpApproverAction: ActionMaker = ({ admin: { core_module: {} }, code_id: chainContext.config.codeIds.DaoProposalSingle, label: `DAO_${context.info.name.trim()}_${DaoProposalSingleAdapterId}_approver`, - msg: encodeMessageAsBase64({ + msg: encodeJsonToBase64({ threshold: config.threshold, allow_revoting: config.allow_revoting, close_proposal_on_execution_failure: @@ -238,7 +238,7 @@ export const makeSetUpApproverAction: ActionMaker = ({ admin: { core_module: {} }, code_id: chainContext.config.codeIds.DaoPreProposeApprover, label: `DAO_${context.info.name.trim()}_pre-propose${DaoProposalSingleAdapterId}_approver`, - msg: encodeMessageAsBase64({ + msg: encodeJsonToBase64({ pre_propose_approval_contract: preProposeApprovalContract, } as DaoPreProposeApproverInstantiateMsg), funds: [], diff --git a/packages/stateful/actions/core/dao_governance/UpgradeV1ToV2/index.tsx b/packages/stateful/actions/core/dao_governance/UpgradeV1ToV2/index.tsx index de43a8ee2..1f86feb58 100644 --- a/packages/stateful/actions/core/dao_governance/UpgradeV1ToV2/index.tsx +++ b/packages/stateful/actions/core/dao_governance/UpgradeV1ToV2/index.tsx @@ -27,7 +27,7 @@ import { } from '@dao-dao/types' import { PreProposeInfo } from '@dao-dao/types/contracts/DaoProposalSingle.v2' import { - encodeMessageAsBase64, + encodeJsonToBase64, makeWasmMessage, objectMatchesStructure, } from '@dao-dao/utils' @@ -286,7 +286,7 @@ export const makeUpgradeV1ToV2Action: ActionMaker = ({ DaoProposalSingleAdapter.id }`, funds: [], - msg: encodeMessageAsBase64({ + msg: encodeJsonToBase64({ deposit_info: depositInfo ? { amount: depositInfo.amount, diff --git a/packages/stateful/actions/core/nfts/TransferNft/index.tsx b/packages/stateful/actions/core/nfts/TransferNft/index.tsx index 381b573d9..70540e57e 100644 --- a/packages/stateful/actions/core/nfts/TransferNft/index.tsx +++ b/packages/stateful/actions/core/nfts/TransferNft/index.tsx @@ -16,12 +16,12 @@ import { } from '@dao-dao/types' import { combineLoadingDataWithErrors, + decodeJsonFromBase64, decodePolytoneExecuteMsg, - encodeMessageAsBase64, + encodeJsonToBase64, makeWasmMessage, maybeMakePolytoneExecuteMessage, objectMatchesStructure, - parseEncodedMessage, } from '@dao-dao/utils' import { AddressInput, NftSelectionModal } from '../../../../components' @@ -78,7 +78,7 @@ const useTransformToCosmos: UseTransformToCosmos = () => { ? { send_nft: { contract: recipient, - msg: encodeMessageAsBase64(smartContractMsg), + msg: encodeJsonToBase64(smartContractMsg), token_id: tokenId, }, } @@ -157,7 +157,7 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( executeSmartContract: true, smartContractMsg: JSON.stringify( - parseEncodedMessage(msg.wasm.execute.msg.send_nft.msg), + decodeJsonFromBase64(msg.wasm.execute.msg.send_nft.msg), null, 2 ), diff --git a/packages/stateful/actions/core/smart_contracting/Execute/index.tsx b/packages/stateful/actions/core/smart_contracting/Execute/index.tsx index fa303df6d..d08caddbd 100644 --- a/packages/stateful/actions/core/smart_contracting/Execute/index.tsx +++ b/packages/stateful/actions/core/smart_contracting/Execute/index.tsx @@ -26,12 +26,12 @@ import { convertDenomToMicroDenomStringWithDecimals, convertDenomToMicroDenomWithDecimals, convertMicroDenomToDenomWithDecimals, + decodeJsonFromBase64, decodePolytoneExecuteMsg, - encodeMessageAsBase64, + encodeJsonToBase64, makeWasmMessage, maybeMakePolytoneExecuteMessage, objectMatchesStructure, - parseEncodedMessage, } from '@dao-dao/utils' import { useTokenBalances } from '../../../hooks' @@ -108,7 +108,7 @@ const useTransformToCosmos: UseTransformToCosmos = () => { fundsTokens[0]!.decimals ), contract: address, - msg: encodeMessageAsBase64(msg), + msg: encodeJsonToBase64(msg), }, }, }, @@ -221,7 +221,7 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( : msg.wasm.execute.contract_addr, message: JSON.stringify( isCw20 - ? parseEncodedMessage(msg.wasm.execute.msg.send.msg) + ? decodeJsonFromBase64(msg.wasm.execute.msg.send.msg) : msg.wasm.execute.msg, undefined, 2 diff --git a/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx b/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx index 22a5514c7..901515e81 100644 --- a/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx +++ b/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx @@ -27,6 +27,7 @@ import { MsgInstantiateContract2 } from '@dao-dao/types/protobuf/codegen/cosmwas import { convertDenomToMicroDenomStringWithDecimals, convertMicroDenomToDenomWithDecimals, + decodeJsonFromBase64, decodePolytoneExecuteMsg, getAccountAddress, getChainAddressForActionOptions, @@ -35,7 +36,6 @@ import { maybeGetChainForChainId, maybeMakePolytoneExecuteMessage, objectMatchesStructure, - parseEncodedMessage, } from '@dao-dao/utils' import { useTokenBalances } from '../../../hooks' @@ -225,7 +225,7 @@ export const makeInstantiate2Action: ActionMaker = ( admin: msg.stargate.value.admin, code_id: Number(msg.stargate.value.codeId), label: msg.stargate.value.label, - msg: parseEncodedMessage(toBase64(msg.stargate.value.msg)), + msg: decodeJsonFromBase64(toBase64(msg.stargate.value.msg)), funds: msg.stargate.value.funds, fix_msg: msg.stargate.value.fixMsg, salt: fromUtf8(msg.stargate.value.salt), diff --git a/packages/stateful/actions/core/treasury/ManageVesting/index.tsx b/packages/stateful/actions/core/treasury/ManageVesting/index.tsx index e666ab491..82ab1036c 100644 --- a/packages/stateful/actions/core/treasury/ManageVesting/index.tsx +++ b/packages/stateful/actions/core/treasury/ManageVesting/index.tsx @@ -50,8 +50,9 @@ import { convertMicroDenomToDenomWithDecimals, convertSecondsToDurationWithUnits, decodeCw1WhitelistExecuteMsg, + decodeJsonFromBase64, decodePolytoneExecuteMsg, - encodeMessageAsBase64, + encodeJsonToBase64, getChainAddressForActionOptions, getDisplayNameForChainId, getNativeTokenForChainId, @@ -59,7 +60,6 @@ import { makeWasmMessage, maybeMakePolytoneExecuteMessage, objectMatchesStructure, - parseEncodedMessage, } from '@dao-dao/utils' import { @@ -703,7 +703,7 @@ export const makeManageVestingAction: ActionMaker = ( send: { amount: BigInt(total).toString(), contract: vestingSource.factory, - msg: encodeMessageAsBase64({ + msg: encodeJsonToBase64({ instantiate_payroll_contract: msg, }), }, @@ -874,7 +874,7 @@ export const makeManageVestingAction: ActionMaker = ( }, }) && objectMatchesStructure( - parseEncodedMessage(msg.wasm.execute.msg.send.msg), + decodeJsonFromBase64(msg.wasm.execute.msg.send.msg), { instantiate_payroll_contract: instantiateStructure, } @@ -934,7 +934,7 @@ export const makeManageVestingAction: ActionMaker = ( // isCw20Begin else { // Extract instantiate message from cw20 send message. - instantiateMsg = parseEncodedMessage(msg.wasm.execute.msg.send.msg) + instantiateMsg = decodeJsonFromBase64(msg.wasm.execute.msg.send.msg) .instantiate_payroll_contract.instantiate_msg as VestingInstantiateMsg } } diff --git a/packages/stateful/actions/core/treasury/token_swap/PerformTokenSwap/index.tsx b/packages/stateful/actions/core/treasury/token_swap/PerformTokenSwap/index.tsx index 72641d60d..8bec0993e 100644 --- a/packages/stateful/actions/core/treasury/token_swap/PerformTokenSwap/index.tsx +++ b/packages/stateful/actions/core/treasury/token_swap/PerformTokenSwap/index.tsx @@ -21,10 +21,10 @@ import { import { ContractName, convertDenomToMicroDenomStringWithDecimals, - encodeMessageAsBase64, + decodeJsonFromBase64, + encodeJsonToBase64, makeWasmMessage, objectMatchesStructure, - parseEncodedMessage, } from '@dao-dao/utils' import { SuspenseLoader } from '../../../../../components' @@ -159,7 +159,7 @@ const useTransformToCosmos: UseTransformToCosmos = () => { send: { amount, contract: tokenSwapContractAddress, - msg: encodeMessageAsBase64({ + msg: encodeJsonToBase64({ // Use common key to identify CW20s being sent to token // swaps from this DAO DAO action. [CW20_SEND_MSG_KEY]: {}, @@ -233,7 +233,7 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( }) && // Use common key to identify CW20s being sent to token swaps from this // DAO DAO action. - CW20_SEND_MSG_KEY in parseEncodedMessage(msg.wasm.execute.msg.send.msg) + CW20_SEND_MSG_KEY in decodeJsonFromBase64(msg.wasm.execute.msg.send.msg) ) { return { match: true, diff --git a/packages/stateful/components/dao/CreateDaoForm.tsx b/packages/stateful/components/dao/CreateDaoForm.tsx index 41c27b9d6..76f3ab635 100644 --- a/packages/stateful/components/dao/CreateDaoForm.tsx +++ b/packages/stateful/components/dao/CreateDaoForm.tsx @@ -44,7 +44,7 @@ import { NEW_DAO_TOKEN_DECIMALS, TokenBasedCreatorId, convertMicroDenomToDenomWithDecimals, - encodeMessageAsBase64, + encodeJsonToBase64, findWasmAttributeValue, getFallbackImage, getFundsFromDaoInstantiateMsg, @@ -407,7 +407,7 @@ export const InnerCreateDaoForm = ({ const { logs } = await instantiateWithFactory( { codeId: codeIds.DaoCore, - instantiateMsg: encodeMessageAsBase64(instantiateMsg), + instantiateMsg: encodeJsonToBase64(instantiateMsg), label: instantiateMsg.name, }, CHAIN_GAS_MULTIPLIER, diff --git a/packages/stateful/components/dao/CreateDaoProposal.tsx b/packages/stateful/components/dao/CreateDaoProposal.tsx index 801ddd57b..7325ecf7a 100644 --- a/packages/stateful/components/dao/CreateDaoProposal.tsx +++ b/packages/stateful/components/dao/CreateDaoProposal.tsx @@ -37,6 +37,9 @@ import { ContractName, DaoProposalSingleAdapterId, SITE_URL, + decodeJsonFromBase64, + encodeJsonToBase64, + objectMatchesStructure, } from '@dao-dao/utils' import { @@ -182,26 +185,40 @@ const InnerCreateDaoProposal = ({ return } - try { - const potentialDefaultValue = router.query.prefill - if (typeof potentialDefaultValue !== 'string') { - return - } + const potentialDefaultValue = router.query.prefill + if (typeof potentialDefaultValue !== 'string' || !potentialDefaultValue) { + setPrefillChecked(true) + return + } - const prefillData = JSON.parse(potentialDefaultValue) - if ( - prefillData.constructor.name === 'Object' && - 'id' in prefillData && - 'data' in prefillData - ) { - loadPrefill(prefillData) - } - // If failed to parse, do nothing. + // Try to parse as JSON. + let prefillData + try { + prefillData = JSON.parse(potentialDefaultValue) } catch (error) { console.error(error) - } finally { - setPrefillChecked(true) } + + // Try to parse as base64. + if (!prefillData) { + try { + prefillData = decodeJsonFromBase64(potentialDefaultValue) + } catch (error) { + console.error(error) + } + } + + // If prefillData looks valid, use it. + if ( + objectMatchesStructure(prefillData, { + id: {}, + data: {}, + }) + ) { + loadPrefill(prefillData) + } + + setPrefillChecked(true) }, [ router.query.prefill, router.isReady, @@ -353,7 +370,7 @@ const InnerCreateDaoProposal = ({ navigator.clipboard.writeText( SITE_URL + getDaoProposalPath(daoInfo.coreAddress, 'create', { - prefill: JSON.stringify({ + prefill: encodeJsonToBase64({ id: proposalModuleAdapterCommonId, data: proposalData, }), diff --git a/packages/stateful/components/gov/NewGovProposal.tsx b/packages/stateful/components/gov/NewGovProposal.tsx index e76550243..654bec9e6 100644 --- a/packages/stateful/components/gov/NewGovProposal.tsx +++ b/packages/stateful/components/gov/NewGovProposal.tsx @@ -74,6 +74,8 @@ import { CHAIN_GAS_MULTIPLIER, SITE_URL, dateToWdhms, + decodeJsonFromBase64, + encodeJsonToBase64, formatDateTime, formatPercentOf100, formatTime, @@ -83,6 +85,7 @@ import { getSignerOptions, govProposalActionDataToDecodedContent, isCosmWasmStargateMsg, + objectMatchesStructure, processError, } from '@dao-dao/utils' @@ -132,32 +135,52 @@ export const NewGovProposal = (innerProps: NewGovProposalProps) => { // Set once prefill has been assessed, indicating NewProposal can load now. const [prefillChecked, setPrefillChecked] = useState(false) - const [usePrefill, setUsePrefill] = useState(false) + // If set to an object, prefill form with data. + const [usePrefill, setUsePrefill] = useState | undefined>( + undefined + ) // Prefill form with data from parameter once ready. useEffect(() => { if (!router.isReady || prefillChecked) { return } - try { - const potentialDefaultValue = router.query.prefill - if (typeof potentialDefaultValue !== 'string') { - return - } + const potentialDefaultValue = router.query.prefill + if (typeof potentialDefaultValue !== 'string' || !potentialDefaultValue) { + setPrefillChecked(true) + return + } - const prefillData = JSON.parse(potentialDefaultValue) - if ( - prefillData.constructor.name === 'Object' && - 'chainId' in prefillData - ) { - setUsePrefill(true) - } - // If failed to parse, do nothing. + // Try to parse as JSON. + let prefillData + try { + prefillData = JSON.parse(potentialDefaultValue) } catch (error) { console.error(error) - } finally { - setPrefillChecked(true) } + + // Try to parse as base64. + if (!prefillData) { + try { + prefillData = decodeJsonFromBase64(potentialDefaultValue) + } catch (error) { + console.error(error) + } + } + + // If prefillData looks valid, use it. + if ( + objectMatchesStructure(prefillData, { + chainId: {}, + version: {}, + title: {}, + description: {}, + }) + ) { + setUsePrefill(prefillData) + } + + setPrefillChecked(true) }, [router.query.prefill, router.isReady, prefillChecked]) return !defaults || !prefillChecked ? ( @@ -171,7 +194,7 @@ export const NewGovProposal = (innerProps: NewGovProposalProps) => { defaults={{ ...defaults, ...cloneDeep(latestProposalSave), - ...(usePrefill ? JSON.parse(router.query.prefill as string) : {}), + ...usePrefill, }} localStorageKey={localStorageKey} realDefaults={defaults} @@ -494,7 +517,7 @@ const InnerNewGovProposal = ({ navigator.clipboard.writeText( SITE_URL + getGovProposalPath(chainContext.config.name, 'create', { - prefill: JSON.stringify(proposalData), + prefill: encodeJsonToBase64(proposalData), }) ) toast.success(t('info.copiedLinkToClipboard')) diff --git a/packages/stateful/creators/MembershipBased/mutate.ts b/packages/stateful/creators/MembershipBased/mutate.ts index 1ff300bb0..dc3ca9df3 100644 --- a/packages/stateful/creators/MembershipBased/mutate.ts +++ b/packages/stateful/creators/MembershipBased/mutate.ts @@ -1,6 +1,6 @@ import { DaoCreatorMutate } from '@dao-dao/types' import { InstantiateMsg, Member } from '@dao-dao/types/contracts/DaoVotingCw4' -import { MembershipBasedCreatorId, encodeMessageAsBase64 } from '@dao-dao/utils' +import { MembershipBasedCreatorId, encodeJsonToBase64 } from '@dao-dao/utils' import { makeValidateMsg } from '@dao-dao/utils/validation/makeValidateMsg' import instantiateSchema from './instantiate_schema.json' @@ -41,7 +41,7 @@ export const mutate: DaoCreatorMutate = ( admin: { core_module: {} }, code_id: codeIds.DaoVotingCw4, label: `DAO_${name.trim()}_${MembershipBasedCreatorId}`, - msg: encodeMessageAsBase64(votingModuleAdapterInstantiateMsg), + msg: encodeJsonToBase64(votingModuleAdapterInstantiateMsg), funds: [], } diff --git a/packages/stateful/creators/NftBased/mutate.ts b/packages/stateful/creators/NftBased/mutate.ts index c1e4b15dd..424a5a54b 100644 --- a/packages/stateful/creators/NftBased/mutate.ts +++ b/packages/stateful/creators/NftBased/mutate.ts @@ -3,7 +3,7 @@ import { InstantiateMsg } from '@dao-dao/types/contracts/DaoVotingCw721Staked' import { NftBasedCreatorId, convertDurationWithUnitsToDuration, - encodeMessageAsBase64, + encodeJsonToBase64, } from '@dao-dao/utils' import { makeValidateMsg } from '@dao-dao/utils/validation/makeValidateMsg' @@ -40,7 +40,7 @@ export const mutate: DaoCreatorMutate = ( admin: { core_module: {} }, code_id: codeIds.DaoVotingCw721Staked, label: `DAO_${daoName.trim()}_${NftBasedCreatorId}`, - msg: encodeMessageAsBase64(votingModuleAdapterInstantiateMsg), + msg: encodeJsonToBase64(votingModuleAdapterInstantiateMsg), funds: [], } diff --git a/packages/stateful/creators/TokenBased/mutate.ts b/packages/stateful/creators/TokenBased/mutate.ts index 82f0e31f4..3ac3f2ef8 100644 --- a/packages/stateful/creators/TokenBased/mutate.ts +++ b/packages/stateful/creators/TokenBased/mutate.ts @@ -9,7 +9,7 @@ import { TokenBasedCreatorId, convertDenomToMicroDenomWithDecimals, convertDurationWithUnitsToDuration, - encodeMessageAsBase64, + encodeJsonToBase64, mustGetSupportedChainConfig, } from '@dao-dao/utils' import { makeValidateMsg } from '@dao-dao/utils/validation/makeValidateMsg' @@ -180,7 +180,7 @@ export const mutate: DaoCreatorMutate = ( label: `DAO_${daoName.trim()}_${TokenBasedCreatorId}_${ isNative ? 'native' : 'cw20' }`, - msg: encodeMessageAsBase64(votingModuleAdapterInstantiateMsg), + msg: encodeJsonToBase64(votingModuleAdapterInstantiateMsg), funds: tokenFactoryDenomCreationFee || [], } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/daoCreation/getInstantiateInfo.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/daoCreation/getInstantiateInfo.ts index 616a41391..070fe11ed 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/daoCreation/getInstantiateInfo.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/daoCreation/getInstantiateInfo.ts @@ -6,7 +6,7 @@ import { convertDenomToMicroDenomWithDecimals, convertDurationWithUnitsToDuration, convertVetoConfigToCosmos, - encodeMessageAsBase64, + encodeJsonToBase64, } from '@dao-dao/utils' import { makeValidateMsg } from '@dao-dao/utils/validation/makeValidateMsg' @@ -96,7 +96,7 @@ export const getInstantiateInfo: DaoCreationGetInstantiateInfo< admin: { core_module: {} }, code_id: codeIdsToUse.DaoPreProposeMultiple, label: `DAO_${name.trim()}_pre-propose-${DaoProposalMultipleAdapterId}`, - msg: encodeMessageAsBase64(preProposeMultipleInstantiateMsg), + msg: encodeJsonToBase64(preProposeMultipleInstantiateMsg), // This function is used by the enable multiple choice action, and // DAOs before v2.3.0 still might want to enable multiple choice, so // make sure to support the old version without the `funds` field. @@ -121,7 +121,7 @@ export const getInstantiateInfo: DaoCreationGetInstantiateInfo< admin: { core_module: {} }, code_id: codeIdsToUse.DaoProposalMultiple, label: `DAO_${name.trim()}_${DaoProposalMultipleAdapterId}`, - msg: encodeMessageAsBase64(msg), + msg: encodeJsonToBase64(msg), // This function is used by the enable multiple choice action, and DAOs // before v2.3.0 still might want to enable multiple choice, so make sure to // support the old version without the `funds` field. diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/getInstantiateInfo.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/getInstantiateInfo.ts index 93d99e2b8..24140dadb 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/getInstantiateInfo.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/getInstantiateInfo.ts @@ -11,7 +11,7 @@ import { convertDenomToMicroDenomWithDecimals, convertDurationWithUnitsToDuration, convertVetoConfigToCosmos, - encodeMessageAsBase64, + encodeJsonToBase64, } from '@dao-dao/utils' import { makeValidateMsg } from '@dao-dao/utils/validation/makeValidateMsg' @@ -110,7 +110,7 @@ export const getInstantiateInfo: DaoCreationGetInstantiateInfo< label: `DAO_${name.trim()}_pre-propose${ approver.enabled ? '-approval' : '' }_${DaoProposalSingleAdapterId}`, - msg: encodeMessageAsBase64(preProposeInstantiateMsg), + msg: encodeJsonToBase64(preProposeInstantiateMsg), funds: [], }, }, @@ -139,7 +139,7 @@ export const getInstantiateInfo: DaoCreationGetInstantiateInfo< admin: { core_module: {} }, code_id: codeIds.DaoProposalSingle, label: `DAO_${name.trim()}_${DaoProposalSingleAdapterId}`, - msg: encodeMessageAsBase64(msg), + msg: encodeJsonToBase64(msg), funds: [], } } diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/StakingModal.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/StakingModal.tsx index 6b8624c8c..b935bb4b4 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/StakingModal.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/StakingModal.tsx @@ -26,7 +26,7 @@ import { convertDenomToMicroDenomStringWithDecimals, convertDenomToMicroDenomWithDecimals, convertMicroDenomToDenomWithDecimals, - encodeMessageAsBase64, + encodeJsonToBase64, processError, } from '@dao-dao/utils' @@ -178,7 +178,7 @@ const InnerStakingModal = ({ governanceToken.decimals ).toString(), contract: stakingContractToExecute, - msg: encodeMessageAsBase64({ + msg: encodeJsonToBase64({ [isOraichainCustomStaking ? 'bond' : 'stake']: {}, }), }) diff --git a/packages/stateless/components/dao/create/pages/CreateDaoReview.tsx b/packages/stateless/components/dao/create/pages/CreateDaoReview.tsx index 795a64d0c..9ecb15e63 100644 --- a/packages/stateless/components/dao/create/pages/CreateDaoReview.tsx +++ b/packages/stateless/components/dao/create/pages/CreateDaoReview.tsx @@ -3,7 +3,7 @@ import { useRef, useState } from 'react' import { useTranslation } from 'react-i18next' import { CreateDaoContext, DaoInfoCard } from '@dao-dao/types' -import { parseEncodedMessage, processError } from '@dao-dao/utils' +import { decodeJsonFromBase64, processError } from '@dao-dao/utils' import { CosmosMessageDisplay } from '../../../CosmosMessageDisplay' import { Checkbox } from '../../../inputs/Checkbox' @@ -43,7 +43,7 @@ export const CreateDaoReview = ({ // Convert encoded module instantiation messages back to readable JSON. if (decodeModuleMessages) { msg.proposal_modules_instantiate_info.forEach((info) => { - const msg = parseEncodedMessage(info.msg) + const msg = decodeJsonFromBase64(info.msg) // Convert encoded pre_propose_info message back to readable JSON. if ( @@ -53,14 +53,14 @@ export const CreateDaoReview = ({ 'msg' in msg.pre_propose_info.module_may_propose.info ) { msg.pre_propose_info.module_may_propose.info.msg = - parseEncodedMessage( + decodeJsonFromBase64( msg.pre_propose_info.module_may_propose.info.msg ) } info.msg = msg }) - msg.voting_module_instantiate_info.msg = parseEncodedMessage( + msg.voting_module_instantiate_info.msg = decodeJsonFromBase64( msg.voting_module_instantiate_info.msg ) } diff --git a/packages/utils/contracts.ts b/packages/utils/contracts.ts index 5477ce0b2..e737224a8 100644 --- a/packages/utils/contracts.ts +++ b/packages/utils/contracts.ts @@ -5,7 +5,7 @@ import { findAttribute, parseRawLog } from '@cosmjs/stargate/build/logs' import { ContractVersion, cwMsgToEncodeObject } from '@dao-dao/types' import { CHAIN_GAS_MULTIPLIER } from './constants' -import { encodeMessageAsBase64 } from './messages' +import { encodeJsonToBase64 } from './messages' const CONTRACT_VERSIONS = Object.values(ContractVersion) @@ -50,7 +50,7 @@ export const instantiateSmartContract = async ( wasm: { instantiate: { code_id: codeId, - msg: encodeMessageAsBase64(msg), + msg: encodeJsonToBase64(msg), funds: funds || [], label, // Replace empty string with undefined. diff --git a/packages/utils/messages/cw.ts b/packages/utils/messages/cw.ts index f951aa89a..80c6d5f68 100644 --- a/packages/utils/messages/cw.ts +++ b/packages/utils/messages/cw.ts @@ -34,7 +34,7 @@ import { import { IBC_TIMEOUT_SECONDS } from '../constants' import { processError } from '../error' import { objectMatchesStructure } from '../objectMatchesStructure' -import { encodeMessageAsBase64, parseEncodedMessage } from './encoding' +import { decodeJsonFromBase64, encodeJsonToBase64 } from './encoding' import { isDecodedStargateMsg } from './protobuf' type WasmMsgType = @@ -98,7 +98,7 @@ export const decodeMessage = (msg: CosmosMsgFor_Empty): Record => { if (msgType && isBinaryType(msgType)) { const base64MsgContainer = (msg.wasm as any)[msgType] if (base64MsgContainer && 'msg' in base64MsgContainer) { - const parsedMsg = parseEncodedMessage(base64MsgContainer.msg) + const parsedMsg = decodeJsonFromBase64(base64MsgContainer.msg) if (parsedMsg) { return { ...msg, @@ -143,20 +143,18 @@ export const makeWasmMessage = (message: { // We need to encode Wasm Execute, Instantiate, and Migrate messages. let msg = message if (message?.wasm?.execute) { - msg.wasm.execute.msg = encodeMessageAsBase64(message.wasm.execute.msg) + msg.wasm.execute.msg = encodeJsonToBase64(message.wasm.execute.msg) } else if (message?.wasm?.instantiate) { - msg.wasm.instantiate.msg = encodeMessageAsBase64( - message.wasm.instantiate.msg - ) + msg.wasm.instantiate.msg = encodeJsonToBase64(message.wasm.instantiate.msg) } else if (message?.wasm?.instantiate2) { - msg.wasm.instantiate2.msg = encodeMessageAsBase64( + msg.wasm.instantiate2.msg = encodeJsonToBase64( message.wasm.instantiate2.msg ) msg.wasm.instantiate2.salt = toBase64( toUtf8(message.wasm.instantiate2.salt) ) } else if (message.wasm.migrate) { - msg.wasm.migrate.msg = encodeMessageAsBase64(message.wasm.migrate.msg) + msg.wasm.migrate.msg = encodeJsonToBase64(message.wasm.migrate.msg) } // Messages such as update or clear admin pass through without modification. return msg @@ -169,7 +167,7 @@ export const makeExecutableMintMessage = ( wasm: { execute: { contract_addr: contractAddress, - msg: encodeMessageAsBase64(msg), + msg: encodeJsonToBase64(msg), funds: [], }, }, diff --git a/packages/utils/messages/encoding.ts b/packages/utils/messages/encoding.ts index 0ce376e00..bff9472bf 100644 --- a/packages/utils/messages/encoding.ts +++ b/packages/utils/messages/encoding.ts @@ -1,14 +1,19 @@ import { fromBase64, fromUtf8, toBase64, toUtf8 } from '@cosmjs/encoding' -export function parseEncodedMessage(base64String?: string) { +/** + * Encode JSON object as base64 string. + */ +export const encodeJsonToBase64 = (object: any) => + toBase64(toUtf8(JSON.stringify(object))) + +/** + * Decode base64 string into JSON object. + */ +export const decodeJsonFromBase64 = (base64String?: string) => { if (base64String) { const jsonMessage = fromUtf8(fromBase64(base64String)) if (jsonMessage) { return JSON.parse(jsonMessage) } } - return undefined } - -export const encodeMessageAsBase64 = (message: any) => - toBase64(toUtf8(JSON.stringify(message))) From 15d73f78788bc381c1494501739b3352e8f3d2fe Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sat, 6 Apr 2024 15:43:16 -0700 Subject: [PATCH 103/438] use base64 for all prefill queries, such as duplicates --- .../components/dao/CreateDaoProposal.tsx | 8 ++--- ...eProposeApprovalProposalContentDisplay.tsx | 4 +-- .../dao/DaoProposalContentDisplay.tsx | 3 +- .../components/gov/NewGovProposal.tsx | 8 ++--- .../components/profile/ProfileActions.tsx | 34 ++++++++++++++++--- packages/utils/url.ts | 5 +-- 6 files changed, 44 insertions(+), 18 deletions(-) diff --git a/packages/stateful/components/dao/CreateDaoProposal.tsx b/packages/stateful/components/dao/CreateDaoProposal.tsx index 7325ecf7a..a75eba451 100644 --- a/packages/stateful/components/dao/CreateDaoProposal.tsx +++ b/packages/stateful/components/dao/CreateDaoProposal.tsx @@ -185,8 +185,8 @@ const InnerCreateDaoProposal = ({ return } - const potentialDefaultValue = router.query.prefill - if (typeof potentialDefaultValue !== 'string' || !potentialDefaultValue) { + const potentialPrefill = router.query.prefill + if (typeof potentialPrefill !== 'string' || !potentialPrefill) { setPrefillChecked(true) return } @@ -194,7 +194,7 @@ const InnerCreateDaoProposal = ({ // Try to parse as JSON. let prefillData try { - prefillData = JSON.parse(potentialDefaultValue) + prefillData = JSON.parse(potentialPrefill) } catch (error) { console.error(error) } @@ -202,7 +202,7 @@ const InnerCreateDaoProposal = ({ // Try to parse as base64. if (!prefillData) { try { - prefillData = decodeJsonFromBase64(potentialDefaultValue) + prefillData = decodeJsonFromBase64(potentialPrefill) } catch (error) { console.error(error) } diff --git a/packages/stateful/components/dao/DaoPreProposeApprovalProposalContentDisplay.tsx b/packages/stateful/components/dao/DaoPreProposeApprovalProposalContentDisplay.tsx index ed805d990..78ef05c92 100644 --- a/packages/stateful/components/dao/DaoPreProposeApprovalProposalContentDisplay.tsx +++ b/packages/stateful/components/dao/DaoPreProposeApprovalProposalContentDisplay.tsx @@ -13,7 +13,7 @@ import { CommonProposalInfo, ProposalPrefill, } from '@dao-dao/types' -import { keyFromPreProposeStatus } from '@dao-dao/utils' +import { encodeJsonToBase64, keyFromPreProposeStatus } from '@dao-dao/utils' import { useActionsForMatching } from '../../actions' import { useEntity } from '../../hooks' @@ -61,7 +61,7 @@ export const DaoPreProposeApprovalProposalContentDisplay = ({ // duplicate button remains hidden until the form data is loaded. const duplicateUrl = duplicateFormData ? getDaoProposalPath(coreAddress, 'create', { - prefill: JSON.stringify(prefill), + prefill: encodeJsonToBase64(prefill), }) : undefined diff --git a/packages/stateful/components/dao/DaoProposalContentDisplay.tsx b/packages/stateful/components/dao/DaoProposalContentDisplay.tsx index c36970203..dd15b14b8 100644 --- a/packages/stateful/components/dao/DaoProposalContentDisplay.tsx +++ b/packages/stateful/components/dao/DaoProposalContentDisplay.tsx @@ -10,6 +10,7 @@ import { PreProposeModuleType, ProposalPrefill, } from '@dao-dao/types' +import { encodeJsonToBase64 } from '@dao-dao/utils' import { useActionsForMatching } from '../../actions' import { useEntity } from '../../hooks' @@ -59,7 +60,7 @@ export const DaoProposalContentDisplay = ({ // duplicate button remains hidden until the form data is loaded. const duplicateUrl = duplicateFormData ? getDaoProposalPath(coreAddress, 'create', { - prefill: JSON.stringify(prefill), + prefill: encodeJsonToBase64(prefill), }) : undefined diff --git a/packages/stateful/components/gov/NewGovProposal.tsx b/packages/stateful/components/gov/NewGovProposal.tsx index 654bec9e6..e39a43231 100644 --- a/packages/stateful/components/gov/NewGovProposal.tsx +++ b/packages/stateful/components/gov/NewGovProposal.tsx @@ -145,8 +145,8 @@ export const NewGovProposal = (innerProps: NewGovProposalProps) => { return } - const potentialDefaultValue = router.query.prefill - if (typeof potentialDefaultValue !== 'string' || !potentialDefaultValue) { + const potentialPrefill = router.query.prefill + if (typeof potentialPrefill !== 'string' || !potentialPrefill) { setPrefillChecked(true) return } @@ -154,7 +154,7 @@ export const NewGovProposal = (innerProps: NewGovProposalProps) => { // Try to parse as JSON. let prefillData try { - prefillData = JSON.parse(potentialDefaultValue) + prefillData = JSON.parse(potentialPrefill) } catch (error) { console.error(error) } @@ -162,7 +162,7 @@ export const NewGovProposal = (innerProps: NewGovProposalProps) => { // Try to parse as base64. if (!prefillData) { try { - prefillData = decodeJsonFromBase64(potentialDefaultValue) + prefillData = decodeJsonFromBase64(potentialPrefill) } catch (error) { console.error(error) } diff --git a/packages/stateful/components/profile/ProfileActions.tsx b/packages/stateful/components/profile/ProfileActions.tsx index b5cafa520..5a903d189 100644 --- a/packages/stateful/components/profile/ProfileActions.tsx +++ b/packages/stateful/components/profile/ProfileActions.tsx @@ -25,8 +25,10 @@ import { CHAIN_GAS_MULTIPLIER, KVPK_API_BASE, ME_SAVED_TX_PREFIX, + decodeJsonFromBase64, getRpcForChainId, getSignerOptions, + objectMatchesStructure, processError, } from '@dao-dao/utils' @@ -73,14 +75,36 @@ export const ProfileActions = () => { // Load from prefill query. const router = useRouter() useEffect(() => { - if (router.query.prefill) { + const potentialPrefill = router.query.prefill + if (typeof potentialPrefill !== 'string' || !potentialPrefill) { + return + } + + // Try to parse as JSON. + let prefillData + try { + prefillData = JSON.parse(potentialPrefill) + } catch (error) { + console.error(error) + } + + // Try to parse as base64. + if (!prefillData) { try { - const prefill = JSON.parse(router.query.prefill as string) - formMethods.reset(prefill) - } catch (err) { - console.error(err) + prefillData = decodeJsonFromBase64(potentialPrefill) + } catch (error) { + console.error(error) } } + + // If prefillData looks valid, use it. + if ( + objectMatchesStructure(prefillData, { + actions: {}, + }) + ) { + formMethods.reset(prefillData) + } }, [formMethods, router.query]) const meTransaction = formMethods.watch() diff --git a/packages/utils/url.ts b/packages/utils/url.ts index 79947c060..cc2da7da1 100644 --- a/packages/utils/url.ts +++ b/packages/utils/url.ts @@ -3,6 +3,7 @@ import queryString from 'query-string' import { ActionKeyAndDataNoId, DaoPageMode, DaoTabId } from '@dao-dao/types' import { DaoProposalSingleAdapterId } from './constants/adapters' +import { encodeJsonToBase64 } from './messages' // Create a path to a DAO page based on the app's page mode. export const getDaoPath = ( @@ -77,7 +78,7 @@ export const getAccountPath = ( export const getMeTxPrefillPath = (actions: ActionKeyAndDataNoId[]) => { const base = '/me/actions' const query = `?${queryString.stringify({ - prefill: JSON.stringify({ + prefill: encodeJsonToBase64({ actions: actions.map((action, index) => ({ _id: index.toString(), ...action, @@ -98,7 +99,7 @@ export const getDaoProposalSinglePrefill = ({ title?: string description?: string }): string => - JSON.stringify({ + encodeJsonToBase64({ id: DaoProposalSingleAdapterId, data: { title, From 90c061d60c1b4dd15d1d09a63637cf6d1b14e705 Mon Sep 17 00:00:00 2001 From: noah Date: Mon, 8 Apr 2024 23:47:15 +0200 Subject: [PATCH 104/438] support self-relaying ICA messages (#1764) --- packages/i18n/locales/bad/translation.json | 1 - packages/i18n/locales/en/translation.json | 2 +- packages/state/package.json | 1 + packages/state/recoil/atoms/refresh.ts | 4 +- packages/state/recoil/selectors/chain.ts | 63 ++- .../components/SelfRelayExecuteModal.tsx | 427 +++++++++++------- .../stateful/components/dao/DaoProposal.tsx | 1 + packages/stateful/hooks/index.ts | 2 +- .../stateful/hooks/useProposalActionState.tsx | 30 +- .../hooks/useProposalPolytoneState.ts | 317 ------------- .../stateful/hooks/useProposalRelayState.ts | 399 ++++++++++++++++ .../components/ProposalStatusAndInfo.tsx | 6 +- .../components/ProposalStatusAndInfo.tsx | 6 +- .../ProposalCrossChainRelayStatus.tsx | 8 +- .../types/components/SelfRelayExecuteModal.ts | 3 + packages/types/proposal-module-adapter.ts | 2 +- packages/types/proposal.ts | 44 +- packages/utils/actions.ts | 9 +- packages/utils/chain.ts | 4 +- packages/utils/constants/chains.ts | 2 +- packages/utils/messages/cw.ts | 62 ++- 21 files changed, 852 insertions(+), 541 deletions(-) delete mode 100644 packages/stateful/hooks/useProposalPolytoneState.ts create mode 100644 packages/stateful/hooks/useProposalRelayState.ts diff --git a/packages/i18n/locales/bad/translation.json b/packages/i18n/locales/bad/translation.json index 1560acd1f..0c4107bff 100644 --- a/packages/i18n/locales/bad/translation.json +++ b/packages/i18n/locales/bad/translation.json @@ -459,7 +459,6 @@ "notificationsNotAllowed": "bad bad bad", "pageNotFound": "bad bad bad bad bad", "parentMustUpgradeToV2": "bad bad bad bad bad bad bad bad bad bad bad", - "polytoneConnectionNotFound": "bad bad bad bad", "polytoneExecutedNoRelay": "bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad", "proposalIdNotFound": "bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad bad", "proposalNotFound": "bad bad bad", diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index cdded351c..5faebd84d 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -402,6 +402,7 @@ "failedToGetAccountFromWallet": "Failed to get account from wallet.", "failedToGetFactoryTokenInfo": "Failed to get factory token info. Please enter a valid factory denom.", "failedToGetTokenInfo": "Failed to get token info. Please enter a valid {{tokenType}} contract address.", + "failedToLoadIbcConnection": "Failed to load IBC connection.", "failedToLoadWidget": "Failed to load widget.", "failedToRelayAcks": "Failed to relay acknowledgements from {{chain}}.", "failedToRelayAndGetAcks": "Failed to relay packets and get acknowledgements.", @@ -487,7 +488,6 @@ "notificationsNotAllowed": "Notifications not allowed.", "pageNotFound": "We couldn't find that page.", "parentMustUpgradeToV2": "SubDAOs cannot upgrade themselves. The parent DAO must upgrade this SubDAO.", - "polytoneConnectionNotFound": "Polytone connection not found.", "polytoneExecutedNoRelay": "The proposal was executed, but not all of the cross-chain messages have been relayed. You must relay them to complete the execution.", "proposalIdNotFound": "An unexpected error occurred while redirecting to the proposal. Go back to the DAO's home page and reload to find it.", "proposalNotFound": "Proposal not found.", diff --git a/packages/state/package.json b/packages/state/package.json index 0af27c450..c1fa79255 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -10,6 +10,7 @@ }, "dependencies": { "@apollo/client": "^3.8.7", + "@confio/relayer": "^0.12.0", "@cosmjs/amino": "^0.32.1", "@cosmjs/cosmwasm-stargate": "^0.32.1", "@cosmjs/encoding": "^0.32.1", diff --git a/packages/state/recoil/atoms/refresh.ts b/packages/state/recoil/atoms/refresh.ts index a743ede53..82aae626b 100644 --- a/packages/state/recoil/atoms/refresh.ts +++ b/packages/state/recoil/atoms/refresh.ts @@ -126,8 +126,8 @@ export const refreshGovProposalsAtom = atomFamily({ default: 0, }) -// Change this to refresh the unreceived IBC packets/acks for a given chain. -export const refreshUnreceivedIbcDataAtom = atomFamily({ +// Change this to refresh IBC packets/acks for a given chain. +export const refreshIbcDataAtom = atomFamily({ key: 'refreshUnreceivedIbcData', default: 0, }) diff --git a/packages/state/recoil/selectors/chain.ts b/packages/state/recoil/selectors/chain.ts index 8bfd5eca8..3e9558413 100644 --- a/packages/state/recoil/selectors/chain.ts +++ b/packages/state/recoil/selectors/chain.ts @@ -1,3 +1,4 @@ +import { parsePacketsFromTendermintEvents } from '@confio/relayer/build/lib/utils' import { CosmWasmClient } from '@cosmjs/cosmwasm-stargate' import { fromBase64, toHex } from '@cosmjs/encoding' import { Coin, IndexedTx, StargateClient } from '@cosmjs/stargate' @@ -52,6 +53,7 @@ import { Pool, Validator as RpcValidator, } from '@dao-dao/types/protobuf/codegen/cosmos/staking/v1beta1/staking' +import { Packet } from '@dao-dao/types/protobuf/codegen/ibc/core/channel/v1/channel' import { Fee as NeutronFee } from '@dao-dao/types/protobuf/codegen/neutron/feerefunder/fee' import { Params as NobleTariffParams } from '@dao-dao/types/protobuf/codegen/tariff/params' import { @@ -71,8 +73,8 @@ import { import { refreshBlockHeightAtom, refreshGovProposalsAtom, + refreshIbcDataAtom, refreshNativeTokenStakingInfoAtom, - refreshUnreceivedIbcDataAtom, refreshWalletBalancesIdAtom, } from '../atoms/refresh' import { @@ -1535,6 +1537,19 @@ export const transactionSelector = selectorFamily< }, }) +export const transactionPacketsSelector = selectorFamily< + Packet[] | undefined, + WithChainId<{ txHash: string }> +>({ + key: 'transactionPackets', + get: + (params) => + async ({ get }) => { + const tx = get(transactionSelector(params)) + return tx && parsePacketsFromTendermintEvents(tx.events) + }, +}) + export const walletHexPublicKeySelector = selectorFamily< string | undefined, WithChainId<{ walletAddress: string }> @@ -1600,8 +1615,8 @@ export const denomMetadataSelector = selectorFamily< }) export const ibcUnreceivedPacketsSelector = selectorFamily< - // Returns unreceived IBC packet sequences. - number[], + // Returns whether or not all of the IBC packet sequences have been received. + boolean, WithChainId<{ portId: string channelId: string @@ -1612,7 +1627,7 @@ export const ibcUnreceivedPacketsSelector = selectorFamily< get: ({ chainId, portId, channelId, packetCommitmentSequences }) => async ({ get }) => { - get(refreshUnreceivedIbcDataAtom(chainId)) + get(refreshIbcDataAtom(chainId)) const ibcClient = get(ibcRpcClientForChainSelector(chainId)) const { sequences } = await ibcClient.core.channel.v1.unreceivedPackets({ portId, @@ -1621,13 +1636,15 @@ export const ibcUnreceivedPacketsSelector = selectorFamily< BigInt(v) ), }) - return sequences.map((s) => Number(s)) + return sequences.some((s) => + packetCommitmentSequences.includes(Number(s)) + ) }, }) export const ibcUnreceivedAcksSelector = selectorFamily< - // Returns unreceived IBC packet acknowledgement sequences. - number[], + // Returns whether or not all of the IBC packet acks have been received. + boolean, WithChainId<{ portId: string channelId: string @@ -1638,13 +1655,41 @@ export const ibcUnreceivedAcksSelector = selectorFamily< get: ({ chainId, portId, channelId, packetAckSequences }) => async ({ get }) => { - get(refreshUnreceivedIbcDataAtom(chainId)) + get(refreshIbcDataAtom(chainId)) const ibcClient = get(ibcRpcClientForChainSelector(chainId)) const { sequences } = await ibcClient.core.channel.v1.unreceivedAcks({ portId, channelId, packetAckSequences: packetAckSequences.map((v) => BigInt(v)), }) - return sequences.map((s) => Number(s)) + return sequences.some((s) => packetAckSequences.includes(Number(s))) + }, +}) + +export const ibcAckReceivedSelector = selectorFamily< + // Returns whether or not the IBC packet acknowledgement was received. + boolean, + WithChainId<{ + portId: string + channelId: string + sequence: number + }> +>({ + key: 'ibcAckReceived', + get: + ({ chainId, portId, channelId, sequence }) => + async ({ get }) => { + get(refreshIbcDataAtom(chainId)) + const ibcClient = get(ibcRpcClientForChainSelector(chainId)) + try { + await ibcClient.core.channel.v1.packetAcknowledgement({ + portId, + channelId, + sequence: BigInt(sequence), + }) + return true + } catch (err) { + return false + } }, }) diff --git a/packages/stateful/components/SelfRelayExecuteModal.tsx b/packages/stateful/components/SelfRelayExecuteModal.tsx index 11485b648..772adc0a0 100644 --- a/packages/stateful/components/SelfRelayExecuteModal.tsx +++ b/packages/stateful/components/SelfRelayExecuteModal.tsx @@ -1,5 +1,6 @@ import { Chain } from '@chain-registry/types' import { AckWithMetadata } from '@confio/relayer' +import { PacketWithMetadata } from '@confio/relayer/build/lib/endpoint' import { IbcClient } from '@confio/relayer/build/lib/ibcclient' import { Link } from '@confio/relayer/build/lib/link' import { @@ -29,8 +30,8 @@ import { useDeepCompareMemoize } from 'use-deep-compare-effect' import { genericTokenBalanceSelector, nativeDenomBalanceSelector, + refreshIbcDataAtom, refreshPolytoneListenerResultsAtom, - refreshUnreceivedIbcDataAtom, refreshWalletBalancesIdAtom, } from '@dao-dao/state/recoil' import { @@ -46,7 +47,6 @@ import { } from '@dao-dao/stateless' import { ChainId, - PolytoneConnection, SelfRelayExecuteModalProps, TokenType, cwMsgToEncodeObject, @@ -107,14 +107,12 @@ type Relayer = { } relayerAddress: string client: IbcClient - // Will be loaded for receiving chains only. The current chain will not have a - // polytone note since it is just responsible for sending packets. - polytoneConnection?: PolytoneConnection } export const SelfRelayExecuteModal = ({ uniqueId, chainIds: _chainIds, + crossChainMessages, transaction, onSuccess, onClose, @@ -126,7 +124,6 @@ export const SelfRelayExecuteModal = ({ // Current chain. const { chain: { chain_id: currentChainId }, - config, } = useSupportedChainContext() // All chains, including current. @@ -331,13 +328,6 @@ export const SelfRelayExecuteModal = ({ throw new Error(t('error.feeTokenNotFound')) } - const polytoneConnection = config.polytone?.[chain.chain_id] - // Only the receiving chains need polytone notes. The current chain is - // just responsible for sending. - if (chain.chain_id !== currentChainId && !polytoneConnection) { - throw new Error(t('error.polytoneConnectionNotFound')) - } - // Connect wallet to chain so we can send tokens. const { address, getSigningStargateClient } = relayerChainWallets[index] @@ -382,7 +372,6 @@ export const SelfRelayExecuteModal = ({ }, relayerAddress, client, - polytoneConnection, } }) ) @@ -561,7 +550,7 @@ export const SelfRelayExecuteModal = ({ ({ set }) => () => { chainIds.forEach((chainId) => - set(refreshUnreceivedIbcDataAtom(chainId), (id) => id + 1) + set(refreshIbcDataAtom(chainId), (id) => id + 1) ) set(refreshPolytoneListenerResultsAtom, (id) => id + 1) }, @@ -608,189 +597,303 @@ export const SelfRelayExecuteModal = ({ // Wait for previous chain to finish relaying packets. await prev - const { chain, client, polytoneConnection } = relayer + const { chain, client } = relayer - // Type-check, should never happen since we slice off the first (current - // chain) relayer, which is just responsible for sending. - if (!polytoneConnection) { - throw new Error(t('error.polytoneNoteNotFound')) - } + // Get the messages for this chain that need relaying. + const messages = crossChainMessages.filter( + ({ data: { chainId } }) => chainId === chain.chain_id + ) // Get packets for this chain that need relaying. - const thesePackets = packets.filter( - ({ packet }) => - packet.sourcePort === `wasm.${polytoneConnection.note}` && - packet.sourceChannel === polytoneConnection.localChannel && - packet.destinationChannel === polytoneConnection.remoteChannel + const chainPackets = packets.filter(({ packet }) => + messages.some( + ({ srcPort, dstPort }) => + packet.sourcePort === srcPort && + packet.destinationPort === dstPort + ) ) - if (!thesePackets.length) { + if (!chainPackets.length) { return } - const packetSequences = thesePackets.map(({ packet }) => - Number(packet.sequence) - ) setRelaying({ type: 'packet', relayer, }) - const link = await Link.createWithExistingConnections( - // First relayer is current chain sending packets. - relayers[0].client, - client, - polytoneConnection.localConnection, - polytoneConnection.remoteConnection + // Get unique source channels and connections. + const srcConnections = ( + await Promise.all( + uniq(chainPackets.map(({ packet }) => packet.sourceChannel)).map( + async (channel) => ({ + channel, + connection: ( + await relayers[0].client.query.ibc.channel.channel( + chainPackets.find( + ({ packet }) => packet.sourceChannel === channel + )!.packet.sourcePort, + channel + ) + ).channel?.connectionHops[0], + }) + ) + ) + ).flatMap(({ channel, connection }) => + connection ? { channel, connection } : [] ) - // Relay packets. Try 5 times. - let tries = 5 - while (tries) { - try { - const unrelayedPackets = - await client.query.ibc.channel.unreceivedPackets( - thesePackets[0].packet.destinationPort, - thesePackets[0].packet.destinationChannel, - packetSequences - ) - - const packetsNeedingRelay = thesePackets.filter(({ packet }) => - unrelayedPackets.sequences.some((seq) => seq === packet.sequence) - ) + // Get connections for channels. + const connections = ( + await Promise.all( + srcConnections + .reduce((acc, { channel, connection }) => { + let existing = acc.find((a) => a.src === connection) + if (!existing) { + existing = { + src: connection, + packets: [], + } + acc.push(existing) + } + + // Find packets coming from the same channel. + existing.packets.push( + ...chainPackets.filter( + ({ packet }) => packet.sourceChannel === channel + ) + ) - // Relay only the packets that need relaying. - if (packetsNeedingRelay.length) { - await link.relayPackets('A', packetsNeedingRelay) - } + return acc + }, [] as { src: string; packets: PacketWithMetadata[] }[]) + .map(async (data) => ({ + ...data, + dst: ( + await relayers[0].client.query.ibc.connection.connection( + data.src + ) + ).connection?.counterparty.connectionId, + })) + ) + ).flatMap(({ src, dst, packets }) => (dst ? { src, dst, packets } : [])) - break - } catch (err) { - // If relayer wallet out of funds, throw immediately since they need - // to top up. - if ( - err instanceof Error && - err.message.includes('insufficient funds') - ) { - // Refresh all balances. - relayers.map(refreshBalances) - throw new Error(t('error.relayerWalletNeedsFunds')) - } + if (!connections.length) { + throw new Error(t('error.failedToLoadIbcConnection')) + } - tries -= 1 + // Run relay process for each connection pair on this chain. + for (const { + src: srcConnection, + dst: dstConnection, + packets, + } of connections) { + const link = await Link.createWithExistingConnections( + // First relayer is current chain sending packets. + relayers[0].client, + client, + srcConnection, + dstConnection + ) - console.error( - t('error.failedToRelayPackets', { - chain: chain.pretty_name, - }) + (tries > 0 ? ' ' + t('info.tryingAgain') : ''), - err + // Get packets with unique source channel/port and destination + // channel/port combinations. + const uniquePackets = uniq( + packets.map((p) => + [ + p.packet.sourceChannel, + p.packet.sourcePort, + p.packet.destinationChannel, + p.packet.destinationPort, + ].join('/') ) - - // If no more tries, rethrow error. - if (tries === 0) { - throw err + ).map((key) => { + const [srcChannel, srcPort, dstChannel, dstPort] = key.split('/') + return { + srcChannel, + srcPort, + dstChannel, + dstPort, } + }) - // Wait a few seconds before trying again. - await new Promise((resolve) => setTimeout(resolve, 5000)) - } - } - - // Wait a few seconds for the packets to be indexed. - await new Promise((resolve) => setTimeout(resolve, 5000)) + setRelaying({ + type: 'packet', + relayer, + }) - setRelaying({ - type: 'ack', - relayer, - }) + const packetSequences = packets.map(({ packet }) => + Number(packet.sequence) + ) - const sourcePort = thesePackets[0].packet.sourcePort - const sourceChannel = thesePackets[0].packet.sourceChannel - - // Relay acks. Try 5 times. - tries = 5 - while (tries) { - try { - // Find acks that need relaying. - const smallestSequenceNumber = Math.min(...packetSequences) - const largestSequenceNumber = Math.max(...packetSequences) - const search = await link.endB.client.tm.txSearchAll({ - query: `write_acknowledgement.packet_connection='${polytoneConnection.remoteConnection}' AND write_acknowledgement.packet_src_port='${sourcePort}' AND write_acknowledgement.packet_src_channel='${sourceChannel}' AND write_acknowledgement.packet_sequence>=${smallestSequenceNumber} AND write_acknowledgement.packet_sequence<=${largestSequenceNumber}`, - }) + // Relay packets. Try 5 times. + let tries = 5 + while (tries) { + try { + const unrelayedPackets = ( + await Promise.all( + uniquePackets.map( + async ({ dstChannel, dstPort }) => + ( + await client.query.ibc.channel.unreceivedPackets( + dstPort, + dstChannel, + packetSequences + ) + ).sequences + ) + ) + ).flat() - const allAcks = search.txs.flatMap(({ height, result, hash }) => { - const events = result.events.map(fromTendermintEvent) - return parseAcksFromTxEvents(events).map( - (ack): AckWithMetadata => ({ - height, - txHash: toHex(hash).toUpperCase(), - txEvents: events, - ...ack, - }) + const packetsNeedingRelay = packets.filter(({ packet }) => + unrelayedPackets.includes(packet.sequence) ) - }) - const unrelayedAcks = - // First relayer is current chain sending packets/getting acks. - await relayers[0].client.query.ibc.channel.unreceivedAcks( - sourcePort, - sourceChannel, - allAcks.map(({ originalPacket }) => - Number(originalPacket.sequence) - ) + // Relay only the packets that need relaying. + if (packetsNeedingRelay.length) { + await link.relayPackets('A', packetsNeedingRelay) + } + + break + } catch (err) { + // If relayer wallet out of funds, throw immediately since they + // need to top up. + if ( + err instanceof Error && + err.message.includes('insufficient funds') + ) { + // Refresh all balances. + relayers.map(refreshBalances) + throw new Error(t('error.relayerWalletNeedsFunds')) + } + + tries -= 1 + + console.error( + t('error.failedToRelayPackets', { + chain: chain.pretty_name, + }) + (tries > 0 ? ' ' + t('info.tryingAgain') : ''), + err ) - const acksNeedingRelay = allAcks.filter(({ originalPacket }) => - unrelayedAcks.sequences.some( - (seq) => seq === originalPacket.sequence - ) - ) + // If no more tries, rethrow error. + if (tries === 0) { + throw err + } - // Acknowledge only the packets that need relaying. - if (acksNeedingRelay.length) { - await link.relayAcks('B', acksNeedingRelay) + // Wait a few seconds before trying again. + await new Promise((resolve) => setTimeout(resolve, 5000)) } + } - break - } catch (err) { - // If relayer wallet out of funds, throw immediately since they need - // to top up. - if ( - err instanceof Error && - err.message.includes('insufficient funds') - ) { - // Refresh all balances. - relayers.map(refreshBalances) - throw new Error(t('error.relayerWalletNeedsFunds')) - } + // Wait a few seconds for the packets to be indexed. + await new Promise((resolve) => setTimeout(resolve, 5000)) - tries -= 1 + setRelaying({ + type: 'ack', + relayer, + }) - console.error( - t('error.failedToRelayAcks', { - chain: chain.pretty_name, - }) + (tries > 0 ? ' ' + t('info.tryingAgain') : ''), - err - ) + // Relay acks. Try 5 times. + tries = 5 + while (tries) { + try { + // Find acks that need relaying. + const smallestSequenceNumber = Math.min(...packetSequences) + const largestSequenceNumber = Math.max(...packetSequences) + const txSearch = ( + await Promise.all( + uniquePackets.map( + async ({ srcChannel, srcPort }) => + ( + await link.endB.client.tm.txSearchAll({ + query: `write_acknowledgement.packet_connection='${dstConnection}' AND write_acknowledgement.packet_src_port='${srcPort}' AND write_acknowledgement.packet_src_channel='${srcChannel}' AND write_acknowledgement.packet_sequence>=${smallestSequenceNumber} AND write_acknowledgement.packet_sequence<=${largestSequenceNumber}`, + }) + ).txs + ) + ) + ).flat() + + const allAcks = txSearch.flatMap(({ height, result, hash }) => { + const events = result.events.map(fromTendermintEvent) + return parseAcksFromTxEvents(events).map( + (ack): AckWithMetadata => ({ + height, + txHash: toHex(hash).toUpperCase(), + txEvents: events, + ...ack, + }) + ) + }) - // If no more tries, rethrow error. - if (tries === 0) { - throw err - } + const unrelayedAcks = ( + await Promise.all( + uniquePackets.map( + async ({ srcChannel, srcPort }) => + // First relayer is current chain sending packets/getting + // acks. + ( + await relayers[0].client.query.ibc.channel.unreceivedAcks( + srcPort, + srcChannel, + allAcks.map(({ originalPacket }) => + Number(originalPacket.sequence) + ) + ) + ).sequences + ) + ) + ).flat() - // Wait a few seconds before trying again. - await new Promise((resolve) => - setTimeout( - resolve, - // If redundant packets detected, a relayer already relayed - // these acks. In that case, wait a bit longer to let it finish. - // The ack relayer above tries to check which acks have not yet - // been received, so if a relayer takes care of the acks, we - // will safely continue. - err instanceof Error && err.message.includes('redundant') - ? 10 * 1000 - : 5 * 1000 + const acksNeedingRelay = allAcks.filter(({ originalPacket }) => + unrelayedAcks.includes(originalPacket.sequence) ) - ) + + // Acknowledge only the packets that need relaying. + if (acksNeedingRelay.length) { + await link.relayAcks('B', acksNeedingRelay) + } + + break + } catch (err) { + // If relayer wallet out of funds, throw immediately since they + // need to top up. + if ( + err instanceof Error && + err.message.includes('insufficient funds') + ) { + // Refresh all balances. + relayers.map(refreshBalances) + throw new Error(t('error.relayerWalletNeedsFunds')) + } + + tries -= 1 + + console.error( + t('error.failedToRelayAcks', { + chain: chain.pretty_name, + }) + (tries > 0 ? ' ' + t('info.tryingAgain') : ''), + err + ) + + // If no more tries, rethrow error. + if (tries === 0) { + throw err + } + + // Wait a few seconds before trying again. + await new Promise((resolve) => + setTimeout( + resolve, + // If redundant packets detected, a relayer already relayed + // these acks. In that case, wait a bit longer to let it + // finish. The ack relayer above tries to check which acks + // have not yet been received, so if a relayer takes care of + // the acks, we will safely continue. + err instanceof Error && err.message.includes('redundant') + ? 10 * 1000 + : 5 * 1000 + ) + ) + } } } }, Promise.resolve()) diff --git a/packages/stateful/components/dao/DaoProposal.tsx b/packages/stateful/components/dao/DaoProposal.tsx index ba7e3d0a0..0cafa5f1f 100644 --- a/packages/stateful/components/dao/DaoProposal.tsx +++ b/packages/stateful/components/dao/DaoProposal.tsx @@ -298,6 +298,7 @@ const InnerDaoProposal = ({ proposalInfo }: InnerDaoProposalProps) => { executeProposal: ( @@ -58,7 +58,7 @@ export type UseProposalActionStateReturn = Pick< * components. */ export const useProposalActionState = ({ - polytoneState, + relayState, statusKey, loadingExecutionTxHash, executeProposal, @@ -154,10 +154,10 @@ export const useProposalActionState = ({ // Loading will stop on success when status refreshes. }, [isWalletConnected, closeProposal, proposalNumber, onCloseSuccess]) - const showPolytone = - !polytoneState.loading && + const showRelayStatus = + !relayState.loading && statusKey === ProposalStatusEnum.Executed && - polytoneState.data.hasPolytoneMessages + relayState.data.hasCrossChainMessages return { action: @@ -165,13 +165,13 @@ export const useProposalActionState = ({ // Show if anyone can execute OR if the wallet is a member, once // polytone messages that need relaying are done loading. (!config.only_members_execute || isMember) && - !polytoneState.loading + !relayState.loading ? { label: t('button.execute'), Icon: Key, loading: actionLoading, - doAction: polytoneState.data.needsSelfRelay - ? polytoneState.data.openPolytoneRelay + doAction: relayState.data.needsSelfRelay + ? relayState.data.openSelfRelay : onExecute, header: allowMemoOnExecute ? ( - {showPolytone && ( - + {showRelayStatus && ( + )} {isWalletConnected && } diff --git a/packages/stateful/hooks/useProposalPolytoneState.ts b/packages/stateful/hooks/useProposalPolytoneState.ts deleted file mode 100644 index 2486f8903..000000000 --- a/packages/stateful/hooks/useProposalPolytoneState.ts +++ /dev/null @@ -1,317 +0,0 @@ -import { parsePacketsFromTendermintEvents } from '@confio/relayer/build/lib/utils' -import uniq from 'lodash.uniq' -import { useEffect, useMemo } from 'react' -import { - constSelector, - useRecoilCallback, - waitForAll, - waitForAllSettled, -} from 'recoil' -import { useDeepCompareMemoize } from 'use-deep-compare-effect' - -import { - PolytoneListenerSelectors, - ibcUnreceivedAcksSelector, - ibcUnreceivedPacketsSelector, - refreshPolytoneListenerResultsAtom, - refreshUnreceivedIbcDataAtom, - transactionSelector, -} from '@dao-dao/state/recoil' -import { - useCachedLoading, - useDaoInfoContext, - useSupportedChainContext, -} from '@dao-dao/stateless' -import { - BaseProposalStatusAndInfoProps, - CosmosMsgFor_Empty, - LoadingData, - ProposalPolytoneState, - ProposalStatus, - ProposalStatusEnum, -} from '@dao-dao/types' -import { - decodeMessage, - decodePolytoneExecuteMsg, - makeWasmMessage, - objectMatchesStructure, -} from '@dao-dao/utils' - -export type UseProposalPolytoneStateOptions = { - msgs: CosmosMsgFor_Empty[] - status: ProposalStatus - executedAt: Date | undefined - proposalModuleAddress: string - proposalNumber: number - openSelfRelayExecute: BaseProposalStatusAndInfoProps['openSelfRelayExecute'] - loadingTxHash: LoadingData -} - -export type UseProposalPolytoneStateReturn = LoadingData - -/** - * This hook uses information about a proposal and produces all the necessary - * state for the status of polytone message relays. It is used in the - * `useProposalActionState` hook. - */ -export const useProposalPolytoneState = ({ - msgs, - status, - executedAt, - proposalModuleAddress, - proposalNumber, - openSelfRelayExecute, - loadingTxHash, -}: UseProposalPolytoneStateOptions): UseProposalPolytoneStateReturn => { - const { coreAddress } = useDaoInfoContext() - const { - chain: { chain_id: srcChainId }, - config: { polytone }, - } = useSupportedChainContext() - - const txLoadable = useCachedLoading( - loadingTxHash.loading || !loadingTxHash.data - ? constSelector(undefined) - : transactionSelector({ - chainId: srcChainId, - txHash: loadingTxHash.data, - }), - undefined - ) - // Parse the packets from the execution TX events. - const packets = - !txLoadable.loading && txLoadable.data - ? parsePacketsFromTendermintEvents(txLoadable.data.events).map( - (packet) => packet - ) - : [] - - // Decoded polytone execute messages. - const polytoneMessages = useMemo( - () => - msgs - .map((msg) => - decodePolytoneExecuteMsg(srcChainId, decodeMessage(msg), 'any') - ) - .flatMap((decoded) => (decoded.match ? [decoded] : [])), - [srcChainId, msgs] - ) - - // Get unreceived packets and acks. - const dstChainIds = uniq(polytoneMessages.map(({ chainId }) => chainId)) - const unreceivedPackets = useCachedLoading( - waitForAll( - dstChainIds.map((dstChainId) => { - const portId = `wasm.${polytone![dstChainId]!.voice}` - const channelId = polytone![dstChainId]!.remoteChannel - // Get packets that are going to this chain's polytone connection. - const packetCommitmentSequences = packets - .filter( - (packet) => - packet.destinationPort === portId && - packet.destinationChannel === channelId - ) - .map((packet) => Number(packet.sequence)) - - return ibcUnreceivedPacketsSelector({ - chainId: dstChainId, - portId, - channelId, - packetCommitmentSequences, - }) - }) - ), - [] - ) - const unreceivedAcks = useCachedLoading( - waitForAll( - dstChainIds.map((dstChainId) => { - const portId = `wasm.${polytone![dstChainId]!.note}` - const channelId = polytone![dstChainId]!.localChannel - // Get packets that are coming from this chain's polytone connection. - const packetAckSequences = packets - .filter( - (packet) => - packet.sourcePort === portId && packet.sourceChannel === channelId - ) - .map((packet) => Number(packet.sequence)) - - return ibcUnreceivedAcksSelector({ - chainId: srcChainId, - portId, - channelId, - packetAckSequences, - }) - }) - ), - [] - ) - - // Callback results. - const polytoneResults = useCachedLoading( - waitForAllSettled( - polytoneMessages.map( - ({ polytoneConnection: { listener }, initiatorMsg }) => - PolytoneListenerSelectors.resultSelector({ - chainId: srcChainId, - contractAddress: listener, - params: [ - { - initiator: coreAddress, - initiatorMsg, - }, - ], - }) - ) - ), - [] - ) - - // Get unrelayed and timed-out messages. - const { relayedMsgs, unrelayedMsgs, timedOutMsgs } = useMemo(() => { - const relayedMsgs = !polytoneResults.loading - ? polytoneResults.data.flatMap((loadable, index) => - loadable.state === 'hasValue' && - objectMatchesStructure(loadable.contents, { - callback: { - result: { - execute: { - Ok: {}, - }, - }, - }, - }) - ? polytoneMessages[index].initiatorMsg - : [] - ) - : [] - const unrelayedMsgs = !polytoneResults.loading - ? polytoneResults.data.flatMap((loadable, index) => - loadable.state === 'hasError' && - loadable.contents instanceof Error && - loadable.contents.message.includes( - 'polytone::callbacks::CallbackMessage not found' - ) - ? polytoneMessages[index].initiatorMsg - : [] - ) - : [] - const timedOutMsgs = !polytoneResults.loading - ? polytoneResults.data.flatMap((loadable, index) => - loadable.state === 'hasValue' && - objectMatchesStructure(loadable.contents, { - callback: { - result: { - execute: { - Err: {}, - }, - }, - }, - }) && - (loadable.contents.callback.result as any).execute.Err === 'timeout' - ? polytoneMessages[index].initiatorMsg - : [] - ) - : [] - - return { - relayedMsgs, - unrelayedMsgs, - timedOutMsgs, - } - }, [polytoneResults, polytoneMessages]) - - // Refresh every 10 seconds while anything is unrelayed. - const refreshUnreceivedIbcData = useRecoilCallback( - ({ set }) => - () => { - set(refreshUnreceivedIbcDataAtom(srcChainId), (id) => id + 1) - dstChainIds.forEach((chainId) => - set(refreshUnreceivedIbcDataAtom(chainId), (id) => id + 1) - ) - set(refreshPolytoneListenerResultsAtom, (id) => id + 1) - }, - useDeepCompareMemoize([srcChainId, dstChainIds]) - ) - const anyUnrelayed = unrelayedMsgs.length > 0 - useEffect(() => { - if (!anyUnrelayed) { - return - } - - const interval = setInterval(refreshUnreceivedIbcData, 10 * 1000) - return () => clearInterval(interval) - }, [anyUnrelayed, refreshUnreceivedIbcData]) - - const executedOverFiveMinutesAgo = - status === ProposalStatusEnum.Executed && - executedAt !== undefined && - // If executed over 5 minutes ago... - Date.now() - executedAt.getTime() > 5 * 60 * 1000 - const polytoneMessagesNeedingSelfRelay = polytoneResults.loading - ? undefined - : polytoneMessages.filter( - ({ polytoneConnection: { needsSelfRelay }, initiatorMsg }) => - // Needs self-relay or does not need self-relay but was executed a few - // minutes ago and still has not been relayed. - (!!needsSelfRelay || executedOverFiveMinutesAgo) && - // Not yet relayed. - unrelayedMsgs.includes(initiatorMsg) - ) - const hasPolytoneMessagesNeedingSelfRelay = - !!polytoneMessagesNeedingSelfRelay?.length - - const openPolytoneRelay = (transactionHash?: string) => - hasPolytoneMessagesNeedingSelfRelay && - openSelfRelayExecute({ - uniqueId: `${srcChainId}:${proposalModuleAddress}:${proposalNumber}`, - transaction: transactionHash - ? { - type: 'exists', - hash: transactionHash, - } - : { - type: 'execute', - msgs: [ - makeWasmMessage({ - wasm: { - execute: { - contract_addr: proposalModuleAddress, - funds: [], - msg: { - execute: { - proposal_id: proposalNumber, - }, - }, - }, - }, - }), - ], - }, - chainIds: uniq( - polytoneMessagesNeedingSelfRelay.map(({ chainId }) => chainId) - ), - }) - - return unreceivedPackets.loading || - unreceivedAcks.loading || - polytoneResults.loading || - txLoadable.loading - ? { - loading: true, - } - : { - loading: false, - data: { - hasPolytoneMessages: polytoneMessages.length > 0, - relayedMsgs, - unrelayedMsgs, - timedOutMsgs, - needsSelfRelay: hasPolytoneMessagesNeedingSelfRelay, - openPolytoneRelay: () => - status === ProposalStatusEnum.Executed && !loadingTxHash.loading - ? openPolytoneRelay(loadingTxHash.data) - : openPolytoneRelay(), - }, - } -} diff --git a/packages/stateful/hooks/useProposalRelayState.ts b/packages/stateful/hooks/useProposalRelayState.ts new file mode 100644 index 000000000..ec495e209 --- /dev/null +++ b/packages/stateful/hooks/useProposalRelayState.ts @@ -0,0 +1,399 @@ +import uniq from 'lodash.uniq' +import { useEffect, useMemo } from 'react' +import { + constSelector, + useRecoilCallback, + waitForAll, + waitForAllSettled, +} from 'recoil' +import { useDeepCompareMemoize } from 'use-deep-compare-effect' + +import { + PolytoneListenerSelectors, + ibcAckReceivedSelector, + ibcUnreceivedAcksSelector, + ibcUnreceivedPacketsSelector, + refreshIbcDataAtom, + refreshPolytoneListenerResultsAtom, + transactionPacketsSelector, +} from '@dao-dao/state/recoil' +import { + useCachedLoading, + useCachedLoadingWithError, + useDaoInfoContext, + useSupportedChainContext, +} from '@dao-dao/stateless' +import { + BaseProposalStatusAndInfoProps, + CosmosMsgFor_Empty, + LoadingData, + ProposalRelayState, + ProposalStatus, + ProposalStatusEnum, +} from '@dao-dao/types' +import { + decodeCrossChainMessages, + makeWasmMessage, + objectMatchesStructure, +} from '@dao-dao/utils' + +export type UseProposalRelayStateOptions = { + msgs: CosmosMsgFor_Empty[] + status: ProposalStatus + executedAt: Date | undefined + proposalModuleAddress: string + proposalNumber: number + openSelfRelayExecute: BaseProposalStatusAndInfoProps['openSelfRelayExecute'] + loadingTxHash: LoadingData +} + +export type UseProposalRelayStateReturn = LoadingData + +/** + * This hook uses information about a proposal and produces all the necessary + * state for the status of polytone message relays. It is used in the + * `useProposalActionState` hook. + */ +export const useProposalRelayState = ({ + msgs, + status, + executedAt, + proposalModuleAddress, + proposalNumber, + openSelfRelayExecute, + loadingTxHash, +}: UseProposalRelayStateOptions): UseProposalRelayStateReturn => { + const { coreAddress } = useDaoInfoContext() + const { + chain: { chain_id: srcChainId }, + } = useSupportedChainContext() + + const packetsLoadable = useCachedLoadingWithError( + loadingTxHash.loading || !loadingTxHash.data + ? constSelector(undefined) + : transactionPacketsSelector({ + chainId: srcChainId, + txHash: loadingTxHash.data, + }) + ) + + // Decoded cross-chain execute messages. + const { crossChainMessages, dstChainIds } = useMemo(() => { + const crossChainMessages = decodeCrossChainMessages( + srcChainId, + coreAddress, + msgs + ) + + const dstChainIds = uniq( + crossChainMessages.map(({ data: { chainId } }) => chainId) + ) + + return { + crossChainMessages, + dstChainIds, + } + }, [msgs, srcChainId, coreAddress]) + + // Get unreceived packets and acks. + const unreceivedPackets = useCachedLoading( + packetsLoadable.loading || packetsLoadable.errored + ? undefined + : waitForAll( + crossChainMessages.map(({ data: { chainId }, srcPort, dstPort }) => { + const packetsToCommit = (packetsLoadable.data || []).filter( + (packet) => + packet.sourcePort === srcPort && + packet.destinationPort === dstPort + ) + + return waitForAll( + packetsToCommit.map((packet) => + ibcUnreceivedPacketsSelector({ + chainId, + portId: dstPort, + channelId: packet.destinationChannel, + packetCommitmentSequences: [Number(packet.sequence)], + }) + ) + ) + }) + ), + [] + ) + const unreceivedAcks = useCachedLoading( + packetsLoadable.loading || packetsLoadable.errored + ? undefined + : waitForAll( + crossChainMessages.map(({ srcPort, dstPort }) => { + const packetsToAck = (packetsLoadable.data || []).filter( + (packet) => + packet.sourcePort === srcPort && + packet.destinationPort === dstPort + ) + + return waitForAll( + packetsToAck.map((packet) => + ibcUnreceivedAcksSelector({ + chainId: srcChainId, + portId: srcPort, + channelId: packet.sourceChannel, + packetAckSequences: [Number(packet.sequence)], + }) + ) + ) + }) + ), + [] + ) + const acksReceived = useCachedLoading( + packetsLoadable.loading || packetsLoadable.errored + ? undefined + : waitForAll( + crossChainMessages.map(({ data: { chainId }, srcPort, dstPort }) => { + const packetsToAck = (packetsLoadable.data || []).filter( + (packet) => + packet.sourcePort === srcPort && + packet.destinationPort === dstPort + ) + + return waitForAll( + packetsToAck.map((packet) => + ibcAckReceivedSelector({ + chainId, + portId: dstPort, + channelId: packet.destinationChannel, + sequence: Number(packet.sequence), + }) + ) + ) + }) + ), + [] + ) + + // Polytone relay results. + const polytoneRelayResults = useCachedLoading( + waitForAllSettled( + crossChainMessages.map((decoded) => + decoded.type === 'polytone' + ? PolytoneListenerSelectors.resultSelector({ + chainId: srcChainId, + contractAddress: decoded.data.polytoneConnection.listener, + params: [ + { + initiator: coreAddress, + initiatorMsg: decoded.data.initiatorMsg, + }, + ], + }) + : constSelector(undefined) + ) + ), + [] + ) + + // Get unrelayed and timed-out messages. + const { relayedMsgs, unrelayedMsgs, timedOutMsgs } = useMemo(() => { + const crossChainMessageStatuses = + packetsLoadable.loading || + packetsLoadable.errored || + unreceivedPackets.loading || + unreceivedAcks.loading || + acksReceived.loading || + polytoneRelayResults.loading + ? [] + : crossChainMessages.flatMap((decoded, index) => { + if (decoded.type === 'polytone') { + const result = polytoneRelayResults.data[index] + + return { + msg: decoded, + status: + result.state === 'hasError' && + result.contents instanceof Error && + result.contents.message.includes( + 'polytone::callbacks::CallbackMessage not found' + ) + ? 'unrelayed' + : result.state === 'hasValue' + ? objectMatchesStructure(result.contents, { + callback: { + result: { + execute: { + Ok: {}, + }, + }, + }, + }) + ? 'relayed' + : objectMatchesStructure(result.contents, { + callback: { + result: { + execute: { + Err: {}, + }, + }, + }, + }) && + (result.contents?.callback.result as any).execute + .Err === 'timeout' + ? 'timedOut' + : '' + : '', + } + } + + if (decoded.type === 'ica') { + // Get latest timeout of packets from this source. + const latestPacketTimeout = Math.max( + 0, + ...(packetsLoadable.data || []) + .filter((packet) => packet.sourcePort === decoded.srcPort) + .map((packet) => Number(packet.timeoutTimestamp)) + ) + + return { + msg: decoded, + status: + acksReceived.data[index]?.length && + acksReceived.data[index].every(Boolean) + ? 'relayed' + : unreceivedPackets.data[index]?.length && + unreceivedPackets.data[index].some(Boolean) + ? Date.now() > Number(latestPacketTimeout) / 1e6 + ? 'timedOut' + : 'unrelayed' + : unreceivedAcks.data[index]?.length && + unreceivedAcks.data[index].some(Boolean) + ? 'unrelayed' + : // If could not find ack or packet, assume unrelayed. + 'unrelayed', + } + } + + return [] + }) + + return { + relayedMsgs: crossChainMessageStatuses.flatMap(({ msg, status }) => + status === 'relayed' ? msg : [] + ), + unrelayedMsgs: crossChainMessageStatuses.flatMap(({ msg, status }) => + status === 'unrelayed' ? msg : [] + ), + timedOutMsgs: crossChainMessageStatuses.flatMap(({ msg, status }) => + status === 'timedOut' ? msg : [] + ), + } + }, [ + unreceivedPackets, + unreceivedAcks, + acksReceived, + polytoneRelayResults, + crossChainMessages, + packetsLoadable, + ]) + + // Refresh every 10 seconds while anything is unrelayed. + const refreshIbcData = useRecoilCallback( + ({ set }) => + () => { + set(refreshIbcDataAtom(srcChainId), (id) => id + 1) + dstChainIds.forEach((chainId) => + set(refreshIbcDataAtom(chainId), (id) => id + 1) + ) + set(refreshPolytoneListenerResultsAtom, (id) => id + 1) + }, + useDeepCompareMemoize([srcChainId, dstChainIds]) + ) + const anyUnrelayed = unrelayedMsgs.length > 0 + useEffect(() => { + if (!anyUnrelayed) { + return + } + + const interval = setInterval(refreshIbcData, 10 * 1000) + return () => clearInterval(interval) + }, [anyUnrelayed, refreshIbcData]) + + const executedOverFiveMinutesAgo = + status === ProposalStatusEnum.Executed && + executedAt !== undefined && + // If executed over 5 minutes ago... + Date.now() - executedAt.getTime() > 5 * 60 * 1000 + const messagesNeedingSelfRelay = + unreceivedPackets.loading || + unreceivedAcks.loading || + acksReceived.loading || + polytoneRelayResults.loading + ? undefined + : crossChainMessages.filter( + (decoded) => + // Not yet relayed. + unrelayedMsgs.includes(decoded) && + // Executed a few minutes ago and still has not been relayed, or the + // Polytone connection needs self-relay. + (executedOverFiveMinutesAgo || + (decoded.type === 'polytone' && + !!decoded.data.polytoneConnection.needsSelfRelay)) + ) + const hasCrossChainMessagesNeedingSelfRelay = + !!messagesNeedingSelfRelay?.length + + const openSelfRelay = (transactionHash?: string) => + hasCrossChainMessagesNeedingSelfRelay && + openSelfRelayExecute({ + uniqueId: `${srcChainId}:${proposalModuleAddress}:${proposalNumber}`, + transaction: transactionHash + ? { + type: 'exists', + hash: transactionHash, + } + : { + type: 'execute', + msgs: [ + makeWasmMessage({ + wasm: { + execute: { + contract_addr: proposalModuleAddress, + funds: [], + msg: { + execute: { + proposal_id: proposalNumber, + }, + }, + }, + }, + }), + ], + }, + crossChainMessages: messagesNeedingSelfRelay, + chainIds: uniq( + messagesNeedingSelfRelay.map(({ data: { chainId } }) => chainId) + ), + }) + + return unreceivedPackets.loading || + unreceivedAcks.loading || + acksReceived.loading || + polytoneRelayResults.loading || + packetsLoadable.loading + ? { + loading: true, + } + : { + loading: false, + data: { + hasCrossChainMessages: crossChainMessages.length > 0, + relayedMsgs, + unrelayedMsgs, + timedOutMsgs, + needsSelfRelay: hasCrossChainMessagesNeedingSelfRelay, + openSelfRelay: () => + status === ProposalStatusEnum.Executed && !loadingTxHash.loading + ? openSelfRelay(loadingTxHash.data) + : openSelfRelay(), + }, + } +} diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalStatusAndInfo.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalStatusAndInfo.tsx index 99f300d3d..0d7ebc4fb 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalStatusAndInfo.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalStatusAndInfo.tsx @@ -45,7 +45,7 @@ import { DaoProposalMultipleHooks, useAwaitNextBlock, useProposalActionState, - useProposalPolytoneState, + useProposalRelayState, useProposalVetoState, useWallet, } from '../../../../hooks' @@ -137,7 +137,7 @@ const InnerProposalStatusAndInfo = ({ sender: walletAddress, }) - const polytoneState = useProposalPolytoneState({ + const relayState = useProposalRelayState({ msgs: winningChoice?.msgs || [], status: proposal.status, executedAt: proposal.executedAt, @@ -148,7 +148,7 @@ const InnerProposalStatusAndInfo = ({ }) const { action, footer } = useProposalActionState({ statusKey, - polytoneState, + relayState, loadingExecutionTxHash, executeProposal, closeProposal, diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfo.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfo.tsx index f8dad3470..be160c39c 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfo.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfo.tsx @@ -48,7 +48,7 @@ import { DaoProposalSingleV2Hooks, useAwaitNextBlock, useProposalActionState, - useProposalPolytoneState, + useProposalRelayState, useProposalVetoState, useWallet, } from '../../../../hooks' @@ -192,7 +192,7 @@ const InnerProposalStatusAndInfo = ({ sender: walletAddress, }) - const polytoneState = useProposalPolytoneState({ + const relayState = useProposalRelayState({ msgs: proposal.msgs, status: proposal.status, executedAt: proposal.executedAt, @@ -203,7 +203,7 @@ const InnerProposalStatusAndInfo = ({ }) const { action, footer } = useProposalActionState({ statusKey, - polytoneState, + relayState, loadingExecutionTxHash, executeProposal, closeProposal, diff --git a/packages/stateless/components/proposal/ProposalCrossChainRelayStatus.tsx b/packages/stateless/components/proposal/ProposalCrossChainRelayStatus.tsx index a43690609..42b2caf21 100644 --- a/packages/stateless/components/proposal/ProposalCrossChainRelayStatus.tsx +++ b/packages/stateless/components/proposal/ProposalCrossChainRelayStatus.tsx @@ -1,19 +1,19 @@ import { useTranslation } from 'react-i18next' -import { ProposalPolytoneState } from '@dao-dao/types' +import { ProposalRelayState } from '@dao-dao/types' import { InfoCard } from '../InfoCard' export type ProposalCrossChainRelayStatusProps = { - state: ProposalPolytoneState + state: ProposalRelayState } export const ProposalCrossChainRelayStatus = ({ - state: { hasPolytoneMessages, needsSelfRelay, unrelayedMsgs, timedOutMsgs }, + state: { hasCrossChainMessages, needsSelfRelay, unrelayedMsgs, timedOutMsgs }, }: ProposalCrossChainRelayStatusProps) => { const { t } = useTranslation() - if (!hasPolytoneMessages) { + if (!hasCrossChainMessages) { return null } diff --git a/packages/types/components/SelfRelayExecuteModal.ts b/packages/types/components/SelfRelayExecuteModal.ts index cb4e14c18..275049230 100644 --- a/packages/types/components/SelfRelayExecuteModal.ts +++ b/packages/types/components/SelfRelayExecuteModal.ts @@ -1,4 +1,5 @@ import { CosmosMsgForEmpty } from '../contracts' +import { DecodedCrossChainMessage } from '../proposal' import { ModalProps } from './Modal' export type SelfRelayExecuteModalProps = Pick< @@ -13,6 +14,8 @@ export type SelfRelayExecuteModalProps = Pick< uniqueId: string // All chain IDs that will receive an IBC packet. chainIds: string[] + // Cross-chain messages that contain the packets that need self-relaying. + crossChainMessages: DecodedCrossChainMessage[] // Information on how to find the transaction to relay packets from. transaction: SelfRelayTransaction // Called when the self-relay execution is successful and all relayer wallets diff --git a/packages/types/proposal-module-adapter.ts b/packages/types/proposal-module-adapter.ts index 9a24c5578..55497ed0a 100644 --- a/packages/types/proposal-module-adapter.ts +++ b/packages/types/proposal-module-adapter.ts @@ -281,7 +281,7 @@ export type BaseProposalStatusAndInfoProps = { openSelfRelayExecute: ( props: Pick< SelfRelayExecuteModalProps, - 'uniqueId' | 'chainIds' | 'transaction' + 'uniqueId' | 'chainIds' | 'crossChainMessages' | 'transaction' > ) => void onExecuteSuccess: () => void | Promise diff --git a/packages/types/proposal.ts b/packages/types/proposal.ts index 0130f9d79..af49d1d2e 100644 --- a/packages/types/proposal.ts +++ b/packages/types/proposal.ts @@ -12,25 +12,25 @@ export type ProposalCreatedCardProps = Omit< 'className' | 'onMouseOver' | 'onMouseLeave' | 'LinkWrapper' > -export type ProposalPolytoneState = { +export type ProposalRelayState = { /** - * Whether or not there are any polytone messages. + * Whether or not there are any cross-chain messages. */ - hasPolytoneMessages: boolean + hasCrossChainMessages: boolean /** - * The initiator msgs that relayed successfully. + * The state for the decoded messages msgs that relayed successfully. */ - relayedMsgs: string[] + relayedMsgs: DecodedCrossChainMessage[] /** - * The initiator msgs that are unrelayed. + * The state for the decoded messages that are unrelayed. */ - unrelayedMsgs: string[] + unrelayedMsgs: DecodedCrossChainMessage[] /** - * The initiator msgs that timed out. + * The state for the decoded messages that timed out. */ - timedOutMsgs: string[] + timedOutMsgs: DecodedCrossChainMessage[] /** - * Whether or not there are polytone messages that need to be self-relayed. + * Whether or not there are cross-chain messages that need to be self-relayed. * Most chains have relayers set up, so no need to self-relay on those chains. * After a few minutes if there are still messages that need to be relayed, * they can be self-relayed. This will be true when unrelayed messages exist @@ -41,7 +41,7 @@ export type ProposalPolytoneState = { /** * Opens the execute and self-relay modal. */ - openPolytoneRelay: () => void + openSelfRelay: () => void } export type DecodedPolytoneMsgMatch = { @@ -100,6 +100,28 @@ export type DecodedIcaMsgNoMatch = { export type DecodedIcaMsg = DecodedIcaMsgNoMatch | DecodedIcaMsgMatch +export type DecodedCrossChainMessage = + | { + type: 'polytone' + data: DecodedPolytoneMsgMatch + srcConnection: string + srcChannel: string + srcPort: string + dstConnection: string + dstChannel: string + dstPort: string + } + | { + type: 'ica' + data: DecodedIcaMsgMatch + srcConnection: string + // Cannot determine srcChannel from decoded message. + srcPort: string + dstConnection: string + // Cannot determine dstChannel from decoded message. + dstPort: string + } + export enum ProcessedTQType { Majority, Absolute, diff --git a/packages/utils/actions.ts b/packages/utils/actions.ts index 19fee1506..e5557b528 100644 --- a/packages/utils/actions.ts +++ b/packages/utils/actions.ts @@ -60,9 +60,12 @@ export const convertActionsToMessages = ( // Filter out undefined messages. .filter(Boolean) as CosmosMsgForEmpty[] -// Get the address for the given action options for the given chain. If a DAO, -// this is the address of the native address on the same chain or the polytone -// proxy on that chain. For a wallet, this is the transformed bech32 address. +/** + * Get the address for the given action options for the given chain. If a DAO, + * this is the address of the native address on the same chain or the polytone + * proxy on that chain. For a wallet, this is the address registered in the + * wallet's profile, if any. + */ export const getChainAddressForActionOptions = ( { context, chain, address }: ActionOptions, chainId: string diff --git a/packages/utils/chain.ts b/packages/utils/chain.ts index 4d8a9aa67..37aca0511 100644 --- a/packages/utils/chain.ts +++ b/packages/utils/chain.ts @@ -302,8 +302,9 @@ export const getIbcTransferInfoBetweenChains = ( destChainId: string ): { sourceChain: IBCInfo['chain_1'] - destinationChain: IBCInfo['chain_1'] sourceChannel: string + destinationChain: IBCInfo['chain_1'] + destinationChannel: string info: IBCInfo } => { const { chain_name: srcChainName } = getChainForChainId(srcChainId) @@ -351,6 +352,7 @@ export const getIbcTransferInfoBetweenChains = ( sourceChain: info[`chain_${srcChainNumber}`], sourceChannel: channel[`chain_${srcChainNumber}`].channel_id, destinationChain: info[`chain_${destChainNumber}`], + destinationChannel: channel[`chain_${destChainNumber}`].channel_id, info, } } diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 2fc09b8f0..08b9b0816 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -1264,7 +1264,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ ] export const POLYTONE_CONFIG_PER_CHAIN: [ChainId, PolytoneConfig][] = - SUPPORTED_CHAINS.map(({ chainId, polytone = {} }) => [ + SUPPORTED_CHAINS.map(({ chainId, polytone: polytone = {} }) => [ chainId as ChainId, polytone, ]) diff --git a/packages/utils/messages/cw.ts b/packages/utils/messages/cw.ts index 80c6d5f68..88a7ba590 100644 --- a/packages/utils/messages/cw.ts +++ b/packages/utils/messages/cw.ts @@ -3,6 +3,7 @@ import { Coin } from '@cosmjs/proto-signing' import { v4 as uuidv4 } from 'uuid' import { + DecodedCrossChainMessage, DecodedIcaMsg, DecodedPolytoneMsg, cwMsgToProtobuf, @@ -250,8 +251,10 @@ export const maybeMakePolytoneExecuteMessage = ( }) } -// Checks if the message is a Polytone execute message and extracts the chain ID -// and msg(s). +/** + * Checks if the message is a Polytone execute message and extracts the chain ID + * and msg(s). + */ export const decodePolytoneExecuteMsg = ( srcChainId: string, decodedMsg: Record, @@ -313,8 +316,10 @@ export const decodePolytoneExecuteMsg = ( } } -// If the source and destination chains are different, this wraps the message in -// an ICA execution message. Otherwise, it just returns the message. +/** + * If the source and destination chains are different, this wraps the message in + * an ICA execution message. Otherwise, it just returns the message. + */ export const maybeMakeIcaExecuteMessage = ( srcChainId: string, destChainId: string, @@ -359,8 +364,10 @@ export const maybeMakeIcaExecuteMessage = ( }) } -// Checks if the message is an ICA execute message and extracts the chain ID and -// msg(s). +/** + * Checks if the message is an ICA execute message and extracts the chain ID and + * msg(s). + */ export const decodeIcaExecuteMsg = ( srcChainId: string, decodedMsg: Record, @@ -421,6 +428,49 @@ export const decodeIcaExecuteMsg = ( } } +/** + * Decode cross-chain messages, which is either polytone or ICA. + */ +export const decodeCrossChainMessages = ( + srcChainId: string, + srcAddress: string, + msgs: CosmosMsgFor_Empty[] +): DecodedCrossChainMessage[] => + decodeMessages(msgs).flatMap((msg): DecodedCrossChainMessage | [] => { + const decodedPolytone = decodePolytoneExecuteMsg(srcChainId, msg, 'any') + if (decodedPolytone.match) { + return { + type: 'polytone', + data: decodedPolytone, + srcConnection: decodedPolytone.polytoneConnection.localConnection, + srcChannel: decodedPolytone.polytoneConnection.localChannel, + srcPort: `wasm.${decodedPolytone.polytoneConnection.note}`, + dstConnection: decodedPolytone.polytoneConnection.remoteConnection, + dstChannel: decodedPolytone.polytoneConnection.remoteChannel, + dstPort: `wasm.${decodedPolytone.polytoneConnection.voice}`, + } + } + + const decodedIca = decodeIcaExecuteMsg(srcChainId, msg, 'any') + if (decodedIca.match) { + const ibcInfo = getIbcTransferInfoBetweenChains( + srcChainId, + decodedIca.chainId + ) + + return { + type: 'ica', + data: decodedIca, + srcConnection: ibcInfo.sourceChain.connection_id, + srcPort: `icacontroller-${srcAddress}`, + dstConnection: ibcInfo.destinationChain.connection_id, + dstPort: 'icahost', + } + } + + return [] + }) + /** * Wrap the message in a cw1-whitelist execution message. */ From 498ba0be61488a3e03d94556dedb79221b4bf658 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 8 Apr 2024 15:56:34 -0700 Subject: [PATCH 105/438] fixed manage SubDAOs action not showing SubDAOs to remove that are fake --- .../state/recoil/selectors/contracts/DaoCore.v2.ts | 14 ++++---------- .../core/dao_governance/ManageSubDaos/index.tsx | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/packages/state/recoil/selectors/contracts/DaoCore.v2.ts b/packages/state/recoil/selectors/contracts/DaoCore.v2.ts index 9be87b356..e66c78a84 100644 --- a/packages/state/recoil/selectors/contracts/DaoCore.v2.ts +++ b/packages/state/recoil/selectors/contracts/DaoCore.v2.ts @@ -1246,10 +1246,10 @@ export const listAllSubDaosSelector = selectorFamily< }) /** - * Get the configs for all this DAO's recognized SubDAOs that this DAO has admin - * power over. These will only be SubDAOs on the same chain. + * Get the configs for all this DAO's recognized SubDAOs. These will only be + * SubDAOs on the same chain. */ -export const allAdministratedSubDaoConfigsSelector = selectorFamily< +export const allSubDaoConfigsSelector = selectorFamily< (WithChainId<{ address: string }> & ConfigResponse)[], QueryClientParams >({ @@ -1257,13 +1257,7 @@ export const allAdministratedSubDaoConfigsSelector = selectorFamily< get: (queryClientParams) => async ({ get }) => { - const subDaos = get( - listAllSubDaosSelector({ - ...queryClientParams, - // Only get SubDAOs this DAO is the admin of. - onlyAdmin: true, - }) - ) + const subDaos = get(listAllSubDaosSelector(queryClientParams)) const subDaoConfigs = get( waitForAll( subDaos.map(({ chainId, addr }) => diff --git a/packages/stateful/actions/core/dao_governance/ManageSubDaos/index.tsx b/packages/stateful/actions/core/dao_governance/ManageSubDaos/index.tsx index 88a2a4e2c..5a877c0a7 100644 --- a/packages/stateful/actions/core/dao_governance/ManageSubDaos/index.tsx +++ b/packages/stateful/actions/core/dao_governance/ManageSubDaos/index.tsx @@ -38,7 +38,7 @@ const Component: ActionComponent = (props) => { } = useActionOptions() const currentSubDaos = useRecoilValue( - DaoCoreV2Selectors.allAdministratedSubDaoConfigsSelector({ + DaoCoreV2Selectors.allSubDaoConfigsSelector({ chainId, contractAddress: address, }) From a118ebf821464009839ce42bcaba152e6e5b5d9c Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 9 Apr 2024 19:49:15 -0700 Subject: [PATCH 106/438] added existing archway polytone connections --- .../components/SelfRelayExecuteModal.tsx | 19 ++-- packages/types/chain.ts | 1 + packages/utils/constants/chains.ts | 95 +++++++++++++++++++ 3 files changed, 106 insertions(+), 9 deletions(-) diff --git a/packages/stateful/components/SelfRelayExecuteModal.tsx b/packages/stateful/components/SelfRelayExecuteModal.tsx index 772adc0a0..8fac1270f 100644 --- a/packages/stateful/components/SelfRelayExecuteModal.tsx +++ b/packages/stateful/components/SelfRelayExecuteModal.tsx @@ -83,15 +83,16 @@ enum RelayStatus { } const RELAYER_FUNDS_NEEDED: Partial> = { - [ChainId.JunoMainnet]: 100000, - [ChainId.OsmosisMainnet]: 100000, - [ChainId.StargazeMainnet]: 2000000, - [ChainId.NeutronMainnet]: 500000, - [ChainId.TerraMainnet]: 100000, - [ChainId.MigalooMainnet]: 2000000, - [ChainId.KujiraMainnet]: 100000, - [ChainId.OraichainMainnet]: 100000, - [ChainId.ChihuahuaMainnet]: 1000000000, + [ChainId.JunoMainnet]: 0.1 * 10 ** 6, + [ChainId.OsmosisMainnet]: 0.1 * 10 ** 6, + [ChainId.StargazeMainnet]: 2 * 10 ** 6, + [ChainId.NeutronMainnet]: 0.5 * 10 ** 6, + [ChainId.TerraMainnet]: 0.1 * 10 ** 6, + [ChainId.MigalooMainnet]: 2 * 10 ** 6, + [ChainId.KujiraMainnet]: 0.1 * 10 ** 6, + [ChainId.OraichainMainnet]: 0.1 * 10 ** 6, + [ChainId.ChihuahuaMainnet]: 1000 * 10 ** 6, + [ChainId.ArchwayMainnet]: 1 * 10 ** 18, } type Relayer = { diff --git a/packages/types/chain.ts b/packages/types/chain.ts index 94eb32d8e..202880277 100644 --- a/packages/types/chain.ts +++ b/packages/types/chain.ts @@ -71,6 +71,7 @@ export enum ChainId { KujiraMainnet = 'kaiyo-1', ChihuahuaMainnet = 'chihuahua-1', OraichainMainnet = 'Oraichain', + ArchwayMainnet = 'archway-1', } export type BaseChainConfig = { diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 08b9b0816..e92b63512 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -221,6 +221,24 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // oraichain remoteChannel: 'channel-229', }, + [ChainId.ArchwayMainnet]: { + // juno + note: 'juno129y879p7fc7lwktj5c72cqrxyl6n9t4e3a9knr5mwjfc5algft0sw6ep29', + // juno + listener: + 'juno1j8hac83mnjtww379wkgffpvqvl3grtyrkmsznav6v0ktyrhfl77seu9mah', + // archway + voice: + 'archway16v6tzjhgt5v5mlfmh5x269vz5gc0t09flgzextspnkym6cc79m0qy0z40s', + // juno + localConnection: 'connection-379', + // archway + remoteConnection: 'connection-19', + // juno + localChannel: 'channel-413', + // archway + remoteChannel: 'channel-45', + }, }, }, { @@ -416,6 +434,24 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // oraichain remoteChannel: 'channel-214', }, + [ChainId.ArchwayMainnet]: { + // osmosis + note: 'osmo14528h5e3c9knxzp82tex0gehhwx2qmz7fm32ntk6yluas27aknssrqkled', + // osmosis + listener: + 'osmo1hddgcv5efr435d8hmlf6kacthn0xsffdljd3er3yq2nxag7kg8wsytx400', + // archway + voice: + 'archway1c7vceg88kylv0u6lpqc6fejqkw50shg0mm84kacpkdkwtljked9q0kgkcy', + // osmosis + localConnection: 'connection-2362', + // archway + remoteConnection: 'connection-1', + // osmosis + localChannel: 'channel-8144', + // archway + remoteChannel: 'channel-43', + }, }, }, { @@ -549,6 +585,24 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // kujira remoteChannel: 'channel-138', }, + [ChainId.ArchwayMainnet]: { + // neutron + note: 'neutron1kprjz0qusrcxvvhfklw0krn7g6ze36hzjuuhmktkepeyx5shljdqflwe2m', + // neutron + listener: + 'neutron1fh522a0x8h2wehc9wfqxwacnz7dqne0423qwrh07q8kz9ewnvdwqrhu0wv', + // archway + voice: + 'archway1qr94yuptq5h0nj5xctzft3q33262j2ajsquh42tpe0lptpev6rkswtfld5', + // neutron + localConnection: 'connection-43', + // archway + remoteConnection: 'connection-58', + // neutron + localChannel: 'channel-47', + // archway + remoteChannel: 'channel-85', + }, }, }, { @@ -717,6 +771,24 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // terra remoteChannel: 'channel-383', }, + [ChainId.ArchwayMainnet]: { + // stargaze + note: 'stars1ny7xvq2l07sgxdrak4qzrcj8eszyk5cwx34fkdshw4gyv84nyeus9cuw45', + // stargaze + listener: + 'stars14e2xhvph5ccteqxaes243na4dhskm4qx60eja75xg02kcdtg8lysdu7xug', + // archway + voice: + 'archway1hd4s3z4ga7f26eae4p44mp70dvr5my39d7l2qrh2hrl74jsv22dquc6h63', + // stargaze + localConnection: 'connection-258', + // archway + remoteConnection: 'connection-54', + // stargaze + localChannel: 'channel-248', + // archway + remoteChannel: 'channel-86', + }, }, }, { @@ -761,6 +833,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // - Neutron // TODO(polytone): Polytone does not yet exist with: // - Kujira + // - Archway polytone: { [ChainId.JunoMainnet]: { // migaloo @@ -1003,6 +1076,24 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // migaloo remoteChannel: 'channel-112', }, + [ChainId.ArchwayMainnet]: { + // terra + note: 'terra1x366fdkmpd88fvtjq09ksupjjgre6fr08zulwn3qe8mfefxfd3jswdmy3x', + // terra + listener: + 'terra1s5nmuezlqhgu5f063mklygkgde92fjds0trp7eaw55vz0fdzyl5s4qed79', + // archway + voice: + 'archway1ge0zdux54pn8f234l203nvugl4xnsr6hgv3tyah2wwm8qgz4y6esfzpwgg', + // terra + localConnection: 'connection-360', + // archway + remoteConnection: 'connection-47', + // terra + localChannel: 'channel-270', + // archway + remoteChannel: 'channel-54', + }, }, }, { @@ -1334,6 +1425,10 @@ export const CHAIN_ENDPOINTS: Partial< rpc: 'https://rpc.orai.io', rest: 'https://lcd.orai.io', }, + [ChainId.ArchwayMainnet]: { + rpc: 'https://archway-rpc.polkachu.com', + rest: 'https://archway-api.polkachu.com', + }, } // All configured chains. Configured chains are either supported chains, which From e64612fee482d547ae2b7073d970ab341fd79658 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 10 Apr 2024 11:00:00 -0700 Subject: [PATCH 107/438] default treasury history graph to day --- packages/stateful/components/TreasuryHistoryGraph.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stateful/components/TreasuryHistoryGraph.tsx b/packages/stateful/components/TreasuryHistoryGraph.tsx index 6a299ff73..cb519d733 100644 --- a/packages/stateful/components/TreasuryHistoryGraph.tsx +++ b/packages/stateful/components/TreasuryHistoryGraph.tsx @@ -70,7 +70,7 @@ export const TreasuryHistoryGraph = ({ const verticalLineColor = useNamedThemeColor('component-badge-valid') const [range, setRange] = useState( - TokenPriceHistoryRange.Month + TokenPriceHistoryRange.Day ) const treasuryValueHistory = useCachedLoadingWithError( From 3f8f62753b6499afea23974daba245b803690884 Mon Sep 17 00:00:00 2001 From: noah Date: Wed, 10 Apr 2024 21:13:20 +0200 Subject: [PATCH 108/438] Kujira Deployment (#1763) --- packages/i18n/locales/en/translation.json | 3 + .../recoil/selectors/contracts/DaoCore.v2.ts | 3 +- .../dao_governance/CreateDao/Component.tsx | 34 +++ .../core/dao_governance/CreateDao/README.md | 4 + .../core/dao_governance/CreateDao/index.tsx | 128 +++++++++++ .../actions/core/dao_governance/index.ts | 2 + .../UploadCode/Component.tsx | 2 +- .../stateful/components/dao/CreateDaoForm.tsx | 82 ++++++- .../components/gov/NewGovProposal.tsx | 23 +- .../stateful/creators/TokenBased/mutate.ts | 2 +- .../stateful/recoil/selectors/dao/cards.ts | 143 +++--------- .../stateful/recoil/selectors/dao/misc.ts | 207 ++++++++++++------ .../MigrateMigalooV4TokenFactory/index.tsx | 3 +- packages/types/actions.ts | 1 + packages/types/chain.ts | 6 +- packages/types/dao.ts | 4 +- packages/types/features.ts | 2 + packages/utils/README.md | 5 + packages/utils/constants/chains.ts | 174 ++++++++++++++- 19 files changed, 602 insertions(+), 226 deletions(-) create mode 100644 packages/stateful/actions/core/dao_governance/CreateDao/Component.tsx create mode 100644 packages/stateful/actions/core/dao_governance/CreateDao/README.md create mode 100644 packages/stateful/actions/core/dao_governance/CreateDao/index.tsx diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 5faebd84d..61e0827f8 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -927,6 +927,7 @@ "count": "Count", "createCrossChainAccountDescription": "Create an account for this DAO on another chain.", "createCrossChainAccountExplanation": "This action creates an account on another chain, allowing this DAO to perform actions on that chain.", + "createDaoActionDescription": "Create a new DAO.", "createDaoFeesExplanation": "Some chains charge fees to create new tokens. These fees are sent directly to the chain—not DAO DAO.", "createFirstOneQuestion": "Create the first one?", "createIcaDescription": "Create an account with the Interchain Accounts SDK module.", @@ -950,6 +951,7 @@ "daoAdminExecDescription": "Execute actions on behalf of a DAO with you as the admin. A parent DAO could use this to execute actions on behalf of a SubDAO.", "daoApproverExplanation": "An approver must approve proposals before they open for voting.", "daoCreationProcessExplanation": "Creating your DAO has never been this easy:", + "daoCreationRequiresChainGovProp": "{{chain}} requires that your DAO is created through a chain governance proposal. Click Continue to open the proposal creation page.", "daoInfoWillRefresh": "DAO information may take up to {{seconds}} seconds to update on all pages once proposal is executed.", "daoNameAZ": "DAO name (A → Z)", "daoNameZA": "DAO name (Z → A)", @@ -1543,6 +1545,7 @@ "createAProposal": "Create a proposal", "createASubDao": "Create a SubDAO", "createCrossChainAccount": "Create Cross-Chain Account", + "createDao": "Create DAO", "createIca": "Create ICA", "createNftCollection": "Create NFT Collection", "createPost": "Create Post", diff --git a/packages/state/recoil/selectors/contracts/DaoCore.v2.ts b/packages/state/recoil/selectors/contracts/DaoCore.v2.ts index e66c78a84..4a6ac6d0d 100644 --- a/packages/state/recoil/selectors/contracts/DaoCore.v2.ts +++ b/packages/state/recoil/selectors/contracts/DaoCore.v2.ts @@ -10,6 +10,7 @@ import { AccountType, GenericTokenBalance, GenericTokenBalanceWithOwner, + IndexerDumpState, PolytoneProxies, TokenType, WithChainId, @@ -241,7 +242,7 @@ export const _cw721TokenListSelector = selectorFamily< // Reduced to only the necessary subset which can be provided by both the // indexer and chain. export const dumpStateSelector = selectorFamily< - DumpStateResponse | undefined, + DumpStateResponse | IndexerDumpState | undefined, QueryClientParams & { params: Parameters } diff --git a/packages/stateful/actions/core/dao_governance/CreateDao/Component.tsx b/packages/stateful/actions/core/dao_governance/CreateDao/Component.tsx new file mode 100644 index 000000000..19c7c33a8 --- /dev/null +++ b/packages/stateful/actions/core/dao_governance/CreateDao/Component.tsx @@ -0,0 +1,34 @@ +import { ComponentType } from 'react' + +import { DaoHeader } from '@dao-dao/stateless' +import { + ActionComponent, + DaoParentInfo, + LinkWrapperProps, +} from '@dao-dao/types' + +export type CreateDaoData = { + admin?: string | null + name: string + description: string + imageUrl?: string +} + +export type CreateDaoOptions = { + // Defined if admin is set to a DAO. + parentDao?: DaoParentInfo + + LinkWrapper: ComponentType +} + +export const CreateDaoComponent: ActionComponent< + CreateDaoOptions, + CreateDaoData +> = ({ data, options: { parentDao, LinkWrapper } }) => ( + +) diff --git a/packages/stateful/actions/core/dao_governance/CreateDao/README.md b/packages/stateful/actions/core/dao_governance/CreateDao/README.md new file mode 100644 index 000000000..d3e113569 --- /dev/null +++ b/packages/stateful/actions/core/dao_governance/CreateDao/README.md @@ -0,0 +1,4 @@ +# CreateDao + +Render DAO creation nicely to improve the UI of governance proposals that create +DAOs. diff --git a/packages/stateful/actions/core/dao_governance/CreateDao/index.tsx b/packages/stateful/actions/core/dao_governance/CreateDao/index.tsx new file mode 100644 index 000000000..1e0a944f7 --- /dev/null +++ b/packages/stateful/actions/core/dao_governance/CreateDao/index.tsx @@ -0,0 +1,128 @@ +import { useCallback } from 'react' +import { constSelector } from 'recoil' + +import { + DaoEmoji, + useCachedLoadingWithError, + useChain, +} from '@dao-dao/stateless' +import { + ActionComponent, + ActionKey, + ActionMaker, + UseDecodedCosmosMsg, + UseDefaults, + UseTransformToCosmos, +} from '@dao-dao/types' +import { decodeJsonFromBase64, objectMatchesStructure } from '@dao-dao/utils' + +import { LinkWrapper } from '../../../../components' +import { daoParentInfoSelector } from '../../../../recoil' +import { CreateDaoComponent, CreateDaoData } from './Component' + +const Component: ActionComponent = (props) => { + const { chain_id: chainId } = useChain() + + // If admin is set, attempt to load parent DAO info. + const parentDao = useCachedLoadingWithError( + props.data.admin + ? daoParentInfoSelector({ + chainId, + parentAddress: props.data.admin, + }) + : constSelector(undefined) + ) + + return ( + + ) +} + +const useDefaults: UseDefaults = () => ({ + name: '', + description: '', + imageUrl: '', +}) + +const useTransformToCosmos: UseTransformToCosmos = () => + useCallback(() => undefined, []) + +const useDecodedCosmosMsg: UseDecodedCosmosMsg = (msg) => { + if ( + !objectMatchesStructure(msg, { + wasm: { + execute: { + contract_addr: {}, + funds: {}, + msg: { + instantiate_contract_with_self_admin: { + code_id: {}, + instantiate_msg: {}, + label: {}, + }, + }, + }, + }, + }) + ) { + return { + match: false, + } + } + + try { + const decoded = decodeJsonFromBase64( + msg.wasm.execute.msg.instantiate_contract_with_self_admin.instantiate_msg + ) + if ( + !objectMatchesStructure(decoded, { + admin: {}, + automatically_add_cw20s: {}, + automatically_add_cw721s: {}, + name: {}, + description: {}, + image_url: {}, + proposal_modules_instantiate_info: {}, + voting_module_instantiate_info: {}, + }) + ) { + return { + match: false, + } + } + + return { + match: true, + data: { + admin: decoded.admin, + name: decoded.name, + description: decoded.description, + imageUrl: decoded.image_url, + }, + } + } catch {} + + return { + match: false, + } +} + +export const makeCreateDaoAction: ActionMaker = ({ t }) => ({ + key: ActionKey.CreateDao, + label: t('title.createDao'), + description: t('info.createDaoActionDescription'), + Icon: DaoEmoji, + Component, + useDefaults, + useTransformToCosmos, + useDecodedCosmosMsg, + // Only use for rendering. + hideFromPicker: true, +}) diff --git a/packages/stateful/actions/core/dao_governance/index.ts b/packages/stateful/actions/core/dao_governance/index.ts index 234665b3d..a75740b40 100644 --- a/packages/stateful/actions/core/dao_governance/index.ts +++ b/packages/stateful/actions/core/dao_governance/index.ts @@ -1,6 +1,7 @@ import { ActionCategoryKey, ActionCategoryMaker } from '@dao-dao/types' import { makeCreateCrossChainAccountAction } from './CreateCrossChainAccount' +import { makeCreateDaoAction } from './CreateDao' import { makeDaoAdminExecAction } from './DaoAdminExec' import { makeEnableMultipleChoiceAction } from './EnableMultipleChoice' import { makeManageStorageItemsAction } from './ManageStorageItems' @@ -37,5 +38,6 @@ export const makeDaoGovernanceActionCategory: ActionCategoryMaker = ({ makeNeutronOverruleSubDaoProposalAction, makeUpdateProposalConfigAction, makeUpdatePreProposeConfigAction, + makeCreateDaoAction, ], }) diff --git a/packages/stateful/actions/core/smart_contracting/UploadCode/Component.tsx b/packages/stateful/actions/core/smart_contracting/UploadCode/Component.tsx index 121a0c840..b08a0b659 100644 --- a/packages/stateful/actions/core/smart_contracting/UploadCode/Component.tsx +++ b/packages/stateful/actions/core/smart_contracting/UploadCode/Component.tsx @@ -88,7 +88,7 @@ export const UploadCodeComponent: ActionComponent = ({ }, [data, sha256Checksum, updateSha256Checksum]) const onSelect = async (file: File) => { - if (!file.name.endsWith('.wasm')) { + if (!file.name.endsWith('.wasm') && !file.name.endsWith('.gz')) { toast.error(t('error.invalidWasmFile')) return } diff --git a/packages/stateful/components/dao/CreateDaoForm.tsx b/packages/stateful/components/dao/CreateDaoForm.tsx index 76f3ab635..4f6dce7be 100644 --- a/packages/stateful/components/dao/CreateDaoForm.tsx +++ b/packages/stateful/components/dao/CreateDaoForm.tsx @@ -1,6 +1,7 @@ import { ArrowBack } from '@mui/icons-material' import cloneDeep from 'lodash.clonedeep' import merge from 'lodash.merge' +import { useRouter } from 'next/router' import { useEffect, useMemo, useState } from 'react' import { FormProvider, @@ -21,6 +22,7 @@ import { ImageSelector, Loader, TooltipInfoIcon, + WarningCard, useAppContext, useCachedLoadable, useDaoNavHelpers, @@ -28,11 +30,13 @@ import { useThemeContext, } from '@dao-dao/stateless' import { + ActionKey, CreateDaoContext, CreateDaoCustomValidator, DaoPageMode, DaoParentInfo, DaoTabId, + GovernanceProposalActionData, NewDao, ProposalModuleAdapter, } from '@dao-dao/types' @@ -46,8 +50,10 @@ import { convertMicroDenomToDenomWithDecimals, encodeJsonToBase64, findWasmAttributeValue, + getDisplayNameForChainId, getFallbackImage, getFundsFromDaoInstantiateMsg, + getGovProposalPath, getNativeTokenForChainId, getSupportedChainConfig, getSupportedChains, @@ -55,6 +61,7 @@ import { processError, } from '@dao-dao/utils' +import { ExecuteData } from '../../actions/core/smart_contracting/Execute/Component' import { getCreatorById, getCreators } from '../../creators' import { GovernanceTokenType, @@ -139,10 +146,16 @@ export const InnerCreateDaoForm = ({ }: CreateDaoFormProps) => { const { t } = useTranslation() + const router = useRouter() const chainContext = useSupportedChainContext() const { chainId, - config: { factoryContractAddress, codeIds }, + config: { + name: chainGovName, + factoryContractAddress, + codeIds, + createViaGovernance, + }, } = chainContext const { goToDao } = useDaoNavHelpers() @@ -297,6 +310,8 @@ export const InnerCreateDaoForm = ({ // Override with SubDAO button if necessary. submitValue === CreateDaoSubmitValue.Create && makingSubDao ? t('button.createSubDao') + : submitValue === CreateDaoSubmitValue.Create && createViaGovernance + ? t('button.continue') : t(submitValue) //! Adapters and message generators @@ -455,7 +470,51 @@ export const InnerCreateDaoForm = ({ // Create the DAO. if (submitterValue === CreateDaoSubmitValue.Create) { - if (isWalletConnected) { + if (createViaGovernance) { + if (instantiateMsgError) { + toast.error(processError(instantiateMsgError)) + return + } else if (!instantiateMsg) { + toast.error(t('error.loadingData')) + return + } + + setCreating(true) + + // Redirect to prefilled chain governance prop page. + router.push( + getGovProposalPath(chainGovName, 'create', { + prefill: encodeJsonToBase64({ + chainId, + title: `Create DAO: ${name.trim()}`, + description: 'This proposal creates a new DAO.', + _actionData: [ + { + _id: 'create', + actionKey: ActionKey.Execute, + data: { + chainId, + address: factoryContractAddress, + message: JSON.stringify( + { + instantiate_contract_with_self_admin: { + code_id: codeIds.DaoCore, + instantiate_msg: encodeJsonToBase64(instantiateMsg), + label: instantiateMsg.name, + }, + }, + null, + 2 + ), + funds: [], + cw20: false, + } as ExecuteData, + }, + ], + } as Partial), + }) + ) + } else if (isWalletConnected) { setCreating(true) try { const coreAddress = await toast.promise(createDaoWithFactory(), { @@ -688,7 +747,7 @@ export const InnerCreateDaoForm = ({ watch={form.watch} /> -

+

{t('form.addAnImage')}

@@ -705,7 +764,7 @@ export const InnerCreateDaoForm = ({ {/* Divider line shown after first page. */} {pageIndex > 0 && ( -
+
)}
@@ -742,8 +801,19 @@ export const InnerCreateDaoForm = ({ )}
+ {submitValue === CreateDaoSubmitValue.Create && createViaGovernance && ( +
+ +
+ )} +
- +

{t(CreateDaoSubmitValue.Back)}

)} diff --git a/packages/stateful/components/gov/NewGovProposal.tsx b/packages/stateful/components/gov/NewGovProposal.tsx index e39a43231..8ef719a20 100644 --- a/packages/stateful/components/gov/NewGovProposal.tsx +++ b/packages/stateful/components/gov/NewGovProposal.tsx @@ -37,7 +37,6 @@ import { } from 'recoil' import { - govParamsSelector, govProposalCreatedCardPropsAtom, govProposalSelector, latestProposalSaveAtom, @@ -89,7 +88,7 @@ import { processError, } from '@dao-dao/utils' -import { WalletActionsProvider } from '../../actions' +import { WalletActionsProvider, useActionOptions } from '../../actions' import { makeGovernanceProposalAction } from '../../actions/core/chain_governance/GovernanceProposal' import { useEntity } from '../../hooks' import { useWallet } from '../../hooks/useWallet' @@ -172,7 +171,6 @@ export const NewGovProposal = (innerProps: NewGovProposalProps) => { if ( objectMatchesStructure(prefillData, { chainId: {}, - version: {}, title: {}, description: {}, }) @@ -249,6 +247,11 @@ const InnerNewGovProposal = ({ chainWallet, } = useWallet() + const { context } = useActionOptions() + if (context.type !== ActionContextType.Gov) { + throw new Error(`Unsupported context: ${context}`) + } + const [loading, setLoading] = useState(false) const [showPreview, setShowPreview] = useState(false) @@ -278,12 +281,6 @@ const InnerNewGovProposal = ({ reset, } = formMethods - const govParams = useRecoilValue( - govParamsSelector({ - chainId: chainContext.chainId, - }) - ) - const holdingAltForDirectSign = useHoldingKey({ key: 'alt' }) const onSubmitError: SubmitErrorHandler = @@ -436,13 +433,13 @@ const InnerNewGovProposal = ({ { Icon: BookOutlined, label: `${t('title.threshold')}: ${formatPercentOf100( - govParams.threshold * 100 + context.params.threshold * 100 )}`, }, { Icon: FlagOutlined, label: `${t('title.quorum')}: ${formatPercentOf100( - govParams.quorum * 100 + context.params.quorum * 100 )}`, }, ...(endTime @@ -497,8 +494,8 @@ const InnerNewGovProposal = ({ chainContext.chain.pretty_name, chainContext.config.name, setGovProposalCreatedCardProps, - govParams.threshold, - govParams.quorum, + context.params.threshold, + context.params.quorum, refreshGovProposals, setLatestProposalSave, router, diff --git a/packages/stateful/creators/TokenBased/mutate.ts b/packages/stateful/creators/TokenBased/mutate.ts index 3ac3f2ef8..31ff0cdea 100644 --- a/packages/stateful/creators/TokenBased/mutate.ts +++ b/packages/stateful/creators/TokenBased/mutate.ts @@ -82,7 +82,7 @@ export const mutate: DaoCreatorMutate = ( active_threshold, token_info: { new: { - token_issuer_code_id: codeIds.CwTokenfactoryIssuerOsmosis, + token_issuer_code_id: codeIds.CwTokenfactoryIssuerMain, subdenom: symbol.toLowerCase(), initial_balances: microInitialBalances, initial_dao_balance: microInitialTreasuryBalance, diff --git a/packages/stateful/recoil/selectors/dao/cards.ts b/packages/stateful/recoil/selectors/dao/cards.ts index faebb3efd..8081cacc4 100644 --- a/packages/stateful/recoil/selectors/dao/cards.ts +++ b/packages/stateful/recoil/selectors/dao/cards.ts @@ -2,15 +2,11 @@ import { RecoilValueReadOnly, selectorFamily, waitForAll } from 'recoil' import { DaoCoreV2Selectors, - addressIsModuleSelector, - contractInfoSelector, contractInstantiateTimeSelector, contractVersionSelector, daoTvlSelector, - isDaoSelector, } from '@dao-dao/state' import { - ContractVersion, DaoCardInfo, DaoCardInfoLazyData, DaoDropdownInfo, @@ -19,26 +15,20 @@ import { IndexerDumpState, WithChainId, } from '@dao-dao/types' +import { DumpStateResponse as CwCoreV1DumpStateResponse } from '@dao-dao/types/contracts/CwCore.v1' +import { DumpStateResponse as DaoCoreV2DumpStateResponse } from '@dao-dao/types/contracts/DaoCore.v2' import { - ConfigResponse as CwCoreV1ConfigResponse, - DumpStateResponse as CwCoreV1DumpStateResponse, -} from '@dao-dao/types/contracts/CwCore.v1' -import { - ConfigResponse as DaoCoreV2ConfigResponse, - DumpStateResponse as DaoCoreV2DumpStateResponse, -} from '@dao-dao/types/contracts/DaoCore.v2' -import { - CHAIN_SUBDAOS, - getDisplayNameForChainId, getFallbackImage, - getImageUrlForChainId, - getSupportedChainConfig, isFeatureSupportedByVersion, parseContractVersion, } from '@dao-dao/utils' import { proposalModuleAdapterProposalCountSelector } from '../../../proposal-module-adapter' -import { daoCoreProposalModulesSelector, daoInfoSelector } from './misc' +import { + daoCoreProposalModulesSelector, + daoInfoSelector, + daoParentInfoSelector, +} from './misc' export const daoCardInfoSelector = selectorFamily< DaoCardInfo | undefined, @@ -84,97 +74,30 @@ export const daoCardInfoSelector = selectorFamily< ) // Get parent DAO if exists. - let parentDao: DaoCardInfo['parentDao'] + let parentDao: DaoCardInfo['parentDao'] = undefined if ( admin && // A DAO without a parent DAO may be its own admin. admin !== coreAddress ) { - if ( - // If address is a DAO contract. - get( - isDaoSelector({ - address: admin, - chainId, - }) - ) - ) { - // Indexer may return `adminInfo`, in which case don't query again. If - // null, there is no admin to load. Otherwise. If not null, query - // chain. - if ('adminInfo' in dumpedState) { - const { adminInfo } = dumpedState as IndexerDumpState - if (adminInfo) { - const { - admin: adminAdmin, - info, - config: { name, image_url }, - registeredSubDao = false, - } = adminInfo - const coreVersion = info && parseContractVersion(info.version) - - if (coreVersion) { - parentDao = { - chainId, - coreAddress: admin, - coreVersion, - name, - imageUrl: image_url || getFallbackImage(admin), - admin: adminAdmin ?? '', - registeredSubDao, - } - } - } - - // If indexer didn't return adminInfo, query chain. - } else { - const adminAdmin = get( - DaoCoreV2Selectors.adminSelector({ - contractAddress: admin, - chainId, - params: [], - }) - ) + // Indexer may return `adminInfo`, in which case don't query again. If + // null, there is no admin to load. Otherwise. If not null, query + // chain. + if ('adminInfo' in dumpedState && dumpedState.adminInfo !== undefined) { + if (dumpedState.adminInfo) { const { - info: { version }, - } = get( - contractInfoSelector({ - contractAddress: admin, - chainId, - }) - ) - const adminVersion = parseContractVersion(version) - - if (adminVersion) { - const { - name, - image_url, - }: CwCoreV1ConfigResponse | DaoCoreV2ConfigResponse = get( - // Both v1 and v2 have a config query. - DaoCoreV2Selectors.configSelector({ - contractAddress: admin, - chainId, - params: [], - }) - ) - - // Check if admin has registered the current DAO as a SubDAO. - const registeredSubDao = isFeatureSupportedByVersion( - Feature.SubDaos, - adminVersion - ) - ? get( - DaoCoreV2Selectors.listAllSubDaosSelector({ - contractAddress: admin, - chainId, - }) - ).some(({ addr }) => addr === coreAddress) - : false + admin: adminAdmin, + info, + config: { name, image_url }, + registeredSubDao = false, + } = dumpedState.adminInfo + const coreVersion = info && parseContractVersion(info.version) + if (coreVersion) { parentDao = { chainId, coreAddress: admin, - coreVersion: adminVersion, + coreVersion, name, imageUrl: image_url || getFallbackImage(admin), admin: adminAdmin ?? '', @@ -182,26 +105,16 @@ export const daoCardInfoSelector = selectorFamily< } } } - } else if ( - get( - addressIsModuleSelector({ + + // If indexer didn't return adminInfo or doesn't exist, query chain. + } else { + parentDao = get( + daoParentInfoSelector({ chainId, - address: admin, - moduleName: 'gov', + parentAddress: admin, + childAddress: coreAddress, }) ) - ) { - // Chain module account. - const chainConfig = getSupportedChainConfig(chainId) - parentDao = chainConfig && { - chainId, - coreAddress: chainConfig.name, - coreVersion: ContractVersion.Gov, - name: getDisplayNameForChainId(chainId), - imageUrl: getImageUrlForChainId(chainId), - admin: '', - registeredSubDao: !!CHAIN_SUBDAOS[chainId]?.includes(coreAddress), - } } } diff --git a/packages/stateful/recoil/selectors/dao/misc.ts b/packages/stateful/recoil/selectors/dao/misc.ts index a04f6dee3..7ff968179 100644 --- a/packages/stateful/recoil/selectors/dao/misc.ts +++ b/packages/stateful/recoil/selectors/dao/misc.ts @@ -1,10 +1,5 @@ import uniq from 'lodash.uniq' -import { - RecoilValueReadOnly, - selectorFamily, - waitForAll, - waitForAllSettled, -} from 'recoil' +import { selectorFamily, waitForAll, waitForAllSettled } from 'recoil' import { DaoCoreV2Selectors, @@ -25,6 +20,7 @@ import { ContractVersionInfo, DaoInfo, DaoPageMode, + DaoParentInfo, DaoWithDropdownVetoableProposalList, DaoWithVetoableProposals, Feature, @@ -33,6 +29,8 @@ import { StatefulProposalLineProps, WithChainId, } from '@dao-dao/types' +import { ConfigResponse as CwCoreV1ConfigResponse } from '@dao-dao/types/contracts/CwCore.v1' +import { ConfigResponse as DaoCoreV2ConfigResponse } from '@dao-dao/types/contracts/DaoCore.v2' import { CHAIN_SUBDAOS, DAO_CORE_CONTRACT_NAMES, @@ -40,9 +38,12 @@ import { VETOABLE_DAOS_ITEM_KEY_PREFIX, getDaoProposalPath, getDisplayNameForChainId, + getFallbackImage, getImageUrlForChainId, getSupportedChainConfig, getSupportedFeatures, + isFeatureSupportedByVersion, + parseContractVersion, } from '@dao-dao/utils' import { fetchProposalModules } from '../../../utils/fetchProposalModules' @@ -155,14 +156,16 @@ export const daoPotentialSubDaosSelector = selectorFamily< }, }) -export const daoInfoSelector: (param: { - chainId: string - coreAddress: string - ignoreAdmins?: string[] | undefined -}) => RecoilValueReadOnly = selectorFamily({ +export const daoInfoSelector = selectorFamily< + DaoInfo, + { + chainId: string + coreAddress: string + } +>({ key: 'daoInfo', get: - ({ chainId, coreAddress, ignoreAdmins }) => + ({ chainId, coreAddress }) => ({ get }) => { const dumpState = get( DaoCoreV2Selectors.dumpStateSelector({ @@ -264,57 +267,16 @@ export const daoInfoSelector: (param: { const { admin } = dumpState - let parentDaoInfo - let parentSubDaos - if (admin && admin !== coreAddress) { - if ( - get( - isDaoSelector({ - address: admin, - chainId, - }) - ) && - !ignoreAdmins?.includes(admin) - ) { - parentDaoInfo = get( - daoInfoSelector({ - chainId, - coreAddress: admin, - ignoreAdmins: [...(ignoreAdmins ?? []), coreAddress], - }) - ) - - if (parentDaoInfo.supportedFeatures[Feature.SubDaos]) { - parentSubDaos = get( - DaoCoreV2Selectors.listAllSubDaosSelector({ - contractAddress: admin, + const parentDao: DaoParentInfo | null = + admin && admin !== coreAddress + ? get( + daoParentInfoSelector({ chainId, + parentAddress: admin, + childAddress: coreAddress, }) - ).map(({ addr }) => addr) - } - } else if ( - get( - addressIsModuleSelector({ - chainId, - address: admin, - moduleName: 'gov', - }) - ) - ) { - // Chain module account. - const chainConfig = getSupportedChainConfig(chainId) - parentDaoInfo = chainConfig && { - chainId, - coreAddress: chainConfig.name, - coreVersion: ContractVersion.Gov, - name: getDisplayNameForChainId(chainId), - imageUrl: getImageUrlForChainId(chainId), - admin: '', - registeredSubDao: false, - } - parentSubDaos = CHAIN_SUBDAOS[chainId] ?? [] - } - } + ) || null + : null const daoInfo: DaoInfo = { chainId, @@ -333,18 +295,7 @@ export const daoInfoSelector: (param: { items, polytoneProxies, accounts, - parentDao: parentDaoInfo - ? { - chainId: parentDaoInfo.chainId, - coreAddress: parentDaoInfo.coreAddress, - coreVersion: parentDaoInfo.coreVersion, - name: parentDaoInfo.name, - imageUrl: parentDaoInfo.imageUrl || null, - parentDao: parentDaoInfo.parentDao, - admin: parentDaoInfo.admin, - registeredSubDao: !!parentSubDaos?.includes(coreAddress), - } - : null, + parentDao, admin, } @@ -352,6 +303,116 @@ export const daoInfoSelector: (param: { }, }) +/** + * Attempt to fetch the info needed to describe a parent DAO. Returns undefined + * if not a DAO nor the chain gov module account. + */ +export const daoParentInfoSelector = selectorFamily< + DaoParentInfo | undefined, + WithChainId<{ + parentAddress: string + /** + * To determine if the parent has registered the child, pass the child. This + * will set `registeredSubDao` appropriately. Otherwise, if undefined, + * `registeredSubDao` will be set to false. + */ + childAddress?: string + }> +>({ + key: 'daoParentInfo', + get: + ({ chainId, parentAddress, childAddress }) => + ({ get }) => { + // If address is a DAO contract... + if ( + get( + isDaoSelector({ + chainId, + address: parentAddress, + }) + ) + ) { + const parentAdmin = get( + DaoCoreV2Selectors.adminSelector({ + chainId, + contractAddress: parentAddress, + params: [], + }) + ) + const { + info: { version }, + } = get( + contractInfoSelector({ + chainId, + contractAddress: parentAddress, + }) + ) + const parentVersion = parseContractVersion(version) + + if (parentVersion) { + const { + name, + image_url, + }: CwCoreV1ConfigResponse | DaoCoreV2ConfigResponse = get( + // Both v1 and v2 have a config query. + DaoCoreV2Selectors.configSelector({ + chainId, + contractAddress: parentAddress, + params: [], + }) + ) + + // Check if parent has registered the child DAO as a SubDAO. + const registeredSubDao = + childAddress && + isFeatureSupportedByVersion(Feature.SubDaos, parentVersion) + ? get( + DaoCoreV2Selectors.listAllSubDaosSelector({ + contractAddress: parentAddress, + chainId, + }) + ).some(({ addr }) => addr === childAddress) + : false + + return { + chainId, + coreAddress: parentAddress, + coreVersion: parentVersion, + name, + imageUrl: image_url || getFallbackImage(parentAddress), + admin: parentAdmin ?? '', + registeredSubDao, + } + } + + // If address is the chain's x/gov module account... + } else if ( + get( + addressIsModuleSelector({ + chainId, + address: parentAddress, + moduleName: 'gov', + }) + ) + ) { + const chainConfig = getSupportedChainConfig(chainId) + return ( + chainConfig && { + chainId, + coreAddress: chainConfig.name, + coreVersion: ContractVersion.Gov, + name: getDisplayNameForChainId(chainId), + imageUrl: getImageUrlForChainId(chainId), + admin: '', + registeredSubDao: + !!childAddress && + !!CHAIN_SUBDAOS[chainId]?.includes(childAddress), + } + ) + } + }, +}) + export const daoInfoFromPolytoneProxySelector = selectorFamily< | { chainId: string diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/MigrateMigalooV4TokenFactory/index.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/MigrateMigalooV4TokenFactory/index.tsx index 38a79c099..083743548 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/MigrateMigalooV4TokenFactory/index.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/MigrateMigalooV4TokenFactory/index.tsx @@ -48,8 +48,7 @@ export const makeMigrateMigalooV4TokenFactoryAction: ActionMaker< wasm: { migrate: { contract_addr: tokenFactoryIssuerAddress, - new_code_id: - chainContext.config.codeIds.CwTokenfactoryIssuerOsmosis, + new_code_id: chainContext.config.codeIds.CwTokenfactoryIssuerMain, msg: {}, }, }, diff --git a/packages/types/actions.ts b/packages/types/actions.ts index 095ed8237..f85a0ceec 100644 --- a/packages/types/actions.ts +++ b/packages/types/actions.ts @@ -82,6 +82,7 @@ export enum ActionKey { UpdatePreProposeConfig = 'updatePreProposeConfig', UpdateProposalConfig = 'updateProposalConfig', MigrateMigalooV4TokenFactory = 'migrateMigalooV4TokenFactory', + CreateDao = 'createDao', // Press CreatePost = 'createPost', UpdatePost = 'updatePost', diff --git a/packages/types/chain.ts b/packages/types/chain.ts index 202880277..397a4220a 100644 --- a/packages/types/chain.ts +++ b/packages/types/chain.ts @@ -147,6 +147,10 @@ export type SupportedChainConfig = BaseChainConfig & { * factory native tokens. Defaults to false. */ createWithCw20?: boolean + /** + * Whether or not to create a DAO through chain governance. + */ + createViaGovernance?: boolean /** * Whether or not this chain has an indexer. */ @@ -176,7 +180,7 @@ export type CodeIdConfig = { // https://github.com/DA0-DA0/dao-contracts CwPayrollFactory: number CwTokenSwap: number - CwTokenfactoryIssuerOsmosis: number + CwTokenfactoryIssuerMain: number CwVesting: number DaoCore: number DaoMigrator: number diff --git a/packages/types/dao.ts b/packages/types/dao.ts index 60dfccd74..72f36e3e3 100644 --- a/packages/types/dao.ts +++ b/packages/types/dao.ts @@ -189,14 +189,14 @@ export type ProposalModule = { prePropose: PreProposeModule | null } & ProposalModuleTypedConfig -export interface ProposalPrefill { +export type ProposalPrefill = { // Proposal module adapter ID id: string // Proposal module adapter proposal creation form data data: FormData } -export interface ProposalDraft { +export type ProposalDraft = { name: string createdAt: number lastUpdatedAt: number diff --git a/packages/types/features.ts b/packages/types/features.ts index b7c79dbd8..e57434632 100644 --- a/packages/types/features.ts +++ b/packages/types/features.ts @@ -25,6 +25,8 @@ export enum ContractVersion { V230 = '2.3.0', // https://github.com/DA0-DA0/dao-contracts/releases/tag/v2.4.0 V240 = '2.4.0', + // https://github.com/DA0-DA0/dao-contracts/releases/tag/v2.4.2 + V242 = '2.4.2', } /** diff --git a/packages/utils/README.md b/packages/utils/README.md index f32823bc7..8aeed3f4a 100644 --- a/packages/utils/README.md +++ b/packages/utils/README.md @@ -118,8 +118,13 @@ let output = (chainId: string) => { ({ chainId, polytone }) => ` # polytone from ${chainId} (voice)\n ["wasm.${polytone.voice}", "${polytone.remoteChannel}"]` ), + ...isolatedFroms.map( + (from) => + `\n${from.chainId}:\n # polytone to ${chainId} (note)\n ["wasm.${from.polytone.note}", "${from.polytone.localChannel}"]` + ), ] + console.log('\n' + chainId + ':') console.log(lines.join(',\n')) } diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index e92b63512..d4d676355 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -72,7 +72,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 4042, CwTokenSwap: 4043, - CwTokenfactoryIssuerOsmosis: 4045, + CwTokenfactoryIssuerMain: 4045, CwVesting: 4046, DaoCore: 4047, DaoMigrator: 4048, @@ -267,7 +267,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 353, CwTokenSwap: 354, - CwTokenfactoryIssuerOsmosis: 364, + CwTokenfactoryIssuerMain: 364, CwVesting: 355, DaoCore: 365, DaoMigrator: -1, // not needed since only v2 DAOs exist @@ -477,7 +477,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 553, CwTokenSwap: 564, - CwTokenfactoryIssuerOsmosis: 565, + CwTokenfactoryIssuerMain: 565, CwVesting: 703, DaoCore: 567, DaoMigrator: -1, // not needed since only v2 DAOs exist @@ -626,7 +626,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 148, CwTokenSwap: 149, - CwTokenfactoryIssuerOsmosis: 150, + CwTokenfactoryIssuerMain: 150, CwVesting: 151, DaoCore: 153, DaoMigrator: -1, // not needed since only v2 DAOs exist @@ -814,7 +814,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 286, CwTokenSwap: 287, - CwTokenfactoryIssuerOsmosis: 401, + CwTokenfactoryIssuerMain: 401, CwTokenfactoryIssuerCosmWasm: 288, CwVesting: 290, DaoCore: 291, @@ -971,7 +971,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 2631, CwTokenSwap: 2632, - CwTokenfactoryIssuerOsmosis: 2633, + CwTokenfactoryIssuerMain: 2633, CwVesting: 2634, DaoCore: 2635, DaoMigrator: -1, @@ -1121,7 +1121,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 1550, CwTokenSwap: 1551, - CwTokenfactoryIssuerOsmosis: 1552, + CwTokenfactoryIssuerMain: 1552, CwVesting: 1553, DaoCore: 1554, DaoMigrator: -1, @@ -1179,6 +1179,158 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ }, }, }, + { + chainId: ChainId.KujiraMainnet, + name: 'kujira', + mainnet: true, + accentColor: '#e53935', + // Permissioned, only Kujira governance can create DAOs. + factoryContractAddress: + 'kujira1hwjtqgymczqra9n0859yvwemzamfqzvsegxsvuwcl7zwphpn04qqkr89yd', + createViaGovernance: true, + explorerUrlTemplates: { + tx: 'https://finder.kujira.network/kaiyo-1/tx/REPLACE', + gov: 'https://blue.kujira.network/govern', + govProp: 'https://blue.kujira.network/govern/REPLACE', + wallet: 'https://finder.kujira.network/kaiyo-1/address/REPLACE', + }, + codeIds: { + // https://github.com/CosmWasm/cw-plus + Cw1Whitelist: 259, + Cw4Group: 260, // v0.16 + // https://github.com/CosmWasm/cw-nfts + Cw721Base: 261, + + // ContractVersion.V242 + CwPayrollFactory: 262, + CwTokenSwap: 263, + CwTokenfactoryIssuerMain: 264, + CwVesting: 265, + DaoCore: 266, + DaoMigrator: -1, + DaoPreProposeApprovalSingle: 267, + DaoPreProposeApprover: 268, + DaoPreProposeMultiple: 269, + DaoPreProposeSingle: 270, + DaoProposalMultiple: 271, + DaoProposalSingle: 272, + DaoVotingCw4: 275, + DaoVotingCw721Staked: 273, + DaoVotingTokenStaked: 274, + }, + // TODO(kujira-polytone): + // - Migaloo + polytone: { + [ChainId.JunoMainnet]: { + // kujira + note: 'kujira1kthhh99l9ec60jr4eytnva40ep52tjvjlup9y2a409vgc7sutn6qv4rrxj', + // kujira + listener: + 'kujira10dpjpmd4jak247hrcupxnn87h77f94kqmgy8rwkspjakxc4paflqd3wnv5', + // juno + voice: + 'juno1vv7s07lcv2de64nphg255y7vsreasg6k89vq48gqf754wpsc5w0qmwupeu', + // kujira + localConnection: 'connection-1', + // juno + remoteConnection: 'connection-140', + // kujira + localChannel: 'channel-131', + // juno + remoteChannel: 'channel-475', + }, + [ChainId.OsmosisMainnet]: { + // kujira + note: 'kujira15454vhqp90cy7u2swyaf79e53hervg0g6h78jgfsgydys5vgqa6shcruhm', + // kujira + listener: + 'kujira1tcu45eeuklxxkd8s4jsjpp0zlz3f04w9dgyhxxvy2sts8rxd3uksjrm9md', + // osmosis + voice: + 'osmo1546fnys90560am2jzuzsl0csmqc502g8ywgwpf3q9jdfucyr93jq7urvlm', + // kujira + localConnection: 'connection-2', + // osmosis + remoteConnection: 'connection-1559', + // kujira + localChannel: 'channel-147', + // osmosis + remoteChannel: 'channel-16723', + }, + [ChainId.StargazeMainnet]: { + // kujira + note: 'kujira1wgjpx4d38gt3tc9rvyffk8upgs4sa805r0a3dleehtll67t7jyuqypclff', + // kujira + listener: + 'kujira1u5c2cn936tqh5rpua7xrscavglwy2g300zwp075wp0fapvs50e0qtwkher', + // stargaze + voice: + 'stars1qm2nv8vx9qf673h9r68vzwce4xf9kvyvkk54a28xnn5x5etcthuswrglxc', + // kujira + localConnection: 'connection-5', + // stargaze + remoteConnection: 'connection-111', + // kujira + localChannel: 'channel-136', + // stargaze + remoteChannel: 'channel-277', + }, + [ChainId.NeutronMainnet]: { + // kujira + note: 'kujira14dckdzh7t30lkpdr0hgdqsqh52erux4tst5rl7jhvc693plnm39qp2r95q', + // kujira + listener: + 'kujira1wkv5qgu75crgyn93wmc2hdysn7xacrzzz3spcjcskr469884cn2snp6ffy', + // neutron + voice: + 'neutron162fvv88dxpsapf3rnux63anruqach36r8qg73ehm2dv3fkat2rusw70nlx', + // kujira + localConnection: 'connection-82', + // neutron + remoteConnection: 'connection-2', + // kujira + localChannel: 'channel-140', + // neutron + remoteChannel: 'channel-69', + }, + [ChainId.TerraMainnet]: { + // kujira + note: 'kujira15u8wevalrxd62y6z549fmkmjdt3k2adr4zzsjgwp0uw365gmy45qkn8s8v', + // kujira + listener: + 'kujira1vgsdqvuxdn229q05f7guhytutcfa0u87l0qnd5xyeyp40e0w6xfqd8y63n', + // terra + voice: + 'terra14qj6ejeuqmgtx63fujulzcvnr290wcjmmfkvqdqh5p4vjdkuewzsyagufs', + // kujira + localConnection: 'connection-3', + // terra + remoteConnection: 'connection-13', + // kujira + localChannel: 'channel-141', + // terra + remoteChannel: 'channel-333', + }, + [ChainId.ArchwayMainnet]: { + // kujira + note: 'kujira1q4r43ywst620wc9valw592nxs8k2a7vlsawkws0tz8x5675aaxxs5etvt8', + // kujira + listener: + 'kujira1fh29pj58cnkgjjnpwqc6rxfy3gnj3tj3hvdsmcn49e4cgz6x0skqldaxms', + // archway + voice: + 'archway1hnt7vrz40qy8lnz9577z0dxw6nedvgmxtqxqvt0ayts6e256v7cq3yzmlg', + // kujira + localConnection: 'connection-110', + // archway + remoteConnection: 'connection-12', + // kujira + localChannel: 'channel-133', + // archway + remoteChannel: 'channel-90', + }, + }, + }, { chainId: ChainId.JunoTestnet, name: 'juno', @@ -1202,7 +1354,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 4062, CwTokenSwap: 4063, - CwTokenfactoryIssuerOsmosis: 4065, + CwTokenfactoryIssuerMain: 4065, CwVesting: 4066, DaoCore: 4067, DaoMigrator: 4068, @@ -1250,7 +1402,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 5841, CwTokenSwap: 5842, - CwTokenfactoryIssuerOsmosis: 5843, + CwTokenfactoryIssuerMain: 5843, CwVesting: 5844, DaoCore: 5845, DaoMigrator: -1, // not needed since only v2 DAOs exist @@ -1292,7 +1444,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 3461, CwTokenSwap: 3462, - CwTokenfactoryIssuerOsmosis: 3463, + CwTokenfactoryIssuerMain: 3463, CwVesting: 3464, DaoCore: 3465, DaoMigrator: -1, // not needed since only v2 DAOs exist @@ -1336,7 +1488,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 3, CwTokenSwap: 4, - CwTokenfactoryIssuerOsmosis: 65, + CwTokenfactoryIssuerMain: 65, CwTokenfactoryIssuerCosmWasm: 5, CwVesting: 6, DaoCore: 7, From fd9f9b866f177418f9aac7400d0d6b6a8d7fb333 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 10 Apr 2024 12:59:54 -0700 Subject: [PATCH 109/438] don't query indexer if not caught up --- packages/state/recoil/selectors/chain.ts | 1 + packages/state/recoil/selectors/contract.ts | 2 + .../recoil/selectors/contracts/Cw20Base.ts | 1 + .../recoil/selectors/contracts/Cw20Stake.ts | 1 + .../recoil/selectors/contracts/CwVesting.ts | 2 + .../recoil/selectors/contracts/DaoCore.v2.ts | 1 + .../contracts/DaoVotingCw20Staked.ts | 1 + .../contracts/DaoVotingCw721Staked.ts | 2 + .../contracts/DaoVotingNativeStaked.ts | 1 + .../contracts/DaoVotingTokenStaked.ts | 1 + .../selectors/contracts/PolytoneProxy.ts | 1 + packages/state/recoil/selectors/indexer.ts | 81 ++++++++++++++----- packages/state/recoil/selectors/wallet.ts | 2 + .../stateful/recoil/selectors/dao/misc.ts | 2 + packages/stateful/recoil/selectors/nft.ts | 2 + packages/stateful/recoil/selectors/token.ts | 1 + packages/stateful/recoil/selectors/vesting.ts | 1 + packages/stateful/recoil/selectors/wallet.ts | 2 + 18 files changed, 87 insertions(+), 18 deletions(-) diff --git a/packages/state/recoil/selectors/chain.ts b/packages/state/recoil/selectors/chain.ts index 3e9558413..582e4c638 100644 --- a/packages/state/recoil/selectors/chain.ts +++ b/packages/state/recoil/selectors/chain.ts @@ -1583,6 +1583,7 @@ export const validatorSlashesSelector = selectorFamily< validatorOperatorAddress, chainId, formula: 'staking/slashes', + noFallback: true, }) )) ?? [], }) diff --git a/packages/state/recoil/selectors/contract.ts b/packages/state/recoil/selectors/contract.ts index f08194e25..9db080065 100644 --- a/packages/state/recoil/selectors/contract.ts +++ b/packages/state/recoil/selectors/contract.ts @@ -31,6 +31,8 @@ export const contractInstantiateTimeSelector = selectorFamily< contractAddress: address, chainId, formula: 'instantiatedAt', + // This never changes, so query even if the indexer is behind. + noFallback: true, }) ) // Null when indexer fails. diff --git a/packages/state/recoil/selectors/contracts/Cw20Base.ts b/packages/state/recoil/selectors/contracts/Cw20Base.ts index c5a7b63a6..b2f336a71 100644 --- a/packages/state/recoil/selectors/contracts/Cw20Base.ts +++ b/packages/state/recoil/selectors/contracts/Cw20Base.ts @@ -381,6 +381,7 @@ export const daosSelector = selectorFamily({ queryContractIndexerSelector({ ...queryClientParams, formula: 'cw20/daos', + noFallback: true, }) ) ?? [], }) diff --git a/packages/state/recoil/selectors/contracts/Cw20Stake.ts b/packages/state/recoil/selectors/contracts/Cw20Stake.ts index cfcb6100e..1c9bef095 100644 --- a/packages/state/recoil/selectors/contracts/Cw20Stake.ts +++ b/packages/state/recoil/selectors/contracts/Cw20Stake.ts @@ -428,6 +428,7 @@ export const topStakersSelector = selectorFamily< oraichainStakingToken, }, id, + noFallback: true, }) ) ?? undefined ) diff --git a/packages/state/recoil/selectors/contracts/CwVesting.ts b/packages/state/recoil/selectors/contracts/CwVesting.ts index d53f4356f..4b440005e 100644 --- a/packages/state/recoil/selectors/contracts/CwVesting.ts +++ b/packages/state/recoil/selectors/contracts/CwVesting.ts @@ -193,6 +193,7 @@ export const stakeHistorySelector = selectorFamily< formula: 'cwVesting/stakeHistory', chainId, id: anyId + thisId, + noFallback: true, }) ) }, @@ -212,6 +213,7 @@ export const unbondingDurationSecondsSelector = selectorFamily< contractAddress, formula: 'cwVesting/unbondingDurationSeconds', chainId, + noFallback: true, }) ), }) diff --git a/packages/state/recoil/selectors/contracts/DaoCore.v2.ts b/packages/state/recoil/selectors/contracts/DaoCore.v2.ts index 4a6ac6d0d..79c73c2e5 100644 --- a/packages/state/recoil/selectors/contracts/DaoCore.v2.ts +++ b/packages/state/recoil/selectors/contracts/DaoCore.v2.ts @@ -1441,6 +1441,7 @@ export const approvalDaosSelector = selectorFamily< chainId, contractAddress, formula: 'daoCore/approvalDaos', + noFallback: true, }) ), }) diff --git a/packages/state/recoil/selectors/contracts/DaoVotingCw20Staked.ts b/packages/state/recoil/selectors/contracts/DaoVotingCw20Staked.ts index 2807c42cf..5432a20bf 100644 --- a/packages/state/recoil/selectors/contracts/DaoVotingCw20Staked.ts +++ b/packages/state/recoil/selectors/contracts/DaoVotingCw20Staked.ts @@ -253,6 +253,7 @@ export const topStakersSelector = selectorFamily< limit, }, id, + noFallback: true, }) ) ?? undefined ) diff --git a/packages/state/recoil/selectors/contracts/DaoVotingCw721Staked.ts b/packages/state/recoil/selectors/contracts/DaoVotingCw721Staked.ts index a1d596631..727b37d37 100644 --- a/packages/state/recoil/selectors/contracts/DaoVotingCw721Staked.ts +++ b/packages/state/recoil/selectors/contracts/DaoVotingCw721Staked.ts @@ -157,6 +157,7 @@ export const stakerForNftSelector = selectorFamily< args: { tokenId, }, + noFallback: true, }) ), }) @@ -189,6 +190,7 @@ export const topStakersSelector = selectorFamily< limit, }, id, + noFallback: true, }) ) ?? undefined ) diff --git a/packages/state/recoil/selectors/contracts/DaoVotingNativeStaked.ts b/packages/state/recoil/selectors/contracts/DaoVotingNativeStaked.ts index 5a6a766e4..2fd85d6b7 100644 --- a/packages/state/recoil/selectors/contracts/DaoVotingNativeStaked.ts +++ b/packages/state/recoil/selectors/contracts/DaoVotingNativeStaked.ts @@ -264,6 +264,7 @@ export const topStakersSelector = selectorFamily< ...queryClientParams, formula: 'daoVotingNativeStaked/topStakers', id, + noFallback: true, }) ) ?? undefined ) diff --git a/packages/state/recoil/selectors/contracts/DaoVotingTokenStaked.ts b/packages/state/recoil/selectors/contracts/DaoVotingTokenStaked.ts index c00dedab1..2d2c49b72 100644 --- a/packages/state/recoil/selectors/contracts/DaoVotingTokenStaked.ts +++ b/packages/state/recoil/selectors/contracts/DaoVotingTokenStaked.ts @@ -361,6 +361,7 @@ export const topStakersSelector = selectorFamily< ...queryClientParams, formula: 'daoVotingTokenStaked/topStakers', id, + noFallback: true, }) ) ?? undefined ) diff --git a/packages/state/recoil/selectors/contracts/PolytoneProxy.ts b/packages/state/recoil/selectors/contracts/PolytoneProxy.ts index 85cd3c4cb..92dee4481 100644 --- a/packages/state/recoil/selectors/contracts/PolytoneProxy.ts +++ b/packages/state/recoil/selectors/contracts/PolytoneProxy.ts @@ -66,6 +66,7 @@ export const remoteControllerForPolytoneProxySelector = selectorFamily< args: { address: proxy, }, + noFallback: true, }) ), }) diff --git a/packages/state/recoil/selectors/indexer.ts b/packages/state/recoil/selectors/indexer.ts index 9effccb5c..454b588a3 100644 --- a/packages/state/recoil/selectors/indexer.ts +++ b/packages/state/recoil/selectors/indexer.ts @@ -33,39 +33,80 @@ import { } from '../atoms' export type QueryIndexerParams = QueryIndexerOptions & { - // Refresh by changing this value. + /** + * Refresh by changing this value. + */ id?: number + /** + * If there is no fallback query available, still query even if indexer is + * behind. Defaults to `false`. + */ + noFallback?: boolean } export const queryIndexerSelector = selectorFamily({ key: 'queryIndexer', - get: (options) => async () => { - try { - return await queryIndexer(options) - } catch (err) { - // If the indexer fails, return null since many indexer queries fallback - // to the chain. If an error other than no indexer for chain, log it. - if ( - !(err instanceof Error) || - err.message !== CommonError.NoIndexerForChain - ) { - console.error(err) + get: + (options) => + async ({ get }) => { + const indexerUp = get( + indexerUpStatusSelector({ + chainId: options.chainId, + // Don't refresh this automatically on a period, since some selectors + // that are not cached will use this, and they will cause annoying + // flickering in the UI. Ideally, we replace all `useRecoilValue` + // blocking hooks with `useCachedLoadingWithError` hooks that cache + // data during updates. Once that happens, we can remove this. But + // that might not happen for a while... + noRefresh: true, + // Manually refresh. + id: options.id, + }) + ) + // If indexer is behind and there is a fallback, return null. + if (!indexerUp.caughtUp && !options.noFallback) { + return null } - return null - } - }, + try { + return await queryIndexer(options) + } catch (err) { + // If the indexer fails, return null since many indexer queries fallback + // to the chain. If an error other than no indexer for chain, log it. + if ( + !(err instanceof Error) || + err.message !== CommonError.NoIndexerForChain + ) { + console.error(err) + } + + return null + } + }, }) export const indexerUpStatusSelector = selectorFamily< IndexerUpStatus, - WithChainId<{}> + WithChainId<{ + /** + * If true, does not refresh the indexer status. Defaults to false. This is + * useful if you want to check the indexer status one time. The refresh + * occurs periodically to update status on the status page. + */ + noRefresh?: boolean + /** + * Change this value to manually refresh. + */ + id?: number + }> >({ key: 'indexerUpStatus', get: - (params) => + ({ noRefresh = false, ...params }) => async ({ get }) => { - get(refreshIndexerUpStatusAtom) + if (!noRefresh) { + get(refreshIndexerUpStatusAtom) + } return await queryIndexerUpStatus(params) }, @@ -185,6 +226,7 @@ export const openProposalsSelector = selectorFamily< chainId, id, args: { address }, + noFallback: true, }) ) return openProposals ?? [] @@ -209,6 +251,7 @@ export const walletProposalStatsSelector = selectorFamily< formula: 'proposals/stats', chainId, id, + noFallback: true, }) ) @@ -234,6 +277,7 @@ export const walletAdminOfDaosSelector = selectorFamily< chainId, walletAddress, formula: 'daos/adminOf', + noFallback: true, }) ) @@ -299,6 +343,7 @@ export const indexerFeaturedDaosSelector = selectorFamily< queryGenericIndexerSelector({ chainId, formula: 'featuredDaos', + noFallback: true, }) ) || [] diff --git a/packages/state/recoil/selectors/wallet.ts b/packages/state/recoil/selectors/wallet.ts index 7b073379e..0acac4dd1 100644 --- a/packages/state/recoil/selectors/wallet.ts +++ b/packages/state/recoil/selectors/wallet.ts @@ -33,6 +33,7 @@ export const walletCw20BalancesSelector = selectorFamily< walletAddress, formula: 'tokens/list', id, + noFallback: true, }) ) ?? [] @@ -69,6 +70,7 @@ export const walletTokenDaoStakedDenomsSelector = selectorFamily< chainId, walletAddress, formula: 'daos/memberOf', + noFallback: true, }) ) if (!daos || !Array.isArray(daos) || daos.length === 0) { diff --git a/packages/stateful/recoil/selectors/dao/misc.ts b/packages/stateful/recoil/selectors/dao/misc.ts index 7ff968179..fb4bd6b05 100644 --- a/packages/stateful/recoil/selectors/dao/misc.ts +++ b/packages/stateful/recoil/selectors/dao/misc.ts @@ -141,6 +141,7 @@ export const daoPotentialSubDaosSelector = selectorFamily< chainId, contractAddress: coreAddress, formula: 'daoCore/potentialSubDaos', + noFallback: true, }) ) @@ -531,6 +532,7 @@ export const daosWithVetoableProposalsSelector = selectorFamily< walletAddress: address, formula: 'veto/vetoableProposals', id, + noFallback: true, }) ) ) diff --git a/packages/stateful/recoil/selectors/nft.ts b/packages/stateful/recoil/selectors/nft.ts index b1e199721..47625bc48 100644 --- a/packages/stateful/recoil/selectors/nft.ts +++ b/packages/stateful/recoil/selectors/nft.ts @@ -346,6 +346,7 @@ export const walletLazyNftCardInfosSelector = selectorFamily< walletAddress, formula: 'nft/collections', id, + noFallback: true, }) ) if (!collections || !Array.isArray(collections)) { @@ -402,6 +403,7 @@ export const walletStakedLazyNftCardInfosSelector = selectorFamily< walletAddress, formula: 'nft/stakedWithDaos', id, + noFallback: true, }) ) if (!collections || !Array.isArray(collections)) { diff --git a/packages/stateful/recoil/selectors/token.ts b/packages/stateful/recoil/selectors/token.ts index bda6571e9..3936ffa5b 100644 --- a/packages/stateful/recoil/selectors/token.ts +++ b/packages/stateful/recoil/selectors/token.ts @@ -204,6 +204,7 @@ export const daosWithNativeVotingContractSelector = selectorFamily< args: { denom, }, + noFallback: true, }) ) ?? [] const votingModuleAddresses = get( diff --git a/packages/stateful/recoil/selectors/vesting.ts b/packages/stateful/recoil/selectors/vesting.ts index 7524a0e99..f83018960 100644 --- a/packages/stateful/recoil/selectors/vesting.ts +++ b/packages/stateful/recoil/selectors/vesting.ts @@ -37,6 +37,7 @@ export const vestingPaymentsOwnedBySelector = selectorFamily< chainId, walletAddress: address, formula: 'vesting/ownerOf', + noFallback: true, }) ) diff --git a/packages/stateful/recoil/selectors/wallet.ts b/packages/stateful/recoil/selectors/wallet.ts index e672e8cce..1d0fd9861 100644 --- a/packages/stateful/recoil/selectors/wallet.ts +++ b/packages/stateful/recoil/selectors/wallet.ts @@ -214,6 +214,7 @@ export const walletTokenCardInfosSelector = selectorFamily< walletAddress, formula: 'tokens/list', id, + noFallback: true, }) ) ) @@ -397,6 +398,7 @@ export const walletDaosSelector = selectorFamily< chainId, walletAddress: address, formula: 'daos/memberOf', + noFallback: true, }) ) if (!daos || !Array.isArray(daos)) { From 0f01398d79a129aa2b91e310397fb7f235e7bbee Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 10 Apr 2024 13:01:30 -0700 Subject: [PATCH 110/438] fixed bug attempting to load pre-propose-approval proposals when not using pre-propose-approval --- .../adapters/DaoProposalSingle/index.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/index.tsx index d7771ad7c..c76f76a40 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/index.tsx @@ -1,4 +1,8 @@ -import { ContractVersion, ProposalModuleAdapter } from '@dao-dao/types' +import { + ContractVersion, + PreProposeModuleType, + ProposalModuleAdapter, +} from '@dao-dao/types' import { Vote } from '@dao-dao/types/contracts/DaoProposalSingle.common' import { DAO_PROPOSAL_SINGLE_CONTRACT_NAMES, @@ -101,7 +105,8 @@ export const DaoProposalSingleAdapter: ProposalModuleAdapter< ...props, }), depositInfo: depositInfoSelector, - ...(options.proposalModule.prePropose + ...(options.proposalModule.prePropose?.type === + PreProposeModuleType.Approval ? { reversePreProposePendingProposalInfos: (props) => reversePreProposePendingProposalInfosSelector({ From 7c737291d543c707cc750d30812ddb663f4ccd16 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 10 Apr 2024 16:22:01 -0700 Subject: [PATCH 111/438] added copy address to profile popup --- .../components/wallet/NavWalletConnected.tsx | 72 ++++++++++++++++--- 1 file changed, 64 insertions(+), 8 deletions(-) diff --git a/packages/stateless/components/wallet/NavWalletConnected.tsx b/packages/stateless/components/wallet/NavWalletConnected.tsx index 2e9772611..432930ebb 100644 --- a/packages/stateless/components/wallet/NavWalletConnected.tsx +++ b/packages/stateless/components/wallet/NavWalletConnected.tsx @@ -2,10 +2,12 @@ import { Logout, NotificationsOutlined, Person, + Tag, WarningAmberRounded, } from '@mui/icons-material' import clsx from 'clsx' -import { useCallback, useEffect, useState } from 'react' +import { useCallback, useMemo, useState } from 'react' +import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' import { @@ -13,11 +15,21 @@ import { NavWalletConnectedProps, PopupTriggerCustomComponent, } from '@dao-dao/types' +import { + concatAddressStartEnd, + getDisplayNameForChainId, + getImageUrlForChainId, +} from '@dao-dao/utils' import { IconButton } from '../icon_buttons' import { useAppContextIfAvailable } from '../layout/AppContext' import { Notifications } from '../Notifications' -import { ButtonPopup, Popup } from '../popup' +import { + ButtonPopup, + FilterableItem, + FilterableItemPopup, + Popup, +} from '../popup' import { ProfileImage } from '../profile' import { Tooltip } from '../tooltip' import { WalletLogo } from './WalletLogo' @@ -39,12 +51,7 @@ export const NavWalletConnected = ({ // be in it. const { mode: appMode, inbox } = useAppContextIfAvailable() ?? {} - const [copied, setCopied] = useState(false) - // Debounce copy unset after 2 seconds. - useEffect(() => { - const timeout = setTimeout(() => setCopied(false), 2000) - return () => clearTimeout(timeout) - }, [copied]) + const [addressPopupVisible, setAddressPopupVisible] = useState(false) const ProfileImagePopup: PopupTriggerCustomComponent = useCallback( ({ onClick }) => ( @@ -84,6 +91,29 @@ export const NavWalletConnected = ({ [mode, t, wallet, profile] ) + const profileChainAddresses = useMemo( + (): (FilterableItem & { chainId: string; address: string })[] => + profile.loading + ? [] + : Object.entries(profile.data.chains) + .map(([chainId, { address }]) => ({ + key: chainId, + label: getDisplayNameForChainId(chainId), + iconUrl: getImageUrlForChainId(chainId), + rightNode: ( +

+ {concatAddressStartEnd(address, 10, 6)} +

+ ), + iconClassName: '!h-8 !w-8', + contentContainerClassName: '!gap-4', + chainId, + address, + })) + .sort((a, b) => a.label.localeCompare(b.label)), + [profile] + ) + return (
setAddressPopupVisible(true), + }, { label: t('button.logOut'), Icon: Logout, @@ -188,6 +223,27 @@ export const NavWalletConnected = ({ }} />
+ + { + navigator.clipboard.writeText(address) + toast.success( + t('info.copiedChainAddress', { + chain: getDisplayNameForChainId(chainId), + }) + ) + }} + searchPlaceholder={t('info.searchForChain')} + trigger={{ + type: 'manual', + open: addressPopupVisible, + setOpen: setAddressPopupVisible, + }} + />
) } + +const FILTERABLE_KEYS = ['label', 'chainId', 'address'] From 8dfdc590e2199a4068aa722dd2c289117b0cd67e Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 10 Apr 2024 16:44:12 -0700 Subject: [PATCH 112/438] refresh proposal on veto expiration --- .../components/ProposalStatusAndInfo.tsx | 39 +++++++------------ .../components/ProposalStatusAndInfo.tsx | 39 +++++++------------ packages/stateless/hooks/index.ts | 2 + packages/stateless/hooks/useExecuteAt.ts | 36 +++++++++++++++++ packages/stateless/hooks/useUpdatingRef.ts | 11 ++++++ 5 files changed, 77 insertions(+), 50 deletions(-) create mode 100644 packages/stateless/hooks/useExecuteAt.ts create mode 100644 packages/stateless/hooks/useUpdatingRef.ts diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalStatusAndInfo.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalStatusAndInfo.tsx index 0d7ebc4fb..613b24388 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalStatusAndInfo.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalStatusAndInfo.tsx @@ -8,7 +8,7 @@ import { Tag, } from '@mui/icons-material' import clsx from 'clsx' -import { ComponentProps, ComponentType, useCallback, useEffect } from 'react' +import { ComponentProps, ComponentType, useCallback } from 'react' import { useTranslation } from 'react-i18next' import TimeAgo from 'react-timeago' import { useRecoilValue } from 'recoil' @@ -24,6 +24,7 @@ import { TooltipTruncatedText, useConfiguredChainContext, useDaoInfoContext, + useExecuteAt, useTranslatedTimeDeltaFormatter, } from '@dao-dao/stateless' import { @@ -157,21 +158,10 @@ const InnerProposalStatusAndInfo = ({ }) const awaitNextBlock = useAwaitNextBlock() - // Refresh proposal and list of proposals (for list status) once voting ends. - useEffect(() => { - if ( - statusKey !== ProposalStatusEnum.Open || - !timestampInfo?.expirationDate - ) { - return - } - - const msRemaining = timestampInfo?.expirationDate.getTime() - Date.now() - if (msRemaining < 0) { - return - } - - const timeout = setTimeout(() => { + // Refresh proposal and list of proposals (for list status) once voting or + // veto period ends. + useExecuteAt({ + fn: () => { // Refresh immediately so that the timestamp countdown re-renders and // hides itself. refreshProposal() @@ -179,15 +169,14 @@ const InnerProposalStatusAndInfo = ({ // and refresh the list of all proposals so the status gets updated there // as well. awaitNextBlock().then(refreshProposalAndAll) - }, msRemaining) - return () => clearTimeout(timeout) - }, [ - timestampInfo?.expirationDate, - statusKey, - refreshProposal, - refreshProposalAndAll, - awaitNextBlock, - ]) + }, + date: + statusKey === ProposalStatusEnum.Open + ? timestampInfo?.expirationDate + : statusKey === 'veto_timelock' + ? vetoTimelockExpiration + : undefined, + }) const { vetoEnabled, canBeVetoed, vetoOrEarlyExecute, vetoInfoItems } = useProposalVetoState({ diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfo.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfo.tsx index be160c39c..4bcc8d916 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfo.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfo.tsx @@ -8,7 +8,7 @@ import { ThumbUpOutlined, } from '@mui/icons-material' import clsx from 'clsx' -import { ComponentProps, useCallback, useEffect } from 'react' +import { ComponentProps, useCallback } from 'react' import { useTranslation } from 'react-i18next' import TimeAgo from 'react-timeago' import { useRecoilValue } from 'recoil' @@ -24,6 +24,7 @@ import { useConfiguredChainContext, useDaoInfoContext, useDaoNavHelpers, + useExecuteAt, useTranslatedTimeDeltaFormatter, } from '@dao-dao/stateless' import { @@ -212,21 +213,10 @@ const InnerProposalStatusAndInfo = ({ }) const awaitNextBlock = useAwaitNextBlock() - // Refresh proposal and list of proposals (for list status) once voting ends. - useEffect(() => { - if ( - statusKey !== ProposalStatusEnum.Open || - !timestampInfo?.expirationDate - ) { - return - } - - const msRemaining = timestampInfo?.expirationDate.getTime() - Date.now() - if (msRemaining < 0) { - return - } - - const timeout = setTimeout(() => { + // Refresh proposal and list of proposals (for list status) once voting or + // veto period ends. + useExecuteAt({ + fn: () => { // Refresh immediately so that the timestamp countdown re-renders and // hides itself. refreshProposal() @@ -234,15 +224,14 @@ const InnerProposalStatusAndInfo = ({ // and refresh the list of all proposals so the status gets updated there // as well. awaitNextBlock().then(refreshProposalAndAll) - }, msRemaining) - return () => clearTimeout(timeout) - }, [ - timestampInfo?.expirationDate, - statusKey, - refreshProposal, - refreshProposalAndAll, - awaitNextBlock, - ]) + }, + date: + statusKey === ProposalStatusEnum.Open + ? timestampInfo?.expirationDate + : statusKey === 'veto_timelock' + ? vetoTimelockExpiration + : undefined, + }) const { vetoEnabled, canBeVetoed, vetoOrEarlyExecute, vetoInfoItems } = useProposalVetoState({ diff --git a/packages/stateless/hooks/index.ts b/packages/stateless/hooks/index.ts index 0251fd407..509cdbe7f 100644 --- a/packages/stateless/hooks/index.ts +++ b/packages/stateless/hooks/index.ts @@ -8,6 +8,7 @@ export * from './useDaoInfoContext' export * from './useDaoNavHelpers' export * from './useDetectTruncate' export * from './useDetectWrap' +export * from './useExecuteAt' export * from './useGovProposalVoteOptions' export * from './useHoldingKey' export * from './useInfiniteScroll' @@ -21,3 +22,4 @@ export * from './useServiceWorker' export * from './useTokenSortOptions' export * from './useTrackDropdown' export * from './useTranslatedTimeDeltaFormatter' +export * from './useUpdatingRef' diff --git a/packages/stateless/hooks/useExecuteAt.ts b/packages/stateless/hooks/useExecuteAt.ts new file mode 100644 index 000000000..4355f6e6f --- /dev/null +++ b/packages/stateless/hooks/useExecuteAt.ts @@ -0,0 +1,36 @@ +import { useEffect } from 'react' + +import { useUpdatingRef } from './useUpdatingRef' + +export type UseExecuteAtOptions = { + /** + * The function to execute. + */ + fn: () => void + /** + * The date at which to execute the function. If undefined, the function will + * not fire. + */ + date: Date | undefined +} + +/** + * A hook to execute a function at a specific date in the future. + */ +export const useExecuteAt = ({ fn, date }: UseExecuteAtOptions) => { + const fnRef = useUpdatingRef(fn) + + useEffect(() => { + if (!date) { + return + } + + const msRemaining = date.getTime() - Date.now() + if (msRemaining < 0) { + return + } + + const timeout = setTimeout(() => fnRef.current(), msRemaining) + return () => clearTimeout(timeout) + }, [date, fnRef]) +} diff --git a/packages/stateless/hooks/useUpdatingRef.ts b/packages/stateless/hooks/useUpdatingRef.ts new file mode 100644 index 000000000..477621fa9 --- /dev/null +++ b/packages/stateless/hooks/useUpdatingRef.ts @@ -0,0 +1,11 @@ +import { useRef } from 'react' + +/** + * Create ref that is updated on every render. This effectively memoizes the + * value so it can be used in effects without causing constant re-renders. + */ +export const useUpdatingRef = (value: T) => { + const ref = useRef(value) + ref.current = value + return ref +} From 267d14d960cab7267876eeb96d1a275cf8f44cb0 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 10 Apr 2024 21:30:47 -0700 Subject: [PATCH 113/438] fixed non-indexed chain gov pages --- packages/state/recoil/selectors/indexer.ts | 58 ++++++++++++---------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/packages/state/recoil/selectors/indexer.ts b/packages/state/recoil/selectors/indexer.ts index 454b588a3..2a8f90f5c 100644 --- a/packages/state/recoil/selectors/indexer.ts +++ b/packages/state/recoil/selectors/indexer.ts @@ -49,37 +49,45 @@ export const queryIndexerSelector = selectorFamily({ get: (options) => async ({ get }) => { - const indexerUp = get( - indexerUpStatusSelector({ - chainId: options.chainId, - // Don't refresh this automatically on a period, since some selectors - // that are not cached will use this, and they will cause annoying - // flickering in the UI. Ideally, we replace all `useRecoilValue` - // blocking hooks with `useCachedLoadingWithError` hooks that cache - // data during updates. Once that happens, we can remove this. But - // that might not happen for a while... - noRefresh: true, - // Manually refresh. - id: options.id, - }) - ) - // If indexer is behind and there is a fallback, return null. - if (!indexerUp.caughtUp && !options.noFallback) { - return null - } - try { - return await queryIndexer(options) + const indexerUp = get( + indexerUpStatusSelector({ + chainId: options.chainId, + // Don't refresh this automatically on a period, since some + // selectors that are not cached will use this, and they will cause + // annoying flickering in the UI. Ideally, we replace all + // `useRecoilValue` blocking hooks with `useCachedLoadingWithError` + // hooks that cache data during updates. Once that happens, we can + // remove this. But that might not happen for a while... + noRefresh: true, + // Manually refresh. + id: options.id, + }) + ) + + // If indexer is behind and there is a fallback, return null. + if (!indexerUp.caughtUp && !options.noFallback) { + return null + } } catch (err) { - // If the indexer fails, return null since many indexer queries fallback - // to the chain. If an error other than no indexer for chain, log it. + // If no indexer for chain, return null. if ( - !(err instanceof Error) || - err.message !== CommonError.NoIndexerForChain + err instanceof Error && + err.message === CommonError.NoIndexerForChain ) { - console.error(err) + return null } + // Throw other errors. Recoil throws promises when waiting for other + // selectors to finish, and we don't want to prevent that. + throw err + } + + try { + return await queryIndexer(options) + } catch (err) { + console.error(err) + return null } }, From d5cb136d696132259510851ed308026c14c2f287 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 11 Apr 2024 10:22:23 -0700 Subject: [PATCH 114/438] added osmosis txfees v24 update --- .../types/protobuf/codegen/alliance/bundle.ts | 22 +- .../types/protobuf/codegen/circle/bundle.ts | 22 +- .../types/protobuf/codegen/cosmos/bundle.ts | 180 +++++++------- .../types/protobuf/codegen/cosmwasm/bundle.ts | 32 +-- .../types/protobuf/codegen/gaia/bundle.ts | 22 +- packages/types/protobuf/codegen/ibc/bundle.ts | 88 +++---- .../types/protobuf/codegen/juno/bundle.ts | 32 +-- .../types/protobuf/codegen/neutron/bundle.ts | 104 ++++---- .../types/protobuf/codegen/noble/bundle.ts | 18 +- .../types/protobuf/codegen/osmosis/bundle.ts | 222 +++++++++--------- .../types/protobuf/codegen/osmosis/client.ts | 5 +- .../types/protobuf/codegen/osmosis/rpc.tx.ts | 3 + .../codegen/osmosis/txfees/v1beta1/genesis.ts | 20 +- .../codegen/osmosis/txfees/v1beta1/params.ts | 92 ++++++++ .../osmosis/txfees/v1beta1/query.rpc.Query.ts | 13 +- .../codegen/osmosis/txfees/v1beta1/query.ts | 153 ++++++++++++ .../osmosis/txfees/v1beta1/tx.amino.ts | 8 + .../osmosis/txfees/v1beta1/tx.registry.ts | 35 +++ .../osmosis/txfees/v1beta1/tx.rpc.msg.ts | 18 ++ .../codegen/osmosis/txfees/v1beta1/tx.ts | 176 ++++++++++++++ .../protobuf/codegen/publicawesome/bundle.ts | 112 ++++----- .../types/protobuf/codegen/regen/bundle.ts | 180 +++++++------- .../protobuf/codegen/tendermint/bundle.ts | 36 +-- .../osmosis/txfees/v1beta1/feetoken.proto | 2 +- .../osmosis/txfees/v1beta1/genesis.proto | 12 +- .../proto/osmosis/txfees/v1beta1/gov.proto | 2 +- .../proto/osmosis/txfees/v1beta1/params.proto | 14 ++ .../proto/osmosis/txfees/v1beta1/query.proto | 18 +- .../proto/osmosis/txfees/v1beta1/tx.proto | 25 ++ 29 files changed, 1129 insertions(+), 537 deletions(-) create mode 100644 packages/types/protobuf/codegen/osmosis/txfees/v1beta1/params.ts create mode 100644 packages/types/protobuf/codegen/osmosis/txfees/v1beta1/tx.amino.ts create mode 100644 packages/types/protobuf/codegen/osmosis/txfees/v1beta1/tx.registry.ts create mode 100644 packages/types/protobuf/codegen/osmosis/txfees/v1beta1/tx.rpc.msg.ts create mode 100644 packages/types/protobuf/codegen/osmosis/txfees/v1beta1/tx.ts create mode 100644 packages/types/protobuf/proto/osmosis/txfees/v1beta1/params.proto create mode 100644 packages/types/protobuf/proto/osmosis/txfees/v1beta1/tx.proto diff --git a/packages/types/protobuf/codegen/alliance/bundle.ts b/packages/types/protobuf/codegen/alliance/bundle.ts index c97fd10db..c44a20265 100644 --- a/packages/types/protobuf/codegen/alliance/bundle.ts +++ b/packages/types/protobuf/codegen/alliance/bundle.ts @@ -8,12 +8,12 @@ import * as _6 from "./alliance/query"; import * as _7 from "./alliance/redelegations"; import * as _8 from "./alliance/tx"; import * as _9 from "./alliance/unbonding"; -import * as _304 from "./alliance/tx.amino"; -import * as _305 from "./alliance/tx.registry"; -import * as _306 from "./alliance/query.rpc.Query"; -import * as _307 from "./alliance/tx.rpc.msg"; -import * as _503 from "./rpc.query"; -import * as _504 from "./rpc.tx"; +import * as _306 from "./alliance/tx.amino"; +import * as _307 from "./alliance/tx.registry"; +import * as _308 from "./alliance/query.rpc.Query"; +import * as _309 from "./alliance/tx.rpc.msg"; +import * as _508 from "./rpc.query"; +import * as _509 from "./rpc.tx"; export namespace alliance { export const alliance = { ..._0, @@ -26,13 +26,13 @@ export namespace alliance { ..._7, ..._8, ..._9, - ..._304, - ..._305, ..._306, - ..._307 + ..._307, + ..._308, + ..._309 }; export const ClientFactory = { - ..._503, - ..._504 + ..._508, + ..._509 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/circle/bundle.ts b/packages/types/protobuf/codegen/circle/bundle.ts index 2c8937393..731406816 100644 --- a/packages/types/protobuf/codegen/circle/bundle.ts +++ b/packages/types/protobuf/codegen/circle/bundle.ts @@ -14,12 +14,12 @@ import * as _23 from "./cctp/v1/sending_and_receiving_messages_paused"; import * as _24 from "./cctp/v1/signature_threshold"; import * as _25 from "./cctp/v1/token_pair"; import * as _26 from "./cctp/v1/tx"; -import * as _308 from "./cctp/v1/tx.amino"; -import * as _309 from "./cctp/v1/tx.registry"; -import * as _310 from "./cctp/v1/query.rpc.Query"; -import * as _311 from "./cctp/v1/tx.rpc.msg"; -import * as _505 from "./rpc.query"; -import * as _506 from "./rpc.tx"; +import * as _310 from "./cctp/v1/tx.amino"; +import * as _311 from "./cctp/v1/tx.registry"; +import * as _312 from "./cctp/v1/query.rpc.Query"; +import * as _313 from "./cctp/v1/tx.rpc.msg"; +import * as _510 from "./rpc.query"; +import * as _511 from "./rpc.tx"; export namespace circle { export namespace cctp { export const v1 = { @@ -39,14 +39,14 @@ export namespace circle { ..._24, ..._25, ..._26, - ..._308, - ..._309, ..._310, - ..._311 + ..._311, + ..._312, + ..._313 }; } export const ClientFactory = { - ..._505, - ..._506 + ..._510, + ..._511 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/bundle.ts b/packages/types/protobuf/codegen/cosmos/bundle.ts index 1787e1986..8f023f183 100644 --- a/packages/types/protobuf/codegen/cosmos/bundle.ts +++ b/packages/types/protobuf/codegen/cosmos/bundle.ts @@ -56,51 +56,51 @@ import * as _82 from "./tx/v1beta1/tx"; import * as _83 from "./upgrade/v1beta1/query"; import * as _84 from "./upgrade/v1beta1/tx"; import * as _85 from "./upgrade/v1beta1/upgrade"; -import * as _312 from "./auth/v1beta1/tx.amino"; -import * as _313 from "./authz/v1beta1/tx.amino"; -import * as _314 from "./bank/v1beta1/tx.amino"; -import * as _315 from "./distribution/v1beta1/tx.amino"; -import * as _316 from "./gov/v1/tx.amino"; -import * as _317 from "./gov/v1beta1/tx.amino"; -import * as _318 from "./mint/v1beta1/tx.amino"; -import * as _319 from "./slashing/v1beta1/tx.amino"; -import * as _320 from "./staking/v1beta1/tx.amino"; -import * as _321 from "./upgrade/v1beta1/tx.amino"; -import * as _322 from "./auth/v1beta1/tx.registry"; -import * as _323 from "./authz/v1beta1/tx.registry"; -import * as _324 from "./bank/v1beta1/tx.registry"; -import * as _325 from "./distribution/v1beta1/tx.registry"; -import * as _326 from "./gov/v1/tx.registry"; -import * as _327 from "./gov/v1beta1/tx.registry"; -import * as _328 from "./mint/v1beta1/tx.registry"; -import * as _329 from "./slashing/v1beta1/tx.registry"; -import * as _330 from "./staking/v1beta1/tx.registry"; -import * as _331 from "./upgrade/v1beta1/tx.registry"; -import * as _332 from "./auth/v1beta1/query.rpc.Query"; -import * as _333 from "./authz/v1beta1/query.rpc.Query"; -import * as _334 from "./bank/v1beta1/query.rpc.Query"; -import * as _335 from "./base/tendermint/v1beta1/query.rpc.Service"; -import * as _336 from "./distribution/v1beta1/query.rpc.Query"; -import * as _337 from "./gov/v1/query.rpc.Query"; -import * as _338 from "./gov/v1beta1/query.rpc.Query"; -import * as _339 from "./mint/v1beta1/query.rpc.Query"; -import * as _340 from "./params/v1beta1/query.rpc.Query"; -import * as _341 from "./slashing/v1beta1/query.rpc.Query"; -import * as _342 from "./staking/v1beta1/query.rpc.Query"; -import * as _343 from "./tx/v1beta1/service.rpc.Service"; -import * as _344 from "./upgrade/v1beta1/query.rpc.Query"; -import * as _345 from "./auth/v1beta1/tx.rpc.msg"; -import * as _346 from "./authz/v1beta1/tx.rpc.msg"; -import * as _347 from "./bank/v1beta1/tx.rpc.msg"; -import * as _348 from "./distribution/v1beta1/tx.rpc.msg"; -import * as _349 from "./gov/v1/tx.rpc.msg"; -import * as _350 from "./gov/v1beta1/tx.rpc.msg"; -import * as _351 from "./mint/v1beta1/tx.rpc.msg"; -import * as _352 from "./slashing/v1beta1/tx.rpc.msg"; -import * as _353 from "./staking/v1beta1/tx.rpc.msg"; -import * as _354 from "./upgrade/v1beta1/tx.rpc.msg"; -import * as _507 from "./rpc.query"; -import * as _508 from "./rpc.tx"; +import * as _314 from "./auth/v1beta1/tx.amino"; +import * as _315 from "./authz/v1beta1/tx.amino"; +import * as _316 from "./bank/v1beta1/tx.amino"; +import * as _317 from "./distribution/v1beta1/tx.amino"; +import * as _318 from "./gov/v1/tx.amino"; +import * as _319 from "./gov/v1beta1/tx.amino"; +import * as _320 from "./mint/v1beta1/tx.amino"; +import * as _321 from "./slashing/v1beta1/tx.amino"; +import * as _322 from "./staking/v1beta1/tx.amino"; +import * as _323 from "./upgrade/v1beta1/tx.amino"; +import * as _324 from "./auth/v1beta1/tx.registry"; +import * as _325 from "./authz/v1beta1/tx.registry"; +import * as _326 from "./bank/v1beta1/tx.registry"; +import * as _327 from "./distribution/v1beta1/tx.registry"; +import * as _328 from "./gov/v1/tx.registry"; +import * as _329 from "./gov/v1beta1/tx.registry"; +import * as _330 from "./mint/v1beta1/tx.registry"; +import * as _331 from "./slashing/v1beta1/tx.registry"; +import * as _332 from "./staking/v1beta1/tx.registry"; +import * as _333 from "./upgrade/v1beta1/tx.registry"; +import * as _334 from "./auth/v1beta1/query.rpc.Query"; +import * as _335 from "./authz/v1beta1/query.rpc.Query"; +import * as _336 from "./bank/v1beta1/query.rpc.Query"; +import * as _337 from "./base/tendermint/v1beta1/query.rpc.Service"; +import * as _338 from "./distribution/v1beta1/query.rpc.Query"; +import * as _339 from "./gov/v1/query.rpc.Query"; +import * as _340 from "./gov/v1beta1/query.rpc.Query"; +import * as _341 from "./mint/v1beta1/query.rpc.Query"; +import * as _342 from "./params/v1beta1/query.rpc.Query"; +import * as _343 from "./slashing/v1beta1/query.rpc.Query"; +import * as _344 from "./staking/v1beta1/query.rpc.Query"; +import * as _345 from "./tx/v1beta1/service.rpc.Service"; +import * as _346 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _347 from "./auth/v1beta1/tx.rpc.msg"; +import * as _348 from "./authz/v1beta1/tx.rpc.msg"; +import * as _349 from "./bank/v1beta1/tx.rpc.msg"; +import * as _350 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _351 from "./gov/v1/tx.rpc.msg"; +import * as _352 from "./gov/v1beta1/tx.rpc.msg"; +import * as _353 from "./mint/v1beta1/tx.rpc.msg"; +import * as _354 from "./slashing/v1beta1/tx.rpc.msg"; +import * as _355 from "./staking/v1beta1/tx.rpc.msg"; +import * as _356 from "./upgrade/v1beta1/tx.rpc.msg"; +import * as _512 from "./rpc.query"; +import * as _513 from "./rpc.tx"; export namespace cosmos { export namespace auth { export const v1beta1 = { @@ -108,10 +108,10 @@ export namespace cosmos { ..._29, ..._30, ..._31, - ..._312, - ..._322, - ..._332, - ..._345 + ..._314, + ..._324, + ..._334, + ..._347 }; } export namespace authz { @@ -121,10 +121,10 @@ export namespace cosmos { ..._34, ..._35, ..._36, - ..._313, - ..._323, - ..._333, - ..._346 + ..._315, + ..._325, + ..._335, + ..._348 }; } export namespace bank { @@ -134,10 +134,10 @@ export namespace cosmos { ..._39, ..._40, ..._41, - ..._314, - ..._324, - ..._334, - ..._347 + ..._316, + ..._326, + ..._336, + ..._349 }; } export namespace base { @@ -155,7 +155,7 @@ export namespace cosmos { export const v1beta1 = { ..._44, ..._45, - ..._335 + ..._337 }; } export const v1beta1 = { @@ -179,10 +179,10 @@ export namespace cosmos { ..._51, ..._52, ..._53, - ..._315, - ..._325, - ..._336, - ..._348 + ..._317, + ..._327, + ..._338, + ..._350 }; } export namespace gov { @@ -191,20 +191,20 @@ export namespace cosmos { ..._55, ..._56, ..._57, - ..._316, - ..._326, - ..._337, - ..._349 + ..._318, + ..._328, + ..._339, + ..._351 }; export const v1beta1 = { ..._58, ..._59, ..._60, ..._61, - ..._317, - ..._327, - ..._338, - ..._350 + ..._319, + ..._329, + ..._340, + ..._352 }; } export namespace mint { @@ -213,10 +213,10 @@ export namespace cosmos { ..._63, ..._64, ..._65, - ..._318, - ..._328, - ..._339, - ..._351 + ..._320, + ..._330, + ..._341, + ..._353 }; } export namespace msg { @@ -233,7 +233,7 @@ export namespace cosmos { export const v1beta1 = { ..._68, ..._69, - ..._340 + ..._342 }; } export namespace query { @@ -247,10 +247,10 @@ export namespace cosmos { ..._72, ..._73, ..._74, - ..._319, - ..._329, - ..._341, - ..._352 + ..._321, + ..._331, + ..._343, + ..._354 }; } export namespace staking { @@ -260,10 +260,10 @@ export namespace cosmos { ..._77, ..._78, ..._79, - ..._320, - ..._330, - ..._342, - ..._353 + ..._322, + ..._332, + ..._344, + ..._355 }; } export namespace tx { @@ -275,7 +275,7 @@ export namespace cosmos { export const v1beta1 = { ..._81, ..._82, - ..._343 + ..._345 }; } export namespace upgrade { @@ -283,14 +283,14 @@ export namespace cosmos { ..._83, ..._84, ..._85, - ..._321, - ..._331, - ..._344, - ..._354 + ..._323, + ..._333, + ..._346, + ..._356 }; } export const ClientFactory = { - ..._507, - ..._508 + ..._512, + ..._513 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmwasm/bundle.ts b/packages/types/protobuf/codegen/cosmwasm/bundle.ts index 9040f1d83..f0b52ac89 100644 --- a/packages/types/protobuf/codegen/cosmwasm/bundle.ts +++ b/packages/types/protobuf/codegen/cosmwasm/bundle.ts @@ -10,16 +10,16 @@ import * as _94 from "./wasm/v1/proposal"; import * as _95 from "./wasm/v1/query"; import * as _96 from "./wasm/v1/tx"; import * as _97 from "./wasm/v1/types"; -import * as _355 from "./tokenfactory/v1beta1/tx.amino"; -import * as _356 from "./wasm/v1/tx.amino"; -import * as _357 from "./tokenfactory/v1beta1/tx.registry"; -import * as _358 from "./wasm/v1/tx.registry"; -import * as _359 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _360 from "./wasm/v1/query.rpc.Query"; -import * as _361 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _362 from "./wasm/v1/tx.rpc.msg"; -import * as _509 from "./rpc.query"; -import * as _510 from "./rpc.tx"; +import * as _357 from "./tokenfactory/v1beta1/tx.amino"; +import * as _358 from "./wasm/v1/tx.amino"; +import * as _359 from "./tokenfactory/v1beta1/tx.registry"; +import * as _360 from "./wasm/v1/tx.registry"; +import * as _361 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _362 from "./wasm/v1/query.rpc.Query"; +import * as _363 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _364 from "./wasm/v1/tx.rpc.msg"; +import * as _514 from "./rpc.query"; +import * as _515 from "./rpc.tx"; export namespace cosmwasm { export namespace tokenfactory { export const v1beta1 = { @@ -28,10 +28,10 @@ export namespace cosmwasm { ..._88, ..._89, ..._90, - ..._355, ..._357, ..._359, - ..._361 + ..._361, + ..._363 }; } export namespace wasm { @@ -43,14 +43,14 @@ export namespace cosmwasm { ..._95, ..._96, ..._97, - ..._356, ..._358, ..._360, - ..._362 + ..._362, + ..._364 }; } export const ClientFactory = { - ..._509, - ..._510 + ..._514, + ..._515 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/gaia/bundle.ts b/packages/types/protobuf/codegen/gaia/bundle.ts index 6cff66f4d..6d636d27d 100644 --- a/packages/types/protobuf/codegen/gaia/bundle.ts +++ b/packages/types/protobuf/codegen/gaia/bundle.ts @@ -1,26 +1,26 @@ import * as _98 from "./globalfee/v1beta1/genesis"; import * as _99 from "./globalfee/v1beta1/query"; import * as _100 from "./globalfee/v1beta1/tx"; -import * as _363 from "./globalfee/v1beta1/tx.amino"; -import * as _364 from "./globalfee/v1beta1/tx.registry"; -import * as _365 from "./globalfee/v1beta1/query.rpc.Query"; -import * as _366 from "./globalfee/v1beta1/tx.rpc.msg"; -import * as _511 from "./rpc.query"; -import * as _512 from "./rpc.tx"; +import * as _365 from "./globalfee/v1beta1/tx.amino"; +import * as _366 from "./globalfee/v1beta1/tx.registry"; +import * as _367 from "./globalfee/v1beta1/query.rpc.Query"; +import * as _368 from "./globalfee/v1beta1/tx.rpc.msg"; +import * as _516 from "./rpc.query"; +import * as _517 from "./rpc.tx"; export namespace gaia { export namespace globalfee { export const v1beta1 = { ..._98, ..._99, ..._100, - ..._363, - ..._364, ..._365, - ..._366 + ..._366, + ..._367, + ..._368 }; } export const ClientFactory = { - ..._511, - ..._512 + ..._516, + ..._517 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/bundle.ts b/packages/types/protobuf/codegen/ibc/bundle.ts index 1aaf3c32c..ca2724d18 100644 --- a/packages/types/protobuf/codegen/ibc/bundle.ts +++ b/packages/types/protobuf/codegen/ibc/bundle.ts @@ -20,28 +20,28 @@ import * as _127 from "./core/client/v1/client"; import * as _128 from "./core/client/v1/genesis"; import * as _129 from "./core/client/v1/query"; import * as _130 from "./core/client/v1/tx"; -import * as _367 from "./applications/interchain_accounts/controller/v1/tx.amino"; -import * as _368 from "./applications/interchain_accounts/host/v1/tx.amino"; -import * as _369 from "./applications/transfer/v1/tx.amino"; -import * as _370 from "./core/channel/v1/tx.amino"; -import * as _371 from "./core/client/v1/tx.amino"; -import * as _372 from "./applications/interchain_accounts/controller/v1/tx.registry"; -import * as _373 from "./applications/interchain_accounts/host/v1/tx.registry"; -import * as _374 from "./applications/transfer/v1/tx.registry"; -import * as _375 from "./core/channel/v1/tx.registry"; -import * as _376 from "./core/client/v1/tx.registry"; -import * as _377 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; -import * as _378 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; -import * as _379 from "./applications/transfer/v1/query.rpc.Query"; -import * as _380 from "./core/channel/v1/query.rpc.Query"; -import * as _381 from "./core/client/v1/query.rpc.Query"; -import * as _382 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; -import * as _383 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; -import * as _384 from "./applications/transfer/v1/tx.rpc.msg"; -import * as _385 from "./core/channel/v1/tx.rpc.msg"; -import * as _386 from "./core/client/v1/tx.rpc.msg"; -import * as _513 from "./rpc.query"; -import * as _514 from "./rpc.tx"; +import * as _369 from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as _370 from "./applications/interchain_accounts/host/v1/tx.amino"; +import * as _371 from "./applications/transfer/v1/tx.amino"; +import * as _372 from "./core/channel/v1/tx.amino"; +import * as _373 from "./core/client/v1/tx.amino"; +import * as _374 from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as _375 from "./applications/interchain_accounts/host/v1/tx.registry"; +import * as _376 from "./applications/transfer/v1/tx.registry"; +import * as _377 from "./core/channel/v1/tx.registry"; +import * as _378 from "./core/client/v1/tx.registry"; +import * as _379 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; +import * as _380 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; +import * as _381 from "./applications/transfer/v1/query.rpc.Query"; +import * as _382 from "./core/channel/v1/query.rpc.Query"; +import * as _383 from "./core/client/v1/query.rpc.Query"; +import * as _384 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; +import * as _385 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; +import * as _386 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _387 from "./core/channel/v1/tx.rpc.msg"; +import * as _388 from "./core/client/v1/tx.rpc.msg"; +import * as _518 from "./rpc.query"; +import * as _519 from "./rpc.tx"; export namespace ibc { export namespace applications { export namespace interchain_accounts { @@ -50,10 +50,10 @@ export namespace ibc { ..._109, ..._110, ..._111, - ..._367, - ..._372, - ..._377, - ..._382 + ..._369, + ..._374, + ..._379, + ..._384 }; } export namespace host { @@ -61,10 +61,10 @@ export namespace ibc { ..._112, ..._113, ..._114, - ..._368, - ..._373, - ..._378, - ..._383 + ..._370, + ..._375, + ..._380, + ..._385 }; } export const v1 = { @@ -80,10 +80,10 @@ export namespace ibc { ..._120, ..._121, ..._122, - ..._369, - ..._374, - ..._379, - ..._384 + ..._371, + ..._376, + ..._381, + ..._386 }; } } @@ -94,10 +94,10 @@ export namespace ibc { ..._124, ..._125, ..._126, - ..._370, - ..._375, - ..._380, - ..._385 + ..._372, + ..._377, + ..._382, + ..._387 }; } export namespace client { @@ -106,15 +106,15 @@ export namespace ibc { ..._128, ..._129, ..._130, - ..._371, - ..._376, - ..._381, - ..._386 + ..._373, + ..._378, + ..._383, + ..._388 }; } } export const ClientFactory = { - ..._513, - ..._514 + ..._518, + ..._519 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/juno/bundle.ts b/packages/types/protobuf/codegen/juno/bundle.ts index f701e7159..130b216e5 100644 --- a/packages/types/protobuf/codegen/juno/bundle.ts +++ b/packages/types/protobuf/codegen/juno/bundle.ts @@ -6,16 +6,16 @@ import * as _135 from "./mint/genesis"; import * as _136 from "./mint/mint"; import * as _137 from "./mint/query"; import * as _138 from "./mint/tx"; -import * as _387 from "./feeshare/v1/tx.amino"; -import * as _388 from "./mint/tx.amino"; -import * as _389 from "./feeshare/v1/tx.registry"; -import * as _390 from "./mint/tx.registry"; -import * as _391 from "./feeshare/v1/query.rpc.Query"; -import * as _392 from "./mint/query.rpc.Query"; -import * as _393 from "./feeshare/v1/tx.rpc.msg"; -import * as _394 from "./mint/tx.rpc.msg"; -import * as _515 from "./rpc.query"; -import * as _516 from "./rpc.tx"; +import * as _389 from "./feeshare/v1/tx.amino"; +import * as _390 from "./mint/tx.amino"; +import * as _391 from "./feeshare/v1/tx.registry"; +import * as _392 from "./mint/tx.registry"; +import * as _393 from "./feeshare/v1/query.rpc.Query"; +import * as _394 from "./mint/query.rpc.Query"; +import * as _395 from "./feeshare/v1/tx.rpc.msg"; +import * as _396 from "./mint/tx.rpc.msg"; +import * as _520 from "./rpc.query"; +import * as _521 from "./rpc.tx"; export namespace juno { export namespace feeshare { export const v1 = { @@ -23,10 +23,10 @@ export namespace juno { ..._132, ..._133, ..._134, - ..._387, ..._389, ..._391, - ..._393 + ..._393, + ..._395 }; } export const mint = { @@ -34,13 +34,13 @@ export namespace juno { ..._136, ..._137, ..._138, - ..._388, ..._390, ..._392, - ..._394 + ..._394, + ..._396 }; export const ClientFactory = { - ..._515, - ..._516 + ..._520, + ..._521 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/neutron/bundle.ts b/packages/types/protobuf/codegen/neutron/bundle.ts index 7da0815cb..d2e5c4fbb 100644 --- a/packages/types/protobuf/codegen/neutron/bundle.ts +++ b/packages/types/protobuf/codegen/neutron/bundle.ts @@ -36,32 +36,32 @@ import * as _173 from "./interchaintxs/v1/genesis"; import * as _174 from "./interchaintxs/v1/params"; import * as _175 from "./interchaintxs/v1/query"; import * as _176 from "./interchaintxs/v1/tx"; -import * as _395 from "./cron/tx.amino"; -import * as _396 from "./dex/tx.amino"; -import * as _397 from "./feeburner/tx.amino"; -import * as _398 from "./feerefunder/tx.amino"; -import * as _399 from "./interchainqueries/tx.amino"; -import * as _400 from "./interchaintxs/v1/tx.amino"; -import * as _401 from "./cron/tx.registry"; -import * as _402 from "./dex/tx.registry"; -import * as _403 from "./feeburner/tx.registry"; -import * as _404 from "./feerefunder/tx.registry"; -import * as _405 from "./interchainqueries/tx.registry"; -import * as _406 from "./interchaintxs/v1/tx.registry"; -import * as _407 from "./cron/query.rpc.Query"; -import * as _408 from "./dex/query.rpc.Query"; -import * as _409 from "./feeburner/query.rpc.Query"; -import * as _410 from "./feerefunder/query.rpc.Query"; -import * as _411 from "./interchainqueries/query.rpc.Query"; -import * as _412 from "./interchaintxs/v1/query.rpc.Query"; -import * as _413 from "./cron/tx.rpc.msg"; -import * as _414 from "./dex/tx.rpc.msg"; -import * as _415 from "./feeburner/tx.rpc.msg"; -import * as _416 from "./feerefunder/tx.rpc.msg"; -import * as _417 from "./interchainqueries/tx.rpc.msg"; -import * as _418 from "./interchaintxs/v1/tx.rpc.msg"; -import * as _517 from "./rpc.query"; -import * as _518 from "./rpc.tx"; +import * as _397 from "./cron/tx.amino"; +import * as _398 from "./dex/tx.amino"; +import * as _399 from "./feeburner/tx.amino"; +import * as _400 from "./feerefunder/tx.amino"; +import * as _401 from "./interchainqueries/tx.amino"; +import * as _402 from "./interchaintxs/v1/tx.amino"; +import * as _403 from "./cron/tx.registry"; +import * as _404 from "./dex/tx.registry"; +import * as _405 from "./feeburner/tx.registry"; +import * as _406 from "./feerefunder/tx.registry"; +import * as _407 from "./interchainqueries/tx.registry"; +import * as _408 from "./interchaintxs/v1/tx.registry"; +import * as _409 from "./cron/query.rpc.Query"; +import * as _410 from "./dex/query.rpc.Query"; +import * as _411 from "./feeburner/query.rpc.Query"; +import * as _412 from "./feerefunder/query.rpc.Query"; +import * as _413 from "./interchainqueries/query.rpc.Query"; +import * as _414 from "./interchaintxs/v1/query.rpc.Query"; +import * as _415 from "./cron/tx.rpc.msg"; +import * as _416 from "./dex/tx.rpc.msg"; +import * as _417 from "./feeburner/tx.rpc.msg"; +import * as _418 from "./feerefunder/tx.rpc.msg"; +import * as _419 from "./interchainqueries/tx.rpc.msg"; +import * as _420 from "./interchaintxs/v1/tx.rpc.msg"; +import * as _522 from "./rpc.query"; +import * as _523 from "./rpc.tx"; export namespace neutron { export namespace contractmanager { export const v1 = { @@ -74,10 +74,10 @@ export namespace neutron { ..._142, ..._143, ..._144, - ..._395, - ..._401, - ..._407, - ..._413 + ..._397, + ..._403, + ..._409, + ..._415 }; export const dex = { ..._145, @@ -94,10 +94,10 @@ export namespace neutron { ..._156, ..._157, ..._158, - ..._396, - ..._402, - ..._408, - ..._414 + ..._398, + ..._404, + ..._410, + ..._416 }; export const feeburner = { ..._159, @@ -105,10 +105,10 @@ export namespace neutron { ..._161, ..._162, ..._163, - ..._397, - ..._403, - ..._409, - ..._415 + ..._399, + ..._405, + ..._411, + ..._417 }; export const feerefunder = { ..._164, @@ -116,20 +116,20 @@ export namespace neutron { ..._166, ..._167, ..._168, - ..._398, - ..._404, - ..._410, - ..._416 + ..._400, + ..._406, + ..._412, + ..._418 }; export const interchainqueries = { ..._169, ..._170, ..._171, ..._172, - ..._399, - ..._405, - ..._411, - ..._417 + ..._401, + ..._407, + ..._413, + ..._419 }; export namespace interchaintxs { export const v1 = { @@ -137,14 +137,14 @@ export namespace neutron { ..._174, ..._175, ..._176, - ..._400, - ..._406, - ..._412, - ..._418 + ..._402, + ..._408, + ..._414, + ..._420 }; } export const ClientFactory = { - ..._517, - ..._518 + ..._522, + ..._523 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/noble/bundle.ts b/packages/types/protobuf/codegen/noble/bundle.ts index 31998b425..0fa954db0 100644 --- a/packages/types/protobuf/codegen/noble/bundle.ts +++ b/packages/types/protobuf/codegen/noble/bundle.ts @@ -1,16 +1,16 @@ -import * as _291 from "../tariff/genesis"; -import * as _292 from "../tariff/params"; -import * as _293 from "../tariff/query"; -import * as _502 from "../tariff/query.rpc.Query"; -import * as _525 from "./rpc.query"; +import * as _293 from "../tariff/genesis"; +import * as _294 from "../tariff/params"; +import * as _295 from "../tariff/query"; +import * as _507 from "../tariff/query.rpc.Query"; +import * as _530 from "./rpc.query"; export namespace noble { export const tariff = { - ..._291, - ..._292, ..._293, - ..._502 + ..._294, + ..._295, + ..._507 }; export const ClientFactory = { - ..._525 + ..._530 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/bundle.ts b/packages/types/protobuf/codegen/osmosis/bundle.ts index e869eaea4..a274e8368 100644 --- a/packages/types/protobuf/codegen/osmosis/bundle.ts +++ b/packages/types/protobuf/codegen/osmosis/bundle.ts @@ -63,60 +63,65 @@ import * as _238 from "./tokenfactory/v1beta1/tx"; import * as _239 from "./txfees/v1beta1/feetoken"; import * as _240 from "./txfees/v1beta1/genesis"; import * as _241 from "./txfees/v1beta1/gov"; -import * as _242 from "./txfees/v1beta1/query"; -import * as _243 from "./valset-pref/v1beta1/query"; -import * as _244 from "./valset-pref/v1beta1/state"; -import * as _245 from "./valset-pref/v1beta1/tx"; -import * as _419 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; -import * as _420 from "./concentratedliquidity/v1beta1/tx.amino"; -import * as _421 from "./gamm/pool-models/balancer/tx/tx.amino"; -import * as _422 from "./gamm/pool-models/stableswap/tx.amino"; -import * as _423 from "./gamm/v1beta1/tx.amino"; -import * as _424 from "./incentives/tx.amino"; -import * as _425 from "./lockup/tx.amino"; -import * as _426 from "./poolmanager/v1beta1/tx.amino"; -import * as _427 from "./protorev/v1beta1/tx.amino"; -import * as _428 from "./superfluid/tx.amino"; -import * as _429 from "./tokenfactory/v1beta1/tx.amino"; -import * as _430 from "./valset-pref/v1beta1/tx.amino"; -import * as _431 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; -import * as _432 from "./concentratedliquidity/v1beta1/tx.registry"; -import * as _433 from "./gamm/pool-models/balancer/tx/tx.registry"; -import * as _434 from "./gamm/pool-models/stableswap/tx.registry"; -import * as _435 from "./gamm/v1beta1/tx.registry"; -import * as _436 from "./incentives/tx.registry"; -import * as _437 from "./lockup/tx.registry"; -import * as _438 from "./poolmanager/v1beta1/tx.registry"; -import * as _439 from "./protorev/v1beta1/tx.registry"; -import * as _440 from "./superfluid/tx.registry"; -import * as _441 from "./tokenfactory/v1beta1/tx.registry"; -import * as _442 from "./valset-pref/v1beta1/tx.registry"; -import * as _443 from "./concentratedliquidity/v1beta1/query.rpc.Query"; -import * as _444 from "./cosmwasmpool/v1beta1/query.rpc.Query"; -import * as _445 from "./gamm/v1beta1/query.rpc.Query"; -import * as _446 from "./incentives/query.rpc.Query"; -import * as _447 from "./lockup/query.rpc.Query"; -import * as _448 from "./pool-incentives/v1beta1/query.rpc.Query"; -import * as _449 from "./poolmanager/v1beta1/query.rpc.Query"; -import * as _450 from "./protorev/v1beta1/query.rpc.Query"; -import * as _451 from "./superfluid/query.rpc.Query"; -import * as _452 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _453 from "./txfees/v1beta1/query.rpc.Query"; -import * as _454 from "./valset-pref/v1beta1/query.rpc.Query"; -import * as _455 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; -import * as _456 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; -import * as _457 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; -import * as _458 from "./gamm/pool-models/stableswap/tx.rpc.msg"; -import * as _459 from "./gamm/v1beta1/tx.rpc.msg"; -import * as _460 from "./incentives/tx.rpc.msg"; -import * as _461 from "./lockup/tx.rpc.msg"; -import * as _462 from "./poolmanager/v1beta1/tx.rpc.msg"; -import * as _463 from "./protorev/v1beta1/tx.rpc.msg"; -import * as _464 from "./superfluid/tx.rpc.msg"; -import * as _465 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _466 from "./valset-pref/v1beta1/tx.rpc.msg"; -import * as _519 from "./rpc.query"; -import * as _520 from "./rpc.tx"; +import * as _242 from "./txfees/v1beta1/params"; +import * as _243 from "./txfees/v1beta1/query"; +import * as _244 from "./txfees/v1beta1/tx"; +import * as _245 from "./valset-pref/v1beta1/query"; +import * as _246 from "./valset-pref/v1beta1/state"; +import * as _247 from "./valset-pref/v1beta1/tx"; +import * as _421 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; +import * as _422 from "./concentratedliquidity/v1beta1/tx.amino"; +import * as _423 from "./gamm/pool-models/balancer/tx/tx.amino"; +import * as _424 from "./gamm/pool-models/stableswap/tx.amino"; +import * as _425 from "./gamm/v1beta1/tx.amino"; +import * as _426 from "./incentives/tx.amino"; +import * as _427 from "./lockup/tx.amino"; +import * as _428 from "./poolmanager/v1beta1/tx.amino"; +import * as _429 from "./protorev/v1beta1/tx.amino"; +import * as _430 from "./superfluid/tx.amino"; +import * as _431 from "./tokenfactory/v1beta1/tx.amino"; +import * as _432 from "./txfees/v1beta1/tx.amino"; +import * as _433 from "./valset-pref/v1beta1/tx.amino"; +import * as _434 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; +import * as _435 from "./concentratedliquidity/v1beta1/tx.registry"; +import * as _436 from "./gamm/pool-models/balancer/tx/tx.registry"; +import * as _437 from "./gamm/pool-models/stableswap/tx.registry"; +import * as _438 from "./gamm/v1beta1/tx.registry"; +import * as _439 from "./incentives/tx.registry"; +import * as _440 from "./lockup/tx.registry"; +import * as _441 from "./poolmanager/v1beta1/tx.registry"; +import * as _442 from "./protorev/v1beta1/tx.registry"; +import * as _443 from "./superfluid/tx.registry"; +import * as _444 from "./tokenfactory/v1beta1/tx.registry"; +import * as _445 from "./txfees/v1beta1/tx.registry"; +import * as _446 from "./valset-pref/v1beta1/tx.registry"; +import * as _447 from "./concentratedliquidity/v1beta1/query.rpc.Query"; +import * as _448 from "./cosmwasmpool/v1beta1/query.rpc.Query"; +import * as _449 from "./gamm/v1beta1/query.rpc.Query"; +import * as _450 from "./incentives/query.rpc.Query"; +import * as _451 from "./lockup/query.rpc.Query"; +import * as _452 from "./pool-incentives/v1beta1/query.rpc.Query"; +import * as _453 from "./poolmanager/v1beta1/query.rpc.Query"; +import * as _454 from "./protorev/v1beta1/query.rpc.Query"; +import * as _455 from "./superfluid/query.rpc.Query"; +import * as _456 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _457 from "./txfees/v1beta1/query.rpc.Query"; +import * as _458 from "./valset-pref/v1beta1/query.rpc.Query"; +import * as _459 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; +import * as _460 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; +import * as _461 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; +import * as _462 from "./gamm/pool-models/stableswap/tx.rpc.msg"; +import * as _463 from "./gamm/v1beta1/tx.rpc.msg"; +import * as _464 from "./incentives/tx.rpc.msg"; +import * as _465 from "./lockup/tx.rpc.msg"; +import * as _466 from "./poolmanager/v1beta1/tx.rpc.msg"; +import * as _467 from "./protorev/v1beta1/tx.rpc.msg"; +import * as _468 from "./superfluid/tx.rpc.msg"; +import * as _469 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _470 from "./txfees/v1beta1/tx.rpc.msg"; +import * as _471 from "./valset-pref/v1beta1/tx.rpc.msg"; +import * as _524 from "./rpc.query"; +import * as _525 from "./rpc.tx"; export namespace osmosis { export namespace accum { export const v1beta1 = { @@ -128,17 +133,17 @@ export namespace osmosis { poolmodel: { concentrated: { v1beta1: { - ..._419, - ..._431, - ..._455 + ..._421, + ..._434, + ..._459 } } }, v1beta1: { - ..._420, - ..._432, - ..._443, - ..._456 + ..._422, + ..._435, + ..._447, + ..._460 } }; export namespace cosmwasmpool { @@ -155,7 +160,7 @@ export namespace osmosis { ..._188, ..._189, ..._190, - ..._444 + ..._448 }; } export namespace gamm { @@ -166,27 +171,27 @@ export namespace osmosis { ..._194, ..._195, ..._196, - ..._423, - ..._435, - ..._445, - ..._459 + ..._425, + ..._438, + ..._449, + ..._463 }; export namespace poolmodels { export namespace balancer { export const v1beta1 = { ..._197, - ..._421, - ..._433, - ..._457 + ..._423, + ..._436, + ..._461 }; } export namespace stableswap { export const v1beta1 = { ..._198, ..._199, - ..._422, - ..._434, - ..._458 + ..._424, + ..._437, + ..._462 }; } } @@ -199,10 +204,10 @@ export namespace osmosis { ..._204, ..._205, ..._206, - ..._424, - ..._436, - ..._446, - ..._460 + ..._426, + ..._439, + ..._450, + ..._464 }; export const lockup = { ..._207, @@ -210,10 +215,10 @@ export namespace osmosis { ..._209, ..._210, ..._211, - ..._425, - ..._437, - ..._447, - ..._461 + ..._427, + ..._440, + ..._451, + ..._465 }; export namespace poolincentives { export const v1beta1 = { @@ -222,7 +227,7 @@ export namespace osmosis { ..._214, ..._215, ..._216, - ..._448 + ..._452 }; } export namespace poolmanager { @@ -233,10 +238,10 @@ export namespace osmosis { ..._220, ..._221, ..._222, - ..._426, - ..._438, - ..._449, - ..._462 + ..._428, + ..._441, + ..._453, + ..._466 }; } export namespace protorev { @@ -247,10 +252,10 @@ export namespace osmosis { ..._226, ..._227, ..._228, - ..._427, - ..._439, - ..._450, - ..._463 + ..._429, + ..._442, + ..._454, + ..._467 }; } export const superfluid = { @@ -259,10 +264,10 @@ export namespace osmosis { ..._231, ..._232, ..._233, - ..._428, - ..._440, - ..._451, - ..._464 + ..._430, + ..._443, + ..._455, + ..._468 }; export namespace tokenfactory { export const v1beta1 = { @@ -271,10 +276,10 @@ export namespace osmosis { ..._236, ..._237, ..._238, - ..._429, - ..._441, - ..._452, - ..._465 + ..._431, + ..._444, + ..._456, + ..._469 }; } export namespace txfees { @@ -283,22 +288,27 @@ export namespace osmosis { ..._240, ..._241, ..._242, - ..._453 + ..._243, + ..._244, + ..._432, + ..._445, + ..._457, + ..._470 }; } export namespace valsetpref { export const v1beta1 = { - ..._243, - ..._244, ..._245, - ..._430, - ..._442, - ..._454, - ..._466 + ..._246, + ..._247, + ..._433, + ..._446, + ..._458, + ..._471 }; } export const ClientFactory = { - ..._519, - ..._520 + ..._524, + ..._525 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/client.ts b/packages/types/protobuf/codegen/osmosis/client.ts index 07bc7fd95..f75b950bf 100644 --- a/packages/types/protobuf/codegen/osmosis/client.ts +++ b/packages/types/protobuf/codegen/osmosis/client.ts @@ -12,6 +12,7 @@ import * as osmosisPoolmanagerV1beta1TxRegistry from "./poolmanager/v1beta1/tx.r import * as osmosisProtorevV1beta1TxRegistry from "./protorev/v1beta1/tx.registry"; import * as osmosisSuperfluidTxRegistry from "./superfluid/tx.registry"; import * as osmosisTokenfactoryV1beta1TxRegistry from "./tokenfactory/v1beta1/tx.registry"; +import * as osmosisTxfeesV1beta1TxRegistry from "./txfees/v1beta1/tx.registry"; import * as osmosisValsetprefV1beta1TxRegistry from "./valset-pref/v1beta1/tx.registry"; import * as osmosisConcentratedliquidityPoolmodelConcentratedV1beta1TxAmino from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; import * as osmosisConcentratedliquidityV1beta1TxAmino from "./concentratedliquidity/v1beta1/tx.amino"; @@ -24,6 +25,7 @@ import * as osmosisPoolmanagerV1beta1TxAmino from "./poolmanager/v1beta1/tx.amin import * as osmosisProtorevV1beta1TxAmino from "./protorev/v1beta1/tx.amino"; import * as osmosisSuperfluidTxAmino from "./superfluid/tx.amino"; import * as osmosisTokenfactoryV1beta1TxAmino from "./tokenfactory/v1beta1/tx.amino"; +import * as osmosisTxfeesV1beta1TxAmino from "./txfees/v1beta1/tx.amino"; import * as osmosisValsetprefV1beta1TxAmino from "./valset-pref/v1beta1/tx.amino"; export const osmosisAminoConverters = { ...osmosisConcentratedliquidityPoolmodelConcentratedV1beta1TxAmino.AminoConverter, @@ -37,9 +39,10 @@ export const osmosisAminoConverters = { ...osmosisProtorevV1beta1TxAmino.AminoConverter, ...osmosisSuperfluidTxAmino.AminoConverter, ...osmosisTokenfactoryV1beta1TxAmino.AminoConverter, + ...osmosisTxfeesV1beta1TxAmino.AminoConverter, ...osmosisValsetprefV1beta1TxAmino.AminoConverter }; -export const osmosisProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...osmosisConcentratedliquidityPoolmodelConcentratedV1beta1TxRegistry.registry, ...osmosisConcentratedliquidityV1beta1TxRegistry.registry, ...osmosisGammPoolmodelsBalancerTxTxRegistry.registry, ...osmosisGammPoolmodelsStableswapTxRegistry.registry, ...osmosisGammV1beta1TxRegistry.registry, ...osmosisIncentivesTxRegistry.registry, ...osmosisLockupTxRegistry.registry, ...osmosisPoolmanagerV1beta1TxRegistry.registry, ...osmosisProtorevV1beta1TxRegistry.registry, ...osmosisSuperfluidTxRegistry.registry, ...osmosisTokenfactoryV1beta1TxRegistry.registry, ...osmosisValsetprefV1beta1TxRegistry.registry]; +export const osmosisProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...osmosisConcentratedliquidityPoolmodelConcentratedV1beta1TxRegistry.registry, ...osmosisConcentratedliquidityV1beta1TxRegistry.registry, ...osmosisGammPoolmodelsBalancerTxTxRegistry.registry, ...osmosisGammPoolmodelsStableswapTxRegistry.registry, ...osmosisGammV1beta1TxRegistry.registry, ...osmosisIncentivesTxRegistry.registry, ...osmosisLockupTxRegistry.registry, ...osmosisPoolmanagerV1beta1TxRegistry.registry, ...osmosisProtorevV1beta1TxRegistry.registry, ...osmosisSuperfluidTxRegistry.registry, ...osmosisTokenfactoryV1beta1TxRegistry.registry, ...osmosisTxfeesV1beta1TxRegistry.registry, ...osmosisValsetprefV1beta1TxRegistry.registry]; export const getSigningOsmosisClientOptions = ({ defaultTypes = defaultRegistryTypes }: { diff --git a/packages/types/protobuf/codegen/osmosis/rpc.tx.ts b/packages/types/protobuf/codegen/osmosis/rpc.tx.ts index 52c46b08a..7129e08ef 100644 --- a/packages/types/protobuf/codegen/osmosis/rpc.tx.ts +++ b/packages/types/protobuf/codegen/osmosis/rpc.tx.ts @@ -66,6 +66,9 @@ export const createRPCMsgClient = async ({ tokenfactory: { v1beta1: new (await import("./tokenfactory/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + txfees: { + v1beta1: new (await import("./txfees/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, valsetpref: { v1beta1: new (await import("./valset-pref/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) } diff --git a/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/genesis.ts b/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/genesis.ts index ff86bc09d..29f0ba849 100644 --- a/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/genesis.ts +++ b/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/genesis.ts @@ -1,10 +1,13 @@ //@ts-nocheck import { FeeToken, FeeTokenAmino, FeeTokenSDKType } from "./feetoken"; +import { Params, ParamsAmino, ParamsSDKType } from "./params"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** GenesisState defines the txfees module's genesis state. */ export interface GenesisState { basedenom: string; feetokens: FeeToken[]; + /** params is the container of txfees parameters. */ + params: Params | undefined; } export interface GenesisStateProtoMsg { typeUrl: "/osmosis.txfees.v1beta1.GenesisState"; @@ -14,6 +17,8 @@ export interface GenesisStateProtoMsg { export interface GenesisStateAmino { basedenom?: string; feetokens?: FeeTokenAmino[]; + /** params is the container of txfees parameters. */ + params?: ParamsAmino | undefined; } export interface GenesisStateAminoMsg { type: "osmosis/txfees/genesis-state"; @@ -23,11 +28,13 @@ export interface GenesisStateAminoMsg { export interface GenesisStateSDKType { basedenom: string; feetokens: FeeTokenSDKType[]; + params: ParamsSDKType | undefined; } function createBaseGenesisState(): GenesisState { return { basedenom: "", - feetokens: [] + feetokens: [], + params: Params.fromPartial({}) }; } export const GenesisState = { @@ -39,6 +46,9 @@ export const GenesisState = { for (const v of message.feetokens) { FeeToken.encode(v!, writer.uint32(18).fork()).ldelim(); } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(34).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState { @@ -54,6 +64,9 @@ export const GenesisState = { case 2: message.feetokens.push(FeeToken.decode(reader, reader.uint32(), useInterfaces)); break; + case 4: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; default: reader.skipType(tag & 7); break; @@ -65,6 +78,7 @@ export const GenesisState = { const message = createBaseGenesisState(); message.basedenom = object.basedenom ?? ""; message.feetokens = object.feetokens?.map(e => FeeToken.fromPartial(e)) || []; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { @@ -73,6 +87,9 @@ export const GenesisState = { message.basedenom = object.basedenom; } message.feetokens = object.feetokens?.map(e => FeeToken.fromAmino(e)) || []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } return message; }, toAmino(message: GenesisState, useInterfaces: boolean = false): GenesisStateAmino { @@ -83,6 +100,7 @@ export const GenesisState = { } else { obj.feetokens = []; } + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { diff --git a/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/params.ts b/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/params.ts new file mode 100644 index 000000000..4002514bf --- /dev/null +++ b/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/params.ts @@ -0,0 +1,92 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** Params holds parameters for the txfees module */ +export interface Params { + whitelistedFeeTokenSetters: string[]; +} +export interface ParamsProtoMsg { + typeUrl: "/osmosis.txfees.v1beta1.Params"; + value: Uint8Array; +} +/** Params holds parameters for the txfees module */ +export interface ParamsAmino { + whitelisted_fee_token_setters?: string[]; +} +export interface ParamsAminoMsg { + type: "osmosis/txfees/params"; + value: ParamsAmino; +} +/** Params holds parameters for the txfees module */ +export interface ParamsSDKType { + whitelisted_fee_token_setters: string[]; +} +function createBaseParams(): Params { + return { + whitelistedFeeTokenSetters: [] + }; +} +export const Params = { + typeUrl: "/osmosis.txfees.v1beta1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.whitelistedFeeTokenSetters) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.whitelistedFeeTokenSetters.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.whitelistedFeeTokenSetters = object.whitelistedFeeTokenSetters?.map(e => e) || []; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.whitelistedFeeTokenSetters = object.whitelisted_fee_token_setters?.map(e => e) || []; + return message; + }, + toAmino(message: Params, useInterfaces: boolean = false): ParamsAmino { + const obj: any = {}; + if (message.whitelistedFeeTokenSetters) { + obj.whitelisted_fee_token_setters = message.whitelistedFeeTokenSetters.map(e => e); + } else { + obj.whitelisted_fee_token_setters = []; + } + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params, useInterfaces: boolean = false): ParamsAminoMsg { + return { + type: "osmosis/txfees/params", + value: Params.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: ParamsProtoMsg, useInterfaces: boolean = false): Params { + return Params.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/osmosis.txfees.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/query.rpc.Query.ts index b72230956..de0bc3688 100644 --- a/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/query.rpc.Query.ts +++ b/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryFeeTokensRequest, QueryFeeTokensResponse, QueryDenomSpotPriceRequest, QueryDenomSpotPriceResponse, QueryDenomPoolIdRequest, QueryDenomPoolIdResponse, QueryBaseDenomRequest, QueryBaseDenomResponse } from "./query"; +import { QueryFeeTokensRequest, QueryFeeTokensResponse, QueryDenomSpotPriceRequest, QueryDenomSpotPriceResponse, QueryDenomPoolIdRequest, QueryDenomPoolIdResponse, QueryBaseDenomRequest, QueryBaseDenomResponse, QueryEipBaseFeeRequest, QueryEipBaseFeeResponse } from "./query"; export interface Query { /** * FeeTokens returns a list of all the whitelisted fee tokens and their @@ -15,6 +15,8 @@ export interface Query { denomPoolId(request: QueryDenomPoolIdRequest): Promise; /** Returns a list of all base denom tokens and their corresponding pools. */ baseDenom(request?: QueryBaseDenomRequest): Promise; + /** Returns a list of all base denom tokens and their corresponding pools. */ + getEipBaseFee(request?: QueryEipBaseFeeRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -24,6 +26,7 @@ export class QueryClientImpl implements Query { this.denomSpotPrice = this.denomSpotPrice.bind(this); this.denomPoolId = this.denomPoolId.bind(this); this.baseDenom = this.baseDenom.bind(this); + this.getEipBaseFee = this.getEipBaseFee.bind(this); } feeTokens(request: QueryFeeTokensRequest = {}, useInterfaces: boolean = true): Promise { const data = QueryFeeTokensRequest.encode(request).finish(); @@ -45,6 +48,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("osmosis.txfees.v1beta1.Query", "BaseDenom", data); return promise.then(data => QueryBaseDenomResponse.decode(new BinaryReader(data), undefined, useInterfaces)); } + getEipBaseFee(request: QueryEipBaseFeeRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryEipBaseFeeRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.txfees.v1beta1.Query", "GetEipBaseFee", data); + return promise.then(data => QueryEipBaseFeeResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -61,6 +69,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, baseDenom(request?: QueryBaseDenomRequest, useInterfaces: boolean = true): Promise { return queryService.baseDenom(request, useInterfaces); + }, + getEipBaseFee(request?: QueryEipBaseFeeRequest, useInterfaces: boolean = true): Promise { + return queryService.getEipBaseFee(request, useInterfaces); } }; }; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/query.ts b/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/query.ts index ddfad8f29..e6392c59d 100644 --- a/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/query.ts +++ b/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/query.ts @@ -153,6 +153,34 @@ export interface QueryBaseDenomResponseAminoMsg { export interface QueryBaseDenomResponseSDKType { base_denom: string; } +export interface QueryEipBaseFeeRequest {} +export interface QueryEipBaseFeeRequestProtoMsg { + typeUrl: "/osmosis.txfees.v1beta1.QueryEipBaseFeeRequest"; + value: Uint8Array; +} +export interface QueryEipBaseFeeRequestAmino {} +export interface QueryEipBaseFeeRequestAminoMsg { + type: "osmosis/txfees/query-eip-base-fee-request"; + value: QueryEipBaseFeeRequestAmino; +} +export interface QueryEipBaseFeeRequestSDKType {} +export interface QueryEipBaseFeeResponse { + baseFee: string; +} +export interface QueryEipBaseFeeResponseProtoMsg { + typeUrl: "/osmosis.txfees.v1beta1.QueryEipBaseFeeResponse"; + value: Uint8Array; +} +export interface QueryEipBaseFeeResponseAmino { + base_fee?: string; +} +export interface QueryEipBaseFeeResponseAminoMsg { + type: "osmosis/txfees/query-eip-base-fee-response"; + value: QueryEipBaseFeeResponseAmino; +} +export interface QueryEipBaseFeeResponseSDKType { + base_fee: string; +} function createBaseQueryFeeTokensRequest(): QueryFeeTokensRequest { return {}; } @@ -692,4 +720,129 @@ export const QueryBaseDenomResponse = { value: QueryBaseDenomResponse.encode(message).finish() }; } +}; +function createBaseQueryEipBaseFeeRequest(): QueryEipBaseFeeRequest { + return {}; +} +export const QueryEipBaseFeeRequest = { + typeUrl: "/osmosis.txfees.v1beta1.QueryEipBaseFeeRequest", + encode(_: QueryEipBaseFeeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryEipBaseFeeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEipBaseFeeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryEipBaseFeeRequest { + const message = createBaseQueryEipBaseFeeRequest(); + return message; + }, + fromAmino(_: QueryEipBaseFeeRequestAmino): QueryEipBaseFeeRequest { + const message = createBaseQueryEipBaseFeeRequest(); + return message; + }, + toAmino(_: QueryEipBaseFeeRequest, useInterfaces: boolean = false): QueryEipBaseFeeRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryEipBaseFeeRequestAminoMsg): QueryEipBaseFeeRequest { + return QueryEipBaseFeeRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryEipBaseFeeRequest, useInterfaces: boolean = false): QueryEipBaseFeeRequestAminoMsg { + return { + type: "osmosis/txfees/query-eip-base-fee-request", + value: QueryEipBaseFeeRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryEipBaseFeeRequestProtoMsg, useInterfaces: boolean = false): QueryEipBaseFeeRequest { + return QueryEipBaseFeeRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryEipBaseFeeRequest): Uint8Array { + return QueryEipBaseFeeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryEipBaseFeeRequest): QueryEipBaseFeeRequestProtoMsg { + return { + typeUrl: "/osmosis.txfees.v1beta1.QueryEipBaseFeeRequest", + value: QueryEipBaseFeeRequest.encode(message).finish() + }; + } +}; +function createBaseQueryEipBaseFeeResponse(): QueryEipBaseFeeResponse { + return { + baseFee: "" + }; +} +export const QueryEipBaseFeeResponse = { + typeUrl: "/osmosis.txfees.v1beta1.QueryEipBaseFeeResponse", + encode(message: QueryEipBaseFeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseFee !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.baseFee, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryEipBaseFeeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEipBaseFeeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryEipBaseFeeResponse { + const message = createBaseQueryEipBaseFeeResponse(); + message.baseFee = object.baseFee ?? ""; + return message; + }, + fromAmino(object: QueryEipBaseFeeResponseAmino): QueryEipBaseFeeResponse { + const message = createBaseQueryEipBaseFeeResponse(); + if (object.base_fee !== undefined && object.base_fee !== null) { + message.baseFee = object.base_fee; + } + return message; + }, + toAmino(message: QueryEipBaseFeeResponse, useInterfaces: boolean = false): QueryEipBaseFeeResponseAmino { + const obj: any = {}; + obj.base_fee = message.baseFee; + return obj; + }, + fromAminoMsg(object: QueryEipBaseFeeResponseAminoMsg): QueryEipBaseFeeResponse { + return QueryEipBaseFeeResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryEipBaseFeeResponse, useInterfaces: boolean = false): QueryEipBaseFeeResponseAminoMsg { + return { + type: "osmosis/txfees/query-eip-base-fee-response", + value: QueryEipBaseFeeResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryEipBaseFeeResponseProtoMsg, useInterfaces: boolean = false): QueryEipBaseFeeResponse { + return QueryEipBaseFeeResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryEipBaseFeeResponse): Uint8Array { + return QueryEipBaseFeeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryEipBaseFeeResponse): QueryEipBaseFeeResponseProtoMsg { + return { + typeUrl: "/osmosis.txfees.v1beta1.QueryEipBaseFeeResponse", + value: QueryEipBaseFeeResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/tx.amino.ts new file mode 100644 index 000000000..90ff632fa --- /dev/null +++ b/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/tx.amino.ts @@ -0,0 +1,8 @@ +import { MsgSetFeeTokens } from "./tx"; +export const AminoConverter = { + "/osmosis.txfees.v1beta1.MsgSetFeeTokens": { + aminoType: "osmosis/set-fee-tokens", + toAmino: MsgSetFeeTokens.toAmino, + fromAmino: MsgSetFeeTokens.fromAmino + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/tx.registry.ts new file mode 100644 index 000000000..717e03504 --- /dev/null +++ b/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/tx.registry.ts @@ -0,0 +1,35 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgSetFeeTokens } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.txfees.v1beta1.MsgSetFeeTokens", MsgSetFeeTokens]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + setFeeTokens(value: MsgSetFeeTokens) { + return { + typeUrl: "/osmosis.txfees.v1beta1.MsgSetFeeTokens", + value: MsgSetFeeTokens.encode(value).finish() + }; + } + }, + withTypeUrl: { + setFeeTokens(value: MsgSetFeeTokens) { + return { + typeUrl: "/osmosis.txfees.v1beta1.MsgSetFeeTokens", + value + }; + } + }, + fromPartial: { + setFeeTokens(value: MsgSetFeeTokens) { + return { + typeUrl: "/osmosis.txfees.v1beta1.MsgSetFeeTokens", + value: MsgSetFeeTokens.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/tx.rpc.msg.ts new file mode 100644 index 000000000..31ef3e9bb --- /dev/null +++ b/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,18 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgSetFeeTokens, MsgSetFeeTokensResponse } from "./tx"; +export interface Msg { + setFeeTokens(request: MsgSetFeeTokens): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.setFeeTokens = this.setFeeTokens.bind(this); + } + setFeeTokens(request: MsgSetFeeTokens, useInterfaces: boolean = true): Promise { + const data = MsgSetFeeTokens.encode(request).finish(); + const promise = this.rpc.request("osmosis.txfees.v1beta1.Msg", "SetFeeTokens", data); + return promise.then(data => MsgSetFeeTokensResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/tx.ts b/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/tx.ts new file mode 100644 index 000000000..b04d07395 --- /dev/null +++ b/packages/types/protobuf/codegen/osmosis/txfees/v1beta1/tx.ts @@ -0,0 +1,176 @@ +//@ts-nocheck +import { FeeToken, FeeTokenAmino, FeeTokenSDKType } from "./feetoken"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** ===================== MsgSetFeeTokens */ +export interface MsgSetFeeTokens { + feeTokens: FeeToken[]; + sender: string; +} +export interface MsgSetFeeTokensProtoMsg { + typeUrl: "/osmosis.txfees.v1beta1.MsgSetFeeTokens"; + value: Uint8Array; +} +/** ===================== MsgSetFeeTokens */ +export interface MsgSetFeeTokensAmino { + fee_tokens?: FeeTokenAmino[]; + sender?: string; +} +export interface MsgSetFeeTokensAminoMsg { + type: "osmosis/set-fee-tokens"; + value: MsgSetFeeTokensAmino; +} +/** ===================== MsgSetFeeTokens */ +export interface MsgSetFeeTokensSDKType { + fee_tokens: FeeTokenSDKType[]; + sender: string; +} +export interface MsgSetFeeTokensResponse {} +export interface MsgSetFeeTokensResponseProtoMsg { + typeUrl: "/osmosis.txfees.v1beta1.MsgSetFeeTokensResponse"; + value: Uint8Array; +} +export interface MsgSetFeeTokensResponseAmino {} +export interface MsgSetFeeTokensResponseAminoMsg { + type: "osmosis/txfees/set-fee-tokens-response"; + value: MsgSetFeeTokensResponseAmino; +} +export interface MsgSetFeeTokensResponseSDKType {} +function createBaseMsgSetFeeTokens(): MsgSetFeeTokens { + return { + feeTokens: [], + sender: "" + }; +} +export const MsgSetFeeTokens = { + typeUrl: "/osmosis.txfees.v1beta1.MsgSetFeeTokens", + encode(message: MsgSetFeeTokens, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.feeTokens) { + FeeToken.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.sender !== "") { + writer.uint32(18).string(message.sender); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetFeeTokens { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetFeeTokens(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feeTokens.push(FeeToken.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetFeeTokens { + const message = createBaseMsgSetFeeTokens(); + message.feeTokens = object.feeTokens?.map(e => FeeToken.fromPartial(e)) || []; + message.sender = object.sender ?? ""; + return message; + }, + fromAmino(object: MsgSetFeeTokensAmino): MsgSetFeeTokens { + const message = createBaseMsgSetFeeTokens(); + message.feeTokens = object.fee_tokens?.map(e => FeeToken.fromAmino(e)) || []; + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; + }, + toAmino(message: MsgSetFeeTokens, useInterfaces: boolean = false): MsgSetFeeTokensAmino { + const obj: any = {}; + if (message.feeTokens) { + obj.fee_tokens = message.feeTokens.map(e => e ? FeeToken.toAmino(e, useInterfaces) : undefined); + } else { + obj.fee_tokens = []; + } + obj.sender = message.sender; + return obj; + }, + fromAminoMsg(object: MsgSetFeeTokensAminoMsg): MsgSetFeeTokens { + return MsgSetFeeTokens.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetFeeTokens, useInterfaces: boolean = false): MsgSetFeeTokensAminoMsg { + return { + type: "osmosis/set-fee-tokens", + value: MsgSetFeeTokens.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgSetFeeTokensProtoMsg, useInterfaces: boolean = false): MsgSetFeeTokens { + return MsgSetFeeTokens.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetFeeTokens): Uint8Array { + return MsgSetFeeTokens.encode(message).finish(); + }, + toProtoMsg(message: MsgSetFeeTokens): MsgSetFeeTokensProtoMsg { + return { + typeUrl: "/osmosis.txfees.v1beta1.MsgSetFeeTokens", + value: MsgSetFeeTokens.encode(message).finish() + }; + } +}; +function createBaseMsgSetFeeTokensResponse(): MsgSetFeeTokensResponse { + return {}; +} +export const MsgSetFeeTokensResponse = { + typeUrl: "/osmosis.txfees.v1beta1.MsgSetFeeTokensResponse", + encode(_: MsgSetFeeTokensResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetFeeTokensResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetFeeTokensResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetFeeTokensResponse { + const message = createBaseMsgSetFeeTokensResponse(); + return message; + }, + fromAmino(_: MsgSetFeeTokensResponseAmino): MsgSetFeeTokensResponse { + const message = createBaseMsgSetFeeTokensResponse(); + return message; + }, + toAmino(_: MsgSetFeeTokensResponse, useInterfaces: boolean = false): MsgSetFeeTokensResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetFeeTokensResponseAminoMsg): MsgSetFeeTokensResponse { + return MsgSetFeeTokensResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetFeeTokensResponse, useInterfaces: boolean = false): MsgSetFeeTokensResponseAminoMsg { + return { + type: "osmosis/txfees/set-fee-tokens-response", + value: MsgSetFeeTokensResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgSetFeeTokensResponseProtoMsg, useInterfaces: boolean = false): MsgSetFeeTokensResponse { + return MsgSetFeeTokensResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetFeeTokensResponse): Uint8Array { + return MsgSetFeeTokensResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetFeeTokensResponse): MsgSetFeeTokensResponseProtoMsg { + return { + typeUrl: "/osmosis.txfees.v1beta1.MsgSetFeeTokensResponse", + value: MsgSetFeeTokensResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/publicawesome/bundle.ts b/packages/types/protobuf/codegen/publicawesome/bundle.ts index 47b417380..916e04fb7 100644 --- a/packages/types/protobuf/codegen/publicawesome/bundle.ts +++ b/packages/types/protobuf/codegen/publicawesome/bundle.ts @@ -1,88 +1,88 @@ -import * as _246 from "./stargaze/alloc/v1beta1/genesis"; -import * as _247 from "./stargaze/alloc/v1beta1/params"; -import * as _248 from "./stargaze/alloc/v1beta1/query"; -import * as _249 from "./stargaze/alloc/v1beta1/tx"; -import * as _250 from "./stargaze/cron/v1/cron"; -import * as _251 from "./stargaze/cron/v1/genesis"; -import * as _252 from "./stargaze/cron/v1/proposal"; -import * as _253 from "./stargaze/cron/v1/query"; -import * as _254 from "./stargaze/cron/v1/tx"; -import * as _255 from "./stargaze/globalfee/v1/genesis"; -import * as _256 from "./stargaze/globalfee/v1/globalfee"; -import * as _257 from "./stargaze/globalfee/v1/proposal"; -import * as _258 from "./stargaze/globalfee/v1/query"; -import * as _259 from "./stargaze/globalfee/v1/tx"; -import * as _260 from "./stargaze/mint/v1beta1/genesis"; -import * as _261 from "./stargaze/mint/v1beta1/mint"; -import * as _262 from "./stargaze/mint/v1beta1/query"; -import * as _263 from "./stargaze/mint/v1beta1/tx"; -import * as _467 from "./stargaze/alloc/v1beta1/tx.amino"; -import * as _468 from "./stargaze/cron/v1/tx.amino"; -import * as _469 from "./stargaze/globalfee/v1/tx.amino"; -import * as _470 from "./stargaze/alloc/v1beta1/tx.registry"; -import * as _471 from "./stargaze/cron/v1/tx.registry"; -import * as _472 from "./stargaze/globalfee/v1/tx.registry"; -import * as _473 from "./stargaze/alloc/v1beta1/query.rpc.Query"; -import * as _474 from "./stargaze/cron/v1/query.rpc.Query"; -import * as _475 from "./stargaze/globalfee/v1/query.rpc.Query"; -import * as _476 from "./stargaze/mint/v1beta1/query.rpc.Query"; -import * as _477 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; -import * as _478 from "./stargaze/cron/v1/tx.rpc.msg"; -import * as _479 from "./stargaze/globalfee/v1/tx.rpc.msg"; -import * as _521 from "./rpc.query"; -import * as _522 from "./rpc.tx"; +import * as _248 from "./stargaze/alloc/v1beta1/genesis"; +import * as _249 from "./stargaze/alloc/v1beta1/params"; +import * as _250 from "./stargaze/alloc/v1beta1/query"; +import * as _251 from "./stargaze/alloc/v1beta1/tx"; +import * as _252 from "./stargaze/cron/v1/cron"; +import * as _253 from "./stargaze/cron/v1/genesis"; +import * as _254 from "./stargaze/cron/v1/proposal"; +import * as _255 from "./stargaze/cron/v1/query"; +import * as _256 from "./stargaze/cron/v1/tx"; +import * as _257 from "./stargaze/globalfee/v1/genesis"; +import * as _258 from "./stargaze/globalfee/v1/globalfee"; +import * as _259 from "./stargaze/globalfee/v1/proposal"; +import * as _260 from "./stargaze/globalfee/v1/query"; +import * as _261 from "./stargaze/globalfee/v1/tx"; +import * as _262 from "./stargaze/mint/v1beta1/genesis"; +import * as _263 from "./stargaze/mint/v1beta1/mint"; +import * as _264 from "./stargaze/mint/v1beta1/query"; +import * as _265 from "./stargaze/mint/v1beta1/tx"; +import * as _472 from "./stargaze/alloc/v1beta1/tx.amino"; +import * as _473 from "./stargaze/cron/v1/tx.amino"; +import * as _474 from "./stargaze/globalfee/v1/tx.amino"; +import * as _475 from "./stargaze/alloc/v1beta1/tx.registry"; +import * as _476 from "./stargaze/cron/v1/tx.registry"; +import * as _477 from "./stargaze/globalfee/v1/tx.registry"; +import * as _478 from "./stargaze/alloc/v1beta1/query.rpc.Query"; +import * as _479 from "./stargaze/cron/v1/query.rpc.Query"; +import * as _480 from "./stargaze/globalfee/v1/query.rpc.Query"; +import * as _481 from "./stargaze/mint/v1beta1/query.rpc.Query"; +import * as _482 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; +import * as _483 from "./stargaze/cron/v1/tx.rpc.msg"; +import * as _484 from "./stargaze/globalfee/v1/tx.rpc.msg"; +import * as _526 from "./rpc.query"; +import * as _527 from "./rpc.tx"; export namespace publicawesome { export namespace stargaze { export namespace alloc { export const v1beta1 = { - ..._246, - ..._247, ..._248, ..._249, - ..._467, - ..._470, - ..._473, - ..._477 + ..._250, + ..._251, + ..._472, + ..._475, + ..._478, + ..._482 }; } export namespace cron { export const v1 = { - ..._250, - ..._251, ..._252, ..._253, ..._254, - ..._468, - ..._471, - ..._474, - ..._478 + ..._255, + ..._256, + ..._473, + ..._476, + ..._479, + ..._483 }; } export namespace globalfee { export const v1 = { - ..._255, - ..._256, ..._257, ..._258, ..._259, - ..._469, - ..._472, - ..._475, - ..._479 + ..._260, + ..._261, + ..._474, + ..._477, + ..._480, + ..._484 }; } export namespace mint { export const v1beta1 = { - ..._260, - ..._261, ..._262, ..._263, - ..._476 + ..._264, + ..._265, + ..._481 }; } } export const ClientFactory = { - ..._521, - ..._522 + ..._526, + ..._527 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/regen/bundle.ts b/packages/types/protobuf/codegen/regen/bundle.ts index 6d1b1209c..ce81a41e3 100644 --- a/packages/types/protobuf/codegen/regen/bundle.ts +++ b/packages/types/protobuf/codegen/regen/bundle.ts @@ -1,134 +1,134 @@ -import * as _264 from "./data/v1/events"; -import * as _265 from "./data/v1/state"; -import * as _266 from "./data/v1/tx"; -import * as _267 from "./data/v1/types"; -import * as _268 from "./data/v2/events"; -import * as _269 from "./data/v2/state"; -import * as _270 from "./data/v2/tx"; -import * as _271 from "./data/v2/types"; -import * as _272 from "./ecocredit/basket/v1/events"; -import * as _273 from "./ecocredit/basket/v1/state"; -import * as _274 from "./ecocredit/basket/v1/tx"; -import * as _275 from "./ecocredit/basket/v1/types"; -import * as _276 from "./ecocredit/marketplace/v1/events"; -import * as _277 from "./ecocredit/marketplace/v1/state"; -import * as _278 from "./ecocredit/marketplace/v1/tx"; -import * as _279 from "./ecocredit/marketplace/v1/types"; -import * as _280 from "./ecocredit/orderbook/v1alpha1/memory"; -import * as _281 from "./ecocredit/v1/events"; -import * as _282 from "./ecocredit/v1/state"; -import * as _283 from "./ecocredit/v1/tx"; -import * as _284 from "./ecocredit/v1/types"; -import * as _285 from "./ecocredit/v1alpha1/events"; -import * as _286 from "./ecocredit/v1alpha1/genesis"; -import * as _287 from "./ecocredit/v1alpha1/tx"; -import * as _288 from "./ecocredit/v1alpha1/types"; -import * as _289 from "./intertx/v1/query"; -import * as _290 from "./intertx/v1/tx"; -import * as _480 from "./data/v1/tx.amino"; -import * as _481 from "./data/v2/tx.amino"; -import * as _482 from "./ecocredit/basket/v1/tx.amino"; -import * as _483 from "./ecocredit/marketplace/v1/tx.amino"; -import * as _484 from "./ecocredit/v1/tx.amino"; -import * as _485 from "./ecocredit/v1alpha1/tx.amino"; -import * as _486 from "./intertx/v1/tx.amino"; -import * as _487 from "./data/v1/tx.registry"; -import * as _488 from "./data/v2/tx.registry"; -import * as _489 from "./ecocredit/basket/v1/tx.registry"; -import * as _490 from "./ecocredit/marketplace/v1/tx.registry"; -import * as _491 from "./ecocredit/v1/tx.registry"; -import * as _492 from "./ecocredit/v1alpha1/tx.registry"; -import * as _493 from "./intertx/v1/tx.registry"; -import * as _494 from "./intertx/v1/query.rpc.Query"; -import * as _495 from "./data/v1/tx.rpc.msg"; -import * as _496 from "./data/v2/tx.rpc.msg"; -import * as _497 from "./ecocredit/basket/v1/tx.rpc.msg"; -import * as _498 from "./ecocredit/marketplace/v1/tx.rpc.msg"; -import * as _499 from "./ecocredit/v1/tx.rpc.msg"; -import * as _500 from "./ecocredit/v1alpha1/tx.rpc.msg"; -import * as _501 from "./intertx/v1/tx.rpc.msg"; -import * as _523 from "./rpc.query"; -import * as _524 from "./rpc.tx"; +import * as _266 from "./data/v1/events"; +import * as _267 from "./data/v1/state"; +import * as _268 from "./data/v1/tx"; +import * as _269 from "./data/v1/types"; +import * as _270 from "./data/v2/events"; +import * as _271 from "./data/v2/state"; +import * as _272 from "./data/v2/tx"; +import * as _273 from "./data/v2/types"; +import * as _274 from "./ecocredit/basket/v1/events"; +import * as _275 from "./ecocredit/basket/v1/state"; +import * as _276 from "./ecocredit/basket/v1/tx"; +import * as _277 from "./ecocredit/basket/v1/types"; +import * as _278 from "./ecocredit/marketplace/v1/events"; +import * as _279 from "./ecocredit/marketplace/v1/state"; +import * as _280 from "./ecocredit/marketplace/v1/tx"; +import * as _281 from "./ecocredit/marketplace/v1/types"; +import * as _282 from "./ecocredit/orderbook/v1alpha1/memory"; +import * as _283 from "./ecocredit/v1/events"; +import * as _284 from "./ecocredit/v1/state"; +import * as _285 from "./ecocredit/v1/tx"; +import * as _286 from "./ecocredit/v1/types"; +import * as _287 from "./ecocredit/v1alpha1/events"; +import * as _288 from "./ecocredit/v1alpha1/genesis"; +import * as _289 from "./ecocredit/v1alpha1/tx"; +import * as _290 from "./ecocredit/v1alpha1/types"; +import * as _291 from "./intertx/v1/query"; +import * as _292 from "./intertx/v1/tx"; +import * as _485 from "./data/v1/tx.amino"; +import * as _486 from "./data/v2/tx.amino"; +import * as _487 from "./ecocredit/basket/v1/tx.amino"; +import * as _488 from "./ecocredit/marketplace/v1/tx.amino"; +import * as _489 from "./ecocredit/v1/tx.amino"; +import * as _490 from "./ecocredit/v1alpha1/tx.amino"; +import * as _491 from "./intertx/v1/tx.amino"; +import * as _492 from "./data/v1/tx.registry"; +import * as _493 from "./data/v2/tx.registry"; +import * as _494 from "./ecocredit/basket/v1/tx.registry"; +import * as _495 from "./ecocredit/marketplace/v1/tx.registry"; +import * as _496 from "./ecocredit/v1/tx.registry"; +import * as _497 from "./ecocredit/v1alpha1/tx.registry"; +import * as _498 from "./intertx/v1/tx.registry"; +import * as _499 from "./intertx/v1/query.rpc.Query"; +import * as _500 from "./data/v1/tx.rpc.msg"; +import * as _501 from "./data/v2/tx.rpc.msg"; +import * as _502 from "./ecocredit/basket/v1/tx.rpc.msg"; +import * as _503 from "./ecocredit/marketplace/v1/tx.rpc.msg"; +import * as _504 from "./ecocredit/v1/tx.rpc.msg"; +import * as _505 from "./ecocredit/v1alpha1/tx.rpc.msg"; +import * as _506 from "./intertx/v1/tx.rpc.msg"; +import * as _528 from "./rpc.query"; +import * as _529 from "./rpc.tx"; export namespace regen { export namespace data { export const v1 = { - ..._264, - ..._265, ..._266, ..._267, - ..._480, - ..._487, - ..._495 - }; - export const v2 = { ..._268, ..._269, + ..._485, + ..._492, + ..._500 + }; + export const v2 = { ..._270, ..._271, - ..._481, - ..._488, - ..._496 + ..._272, + ..._273, + ..._486, + ..._493, + ..._501 }; } export namespace ecocredit { export namespace basket { export const v1 = { - ..._272, - ..._273, ..._274, ..._275, - ..._482, - ..._489, - ..._497 + ..._276, + ..._277, + ..._487, + ..._494, + ..._502 }; } export namespace marketplace { export const v1 = { - ..._276, - ..._277, ..._278, ..._279, - ..._483, - ..._490, - ..._498 + ..._280, + ..._281, + ..._488, + ..._495, + ..._503 }; } export namespace orderbook { export const v1alpha1 = { - ..._280 + ..._282 }; } export const v1 = { - ..._281, - ..._282, ..._283, ..._284, - ..._484, - ..._491, - ..._499 - }; - export const v1alpha1 = { ..._285, ..._286, + ..._489, + ..._496, + ..._504 + }; + export const v1alpha1 = { ..._287, ..._288, - ..._485, - ..._492, - ..._500 + ..._289, + ..._290, + ..._490, + ..._497, + ..._505 }; } export namespace intertx { export const v1 = { - ..._289, - ..._290, - ..._486, - ..._493, - ..._494, - ..._501 + ..._291, + ..._292, + ..._491, + ..._498, + ..._499, + ..._506 }; } export const ClientFactory = { - ..._523, - ..._524 + ..._528, + ..._529 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/tendermint/bundle.ts b/packages/types/protobuf/codegen/tendermint/bundle.ts index f2fd77b7b..a31a79791 100644 --- a/packages/types/protobuf/codegen/tendermint/bundle.ts +++ b/packages/types/protobuf/codegen/tendermint/bundle.ts @@ -1,32 +1,32 @@ -import * as _294 from "./abci/types"; -import * as _295 from "./crypto/keys"; -import * as _296 from "./crypto/proof"; -import * as _297 from "./p2p/types"; -import * as _298 from "./types/block"; -import * as _299 from "./types/evidence"; -import * as _300 from "./types/params"; -import * as _301 from "./types/types"; -import * as _302 from "./types/validator"; -import * as _303 from "./version/types"; +import * as _296 from "./abci/types"; +import * as _297 from "./crypto/keys"; +import * as _298 from "./crypto/proof"; +import * as _299 from "./p2p/types"; +import * as _300 from "./types/block"; +import * as _301 from "./types/evidence"; +import * as _302 from "./types/params"; +import * as _303 from "./types/types"; +import * as _304 from "./types/validator"; +import * as _305 from "./version/types"; export namespace tendermint { export const abci = { - ..._294 + ..._296 }; export const crypto = { - ..._295, - ..._296 + ..._297, + ..._298 }; export const p2p = { - ..._297 + ..._299 }; export const types = { - ..._298, - ..._299, ..._300, ..._301, - ..._302 + ..._302, + ..._303, + ..._304 }; export const version = { - ..._303 + ..._305 }; } \ No newline at end of file diff --git a/packages/types/protobuf/proto/osmosis/txfees/v1beta1/feetoken.proto b/packages/types/protobuf/proto/osmosis/txfees/v1beta1/feetoken.proto index b3be388a9..9b2fe7d90 100644 --- a/packages/types/protobuf/proto/osmosis/txfees/v1beta1/feetoken.proto +++ b/packages/types/protobuf/proto/osmosis/txfees/v1beta1/feetoken.proto @@ -3,7 +3,7 @@ package osmosis.txfees.v1beta1; import "gogoproto/gogo.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v19/x/txfees/types"; +option go_package = "github.com/osmosis-labs/osmosis/v24/x/txfees/types"; // FeeToken is a struct that specifies a coin denom, and pool ID pair. // This marks the token as eligible for use as a tx fee asset in Osmosis. diff --git a/packages/types/protobuf/proto/osmosis/txfees/v1beta1/genesis.proto b/packages/types/protobuf/proto/osmosis/txfees/v1beta1/genesis.proto index 43e06a6a0..db7d6c8df 100644 --- a/packages/types/protobuf/proto/osmosis/txfees/v1beta1/genesis.proto +++ b/packages/types/protobuf/proto/osmosis/txfees/v1beta1/genesis.proto @@ -3,11 +3,21 @@ package osmosis.txfees.v1beta1; import "gogoproto/gogo.proto"; import "osmosis/txfees/v1beta1/feetoken.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "osmosis/txfees/v1beta1/params.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v19/x/txfees/types"; +option go_package = "github.com/osmosis-labs/osmosis/v24/x/txfees/types"; // GenesisState defines the txfees module's genesis state. message GenesisState { string basedenom = 1; repeated FeeToken feetokens = 2 [ (gogoproto.nullable) = false ]; + + // // KVStore state + // TxFeesTracker txFeesTracker = 3; + reserved 3; + reserved "txFeesTracker"; + + // params is the container of txfees parameters. + Params params = 4 [ (gogoproto.nullable) = false ]; } diff --git a/packages/types/protobuf/proto/osmosis/txfees/v1beta1/gov.proto b/packages/types/protobuf/proto/osmosis/txfees/v1beta1/gov.proto index f97b8643b..b431172c3 100644 --- a/packages/types/protobuf/proto/osmosis/txfees/v1beta1/gov.proto +++ b/packages/types/protobuf/proto/osmosis/txfees/v1beta1/gov.proto @@ -6,7 +6,7 @@ import "cosmos_proto/cosmos.proto"; import "amino/amino.proto"; import "osmosis/txfees/v1beta1/feetoken.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v19/x/txfees/types"; +option go_package = "github.com/osmosis-labs/osmosis/v24/x/txfees/types"; // UpdateFeeTokenProposal is a gov Content type for adding new whitelisted fee // token(s). It must specify a denom along with gamm pool ID to use as a spot diff --git a/packages/types/protobuf/proto/osmosis/txfees/v1beta1/params.proto b/packages/types/protobuf/proto/osmosis/txfees/v1beta1/params.proto new file mode 100644 index 000000000..3f8a7e10c --- /dev/null +++ b/packages/types/protobuf/proto/osmosis/txfees/v1beta1/params.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package osmosis.txfees.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/txfees/types"; + +// Params holds parameters for the txfees module +message Params { + repeated string whitelisted_fee_token_setters = 1 [ + (gogoproto.moretags) = "yaml:\"whitelisted_fee_token_setters\"", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/types/protobuf/proto/osmosis/txfees/v1beta1/query.proto b/packages/types/protobuf/proto/osmosis/txfees/v1beta1/query.proto index e37f58d6b..1d30a0f5a 100644 --- a/packages/types/protobuf/proto/osmosis/txfees/v1beta1/query.proto +++ b/packages/types/protobuf/proto/osmosis/txfees/v1beta1/query.proto @@ -7,7 +7,7 @@ import "google/protobuf/duration.proto"; import "osmosis/txfees/v1beta1/feetoken.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v19/x/txfees/types"; +option go_package = "github.com/osmosis-labs/osmosis/v24/x/txfees/types"; service Query { // FeeTokens returns a list of all the whitelisted fee tokens and their @@ -34,6 +34,11 @@ service Query { rpc BaseDenom(QueryBaseDenomRequest) returns (QueryBaseDenomResponse) { option (google.api.http).get = "/osmosis/txfees/v1beta1/base_denom"; } + + // Returns a list of all base denom tokens and their corresponding pools. + rpc GetEipBaseFee(QueryEipBaseFeeRequest) returns (QueryEipBaseFeeResponse) { + option (google.api.http).get = "/osmosis/txfees/v1beta1/cur_eip_base_fee"; + } } message QueryFeeTokensRequest {} @@ -56,6 +61,7 @@ message QueryDenomSpotPriceResponse { uint64 poolID = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; string spot_price = 2 [ (gogoproto.moretags) = "yaml:\"spot_price\"", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; @@ -72,3 +78,13 @@ message QueryBaseDenomRequest {} message QueryBaseDenomResponse { string base_denom = 1 [ (gogoproto.moretags) = "yaml:\"base_denom\"" ]; } + +message QueryEipBaseFeeRequest {} +message QueryEipBaseFeeResponse { + string base_fee = 1 [ + (gogoproto.moretags) = "yaml:\"base_fee\"", + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/types/protobuf/proto/osmosis/txfees/v1beta1/tx.proto b/packages/types/protobuf/proto/osmosis/txfees/v1beta1/tx.proto new file mode 100644 index 000000000..c96e9638b --- /dev/null +++ b/packages/types/protobuf/proto/osmosis/txfees/v1beta1/tx.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package osmosis.txfees.v1beta1; + +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; +import "osmosis/txfees/v1beta1/feetoken.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v24/x/txfees/types"; + +service Msg { + rpc SetFeeTokens(MsgSetFeeTokens) returns (MsgSetFeeTokensResponse); +} + +// ===================== MsgSetFeeTokens +message MsgSetFeeTokens { + option (amino.name) = "osmosis/set-fee-tokens"; + + repeated FeeToken fee_tokens = 1 [ + (gogoproto.moretags) = "yaml:\"fee_tokens\"", + (gogoproto.nullable) = false + ]; + string sender = 2 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; +} + +message MsgSetFeeTokensResponse {} From 6692e1992b6821c15acd980cd3d7ce6f64f27da9 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 11 Apr 2024 10:25:17 -0700 Subject: [PATCH 115/438] increased migaloo relayer funds needed --- packages/stateful/components/SelfRelayExecuteModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stateful/components/SelfRelayExecuteModal.tsx b/packages/stateful/components/SelfRelayExecuteModal.tsx index 8fac1270f..968541f7c 100644 --- a/packages/stateful/components/SelfRelayExecuteModal.tsx +++ b/packages/stateful/components/SelfRelayExecuteModal.tsx @@ -88,7 +88,7 @@ const RELAYER_FUNDS_NEEDED: Partial> = { [ChainId.StargazeMainnet]: 2 * 10 ** 6, [ChainId.NeutronMainnet]: 0.5 * 10 ** 6, [ChainId.TerraMainnet]: 0.1 * 10 ** 6, - [ChainId.MigalooMainnet]: 2 * 10 ** 6, + [ChainId.MigalooMainnet]: 4 * 10 ** 6, [ChainId.KujiraMainnet]: 0.1 * 10 ** 6, [ChainId.OraichainMainnet]: 0.1 * 10 ** 6, [ChainId.ChihuahuaMainnet]: 1000 * 10 ** 6, From f70f5546a1ae19159331f01291519bf975d7b63c Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 11 Apr 2024 12:32:33 -0700 Subject: [PATCH 116/438] increased migaloo relayer funds needed again --- packages/stateful/components/SelfRelayExecuteModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stateful/components/SelfRelayExecuteModal.tsx b/packages/stateful/components/SelfRelayExecuteModal.tsx index 968541f7c..5eb048391 100644 --- a/packages/stateful/components/SelfRelayExecuteModal.tsx +++ b/packages/stateful/components/SelfRelayExecuteModal.tsx @@ -88,7 +88,7 @@ const RELAYER_FUNDS_NEEDED: Partial> = { [ChainId.StargazeMainnet]: 2 * 10 ** 6, [ChainId.NeutronMainnet]: 0.5 * 10 ** 6, [ChainId.TerraMainnet]: 0.1 * 10 ** 6, - [ChainId.MigalooMainnet]: 4 * 10 ** 6, + [ChainId.MigalooMainnet]: 40 * 10 ** 6, [ChainId.KujiraMainnet]: 0.1 * 10 ** 6, [ChainId.OraichainMainnet]: 0.1 * 10 ** 6, [ChainId.ChihuahuaMainnet]: 1000 * 10 ** 6, From 17d40a2fd219a5585434a2a5e99223cc0666e992 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 15 Apr 2024 13:19:20 -0700 Subject: [PATCH 117/438] use connectComet instead of manual fn --- packages/utils/client.ts | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/packages/utils/client.ts b/packages/utils/client.ts index 6d8087eb6..8ebc4f74f 100644 --- a/packages/utils/client.ts +++ b/packages/utils/client.ts @@ -1,9 +1,11 @@ import { CosmWasmClient } from '@cosmjs/cosmwasm-stargate' import { StargateClient, logs } from '@cosmjs/stargate' import { + Comet38Client, HttpBatchClient, Tendermint34Client, Tendermint37Client, + connectComet, } from '@cosmjs/tendermint-rpc' type ChainClientRoutes = { @@ -62,8 +64,11 @@ export const cosmWasmClientRouter = new ChainClientRouter({ const httpClient = new HttpBatchClient(rpcEndpoint) const tmClient = await ( ( - await connectTendermintClient(rpcEndpoint) - ).constructor as typeof Tendermint34Client | typeof Tendermint37Client + await connectComet(rpcEndpoint) + ).constructor as + | typeof Tendermint34Client + | typeof Tendermint37Client + | typeof Comet38Client ).create(httpClient) return await CosmWasmClient.create(tmClient) @@ -78,8 +83,11 @@ export const stargateClientRouter = new ChainClientRouter({ const httpClient = new HttpBatchClient(rpcEndpoint) const tmClient = await ( ( - await connectTendermintClient(rpcEndpoint) - ).constructor as typeof Tendermint34Client | typeof Tendermint37Client + await connectComet(rpcEndpoint) + ).constructor as + | typeof Tendermint34Client + | typeof Tendermint37Client + | typeof Comet38Client ).create(httpClient) return await StargateClient.create(tmClient, {}) @@ -106,19 +114,3 @@ export const findWasmAttributeValue = ( ) return wasmEvent?.attributes.find(({ key }) => key === attributeKey)!.value } - -// Connect the correct tendermint client based on the node's version. -export const connectTendermintClient = async (endpoint: string) => { - // Tendermint/CometBFT 0.34/0.37 auto-detection. Starting with 0.37 we seem to - // get reliable versions again 🎉 Using 0.34 as the fallback. - let tmClient - const tm37Client = await Tendermint37Client.connect(endpoint) - const version = (await tm37Client.status()).nodeInfo.version - if (version.startsWith('0.37.')) { - tmClient = tm37Client - } else { - tm37Client.disconnect() - tmClient = await Tendermint34Client.connect(endpoint) - } - return tmClient -} From 4ac94a252389ad9a9e37a4b8888d2805d4e7a58e Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 16 Apr 2024 07:58:36 -0700 Subject: [PATCH 118/438] fixed gov v1 empty proposal messages amino signing --- .../types/protobuf/codegen/cosmos/gov/v1/tx.ts | 2 -- packages/types/protobuf/patches.diff | 14 ++++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts b/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts index 72e20f771..774bdbe5c 100644 --- a/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts +++ b/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts @@ -601,8 +601,6 @@ export const MsgSubmitProposal = { const obj: any = {}; if (message.messages.length) { obj.messages = message.messages.map(e => e ? rawProtobufMsgToAmino(e, false) : undefined); - } else { - obj.messages = []; } if (message.initialDeposit) { obj.initial_deposit = message.initialDeposit.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); diff --git a/packages/types/protobuf/patches.diff b/packages/types/protobuf/patches.diff index b135b8c65..ad95c7614 100644 --- a/packages/types/protobuf/patches.diff +++ b/packages/types/protobuf/patches.diff @@ -56,7 +56,7 @@ index 9eb780900..70b01f2fc 100644 }, fromAminoMsg(object: MetadataAminoMsg): Metadata { diff --git b/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts a/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts -index 6c5cc594d..72e20f771 100644 +index 6c5cc594d..774bdbe5c 100644 --- b/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts +++ a/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts @@ -1,7 +1,8 @@ @@ -79,18 +79,20 @@ index 6c5cc594d..72e20f771 100644 message.initialDeposit = object.initial_deposit?.map(e => Coin.fromAmino(e)) || []; if (object.proposer !== undefined && object.proposer !== null) { message.proposer = object.proposer; -@@ -598,8 +599,8 @@ export const MsgSubmitProposal = { +@@ -598,10 +599,8 @@ export const MsgSubmitProposal = { }, toAmino(message: MsgSubmitProposal, useInterfaces: boolean = false): MsgSubmitProposalAmino { const obj: any = {}; - if (message.messages) { - obj.messages = message.messages.map(e => e ? Any.toAmino(e, useInterfaces) : undefined); +- } else { +- obj.messages = []; + if (message.messages.length) { + obj.messages = message.messages.map(e => e ? rawProtobufMsgToAmino(e, false) : undefined); - } else { - obj.messages = []; } -@@ -612,7 +613,9 @@ export const MsgSubmitProposal = { + if (message.initialDeposit) { + obj.initial_deposit = message.initialDeposit.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); +@@ -612,7 +611,9 @@ export const MsgSubmitProposal = { obj.metadata = message.metadata; obj.title = message.title; obj.summary = message.summary; @@ -101,7 +103,7 @@ index 6c5cc594d..72e20f771 100644 return obj; }, fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { -@@ -911,7 +914,7 @@ export const MsgVote = { +@@ -911,7 +912,7 @@ export const MsgVote = { message.voter = object.voter; } if (object.option !== undefined && object.option !== null) { From 6b23d3247e00fea29ce6c930c2d8af9a69debce5 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 16 Apr 2024 08:53:29 -0700 Subject: [PATCH 119/438] added kujira protobufs --- .../types/protobuf/codegen/alliance/bundle.ts | 24 +- .../types/protobuf/codegen/circle/bundle.ts | 24 +- .../types/protobuf/codegen/cosmos/bundle.ts | 180 +- .../types/protobuf/codegen/cosmwasm/bundle.ts | 40 +- .../types/protobuf/codegen/gaia/bundle.ts | 24 +- packages/types/protobuf/codegen/ibc/bundle.ts | 88 +- packages/types/protobuf/codegen/index.ts | 2 + .../types/protobuf/codegen/juno/bundle.ts | 40 +- .../types/protobuf/codegen/kujira/bundle.ts | 60 + .../types/protobuf/codegen/kujira/client.ts | 50 + .../codegen/kujira/denom/authorityMetadata.ts | 98 + .../protobuf/codegen/kujira/denom/genesis.ts | 201 ++ .../protobuf/codegen/kujira/denom/params.ts | 87 + .../codegen/kujira/denom/query.rpc.Query.ts | 50 + .../protobuf/codegen/kujira/denom/query.ts | 475 +++++ .../protobuf/codegen/kujira/denom/tx.amino.ts | 23 + .../codegen/kujira/denom/tx.registry.ts | 89 + .../codegen/kujira/denom/tx.rpc.msg.ts | 45 + .../types/protobuf/codegen/kujira/denom/tx.ts | 739 +++++++ .../protobuf/codegen/kujira/oracle/genesis.ts | 388 ++++ .../protobuf/codegen/kujira/oracle/oracle.ts | 598 ++++++ .../codegen/kujira/oracle/query.rpc.Query.ts | 129 ++ .../protobuf/codegen/kujira/oracle/query.ts | 1855 +++++++++++++++++ .../codegen/kujira/oracle/tx.amino.ts | 18 + .../codegen/kujira/oracle/tx.registry.ts | 71 + .../codegen/kujira/oracle/tx.rpc.msg.ts | 42 + .../protobuf/codegen/kujira/oracle/tx.ts | 560 +++++ .../protobuf/codegen/kujira/rpc.query.ts | 58 + .../types/protobuf/codegen/kujira/rpc.tx.ts | 41 + .../codegen/kujira/scheduler/genesis.ts | 119 ++ .../protobuf/codegen/kujira/scheduler/hook.ts | 160 ++ .../codegen/kujira/scheduler/params.ts | 65 + .../codegen/kujira/scheduler/proposal.ts | 488 +++++ .../kujira/scheduler/query.rpc.Query.ts | 54 + .../codegen/kujira/scheduler/query.ts | 491 +++++ .../types/protobuf/codegen/neutron/bundle.ts | 232 +-- .../types/protobuf/codegen/noble/bundle.ts | 20 +- .../types/protobuf/codegen/osmosis/bundle.ts | 496 ++--- .../protobuf/codegen/publicawesome/bundle.ts | 132 +- .../types/protobuf/codegen/regen/bundle.ts | 204 +- .../protobuf/codegen/tendermint/bundle.ts | 40 +- .../kujira/denom/authorityMetadata.proto | 16 + .../protobuf/proto/kujira/denom/genesis.proto | 29 + .../protobuf/proto/kujira/denom/params.proto | 18 + .../protobuf/proto/kujira/denom/query.proto | 56 + .../protobuf/proto/kujira/denom/tx.proto | 83 + .../proto/kujira/oracle/genesis.proto | 34 + .../protobuf/proto/kujira/oracle/oracle.proto | 93 + .../protobuf/proto/kujira/oracle/query.proto | 204 ++ .../protobuf/proto/kujira/oracle/tx.proto | 62 + .../proto/kujira/scheduler/genesis.proto | 15 + .../proto/kujira/scheduler/hook.proto | 19 + .../proto/kujira/scheduler/params.proto | 12 + .../proto/kujira/scheduler/proposal.proto | 59 + .../proto/kujira/scheduler/query.proto | 53 + packages/types/protobuf/scripts/codegen.js | 3 + packages/types/protobuf/utils.ts | 4 + 57 files changed, 8588 insertions(+), 772 deletions(-) create mode 100644 packages/types/protobuf/codegen/kujira/bundle.ts create mode 100644 packages/types/protobuf/codegen/kujira/client.ts create mode 100644 packages/types/protobuf/codegen/kujira/denom/authorityMetadata.ts create mode 100644 packages/types/protobuf/codegen/kujira/denom/genesis.ts create mode 100644 packages/types/protobuf/codegen/kujira/denom/params.ts create mode 100644 packages/types/protobuf/codegen/kujira/denom/query.rpc.Query.ts create mode 100644 packages/types/protobuf/codegen/kujira/denom/query.ts create mode 100644 packages/types/protobuf/codegen/kujira/denom/tx.amino.ts create mode 100644 packages/types/protobuf/codegen/kujira/denom/tx.registry.ts create mode 100644 packages/types/protobuf/codegen/kujira/denom/tx.rpc.msg.ts create mode 100644 packages/types/protobuf/codegen/kujira/denom/tx.ts create mode 100644 packages/types/protobuf/codegen/kujira/oracle/genesis.ts create mode 100644 packages/types/protobuf/codegen/kujira/oracle/oracle.ts create mode 100644 packages/types/protobuf/codegen/kujira/oracle/query.rpc.Query.ts create mode 100644 packages/types/protobuf/codegen/kujira/oracle/query.ts create mode 100644 packages/types/protobuf/codegen/kujira/oracle/tx.amino.ts create mode 100644 packages/types/protobuf/codegen/kujira/oracle/tx.registry.ts create mode 100644 packages/types/protobuf/codegen/kujira/oracle/tx.rpc.msg.ts create mode 100644 packages/types/protobuf/codegen/kujira/oracle/tx.ts create mode 100644 packages/types/protobuf/codegen/kujira/rpc.query.ts create mode 100644 packages/types/protobuf/codegen/kujira/rpc.tx.ts create mode 100644 packages/types/protobuf/codegen/kujira/scheduler/genesis.ts create mode 100644 packages/types/protobuf/codegen/kujira/scheduler/hook.ts create mode 100644 packages/types/protobuf/codegen/kujira/scheduler/params.ts create mode 100644 packages/types/protobuf/codegen/kujira/scheduler/proposal.ts create mode 100644 packages/types/protobuf/codegen/kujira/scheduler/query.rpc.Query.ts create mode 100644 packages/types/protobuf/codegen/kujira/scheduler/query.ts create mode 100644 packages/types/protobuf/proto/kujira/denom/authorityMetadata.proto create mode 100644 packages/types/protobuf/proto/kujira/denom/genesis.proto create mode 100644 packages/types/protobuf/proto/kujira/denom/params.proto create mode 100644 packages/types/protobuf/proto/kujira/denom/query.proto create mode 100644 packages/types/protobuf/proto/kujira/denom/tx.proto create mode 100644 packages/types/protobuf/proto/kujira/oracle/genesis.proto create mode 100644 packages/types/protobuf/proto/kujira/oracle/oracle.proto create mode 100644 packages/types/protobuf/proto/kujira/oracle/query.proto create mode 100644 packages/types/protobuf/proto/kujira/oracle/tx.proto create mode 100644 packages/types/protobuf/proto/kujira/scheduler/genesis.proto create mode 100644 packages/types/protobuf/proto/kujira/scheduler/hook.proto create mode 100644 packages/types/protobuf/proto/kujira/scheduler/params.proto create mode 100644 packages/types/protobuf/proto/kujira/scheduler/proposal.proto create mode 100644 packages/types/protobuf/proto/kujira/scheduler/query.proto diff --git a/packages/types/protobuf/codegen/alliance/bundle.ts b/packages/types/protobuf/codegen/alliance/bundle.ts index c44a20265..0635ab8ee 100644 --- a/packages/types/protobuf/codegen/alliance/bundle.ts +++ b/packages/types/protobuf/codegen/alliance/bundle.ts @@ -8,12 +8,12 @@ import * as _6 from "./alliance/query"; import * as _7 from "./alliance/redelegations"; import * as _8 from "./alliance/tx"; import * as _9 from "./alliance/unbonding"; -import * as _306 from "./alliance/tx.amino"; -import * as _307 from "./alliance/tx.registry"; -import * as _308 from "./alliance/query.rpc.Query"; -import * as _309 from "./alliance/tx.rpc.msg"; -import * as _508 from "./rpc.query"; -import * as _509 from "./rpc.tx"; +import * as _320 from "./alliance/tx.amino"; +import * as _321 from "./alliance/tx.registry"; +import * as _322 from "./alliance/query.rpc.Query"; +import * as _323 from "./alliance/tx.rpc.msg"; +import * as _531 from "./rpc.query"; +import * as _532 from "./rpc.tx"; export namespace alliance { export const alliance = { ..._0, @@ -26,13 +26,13 @@ export namespace alliance { ..._7, ..._8, ..._9, - ..._306, - ..._307, - ..._308, - ..._309 + ..._320, + ..._321, + ..._322, + ..._323 }; export const ClientFactory = { - ..._508, - ..._509 + ..._531, + ..._532 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/circle/bundle.ts b/packages/types/protobuf/codegen/circle/bundle.ts index 731406816..798e94eeb 100644 --- a/packages/types/protobuf/codegen/circle/bundle.ts +++ b/packages/types/protobuf/codegen/circle/bundle.ts @@ -14,12 +14,12 @@ import * as _23 from "./cctp/v1/sending_and_receiving_messages_paused"; import * as _24 from "./cctp/v1/signature_threshold"; import * as _25 from "./cctp/v1/token_pair"; import * as _26 from "./cctp/v1/tx"; -import * as _310 from "./cctp/v1/tx.amino"; -import * as _311 from "./cctp/v1/tx.registry"; -import * as _312 from "./cctp/v1/query.rpc.Query"; -import * as _313 from "./cctp/v1/tx.rpc.msg"; -import * as _510 from "./rpc.query"; -import * as _511 from "./rpc.tx"; +import * as _324 from "./cctp/v1/tx.amino"; +import * as _325 from "./cctp/v1/tx.registry"; +import * as _326 from "./cctp/v1/query.rpc.Query"; +import * as _327 from "./cctp/v1/tx.rpc.msg"; +import * as _533 from "./rpc.query"; +import * as _534 from "./rpc.tx"; export namespace circle { export namespace cctp { export const v1 = { @@ -39,14 +39,14 @@ export namespace circle { ..._24, ..._25, ..._26, - ..._310, - ..._311, - ..._312, - ..._313 + ..._324, + ..._325, + ..._326, + ..._327 }; } export const ClientFactory = { - ..._510, - ..._511 + ..._533, + ..._534 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/bundle.ts b/packages/types/protobuf/codegen/cosmos/bundle.ts index 8f023f183..f8c100a75 100644 --- a/packages/types/protobuf/codegen/cosmos/bundle.ts +++ b/packages/types/protobuf/codegen/cosmos/bundle.ts @@ -56,51 +56,51 @@ import * as _82 from "./tx/v1beta1/tx"; import * as _83 from "./upgrade/v1beta1/query"; import * as _84 from "./upgrade/v1beta1/tx"; import * as _85 from "./upgrade/v1beta1/upgrade"; -import * as _314 from "./auth/v1beta1/tx.amino"; -import * as _315 from "./authz/v1beta1/tx.amino"; -import * as _316 from "./bank/v1beta1/tx.amino"; -import * as _317 from "./distribution/v1beta1/tx.amino"; -import * as _318 from "./gov/v1/tx.amino"; -import * as _319 from "./gov/v1beta1/tx.amino"; -import * as _320 from "./mint/v1beta1/tx.amino"; -import * as _321 from "./slashing/v1beta1/tx.amino"; -import * as _322 from "./staking/v1beta1/tx.amino"; -import * as _323 from "./upgrade/v1beta1/tx.amino"; -import * as _324 from "./auth/v1beta1/tx.registry"; -import * as _325 from "./authz/v1beta1/tx.registry"; -import * as _326 from "./bank/v1beta1/tx.registry"; -import * as _327 from "./distribution/v1beta1/tx.registry"; -import * as _328 from "./gov/v1/tx.registry"; -import * as _329 from "./gov/v1beta1/tx.registry"; -import * as _330 from "./mint/v1beta1/tx.registry"; -import * as _331 from "./slashing/v1beta1/tx.registry"; -import * as _332 from "./staking/v1beta1/tx.registry"; -import * as _333 from "./upgrade/v1beta1/tx.registry"; -import * as _334 from "./auth/v1beta1/query.rpc.Query"; -import * as _335 from "./authz/v1beta1/query.rpc.Query"; -import * as _336 from "./bank/v1beta1/query.rpc.Query"; -import * as _337 from "./base/tendermint/v1beta1/query.rpc.Service"; -import * as _338 from "./distribution/v1beta1/query.rpc.Query"; -import * as _339 from "./gov/v1/query.rpc.Query"; -import * as _340 from "./gov/v1beta1/query.rpc.Query"; -import * as _341 from "./mint/v1beta1/query.rpc.Query"; -import * as _342 from "./params/v1beta1/query.rpc.Query"; -import * as _343 from "./slashing/v1beta1/query.rpc.Query"; -import * as _344 from "./staking/v1beta1/query.rpc.Query"; -import * as _345 from "./tx/v1beta1/service.rpc.Service"; -import * as _346 from "./upgrade/v1beta1/query.rpc.Query"; -import * as _347 from "./auth/v1beta1/tx.rpc.msg"; -import * as _348 from "./authz/v1beta1/tx.rpc.msg"; -import * as _349 from "./bank/v1beta1/tx.rpc.msg"; -import * as _350 from "./distribution/v1beta1/tx.rpc.msg"; -import * as _351 from "./gov/v1/tx.rpc.msg"; -import * as _352 from "./gov/v1beta1/tx.rpc.msg"; -import * as _353 from "./mint/v1beta1/tx.rpc.msg"; -import * as _354 from "./slashing/v1beta1/tx.rpc.msg"; -import * as _355 from "./staking/v1beta1/tx.rpc.msg"; -import * as _356 from "./upgrade/v1beta1/tx.rpc.msg"; -import * as _512 from "./rpc.query"; -import * as _513 from "./rpc.tx"; +import * as _328 from "./auth/v1beta1/tx.amino"; +import * as _329 from "./authz/v1beta1/tx.amino"; +import * as _330 from "./bank/v1beta1/tx.amino"; +import * as _331 from "./distribution/v1beta1/tx.amino"; +import * as _332 from "./gov/v1/tx.amino"; +import * as _333 from "./gov/v1beta1/tx.amino"; +import * as _334 from "./mint/v1beta1/tx.amino"; +import * as _335 from "./slashing/v1beta1/tx.amino"; +import * as _336 from "./staking/v1beta1/tx.amino"; +import * as _337 from "./upgrade/v1beta1/tx.amino"; +import * as _338 from "./auth/v1beta1/tx.registry"; +import * as _339 from "./authz/v1beta1/tx.registry"; +import * as _340 from "./bank/v1beta1/tx.registry"; +import * as _341 from "./distribution/v1beta1/tx.registry"; +import * as _342 from "./gov/v1/tx.registry"; +import * as _343 from "./gov/v1beta1/tx.registry"; +import * as _344 from "./mint/v1beta1/tx.registry"; +import * as _345 from "./slashing/v1beta1/tx.registry"; +import * as _346 from "./staking/v1beta1/tx.registry"; +import * as _347 from "./upgrade/v1beta1/tx.registry"; +import * as _348 from "./auth/v1beta1/query.rpc.Query"; +import * as _349 from "./authz/v1beta1/query.rpc.Query"; +import * as _350 from "./bank/v1beta1/query.rpc.Query"; +import * as _351 from "./base/tendermint/v1beta1/query.rpc.Service"; +import * as _352 from "./distribution/v1beta1/query.rpc.Query"; +import * as _353 from "./gov/v1/query.rpc.Query"; +import * as _354 from "./gov/v1beta1/query.rpc.Query"; +import * as _355 from "./mint/v1beta1/query.rpc.Query"; +import * as _356 from "./params/v1beta1/query.rpc.Query"; +import * as _357 from "./slashing/v1beta1/query.rpc.Query"; +import * as _358 from "./staking/v1beta1/query.rpc.Query"; +import * as _359 from "./tx/v1beta1/service.rpc.Service"; +import * as _360 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _361 from "./auth/v1beta1/tx.rpc.msg"; +import * as _362 from "./authz/v1beta1/tx.rpc.msg"; +import * as _363 from "./bank/v1beta1/tx.rpc.msg"; +import * as _364 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _365 from "./gov/v1/tx.rpc.msg"; +import * as _366 from "./gov/v1beta1/tx.rpc.msg"; +import * as _367 from "./mint/v1beta1/tx.rpc.msg"; +import * as _368 from "./slashing/v1beta1/tx.rpc.msg"; +import * as _369 from "./staking/v1beta1/tx.rpc.msg"; +import * as _370 from "./upgrade/v1beta1/tx.rpc.msg"; +import * as _535 from "./rpc.query"; +import * as _536 from "./rpc.tx"; export namespace cosmos { export namespace auth { export const v1beta1 = { @@ -108,10 +108,10 @@ export namespace cosmos { ..._29, ..._30, ..._31, - ..._314, - ..._324, - ..._334, - ..._347 + ..._328, + ..._338, + ..._348, + ..._361 }; } export namespace authz { @@ -121,10 +121,10 @@ export namespace cosmos { ..._34, ..._35, ..._36, - ..._315, - ..._325, - ..._335, - ..._348 + ..._329, + ..._339, + ..._349, + ..._362 }; } export namespace bank { @@ -134,10 +134,10 @@ export namespace cosmos { ..._39, ..._40, ..._41, - ..._316, - ..._326, - ..._336, - ..._349 + ..._330, + ..._340, + ..._350, + ..._363 }; } export namespace base { @@ -155,7 +155,7 @@ export namespace cosmos { export const v1beta1 = { ..._44, ..._45, - ..._337 + ..._351 }; } export const v1beta1 = { @@ -179,10 +179,10 @@ export namespace cosmos { ..._51, ..._52, ..._53, - ..._317, - ..._327, - ..._338, - ..._350 + ..._331, + ..._341, + ..._352, + ..._364 }; } export namespace gov { @@ -191,20 +191,20 @@ export namespace cosmos { ..._55, ..._56, ..._57, - ..._318, - ..._328, - ..._339, - ..._351 + ..._332, + ..._342, + ..._353, + ..._365 }; export const v1beta1 = { ..._58, ..._59, ..._60, ..._61, - ..._319, - ..._329, - ..._340, - ..._352 + ..._333, + ..._343, + ..._354, + ..._366 }; } export namespace mint { @@ -213,10 +213,10 @@ export namespace cosmos { ..._63, ..._64, ..._65, - ..._320, - ..._330, - ..._341, - ..._353 + ..._334, + ..._344, + ..._355, + ..._367 }; } export namespace msg { @@ -233,7 +233,7 @@ export namespace cosmos { export const v1beta1 = { ..._68, ..._69, - ..._342 + ..._356 }; } export namespace query { @@ -247,10 +247,10 @@ export namespace cosmos { ..._72, ..._73, ..._74, - ..._321, - ..._331, - ..._343, - ..._354 + ..._335, + ..._345, + ..._357, + ..._368 }; } export namespace staking { @@ -260,10 +260,10 @@ export namespace cosmos { ..._77, ..._78, ..._79, - ..._322, - ..._332, - ..._344, - ..._355 + ..._336, + ..._346, + ..._358, + ..._369 }; } export namespace tx { @@ -275,7 +275,7 @@ export namespace cosmos { export const v1beta1 = { ..._81, ..._82, - ..._345 + ..._359 }; } export namespace upgrade { @@ -283,14 +283,14 @@ export namespace cosmos { ..._83, ..._84, ..._85, - ..._323, - ..._333, - ..._346, - ..._356 + ..._337, + ..._347, + ..._360, + ..._370 }; } export const ClientFactory = { - ..._512, - ..._513 + ..._535, + ..._536 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmwasm/bundle.ts b/packages/types/protobuf/codegen/cosmwasm/bundle.ts index f0b52ac89..0bd296e72 100644 --- a/packages/types/protobuf/codegen/cosmwasm/bundle.ts +++ b/packages/types/protobuf/codegen/cosmwasm/bundle.ts @@ -10,16 +10,16 @@ import * as _94 from "./wasm/v1/proposal"; import * as _95 from "./wasm/v1/query"; import * as _96 from "./wasm/v1/tx"; import * as _97 from "./wasm/v1/types"; -import * as _357 from "./tokenfactory/v1beta1/tx.amino"; -import * as _358 from "./wasm/v1/tx.amino"; -import * as _359 from "./tokenfactory/v1beta1/tx.registry"; -import * as _360 from "./wasm/v1/tx.registry"; -import * as _361 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _362 from "./wasm/v1/query.rpc.Query"; -import * as _363 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _364 from "./wasm/v1/tx.rpc.msg"; -import * as _514 from "./rpc.query"; -import * as _515 from "./rpc.tx"; +import * as _371 from "./tokenfactory/v1beta1/tx.amino"; +import * as _372 from "./wasm/v1/tx.amino"; +import * as _373 from "./tokenfactory/v1beta1/tx.registry"; +import * as _374 from "./wasm/v1/tx.registry"; +import * as _375 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _376 from "./wasm/v1/query.rpc.Query"; +import * as _377 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _378 from "./wasm/v1/tx.rpc.msg"; +import * as _537 from "./rpc.query"; +import * as _538 from "./rpc.tx"; export namespace cosmwasm { export namespace tokenfactory { export const v1beta1 = { @@ -28,10 +28,10 @@ export namespace cosmwasm { ..._88, ..._89, ..._90, - ..._357, - ..._359, - ..._361, - ..._363 + ..._371, + ..._373, + ..._375, + ..._377 }; } export namespace wasm { @@ -43,14 +43,14 @@ export namespace cosmwasm { ..._95, ..._96, ..._97, - ..._358, - ..._360, - ..._362, - ..._364 + ..._372, + ..._374, + ..._376, + ..._378 }; } export const ClientFactory = { - ..._514, - ..._515 + ..._537, + ..._538 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/gaia/bundle.ts b/packages/types/protobuf/codegen/gaia/bundle.ts index 6d636d27d..a0ac08794 100644 --- a/packages/types/protobuf/codegen/gaia/bundle.ts +++ b/packages/types/protobuf/codegen/gaia/bundle.ts @@ -1,26 +1,26 @@ import * as _98 from "./globalfee/v1beta1/genesis"; import * as _99 from "./globalfee/v1beta1/query"; import * as _100 from "./globalfee/v1beta1/tx"; -import * as _365 from "./globalfee/v1beta1/tx.amino"; -import * as _366 from "./globalfee/v1beta1/tx.registry"; -import * as _367 from "./globalfee/v1beta1/query.rpc.Query"; -import * as _368 from "./globalfee/v1beta1/tx.rpc.msg"; -import * as _516 from "./rpc.query"; -import * as _517 from "./rpc.tx"; +import * as _379 from "./globalfee/v1beta1/tx.amino"; +import * as _380 from "./globalfee/v1beta1/tx.registry"; +import * as _381 from "./globalfee/v1beta1/query.rpc.Query"; +import * as _382 from "./globalfee/v1beta1/tx.rpc.msg"; +import * as _539 from "./rpc.query"; +import * as _540 from "./rpc.tx"; export namespace gaia { export namespace globalfee { export const v1beta1 = { ..._98, ..._99, ..._100, - ..._365, - ..._366, - ..._367, - ..._368 + ..._379, + ..._380, + ..._381, + ..._382 }; } export const ClientFactory = { - ..._516, - ..._517 + ..._539, + ..._540 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/bundle.ts b/packages/types/protobuf/codegen/ibc/bundle.ts index ca2724d18..0d49a3be6 100644 --- a/packages/types/protobuf/codegen/ibc/bundle.ts +++ b/packages/types/protobuf/codegen/ibc/bundle.ts @@ -20,28 +20,28 @@ import * as _127 from "./core/client/v1/client"; import * as _128 from "./core/client/v1/genesis"; import * as _129 from "./core/client/v1/query"; import * as _130 from "./core/client/v1/tx"; -import * as _369 from "./applications/interchain_accounts/controller/v1/tx.amino"; -import * as _370 from "./applications/interchain_accounts/host/v1/tx.amino"; -import * as _371 from "./applications/transfer/v1/tx.amino"; -import * as _372 from "./core/channel/v1/tx.amino"; -import * as _373 from "./core/client/v1/tx.amino"; -import * as _374 from "./applications/interchain_accounts/controller/v1/tx.registry"; -import * as _375 from "./applications/interchain_accounts/host/v1/tx.registry"; -import * as _376 from "./applications/transfer/v1/tx.registry"; -import * as _377 from "./core/channel/v1/tx.registry"; -import * as _378 from "./core/client/v1/tx.registry"; -import * as _379 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; -import * as _380 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; -import * as _381 from "./applications/transfer/v1/query.rpc.Query"; -import * as _382 from "./core/channel/v1/query.rpc.Query"; -import * as _383 from "./core/client/v1/query.rpc.Query"; -import * as _384 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; -import * as _385 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; -import * as _386 from "./applications/transfer/v1/tx.rpc.msg"; -import * as _387 from "./core/channel/v1/tx.rpc.msg"; -import * as _388 from "./core/client/v1/tx.rpc.msg"; -import * as _518 from "./rpc.query"; -import * as _519 from "./rpc.tx"; +import * as _383 from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as _384 from "./applications/interchain_accounts/host/v1/tx.amino"; +import * as _385 from "./applications/transfer/v1/tx.amino"; +import * as _386 from "./core/channel/v1/tx.amino"; +import * as _387 from "./core/client/v1/tx.amino"; +import * as _388 from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as _389 from "./applications/interchain_accounts/host/v1/tx.registry"; +import * as _390 from "./applications/transfer/v1/tx.registry"; +import * as _391 from "./core/channel/v1/tx.registry"; +import * as _392 from "./core/client/v1/tx.registry"; +import * as _393 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; +import * as _394 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; +import * as _395 from "./applications/transfer/v1/query.rpc.Query"; +import * as _396 from "./core/channel/v1/query.rpc.Query"; +import * as _397 from "./core/client/v1/query.rpc.Query"; +import * as _398 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; +import * as _399 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; +import * as _400 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _401 from "./core/channel/v1/tx.rpc.msg"; +import * as _402 from "./core/client/v1/tx.rpc.msg"; +import * as _541 from "./rpc.query"; +import * as _542 from "./rpc.tx"; export namespace ibc { export namespace applications { export namespace interchain_accounts { @@ -50,10 +50,10 @@ export namespace ibc { ..._109, ..._110, ..._111, - ..._369, - ..._374, - ..._379, - ..._384 + ..._383, + ..._388, + ..._393, + ..._398 }; } export namespace host { @@ -61,10 +61,10 @@ export namespace ibc { ..._112, ..._113, ..._114, - ..._370, - ..._375, - ..._380, - ..._385 + ..._384, + ..._389, + ..._394, + ..._399 }; } export const v1 = { @@ -80,10 +80,10 @@ export namespace ibc { ..._120, ..._121, ..._122, - ..._371, - ..._376, - ..._381, - ..._386 + ..._385, + ..._390, + ..._395, + ..._400 }; } } @@ -94,10 +94,10 @@ export namespace ibc { ..._124, ..._125, ..._126, - ..._372, - ..._377, - ..._382, - ..._387 + ..._386, + ..._391, + ..._396, + ..._401 }; } export namespace client { @@ -106,15 +106,15 @@ export namespace ibc { ..._128, ..._129, ..._130, - ..._373, - ..._378, - ..._383, - ..._388 + ..._387, + ..._392, + ..._397, + ..._402 }; } } export const ClientFactory = { - ..._518, - ..._519 + ..._541, + ..._542 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/index.ts b/packages/types/protobuf/codegen/index.ts index 946a6da41..246c1f215 100644 --- a/packages/types/protobuf/codegen/index.ts +++ b/packages/types/protobuf/codegen/index.ts @@ -22,6 +22,8 @@ export * from "./ibc/bundle"; export * from "./ibc/client"; export * from "./juno/bundle"; export * from "./juno/client"; +export * from "./kujira/bundle"; +export * from "./kujira/client"; export * from "./neutron/bundle"; export * from "./neutron/client"; export * from "./osmosis/bundle"; diff --git a/packages/types/protobuf/codegen/juno/bundle.ts b/packages/types/protobuf/codegen/juno/bundle.ts index 130b216e5..5fca0bbba 100644 --- a/packages/types/protobuf/codegen/juno/bundle.ts +++ b/packages/types/protobuf/codegen/juno/bundle.ts @@ -6,16 +6,16 @@ import * as _135 from "./mint/genesis"; import * as _136 from "./mint/mint"; import * as _137 from "./mint/query"; import * as _138 from "./mint/tx"; -import * as _389 from "./feeshare/v1/tx.amino"; -import * as _390 from "./mint/tx.amino"; -import * as _391 from "./feeshare/v1/tx.registry"; -import * as _392 from "./mint/tx.registry"; -import * as _393 from "./feeshare/v1/query.rpc.Query"; -import * as _394 from "./mint/query.rpc.Query"; -import * as _395 from "./feeshare/v1/tx.rpc.msg"; -import * as _396 from "./mint/tx.rpc.msg"; -import * as _520 from "./rpc.query"; -import * as _521 from "./rpc.tx"; +import * as _403 from "./feeshare/v1/tx.amino"; +import * as _404 from "./mint/tx.amino"; +import * as _405 from "./feeshare/v1/tx.registry"; +import * as _406 from "./mint/tx.registry"; +import * as _407 from "./feeshare/v1/query.rpc.Query"; +import * as _408 from "./mint/query.rpc.Query"; +import * as _409 from "./feeshare/v1/tx.rpc.msg"; +import * as _410 from "./mint/tx.rpc.msg"; +import * as _543 from "./rpc.query"; +import * as _544 from "./rpc.tx"; export namespace juno { export namespace feeshare { export const v1 = { @@ -23,10 +23,10 @@ export namespace juno { ..._132, ..._133, ..._134, - ..._389, - ..._391, - ..._393, - ..._395 + ..._403, + ..._405, + ..._407, + ..._409 }; } export const mint = { @@ -34,13 +34,13 @@ export namespace juno { ..._136, ..._137, ..._138, - ..._390, - ..._392, - ..._394, - ..._396 + ..._404, + ..._406, + ..._408, + ..._410 }; export const ClientFactory = { - ..._520, - ..._521 + ..._543, + ..._544 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/bundle.ts b/packages/types/protobuf/codegen/kujira/bundle.ts new file mode 100644 index 000000000..288dad325 --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/bundle.ts @@ -0,0 +1,60 @@ +import * as _139 from "./denom/authorityMetadata"; +import * as _140 from "./denom/genesis"; +import * as _141 from "./denom/params"; +import * as _142 from "./denom/query"; +import * as _143 from "./denom/tx"; +import * as _144 from "./oracle/genesis"; +import * as _145 from "./oracle/oracle"; +import * as _146 from "./oracle/query"; +import * as _147 from "./oracle/tx"; +import * as _148 from "./scheduler/genesis"; +import * as _149 from "./scheduler/hook"; +import * as _150 from "./scheduler/params"; +import * as _151 from "./scheduler/proposal"; +import * as _152 from "./scheduler/query"; +import * as _411 from "./denom/tx.amino"; +import * as _412 from "./oracle/tx.amino"; +import * as _413 from "./denom/tx.registry"; +import * as _414 from "./oracle/tx.registry"; +import * as _415 from "./denom/query.rpc.Query"; +import * as _416 from "./oracle/query.rpc.Query"; +import * as _417 from "./scheduler/query.rpc.Query"; +import * as _418 from "./denom/tx.rpc.msg"; +import * as _419 from "./oracle/tx.rpc.msg"; +import * as _545 from "./rpc.query"; +import * as _546 from "./rpc.tx"; +export namespace kujira { + export const denom = { + ..._139, + ..._140, + ..._141, + ..._142, + ..._143, + ..._411, + ..._413, + ..._415, + ..._418 + }; + export const oracle = { + ..._144, + ..._145, + ..._146, + ..._147, + ..._412, + ..._414, + ..._416, + ..._419 + }; + export const scheduler = { + ..._148, + ..._149, + ..._150, + ..._151, + ..._152, + ..._417 + }; + export const ClientFactory = { + ..._545, + ..._546 + }; +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/client.ts b/packages/types/protobuf/codegen/kujira/client.ts new file mode 100644 index 000000000..5d4b9c6e2 --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/client.ts @@ -0,0 +1,50 @@ +import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; +import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; +import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as kujiraDenomTxRegistry from "./denom/tx.registry"; +import * as kujiraOracleTxRegistry from "./oracle/tx.registry"; +import * as kujiraDenomTxAmino from "./denom/tx.amino"; +import * as kujiraOracleTxAmino from "./oracle/tx.amino"; +export const kujiraAminoConverters = { + ...kujiraDenomTxAmino.AminoConverter, + ...kujiraOracleTxAmino.AminoConverter +}; +export const kujiraProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...kujiraDenomTxRegistry.registry, ...kujiraOracleTxRegistry.registry]; +export const getSigningKujiraClientOptions = ({ + defaultTypes = defaultRegistryTypes +}: { + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +} = {}): { + registry: Registry; + aminoTypes: AminoTypes; +} => { + const registry = new Registry([...defaultTypes, ...kujiraProtoRegistry]); + const aminoTypes = new AminoTypes({ + ...kujiraAminoConverters + }); + return { + registry, + aminoTypes + }; +}; +export const getSigningKujiraClient = async ({ + rpcEndpoint, + signer, + defaultTypes = defaultRegistryTypes +}: { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +}) => { + const { + registry, + aminoTypes + } = getSigningKujiraClientOptions({ + defaultTypes + }); + const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { + registry: (registry as any), + aminoTypes + }); + return client; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/denom/authorityMetadata.ts b/packages/types/protobuf/codegen/kujira/denom/authorityMetadata.ts new file mode 100644 index 000000000..aa56c4847 --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/denom/authorityMetadata.ts @@ -0,0 +1,98 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * DenomAuthorityMetadata specifies metadata for addresses that have specific + * capabilities over a token factory denom. Right now there is only one Admin + * permission, but is planned to be extended to the future. + */ +export interface DenomAuthorityMetadata { + /** Can be empty for no admin, or a valid kujira address */ + Admin: string; +} +export interface DenomAuthorityMetadataProtoMsg { + typeUrl: "/kujira.denom.DenomAuthorityMetadata"; + value: Uint8Array; +} +/** + * DenomAuthorityMetadata specifies metadata for addresses that have specific + * capabilities over a token factory denom. Right now there is only one Admin + * permission, but is planned to be extended to the future. + */ +export interface DenomAuthorityMetadataAmino { + /** Can be empty for no admin, or a valid kujira address */ + Admin?: string; +} +export interface DenomAuthorityMetadataAminoMsg { + type: "/kujira.denom.DenomAuthorityMetadata"; + value: DenomAuthorityMetadataAmino; +} +/** + * DenomAuthorityMetadata specifies metadata for addresses that have specific + * capabilities over a token factory denom. Right now there is only one Admin + * permission, but is planned to be extended to the future. + */ +export interface DenomAuthorityMetadataSDKType { + Admin: string; +} +function createBaseDenomAuthorityMetadata(): DenomAuthorityMetadata { + return { + Admin: "" + }; +} +export const DenomAuthorityMetadata = { + typeUrl: "/kujira.denom.DenomAuthorityMetadata", + encode(message: DenomAuthorityMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.Admin !== "") { + writer.uint32(10).string(message.Admin); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): DenomAuthorityMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomAuthorityMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.Admin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DenomAuthorityMetadata { + const message = createBaseDenomAuthorityMetadata(); + message.Admin = object.Admin ?? ""; + return message; + }, + fromAmino(object: DenomAuthorityMetadataAmino): DenomAuthorityMetadata { + const message = createBaseDenomAuthorityMetadata(); + if (object.Admin !== undefined && object.Admin !== null) { + message.Admin = object.Admin; + } + return message; + }, + toAmino(message: DenomAuthorityMetadata, useInterfaces: boolean = false): DenomAuthorityMetadataAmino { + const obj: any = {}; + obj.Admin = message.Admin; + return obj; + }, + fromAminoMsg(object: DenomAuthorityMetadataAminoMsg): DenomAuthorityMetadata { + return DenomAuthorityMetadata.fromAmino(object.value); + }, + fromProtoMsg(message: DenomAuthorityMetadataProtoMsg, useInterfaces: boolean = false): DenomAuthorityMetadata { + return DenomAuthorityMetadata.decode(message.value, undefined, useInterfaces); + }, + toProto(message: DenomAuthorityMetadata): Uint8Array { + return DenomAuthorityMetadata.encode(message).finish(); + }, + toProtoMsg(message: DenomAuthorityMetadata): DenomAuthorityMetadataProtoMsg { + return { + typeUrl: "/kujira.denom.DenomAuthorityMetadata", + value: DenomAuthorityMetadata.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/denom/genesis.ts b/packages/types/protobuf/codegen/kujira/denom/genesis.ts new file mode 100644 index 000000000..3f866d8d1 --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/denom/genesis.ts @@ -0,0 +1,201 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { DenomAuthorityMetadata, DenomAuthorityMetadataAmino, DenomAuthorityMetadataSDKType } from "./authorityMetadata"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines the denom module's genesis state. */ +export interface GenesisState { + /** params defines the paramaters of the module. */ + params: Params | undefined; + factoryDenoms: GenesisDenom[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/kujira.denom.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the denom module's genesis state. */ +export interface GenesisStateAmino { + /** params defines the paramaters of the module. */ + params?: ParamsAmino | undefined; + factory_denoms?: GenesisDenomAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/kujira.denom.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the denom module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType | undefined; + factory_denoms: GenesisDenomSDKType[]; +} +export interface GenesisDenom { + denom: string; + authorityMetadata: DenomAuthorityMetadata | undefined; +} +export interface GenesisDenomProtoMsg { + typeUrl: "/kujira.denom.GenesisDenom"; + value: Uint8Array; +} +export interface GenesisDenomAmino { + denom?: string; + authority_metadata?: DenomAuthorityMetadataAmino | undefined; +} +export interface GenesisDenomAminoMsg { + type: "/kujira.denom.GenesisDenom"; + value: GenesisDenomAmino; +} +export interface GenesisDenomSDKType { + denom: string; + authority_metadata: DenomAuthorityMetadataSDKType | undefined; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + factoryDenoms: [] + }; +} +export const GenesisState = { + typeUrl: "/kujira.denom.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.factoryDenoms) { + GenesisDenom.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.factoryDenoms.push(GenesisDenom.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.factoryDenoms = object.factoryDenoms?.map(e => GenesisDenom.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.factoryDenoms = object.factory_denoms?.map(e => GenesisDenom.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState, useInterfaces: boolean = false): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + if (message.factoryDenoms) { + obj.factory_denoms = message.factoryDenoms.map(e => e ? GenesisDenom.toAmino(e, useInterfaces) : undefined); + } else { + obj.factory_denoms = []; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg, useInterfaces: boolean = false): GenesisState { + return GenesisState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/kujira.denom.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +function createBaseGenesisDenom(): GenesisDenom { + return { + denom: "", + authorityMetadata: DenomAuthorityMetadata.fromPartial({}) + }; +} +export const GenesisDenom = { + typeUrl: "/kujira.denom.GenesisDenom", + encode(message: GenesisDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.authorityMetadata !== undefined) { + DenomAuthorityMetadata.encode(message.authorityMetadata, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisDenom(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.authorityMetadata = DenomAuthorityMetadata.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisDenom { + const message = createBaseGenesisDenom(); + message.denom = object.denom ?? ""; + message.authorityMetadata = object.authorityMetadata !== undefined && object.authorityMetadata !== null ? DenomAuthorityMetadata.fromPartial(object.authorityMetadata) : undefined; + return message; + }, + fromAmino(object: GenesisDenomAmino): GenesisDenom { + const message = createBaseGenesisDenom(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.authority_metadata !== undefined && object.authority_metadata !== null) { + message.authorityMetadata = DenomAuthorityMetadata.fromAmino(object.authority_metadata); + } + return message; + }, + toAmino(message: GenesisDenom, useInterfaces: boolean = false): GenesisDenomAmino { + const obj: any = {}; + obj.denom = message.denom; + obj.authority_metadata = message.authorityMetadata ? DenomAuthorityMetadata.toAmino(message.authorityMetadata, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisDenomAminoMsg): GenesisDenom { + return GenesisDenom.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisDenomProtoMsg, useInterfaces: boolean = false): GenesisDenom { + return GenesisDenom.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisDenom): Uint8Array { + return GenesisDenom.encode(message).finish(); + }, + toProtoMsg(message: GenesisDenom): GenesisDenomProtoMsg { + return { + typeUrl: "/kujira.denom.GenesisDenom", + value: GenesisDenom.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/denom/params.ts b/packages/types/protobuf/codegen/kujira/denom/params.ts new file mode 100644 index 000000000..1d4db470a --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/denom/params.ts @@ -0,0 +1,87 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** Params holds parameters for the denom module */ +export interface Params { + creationFee: Coin[]; +} +export interface ParamsProtoMsg { + typeUrl: "/kujira.denom.Params"; + value: Uint8Array; +} +/** Params holds parameters for the denom module */ +export interface ParamsAmino { + creation_fee?: CoinAmino[]; +} +export interface ParamsAminoMsg { + type: "/kujira.denom.Params"; + value: ParamsAmino; +} +/** Params holds parameters for the denom module */ +export interface ParamsSDKType { + creation_fee: CoinSDKType[]; +} +function createBaseParams(): Params { + return { + creationFee: [] + }; +} +export const Params = { + typeUrl: "/kujira.denom.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.creationFee) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creationFee.push(Coin.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.creationFee = object.creationFee?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.creationFee = object.creation_fee?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Params, useInterfaces: boolean = false): ParamsAmino { + const obj: any = {}; + if (message.creationFee) { + obj.creation_fee = message.creationFee.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); + } else { + obj.creation_fee = []; + } + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsProtoMsg, useInterfaces: boolean = false): Params { + return Params.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/kujira.denom.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/denom/query.rpc.Query.ts b/packages/types/protobuf/codegen/kujira/denom/query.rpc.Query.ts new file mode 100644 index 000000000..4bf51b64e --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/denom/query.rpc.Query.ts @@ -0,0 +1,50 @@ +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryParamsRequest, QueryParamsResponse, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponse, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Params returns the total set of minting parameters. */ + params(request?: QueryParamsRequest): Promise; + denomAuthorityMetadata(request: QueryDenomAuthorityMetadataRequest): Promise; + denomsFromCreator(request: QueryDenomsFromCreatorRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + this.denomAuthorityMetadata = this.denomAuthorityMetadata.bind(this); + this.denomsFromCreator = this.denomsFromCreator.bind(this); + } + params(request: QueryParamsRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("kujira.denom.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + denomAuthorityMetadata(request: QueryDenomAuthorityMetadataRequest, useInterfaces: boolean = true): Promise { + const data = QueryDenomAuthorityMetadataRequest.encode(request).finish(); + const promise = this.rpc.request("kujira.denom.Query", "DenomAuthorityMetadata", data); + return promise.then(data => QueryDenomAuthorityMetadataResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + denomsFromCreator(request: QueryDenomsFromCreatorRequest, useInterfaces: boolean = true): Promise { + const data = QueryDenomsFromCreatorRequest.encode(request).finish(); + const promise = this.rpc.request("kujira.denom.Query", "DenomsFromCreator", data); + return promise.then(data => QueryDenomsFromCreatorResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest, useInterfaces: boolean = true): Promise { + return queryService.params(request, useInterfaces); + }, + denomAuthorityMetadata(request: QueryDenomAuthorityMetadataRequest, useInterfaces: boolean = true): Promise { + return queryService.denomAuthorityMetadata(request, useInterfaces); + }, + denomsFromCreator(request: QueryDenomsFromCreatorRequest, useInterfaces: boolean = true): Promise { + return queryService.denomsFromCreator(request, useInterfaces); + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/denom/query.ts b/packages/types/protobuf/codegen/kujira/denom/query.ts new file mode 100644 index 000000000..dcf63a854 --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/denom/query.ts @@ -0,0 +1,475 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { DenomAuthorityMetadata, DenomAuthorityMetadataAmino, DenomAuthorityMetadataSDKType } from "./authorityMetadata"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/kujira.denom.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/kujira.denom.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params defines the parameters of the module. */ + params: Params | undefined; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/kujira.denom.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** params defines the parameters of the module. */ + params?: ParamsAmino | undefined; +} +export interface QueryParamsResponseAminoMsg { + type: "/kujira.denom.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType | undefined; +} +export interface QueryDenomAuthorityMetadataRequest { + denom: string; +} +export interface QueryDenomAuthorityMetadataRequestProtoMsg { + typeUrl: "/kujira.denom.QueryDenomAuthorityMetadataRequest"; + value: Uint8Array; +} +export interface QueryDenomAuthorityMetadataRequestAmino { + denom?: string; +} +export interface QueryDenomAuthorityMetadataRequestAminoMsg { + type: "/kujira.denom.QueryDenomAuthorityMetadataRequest"; + value: QueryDenomAuthorityMetadataRequestAmino; +} +export interface QueryDenomAuthorityMetadataRequestSDKType { + denom: string; +} +export interface QueryDenomAuthorityMetadataResponse { + authorityMetadata: DenomAuthorityMetadata | undefined; +} +export interface QueryDenomAuthorityMetadataResponseProtoMsg { + typeUrl: "/kujira.denom.QueryDenomAuthorityMetadataResponse"; + value: Uint8Array; +} +export interface QueryDenomAuthorityMetadataResponseAmino { + authority_metadata?: DenomAuthorityMetadataAmino | undefined; +} +export interface QueryDenomAuthorityMetadataResponseAminoMsg { + type: "/kujira.denom.QueryDenomAuthorityMetadataResponse"; + value: QueryDenomAuthorityMetadataResponseAmino; +} +export interface QueryDenomAuthorityMetadataResponseSDKType { + authority_metadata: DenomAuthorityMetadataSDKType | undefined; +} +export interface QueryDenomsFromCreatorRequest { + creator: string; +} +export interface QueryDenomsFromCreatorRequestProtoMsg { + typeUrl: "/kujira.denom.QueryDenomsFromCreatorRequest"; + value: Uint8Array; +} +export interface QueryDenomsFromCreatorRequestAmino { + creator?: string; +} +export interface QueryDenomsFromCreatorRequestAminoMsg { + type: "/kujira.denom.QueryDenomsFromCreatorRequest"; + value: QueryDenomsFromCreatorRequestAmino; +} +export interface QueryDenomsFromCreatorRequestSDKType { + creator: string; +} +export interface QueryDenomsFromCreatorResponse { + denoms: string[]; +} +export interface QueryDenomsFromCreatorResponseProtoMsg { + typeUrl: "/kujira.denom.QueryDenomsFromCreatorResponse"; + value: Uint8Array; +} +export interface QueryDenomsFromCreatorResponseAmino { + denoms?: string[]; +} +export interface QueryDenomsFromCreatorResponseAminoMsg { + type: "/kujira.denom.QueryDenomsFromCreatorResponse"; + value: QueryDenomsFromCreatorResponseAmino; +} +export interface QueryDenomsFromCreatorResponseSDKType { + denoms: string[]; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/kujira.denom.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest, useInterfaces: boolean = false): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg, useInterfaces: boolean = false): QueryParamsRequest { + return QueryParamsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/kujira.denom.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/kujira.denom.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse, useInterfaces: boolean = false): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg, useInterfaces: boolean = false): QueryParamsResponse { + return QueryParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/kujira.denom.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDenomAuthorityMetadataRequest(): QueryDenomAuthorityMetadataRequest { + return { + denom: "" + }; +} +export const QueryDenomAuthorityMetadataRequest = { + typeUrl: "/kujira.denom.QueryDenomAuthorityMetadataRequest", + encode(message: QueryDenomAuthorityMetadataRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryDenomAuthorityMetadataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomAuthorityMetadataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomAuthorityMetadataRequest { + const message = createBaseQueryDenomAuthorityMetadataRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryDenomAuthorityMetadataRequestAmino): QueryDenomAuthorityMetadataRequest { + const message = createBaseQueryDenomAuthorityMetadataRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryDenomAuthorityMetadataRequest, useInterfaces: boolean = false): QueryDenomAuthorityMetadataRequestAmino { + const obj: any = {}; + obj.denom = message.denom; + return obj; + }, + fromAminoMsg(object: QueryDenomAuthorityMetadataRequestAminoMsg): QueryDenomAuthorityMetadataRequest { + return QueryDenomAuthorityMetadataRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDenomAuthorityMetadataRequestProtoMsg, useInterfaces: boolean = false): QueryDenomAuthorityMetadataRequest { + return QueryDenomAuthorityMetadataRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryDenomAuthorityMetadataRequest): Uint8Array { + return QueryDenomAuthorityMetadataRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomAuthorityMetadataRequest): QueryDenomAuthorityMetadataRequestProtoMsg { + return { + typeUrl: "/kujira.denom.QueryDenomAuthorityMetadataRequest", + value: QueryDenomAuthorityMetadataRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDenomAuthorityMetadataResponse(): QueryDenomAuthorityMetadataResponse { + return { + authorityMetadata: DenomAuthorityMetadata.fromPartial({}) + }; +} +export const QueryDenomAuthorityMetadataResponse = { + typeUrl: "/kujira.denom.QueryDenomAuthorityMetadataResponse", + encode(message: QueryDenomAuthorityMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authorityMetadata !== undefined) { + DenomAuthorityMetadata.encode(message.authorityMetadata, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryDenomAuthorityMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomAuthorityMetadataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authorityMetadata = DenomAuthorityMetadata.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomAuthorityMetadataResponse { + const message = createBaseQueryDenomAuthorityMetadataResponse(); + message.authorityMetadata = object.authorityMetadata !== undefined && object.authorityMetadata !== null ? DenomAuthorityMetadata.fromPartial(object.authorityMetadata) : undefined; + return message; + }, + fromAmino(object: QueryDenomAuthorityMetadataResponseAmino): QueryDenomAuthorityMetadataResponse { + const message = createBaseQueryDenomAuthorityMetadataResponse(); + if (object.authority_metadata !== undefined && object.authority_metadata !== null) { + message.authorityMetadata = DenomAuthorityMetadata.fromAmino(object.authority_metadata); + } + return message; + }, + toAmino(message: QueryDenomAuthorityMetadataResponse, useInterfaces: boolean = false): QueryDenomAuthorityMetadataResponseAmino { + const obj: any = {}; + obj.authority_metadata = message.authorityMetadata ? DenomAuthorityMetadata.toAmino(message.authorityMetadata, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomAuthorityMetadataResponseAminoMsg): QueryDenomAuthorityMetadataResponse { + return QueryDenomAuthorityMetadataResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDenomAuthorityMetadataResponseProtoMsg, useInterfaces: boolean = false): QueryDenomAuthorityMetadataResponse { + return QueryDenomAuthorityMetadataResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryDenomAuthorityMetadataResponse): Uint8Array { + return QueryDenomAuthorityMetadataResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomAuthorityMetadataResponse): QueryDenomAuthorityMetadataResponseProtoMsg { + return { + typeUrl: "/kujira.denom.QueryDenomAuthorityMetadataResponse", + value: QueryDenomAuthorityMetadataResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDenomsFromCreatorRequest(): QueryDenomsFromCreatorRequest { + return { + creator: "" + }; +} +export const QueryDenomsFromCreatorRequest = { + typeUrl: "/kujira.denom.QueryDenomsFromCreatorRequest", + encode(message: QueryDenomsFromCreatorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryDenomsFromCreatorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomsFromCreatorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomsFromCreatorRequest { + const message = createBaseQueryDenomsFromCreatorRequest(); + message.creator = object.creator ?? ""; + return message; + }, + fromAmino(object: QueryDenomsFromCreatorRequestAmino): QueryDenomsFromCreatorRequest { + const message = createBaseQueryDenomsFromCreatorRequest(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + return message; + }, + toAmino(message: QueryDenomsFromCreatorRequest, useInterfaces: boolean = false): QueryDenomsFromCreatorRequestAmino { + const obj: any = {}; + obj.creator = message.creator; + return obj; + }, + fromAminoMsg(object: QueryDenomsFromCreatorRequestAminoMsg): QueryDenomsFromCreatorRequest { + return QueryDenomsFromCreatorRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDenomsFromCreatorRequestProtoMsg, useInterfaces: boolean = false): QueryDenomsFromCreatorRequest { + return QueryDenomsFromCreatorRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryDenomsFromCreatorRequest): Uint8Array { + return QueryDenomsFromCreatorRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomsFromCreatorRequest): QueryDenomsFromCreatorRequestProtoMsg { + return { + typeUrl: "/kujira.denom.QueryDenomsFromCreatorRequest", + value: QueryDenomsFromCreatorRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDenomsFromCreatorResponse(): QueryDenomsFromCreatorResponse { + return { + denoms: [] + }; +} +export const QueryDenomsFromCreatorResponse = { + typeUrl: "/kujira.denom.QueryDenomsFromCreatorResponse", + encode(message: QueryDenomsFromCreatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.denoms) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryDenomsFromCreatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomsFromCreatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denoms.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomsFromCreatorResponse { + const message = createBaseQueryDenomsFromCreatorResponse(); + message.denoms = object.denoms?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryDenomsFromCreatorResponseAmino): QueryDenomsFromCreatorResponse { + const message = createBaseQueryDenomsFromCreatorResponse(); + message.denoms = object.denoms?.map(e => e) || []; + return message; + }, + toAmino(message: QueryDenomsFromCreatorResponse, useInterfaces: boolean = false): QueryDenomsFromCreatorResponseAmino { + const obj: any = {}; + if (message.denoms) { + obj.denoms = message.denoms.map(e => e); + } else { + obj.denoms = []; + } + return obj; + }, + fromAminoMsg(object: QueryDenomsFromCreatorResponseAminoMsg): QueryDenomsFromCreatorResponse { + return QueryDenomsFromCreatorResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDenomsFromCreatorResponseProtoMsg, useInterfaces: boolean = false): QueryDenomsFromCreatorResponse { + return QueryDenomsFromCreatorResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryDenomsFromCreatorResponse): Uint8Array { + return QueryDenomsFromCreatorResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomsFromCreatorResponse): QueryDenomsFromCreatorResponseProtoMsg { + return { + typeUrl: "/kujira.denom.QueryDenomsFromCreatorResponse", + value: QueryDenomsFromCreatorResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/denom/tx.amino.ts b/packages/types/protobuf/codegen/kujira/denom/tx.amino.ts new file mode 100644 index 000000000..364bd84f1 --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/denom/tx.amino.ts @@ -0,0 +1,23 @@ +import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin } from "./tx"; +export const AminoConverter = { + "/kujira.denom.MsgCreateDenom": { + aminoType: "/kujira.denom.MsgCreateDenom", + toAmino: MsgCreateDenom.toAmino, + fromAmino: MsgCreateDenom.fromAmino + }, + "/kujira.denom.MsgMint": { + aminoType: "/kujira.denom.MsgMint", + toAmino: MsgMint.toAmino, + fromAmino: MsgMint.fromAmino + }, + "/kujira.denom.MsgBurn": { + aminoType: "/kujira.denom.MsgBurn", + toAmino: MsgBurn.toAmino, + fromAmino: MsgBurn.fromAmino + }, + "/kujira.denom.MsgChangeAdmin": { + aminoType: "/kujira.denom.MsgChangeAdmin", + toAmino: MsgChangeAdmin.toAmino, + fromAmino: MsgChangeAdmin.fromAmino + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/denom/tx.registry.ts b/packages/types/protobuf/codegen/kujira/denom/tx.registry.ts new file mode 100644 index 000000000..6737ece54 --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/denom/tx.registry.ts @@ -0,0 +1,89 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/kujira.denom.MsgCreateDenom", MsgCreateDenom], ["/kujira.denom.MsgMint", MsgMint], ["/kujira.denom.MsgBurn", MsgBurn], ["/kujira.denom.MsgChangeAdmin", MsgChangeAdmin]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createDenom(value: MsgCreateDenom) { + return { + typeUrl: "/kujira.denom.MsgCreateDenom", + value: MsgCreateDenom.encode(value).finish() + }; + }, + mint(value: MsgMint) { + return { + typeUrl: "/kujira.denom.MsgMint", + value: MsgMint.encode(value).finish() + }; + }, + burn(value: MsgBurn) { + return { + typeUrl: "/kujira.denom.MsgBurn", + value: MsgBurn.encode(value).finish() + }; + }, + changeAdmin(value: MsgChangeAdmin) { + return { + typeUrl: "/kujira.denom.MsgChangeAdmin", + value: MsgChangeAdmin.encode(value).finish() + }; + } + }, + withTypeUrl: { + createDenom(value: MsgCreateDenom) { + return { + typeUrl: "/kujira.denom.MsgCreateDenom", + value + }; + }, + mint(value: MsgMint) { + return { + typeUrl: "/kujira.denom.MsgMint", + value + }; + }, + burn(value: MsgBurn) { + return { + typeUrl: "/kujira.denom.MsgBurn", + value + }; + }, + changeAdmin(value: MsgChangeAdmin) { + return { + typeUrl: "/kujira.denom.MsgChangeAdmin", + value + }; + } + }, + fromPartial: { + createDenom(value: MsgCreateDenom) { + return { + typeUrl: "/kujira.denom.MsgCreateDenom", + value: MsgCreateDenom.fromPartial(value) + }; + }, + mint(value: MsgMint) { + return { + typeUrl: "/kujira.denom.MsgMint", + value: MsgMint.fromPartial(value) + }; + }, + burn(value: MsgBurn) { + return { + typeUrl: "/kujira.denom.MsgBurn", + value: MsgBurn.fromPartial(value) + }; + }, + changeAdmin(value: MsgChangeAdmin) { + return { + typeUrl: "/kujira.denom.MsgChangeAdmin", + value: MsgChangeAdmin.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/denom/tx.rpc.msg.ts b/packages/types/protobuf/codegen/kujira/denom/tx.rpc.msg.ts new file mode 100644 index 000000000..3bf108d61 --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/denom/tx.rpc.msg.ts @@ -0,0 +1,45 @@ +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { MsgCreateDenom, MsgCreateDenomResponse, MsgMint, MsgMintResponse, MsgBurn, MsgBurnResponse, MsgChangeAdmin, MsgChangeAdminResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + createDenom(request: MsgCreateDenom): Promise; + mint(request: MsgMint): Promise; + burn(request: MsgBurn): Promise; + /** + * ForceTransfer is deactivated for now because we need to think through edge + * cases rpc ForceTransfer(MsgForceTransfer) returns + * (MsgForceTransferResponse); + */ + changeAdmin(request: MsgChangeAdmin): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.createDenom = this.createDenom.bind(this); + this.mint = this.mint.bind(this); + this.burn = this.burn.bind(this); + this.changeAdmin = this.changeAdmin.bind(this); + } + createDenom(request: MsgCreateDenom, useInterfaces: boolean = true): Promise { + const data = MsgCreateDenom.encode(request).finish(); + const promise = this.rpc.request("kujira.denom.Msg", "CreateDenom", data); + return promise.then(data => MsgCreateDenomResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + mint(request: MsgMint, useInterfaces: boolean = true): Promise { + const data = MsgMint.encode(request).finish(); + const promise = this.rpc.request("kujira.denom.Msg", "Mint", data); + return promise.then(data => MsgMintResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + burn(request: MsgBurn, useInterfaces: boolean = true): Promise { + const data = MsgBurn.encode(request).finish(); + const promise = this.rpc.request("kujira.denom.Msg", "Burn", data); + return promise.then(data => MsgBurnResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + changeAdmin(request: MsgChangeAdmin, useInterfaces: boolean = true): Promise { + const data = MsgChangeAdmin.encode(request).finish(); + const promise = this.rpc.request("kujira.denom.Msg", "ChangeAdmin", data); + return promise.then(data => MsgChangeAdminResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/denom/tx.ts b/packages/types/protobuf/codegen/kujira/denom/tx.ts new file mode 100644 index 000000000..903fd00ae --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/denom/tx.ts @@ -0,0 +1,739 @@ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * MsgCreateDenom is the sdk.Msg type for allowing an account to create + * a new denom. It requires a sender address and a unique nonce + * (to allow accounts to create multiple denoms) + */ +export interface MsgCreateDenom { + sender: string; + nonce: string; +} +export interface MsgCreateDenomProtoMsg { + typeUrl: "/kujira.denom.MsgCreateDenom"; + value: Uint8Array; +} +/** + * MsgCreateDenom is the sdk.Msg type for allowing an account to create + * a new denom. It requires a sender address and a unique nonce + * (to allow accounts to create multiple denoms) + */ +export interface MsgCreateDenomAmino { + sender?: string; + nonce?: string; +} +export interface MsgCreateDenomAminoMsg { + type: "/kujira.denom.MsgCreateDenom"; + value: MsgCreateDenomAmino; +} +/** + * MsgCreateDenom is the sdk.Msg type for allowing an account to create + * a new denom. It requires a sender address and a unique nonce + * (to allow accounts to create multiple denoms) + */ +export interface MsgCreateDenomSDKType { + sender: string; + nonce: string; +} +/** + * MsgCreateDenomResponse is the return value of MsgCreateDenom + * It returns the full string of the newly created denom + */ +export interface MsgCreateDenomResponse { + newTokenDenom: string; +} +export interface MsgCreateDenomResponseProtoMsg { + typeUrl: "/kujira.denom.MsgCreateDenomResponse"; + value: Uint8Array; +} +/** + * MsgCreateDenomResponse is the return value of MsgCreateDenom + * It returns the full string of the newly created denom + */ +export interface MsgCreateDenomResponseAmino { + new_token_denom?: string; +} +export interface MsgCreateDenomResponseAminoMsg { + type: "/kujira.denom.MsgCreateDenomResponse"; + value: MsgCreateDenomResponseAmino; +} +/** + * MsgCreateDenomResponse is the return value of MsgCreateDenom + * It returns the full string of the newly created denom + */ +export interface MsgCreateDenomResponseSDKType { + new_token_denom: string; +} +/** + * MsgMint is the sdk.Msg type for allowing an admin account to mint + * more of a token. + */ +export interface MsgMint { + sender: string; + amount: Coin | undefined; + recipient: string; +} +export interface MsgMintProtoMsg { + typeUrl: "/kujira.denom.MsgMint"; + value: Uint8Array; +} +/** + * MsgMint is the sdk.Msg type for allowing an admin account to mint + * more of a token. + */ +export interface MsgMintAmino { + sender?: string; + amount?: CoinAmino | undefined; + recipient?: string; +} +export interface MsgMintAminoMsg { + type: "/kujira.denom.MsgMint"; + value: MsgMintAmino; +} +/** + * MsgMint is the sdk.Msg type for allowing an admin account to mint + * more of a token. + */ +export interface MsgMintSDKType { + sender: string; + amount: CoinSDKType | undefined; + recipient: string; +} +export interface MsgMintResponse {} +export interface MsgMintResponseProtoMsg { + typeUrl: "/kujira.denom.MsgMintResponse"; + value: Uint8Array; +} +export interface MsgMintResponseAmino {} +export interface MsgMintResponseAminoMsg { + type: "/kujira.denom.MsgMintResponse"; + value: MsgMintResponseAmino; +} +export interface MsgMintResponseSDKType {} +/** + * MsgBurn is the sdk.Msg type for allowing an admin account to burn + * a token. For now, we only support burning from the sender account. + */ +export interface MsgBurn { + sender: string; + amount: Coin | undefined; +} +export interface MsgBurnProtoMsg { + typeUrl: "/kujira.denom.MsgBurn"; + value: Uint8Array; +} +/** + * MsgBurn is the sdk.Msg type for allowing an admin account to burn + * a token. For now, we only support burning from the sender account. + */ +export interface MsgBurnAmino { + sender?: string; + amount?: CoinAmino | undefined; +} +export interface MsgBurnAminoMsg { + type: "/kujira.denom.MsgBurn"; + value: MsgBurnAmino; +} +/** + * MsgBurn is the sdk.Msg type for allowing an admin account to burn + * a token. For now, we only support burning from the sender account. + */ +export interface MsgBurnSDKType { + sender: string; + amount: CoinSDKType | undefined; +} +export interface MsgBurnResponse {} +export interface MsgBurnResponseProtoMsg { + typeUrl: "/kujira.denom.MsgBurnResponse"; + value: Uint8Array; +} +export interface MsgBurnResponseAmino {} +export interface MsgBurnResponseAminoMsg { + type: "/kujira.denom.MsgBurnResponse"; + value: MsgBurnResponseAmino; +} +export interface MsgBurnResponseSDKType {} +/** + * MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign + * adminship of a denom to a new account + */ +export interface MsgChangeAdmin { + sender: string; + denom: string; + newAdmin: string; +} +export interface MsgChangeAdminProtoMsg { + typeUrl: "/kujira.denom.MsgChangeAdmin"; + value: Uint8Array; +} +/** + * MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign + * adminship of a denom to a new account + */ +export interface MsgChangeAdminAmino { + sender?: string; + denom?: string; + newAdmin?: string; +} +export interface MsgChangeAdminAminoMsg { + type: "/kujira.denom.MsgChangeAdmin"; + value: MsgChangeAdminAmino; +} +/** + * MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign + * adminship of a denom to a new account + */ +export interface MsgChangeAdminSDKType { + sender: string; + denom: string; + newAdmin: string; +} +export interface MsgChangeAdminResponse {} +export interface MsgChangeAdminResponseProtoMsg { + typeUrl: "/kujira.denom.MsgChangeAdminResponse"; + value: Uint8Array; +} +export interface MsgChangeAdminResponseAmino {} +export interface MsgChangeAdminResponseAminoMsg { + type: "/kujira.denom.MsgChangeAdminResponse"; + value: MsgChangeAdminResponseAmino; +} +export interface MsgChangeAdminResponseSDKType {} +function createBaseMsgCreateDenom(): MsgCreateDenom { + return { + sender: "", + nonce: "" + }; +} +export const MsgCreateDenom = { + typeUrl: "/kujira.denom.MsgCreateDenom", + encode(message: MsgCreateDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.nonce !== "") { + writer.uint32(18).string(message.nonce); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgCreateDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDenom(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.nonce = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateDenom { + const message = createBaseMsgCreateDenom(); + message.sender = object.sender ?? ""; + message.nonce = object.nonce ?? ""; + return message; + }, + fromAmino(object: MsgCreateDenomAmino): MsgCreateDenom { + const message = createBaseMsgCreateDenom(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.nonce !== undefined && object.nonce !== null) { + message.nonce = object.nonce; + } + return message; + }, + toAmino(message: MsgCreateDenom, useInterfaces: boolean = false): MsgCreateDenomAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.nonce = message.nonce; + return obj; + }, + fromAminoMsg(object: MsgCreateDenomAminoMsg): MsgCreateDenom { + return MsgCreateDenom.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateDenomProtoMsg, useInterfaces: boolean = false): MsgCreateDenom { + return MsgCreateDenom.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgCreateDenom): Uint8Array { + return MsgCreateDenom.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateDenom): MsgCreateDenomProtoMsg { + return { + typeUrl: "/kujira.denom.MsgCreateDenom", + value: MsgCreateDenom.encode(message).finish() + }; + } +}; +function createBaseMsgCreateDenomResponse(): MsgCreateDenomResponse { + return { + newTokenDenom: "" + }; +} +export const MsgCreateDenomResponse = { + typeUrl: "/kujira.denom.MsgCreateDenomResponse", + encode(message: MsgCreateDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.newTokenDenom !== "") { + writer.uint32(10).string(message.newTokenDenom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgCreateDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.newTokenDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateDenomResponse { + const message = createBaseMsgCreateDenomResponse(); + message.newTokenDenom = object.newTokenDenom ?? ""; + return message; + }, + fromAmino(object: MsgCreateDenomResponseAmino): MsgCreateDenomResponse { + const message = createBaseMsgCreateDenomResponse(); + if (object.new_token_denom !== undefined && object.new_token_denom !== null) { + message.newTokenDenom = object.new_token_denom; + } + return message; + }, + toAmino(message: MsgCreateDenomResponse, useInterfaces: boolean = false): MsgCreateDenomResponseAmino { + const obj: any = {}; + obj.new_token_denom = message.newTokenDenom; + return obj; + }, + fromAminoMsg(object: MsgCreateDenomResponseAminoMsg): MsgCreateDenomResponse { + return MsgCreateDenomResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateDenomResponseProtoMsg, useInterfaces: boolean = false): MsgCreateDenomResponse { + return MsgCreateDenomResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgCreateDenomResponse): Uint8Array { + return MsgCreateDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateDenomResponse): MsgCreateDenomResponseProtoMsg { + return { + typeUrl: "/kujira.denom.MsgCreateDenomResponse", + value: MsgCreateDenomResponse.encode(message).finish() + }; + } +}; +function createBaseMsgMint(): MsgMint { + return { + sender: "", + amount: Coin.fromPartial({}), + recipient: "" + }; +} +export const MsgMint = { + typeUrl: "/kujira.denom.MsgMint", + encode(message: MsgMint, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + if (message.recipient !== "") { + writer.uint32(26).string(message.recipient); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgMint { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMint(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.recipient = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgMint { + const message = createBaseMsgMint(); + message.sender = object.sender ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + message.recipient = object.recipient ?? ""; + return message; + }, + fromAmino(object: MsgMintAmino): MsgMint { + const message = createBaseMsgMint(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + return message; + }, + toAmino(message: MsgMint, useInterfaces: boolean = false): MsgMintAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.amount = message.amount ? Coin.toAmino(message.amount, useInterfaces) : undefined; + obj.recipient = message.recipient; + return obj; + }, + fromAminoMsg(object: MsgMintAminoMsg): MsgMint { + return MsgMint.fromAmino(object.value); + }, + fromProtoMsg(message: MsgMintProtoMsg, useInterfaces: boolean = false): MsgMint { + return MsgMint.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgMint): Uint8Array { + return MsgMint.encode(message).finish(); + }, + toProtoMsg(message: MsgMint): MsgMintProtoMsg { + return { + typeUrl: "/kujira.denom.MsgMint", + value: MsgMint.encode(message).finish() + }; + } +}; +function createBaseMsgMintResponse(): MsgMintResponse { + return {}; +} +export const MsgMintResponse = { + typeUrl: "/kujira.denom.MsgMintResponse", + encode(_: MsgMintResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgMintResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMintResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgMintResponse { + const message = createBaseMsgMintResponse(); + return message; + }, + fromAmino(_: MsgMintResponseAmino): MsgMintResponse { + const message = createBaseMsgMintResponse(); + return message; + }, + toAmino(_: MsgMintResponse, useInterfaces: boolean = false): MsgMintResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgMintResponseAminoMsg): MsgMintResponse { + return MsgMintResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgMintResponseProtoMsg, useInterfaces: boolean = false): MsgMintResponse { + return MsgMintResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgMintResponse): Uint8Array { + return MsgMintResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgMintResponse): MsgMintResponseProtoMsg { + return { + typeUrl: "/kujira.denom.MsgMintResponse", + value: MsgMintResponse.encode(message).finish() + }; + } +}; +function createBaseMsgBurn(): MsgBurn { + return { + sender: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgBurn = { + typeUrl: "/kujira.denom.MsgBurn", + encode(message: MsgBurn, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgBurn { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBurn(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgBurn { + const message = createBaseMsgBurn(); + message.sender = object.sender ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgBurnAmino): MsgBurn { + const message = createBaseMsgBurn(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgBurn, useInterfaces: boolean = false): MsgBurnAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.amount = message.amount ? Coin.toAmino(message.amount, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgBurnAminoMsg): MsgBurn { + return MsgBurn.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBurnProtoMsg, useInterfaces: boolean = false): MsgBurn { + return MsgBurn.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgBurn): Uint8Array { + return MsgBurn.encode(message).finish(); + }, + toProtoMsg(message: MsgBurn): MsgBurnProtoMsg { + return { + typeUrl: "/kujira.denom.MsgBurn", + value: MsgBurn.encode(message).finish() + }; + } +}; +function createBaseMsgBurnResponse(): MsgBurnResponse { + return {}; +} +export const MsgBurnResponse = { + typeUrl: "/kujira.denom.MsgBurnResponse", + encode(_: MsgBurnResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgBurnResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBurnResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgBurnResponse { + const message = createBaseMsgBurnResponse(); + return message; + }, + fromAmino(_: MsgBurnResponseAmino): MsgBurnResponse { + const message = createBaseMsgBurnResponse(); + return message; + }, + toAmino(_: MsgBurnResponse, useInterfaces: boolean = false): MsgBurnResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgBurnResponseAminoMsg): MsgBurnResponse { + return MsgBurnResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBurnResponseProtoMsg, useInterfaces: boolean = false): MsgBurnResponse { + return MsgBurnResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgBurnResponse): Uint8Array { + return MsgBurnResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBurnResponse): MsgBurnResponseProtoMsg { + return { + typeUrl: "/kujira.denom.MsgBurnResponse", + value: MsgBurnResponse.encode(message).finish() + }; + } +}; +function createBaseMsgChangeAdmin(): MsgChangeAdmin { + return { + sender: "", + denom: "", + newAdmin: "" + }; +} +export const MsgChangeAdmin = { + typeUrl: "/kujira.denom.MsgChangeAdmin", + encode(message: MsgChangeAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.newAdmin !== "") { + writer.uint32(26).string(message.newAdmin); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgChangeAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChangeAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.newAdmin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChangeAdmin { + const message = createBaseMsgChangeAdmin(); + message.sender = object.sender ?? ""; + message.denom = object.denom ?? ""; + message.newAdmin = object.newAdmin ?? ""; + return message; + }, + fromAmino(object: MsgChangeAdminAmino): MsgChangeAdmin { + const message = createBaseMsgChangeAdmin(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.newAdmin !== undefined && object.newAdmin !== null) { + message.newAdmin = object.newAdmin; + } + return message; + }, + toAmino(message: MsgChangeAdmin, useInterfaces: boolean = false): MsgChangeAdminAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.denom = message.denom; + obj.newAdmin = message.newAdmin; + return obj; + }, + fromAminoMsg(object: MsgChangeAdminAminoMsg): MsgChangeAdmin { + return MsgChangeAdmin.fromAmino(object.value); + }, + fromProtoMsg(message: MsgChangeAdminProtoMsg, useInterfaces: boolean = false): MsgChangeAdmin { + return MsgChangeAdmin.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgChangeAdmin): Uint8Array { + return MsgChangeAdmin.encode(message).finish(); + }, + toProtoMsg(message: MsgChangeAdmin): MsgChangeAdminProtoMsg { + return { + typeUrl: "/kujira.denom.MsgChangeAdmin", + value: MsgChangeAdmin.encode(message).finish() + }; + } +}; +function createBaseMsgChangeAdminResponse(): MsgChangeAdminResponse { + return {}; +} +export const MsgChangeAdminResponse = { + typeUrl: "/kujira.denom.MsgChangeAdminResponse", + encode(_: MsgChangeAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgChangeAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChangeAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgChangeAdminResponse { + const message = createBaseMsgChangeAdminResponse(); + return message; + }, + fromAmino(_: MsgChangeAdminResponseAmino): MsgChangeAdminResponse { + const message = createBaseMsgChangeAdminResponse(); + return message; + }, + toAmino(_: MsgChangeAdminResponse, useInterfaces: boolean = false): MsgChangeAdminResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChangeAdminResponseAminoMsg): MsgChangeAdminResponse { + return MsgChangeAdminResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgChangeAdminResponseProtoMsg, useInterfaces: boolean = false): MsgChangeAdminResponse { + return MsgChangeAdminResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgChangeAdminResponse): Uint8Array { + return MsgChangeAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChangeAdminResponse): MsgChangeAdminResponseProtoMsg { + return { + typeUrl: "/kujira.denom.MsgChangeAdminResponse", + value: MsgChangeAdminResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/oracle/genesis.ts b/packages/types/protobuf/codegen/kujira/oracle/genesis.ts new file mode 100644 index 000000000..6a3441051 --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/oracle/genesis.ts @@ -0,0 +1,388 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType, ExchangeRateTuple, ExchangeRateTupleAmino, ExchangeRateTupleSDKType, AggregateExchangeRatePrevote, AggregateExchangeRatePrevoteAmino, AggregateExchangeRatePrevoteSDKType, AggregateExchangeRateVote, AggregateExchangeRateVoteAmino, AggregateExchangeRateVoteSDKType } from "./oracle"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines the oracle module's genesis state. */ +export interface GenesisState { + params: Params | undefined; + feederDelegations: FeederDelegation[]; + exchangeRates: ExchangeRateTuple[]; + missCounters: MissCounter[]; + aggregateExchangeRatePrevotes: AggregateExchangeRatePrevote[]; + aggregateExchangeRateVotes: AggregateExchangeRateVote[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/kujira.oracle.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the oracle module's genesis state. */ +export interface GenesisStateAmino { + params?: ParamsAmino | undefined; + feeder_delegations?: FeederDelegationAmino[]; + exchange_rates?: ExchangeRateTupleAmino[]; + miss_counters?: MissCounterAmino[]; + aggregate_exchange_rate_prevotes?: AggregateExchangeRatePrevoteAmino[]; + aggregate_exchange_rate_votes?: AggregateExchangeRateVoteAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/kujira.oracle.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the oracle module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType | undefined; + feeder_delegations: FeederDelegationSDKType[]; + exchange_rates: ExchangeRateTupleSDKType[]; + miss_counters: MissCounterSDKType[]; + aggregate_exchange_rate_prevotes: AggregateExchangeRatePrevoteSDKType[]; + aggregate_exchange_rate_votes: AggregateExchangeRateVoteSDKType[]; +} +/** + * FeederDelegation is the address for where oracle feeder authority are + * delegated to. By default this struct is only used at genesis to feed in + * default feeder addresses. + */ +export interface FeederDelegation { + feederAddress: string; + validatorAddress: string; +} +export interface FeederDelegationProtoMsg { + typeUrl: "/kujira.oracle.FeederDelegation"; + value: Uint8Array; +} +/** + * FeederDelegation is the address for where oracle feeder authority are + * delegated to. By default this struct is only used at genesis to feed in + * default feeder addresses. + */ +export interface FeederDelegationAmino { + feeder_address?: string; + validator_address?: string; +} +export interface FeederDelegationAminoMsg { + type: "/kujira.oracle.FeederDelegation"; + value: FeederDelegationAmino; +} +/** + * FeederDelegation is the address for where oracle feeder authority are + * delegated to. By default this struct is only used at genesis to feed in + * default feeder addresses. + */ +export interface FeederDelegationSDKType { + feeder_address: string; + validator_address: string; +} +/** + * MissCounter defines an miss counter and validator address pair used in + * oracle module's genesis state + */ +export interface MissCounter { + validatorAddress: string; + missCounter: bigint; +} +export interface MissCounterProtoMsg { + typeUrl: "/kujira.oracle.MissCounter"; + value: Uint8Array; +} +/** + * MissCounter defines an miss counter and validator address pair used in + * oracle module's genesis state + */ +export interface MissCounterAmino { + validator_address?: string; + miss_counter?: string; +} +export interface MissCounterAminoMsg { + type: "/kujira.oracle.MissCounter"; + value: MissCounterAmino; +} +/** + * MissCounter defines an miss counter and validator address pair used in + * oracle module's genesis state + */ +export interface MissCounterSDKType { + validator_address: string; + miss_counter: bigint; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + feederDelegations: [], + exchangeRates: [], + missCounters: [], + aggregateExchangeRatePrevotes: [], + aggregateExchangeRateVotes: [] + }; +} +export const GenesisState = { + typeUrl: "/kujira.oracle.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.feederDelegations) { + FeederDelegation.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.exchangeRates) { + ExchangeRateTuple.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.missCounters) { + MissCounter.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.aggregateExchangeRatePrevotes) { + AggregateExchangeRatePrevote.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.aggregateExchangeRateVotes) { + AggregateExchangeRateVote.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.feederDelegations.push(FeederDelegation.decode(reader, reader.uint32(), useInterfaces)); + break; + case 3: + message.exchangeRates.push(ExchangeRateTuple.decode(reader, reader.uint32(), useInterfaces)); + break; + case 4: + message.missCounters.push(MissCounter.decode(reader, reader.uint32(), useInterfaces)); + break; + case 5: + message.aggregateExchangeRatePrevotes.push(AggregateExchangeRatePrevote.decode(reader, reader.uint32(), useInterfaces)); + break; + case 6: + message.aggregateExchangeRateVotes.push(AggregateExchangeRateVote.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.feederDelegations = object.feederDelegations?.map(e => FeederDelegation.fromPartial(e)) || []; + message.exchangeRates = object.exchangeRates?.map(e => ExchangeRateTuple.fromPartial(e)) || []; + message.missCounters = object.missCounters?.map(e => MissCounter.fromPartial(e)) || []; + message.aggregateExchangeRatePrevotes = object.aggregateExchangeRatePrevotes?.map(e => AggregateExchangeRatePrevote.fromPartial(e)) || []; + message.aggregateExchangeRateVotes = object.aggregateExchangeRateVotes?.map(e => AggregateExchangeRateVote.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.feederDelegations = object.feeder_delegations?.map(e => FeederDelegation.fromAmino(e)) || []; + message.exchangeRates = object.exchange_rates?.map(e => ExchangeRateTuple.fromAmino(e)) || []; + message.missCounters = object.miss_counters?.map(e => MissCounter.fromAmino(e)) || []; + message.aggregateExchangeRatePrevotes = object.aggregate_exchange_rate_prevotes?.map(e => AggregateExchangeRatePrevote.fromAmino(e)) || []; + message.aggregateExchangeRateVotes = object.aggregate_exchange_rate_votes?.map(e => AggregateExchangeRateVote.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState, useInterfaces: boolean = false): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + if (message.feederDelegations) { + obj.feeder_delegations = message.feederDelegations.map(e => e ? FeederDelegation.toAmino(e, useInterfaces) : undefined); + } else { + obj.feeder_delegations = []; + } + if (message.exchangeRates) { + obj.exchange_rates = message.exchangeRates.map(e => e ? ExchangeRateTuple.toAmino(e, useInterfaces) : undefined); + } else { + obj.exchange_rates = []; + } + if (message.missCounters) { + obj.miss_counters = message.missCounters.map(e => e ? MissCounter.toAmino(e, useInterfaces) : undefined); + } else { + obj.miss_counters = []; + } + if (message.aggregateExchangeRatePrevotes) { + obj.aggregate_exchange_rate_prevotes = message.aggregateExchangeRatePrevotes.map(e => e ? AggregateExchangeRatePrevote.toAmino(e, useInterfaces) : undefined); + } else { + obj.aggregate_exchange_rate_prevotes = []; + } + if (message.aggregateExchangeRateVotes) { + obj.aggregate_exchange_rate_votes = message.aggregateExchangeRateVotes.map(e => e ? AggregateExchangeRateVote.toAmino(e, useInterfaces) : undefined); + } else { + obj.aggregate_exchange_rate_votes = []; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg, useInterfaces: boolean = false): GenesisState { + return GenesisState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/kujira.oracle.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +function createBaseFeederDelegation(): FeederDelegation { + return { + feederAddress: "", + validatorAddress: "" + }; +} +export const FeederDelegation = { + typeUrl: "/kujira.oracle.FeederDelegation", + encode(message: FeederDelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feederAddress !== "") { + writer.uint32(10).string(message.feederAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): FeederDelegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeederDelegation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feederAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): FeederDelegation { + const message = createBaseFeederDelegation(); + message.feederAddress = object.feederAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + return message; + }, + fromAmino(object: FeederDelegationAmino): FeederDelegation { + const message = createBaseFeederDelegation(); + if (object.feeder_address !== undefined && object.feeder_address !== null) { + message.feederAddress = object.feeder_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; + }, + toAmino(message: FeederDelegation, useInterfaces: boolean = false): FeederDelegationAmino { + const obj: any = {}; + obj.feeder_address = message.feederAddress; + obj.validator_address = message.validatorAddress; + return obj; + }, + fromAminoMsg(object: FeederDelegationAminoMsg): FeederDelegation { + return FeederDelegation.fromAmino(object.value); + }, + fromProtoMsg(message: FeederDelegationProtoMsg, useInterfaces: boolean = false): FeederDelegation { + return FeederDelegation.decode(message.value, undefined, useInterfaces); + }, + toProto(message: FeederDelegation): Uint8Array { + return FeederDelegation.encode(message).finish(); + }, + toProtoMsg(message: FeederDelegation): FeederDelegationProtoMsg { + return { + typeUrl: "/kujira.oracle.FeederDelegation", + value: FeederDelegation.encode(message).finish() + }; + } +}; +function createBaseMissCounter(): MissCounter { + return { + validatorAddress: "", + missCounter: BigInt(0) + }; +} +export const MissCounter = { + typeUrl: "/kujira.oracle.MissCounter", + encode(message: MissCounter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (message.missCounter !== BigInt(0)) { + writer.uint32(16).uint64(message.missCounter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MissCounter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMissCounter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.missCounter = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MissCounter { + const message = createBaseMissCounter(); + message.validatorAddress = object.validatorAddress ?? ""; + message.missCounter = object.missCounter !== undefined && object.missCounter !== null ? BigInt(object.missCounter.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MissCounterAmino): MissCounter { + const message = createBaseMissCounter(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.miss_counter !== undefined && object.miss_counter !== null) { + message.missCounter = BigInt(object.miss_counter); + } + return message; + }, + toAmino(message: MissCounter, useInterfaces: boolean = false): MissCounterAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress; + obj.miss_counter = message.missCounter ? message.missCounter.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MissCounterAminoMsg): MissCounter { + return MissCounter.fromAmino(object.value); + }, + fromProtoMsg(message: MissCounterProtoMsg, useInterfaces: boolean = false): MissCounter { + return MissCounter.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MissCounter): Uint8Array { + return MissCounter.encode(message).finish(); + }, + toProtoMsg(message: MissCounter): MissCounterProtoMsg { + return { + typeUrl: "/kujira.oracle.MissCounter", + value: MissCounter.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/oracle/oracle.ts b/packages/types/protobuf/codegen/kujira/oracle/oracle.ts new file mode 100644 index 000000000..ad38eb7f5 --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/oracle/oracle.ts @@ -0,0 +1,598 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +import { Decimal } from "@cosmjs/math"; +/** Params defines the parameters for the oracle module. */ +export interface Params { + votePeriod: bigint; + voteThreshold: string; + rewardBand: string; + rewardDistributionWindow: bigint; + whitelist: Denom[]; + slashFraction: string; + slashWindow: bigint; + minValidPerWindow: string; +} +export interface ParamsProtoMsg { + typeUrl: "/kujira.oracle.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the oracle module. */ +export interface ParamsAmino { + vote_period?: string; + vote_threshold?: string; + reward_band?: string; + reward_distribution_window?: string; + whitelist?: DenomAmino[]; + slash_fraction?: string; + slash_window?: string; + min_valid_per_window?: string; +} +export interface ParamsAminoMsg { + type: "/kujira.oracle.Params"; + value: ParamsAmino; +} +/** Params defines the parameters for the oracle module. */ +export interface ParamsSDKType { + vote_period: bigint; + vote_threshold: string; + reward_band: string; + reward_distribution_window: bigint; + whitelist: DenomSDKType[]; + slash_fraction: string; + slash_window: bigint; + min_valid_per_window: string; +} +/** Denom - the object to hold configurations of each denom */ +export interface Denom { + name: string; +} +export interface DenomProtoMsg { + typeUrl: "/kujira.oracle.Denom"; + value: Uint8Array; +} +/** Denom - the object to hold configurations of each denom */ +export interface DenomAmino { + name?: string; +} +export interface DenomAminoMsg { + type: "/kujira.oracle.Denom"; + value: DenomAmino; +} +/** Denom - the object to hold configurations of each denom */ +export interface DenomSDKType { + name: string; +} +/** + * struct for aggregate prevoting on the ExchangeRateVote. + * The purpose of aggregate prevote is to hide vote exchange rates with hash + * which is formatted as hex string in SHA256("{salt}:{exchange rate}{denom},...,{exchange rate}{denom}:{voter}") + */ +export interface AggregateExchangeRatePrevote { + hash: string; + voter: string; + submitBlock: bigint; +} +export interface AggregateExchangeRatePrevoteProtoMsg { + typeUrl: "/kujira.oracle.AggregateExchangeRatePrevote"; + value: Uint8Array; +} +/** + * struct for aggregate prevoting on the ExchangeRateVote. + * The purpose of aggregate prevote is to hide vote exchange rates with hash + * which is formatted as hex string in SHA256("{salt}:{exchange rate}{denom},...,{exchange rate}{denom}:{voter}") + */ +export interface AggregateExchangeRatePrevoteAmino { + hash?: string; + voter?: string; + submit_block?: string; +} +export interface AggregateExchangeRatePrevoteAminoMsg { + type: "/kujira.oracle.AggregateExchangeRatePrevote"; + value: AggregateExchangeRatePrevoteAmino; +} +/** + * struct for aggregate prevoting on the ExchangeRateVote. + * The purpose of aggregate prevote is to hide vote exchange rates with hash + * which is formatted as hex string in SHA256("{salt}:{exchange rate}{denom},...,{exchange rate}{denom}:{voter}") + */ +export interface AggregateExchangeRatePrevoteSDKType { + hash: string; + voter: string; + submit_block: bigint; +} +/** MsgAggregateExchangeRateVote - struct for voting on exchange rates. */ +export interface AggregateExchangeRateVote { + exchangeRateTuples: ExchangeRateTuple[]; + voter: string; +} +export interface AggregateExchangeRateVoteProtoMsg { + typeUrl: "/kujira.oracle.AggregateExchangeRateVote"; + value: Uint8Array; +} +/** MsgAggregateExchangeRateVote - struct for voting on exchange rates. */ +export interface AggregateExchangeRateVoteAmino { + exchange_rate_tuples?: ExchangeRateTupleAmino[]; + voter?: string; +} +export interface AggregateExchangeRateVoteAminoMsg { + type: "/kujira.oracle.AggregateExchangeRateVote"; + value: AggregateExchangeRateVoteAmino; +} +/** MsgAggregateExchangeRateVote - struct for voting on exchange rates. */ +export interface AggregateExchangeRateVoteSDKType { + exchange_rate_tuples: ExchangeRateTupleSDKType[]; + voter: string; +} +/** ExchangeRateTuple - struct to store interpreted exchange rates data to store */ +export interface ExchangeRateTuple { + denom: string; + exchangeRate: string; +} +export interface ExchangeRateTupleProtoMsg { + typeUrl: "/kujira.oracle.ExchangeRateTuple"; + value: Uint8Array; +} +/** ExchangeRateTuple - struct to store interpreted exchange rates data to store */ +export interface ExchangeRateTupleAmino { + denom?: string; + exchange_rate?: string; +} +export interface ExchangeRateTupleAminoMsg { + type: "/kujira.oracle.ExchangeRateTuple"; + value: ExchangeRateTupleAmino; +} +/** ExchangeRateTuple - struct to store interpreted exchange rates data to store */ +export interface ExchangeRateTupleSDKType { + denom: string; + exchange_rate: string; +} +function createBaseParams(): Params { + return { + votePeriod: BigInt(0), + voteThreshold: "", + rewardBand: "", + rewardDistributionWindow: BigInt(0), + whitelist: [], + slashFraction: "", + slashWindow: BigInt(0), + minValidPerWindow: "" + }; +} +export const Params = { + typeUrl: "/kujira.oracle.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.votePeriod !== BigInt(0)) { + writer.uint32(8).uint64(message.votePeriod); + } + if (message.voteThreshold !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.voteThreshold, 18).atomics); + } + if (message.rewardBand !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.rewardBand, 18).atomics); + } + if (message.rewardDistributionWindow !== BigInt(0)) { + writer.uint32(32).uint64(message.rewardDistributionWindow); + } + for (const v of message.whitelist) { + Denom.encode(v!, writer.uint32(42).fork()).ldelim(); + } + if (message.slashFraction !== "") { + writer.uint32(50).string(Decimal.fromUserInput(message.slashFraction, 18).atomics); + } + if (message.slashWindow !== BigInt(0)) { + writer.uint32(56).uint64(message.slashWindow); + } + if (message.minValidPerWindow !== "") { + writer.uint32(66).string(Decimal.fromUserInput(message.minValidPerWindow, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votePeriod = reader.uint64(); + break; + case 2: + message.voteThreshold = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 3: + message.rewardBand = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 4: + message.rewardDistributionWindow = reader.uint64(); + break; + case 5: + message.whitelist.push(Denom.decode(reader, reader.uint32(), useInterfaces)); + break; + case 6: + message.slashFraction = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 7: + message.slashWindow = reader.uint64(); + break; + case 8: + message.minValidPerWindow = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.votePeriod = object.votePeriod !== undefined && object.votePeriod !== null ? BigInt(object.votePeriod.toString()) : BigInt(0); + message.voteThreshold = object.voteThreshold ?? ""; + message.rewardBand = object.rewardBand ?? ""; + message.rewardDistributionWindow = object.rewardDistributionWindow !== undefined && object.rewardDistributionWindow !== null ? BigInt(object.rewardDistributionWindow.toString()) : BigInt(0); + message.whitelist = object.whitelist?.map(e => Denom.fromPartial(e)) || []; + message.slashFraction = object.slashFraction ?? ""; + message.slashWindow = object.slashWindow !== undefined && object.slashWindow !== null ? BigInt(object.slashWindow.toString()) : BigInt(0); + message.minValidPerWindow = object.minValidPerWindow ?? ""; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.vote_period !== undefined && object.vote_period !== null) { + message.votePeriod = BigInt(object.vote_period); + } + if (object.vote_threshold !== undefined && object.vote_threshold !== null) { + message.voteThreshold = object.vote_threshold; + } + if (object.reward_band !== undefined && object.reward_band !== null) { + message.rewardBand = object.reward_band; + } + if (object.reward_distribution_window !== undefined && object.reward_distribution_window !== null) { + message.rewardDistributionWindow = BigInt(object.reward_distribution_window); + } + message.whitelist = object.whitelist?.map(e => Denom.fromAmino(e)) || []; + if (object.slash_fraction !== undefined && object.slash_fraction !== null) { + message.slashFraction = object.slash_fraction; + } + if (object.slash_window !== undefined && object.slash_window !== null) { + message.slashWindow = BigInt(object.slash_window); + } + if (object.min_valid_per_window !== undefined && object.min_valid_per_window !== null) { + message.minValidPerWindow = object.min_valid_per_window; + } + return message; + }, + toAmino(message: Params, useInterfaces: boolean = false): ParamsAmino { + const obj: any = {}; + obj.vote_period = message.votePeriod ? message.votePeriod.toString() : undefined; + obj.vote_threshold = message.voteThreshold; + obj.reward_band = message.rewardBand; + obj.reward_distribution_window = message.rewardDistributionWindow ? message.rewardDistributionWindow.toString() : undefined; + if (message.whitelist) { + obj.whitelist = message.whitelist.map(e => e ? Denom.toAmino(e, useInterfaces) : undefined); + } else { + obj.whitelist = []; + } + obj.slash_fraction = message.slashFraction; + obj.slash_window = message.slashWindow ? message.slashWindow.toString() : undefined; + obj.min_valid_per_window = message.minValidPerWindow; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsProtoMsg, useInterfaces: boolean = false): Params { + return Params.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/kujira.oracle.Params", + value: Params.encode(message).finish() + }; + } +}; +function createBaseDenom(): Denom { + return { + name: "" + }; +} +export const Denom = { + typeUrl: "/kujira.oracle.Denom", + encode(message: Denom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Denom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenom(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Denom { + const message = createBaseDenom(); + message.name = object.name ?? ""; + return message; + }, + fromAmino(object: DenomAmino): Denom { + const message = createBaseDenom(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + return message; + }, + toAmino(message: Denom, useInterfaces: boolean = false): DenomAmino { + const obj: any = {}; + obj.name = message.name; + return obj; + }, + fromAminoMsg(object: DenomAminoMsg): Denom { + return Denom.fromAmino(object.value); + }, + fromProtoMsg(message: DenomProtoMsg, useInterfaces: boolean = false): Denom { + return Denom.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Denom): Uint8Array { + return Denom.encode(message).finish(); + }, + toProtoMsg(message: Denom): DenomProtoMsg { + return { + typeUrl: "/kujira.oracle.Denom", + value: Denom.encode(message).finish() + }; + } +}; +function createBaseAggregateExchangeRatePrevote(): AggregateExchangeRatePrevote { + return { + hash: "", + voter: "", + submitBlock: BigInt(0) + }; +} +export const AggregateExchangeRatePrevote = { + typeUrl: "/kujira.oracle.AggregateExchangeRatePrevote", + encode(message: AggregateExchangeRatePrevote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash !== "") { + writer.uint32(10).string(message.hash); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + if (message.submitBlock !== BigInt(0)) { + writer.uint32(24).uint64(message.submitBlock); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): AggregateExchangeRatePrevote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAggregateExchangeRatePrevote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.string(); + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.submitBlock = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AggregateExchangeRatePrevote { + const message = createBaseAggregateExchangeRatePrevote(); + message.hash = object.hash ?? ""; + message.voter = object.voter ?? ""; + message.submitBlock = object.submitBlock !== undefined && object.submitBlock !== null ? BigInt(object.submitBlock.toString()) : BigInt(0); + return message; + }, + fromAmino(object: AggregateExchangeRatePrevoteAmino): AggregateExchangeRatePrevote { + const message = createBaseAggregateExchangeRatePrevote(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.submit_block !== undefined && object.submit_block !== null) { + message.submitBlock = BigInt(object.submit_block); + } + return message; + }, + toAmino(message: AggregateExchangeRatePrevote, useInterfaces: boolean = false): AggregateExchangeRatePrevoteAmino { + const obj: any = {}; + obj.hash = message.hash; + obj.voter = message.voter; + obj.submit_block = message.submitBlock ? message.submitBlock.toString() : undefined; + return obj; + }, + fromAminoMsg(object: AggregateExchangeRatePrevoteAminoMsg): AggregateExchangeRatePrevote { + return AggregateExchangeRatePrevote.fromAmino(object.value); + }, + fromProtoMsg(message: AggregateExchangeRatePrevoteProtoMsg, useInterfaces: boolean = false): AggregateExchangeRatePrevote { + return AggregateExchangeRatePrevote.decode(message.value, undefined, useInterfaces); + }, + toProto(message: AggregateExchangeRatePrevote): Uint8Array { + return AggregateExchangeRatePrevote.encode(message).finish(); + }, + toProtoMsg(message: AggregateExchangeRatePrevote): AggregateExchangeRatePrevoteProtoMsg { + return { + typeUrl: "/kujira.oracle.AggregateExchangeRatePrevote", + value: AggregateExchangeRatePrevote.encode(message).finish() + }; + } +}; +function createBaseAggregateExchangeRateVote(): AggregateExchangeRateVote { + return { + exchangeRateTuples: [], + voter: "" + }; +} +export const AggregateExchangeRateVote = { + typeUrl: "/kujira.oracle.AggregateExchangeRateVote", + encode(message: AggregateExchangeRateVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.exchangeRateTuples) { + ExchangeRateTuple.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): AggregateExchangeRateVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAggregateExchangeRateVote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exchangeRateTuples.push(ExchangeRateTuple.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.voter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AggregateExchangeRateVote { + const message = createBaseAggregateExchangeRateVote(); + message.exchangeRateTuples = object.exchangeRateTuples?.map(e => ExchangeRateTuple.fromPartial(e)) || []; + message.voter = object.voter ?? ""; + return message; + }, + fromAmino(object: AggregateExchangeRateVoteAmino): AggregateExchangeRateVote { + const message = createBaseAggregateExchangeRateVote(); + message.exchangeRateTuples = object.exchange_rate_tuples?.map(e => ExchangeRateTuple.fromAmino(e)) || []; + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + return message; + }, + toAmino(message: AggregateExchangeRateVote, useInterfaces: boolean = false): AggregateExchangeRateVoteAmino { + const obj: any = {}; + if (message.exchangeRateTuples) { + obj.exchange_rate_tuples = message.exchangeRateTuples.map(e => e ? ExchangeRateTuple.toAmino(e, useInterfaces) : undefined); + } else { + obj.exchange_rate_tuples = []; + } + obj.voter = message.voter; + return obj; + }, + fromAminoMsg(object: AggregateExchangeRateVoteAminoMsg): AggregateExchangeRateVote { + return AggregateExchangeRateVote.fromAmino(object.value); + }, + fromProtoMsg(message: AggregateExchangeRateVoteProtoMsg, useInterfaces: boolean = false): AggregateExchangeRateVote { + return AggregateExchangeRateVote.decode(message.value, undefined, useInterfaces); + }, + toProto(message: AggregateExchangeRateVote): Uint8Array { + return AggregateExchangeRateVote.encode(message).finish(); + }, + toProtoMsg(message: AggregateExchangeRateVote): AggregateExchangeRateVoteProtoMsg { + return { + typeUrl: "/kujira.oracle.AggregateExchangeRateVote", + value: AggregateExchangeRateVote.encode(message).finish() + }; + } +}; +function createBaseExchangeRateTuple(): ExchangeRateTuple { + return { + denom: "", + exchangeRate: "" + }; +} +export const ExchangeRateTuple = { + typeUrl: "/kujira.oracle.ExchangeRateTuple", + encode(message: ExchangeRateTuple, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.exchangeRate !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.exchangeRate, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ExchangeRateTuple { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExchangeRateTuple(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.exchangeRate = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ExchangeRateTuple { + const message = createBaseExchangeRateTuple(); + message.denom = object.denom ?? ""; + message.exchangeRate = object.exchangeRate ?? ""; + return message; + }, + fromAmino(object: ExchangeRateTupleAmino): ExchangeRateTuple { + const message = createBaseExchangeRateTuple(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.exchange_rate !== undefined && object.exchange_rate !== null) { + message.exchangeRate = object.exchange_rate; + } + return message; + }, + toAmino(message: ExchangeRateTuple, useInterfaces: boolean = false): ExchangeRateTupleAmino { + const obj: any = {}; + obj.denom = message.denom; + obj.exchange_rate = message.exchangeRate; + return obj; + }, + fromAminoMsg(object: ExchangeRateTupleAminoMsg): ExchangeRateTuple { + return ExchangeRateTuple.fromAmino(object.value); + }, + fromProtoMsg(message: ExchangeRateTupleProtoMsg, useInterfaces: boolean = false): ExchangeRateTuple { + return ExchangeRateTuple.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ExchangeRateTuple): Uint8Array { + return ExchangeRateTuple.encode(message).finish(); + }, + toProtoMsg(message: ExchangeRateTuple): ExchangeRateTupleProtoMsg { + return { + typeUrl: "/kujira.oracle.ExchangeRateTuple", + value: ExchangeRateTuple.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/oracle/query.rpc.Query.ts b/packages/types/protobuf/codegen/kujira/oracle/query.rpc.Query.ts new file mode 100644 index 000000000..824209981 --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/oracle/query.rpc.Query.ts @@ -0,0 +1,129 @@ +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryExchangeRateRequest, QueryExchangeRateResponse, QueryExchangeRatesRequest, QueryExchangeRatesResponse, QueryActivesRequest, QueryActivesResponse, QueryFeederDelegationRequest, QueryFeederDelegationResponse, QueryMissCounterRequest, QueryMissCounterResponse, QueryAggregatePrevoteRequest, QueryAggregatePrevoteResponse, QueryAggregatePrevotesRequest, QueryAggregatePrevotesResponse, QueryAggregateVoteRequest, QueryAggregateVoteResponse, QueryAggregateVotesRequest, QueryAggregateVotesResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** ExchangeRate returns exchange rate of a denom */ + exchangeRate(request: QueryExchangeRateRequest): Promise; + /** ExchangeRates returns exchange rates of all denoms */ + exchangeRates(request?: QueryExchangeRatesRequest): Promise; + /** Actives returns all active denoms */ + actives(request?: QueryActivesRequest): Promise; + /** FeederDelegation returns feeder delegation of a validator */ + feederDelegation(request: QueryFeederDelegationRequest): Promise; + /** MissCounter returns oracle miss counter of a validator */ + missCounter(request: QueryMissCounterRequest): Promise; + /** AggregatePrevote returns an aggregate prevote of a validator */ + aggregatePrevote(request: QueryAggregatePrevoteRequest): Promise; + /** AggregatePrevotes returns aggregate prevotes of all validators */ + aggregatePrevotes(request?: QueryAggregatePrevotesRequest): Promise; + /** AggregateVote returns an aggregate vote of a validator */ + aggregateVote(request: QueryAggregateVoteRequest): Promise; + /** AggregateVotes returns aggregate votes of all validators */ + aggregateVotes(request?: QueryAggregateVotesRequest): Promise; + /** Params queries all parameters. */ + params(request?: QueryParamsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.exchangeRate = this.exchangeRate.bind(this); + this.exchangeRates = this.exchangeRates.bind(this); + this.actives = this.actives.bind(this); + this.feederDelegation = this.feederDelegation.bind(this); + this.missCounter = this.missCounter.bind(this); + this.aggregatePrevote = this.aggregatePrevote.bind(this); + this.aggregatePrevotes = this.aggregatePrevotes.bind(this); + this.aggregateVote = this.aggregateVote.bind(this); + this.aggregateVotes = this.aggregateVotes.bind(this); + this.params = this.params.bind(this); + } + exchangeRate(request: QueryExchangeRateRequest, useInterfaces: boolean = true): Promise { + const data = QueryExchangeRateRequest.encode(request).finish(); + const promise = this.rpc.request("kujira.oracle.Query", "ExchangeRate", data); + return promise.then(data => QueryExchangeRateResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + exchangeRates(request: QueryExchangeRatesRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryExchangeRatesRequest.encode(request).finish(); + const promise = this.rpc.request("kujira.oracle.Query", "ExchangeRates", data); + return promise.then(data => QueryExchangeRatesResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + actives(request: QueryActivesRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryActivesRequest.encode(request).finish(); + const promise = this.rpc.request("kujira.oracle.Query", "Actives", data); + return promise.then(data => QueryActivesResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + feederDelegation(request: QueryFeederDelegationRequest, useInterfaces: boolean = true): Promise { + const data = QueryFeederDelegationRequest.encode(request).finish(); + const promise = this.rpc.request("kujira.oracle.Query", "FeederDelegation", data); + return promise.then(data => QueryFeederDelegationResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + missCounter(request: QueryMissCounterRequest, useInterfaces: boolean = true): Promise { + const data = QueryMissCounterRequest.encode(request).finish(); + const promise = this.rpc.request("kujira.oracle.Query", "MissCounter", data); + return promise.then(data => QueryMissCounterResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + aggregatePrevote(request: QueryAggregatePrevoteRequest, useInterfaces: boolean = true): Promise { + const data = QueryAggregatePrevoteRequest.encode(request).finish(); + const promise = this.rpc.request("kujira.oracle.Query", "AggregatePrevote", data); + return promise.then(data => QueryAggregatePrevoteResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + aggregatePrevotes(request: QueryAggregatePrevotesRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryAggregatePrevotesRequest.encode(request).finish(); + const promise = this.rpc.request("kujira.oracle.Query", "AggregatePrevotes", data); + return promise.then(data => QueryAggregatePrevotesResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + aggregateVote(request: QueryAggregateVoteRequest, useInterfaces: boolean = true): Promise { + const data = QueryAggregateVoteRequest.encode(request).finish(); + const promise = this.rpc.request("kujira.oracle.Query", "AggregateVote", data); + return promise.then(data => QueryAggregateVoteResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + aggregateVotes(request: QueryAggregateVotesRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryAggregateVotesRequest.encode(request).finish(); + const promise = this.rpc.request("kujira.oracle.Query", "AggregateVotes", data); + return promise.then(data => QueryAggregateVotesResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + params(request: QueryParamsRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("kujira.oracle.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + exchangeRate(request: QueryExchangeRateRequest, useInterfaces: boolean = true): Promise { + return queryService.exchangeRate(request, useInterfaces); + }, + exchangeRates(request?: QueryExchangeRatesRequest, useInterfaces: boolean = true): Promise { + return queryService.exchangeRates(request, useInterfaces); + }, + actives(request?: QueryActivesRequest, useInterfaces: boolean = true): Promise { + return queryService.actives(request, useInterfaces); + }, + feederDelegation(request: QueryFeederDelegationRequest, useInterfaces: boolean = true): Promise { + return queryService.feederDelegation(request, useInterfaces); + }, + missCounter(request: QueryMissCounterRequest, useInterfaces: boolean = true): Promise { + return queryService.missCounter(request, useInterfaces); + }, + aggregatePrevote(request: QueryAggregatePrevoteRequest, useInterfaces: boolean = true): Promise { + return queryService.aggregatePrevote(request, useInterfaces); + }, + aggregatePrevotes(request?: QueryAggregatePrevotesRequest, useInterfaces: boolean = true): Promise { + return queryService.aggregatePrevotes(request, useInterfaces); + }, + aggregateVote(request: QueryAggregateVoteRequest, useInterfaces: boolean = true): Promise { + return queryService.aggregateVote(request, useInterfaces); + }, + aggregateVotes(request?: QueryAggregateVotesRequest, useInterfaces: boolean = true): Promise { + return queryService.aggregateVotes(request, useInterfaces); + }, + params(request?: QueryParamsRequest, useInterfaces: boolean = true): Promise { + return queryService.params(request, useInterfaces); + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/oracle/query.ts b/packages/types/protobuf/codegen/kujira/oracle/query.ts new file mode 100644 index 000000000..47da3981c --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/oracle/query.ts @@ -0,0 +1,1855 @@ +//@ts-nocheck +import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../cosmos/base/v1beta1/coin"; +import { AggregateExchangeRatePrevote, AggregateExchangeRatePrevoteAmino, AggregateExchangeRatePrevoteSDKType, AggregateExchangeRateVote, AggregateExchangeRateVoteAmino, AggregateExchangeRateVoteSDKType, Params, ParamsAmino, ParamsSDKType } from "./oracle"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { Decimal } from "@cosmjs/math"; +/** QueryExchangeRateRequest is the request type for the Query/ExchangeRate RPC method. */ +export interface QueryExchangeRateRequest { + /** denom defines the denomination to query for. */ + denom: string; +} +export interface QueryExchangeRateRequestProtoMsg { + typeUrl: "/kujira.oracle.QueryExchangeRateRequest"; + value: Uint8Array; +} +/** QueryExchangeRateRequest is the request type for the Query/ExchangeRate RPC method. */ +export interface QueryExchangeRateRequestAmino { + /** denom defines the denomination to query for. */ + denom?: string; +} +export interface QueryExchangeRateRequestAminoMsg { + type: "/kujira.oracle.QueryExchangeRateRequest"; + value: QueryExchangeRateRequestAmino; +} +/** QueryExchangeRateRequest is the request type for the Query/ExchangeRate RPC method. */ +export interface QueryExchangeRateRequestSDKType { + denom: string; +} +/** + * QueryExchangeRateResponse is response type for the + * Query/ExchangeRate RPC method. + */ +export interface QueryExchangeRateResponse { + /** exchange_rate defines the exchange rate of whitelisted assets */ + exchangeRate: string; +} +export interface QueryExchangeRateResponseProtoMsg { + typeUrl: "/kujira.oracle.QueryExchangeRateResponse"; + value: Uint8Array; +} +/** + * QueryExchangeRateResponse is response type for the + * Query/ExchangeRate RPC method. + */ +export interface QueryExchangeRateResponseAmino { + /** exchange_rate defines the exchange rate of whitelisted assets */ + exchange_rate?: string; +} +export interface QueryExchangeRateResponseAminoMsg { + type: "/kujira.oracle.QueryExchangeRateResponse"; + value: QueryExchangeRateResponseAmino; +} +/** + * QueryExchangeRateResponse is response type for the + * Query/ExchangeRate RPC method. + */ +export interface QueryExchangeRateResponseSDKType { + exchange_rate: string; +} +/** QueryExchangeRatesRequest is the request type for the Query/ExchangeRates RPC method. */ +export interface QueryExchangeRatesRequest {} +export interface QueryExchangeRatesRequestProtoMsg { + typeUrl: "/kujira.oracle.QueryExchangeRatesRequest"; + value: Uint8Array; +} +/** QueryExchangeRatesRequest is the request type for the Query/ExchangeRates RPC method. */ +export interface QueryExchangeRatesRequestAmino {} +export interface QueryExchangeRatesRequestAminoMsg { + type: "/kujira.oracle.QueryExchangeRatesRequest"; + value: QueryExchangeRatesRequestAmino; +} +/** QueryExchangeRatesRequest is the request type for the Query/ExchangeRates RPC method. */ +export interface QueryExchangeRatesRequestSDKType {} +/** + * QueryExchangeRatesResponse is response type for the + * Query/ExchangeRates RPC method. + */ +export interface QueryExchangeRatesResponse { + /** exchange_rates defines a list of the exchange rate for all whitelisted denoms. */ + exchangeRates: DecCoin[]; +} +export interface QueryExchangeRatesResponseProtoMsg { + typeUrl: "/kujira.oracle.QueryExchangeRatesResponse"; + value: Uint8Array; +} +/** + * QueryExchangeRatesResponse is response type for the + * Query/ExchangeRates RPC method. + */ +export interface QueryExchangeRatesResponseAmino { + /** exchange_rates defines a list of the exchange rate for all whitelisted denoms. */ + exchange_rates?: DecCoinAmino[]; +} +export interface QueryExchangeRatesResponseAminoMsg { + type: "/kujira.oracle.QueryExchangeRatesResponse"; + value: QueryExchangeRatesResponseAmino; +} +/** + * QueryExchangeRatesResponse is response type for the + * Query/ExchangeRates RPC method. + */ +export interface QueryExchangeRatesResponseSDKType { + exchange_rates: DecCoinSDKType[]; +} +/** QueryActivesRequest is the request type for the Query/Actives RPC method. */ +export interface QueryActivesRequest {} +export interface QueryActivesRequestProtoMsg { + typeUrl: "/kujira.oracle.QueryActivesRequest"; + value: Uint8Array; +} +/** QueryActivesRequest is the request type for the Query/Actives RPC method. */ +export interface QueryActivesRequestAmino {} +export interface QueryActivesRequestAminoMsg { + type: "/kujira.oracle.QueryActivesRequest"; + value: QueryActivesRequestAmino; +} +/** QueryActivesRequest is the request type for the Query/Actives RPC method. */ +export interface QueryActivesRequestSDKType {} +/** + * QueryActivesResponse is response type for the + * Query/Actives RPC method. + */ +export interface QueryActivesResponse { + /** actives defines a list of the denomination which oracle prices aggreed upon. */ + actives: string[]; +} +export interface QueryActivesResponseProtoMsg { + typeUrl: "/kujira.oracle.QueryActivesResponse"; + value: Uint8Array; +} +/** + * QueryActivesResponse is response type for the + * Query/Actives RPC method. + */ +export interface QueryActivesResponseAmino { + /** actives defines a list of the denomination which oracle prices aggreed upon. */ + actives?: string[]; +} +export interface QueryActivesResponseAminoMsg { + type: "/kujira.oracle.QueryActivesResponse"; + value: QueryActivesResponseAmino; +} +/** + * QueryActivesResponse is response type for the + * Query/Actives RPC method. + */ +export interface QueryActivesResponseSDKType { + actives: string[]; +} +/** QueryVoteTargetsRequest is the request type for the Query/VoteTargets RPC method. */ +export interface QueryVoteTargetsRequest {} +export interface QueryVoteTargetsRequestProtoMsg { + typeUrl: "/kujira.oracle.QueryVoteTargetsRequest"; + value: Uint8Array; +} +/** QueryVoteTargetsRequest is the request type for the Query/VoteTargets RPC method. */ +export interface QueryVoteTargetsRequestAmino {} +export interface QueryVoteTargetsRequestAminoMsg { + type: "/kujira.oracle.QueryVoteTargetsRequest"; + value: QueryVoteTargetsRequestAmino; +} +/** QueryVoteTargetsRequest is the request type for the Query/VoteTargets RPC method. */ +export interface QueryVoteTargetsRequestSDKType {} +/** + * QueryVoteTargetsResponse is response type for the + * Query/VoteTargets RPC method. + */ +export interface QueryVoteTargetsResponse { + /** + * vote_targets defines a list of the denomination in which everyone + * should vote in the current vote period. + */ + voteTargets: string[]; +} +export interface QueryVoteTargetsResponseProtoMsg { + typeUrl: "/kujira.oracle.QueryVoteTargetsResponse"; + value: Uint8Array; +} +/** + * QueryVoteTargetsResponse is response type for the + * Query/VoteTargets RPC method. + */ +export interface QueryVoteTargetsResponseAmino { + /** + * vote_targets defines a list of the denomination in which everyone + * should vote in the current vote period. + */ + vote_targets?: string[]; +} +export interface QueryVoteTargetsResponseAminoMsg { + type: "/kujira.oracle.QueryVoteTargetsResponse"; + value: QueryVoteTargetsResponseAmino; +} +/** + * QueryVoteTargetsResponse is response type for the + * Query/VoteTargets RPC method. + */ +export interface QueryVoteTargetsResponseSDKType { + vote_targets: string[]; +} +/** QueryFeederDelegationRequest is the request type for the Query/FeederDelegation RPC method. */ +export interface QueryFeederDelegationRequest { + /** validator defines the validator address to query for. */ + validatorAddr: string; +} +export interface QueryFeederDelegationRequestProtoMsg { + typeUrl: "/kujira.oracle.QueryFeederDelegationRequest"; + value: Uint8Array; +} +/** QueryFeederDelegationRequest is the request type for the Query/FeederDelegation RPC method. */ +export interface QueryFeederDelegationRequestAmino { + /** validator defines the validator address to query for. */ + validator_addr?: string; +} +export interface QueryFeederDelegationRequestAminoMsg { + type: "/kujira.oracle.QueryFeederDelegationRequest"; + value: QueryFeederDelegationRequestAmino; +} +/** QueryFeederDelegationRequest is the request type for the Query/FeederDelegation RPC method. */ +export interface QueryFeederDelegationRequestSDKType { + validator_addr: string; +} +/** + * QueryFeederDelegationResponse is response type for the + * Query/FeederDelegation RPC method. + */ +export interface QueryFeederDelegationResponse { + /** feeder_addr defines the feeder delegation of a validator */ + feederAddr: string; +} +export interface QueryFeederDelegationResponseProtoMsg { + typeUrl: "/kujira.oracle.QueryFeederDelegationResponse"; + value: Uint8Array; +} +/** + * QueryFeederDelegationResponse is response type for the + * Query/FeederDelegation RPC method. + */ +export interface QueryFeederDelegationResponseAmino { + /** feeder_addr defines the feeder delegation of a validator */ + feeder_addr?: string; +} +export interface QueryFeederDelegationResponseAminoMsg { + type: "/kujira.oracle.QueryFeederDelegationResponse"; + value: QueryFeederDelegationResponseAmino; +} +/** + * QueryFeederDelegationResponse is response type for the + * Query/FeederDelegation RPC method. + */ +export interface QueryFeederDelegationResponseSDKType { + feeder_addr: string; +} +/** QueryMissCounterRequest is the request type for the Query/MissCounter RPC method. */ +export interface QueryMissCounterRequest { + /** validator defines the validator address to query for. */ + validatorAddr: string; +} +export interface QueryMissCounterRequestProtoMsg { + typeUrl: "/kujira.oracle.QueryMissCounterRequest"; + value: Uint8Array; +} +/** QueryMissCounterRequest is the request type for the Query/MissCounter RPC method. */ +export interface QueryMissCounterRequestAmino { + /** validator defines the validator address to query for. */ + validator_addr?: string; +} +export interface QueryMissCounterRequestAminoMsg { + type: "/kujira.oracle.QueryMissCounterRequest"; + value: QueryMissCounterRequestAmino; +} +/** QueryMissCounterRequest is the request type for the Query/MissCounter RPC method. */ +export interface QueryMissCounterRequestSDKType { + validator_addr: string; +} +/** + * QueryMissCounterResponse is response type for the + * Query/MissCounter RPC method. + */ +export interface QueryMissCounterResponse { + /** miss_counter defines the oracle miss counter of a validator */ + missCounter: bigint; +} +export interface QueryMissCounterResponseProtoMsg { + typeUrl: "/kujira.oracle.QueryMissCounterResponse"; + value: Uint8Array; +} +/** + * QueryMissCounterResponse is response type for the + * Query/MissCounter RPC method. + */ +export interface QueryMissCounterResponseAmino { + /** miss_counter defines the oracle miss counter of a validator */ + miss_counter?: string; +} +export interface QueryMissCounterResponseAminoMsg { + type: "/kujira.oracle.QueryMissCounterResponse"; + value: QueryMissCounterResponseAmino; +} +/** + * QueryMissCounterResponse is response type for the + * Query/MissCounter RPC method. + */ +export interface QueryMissCounterResponseSDKType { + miss_counter: bigint; +} +/** QueryAggregatePrevoteRequest is the request type for the Query/AggregatePrevote RPC method. */ +export interface QueryAggregatePrevoteRequest { + /** validator defines the validator address to query for. */ + validatorAddr: string; +} +export interface QueryAggregatePrevoteRequestProtoMsg { + typeUrl: "/kujira.oracle.QueryAggregatePrevoteRequest"; + value: Uint8Array; +} +/** QueryAggregatePrevoteRequest is the request type for the Query/AggregatePrevote RPC method. */ +export interface QueryAggregatePrevoteRequestAmino { + /** validator defines the validator address to query for. */ + validator_addr?: string; +} +export interface QueryAggregatePrevoteRequestAminoMsg { + type: "/kujira.oracle.QueryAggregatePrevoteRequest"; + value: QueryAggregatePrevoteRequestAmino; +} +/** QueryAggregatePrevoteRequest is the request type for the Query/AggregatePrevote RPC method. */ +export interface QueryAggregatePrevoteRequestSDKType { + validator_addr: string; +} +/** + * QueryAggregatePrevoteResponse is response type for the + * Query/AggregatePrevote RPC method. + */ +export interface QueryAggregatePrevoteResponse { + /** aggregate_prevote defines oracle aggregate prevote submitted by a validator in the current vote period */ + aggregatePrevote: AggregateExchangeRatePrevote | undefined; +} +export interface QueryAggregatePrevoteResponseProtoMsg { + typeUrl: "/kujira.oracle.QueryAggregatePrevoteResponse"; + value: Uint8Array; +} +/** + * QueryAggregatePrevoteResponse is response type for the + * Query/AggregatePrevote RPC method. + */ +export interface QueryAggregatePrevoteResponseAmino { + /** aggregate_prevote defines oracle aggregate prevote submitted by a validator in the current vote period */ + aggregate_prevote?: AggregateExchangeRatePrevoteAmino | undefined; +} +export interface QueryAggregatePrevoteResponseAminoMsg { + type: "/kujira.oracle.QueryAggregatePrevoteResponse"; + value: QueryAggregatePrevoteResponseAmino; +} +/** + * QueryAggregatePrevoteResponse is response type for the + * Query/AggregatePrevote RPC method. + */ +export interface QueryAggregatePrevoteResponseSDKType { + aggregate_prevote: AggregateExchangeRatePrevoteSDKType | undefined; +} +/** QueryAggregatePrevotesRequest is the request type for the Query/AggregatePrevotes RPC method. */ +export interface QueryAggregatePrevotesRequest {} +export interface QueryAggregatePrevotesRequestProtoMsg { + typeUrl: "/kujira.oracle.QueryAggregatePrevotesRequest"; + value: Uint8Array; +} +/** QueryAggregatePrevotesRequest is the request type for the Query/AggregatePrevotes RPC method. */ +export interface QueryAggregatePrevotesRequestAmino {} +export interface QueryAggregatePrevotesRequestAminoMsg { + type: "/kujira.oracle.QueryAggregatePrevotesRequest"; + value: QueryAggregatePrevotesRequestAmino; +} +/** QueryAggregatePrevotesRequest is the request type for the Query/AggregatePrevotes RPC method. */ +export interface QueryAggregatePrevotesRequestSDKType {} +/** + * QueryAggregatePrevotesResponse is response type for the + * Query/AggregatePrevotes RPC method. + */ +export interface QueryAggregatePrevotesResponse { + /** aggregate_prevotes defines all oracle aggregate prevotes submitted in the current vote period */ + aggregatePrevotes: AggregateExchangeRatePrevote[]; +} +export interface QueryAggregatePrevotesResponseProtoMsg { + typeUrl: "/kujira.oracle.QueryAggregatePrevotesResponse"; + value: Uint8Array; +} +/** + * QueryAggregatePrevotesResponse is response type for the + * Query/AggregatePrevotes RPC method. + */ +export interface QueryAggregatePrevotesResponseAmino { + /** aggregate_prevotes defines all oracle aggregate prevotes submitted in the current vote period */ + aggregate_prevotes?: AggregateExchangeRatePrevoteAmino[]; +} +export interface QueryAggregatePrevotesResponseAminoMsg { + type: "/kujira.oracle.QueryAggregatePrevotesResponse"; + value: QueryAggregatePrevotesResponseAmino; +} +/** + * QueryAggregatePrevotesResponse is response type for the + * Query/AggregatePrevotes RPC method. + */ +export interface QueryAggregatePrevotesResponseSDKType { + aggregate_prevotes: AggregateExchangeRatePrevoteSDKType[]; +} +/** QueryAggregateVoteRequest is the request type for the Query/AggregateVote RPC method. */ +export interface QueryAggregateVoteRequest { + /** validator defines the validator address to query for. */ + validatorAddr: string; +} +export interface QueryAggregateVoteRequestProtoMsg { + typeUrl: "/kujira.oracle.QueryAggregateVoteRequest"; + value: Uint8Array; +} +/** QueryAggregateVoteRequest is the request type for the Query/AggregateVote RPC method. */ +export interface QueryAggregateVoteRequestAmino { + /** validator defines the validator address to query for. */ + validator_addr?: string; +} +export interface QueryAggregateVoteRequestAminoMsg { + type: "/kujira.oracle.QueryAggregateVoteRequest"; + value: QueryAggregateVoteRequestAmino; +} +/** QueryAggregateVoteRequest is the request type for the Query/AggregateVote RPC method. */ +export interface QueryAggregateVoteRequestSDKType { + validator_addr: string; +} +/** + * QueryAggregateVoteResponse is response type for the + * Query/AggregateVote RPC method. + */ +export interface QueryAggregateVoteResponse { + /** aggregate_vote defines oracle aggregate vote submitted by a validator in the current vote period */ + aggregateVote: AggregateExchangeRateVote | undefined; +} +export interface QueryAggregateVoteResponseProtoMsg { + typeUrl: "/kujira.oracle.QueryAggregateVoteResponse"; + value: Uint8Array; +} +/** + * QueryAggregateVoteResponse is response type for the + * Query/AggregateVote RPC method. + */ +export interface QueryAggregateVoteResponseAmino { + /** aggregate_vote defines oracle aggregate vote submitted by a validator in the current vote period */ + aggregate_vote?: AggregateExchangeRateVoteAmino | undefined; +} +export interface QueryAggregateVoteResponseAminoMsg { + type: "/kujira.oracle.QueryAggregateVoteResponse"; + value: QueryAggregateVoteResponseAmino; +} +/** + * QueryAggregateVoteResponse is response type for the + * Query/AggregateVote RPC method. + */ +export interface QueryAggregateVoteResponseSDKType { + aggregate_vote: AggregateExchangeRateVoteSDKType | undefined; +} +/** QueryAggregateVotesRequest is the request type for the Query/AggregateVotes RPC method. */ +export interface QueryAggregateVotesRequest {} +export interface QueryAggregateVotesRequestProtoMsg { + typeUrl: "/kujira.oracle.QueryAggregateVotesRequest"; + value: Uint8Array; +} +/** QueryAggregateVotesRequest is the request type for the Query/AggregateVotes RPC method. */ +export interface QueryAggregateVotesRequestAmino {} +export interface QueryAggregateVotesRequestAminoMsg { + type: "/kujira.oracle.QueryAggregateVotesRequest"; + value: QueryAggregateVotesRequestAmino; +} +/** QueryAggregateVotesRequest is the request type for the Query/AggregateVotes RPC method. */ +export interface QueryAggregateVotesRequestSDKType {} +/** + * QueryAggregateVotesResponse is response type for the + * Query/AggregateVotes RPC method. + */ +export interface QueryAggregateVotesResponse { + /** aggregate_votes defines all oracle aggregate votes submitted in the current vote period */ + aggregateVotes: AggregateExchangeRateVote[]; +} +export interface QueryAggregateVotesResponseProtoMsg { + typeUrl: "/kujira.oracle.QueryAggregateVotesResponse"; + value: Uint8Array; +} +/** + * QueryAggregateVotesResponse is response type for the + * Query/AggregateVotes RPC method. + */ +export interface QueryAggregateVotesResponseAmino { + /** aggregate_votes defines all oracle aggregate votes submitted in the current vote period */ + aggregate_votes?: AggregateExchangeRateVoteAmino[]; +} +export interface QueryAggregateVotesResponseAminoMsg { + type: "/kujira.oracle.QueryAggregateVotesResponse"; + value: QueryAggregateVotesResponseAmino; +} +/** + * QueryAggregateVotesResponse is response type for the + * Query/AggregateVotes RPC method. + */ +export interface QueryAggregateVotesResponseSDKType { + aggregate_votes: AggregateExchangeRateVoteSDKType[]; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/kujira.oracle.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/kujira.oracle.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params defines the parameters of the module. */ + params: Params | undefined; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/kujira.oracle.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** params defines the parameters of the module. */ + params?: ParamsAmino | undefined; +} +export interface QueryParamsResponseAminoMsg { + type: "/kujira.oracle.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType | undefined; +} +function createBaseQueryExchangeRateRequest(): QueryExchangeRateRequest { + return { + denom: "" + }; +} +export const QueryExchangeRateRequest = { + typeUrl: "/kujira.oracle.QueryExchangeRateRequest", + encode(message: QueryExchangeRateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryExchangeRateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryExchangeRateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryExchangeRateRequest { + const message = createBaseQueryExchangeRateRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryExchangeRateRequestAmino): QueryExchangeRateRequest { + const message = createBaseQueryExchangeRateRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryExchangeRateRequest, useInterfaces: boolean = false): QueryExchangeRateRequestAmino { + const obj: any = {}; + obj.denom = message.denom; + return obj; + }, + fromAminoMsg(object: QueryExchangeRateRequestAminoMsg): QueryExchangeRateRequest { + return QueryExchangeRateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryExchangeRateRequestProtoMsg, useInterfaces: boolean = false): QueryExchangeRateRequest { + return QueryExchangeRateRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryExchangeRateRequest): Uint8Array { + return QueryExchangeRateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryExchangeRateRequest): QueryExchangeRateRequestProtoMsg { + return { + typeUrl: "/kujira.oracle.QueryExchangeRateRequest", + value: QueryExchangeRateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryExchangeRateResponse(): QueryExchangeRateResponse { + return { + exchangeRate: "" + }; +} +export const QueryExchangeRateResponse = { + typeUrl: "/kujira.oracle.QueryExchangeRateResponse", + encode(message: QueryExchangeRateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.exchangeRate !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.exchangeRate, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryExchangeRateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryExchangeRateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exchangeRate = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryExchangeRateResponse { + const message = createBaseQueryExchangeRateResponse(); + message.exchangeRate = object.exchangeRate ?? ""; + return message; + }, + fromAmino(object: QueryExchangeRateResponseAmino): QueryExchangeRateResponse { + const message = createBaseQueryExchangeRateResponse(); + if (object.exchange_rate !== undefined && object.exchange_rate !== null) { + message.exchangeRate = object.exchange_rate; + } + return message; + }, + toAmino(message: QueryExchangeRateResponse, useInterfaces: boolean = false): QueryExchangeRateResponseAmino { + const obj: any = {}; + obj.exchange_rate = message.exchangeRate; + return obj; + }, + fromAminoMsg(object: QueryExchangeRateResponseAminoMsg): QueryExchangeRateResponse { + return QueryExchangeRateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryExchangeRateResponseProtoMsg, useInterfaces: boolean = false): QueryExchangeRateResponse { + return QueryExchangeRateResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryExchangeRateResponse): Uint8Array { + return QueryExchangeRateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryExchangeRateResponse): QueryExchangeRateResponseProtoMsg { + return { + typeUrl: "/kujira.oracle.QueryExchangeRateResponse", + value: QueryExchangeRateResponse.encode(message).finish() + }; + } +}; +function createBaseQueryExchangeRatesRequest(): QueryExchangeRatesRequest { + return {}; +} +export const QueryExchangeRatesRequest = { + typeUrl: "/kujira.oracle.QueryExchangeRatesRequest", + encode(_: QueryExchangeRatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryExchangeRatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryExchangeRatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryExchangeRatesRequest { + const message = createBaseQueryExchangeRatesRequest(); + return message; + }, + fromAmino(_: QueryExchangeRatesRequestAmino): QueryExchangeRatesRequest { + const message = createBaseQueryExchangeRatesRequest(); + return message; + }, + toAmino(_: QueryExchangeRatesRequest, useInterfaces: boolean = false): QueryExchangeRatesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryExchangeRatesRequestAminoMsg): QueryExchangeRatesRequest { + return QueryExchangeRatesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryExchangeRatesRequestProtoMsg, useInterfaces: boolean = false): QueryExchangeRatesRequest { + return QueryExchangeRatesRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryExchangeRatesRequest): Uint8Array { + return QueryExchangeRatesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryExchangeRatesRequest): QueryExchangeRatesRequestProtoMsg { + return { + typeUrl: "/kujira.oracle.QueryExchangeRatesRequest", + value: QueryExchangeRatesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryExchangeRatesResponse(): QueryExchangeRatesResponse { + return { + exchangeRates: [] + }; +} +export const QueryExchangeRatesResponse = { + typeUrl: "/kujira.oracle.QueryExchangeRatesResponse", + encode(message: QueryExchangeRatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.exchangeRates) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryExchangeRatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryExchangeRatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exchangeRates.push(DecCoin.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryExchangeRatesResponse { + const message = createBaseQueryExchangeRatesResponse(); + message.exchangeRates = object.exchangeRates?.map(e => DecCoin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryExchangeRatesResponseAmino): QueryExchangeRatesResponse { + const message = createBaseQueryExchangeRatesResponse(); + message.exchangeRates = object.exchange_rates?.map(e => DecCoin.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryExchangeRatesResponse, useInterfaces: boolean = false): QueryExchangeRatesResponseAmino { + const obj: any = {}; + if (message.exchangeRates) { + obj.exchange_rates = message.exchangeRates.map(e => e ? DecCoin.toAmino(e, useInterfaces) : undefined); + } else { + obj.exchange_rates = []; + } + return obj; + }, + fromAminoMsg(object: QueryExchangeRatesResponseAminoMsg): QueryExchangeRatesResponse { + return QueryExchangeRatesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryExchangeRatesResponseProtoMsg, useInterfaces: boolean = false): QueryExchangeRatesResponse { + return QueryExchangeRatesResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryExchangeRatesResponse): Uint8Array { + return QueryExchangeRatesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryExchangeRatesResponse): QueryExchangeRatesResponseProtoMsg { + return { + typeUrl: "/kujira.oracle.QueryExchangeRatesResponse", + value: QueryExchangeRatesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryActivesRequest(): QueryActivesRequest { + return {}; +} +export const QueryActivesRequest = { + typeUrl: "/kujira.oracle.QueryActivesRequest", + encode(_: QueryActivesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryActivesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryActivesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryActivesRequest { + const message = createBaseQueryActivesRequest(); + return message; + }, + fromAmino(_: QueryActivesRequestAmino): QueryActivesRequest { + const message = createBaseQueryActivesRequest(); + return message; + }, + toAmino(_: QueryActivesRequest, useInterfaces: boolean = false): QueryActivesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryActivesRequestAminoMsg): QueryActivesRequest { + return QueryActivesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryActivesRequestProtoMsg, useInterfaces: boolean = false): QueryActivesRequest { + return QueryActivesRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryActivesRequest): Uint8Array { + return QueryActivesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryActivesRequest): QueryActivesRequestProtoMsg { + return { + typeUrl: "/kujira.oracle.QueryActivesRequest", + value: QueryActivesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryActivesResponse(): QueryActivesResponse { + return { + actives: [] + }; +} +export const QueryActivesResponse = { + typeUrl: "/kujira.oracle.QueryActivesResponse", + encode(message: QueryActivesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.actives) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryActivesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryActivesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.actives.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryActivesResponse { + const message = createBaseQueryActivesResponse(); + message.actives = object.actives?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryActivesResponseAmino): QueryActivesResponse { + const message = createBaseQueryActivesResponse(); + message.actives = object.actives?.map(e => e) || []; + return message; + }, + toAmino(message: QueryActivesResponse, useInterfaces: boolean = false): QueryActivesResponseAmino { + const obj: any = {}; + if (message.actives) { + obj.actives = message.actives.map(e => e); + } else { + obj.actives = []; + } + return obj; + }, + fromAminoMsg(object: QueryActivesResponseAminoMsg): QueryActivesResponse { + return QueryActivesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryActivesResponseProtoMsg, useInterfaces: boolean = false): QueryActivesResponse { + return QueryActivesResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryActivesResponse): Uint8Array { + return QueryActivesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryActivesResponse): QueryActivesResponseProtoMsg { + return { + typeUrl: "/kujira.oracle.QueryActivesResponse", + value: QueryActivesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryVoteTargetsRequest(): QueryVoteTargetsRequest { + return {}; +} +export const QueryVoteTargetsRequest = { + typeUrl: "/kujira.oracle.QueryVoteTargetsRequest", + encode(_: QueryVoteTargetsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryVoteTargetsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVoteTargetsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryVoteTargetsRequest { + const message = createBaseQueryVoteTargetsRequest(); + return message; + }, + fromAmino(_: QueryVoteTargetsRequestAmino): QueryVoteTargetsRequest { + const message = createBaseQueryVoteTargetsRequest(); + return message; + }, + toAmino(_: QueryVoteTargetsRequest, useInterfaces: boolean = false): QueryVoteTargetsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryVoteTargetsRequestAminoMsg): QueryVoteTargetsRequest { + return QueryVoteTargetsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryVoteTargetsRequestProtoMsg, useInterfaces: boolean = false): QueryVoteTargetsRequest { + return QueryVoteTargetsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryVoteTargetsRequest): Uint8Array { + return QueryVoteTargetsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryVoteTargetsRequest): QueryVoteTargetsRequestProtoMsg { + return { + typeUrl: "/kujira.oracle.QueryVoteTargetsRequest", + value: QueryVoteTargetsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryVoteTargetsResponse(): QueryVoteTargetsResponse { + return { + voteTargets: [] + }; +} +export const QueryVoteTargetsResponse = { + typeUrl: "/kujira.oracle.QueryVoteTargetsResponse", + encode(message: QueryVoteTargetsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.voteTargets) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryVoteTargetsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVoteTargetsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.voteTargets.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVoteTargetsResponse { + const message = createBaseQueryVoteTargetsResponse(); + message.voteTargets = object.voteTargets?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryVoteTargetsResponseAmino): QueryVoteTargetsResponse { + const message = createBaseQueryVoteTargetsResponse(); + message.voteTargets = object.vote_targets?.map(e => e) || []; + return message; + }, + toAmino(message: QueryVoteTargetsResponse, useInterfaces: boolean = false): QueryVoteTargetsResponseAmino { + const obj: any = {}; + if (message.voteTargets) { + obj.vote_targets = message.voteTargets.map(e => e); + } else { + obj.vote_targets = []; + } + return obj; + }, + fromAminoMsg(object: QueryVoteTargetsResponseAminoMsg): QueryVoteTargetsResponse { + return QueryVoteTargetsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryVoteTargetsResponseProtoMsg, useInterfaces: boolean = false): QueryVoteTargetsResponse { + return QueryVoteTargetsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryVoteTargetsResponse): Uint8Array { + return QueryVoteTargetsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryVoteTargetsResponse): QueryVoteTargetsResponseProtoMsg { + return { + typeUrl: "/kujira.oracle.QueryVoteTargetsResponse", + value: QueryVoteTargetsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryFeederDelegationRequest(): QueryFeederDelegationRequest { + return { + validatorAddr: "" + }; +} +export const QueryFeederDelegationRequest = { + typeUrl: "/kujira.oracle.QueryFeederDelegationRequest", + encode(message: QueryFeederDelegationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddr !== "") { + writer.uint32(10).string(message.validatorAddr); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryFeederDelegationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeederDelegationRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryFeederDelegationRequest { + const message = createBaseQueryFeederDelegationRequest(); + message.validatorAddr = object.validatorAddr ?? ""; + return message; + }, + fromAmino(object: QueryFeederDelegationRequestAmino): QueryFeederDelegationRequest { + const message = createBaseQueryFeederDelegationRequest(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; + }, + toAmino(message: QueryFeederDelegationRequest, useInterfaces: boolean = false): QueryFeederDelegationRequestAmino { + const obj: any = {}; + obj.validator_addr = message.validatorAddr; + return obj; + }, + fromAminoMsg(object: QueryFeederDelegationRequestAminoMsg): QueryFeederDelegationRequest { + return QueryFeederDelegationRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFeederDelegationRequestProtoMsg, useInterfaces: boolean = false): QueryFeederDelegationRequest { + return QueryFeederDelegationRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryFeederDelegationRequest): Uint8Array { + return QueryFeederDelegationRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryFeederDelegationRequest): QueryFeederDelegationRequestProtoMsg { + return { + typeUrl: "/kujira.oracle.QueryFeederDelegationRequest", + value: QueryFeederDelegationRequest.encode(message).finish() + }; + } +}; +function createBaseQueryFeederDelegationResponse(): QueryFeederDelegationResponse { + return { + feederAddr: "" + }; +} +export const QueryFeederDelegationResponse = { + typeUrl: "/kujira.oracle.QueryFeederDelegationResponse", + encode(message: QueryFeederDelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.feederAddr !== "") { + writer.uint32(10).string(message.feederAddr); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryFeederDelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFeederDelegationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.feederAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryFeederDelegationResponse { + const message = createBaseQueryFeederDelegationResponse(); + message.feederAddr = object.feederAddr ?? ""; + return message; + }, + fromAmino(object: QueryFeederDelegationResponseAmino): QueryFeederDelegationResponse { + const message = createBaseQueryFeederDelegationResponse(); + if (object.feeder_addr !== undefined && object.feeder_addr !== null) { + message.feederAddr = object.feeder_addr; + } + return message; + }, + toAmino(message: QueryFeederDelegationResponse, useInterfaces: boolean = false): QueryFeederDelegationResponseAmino { + const obj: any = {}; + obj.feeder_addr = message.feederAddr; + return obj; + }, + fromAminoMsg(object: QueryFeederDelegationResponseAminoMsg): QueryFeederDelegationResponse { + return QueryFeederDelegationResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFeederDelegationResponseProtoMsg, useInterfaces: boolean = false): QueryFeederDelegationResponse { + return QueryFeederDelegationResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryFeederDelegationResponse): Uint8Array { + return QueryFeederDelegationResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryFeederDelegationResponse): QueryFeederDelegationResponseProtoMsg { + return { + typeUrl: "/kujira.oracle.QueryFeederDelegationResponse", + value: QueryFeederDelegationResponse.encode(message).finish() + }; + } +}; +function createBaseQueryMissCounterRequest(): QueryMissCounterRequest { + return { + validatorAddr: "" + }; +} +export const QueryMissCounterRequest = { + typeUrl: "/kujira.oracle.QueryMissCounterRequest", + encode(message: QueryMissCounterRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddr !== "") { + writer.uint32(10).string(message.validatorAddr); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryMissCounterRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMissCounterRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryMissCounterRequest { + const message = createBaseQueryMissCounterRequest(); + message.validatorAddr = object.validatorAddr ?? ""; + return message; + }, + fromAmino(object: QueryMissCounterRequestAmino): QueryMissCounterRequest { + const message = createBaseQueryMissCounterRequest(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; + }, + toAmino(message: QueryMissCounterRequest, useInterfaces: boolean = false): QueryMissCounterRequestAmino { + const obj: any = {}; + obj.validator_addr = message.validatorAddr; + return obj; + }, + fromAminoMsg(object: QueryMissCounterRequestAminoMsg): QueryMissCounterRequest { + return QueryMissCounterRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMissCounterRequestProtoMsg, useInterfaces: boolean = false): QueryMissCounterRequest { + return QueryMissCounterRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryMissCounterRequest): Uint8Array { + return QueryMissCounterRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryMissCounterRequest): QueryMissCounterRequestProtoMsg { + return { + typeUrl: "/kujira.oracle.QueryMissCounterRequest", + value: QueryMissCounterRequest.encode(message).finish() + }; + } +}; +function createBaseQueryMissCounterResponse(): QueryMissCounterResponse { + return { + missCounter: BigInt(0) + }; +} +export const QueryMissCounterResponse = { + typeUrl: "/kujira.oracle.QueryMissCounterResponse", + encode(message: QueryMissCounterResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.missCounter !== BigInt(0)) { + writer.uint32(8).uint64(message.missCounter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryMissCounterResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMissCounterResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.missCounter = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryMissCounterResponse { + const message = createBaseQueryMissCounterResponse(); + message.missCounter = object.missCounter !== undefined && object.missCounter !== null ? BigInt(object.missCounter.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryMissCounterResponseAmino): QueryMissCounterResponse { + const message = createBaseQueryMissCounterResponse(); + if (object.miss_counter !== undefined && object.miss_counter !== null) { + message.missCounter = BigInt(object.miss_counter); + } + return message; + }, + toAmino(message: QueryMissCounterResponse, useInterfaces: boolean = false): QueryMissCounterResponseAmino { + const obj: any = {}; + obj.miss_counter = message.missCounter ? message.missCounter.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryMissCounterResponseAminoMsg): QueryMissCounterResponse { + return QueryMissCounterResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryMissCounterResponseProtoMsg, useInterfaces: boolean = false): QueryMissCounterResponse { + return QueryMissCounterResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryMissCounterResponse): Uint8Array { + return QueryMissCounterResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryMissCounterResponse): QueryMissCounterResponseProtoMsg { + return { + typeUrl: "/kujira.oracle.QueryMissCounterResponse", + value: QueryMissCounterResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAggregatePrevoteRequest(): QueryAggregatePrevoteRequest { + return { + validatorAddr: "" + }; +} +export const QueryAggregatePrevoteRequest = { + typeUrl: "/kujira.oracle.QueryAggregatePrevoteRequest", + encode(message: QueryAggregatePrevoteRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddr !== "") { + writer.uint32(10).string(message.validatorAddr); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAggregatePrevoteRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregatePrevoteRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAggregatePrevoteRequest { + const message = createBaseQueryAggregatePrevoteRequest(); + message.validatorAddr = object.validatorAddr ?? ""; + return message; + }, + fromAmino(object: QueryAggregatePrevoteRequestAmino): QueryAggregatePrevoteRequest { + const message = createBaseQueryAggregatePrevoteRequest(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; + }, + toAmino(message: QueryAggregatePrevoteRequest, useInterfaces: boolean = false): QueryAggregatePrevoteRequestAmino { + const obj: any = {}; + obj.validator_addr = message.validatorAddr; + return obj; + }, + fromAminoMsg(object: QueryAggregatePrevoteRequestAminoMsg): QueryAggregatePrevoteRequest { + return QueryAggregatePrevoteRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregatePrevoteRequestProtoMsg, useInterfaces: boolean = false): QueryAggregatePrevoteRequest { + return QueryAggregatePrevoteRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAggregatePrevoteRequest): Uint8Array { + return QueryAggregatePrevoteRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregatePrevoteRequest): QueryAggregatePrevoteRequestProtoMsg { + return { + typeUrl: "/kujira.oracle.QueryAggregatePrevoteRequest", + value: QueryAggregatePrevoteRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAggregatePrevoteResponse(): QueryAggregatePrevoteResponse { + return { + aggregatePrevote: AggregateExchangeRatePrevote.fromPartial({}) + }; +} +export const QueryAggregatePrevoteResponse = { + typeUrl: "/kujira.oracle.QueryAggregatePrevoteResponse", + encode(message: QueryAggregatePrevoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.aggregatePrevote !== undefined) { + AggregateExchangeRatePrevote.encode(message.aggregatePrevote, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAggregatePrevoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregatePrevoteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aggregatePrevote = AggregateExchangeRatePrevote.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAggregatePrevoteResponse { + const message = createBaseQueryAggregatePrevoteResponse(); + message.aggregatePrevote = object.aggregatePrevote !== undefined && object.aggregatePrevote !== null ? AggregateExchangeRatePrevote.fromPartial(object.aggregatePrevote) : undefined; + return message; + }, + fromAmino(object: QueryAggregatePrevoteResponseAmino): QueryAggregatePrevoteResponse { + const message = createBaseQueryAggregatePrevoteResponse(); + if (object.aggregate_prevote !== undefined && object.aggregate_prevote !== null) { + message.aggregatePrevote = AggregateExchangeRatePrevote.fromAmino(object.aggregate_prevote); + } + return message; + }, + toAmino(message: QueryAggregatePrevoteResponse, useInterfaces: boolean = false): QueryAggregatePrevoteResponseAmino { + const obj: any = {}; + obj.aggregate_prevote = message.aggregatePrevote ? AggregateExchangeRatePrevote.toAmino(message.aggregatePrevote, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAggregatePrevoteResponseAminoMsg): QueryAggregatePrevoteResponse { + return QueryAggregatePrevoteResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregatePrevoteResponseProtoMsg, useInterfaces: boolean = false): QueryAggregatePrevoteResponse { + return QueryAggregatePrevoteResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAggregatePrevoteResponse): Uint8Array { + return QueryAggregatePrevoteResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregatePrevoteResponse): QueryAggregatePrevoteResponseProtoMsg { + return { + typeUrl: "/kujira.oracle.QueryAggregatePrevoteResponse", + value: QueryAggregatePrevoteResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAggregatePrevotesRequest(): QueryAggregatePrevotesRequest { + return {}; +} +export const QueryAggregatePrevotesRequest = { + typeUrl: "/kujira.oracle.QueryAggregatePrevotesRequest", + encode(_: QueryAggregatePrevotesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAggregatePrevotesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregatePrevotesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryAggregatePrevotesRequest { + const message = createBaseQueryAggregatePrevotesRequest(); + return message; + }, + fromAmino(_: QueryAggregatePrevotesRequestAmino): QueryAggregatePrevotesRequest { + const message = createBaseQueryAggregatePrevotesRequest(); + return message; + }, + toAmino(_: QueryAggregatePrevotesRequest, useInterfaces: boolean = false): QueryAggregatePrevotesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAggregatePrevotesRequestAminoMsg): QueryAggregatePrevotesRequest { + return QueryAggregatePrevotesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregatePrevotesRequestProtoMsg, useInterfaces: boolean = false): QueryAggregatePrevotesRequest { + return QueryAggregatePrevotesRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAggregatePrevotesRequest): Uint8Array { + return QueryAggregatePrevotesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregatePrevotesRequest): QueryAggregatePrevotesRequestProtoMsg { + return { + typeUrl: "/kujira.oracle.QueryAggregatePrevotesRequest", + value: QueryAggregatePrevotesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAggregatePrevotesResponse(): QueryAggregatePrevotesResponse { + return { + aggregatePrevotes: [] + }; +} +export const QueryAggregatePrevotesResponse = { + typeUrl: "/kujira.oracle.QueryAggregatePrevotesResponse", + encode(message: QueryAggregatePrevotesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.aggregatePrevotes) { + AggregateExchangeRatePrevote.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAggregatePrevotesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregatePrevotesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aggregatePrevotes.push(AggregateExchangeRatePrevote.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAggregatePrevotesResponse { + const message = createBaseQueryAggregatePrevotesResponse(); + message.aggregatePrevotes = object.aggregatePrevotes?.map(e => AggregateExchangeRatePrevote.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryAggregatePrevotesResponseAmino): QueryAggregatePrevotesResponse { + const message = createBaseQueryAggregatePrevotesResponse(); + message.aggregatePrevotes = object.aggregate_prevotes?.map(e => AggregateExchangeRatePrevote.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryAggregatePrevotesResponse, useInterfaces: boolean = false): QueryAggregatePrevotesResponseAmino { + const obj: any = {}; + if (message.aggregatePrevotes) { + obj.aggregate_prevotes = message.aggregatePrevotes.map(e => e ? AggregateExchangeRatePrevote.toAmino(e, useInterfaces) : undefined); + } else { + obj.aggregate_prevotes = []; + } + return obj; + }, + fromAminoMsg(object: QueryAggregatePrevotesResponseAminoMsg): QueryAggregatePrevotesResponse { + return QueryAggregatePrevotesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregatePrevotesResponseProtoMsg, useInterfaces: boolean = false): QueryAggregatePrevotesResponse { + return QueryAggregatePrevotesResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAggregatePrevotesResponse): Uint8Array { + return QueryAggregatePrevotesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregatePrevotesResponse): QueryAggregatePrevotesResponseProtoMsg { + return { + typeUrl: "/kujira.oracle.QueryAggregatePrevotesResponse", + value: QueryAggregatePrevotesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAggregateVoteRequest(): QueryAggregateVoteRequest { + return { + validatorAddr: "" + }; +} +export const QueryAggregateVoteRequest = { + typeUrl: "/kujira.oracle.QueryAggregateVoteRequest", + encode(message: QueryAggregateVoteRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddr !== "") { + writer.uint32(10).string(message.validatorAddr); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAggregateVoteRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregateVoteRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAggregateVoteRequest { + const message = createBaseQueryAggregateVoteRequest(); + message.validatorAddr = object.validatorAddr ?? ""; + return message; + }, + fromAmino(object: QueryAggregateVoteRequestAmino): QueryAggregateVoteRequest { + const message = createBaseQueryAggregateVoteRequest(); + if (object.validator_addr !== undefined && object.validator_addr !== null) { + message.validatorAddr = object.validator_addr; + } + return message; + }, + toAmino(message: QueryAggregateVoteRequest, useInterfaces: boolean = false): QueryAggregateVoteRequestAmino { + const obj: any = {}; + obj.validator_addr = message.validatorAddr; + return obj; + }, + fromAminoMsg(object: QueryAggregateVoteRequestAminoMsg): QueryAggregateVoteRequest { + return QueryAggregateVoteRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregateVoteRequestProtoMsg, useInterfaces: boolean = false): QueryAggregateVoteRequest { + return QueryAggregateVoteRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAggregateVoteRequest): Uint8Array { + return QueryAggregateVoteRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregateVoteRequest): QueryAggregateVoteRequestProtoMsg { + return { + typeUrl: "/kujira.oracle.QueryAggregateVoteRequest", + value: QueryAggregateVoteRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAggregateVoteResponse(): QueryAggregateVoteResponse { + return { + aggregateVote: AggregateExchangeRateVote.fromPartial({}) + }; +} +export const QueryAggregateVoteResponse = { + typeUrl: "/kujira.oracle.QueryAggregateVoteResponse", + encode(message: QueryAggregateVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.aggregateVote !== undefined) { + AggregateExchangeRateVote.encode(message.aggregateVote, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAggregateVoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregateVoteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aggregateVote = AggregateExchangeRateVote.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAggregateVoteResponse { + const message = createBaseQueryAggregateVoteResponse(); + message.aggregateVote = object.aggregateVote !== undefined && object.aggregateVote !== null ? AggregateExchangeRateVote.fromPartial(object.aggregateVote) : undefined; + return message; + }, + fromAmino(object: QueryAggregateVoteResponseAmino): QueryAggregateVoteResponse { + const message = createBaseQueryAggregateVoteResponse(); + if (object.aggregate_vote !== undefined && object.aggregate_vote !== null) { + message.aggregateVote = AggregateExchangeRateVote.fromAmino(object.aggregate_vote); + } + return message; + }, + toAmino(message: QueryAggregateVoteResponse, useInterfaces: boolean = false): QueryAggregateVoteResponseAmino { + const obj: any = {}; + obj.aggregate_vote = message.aggregateVote ? AggregateExchangeRateVote.toAmino(message.aggregateVote, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAggregateVoteResponseAminoMsg): QueryAggregateVoteResponse { + return QueryAggregateVoteResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregateVoteResponseProtoMsg, useInterfaces: boolean = false): QueryAggregateVoteResponse { + return QueryAggregateVoteResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAggregateVoteResponse): Uint8Array { + return QueryAggregateVoteResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregateVoteResponse): QueryAggregateVoteResponseProtoMsg { + return { + typeUrl: "/kujira.oracle.QueryAggregateVoteResponse", + value: QueryAggregateVoteResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAggregateVotesRequest(): QueryAggregateVotesRequest { + return {}; +} +export const QueryAggregateVotesRequest = { + typeUrl: "/kujira.oracle.QueryAggregateVotesRequest", + encode(_: QueryAggregateVotesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAggregateVotesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregateVotesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryAggregateVotesRequest { + const message = createBaseQueryAggregateVotesRequest(); + return message; + }, + fromAmino(_: QueryAggregateVotesRequestAmino): QueryAggregateVotesRequest { + const message = createBaseQueryAggregateVotesRequest(); + return message; + }, + toAmino(_: QueryAggregateVotesRequest, useInterfaces: boolean = false): QueryAggregateVotesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAggregateVotesRequestAminoMsg): QueryAggregateVotesRequest { + return QueryAggregateVotesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregateVotesRequestProtoMsg, useInterfaces: boolean = false): QueryAggregateVotesRequest { + return QueryAggregateVotesRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAggregateVotesRequest): Uint8Array { + return QueryAggregateVotesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregateVotesRequest): QueryAggregateVotesRequestProtoMsg { + return { + typeUrl: "/kujira.oracle.QueryAggregateVotesRequest", + value: QueryAggregateVotesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAggregateVotesResponse(): QueryAggregateVotesResponse { + return { + aggregateVotes: [] + }; +} +export const QueryAggregateVotesResponse = { + typeUrl: "/kujira.oracle.QueryAggregateVotesResponse", + encode(message: QueryAggregateVotesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.aggregateVotes) { + AggregateExchangeRateVote.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAggregateVotesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAggregateVotesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aggregateVotes.push(AggregateExchangeRateVote.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAggregateVotesResponse { + const message = createBaseQueryAggregateVotesResponse(); + message.aggregateVotes = object.aggregateVotes?.map(e => AggregateExchangeRateVote.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryAggregateVotesResponseAmino): QueryAggregateVotesResponse { + const message = createBaseQueryAggregateVotesResponse(); + message.aggregateVotes = object.aggregate_votes?.map(e => AggregateExchangeRateVote.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryAggregateVotesResponse, useInterfaces: boolean = false): QueryAggregateVotesResponseAmino { + const obj: any = {}; + if (message.aggregateVotes) { + obj.aggregate_votes = message.aggregateVotes.map(e => e ? AggregateExchangeRateVote.toAmino(e, useInterfaces) : undefined); + } else { + obj.aggregate_votes = []; + } + return obj; + }, + fromAminoMsg(object: QueryAggregateVotesResponseAminoMsg): QueryAggregateVotesResponse { + return QueryAggregateVotesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAggregateVotesResponseProtoMsg, useInterfaces: boolean = false): QueryAggregateVotesResponse { + return QueryAggregateVotesResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAggregateVotesResponse): Uint8Array { + return QueryAggregateVotesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAggregateVotesResponse): QueryAggregateVotesResponseProtoMsg { + return { + typeUrl: "/kujira.oracle.QueryAggregateVotesResponse", + value: QueryAggregateVotesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/kujira.oracle.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest, useInterfaces: boolean = false): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg, useInterfaces: boolean = false): QueryParamsRequest { + return QueryParamsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/kujira.oracle.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/kujira.oracle.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse, useInterfaces: boolean = false): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg, useInterfaces: boolean = false): QueryParamsResponse { + return QueryParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/kujira.oracle.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/oracle/tx.amino.ts b/packages/types/protobuf/codegen/kujira/oracle/tx.amino.ts new file mode 100644 index 000000000..ed9e380df --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/oracle/tx.amino.ts @@ -0,0 +1,18 @@ +import { MsgAggregateExchangeRatePrevote, MsgAggregateExchangeRateVote, MsgDelegateFeedConsent } from "./tx"; +export const AminoConverter = { + "/kujira.oracle.MsgAggregateExchangeRatePrevote": { + aminoType: "/kujira.oracle.MsgAggregateExchangeRatePrevote", + toAmino: MsgAggregateExchangeRatePrevote.toAmino, + fromAmino: MsgAggregateExchangeRatePrevote.fromAmino + }, + "/kujira.oracle.MsgAggregateExchangeRateVote": { + aminoType: "/kujira.oracle.MsgAggregateExchangeRateVote", + toAmino: MsgAggregateExchangeRateVote.toAmino, + fromAmino: MsgAggregateExchangeRateVote.fromAmino + }, + "/kujira.oracle.MsgDelegateFeedConsent": { + aminoType: "/kujira.oracle.MsgDelegateFeedConsent", + toAmino: MsgDelegateFeedConsent.toAmino, + fromAmino: MsgDelegateFeedConsent.fromAmino + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/oracle/tx.registry.ts b/packages/types/protobuf/codegen/kujira/oracle/tx.registry.ts new file mode 100644 index 000000000..2272047a1 --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/oracle/tx.registry.ts @@ -0,0 +1,71 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgAggregateExchangeRatePrevote, MsgAggregateExchangeRateVote, MsgDelegateFeedConsent } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/kujira.oracle.MsgAggregateExchangeRatePrevote", MsgAggregateExchangeRatePrevote], ["/kujira.oracle.MsgAggregateExchangeRateVote", MsgAggregateExchangeRateVote], ["/kujira.oracle.MsgDelegateFeedConsent", MsgDelegateFeedConsent]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + aggregateExchangeRatePrevote(value: MsgAggregateExchangeRatePrevote) { + return { + typeUrl: "/kujira.oracle.MsgAggregateExchangeRatePrevote", + value: MsgAggregateExchangeRatePrevote.encode(value).finish() + }; + }, + aggregateExchangeRateVote(value: MsgAggregateExchangeRateVote) { + return { + typeUrl: "/kujira.oracle.MsgAggregateExchangeRateVote", + value: MsgAggregateExchangeRateVote.encode(value).finish() + }; + }, + delegateFeedConsent(value: MsgDelegateFeedConsent) { + return { + typeUrl: "/kujira.oracle.MsgDelegateFeedConsent", + value: MsgDelegateFeedConsent.encode(value).finish() + }; + } + }, + withTypeUrl: { + aggregateExchangeRatePrevote(value: MsgAggregateExchangeRatePrevote) { + return { + typeUrl: "/kujira.oracle.MsgAggregateExchangeRatePrevote", + value + }; + }, + aggregateExchangeRateVote(value: MsgAggregateExchangeRateVote) { + return { + typeUrl: "/kujira.oracle.MsgAggregateExchangeRateVote", + value + }; + }, + delegateFeedConsent(value: MsgDelegateFeedConsent) { + return { + typeUrl: "/kujira.oracle.MsgDelegateFeedConsent", + value + }; + } + }, + fromPartial: { + aggregateExchangeRatePrevote(value: MsgAggregateExchangeRatePrevote) { + return { + typeUrl: "/kujira.oracle.MsgAggregateExchangeRatePrevote", + value: MsgAggregateExchangeRatePrevote.fromPartial(value) + }; + }, + aggregateExchangeRateVote(value: MsgAggregateExchangeRateVote) { + return { + typeUrl: "/kujira.oracle.MsgAggregateExchangeRateVote", + value: MsgAggregateExchangeRateVote.fromPartial(value) + }; + }, + delegateFeedConsent(value: MsgDelegateFeedConsent) { + return { + typeUrl: "/kujira.oracle.MsgDelegateFeedConsent", + value: MsgDelegateFeedConsent.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/oracle/tx.rpc.msg.ts b/packages/types/protobuf/codegen/kujira/oracle/tx.rpc.msg.ts new file mode 100644 index 000000000..96ca99054 --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/oracle/tx.rpc.msg.ts @@ -0,0 +1,42 @@ +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { MsgAggregateExchangeRatePrevote, MsgAggregateExchangeRatePrevoteResponse, MsgAggregateExchangeRateVote, MsgAggregateExchangeRateVoteResponse, MsgDelegateFeedConsent, MsgDelegateFeedConsentResponse } from "./tx"; +/** Msg defines the oracle Msg service. */ +export interface Msg { + /** + * AggregateExchangeRatePrevote defines a method for submitting + * aggregate exchange rate prevote + */ + aggregateExchangeRatePrevote(request: MsgAggregateExchangeRatePrevote): Promise; + /** + * AggregateExchangeRateVote defines a method for submitting + * aggregate exchange rate vote + */ + aggregateExchangeRateVote(request: MsgAggregateExchangeRateVote): Promise; + /** DelegateFeedConsent defines a method for setting the feeder delegation */ + delegateFeedConsent(request: MsgDelegateFeedConsent): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.aggregateExchangeRatePrevote = this.aggregateExchangeRatePrevote.bind(this); + this.aggregateExchangeRateVote = this.aggregateExchangeRateVote.bind(this); + this.delegateFeedConsent = this.delegateFeedConsent.bind(this); + } + aggregateExchangeRatePrevote(request: MsgAggregateExchangeRatePrevote, useInterfaces: boolean = true): Promise { + const data = MsgAggregateExchangeRatePrevote.encode(request).finish(); + const promise = this.rpc.request("kujira.oracle.Msg", "AggregateExchangeRatePrevote", data); + return promise.then(data => MsgAggregateExchangeRatePrevoteResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + aggregateExchangeRateVote(request: MsgAggregateExchangeRateVote, useInterfaces: boolean = true): Promise { + const data = MsgAggregateExchangeRateVote.encode(request).finish(); + const promise = this.rpc.request("kujira.oracle.Msg", "AggregateExchangeRateVote", data); + return promise.then(data => MsgAggregateExchangeRateVoteResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + delegateFeedConsent(request: MsgDelegateFeedConsent, useInterfaces: boolean = true): Promise { + const data = MsgDelegateFeedConsent.encode(request).finish(); + const promise = this.rpc.request("kujira.oracle.Msg", "DelegateFeedConsent", data); + return promise.then(data => MsgDelegateFeedConsentResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/oracle/tx.ts b/packages/types/protobuf/codegen/kujira/oracle/tx.ts new file mode 100644 index 000000000..9e861a72a --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/oracle/tx.ts @@ -0,0 +1,560 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * MsgAggregateExchangeRatePrevote represents a message to submit + * aggregate exchange rate prevote. + */ +export interface MsgAggregateExchangeRatePrevote { + hash: string; + feeder: string; + validator: string; +} +export interface MsgAggregateExchangeRatePrevoteProtoMsg { + typeUrl: "/kujira.oracle.MsgAggregateExchangeRatePrevote"; + value: Uint8Array; +} +/** + * MsgAggregateExchangeRatePrevote represents a message to submit + * aggregate exchange rate prevote. + */ +export interface MsgAggregateExchangeRatePrevoteAmino { + hash?: string; + feeder?: string; + validator?: string; +} +export interface MsgAggregateExchangeRatePrevoteAminoMsg { + type: "/kujira.oracle.MsgAggregateExchangeRatePrevote"; + value: MsgAggregateExchangeRatePrevoteAmino; +} +/** + * MsgAggregateExchangeRatePrevote represents a message to submit + * aggregate exchange rate prevote. + */ +export interface MsgAggregateExchangeRatePrevoteSDKType { + hash: string; + feeder: string; + validator: string; +} +/** MsgAggregateExchangeRatePrevoteResponse defines the Msg/AggregateExchangeRatePrevote response type. */ +export interface MsgAggregateExchangeRatePrevoteResponse {} +export interface MsgAggregateExchangeRatePrevoteResponseProtoMsg { + typeUrl: "/kujira.oracle.MsgAggregateExchangeRatePrevoteResponse"; + value: Uint8Array; +} +/** MsgAggregateExchangeRatePrevoteResponse defines the Msg/AggregateExchangeRatePrevote response type. */ +export interface MsgAggregateExchangeRatePrevoteResponseAmino {} +export interface MsgAggregateExchangeRatePrevoteResponseAminoMsg { + type: "/kujira.oracle.MsgAggregateExchangeRatePrevoteResponse"; + value: MsgAggregateExchangeRatePrevoteResponseAmino; +} +/** MsgAggregateExchangeRatePrevoteResponse defines the Msg/AggregateExchangeRatePrevote response type. */ +export interface MsgAggregateExchangeRatePrevoteResponseSDKType {} +/** + * MsgAggregateExchangeRateVote represents a message to submit + * aggregate exchange rate vote. + */ +export interface MsgAggregateExchangeRateVote { + salt: string; + exchangeRates: string; + feeder: string; + validator: string; +} +export interface MsgAggregateExchangeRateVoteProtoMsg { + typeUrl: "/kujira.oracle.MsgAggregateExchangeRateVote"; + value: Uint8Array; +} +/** + * MsgAggregateExchangeRateVote represents a message to submit + * aggregate exchange rate vote. + */ +export interface MsgAggregateExchangeRateVoteAmino { + salt?: string; + exchange_rates?: string; + feeder?: string; + validator?: string; +} +export interface MsgAggregateExchangeRateVoteAminoMsg { + type: "/kujira.oracle.MsgAggregateExchangeRateVote"; + value: MsgAggregateExchangeRateVoteAmino; +} +/** + * MsgAggregateExchangeRateVote represents a message to submit + * aggregate exchange rate vote. + */ +export interface MsgAggregateExchangeRateVoteSDKType { + salt: string; + exchange_rates: string; + feeder: string; + validator: string; +} +/** MsgAggregateExchangeRateVoteResponse defines the Msg/AggregateExchangeRateVote response type. */ +export interface MsgAggregateExchangeRateVoteResponse {} +export interface MsgAggregateExchangeRateVoteResponseProtoMsg { + typeUrl: "/kujira.oracle.MsgAggregateExchangeRateVoteResponse"; + value: Uint8Array; +} +/** MsgAggregateExchangeRateVoteResponse defines the Msg/AggregateExchangeRateVote response type. */ +export interface MsgAggregateExchangeRateVoteResponseAmino {} +export interface MsgAggregateExchangeRateVoteResponseAminoMsg { + type: "/kujira.oracle.MsgAggregateExchangeRateVoteResponse"; + value: MsgAggregateExchangeRateVoteResponseAmino; +} +/** MsgAggregateExchangeRateVoteResponse defines the Msg/AggregateExchangeRateVote response type. */ +export interface MsgAggregateExchangeRateVoteResponseSDKType {} +/** + * MsgDelegateFeedConsent represents a message to + * delegate oracle voting rights to another address. + */ +export interface MsgDelegateFeedConsent { + operator: string; + delegate: string; +} +export interface MsgDelegateFeedConsentProtoMsg { + typeUrl: "/kujira.oracle.MsgDelegateFeedConsent"; + value: Uint8Array; +} +/** + * MsgDelegateFeedConsent represents a message to + * delegate oracle voting rights to another address. + */ +export interface MsgDelegateFeedConsentAmino { + operator?: string; + delegate?: string; +} +export interface MsgDelegateFeedConsentAminoMsg { + type: "/kujira.oracle.MsgDelegateFeedConsent"; + value: MsgDelegateFeedConsentAmino; +} +/** + * MsgDelegateFeedConsent represents a message to + * delegate oracle voting rights to another address. + */ +export interface MsgDelegateFeedConsentSDKType { + operator: string; + delegate: string; +} +/** MsgDelegateFeedConsentResponse defines the Msg/DelegateFeedConsent response type. */ +export interface MsgDelegateFeedConsentResponse {} +export interface MsgDelegateFeedConsentResponseProtoMsg { + typeUrl: "/kujira.oracle.MsgDelegateFeedConsentResponse"; + value: Uint8Array; +} +/** MsgDelegateFeedConsentResponse defines the Msg/DelegateFeedConsent response type. */ +export interface MsgDelegateFeedConsentResponseAmino {} +export interface MsgDelegateFeedConsentResponseAminoMsg { + type: "/kujira.oracle.MsgDelegateFeedConsentResponse"; + value: MsgDelegateFeedConsentResponseAmino; +} +/** MsgDelegateFeedConsentResponse defines the Msg/DelegateFeedConsent response type. */ +export interface MsgDelegateFeedConsentResponseSDKType {} +function createBaseMsgAggregateExchangeRatePrevote(): MsgAggregateExchangeRatePrevote { + return { + hash: "", + feeder: "", + validator: "" + }; +} +export const MsgAggregateExchangeRatePrevote = { + typeUrl: "/kujira.oracle.MsgAggregateExchangeRatePrevote", + encode(message: MsgAggregateExchangeRatePrevote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash !== "") { + writer.uint32(10).string(message.hash); + } + if (message.feeder !== "") { + writer.uint32(18).string(message.feeder); + } + if (message.validator !== "") { + writer.uint32(26).string(message.validator); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgAggregateExchangeRatePrevote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAggregateExchangeRatePrevote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.string(); + break; + case 2: + message.feeder = reader.string(); + break; + case 3: + message.validator = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgAggregateExchangeRatePrevote { + const message = createBaseMsgAggregateExchangeRatePrevote(); + message.hash = object.hash ?? ""; + message.feeder = object.feeder ?? ""; + message.validator = object.validator ?? ""; + return message; + }, + fromAmino(object: MsgAggregateExchangeRatePrevoteAmino): MsgAggregateExchangeRatePrevote { + const message = createBaseMsgAggregateExchangeRatePrevote(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + if (object.feeder !== undefined && object.feeder !== null) { + message.feeder = object.feeder; + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = object.validator; + } + return message; + }, + toAmino(message: MsgAggregateExchangeRatePrevote, useInterfaces: boolean = false): MsgAggregateExchangeRatePrevoteAmino { + const obj: any = {}; + obj.hash = message.hash; + obj.feeder = message.feeder; + obj.validator = message.validator; + return obj; + }, + fromAminoMsg(object: MsgAggregateExchangeRatePrevoteAminoMsg): MsgAggregateExchangeRatePrevote { + return MsgAggregateExchangeRatePrevote.fromAmino(object.value); + }, + fromProtoMsg(message: MsgAggregateExchangeRatePrevoteProtoMsg, useInterfaces: boolean = false): MsgAggregateExchangeRatePrevote { + return MsgAggregateExchangeRatePrevote.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgAggregateExchangeRatePrevote): Uint8Array { + return MsgAggregateExchangeRatePrevote.encode(message).finish(); + }, + toProtoMsg(message: MsgAggregateExchangeRatePrevote): MsgAggregateExchangeRatePrevoteProtoMsg { + return { + typeUrl: "/kujira.oracle.MsgAggregateExchangeRatePrevote", + value: MsgAggregateExchangeRatePrevote.encode(message).finish() + }; + } +}; +function createBaseMsgAggregateExchangeRatePrevoteResponse(): MsgAggregateExchangeRatePrevoteResponse { + return {}; +} +export const MsgAggregateExchangeRatePrevoteResponse = { + typeUrl: "/kujira.oracle.MsgAggregateExchangeRatePrevoteResponse", + encode(_: MsgAggregateExchangeRatePrevoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgAggregateExchangeRatePrevoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAggregateExchangeRatePrevoteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgAggregateExchangeRatePrevoteResponse { + const message = createBaseMsgAggregateExchangeRatePrevoteResponse(); + return message; + }, + fromAmino(_: MsgAggregateExchangeRatePrevoteResponseAmino): MsgAggregateExchangeRatePrevoteResponse { + const message = createBaseMsgAggregateExchangeRatePrevoteResponse(); + return message; + }, + toAmino(_: MsgAggregateExchangeRatePrevoteResponse, useInterfaces: boolean = false): MsgAggregateExchangeRatePrevoteResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgAggregateExchangeRatePrevoteResponseAminoMsg): MsgAggregateExchangeRatePrevoteResponse { + return MsgAggregateExchangeRatePrevoteResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgAggregateExchangeRatePrevoteResponseProtoMsg, useInterfaces: boolean = false): MsgAggregateExchangeRatePrevoteResponse { + return MsgAggregateExchangeRatePrevoteResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgAggregateExchangeRatePrevoteResponse): Uint8Array { + return MsgAggregateExchangeRatePrevoteResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAggregateExchangeRatePrevoteResponse): MsgAggregateExchangeRatePrevoteResponseProtoMsg { + return { + typeUrl: "/kujira.oracle.MsgAggregateExchangeRatePrevoteResponse", + value: MsgAggregateExchangeRatePrevoteResponse.encode(message).finish() + }; + } +}; +function createBaseMsgAggregateExchangeRateVote(): MsgAggregateExchangeRateVote { + return { + salt: "", + exchangeRates: "", + feeder: "", + validator: "" + }; +} +export const MsgAggregateExchangeRateVote = { + typeUrl: "/kujira.oracle.MsgAggregateExchangeRateVote", + encode(message: MsgAggregateExchangeRateVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.salt !== "") { + writer.uint32(10).string(message.salt); + } + if (message.exchangeRates !== "") { + writer.uint32(18).string(message.exchangeRates); + } + if (message.feeder !== "") { + writer.uint32(26).string(message.feeder); + } + if (message.validator !== "") { + writer.uint32(34).string(message.validator); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgAggregateExchangeRateVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAggregateExchangeRateVote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.salt = reader.string(); + break; + case 2: + message.exchangeRates = reader.string(); + break; + case 3: + message.feeder = reader.string(); + break; + case 4: + message.validator = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgAggregateExchangeRateVote { + const message = createBaseMsgAggregateExchangeRateVote(); + message.salt = object.salt ?? ""; + message.exchangeRates = object.exchangeRates ?? ""; + message.feeder = object.feeder ?? ""; + message.validator = object.validator ?? ""; + return message; + }, + fromAmino(object: MsgAggregateExchangeRateVoteAmino): MsgAggregateExchangeRateVote { + const message = createBaseMsgAggregateExchangeRateVote(); + if (object.salt !== undefined && object.salt !== null) { + message.salt = object.salt; + } + if (object.exchange_rates !== undefined && object.exchange_rates !== null) { + message.exchangeRates = object.exchange_rates; + } + if (object.feeder !== undefined && object.feeder !== null) { + message.feeder = object.feeder; + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = object.validator; + } + return message; + }, + toAmino(message: MsgAggregateExchangeRateVote, useInterfaces: boolean = false): MsgAggregateExchangeRateVoteAmino { + const obj: any = {}; + obj.salt = message.salt; + obj.exchange_rates = message.exchangeRates; + obj.feeder = message.feeder; + obj.validator = message.validator; + return obj; + }, + fromAminoMsg(object: MsgAggregateExchangeRateVoteAminoMsg): MsgAggregateExchangeRateVote { + return MsgAggregateExchangeRateVote.fromAmino(object.value); + }, + fromProtoMsg(message: MsgAggregateExchangeRateVoteProtoMsg, useInterfaces: boolean = false): MsgAggregateExchangeRateVote { + return MsgAggregateExchangeRateVote.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgAggregateExchangeRateVote): Uint8Array { + return MsgAggregateExchangeRateVote.encode(message).finish(); + }, + toProtoMsg(message: MsgAggregateExchangeRateVote): MsgAggregateExchangeRateVoteProtoMsg { + return { + typeUrl: "/kujira.oracle.MsgAggregateExchangeRateVote", + value: MsgAggregateExchangeRateVote.encode(message).finish() + }; + } +}; +function createBaseMsgAggregateExchangeRateVoteResponse(): MsgAggregateExchangeRateVoteResponse { + return {}; +} +export const MsgAggregateExchangeRateVoteResponse = { + typeUrl: "/kujira.oracle.MsgAggregateExchangeRateVoteResponse", + encode(_: MsgAggregateExchangeRateVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgAggregateExchangeRateVoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAggregateExchangeRateVoteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgAggregateExchangeRateVoteResponse { + const message = createBaseMsgAggregateExchangeRateVoteResponse(); + return message; + }, + fromAmino(_: MsgAggregateExchangeRateVoteResponseAmino): MsgAggregateExchangeRateVoteResponse { + const message = createBaseMsgAggregateExchangeRateVoteResponse(); + return message; + }, + toAmino(_: MsgAggregateExchangeRateVoteResponse, useInterfaces: boolean = false): MsgAggregateExchangeRateVoteResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgAggregateExchangeRateVoteResponseAminoMsg): MsgAggregateExchangeRateVoteResponse { + return MsgAggregateExchangeRateVoteResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgAggregateExchangeRateVoteResponseProtoMsg, useInterfaces: boolean = false): MsgAggregateExchangeRateVoteResponse { + return MsgAggregateExchangeRateVoteResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgAggregateExchangeRateVoteResponse): Uint8Array { + return MsgAggregateExchangeRateVoteResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAggregateExchangeRateVoteResponse): MsgAggregateExchangeRateVoteResponseProtoMsg { + return { + typeUrl: "/kujira.oracle.MsgAggregateExchangeRateVoteResponse", + value: MsgAggregateExchangeRateVoteResponse.encode(message).finish() + }; + } +}; +function createBaseMsgDelegateFeedConsent(): MsgDelegateFeedConsent { + return { + operator: "", + delegate: "" + }; +} +export const MsgDelegateFeedConsent = { + typeUrl: "/kujira.oracle.MsgDelegateFeedConsent", + encode(message: MsgDelegateFeedConsent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.operator !== "") { + writer.uint32(10).string(message.operator); + } + if (message.delegate !== "") { + writer.uint32(18).string(message.delegate); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgDelegateFeedConsent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDelegateFeedConsent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operator = reader.string(); + break; + case 2: + message.delegate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgDelegateFeedConsent { + const message = createBaseMsgDelegateFeedConsent(); + message.operator = object.operator ?? ""; + message.delegate = object.delegate ?? ""; + return message; + }, + fromAmino(object: MsgDelegateFeedConsentAmino): MsgDelegateFeedConsent { + const message = createBaseMsgDelegateFeedConsent(); + if (object.operator !== undefined && object.operator !== null) { + message.operator = object.operator; + } + if (object.delegate !== undefined && object.delegate !== null) { + message.delegate = object.delegate; + } + return message; + }, + toAmino(message: MsgDelegateFeedConsent, useInterfaces: boolean = false): MsgDelegateFeedConsentAmino { + const obj: any = {}; + obj.operator = message.operator; + obj.delegate = message.delegate; + return obj; + }, + fromAminoMsg(object: MsgDelegateFeedConsentAminoMsg): MsgDelegateFeedConsent { + return MsgDelegateFeedConsent.fromAmino(object.value); + }, + fromProtoMsg(message: MsgDelegateFeedConsentProtoMsg, useInterfaces: boolean = false): MsgDelegateFeedConsent { + return MsgDelegateFeedConsent.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgDelegateFeedConsent): Uint8Array { + return MsgDelegateFeedConsent.encode(message).finish(); + }, + toProtoMsg(message: MsgDelegateFeedConsent): MsgDelegateFeedConsentProtoMsg { + return { + typeUrl: "/kujira.oracle.MsgDelegateFeedConsent", + value: MsgDelegateFeedConsent.encode(message).finish() + }; + } +}; +function createBaseMsgDelegateFeedConsentResponse(): MsgDelegateFeedConsentResponse { + return {}; +} +export const MsgDelegateFeedConsentResponse = { + typeUrl: "/kujira.oracle.MsgDelegateFeedConsentResponse", + encode(_: MsgDelegateFeedConsentResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgDelegateFeedConsentResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDelegateFeedConsentResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgDelegateFeedConsentResponse { + const message = createBaseMsgDelegateFeedConsentResponse(); + return message; + }, + fromAmino(_: MsgDelegateFeedConsentResponseAmino): MsgDelegateFeedConsentResponse { + const message = createBaseMsgDelegateFeedConsentResponse(); + return message; + }, + toAmino(_: MsgDelegateFeedConsentResponse, useInterfaces: boolean = false): MsgDelegateFeedConsentResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgDelegateFeedConsentResponseAminoMsg): MsgDelegateFeedConsentResponse { + return MsgDelegateFeedConsentResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgDelegateFeedConsentResponseProtoMsg, useInterfaces: boolean = false): MsgDelegateFeedConsentResponse { + return MsgDelegateFeedConsentResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgDelegateFeedConsentResponse): Uint8Array { + return MsgDelegateFeedConsentResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDelegateFeedConsentResponse): MsgDelegateFeedConsentResponseProtoMsg { + return { + typeUrl: "/kujira.oracle.MsgDelegateFeedConsentResponse", + value: MsgDelegateFeedConsentResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/rpc.query.ts b/packages/types/protobuf/codegen/kujira/rpc.query.ts new file mode 100644 index 000000000..30026d835 --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/rpc.query.ts @@ -0,0 +1,58 @@ +import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import { QueryClient } from "@cosmjs/stargate"; +export const createRPCQueryClient = async ({ + rpcEndpoint +}: { + rpcEndpoint: string | HttpEndpoint; +}) => { + const tmClient = await Tendermint34Client.connect(rpcEndpoint); + const client = new QueryClient(tmClient); + return { + cosmos: { + auth: { + v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + authz: { + v1beta1: (await import("../cosmos/authz/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + bank: { + v1beta1: (await import("../cosmos/bank/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + base: { + tendermint: { + v1beta1: (await import("../cosmos/base/tendermint/v1beta1/query.rpc.Service")).createRpcQueryExtension(client) + } + }, + distribution: { + v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + gov: { + v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), + v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + mint: { + v1beta1: (await import("../cosmos/mint/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + params: { + v1beta1: (await import("../cosmos/params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + slashing: { + v1beta1: (await import("../cosmos/slashing/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + staking: { + v1beta1: (await import("../cosmos/staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + tx: { + v1beta1: (await import("../cosmos/tx/v1beta1/service.rpc.Service")).createRpcQueryExtension(client) + }, + upgrade: { + v1beta1: (await import("../cosmos/upgrade/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, + kujira: { + denom: (await import("./denom/query.rpc.Query")).createRpcQueryExtension(client), + oracle: (await import("./oracle/query.rpc.Query")).createRpcQueryExtension(client), + scheduler: (await import("./scheduler/query.rpc.Query")).createRpcQueryExtension(client) + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/rpc.tx.ts b/packages/types/protobuf/codegen/kujira/rpc.tx.ts new file mode 100644 index 000000000..2e5d39762 --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/rpc.tx.ts @@ -0,0 +1,41 @@ +import { Rpc } from "../helpers"; +export const createRPCMsgClient = async ({ + rpc +}: { + rpc: Rpc; +}) => ({ + cosmos: { + auth: { + v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + authz: { + v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + bank: { + v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + distribution: { + v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + gov: { + v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), + v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + mint: { + v1beta1: new (await import("../cosmos/mint/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + slashing: { + v1beta1: new (await import("../cosmos/slashing/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + staking: { + v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + upgrade: { + v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + } + }, + kujira: { + denom: new (await import("./denom/tx.rpc.msg")).MsgClientImpl(rpc), + oracle: new (await import("./oracle/tx.rpc.msg")).MsgClientImpl(rpc) + } +}); \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/scheduler/genesis.ts b/packages/types/protobuf/codegen/kujira/scheduler/genesis.ts new file mode 100644 index 000000000..fb6a3bf19 --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/scheduler/genesis.ts @@ -0,0 +1,119 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { Hook, HookAmino, HookSDKType } from "./hook"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisState defines the scheduler module's genesis state. */ +export interface GenesisState { + params: Params | undefined; + hookList: Hook[]; + hookCount: bigint; +} +export interface GenesisStateProtoMsg { + typeUrl: "/kujira.scheduler.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the scheduler module's genesis state. */ +export interface GenesisStateAmino { + params?: ParamsAmino | undefined; + hookList?: HookAmino[]; + hookCount?: string; +} +export interface GenesisStateAminoMsg { + type: "/kujira.scheduler.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the scheduler module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType | undefined; + hookList: HookSDKType[]; + hookCount: bigint; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + hookList: [], + hookCount: BigInt(0) + }; +} +export const GenesisState = { + typeUrl: "/kujira.scheduler.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.hookList) { + Hook.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.hookCount !== BigInt(0)) { + writer.uint32(24).uint64(message.hookCount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.hookList.push(Hook.decode(reader, reader.uint32(), useInterfaces)); + break; + case 3: + message.hookCount = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.hookList = object.hookList?.map(e => Hook.fromPartial(e)) || []; + message.hookCount = object.hookCount !== undefined && object.hookCount !== null ? BigInt(object.hookCount.toString()) : BigInt(0); + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.hookList = object.hookList?.map(e => Hook.fromAmino(e)) || []; + if (object.hookCount !== undefined && object.hookCount !== null) { + message.hookCount = BigInt(object.hookCount); + } + return message; + }, + toAmino(message: GenesisState, useInterfaces: boolean = false): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + if (message.hookList) { + obj.hookList = message.hookList.map(e => e ? Hook.toAmino(e, useInterfaces) : undefined); + } else { + obj.hookList = []; + } + obj.hookCount = message.hookCount ? message.hookCount.toString() : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg, useInterfaces: boolean = false): GenesisState { + return GenesisState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/kujira.scheduler.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/scheduler/hook.ts b/packages/types/protobuf/codegen/kujira/scheduler/hook.ts new file mode 100644 index 000000000..5b459aea1 --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/scheduler/hook.ts @@ -0,0 +1,160 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +export interface Hook { + id: bigint; + executor: string; + contract: string; + msg: Uint8Array; + frequency: bigint; + funds: Coin[]; +} +export interface HookProtoMsg { + typeUrl: "/kujira.scheduler.Hook"; + value: Uint8Array; +} +export interface HookAmino { + id?: string; + executor?: string; + contract?: string; + msg?: string; + frequency?: string; + funds?: CoinAmino[]; +} +export interface HookAminoMsg { + type: "/kujira.scheduler.Hook"; + value: HookAmino; +} +export interface HookSDKType { + id: bigint; + executor: string; + contract: string; + msg: Uint8Array; + frequency: bigint; + funds: CoinSDKType[]; +} +function createBaseHook(): Hook { + return { + id: BigInt(0), + executor: "", + contract: "", + msg: new Uint8Array(), + frequency: BigInt(0), + funds: [] + }; +} +export const Hook = { + typeUrl: "/kujira.scheduler.Hook", + encode(message: Hook, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).uint64(message.id); + } + if (message.executor !== "") { + writer.uint32(18).string(message.executor); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(34).bytes(message.msg); + } + if (message.frequency !== BigInt(0)) { + writer.uint32(40).int64(message.frequency); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Hook { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHook(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint64(); + break; + case 2: + message.executor = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + case 4: + message.msg = reader.bytes(); + break; + case 5: + message.frequency = reader.int64(); + break; + case 6: + message.funds.push(Coin.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Hook { + const message = createBaseHook(); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + message.executor = object.executor ?? ""; + message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.frequency = object.frequency !== undefined && object.frequency !== null ? BigInt(object.frequency.toString()) : BigInt(0); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: HookAmino): Hook { + const message = createBaseHook(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.executor !== undefined && object.executor !== null) { + message.executor = object.executor; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = bytesFromBase64(object.msg); + } + if (object.frequency !== undefined && object.frequency !== null) { + message.frequency = BigInt(object.frequency); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Hook, useInterfaces: boolean = false): HookAmino { + const obj: any = {}; + obj.id = message.id ? message.id.toString() : undefined; + obj.executor = message.executor; + obj.contract = message.contract; + obj.msg = message.msg ? base64FromBytes(message.msg) : undefined; + obj.frequency = message.frequency ? message.frequency.toString() : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); + } else { + obj.funds = []; + } + return obj; + }, + fromAminoMsg(object: HookAminoMsg): Hook { + return Hook.fromAmino(object.value); + }, + fromProtoMsg(message: HookProtoMsg, useInterfaces: boolean = false): Hook { + return Hook.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Hook): Uint8Array { + return Hook.encode(message).finish(); + }, + toProtoMsg(message: Hook): HookProtoMsg { + return { + typeUrl: "/kujira.scheduler.Hook", + value: Hook.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/scheduler/params.ts b/packages/types/protobuf/codegen/kujira/scheduler/params.ts new file mode 100644 index 000000000..7d9259869 --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/scheduler/params.ts @@ -0,0 +1,65 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +/** Params defines the parameters for the module. */ +export interface Params {} +export interface ParamsProtoMsg { + typeUrl: "/kujira.scheduler.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the module. */ +export interface ParamsAmino {} +export interface ParamsAminoMsg { + type: "/kujira.scheduler.Params"; + value: ParamsAmino; +} +/** Params defines the parameters for the module. */ +export interface ParamsSDKType {} +function createBaseParams(): Params { + return {}; +} +export const Params = { + typeUrl: "/kujira.scheduler.Params", + encode(_: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): Params { + const message = createBaseParams(); + return message; + }, + fromAmino(_: ParamsAmino): Params { + const message = createBaseParams(); + return message; + }, + toAmino(_: Params, useInterfaces: boolean = false): ParamsAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsProtoMsg, useInterfaces: boolean = false): Params { + return Params.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/kujira.scheduler.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/scheduler/proposal.ts b/packages/types/protobuf/codegen/kujira/scheduler/proposal.ts new file mode 100644 index 000000000..769497fd2 --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/scheduler/proposal.ts @@ -0,0 +1,488 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../helpers"; +export interface CreateHookProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** The account that will execute the msg on the schedule */ + executor: string; + /** The contract that the msg is called on */ + contract: string; + msg: Uint8Array; + frequency: bigint; + funds: Coin[]; +} +export interface CreateHookProposalProtoMsg { + typeUrl: "/kujira.scheduler.CreateHookProposal"; + value: Uint8Array; +} +export interface CreateHookProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** The account that will execute the msg on the schedule */ + executor?: string; + /** The contract that the msg is called on */ + contract?: string; + msg?: string; + frequency?: string; + funds?: CoinAmino[]; +} +export interface CreateHookProposalAminoMsg { + type: "/kujira.scheduler.CreateHookProposal"; + value: CreateHookProposalAmino; +} +export interface CreateHookProposalSDKType { + title: string; + description: string; + executor: string; + contract: string; + msg: Uint8Array; + frequency: bigint; + funds: CoinSDKType[]; +} +export interface UpdateHookProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + id: bigint; + executor: string; + contract: string; + msg: Uint8Array; + frequency: bigint; + funds: Coin[]; +} +export interface UpdateHookProposalProtoMsg { + typeUrl: "/kujira.scheduler.UpdateHookProposal"; + value: Uint8Array; +} +export interface UpdateHookProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + id?: string; + executor?: string; + contract?: string; + msg?: string; + frequency?: string; + funds?: CoinAmino[]; +} +export interface UpdateHookProposalAminoMsg { + type: "/kujira.scheduler.UpdateHookProposal"; + value: UpdateHookProposalAmino; +} +export interface UpdateHookProposalSDKType { + title: string; + description: string; + id: bigint; + executor: string; + contract: string; + msg: Uint8Array; + frequency: bigint; + funds: CoinSDKType[]; +} +export interface DeleteHookProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + id: bigint; +} +export interface DeleteHookProposalProtoMsg { + typeUrl: "/kujira.scheduler.DeleteHookProposal"; + value: Uint8Array; +} +export interface DeleteHookProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + id?: string; +} +export interface DeleteHookProposalAminoMsg { + type: "/kujira.scheduler.DeleteHookProposal"; + value: DeleteHookProposalAmino; +} +export interface DeleteHookProposalSDKType { + title: string; + description: string; + id: bigint; +} +function createBaseCreateHookProposal(): CreateHookProposal { + return { + title: "", + description: "", + executor: "", + contract: "", + msg: new Uint8Array(), + frequency: BigInt(0), + funds: [] + }; +} +export const CreateHookProposal = { + typeUrl: "/kujira.scheduler.CreateHookProposal", + encode(message: CreateHookProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.executor !== "") { + writer.uint32(26).string(message.executor); + } + if (message.contract !== "") { + writer.uint32(34).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(42).bytes(message.msg); + } + if (message.frequency !== BigInt(0)) { + writer.uint32(48).int64(message.frequency); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): CreateHookProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateHookProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.executor = reader.string(); + break; + case 4: + message.contract = reader.string(); + break; + case 5: + message.msg = reader.bytes(); + break; + case 6: + message.frequency = reader.int64(); + break; + case 7: + message.funds.push(Coin.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CreateHookProposal { + const message = createBaseCreateHookProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.executor = object.executor ?? ""; + message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.frequency = object.frequency !== undefined && object.frequency !== null ? BigInt(object.frequency.toString()) : BigInt(0); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CreateHookProposalAmino): CreateHookProposal { + const message = createBaseCreateHookProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.executor !== undefined && object.executor !== null) { + message.executor = object.executor; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = bytesFromBase64(object.msg); + } + if (object.frequency !== undefined && object.frequency !== null) { + message.frequency = BigInt(object.frequency); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: CreateHookProposal, useInterfaces: boolean = false): CreateHookProposalAmino { + const obj: any = {}; + obj.title = message.title; + obj.description = message.description; + obj.executor = message.executor; + obj.contract = message.contract; + obj.msg = message.msg ? base64FromBytes(message.msg) : undefined; + obj.frequency = message.frequency ? message.frequency.toString() : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); + } else { + obj.funds = []; + } + return obj; + }, + fromAminoMsg(object: CreateHookProposalAminoMsg): CreateHookProposal { + return CreateHookProposal.fromAmino(object.value); + }, + fromProtoMsg(message: CreateHookProposalProtoMsg, useInterfaces: boolean = false): CreateHookProposal { + return CreateHookProposal.decode(message.value, undefined, useInterfaces); + }, + toProto(message: CreateHookProposal): Uint8Array { + return CreateHookProposal.encode(message).finish(); + }, + toProtoMsg(message: CreateHookProposal): CreateHookProposalProtoMsg { + return { + typeUrl: "/kujira.scheduler.CreateHookProposal", + value: CreateHookProposal.encode(message).finish() + }; + } +}; +function createBaseUpdateHookProposal(): UpdateHookProposal { + return { + title: "", + description: "", + id: BigInt(0), + executor: "", + contract: "", + msg: new Uint8Array(), + frequency: BigInt(0), + funds: [] + }; +} +export const UpdateHookProposal = { + typeUrl: "/kujira.scheduler.UpdateHookProposal", + encode(message: UpdateHookProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.id !== BigInt(0)) { + writer.uint32(24).uint64(message.id); + } + if (message.executor !== "") { + writer.uint32(34).string(message.executor); + } + if (message.contract !== "") { + writer.uint32(42).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(50).bytes(message.msg); + } + if (message.frequency !== BigInt(0)) { + writer.uint32(56).int64(message.frequency); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): UpdateHookProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateHookProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.id = reader.uint64(); + break; + case 4: + message.executor = reader.string(); + break; + case 5: + message.contract = reader.string(); + break; + case 6: + message.msg = reader.bytes(); + break; + case 7: + message.frequency = reader.int64(); + break; + case 8: + message.funds.push(Coin.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpdateHookProposal { + const message = createBaseUpdateHookProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + message.executor = object.executor ?? ""; + message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.frequency = object.frequency !== undefined && object.frequency !== null ? BigInt(object.frequency.toString()) : BigInt(0); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: UpdateHookProposalAmino): UpdateHookProposal { + const message = createBaseUpdateHookProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.executor !== undefined && object.executor !== null) { + message.executor = object.executor; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = bytesFromBase64(object.msg); + } + if (object.frequency !== undefined && object.frequency !== null) { + message.frequency = BigInt(object.frequency); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: UpdateHookProposal, useInterfaces: boolean = false): UpdateHookProposalAmino { + const obj: any = {}; + obj.title = message.title; + obj.description = message.description; + obj.id = message.id ? message.id.toString() : undefined; + obj.executor = message.executor; + obj.contract = message.contract; + obj.msg = message.msg ? base64FromBytes(message.msg) : undefined; + obj.frequency = message.frequency ? message.frequency.toString() : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); + } else { + obj.funds = []; + } + return obj; + }, + fromAminoMsg(object: UpdateHookProposalAminoMsg): UpdateHookProposal { + return UpdateHookProposal.fromAmino(object.value); + }, + fromProtoMsg(message: UpdateHookProposalProtoMsg, useInterfaces: boolean = false): UpdateHookProposal { + return UpdateHookProposal.decode(message.value, undefined, useInterfaces); + }, + toProto(message: UpdateHookProposal): Uint8Array { + return UpdateHookProposal.encode(message).finish(); + }, + toProtoMsg(message: UpdateHookProposal): UpdateHookProposalProtoMsg { + return { + typeUrl: "/kujira.scheduler.UpdateHookProposal", + value: UpdateHookProposal.encode(message).finish() + }; + } +}; +function createBaseDeleteHookProposal(): DeleteHookProposal { + return { + title: "", + description: "", + id: BigInt(0) + }; +} +export const DeleteHookProposal = { + typeUrl: "/kujira.scheduler.DeleteHookProposal", + encode(message: DeleteHookProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.id !== BigInt(0)) { + writer.uint32(24).uint64(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): DeleteHookProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteHookProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.id = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DeleteHookProposal { + const message = createBaseDeleteHookProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + return message; + }, + fromAmino(object: DeleteHookProposalAmino): DeleteHookProposal { + const message = createBaseDeleteHookProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + return message; + }, + toAmino(message: DeleteHookProposal, useInterfaces: boolean = false): DeleteHookProposalAmino { + const obj: any = {}; + obj.title = message.title; + obj.description = message.description; + obj.id = message.id ? message.id.toString() : undefined; + return obj; + }, + fromAminoMsg(object: DeleteHookProposalAminoMsg): DeleteHookProposal { + return DeleteHookProposal.fromAmino(object.value); + }, + fromProtoMsg(message: DeleteHookProposalProtoMsg, useInterfaces: boolean = false): DeleteHookProposal { + return DeleteHookProposal.decode(message.value, undefined, useInterfaces); + }, + toProto(message: DeleteHookProposal): Uint8Array { + return DeleteHookProposal.encode(message).finish(); + }, + toProtoMsg(message: DeleteHookProposal): DeleteHookProposalProtoMsg { + return { + typeUrl: "/kujira.scheduler.DeleteHookProposal", + value: DeleteHookProposal.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/scheduler/query.rpc.Query.ts b/packages/types/protobuf/codegen/kujira/scheduler/query.rpc.Query.ts new file mode 100644 index 000000000..3e4c01354 --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/scheduler/query.rpc.Query.ts @@ -0,0 +1,54 @@ +import { Rpc } from "../../helpers"; +import { BinaryReader } from "../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryParamsRequest, QueryParamsResponse, QueryGetHookRequest, QueryGetHookResponse, QueryAllHookRequest, QueryAllHookResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Parameters queries the parameters of the module. */ + params(request?: QueryParamsRequest): Promise; + /** Queries a Hook by id. */ + hook(request: QueryGetHookRequest): Promise; + /** Queries a list of Hook items. */ + hookAll(request?: QueryAllHookRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + this.hook = this.hook.bind(this); + this.hookAll = this.hookAll.bind(this); + } + params(request: QueryParamsRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("kujira.scheduler.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + hook(request: QueryGetHookRequest, useInterfaces: boolean = true): Promise { + const data = QueryGetHookRequest.encode(request).finish(); + const promise = this.rpc.request("kujira.scheduler.Query", "Hook", data); + return promise.then(data => QueryGetHookResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + hookAll(request: QueryAllHookRequest = { + pagination: undefined + }, useInterfaces: boolean = true): Promise { + const data = QueryAllHookRequest.encode(request).finish(); + const promise = this.rpc.request("kujira.scheduler.Query", "HookAll", data); + return promise.then(data => QueryAllHookResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest, useInterfaces: boolean = true): Promise { + return queryService.params(request, useInterfaces); + }, + hook(request: QueryGetHookRequest, useInterfaces: boolean = true): Promise { + return queryService.hook(request, useInterfaces); + }, + hookAll(request?: QueryAllHookRequest, useInterfaces: boolean = true): Promise { + return queryService.hookAll(request, useInterfaces); + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/scheduler/query.ts b/packages/types/protobuf/codegen/kujira/scheduler/query.ts new file mode 100644 index 000000000..82b22f83c --- /dev/null +++ b/packages/types/protobuf/codegen/kujira/scheduler/query.ts @@ -0,0 +1,491 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../cosmos/base/query/v1beta1/pagination"; +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { Hook, HookAmino, HookSDKType } from "./hook"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/kujira.scheduler.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/kujira.scheduler.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params holds all the parameters of this module. */ + params: Params | undefined; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/kujira.scheduler.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** params holds all the parameters of this module. */ + params?: ParamsAmino | undefined; +} +export interface QueryParamsResponseAminoMsg { + type: "/kujira.scheduler.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType | undefined; +} +export interface QueryGetHookRequest { + id: bigint; +} +export interface QueryGetHookRequestProtoMsg { + typeUrl: "/kujira.scheduler.QueryGetHookRequest"; + value: Uint8Array; +} +export interface QueryGetHookRequestAmino { + id?: string; +} +export interface QueryGetHookRequestAminoMsg { + type: "/kujira.scheduler.QueryGetHookRequest"; + value: QueryGetHookRequestAmino; +} +export interface QueryGetHookRequestSDKType { + id: bigint; +} +export interface QueryGetHookResponse { + Hook: Hook | undefined; +} +export interface QueryGetHookResponseProtoMsg { + typeUrl: "/kujira.scheduler.QueryGetHookResponse"; + value: Uint8Array; +} +export interface QueryGetHookResponseAmino { + Hook?: HookAmino | undefined; +} +export interface QueryGetHookResponseAminoMsg { + type: "/kujira.scheduler.QueryGetHookResponse"; + value: QueryGetHookResponseAmino; +} +export interface QueryGetHookResponseSDKType { + Hook: HookSDKType | undefined; +} +export interface QueryAllHookRequest { + pagination?: PageRequest | undefined; +} +export interface QueryAllHookRequestProtoMsg { + typeUrl: "/kujira.scheduler.QueryAllHookRequest"; + value: Uint8Array; +} +export interface QueryAllHookRequestAmino { + pagination?: PageRequestAmino | undefined; +} +export interface QueryAllHookRequestAminoMsg { + type: "/kujira.scheduler.QueryAllHookRequest"; + value: QueryAllHookRequestAmino; +} +export interface QueryAllHookRequestSDKType { + pagination?: PageRequestSDKType | undefined; +} +export interface QueryAllHookResponse { + Hook: Hook[]; + pagination?: PageResponse | undefined; +} +export interface QueryAllHookResponseProtoMsg { + typeUrl: "/kujira.scheduler.QueryAllHookResponse"; + value: Uint8Array; +} +export interface QueryAllHookResponseAmino { + Hook?: HookAmino[]; + pagination?: PageResponseAmino | undefined; +} +export interface QueryAllHookResponseAminoMsg { + type: "/kujira.scheduler.QueryAllHookResponse"; + value: QueryAllHookResponseAmino; +} +export interface QueryAllHookResponseSDKType { + Hook: HookSDKType[]; + pagination?: PageResponseSDKType | undefined; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/kujira.scheduler.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest, useInterfaces: boolean = false): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg, useInterfaces: boolean = false): QueryParamsRequest { + return QueryParamsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/kujira.scheduler.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/kujira.scheduler.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse, useInterfaces: boolean = false): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg, useInterfaces: boolean = false): QueryParamsResponse { + return QueryParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/kujira.scheduler.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryGetHookRequest(): QueryGetHookRequest { + return { + id: BigInt(0) + }; +} +export const QueryGetHookRequest = { + typeUrl: "/kujira.scheduler.QueryGetHookRequest", + encode(message: QueryGetHookRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).uint64(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryGetHookRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetHookRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGetHookRequest { + const message = createBaseQueryGetHookRequest(); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryGetHookRequestAmino): QueryGetHookRequest { + const message = createBaseQueryGetHookRequest(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + return message; + }, + toAmino(message: QueryGetHookRequest, useInterfaces: boolean = false): QueryGetHookRequestAmino { + const obj: any = {}; + obj.id = message.id ? message.id.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryGetHookRequestAminoMsg): QueryGetHookRequest { + return QueryGetHookRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryGetHookRequestProtoMsg, useInterfaces: boolean = false): QueryGetHookRequest { + return QueryGetHookRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryGetHookRequest): Uint8Array { + return QueryGetHookRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGetHookRequest): QueryGetHookRequestProtoMsg { + return { + typeUrl: "/kujira.scheduler.QueryGetHookRequest", + value: QueryGetHookRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGetHookResponse(): QueryGetHookResponse { + return { + Hook: Hook.fromPartial({}) + }; +} +export const QueryGetHookResponse = { + typeUrl: "/kujira.scheduler.QueryGetHookResponse", + encode(message: QueryGetHookResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.Hook !== undefined) { + Hook.encode(message.Hook, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryGetHookResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetHookResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.Hook = Hook.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGetHookResponse { + const message = createBaseQueryGetHookResponse(); + message.Hook = object.Hook !== undefined && object.Hook !== null ? Hook.fromPartial(object.Hook) : undefined; + return message; + }, + fromAmino(object: QueryGetHookResponseAmino): QueryGetHookResponse { + const message = createBaseQueryGetHookResponse(); + if (object.Hook !== undefined && object.Hook !== null) { + message.Hook = Hook.fromAmino(object.Hook); + } + return message; + }, + toAmino(message: QueryGetHookResponse, useInterfaces: boolean = false): QueryGetHookResponseAmino { + const obj: any = {}; + obj.Hook = message.Hook ? Hook.toAmino(message.Hook, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGetHookResponseAminoMsg): QueryGetHookResponse { + return QueryGetHookResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryGetHookResponseProtoMsg, useInterfaces: boolean = false): QueryGetHookResponse { + return QueryGetHookResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryGetHookResponse): Uint8Array { + return QueryGetHookResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGetHookResponse): QueryGetHookResponseProtoMsg { + return { + typeUrl: "/kujira.scheduler.QueryGetHookResponse", + value: QueryGetHookResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllHookRequest(): QueryAllHookRequest { + return { + pagination: undefined + }; +} +export const QueryAllHookRequest = { + typeUrl: "/kujira.scheduler.QueryAllHookRequest", + encode(message: QueryAllHookRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAllHookRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllHookRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllHookRequest { + const message = createBaseQueryAllHookRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllHookRequestAmino): QueryAllHookRequest { + const message = createBaseQueryAllHookRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllHookRequest, useInterfaces: boolean = false): QueryAllHookRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllHookRequestAminoMsg): QueryAllHookRequest { + return QueryAllHookRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllHookRequestProtoMsg, useInterfaces: boolean = false): QueryAllHookRequest { + return QueryAllHookRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAllHookRequest): Uint8Array { + return QueryAllHookRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllHookRequest): QueryAllHookRequestProtoMsg { + return { + typeUrl: "/kujira.scheduler.QueryAllHookRequest", + value: QueryAllHookRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllHookResponse(): QueryAllHookResponse { + return { + Hook: [], + pagination: undefined + }; +} +export const QueryAllHookResponse = { + typeUrl: "/kujira.scheduler.QueryAllHookResponse", + encode(message: QueryAllHookResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.Hook) { + Hook.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAllHookResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllHookResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.Hook.push(Hook.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllHookResponse { + const message = createBaseQueryAllHookResponse(); + message.Hook = object.Hook?.map(e => Hook.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllHookResponseAmino): QueryAllHookResponse { + const message = createBaseQueryAllHookResponse(); + message.Hook = object.Hook?.map(e => Hook.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllHookResponse, useInterfaces: boolean = false): QueryAllHookResponseAmino { + const obj: any = {}; + if (message.Hook) { + obj.Hook = message.Hook.map(e => e ? Hook.toAmino(e, useInterfaces) : undefined); + } else { + obj.Hook = []; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllHookResponseAminoMsg): QueryAllHookResponse { + return QueryAllHookResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllHookResponseProtoMsg, useInterfaces: boolean = false): QueryAllHookResponse { + return QueryAllHookResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAllHookResponse): Uint8Array { + return QueryAllHookResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllHookResponse): QueryAllHookResponseProtoMsg { + return { + typeUrl: "/kujira.scheduler.QueryAllHookResponse", + value: QueryAllHookResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/neutron/bundle.ts b/packages/types/protobuf/codegen/neutron/bundle.ts index d2e5c4fbb..ede7d49df 100644 --- a/packages/types/protobuf/codegen/neutron/bundle.ts +++ b/packages/types/protobuf/codegen/neutron/bundle.ts @@ -1,150 +1,150 @@ -import * as _139 from "./contractmanager/v1/failure"; -import * as _140 from "./cron/genesis"; -import * as _141 from "./cron/params"; -import * as _142 from "./cron/query"; -import * as _143 from "./cron/schedule"; -import * as _144 from "./cron/tx"; -import * as _145 from "./dex/deposit_record"; -import * as _146 from "./dex/genesis"; -import * as _147 from "./dex/limit_order_expiration"; -import * as _148 from "./dex/limit_order_tranche_user"; -import * as _149 from "./dex/limit_order_tranche"; -import * as _150 from "./dex/pair_id"; -import * as _151 from "./dex/params"; -import * as _152 from "./dex/pool_metadata"; -import * as _153 from "./dex/pool_reserves"; -import * as _154 from "./dex/pool"; -import * as _155 from "./dex/query"; -import * as _156 from "./dex/tick_liquidity"; -import * as _157 from "./dex/trade_pair_id"; -import * as _158 from "./dex/tx"; -import * as _159 from "./feeburner/genesis"; -import * as _160 from "./feeburner/params"; -import * as _161 from "./feeburner/query"; -import * as _162 from "./feeburner/total_burned_neutrons_amount"; -import * as _163 from "./feeburner/tx"; -import * as _164 from "./feerefunder/fee"; -import * as _165 from "./feerefunder/genesis"; -import * as _166 from "./feerefunder/params"; -import * as _167 from "./feerefunder/query"; -import * as _168 from "./feerefunder/tx"; -import * as _169 from "./interchainqueries/genesis"; -import * as _170 from "./interchainqueries/params"; -import * as _171 from "./interchainqueries/query"; -import * as _172 from "./interchainqueries/tx"; -import * as _173 from "./interchaintxs/v1/genesis"; -import * as _174 from "./interchaintxs/v1/params"; -import * as _175 from "./interchaintxs/v1/query"; -import * as _176 from "./interchaintxs/v1/tx"; -import * as _397 from "./cron/tx.amino"; -import * as _398 from "./dex/tx.amino"; -import * as _399 from "./feeburner/tx.amino"; -import * as _400 from "./feerefunder/tx.amino"; -import * as _401 from "./interchainqueries/tx.amino"; -import * as _402 from "./interchaintxs/v1/tx.amino"; -import * as _403 from "./cron/tx.registry"; -import * as _404 from "./dex/tx.registry"; -import * as _405 from "./feeburner/tx.registry"; -import * as _406 from "./feerefunder/tx.registry"; -import * as _407 from "./interchainqueries/tx.registry"; -import * as _408 from "./interchaintxs/v1/tx.registry"; -import * as _409 from "./cron/query.rpc.Query"; -import * as _410 from "./dex/query.rpc.Query"; -import * as _411 from "./feeburner/query.rpc.Query"; -import * as _412 from "./feerefunder/query.rpc.Query"; -import * as _413 from "./interchainqueries/query.rpc.Query"; -import * as _414 from "./interchaintxs/v1/query.rpc.Query"; -import * as _415 from "./cron/tx.rpc.msg"; -import * as _416 from "./dex/tx.rpc.msg"; -import * as _417 from "./feeburner/tx.rpc.msg"; -import * as _418 from "./feerefunder/tx.rpc.msg"; -import * as _419 from "./interchainqueries/tx.rpc.msg"; -import * as _420 from "./interchaintxs/v1/tx.rpc.msg"; -import * as _522 from "./rpc.query"; -import * as _523 from "./rpc.tx"; +import * as _153 from "./contractmanager/v1/failure"; +import * as _154 from "./cron/genesis"; +import * as _155 from "./cron/params"; +import * as _156 from "./cron/query"; +import * as _157 from "./cron/schedule"; +import * as _158 from "./cron/tx"; +import * as _159 from "./dex/deposit_record"; +import * as _160 from "./dex/genesis"; +import * as _161 from "./dex/limit_order_expiration"; +import * as _162 from "./dex/limit_order_tranche_user"; +import * as _163 from "./dex/limit_order_tranche"; +import * as _164 from "./dex/pair_id"; +import * as _165 from "./dex/params"; +import * as _166 from "./dex/pool_metadata"; +import * as _167 from "./dex/pool_reserves"; +import * as _168 from "./dex/pool"; +import * as _169 from "./dex/query"; +import * as _170 from "./dex/tick_liquidity"; +import * as _171 from "./dex/trade_pair_id"; +import * as _172 from "./dex/tx"; +import * as _173 from "./feeburner/genesis"; +import * as _174 from "./feeburner/params"; +import * as _175 from "./feeburner/query"; +import * as _176 from "./feeburner/total_burned_neutrons_amount"; +import * as _177 from "./feeburner/tx"; +import * as _178 from "./feerefunder/fee"; +import * as _179 from "./feerefunder/genesis"; +import * as _180 from "./feerefunder/params"; +import * as _181 from "./feerefunder/query"; +import * as _182 from "./feerefunder/tx"; +import * as _183 from "./interchainqueries/genesis"; +import * as _184 from "./interchainqueries/params"; +import * as _185 from "./interchainqueries/query"; +import * as _186 from "./interchainqueries/tx"; +import * as _187 from "./interchaintxs/v1/genesis"; +import * as _188 from "./interchaintxs/v1/params"; +import * as _189 from "./interchaintxs/v1/query"; +import * as _190 from "./interchaintxs/v1/tx"; +import * as _420 from "./cron/tx.amino"; +import * as _421 from "./dex/tx.amino"; +import * as _422 from "./feeburner/tx.amino"; +import * as _423 from "./feerefunder/tx.amino"; +import * as _424 from "./interchainqueries/tx.amino"; +import * as _425 from "./interchaintxs/v1/tx.amino"; +import * as _426 from "./cron/tx.registry"; +import * as _427 from "./dex/tx.registry"; +import * as _428 from "./feeburner/tx.registry"; +import * as _429 from "./feerefunder/tx.registry"; +import * as _430 from "./interchainqueries/tx.registry"; +import * as _431 from "./interchaintxs/v1/tx.registry"; +import * as _432 from "./cron/query.rpc.Query"; +import * as _433 from "./dex/query.rpc.Query"; +import * as _434 from "./feeburner/query.rpc.Query"; +import * as _435 from "./feerefunder/query.rpc.Query"; +import * as _436 from "./interchainqueries/query.rpc.Query"; +import * as _437 from "./interchaintxs/v1/query.rpc.Query"; +import * as _438 from "./cron/tx.rpc.msg"; +import * as _439 from "./dex/tx.rpc.msg"; +import * as _440 from "./feeburner/tx.rpc.msg"; +import * as _441 from "./feerefunder/tx.rpc.msg"; +import * as _442 from "./interchainqueries/tx.rpc.msg"; +import * as _443 from "./interchaintxs/v1/tx.rpc.msg"; +import * as _547 from "./rpc.query"; +import * as _548 from "./rpc.tx"; export namespace neutron { export namespace contractmanager { export const v1 = { - ..._139 + ..._153 }; } export const cron = { - ..._140, - ..._141, - ..._142, - ..._143, - ..._144, - ..._397, - ..._403, - ..._409, - ..._415 - }; - export const dex = { - ..._145, - ..._146, - ..._147, - ..._148, - ..._149, - ..._150, - ..._151, - ..._152, - ..._153, ..._154, ..._155, ..._156, ..._157, ..._158, - ..._398, - ..._404, - ..._410, - ..._416 + ..._420, + ..._426, + ..._432, + ..._438 }; - export const feeburner = { + export const dex = { ..._159, ..._160, ..._161, ..._162, ..._163, - ..._399, - ..._405, - ..._411, - ..._417 - }; - export const feerefunder = { ..._164, ..._165, ..._166, ..._167, ..._168, - ..._400, - ..._406, - ..._412, - ..._418 - }; - export const interchainqueries = { ..._169, ..._170, ..._171, ..._172, - ..._401, - ..._407, - ..._413, - ..._419 + ..._421, + ..._427, + ..._433, + ..._439 + }; + export const feeburner = { + ..._173, + ..._174, + ..._175, + ..._176, + ..._177, + ..._422, + ..._428, + ..._434, + ..._440 + }; + export const feerefunder = { + ..._178, + ..._179, + ..._180, + ..._181, + ..._182, + ..._423, + ..._429, + ..._435, + ..._441 + }; + export const interchainqueries = { + ..._183, + ..._184, + ..._185, + ..._186, + ..._424, + ..._430, + ..._436, + ..._442 }; export namespace interchaintxs { export const v1 = { - ..._173, - ..._174, - ..._175, - ..._176, - ..._402, - ..._408, - ..._414, - ..._420 + ..._187, + ..._188, + ..._189, + ..._190, + ..._425, + ..._431, + ..._437, + ..._443 }; } export const ClientFactory = { - ..._522, - ..._523 + ..._547, + ..._548 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/noble/bundle.ts b/packages/types/protobuf/codegen/noble/bundle.ts index 0fa954db0..97930acb4 100644 --- a/packages/types/protobuf/codegen/noble/bundle.ts +++ b/packages/types/protobuf/codegen/noble/bundle.ts @@ -1,16 +1,16 @@ -import * as _293 from "../tariff/genesis"; -import * as _294 from "../tariff/params"; -import * as _295 from "../tariff/query"; -import * as _507 from "../tariff/query.rpc.Query"; -import * as _530 from "./rpc.query"; +import * as _307 from "../tariff/genesis"; +import * as _308 from "../tariff/params"; +import * as _309 from "../tariff/query"; +import * as _530 from "../tariff/query.rpc.Query"; +import * as _555 from "./rpc.query"; export namespace noble { export const tariff = { - ..._293, - ..._294, - ..._295, - ..._507 + ..._307, + ..._308, + ..._309, + ..._530 }; export const ClientFactory = { - ..._530 + ..._555 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/bundle.ts b/packages/types/protobuf/codegen/osmosis/bundle.ts index a274e8368..4e946b228 100644 --- a/packages/types/protobuf/codegen/osmosis/bundle.ts +++ b/packages/types/protobuf/codegen/osmosis/bundle.ts @@ -1,314 +1,314 @@ -import * as _177 from "./accum/v1beta1/accum"; -import * as _178 from "./concentratedliquidity/params"; -import * as _179 from "./cosmwasmpool/v1beta1/genesis"; -import * as _180 from "./cosmwasmpool/v1beta1/gov"; -import * as _181 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; -import * as _182 from "./cosmwasmpool/v1beta1/model/module_query_msg"; -import * as _183 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; -import * as _184 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; -import * as _185 from "./cosmwasmpool/v1beta1/model/pool"; -import * as _186 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; -import * as _187 from "./cosmwasmpool/v1beta1/model/tx"; -import * as _188 from "./cosmwasmpool/v1beta1/params"; -import * as _189 from "./cosmwasmpool/v1beta1/query"; -import * as _190 from "./cosmwasmpool/v1beta1/tx"; -import * as _191 from "./gamm/pool-models/balancer/balancerPool"; -import * as _192 from "./gamm/v1beta1/genesis"; -import * as _193 from "./gamm/v1beta1/gov"; -import * as _194 from "./gamm/v1beta1/query"; -import * as _195 from "./gamm/v1beta1/shared"; -import * as _196 from "./gamm/v1beta1/tx"; -import * as _197 from "./gamm/pool-models/balancer/tx/tx"; -import * as _198 from "./gamm/pool-models/stableswap/stableswap_pool"; -import * as _199 from "./gamm/pool-models/stableswap/tx"; -import * as _200 from "./incentives/gauge"; -import * as _201 from "./incentives/genesis"; -import * as _202 from "./incentives/gov"; -import * as _203 from "./incentives/group"; -import * as _204 from "./incentives/params"; -import * as _205 from "./incentives/query"; -import * as _206 from "./incentives/tx"; -import * as _207 from "./lockup/genesis"; -import * as _208 from "./lockup/lock"; -import * as _209 from "./lockup/params"; -import * as _210 from "./lockup/query"; -import * as _211 from "./lockup/tx"; -import * as _212 from "./pool-incentives/v1beta1/genesis"; -import * as _213 from "./pool-incentives/v1beta1/gov"; -import * as _214 from "./pool-incentives/v1beta1/incentives"; -import * as _215 from "./pool-incentives/v1beta1/query"; -import * as _216 from "./pool-incentives/v1beta1/shared"; -import * as _217 from "./poolmanager/v1beta1/genesis"; -import * as _218 from "./poolmanager/v1beta1/gov"; -import * as _219 from "./poolmanager/v1beta1/module_route"; -import * as _220 from "./poolmanager/v1beta1/query"; -import * as _221 from "./poolmanager/v1beta1/swap_route"; -import * as _222 from "./poolmanager/v1beta1/tx"; -import * as _223 from "./protorev/v1beta1/genesis"; -import * as _224 from "./protorev/v1beta1/gov"; -import * as _225 from "./protorev/v1beta1/params"; -import * as _226 from "./protorev/v1beta1/protorev"; -import * as _227 from "./protorev/v1beta1/query"; -import * as _228 from "./protorev/v1beta1/tx"; -import * as _229 from "./superfluid/genesis"; -import * as _230 from "./superfluid/params"; -import * as _231 from "./superfluid/query"; -import * as _232 from "./superfluid/superfluid"; -import * as _233 from "./superfluid/tx"; -import * as _234 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _235 from "./tokenfactory/v1beta1/genesis"; -import * as _236 from "./tokenfactory/v1beta1/params"; -import * as _237 from "./tokenfactory/v1beta1/query"; -import * as _238 from "./tokenfactory/v1beta1/tx"; -import * as _239 from "./txfees/v1beta1/feetoken"; -import * as _240 from "./txfees/v1beta1/genesis"; -import * as _241 from "./txfees/v1beta1/gov"; -import * as _242 from "./txfees/v1beta1/params"; -import * as _243 from "./txfees/v1beta1/query"; -import * as _244 from "./txfees/v1beta1/tx"; -import * as _245 from "./valset-pref/v1beta1/query"; -import * as _246 from "./valset-pref/v1beta1/state"; -import * as _247 from "./valset-pref/v1beta1/tx"; -import * as _421 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; -import * as _422 from "./concentratedliquidity/v1beta1/tx.amino"; -import * as _423 from "./gamm/pool-models/balancer/tx/tx.amino"; -import * as _424 from "./gamm/pool-models/stableswap/tx.amino"; -import * as _425 from "./gamm/v1beta1/tx.amino"; -import * as _426 from "./incentives/tx.amino"; -import * as _427 from "./lockup/tx.amino"; -import * as _428 from "./poolmanager/v1beta1/tx.amino"; -import * as _429 from "./protorev/v1beta1/tx.amino"; -import * as _430 from "./superfluid/tx.amino"; -import * as _431 from "./tokenfactory/v1beta1/tx.amino"; -import * as _432 from "./txfees/v1beta1/tx.amino"; -import * as _433 from "./valset-pref/v1beta1/tx.amino"; -import * as _434 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; -import * as _435 from "./concentratedliquidity/v1beta1/tx.registry"; -import * as _436 from "./gamm/pool-models/balancer/tx/tx.registry"; -import * as _437 from "./gamm/pool-models/stableswap/tx.registry"; -import * as _438 from "./gamm/v1beta1/tx.registry"; -import * as _439 from "./incentives/tx.registry"; -import * as _440 from "./lockup/tx.registry"; -import * as _441 from "./poolmanager/v1beta1/tx.registry"; -import * as _442 from "./protorev/v1beta1/tx.registry"; -import * as _443 from "./superfluid/tx.registry"; -import * as _444 from "./tokenfactory/v1beta1/tx.registry"; -import * as _445 from "./txfees/v1beta1/tx.registry"; -import * as _446 from "./valset-pref/v1beta1/tx.registry"; -import * as _447 from "./concentratedliquidity/v1beta1/query.rpc.Query"; -import * as _448 from "./cosmwasmpool/v1beta1/query.rpc.Query"; -import * as _449 from "./gamm/v1beta1/query.rpc.Query"; -import * as _450 from "./incentives/query.rpc.Query"; -import * as _451 from "./lockup/query.rpc.Query"; -import * as _452 from "./pool-incentives/v1beta1/query.rpc.Query"; -import * as _453 from "./poolmanager/v1beta1/query.rpc.Query"; -import * as _454 from "./protorev/v1beta1/query.rpc.Query"; -import * as _455 from "./superfluid/query.rpc.Query"; -import * as _456 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _457 from "./txfees/v1beta1/query.rpc.Query"; -import * as _458 from "./valset-pref/v1beta1/query.rpc.Query"; -import * as _459 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; -import * as _460 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; -import * as _461 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; -import * as _462 from "./gamm/pool-models/stableswap/tx.rpc.msg"; -import * as _463 from "./gamm/v1beta1/tx.rpc.msg"; -import * as _464 from "./incentives/tx.rpc.msg"; -import * as _465 from "./lockup/tx.rpc.msg"; -import * as _466 from "./poolmanager/v1beta1/tx.rpc.msg"; -import * as _467 from "./protorev/v1beta1/tx.rpc.msg"; -import * as _468 from "./superfluid/tx.rpc.msg"; -import * as _469 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _470 from "./txfees/v1beta1/tx.rpc.msg"; -import * as _471 from "./valset-pref/v1beta1/tx.rpc.msg"; -import * as _524 from "./rpc.query"; -import * as _525 from "./rpc.tx"; +import * as _191 from "./accum/v1beta1/accum"; +import * as _192 from "./concentratedliquidity/params"; +import * as _193 from "./cosmwasmpool/v1beta1/genesis"; +import * as _194 from "./cosmwasmpool/v1beta1/gov"; +import * as _195 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; +import * as _196 from "./cosmwasmpool/v1beta1/model/module_query_msg"; +import * as _197 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; +import * as _198 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; +import * as _199 from "./cosmwasmpool/v1beta1/model/pool"; +import * as _200 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; +import * as _201 from "./cosmwasmpool/v1beta1/model/tx"; +import * as _202 from "./cosmwasmpool/v1beta1/params"; +import * as _203 from "./cosmwasmpool/v1beta1/query"; +import * as _204 from "./cosmwasmpool/v1beta1/tx"; +import * as _205 from "./gamm/pool-models/balancer/balancerPool"; +import * as _206 from "./gamm/v1beta1/genesis"; +import * as _207 from "./gamm/v1beta1/gov"; +import * as _208 from "./gamm/v1beta1/query"; +import * as _209 from "./gamm/v1beta1/shared"; +import * as _210 from "./gamm/v1beta1/tx"; +import * as _211 from "./gamm/pool-models/balancer/tx/tx"; +import * as _212 from "./gamm/pool-models/stableswap/stableswap_pool"; +import * as _213 from "./gamm/pool-models/stableswap/tx"; +import * as _214 from "./incentives/gauge"; +import * as _215 from "./incentives/genesis"; +import * as _216 from "./incentives/gov"; +import * as _217 from "./incentives/group"; +import * as _218 from "./incentives/params"; +import * as _219 from "./incentives/query"; +import * as _220 from "./incentives/tx"; +import * as _221 from "./lockup/genesis"; +import * as _222 from "./lockup/lock"; +import * as _223 from "./lockup/params"; +import * as _224 from "./lockup/query"; +import * as _225 from "./lockup/tx"; +import * as _226 from "./pool-incentives/v1beta1/genesis"; +import * as _227 from "./pool-incentives/v1beta1/gov"; +import * as _228 from "./pool-incentives/v1beta1/incentives"; +import * as _229 from "./pool-incentives/v1beta1/query"; +import * as _230 from "./pool-incentives/v1beta1/shared"; +import * as _231 from "./poolmanager/v1beta1/genesis"; +import * as _232 from "./poolmanager/v1beta1/gov"; +import * as _233 from "./poolmanager/v1beta1/module_route"; +import * as _234 from "./poolmanager/v1beta1/query"; +import * as _235 from "./poolmanager/v1beta1/swap_route"; +import * as _236 from "./poolmanager/v1beta1/tx"; +import * as _237 from "./protorev/v1beta1/genesis"; +import * as _238 from "./protorev/v1beta1/gov"; +import * as _239 from "./protorev/v1beta1/params"; +import * as _240 from "./protorev/v1beta1/protorev"; +import * as _241 from "./protorev/v1beta1/query"; +import * as _242 from "./protorev/v1beta1/tx"; +import * as _243 from "./superfluid/genesis"; +import * as _244 from "./superfluid/params"; +import * as _245 from "./superfluid/query"; +import * as _246 from "./superfluid/superfluid"; +import * as _247 from "./superfluid/tx"; +import * as _248 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _249 from "./tokenfactory/v1beta1/genesis"; +import * as _250 from "./tokenfactory/v1beta1/params"; +import * as _251 from "./tokenfactory/v1beta1/query"; +import * as _252 from "./tokenfactory/v1beta1/tx"; +import * as _253 from "./txfees/v1beta1/feetoken"; +import * as _254 from "./txfees/v1beta1/genesis"; +import * as _255 from "./txfees/v1beta1/gov"; +import * as _256 from "./txfees/v1beta1/params"; +import * as _257 from "./txfees/v1beta1/query"; +import * as _258 from "./txfees/v1beta1/tx"; +import * as _259 from "./valset-pref/v1beta1/query"; +import * as _260 from "./valset-pref/v1beta1/state"; +import * as _261 from "./valset-pref/v1beta1/tx"; +import * as _444 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; +import * as _445 from "./concentratedliquidity/v1beta1/tx.amino"; +import * as _446 from "./gamm/pool-models/balancer/tx/tx.amino"; +import * as _447 from "./gamm/pool-models/stableswap/tx.amino"; +import * as _448 from "./gamm/v1beta1/tx.amino"; +import * as _449 from "./incentives/tx.amino"; +import * as _450 from "./lockup/tx.amino"; +import * as _451 from "./poolmanager/v1beta1/tx.amino"; +import * as _452 from "./protorev/v1beta1/tx.amino"; +import * as _453 from "./superfluid/tx.amino"; +import * as _454 from "./tokenfactory/v1beta1/tx.amino"; +import * as _455 from "./txfees/v1beta1/tx.amino"; +import * as _456 from "./valset-pref/v1beta1/tx.amino"; +import * as _457 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; +import * as _458 from "./concentratedliquidity/v1beta1/tx.registry"; +import * as _459 from "./gamm/pool-models/balancer/tx/tx.registry"; +import * as _460 from "./gamm/pool-models/stableswap/tx.registry"; +import * as _461 from "./gamm/v1beta1/tx.registry"; +import * as _462 from "./incentives/tx.registry"; +import * as _463 from "./lockup/tx.registry"; +import * as _464 from "./poolmanager/v1beta1/tx.registry"; +import * as _465 from "./protorev/v1beta1/tx.registry"; +import * as _466 from "./superfluid/tx.registry"; +import * as _467 from "./tokenfactory/v1beta1/tx.registry"; +import * as _468 from "./txfees/v1beta1/tx.registry"; +import * as _469 from "./valset-pref/v1beta1/tx.registry"; +import * as _470 from "./concentratedliquidity/v1beta1/query.rpc.Query"; +import * as _471 from "./cosmwasmpool/v1beta1/query.rpc.Query"; +import * as _472 from "./gamm/v1beta1/query.rpc.Query"; +import * as _473 from "./incentives/query.rpc.Query"; +import * as _474 from "./lockup/query.rpc.Query"; +import * as _475 from "./pool-incentives/v1beta1/query.rpc.Query"; +import * as _476 from "./poolmanager/v1beta1/query.rpc.Query"; +import * as _477 from "./protorev/v1beta1/query.rpc.Query"; +import * as _478 from "./superfluid/query.rpc.Query"; +import * as _479 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _480 from "./txfees/v1beta1/query.rpc.Query"; +import * as _481 from "./valset-pref/v1beta1/query.rpc.Query"; +import * as _482 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; +import * as _483 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; +import * as _484 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; +import * as _485 from "./gamm/pool-models/stableswap/tx.rpc.msg"; +import * as _486 from "./gamm/v1beta1/tx.rpc.msg"; +import * as _487 from "./incentives/tx.rpc.msg"; +import * as _488 from "./lockup/tx.rpc.msg"; +import * as _489 from "./poolmanager/v1beta1/tx.rpc.msg"; +import * as _490 from "./protorev/v1beta1/tx.rpc.msg"; +import * as _491 from "./superfluid/tx.rpc.msg"; +import * as _492 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _493 from "./txfees/v1beta1/tx.rpc.msg"; +import * as _494 from "./valset-pref/v1beta1/tx.rpc.msg"; +import * as _549 from "./rpc.query"; +import * as _550 from "./rpc.tx"; export namespace osmosis { export namespace accum { export const v1beta1 = { - ..._177 + ..._191 }; } export const concentratedliquidity = { - ..._178, + ..._192, poolmodel: { concentrated: { v1beta1: { - ..._421, - ..._434, - ..._459 + ..._444, + ..._457, + ..._482 } } }, v1beta1: { - ..._422, - ..._435, - ..._447, - ..._460 + ..._445, + ..._458, + ..._470, + ..._483 } }; export namespace cosmwasmpool { export const v1beta1 = { - ..._179, - ..._180, - ..._181, - ..._182, - ..._183, - ..._184, - ..._185, - ..._186, - ..._187, - ..._188, - ..._189, - ..._190, - ..._448 - }; - } - export namespace gamm { - export const v1beta1 = { - ..._191, - ..._192, ..._193, ..._194, ..._195, ..._196, - ..._425, - ..._438, - ..._449, - ..._463 + ..._197, + ..._198, + ..._199, + ..._200, + ..._201, + ..._202, + ..._203, + ..._204, + ..._471 + }; + } + export namespace gamm { + export const v1beta1 = { + ..._205, + ..._206, + ..._207, + ..._208, + ..._209, + ..._210, + ..._448, + ..._461, + ..._472, + ..._486 }; export namespace poolmodels { export namespace balancer { export const v1beta1 = { - ..._197, - ..._423, - ..._436, - ..._461 + ..._211, + ..._446, + ..._459, + ..._484 }; } export namespace stableswap { export const v1beta1 = { - ..._198, - ..._199, - ..._424, - ..._437, - ..._462 + ..._212, + ..._213, + ..._447, + ..._460, + ..._485 }; } } } export const incentives = { - ..._200, - ..._201, - ..._202, - ..._203, - ..._204, - ..._205, - ..._206, - ..._426, - ..._439, - ..._450, - ..._464 + ..._214, + ..._215, + ..._216, + ..._217, + ..._218, + ..._219, + ..._220, + ..._449, + ..._462, + ..._473, + ..._487 }; export const lockup = { - ..._207, - ..._208, - ..._209, - ..._210, - ..._211, - ..._427, - ..._440, - ..._451, - ..._465 + ..._221, + ..._222, + ..._223, + ..._224, + ..._225, + ..._450, + ..._463, + ..._474, + ..._488 }; export namespace poolincentives { export const v1beta1 = { - ..._212, - ..._213, - ..._214, - ..._215, - ..._216, - ..._452 + ..._226, + ..._227, + ..._228, + ..._229, + ..._230, + ..._475 }; } export namespace poolmanager { export const v1beta1 = { - ..._217, - ..._218, - ..._219, - ..._220, - ..._221, - ..._222, - ..._428, - ..._441, - ..._453, - ..._466 + ..._231, + ..._232, + ..._233, + ..._234, + ..._235, + ..._236, + ..._451, + ..._464, + ..._476, + ..._489 }; } export namespace protorev { export const v1beta1 = { - ..._223, - ..._224, - ..._225, - ..._226, - ..._227, - ..._228, - ..._429, - ..._442, - ..._454, - ..._467 + ..._237, + ..._238, + ..._239, + ..._240, + ..._241, + ..._242, + ..._452, + ..._465, + ..._477, + ..._490 }; } export const superfluid = { - ..._229, - ..._230, - ..._231, - ..._232, - ..._233, - ..._430, - ..._443, - ..._455, - ..._468 + ..._243, + ..._244, + ..._245, + ..._246, + ..._247, + ..._453, + ..._466, + ..._478, + ..._491 }; export namespace tokenfactory { export const v1beta1 = { - ..._234, - ..._235, - ..._236, - ..._237, - ..._238, - ..._431, - ..._444, - ..._456, - ..._469 + ..._248, + ..._249, + ..._250, + ..._251, + ..._252, + ..._454, + ..._467, + ..._479, + ..._492 }; } export namespace txfees { export const v1beta1 = { - ..._239, - ..._240, - ..._241, - ..._242, - ..._243, - ..._244, - ..._432, - ..._445, - ..._457, - ..._470 + ..._253, + ..._254, + ..._255, + ..._256, + ..._257, + ..._258, + ..._455, + ..._468, + ..._480, + ..._493 }; } export namespace valsetpref { export const v1beta1 = { - ..._245, - ..._246, - ..._247, - ..._433, - ..._446, - ..._458, - ..._471 + ..._259, + ..._260, + ..._261, + ..._456, + ..._469, + ..._481, + ..._494 }; } export const ClientFactory = { - ..._524, - ..._525 + ..._549, + ..._550 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/publicawesome/bundle.ts b/packages/types/protobuf/codegen/publicawesome/bundle.ts index 916e04fb7..ad8d7409b 100644 --- a/packages/types/protobuf/codegen/publicawesome/bundle.ts +++ b/packages/types/protobuf/codegen/publicawesome/bundle.ts @@ -1,88 +1,88 @@ -import * as _248 from "./stargaze/alloc/v1beta1/genesis"; -import * as _249 from "./stargaze/alloc/v1beta1/params"; -import * as _250 from "./stargaze/alloc/v1beta1/query"; -import * as _251 from "./stargaze/alloc/v1beta1/tx"; -import * as _252 from "./stargaze/cron/v1/cron"; -import * as _253 from "./stargaze/cron/v1/genesis"; -import * as _254 from "./stargaze/cron/v1/proposal"; -import * as _255 from "./stargaze/cron/v1/query"; -import * as _256 from "./stargaze/cron/v1/tx"; -import * as _257 from "./stargaze/globalfee/v1/genesis"; -import * as _258 from "./stargaze/globalfee/v1/globalfee"; -import * as _259 from "./stargaze/globalfee/v1/proposal"; -import * as _260 from "./stargaze/globalfee/v1/query"; -import * as _261 from "./stargaze/globalfee/v1/tx"; -import * as _262 from "./stargaze/mint/v1beta1/genesis"; -import * as _263 from "./stargaze/mint/v1beta1/mint"; -import * as _264 from "./stargaze/mint/v1beta1/query"; -import * as _265 from "./stargaze/mint/v1beta1/tx"; -import * as _472 from "./stargaze/alloc/v1beta1/tx.amino"; -import * as _473 from "./stargaze/cron/v1/tx.amino"; -import * as _474 from "./stargaze/globalfee/v1/tx.amino"; -import * as _475 from "./stargaze/alloc/v1beta1/tx.registry"; -import * as _476 from "./stargaze/cron/v1/tx.registry"; -import * as _477 from "./stargaze/globalfee/v1/tx.registry"; -import * as _478 from "./stargaze/alloc/v1beta1/query.rpc.Query"; -import * as _479 from "./stargaze/cron/v1/query.rpc.Query"; -import * as _480 from "./stargaze/globalfee/v1/query.rpc.Query"; -import * as _481 from "./stargaze/mint/v1beta1/query.rpc.Query"; -import * as _482 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; -import * as _483 from "./stargaze/cron/v1/tx.rpc.msg"; -import * as _484 from "./stargaze/globalfee/v1/tx.rpc.msg"; -import * as _526 from "./rpc.query"; -import * as _527 from "./rpc.tx"; +import * as _262 from "./stargaze/alloc/v1beta1/genesis"; +import * as _263 from "./stargaze/alloc/v1beta1/params"; +import * as _264 from "./stargaze/alloc/v1beta1/query"; +import * as _265 from "./stargaze/alloc/v1beta1/tx"; +import * as _266 from "./stargaze/cron/v1/cron"; +import * as _267 from "./stargaze/cron/v1/genesis"; +import * as _268 from "./stargaze/cron/v1/proposal"; +import * as _269 from "./stargaze/cron/v1/query"; +import * as _270 from "./stargaze/cron/v1/tx"; +import * as _271 from "./stargaze/globalfee/v1/genesis"; +import * as _272 from "./stargaze/globalfee/v1/globalfee"; +import * as _273 from "./stargaze/globalfee/v1/proposal"; +import * as _274 from "./stargaze/globalfee/v1/query"; +import * as _275 from "./stargaze/globalfee/v1/tx"; +import * as _276 from "./stargaze/mint/v1beta1/genesis"; +import * as _277 from "./stargaze/mint/v1beta1/mint"; +import * as _278 from "./stargaze/mint/v1beta1/query"; +import * as _279 from "./stargaze/mint/v1beta1/tx"; +import * as _495 from "./stargaze/alloc/v1beta1/tx.amino"; +import * as _496 from "./stargaze/cron/v1/tx.amino"; +import * as _497 from "./stargaze/globalfee/v1/tx.amino"; +import * as _498 from "./stargaze/alloc/v1beta1/tx.registry"; +import * as _499 from "./stargaze/cron/v1/tx.registry"; +import * as _500 from "./stargaze/globalfee/v1/tx.registry"; +import * as _501 from "./stargaze/alloc/v1beta1/query.rpc.Query"; +import * as _502 from "./stargaze/cron/v1/query.rpc.Query"; +import * as _503 from "./stargaze/globalfee/v1/query.rpc.Query"; +import * as _504 from "./stargaze/mint/v1beta1/query.rpc.Query"; +import * as _505 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; +import * as _506 from "./stargaze/cron/v1/tx.rpc.msg"; +import * as _507 from "./stargaze/globalfee/v1/tx.rpc.msg"; +import * as _551 from "./rpc.query"; +import * as _552 from "./rpc.tx"; export namespace publicawesome { export namespace stargaze { export namespace alloc { export const v1beta1 = { - ..._248, - ..._249, - ..._250, - ..._251, - ..._472, - ..._475, - ..._478, - ..._482 + ..._262, + ..._263, + ..._264, + ..._265, + ..._495, + ..._498, + ..._501, + ..._505 }; } export namespace cron { export const v1 = { - ..._252, - ..._253, - ..._254, - ..._255, - ..._256, - ..._473, - ..._476, - ..._479, - ..._483 + ..._266, + ..._267, + ..._268, + ..._269, + ..._270, + ..._496, + ..._499, + ..._502, + ..._506 }; } export namespace globalfee { export const v1 = { - ..._257, - ..._258, - ..._259, - ..._260, - ..._261, - ..._474, - ..._477, - ..._480, - ..._484 + ..._271, + ..._272, + ..._273, + ..._274, + ..._275, + ..._497, + ..._500, + ..._503, + ..._507 }; } export namespace mint { export const v1beta1 = { - ..._262, - ..._263, - ..._264, - ..._265, - ..._481 + ..._276, + ..._277, + ..._278, + ..._279, + ..._504 }; } } export const ClientFactory = { - ..._526, - ..._527 + ..._551, + ..._552 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/regen/bundle.ts b/packages/types/protobuf/codegen/regen/bundle.ts index ce81a41e3..d37af239c 100644 --- a/packages/types/protobuf/codegen/regen/bundle.ts +++ b/packages/types/protobuf/codegen/regen/bundle.ts @@ -1,134 +1,134 @@ -import * as _266 from "./data/v1/events"; -import * as _267 from "./data/v1/state"; -import * as _268 from "./data/v1/tx"; -import * as _269 from "./data/v1/types"; -import * as _270 from "./data/v2/events"; -import * as _271 from "./data/v2/state"; -import * as _272 from "./data/v2/tx"; -import * as _273 from "./data/v2/types"; -import * as _274 from "./ecocredit/basket/v1/events"; -import * as _275 from "./ecocredit/basket/v1/state"; -import * as _276 from "./ecocredit/basket/v1/tx"; -import * as _277 from "./ecocredit/basket/v1/types"; -import * as _278 from "./ecocredit/marketplace/v1/events"; -import * as _279 from "./ecocredit/marketplace/v1/state"; -import * as _280 from "./ecocredit/marketplace/v1/tx"; -import * as _281 from "./ecocredit/marketplace/v1/types"; -import * as _282 from "./ecocredit/orderbook/v1alpha1/memory"; -import * as _283 from "./ecocredit/v1/events"; -import * as _284 from "./ecocredit/v1/state"; -import * as _285 from "./ecocredit/v1/tx"; -import * as _286 from "./ecocredit/v1/types"; -import * as _287 from "./ecocredit/v1alpha1/events"; -import * as _288 from "./ecocredit/v1alpha1/genesis"; -import * as _289 from "./ecocredit/v1alpha1/tx"; -import * as _290 from "./ecocredit/v1alpha1/types"; -import * as _291 from "./intertx/v1/query"; -import * as _292 from "./intertx/v1/tx"; -import * as _485 from "./data/v1/tx.amino"; -import * as _486 from "./data/v2/tx.amino"; -import * as _487 from "./ecocredit/basket/v1/tx.amino"; -import * as _488 from "./ecocredit/marketplace/v1/tx.amino"; -import * as _489 from "./ecocredit/v1/tx.amino"; -import * as _490 from "./ecocredit/v1alpha1/tx.amino"; -import * as _491 from "./intertx/v1/tx.amino"; -import * as _492 from "./data/v1/tx.registry"; -import * as _493 from "./data/v2/tx.registry"; -import * as _494 from "./ecocredit/basket/v1/tx.registry"; -import * as _495 from "./ecocredit/marketplace/v1/tx.registry"; -import * as _496 from "./ecocredit/v1/tx.registry"; -import * as _497 from "./ecocredit/v1alpha1/tx.registry"; -import * as _498 from "./intertx/v1/tx.registry"; -import * as _499 from "./intertx/v1/query.rpc.Query"; -import * as _500 from "./data/v1/tx.rpc.msg"; -import * as _501 from "./data/v2/tx.rpc.msg"; -import * as _502 from "./ecocredit/basket/v1/tx.rpc.msg"; -import * as _503 from "./ecocredit/marketplace/v1/tx.rpc.msg"; -import * as _504 from "./ecocredit/v1/tx.rpc.msg"; -import * as _505 from "./ecocredit/v1alpha1/tx.rpc.msg"; -import * as _506 from "./intertx/v1/tx.rpc.msg"; -import * as _528 from "./rpc.query"; -import * as _529 from "./rpc.tx"; +import * as _280 from "./data/v1/events"; +import * as _281 from "./data/v1/state"; +import * as _282 from "./data/v1/tx"; +import * as _283 from "./data/v1/types"; +import * as _284 from "./data/v2/events"; +import * as _285 from "./data/v2/state"; +import * as _286 from "./data/v2/tx"; +import * as _287 from "./data/v2/types"; +import * as _288 from "./ecocredit/basket/v1/events"; +import * as _289 from "./ecocredit/basket/v1/state"; +import * as _290 from "./ecocredit/basket/v1/tx"; +import * as _291 from "./ecocredit/basket/v1/types"; +import * as _292 from "./ecocredit/marketplace/v1/events"; +import * as _293 from "./ecocredit/marketplace/v1/state"; +import * as _294 from "./ecocredit/marketplace/v1/tx"; +import * as _295 from "./ecocredit/marketplace/v1/types"; +import * as _296 from "./ecocredit/orderbook/v1alpha1/memory"; +import * as _297 from "./ecocredit/v1/events"; +import * as _298 from "./ecocredit/v1/state"; +import * as _299 from "./ecocredit/v1/tx"; +import * as _300 from "./ecocredit/v1/types"; +import * as _301 from "./ecocredit/v1alpha1/events"; +import * as _302 from "./ecocredit/v1alpha1/genesis"; +import * as _303 from "./ecocredit/v1alpha1/tx"; +import * as _304 from "./ecocredit/v1alpha1/types"; +import * as _305 from "./intertx/v1/query"; +import * as _306 from "./intertx/v1/tx"; +import * as _508 from "./data/v1/tx.amino"; +import * as _509 from "./data/v2/tx.amino"; +import * as _510 from "./ecocredit/basket/v1/tx.amino"; +import * as _511 from "./ecocredit/marketplace/v1/tx.amino"; +import * as _512 from "./ecocredit/v1/tx.amino"; +import * as _513 from "./ecocredit/v1alpha1/tx.amino"; +import * as _514 from "./intertx/v1/tx.amino"; +import * as _515 from "./data/v1/tx.registry"; +import * as _516 from "./data/v2/tx.registry"; +import * as _517 from "./ecocredit/basket/v1/tx.registry"; +import * as _518 from "./ecocredit/marketplace/v1/tx.registry"; +import * as _519 from "./ecocredit/v1/tx.registry"; +import * as _520 from "./ecocredit/v1alpha1/tx.registry"; +import * as _521 from "./intertx/v1/tx.registry"; +import * as _522 from "./intertx/v1/query.rpc.Query"; +import * as _523 from "./data/v1/tx.rpc.msg"; +import * as _524 from "./data/v2/tx.rpc.msg"; +import * as _525 from "./ecocredit/basket/v1/tx.rpc.msg"; +import * as _526 from "./ecocredit/marketplace/v1/tx.rpc.msg"; +import * as _527 from "./ecocredit/v1/tx.rpc.msg"; +import * as _528 from "./ecocredit/v1alpha1/tx.rpc.msg"; +import * as _529 from "./intertx/v1/tx.rpc.msg"; +import * as _553 from "./rpc.query"; +import * as _554 from "./rpc.tx"; export namespace regen { export namespace data { export const v1 = { - ..._266, - ..._267, - ..._268, - ..._269, - ..._485, - ..._492, - ..._500 + ..._280, + ..._281, + ..._282, + ..._283, + ..._508, + ..._515, + ..._523 }; export const v2 = { - ..._270, - ..._271, - ..._272, - ..._273, - ..._486, - ..._493, - ..._501 + ..._284, + ..._285, + ..._286, + ..._287, + ..._509, + ..._516, + ..._524 }; } export namespace ecocredit { export namespace basket { export const v1 = { - ..._274, - ..._275, - ..._276, - ..._277, - ..._487, - ..._494, - ..._502 + ..._288, + ..._289, + ..._290, + ..._291, + ..._510, + ..._517, + ..._525 }; } export namespace marketplace { export const v1 = { - ..._278, - ..._279, - ..._280, - ..._281, - ..._488, - ..._495, - ..._503 + ..._292, + ..._293, + ..._294, + ..._295, + ..._511, + ..._518, + ..._526 }; } export namespace orderbook { export const v1alpha1 = { - ..._282 + ..._296 }; } export const v1 = { - ..._283, - ..._284, - ..._285, - ..._286, - ..._489, - ..._496, - ..._504 + ..._297, + ..._298, + ..._299, + ..._300, + ..._512, + ..._519, + ..._527 }; export const v1alpha1 = { - ..._287, - ..._288, - ..._289, - ..._290, - ..._490, - ..._497, - ..._505 + ..._301, + ..._302, + ..._303, + ..._304, + ..._513, + ..._520, + ..._528 }; } export namespace intertx { export const v1 = { - ..._291, - ..._292, - ..._491, - ..._498, - ..._499, - ..._506 + ..._305, + ..._306, + ..._514, + ..._521, + ..._522, + ..._529 }; } export const ClientFactory = { - ..._528, - ..._529 + ..._553, + ..._554 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/tendermint/bundle.ts b/packages/types/protobuf/codegen/tendermint/bundle.ts index a31a79791..fd0dd70f6 100644 --- a/packages/types/protobuf/codegen/tendermint/bundle.ts +++ b/packages/types/protobuf/codegen/tendermint/bundle.ts @@ -1,32 +1,32 @@ -import * as _296 from "./abci/types"; -import * as _297 from "./crypto/keys"; -import * as _298 from "./crypto/proof"; -import * as _299 from "./p2p/types"; -import * as _300 from "./types/block"; -import * as _301 from "./types/evidence"; -import * as _302 from "./types/params"; -import * as _303 from "./types/types"; -import * as _304 from "./types/validator"; -import * as _305 from "./version/types"; +import * as _310 from "./abci/types"; +import * as _311 from "./crypto/keys"; +import * as _312 from "./crypto/proof"; +import * as _313 from "./p2p/types"; +import * as _314 from "./types/block"; +import * as _315 from "./types/evidence"; +import * as _316 from "./types/params"; +import * as _317 from "./types/types"; +import * as _318 from "./types/validator"; +import * as _319 from "./version/types"; export namespace tendermint { export const abci = { - ..._296 + ..._310 }; export const crypto = { - ..._297, - ..._298 + ..._311, + ..._312 }; export const p2p = { - ..._299 + ..._313 }; export const types = { - ..._300, - ..._301, - ..._302, - ..._303, - ..._304 + ..._314, + ..._315, + ..._316, + ..._317, + ..._318 }; export const version = { - ..._305 + ..._319 }; } \ No newline at end of file diff --git a/packages/types/protobuf/proto/kujira/denom/authorityMetadata.proto b/packages/types/protobuf/proto/kujira/denom/authorityMetadata.proto new file mode 100644 index 000000000..283e9327c --- /dev/null +++ b/packages/types/protobuf/proto/kujira/denom/authorityMetadata.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package kujira.denom; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/Team-Kujira/core/x/denom/types"; + +// DenomAuthorityMetadata specifies metadata for addresses that have specific +// capabilities over a token factory denom. Right now there is only one Admin +// permission, but is planned to be extended to the future. +message DenomAuthorityMetadata { + option (gogoproto.equal) = true; + + // Can be empty for no admin, or a valid kujira address + string Admin = 1 [ (gogoproto.moretags) = "yaml:\"admin\"" ]; +} diff --git a/packages/types/protobuf/proto/kujira/denom/genesis.proto b/packages/types/protobuf/proto/kujira/denom/genesis.proto new file mode 100644 index 000000000..1bd46fd6f --- /dev/null +++ b/packages/types/protobuf/proto/kujira/denom/genesis.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package kujira.denom; + +import "gogoproto/gogo.proto"; +import "kujira/denom/authorityMetadata.proto"; +import "kujira/denom/params.proto"; + +option go_package = "github.com/Team-Kujira/core/x/denom/types"; + +// GenesisState defines the denom module's genesis state. +message GenesisState { + // params defines the paramaters of the module. + Params params = 1 [ (gogoproto.nullable) = false ]; + + repeated GenesisDenom factory_denoms = 2 [ + (gogoproto.moretags) = "yaml:\"factory_denoms\"", + (gogoproto.nullable) = false + ]; +} + +message GenesisDenom { + option (gogoproto.equal) = true; + + string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; + DenomAuthorityMetadata authority_metadata = 2 [ + (gogoproto.moretags) = "yaml:\"authority_metadata\"", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/kujira/denom/params.proto b/packages/types/protobuf/proto/kujira/denom/params.proto new file mode 100644 index 000000000..09faded02 --- /dev/null +++ b/packages/types/protobuf/proto/kujira/denom/params.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package kujira.denom; + +import "gogoproto/gogo.proto"; +import "kujira/denom/authorityMetadata.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/Team-Kujira/core/x/denom/types"; + +// Params holds parameters for the denom module +message Params { + repeated cosmos.base.v1beta1.Coin creation_fee = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"creation_fee\"", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/types/protobuf/proto/kujira/denom/query.proto b/packages/types/protobuf/proto/kujira/denom/query.proto new file mode 100644 index 000000000..bf233df35 --- /dev/null +++ b/packages/types/protobuf/proto/kujira/denom/query.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; +package kujira.denom; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "kujira/denom/authorityMetadata.proto"; +import "kujira/denom/params.proto"; + +option go_package = "github.com/Team-Kujira/core/x/denom/types"; + +// Query defines the gRPC querier service. +service Query { + // Params returns the total set of minting parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/kujira/denoms/params"; + } + + rpc DenomAuthorityMetadata(QueryDenomAuthorityMetadataRequest) + returns (QueryDenomAuthorityMetadataResponse) { + option (google.api.http).get = + "/kujira/denoms/{denom}/authority_metadata"; + } + + rpc DenomsFromCreator(QueryDenomsFromCreatorRequest) + returns (QueryDenomsFromCreatorResponse) { + option (google.api.http).get = + "/kujira/denoms/by_creator/{creator}"; + } +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryDenomAuthorityMetadataRequest { + string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; +} +message QueryDenomAuthorityMetadataResponse { + DenomAuthorityMetadata authority_metadata = 1 [ + (gogoproto.moretags) = "yaml:\"authority_metadata\"", + (gogoproto.nullable) = false + ]; +} + +message QueryDenomsFromCreatorRequest { + string creator = 1 [ (gogoproto.moretags) = "yaml:\"creator\"" ]; +} +message QueryDenomsFromCreatorResponse { + repeated string denoms = 1 [ (gogoproto.moretags) = "yaml:\"denoms\"" ]; +} diff --git a/packages/types/protobuf/proto/kujira/denom/tx.proto b/packages/types/protobuf/proto/kujira/denom/tx.proto new file mode 100644 index 000000000..9378cb5a2 --- /dev/null +++ b/packages/types/protobuf/proto/kujira/denom/tx.proto @@ -0,0 +1,83 @@ +syntax = "proto3"; +package kujira.denom; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/Team-Kujira/core/x/denom/types"; + +// Msg defines the Msg service. +service Msg { + rpc CreateDenom(MsgCreateDenom) returns (MsgCreateDenomResponse); + rpc Mint(MsgMint) returns (MsgMintResponse); + rpc Burn(MsgBurn) returns (MsgBurnResponse); + // ForceTransfer is deactivated for now because we need to think through edge + // cases rpc ForceTransfer(MsgForceTransfer) returns + // (MsgForceTransferResponse); + rpc ChangeAdmin(MsgChangeAdmin) returns (MsgChangeAdminResponse); +} + +// MsgCreateDenom is the sdk.Msg type for allowing an account to create +// a new denom. It requires a sender address and a unique nonce +// (to allow accounts to create multiple denoms) +message MsgCreateDenom { + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + string nonce = 2 [ (gogoproto.moretags) = "yaml:\"nonce\"" ]; +} + +// MsgCreateDenomResponse is the return value of MsgCreateDenom +// It returns the full string of the newly created denom +message MsgCreateDenomResponse { + string new_token_denom = 1 + [ (gogoproto.moretags) = "yaml:\"new_token_denom\"" ]; +} + +// MsgMint is the sdk.Msg type for allowing an admin account to mint +// more of a token. +message MsgMint { + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + cosmos.base.v1beta1.Coin amount = 2 [ + (gogoproto.moretags) = "yaml:\"amount\"", + (gogoproto.nullable) = false + ]; + string recipient = 3 [ (gogoproto.moretags) = "yaml:\"recipient\"" ]; +} + +message MsgMintResponse {} + +// MsgBurn is the sdk.Msg type for allowing an admin account to burn +// a token. For now, we only support burning from the sender account. +message MsgBurn { + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + cosmos.base.v1beta1.Coin amount = 2 [ + (gogoproto.moretags) = "yaml:\"amount\"", + (gogoproto.nullable) = false + ]; +} + +message MsgBurnResponse {} + +// // ===================== MsgForceTransfer +// message MsgForceTransfer { +// string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; +// cosmos.base.v1beta1.Coin amount = 2 [ +// (gogoproto.moretags) = "yaml:\"amount\"", +// (gogoproto.nullable) = false +// ]; +// string transferFromAddress = 3 +// [ (gogoproto.moretags) = "yaml:\"transfer_from_address\"" ]; +// string transferToAddress = 4 +// [ (gogoproto.moretags) = "yaml:\"transfer_to_address\"" ]; +// } + +// message MsgForceTransferResponse {} + +// MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign +// adminship of a denom to a new account +message MsgChangeAdmin { + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + string denom = 2 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; + string newAdmin = 3 [ (gogoproto.moretags) = "yaml:\"new_admin\"" ]; +} + +message MsgChangeAdminResponse {} \ No newline at end of file diff --git a/packages/types/protobuf/proto/kujira/oracle/genesis.proto b/packages/types/protobuf/proto/kujira/oracle/genesis.proto new file mode 100644 index 000000000..1e2ee109d --- /dev/null +++ b/packages/types/protobuf/proto/kujira/oracle/genesis.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; +package kujira.oracle; + +import "gogoproto/gogo.proto"; +import "kujira/oracle/oracle.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/Team-Kujira/core/x/oracle/types"; + +// GenesisState defines the oracle module's genesis state. +message GenesisState { + Params params = 1 [(gogoproto.nullable) = false]; + repeated FeederDelegation feeder_delegations = 2 [(gogoproto.nullable) = false]; + repeated ExchangeRateTuple exchange_rates = 3 + [(gogoproto.castrepeated) = "ExchangeRateTuples", (gogoproto.nullable) = false]; + repeated MissCounter miss_counters = 4 [(gogoproto.nullable) = false]; + repeated AggregateExchangeRatePrevote aggregate_exchange_rate_prevotes = 5 [(gogoproto.nullable) = false]; + repeated AggregateExchangeRateVote aggregate_exchange_rate_votes = 6 [(gogoproto.nullable) = false]; +} + +// FeederDelegation is the address for where oracle feeder authority are +// delegated to. By default this struct is only used at genesis to feed in +// default feeder addresses. +message FeederDelegation { + string feeder_address = 1; + string validator_address = 2; +} + +// MissCounter defines an miss counter and validator address pair used in +// oracle module's genesis state +message MissCounter { + string validator_address = 1; + uint64 miss_counter = 2; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/kujira/oracle/oracle.proto b/packages/types/protobuf/proto/kujira/oracle/oracle.proto new file mode 100644 index 000000000..2230f2959 --- /dev/null +++ b/packages/types/protobuf/proto/kujira/oracle/oracle.proto @@ -0,0 +1,93 @@ +syntax = "proto3"; +package kujira.oracle; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/Team-Kujira/core/x/oracle/types"; + +// Params defines the parameters for the oracle module. +message Params { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + uint64 vote_period = 1 [(gogoproto.moretags) = "yaml:\"vote_period\""]; + string vote_threshold = 2 [ + (gogoproto.moretags) = "yaml:\"vote_threshold\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string reward_band = 3 [ + (gogoproto.moretags) = "yaml:\"reward_band\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + uint64 reward_distribution_window = 4 [(gogoproto.moretags) = "yaml:\"reward_distribution_window\""]; + repeated Denom whitelist = 5 [ + (gogoproto.moretags) = "yaml:\"whitelist\"", + (gogoproto.castrepeated) = "DenomList", + (gogoproto.nullable) = false + ]; + string slash_fraction = 6 [ + (gogoproto.moretags) = "yaml:\"slash_fraction\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + uint64 slash_window = 7 [(gogoproto.moretags) = "yaml:\"slash_window\""]; + string min_valid_per_window = 8 [ + (gogoproto.moretags) = "yaml:\"min_valid_per_window\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// Denom - the object to hold configurations of each denom +message Denom { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + string name = 1 [(gogoproto.moretags) = "yaml:\"name\""]; +} + +// struct for aggregate prevoting on the ExchangeRateVote. +// The purpose of aggregate prevote is to hide vote exchange rates with hash +// which is formatted as hex string in SHA256("{salt}:{exchange rate}{denom},...,{exchange rate}{denom}:{voter}") +message AggregateExchangeRatePrevote { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + string hash = 1 [(gogoproto.moretags) = "yaml:\"hash\""]; + string voter = 2 [(gogoproto.moretags) = "yaml:\"voter\""]; + uint64 submit_block = 3 [(gogoproto.moretags) = "yaml:\"submit_block\""]; +} + +// MsgAggregateExchangeRateVote - struct for voting on exchange rates. +message AggregateExchangeRateVote { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + repeated ExchangeRateTuple exchange_rate_tuples = 1 [ + (gogoproto.moretags) = "yaml:\"exchange_rate_tuples\"", + (gogoproto.castrepeated) = "ExchangeRateTuples", + (gogoproto.nullable) = false + ]; + + string voter = 2 [(gogoproto.moretags) = "yaml:\"voter\""]; +} + +// ExchangeRateTuple - struct to store interpreted exchange rates data to store +message ExchangeRateTuple { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + string denom = 1 [(gogoproto.moretags) = "yaml:\"denom\""]; + string exchange_rate = 2 [ + (gogoproto.moretags) = "yaml:\"exchange_rate\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/types/protobuf/proto/kujira/oracle/query.proto b/packages/types/protobuf/proto/kujira/oracle/query.proto new file mode 100644 index 000000000..8836935dd --- /dev/null +++ b/packages/types/protobuf/proto/kujira/oracle/query.proto @@ -0,0 +1,204 @@ +syntax = "proto3"; +package kujira.oracle; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "kujira/oracle/oracle.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/Team-Kujira/core/x/oracle/types"; + +// Query defines the gRPC querier service. +service Query { + // ExchangeRate returns exchange rate of a denom + rpc ExchangeRate(QueryExchangeRateRequest) returns (QueryExchangeRateResponse) { + option (google.api.http).get = "/oracle/denoms/{denom}/exchange_rate"; + } + + // ExchangeRates returns exchange rates of all denoms + rpc ExchangeRates(QueryExchangeRatesRequest) returns (QueryExchangeRatesResponse) { + option (google.api.http).get = "/oracle/denoms/exchange_rates"; + } + + // Actives returns all active denoms + rpc Actives(QueryActivesRequest) returns (QueryActivesResponse) { + option (google.api.http).get = "/oracle/denoms/actives"; + } + + // FeederDelegation returns feeder delegation of a validator + rpc FeederDelegation(QueryFeederDelegationRequest) returns (QueryFeederDelegationResponse) { + option (google.api.http).get = "/oracle/validators/{validator_addr}/feeder"; + } + + // MissCounter returns oracle miss counter of a validator + rpc MissCounter(QueryMissCounterRequest) returns (QueryMissCounterResponse) { + option (google.api.http).get = "/oracle/validators/{validator_addr}/miss"; + } + + // AggregatePrevote returns an aggregate prevote of a validator + rpc AggregatePrevote(QueryAggregatePrevoteRequest) returns (QueryAggregatePrevoteResponse) { + option (google.api.http).get = "/oracle/validators/{validator_addr}/aggregate_prevote"; + } + + // AggregatePrevotes returns aggregate prevotes of all validators + rpc AggregatePrevotes(QueryAggregatePrevotesRequest) returns (QueryAggregatePrevotesResponse) { + option (google.api.http).get = "/oracle/validators/aggregate_prevotes"; + } + + // AggregateVote returns an aggregate vote of a validator + rpc AggregateVote(QueryAggregateVoteRequest) returns (QueryAggregateVoteResponse) { + option (google.api.http).get = "/oracle/valdiators/{validator_addr}/aggregate_vote"; + } + + // AggregateVotes returns aggregate votes of all validators + rpc AggregateVotes(QueryAggregateVotesRequest) returns (QueryAggregateVotesResponse) { + option (google.api.http).get = "/oracle/validators/aggregate_votes"; + } + + // Params queries all parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/oracle/params"; + } +} + +// QueryExchangeRateRequest is the request type for the Query/ExchangeRate RPC method. +message QueryExchangeRateRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // denom defines the denomination to query for. + string denom = 1; +} + +// QueryExchangeRateResponse is response type for the +// Query/ExchangeRate RPC method. +message QueryExchangeRateResponse { + // exchange_rate defines the exchange rate of whitelisted assets + string exchange_rate = 1 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} + +// QueryExchangeRatesRequest is the request type for the Query/ExchangeRates RPC method. +message QueryExchangeRatesRequest {} + +// QueryExchangeRatesResponse is response type for the +// Query/ExchangeRates RPC method. +message QueryExchangeRatesResponse { + // exchange_rates defines a list of the exchange rate for all whitelisted denoms. + repeated cosmos.base.v1beta1.DecCoin exchange_rates = 1 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; +} + +// QueryActivesRequest is the request type for the Query/Actives RPC method. +message QueryActivesRequest {} + +// QueryActivesResponse is response type for the +// Query/Actives RPC method. +message QueryActivesResponse { + // actives defines a list of the denomination which oracle prices aggreed upon. + repeated string actives = 1; +} + +// QueryVoteTargetsRequest is the request type for the Query/VoteTargets RPC method. +message QueryVoteTargetsRequest {} + +// QueryVoteTargetsResponse is response type for the +// Query/VoteTargets RPC method. +message QueryVoteTargetsResponse { + // vote_targets defines a list of the denomination in which everyone + // should vote in the current vote period. + repeated string vote_targets = 1; +} + +// QueryFeederDelegationRequest is the request type for the Query/FeederDelegation RPC method. +message QueryFeederDelegationRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator defines the validator address to query for. + string validator_addr = 1; +} + +// QueryFeederDelegationResponse is response type for the +// Query/FeederDelegation RPC method. +message QueryFeederDelegationResponse { + // feeder_addr defines the feeder delegation of a validator + string feeder_addr = 1; +} + +// QueryMissCounterRequest is the request type for the Query/MissCounter RPC method. +message QueryMissCounterRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator defines the validator address to query for. + string validator_addr = 1; +} + +// QueryMissCounterResponse is response type for the +// Query/MissCounter RPC method. +message QueryMissCounterResponse { + // miss_counter defines the oracle miss counter of a validator + uint64 miss_counter = 1; +} + +// QueryAggregatePrevoteRequest is the request type for the Query/AggregatePrevote RPC method. +message QueryAggregatePrevoteRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator defines the validator address to query for. + string validator_addr = 1; +} + +// QueryAggregatePrevoteResponse is response type for the +// Query/AggregatePrevote RPC method. +message QueryAggregatePrevoteResponse { + // aggregate_prevote defines oracle aggregate prevote submitted by a validator in the current vote period + AggregateExchangeRatePrevote aggregate_prevote = 1 [(gogoproto.nullable) = false]; +} + +// QueryAggregatePrevotesRequest is the request type for the Query/AggregatePrevotes RPC method. +message QueryAggregatePrevotesRequest {} + +// QueryAggregatePrevotesResponse is response type for the +// Query/AggregatePrevotes RPC method. +message QueryAggregatePrevotesResponse { + // aggregate_prevotes defines all oracle aggregate prevotes submitted in the current vote period + repeated AggregateExchangeRatePrevote aggregate_prevotes = 1 [(gogoproto.nullable) = false]; +} + +// QueryAggregateVoteRequest is the request type for the Query/AggregateVote RPC method. +message QueryAggregateVoteRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // validator defines the validator address to query for. + string validator_addr = 1; +} + +// QueryAggregateVoteResponse is response type for the +// Query/AggregateVote RPC method. +message QueryAggregateVoteResponse { + // aggregate_vote defines oracle aggregate vote submitted by a validator in the current vote period + AggregateExchangeRateVote aggregate_vote = 1 [(gogoproto.nullable) = false]; +} + +// QueryAggregateVotesRequest is the request type for the Query/AggregateVotes RPC method. +message QueryAggregateVotesRequest {} + +// QueryAggregateVotesResponse is response type for the +// Query/AggregateVotes RPC method. +message QueryAggregateVotesResponse { + // aggregate_votes defines all oracle aggregate votes submitted in the current vote period + repeated AggregateExchangeRateVote aggregate_votes = 1 [(gogoproto.nullable) = false]; +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/kujira/oracle/tx.proto b/packages/types/protobuf/proto/kujira/oracle/tx.proto new file mode 100644 index 000000000..87dd9d985 --- /dev/null +++ b/packages/types/protobuf/proto/kujira/oracle/tx.proto @@ -0,0 +1,62 @@ +syntax = "proto3"; +package kujira.oracle; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/Team-Kujira/core/x/oracle/types"; + +// Msg defines the oracle Msg service. +service Msg { + // AggregateExchangeRatePrevote defines a method for submitting + // aggregate exchange rate prevote + rpc AggregateExchangeRatePrevote(MsgAggregateExchangeRatePrevote) returns (MsgAggregateExchangeRatePrevoteResponse); + + // AggregateExchangeRateVote defines a method for submitting + // aggregate exchange rate vote + rpc AggregateExchangeRateVote(MsgAggregateExchangeRateVote) returns (MsgAggregateExchangeRateVoteResponse); + + // DelegateFeedConsent defines a method for setting the feeder delegation + rpc DelegateFeedConsent(MsgDelegateFeedConsent) returns (MsgDelegateFeedConsentResponse); +} + +// MsgAggregateExchangeRatePrevote represents a message to submit +// aggregate exchange rate prevote. +message MsgAggregateExchangeRatePrevote { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string hash = 1 [(gogoproto.moretags) = "yaml:\"hash\""]; + string feeder = 2 [(gogoproto.moretags) = "yaml:\"feeder\""]; + string validator = 3 [(gogoproto.moretags) = "yaml:\"validator\""]; +} + +// MsgAggregateExchangeRatePrevoteResponse defines the Msg/AggregateExchangeRatePrevote response type. +message MsgAggregateExchangeRatePrevoteResponse {} + +// MsgAggregateExchangeRateVote represents a message to submit +// aggregate exchange rate vote. +message MsgAggregateExchangeRateVote { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string salt = 1 [(gogoproto.moretags) = "yaml:\"salt\""]; + string exchange_rates = 2 [(gogoproto.moretags) = "yaml:\"exchange_rates\""]; + string feeder = 3 [(gogoproto.moretags) = "yaml:\"feeder\""]; + string validator = 4 [(gogoproto.moretags) = "yaml:\"validator\""]; +} + +// MsgAggregateExchangeRateVoteResponse defines the Msg/AggregateExchangeRateVote response type. +message MsgAggregateExchangeRateVoteResponse {} + +// MsgDelegateFeedConsent represents a message to +// delegate oracle voting rights to another address. +message MsgDelegateFeedConsent { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string operator = 1 [(gogoproto.moretags) = "yaml:\"operator\""]; + string delegate = 2 [(gogoproto.moretags) = "yaml:\"delegate\""]; +} + +// MsgDelegateFeedConsentResponse defines the Msg/DelegateFeedConsent response type. +message MsgDelegateFeedConsentResponse {} \ No newline at end of file diff --git a/packages/types/protobuf/proto/kujira/scheduler/genesis.proto b/packages/types/protobuf/proto/kujira/scheduler/genesis.proto new file mode 100644 index 000000000..b221ec1f2 --- /dev/null +++ b/packages/types/protobuf/proto/kujira/scheduler/genesis.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package kujira.scheduler; + +import "gogoproto/gogo.proto"; +import "kujira/scheduler/params.proto"; +import "kujira/scheduler/hook.proto"; + +option go_package = "github.com/Team-Kujira/core/x/scheduler/types"; + +// GenesisState defines the scheduler module's genesis state. +message GenesisState { + Params params = 1 [(gogoproto.nullable) = false]; + repeated Hook hookList = 2 [(gogoproto.nullable) = false]; + uint64 hookCount = 3; +} diff --git a/packages/types/protobuf/proto/kujira/scheduler/hook.proto b/packages/types/protobuf/proto/kujira/scheduler/hook.proto new file mode 100644 index 000000000..15c17f2b7 --- /dev/null +++ b/packages/types/protobuf/proto/kujira/scheduler/hook.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; +package kujira.scheduler; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/Team-Kujira/core/x/scheduler/types"; + +message Hook { + uint64 id = 1; + string executor = 2; + string contract = 3; + bytes msg = 4 [ (gogoproto.casttype) = "github.com/CosmWasm/wasmd/x/wasm/types.RawContractMessage" ]; + int64 frequency = 5; + repeated cosmos.base.v1beta1.Coin funds = 6 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} diff --git a/packages/types/protobuf/proto/kujira/scheduler/params.proto b/packages/types/protobuf/proto/kujira/scheduler/params.proto new file mode 100644 index 000000000..8bd807b97 --- /dev/null +++ b/packages/types/protobuf/proto/kujira/scheduler/params.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package kujira.scheduler; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/Team-Kujira/core/x/scheduler/types"; + +// Params defines the parameters for the module. +message Params { + option (gogoproto.goproto_stringer) = false; + +} diff --git a/packages/types/protobuf/proto/kujira/scheduler/proposal.proto b/packages/types/protobuf/proto/kujira/scheduler/proposal.proto new file mode 100644 index 000000000..53d78ab00 --- /dev/null +++ b/packages/types/protobuf/proto/kujira/scheduler/proposal.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; +package kujira.scheduler; + +import "gogoproto/gogo.proto"; +import "kujira/scheduler/hook.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/Team-Kujira/core/x/scheduler/types"; +option (gogoproto.goproto_stringer_all) = false; + + +message CreateHookProposal { + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + + // The account that will execute the msg on the schedule + string executor = 3; + + // The contract that the msg is called on + string contract = 4; + + bytes msg = 5 [ (gogoproto.casttype) = "github.com/CosmWasm/wasmd/x/wasm/types.RawContractMessage" ]; + int64 frequency = 6; + repeated cosmos.base.v1beta1.Coin funds = 7 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + +} + +message UpdateHookProposal { + // Title is a short summary + string title = 1; + + // Description is a human readable text + string description = 2; + + uint64 id = 3; + string executor = 4; + string contract = 5; + bytes msg = 6 [ (gogoproto.casttype) = "github.com/CosmWasm/wasmd/x/wasm/types.RawContractMessage" ]; + int64 frequency = 7; + repeated cosmos.base.v1beta1.Coin funds = 8 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +message DeleteHookProposal { + // Title is a short summary + string title = 1; + + // Description is a human readable text + string description = 2; + + uint64 id = 3; +} diff --git a/packages/types/protobuf/proto/kujira/scheduler/query.proto b/packages/types/protobuf/proto/kujira/scheduler/query.proto new file mode 100644 index 000000000..a9a5852c9 --- /dev/null +++ b/packages/types/protobuf/proto/kujira/scheduler/query.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; +package kujira.scheduler; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "kujira/scheduler/params.proto"; +import "kujira/scheduler/hook.proto"; + +option go_package = "github.com/Team-Kujira/core/x/scheduler/types"; + +// Query defines the gRPC querier service. +service Query { + // Parameters queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/kujira/scheduler/params"; + } + // Queries a Hook by id. + rpc Hook(QueryGetHookRequest) returns (QueryGetHookResponse) { + option (google.api.http).get = "/kujira/scheduler/hook/{id}"; + } + + // Queries a list of Hook items. + rpc HookAll(QueryAllHookRequest) returns (QueryAllHookResponse) { + option (google.api.http).get = "/kujira/scheduler/hook"; + } +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [(gogoproto.nullable) = false]; +} + +message QueryGetHookRequest { + uint64 id = 1; +} + +message QueryGetHookResponse { + Hook Hook = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllHookRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllHookResponse { + repeated Hook Hook = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/packages/types/protobuf/scripts/codegen.js b/packages/types/protobuf/scripts/codegen.js index cc5e20549..9c73459d0 100644 --- a/packages/types/protobuf/scripts/codegen.js +++ b/packages/types/protobuf/scripts/codegen.js @@ -106,6 +106,9 @@ telescope({ 'regen.intertx.v1', 'alliance.alliance', 'circle.cctp.v1', + 'kujira.denom', + 'kujira.oracle', + 'kujira.scheduler', ], }, // excluded: { diff --git a/packages/types/protobuf/utils.ts b/packages/types/protobuf/utils.ts index c74da0e42..32085c167 100644 --- a/packages/types/protobuf/utils.ts +++ b/packages/types/protobuf/utils.ts @@ -33,6 +33,8 @@ import { ibcProtoRegistry, junoAminoConverters, junoProtoRegistry, + kujiraAminoConverters, + kujiraProtoRegistry, neutronAminoConverters, neutronProtoRegistry, osmosisAminoConverters, @@ -552,6 +554,7 @@ export const PROTOBUF_TYPES: ReadonlyArray<[string, GeneratedType]> = [ ...regenProtoRegistry, ...allianceProtoRegistry, ...circleProtoRegistry, + ...kujiraProtoRegistry, // Not a query or TX so it isn't included in any of the registries. But we // want to decode this because it appears in gov props. We need to find a // better way to collect all generated types in a single registry... @@ -588,6 +591,7 @@ export const aminoTypes = new AminoTypes({ ...regenAminoConverters, ...allianceAminoConverters, ...circleAminoConverters, + ...kujiraAminoConverters, }) // Encodes a protobuf message value from its JSON representation into a byte From 3df328cab56e76799bae432ca68583ab537d06fd Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 17 Apr 2024 11:40:00 -0700 Subject: [PATCH 120/438] fixed decoding invalid JSON --- .../GovernanceDeposit/index.tsx | 1 + .../chain_governance/GovernanceVote/index.tsx | 1 + .../dao_governance/SetUpApprover/index.tsx | 5 +++-- .../actions/core/nfts/TransferNft/index.tsx | 2 +- .../core/smart_contracting/Execute/index.tsx | 2 +- .../smart_contracting/Instantiate2/index.tsx | 2 +- .../core/treasury/ManageVesting/index.tsx | 8 +++++--- .../token_swap/PerformTokenSwap/index.tsx | 3 ++- .../dao/create/pages/CreateDaoReview.tsx | 19 +++++++++++++----- packages/utils/messages/cw.ts | 2 +- packages/utils/messages/encoding.ts | 20 +++++++++++++++---- 11 files changed, 46 insertions(+), 19 deletions(-) diff --git a/packages/stateful/actions/core/chain_governance/GovernanceDeposit/index.tsx b/packages/stateful/actions/core/chain_governance/GovernanceDeposit/index.tsx index 72e343a32..93485c549 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceDeposit/index.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceDeposit/index.tsx @@ -92,6 +92,7 @@ const InnerComponent: ActionComponent = ( ? govProposalsSelector({ status: ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD, chainId, + limit: 100, }) : constSelector(undefined) ) diff --git a/packages/stateful/actions/core/chain_governance/GovernanceVote/index.tsx b/packages/stateful/actions/core/chain_governance/GovernanceVote/index.tsx index 9f60ec18d..48c575920 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceVote/index.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceVote/index.tsx @@ -68,6 +68,7 @@ const Component: ActionComponent = (props) => { ? govProposalsSelector({ status: ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD, chainId, + limit: 100, }) : constSelector(undefined) ) diff --git a/packages/stateful/actions/core/dao_governance/SetUpApprover/index.tsx b/packages/stateful/actions/core/dao_governance/SetUpApprover/index.tsx index 3d24f25f8..3f79c3927 100644 --- a/packages/stateful/actions/core/dao_governance/SetUpApprover/index.tsx +++ b/packages/stateful/actions/core/dao_governance/SetUpApprover/index.tsx @@ -82,7 +82,7 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( } } - const parsedMsg = decodeJsonFromBase64(info.msg) + const parsedMsg = decodeJsonFromBase64(info.msg, true) if ( !info.label.endsWith(`${DaoProposalSingleAdapterId}_approver`) || !objectMatchesStructure(parsedMsg, { @@ -104,7 +104,8 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( } const parsedPreProposeMsg = decodeJsonFromBase64( - parsedMsg.pre_propose_info.module_may_propose.info.msg + parsedMsg.pre_propose_info.module_may_propose.info.msg, + true ) if ( !objectMatchesStructure(parsedPreProposeMsg, { diff --git a/packages/stateful/actions/core/nfts/TransferNft/index.tsx b/packages/stateful/actions/core/nfts/TransferNft/index.tsx index 70540e57e..cd2094971 100644 --- a/packages/stateful/actions/core/nfts/TransferNft/index.tsx +++ b/packages/stateful/actions/core/nfts/TransferNft/index.tsx @@ -157,7 +157,7 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( executeSmartContract: true, smartContractMsg: JSON.stringify( - decodeJsonFromBase64(msg.wasm.execute.msg.send_nft.msg), + decodeJsonFromBase64(msg.wasm.execute.msg.send_nft.msg, true), null, 2 ), diff --git a/packages/stateful/actions/core/smart_contracting/Execute/index.tsx b/packages/stateful/actions/core/smart_contracting/Execute/index.tsx index d08caddbd..38cad7d32 100644 --- a/packages/stateful/actions/core/smart_contracting/Execute/index.tsx +++ b/packages/stateful/actions/core/smart_contracting/Execute/index.tsx @@ -221,7 +221,7 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( : msg.wasm.execute.contract_addr, message: JSON.stringify( isCw20 - ? decodeJsonFromBase64(msg.wasm.execute.msg.send.msg) + ? decodeJsonFromBase64(msg.wasm.execute.msg.send.msg, true) : msg.wasm.execute.msg, undefined, 2 diff --git a/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx b/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx index 901515e81..cc1df3dd7 100644 --- a/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx +++ b/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx @@ -225,7 +225,7 @@ export const makeInstantiate2Action: ActionMaker = ( admin: msg.stargate.value.admin, code_id: Number(msg.stargate.value.codeId), label: msg.stargate.value.label, - msg: decodeJsonFromBase64(toBase64(msg.stargate.value.msg)), + msg: decodeJsonFromBase64(toBase64(msg.stargate.value.msg), true), funds: msg.stargate.value.funds, fix_msg: msg.stargate.value.fixMsg, salt: fromUtf8(msg.stargate.value.salt), diff --git a/packages/stateful/actions/core/treasury/ManageVesting/index.tsx b/packages/stateful/actions/core/treasury/ManageVesting/index.tsx index 82ab1036c..38310de8d 100644 --- a/packages/stateful/actions/core/treasury/ManageVesting/index.tsx +++ b/packages/stateful/actions/core/treasury/ManageVesting/index.tsx @@ -874,7 +874,7 @@ export const makeManageVestingAction: ActionMaker = ( }, }) && objectMatchesStructure( - decodeJsonFromBase64(msg.wasm.execute.msg.send.msg), + decodeJsonFromBase64(msg.wasm.execute.msg.send.msg, true), { instantiate_payroll_contract: instantiateStructure, } @@ -934,8 +934,10 @@ export const makeManageVestingAction: ActionMaker = ( // isCw20Begin else { // Extract instantiate message from cw20 send message. - instantiateMsg = decodeJsonFromBase64(msg.wasm.execute.msg.send.msg) - .instantiate_payroll_contract.instantiate_msg as VestingInstantiateMsg + instantiateMsg = decodeJsonFromBase64( + msg.wasm.execute.msg.send.msg, + true + ).instantiate_payroll_contract?.instantiate_msg as VestingInstantiateMsg } } diff --git a/packages/stateful/actions/core/treasury/token_swap/PerformTokenSwap/index.tsx b/packages/stateful/actions/core/treasury/token_swap/PerformTokenSwap/index.tsx index 8bec0993e..089963de8 100644 --- a/packages/stateful/actions/core/treasury/token_swap/PerformTokenSwap/index.tsx +++ b/packages/stateful/actions/core/treasury/token_swap/PerformTokenSwap/index.tsx @@ -233,7 +233,8 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( }) && // Use common key to identify CW20s being sent to token swaps from this // DAO DAO action. - CW20_SEND_MSG_KEY in decodeJsonFromBase64(msg.wasm.execute.msg.send.msg) + CW20_SEND_MSG_KEY in + decodeJsonFromBase64(msg.wasm.execute.msg.send.msg, true) ) { return { match: true, diff --git a/packages/stateless/components/dao/create/pages/CreateDaoReview.tsx b/packages/stateless/components/dao/create/pages/CreateDaoReview.tsx index 9ecb15e63..31e26b99d 100644 --- a/packages/stateless/components/dao/create/pages/CreateDaoReview.tsx +++ b/packages/stateless/components/dao/create/pages/CreateDaoReview.tsx @@ -3,7 +3,11 @@ import { useRef, useState } from 'react' import { useTranslation } from 'react-i18next' import { CreateDaoContext, DaoInfoCard } from '@dao-dao/types' -import { decodeJsonFromBase64, processError } from '@dao-dao/utils' +import { + decodeJsonFromBase64, + objectMatchesStructure, + processError, +} from '@dao-dao/utils' import { CosmosMessageDisplay } from '../../../CosmosMessageDisplay' import { Checkbox } from '../../../inputs/Checkbox' @@ -47,10 +51,15 @@ export const CreateDaoReview = ({ // Convert encoded pre_propose_info message back to readable JSON. if ( - 'pre_propose_info' in msg && - 'module_may_propose' in msg.pre_propose_info && - 'info' in msg.pre_propose_info.module_may_propose && - 'msg' in msg.pre_propose_info.module_may_propose.info + objectMatchesStructure(msg, { + pre_propose_info: { + module_may_propose: { + info: { + msg: {}, + }, + }, + }, + }) ) { msg.pre_propose_info.module_may_propose.info.msg = decodeJsonFromBase64( diff --git a/packages/utils/messages/cw.ts b/packages/utils/messages/cw.ts index 88a7ba590..52ad90562 100644 --- a/packages/utils/messages/cw.ts +++ b/packages/utils/messages/cw.ts @@ -99,7 +99,7 @@ export const decodeMessage = (msg: CosmosMsgFor_Empty): Record => { if (msgType && isBinaryType(msgType)) { const base64MsgContainer = (msg.wasm as any)[msgType] if (base64MsgContainer && 'msg' in base64MsgContainer) { - const parsedMsg = decodeJsonFromBase64(base64MsgContainer.msg) + const parsedMsg = decodeJsonFromBase64(base64MsgContainer.msg, true) if (parsedMsg) { return { ...msg, diff --git a/packages/utils/messages/encoding.ts b/packages/utils/messages/encoding.ts index bff9472bf..b7b2e7645 100644 --- a/packages/utils/messages/encoding.ts +++ b/packages/utils/messages/encoding.ts @@ -7,13 +7,25 @@ export const encodeJsonToBase64 = (object: any) => toBase64(toUtf8(JSON.stringify(object))) /** - * Decode base64 string into JSON object. + * Decode base64 string into JSON object. If `fallbackToString` is true and + * JSON parse fails, decoded string is returned. */ -export const decodeJsonFromBase64 = (base64String?: string) => { +export const decodeJsonFromBase64 = ( + base64String?: string, + fallbackToString = false +) => { if (base64String) { const jsonMessage = fromUtf8(fromBase64(base64String)) - if (jsonMessage) { - return JSON.parse(jsonMessage) + try { + if (jsonMessage) { + return JSON.parse(jsonMessage) + } + } catch (err) { + if (fallbackToString) { + return jsonMessage + } + + throw err } } } From 5e8ea05d4c8c818537b9ce7b4eb086f25166c1ce Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 17 Apr 2024 13:58:13 -0700 Subject: [PATCH 121/438] improve gov query performance --- .../core/chain_governance/GovernanceDeposit/index.tsx | 7 ++++++- .../core/chain_governance/GovernanceVote/index.tsx | 7 ++++++- packages/stateful/components/gov/GovProposalList.tsx | 10 ++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/packages/stateful/actions/core/chain_governance/GovernanceDeposit/index.tsx b/packages/stateful/actions/core/chain_governance/GovernanceDeposit/index.tsx index 93485c549..ee447102b 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceDeposit/index.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceDeposit/index.tsx @@ -92,7 +92,12 @@ const InnerComponent: ActionComponent = ( ? govProposalsSelector({ status: ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD, chainId, - limit: 100, + // No need to load more than 50 proposals when trying to find + // proposals currently being voted on. The alternative is to load all + // proposals, which is not ideal. Ideally, this is pre-indexed and we + // can query only the proposals in the voting period instead of having + // to filter locally. + limit: 50, }) : constSelector(undefined) ) diff --git a/packages/stateful/actions/core/chain_governance/GovernanceVote/index.tsx b/packages/stateful/actions/core/chain_governance/GovernanceVote/index.tsx index 48c575920..6367c9356 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceVote/index.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceVote/index.tsx @@ -68,7 +68,12 @@ const Component: ActionComponent = (props) => { ? govProposalsSelector({ status: ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD, chainId, - limit: 100, + // No need to load more than 50 proposals when trying to find + // proposals currently being voted on. The alternative is to load all + // proposals, which is not ideal. Ideally, this is pre-indexed and we + // can query only the proposals in the voting period instead of having + // to filter locally. + limit: 50, }) : constSelector(undefined) ) diff --git a/packages/stateful/components/gov/GovProposalList.tsx b/packages/stateful/components/gov/GovProposalList.tsx index 7f466effb..8ac284c86 100644 --- a/packages/stateful/components/gov/GovProposalList.tsx +++ b/packages/stateful/components/gov/GovProposalList.tsx @@ -24,6 +24,11 @@ export const GovProposalList = () => { govProposalsSelector({ chainId: chain.chain_id, status: ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD, + // No need to load more than 50 proposals when trying to find proposals + // currently being voted on. The alternative is to load all proposals, + // which is not ideal. Ideally, this is pre-indexed and we can query only + // the proposals in the voting period instead of having to filter locally. + limit: 50, }), { proposals: [], @@ -35,6 +40,11 @@ export const GovProposalList = () => { govProposalsSelector({ chainId: chain.chain_id, status: ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD, + // No need to load more than 50 proposals when trying to find proposals in + // the deposit period. The alternative is to load all proposals, which is + // not ideal. Ideally, this is pre-indexed and we can query only the + // proposals in the voting period instead of having to filter locally. + limit: 50, }), { proposals: [], From fcf8315a19a616f0307252c969caa763cea1cca1 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 18 Apr 2024 12:59:24 -0700 Subject: [PATCH 122/438] fixed missing osmosis gov prop content types --- .../protobuf/codegen/cosmos/gov/v1/tx.ts | 33 ++++++++++++++++--- .../codegen/cosmos/gov/v1beta1/gov.ts | 33 ++++++++++++++++--- .../protobuf/codegen/cosmos/gov/v1beta1/tx.ts | 33 ++++++++++++++++--- .../osmosis/cosmwasmpool/v1beta1/gov.ts | 6 ++++ .../osmosis/cosmwasmpool/v1beta1/gov.proto | 3 ++ 5 files changed, 96 insertions(+), 12 deletions(-) diff --git a/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts b/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts index 774bdbe5c..fd09961b2 100644 --- a/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts +++ b/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts @@ -11,6 +11,7 @@ import { ParameterChangeProposal, ParameterChangeProposalProtoMsg, ParameterChan import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, SoftwareUpgradeProposalSDKType, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposalSDKType } from "../../upgrade/v1beta1/upgrade"; import { StoreCodeProposal, StoreCodeProposalProtoMsg, StoreCodeProposalSDKType, InstantiateContractProposal, InstantiateContractProposalProtoMsg, InstantiateContractProposalSDKType, InstantiateContract2Proposal, InstantiateContract2ProposalProtoMsg, InstantiateContract2ProposalSDKType, MigrateContractProposal, MigrateContractProposalProtoMsg, MigrateContractProposalSDKType, SudoContractProposal, SudoContractProposalProtoMsg, SudoContractProposalSDKType, ExecuteContractProposal, ExecuteContractProposalProtoMsg, ExecuteContractProposalSDKType, UpdateAdminProposal, UpdateAdminProposalProtoMsg, UpdateAdminProposalSDKType, ClearAdminProposal, ClearAdminProposalProtoMsg, ClearAdminProposalSDKType, PinCodesProposal, PinCodesProposalProtoMsg, PinCodesProposalSDKType, UnpinCodesProposal, UnpinCodesProposalProtoMsg, UnpinCodesProposalSDKType, UpdateInstantiateConfigProposal, UpdateInstantiateConfigProposalProtoMsg, UpdateInstantiateConfigProposalSDKType, StoreAndInstantiateContractProposal, StoreAndInstantiateContractProposalProtoMsg, StoreAndInstantiateContractProposalSDKType } from "../../../cosmwasm/wasm/v1/proposal"; import { ClientUpdateProposal, ClientUpdateProposalProtoMsg, ClientUpdateProposalSDKType, UpgradeProposal, UpgradeProposalProtoMsg, UpgradeProposalSDKType } from "../../../ibc/core/client/v1/client"; +import { UploadCosmWasmPoolCodeAndWhiteListProposal, UploadCosmWasmPoolCodeAndWhiteListProposalProtoMsg, UploadCosmWasmPoolCodeAndWhiteListProposalSDKType, MigratePoolContractsProposal, MigratePoolContractsProposalProtoMsg, MigratePoolContractsProposalSDKType } from "../../../osmosis/cosmwasmpool/v1beta1/gov"; import { ReplaceMigrationRecordsProposal, ReplaceMigrationRecordsProposalProtoMsg, ReplaceMigrationRecordsProposalSDKType, UpdateMigrationRecordsProposal, UpdateMigrationRecordsProposalProtoMsg, UpdateMigrationRecordsProposalSDKType, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType, SetScalingFactorControllerProposal, SetScalingFactorControllerProposalProtoMsg, SetScalingFactorControllerProposalSDKType } from "../../../osmosis/gamm/v1beta1/gov"; import { CreateGroupsProposal, CreateGroupsProposalProtoMsg, CreateGroupsProposalSDKType } from "../../../osmosis/incentives/gov"; import { ReplacePoolIncentivesProposal, ReplacePoolIncentivesProposalProtoMsg, ReplacePoolIncentivesProposalSDKType, UpdatePoolIncentivesProposal, UpdatePoolIncentivesProposalProtoMsg, UpdatePoolIncentivesProposalSDKType } from "../../../osmosis/pool-incentives/v1beta1/gov"; @@ -136,7 +137,7 @@ export interface MsgSubmitProposalResponseSDKType { */ export interface MsgExecLegacyContent { /** content is the proposal's content. */ - content?: (MsgCreateAllianceProposal & MsgUpdateAllianceProposal & MsgDeleteAllianceProposal & CommunityPoolSpendProposal & CommunityPoolSpendProposalWithDeposit & TextProposal & ParameterChangeProposal & SoftwareUpgradeProposal & CancelSoftwareUpgradeProposal & StoreCodeProposal & InstantiateContractProposal & InstantiateContract2Proposal & MigrateContractProposal & SudoContractProposal & ExecuteContractProposal & UpdateAdminProposal & ClearAdminProposal & PinCodesProposal & UnpinCodesProposal & UpdateInstantiateConfigProposal & StoreAndInstantiateContractProposal & ClientUpdateProposal & UpgradeProposal & ReplaceMigrationRecordsProposal & UpdateMigrationRecordsProposal & CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal & SetScalingFactorControllerProposal & CreateGroupsProposal & ReplacePoolIncentivesProposal & UpdatePoolIncentivesProposal & SetProtoRevEnabledProposal & SetProtoRevAdminAccountProposal & SetSuperfluidAssetsProposal & RemoveSuperfluidAssetsProposal & UpdateUnpoolWhiteListProposal & UpdateFeeTokenProposal & PromoteToPrivilegedContractProposal & DemotePrivilegedContractProposal & SetCodeAuthorizationProposal & RemoveCodeAuthorizationProposal & SetContractAuthorizationProposal & RemoveContractAuthorizationProposal & AllowDenomProposal & CreditTypeProposal & Any) | undefined; + content?: (MsgCreateAllianceProposal & MsgUpdateAllianceProposal & MsgDeleteAllianceProposal & CommunityPoolSpendProposal & CommunityPoolSpendProposalWithDeposit & TextProposal & ParameterChangeProposal & SoftwareUpgradeProposal & CancelSoftwareUpgradeProposal & StoreCodeProposal & InstantiateContractProposal & InstantiateContract2Proposal & MigrateContractProposal & SudoContractProposal & ExecuteContractProposal & UpdateAdminProposal & ClearAdminProposal & PinCodesProposal & UnpinCodesProposal & UpdateInstantiateConfigProposal & StoreAndInstantiateContractProposal & ClientUpdateProposal & UpgradeProposal & UploadCosmWasmPoolCodeAndWhiteListProposal & MigratePoolContractsProposal & ReplaceMigrationRecordsProposal & UpdateMigrationRecordsProposal & CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal & SetScalingFactorControllerProposal & CreateGroupsProposal & ReplacePoolIncentivesProposal & UpdatePoolIncentivesProposal & SetProtoRevEnabledProposal & SetProtoRevAdminAccountProposal & SetSuperfluidAssetsProposal & RemoveSuperfluidAssetsProposal & UpdateUnpoolWhiteListProposal & UpdateFeeTokenProposal & PromoteToPrivilegedContractProposal & DemotePrivilegedContractProposal & SetCodeAuthorizationProposal & RemoveCodeAuthorizationProposal & SetContractAuthorizationProposal & RemoveContractAuthorizationProposal & AllowDenomProposal & CreditTypeProposal & Any) | undefined; /** authority must be the gov module address. */ authority: string; } @@ -145,7 +146,7 @@ export interface MsgExecLegacyContentProtoMsg { value: Uint8Array; } export type MsgExecLegacyContentEncoded = Omit & { - /** content is the proposal's content. */content?: MsgCreateAllianceProposalProtoMsg | MsgUpdateAllianceProposalProtoMsg | MsgDeleteAllianceProposalProtoMsg | CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | ParameterChangeProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | ClientUpdateProposalProtoMsg | UpgradeProposalProtoMsg | ReplaceMigrationRecordsProposalProtoMsg | UpdateMigrationRecordsProposalProtoMsg | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg | SetScalingFactorControllerProposalProtoMsg | CreateGroupsProposalProtoMsg | ReplacePoolIncentivesProposalProtoMsg | UpdatePoolIncentivesProposalProtoMsg | SetProtoRevEnabledProposalProtoMsg | SetProtoRevAdminAccountProposalProtoMsg | SetSuperfluidAssetsProposalProtoMsg | RemoveSuperfluidAssetsProposalProtoMsg | UpdateUnpoolWhiteListProposalProtoMsg | UpdateFeeTokenProposalProtoMsg | PromoteToPrivilegedContractProposalProtoMsg | DemotePrivilegedContractProposalProtoMsg | SetCodeAuthorizationProposalProtoMsg | RemoveCodeAuthorizationProposalProtoMsg | SetContractAuthorizationProposalProtoMsg | RemoveContractAuthorizationProposalProtoMsg | AllowDenomProposalProtoMsg | CreditTypeProposalProtoMsg | AnyProtoMsg | undefined; + /** content is the proposal's content. */content?: MsgCreateAllianceProposalProtoMsg | MsgUpdateAllianceProposalProtoMsg | MsgDeleteAllianceProposalProtoMsg | CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | ParameterChangeProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | ClientUpdateProposalProtoMsg | UpgradeProposalProtoMsg | UploadCosmWasmPoolCodeAndWhiteListProposalProtoMsg | MigratePoolContractsProposalProtoMsg | ReplaceMigrationRecordsProposalProtoMsg | UpdateMigrationRecordsProposalProtoMsg | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg | SetScalingFactorControllerProposalProtoMsg | CreateGroupsProposalProtoMsg | ReplacePoolIncentivesProposalProtoMsg | UpdatePoolIncentivesProposalProtoMsg | SetProtoRevEnabledProposalProtoMsg | SetProtoRevAdminAccountProposalProtoMsg | SetSuperfluidAssetsProposalProtoMsg | RemoveSuperfluidAssetsProposalProtoMsg | UpdateUnpoolWhiteListProposalProtoMsg | UpdateFeeTokenProposalProtoMsg | PromoteToPrivilegedContractProposalProtoMsg | DemotePrivilegedContractProposalProtoMsg | SetCodeAuthorizationProposalProtoMsg | RemoveCodeAuthorizationProposalProtoMsg | SetContractAuthorizationProposalProtoMsg | RemoveContractAuthorizationProposalProtoMsg | AllowDenomProposalProtoMsg | CreditTypeProposalProtoMsg | AnyProtoMsg | undefined; }; /** * MsgExecLegacyContent is used to wrap the legacy content field into a message. @@ -166,7 +167,7 @@ export interface MsgExecLegacyContentAminoMsg { * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. */ export interface MsgExecLegacyContentSDKType { - content?: MsgCreateAllianceProposalSDKType | MsgUpdateAllianceProposalSDKType | MsgDeleteAllianceProposalSDKType | CommunityPoolSpendProposalSDKType | CommunityPoolSpendProposalWithDepositSDKType | TextProposalSDKType | ParameterChangeProposalSDKType | SoftwareUpgradeProposalSDKType | CancelSoftwareUpgradeProposalSDKType | StoreCodeProposalSDKType | InstantiateContractProposalSDKType | InstantiateContract2ProposalSDKType | MigrateContractProposalSDKType | SudoContractProposalSDKType | ExecuteContractProposalSDKType | UpdateAdminProposalSDKType | ClearAdminProposalSDKType | PinCodesProposalSDKType | UnpinCodesProposalSDKType | UpdateInstantiateConfigProposalSDKType | StoreAndInstantiateContractProposalSDKType | ClientUpdateProposalSDKType | UpgradeProposalSDKType | ReplaceMigrationRecordsProposalSDKType | UpdateMigrationRecordsProposalSDKType | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType | SetScalingFactorControllerProposalSDKType | CreateGroupsProposalSDKType | ReplacePoolIncentivesProposalSDKType | UpdatePoolIncentivesProposalSDKType | SetProtoRevEnabledProposalSDKType | SetProtoRevAdminAccountProposalSDKType | SetSuperfluidAssetsProposalSDKType | RemoveSuperfluidAssetsProposalSDKType | UpdateUnpoolWhiteListProposalSDKType | UpdateFeeTokenProposalSDKType | PromoteToPrivilegedContractProposalSDKType | DemotePrivilegedContractProposalSDKType | SetCodeAuthorizationProposalSDKType | RemoveCodeAuthorizationProposalSDKType | SetContractAuthorizationProposalSDKType | RemoveContractAuthorizationProposalSDKType | AllowDenomProposalSDKType | CreditTypeProposalSDKType | AnySDKType | undefined; + content?: MsgCreateAllianceProposalSDKType | MsgUpdateAllianceProposalSDKType | MsgDeleteAllianceProposalSDKType | CommunityPoolSpendProposalSDKType | CommunityPoolSpendProposalWithDepositSDKType | TextProposalSDKType | ParameterChangeProposalSDKType | SoftwareUpgradeProposalSDKType | CancelSoftwareUpgradeProposalSDKType | StoreCodeProposalSDKType | InstantiateContractProposalSDKType | InstantiateContract2ProposalSDKType | MigrateContractProposalSDKType | SudoContractProposalSDKType | ExecuteContractProposalSDKType | UpdateAdminProposalSDKType | ClearAdminProposalSDKType | PinCodesProposalSDKType | UnpinCodesProposalSDKType | UpdateInstantiateConfigProposalSDKType | StoreAndInstantiateContractProposalSDKType | ClientUpdateProposalSDKType | UpgradeProposalSDKType | UploadCosmWasmPoolCodeAndWhiteListProposalSDKType | MigratePoolContractsProposalSDKType | ReplaceMigrationRecordsProposalSDKType | UpdateMigrationRecordsProposalSDKType | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType | SetScalingFactorControllerProposalSDKType | CreateGroupsProposalSDKType | ReplacePoolIncentivesProposalSDKType | UpdatePoolIncentivesProposalSDKType | SetProtoRevEnabledProposalSDKType | SetProtoRevAdminAccountProposalSDKType | SetSuperfluidAssetsProposalSDKType | RemoveSuperfluidAssetsProposalSDKType | UpdateUnpoolWhiteListProposalSDKType | UpdateFeeTokenProposalSDKType | PromoteToPrivilegedContractProposalSDKType | DemotePrivilegedContractProposalSDKType | SetCodeAuthorizationProposalSDKType | RemoveCodeAuthorizationProposalSDKType | SetContractAuthorizationProposalSDKType | RemoveContractAuthorizationProposalSDKType | AllowDenomProposalSDKType | CreditTypeProposalSDKType | AnySDKType | undefined; authority: string; } /** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ @@ -1630,7 +1631,7 @@ export const MsgCancelProposalResponse = { }; } }; -export const Cosmos_govv1beta1Content_InterfaceDecoder = (input: BinaryReader | Uint8Array): MsgCreateAllianceProposal | MsgUpdateAllianceProposal | MsgDeleteAllianceProposal | CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | ClientUpdateProposal | UpgradeProposal | ReplaceMigrationRecordsProposal | UpdateMigrationRecordsProposal | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal | SetScalingFactorControllerProposal | CreateGroupsProposal | ReplacePoolIncentivesProposal | UpdatePoolIncentivesProposal | SetProtoRevEnabledProposal | SetProtoRevAdminAccountProposal | SetSuperfluidAssetsProposal | RemoveSuperfluidAssetsProposal | UpdateUnpoolWhiteListProposal | UpdateFeeTokenProposal | PromoteToPrivilegedContractProposal | DemotePrivilegedContractProposal | SetCodeAuthorizationProposal | RemoveCodeAuthorizationProposal | SetContractAuthorizationProposal | RemoveContractAuthorizationProposal | AllowDenomProposal | CreditTypeProposal | Any => { +export const Cosmos_govv1beta1Content_InterfaceDecoder = (input: BinaryReader | Uint8Array): MsgCreateAllianceProposal | MsgUpdateAllianceProposal | MsgDeleteAllianceProposal | CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | ClientUpdateProposal | UpgradeProposal | UploadCosmWasmPoolCodeAndWhiteListProposal | MigratePoolContractsProposal | ReplaceMigrationRecordsProposal | UpdateMigrationRecordsProposal | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal | SetScalingFactorControllerProposal | CreateGroupsProposal | ReplacePoolIncentivesProposal | UpdatePoolIncentivesProposal | SetProtoRevEnabledProposal | SetProtoRevAdminAccountProposal | SetSuperfluidAssetsProposal | RemoveSuperfluidAssetsProposal | UpdateUnpoolWhiteListProposal | UpdateFeeTokenProposal | PromoteToPrivilegedContractProposal | DemotePrivilegedContractProposal | SetCodeAuthorizationProposal | RemoveCodeAuthorizationProposal | SetContractAuthorizationProposal | RemoveContractAuthorizationProposal | AllowDenomProposal | CreditTypeProposal | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { @@ -1680,6 +1681,10 @@ export const Cosmos_govv1beta1Content_InterfaceDecoder = (input: BinaryReader | return ClientUpdateProposal.decode(data.value, undefined, true); case "/ibc.core.client.v1.UpgradeProposal": return UpgradeProposal.decode(data.value, undefined, true); + case "/osmosis.cosmwasmpool.v1beta1.UploadCosmWasmPoolCodeAndWhiteListProposal": + return UploadCosmWasmPoolCodeAndWhiteListProposal.decode(data.value, undefined, true); + case "/osmosis.cosmwasmpool.v1beta1.MigratePoolContractsProposal": + return MigratePoolContractsProposal.decode(data.value, undefined, true); case "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal": return ReplaceMigrationRecordsProposal.decode(data.value, undefined, true); case "/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal": @@ -1843,6 +1848,16 @@ export const Cosmos_govv1beta1Content_FromAmino = (content: AnyAmino) => { typeUrl: "/ibc.core.client.v1.UpgradeProposal", value: UpgradeProposal.encode(UpgradeProposal.fromPartial(UpgradeProposal.fromAmino(content.value))).finish() }); + case "osmosis/cosmwasmpool/upload-cosm-wasm-pool-code-and-white-list-proposal": + return Any.fromPartial({ + typeUrl: "/osmosis.cosmwasmpool.v1beta1.UploadCosmWasmPoolCodeAndWhiteListProposal", + value: UploadCosmWasmPoolCodeAndWhiteListProposal.encode(UploadCosmWasmPoolCodeAndWhiteListProposal.fromPartial(UploadCosmWasmPoolCodeAndWhiteListProposal.fromAmino(content.value))).finish() + }); + case "osmosis/cosmwasmpool/migrate-pool-contracts-proposal": + return Any.fromPartial({ + typeUrl: "/osmosis.cosmwasmpool.v1beta1.MigratePoolContractsProposal", + value: MigratePoolContractsProposal.encode(MigratePoolContractsProposal.fromPartial(MigratePoolContractsProposal.fromAmino(content.value))).finish() + }); case "osmosis/ReplaceMigrationRecordsProposal": return Any.fromPartial({ typeUrl: "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal", @@ -2069,6 +2084,16 @@ export const Cosmos_govv1beta1Content_ToAmino = (content: Any, useInterfaces: bo type: "cosmos-sdk/UpgradeProposal", value: UpgradeProposal.toAmino(UpgradeProposal.decode(content.value, undefined, useInterfaces), useInterfaces) }; + case "/osmosis.cosmwasmpool.v1beta1.UploadCosmWasmPoolCodeAndWhiteListProposal": + return { + type: "osmosis/cosmwasmpool/upload-cosm-wasm-pool-code-and-white-list-proposal", + value: UploadCosmWasmPoolCodeAndWhiteListProposal.toAmino(UploadCosmWasmPoolCodeAndWhiteListProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/osmosis.cosmwasmpool.v1beta1.MigratePoolContractsProposal": + return { + type: "osmosis/cosmwasmpool/migrate-pool-contracts-proposal", + value: MigratePoolContractsProposal.toAmino(MigratePoolContractsProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; case "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal": return { type: "osmosis/ReplaceMigrationRecordsProposal", diff --git a/packages/types/protobuf/codegen/cosmos/gov/v1beta1/gov.ts b/packages/types/protobuf/codegen/cosmos/gov/v1beta1/gov.ts index 0fe8bf626..fa6c1628a 100644 --- a/packages/types/protobuf/codegen/cosmos/gov/v1beta1/gov.ts +++ b/packages/types/protobuf/codegen/cosmos/gov/v1beta1/gov.ts @@ -9,6 +9,7 @@ import { ParameterChangeProposal, ParameterChangeProposalProtoMsg, ParameterChan import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, SoftwareUpgradeProposalSDKType, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposalSDKType } from "../../upgrade/v1beta1/upgrade"; import { StoreCodeProposal, StoreCodeProposalProtoMsg, StoreCodeProposalSDKType, InstantiateContractProposal, InstantiateContractProposalProtoMsg, InstantiateContractProposalSDKType, InstantiateContract2Proposal, InstantiateContract2ProposalProtoMsg, InstantiateContract2ProposalSDKType, MigrateContractProposal, MigrateContractProposalProtoMsg, MigrateContractProposalSDKType, SudoContractProposal, SudoContractProposalProtoMsg, SudoContractProposalSDKType, ExecuteContractProposal, ExecuteContractProposalProtoMsg, ExecuteContractProposalSDKType, UpdateAdminProposal, UpdateAdminProposalProtoMsg, UpdateAdminProposalSDKType, ClearAdminProposal, ClearAdminProposalProtoMsg, ClearAdminProposalSDKType, PinCodesProposal, PinCodesProposalProtoMsg, PinCodesProposalSDKType, UnpinCodesProposal, UnpinCodesProposalProtoMsg, UnpinCodesProposalSDKType, UpdateInstantiateConfigProposal, UpdateInstantiateConfigProposalProtoMsg, UpdateInstantiateConfigProposalSDKType, StoreAndInstantiateContractProposal, StoreAndInstantiateContractProposalProtoMsg, StoreAndInstantiateContractProposalSDKType } from "../../../cosmwasm/wasm/v1/proposal"; import { ClientUpdateProposal, ClientUpdateProposalProtoMsg, ClientUpdateProposalSDKType, UpgradeProposal, UpgradeProposalProtoMsg, UpgradeProposalSDKType } from "../../../ibc/core/client/v1/client"; +import { UploadCosmWasmPoolCodeAndWhiteListProposal, UploadCosmWasmPoolCodeAndWhiteListProposalProtoMsg, UploadCosmWasmPoolCodeAndWhiteListProposalSDKType, MigratePoolContractsProposal, MigratePoolContractsProposalProtoMsg, MigratePoolContractsProposalSDKType } from "../../../osmosis/cosmwasmpool/v1beta1/gov"; import { ReplaceMigrationRecordsProposal, ReplaceMigrationRecordsProposalProtoMsg, ReplaceMigrationRecordsProposalSDKType, UpdateMigrationRecordsProposal, UpdateMigrationRecordsProposalProtoMsg, UpdateMigrationRecordsProposalSDKType, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType, SetScalingFactorControllerProposal, SetScalingFactorControllerProposalProtoMsg, SetScalingFactorControllerProposalSDKType } from "../../../osmosis/gamm/v1beta1/gov"; import { CreateGroupsProposal, CreateGroupsProposalProtoMsg, CreateGroupsProposalSDKType } from "../../../osmosis/incentives/gov"; import { ReplacePoolIncentivesProposal, ReplacePoolIncentivesProposalProtoMsg, ReplacePoolIncentivesProposalSDKType, UpdatePoolIncentivesProposal, UpdatePoolIncentivesProposalProtoMsg, UpdatePoolIncentivesProposalSDKType } from "../../../osmosis/pool-incentives/v1beta1/gov"; @@ -279,7 +280,7 @@ export interface Proposal { /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; /** content is the proposal's content. */ - content?: (TextProposal & MsgCreateAllianceProposal & MsgUpdateAllianceProposal & MsgDeleteAllianceProposal & CommunityPoolSpendProposal & CommunityPoolSpendProposalWithDeposit & ParameterChangeProposal & SoftwareUpgradeProposal & CancelSoftwareUpgradeProposal & StoreCodeProposal & InstantiateContractProposal & InstantiateContract2Proposal & MigrateContractProposal & SudoContractProposal & ExecuteContractProposal & UpdateAdminProposal & ClearAdminProposal & PinCodesProposal & UnpinCodesProposal & UpdateInstantiateConfigProposal & StoreAndInstantiateContractProposal & ClientUpdateProposal & UpgradeProposal & ReplaceMigrationRecordsProposal & UpdateMigrationRecordsProposal & CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal & SetScalingFactorControllerProposal & CreateGroupsProposal & ReplacePoolIncentivesProposal & UpdatePoolIncentivesProposal & SetProtoRevEnabledProposal & SetProtoRevAdminAccountProposal & SetSuperfluidAssetsProposal & RemoveSuperfluidAssetsProposal & UpdateUnpoolWhiteListProposal & UpdateFeeTokenProposal & PromoteToPrivilegedContractProposal & DemotePrivilegedContractProposal & SetCodeAuthorizationProposal & RemoveCodeAuthorizationProposal & SetContractAuthorizationProposal & RemoveContractAuthorizationProposal & AllowDenomProposal & CreditTypeProposal & Any) | undefined; + content?: (TextProposal & MsgCreateAllianceProposal & MsgUpdateAllianceProposal & MsgDeleteAllianceProposal & CommunityPoolSpendProposal & CommunityPoolSpendProposalWithDeposit & ParameterChangeProposal & SoftwareUpgradeProposal & CancelSoftwareUpgradeProposal & StoreCodeProposal & InstantiateContractProposal & InstantiateContract2Proposal & MigrateContractProposal & SudoContractProposal & ExecuteContractProposal & UpdateAdminProposal & ClearAdminProposal & PinCodesProposal & UnpinCodesProposal & UpdateInstantiateConfigProposal & StoreAndInstantiateContractProposal & ClientUpdateProposal & UpgradeProposal & UploadCosmWasmPoolCodeAndWhiteListProposal & MigratePoolContractsProposal & ReplaceMigrationRecordsProposal & UpdateMigrationRecordsProposal & CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal & SetScalingFactorControllerProposal & CreateGroupsProposal & ReplacePoolIncentivesProposal & UpdatePoolIncentivesProposal & SetProtoRevEnabledProposal & SetProtoRevAdminAccountProposal & SetSuperfluidAssetsProposal & RemoveSuperfluidAssetsProposal & UpdateUnpoolWhiteListProposal & UpdateFeeTokenProposal & PromoteToPrivilegedContractProposal & DemotePrivilegedContractProposal & SetCodeAuthorizationProposal & RemoveCodeAuthorizationProposal & SetContractAuthorizationProposal & RemoveContractAuthorizationProposal & AllowDenomProposal & CreditTypeProposal & Any) | undefined; /** status defines the proposal status. */ status: ProposalStatus; /** @@ -304,7 +305,7 @@ export interface ProposalProtoMsg { value: Uint8Array; } export type ProposalEncoded = Omit & { - /** content is the proposal's content. */content?: TextProposalProtoMsg | MsgCreateAllianceProposalProtoMsg | MsgUpdateAllianceProposalProtoMsg | MsgDeleteAllianceProposalProtoMsg | CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | ParameterChangeProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | ClientUpdateProposalProtoMsg | UpgradeProposalProtoMsg | ReplaceMigrationRecordsProposalProtoMsg | UpdateMigrationRecordsProposalProtoMsg | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg | SetScalingFactorControllerProposalProtoMsg | CreateGroupsProposalProtoMsg | ReplacePoolIncentivesProposalProtoMsg | UpdatePoolIncentivesProposalProtoMsg | SetProtoRevEnabledProposalProtoMsg | SetProtoRevAdminAccountProposalProtoMsg | SetSuperfluidAssetsProposalProtoMsg | RemoveSuperfluidAssetsProposalProtoMsg | UpdateUnpoolWhiteListProposalProtoMsg | UpdateFeeTokenProposalProtoMsg | PromoteToPrivilegedContractProposalProtoMsg | DemotePrivilegedContractProposalProtoMsg | SetCodeAuthorizationProposalProtoMsg | RemoveCodeAuthorizationProposalProtoMsg | SetContractAuthorizationProposalProtoMsg | RemoveContractAuthorizationProposalProtoMsg | AllowDenomProposalProtoMsg | CreditTypeProposalProtoMsg | AnyProtoMsg | undefined; + /** content is the proposal's content. */content?: TextProposalProtoMsg | MsgCreateAllianceProposalProtoMsg | MsgUpdateAllianceProposalProtoMsg | MsgDeleteAllianceProposalProtoMsg | CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | ParameterChangeProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | ClientUpdateProposalProtoMsg | UpgradeProposalProtoMsg | UploadCosmWasmPoolCodeAndWhiteListProposalProtoMsg | MigratePoolContractsProposalProtoMsg | ReplaceMigrationRecordsProposalProtoMsg | UpdateMigrationRecordsProposalProtoMsg | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg | SetScalingFactorControllerProposalProtoMsg | CreateGroupsProposalProtoMsg | ReplacePoolIncentivesProposalProtoMsg | UpdatePoolIncentivesProposalProtoMsg | SetProtoRevEnabledProposalProtoMsg | SetProtoRevAdminAccountProposalProtoMsg | SetSuperfluidAssetsProposalProtoMsg | RemoveSuperfluidAssetsProposalProtoMsg | UpdateUnpoolWhiteListProposalProtoMsg | UpdateFeeTokenProposalProtoMsg | PromoteToPrivilegedContractProposalProtoMsg | DemotePrivilegedContractProposalProtoMsg | SetCodeAuthorizationProposalProtoMsg | RemoveCodeAuthorizationProposalProtoMsg | SetContractAuthorizationProposalProtoMsg | RemoveContractAuthorizationProposalProtoMsg | AllowDenomProposalProtoMsg | CreditTypeProposalProtoMsg | AnyProtoMsg | undefined; }; /** Proposal defines the core field members of a governance proposal. */ export interface ProposalAmino { @@ -338,7 +339,7 @@ export interface ProposalAminoMsg { /** Proposal defines the core field members of a governance proposal. */ export interface ProposalSDKType { proposal_id: bigint; - content?: TextProposalSDKType | MsgCreateAllianceProposalSDKType | MsgUpdateAllianceProposalSDKType | MsgDeleteAllianceProposalSDKType | CommunityPoolSpendProposalSDKType | CommunityPoolSpendProposalWithDepositSDKType | ParameterChangeProposalSDKType | SoftwareUpgradeProposalSDKType | CancelSoftwareUpgradeProposalSDKType | StoreCodeProposalSDKType | InstantiateContractProposalSDKType | InstantiateContract2ProposalSDKType | MigrateContractProposalSDKType | SudoContractProposalSDKType | ExecuteContractProposalSDKType | UpdateAdminProposalSDKType | ClearAdminProposalSDKType | PinCodesProposalSDKType | UnpinCodesProposalSDKType | UpdateInstantiateConfigProposalSDKType | StoreAndInstantiateContractProposalSDKType | ClientUpdateProposalSDKType | UpgradeProposalSDKType | ReplaceMigrationRecordsProposalSDKType | UpdateMigrationRecordsProposalSDKType | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType | SetScalingFactorControllerProposalSDKType | CreateGroupsProposalSDKType | ReplacePoolIncentivesProposalSDKType | UpdatePoolIncentivesProposalSDKType | SetProtoRevEnabledProposalSDKType | SetProtoRevAdminAccountProposalSDKType | SetSuperfluidAssetsProposalSDKType | RemoveSuperfluidAssetsProposalSDKType | UpdateUnpoolWhiteListProposalSDKType | UpdateFeeTokenProposalSDKType | PromoteToPrivilegedContractProposalSDKType | DemotePrivilegedContractProposalSDKType | SetCodeAuthorizationProposalSDKType | RemoveCodeAuthorizationProposalSDKType | SetContractAuthorizationProposalSDKType | RemoveContractAuthorizationProposalSDKType | AllowDenomProposalSDKType | CreditTypeProposalSDKType | AnySDKType | undefined; + content?: TextProposalSDKType | MsgCreateAllianceProposalSDKType | MsgUpdateAllianceProposalSDKType | MsgDeleteAllianceProposalSDKType | CommunityPoolSpendProposalSDKType | CommunityPoolSpendProposalWithDepositSDKType | ParameterChangeProposalSDKType | SoftwareUpgradeProposalSDKType | CancelSoftwareUpgradeProposalSDKType | StoreCodeProposalSDKType | InstantiateContractProposalSDKType | InstantiateContract2ProposalSDKType | MigrateContractProposalSDKType | SudoContractProposalSDKType | ExecuteContractProposalSDKType | UpdateAdminProposalSDKType | ClearAdminProposalSDKType | PinCodesProposalSDKType | UnpinCodesProposalSDKType | UpdateInstantiateConfigProposalSDKType | StoreAndInstantiateContractProposalSDKType | ClientUpdateProposalSDKType | UpgradeProposalSDKType | UploadCosmWasmPoolCodeAndWhiteListProposalSDKType | MigratePoolContractsProposalSDKType | ReplaceMigrationRecordsProposalSDKType | UpdateMigrationRecordsProposalSDKType | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType | SetScalingFactorControllerProposalSDKType | CreateGroupsProposalSDKType | ReplacePoolIncentivesProposalSDKType | UpdatePoolIncentivesProposalSDKType | SetProtoRevEnabledProposalSDKType | SetProtoRevAdminAccountProposalSDKType | SetSuperfluidAssetsProposalSDKType | RemoveSuperfluidAssetsProposalSDKType | UpdateUnpoolWhiteListProposalSDKType | UpdateFeeTokenProposalSDKType | PromoteToPrivilegedContractProposalSDKType | DemotePrivilegedContractProposalSDKType | SetCodeAuthorizationProposalSDKType | RemoveCodeAuthorizationProposalSDKType | SetContractAuthorizationProposalSDKType | RemoveContractAuthorizationProposalSDKType | AllowDenomProposalSDKType | CreditTypeProposalSDKType | AnySDKType | undefined; status: ProposalStatus; final_tally_result: TallyResultSDKType | undefined; submit_time: Date | undefined; @@ -1430,7 +1431,7 @@ export const TallyParams = { }; } }; -export const Cosmos_govv1beta1Content_InterfaceDecoder = (input: BinaryReader | Uint8Array): MsgCreateAllianceProposal | MsgUpdateAllianceProposal | MsgDeleteAllianceProposal | CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | ClientUpdateProposal | UpgradeProposal | ReplaceMigrationRecordsProposal | UpdateMigrationRecordsProposal | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal | SetScalingFactorControllerProposal | CreateGroupsProposal | ReplacePoolIncentivesProposal | UpdatePoolIncentivesProposal | SetProtoRevEnabledProposal | SetProtoRevAdminAccountProposal | SetSuperfluidAssetsProposal | RemoveSuperfluidAssetsProposal | UpdateUnpoolWhiteListProposal | UpdateFeeTokenProposal | PromoteToPrivilegedContractProposal | DemotePrivilegedContractProposal | SetCodeAuthorizationProposal | RemoveCodeAuthorizationProposal | SetContractAuthorizationProposal | RemoveContractAuthorizationProposal | AllowDenomProposal | CreditTypeProposal | Any => { +export const Cosmos_govv1beta1Content_InterfaceDecoder = (input: BinaryReader | Uint8Array): MsgCreateAllianceProposal | MsgUpdateAllianceProposal | MsgDeleteAllianceProposal | CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | ClientUpdateProposal | UpgradeProposal | UploadCosmWasmPoolCodeAndWhiteListProposal | MigratePoolContractsProposal | ReplaceMigrationRecordsProposal | UpdateMigrationRecordsProposal | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal | SetScalingFactorControllerProposal | CreateGroupsProposal | ReplacePoolIncentivesProposal | UpdatePoolIncentivesProposal | SetProtoRevEnabledProposal | SetProtoRevAdminAccountProposal | SetSuperfluidAssetsProposal | RemoveSuperfluidAssetsProposal | UpdateUnpoolWhiteListProposal | UpdateFeeTokenProposal | PromoteToPrivilegedContractProposal | DemotePrivilegedContractProposal | SetCodeAuthorizationProposal | RemoveCodeAuthorizationProposal | SetContractAuthorizationProposal | RemoveContractAuthorizationProposal | AllowDenomProposal | CreditTypeProposal | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { @@ -1480,6 +1481,10 @@ export const Cosmos_govv1beta1Content_InterfaceDecoder = (input: BinaryReader | return ClientUpdateProposal.decode(data.value, undefined, true); case "/ibc.core.client.v1.UpgradeProposal": return UpgradeProposal.decode(data.value, undefined, true); + case "/osmosis.cosmwasmpool.v1beta1.UploadCosmWasmPoolCodeAndWhiteListProposal": + return UploadCosmWasmPoolCodeAndWhiteListProposal.decode(data.value, undefined, true); + case "/osmosis.cosmwasmpool.v1beta1.MigratePoolContractsProposal": + return MigratePoolContractsProposal.decode(data.value, undefined, true); case "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal": return ReplaceMigrationRecordsProposal.decode(data.value, undefined, true); case "/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal": @@ -1643,6 +1648,16 @@ export const Cosmos_govv1beta1Content_FromAmino = (content: AnyAmino) => { typeUrl: "/ibc.core.client.v1.UpgradeProposal", value: UpgradeProposal.encode(UpgradeProposal.fromPartial(UpgradeProposal.fromAmino(content.value))).finish() }); + case "osmosis/cosmwasmpool/upload-cosm-wasm-pool-code-and-white-list-proposal": + return Any.fromPartial({ + typeUrl: "/osmosis.cosmwasmpool.v1beta1.UploadCosmWasmPoolCodeAndWhiteListProposal", + value: UploadCosmWasmPoolCodeAndWhiteListProposal.encode(UploadCosmWasmPoolCodeAndWhiteListProposal.fromPartial(UploadCosmWasmPoolCodeAndWhiteListProposal.fromAmino(content.value))).finish() + }); + case "osmosis/cosmwasmpool/migrate-pool-contracts-proposal": + return Any.fromPartial({ + typeUrl: "/osmosis.cosmwasmpool.v1beta1.MigratePoolContractsProposal", + value: MigratePoolContractsProposal.encode(MigratePoolContractsProposal.fromPartial(MigratePoolContractsProposal.fromAmino(content.value))).finish() + }); case "osmosis/ReplaceMigrationRecordsProposal": return Any.fromPartial({ typeUrl: "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal", @@ -1869,6 +1884,16 @@ export const Cosmos_govv1beta1Content_ToAmino = (content: Any, useInterfaces: bo type: "cosmos-sdk/UpgradeProposal", value: UpgradeProposal.toAmino(UpgradeProposal.decode(content.value, undefined, useInterfaces), useInterfaces) }; + case "/osmosis.cosmwasmpool.v1beta1.UploadCosmWasmPoolCodeAndWhiteListProposal": + return { + type: "osmosis/cosmwasmpool/upload-cosm-wasm-pool-code-and-white-list-proposal", + value: UploadCosmWasmPoolCodeAndWhiteListProposal.toAmino(UploadCosmWasmPoolCodeAndWhiteListProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/osmosis.cosmwasmpool.v1beta1.MigratePoolContractsProposal": + return { + type: "osmosis/cosmwasmpool/migrate-pool-contracts-proposal", + value: MigratePoolContractsProposal.toAmino(MigratePoolContractsProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; case "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal": return { type: "osmosis/ReplaceMigrationRecordsProposal", diff --git a/packages/types/protobuf/codegen/cosmos/gov/v1beta1/tx.ts b/packages/types/protobuf/codegen/cosmos/gov/v1beta1/tx.ts index 2451cbfd8..cced669c2 100644 --- a/packages/types/protobuf/codegen/cosmos/gov/v1beta1/tx.ts +++ b/packages/types/protobuf/codegen/cosmos/gov/v1beta1/tx.ts @@ -8,6 +8,7 @@ import { ParameterChangeProposal, ParameterChangeProposalProtoMsg, ParameterChan import { SoftwareUpgradeProposal, SoftwareUpgradeProposalProtoMsg, SoftwareUpgradeProposalSDKType, CancelSoftwareUpgradeProposal, CancelSoftwareUpgradeProposalProtoMsg, CancelSoftwareUpgradeProposalSDKType } from "../../upgrade/v1beta1/upgrade"; import { StoreCodeProposal, StoreCodeProposalProtoMsg, StoreCodeProposalSDKType, InstantiateContractProposal, InstantiateContractProposalProtoMsg, InstantiateContractProposalSDKType, InstantiateContract2Proposal, InstantiateContract2ProposalProtoMsg, InstantiateContract2ProposalSDKType, MigrateContractProposal, MigrateContractProposalProtoMsg, MigrateContractProposalSDKType, SudoContractProposal, SudoContractProposalProtoMsg, SudoContractProposalSDKType, ExecuteContractProposal, ExecuteContractProposalProtoMsg, ExecuteContractProposalSDKType, UpdateAdminProposal, UpdateAdminProposalProtoMsg, UpdateAdminProposalSDKType, ClearAdminProposal, ClearAdminProposalProtoMsg, ClearAdminProposalSDKType, PinCodesProposal, PinCodesProposalProtoMsg, PinCodesProposalSDKType, UnpinCodesProposal, UnpinCodesProposalProtoMsg, UnpinCodesProposalSDKType, UpdateInstantiateConfigProposal, UpdateInstantiateConfigProposalProtoMsg, UpdateInstantiateConfigProposalSDKType, StoreAndInstantiateContractProposal, StoreAndInstantiateContractProposalProtoMsg, StoreAndInstantiateContractProposalSDKType } from "../../../cosmwasm/wasm/v1/proposal"; import { ClientUpdateProposal, ClientUpdateProposalProtoMsg, ClientUpdateProposalSDKType, UpgradeProposal, UpgradeProposalProtoMsg, UpgradeProposalSDKType } from "../../../ibc/core/client/v1/client"; +import { UploadCosmWasmPoolCodeAndWhiteListProposal, UploadCosmWasmPoolCodeAndWhiteListProposalProtoMsg, UploadCosmWasmPoolCodeAndWhiteListProposalSDKType, MigratePoolContractsProposal, MigratePoolContractsProposalProtoMsg, MigratePoolContractsProposalSDKType } from "../../../osmosis/cosmwasmpool/v1beta1/gov"; import { ReplaceMigrationRecordsProposal, ReplaceMigrationRecordsProposalProtoMsg, ReplaceMigrationRecordsProposalSDKType, UpdateMigrationRecordsProposal, UpdateMigrationRecordsProposalProtoMsg, UpdateMigrationRecordsProposalSDKType, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg, CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType, SetScalingFactorControllerProposal, SetScalingFactorControllerProposalProtoMsg, SetScalingFactorControllerProposalSDKType } from "../../../osmosis/gamm/v1beta1/gov"; import { CreateGroupsProposal, CreateGroupsProposalProtoMsg, CreateGroupsProposalSDKType } from "../../../osmosis/incentives/gov"; import { ReplacePoolIncentivesProposal, ReplacePoolIncentivesProposalProtoMsg, ReplacePoolIncentivesProposalSDKType, UpdatePoolIncentivesProposal, UpdatePoolIncentivesProposalProtoMsg, UpdatePoolIncentivesProposalSDKType } from "../../../osmosis/pool-incentives/v1beta1/gov"; @@ -25,7 +26,7 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; */ export interface MsgSubmitProposal { /** content is the proposal's content. */ - content?: (MsgCreateAllianceProposal & MsgUpdateAllianceProposal & MsgDeleteAllianceProposal & CommunityPoolSpendProposal & CommunityPoolSpendProposalWithDeposit & TextProposal & ParameterChangeProposal & SoftwareUpgradeProposal & CancelSoftwareUpgradeProposal & StoreCodeProposal & InstantiateContractProposal & InstantiateContract2Proposal & MigrateContractProposal & SudoContractProposal & ExecuteContractProposal & UpdateAdminProposal & ClearAdminProposal & PinCodesProposal & UnpinCodesProposal & UpdateInstantiateConfigProposal & StoreAndInstantiateContractProposal & ClientUpdateProposal & UpgradeProposal & ReplaceMigrationRecordsProposal & UpdateMigrationRecordsProposal & CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal & SetScalingFactorControllerProposal & CreateGroupsProposal & ReplacePoolIncentivesProposal & UpdatePoolIncentivesProposal & SetProtoRevEnabledProposal & SetProtoRevAdminAccountProposal & SetSuperfluidAssetsProposal & RemoveSuperfluidAssetsProposal & UpdateUnpoolWhiteListProposal & UpdateFeeTokenProposal & PromoteToPrivilegedContractProposal & DemotePrivilegedContractProposal & SetCodeAuthorizationProposal & RemoveCodeAuthorizationProposal & SetContractAuthorizationProposal & RemoveContractAuthorizationProposal & AllowDenomProposal & CreditTypeProposal & Any) | undefined; + content?: (MsgCreateAllianceProposal & MsgUpdateAllianceProposal & MsgDeleteAllianceProposal & CommunityPoolSpendProposal & CommunityPoolSpendProposalWithDeposit & TextProposal & ParameterChangeProposal & SoftwareUpgradeProposal & CancelSoftwareUpgradeProposal & StoreCodeProposal & InstantiateContractProposal & InstantiateContract2Proposal & MigrateContractProposal & SudoContractProposal & ExecuteContractProposal & UpdateAdminProposal & ClearAdminProposal & PinCodesProposal & UnpinCodesProposal & UpdateInstantiateConfigProposal & StoreAndInstantiateContractProposal & ClientUpdateProposal & UpgradeProposal & UploadCosmWasmPoolCodeAndWhiteListProposal & MigratePoolContractsProposal & ReplaceMigrationRecordsProposal & UpdateMigrationRecordsProposal & CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal & SetScalingFactorControllerProposal & CreateGroupsProposal & ReplacePoolIncentivesProposal & UpdatePoolIncentivesProposal & SetProtoRevEnabledProposal & SetProtoRevAdminAccountProposal & SetSuperfluidAssetsProposal & RemoveSuperfluidAssetsProposal & UpdateUnpoolWhiteListProposal & UpdateFeeTokenProposal & PromoteToPrivilegedContractProposal & DemotePrivilegedContractProposal & SetCodeAuthorizationProposal & RemoveCodeAuthorizationProposal & SetContractAuthorizationProposal & RemoveContractAuthorizationProposal & AllowDenomProposal & CreditTypeProposal & Any) | undefined; /** initial_deposit is the deposit value that must be paid at proposal submission. */ initialDeposit: Coin[]; /** proposer is the account address of the proposer. */ @@ -36,7 +37,7 @@ export interface MsgSubmitProposalProtoMsg { value: Uint8Array; } export type MsgSubmitProposalEncoded = Omit & { - /** content is the proposal's content. */content?: MsgCreateAllianceProposalProtoMsg | MsgUpdateAllianceProposalProtoMsg | MsgDeleteAllianceProposalProtoMsg | CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | ParameterChangeProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | ClientUpdateProposalProtoMsg | UpgradeProposalProtoMsg | ReplaceMigrationRecordsProposalProtoMsg | UpdateMigrationRecordsProposalProtoMsg | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg | SetScalingFactorControllerProposalProtoMsg | CreateGroupsProposalProtoMsg | ReplacePoolIncentivesProposalProtoMsg | UpdatePoolIncentivesProposalProtoMsg | SetProtoRevEnabledProposalProtoMsg | SetProtoRevAdminAccountProposalProtoMsg | SetSuperfluidAssetsProposalProtoMsg | RemoveSuperfluidAssetsProposalProtoMsg | UpdateUnpoolWhiteListProposalProtoMsg | UpdateFeeTokenProposalProtoMsg | PromoteToPrivilegedContractProposalProtoMsg | DemotePrivilegedContractProposalProtoMsg | SetCodeAuthorizationProposalProtoMsg | RemoveCodeAuthorizationProposalProtoMsg | SetContractAuthorizationProposalProtoMsg | RemoveContractAuthorizationProposalProtoMsg | AllowDenomProposalProtoMsg | CreditTypeProposalProtoMsg | AnyProtoMsg | undefined; + /** content is the proposal's content. */content?: MsgCreateAllianceProposalProtoMsg | MsgUpdateAllianceProposalProtoMsg | MsgDeleteAllianceProposalProtoMsg | CommunityPoolSpendProposalProtoMsg | CommunityPoolSpendProposalWithDepositProtoMsg | TextProposalProtoMsg | ParameterChangeProposalProtoMsg | SoftwareUpgradeProposalProtoMsg | CancelSoftwareUpgradeProposalProtoMsg | StoreCodeProposalProtoMsg | InstantiateContractProposalProtoMsg | InstantiateContract2ProposalProtoMsg | MigrateContractProposalProtoMsg | SudoContractProposalProtoMsg | ExecuteContractProposalProtoMsg | UpdateAdminProposalProtoMsg | ClearAdminProposalProtoMsg | PinCodesProposalProtoMsg | UnpinCodesProposalProtoMsg | UpdateInstantiateConfigProposalProtoMsg | StoreAndInstantiateContractProposalProtoMsg | ClientUpdateProposalProtoMsg | UpgradeProposalProtoMsg | UploadCosmWasmPoolCodeAndWhiteListProposalProtoMsg | MigratePoolContractsProposalProtoMsg | ReplaceMigrationRecordsProposalProtoMsg | UpdateMigrationRecordsProposalProtoMsg | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalProtoMsg | SetScalingFactorControllerProposalProtoMsg | CreateGroupsProposalProtoMsg | ReplacePoolIncentivesProposalProtoMsg | UpdatePoolIncentivesProposalProtoMsg | SetProtoRevEnabledProposalProtoMsg | SetProtoRevAdminAccountProposalProtoMsg | SetSuperfluidAssetsProposalProtoMsg | RemoveSuperfluidAssetsProposalProtoMsg | UpdateUnpoolWhiteListProposalProtoMsg | UpdateFeeTokenProposalProtoMsg | PromoteToPrivilegedContractProposalProtoMsg | DemotePrivilegedContractProposalProtoMsg | SetCodeAuthorizationProposalProtoMsg | RemoveCodeAuthorizationProposalProtoMsg | SetContractAuthorizationProposalProtoMsg | RemoveContractAuthorizationProposalProtoMsg | AllowDenomProposalProtoMsg | CreditTypeProposalProtoMsg | AnyProtoMsg | undefined; }; /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary @@ -59,7 +60,7 @@ export interface MsgSubmitProposalAminoMsg { * proposal Content. */ export interface MsgSubmitProposalSDKType { - content?: MsgCreateAllianceProposalSDKType | MsgUpdateAllianceProposalSDKType | MsgDeleteAllianceProposalSDKType | CommunityPoolSpendProposalSDKType | CommunityPoolSpendProposalWithDepositSDKType | TextProposalSDKType | ParameterChangeProposalSDKType | SoftwareUpgradeProposalSDKType | CancelSoftwareUpgradeProposalSDKType | StoreCodeProposalSDKType | InstantiateContractProposalSDKType | InstantiateContract2ProposalSDKType | MigrateContractProposalSDKType | SudoContractProposalSDKType | ExecuteContractProposalSDKType | UpdateAdminProposalSDKType | ClearAdminProposalSDKType | PinCodesProposalSDKType | UnpinCodesProposalSDKType | UpdateInstantiateConfigProposalSDKType | StoreAndInstantiateContractProposalSDKType | ClientUpdateProposalSDKType | UpgradeProposalSDKType | ReplaceMigrationRecordsProposalSDKType | UpdateMigrationRecordsProposalSDKType | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType | SetScalingFactorControllerProposalSDKType | CreateGroupsProposalSDKType | ReplacePoolIncentivesProposalSDKType | UpdatePoolIncentivesProposalSDKType | SetProtoRevEnabledProposalSDKType | SetProtoRevAdminAccountProposalSDKType | SetSuperfluidAssetsProposalSDKType | RemoveSuperfluidAssetsProposalSDKType | UpdateUnpoolWhiteListProposalSDKType | UpdateFeeTokenProposalSDKType | PromoteToPrivilegedContractProposalSDKType | DemotePrivilegedContractProposalSDKType | SetCodeAuthorizationProposalSDKType | RemoveCodeAuthorizationProposalSDKType | SetContractAuthorizationProposalSDKType | RemoveContractAuthorizationProposalSDKType | AllowDenomProposalSDKType | CreditTypeProposalSDKType | AnySDKType | undefined; + content?: MsgCreateAllianceProposalSDKType | MsgUpdateAllianceProposalSDKType | MsgDeleteAllianceProposalSDKType | CommunityPoolSpendProposalSDKType | CommunityPoolSpendProposalWithDepositSDKType | TextProposalSDKType | ParameterChangeProposalSDKType | SoftwareUpgradeProposalSDKType | CancelSoftwareUpgradeProposalSDKType | StoreCodeProposalSDKType | InstantiateContractProposalSDKType | InstantiateContract2ProposalSDKType | MigrateContractProposalSDKType | SudoContractProposalSDKType | ExecuteContractProposalSDKType | UpdateAdminProposalSDKType | ClearAdminProposalSDKType | PinCodesProposalSDKType | UnpinCodesProposalSDKType | UpdateInstantiateConfigProposalSDKType | StoreAndInstantiateContractProposalSDKType | ClientUpdateProposalSDKType | UpgradeProposalSDKType | UploadCosmWasmPoolCodeAndWhiteListProposalSDKType | MigratePoolContractsProposalSDKType | ReplaceMigrationRecordsProposalSDKType | UpdateMigrationRecordsProposalSDKType | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposalSDKType | SetScalingFactorControllerProposalSDKType | CreateGroupsProposalSDKType | ReplacePoolIncentivesProposalSDKType | UpdatePoolIncentivesProposalSDKType | SetProtoRevEnabledProposalSDKType | SetProtoRevAdminAccountProposalSDKType | SetSuperfluidAssetsProposalSDKType | RemoveSuperfluidAssetsProposalSDKType | UpdateUnpoolWhiteListProposalSDKType | UpdateFeeTokenProposalSDKType | PromoteToPrivilegedContractProposalSDKType | DemotePrivilegedContractProposalSDKType | SetCodeAuthorizationProposalSDKType | RemoveCodeAuthorizationProposalSDKType | SetContractAuthorizationProposalSDKType | RemoveContractAuthorizationProposalSDKType | AllowDenomProposalSDKType | CreditTypeProposalSDKType | AnySDKType | undefined; initial_deposit: CoinSDKType[]; proposer: string; } @@ -862,7 +863,7 @@ export const MsgDepositResponse = { }; } }; -export const Cosmos_govv1beta1Content_InterfaceDecoder = (input: BinaryReader | Uint8Array): MsgCreateAllianceProposal | MsgUpdateAllianceProposal | MsgDeleteAllianceProposal | CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | ClientUpdateProposal | UpgradeProposal | ReplaceMigrationRecordsProposal | UpdateMigrationRecordsProposal | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal | SetScalingFactorControllerProposal | CreateGroupsProposal | ReplacePoolIncentivesProposal | UpdatePoolIncentivesProposal | SetProtoRevEnabledProposal | SetProtoRevAdminAccountProposal | SetSuperfluidAssetsProposal | RemoveSuperfluidAssetsProposal | UpdateUnpoolWhiteListProposal | UpdateFeeTokenProposal | PromoteToPrivilegedContractProposal | DemotePrivilegedContractProposal | SetCodeAuthorizationProposal | RemoveCodeAuthorizationProposal | SetContractAuthorizationProposal | RemoveContractAuthorizationProposal | AllowDenomProposal | CreditTypeProposal | Any => { +export const Cosmos_govv1beta1Content_InterfaceDecoder = (input: BinaryReader | Uint8Array): MsgCreateAllianceProposal | MsgUpdateAllianceProposal | MsgDeleteAllianceProposal | CommunityPoolSpendProposal | CommunityPoolSpendProposalWithDeposit | TextProposal | ParameterChangeProposal | SoftwareUpgradeProposal | CancelSoftwareUpgradeProposal | StoreCodeProposal | InstantiateContractProposal | InstantiateContract2Proposal | MigrateContractProposal | SudoContractProposal | ExecuteContractProposal | UpdateAdminProposal | ClearAdminProposal | PinCodesProposal | UnpinCodesProposal | UpdateInstantiateConfigProposal | StoreAndInstantiateContractProposal | ClientUpdateProposal | UpgradeProposal | UploadCosmWasmPoolCodeAndWhiteListProposal | MigratePoolContractsProposal | ReplaceMigrationRecordsProposal | UpdateMigrationRecordsProposal | CreateConcentratedLiquidityPoolsAndLinktoCFMMProposal | SetScalingFactorControllerProposal | CreateGroupsProposal | ReplacePoolIncentivesProposal | UpdatePoolIncentivesProposal | SetProtoRevEnabledProposal | SetProtoRevAdminAccountProposal | SetSuperfluidAssetsProposal | RemoveSuperfluidAssetsProposal | UpdateUnpoolWhiteListProposal | UpdateFeeTokenProposal | PromoteToPrivilegedContractProposal | DemotePrivilegedContractProposal | SetCodeAuthorizationProposal | RemoveCodeAuthorizationProposal | SetContractAuthorizationProposal | RemoveContractAuthorizationProposal | AllowDenomProposal | CreditTypeProposal | Any => { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const data = Any.decode(reader, reader.uint32(), true); switch (data.typeUrl) { @@ -912,6 +913,10 @@ export const Cosmos_govv1beta1Content_InterfaceDecoder = (input: BinaryReader | return ClientUpdateProposal.decode(data.value, undefined, true); case "/ibc.core.client.v1.UpgradeProposal": return UpgradeProposal.decode(data.value, undefined, true); + case "/osmosis.cosmwasmpool.v1beta1.UploadCosmWasmPoolCodeAndWhiteListProposal": + return UploadCosmWasmPoolCodeAndWhiteListProposal.decode(data.value, undefined, true); + case "/osmosis.cosmwasmpool.v1beta1.MigratePoolContractsProposal": + return MigratePoolContractsProposal.decode(data.value, undefined, true); case "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal": return ReplaceMigrationRecordsProposal.decode(data.value, undefined, true); case "/osmosis.gamm.v1beta1.UpdateMigrationRecordsProposal": @@ -1075,6 +1080,16 @@ export const Cosmos_govv1beta1Content_FromAmino = (content: AnyAmino) => { typeUrl: "/ibc.core.client.v1.UpgradeProposal", value: UpgradeProposal.encode(UpgradeProposal.fromPartial(UpgradeProposal.fromAmino(content.value))).finish() }); + case "osmosis/cosmwasmpool/upload-cosm-wasm-pool-code-and-white-list-proposal": + return Any.fromPartial({ + typeUrl: "/osmosis.cosmwasmpool.v1beta1.UploadCosmWasmPoolCodeAndWhiteListProposal", + value: UploadCosmWasmPoolCodeAndWhiteListProposal.encode(UploadCosmWasmPoolCodeAndWhiteListProposal.fromPartial(UploadCosmWasmPoolCodeAndWhiteListProposal.fromAmino(content.value))).finish() + }); + case "osmosis/cosmwasmpool/migrate-pool-contracts-proposal": + return Any.fromPartial({ + typeUrl: "/osmosis.cosmwasmpool.v1beta1.MigratePoolContractsProposal", + value: MigratePoolContractsProposal.encode(MigratePoolContractsProposal.fromPartial(MigratePoolContractsProposal.fromAmino(content.value))).finish() + }); case "osmosis/ReplaceMigrationRecordsProposal": return Any.fromPartial({ typeUrl: "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal", @@ -1301,6 +1316,16 @@ export const Cosmos_govv1beta1Content_ToAmino = (content: Any, useInterfaces: bo type: "cosmos-sdk/UpgradeProposal", value: UpgradeProposal.toAmino(UpgradeProposal.decode(content.value, undefined, useInterfaces), useInterfaces) }; + case "/osmosis.cosmwasmpool.v1beta1.UploadCosmWasmPoolCodeAndWhiteListProposal": + return { + type: "osmosis/cosmwasmpool/upload-cosm-wasm-pool-code-and-white-list-proposal", + value: UploadCosmWasmPoolCodeAndWhiteListProposal.toAmino(UploadCosmWasmPoolCodeAndWhiteListProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/osmosis.cosmwasmpool.v1beta1.MigratePoolContractsProposal": + return { + type: "osmosis/cosmwasmpool/migrate-pool-contracts-proposal", + value: MigratePoolContractsProposal.toAmino(MigratePoolContractsProposal.decode(content.value, undefined, useInterfaces), useInterfaces) + }; case "/osmosis.gamm.v1beta1.ReplaceMigrationRecordsProposal": return { type: "osmosis/ReplaceMigrationRecordsProposal", diff --git a/packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts b/packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts index cd0e0d288..638c0887d 100644 --- a/packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts +++ b/packages/types/protobuf/codegen/osmosis/cosmwasmpool/v1beta1/gov.ts @@ -8,6 +8,7 @@ import { bytesFromBase64, base64FromBytes } from "../../../helpers"; * code ids created by this message are eligible for being x/cosmwasmpool pools. */ export interface UploadCosmWasmPoolCodeAndWhiteListProposal { + $typeUrl?: "/osmosis.cosmwasmpool.v1beta1.UploadCosmWasmPoolCodeAndWhiteListProposal"; title: string; description: string; /** WASMByteCode can be raw or gzip compressed */ @@ -38,6 +39,7 @@ export interface UploadCosmWasmPoolCodeAndWhiteListProposalAminoMsg { * code ids created by this message are eligible for being x/cosmwasmpool pools. */ export interface UploadCosmWasmPoolCodeAndWhiteListProposalSDKType { + $typeUrl?: "/osmosis.cosmwasmpool.v1beta1.UploadCosmWasmPoolCodeAndWhiteListProposal"; title: string; description: string; wasm_byte_code: Uint8Array; @@ -71,6 +73,7 @@ export interface UploadCosmWasmPoolCodeAndWhiteListProposalSDKType { * be configured by a module parameter so it can be changed by a constant. */ export interface MigratePoolContractsProposal { + $typeUrl?: "/osmosis.cosmwasmpool.v1beta1.MigratePoolContractsProposal"; title: string; description: string; /** @@ -183,6 +186,7 @@ export interface MigratePoolContractsProposalAminoMsg { * be configured by a module parameter so it can be changed by a constant. */ export interface MigratePoolContractsProposalSDKType { + $typeUrl?: "/osmosis.cosmwasmpool.v1beta1.MigratePoolContractsProposal"; title: string; description: string; pool_ids: bigint[]; @@ -192,6 +196,7 @@ export interface MigratePoolContractsProposalSDKType { } function createBaseUploadCosmWasmPoolCodeAndWhiteListProposal(): UploadCosmWasmPoolCodeAndWhiteListProposal { return { + $typeUrl: "/osmosis.cosmwasmpool.v1beta1.UploadCosmWasmPoolCodeAndWhiteListProposal", title: "", description: "", wasmByteCode: new Uint8Array() @@ -285,6 +290,7 @@ export const UploadCosmWasmPoolCodeAndWhiteListProposal = { }; function createBaseMigratePoolContractsProposal(): MigratePoolContractsProposal { return { + $typeUrl: "/osmosis.cosmwasmpool.v1beta1.MigratePoolContractsProposal", title: "", description: "", poolIds: [], diff --git a/packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/gov.proto b/packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/gov.proto index 6fbeb3adf..9cb824e59 100644 --- a/packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/gov.proto +++ b/packages/types/protobuf/proto/osmosis/cosmwasmpool/v1beta1/gov.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package osmosis.cosmwasmpool.v1beta1; import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; option go_package = "github.com/osmosis-labs/osmosis/v19/x/cosmwasmpool/types"; @@ -12,6 +13,7 @@ message UploadCosmWasmPoolCodeAndWhiteListProposal { option (gogoproto.equal) = true; option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; string title = 1; string description = 2; @@ -50,6 +52,7 @@ message MigratePoolContractsProposal { option (gogoproto.equal) = true; option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; string title = 1; string description = 2; From f829dcc93f6e354397eaf7c53cb6820b40d92937 Mon Sep 17 00:00:00 2001 From: noah Date: Thu, 18 Apr 2024 22:00:41 +0200 Subject: [PATCH 123/438] Chain governance proposal performance improvements (#1768) --- apps/dapp/.env.mainnet | 2 +- apps/dapp/.env.testnet | 2 +- packages/i18n/locales/bad/translation.json | 2 +- packages/i18n/locales/dog/translation.json | 2 +- packages/i18n/locales/en/translation.json | 5 +- packages/state/indexer/search.ts | 77 ++++- packages/state/recoil/selectors/chain.ts | 285 +++++++++--------- packages/state/recoil/selectors/indexer.ts | 14 + .../GovernanceDeposit/index.tsx | 6 - .../chain_governance/GovernanceVote/index.tsx | 6 - .../gov/GovProposalActionDisplay.tsx | 53 +++- .../components/gov/GovProposalList.tsx | 92 ++++-- .../components/MultipleChoiceOptionViewer.tsx | 4 +- .../PreProposeApprovalInnerContentDisplay.tsx | 4 +- .../ProposalInnerContentDisplay.tsx | 30 +- .../components/proposal/ProposalList.tsx | 36 ++- packages/storybook/.env | 2 +- 17 files changed, 392 insertions(+), 230 deletions(-) diff --git a/apps/dapp/.env.mainnet b/apps/dapp/.env.mainnet index 9f938f043..5a3d65eaa 100644 --- a/apps/dapp/.env.mainnet +++ b/apps/dapp/.env.mainnet @@ -20,7 +20,7 @@ NEXT_PUBLIC_INDEXER_URL=https://indexer.daodao.zone # Search NEXT_PUBLIC_SEARCH_HOST=https://search.daodao.zone -NEXT_PUBLIC_SEARCH_API_KEY=613511c001942ea974f72dde06647428d1ae3f42cb13fcf71e88e4317d73f2cf +NEXT_PUBLIC_SEARCH_API_KEY=1d599098d24298ffd8b295508eaedccb149163f847b862069cc6de31495dc71b # https://nft.storage/docs/#get-an-api-token NFT_STORAGE_API_KEY= diff --git a/apps/dapp/.env.testnet b/apps/dapp/.env.testnet index 1c6f442d6..f541183d4 100644 --- a/apps/dapp/.env.testnet +++ b/apps/dapp/.env.testnet @@ -19,7 +19,7 @@ NEXT_PUBLIC_INDEXER_URL=https://indexer.daodao.zone # Search NEXT_PUBLIC_SEARCH_HOST=https://search.daodao.zone -NEXT_PUBLIC_SEARCH_API_KEY=613511c001942ea974f72dde06647428d1ae3f42cb13fcf71e88e4317d73f2cf +NEXT_PUBLIC_SEARCH_API_KEY=1d599098d24298ffd8b295508eaedccb149163f847b862069cc6de31495dc71b # https://nft.storage/docs/#get-an-api-token NFT_STORAGE_API_KEY= diff --git a/packages/i18n/locales/bad/translation.json b/packages/i18n/locales/bad/translation.json index 0c4107bff..eb1e96247 100644 --- a/packages/i18n/locales/bad/translation.json +++ b/packages/i18n/locales/bad/translation.json @@ -1044,8 +1044,8 @@ "noPostsFound": "bad bad bad", "noPriceData": "bad bad bad", "noProposalActions": "bad bad bad bad bad bad bad", + "noProposalsToVoteOnYet": "bad bad bad bad bad bad", "noProposalsTooltip": "bad bad bad bad bad bad bad bad bad bad bad bad", - "noProposalsYet": "bad bad bad bad bad bad", "noPushNotificationSubscriptions": "bad bad bad bad bad bad bad bad", "noSubDaosYet": "bad bad bad", "noSubmission": "bad bad", diff --git a/packages/i18n/locales/dog/translation.json b/packages/i18n/locales/dog/translation.json index ad8c0cfae..014ceb05e 100644 --- a/packages/i18n/locales/dog/translation.json +++ b/packages/i18n/locales/dog/translation.json @@ -330,7 +330,7 @@ "noDaosFollowedYet": "u hav not yet fawloed ennie da0z", "noDisplayName": "no display naem", "noNftsBeingDisplayed": "no nftz ar bein dizplaid", - "noProposalsYet": "no puppozalz 2 voat on yit", + "noProposalsToVoteOnYet": "no puppozalz 2 voat on yit", "noSubDaosYet": "no subda0z yit", "noVote": "no", "none": "none", diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 61e0827f8..2c868b801 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -1103,8 +1103,9 @@ "noPostsFound": "No posts found.", "noPriceData": "No price data.", "noProposalActions": "This proposal does not perform any actions.", + "noProposalsFound": "No proposals found.", + "noProposalsToVoteOnYet": "No proposals to vote on yet.", "noProposalsTooltip": "This DAO has no proposals and may be inactive or a duplicate.", - "noProposalsYet": "No proposals to vote on yet.", "noPushNotificationSubscriptions": "You do not have any push notification subscriptions.", "noQuorum": "No quorum", "noSubDaosYet": "No SubDAOs yet.", @@ -1240,6 +1241,7 @@ "searchMessages": "Search messages", "searchNftsPlaceholder": "Find an NFT...", "searchPlaceholder": "Search...", + "searchProposalsPlaceholder": "Search proposals...", "searchValidatorsPlaceholder": "Find a validator...", "selectPressChain": "Each post will be minted as an NFT on this chain and then deposited into the DAO's treasury.", "selfRelayDescription": "One or more messages in this proposal require self-relaying across chains since automatic relayers do not exist or are inactive right now.", @@ -1746,6 +1748,7 @@ "requestedRating": "Requested rating", "resetting": "Resetting...", "restake": "Restake", + "results": "Results", "retroactive": "Retroactive", "retroactiveCompensation": "Retroactive compensation", "reviewTransaction": "Review Transaction", diff --git a/packages/state/indexer/search.ts b/packages/state/indexer/search.ts index 4bdd0e44e..b5b00e33f 100644 --- a/packages/state/indexer/search.ts +++ b/packages/state/indexer/search.ts @@ -1,7 +1,9 @@ import MeiliSearch from 'meilisearch' import { IndexerDumpState, WithChainId } from '@dao-dao/types' +import { ProposalStatus } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1/gov' import { + CommonError, INACTIVE_DAO_NAMES, SEARCH_API_KEY, SEARCH_HOST, @@ -46,9 +48,10 @@ export const searchDaos = async ({ const client = await loadMeilisearchClient() const config = getSupportedChainConfig(chainId) - if (!config) { - return [] + if (!config || config.noIndexer) { + throw new Error(CommonError.NoIndexerForChain) } + const index = client.index(chainId + '_daos') const results = await index.search>(query, { @@ -74,3 +77,73 @@ export const searchDaos = async ({ ...hit, })) } + +export type GovProposalSearchResult = { + chainId: string + id: string + block: { + height: string + timeUnixMs: string + } + value: { + id: string + data: string + title: string + description: string + status: ProposalStatus + submitTime?: number + depositEndTime?: number + votingStartTime?: number + votingEndTime?: number + } +} + +export type SearchGovProposalsOptions = WithChainId<{ + query?: string + status?: ProposalStatus + offset?: number + limit?: number +}> + +export const searchGovProposals = async ({ + chainId, + query, + status, + offset, + limit, +}: SearchGovProposalsOptions): Promise<{ + results: GovProposalSearchResult[] + total: number +}> => { + const client = await loadMeilisearchClient() + + const config = getSupportedChainConfig(chainId) + if (!config || config.noIndexer) { + throw new Error(CommonError.NoIndexerForChain) + } + + const index = client.index(chainId + '_gov-proposals') + + const results = await index.search>( + query, + { + filter: [...(status ? [`value.status = ${status}`] : [])] + .map((filter) => `(${filter})`) + .join(' AND '), + offset, + limit, + // Most recent at the top if no query passed. + sort: query ? undefined : ['value.id:desc'], + } + ) + + const total = (await index.getStats()).numberOfDocuments + + return { + results: results.hits.map((hit) => ({ + chainId, + ...hit, + })), + total, + } +} diff --git a/packages/state/recoil/selectors/chain.ts b/packages/state/recoil/selectors/chain.ts index 582e4c638..1d5bb9eeb 100644 --- a/packages/state/recoil/selectors/chain.ts +++ b/packages/state/recoil/selectors/chain.ts @@ -70,6 +70,7 @@ import { stargateClientRouter, } from '@dao-dao/utils' +import { SearchGovProposalsOptions } from '../../indexer' import { refreshBlockHeightAtom, refreshGovProposalsAtom, @@ -80,6 +81,7 @@ import { import { queryGenericIndexerSelector, queryValidatorIndexerSelector, + searchGovProposalsSelector, } from './indexer' import { genericTokenSelector } from './token' import { walletTokenDaoStakedDenomsSelector } from './wallet' @@ -700,6 +702,59 @@ export const nativeUnstakingDurationSecondsSelector = selectorFamily< }, }) +/** + * Search gov proposals in the indexer and decode their content. + */ +export const searchedDecodedGovProposalsSelector = selectorFamily< + { + proposals: GovProposalWithDecodedContent[] + total: number + }, + SearchGovProposalsOptions +>({ + key: 'searchedDecodedGovProposals', + get: + (options) => + async ({ get }) => { + get(refreshGovProposalsAtom(options.chainId)) + + const supportsV1Gov = get( + chainSupportsV1GovModuleSelector({ chainId: options.chainId }) + ) + + const { results, total } = get(searchGovProposalsSelector(options)) + + const proposals = ( + await Promise.allSettled( + results.map(async ({ value: { id, data } }) => + decodeGovProposal( + supportsV1Gov + ? { + version: GovProposalVersion.V1, + id: BigInt(id), + proposal: ProposalV1.decode(fromBase64(data)), + } + : { + version: GovProposalVersion.V1_BETA_1, + id: BigInt(id), + proposal: ProposalV1Beta1.decode( + fromBase64(data), + undefined, + true + ), + } + ) + ) + ) + ).flatMap((p) => (p.status === 'fulfilled' ? p.value : [])) + + return { + proposals, + total, + } + }, +}) + // Queries the chain for governance proposals, defaulting to those that are // currently open for voting. export const govProposalsSelector = selectorFamily< @@ -715,174 +770,114 @@ export const govProposalsSelector = selectorFamily< >({ key: 'govProposals', get: - ({ - status = ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED, - offset, - limit, - chainId, - }) => + ({ status, offset, limit, chainId }) => async ({ get }) => { get(refreshGovProposalsAtom(chainId)) - const supportsV1Gov = get(chainSupportsV1GovModuleSelector({ chainId })) - - let v1Proposals: ProposalV1[] | undefined - let v1Beta1Proposals: ProposalV1Beta1[] | undefined - let total = 0 - // Try to load from indexer first. - const indexerProposals: - | { - proposals: { - id: string - data: string - }[] - total: number - } - | undefined = get( - queryGenericIndexerSelector({ - chainId, - formula: 'gov/reverseProposals', - args: { - limit, + const indexerProposals = get( + waitForAllSettled([ + searchedDecodedGovProposalsSelector({ + chainId, + status, offset, - }, - }) - ) + limit, + }), + ]) + )[0].valueMaybe() if (indexerProposals?.proposals.length) { - if (supportsV1Gov) { - v1Proposals = indexerProposals.proposals.flatMap( - ({ data }): ProposalV1 | [] => { - try { - const proposal = ProposalV1.decode(fromBase64(data)) - - if ( - status === ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED || - proposal.status === status - ) { - return proposal - } - } catch {} - - return [] - } - ) - - if (status === ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED) { - total = indexerProposals.total - } else { - total = v1Proposals.length - } - } else { - v1Beta1Proposals = indexerProposals.proposals.flatMap( - ({ data }): ProposalV1Beta1 | [] => { - try { - const proposal = ProposalV1Beta1.decode( - fromBase64(data), - undefined, - true - ) - - if ( - status === ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED || - proposal.status === status - ) { - return proposal - } - } catch {} - - return [] - } - ) + return indexerProposals + } - if (status === ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED) { - total = indexerProposals.total - } else { - total = v1Beta1Proposals.length - } - } + // Fallback to querying chain if indexer failed. + const supportsV1Gov = get(chainSupportsV1GovModuleSelector({ chainId })) - // Fallback to querying chain if indexer failed. - } else { - const client = get(cosmosRpcClientForChainSelector(chainId)) - if (supportsV1Gov) { - try { - if (limit === undefined && offset === undefined) { - v1Proposals = await getAllRpcResponse( - client.gov.v1.proposals, - { - proposalStatus: status, - voter: '', - depositor: '', - pagination: undefined, - }, - 'proposals', - true - ) - total = v1Proposals.length - } else { - const response = await client.gov.v1.proposals({ - proposalStatus: status, - voter: '', - depositor: '', - pagination: { - key: new Uint8Array(), - offset: BigInt(offset || 0), - limit: BigInt(limit || 0), - countTotal: true, - reverse: true, - }, - }) - v1Proposals = response.proposals - total = Number(response.pagination?.total || 0) - } - } catch (err) { - // Fallback to v1beta1 query if v1 not supported. - if ( - !(err instanceof Error) || - !err.message.includes('unknown query path') - ) { - // Rethrow other errors. - throw err - } - } - } + let v1Proposals: ProposalV1[] | undefined + let v1Beta1Proposals: ProposalV1Beta1[] | undefined + let total = 0 - if (!v1Proposals) { + const client = get(cosmosRpcClientForChainSelector(chainId)) + if (supportsV1Gov) { + try { if (limit === undefined && offset === undefined) { - v1Beta1Proposals = await getAllRpcResponse( - client.gov.v1beta1.proposals, + v1Proposals = await getAllRpcResponse( + client.gov.v1.proposals, { - proposalStatus: status, + proposalStatus: + status || ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED, voter: '', depositor: '', pagination: undefined, }, 'proposals', - true, true ) - total = v1Beta1Proposals.length + total = v1Proposals.length } else { - const response = await client.gov.v1beta1.proposals( - { - proposalStatus: status, - voter: '', - depositor: '', - pagination: { - key: new Uint8Array(), - offset: BigInt(offset || 0), - limit: BigInt(limit || 0), - countTotal: true, - reverse: true, - }, + const response = await client.gov.v1.proposals({ + proposalStatus: + status || ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED, + voter: '', + depositor: '', + pagination: { + key: new Uint8Array(), + offset: BigInt(offset || 0), + limit: BigInt(limit || 0), + countTotal: true, + reverse: true, }, - true - ) - v1Beta1Proposals = response.proposals + }) + v1Proposals = response.proposals total = Number(response.pagination?.total || 0) } + } catch (err) { + // Fallback to v1beta1 query if v1 not supported. + if ( + !(err instanceof Error) || + !err.message.includes('unknown query path') + ) { + // Rethrow other errors. + throw err + } + } + } + + if (!v1Proposals) { + if (limit === undefined && offset === undefined) { + v1Beta1Proposals = await getAllRpcResponse( + client.gov.v1beta1.proposals, + { + proposalStatus: + status || ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED, + voter: '', + depositor: '', + pagination: undefined, + }, + 'proposals', + true, + true + ) + total = v1Beta1Proposals.length + } else { + const response = await client.gov.v1beta1.proposals( + { + proposalStatus: + status || ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED, + voter: '', + depositor: '', + pagination: { + key: new Uint8Array(), + offset: BigInt(offset || 0), + limit: BigInt(limit || 0), + countTotal: true, + reverse: true, + }, + }, + true + ) + v1Beta1Proposals = response.proposals + total = Number(response.pagination?.total || 0) } } diff --git a/packages/state/recoil/selectors/indexer.ts b/packages/state/recoil/selectors/indexer.ts index 2a8f90f5c..e374d7ba4 100644 --- a/packages/state/recoil/selectors/indexer.ts +++ b/packages/state/recoil/selectors/indexer.ts @@ -17,14 +17,17 @@ import { import { DaoSearchResult, + GovProposalSearchResult, QueryIndexerOptions, QuerySnapperOptions, SearchDaosOptions, + SearchGovProposalsOptions, loadMeilisearchClient, queryIndexer, queryIndexerUpStatus, querySnapper, searchDaos, + searchGovProposals, } from '../../indexer' import { refreshIndexerUpStatusAtom, @@ -211,6 +214,17 @@ export const searchDaosSelector = selectorFamily< get: (options) => async () => await searchDaos(options), }) +export const searchGovProposalsSelector = selectorFamily< + { + results: GovProposalSearchResult[] + total: number + }, + SearchGovProposalsOptions +>({ + key: 'searchGovProposals', + get: (options) => async () => await searchGovProposals(options), +}) + export const openProposalsSelector = selectorFamily< { proposalModuleAddress: string diff --git a/packages/stateful/actions/core/chain_governance/GovernanceDeposit/index.tsx b/packages/stateful/actions/core/chain_governance/GovernanceDeposit/index.tsx index ee447102b..72e343a32 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceDeposit/index.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceDeposit/index.tsx @@ -92,12 +92,6 @@ const InnerComponent: ActionComponent = ( ? govProposalsSelector({ status: ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD, chainId, - // No need to load more than 50 proposals when trying to find - // proposals currently being voted on. The alternative is to load all - // proposals, which is not ideal. Ideally, this is pre-indexed and we - // can query only the proposals in the voting period instead of having - // to filter locally. - limit: 50, }) : constSelector(undefined) ) diff --git a/packages/stateful/actions/core/chain_governance/GovernanceVote/index.tsx b/packages/stateful/actions/core/chain_governance/GovernanceVote/index.tsx index 6367c9356..9f60ec18d 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceVote/index.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceVote/index.tsx @@ -68,12 +68,6 @@ const Component: ActionComponent = (props) => { ? govProposalsSelector({ status: ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD, chainId, - // No need to load more than 50 proposals when trying to find - // proposals currently being voted on. The alternative is to load all - // proposals, which is not ideal. Ideally, this is pre-indexed and we - // can query only the proposals in the voting period instead of having - // to filter locally. - limit: 50, }) : constSelector(undefined) ) diff --git a/packages/stateful/components/gov/GovProposalActionDisplay.tsx b/packages/stateful/components/gov/GovProposalActionDisplay.tsx index 6c20300c4..9a46efb62 100644 --- a/packages/stateful/components/gov/GovProposalActionDisplay.tsx +++ b/packages/stateful/components/gov/GovProposalActionDisplay.tsx @@ -1,9 +1,11 @@ -import { useMemo } from 'react' +import { DataObject } from '@mui/icons-material' +import { useMemo, useState } from 'react' import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' import { ActionsRenderer, + Button, CosmosMessageDisplay, Loader, } from '@dao-dao/stateless' @@ -53,13 +55,25 @@ const InnerGovProposalActionDisplay = ({ const actionsForMatching = useActionsForMatching() - const decodedMessages = useMemo( - () => - content.version === GovProposalVersion.V1_BETA_1 - ? [] - : decodeMessages(content.decodedMessages), - [content] - ) + const [showRaw, setShowRaw] = useState(false) + + const { decodedMessages, rawDecodedMessages } = useMemo(() => { + const decodedMessages = + content.version === GovProposalVersion.V1 + ? decodeMessages(content.decodedMessages) + : [] + + const rawDecodedMessages = JSON.stringify( + decodedMessages.map(decodeRawDataForDisplay), + null, + 2 + ) + + return { + decodedMessages, + rawDecodedMessages, + } + }, [content]) // Call relevant action hooks in the same order every time. const actionData = decodedMessages @@ -139,12 +153,23 @@ const InnerGovProposalActionDisplay = ({ {content.version === GovProposalVersion.V1 && content.decodedMessages?.length ? ( - toast.success(t('info.copiedLinkToClipboard'))} - /> +
+ toast.success(t('info.copiedLinkToClipboard'))} + /> + + + + {showRaw && } +
) : null} ) diff --git a/packages/stateful/components/gov/GovProposalList.tsx b/packages/stateful/components/gov/GovProposalList.tsx index 8ac284c86..ad1d3aa99 100644 --- a/packages/stateful/components/gov/GovProposalList.tsx +++ b/packages/stateful/components/gov/GovProposalList.tsx @@ -2,10 +2,14 @@ import { useRouter } from 'next/router' import { useCallback, useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' -import { govProposalsSelector } from '@dao-dao/state/recoil' +import { + govProposalsSelector, + searchedDecodedGovProposalsSelector, +} from '@dao-dao/state/recoil' import { ProposalList as StatelessProposalList, useCachedLoading, + useCachedLoadingWithError, useChain, } from '@dao-dao/stateless' import { ProposalStatus } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' @@ -24,11 +28,6 @@ export const GovProposalList = () => { govProposalsSelector({ chainId: chain.chain_id, status: ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD, - // No need to load more than 50 proposals when trying to find proposals - // currently being voted on. The alternative is to load all proposals, - // which is not ideal. Ideally, this is pre-indexed and we can query only - // the proposals in the voting period instead of having to filter locally. - limit: 50, }), { proposals: [], @@ -40,11 +39,6 @@ export const GovProposalList = () => { govProposalsSelector({ chainId: chain.chain_id, status: ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD, - // No need to load more than 50 proposals when trying to find proposals in - // the deposit period. The alternative is to load all proposals, which is - // not ideal. Ideally, this is pre-indexed and we can query only the - // proposals in the voting period instead of having to filter locally. - limit: 50, }), { proposals: [], @@ -164,38 +158,74 @@ export const GovProposalList = () => { govProposalsDepositPeriod.loading ? 0 : loadingAllGovProposals.data.total - - openGovProposalsVotingPeriod.data.total - - govProposalsDepositPeriod.data.total + openGovProposalsVotingPeriod.data.proposals.length - + govProposalsDepositPeriod.data.proposals.length + + const [search, setSearch] = useState('') + const showingSearchResults = !!search && search.length > 0 + const searchedGovProposals = useCachedLoadingWithError( + showingSearchResults + ? searchedDecodedGovProposalsSelector({ + chainId: chain.chain_id, + query: search, + limit: 20, + }) + : undefined + ) return ( setSearch(e.target.value), + }} + sections={ + showingSearchResults + ? [ + { + title: t('title.results'), + proposals: + searchedGovProposals.loading || searchedGovProposals.errored + ? [] + : searchedGovProposals.data.proposals.map( + (proposal): GovProposalLineProps => ({ + proposalId: proposal.id.toString(), + proposal, + }) + ), + }, + ] + : [ + { + title: t('title.depositPeriod'), + proposals: depositPeriodProposals, + defaultCollapsed: true, + }, + { + title: t('title.history'), + proposals: historyProposals, + total: historyCount, + }, + ] } - openProposals={openProposals} - sections={[ - { - title: t('title.depositPeriod'), - proposals: depositPeriodProposals, - defaultCollapsed: true, - }, - { - title: t('title.history'), - proposals: historyProposals, - total: historyCount, - }, - ]} + showingSearchResults={showingSearchResults} /> ) } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/MultipleChoiceOptionViewer.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/MultipleChoiceOptionViewer.tsx index 174bbfa50..f20e78719 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/MultipleChoiceOptionViewer.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/MultipleChoiceOptionViewer.tsx @@ -1,4 +1,4 @@ -import { AnalyticsOutlined, Check } from '@mui/icons-material' +import { Check, DataObject } from '@mui/icons-material' import clsx from 'clsx' import { ComponentType, useMemo, useState } from 'react' import toast from 'react-hot-toast' @@ -139,7 +139,7 @@ export const MultipleChoiceOptionViewer = ({ onClick={() => setShowRaw(!showRaw)} variant="ghost" > - +

{showRaw ? t('button.hideRawData') : t('button.showRawData')}

diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/PreProposeApprovalInnerContentDisplay.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/PreProposeApprovalInnerContentDisplay.tsx index 9e05375da..ddd5f8552 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/PreProposeApprovalInnerContentDisplay.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/PreProposeApprovalInnerContentDisplay.tsx @@ -1,4 +1,4 @@ -import { AnalyticsOutlined } from '@mui/icons-material' +import { DataObject } from '@mui/icons-material' import { useEffect, useMemo, useState } from 'react' import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' @@ -102,7 +102,7 @@ const InnerPreProposeApprovalInnerContentDisplay = ({ />
+ {searchBarProps && ( + + )} + {proposalsExist ? ( <> {openProposals.length > 0 && ( @@ -193,9 +213,19 @@ export const ProposalList = ({ )}
diff --git a/packages/storybook/.env b/packages/storybook/.env index 137733a40..c5b03bb9a 100644 --- a/packages/storybook/.env +++ b/packages/storybook/.env @@ -12,7 +12,7 @@ NEXT_PUBLIC_PFPK_API_BASE=https://pfpk.daodao.zone # Search NEXT_PUBLIC_SEARCH_HOST=https://search.daodao.zone -NEXT_PUBLIC_SEARCH_API_KEY=613511c001942ea974f72dde06647428d1ae3f42cb13fcf71e88e4317d73f2cf +NEXT_PUBLIC_SEARCH_API_KEY=1d599098d24298ffd8b295508eaedccb149163f847b862069cc6de31495dc71b # https://nft.storage/docs/#get-an-api-token NFT_STORAGE_API_KEY= From e8e14236f54a22218d2adc939f169cbc9232e205 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 18 Apr 2024 13:48:46 -0700 Subject: [PATCH 124/438] hide search bar on gov props page if no indexer on chain --- packages/state/indexer/query.ts | 10 +++------- packages/state/indexer/search.ts | 8 +++----- .../stateful/components/gov/GovProposalList.tsx | 17 ++++++++++++----- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/packages/state/indexer/query.ts b/packages/state/indexer/query.ts index a3d83826c..a19b2dc09 100644 --- a/packages/state/indexer/query.ts +++ b/packages/state/indexer/query.ts @@ -7,7 +7,7 @@ import { BatchClient, CommonError, INDEXER_URL, - getSupportedChainConfig, + chainIsIndexed, } from '@dao-dao/utils' export type QueryIndexerOptions = WithChainId< @@ -47,9 +47,7 @@ export const queryIndexer = async ({ times, chainId, }: QueryIndexerOptions): Promise => { - // Only supported chains have an indexer. - const chainConfig = getSupportedChainConfig(chainId) - if (!chainConfig || chainConfig.noIndexer) { + if (!chainIsIndexed(chainId)) { throw new Error(CommonError.NoIndexerForChain) } @@ -101,9 +99,7 @@ export const queryIndexer = async ({ export const queryIndexerUpStatus = async ({ chainId, }: WithChainId<{}>): Promise => { - // Only supported chains have an indexer. - const chainConfig = getSupportedChainConfig(chainId) - if (!chainConfig || chainConfig.noIndexer) { + if (!chainIsIndexed(chainId)) { throw new Error(CommonError.NoIndexerForChain) } diff --git a/packages/state/indexer/search.ts b/packages/state/indexer/search.ts index b5b00e33f..e4a86dafb 100644 --- a/packages/state/indexer/search.ts +++ b/packages/state/indexer/search.ts @@ -7,7 +7,7 @@ import { INACTIVE_DAO_NAMES, SEARCH_API_KEY, SEARCH_HOST, - getSupportedChainConfig, + chainIsIndexed, } from '@dao-dao/utils' let _client: MeiliSearch | undefined @@ -47,8 +47,7 @@ export const searchDaos = async ({ }: SearchDaosOptions): Promise => { const client = await loadMeilisearchClient() - const config = getSupportedChainConfig(chainId) - if (!config || config.noIndexer) { + if (!chainIsIndexed(chainId)) { throw new Error(CommonError.NoIndexerForChain) } @@ -117,8 +116,7 @@ export const searchGovProposals = async ({ }> => { const client = await loadMeilisearchClient() - const config = getSupportedChainConfig(chainId) - if (!config || config.noIndexer) { + if (!chainIsIndexed(chainId)) { throw new Error(CommonError.NoIndexerForChain) } diff --git a/packages/stateful/components/gov/GovProposalList.tsx b/packages/stateful/components/gov/GovProposalList.tsx index ad1d3aa99..3d62c3117 100644 --- a/packages/stateful/components/gov/GovProposalList.tsx +++ b/packages/stateful/components/gov/GovProposalList.tsx @@ -13,6 +13,7 @@ import { useChain, } from '@dao-dao/stateless' import { ProposalStatus } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' +import { chainIsIndexed } from '@dao-dao/utils' import { LinkWrapper } from '../LinkWrapper' import { GovProposalLine, GovProposalLineProps } from './GovProposalLine' @@ -23,6 +24,7 @@ export const GovProposalList = () => { const { t } = useTranslation() const chain = useChain() const { asPath } = useRouter() + const hasIndexer = chainIsIndexed(chain.chain_id) const openGovProposalsVotingPeriod = useCachedLoading( govProposalsSelector({ @@ -162,7 +164,7 @@ export const GovProposalList = () => { govProposalsDepositPeriod.data.proposals.length const [search, setSearch] = useState('') - const showingSearchResults = !!search && search.length > 0 + const showingSearchResults = hasIndexer && !!search && search.length > 0 const searchedGovProposals = useCachedLoadingWithError( showingSearchResults ? searchedDecodedGovProposalsSelector({ @@ -192,10 +194,15 @@ export const GovProposalList = () => { !!loadingAllGovProposals.updating } openProposals={showingSearchResults ? [] : openProposals} - searchBarProps={{ - value: search, - onChange: (e) => setSearch(e.target.value), - }} + searchBarProps={ + // Cannot search without an indexer on the chain. + hasIndexer + ? { + value: search, + onChange: (e) => setSearch(e.target.value), + } + : undefined + } sections={ showingSearchResults ? [ From c605dc3430d17538551645b67f89a3e55767d91e Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 19 Apr 2024 10:28:01 -0700 Subject: [PATCH 125/438] upgraded cosmjs to fix support for SDK v0.50+ --- packages/state/package.json | 10 +-- packages/stateful/package.json | 10 +-- packages/stateless/package.json | 2 +- packages/utils/package.json | 12 +-- yarn.lock | 131 +++++++++++++++++++++++++++++++- 5 files changed, 147 insertions(+), 18 deletions(-) diff --git a/packages/state/package.json b/packages/state/package.json index c1fa79255..b064c5b9c 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -11,11 +11,11 @@ "dependencies": { "@apollo/client": "^3.8.7", "@confio/relayer": "^0.12.0", - "@cosmjs/amino": "^0.32.1", - "@cosmjs/cosmwasm-stargate": "^0.32.1", - "@cosmjs/encoding": "^0.32.1", - "@cosmjs/proto-signing": "^0.32.1", - "@cosmjs/stargate": "^0.32.1", + "@cosmjs/amino": "^0.32.3", + "@cosmjs/cosmwasm-stargate": "^0.32.3", + "@cosmjs/encoding": "^0.32.3", + "@cosmjs/proto-signing": "^0.32.3", + "@cosmjs/stargate": "^0.32.3", "@dao-dao/utils": "2.4.0-rc.8", "graphql": "^16.8.1", "json5": "^2.2.0", diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 061371abc..7e45814b7 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -10,10 +10,10 @@ }, "dependencies": { "@confio/relayer": "^0.12.0", - "@cosmjs/cosmwasm-stargate": "^0.32.1", - "@cosmjs/encoding": "^0.32.1", - "@cosmjs/proto-signing": "^0.32.1", - "@cosmjs/stargate": "^0.32.1", + "@cosmjs/cosmwasm-stargate": "^0.32.3", + "@cosmjs/encoding": "^0.32.3", + "@cosmjs/proto-signing": "^0.32.3", + "@cosmjs/stargate": "^0.32.3", "@cosmos-kit/coin98": "^2.6.10", "@cosmos-kit/compass": "^2.6.9", "@cosmos-kit/core": "^2.8.9", @@ -74,7 +74,7 @@ }, "devDependencies": { "@chain-registry/types": "^0.17.1", - "@cosmjs/amino": "^0.32.1", + "@cosmjs/amino": "^0.32.3", "@dao-dao/config": "2.4.0-rc.8", "@dao-dao/types": "2.4.0-rc.8", "@storybook/react": "^6.5.10", diff --git a/packages/stateless/package.json b/packages/stateless/package.json index cdfe7f32c..8b8df9021 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -8,7 +8,7 @@ "lint": "eslint ." }, "dependencies": { - "@cosmjs/encoding": "^0.32.1", + "@cosmjs/encoding": "^0.32.3", "@dao-dao/types": "2.4.0-rc.8", "@dao-dao/utils": "2.4.0-rc.8", "@emotion/react": "^11.10.4", diff --git a/packages/utils/package.json b/packages/utils/package.json index 533ac8b07..b0eedad4e 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -8,11 +8,11 @@ "test": "jest" }, "dependencies": { - "@cosmjs/amino": "^0.32.1", - "@cosmjs/cosmwasm-stargate": "^0.32.1", - "@cosmjs/encoding": "^0.32.1", - "@cosmjs/stargate": "^0.32.1", - "@cosmjs/tendermint-rpc": "^0.32.1", + "@cosmjs/amino": "^0.32.3", + "@cosmjs/cosmwasm-stargate": "^0.32.3", + "@cosmjs/encoding": "^0.32.3", + "@cosmjs/stargate": "^0.32.3", + "@cosmjs/tendermint-rpc": "^0.32.3", "@dao-dao/types": "2.4.0-rc.8", "@sentry/nextjs": "^7.7.0", "@types/lodash.clonedeep": "^4.5.0", @@ -35,7 +35,7 @@ }, "devDependencies": { "@chain-registry/types": "^0.17.1", - "@cosmjs/proto-signing": "^0.32.1", + "@cosmjs/proto-signing": "^0.32.3", "@dao-dao/config": "2.4.0-rc.8", "cosmjs-types": "^0.9.0", "jest": "^29.1.1", diff --git a/yarn.lock b/yarn.lock index c2426f8fe..1c32ab4a5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2167,7 +2167,7 @@ "@cosmjs/math" "^0.31.3" "@cosmjs/utils" "^0.31.3" -"@cosmjs/amino@^0.32.1", "@cosmjs/amino@^0.32.2": +"@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== @@ -2177,6 +2177,16 @@ "@cosmjs/math" "^0.32.2" "@cosmjs/utils" "^0.32.2" +"@cosmjs/amino@^0.32.3": + version "0.32.3" + resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.32.3.tgz#b81d4a2b8d61568431a1afcd871e1344a19d97ff" + integrity sha512-G4zXl+dJbqrz1sSJ56H/25l5NJEk/pAPIr8piAHgbXYw88OdAOlpA26PQvk2IbSN/rRgVbvlLTNgX2tzz1dyUA== + dependencies: + "@cosmjs/crypto" "^0.32.3" + "@cosmjs/encoding" "^0.32.3" + "@cosmjs/math" "^0.32.3" + "@cosmjs/utils" "^0.32.3" + "@cosmjs/cosmwasm-stargate@^0.32.1", "@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" @@ -2193,6 +2203,22 @@ cosmjs-types "^0.9.0" pako "^2.0.2" +"@cosmjs/cosmwasm-stargate@^0.32.3": + version "0.32.3" + resolved "https://registry.yarnpkg.com/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.32.3.tgz#26a110a6bb0c15fdeef647e3433bd9553a1acd5f" + integrity sha512-pqkt+QsLIPNMTRh9m+igJgIpzXXgn1BxmxfAb9zlC23kvsuzY/12un9M7iAdim1NwKXDFeYw46xC2YkprwQp+g== + dependencies: + "@cosmjs/amino" "^0.32.3" + "@cosmjs/crypto" "^0.32.3" + "@cosmjs/encoding" "^0.32.3" + "@cosmjs/math" "^0.32.3" + "@cosmjs/proto-signing" "^0.32.3" + "@cosmjs/stargate" "^0.32.3" + "@cosmjs/tendermint-rpc" "^0.32.3" + "@cosmjs/utils" "^0.32.3" + cosmjs-types "^0.9.0" + pako "^2.0.2" + "@cosmjs/crypto@^0.31.3": version "0.31.3" resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.31.3.tgz#c752cb6d682fdc735dcb45a2519f89c56ba16c26" @@ -2219,6 +2245,19 @@ elliptic "^6.5.4" libsodium-wrappers-sumo "^0.7.11" +"@cosmjs/crypto@^0.32.3": + version "0.32.3" + resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.32.3.tgz#787f8e659709678722068ee1ddf379f65051a25e" + integrity sha512-niQOWJHUtlJm2GG4F00yGT7sGPKxfUwz+2qQ30uO/E3p58gOusTcH2qjiJNVxb8vScYJhFYFqpm/OA/mVqoUGQ== + dependencies: + "@cosmjs/encoding" "^0.32.3" + "@cosmjs/math" "^0.32.3" + "@cosmjs/utils" "^0.32.3" + "@noble/hashes" "^1" + bn.js "^5.2.0" + elliptic "^6.5.4" + libsodium-wrappers-sumo "^0.7.11" + "@cosmjs/encoding@^0.31.3": version "0.31.3" resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.31.3.tgz#2519d9c9ae48368424971f253775c4580b54c5aa" @@ -2237,6 +2276,15 @@ bech32 "^1.1.4" readonly-date "^1.0.0" +"@cosmjs/encoding@^0.32.3": + version "0.32.3" + resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.32.3.tgz#e245ff511fe4a0df7ba427b5187aab69e3468e5b" + integrity sha512-p4KF7hhv8jBQX3MkB3Defuhz/W0l3PwWVYU2vkVuBJ13bJcXyhU9nJjiMkaIv+XP+W2QgRceqNNgFUC5chNR7w== + dependencies: + base64-js "^1.3.0" + bech32 "^1.1.4" + readonly-date "^1.0.0" + "@cosmjs/faucet-client@^0.32.1": version "0.32.2" resolved "https://registry.yarnpkg.com/@cosmjs/faucet-client/-/faucet-client-0.32.2.tgz#c48a44102dd7332d377529cdcca661d4ad1bd2cb" @@ -2252,6 +2300,14 @@ "@cosmjs/stream" "^0.32.2" xstream "^11.14.0" +"@cosmjs/json-rpc@^0.32.3": + version "0.32.3" + resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.32.3.tgz#ccffdd7f722cecfab6daaa7463843b92f5d25355" + integrity sha512-JwFRWZa+Y95KrAG8CuEbPVOSnXO2uMSEBcaAB/FBU3Mo4jQnDoUjXvt3vwtFWxfAytrWCn1I4YDFaOAinnEG/Q== + dependencies: + "@cosmjs/stream" "^0.32.3" + xstream "^11.14.0" + "@cosmjs/math@^0.31.3": version "0.31.3" resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.31.3.tgz#767f7263d12ba1b9ed2f01f68d857597839fd957" @@ -2266,6 +2322,13 @@ dependencies: bn.js "^5.2.0" +"@cosmjs/math@^0.32.3": + version "0.32.3" + resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.32.3.tgz#16e4256f4da507b9352327da12ae64056a2ba6c9" + integrity sha512-amumUtZs8hCCnV+lSBaJIiZkGabQm22QGg/IotYrhcmoOEOjt82n7hMNlNXRs7V6WLMidGrGYcswB5zcmp0Meg== + dependencies: + bn.js "^5.2.0" + "@cosmjs/proto-signing@0.32.2", "@cosmjs/proto-signing@^0.32.1", "@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" @@ -2291,6 +2354,18 @@ cosmjs-types "^0.8.0" long "^4.0.0" +"@cosmjs/proto-signing@^0.32.3": + version "0.32.3" + resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.32.3.tgz#91ae149b747d18666a6ccc924165b306431f7c0d" + integrity sha512-kSZ0ZUY0DwcRT0NcIn2HkadH4NKlwjfZgbLj1ABwh/4l0RgeT84QCscZCu63tJYq3K6auwqTiZSZERwlO4/nbg== + dependencies: + "@cosmjs/amino" "^0.32.3" + "@cosmjs/crypto" "^0.32.3" + "@cosmjs/encoding" "^0.32.3" + "@cosmjs/math" "^0.32.3" + "@cosmjs/utils" "^0.32.3" + cosmjs-types "^0.9.0" + "@cosmjs/socket@^0.32.2": version "0.32.2" resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.32.2.tgz#a66be3863d03bf2d8df0433af476df010ff10e8c" @@ -2301,6 +2376,16 @@ ws "^7" xstream "^11.14.0" +"@cosmjs/socket@^0.32.3": + version "0.32.3" + resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.32.3.tgz#fa5c36bf58e87c0ad865d6318ecb0f8d9c89a28a" + integrity sha512-F2WwNmaUPdZ4SsH6Uyreq3wQk7jpaEkb3wfOP951f5Jt6HCW/PxbxhKzHkAAf6+Sqks6SPhkbWoE8XaZpjL2KA== + dependencies: + "@cosmjs/stream" "^0.32.3" + isomorphic-ws "^4.0.1" + ws "^7" + xstream "^11.14.0" + "@cosmjs/stargate@^0.32.1", "@cosmjs/stargate@^0.32.2": version "0.32.2" resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.32.2.tgz#73718c5c6a3ae138682ee9987333d911eca22a13" @@ -2317,6 +2402,22 @@ cosmjs-types "^0.9.0" xstream "^11.14.0" +"@cosmjs/stargate@^0.32.3": + version "0.32.3" + resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.32.3.tgz#5a92b222ada960ebecea72cc9f366370763f4b66" + integrity sha512-OQWzO9YWKerUinPIxrO1MARbe84XkeXJAW0lyMIjXIEikajuXZ+PwftiKA5yA+8OyditVmHVLtPud6Pjna2s5w== + dependencies: + "@confio/ics23" "^0.6.8" + "@cosmjs/amino" "^0.32.3" + "@cosmjs/encoding" "^0.32.3" + "@cosmjs/math" "^0.32.3" + "@cosmjs/proto-signing" "^0.32.3" + "@cosmjs/stream" "^0.32.3" + "@cosmjs/tendermint-rpc" "^0.32.3" + "@cosmjs/utils" "^0.32.3" + cosmjs-types "^0.9.0" + xstream "^11.14.0" + "@cosmjs/stream@^0.32.1", "@cosmjs/stream@^0.32.2": version "0.32.2" resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.32.2.tgz#b1e8f977d25313d659f1aa89ad21614b5391cd93" @@ -2324,6 +2425,13 @@ dependencies: xstream "^11.14.0" +"@cosmjs/stream@^0.32.3": + version "0.32.3" + resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.32.3.tgz#7522579aaf18025d322c2f33d6fb7573220395d6" + integrity sha512-J2zVWDojkynYifAUcRmVczzmp6STEpyiAARq0rSsviqjreGIfspfuws/8rmkPa6qQBZvpQOBQCm2HyZZwYplIw== + dependencies: + xstream "^11.14.0" + "@cosmjs/tendermint-rpc@^0.32.1", "@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" @@ -2340,6 +2448,22 @@ readonly-date "^1.0.0" xstream "^11.14.0" +"@cosmjs/tendermint-rpc@^0.32.3": + version "0.32.3" + resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.32.3.tgz#f0406b9f0233e588fb924dca8c614972f9038aff" + integrity sha512-xeprW+VR9xKGstqZg0H/KBZoUp8/FfFyS9ljIUTLM/UINjP2MhiwncANPS2KScfJVepGufUKk0/phHUeIBSEkw== + dependencies: + "@cosmjs/crypto" "^0.32.3" + "@cosmjs/encoding" "^0.32.3" + "@cosmjs/json-rpc" "^0.32.3" + "@cosmjs/math" "^0.32.3" + "@cosmjs/socket" "^0.32.3" + "@cosmjs/stream" "^0.32.3" + "@cosmjs/utils" "^0.32.3" + axios "^1.6.0" + readonly-date "^1.0.0" + xstream "^11.14.0" + "@cosmjs/utils@^0.31.3": version "0.31.3" resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.31.3.tgz#f97bbfda35ad69e80cd5c7fe0a270cbda16db1ed" @@ -2350,6 +2474,11 @@ resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.32.2.tgz#324304aa85bfa6f10561cc17781d824d02130897" integrity sha512-Gg5t+eR7vPJMAmhkFt6CZrzPd0EKpAslWwk5rFVYZpJsM8JG5KT9XQ99hgNM3Ov6ScNoIWbXkpX27F6A9cXR4Q== +"@cosmjs/utils@^0.32.3": + version "0.32.3" + resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.32.3.tgz#5dcaee6dd7cc846cdc073e9a7a7f63242f5f7e31" + integrity sha512-WCZK4yksj2hBDz4w7xFZQTRZQ/RJhBX26uFHmmQFIcNUUVAihrLO+RerqJgk0dZqC42wstM9pEUQGtPmLcIYvg== + "@cosmology/ast@^1.4.8": version "1.4.8" resolved "https://registry.yarnpkg.com/@cosmology/ast/-/ast-1.4.8.tgz#9c6312de9fc4177d861a8723e4121cfdd4988533" From 7c08c683287da5644dd412172540bad0caa999fa Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 19 Apr 2024 10:43:16 -0700 Subject: [PATCH 126/438] dedupe yarn.lock --- yarn.lock | 381 +++++------------------------------------------------- 1 file changed, 31 insertions(+), 350 deletions(-) diff --git a/yarn.lock b/yarn.lock index 1c32ab4a5..f173e9364 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1944,14 +1944,7 @@ core-js-pure "^3.20.2" regenerator-runtime "^0.13.4" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.13.17", "@babel/runtime@^7.14.5", "@babel/runtime@^7.17.2", "@babel/runtime@^7.17.8", "@babel/runtime@^7.18.3", "@babel/runtime@^7.18.9", "@babel/runtime@^7.21.0", "@babel/runtime@^7.22.6", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.6.tgz#c05e610dc228855dc92ef1b53d07389ed8ab521d" - integrity sha512-zHd0eUrf5GZoOWVCXp6koAKQTfZV07eit6bGPmJgnZdnSAvvZee6zniW2XMF7Cmc4ISOOnPy3QaSiIJGJkVEDQ== - dependencies: - regenerator-runtime "^0.14.0" - -"@babel/runtime@^7.22.10": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.13.17", "@babel/runtime@^7.14.5", "@babel/runtime@^7.17.2", "@babel/runtime@^7.17.8", "@babel/runtime@^7.18.3", "@babel/runtime@^7.18.9", "@babel/runtime@^7.21.0", "@babel/runtime@^7.22.10", "@babel/runtime@^7.22.6", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7": version "7.24.0" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.0.tgz#584c450063ffda59697021430cb47101b085951e" integrity sha512-Chk32uHMg6TnQdvw2e9IlqPpFX/6NLuK0Ys2PqLb7/gL5uFn9mXvK715FGLlOLQrcO4qIkNHkvPGktzzXexsFw== @@ -2090,17 +2083,7 @@ dependencies: "@babel/runtime" "^7.21.0" -"@chain-registry/utils@^1.15.0", "@chain-registry/utils@^1.17.0": - version "1.17.0" - resolved "https://registry.yarnpkg.com/@chain-registry/utils/-/utils-1.17.0.tgz#f3072c2ca59bc81516f8fac0994ac05d9236a60a" - integrity sha512-MNIfpFM8rF1Gex+LhmuHgUElLbjz2vgmjI9qpRl9MMuQUSndu/NVhCDWcgvGNVKCD6woR6ohD9UIs9n0/Q91AA== - dependencies: - "@babel/runtime" "^7.21.0" - "@chain-registry/types" "^0.17.1" - bignumber.js "9.1.1" - sha.js "^2.4.11" - -"@chain-registry/utils@^1.18.2": +"@chain-registry/utils@^1.15.0", "@chain-registry/utils@^1.17.0", "@chain-registry/utils@^1.18.2": version "1.18.2" resolved "https://registry.yarnpkg.com/@chain-registry/utils/-/utils-1.18.2.tgz#fa67e8179afad45011c031a1181824133412e6c6" integrity sha512-X1vBFxdMVRGFW/6fLUQgJ4aG/2RaDYDDEeDA5/x/MlssGtdSBEyytd7M9zO0uS51QYy1ysIhkG3OyZLoyGdurg== @@ -2167,17 +2150,7 @@ "@cosmjs/math" "^0.31.3" "@cosmjs/utils" "^0.31.3" -"@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/crypto" "^0.32.2" - "@cosmjs/encoding" "^0.32.2" - "@cosmjs/math" "^0.32.2" - "@cosmjs/utils" "^0.32.2" - -"@cosmjs/amino@^0.32.3": +"@cosmjs/amino@^0.32.2", "@cosmjs/amino@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.32.3.tgz#b81d4a2b8d61568431a1afcd871e1344a19d97ff" integrity sha512-G4zXl+dJbqrz1sSJ56H/25l5NJEk/pAPIr8piAHgbXYw88OdAOlpA26PQvk2IbSN/rRgVbvlLTNgX2tzz1dyUA== @@ -2187,23 +2160,7 @@ "@cosmjs/math" "^0.32.3" "@cosmjs/utils" "^0.32.3" -"@cosmjs/cosmwasm-stargate@^0.32.1", "@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/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/cosmwasm-stargate@^0.32.3": +"@cosmjs/cosmwasm-stargate@^0.32.1", "@cosmjs/cosmwasm-stargate@^0.32.2", "@cosmjs/cosmwasm-stargate@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.32.3.tgz#26a110a6bb0c15fdeef647e3433bd9553a1acd5f" integrity sha512-pqkt+QsLIPNMTRh9m+igJgIpzXXgn1BxmxfAb9zlC23kvsuzY/12un9M7iAdim1NwKXDFeYw46xC2YkprwQp+g== @@ -2232,20 +2189,7 @@ elliptic "^6.5.4" libsodium-wrappers-sumo "^0.7.11" -"@cosmjs/crypto@^0.32.1", "@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/crypto@^0.32.3": +"@cosmjs/crypto@^0.32.1", "@cosmjs/crypto@^0.32.2", "@cosmjs/crypto@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.32.3.tgz#787f8e659709678722068ee1ddf379f65051a25e" integrity sha512-niQOWJHUtlJm2GG4F00yGT7sGPKxfUwz+2qQ30uO/E3p58gOusTcH2qjiJNVxb8vScYJhFYFqpm/OA/mVqoUGQ== @@ -2267,16 +2211,7 @@ bech32 "^1.1.4" readonly-date "^1.0.0" -"@cosmjs/encoding@^0.32.1", "@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" - readonly-date "^1.0.0" - -"@cosmjs/encoding@^0.32.3": +"@cosmjs/encoding@^0.32.1", "@cosmjs/encoding@^0.32.2", "@cosmjs/encoding@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.32.3.tgz#e245ff511fe4a0df7ba427b5187aab69e3468e5b" integrity sha512-p4KF7hhv8jBQX3MkB3Defuhz/W0l3PwWVYU2vkVuBJ13bJcXyhU9nJjiMkaIv+XP+W2QgRceqNNgFUC5chNR7w== @@ -2292,14 +2227,6 @@ dependencies: axios "^1.6.0" -"@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.32.2" - xstream "^11.14.0" - "@cosmjs/json-rpc@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.32.3.tgz#ccffdd7f722cecfab6daaa7463843b92f5d25355" @@ -2315,21 +2242,14 @@ dependencies: bn.js "^5.2.0" -"@cosmjs/math@^0.32.1", "@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" - -"@cosmjs/math@^0.32.3": +"@cosmjs/math@^0.32.1", "@cosmjs/math@^0.32.2", "@cosmjs/math@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.32.3.tgz#16e4256f4da507b9352327da12ae64056a2ba6c9" integrity sha512-amumUtZs8hCCnV+lSBaJIiZkGabQm22QGg/IotYrhcmoOEOjt82n7hMNlNXRs7V6WLMidGrGYcswB5zcmp0Meg== dependencies: bn.js "^5.2.0" -"@cosmjs/proto-signing@0.32.2", "@cosmjs/proto-signing@^0.32.1", "@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== @@ -2354,7 +2274,7 @@ cosmjs-types "^0.8.0" long "^4.0.0" -"@cosmjs/proto-signing@^0.32.3": +"@cosmjs/proto-signing@^0.32.1", "@cosmjs/proto-signing@^0.32.2", "@cosmjs/proto-signing@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.32.3.tgz#91ae149b747d18666a6ccc924165b306431f7c0d" integrity sha512-kSZ0ZUY0DwcRT0NcIn2HkadH4NKlwjfZgbLj1ABwh/4l0RgeT84QCscZCu63tJYq3K6auwqTiZSZERwlO4/nbg== @@ -2366,16 +2286,6 @@ "@cosmjs/utils" "^0.32.3" cosmjs-types "^0.9.0" -"@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.32.2" - isomorphic-ws "^4.0.1" - ws "^7" - xstream "^11.14.0" - "@cosmjs/socket@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.32.3.tgz#fa5c36bf58e87c0ad865d6318ecb0f8d9c89a28a" @@ -2386,23 +2296,7 @@ ws "^7" xstream "^11.14.0" -"@cosmjs/stargate@^0.32.1", "@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.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/stargate@^0.32.3": +"@cosmjs/stargate@^0.32.1", "@cosmjs/stargate@^0.32.2", "@cosmjs/stargate@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.32.3.tgz#5a92b222ada960ebecea72cc9f366370763f4b66" integrity sha512-OQWzO9YWKerUinPIxrO1MARbe84XkeXJAW0lyMIjXIEikajuXZ+PwftiKA5yA+8OyditVmHVLtPud6Pjna2s5w== @@ -2418,37 +2312,14 @@ cosmjs-types "^0.9.0" xstream "^11.14.0" -"@cosmjs/stream@^0.32.1", "@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/stream@^0.32.3": +"@cosmjs/stream@^0.32.1", "@cosmjs/stream@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.32.3.tgz#7522579aaf18025d322c2f33d6fb7573220395d6" integrity sha512-J2zVWDojkynYifAUcRmVczzmp6STEpyiAARq0rSsviqjreGIfspfuws/8rmkPa6qQBZvpQOBQCm2HyZZwYplIw== dependencies: xstream "^11.14.0" -"@cosmjs/tendermint-rpc@^0.32.1", "@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.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/tendermint-rpc@^0.32.3": +"@cosmjs/tendermint-rpc@^0.32.1", "@cosmjs/tendermint-rpc@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.32.3.tgz#f0406b9f0233e588fb924dca8c614972f9038aff" integrity sha512-xeprW+VR9xKGstqZg0H/KBZoUp8/FfFyS9ljIUTLM/UINjP2MhiwncANPS2KScfJVepGufUKk0/phHUeIBSEkw== @@ -2469,12 +2340,7 @@ resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.31.3.tgz#f97bbfda35ad69e80cd5c7fe0a270cbda16db1ed" integrity sha512-VBhAgzrrYdIe0O5IbKRqwszbQa7ZyQLx9nEQuHQ3HUplQW7P44COG/ye2n6AzCudtqxmwdX7nyX8ta1J07GoqA== -"@cosmjs/utils@^0.32.1", "@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== - -"@cosmjs/utils@^0.32.3": +"@cosmjs/utils@^0.32.1", "@cosmjs/utils@^0.32.2", "@cosmjs/utils@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.32.3.tgz#5dcaee6dd7cc846cdc073e9a7a7f63242f5f7e31" integrity sha512-WCZK4yksj2hBDz4w7xFZQTRZQ/RJhBX26uFHmmQFIcNUUVAihrLO+RerqJgk0dZqC42wstM9pEUQGtPmLcIYvg== @@ -5724,38 +5590,14 @@ resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.3.0.tgz#db7b55fee834dc8c2c484c696469e65bae2ee770" integrity sha512-Reer6rkLLcoOvB0dd66+Y7WrWVFH7sEEkF/4bJCIfsSKnTStTYaHtwIJAwbqnt9I392Tqvku0KkoqZOryWV9LQ== -"@noble/curves@1.1.0", "@noble/curves@~1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.1.0.tgz#f13fc667c89184bc04cccb9b11e8e7bae27d8c3d" - integrity sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA== - dependencies: - "@noble/hashes" "1.3.1" - -"@noble/curves@1.3.0", "@noble/curves@~1.3.0": +"@noble/curves@1.3.0", "@noble/curves@^1.0.0", "@noble/curves@~1.3.0": version "1.3.0" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.3.0.tgz#01be46da4fd195822dab821e72f71bf4aeec635e" integrity sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA== dependencies: "@noble/hashes" "1.3.3" -"@noble/curves@^1.0.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" - integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== - dependencies: - "@noble/hashes" "1.3.2" - -"@noble/hashes@1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.1.tgz#8831ef002114670c603c458ab8b11328406953a9" - integrity sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA== - -"@noble/hashes@1.3.2", "@noble/hashes@^1", "@noble/hashes@^1.0.0", "@noble/hashes@^1.2.0", "@noble/hashes@^1.3.1", "@noble/hashes@~1.3.0", "@noble/hashes@~1.3.1": - version "1.3.2" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" - integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== - -"@noble/hashes@1.3.3", "@noble/hashes@~1.3.2": +"@noble/hashes@1.3.3", "@noble/hashes@^1", "@noble/hashes@^1.0.0", "@noble/hashes@^1.2.0", "@noble/hashes@^1.3.1", "@noble/hashes@~1.3.2": version "1.3.3" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.3.tgz#39908da56a4adc270147bb07968bf3b16cfe1699" integrity sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA== @@ -6510,20 +6352,6 @@ resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.5.tgz#1d85d17269fe97694b9c592552dd9e5e33552157" integrity sha512-Brj9FiG2W1MRQSTB212YVPRrcbjkv48FoZi/u4l/zds/ieRrqsh7aUf6CLwkAq61oKXr/ZlTzlY66gLIj3TFTQ== -"@scure/base@~1.1.0": - version "1.1.3" - resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.3.tgz#8584115565228290a6c6c4961973e0903bb3df2f" - integrity sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q== - -"@scure/bip32@1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.3.1.tgz#7248aea723667f98160f593d621c47e208ccbb10" - integrity sha512-osvveYtyzdEVbt3OfwwXFr4P2iVBL5u1Q3q4ONBfDY/UpOuXmOlbgwc1xECEboY8wIays8Yt6onaWMUdUbfl0A== - dependencies: - "@noble/curves" "~1.1.0" - "@noble/hashes" "~1.3.1" - "@scure/base" "~1.1.0" - "@scure/bip32@1.3.3": version "1.3.3" resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.3.3.tgz#a9624991dc8767087c57999a5d79488f48eae6c8" @@ -6533,14 +6361,6 @@ "@noble/hashes" "~1.3.2" "@scure/base" "~1.1.4" -"@scure/bip39@1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.2.1.tgz#5cee8978656b272a917b7871c981e0541ad6ac2a" - integrity sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg== - dependencies: - "@noble/hashes" "~1.3.0" - "@scure/base" "~1.1.0" - "@scure/bip39@1.2.2": version "1.2.2" resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.2.2.tgz#f3426813f4ced11a47489cbcf7294aa963966527" @@ -8967,15 +8787,7 @@ tslib "1.14.1" ws "^7.5.1" -"@walletconnect/keyvaluestorage@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@walletconnect/keyvaluestorage/-/keyvaluestorage-1.0.2.tgz#92f5ca0f54c1a88a093778842ce0c874d86369c8" - integrity sha512-U/nNG+VLWoPFdwwKx0oliT4ziKQCEoQ27L5Hhw8YOFGA2Po9A9pULUYNWhDgHkrb0gYDNt//X7wABcEWWBd3FQ== - dependencies: - safe-json-utils "^1.1.1" - tslib "1.14.1" - -"@walletconnect/keyvaluestorage@^1.1.1": +"@walletconnect/keyvaluestorage@^1.0.2", "@walletconnect/keyvaluestorage@^1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@walletconnect/keyvaluestorage/-/keyvaluestorage-1.1.1.tgz#dd2caddabfbaf80f6b8993a0704d8b83115a1842" integrity sha512-V7ZQq2+mSxAq7MrRqDxanTzu2RcElfK1PfNYiaVnJgJ7Q7G7hTVwF8voIBx92qsRyGHZihrwNPHuZd1aKkd0rA== @@ -9087,7 +8899,7 @@ resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-1.8.0.tgz#3f5e85b2d6b149337f727ab8a71b8471d8d9a195" integrity sha512-Cn+3I0V0vT9ghMuzh1KzZvCkiAxTq+1TR2eSqw5E5AVWfmCtECFkVZBP6uUJZ8YjwLqXheI+rnjqPy7sVM4Fyg== -"@walletconnect/utils@2.10.0", "@walletconnect/utils@^2.9.0": +"@walletconnect/utils@2.10.0": version "2.10.0" resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.10.0.tgz#6918d12180d797b8bd4a19fb2ff128e394e181d6" integrity sha512-9GRyEz/7CJW+G04RvrjPET5k7hOEsB9b3fF9cWDk/iDCxSWpbkU/hv/urRB36C+gvQMAZgIZYX3dHfzJWkY/2g== @@ -9107,7 +8919,7 @@ query-string "7.1.3" uint8arrays "^3.1.0" -"@walletconnect/utils@^2.11.0": +"@walletconnect/utils@^2.11.0", "@walletconnect/utils@^2.9.0": version "2.11.2" resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.11.2.tgz#dee0f19adf5e38543612cbe9fa4de7ed28eb7e85" integrity sha512-LyfdmrnZY6dWqlF4eDrx5jpUwsB2bEPjoqR5Z6rXPiHJKUOdJt7az+mNOn5KTSOlRpd1DmozrBrWr+G9fFLYVw== @@ -9758,12 +9570,7 @@ acorn@^7.0.0, acorn@^7.4.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.0.4, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0: - version "8.8.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" - integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== - -acorn@^8.11.3: +acorn@^8.0.4, acorn@^8.11.3, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0: version "8.11.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== @@ -10014,15 +9821,7 @@ anymatch@^2.0.0: micromatch "^3.1.4" normalize-path "^2.1.1" -anymatch@^3.0.0, anymatch@^3.0.3, anymatch@~3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" - integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -anymatch@^3.1.3: +anymatch@^3.0.0, anymatch@^3.0.3, anymatch@^3.1.3, anymatch@~3.1.2: version "3.1.3" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== @@ -10243,17 +10042,7 @@ assert@^1.1.1: object-assign "^4.1.1" util "0.10.3" -assert@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/assert/-/assert-2.0.0.tgz#95fc1c616d48713510680f2eaf2d10dd22e02d32" - integrity sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A== - dependencies: - es6-object-assign "^1.1.0" - is-nan "^1.2.1" - object-is "^1.0.1" - util "^0.12.0" - -assert@^2.1.0: +assert@^2.0.0, assert@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/assert/-/assert-2.1.0.tgz#6d92a238d05dc02e7427c881fb8be81c8448b2dd" integrity sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw== @@ -11194,16 +10983,7 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" -call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.5.tgz#6fa2b7845ce0ea49bf4d8b9ef64727a2c2e2e513" - integrity sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ== - dependencies: - function-bind "^1.1.2" - get-intrinsic "^1.2.1" - set-function-length "^1.1.1" - -call-bind@^1.0.7: +call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.5, call-bind@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.7.tgz#06016599c40c56498c18769d2730be242b6fa3b9" integrity sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w== @@ -12606,29 +12386,12 @@ define-data-property@^1.0.1, define-data-property@^1.1.2: es-errors "^1.3.0" gopd "^1.0.1" -define-data-property@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.1.tgz#c35f7cd0ab09883480d12ac5cb213715587800b3" - integrity sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ== - dependencies: - get-intrinsic "^1.2.1" - gopd "^1.0.1" - has-property-descriptors "^1.0.0" - define-lazy-prop@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og== -define-properties@^1.1.2, define-properties@^1.1.3, define-properties@^1.1.4: - version "1.2.0" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.0.tgz#52988570670c9eacedd8064f4a990f2405849bd5" - integrity sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA== - dependencies: - has-property-descriptors "^1.0.0" - object-keys "^1.1.1" - -define-properties@^1.2.1: +define-properties@^1.1.2, define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== @@ -13352,11 +13115,6 @@ es6-iterator@^2.0.3: es5-ext "^0.10.35" es6-symbol "^3.1.1" -es6-object-assign@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/es6-object-assign/-/es6-object-assign-1.1.0.tgz#c2c3582656247c39ea107cb1e6652b6f9f24523c" - integrity sha512-MEl9uirslVwqQU369iHNWZXsI8yaZYGg/D65aOgZkeyFJwHYSxilf7rQzXKI7DdDuBPrBXbfk3sl9hJhmd5AUw== - es6-promise@^4.0.3: version "4.2.8" resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" @@ -13783,17 +13541,7 @@ eth-rpc-errors@^4.0.2: dependencies: fast-safe-stringify "^2.0.6" -ethereum-cryptography@^2.0.0, ethereum-cryptography@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-2.1.2.tgz#18fa7108622e56481157a5cb7c01c0c6a672eb67" - integrity sha512-Z5Ba0T0ImZ8fqXrJbpHcbpAvIswRte2wGNR/KePnu8GbbvgJ47lMxT/ZZPG6i9Jaht4azPDop4HaM00J0J59ug== - dependencies: - "@noble/curves" "1.1.0" - "@noble/hashes" "1.3.1" - "@scure/bip32" "1.3.1" - "@scure/bip39" "1.2.1" - -ethereum-cryptography@^2.1.3: +ethereum-cryptography@^2.0.0, ethereum-cryptography@^2.1.2, ethereum-cryptography@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-2.1.3.tgz#1352270ed3b339fe25af5ceeadcf1b9c8e30768a" integrity sha512-BlwbIL7/P45W8FGW2r7LGuvoEZ+7PWsniMvQ4p5s2xCyw9tmaDlpfsN9HjAucbF+t/qpVHwZUisgfK24TCW8aA== @@ -14678,17 +14426,7 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.2.tgz#281b7622971123e1ef4b3c90fd7539306da93f3b" - integrity sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA== - dependencies: - function-bind "^1.1.2" - has-proto "^1.0.1" - has-symbols "^1.0.3" - hasown "^2.0.0" - -get-intrinsic@^1.2.3, get-intrinsic@^1.2.4: +get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.3, get-intrinsic@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd" integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ== @@ -15157,14 +14895,7 @@ has-glob@^1.0.0: dependencies: is-glob "^3.0.0" -has-property-descriptors@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz#610708600606d36961ed04c196193b6a607fa861" - integrity sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ== - dependencies: - get-intrinsic "^1.1.1" - -has-property-descriptors@^1.0.1: +has-property-descriptors@^1.0.0, has-property-descriptors@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== @@ -15675,14 +15406,7 @@ icss-utils@^5.0.0, icss-utils@^5.1.0: resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae" integrity sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA== -idb-keyval@^6.0.3: - version "6.2.0" - resolved "https://registry.yarnpkg.com/idb-keyval/-/idb-keyval-6.2.0.tgz#3af94a3cc0689d6ee0bc9e045d2a3340ea897173" - integrity sha512-uw+MIyQn2jl3+hroD7hF8J7PUviBU7BPKWw4f/ISf32D4LoGu98yHjrzWWJDASu9QNrX10tCJqk9YY0ClWm8Ng== - dependencies: - safari-14-idb-fix "^3.0.0" - -idb-keyval@^6.2.1: +idb-keyval@^6.0.3, idb-keyval@^6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/idb-keyval/-/idb-keyval-6.2.1.tgz#94516d625346d16f56f3b33855da11bfded2db33" integrity sha512-8Sb3veuYCyrZL+VBt9LJfZjLUPWVvqn8tG28VqYNFCo43KHcKuq+b4EiXGeuaLAQWL2YmyDgMp2aSpH9JHsEQg== @@ -16431,7 +16155,7 @@ is-map@^2.0.2: resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.2.tgz#00922db8c9bf73e81b7a335827bc2a43f2b91127" integrity sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg== -is-nan@^1.2.1, is-nan@^1.3.2: +is-nan@^1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/is-nan/-/is-nan-1.3.2.tgz#043a54adea31748b55b6cd4e09aadafa69bd9e1d" integrity sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w== @@ -18202,7 +17926,7 @@ lower-case@^2.0.2: dependencies: tslib "^2.0.3" -lru-cache@^10.0.2: +lru-cache@^10.0.2, "lru-cache@^9.1.1 || ^10.0.0": version "10.2.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.0.tgz#0bd445ca57363465900f4d1f9bd8db343a4d95c3" integrity sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q== @@ -18234,11 +17958,6 @@ lru-cache@^7.4.4, lru-cache@^7.5.1, lru-cache@^7.7.1: resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.14.1.tgz#8da8d2f5f59827edb388e63e459ac23d6d408fea" integrity sha512-ysxwsnTKdAx96aTRdhDOCQfDgbHnt8SK0KY8SEjO0wHinhWOFTESbjVCMPbU1uGXg/ch4lifqx0wfjOawU2+WA== -"lru-cache@^9.1.1 || ^10.0.0": - version "10.0.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.0.1.tgz#0a3be479df549cca0e5d693ac402ff19537a6b7a" - integrity sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g== - lru-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3" @@ -19962,14 +19681,6 @@ object-inspect@^1.12.0, object-inspect@^1.9.0: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== -object-is@^1.0.1: - version "1.1.5" - resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" - integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - object-is@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.6.tgz#1a6a53aed2dd8f7e6775ff870bea58545956ab07" @@ -19990,17 +19701,7 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" -object.assign@^4.1.0, object.assign@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" - integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - has-symbols "^1.0.1" - object-keys "^1.1.1" - -object.assign@^4.1.4: +object.assign@^4.1.0, object.assign@^4.1.2, object.assign@^4.1.4: version "4.1.5" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.5.tgz#3a833f9ab7fdb80fc9e8d2300c803d216d8fdbb0" integrity sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ== @@ -22489,11 +22190,6 @@ sade@^1.7.3: dependencies: mri "^1.1.0" -safari-14-idb-fix@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/safari-14-idb-fix/-/safari-14-idb-fix-3.0.0.tgz#450fc049b996ec7f3fd9ca2f89d32e0761583440" - integrity sha512-eBNFLob4PMq8JA1dGyFn6G97q3/WzNtFK4RnzT1fnLq+9RyrGknzYiM/9B12MnKAxuj1IXr7UKYtTNtjyKMBog== - safe-buffer@5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -22509,11 +22205,6 @@ safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, s resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== -safe-json-utils@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/safe-json-utils/-/safe-json-utils-1.1.1.tgz#0e883874467d95ab914c3f511096b89bfb3e63b1" - integrity sha512-SAJWGKDs50tAbiDXLf89PDwt9XYkWyANFWVzn4dTXl5QyI8t2o/bW5/OJl3lvc2WVU4MEpTo9Yz5NVFNsp+OJQ== - safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" @@ -22739,16 +22430,6 @@ set-blocking@^2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== -set-function-length@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.1.1.tgz#4bc39fafb0307224a33e106a7d35ca1218d659ed" - integrity sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ== - dependencies: - define-data-property "^1.1.1" - get-intrinsic "^1.2.1" - gopd "^1.0.1" - has-property-descriptors "^1.0.0" - set-function-length@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.1.tgz#47cc5945f2c771e2cf261c6737cf9684a2a5e425" @@ -25041,7 +24722,7 @@ util@^0.11.0: dependencies: inherits "2.0.3" -util@^0.12.0, util@^0.12.3, util@^0.12.5: +util@^0.12.3, util@^0.12.5: version "0.12.5" resolved "https://registry.yarnpkg.com/util/-/util-0.12.5.tgz#5f17a6059b73db61a875668781a1c2b136bd6fbc" integrity sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA== From 7c735647aef2f8430e113bf0c6b866fc131620e5 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 19 Apr 2024 10:48:36 -0700 Subject: [PATCH 127/438] fixed getting wasm value from tx result events --- packages/state/recoil/selectors/treasury.ts | 53 +++++++------------ .../stateful/components/dao/CreateDaoForm.tsx | 4 +- .../common/hooks/makeUsePublishProposal.ts | 5 +- .../common/hooks/makeUsePublishProposal.ts | 4 +- packages/utils/client.ts | 30 +++++------ 5 files changed, 40 insertions(+), 56 deletions(-) diff --git a/packages/state/recoil/selectors/treasury.ts b/packages/state/recoil/selectors/treasury.ts index 3708f1ca5..3e4663aaf 100644 --- a/packages/state/recoil/selectors/treasury.ts +++ b/packages/state/recoil/selectors/treasury.ts @@ -1,5 +1,5 @@ import { parseCoins } from '@cosmjs/proto-signing' -import { IndexedTx } from '@cosmjs/stargate' +import { Event, IndexedTx } from '@cosmjs/stargate' import { selectorFamily, waitForAll } from 'recoil' import { AmountWithTimestamp, WithChainId } from '@dao-dao/types' @@ -25,13 +25,7 @@ type TreasuryTransactionsParams = WithChainId<{ interface TreasuryTransaction { tx: IndexedTx timestamp: Date | undefined - events: { - type: string - attributes: { - key: string - value: string - }[] - }[] + events: readonly Event[] } export const treasuryTransactionsSelector = selectorFamily< @@ -63,33 +57,24 @@ export const treasuryTransactionsSelector = selectorFamily< ) ) - return ( - txs - .map((tx, index) => { - let events - try { - events = JSON.parse(tx.rawLog)[0].events - } catch { - return - } - - return { - tx, - timestamp: txDates[index], - events, - } + return txs + .map( + (tx, index): TreasuryTransaction => ({ + tx, + timestamp: txDates[index], + events: tx.events, }) - .filter(Boolean) as TreasuryTransaction[] - ).sort((a, b) => - // Sort descending by timestamp, putting undefined timestamps last. - b.timestamp && a.timestamp - ? b.timestamp.getTime() - a.timestamp.getTime() - : !a.timestamp - ? 1 - : !b.timestamp - ? -1 - : b.tx.height - a.tx.height - ) + ) + .sort((a, b) => + // Sort descending by timestamp, putting undefined timestamps last. + b.timestamp && a.timestamp + ? b.timestamp.getTime() - a.timestamp.getTime() + : !a.timestamp + ? 1 + : !b.timestamp + ? -1 + : b.tx.height - a.tx.height + ) }, }) diff --git a/packages/stateful/components/dao/CreateDaoForm.tsx b/packages/stateful/components/dao/CreateDaoForm.tsx index 4f6dce7be..a450258f9 100644 --- a/packages/stateful/components/dao/CreateDaoForm.tsx +++ b/packages/stateful/components/dao/CreateDaoForm.tsx @@ -419,7 +419,7 @@ export const InnerCreateDaoForm = ({ throw new Error(t('error.loadingData')) } - const { logs } = await instantiateWithFactory( + const { events } = await instantiateWithFactory( { codeId: codeIds.DaoCore, instantiateMsg: encodeJsonToBase64(instantiateMsg), @@ -430,7 +430,7 @@ export const InnerCreateDaoForm = ({ getFundsFromDaoInstantiateMsg(instantiateMsg) ) return findWasmAttributeValue( - logs, + events, factoryContractAddress, 'set contract admin as itself' )! diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/hooks/makeUsePublishProposal.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/hooks/makeUsePublishProposal.ts index b847034ef..ebf202c3a 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/hooks/makeUsePublishProposal.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/hooks/makeUsePublishProposal.ts @@ -1,4 +1,3 @@ -import { ExecuteResult } from '@cosmjs/cosmwasm-stargate' import { coins } from '@cosmjs/stargate' import { useCallback, useEffect, useState } from 'react' import toast from 'react-hot-toast' @@ -347,7 +346,7 @@ export const makeUsePublishProposal = choices, } - let response: ExecuteResult = proposalModule.prePropose + let { events } = proposalModule.prePropose ? await doProposePrePropose( { msg: { @@ -371,7 +370,7 @@ export const makeUsePublishProposal = const proposalNumber = Number( findWasmAttributeValue( - response.logs, + events, proposalModule.address, 'proposal_id' ) ?? -1 diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/makeUsePublishProposal.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/makeUsePublishProposal.ts index 1222c37be..75a37dfca 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/makeUsePublishProposal.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/makeUsePublishProposal.ts @@ -362,12 +362,12 @@ export const makeUsePublishProposal = const proposalNumber = Number( (isPreProposeApprovalProposal && proposalModule.prePropose ? findWasmAttributeValue( - response.logs, + response.events, proposalModule.prePropose.address, 'id' ) : findWasmAttributeValue( - response.logs, + response.events, proposalModule.address, 'proposal_id' )) ?? -1 diff --git a/packages/utils/client.ts b/packages/utils/client.ts index 8ebc4f74f..9c2cd1d8e 100644 --- a/packages/utils/client.ts +++ b/packages/utils/client.ts @@ -1,5 +1,5 @@ import { CosmWasmClient } from '@cosmjs/cosmwasm-stargate' -import { StargateClient, logs } from '@cosmjs/stargate' +import { Event, StargateClient } from '@cosmjs/stargate' import { Comet38Client, HttpBatchClient, @@ -94,23 +94,23 @@ export const stargateClientRouter = new ChainClientRouter({ }, }) -// In response logs from a transaction with a wasm event, gets the attribute key -// for a given contract address. +/** + * In response events from a transaction with a wasm event, gets the attribute + * key for a given contract address. + */ export const findWasmAttributeValue = ( - logs: readonly logs.Log[], + events: readonly Event[], contractAddress: string, attributeKey: string ): string | undefined => { - const wasmEvent = logs - .flatMap((log) => log.events) - .find( - ({ type, attributes }) => - type === 'wasm' && - attributes.some( - ({ key, value }) => - key === '_contract_address' && value === contractAddress - ) && - attributes.some(({ key }) => key === attributeKey) - ) + const wasmEvent = events.find( + ({ type, attributes }) => + type === 'wasm' && + attributes.some( + ({ key, value }) => + key === '_contract_address' && value === contractAddress + ) && + attributes.some(({ key }) => key === attributeKey) + ) return wasmEvent?.attributes.find(({ key }) => key === attributeKey)!.value } From 764feda2a56b381e4025925e4dbe819dc22ccfa6 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 22 Apr 2024 11:47:47 -0700 Subject: [PATCH 128/438] added approve and reject buttons for wallet approval flow --- packages/i18n/locales/en/translation.json | 2 + .../contracts/DaoPreProposeApprovalSingle.ts | 36 +++++- .../contracts/DaoPreProposeApprovalSingle.ts | 50 ++++++++ packages/stateful/hooks/contracts/index.ts | 1 + ...reProposeApprovalProposalStatusAndInfo.tsx | 115 +++++++++++++++++- .../hooks/useProposalRefreshers.ts | 20 +-- 6 files changed, 210 insertions(+), 14 deletions(-) create mode 100644 packages/stateful/hooks/contracts/DaoPreProposeApprovalSingle.ts diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 2c868b801..d7fc69099 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -1458,10 +1458,12 @@ "multisigImported": "Import successful. Review your new DAO's configuration, and make sure to set an image, name, and description.", "nftCollectionContractInstantiated": "NFT collection created successfully.", "nominationSubmitted": "Contributor nominated for this compensation cycle.", + "proposalApproved": "Proposal approved and is now open for voting.", "proposalClosed": "Proposal closed.", "proposalCreatedCompleteCompensationCycle": "Proposal published. Complete the compensation cycle by saving the proposal ID.", "proposalExecuted": "Executed. Updating data and refreshing page...", "proposalOverruled": "Proposal overruled.", + "proposalRejected": "Proposal rejected.", "proposalSimulation": "Proposal simulated successfully. If executed right now, it would not fail.", "proposalVetoed": "Proposal vetoed.", "ratingsSubmitted": "Ratings submitted.", diff --git a/packages/state/recoil/selectors/contracts/DaoPreProposeApprovalSingle.ts b/packages/state/recoil/selectors/contracts/DaoPreProposeApprovalSingle.ts index 4df6b3777..0065fdc9c 100644 --- a/packages/state/recoil/selectors/contracts/DaoPreProposeApprovalSingle.ts +++ b/packages/state/recoil/selectors/contracts/DaoPreProposeApprovalSingle.ts @@ -7,8 +7,15 @@ import { HooksResponse, } from '@dao-dao/types/contracts/DaoPreProposeApprovalSingle' -import { DaoPreProposeApprovalSingleQueryClient } from '../../../contracts/DaoPreProposeApprovalSingle' -import { refreshProposalIdAtom, refreshProposalsIdAtom } from '../../atoms' +import { + DaoPreProposeApprovalSingleClient, + DaoPreProposeApprovalSingleQueryClient, +} from '../../../contracts/DaoPreProposeApprovalSingle' +import { + refreshProposalIdAtom, + refreshProposalsIdAtom, + signingCosmWasmClientAtom, +} from '../../atoms' import { cosmWasmClientForChainSelector } from '../chain' import { queryContractIndexerSelector } from '../indexer' @@ -30,6 +37,31 @@ export const queryClient = selectorFamily< dangerouslyAllowMutability: true, }) +export type ExecuteClientParams = WithChainId<{ + contractAddress: string + sender: string +}> + +export const executeClient = selectorFamily< + DaoPreProposeApprovalSingleClient | undefined, + ExecuteClientParams +>({ + key: 'daoPreProposeApprovalSingleExecuteClient', + get: + ({ chainId, contractAddress, sender }) => + ({ get }) => { + const client = get(signingCosmWasmClientAtom({ chainId })) + if (!client) return + + return new DaoPreProposeApprovalSingleClient( + client, + sender, + contractAddress + ) + }, + dangerouslyAllowMutability: true, +}) + export const proposalModuleSelector = selectorFamily< Addr, QueryClientParams & { diff --git a/packages/stateful/hooks/contracts/DaoPreProposeApprovalSingle.ts b/packages/stateful/hooks/contracts/DaoPreProposeApprovalSingle.ts new file mode 100644 index 000000000..42085c836 --- /dev/null +++ b/packages/stateful/hooks/contracts/DaoPreProposeApprovalSingle.ts @@ -0,0 +1,50 @@ +/* eslint-disable react-hooks/rules-of-hooks */ + +import { ExecuteResult } from '@cosmjs/cosmwasm-stargate' +import { useCallback } from 'react' +import { useRecoilValueLoadable } from 'recoil' + +import { DaoPreProposeApprovalSingleClient as ExecuteClient } from '@dao-dao/state/contracts/DaoPreProposeApprovalSingle' +import { + ExecuteClientParams, + executeClient, +} from '@dao-dao/state/recoil/selectors/contracts/DaoPreProposeApprovalSingle' +import { useChain } from '@dao-dao/stateless' +import { FunctionKeyOf } from '@dao-dao/types' + +import { useSyncWalletSigner } from '../useSyncWalletSigner' + +// This hook wrapper lets us easily make hooks out of all execution functions on +// the contract clients, without having to fetch the `executeClient` selector as +// a loadable and add `useCallback` hooks in all the components. +const wrapExecuteHook = + >(fn: T) => + (params: Omit) => { + // Make sure we have the signing client for this chain and wallet. + useSyncWalletSigner() + + const { chain_id: chainId } = useChain() + const clientLoadable = useRecoilValueLoadable( + executeClient({ + ...params, + chainId, + }) + ) + const client = + clientLoadable.state === 'hasValue' ? clientLoadable.contents : undefined + + return useCallback( + (...args: Parameters) => { + if (client) + return ( + client[fn] as ( + ...args: Parameters + ) => Promise + )(...args) + throw new Error('Wallet signer not set up.') + }, + [client] + ) + } + +export const useExtension = wrapExecuteHook('extension') diff --git a/packages/stateful/hooks/contracts/index.ts b/packages/stateful/hooks/contracts/index.ts index eb5abfb6a..bd6804b26 100644 --- a/packages/stateful/hooks/contracts/index.ts +++ b/packages/stateful/hooks/contracts/index.ts @@ -4,6 +4,7 @@ export * as Cw721BaseHooks from './Cw721Base' export * as CwAdminFactoryHooks from './CwAdminFactory' export * as CwProposalSingleV1Hooks from './CwProposalSingle.v1' export * as CwVesting from './CwVesting' +export * as DaoPreProposeApprovalSingleHooks from './DaoPreProposeApprovalSingle' export * as DaoPreProposeMultipleHooks from './DaoPreProposeMultiple' export * as DaoPreProposeSingleHooks from './DaoPreProposeSingle' export * as DaoProposalMultipleHooks from './DaoProposalMultiple' diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/PreProposeApprovalProposalStatusAndInfo.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/PreProposeApprovalProposalStatusAndInfo.tsx index bd9d18534..3ad6a845a 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/PreProposeApprovalProposalStatusAndInfo.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/PreProposeApprovalProposalStatusAndInfo.tsx @@ -2,12 +2,17 @@ import { AccountCircleOutlined, HourglassTopRounded, RotateRightOutlined, + ThumbDown, + ThumbUp, ThumbUpOutlined, WhereToVoteOutlined, } from '@mui/icons-material' +import { useState } from 'react' +import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' import { + Button, Logo, PreProposeApprovalProposalStatusMap, ProposalStatusAndInfoProps, @@ -21,15 +26,20 @@ import { PreProposeApprovalProposalWithMeteadata, PreProposeModuleType, } from '@dao-dao/types' -import { keyFromPreProposeStatus } from '@dao-dao/utils' +import { keyFromPreProposeStatus, processError } from '@dao-dao/utils' import { ButtonLink, EntityDisplay, SuspenseLoader, } from '../../../../components' +import { DaoPreProposeApprovalSingleHooks } from '../../../../hooks' +import { useWallet } from '../../../../hooks/useWallet' import { useProposalModuleAdapterOptions } from '../../../react' -import { useLoadingPreProposeApprovalProposal } from '../hooks' +import { + useLoadingPreProposeApprovalProposal, + useProposalRefreshers, +} from '../hooks' import { ProposalStatusAndInfoLoader } from './ProposalStatusAndInfoLoader' export const PreProposeApprovalProposalStatusAndInfo = ( @@ -64,6 +74,14 @@ const InnerPreProposeApprovalProposalStatusAndInfo = ({ const { proposalModule: { prefix, prePropose }, } = useProposalModuleAdapterOptions() + const { isWalletConnected, address = '' } = useWallet() + const { refreshProposalAndAll } = useProposalRefreshers() + + const [loading, setLoading] = useState<'approve' | 'reject' | false>(false) + const doExtension = DaoPreProposeApprovalSingleHooks.useExtension({ + contractAddress: prePropose?.address ?? '', + sender: address, + }) if (!prePropose || prePropose.type !== PreProposeModuleType.Approval) { return null @@ -173,7 +191,98 @@ const InnerPreProposeApprovalProposalStatusAndInfo = ({ context: statusKey, }) + const approve = async () => { + if (!isWalletConnected) { + toast.error(t('error.logInToContinue')) + return + } + + setLoading('approve') + try { + await doExtension({ + msg: { + approve: { + id: proposal.approval_id, + }, + }, + }) + + toast.success(t('success.proposalApproved')) + + refreshProposalAndAll() + } catch (err) { + console.error(err) + toast.error(processError(err)) + } finally { + setLoading(false) + } + } + + const reject = async () => { + if (!isWalletConnected) { + toast.error(t('error.logInToContinue')) + return + } + + setLoading('reject') + try { + await doExtension({ + msg: { + reject: { + id: proposal.approval_id, + }, + }, + }) + + toast.success(t('success.proposalRejected')) + + refreshProposalAndAll() + } catch (err) { + console.error(err) + toast.error(processError(err)) + } finally { + setLoading(false) + } + } + return ( - + + + + +
+ ), + } + : undefined + } + info={info} + status={status} + /> ) } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalRefreshers.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalRefreshers.ts index 96a9c98d6..7681ea0fd 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalRefreshers.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalRefreshers.ts @@ -42,15 +42,17 @@ export const useProposalRefreshers = (): ProposalRefreshers => { }, [setRefreshProposalsId]) const loadingProposal = useCachedLoading( - DaoProposalSingleCommonSelectors.proposalSelector({ - contractAddress: proposalModuleAddress, - chainId, - params: [ - { - proposalId: proposalNumber, - }, - ], - }), + !isPreProposeApprovalProposal + ? DaoProposalSingleCommonSelectors.proposalSelector({ + contractAddress: proposalModuleAddress, + chainId, + params: [ + { + proposalId: proposalNumber, + }, + ], + }) + : constSelector(undefined), undefined ) From 5093c499cbe5f09911bb43f183a8c37fb823cd51 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 23 Apr 2024 19:34:13 -0700 Subject: [PATCH 129/438] added polytone connections with injective --- .../components/SelfRelayExecuteModal.tsx | 1 + packages/types/chain.ts | 1 + packages/utils/constants/chains.ts | 71 +++++++++++++++++++ 3 files changed, 73 insertions(+) diff --git a/packages/stateful/components/SelfRelayExecuteModal.tsx b/packages/stateful/components/SelfRelayExecuteModal.tsx index 5eb048391..b7ee72de5 100644 --- a/packages/stateful/components/SelfRelayExecuteModal.tsx +++ b/packages/stateful/components/SelfRelayExecuteModal.tsx @@ -93,6 +93,7 @@ const RELAYER_FUNDS_NEEDED: Partial> = { [ChainId.OraichainMainnet]: 0.1 * 10 ** 6, [ChainId.ChihuahuaMainnet]: 1000 * 10 ** 6, [ChainId.ArchwayMainnet]: 1 * 10 ** 18, + [ChainId.InjectiveMainnet]: 0.03 * 10 ** 18, } type Relayer = { diff --git a/packages/types/chain.ts b/packages/types/chain.ts index 397a4220a..bd3ae36f2 100644 --- a/packages/types/chain.ts +++ b/packages/types/chain.ts @@ -72,6 +72,7 @@ export enum ChainId { ChihuahuaMainnet = 'chihuahua-1', OraichainMainnet = 'Oraichain', ArchwayMainnet = 'archway-1', + InjectiveMainnet = 'injective-1', } export type BaseChainConfig = { diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index d4d676355..a3fd87d92 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -96,6 +96,9 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ DaoProposalMultiple: 2461, }, }, + // No IBC connection with: + // - Injective + // - Neutron polytone: { [ChainId.OsmosisMainnet]: { // juno @@ -452,6 +455,23 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // archway remoteChannel: 'channel-43', }, + [ChainId.InjectiveMainnet]: { + // osmosis + note: 'osmo16passct926eern05hzuf46g9809cvavhxv9qw9rm5wnu9fk0gfxs2v37x7', + // osmosis + listener: + 'osmo1c6htfqceqr4vuln2ryrs7sk6mkdvqrgt5j5vlw8x5ql0cjvy29ls5dkyll', + // injective + voice: 'inj1kt7anwm5wy9e8grq04z46z08yqd49ewq97g8f0', + // osmosis + localConnection: 'connection-1298', + // injective + remoteConnection: 'connection-14', + // osmosis + localChannel: 'channel-73927', + // injective + remoteChannel: 'channel-266', + }, }, }, { @@ -603,6 +623,23 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // archway remoteChannel: 'channel-85', }, + [ChainId.InjectiveMainnet]: { + // neutron + note: 'neutron1565ewvznhrw3t96ztv8gan3ykr7262gjrl4xy449mhgvl5h6gdkq027r4c', + // neutron + listener: + 'neutron1ga58f9hz8v8fjtpspmtrmakpdapc2jdddhszpwg0dfjuwg8xt5fqgud73l', + // injective + voice: 'inj1ac4y7r7ec47jh9re379ejcl942a9c5k6f23yqa', + // neutron + localConnection: 'connection-58', + // injective + remoteConnection: 'connection-220', + // neutron + localChannel: 'channel-4188', + // injective + remoteChannel: 'channel-271', + }, }, }, { @@ -945,6 +982,23 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // chihuahua // remoteClient: '07-tendermint-126', }, + [ChainId.InjectiveMainnet]: { + // migaloo + note: 'migaloo1e63cld4ex3062nvrx8f6dald97c5f9am3y8eledc0za7tvyzc7usvn3nwr', + // migaloo + listener: + 'migaloo1mdz2smpj6hs4caerx0sch2hdvs2zj4eryr7unv9vqrrfw7xjuz6qd5j38z', + // injective + voice: 'inj1ql2qpt5uudppa33yf0p03fssxtkhqawxdw4czf', + // migaloo + localConnection: 'connection-8', + // injective + remoteConnection: 'connection-123', + // migaloo + localChannel: 'channel-117', + // injective + remoteChannel: 'channel-264', + }, }, }, { @@ -1094,6 +1148,23 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // archway remoteChannel: 'channel-54', }, + [ChainId.InjectiveMainnet]: { + // terra + note: 'terra1pmhsahmn5eymdn07yahp9692jnqyh54f7pak82v4nwzylgfrvkaq8grraa', + // terra + listener: + 'terra1m2xgx2n6wu5lw2zk3sxpyyr7f75fe9v32u3av9lfl6h64mutw96qztacj9', + // injective + voice: 'inj1eksx0xjfzdcvesfq0kk7fcdv534ajrmccg27ah', + // terra + localConnection: 'connection-311', + // injective + remoteConnection: 'connection-202', + // terra + localChannel: 'channel-397', + // injective + remoteChannel: 'channel-272', + }, }, }, { From 48f99da58927d533fe1c5c9998372b34372b5f9f Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 26 Apr 2024 10:21:34 -0700 Subject: [PATCH 130/438] added cosmos feegrant proto --- .../types/protobuf/codegen/alliance/bundle.ts | 24 +- .../protobuf/codegen/alliance/rpc.query.ts | 3 + .../types/protobuf/codegen/alliance/rpc.tx.ts | 3 + .../types/protobuf/codegen/circle/bundle.ts | 24 +- .../protobuf/codegen/circle/rpc.query.ts | 3 + .../types/protobuf/codegen/circle/rpc.tx.ts | 3 + .../types/protobuf/codegen/cosmos/bundle.ts | 312 +++++---- .../types/protobuf/codegen/cosmos/client.ts | 5 +- .../cosmos/feegrant/v1beta1/feegrant.ts | 632 +++++++++++++++++ .../cosmos/feegrant/v1beta1/genesis.ts | 94 +++ .../feegrant/v1beta1/query.rpc.Query.ts | 52 ++ .../codegen/cosmos/feegrant/v1beta1/query.ts | 635 ++++++++++++++++++ .../cosmos/feegrant/v1beta1/tx.amino.ts | 18 + .../cosmos/feegrant/v1beta1/tx.registry.ts | 71 ++ .../cosmos/feegrant/v1beta1/tx.rpc.msg.ts | 42 ++ .../codegen/cosmos/feegrant/v1beta1/tx.ts | 606 +++++++++++++++++ .../protobuf/codegen/cosmos/rpc.query.ts | 3 + .../types/protobuf/codegen/cosmos/rpc.tx.ts | 3 + .../types/protobuf/codegen/cosmwasm/bundle.ts | 80 +-- .../protobuf/codegen/cosmwasm/rpc.query.ts | 3 + .../types/protobuf/codegen/cosmwasm/rpc.tx.ts | 3 + .../types/protobuf/codegen/gaia/bundle.ts | 36 +- .../types/protobuf/codegen/gaia/rpc.query.ts | 3 + .../types/protobuf/codegen/gaia/rpc.tx.ts | 3 + .../protobuf/codegen/gogoproto/bundle.ts | 4 +- .../types/protobuf/codegen/google/bundle.ts | 28 +- packages/types/protobuf/codegen/ibc/bundle.ts | 172 ++--- .../types/protobuf/codegen/ibc/rpc.query.ts | 3 + packages/types/protobuf/codegen/ibc/rpc.tx.ts | 3 + .../types/protobuf/codegen/juno/bundle.ts | 72 +- .../types/protobuf/codegen/juno/rpc.query.ts | 3 + .../types/protobuf/codegen/juno/rpc.tx.ts | 3 + .../types/protobuf/codegen/kujira/bundle.ts | 86 +-- .../protobuf/codegen/kujira/rpc.query.ts | 3 + .../types/protobuf/codegen/kujira/rpc.tx.ts | 3 + .../types/protobuf/codegen/neutron/bundle.ts | 214 +++--- .../protobuf/codegen/neutron/rpc.query.ts | 3 + .../types/protobuf/codegen/neutron/rpc.tx.ts | 3 + .../types/protobuf/codegen/noble/bundle.ts | 20 +- .../types/protobuf/codegen/noble/rpc.query.ts | 3 + .../types/protobuf/codegen/osmosis/bundle.ts | 444 ++++++------ .../protobuf/codegen/osmosis/rpc.query.ts | 3 + .../types/protobuf/codegen/osmosis/rpc.tx.ts | 3 + .../protobuf/codegen/publicawesome/bundle.ts | 122 ++-- .../codegen/publicawesome/rpc.query.ts | 3 + .../protobuf/codegen/publicawesome/rpc.tx.ts | 3 + .../types/protobuf/codegen/regen/bundle.ts | 188 +++--- .../types/protobuf/codegen/regen/rpc.query.ts | 3 + .../types/protobuf/codegen/regen/rpc.tx.ts | 3 + .../protobuf/codegen/tendermint/bundle.ts | 40 +- .../proto/cosmos/feegrant/v1beta1/query.proto | 15 +- .../proto/cosmos/feegrant/v1beta1/tx.proto | 19 + packages/types/protobuf/scripts/codegen.js | 2 + 53 files changed, 3199 insertions(+), 933 deletions(-) create mode 100644 packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/feegrant.ts create mode 100644 packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/genesis.ts create mode 100644 packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/query.rpc.Query.ts create mode 100644 packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/query.ts create mode 100644 packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/tx.amino.ts create mode 100644 packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/tx.registry.ts create mode 100644 packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/tx.rpc.msg.ts create mode 100644 packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/tx.ts diff --git a/packages/types/protobuf/codegen/alliance/bundle.ts b/packages/types/protobuf/codegen/alliance/bundle.ts index 0635ab8ee..e8c137010 100644 --- a/packages/types/protobuf/codegen/alliance/bundle.ts +++ b/packages/types/protobuf/codegen/alliance/bundle.ts @@ -8,12 +8,12 @@ import * as _6 from "./alliance/query"; import * as _7 from "./alliance/redelegations"; import * as _8 from "./alliance/tx"; import * as _9 from "./alliance/unbonding"; -import * as _320 from "./alliance/tx.amino"; -import * as _321 from "./alliance/tx.registry"; -import * as _322 from "./alliance/query.rpc.Query"; -import * as _323 from "./alliance/tx.rpc.msg"; -import * as _531 from "./rpc.query"; -import * as _532 from "./rpc.tx"; +import * as _324 from "./alliance/tx.amino"; +import * as _325 from "./alliance/tx.registry"; +import * as _326 from "./alliance/query.rpc.Query"; +import * as _327 from "./alliance/tx.rpc.msg"; +import * as _539 from "./rpc.query"; +import * as _540 from "./rpc.tx"; export namespace alliance { export const alliance = { ..._0, @@ -26,13 +26,13 @@ export namespace alliance { ..._7, ..._8, ..._9, - ..._320, - ..._321, - ..._322, - ..._323 + ..._324, + ..._325, + ..._326, + ..._327 }; export const ClientFactory = { - ..._531, - ..._532 + ..._539, + ..._540 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/alliance/rpc.query.ts b/packages/types/protobuf/codegen/alliance/rpc.query.ts index af86e0465..5b1ec6a9e 100644 --- a/packages/types/protobuf/codegen/alliance/rpc.query.ts +++ b/packages/types/protobuf/codegen/alliance/rpc.query.ts @@ -29,6 +29,9 @@ export const createRPCQueryClient = async ({ distribution: { v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, gov: { v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) diff --git a/packages/types/protobuf/codegen/alliance/rpc.tx.ts b/packages/types/protobuf/codegen/alliance/rpc.tx.ts index e62e19951..2782bd639 100644 --- a/packages/types/protobuf/codegen/alliance/rpc.tx.ts +++ b/packages/types/protobuf/codegen/alliance/rpc.tx.ts @@ -20,6 +20,9 @@ export const createRPCMsgClient = async ({ distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, gov: { v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) diff --git a/packages/types/protobuf/codegen/circle/bundle.ts b/packages/types/protobuf/codegen/circle/bundle.ts index 798e94eeb..37545a6f0 100644 --- a/packages/types/protobuf/codegen/circle/bundle.ts +++ b/packages/types/protobuf/codegen/circle/bundle.ts @@ -14,12 +14,12 @@ import * as _23 from "./cctp/v1/sending_and_receiving_messages_paused"; import * as _24 from "./cctp/v1/signature_threshold"; import * as _25 from "./cctp/v1/token_pair"; import * as _26 from "./cctp/v1/tx"; -import * as _324 from "./cctp/v1/tx.amino"; -import * as _325 from "./cctp/v1/tx.registry"; -import * as _326 from "./cctp/v1/query.rpc.Query"; -import * as _327 from "./cctp/v1/tx.rpc.msg"; -import * as _533 from "./rpc.query"; -import * as _534 from "./rpc.tx"; +import * as _328 from "./cctp/v1/tx.amino"; +import * as _329 from "./cctp/v1/tx.registry"; +import * as _330 from "./cctp/v1/query.rpc.Query"; +import * as _331 from "./cctp/v1/tx.rpc.msg"; +import * as _541 from "./rpc.query"; +import * as _542 from "./rpc.tx"; export namespace circle { export namespace cctp { export const v1 = { @@ -39,14 +39,14 @@ export namespace circle { ..._24, ..._25, ..._26, - ..._324, - ..._325, - ..._326, - ..._327 + ..._328, + ..._329, + ..._330, + ..._331 }; } export const ClientFactory = { - ..._533, - ..._534 + ..._541, + ..._542 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/circle/rpc.query.ts b/packages/types/protobuf/codegen/circle/rpc.query.ts index 7213a5194..4de7815ea 100644 --- a/packages/types/protobuf/codegen/circle/rpc.query.ts +++ b/packages/types/protobuf/codegen/circle/rpc.query.ts @@ -31,6 +31,9 @@ export const createRPCQueryClient = async ({ distribution: { v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, gov: { v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) diff --git a/packages/types/protobuf/codegen/circle/rpc.tx.ts b/packages/types/protobuf/codegen/circle/rpc.tx.ts index 2d596d6e8..3533e340e 100644 --- a/packages/types/protobuf/codegen/circle/rpc.tx.ts +++ b/packages/types/protobuf/codegen/circle/rpc.tx.ts @@ -22,6 +22,9 @@ export const createRPCMsgClient = async ({ distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, gov: { v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) diff --git a/packages/types/protobuf/codegen/cosmos/bundle.ts b/packages/types/protobuf/codegen/cosmos/bundle.ts index f8c100a75..46c611a39 100644 --- a/packages/types/protobuf/codegen/cosmos/bundle.ts +++ b/packages/types/protobuf/codegen/cosmos/bundle.ts @@ -24,83 +24,91 @@ import * as _50 from "./distribution/v1beta1/distribution"; import * as _51 from "./distribution/v1beta1/genesis"; import * as _52 from "./distribution/v1beta1/query"; import * as _53 from "./distribution/v1beta1/tx"; -import * as _54 from "./gov/v1/genesis"; -import * as _55 from "./gov/v1/gov"; -import * as _56 from "./gov/v1/query"; -import * as _57 from "./gov/v1/tx"; -import * as _58 from "./gov/v1beta1/genesis"; -import * as _59 from "./gov/v1beta1/gov"; -import * as _60 from "./gov/v1beta1/query"; -import * as _61 from "./gov/v1beta1/tx"; -import * as _62 from "./mint/v1beta1/genesis"; -import * as _63 from "./mint/v1beta1/mint"; -import * as _64 from "./mint/v1beta1/query"; -import * as _65 from "./mint/v1beta1/tx"; -import * as _66 from "./msg/v1/msg"; -import * as _67 from "./orm/v1/orm"; -import * as _68 from "./params/v1beta1/params"; -import * as _69 from "./params/v1beta1/query"; -import * as _70 from "./query/v1/query"; -import * as _71 from "./slashing/v1beta1/genesis"; -import * as _72 from "./slashing/v1beta1/query"; -import * as _73 from "./slashing/v1beta1/slashing"; -import * as _74 from "./slashing/v1beta1/tx"; -import * as _75 from "./staking/v1beta1/authz"; -import * as _76 from "./staking/v1beta1/genesis"; -import * as _77 from "./staking/v1beta1/query"; -import * as _78 from "./staking/v1beta1/staking"; -import * as _79 from "./staking/v1beta1/tx"; -import * as _80 from "./tx/signing/v1beta1/signing"; -import * as _81 from "./tx/v1beta1/service"; -import * as _82 from "./tx/v1beta1/tx"; -import * as _83 from "./upgrade/v1beta1/query"; -import * as _84 from "./upgrade/v1beta1/tx"; -import * as _85 from "./upgrade/v1beta1/upgrade"; -import * as _328 from "./auth/v1beta1/tx.amino"; -import * as _329 from "./authz/v1beta1/tx.amino"; -import * as _330 from "./bank/v1beta1/tx.amino"; -import * as _331 from "./distribution/v1beta1/tx.amino"; -import * as _332 from "./gov/v1/tx.amino"; -import * as _333 from "./gov/v1beta1/tx.amino"; -import * as _334 from "./mint/v1beta1/tx.amino"; -import * as _335 from "./slashing/v1beta1/tx.amino"; -import * as _336 from "./staking/v1beta1/tx.amino"; -import * as _337 from "./upgrade/v1beta1/tx.amino"; -import * as _338 from "./auth/v1beta1/tx.registry"; -import * as _339 from "./authz/v1beta1/tx.registry"; -import * as _340 from "./bank/v1beta1/tx.registry"; -import * as _341 from "./distribution/v1beta1/tx.registry"; -import * as _342 from "./gov/v1/tx.registry"; -import * as _343 from "./gov/v1beta1/tx.registry"; -import * as _344 from "./mint/v1beta1/tx.registry"; -import * as _345 from "./slashing/v1beta1/tx.registry"; -import * as _346 from "./staking/v1beta1/tx.registry"; -import * as _347 from "./upgrade/v1beta1/tx.registry"; -import * as _348 from "./auth/v1beta1/query.rpc.Query"; -import * as _349 from "./authz/v1beta1/query.rpc.Query"; -import * as _350 from "./bank/v1beta1/query.rpc.Query"; -import * as _351 from "./base/tendermint/v1beta1/query.rpc.Service"; -import * as _352 from "./distribution/v1beta1/query.rpc.Query"; -import * as _353 from "./gov/v1/query.rpc.Query"; -import * as _354 from "./gov/v1beta1/query.rpc.Query"; -import * as _355 from "./mint/v1beta1/query.rpc.Query"; -import * as _356 from "./params/v1beta1/query.rpc.Query"; -import * as _357 from "./slashing/v1beta1/query.rpc.Query"; -import * as _358 from "./staking/v1beta1/query.rpc.Query"; -import * as _359 from "./tx/v1beta1/service.rpc.Service"; -import * as _360 from "./upgrade/v1beta1/query.rpc.Query"; -import * as _361 from "./auth/v1beta1/tx.rpc.msg"; -import * as _362 from "./authz/v1beta1/tx.rpc.msg"; -import * as _363 from "./bank/v1beta1/tx.rpc.msg"; -import * as _364 from "./distribution/v1beta1/tx.rpc.msg"; -import * as _365 from "./gov/v1/tx.rpc.msg"; -import * as _366 from "./gov/v1beta1/tx.rpc.msg"; -import * as _367 from "./mint/v1beta1/tx.rpc.msg"; -import * as _368 from "./slashing/v1beta1/tx.rpc.msg"; -import * as _369 from "./staking/v1beta1/tx.rpc.msg"; -import * as _370 from "./upgrade/v1beta1/tx.rpc.msg"; -import * as _535 from "./rpc.query"; -import * as _536 from "./rpc.tx"; +import * as _54 from "./feegrant/v1beta1/feegrant"; +import * as _55 from "./feegrant/v1beta1/genesis"; +import * as _56 from "./feegrant/v1beta1/query"; +import * as _57 from "./feegrant/v1beta1/tx"; +import * as _58 from "./gov/v1/genesis"; +import * as _59 from "./gov/v1/gov"; +import * as _60 from "./gov/v1/query"; +import * as _61 from "./gov/v1/tx"; +import * as _62 from "./gov/v1beta1/genesis"; +import * as _63 from "./gov/v1beta1/gov"; +import * as _64 from "./gov/v1beta1/query"; +import * as _65 from "./gov/v1beta1/tx"; +import * as _66 from "./mint/v1beta1/genesis"; +import * as _67 from "./mint/v1beta1/mint"; +import * as _68 from "./mint/v1beta1/query"; +import * as _69 from "./mint/v1beta1/tx"; +import * as _70 from "./msg/v1/msg"; +import * as _71 from "./orm/v1/orm"; +import * as _72 from "./params/v1beta1/params"; +import * as _73 from "./params/v1beta1/query"; +import * as _74 from "./query/v1/query"; +import * as _75 from "./slashing/v1beta1/genesis"; +import * as _76 from "./slashing/v1beta1/query"; +import * as _77 from "./slashing/v1beta1/slashing"; +import * as _78 from "./slashing/v1beta1/tx"; +import * as _79 from "./staking/v1beta1/authz"; +import * as _80 from "./staking/v1beta1/genesis"; +import * as _81 from "./staking/v1beta1/query"; +import * as _82 from "./staking/v1beta1/staking"; +import * as _83 from "./staking/v1beta1/tx"; +import * as _84 from "./tx/signing/v1beta1/signing"; +import * as _85 from "./tx/v1beta1/service"; +import * as _86 from "./tx/v1beta1/tx"; +import * as _87 from "./upgrade/v1beta1/query"; +import * as _88 from "./upgrade/v1beta1/tx"; +import * as _89 from "./upgrade/v1beta1/upgrade"; +import * as _332 from "./auth/v1beta1/tx.amino"; +import * as _333 from "./authz/v1beta1/tx.amino"; +import * as _334 from "./bank/v1beta1/tx.amino"; +import * as _335 from "./distribution/v1beta1/tx.amino"; +import * as _336 from "./feegrant/v1beta1/tx.amino"; +import * as _337 from "./gov/v1/tx.amino"; +import * as _338 from "./gov/v1beta1/tx.amino"; +import * as _339 from "./mint/v1beta1/tx.amino"; +import * as _340 from "./slashing/v1beta1/tx.amino"; +import * as _341 from "./staking/v1beta1/tx.amino"; +import * as _342 from "./upgrade/v1beta1/tx.amino"; +import * as _343 from "./auth/v1beta1/tx.registry"; +import * as _344 from "./authz/v1beta1/tx.registry"; +import * as _345 from "./bank/v1beta1/tx.registry"; +import * as _346 from "./distribution/v1beta1/tx.registry"; +import * as _347 from "./feegrant/v1beta1/tx.registry"; +import * as _348 from "./gov/v1/tx.registry"; +import * as _349 from "./gov/v1beta1/tx.registry"; +import * as _350 from "./mint/v1beta1/tx.registry"; +import * as _351 from "./slashing/v1beta1/tx.registry"; +import * as _352 from "./staking/v1beta1/tx.registry"; +import * as _353 from "./upgrade/v1beta1/tx.registry"; +import * as _354 from "./auth/v1beta1/query.rpc.Query"; +import * as _355 from "./authz/v1beta1/query.rpc.Query"; +import * as _356 from "./bank/v1beta1/query.rpc.Query"; +import * as _357 from "./base/tendermint/v1beta1/query.rpc.Service"; +import * as _358 from "./distribution/v1beta1/query.rpc.Query"; +import * as _359 from "./feegrant/v1beta1/query.rpc.Query"; +import * as _360 from "./gov/v1/query.rpc.Query"; +import * as _361 from "./gov/v1beta1/query.rpc.Query"; +import * as _362 from "./mint/v1beta1/query.rpc.Query"; +import * as _363 from "./params/v1beta1/query.rpc.Query"; +import * as _364 from "./slashing/v1beta1/query.rpc.Query"; +import * as _365 from "./staking/v1beta1/query.rpc.Query"; +import * as _366 from "./tx/v1beta1/service.rpc.Service"; +import * as _367 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _368 from "./auth/v1beta1/tx.rpc.msg"; +import * as _369 from "./authz/v1beta1/tx.rpc.msg"; +import * as _370 from "./bank/v1beta1/tx.rpc.msg"; +import * as _371 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _372 from "./feegrant/v1beta1/tx.rpc.msg"; +import * as _373 from "./gov/v1/tx.rpc.msg"; +import * as _374 from "./gov/v1beta1/tx.rpc.msg"; +import * as _375 from "./mint/v1beta1/tx.rpc.msg"; +import * as _376 from "./slashing/v1beta1/tx.rpc.msg"; +import * as _377 from "./staking/v1beta1/tx.rpc.msg"; +import * as _378 from "./upgrade/v1beta1/tx.rpc.msg"; +import * as _543 from "./rpc.query"; +import * as _544 from "./rpc.tx"; export namespace cosmos { export namespace auth { export const v1beta1 = { @@ -108,10 +116,10 @@ export namespace cosmos { ..._29, ..._30, ..._31, - ..._328, - ..._338, - ..._348, - ..._361 + ..._332, + ..._343, + ..._354, + ..._368 }; } export namespace authz { @@ -121,10 +129,10 @@ export namespace cosmos { ..._34, ..._35, ..._36, - ..._329, - ..._339, - ..._349, - ..._362 + ..._333, + ..._344, + ..._355, + ..._369 }; } export namespace bank { @@ -134,10 +142,10 @@ export namespace cosmos { ..._39, ..._40, ..._41, - ..._330, - ..._340, - ..._350, - ..._363 + ..._334, + ..._345, + ..._356, + ..._370 }; } export namespace base { @@ -155,7 +163,7 @@ export namespace cosmos { export const v1beta1 = { ..._44, ..._45, - ..._351 + ..._357 }; } export const v1beta1 = { @@ -179,118 +187,130 @@ export namespace cosmos { ..._51, ..._52, ..._53, - ..._331, - ..._341, - ..._352, - ..._364 + ..._335, + ..._346, + ..._358, + ..._371 }; } - export namespace gov { - export const v1 = { + export namespace feegrant { + export const v1beta1 = { ..._54, ..._55, ..._56, ..._57, - ..._332, - ..._342, - ..._353, - ..._365 + ..._336, + ..._347, + ..._359, + ..._372 }; - export const v1beta1 = { + } + export namespace gov { + export const v1 = { ..._58, ..._59, ..._60, ..._61, - ..._333, - ..._343, - ..._354, - ..._366 + ..._337, + ..._348, + ..._360, + ..._373 }; - } - export namespace mint { export const v1beta1 = { ..._62, ..._63, ..._64, ..._65, - ..._334, - ..._344, - ..._355, - ..._367 + ..._338, + ..._349, + ..._361, + ..._374 + }; + } + export namespace mint { + export const v1beta1 = { + ..._66, + ..._67, + ..._68, + ..._69, + ..._339, + ..._350, + ..._362, + ..._375 }; } export namespace msg { export const v1 = { - ..._66 + ..._70 }; } export namespace orm { export const v1 = { - ..._67 + ..._71 }; } export namespace params { export const v1beta1 = { - ..._68, - ..._69, - ..._356 + ..._72, + ..._73, + ..._363 }; } export namespace query { export const v1 = { - ..._70 + ..._74 }; } export namespace slashing { - export const v1beta1 = { - ..._71, - ..._72, - ..._73, - ..._74, - ..._335, - ..._345, - ..._357, - ..._368 - }; - } - export namespace staking { export const v1beta1 = { ..._75, ..._76, ..._77, ..._78, + ..._340, + ..._351, + ..._364, + ..._376 + }; + } + export namespace staking { + export const v1beta1 = { ..._79, - ..._336, - ..._346, - ..._358, - ..._369 + ..._80, + ..._81, + ..._82, + ..._83, + ..._341, + ..._352, + ..._365, + ..._377 }; } export namespace tx { export namespace signing { export const v1beta1 = { - ..._80 + ..._84 }; } export const v1beta1 = { - ..._81, - ..._82, - ..._359 + ..._85, + ..._86, + ..._366 }; } export namespace upgrade { export const v1beta1 = { - ..._83, - ..._84, - ..._85, - ..._337, - ..._347, - ..._360, - ..._370 + ..._87, + ..._88, + ..._89, + ..._342, + ..._353, + ..._367, + ..._378 }; } export const ClientFactory = { - ..._535, - ..._536 + ..._543, + ..._544 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/client.ts b/packages/types/protobuf/codegen/cosmos/client.ts index 7df3dac9d..a0691dfb2 100644 --- a/packages/types/protobuf/codegen/cosmos/client.ts +++ b/packages/types/protobuf/codegen/cosmos/client.ts @@ -5,6 +5,7 @@ import * as cosmosAuthV1beta1TxRegistry from "./auth/v1beta1/tx.registry"; import * as cosmosAuthzV1beta1TxRegistry from "./authz/v1beta1/tx.registry"; import * as cosmosBankV1beta1TxRegistry from "./bank/v1beta1/tx.registry"; import * as cosmosDistributionV1beta1TxRegistry from "./distribution/v1beta1/tx.registry"; +import * as cosmosFeegrantV1beta1TxRegistry from "./feegrant/v1beta1/tx.registry"; import * as cosmosGovV1TxRegistry from "./gov/v1/tx.registry"; import * as cosmosGovV1beta1TxRegistry from "./gov/v1beta1/tx.registry"; import * as cosmosMintV1beta1TxRegistry from "./mint/v1beta1/tx.registry"; @@ -15,6 +16,7 @@ import * as cosmosAuthV1beta1TxAmino from "./auth/v1beta1/tx.amino"; import * as cosmosAuthzV1beta1TxAmino from "./authz/v1beta1/tx.amino"; import * as cosmosBankV1beta1TxAmino from "./bank/v1beta1/tx.amino"; import * as cosmosDistributionV1beta1TxAmino from "./distribution/v1beta1/tx.amino"; +import * as cosmosFeegrantV1beta1TxAmino from "./feegrant/v1beta1/tx.amino"; import * as cosmosGovV1TxAmino from "./gov/v1/tx.amino"; import * as cosmosGovV1beta1TxAmino from "./gov/v1beta1/tx.amino"; import * as cosmosMintV1beta1TxAmino from "./mint/v1beta1/tx.amino"; @@ -26,6 +28,7 @@ export const cosmosAminoConverters = { ...cosmosAuthzV1beta1TxAmino.AminoConverter, ...cosmosBankV1beta1TxAmino.AminoConverter, ...cosmosDistributionV1beta1TxAmino.AminoConverter, + ...cosmosFeegrantV1beta1TxAmino.AminoConverter, ...cosmosGovV1TxAmino.AminoConverter, ...cosmosGovV1beta1TxAmino.AminoConverter, ...cosmosMintV1beta1TxAmino.AminoConverter, @@ -33,7 +36,7 @@ export const cosmosAminoConverters = { ...cosmosStakingV1beta1TxAmino.AminoConverter, ...cosmosUpgradeV1beta1TxAmino.AminoConverter }; -export const cosmosProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...cosmosAuthV1beta1TxRegistry.registry, ...cosmosAuthzV1beta1TxRegistry.registry, ...cosmosBankV1beta1TxRegistry.registry, ...cosmosDistributionV1beta1TxRegistry.registry, ...cosmosGovV1TxRegistry.registry, ...cosmosGovV1beta1TxRegistry.registry, ...cosmosMintV1beta1TxRegistry.registry, ...cosmosSlashingV1beta1TxRegistry.registry, ...cosmosStakingV1beta1TxRegistry.registry, ...cosmosUpgradeV1beta1TxRegistry.registry]; +export const cosmosProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...cosmosAuthV1beta1TxRegistry.registry, ...cosmosAuthzV1beta1TxRegistry.registry, ...cosmosBankV1beta1TxRegistry.registry, ...cosmosDistributionV1beta1TxRegistry.registry, ...cosmosFeegrantV1beta1TxRegistry.registry, ...cosmosGovV1TxRegistry.registry, ...cosmosGovV1beta1TxRegistry.registry, ...cosmosMintV1beta1TxRegistry.registry, ...cosmosSlashingV1beta1TxRegistry.registry, ...cosmosStakingV1beta1TxRegistry.registry, ...cosmosUpgradeV1beta1TxRegistry.registry]; export const getSigningCosmosClientOptions = (): { registry: Registry; aminoTypes: AminoTypes; diff --git a/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/feegrant.ts b/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/feegrant.ts new file mode 100644 index 000000000..4e3373aa9 --- /dev/null +++ b/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/feegrant.ts @@ -0,0 +1,632 @@ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +/** + * BasicAllowance implements Allowance with a one-time grant of coins + * that optionally expires. The grantee can use up to SpendLimit to cover fees. + */ +export interface BasicAllowance { + $typeUrl?: "/cosmos.feegrant.v1beta1.BasicAllowance"; + /** + * spend_limit specifies the maximum amount of coins that can be spent + * by this allowance and will be updated as coins are spent. If it is + * empty, there is no spend limit and any amount of coins can be spent. + */ + spendLimit: Coin[]; + /** expiration specifies an optional time when this allowance expires */ + expiration?: Date | undefined; +} +export interface BasicAllowanceProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.BasicAllowance"; + value: Uint8Array; +} +/** + * BasicAllowance implements Allowance with a one-time grant of coins + * that optionally expires. The grantee can use up to SpendLimit to cover fees. + */ +export interface BasicAllowanceAmino { + /** + * spend_limit specifies the maximum amount of coins that can be spent + * by this allowance and will be updated as coins are spent. If it is + * empty, there is no spend limit and any amount of coins can be spent. + */ + spend_limit: CoinAmino[]; + /** expiration specifies an optional time when this allowance expires */ + expiration?: string | undefined; +} +export interface BasicAllowanceAminoMsg { + type: "cosmos-sdk/BasicAllowance"; + value: BasicAllowanceAmino; +} +/** + * BasicAllowance implements Allowance with a one-time grant of coins + * that optionally expires. The grantee can use up to SpendLimit to cover fees. + */ +export interface BasicAllowanceSDKType { + $typeUrl?: "/cosmos.feegrant.v1beta1.BasicAllowance"; + spend_limit: CoinSDKType[]; + expiration?: Date | undefined; +} +/** + * PeriodicAllowance extends Allowance to allow for both a maximum cap, + * as well as a limit per time period. + */ +export interface PeriodicAllowance { + $typeUrl?: "/cosmos.feegrant.v1beta1.PeriodicAllowance"; + /** basic specifies a struct of `BasicAllowance` */ + basic: BasicAllowance | undefined; + /** + * period specifies the time duration in which period_spend_limit coins can + * be spent before that allowance is reset + */ + period: Duration | undefined; + /** + * period_spend_limit specifies the maximum number of coins that can be spent + * in the period + */ + periodSpendLimit: Coin[]; + /** period_can_spend is the number of coins left to be spent before the period_reset time */ + periodCanSpend: Coin[]; + /** + * period_reset is the time at which this period resets and a new one begins, + * it is calculated from the start time of the first transaction after the + * last period ended + */ + periodReset: Date | undefined; +} +export interface PeriodicAllowanceProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.PeriodicAllowance"; + value: Uint8Array; +} +/** + * PeriodicAllowance extends Allowance to allow for both a maximum cap, + * as well as a limit per time period. + */ +export interface PeriodicAllowanceAmino { + /** basic specifies a struct of `BasicAllowance` */ + basic: BasicAllowanceAmino | undefined; + /** + * period specifies the time duration in which period_spend_limit coins can + * be spent before that allowance is reset + */ + period: DurationAmino | undefined; + /** + * period_spend_limit specifies the maximum number of coins that can be spent + * in the period + */ + period_spend_limit: CoinAmino[]; + /** period_can_spend is the number of coins left to be spent before the period_reset time */ + period_can_spend: CoinAmino[]; + /** + * period_reset is the time at which this period resets and a new one begins, + * it is calculated from the start time of the first transaction after the + * last period ended + */ + period_reset: string | undefined; +} +export interface PeriodicAllowanceAminoMsg { + type: "cosmos-sdk/PeriodicAllowance"; + value: PeriodicAllowanceAmino; +} +/** + * PeriodicAllowance extends Allowance to allow for both a maximum cap, + * as well as a limit per time period. + */ +export interface PeriodicAllowanceSDKType { + $typeUrl?: "/cosmos.feegrant.v1beta1.PeriodicAllowance"; + basic: BasicAllowanceSDKType | undefined; + period: DurationSDKType | undefined; + period_spend_limit: CoinSDKType[]; + period_can_spend: CoinSDKType[]; + period_reset: Date | undefined; +} +/** AllowedMsgAllowance creates allowance only for specified message types. */ +export interface AllowedMsgAllowance { + $typeUrl?: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance"; + /** allowance can be any of basic and periodic fee allowance. */ + allowance?: (BasicAllowance & PeriodicAllowance & AllowedMsgAllowance & Any) | undefined; + /** allowed_messages are the messages for which the grantee has the access. */ + allowedMessages: string[]; +} +export interface AllowedMsgAllowanceProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance"; + value: Uint8Array; +} +export type AllowedMsgAllowanceEncoded = Omit & { + /** allowance can be any of basic and periodic fee allowance. */allowance?: BasicAllowanceProtoMsg | PeriodicAllowanceProtoMsg | AllowedMsgAllowanceProtoMsg | AnyProtoMsg | undefined; +}; +/** AllowedMsgAllowance creates allowance only for specified message types. */ +export interface AllowedMsgAllowanceAmino { + /** allowance can be any of basic and periodic fee allowance. */ + allowance?: AnyAmino | undefined; + /** allowed_messages are the messages for which the grantee has the access. */ + allowed_messages?: string[]; +} +export interface AllowedMsgAllowanceAminoMsg { + type: "cosmos-sdk/AllowedMsgAllowance"; + value: AllowedMsgAllowanceAmino; +} +/** AllowedMsgAllowance creates allowance only for specified message types. */ +export interface AllowedMsgAllowanceSDKType { + $typeUrl?: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance"; + allowance?: BasicAllowanceSDKType | PeriodicAllowanceSDKType | AllowedMsgAllowanceSDKType | AnySDKType | undefined; + allowed_messages: string[]; +} +/** Grant is stored in the KVStore to record a grant with full context */ +export interface Grant { + /** granter is the address of the user granting an allowance of their funds. */ + granter: string; + /** grantee is the address of the user being granted an allowance of another user's funds. */ + grantee: string; + /** allowance can be any of basic, periodic, allowed fee allowance. */ + allowance?: (BasicAllowance & PeriodicAllowance & AllowedMsgAllowance & Any) | undefined; +} +export interface GrantProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.Grant"; + value: Uint8Array; +} +export type GrantEncoded = Omit & { + /** allowance can be any of basic, periodic, allowed fee allowance. */allowance?: BasicAllowanceProtoMsg | PeriodicAllowanceProtoMsg | AllowedMsgAllowanceProtoMsg | AnyProtoMsg | undefined; +}; +/** Grant is stored in the KVStore to record a grant with full context */ +export interface GrantAmino { + /** granter is the address of the user granting an allowance of their funds. */ + granter?: string; + /** grantee is the address of the user being granted an allowance of another user's funds. */ + grantee?: string; + /** allowance can be any of basic, periodic, allowed fee allowance. */ + allowance?: AnyAmino | undefined; +} +export interface GrantAminoMsg { + type: "cosmos-sdk/Grant"; + value: GrantAmino; +} +/** Grant is stored in the KVStore to record a grant with full context */ +export interface GrantSDKType { + granter: string; + grantee: string; + allowance?: BasicAllowanceSDKType | PeriodicAllowanceSDKType | AllowedMsgAllowanceSDKType | AnySDKType | undefined; +} +function createBaseBasicAllowance(): BasicAllowance { + return { + $typeUrl: "/cosmos.feegrant.v1beta1.BasicAllowance", + spendLimit: [], + expiration: undefined + }; +} +export const BasicAllowance = { + typeUrl: "/cosmos.feegrant.v1beta1.BasicAllowance", + encode(message: BasicAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.spendLimit) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.expiration !== undefined) { + Timestamp.encode(toTimestamp(message.expiration), writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): BasicAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBasicAllowance(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.spendLimit.push(Coin.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.expiration = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BasicAllowance { + const message = createBaseBasicAllowance(); + message.spendLimit = object.spendLimit?.map(e => Coin.fromPartial(e)) || []; + message.expiration = object.expiration ?? undefined; + return message; + }, + fromAmino(object: BasicAllowanceAmino): BasicAllowance { + const message = createBaseBasicAllowance(); + message.spendLimit = object.spend_limit?.map(e => Coin.fromAmino(e)) || []; + if (object.expiration !== undefined && object.expiration !== null) { + message.expiration = fromTimestamp(Timestamp.fromAmino(object.expiration)); + } + return message; + }, + toAmino(message: BasicAllowance, useInterfaces: boolean = false): BasicAllowanceAmino { + const obj: any = {}; + if (message.spendLimit) { + obj.spend_limit = message.spendLimit.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); + } else { + obj.spend_limit = []; + } + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; + return obj; + }, + fromAminoMsg(object: BasicAllowanceAminoMsg): BasicAllowance { + return BasicAllowance.fromAmino(object.value); + }, + toAminoMsg(message: BasicAllowance, useInterfaces: boolean = false): BasicAllowanceAminoMsg { + return { + type: "cosmos-sdk/BasicAllowance", + value: BasicAllowance.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: BasicAllowanceProtoMsg, useInterfaces: boolean = false): BasicAllowance { + return BasicAllowance.decode(message.value, undefined, useInterfaces); + }, + toProto(message: BasicAllowance): Uint8Array { + return BasicAllowance.encode(message).finish(); + }, + toProtoMsg(message: BasicAllowance): BasicAllowanceProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.BasicAllowance", + value: BasicAllowance.encode(message).finish() + }; + } +}; +function createBasePeriodicAllowance(): PeriodicAllowance { + return { + $typeUrl: "/cosmos.feegrant.v1beta1.PeriodicAllowance", + basic: BasicAllowance.fromPartial({}), + period: Duration.fromPartial({}), + periodSpendLimit: [], + periodCanSpend: [], + periodReset: new Date() + }; +} +export const PeriodicAllowance = { + typeUrl: "/cosmos.feegrant.v1beta1.PeriodicAllowance", + encode(message: PeriodicAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.basic !== undefined) { + BasicAllowance.encode(message.basic, writer.uint32(10).fork()).ldelim(); + } + if (message.period !== undefined) { + Duration.encode(message.period, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.periodSpendLimit) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.periodCanSpend) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.periodReset !== undefined) { + Timestamp.encode(toTimestamp(message.periodReset), writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): PeriodicAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePeriodicAllowance(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.basic = BasicAllowance.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.period = Duration.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.periodSpendLimit.push(Coin.decode(reader, reader.uint32(), useInterfaces)); + break; + case 4: + message.periodCanSpend.push(Coin.decode(reader, reader.uint32(), useInterfaces)); + break; + case 5: + message.periodReset = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PeriodicAllowance { + const message = createBasePeriodicAllowance(); + message.basic = object.basic !== undefined && object.basic !== null ? BasicAllowance.fromPartial(object.basic) : undefined; + message.period = object.period !== undefined && object.period !== null ? Duration.fromPartial(object.period) : undefined; + message.periodSpendLimit = object.periodSpendLimit?.map(e => Coin.fromPartial(e)) || []; + message.periodCanSpend = object.periodCanSpend?.map(e => Coin.fromPartial(e)) || []; + message.periodReset = object.periodReset ?? undefined; + return message; + }, + fromAmino(object: PeriodicAllowanceAmino): PeriodicAllowance { + const message = createBasePeriodicAllowance(); + if (object.basic !== undefined && object.basic !== null) { + message.basic = BasicAllowance.fromAmino(object.basic); + } + if (object.period !== undefined && object.period !== null) { + message.period = Duration.fromAmino(object.period); + } + message.periodSpendLimit = object.period_spend_limit?.map(e => Coin.fromAmino(e)) || []; + message.periodCanSpend = object.period_can_spend?.map(e => Coin.fromAmino(e)) || []; + if (object.period_reset !== undefined && object.period_reset !== null) { + message.periodReset = fromTimestamp(Timestamp.fromAmino(object.period_reset)); + } + return message; + }, + toAmino(message: PeriodicAllowance, useInterfaces: boolean = false): PeriodicAllowanceAmino { + const obj: any = {}; + obj.basic = message.basic ? BasicAllowance.toAmino(message.basic, useInterfaces) : BasicAllowance.fromPartial({}); + obj.period = message.period ? Duration.toAmino(message.period, useInterfaces) : Duration.fromPartial({}); + if (message.periodSpendLimit) { + obj.period_spend_limit = message.periodSpendLimit.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); + } else { + obj.period_spend_limit = []; + } + if (message.periodCanSpend) { + obj.period_can_spend = message.periodCanSpend.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); + } else { + obj.period_can_spend = []; + } + obj.period_reset = message.periodReset ? Timestamp.toAmino(toTimestamp(message.periodReset)) : new Date(); + return obj; + }, + fromAminoMsg(object: PeriodicAllowanceAminoMsg): PeriodicAllowance { + return PeriodicAllowance.fromAmino(object.value); + }, + toAminoMsg(message: PeriodicAllowance, useInterfaces: boolean = false): PeriodicAllowanceAminoMsg { + return { + type: "cosmos-sdk/PeriodicAllowance", + value: PeriodicAllowance.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: PeriodicAllowanceProtoMsg, useInterfaces: boolean = false): PeriodicAllowance { + return PeriodicAllowance.decode(message.value, undefined, useInterfaces); + }, + toProto(message: PeriodicAllowance): Uint8Array { + return PeriodicAllowance.encode(message).finish(); + }, + toProtoMsg(message: PeriodicAllowance): PeriodicAllowanceProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.PeriodicAllowance", + value: PeriodicAllowance.encode(message).finish() + }; + } +}; +function createBaseAllowedMsgAllowance(): AllowedMsgAllowance { + return { + $typeUrl: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance", + allowance: undefined, + allowedMessages: [] + }; +} +export const AllowedMsgAllowance = { + typeUrl: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance", + encode(message: AllowedMsgAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.allowance !== undefined) { + Any.encode((message.allowance as Any), writer.uint32(10).fork()).ldelim(); + } + for (const v of message.allowedMessages) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): AllowedMsgAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAllowedMsgAllowance(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowance = useInterfaces ? (Cosmos_feegrantv1beta1FeeAllowanceI_InterfaceDecoder(reader) as Any) : Any.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.allowedMessages.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AllowedMsgAllowance { + const message = createBaseAllowedMsgAllowance(); + message.allowance = object.allowance !== undefined && object.allowance !== null ? Any.fromPartial(object.allowance) : undefined; + message.allowedMessages = object.allowedMessages?.map(e => e) || []; + return message; + }, + fromAmino(object: AllowedMsgAllowanceAmino): AllowedMsgAllowance { + const message = createBaseAllowedMsgAllowance(); + if (object.allowance !== undefined && object.allowance !== null) { + message.allowance = Cosmos_feegrantv1beta1FeeAllowanceI_FromAmino(object.allowance); + } + message.allowedMessages = object.allowed_messages?.map(e => e) || []; + return message; + }, + toAmino(message: AllowedMsgAllowance, useInterfaces: boolean = false): AllowedMsgAllowanceAmino { + const obj: any = {}; + obj.allowance = message.allowance ? Cosmos_feegrantv1beta1FeeAllowanceI_ToAmino((message.allowance as Any), useInterfaces) : undefined; + if (message.allowedMessages) { + obj.allowed_messages = message.allowedMessages.map(e => e); + } else { + obj.allowed_messages = []; + } + return obj; + }, + fromAminoMsg(object: AllowedMsgAllowanceAminoMsg): AllowedMsgAllowance { + return AllowedMsgAllowance.fromAmino(object.value); + }, + toAminoMsg(message: AllowedMsgAllowance, useInterfaces: boolean = false): AllowedMsgAllowanceAminoMsg { + return { + type: "cosmos-sdk/AllowedMsgAllowance", + value: AllowedMsgAllowance.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: AllowedMsgAllowanceProtoMsg, useInterfaces: boolean = false): AllowedMsgAllowance { + return AllowedMsgAllowance.decode(message.value, undefined, useInterfaces); + }, + toProto(message: AllowedMsgAllowance): Uint8Array { + return AllowedMsgAllowance.encode(message).finish(); + }, + toProtoMsg(message: AllowedMsgAllowance): AllowedMsgAllowanceProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance", + value: AllowedMsgAllowance.encode(message).finish() + }; + } +}; +function createBaseGrant(): Grant { + return { + granter: "", + grantee: "", + allowance: undefined + }; +} +export const Grant = { + typeUrl: "/cosmos.feegrant.v1beta1.Grant", + encode(message: Grant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.grantee !== "") { + writer.uint32(18).string(message.grantee); + } + if (message.allowance !== undefined) { + Any.encode((message.allowance as Any), writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Grant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.grantee = reader.string(); + break; + case 3: + message.allowance = useInterfaces ? (Cosmos_feegrantv1beta1FeeAllowanceI_InterfaceDecoder(reader) as Any) : Any.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Grant { + const message = createBaseGrant(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + message.allowance = object.allowance !== undefined && object.allowance !== null ? Any.fromPartial(object.allowance) : undefined; + return message; + }, + fromAmino(object: GrantAmino): Grant { + const message = createBaseGrant(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.allowance !== undefined && object.allowance !== null) { + message.allowance = Cosmos_feegrantv1beta1FeeAllowanceI_FromAmino(object.allowance); + } + return message; + }, + toAmino(message: Grant, useInterfaces: boolean = false): GrantAmino { + const obj: any = {}; + obj.granter = message.granter; + obj.grantee = message.grantee; + obj.allowance = message.allowance ? Cosmos_feegrantv1beta1FeeAllowanceI_ToAmino((message.allowance as Any), useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: GrantAminoMsg): Grant { + return Grant.fromAmino(object.value); + }, + toAminoMsg(message: Grant, useInterfaces: boolean = false): GrantAminoMsg { + return { + type: "cosmos-sdk/Grant", + value: Grant.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: GrantProtoMsg, useInterfaces: boolean = false): Grant { + return Grant.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Grant): Uint8Array { + return Grant.encode(message).finish(); + }, + toProtoMsg(message: Grant): GrantProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.Grant", + value: Grant.encode(message).finish() + }; + } +}; +export const Cosmos_feegrantv1beta1FeeAllowanceI_InterfaceDecoder = (input: BinaryReader | Uint8Array): BasicAllowance | PeriodicAllowance | AllowedMsgAllowance | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32(), true); + switch (data.typeUrl) { + case "/cosmos.feegrant.v1beta1.BasicAllowance": + return BasicAllowance.decode(data.value, undefined, true); + case "/cosmos.feegrant.v1beta1.PeriodicAllowance": + return PeriodicAllowance.decode(data.value, undefined, true); + case "/cosmos.feegrant.v1beta1.AllowedMsgAllowance": + return AllowedMsgAllowance.decode(data.value, undefined, true); + default: + return data; + } +}; +export const Cosmos_feegrantv1beta1FeeAllowanceI_FromAmino = (content: AnyAmino) => { + switch (content.type) { + case "cosmos-sdk/BasicAllowance": + return Any.fromPartial({ + typeUrl: "/cosmos.feegrant.v1beta1.BasicAllowance", + value: BasicAllowance.encode(BasicAllowance.fromPartial(BasicAllowance.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/PeriodicAllowance": + return Any.fromPartial({ + typeUrl: "/cosmos.feegrant.v1beta1.PeriodicAllowance", + value: PeriodicAllowance.encode(PeriodicAllowance.fromPartial(PeriodicAllowance.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/AllowedMsgAllowance": + return Any.fromPartial({ + typeUrl: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance", + value: AllowedMsgAllowance.encode(AllowedMsgAllowance.fromPartial(AllowedMsgAllowance.fromAmino(content.value))).finish() + }); + default: + return Any.fromAmino(content); + } +}; +export const Cosmos_feegrantv1beta1FeeAllowanceI_ToAmino = (content: Any, useInterfaces: boolean = false) => { + switch (content.typeUrl) { + case "/cosmos.feegrant.v1beta1.BasicAllowance": + return { + type: "cosmos-sdk/BasicAllowance", + value: BasicAllowance.toAmino(BasicAllowance.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/cosmos.feegrant.v1beta1.PeriodicAllowance": + return { + type: "cosmos-sdk/PeriodicAllowance", + value: PeriodicAllowance.toAmino(PeriodicAllowance.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/cosmos.feegrant.v1beta1.AllowedMsgAllowance": + return { + type: "cosmos-sdk/AllowedMsgAllowance", + value: AllowedMsgAllowance.toAmino(AllowedMsgAllowance.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + default: + return Any.toAmino(content, useInterfaces); + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/genesis.ts b/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/genesis.ts new file mode 100644 index 000000000..89d54a5e2 --- /dev/null +++ b/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/genesis.ts @@ -0,0 +1,94 @@ +//@ts-nocheck +import { Grant, GrantAmino, GrantSDKType } from "./feegrant"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** GenesisState contains a set of fee allowances, persisted from the store */ +export interface GenesisState { + allowances: Grant[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState contains a set of fee allowances, persisted from the store */ +export interface GenesisStateAmino { + allowances: GrantAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState contains a set of fee allowances, persisted from the store */ +export interface GenesisStateSDKType { + allowances: GrantSDKType[]; +} +function createBaseGenesisState(): GenesisState { + return { + allowances: [] + }; +} +export const GenesisState = { + typeUrl: "/cosmos.feegrant.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.allowances) { + Grant.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowances.push(Grant.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.allowances = object.allowances?.map(e => Grant.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.allowances = object.allowances?.map(e => Grant.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState, useInterfaces: boolean = false): GenesisStateAmino { + const obj: any = {}; + if (message.allowances) { + obj.allowances = message.allowances.map(e => e ? Grant.toAmino(e, useInterfaces) : undefined); + } else { + obj.allowances = []; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState, useInterfaces: boolean = false): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg, useInterfaces: boolean = false): GenesisState { + return GenesisState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/query.rpc.Query.ts new file mode 100644 index 000000000..e6508b11e --- /dev/null +++ b/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/query.rpc.Query.ts @@ -0,0 +1,52 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryAllowanceRequest, QueryAllowanceResponse, QueryAllowancesRequest, QueryAllowancesResponse, QueryAllowancesByGranterRequest, QueryAllowancesByGranterResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Allowance returns granted allowance to the grantee by the granter. */ + allowance(request: QueryAllowanceRequest): Promise; + /** Allowances returns all the grants for the given grantee address. */ + allowances(request: QueryAllowancesRequest): Promise; + /** AllowancesByGranter returns all the grants given by an address */ + allowancesByGranter(request: QueryAllowancesByGranterRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.allowance = this.allowance.bind(this); + this.allowances = this.allowances.bind(this); + this.allowancesByGranter = this.allowancesByGranter.bind(this); + } + allowance(request: QueryAllowanceRequest, useInterfaces: boolean = true): Promise { + const data = QueryAllowanceRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.feegrant.v1beta1.Query", "Allowance", data); + return promise.then(data => QueryAllowanceResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + allowances(request: QueryAllowancesRequest, useInterfaces: boolean = true): Promise { + const data = QueryAllowancesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.feegrant.v1beta1.Query", "Allowances", data); + return promise.then(data => QueryAllowancesResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + allowancesByGranter(request: QueryAllowancesByGranterRequest, useInterfaces: boolean = true): Promise { + const data = QueryAllowancesByGranterRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.feegrant.v1beta1.Query", "AllowancesByGranter", data); + return promise.then(data => QueryAllowancesByGranterResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + allowance(request: QueryAllowanceRequest, useInterfaces: boolean = true): Promise { + return queryService.allowance(request, useInterfaces); + }, + allowances(request: QueryAllowancesRequest, useInterfaces: boolean = true): Promise { + return queryService.allowances(request, useInterfaces); + }, + allowancesByGranter(request: QueryAllowancesByGranterRequest, useInterfaces: boolean = true): Promise { + return queryService.allowancesByGranter(request, useInterfaces); + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/query.ts b/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/query.ts new file mode 100644 index 000000000..d67304b7b --- /dev/null +++ b/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/query.ts @@ -0,0 +1,635 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; +import { Grant, GrantAmino, GrantSDKType } from "./feegrant"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryAllowanceRequest is the request type for the Query/Allowance RPC method. */ +export interface QueryAllowanceRequest { + /** granter is the address of the user granting an allowance of their funds. */ + granter: string; + /** grantee is the address of the user being granted an allowance of another user's funds. */ + grantee: string; +} +export interface QueryAllowanceRequestProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowanceRequest"; + value: Uint8Array; +} +/** QueryAllowanceRequest is the request type for the Query/Allowance RPC method. */ +export interface QueryAllowanceRequestAmino { + /** granter is the address of the user granting an allowance of their funds. */ + granter?: string; + /** grantee is the address of the user being granted an allowance of another user's funds. */ + grantee?: string; +} +export interface QueryAllowanceRequestAminoMsg { + type: "cosmos-sdk/QueryAllowanceRequest"; + value: QueryAllowanceRequestAmino; +} +/** QueryAllowanceRequest is the request type for the Query/Allowance RPC method. */ +export interface QueryAllowanceRequestSDKType { + granter: string; + grantee: string; +} +/** QueryAllowanceResponse is the response type for the Query/Allowance RPC method. */ +export interface QueryAllowanceResponse { + /** allowance is a allowance granted for grantee by granter. */ + allowance?: Grant | undefined; +} +export interface QueryAllowanceResponseProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowanceResponse"; + value: Uint8Array; +} +/** QueryAllowanceResponse is the response type for the Query/Allowance RPC method. */ +export interface QueryAllowanceResponseAmino { + /** allowance is a allowance granted for grantee by granter. */ + allowance?: GrantAmino | undefined; +} +export interface QueryAllowanceResponseAminoMsg { + type: "cosmos-sdk/QueryAllowanceResponse"; + value: QueryAllowanceResponseAmino; +} +/** QueryAllowanceResponse is the response type for the Query/Allowance RPC method. */ +export interface QueryAllowanceResponseSDKType { + allowance?: GrantSDKType | undefined; +} +/** QueryAllowancesRequest is the request type for the Query/Allowances RPC method. */ +export interface QueryAllowancesRequest { + grantee: string; + /** pagination defines an pagination for the request. */ + pagination?: PageRequest | undefined; +} +export interface QueryAllowancesRequestProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesRequest"; + value: Uint8Array; +} +/** QueryAllowancesRequest is the request type for the Query/Allowances RPC method. */ +export interface QueryAllowancesRequestAmino { + grantee?: string; + /** pagination defines an pagination for the request. */ + pagination?: PageRequestAmino | undefined; +} +export interface QueryAllowancesRequestAminoMsg { + type: "cosmos-sdk/QueryAllowancesRequest"; + value: QueryAllowancesRequestAmino; +} +/** QueryAllowancesRequest is the request type for the Query/Allowances RPC method. */ +export interface QueryAllowancesRequestSDKType { + grantee: string; + pagination?: PageRequestSDKType | undefined; +} +/** QueryAllowancesResponse is the response type for the Query/Allowances RPC method. */ +export interface QueryAllowancesResponse { + /** allowances are allowance's granted for grantee by granter. */ + allowances: Grant[]; + /** pagination defines an pagination for the response. */ + pagination?: PageResponse | undefined; +} +export interface QueryAllowancesResponseProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesResponse"; + value: Uint8Array; +} +/** QueryAllowancesResponse is the response type for the Query/Allowances RPC method. */ +export interface QueryAllowancesResponseAmino { + /** allowances are allowance's granted for grantee by granter. */ + allowances?: GrantAmino[]; + /** pagination defines an pagination for the response. */ + pagination?: PageResponseAmino | undefined; +} +export interface QueryAllowancesResponseAminoMsg { + type: "cosmos-sdk/QueryAllowancesResponse"; + value: QueryAllowancesResponseAmino; +} +/** QueryAllowancesResponse is the response type for the Query/Allowances RPC method. */ +export interface QueryAllowancesResponseSDKType { + allowances: GrantSDKType[]; + pagination?: PageResponseSDKType | undefined; +} +/** QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. */ +export interface QueryAllowancesByGranterRequest { + granter: string; + /** pagination defines an pagination for the request. */ + pagination?: PageRequest | undefined; +} +export interface QueryAllowancesByGranterRequestProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesByGranterRequest"; + value: Uint8Array; +} +/** QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. */ +export interface QueryAllowancesByGranterRequestAmino { + granter?: string; + /** pagination defines an pagination for the request. */ + pagination?: PageRequestAmino | undefined; +} +export interface QueryAllowancesByGranterRequestAminoMsg { + type: "cosmos-sdk/QueryAllowancesByGranterRequest"; + value: QueryAllowancesByGranterRequestAmino; +} +/** QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. */ +export interface QueryAllowancesByGranterRequestSDKType { + granter: string; + pagination?: PageRequestSDKType | undefined; +} +/** QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. */ +export interface QueryAllowancesByGranterResponse { + /** allowances that have been issued by the granter. */ + allowances: Grant[]; + /** pagination defines an pagination for the response. */ + pagination?: PageResponse | undefined; +} +export interface QueryAllowancesByGranterResponseProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse"; + value: Uint8Array; +} +/** QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. */ +export interface QueryAllowancesByGranterResponseAmino { + /** allowances that have been issued by the granter. */ + allowances?: GrantAmino[]; + /** pagination defines an pagination for the response. */ + pagination?: PageResponseAmino | undefined; +} +export interface QueryAllowancesByGranterResponseAminoMsg { + type: "cosmos-sdk/QueryAllowancesByGranterResponse"; + value: QueryAllowancesByGranterResponseAmino; +} +/** QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. */ +export interface QueryAllowancesByGranterResponseSDKType { + allowances: GrantSDKType[]; + pagination?: PageResponseSDKType | undefined; +} +function createBaseQueryAllowanceRequest(): QueryAllowanceRequest { + return { + granter: "", + grantee: "" + }; +} +export const QueryAllowanceRequest = { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowanceRequest", + encode(message: QueryAllowanceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.grantee !== "") { + writer.uint32(18).string(message.grantee); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAllowanceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllowanceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.grantee = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllowanceRequest { + const message = createBaseQueryAllowanceRequest(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + return message; + }, + fromAmino(object: QueryAllowanceRequestAmino): QueryAllowanceRequest { + const message = createBaseQueryAllowanceRequest(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + return message; + }, + toAmino(message: QueryAllowanceRequest, useInterfaces: boolean = false): QueryAllowanceRequestAmino { + const obj: any = {}; + obj.granter = message.granter; + obj.grantee = message.grantee; + return obj; + }, + fromAminoMsg(object: QueryAllowanceRequestAminoMsg): QueryAllowanceRequest { + return QueryAllowanceRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllowanceRequest, useInterfaces: boolean = false): QueryAllowanceRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAllowanceRequest", + value: QueryAllowanceRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryAllowanceRequestProtoMsg, useInterfaces: boolean = false): QueryAllowanceRequest { + return QueryAllowanceRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAllowanceRequest): Uint8Array { + return QueryAllowanceRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllowanceRequest): QueryAllowanceRequestProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowanceRequest", + value: QueryAllowanceRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllowanceResponse(): QueryAllowanceResponse { + return { + allowance: undefined + }; +} +export const QueryAllowanceResponse = { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowanceResponse", + encode(message: QueryAllowanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.allowance !== undefined) { + Grant.encode(message.allowance, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAllowanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllowanceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowance = Grant.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllowanceResponse { + const message = createBaseQueryAllowanceResponse(); + message.allowance = object.allowance !== undefined && object.allowance !== null ? Grant.fromPartial(object.allowance) : undefined; + return message; + }, + fromAmino(object: QueryAllowanceResponseAmino): QueryAllowanceResponse { + const message = createBaseQueryAllowanceResponse(); + if (object.allowance !== undefined && object.allowance !== null) { + message.allowance = Grant.fromAmino(object.allowance); + } + return message; + }, + toAmino(message: QueryAllowanceResponse, useInterfaces: boolean = false): QueryAllowanceResponseAmino { + const obj: any = {}; + obj.allowance = message.allowance ? Grant.toAmino(message.allowance, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllowanceResponseAminoMsg): QueryAllowanceResponse { + return QueryAllowanceResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllowanceResponse, useInterfaces: boolean = false): QueryAllowanceResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAllowanceResponse", + value: QueryAllowanceResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryAllowanceResponseProtoMsg, useInterfaces: boolean = false): QueryAllowanceResponse { + return QueryAllowanceResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAllowanceResponse): Uint8Array { + return QueryAllowanceResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllowanceResponse): QueryAllowanceResponseProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowanceResponse", + value: QueryAllowanceResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllowancesRequest(): QueryAllowancesRequest { + return { + grantee: "", + pagination: undefined + }; +} +export const QueryAllowancesRequest = { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesRequest", + encode(message: QueryAllowancesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.grantee !== "") { + writer.uint32(10).string(message.grantee); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAllowancesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllowancesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grantee = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllowancesRequest { + const message = createBaseQueryAllowancesRequest(); + message.grantee = object.grantee ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllowancesRequestAmino): QueryAllowancesRequest { + const message = createBaseQueryAllowancesRequest(); + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllowancesRequest, useInterfaces: boolean = false): QueryAllowancesRequestAmino { + const obj: any = {}; + obj.grantee = message.grantee; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllowancesRequestAminoMsg): QueryAllowancesRequest { + return QueryAllowancesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllowancesRequest, useInterfaces: boolean = false): QueryAllowancesRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAllowancesRequest", + value: QueryAllowancesRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryAllowancesRequestProtoMsg, useInterfaces: boolean = false): QueryAllowancesRequest { + return QueryAllowancesRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAllowancesRequest): Uint8Array { + return QueryAllowancesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllowancesRequest): QueryAllowancesRequestProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesRequest", + value: QueryAllowancesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllowancesResponse(): QueryAllowancesResponse { + return { + allowances: [], + pagination: undefined + }; +} +export const QueryAllowancesResponse = { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesResponse", + encode(message: QueryAllowancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.allowances) { + Grant.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAllowancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllowancesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowances.push(Grant.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllowancesResponse { + const message = createBaseQueryAllowancesResponse(); + message.allowances = object.allowances?.map(e => Grant.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllowancesResponseAmino): QueryAllowancesResponse { + const message = createBaseQueryAllowancesResponse(); + message.allowances = object.allowances?.map(e => Grant.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllowancesResponse, useInterfaces: boolean = false): QueryAllowancesResponseAmino { + const obj: any = {}; + if (message.allowances) { + obj.allowances = message.allowances.map(e => e ? Grant.toAmino(e, useInterfaces) : undefined); + } else { + obj.allowances = []; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllowancesResponseAminoMsg): QueryAllowancesResponse { + return QueryAllowancesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllowancesResponse, useInterfaces: boolean = false): QueryAllowancesResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAllowancesResponse", + value: QueryAllowancesResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryAllowancesResponseProtoMsg, useInterfaces: boolean = false): QueryAllowancesResponse { + return QueryAllowancesResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAllowancesResponse): Uint8Array { + return QueryAllowancesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllowancesResponse): QueryAllowancesResponseProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesResponse", + value: QueryAllowancesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllowancesByGranterRequest(): QueryAllowancesByGranterRequest { + return { + granter: "", + pagination: undefined + }; +} +export const QueryAllowancesByGranterRequest = { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesByGranterRequest", + encode(message: QueryAllowancesByGranterRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAllowancesByGranterRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllowancesByGranterRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllowancesByGranterRequest { + const message = createBaseQueryAllowancesByGranterRequest(); + message.granter = object.granter ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllowancesByGranterRequestAmino): QueryAllowancesByGranterRequest { + const message = createBaseQueryAllowancesByGranterRequest(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllowancesByGranterRequest, useInterfaces: boolean = false): QueryAllowancesByGranterRequestAmino { + const obj: any = {}; + obj.granter = message.granter; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllowancesByGranterRequestAminoMsg): QueryAllowancesByGranterRequest { + return QueryAllowancesByGranterRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllowancesByGranterRequest, useInterfaces: boolean = false): QueryAllowancesByGranterRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAllowancesByGranterRequest", + value: QueryAllowancesByGranterRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryAllowancesByGranterRequestProtoMsg, useInterfaces: boolean = false): QueryAllowancesByGranterRequest { + return QueryAllowancesByGranterRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAllowancesByGranterRequest): Uint8Array { + return QueryAllowancesByGranterRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllowancesByGranterRequest): QueryAllowancesByGranterRequestProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesByGranterRequest", + value: QueryAllowancesByGranterRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllowancesByGranterResponse(): QueryAllowancesByGranterResponse { + return { + allowances: [], + pagination: undefined + }; +} +export const QueryAllowancesByGranterResponse = { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse", + encode(message: QueryAllowancesByGranterResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.allowances) { + Grant.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAllowancesByGranterResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllowancesByGranterResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowances.push(Grant.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllowancesByGranterResponse { + const message = createBaseQueryAllowancesByGranterResponse(); + message.allowances = object.allowances?.map(e => Grant.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllowancesByGranterResponseAmino): QueryAllowancesByGranterResponse { + const message = createBaseQueryAllowancesByGranterResponse(); + message.allowances = object.allowances?.map(e => Grant.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllowancesByGranterResponse, useInterfaces: boolean = false): QueryAllowancesByGranterResponseAmino { + const obj: any = {}; + if (message.allowances) { + obj.allowances = message.allowances.map(e => e ? Grant.toAmino(e, useInterfaces) : undefined); + } else { + obj.allowances = []; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllowancesByGranterResponseAminoMsg): QueryAllowancesByGranterResponse { + return QueryAllowancesByGranterResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllowancesByGranterResponse, useInterfaces: boolean = false): QueryAllowancesByGranterResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAllowancesByGranterResponse", + value: QueryAllowancesByGranterResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryAllowancesByGranterResponseProtoMsg, useInterfaces: boolean = false): QueryAllowancesByGranterResponse { + return QueryAllowancesByGranterResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAllowancesByGranterResponse): Uint8Array { + return QueryAllowancesByGranterResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllowancesByGranterResponse): QueryAllowancesByGranterResponseProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse", + value: QueryAllowancesByGranterResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/tx.amino.ts new file mode 100644 index 000000000..abc5f21ab --- /dev/null +++ b/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/tx.amino.ts @@ -0,0 +1,18 @@ +import { MsgGrantAllowance, MsgRevokeAllowance, MsgPruneAllowances } from "./tx"; +export const AminoConverter = { + "/cosmos.feegrant.v1beta1.MsgGrantAllowance": { + aminoType: "cosmos-sdk/MsgGrantAllowance", + toAmino: MsgGrantAllowance.toAmino, + fromAmino: MsgGrantAllowance.fromAmino + }, + "/cosmos.feegrant.v1beta1.MsgRevokeAllowance": { + aminoType: "cosmos-sdk/MsgRevokeAllowance", + toAmino: MsgRevokeAllowance.toAmino, + fromAmino: MsgRevokeAllowance.fromAmino + }, + "/cosmos.feegrant.v1beta1.MsgPruneAllowances": { + aminoType: "cosmos-sdk/MsgPruneAllowances", + toAmino: MsgPruneAllowances.toAmino, + fromAmino: MsgPruneAllowances.fromAmino + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/tx.registry.ts new file mode 100644 index 000000000..a974fd531 --- /dev/null +++ b/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/tx.registry.ts @@ -0,0 +1,71 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgGrantAllowance, MsgRevokeAllowance, MsgPruneAllowances } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.feegrant.v1beta1.MsgGrantAllowance", MsgGrantAllowance], ["/cosmos.feegrant.v1beta1.MsgRevokeAllowance", MsgRevokeAllowance], ["/cosmos.feegrant.v1beta1.MsgPruneAllowances", MsgPruneAllowances]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + grantAllowance(value: MsgGrantAllowance) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + value: MsgGrantAllowance.encode(value).finish() + }; + }, + revokeAllowance(value: MsgRevokeAllowance) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", + value: MsgRevokeAllowance.encode(value).finish() + }; + }, + pruneAllowances(value: MsgPruneAllowances) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowances", + value: MsgPruneAllowances.encode(value).finish() + }; + } + }, + withTypeUrl: { + grantAllowance(value: MsgGrantAllowance) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + value + }; + }, + revokeAllowance(value: MsgRevokeAllowance) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", + value + }; + }, + pruneAllowances(value: MsgPruneAllowances) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowances", + value + }; + } + }, + fromPartial: { + grantAllowance(value: MsgGrantAllowance) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + value: MsgGrantAllowance.fromPartial(value) + }; + }, + revokeAllowance(value: MsgRevokeAllowance) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", + value: MsgRevokeAllowance.fromPartial(value) + }; + }, + pruneAllowances(value: MsgPruneAllowances) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowances", + value: MsgPruneAllowances.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/tx.rpc.msg.ts new file mode 100644 index 000000000..6b8c52711 --- /dev/null +++ b/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,42 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgGrantAllowance, MsgGrantAllowanceResponse, MsgRevokeAllowance, MsgRevokeAllowanceResponse, MsgPruneAllowances, MsgPruneAllowancesResponse } from "./tx"; +/** Msg defines the feegrant msg service. */ +export interface Msg { + /** + * GrantAllowance grants fee allowance to the grantee on the granter's + * account with the provided expiration time. + */ + grantAllowance(request: MsgGrantAllowance): Promise; + /** + * RevokeAllowance revokes any fee allowance of granter's account that + * has been granted to the grantee. + */ + revokeAllowance(request: MsgRevokeAllowance): Promise; + /** PruneAllowances prunes expired fee allowances, currently up to 75 at a time. */ + pruneAllowances(request: MsgPruneAllowances): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.grantAllowance = this.grantAllowance.bind(this); + this.revokeAllowance = this.revokeAllowance.bind(this); + this.pruneAllowances = this.pruneAllowances.bind(this); + } + grantAllowance(request: MsgGrantAllowance, useInterfaces: boolean = true): Promise { + const data = MsgGrantAllowance.encode(request).finish(); + const promise = this.rpc.request("cosmos.feegrant.v1beta1.Msg", "GrantAllowance", data); + return promise.then(data => MsgGrantAllowanceResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + revokeAllowance(request: MsgRevokeAllowance, useInterfaces: boolean = true): Promise { + const data = MsgRevokeAllowance.encode(request).finish(); + const promise = this.rpc.request("cosmos.feegrant.v1beta1.Msg", "RevokeAllowance", data); + return promise.then(data => MsgRevokeAllowanceResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + pruneAllowances(request: MsgPruneAllowances, useInterfaces: boolean = true): Promise { + const data = MsgPruneAllowances.encode(request).finish(); + const promise = this.rpc.request("cosmos.feegrant.v1beta1.Msg", "PruneAllowances", data); + return promise.then(data => MsgPruneAllowancesResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/tx.ts b/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/tx.ts new file mode 100644 index 000000000..abb4c3928 --- /dev/null +++ b/packages/types/protobuf/codegen/cosmos/feegrant/v1beta1/tx.ts @@ -0,0 +1,606 @@ +//@ts-nocheck +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { BasicAllowance, BasicAllowanceProtoMsg, BasicAllowanceSDKType, PeriodicAllowance, PeriodicAllowanceProtoMsg, PeriodicAllowanceSDKType, AllowedMsgAllowance, AllowedMsgAllowanceProtoMsg, AllowedMsgAllowanceSDKType } from "./feegrant"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * MsgGrantAllowance adds permission for Grantee to spend up to Allowance + * of fees from the account of Granter. + */ +export interface MsgGrantAllowance { + /** granter is the address of the user granting an allowance of their funds. */ + granter: string; + /** grantee is the address of the user being granted an allowance of another user's funds. */ + grantee: string; + /** allowance can be any of basic, periodic, allowed fee allowance. */ + allowance?: (BasicAllowance & PeriodicAllowance & AllowedMsgAllowance & Any) | undefined; +} +export interface MsgGrantAllowanceProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance"; + value: Uint8Array; +} +export type MsgGrantAllowanceEncoded = Omit & { + /** allowance can be any of basic, periodic, allowed fee allowance. */allowance?: BasicAllowanceProtoMsg | PeriodicAllowanceProtoMsg | AllowedMsgAllowanceProtoMsg | AnyProtoMsg | undefined; +}; +/** + * MsgGrantAllowance adds permission for Grantee to spend up to Allowance + * of fees from the account of Granter. + */ +export interface MsgGrantAllowanceAmino { + /** granter is the address of the user granting an allowance of their funds. */ + granter?: string; + /** grantee is the address of the user being granted an allowance of another user's funds. */ + grantee?: string; + /** allowance can be any of basic, periodic, allowed fee allowance. */ + allowance?: AnyAmino | undefined; +} +export interface MsgGrantAllowanceAminoMsg { + type: "cosmos-sdk/MsgGrantAllowance"; + value: MsgGrantAllowanceAmino; +} +/** + * MsgGrantAllowance adds permission for Grantee to spend up to Allowance + * of fees from the account of Granter. + */ +export interface MsgGrantAllowanceSDKType { + granter: string; + grantee: string; + allowance?: BasicAllowanceSDKType | PeriodicAllowanceSDKType | AllowedMsgAllowanceSDKType | AnySDKType | undefined; +} +/** MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. */ +export interface MsgGrantAllowanceResponse {} +export interface MsgGrantAllowanceResponseProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse"; + value: Uint8Array; +} +/** MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. */ +export interface MsgGrantAllowanceResponseAmino {} +export interface MsgGrantAllowanceResponseAminoMsg { + type: "cosmos-sdk/MsgGrantAllowanceResponse"; + value: MsgGrantAllowanceResponseAmino; +} +/** MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. */ +export interface MsgGrantAllowanceResponseSDKType {} +/** MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. */ +export interface MsgRevokeAllowance { + /** granter is the address of the user granting an allowance of their funds. */ + granter: string; + /** grantee is the address of the user being granted an allowance of another user's funds. */ + grantee: string; +} +export interface MsgRevokeAllowanceProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance"; + value: Uint8Array; +} +/** MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. */ +export interface MsgRevokeAllowanceAmino { + /** granter is the address of the user granting an allowance of their funds. */ + granter?: string; + /** grantee is the address of the user being granted an allowance of another user's funds. */ + grantee?: string; +} +export interface MsgRevokeAllowanceAminoMsg { + type: "cosmos-sdk/MsgRevokeAllowance"; + value: MsgRevokeAllowanceAmino; +} +/** MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. */ +export interface MsgRevokeAllowanceSDKType { + granter: string; + grantee: string; +} +/** MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. */ +export interface MsgRevokeAllowanceResponse {} +export interface MsgRevokeAllowanceResponseProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse"; + value: Uint8Array; +} +/** MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. */ +export interface MsgRevokeAllowanceResponseAmino {} +export interface MsgRevokeAllowanceResponseAminoMsg { + type: "cosmos-sdk/MsgRevokeAllowanceResponse"; + value: MsgRevokeAllowanceResponseAmino; +} +/** MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. */ +export interface MsgRevokeAllowanceResponseSDKType {} +/** MsgPruneAllowances prunes expired fee allowances. */ +export interface MsgPruneAllowances { + /** pruner is the address of the user pruning expired allowances. */ + pruner: string; +} +export interface MsgPruneAllowancesProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowances"; + value: Uint8Array; +} +/** MsgPruneAllowances prunes expired fee allowances. */ +export interface MsgPruneAllowancesAmino { + /** pruner is the address of the user pruning expired allowances. */ + pruner?: string; +} +export interface MsgPruneAllowancesAminoMsg { + type: "cosmos-sdk/MsgPruneAllowances"; + value: MsgPruneAllowancesAmino; +} +/** MsgPruneAllowances prunes expired fee allowances. */ +export interface MsgPruneAllowancesSDKType { + pruner: string; +} +/** MsgPruneAllowancesResponse defines the Msg/PruneAllowancesResponse response type. */ +export interface MsgPruneAllowancesResponse {} +export interface MsgPruneAllowancesResponseProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse"; + value: Uint8Array; +} +/** MsgPruneAllowancesResponse defines the Msg/PruneAllowancesResponse response type. */ +export interface MsgPruneAllowancesResponseAmino {} +export interface MsgPruneAllowancesResponseAminoMsg { + type: "cosmos-sdk/MsgPruneAllowancesResponse"; + value: MsgPruneAllowancesResponseAmino; +} +/** MsgPruneAllowancesResponse defines the Msg/PruneAllowancesResponse response type. */ +export interface MsgPruneAllowancesResponseSDKType {} +function createBaseMsgGrantAllowance(): MsgGrantAllowance { + return { + granter: "", + grantee: "", + allowance: undefined + }; +} +export const MsgGrantAllowance = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + encode(message: MsgGrantAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.grantee !== "") { + writer.uint32(18).string(message.grantee); + } + if (message.allowance !== undefined) { + Any.encode((message.allowance as Any), writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgGrantAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgGrantAllowance(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.grantee = reader.string(); + break; + case 3: + message.allowance = useInterfaces ? (Cosmos_feegrantv1beta1FeeAllowanceI_InterfaceDecoder(reader) as Any) : Any.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgGrantAllowance { + const message = createBaseMsgGrantAllowance(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + message.allowance = object.allowance !== undefined && object.allowance !== null ? Any.fromPartial(object.allowance) : undefined; + return message; + }, + fromAmino(object: MsgGrantAllowanceAmino): MsgGrantAllowance { + const message = createBaseMsgGrantAllowance(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.allowance !== undefined && object.allowance !== null) { + message.allowance = Cosmos_feegrantv1beta1FeeAllowanceI_FromAmino(object.allowance); + } + return message; + }, + toAmino(message: MsgGrantAllowance, useInterfaces: boolean = false): MsgGrantAllowanceAmino { + const obj: any = {}; + obj.granter = message.granter; + obj.grantee = message.grantee; + obj.allowance = message.allowance ? Cosmos_feegrantv1beta1FeeAllowanceI_ToAmino((message.allowance as Any), useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgGrantAllowanceAminoMsg): MsgGrantAllowance { + return MsgGrantAllowance.fromAmino(object.value); + }, + toAminoMsg(message: MsgGrantAllowance, useInterfaces: boolean = false): MsgGrantAllowanceAminoMsg { + return { + type: "cosmos-sdk/MsgGrantAllowance", + value: MsgGrantAllowance.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgGrantAllowanceProtoMsg, useInterfaces: boolean = false): MsgGrantAllowance { + return MsgGrantAllowance.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgGrantAllowance): Uint8Array { + return MsgGrantAllowance.encode(message).finish(); + }, + toProtoMsg(message: MsgGrantAllowance): MsgGrantAllowanceProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + value: MsgGrantAllowance.encode(message).finish() + }; + } +}; +function createBaseMsgGrantAllowanceResponse(): MsgGrantAllowanceResponse { + return {}; +} +export const MsgGrantAllowanceResponse = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse", + encode(_: MsgGrantAllowanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgGrantAllowanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgGrantAllowanceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgGrantAllowanceResponse { + const message = createBaseMsgGrantAllowanceResponse(); + return message; + }, + fromAmino(_: MsgGrantAllowanceResponseAmino): MsgGrantAllowanceResponse { + const message = createBaseMsgGrantAllowanceResponse(); + return message; + }, + toAmino(_: MsgGrantAllowanceResponse, useInterfaces: boolean = false): MsgGrantAllowanceResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgGrantAllowanceResponseAminoMsg): MsgGrantAllowanceResponse { + return MsgGrantAllowanceResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgGrantAllowanceResponse, useInterfaces: boolean = false): MsgGrantAllowanceResponseAminoMsg { + return { + type: "cosmos-sdk/MsgGrantAllowanceResponse", + value: MsgGrantAllowanceResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgGrantAllowanceResponseProtoMsg, useInterfaces: boolean = false): MsgGrantAllowanceResponse { + return MsgGrantAllowanceResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgGrantAllowanceResponse): Uint8Array { + return MsgGrantAllowanceResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgGrantAllowanceResponse): MsgGrantAllowanceResponseProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse", + value: MsgGrantAllowanceResponse.encode(message).finish() + }; + } +}; +function createBaseMsgRevokeAllowance(): MsgRevokeAllowance { + return { + granter: "", + grantee: "" + }; +} +export const MsgRevokeAllowance = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", + encode(message: MsgRevokeAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.grantee !== "") { + writer.uint32(18).string(message.grantee); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRevokeAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeAllowance(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.grantee = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRevokeAllowance { + const message = createBaseMsgRevokeAllowance(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + return message; + }, + fromAmino(object: MsgRevokeAllowanceAmino): MsgRevokeAllowance { + const message = createBaseMsgRevokeAllowance(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + return message; + }, + toAmino(message: MsgRevokeAllowance, useInterfaces: boolean = false): MsgRevokeAllowanceAmino { + const obj: any = {}; + obj.granter = message.granter; + obj.grantee = message.grantee; + return obj; + }, + fromAminoMsg(object: MsgRevokeAllowanceAminoMsg): MsgRevokeAllowance { + return MsgRevokeAllowance.fromAmino(object.value); + }, + toAminoMsg(message: MsgRevokeAllowance, useInterfaces: boolean = false): MsgRevokeAllowanceAminoMsg { + return { + type: "cosmos-sdk/MsgRevokeAllowance", + value: MsgRevokeAllowance.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgRevokeAllowanceProtoMsg, useInterfaces: boolean = false): MsgRevokeAllowance { + return MsgRevokeAllowance.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgRevokeAllowance): Uint8Array { + return MsgRevokeAllowance.encode(message).finish(); + }, + toProtoMsg(message: MsgRevokeAllowance): MsgRevokeAllowanceProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", + value: MsgRevokeAllowance.encode(message).finish() + }; + } +}; +function createBaseMsgRevokeAllowanceResponse(): MsgRevokeAllowanceResponse { + return {}; +} +export const MsgRevokeAllowanceResponse = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse", + encode(_: MsgRevokeAllowanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRevokeAllowanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRevokeAllowanceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgRevokeAllowanceResponse { + const message = createBaseMsgRevokeAllowanceResponse(); + return message; + }, + fromAmino(_: MsgRevokeAllowanceResponseAmino): MsgRevokeAllowanceResponse { + const message = createBaseMsgRevokeAllowanceResponse(); + return message; + }, + toAmino(_: MsgRevokeAllowanceResponse, useInterfaces: boolean = false): MsgRevokeAllowanceResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRevokeAllowanceResponseAminoMsg): MsgRevokeAllowanceResponse { + return MsgRevokeAllowanceResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgRevokeAllowanceResponse, useInterfaces: boolean = false): MsgRevokeAllowanceResponseAminoMsg { + return { + type: "cosmos-sdk/MsgRevokeAllowanceResponse", + value: MsgRevokeAllowanceResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgRevokeAllowanceResponseProtoMsg, useInterfaces: boolean = false): MsgRevokeAllowanceResponse { + return MsgRevokeAllowanceResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgRevokeAllowanceResponse): Uint8Array { + return MsgRevokeAllowanceResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRevokeAllowanceResponse): MsgRevokeAllowanceResponseProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse", + value: MsgRevokeAllowanceResponse.encode(message).finish() + }; + } +}; +function createBaseMsgPruneAllowances(): MsgPruneAllowances { + return { + pruner: "" + }; +} +export const MsgPruneAllowances = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowances", + encode(message: MsgPruneAllowances, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pruner !== "") { + writer.uint32(10).string(message.pruner); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgPruneAllowances { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPruneAllowances(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pruner = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgPruneAllowances { + const message = createBaseMsgPruneAllowances(); + message.pruner = object.pruner ?? ""; + return message; + }, + fromAmino(object: MsgPruneAllowancesAmino): MsgPruneAllowances { + const message = createBaseMsgPruneAllowances(); + if (object.pruner !== undefined && object.pruner !== null) { + message.pruner = object.pruner; + } + return message; + }, + toAmino(message: MsgPruneAllowances, useInterfaces: boolean = false): MsgPruneAllowancesAmino { + const obj: any = {}; + obj.pruner = message.pruner; + return obj; + }, + fromAminoMsg(object: MsgPruneAllowancesAminoMsg): MsgPruneAllowances { + return MsgPruneAllowances.fromAmino(object.value); + }, + toAminoMsg(message: MsgPruneAllowances, useInterfaces: boolean = false): MsgPruneAllowancesAminoMsg { + return { + type: "cosmos-sdk/MsgPruneAllowances", + value: MsgPruneAllowances.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgPruneAllowancesProtoMsg, useInterfaces: boolean = false): MsgPruneAllowances { + return MsgPruneAllowances.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgPruneAllowances): Uint8Array { + return MsgPruneAllowances.encode(message).finish(); + }, + toProtoMsg(message: MsgPruneAllowances): MsgPruneAllowancesProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowances", + value: MsgPruneAllowances.encode(message).finish() + }; + } +}; +function createBaseMsgPruneAllowancesResponse(): MsgPruneAllowancesResponse { + return {}; +} +export const MsgPruneAllowancesResponse = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse", + encode(_: MsgPruneAllowancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgPruneAllowancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPruneAllowancesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgPruneAllowancesResponse { + const message = createBaseMsgPruneAllowancesResponse(); + return message; + }, + fromAmino(_: MsgPruneAllowancesResponseAmino): MsgPruneAllowancesResponse { + const message = createBaseMsgPruneAllowancesResponse(); + return message; + }, + toAmino(_: MsgPruneAllowancesResponse, useInterfaces: boolean = false): MsgPruneAllowancesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgPruneAllowancesResponseAminoMsg): MsgPruneAllowancesResponse { + return MsgPruneAllowancesResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgPruneAllowancesResponse, useInterfaces: boolean = false): MsgPruneAllowancesResponseAminoMsg { + return { + type: "cosmos-sdk/MsgPruneAllowancesResponse", + value: MsgPruneAllowancesResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgPruneAllowancesResponseProtoMsg, useInterfaces: boolean = false): MsgPruneAllowancesResponse { + return MsgPruneAllowancesResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgPruneAllowancesResponse): Uint8Array { + return MsgPruneAllowancesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgPruneAllowancesResponse): MsgPruneAllowancesResponseProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse", + value: MsgPruneAllowancesResponse.encode(message).finish() + }; + } +}; +export const Cosmos_feegrantv1beta1FeeAllowanceI_InterfaceDecoder = (input: BinaryReader | Uint8Array): BasicAllowance | PeriodicAllowance | AllowedMsgAllowance | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32(), true); + switch (data.typeUrl) { + case "/cosmos.feegrant.v1beta1.BasicAllowance": + return BasicAllowance.decode(data.value, undefined, true); + case "/cosmos.feegrant.v1beta1.PeriodicAllowance": + return PeriodicAllowance.decode(data.value, undefined, true); + case "/cosmos.feegrant.v1beta1.AllowedMsgAllowance": + return AllowedMsgAllowance.decode(data.value, undefined, true); + default: + return data; + } +}; +export const Cosmos_feegrantv1beta1FeeAllowanceI_FromAmino = (content: AnyAmino) => { + switch (content.type) { + case "cosmos-sdk/BasicAllowance": + return Any.fromPartial({ + typeUrl: "/cosmos.feegrant.v1beta1.BasicAllowance", + value: BasicAllowance.encode(BasicAllowance.fromPartial(BasicAllowance.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/PeriodicAllowance": + return Any.fromPartial({ + typeUrl: "/cosmos.feegrant.v1beta1.PeriodicAllowance", + value: PeriodicAllowance.encode(PeriodicAllowance.fromPartial(PeriodicAllowance.fromAmino(content.value))).finish() + }); + case "cosmos-sdk/AllowedMsgAllowance": + return Any.fromPartial({ + typeUrl: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance", + value: AllowedMsgAllowance.encode(AllowedMsgAllowance.fromPartial(AllowedMsgAllowance.fromAmino(content.value))).finish() + }); + default: + return Any.fromAmino(content); + } +}; +export const Cosmos_feegrantv1beta1FeeAllowanceI_ToAmino = (content: Any, useInterfaces: boolean = false) => { + switch (content.typeUrl) { + case "/cosmos.feegrant.v1beta1.BasicAllowance": + return { + type: "cosmos-sdk/BasicAllowance", + value: BasicAllowance.toAmino(BasicAllowance.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/cosmos.feegrant.v1beta1.PeriodicAllowance": + return { + type: "cosmos-sdk/PeriodicAllowance", + value: PeriodicAllowance.toAmino(PeriodicAllowance.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + case "/cosmos.feegrant.v1beta1.AllowedMsgAllowance": + return { + type: "cosmos-sdk/AllowedMsgAllowance", + value: AllowedMsgAllowance.toAmino(AllowedMsgAllowance.decode(content.value, undefined, useInterfaces), useInterfaces) + }; + default: + return Any.toAmino(content, useInterfaces); + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/rpc.query.ts b/packages/types/protobuf/codegen/cosmos/rpc.query.ts index dd70e0bca..1fdb1dc7b 100644 --- a/packages/types/protobuf/codegen/cosmos/rpc.query.ts +++ b/packages/types/protobuf/codegen/cosmos/rpc.query.ts @@ -26,6 +26,9 @@ export const createRPCQueryClient = async ({ distribution: { v1beta1: (await import("./distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + feegrant: { + v1beta1: (await import("./feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, gov: { v1: (await import("./gov/v1/query.rpc.Query")).createRpcQueryExtension(client), v1beta1: (await import("./gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) diff --git a/packages/types/protobuf/codegen/cosmos/rpc.tx.ts b/packages/types/protobuf/codegen/cosmos/rpc.tx.ts index bc3dc8322..080131032 100644 --- a/packages/types/protobuf/codegen/cosmos/rpc.tx.ts +++ b/packages/types/protobuf/codegen/cosmos/rpc.tx.ts @@ -17,6 +17,9 @@ export const createRPCMsgClient = async ({ distribution: { v1beta1: new (await import("./distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + feegrant: { + v1beta1: new (await import("./feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, gov: { v1: new (await import("./gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), v1beta1: new (await import("./gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) diff --git a/packages/types/protobuf/codegen/cosmwasm/bundle.ts b/packages/types/protobuf/codegen/cosmwasm/bundle.ts index 0bd296e72..893641735 100644 --- a/packages/types/protobuf/codegen/cosmwasm/bundle.ts +++ b/packages/types/protobuf/codegen/cosmwasm/bundle.ts @@ -1,56 +1,56 @@ -import * as _86 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _87 from "./tokenfactory/v1beta1/genesis"; -import * as _88 from "./tokenfactory/v1beta1/params"; -import * as _89 from "./tokenfactory/v1beta1/query"; -import * as _90 from "./tokenfactory/v1beta1/tx"; -import * as _91 from "./wasm/v1/authz"; -import * as _92 from "./wasm/v1/genesis"; -import * as _93 from "./wasm/v1/ibc"; -import * as _94 from "./wasm/v1/proposal"; -import * as _95 from "./wasm/v1/query"; -import * as _96 from "./wasm/v1/tx"; -import * as _97 from "./wasm/v1/types"; -import * as _371 from "./tokenfactory/v1beta1/tx.amino"; -import * as _372 from "./wasm/v1/tx.amino"; -import * as _373 from "./tokenfactory/v1beta1/tx.registry"; -import * as _374 from "./wasm/v1/tx.registry"; -import * as _375 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _376 from "./wasm/v1/query.rpc.Query"; -import * as _377 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _378 from "./wasm/v1/tx.rpc.msg"; -import * as _537 from "./rpc.query"; -import * as _538 from "./rpc.tx"; +import * as _90 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _91 from "./tokenfactory/v1beta1/genesis"; +import * as _92 from "./tokenfactory/v1beta1/params"; +import * as _93 from "./tokenfactory/v1beta1/query"; +import * as _94 from "./tokenfactory/v1beta1/tx"; +import * as _95 from "./wasm/v1/authz"; +import * as _96 from "./wasm/v1/genesis"; +import * as _97 from "./wasm/v1/ibc"; +import * as _98 from "./wasm/v1/proposal"; +import * as _99 from "./wasm/v1/query"; +import * as _100 from "./wasm/v1/tx"; +import * as _101 from "./wasm/v1/types"; +import * as _379 from "./tokenfactory/v1beta1/tx.amino"; +import * as _380 from "./wasm/v1/tx.amino"; +import * as _381 from "./tokenfactory/v1beta1/tx.registry"; +import * as _382 from "./wasm/v1/tx.registry"; +import * as _383 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _384 from "./wasm/v1/query.rpc.Query"; +import * as _385 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _386 from "./wasm/v1/tx.rpc.msg"; +import * as _545 from "./rpc.query"; +import * as _546 from "./rpc.tx"; export namespace cosmwasm { export namespace tokenfactory { export const v1beta1 = { - ..._86, - ..._87, - ..._88, - ..._89, ..._90, - ..._371, - ..._373, - ..._375, - ..._377 - }; - } - export namespace wasm { - export const v1 = { ..._91, ..._92, ..._93, ..._94, + ..._379, + ..._381, + ..._383, + ..._385 + }; + } + export namespace wasm { + export const v1 = { ..._95, ..._96, ..._97, - ..._372, - ..._374, - ..._376, - ..._378 + ..._98, + ..._99, + ..._100, + ..._101, + ..._380, + ..._382, + ..._384, + ..._386 }; } export const ClientFactory = { - ..._537, - ..._538 + ..._545, + ..._546 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmwasm/rpc.query.ts b/packages/types/protobuf/codegen/cosmwasm/rpc.query.ts index 4c243915c..7d9a9b83b 100644 --- a/packages/types/protobuf/codegen/cosmwasm/rpc.query.ts +++ b/packages/types/protobuf/codegen/cosmwasm/rpc.query.ts @@ -26,6 +26,9 @@ export const createRPCQueryClient = async ({ distribution: { v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, gov: { v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) diff --git a/packages/types/protobuf/codegen/cosmwasm/rpc.tx.ts b/packages/types/protobuf/codegen/cosmwasm/rpc.tx.ts index a445e20d9..23b50e5e8 100644 --- a/packages/types/protobuf/codegen/cosmwasm/rpc.tx.ts +++ b/packages/types/protobuf/codegen/cosmwasm/rpc.tx.ts @@ -17,6 +17,9 @@ export const createRPCMsgClient = async ({ distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, gov: { v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) diff --git a/packages/types/protobuf/codegen/gaia/bundle.ts b/packages/types/protobuf/codegen/gaia/bundle.ts index a0ac08794..ab6089e54 100644 --- a/packages/types/protobuf/codegen/gaia/bundle.ts +++ b/packages/types/protobuf/codegen/gaia/bundle.ts @@ -1,26 +1,26 @@ -import * as _98 from "./globalfee/v1beta1/genesis"; -import * as _99 from "./globalfee/v1beta1/query"; -import * as _100 from "./globalfee/v1beta1/tx"; -import * as _379 from "./globalfee/v1beta1/tx.amino"; -import * as _380 from "./globalfee/v1beta1/tx.registry"; -import * as _381 from "./globalfee/v1beta1/query.rpc.Query"; -import * as _382 from "./globalfee/v1beta1/tx.rpc.msg"; -import * as _539 from "./rpc.query"; -import * as _540 from "./rpc.tx"; +import * as _102 from "./globalfee/v1beta1/genesis"; +import * as _103 from "./globalfee/v1beta1/query"; +import * as _104 from "./globalfee/v1beta1/tx"; +import * as _387 from "./globalfee/v1beta1/tx.amino"; +import * as _388 from "./globalfee/v1beta1/tx.registry"; +import * as _389 from "./globalfee/v1beta1/query.rpc.Query"; +import * as _390 from "./globalfee/v1beta1/tx.rpc.msg"; +import * as _547 from "./rpc.query"; +import * as _548 from "./rpc.tx"; export namespace gaia { export namespace globalfee { export const v1beta1 = { - ..._98, - ..._99, - ..._100, - ..._379, - ..._380, - ..._381, - ..._382 + ..._102, + ..._103, + ..._104, + ..._387, + ..._388, + ..._389, + ..._390 }; } export const ClientFactory = { - ..._539, - ..._540 + ..._547, + ..._548 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/gaia/rpc.query.ts b/packages/types/protobuf/codegen/gaia/rpc.query.ts index 2b2fa3e7b..cc8c0b389 100644 --- a/packages/types/protobuf/codegen/gaia/rpc.query.ts +++ b/packages/types/protobuf/codegen/gaia/rpc.query.ts @@ -26,6 +26,9 @@ export const createRPCQueryClient = async ({ distribution: { v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, gov: { v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) diff --git a/packages/types/protobuf/codegen/gaia/rpc.tx.ts b/packages/types/protobuf/codegen/gaia/rpc.tx.ts index 758c21a16..b8564052c 100644 --- a/packages/types/protobuf/codegen/gaia/rpc.tx.ts +++ b/packages/types/protobuf/codegen/gaia/rpc.tx.ts @@ -17,6 +17,9 @@ export const createRPCMsgClient = async ({ distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, gov: { v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) diff --git a/packages/types/protobuf/codegen/gogoproto/bundle.ts b/packages/types/protobuf/codegen/gogoproto/bundle.ts index 758475833..3025fa61b 100644 --- a/packages/types/protobuf/codegen/gogoproto/bundle.ts +++ b/packages/types/protobuf/codegen/gogoproto/bundle.ts @@ -1,4 +1,4 @@ -import * as _101 from "./gogo"; +import * as _105 from "./gogo"; export const gogoproto = { - ..._101 + ..._105 }; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/google/bundle.ts b/packages/types/protobuf/codegen/google/bundle.ts index 7eedebd81..ad2059149 100644 --- a/packages/types/protobuf/codegen/google/bundle.ts +++ b/packages/types/protobuf/codegen/google/bundle.ts @@ -1,20 +1,20 @@ -import * as _102 from "./api/annotations"; -import * as _103 from "./api/http"; -import * as _104 from "./protobuf/any"; -import * as _105 from "./protobuf/descriptor"; -import * as _106 from "./protobuf/duration"; -import * as _107 from "./protobuf/empty"; -import * as _108 from "./protobuf/timestamp"; +import * as _106 from "./api/annotations"; +import * as _107 from "./api/http"; +import * as _108 from "./protobuf/any"; +import * as _109 from "./protobuf/descriptor"; +import * as _110 from "./protobuf/duration"; +import * as _111 from "./protobuf/empty"; +import * as _112 from "./protobuf/timestamp"; export namespace google { export const api = { - ..._102, - ..._103 + ..._106, + ..._107 }; export const protobuf = { - ..._104, - ..._105, - ..._106, - ..._107, - ..._108 + ..._108, + ..._109, + ..._110, + ..._111, + ..._112 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/bundle.ts b/packages/types/protobuf/codegen/ibc/bundle.ts index 0d49a3be6..1e09309d1 100644 --- a/packages/types/protobuf/codegen/ibc/bundle.ts +++ b/packages/types/protobuf/codegen/ibc/bundle.ts @@ -1,120 +1,120 @@ -import * as _109 from "./applications/interchain_accounts/controller/v1/controller"; -import * as _110 from "./applications/interchain_accounts/controller/v1/query"; -import * as _111 from "./applications/interchain_accounts/controller/v1/tx"; -import * as _112 from "./applications/interchain_accounts/host/v1/host"; -import * as _113 from "./applications/interchain_accounts/host/v1/query"; -import * as _114 from "./applications/interchain_accounts/host/v1/tx"; -import * as _115 from "./applications/interchain_accounts/v1/account"; -import * as _116 from "./applications/interchain_accounts/v1/metadata"; -import * as _117 from "./applications/interchain_accounts/v1/packet"; -import * as _118 from "./applications/transfer/v1/authz"; -import * as _119 from "./applications/transfer/v1/genesis"; -import * as _120 from "./applications/transfer/v1/query"; -import * as _121 from "./applications/transfer/v1/transfer"; -import * as _122 from "./applications/transfer/v1/tx"; -import * as _123 from "./core/channel/v1/channel"; -import * as _124 from "./core/channel/v1/genesis"; -import * as _125 from "./core/channel/v1/query"; -import * as _126 from "./core/channel/v1/tx"; -import * as _127 from "./core/client/v1/client"; -import * as _128 from "./core/client/v1/genesis"; -import * as _129 from "./core/client/v1/query"; -import * as _130 from "./core/client/v1/tx"; -import * as _383 from "./applications/interchain_accounts/controller/v1/tx.amino"; -import * as _384 from "./applications/interchain_accounts/host/v1/tx.amino"; -import * as _385 from "./applications/transfer/v1/tx.amino"; -import * as _386 from "./core/channel/v1/tx.amino"; -import * as _387 from "./core/client/v1/tx.amino"; -import * as _388 from "./applications/interchain_accounts/controller/v1/tx.registry"; -import * as _389 from "./applications/interchain_accounts/host/v1/tx.registry"; -import * as _390 from "./applications/transfer/v1/tx.registry"; -import * as _391 from "./core/channel/v1/tx.registry"; -import * as _392 from "./core/client/v1/tx.registry"; -import * as _393 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; -import * as _394 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; -import * as _395 from "./applications/transfer/v1/query.rpc.Query"; -import * as _396 from "./core/channel/v1/query.rpc.Query"; -import * as _397 from "./core/client/v1/query.rpc.Query"; -import * as _398 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; -import * as _399 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; -import * as _400 from "./applications/transfer/v1/tx.rpc.msg"; -import * as _401 from "./core/channel/v1/tx.rpc.msg"; -import * as _402 from "./core/client/v1/tx.rpc.msg"; -import * as _541 from "./rpc.query"; -import * as _542 from "./rpc.tx"; +import * as _113 from "./applications/interchain_accounts/controller/v1/controller"; +import * as _114 from "./applications/interchain_accounts/controller/v1/query"; +import * as _115 from "./applications/interchain_accounts/controller/v1/tx"; +import * as _116 from "./applications/interchain_accounts/host/v1/host"; +import * as _117 from "./applications/interchain_accounts/host/v1/query"; +import * as _118 from "./applications/interchain_accounts/host/v1/tx"; +import * as _119 from "./applications/interchain_accounts/v1/account"; +import * as _120 from "./applications/interchain_accounts/v1/metadata"; +import * as _121 from "./applications/interchain_accounts/v1/packet"; +import * as _122 from "./applications/transfer/v1/authz"; +import * as _123 from "./applications/transfer/v1/genesis"; +import * as _124 from "./applications/transfer/v1/query"; +import * as _125 from "./applications/transfer/v1/transfer"; +import * as _126 from "./applications/transfer/v1/tx"; +import * as _127 from "./core/channel/v1/channel"; +import * as _128 from "./core/channel/v1/genesis"; +import * as _129 from "./core/channel/v1/query"; +import * as _130 from "./core/channel/v1/tx"; +import * as _131 from "./core/client/v1/client"; +import * as _132 from "./core/client/v1/genesis"; +import * as _133 from "./core/client/v1/query"; +import * as _134 from "./core/client/v1/tx"; +import * as _391 from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as _392 from "./applications/interchain_accounts/host/v1/tx.amino"; +import * as _393 from "./applications/transfer/v1/tx.amino"; +import * as _394 from "./core/channel/v1/tx.amino"; +import * as _395 from "./core/client/v1/tx.amino"; +import * as _396 from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as _397 from "./applications/interchain_accounts/host/v1/tx.registry"; +import * as _398 from "./applications/transfer/v1/tx.registry"; +import * as _399 from "./core/channel/v1/tx.registry"; +import * as _400 from "./core/client/v1/tx.registry"; +import * as _401 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; +import * as _402 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; +import * as _403 from "./applications/transfer/v1/query.rpc.Query"; +import * as _404 from "./core/channel/v1/query.rpc.Query"; +import * as _405 from "./core/client/v1/query.rpc.Query"; +import * as _406 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; +import * as _407 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; +import * as _408 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _409 from "./core/channel/v1/tx.rpc.msg"; +import * as _410 from "./core/client/v1/tx.rpc.msg"; +import * as _549 from "./rpc.query"; +import * as _550 from "./rpc.tx"; export namespace ibc { export namespace applications { export namespace interchain_accounts { export namespace controller { export const v1 = { - ..._109, - ..._110, - ..._111, - ..._383, - ..._388, - ..._393, - ..._398 + ..._113, + ..._114, + ..._115, + ..._391, + ..._396, + ..._401, + ..._406 }; } export namespace host { export const v1 = { - ..._112, - ..._113, - ..._114, - ..._384, - ..._389, - ..._394, - ..._399 + ..._116, + ..._117, + ..._118, + ..._392, + ..._397, + ..._402, + ..._407 }; } export const v1 = { - ..._115, - ..._116, - ..._117 - }; - } - export namespace transfer { - export const v1 = { - ..._118, ..._119, ..._120, - ..._121, - ..._122, - ..._385, - ..._390, - ..._395, - ..._400 + ..._121 }; } - } - export namespace core { - export namespace channel { + export namespace transfer { export const v1 = { + ..._122, ..._123, ..._124, ..._125, ..._126, - ..._386, - ..._391, - ..._396, - ..._401 + ..._393, + ..._398, + ..._403, + ..._408 }; } - export namespace client { + } + export namespace core { + export namespace channel { export const v1 = { ..._127, ..._128, ..._129, ..._130, - ..._387, - ..._392, - ..._397, - ..._402 + ..._394, + ..._399, + ..._404, + ..._409 + }; + } + export namespace client { + export const v1 = { + ..._131, + ..._132, + ..._133, + ..._134, + ..._395, + ..._400, + ..._405, + ..._410 }; } } export const ClientFactory = { - ..._541, - ..._542 + ..._549, + ..._550 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/rpc.query.ts b/packages/types/protobuf/codegen/ibc/rpc.query.ts index 493f63885..bb51968df 100644 --- a/packages/types/protobuf/codegen/ibc/rpc.query.ts +++ b/packages/types/protobuf/codegen/ibc/rpc.query.ts @@ -26,6 +26,9 @@ export const createRPCQueryClient = async ({ distribution: { v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, gov: { v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) diff --git a/packages/types/protobuf/codegen/ibc/rpc.tx.ts b/packages/types/protobuf/codegen/ibc/rpc.tx.ts index c7236772f..14f8597c8 100644 --- a/packages/types/protobuf/codegen/ibc/rpc.tx.ts +++ b/packages/types/protobuf/codegen/ibc/rpc.tx.ts @@ -17,6 +17,9 @@ export const createRPCMsgClient = async ({ distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, gov: { v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) diff --git a/packages/types/protobuf/codegen/juno/bundle.ts b/packages/types/protobuf/codegen/juno/bundle.ts index 5fca0bbba..34bedb68f 100644 --- a/packages/types/protobuf/codegen/juno/bundle.ts +++ b/packages/types/protobuf/codegen/juno/bundle.ts @@ -1,46 +1,46 @@ -import * as _131 from "./feeshare/v1/feeshare"; -import * as _132 from "./feeshare/v1/genesis"; -import * as _133 from "./feeshare/v1/query"; -import * as _134 from "./feeshare/v1/tx"; -import * as _135 from "./mint/genesis"; -import * as _136 from "./mint/mint"; -import * as _137 from "./mint/query"; -import * as _138 from "./mint/tx"; -import * as _403 from "./feeshare/v1/tx.amino"; -import * as _404 from "./mint/tx.amino"; -import * as _405 from "./feeshare/v1/tx.registry"; -import * as _406 from "./mint/tx.registry"; -import * as _407 from "./feeshare/v1/query.rpc.Query"; -import * as _408 from "./mint/query.rpc.Query"; -import * as _409 from "./feeshare/v1/tx.rpc.msg"; -import * as _410 from "./mint/tx.rpc.msg"; -import * as _543 from "./rpc.query"; -import * as _544 from "./rpc.tx"; +import * as _135 from "./feeshare/v1/feeshare"; +import * as _136 from "./feeshare/v1/genesis"; +import * as _137 from "./feeshare/v1/query"; +import * as _138 from "./feeshare/v1/tx"; +import * as _139 from "./mint/genesis"; +import * as _140 from "./mint/mint"; +import * as _141 from "./mint/query"; +import * as _142 from "./mint/tx"; +import * as _411 from "./feeshare/v1/tx.amino"; +import * as _412 from "./mint/tx.amino"; +import * as _413 from "./feeshare/v1/tx.registry"; +import * as _414 from "./mint/tx.registry"; +import * as _415 from "./feeshare/v1/query.rpc.Query"; +import * as _416 from "./mint/query.rpc.Query"; +import * as _417 from "./feeshare/v1/tx.rpc.msg"; +import * as _418 from "./mint/tx.rpc.msg"; +import * as _551 from "./rpc.query"; +import * as _552 from "./rpc.tx"; export namespace juno { export namespace feeshare { export const v1 = { - ..._131, - ..._132, - ..._133, - ..._134, - ..._403, - ..._405, - ..._407, - ..._409 + ..._135, + ..._136, + ..._137, + ..._138, + ..._411, + ..._413, + ..._415, + ..._417 }; } export const mint = { - ..._135, - ..._136, - ..._137, - ..._138, - ..._404, - ..._406, - ..._408, - ..._410 + ..._139, + ..._140, + ..._141, + ..._142, + ..._412, + ..._414, + ..._416, + ..._418 }; export const ClientFactory = { - ..._543, - ..._544 + ..._551, + ..._552 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/juno/rpc.query.ts b/packages/types/protobuf/codegen/juno/rpc.query.ts index 182fed4ab..4cf3955e0 100644 --- a/packages/types/protobuf/codegen/juno/rpc.query.ts +++ b/packages/types/protobuf/codegen/juno/rpc.query.ts @@ -26,6 +26,9 @@ export const createRPCQueryClient = async ({ distribution: { v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, gov: { v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) diff --git a/packages/types/protobuf/codegen/juno/rpc.tx.ts b/packages/types/protobuf/codegen/juno/rpc.tx.ts index c8abfe305..cc3112731 100644 --- a/packages/types/protobuf/codegen/juno/rpc.tx.ts +++ b/packages/types/protobuf/codegen/juno/rpc.tx.ts @@ -17,6 +17,9 @@ export const createRPCMsgClient = async ({ distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, gov: { v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) diff --git a/packages/types/protobuf/codegen/kujira/bundle.ts b/packages/types/protobuf/codegen/kujira/bundle.ts index 288dad325..aa4330774 100644 --- a/packages/types/protobuf/codegen/kujira/bundle.ts +++ b/packages/types/protobuf/codegen/kujira/bundle.ts @@ -1,60 +1,60 @@ -import * as _139 from "./denom/authorityMetadata"; -import * as _140 from "./denom/genesis"; -import * as _141 from "./denom/params"; -import * as _142 from "./denom/query"; -import * as _143 from "./denom/tx"; -import * as _144 from "./oracle/genesis"; -import * as _145 from "./oracle/oracle"; -import * as _146 from "./oracle/query"; -import * as _147 from "./oracle/tx"; -import * as _148 from "./scheduler/genesis"; -import * as _149 from "./scheduler/hook"; -import * as _150 from "./scheduler/params"; -import * as _151 from "./scheduler/proposal"; -import * as _152 from "./scheduler/query"; -import * as _411 from "./denom/tx.amino"; -import * as _412 from "./oracle/tx.amino"; -import * as _413 from "./denom/tx.registry"; -import * as _414 from "./oracle/tx.registry"; -import * as _415 from "./denom/query.rpc.Query"; -import * as _416 from "./oracle/query.rpc.Query"; -import * as _417 from "./scheduler/query.rpc.Query"; -import * as _418 from "./denom/tx.rpc.msg"; -import * as _419 from "./oracle/tx.rpc.msg"; -import * as _545 from "./rpc.query"; -import * as _546 from "./rpc.tx"; +import * as _143 from "./denom/authorityMetadata"; +import * as _144 from "./denom/genesis"; +import * as _145 from "./denom/params"; +import * as _146 from "./denom/query"; +import * as _147 from "./denom/tx"; +import * as _148 from "./oracle/genesis"; +import * as _149 from "./oracle/oracle"; +import * as _150 from "./oracle/query"; +import * as _151 from "./oracle/tx"; +import * as _152 from "./scheduler/genesis"; +import * as _153 from "./scheduler/hook"; +import * as _154 from "./scheduler/params"; +import * as _155 from "./scheduler/proposal"; +import * as _156 from "./scheduler/query"; +import * as _419 from "./denom/tx.amino"; +import * as _420 from "./oracle/tx.amino"; +import * as _421 from "./denom/tx.registry"; +import * as _422 from "./oracle/tx.registry"; +import * as _423 from "./denom/query.rpc.Query"; +import * as _424 from "./oracle/query.rpc.Query"; +import * as _425 from "./scheduler/query.rpc.Query"; +import * as _426 from "./denom/tx.rpc.msg"; +import * as _427 from "./oracle/tx.rpc.msg"; +import * as _553 from "./rpc.query"; +import * as _554 from "./rpc.tx"; export namespace kujira { export const denom = { - ..._139, - ..._140, - ..._141, - ..._142, ..._143, - ..._411, - ..._413, - ..._415, - ..._418 - }; - export const oracle = { ..._144, ..._145, ..._146, ..._147, - ..._412, - ..._414, - ..._416, - ..._419 + ..._419, + ..._421, + ..._423, + ..._426 }; - export const scheduler = { + export const oracle = { ..._148, ..._149, ..._150, ..._151, + ..._420, + ..._422, + ..._424, + ..._427 + }; + export const scheduler = { ..._152, - ..._417 + ..._153, + ..._154, + ..._155, + ..._156, + ..._425 }; export const ClientFactory = { - ..._545, - ..._546 + ..._553, + ..._554 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/rpc.query.ts b/packages/types/protobuf/codegen/kujira/rpc.query.ts index 30026d835..a7c8e57b3 100644 --- a/packages/types/protobuf/codegen/kujira/rpc.query.ts +++ b/packages/types/protobuf/codegen/kujira/rpc.query.ts @@ -26,6 +26,9 @@ export const createRPCQueryClient = async ({ distribution: { v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, gov: { v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) diff --git a/packages/types/protobuf/codegen/kujira/rpc.tx.ts b/packages/types/protobuf/codegen/kujira/rpc.tx.ts index 2e5d39762..b10034d26 100644 --- a/packages/types/protobuf/codegen/kujira/rpc.tx.ts +++ b/packages/types/protobuf/codegen/kujira/rpc.tx.ts @@ -17,6 +17,9 @@ export const createRPCMsgClient = async ({ distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, gov: { v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) diff --git a/packages/types/protobuf/codegen/neutron/bundle.ts b/packages/types/protobuf/codegen/neutron/bundle.ts index ede7d49df..6544a2b85 100644 --- a/packages/types/protobuf/codegen/neutron/bundle.ts +++ b/packages/types/protobuf/codegen/neutron/bundle.ts @@ -1,89 +1,85 @@ -import * as _153 from "./contractmanager/v1/failure"; -import * as _154 from "./cron/genesis"; -import * as _155 from "./cron/params"; -import * as _156 from "./cron/query"; -import * as _157 from "./cron/schedule"; -import * as _158 from "./cron/tx"; -import * as _159 from "./dex/deposit_record"; -import * as _160 from "./dex/genesis"; -import * as _161 from "./dex/limit_order_expiration"; -import * as _162 from "./dex/limit_order_tranche_user"; -import * as _163 from "./dex/limit_order_tranche"; -import * as _164 from "./dex/pair_id"; -import * as _165 from "./dex/params"; -import * as _166 from "./dex/pool_metadata"; -import * as _167 from "./dex/pool_reserves"; -import * as _168 from "./dex/pool"; -import * as _169 from "./dex/query"; -import * as _170 from "./dex/tick_liquidity"; -import * as _171 from "./dex/trade_pair_id"; -import * as _172 from "./dex/tx"; -import * as _173 from "./feeburner/genesis"; -import * as _174 from "./feeburner/params"; -import * as _175 from "./feeburner/query"; -import * as _176 from "./feeburner/total_burned_neutrons_amount"; -import * as _177 from "./feeburner/tx"; -import * as _178 from "./feerefunder/fee"; -import * as _179 from "./feerefunder/genesis"; -import * as _180 from "./feerefunder/params"; -import * as _181 from "./feerefunder/query"; -import * as _182 from "./feerefunder/tx"; -import * as _183 from "./interchainqueries/genesis"; -import * as _184 from "./interchainqueries/params"; -import * as _185 from "./interchainqueries/query"; -import * as _186 from "./interchainqueries/tx"; -import * as _187 from "./interchaintxs/v1/genesis"; -import * as _188 from "./interchaintxs/v1/params"; -import * as _189 from "./interchaintxs/v1/query"; -import * as _190 from "./interchaintxs/v1/tx"; -import * as _420 from "./cron/tx.amino"; -import * as _421 from "./dex/tx.amino"; -import * as _422 from "./feeburner/tx.amino"; -import * as _423 from "./feerefunder/tx.amino"; -import * as _424 from "./interchainqueries/tx.amino"; -import * as _425 from "./interchaintxs/v1/tx.amino"; -import * as _426 from "./cron/tx.registry"; -import * as _427 from "./dex/tx.registry"; -import * as _428 from "./feeburner/tx.registry"; -import * as _429 from "./feerefunder/tx.registry"; -import * as _430 from "./interchainqueries/tx.registry"; -import * as _431 from "./interchaintxs/v1/tx.registry"; -import * as _432 from "./cron/query.rpc.Query"; -import * as _433 from "./dex/query.rpc.Query"; -import * as _434 from "./feeburner/query.rpc.Query"; -import * as _435 from "./feerefunder/query.rpc.Query"; -import * as _436 from "./interchainqueries/query.rpc.Query"; -import * as _437 from "./interchaintxs/v1/query.rpc.Query"; -import * as _438 from "./cron/tx.rpc.msg"; -import * as _439 from "./dex/tx.rpc.msg"; -import * as _440 from "./feeburner/tx.rpc.msg"; -import * as _441 from "./feerefunder/tx.rpc.msg"; -import * as _442 from "./interchainqueries/tx.rpc.msg"; -import * as _443 from "./interchaintxs/v1/tx.rpc.msg"; -import * as _547 from "./rpc.query"; -import * as _548 from "./rpc.tx"; +import * as _157 from "./contractmanager/v1/failure"; +import * as _158 from "./cron/genesis"; +import * as _159 from "./cron/params"; +import * as _160 from "./cron/query"; +import * as _161 from "./cron/schedule"; +import * as _162 from "./cron/tx"; +import * as _163 from "./dex/deposit_record"; +import * as _164 from "./dex/genesis"; +import * as _165 from "./dex/limit_order_expiration"; +import * as _166 from "./dex/limit_order_tranche_user"; +import * as _167 from "./dex/limit_order_tranche"; +import * as _168 from "./dex/pair_id"; +import * as _169 from "./dex/params"; +import * as _170 from "./dex/pool_metadata"; +import * as _171 from "./dex/pool_reserves"; +import * as _172 from "./dex/pool"; +import * as _173 from "./dex/query"; +import * as _174 from "./dex/tick_liquidity"; +import * as _175 from "./dex/trade_pair_id"; +import * as _176 from "./dex/tx"; +import * as _177 from "./feeburner/genesis"; +import * as _178 from "./feeburner/params"; +import * as _179 from "./feeburner/query"; +import * as _180 from "./feeburner/total_burned_neutrons_amount"; +import * as _181 from "./feeburner/tx"; +import * as _182 from "./feerefunder/fee"; +import * as _183 from "./feerefunder/genesis"; +import * as _184 from "./feerefunder/params"; +import * as _185 from "./feerefunder/query"; +import * as _186 from "./feerefunder/tx"; +import * as _187 from "./interchainqueries/genesis"; +import * as _188 from "./interchainqueries/params"; +import * as _189 from "./interchainqueries/query"; +import * as _190 from "./interchainqueries/tx"; +import * as _191 from "./interchaintxs/v1/genesis"; +import * as _192 from "./interchaintxs/v1/params"; +import * as _193 from "./interchaintxs/v1/query"; +import * as _194 from "./interchaintxs/v1/tx"; +import * as _428 from "./cron/tx.amino"; +import * as _429 from "./dex/tx.amino"; +import * as _430 from "./feeburner/tx.amino"; +import * as _431 from "./feerefunder/tx.amino"; +import * as _432 from "./interchainqueries/tx.amino"; +import * as _433 from "./interchaintxs/v1/tx.amino"; +import * as _434 from "./cron/tx.registry"; +import * as _435 from "./dex/tx.registry"; +import * as _436 from "./feeburner/tx.registry"; +import * as _437 from "./feerefunder/tx.registry"; +import * as _438 from "./interchainqueries/tx.registry"; +import * as _439 from "./interchaintxs/v1/tx.registry"; +import * as _440 from "./cron/query.rpc.Query"; +import * as _441 from "./dex/query.rpc.Query"; +import * as _442 from "./feeburner/query.rpc.Query"; +import * as _443 from "./feerefunder/query.rpc.Query"; +import * as _444 from "./interchainqueries/query.rpc.Query"; +import * as _445 from "./interchaintxs/v1/query.rpc.Query"; +import * as _446 from "./cron/tx.rpc.msg"; +import * as _447 from "./dex/tx.rpc.msg"; +import * as _448 from "./feeburner/tx.rpc.msg"; +import * as _449 from "./feerefunder/tx.rpc.msg"; +import * as _450 from "./interchainqueries/tx.rpc.msg"; +import * as _451 from "./interchaintxs/v1/tx.rpc.msg"; +import * as _555 from "./rpc.query"; +import * as _556 from "./rpc.tx"; export namespace neutron { export namespace contractmanager { export const v1 = { - ..._153 + ..._157 }; } export const cron = { - ..._154, - ..._155, - ..._156, - ..._157, ..._158, - ..._420, - ..._426, - ..._432, - ..._438 - }; - export const dex = { ..._159, ..._160, ..._161, ..._162, + ..._428, + ..._434, + ..._440, + ..._446 + }; + export const dex = { ..._163, ..._164, ..._165, @@ -94,57 +90,61 @@ export namespace neutron { ..._170, ..._171, ..._172, - ..._421, - ..._427, - ..._433, - ..._439 - }; - export const feeburner = { ..._173, ..._174, ..._175, ..._176, - ..._177, - ..._422, - ..._428, - ..._434, - ..._440 + ..._429, + ..._435, + ..._441, + ..._447 }; - export const feerefunder = { + export const feeburner = { + ..._177, ..._178, ..._179, ..._180, ..._181, - ..._182, - ..._423, - ..._429, - ..._435, - ..._441 + ..._430, + ..._436, + ..._442, + ..._448 }; - export const interchainqueries = { + export const feerefunder = { + ..._182, ..._183, ..._184, ..._185, ..._186, - ..._424, - ..._430, - ..._436, - ..._442 + ..._431, + ..._437, + ..._443, + ..._449 + }; + export const interchainqueries = { + ..._187, + ..._188, + ..._189, + ..._190, + ..._432, + ..._438, + ..._444, + ..._450 }; export namespace interchaintxs { export const v1 = { - ..._187, - ..._188, - ..._189, - ..._190, - ..._425, - ..._431, - ..._437, - ..._443 + ..._191, + ..._192, + ..._193, + ..._194, + ..._433, + ..._439, + ..._445, + ..._451 }; } export const ClientFactory = { - ..._547, - ..._548 + ..._555, + ..._556 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/neutron/rpc.query.ts b/packages/types/protobuf/codegen/neutron/rpc.query.ts index 78b501d8a..6a2fc37fe 100644 --- a/packages/types/protobuf/codegen/neutron/rpc.query.ts +++ b/packages/types/protobuf/codegen/neutron/rpc.query.ts @@ -26,6 +26,9 @@ export const createRPCQueryClient = async ({ distribution: { v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, gov: { v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) diff --git a/packages/types/protobuf/codegen/neutron/rpc.tx.ts b/packages/types/protobuf/codegen/neutron/rpc.tx.ts index afec23df6..9c391ea03 100644 --- a/packages/types/protobuf/codegen/neutron/rpc.tx.ts +++ b/packages/types/protobuf/codegen/neutron/rpc.tx.ts @@ -17,6 +17,9 @@ export const createRPCMsgClient = async ({ distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, gov: { v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) diff --git a/packages/types/protobuf/codegen/noble/bundle.ts b/packages/types/protobuf/codegen/noble/bundle.ts index 97930acb4..3f83576e3 100644 --- a/packages/types/protobuf/codegen/noble/bundle.ts +++ b/packages/types/protobuf/codegen/noble/bundle.ts @@ -1,16 +1,16 @@ -import * as _307 from "../tariff/genesis"; -import * as _308 from "../tariff/params"; -import * as _309 from "../tariff/query"; -import * as _530 from "../tariff/query.rpc.Query"; -import * as _555 from "./rpc.query"; +import * as _311 from "../tariff/genesis"; +import * as _312 from "../tariff/params"; +import * as _313 from "../tariff/query"; +import * as _538 from "../tariff/query.rpc.Query"; +import * as _563 from "./rpc.query"; export namespace noble { export const tariff = { - ..._307, - ..._308, - ..._309, - ..._530 + ..._311, + ..._312, + ..._313, + ..._538 }; export const ClientFactory = { - ..._555 + ..._563 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/noble/rpc.query.ts b/packages/types/protobuf/codegen/noble/rpc.query.ts index 24c9736e2..00d067ffb 100644 --- a/packages/types/protobuf/codegen/noble/rpc.query.ts +++ b/packages/types/protobuf/codegen/noble/rpc.query.ts @@ -26,6 +26,9 @@ export const createRPCQueryClient = async ({ distribution: { v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, gov: { v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) diff --git a/packages/types/protobuf/codegen/osmosis/bundle.ts b/packages/types/protobuf/codegen/osmosis/bundle.ts index 4e946b228..2aaf73ae0 100644 --- a/packages/types/protobuf/codegen/osmosis/bundle.ts +++ b/packages/types/protobuf/codegen/osmosis/bundle.ts @@ -1,157 +1,153 @@ -import * as _191 from "./accum/v1beta1/accum"; -import * as _192 from "./concentratedliquidity/params"; -import * as _193 from "./cosmwasmpool/v1beta1/genesis"; -import * as _194 from "./cosmwasmpool/v1beta1/gov"; -import * as _195 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; -import * as _196 from "./cosmwasmpool/v1beta1/model/module_query_msg"; -import * as _197 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; -import * as _198 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; -import * as _199 from "./cosmwasmpool/v1beta1/model/pool"; -import * as _200 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; -import * as _201 from "./cosmwasmpool/v1beta1/model/tx"; -import * as _202 from "./cosmwasmpool/v1beta1/params"; -import * as _203 from "./cosmwasmpool/v1beta1/query"; -import * as _204 from "./cosmwasmpool/v1beta1/tx"; -import * as _205 from "./gamm/pool-models/balancer/balancerPool"; -import * as _206 from "./gamm/v1beta1/genesis"; -import * as _207 from "./gamm/v1beta1/gov"; -import * as _208 from "./gamm/v1beta1/query"; -import * as _209 from "./gamm/v1beta1/shared"; -import * as _210 from "./gamm/v1beta1/tx"; -import * as _211 from "./gamm/pool-models/balancer/tx/tx"; -import * as _212 from "./gamm/pool-models/stableswap/stableswap_pool"; -import * as _213 from "./gamm/pool-models/stableswap/tx"; -import * as _214 from "./incentives/gauge"; -import * as _215 from "./incentives/genesis"; -import * as _216 from "./incentives/gov"; -import * as _217 from "./incentives/group"; -import * as _218 from "./incentives/params"; -import * as _219 from "./incentives/query"; -import * as _220 from "./incentives/tx"; -import * as _221 from "./lockup/genesis"; -import * as _222 from "./lockup/lock"; -import * as _223 from "./lockup/params"; -import * as _224 from "./lockup/query"; -import * as _225 from "./lockup/tx"; -import * as _226 from "./pool-incentives/v1beta1/genesis"; -import * as _227 from "./pool-incentives/v1beta1/gov"; -import * as _228 from "./pool-incentives/v1beta1/incentives"; -import * as _229 from "./pool-incentives/v1beta1/query"; -import * as _230 from "./pool-incentives/v1beta1/shared"; -import * as _231 from "./poolmanager/v1beta1/genesis"; -import * as _232 from "./poolmanager/v1beta1/gov"; -import * as _233 from "./poolmanager/v1beta1/module_route"; -import * as _234 from "./poolmanager/v1beta1/query"; -import * as _235 from "./poolmanager/v1beta1/swap_route"; -import * as _236 from "./poolmanager/v1beta1/tx"; -import * as _237 from "./protorev/v1beta1/genesis"; -import * as _238 from "./protorev/v1beta1/gov"; -import * as _239 from "./protorev/v1beta1/params"; -import * as _240 from "./protorev/v1beta1/protorev"; -import * as _241 from "./protorev/v1beta1/query"; -import * as _242 from "./protorev/v1beta1/tx"; -import * as _243 from "./superfluid/genesis"; -import * as _244 from "./superfluid/params"; -import * as _245 from "./superfluid/query"; -import * as _246 from "./superfluid/superfluid"; -import * as _247 from "./superfluid/tx"; -import * as _248 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _249 from "./tokenfactory/v1beta1/genesis"; -import * as _250 from "./tokenfactory/v1beta1/params"; -import * as _251 from "./tokenfactory/v1beta1/query"; -import * as _252 from "./tokenfactory/v1beta1/tx"; -import * as _253 from "./txfees/v1beta1/feetoken"; -import * as _254 from "./txfees/v1beta1/genesis"; -import * as _255 from "./txfees/v1beta1/gov"; -import * as _256 from "./txfees/v1beta1/params"; -import * as _257 from "./txfees/v1beta1/query"; -import * as _258 from "./txfees/v1beta1/tx"; -import * as _259 from "./valset-pref/v1beta1/query"; -import * as _260 from "./valset-pref/v1beta1/state"; -import * as _261 from "./valset-pref/v1beta1/tx"; -import * as _444 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; -import * as _445 from "./concentratedliquidity/v1beta1/tx.amino"; -import * as _446 from "./gamm/pool-models/balancer/tx/tx.amino"; -import * as _447 from "./gamm/pool-models/stableswap/tx.amino"; -import * as _448 from "./gamm/v1beta1/tx.amino"; -import * as _449 from "./incentives/tx.amino"; -import * as _450 from "./lockup/tx.amino"; -import * as _451 from "./poolmanager/v1beta1/tx.amino"; -import * as _452 from "./protorev/v1beta1/tx.amino"; -import * as _453 from "./superfluid/tx.amino"; -import * as _454 from "./tokenfactory/v1beta1/tx.amino"; -import * as _455 from "./txfees/v1beta1/tx.amino"; -import * as _456 from "./valset-pref/v1beta1/tx.amino"; -import * as _457 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; -import * as _458 from "./concentratedliquidity/v1beta1/tx.registry"; -import * as _459 from "./gamm/pool-models/balancer/tx/tx.registry"; -import * as _460 from "./gamm/pool-models/stableswap/tx.registry"; -import * as _461 from "./gamm/v1beta1/tx.registry"; -import * as _462 from "./incentives/tx.registry"; -import * as _463 from "./lockup/tx.registry"; -import * as _464 from "./poolmanager/v1beta1/tx.registry"; -import * as _465 from "./protorev/v1beta1/tx.registry"; -import * as _466 from "./superfluid/tx.registry"; -import * as _467 from "./tokenfactory/v1beta1/tx.registry"; -import * as _468 from "./txfees/v1beta1/tx.registry"; -import * as _469 from "./valset-pref/v1beta1/tx.registry"; -import * as _470 from "./concentratedliquidity/v1beta1/query.rpc.Query"; -import * as _471 from "./cosmwasmpool/v1beta1/query.rpc.Query"; -import * as _472 from "./gamm/v1beta1/query.rpc.Query"; -import * as _473 from "./incentives/query.rpc.Query"; -import * as _474 from "./lockup/query.rpc.Query"; -import * as _475 from "./pool-incentives/v1beta1/query.rpc.Query"; -import * as _476 from "./poolmanager/v1beta1/query.rpc.Query"; -import * as _477 from "./protorev/v1beta1/query.rpc.Query"; -import * as _478 from "./superfluid/query.rpc.Query"; -import * as _479 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _480 from "./txfees/v1beta1/query.rpc.Query"; -import * as _481 from "./valset-pref/v1beta1/query.rpc.Query"; -import * as _482 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; -import * as _483 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; -import * as _484 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; -import * as _485 from "./gamm/pool-models/stableswap/tx.rpc.msg"; -import * as _486 from "./gamm/v1beta1/tx.rpc.msg"; -import * as _487 from "./incentives/tx.rpc.msg"; -import * as _488 from "./lockup/tx.rpc.msg"; -import * as _489 from "./poolmanager/v1beta1/tx.rpc.msg"; -import * as _490 from "./protorev/v1beta1/tx.rpc.msg"; -import * as _491 from "./superfluid/tx.rpc.msg"; -import * as _492 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _493 from "./txfees/v1beta1/tx.rpc.msg"; -import * as _494 from "./valset-pref/v1beta1/tx.rpc.msg"; -import * as _549 from "./rpc.query"; -import * as _550 from "./rpc.tx"; +import * as _195 from "./accum/v1beta1/accum"; +import * as _196 from "./concentratedliquidity/params"; +import * as _197 from "./cosmwasmpool/v1beta1/genesis"; +import * as _198 from "./cosmwasmpool/v1beta1/gov"; +import * as _199 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; +import * as _200 from "./cosmwasmpool/v1beta1/model/module_query_msg"; +import * as _201 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; +import * as _202 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; +import * as _203 from "./cosmwasmpool/v1beta1/model/pool"; +import * as _204 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; +import * as _205 from "./cosmwasmpool/v1beta1/model/tx"; +import * as _206 from "./cosmwasmpool/v1beta1/params"; +import * as _207 from "./cosmwasmpool/v1beta1/query"; +import * as _208 from "./cosmwasmpool/v1beta1/tx"; +import * as _209 from "./gamm/pool-models/balancer/balancerPool"; +import * as _210 from "./gamm/v1beta1/genesis"; +import * as _211 from "./gamm/v1beta1/gov"; +import * as _212 from "./gamm/v1beta1/query"; +import * as _213 from "./gamm/v1beta1/shared"; +import * as _214 from "./gamm/v1beta1/tx"; +import * as _215 from "./gamm/pool-models/balancer/tx/tx"; +import * as _216 from "./gamm/pool-models/stableswap/stableswap_pool"; +import * as _217 from "./gamm/pool-models/stableswap/tx"; +import * as _218 from "./incentives/gauge"; +import * as _219 from "./incentives/genesis"; +import * as _220 from "./incentives/gov"; +import * as _221 from "./incentives/group"; +import * as _222 from "./incentives/params"; +import * as _223 from "./incentives/query"; +import * as _224 from "./incentives/tx"; +import * as _225 from "./lockup/genesis"; +import * as _226 from "./lockup/lock"; +import * as _227 from "./lockup/params"; +import * as _228 from "./lockup/query"; +import * as _229 from "./lockup/tx"; +import * as _230 from "./pool-incentives/v1beta1/genesis"; +import * as _231 from "./pool-incentives/v1beta1/gov"; +import * as _232 from "./pool-incentives/v1beta1/incentives"; +import * as _233 from "./pool-incentives/v1beta1/query"; +import * as _234 from "./pool-incentives/v1beta1/shared"; +import * as _235 from "./poolmanager/v1beta1/genesis"; +import * as _236 from "./poolmanager/v1beta1/gov"; +import * as _237 from "./poolmanager/v1beta1/module_route"; +import * as _238 from "./poolmanager/v1beta1/query"; +import * as _239 from "./poolmanager/v1beta1/swap_route"; +import * as _240 from "./poolmanager/v1beta1/tx"; +import * as _241 from "./protorev/v1beta1/genesis"; +import * as _242 from "./protorev/v1beta1/gov"; +import * as _243 from "./protorev/v1beta1/params"; +import * as _244 from "./protorev/v1beta1/protorev"; +import * as _245 from "./protorev/v1beta1/query"; +import * as _246 from "./protorev/v1beta1/tx"; +import * as _247 from "./superfluid/genesis"; +import * as _248 from "./superfluid/params"; +import * as _249 from "./superfluid/query"; +import * as _250 from "./superfluid/superfluid"; +import * as _251 from "./superfluid/tx"; +import * as _252 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _253 from "./tokenfactory/v1beta1/genesis"; +import * as _254 from "./tokenfactory/v1beta1/params"; +import * as _255 from "./tokenfactory/v1beta1/query"; +import * as _256 from "./tokenfactory/v1beta1/tx"; +import * as _257 from "./txfees/v1beta1/feetoken"; +import * as _258 from "./txfees/v1beta1/genesis"; +import * as _259 from "./txfees/v1beta1/gov"; +import * as _260 from "./txfees/v1beta1/params"; +import * as _261 from "./txfees/v1beta1/query"; +import * as _262 from "./txfees/v1beta1/tx"; +import * as _263 from "./valset-pref/v1beta1/query"; +import * as _264 from "./valset-pref/v1beta1/state"; +import * as _265 from "./valset-pref/v1beta1/tx"; +import * as _452 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; +import * as _453 from "./concentratedliquidity/v1beta1/tx.amino"; +import * as _454 from "./gamm/pool-models/balancer/tx/tx.amino"; +import * as _455 from "./gamm/pool-models/stableswap/tx.amino"; +import * as _456 from "./gamm/v1beta1/tx.amino"; +import * as _457 from "./incentives/tx.amino"; +import * as _458 from "./lockup/tx.amino"; +import * as _459 from "./poolmanager/v1beta1/tx.amino"; +import * as _460 from "./protorev/v1beta1/tx.amino"; +import * as _461 from "./superfluid/tx.amino"; +import * as _462 from "./tokenfactory/v1beta1/tx.amino"; +import * as _463 from "./txfees/v1beta1/tx.amino"; +import * as _464 from "./valset-pref/v1beta1/tx.amino"; +import * as _465 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; +import * as _466 from "./concentratedliquidity/v1beta1/tx.registry"; +import * as _467 from "./gamm/pool-models/balancer/tx/tx.registry"; +import * as _468 from "./gamm/pool-models/stableswap/tx.registry"; +import * as _469 from "./gamm/v1beta1/tx.registry"; +import * as _470 from "./incentives/tx.registry"; +import * as _471 from "./lockup/tx.registry"; +import * as _472 from "./poolmanager/v1beta1/tx.registry"; +import * as _473 from "./protorev/v1beta1/tx.registry"; +import * as _474 from "./superfluid/tx.registry"; +import * as _475 from "./tokenfactory/v1beta1/tx.registry"; +import * as _476 from "./txfees/v1beta1/tx.registry"; +import * as _477 from "./valset-pref/v1beta1/tx.registry"; +import * as _478 from "./concentratedliquidity/v1beta1/query.rpc.Query"; +import * as _479 from "./cosmwasmpool/v1beta1/query.rpc.Query"; +import * as _480 from "./gamm/v1beta1/query.rpc.Query"; +import * as _481 from "./incentives/query.rpc.Query"; +import * as _482 from "./lockup/query.rpc.Query"; +import * as _483 from "./pool-incentives/v1beta1/query.rpc.Query"; +import * as _484 from "./poolmanager/v1beta1/query.rpc.Query"; +import * as _485 from "./protorev/v1beta1/query.rpc.Query"; +import * as _486 from "./superfluid/query.rpc.Query"; +import * as _487 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _488 from "./txfees/v1beta1/query.rpc.Query"; +import * as _489 from "./valset-pref/v1beta1/query.rpc.Query"; +import * as _490 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; +import * as _491 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; +import * as _492 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; +import * as _493 from "./gamm/pool-models/stableswap/tx.rpc.msg"; +import * as _494 from "./gamm/v1beta1/tx.rpc.msg"; +import * as _495 from "./incentives/tx.rpc.msg"; +import * as _496 from "./lockup/tx.rpc.msg"; +import * as _497 from "./poolmanager/v1beta1/tx.rpc.msg"; +import * as _498 from "./protorev/v1beta1/tx.rpc.msg"; +import * as _499 from "./superfluid/tx.rpc.msg"; +import * as _500 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _501 from "./txfees/v1beta1/tx.rpc.msg"; +import * as _502 from "./valset-pref/v1beta1/tx.rpc.msg"; +import * as _557 from "./rpc.query"; +import * as _558 from "./rpc.tx"; export namespace osmosis { export namespace accum { export const v1beta1 = { - ..._191 + ..._195 }; } export const concentratedliquidity = { - ..._192, + ..._196, poolmodel: { concentrated: { v1beta1: { - ..._444, - ..._457, - ..._482 + ..._452, + ..._465, + ..._490 } } }, v1beta1: { - ..._445, - ..._458, - ..._470, - ..._483 + ..._453, + ..._466, + ..._478, + ..._491 } }; export namespace cosmwasmpool { export const v1beta1 = { - ..._193, - ..._194, - ..._195, - ..._196, ..._197, ..._198, ..._199, @@ -160,155 +156,159 @@ export namespace osmosis { ..._202, ..._203, ..._204, - ..._471 - }; - } - export namespace gamm { - export const v1beta1 = { ..._205, ..._206, ..._207, ..._208, + ..._479 + }; + } + export namespace gamm { + export const v1beta1 = { ..._209, ..._210, - ..._448, - ..._461, - ..._472, - ..._486 + ..._211, + ..._212, + ..._213, + ..._214, + ..._456, + ..._469, + ..._480, + ..._494 }; export namespace poolmodels { export namespace balancer { export const v1beta1 = { - ..._211, - ..._446, - ..._459, - ..._484 + ..._215, + ..._454, + ..._467, + ..._492 }; } export namespace stableswap { export const v1beta1 = { - ..._212, - ..._213, - ..._447, - ..._460, - ..._485 + ..._216, + ..._217, + ..._455, + ..._468, + ..._493 }; } } } export const incentives = { - ..._214, - ..._215, - ..._216, - ..._217, ..._218, ..._219, ..._220, - ..._449, - ..._462, - ..._473, - ..._487 - }; - export const lockup = { ..._221, ..._222, ..._223, ..._224, + ..._457, + ..._470, + ..._481, + ..._495 + }; + export const lockup = { ..._225, - ..._450, - ..._463, - ..._474, - ..._488 + ..._226, + ..._227, + ..._228, + ..._229, + ..._458, + ..._471, + ..._482, + ..._496 }; export namespace poolincentives { export const v1beta1 = { - ..._226, - ..._227, - ..._228, - ..._229, ..._230, - ..._475 - }; - } - export namespace poolmanager { - export const v1beta1 = { ..._231, ..._232, ..._233, ..._234, - ..._235, - ..._236, - ..._451, - ..._464, - ..._476, - ..._489 + ..._483 }; } - export namespace protorev { + export namespace poolmanager { export const v1beta1 = { + ..._235, + ..._236, ..._237, ..._238, ..._239, ..._240, + ..._459, + ..._472, + ..._484, + ..._497 + }; + } + export namespace protorev { + export const v1beta1 = { ..._241, ..._242, - ..._452, - ..._465, - ..._477, - ..._490 + ..._243, + ..._244, + ..._245, + ..._246, + ..._460, + ..._473, + ..._485, + ..._498 }; } export const superfluid = { - ..._243, - ..._244, - ..._245, - ..._246, ..._247, - ..._453, - ..._466, - ..._478, - ..._491 + ..._248, + ..._249, + ..._250, + ..._251, + ..._461, + ..._474, + ..._486, + ..._499 }; export namespace tokenfactory { export const v1beta1 = { - ..._248, - ..._249, - ..._250, - ..._251, ..._252, - ..._454, - ..._467, - ..._479, - ..._492 - }; - } - export namespace txfees { - export const v1beta1 = { ..._253, ..._254, ..._255, ..._256, - ..._257, - ..._258, - ..._455, - ..._468, - ..._480, - ..._493 + ..._462, + ..._475, + ..._487, + ..._500 }; } - export namespace valsetpref { + export namespace txfees { export const v1beta1 = { + ..._257, + ..._258, ..._259, ..._260, ..._261, - ..._456, - ..._469, - ..._481, - ..._494 + ..._262, + ..._463, + ..._476, + ..._488, + ..._501 + }; + } + export namespace valsetpref { + export const v1beta1 = { + ..._263, + ..._264, + ..._265, + ..._464, + ..._477, + ..._489, + ..._502 }; } export const ClientFactory = { - ..._549, - ..._550 + ..._557, + ..._558 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/rpc.query.ts b/packages/types/protobuf/codegen/osmosis/rpc.query.ts index 1c075cd1b..4862426bf 100644 --- a/packages/types/protobuf/codegen/osmosis/rpc.query.ts +++ b/packages/types/protobuf/codegen/osmosis/rpc.query.ts @@ -26,6 +26,9 @@ export const createRPCQueryClient = async ({ distribution: { v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, gov: { v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) diff --git a/packages/types/protobuf/codegen/osmosis/rpc.tx.ts b/packages/types/protobuf/codegen/osmosis/rpc.tx.ts index 7129e08ef..572d5ff05 100644 --- a/packages/types/protobuf/codegen/osmosis/rpc.tx.ts +++ b/packages/types/protobuf/codegen/osmosis/rpc.tx.ts @@ -17,6 +17,9 @@ export const createRPCMsgClient = async ({ distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, gov: { v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) diff --git a/packages/types/protobuf/codegen/publicawesome/bundle.ts b/packages/types/protobuf/codegen/publicawesome/bundle.ts index ad8d7409b..aa9b74d72 100644 --- a/packages/types/protobuf/codegen/publicawesome/bundle.ts +++ b/packages/types/protobuf/codegen/publicawesome/bundle.ts @@ -1,88 +1,88 @@ -import * as _262 from "./stargaze/alloc/v1beta1/genesis"; -import * as _263 from "./stargaze/alloc/v1beta1/params"; -import * as _264 from "./stargaze/alloc/v1beta1/query"; -import * as _265 from "./stargaze/alloc/v1beta1/tx"; -import * as _266 from "./stargaze/cron/v1/cron"; -import * as _267 from "./stargaze/cron/v1/genesis"; -import * as _268 from "./stargaze/cron/v1/proposal"; -import * as _269 from "./stargaze/cron/v1/query"; -import * as _270 from "./stargaze/cron/v1/tx"; -import * as _271 from "./stargaze/globalfee/v1/genesis"; -import * as _272 from "./stargaze/globalfee/v1/globalfee"; -import * as _273 from "./stargaze/globalfee/v1/proposal"; -import * as _274 from "./stargaze/globalfee/v1/query"; -import * as _275 from "./stargaze/globalfee/v1/tx"; -import * as _276 from "./stargaze/mint/v1beta1/genesis"; -import * as _277 from "./stargaze/mint/v1beta1/mint"; -import * as _278 from "./stargaze/mint/v1beta1/query"; -import * as _279 from "./stargaze/mint/v1beta1/tx"; -import * as _495 from "./stargaze/alloc/v1beta1/tx.amino"; -import * as _496 from "./stargaze/cron/v1/tx.amino"; -import * as _497 from "./stargaze/globalfee/v1/tx.amino"; -import * as _498 from "./stargaze/alloc/v1beta1/tx.registry"; -import * as _499 from "./stargaze/cron/v1/tx.registry"; -import * as _500 from "./stargaze/globalfee/v1/tx.registry"; -import * as _501 from "./stargaze/alloc/v1beta1/query.rpc.Query"; -import * as _502 from "./stargaze/cron/v1/query.rpc.Query"; -import * as _503 from "./stargaze/globalfee/v1/query.rpc.Query"; -import * as _504 from "./stargaze/mint/v1beta1/query.rpc.Query"; -import * as _505 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; -import * as _506 from "./stargaze/cron/v1/tx.rpc.msg"; -import * as _507 from "./stargaze/globalfee/v1/tx.rpc.msg"; -import * as _551 from "./rpc.query"; -import * as _552 from "./rpc.tx"; +import * as _266 from "./stargaze/alloc/v1beta1/genesis"; +import * as _267 from "./stargaze/alloc/v1beta1/params"; +import * as _268 from "./stargaze/alloc/v1beta1/query"; +import * as _269 from "./stargaze/alloc/v1beta1/tx"; +import * as _270 from "./stargaze/cron/v1/cron"; +import * as _271 from "./stargaze/cron/v1/genesis"; +import * as _272 from "./stargaze/cron/v1/proposal"; +import * as _273 from "./stargaze/cron/v1/query"; +import * as _274 from "./stargaze/cron/v1/tx"; +import * as _275 from "./stargaze/globalfee/v1/genesis"; +import * as _276 from "./stargaze/globalfee/v1/globalfee"; +import * as _277 from "./stargaze/globalfee/v1/proposal"; +import * as _278 from "./stargaze/globalfee/v1/query"; +import * as _279 from "./stargaze/globalfee/v1/tx"; +import * as _280 from "./stargaze/mint/v1beta1/genesis"; +import * as _281 from "./stargaze/mint/v1beta1/mint"; +import * as _282 from "./stargaze/mint/v1beta1/query"; +import * as _283 from "./stargaze/mint/v1beta1/tx"; +import * as _503 from "./stargaze/alloc/v1beta1/tx.amino"; +import * as _504 from "./stargaze/cron/v1/tx.amino"; +import * as _505 from "./stargaze/globalfee/v1/tx.amino"; +import * as _506 from "./stargaze/alloc/v1beta1/tx.registry"; +import * as _507 from "./stargaze/cron/v1/tx.registry"; +import * as _508 from "./stargaze/globalfee/v1/tx.registry"; +import * as _509 from "./stargaze/alloc/v1beta1/query.rpc.Query"; +import * as _510 from "./stargaze/cron/v1/query.rpc.Query"; +import * as _511 from "./stargaze/globalfee/v1/query.rpc.Query"; +import * as _512 from "./stargaze/mint/v1beta1/query.rpc.Query"; +import * as _513 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; +import * as _514 from "./stargaze/cron/v1/tx.rpc.msg"; +import * as _515 from "./stargaze/globalfee/v1/tx.rpc.msg"; +import * as _559 from "./rpc.query"; +import * as _560 from "./rpc.tx"; export namespace publicawesome { export namespace stargaze { export namespace alloc { export const v1beta1 = { - ..._262, - ..._263, - ..._264, - ..._265, - ..._495, - ..._498, - ..._501, - ..._505 - }; - } - export namespace cron { - export const v1 = { ..._266, ..._267, ..._268, ..._269, - ..._270, - ..._496, - ..._499, - ..._502, - ..._506 + ..._503, + ..._506, + ..._509, + ..._513 }; } - export namespace globalfee { + export namespace cron { export const v1 = { + ..._270, ..._271, ..._272, ..._273, ..._274, - ..._275, - ..._497, - ..._500, - ..._503, - ..._507 + ..._504, + ..._507, + ..._510, + ..._514 }; } - export namespace mint { - export const v1beta1 = { + export namespace globalfee { + export const v1 = { + ..._275, ..._276, ..._277, ..._278, ..._279, - ..._504 + ..._505, + ..._508, + ..._511, + ..._515 + }; + } + export namespace mint { + export const v1beta1 = { + ..._280, + ..._281, + ..._282, + ..._283, + ..._512 }; } } export const ClientFactory = { - ..._551, - ..._552 + ..._559, + ..._560 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/publicawesome/rpc.query.ts b/packages/types/protobuf/codegen/publicawesome/rpc.query.ts index eef3c54d8..64e76ccf8 100644 --- a/packages/types/protobuf/codegen/publicawesome/rpc.query.ts +++ b/packages/types/protobuf/codegen/publicawesome/rpc.query.ts @@ -26,6 +26,9 @@ export const createRPCQueryClient = async ({ distribution: { v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, gov: { v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) diff --git a/packages/types/protobuf/codegen/publicawesome/rpc.tx.ts b/packages/types/protobuf/codegen/publicawesome/rpc.tx.ts index f506b2647..645ea22f4 100644 --- a/packages/types/protobuf/codegen/publicawesome/rpc.tx.ts +++ b/packages/types/protobuf/codegen/publicawesome/rpc.tx.ts @@ -17,6 +17,9 @@ export const createRPCMsgClient = async ({ distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, gov: { v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) diff --git a/packages/types/protobuf/codegen/regen/bundle.ts b/packages/types/protobuf/codegen/regen/bundle.ts index d37af239c..3f2eb9a86 100644 --- a/packages/types/protobuf/codegen/regen/bundle.ts +++ b/packages/types/protobuf/codegen/regen/bundle.ts @@ -1,134 +1,134 @@ -import * as _280 from "./data/v1/events"; -import * as _281 from "./data/v1/state"; -import * as _282 from "./data/v1/tx"; -import * as _283 from "./data/v1/types"; -import * as _284 from "./data/v2/events"; -import * as _285 from "./data/v2/state"; -import * as _286 from "./data/v2/tx"; -import * as _287 from "./data/v2/types"; -import * as _288 from "./ecocredit/basket/v1/events"; -import * as _289 from "./ecocredit/basket/v1/state"; -import * as _290 from "./ecocredit/basket/v1/tx"; -import * as _291 from "./ecocredit/basket/v1/types"; -import * as _292 from "./ecocredit/marketplace/v1/events"; -import * as _293 from "./ecocredit/marketplace/v1/state"; -import * as _294 from "./ecocredit/marketplace/v1/tx"; -import * as _295 from "./ecocredit/marketplace/v1/types"; -import * as _296 from "./ecocredit/orderbook/v1alpha1/memory"; -import * as _297 from "./ecocredit/v1/events"; -import * as _298 from "./ecocredit/v1/state"; -import * as _299 from "./ecocredit/v1/tx"; -import * as _300 from "./ecocredit/v1/types"; -import * as _301 from "./ecocredit/v1alpha1/events"; -import * as _302 from "./ecocredit/v1alpha1/genesis"; -import * as _303 from "./ecocredit/v1alpha1/tx"; -import * as _304 from "./ecocredit/v1alpha1/types"; -import * as _305 from "./intertx/v1/query"; -import * as _306 from "./intertx/v1/tx"; -import * as _508 from "./data/v1/tx.amino"; -import * as _509 from "./data/v2/tx.amino"; -import * as _510 from "./ecocredit/basket/v1/tx.amino"; -import * as _511 from "./ecocredit/marketplace/v1/tx.amino"; -import * as _512 from "./ecocredit/v1/tx.amino"; -import * as _513 from "./ecocredit/v1alpha1/tx.amino"; -import * as _514 from "./intertx/v1/tx.amino"; -import * as _515 from "./data/v1/tx.registry"; -import * as _516 from "./data/v2/tx.registry"; -import * as _517 from "./ecocredit/basket/v1/tx.registry"; -import * as _518 from "./ecocredit/marketplace/v1/tx.registry"; -import * as _519 from "./ecocredit/v1/tx.registry"; -import * as _520 from "./ecocredit/v1alpha1/tx.registry"; -import * as _521 from "./intertx/v1/tx.registry"; -import * as _522 from "./intertx/v1/query.rpc.Query"; -import * as _523 from "./data/v1/tx.rpc.msg"; -import * as _524 from "./data/v2/tx.rpc.msg"; -import * as _525 from "./ecocredit/basket/v1/tx.rpc.msg"; -import * as _526 from "./ecocredit/marketplace/v1/tx.rpc.msg"; -import * as _527 from "./ecocredit/v1/tx.rpc.msg"; -import * as _528 from "./ecocredit/v1alpha1/tx.rpc.msg"; -import * as _529 from "./intertx/v1/tx.rpc.msg"; -import * as _553 from "./rpc.query"; -import * as _554 from "./rpc.tx"; +import * as _284 from "./data/v1/events"; +import * as _285 from "./data/v1/state"; +import * as _286 from "./data/v1/tx"; +import * as _287 from "./data/v1/types"; +import * as _288 from "./data/v2/events"; +import * as _289 from "./data/v2/state"; +import * as _290 from "./data/v2/tx"; +import * as _291 from "./data/v2/types"; +import * as _292 from "./ecocredit/basket/v1/events"; +import * as _293 from "./ecocredit/basket/v1/state"; +import * as _294 from "./ecocredit/basket/v1/tx"; +import * as _295 from "./ecocredit/basket/v1/types"; +import * as _296 from "./ecocredit/marketplace/v1/events"; +import * as _297 from "./ecocredit/marketplace/v1/state"; +import * as _298 from "./ecocredit/marketplace/v1/tx"; +import * as _299 from "./ecocredit/marketplace/v1/types"; +import * as _300 from "./ecocredit/orderbook/v1alpha1/memory"; +import * as _301 from "./ecocredit/v1/events"; +import * as _302 from "./ecocredit/v1/state"; +import * as _303 from "./ecocredit/v1/tx"; +import * as _304 from "./ecocredit/v1/types"; +import * as _305 from "./ecocredit/v1alpha1/events"; +import * as _306 from "./ecocredit/v1alpha1/genesis"; +import * as _307 from "./ecocredit/v1alpha1/tx"; +import * as _308 from "./ecocredit/v1alpha1/types"; +import * as _309 from "./intertx/v1/query"; +import * as _310 from "./intertx/v1/tx"; +import * as _516 from "./data/v1/tx.amino"; +import * as _517 from "./data/v2/tx.amino"; +import * as _518 from "./ecocredit/basket/v1/tx.amino"; +import * as _519 from "./ecocredit/marketplace/v1/tx.amino"; +import * as _520 from "./ecocredit/v1/tx.amino"; +import * as _521 from "./ecocredit/v1alpha1/tx.amino"; +import * as _522 from "./intertx/v1/tx.amino"; +import * as _523 from "./data/v1/tx.registry"; +import * as _524 from "./data/v2/tx.registry"; +import * as _525 from "./ecocredit/basket/v1/tx.registry"; +import * as _526 from "./ecocredit/marketplace/v1/tx.registry"; +import * as _527 from "./ecocredit/v1/tx.registry"; +import * as _528 from "./ecocredit/v1alpha1/tx.registry"; +import * as _529 from "./intertx/v1/tx.registry"; +import * as _530 from "./intertx/v1/query.rpc.Query"; +import * as _531 from "./data/v1/tx.rpc.msg"; +import * as _532 from "./data/v2/tx.rpc.msg"; +import * as _533 from "./ecocredit/basket/v1/tx.rpc.msg"; +import * as _534 from "./ecocredit/marketplace/v1/tx.rpc.msg"; +import * as _535 from "./ecocredit/v1/tx.rpc.msg"; +import * as _536 from "./ecocredit/v1alpha1/tx.rpc.msg"; +import * as _537 from "./intertx/v1/tx.rpc.msg"; +import * as _561 from "./rpc.query"; +import * as _562 from "./rpc.tx"; export namespace regen { export namespace data { export const v1 = { - ..._280, - ..._281, - ..._282, - ..._283, - ..._508, - ..._515, - ..._523 - }; - export const v2 = { ..._284, ..._285, ..._286, ..._287, - ..._509, ..._516, - ..._524 + ..._523, + ..._531 + }; + export const v2 = { + ..._288, + ..._289, + ..._290, + ..._291, + ..._517, + ..._524, + ..._532 }; } export namespace ecocredit { export namespace basket { - export const v1 = { - ..._288, - ..._289, - ..._290, - ..._291, - ..._510, - ..._517, - ..._525 - }; - } - export namespace marketplace { export const v1 = { ..._292, ..._293, ..._294, ..._295, - ..._511, ..._518, - ..._526 + ..._525, + ..._533 + }; + } + export namespace marketplace { + export const v1 = { + ..._296, + ..._297, + ..._298, + ..._299, + ..._519, + ..._526, + ..._534 }; } export namespace orderbook { export const v1alpha1 = { - ..._296 + ..._300 }; } export const v1 = { - ..._297, - ..._298, - ..._299, - ..._300, - ..._512, - ..._519, - ..._527 - }; - export const v1alpha1 = { ..._301, ..._302, ..._303, ..._304, - ..._513, ..._520, - ..._528 + ..._527, + ..._535 }; - } - export namespace intertx { - export const v1 = { + export const v1alpha1 = { ..._305, ..._306, - ..._514, + ..._307, + ..._308, ..._521, + ..._528, + ..._536 + }; + } + export namespace intertx { + export const v1 = { + ..._309, + ..._310, ..._522, - ..._529 + ..._529, + ..._530, + ..._537 }; } export const ClientFactory = { - ..._553, - ..._554 + ..._561, + ..._562 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/regen/rpc.query.ts b/packages/types/protobuf/codegen/regen/rpc.query.ts index 3cdeb6f90..ff22cb784 100644 --- a/packages/types/protobuf/codegen/regen/rpc.query.ts +++ b/packages/types/protobuf/codegen/regen/rpc.query.ts @@ -26,6 +26,9 @@ export const createRPCQueryClient = async ({ distribution: { v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, gov: { v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) diff --git a/packages/types/protobuf/codegen/regen/rpc.tx.ts b/packages/types/protobuf/codegen/regen/rpc.tx.ts index a51aab85d..f5da8f197 100644 --- a/packages/types/protobuf/codegen/regen/rpc.tx.ts +++ b/packages/types/protobuf/codegen/regen/rpc.tx.ts @@ -17,6 +17,9 @@ export const createRPCMsgClient = async ({ distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, gov: { v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) diff --git a/packages/types/protobuf/codegen/tendermint/bundle.ts b/packages/types/protobuf/codegen/tendermint/bundle.ts index fd0dd70f6..33ace37d1 100644 --- a/packages/types/protobuf/codegen/tendermint/bundle.ts +++ b/packages/types/protobuf/codegen/tendermint/bundle.ts @@ -1,32 +1,32 @@ -import * as _310 from "./abci/types"; -import * as _311 from "./crypto/keys"; -import * as _312 from "./crypto/proof"; -import * as _313 from "./p2p/types"; -import * as _314 from "./types/block"; -import * as _315 from "./types/evidence"; -import * as _316 from "./types/params"; -import * as _317 from "./types/types"; -import * as _318 from "./types/validator"; -import * as _319 from "./version/types"; +import * as _314 from "./abci/types"; +import * as _315 from "./crypto/keys"; +import * as _316 from "./crypto/proof"; +import * as _317 from "./p2p/types"; +import * as _318 from "./types/block"; +import * as _319 from "./types/evidence"; +import * as _320 from "./types/params"; +import * as _321 from "./types/types"; +import * as _322 from "./types/validator"; +import * as _323 from "./version/types"; export namespace tendermint { export const abci = { - ..._310 + ..._314 }; export const crypto = { - ..._311, - ..._312 + ..._315, + ..._316 }; export const p2p = { - ..._313 + ..._317 }; export const types = { - ..._314, - ..._315, - ..._316, - ..._317, - ..._318 + ..._318, + ..._319, + ..._320, + ..._321, + ..._322 }; export const version = { - ..._319 + ..._323 }; } \ No newline at end of file diff --git a/packages/types/protobuf/proto/cosmos/feegrant/v1beta1/query.proto b/packages/types/protobuf/proto/cosmos/feegrant/v1beta1/query.proto index 591537acd..36305f877 100644 --- a/packages/types/protobuf/proto/cosmos/feegrant/v1beta1/query.proto +++ b/packages/types/protobuf/proto/cosmos/feegrant/v1beta1/query.proto @@ -12,7 +12,7 @@ option go_package = "cosmossdk.io/x/feegrant"; // Query defines the gRPC querier service. service Query { - // Allowance returns granted allwance to the grantee by the granter. + // Allowance returns granted allowance to the grantee by the granter. rpc Allowance(QueryAllowanceRequest) returns (QueryAllowanceResponse) { option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}"; } @@ -23,10 +23,9 @@ service Query { } // AllowancesByGranter returns all the grants given by an address - // - // Since: cosmos-sdk 0.46 rpc AllowancesByGranter(QueryAllowancesByGranterRequest) returns (QueryAllowancesByGranterResponse) { - option (google.api.http).get = "/cosmos/feegrant/v1beta1/issued/{granter}"; + option (cosmos_proto.method_added_in) = "cosmos-sdk 0.46"; + option (google.api.http).get = "/cosmos/feegrant/v1beta1/issued/{granter}"; } } @@ -63,19 +62,17 @@ message QueryAllowancesResponse { } // QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. -// -// Since: cosmos-sdk 0.46 message QueryAllowancesByGranterRequest { - string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + option (cosmos_proto.message_added_in) = "cosmos-sdk 0.46"; + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // pagination defines an pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 2; } // QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. -// -// Since: cosmos-sdk 0.46 message QueryAllowancesByGranterResponse { + option (cosmos_proto.message_added_in) = "cosmos-sdk 0.46"; // allowances that have been issued by the granter. repeated cosmos.feegrant.v1beta1.Grant allowances = 1; diff --git a/packages/types/protobuf/proto/cosmos/feegrant/v1beta1/tx.proto b/packages/types/protobuf/proto/cosmos/feegrant/v1beta1/tx.proto index 37e505c4e..6aa7cdae4 100644 --- a/packages/types/protobuf/proto/cosmos/feegrant/v1beta1/tx.proto +++ b/packages/types/protobuf/proto/cosmos/feegrant/v1beta1/tx.proto @@ -20,6 +20,11 @@ service Msg { // RevokeAllowance revokes any fee allowance of granter's account that // has been granted to the grantee. rpc RevokeAllowance(MsgRevokeAllowance) returns (MsgRevokeAllowanceResponse); + + // PruneAllowances prunes expired fee allowances, currently up to 75 at a time. + rpc PruneAllowances(MsgPruneAllowances) returns (MsgPruneAllowancesResponse) { + option (cosmos_proto.method_added_in) = "cosmos-sdk 0.50"; + } } // MsgGrantAllowance adds permission for Grantee to spend up to Allowance @@ -55,3 +60,17 @@ message MsgRevokeAllowance { // MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. message MsgRevokeAllowanceResponse {} + +// MsgPruneAllowances prunes expired fee allowances. +message MsgPruneAllowances { + option (cosmos_proto.message_added_in) = "cosmos-sdk 0.50"; + option (cosmos.msg.v1.signer) = "pruner"; + + // pruner is the address of the user pruning expired allowances. + string pruner = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgPruneAllowancesResponse defines the Msg/PruneAllowancesResponse response type. +message MsgPruneAllowancesResponse { + option (cosmos_proto.message_added_in) = "cosmos-sdk 0.50"; +} \ No newline at end of file diff --git a/packages/types/protobuf/scripts/codegen.js b/packages/types/protobuf/scripts/codegen.js index 9c73459d0..fa793c1e0 100644 --- a/packages/types/protobuf/scripts/codegen.js +++ b/packages/types/protobuf/scripts/codegen.js @@ -27,6 +27,7 @@ telescope({ '**/genesis.ts', '**/gov.ts', '**/query.ts', + '**/feegrant.ts', ], }, removeUnusedImports: true, @@ -47,6 +48,7 @@ telescope({ 'cosmos.crypto.multisig', 'cosmos.crypto.secp256k1', 'cosmos.distribution.v1beta1', + 'cosmos.feegrant.v1beta1', 'cosmos.gov.v1', 'cosmos.gov.v1beta1', 'cosmos.mint.v1beta1', From cb020c186eee7b042874b1d9bcfa83bcbd7d0800 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 26 Apr 2024 11:16:17 -0700 Subject: [PATCH 131/438] fixed apps tab direct signing authz support --- packages/stateful/components/dao/tabs/AppsTab.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stateful/components/dao/tabs/AppsTab.tsx b/packages/stateful/components/dao/tabs/AppsTab.tsx index 2e2a7f858..7f5498b9f 100644 --- a/packages/stateful/components/dao/tabs/AppsTab.tsx +++ b/packages/stateful/components/dao/tabs/AppsTab.tsx @@ -104,7 +104,7 @@ export const AppsTab = () => { maybeMakePolytoneExecuteMessage( currentChainId, chainId, - protobufToCwMsg(msg).msg + protobufToCwMsg(msg, false).msg ) ) setMsgs(messages) From 407d8af16695c3fbe4bb8a73fb00a02267696c12 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 26 Apr 2024 11:33:46 -0700 Subject: [PATCH 132/438] allow submitting already base64-encoded data to custom action --- .../actions/core/advanced/Custom/index.tsx | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/packages/stateful/actions/core/advanced/Custom/index.tsx b/packages/stateful/actions/core/advanced/Custom/index.tsx index ac4ddaad0..98f2dccd8 100644 --- a/packages/stateful/actions/core/advanced/Custom/index.tsx +++ b/packages/stateful/actions/core/advanced/Custom/index.tsx @@ -1,3 +1,4 @@ +import { fromBase64 } from '@cosmjs/encoding' import JSON5 from 'json5' import { useCallback, useMemo } from 'react' @@ -10,7 +11,7 @@ import { UseDefaults, UseTransformToCosmos, } from '@dao-dao/types/actions' -import { makeWasmMessage } from '@dao-dao/utils' +import { makeWasmMessage, objectMatchesStructure } from '@dao-dao/utils' import { CustomComponent as Component, CustomData } from './Component' @@ -34,10 +35,35 @@ const useTransformToCosmos: UseTransformToCosmos = () => if (msg.wasm) { msg = makeWasmMessage(msg) } - // Encode the stargate message. - if (msg.stargate) { + // Encode JSON stargate message if needed. + if ( + objectMatchesStructure(msg, { + stargate: { + typeUrl: {}, + value: {}, + }, + }) + ) { msg = makeStargateMessage(msg) } + // If msg is in the encoded stargate format, validate it. + if ( + objectMatchesStructure(msg, { + stargate: { + type_url: {}, + value: {}, + }, + }) + ) { + if (typeof msg.stargate.value !== 'string') { + throw new Error('stargate `value` must be a base64-encoded string') + } + + // Ensure value is valid base64 by attempting to decode it and throwing + // error on failure. + fromBase64(msg.stargate.value) + } + return msg }, []) From 727613d346e1704d8554f30ac5ab4ed61d3937b9 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 26 Apr 2024 12:45:35 -0700 Subject: [PATCH 133/438] allow submitting already base64-encoded data to custom action 2 --- .../core/advanced/Custom/Component.tsx | 27 +--- .../actions/core/advanced/Custom/index.tsx | 52 +------ packages/utils/messages/cw.ts | 128 +++++++++++++++--- 3 files changed, 117 insertions(+), 90 deletions(-) diff --git a/packages/stateful/actions/core/advanced/Custom/Component.tsx b/packages/stateful/actions/core/advanced/Custom/Component.tsx index 7ab55668f..17d000e9f 100644 --- a/packages/stateful/actions/core/advanced/Custom/Component.tsx +++ b/packages/stateful/actions/core/advanced/Custom/Component.tsx @@ -1,5 +1,4 @@ import { Check, Close } from '@mui/icons-material' -import JSON5 from 'json5' import { useMemo } from 'react' import { useFormContext } from 'react-hook-form' import { useTranslation } from 'react-i18next' @@ -9,10 +8,10 @@ import { FilterableItemPopup, useChain, } from '@dao-dao/stateless' -import { ChainId, PROTOBUF_TYPES, makeStargateMessage } from '@dao-dao/types' +import { ChainId, PROTOBUF_TYPES } from '@dao-dao/types' import { ActionComponent } from '@dao-dao/types/actions' import { - makeWasmMessage, + convertJsonToCWCosmosMsg, objectMatchesStructure, validateCosmosMsg, } from '@dao-dao/utils' @@ -90,23 +89,9 @@ export const CustomComponent: ActionComponent = ({ readOnly={!isCreating} transform={isCreating ? undefined : transformLongKeys} validation={[ - (v: string) => { - let msg + (value: string) => { try { - msg = JSON5.parse(v) - } catch (e: any) { - return e.message as string - } - - try { - if (msg.wasm) { - msg = makeWasmMessage(msg) - } - if (msg.stargate) { - msg = makeStargateMessage(msg) - } - - validateCosmosMsg(msg) + validateCosmosMsg(convertJsonToCWCosmosMsg(value)) } catch (err) { return err instanceof Error ? err.message : `${err}` } @@ -118,7 +103,7 @@ export const CustomComponent: ActionComponent = ({ {errors?.message ? ( ) : ( -

+

{t('info.jsonIsValid')}

)} diff --git a/packages/stateful/actions/core/advanced/Custom/index.tsx b/packages/stateful/actions/core/advanced/Custom/index.tsx index 98f2dccd8..327a2c787 100644 --- a/packages/stateful/actions/core/advanced/Custom/index.tsx +++ b/packages/stateful/actions/core/advanced/Custom/index.tsx @@ -1,9 +1,6 @@ -import { fromBase64 } from '@cosmjs/encoding' -import JSON5 from 'json5' import { useCallback, useMemo } from 'react' import { RobotEmoji } from '@dao-dao/stateless' -import { makeStargateMessage } from '@dao-dao/types' import { ActionKey, ActionMaker, @@ -11,7 +8,7 @@ import { UseDefaults, UseTransformToCosmos, } from '@dao-dao/types/actions' -import { makeWasmMessage, objectMatchesStructure } from '@dao-dao/utils' +import { convertJsonToCWCosmosMsg } from '@dao-dao/utils' import { CustomComponent as Component, CustomData } from './Component' @@ -20,52 +17,7 @@ const useDefaults: UseDefaults = () => ({ }) const useTransformToCosmos: UseTransformToCosmos = () => - useCallback((data: CustomData) => { - let msg - try { - msg = JSON5.parse(data.message) - } catch (err) { - console.error( - `internal error. unparsable message: (${data.message})`, - err - ) - return - } - // Convert the wasm message component to base64 - if (msg.wasm) { - msg = makeWasmMessage(msg) - } - // Encode JSON stargate message if needed. - if ( - objectMatchesStructure(msg, { - stargate: { - typeUrl: {}, - value: {}, - }, - }) - ) { - msg = makeStargateMessage(msg) - } - // If msg is in the encoded stargate format, validate it. - if ( - objectMatchesStructure(msg, { - stargate: { - type_url: {}, - value: {}, - }, - }) - ) { - if (typeof msg.stargate.value !== 'string') { - throw new Error('stargate `value` must be a base64-encoded string') - } - - // Ensure value is valid base64 by attempting to decode it and throwing - // error on failure. - fromBase64(msg.stargate.value) - } - - return msg - }, []) + useCallback((data: CustomData) => convertJsonToCWCosmosMsg(data.message), []) const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( msg: Record diff --git a/packages/utils/messages/cw.ts b/packages/utils/messages/cw.ts index 52ad90562..2282c25a5 100644 --- a/packages/utils/messages/cw.ts +++ b/packages/utils/messages/cw.ts @@ -1,5 +1,7 @@ -import { toBase64, toUtf8 } from '@cosmjs/encoding' +import { fromBase64, toBase64, toUtf8 } from '@cosmjs/encoding' import { Coin } from '@cosmjs/proto-signing' +import JSON5 from 'json5' +import cloneDeep from 'lodash.clonedeep' import { v4 as uuidv4 } from 'uuid' import { @@ -135,29 +137,68 @@ export function decodedMessagesString(msgs: CosmosMsgFor_Empty[]): string { return JSON.stringify(decodedMessageArray, undefined, 2) } -// This function mutates its input message. -export const makeWasmMessage = (message: { +/** + * Encode relevant components of wasm messages into base64 strings as the chain + * expects. + */ +export const makeWasmMessage = (msg: { wasm: any }): { wasm: WasmMsg } => { - // We need to encode Wasm Execute, Instantiate, and Migrate messages. - let msg = message - if (message?.wasm?.execute) { - msg.wasm.execute.msg = encodeJsonToBase64(message.wasm.execute.msg) - } else if (message?.wasm?.instantiate) { - msg.wasm.instantiate.msg = encodeJsonToBase64(message.wasm.instantiate.msg) - } else if (message?.wasm?.instantiate2) { - msg.wasm.instantiate2.msg = encodeJsonToBase64( - message.wasm.instantiate2.msg - ) - msg.wasm.instantiate2.salt = toBase64( - toUtf8(message.wasm.instantiate2.salt) - ) - } else if (message.wasm.migrate) { - msg.wasm.migrate.msg = encodeJsonToBase64(message.wasm.migrate.msg) + msg = cloneDeep(msg) + + // We need to encode Wasm Execute, Instantiate, and Migrate messages. Messages + // such as update or clear admin pass through without modification. + if ( + objectMatchesStructure(msg, { + wasm: { + execute: { + msg: {}, + }, + }, + }) && + typeof msg.wasm.execute.msg !== 'string' + ) { + msg.wasm.execute.msg = encodeJsonToBase64(msg.wasm.execute.msg) + } else if ( + objectMatchesStructure(msg, { + wasm: { + instantiate: { + msg: {}, + }, + }, + }) && + typeof msg.wasm.instantiate.msg !== 'string' + ) { + msg.wasm.instantiate.msg = encodeJsonToBase64(msg.wasm.instantiate.msg) + } else if ( + objectMatchesStructure(msg, { + wasm: { + instantiate2: { + msg: {}, + salt: {}, + }, + }, + }) + ) { + if (typeof msg.wasm.instantiate2.msg !== 'string') { + msg.wasm.instantiate2.msg = encodeJsonToBase64(msg.wasm.instantiate2.msg) + } + msg.wasm.instantiate2.salt = toBase64(toUtf8(msg.wasm.instantiate2.salt)) + } else if ( + objectMatchesStructure(msg, { + wasm: { + migrate: { + msg: {}, + }, + }, + }) && + typeof msg.wasm.migrate.msg !== 'string' + ) { + msg.wasm.migrate.msg = encodeJsonToBase64(msg.wasm.migrate.msg) } - // Messages such as update or clear admin pass through without modification. + return msg } @@ -200,6 +241,55 @@ export const makeBankMessage = ( }, }) +/** + * Convert stringified JSON object into CosmWasm-formatted Cosmos message. Used + * by the Custom action component to encode generic a JSON string. + */ +export const convertJsonToCWCosmosMsg = (value: string): CosmosMsgFor_Empty => { + let msg = JSON5.parse(value) + + // Convert the wasm message component to base64 if necessary. + if ( + objectMatchesStructure(msg, { + wasm: {}, + }) + ) { + msg = makeWasmMessage(msg) + } + + // Encode JSON stargate message if needed. + if ( + objectMatchesStructure(msg, { + stargate: { + typeUrl: {}, + value: {}, + }, + }) + ) { + msg = makeStargateMessage(msg) + } + + // If msg is in the encoded stargate format, validate it. + if ( + objectMatchesStructure(msg, { + stargate: { + type_url: {}, + value: {}, + }, + }) + ) { + if (typeof msg.stargate.value !== 'string') { + throw new Error('stargate `value` must be a base64-encoded string') + } + + // Ensure value is valid base64 by attempting to decode it and throwing + // error on failure. + fromBase64(msg.stargate.value) + } + + return msg +} + export enum StakingActionType { Delegate = 'delegate', Undelegate = 'undelegate', From d8540ac457ba9a3619e687235dac25a2996e6ade Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 29 Apr 2024 19:07:02 -0700 Subject: [PATCH 134/438] support terra classic in gov --- packages/types/chain.ts | 1 + packages/utils/constants/chains.ts | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/types/chain.ts b/packages/types/chain.ts index bd3ae36f2..b1ee07708 100644 --- a/packages/types/chain.ts +++ b/packages/types/chain.ts @@ -65,6 +65,7 @@ export enum ChainId { StargazeTestnet = 'elgafar-1', NeutronMainnet = 'neutron-1', TerraMainnet = 'phoenix-1', + TerraClassicMainnet = 'columbus-5', MigalooMainnet = 'migaloo-1', MigalooTestnet = 'narwhal-2', NobleMainnet = 'noble-1', diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index a3fd87d92..c9ffeb8fc 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -1628,6 +1628,10 @@ export const CHAIN_ENDPOINTS: Partial< rpc: 'https://terra-rpc.polkachu.com', rest: 'https://terra-api.polkachu.com', }, + [ChainId.TerraClassicMainnet]: { + rpc: 'https://terra-classic-rpc.publicnode.com', + rest: 'https://terra-classic-rest.publicnode.com', + }, [ChainId.MigalooMainnet]: { rpc: 'https://migaloo-rpc.polkachu.com', rest: 'https://migaloo-api.polkachu.com', @@ -1789,9 +1793,16 @@ chains } } + // Rename Terra Classic since its chain registry name is `terra` but that's + // taken by Terra 2 since it's a configured chain. + const name = + chain.chain_id === ChainId.TerraClassicMainnet + ? 'terraclassic' + : chain.chain_name + CONFIGURED_CHAINS.push({ chainId: chain.chain_id, - name: chain.chain_name, + name, mainnet: chain.network_type === 'mainnet', accentColor: '', noGov: NO_GOV_CHAIN_IDS.includes(chain.chain_id), From 6227376af36a0ee6c4277d8ea9255cf3264aa952 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 1 May 2024 10:54:06 -0700 Subject: [PATCH 135/438] added pstake protobufs --- .../types/protobuf/codegen/alliance/bundle.ts | 24 +- .../types/protobuf/codegen/circle/bundle.ts | 24 +- .../types/protobuf/codegen/cosmos/bundle.ts | 196 +- .../types/protobuf/codegen/cosmwasm/bundle.ts | 40 +- .../types/protobuf/codegen/gaia/bundle.ts | 24 +- packages/types/protobuf/codegen/ibc/bundle.ts | 88 +- packages/types/protobuf/codegen/index.ts | 2 + .../types/protobuf/codegen/juno/bundle.ts | 40 +- .../types/protobuf/codegen/kujira/bundle.ts | 44 +- .../types/protobuf/codegen/neutron/bundle.ts | 104 +- .../types/protobuf/codegen/noble/bundle.ts | 20 +- .../types/protobuf/codegen/osmosis/bundle.ts | 212 +- .../types/protobuf/codegen/pstake/bundle.ts | 98 + .../types/protobuf/codegen/pstake/client.ts | 56 + .../pstake/liquidstake/v1beta1/genesis.ts | 105 + .../pstake/liquidstake/v1beta1/liquidstake.ts | 999 ++++++ .../liquidstake/v1beta1/query.rpc.Query.ts | 55 + .../pstake/liquidstake/v1beta1/query.ts | 464 +++ .../pstake/liquidstake/v1beta1/tx.amino.ts | 33 + .../pstake/liquidstake/v1beta1/tx.registry.ts | 125 + .../pstake/liquidstake/v1beta1/tx.rpc.msg.ts | 75 + .../codegen/pstake/liquidstake/v1beta1/tx.ts | 1109 +++++++ .../pstake/liquidstakeibc/v1beta1/genesis.ts | 182 ++ .../liquidstakeibc/v1beta1/liquidstakeibc.ts | 2489 ++++++++++++++ .../liquidstakeibc/v1beta1/msgs.amino.ts | 38 + .../liquidstakeibc/v1beta1/msgs.registry.ts | 143 + .../liquidstakeibc/v1beta1/msgs.rpc.msg.ts | 61 + .../pstake/liquidstakeibc/v1beta1/msgs.ts | 1312 ++++++++ .../pstake/liquidstakeibc/v1beta1/params.ts | 105 + .../liquidstakeibc/v1beta1/query.rpc.Query.ts | 179 + .../pstake/liquidstakeibc/v1beta1/query.ts | 2270 +++++++++++++ .../pstake/lscosmos/v1beta1/genesis.ts | 228 ++ .../lscosmos/v1beta1/governance_proposal.ts | 402 +++ .../pstake/lscosmos/v1beta1/lscosmos.ts | 1636 ++++++++++ .../pstake/lscosmos/v1beta1/msgs.amino.ts | 43 + .../pstake/lscosmos/v1beta1/msgs.registry.ts | 161 + .../pstake/lscosmos/v1beta1/msgs.rpc.msg.ts | 68 + .../codegen/pstake/lscosmos/v1beta1/msgs.ts | 1356 ++++++++ .../codegen/pstake/lscosmos/v1beta1/params.ts | 65 + .../lscosmos/v1beta1/query.rpc.Query.ts | 191 ++ .../codegen/pstake/lscosmos/v1beta1/query.ts | 2882 +++++++++++++++++ .../pstake/ratesync/v1beta1/contract.ts | 343 ++ .../pstake/ratesync/v1beta1/genesis.ts | 104 + .../codegen/pstake/ratesync/v1beta1/params.ts | 84 + .../ratesync/v1beta1/query.rpc.Query.ts | 53 + .../codegen/pstake/ratesync/v1beta1/query.ts | 491 +++ .../pstake/ratesync/v1beta1/ratesync.ts | 626 ++++ .../pstake/ratesync/v1beta1/tx.amino.ts | 23 + .../pstake/ratesync/v1beta1/tx.registry.ts | 89 + .../pstake/ratesync/v1beta1/tx.rpc.msg.ts | 40 + .../codegen/pstake/ratesync/v1beta1/tx.ts | 671 ++++ .../protobuf/codegen/pstake/rpc.query.ts | 70 + .../types/protobuf/codegen/pstake/rpc.tx.ts | 54 + .../protobuf/codegen/publicawesome/bundle.ts | 132 +- .../types/protobuf/codegen/regen/bundle.ts | 204 +- .../protobuf/codegen/tendermint/bundle.ts | 40 +- .../pstake/liquidstake/v1beta1/genesis.proto | 20 + .../liquidstake/v1beta1/liquidstake.proto | 214 ++ .../pstake/liquidstake/v1beta1/query.proto | 55 + .../proto/pstake/liquidstake/v1beta1/tx.proto | 148 + .../liquidstakeibc/v1beta1/genesis.proto | 30 + .../v1beta1/liquidstakeibc.proto | 335 ++ .../pstake/liquidstakeibc/v1beta1/msgs.proto | 161 + .../liquidstakeibc/v1beta1/params.proto | 25 + .../pstake/liquidstakeibc/v1beta1/query.proto | 194 ++ .../pstake/lscosmos/v1beta1/genesis.proto | 31 + .../v1beta1/governance_proposal.proto | 69 + .../pstake/lscosmos/v1beta1/lscosmos.proto | 168 + .../proto/pstake/lscosmos/v1beta1/msgs.proto | 138 + .../pstake/lscosmos/v1beta1/params.proto | 9 + .../proto/pstake/lscosmos/v1beta1/query.proto | 284 ++ .../pstake/ratesync/v1beta1/contract.proto | 35 + .../pstake/ratesync/v1beta1/genesis.proto | 14 + .../pstake/ratesync/v1beta1/params.proto | 14 + .../proto/pstake/ratesync/v1beta1/query.proto | 52 + .../pstake/ratesync/v1beta1/ratesync.proto | 71 + .../proto/pstake/ratesync/v1beta1/tx.proto | 63 + packages/types/protobuf/scripts/codegen.js | 4 + 78 files changed, 22310 insertions(+), 596 deletions(-) create mode 100644 packages/types/protobuf/codegen/pstake/bundle.ts create mode 100644 packages/types/protobuf/codegen/pstake/client.ts create mode 100644 packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/genesis.ts create mode 100644 packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/liquidstake.ts create mode 100644 packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/query.rpc.Query.ts create mode 100644 packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/query.ts create mode 100644 packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/tx.amino.ts create mode 100644 packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/tx.registry.ts create mode 100644 packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/tx.rpc.msg.ts create mode 100644 packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/tx.ts create mode 100644 packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/genesis.ts create mode 100644 packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/liquidstakeibc.ts create mode 100644 packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/msgs.amino.ts create mode 100644 packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/msgs.registry.ts create mode 100644 packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/msgs.rpc.msg.ts create mode 100644 packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/msgs.ts create mode 100644 packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/params.ts create mode 100644 packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/query.rpc.Query.ts create mode 100644 packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/query.ts create mode 100644 packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/genesis.ts create mode 100644 packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/governance_proposal.ts create mode 100644 packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/lscosmos.ts create mode 100644 packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/msgs.amino.ts create mode 100644 packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/msgs.registry.ts create mode 100644 packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/msgs.rpc.msg.ts create mode 100644 packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/msgs.ts create mode 100644 packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/params.ts create mode 100644 packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/query.rpc.Query.ts create mode 100644 packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/query.ts create mode 100644 packages/types/protobuf/codegen/pstake/ratesync/v1beta1/contract.ts create mode 100644 packages/types/protobuf/codegen/pstake/ratesync/v1beta1/genesis.ts create mode 100644 packages/types/protobuf/codegen/pstake/ratesync/v1beta1/params.ts create mode 100644 packages/types/protobuf/codegen/pstake/ratesync/v1beta1/query.rpc.Query.ts create mode 100644 packages/types/protobuf/codegen/pstake/ratesync/v1beta1/query.ts create mode 100644 packages/types/protobuf/codegen/pstake/ratesync/v1beta1/ratesync.ts create mode 100644 packages/types/protobuf/codegen/pstake/ratesync/v1beta1/tx.amino.ts create mode 100644 packages/types/protobuf/codegen/pstake/ratesync/v1beta1/tx.registry.ts create mode 100644 packages/types/protobuf/codegen/pstake/ratesync/v1beta1/tx.rpc.msg.ts create mode 100644 packages/types/protobuf/codegen/pstake/ratesync/v1beta1/tx.ts create mode 100644 packages/types/protobuf/codegen/pstake/rpc.query.ts create mode 100644 packages/types/protobuf/codegen/pstake/rpc.tx.ts create mode 100644 packages/types/protobuf/proto/pstake/liquidstake/v1beta1/genesis.proto create mode 100644 packages/types/protobuf/proto/pstake/liquidstake/v1beta1/liquidstake.proto create mode 100644 packages/types/protobuf/proto/pstake/liquidstake/v1beta1/query.proto create mode 100644 packages/types/protobuf/proto/pstake/liquidstake/v1beta1/tx.proto create mode 100644 packages/types/protobuf/proto/pstake/liquidstakeibc/v1beta1/genesis.proto create mode 100644 packages/types/protobuf/proto/pstake/liquidstakeibc/v1beta1/liquidstakeibc.proto create mode 100644 packages/types/protobuf/proto/pstake/liquidstakeibc/v1beta1/msgs.proto create mode 100644 packages/types/protobuf/proto/pstake/liquidstakeibc/v1beta1/params.proto create mode 100644 packages/types/protobuf/proto/pstake/liquidstakeibc/v1beta1/query.proto create mode 100644 packages/types/protobuf/proto/pstake/lscosmos/v1beta1/genesis.proto create mode 100644 packages/types/protobuf/proto/pstake/lscosmos/v1beta1/governance_proposal.proto create mode 100644 packages/types/protobuf/proto/pstake/lscosmos/v1beta1/lscosmos.proto create mode 100644 packages/types/protobuf/proto/pstake/lscosmos/v1beta1/msgs.proto create mode 100644 packages/types/protobuf/proto/pstake/lscosmos/v1beta1/params.proto create mode 100644 packages/types/protobuf/proto/pstake/lscosmos/v1beta1/query.proto create mode 100644 packages/types/protobuf/proto/pstake/ratesync/v1beta1/contract.proto create mode 100644 packages/types/protobuf/proto/pstake/ratesync/v1beta1/genesis.proto create mode 100644 packages/types/protobuf/proto/pstake/ratesync/v1beta1/params.proto create mode 100644 packages/types/protobuf/proto/pstake/ratesync/v1beta1/query.proto create mode 100644 packages/types/protobuf/proto/pstake/ratesync/v1beta1/ratesync.proto create mode 100644 packages/types/protobuf/proto/pstake/ratesync/v1beta1/tx.proto diff --git a/packages/types/protobuf/codegen/alliance/bundle.ts b/packages/types/protobuf/codegen/alliance/bundle.ts index e8c137010..88533f350 100644 --- a/packages/types/protobuf/codegen/alliance/bundle.ts +++ b/packages/types/protobuf/codegen/alliance/bundle.ts @@ -8,12 +8,12 @@ import * as _6 from "./alliance/query"; import * as _7 from "./alliance/redelegations"; import * as _8 from "./alliance/tx"; import * as _9 from "./alliance/unbonding"; -import * as _324 from "./alliance/tx.amino"; -import * as _325 from "./alliance/tx.registry"; -import * as _326 from "./alliance/query.rpc.Query"; -import * as _327 from "./alliance/tx.rpc.msg"; -import * as _539 from "./rpc.query"; -import * as _540 from "./rpc.tx"; +import * as _345 from "./alliance/tx.amino"; +import * as _346 from "./alliance/tx.registry"; +import * as _347 from "./alliance/query.rpc.Query"; +import * as _348 from "./alliance/tx.rpc.msg"; +import * as _576 from "./rpc.query"; +import * as _577 from "./rpc.tx"; export namespace alliance { export const alliance = { ..._0, @@ -26,13 +26,13 @@ export namespace alliance { ..._7, ..._8, ..._9, - ..._324, - ..._325, - ..._326, - ..._327 + ..._345, + ..._346, + ..._347, + ..._348 }; export const ClientFactory = { - ..._539, - ..._540 + ..._576, + ..._577 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/circle/bundle.ts b/packages/types/protobuf/codegen/circle/bundle.ts index 37545a6f0..d1fbcdc7f 100644 --- a/packages/types/protobuf/codegen/circle/bundle.ts +++ b/packages/types/protobuf/codegen/circle/bundle.ts @@ -14,12 +14,12 @@ import * as _23 from "./cctp/v1/sending_and_receiving_messages_paused"; import * as _24 from "./cctp/v1/signature_threshold"; import * as _25 from "./cctp/v1/token_pair"; import * as _26 from "./cctp/v1/tx"; -import * as _328 from "./cctp/v1/tx.amino"; -import * as _329 from "./cctp/v1/tx.registry"; -import * as _330 from "./cctp/v1/query.rpc.Query"; -import * as _331 from "./cctp/v1/tx.rpc.msg"; -import * as _541 from "./rpc.query"; -import * as _542 from "./rpc.tx"; +import * as _349 from "./cctp/v1/tx.amino"; +import * as _350 from "./cctp/v1/tx.registry"; +import * as _351 from "./cctp/v1/query.rpc.Query"; +import * as _352 from "./cctp/v1/tx.rpc.msg"; +import * as _578 from "./rpc.query"; +import * as _579 from "./rpc.tx"; export namespace circle { export namespace cctp { export const v1 = { @@ -39,14 +39,14 @@ export namespace circle { ..._24, ..._25, ..._26, - ..._328, - ..._329, - ..._330, - ..._331 + ..._349, + ..._350, + ..._351, + ..._352 }; } export const ClientFactory = { - ..._541, - ..._542 + ..._578, + ..._579 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/bundle.ts b/packages/types/protobuf/codegen/cosmos/bundle.ts index 46c611a39..87adfb95a 100644 --- a/packages/types/protobuf/codegen/cosmos/bundle.ts +++ b/packages/types/protobuf/codegen/cosmos/bundle.ts @@ -60,55 +60,55 @@ import * as _86 from "./tx/v1beta1/tx"; import * as _87 from "./upgrade/v1beta1/query"; import * as _88 from "./upgrade/v1beta1/tx"; import * as _89 from "./upgrade/v1beta1/upgrade"; -import * as _332 from "./auth/v1beta1/tx.amino"; -import * as _333 from "./authz/v1beta1/tx.amino"; -import * as _334 from "./bank/v1beta1/tx.amino"; -import * as _335 from "./distribution/v1beta1/tx.amino"; -import * as _336 from "./feegrant/v1beta1/tx.amino"; -import * as _337 from "./gov/v1/tx.amino"; -import * as _338 from "./gov/v1beta1/tx.amino"; -import * as _339 from "./mint/v1beta1/tx.amino"; -import * as _340 from "./slashing/v1beta1/tx.amino"; -import * as _341 from "./staking/v1beta1/tx.amino"; -import * as _342 from "./upgrade/v1beta1/tx.amino"; -import * as _343 from "./auth/v1beta1/tx.registry"; -import * as _344 from "./authz/v1beta1/tx.registry"; -import * as _345 from "./bank/v1beta1/tx.registry"; -import * as _346 from "./distribution/v1beta1/tx.registry"; -import * as _347 from "./feegrant/v1beta1/tx.registry"; -import * as _348 from "./gov/v1/tx.registry"; -import * as _349 from "./gov/v1beta1/tx.registry"; -import * as _350 from "./mint/v1beta1/tx.registry"; -import * as _351 from "./slashing/v1beta1/tx.registry"; -import * as _352 from "./staking/v1beta1/tx.registry"; -import * as _353 from "./upgrade/v1beta1/tx.registry"; -import * as _354 from "./auth/v1beta1/query.rpc.Query"; -import * as _355 from "./authz/v1beta1/query.rpc.Query"; -import * as _356 from "./bank/v1beta1/query.rpc.Query"; -import * as _357 from "./base/tendermint/v1beta1/query.rpc.Service"; -import * as _358 from "./distribution/v1beta1/query.rpc.Query"; -import * as _359 from "./feegrant/v1beta1/query.rpc.Query"; -import * as _360 from "./gov/v1/query.rpc.Query"; -import * as _361 from "./gov/v1beta1/query.rpc.Query"; -import * as _362 from "./mint/v1beta1/query.rpc.Query"; -import * as _363 from "./params/v1beta1/query.rpc.Query"; -import * as _364 from "./slashing/v1beta1/query.rpc.Query"; -import * as _365 from "./staking/v1beta1/query.rpc.Query"; -import * as _366 from "./tx/v1beta1/service.rpc.Service"; -import * as _367 from "./upgrade/v1beta1/query.rpc.Query"; -import * as _368 from "./auth/v1beta1/tx.rpc.msg"; -import * as _369 from "./authz/v1beta1/tx.rpc.msg"; -import * as _370 from "./bank/v1beta1/tx.rpc.msg"; -import * as _371 from "./distribution/v1beta1/tx.rpc.msg"; -import * as _372 from "./feegrant/v1beta1/tx.rpc.msg"; -import * as _373 from "./gov/v1/tx.rpc.msg"; -import * as _374 from "./gov/v1beta1/tx.rpc.msg"; -import * as _375 from "./mint/v1beta1/tx.rpc.msg"; -import * as _376 from "./slashing/v1beta1/tx.rpc.msg"; -import * as _377 from "./staking/v1beta1/tx.rpc.msg"; -import * as _378 from "./upgrade/v1beta1/tx.rpc.msg"; -import * as _543 from "./rpc.query"; -import * as _544 from "./rpc.tx"; +import * as _353 from "./auth/v1beta1/tx.amino"; +import * as _354 from "./authz/v1beta1/tx.amino"; +import * as _355 from "./bank/v1beta1/tx.amino"; +import * as _356 from "./distribution/v1beta1/tx.amino"; +import * as _357 from "./feegrant/v1beta1/tx.amino"; +import * as _358 from "./gov/v1/tx.amino"; +import * as _359 from "./gov/v1beta1/tx.amino"; +import * as _360 from "./mint/v1beta1/tx.amino"; +import * as _361 from "./slashing/v1beta1/tx.amino"; +import * as _362 from "./staking/v1beta1/tx.amino"; +import * as _363 from "./upgrade/v1beta1/tx.amino"; +import * as _364 from "./auth/v1beta1/tx.registry"; +import * as _365 from "./authz/v1beta1/tx.registry"; +import * as _366 from "./bank/v1beta1/tx.registry"; +import * as _367 from "./distribution/v1beta1/tx.registry"; +import * as _368 from "./feegrant/v1beta1/tx.registry"; +import * as _369 from "./gov/v1/tx.registry"; +import * as _370 from "./gov/v1beta1/tx.registry"; +import * as _371 from "./mint/v1beta1/tx.registry"; +import * as _372 from "./slashing/v1beta1/tx.registry"; +import * as _373 from "./staking/v1beta1/tx.registry"; +import * as _374 from "./upgrade/v1beta1/tx.registry"; +import * as _375 from "./auth/v1beta1/query.rpc.Query"; +import * as _376 from "./authz/v1beta1/query.rpc.Query"; +import * as _377 from "./bank/v1beta1/query.rpc.Query"; +import * as _378 from "./base/tendermint/v1beta1/query.rpc.Service"; +import * as _379 from "./distribution/v1beta1/query.rpc.Query"; +import * as _380 from "./feegrant/v1beta1/query.rpc.Query"; +import * as _381 from "./gov/v1/query.rpc.Query"; +import * as _382 from "./gov/v1beta1/query.rpc.Query"; +import * as _383 from "./mint/v1beta1/query.rpc.Query"; +import * as _384 from "./params/v1beta1/query.rpc.Query"; +import * as _385 from "./slashing/v1beta1/query.rpc.Query"; +import * as _386 from "./staking/v1beta1/query.rpc.Query"; +import * as _387 from "./tx/v1beta1/service.rpc.Service"; +import * as _388 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _389 from "./auth/v1beta1/tx.rpc.msg"; +import * as _390 from "./authz/v1beta1/tx.rpc.msg"; +import * as _391 from "./bank/v1beta1/tx.rpc.msg"; +import * as _392 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _393 from "./feegrant/v1beta1/tx.rpc.msg"; +import * as _394 from "./gov/v1/tx.rpc.msg"; +import * as _395 from "./gov/v1beta1/tx.rpc.msg"; +import * as _396 from "./mint/v1beta1/tx.rpc.msg"; +import * as _397 from "./slashing/v1beta1/tx.rpc.msg"; +import * as _398 from "./staking/v1beta1/tx.rpc.msg"; +import * as _399 from "./upgrade/v1beta1/tx.rpc.msg"; +import * as _580 from "./rpc.query"; +import * as _581 from "./rpc.tx"; export namespace cosmos { export namespace auth { export const v1beta1 = { @@ -116,10 +116,10 @@ export namespace cosmos { ..._29, ..._30, ..._31, - ..._332, - ..._343, - ..._354, - ..._368 + ..._353, + ..._364, + ..._375, + ..._389 }; } export namespace authz { @@ -129,10 +129,10 @@ export namespace cosmos { ..._34, ..._35, ..._36, - ..._333, - ..._344, - ..._355, - ..._369 + ..._354, + ..._365, + ..._376, + ..._390 }; } export namespace bank { @@ -142,10 +142,10 @@ export namespace cosmos { ..._39, ..._40, ..._41, - ..._334, - ..._345, - ..._356, - ..._370 + ..._355, + ..._366, + ..._377, + ..._391 }; } export namespace base { @@ -163,7 +163,7 @@ export namespace cosmos { export const v1beta1 = { ..._44, ..._45, - ..._357 + ..._378 }; } export const v1beta1 = { @@ -187,10 +187,10 @@ export namespace cosmos { ..._51, ..._52, ..._53, - ..._335, - ..._346, - ..._358, - ..._371 + ..._356, + ..._367, + ..._379, + ..._392 }; } export namespace feegrant { @@ -199,10 +199,10 @@ export namespace cosmos { ..._55, ..._56, ..._57, - ..._336, - ..._347, - ..._359, - ..._372 + ..._357, + ..._368, + ..._380, + ..._393 }; } export namespace gov { @@ -211,20 +211,20 @@ export namespace cosmos { ..._59, ..._60, ..._61, - ..._337, - ..._348, - ..._360, - ..._373 + ..._358, + ..._369, + ..._381, + ..._394 }; export const v1beta1 = { ..._62, ..._63, ..._64, ..._65, - ..._338, - ..._349, - ..._361, - ..._374 + ..._359, + ..._370, + ..._382, + ..._395 }; } export namespace mint { @@ -233,10 +233,10 @@ export namespace cosmos { ..._67, ..._68, ..._69, - ..._339, - ..._350, - ..._362, - ..._375 + ..._360, + ..._371, + ..._383, + ..._396 }; } export namespace msg { @@ -253,7 +253,7 @@ export namespace cosmos { export const v1beta1 = { ..._72, ..._73, - ..._363 + ..._384 }; } export namespace query { @@ -267,10 +267,10 @@ export namespace cosmos { ..._76, ..._77, ..._78, - ..._340, - ..._351, - ..._364, - ..._376 + ..._361, + ..._372, + ..._385, + ..._397 }; } export namespace staking { @@ -280,10 +280,10 @@ export namespace cosmos { ..._81, ..._82, ..._83, - ..._341, - ..._352, - ..._365, - ..._377 + ..._362, + ..._373, + ..._386, + ..._398 }; } export namespace tx { @@ -295,7 +295,7 @@ export namespace cosmos { export const v1beta1 = { ..._85, ..._86, - ..._366 + ..._387 }; } export namespace upgrade { @@ -303,14 +303,14 @@ export namespace cosmos { ..._87, ..._88, ..._89, - ..._342, - ..._353, - ..._367, - ..._378 + ..._363, + ..._374, + ..._388, + ..._399 }; } export const ClientFactory = { - ..._543, - ..._544 + ..._580, + ..._581 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmwasm/bundle.ts b/packages/types/protobuf/codegen/cosmwasm/bundle.ts index 893641735..15e4aa086 100644 --- a/packages/types/protobuf/codegen/cosmwasm/bundle.ts +++ b/packages/types/protobuf/codegen/cosmwasm/bundle.ts @@ -10,16 +10,16 @@ import * as _98 from "./wasm/v1/proposal"; import * as _99 from "./wasm/v1/query"; import * as _100 from "./wasm/v1/tx"; import * as _101 from "./wasm/v1/types"; -import * as _379 from "./tokenfactory/v1beta1/tx.amino"; -import * as _380 from "./wasm/v1/tx.amino"; -import * as _381 from "./tokenfactory/v1beta1/tx.registry"; -import * as _382 from "./wasm/v1/tx.registry"; -import * as _383 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _384 from "./wasm/v1/query.rpc.Query"; -import * as _385 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _386 from "./wasm/v1/tx.rpc.msg"; -import * as _545 from "./rpc.query"; -import * as _546 from "./rpc.tx"; +import * as _400 from "./tokenfactory/v1beta1/tx.amino"; +import * as _401 from "./wasm/v1/tx.amino"; +import * as _402 from "./tokenfactory/v1beta1/tx.registry"; +import * as _403 from "./wasm/v1/tx.registry"; +import * as _404 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _405 from "./wasm/v1/query.rpc.Query"; +import * as _406 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _407 from "./wasm/v1/tx.rpc.msg"; +import * as _582 from "./rpc.query"; +import * as _583 from "./rpc.tx"; export namespace cosmwasm { export namespace tokenfactory { export const v1beta1 = { @@ -28,10 +28,10 @@ export namespace cosmwasm { ..._92, ..._93, ..._94, - ..._379, - ..._381, - ..._383, - ..._385 + ..._400, + ..._402, + ..._404, + ..._406 }; } export namespace wasm { @@ -43,14 +43,14 @@ export namespace cosmwasm { ..._99, ..._100, ..._101, - ..._380, - ..._382, - ..._384, - ..._386 + ..._401, + ..._403, + ..._405, + ..._407 }; } export const ClientFactory = { - ..._545, - ..._546 + ..._582, + ..._583 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/gaia/bundle.ts b/packages/types/protobuf/codegen/gaia/bundle.ts index ab6089e54..f73d90748 100644 --- a/packages/types/protobuf/codegen/gaia/bundle.ts +++ b/packages/types/protobuf/codegen/gaia/bundle.ts @@ -1,26 +1,26 @@ import * as _102 from "./globalfee/v1beta1/genesis"; import * as _103 from "./globalfee/v1beta1/query"; import * as _104 from "./globalfee/v1beta1/tx"; -import * as _387 from "./globalfee/v1beta1/tx.amino"; -import * as _388 from "./globalfee/v1beta1/tx.registry"; -import * as _389 from "./globalfee/v1beta1/query.rpc.Query"; -import * as _390 from "./globalfee/v1beta1/tx.rpc.msg"; -import * as _547 from "./rpc.query"; -import * as _548 from "./rpc.tx"; +import * as _408 from "./globalfee/v1beta1/tx.amino"; +import * as _409 from "./globalfee/v1beta1/tx.registry"; +import * as _410 from "./globalfee/v1beta1/query.rpc.Query"; +import * as _411 from "./globalfee/v1beta1/tx.rpc.msg"; +import * as _584 from "./rpc.query"; +import * as _585 from "./rpc.tx"; export namespace gaia { export namespace globalfee { export const v1beta1 = { ..._102, ..._103, ..._104, - ..._387, - ..._388, - ..._389, - ..._390 + ..._408, + ..._409, + ..._410, + ..._411 }; } export const ClientFactory = { - ..._547, - ..._548 + ..._584, + ..._585 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/bundle.ts b/packages/types/protobuf/codegen/ibc/bundle.ts index 1e09309d1..a1e20ded4 100644 --- a/packages/types/protobuf/codegen/ibc/bundle.ts +++ b/packages/types/protobuf/codegen/ibc/bundle.ts @@ -20,28 +20,28 @@ import * as _131 from "./core/client/v1/client"; import * as _132 from "./core/client/v1/genesis"; import * as _133 from "./core/client/v1/query"; import * as _134 from "./core/client/v1/tx"; -import * as _391 from "./applications/interchain_accounts/controller/v1/tx.amino"; -import * as _392 from "./applications/interchain_accounts/host/v1/tx.amino"; -import * as _393 from "./applications/transfer/v1/tx.amino"; -import * as _394 from "./core/channel/v1/tx.amino"; -import * as _395 from "./core/client/v1/tx.amino"; -import * as _396 from "./applications/interchain_accounts/controller/v1/tx.registry"; -import * as _397 from "./applications/interchain_accounts/host/v1/tx.registry"; -import * as _398 from "./applications/transfer/v1/tx.registry"; -import * as _399 from "./core/channel/v1/tx.registry"; -import * as _400 from "./core/client/v1/tx.registry"; -import * as _401 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; -import * as _402 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; -import * as _403 from "./applications/transfer/v1/query.rpc.Query"; -import * as _404 from "./core/channel/v1/query.rpc.Query"; -import * as _405 from "./core/client/v1/query.rpc.Query"; -import * as _406 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; -import * as _407 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; -import * as _408 from "./applications/transfer/v1/tx.rpc.msg"; -import * as _409 from "./core/channel/v1/tx.rpc.msg"; -import * as _410 from "./core/client/v1/tx.rpc.msg"; -import * as _549 from "./rpc.query"; -import * as _550 from "./rpc.tx"; +import * as _412 from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as _413 from "./applications/interchain_accounts/host/v1/tx.amino"; +import * as _414 from "./applications/transfer/v1/tx.amino"; +import * as _415 from "./core/channel/v1/tx.amino"; +import * as _416 from "./core/client/v1/tx.amino"; +import * as _417 from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as _418 from "./applications/interchain_accounts/host/v1/tx.registry"; +import * as _419 from "./applications/transfer/v1/tx.registry"; +import * as _420 from "./core/channel/v1/tx.registry"; +import * as _421 from "./core/client/v1/tx.registry"; +import * as _422 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; +import * as _423 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; +import * as _424 from "./applications/transfer/v1/query.rpc.Query"; +import * as _425 from "./core/channel/v1/query.rpc.Query"; +import * as _426 from "./core/client/v1/query.rpc.Query"; +import * as _427 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; +import * as _428 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; +import * as _429 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _430 from "./core/channel/v1/tx.rpc.msg"; +import * as _431 from "./core/client/v1/tx.rpc.msg"; +import * as _586 from "./rpc.query"; +import * as _587 from "./rpc.tx"; export namespace ibc { export namespace applications { export namespace interchain_accounts { @@ -50,10 +50,10 @@ export namespace ibc { ..._113, ..._114, ..._115, - ..._391, - ..._396, - ..._401, - ..._406 + ..._412, + ..._417, + ..._422, + ..._427 }; } export namespace host { @@ -61,10 +61,10 @@ export namespace ibc { ..._116, ..._117, ..._118, - ..._392, - ..._397, - ..._402, - ..._407 + ..._413, + ..._418, + ..._423, + ..._428 }; } export const v1 = { @@ -80,10 +80,10 @@ export namespace ibc { ..._124, ..._125, ..._126, - ..._393, - ..._398, - ..._403, - ..._408 + ..._414, + ..._419, + ..._424, + ..._429 }; } } @@ -94,10 +94,10 @@ export namespace ibc { ..._128, ..._129, ..._130, - ..._394, - ..._399, - ..._404, - ..._409 + ..._415, + ..._420, + ..._425, + ..._430 }; } export namespace client { @@ -106,15 +106,15 @@ export namespace ibc { ..._132, ..._133, ..._134, - ..._395, - ..._400, - ..._405, - ..._410 + ..._416, + ..._421, + ..._426, + ..._431 }; } } export const ClientFactory = { - ..._549, - ..._550 + ..._586, + ..._587 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/index.ts b/packages/types/protobuf/codegen/index.ts index 246c1f215..edc498ca6 100644 --- a/packages/types/protobuf/codegen/index.ts +++ b/packages/types/protobuf/codegen/index.ts @@ -28,6 +28,8 @@ export * from "./neutron/bundle"; export * from "./neutron/client"; export * from "./osmosis/bundle"; export * from "./osmosis/client"; +export * from "./pstake/bundle"; +export * from "./pstake/client"; export * from "./publicawesome/bundle"; export * from "./publicawesome/client"; export * from "./regen/bundle"; diff --git a/packages/types/protobuf/codegen/juno/bundle.ts b/packages/types/protobuf/codegen/juno/bundle.ts index 34bedb68f..4aa4e59cf 100644 --- a/packages/types/protobuf/codegen/juno/bundle.ts +++ b/packages/types/protobuf/codegen/juno/bundle.ts @@ -6,16 +6,16 @@ import * as _139 from "./mint/genesis"; import * as _140 from "./mint/mint"; import * as _141 from "./mint/query"; import * as _142 from "./mint/tx"; -import * as _411 from "./feeshare/v1/tx.amino"; -import * as _412 from "./mint/tx.amino"; -import * as _413 from "./feeshare/v1/tx.registry"; -import * as _414 from "./mint/tx.registry"; -import * as _415 from "./feeshare/v1/query.rpc.Query"; -import * as _416 from "./mint/query.rpc.Query"; -import * as _417 from "./feeshare/v1/tx.rpc.msg"; -import * as _418 from "./mint/tx.rpc.msg"; -import * as _551 from "./rpc.query"; -import * as _552 from "./rpc.tx"; +import * as _432 from "./feeshare/v1/tx.amino"; +import * as _433 from "./mint/tx.amino"; +import * as _434 from "./feeshare/v1/tx.registry"; +import * as _435 from "./mint/tx.registry"; +import * as _436 from "./feeshare/v1/query.rpc.Query"; +import * as _437 from "./mint/query.rpc.Query"; +import * as _438 from "./feeshare/v1/tx.rpc.msg"; +import * as _439 from "./mint/tx.rpc.msg"; +import * as _588 from "./rpc.query"; +import * as _589 from "./rpc.tx"; export namespace juno { export namespace feeshare { export const v1 = { @@ -23,10 +23,10 @@ export namespace juno { ..._136, ..._137, ..._138, - ..._411, - ..._413, - ..._415, - ..._417 + ..._432, + ..._434, + ..._436, + ..._438 }; } export const mint = { @@ -34,13 +34,13 @@ export namespace juno { ..._140, ..._141, ..._142, - ..._412, - ..._414, - ..._416, - ..._418 + ..._433, + ..._435, + ..._437, + ..._439 }; export const ClientFactory = { - ..._551, - ..._552 + ..._588, + ..._589 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/bundle.ts b/packages/types/protobuf/codegen/kujira/bundle.ts index aa4330774..830aaa96a 100644 --- a/packages/types/protobuf/codegen/kujira/bundle.ts +++ b/packages/types/protobuf/codegen/kujira/bundle.ts @@ -12,17 +12,17 @@ import * as _153 from "./scheduler/hook"; import * as _154 from "./scheduler/params"; import * as _155 from "./scheduler/proposal"; import * as _156 from "./scheduler/query"; -import * as _419 from "./denom/tx.amino"; -import * as _420 from "./oracle/tx.amino"; -import * as _421 from "./denom/tx.registry"; -import * as _422 from "./oracle/tx.registry"; -import * as _423 from "./denom/query.rpc.Query"; -import * as _424 from "./oracle/query.rpc.Query"; -import * as _425 from "./scheduler/query.rpc.Query"; -import * as _426 from "./denom/tx.rpc.msg"; -import * as _427 from "./oracle/tx.rpc.msg"; -import * as _553 from "./rpc.query"; -import * as _554 from "./rpc.tx"; +import * as _440 from "./denom/tx.amino"; +import * as _441 from "./oracle/tx.amino"; +import * as _442 from "./denom/tx.registry"; +import * as _443 from "./oracle/tx.registry"; +import * as _444 from "./denom/query.rpc.Query"; +import * as _445 from "./oracle/query.rpc.Query"; +import * as _446 from "./scheduler/query.rpc.Query"; +import * as _447 from "./denom/tx.rpc.msg"; +import * as _448 from "./oracle/tx.rpc.msg"; +import * as _590 from "./rpc.query"; +import * as _591 from "./rpc.tx"; export namespace kujira { export const denom = { ..._143, @@ -30,20 +30,20 @@ export namespace kujira { ..._145, ..._146, ..._147, - ..._419, - ..._421, - ..._423, - ..._426 + ..._440, + ..._442, + ..._444, + ..._447 }; export const oracle = { ..._148, ..._149, ..._150, ..._151, - ..._420, - ..._422, - ..._424, - ..._427 + ..._441, + ..._443, + ..._445, + ..._448 }; export const scheduler = { ..._152, @@ -51,10 +51,10 @@ export namespace kujira { ..._154, ..._155, ..._156, - ..._425 + ..._446 }; export const ClientFactory = { - ..._553, - ..._554 + ..._590, + ..._591 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/neutron/bundle.ts b/packages/types/protobuf/codegen/neutron/bundle.ts index 6544a2b85..2549ea389 100644 --- a/packages/types/protobuf/codegen/neutron/bundle.ts +++ b/packages/types/protobuf/codegen/neutron/bundle.ts @@ -36,32 +36,32 @@ import * as _191 from "./interchaintxs/v1/genesis"; import * as _192 from "./interchaintxs/v1/params"; import * as _193 from "./interchaintxs/v1/query"; import * as _194 from "./interchaintxs/v1/tx"; -import * as _428 from "./cron/tx.amino"; -import * as _429 from "./dex/tx.amino"; -import * as _430 from "./feeburner/tx.amino"; -import * as _431 from "./feerefunder/tx.amino"; -import * as _432 from "./interchainqueries/tx.amino"; -import * as _433 from "./interchaintxs/v1/tx.amino"; -import * as _434 from "./cron/tx.registry"; -import * as _435 from "./dex/tx.registry"; -import * as _436 from "./feeburner/tx.registry"; -import * as _437 from "./feerefunder/tx.registry"; -import * as _438 from "./interchainqueries/tx.registry"; -import * as _439 from "./interchaintxs/v1/tx.registry"; -import * as _440 from "./cron/query.rpc.Query"; -import * as _441 from "./dex/query.rpc.Query"; -import * as _442 from "./feeburner/query.rpc.Query"; -import * as _443 from "./feerefunder/query.rpc.Query"; -import * as _444 from "./interchainqueries/query.rpc.Query"; -import * as _445 from "./interchaintxs/v1/query.rpc.Query"; -import * as _446 from "./cron/tx.rpc.msg"; -import * as _447 from "./dex/tx.rpc.msg"; -import * as _448 from "./feeburner/tx.rpc.msg"; -import * as _449 from "./feerefunder/tx.rpc.msg"; -import * as _450 from "./interchainqueries/tx.rpc.msg"; -import * as _451 from "./interchaintxs/v1/tx.rpc.msg"; -import * as _555 from "./rpc.query"; -import * as _556 from "./rpc.tx"; +import * as _449 from "./cron/tx.amino"; +import * as _450 from "./dex/tx.amino"; +import * as _451 from "./feeburner/tx.amino"; +import * as _452 from "./feerefunder/tx.amino"; +import * as _453 from "./interchainqueries/tx.amino"; +import * as _454 from "./interchaintxs/v1/tx.amino"; +import * as _455 from "./cron/tx.registry"; +import * as _456 from "./dex/tx.registry"; +import * as _457 from "./feeburner/tx.registry"; +import * as _458 from "./feerefunder/tx.registry"; +import * as _459 from "./interchainqueries/tx.registry"; +import * as _460 from "./interchaintxs/v1/tx.registry"; +import * as _461 from "./cron/query.rpc.Query"; +import * as _462 from "./dex/query.rpc.Query"; +import * as _463 from "./feeburner/query.rpc.Query"; +import * as _464 from "./feerefunder/query.rpc.Query"; +import * as _465 from "./interchainqueries/query.rpc.Query"; +import * as _466 from "./interchaintxs/v1/query.rpc.Query"; +import * as _467 from "./cron/tx.rpc.msg"; +import * as _468 from "./dex/tx.rpc.msg"; +import * as _469 from "./feeburner/tx.rpc.msg"; +import * as _470 from "./feerefunder/tx.rpc.msg"; +import * as _471 from "./interchainqueries/tx.rpc.msg"; +import * as _472 from "./interchaintxs/v1/tx.rpc.msg"; +import * as _592 from "./rpc.query"; +import * as _593 from "./rpc.tx"; export namespace neutron { export namespace contractmanager { export const v1 = { @@ -74,10 +74,10 @@ export namespace neutron { ..._160, ..._161, ..._162, - ..._428, - ..._434, - ..._440, - ..._446 + ..._449, + ..._455, + ..._461, + ..._467 }; export const dex = { ..._163, @@ -94,10 +94,10 @@ export namespace neutron { ..._174, ..._175, ..._176, - ..._429, - ..._435, - ..._441, - ..._447 + ..._450, + ..._456, + ..._462, + ..._468 }; export const feeburner = { ..._177, @@ -105,10 +105,10 @@ export namespace neutron { ..._179, ..._180, ..._181, - ..._430, - ..._436, - ..._442, - ..._448 + ..._451, + ..._457, + ..._463, + ..._469 }; export const feerefunder = { ..._182, @@ -116,20 +116,20 @@ export namespace neutron { ..._184, ..._185, ..._186, - ..._431, - ..._437, - ..._443, - ..._449 + ..._452, + ..._458, + ..._464, + ..._470 }; export const interchainqueries = { ..._187, ..._188, ..._189, ..._190, - ..._432, - ..._438, - ..._444, - ..._450 + ..._453, + ..._459, + ..._465, + ..._471 }; export namespace interchaintxs { export const v1 = { @@ -137,14 +137,14 @@ export namespace neutron { ..._192, ..._193, ..._194, - ..._433, - ..._439, - ..._445, - ..._451 + ..._454, + ..._460, + ..._466, + ..._472 }; } export const ClientFactory = { - ..._555, - ..._556 + ..._592, + ..._593 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/noble/bundle.ts b/packages/types/protobuf/codegen/noble/bundle.ts index 3f83576e3..01c4dbcd4 100644 --- a/packages/types/protobuf/codegen/noble/bundle.ts +++ b/packages/types/protobuf/codegen/noble/bundle.ts @@ -1,16 +1,16 @@ -import * as _311 from "../tariff/genesis"; -import * as _312 from "../tariff/params"; -import * as _313 from "../tariff/query"; -import * as _538 from "../tariff/query.rpc.Query"; -import * as _563 from "./rpc.query"; +import * as _332 from "../tariff/genesis"; +import * as _333 from "../tariff/params"; +import * as _334 from "../tariff/query"; +import * as _575 from "../tariff/query.rpc.Query"; +import * as _602 from "./rpc.query"; export namespace noble { export const tariff = { - ..._311, - ..._312, - ..._313, - ..._538 + ..._332, + ..._333, + ..._334, + ..._575 }; export const ClientFactory = { - ..._563 + ..._602 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/bundle.ts b/packages/types/protobuf/codegen/osmosis/bundle.ts index 2aaf73ae0..5832d0359 100644 --- a/packages/types/protobuf/codegen/osmosis/bundle.ts +++ b/packages/types/protobuf/codegen/osmosis/bundle.ts @@ -69,59 +69,59 @@ import * as _262 from "./txfees/v1beta1/tx"; import * as _263 from "./valset-pref/v1beta1/query"; import * as _264 from "./valset-pref/v1beta1/state"; import * as _265 from "./valset-pref/v1beta1/tx"; -import * as _452 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; -import * as _453 from "./concentratedliquidity/v1beta1/tx.amino"; -import * as _454 from "./gamm/pool-models/balancer/tx/tx.amino"; -import * as _455 from "./gamm/pool-models/stableswap/tx.amino"; -import * as _456 from "./gamm/v1beta1/tx.amino"; -import * as _457 from "./incentives/tx.amino"; -import * as _458 from "./lockup/tx.amino"; -import * as _459 from "./poolmanager/v1beta1/tx.amino"; -import * as _460 from "./protorev/v1beta1/tx.amino"; -import * as _461 from "./superfluid/tx.amino"; -import * as _462 from "./tokenfactory/v1beta1/tx.amino"; -import * as _463 from "./txfees/v1beta1/tx.amino"; -import * as _464 from "./valset-pref/v1beta1/tx.amino"; -import * as _465 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; -import * as _466 from "./concentratedliquidity/v1beta1/tx.registry"; -import * as _467 from "./gamm/pool-models/balancer/tx/tx.registry"; -import * as _468 from "./gamm/pool-models/stableswap/tx.registry"; -import * as _469 from "./gamm/v1beta1/tx.registry"; -import * as _470 from "./incentives/tx.registry"; -import * as _471 from "./lockup/tx.registry"; -import * as _472 from "./poolmanager/v1beta1/tx.registry"; -import * as _473 from "./protorev/v1beta1/tx.registry"; -import * as _474 from "./superfluid/tx.registry"; -import * as _475 from "./tokenfactory/v1beta1/tx.registry"; -import * as _476 from "./txfees/v1beta1/tx.registry"; -import * as _477 from "./valset-pref/v1beta1/tx.registry"; -import * as _478 from "./concentratedliquidity/v1beta1/query.rpc.Query"; -import * as _479 from "./cosmwasmpool/v1beta1/query.rpc.Query"; -import * as _480 from "./gamm/v1beta1/query.rpc.Query"; -import * as _481 from "./incentives/query.rpc.Query"; -import * as _482 from "./lockup/query.rpc.Query"; -import * as _483 from "./pool-incentives/v1beta1/query.rpc.Query"; -import * as _484 from "./poolmanager/v1beta1/query.rpc.Query"; -import * as _485 from "./protorev/v1beta1/query.rpc.Query"; -import * as _486 from "./superfluid/query.rpc.Query"; -import * as _487 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _488 from "./txfees/v1beta1/query.rpc.Query"; -import * as _489 from "./valset-pref/v1beta1/query.rpc.Query"; -import * as _490 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; -import * as _491 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; -import * as _492 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; -import * as _493 from "./gamm/pool-models/stableswap/tx.rpc.msg"; -import * as _494 from "./gamm/v1beta1/tx.rpc.msg"; -import * as _495 from "./incentives/tx.rpc.msg"; -import * as _496 from "./lockup/tx.rpc.msg"; -import * as _497 from "./poolmanager/v1beta1/tx.rpc.msg"; -import * as _498 from "./protorev/v1beta1/tx.rpc.msg"; -import * as _499 from "./superfluid/tx.rpc.msg"; -import * as _500 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _501 from "./txfees/v1beta1/tx.rpc.msg"; -import * as _502 from "./valset-pref/v1beta1/tx.rpc.msg"; -import * as _557 from "./rpc.query"; -import * as _558 from "./rpc.tx"; +import * as _473 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; +import * as _474 from "./concentratedliquidity/v1beta1/tx.amino"; +import * as _475 from "./gamm/pool-models/balancer/tx/tx.amino"; +import * as _476 from "./gamm/pool-models/stableswap/tx.amino"; +import * as _477 from "./gamm/v1beta1/tx.amino"; +import * as _478 from "./incentives/tx.amino"; +import * as _479 from "./lockup/tx.amino"; +import * as _480 from "./poolmanager/v1beta1/tx.amino"; +import * as _481 from "./protorev/v1beta1/tx.amino"; +import * as _482 from "./superfluid/tx.amino"; +import * as _483 from "./tokenfactory/v1beta1/tx.amino"; +import * as _484 from "./txfees/v1beta1/tx.amino"; +import * as _485 from "./valset-pref/v1beta1/tx.amino"; +import * as _486 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; +import * as _487 from "./concentratedliquidity/v1beta1/tx.registry"; +import * as _488 from "./gamm/pool-models/balancer/tx/tx.registry"; +import * as _489 from "./gamm/pool-models/stableswap/tx.registry"; +import * as _490 from "./gamm/v1beta1/tx.registry"; +import * as _491 from "./incentives/tx.registry"; +import * as _492 from "./lockup/tx.registry"; +import * as _493 from "./poolmanager/v1beta1/tx.registry"; +import * as _494 from "./protorev/v1beta1/tx.registry"; +import * as _495 from "./superfluid/tx.registry"; +import * as _496 from "./tokenfactory/v1beta1/tx.registry"; +import * as _497 from "./txfees/v1beta1/tx.registry"; +import * as _498 from "./valset-pref/v1beta1/tx.registry"; +import * as _499 from "./concentratedliquidity/v1beta1/query.rpc.Query"; +import * as _500 from "./cosmwasmpool/v1beta1/query.rpc.Query"; +import * as _501 from "./gamm/v1beta1/query.rpc.Query"; +import * as _502 from "./incentives/query.rpc.Query"; +import * as _503 from "./lockup/query.rpc.Query"; +import * as _504 from "./pool-incentives/v1beta1/query.rpc.Query"; +import * as _505 from "./poolmanager/v1beta1/query.rpc.Query"; +import * as _506 from "./protorev/v1beta1/query.rpc.Query"; +import * as _507 from "./superfluid/query.rpc.Query"; +import * as _508 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _509 from "./txfees/v1beta1/query.rpc.Query"; +import * as _510 from "./valset-pref/v1beta1/query.rpc.Query"; +import * as _511 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; +import * as _512 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; +import * as _513 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; +import * as _514 from "./gamm/pool-models/stableswap/tx.rpc.msg"; +import * as _515 from "./gamm/v1beta1/tx.rpc.msg"; +import * as _516 from "./incentives/tx.rpc.msg"; +import * as _517 from "./lockup/tx.rpc.msg"; +import * as _518 from "./poolmanager/v1beta1/tx.rpc.msg"; +import * as _519 from "./protorev/v1beta1/tx.rpc.msg"; +import * as _520 from "./superfluid/tx.rpc.msg"; +import * as _521 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _522 from "./txfees/v1beta1/tx.rpc.msg"; +import * as _523 from "./valset-pref/v1beta1/tx.rpc.msg"; +import * as _594 from "./rpc.query"; +import * as _595 from "./rpc.tx"; export namespace osmosis { export namespace accum { export const v1beta1 = { @@ -133,17 +133,17 @@ export namespace osmosis { poolmodel: { concentrated: { v1beta1: { - ..._452, - ..._465, - ..._490 + ..._473, + ..._486, + ..._511 } } }, v1beta1: { - ..._453, - ..._466, - ..._478, - ..._491 + ..._474, + ..._487, + ..._499, + ..._512 } }; export namespace cosmwasmpool { @@ -160,7 +160,7 @@ export namespace osmosis { ..._206, ..._207, ..._208, - ..._479 + ..._500 }; } export namespace gamm { @@ -171,27 +171,27 @@ export namespace osmosis { ..._212, ..._213, ..._214, - ..._456, - ..._469, - ..._480, - ..._494 + ..._477, + ..._490, + ..._501, + ..._515 }; export namespace poolmodels { export namespace balancer { export const v1beta1 = { ..._215, - ..._454, - ..._467, - ..._492 + ..._475, + ..._488, + ..._513 }; } export namespace stableswap { export const v1beta1 = { ..._216, ..._217, - ..._455, - ..._468, - ..._493 + ..._476, + ..._489, + ..._514 }; } } @@ -204,10 +204,10 @@ export namespace osmosis { ..._222, ..._223, ..._224, - ..._457, - ..._470, - ..._481, - ..._495 + ..._478, + ..._491, + ..._502, + ..._516 }; export const lockup = { ..._225, @@ -215,10 +215,10 @@ export namespace osmosis { ..._227, ..._228, ..._229, - ..._458, - ..._471, - ..._482, - ..._496 + ..._479, + ..._492, + ..._503, + ..._517 }; export namespace poolincentives { export const v1beta1 = { @@ -227,7 +227,7 @@ export namespace osmosis { ..._232, ..._233, ..._234, - ..._483 + ..._504 }; } export namespace poolmanager { @@ -238,10 +238,10 @@ export namespace osmosis { ..._238, ..._239, ..._240, - ..._459, - ..._472, - ..._484, - ..._497 + ..._480, + ..._493, + ..._505, + ..._518 }; } export namespace protorev { @@ -252,10 +252,10 @@ export namespace osmosis { ..._244, ..._245, ..._246, - ..._460, - ..._473, - ..._485, - ..._498 + ..._481, + ..._494, + ..._506, + ..._519 }; } export const superfluid = { @@ -264,10 +264,10 @@ export namespace osmosis { ..._249, ..._250, ..._251, - ..._461, - ..._474, - ..._486, - ..._499 + ..._482, + ..._495, + ..._507, + ..._520 }; export namespace tokenfactory { export const v1beta1 = { @@ -276,10 +276,10 @@ export namespace osmosis { ..._254, ..._255, ..._256, - ..._462, - ..._475, - ..._487, - ..._500 + ..._483, + ..._496, + ..._508, + ..._521 }; } export namespace txfees { @@ -290,10 +290,10 @@ export namespace osmosis { ..._260, ..._261, ..._262, - ..._463, - ..._476, - ..._488, - ..._501 + ..._484, + ..._497, + ..._509, + ..._522 }; } export namespace valsetpref { @@ -301,14 +301,14 @@ export namespace osmosis { ..._263, ..._264, ..._265, - ..._464, - ..._477, - ..._489, - ..._502 + ..._485, + ..._498, + ..._510, + ..._523 }; } export const ClientFactory = { - ..._557, - ..._558 + ..._594, + ..._595 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/bundle.ts b/packages/types/protobuf/codegen/pstake/bundle.ts new file mode 100644 index 000000000..67018b2b1 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/bundle.ts @@ -0,0 +1,98 @@ +import * as _266 from "./liquidstake/v1beta1/genesis"; +import * as _267 from "./liquidstake/v1beta1/liquidstake"; +import * as _268 from "./liquidstake/v1beta1/query"; +import * as _269 from "./liquidstake/v1beta1/tx"; +import * as _270 from "./liquidstakeibc/v1beta1/genesis"; +import * as _271 from "./liquidstakeibc/v1beta1/liquidstakeibc"; +import * as _272 from "./liquidstakeibc/v1beta1/msgs"; +import * as _273 from "./liquidstakeibc/v1beta1/params"; +import * as _274 from "./liquidstakeibc/v1beta1/query"; +import * as _275 from "./lscosmos/v1beta1/genesis"; +import * as _276 from "./lscosmos/v1beta1/governance_proposal"; +import * as _277 from "./lscosmos/v1beta1/lscosmos"; +import * as _278 from "./lscosmos/v1beta1/msgs"; +import * as _279 from "./lscosmos/v1beta1/params"; +import * as _280 from "./lscosmos/v1beta1/query"; +import * as _281 from "./ratesync/v1beta1/contract"; +import * as _282 from "./ratesync/v1beta1/genesis"; +import * as _283 from "./ratesync/v1beta1/params"; +import * as _284 from "./ratesync/v1beta1/query"; +import * as _285 from "./ratesync/v1beta1/ratesync"; +import * as _286 from "./ratesync/v1beta1/tx"; +import * as _524 from "./liquidstake/v1beta1/tx.amino"; +import * as _525 from "./liquidstakeibc/v1beta1/msgs.amino"; +import * as _526 from "./lscosmos/v1beta1/msgs.amino"; +import * as _527 from "./ratesync/v1beta1/tx.amino"; +import * as _528 from "./liquidstake/v1beta1/tx.registry"; +import * as _529 from "./liquidstakeibc/v1beta1/msgs.registry"; +import * as _530 from "./lscosmos/v1beta1/msgs.registry"; +import * as _531 from "./ratesync/v1beta1/tx.registry"; +import * as _532 from "./liquidstake/v1beta1/query.rpc.Query"; +import * as _533 from "./liquidstakeibc/v1beta1/query.rpc.Query"; +import * as _534 from "./lscosmos/v1beta1/query.rpc.Query"; +import * as _535 from "./ratesync/v1beta1/query.rpc.Query"; +import * as _536 from "./liquidstake/v1beta1/tx.rpc.msg"; +import * as _537 from "./liquidstakeibc/v1beta1/msgs.rpc.msg"; +import * as _538 from "./lscosmos/v1beta1/msgs.rpc.msg"; +import * as _539 from "./ratesync/v1beta1/tx.rpc.msg"; +import * as _596 from "./rpc.query"; +import * as _597 from "./rpc.tx"; +export namespace pstake { + export namespace liquidstake { + export const v1beta1 = { + ..._266, + ..._267, + ..._268, + ..._269, + ..._524, + ..._528, + ..._532, + ..._536 + }; + } + export namespace liquidstakeibc { + export const v1beta1 = { + ..._270, + ..._271, + ..._272, + ..._273, + ..._274, + ..._525, + ..._529, + ..._533, + ..._537 + }; + } + export namespace lscosmos { + export const v1beta1 = { + ..._275, + ..._276, + ..._277, + ..._278, + ..._279, + ..._280, + ..._526, + ..._530, + ..._534, + ..._538 + }; + } + export namespace ratesync { + export const v1beta1 = { + ..._281, + ..._282, + ..._283, + ..._284, + ..._285, + ..._286, + ..._527, + ..._531, + ..._535, + ..._539 + }; + } + export const ClientFactory = { + ..._596, + ..._597 + }; +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/client.ts b/packages/types/protobuf/codegen/pstake/client.ts new file mode 100644 index 000000000..3b47c3531 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/client.ts @@ -0,0 +1,56 @@ +import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; +import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; +import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as pstakeLiquidstakeV1beta1TxRegistry from "./liquidstake/v1beta1/tx.registry"; +import * as pstakeLiquidstakeibcV1beta1MsgsRegistry from "./liquidstakeibc/v1beta1/msgs.registry"; +import * as pstakeLscosmosV1beta1MsgsRegistry from "./lscosmos/v1beta1/msgs.registry"; +import * as pstakeRatesyncV1beta1TxRegistry from "./ratesync/v1beta1/tx.registry"; +import * as pstakeLiquidstakeV1beta1TxAmino from "./liquidstake/v1beta1/tx.amino"; +import * as pstakeLiquidstakeibcV1beta1MsgsAmino from "./liquidstakeibc/v1beta1/msgs.amino"; +import * as pstakeLscosmosV1beta1MsgsAmino from "./lscosmos/v1beta1/msgs.amino"; +import * as pstakeRatesyncV1beta1TxAmino from "./ratesync/v1beta1/tx.amino"; +export const pstakeAminoConverters = { + ...pstakeLiquidstakeV1beta1TxAmino.AminoConverter, + ...pstakeLiquidstakeibcV1beta1MsgsAmino.AminoConverter, + ...pstakeLscosmosV1beta1MsgsAmino.AminoConverter, + ...pstakeRatesyncV1beta1TxAmino.AminoConverter +}; +export const pstakeProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...pstakeLiquidstakeV1beta1TxRegistry.registry, ...pstakeLiquidstakeibcV1beta1MsgsRegistry.registry, ...pstakeLscosmosV1beta1MsgsRegistry.registry, ...pstakeRatesyncV1beta1TxRegistry.registry]; +export const getSigningPstakeClientOptions = ({ + defaultTypes = defaultRegistryTypes +}: { + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +} = {}): { + registry: Registry; + aminoTypes: AminoTypes; +} => { + const registry = new Registry([...defaultTypes, ...pstakeProtoRegistry]); + const aminoTypes = new AminoTypes({ + ...pstakeAminoConverters + }); + return { + registry, + aminoTypes + }; +}; +export const getSigningPstakeClient = async ({ + rpcEndpoint, + signer, + defaultTypes = defaultRegistryTypes +}: { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +}) => { + const { + registry, + aminoTypes + } = getSigningPstakeClientOptions({ + defaultTypes + }); + const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { + registry: (registry as any), + aminoTypes + }); + return client; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/genesis.ts b/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/genesis.ts new file mode 100644 index 000000000..a7fb6e765 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/genesis.ts @@ -0,0 +1,105 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType, LiquidValidator, LiquidValidatorAmino, LiquidValidatorSDKType } from "./liquidstake"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** GenesisState defines the liquidstake module's genesis state. */ +export interface GenesisState { + /** params defines all the parameters for the liquidstake module */ + params: Params | undefined; + liquidValidators: LiquidValidator[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the liquidstake module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the parameters for the liquidstake module */ + params?: ParamsAmino | undefined; + liquid_validators?: LiquidValidatorAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/pstake.liquidstake.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the liquidstake module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType | undefined; + liquid_validators: LiquidValidatorSDKType[]; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + liquidValidators: [] + }; +} +export const GenesisState = { + typeUrl: "/pstake.liquidstake.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.liquidValidators) { + LiquidValidator.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.liquidValidators.push(LiquidValidator.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.liquidValidators = object.liquidValidators?.map(e => LiquidValidator.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.liquidValidators = object.liquid_validators?.map(e => LiquidValidator.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState, useInterfaces: boolean = false): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + if (message.liquidValidators) { + obj.liquid_validators = message.liquidValidators.map(e => e ? LiquidValidator.toAmino(e, useInterfaces) : undefined); + } else { + obj.liquid_validators = []; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg, useInterfaces: boolean = false): GenesisState { + return GenesisState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/liquidstake.ts b/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/liquidstake.ts new file mode 100644 index 000000000..de33bdda6 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/liquidstake.ts @@ -0,0 +1,999 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +/** ValidatorStatus enumerates the status of a liquid validator. */ +export enum ValidatorStatus { + /** VALIDATOR_STATUS_UNSPECIFIED - VALIDATOR_STATUS_UNSPECIFIED defines the unspecified invalid status. */ + VALIDATOR_STATUS_UNSPECIFIED = 0, + /** VALIDATOR_STATUS_ACTIVE - VALIDATOR_STATUS_ACTIVE defines the active, valid status */ + VALIDATOR_STATUS_ACTIVE = 1, + /** VALIDATOR_STATUS_INACTIVE - VALIDATOR_STATUS_INACTIVE defines the inactive, invalid status */ + VALIDATOR_STATUS_INACTIVE = 2, + UNRECOGNIZED = -1, +} +export const ValidatorStatusSDKType = ValidatorStatus; +export const ValidatorStatusAmino = ValidatorStatus; +export function validatorStatusFromJSON(object: any): ValidatorStatus { + switch (object) { + case 0: + case "VALIDATOR_STATUS_UNSPECIFIED": + return ValidatorStatus.VALIDATOR_STATUS_UNSPECIFIED; + case 1: + case "VALIDATOR_STATUS_ACTIVE": + return ValidatorStatus.VALIDATOR_STATUS_ACTIVE; + case 2: + case "VALIDATOR_STATUS_INACTIVE": + return ValidatorStatus.VALIDATOR_STATUS_INACTIVE; + case -1: + case "UNRECOGNIZED": + default: + return ValidatorStatus.UNRECOGNIZED; + } +} +export function validatorStatusToJSON(object: ValidatorStatus): string { + switch (object) { + case ValidatorStatus.VALIDATOR_STATUS_UNSPECIFIED: + return "VALIDATOR_STATUS_UNSPECIFIED"; + case ValidatorStatus.VALIDATOR_STATUS_ACTIVE: + return "VALIDATOR_STATUS_ACTIVE"; + case ValidatorStatus.VALIDATOR_STATUS_INACTIVE: + return "VALIDATOR_STATUS_INACTIVE"; + case ValidatorStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** Params defines the set of params for the liquidstake module. */ +export interface Params { + /** + * LiquidBondDenom specifies the denomination of the token receiving after + * liquid stake, The value is calculated through NetAmount. + */ + liquidBondDenom: string; + /** + * WhitelistedValidators specifies the validators elected to become Active + * Liquid Validators. + */ + whitelistedValidators: WhitelistedValidator[]; + /** + * UnstakeFeeRate specifies the fee rate when liquid unstake is requested, + * unbonded by subtracting it from unbondingAmount + */ + unstakeFeeRate: string; + /** + * LsmDisabled allows to block any msgs that convert staked tokens into + * stkXPRT through LSM. + */ + lsmDisabled: boolean; + /** + * MinLiquidStakingAmount specifies the minimum number of coins to be staked + * to the active liquid validators on liquid staking to minimize decimal loss + * and consider gas efficiency. + */ + minLiquidStakeAmount: string; + /** + * CwLockedPoolAddress defines the bech32-encoded address of + * a CW smart-contract representing a time locked LP (e.g. Superfluid LP). + */ + cwLockedPoolAddress: string; + /** + * FeeAccountAddress defines the bech32-encoded address of + * a an account responsible for accumulating protocol fees. + */ + feeAccountAddress: string; + /** + * AutocompoundFeeRate specifies the fee rate for auto redelegating the stake + * rewards. The fee is taken in favour of the fee account (see + * FeeAccountAddress). + */ + autocompoundFeeRate: string; + /** + * WhitelistAdminAddress the bech32-encoded address of an admin authority + * that is allowed to update whitelisted validators or pause liquidstaking + * module entirely. The key is controlled by an offchain process that is + * selecting validators based on a criteria. Pausing of the module can be + * required during important migrations or failures. + */ + whitelistAdminAddress: string; + /** + * ModulePaused is a safety toggle that allows to stop main module functions + * such as stake/unstake/stake-to-lp and the BeginBlocker logic. + */ + modulePaused: boolean; +} +export interface ParamsProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the set of params for the liquidstake module. */ +export interface ParamsAmino { + /** + * LiquidBondDenom specifies the denomination of the token receiving after + * liquid stake, The value is calculated through NetAmount. + */ + liquid_bond_denom?: string; + /** + * WhitelistedValidators specifies the validators elected to become Active + * Liquid Validators. + */ + whitelisted_validators?: WhitelistedValidatorAmino[]; + /** + * UnstakeFeeRate specifies the fee rate when liquid unstake is requested, + * unbonded by subtracting it from unbondingAmount + */ + unstake_fee_rate?: string; + /** + * LsmDisabled allows to block any msgs that convert staked tokens into + * stkXPRT through LSM. + */ + lsm_disabled?: boolean; + /** + * MinLiquidStakingAmount specifies the minimum number of coins to be staked + * to the active liquid validators on liquid staking to minimize decimal loss + * and consider gas efficiency. + */ + min_liquid_stake_amount?: string; + /** + * CwLockedPoolAddress defines the bech32-encoded address of + * a CW smart-contract representing a time locked LP (e.g. Superfluid LP). + */ + cw_locked_pool_address?: string; + /** + * FeeAccountAddress defines the bech32-encoded address of + * a an account responsible for accumulating protocol fees. + */ + fee_account_address?: string; + /** + * AutocompoundFeeRate specifies the fee rate for auto redelegating the stake + * rewards. The fee is taken in favour of the fee account (see + * FeeAccountAddress). + */ + autocompound_fee_rate?: string; + /** + * WhitelistAdminAddress the bech32-encoded address of an admin authority + * that is allowed to update whitelisted validators or pause liquidstaking + * module entirely. The key is controlled by an offchain process that is + * selecting validators based on a criteria. Pausing of the module can be + * required during important migrations or failures. + */ + whitelist_admin_address?: string; + /** + * ModulePaused is a safety toggle that allows to stop main module functions + * such as stake/unstake/stake-to-lp and the BeginBlocker logic. + */ + module_paused?: boolean; +} +export interface ParamsAminoMsg { + type: "/pstake.liquidstake.v1beta1.Params"; + value: ParamsAmino; +} +/** Params defines the set of params for the liquidstake module. */ +export interface ParamsSDKType { + liquid_bond_denom: string; + whitelisted_validators: WhitelistedValidatorSDKType[]; + unstake_fee_rate: string; + lsm_disabled: boolean; + min_liquid_stake_amount: string; + cw_locked_pool_address: string; + fee_account_address: string; + autocompound_fee_rate: string; + whitelist_admin_address: string; + module_paused: boolean; +} +/** + * WhitelistedValidator consists of the validator operator address and the + * target weight, which is a value for calculating the real weight to be derived + * according to the active status. + */ +export interface WhitelistedValidator { + /** + * validator_address defines the bech32-encoded address that whitelisted + * validator + */ + validatorAddress: string; + /** + * target_weight specifies the target weight for liquid staking, unstaking + * amount, which is a value for calculating the real weight to be derived + * according to the active status + */ + targetWeight: string; +} +export interface WhitelistedValidatorProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.WhitelistedValidator"; + value: Uint8Array; +} +/** + * WhitelistedValidator consists of the validator operator address and the + * target weight, which is a value for calculating the real weight to be derived + * according to the active status. + */ +export interface WhitelistedValidatorAmino { + /** + * validator_address defines the bech32-encoded address that whitelisted + * validator + */ + validator_address?: string; + /** + * target_weight specifies the target weight for liquid staking, unstaking + * amount, which is a value for calculating the real weight to be derived + * according to the active status + */ + target_weight?: string; +} +export interface WhitelistedValidatorAminoMsg { + type: "/pstake.liquidstake.v1beta1.WhitelistedValidator"; + value: WhitelistedValidatorAmino; +} +/** + * WhitelistedValidator consists of the validator operator address and the + * target weight, which is a value for calculating the real weight to be derived + * according to the active status. + */ +export interface WhitelistedValidatorSDKType { + validator_address: string; + target_weight: string; +} +/** + * LiquidValidator defines a Validator that can be the target of LiquidStaking + * and LiquidUnstaking, Active, Weight, etc. fields are derived as functions to + * deal with by maintaining consistency with the state of the staking module. + */ +export interface LiquidValidator { + /** + * operator_address defines the address of the validator's operator; bech + * encoded in JSON. + */ + operatorAddress: string; +} +export interface LiquidValidatorProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.LiquidValidator"; + value: Uint8Array; +} +/** + * LiquidValidator defines a Validator that can be the target of LiquidStaking + * and LiquidUnstaking, Active, Weight, etc. fields are derived as functions to + * deal with by maintaining consistency with the state of the staking module. + */ +export interface LiquidValidatorAmino { + /** + * operator_address defines the address of the validator's operator; bech + * encoded in JSON. + */ + operator_address?: string; +} +export interface LiquidValidatorAminoMsg { + type: "/pstake.liquidstake.v1beta1.LiquidValidator"; + value: LiquidValidatorAmino; +} +/** + * LiquidValidator defines a Validator that can be the target of LiquidStaking + * and LiquidUnstaking, Active, Weight, etc. fields are derived as functions to + * deal with by maintaining consistency with the state of the staking module. + */ +export interface LiquidValidatorSDKType { + operator_address: string; +} +/** + * LiquidValidatorState is type LiquidValidator with state added to return to + * query results. + */ +export interface LiquidValidatorState { + /** + * operator_address defines the address of the validator's operator; bech + * encoded in JSON. + */ + operatorAddress: string; + /** weight specifies the weight for liquid staking, unstaking amount */ + weight: string; + /** status is the liquid validator status */ + status: ValidatorStatus; + /** del_shares define the delegation shares of the validator */ + delShares: string; + /** + * liquid_tokens define the token amount worth of delegation shares of the + * validator (slashing applied amount) + */ + liquidTokens: string; +} +export interface LiquidValidatorStateProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.LiquidValidatorState"; + value: Uint8Array; +} +/** + * LiquidValidatorState is type LiquidValidator with state added to return to + * query results. + */ +export interface LiquidValidatorStateAmino { + /** + * operator_address defines the address of the validator's operator; bech + * encoded in JSON. + */ + operator_address?: string; + /** weight specifies the weight for liquid staking, unstaking amount */ + weight?: string; + /** status is the liquid validator status */ + status?: ValidatorStatus; + /** del_shares define the delegation shares of the validator */ + del_shares?: string; + /** + * liquid_tokens define the token amount worth of delegation shares of the + * validator (slashing applied amount) + */ + liquid_tokens?: string; +} +export interface LiquidValidatorStateAminoMsg { + type: "/pstake.liquidstake.v1beta1.LiquidValidatorState"; + value: LiquidValidatorStateAmino; +} +/** + * LiquidValidatorState is type LiquidValidator with state added to return to + * query results. + */ +export interface LiquidValidatorStateSDKType { + operator_address: string; + weight: string; + status: ValidatorStatus; + del_shares: string; + liquid_tokens: string; +} +/** + * NetAmountState is type for net amount raw data and mint rate, This is a value + * that depends on the several module state every time, so it is used only for + * calculation and query and is not stored in kv. + */ +export interface NetAmountState { + /** mint_rate is stkXPRTTotalSupply / NetAmount */ + mintRate: string; + /** btoken_total_supply returns the total supply of stk/uxprt (stkXPRT denom) */ + stkxprtTotalSupply: string; + /** + * net_amount is proxy account's native token balance + total liquid tokens + + * total remaining rewards + total unbonding balance + */ + netAmount: string; + /** total_del_shares define the delegation shares of all liquid validators */ + totalDelShares: string; + /** + * total_liquid_tokens define the token amount worth of delegation shares of + * all liquid validator (slashing applied amount) + */ + totalLiquidTokens: string; + /** + * total_remaining_rewards define the sum of remaining rewards of proxy + * account by all liquid validators + */ + totalRemainingRewards: string; + /** + * total_unbonding_balance define the unbonding balance of proxy account by + * all liquid validator (slashing applied amount) + */ + totalUnbondingBalance: string; + /** proxy_acc_balance define the balance of proxy account for the native token */ + proxyAccBalance: string; +} +export interface NetAmountStateProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.NetAmountState"; + value: Uint8Array; +} +/** + * NetAmountState is type for net amount raw data and mint rate, This is a value + * that depends on the several module state every time, so it is used only for + * calculation and query and is not stored in kv. + */ +export interface NetAmountStateAmino { + /** mint_rate is stkXPRTTotalSupply / NetAmount */ + mint_rate?: string; + /** btoken_total_supply returns the total supply of stk/uxprt (stkXPRT denom) */ + stkxprt_total_supply?: string; + /** + * net_amount is proxy account's native token balance + total liquid tokens + + * total remaining rewards + total unbonding balance + */ + net_amount?: string; + /** total_del_shares define the delegation shares of all liquid validators */ + total_del_shares?: string; + /** + * total_liquid_tokens define the token amount worth of delegation shares of + * all liquid validator (slashing applied amount) + */ + total_liquid_tokens?: string; + /** + * total_remaining_rewards define the sum of remaining rewards of proxy + * account by all liquid validators + */ + total_remaining_rewards?: string; + /** + * total_unbonding_balance define the unbonding balance of proxy account by + * all liquid validator (slashing applied amount) + */ + total_unbonding_balance?: string; + /** proxy_acc_balance define the balance of proxy account for the native token */ + proxy_acc_balance?: string; +} +export interface NetAmountStateAminoMsg { + type: "/pstake.liquidstake.v1beta1.NetAmountState"; + value: NetAmountStateAmino; +} +/** + * NetAmountState is type for net amount raw data and mint rate, This is a value + * that depends on the several module state every time, so it is used only for + * calculation and query and is not stored in kv. + */ +export interface NetAmountStateSDKType { + mint_rate: string; + stkxprt_total_supply: string; + net_amount: string; + total_del_shares: string; + total_liquid_tokens: string; + total_remaining_rewards: string; + total_unbonding_balance: string; + proxy_acc_balance: string; +} +function createBaseParams(): Params { + return { + liquidBondDenom: "", + whitelistedValidators: [], + unstakeFeeRate: "", + lsmDisabled: false, + minLiquidStakeAmount: "", + cwLockedPoolAddress: "", + feeAccountAddress: "", + autocompoundFeeRate: "", + whitelistAdminAddress: "", + modulePaused: false + }; +} +export const Params = { + typeUrl: "/pstake.liquidstake.v1beta1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.liquidBondDenom !== "") { + writer.uint32(10).string(message.liquidBondDenom); + } + for (const v of message.whitelistedValidators) { + WhitelistedValidator.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.unstakeFeeRate !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.unstakeFeeRate, 18).atomics); + } + if (message.lsmDisabled === true) { + writer.uint32(32).bool(message.lsmDisabled); + } + if (message.minLiquidStakeAmount !== "") { + writer.uint32(42).string(message.minLiquidStakeAmount); + } + if (message.cwLockedPoolAddress !== "") { + writer.uint32(50).string(message.cwLockedPoolAddress); + } + if (message.feeAccountAddress !== "") { + writer.uint32(58).string(message.feeAccountAddress); + } + if (message.autocompoundFeeRate !== "") { + writer.uint32(66).string(Decimal.fromUserInput(message.autocompoundFeeRate, 18).atomics); + } + if (message.whitelistAdminAddress !== "") { + writer.uint32(74).string(message.whitelistAdminAddress); + } + if (message.modulePaused === true) { + writer.uint32(80).bool(message.modulePaused); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.liquidBondDenom = reader.string(); + break; + case 2: + message.whitelistedValidators.push(WhitelistedValidator.decode(reader, reader.uint32(), useInterfaces)); + break; + case 3: + message.unstakeFeeRate = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 4: + message.lsmDisabled = reader.bool(); + break; + case 5: + message.minLiquidStakeAmount = reader.string(); + break; + case 6: + message.cwLockedPoolAddress = reader.string(); + break; + case 7: + message.feeAccountAddress = reader.string(); + break; + case 8: + message.autocompoundFeeRate = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 9: + message.whitelistAdminAddress = reader.string(); + break; + case 10: + message.modulePaused = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.liquidBondDenom = object.liquidBondDenom ?? ""; + message.whitelistedValidators = object.whitelistedValidators?.map(e => WhitelistedValidator.fromPartial(e)) || []; + message.unstakeFeeRate = object.unstakeFeeRate ?? ""; + message.lsmDisabled = object.lsmDisabled ?? false; + message.minLiquidStakeAmount = object.minLiquidStakeAmount ?? ""; + message.cwLockedPoolAddress = object.cwLockedPoolAddress ?? ""; + message.feeAccountAddress = object.feeAccountAddress ?? ""; + message.autocompoundFeeRate = object.autocompoundFeeRate ?? ""; + message.whitelistAdminAddress = object.whitelistAdminAddress ?? ""; + message.modulePaused = object.modulePaused ?? false; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.liquid_bond_denom !== undefined && object.liquid_bond_denom !== null) { + message.liquidBondDenom = object.liquid_bond_denom; + } + message.whitelistedValidators = object.whitelisted_validators?.map(e => WhitelistedValidator.fromAmino(e)) || []; + if (object.unstake_fee_rate !== undefined && object.unstake_fee_rate !== null) { + message.unstakeFeeRate = object.unstake_fee_rate; + } + if (object.lsm_disabled !== undefined && object.lsm_disabled !== null) { + message.lsmDisabled = object.lsm_disabled; + } + if (object.min_liquid_stake_amount !== undefined && object.min_liquid_stake_amount !== null) { + message.minLiquidStakeAmount = object.min_liquid_stake_amount; + } + if (object.cw_locked_pool_address !== undefined && object.cw_locked_pool_address !== null) { + message.cwLockedPoolAddress = object.cw_locked_pool_address; + } + if (object.fee_account_address !== undefined && object.fee_account_address !== null) { + message.feeAccountAddress = object.fee_account_address; + } + if (object.autocompound_fee_rate !== undefined && object.autocompound_fee_rate !== null) { + message.autocompoundFeeRate = object.autocompound_fee_rate; + } + if (object.whitelist_admin_address !== undefined && object.whitelist_admin_address !== null) { + message.whitelistAdminAddress = object.whitelist_admin_address; + } + if (object.module_paused !== undefined && object.module_paused !== null) { + message.modulePaused = object.module_paused; + } + return message; + }, + toAmino(message: Params, useInterfaces: boolean = false): ParamsAmino { + const obj: any = {}; + obj.liquid_bond_denom = message.liquidBondDenom; + if (message.whitelistedValidators) { + obj.whitelisted_validators = message.whitelistedValidators.map(e => e ? WhitelistedValidator.toAmino(e, useInterfaces) : undefined); + } else { + obj.whitelisted_validators = []; + } + obj.unstake_fee_rate = message.unstakeFeeRate; + obj.lsm_disabled = message.lsmDisabled; + obj.min_liquid_stake_amount = message.minLiquidStakeAmount; + obj.cw_locked_pool_address = message.cwLockedPoolAddress; + obj.fee_account_address = message.feeAccountAddress; + obj.autocompound_fee_rate = message.autocompoundFeeRate; + obj.whitelist_admin_address = message.whitelistAdminAddress; + obj.module_paused = message.modulePaused; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsProtoMsg, useInterfaces: boolean = false): Params { + return Params.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; +function createBaseWhitelistedValidator(): WhitelistedValidator { + return { + validatorAddress: "", + targetWeight: "" + }; +} +export const WhitelistedValidator = { + typeUrl: "/pstake.liquidstake.v1beta1.WhitelistedValidator", + encode(message: WhitelistedValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (message.targetWeight !== "") { + writer.uint32(18).string(message.targetWeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): WhitelistedValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseWhitelistedValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.targetWeight = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): WhitelistedValidator { + const message = createBaseWhitelistedValidator(); + message.validatorAddress = object.validatorAddress ?? ""; + message.targetWeight = object.targetWeight ?? ""; + return message; + }, + fromAmino(object: WhitelistedValidatorAmino): WhitelistedValidator { + const message = createBaseWhitelistedValidator(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.target_weight !== undefined && object.target_weight !== null) { + message.targetWeight = object.target_weight; + } + return message; + }, + toAmino(message: WhitelistedValidator, useInterfaces: boolean = false): WhitelistedValidatorAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress; + obj.target_weight = message.targetWeight; + return obj; + }, + fromAminoMsg(object: WhitelistedValidatorAminoMsg): WhitelistedValidator { + return WhitelistedValidator.fromAmino(object.value); + }, + fromProtoMsg(message: WhitelistedValidatorProtoMsg, useInterfaces: boolean = false): WhitelistedValidator { + return WhitelistedValidator.decode(message.value, undefined, useInterfaces); + }, + toProto(message: WhitelistedValidator): Uint8Array { + return WhitelistedValidator.encode(message).finish(); + }, + toProtoMsg(message: WhitelistedValidator): WhitelistedValidatorProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.WhitelistedValidator", + value: WhitelistedValidator.encode(message).finish() + }; + } +}; +function createBaseLiquidValidator(): LiquidValidator { + return { + operatorAddress: "" + }; +} +export const LiquidValidator = { + typeUrl: "/pstake.liquidstake.v1beta1.LiquidValidator", + encode(message: LiquidValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.operatorAddress !== "") { + writer.uint32(10).string(message.operatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): LiquidValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLiquidValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LiquidValidator { + const message = createBaseLiquidValidator(); + message.operatorAddress = object.operatorAddress ?? ""; + return message; + }, + fromAmino(object: LiquidValidatorAmino): LiquidValidator { + const message = createBaseLiquidValidator(); + if (object.operator_address !== undefined && object.operator_address !== null) { + message.operatorAddress = object.operator_address; + } + return message; + }, + toAmino(message: LiquidValidator, useInterfaces: boolean = false): LiquidValidatorAmino { + const obj: any = {}; + obj.operator_address = message.operatorAddress; + return obj; + }, + fromAminoMsg(object: LiquidValidatorAminoMsg): LiquidValidator { + return LiquidValidator.fromAmino(object.value); + }, + fromProtoMsg(message: LiquidValidatorProtoMsg, useInterfaces: boolean = false): LiquidValidator { + return LiquidValidator.decode(message.value, undefined, useInterfaces); + }, + toProto(message: LiquidValidator): Uint8Array { + return LiquidValidator.encode(message).finish(); + }, + toProtoMsg(message: LiquidValidator): LiquidValidatorProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.LiquidValidator", + value: LiquidValidator.encode(message).finish() + }; + } +}; +function createBaseLiquidValidatorState(): LiquidValidatorState { + return { + operatorAddress: "", + weight: "", + status: 0, + delShares: "", + liquidTokens: "" + }; +} +export const LiquidValidatorState = { + typeUrl: "/pstake.liquidstake.v1beta1.LiquidValidatorState", + encode(message: LiquidValidatorState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.operatorAddress !== "") { + writer.uint32(10).string(message.operatorAddress); + } + if (message.weight !== "") { + writer.uint32(18).string(message.weight); + } + if (message.status !== 0) { + writer.uint32(24).int32(message.status); + } + if (message.delShares !== "") { + writer.uint32(34).string(Decimal.fromUserInput(message.delShares, 18).atomics); + } + if (message.liquidTokens !== "") { + writer.uint32(42).string(message.liquidTokens); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): LiquidValidatorState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLiquidValidatorState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operatorAddress = reader.string(); + break; + case 2: + message.weight = reader.string(); + break; + case 3: + message.status = (reader.int32() as any); + break; + case 4: + message.delShares = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 5: + message.liquidTokens = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LiquidValidatorState { + const message = createBaseLiquidValidatorState(); + message.operatorAddress = object.operatorAddress ?? ""; + message.weight = object.weight ?? ""; + message.status = object.status ?? 0; + message.delShares = object.delShares ?? ""; + message.liquidTokens = object.liquidTokens ?? ""; + return message; + }, + fromAmino(object: LiquidValidatorStateAmino): LiquidValidatorState { + const message = createBaseLiquidValidatorState(); + if (object.operator_address !== undefined && object.operator_address !== null) { + message.operatorAddress = object.operator_address; + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + if (object.status !== undefined && object.status !== null) { + message.status = validatorStatusFromJSON(object.status); + } + if (object.del_shares !== undefined && object.del_shares !== null) { + message.delShares = object.del_shares; + } + if (object.liquid_tokens !== undefined && object.liquid_tokens !== null) { + message.liquidTokens = object.liquid_tokens; + } + return message; + }, + toAmino(message: LiquidValidatorState, useInterfaces: boolean = false): LiquidValidatorStateAmino { + const obj: any = {}; + obj.operator_address = message.operatorAddress; + obj.weight = message.weight; + obj.status = message.status; + obj.del_shares = message.delShares; + obj.liquid_tokens = message.liquidTokens; + return obj; + }, + fromAminoMsg(object: LiquidValidatorStateAminoMsg): LiquidValidatorState { + return LiquidValidatorState.fromAmino(object.value); + }, + fromProtoMsg(message: LiquidValidatorStateProtoMsg, useInterfaces: boolean = false): LiquidValidatorState { + return LiquidValidatorState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: LiquidValidatorState): Uint8Array { + return LiquidValidatorState.encode(message).finish(); + }, + toProtoMsg(message: LiquidValidatorState): LiquidValidatorStateProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.LiquidValidatorState", + value: LiquidValidatorState.encode(message).finish() + }; + } +}; +function createBaseNetAmountState(): NetAmountState { + return { + mintRate: "", + stkxprtTotalSupply: "", + netAmount: "", + totalDelShares: "", + totalLiquidTokens: "", + totalRemainingRewards: "", + totalUnbondingBalance: "", + proxyAccBalance: "" + }; +} +export const NetAmountState = { + typeUrl: "/pstake.liquidstake.v1beta1.NetAmountState", + encode(message: NetAmountState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.mintRate !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.mintRate, 18).atomics); + } + if (message.stkxprtTotalSupply !== "") { + writer.uint32(18).string(message.stkxprtTotalSupply); + } + if (message.netAmount !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.netAmount, 18).atomics); + } + if (message.totalDelShares !== "") { + writer.uint32(34).string(Decimal.fromUserInput(message.totalDelShares, 18).atomics); + } + if (message.totalLiquidTokens !== "") { + writer.uint32(42).string(message.totalLiquidTokens); + } + if (message.totalRemainingRewards !== "") { + writer.uint32(50).string(Decimal.fromUserInput(message.totalRemainingRewards, 18).atomics); + } + if (message.totalUnbondingBalance !== "") { + writer.uint32(58).string(message.totalUnbondingBalance); + } + if (message.proxyAccBalance !== "") { + writer.uint32(66).string(message.proxyAccBalance); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): NetAmountState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNetAmountState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mintRate = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 2: + message.stkxprtTotalSupply = reader.string(); + break; + case 3: + message.netAmount = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 4: + message.totalDelShares = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 5: + message.totalLiquidTokens = reader.string(); + break; + case 6: + message.totalRemainingRewards = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 7: + message.totalUnbondingBalance = reader.string(); + break; + case 8: + message.proxyAccBalance = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): NetAmountState { + const message = createBaseNetAmountState(); + message.mintRate = object.mintRate ?? ""; + message.stkxprtTotalSupply = object.stkxprtTotalSupply ?? ""; + message.netAmount = object.netAmount ?? ""; + message.totalDelShares = object.totalDelShares ?? ""; + message.totalLiquidTokens = object.totalLiquidTokens ?? ""; + message.totalRemainingRewards = object.totalRemainingRewards ?? ""; + message.totalUnbondingBalance = object.totalUnbondingBalance ?? ""; + message.proxyAccBalance = object.proxyAccBalance ?? ""; + return message; + }, + fromAmino(object: NetAmountStateAmino): NetAmountState { + const message = createBaseNetAmountState(); + if (object.mint_rate !== undefined && object.mint_rate !== null) { + message.mintRate = object.mint_rate; + } + if (object.stkxprt_total_supply !== undefined && object.stkxprt_total_supply !== null) { + message.stkxprtTotalSupply = object.stkxprt_total_supply; + } + if (object.net_amount !== undefined && object.net_amount !== null) { + message.netAmount = object.net_amount; + } + if (object.total_del_shares !== undefined && object.total_del_shares !== null) { + message.totalDelShares = object.total_del_shares; + } + if (object.total_liquid_tokens !== undefined && object.total_liquid_tokens !== null) { + message.totalLiquidTokens = object.total_liquid_tokens; + } + if (object.total_remaining_rewards !== undefined && object.total_remaining_rewards !== null) { + message.totalRemainingRewards = object.total_remaining_rewards; + } + if (object.total_unbonding_balance !== undefined && object.total_unbonding_balance !== null) { + message.totalUnbondingBalance = object.total_unbonding_balance; + } + if (object.proxy_acc_balance !== undefined && object.proxy_acc_balance !== null) { + message.proxyAccBalance = object.proxy_acc_balance; + } + return message; + }, + toAmino(message: NetAmountState, useInterfaces: boolean = false): NetAmountStateAmino { + const obj: any = {}; + obj.mint_rate = message.mintRate; + obj.stkxprt_total_supply = message.stkxprtTotalSupply; + obj.net_amount = message.netAmount; + obj.total_del_shares = message.totalDelShares; + obj.total_liquid_tokens = message.totalLiquidTokens; + obj.total_remaining_rewards = message.totalRemainingRewards; + obj.total_unbonding_balance = message.totalUnbondingBalance; + obj.proxy_acc_balance = message.proxyAccBalance; + return obj; + }, + fromAminoMsg(object: NetAmountStateAminoMsg): NetAmountState { + return NetAmountState.fromAmino(object.value); + }, + fromProtoMsg(message: NetAmountStateProtoMsg, useInterfaces: boolean = false): NetAmountState { + return NetAmountState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: NetAmountState): Uint8Array { + return NetAmountState.encode(message).finish(); + }, + toProtoMsg(message: NetAmountState): NetAmountStateProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.NetAmountState", + value: NetAmountState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/query.rpc.Query.ts new file mode 100644 index 000000000..d970f5653 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/query.rpc.Query.ts @@ -0,0 +1,55 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryParamsRequest, QueryParamsResponse, QueryLiquidValidatorsRequest, QueryLiquidValidatorsResponse, QueryStatesRequest, QueryStatesResponse } from "./query"; +/** Query defines the gRPC query service for the liquidstake module. */ +export interface Query { + /** Params returns parameters of the liquidstake module. */ + params(request?: QueryParamsRequest): Promise; + /** + * LiquidValidators returns liquid validators with states of the liquidstake + * module. + */ + liquidValidators(request?: QueryLiquidValidatorsRequest): Promise; + /** States returns states of the liquidstake module. */ + states(request?: QueryStatesRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + this.liquidValidators = this.liquidValidators.bind(this); + this.states = this.states.bind(this); + } + params(request: QueryParamsRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstake.v1beta1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + liquidValidators(request: QueryLiquidValidatorsRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryLiquidValidatorsRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstake.v1beta1.Query", "LiquidValidators", data); + return promise.then(data => QueryLiquidValidatorsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + states(request: QueryStatesRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryStatesRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstake.v1beta1.Query", "States", data); + return promise.then(data => QueryStatesResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest, useInterfaces: boolean = true): Promise { + return queryService.params(request, useInterfaces); + }, + liquidValidators(request?: QueryLiquidValidatorsRequest, useInterfaces: boolean = true): Promise { + return queryService.liquidValidators(request, useInterfaces); + }, + states(request?: QueryStatesRequest, useInterfaces: boolean = true): Promise { + return queryService.states(request, useInterfaces); + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/query.ts b/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/query.ts new file mode 100644 index 000000000..727d7dfe7 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/query.ts @@ -0,0 +1,464 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType, LiquidValidatorState, LiquidValidatorStateAmino, LiquidValidatorStateSDKType, NetAmountState, NetAmountStateAmino, NetAmountStateSDKType } from "./liquidstake"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/pstake.liquidstake.v1beta1.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + params: Params | undefined; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + params?: ParamsAmino | undefined; +} +export interface QueryParamsResponseAminoMsg { + type: "/pstake.liquidstake.v1beta1.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType | undefined; +} +/** + * QueryLiquidValidatorsRequest is the request type for the + * Query/LiquidValidators RPC method. + */ +export interface QueryLiquidValidatorsRequest {} +export interface QueryLiquidValidatorsRequestProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.QueryLiquidValidatorsRequest"; + value: Uint8Array; +} +/** + * QueryLiquidValidatorsRequest is the request type for the + * Query/LiquidValidators RPC method. + */ +export interface QueryLiquidValidatorsRequestAmino {} +export interface QueryLiquidValidatorsRequestAminoMsg { + type: "/pstake.liquidstake.v1beta1.QueryLiquidValidatorsRequest"; + value: QueryLiquidValidatorsRequestAmino; +} +/** + * QueryLiquidValidatorsRequest is the request type for the + * Query/LiquidValidators RPC method. + */ +export interface QueryLiquidValidatorsRequestSDKType {} +/** + * QueryLiquidValidatorsResponse is the response type for the + * Query/LiquidValidators RPC method. + */ +export interface QueryLiquidValidatorsResponse { + liquidValidators: LiquidValidatorState[]; +} +export interface QueryLiquidValidatorsResponseProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.QueryLiquidValidatorsResponse"; + value: Uint8Array; +} +/** + * QueryLiquidValidatorsResponse is the response type for the + * Query/LiquidValidators RPC method. + */ +export interface QueryLiquidValidatorsResponseAmino { + liquid_validators?: LiquidValidatorStateAmino[]; +} +export interface QueryLiquidValidatorsResponseAminoMsg { + type: "/pstake.liquidstake.v1beta1.QueryLiquidValidatorsResponse"; + value: QueryLiquidValidatorsResponseAmino; +} +/** + * QueryLiquidValidatorsResponse is the response type for the + * Query/LiquidValidators RPC method. + */ +export interface QueryLiquidValidatorsResponseSDKType { + liquid_validators: LiquidValidatorStateSDKType[]; +} +/** QueryStatesRequest is the request type for the Query/States RPC method. */ +export interface QueryStatesRequest {} +export interface QueryStatesRequestProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.QueryStatesRequest"; + value: Uint8Array; +} +/** QueryStatesRequest is the request type for the Query/States RPC method. */ +export interface QueryStatesRequestAmino {} +export interface QueryStatesRequestAminoMsg { + type: "/pstake.liquidstake.v1beta1.QueryStatesRequest"; + value: QueryStatesRequestAmino; +} +/** QueryStatesRequest is the request type for the Query/States RPC method. */ +export interface QueryStatesRequestSDKType {} +/** QueryStatesResponse is the response type for the Query/States RPC method. */ +export interface QueryStatesResponse { + netAmountState: NetAmountState | undefined; +} +export interface QueryStatesResponseProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.QueryStatesResponse"; + value: Uint8Array; +} +/** QueryStatesResponse is the response type for the Query/States RPC method. */ +export interface QueryStatesResponseAmino { + net_amount_state?: NetAmountStateAmino | undefined; +} +export interface QueryStatesResponseAminoMsg { + type: "/pstake.liquidstake.v1beta1.QueryStatesResponse"; + value: QueryStatesResponseAmino; +} +/** QueryStatesResponse is the response type for the Query/States RPC method. */ +export interface QueryStatesResponseSDKType { + net_amount_state: NetAmountStateSDKType | undefined; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/pstake.liquidstake.v1beta1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest, useInterfaces: boolean = false): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg, useInterfaces: boolean = false): QueryParamsRequest { + return QueryParamsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/pstake.liquidstake.v1beta1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse, useInterfaces: boolean = false): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg, useInterfaces: boolean = false): QueryParamsResponse { + return QueryParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryLiquidValidatorsRequest(): QueryLiquidValidatorsRequest { + return {}; +} +export const QueryLiquidValidatorsRequest = { + typeUrl: "/pstake.liquidstake.v1beta1.QueryLiquidValidatorsRequest", + encode(_: QueryLiquidValidatorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryLiquidValidatorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLiquidValidatorsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryLiquidValidatorsRequest { + const message = createBaseQueryLiquidValidatorsRequest(); + return message; + }, + fromAmino(_: QueryLiquidValidatorsRequestAmino): QueryLiquidValidatorsRequest { + const message = createBaseQueryLiquidValidatorsRequest(); + return message; + }, + toAmino(_: QueryLiquidValidatorsRequest, useInterfaces: boolean = false): QueryLiquidValidatorsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryLiquidValidatorsRequestAminoMsg): QueryLiquidValidatorsRequest { + return QueryLiquidValidatorsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLiquidValidatorsRequestProtoMsg, useInterfaces: boolean = false): QueryLiquidValidatorsRequest { + return QueryLiquidValidatorsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryLiquidValidatorsRequest): Uint8Array { + return QueryLiquidValidatorsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryLiquidValidatorsRequest): QueryLiquidValidatorsRequestProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.QueryLiquidValidatorsRequest", + value: QueryLiquidValidatorsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryLiquidValidatorsResponse(): QueryLiquidValidatorsResponse { + return { + liquidValidators: [] + }; +} +export const QueryLiquidValidatorsResponse = { + typeUrl: "/pstake.liquidstake.v1beta1.QueryLiquidValidatorsResponse", + encode(message: QueryLiquidValidatorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.liquidValidators) { + LiquidValidatorState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryLiquidValidatorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLiquidValidatorsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.liquidValidators.push(LiquidValidatorState.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryLiquidValidatorsResponse { + const message = createBaseQueryLiquidValidatorsResponse(); + message.liquidValidators = object.liquidValidators?.map(e => LiquidValidatorState.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryLiquidValidatorsResponseAmino): QueryLiquidValidatorsResponse { + const message = createBaseQueryLiquidValidatorsResponse(); + message.liquidValidators = object.liquid_validators?.map(e => LiquidValidatorState.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryLiquidValidatorsResponse, useInterfaces: boolean = false): QueryLiquidValidatorsResponseAmino { + const obj: any = {}; + if (message.liquidValidators) { + obj.liquid_validators = message.liquidValidators.map(e => e ? LiquidValidatorState.toAmino(e, useInterfaces) : undefined); + } else { + obj.liquid_validators = []; + } + return obj; + }, + fromAminoMsg(object: QueryLiquidValidatorsResponseAminoMsg): QueryLiquidValidatorsResponse { + return QueryLiquidValidatorsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLiquidValidatorsResponseProtoMsg, useInterfaces: boolean = false): QueryLiquidValidatorsResponse { + return QueryLiquidValidatorsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryLiquidValidatorsResponse): Uint8Array { + return QueryLiquidValidatorsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryLiquidValidatorsResponse): QueryLiquidValidatorsResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.QueryLiquidValidatorsResponse", + value: QueryLiquidValidatorsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryStatesRequest(): QueryStatesRequest { + return {}; +} +export const QueryStatesRequest = { + typeUrl: "/pstake.liquidstake.v1beta1.QueryStatesRequest", + encode(_: QueryStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryStatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryStatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryStatesRequest { + const message = createBaseQueryStatesRequest(); + return message; + }, + fromAmino(_: QueryStatesRequestAmino): QueryStatesRequest { + const message = createBaseQueryStatesRequest(); + return message; + }, + toAmino(_: QueryStatesRequest, useInterfaces: boolean = false): QueryStatesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryStatesRequestAminoMsg): QueryStatesRequest { + return QueryStatesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryStatesRequestProtoMsg, useInterfaces: boolean = false): QueryStatesRequest { + return QueryStatesRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryStatesRequest): Uint8Array { + return QueryStatesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryStatesRequest): QueryStatesRequestProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.QueryStatesRequest", + value: QueryStatesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryStatesResponse(): QueryStatesResponse { + return { + netAmountState: NetAmountState.fromPartial({}) + }; +} +export const QueryStatesResponse = { + typeUrl: "/pstake.liquidstake.v1beta1.QueryStatesResponse", + encode(message: QueryStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.netAmountState !== undefined) { + NetAmountState.encode(message.netAmountState, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryStatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryStatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.netAmountState = NetAmountState.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryStatesResponse { + const message = createBaseQueryStatesResponse(); + message.netAmountState = object.netAmountState !== undefined && object.netAmountState !== null ? NetAmountState.fromPartial(object.netAmountState) : undefined; + return message; + }, + fromAmino(object: QueryStatesResponseAmino): QueryStatesResponse { + const message = createBaseQueryStatesResponse(); + if (object.net_amount_state !== undefined && object.net_amount_state !== null) { + message.netAmountState = NetAmountState.fromAmino(object.net_amount_state); + } + return message; + }, + toAmino(message: QueryStatesResponse, useInterfaces: boolean = false): QueryStatesResponseAmino { + const obj: any = {}; + obj.net_amount_state = message.netAmountState ? NetAmountState.toAmino(message.netAmountState, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryStatesResponseAminoMsg): QueryStatesResponse { + return QueryStatesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryStatesResponseProtoMsg, useInterfaces: boolean = false): QueryStatesResponse { + return QueryStatesResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryStatesResponse): Uint8Array { + return QueryStatesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryStatesResponse): QueryStatesResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.QueryStatesResponse", + value: QueryStatesResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/tx.amino.ts new file mode 100644 index 000000000..c81ceebe9 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/tx.amino.ts @@ -0,0 +1,33 @@ +import { MsgLiquidStake, MsgLiquidUnstake, MsgStakeToLP, MsgUpdateParams, MsgUpdateWhitelistedValidators, MsgSetModulePaused } from "./tx"; +export const AminoConverter = { + "/pstake.liquidstake.v1beta1.MsgLiquidStake": { + aminoType: "/pstake.liquidstake.v1beta1.MsgLiquidStake", + toAmino: MsgLiquidStake.toAmino, + fromAmino: MsgLiquidStake.fromAmino + }, + "/pstake.liquidstake.v1beta1.MsgLiquidUnstake": { + aminoType: "/pstake.liquidstake.v1beta1.MsgLiquidUnstake", + toAmino: MsgLiquidUnstake.toAmino, + fromAmino: MsgLiquidUnstake.fromAmino + }, + "/pstake.liquidstake.v1beta1.MsgStakeToLP": { + aminoType: "/pstake.liquidstake.v1beta1.MsgStakeToLP", + toAmino: MsgStakeToLP.toAmino, + fromAmino: MsgStakeToLP.fromAmino + }, + "/pstake.liquidstake.v1beta1.MsgUpdateParams": { + aminoType: "/pstake.liquidstake.v1beta1.MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + }, + "/pstake.liquidstake.v1beta1.MsgUpdateWhitelistedValidators": { + aminoType: "/pstake.liquidstake.v1beta1.MsgUpdateWhitelistedValidators", + toAmino: MsgUpdateWhitelistedValidators.toAmino, + fromAmino: MsgUpdateWhitelistedValidators.fromAmino + }, + "/pstake.liquidstake.v1beta1.MsgSetModulePaused": { + aminoType: "/pstake.liquidstake.v1beta1.MsgSetModulePaused", + toAmino: MsgSetModulePaused.toAmino, + fromAmino: MsgSetModulePaused.fromAmino + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/tx.registry.ts new file mode 100644 index 000000000..82b8dbc57 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/tx.registry.ts @@ -0,0 +1,125 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgLiquidStake, MsgLiquidUnstake, MsgStakeToLP, MsgUpdateParams, MsgUpdateWhitelistedValidators, MsgSetModulePaused } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/pstake.liquidstake.v1beta1.MsgLiquidStake", MsgLiquidStake], ["/pstake.liquidstake.v1beta1.MsgLiquidUnstake", MsgLiquidUnstake], ["/pstake.liquidstake.v1beta1.MsgStakeToLP", MsgStakeToLP], ["/pstake.liquidstake.v1beta1.MsgUpdateParams", MsgUpdateParams], ["/pstake.liquidstake.v1beta1.MsgUpdateWhitelistedValidators", MsgUpdateWhitelistedValidators], ["/pstake.liquidstake.v1beta1.MsgSetModulePaused", MsgSetModulePaused]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + liquidStake(value: MsgLiquidStake) { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgLiquidStake", + value: MsgLiquidStake.encode(value).finish() + }; + }, + liquidUnstake(value: MsgLiquidUnstake) { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgLiquidUnstake", + value: MsgLiquidUnstake.encode(value).finish() + }; + }, + stakeToLP(value: MsgStakeToLP) { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgStakeToLP", + value: MsgStakeToLP.encode(value).finish() + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + }, + updateWhitelistedValidators(value: MsgUpdateWhitelistedValidators) { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgUpdateWhitelistedValidators", + value: MsgUpdateWhitelistedValidators.encode(value).finish() + }; + }, + setModulePaused(value: MsgSetModulePaused) { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgSetModulePaused", + value: MsgSetModulePaused.encode(value).finish() + }; + } + }, + withTypeUrl: { + liquidStake(value: MsgLiquidStake) { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgLiquidStake", + value + }; + }, + liquidUnstake(value: MsgLiquidUnstake) { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgLiquidUnstake", + value + }; + }, + stakeToLP(value: MsgStakeToLP) { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgStakeToLP", + value + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgUpdateParams", + value + }; + }, + updateWhitelistedValidators(value: MsgUpdateWhitelistedValidators) { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgUpdateWhitelistedValidators", + value + }; + }, + setModulePaused(value: MsgSetModulePaused) { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgSetModulePaused", + value + }; + } + }, + fromPartial: { + liquidStake(value: MsgLiquidStake) { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgLiquidStake", + value: MsgLiquidStake.fromPartial(value) + }; + }, + liquidUnstake(value: MsgLiquidUnstake) { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgLiquidUnstake", + value: MsgLiquidUnstake.fromPartial(value) + }; + }, + stakeToLP(value: MsgStakeToLP) { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgStakeToLP", + value: MsgStakeToLP.fromPartial(value) + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + }, + updateWhitelistedValidators(value: MsgUpdateWhitelistedValidators) { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgUpdateWhitelistedValidators", + value: MsgUpdateWhitelistedValidators.fromPartial(value) + }; + }, + setModulePaused(value: MsgSetModulePaused) { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgSetModulePaused", + value: MsgSetModulePaused.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/tx.rpc.msg.ts new file mode 100644 index 000000000..e091564cf --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,75 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgLiquidStake, MsgLiquidStakeResponse, MsgLiquidUnstake, MsgLiquidUnstakeResponse, MsgStakeToLP, MsgStakeToLPResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgUpdateWhitelistedValidators, MsgUpdateWhitelistedValidatorsResponse, MsgSetModulePaused, MsgSetModulePausedResponse } from "./tx"; +/** Msg defines the liquid staking Msg service. */ +export interface Msg { + /** + * LiquidStake defines a method for performing a delegation of coins + * from a delegator to whitelisted validators. + */ + liquidStake(request: MsgLiquidStake): Promise; + /** + * LiquidUnstake defines a method for performing an undelegation of liquid + * staking from a delegate. + */ + liquidUnstake(request: MsgLiquidUnstake): Promise; + /** + * StakeToLP defines a method for LSM-transfer of staked XPRT + * into stkXPRT with locking into an LP. + */ + stakeToLP(request: MsgStakeToLP): Promise; + /** UpdateParams defines a method to update the module params. */ + updateParams(request: MsgUpdateParams): Promise; + /** + * UpdateWhitelistedValidators defines a method to update the whitelisted + * validators list. + */ + updateWhitelistedValidators(request: MsgUpdateWhitelistedValidators): Promise; + /** + * SetModulePaused defines a method to update the module's pause status, + * setting value of the safety flag in params. + */ + setModulePaused(request: MsgSetModulePaused): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.liquidStake = this.liquidStake.bind(this); + this.liquidUnstake = this.liquidUnstake.bind(this); + this.stakeToLP = this.stakeToLP.bind(this); + this.updateParams = this.updateParams.bind(this); + this.updateWhitelistedValidators = this.updateWhitelistedValidators.bind(this); + this.setModulePaused = this.setModulePaused.bind(this); + } + liquidStake(request: MsgLiquidStake, useInterfaces: boolean = true): Promise { + const data = MsgLiquidStake.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstake.v1beta1.Msg", "LiquidStake", data); + return promise.then(data => MsgLiquidStakeResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + liquidUnstake(request: MsgLiquidUnstake, useInterfaces: boolean = true): Promise { + const data = MsgLiquidUnstake.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstake.v1beta1.Msg", "LiquidUnstake", data); + return promise.then(data => MsgLiquidUnstakeResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + stakeToLP(request: MsgStakeToLP, useInterfaces: boolean = true): Promise { + const data = MsgStakeToLP.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstake.v1beta1.Msg", "StakeToLP", data); + return promise.then(data => MsgStakeToLPResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + updateParams(request: MsgUpdateParams, useInterfaces: boolean = true): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstake.v1beta1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + updateWhitelistedValidators(request: MsgUpdateWhitelistedValidators, useInterfaces: boolean = true): Promise { + const data = MsgUpdateWhitelistedValidators.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstake.v1beta1.Msg", "UpdateWhitelistedValidators", data); + return promise.then(data => MsgUpdateWhitelistedValidatorsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + setModulePaused(request: MsgSetModulePaused, useInterfaces: boolean = true): Promise { + const data = MsgSetModulePaused.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstake.v1beta1.Msg", "SetModulePaused", data); + return promise.then(data => MsgSetModulePausedResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/tx.ts b/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/tx.ts new file mode 100644 index 000000000..a910fccf8 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/liquidstake/v1beta1/tx.ts @@ -0,0 +1,1109 @@ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Params, ParamsAmino, ParamsSDKType, WhitelistedValidator, WhitelistedValidatorAmino, WhitelistedValidatorSDKType } from "./liquidstake"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +/** + * MsgLiquidStake defines a SDK message for performing a liquid stake of coins + * from a delegator to whitelisted validators. + */ +export interface MsgLiquidStake { + delegatorAddress: string; + amount: Coin | undefined; +} +export interface MsgLiquidStakeProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.MsgLiquidStake"; + value: Uint8Array; +} +/** + * MsgLiquidStake defines a SDK message for performing a liquid stake of coins + * from a delegator to whitelisted validators. + */ +export interface MsgLiquidStakeAmino { + delegator_address?: string; + amount?: CoinAmino | undefined; +} +export interface MsgLiquidStakeAminoMsg { + type: "/pstake.liquidstake.v1beta1.MsgLiquidStake"; + value: MsgLiquidStakeAmino; +} +/** + * MsgLiquidStake defines a SDK message for performing a liquid stake of coins + * from a delegator to whitelisted validators. + */ +export interface MsgLiquidStakeSDKType { + delegator_address: string; + amount: CoinSDKType | undefined; +} +/** MsgLiquidStakeResponse defines the MsgLiquidStake response type. */ +export interface MsgLiquidStakeResponse {} +export interface MsgLiquidStakeResponseProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.MsgLiquidStakeResponse"; + value: Uint8Array; +} +/** MsgLiquidStakeResponse defines the MsgLiquidStake response type. */ +export interface MsgLiquidStakeResponseAmino {} +export interface MsgLiquidStakeResponseAminoMsg { + type: "/pstake.liquidstake.v1beta1.MsgLiquidStakeResponse"; + value: MsgLiquidStakeResponseAmino; +} +/** MsgLiquidStakeResponse defines the MsgLiquidStake response type. */ +export interface MsgLiquidStakeResponseSDKType {} +/** + * MsgStakeToLP defines a SDK message for performing an LSM-transfer of staked + * XPRT into stkXPRT with locking into an LP. + */ +export interface MsgStakeToLP { + delegatorAddress: string; + validatorAddress: string; + stakedAmount: Coin | undefined; + liquidAmount: Coin | undefined; +} +export interface MsgStakeToLPProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.MsgStakeToLP"; + value: Uint8Array; +} +/** + * MsgStakeToLP defines a SDK message for performing an LSM-transfer of staked + * XPRT into stkXPRT with locking into an LP. + */ +export interface MsgStakeToLPAmino { + delegator_address?: string; + validator_address?: string; + staked_amount?: CoinAmino | undefined; + liquid_amount?: CoinAmino | undefined; +} +export interface MsgStakeToLPAminoMsg { + type: "/pstake.liquidstake.v1beta1.MsgStakeToLP"; + value: MsgStakeToLPAmino; +} +/** + * MsgStakeToLP defines a SDK message for performing an LSM-transfer of staked + * XPRT into stkXPRT with locking into an LP. + */ +export interface MsgStakeToLPSDKType { + delegator_address: string; + validator_address: string; + staked_amount: CoinSDKType | undefined; + liquid_amount: CoinSDKType | undefined; +} +/** MsgStakeToLPResponse defines the MsgStakeToLP response type. */ +export interface MsgStakeToLPResponse {} +export interface MsgStakeToLPResponseProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.MsgStakeToLPResponse"; + value: Uint8Array; +} +/** MsgStakeToLPResponse defines the MsgStakeToLP response type. */ +export interface MsgStakeToLPResponseAmino {} +export interface MsgStakeToLPResponseAminoMsg { + type: "/pstake.liquidstake.v1beta1.MsgStakeToLPResponse"; + value: MsgStakeToLPResponseAmino; +} +/** MsgStakeToLPResponse defines the MsgStakeToLP response type. */ +export interface MsgStakeToLPResponseSDKType {} +/** + * MsgLiquidUnstake defines a SDK message for performing an undelegation of + * liquid staking from a delegate. + */ +export interface MsgLiquidUnstake { + delegatorAddress: string; + amount: Coin | undefined; +} +export interface MsgLiquidUnstakeProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.MsgLiquidUnstake"; + value: Uint8Array; +} +/** + * MsgLiquidUnstake defines a SDK message for performing an undelegation of + * liquid staking from a delegate. + */ +export interface MsgLiquidUnstakeAmino { + delegator_address?: string; + amount?: CoinAmino | undefined; +} +export interface MsgLiquidUnstakeAminoMsg { + type: "/pstake.liquidstake.v1beta1.MsgLiquidUnstake"; + value: MsgLiquidUnstakeAmino; +} +/** + * MsgLiquidUnstake defines a SDK message for performing an undelegation of + * liquid staking from a delegate. + */ +export interface MsgLiquidUnstakeSDKType { + delegator_address: string; + amount: CoinSDKType | undefined; +} +/** MsgLiquidUnstakeResponse defines the MsgLiquidUnstake response type. */ +export interface MsgLiquidUnstakeResponse { + completionTime: Date | undefined; +} +export interface MsgLiquidUnstakeResponseProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.MsgLiquidUnstakeResponse"; + value: Uint8Array; +} +/** MsgLiquidUnstakeResponse defines the MsgLiquidUnstake response type. */ +export interface MsgLiquidUnstakeResponseAmino { + completion_time?: string | undefined; +} +export interface MsgLiquidUnstakeResponseAminoMsg { + type: "/pstake.liquidstake.v1beta1.MsgLiquidUnstakeResponse"; + value: MsgLiquidUnstakeResponseAmino; +} +/** MsgLiquidUnstakeResponse defines the MsgLiquidUnstake response type. */ +export interface MsgLiquidUnstakeResponseSDKType { + completion_time: Date | undefined; +} +export interface MsgUpdateParams { + /** + * authority is the address that controls the module (defaults to x/gov unless + * overwritten). + */ + authority: string; + /** + * params defines the parameters to update. + * + * NOTE: denom and whitelisted validators are not updated. + */ + params: Params | undefined; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +export interface MsgUpdateParamsAmino { + /** + * authority is the address that controls the module (defaults to x/gov unless + * overwritten). + */ + authority?: string; + /** + * params defines the parameters to update. + * + * NOTE: denom and whitelisted validators are not updated. + */ + params?: ParamsAmino | undefined; +} +export interface MsgUpdateParamsAminoMsg { + type: "/pstake.liquidstake.v1beta1.MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType | undefined; +} +/** MsgUpdateParamsResponse defines the response structure for executing a */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse defines the response structure for executing a */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/pstake.liquidstake.v1beta1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgUpdateParamsResponse defines the response structure for executing a */ +export interface MsgUpdateParamsResponseSDKType {} +export interface MsgUpdateWhitelistedValidators { + /** + * Authority is the address that is allowed to update whitelisted validators, + * defined as admin address in params (WhitelistAdminAddress). + */ + authority: string; + /** + * WhitelistedValidators specifies the validators elected to become Active + * Liquid Validators. + */ + whitelistedValidators: WhitelistedValidator[]; +} +export interface MsgUpdateWhitelistedValidatorsProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.MsgUpdateWhitelistedValidators"; + value: Uint8Array; +} +export interface MsgUpdateWhitelistedValidatorsAmino { + /** + * Authority is the address that is allowed to update whitelisted validators, + * defined as admin address in params (WhitelistAdminAddress). + */ + authority?: string; + /** + * WhitelistedValidators specifies the validators elected to become Active + * Liquid Validators. + */ + whitelisted_validators?: WhitelistedValidatorAmino[]; +} +export interface MsgUpdateWhitelistedValidatorsAminoMsg { + type: "/pstake.liquidstake.v1beta1.MsgUpdateWhitelistedValidators"; + value: MsgUpdateWhitelistedValidatorsAmino; +} +export interface MsgUpdateWhitelistedValidatorsSDKType { + authority: string; + whitelisted_validators: WhitelistedValidatorSDKType[]; +} +/** + * MsgUpdateWhitelistedValidatorsResponse defines the response structure for + * executing a + */ +export interface MsgUpdateWhitelistedValidatorsResponse {} +export interface MsgUpdateWhitelistedValidatorsResponseProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.MsgUpdateWhitelistedValidatorsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateWhitelistedValidatorsResponse defines the response structure for + * executing a + */ +export interface MsgUpdateWhitelistedValidatorsResponseAmino {} +export interface MsgUpdateWhitelistedValidatorsResponseAminoMsg { + type: "/pstake.liquidstake.v1beta1.MsgUpdateWhitelistedValidatorsResponse"; + value: MsgUpdateWhitelistedValidatorsResponseAmino; +} +/** + * MsgUpdateWhitelistedValidatorsResponse defines the response structure for + * executing a + */ +export interface MsgUpdateWhitelistedValidatorsResponseSDKType {} +export interface MsgSetModulePaused { + /** + * Authority is the address that is allowed to update module's paused state, + * defined as admin address in params (WhitelistAdminAddress). + */ + authority: string; + /** IsPaused represents the target state of the paused flag. */ + isPaused: boolean; +} +export interface MsgSetModulePausedProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.MsgSetModulePaused"; + value: Uint8Array; +} +export interface MsgSetModulePausedAmino { + /** + * Authority is the address that is allowed to update module's paused state, + * defined as admin address in params (WhitelistAdminAddress). + */ + authority?: string; + /** IsPaused represents the target state of the paused flag. */ + is_paused?: boolean; +} +export interface MsgSetModulePausedAminoMsg { + type: "/pstake.liquidstake.v1beta1.MsgSetModulePaused"; + value: MsgSetModulePausedAmino; +} +export interface MsgSetModulePausedSDKType { + authority: string; + is_paused: boolean; +} +/** + * MsgSetModulePausedResponse defines the response structure for + * executing a + */ +export interface MsgSetModulePausedResponse {} +export interface MsgSetModulePausedResponseProtoMsg { + typeUrl: "/pstake.liquidstake.v1beta1.MsgSetModulePausedResponse"; + value: Uint8Array; +} +/** + * MsgSetModulePausedResponse defines the response structure for + * executing a + */ +export interface MsgSetModulePausedResponseAmino {} +export interface MsgSetModulePausedResponseAminoMsg { + type: "/pstake.liquidstake.v1beta1.MsgSetModulePausedResponse"; + value: MsgSetModulePausedResponseAmino; +} +/** + * MsgSetModulePausedResponse defines the response structure for + * executing a + */ +export interface MsgSetModulePausedResponseSDKType {} +function createBaseMsgLiquidStake(): MsgLiquidStake { + return { + delegatorAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgLiquidStake = { + typeUrl: "/pstake.liquidstake.v1beta1.MsgLiquidStake", + encode(message: MsgLiquidStake, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgLiquidStake { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLiquidStake(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgLiquidStake { + const message = createBaseMsgLiquidStake(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgLiquidStakeAmino): MsgLiquidStake { + const message = createBaseMsgLiquidStake(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgLiquidStake, useInterfaces: boolean = false): MsgLiquidStakeAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgLiquidStakeAminoMsg): MsgLiquidStake { + return MsgLiquidStake.fromAmino(object.value); + }, + fromProtoMsg(message: MsgLiquidStakeProtoMsg, useInterfaces: boolean = false): MsgLiquidStake { + return MsgLiquidStake.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgLiquidStake): Uint8Array { + return MsgLiquidStake.encode(message).finish(); + }, + toProtoMsg(message: MsgLiquidStake): MsgLiquidStakeProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgLiquidStake", + value: MsgLiquidStake.encode(message).finish() + }; + } +}; +function createBaseMsgLiquidStakeResponse(): MsgLiquidStakeResponse { + return {}; +} +export const MsgLiquidStakeResponse = { + typeUrl: "/pstake.liquidstake.v1beta1.MsgLiquidStakeResponse", + encode(_: MsgLiquidStakeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgLiquidStakeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLiquidStakeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgLiquidStakeResponse { + const message = createBaseMsgLiquidStakeResponse(); + return message; + }, + fromAmino(_: MsgLiquidStakeResponseAmino): MsgLiquidStakeResponse { + const message = createBaseMsgLiquidStakeResponse(); + return message; + }, + toAmino(_: MsgLiquidStakeResponse, useInterfaces: boolean = false): MsgLiquidStakeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgLiquidStakeResponseAminoMsg): MsgLiquidStakeResponse { + return MsgLiquidStakeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgLiquidStakeResponseProtoMsg, useInterfaces: boolean = false): MsgLiquidStakeResponse { + return MsgLiquidStakeResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgLiquidStakeResponse): Uint8Array { + return MsgLiquidStakeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgLiquidStakeResponse): MsgLiquidStakeResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgLiquidStakeResponse", + value: MsgLiquidStakeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgStakeToLP(): MsgStakeToLP { + return { + delegatorAddress: "", + validatorAddress: "", + stakedAmount: Coin.fromPartial({}), + liquidAmount: Coin.fromPartial({}) + }; +} +export const MsgStakeToLP = { + typeUrl: "/pstake.liquidstake.v1beta1.MsgStakeToLP", + encode(message: MsgStakeToLP, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + if (message.stakedAmount !== undefined) { + Coin.encode(message.stakedAmount, writer.uint32(26).fork()).ldelim(); + } + if (message.liquidAmount !== undefined) { + Coin.encode(message.liquidAmount, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgStakeToLP { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStakeToLP(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.stakedAmount = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + case 4: + message.liquidAmount = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgStakeToLP { + const message = createBaseMsgStakeToLP(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.stakedAmount = object.stakedAmount !== undefined && object.stakedAmount !== null ? Coin.fromPartial(object.stakedAmount) : undefined; + message.liquidAmount = object.liquidAmount !== undefined && object.liquidAmount !== null ? Coin.fromPartial(object.liquidAmount) : undefined; + return message; + }, + fromAmino(object: MsgStakeToLPAmino): MsgStakeToLP { + const message = createBaseMsgStakeToLP(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.staked_amount !== undefined && object.staked_amount !== null) { + message.stakedAmount = Coin.fromAmino(object.staked_amount); + } + if (object.liquid_amount !== undefined && object.liquid_amount !== null) { + message.liquidAmount = Coin.fromAmino(object.liquid_amount); + } + return message; + }, + toAmino(message: MsgStakeToLP, useInterfaces: boolean = false): MsgStakeToLPAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress; + obj.validator_address = message.validatorAddress; + obj.staked_amount = message.stakedAmount ? Coin.toAmino(message.stakedAmount, useInterfaces) : undefined; + obj.liquid_amount = message.liquidAmount ? Coin.toAmino(message.liquidAmount, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgStakeToLPAminoMsg): MsgStakeToLP { + return MsgStakeToLP.fromAmino(object.value); + }, + fromProtoMsg(message: MsgStakeToLPProtoMsg, useInterfaces: boolean = false): MsgStakeToLP { + return MsgStakeToLP.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgStakeToLP): Uint8Array { + return MsgStakeToLP.encode(message).finish(); + }, + toProtoMsg(message: MsgStakeToLP): MsgStakeToLPProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgStakeToLP", + value: MsgStakeToLP.encode(message).finish() + }; + } +}; +function createBaseMsgStakeToLPResponse(): MsgStakeToLPResponse { + return {}; +} +export const MsgStakeToLPResponse = { + typeUrl: "/pstake.liquidstake.v1beta1.MsgStakeToLPResponse", + encode(_: MsgStakeToLPResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgStakeToLPResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStakeToLPResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgStakeToLPResponse { + const message = createBaseMsgStakeToLPResponse(); + return message; + }, + fromAmino(_: MsgStakeToLPResponseAmino): MsgStakeToLPResponse { + const message = createBaseMsgStakeToLPResponse(); + return message; + }, + toAmino(_: MsgStakeToLPResponse, useInterfaces: boolean = false): MsgStakeToLPResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgStakeToLPResponseAminoMsg): MsgStakeToLPResponse { + return MsgStakeToLPResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgStakeToLPResponseProtoMsg, useInterfaces: boolean = false): MsgStakeToLPResponse { + return MsgStakeToLPResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgStakeToLPResponse): Uint8Array { + return MsgStakeToLPResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgStakeToLPResponse): MsgStakeToLPResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgStakeToLPResponse", + value: MsgStakeToLPResponse.encode(message).finish() + }; + } +}; +function createBaseMsgLiquidUnstake(): MsgLiquidUnstake { + return { + delegatorAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgLiquidUnstake = { + typeUrl: "/pstake.liquidstake.v1beta1.MsgLiquidUnstake", + encode(message: MsgLiquidUnstake, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgLiquidUnstake { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLiquidUnstake(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgLiquidUnstake { + const message = createBaseMsgLiquidUnstake(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgLiquidUnstakeAmino): MsgLiquidUnstake { + const message = createBaseMsgLiquidUnstake(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgLiquidUnstake, useInterfaces: boolean = false): MsgLiquidUnstakeAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgLiquidUnstakeAminoMsg): MsgLiquidUnstake { + return MsgLiquidUnstake.fromAmino(object.value); + }, + fromProtoMsg(message: MsgLiquidUnstakeProtoMsg, useInterfaces: boolean = false): MsgLiquidUnstake { + return MsgLiquidUnstake.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgLiquidUnstake): Uint8Array { + return MsgLiquidUnstake.encode(message).finish(); + }, + toProtoMsg(message: MsgLiquidUnstake): MsgLiquidUnstakeProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgLiquidUnstake", + value: MsgLiquidUnstake.encode(message).finish() + }; + } +}; +function createBaseMsgLiquidUnstakeResponse(): MsgLiquidUnstakeResponse { + return { + completionTime: new Date() + }; +} +export const MsgLiquidUnstakeResponse = { + typeUrl: "/pstake.liquidstake.v1beta1.MsgLiquidUnstakeResponse", + encode(message: MsgLiquidUnstakeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgLiquidUnstakeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLiquidUnstakeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgLiquidUnstakeResponse { + const message = createBaseMsgLiquidUnstakeResponse(); + message.completionTime = object.completionTime ?? undefined; + return message; + }, + fromAmino(object: MsgLiquidUnstakeResponseAmino): MsgLiquidUnstakeResponse { + const message = createBaseMsgLiquidUnstakeResponse(); + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time)); + } + return message; + }, + toAmino(message: MsgLiquidUnstakeResponse, useInterfaces: boolean = false): MsgLiquidUnstakeResponseAmino { + const obj: any = {}; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; + return obj; + }, + fromAminoMsg(object: MsgLiquidUnstakeResponseAminoMsg): MsgLiquidUnstakeResponse { + return MsgLiquidUnstakeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgLiquidUnstakeResponseProtoMsg, useInterfaces: boolean = false): MsgLiquidUnstakeResponse { + return MsgLiquidUnstakeResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgLiquidUnstakeResponse): Uint8Array { + return MsgLiquidUnstakeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgLiquidUnstakeResponse): MsgLiquidUnstakeResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgLiquidUnstakeResponse", + value: MsgLiquidUnstakeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/pstake.liquidstake.v1beta1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams, useInterfaces: boolean = false): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg, useInterfaces: boolean = false): MsgUpdateParams { + return MsgUpdateParams.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/pstake.liquidstake.v1beta1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse, useInterfaces: boolean = false): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg, useInterfaces: boolean = false): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateWhitelistedValidators(): MsgUpdateWhitelistedValidators { + return { + authority: "", + whitelistedValidators: [] + }; +} +export const MsgUpdateWhitelistedValidators = { + typeUrl: "/pstake.liquidstake.v1beta1.MsgUpdateWhitelistedValidators", + encode(message: MsgUpdateWhitelistedValidators, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + for (const v of message.whitelistedValidators) { + WhitelistedValidator.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateWhitelistedValidators { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateWhitelistedValidators(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.whitelistedValidators.push(WhitelistedValidator.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateWhitelistedValidators { + const message = createBaseMsgUpdateWhitelistedValidators(); + message.authority = object.authority ?? ""; + message.whitelistedValidators = object.whitelistedValidators?.map(e => WhitelistedValidator.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgUpdateWhitelistedValidatorsAmino): MsgUpdateWhitelistedValidators { + const message = createBaseMsgUpdateWhitelistedValidators(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.whitelistedValidators = object.whitelisted_validators?.map(e => WhitelistedValidator.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgUpdateWhitelistedValidators, useInterfaces: boolean = false): MsgUpdateWhitelistedValidatorsAmino { + const obj: any = {}; + obj.authority = message.authority; + if (message.whitelistedValidators) { + obj.whitelisted_validators = message.whitelistedValidators.map(e => e ? WhitelistedValidator.toAmino(e, useInterfaces) : undefined); + } else { + obj.whitelisted_validators = []; + } + return obj; + }, + fromAminoMsg(object: MsgUpdateWhitelistedValidatorsAminoMsg): MsgUpdateWhitelistedValidators { + return MsgUpdateWhitelistedValidators.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateWhitelistedValidatorsProtoMsg, useInterfaces: boolean = false): MsgUpdateWhitelistedValidators { + return MsgUpdateWhitelistedValidators.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateWhitelistedValidators): Uint8Array { + return MsgUpdateWhitelistedValidators.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateWhitelistedValidators): MsgUpdateWhitelistedValidatorsProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgUpdateWhitelistedValidators", + value: MsgUpdateWhitelistedValidators.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateWhitelistedValidatorsResponse(): MsgUpdateWhitelistedValidatorsResponse { + return {}; +} +export const MsgUpdateWhitelistedValidatorsResponse = { + typeUrl: "/pstake.liquidstake.v1beta1.MsgUpdateWhitelistedValidatorsResponse", + encode(_: MsgUpdateWhitelistedValidatorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateWhitelistedValidatorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateWhitelistedValidatorsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateWhitelistedValidatorsResponse { + const message = createBaseMsgUpdateWhitelistedValidatorsResponse(); + return message; + }, + fromAmino(_: MsgUpdateWhitelistedValidatorsResponseAmino): MsgUpdateWhitelistedValidatorsResponse { + const message = createBaseMsgUpdateWhitelistedValidatorsResponse(); + return message; + }, + toAmino(_: MsgUpdateWhitelistedValidatorsResponse, useInterfaces: boolean = false): MsgUpdateWhitelistedValidatorsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateWhitelistedValidatorsResponseAminoMsg): MsgUpdateWhitelistedValidatorsResponse { + return MsgUpdateWhitelistedValidatorsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateWhitelistedValidatorsResponseProtoMsg, useInterfaces: boolean = false): MsgUpdateWhitelistedValidatorsResponse { + return MsgUpdateWhitelistedValidatorsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateWhitelistedValidatorsResponse): Uint8Array { + return MsgUpdateWhitelistedValidatorsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateWhitelistedValidatorsResponse): MsgUpdateWhitelistedValidatorsResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgUpdateWhitelistedValidatorsResponse", + value: MsgUpdateWhitelistedValidatorsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetModulePaused(): MsgSetModulePaused { + return { + authority: "", + isPaused: false + }; +} +export const MsgSetModulePaused = { + typeUrl: "/pstake.liquidstake.v1beta1.MsgSetModulePaused", + encode(message: MsgSetModulePaused, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.isPaused === true) { + writer.uint32(16).bool(message.isPaused); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetModulePaused { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetModulePaused(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.isPaused = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetModulePaused { + const message = createBaseMsgSetModulePaused(); + message.authority = object.authority ?? ""; + message.isPaused = object.isPaused ?? false; + return message; + }, + fromAmino(object: MsgSetModulePausedAmino): MsgSetModulePaused { + const message = createBaseMsgSetModulePaused(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.is_paused !== undefined && object.is_paused !== null) { + message.isPaused = object.is_paused; + } + return message; + }, + toAmino(message: MsgSetModulePaused, useInterfaces: boolean = false): MsgSetModulePausedAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.is_paused = message.isPaused; + return obj; + }, + fromAminoMsg(object: MsgSetModulePausedAminoMsg): MsgSetModulePaused { + return MsgSetModulePaused.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetModulePausedProtoMsg, useInterfaces: boolean = false): MsgSetModulePaused { + return MsgSetModulePaused.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetModulePaused): Uint8Array { + return MsgSetModulePaused.encode(message).finish(); + }, + toProtoMsg(message: MsgSetModulePaused): MsgSetModulePausedProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgSetModulePaused", + value: MsgSetModulePaused.encode(message).finish() + }; + } +}; +function createBaseMsgSetModulePausedResponse(): MsgSetModulePausedResponse { + return {}; +} +export const MsgSetModulePausedResponse = { + typeUrl: "/pstake.liquidstake.v1beta1.MsgSetModulePausedResponse", + encode(_: MsgSetModulePausedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetModulePausedResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetModulePausedResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetModulePausedResponse { + const message = createBaseMsgSetModulePausedResponse(); + return message; + }, + fromAmino(_: MsgSetModulePausedResponseAmino): MsgSetModulePausedResponse { + const message = createBaseMsgSetModulePausedResponse(); + return message; + }, + toAmino(_: MsgSetModulePausedResponse, useInterfaces: boolean = false): MsgSetModulePausedResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetModulePausedResponseAminoMsg): MsgSetModulePausedResponse { + return MsgSetModulePausedResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetModulePausedResponseProtoMsg, useInterfaces: boolean = false): MsgSetModulePausedResponse { + return MsgSetModulePausedResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetModulePausedResponse): Uint8Array { + return MsgSetModulePausedResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetModulePausedResponse): MsgSetModulePausedResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstake.v1beta1.MsgSetModulePausedResponse", + value: MsgSetModulePausedResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/genesis.ts b/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/genesis.ts new file mode 100644 index 000000000..60a384036 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/genesis.ts @@ -0,0 +1,182 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { HostChain, HostChainAmino, HostChainSDKType, Deposit, DepositAmino, DepositSDKType, Unbonding, UnbondingAmino, UnbondingSDKType, UserUnbonding, UserUnbondingAmino, UserUnbondingSDKType, ValidatorUnbonding, ValidatorUnbondingAmino, ValidatorUnbondingSDKType } from "./liquidstakeibc"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** GenesisState defines the liquidstakeibc module's genesis state. */ +export interface GenesisState { + params: Params | undefined; + /** initial host chain list */ + hostChains: HostChain[]; + /** initial deposit list */ + deposits: Deposit[]; + /** initial unbondings */ + unbondings: Unbonding[]; + /** initial user unbondings */ + userUnbondings: UserUnbonding[]; + /** validator unbondings */ + validatorUnbondings: ValidatorUnbonding[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the liquidstakeibc module's genesis state. */ +export interface GenesisStateAmino { + params?: ParamsAmino | undefined; + /** initial host chain list */ + host_chains?: HostChainAmino[]; + /** initial deposit list */ + deposits?: DepositAmino[]; + /** initial unbondings */ + unbondings?: UnbondingAmino[]; + /** initial user unbondings */ + user_unbondings?: UserUnbondingAmino[]; + /** validator unbondings */ + validator_unbondings?: ValidatorUnbondingAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the liquidstakeibc module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType | undefined; + host_chains: HostChainSDKType[]; + deposits: DepositSDKType[]; + unbondings: UnbondingSDKType[]; + user_unbondings: UserUnbondingSDKType[]; + validator_unbondings: ValidatorUnbondingSDKType[]; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + hostChains: [], + deposits: [], + unbondings: [], + userUnbondings: [], + validatorUnbondings: [] + }; +} +export const GenesisState = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.hostChains) { + HostChain.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.deposits) { + Deposit.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.unbondings) { + Unbonding.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.userUnbondings) { + UserUnbonding.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.validatorUnbondings) { + ValidatorUnbonding.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.hostChains.push(HostChain.decode(reader, reader.uint32(), useInterfaces)); + break; + case 3: + message.deposits.push(Deposit.decode(reader, reader.uint32(), useInterfaces)); + break; + case 4: + message.unbondings.push(Unbonding.decode(reader, reader.uint32(), useInterfaces)); + break; + case 5: + message.userUnbondings.push(UserUnbonding.decode(reader, reader.uint32(), useInterfaces)); + break; + case 6: + message.validatorUnbondings.push(ValidatorUnbonding.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.hostChains = object.hostChains?.map(e => HostChain.fromPartial(e)) || []; + message.deposits = object.deposits?.map(e => Deposit.fromPartial(e)) || []; + message.unbondings = object.unbondings?.map(e => Unbonding.fromPartial(e)) || []; + message.userUnbondings = object.userUnbondings?.map(e => UserUnbonding.fromPartial(e)) || []; + message.validatorUnbondings = object.validatorUnbondings?.map(e => ValidatorUnbonding.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.hostChains = object.host_chains?.map(e => HostChain.fromAmino(e)) || []; + message.deposits = object.deposits?.map(e => Deposit.fromAmino(e)) || []; + message.unbondings = object.unbondings?.map(e => Unbonding.fromAmino(e)) || []; + message.userUnbondings = object.user_unbondings?.map(e => UserUnbonding.fromAmino(e)) || []; + message.validatorUnbondings = object.validator_unbondings?.map(e => ValidatorUnbonding.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState, useInterfaces: boolean = false): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + if (message.hostChains) { + obj.host_chains = message.hostChains.map(e => e ? HostChain.toAmino(e, useInterfaces) : undefined); + } else { + obj.host_chains = []; + } + if (message.deposits) { + obj.deposits = message.deposits.map(e => e ? Deposit.toAmino(e, useInterfaces) : undefined); + } else { + obj.deposits = []; + } + if (message.unbondings) { + obj.unbondings = message.unbondings.map(e => e ? Unbonding.toAmino(e, useInterfaces) : undefined); + } else { + obj.unbondings = []; + } + if (message.userUnbondings) { + obj.user_unbondings = message.userUnbondings.map(e => e ? UserUnbonding.toAmino(e, useInterfaces) : undefined); + } else { + obj.user_unbondings = []; + } + if (message.validatorUnbondings) { + obj.validator_unbondings = message.validatorUnbondings.map(e => e ? ValidatorUnbonding.toAmino(e, useInterfaces) : undefined); + } else { + obj.validator_unbondings = []; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg, useInterfaces: boolean = false): GenesisState { + return GenesisState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/liquidstakeibc.ts b/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/liquidstakeibc.ts new file mode 100644 index 000000000..af64c4880 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/liquidstakeibc.ts @@ -0,0 +1,2489 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Redelegation, RedelegationAmino, RedelegationSDKType } from "../../../cosmos/staking/v1beta1/staking"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +export enum ICAAccount_ChannelState { + /** ICA_CHANNEL_CREATING - ICA channel is being created */ + ICA_CHANNEL_CREATING = 0, + /** ICA_CHANNEL_CREATED - ICA is established and the account can be used */ + ICA_CHANNEL_CREATED = 1, + UNRECOGNIZED = -1, +} +export const ICAAccount_ChannelStateSDKType = ICAAccount_ChannelState; +export const ICAAccount_ChannelStateAmino = ICAAccount_ChannelState; +export function iCAAccount_ChannelStateFromJSON(object: any): ICAAccount_ChannelState { + switch (object) { + case 0: + case "ICA_CHANNEL_CREATING": + return ICAAccount_ChannelState.ICA_CHANNEL_CREATING; + case 1: + case "ICA_CHANNEL_CREATED": + return ICAAccount_ChannelState.ICA_CHANNEL_CREATED; + case -1: + case "UNRECOGNIZED": + default: + return ICAAccount_ChannelState.UNRECOGNIZED; + } +} +export function iCAAccount_ChannelStateToJSON(object: ICAAccount_ChannelState): string { + switch (object) { + case ICAAccount_ChannelState.ICA_CHANNEL_CREATING: + return "ICA_CHANNEL_CREATING"; + case ICAAccount_ChannelState.ICA_CHANNEL_CREATED: + return "ICA_CHANNEL_CREATED"; + case ICAAccount_ChannelState.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum Deposit_DepositState { + /** DEPOSIT_PENDING - no action has been initiated on the deposit */ + DEPOSIT_PENDING = 0, + /** DEPOSIT_SENT - deposit sent to the host chain delegator address */ + DEPOSIT_SENT = 1, + /** DEPOSIT_RECEIVED - deposit received by the host chain delegator address */ + DEPOSIT_RECEIVED = 2, + /** DEPOSIT_DELEGATING - delegation submitted for the deposit on the host chain */ + DEPOSIT_DELEGATING = 3, + UNRECOGNIZED = -1, +} +export const Deposit_DepositStateSDKType = Deposit_DepositState; +export const Deposit_DepositStateAmino = Deposit_DepositState; +export function deposit_DepositStateFromJSON(object: any): Deposit_DepositState { + switch (object) { + case 0: + case "DEPOSIT_PENDING": + return Deposit_DepositState.DEPOSIT_PENDING; + case 1: + case "DEPOSIT_SENT": + return Deposit_DepositState.DEPOSIT_SENT; + case 2: + case "DEPOSIT_RECEIVED": + return Deposit_DepositState.DEPOSIT_RECEIVED; + case 3: + case "DEPOSIT_DELEGATING": + return Deposit_DepositState.DEPOSIT_DELEGATING; + case -1: + case "UNRECOGNIZED": + default: + return Deposit_DepositState.UNRECOGNIZED; + } +} +export function deposit_DepositStateToJSON(object: Deposit_DepositState): string { + switch (object) { + case Deposit_DepositState.DEPOSIT_PENDING: + return "DEPOSIT_PENDING"; + case Deposit_DepositState.DEPOSIT_SENT: + return "DEPOSIT_SENT"; + case Deposit_DepositState.DEPOSIT_RECEIVED: + return "DEPOSIT_RECEIVED"; + case Deposit_DepositState.DEPOSIT_DELEGATING: + return "DEPOSIT_DELEGATING"; + case Deposit_DepositState.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum LSMDeposit_LSMDepositState { + /** DEPOSIT_PENDING - no action has been initiated on the deposit */ + DEPOSIT_PENDING = 0, + /** DEPOSIT_SENT - deposit sent to the host chain delegator address */ + DEPOSIT_SENT = 1, + /** DEPOSIT_RECEIVED - deposit received by the host chain delegator address */ + DEPOSIT_RECEIVED = 2, + /** DEPOSIT_UNTOKENIZING - deposit started the untokenization process */ + DEPOSIT_UNTOKENIZING = 3, + UNRECOGNIZED = -1, +} +export const LSMDeposit_LSMDepositStateSDKType = LSMDeposit_LSMDepositState; +export const LSMDeposit_LSMDepositStateAmino = LSMDeposit_LSMDepositState; +export function lSMDeposit_LSMDepositStateFromJSON(object: any): LSMDeposit_LSMDepositState { + switch (object) { + case 0: + case "DEPOSIT_PENDING": + return LSMDeposit_LSMDepositState.DEPOSIT_PENDING; + case 1: + case "DEPOSIT_SENT": + return LSMDeposit_LSMDepositState.DEPOSIT_SENT; + case 2: + case "DEPOSIT_RECEIVED": + return LSMDeposit_LSMDepositState.DEPOSIT_RECEIVED; + case 3: + case "DEPOSIT_UNTOKENIZING": + return LSMDeposit_LSMDepositState.DEPOSIT_UNTOKENIZING; + case -1: + case "UNRECOGNIZED": + default: + return LSMDeposit_LSMDepositState.UNRECOGNIZED; + } +} +export function lSMDeposit_LSMDepositStateToJSON(object: LSMDeposit_LSMDepositState): string { + switch (object) { + case LSMDeposit_LSMDepositState.DEPOSIT_PENDING: + return "DEPOSIT_PENDING"; + case LSMDeposit_LSMDepositState.DEPOSIT_SENT: + return "DEPOSIT_SENT"; + case LSMDeposit_LSMDepositState.DEPOSIT_RECEIVED: + return "DEPOSIT_RECEIVED"; + case LSMDeposit_LSMDepositState.DEPOSIT_UNTOKENIZING: + return "DEPOSIT_UNTOKENIZING"; + case LSMDeposit_LSMDepositState.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum Unbonding_UnbondingState { + /** UNBONDING_PENDING - no action has been initiated on the unbonding */ + UNBONDING_PENDING = 0, + /** UNBONDING_INITIATED - unbonding action has been sent to the host chain */ + UNBONDING_INITIATED = 1, + /** UNBONDING_MATURING - unbonding is waiting for the maturing period of the host chain */ + UNBONDING_MATURING = 2, + /** UNBONDING_MATURED - unbonding has matured and is ready to transfer from the host chain */ + UNBONDING_MATURED = 3, + /** UNBONDING_CLAIMABLE - unbonding is on the persistence chain and can be claimed */ + UNBONDING_CLAIMABLE = 4, + /** UNBONDING_FAILED - unbonding has failed */ + UNBONDING_FAILED = 5, + UNRECOGNIZED = -1, +} +export const Unbonding_UnbondingStateSDKType = Unbonding_UnbondingState; +export const Unbonding_UnbondingStateAmino = Unbonding_UnbondingState; +export function unbonding_UnbondingStateFromJSON(object: any): Unbonding_UnbondingState { + switch (object) { + case 0: + case "UNBONDING_PENDING": + return Unbonding_UnbondingState.UNBONDING_PENDING; + case 1: + case "UNBONDING_INITIATED": + return Unbonding_UnbondingState.UNBONDING_INITIATED; + case 2: + case "UNBONDING_MATURING": + return Unbonding_UnbondingState.UNBONDING_MATURING; + case 3: + case "UNBONDING_MATURED": + return Unbonding_UnbondingState.UNBONDING_MATURED; + case 4: + case "UNBONDING_CLAIMABLE": + return Unbonding_UnbondingState.UNBONDING_CLAIMABLE; + case 5: + case "UNBONDING_FAILED": + return Unbonding_UnbondingState.UNBONDING_FAILED; + case -1: + case "UNRECOGNIZED": + default: + return Unbonding_UnbondingState.UNRECOGNIZED; + } +} +export function unbonding_UnbondingStateToJSON(object: Unbonding_UnbondingState): string { + switch (object) { + case Unbonding_UnbondingState.UNBONDING_PENDING: + return "UNBONDING_PENDING"; + case Unbonding_UnbondingState.UNBONDING_INITIATED: + return "UNBONDING_INITIATED"; + case Unbonding_UnbondingState.UNBONDING_MATURING: + return "UNBONDING_MATURING"; + case Unbonding_UnbondingState.UNBONDING_MATURED: + return "UNBONDING_MATURED"; + case Unbonding_UnbondingState.UNBONDING_CLAIMABLE: + return "UNBONDING_CLAIMABLE"; + case Unbonding_UnbondingState.UNBONDING_FAILED: + return "UNBONDING_FAILED"; + case Unbonding_UnbondingState.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum RedelegateTx_RedelegateTxState { + /** REDELEGATE_SENT - redelegate txn sent */ + REDELEGATE_SENT = 0, + /** REDELEGATE_ACKED - redelegate txn acked */ + REDELEGATE_ACKED = 1, + UNRECOGNIZED = -1, +} +export const RedelegateTx_RedelegateTxStateSDKType = RedelegateTx_RedelegateTxState; +export const RedelegateTx_RedelegateTxStateAmino = RedelegateTx_RedelegateTxState; +export function redelegateTx_RedelegateTxStateFromJSON(object: any): RedelegateTx_RedelegateTxState { + switch (object) { + case 0: + case "REDELEGATE_SENT": + return RedelegateTx_RedelegateTxState.REDELEGATE_SENT; + case 1: + case "REDELEGATE_ACKED": + return RedelegateTx_RedelegateTxState.REDELEGATE_ACKED; + case -1: + case "UNRECOGNIZED": + default: + return RedelegateTx_RedelegateTxState.UNRECOGNIZED; + } +} +export function redelegateTx_RedelegateTxStateToJSON(object: RedelegateTx_RedelegateTxState): string { + switch (object) { + case RedelegateTx_RedelegateTxState.REDELEGATE_SENT: + return "REDELEGATE_SENT"; + case RedelegateTx_RedelegateTxState.REDELEGATE_ACKED: + return "REDELEGATE_ACKED"; + case RedelegateTx_RedelegateTxState.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export interface HostChain { + /** host chain id */ + chainId: string; + /** ibc connection id */ + connectionId: string; + /** module params */ + params?: HostChainLSParams | undefined; + /** native token denom */ + hostDenom: string; + /** ibc connection channel id */ + channelId: string; + /** ibc connection port id */ + portId: string; + /** delegation host account */ + delegationAccount?: ICAAccount | undefined; + /** reward host account */ + rewardsAccount?: ICAAccount | undefined; + /** validator set */ + validators: Validator[]; + /** minimum ls amount */ + minimumDeposit: string; + /** redemption rate */ + cValue: string; + /** previous redemption rate */ + lastCValue: string; + /** undelegation epoch factor */ + unbondingFactor: bigint; + /** whether the chain is ready to accept delegations or not */ + active: boolean; + /** factor limit for auto-compounding, daily periodic rate (APY / 365s) */ + autoCompoundFactor: string; + /** host chain flags */ + flags?: HostChainFlags | undefined; + /** non-compoundable chain reward params */ + rewardParams?: RewardParams | undefined; +} +export interface HostChainProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.HostChain"; + value: Uint8Array; +} +export interface HostChainAmino { + /** host chain id */ + chain_id?: string; + /** ibc connection id */ + connection_id?: string; + /** module params */ + params?: HostChainLSParamsAmino | undefined; + /** native token denom */ + host_denom?: string; + /** ibc connection channel id */ + channel_id?: string; + /** ibc connection port id */ + port_id?: string; + /** delegation host account */ + delegation_account?: ICAAccountAmino | undefined; + /** reward host account */ + rewards_account?: ICAAccountAmino | undefined; + /** validator set */ + validators?: ValidatorAmino[]; + /** minimum ls amount */ + minimum_deposit?: string; + /** redemption rate */ + c_value?: string; + /** previous redemption rate */ + last_c_value?: string; + /** undelegation epoch factor */ + unbonding_factor?: string; + /** whether the chain is ready to accept delegations or not */ + active?: boolean; + /** factor limit for auto-compounding, daily periodic rate (APY / 365s) */ + auto_compound_factor?: string; + /** host chain flags */ + flags?: HostChainFlagsAmino | undefined; + /** non-compoundable chain reward params */ + reward_params?: RewardParamsAmino | undefined; +} +export interface HostChainAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.HostChain"; + value: HostChainAmino; +} +export interface HostChainSDKType { + chain_id: string; + connection_id: string; + params?: HostChainLSParamsSDKType | undefined; + host_denom: string; + channel_id: string; + port_id: string; + delegation_account?: ICAAccountSDKType | undefined; + rewards_account?: ICAAccountSDKType | undefined; + validators: ValidatorSDKType[]; + minimum_deposit: string; + c_value: string; + last_c_value: string; + unbonding_factor: bigint; + active: boolean; + auto_compound_factor: string; + flags?: HostChainFlagsSDKType | undefined; + reward_params?: RewardParamsSDKType | undefined; +} +export interface HostChainFlags { + lsm: boolean; +} +export interface HostChainFlagsProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.HostChainFlags"; + value: Uint8Array; +} +export interface HostChainFlagsAmino { + lsm?: boolean; +} +export interface HostChainFlagsAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.HostChainFlags"; + value: HostChainFlagsAmino; +} +export interface HostChainFlagsSDKType { + lsm: boolean; +} +export interface RewardParams { + /** rewards denom on the host chain */ + denom: string; + /** entity which will convert rewards to the host denom */ + destination: string; +} +export interface RewardParamsProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.RewardParams"; + value: Uint8Array; +} +export interface RewardParamsAmino { + /** rewards denom on the host chain */ + denom?: string; + /** entity which will convert rewards to the host denom */ + destination?: string; +} +export interface RewardParamsAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.RewardParams"; + value: RewardParamsAmino; +} +export interface RewardParamsSDKType { + denom: string; + destination: string; +} +export interface HostChainLSParams { + depositFee: string; + restakeFee: string; + unstakeFee: string; + redemptionFee: string; + lsmValidatorCap: string; + /** + * LSM bond factor + * Should be used only when HostChainFlag.Lsm == true, orelse default + */ + lsmBondFactor: string; + /** UndelegateEntries */ + maxEntries: number; + /** amount skew that is acceptable before redelegating */ + redelegationAcceptableDelta: string; + upperCValueLimit: string; + lowerCValueLimit: string; +} +export interface HostChainLSParamsProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.HostChainLSParams"; + value: Uint8Array; +} +export interface HostChainLSParamsAmino { + deposit_fee?: string; + restake_fee?: string; + unstake_fee?: string; + redemption_fee?: string; + lsm_validator_cap?: string; + /** + * LSM bond factor + * Should be used only when HostChainFlag.Lsm == true, orelse default + */ + lsm_bond_factor?: string; + /** UndelegateEntries */ + max_entries?: number; + /** amount skew that is acceptable before redelegating */ + redelegation_acceptable_delta?: string; + upper_c_value_limit?: string; + lower_c_value_limit?: string; +} +export interface HostChainLSParamsAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.HostChainLSParams"; + value: HostChainLSParamsAmino; +} +export interface HostChainLSParamsSDKType { + deposit_fee: string; + restake_fee: string; + unstake_fee: string; + redemption_fee: string; + lsm_validator_cap: string; + lsm_bond_factor: string; + max_entries: number; + redelegation_acceptable_delta: string; + upper_c_value_limit: string; + lower_c_value_limit: string; +} +export interface ICAAccount { + /** address of the ica on the controller chain */ + address: string; + /** token balance of the ica */ + balance: Coin | undefined; + /** owner string */ + owner: string; + channelState: ICAAccount_ChannelState; +} +export interface ICAAccountProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.ICAAccount"; + value: Uint8Array; +} +export interface ICAAccountAmino { + /** address of the ica on the controller chain */ + address?: string; + /** token balance of the ica */ + balance?: CoinAmino | undefined; + /** owner string */ + owner?: string; + channel_state?: ICAAccount_ChannelState; +} +export interface ICAAccountAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.ICAAccount"; + value: ICAAccountAmino; +} +export interface ICAAccountSDKType { + address: string; + balance: CoinSDKType | undefined; + owner: string; + channel_state: ICAAccount_ChannelState; +} +export interface Validator { + /** valoper address */ + operatorAddress: string; + /** validator status */ + status: string; + /** validator weight in the set */ + weight: string; + /** amount delegated by the module to the validator */ + delegatedAmount: string; + /** + * the validator token exchange rate, total bonded tokens divided by total + * shares issued + */ + exchangeRate: string; + /** the unbonding epoch number when the validator transitioned into the state */ + unbondingEpoch: bigint; + /** + * whether the validator can accept delegations or not, default true for + * non-lsm chains + */ + delegable: boolean; +} +export interface ValidatorProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.Validator"; + value: Uint8Array; +} +export interface ValidatorAmino { + /** valoper address */ + operator_address?: string; + /** validator status */ + status?: string; + /** validator weight in the set */ + weight?: string; + /** amount delegated by the module to the validator */ + delegated_amount?: string; + /** + * the validator token exchange rate, total bonded tokens divided by total + * shares issued + */ + exchange_rate?: string; + /** the unbonding epoch number when the validator transitioned into the state */ + unbonding_epoch?: string; + /** + * whether the validator can accept delegations or not, default true for + * non-lsm chains + */ + delegable?: boolean; +} +export interface ValidatorAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.Validator"; + value: ValidatorAmino; +} +export interface ValidatorSDKType { + operator_address: string; + status: string; + weight: string; + delegated_amount: string; + exchange_rate: string; + unbonding_epoch: bigint; + delegable: boolean; +} +export interface Deposit { + /** deposit target chain */ + chainId: string; + amount: Coin | undefined; + /** epoch number of the deposit */ + epoch: bigint; + /** state */ + state: Deposit_DepositState; + /** sequence id of the ibc transaction */ + ibcSequenceId: string; +} +export interface DepositProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.Deposit"; + value: Uint8Array; +} +export interface DepositAmino { + /** deposit target chain */ + chain_id?: string; + amount?: CoinAmino | undefined; + /** epoch number of the deposit */ + epoch?: string; + /** state */ + state?: Deposit_DepositState; + /** sequence id of the ibc transaction */ + ibc_sequence_id?: string; +} +export interface DepositAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.Deposit"; + value: DepositAmino; +} +export interface DepositSDKType { + chain_id: string; + amount: CoinSDKType | undefined; + epoch: bigint; + state: Deposit_DepositState; + ibc_sequence_id: string; +} +export interface LSMDeposit { + /** deposit target chain */ + chainId: string; + /** + * this is calculated when liquid staking [lsm_shares * + * validator_exchange_rate] + */ + amount: string; + /** + * LSM token shares, they are mapped 1:1 with the delegator shares that are + * tokenized https://github.com/iqlusioninc/cosmos-sdk/pull/19 + */ + shares: string; + /** LSM token denom */ + denom: string; + /** LSM token ibc denom */ + ibcDenom: string; + /** address of the delegator */ + delegatorAddress: string; + /** state o the deposit */ + state: LSMDeposit_LSMDepositState; + /** sequence id of the ibc transaction */ + ibcSequenceId: string; +} +export interface LSMDepositProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.LSMDeposit"; + value: Uint8Array; +} +export interface LSMDepositAmino { + /** deposit target chain */ + chain_id?: string; + /** + * this is calculated when liquid staking [lsm_shares * + * validator_exchange_rate] + */ + amount?: string; + /** + * LSM token shares, they are mapped 1:1 with the delegator shares that are + * tokenized https://github.com/iqlusioninc/cosmos-sdk/pull/19 + */ + shares?: string; + /** LSM token denom */ + denom?: string; + /** LSM token ibc denom */ + ibc_denom?: string; + /** address of the delegator */ + delegator_address?: string; + /** state o the deposit */ + state?: LSMDeposit_LSMDepositState; + /** sequence id of the ibc transaction */ + ibc_sequence_id?: string; +} +export interface LSMDepositAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.LSMDeposit"; + value: LSMDepositAmino; +} +export interface LSMDepositSDKType { + chain_id: string; + amount: string; + shares: string; + denom: string; + ibc_denom: string; + delegator_address: string; + state: LSMDeposit_LSMDepositState; + ibc_sequence_id: string; +} +export interface Unbonding { + /** unbonding target chain */ + chainId: string; + /** epoch number of the unbonding record */ + epochNumber: bigint; + /** time when the unbonding matures and can be collected */ + matureTime: Date | undefined; + /** stk token amount that is burned with the unbonding */ + burnAmount: Coin | undefined; + /** host token amount that is being unbonded */ + unbondAmount: Coin | undefined; + /** sequence id of the ibc transaction */ + ibcSequenceId: string; + /** state of the unbonding during the process */ + state: Unbonding_UnbondingState; +} +export interface UnbondingProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.Unbonding"; + value: Uint8Array; +} +export interface UnbondingAmino { + /** unbonding target chain */ + chain_id?: string; + /** epoch number of the unbonding record */ + epoch_number?: string; + /** time when the unbonding matures and can be collected */ + mature_time?: string | undefined; + /** stk token amount that is burned with the unbonding */ + burn_amount?: CoinAmino | undefined; + /** host token amount that is being unbonded */ + unbond_amount?: CoinAmino | undefined; + /** sequence id of the ibc transaction */ + ibc_sequence_id?: string; + /** state of the unbonding during the process */ + state?: Unbonding_UnbondingState; +} +export interface UnbondingAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.Unbonding"; + value: UnbondingAmino; +} +export interface UnbondingSDKType { + chain_id: string; + epoch_number: bigint; + mature_time: Date | undefined; + burn_amount: CoinSDKType | undefined; + unbond_amount: CoinSDKType | undefined; + ibc_sequence_id: string; + state: Unbonding_UnbondingState; +} +export interface UserUnbonding { + /** unbonding target chain */ + chainId: string; + /** epoch when the unbonding started */ + epochNumber: bigint; + /** address which requested the unbonding */ + address: string; + /** stk token amount that is being unbonded */ + stkAmount: Coin | undefined; + /** host token amount that is being unbonded */ + unbondAmount: Coin | undefined; +} +export interface UserUnbondingProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.UserUnbonding"; + value: Uint8Array; +} +export interface UserUnbondingAmino { + /** unbonding target chain */ + chain_id?: string; + /** epoch when the unbonding started */ + epoch_number?: string; + /** address which requested the unbonding */ + address?: string; + /** stk token amount that is being unbonded */ + stk_amount?: CoinAmino | undefined; + /** host token amount that is being unbonded */ + unbond_amount?: CoinAmino | undefined; +} +export interface UserUnbondingAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.UserUnbonding"; + value: UserUnbondingAmino; +} +export interface UserUnbondingSDKType { + chain_id: string; + epoch_number: bigint; + address: string; + stk_amount: CoinSDKType | undefined; + unbond_amount: CoinSDKType | undefined; +} +export interface ValidatorUnbonding { + /** unbonding target chain */ + chainId: string; + /** epoch when the unbonding started */ + epochNumber: bigint; + /** time when the unbonding matures and can be collected */ + matureTime: Date | undefined; + /** address of the validator that is being unbonded */ + validatorAddress: string; + /** amount unbonded from the validator */ + amount: Coin | undefined; + /** sequence id of the ibc transaction */ + ibcSequenceId: string; +} +export interface ValidatorUnbondingProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.ValidatorUnbonding"; + value: Uint8Array; +} +export interface ValidatorUnbondingAmino { + /** unbonding target chain */ + chain_id?: string; + /** epoch when the unbonding started */ + epoch_number?: string; + /** time when the unbonding matures and can be collected */ + mature_time?: string | undefined; + /** address of the validator that is being unbonded */ + validator_address?: string; + /** amount unbonded from the validator */ + amount?: CoinAmino | undefined; + /** sequence id of the ibc transaction */ + ibc_sequence_id?: string; +} +export interface ValidatorUnbondingAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.ValidatorUnbonding"; + value: ValidatorUnbondingAmino; +} +export interface ValidatorUnbondingSDKType { + chain_id: string; + epoch_number: bigint; + mature_time: Date | undefined; + validator_address: string; + amount: CoinSDKType | undefined; + ibc_sequence_id: string; +} +export interface KVUpdate { + key: string; + value: string; +} +export interface KVUpdateProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.KVUpdate"; + value: Uint8Array; +} +export interface KVUpdateAmino { + key?: string; + value?: string; +} +export interface KVUpdateAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.KVUpdate"; + value: KVUpdateAmino; +} +export interface KVUpdateSDKType { + key: string; + value: string; +} +export interface Redelegations { + chainID: string; + redelegations: Redelegation[]; +} +export interface RedelegationsProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.Redelegations"; + value: Uint8Array; +} +export interface RedelegationsAmino { + chain_i_d?: string; + redelegations?: RedelegationAmino[]; +} +export interface RedelegationsAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.Redelegations"; + value: RedelegationsAmino; +} +export interface RedelegationsSDKType { + chain_i_d: string; + redelegations: RedelegationSDKType[]; +} +export interface RedelegateTx { + /** target chain */ + chainId: string; + ibcSequenceId: string; + /** state of the unbonding during the process */ + state: RedelegateTx_RedelegateTxState; +} +export interface RedelegateTxProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.RedelegateTx"; + value: Uint8Array; +} +export interface RedelegateTxAmino { + /** target chain */ + chain_id?: string; + ibc_sequence_id?: string; + /** state of the unbonding during the process */ + state?: RedelegateTx_RedelegateTxState; +} +export interface RedelegateTxAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.RedelegateTx"; + value: RedelegateTxAmino; +} +export interface RedelegateTxSDKType { + chain_id: string; + ibc_sequence_id: string; + state: RedelegateTx_RedelegateTxState; +} +function createBaseHostChain(): HostChain { + return { + chainId: "", + connectionId: "", + params: undefined, + hostDenom: "", + channelId: "", + portId: "", + delegationAccount: undefined, + rewardsAccount: undefined, + validators: [], + minimumDeposit: "", + cValue: "", + lastCValue: "", + unbondingFactor: BigInt(0), + active: false, + autoCompoundFactor: "", + flags: undefined, + rewardParams: undefined + }; +} +export const HostChain = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.HostChain", + encode(message: HostChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + if (message.connectionId !== "") { + writer.uint32(18).string(message.connectionId); + } + if (message.params !== undefined) { + HostChainLSParams.encode(message.params, writer.uint32(26).fork()).ldelim(); + } + if (message.hostDenom !== "") { + writer.uint32(34).string(message.hostDenom); + } + if (message.channelId !== "") { + writer.uint32(42).string(message.channelId); + } + if (message.portId !== "") { + writer.uint32(50).string(message.portId); + } + if (message.delegationAccount !== undefined) { + ICAAccount.encode(message.delegationAccount, writer.uint32(58).fork()).ldelim(); + } + if (message.rewardsAccount !== undefined) { + ICAAccount.encode(message.rewardsAccount, writer.uint32(66).fork()).ldelim(); + } + for (const v of message.validators) { + Validator.encode(v!, writer.uint32(74).fork()).ldelim(); + } + if (message.minimumDeposit !== "") { + writer.uint32(82).string(message.minimumDeposit); + } + if (message.cValue !== "") { + writer.uint32(90).string(Decimal.fromUserInput(message.cValue, 18).atomics); + } + if (message.lastCValue !== "") { + writer.uint32(98).string(Decimal.fromUserInput(message.lastCValue, 18).atomics); + } + if (message.unbondingFactor !== BigInt(0)) { + writer.uint32(104).int64(message.unbondingFactor); + } + if (message.active === true) { + writer.uint32(112).bool(message.active); + } + if (message.autoCompoundFactor !== "") { + writer.uint32(122).string(Decimal.fromUserInput(message.autoCompoundFactor, 18).atomics); + } + if (message.flags !== undefined) { + HostChainFlags.encode(message.flags, writer.uint32(130).fork()).ldelim(); + } + if (message.rewardParams !== undefined) { + RewardParams.encode(message.rewardParams, writer.uint32(138).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): HostChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHostChain(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + case 2: + message.connectionId = reader.string(); + break; + case 3: + message.params = HostChainLSParams.decode(reader, reader.uint32(), useInterfaces); + break; + case 4: + message.hostDenom = reader.string(); + break; + case 5: + message.channelId = reader.string(); + break; + case 6: + message.portId = reader.string(); + break; + case 7: + message.delegationAccount = ICAAccount.decode(reader, reader.uint32(), useInterfaces); + break; + case 8: + message.rewardsAccount = ICAAccount.decode(reader, reader.uint32(), useInterfaces); + break; + case 9: + message.validators.push(Validator.decode(reader, reader.uint32(), useInterfaces)); + break; + case 10: + message.minimumDeposit = reader.string(); + break; + case 11: + message.cValue = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 12: + message.lastCValue = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 13: + message.unbondingFactor = reader.int64(); + break; + case 14: + message.active = reader.bool(); + break; + case 15: + message.autoCompoundFactor = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 16: + message.flags = HostChainFlags.decode(reader, reader.uint32(), useInterfaces); + break; + case 17: + message.rewardParams = RewardParams.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): HostChain { + const message = createBaseHostChain(); + message.chainId = object.chainId ?? ""; + message.connectionId = object.connectionId ?? ""; + message.params = object.params !== undefined && object.params !== null ? HostChainLSParams.fromPartial(object.params) : undefined; + message.hostDenom = object.hostDenom ?? ""; + message.channelId = object.channelId ?? ""; + message.portId = object.portId ?? ""; + message.delegationAccount = object.delegationAccount !== undefined && object.delegationAccount !== null ? ICAAccount.fromPartial(object.delegationAccount) : undefined; + message.rewardsAccount = object.rewardsAccount !== undefined && object.rewardsAccount !== null ? ICAAccount.fromPartial(object.rewardsAccount) : undefined; + message.validators = object.validators?.map(e => Validator.fromPartial(e)) || []; + message.minimumDeposit = object.minimumDeposit ?? ""; + message.cValue = object.cValue ?? ""; + message.lastCValue = object.lastCValue ?? ""; + message.unbondingFactor = object.unbondingFactor !== undefined && object.unbondingFactor !== null ? BigInt(object.unbondingFactor.toString()) : BigInt(0); + message.active = object.active ?? false; + message.autoCompoundFactor = object.autoCompoundFactor ?? ""; + message.flags = object.flags !== undefined && object.flags !== null ? HostChainFlags.fromPartial(object.flags) : undefined; + message.rewardParams = object.rewardParams !== undefined && object.rewardParams !== null ? RewardParams.fromPartial(object.rewardParams) : undefined; + return message; + }, + fromAmino(object: HostChainAmino): HostChain { + const message = createBaseHostChain(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.params !== undefined && object.params !== null) { + message.params = HostChainLSParams.fromAmino(object.params); + } + if (object.host_denom !== undefined && object.host_denom !== null) { + message.hostDenom = object.host_denom; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.delegation_account !== undefined && object.delegation_account !== null) { + message.delegationAccount = ICAAccount.fromAmino(object.delegation_account); + } + if (object.rewards_account !== undefined && object.rewards_account !== null) { + message.rewardsAccount = ICAAccount.fromAmino(object.rewards_account); + } + message.validators = object.validators?.map(e => Validator.fromAmino(e)) || []; + if (object.minimum_deposit !== undefined && object.minimum_deposit !== null) { + message.minimumDeposit = object.minimum_deposit; + } + if (object.c_value !== undefined && object.c_value !== null) { + message.cValue = object.c_value; + } + if (object.last_c_value !== undefined && object.last_c_value !== null) { + message.lastCValue = object.last_c_value; + } + if (object.unbonding_factor !== undefined && object.unbonding_factor !== null) { + message.unbondingFactor = BigInt(object.unbonding_factor); + } + if (object.active !== undefined && object.active !== null) { + message.active = object.active; + } + if (object.auto_compound_factor !== undefined && object.auto_compound_factor !== null) { + message.autoCompoundFactor = object.auto_compound_factor; + } + if (object.flags !== undefined && object.flags !== null) { + message.flags = HostChainFlags.fromAmino(object.flags); + } + if (object.reward_params !== undefined && object.reward_params !== null) { + message.rewardParams = RewardParams.fromAmino(object.reward_params); + } + return message; + }, + toAmino(message: HostChain, useInterfaces: boolean = false): HostChainAmino { + const obj: any = {}; + obj.chain_id = message.chainId; + obj.connection_id = message.connectionId; + obj.params = message.params ? HostChainLSParams.toAmino(message.params, useInterfaces) : undefined; + obj.host_denom = message.hostDenom; + obj.channel_id = message.channelId; + obj.port_id = message.portId; + obj.delegation_account = message.delegationAccount ? ICAAccount.toAmino(message.delegationAccount, useInterfaces) : undefined; + obj.rewards_account = message.rewardsAccount ? ICAAccount.toAmino(message.rewardsAccount, useInterfaces) : undefined; + if (message.validators) { + obj.validators = message.validators.map(e => e ? Validator.toAmino(e, useInterfaces) : undefined); + } else { + obj.validators = []; + } + obj.minimum_deposit = message.minimumDeposit; + obj.c_value = message.cValue; + obj.last_c_value = message.lastCValue; + obj.unbonding_factor = message.unbondingFactor ? message.unbondingFactor.toString() : undefined; + obj.active = message.active; + obj.auto_compound_factor = message.autoCompoundFactor; + obj.flags = message.flags ? HostChainFlags.toAmino(message.flags, useInterfaces) : undefined; + obj.reward_params = message.rewardParams ? RewardParams.toAmino(message.rewardParams, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: HostChainAminoMsg): HostChain { + return HostChain.fromAmino(object.value); + }, + fromProtoMsg(message: HostChainProtoMsg, useInterfaces: boolean = false): HostChain { + return HostChain.decode(message.value, undefined, useInterfaces); + }, + toProto(message: HostChain): Uint8Array { + return HostChain.encode(message).finish(); + }, + toProtoMsg(message: HostChain): HostChainProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.HostChain", + value: HostChain.encode(message).finish() + }; + } +}; +function createBaseHostChainFlags(): HostChainFlags { + return { + lsm: false + }; +} +export const HostChainFlags = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.HostChainFlags", + encode(message: HostChainFlags, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.lsm === true) { + writer.uint32(8).bool(message.lsm); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): HostChainFlags { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHostChainFlags(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lsm = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): HostChainFlags { + const message = createBaseHostChainFlags(); + message.lsm = object.lsm ?? false; + return message; + }, + fromAmino(object: HostChainFlagsAmino): HostChainFlags { + const message = createBaseHostChainFlags(); + if (object.lsm !== undefined && object.lsm !== null) { + message.lsm = object.lsm; + } + return message; + }, + toAmino(message: HostChainFlags, useInterfaces: boolean = false): HostChainFlagsAmino { + const obj: any = {}; + obj.lsm = message.lsm; + return obj; + }, + fromAminoMsg(object: HostChainFlagsAminoMsg): HostChainFlags { + return HostChainFlags.fromAmino(object.value); + }, + fromProtoMsg(message: HostChainFlagsProtoMsg, useInterfaces: boolean = false): HostChainFlags { + return HostChainFlags.decode(message.value, undefined, useInterfaces); + }, + toProto(message: HostChainFlags): Uint8Array { + return HostChainFlags.encode(message).finish(); + }, + toProtoMsg(message: HostChainFlags): HostChainFlagsProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.HostChainFlags", + value: HostChainFlags.encode(message).finish() + }; + } +}; +function createBaseRewardParams(): RewardParams { + return { + denom: "", + destination: "" + }; +} +export const RewardParams = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.RewardParams", + encode(message: RewardParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.destination !== "") { + writer.uint32(18).string(message.destination); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): RewardParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRewardParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.destination = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RewardParams { + const message = createBaseRewardParams(); + message.denom = object.denom ?? ""; + message.destination = object.destination ?? ""; + return message; + }, + fromAmino(object: RewardParamsAmino): RewardParams { + const message = createBaseRewardParams(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.destination !== undefined && object.destination !== null) { + message.destination = object.destination; + } + return message; + }, + toAmino(message: RewardParams, useInterfaces: boolean = false): RewardParamsAmino { + const obj: any = {}; + obj.denom = message.denom; + obj.destination = message.destination; + return obj; + }, + fromAminoMsg(object: RewardParamsAminoMsg): RewardParams { + return RewardParams.fromAmino(object.value); + }, + fromProtoMsg(message: RewardParamsProtoMsg, useInterfaces: boolean = false): RewardParams { + return RewardParams.decode(message.value, undefined, useInterfaces); + }, + toProto(message: RewardParams): Uint8Array { + return RewardParams.encode(message).finish(); + }, + toProtoMsg(message: RewardParams): RewardParamsProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.RewardParams", + value: RewardParams.encode(message).finish() + }; + } +}; +function createBaseHostChainLSParams(): HostChainLSParams { + return { + depositFee: "", + restakeFee: "", + unstakeFee: "", + redemptionFee: "", + lsmValidatorCap: "", + lsmBondFactor: "", + maxEntries: 0, + redelegationAcceptableDelta: "", + upperCValueLimit: "", + lowerCValueLimit: "" + }; +} +export const HostChainLSParams = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.HostChainLSParams", + encode(message: HostChainLSParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.depositFee !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.depositFee, 18).atomics); + } + if (message.restakeFee !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.restakeFee, 18).atomics); + } + if (message.unstakeFee !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.unstakeFee, 18).atomics); + } + if (message.redemptionFee !== "") { + writer.uint32(34).string(Decimal.fromUserInput(message.redemptionFee, 18).atomics); + } + if (message.lsmValidatorCap !== "") { + writer.uint32(50).string(Decimal.fromUserInput(message.lsmValidatorCap, 18).atomics); + } + if (message.lsmBondFactor !== "") { + writer.uint32(58).string(Decimal.fromUserInput(message.lsmBondFactor, 18).atomics); + } + if (message.maxEntries !== 0) { + writer.uint32(64).uint32(message.maxEntries); + } + if (message.redelegationAcceptableDelta !== "") { + writer.uint32(74).string(message.redelegationAcceptableDelta); + } + if (message.upperCValueLimit !== "") { + writer.uint32(82).string(Decimal.fromUserInput(message.upperCValueLimit, 18).atomics); + } + if (message.lowerCValueLimit !== "") { + writer.uint32(90).string(Decimal.fromUserInput(message.lowerCValueLimit, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): HostChainLSParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHostChainLSParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.depositFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 2: + message.restakeFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 3: + message.unstakeFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 4: + message.redemptionFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 6: + message.lsmValidatorCap = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 7: + message.lsmBondFactor = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 8: + message.maxEntries = reader.uint32(); + break; + case 9: + message.redelegationAcceptableDelta = reader.string(); + break; + case 10: + message.upperCValueLimit = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 11: + message.lowerCValueLimit = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): HostChainLSParams { + const message = createBaseHostChainLSParams(); + message.depositFee = object.depositFee ?? ""; + message.restakeFee = object.restakeFee ?? ""; + message.unstakeFee = object.unstakeFee ?? ""; + message.redemptionFee = object.redemptionFee ?? ""; + message.lsmValidatorCap = object.lsmValidatorCap ?? ""; + message.lsmBondFactor = object.lsmBondFactor ?? ""; + message.maxEntries = object.maxEntries ?? 0; + message.redelegationAcceptableDelta = object.redelegationAcceptableDelta ?? ""; + message.upperCValueLimit = object.upperCValueLimit ?? ""; + message.lowerCValueLimit = object.lowerCValueLimit ?? ""; + return message; + }, + fromAmino(object: HostChainLSParamsAmino): HostChainLSParams { + const message = createBaseHostChainLSParams(); + if (object.deposit_fee !== undefined && object.deposit_fee !== null) { + message.depositFee = object.deposit_fee; + } + if (object.restake_fee !== undefined && object.restake_fee !== null) { + message.restakeFee = object.restake_fee; + } + if (object.unstake_fee !== undefined && object.unstake_fee !== null) { + message.unstakeFee = object.unstake_fee; + } + if (object.redemption_fee !== undefined && object.redemption_fee !== null) { + message.redemptionFee = object.redemption_fee; + } + if (object.lsm_validator_cap !== undefined && object.lsm_validator_cap !== null) { + message.lsmValidatorCap = object.lsm_validator_cap; + } + if (object.lsm_bond_factor !== undefined && object.lsm_bond_factor !== null) { + message.lsmBondFactor = object.lsm_bond_factor; + } + if (object.max_entries !== undefined && object.max_entries !== null) { + message.maxEntries = object.max_entries; + } + if (object.redelegation_acceptable_delta !== undefined && object.redelegation_acceptable_delta !== null) { + message.redelegationAcceptableDelta = object.redelegation_acceptable_delta; + } + if (object.upper_c_value_limit !== undefined && object.upper_c_value_limit !== null) { + message.upperCValueLimit = object.upper_c_value_limit; + } + if (object.lower_c_value_limit !== undefined && object.lower_c_value_limit !== null) { + message.lowerCValueLimit = object.lower_c_value_limit; + } + return message; + }, + toAmino(message: HostChainLSParams, useInterfaces: boolean = false): HostChainLSParamsAmino { + const obj: any = {}; + obj.deposit_fee = message.depositFee; + obj.restake_fee = message.restakeFee; + obj.unstake_fee = message.unstakeFee; + obj.redemption_fee = message.redemptionFee; + obj.lsm_validator_cap = message.lsmValidatorCap; + obj.lsm_bond_factor = message.lsmBondFactor; + obj.max_entries = message.maxEntries; + obj.redelegation_acceptable_delta = message.redelegationAcceptableDelta; + obj.upper_c_value_limit = message.upperCValueLimit; + obj.lower_c_value_limit = message.lowerCValueLimit; + return obj; + }, + fromAminoMsg(object: HostChainLSParamsAminoMsg): HostChainLSParams { + return HostChainLSParams.fromAmino(object.value); + }, + fromProtoMsg(message: HostChainLSParamsProtoMsg, useInterfaces: boolean = false): HostChainLSParams { + return HostChainLSParams.decode(message.value, undefined, useInterfaces); + }, + toProto(message: HostChainLSParams): Uint8Array { + return HostChainLSParams.encode(message).finish(); + }, + toProtoMsg(message: HostChainLSParams): HostChainLSParamsProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.HostChainLSParams", + value: HostChainLSParams.encode(message).finish() + }; + } +}; +function createBaseICAAccount(): ICAAccount { + return { + address: "", + balance: Coin.fromPartial({}), + owner: "", + channelState: 0 + }; +} +export const ICAAccount = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.ICAAccount", + encode(message: ICAAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(18).fork()).ldelim(); + } + if (message.owner !== "") { + writer.uint32(26).string(message.owner); + } + if (message.channelState !== 0) { + writer.uint32(32).int32(message.channelState); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ICAAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseICAAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.balance = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.owner = reader.string(); + break; + case 4: + message.channelState = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ICAAccount { + const message = createBaseICAAccount(); + message.address = object.address ?? ""; + message.balance = object.balance !== undefined && object.balance !== null ? Coin.fromPartial(object.balance) : undefined; + message.owner = object.owner ?? ""; + message.channelState = object.channelState ?? 0; + return message; + }, + fromAmino(object: ICAAccountAmino): ICAAccount { + const message = createBaseICAAccount(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.channel_state !== undefined && object.channel_state !== null) { + message.channelState = iCAAccount_ChannelStateFromJSON(object.channel_state); + } + return message; + }, + toAmino(message: ICAAccount, useInterfaces: boolean = false): ICAAccountAmino { + const obj: any = {}; + obj.address = message.address; + obj.balance = message.balance ? Coin.toAmino(message.balance, useInterfaces) : undefined; + obj.owner = message.owner; + obj.channel_state = message.channelState; + return obj; + }, + fromAminoMsg(object: ICAAccountAminoMsg): ICAAccount { + return ICAAccount.fromAmino(object.value); + }, + fromProtoMsg(message: ICAAccountProtoMsg, useInterfaces: boolean = false): ICAAccount { + return ICAAccount.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ICAAccount): Uint8Array { + return ICAAccount.encode(message).finish(); + }, + toProtoMsg(message: ICAAccount): ICAAccountProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.ICAAccount", + value: ICAAccount.encode(message).finish() + }; + } +}; +function createBaseValidator(): Validator { + return { + operatorAddress: "", + status: "", + weight: "", + delegatedAmount: "", + exchangeRate: "", + unbondingEpoch: BigInt(0), + delegable: false + }; +} +export const Validator = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.Validator", + encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.operatorAddress !== "") { + writer.uint32(10).string(message.operatorAddress); + } + if (message.status !== "") { + writer.uint32(18).string(message.status); + } + if (message.weight !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.weight, 18).atomics); + } + if (message.delegatedAmount !== "") { + writer.uint32(34).string(message.delegatedAmount); + } + if (message.exchangeRate !== "") { + writer.uint32(42).string(Decimal.fromUserInput(message.exchangeRate, 18).atomics); + } + if (message.unbondingEpoch !== BigInt(0)) { + writer.uint32(48).int64(message.unbondingEpoch); + } + if (message.delegable === true) { + writer.uint32(56).bool(message.delegable); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Validator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operatorAddress = reader.string(); + break; + case 2: + message.status = reader.string(); + break; + case 3: + message.weight = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 4: + message.delegatedAmount = reader.string(); + break; + case 5: + message.exchangeRate = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 6: + message.unbondingEpoch = reader.int64(); + break; + case 7: + message.delegable = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Validator { + const message = createBaseValidator(); + message.operatorAddress = object.operatorAddress ?? ""; + message.status = object.status ?? ""; + message.weight = object.weight ?? ""; + message.delegatedAmount = object.delegatedAmount ?? ""; + message.exchangeRate = object.exchangeRate ?? ""; + message.unbondingEpoch = object.unbondingEpoch !== undefined && object.unbondingEpoch !== null ? BigInt(object.unbondingEpoch.toString()) : BigInt(0); + message.delegable = object.delegable ?? false; + return message; + }, + fromAmino(object: ValidatorAmino): Validator { + const message = createBaseValidator(); + if (object.operator_address !== undefined && object.operator_address !== null) { + message.operatorAddress = object.operator_address; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + if (object.delegated_amount !== undefined && object.delegated_amount !== null) { + message.delegatedAmount = object.delegated_amount; + } + if (object.exchange_rate !== undefined && object.exchange_rate !== null) { + message.exchangeRate = object.exchange_rate; + } + if (object.unbonding_epoch !== undefined && object.unbonding_epoch !== null) { + message.unbondingEpoch = BigInt(object.unbonding_epoch); + } + if (object.delegable !== undefined && object.delegable !== null) { + message.delegable = object.delegable; + } + return message; + }, + toAmino(message: Validator, useInterfaces: boolean = false): ValidatorAmino { + const obj: any = {}; + obj.operator_address = message.operatorAddress; + obj.status = message.status; + obj.weight = message.weight; + obj.delegated_amount = message.delegatedAmount; + obj.exchange_rate = message.exchangeRate; + obj.unbonding_epoch = message.unbondingEpoch ? message.unbondingEpoch.toString() : undefined; + obj.delegable = message.delegable; + return obj; + }, + fromAminoMsg(object: ValidatorAminoMsg): Validator { + return Validator.fromAmino(object.value); + }, + fromProtoMsg(message: ValidatorProtoMsg, useInterfaces: boolean = false): Validator { + return Validator.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Validator): Uint8Array { + return Validator.encode(message).finish(); + }, + toProtoMsg(message: Validator): ValidatorProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.Validator", + value: Validator.encode(message).finish() + }; + } +}; +function createBaseDeposit(): Deposit { + return { + chainId: "", + amount: Coin.fromPartial({}), + epoch: BigInt(0), + state: 0, + ibcSequenceId: "" + }; +} +export const Deposit = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.Deposit", + encode(message: Deposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + if (message.epoch !== BigInt(0)) { + writer.uint32(24).int64(message.epoch); + } + if (message.state !== 0) { + writer.uint32(32).int32(message.state); + } + if (message.ibcSequenceId !== "") { + writer.uint32(42).string(message.ibcSequenceId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Deposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeposit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.epoch = reader.int64(); + break; + case 4: + message.state = (reader.int32() as any); + break; + case 5: + message.ibcSequenceId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Deposit { + const message = createBaseDeposit(); + message.chainId = object.chainId ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + message.epoch = object.epoch !== undefined && object.epoch !== null ? BigInt(object.epoch.toString()) : BigInt(0); + message.state = object.state ?? 0; + message.ibcSequenceId = object.ibcSequenceId ?? ""; + return message; + }, + fromAmino(object: DepositAmino): Deposit { + const message = createBaseDeposit(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + if (object.epoch !== undefined && object.epoch !== null) { + message.epoch = BigInt(object.epoch); + } + if (object.state !== undefined && object.state !== null) { + message.state = deposit_DepositStateFromJSON(object.state); + } + if (object.ibc_sequence_id !== undefined && object.ibc_sequence_id !== null) { + message.ibcSequenceId = object.ibc_sequence_id; + } + return message; + }, + toAmino(message: Deposit, useInterfaces: boolean = false): DepositAmino { + const obj: any = {}; + obj.chain_id = message.chainId; + obj.amount = message.amount ? Coin.toAmino(message.amount, useInterfaces) : undefined; + obj.epoch = message.epoch ? message.epoch.toString() : undefined; + obj.state = message.state; + obj.ibc_sequence_id = message.ibcSequenceId; + return obj; + }, + fromAminoMsg(object: DepositAminoMsg): Deposit { + return Deposit.fromAmino(object.value); + }, + fromProtoMsg(message: DepositProtoMsg, useInterfaces: boolean = false): Deposit { + return Deposit.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Deposit): Uint8Array { + return Deposit.encode(message).finish(); + }, + toProtoMsg(message: Deposit): DepositProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.Deposit", + value: Deposit.encode(message).finish() + }; + } +}; +function createBaseLSMDeposit(): LSMDeposit { + return { + chainId: "", + amount: "", + shares: "", + denom: "", + ibcDenom: "", + delegatorAddress: "", + state: 0, + ibcSequenceId: "" + }; +} +export const LSMDeposit = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.LSMDeposit", + encode(message: LSMDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + if (message.shares !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.shares, 18).atomics); + } + if (message.denom !== "") { + writer.uint32(34).string(message.denom); + } + if (message.ibcDenom !== "") { + writer.uint32(42).string(message.ibcDenom); + } + if (message.delegatorAddress !== "") { + writer.uint32(50).string(message.delegatorAddress); + } + if (message.state !== 0) { + writer.uint32(56).int32(message.state); + } + if (message.ibcSequenceId !== "") { + writer.uint32(66).string(message.ibcSequenceId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): LSMDeposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLSMDeposit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + case 3: + message.shares = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 4: + message.denom = reader.string(); + break; + case 5: + message.ibcDenom = reader.string(); + break; + case 6: + message.delegatorAddress = reader.string(); + break; + case 7: + message.state = (reader.int32() as any); + break; + case 8: + message.ibcSequenceId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LSMDeposit { + const message = createBaseLSMDeposit(); + message.chainId = object.chainId ?? ""; + message.amount = object.amount ?? ""; + message.shares = object.shares ?? ""; + message.denom = object.denom ?? ""; + message.ibcDenom = object.ibcDenom ?? ""; + message.delegatorAddress = object.delegatorAddress ?? ""; + message.state = object.state ?? 0; + message.ibcSequenceId = object.ibcSequenceId ?? ""; + return message; + }, + fromAmino(object: LSMDepositAmino): LSMDeposit { + const message = createBaseLSMDeposit(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } + if (object.shares !== undefined && object.shares !== null) { + message.shares = object.shares; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.ibc_denom !== undefined && object.ibc_denom !== null) { + message.ibcDenom = object.ibc_denom; + } + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.state !== undefined && object.state !== null) { + message.state = lSMDeposit_LSMDepositStateFromJSON(object.state); + } + if (object.ibc_sequence_id !== undefined && object.ibc_sequence_id !== null) { + message.ibcSequenceId = object.ibc_sequence_id; + } + return message; + }, + toAmino(message: LSMDeposit, useInterfaces: boolean = false): LSMDepositAmino { + const obj: any = {}; + obj.chain_id = message.chainId; + obj.amount = message.amount; + obj.shares = message.shares; + obj.denom = message.denom; + obj.ibc_denom = message.ibcDenom; + obj.delegator_address = message.delegatorAddress; + obj.state = message.state; + obj.ibc_sequence_id = message.ibcSequenceId; + return obj; + }, + fromAminoMsg(object: LSMDepositAminoMsg): LSMDeposit { + return LSMDeposit.fromAmino(object.value); + }, + fromProtoMsg(message: LSMDepositProtoMsg, useInterfaces: boolean = false): LSMDeposit { + return LSMDeposit.decode(message.value, undefined, useInterfaces); + }, + toProto(message: LSMDeposit): Uint8Array { + return LSMDeposit.encode(message).finish(); + }, + toProtoMsg(message: LSMDeposit): LSMDepositProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.LSMDeposit", + value: LSMDeposit.encode(message).finish() + }; + } +}; +function createBaseUnbonding(): Unbonding { + return { + chainId: "", + epochNumber: BigInt(0), + matureTime: new Date(), + burnAmount: Coin.fromPartial({}), + unbondAmount: Coin.fromPartial({}), + ibcSequenceId: "", + state: 0 + }; +} +export const Unbonding = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.Unbonding", + encode(message: Unbonding, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + if (message.epochNumber !== BigInt(0)) { + writer.uint32(16).int64(message.epochNumber); + } + if (message.matureTime !== undefined) { + Timestamp.encode(toTimestamp(message.matureTime), writer.uint32(26).fork()).ldelim(); + } + if (message.burnAmount !== undefined) { + Coin.encode(message.burnAmount, writer.uint32(34).fork()).ldelim(); + } + if (message.unbondAmount !== undefined) { + Coin.encode(message.unbondAmount, writer.uint32(42).fork()).ldelim(); + } + if (message.ibcSequenceId !== "") { + writer.uint32(50).string(message.ibcSequenceId); + } + if (message.state !== 0) { + writer.uint32(56).int32(message.state); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Unbonding { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnbonding(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + case 2: + message.epochNumber = reader.int64(); + break; + case 3: + message.matureTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 4: + message.burnAmount = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + case 5: + message.unbondAmount = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + case 6: + message.ibcSequenceId = reader.string(); + break; + case 7: + message.state = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Unbonding { + const message = createBaseUnbonding(); + message.chainId = object.chainId ?? ""; + message.epochNumber = object.epochNumber !== undefined && object.epochNumber !== null ? BigInt(object.epochNumber.toString()) : BigInt(0); + message.matureTime = object.matureTime ?? undefined; + message.burnAmount = object.burnAmount !== undefined && object.burnAmount !== null ? Coin.fromPartial(object.burnAmount) : undefined; + message.unbondAmount = object.unbondAmount !== undefined && object.unbondAmount !== null ? Coin.fromPartial(object.unbondAmount) : undefined; + message.ibcSequenceId = object.ibcSequenceId ?? ""; + message.state = object.state ?? 0; + return message; + }, + fromAmino(object: UnbondingAmino): Unbonding { + const message = createBaseUnbonding(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.epoch_number !== undefined && object.epoch_number !== null) { + message.epochNumber = BigInt(object.epoch_number); + } + if (object.mature_time !== undefined && object.mature_time !== null) { + message.matureTime = fromTimestamp(Timestamp.fromAmino(object.mature_time)); + } + if (object.burn_amount !== undefined && object.burn_amount !== null) { + message.burnAmount = Coin.fromAmino(object.burn_amount); + } + if (object.unbond_amount !== undefined && object.unbond_amount !== null) { + message.unbondAmount = Coin.fromAmino(object.unbond_amount); + } + if (object.ibc_sequence_id !== undefined && object.ibc_sequence_id !== null) { + message.ibcSequenceId = object.ibc_sequence_id; + } + if (object.state !== undefined && object.state !== null) { + message.state = unbonding_UnbondingStateFromJSON(object.state); + } + return message; + }, + toAmino(message: Unbonding, useInterfaces: boolean = false): UnbondingAmino { + const obj: any = {}; + obj.chain_id = message.chainId; + obj.epoch_number = message.epochNumber ? message.epochNumber.toString() : undefined; + obj.mature_time = message.matureTime ? Timestamp.toAmino(toTimestamp(message.matureTime)) : undefined; + obj.burn_amount = message.burnAmount ? Coin.toAmino(message.burnAmount, useInterfaces) : undefined; + obj.unbond_amount = message.unbondAmount ? Coin.toAmino(message.unbondAmount, useInterfaces) : undefined; + obj.ibc_sequence_id = message.ibcSequenceId; + obj.state = message.state; + return obj; + }, + fromAminoMsg(object: UnbondingAminoMsg): Unbonding { + return Unbonding.fromAmino(object.value); + }, + fromProtoMsg(message: UnbondingProtoMsg, useInterfaces: boolean = false): Unbonding { + return Unbonding.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Unbonding): Uint8Array { + return Unbonding.encode(message).finish(); + }, + toProtoMsg(message: Unbonding): UnbondingProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.Unbonding", + value: Unbonding.encode(message).finish() + }; + } +}; +function createBaseUserUnbonding(): UserUnbonding { + return { + chainId: "", + epochNumber: BigInt(0), + address: "", + stkAmount: Coin.fromPartial({}), + unbondAmount: Coin.fromPartial({}) + }; +} +export const UserUnbonding = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.UserUnbonding", + encode(message: UserUnbonding, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + if (message.epochNumber !== BigInt(0)) { + writer.uint32(16).int64(message.epochNumber); + } + if (message.address !== "") { + writer.uint32(26).string(message.address); + } + if (message.stkAmount !== undefined) { + Coin.encode(message.stkAmount, writer.uint32(34).fork()).ldelim(); + } + if (message.unbondAmount !== undefined) { + Coin.encode(message.unbondAmount, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): UserUnbonding { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUserUnbonding(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + case 2: + message.epochNumber = reader.int64(); + break; + case 3: + message.address = reader.string(); + break; + case 4: + message.stkAmount = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + case 5: + message.unbondAmount = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UserUnbonding { + const message = createBaseUserUnbonding(); + message.chainId = object.chainId ?? ""; + message.epochNumber = object.epochNumber !== undefined && object.epochNumber !== null ? BigInt(object.epochNumber.toString()) : BigInt(0); + message.address = object.address ?? ""; + message.stkAmount = object.stkAmount !== undefined && object.stkAmount !== null ? Coin.fromPartial(object.stkAmount) : undefined; + message.unbondAmount = object.unbondAmount !== undefined && object.unbondAmount !== null ? Coin.fromPartial(object.unbondAmount) : undefined; + return message; + }, + fromAmino(object: UserUnbondingAmino): UserUnbonding { + const message = createBaseUserUnbonding(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.epoch_number !== undefined && object.epoch_number !== null) { + message.epochNumber = BigInt(object.epoch_number); + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.stk_amount !== undefined && object.stk_amount !== null) { + message.stkAmount = Coin.fromAmino(object.stk_amount); + } + if (object.unbond_amount !== undefined && object.unbond_amount !== null) { + message.unbondAmount = Coin.fromAmino(object.unbond_amount); + } + return message; + }, + toAmino(message: UserUnbonding, useInterfaces: boolean = false): UserUnbondingAmino { + const obj: any = {}; + obj.chain_id = message.chainId; + obj.epoch_number = message.epochNumber ? message.epochNumber.toString() : undefined; + obj.address = message.address; + obj.stk_amount = message.stkAmount ? Coin.toAmino(message.stkAmount, useInterfaces) : undefined; + obj.unbond_amount = message.unbondAmount ? Coin.toAmino(message.unbondAmount, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: UserUnbondingAminoMsg): UserUnbonding { + return UserUnbonding.fromAmino(object.value); + }, + fromProtoMsg(message: UserUnbondingProtoMsg, useInterfaces: boolean = false): UserUnbonding { + return UserUnbonding.decode(message.value, undefined, useInterfaces); + }, + toProto(message: UserUnbonding): Uint8Array { + return UserUnbonding.encode(message).finish(); + }, + toProtoMsg(message: UserUnbonding): UserUnbondingProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.UserUnbonding", + value: UserUnbonding.encode(message).finish() + }; + } +}; +function createBaseValidatorUnbonding(): ValidatorUnbonding { + return { + chainId: "", + epochNumber: BigInt(0), + matureTime: new Date(), + validatorAddress: "", + amount: Coin.fromPartial({}), + ibcSequenceId: "" + }; +} +export const ValidatorUnbonding = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.ValidatorUnbonding", + encode(message: ValidatorUnbonding, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + if (message.epochNumber !== BigInt(0)) { + writer.uint32(16).int64(message.epochNumber); + } + if (message.matureTime !== undefined) { + Timestamp.encode(toTimestamp(message.matureTime), writer.uint32(26).fork()).ldelim(); + } + if (message.validatorAddress !== "") { + writer.uint32(34).string(message.validatorAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(42).fork()).ldelim(); + } + if (message.ibcSequenceId !== "") { + writer.uint32(50).string(message.ibcSequenceId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ValidatorUnbonding { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorUnbonding(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + case 2: + message.epochNumber = reader.int64(); + break; + case 3: + message.matureTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 4: + message.validatorAddress = reader.string(); + break; + case 5: + message.amount = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + case 6: + message.ibcSequenceId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ValidatorUnbonding { + const message = createBaseValidatorUnbonding(); + message.chainId = object.chainId ?? ""; + message.epochNumber = object.epochNumber !== undefined && object.epochNumber !== null ? BigInt(object.epochNumber.toString()) : BigInt(0); + message.matureTime = object.matureTime ?? undefined; + message.validatorAddress = object.validatorAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + message.ibcSequenceId = object.ibcSequenceId ?? ""; + return message; + }, + fromAmino(object: ValidatorUnbondingAmino): ValidatorUnbonding { + const message = createBaseValidatorUnbonding(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.epoch_number !== undefined && object.epoch_number !== null) { + message.epochNumber = BigInt(object.epoch_number); + } + if (object.mature_time !== undefined && object.mature_time !== null) { + message.matureTime = fromTimestamp(Timestamp.fromAmino(object.mature_time)); + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + if (object.ibc_sequence_id !== undefined && object.ibc_sequence_id !== null) { + message.ibcSequenceId = object.ibc_sequence_id; + } + return message; + }, + toAmino(message: ValidatorUnbonding, useInterfaces: boolean = false): ValidatorUnbondingAmino { + const obj: any = {}; + obj.chain_id = message.chainId; + obj.epoch_number = message.epochNumber ? message.epochNumber.toString() : undefined; + obj.mature_time = message.matureTime ? Timestamp.toAmino(toTimestamp(message.matureTime)) : undefined; + obj.validator_address = message.validatorAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount, useInterfaces) : undefined; + obj.ibc_sequence_id = message.ibcSequenceId; + return obj; + }, + fromAminoMsg(object: ValidatorUnbondingAminoMsg): ValidatorUnbonding { + return ValidatorUnbonding.fromAmino(object.value); + }, + fromProtoMsg(message: ValidatorUnbondingProtoMsg, useInterfaces: boolean = false): ValidatorUnbonding { + return ValidatorUnbonding.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ValidatorUnbonding): Uint8Array { + return ValidatorUnbonding.encode(message).finish(); + }, + toProtoMsg(message: ValidatorUnbonding): ValidatorUnbondingProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.ValidatorUnbonding", + value: ValidatorUnbonding.encode(message).finish() + }; + } +}; +function createBaseKVUpdate(): KVUpdate { + return { + key: "", + value: "" + }; +} +export const KVUpdate = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.KVUpdate", + encode(message: KVUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): KVUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseKVUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): KVUpdate { + const message = createBaseKVUpdate(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, + fromAmino(object: KVUpdateAmino): KVUpdate { + const message = createBaseKVUpdate(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } + return message; + }, + toAmino(message: KVUpdate, useInterfaces: boolean = false): KVUpdateAmino { + const obj: any = {}; + obj.key = message.key; + obj.value = message.value; + return obj; + }, + fromAminoMsg(object: KVUpdateAminoMsg): KVUpdate { + return KVUpdate.fromAmino(object.value); + }, + fromProtoMsg(message: KVUpdateProtoMsg, useInterfaces: boolean = false): KVUpdate { + return KVUpdate.decode(message.value, undefined, useInterfaces); + }, + toProto(message: KVUpdate): Uint8Array { + return KVUpdate.encode(message).finish(); + }, + toProtoMsg(message: KVUpdate): KVUpdateProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.KVUpdate", + value: KVUpdate.encode(message).finish() + }; + } +}; +function createBaseRedelegations(): Redelegations { + return { + chainID: "", + redelegations: [] + }; +} +export const Redelegations = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.Redelegations", + encode(message: Redelegations, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainID !== "") { + writer.uint32(10).string(message.chainID); + } + for (const v of message.redelegations) { + Redelegation.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Redelegations { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRedelegations(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainID = reader.string(); + break; + case 2: + message.redelegations.push(Redelegation.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Redelegations { + const message = createBaseRedelegations(); + message.chainID = object.chainID ?? ""; + message.redelegations = object.redelegations?.map(e => Redelegation.fromPartial(e)) || []; + return message; + }, + fromAmino(object: RedelegationsAmino): Redelegations { + const message = createBaseRedelegations(); + if (object.chain_i_d !== undefined && object.chain_i_d !== null) { + message.chainID = object.chain_i_d; + } + message.redelegations = object.redelegations?.map(e => Redelegation.fromAmino(e)) || []; + return message; + }, + toAmino(message: Redelegations, useInterfaces: boolean = false): RedelegationsAmino { + const obj: any = {}; + obj.chain_i_d = message.chainID; + if (message.redelegations) { + obj.redelegations = message.redelegations.map(e => e ? Redelegation.toAmino(e, useInterfaces) : undefined); + } else { + obj.redelegations = []; + } + return obj; + }, + fromAminoMsg(object: RedelegationsAminoMsg): Redelegations { + return Redelegations.fromAmino(object.value); + }, + fromProtoMsg(message: RedelegationsProtoMsg, useInterfaces: boolean = false): Redelegations { + return Redelegations.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Redelegations): Uint8Array { + return Redelegations.encode(message).finish(); + }, + toProtoMsg(message: Redelegations): RedelegationsProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.Redelegations", + value: Redelegations.encode(message).finish() + }; + } +}; +function createBaseRedelegateTx(): RedelegateTx { + return { + chainId: "", + ibcSequenceId: "", + state: 0 + }; +} +export const RedelegateTx = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.RedelegateTx", + encode(message: RedelegateTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + if (message.ibcSequenceId !== "") { + writer.uint32(18).string(message.ibcSequenceId); + } + if (message.state !== 0) { + writer.uint32(24).int32(message.state); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): RedelegateTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRedelegateTx(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + case 2: + message.ibcSequenceId = reader.string(); + break; + case 3: + message.state = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RedelegateTx { + const message = createBaseRedelegateTx(); + message.chainId = object.chainId ?? ""; + message.ibcSequenceId = object.ibcSequenceId ?? ""; + message.state = object.state ?? 0; + return message; + }, + fromAmino(object: RedelegateTxAmino): RedelegateTx { + const message = createBaseRedelegateTx(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.ibc_sequence_id !== undefined && object.ibc_sequence_id !== null) { + message.ibcSequenceId = object.ibc_sequence_id; + } + if (object.state !== undefined && object.state !== null) { + message.state = redelegateTx_RedelegateTxStateFromJSON(object.state); + } + return message; + }, + toAmino(message: RedelegateTx, useInterfaces: boolean = false): RedelegateTxAmino { + const obj: any = {}; + obj.chain_id = message.chainId; + obj.ibc_sequence_id = message.ibcSequenceId; + obj.state = message.state; + return obj; + }, + fromAminoMsg(object: RedelegateTxAminoMsg): RedelegateTx { + return RedelegateTx.fromAmino(object.value); + }, + fromProtoMsg(message: RedelegateTxProtoMsg, useInterfaces: boolean = false): RedelegateTx { + return RedelegateTx.decode(message.value, undefined, useInterfaces); + }, + toProto(message: RedelegateTx): Uint8Array { + return RedelegateTx.encode(message).finish(); + }, + toProtoMsg(message: RedelegateTx): RedelegateTxProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.RedelegateTx", + value: RedelegateTx.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/msgs.amino.ts b/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/msgs.amino.ts new file mode 100644 index 000000000..4d83c151d --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/msgs.amino.ts @@ -0,0 +1,38 @@ +import { MsgRegisterHostChain, MsgUpdateHostChain, MsgLiquidStake, MsgLiquidStakeLSM, MsgLiquidUnstake, MsgRedeem, MsgUpdateParams } from "./msgs"; +export const AminoConverter = { + "/pstake.liquidstakeibc.v1beta1.MsgRegisterHostChain": { + aminoType: "pstake/MsgRegisterHostChain", + toAmino: MsgRegisterHostChain.toAmino, + fromAmino: MsgRegisterHostChain.fromAmino + }, + "/pstake.liquidstakeibc.v1beta1.MsgUpdateHostChain": { + aminoType: "pstake/MsgUpdateHostChain", + toAmino: MsgUpdateHostChain.toAmino, + fromAmino: MsgUpdateHostChain.fromAmino + }, + "/pstake.liquidstakeibc.v1beta1.MsgLiquidStake": { + aminoType: "pstake/MsgLiquidStake", + toAmino: MsgLiquidStake.toAmino, + fromAmino: MsgLiquidStake.fromAmino + }, + "/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeLSM": { + aminoType: "pstake/MsgLiquidStakeLSM", + toAmino: MsgLiquidStakeLSM.toAmino, + fromAmino: MsgLiquidStakeLSM.fromAmino + }, + "/pstake.liquidstakeibc.v1beta1.MsgLiquidUnstake": { + aminoType: "pstake/MsgLiquidUnstake", + toAmino: MsgLiquidUnstake.toAmino, + fromAmino: MsgLiquidUnstake.fromAmino + }, + "/pstake.liquidstakeibc.v1beta1.MsgRedeem": { + aminoType: "pstake/MsgRedeem", + toAmino: MsgRedeem.toAmino, + fromAmino: MsgRedeem.fromAmino + }, + "/pstake.liquidstakeibc.v1beta1.MsgUpdateParams": { + aminoType: "pstake/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/msgs.registry.ts b/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/msgs.registry.ts new file mode 100644 index 000000000..ca1ff2d76 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/msgs.registry.ts @@ -0,0 +1,143 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgRegisterHostChain, MsgUpdateHostChain, MsgLiquidStake, MsgLiquidStakeLSM, MsgLiquidUnstake, MsgRedeem, MsgUpdateParams } from "./msgs"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/pstake.liquidstakeibc.v1beta1.MsgRegisterHostChain", MsgRegisterHostChain], ["/pstake.liquidstakeibc.v1beta1.MsgUpdateHostChain", MsgUpdateHostChain], ["/pstake.liquidstakeibc.v1beta1.MsgLiquidStake", MsgLiquidStake], ["/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeLSM", MsgLiquidStakeLSM], ["/pstake.liquidstakeibc.v1beta1.MsgLiquidUnstake", MsgLiquidUnstake], ["/pstake.liquidstakeibc.v1beta1.MsgRedeem", MsgRedeem], ["/pstake.liquidstakeibc.v1beta1.MsgUpdateParams", MsgUpdateParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + registerHostChain(value: MsgRegisterHostChain) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRegisterHostChain", + value: MsgRegisterHostChain.encode(value).finish() + }; + }, + updateHostChain(value: MsgUpdateHostChain) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateHostChain", + value: MsgUpdateHostChain.encode(value).finish() + }; + }, + liquidStake(value: MsgLiquidStake) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStake", + value: MsgLiquidStake.encode(value).finish() + }; + }, + liquidStakeLSM(value: MsgLiquidStakeLSM) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeLSM", + value: MsgLiquidStakeLSM.encode(value).finish() + }; + }, + liquidUnstake(value: MsgLiquidUnstake) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidUnstake", + value: MsgLiquidUnstake.encode(value).finish() + }; + }, + redeem(value: MsgRedeem) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRedeem", + value: MsgRedeem.encode(value).finish() + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + registerHostChain(value: MsgRegisterHostChain) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRegisterHostChain", + value + }; + }, + updateHostChain(value: MsgUpdateHostChain) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateHostChain", + value + }; + }, + liquidStake(value: MsgLiquidStake) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStake", + value + }; + }, + liquidStakeLSM(value: MsgLiquidStakeLSM) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeLSM", + value + }; + }, + liquidUnstake(value: MsgLiquidUnstake) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidUnstake", + value + }; + }, + redeem(value: MsgRedeem) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRedeem", + value + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateParams", + value + }; + } + }, + fromPartial: { + registerHostChain(value: MsgRegisterHostChain) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRegisterHostChain", + value: MsgRegisterHostChain.fromPartial(value) + }; + }, + updateHostChain(value: MsgUpdateHostChain) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateHostChain", + value: MsgUpdateHostChain.fromPartial(value) + }; + }, + liquidStake(value: MsgLiquidStake) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStake", + value: MsgLiquidStake.fromPartial(value) + }; + }, + liquidStakeLSM(value: MsgLiquidStakeLSM) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeLSM", + value: MsgLiquidStakeLSM.fromPartial(value) + }; + }, + liquidUnstake(value: MsgLiquidUnstake) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidUnstake", + value: MsgLiquidUnstake.fromPartial(value) + }; + }, + redeem(value: MsgRedeem) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRedeem", + value: MsgRedeem.fromPartial(value) + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/msgs.rpc.msg.ts b/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/msgs.rpc.msg.ts new file mode 100644 index 000000000..88fd1342c --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/msgs.rpc.msg.ts @@ -0,0 +1,61 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgRegisterHostChain, MsgRegisterHostChainResponse, MsgUpdateHostChain, MsgUpdateHostChainResponse, MsgLiquidStake, MsgLiquidStakeResponse, MsgLiquidStakeLSM, MsgLiquidStakeLSMResponse, MsgLiquidUnstake, MsgLiquidUnstakeResponse, MsgRedeem, MsgRedeemResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./msgs"; +/** Msg defines the liquidstakeibc services. */ +export interface Msg { + registerHostChain(request: MsgRegisterHostChain): Promise; + updateHostChain(request: MsgUpdateHostChain): Promise; + liquidStake(request: MsgLiquidStake): Promise; + liquidStakeLSM(request: MsgLiquidStakeLSM): Promise; + liquidUnstake(request: MsgLiquidUnstake): Promise; + redeem(request: MsgRedeem): Promise; + updateParams(request: MsgUpdateParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.registerHostChain = this.registerHostChain.bind(this); + this.updateHostChain = this.updateHostChain.bind(this); + this.liquidStake = this.liquidStake.bind(this); + this.liquidStakeLSM = this.liquidStakeLSM.bind(this); + this.liquidUnstake = this.liquidUnstake.bind(this); + this.redeem = this.redeem.bind(this); + this.updateParams = this.updateParams.bind(this); + } + registerHostChain(request: MsgRegisterHostChain, useInterfaces: boolean = true): Promise { + const data = MsgRegisterHostChain.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Msg", "RegisterHostChain", data); + return promise.then(data => MsgRegisterHostChainResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + updateHostChain(request: MsgUpdateHostChain, useInterfaces: boolean = true): Promise { + const data = MsgUpdateHostChain.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Msg", "UpdateHostChain", data); + return promise.then(data => MsgUpdateHostChainResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + liquidStake(request: MsgLiquidStake, useInterfaces: boolean = true): Promise { + const data = MsgLiquidStake.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Msg", "LiquidStake", data); + return promise.then(data => MsgLiquidStakeResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + liquidStakeLSM(request: MsgLiquidStakeLSM, useInterfaces: boolean = true): Promise { + const data = MsgLiquidStakeLSM.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Msg", "LiquidStakeLSM", data); + return promise.then(data => MsgLiquidStakeLSMResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + liquidUnstake(request: MsgLiquidUnstake, useInterfaces: boolean = true): Promise { + const data = MsgLiquidUnstake.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Msg", "LiquidUnstake", data); + return promise.then(data => MsgLiquidUnstakeResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + redeem(request: MsgRedeem, useInterfaces: boolean = true): Promise { + const data = MsgRedeem.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Msg", "Redeem", data); + return promise.then(data => MsgRedeemResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + updateParams(request: MsgUpdateParams, useInterfaces: boolean = true): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/msgs.ts b/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/msgs.ts new file mode 100644 index 000000000..51b81be0e --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/msgs.ts @@ -0,0 +1,1312 @@ +import { KVUpdate, KVUpdateAmino, KVUpdateSDKType } from "./liquidstakeibc"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +export interface MsgRegisterHostChain { + /** authority is the address of the governance account */ + authority: string; + connectionId: string; + depositFee: string; + restakeFee: string; + unstakeFee: string; + redemptionFee: string; + channelId: string; + portId: string; + hostDenom: string; + minimumDeposit: string; + unbondingFactor: bigint; + autoCompoundFactor: bigint; +} +export interface MsgRegisterHostChainProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRegisterHostChain"; + value: Uint8Array; +} +export interface MsgRegisterHostChainAmino { + /** authority is the address of the governance account */ + authority?: string; + connection_id?: string; + deposit_fee?: string; + restake_fee?: string; + unstake_fee?: string; + redemption_fee?: string; + channel_id?: string; + port_id?: string; + host_denom?: string; + minimum_deposit?: string; + unbonding_factor?: string; + auto_compound_factor?: string; +} +export interface MsgRegisterHostChainAminoMsg { + type: "pstake/MsgRegisterHostChain"; + value: MsgRegisterHostChainAmino; +} +export interface MsgRegisterHostChainSDKType { + authority: string; + connection_id: string; + deposit_fee: string; + restake_fee: string; + unstake_fee: string; + redemption_fee: string; + channel_id: string; + port_id: string; + host_denom: string; + minimum_deposit: string; + unbonding_factor: bigint; + auto_compound_factor: bigint; +} +export interface MsgRegisterHostChainResponse {} +export interface MsgRegisterHostChainResponseProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRegisterHostChainResponse"; + value: Uint8Array; +} +export interface MsgRegisterHostChainResponseAmino {} +export interface MsgRegisterHostChainResponseAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.MsgRegisterHostChainResponse"; + value: MsgRegisterHostChainResponseAmino; +} +export interface MsgRegisterHostChainResponseSDKType {} +export interface MsgUpdateHostChain { + /** authority is the address of the governance account */ + authority: string; + chainId: string; + updates: KVUpdate[]; +} +export interface MsgUpdateHostChainProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateHostChain"; + value: Uint8Array; +} +export interface MsgUpdateHostChainAmino { + /** authority is the address of the governance account */ + authority?: string; + chain_id?: string; + updates: KVUpdateAmino[]; +} +export interface MsgUpdateHostChainAminoMsg { + type: "pstake/MsgUpdateHostChain"; + value: MsgUpdateHostChainAmino; +} +export interface MsgUpdateHostChainSDKType { + authority: string; + chain_id: string; + updates: KVUpdateSDKType[]; +} +export interface MsgUpdateHostChainResponse {} +export interface MsgUpdateHostChainResponseProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateHostChainResponse"; + value: Uint8Array; +} +export interface MsgUpdateHostChainResponseAmino {} +export interface MsgUpdateHostChainResponseAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.MsgUpdateHostChainResponse"; + value: MsgUpdateHostChainResponseAmino; +} +export interface MsgUpdateHostChainResponseSDKType {} +export interface MsgLiquidStake { + delegatorAddress: string; + amount: Coin | undefined; +} +export interface MsgLiquidStakeProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStake"; + value: Uint8Array; +} +export interface MsgLiquidStakeAmino { + delegator_address?: string; + amount?: CoinAmino | undefined; +} +export interface MsgLiquidStakeAminoMsg { + type: "pstake/MsgLiquidStake"; + value: MsgLiquidStakeAmino; +} +export interface MsgLiquidStakeSDKType { + delegator_address: string; + amount: CoinSDKType | undefined; +} +export interface MsgLiquidStakeResponse {} +export interface MsgLiquidStakeResponseProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeResponse"; + value: Uint8Array; +} +export interface MsgLiquidStakeResponseAmino {} +export interface MsgLiquidStakeResponseAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeResponse"; + value: MsgLiquidStakeResponseAmino; +} +export interface MsgLiquidStakeResponseSDKType {} +export interface MsgLiquidStakeLSM { + delegatorAddress: string; + delegations: Coin[]; +} +export interface MsgLiquidStakeLSMProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeLSM"; + value: Uint8Array; +} +export interface MsgLiquidStakeLSMAmino { + delegator_address?: string; + delegations?: CoinAmino[]; +} +export interface MsgLiquidStakeLSMAminoMsg { + type: "pstake/MsgLiquidStakeLSM"; + value: MsgLiquidStakeLSMAmino; +} +export interface MsgLiquidStakeLSMSDKType { + delegator_address: string; + delegations: CoinSDKType[]; +} +export interface MsgLiquidStakeLSMResponse {} +export interface MsgLiquidStakeLSMResponseProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeLSMResponse"; + value: Uint8Array; +} +export interface MsgLiquidStakeLSMResponseAmino {} +export interface MsgLiquidStakeLSMResponseAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeLSMResponse"; + value: MsgLiquidStakeLSMResponseAmino; +} +export interface MsgLiquidStakeLSMResponseSDKType {} +export interface MsgLiquidUnstake { + delegatorAddress: string; + amount: Coin | undefined; +} +export interface MsgLiquidUnstakeProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidUnstake"; + value: Uint8Array; +} +export interface MsgLiquidUnstakeAmino { + delegator_address?: string; + amount?: CoinAmino | undefined; +} +export interface MsgLiquidUnstakeAminoMsg { + type: "pstake/MsgLiquidUnstake"; + value: MsgLiquidUnstakeAmino; +} +export interface MsgLiquidUnstakeSDKType { + delegator_address: string; + amount: CoinSDKType | undefined; +} +export interface MsgLiquidUnstakeResponse {} +export interface MsgLiquidUnstakeResponseProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidUnstakeResponse"; + value: Uint8Array; +} +export interface MsgLiquidUnstakeResponseAmino {} +export interface MsgLiquidUnstakeResponseAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.MsgLiquidUnstakeResponse"; + value: MsgLiquidUnstakeResponseAmino; +} +export interface MsgLiquidUnstakeResponseSDKType {} +export interface MsgRedeem { + delegatorAddress: string; + amount: Coin | undefined; +} +export interface MsgRedeemProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRedeem"; + value: Uint8Array; +} +export interface MsgRedeemAmino { + delegator_address?: string; + amount?: CoinAmino | undefined; +} +export interface MsgRedeemAminoMsg { + type: "pstake/MsgRedeem"; + value: MsgRedeemAmino; +} +export interface MsgRedeemSDKType { + delegator_address: string; + amount: CoinSDKType | undefined; +} +export interface MsgRedeemResponse {} +export interface MsgRedeemResponseProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRedeemResponse"; + value: Uint8Array; +} +export interface MsgRedeemResponseAmino {} +export interface MsgRedeemResponseAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.MsgRedeemResponse"; + value: MsgRedeemResponseAmino; +} +export interface MsgRedeemResponseSDKType {} +export interface MsgUpdateParams { + authority: string; + params: Params | undefined; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +export interface MsgUpdateParamsAmino { + authority?: string; + params: ParamsAmino | undefined; +} +export interface MsgUpdateParamsAminoMsg { + type: "pstake/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType | undefined; +} +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +export interface MsgUpdateParamsResponseSDKType {} +function createBaseMsgRegisterHostChain(): MsgRegisterHostChain { + return { + authority: "", + connectionId: "", + depositFee: "", + restakeFee: "", + unstakeFee: "", + redemptionFee: "", + channelId: "", + portId: "", + hostDenom: "", + minimumDeposit: "", + unbondingFactor: BigInt(0), + autoCompoundFactor: BigInt(0) + }; +} +export const MsgRegisterHostChain = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRegisterHostChain", + encode(message: MsgRegisterHostChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.connectionId !== "") { + writer.uint32(18).string(message.connectionId); + } + if (message.depositFee !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.depositFee, 18).atomics); + } + if (message.restakeFee !== "") { + writer.uint32(34).string(Decimal.fromUserInput(message.restakeFee, 18).atomics); + } + if (message.unstakeFee !== "") { + writer.uint32(42).string(Decimal.fromUserInput(message.unstakeFee, 18).atomics); + } + if (message.redemptionFee !== "") { + writer.uint32(50).string(Decimal.fromUserInput(message.redemptionFee, 18).atomics); + } + if (message.channelId !== "") { + writer.uint32(58).string(message.channelId); + } + if (message.portId !== "") { + writer.uint32(66).string(message.portId); + } + if (message.hostDenom !== "") { + writer.uint32(74).string(message.hostDenom); + } + if (message.minimumDeposit !== "") { + writer.uint32(82).string(message.minimumDeposit); + } + if (message.unbondingFactor !== BigInt(0)) { + writer.uint32(88).int64(message.unbondingFactor); + } + if (message.autoCompoundFactor !== BigInt(0)) { + writer.uint32(96).int64(message.autoCompoundFactor); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRegisterHostChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRegisterHostChain(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.connectionId = reader.string(); + break; + case 3: + message.depositFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 4: + message.restakeFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 5: + message.unstakeFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 6: + message.redemptionFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 7: + message.channelId = reader.string(); + break; + case 8: + message.portId = reader.string(); + break; + case 9: + message.hostDenom = reader.string(); + break; + case 10: + message.minimumDeposit = reader.string(); + break; + case 11: + message.unbondingFactor = reader.int64(); + break; + case 12: + message.autoCompoundFactor = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRegisterHostChain { + const message = createBaseMsgRegisterHostChain(); + message.authority = object.authority ?? ""; + message.connectionId = object.connectionId ?? ""; + message.depositFee = object.depositFee ?? ""; + message.restakeFee = object.restakeFee ?? ""; + message.unstakeFee = object.unstakeFee ?? ""; + message.redemptionFee = object.redemptionFee ?? ""; + message.channelId = object.channelId ?? ""; + message.portId = object.portId ?? ""; + message.hostDenom = object.hostDenom ?? ""; + message.minimumDeposit = object.minimumDeposit ?? ""; + message.unbondingFactor = object.unbondingFactor !== undefined && object.unbondingFactor !== null ? BigInt(object.unbondingFactor.toString()) : BigInt(0); + message.autoCompoundFactor = object.autoCompoundFactor !== undefined && object.autoCompoundFactor !== null ? BigInt(object.autoCompoundFactor.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgRegisterHostChainAmino): MsgRegisterHostChain { + const message = createBaseMsgRegisterHostChain(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.deposit_fee !== undefined && object.deposit_fee !== null) { + message.depositFee = object.deposit_fee; + } + if (object.restake_fee !== undefined && object.restake_fee !== null) { + message.restakeFee = object.restake_fee; + } + if (object.unstake_fee !== undefined && object.unstake_fee !== null) { + message.unstakeFee = object.unstake_fee; + } + if (object.redemption_fee !== undefined && object.redemption_fee !== null) { + message.redemptionFee = object.redemption_fee; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.host_denom !== undefined && object.host_denom !== null) { + message.hostDenom = object.host_denom; + } + if (object.minimum_deposit !== undefined && object.minimum_deposit !== null) { + message.minimumDeposit = object.minimum_deposit; + } + if (object.unbonding_factor !== undefined && object.unbonding_factor !== null) { + message.unbondingFactor = BigInt(object.unbonding_factor); + } + if (object.auto_compound_factor !== undefined && object.auto_compound_factor !== null) { + message.autoCompoundFactor = BigInt(object.auto_compound_factor); + } + return message; + }, + toAmino(message: MsgRegisterHostChain, useInterfaces: boolean = false): MsgRegisterHostChainAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.connection_id = message.connectionId; + obj.deposit_fee = message.depositFee; + obj.restake_fee = message.restakeFee; + obj.unstake_fee = message.unstakeFee; + obj.redemption_fee = message.redemptionFee; + obj.channel_id = message.channelId; + obj.port_id = message.portId; + obj.host_denom = message.hostDenom; + obj.minimum_deposit = message.minimumDeposit; + obj.unbonding_factor = message.unbondingFactor ? message.unbondingFactor.toString() : undefined; + obj.auto_compound_factor = message.autoCompoundFactor ? message.autoCompoundFactor.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgRegisterHostChainAminoMsg): MsgRegisterHostChain { + return MsgRegisterHostChain.fromAmino(object.value); + }, + toAminoMsg(message: MsgRegisterHostChain, useInterfaces: boolean = false): MsgRegisterHostChainAminoMsg { + return { + type: "pstake/MsgRegisterHostChain", + value: MsgRegisterHostChain.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgRegisterHostChainProtoMsg, useInterfaces: boolean = false): MsgRegisterHostChain { + return MsgRegisterHostChain.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgRegisterHostChain): Uint8Array { + return MsgRegisterHostChain.encode(message).finish(); + }, + toProtoMsg(message: MsgRegisterHostChain): MsgRegisterHostChainProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRegisterHostChain", + value: MsgRegisterHostChain.encode(message).finish() + }; + } +}; +function createBaseMsgRegisterHostChainResponse(): MsgRegisterHostChainResponse { + return {}; +} +export const MsgRegisterHostChainResponse = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRegisterHostChainResponse", + encode(_: MsgRegisterHostChainResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRegisterHostChainResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRegisterHostChainResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgRegisterHostChainResponse { + const message = createBaseMsgRegisterHostChainResponse(); + return message; + }, + fromAmino(_: MsgRegisterHostChainResponseAmino): MsgRegisterHostChainResponse { + const message = createBaseMsgRegisterHostChainResponse(); + return message; + }, + toAmino(_: MsgRegisterHostChainResponse, useInterfaces: boolean = false): MsgRegisterHostChainResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRegisterHostChainResponseAminoMsg): MsgRegisterHostChainResponse { + return MsgRegisterHostChainResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRegisterHostChainResponseProtoMsg, useInterfaces: boolean = false): MsgRegisterHostChainResponse { + return MsgRegisterHostChainResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgRegisterHostChainResponse): Uint8Array { + return MsgRegisterHostChainResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRegisterHostChainResponse): MsgRegisterHostChainResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRegisterHostChainResponse", + value: MsgRegisterHostChainResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateHostChain(): MsgUpdateHostChain { + return { + authority: "", + chainId: "", + updates: [] + }; +} +export const MsgUpdateHostChain = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateHostChain", + encode(message: MsgUpdateHostChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.chainId !== "") { + writer.uint32(18).string(message.chainId); + } + for (const v of message.updates) { + KVUpdate.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateHostChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateHostChain(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.chainId = reader.string(); + break; + case 3: + message.updates.push(KVUpdate.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateHostChain { + const message = createBaseMsgUpdateHostChain(); + message.authority = object.authority ?? ""; + message.chainId = object.chainId ?? ""; + message.updates = object.updates?.map(e => KVUpdate.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgUpdateHostChainAmino): MsgUpdateHostChain { + const message = createBaseMsgUpdateHostChain(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + message.updates = object.updates?.map(e => KVUpdate.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgUpdateHostChain, useInterfaces: boolean = false): MsgUpdateHostChainAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.chain_id = message.chainId; + if (message.updates) { + obj.updates = message.updates.map(e => e ? KVUpdate.toAmino(e, useInterfaces) : undefined); + } else { + obj.updates = []; + } + return obj; + }, + fromAminoMsg(object: MsgUpdateHostChainAminoMsg): MsgUpdateHostChain { + return MsgUpdateHostChain.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateHostChain, useInterfaces: boolean = false): MsgUpdateHostChainAminoMsg { + return { + type: "pstake/MsgUpdateHostChain", + value: MsgUpdateHostChain.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgUpdateHostChainProtoMsg, useInterfaces: boolean = false): MsgUpdateHostChain { + return MsgUpdateHostChain.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateHostChain): Uint8Array { + return MsgUpdateHostChain.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateHostChain): MsgUpdateHostChainProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateHostChain", + value: MsgUpdateHostChain.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateHostChainResponse(): MsgUpdateHostChainResponse { + return {}; +} +export const MsgUpdateHostChainResponse = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateHostChainResponse", + encode(_: MsgUpdateHostChainResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateHostChainResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateHostChainResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateHostChainResponse { + const message = createBaseMsgUpdateHostChainResponse(); + return message; + }, + fromAmino(_: MsgUpdateHostChainResponseAmino): MsgUpdateHostChainResponse { + const message = createBaseMsgUpdateHostChainResponse(); + return message; + }, + toAmino(_: MsgUpdateHostChainResponse, useInterfaces: boolean = false): MsgUpdateHostChainResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateHostChainResponseAminoMsg): MsgUpdateHostChainResponse { + return MsgUpdateHostChainResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateHostChainResponseProtoMsg, useInterfaces: boolean = false): MsgUpdateHostChainResponse { + return MsgUpdateHostChainResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateHostChainResponse): Uint8Array { + return MsgUpdateHostChainResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateHostChainResponse): MsgUpdateHostChainResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateHostChainResponse", + value: MsgUpdateHostChainResponse.encode(message).finish() + }; + } +}; +function createBaseMsgLiquidStake(): MsgLiquidStake { + return { + delegatorAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgLiquidStake = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStake", + encode(message: MsgLiquidStake, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgLiquidStake { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLiquidStake(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgLiquidStake { + const message = createBaseMsgLiquidStake(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgLiquidStakeAmino): MsgLiquidStake { + const message = createBaseMsgLiquidStake(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgLiquidStake, useInterfaces: boolean = false): MsgLiquidStakeAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgLiquidStakeAminoMsg): MsgLiquidStake { + return MsgLiquidStake.fromAmino(object.value); + }, + toAminoMsg(message: MsgLiquidStake, useInterfaces: boolean = false): MsgLiquidStakeAminoMsg { + return { + type: "pstake/MsgLiquidStake", + value: MsgLiquidStake.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgLiquidStakeProtoMsg, useInterfaces: boolean = false): MsgLiquidStake { + return MsgLiquidStake.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgLiquidStake): Uint8Array { + return MsgLiquidStake.encode(message).finish(); + }, + toProtoMsg(message: MsgLiquidStake): MsgLiquidStakeProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStake", + value: MsgLiquidStake.encode(message).finish() + }; + } +}; +function createBaseMsgLiquidStakeResponse(): MsgLiquidStakeResponse { + return {}; +} +export const MsgLiquidStakeResponse = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeResponse", + encode(_: MsgLiquidStakeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgLiquidStakeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLiquidStakeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgLiquidStakeResponse { + const message = createBaseMsgLiquidStakeResponse(); + return message; + }, + fromAmino(_: MsgLiquidStakeResponseAmino): MsgLiquidStakeResponse { + const message = createBaseMsgLiquidStakeResponse(); + return message; + }, + toAmino(_: MsgLiquidStakeResponse, useInterfaces: boolean = false): MsgLiquidStakeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgLiquidStakeResponseAminoMsg): MsgLiquidStakeResponse { + return MsgLiquidStakeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgLiquidStakeResponseProtoMsg, useInterfaces: boolean = false): MsgLiquidStakeResponse { + return MsgLiquidStakeResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgLiquidStakeResponse): Uint8Array { + return MsgLiquidStakeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgLiquidStakeResponse): MsgLiquidStakeResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeResponse", + value: MsgLiquidStakeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgLiquidStakeLSM(): MsgLiquidStakeLSM { + return { + delegatorAddress: "", + delegations: [] + }; +} +export const MsgLiquidStakeLSM = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeLSM", + encode(message: MsgLiquidStakeLSM, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + for (const v of message.delegations) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgLiquidStakeLSM { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLiquidStakeLSM(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.delegations.push(Coin.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgLiquidStakeLSM { + const message = createBaseMsgLiquidStakeLSM(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.delegations = object.delegations?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgLiquidStakeLSMAmino): MsgLiquidStakeLSM { + const message = createBaseMsgLiquidStakeLSM(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + message.delegations = object.delegations?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgLiquidStakeLSM, useInterfaces: boolean = false): MsgLiquidStakeLSMAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress; + if (message.delegations) { + obj.delegations = message.delegations.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); + } else { + obj.delegations = []; + } + return obj; + }, + fromAminoMsg(object: MsgLiquidStakeLSMAminoMsg): MsgLiquidStakeLSM { + return MsgLiquidStakeLSM.fromAmino(object.value); + }, + toAminoMsg(message: MsgLiquidStakeLSM, useInterfaces: boolean = false): MsgLiquidStakeLSMAminoMsg { + return { + type: "pstake/MsgLiquidStakeLSM", + value: MsgLiquidStakeLSM.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgLiquidStakeLSMProtoMsg, useInterfaces: boolean = false): MsgLiquidStakeLSM { + return MsgLiquidStakeLSM.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgLiquidStakeLSM): Uint8Array { + return MsgLiquidStakeLSM.encode(message).finish(); + }, + toProtoMsg(message: MsgLiquidStakeLSM): MsgLiquidStakeLSMProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeLSM", + value: MsgLiquidStakeLSM.encode(message).finish() + }; + } +}; +function createBaseMsgLiquidStakeLSMResponse(): MsgLiquidStakeLSMResponse { + return {}; +} +export const MsgLiquidStakeLSMResponse = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeLSMResponse", + encode(_: MsgLiquidStakeLSMResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgLiquidStakeLSMResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLiquidStakeLSMResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgLiquidStakeLSMResponse { + const message = createBaseMsgLiquidStakeLSMResponse(); + return message; + }, + fromAmino(_: MsgLiquidStakeLSMResponseAmino): MsgLiquidStakeLSMResponse { + const message = createBaseMsgLiquidStakeLSMResponse(); + return message; + }, + toAmino(_: MsgLiquidStakeLSMResponse, useInterfaces: boolean = false): MsgLiquidStakeLSMResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgLiquidStakeLSMResponseAminoMsg): MsgLiquidStakeLSMResponse { + return MsgLiquidStakeLSMResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgLiquidStakeLSMResponseProtoMsg, useInterfaces: boolean = false): MsgLiquidStakeLSMResponse { + return MsgLiquidStakeLSMResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgLiquidStakeLSMResponse): Uint8Array { + return MsgLiquidStakeLSMResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgLiquidStakeLSMResponse): MsgLiquidStakeLSMResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeLSMResponse", + value: MsgLiquidStakeLSMResponse.encode(message).finish() + }; + } +}; +function createBaseMsgLiquidUnstake(): MsgLiquidUnstake { + return { + delegatorAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgLiquidUnstake = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidUnstake", + encode(message: MsgLiquidUnstake, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgLiquidUnstake { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLiquidUnstake(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgLiquidUnstake { + const message = createBaseMsgLiquidUnstake(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgLiquidUnstakeAmino): MsgLiquidUnstake { + const message = createBaseMsgLiquidUnstake(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgLiquidUnstake, useInterfaces: boolean = false): MsgLiquidUnstakeAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgLiquidUnstakeAminoMsg): MsgLiquidUnstake { + return MsgLiquidUnstake.fromAmino(object.value); + }, + toAminoMsg(message: MsgLiquidUnstake, useInterfaces: boolean = false): MsgLiquidUnstakeAminoMsg { + return { + type: "pstake/MsgLiquidUnstake", + value: MsgLiquidUnstake.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgLiquidUnstakeProtoMsg, useInterfaces: boolean = false): MsgLiquidUnstake { + return MsgLiquidUnstake.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgLiquidUnstake): Uint8Array { + return MsgLiquidUnstake.encode(message).finish(); + }, + toProtoMsg(message: MsgLiquidUnstake): MsgLiquidUnstakeProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidUnstake", + value: MsgLiquidUnstake.encode(message).finish() + }; + } +}; +function createBaseMsgLiquidUnstakeResponse(): MsgLiquidUnstakeResponse { + return {}; +} +export const MsgLiquidUnstakeResponse = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidUnstakeResponse", + encode(_: MsgLiquidUnstakeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgLiquidUnstakeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLiquidUnstakeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgLiquidUnstakeResponse { + const message = createBaseMsgLiquidUnstakeResponse(); + return message; + }, + fromAmino(_: MsgLiquidUnstakeResponseAmino): MsgLiquidUnstakeResponse { + const message = createBaseMsgLiquidUnstakeResponse(); + return message; + }, + toAmino(_: MsgLiquidUnstakeResponse, useInterfaces: boolean = false): MsgLiquidUnstakeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgLiquidUnstakeResponseAminoMsg): MsgLiquidUnstakeResponse { + return MsgLiquidUnstakeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgLiquidUnstakeResponseProtoMsg, useInterfaces: boolean = false): MsgLiquidUnstakeResponse { + return MsgLiquidUnstakeResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgLiquidUnstakeResponse): Uint8Array { + return MsgLiquidUnstakeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgLiquidUnstakeResponse): MsgLiquidUnstakeResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidUnstakeResponse", + value: MsgLiquidUnstakeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgRedeem(): MsgRedeem { + return { + delegatorAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgRedeem = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRedeem", + encode(message: MsgRedeem, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRedeem { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRedeem(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRedeem { + const message = createBaseMsgRedeem(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgRedeemAmino): MsgRedeem { + const message = createBaseMsgRedeem(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgRedeem, useInterfaces: boolean = false): MsgRedeemAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgRedeemAminoMsg): MsgRedeem { + return MsgRedeem.fromAmino(object.value); + }, + toAminoMsg(message: MsgRedeem, useInterfaces: boolean = false): MsgRedeemAminoMsg { + return { + type: "pstake/MsgRedeem", + value: MsgRedeem.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgRedeemProtoMsg, useInterfaces: boolean = false): MsgRedeem { + return MsgRedeem.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgRedeem): Uint8Array { + return MsgRedeem.encode(message).finish(); + }, + toProtoMsg(message: MsgRedeem): MsgRedeemProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRedeem", + value: MsgRedeem.encode(message).finish() + }; + } +}; +function createBaseMsgRedeemResponse(): MsgRedeemResponse { + return {}; +} +export const MsgRedeemResponse = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRedeemResponse", + encode(_: MsgRedeemResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRedeemResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRedeemResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgRedeemResponse { + const message = createBaseMsgRedeemResponse(); + return message; + }, + fromAmino(_: MsgRedeemResponseAmino): MsgRedeemResponse { + const message = createBaseMsgRedeemResponse(); + return message; + }, + toAmino(_: MsgRedeemResponse, useInterfaces: boolean = false): MsgRedeemResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRedeemResponseAminoMsg): MsgRedeemResponse { + return MsgRedeemResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRedeemResponseProtoMsg, useInterfaces: boolean = false): MsgRedeemResponse { + return MsgRedeemResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgRedeemResponse): Uint8Array { + return MsgRedeemResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRedeemResponse): MsgRedeemResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRedeemResponse", + value: MsgRedeemResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams, useInterfaces: boolean = false): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : Params.fromPartial({}); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams, useInterfaces: boolean = false): MsgUpdateParamsAminoMsg { + return { + type: "pstake/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg, useInterfaces: boolean = false): MsgUpdateParams { + return MsgUpdateParams.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse, useInterfaces: boolean = false): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg, useInterfaces: boolean = false): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/params.ts b/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/params.ts new file mode 100644 index 000000000..dd5f9df73 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/params.ts @@ -0,0 +1,105 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** Params defines the parameters for the module. */ +export interface Params { + adminAddress: string; + feeAddress: string; +} +export interface ParamsProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the module. */ +export interface ParamsAmino { + admin_address?: string; + fee_address?: string; +} +export interface ParamsAminoMsg { + type: "pstake/x/liquidstakeibc/Params"; + value: ParamsAmino; +} +/** Params defines the parameters for the module. */ +export interface ParamsSDKType { + admin_address: string; + fee_address: string; +} +function createBaseParams(): Params { + return { + adminAddress: "", + feeAddress: "" + }; +} +export const Params = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.adminAddress !== "") { + writer.uint32(10).string(message.adminAddress); + } + if (message.feeAddress !== "") { + writer.uint32(18).string(message.feeAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.adminAddress = reader.string(); + break; + case 2: + message.feeAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.adminAddress = object.adminAddress ?? ""; + message.feeAddress = object.feeAddress ?? ""; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.admin_address !== undefined && object.admin_address !== null) { + message.adminAddress = object.admin_address; + } + if (object.fee_address !== undefined && object.fee_address !== null) { + message.feeAddress = object.fee_address; + } + return message; + }, + toAmino(message: Params, useInterfaces: boolean = false): ParamsAmino { + const obj: any = {}; + obj.admin_address = message.adminAddress; + obj.fee_address = message.feeAddress; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params, useInterfaces: boolean = false): ParamsAminoMsg { + return { + type: "pstake/x/liquidstakeibc/Params", + value: Params.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: ParamsProtoMsg, useInterfaces: boolean = false): Params { + return Params.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/query.rpc.Query.ts new file mode 100644 index 000000000..9c9f5f4ef --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/query.rpc.Query.ts @@ -0,0 +1,179 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryParamsRequest, QueryParamsResponse, QueryHostChainRequest, QueryHostChainResponse, QueryHostChainsRequest, QueryHostChainsResponse, QueryDepositsRequest, QueryDepositsResponse, QueryLSMDepositsRequest, QueryLSMDepositsResponse, QueryUnbondingsRequest, QueryUnbondingsResponse, QueryUnbondingRequest, QueryUnbondingResponse, QueryUserUnbondingsRequest, QueryUserUnbondingsResponse, QueryHostChainUserUnbondingsRequest, QueryHostChainUserUnbondingsResponse, QueryValidatorUnbondingRequest, QueryValidatorUnbondingResponse, QueryDepositAccountBalanceRequest, QueryDepositAccountBalanceResponse, QueryExchangeRateRequest, QueryExchangeRateResponse, QueryRedelegationsRequest, QueryRedelegationsResponse, QueryRedelegationTxRequest, QueryRedelegationTxResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Queries the parameters of the module. */ + params(request?: QueryParamsRequest): Promise; + /** Queries a HostChain by id. */ + hostChain(request: QueryHostChainRequest): Promise; + /** Queries for all the HostChains. */ + hostChains(request?: QueryHostChainsRequest): Promise; + /** Queries for all the deposits for a host chain. */ + deposits(request: QueryDepositsRequest): Promise; + /** Queries for all the deposits for a host chain. */ + lSMDeposits(request: QueryLSMDepositsRequest): Promise; + /** Queries all unbondings for a host chain. */ + unbondings(request: QueryUnbondingsRequest): Promise; + /** Queries an unbonding for a host chain. */ + unbonding(request: QueryUnbondingRequest): Promise; + /** Queries all unbondings for a delegator address. */ + userUnbondings(request: QueryUserUnbondingsRequest): Promise; + /** Queries all unbondings for a host chain. */ + hostChainUserUnbondings(request: QueryHostChainUserUnbondingsRequest): Promise; + /** Queries all validator unbondings for a host chain. */ + validatorUnbondings(request: QueryValidatorUnbondingRequest): Promise; + /** Queries for a host chain deposit account balance. */ + depositAccountBalance(request: QueryDepositAccountBalanceRequest): Promise; + /** + * Queries for a host chain exchange rate between the host token and the stk + * token. + */ + exchangeRate(request: QueryExchangeRateRequest): Promise; + /** + * Queries for a host chain redelegation entries on the host token delegation + * acct. + */ + redelegations(request: QueryRedelegationsRequest): Promise; + /** Queries for a host chain redelegation-txs for the host token. */ + redelegationTx(request: QueryRedelegationTxRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + this.hostChain = this.hostChain.bind(this); + this.hostChains = this.hostChains.bind(this); + this.deposits = this.deposits.bind(this); + this.lSMDeposits = this.lSMDeposits.bind(this); + this.unbondings = this.unbondings.bind(this); + this.unbonding = this.unbonding.bind(this); + this.userUnbondings = this.userUnbondings.bind(this); + this.hostChainUserUnbondings = this.hostChainUserUnbondings.bind(this); + this.validatorUnbondings = this.validatorUnbondings.bind(this); + this.depositAccountBalance = this.depositAccountBalance.bind(this); + this.exchangeRate = this.exchangeRate.bind(this); + this.redelegations = this.redelegations.bind(this); + this.redelegationTx = this.redelegationTx.bind(this); + } + params(request: QueryParamsRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + hostChain(request: QueryHostChainRequest, useInterfaces: boolean = true): Promise { + const data = QueryHostChainRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "HostChain", data); + return promise.then(data => QueryHostChainResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + hostChains(request: QueryHostChainsRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryHostChainsRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "HostChains", data); + return promise.then(data => QueryHostChainsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + deposits(request: QueryDepositsRequest, useInterfaces: boolean = true): Promise { + const data = QueryDepositsRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "Deposits", data); + return promise.then(data => QueryDepositsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + lSMDeposits(request: QueryLSMDepositsRequest, useInterfaces: boolean = true): Promise { + const data = QueryLSMDepositsRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "LSMDeposits", data); + return promise.then(data => QueryLSMDepositsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + unbondings(request: QueryUnbondingsRequest, useInterfaces: boolean = true): Promise { + const data = QueryUnbondingsRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "Unbondings", data); + return promise.then(data => QueryUnbondingsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + unbonding(request: QueryUnbondingRequest, useInterfaces: boolean = true): Promise { + const data = QueryUnbondingRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "Unbonding", data); + return promise.then(data => QueryUnbondingResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + userUnbondings(request: QueryUserUnbondingsRequest, useInterfaces: boolean = true): Promise { + const data = QueryUserUnbondingsRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "UserUnbondings", data); + return promise.then(data => QueryUserUnbondingsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + hostChainUserUnbondings(request: QueryHostChainUserUnbondingsRequest, useInterfaces: boolean = true): Promise { + const data = QueryHostChainUserUnbondingsRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "HostChainUserUnbondings", data); + return promise.then(data => QueryHostChainUserUnbondingsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + validatorUnbondings(request: QueryValidatorUnbondingRequest, useInterfaces: boolean = true): Promise { + const data = QueryValidatorUnbondingRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "ValidatorUnbondings", data); + return promise.then(data => QueryValidatorUnbondingResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + depositAccountBalance(request: QueryDepositAccountBalanceRequest, useInterfaces: boolean = true): Promise { + const data = QueryDepositAccountBalanceRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "DepositAccountBalance", data); + return promise.then(data => QueryDepositAccountBalanceResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + exchangeRate(request: QueryExchangeRateRequest, useInterfaces: boolean = true): Promise { + const data = QueryExchangeRateRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "ExchangeRate", data); + return promise.then(data => QueryExchangeRateResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + redelegations(request: QueryRedelegationsRequest, useInterfaces: boolean = true): Promise { + const data = QueryRedelegationsRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "Redelegations", data); + return promise.then(data => QueryRedelegationsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + redelegationTx(request: QueryRedelegationTxRequest, useInterfaces: boolean = true): Promise { + const data = QueryRedelegationTxRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "RedelegationTx", data); + return promise.then(data => QueryRedelegationTxResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest, useInterfaces: boolean = true): Promise { + return queryService.params(request, useInterfaces); + }, + hostChain(request: QueryHostChainRequest, useInterfaces: boolean = true): Promise { + return queryService.hostChain(request, useInterfaces); + }, + hostChains(request?: QueryHostChainsRequest, useInterfaces: boolean = true): Promise { + return queryService.hostChains(request, useInterfaces); + }, + deposits(request: QueryDepositsRequest, useInterfaces: boolean = true): Promise { + return queryService.deposits(request, useInterfaces); + }, + lSMDeposits(request: QueryLSMDepositsRequest, useInterfaces: boolean = true): Promise { + return queryService.lSMDeposits(request, useInterfaces); + }, + unbondings(request: QueryUnbondingsRequest, useInterfaces: boolean = true): Promise { + return queryService.unbondings(request, useInterfaces); + }, + unbonding(request: QueryUnbondingRequest, useInterfaces: boolean = true): Promise { + return queryService.unbonding(request, useInterfaces); + }, + userUnbondings(request: QueryUserUnbondingsRequest, useInterfaces: boolean = true): Promise { + return queryService.userUnbondings(request, useInterfaces); + }, + hostChainUserUnbondings(request: QueryHostChainUserUnbondingsRequest, useInterfaces: boolean = true): Promise { + return queryService.hostChainUserUnbondings(request, useInterfaces); + }, + validatorUnbondings(request: QueryValidatorUnbondingRequest, useInterfaces: boolean = true): Promise { + return queryService.validatorUnbondings(request, useInterfaces); + }, + depositAccountBalance(request: QueryDepositAccountBalanceRequest, useInterfaces: boolean = true): Promise { + return queryService.depositAccountBalance(request, useInterfaces); + }, + exchangeRate(request: QueryExchangeRateRequest, useInterfaces: boolean = true): Promise { + return queryService.exchangeRate(request, useInterfaces); + }, + redelegations(request: QueryRedelegationsRequest, useInterfaces: boolean = true): Promise { + return queryService.redelegations(request, useInterfaces); + }, + redelegationTx(request: QueryRedelegationTxRequest, useInterfaces: boolean = true): Promise { + return queryService.redelegationTx(request, useInterfaces); + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/query.ts b/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/query.ts new file mode 100644 index 000000000..8bdf573a2 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/liquidstakeibc/v1beta1/query.ts @@ -0,0 +1,2270 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../cosmos/base/query/v1beta1/pagination"; +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { HostChain, HostChainAmino, HostChainSDKType, Deposit, DepositAmino, DepositSDKType, LSMDeposit, LSMDepositAmino, LSMDepositSDKType, Unbonding, UnbondingAmino, UnbondingSDKType, UserUnbonding, UserUnbondingAmino, UserUnbondingSDKType, ValidatorUnbonding, ValidatorUnbondingAmino, ValidatorUnbondingSDKType, Redelegations, RedelegationsAmino, RedelegationsSDKType, RedelegateTx, RedelegateTxAmino, RedelegateTxSDKType } from "./liquidstakeibc"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +export interface QueryParamsRequestSDKType {} +export interface QueryParamsResponse { + params: Params | undefined; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +export interface QueryParamsResponseAmino { + params?: ParamsAmino | undefined; +} +export interface QueryParamsResponseAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +export interface QueryParamsResponseSDKType { + params: ParamsSDKType | undefined; +} +export interface QueryHostChainRequest { + chainId: string; +} +export interface QueryHostChainRequestProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryHostChainRequest"; + value: Uint8Array; +} +export interface QueryHostChainRequestAmino { + chain_id?: string; +} +export interface QueryHostChainRequestAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryHostChainRequest"; + value: QueryHostChainRequestAmino; +} +export interface QueryHostChainRequestSDKType { + chain_id: string; +} +export interface QueryHostChainResponse { + hostChain: HostChain | undefined; +} +export interface QueryHostChainResponseProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryHostChainResponse"; + value: Uint8Array; +} +export interface QueryHostChainResponseAmino { + host_chain?: HostChainAmino | undefined; +} +export interface QueryHostChainResponseAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryHostChainResponse"; + value: QueryHostChainResponseAmino; +} +export interface QueryHostChainResponseSDKType { + host_chain: HostChainSDKType | undefined; +} +export interface QueryHostChainsRequest {} +export interface QueryHostChainsRequestProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryHostChainsRequest"; + value: Uint8Array; +} +export interface QueryHostChainsRequestAmino {} +export interface QueryHostChainsRequestAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryHostChainsRequest"; + value: QueryHostChainsRequestAmino; +} +export interface QueryHostChainsRequestSDKType {} +export interface QueryHostChainsResponse { + hostChains: HostChain[]; +} +export interface QueryHostChainsResponseProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryHostChainsResponse"; + value: Uint8Array; +} +export interface QueryHostChainsResponseAmino { + host_chains?: HostChainAmino[]; +} +export interface QueryHostChainsResponseAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryHostChainsResponse"; + value: QueryHostChainsResponseAmino; +} +export interface QueryHostChainsResponseSDKType { + host_chains: HostChainSDKType[]; +} +export interface QueryDepositsRequest { + chainId: string; +} +export interface QueryDepositsRequestProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryDepositsRequest"; + value: Uint8Array; +} +export interface QueryDepositsRequestAmino { + chain_id?: string; +} +export interface QueryDepositsRequestAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryDepositsRequest"; + value: QueryDepositsRequestAmino; +} +export interface QueryDepositsRequestSDKType { + chain_id: string; +} +export interface QueryDepositsResponse { + deposits: Deposit[]; +} +export interface QueryDepositsResponseProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryDepositsResponse"; + value: Uint8Array; +} +export interface QueryDepositsResponseAmino { + deposits?: DepositAmino[]; +} +export interface QueryDepositsResponseAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryDepositsResponse"; + value: QueryDepositsResponseAmino; +} +export interface QueryDepositsResponseSDKType { + deposits: DepositSDKType[]; +} +export interface QueryLSMDepositsRequest { + chainId: string; +} +export interface QueryLSMDepositsRequestProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryLSMDepositsRequest"; + value: Uint8Array; +} +export interface QueryLSMDepositsRequestAmino { + chain_id?: string; +} +export interface QueryLSMDepositsRequestAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryLSMDepositsRequest"; + value: QueryLSMDepositsRequestAmino; +} +export interface QueryLSMDepositsRequestSDKType { + chain_id: string; +} +export interface QueryLSMDepositsResponse { + deposits: LSMDeposit[]; +} +export interface QueryLSMDepositsResponseProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryLSMDepositsResponse"; + value: Uint8Array; +} +export interface QueryLSMDepositsResponseAmino { + deposits?: LSMDepositAmino[]; +} +export interface QueryLSMDepositsResponseAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryLSMDepositsResponse"; + value: QueryLSMDepositsResponseAmino; +} +export interface QueryLSMDepositsResponseSDKType { + deposits: LSMDepositSDKType[]; +} +export interface QueryUnbondingsRequest { + chainId: string; +} +export interface QueryUnbondingsRequestProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryUnbondingsRequest"; + value: Uint8Array; +} +export interface QueryUnbondingsRequestAmino { + chain_id?: string; +} +export interface QueryUnbondingsRequestAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryUnbondingsRequest"; + value: QueryUnbondingsRequestAmino; +} +export interface QueryUnbondingsRequestSDKType { + chain_id: string; +} +export interface QueryUnbondingsResponse { + unbondings: Unbonding[]; +} +export interface QueryUnbondingsResponseProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryUnbondingsResponse"; + value: Uint8Array; +} +export interface QueryUnbondingsResponseAmino { + unbondings?: UnbondingAmino[]; +} +export interface QueryUnbondingsResponseAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryUnbondingsResponse"; + value: QueryUnbondingsResponseAmino; +} +export interface QueryUnbondingsResponseSDKType { + unbondings: UnbondingSDKType[]; +} +export interface QueryUnbondingRequest { + chainId: string; + epoch: bigint; +} +export interface QueryUnbondingRequestProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryUnbondingRequest"; + value: Uint8Array; +} +export interface QueryUnbondingRequestAmino { + chain_id?: string; + epoch?: string; +} +export interface QueryUnbondingRequestAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryUnbondingRequest"; + value: QueryUnbondingRequestAmino; +} +export interface QueryUnbondingRequestSDKType { + chain_id: string; + epoch: bigint; +} +export interface QueryUnbondingResponse { + unbonding?: Unbonding | undefined; +} +export interface QueryUnbondingResponseProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryUnbondingResponse"; + value: Uint8Array; +} +export interface QueryUnbondingResponseAmino { + unbonding?: UnbondingAmino | undefined; +} +export interface QueryUnbondingResponseAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryUnbondingResponse"; + value: QueryUnbondingResponseAmino; +} +export interface QueryUnbondingResponseSDKType { + unbonding?: UnbondingSDKType | undefined; +} +export interface QueryUserUnbondingsRequest { + address: string; +} +export interface QueryUserUnbondingsRequestProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryUserUnbondingsRequest"; + value: Uint8Array; +} +export interface QueryUserUnbondingsRequestAmino { + address?: string; +} +export interface QueryUserUnbondingsRequestAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryUserUnbondingsRequest"; + value: QueryUserUnbondingsRequestAmino; +} +export interface QueryUserUnbondingsRequestSDKType { + address: string; +} +export interface QueryUserUnbondingsResponse { + userUnbondings: UserUnbonding[]; +} +export interface QueryUserUnbondingsResponseProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryUserUnbondingsResponse"; + value: Uint8Array; +} +export interface QueryUserUnbondingsResponseAmino { + user_unbondings?: UserUnbondingAmino[]; +} +export interface QueryUserUnbondingsResponseAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryUserUnbondingsResponse"; + value: QueryUserUnbondingsResponseAmino; +} +export interface QueryUserUnbondingsResponseSDKType { + user_unbondings: UserUnbondingSDKType[]; +} +export interface QueryHostChainUserUnbondingsRequest { + chainId: string; + pagination?: PageRequest | undefined; +} +export interface QueryHostChainUserUnbondingsRequestProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryHostChainUserUnbondingsRequest"; + value: Uint8Array; +} +export interface QueryHostChainUserUnbondingsRequestAmino { + chain_id?: string; + pagination?: PageRequestAmino | undefined; +} +export interface QueryHostChainUserUnbondingsRequestAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryHostChainUserUnbondingsRequest"; + value: QueryHostChainUserUnbondingsRequestAmino; +} +export interface QueryHostChainUserUnbondingsRequestSDKType { + chain_id: string; + pagination?: PageRequestSDKType | undefined; +} +export interface QueryHostChainUserUnbondingsResponse { + userUnbondings: UserUnbonding[]; + pagination?: PageResponse | undefined; +} +export interface QueryHostChainUserUnbondingsResponseProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryHostChainUserUnbondingsResponse"; + value: Uint8Array; +} +export interface QueryHostChainUserUnbondingsResponseAmino { + user_unbondings?: UserUnbondingAmino[]; + pagination?: PageResponseAmino | undefined; +} +export interface QueryHostChainUserUnbondingsResponseAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryHostChainUserUnbondingsResponse"; + value: QueryHostChainUserUnbondingsResponseAmino; +} +export interface QueryHostChainUserUnbondingsResponseSDKType { + user_unbondings: UserUnbondingSDKType[]; + pagination?: PageResponseSDKType | undefined; +} +export interface QueryValidatorUnbondingRequest { + chainId: string; +} +export interface QueryValidatorUnbondingRequestProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryValidatorUnbondingRequest"; + value: Uint8Array; +} +export interface QueryValidatorUnbondingRequestAmino { + chain_id?: string; +} +export interface QueryValidatorUnbondingRequestAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryValidatorUnbondingRequest"; + value: QueryValidatorUnbondingRequestAmino; +} +export interface QueryValidatorUnbondingRequestSDKType { + chain_id: string; +} +export interface QueryValidatorUnbondingResponse { + validatorUnbondings: ValidatorUnbonding[]; +} +export interface QueryValidatorUnbondingResponseProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryValidatorUnbondingResponse"; + value: Uint8Array; +} +export interface QueryValidatorUnbondingResponseAmino { + validator_unbondings?: ValidatorUnbondingAmino[]; +} +export interface QueryValidatorUnbondingResponseAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryValidatorUnbondingResponse"; + value: QueryValidatorUnbondingResponseAmino; +} +export interface QueryValidatorUnbondingResponseSDKType { + validator_unbondings: ValidatorUnbondingSDKType[]; +} +export interface QueryDepositAccountBalanceRequest { + chainId: string; +} +export interface QueryDepositAccountBalanceRequestProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryDepositAccountBalanceRequest"; + value: Uint8Array; +} +export interface QueryDepositAccountBalanceRequestAmino { + chain_id?: string; +} +export interface QueryDepositAccountBalanceRequestAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryDepositAccountBalanceRequest"; + value: QueryDepositAccountBalanceRequestAmino; +} +export interface QueryDepositAccountBalanceRequestSDKType { + chain_id: string; +} +export interface QueryDepositAccountBalanceResponse { + balance: Coin | undefined; +} +export interface QueryDepositAccountBalanceResponseProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryDepositAccountBalanceResponse"; + value: Uint8Array; +} +export interface QueryDepositAccountBalanceResponseAmino { + balance?: CoinAmino | undefined; +} +export interface QueryDepositAccountBalanceResponseAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryDepositAccountBalanceResponse"; + value: QueryDepositAccountBalanceResponseAmino; +} +export interface QueryDepositAccountBalanceResponseSDKType { + balance: CoinSDKType | undefined; +} +export interface QueryExchangeRateRequest { + chainId: string; +} +export interface QueryExchangeRateRequestProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryExchangeRateRequest"; + value: Uint8Array; +} +export interface QueryExchangeRateRequestAmino { + chain_id?: string; +} +export interface QueryExchangeRateRequestAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryExchangeRateRequest"; + value: QueryExchangeRateRequestAmino; +} +export interface QueryExchangeRateRequestSDKType { + chain_id: string; +} +export interface QueryExchangeRateResponse { + rate: string; +} +export interface QueryExchangeRateResponseProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryExchangeRateResponse"; + value: Uint8Array; +} +export interface QueryExchangeRateResponseAmino { + rate?: string; +} +export interface QueryExchangeRateResponseAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryExchangeRateResponse"; + value: QueryExchangeRateResponseAmino; +} +export interface QueryExchangeRateResponseSDKType { + rate: string; +} +export interface QueryRedelegationsRequest { + chainId: string; +} +export interface QueryRedelegationsRequestProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryRedelegationsRequest"; + value: Uint8Array; +} +export interface QueryRedelegationsRequestAmino { + chain_id?: string; +} +export interface QueryRedelegationsRequestAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryRedelegationsRequest"; + value: QueryRedelegationsRequestAmino; +} +export interface QueryRedelegationsRequestSDKType { + chain_id: string; +} +export interface QueryRedelegationsResponse { + redelegations?: Redelegations | undefined; +} +export interface QueryRedelegationsResponseProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryRedelegationsResponse"; + value: Uint8Array; +} +export interface QueryRedelegationsResponseAmino { + redelegations?: RedelegationsAmino | undefined; +} +export interface QueryRedelegationsResponseAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryRedelegationsResponse"; + value: QueryRedelegationsResponseAmino; +} +export interface QueryRedelegationsResponseSDKType { + redelegations?: RedelegationsSDKType | undefined; +} +export interface QueryRedelegationTxRequest { + chainId: string; +} +export interface QueryRedelegationTxRequestProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryRedelegationTxRequest"; + value: Uint8Array; +} +export interface QueryRedelegationTxRequestAmino { + chain_id?: string; +} +export interface QueryRedelegationTxRequestAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryRedelegationTxRequest"; + value: QueryRedelegationTxRequestAmino; +} +export interface QueryRedelegationTxRequestSDKType { + chain_id: string; +} +export interface QueryRedelegationTxResponse { + redelegationTx: RedelegateTx[]; +} +export interface QueryRedelegationTxResponseProtoMsg { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryRedelegationTxResponse"; + value: Uint8Array; +} +export interface QueryRedelegationTxResponseAmino { + redelegation_tx?: RedelegateTxAmino[]; +} +export interface QueryRedelegationTxResponseAminoMsg { + type: "/pstake.liquidstakeibc.v1beta1.QueryRedelegationTxResponse"; + value: QueryRedelegationTxResponseAmino; +} +export interface QueryRedelegationTxResponseSDKType { + redelegation_tx: RedelegateTxSDKType[]; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest, useInterfaces: boolean = false): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg, useInterfaces: boolean = false): QueryParamsRequest { + return QueryParamsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse, useInterfaces: boolean = false): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg, useInterfaces: boolean = false): QueryParamsResponse { + return QueryParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryHostChainRequest(): QueryHostChainRequest { + return { + chainId: "" + }; +} +export const QueryHostChainRequest = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryHostChainRequest", + encode(message: QueryHostChainRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryHostChainRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHostChainRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryHostChainRequest { + const message = createBaseQueryHostChainRequest(); + message.chainId = object.chainId ?? ""; + return message; + }, + fromAmino(object: QueryHostChainRequestAmino): QueryHostChainRequest { + const message = createBaseQueryHostChainRequest(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + return message; + }, + toAmino(message: QueryHostChainRequest, useInterfaces: boolean = false): QueryHostChainRequestAmino { + const obj: any = {}; + obj.chain_id = message.chainId; + return obj; + }, + fromAminoMsg(object: QueryHostChainRequestAminoMsg): QueryHostChainRequest { + return QueryHostChainRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryHostChainRequestProtoMsg, useInterfaces: boolean = false): QueryHostChainRequest { + return QueryHostChainRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryHostChainRequest): Uint8Array { + return QueryHostChainRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryHostChainRequest): QueryHostChainRequestProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryHostChainRequest", + value: QueryHostChainRequest.encode(message).finish() + }; + } +}; +function createBaseQueryHostChainResponse(): QueryHostChainResponse { + return { + hostChain: HostChain.fromPartial({}) + }; +} +export const QueryHostChainResponse = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryHostChainResponse", + encode(message: QueryHostChainResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hostChain !== undefined) { + HostChain.encode(message.hostChain, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryHostChainResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHostChainResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hostChain = HostChain.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryHostChainResponse { + const message = createBaseQueryHostChainResponse(); + message.hostChain = object.hostChain !== undefined && object.hostChain !== null ? HostChain.fromPartial(object.hostChain) : undefined; + return message; + }, + fromAmino(object: QueryHostChainResponseAmino): QueryHostChainResponse { + const message = createBaseQueryHostChainResponse(); + if (object.host_chain !== undefined && object.host_chain !== null) { + message.hostChain = HostChain.fromAmino(object.host_chain); + } + return message; + }, + toAmino(message: QueryHostChainResponse, useInterfaces: boolean = false): QueryHostChainResponseAmino { + const obj: any = {}; + obj.host_chain = message.hostChain ? HostChain.toAmino(message.hostChain, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryHostChainResponseAminoMsg): QueryHostChainResponse { + return QueryHostChainResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryHostChainResponseProtoMsg, useInterfaces: boolean = false): QueryHostChainResponse { + return QueryHostChainResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryHostChainResponse): Uint8Array { + return QueryHostChainResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryHostChainResponse): QueryHostChainResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryHostChainResponse", + value: QueryHostChainResponse.encode(message).finish() + }; + } +}; +function createBaseQueryHostChainsRequest(): QueryHostChainsRequest { + return {}; +} +export const QueryHostChainsRequest = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryHostChainsRequest", + encode(_: QueryHostChainsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryHostChainsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHostChainsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryHostChainsRequest { + const message = createBaseQueryHostChainsRequest(); + return message; + }, + fromAmino(_: QueryHostChainsRequestAmino): QueryHostChainsRequest { + const message = createBaseQueryHostChainsRequest(); + return message; + }, + toAmino(_: QueryHostChainsRequest, useInterfaces: boolean = false): QueryHostChainsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryHostChainsRequestAminoMsg): QueryHostChainsRequest { + return QueryHostChainsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryHostChainsRequestProtoMsg, useInterfaces: boolean = false): QueryHostChainsRequest { + return QueryHostChainsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryHostChainsRequest): Uint8Array { + return QueryHostChainsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryHostChainsRequest): QueryHostChainsRequestProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryHostChainsRequest", + value: QueryHostChainsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryHostChainsResponse(): QueryHostChainsResponse { + return { + hostChains: [] + }; +} +export const QueryHostChainsResponse = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryHostChainsResponse", + encode(message: QueryHostChainsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.hostChains) { + HostChain.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryHostChainsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHostChainsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hostChains.push(HostChain.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryHostChainsResponse { + const message = createBaseQueryHostChainsResponse(); + message.hostChains = object.hostChains?.map(e => HostChain.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryHostChainsResponseAmino): QueryHostChainsResponse { + const message = createBaseQueryHostChainsResponse(); + message.hostChains = object.host_chains?.map(e => HostChain.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryHostChainsResponse, useInterfaces: boolean = false): QueryHostChainsResponseAmino { + const obj: any = {}; + if (message.hostChains) { + obj.host_chains = message.hostChains.map(e => e ? HostChain.toAmino(e, useInterfaces) : undefined); + } else { + obj.host_chains = []; + } + return obj; + }, + fromAminoMsg(object: QueryHostChainsResponseAminoMsg): QueryHostChainsResponse { + return QueryHostChainsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryHostChainsResponseProtoMsg, useInterfaces: boolean = false): QueryHostChainsResponse { + return QueryHostChainsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryHostChainsResponse): Uint8Array { + return QueryHostChainsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryHostChainsResponse): QueryHostChainsResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryHostChainsResponse", + value: QueryHostChainsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDepositsRequest(): QueryDepositsRequest { + return { + chainId: "" + }; +} +export const QueryDepositsRequest = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryDepositsRequest", + encode(message: QueryDepositsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryDepositsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDepositsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDepositsRequest { + const message = createBaseQueryDepositsRequest(); + message.chainId = object.chainId ?? ""; + return message; + }, + fromAmino(object: QueryDepositsRequestAmino): QueryDepositsRequest { + const message = createBaseQueryDepositsRequest(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + return message; + }, + toAmino(message: QueryDepositsRequest, useInterfaces: boolean = false): QueryDepositsRequestAmino { + const obj: any = {}; + obj.chain_id = message.chainId; + return obj; + }, + fromAminoMsg(object: QueryDepositsRequestAminoMsg): QueryDepositsRequest { + return QueryDepositsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDepositsRequestProtoMsg, useInterfaces: boolean = false): QueryDepositsRequest { + return QueryDepositsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryDepositsRequest): Uint8Array { + return QueryDepositsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDepositsRequest): QueryDepositsRequestProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryDepositsRequest", + value: QueryDepositsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDepositsResponse(): QueryDepositsResponse { + return { + deposits: [] + }; +} +export const QueryDepositsResponse = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryDepositsResponse", + encode(message: QueryDepositsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.deposits) { + Deposit.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryDepositsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDepositsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deposits.push(Deposit.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDepositsResponse { + const message = createBaseQueryDepositsResponse(); + message.deposits = object.deposits?.map(e => Deposit.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryDepositsResponseAmino): QueryDepositsResponse { + const message = createBaseQueryDepositsResponse(); + message.deposits = object.deposits?.map(e => Deposit.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryDepositsResponse, useInterfaces: boolean = false): QueryDepositsResponseAmino { + const obj: any = {}; + if (message.deposits) { + obj.deposits = message.deposits.map(e => e ? Deposit.toAmino(e, useInterfaces) : undefined); + } else { + obj.deposits = []; + } + return obj; + }, + fromAminoMsg(object: QueryDepositsResponseAminoMsg): QueryDepositsResponse { + return QueryDepositsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDepositsResponseProtoMsg, useInterfaces: boolean = false): QueryDepositsResponse { + return QueryDepositsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryDepositsResponse): Uint8Array { + return QueryDepositsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDepositsResponse): QueryDepositsResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryDepositsResponse", + value: QueryDepositsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryLSMDepositsRequest(): QueryLSMDepositsRequest { + return { + chainId: "" + }; +} +export const QueryLSMDepositsRequest = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryLSMDepositsRequest", + encode(message: QueryLSMDepositsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryLSMDepositsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLSMDepositsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryLSMDepositsRequest { + const message = createBaseQueryLSMDepositsRequest(); + message.chainId = object.chainId ?? ""; + return message; + }, + fromAmino(object: QueryLSMDepositsRequestAmino): QueryLSMDepositsRequest { + const message = createBaseQueryLSMDepositsRequest(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + return message; + }, + toAmino(message: QueryLSMDepositsRequest, useInterfaces: boolean = false): QueryLSMDepositsRequestAmino { + const obj: any = {}; + obj.chain_id = message.chainId; + return obj; + }, + fromAminoMsg(object: QueryLSMDepositsRequestAminoMsg): QueryLSMDepositsRequest { + return QueryLSMDepositsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLSMDepositsRequestProtoMsg, useInterfaces: boolean = false): QueryLSMDepositsRequest { + return QueryLSMDepositsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryLSMDepositsRequest): Uint8Array { + return QueryLSMDepositsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryLSMDepositsRequest): QueryLSMDepositsRequestProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryLSMDepositsRequest", + value: QueryLSMDepositsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryLSMDepositsResponse(): QueryLSMDepositsResponse { + return { + deposits: [] + }; +} +export const QueryLSMDepositsResponse = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryLSMDepositsResponse", + encode(message: QueryLSMDepositsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.deposits) { + LSMDeposit.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryLSMDepositsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryLSMDepositsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deposits.push(LSMDeposit.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryLSMDepositsResponse { + const message = createBaseQueryLSMDepositsResponse(); + message.deposits = object.deposits?.map(e => LSMDeposit.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryLSMDepositsResponseAmino): QueryLSMDepositsResponse { + const message = createBaseQueryLSMDepositsResponse(); + message.deposits = object.deposits?.map(e => LSMDeposit.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryLSMDepositsResponse, useInterfaces: boolean = false): QueryLSMDepositsResponseAmino { + const obj: any = {}; + if (message.deposits) { + obj.deposits = message.deposits.map(e => e ? LSMDeposit.toAmino(e, useInterfaces) : undefined); + } else { + obj.deposits = []; + } + return obj; + }, + fromAminoMsg(object: QueryLSMDepositsResponseAminoMsg): QueryLSMDepositsResponse { + return QueryLSMDepositsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryLSMDepositsResponseProtoMsg, useInterfaces: boolean = false): QueryLSMDepositsResponse { + return QueryLSMDepositsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryLSMDepositsResponse): Uint8Array { + return QueryLSMDepositsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryLSMDepositsResponse): QueryLSMDepositsResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryLSMDepositsResponse", + value: QueryLSMDepositsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryUnbondingsRequest(): QueryUnbondingsRequest { + return { + chainId: "" + }; +} +export const QueryUnbondingsRequest = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryUnbondingsRequest", + encode(message: QueryUnbondingsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryUnbondingsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnbondingsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUnbondingsRequest { + const message = createBaseQueryUnbondingsRequest(); + message.chainId = object.chainId ?? ""; + return message; + }, + fromAmino(object: QueryUnbondingsRequestAmino): QueryUnbondingsRequest { + const message = createBaseQueryUnbondingsRequest(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + return message; + }, + toAmino(message: QueryUnbondingsRequest, useInterfaces: boolean = false): QueryUnbondingsRequestAmino { + const obj: any = {}; + obj.chain_id = message.chainId; + return obj; + }, + fromAminoMsg(object: QueryUnbondingsRequestAminoMsg): QueryUnbondingsRequest { + return QueryUnbondingsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryUnbondingsRequestProtoMsg, useInterfaces: boolean = false): QueryUnbondingsRequest { + return QueryUnbondingsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryUnbondingsRequest): Uint8Array { + return QueryUnbondingsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUnbondingsRequest): QueryUnbondingsRequestProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryUnbondingsRequest", + value: QueryUnbondingsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryUnbondingsResponse(): QueryUnbondingsResponse { + return { + unbondings: [] + }; +} +export const QueryUnbondingsResponse = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryUnbondingsResponse", + encode(message: QueryUnbondingsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.unbondings) { + Unbonding.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryUnbondingsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnbondingsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unbondings.push(Unbonding.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUnbondingsResponse { + const message = createBaseQueryUnbondingsResponse(); + message.unbondings = object.unbondings?.map(e => Unbonding.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryUnbondingsResponseAmino): QueryUnbondingsResponse { + const message = createBaseQueryUnbondingsResponse(); + message.unbondings = object.unbondings?.map(e => Unbonding.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryUnbondingsResponse, useInterfaces: boolean = false): QueryUnbondingsResponseAmino { + const obj: any = {}; + if (message.unbondings) { + obj.unbondings = message.unbondings.map(e => e ? Unbonding.toAmino(e, useInterfaces) : undefined); + } else { + obj.unbondings = []; + } + return obj; + }, + fromAminoMsg(object: QueryUnbondingsResponseAminoMsg): QueryUnbondingsResponse { + return QueryUnbondingsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryUnbondingsResponseProtoMsg, useInterfaces: boolean = false): QueryUnbondingsResponse { + return QueryUnbondingsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryUnbondingsResponse): Uint8Array { + return QueryUnbondingsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUnbondingsResponse): QueryUnbondingsResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryUnbondingsResponse", + value: QueryUnbondingsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryUnbondingRequest(): QueryUnbondingRequest { + return { + chainId: "", + epoch: BigInt(0) + }; +} +export const QueryUnbondingRequest = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryUnbondingRequest", + encode(message: QueryUnbondingRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + if (message.epoch !== BigInt(0)) { + writer.uint32(16).int64(message.epoch); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryUnbondingRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnbondingRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + case 2: + message.epoch = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUnbondingRequest { + const message = createBaseQueryUnbondingRequest(); + message.chainId = object.chainId ?? ""; + message.epoch = object.epoch !== undefined && object.epoch !== null ? BigInt(object.epoch.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryUnbondingRequestAmino): QueryUnbondingRequest { + const message = createBaseQueryUnbondingRequest(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.epoch !== undefined && object.epoch !== null) { + message.epoch = BigInt(object.epoch); + } + return message; + }, + toAmino(message: QueryUnbondingRequest, useInterfaces: boolean = false): QueryUnbondingRequestAmino { + const obj: any = {}; + obj.chain_id = message.chainId; + obj.epoch = message.epoch ? message.epoch.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryUnbondingRequestAminoMsg): QueryUnbondingRequest { + return QueryUnbondingRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryUnbondingRequestProtoMsg, useInterfaces: boolean = false): QueryUnbondingRequest { + return QueryUnbondingRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryUnbondingRequest): Uint8Array { + return QueryUnbondingRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUnbondingRequest): QueryUnbondingRequestProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryUnbondingRequest", + value: QueryUnbondingRequest.encode(message).finish() + }; + } +}; +function createBaseQueryUnbondingResponse(): QueryUnbondingResponse { + return { + unbonding: undefined + }; +} +export const QueryUnbondingResponse = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryUnbondingResponse", + encode(message: QueryUnbondingResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.unbonding !== undefined) { + Unbonding.encode(message.unbonding, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryUnbondingResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnbondingResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unbonding = Unbonding.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUnbondingResponse { + const message = createBaseQueryUnbondingResponse(); + message.unbonding = object.unbonding !== undefined && object.unbonding !== null ? Unbonding.fromPartial(object.unbonding) : undefined; + return message; + }, + fromAmino(object: QueryUnbondingResponseAmino): QueryUnbondingResponse { + const message = createBaseQueryUnbondingResponse(); + if (object.unbonding !== undefined && object.unbonding !== null) { + message.unbonding = Unbonding.fromAmino(object.unbonding); + } + return message; + }, + toAmino(message: QueryUnbondingResponse, useInterfaces: boolean = false): QueryUnbondingResponseAmino { + const obj: any = {}; + obj.unbonding = message.unbonding ? Unbonding.toAmino(message.unbonding, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryUnbondingResponseAminoMsg): QueryUnbondingResponse { + return QueryUnbondingResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryUnbondingResponseProtoMsg, useInterfaces: boolean = false): QueryUnbondingResponse { + return QueryUnbondingResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryUnbondingResponse): Uint8Array { + return QueryUnbondingResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUnbondingResponse): QueryUnbondingResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryUnbondingResponse", + value: QueryUnbondingResponse.encode(message).finish() + }; + } +}; +function createBaseQueryUserUnbondingsRequest(): QueryUserUnbondingsRequest { + return { + address: "" + }; +} +export const QueryUserUnbondingsRequest = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryUserUnbondingsRequest", + encode(message: QueryUserUnbondingsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryUserUnbondingsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUserUnbondingsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUserUnbondingsRequest { + const message = createBaseQueryUserUnbondingsRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryUserUnbondingsRequestAmino): QueryUserUnbondingsRequest { + const message = createBaseQueryUserUnbondingsRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryUserUnbondingsRequest, useInterfaces: boolean = false): QueryUserUnbondingsRequestAmino { + const obj: any = {}; + obj.address = message.address; + return obj; + }, + fromAminoMsg(object: QueryUserUnbondingsRequestAminoMsg): QueryUserUnbondingsRequest { + return QueryUserUnbondingsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryUserUnbondingsRequestProtoMsg, useInterfaces: boolean = false): QueryUserUnbondingsRequest { + return QueryUserUnbondingsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryUserUnbondingsRequest): Uint8Array { + return QueryUserUnbondingsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUserUnbondingsRequest): QueryUserUnbondingsRequestProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryUserUnbondingsRequest", + value: QueryUserUnbondingsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryUserUnbondingsResponse(): QueryUserUnbondingsResponse { + return { + userUnbondings: [] + }; +} +export const QueryUserUnbondingsResponse = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryUserUnbondingsResponse", + encode(message: QueryUserUnbondingsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.userUnbondings) { + UserUnbonding.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryUserUnbondingsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUserUnbondingsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userUnbondings.push(UserUnbonding.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUserUnbondingsResponse { + const message = createBaseQueryUserUnbondingsResponse(); + message.userUnbondings = object.userUnbondings?.map(e => UserUnbonding.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryUserUnbondingsResponseAmino): QueryUserUnbondingsResponse { + const message = createBaseQueryUserUnbondingsResponse(); + message.userUnbondings = object.user_unbondings?.map(e => UserUnbonding.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryUserUnbondingsResponse, useInterfaces: boolean = false): QueryUserUnbondingsResponseAmino { + const obj: any = {}; + if (message.userUnbondings) { + obj.user_unbondings = message.userUnbondings.map(e => e ? UserUnbonding.toAmino(e, useInterfaces) : undefined); + } else { + obj.user_unbondings = []; + } + return obj; + }, + fromAminoMsg(object: QueryUserUnbondingsResponseAminoMsg): QueryUserUnbondingsResponse { + return QueryUserUnbondingsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryUserUnbondingsResponseProtoMsg, useInterfaces: boolean = false): QueryUserUnbondingsResponse { + return QueryUserUnbondingsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryUserUnbondingsResponse): Uint8Array { + return QueryUserUnbondingsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUserUnbondingsResponse): QueryUserUnbondingsResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryUserUnbondingsResponse", + value: QueryUserUnbondingsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryHostChainUserUnbondingsRequest(): QueryHostChainUserUnbondingsRequest { + return { + chainId: "", + pagination: undefined + }; +} +export const QueryHostChainUserUnbondingsRequest = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryHostChainUserUnbondingsRequest", + encode(message: QueryHostChainUserUnbondingsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryHostChainUserUnbondingsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHostChainUserUnbondingsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryHostChainUserUnbondingsRequest { + const message = createBaseQueryHostChainUserUnbondingsRequest(); + message.chainId = object.chainId ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryHostChainUserUnbondingsRequestAmino): QueryHostChainUserUnbondingsRequest { + const message = createBaseQueryHostChainUserUnbondingsRequest(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryHostChainUserUnbondingsRequest, useInterfaces: boolean = false): QueryHostChainUserUnbondingsRequestAmino { + const obj: any = {}; + obj.chain_id = message.chainId; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryHostChainUserUnbondingsRequestAminoMsg): QueryHostChainUserUnbondingsRequest { + return QueryHostChainUserUnbondingsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryHostChainUserUnbondingsRequestProtoMsg, useInterfaces: boolean = false): QueryHostChainUserUnbondingsRequest { + return QueryHostChainUserUnbondingsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryHostChainUserUnbondingsRequest): Uint8Array { + return QueryHostChainUserUnbondingsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryHostChainUserUnbondingsRequest): QueryHostChainUserUnbondingsRequestProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryHostChainUserUnbondingsRequest", + value: QueryHostChainUserUnbondingsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryHostChainUserUnbondingsResponse(): QueryHostChainUserUnbondingsResponse { + return { + userUnbondings: [], + pagination: undefined + }; +} +export const QueryHostChainUserUnbondingsResponse = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryHostChainUserUnbondingsResponse", + encode(message: QueryHostChainUserUnbondingsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.userUnbondings) { + UserUnbonding.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryHostChainUserUnbondingsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHostChainUserUnbondingsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userUnbondings.push(UserUnbonding.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryHostChainUserUnbondingsResponse { + const message = createBaseQueryHostChainUserUnbondingsResponse(); + message.userUnbondings = object.userUnbondings?.map(e => UserUnbonding.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryHostChainUserUnbondingsResponseAmino): QueryHostChainUserUnbondingsResponse { + const message = createBaseQueryHostChainUserUnbondingsResponse(); + message.userUnbondings = object.user_unbondings?.map(e => UserUnbonding.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryHostChainUserUnbondingsResponse, useInterfaces: boolean = false): QueryHostChainUserUnbondingsResponseAmino { + const obj: any = {}; + if (message.userUnbondings) { + obj.user_unbondings = message.userUnbondings.map(e => e ? UserUnbonding.toAmino(e, useInterfaces) : undefined); + } else { + obj.user_unbondings = []; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryHostChainUserUnbondingsResponseAminoMsg): QueryHostChainUserUnbondingsResponse { + return QueryHostChainUserUnbondingsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryHostChainUserUnbondingsResponseProtoMsg, useInterfaces: boolean = false): QueryHostChainUserUnbondingsResponse { + return QueryHostChainUserUnbondingsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryHostChainUserUnbondingsResponse): Uint8Array { + return QueryHostChainUserUnbondingsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryHostChainUserUnbondingsResponse): QueryHostChainUserUnbondingsResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryHostChainUserUnbondingsResponse", + value: QueryHostChainUserUnbondingsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryValidatorUnbondingRequest(): QueryValidatorUnbondingRequest { + return { + chainId: "" + }; +} +export const QueryValidatorUnbondingRequest = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryValidatorUnbondingRequest", + encode(message: QueryValidatorUnbondingRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryValidatorUnbondingRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorUnbondingRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryValidatorUnbondingRequest { + const message = createBaseQueryValidatorUnbondingRequest(); + message.chainId = object.chainId ?? ""; + return message; + }, + fromAmino(object: QueryValidatorUnbondingRequestAmino): QueryValidatorUnbondingRequest { + const message = createBaseQueryValidatorUnbondingRequest(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + return message; + }, + toAmino(message: QueryValidatorUnbondingRequest, useInterfaces: boolean = false): QueryValidatorUnbondingRequestAmino { + const obj: any = {}; + obj.chain_id = message.chainId; + return obj; + }, + fromAminoMsg(object: QueryValidatorUnbondingRequestAminoMsg): QueryValidatorUnbondingRequest { + return QueryValidatorUnbondingRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryValidatorUnbondingRequestProtoMsg, useInterfaces: boolean = false): QueryValidatorUnbondingRequest { + return QueryValidatorUnbondingRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryValidatorUnbondingRequest): Uint8Array { + return QueryValidatorUnbondingRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorUnbondingRequest): QueryValidatorUnbondingRequestProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryValidatorUnbondingRequest", + value: QueryValidatorUnbondingRequest.encode(message).finish() + }; + } +}; +function createBaseQueryValidatorUnbondingResponse(): QueryValidatorUnbondingResponse { + return { + validatorUnbondings: [] + }; +} +export const QueryValidatorUnbondingResponse = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryValidatorUnbondingResponse", + encode(message: QueryValidatorUnbondingResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.validatorUnbondings) { + ValidatorUnbonding.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryValidatorUnbondingResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorUnbondingResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorUnbondings.push(ValidatorUnbonding.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryValidatorUnbondingResponse { + const message = createBaseQueryValidatorUnbondingResponse(); + message.validatorUnbondings = object.validatorUnbondings?.map(e => ValidatorUnbonding.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryValidatorUnbondingResponseAmino): QueryValidatorUnbondingResponse { + const message = createBaseQueryValidatorUnbondingResponse(); + message.validatorUnbondings = object.validator_unbondings?.map(e => ValidatorUnbonding.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryValidatorUnbondingResponse, useInterfaces: boolean = false): QueryValidatorUnbondingResponseAmino { + const obj: any = {}; + if (message.validatorUnbondings) { + obj.validator_unbondings = message.validatorUnbondings.map(e => e ? ValidatorUnbonding.toAmino(e, useInterfaces) : undefined); + } else { + obj.validator_unbondings = []; + } + return obj; + }, + fromAminoMsg(object: QueryValidatorUnbondingResponseAminoMsg): QueryValidatorUnbondingResponse { + return QueryValidatorUnbondingResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryValidatorUnbondingResponseProtoMsg, useInterfaces: boolean = false): QueryValidatorUnbondingResponse { + return QueryValidatorUnbondingResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryValidatorUnbondingResponse): Uint8Array { + return QueryValidatorUnbondingResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorUnbondingResponse): QueryValidatorUnbondingResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryValidatorUnbondingResponse", + value: QueryValidatorUnbondingResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDepositAccountBalanceRequest(): QueryDepositAccountBalanceRequest { + return { + chainId: "" + }; +} +export const QueryDepositAccountBalanceRequest = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryDepositAccountBalanceRequest", + encode(message: QueryDepositAccountBalanceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryDepositAccountBalanceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDepositAccountBalanceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDepositAccountBalanceRequest { + const message = createBaseQueryDepositAccountBalanceRequest(); + message.chainId = object.chainId ?? ""; + return message; + }, + fromAmino(object: QueryDepositAccountBalanceRequestAmino): QueryDepositAccountBalanceRequest { + const message = createBaseQueryDepositAccountBalanceRequest(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + return message; + }, + toAmino(message: QueryDepositAccountBalanceRequest, useInterfaces: boolean = false): QueryDepositAccountBalanceRequestAmino { + const obj: any = {}; + obj.chain_id = message.chainId; + return obj; + }, + fromAminoMsg(object: QueryDepositAccountBalanceRequestAminoMsg): QueryDepositAccountBalanceRequest { + return QueryDepositAccountBalanceRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDepositAccountBalanceRequestProtoMsg, useInterfaces: boolean = false): QueryDepositAccountBalanceRequest { + return QueryDepositAccountBalanceRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryDepositAccountBalanceRequest): Uint8Array { + return QueryDepositAccountBalanceRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDepositAccountBalanceRequest): QueryDepositAccountBalanceRequestProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryDepositAccountBalanceRequest", + value: QueryDepositAccountBalanceRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDepositAccountBalanceResponse(): QueryDepositAccountBalanceResponse { + return { + balance: Coin.fromPartial({}) + }; +} +export const QueryDepositAccountBalanceResponse = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryDepositAccountBalanceResponse", + encode(message: QueryDepositAccountBalanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryDepositAccountBalanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDepositAccountBalanceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balance = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDepositAccountBalanceResponse { + const message = createBaseQueryDepositAccountBalanceResponse(); + message.balance = object.balance !== undefined && object.balance !== null ? Coin.fromPartial(object.balance) : undefined; + return message; + }, + fromAmino(object: QueryDepositAccountBalanceResponseAmino): QueryDepositAccountBalanceResponse { + const message = createBaseQueryDepositAccountBalanceResponse(); + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } + return message; + }, + toAmino(message: QueryDepositAccountBalanceResponse, useInterfaces: boolean = false): QueryDepositAccountBalanceResponseAmino { + const obj: any = {}; + obj.balance = message.balance ? Coin.toAmino(message.balance, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDepositAccountBalanceResponseAminoMsg): QueryDepositAccountBalanceResponse { + return QueryDepositAccountBalanceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDepositAccountBalanceResponseProtoMsg, useInterfaces: boolean = false): QueryDepositAccountBalanceResponse { + return QueryDepositAccountBalanceResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryDepositAccountBalanceResponse): Uint8Array { + return QueryDepositAccountBalanceResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDepositAccountBalanceResponse): QueryDepositAccountBalanceResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryDepositAccountBalanceResponse", + value: QueryDepositAccountBalanceResponse.encode(message).finish() + }; + } +}; +function createBaseQueryExchangeRateRequest(): QueryExchangeRateRequest { + return { + chainId: "" + }; +} +export const QueryExchangeRateRequest = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryExchangeRateRequest", + encode(message: QueryExchangeRateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryExchangeRateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryExchangeRateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryExchangeRateRequest { + const message = createBaseQueryExchangeRateRequest(); + message.chainId = object.chainId ?? ""; + return message; + }, + fromAmino(object: QueryExchangeRateRequestAmino): QueryExchangeRateRequest { + const message = createBaseQueryExchangeRateRequest(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + return message; + }, + toAmino(message: QueryExchangeRateRequest, useInterfaces: boolean = false): QueryExchangeRateRequestAmino { + const obj: any = {}; + obj.chain_id = message.chainId; + return obj; + }, + fromAminoMsg(object: QueryExchangeRateRequestAminoMsg): QueryExchangeRateRequest { + return QueryExchangeRateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryExchangeRateRequestProtoMsg, useInterfaces: boolean = false): QueryExchangeRateRequest { + return QueryExchangeRateRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryExchangeRateRequest): Uint8Array { + return QueryExchangeRateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryExchangeRateRequest): QueryExchangeRateRequestProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryExchangeRateRequest", + value: QueryExchangeRateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryExchangeRateResponse(): QueryExchangeRateResponse { + return { + rate: "" + }; +} +export const QueryExchangeRateResponse = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryExchangeRateResponse", + encode(message: QueryExchangeRateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rate !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.rate, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryExchangeRateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryExchangeRateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rate = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryExchangeRateResponse { + const message = createBaseQueryExchangeRateResponse(); + message.rate = object.rate ?? ""; + return message; + }, + fromAmino(object: QueryExchangeRateResponseAmino): QueryExchangeRateResponse { + const message = createBaseQueryExchangeRateResponse(); + if (object.rate !== undefined && object.rate !== null) { + message.rate = object.rate; + } + return message; + }, + toAmino(message: QueryExchangeRateResponse, useInterfaces: boolean = false): QueryExchangeRateResponseAmino { + const obj: any = {}; + obj.rate = message.rate; + return obj; + }, + fromAminoMsg(object: QueryExchangeRateResponseAminoMsg): QueryExchangeRateResponse { + return QueryExchangeRateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryExchangeRateResponseProtoMsg, useInterfaces: boolean = false): QueryExchangeRateResponse { + return QueryExchangeRateResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryExchangeRateResponse): Uint8Array { + return QueryExchangeRateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryExchangeRateResponse): QueryExchangeRateResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryExchangeRateResponse", + value: QueryExchangeRateResponse.encode(message).finish() + }; + } +}; +function createBaseQueryRedelegationsRequest(): QueryRedelegationsRequest { + return { + chainId: "" + }; +} +export const QueryRedelegationsRequest = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryRedelegationsRequest", + encode(message: QueryRedelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryRedelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRedelegationsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryRedelegationsRequest { + const message = createBaseQueryRedelegationsRequest(); + message.chainId = object.chainId ?? ""; + return message; + }, + fromAmino(object: QueryRedelegationsRequestAmino): QueryRedelegationsRequest { + const message = createBaseQueryRedelegationsRequest(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + return message; + }, + toAmino(message: QueryRedelegationsRequest, useInterfaces: boolean = false): QueryRedelegationsRequestAmino { + const obj: any = {}; + obj.chain_id = message.chainId; + return obj; + }, + fromAminoMsg(object: QueryRedelegationsRequestAminoMsg): QueryRedelegationsRequest { + return QueryRedelegationsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryRedelegationsRequestProtoMsg, useInterfaces: boolean = false): QueryRedelegationsRequest { + return QueryRedelegationsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryRedelegationsRequest): Uint8Array { + return QueryRedelegationsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryRedelegationsRequest): QueryRedelegationsRequestProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryRedelegationsRequest", + value: QueryRedelegationsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryRedelegationsResponse(): QueryRedelegationsResponse { + return { + redelegations: undefined + }; +} +export const QueryRedelegationsResponse = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryRedelegationsResponse", + encode(message: QueryRedelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.redelegations !== undefined) { + Redelegations.encode(message.redelegations, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryRedelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRedelegationsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redelegations = Redelegations.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryRedelegationsResponse { + const message = createBaseQueryRedelegationsResponse(); + message.redelegations = object.redelegations !== undefined && object.redelegations !== null ? Redelegations.fromPartial(object.redelegations) : undefined; + return message; + }, + fromAmino(object: QueryRedelegationsResponseAmino): QueryRedelegationsResponse { + const message = createBaseQueryRedelegationsResponse(); + if (object.redelegations !== undefined && object.redelegations !== null) { + message.redelegations = Redelegations.fromAmino(object.redelegations); + } + return message; + }, + toAmino(message: QueryRedelegationsResponse, useInterfaces: boolean = false): QueryRedelegationsResponseAmino { + const obj: any = {}; + obj.redelegations = message.redelegations ? Redelegations.toAmino(message.redelegations, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRedelegationsResponseAminoMsg): QueryRedelegationsResponse { + return QueryRedelegationsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryRedelegationsResponseProtoMsg, useInterfaces: boolean = false): QueryRedelegationsResponse { + return QueryRedelegationsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryRedelegationsResponse): Uint8Array { + return QueryRedelegationsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryRedelegationsResponse): QueryRedelegationsResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryRedelegationsResponse", + value: QueryRedelegationsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryRedelegationTxRequest(): QueryRedelegationTxRequest { + return { + chainId: "" + }; +} +export const QueryRedelegationTxRequest = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryRedelegationTxRequest", + encode(message: QueryRedelegationTxRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryRedelegationTxRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRedelegationTxRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryRedelegationTxRequest { + const message = createBaseQueryRedelegationTxRequest(); + message.chainId = object.chainId ?? ""; + return message; + }, + fromAmino(object: QueryRedelegationTxRequestAmino): QueryRedelegationTxRequest { + const message = createBaseQueryRedelegationTxRequest(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + return message; + }, + toAmino(message: QueryRedelegationTxRequest, useInterfaces: boolean = false): QueryRedelegationTxRequestAmino { + const obj: any = {}; + obj.chain_id = message.chainId; + return obj; + }, + fromAminoMsg(object: QueryRedelegationTxRequestAminoMsg): QueryRedelegationTxRequest { + return QueryRedelegationTxRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryRedelegationTxRequestProtoMsg, useInterfaces: boolean = false): QueryRedelegationTxRequest { + return QueryRedelegationTxRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryRedelegationTxRequest): Uint8Array { + return QueryRedelegationTxRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryRedelegationTxRequest): QueryRedelegationTxRequestProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryRedelegationTxRequest", + value: QueryRedelegationTxRequest.encode(message).finish() + }; + } +}; +function createBaseQueryRedelegationTxResponse(): QueryRedelegationTxResponse { + return { + redelegationTx: [] + }; +} +export const QueryRedelegationTxResponse = { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryRedelegationTxResponse", + encode(message: QueryRedelegationTxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.redelegationTx) { + RedelegateTx.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryRedelegationTxResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRedelegationTxResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redelegationTx.push(RedelegateTx.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryRedelegationTxResponse { + const message = createBaseQueryRedelegationTxResponse(); + message.redelegationTx = object.redelegationTx?.map(e => RedelegateTx.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryRedelegationTxResponseAmino): QueryRedelegationTxResponse { + const message = createBaseQueryRedelegationTxResponse(); + message.redelegationTx = object.redelegation_tx?.map(e => RedelegateTx.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryRedelegationTxResponse, useInterfaces: boolean = false): QueryRedelegationTxResponseAmino { + const obj: any = {}; + if (message.redelegationTx) { + obj.redelegation_tx = message.redelegationTx.map(e => e ? RedelegateTx.toAmino(e, useInterfaces) : undefined); + } else { + obj.redelegation_tx = []; + } + return obj; + }, + fromAminoMsg(object: QueryRedelegationTxResponseAminoMsg): QueryRedelegationTxResponse { + return QueryRedelegationTxResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryRedelegationTxResponseProtoMsg, useInterfaces: boolean = false): QueryRedelegationTxResponse { + return QueryRedelegationTxResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryRedelegationTxResponse): Uint8Array { + return QueryRedelegationTxResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryRedelegationTxResponse): QueryRedelegationTxResponseProtoMsg { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.QueryRedelegationTxResponse", + value: QueryRedelegationTxResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/genesis.ts b/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/genesis.ts new file mode 100644 index 000000000..573ad6ea8 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/genesis.ts @@ -0,0 +1,228 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { HostChainParams, HostChainParamsAmino, HostChainParamsSDKType, AllowListedValidators, AllowListedValidatorsAmino, AllowListedValidatorsSDKType, DelegationState, DelegationStateAmino, DelegationStateSDKType, HostChainRewardAddress, HostChainRewardAddressAmino, HostChainRewardAddressSDKType, IBCAmountTransientStore, IBCAmountTransientStoreAmino, IBCAmountTransientStoreSDKType, UnbondingEpochCValue, UnbondingEpochCValueAmino, UnbondingEpochCValueSDKType, DelegatorUnbondingEpochEntry, DelegatorUnbondingEpochEntryAmino, DelegatorUnbondingEpochEntrySDKType, HostAccounts, HostAccountsAmino, HostAccountsSDKType } from "./lscosmos"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** GenesisState defines the lscosmos module's genesis state. */ +export interface GenesisState { + params: Params | undefined; + /** this line is used by starport scaffolding # genesis/proto/state */ + moduleEnabled: boolean; + hostChainParams: HostChainParams | undefined; + allowListedValidators: AllowListedValidators | undefined; + delegationState: DelegationState | undefined; + hostChainRewardAddress: HostChainRewardAddress | undefined; + iBCAmountTransientStore: IBCAmountTransientStore | undefined; + unbondingEpochCValues: UnbondingEpochCValue[]; + delegatorUnbondingEpochEntries: DelegatorUnbondingEpochEntry[]; + hostAccounts: HostAccounts | undefined; +} +export interface GenesisStateProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the lscosmos module's genesis state. */ +export interface GenesisStateAmino { + params?: ParamsAmino | undefined; + /** this line is used by starport scaffolding # genesis/proto/state */ + module_enabled?: boolean; + host_chain_params?: HostChainParamsAmino | undefined; + allow_listed_validators?: AllowListedValidatorsAmino | undefined; + delegation_state?: DelegationStateAmino | undefined; + host_chain_reward_address?: HostChainRewardAddressAmino | undefined; + i_b_c_amount_transient_store?: IBCAmountTransientStoreAmino | undefined; + unbonding_epoch_c_values?: UnbondingEpochCValueAmino[]; + delegator_unbonding_epoch_entries?: DelegatorUnbondingEpochEntryAmino[]; + host_accounts?: HostAccountsAmino | undefined; +} +export interface GenesisStateAminoMsg { + type: "/pstake.lscosmos.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the lscosmos module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType | undefined; + module_enabled: boolean; + host_chain_params: HostChainParamsSDKType | undefined; + allow_listed_validators: AllowListedValidatorsSDKType | undefined; + delegation_state: DelegationStateSDKType | undefined; + host_chain_reward_address: HostChainRewardAddressSDKType | undefined; + i_b_c_amount_transient_store: IBCAmountTransientStoreSDKType | undefined; + unbonding_epoch_c_values: UnbondingEpochCValueSDKType[]; + delegator_unbonding_epoch_entries: DelegatorUnbondingEpochEntrySDKType[]; + host_accounts: HostAccountsSDKType | undefined; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + moduleEnabled: false, + hostChainParams: HostChainParams.fromPartial({}), + allowListedValidators: AllowListedValidators.fromPartial({}), + delegationState: DelegationState.fromPartial({}), + hostChainRewardAddress: HostChainRewardAddress.fromPartial({}), + iBCAmountTransientStore: IBCAmountTransientStore.fromPartial({}), + unbondingEpochCValues: [], + delegatorUnbondingEpochEntries: [], + hostAccounts: HostAccounts.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/pstake.lscosmos.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + if (message.moduleEnabled === true) { + writer.uint32(16).bool(message.moduleEnabled); + } + if (message.hostChainParams !== undefined) { + HostChainParams.encode(message.hostChainParams, writer.uint32(26).fork()).ldelim(); + } + if (message.allowListedValidators !== undefined) { + AllowListedValidators.encode(message.allowListedValidators, writer.uint32(34).fork()).ldelim(); + } + if (message.delegationState !== undefined) { + DelegationState.encode(message.delegationState, writer.uint32(42).fork()).ldelim(); + } + if (message.hostChainRewardAddress !== undefined) { + HostChainRewardAddress.encode(message.hostChainRewardAddress, writer.uint32(50).fork()).ldelim(); + } + if (message.iBCAmountTransientStore !== undefined) { + IBCAmountTransientStore.encode(message.iBCAmountTransientStore, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.unbondingEpochCValues) { + UnbondingEpochCValue.encode(v!, writer.uint32(66).fork()).ldelim(); + } + for (const v of message.delegatorUnbondingEpochEntries) { + DelegatorUnbondingEpochEntry.encode(v!, writer.uint32(74).fork()).ldelim(); + } + if (message.hostAccounts !== undefined) { + HostAccounts.encode(message.hostAccounts, writer.uint32(82).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.moduleEnabled = reader.bool(); + break; + case 3: + message.hostChainParams = HostChainParams.decode(reader, reader.uint32(), useInterfaces); + break; + case 4: + message.allowListedValidators = AllowListedValidators.decode(reader, reader.uint32(), useInterfaces); + break; + case 5: + message.delegationState = DelegationState.decode(reader, reader.uint32(), useInterfaces); + break; + case 6: + message.hostChainRewardAddress = HostChainRewardAddress.decode(reader, reader.uint32(), useInterfaces); + break; + case 7: + message.iBCAmountTransientStore = IBCAmountTransientStore.decode(reader, reader.uint32(), useInterfaces); + break; + case 8: + message.unbondingEpochCValues.push(UnbondingEpochCValue.decode(reader, reader.uint32(), useInterfaces)); + break; + case 9: + message.delegatorUnbondingEpochEntries.push(DelegatorUnbondingEpochEntry.decode(reader, reader.uint32(), useInterfaces)); + break; + case 10: + message.hostAccounts = HostAccounts.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.moduleEnabled = object.moduleEnabled ?? false; + message.hostChainParams = object.hostChainParams !== undefined && object.hostChainParams !== null ? HostChainParams.fromPartial(object.hostChainParams) : undefined; + message.allowListedValidators = object.allowListedValidators !== undefined && object.allowListedValidators !== null ? AllowListedValidators.fromPartial(object.allowListedValidators) : undefined; + message.delegationState = object.delegationState !== undefined && object.delegationState !== null ? DelegationState.fromPartial(object.delegationState) : undefined; + message.hostChainRewardAddress = object.hostChainRewardAddress !== undefined && object.hostChainRewardAddress !== null ? HostChainRewardAddress.fromPartial(object.hostChainRewardAddress) : undefined; + message.iBCAmountTransientStore = object.iBCAmountTransientStore !== undefined && object.iBCAmountTransientStore !== null ? IBCAmountTransientStore.fromPartial(object.iBCAmountTransientStore) : undefined; + message.unbondingEpochCValues = object.unbondingEpochCValues?.map(e => UnbondingEpochCValue.fromPartial(e)) || []; + message.delegatorUnbondingEpochEntries = object.delegatorUnbondingEpochEntries?.map(e => DelegatorUnbondingEpochEntry.fromPartial(e)) || []; + message.hostAccounts = object.hostAccounts !== undefined && object.hostAccounts !== null ? HostAccounts.fromPartial(object.hostAccounts) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.module_enabled !== undefined && object.module_enabled !== null) { + message.moduleEnabled = object.module_enabled; + } + if (object.host_chain_params !== undefined && object.host_chain_params !== null) { + message.hostChainParams = HostChainParams.fromAmino(object.host_chain_params); + } + if (object.allow_listed_validators !== undefined && object.allow_listed_validators !== null) { + message.allowListedValidators = AllowListedValidators.fromAmino(object.allow_listed_validators); + } + if (object.delegation_state !== undefined && object.delegation_state !== null) { + message.delegationState = DelegationState.fromAmino(object.delegation_state); + } + if (object.host_chain_reward_address !== undefined && object.host_chain_reward_address !== null) { + message.hostChainRewardAddress = HostChainRewardAddress.fromAmino(object.host_chain_reward_address); + } + if (object.i_b_c_amount_transient_store !== undefined && object.i_b_c_amount_transient_store !== null) { + message.iBCAmountTransientStore = IBCAmountTransientStore.fromAmino(object.i_b_c_amount_transient_store); + } + message.unbondingEpochCValues = object.unbonding_epoch_c_values?.map(e => UnbondingEpochCValue.fromAmino(e)) || []; + message.delegatorUnbondingEpochEntries = object.delegator_unbonding_epoch_entries?.map(e => DelegatorUnbondingEpochEntry.fromAmino(e)) || []; + if (object.host_accounts !== undefined && object.host_accounts !== null) { + message.hostAccounts = HostAccounts.fromAmino(object.host_accounts); + } + return message; + }, + toAmino(message: GenesisState, useInterfaces: boolean = false): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + obj.module_enabled = message.moduleEnabled; + obj.host_chain_params = message.hostChainParams ? HostChainParams.toAmino(message.hostChainParams, useInterfaces) : undefined; + obj.allow_listed_validators = message.allowListedValidators ? AllowListedValidators.toAmino(message.allowListedValidators, useInterfaces) : undefined; + obj.delegation_state = message.delegationState ? DelegationState.toAmino(message.delegationState, useInterfaces) : undefined; + obj.host_chain_reward_address = message.hostChainRewardAddress ? HostChainRewardAddress.toAmino(message.hostChainRewardAddress, useInterfaces) : undefined; + obj.i_b_c_amount_transient_store = message.iBCAmountTransientStore ? IBCAmountTransientStore.toAmino(message.iBCAmountTransientStore, useInterfaces) : undefined; + if (message.unbondingEpochCValues) { + obj.unbonding_epoch_c_values = message.unbondingEpochCValues.map(e => e ? UnbondingEpochCValue.toAmino(e, useInterfaces) : undefined); + } else { + obj.unbonding_epoch_c_values = []; + } + if (message.delegatorUnbondingEpochEntries) { + obj.delegator_unbonding_epoch_entries = message.delegatorUnbondingEpochEntries.map(e => e ? DelegatorUnbondingEpochEntry.toAmino(e, useInterfaces) : undefined); + } else { + obj.delegator_unbonding_epoch_entries = []; + } + obj.host_accounts = message.hostAccounts ? HostAccounts.toAmino(message.hostAccounts, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg, useInterfaces: boolean = false): GenesisState { + return GenesisState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/governance_proposal.ts b/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/governance_proposal.ts new file mode 100644 index 000000000..f533806c4 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/governance_proposal.ts @@ -0,0 +1,402 @@ +import { AllowListedValidators, AllowListedValidatorsAmino, AllowListedValidatorsSDKType } from "./lscosmos"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +/** @deprecated */ +export interface MinDepositAndFeeChangeProposal { + title: string; + description: string; + minDeposit: string; + pstakeDepositFee: string; + pstakeRestakeFee: string; + pstakeUnstakeFee: string; + pstakeRedemptionFee: string; +} +export interface MinDepositAndFeeChangeProposalProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.MinDepositAndFeeChangeProposal"; + value: Uint8Array; +} +/** @deprecated */ +export interface MinDepositAndFeeChangeProposalAmino { + title?: string; + description?: string; + min_deposit?: string; + pstake_deposit_fee?: string; + pstake_restake_fee?: string; + pstake_unstake_fee?: string; + pstake_redemption_fee?: string; +} +export interface MinDepositAndFeeChangeProposalAminoMsg { + type: "/pstake.lscosmos.v1beta1.MinDepositAndFeeChangeProposal"; + value: MinDepositAndFeeChangeProposalAmino; +} +/** @deprecated */ +export interface MinDepositAndFeeChangeProposalSDKType { + title: string; + description: string; + min_deposit: string; + pstake_deposit_fee: string; + pstake_restake_fee: string; + pstake_unstake_fee: string; + pstake_redemption_fee: string; +} +/** @deprecated */ +export interface PstakeFeeAddressChangeProposal { + title: string; + description: string; + pstakeFeeAddress: string; +} +export interface PstakeFeeAddressChangeProposalProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.PstakeFeeAddressChangeProposal"; + value: Uint8Array; +} +/** @deprecated */ +export interface PstakeFeeAddressChangeProposalAmino { + title?: string; + description?: string; + pstake_fee_address?: string; +} +export interface PstakeFeeAddressChangeProposalAminoMsg { + type: "/pstake.lscosmos.v1beta1.PstakeFeeAddressChangeProposal"; + value: PstakeFeeAddressChangeProposalAmino; +} +/** @deprecated */ +export interface PstakeFeeAddressChangeProposalSDKType { + title: string; + description: string; + pstake_fee_address: string; +} +/** @deprecated */ +export interface AllowListedValidatorSetChangeProposal { + title: string; + description: string; + allowListedValidators: AllowListedValidators | undefined; +} +export interface AllowListedValidatorSetChangeProposalProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.AllowListedValidatorSetChangeProposal"; + value: Uint8Array; +} +/** @deprecated */ +export interface AllowListedValidatorSetChangeProposalAmino { + title?: string; + description?: string; + allow_listed_validators?: AllowListedValidatorsAmino | undefined; +} +export interface AllowListedValidatorSetChangeProposalAminoMsg { + type: "/pstake.lscosmos.v1beta1.AllowListedValidatorSetChangeProposal"; + value: AllowListedValidatorSetChangeProposalAmino; +} +/** @deprecated */ +export interface AllowListedValidatorSetChangeProposalSDKType { + title: string; + description: string; + allow_listed_validators: AllowListedValidatorsSDKType | undefined; +} +function createBaseMinDepositAndFeeChangeProposal(): MinDepositAndFeeChangeProposal { + return { + title: "", + description: "", + minDeposit: "", + pstakeDepositFee: "", + pstakeRestakeFee: "", + pstakeUnstakeFee: "", + pstakeRedemptionFee: "" + }; +} +export const MinDepositAndFeeChangeProposal = { + typeUrl: "/pstake.lscosmos.v1beta1.MinDepositAndFeeChangeProposal", + encode(message: MinDepositAndFeeChangeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.minDeposit !== "") { + writer.uint32(26).string(message.minDeposit); + } + if (message.pstakeDepositFee !== "") { + writer.uint32(34).string(Decimal.fromUserInput(message.pstakeDepositFee, 18).atomics); + } + if (message.pstakeRestakeFee !== "") { + writer.uint32(42).string(Decimal.fromUserInput(message.pstakeRestakeFee, 18).atomics); + } + if (message.pstakeUnstakeFee !== "") { + writer.uint32(50).string(Decimal.fromUserInput(message.pstakeUnstakeFee, 18).atomics); + } + if (message.pstakeRedemptionFee !== "") { + writer.uint32(58).string(Decimal.fromUserInput(message.pstakeRedemptionFee, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MinDepositAndFeeChangeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMinDepositAndFeeChangeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.minDeposit = reader.string(); + break; + case 4: + message.pstakeDepositFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 5: + message.pstakeRestakeFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 6: + message.pstakeUnstakeFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 7: + message.pstakeRedemptionFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MinDepositAndFeeChangeProposal { + const message = createBaseMinDepositAndFeeChangeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.minDeposit = object.minDeposit ?? ""; + message.pstakeDepositFee = object.pstakeDepositFee ?? ""; + message.pstakeRestakeFee = object.pstakeRestakeFee ?? ""; + message.pstakeUnstakeFee = object.pstakeUnstakeFee ?? ""; + message.pstakeRedemptionFee = object.pstakeRedemptionFee ?? ""; + return message; + }, + fromAmino(object: MinDepositAndFeeChangeProposalAmino): MinDepositAndFeeChangeProposal { + const message = createBaseMinDepositAndFeeChangeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.min_deposit !== undefined && object.min_deposit !== null) { + message.minDeposit = object.min_deposit; + } + if (object.pstake_deposit_fee !== undefined && object.pstake_deposit_fee !== null) { + message.pstakeDepositFee = object.pstake_deposit_fee; + } + if (object.pstake_restake_fee !== undefined && object.pstake_restake_fee !== null) { + message.pstakeRestakeFee = object.pstake_restake_fee; + } + if (object.pstake_unstake_fee !== undefined && object.pstake_unstake_fee !== null) { + message.pstakeUnstakeFee = object.pstake_unstake_fee; + } + if (object.pstake_redemption_fee !== undefined && object.pstake_redemption_fee !== null) { + message.pstakeRedemptionFee = object.pstake_redemption_fee; + } + return message; + }, + toAmino(message: MinDepositAndFeeChangeProposal, useInterfaces: boolean = false): MinDepositAndFeeChangeProposalAmino { + const obj: any = {}; + obj.title = message.title; + obj.description = message.description; + obj.min_deposit = message.minDeposit; + obj.pstake_deposit_fee = message.pstakeDepositFee; + obj.pstake_restake_fee = message.pstakeRestakeFee; + obj.pstake_unstake_fee = message.pstakeUnstakeFee; + obj.pstake_redemption_fee = message.pstakeRedemptionFee; + return obj; + }, + fromAminoMsg(object: MinDepositAndFeeChangeProposalAminoMsg): MinDepositAndFeeChangeProposal { + return MinDepositAndFeeChangeProposal.fromAmino(object.value); + }, + fromProtoMsg(message: MinDepositAndFeeChangeProposalProtoMsg, useInterfaces: boolean = false): MinDepositAndFeeChangeProposal { + return MinDepositAndFeeChangeProposal.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MinDepositAndFeeChangeProposal): Uint8Array { + return MinDepositAndFeeChangeProposal.encode(message).finish(); + }, + toProtoMsg(message: MinDepositAndFeeChangeProposal): MinDepositAndFeeChangeProposalProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MinDepositAndFeeChangeProposal", + value: MinDepositAndFeeChangeProposal.encode(message).finish() + }; + } +}; +function createBasePstakeFeeAddressChangeProposal(): PstakeFeeAddressChangeProposal { + return { + title: "", + description: "", + pstakeFeeAddress: "" + }; +} +export const PstakeFeeAddressChangeProposal = { + typeUrl: "/pstake.lscosmos.v1beta1.PstakeFeeAddressChangeProposal", + encode(message: PstakeFeeAddressChangeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.pstakeFeeAddress !== "") { + writer.uint32(26).string(message.pstakeFeeAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): PstakeFeeAddressChangeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePstakeFeeAddressChangeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.pstakeFeeAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PstakeFeeAddressChangeProposal { + const message = createBasePstakeFeeAddressChangeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.pstakeFeeAddress = object.pstakeFeeAddress ?? ""; + return message; + }, + fromAmino(object: PstakeFeeAddressChangeProposalAmino): PstakeFeeAddressChangeProposal { + const message = createBasePstakeFeeAddressChangeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.pstake_fee_address !== undefined && object.pstake_fee_address !== null) { + message.pstakeFeeAddress = object.pstake_fee_address; + } + return message; + }, + toAmino(message: PstakeFeeAddressChangeProposal, useInterfaces: boolean = false): PstakeFeeAddressChangeProposalAmino { + const obj: any = {}; + obj.title = message.title; + obj.description = message.description; + obj.pstake_fee_address = message.pstakeFeeAddress; + return obj; + }, + fromAminoMsg(object: PstakeFeeAddressChangeProposalAminoMsg): PstakeFeeAddressChangeProposal { + return PstakeFeeAddressChangeProposal.fromAmino(object.value); + }, + fromProtoMsg(message: PstakeFeeAddressChangeProposalProtoMsg, useInterfaces: boolean = false): PstakeFeeAddressChangeProposal { + return PstakeFeeAddressChangeProposal.decode(message.value, undefined, useInterfaces); + }, + toProto(message: PstakeFeeAddressChangeProposal): Uint8Array { + return PstakeFeeAddressChangeProposal.encode(message).finish(); + }, + toProtoMsg(message: PstakeFeeAddressChangeProposal): PstakeFeeAddressChangeProposalProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.PstakeFeeAddressChangeProposal", + value: PstakeFeeAddressChangeProposal.encode(message).finish() + }; + } +}; +function createBaseAllowListedValidatorSetChangeProposal(): AllowListedValidatorSetChangeProposal { + return { + title: "", + description: "", + allowListedValidators: AllowListedValidators.fromPartial({}) + }; +} +export const AllowListedValidatorSetChangeProposal = { + typeUrl: "/pstake.lscosmos.v1beta1.AllowListedValidatorSetChangeProposal", + encode(message: AllowListedValidatorSetChangeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.allowListedValidators !== undefined) { + AllowListedValidators.encode(message.allowListedValidators, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): AllowListedValidatorSetChangeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAllowListedValidatorSetChangeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.allowListedValidators = AllowListedValidators.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AllowListedValidatorSetChangeProposal { + const message = createBaseAllowListedValidatorSetChangeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.allowListedValidators = object.allowListedValidators !== undefined && object.allowListedValidators !== null ? AllowListedValidators.fromPartial(object.allowListedValidators) : undefined; + return message; + }, + fromAmino(object: AllowListedValidatorSetChangeProposalAmino): AllowListedValidatorSetChangeProposal { + const message = createBaseAllowListedValidatorSetChangeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.allow_listed_validators !== undefined && object.allow_listed_validators !== null) { + message.allowListedValidators = AllowListedValidators.fromAmino(object.allow_listed_validators); + } + return message; + }, + toAmino(message: AllowListedValidatorSetChangeProposal, useInterfaces: boolean = false): AllowListedValidatorSetChangeProposalAmino { + const obj: any = {}; + obj.title = message.title; + obj.description = message.description; + obj.allow_listed_validators = message.allowListedValidators ? AllowListedValidators.toAmino(message.allowListedValidators, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: AllowListedValidatorSetChangeProposalAminoMsg): AllowListedValidatorSetChangeProposal { + return AllowListedValidatorSetChangeProposal.fromAmino(object.value); + }, + fromProtoMsg(message: AllowListedValidatorSetChangeProposalProtoMsg, useInterfaces: boolean = false): AllowListedValidatorSetChangeProposal { + return AllowListedValidatorSetChangeProposal.decode(message.value, undefined, useInterfaces); + }, + toProto(message: AllowListedValidatorSetChangeProposal): Uint8Array { + return AllowListedValidatorSetChangeProposal.encode(message).finish(); + }, + toProtoMsg(message: AllowListedValidatorSetChangeProposal): AllowListedValidatorSetChangeProposalProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.AllowListedValidatorSetChangeProposal", + value: AllowListedValidatorSetChangeProposal.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/lscosmos.ts b/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/lscosmos.ts new file mode 100644 index 000000000..c892f4aad --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/lscosmos.ts @@ -0,0 +1,1636 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +export interface AllowListedValidators { + allowListedValidators: AllowListedValidator[]; +} +export interface AllowListedValidatorsProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.AllowListedValidators"; + value: Uint8Array; +} +export interface AllowListedValidatorsAmino { + allow_listed_validators?: AllowListedValidatorAmino[]; +} +export interface AllowListedValidatorsAminoMsg { + type: "/pstake.lscosmos.v1beta1.AllowListedValidators"; + value: AllowListedValidatorsAmino; +} +export interface AllowListedValidatorsSDKType { + allow_listed_validators: AllowListedValidatorSDKType[]; +} +export interface AllowListedValidator { + /** + * validator_address defines the bech32-encoded address the allowlisted + * validator + */ + validatorAddress: string; + /** + * target_weight specifies the target weight for liquid staking, unstaking + * amount, which is a value for calculating the real weight to be derived + * according to the active status + */ + targetWeight: string; +} +export interface AllowListedValidatorProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.AllowListedValidator"; + value: Uint8Array; +} +export interface AllowListedValidatorAmino { + /** + * validator_address defines the bech32-encoded address the allowlisted + * validator + */ + validator_address?: string; + /** + * target_weight specifies the target weight for liquid staking, unstaking + * amount, which is a value for calculating the real weight to be derived + * according to the active status + */ + target_weight?: string; +} +export interface AllowListedValidatorAminoMsg { + type: "/pstake.lscosmos.v1beta1.AllowListedValidator"; + value: AllowListedValidatorAmino; +} +export interface AllowListedValidatorSDKType { + validator_address: string; + target_weight: string; +} +export interface PstakeParams { + pstakeDepositFee: string; + pstakeRestakeFee: string; + pstakeUnstakeFee: string; + pstakeRedemptionFee: string; + pstakeFeeAddress: string; +} +export interface PstakeParamsProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.PstakeParams"; + value: Uint8Array; +} +export interface PstakeParamsAmino { + pstake_deposit_fee?: string; + pstake_restake_fee?: string; + pstake_unstake_fee?: string; + pstake_redemption_fee?: string; + pstake_fee_address?: string; +} +export interface PstakeParamsAminoMsg { + type: "/pstake.lscosmos.v1beta1.PstakeParams"; + value: PstakeParamsAmino; +} +export interface PstakeParamsSDKType { + pstake_deposit_fee: string; + pstake_restake_fee: string; + pstake_unstake_fee: string; + pstake_redemption_fee: string; + pstake_fee_address: string; +} +/** HostChainParams go into the DB */ +export interface HostChainParams { + chainID: string; + connectionID: string; + transferChannel: string; + transferPort: string; + baseDenom: string; + mintDenom: string; + minDeposit: string; + pstakeParams: PstakeParams | undefined; +} +export interface HostChainParamsProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.HostChainParams"; + value: Uint8Array; +} +/** HostChainParams go into the DB */ +export interface HostChainParamsAmino { + chain_i_d?: string; + connection_i_d?: string; + transfer_channel?: string; + transfer_port?: string; + base_denom?: string; + mint_denom?: string; + min_deposit?: string; + pstake_params?: PstakeParamsAmino | undefined; +} +export interface HostChainParamsAminoMsg { + type: "/pstake.lscosmos.v1beta1.HostChainParams"; + value: HostChainParamsAmino; +} +/** HostChainParams go into the DB */ +export interface HostChainParamsSDKType { + chain_i_d: string; + connection_i_d: string; + transfer_channel: string; + transfer_port: string; + base_denom: string; + mint_denom: string; + min_deposit: string; + pstake_params: PstakeParamsSDKType | undefined; +} +/** + * DelegationState stores module account balance, ica account balance, + * delegation state, undelegation state + */ +export interface DelegationState { + /** + * This field is necessary as the address of not blocked for send coins, + * we only should care about funds that have come via proper channels. + */ + hostDelegationAccountBalance: Coin[]; + hostChainDelegationAddress: string; + hostAccountDelegations: HostAccountDelegation[]; + hostAccountUndelegations: HostAccountUndelegation[]; +} +export interface DelegationStateProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.DelegationState"; + value: Uint8Array; +} +/** + * DelegationState stores module account balance, ica account balance, + * delegation state, undelegation state + */ +export interface DelegationStateAmino { + /** + * This field is necessary as the address of not blocked for send coins, + * we only should care about funds that have come via proper channels. + */ + host_delegation_account_balance?: CoinAmino[]; + host_chain_delegation_address?: string; + host_account_delegations?: HostAccountDelegationAmino[]; + host_account_undelegations?: HostAccountUndelegationAmino[]; +} +export interface DelegationStateAminoMsg { + type: "/pstake.lscosmos.v1beta1.DelegationState"; + value: DelegationStateAmino; +} +/** + * DelegationState stores module account balance, ica account balance, + * delegation state, undelegation state + */ +export interface DelegationStateSDKType { + host_delegation_account_balance: CoinSDKType[]; + host_chain_delegation_address: string; + host_account_delegations: HostAccountDelegationSDKType[]; + host_account_undelegations: HostAccountUndelegationSDKType[]; +} +export interface HostAccountDelegation { + validatorAddress: string; + amount: Coin | undefined; +} +export interface HostAccountDelegationProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.HostAccountDelegation"; + value: Uint8Array; +} +export interface HostAccountDelegationAmino { + validator_address?: string; + amount?: CoinAmino | undefined; +} +export interface HostAccountDelegationAminoMsg { + type: "/pstake.lscosmos.v1beta1.HostAccountDelegation"; + value: HostAccountDelegationAmino; +} +export interface HostAccountDelegationSDKType { + validator_address: string; + amount: CoinSDKType | undefined; +} +export interface HostAccountUndelegation { + epochNumber: bigint; + totalUndelegationAmount: Coin | undefined; + completionTime: Date | undefined; + undelegationEntries: UndelegationEntry[]; +} +export interface HostAccountUndelegationProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.HostAccountUndelegation"; + value: Uint8Array; +} +export interface HostAccountUndelegationAmino { + epoch_number?: string; + total_undelegation_amount?: CoinAmino | undefined; + completion_time?: string | undefined; + undelegation_entries?: UndelegationEntryAmino[]; +} +export interface HostAccountUndelegationAminoMsg { + type: "/pstake.lscosmos.v1beta1.HostAccountUndelegation"; + value: HostAccountUndelegationAmino; +} +export interface HostAccountUndelegationSDKType { + epoch_number: bigint; + total_undelegation_amount: CoinSDKType | undefined; + completion_time: Date | undefined; + undelegation_entries: UndelegationEntrySDKType[]; +} +export interface UndelegationEntry { + validatorAddress: string; + amount: Coin | undefined; +} +export interface UndelegationEntryProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.UndelegationEntry"; + value: Uint8Array; +} +export interface UndelegationEntryAmino { + validator_address?: string; + amount?: CoinAmino | undefined; +} +export interface UndelegationEntryAminoMsg { + type: "/pstake.lscosmos.v1beta1.UndelegationEntry"; + value: UndelegationEntryAmino; +} +export interface UndelegationEntrySDKType { + validator_address: string; + amount: CoinSDKType | undefined; +} +export interface HostChainRewardAddress { + address: string; +} +export interface HostChainRewardAddressProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.HostChainRewardAddress"; + value: Uint8Array; +} +export interface HostChainRewardAddressAmino { + address?: string; +} +export interface HostChainRewardAddressAminoMsg { + type: "/pstake.lscosmos.v1beta1.HostChainRewardAddress"; + value: HostChainRewardAddressAmino; +} +export interface HostChainRewardAddressSDKType { + address: string; +} +export interface IBCAmountTransientStore { + /** ibc_transfer stores only tokens which have ibc denoms "ibc/HEXHASH" */ + iBCTransfer: Coin[]; + /** ica_delegate stores only token which has staking baseDenom */ + iCADelegate: Coin | undefined; + undelegatonCompleteIBCTransfer: TransientUndelegationTransfer[]; +} +export interface IBCAmountTransientStoreProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.IBCAmountTransientStore"; + value: Uint8Array; +} +export interface IBCAmountTransientStoreAmino { + /** ibc_transfer stores only tokens which have ibc denoms "ibc/HEXHASH" */ + i_b_c_transfer?: CoinAmino[]; + /** ica_delegate stores only token which has staking baseDenom */ + i_c_a_delegate?: CoinAmino | undefined; + undelegaton_complete_i_b_c_transfer?: TransientUndelegationTransferAmino[]; +} +export interface IBCAmountTransientStoreAminoMsg { + type: "/pstake.lscosmos.v1beta1.IBCAmountTransientStore"; + value: IBCAmountTransientStoreAmino; +} +export interface IBCAmountTransientStoreSDKType { + i_b_c_transfer: CoinSDKType[]; + i_c_a_delegate: CoinSDKType | undefined; + undelegaton_complete_i_b_c_transfer: TransientUndelegationTransferSDKType[]; +} +export interface TransientUndelegationTransfer { + epochNumber: bigint; + amountUnbonded: Coin | undefined; +} +export interface TransientUndelegationTransferProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.TransientUndelegationTransfer"; + value: Uint8Array; +} +export interface TransientUndelegationTransferAmino { + epoch_number?: string; + amount_unbonded?: CoinAmino | undefined; +} +export interface TransientUndelegationTransferAminoMsg { + type: "/pstake.lscosmos.v1beta1.TransientUndelegationTransfer"; + value: TransientUndelegationTransferAmino; +} +export interface TransientUndelegationTransferSDKType { + epoch_number: bigint; + amount_unbonded: CoinSDKType | undefined; +} +export interface UnbondingEpochCValue { + epochNumber: bigint; + /** c_value = stk_burn.Amount/amount_unbonded.Amount */ + sTKBurn: Coin | undefined; + amountUnbonded: Coin | undefined; + isMatured: boolean; + isFailed: boolean; +} +export interface UnbondingEpochCValueProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.UnbondingEpochCValue"; + value: Uint8Array; +} +export interface UnbondingEpochCValueAmino { + epoch_number?: string; + /** c_value = stk_burn.Amount/amount_unbonded.Amount */ + s_t_k_burn?: CoinAmino | undefined; + amount_unbonded?: CoinAmino | undefined; + is_matured?: boolean; + is_failed?: boolean; +} +export interface UnbondingEpochCValueAminoMsg { + type: "/pstake.lscosmos.v1beta1.UnbondingEpochCValue"; + value: UnbondingEpochCValueAmino; +} +export interface UnbondingEpochCValueSDKType { + epoch_number: bigint; + s_t_k_burn: CoinSDKType | undefined; + amount_unbonded: CoinSDKType | undefined; + is_matured: boolean; + is_failed: boolean; +} +export interface DelegatorUnbondingEpochEntry { + delegatorAddress: string; + epochNumber: bigint; + amount: Coin | undefined; +} +export interface DelegatorUnbondingEpochEntryProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.DelegatorUnbondingEpochEntry"; + value: Uint8Array; +} +export interface DelegatorUnbondingEpochEntryAmino { + delegator_address?: string; + epoch_number?: string; + amount?: CoinAmino | undefined; +} +export interface DelegatorUnbondingEpochEntryAminoMsg { + type: "/pstake.lscosmos.v1beta1.DelegatorUnbondingEpochEntry"; + value: DelegatorUnbondingEpochEntryAmino; +} +export interface DelegatorUnbondingEpochEntrySDKType { + delegator_address: string; + epoch_number: bigint; + amount: CoinSDKType | undefined; +} +export interface HostAccounts { + delegatorAccountOwnerID: string; + rewardsAccountOwnerID: string; +} +export interface HostAccountsProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.HostAccounts"; + value: Uint8Array; +} +export interface HostAccountsAmino { + delegator_account_owner_i_d?: string; + rewards_account_owner_i_d?: string; +} +export interface HostAccountsAminoMsg { + type: "/pstake.lscosmos.v1beta1.HostAccounts"; + value: HostAccountsAmino; +} +export interface HostAccountsSDKType { + delegator_account_owner_i_d: string; + rewards_account_owner_i_d: string; +} +function createBaseAllowListedValidators(): AllowListedValidators { + return { + allowListedValidators: [] + }; +} +export const AllowListedValidators = { + typeUrl: "/pstake.lscosmos.v1beta1.AllowListedValidators", + encode(message: AllowListedValidators, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.allowListedValidators) { + AllowListedValidator.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): AllowListedValidators { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAllowListedValidators(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowListedValidators.push(AllowListedValidator.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AllowListedValidators { + const message = createBaseAllowListedValidators(); + message.allowListedValidators = object.allowListedValidators?.map(e => AllowListedValidator.fromPartial(e)) || []; + return message; + }, + fromAmino(object: AllowListedValidatorsAmino): AllowListedValidators { + const message = createBaseAllowListedValidators(); + message.allowListedValidators = object.allow_listed_validators?.map(e => AllowListedValidator.fromAmino(e)) || []; + return message; + }, + toAmino(message: AllowListedValidators, useInterfaces: boolean = false): AllowListedValidatorsAmino { + const obj: any = {}; + if (message.allowListedValidators) { + obj.allow_listed_validators = message.allowListedValidators.map(e => e ? AllowListedValidator.toAmino(e, useInterfaces) : undefined); + } else { + obj.allow_listed_validators = []; + } + return obj; + }, + fromAminoMsg(object: AllowListedValidatorsAminoMsg): AllowListedValidators { + return AllowListedValidators.fromAmino(object.value); + }, + fromProtoMsg(message: AllowListedValidatorsProtoMsg, useInterfaces: boolean = false): AllowListedValidators { + return AllowListedValidators.decode(message.value, undefined, useInterfaces); + }, + toProto(message: AllowListedValidators): Uint8Array { + return AllowListedValidators.encode(message).finish(); + }, + toProtoMsg(message: AllowListedValidators): AllowListedValidatorsProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.AllowListedValidators", + value: AllowListedValidators.encode(message).finish() + }; + } +}; +function createBaseAllowListedValidator(): AllowListedValidator { + return { + validatorAddress: "", + targetWeight: "" + }; +} +export const AllowListedValidator = { + typeUrl: "/pstake.lscosmos.v1beta1.AllowListedValidator", + encode(message: AllowListedValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (message.targetWeight !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.targetWeight, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): AllowListedValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAllowListedValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.targetWeight = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AllowListedValidator { + const message = createBaseAllowListedValidator(); + message.validatorAddress = object.validatorAddress ?? ""; + message.targetWeight = object.targetWeight ?? ""; + return message; + }, + fromAmino(object: AllowListedValidatorAmino): AllowListedValidator { + const message = createBaseAllowListedValidator(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.target_weight !== undefined && object.target_weight !== null) { + message.targetWeight = object.target_weight; + } + return message; + }, + toAmino(message: AllowListedValidator, useInterfaces: boolean = false): AllowListedValidatorAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress; + obj.target_weight = message.targetWeight; + return obj; + }, + fromAminoMsg(object: AllowListedValidatorAminoMsg): AllowListedValidator { + return AllowListedValidator.fromAmino(object.value); + }, + fromProtoMsg(message: AllowListedValidatorProtoMsg, useInterfaces: boolean = false): AllowListedValidator { + return AllowListedValidator.decode(message.value, undefined, useInterfaces); + }, + toProto(message: AllowListedValidator): Uint8Array { + return AllowListedValidator.encode(message).finish(); + }, + toProtoMsg(message: AllowListedValidator): AllowListedValidatorProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.AllowListedValidator", + value: AllowListedValidator.encode(message).finish() + }; + } +}; +function createBasePstakeParams(): PstakeParams { + return { + pstakeDepositFee: "", + pstakeRestakeFee: "", + pstakeUnstakeFee: "", + pstakeRedemptionFee: "", + pstakeFeeAddress: "" + }; +} +export const PstakeParams = { + typeUrl: "/pstake.lscosmos.v1beta1.PstakeParams", + encode(message: PstakeParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pstakeDepositFee !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.pstakeDepositFee, 18).atomics); + } + if (message.pstakeRestakeFee !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.pstakeRestakeFee, 18).atomics); + } + if (message.pstakeUnstakeFee !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.pstakeUnstakeFee, 18).atomics); + } + if (message.pstakeRedemptionFee !== "") { + writer.uint32(34).string(Decimal.fromUserInput(message.pstakeRedemptionFee, 18).atomics); + } + if (message.pstakeFeeAddress !== "") { + writer.uint32(42).string(message.pstakeFeeAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): PstakeParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePstakeParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pstakeDepositFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 2: + message.pstakeRestakeFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 3: + message.pstakeUnstakeFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 4: + message.pstakeRedemptionFee = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 5: + message.pstakeFeeAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PstakeParams { + const message = createBasePstakeParams(); + message.pstakeDepositFee = object.pstakeDepositFee ?? ""; + message.pstakeRestakeFee = object.pstakeRestakeFee ?? ""; + message.pstakeUnstakeFee = object.pstakeUnstakeFee ?? ""; + message.pstakeRedemptionFee = object.pstakeRedemptionFee ?? ""; + message.pstakeFeeAddress = object.pstakeFeeAddress ?? ""; + return message; + }, + fromAmino(object: PstakeParamsAmino): PstakeParams { + const message = createBasePstakeParams(); + if (object.pstake_deposit_fee !== undefined && object.pstake_deposit_fee !== null) { + message.pstakeDepositFee = object.pstake_deposit_fee; + } + if (object.pstake_restake_fee !== undefined && object.pstake_restake_fee !== null) { + message.pstakeRestakeFee = object.pstake_restake_fee; + } + if (object.pstake_unstake_fee !== undefined && object.pstake_unstake_fee !== null) { + message.pstakeUnstakeFee = object.pstake_unstake_fee; + } + if (object.pstake_redemption_fee !== undefined && object.pstake_redemption_fee !== null) { + message.pstakeRedemptionFee = object.pstake_redemption_fee; + } + if (object.pstake_fee_address !== undefined && object.pstake_fee_address !== null) { + message.pstakeFeeAddress = object.pstake_fee_address; + } + return message; + }, + toAmino(message: PstakeParams, useInterfaces: boolean = false): PstakeParamsAmino { + const obj: any = {}; + obj.pstake_deposit_fee = message.pstakeDepositFee; + obj.pstake_restake_fee = message.pstakeRestakeFee; + obj.pstake_unstake_fee = message.pstakeUnstakeFee; + obj.pstake_redemption_fee = message.pstakeRedemptionFee; + obj.pstake_fee_address = message.pstakeFeeAddress; + return obj; + }, + fromAminoMsg(object: PstakeParamsAminoMsg): PstakeParams { + return PstakeParams.fromAmino(object.value); + }, + fromProtoMsg(message: PstakeParamsProtoMsg, useInterfaces: boolean = false): PstakeParams { + return PstakeParams.decode(message.value, undefined, useInterfaces); + }, + toProto(message: PstakeParams): Uint8Array { + return PstakeParams.encode(message).finish(); + }, + toProtoMsg(message: PstakeParams): PstakeParamsProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.PstakeParams", + value: PstakeParams.encode(message).finish() + }; + } +}; +function createBaseHostChainParams(): HostChainParams { + return { + chainID: "", + connectionID: "", + transferChannel: "", + transferPort: "", + baseDenom: "", + mintDenom: "", + minDeposit: "", + pstakeParams: PstakeParams.fromPartial({}) + }; +} +export const HostChainParams = { + typeUrl: "/pstake.lscosmos.v1beta1.HostChainParams", + encode(message: HostChainParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainID !== "") { + writer.uint32(10).string(message.chainID); + } + if (message.connectionID !== "") { + writer.uint32(18).string(message.connectionID); + } + if (message.transferChannel !== "") { + writer.uint32(26).string(message.transferChannel); + } + if (message.transferPort !== "") { + writer.uint32(34).string(message.transferPort); + } + if (message.baseDenom !== "") { + writer.uint32(42).string(message.baseDenom); + } + if (message.mintDenom !== "") { + writer.uint32(50).string(message.mintDenom); + } + if (message.minDeposit !== "") { + writer.uint32(58).string(message.minDeposit); + } + if (message.pstakeParams !== undefined) { + PstakeParams.encode(message.pstakeParams, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): HostChainParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHostChainParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainID = reader.string(); + break; + case 2: + message.connectionID = reader.string(); + break; + case 3: + message.transferChannel = reader.string(); + break; + case 4: + message.transferPort = reader.string(); + break; + case 5: + message.baseDenom = reader.string(); + break; + case 6: + message.mintDenom = reader.string(); + break; + case 7: + message.minDeposit = reader.string(); + break; + case 8: + message.pstakeParams = PstakeParams.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): HostChainParams { + const message = createBaseHostChainParams(); + message.chainID = object.chainID ?? ""; + message.connectionID = object.connectionID ?? ""; + message.transferChannel = object.transferChannel ?? ""; + message.transferPort = object.transferPort ?? ""; + message.baseDenom = object.baseDenom ?? ""; + message.mintDenom = object.mintDenom ?? ""; + message.minDeposit = object.minDeposit ?? ""; + message.pstakeParams = object.pstakeParams !== undefined && object.pstakeParams !== null ? PstakeParams.fromPartial(object.pstakeParams) : undefined; + return message; + }, + fromAmino(object: HostChainParamsAmino): HostChainParams { + const message = createBaseHostChainParams(); + if (object.chain_i_d !== undefined && object.chain_i_d !== null) { + message.chainID = object.chain_i_d; + } + if (object.connection_i_d !== undefined && object.connection_i_d !== null) { + message.connectionID = object.connection_i_d; + } + if (object.transfer_channel !== undefined && object.transfer_channel !== null) { + message.transferChannel = object.transfer_channel; + } + if (object.transfer_port !== undefined && object.transfer_port !== null) { + message.transferPort = object.transfer_port; + } + if (object.base_denom !== undefined && object.base_denom !== null) { + message.baseDenom = object.base_denom; + } + if (object.mint_denom !== undefined && object.mint_denom !== null) { + message.mintDenom = object.mint_denom; + } + if (object.min_deposit !== undefined && object.min_deposit !== null) { + message.minDeposit = object.min_deposit; + } + if (object.pstake_params !== undefined && object.pstake_params !== null) { + message.pstakeParams = PstakeParams.fromAmino(object.pstake_params); + } + return message; + }, + toAmino(message: HostChainParams, useInterfaces: boolean = false): HostChainParamsAmino { + const obj: any = {}; + obj.chain_i_d = message.chainID; + obj.connection_i_d = message.connectionID; + obj.transfer_channel = message.transferChannel; + obj.transfer_port = message.transferPort; + obj.base_denom = message.baseDenom; + obj.mint_denom = message.mintDenom; + obj.min_deposit = message.minDeposit; + obj.pstake_params = message.pstakeParams ? PstakeParams.toAmino(message.pstakeParams, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: HostChainParamsAminoMsg): HostChainParams { + return HostChainParams.fromAmino(object.value); + }, + fromProtoMsg(message: HostChainParamsProtoMsg, useInterfaces: boolean = false): HostChainParams { + return HostChainParams.decode(message.value, undefined, useInterfaces); + }, + toProto(message: HostChainParams): Uint8Array { + return HostChainParams.encode(message).finish(); + }, + toProtoMsg(message: HostChainParams): HostChainParamsProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.HostChainParams", + value: HostChainParams.encode(message).finish() + }; + } +}; +function createBaseDelegationState(): DelegationState { + return { + hostDelegationAccountBalance: [], + hostChainDelegationAddress: "", + hostAccountDelegations: [], + hostAccountUndelegations: [] + }; +} +export const DelegationState = { + typeUrl: "/pstake.lscosmos.v1beta1.DelegationState", + encode(message: DelegationState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.hostDelegationAccountBalance) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.hostChainDelegationAddress !== "") { + writer.uint32(18).string(message.hostChainDelegationAddress); + } + for (const v of message.hostAccountDelegations) { + HostAccountDelegation.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.hostAccountUndelegations) { + HostAccountUndelegation.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): DelegationState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelegationState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hostDelegationAccountBalance.push(Coin.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.hostChainDelegationAddress = reader.string(); + break; + case 3: + message.hostAccountDelegations.push(HostAccountDelegation.decode(reader, reader.uint32(), useInterfaces)); + break; + case 4: + message.hostAccountUndelegations.push(HostAccountUndelegation.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DelegationState { + const message = createBaseDelegationState(); + message.hostDelegationAccountBalance = object.hostDelegationAccountBalance?.map(e => Coin.fromPartial(e)) || []; + message.hostChainDelegationAddress = object.hostChainDelegationAddress ?? ""; + message.hostAccountDelegations = object.hostAccountDelegations?.map(e => HostAccountDelegation.fromPartial(e)) || []; + message.hostAccountUndelegations = object.hostAccountUndelegations?.map(e => HostAccountUndelegation.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DelegationStateAmino): DelegationState { + const message = createBaseDelegationState(); + message.hostDelegationAccountBalance = object.host_delegation_account_balance?.map(e => Coin.fromAmino(e)) || []; + if (object.host_chain_delegation_address !== undefined && object.host_chain_delegation_address !== null) { + message.hostChainDelegationAddress = object.host_chain_delegation_address; + } + message.hostAccountDelegations = object.host_account_delegations?.map(e => HostAccountDelegation.fromAmino(e)) || []; + message.hostAccountUndelegations = object.host_account_undelegations?.map(e => HostAccountUndelegation.fromAmino(e)) || []; + return message; + }, + toAmino(message: DelegationState, useInterfaces: boolean = false): DelegationStateAmino { + const obj: any = {}; + if (message.hostDelegationAccountBalance) { + obj.host_delegation_account_balance = message.hostDelegationAccountBalance.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); + } else { + obj.host_delegation_account_balance = []; + } + obj.host_chain_delegation_address = message.hostChainDelegationAddress; + if (message.hostAccountDelegations) { + obj.host_account_delegations = message.hostAccountDelegations.map(e => e ? HostAccountDelegation.toAmino(e, useInterfaces) : undefined); + } else { + obj.host_account_delegations = []; + } + if (message.hostAccountUndelegations) { + obj.host_account_undelegations = message.hostAccountUndelegations.map(e => e ? HostAccountUndelegation.toAmino(e, useInterfaces) : undefined); + } else { + obj.host_account_undelegations = []; + } + return obj; + }, + fromAminoMsg(object: DelegationStateAminoMsg): DelegationState { + return DelegationState.fromAmino(object.value); + }, + fromProtoMsg(message: DelegationStateProtoMsg, useInterfaces: boolean = false): DelegationState { + return DelegationState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: DelegationState): Uint8Array { + return DelegationState.encode(message).finish(); + }, + toProtoMsg(message: DelegationState): DelegationStateProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.DelegationState", + value: DelegationState.encode(message).finish() + }; + } +}; +function createBaseHostAccountDelegation(): HostAccountDelegation { + return { + validatorAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const HostAccountDelegation = { + typeUrl: "/pstake.lscosmos.v1beta1.HostAccountDelegation", + encode(message: HostAccountDelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): HostAccountDelegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHostAccountDelegation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): HostAccountDelegation { + const message = createBaseHostAccountDelegation(); + message.validatorAddress = object.validatorAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: HostAccountDelegationAmino): HostAccountDelegation { + const message = createBaseHostAccountDelegation(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: HostAccountDelegation, useInterfaces: boolean = false): HostAccountDelegationAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: HostAccountDelegationAminoMsg): HostAccountDelegation { + return HostAccountDelegation.fromAmino(object.value); + }, + fromProtoMsg(message: HostAccountDelegationProtoMsg, useInterfaces: boolean = false): HostAccountDelegation { + return HostAccountDelegation.decode(message.value, undefined, useInterfaces); + }, + toProto(message: HostAccountDelegation): Uint8Array { + return HostAccountDelegation.encode(message).finish(); + }, + toProtoMsg(message: HostAccountDelegation): HostAccountDelegationProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.HostAccountDelegation", + value: HostAccountDelegation.encode(message).finish() + }; + } +}; +function createBaseHostAccountUndelegation(): HostAccountUndelegation { + return { + epochNumber: BigInt(0), + totalUndelegationAmount: Coin.fromPartial({}), + completionTime: new Date(), + undelegationEntries: [] + }; +} +export const HostAccountUndelegation = { + typeUrl: "/pstake.lscosmos.v1beta1.HostAccountUndelegation", + encode(message: HostAccountUndelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.epochNumber !== BigInt(0)) { + writer.uint32(8).int64(message.epochNumber); + } + if (message.totalUndelegationAmount !== undefined) { + Coin.encode(message.totalUndelegationAmount, writer.uint32(18).fork()).ldelim(); + } + if (message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(26).fork()).ldelim(); + } + for (const v of message.undelegationEntries) { + UndelegationEntry.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): HostAccountUndelegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHostAccountUndelegation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.epochNumber = reader.int64(); + break; + case 2: + message.totalUndelegationAmount = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 4: + message.undelegationEntries.push(UndelegationEntry.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): HostAccountUndelegation { + const message = createBaseHostAccountUndelegation(); + message.epochNumber = object.epochNumber !== undefined && object.epochNumber !== null ? BigInt(object.epochNumber.toString()) : BigInt(0); + message.totalUndelegationAmount = object.totalUndelegationAmount !== undefined && object.totalUndelegationAmount !== null ? Coin.fromPartial(object.totalUndelegationAmount) : undefined; + message.completionTime = object.completionTime ?? undefined; + message.undelegationEntries = object.undelegationEntries?.map(e => UndelegationEntry.fromPartial(e)) || []; + return message; + }, + fromAmino(object: HostAccountUndelegationAmino): HostAccountUndelegation { + const message = createBaseHostAccountUndelegation(); + if (object.epoch_number !== undefined && object.epoch_number !== null) { + message.epochNumber = BigInt(object.epoch_number); + } + if (object.total_undelegation_amount !== undefined && object.total_undelegation_amount !== null) { + message.totalUndelegationAmount = Coin.fromAmino(object.total_undelegation_amount); + } + if (object.completion_time !== undefined && object.completion_time !== null) { + message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time)); + } + message.undelegationEntries = object.undelegation_entries?.map(e => UndelegationEntry.fromAmino(e)) || []; + return message; + }, + toAmino(message: HostAccountUndelegation, useInterfaces: boolean = false): HostAccountUndelegationAmino { + const obj: any = {}; + obj.epoch_number = message.epochNumber ? message.epochNumber.toString() : undefined; + obj.total_undelegation_amount = message.totalUndelegationAmount ? Coin.toAmino(message.totalUndelegationAmount, useInterfaces) : undefined; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; + if (message.undelegationEntries) { + obj.undelegation_entries = message.undelegationEntries.map(e => e ? UndelegationEntry.toAmino(e, useInterfaces) : undefined); + } else { + obj.undelegation_entries = []; + } + return obj; + }, + fromAminoMsg(object: HostAccountUndelegationAminoMsg): HostAccountUndelegation { + return HostAccountUndelegation.fromAmino(object.value); + }, + fromProtoMsg(message: HostAccountUndelegationProtoMsg, useInterfaces: boolean = false): HostAccountUndelegation { + return HostAccountUndelegation.decode(message.value, undefined, useInterfaces); + }, + toProto(message: HostAccountUndelegation): Uint8Array { + return HostAccountUndelegation.encode(message).finish(); + }, + toProtoMsg(message: HostAccountUndelegation): HostAccountUndelegationProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.HostAccountUndelegation", + value: HostAccountUndelegation.encode(message).finish() + }; + } +}; +function createBaseUndelegationEntry(): UndelegationEntry { + return { + validatorAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const UndelegationEntry = { + typeUrl: "/pstake.lscosmos.v1beta1.UndelegationEntry", + encode(message: UndelegationEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): UndelegationEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUndelegationEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UndelegationEntry { + const message = createBaseUndelegationEntry(); + message.validatorAddress = object.validatorAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: UndelegationEntryAmino): UndelegationEntry { + const message = createBaseUndelegationEntry(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: UndelegationEntry, useInterfaces: boolean = false): UndelegationEntryAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: UndelegationEntryAminoMsg): UndelegationEntry { + return UndelegationEntry.fromAmino(object.value); + }, + fromProtoMsg(message: UndelegationEntryProtoMsg, useInterfaces: boolean = false): UndelegationEntry { + return UndelegationEntry.decode(message.value, undefined, useInterfaces); + }, + toProto(message: UndelegationEntry): Uint8Array { + return UndelegationEntry.encode(message).finish(); + }, + toProtoMsg(message: UndelegationEntry): UndelegationEntryProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.UndelegationEntry", + value: UndelegationEntry.encode(message).finish() + }; + } +}; +function createBaseHostChainRewardAddress(): HostChainRewardAddress { + return { + address: "" + }; +} +export const HostChainRewardAddress = { + typeUrl: "/pstake.lscosmos.v1beta1.HostChainRewardAddress", + encode(message: HostChainRewardAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): HostChainRewardAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHostChainRewardAddress(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): HostChainRewardAddress { + const message = createBaseHostChainRewardAddress(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: HostChainRewardAddressAmino): HostChainRewardAddress { + const message = createBaseHostChainRewardAddress(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: HostChainRewardAddress, useInterfaces: boolean = false): HostChainRewardAddressAmino { + const obj: any = {}; + obj.address = message.address; + return obj; + }, + fromAminoMsg(object: HostChainRewardAddressAminoMsg): HostChainRewardAddress { + return HostChainRewardAddress.fromAmino(object.value); + }, + fromProtoMsg(message: HostChainRewardAddressProtoMsg, useInterfaces: boolean = false): HostChainRewardAddress { + return HostChainRewardAddress.decode(message.value, undefined, useInterfaces); + }, + toProto(message: HostChainRewardAddress): Uint8Array { + return HostChainRewardAddress.encode(message).finish(); + }, + toProtoMsg(message: HostChainRewardAddress): HostChainRewardAddressProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.HostChainRewardAddress", + value: HostChainRewardAddress.encode(message).finish() + }; + } +}; +function createBaseIBCAmountTransientStore(): IBCAmountTransientStore { + return { + iBCTransfer: [], + iCADelegate: Coin.fromPartial({}), + undelegatonCompleteIBCTransfer: [] + }; +} +export const IBCAmountTransientStore = { + typeUrl: "/pstake.lscosmos.v1beta1.IBCAmountTransientStore", + encode(message: IBCAmountTransientStore, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.iBCTransfer) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.iCADelegate !== undefined) { + Coin.encode(message.iCADelegate, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.undelegatonCompleteIBCTransfer) { + TransientUndelegationTransfer.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): IBCAmountTransientStore { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIBCAmountTransientStore(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.iBCTransfer.push(Coin.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.iCADelegate = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.undelegatonCompleteIBCTransfer.push(TransientUndelegationTransfer.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IBCAmountTransientStore { + const message = createBaseIBCAmountTransientStore(); + message.iBCTransfer = object.iBCTransfer?.map(e => Coin.fromPartial(e)) || []; + message.iCADelegate = object.iCADelegate !== undefined && object.iCADelegate !== null ? Coin.fromPartial(object.iCADelegate) : undefined; + message.undelegatonCompleteIBCTransfer = object.undelegatonCompleteIBCTransfer?.map(e => TransientUndelegationTransfer.fromPartial(e)) || []; + return message; + }, + fromAmino(object: IBCAmountTransientStoreAmino): IBCAmountTransientStore { + const message = createBaseIBCAmountTransientStore(); + message.iBCTransfer = object.i_b_c_transfer?.map(e => Coin.fromAmino(e)) || []; + if (object.i_c_a_delegate !== undefined && object.i_c_a_delegate !== null) { + message.iCADelegate = Coin.fromAmino(object.i_c_a_delegate); + } + message.undelegatonCompleteIBCTransfer = object.undelegaton_complete_i_b_c_transfer?.map(e => TransientUndelegationTransfer.fromAmino(e)) || []; + return message; + }, + toAmino(message: IBCAmountTransientStore, useInterfaces: boolean = false): IBCAmountTransientStoreAmino { + const obj: any = {}; + if (message.iBCTransfer) { + obj.i_b_c_transfer = message.iBCTransfer.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); + } else { + obj.i_b_c_transfer = []; + } + obj.i_c_a_delegate = message.iCADelegate ? Coin.toAmino(message.iCADelegate, useInterfaces) : undefined; + if (message.undelegatonCompleteIBCTransfer) { + obj.undelegaton_complete_i_b_c_transfer = message.undelegatonCompleteIBCTransfer.map(e => e ? TransientUndelegationTransfer.toAmino(e, useInterfaces) : undefined); + } else { + obj.undelegaton_complete_i_b_c_transfer = []; + } + return obj; + }, + fromAminoMsg(object: IBCAmountTransientStoreAminoMsg): IBCAmountTransientStore { + return IBCAmountTransientStore.fromAmino(object.value); + }, + fromProtoMsg(message: IBCAmountTransientStoreProtoMsg, useInterfaces: boolean = false): IBCAmountTransientStore { + return IBCAmountTransientStore.decode(message.value, undefined, useInterfaces); + }, + toProto(message: IBCAmountTransientStore): Uint8Array { + return IBCAmountTransientStore.encode(message).finish(); + }, + toProtoMsg(message: IBCAmountTransientStore): IBCAmountTransientStoreProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.IBCAmountTransientStore", + value: IBCAmountTransientStore.encode(message).finish() + }; + } +}; +function createBaseTransientUndelegationTransfer(): TransientUndelegationTransfer { + return { + epochNumber: BigInt(0), + amountUnbonded: Coin.fromPartial({}) + }; +} +export const TransientUndelegationTransfer = { + typeUrl: "/pstake.lscosmos.v1beta1.TransientUndelegationTransfer", + encode(message: TransientUndelegationTransfer, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.epochNumber !== BigInt(0)) { + writer.uint32(8).int64(message.epochNumber); + } + if (message.amountUnbonded !== undefined) { + Coin.encode(message.amountUnbonded, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): TransientUndelegationTransfer { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTransientUndelegationTransfer(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.epochNumber = reader.int64(); + break; + case 2: + message.amountUnbonded = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TransientUndelegationTransfer { + const message = createBaseTransientUndelegationTransfer(); + message.epochNumber = object.epochNumber !== undefined && object.epochNumber !== null ? BigInt(object.epochNumber.toString()) : BigInt(0); + message.amountUnbonded = object.amountUnbonded !== undefined && object.amountUnbonded !== null ? Coin.fromPartial(object.amountUnbonded) : undefined; + return message; + }, + fromAmino(object: TransientUndelegationTransferAmino): TransientUndelegationTransfer { + const message = createBaseTransientUndelegationTransfer(); + if (object.epoch_number !== undefined && object.epoch_number !== null) { + message.epochNumber = BigInt(object.epoch_number); + } + if (object.amount_unbonded !== undefined && object.amount_unbonded !== null) { + message.amountUnbonded = Coin.fromAmino(object.amount_unbonded); + } + return message; + }, + toAmino(message: TransientUndelegationTransfer, useInterfaces: boolean = false): TransientUndelegationTransferAmino { + const obj: any = {}; + obj.epoch_number = message.epochNumber ? message.epochNumber.toString() : undefined; + obj.amount_unbonded = message.amountUnbonded ? Coin.toAmino(message.amountUnbonded, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: TransientUndelegationTransferAminoMsg): TransientUndelegationTransfer { + return TransientUndelegationTransfer.fromAmino(object.value); + }, + fromProtoMsg(message: TransientUndelegationTransferProtoMsg, useInterfaces: boolean = false): TransientUndelegationTransfer { + return TransientUndelegationTransfer.decode(message.value, undefined, useInterfaces); + }, + toProto(message: TransientUndelegationTransfer): Uint8Array { + return TransientUndelegationTransfer.encode(message).finish(); + }, + toProtoMsg(message: TransientUndelegationTransfer): TransientUndelegationTransferProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.TransientUndelegationTransfer", + value: TransientUndelegationTransfer.encode(message).finish() + }; + } +}; +function createBaseUnbondingEpochCValue(): UnbondingEpochCValue { + return { + epochNumber: BigInt(0), + sTKBurn: Coin.fromPartial({}), + amountUnbonded: Coin.fromPartial({}), + isMatured: false, + isFailed: false + }; +} +export const UnbondingEpochCValue = { + typeUrl: "/pstake.lscosmos.v1beta1.UnbondingEpochCValue", + encode(message: UnbondingEpochCValue, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.epochNumber !== BigInt(0)) { + writer.uint32(8).int64(message.epochNumber); + } + if (message.sTKBurn !== undefined) { + Coin.encode(message.sTKBurn, writer.uint32(18).fork()).ldelim(); + } + if (message.amountUnbonded !== undefined) { + Coin.encode(message.amountUnbonded, writer.uint32(26).fork()).ldelim(); + } + if (message.isMatured === true) { + writer.uint32(32).bool(message.isMatured); + } + if (message.isFailed === true) { + writer.uint32(40).bool(message.isFailed); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): UnbondingEpochCValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnbondingEpochCValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.epochNumber = reader.int64(); + break; + case 2: + message.sTKBurn = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.amountUnbonded = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + case 4: + message.isMatured = reader.bool(); + break; + case 5: + message.isFailed = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UnbondingEpochCValue { + const message = createBaseUnbondingEpochCValue(); + message.epochNumber = object.epochNumber !== undefined && object.epochNumber !== null ? BigInt(object.epochNumber.toString()) : BigInt(0); + message.sTKBurn = object.sTKBurn !== undefined && object.sTKBurn !== null ? Coin.fromPartial(object.sTKBurn) : undefined; + message.amountUnbonded = object.amountUnbonded !== undefined && object.amountUnbonded !== null ? Coin.fromPartial(object.amountUnbonded) : undefined; + message.isMatured = object.isMatured ?? false; + message.isFailed = object.isFailed ?? false; + return message; + }, + fromAmino(object: UnbondingEpochCValueAmino): UnbondingEpochCValue { + const message = createBaseUnbondingEpochCValue(); + if (object.epoch_number !== undefined && object.epoch_number !== null) { + message.epochNumber = BigInt(object.epoch_number); + } + if (object.s_t_k_burn !== undefined && object.s_t_k_burn !== null) { + message.sTKBurn = Coin.fromAmino(object.s_t_k_burn); + } + if (object.amount_unbonded !== undefined && object.amount_unbonded !== null) { + message.amountUnbonded = Coin.fromAmino(object.amount_unbonded); + } + if (object.is_matured !== undefined && object.is_matured !== null) { + message.isMatured = object.is_matured; + } + if (object.is_failed !== undefined && object.is_failed !== null) { + message.isFailed = object.is_failed; + } + return message; + }, + toAmino(message: UnbondingEpochCValue, useInterfaces: boolean = false): UnbondingEpochCValueAmino { + const obj: any = {}; + obj.epoch_number = message.epochNumber ? message.epochNumber.toString() : undefined; + obj.s_t_k_burn = message.sTKBurn ? Coin.toAmino(message.sTKBurn, useInterfaces) : undefined; + obj.amount_unbonded = message.amountUnbonded ? Coin.toAmino(message.amountUnbonded, useInterfaces) : undefined; + obj.is_matured = message.isMatured; + obj.is_failed = message.isFailed; + return obj; + }, + fromAminoMsg(object: UnbondingEpochCValueAminoMsg): UnbondingEpochCValue { + return UnbondingEpochCValue.fromAmino(object.value); + }, + fromProtoMsg(message: UnbondingEpochCValueProtoMsg, useInterfaces: boolean = false): UnbondingEpochCValue { + return UnbondingEpochCValue.decode(message.value, undefined, useInterfaces); + }, + toProto(message: UnbondingEpochCValue): Uint8Array { + return UnbondingEpochCValue.encode(message).finish(); + }, + toProtoMsg(message: UnbondingEpochCValue): UnbondingEpochCValueProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.UnbondingEpochCValue", + value: UnbondingEpochCValue.encode(message).finish() + }; + } +}; +function createBaseDelegatorUnbondingEpochEntry(): DelegatorUnbondingEpochEntry { + return { + delegatorAddress: "", + epochNumber: BigInt(0), + amount: Coin.fromPartial({}) + }; +} +export const DelegatorUnbondingEpochEntry = { + typeUrl: "/pstake.lscosmos.v1beta1.DelegatorUnbondingEpochEntry", + encode(message: DelegatorUnbondingEpochEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.epochNumber !== BigInt(0)) { + writer.uint32(16).int64(message.epochNumber); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): DelegatorUnbondingEpochEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelegatorUnbondingEpochEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.epochNumber = reader.int64(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DelegatorUnbondingEpochEntry { + const message = createBaseDelegatorUnbondingEpochEntry(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.epochNumber = object.epochNumber !== undefined && object.epochNumber !== null ? BigInt(object.epochNumber.toString()) : BigInt(0); + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: DelegatorUnbondingEpochEntryAmino): DelegatorUnbondingEpochEntry { + const message = createBaseDelegatorUnbondingEpochEntry(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.epoch_number !== undefined && object.epoch_number !== null) { + message.epochNumber = BigInt(object.epoch_number); + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: DelegatorUnbondingEpochEntry, useInterfaces: boolean = false): DelegatorUnbondingEpochEntryAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress; + obj.epoch_number = message.epochNumber ? message.epochNumber.toString() : undefined; + obj.amount = message.amount ? Coin.toAmino(message.amount, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: DelegatorUnbondingEpochEntryAminoMsg): DelegatorUnbondingEpochEntry { + return DelegatorUnbondingEpochEntry.fromAmino(object.value); + }, + fromProtoMsg(message: DelegatorUnbondingEpochEntryProtoMsg, useInterfaces: boolean = false): DelegatorUnbondingEpochEntry { + return DelegatorUnbondingEpochEntry.decode(message.value, undefined, useInterfaces); + }, + toProto(message: DelegatorUnbondingEpochEntry): Uint8Array { + return DelegatorUnbondingEpochEntry.encode(message).finish(); + }, + toProtoMsg(message: DelegatorUnbondingEpochEntry): DelegatorUnbondingEpochEntryProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.DelegatorUnbondingEpochEntry", + value: DelegatorUnbondingEpochEntry.encode(message).finish() + }; + } +}; +function createBaseHostAccounts(): HostAccounts { + return { + delegatorAccountOwnerID: "", + rewardsAccountOwnerID: "" + }; +} +export const HostAccounts = { + typeUrl: "/pstake.lscosmos.v1beta1.HostAccounts", + encode(message: HostAccounts, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAccountOwnerID !== "") { + writer.uint32(10).string(message.delegatorAccountOwnerID); + } + if (message.rewardsAccountOwnerID !== "") { + writer.uint32(18).string(message.rewardsAccountOwnerID); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): HostAccounts { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHostAccounts(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAccountOwnerID = reader.string(); + break; + case 2: + message.rewardsAccountOwnerID = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): HostAccounts { + const message = createBaseHostAccounts(); + message.delegatorAccountOwnerID = object.delegatorAccountOwnerID ?? ""; + message.rewardsAccountOwnerID = object.rewardsAccountOwnerID ?? ""; + return message; + }, + fromAmino(object: HostAccountsAmino): HostAccounts { + const message = createBaseHostAccounts(); + if (object.delegator_account_owner_i_d !== undefined && object.delegator_account_owner_i_d !== null) { + message.delegatorAccountOwnerID = object.delegator_account_owner_i_d; + } + if (object.rewards_account_owner_i_d !== undefined && object.rewards_account_owner_i_d !== null) { + message.rewardsAccountOwnerID = object.rewards_account_owner_i_d; + } + return message; + }, + toAmino(message: HostAccounts, useInterfaces: boolean = false): HostAccountsAmino { + const obj: any = {}; + obj.delegator_account_owner_i_d = message.delegatorAccountOwnerID; + obj.rewards_account_owner_i_d = message.rewardsAccountOwnerID; + return obj; + }, + fromAminoMsg(object: HostAccountsAminoMsg): HostAccounts { + return HostAccounts.fromAmino(object.value); + }, + fromProtoMsg(message: HostAccountsProtoMsg, useInterfaces: boolean = false): HostAccounts { + return HostAccounts.decode(message.value, undefined, useInterfaces); + }, + toProto(message: HostAccounts): Uint8Array { + return HostAccounts.encode(message).finish(); + }, + toProtoMsg(message: HostAccounts): HostAccountsProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.HostAccounts", + value: HostAccounts.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/msgs.amino.ts b/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/msgs.amino.ts new file mode 100644 index 000000000..73f45661f --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/msgs.amino.ts @@ -0,0 +1,43 @@ +import { MsgLiquidStake, MsgLiquidUnstake, MsgRedeem, MsgClaim, MsgRecreateICA, MsgJumpStart, MsgChangeModuleState, MsgReportSlashing } from "./msgs"; +export const AminoConverter = { + "/pstake.lscosmos.v1beta1.MsgLiquidStake": { + aminoType: "/pstake.lscosmos.v1beta1.MsgLiquidStake", + toAmino: MsgLiquidStake.toAmino, + fromAmino: MsgLiquidStake.fromAmino + }, + "/pstake.lscosmos.v1beta1.MsgLiquidUnstake": { + aminoType: "/pstake.lscosmos.v1beta1.MsgLiquidUnstake", + toAmino: MsgLiquidUnstake.toAmino, + fromAmino: MsgLiquidUnstake.fromAmino + }, + "/pstake.lscosmos.v1beta1.MsgRedeem": { + aminoType: "/pstake.lscosmos.v1beta1.MsgRedeem", + toAmino: MsgRedeem.toAmino, + fromAmino: MsgRedeem.fromAmino + }, + "/pstake.lscosmos.v1beta1.MsgClaim": { + aminoType: "/pstake.lscosmos.v1beta1.MsgClaim", + toAmino: MsgClaim.toAmino, + fromAmino: MsgClaim.fromAmino + }, + "/pstake.lscosmos.v1beta1.MsgRecreateICA": { + aminoType: "/pstake.lscosmos.v1beta1.MsgRecreateICA", + toAmino: MsgRecreateICA.toAmino, + fromAmino: MsgRecreateICA.fromAmino + }, + "/pstake.lscosmos.v1beta1.MsgJumpStart": { + aminoType: "/pstake.lscosmos.v1beta1.MsgJumpStart", + toAmino: MsgJumpStart.toAmino, + fromAmino: MsgJumpStart.fromAmino + }, + "/pstake.lscosmos.v1beta1.MsgChangeModuleState": { + aminoType: "/pstake.lscosmos.v1beta1.MsgChangeModuleState", + toAmino: MsgChangeModuleState.toAmino, + fromAmino: MsgChangeModuleState.fromAmino + }, + "/pstake.lscosmos.v1beta1.MsgReportSlashing": { + aminoType: "/pstake.lscosmos.v1beta1.MsgReportSlashing", + toAmino: MsgReportSlashing.toAmino, + fromAmino: MsgReportSlashing.fromAmino + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/msgs.registry.ts b/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/msgs.registry.ts new file mode 100644 index 000000000..93a248082 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/msgs.registry.ts @@ -0,0 +1,161 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgLiquidStake, MsgLiquidUnstake, MsgRedeem, MsgClaim, MsgRecreateICA, MsgJumpStart, MsgChangeModuleState, MsgReportSlashing } from "./msgs"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/pstake.lscosmos.v1beta1.MsgLiquidStake", MsgLiquidStake], ["/pstake.lscosmos.v1beta1.MsgLiquidUnstake", MsgLiquidUnstake], ["/pstake.lscosmos.v1beta1.MsgRedeem", MsgRedeem], ["/pstake.lscosmos.v1beta1.MsgClaim", MsgClaim], ["/pstake.lscosmos.v1beta1.MsgRecreateICA", MsgRecreateICA], ["/pstake.lscosmos.v1beta1.MsgJumpStart", MsgJumpStart], ["/pstake.lscosmos.v1beta1.MsgChangeModuleState", MsgChangeModuleState], ["/pstake.lscosmos.v1beta1.MsgReportSlashing", MsgReportSlashing]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + liquidStake(value: MsgLiquidStake) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidStake", + value: MsgLiquidStake.encode(value).finish() + }; + }, + liquidUnstake(value: MsgLiquidUnstake) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidUnstake", + value: MsgLiquidUnstake.encode(value).finish() + }; + }, + redeem(value: MsgRedeem) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRedeem", + value: MsgRedeem.encode(value).finish() + }; + }, + claim(value: MsgClaim) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgClaim", + value: MsgClaim.encode(value).finish() + }; + }, + recreateICA(value: MsgRecreateICA) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRecreateICA", + value: MsgRecreateICA.encode(value).finish() + }; + }, + jumpStart(value: MsgJumpStart) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgJumpStart", + value: MsgJumpStart.encode(value).finish() + }; + }, + changeModuleState(value: MsgChangeModuleState) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgChangeModuleState", + value: MsgChangeModuleState.encode(value).finish() + }; + }, + reportSlashing(value: MsgReportSlashing) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgReportSlashing", + value: MsgReportSlashing.encode(value).finish() + }; + } + }, + withTypeUrl: { + liquidStake(value: MsgLiquidStake) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidStake", + value + }; + }, + liquidUnstake(value: MsgLiquidUnstake) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidUnstake", + value + }; + }, + redeem(value: MsgRedeem) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRedeem", + value + }; + }, + claim(value: MsgClaim) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgClaim", + value + }; + }, + recreateICA(value: MsgRecreateICA) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRecreateICA", + value + }; + }, + jumpStart(value: MsgJumpStart) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgJumpStart", + value + }; + }, + changeModuleState(value: MsgChangeModuleState) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgChangeModuleState", + value + }; + }, + reportSlashing(value: MsgReportSlashing) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgReportSlashing", + value + }; + } + }, + fromPartial: { + liquidStake(value: MsgLiquidStake) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidStake", + value: MsgLiquidStake.fromPartial(value) + }; + }, + liquidUnstake(value: MsgLiquidUnstake) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidUnstake", + value: MsgLiquidUnstake.fromPartial(value) + }; + }, + redeem(value: MsgRedeem) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRedeem", + value: MsgRedeem.fromPartial(value) + }; + }, + claim(value: MsgClaim) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgClaim", + value: MsgClaim.fromPartial(value) + }; + }, + recreateICA(value: MsgRecreateICA) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRecreateICA", + value: MsgRecreateICA.fromPartial(value) + }; + }, + jumpStart(value: MsgJumpStart) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgJumpStart", + value: MsgJumpStart.fromPartial(value) + }; + }, + changeModuleState(value: MsgChangeModuleState) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgChangeModuleState", + value: MsgChangeModuleState.fromPartial(value) + }; + }, + reportSlashing(value: MsgReportSlashing) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgReportSlashing", + value: MsgReportSlashing.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/msgs.rpc.msg.ts b/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/msgs.rpc.msg.ts new file mode 100644 index 000000000..8a307ad34 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/msgs.rpc.msg.ts @@ -0,0 +1,68 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgLiquidStake, MsgLiquidStakeResponse, MsgLiquidUnstake, MsgLiquidUnstakeResponse, MsgRedeem, MsgRedeemResponse, MsgClaim, MsgClaimResponse, MsgRecreateICA, MsgRecreateICAResponse, MsgJumpStart, MsgJumpStartResponse, MsgChangeModuleState, MsgChangeModuleStateResponse, MsgReportSlashing, MsgReportSlashingResponse } from "./msgs"; +/** Msg defines the lsCosmos services. */ +export interface Msg { + liquidStake(request: MsgLiquidStake): Promise; + liquidUnstake(request: MsgLiquidUnstake): Promise; + redeem(request: MsgRedeem): Promise; + claim(request: MsgClaim): Promise; + recreateICA(request: MsgRecreateICA): Promise; + jumpStart(request: MsgJumpStart): Promise; + changeModuleState(request: MsgChangeModuleState): Promise; + reportSlashing(request: MsgReportSlashing): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.liquidStake = this.liquidStake.bind(this); + this.liquidUnstake = this.liquidUnstake.bind(this); + this.redeem = this.redeem.bind(this); + this.claim = this.claim.bind(this); + this.recreateICA = this.recreateICA.bind(this); + this.jumpStart = this.jumpStart.bind(this); + this.changeModuleState = this.changeModuleState.bind(this); + this.reportSlashing = this.reportSlashing.bind(this); + } + liquidStake(request: MsgLiquidStake, useInterfaces: boolean = true): Promise { + const data = MsgLiquidStake.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Msg", "LiquidStake", data); + return promise.then(data => MsgLiquidStakeResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + liquidUnstake(request: MsgLiquidUnstake, useInterfaces: boolean = true): Promise { + const data = MsgLiquidUnstake.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Msg", "LiquidUnstake", data); + return promise.then(data => MsgLiquidUnstakeResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + redeem(request: MsgRedeem, useInterfaces: boolean = true): Promise { + const data = MsgRedeem.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Msg", "Redeem", data); + return promise.then(data => MsgRedeemResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + claim(request: MsgClaim, useInterfaces: boolean = true): Promise { + const data = MsgClaim.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Msg", "Claim", data); + return promise.then(data => MsgClaimResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + recreateICA(request: MsgRecreateICA, useInterfaces: boolean = true): Promise { + const data = MsgRecreateICA.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Msg", "RecreateICA", data); + return promise.then(data => MsgRecreateICAResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + jumpStart(request: MsgJumpStart, useInterfaces: boolean = true): Promise { + const data = MsgJumpStart.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Msg", "JumpStart", data); + return promise.then(data => MsgJumpStartResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + changeModuleState(request: MsgChangeModuleState, useInterfaces: boolean = true): Promise { + const data = MsgChangeModuleState.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Msg", "ChangeModuleState", data); + return promise.then(data => MsgChangeModuleStateResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + reportSlashing(request: MsgReportSlashing, useInterfaces: boolean = true): Promise { + const data = MsgReportSlashing.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Msg", "ReportSlashing", data); + return promise.then(data => MsgReportSlashingResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/msgs.ts b/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/msgs.ts new file mode 100644 index 000000000..85178f4b2 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/msgs.ts @@ -0,0 +1,1356 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { AllowListedValidators, AllowListedValidatorsAmino, AllowListedValidatorsSDKType, PstakeParams, PstakeParamsAmino, PstakeParamsSDKType, HostAccounts, HostAccountsAmino, HostAccountsSDKType } from "./lscosmos"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +export interface MsgLiquidStake { + delegatorAddress: string; + amount: Coin | undefined; +} +export interface MsgLiquidStakeProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidStake"; + value: Uint8Array; +} +export interface MsgLiquidStakeAmino { + delegator_address?: string; + amount?: CoinAmino | undefined; +} +export interface MsgLiquidStakeAminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgLiquidStake"; + value: MsgLiquidStakeAmino; +} +export interface MsgLiquidStakeSDKType { + delegator_address: string; + amount: CoinSDKType | undefined; +} +export interface MsgLiquidStakeResponse {} +export interface MsgLiquidStakeResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidStakeResponse"; + value: Uint8Array; +} +export interface MsgLiquidStakeResponseAmino {} +export interface MsgLiquidStakeResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgLiquidStakeResponse"; + value: MsgLiquidStakeResponseAmino; +} +export interface MsgLiquidStakeResponseSDKType {} +export interface MsgLiquidUnstake { + delegatorAddress: string; + amount: Coin | undefined; +} +export interface MsgLiquidUnstakeProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidUnstake"; + value: Uint8Array; +} +export interface MsgLiquidUnstakeAmino { + delegator_address?: string; + amount?: CoinAmino | undefined; +} +export interface MsgLiquidUnstakeAminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgLiquidUnstake"; + value: MsgLiquidUnstakeAmino; +} +export interface MsgLiquidUnstakeSDKType { + delegator_address: string; + amount: CoinSDKType | undefined; +} +export interface MsgLiquidUnstakeResponse {} +export interface MsgLiquidUnstakeResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidUnstakeResponse"; + value: Uint8Array; +} +export interface MsgLiquidUnstakeResponseAmino {} +export interface MsgLiquidUnstakeResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgLiquidUnstakeResponse"; + value: MsgLiquidUnstakeResponseAmino; +} +export interface MsgLiquidUnstakeResponseSDKType {} +export interface MsgRedeem { + delegatorAddress: string; + amount: Coin | undefined; +} +export interface MsgRedeemProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRedeem"; + value: Uint8Array; +} +export interface MsgRedeemAmino { + delegator_address?: string; + amount?: CoinAmino | undefined; +} +export interface MsgRedeemAminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgRedeem"; + value: MsgRedeemAmino; +} +export interface MsgRedeemSDKType { + delegator_address: string; + amount: CoinSDKType | undefined; +} +export interface MsgRedeemResponse {} +export interface MsgRedeemResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRedeemResponse"; + value: Uint8Array; +} +export interface MsgRedeemResponseAmino {} +export interface MsgRedeemResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgRedeemResponse"; + value: MsgRedeemResponseAmino; +} +export interface MsgRedeemResponseSDKType {} +export interface MsgClaim { + delegatorAddress: string; +} +export interface MsgClaimProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.MsgClaim"; + value: Uint8Array; +} +export interface MsgClaimAmino { + delegator_address?: string; +} +export interface MsgClaimAminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgClaim"; + value: MsgClaimAmino; +} +export interface MsgClaimSDKType { + delegator_address: string; +} +export interface MsgClaimResponse {} +export interface MsgClaimResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.MsgClaimResponse"; + value: Uint8Array; +} +export interface MsgClaimResponseAmino {} +export interface MsgClaimResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgClaimResponse"; + value: MsgClaimResponseAmino; +} +export interface MsgClaimResponseSDKType {} +export interface MsgRecreateICA { + fromAddress: string; +} +export interface MsgRecreateICAProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRecreateICA"; + value: Uint8Array; +} +export interface MsgRecreateICAAmino { + from_address?: string; +} +export interface MsgRecreateICAAminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgRecreateICA"; + value: MsgRecreateICAAmino; +} +export interface MsgRecreateICASDKType { + from_address: string; +} +export interface MsgRecreateICAResponse {} +export interface MsgRecreateICAResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRecreateICAResponse"; + value: Uint8Array; +} +export interface MsgRecreateICAResponseAmino {} +export interface MsgRecreateICAResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgRecreateICAResponse"; + value: MsgRecreateICAResponseAmino; +} +export interface MsgRecreateICAResponseSDKType {} +export interface MsgJumpStart { + pstakeAddress: string; + chainID: string; + connectionID: string; + transferChannel: string; + transferPort: string; + baseDenom: string; + mintDenom: string; + minDeposit: string; + allowListedValidators: AllowListedValidators | undefined; + pstakeParams: PstakeParams | undefined; + hostAccounts: HostAccounts | undefined; +} +export interface MsgJumpStartProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.MsgJumpStart"; + value: Uint8Array; +} +export interface MsgJumpStartAmino { + pstake_address?: string; + chain_i_d?: string; + connection_i_d?: string; + transfer_channel?: string; + transfer_port?: string; + base_denom?: string; + mint_denom?: string; + min_deposit?: string; + allow_listed_validators?: AllowListedValidatorsAmino | undefined; + pstake_params?: PstakeParamsAmino | undefined; + host_accounts?: HostAccountsAmino | undefined; +} +export interface MsgJumpStartAminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgJumpStart"; + value: MsgJumpStartAmino; +} +export interface MsgJumpStartSDKType { + pstake_address: string; + chain_i_d: string; + connection_i_d: string; + transfer_channel: string; + transfer_port: string; + base_denom: string; + mint_denom: string; + min_deposit: string; + allow_listed_validators: AllowListedValidatorsSDKType | undefined; + pstake_params: PstakeParamsSDKType | undefined; + host_accounts: HostAccountsSDKType | undefined; +} +export interface MsgJumpStartResponse {} +export interface MsgJumpStartResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.MsgJumpStartResponse"; + value: Uint8Array; +} +export interface MsgJumpStartResponseAmino {} +export interface MsgJumpStartResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgJumpStartResponse"; + value: MsgJumpStartResponseAmino; +} +export interface MsgJumpStartResponseSDKType {} +export interface MsgChangeModuleState { + pstakeAddress: string; + moduleState: boolean; +} +export interface MsgChangeModuleStateProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.MsgChangeModuleState"; + value: Uint8Array; +} +export interface MsgChangeModuleStateAmino { + pstake_address?: string; + module_state?: boolean; +} +export interface MsgChangeModuleStateAminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgChangeModuleState"; + value: MsgChangeModuleStateAmino; +} +export interface MsgChangeModuleStateSDKType { + pstake_address: string; + module_state: boolean; +} +export interface MsgChangeModuleStateResponse {} +export interface MsgChangeModuleStateResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.MsgChangeModuleStateResponse"; + value: Uint8Array; +} +export interface MsgChangeModuleStateResponseAmino {} +export interface MsgChangeModuleStateResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgChangeModuleStateResponse"; + value: MsgChangeModuleStateResponseAmino; +} +export interface MsgChangeModuleStateResponseSDKType {} +export interface MsgReportSlashing { + pstakeAddress: string; + validatorAddress: string; +} +export interface MsgReportSlashingProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.MsgReportSlashing"; + value: Uint8Array; +} +export interface MsgReportSlashingAmino { + pstake_address?: string; + validator_address?: string; +} +export interface MsgReportSlashingAminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgReportSlashing"; + value: MsgReportSlashingAmino; +} +export interface MsgReportSlashingSDKType { + pstake_address: string; + validator_address: string; +} +export interface MsgReportSlashingResponse {} +export interface MsgReportSlashingResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.MsgReportSlashingResponse"; + value: Uint8Array; +} +export interface MsgReportSlashingResponseAmino {} +export interface MsgReportSlashingResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgReportSlashingResponse"; + value: MsgReportSlashingResponseAmino; +} +export interface MsgReportSlashingResponseSDKType {} +function createBaseMsgLiquidStake(): MsgLiquidStake { + return { + delegatorAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgLiquidStake = { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidStake", + encode(message: MsgLiquidStake, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgLiquidStake { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLiquidStake(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgLiquidStake { + const message = createBaseMsgLiquidStake(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgLiquidStakeAmino): MsgLiquidStake { + const message = createBaseMsgLiquidStake(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgLiquidStake, useInterfaces: boolean = false): MsgLiquidStakeAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgLiquidStakeAminoMsg): MsgLiquidStake { + return MsgLiquidStake.fromAmino(object.value); + }, + fromProtoMsg(message: MsgLiquidStakeProtoMsg, useInterfaces: boolean = false): MsgLiquidStake { + return MsgLiquidStake.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgLiquidStake): Uint8Array { + return MsgLiquidStake.encode(message).finish(); + }, + toProtoMsg(message: MsgLiquidStake): MsgLiquidStakeProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidStake", + value: MsgLiquidStake.encode(message).finish() + }; + } +}; +function createBaseMsgLiquidStakeResponse(): MsgLiquidStakeResponse { + return {}; +} +export const MsgLiquidStakeResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidStakeResponse", + encode(_: MsgLiquidStakeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgLiquidStakeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLiquidStakeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgLiquidStakeResponse { + const message = createBaseMsgLiquidStakeResponse(); + return message; + }, + fromAmino(_: MsgLiquidStakeResponseAmino): MsgLiquidStakeResponse { + const message = createBaseMsgLiquidStakeResponse(); + return message; + }, + toAmino(_: MsgLiquidStakeResponse, useInterfaces: boolean = false): MsgLiquidStakeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgLiquidStakeResponseAminoMsg): MsgLiquidStakeResponse { + return MsgLiquidStakeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgLiquidStakeResponseProtoMsg, useInterfaces: boolean = false): MsgLiquidStakeResponse { + return MsgLiquidStakeResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgLiquidStakeResponse): Uint8Array { + return MsgLiquidStakeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgLiquidStakeResponse): MsgLiquidStakeResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidStakeResponse", + value: MsgLiquidStakeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgLiquidUnstake(): MsgLiquidUnstake { + return { + delegatorAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgLiquidUnstake = { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidUnstake", + encode(message: MsgLiquidUnstake, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgLiquidUnstake { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLiquidUnstake(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgLiquidUnstake { + const message = createBaseMsgLiquidUnstake(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgLiquidUnstakeAmino): MsgLiquidUnstake { + const message = createBaseMsgLiquidUnstake(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgLiquidUnstake, useInterfaces: boolean = false): MsgLiquidUnstakeAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgLiquidUnstakeAminoMsg): MsgLiquidUnstake { + return MsgLiquidUnstake.fromAmino(object.value); + }, + fromProtoMsg(message: MsgLiquidUnstakeProtoMsg, useInterfaces: boolean = false): MsgLiquidUnstake { + return MsgLiquidUnstake.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgLiquidUnstake): Uint8Array { + return MsgLiquidUnstake.encode(message).finish(); + }, + toProtoMsg(message: MsgLiquidUnstake): MsgLiquidUnstakeProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidUnstake", + value: MsgLiquidUnstake.encode(message).finish() + }; + } +}; +function createBaseMsgLiquidUnstakeResponse(): MsgLiquidUnstakeResponse { + return {}; +} +export const MsgLiquidUnstakeResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidUnstakeResponse", + encode(_: MsgLiquidUnstakeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgLiquidUnstakeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLiquidUnstakeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgLiquidUnstakeResponse { + const message = createBaseMsgLiquidUnstakeResponse(); + return message; + }, + fromAmino(_: MsgLiquidUnstakeResponseAmino): MsgLiquidUnstakeResponse { + const message = createBaseMsgLiquidUnstakeResponse(); + return message; + }, + toAmino(_: MsgLiquidUnstakeResponse, useInterfaces: boolean = false): MsgLiquidUnstakeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgLiquidUnstakeResponseAminoMsg): MsgLiquidUnstakeResponse { + return MsgLiquidUnstakeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgLiquidUnstakeResponseProtoMsg, useInterfaces: boolean = false): MsgLiquidUnstakeResponse { + return MsgLiquidUnstakeResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgLiquidUnstakeResponse): Uint8Array { + return MsgLiquidUnstakeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgLiquidUnstakeResponse): MsgLiquidUnstakeResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidUnstakeResponse", + value: MsgLiquidUnstakeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgRedeem(): MsgRedeem { + return { + delegatorAddress: "", + amount: Coin.fromPartial({}) + }; +} +export const MsgRedeem = { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRedeem", + encode(message: MsgRedeem, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRedeem { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRedeem(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRedeem { + const message = createBaseMsgRedeem(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: MsgRedeemAmino): MsgRedeem { + const message = createBaseMsgRedeem(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: MsgRedeem, useInterfaces: boolean = false): MsgRedeemAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgRedeemAminoMsg): MsgRedeem { + return MsgRedeem.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRedeemProtoMsg, useInterfaces: boolean = false): MsgRedeem { + return MsgRedeem.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgRedeem): Uint8Array { + return MsgRedeem.encode(message).finish(); + }, + toProtoMsg(message: MsgRedeem): MsgRedeemProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRedeem", + value: MsgRedeem.encode(message).finish() + }; + } +}; +function createBaseMsgRedeemResponse(): MsgRedeemResponse { + return {}; +} +export const MsgRedeemResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRedeemResponse", + encode(_: MsgRedeemResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRedeemResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRedeemResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgRedeemResponse { + const message = createBaseMsgRedeemResponse(); + return message; + }, + fromAmino(_: MsgRedeemResponseAmino): MsgRedeemResponse { + const message = createBaseMsgRedeemResponse(); + return message; + }, + toAmino(_: MsgRedeemResponse, useInterfaces: boolean = false): MsgRedeemResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRedeemResponseAminoMsg): MsgRedeemResponse { + return MsgRedeemResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRedeemResponseProtoMsg, useInterfaces: boolean = false): MsgRedeemResponse { + return MsgRedeemResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgRedeemResponse): Uint8Array { + return MsgRedeemResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRedeemResponse): MsgRedeemResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRedeemResponse", + value: MsgRedeemResponse.encode(message).finish() + }; + } +}; +function createBaseMsgClaim(): MsgClaim { + return { + delegatorAddress: "" + }; +} +export const MsgClaim = { + typeUrl: "/pstake.lscosmos.v1beta1.MsgClaim", + encode(message: MsgClaim, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgClaim { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClaim(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgClaim { + const message = createBaseMsgClaim(); + message.delegatorAddress = object.delegatorAddress ?? ""; + return message; + }, + fromAmino(object: MsgClaimAmino): MsgClaim { + const message = createBaseMsgClaim(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; + }, + toAmino(message: MsgClaim, useInterfaces: boolean = false): MsgClaimAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress; + return obj; + }, + fromAminoMsg(object: MsgClaimAminoMsg): MsgClaim { + return MsgClaim.fromAmino(object.value); + }, + fromProtoMsg(message: MsgClaimProtoMsg, useInterfaces: boolean = false): MsgClaim { + return MsgClaim.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgClaim): Uint8Array { + return MsgClaim.encode(message).finish(); + }, + toProtoMsg(message: MsgClaim): MsgClaimProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgClaim", + value: MsgClaim.encode(message).finish() + }; + } +}; +function createBaseMsgClaimResponse(): MsgClaimResponse { + return {}; +} +export const MsgClaimResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.MsgClaimResponse", + encode(_: MsgClaimResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgClaimResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClaimResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgClaimResponse { + const message = createBaseMsgClaimResponse(); + return message; + }, + fromAmino(_: MsgClaimResponseAmino): MsgClaimResponse { + const message = createBaseMsgClaimResponse(); + return message; + }, + toAmino(_: MsgClaimResponse, useInterfaces: boolean = false): MsgClaimResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgClaimResponseAminoMsg): MsgClaimResponse { + return MsgClaimResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgClaimResponseProtoMsg, useInterfaces: boolean = false): MsgClaimResponse { + return MsgClaimResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgClaimResponse): Uint8Array { + return MsgClaimResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgClaimResponse): MsgClaimResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgClaimResponse", + value: MsgClaimResponse.encode(message).finish() + }; + } +}; +function createBaseMsgRecreateICA(): MsgRecreateICA { + return { + fromAddress: "" + }; +} +export const MsgRecreateICA = { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRecreateICA", + encode(message: MsgRecreateICA, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fromAddress !== "") { + writer.uint32(10).string(message.fromAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRecreateICA { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRecreateICA(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRecreateICA { + const message = createBaseMsgRecreateICA(); + message.fromAddress = object.fromAddress ?? ""; + return message; + }, + fromAmino(object: MsgRecreateICAAmino): MsgRecreateICA { + const message = createBaseMsgRecreateICA(); + if (object.from_address !== undefined && object.from_address !== null) { + message.fromAddress = object.from_address; + } + return message; + }, + toAmino(message: MsgRecreateICA, useInterfaces: boolean = false): MsgRecreateICAAmino { + const obj: any = {}; + obj.from_address = message.fromAddress; + return obj; + }, + fromAminoMsg(object: MsgRecreateICAAminoMsg): MsgRecreateICA { + return MsgRecreateICA.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRecreateICAProtoMsg, useInterfaces: boolean = false): MsgRecreateICA { + return MsgRecreateICA.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgRecreateICA): Uint8Array { + return MsgRecreateICA.encode(message).finish(); + }, + toProtoMsg(message: MsgRecreateICA): MsgRecreateICAProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRecreateICA", + value: MsgRecreateICA.encode(message).finish() + }; + } +}; +function createBaseMsgRecreateICAResponse(): MsgRecreateICAResponse { + return {}; +} +export const MsgRecreateICAResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRecreateICAResponse", + encode(_: MsgRecreateICAResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRecreateICAResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRecreateICAResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgRecreateICAResponse { + const message = createBaseMsgRecreateICAResponse(); + return message; + }, + fromAmino(_: MsgRecreateICAResponseAmino): MsgRecreateICAResponse { + const message = createBaseMsgRecreateICAResponse(); + return message; + }, + toAmino(_: MsgRecreateICAResponse, useInterfaces: boolean = false): MsgRecreateICAResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRecreateICAResponseAminoMsg): MsgRecreateICAResponse { + return MsgRecreateICAResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRecreateICAResponseProtoMsg, useInterfaces: boolean = false): MsgRecreateICAResponse { + return MsgRecreateICAResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgRecreateICAResponse): Uint8Array { + return MsgRecreateICAResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRecreateICAResponse): MsgRecreateICAResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRecreateICAResponse", + value: MsgRecreateICAResponse.encode(message).finish() + }; + } +}; +function createBaseMsgJumpStart(): MsgJumpStart { + return { + pstakeAddress: "", + chainID: "", + connectionID: "", + transferChannel: "", + transferPort: "", + baseDenom: "", + mintDenom: "", + minDeposit: "", + allowListedValidators: AllowListedValidators.fromPartial({}), + pstakeParams: PstakeParams.fromPartial({}), + hostAccounts: HostAccounts.fromPartial({}) + }; +} +export const MsgJumpStart = { + typeUrl: "/pstake.lscosmos.v1beta1.MsgJumpStart", + encode(message: MsgJumpStart, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pstakeAddress !== "") { + writer.uint32(10).string(message.pstakeAddress); + } + if (message.chainID !== "") { + writer.uint32(18).string(message.chainID); + } + if (message.connectionID !== "") { + writer.uint32(26).string(message.connectionID); + } + if (message.transferChannel !== "") { + writer.uint32(34).string(message.transferChannel); + } + if (message.transferPort !== "") { + writer.uint32(42).string(message.transferPort); + } + if (message.baseDenom !== "") { + writer.uint32(50).string(message.baseDenom); + } + if (message.mintDenom !== "") { + writer.uint32(58).string(message.mintDenom); + } + if (message.minDeposit !== "") { + writer.uint32(66).string(message.minDeposit); + } + if (message.allowListedValidators !== undefined) { + AllowListedValidators.encode(message.allowListedValidators, writer.uint32(74).fork()).ldelim(); + } + if (message.pstakeParams !== undefined) { + PstakeParams.encode(message.pstakeParams, writer.uint32(82).fork()).ldelim(); + } + if (message.hostAccounts !== undefined) { + HostAccounts.encode(message.hostAccounts, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgJumpStart { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgJumpStart(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pstakeAddress = reader.string(); + break; + case 2: + message.chainID = reader.string(); + break; + case 3: + message.connectionID = reader.string(); + break; + case 4: + message.transferChannel = reader.string(); + break; + case 5: + message.transferPort = reader.string(); + break; + case 6: + message.baseDenom = reader.string(); + break; + case 7: + message.mintDenom = reader.string(); + break; + case 8: + message.minDeposit = reader.string(); + break; + case 9: + message.allowListedValidators = AllowListedValidators.decode(reader, reader.uint32(), useInterfaces); + break; + case 10: + message.pstakeParams = PstakeParams.decode(reader, reader.uint32(), useInterfaces); + break; + case 11: + message.hostAccounts = HostAccounts.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgJumpStart { + const message = createBaseMsgJumpStart(); + message.pstakeAddress = object.pstakeAddress ?? ""; + message.chainID = object.chainID ?? ""; + message.connectionID = object.connectionID ?? ""; + message.transferChannel = object.transferChannel ?? ""; + message.transferPort = object.transferPort ?? ""; + message.baseDenom = object.baseDenom ?? ""; + message.mintDenom = object.mintDenom ?? ""; + message.minDeposit = object.minDeposit ?? ""; + message.allowListedValidators = object.allowListedValidators !== undefined && object.allowListedValidators !== null ? AllowListedValidators.fromPartial(object.allowListedValidators) : undefined; + message.pstakeParams = object.pstakeParams !== undefined && object.pstakeParams !== null ? PstakeParams.fromPartial(object.pstakeParams) : undefined; + message.hostAccounts = object.hostAccounts !== undefined && object.hostAccounts !== null ? HostAccounts.fromPartial(object.hostAccounts) : undefined; + return message; + }, + fromAmino(object: MsgJumpStartAmino): MsgJumpStart { + const message = createBaseMsgJumpStart(); + if (object.pstake_address !== undefined && object.pstake_address !== null) { + message.pstakeAddress = object.pstake_address; + } + if (object.chain_i_d !== undefined && object.chain_i_d !== null) { + message.chainID = object.chain_i_d; + } + if (object.connection_i_d !== undefined && object.connection_i_d !== null) { + message.connectionID = object.connection_i_d; + } + if (object.transfer_channel !== undefined && object.transfer_channel !== null) { + message.transferChannel = object.transfer_channel; + } + if (object.transfer_port !== undefined && object.transfer_port !== null) { + message.transferPort = object.transfer_port; + } + if (object.base_denom !== undefined && object.base_denom !== null) { + message.baseDenom = object.base_denom; + } + if (object.mint_denom !== undefined && object.mint_denom !== null) { + message.mintDenom = object.mint_denom; + } + if (object.min_deposit !== undefined && object.min_deposit !== null) { + message.minDeposit = object.min_deposit; + } + if (object.allow_listed_validators !== undefined && object.allow_listed_validators !== null) { + message.allowListedValidators = AllowListedValidators.fromAmino(object.allow_listed_validators); + } + if (object.pstake_params !== undefined && object.pstake_params !== null) { + message.pstakeParams = PstakeParams.fromAmino(object.pstake_params); + } + if (object.host_accounts !== undefined && object.host_accounts !== null) { + message.hostAccounts = HostAccounts.fromAmino(object.host_accounts); + } + return message; + }, + toAmino(message: MsgJumpStart, useInterfaces: boolean = false): MsgJumpStartAmino { + const obj: any = {}; + obj.pstake_address = message.pstakeAddress; + obj.chain_i_d = message.chainID; + obj.connection_i_d = message.connectionID; + obj.transfer_channel = message.transferChannel; + obj.transfer_port = message.transferPort; + obj.base_denom = message.baseDenom; + obj.mint_denom = message.mintDenom; + obj.min_deposit = message.minDeposit; + obj.allow_listed_validators = message.allowListedValidators ? AllowListedValidators.toAmino(message.allowListedValidators, useInterfaces) : undefined; + obj.pstake_params = message.pstakeParams ? PstakeParams.toAmino(message.pstakeParams, useInterfaces) : undefined; + obj.host_accounts = message.hostAccounts ? HostAccounts.toAmino(message.hostAccounts, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgJumpStartAminoMsg): MsgJumpStart { + return MsgJumpStart.fromAmino(object.value); + }, + fromProtoMsg(message: MsgJumpStartProtoMsg, useInterfaces: boolean = false): MsgJumpStart { + return MsgJumpStart.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgJumpStart): Uint8Array { + return MsgJumpStart.encode(message).finish(); + }, + toProtoMsg(message: MsgJumpStart): MsgJumpStartProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgJumpStart", + value: MsgJumpStart.encode(message).finish() + }; + } +}; +function createBaseMsgJumpStartResponse(): MsgJumpStartResponse { + return {}; +} +export const MsgJumpStartResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.MsgJumpStartResponse", + encode(_: MsgJumpStartResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgJumpStartResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgJumpStartResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgJumpStartResponse { + const message = createBaseMsgJumpStartResponse(); + return message; + }, + fromAmino(_: MsgJumpStartResponseAmino): MsgJumpStartResponse { + const message = createBaseMsgJumpStartResponse(); + return message; + }, + toAmino(_: MsgJumpStartResponse, useInterfaces: boolean = false): MsgJumpStartResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgJumpStartResponseAminoMsg): MsgJumpStartResponse { + return MsgJumpStartResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgJumpStartResponseProtoMsg, useInterfaces: boolean = false): MsgJumpStartResponse { + return MsgJumpStartResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgJumpStartResponse): Uint8Array { + return MsgJumpStartResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgJumpStartResponse): MsgJumpStartResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgJumpStartResponse", + value: MsgJumpStartResponse.encode(message).finish() + }; + } +}; +function createBaseMsgChangeModuleState(): MsgChangeModuleState { + return { + pstakeAddress: "", + moduleState: false + }; +} +export const MsgChangeModuleState = { + typeUrl: "/pstake.lscosmos.v1beta1.MsgChangeModuleState", + encode(message: MsgChangeModuleState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pstakeAddress !== "") { + writer.uint32(10).string(message.pstakeAddress); + } + if (message.moduleState === true) { + writer.uint32(16).bool(message.moduleState); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgChangeModuleState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChangeModuleState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pstakeAddress = reader.string(); + break; + case 2: + message.moduleState = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChangeModuleState { + const message = createBaseMsgChangeModuleState(); + message.pstakeAddress = object.pstakeAddress ?? ""; + message.moduleState = object.moduleState ?? false; + return message; + }, + fromAmino(object: MsgChangeModuleStateAmino): MsgChangeModuleState { + const message = createBaseMsgChangeModuleState(); + if (object.pstake_address !== undefined && object.pstake_address !== null) { + message.pstakeAddress = object.pstake_address; + } + if (object.module_state !== undefined && object.module_state !== null) { + message.moduleState = object.module_state; + } + return message; + }, + toAmino(message: MsgChangeModuleState, useInterfaces: boolean = false): MsgChangeModuleStateAmino { + const obj: any = {}; + obj.pstake_address = message.pstakeAddress; + obj.module_state = message.moduleState; + return obj; + }, + fromAminoMsg(object: MsgChangeModuleStateAminoMsg): MsgChangeModuleState { + return MsgChangeModuleState.fromAmino(object.value); + }, + fromProtoMsg(message: MsgChangeModuleStateProtoMsg, useInterfaces: boolean = false): MsgChangeModuleState { + return MsgChangeModuleState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgChangeModuleState): Uint8Array { + return MsgChangeModuleState.encode(message).finish(); + }, + toProtoMsg(message: MsgChangeModuleState): MsgChangeModuleStateProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgChangeModuleState", + value: MsgChangeModuleState.encode(message).finish() + }; + } +}; +function createBaseMsgChangeModuleStateResponse(): MsgChangeModuleStateResponse { + return {}; +} +export const MsgChangeModuleStateResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.MsgChangeModuleStateResponse", + encode(_: MsgChangeModuleStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgChangeModuleStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChangeModuleStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgChangeModuleStateResponse { + const message = createBaseMsgChangeModuleStateResponse(); + return message; + }, + fromAmino(_: MsgChangeModuleStateResponseAmino): MsgChangeModuleStateResponse { + const message = createBaseMsgChangeModuleStateResponse(); + return message; + }, + toAmino(_: MsgChangeModuleStateResponse, useInterfaces: boolean = false): MsgChangeModuleStateResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChangeModuleStateResponseAminoMsg): MsgChangeModuleStateResponse { + return MsgChangeModuleStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgChangeModuleStateResponseProtoMsg, useInterfaces: boolean = false): MsgChangeModuleStateResponse { + return MsgChangeModuleStateResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgChangeModuleStateResponse): Uint8Array { + return MsgChangeModuleStateResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChangeModuleStateResponse): MsgChangeModuleStateResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgChangeModuleStateResponse", + value: MsgChangeModuleStateResponse.encode(message).finish() + }; + } +}; +function createBaseMsgReportSlashing(): MsgReportSlashing { + return { + pstakeAddress: "", + validatorAddress: "" + }; +} +export const MsgReportSlashing = { + typeUrl: "/pstake.lscosmos.v1beta1.MsgReportSlashing", + encode(message: MsgReportSlashing, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pstakeAddress !== "") { + writer.uint32(10).string(message.pstakeAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgReportSlashing { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgReportSlashing(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pstakeAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgReportSlashing { + const message = createBaseMsgReportSlashing(); + message.pstakeAddress = object.pstakeAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + return message; + }, + fromAmino(object: MsgReportSlashingAmino): MsgReportSlashing { + const message = createBaseMsgReportSlashing(); + if (object.pstake_address !== undefined && object.pstake_address !== null) { + message.pstakeAddress = object.pstake_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; + }, + toAmino(message: MsgReportSlashing, useInterfaces: boolean = false): MsgReportSlashingAmino { + const obj: any = {}; + obj.pstake_address = message.pstakeAddress; + obj.validator_address = message.validatorAddress; + return obj; + }, + fromAminoMsg(object: MsgReportSlashingAminoMsg): MsgReportSlashing { + return MsgReportSlashing.fromAmino(object.value); + }, + fromProtoMsg(message: MsgReportSlashingProtoMsg, useInterfaces: boolean = false): MsgReportSlashing { + return MsgReportSlashing.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgReportSlashing): Uint8Array { + return MsgReportSlashing.encode(message).finish(); + }, + toProtoMsg(message: MsgReportSlashing): MsgReportSlashingProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgReportSlashing", + value: MsgReportSlashing.encode(message).finish() + }; + } +}; +function createBaseMsgReportSlashingResponse(): MsgReportSlashingResponse { + return {}; +} +export const MsgReportSlashingResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.MsgReportSlashingResponse", + encode(_: MsgReportSlashingResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgReportSlashingResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgReportSlashingResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgReportSlashingResponse { + const message = createBaseMsgReportSlashingResponse(); + return message; + }, + fromAmino(_: MsgReportSlashingResponseAmino): MsgReportSlashingResponse { + const message = createBaseMsgReportSlashingResponse(); + return message; + }, + toAmino(_: MsgReportSlashingResponse, useInterfaces: boolean = false): MsgReportSlashingResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgReportSlashingResponseAminoMsg): MsgReportSlashingResponse { + return MsgReportSlashingResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgReportSlashingResponseProtoMsg, useInterfaces: boolean = false): MsgReportSlashingResponse { + return MsgReportSlashingResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgReportSlashingResponse): Uint8Array { + return MsgReportSlashingResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgReportSlashingResponse): MsgReportSlashingResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgReportSlashingResponse", + value: MsgReportSlashingResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/params.ts b/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/params.ts new file mode 100644 index 000000000..1648023cb --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/params.ts @@ -0,0 +1,65 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** Params defines the parameters for the module. */ +export interface Params {} +export interface ParamsProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the module. */ +export interface ParamsAmino {} +export interface ParamsAminoMsg { + type: "/pstake.lscosmos.v1beta1.Params"; + value: ParamsAmino; +} +/** Params defines the parameters for the module. */ +export interface ParamsSDKType {} +function createBaseParams(): Params { + return {}; +} +export const Params = { + typeUrl: "/pstake.lscosmos.v1beta1.Params", + encode(_: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): Params { + const message = createBaseParams(); + return message; + }, + fromAmino(_: ParamsAmino): Params { + const message = createBaseParams(); + return message; + }, + toAmino(_: Params, useInterfaces: boolean = false): ParamsAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsProtoMsg, useInterfaces: boolean = false): Params { + return Params.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/query.rpc.Query.ts new file mode 100644 index 000000000..5412584d7 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/query.rpc.Query.ts @@ -0,0 +1,191 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryParamsRequest, QueryParamsResponse, QueryAllStateRequest, QueryAllStateResponse, QueryHostChainParamsRequest, QueryHostChainParamsResponse, QueryDelegationStateRequest, QueryDelegationStateResponse, QueryAllowListedValidatorsRequest, QueryAllowListedValidatorsResponse, QueryCValueRequest, QueryCValueResponse, QueryModuleStateRequest, QueryModuleStateResponse, QueryIBCTransientStoreRequest, QueryIBCTransientStoreResponse, QueryUnclaimedRequest, QueryUnclaimedResponse, QueryFailedUnbondingsRequest, QueryFailedUnbondingsResponse, QueryPendingUnbondingsRequest, QueryPendingUnbondingsResponse, QueryUnbondingEpochCValueRequest, QueryUnbondingEpochCValueResponse, QueryHostAccountUndelegationRequest, QueryHostAccountUndelegationResponse, QueryDelegatorUnbondingEpochEntryRequest, QueryDelegatorUnbondingEpochEntryResponse, QueryHostAccountsRequest, QueryHostAccountsResponse, QueryDepositModuleAccountRequest, QueryDepositModuleAccountResponse, QueryAllDelegatorUnbondingEpochEntriesRequest, QueryAllDelegatorUnbondingEpochEntriesResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Parameters queries the parameters of the module. */ + params(request?: QueryParamsRequest): Promise; + /** AllState returns all state of module, aka, genesis export. */ + allState(request?: QueryAllStateRequest): Promise; + hostChainParams(request?: QueryHostChainParamsRequest): Promise; + delegationState(request?: QueryDelegationStateRequest): Promise; + allowListedValidators(request?: QueryAllowListedValidatorsRequest): Promise; + cValue(request?: QueryCValueRequest): Promise; + moduleState(request?: QueryModuleStateRequest): Promise; + iBCTransientStore(request?: QueryIBCTransientStoreRequest): Promise; + unclaimed(request: QueryUnclaimedRequest): Promise; + failedUnbondings(request: QueryFailedUnbondingsRequest): Promise; + pendingUnbondings(request: QueryPendingUnbondingsRequest): Promise; + unbondingEpochCValue(request: QueryUnbondingEpochCValueRequest): Promise; + hostAccountUndelegation(request: QueryHostAccountUndelegationRequest): Promise; + delegatorUnbondingEpochEntry(request: QueryDelegatorUnbondingEpochEntryRequest): Promise; + hostAccounts(request?: QueryHostAccountsRequest): Promise; + depositModuleAccount(request?: QueryDepositModuleAccountRequest): Promise; + delegatorUnbondingEpochEntries(request: QueryAllDelegatorUnbondingEpochEntriesRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + this.allState = this.allState.bind(this); + this.hostChainParams = this.hostChainParams.bind(this); + this.delegationState = this.delegationState.bind(this); + this.allowListedValidators = this.allowListedValidators.bind(this); + this.cValue = this.cValue.bind(this); + this.moduleState = this.moduleState.bind(this); + this.iBCTransientStore = this.iBCTransientStore.bind(this); + this.unclaimed = this.unclaimed.bind(this); + this.failedUnbondings = this.failedUnbondings.bind(this); + this.pendingUnbondings = this.pendingUnbondings.bind(this); + this.unbondingEpochCValue = this.unbondingEpochCValue.bind(this); + this.hostAccountUndelegation = this.hostAccountUndelegation.bind(this); + this.delegatorUnbondingEpochEntry = this.delegatorUnbondingEpochEntry.bind(this); + this.hostAccounts = this.hostAccounts.bind(this); + this.depositModuleAccount = this.depositModuleAccount.bind(this); + this.delegatorUnbondingEpochEntries = this.delegatorUnbondingEpochEntries.bind(this); + } + params(request: QueryParamsRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + allState(request: QueryAllStateRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryAllStateRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "AllState", data); + return promise.then(data => QueryAllStateResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + hostChainParams(request: QueryHostChainParamsRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryHostChainParamsRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "HostChainParams", data); + return promise.then(data => QueryHostChainParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + delegationState(request: QueryDelegationStateRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryDelegationStateRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "DelegationState", data); + return promise.then(data => QueryDelegationStateResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + allowListedValidators(request: QueryAllowListedValidatorsRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryAllowListedValidatorsRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "AllowListedValidators", data); + return promise.then(data => QueryAllowListedValidatorsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + cValue(request: QueryCValueRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryCValueRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "CValue", data); + return promise.then(data => QueryCValueResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + moduleState(request: QueryModuleStateRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryModuleStateRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "ModuleState", data); + return promise.then(data => QueryModuleStateResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + iBCTransientStore(request: QueryIBCTransientStoreRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryIBCTransientStoreRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "IBCTransientStore", data); + return promise.then(data => QueryIBCTransientStoreResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + unclaimed(request: QueryUnclaimedRequest, useInterfaces: boolean = true): Promise { + const data = QueryUnclaimedRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "Unclaimed", data); + return promise.then(data => QueryUnclaimedResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + failedUnbondings(request: QueryFailedUnbondingsRequest, useInterfaces: boolean = true): Promise { + const data = QueryFailedUnbondingsRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "FailedUnbondings", data); + return promise.then(data => QueryFailedUnbondingsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + pendingUnbondings(request: QueryPendingUnbondingsRequest, useInterfaces: boolean = true): Promise { + const data = QueryPendingUnbondingsRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "PendingUnbondings", data); + return promise.then(data => QueryPendingUnbondingsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + unbondingEpochCValue(request: QueryUnbondingEpochCValueRequest, useInterfaces: boolean = true): Promise { + const data = QueryUnbondingEpochCValueRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "UnbondingEpochCValue", data); + return promise.then(data => QueryUnbondingEpochCValueResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + hostAccountUndelegation(request: QueryHostAccountUndelegationRequest, useInterfaces: boolean = true): Promise { + const data = QueryHostAccountUndelegationRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "HostAccountUndelegation", data); + return promise.then(data => QueryHostAccountUndelegationResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + delegatorUnbondingEpochEntry(request: QueryDelegatorUnbondingEpochEntryRequest, useInterfaces: boolean = true): Promise { + const data = QueryDelegatorUnbondingEpochEntryRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "DelegatorUnbondingEpochEntry", data); + return promise.then(data => QueryDelegatorUnbondingEpochEntryResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + hostAccounts(request: QueryHostAccountsRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryHostAccountsRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "HostAccounts", data); + return promise.then(data => QueryHostAccountsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + depositModuleAccount(request: QueryDepositModuleAccountRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryDepositModuleAccountRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "DepositModuleAccount", data); + return promise.then(data => QueryDepositModuleAccountResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + delegatorUnbondingEpochEntries(request: QueryAllDelegatorUnbondingEpochEntriesRequest, useInterfaces: boolean = true): Promise { + const data = QueryAllDelegatorUnbondingEpochEntriesRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "DelegatorUnbondingEpochEntries", data); + return promise.then(data => QueryAllDelegatorUnbondingEpochEntriesResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest, useInterfaces: boolean = true): Promise { + return queryService.params(request, useInterfaces); + }, + allState(request?: QueryAllStateRequest, useInterfaces: boolean = true): Promise { + return queryService.allState(request, useInterfaces); + }, + hostChainParams(request?: QueryHostChainParamsRequest, useInterfaces: boolean = true): Promise { + return queryService.hostChainParams(request, useInterfaces); + }, + delegationState(request?: QueryDelegationStateRequest, useInterfaces: boolean = true): Promise { + return queryService.delegationState(request, useInterfaces); + }, + allowListedValidators(request?: QueryAllowListedValidatorsRequest, useInterfaces: boolean = true): Promise { + return queryService.allowListedValidators(request, useInterfaces); + }, + cValue(request?: QueryCValueRequest, useInterfaces: boolean = true): Promise { + return queryService.cValue(request, useInterfaces); + }, + moduleState(request?: QueryModuleStateRequest, useInterfaces: boolean = true): Promise { + return queryService.moduleState(request, useInterfaces); + }, + iBCTransientStore(request?: QueryIBCTransientStoreRequest, useInterfaces: boolean = true): Promise { + return queryService.iBCTransientStore(request, useInterfaces); + }, + unclaimed(request: QueryUnclaimedRequest, useInterfaces: boolean = true): Promise { + return queryService.unclaimed(request, useInterfaces); + }, + failedUnbondings(request: QueryFailedUnbondingsRequest, useInterfaces: boolean = true): Promise { + return queryService.failedUnbondings(request, useInterfaces); + }, + pendingUnbondings(request: QueryPendingUnbondingsRequest, useInterfaces: boolean = true): Promise { + return queryService.pendingUnbondings(request, useInterfaces); + }, + unbondingEpochCValue(request: QueryUnbondingEpochCValueRequest, useInterfaces: boolean = true): Promise { + return queryService.unbondingEpochCValue(request, useInterfaces); + }, + hostAccountUndelegation(request: QueryHostAccountUndelegationRequest, useInterfaces: boolean = true): Promise { + return queryService.hostAccountUndelegation(request, useInterfaces); + }, + delegatorUnbondingEpochEntry(request: QueryDelegatorUnbondingEpochEntryRequest, useInterfaces: boolean = true): Promise { + return queryService.delegatorUnbondingEpochEntry(request, useInterfaces); + }, + hostAccounts(request?: QueryHostAccountsRequest, useInterfaces: boolean = true): Promise { + return queryService.hostAccounts(request, useInterfaces); + }, + depositModuleAccount(request?: QueryDepositModuleAccountRequest, useInterfaces: boolean = true): Promise { + return queryService.depositModuleAccount(request, useInterfaces); + }, + delegatorUnbondingEpochEntries(request: QueryAllDelegatorUnbondingEpochEntriesRequest, useInterfaces: boolean = true): Promise { + return queryService.delegatorUnbondingEpochEntries(request, useInterfaces); + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/query.ts b/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/query.ts new file mode 100644 index 000000000..8efea99aa --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/lscosmos/v1beta1/query.ts @@ -0,0 +1,2882 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { GenesisState, GenesisStateAmino, GenesisStateSDKType } from "./genesis"; +import { HostChainParams, HostChainParamsAmino, HostChainParamsSDKType, DelegationState, DelegationStateAmino, DelegationStateSDKType, AllowListedValidators, AllowListedValidatorsAmino, AllowListedValidatorsSDKType, IBCAmountTransientStore, IBCAmountTransientStoreAmino, IBCAmountTransientStoreSDKType, UnbondingEpochCValue, UnbondingEpochCValueAmino, UnbondingEpochCValueSDKType, HostAccountUndelegation, HostAccountUndelegationAmino, HostAccountUndelegationSDKType, DelegatorUnbondingEpochEntry, DelegatorUnbondingEpochEntryAmino, DelegatorUnbondingEpochEntrySDKType, HostAccounts, HostAccountsAmino, HostAccountsSDKType } from "./lscosmos"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params holds all the parameters of this module. */ + params: Params | undefined; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** params holds all the parameters of this module. */ + params?: ParamsAmino | undefined; +} +export interface QueryParamsResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType | undefined; +} +/** QueryAllStateRequest is request type for the Query/AllState RPC method. */ +export interface QueryAllStateRequest {} +export interface QueryAllStateRequestProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryAllStateRequest"; + value: Uint8Array; +} +/** QueryAllStateRequest is request type for the Query/AllState RPC method. */ +export interface QueryAllStateRequestAmino {} +export interface QueryAllStateRequestAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryAllStateRequest"; + value: QueryAllStateRequestAmino; +} +/** QueryAllStateRequest is request type for the Query/AllState RPC method. */ +export interface QueryAllStateRequestSDKType {} +/** QueryAllStateResponse is response type for the Query/AllState RPC method. */ +export interface QueryAllStateResponse { + /** params holds all the parameters of this module. */ + genesis: GenesisState | undefined; +} +export interface QueryAllStateResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryAllStateResponse"; + value: Uint8Array; +} +/** QueryAllStateResponse is response type for the Query/AllState RPC method. */ +export interface QueryAllStateResponseAmino { + /** params holds all the parameters of this module. */ + genesis?: GenesisStateAmino | undefined; +} +export interface QueryAllStateResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryAllStateResponse"; + value: QueryAllStateResponseAmino; +} +/** QueryAllStateResponse is response type for the Query/AllState RPC method. */ +export interface QueryAllStateResponseSDKType { + genesis: GenesisStateSDKType | undefined; +} +/** QueryHostChainParamsRequest is request for the Ouery/HostChainParams methods. */ +export interface QueryHostChainParamsRequest {} +export interface QueryHostChainParamsRequestProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryHostChainParamsRequest"; + value: Uint8Array; +} +/** QueryHostChainParamsRequest is request for the Ouery/HostChainParams methods. */ +export interface QueryHostChainParamsRequestAmino {} +export interface QueryHostChainParamsRequestAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryHostChainParamsRequest"; + value: QueryHostChainParamsRequestAmino; +} +/** QueryHostChainParamsRequest is request for the Ouery/HostChainParams methods. */ +export interface QueryHostChainParamsRequestSDKType {} +/** + * QueryHostChainParamsResponse is response for the Ouery/HostChainParams + * methods. + */ +export interface QueryHostChainParamsResponse { + hostChainParams: HostChainParams | undefined; +} +export interface QueryHostChainParamsResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryHostChainParamsResponse"; + value: Uint8Array; +} +/** + * QueryHostChainParamsResponse is response for the Ouery/HostChainParams + * methods. + */ +export interface QueryHostChainParamsResponseAmino { + host_chain_params?: HostChainParamsAmino | undefined; +} +export interface QueryHostChainParamsResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryHostChainParamsResponse"; + value: QueryHostChainParamsResponseAmino; +} +/** + * QueryHostChainParamsResponse is response for the Ouery/HostChainParams + * methods. + */ +export interface QueryHostChainParamsResponseSDKType { + host_chain_params: HostChainParamsSDKType | undefined; +} +/** QueryDelegationStateRequest is request for the Ouery/DelegationState methods. */ +export interface QueryDelegationStateRequest {} +export interface QueryDelegationStateRequestProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryDelegationStateRequest"; + value: Uint8Array; +} +/** QueryDelegationStateRequest is request for the Ouery/DelegationState methods. */ +export interface QueryDelegationStateRequestAmino {} +export interface QueryDelegationStateRequestAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryDelegationStateRequest"; + value: QueryDelegationStateRequestAmino; +} +/** QueryDelegationStateRequest is request for the Ouery/DelegationState methods. */ +export interface QueryDelegationStateRequestSDKType {} +/** + * QueryDelegationStateResponse is response for the Ouery/DelegationState + * methods. + */ +export interface QueryDelegationStateResponse { + delegationState: DelegationState | undefined; +} +export interface QueryDelegationStateResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryDelegationStateResponse"; + value: Uint8Array; +} +/** + * QueryDelegationStateResponse is response for the Ouery/DelegationState + * methods. + */ +export interface QueryDelegationStateResponseAmino { + delegation_state?: DelegationStateAmino | undefined; +} +export interface QueryDelegationStateResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryDelegationStateResponse"; + value: QueryDelegationStateResponseAmino; +} +/** + * QueryDelegationStateResponse is response for the Ouery/DelegationState + * methods. + */ +export interface QueryDelegationStateResponseSDKType { + delegation_state: DelegationStateSDKType | undefined; +} +/** + * QueryListedValidatorsRequest is a request for the Query/AllowListedValidators + * methods. + */ +export interface QueryAllowListedValidatorsRequest {} +export interface QueryAllowListedValidatorsRequestProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryAllowListedValidatorsRequest"; + value: Uint8Array; +} +/** + * QueryListedValidatorsRequest is a request for the Query/AllowListedValidators + * methods. + */ +export interface QueryAllowListedValidatorsRequestAmino {} +export interface QueryAllowListedValidatorsRequestAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryAllowListedValidatorsRequest"; + value: QueryAllowListedValidatorsRequestAmino; +} +/** + * QueryListedValidatorsRequest is a request for the Query/AllowListedValidators + * methods. + */ +export interface QueryAllowListedValidatorsRequestSDKType {} +/** + * QueryListedValidatorsResponse is a response for the + * Query/AllowListedValidators methods. + */ +export interface QueryAllowListedValidatorsResponse { + allowListedValidators: AllowListedValidators | undefined; +} +export interface QueryAllowListedValidatorsResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryAllowListedValidatorsResponse"; + value: Uint8Array; +} +/** + * QueryListedValidatorsResponse is a response for the + * Query/AllowListedValidators methods. + */ +export interface QueryAllowListedValidatorsResponseAmino { + allow_listed_validators?: AllowListedValidatorsAmino | undefined; +} +export interface QueryAllowListedValidatorsResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryAllowListedValidatorsResponse"; + value: QueryAllowListedValidatorsResponseAmino; +} +/** + * QueryListedValidatorsResponse is a response for the + * Query/AllowListedValidators methods. + */ +export interface QueryAllowListedValidatorsResponseSDKType { + allow_listed_validators: AllowListedValidatorsSDKType | undefined; +} +/** QueryCValueRequest is a request for the Query/CValue methods. */ +export interface QueryCValueRequest {} +export interface QueryCValueRequestProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryCValueRequest"; + value: Uint8Array; +} +/** QueryCValueRequest is a request for the Query/CValue methods. */ +export interface QueryCValueRequestAmino {} +export interface QueryCValueRequestAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryCValueRequest"; + value: QueryCValueRequestAmino; +} +/** QueryCValueRequest is a request for the Query/CValue methods. */ +export interface QueryCValueRequestSDKType {} +/** QueryCValueRequest is a response for the Query/CValue methods. */ +export interface QueryCValueResponse { + cValue: string; +} +export interface QueryCValueResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryCValueResponse"; + value: Uint8Array; +} +/** QueryCValueRequest is a response for the Query/CValue methods. */ +export interface QueryCValueResponseAmino { + c_value?: string; +} +export interface QueryCValueResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryCValueResponse"; + value: QueryCValueResponseAmino; +} +/** QueryCValueRequest is a response for the Query/CValue methods. */ +export interface QueryCValueResponseSDKType { + c_value: string; +} +/** QueryModuleStateRequest is a request for the Query/ModuleState methods. */ +export interface QueryModuleStateRequest {} +export interface QueryModuleStateRequestProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryModuleStateRequest"; + value: Uint8Array; +} +/** QueryModuleStateRequest is a request for the Query/ModuleState methods. */ +export interface QueryModuleStateRequestAmino {} +export interface QueryModuleStateRequestAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryModuleStateRequest"; + value: QueryModuleStateRequestAmino; +} +/** QueryModuleStateRequest is a request for the Query/ModuleState methods. */ +export interface QueryModuleStateRequestSDKType {} +/** QueryModuleStateRequest is a response for the Query/ModuleState methods. */ +export interface QueryModuleStateResponse { + /** QueryModuleStateRequest is a response for the Query/ModuleState methods. */ + moduleState: boolean; +} +export interface QueryModuleStateResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryModuleStateResponse"; + value: Uint8Array; +} +/** QueryModuleStateRequest is a response for the Query/ModuleState methods. */ +export interface QueryModuleStateResponseAmino { + /** QueryModuleStateRequest is a response for the Query/ModuleState methods. */ + module_state?: boolean; +} +export interface QueryModuleStateResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryModuleStateResponse"; + value: QueryModuleStateResponseAmino; +} +/** QueryModuleStateRequest is a response for the Query/ModuleState methods. */ +export interface QueryModuleStateResponseSDKType { + module_state: boolean; +} +/** + * QueryIBCTransientStoreRequest is a request for the Query/IBCTransientStore + * methods. + */ +export interface QueryIBCTransientStoreRequest {} +export interface QueryIBCTransientStoreRequestProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryIBCTransientStoreRequest"; + value: Uint8Array; +} +/** + * QueryIBCTransientStoreRequest is a request for the Query/IBCTransientStore + * methods. + */ +export interface QueryIBCTransientStoreRequestAmino {} +export interface QueryIBCTransientStoreRequestAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryIBCTransientStoreRequest"; + value: QueryIBCTransientStoreRequestAmino; +} +/** + * QueryIBCTransientStoreRequest is a request for the Query/IBCTransientStore + * methods. + */ +export interface QueryIBCTransientStoreRequestSDKType {} +/** + * QueryIBCTransientStoreRequest is a response for the Query/IBCTransientStore + * methods. + */ +export interface QueryIBCTransientStoreResponse { + iBCTransientStore: IBCAmountTransientStore | undefined; +} +export interface QueryIBCTransientStoreResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryIBCTransientStoreResponse"; + value: Uint8Array; +} +/** + * QueryIBCTransientStoreRequest is a response for the Query/IBCTransientStore + * methods. + */ +export interface QueryIBCTransientStoreResponseAmino { + i_b_c_transient_store?: IBCAmountTransientStoreAmino | undefined; +} +export interface QueryIBCTransientStoreResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryIBCTransientStoreResponse"; + value: QueryIBCTransientStoreResponseAmino; +} +/** + * QueryIBCTransientStoreRequest is a response for the Query/IBCTransientStore + * methods. + */ +export interface QueryIBCTransientStoreResponseSDKType { + i_b_c_transient_store: IBCAmountTransientStoreSDKType | undefined; +} +/** QueryUnclaimedRequest is a request for the Query/Unclaimed methods. */ +export interface QueryUnclaimedRequest { + /** QueryUnclaimedRequest is a request for the Query/Unclaimed methods. */ + delegatorAddress: string; +} +export interface QueryUnclaimedRequestProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryUnclaimedRequest"; + value: Uint8Array; +} +/** QueryUnclaimedRequest is a request for the Query/Unclaimed methods. */ +export interface QueryUnclaimedRequestAmino { + /** QueryUnclaimedRequest is a request for the Query/Unclaimed methods. */ + delegator_address?: string; +} +export interface QueryUnclaimedRequestAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryUnclaimedRequest"; + value: QueryUnclaimedRequestAmino; +} +/** QueryUnclaimedRequest is a request for the Query/Unclaimed methods. */ +export interface QueryUnclaimedRequestSDKType { + delegator_address: string; +} +/** QueryUnclaimedResponse is a response for the Query/Unclaimed methods. */ +export interface QueryUnclaimedResponse { + unclaimed: UnbondingEpochCValue[]; +} +export interface QueryUnclaimedResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryUnclaimedResponse"; + value: Uint8Array; +} +/** QueryUnclaimedResponse is a response for the Query/Unclaimed methods. */ +export interface QueryUnclaimedResponseAmino { + unclaimed?: UnbondingEpochCValueAmino[]; +} +export interface QueryUnclaimedResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryUnclaimedResponse"; + value: QueryUnclaimedResponseAmino; +} +/** QueryUnclaimedResponse is a response for the Query/Unclaimed methods. */ +export interface QueryUnclaimedResponseSDKType { + unclaimed: UnbondingEpochCValueSDKType[]; +} +/** + * QueryFailedUnbondingsRequest is a request for the Query/FailedUnbondings + * methods. + */ +export interface QueryFailedUnbondingsRequest { + /** + * QueryFailedUnbondingsRequest is a request for the Query/FailedUnbondings + * methods. + */ + delegatorAddress: string; +} +export interface QueryFailedUnbondingsRequestProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryFailedUnbondingsRequest"; + value: Uint8Array; +} +/** + * QueryFailedUnbondingsRequest is a request for the Query/FailedUnbondings + * methods. + */ +export interface QueryFailedUnbondingsRequestAmino { + /** + * QueryFailedUnbondingsRequest is a request for the Query/FailedUnbondings + * methods. + */ + delegator_address?: string; +} +export interface QueryFailedUnbondingsRequestAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryFailedUnbondingsRequest"; + value: QueryFailedUnbondingsRequestAmino; +} +/** + * QueryFailedUnbondingsRequest is a request for the Query/FailedUnbondings + * methods. + */ +export interface QueryFailedUnbondingsRequestSDKType { + delegator_address: string; +} +/** + * QueryFailedUnbondingsResponse a response for the Query/FailedUnbondings + * methods. + */ +export interface QueryFailedUnbondingsResponse { + failedUnbondings: UnbondingEpochCValue[]; +} +export interface QueryFailedUnbondingsResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryFailedUnbondingsResponse"; + value: Uint8Array; +} +/** + * QueryFailedUnbondingsResponse a response for the Query/FailedUnbondings + * methods. + */ +export interface QueryFailedUnbondingsResponseAmino { + failed_unbondings?: UnbondingEpochCValueAmino[]; +} +export interface QueryFailedUnbondingsResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryFailedUnbondingsResponse"; + value: QueryFailedUnbondingsResponseAmino; +} +/** + * QueryFailedUnbondingsResponse a response for the Query/FailedUnbondings + * methods. + */ +export interface QueryFailedUnbondingsResponseSDKType { + failed_unbondings: UnbondingEpochCValueSDKType[]; +} +/** + * QueryPendingUnbondingsRequest is a request for the Query/PendingUnbondings + * methods. + */ +export interface QueryPendingUnbondingsRequest { + /** + * QueryPendingUnbondingsRequest is a request for the Query/PendingUnbondings + * methods. + */ + delegatorAddress: string; +} +export interface QueryPendingUnbondingsRequestProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryPendingUnbondingsRequest"; + value: Uint8Array; +} +/** + * QueryPendingUnbondingsRequest is a request for the Query/PendingUnbondings + * methods. + */ +export interface QueryPendingUnbondingsRequestAmino { + /** + * QueryPendingUnbondingsRequest is a request for the Query/PendingUnbondings + * methods. + */ + delegator_address?: string; +} +export interface QueryPendingUnbondingsRequestAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryPendingUnbondingsRequest"; + value: QueryPendingUnbondingsRequestAmino; +} +/** + * QueryPendingUnbondingsRequest is a request for the Query/PendingUnbondings + * methods. + */ +export interface QueryPendingUnbondingsRequestSDKType { + delegator_address: string; +} +/** + * QueryPendingUnbondingsResponse is a response for the Query/PendingUnbondings + * methods. + */ +export interface QueryPendingUnbondingsResponse { + pendingUnbondings: UnbondingEpochCValue[]; +} +export interface QueryPendingUnbondingsResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryPendingUnbondingsResponse"; + value: Uint8Array; +} +/** + * QueryPendingUnbondingsResponse is a response for the Query/PendingUnbondings + * methods. + */ +export interface QueryPendingUnbondingsResponseAmino { + pending_unbondings?: UnbondingEpochCValueAmino[]; +} +export interface QueryPendingUnbondingsResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryPendingUnbondingsResponse"; + value: QueryPendingUnbondingsResponseAmino; +} +/** + * QueryPendingUnbondingsResponse is a response for the Query/PendingUnbondings + * methods. + */ +export interface QueryPendingUnbondingsResponseSDKType { + pending_unbondings: UnbondingEpochCValueSDKType[]; +} +/** + * QueryUnbondingEpochCValueRequest is a request for the + * Query/UnbondingEpochCValue methods. + */ +export interface QueryUnbondingEpochCValueRequest { + /** + * QueryUnbondingEpochCValueRequest is a request for the + * Query/UnbondingEpochCValue methods. + */ + epochNumber: bigint; +} +export interface QueryUnbondingEpochCValueRequestProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryUnbondingEpochCValueRequest"; + value: Uint8Array; +} +/** + * QueryUnbondingEpochCValueRequest is a request for the + * Query/UnbondingEpochCValue methods. + */ +export interface QueryUnbondingEpochCValueRequestAmino { + /** + * QueryUnbondingEpochCValueRequest is a request for the + * Query/UnbondingEpochCValue methods. + */ + epoch_number?: string; +} +export interface QueryUnbondingEpochCValueRequestAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryUnbondingEpochCValueRequest"; + value: QueryUnbondingEpochCValueRequestAmino; +} +/** + * QueryUnbondingEpochCValueRequest is a request for the + * Query/UnbondingEpochCValue methods. + */ +export interface QueryUnbondingEpochCValueRequestSDKType { + epoch_number: bigint; +} +/** + * QueryUnbondingEpochCValueResponse is a response for the + * Query/UnbondingEpochCValue methods. + */ +export interface QueryUnbondingEpochCValueResponse { + unbondingEpochCValue: UnbondingEpochCValue | undefined; +} +export interface QueryUnbondingEpochCValueResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryUnbondingEpochCValueResponse"; + value: Uint8Array; +} +/** + * QueryUnbondingEpochCValueResponse is a response for the + * Query/UnbondingEpochCValue methods. + */ +export interface QueryUnbondingEpochCValueResponseAmino { + unbonding_epoch_c_value?: UnbondingEpochCValueAmino | undefined; +} +export interface QueryUnbondingEpochCValueResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryUnbondingEpochCValueResponse"; + value: QueryUnbondingEpochCValueResponseAmino; +} +/** + * QueryUnbondingEpochCValueResponse is a response for the + * Query/UnbondingEpochCValue methods. + */ +export interface QueryUnbondingEpochCValueResponseSDKType { + unbonding_epoch_c_value: UnbondingEpochCValueSDKType | undefined; +} +/** + * QueryHostAccountUndelegationRequest is a request for the + * Query/HostAccountUndelegation methods. + */ +export interface QueryHostAccountUndelegationRequest { + /** + * QueryHostAccountUndelegationRequest is a request for the + * Query/HostAccountUndelegation methods. + */ + epochNumber: bigint; +} +export interface QueryHostAccountUndelegationRequestProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryHostAccountUndelegationRequest"; + value: Uint8Array; +} +/** + * QueryHostAccountUndelegationRequest is a request for the + * Query/HostAccountUndelegation methods. + */ +export interface QueryHostAccountUndelegationRequestAmino { + /** + * QueryHostAccountUndelegationRequest is a request for the + * Query/HostAccountUndelegation methods. + */ + epoch_number?: string; +} +export interface QueryHostAccountUndelegationRequestAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryHostAccountUndelegationRequest"; + value: QueryHostAccountUndelegationRequestAmino; +} +/** + * QueryHostAccountUndelegationRequest is a request for the + * Query/HostAccountUndelegation methods. + */ +export interface QueryHostAccountUndelegationRequestSDKType { + epoch_number: bigint; +} +/** + * QueryHostAccountUndelegationResponse is a response for the + * Query/HostAccountUndelegation methods. + */ +export interface QueryHostAccountUndelegationResponse { + hostAccountUndelegation: HostAccountUndelegation | undefined; +} +export interface QueryHostAccountUndelegationResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryHostAccountUndelegationResponse"; + value: Uint8Array; +} +/** + * QueryHostAccountUndelegationResponse is a response for the + * Query/HostAccountUndelegation methods. + */ +export interface QueryHostAccountUndelegationResponseAmino { + host_account_undelegation?: HostAccountUndelegationAmino | undefined; +} +export interface QueryHostAccountUndelegationResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryHostAccountUndelegationResponse"; + value: QueryHostAccountUndelegationResponseAmino; +} +/** + * QueryHostAccountUndelegationResponse is a response for the + * Query/HostAccountUndelegation methods. + */ +export interface QueryHostAccountUndelegationResponseSDKType { + host_account_undelegation: HostAccountUndelegationSDKType | undefined; +} +/** + * QueryDelegatorUnbondingEpochEntryRequest is a request for the + * Query/DelegatorUnbondingEpochEntry methods. + */ +export interface QueryDelegatorUnbondingEpochEntryRequest { + delegatorAddress: string; + epochNumber: bigint; +} +export interface QueryDelegatorUnbondingEpochEntryRequestProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryDelegatorUnbondingEpochEntryRequest"; + value: Uint8Array; +} +/** + * QueryDelegatorUnbondingEpochEntryRequest is a request for the + * Query/DelegatorUnbondingEpochEntry methods. + */ +export interface QueryDelegatorUnbondingEpochEntryRequestAmino { + delegator_address?: string; + epoch_number?: string; +} +export interface QueryDelegatorUnbondingEpochEntryRequestAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryDelegatorUnbondingEpochEntryRequest"; + value: QueryDelegatorUnbondingEpochEntryRequestAmino; +} +/** + * QueryDelegatorUnbondingEpochEntryRequest is a request for the + * Query/DelegatorUnbondingEpochEntry methods. + */ +export interface QueryDelegatorUnbondingEpochEntryRequestSDKType { + delegator_address: string; + epoch_number: bigint; +} +/** + * QueryDelegatorUnbondingEpochEntryResponse is a response for the + * Query/DelegatorUnbondingEpochEntry methods. + */ +export interface QueryDelegatorUnbondingEpochEntryResponse { + delegatorUnbodingEpochEntry: DelegatorUnbondingEpochEntry | undefined; +} +export interface QueryDelegatorUnbondingEpochEntryResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryDelegatorUnbondingEpochEntryResponse"; + value: Uint8Array; +} +/** + * QueryDelegatorUnbondingEpochEntryResponse is a response for the + * Query/DelegatorUnbondingEpochEntry methods. + */ +export interface QueryDelegatorUnbondingEpochEntryResponseAmino { + delegator_unboding_epoch_entry?: DelegatorUnbondingEpochEntryAmino | undefined; +} +export interface QueryDelegatorUnbondingEpochEntryResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryDelegatorUnbondingEpochEntryResponse"; + value: QueryDelegatorUnbondingEpochEntryResponseAmino; +} +/** + * QueryDelegatorUnbondingEpochEntryResponse is a response for the + * Query/DelegatorUnbondingEpochEntry methods. + */ +export interface QueryDelegatorUnbondingEpochEntryResponseSDKType { + delegator_unboding_epoch_entry: DelegatorUnbondingEpochEntrySDKType | undefined; +} +/** QueryHostAccountsRequest is a request for the Query/HostAccounts methods. */ +export interface QueryHostAccountsRequest {} +export interface QueryHostAccountsRequestProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryHostAccountsRequest"; + value: Uint8Array; +} +/** QueryHostAccountsRequest is a request for the Query/HostAccounts methods. */ +export interface QueryHostAccountsRequestAmino {} +export interface QueryHostAccountsRequestAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryHostAccountsRequest"; + value: QueryHostAccountsRequestAmino; +} +/** QueryHostAccountsRequest is a request for the Query/HostAccounts methods. */ +export interface QueryHostAccountsRequestSDKType {} +/** QueryHostAccountsResponse is a response for the Query/HostAccounts methods. */ +export interface QueryHostAccountsResponse { + hostAccounts: HostAccounts | undefined; +} +export interface QueryHostAccountsResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryHostAccountsResponse"; + value: Uint8Array; +} +/** QueryHostAccountsResponse is a response for the Query/HostAccounts methods. */ +export interface QueryHostAccountsResponseAmino { + host_accounts?: HostAccountsAmino | undefined; +} +export interface QueryHostAccountsResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryHostAccountsResponse"; + value: QueryHostAccountsResponseAmino; +} +/** QueryHostAccountsResponse is a response for the Query/HostAccounts methods. */ +export interface QueryHostAccountsResponseSDKType { + host_accounts: HostAccountsSDKType | undefined; +} +/** + * QueryDepositModuleAccountRequest is a request for the + * Query/DepositModuleAccount methods. + */ +export interface QueryDepositModuleAccountRequest {} +export interface QueryDepositModuleAccountRequestProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryDepositModuleAccountRequest"; + value: Uint8Array; +} +/** + * QueryDepositModuleAccountRequest is a request for the + * Query/DepositModuleAccount methods. + */ +export interface QueryDepositModuleAccountRequestAmino {} +export interface QueryDepositModuleAccountRequestAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryDepositModuleAccountRequest"; + value: QueryDepositModuleAccountRequestAmino; +} +/** + * QueryDepositModuleAccountRequest is a request for the + * Query/DepositModuleAccount methods. + */ +export interface QueryDepositModuleAccountRequestSDKType {} +/** + * QueryDepositModuleAccountResponse is a response for the + * Query/DepositModuleAccount methods. + */ +export interface QueryDepositModuleAccountResponse { + balance: Coin | undefined; +} +export interface QueryDepositModuleAccountResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryDepositModuleAccountResponse"; + value: Uint8Array; +} +/** + * QueryDepositModuleAccountResponse is a response for the + * Query/DepositModuleAccount methods. + */ +export interface QueryDepositModuleAccountResponseAmino { + balance?: CoinAmino | undefined; +} +export interface QueryDepositModuleAccountResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryDepositModuleAccountResponse"; + value: QueryDepositModuleAccountResponseAmino; +} +/** + * QueryDepositModuleAccountResponse is a response for the + * Query/DepositModuleAccount methods. + */ +export interface QueryDepositModuleAccountResponseSDKType { + balance: CoinSDKType | undefined; +} +/** + * QueryAllDelegatorUnbondingEpochEntriesRequest is a request for the + * Query/DelegatorUnbondingEpochEntries methods. + */ +export interface QueryAllDelegatorUnbondingEpochEntriesRequest { + delegatorAddress: string; +} +export interface QueryAllDelegatorUnbondingEpochEntriesRequestProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryAllDelegatorUnbondingEpochEntriesRequest"; + value: Uint8Array; +} +/** + * QueryAllDelegatorUnbondingEpochEntriesRequest is a request for the + * Query/DelegatorUnbondingEpochEntries methods. + */ +export interface QueryAllDelegatorUnbondingEpochEntriesRequestAmino { + delegator_address?: string; +} +export interface QueryAllDelegatorUnbondingEpochEntriesRequestAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryAllDelegatorUnbondingEpochEntriesRequest"; + value: QueryAllDelegatorUnbondingEpochEntriesRequestAmino; +} +/** + * QueryAllDelegatorUnbondingEpochEntriesRequest is a request for the + * Query/DelegatorUnbondingEpochEntries methods. + */ +export interface QueryAllDelegatorUnbondingEpochEntriesRequestSDKType { + delegator_address: string; +} +/** + * QueryAllDelegatorUnbondingEpochEntriesResponse is a response for the + * Query/DelegatorUnbondingEpochEntries methods. + */ +export interface QueryAllDelegatorUnbondingEpochEntriesResponse { + delegatorUnbondingEpochEntries: DelegatorUnbondingEpochEntry[]; +} +export interface QueryAllDelegatorUnbondingEpochEntriesResponseProtoMsg { + typeUrl: "/pstake.lscosmos.v1beta1.QueryAllDelegatorUnbondingEpochEntriesResponse"; + value: Uint8Array; +} +/** + * QueryAllDelegatorUnbondingEpochEntriesResponse is a response for the + * Query/DelegatorUnbondingEpochEntries methods. + */ +export interface QueryAllDelegatorUnbondingEpochEntriesResponseAmino { + delegator_unbonding_epoch_entries?: DelegatorUnbondingEpochEntryAmino[]; +} +export interface QueryAllDelegatorUnbondingEpochEntriesResponseAminoMsg { + type: "/pstake.lscosmos.v1beta1.QueryAllDelegatorUnbondingEpochEntriesResponse"; + value: QueryAllDelegatorUnbondingEpochEntriesResponseAmino; +} +/** + * QueryAllDelegatorUnbondingEpochEntriesResponse is a response for the + * Query/DelegatorUnbondingEpochEntries methods. + */ +export interface QueryAllDelegatorUnbondingEpochEntriesResponseSDKType { + delegator_unbonding_epoch_entries: DelegatorUnbondingEpochEntrySDKType[]; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest, useInterfaces: boolean = false): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg, useInterfaces: boolean = false): QueryParamsRequest { + return QueryParamsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse, useInterfaces: boolean = false): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg, useInterfaces: boolean = false): QueryParamsResponse { + return QueryParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllStateRequest(): QueryAllStateRequest { + return {}; +} +export const QueryAllStateRequest = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryAllStateRequest", + encode(_: QueryAllStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAllStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryAllStateRequest { + const message = createBaseQueryAllStateRequest(); + return message; + }, + fromAmino(_: QueryAllStateRequestAmino): QueryAllStateRequest { + const message = createBaseQueryAllStateRequest(); + return message; + }, + toAmino(_: QueryAllStateRequest, useInterfaces: boolean = false): QueryAllStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAllStateRequestAminoMsg): QueryAllStateRequest { + return QueryAllStateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllStateRequestProtoMsg, useInterfaces: boolean = false): QueryAllStateRequest { + return QueryAllStateRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAllStateRequest): Uint8Array { + return QueryAllStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllStateRequest): QueryAllStateRequestProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryAllStateRequest", + value: QueryAllStateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllStateResponse(): QueryAllStateResponse { + return { + genesis: GenesisState.fromPartial({}) + }; +} +export const QueryAllStateResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryAllStateResponse", + encode(message: QueryAllStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.genesis !== undefined) { + GenesisState.encode(message.genesis, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAllStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.genesis = GenesisState.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllStateResponse { + const message = createBaseQueryAllStateResponse(); + message.genesis = object.genesis !== undefined && object.genesis !== null ? GenesisState.fromPartial(object.genesis) : undefined; + return message; + }, + fromAmino(object: QueryAllStateResponseAmino): QueryAllStateResponse { + const message = createBaseQueryAllStateResponse(); + if (object.genesis !== undefined && object.genesis !== null) { + message.genesis = GenesisState.fromAmino(object.genesis); + } + return message; + }, + toAmino(message: QueryAllStateResponse, useInterfaces: boolean = false): QueryAllStateResponseAmino { + const obj: any = {}; + obj.genesis = message.genesis ? GenesisState.toAmino(message.genesis, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllStateResponseAminoMsg): QueryAllStateResponse { + return QueryAllStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllStateResponseProtoMsg, useInterfaces: boolean = false): QueryAllStateResponse { + return QueryAllStateResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAllStateResponse): Uint8Array { + return QueryAllStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllStateResponse): QueryAllStateResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryAllStateResponse", + value: QueryAllStateResponse.encode(message).finish() + }; + } +}; +function createBaseQueryHostChainParamsRequest(): QueryHostChainParamsRequest { + return {}; +} +export const QueryHostChainParamsRequest = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryHostChainParamsRequest", + encode(_: QueryHostChainParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryHostChainParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHostChainParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryHostChainParamsRequest { + const message = createBaseQueryHostChainParamsRequest(); + return message; + }, + fromAmino(_: QueryHostChainParamsRequestAmino): QueryHostChainParamsRequest { + const message = createBaseQueryHostChainParamsRequest(); + return message; + }, + toAmino(_: QueryHostChainParamsRequest, useInterfaces: boolean = false): QueryHostChainParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryHostChainParamsRequestAminoMsg): QueryHostChainParamsRequest { + return QueryHostChainParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryHostChainParamsRequestProtoMsg, useInterfaces: boolean = false): QueryHostChainParamsRequest { + return QueryHostChainParamsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryHostChainParamsRequest): Uint8Array { + return QueryHostChainParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryHostChainParamsRequest): QueryHostChainParamsRequestProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryHostChainParamsRequest", + value: QueryHostChainParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryHostChainParamsResponse(): QueryHostChainParamsResponse { + return { + hostChainParams: HostChainParams.fromPartial({}) + }; +} +export const QueryHostChainParamsResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryHostChainParamsResponse", + encode(message: QueryHostChainParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hostChainParams !== undefined) { + HostChainParams.encode(message.hostChainParams, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryHostChainParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHostChainParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hostChainParams = HostChainParams.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryHostChainParamsResponse { + const message = createBaseQueryHostChainParamsResponse(); + message.hostChainParams = object.hostChainParams !== undefined && object.hostChainParams !== null ? HostChainParams.fromPartial(object.hostChainParams) : undefined; + return message; + }, + fromAmino(object: QueryHostChainParamsResponseAmino): QueryHostChainParamsResponse { + const message = createBaseQueryHostChainParamsResponse(); + if (object.host_chain_params !== undefined && object.host_chain_params !== null) { + message.hostChainParams = HostChainParams.fromAmino(object.host_chain_params); + } + return message; + }, + toAmino(message: QueryHostChainParamsResponse, useInterfaces: boolean = false): QueryHostChainParamsResponseAmino { + const obj: any = {}; + obj.host_chain_params = message.hostChainParams ? HostChainParams.toAmino(message.hostChainParams, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryHostChainParamsResponseAminoMsg): QueryHostChainParamsResponse { + return QueryHostChainParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryHostChainParamsResponseProtoMsg, useInterfaces: boolean = false): QueryHostChainParamsResponse { + return QueryHostChainParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryHostChainParamsResponse): Uint8Array { + return QueryHostChainParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryHostChainParamsResponse): QueryHostChainParamsResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryHostChainParamsResponse", + value: QueryHostChainParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDelegationStateRequest(): QueryDelegationStateRequest { + return {}; +} +export const QueryDelegationStateRequest = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryDelegationStateRequest", + encode(_: QueryDelegationStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryDelegationStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegationStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryDelegationStateRequest { + const message = createBaseQueryDelegationStateRequest(); + return message; + }, + fromAmino(_: QueryDelegationStateRequestAmino): QueryDelegationStateRequest { + const message = createBaseQueryDelegationStateRequest(); + return message; + }, + toAmino(_: QueryDelegationStateRequest, useInterfaces: boolean = false): QueryDelegationStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryDelegationStateRequestAminoMsg): QueryDelegationStateRequest { + return QueryDelegationStateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDelegationStateRequestProtoMsg, useInterfaces: boolean = false): QueryDelegationStateRequest { + return QueryDelegationStateRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryDelegationStateRequest): Uint8Array { + return QueryDelegationStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegationStateRequest): QueryDelegationStateRequestProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryDelegationStateRequest", + value: QueryDelegationStateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDelegationStateResponse(): QueryDelegationStateResponse { + return { + delegationState: DelegationState.fromPartial({}) + }; +} +export const QueryDelegationStateResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryDelegationStateResponse", + encode(message: QueryDelegationStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegationState !== undefined) { + DelegationState.encode(message.delegationState, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryDelegationStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegationStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegationState = DelegationState.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelegationStateResponse { + const message = createBaseQueryDelegationStateResponse(); + message.delegationState = object.delegationState !== undefined && object.delegationState !== null ? DelegationState.fromPartial(object.delegationState) : undefined; + return message; + }, + fromAmino(object: QueryDelegationStateResponseAmino): QueryDelegationStateResponse { + const message = createBaseQueryDelegationStateResponse(); + if (object.delegation_state !== undefined && object.delegation_state !== null) { + message.delegationState = DelegationState.fromAmino(object.delegation_state); + } + return message; + }, + toAmino(message: QueryDelegationStateResponse, useInterfaces: boolean = false): QueryDelegationStateResponseAmino { + const obj: any = {}; + obj.delegation_state = message.delegationState ? DelegationState.toAmino(message.delegationState, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegationStateResponseAminoMsg): QueryDelegationStateResponse { + return QueryDelegationStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDelegationStateResponseProtoMsg, useInterfaces: boolean = false): QueryDelegationStateResponse { + return QueryDelegationStateResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryDelegationStateResponse): Uint8Array { + return QueryDelegationStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegationStateResponse): QueryDelegationStateResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryDelegationStateResponse", + value: QueryDelegationStateResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllowListedValidatorsRequest(): QueryAllowListedValidatorsRequest { + return {}; +} +export const QueryAllowListedValidatorsRequest = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryAllowListedValidatorsRequest", + encode(_: QueryAllowListedValidatorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAllowListedValidatorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllowListedValidatorsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryAllowListedValidatorsRequest { + const message = createBaseQueryAllowListedValidatorsRequest(); + return message; + }, + fromAmino(_: QueryAllowListedValidatorsRequestAmino): QueryAllowListedValidatorsRequest { + const message = createBaseQueryAllowListedValidatorsRequest(); + return message; + }, + toAmino(_: QueryAllowListedValidatorsRequest, useInterfaces: boolean = false): QueryAllowListedValidatorsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAllowListedValidatorsRequestAminoMsg): QueryAllowListedValidatorsRequest { + return QueryAllowListedValidatorsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllowListedValidatorsRequestProtoMsg, useInterfaces: boolean = false): QueryAllowListedValidatorsRequest { + return QueryAllowListedValidatorsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAllowListedValidatorsRequest): Uint8Array { + return QueryAllowListedValidatorsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllowListedValidatorsRequest): QueryAllowListedValidatorsRequestProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryAllowListedValidatorsRequest", + value: QueryAllowListedValidatorsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllowListedValidatorsResponse(): QueryAllowListedValidatorsResponse { + return { + allowListedValidators: AllowListedValidators.fromPartial({}) + }; +} +export const QueryAllowListedValidatorsResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryAllowListedValidatorsResponse", + encode(message: QueryAllowListedValidatorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.allowListedValidators !== undefined) { + AllowListedValidators.encode(message.allowListedValidators, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAllowListedValidatorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllowListedValidatorsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowListedValidators = AllowListedValidators.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllowListedValidatorsResponse { + const message = createBaseQueryAllowListedValidatorsResponse(); + message.allowListedValidators = object.allowListedValidators !== undefined && object.allowListedValidators !== null ? AllowListedValidators.fromPartial(object.allowListedValidators) : undefined; + return message; + }, + fromAmino(object: QueryAllowListedValidatorsResponseAmino): QueryAllowListedValidatorsResponse { + const message = createBaseQueryAllowListedValidatorsResponse(); + if (object.allow_listed_validators !== undefined && object.allow_listed_validators !== null) { + message.allowListedValidators = AllowListedValidators.fromAmino(object.allow_listed_validators); + } + return message; + }, + toAmino(message: QueryAllowListedValidatorsResponse, useInterfaces: boolean = false): QueryAllowListedValidatorsResponseAmino { + const obj: any = {}; + obj.allow_listed_validators = message.allowListedValidators ? AllowListedValidators.toAmino(message.allowListedValidators, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllowListedValidatorsResponseAminoMsg): QueryAllowListedValidatorsResponse { + return QueryAllowListedValidatorsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllowListedValidatorsResponseProtoMsg, useInterfaces: boolean = false): QueryAllowListedValidatorsResponse { + return QueryAllowListedValidatorsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAllowListedValidatorsResponse): Uint8Array { + return QueryAllowListedValidatorsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllowListedValidatorsResponse): QueryAllowListedValidatorsResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryAllowListedValidatorsResponse", + value: QueryAllowListedValidatorsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryCValueRequest(): QueryCValueRequest { + return {}; +} +export const QueryCValueRequest = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryCValueRequest", + encode(_: QueryCValueRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryCValueRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCValueRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryCValueRequest { + const message = createBaseQueryCValueRequest(); + return message; + }, + fromAmino(_: QueryCValueRequestAmino): QueryCValueRequest { + const message = createBaseQueryCValueRequest(); + return message; + }, + toAmino(_: QueryCValueRequest, useInterfaces: boolean = false): QueryCValueRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryCValueRequestAminoMsg): QueryCValueRequest { + return QueryCValueRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCValueRequestProtoMsg, useInterfaces: boolean = false): QueryCValueRequest { + return QueryCValueRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryCValueRequest): Uint8Array { + return QueryCValueRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCValueRequest): QueryCValueRequestProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryCValueRequest", + value: QueryCValueRequest.encode(message).finish() + }; + } +}; +function createBaseQueryCValueResponse(): QueryCValueResponse { + return { + cValue: "" + }; +} +export const QueryCValueResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryCValueResponse", + encode(message: QueryCValueResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.cValue !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.cValue, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryCValueResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCValueResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cValue = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCValueResponse { + const message = createBaseQueryCValueResponse(); + message.cValue = object.cValue ?? ""; + return message; + }, + fromAmino(object: QueryCValueResponseAmino): QueryCValueResponse { + const message = createBaseQueryCValueResponse(); + if (object.c_value !== undefined && object.c_value !== null) { + message.cValue = object.c_value; + } + return message; + }, + toAmino(message: QueryCValueResponse, useInterfaces: boolean = false): QueryCValueResponseAmino { + const obj: any = {}; + obj.c_value = message.cValue; + return obj; + }, + fromAminoMsg(object: QueryCValueResponseAminoMsg): QueryCValueResponse { + return QueryCValueResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCValueResponseProtoMsg, useInterfaces: boolean = false): QueryCValueResponse { + return QueryCValueResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryCValueResponse): Uint8Array { + return QueryCValueResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCValueResponse): QueryCValueResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryCValueResponse", + value: QueryCValueResponse.encode(message).finish() + }; + } +}; +function createBaseQueryModuleStateRequest(): QueryModuleStateRequest { + return {}; +} +export const QueryModuleStateRequest = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryModuleStateRequest", + encode(_: QueryModuleStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryModuleStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + fromAmino(_: QueryModuleStateRequestAmino): QueryModuleStateRequest { + const message = createBaseQueryModuleStateRequest(); + return message; + }, + toAmino(_: QueryModuleStateRequest, useInterfaces: boolean = false): QueryModuleStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryModuleStateRequestAminoMsg): QueryModuleStateRequest { + return QueryModuleStateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateRequestProtoMsg, useInterfaces: boolean = false): QueryModuleStateRequest { + return QueryModuleStateRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryModuleStateRequest): Uint8Array { + return QueryModuleStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateRequest): QueryModuleStateRequestProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryModuleStateRequest", + value: QueryModuleStateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryModuleStateResponse(): QueryModuleStateResponse { + return { + moduleState: false + }; +} +export const QueryModuleStateResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryModuleStateResponse", + encode(message: QueryModuleStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.moduleState === true) { + writer.uint32(8).bool(message.moduleState); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryModuleStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moduleState = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + message.moduleState = object.moduleState ?? false; + return message; + }, + fromAmino(object: QueryModuleStateResponseAmino): QueryModuleStateResponse { + const message = createBaseQueryModuleStateResponse(); + if (object.module_state !== undefined && object.module_state !== null) { + message.moduleState = object.module_state; + } + return message; + }, + toAmino(message: QueryModuleStateResponse, useInterfaces: boolean = false): QueryModuleStateResponseAmino { + const obj: any = {}; + obj.module_state = message.moduleState; + return obj; + }, + fromAminoMsg(object: QueryModuleStateResponseAminoMsg): QueryModuleStateResponse { + return QueryModuleStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryModuleStateResponseProtoMsg, useInterfaces: boolean = false): QueryModuleStateResponse { + return QueryModuleStateResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryModuleStateResponse): Uint8Array { + return QueryModuleStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleStateResponse): QueryModuleStateResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryModuleStateResponse", + value: QueryModuleStateResponse.encode(message).finish() + }; + } +}; +function createBaseQueryIBCTransientStoreRequest(): QueryIBCTransientStoreRequest { + return {}; +} +export const QueryIBCTransientStoreRequest = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryIBCTransientStoreRequest", + encode(_: QueryIBCTransientStoreRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryIBCTransientStoreRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryIBCTransientStoreRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryIBCTransientStoreRequest { + const message = createBaseQueryIBCTransientStoreRequest(); + return message; + }, + fromAmino(_: QueryIBCTransientStoreRequestAmino): QueryIBCTransientStoreRequest { + const message = createBaseQueryIBCTransientStoreRequest(); + return message; + }, + toAmino(_: QueryIBCTransientStoreRequest, useInterfaces: boolean = false): QueryIBCTransientStoreRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryIBCTransientStoreRequestAminoMsg): QueryIBCTransientStoreRequest { + return QueryIBCTransientStoreRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryIBCTransientStoreRequestProtoMsg, useInterfaces: boolean = false): QueryIBCTransientStoreRequest { + return QueryIBCTransientStoreRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryIBCTransientStoreRequest): Uint8Array { + return QueryIBCTransientStoreRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryIBCTransientStoreRequest): QueryIBCTransientStoreRequestProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryIBCTransientStoreRequest", + value: QueryIBCTransientStoreRequest.encode(message).finish() + }; + } +}; +function createBaseQueryIBCTransientStoreResponse(): QueryIBCTransientStoreResponse { + return { + iBCTransientStore: IBCAmountTransientStore.fromPartial({}) + }; +} +export const QueryIBCTransientStoreResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryIBCTransientStoreResponse", + encode(message: QueryIBCTransientStoreResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.iBCTransientStore !== undefined) { + IBCAmountTransientStore.encode(message.iBCTransientStore, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryIBCTransientStoreResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryIBCTransientStoreResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.iBCTransientStore = IBCAmountTransientStore.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryIBCTransientStoreResponse { + const message = createBaseQueryIBCTransientStoreResponse(); + message.iBCTransientStore = object.iBCTransientStore !== undefined && object.iBCTransientStore !== null ? IBCAmountTransientStore.fromPartial(object.iBCTransientStore) : undefined; + return message; + }, + fromAmino(object: QueryIBCTransientStoreResponseAmino): QueryIBCTransientStoreResponse { + const message = createBaseQueryIBCTransientStoreResponse(); + if (object.i_b_c_transient_store !== undefined && object.i_b_c_transient_store !== null) { + message.iBCTransientStore = IBCAmountTransientStore.fromAmino(object.i_b_c_transient_store); + } + return message; + }, + toAmino(message: QueryIBCTransientStoreResponse, useInterfaces: boolean = false): QueryIBCTransientStoreResponseAmino { + const obj: any = {}; + obj.i_b_c_transient_store = message.iBCTransientStore ? IBCAmountTransientStore.toAmino(message.iBCTransientStore, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryIBCTransientStoreResponseAminoMsg): QueryIBCTransientStoreResponse { + return QueryIBCTransientStoreResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryIBCTransientStoreResponseProtoMsg, useInterfaces: boolean = false): QueryIBCTransientStoreResponse { + return QueryIBCTransientStoreResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryIBCTransientStoreResponse): Uint8Array { + return QueryIBCTransientStoreResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryIBCTransientStoreResponse): QueryIBCTransientStoreResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryIBCTransientStoreResponse", + value: QueryIBCTransientStoreResponse.encode(message).finish() + }; + } +}; +function createBaseQueryUnclaimedRequest(): QueryUnclaimedRequest { + return { + delegatorAddress: "" + }; +} +export const QueryUnclaimedRequest = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryUnclaimedRequest", + encode(message: QueryUnclaimedRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryUnclaimedRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnclaimedRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUnclaimedRequest { + const message = createBaseQueryUnclaimedRequest(); + message.delegatorAddress = object.delegatorAddress ?? ""; + return message; + }, + fromAmino(object: QueryUnclaimedRequestAmino): QueryUnclaimedRequest { + const message = createBaseQueryUnclaimedRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; + }, + toAmino(message: QueryUnclaimedRequest, useInterfaces: boolean = false): QueryUnclaimedRequestAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress; + return obj; + }, + fromAminoMsg(object: QueryUnclaimedRequestAminoMsg): QueryUnclaimedRequest { + return QueryUnclaimedRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryUnclaimedRequestProtoMsg, useInterfaces: boolean = false): QueryUnclaimedRequest { + return QueryUnclaimedRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryUnclaimedRequest): Uint8Array { + return QueryUnclaimedRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUnclaimedRequest): QueryUnclaimedRequestProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryUnclaimedRequest", + value: QueryUnclaimedRequest.encode(message).finish() + }; + } +}; +function createBaseQueryUnclaimedResponse(): QueryUnclaimedResponse { + return { + unclaimed: [] + }; +} +export const QueryUnclaimedResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryUnclaimedResponse", + encode(message: QueryUnclaimedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.unclaimed) { + UnbondingEpochCValue.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryUnclaimedResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnclaimedResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unclaimed.push(UnbondingEpochCValue.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUnclaimedResponse { + const message = createBaseQueryUnclaimedResponse(); + message.unclaimed = object.unclaimed?.map(e => UnbondingEpochCValue.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryUnclaimedResponseAmino): QueryUnclaimedResponse { + const message = createBaseQueryUnclaimedResponse(); + message.unclaimed = object.unclaimed?.map(e => UnbondingEpochCValue.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryUnclaimedResponse, useInterfaces: boolean = false): QueryUnclaimedResponseAmino { + const obj: any = {}; + if (message.unclaimed) { + obj.unclaimed = message.unclaimed.map(e => e ? UnbondingEpochCValue.toAmino(e, useInterfaces) : undefined); + } else { + obj.unclaimed = []; + } + return obj; + }, + fromAminoMsg(object: QueryUnclaimedResponseAminoMsg): QueryUnclaimedResponse { + return QueryUnclaimedResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryUnclaimedResponseProtoMsg, useInterfaces: boolean = false): QueryUnclaimedResponse { + return QueryUnclaimedResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryUnclaimedResponse): Uint8Array { + return QueryUnclaimedResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUnclaimedResponse): QueryUnclaimedResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryUnclaimedResponse", + value: QueryUnclaimedResponse.encode(message).finish() + }; + } +}; +function createBaseQueryFailedUnbondingsRequest(): QueryFailedUnbondingsRequest { + return { + delegatorAddress: "" + }; +} +export const QueryFailedUnbondingsRequest = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryFailedUnbondingsRequest", + encode(message: QueryFailedUnbondingsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryFailedUnbondingsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFailedUnbondingsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryFailedUnbondingsRequest { + const message = createBaseQueryFailedUnbondingsRequest(); + message.delegatorAddress = object.delegatorAddress ?? ""; + return message; + }, + fromAmino(object: QueryFailedUnbondingsRequestAmino): QueryFailedUnbondingsRequest { + const message = createBaseQueryFailedUnbondingsRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; + }, + toAmino(message: QueryFailedUnbondingsRequest, useInterfaces: boolean = false): QueryFailedUnbondingsRequestAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress; + return obj; + }, + fromAminoMsg(object: QueryFailedUnbondingsRequestAminoMsg): QueryFailedUnbondingsRequest { + return QueryFailedUnbondingsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFailedUnbondingsRequestProtoMsg, useInterfaces: boolean = false): QueryFailedUnbondingsRequest { + return QueryFailedUnbondingsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryFailedUnbondingsRequest): Uint8Array { + return QueryFailedUnbondingsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryFailedUnbondingsRequest): QueryFailedUnbondingsRequestProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryFailedUnbondingsRequest", + value: QueryFailedUnbondingsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryFailedUnbondingsResponse(): QueryFailedUnbondingsResponse { + return { + failedUnbondings: [] + }; +} +export const QueryFailedUnbondingsResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryFailedUnbondingsResponse", + encode(message: QueryFailedUnbondingsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.failedUnbondings) { + UnbondingEpochCValue.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryFailedUnbondingsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryFailedUnbondingsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.failedUnbondings.push(UnbondingEpochCValue.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryFailedUnbondingsResponse { + const message = createBaseQueryFailedUnbondingsResponse(); + message.failedUnbondings = object.failedUnbondings?.map(e => UnbondingEpochCValue.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryFailedUnbondingsResponseAmino): QueryFailedUnbondingsResponse { + const message = createBaseQueryFailedUnbondingsResponse(); + message.failedUnbondings = object.failed_unbondings?.map(e => UnbondingEpochCValue.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryFailedUnbondingsResponse, useInterfaces: boolean = false): QueryFailedUnbondingsResponseAmino { + const obj: any = {}; + if (message.failedUnbondings) { + obj.failed_unbondings = message.failedUnbondings.map(e => e ? UnbondingEpochCValue.toAmino(e, useInterfaces) : undefined); + } else { + obj.failed_unbondings = []; + } + return obj; + }, + fromAminoMsg(object: QueryFailedUnbondingsResponseAminoMsg): QueryFailedUnbondingsResponse { + return QueryFailedUnbondingsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryFailedUnbondingsResponseProtoMsg, useInterfaces: boolean = false): QueryFailedUnbondingsResponse { + return QueryFailedUnbondingsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryFailedUnbondingsResponse): Uint8Array { + return QueryFailedUnbondingsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryFailedUnbondingsResponse): QueryFailedUnbondingsResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryFailedUnbondingsResponse", + value: QueryFailedUnbondingsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryPendingUnbondingsRequest(): QueryPendingUnbondingsRequest { + return { + delegatorAddress: "" + }; +} +export const QueryPendingUnbondingsRequest = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryPendingUnbondingsRequest", + encode(message: QueryPendingUnbondingsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryPendingUnbondingsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPendingUnbondingsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPendingUnbondingsRequest { + const message = createBaseQueryPendingUnbondingsRequest(); + message.delegatorAddress = object.delegatorAddress ?? ""; + return message; + }, + fromAmino(object: QueryPendingUnbondingsRequestAmino): QueryPendingUnbondingsRequest { + const message = createBaseQueryPendingUnbondingsRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; + }, + toAmino(message: QueryPendingUnbondingsRequest, useInterfaces: boolean = false): QueryPendingUnbondingsRequestAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress; + return obj; + }, + fromAminoMsg(object: QueryPendingUnbondingsRequestAminoMsg): QueryPendingUnbondingsRequest { + return QueryPendingUnbondingsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPendingUnbondingsRequestProtoMsg, useInterfaces: boolean = false): QueryPendingUnbondingsRequest { + return QueryPendingUnbondingsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryPendingUnbondingsRequest): Uint8Array { + return QueryPendingUnbondingsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryPendingUnbondingsRequest): QueryPendingUnbondingsRequestProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryPendingUnbondingsRequest", + value: QueryPendingUnbondingsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryPendingUnbondingsResponse(): QueryPendingUnbondingsResponse { + return { + pendingUnbondings: [] + }; +} +export const QueryPendingUnbondingsResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryPendingUnbondingsResponse", + encode(message: QueryPendingUnbondingsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.pendingUnbondings) { + UnbondingEpochCValue.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryPendingUnbondingsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPendingUnbondingsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pendingUnbondings.push(UnbondingEpochCValue.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryPendingUnbondingsResponse { + const message = createBaseQueryPendingUnbondingsResponse(); + message.pendingUnbondings = object.pendingUnbondings?.map(e => UnbondingEpochCValue.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryPendingUnbondingsResponseAmino): QueryPendingUnbondingsResponse { + const message = createBaseQueryPendingUnbondingsResponse(); + message.pendingUnbondings = object.pending_unbondings?.map(e => UnbondingEpochCValue.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryPendingUnbondingsResponse, useInterfaces: boolean = false): QueryPendingUnbondingsResponseAmino { + const obj: any = {}; + if (message.pendingUnbondings) { + obj.pending_unbondings = message.pendingUnbondings.map(e => e ? UnbondingEpochCValue.toAmino(e, useInterfaces) : undefined); + } else { + obj.pending_unbondings = []; + } + return obj; + }, + fromAminoMsg(object: QueryPendingUnbondingsResponseAminoMsg): QueryPendingUnbondingsResponse { + return QueryPendingUnbondingsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryPendingUnbondingsResponseProtoMsg, useInterfaces: boolean = false): QueryPendingUnbondingsResponse { + return QueryPendingUnbondingsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryPendingUnbondingsResponse): Uint8Array { + return QueryPendingUnbondingsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryPendingUnbondingsResponse): QueryPendingUnbondingsResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryPendingUnbondingsResponse", + value: QueryPendingUnbondingsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryUnbondingEpochCValueRequest(): QueryUnbondingEpochCValueRequest { + return { + epochNumber: BigInt(0) + }; +} +export const QueryUnbondingEpochCValueRequest = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryUnbondingEpochCValueRequest", + encode(message: QueryUnbondingEpochCValueRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.epochNumber !== BigInt(0)) { + writer.uint32(8).int64(message.epochNumber); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryUnbondingEpochCValueRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnbondingEpochCValueRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.epochNumber = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUnbondingEpochCValueRequest { + const message = createBaseQueryUnbondingEpochCValueRequest(); + message.epochNumber = object.epochNumber !== undefined && object.epochNumber !== null ? BigInt(object.epochNumber.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryUnbondingEpochCValueRequestAmino): QueryUnbondingEpochCValueRequest { + const message = createBaseQueryUnbondingEpochCValueRequest(); + if (object.epoch_number !== undefined && object.epoch_number !== null) { + message.epochNumber = BigInt(object.epoch_number); + } + return message; + }, + toAmino(message: QueryUnbondingEpochCValueRequest, useInterfaces: boolean = false): QueryUnbondingEpochCValueRequestAmino { + const obj: any = {}; + obj.epoch_number = message.epochNumber ? message.epochNumber.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryUnbondingEpochCValueRequestAminoMsg): QueryUnbondingEpochCValueRequest { + return QueryUnbondingEpochCValueRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryUnbondingEpochCValueRequestProtoMsg, useInterfaces: boolean = false): QueryUnbondingEpochCValueRequest { + return QueryUnbondingEpochCValueRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryUnbondingEpochCValueRequest): Uint8Array { + return QueryUnbondingEpochCValueRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUnbondingEpochCValueRequest): QueryUnbondingEpochCValueRequestProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryUnbondingEpochCValueRequest", + value: QueryUnbondingEpochCValueRequest.encode(message).finish() + }; + } +}; +function createBaseQueryUnbondingEpochCValueResponse(): QueryUnbondingEpochCValueResponse { + return { + unbondingEpochCValue: UnbondingEpochCValue.fromPartial({}) + }; +} +export const QueryUnbondingEpochCValueResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryUnbondingEpochCValueResponse", + encode(message: QueryUnbondingEpochCValueResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.unbondingEpochCValue !== undefined) { + UnbondingEpochCValue.encode(message.unbondingEpochCValue, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryUnbondingEpochCValueResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnbondingEpochCValueResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unbondingEpochCValue = UnbondingEpochCValue.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUnbondingEpochCValueResponse { + const message = createBaseQueryUnbondingEpochCValueResponse(); + message.unbondingEpochCValue = object.unbondingEpochCValue !== undefined && object.unbondingEpochCValue !== null ? UnbondingEpochCValue.fromPartial(object.unbondingEpochCValue) : undefined; + return message; + }, + fromAmino(object: QueryUnbondingEpochCValueResponseAmino): QueryUnbondingEpochCValueResponse { + const message = createBaseQueryUnbondingEpochCValueResponse(); + if (object.unbonding_epoch_c_value !== undefined && object.unbonding_epoch_c_value !== null) { + message.unbondingEpochCValue = UnbondingEpochCValue.fromAmino(object.unbonding_epoch_c_value); + } + return message; + }, + toAmino(message: QueryUnbondingEpochCValueResponse, useInterfaces: boolean = false): QueryUnbondingEpochCValueResponseAmino { + const obj: any = {}; + obj.unbonding_epoch_c_value = message.unbondingEpochCValue ? UnbondingEpochCValue.toAmino(message.unbondingEpochCValue, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryUnbondingEpochCValueResponseAminoMsg): QueryUnbondingEpochCValueResponse { + return QueryUnbondingEpochCValueResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryUnbondingEpochCValueResponseProtoMsg, useInterfaces: boolean = false): QueryUnbondingEpochCValueResponse { + return QueryUnbondingEpochCValueResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryUnbondingEpochCValueResponse): Uint8Array { + return QueryUnbondingEpochCValueResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUnbondingEpochCValueResponse): QueryUnbondingEpochCValueResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryUnbondingEpochCValueResponse", + value: QueryUnbondingEpochCValueResponse.encode(message).finish() + }; + } +}; +function createBaseQueryHostAccountUndelegationRequest(): QueryHostAccountUndelegationRequest { + return { + epochNumber: BigInt(0) + }; +} +export const QueryHostAccountUndelegationRequest = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryHostAccountUndelegationRequest", + encode(message: QueryHostAccountUndelegationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.epochNumber !== BigInt(0)) { + writer.uint32(8).int64(message.epochNumber); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryHostAccountUndelegationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHostAccountUndelegationRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.epochNumber = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryHostAccountUndelegationRequest { + const message = createBaseQueryHostAccountUndelegationRequest(); + message.epochNumber = object.epochNumber !== undefined && object.epochNumber !== null ? BigInt(object.epochNumber.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryHostAccountUndelegationRequestAmino): QueryHostAccountUndelegationRequest { + const message = createBaseQueryHostAccountUndelegationRequest(); + if (object.epoch_number !== undefined && object.epoch_number !== null) { + message.epochNumber = BigInt(object.epoch_number); + } + return message; + }, + toAmino(message: QueryHostAccountUndelegationRequest, useInterfaces: boolean = false): QueryHostAccountUndelegationRequestAmino { + const obj: any = {}; + obj.epoch_number = message.epochNumber ? message.epochNumber.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryHostAccountUndelegationRequestAminoMsg): QueryHostAccountUndelegationRequest { + return QueryHostAccountUndelegationRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryHostAccountUndelegationRequestProtoMsg, useInterfaces: boolean = false): QueryHostAccountUndelegationRequest { + return QueryHostAccountUndelegationRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryHostAccountUndelegationRequest): Uint8Array { + return QueryHostAccountUndelegationRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryHostAccountUndelegationRequest): QueryHostAccountUndelegationRequestProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryHostAccountUndelegationRequest", + value: QueryHostAccountUndelegationRequest.encode(message).finish() + }; + } +}; +function createBaseQueryHostAccountUndelegationResponse(): QueryHostAccountUndelegationResponse { + return { + hostAccountUndelegation: HostAccountUndelegation.fromPartial({}) + }; +} +export const QueryHostAccountUndelegationResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryHostAccountUndelegationResponse", + encode(message: QueryHostAccountUndelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hostAccountUndelegation !== undefined) { + HostAccountUndelegation.encode(message.hostAccountUndelegation, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryHostAccountUndelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHostAccountUndelegationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hostAccountUndelegation = HostAccountUndelegation.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryHostAccountUndelegationResponse { + const message = createBaseQueryHostAccountUndelegationResponse(); + message.hostAccountUndelegation = object.hostAccountUndelegation !== undefined && object.hostAccountUndelegation !== null ? HostAccountUndelegation.fromPartial(object.hostAccountUndelegation) : undefined; + return message; + }, + fromAmino(object: QueryHostAccountUndelegationResponseAmino): QueryHostAccountUndelegationResponse { + const message = createBaseQueryHostAccountUndelegationResponse(); + if (object.host_account_undelegation !== undefined && object.host_account_undelegation !== null) { + message.hostAccountUndelegation = HostAccountUndelegation.fromAmino(object.host_account_undelegation); + } + return message; + }, + toAmino(message: QueryHostAccountUndelegationResponse, useInterfaces: boolean = false): QueryHostAccountUndelegationResponseAmino { + const obj: any = {}; + obj.host_account_undelegation = message.hostAccountUndelegation ? HostAccountUndelegation.toAmino(message.hostAccountUndelegation, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryHostAccountUndelegationResponseAminoMsg): QueryHostAccountUndelegationResponse { + return QueryHostAccountUndelegationResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryHostAccountUndelegationResponseProtoMsg, useInterfaces: boolean = false): QueryHostAccountUndelegationResponse { + return QueryHostAccountUndelegationResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryHostAccountUndelegationResponse): Uint8Array { + return QueryHostAccountUndelegationResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryHostAccountUndelegationResponse): QueryHostAccountUndelegationResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryHostAccountUndelegationResponse", + value: QueryHostAccountUndelegationResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDelegatorUnbondingEpochEntryRequest(): QueryDelegatorUnbondingEpochEntryRequest { + return { + delegatorAddress: "", + epochNumber: BigInt(0) + }; +} +export const QueryDelegatorUnbondingEpochEntryRequest = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryDelegatorUnbondingEpochEntryRequest", + encode(message: QueryDelegatorUnbondingEpochEntryRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.epochNumber !== BigInt(0)) { + writer.uint32(16).int64(message.epochNumber); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryDelegatorUnbondingEpochEntryRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorUnbondingEpochEntryRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.epochNumber = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelegatorUnbondingEpochEntryRequest { + const message = createBaseQueryDelegatorUnbondingEpochEntryRequest(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.epochNumber = object.epochNumber !== undefined && object.epochNumber !== null ? BigInt(object.epochNumber.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryDelegatorUnbondingEpochEntryRequestAmino): QueryDelegatorUnbondingEpochEntryRequest { + const message = createBaseQueryDelegatorUnbondingEpochEntryRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.epoch_number !== undefined && object.epoch_number !== null) { + message.epochNumber = BigInt(object.epoch_number); + } + return message; + }, + toAmino(message: QueryDelegatorUnbondingEpochEntryRequest, useInterfaces: boolean = false): QueryDelegatorUnbondingEpochEntryRequestAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress; + obj.epoch_number = message.epochNumber ? message.epochNumber.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegatorUnbondingEpochEntryRequestAminoMsg): QueryDelegatorUnbondingEpochEntryRequest { + return QueryDelegatorUnbondingEpochEntryRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDelegatorUnbondingEpochEntryRequestProtoMsg, useInterfaces: boolean = false): QueryDelegatorUnbondingEpochEntryRequest { + return QueryDelegatorUnbondingEpochEntryRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryDelegatorUnbondingEpochEntryRequest): Uint8Array { + return QueryDelegatorUnbondingEpochEntryRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorUnbondingEpochEntryRequest): QueryDelegatorUnbondingEpochEntryRequestProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryDelegatorUnbondingEpochEntryRequest", + value: QueryDelegatorUnbondingEpochEntryRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDelegatorUnbondingEpochEntryResponse(): QueryDelegatorUnbondingEpochEntryResponse { + return { + delegatorUnbodingEpochEntry: DelegatorUnbondingEpochEntry.fromPartial({}) + }; +} +export const QueryDelegatorUnbondingEpochEntryResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryDelegatorUnbondingEpochEntryResponse", + encode(message: QueryDelegatorUnbondingEpochEntryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorUnbodingEpochEntry !== undefined) { + DelegatorUnbondingEpochEntry.encode(message.delegatorUnbodingEpochEntry, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryDelegatorUnbondingEpochEntryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDelegatorUnbondingEpochEntryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorUnbodingEpochEntry = DelegatorUnbondingEpochEntry.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDelegatorUnbondingEpochEntryResponse { + const message = createBaseQueryDelegatorUnbondingEpochEntryResponse(); + message.delegatorUnbodingEpochEntry = object.delegatorUnbodingEpochEntry !== undefined && object.delegatorUnbodingEpochEntry !== null ? DelegatorUnbondingEpochEntry.fromPartial(object.delegatorUnbodingEpochEntry) : undefined; + return message; + }, + fromAmino(object: QueryDelegatorUnbondingEpochEntryResponseAmino): QueryDelegatorUnbondingEpochEntryResponse { + const message = createBaseQueryDelegatorUnbondingEpochEntryResponse(); + if (object.delegator_unboding_epoch_entry !== undefined && object.delegator_unboding_epoch_entry !== null) { + message.delegatorUnbodingEpochEntry = DelegatorUnbondingEpochEntry.fromAmino(object.delegator_unboding_epoch_entry); + } + return message; + }, + toAmino(message: QueryDelegatorUnbondingEpochEntryResponse, useInterfaces: boolean = false): QueryDelegatorUnbondingEpochEntryResponseAmino { + const obj: any = {}; + obj.delegator_unboding_epoch_entry = message.delegatorUnbodingEpochEntry ? DelegatorUnbondingEpochEntry.toAmino(message.delegatorUnbodingEpochEntry, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDelegatorUnbondingEpochEntryResponseAminoMsg): QueryDelegatorUnbondingEpochEntryResponse { + return QueryDelegatorUnbondingEpochEntryResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDelegatorUnbondingEpochEntryResponseProtoMsg, useInterfaces: boolean = false): QueryDelegatorUnbondingEpochEntryResponse { + return QueryDelegatorUnbondingEpochEntryResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryDelegatorUnbondingEpochEntryResponse): Uint8Array { + return QueryDelegatorUnbondingEpochEntryResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDelegatorUnbondingEpochEntryResponse): QueryDelegatorUnbondingEpochEntryResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryDelegatorUnbondingEpochEntryResponse", + value: QueryDelegatorUnbondingEpochEntryResponse.encode(message).finish() + }; + } +}; +function createBaseQueryHostAccountsRequest(): QueryHostAccountsRequest { + return {}; +} +export const QueryHostAccountsRequest = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryHostAccountsRequest", + encode(_: QueryHostAccountsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryHostAccountsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHostAccountsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryHostAccountsRequest { + const message = createBaseQueryHostAccountsRequest(); + return message; + }, + fromAmino(_: QueryHostAccountsRequestAmino): QueryHostAccountsRequest { + const message = createBaseQueryHostAccountsRequest(); + return message; + }, + toAmino(_: QueryHostAccountsRequest, useInterfaces: boolean = false): QueryHostAccountsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryHostAccountsRequestAminoMsg): QueryHostAccountsRequest { + return QueryHostAccountsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryHostAccountsRequestProtoMsg, useInterfaces: boolean = false): QueryHostAccountsRequest { + return QueryHostAccountsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryHostAccountsRequest): Uint8Array { + return QueryHostAccountsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryHostAccountsRequest): QueryHostAccountsRequestProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryHostAccountsRequest", + value: QueryHostAccountsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryHostAccountsResponse(): QueryHostAccountsResponse { + return { + hostAccounts: HostAccounts.fromPartial({}) + }; +} +export const QueryHostAccountsResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryHostAccountsResponse", + encode(message: QueryHostAccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hostAccounts !== undefined) { + HostAccounts.encode(message.hostAccounts, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryHostAccountsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryHostAccountsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hostAccounts = HostAccounts.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryHostAccountsResponse { + const message = createBaseQueryHostAccountsResponse(); + message.hostAccounts = object.hostAccounts !== undefined && object.hostAccounts !== null ? HostAccounts.fromPartial(object.hostAccounts) : undefined; + return message; + }, + fromAmino(object: QueryHostAccountsResponseAmino): QueryHostAccountsResponse { + const message = createBaseQueryHostAccountsResponse(); + if (object.host_accounts !== undefined && object.host_accounts !== null) { + message.hostAccounts = HostAccounts.fromAmino(object.host_accounts); + } + return message; + }, + toAmino(message: QueryHostAccountsResponse, useInterfaces: boolean = false): QueryHostAccountsResponseAmino { + const obj: any = {}; + obj.host_accounts = message.hostAccounts ? HostAccounts.toAmino(message.hostAccounts, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryHostAccountsResponseAminoMsg): QueryHostAccountsResponse { + return QueryHostAccountsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryHostAccountsResponseProtoMsg, useInterfaces: boolean = false): QueryHostAccountsResponse { + return QueryHostAccountsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryHostAccountsResponse): Uint8Array { + return QueryHostAccountsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryHostAccountsResponse): QueryHostAccountsResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryHostAccountsResponse", + value: QueryHostAccountsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDepositModuleAccountRequest(): QueryDepositModuleAccountRequest { + return {}; +} +export const QueryDepositModuleAccountRequest = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryDepositModuleAccountRequest", + encode(_: QueryDepositModuleAccountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryDepositModuleAccountRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDepositModuleAccountRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryDepositModuleAccountRequest { + const message = createBaseQueryDepositModuleAccountRequest(); + return message; + }, + fromAmino(_: QueryDepositModuleAccountRequestAmino): QueryDepositModuleAccountRequest { + const message = createBaseQueryDepositModuleAccountRequest(); + return message; + }, + toAmino(_: QueryDepositModuleAccountRequest, useInterfaces: boolean = false): QueryDepositModuleAccountRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryDepositModuleAccountRequestAminoMsg): QueryDepositModuleAccountRequest { + return QueryDepositModuleAccountRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDepositModuleAccountRequestProtoMsg, useInterfaces: boolean = false): QueryDepositModuleAccountRequest { + return QueryDepositModuleAccountRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryDepositModuleAccountRequest): Uint8Array { + return QueryDepositModuleAccountRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDepositModuleAccountRequest): QueryDepositModuleAccountRequestProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryDepositModuleAccountRequest", + value: QueryDepositModuleAccountRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDepositModuleAccountResponse(): QueryDepositModuleAccountResponse { + return { + balance: Coin.fromPartial({}) + }; +} +export const QueryDepositModuleAccountResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryDepositModuleAccountResponse", + encode(message: QueryDepositModuleAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryDepositModuleAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDepositModuleAccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balance = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDepositModuleAccountResponse { + const message = createBaseQueryDepositModuleAccountResponse(); + message.balance = object.balance !== undefined && object.balance !== null ? Coin.fromPartial(object.balance) : undefined; + return message; + }, + fromAmino(object: QueryDepositModuleAccountResponseAmino): QueryDepositModuleAccountResponse { + const message = createBaseQueryDepositModuleAccountResponse(); + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } + return message; + }, + toAmino(message: QueryDepositModuleAccountResponse, useInterfaces: boolean = false): QueryDepositModuleAccountResponseAmino { + const obj: any = {}; + obj.balance = message.balance ? Coin.toAmino(message.balance, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDepositModuleAccountResponseAminoMsg): QueryDepositModuleAccountResponse { + return QueryDepositModuleAccountResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDepositModuleAccountResponseProtoMsg, useInterfaces: boolean = false): QueryDepositModuleAccountResponse { + return QueryDepositModuleAccountResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryDepositModuleAccountResponse): Uint8Array { + return QueryDepositModuleAccountResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDepositModuleAccountResponse): QueryDepositModuleAccountResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryDepositModuleAccountResponse", + value: QueryDepositModuleAccountResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllDelegatorUnbondingEpochEntriesRequest(): QueryAllDelegatorUnbondingEpochEntriesRequest { + return { + delegatorAddress: "" + }; +} +export const QueryAllDelegatorUnbondingEpochEntriesRequest = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryAllDelegatorUnbondingEpochEntriesRequest", + encode(message: QueryAllDelegatorUnbondingEpochEntriesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAllDelegatorUnbondingEpochEntriesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllDelegatorUnbondingEpochEntriesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllDelegatorUnbondingEpochEntriesRequest { + const message = createBaseQueryAllDelegatorUnbondingEpochEntriesRequest(); + message.delegatorAddress = object.delegatorAddress ?? ""; + return message; + }, + fromAmino(object: QueryAllDelegatorUnbondingEpochEntriesRequestAmino): QueryAllDelegatorUnbondingEpochEntriesRequest { + const message = createBaseQueryAllDelegatorUnbondingEpochEntriesRequest(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + return message; + }, + toAmino(message: QueryAllDelegatorUnbondingEpochEntriesRequest, useInterfaces: boolean = false): QueryAllDelegatorUnbondingEpochEntriesRequestAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress; + return obj; + }, + fromAminoMsg(object: QueryAllDelegatorUnbondingEpochEntriesRequestAminoMsg): QueryAllDelegatorUnbondingEpochEntriesRequest { + return QueryAllDelegatorUnbondingEpochEntriesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllDelegatorUnbondingEpochEntriesRequestProtoMsg, useInterfaces: boolean = false): QueryAllDelegatorUnbondingEpochEntriesRequest { + return QueryAllDelegatorUnbondingEpochEntriesRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAllDelegatorUnbondingEpochEntriesRequest): Uint8Array { + return QueryAllDelegatorUnbondingEpochEntriesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllDelegatorUnbondingEpochEntriesRequest): QueryAllDelegatorUnbondingEpochEntriesRequestProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryAllDelegatorUnbondingEpochEntriesRequest", + value: QueryAllDelegatorUnbondingEpochEntriesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllDelegatorUnbondingEpochEntriesResponse(): QueryAllDelegatorUnbondingEpochEntriesResponse { + return { + delegatorUnbondingEpochEntries: [] + }; +} +export const QueryAllDelegatorUnbondingEpochEntriesResponse = { + typeUrl: "/pstake.lscosmos.v1beta1.QueryAllDelegatorUnbondingEpochEntriesResponse", + encode(message: QueryAllDelegatorUnbondingEpochEntriesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.delegatorUnbondingEpochEntries) { + DelegatorUnbondingEpochEntry.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAllDelegatorUnbondingEpochEntriesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllDelegatorUnbondingEpochEntriesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorUnbondingEpochEntries.push(DelegatorUnbondingEpochEntry.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllDelegatorUnbondingEpochEntriesResponse { + const message = createBaseQueryAllDelegatorUnbondingEpochEntriesResponse(); + message.delegatorUnbondingEpochEntries = object.delegatorUnbondingEpochEntries?.map(e => DelegatorUnbondingEpochEntry.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryAllDelegatorUnbondingEpochEntriesResponseAmino): QueryAllDelegatorUnbondingEpochEntriesResponse { + const message = createBaseQueryAllDelegatorUnbondingEpochEntriesResponse(); + message.delegatorUnbondingEpochEntries = object.delegator_unbonding_epoch_entries?.map(e => DelegatorUnbondingEpochEntry.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryAllDelegatorUnbondingEpochEntriesResponse, useInterfaces: boolean = false): QueryAllDelegatorUnbondingEpochEntriesResponseAmino { + const obj: any = {}; + if (message.delegatorUnbondingEpochEntries) { + obj.delegator_unbonding_epoch_entries = message.delegatorUnbondingEpochEntries.map(e => e ? DelegatorUnbondingEpochEntry.toAmino(e, useInterfaces) : undefined); + } else { + obj.delegator_unbonding_epoch_entries = []; + } + return obj; + }, + fromAminoMsg(object: QueryAllDelegatorUnbondingEpochEntriesResponseAminoMsg): QueryAllDelegatorUnbondingEpochEntriesResponse { + return QueryAllDelegatorUnbondingEpochEntriesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllDelegatorUnbondingEpochEntriesResponseProtoMsg, useInterfaces: boolean = false): QueryAllDelegatorUnbondingEpochEntriesResponse { + return QueryAllDelegatorUnbondingEpochEntriesResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAllDelegatorUnbondingEpochEntriesResponse): Uint8Array { + return QueryAllDelegatorUnbondingEpochEntriesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllDelegatorUnbondingEpochEntriesResponse): QueryAllDelegatorUnbondingEpochEntriesResponseProtoMsg { + return { + typeUrl: "/pstake.lscosmos.v1beta1.QueryAllDelegatorUnbondingEpochEntriesResponse", + value: QueryAllDelegatorUnbondingEpochEntriesResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/contract.ts b/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/contract.ts new file mode 100644 index 000000000..fc04f5c71 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/contract.ts @@ -0,0 +1,343 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +/** msg blob for instantiate contract. */ +export interface InstantiateLiquidStakeRateContract { + admin: string; + transferChannelID: string; + transferPortID: string; +} +export interface InstantiateLiquidStakeRateContractProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.InstantiateLiquidStakeRateContract"; + value: Uint8Array; +} +/** msg blob for instantiate contract. */ +export interface InstantiateLiquidStakeRateContractAmino { + admin?: string; + transfer_channel_i_d?: string; + transfer_port_i_d?: string; +} +export interface InstantiateLiquidStakeRateContractAminoMsg { + type: "/pstake.ratesync.v1beta1.InstantiateLiquidStakeRateContract"; + value: InstantiateLiquidStakeRateContractAmino; +} +/** msg blob for instantiate contract. */ +export interface InstantiateLiquidStakeRateContractSDKType { + admin: string; + transfer_channel_i_d: string; + transfer_port_i_d: string; +} +/** + * wrapper for liquidstakerate as wasm msg should be marshalled as encodedMsg = + * { wasmMsg: { wasm MsgDetails } } + */ +export interface ExecuteLiquidStakeRate { + liquidStakeRate: LiquidStakeRate | undefined; +} +export interface ExecuteLiquidStakeRateProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.ExecuteLiquidStakeRate"; + value: Uint8Array; +} +/** + * wrapper for liquidstakerate as wasm msg should be marshalled as encodedMsg = + * { wasmMsg: { wasm MsgDetails } } + */ +export interface ExecuteLiquidStakeRateAmino { + liquid_stake_rate?: LiquidStakeRateAmino | undefined; +} +export interface ExecuteLiquidStakeRateAminoMsg { + type: "/pstake.ratesync.v1beta1.ExecuteLiquidStakeRate"; + value: ExecuteLiquidStakeRateAmino; +} +/** + * wrapper for liquidstakerate as wasm msg should be marshalled as encodedMsg = + * { wasmMsg: { wasm MsgDetails } } + */ +export interface ExecuteLiquidStakeRateSDKType { + liquid_stake_rate: LiquidStakeRateSDKType | undefined; +} +/** msg blob for execute contract. */ +export interface LiquidStakeRate { + defaultBondDenom: string; + stkDenom: string; + /** + * cvalue = default_bond_denom_price/stk_denom_price + * cvalue = stk_denom_supply/default_bond_denom_supply + */ + cValue: string; + controllerChainTime: bigint; +} +export interface LiquidStakeRateProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.LiquidStakeRate"; + value: Uint8Array; +} +/** msg blob for execute contract. */ +export interface LiquidStakeRateAmino { + default_bond_denom?: string; + stk_denom?: string; + /** + * cvalue = default_bond_denom_price/stk_denom_price + * cvalue = stk_denom_supply/default_bond_denom_supply + */ + c_value?: string; + controller_chain_time?: string; +} +export interface LiquidStakeRateAminoMsg { + type: "/pstake.ratesync.v1beta1.LiquidStakeRate"; + value: LiquidStakeRateAmino; +} +/** msg blob for execute contract. */ +export interface LiquidStakeRateSDKType { + default_bond_denom: string; + stk_denom: string; + c_value: string; + controller_chain_time: bigint; +} +function createBaseInstantiateLiquidStakeRateContract(): InstantiateLiquidStakeRateContract { + return { + admin: "", + transferChannelID: "", + transferPortID: "" + }; +} +export const InstantiateLiquidStakeRateContract = { + typeUrl: "/pstake.ratesync.v1beta1.InstantiateLiquidStakeRateContract", + encode(message: InstantiateLiquidStakeRateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.transferChannelID !== "") { + writer.uint32(18).string(message.transferChannelID); + } + if (message.transferPortID !== "") { + writer.uint32(26).string(message.transferPortID); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): InstantiateLiquidStakeRateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInstantiateLiquidStakeRateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.transferChannelID = reader.string(); + break; + case 3: + message.transferPortID = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InstantiateLiquidStakeRateContract { + const message = createBaseInstantiateLiquidStakeRateContract(); + message.admin = object.admin ?? ""; + message.transferChannelID = object.transferChannelID ?? ""; + message.transferPortID = object.transferPortID ?? ""; + return message; + }, + fromAmino(object: InstantiateLiquidStakeRateContractAmino): InstantiateLiquidStakeRateContract { + const message = createBaseInstantiateLiquidStakeRateContract(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.transfer_channel_i_d !== undefined && object.transfer_channel_i_d !== null) { + message.transferChannelID = object.transfer_channel_i_d; + } + if (object.transfer_port_i_d !== undefined && object.transfer_port_i_d !== null) { + message.transferPortID = object.transfer_port_i_d; + } + return message; + }, + toAmino(message: InstantiateLiquidStakeRateContract, useInterfaces: boolean = false): InstantiateLiquidStakeRateContractAmino { + const obj: any = {}; + obj.admin = message.admin; + obj.transfer_channel_i_d = message.transferChannelID; + obj.transfer_port_i_d = message.transferPortID; + return obj; + }, + fromAminoMsg(object: InstantiateLiquidStakeRateContractAminoMsg): InstantiateLiquidStakeRateContract { + return InstantiateLiquidStakeRateContract.fromAmino(object.value); + }, + fromProtoMsg(message: InstantiateLiquidStakeRateContractProtoMsg, useInterfaces: boolean = false): InstantiateLiquidStakeRateContract { + return InstantiateLiquidStakeRateContract.decode(message.value, undefined, useInterfaces); + }, + toProto(message: InstantiateLiquidStakeRateContract): Uint8Array { + return InstantiateLiquidStakeRateContract.encode(message).finish(); + }, + toProtoMsg(message: InstantiateLiquidStakeRateContract): InstantiateLiquidStakeRateContractProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.InstantiateLiquidStakeRateContract", + value: InstantiateLiquidStakeRateContract.encode(message).finish() + }; + } +}; +function createBaseExecuteLiquidStakeRate(): ExecuteLiquidStakeRate { + return { + liquidStakeRate: LiquidStakeRate.fromPartial({}) + }; +} +export const ExecuteLiquidStakeRate = { + typeUrl: "/pstake.ratesync.v1beta1.ExecuteLiquidStakeRate", + encode(message: ExecuteLiquidStakeRate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.liquidStakeRate !== undefined) { + LiquidStakeRate.encode(message.liquidStakeRate, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ExecuteLiquidStakeRate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExecuteLiquidStakeRate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.liquidStakeRate = LiquidStakeRate.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ExecuteLiquidStakeRate { + const message = createBaseExecuteLiquidStakeRate(); + message.liquidStakeRate = object.liquidStakeRate !== undefined && object.liquidStakeRate !== null ? LiquidStakeRate.fromPartial(object.liquidStakeRate) : undefined; + return message; + }, + fromAmino(object: ExecuteLiquidStakeRateAmino): ExecuteLiquidStakeRate { + const message = createBaseExecuteLiquidStakeRate(); + if (object.liquid_stake_rate !== undefined && object.liquid_stake_rate !== null) { + message.liquidStakeRate = LiquidStakeRate.fromAmino(object.liquid_stake_rate); + } + return message; + }, + toAmino(message: ExecuteLiquidStakeRate, useInterfaces: boolean = false): ExecuteLiquidStakeRateAmino { + const obj: any = {}; + obj.liquid_stake_rate = message.liquidStakeRate ? LiquidStakeRate.toAmino(message.liquidStakeRate, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: ExecuteLiquidStakeRateAminoMsg): ExecuteLiquidStakeRate { + return ExecuteLiquidStakeRate.fromAmino(object.value); + }, + fromProtoMsg(message: ExecuteLiquidStakeRateProtoMsg, useInterfaces: boolean = false): ExecuteLiquidStakeRate { + return ExecuteLiquidStakeRate.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ExecuteLiquidStakeRate): Uint8Array { + return ExecuteLiquidStakeRate.encode(message).finish(); + }, + toProtoMsg(message: ExecuteLiquidStakeRate): ExecuteLiquidStakeRateProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.ExecuteLiquidStakeRate", + value: ExecuteLiquidStakeRate.encode(message).finish() + }; + } +}; +function createBaseLiquidStakeRate(): LiquidStakeRate { + return { + defaultBondDenom: "", + stkDenom: "", + cValue: "", + controllerChainTime: BigInt(0) + }; +} +export const LiquidStakeRate = { + typeUrl: "/pstake.ratesync.v1beta1.LiquidStakeRate", + encode(message: LiquidStakeRate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.defaultBondDenom !== "") { + writer.uint32(10).string(message.defaultBondDenom); + } + if (message.stkDenom !== "") { + writer.uint32(18).string(message.stkDenom); + } + if (message.cValue !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.cValue, 18).atomics); + } + if (message.controllerChainTime !== BigInt(0)) { + writer.uint32(32).int64(message.controllerChainTime); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): LiquidStakeRate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLiquidStakeRate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.defaultBondDenom = reader.string(); + break; + case 2: + message.stkDenom = reader.string(); + break; + case 3: + message.cValue = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 4: + message.controllerChainTime = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LiquidStakeRate { + const message = createBaseLiquidStakeRate(); + message.defaultBondDenom = object.defaultBondDenom ?? ""; + message.stkDenom = object.stkDenom ?? ""; + message.cValue = object.cValue ?? ""; + message.controllerChainTime = object.controllerChainTime !== undefined && object.controllerChainTime !== null ? BigInt(object.controllerChainTime.toString()) : BigInt(0); + return message; + }, + fromAmino(object: LiquidStakeRateAmino): LiquidStakeRate { + const message = createBaseLiquidStakeRate(); + if (object.default_bond_denom !== undefined && object.default_bond_denom !== null) { + message.defaultBondDenom = object.default_bond_denom; + } + if (object.stk_denom !== undefined && object.stk_denom !== null) { + message.stkDenom = object.stk_denom; + } + if (object.c_value !== undefined && object.c_value !== null) { + message.cValue = object.c_value; + } + if (object.controller_chain_time !== undefined && object.controller_chain_time !== null) { + message.controllerChainTime = BigInt(object.controller_chain_time); + } + return message; + }, + toAmino(message: LiquidStakeRate, useInterfaces: boolean = false): LiquidStakeRateAmino { + const obj: any = {}; + obj.default_bond_denom = message.defaultBondDenom; + obj.stk_denom = message.stkDenom; + obj.c_value = message.cValue; + obj.controller_chain_time = message.controllerChainTime ? message.controllerChainTime.toString() : undefined; + return obj; + }, + fromAminoMsg(object: LiquidStakeRateAminoMsg): LiquidStakeRate { + return LiquidStakeRate.fromAmino(object.value); + }, + fromProtoMsg(message: LiquidStakeRateProtoMsg, useInterfaces: boolean = false): LiquidStakeRate { + return LiquidStakeRate.decode(message.value, undefined, useInterfaces); + }, + toProto(message: LiquidStakeRate): Uint8Array { + return LiquidStakeRate.encode(message).finish(); + }, + toProtoMsg(message: LiquidStakeRate): LiquidStakeRateProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.LiquidStakeRate", + value: LiquidStakeRate.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/genesis.ts b/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/genesis.ts new file mode 100644 index 000000000..496eca190 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/genesis.ts @@ -0,0 +1,104 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { HostChain, HostChainAmino, HostChainSDKType } from "./ratesync"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** GenesisState defines the ratesync module's genesis state. */ +export interface GenesisState { + params: Params | undefined; + hostChains: HostChain[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the ratesync module's genesis state. */ +export interface GenesisStateAmino { + params?: ParamsAmino | undefined; + host_chains?: HostChainAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/pstake.ratesync.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the ratesync module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType | undefined; + host_chains: HostChainSDKType[]; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + hostChains: [] + }; +} +export const GenesisState = { + typeUrl: "/pstake.ratesync.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.hostChains) { + HostChain.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.hostChains.push(HostChain.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.hostChains = object.hostChains?.map(e => HostChain.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.hostChains = object.host_chains?.map(e => HostChain.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState, useInterfaces: boolean = false): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + if (message.hostChains) { + obj.host_chains = message.hostChains.map(e => e ? HostChain.toAmino(e, useInterfaces) : undefined); + } else { + obj.host_chains = []; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg, useInterfaces: boolean = false): GenesisState { + return GenesisState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/params.ts b/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/params.ts new file mode 100644 index 000000000..f9004461f --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/params.ts @@ -0,0 +1,84 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** Params defines the parameters for the module. */ +export interface Params { + admin: string; +} +export interface ParamsProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the module. */ +export interface ParamsAmino { + admin?: string; +} +export interface ParamsAminoMsg { + type: "/pstake.ratesync.v1beta1.Params"; + value: ParamsAmino; +} +/** Params defines the parameters for the module. */ +export interface ParamsSDKType { + admin: string; +} +function createBaseParams(): Params { + return { + admin: "" + }; +} +export const Params = { + typeUrl: "/pstake.ratesync.v1beta1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.admin = object.admin ?? ""; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + return message; + }, + toAmino(message: Params, useInterfaces: boolean = false): ParamsAmino { + const obj: any = {}; + obj.admin = message.admin; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsProtoMsg, useInterfaces: boolean = false): Params { + return Params.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/query.rpc.Query.ts new file mode 100644 index 000000000..438e9a28b --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/query.rpc.Query.ts @@ -0,0 +1,53 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryParamsRequest, QueryParamsResponse, QueryGetHostChainRequest, QueryGetHostChainResponse, QueryAllHostChainsRequest, QueryAllHostChainsResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Parameters queries the parameters of the module. */ + params(request?: QueryParamsRequest): Promise; + /** Queries a list of Chain items. */ + hostChain(request: QueryGetHostChainRequest): Promise; + allHostChains(request?: QueryAllHostChainsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + this.hostChain = this.hostChain.bind(this); + this.allHostChains = this.allHostChains.bind(this); + } + params(request: QueryParamsRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.ratesync.v1beta1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + hostChain(request: QueryGetHostChainRequest, useInterfaces: boolean = true): Promise { + const data = QueryGetHostChainRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.ratesync.v1beta1.Query", "HostChain", data); + return promise.then(data => QueryGetHostChainResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + allHostChains(request: QueryAllHostChainsRequest = { + pagination: undefined + }, useInterfaces: boolean = true): Promise { + const data = QueryAllHostChainsRequest.encode(request).finish(); + const promise = this.rpc.request("pstake.ratesync.v1beta1.Query", "AllHostChains", data); + return promise.then(data => QueryAllHostChainsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest, useInterfaces: boolean = true): Promise { + return queryService.params(request, useInterfaces); + }, + hostChain(request: QueryGetHostChainRequest, useInterfaces: boolean = true): Promise { + return queryService.hostChain(request, useInterfaces); + }, + allHostChains(request?: QueryAllHostChainsRequest, useInterfaces: boolean = true): Promise { + return queryService.allHostChains(request, useInterfaces); + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/query.ts b/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/query.ts new file mode 100644 index 000000000..54e40d0ff --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/query.ts @@ -0,0 +1,491 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../cosmos/base/query/v1beta1/pagination"; +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { HostChain, HostChainAmino, HostChainSDKType } from "./ratesync"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/pstake.ratesync.v1beta1.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params holds all the parameters of this module. */ + params: Params | undefined; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** params holds all the parameters of this module. */ + params?: ParamsAmino | undefined; +} +export interface QueryParamsResponseAminoMsg { + type: "/pstake.ratesync.v1beta1.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType | undefined; +} +export interface QueryGetHostChainRequest { + iD: bigint; +} +export interface QueryGetHostChainRequestProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.QueryGetHostChainRequest"; + value: Uint8Array; +} +export interface QueryGetHostChainRequestAmino { + i_d?: string; +} +export interface QueryGetHostChainRequestAminoMsg { + type: "/pstake.ratesync.v1beta1.QueryGetHostChainRequest"; + value: QueryGetHostChainRequestAmino; +} +export interface QueryGetHostChainRequestSDKType { + i_d: bigint; +} +export interface QueryGetHostChainResponse { + hostChain: HostChain | undefined; +} +export interface QueryGetHostChainResponseProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.QueryGetHostChainResponse"; + value: Uint8Array; +} +export interface QueryGetHostChainResponseAmino { + host_chain?: HostChainAmino | undefined; +} +export interface QueryGetHostChainResponseAminoMsg { + type: "/pstake.ratesync.v1beta1.QueryGetHostChainResponse"; + value: QueryGetHostChainResponseAmino; +} +export interface QueryGetHostChainResponseSDKType { + host_chain: HostChainSDKType | undefined; +} +export interface QueryAllHostChainsRequest { + pagination?: PageRequest | undefined; +} +export interface QueryAllHostChainsRequestProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.QueryAllHostChainsRequest"; + value: Uint8Array; +} +export interface QueryAllHostChainsRequestAmino { + pagination?: PageRequestAmino | undefined; +} +export interface QueryAllHostChainsRequestAminoMsg { + type: "/pstake.ratesync.v1beta1.QueryAllHostChainsRequest"; + value: QueryAllHostChainsRequestAmino; +} +export interface QueryAllHostChainsRequestSDKType { + pagination?: PageRequestSDKType | undefined; +} +export interface QueryAllHostChainsResponse { + hostChains: HostChain[]; + pagination?: PageResponse | undefined; +} +export interface QueryAllHostChainsResponseProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.QueryAllHostChainsResponse"; + value: Uint8Array; +} +export interface QueryAllHostChainsResponseAmino { + host_chains?: HostChainAmino[]; + pagination?: PageResponseAmino | undefined; +} +export interface QueryAllHostChainsResponseAminoMsg { + type: "/pstake.ratesync.v1beta1.QueryAllHostChainsResponse"; + value: QueryAllHostChainsResponseAmino; +} +export interface QueryAllHostChainsResponseSDKType { + host_chains: HostChainSDKType[]; + pagination?: PageResponseSDKType | undefined; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/pstake.ratesync.v1beta1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest, useInterfaces: boolean = false): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg, useInterfaces: boolean = false): QueryParamsRequest { + return QueryParamsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/pstake.ratesync.v1beta1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse, useInterfaces: boolean = false): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg, useInterfaces: boolean = false): QueryParamsResponse { + return QueryParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryGetHostChainRequest(): QueryGetHostChainRequest { + return { + iD: BigInt(0) + }; +} +export const QueryGetHostChainRequest = { + typeUrl: "/pstake.ratesync.v1beta1.QueryGetHostChainRequest", + encode(message: QueryGetHostChainRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.iD !== BigInt(0)) { + writer.uint32(8).uint64(message.iD); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryGetHostChainRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetHostChainRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.iD = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGetHostChainRequest { + const message = createBaseQueryGetHostChainRequest(); + message.iD = object.iD !== undefined && object.iD !== null ? BigInt(object.iD.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryGetHostChainRequestAmino): QueryGetHostChainRequest { + const message = createBaseQueryGetHostChainRequest(); + if (object.i_d !== undefined && object.i_d !== null) { + message.iD = BigInt(object.i_d); + } + return message; + }, + toAmino(message: QueryGetHostChainRequest, useInterfaces: boolean = false): QueryGetHostChainRequestAmino { + const obj: any = {}; + obj.i_d = message.iD ? message.iD.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryGetHostChainRequestAminoMsg): QueryGetHostChainRequest { + return QueryGetHostChainRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryGetHostChainRequestProtoMsg, useInterfaces: boolean = false): QueryGetHostChainRequest { + return QueryGetHostChainRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryGetHostChainRequest): Uint8Array { + return QueryGetHostChainRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGetHostChainRequest): QueryGetHostChainRequestProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.QueryGetHostChainRequest", + value: QueryGetHostChainRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGetHostChainResponse(): QueryGetHostChainResponse { + return { + hostChain: HostChain.fromPartial({}) + }; +} +export const QueryGetHostChainResponse = { + typeUrl: "/pstake.ratesync.v1beta1.QueryGetHostChainResponse", + encode(message: QueryGetHostChainResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hostChain !== undefined) { + HostChain.encode(message.hostChain, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryGetHostChainResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetHostChainResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hostChain = HostChain.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGetHostChainResponse { + const message = createBaseQueryGetHostChainResponse(); + message.hostChain = object.hostChain !== undefined && object.hostChain !== null ? HostChain.fromPartial(object.hostChain) : undefined; + return message; + }, + fromAmino(object: QueryGetHostChainResponseAmino): QueryGetHostChainResponse { + const message = createBaseQueryGetHostChainResponse(); + if (object.host_chain !== undefined && object.host_chain !== null) { + message.hostChain = HostChain.fromAmino(object.host_chain); + } + return message; + }, + toAmino(message: QueryGetHostChainResponse, useInterfaces: boolean = false): QueryGetHostChainResponseAmino { + const obj: any = {}; + obj.host_chain = message.hostChain ? HostChain.toAmino(message.hostChain, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGetHostChainResponseAminoMsg): QueryGetHostChainResponse { + return QueryGetHostChainResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryGetHostChainResponseProtoMsg, useInterfaces: boolean = false): QueryGetHostChainResponse { + return QueryGetHostChainResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryGetHostChainResponse): Uint8Array { + return QueryGetHostChainResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGetHostChainResponse): QueryGetHostChainResponseProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.QueryGetHostChainResponse", + value: QueryGetHostChainResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAllHostChainsRequest(): QueryAllHostChainsRequest { + return { + pagination: undefined + }; +} +export const QueryAllHostChainsRequest = { + typeUrl: "/pstake.ratesync.v1beta1.QueryAllHostChainsRequest", + encode(message: QueryAllHostChainsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAllHostChainsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllHostChainsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllHostChainsRequest { + const message = createBaseQueryAllHostChainsRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllHostChainsRequestAmino): QueryAllHostChainsRequest { + const message = createBaseQueryAllHostChainsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllHostChainsRequest, useInterfaces: boolean = false): QueryAllHostChainsRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllHostChainsRequestAminoMsg): QueryAllHostChainsRequest { + return QueryAllHostChainsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllHostChainsRequestProtoMsg, useInterfaces: boolean = false): QueryAllHostChainsRequest { + return QueryAllHostChainsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAllHostChainsRequest): Uint8Array { + return QueryAllHostChainsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAllHostChainsRequest): QueryAllHostChainsRequestProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.QueryAllHostChainsRequest", + value: QueryAllHostChainsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAllHostChainsResponse(): QueryAllHostChainsResponse { + return { + hostChains: [], + pagination: undefined + }; +} +export const QueryAllHostChainsResponse = { + typeUrl: "/pstake.ratesync.v1beta1.QueryAllHostChainsResponse", + encode(message: QueryAllHostChainsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.hostChains) { + HostChain.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAllHostChainsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllHostChainsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hostChains.push(HostChain.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAllHostChainsResponse { + const message = createBaseQueryAllHostChainsResponse(); + message.hostChains = object.hostChains?.map(e => HostChain.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAllHostChainsResponseAmino): QueryAllHostChainsResponse { + const message = createBaseQueryAllHostChainsResponse(); + message.hostChains = object.host_chains?.map(e => HostChain.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAllHostChainsResponse, useInterfaces: boolean = false): QueryAllHostChainsResponseAmino { + const obj: any = {}; + if (message.hostChains) { + obj.host_chains = message.hostChains.map(e => e ? HostChain.toAmino(e, useInterfaces) : undefined); + } else { + obj.host_chains = []; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllHostChainsResponseAminoMsg): QueryAllHostChainsResponse { + return QueryAllHostChainsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryAllHostChainsResponseProtoMsg, useInterfaces: boolean = false): QueryAllHostChainsResponse { + return QueryAllHostChainsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAllHostChainsResponse): Uint8Array { + return QueryAllHostChainsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAllHostChainsResponse): QueryAllHostChainsResponseProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.QueryAllHostChainsResponse", + value: QueryAllHostChainsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/ratesync.ts b/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/ratesync.ts new file mode 100644 index 000000000..0ef81284a --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/ratesync.ts @@ -0,0 +1,626 @@ +import { ICAAccount, ICAAccountAmino, ICAAccountSDKType } from "../../liquidstakeibc/v1beta1/liquidstakeibc"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +export enum InstantiationState { + /** INSTANTIATION_NOT_INITIATED - Not Initiated */ + INSTANTIATION_NOT_INITIATED = 0, + /** INSTANTIATION_INITIATED - Initiated */ + INSTANTIATION_INITIATED = 1, + /** INSTANTIATION_COMPLETED - we should have an address */ + INSTANTIATION_COMPLETED = 2, + UNRECOGNIZED = -1, +} +export const InstantiationStateSDKType = InstantiationState; +export const InstantiationStateAmino = InstantiationState; +export function instantiationStateFromJSON(object: any): InstantiationState { + switch (object) { + case 0: + case "INSTANTIATION_NOT_INITIATED": + return InstantiationState.INSTANTIATION_NOT_INITIATED; + case 1: + case "INSTANTIATION_INITIATED": + return InstantiationState.INSTANTIATION_INITIATED; + case 2: + case "INSTANTIATION_COMPLETED": + return InstantiationState.INSTANTIATION_COMPLETED; + case -1: + case "UNRECOGNIZED": + default: + return InstantiationState.UNRECOGNIZED; + } +} +export function instantiationStateToJSON(object: InstantiationState): string { + switch (object) { + case InstantiationState.INSTANTIATION_NOT_INITIATED: + return "INSTANTIATION_NOT_INITIATED"; + case InstantiationState.INSTANTIATION_INITIATED: + return "INSTANTIATION_INITIATED"; + case InstantiationState.INSTANTIATION_COMPLETED: + return "INSTANTIATION_COMPLETED"; + case InstantiationState.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum FeatureType { + LIQUID_STAKE_IBC = 0, + LIQUID_STAKE = 1, + UNRECOGNIZED = -1, +} +export const FeatureTypeSDKType = FeatureType; +export const FeatureTypeAmino = FeatureType; +export function featureTypeFromJSON(object: any): FeatureType { + switch (object) { + case 0: + case "LIQUID_STAKE_IBC": + return FeatureType.LIQUID_STAKE_IBC; + case 1: + case "LIQUID_STAKE": + return FeatureType.LIQUID_STAKE; + case -1: + case "UNRECOGNIZED": + default: + return FeatureType.UNRECOGNIZED; + } +} +export function featureTypeToJSON(object: FeatureType): string { + switch (object) { + case FeatureType.LIQUID_STAKE_IBC: + return "LIQUID_STAKE_IBC"; + case FeatureType.LIQUID_STAKE: + return "LIQUID_STAKE"; + case FeatureType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** HostChain defines the ratesync module's HostChain state. */ +export interface HostChain { + /** unique id */ + iD: bigint; + /** not really required, just easier readability */ + chainID: string; + connectionID: string; + iCAAccount: ICAAccount | undefined; + features: Feature | undefined; + transferChannelID: string; + transferPortID: string; +} +export interface HostChainProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.HostChain"; + value: Uint8Array; +} +/** HostChain defines the ratesync module's HostChain state. */ +export interface HostChainAmino { + /** unique id */ + i_d?: string; + /** not really required, just easier readability */ + chain_i_d?: string; + connection_i_d?: string; + i_c_a_account: ICAAccountAmino | undefined; + features: FeatureAmino | undefined; + transfer_channel_i_d?: string; + transfer_port_i_d?: string; +} +export interface HostChainAminoMsg { + type: "/pstake.ratesync.v1beta1.HostChain"; + value: HostChainAmino; +} +/** HostChain defines the ratesync module's HostChain state. */ +export interface HostChainSDKType { + i_d: bigint; + chain_i_d: string; + connection_i_d: string; + i_c_a_account: ICAAccountSDKType | undefined; + features: FeatureSDKType | undefined; + transfer_channel_i_d: string; + transfer_port_i_d: string; +} +export interface Feature { + /** triggers on hooks */ + liquidStakeIBC: LiquidStake | undefined; + /** triggers on hour epoch */ + liquidStake: LiquidStake | undefined; +} +export interface FeatureProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.Feature"; + value: Uint8Array; +} +export interface FeatureAmino { + /** triggers on hooks */ + liquid_stake_i_b_c: LiquidStakeAmino | undefined; + /** triggers on hour epoch */ + liquid_stake: LiquidStakeAmino | undefined; +} +export interface FeatureAminoMsg { + type: "/pstake.ratesync.v1beta1.Feature"; + value: FeatureAmino; +} +export interface FeatureSDKType { + liquid_stake_i_b_c: LiquidStakeSDKType | undefined; + liquid_stake: LiquidStakeSDKType | undefined; +} +export interface LiquidStake { + featureType: FeatureType; + /** needs to be uploaded before hand */ + codeID: bigint; + /** + * state of instantiation, do not support gov based instantiation. (need ICA + * to be at least admin) + */ + instantiation: InstantiationState; + /** address of instantiated contract. */ + contractAddress: string; + /** + * allow * as default for all denoms in case of lsibc, or default bond denom + * in case of ls. + */ + denoms: string[]; + enabled: boolean; +} +export interface LiquidStakeProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.LiquidStake"; + value: Uint8Array; +} +export interface LiquidStakeAmino { + feature_type?: FeatureType; + /** needs to be uploaded before hand */ + code_i_d?: string; + /** + * state of instantiation, do not support gov based instantiation. (need ICA + * to be at least admin) + */ + instantiation?: InstantiationState; + /** address of instantiated contract. */ + contract_address?: string; + /** + * allow * as default for all denoms in case of lsibc, or default bond denom + * in case of ls. + */ + denoms?: string[]; + enabled?: boolean; +} +export interface LiquidStakeAminoMsg { + type: "/pstake.ratesync.v1beta1.LiquidStake"; + value: LiquidStakeAmino; +} +export interface LiquidStakeSDKType { + feature_type: FeatureType; + code_i_d: bigint; + instantiation: InstantiationState; + contract_address: string; + denoms: string[]; + enabled: boolean; +} +/** aim to keep this smaller than 256 MaxCharLen in ICA memo. */ +export interface ICAMemo { + featureType: FeatureType; + hostChainID: bigint; +} +export interface ICAMemoProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.ICAMemo"; + value: Uint8Array; +} +/** aim to keep this smaller than 256 MaxCharLen in ICA memo. */ +export interface ICAMemoAmino { + feature_type?: FeatureType; + host_chain_i_d?: string; +} +export interface ICAMemoAminoMsg { + type: "/pstake.ratesync.v1beta1.ICAMemo"; + value: ICAMemoAmino; +} +/** aim to keep this smaller than 256 MaxCharLen in ICA memo. */ +export interface ICAMemoSDKType { + feature_type: FeatureType; + host_chain_i_d: bigint; +} +function createBaseHostChain(): HostChain { + return { + iD: BigInt(0), + chainID: "", + connectionID: "", + iCAAccount: ICAAccount.fromPartial({}), + features: Feature.fromPartial({}), + transferChannelID: "", + transferPortID: "" + }; +} +export const HostChain = { + typeUrl: "/pstake.ratesync.v1beta1.HostChain", + encode(message: HostChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.iD !== BigInt(0)) { + writer.uint32(8).uint64(message.iD); + } + if (message.chainID !== "") { + writer.uint32(18).string(message.chainID); + } + if (message.connectionID !== "") { + writer.uint32(26).string(message.connectionID); + } + if (message.iCAAccount !== undefined) { + ICAAccount.encode(message.iCAAccount, writer.uint32(34).fork()).ldelim(); + } + if (message.features !== undefined) { + Feature.encode(message.features, writer.uint32(42).fork()).ldelim(); + } + if (message.transferChannelID !== "") { + writer.uint32(50).string(message.transferChannelID); + } + if (message.transferPortID !== "") { + writer.uint32(58).string(message.transferPortID); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): HostChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHostChain(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.iD = reader.uint64(); + break; + case 2: + message.chainID = reader.string(); + break; + case 3: + message.connectionID = reader.string(); + break; + case 4: + message.iCAAccount = ICAAccount.decode(reader, reader.uint32(), useInterfaces); + break; + case 5: + message.features = Feature.decode(reader, reader.uint32(), useInterfaces); + break; + case 6: + message.transferChannelID = reader.string(); + break; + case 7: + message.transferPortID = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): HostChain { + const message = createBaseHostChain(); + message.iD = object.iD !== undefined && object.iD !== null ? BigInt(object.iD.toString()) : BigInt(0); + message.chainID = object.chainID ?? ""; + message.connectionID = object.connectionID ?? ""; + message.iCAAccount = object.iCAAccount !== undefined && object.iCAAccount !== null ? ICAAccount.fromPartial(object.iCAAccount) : undefined; + message.features = object.features !== undefined && object.features !== null ? Feature.fromPartial(object.features) : undefined; + message.transferChannelID = object.transferChannelID ?? ""; + message.transferPortID = object.transferPortID ?? ""; + return message; + }, + fromAmino(object: HostChainAmino): HostChain { + const message = createBaseHostChain(); + if (object.i_d !== undefined && object.i_d !== null) { + message.iD = BigInt(object.i_d); + } + if (object.chain_i_d !== undefined && object.chain_i_d !== null) { + message.chainID = object.chain_i_d; + } + if (object.connection_i_d !== undefined && object.connection_i_d !== null) { + message.connectionID = object.connection_i_d; + } + if (object.i_c_a_account !== undefined && object.i_c_a_account !== null) { + message.iCAAccount = ICAAccount.fromAmino(object.i_c_a_account); + } + if (object.features !== undefined && object.features !== null) { + message.features = Feature.fromAmino(object.features); + } + if (object.transfer_channel_i_d !== undefined && object.transfer_channel_i_d !== null) { + message.transferChannelID = object.transfer_channel_i_d; + } + if (object.transfer_port_i_d !== undefined && object.transfer_port_i_d !== null) { + message.transferPortID = object.transfer_port_i_d; + } + return message; + }, + toAmino(message: HostChain, useInterfaces: boolean = false): HostChainAmino { + const obj: any = {}; + obj.i_d = message.iD ? message.iD.toString() : undefined; + obj.chain_i_d = message.chainID; + obj.connection_i_d = message.connectionID; + obj.i_c_a_account = message.iCAAccount ? ICAAccount.toAmino(message.iCAAccount, useInterfaces) : ICAAccount.fromPartial({}); + obj.features = message.features ? Feature.toAmino(message.features, useInterfaces) : Feature.fromPartial({}); + obj.transfer_channel_i_d = message.transferChannelID; + obj.transfer_port_i_d = message.transferPortID; + return obj; + }, + fromAminoMsg(object: HostChainAminoMsg): HostChain { + return HostChain.fromAmino(object.value); + }, + fromProtoMsg(message: HostChainProtoMsg, useInterfaces: boolean = false): HostChain { + return HostChain.decode(message.value, undefined, useInterfaces); + }, + toProto(message: HostChain): Uint8Array { + return HostChain.encode(message).finish(); + }, + toProtoMsg(message: HostChain): HostChainProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.HostChain", + value: HostChain.encode(message).finish() + }; + } +}; +function createBaseFeature(): Feature { + return { + liquidStakeIBC: LiquidStake.fromPartial({}), + liquidStake: LiquidStake.fromPartial({}) + }; +} +export const Feature = { + typeUrl: "/pstake.ratesync.v1beta1.Feature", + encode(message: Feature, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.liquidStakeIBC !== undefined) { + LiquidStake.encode(message.liquidStakeIBC, writer.uint32(10).fork()).ldelim(); + } + if (message.liquidStake !== undefined) { + LiquidStake.encode(message.liquidStake, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Feature { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeature(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.liquidStakeIBC = LiquidStake.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.liquidStake = LiquidStake.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Feature { + const message = createBaseFeature(); + message.liquidStakeIBC = object.liquidStakeIBC !== undefined && object.liquidStakeIBC !== null ? LiquidStake.fromPartial(object.liquidStakeIBC) : undefined; + message.liquidStake = object.liquidStake !== undefined && object.liquidStake !== null ? LiquidStake.fromPartial(object.liquidStake) : undefined; + return message; + }, + fromAmino(object: FeatureAmino): Feature { + const message = createBaseFeature(); + if (object.liquid_stake_i_b_c !== undefined && object.liquid_stake_i_b_c !== null) { + message.liquidStakeIBC = LiquidStake.fromAmino(object.liquid_stake_i_b_c); + } + if (object.liquid_stake !== undefined && object.liquid_stake !== null) { + message.liquidStake = LiquidStake.fromAmino(object.liquid_stake); + } + return message; + }, + toAmino(message: Feature, useInterfaces: boolean = false): FeatureAmino { + const obj: any = {}; + obj.liquid_stake_i_b_c = message.liquidStakeIBC ? LiquidStake.toAmino(message.liquidStakeIBC, useInterfaces) : LiquidStake.fromPartial({}); + obj.liquid_stake = message.liquidStake ? LiquidStake.toAmino(message.liquidStake, useInterfaces) : LiquidStake.fromPartial({}); + return obj; + }, + fromAminoMsg(object: FeatureAminoMsg): Feature { + return Feature.fromAmino(object.value); + }, + fromProtoMsg(message: FeatureProtoMsg, useInterfaces: boolean = false): Feature { + return Feature.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Feature): Uint8Array { + return Feature.encode(message).finish(); + }, + toProtoMsg(message: Feature): FeatureProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.Feature", + value: Feature.encode(message).finish() + }; + } +}; +function createBaseLiquidStake(): LiquidStake { + return { + featureType: 0, + codeID: BigInt(0), + instantiation: 0, + contractAddress: "", + denoms: [], + enabled: false + }; +} +export const LiquidStake = { + typeUrl: "/pstake.ratesync.v1beta1.LiquidStake", + encode(message: LiquidStake, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.featureType !== 0) { + writer.uint32(8).int32(message.featureType); + } + if (message.codeID !== BigInt(0)) { + writer.uint32(16).uint64(message.codeID); + } + if (message.instantiation !== 0) { + writer.uint32(24).int32(message.instantiation); + } + if (message.contractAddress !== "") { + writer.uint32(34).string(message.contractAddress); + } + for (const v of message.denoms) { + writer.uint32(42).string(v!); + } + if (message.enabled === true) { + writer.uint32(48).bool(message.enabled); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): LiquidStake { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLiquidStake(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.featureType = (reader.int32() as any); + break; + case 2: + message.codeID = reader.uint64(); + break; + case 3: + message.instantiation = (reader.int32() as any); + break; + case 4: + message.contractAddress = reader.string(); + break; + case 5: + message.denoms.push(reader.string()); + break; + case 6: + message.enabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LiquidStake { + const message = createBaseLiquidStake(); + message.featureType = object.featureType ?? 0; + message.codeID = object.codeID !== undefined && object.codeID !== null ? BigInt(object.codeID.toString()) : BigInt(0); + message.instantiation = object.instantiation ?? 0; + message.contractAddress = object.contractAddress ?? ""; + message.denoms = object.denoms?.map(e => e) || []; + message.enabled = object.enabled ?? false; + return message; + }, + fromAmino(object: LiquidStakeAmino): LiquidStake { + const message = createBaseLiquidStake(); + if (object.feature_type !== undefined && object.feature_type !== null) { + message.featureType = featureTypeFromJSON(object.feature_type); + } + if (object.code_i_d !== undefined && object.code_i_d !== null) { + message.codeID = BigInt(object.code_i_d); + } + if (object.instantiation !== undefined && object.instantiation !== null) { + message.instantiation = instantiationStateFromJSON(object.instantiation); + } + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + message.denoms = object.denoms?.map(e => e) || []; + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + return message; + }, + toAmino(message: LiquidStake, useInterfaces: boolean = false): LiquidStakeAmino { + const obj: any = {}; + obj.feature_type = message.featureType; + obj.code_i_d = message.codeID ? message.codeID.toString() : undefined; + obj.instantiation = message.instantiation; + obj.contract_address = message.contractAddress; + if (message.denoms) { + obj.denoms = message.denoms.map(e => e); + } else { + obj.denoms = []; + } + obj.enabled = message.enabled; + return obj; + }, + fromAminoMsg(object: LiquidStakeAminoMsg): LiquidStake { + return LiquidStake.fromAmino(object.value); + }, + fromProtoMsg(message: LiquidStakeProtoMsg, useInterfaces: boolean = false): LiquidStake { + return LiquidStake.decode(message.value, undefined, useInterfaces); + }, + toProto(message: LiquidStake): Uint8Array { + return LiquidStake.encode(message).finish(); + }, + toProtoMsg(message: LiquidStake): LiquidStakeProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.LiquidStake", + value: LiquidStake.encode(message).finish() + }; + } +}; +function createBaseICAMemo(): ICAMemo { + return { + featureType: 0, + hostChainID: BigInt(0) + }; +} +export const ICAMemo = { + typeUrl: "/pstake.ratesync.v1beta1.ICAMemo", + encode(message: ICAMemo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.featureType !== 0) { + writer.uint32(8).int32(message.featureType); + } + if (message.hostChainID !== BigInt(0)) { + writer.uint32(16).uint64(message.hostChainID); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ICAMemo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseICAMemo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.featureType = (reader.int32() as any); + break; + case 2: + message.hostChainID = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ICAMemo { + const message = createBaseICAMemo(); + message.featureType = object.featureType ?? 0; + message.hostChainID = object.hostChainID !== undefined && object.hostChainID !== null ? BigInt(object.hostChainID.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ICAMemoAmino): ICAMemo { + const message = createBaseICAMemo(); + if (object.feature_type !== undefined && object.feature_type !== null) { + message.featureType = featureTypeFromJSON(object.feature_type); + } + if (object.host_chain_i_d !== undefined && object.host_chain_i_d !== null) { + message.hostChainID = BigInt(object.host_chain_i_d); + } + return message; + }, + toAmino(message: ICAMemo, useInterfaces: boolean = false): ICAMemoAmino { + const obj: any = {}; + obj.feature_type = message.featureType; + obj.host_chain_i_d = message.hostChainID ? message.hostChainID.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ICAMemoAminoMsg): ICAMemo { + return ICAMemo.fromAmino(object.value); + }, + fromProtoMsg(message: ICAMemoProtoMsg, useInterfaces: boolean = false): ICAMemo { + return ICAMemo.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ICAMemo): Uint8Array { + return ICAMemo.encode(message).finish(); + }, + toProtoMsg(message: ICAMemo): ICAMemoProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.ICAMemo", + value: ICAMemo.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/tx.amino.ts new file mode 100644 index 000000000..3bd554730 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/tx.amino.ts @@ -0,0 +1,23 @@ +import { MsgCreateHostChain, MsgUpdateHostChain, MsgDeleteHostChain, MsgUpdateParams } from "./tx"; +export const AminoConverter = { + "/pstake.ratesync.v1beta1.MsgCreateHostChain": { + aminoType: "pstake/ratesync/MsgCreateHostChain", + toAmino: MsgCreateHostChain.toAmino, + fromAmino: MsgCreateHostChain.fromAmino + }, + "/pstake.ratesync.v1beta1.MsgUpdateHostChain": { + aminoType: "pstake/ratesync/MsgUpdateHostChain", + toAmino: MsgUpdateHostChain.toAmino, + fromAmino: MsgUpdateHostChain.fromAmino + }, + "/pstake.ratesync.v1beta1.MsgDeleteHostChain": { + aminoType: "pstake/ratesync/MsgDeleteHostChain", + toAmino: MsgDeleteHostChain.toAmino, + fromAmino: MsgDeleteHostChain.fromAmino + }, + "/pstake.ratesync.v1beta1.MsgUpdateParams": { + aminoType: "pstake/ratesync/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/tx.registry.ts new file mode 100644 index 000000000..88c134c6b --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/tx.registry.ts @@ -0,0 +1,89 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgCreateHostChain, MsgUpdateHostChain, MsgDeleteHostChain, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/pstake.ratesync.v1beta1.MsgCreateHostChain", MsgCreateHostChain], ["/pstake.ratesync.v1beta1.MsgUpdateHostChain", MsgUpdateHostChain], ["/pstake.ratesync.v1beta1.MsgDeleteHostChain", MsgDeleteHostChain], ["/pstake.ratesync.v1beta1.MsgUpdateParams", MsgUpdateParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createHostChain(value: MsgCreateHostChain) { + return { + typeUrl: "/pstake.ratesync.v1beta1.MsgCreateHostChain", + value: MsgCreateHostChain.encode(value).finish() + }; + }, + updateHostChain(value: MsgUpdateHostChain) { + return { + typeUrl: "/pstake.ratesync.v1beta1.MsgUpdateHostChain", + value: MsgUpdateHostChain.encode(value).finish() + }; + }, + deleteHostChain(value: MsgDeleteHostChain) { + return { + typeUrl: "/pstake.ratesync.v1beta1.MsgDeleteHostChain", + value: MsgDeleteHostChain.encode(value).finish() + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/pstake.ratesync.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + createHostChain(value: MsgCreateHostChain) { + return { + typeUrl: "/pstake.ratesync.v1beta1.MsgCreateHostChain", + value + }; + }, + updateHostChain(value: MsgUpdateHostChain) { + return { + typeUrl: "/pstake.ratesync.v1beta1.MsgUpdateHostChain", + value + }; + }, + deleteHostChain(value: MsgDeleteHostChain) { + return { + typeUrl: "/pstake.ratesync.v1beta1.MsgDeleteHostChain", + value + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/pstake.ratesync.v1beta1.MsgUpdateParams", + value + }; + } + }, + fromPartial: { + createHostChain(value: MsgCreateHostChain) { + return { + typeUrl: "/pstake.ratesync.v1beta1.MsgCreateHostChain", + value: MsgCreateHostChain.fromPartial(value) + }; + }, + updateHostChain(value: MsgUpdateHostChain) { + return { + typeUrl: "/pstake.ratesync.v1beta1.MsgUpdateHostChain", + value: MsgUpdateHostChain.fromPartial(value) + }; + }, + deleteHostChain(value: MsgDeleteHostChain) { + return { + typeUrl: "/pstake.ratesync.v1beta1.MsgDeleteHostChain", + value: MsgDeleteHostChain.fromPartial(value) + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/pstake.ratesync.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/tx.rpc.msg.ts new file mode 100644 index 000000000..333f5936f --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,40 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgCreateHostChain, MsgCreateHostChainResponse, MsgUpdateHostChain, MsgUpdateHostChainResponse, MsgDeleteHostChain, MsgDeleteHostChainResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + createHostChain(request: MsgCreateHostChain): Promise; + updateHostChain(request: MsgUpdateHostChain): Promise; + deleteHostChain(request: MsgDeleteHostChain): Promise; + updateParams(request: MsgUpdateParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.createHostChain = this.createHostChain.bind(this); + this.updateHostChain = this.updateHostChain.bind(this); + this.deleteHostChain = this.deleteHostChain.bind(this); + this.updateParams = this.updateParams.bind(this); + } + createHostChain(request: MsgCreateHostChain, useInterfaces: boolean = true): Promise { + const data = MsgCreateHostChain.encode(request).finish(); + const promise = this.rpc.request("pstake.ratesync.v1beta1.Msg", "CreateHostChain", data); + return promise.then(data => MsgCreateHostChainResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + updateHostChain(request: MsgUpdateHostChain, useInterfaces: boolean = true): Promise { + const data = MsgUpdateHostChain.encode(request).finish(); + const promise = this.rpc.request("pstake.ratesync.v1beta1.Msg", "UpdateHostChain", data); + return promise.then(data => MsgUpdateHostChainResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + deleteHostChain(request: MsgDeleteHostChain, useInterfaces: boolean = true): Promise { + const data = MsgDeleteHostChain.encode(request).finish(); + const promise = this.rpc.request("pstake.ratesync.v1beta1.Msg", "DeleteHostChain", data); + return promise.then(data => MsgDeleteHostChainResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + updateParams(request: MsgUpdateParams, useInterfaces: boolean = true): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("pstake.ratesync.v1beta1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/tx.ts b/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/tx.ts new file mode 100644 index 000000000..17680ff7c --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/ratesync/v1beta1/tx.ts @@ -0,0 +1,671 @@ +//@ts-nocheck +import { HostChain, HostChainAmino, HostChainSDKType } from "./ratesync"; +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +export interface MsgCreateHostChain { + authority: string; + hostChain: HostChain | undefined; +} +export interface MsgCreateHostChainProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.MsgCreateHostChain"; + value: Uint8Array; +} +export interface MsgCreateHostChainAmino { + authority?: string; + host_chain: HostChainAmino | undefined; +} +export interface MsgCreateHostChainAminoMsg { + type: "pstake/ratesync/MsgCreateHostChain"; + value: MsgCreateHostChainAmino; +} +export interface MsgCreateHostChainSDKType { + authority: string; + host_chain: HostChainSDKType | undefined; +} +export interface MsgCreateHostChainResponse { + iD: bigint; +} +export interface MsgCreateHostChainResponseProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.MsgCreateHostChainResponse"; + value: Uint8Array; +} +export interface MsgCreateHostChainResponseAmino { + i_d?: string; +} +export interface MsgCreateHostChainResponseAminoMsg { + type: "/pstake.ratesync.v1beta1.MsgCreateHostChainResponse"; + value: MsgCreateHostChainResponseAmino; +} +export interface MsgCreateHostChainResponseSDKType { + i_d: bigint; +} +export interface MsgUpdateHostChain { + authority: string; + hostChain: HostChain | undefined; +} +export interface MsgUpdateHostChainProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.MsgUpdateHostChain"; + value: Uint8Array; +} +export interface MsgUpdateHostChainAmino { + authority?: string; + host_chain: HostChainAmino | undefined; +} +export interface MsgUpdateHostChainAminoMsg { + type: "pstake/ratesync/MsgUpdateHostChain"; + value: MsgUpdateHostChainAmino; +} +export interface MsgUpdateHostChainSDKType { + authority: string; + host_chain: HostChainSDKType | undefined; +} +export interface MsgUpdateHostChainResponse {} +export interface MsgUpdateHostChainResponseProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.MsgUpdateHostChainResponse"; + value: Uint8Array; +} +export interface MsgUpdateHostChainResponseAmino {} +export interface MsgUpdateHostChainResponseAminoMsg { + type: "/pstake.ratesync.v1beta1.MsgUpdateHostChainResponse"; + value: MsgUpdateHostChainResponseAmino; +} +export interface MsgUpdateHostChainResponseSDKType {} +export interface MsgDeleteHostChain { + authority: string; + iD: bigint; +} +export interface MsgDeleteHostChainProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.MsgDeleteHostChain"; + value: Uint8Array; +} +export interface MsgDeleteHostChainAmino { + authority?: string; + i_d?: string; +} +export interface MsgDeleteHostChainAminoMsg { + type: "pstake/ratesync/MsgDeleteHostChain"; + value: MsgDeleteHostChainAmino; +} +export interface MsgDeleteHostChainSDKType { + authority: string; + i_d: bigint; +} +export interface MsgDeleteHostChainResponse {} +export interface MsgDeleteHostChainResponseProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.MsgDeleteHostChainResponse"; + value: Uint8Array; +} +export interface MsgDeleteHostChainResponseAmino {} +export interface MsgDeleteHostChainResponseAminoMsg { + type: "/pstake.ratesync.v1beta1.MsgDeleteHostChainResponse"; + value: MsgDeleteHostChainResponseAmino; +} +export interface MsgDeleteHostChainResponseSDKType {} +export interface MsgUpdateParams { + authority: string; + params: Params | undefined; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +export interface MsgUpdateParamsAmino { + authority?: string; + params: ParamsAmino | undefined; +} +export interface MsgUpdateParamsAminoMsg { + type: "pstake/ratesync/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType | undefined; +} +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/pstake.ratesync.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/pstake.ratesync.v1beta1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +export interface MsgUpdateParamsResponseSDKType {} +function createBaseMsgCreateHostChain(): MsgCreateHostChain { + return { + authority: "", + hostChain: HostChain.fromPartial({}) + }; +} +export const MsgCreateHostChain = { + typeUrl: "/pstake.ratesync.v1beta1.MsgCreateHostChain", + encode(message: MsgCreateHostChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.hostChain !== undefined) { + HostChain.encode(message.hostChain, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgCreateHostChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateHostChain(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.hostChain = HostChain.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateHostChain { + const message = createBaseMsgCreateHostChain(); + message.authority = object.authority ?? ""; + message.hostChain = object.hostChain !== undefined && object.hostChain !== null ? HostChain.fromPartial(object.hostChain) : undefined; + return message; + }, + fromAmino(object: MsgCreateHostChainAmino): MsgCreateHostChain { + const message = createBaseMsgCreateHostChain(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.host_chain !== undefined && object.host_chain !== null) { + message.hostChain = HostChain.fromAmino(object.host_chain); + } + return message; + }, + toAmino(message: MsgCreateHostChain, useInterfaces: boolean = false): MsgCreateHostChainAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.host_chain = message.hostChain ? HostChain.toAmino(message.hostChain, useInterfaces) : HostChain.fromPartial({}); + return obj; + }, + fromAminoMsg(object: MsgCreateHostChainAminoMsg): MsgCreateHostChain { + return MsgCreateHostChain.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateHostChain, useInterfaces: boolean = false): MsgCreateHostChainAminoMsg { + return { + type: "pstake/ratesync/MsgCreateHostChain", + value: MsgCreateHostChain.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgCreateHostChainProtoMsg, useInterfaces: boolean = false): MsgCreateHostChain { + return MsgCreateHostChain.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgCreateHostChain): Uint8Array { + return MsgCreateHostChain.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateHostChain): MsgCreateHostChainProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.MsgCreateHostChain", + value: MsgCreateHostChain.encode(message).finish() + }; + } +}; +function createBaseMsgCreateHostChainResponse(): MsgCreateHostChainResponse { + return { + iD: BigInt(0) + }; +} +export const MsgCreateHostChainResponse = { + typeUrl: "/pstake.ratesync.v1beta1.MsgCreateHostChainResponse", + encode(message: MsgCreateHostChainResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.iD !== BigInt(0)) { + writer.uint32(8).uint64(message.iD); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgCreateHostChainResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateHostChainResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.iD = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateHostChainResponse { + const message = createBaseMsgCreateHostChainResponse(); + message.iD = object.iD !== undefined && object.iD !== null ? BigInt(object.iD.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgCreateHostChainResponseAmino): MsgCreateHostChainResponse { + const message = createBaseMsgCreateHostChainResponse(); + if (object.i_d !== undefined && object.i_d !== null) { + message.iD = BigInt(object.i_d); + } + return message; + }, + toAmino(message: MsgCreateHostChainResponse, useInterfaces: boolean = false): MsgCreateHostChainResponseAmino { + const obj: any = {}; + obj.i_d = message.iD ? message.iD.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateHostChainResponseAminoMsg): MsgCreateHostChainResponse { + return MsgCreateHostChainResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateHostChainResponseProtoMsg, useInterfaces: boolean = false): MsgCreateHostChainResponse { + return MsgCreateHostChainResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgCreateHostChainResponse): Uint8Array { + return MsgCreateHostChainResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateHostChainResponse): MsgCreateHostChainResponseProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.MsgCreateHostChainResponse", + value: MsgCreateHostChainResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateHostChain(): MsgUpdateHostChain { + return { + authority: "", + hostChain: HostChain.fromPartial({}) + }; +} +export const MsgUpdateHostChain = { + typeUrl: "/pstake.ratesync.v1beta1.MsgUpdateHostChain", + encode(message: MsgUpdateHostChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.hostChain !== undefined) { + HostChain.encode(message.hostChain, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateHostChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateHostChain(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.hostChain = HostChain.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateHostChain { + const message = createBaseMsgUpdateHostChain(); + message.authority = object.authority ?? ""; + message.hostChain = object.hostChain !== undefined && object.hostChain !== null ? HostChain.fromPartial(object.hostChain) : undefined; + return message; + }, + fromAmino(object: MsgUpdateHostChainAmino): MsgUpdateHostChain { + const message = createBaseMsgUpdateHostChain(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.host_chain !== undefined && object.host_chain !== null) { + message.hostChain = HostChain.fromAmino(object.host_chain); + } + return message; + }, + toAmino(message: MsgUpdateHostChain, useInterfaces: boolean = false): MsgUpdateHostChainAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.host_chain = message.hostChain ? HostChain.toAmino(message.hostChain, useInterfaces) : HostChain.fromPartial({}); + return obj; + }, + fromAminoMsg(object: MsgUpdateHostChainAminoMsg): MsgUpdateHostChain { + return MsgUpdateHostChain.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateHostChain, useInterfaces: boolean = false): MsgUpdateHostChainAminoMsg { + return { + type: "pstake/ratesync/MsgUpdateHostChain", + value: MsgUpdateHostChain.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgUpdateHostChainProtoMsg, useInterfaces: boolean = false): MsgUpdateHostChain { + return MsgUpdateHostChain.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateHostChain): Uint8Array { + return MsgUpdateHostChain.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateHostChain): MsgUpdateHostChainProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.MsgUpdateHostChain", + value: MsgUpdateHostChain.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateHostChainResponse(): MsgUpdateHostChainResponse { + return {}; +} +export const MsgUpdateHostChainResponse = { + typeUrl: "/pstake.ratesync.v1beta1.MsgUpdateHostChainResponse", + encode(_: MsgUpdateHostChainResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateHostChainResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateHostChainResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateHostChainResponse { + const message = createBaseMsgUpdateHostChainResponse(); + return message; + }, + fromAmino(_: MsgUpdateHostChainResponseAmino): MsgUpdateHostChainResponse { + const message = createBaseMsgUpdateHostChainResponse(); + return message; + }, + toAmino(_: MsgUpdateHostChainResponse, useInterfaces: boolean = false): MsgUpdateHostChainResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateHostChainResponseAminoMsg): MsgUpdateHostChainResponse { + return MsgUpdateHostChainResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateHostChainResponseProtoMsg, useInterfaces: boolean = false): MsgUpdateHostChainResponse { + return MsgUpdateHostChainResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateHostChainResponse): Uint8Array { + return MsgUpdateHostChainResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateHostChainResponse): MsgUpdateHostChainResponseProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.MsgUpdateHostChainResponse", + value: MsgUpdateHostChainResponse.encode(message).finish() + }; + } +}; +function createBaseMsgDeleteHostChain(): MsgDeleteHostChain { + return { + authority: "", + iD: BigInt(0) + }; +} +export const MsgDeleteHostChain = { + typeUrl: "/pstake.ratesync.v1beta1.MsgDeleteHostChain", + encode(message: MsgDeleteHostChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.iD !== BigInt(0)) { + writer.uint32(16).uint64(message.iD); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgDeleteHostChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteHostChain(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.iD = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgDeleteHostChain { + const message = createBaseMsgDeleteHostChain(); + message.authority = object.authority ?? ""; + message.iD = object.iD !== undefined && object.iD !== null ? BigInt(object.iD.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgDeleteHostChainAmino): MsgDeleteHostChain { + const message = createBaseMsgDeleteHostChain(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.i_d !== undefined && object.i_d !== null) { + message.iD = BigInt(object.i_d); + } + return message; + }, + toAmino(message: MsgDeleteHostChain, useInterfaces: boolean = false): MsgDeleteHostChainAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.i_d = message.iD ? message.iD.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgDeleteHostChainAminoMsg): MsgDeleteHostChain { + return MsgDeleteHostChain.fromAmino(object.value); + }, + toAminoMsg(message: MsgDeleteHostChain, useInterfaces: boolean = false): MsgDeleteHostChainAminoMsg { + return { + type: "pstake/ratesync/MsgDeleteHostChain", + value: MsgDeleteHostChain.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgDeleteHostChainProtoMsg, useInterfaces: boolean = false): MsgDeleteHostChain { + return MsgDeleteHostChain.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgDeleteHostChain): Uint8Array { + return MsgDeleteHostChain.encode(message).finish(); + }, + toProtoMsg(message: MsgDeleteHostChain): MsgDeleteHostChainProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.MsgDeleteHostChain", + value: MsgDeleteHostChain.encode(message).finish() + }; + } +}; +function createBaseMsgDeleteHostChainResponse(): MsgDeleteHostChainResponse { + return {}; +} +export const MsgDeleteHostChainResponse = { + typeUrl: "/pstake.ratesync.v1beta1.MsgDeleteHostChainResponse", + encode(_: MsgDeleteHostChainResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgDeleteHostChainResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteHostChainResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgDeleteHostChainResponse { + const message = createBaseMsgDeleteHostChainResponse(); + return message; + }, + fromAmino(_: MsgDeleteHostChainResponseAmino): MsgDeleteHostChainResponse { + const message = createBaseMsgDeleteHostChainResponse(); + return message; + }, + toAmino(_: MsgDeleteHostChainResponse, useInterfaces: boolean = false): MsgDeleteHostChainResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgDeleteHostChainResponseAminoMsg): MsgDeleteHostChainResponse { + return MsgDeleteHostChainResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgDeleteHostChainResponseProtoMsg, useInterfaces: boolean = false): MsgDeleteHostChainResponse { + return MsgDeleteHostChainResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgDeleteHostChainResponse): Uint8Array { + return MsgDeleteHostChainResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDeleteHostChainResponse): MsgDeleteHostChainResponseProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.MsgDeleteHostChainResponse", + value: MsgDeleteHostChainResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/pstake.ratesync.v1beta1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams, useInterfaces: boolean = false): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : Params.fromPartial({}); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams, useInterfaces: boolean = false): MsgUpdateParamsAminoMsg { + return { + type: "pstake/ratesync/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg, useInterfaces: boolean = false): MsgUpdateParams { + return MsgUpdateParams.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/pstake.ratesync.v1beta1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse, useInterfaces: boolean = false): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg, useInterfaces: boolean = false): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/pstake.ratesync.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/rpc.query.ts b/packages/types/protobuf/codegen/pstake/rpc.query.ts new file mode 100644 index 000000000..059eb0f34 --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/rpc.query.ts @@ -0,0 +1,70 @@ +import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import { QueryClient } from "@cosmjs/stargate"; +export const createRPCQueryClient = async ({ + rpcEndpoint +}: { + rpcEndpoint: string | HttpEndpoint; +}) => { + const tmClient = await Tendermint34Client.connect(rpcEndpoint); + const client = new QueryClient(tmClient); + return { + cosmos: { + auth: { + v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + authz: { + v1beta1: (await import("../cosmos/authz/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + bank: { + v1beta1: (await import("../cosmos/bank/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + base: { + tendermint: { + v1beta1: (await import("../cosmos/base/tendermint/v1beta1/query.rpc.Service")).createRpcQueryExtension(client) + } + }, + distribution: { + v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + gov: { + v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), + v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + mint: { + v1beta1: (await import("../cosmos/mint/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + params: { + v1beta1: (await import("../cosmos/params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + slashing: { + v1beta1: (await import("../cosmos/slashing/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + staking: { + v1beta1: (await import("../cosmos/staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + tx: { + v1beta1: (await import("../cosmos/tx/v1beta1/service.rpc.Service")).createRpcQueryExtension(client) + }, + upgrade: { + v1beta1: (await import("../cosmos/upgrade/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, + pstake: { + liquidstake: { + v1beta1: (await import("./liquidstake/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + liquidstakeibc: { + v1beta1: (await import("./liquidstakeibc/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + lscosmos: { + v1beta1: (await import("./lscosmos/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + ratesync: { + v1beta1: (await import("./ratesync/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + } + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/rpc.tx.ts b/packages/types/protobuf/codegen/pstake/rpc.tx.ts new file mode 100644 index 000000000..73c4b893e --- /dev/null +++ b/packages/types/protobuf/codegen/pstake/rpc.tx.ts @@ -0,0 +1,54 @@ +import { Rpc } from "../helpers"; +export const createRPCMsgClient = async ({ + rpc +}: { + rpc: Rpc; +}) => ({ + cosmos: { + auth: { + v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + authz: { + v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + bank: { + v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + distribution: { + v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + gov: { + v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), + v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + mint: { + v1beta1: new (await import("../cosmos/mint/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + slashing: { + v1beta1: new (await import("../cosmos/slashing/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + staking: { + v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + upgrade: { + v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + } + }, + pstake: { + liquidstake: { + v1beta1: new (await import("./liquidstake/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + liquidstakeibc: { + v1beta1: new (await import("./liquidstakeibc/v1beta1/msgs.rpc.msg")).MsgClientImpl(rpc) + }, + lscosmos: { + v1beta1: new (await import("./lscosmos/v1beta1/msgs.rpc.msg")).MsgClientImpl(rpc) + }, + ratesync: { + v1beta1: new (await import("./ratesync/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + } + } +}); \ No newline at end of file diff --git a/packages/types/protobuf/codegen/publicawesome/bundle.ts b/packages/types/protobuf/codegen/publicawesome/bundle.ts index aa9b74d72..a15715f07 100644 --- a/packages/types/protobuf/codegen/publicawesome/bundle.ts +++ b/packages/types/protobuf/codegen/publicawesome/bundle.ts @@ -1,88 +1,88 @@ -import * as _266 from "./stargaze/alloc/v1beta1/genesis"; -import * as _267 from "./stargaze/alloc/v1beta1/params"; -import * as _268 from "./stargaze/alloc/v1beta1/query"; -import * as _269 from "./stargaze/alloc/v1beta1/tx"; -import * as _270 from "./stargaze/cron/v1/cron"; -import * as _271 from "./stargaze/cron/v1/genesis"; -import * as _272 from "./stargaze/cron/v1/proposal"; -import * as _273 from "./stargaze/cron/v1/query"; -import * as _274 from "./stargaze/cron/v1/tx"; -import * as _275 from "./stargaze/globalfee/v1/genesis"; -import * as _276 from "./stargaze/globalfee/v1/globalfee"; -import * as _277 from "./stargaze/globalfee/v1/proposal"; -import * as _278 from "./stargaze/globalfee/v1/query"; -import * as _279 from "./stargaze/globalfee/v1/tx"; -import * as _280 from "./stargaze/mint/v1beta1/genesis"; -import * as _281 from "./stargaze/mint/v1beta1/mint"; -import * as _282 from "./stargaze/mint/v1beta1/query"; -import * as _283 from "./stargaze/mint/v1beta1/tx"; -import * as _503 from "./stargaze/alloc/v1beta1/tx.amino"; -import * as _504 from "./stargaze/cron/v1/tx.amino"; -import * as _505 from "./stargaze/globalfee/v1/tx.amino"; -import * as _506 from "./stargaze/alloc/v1beta1/tx.registry"; -import * as _507 from "./stargaze/cron/v1/tx.registry"; -import * as _508 from "./stargaze/globalfee/v1/tx.registry"; -import * as _509 from "./stargaze/alloc/v1beta1/query.rpc.Query"; -import * as _510 from "./stargaze/cron/v1/query.rpc.Query"; -import * as _511 from "./stargaze/globalfee/v1/query.rpc.Query"; -import * as _512 from "./stargaze/mint/v1beta1/query.rpc.Query"; -import * as _513 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; -import * as _514 from "./stargaze/cron/v1/tx.rpc.msg"; -import * as _515 from "./stargaze/globalfee/v1/tx.rpc.msg"; -import * as _559 from "./rpc.query"; -import * as _560 from "./rpc.tx"; +import * as _287 from "./stargaze/alloc/v1beta1/genesis"; +import * as _288 from "./stargaze/alloc/v1beta1/params"; +import * as _289 from "./stargaze/alloc/v1beta1/query"; +import * as _290 from "./stargaze/alloc/v1beta1/tx"; +import * as _291 from "./stargaze/cron/v1/cron"; +import * as _292 from "./stargaze/cron/v1/genesis"; +import * as _293 from "./stargaze/cron/v1/proposal"; +import * as _294 from "./stargaze/cron/v1/query"; +import * as _295 from "./stargaze/cron/v1/tx"; +import * as _296 from "./stargaze/globalfee/v1/genesis"; +import * as _297 from "./stargaze/globalfee/v1/globalfee"; +import * as _298 from "./stargaze/globalfee/v1/proposal"; +import * as _299 from "./stargaze/globalfee/v1/query"; +import * as _300 from "./stargaze/globalfee/v1/tx"; +import * as _301 from "./stargaze/mint/v1beta1/genesis"; +import * as _302 from "./stargaze/mint/v1beta1/mint"; +import * as _303 from "./stargaze/mint/v1beta1/query"; +import * as _304 from "./stargaze/mint/v1beta1/tx"; +import * as _540 from "./stargaze/alloc/v1beta1/tx.amino"; +import * as _541 from "./stargaze/cron/v1/tx.amino"; +import * as _542 from "./stargaze/globalfee/v1/tx.amino"; +import * as _543 from "./stargaze/alloc/v1beta1/tx.registry"; +import * as _544 from "./stargaze/cron/v1/tx.registry"; +import * as _545 from "./stargaze/globalfee/v1/tx.registry"; +import * as _546 from "./stargaze/alloc/v1beta1/query.rpc.Query"; +import * as _547 from "./stargaze/cron/v1/query.rpc.Query"; +import * as _548 from "./stargaze/globalfee/v1/query.rpc.Query"; +import * as _549 from "./stargaze/mint/v1beta1/query.rpc.Query"; +import * as _550 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; +import * as _551 from "./stargaze/cron/v1/tx.rpc.msg"; +import * as _552 from "./stargaze/globalfee/v1/tx.rpc.msg"; +import * as _598 from "./rpc.query"; +import * as _599 from "./rpc.tx"; export namespace publicawesome { export namespace stargaze { export namespace alloc { export const v1beta1 = { - ..._266, - ..._267, - ..._268, - ..._269, - ..._503, - ..._506, - ..._509, - ..._513 + ..._287, + ..._288, + ..._289, + ..._290, + ..._540, + ..._543, + ..._546, + ..._550 }; } export namespace cron { export const v1 = { - ..._270, - ..._271, - ..._272, - ..._273, - ..._274, - ..._504, - ..._507, - ..._510, - ..._514 + ..._291, + ..._292, + ..._293, + ..._294, + ..._295, + ..._541, + ..._544, + ..._547, + ..._551 }; } export namespace globalfee { export const v1 = { - ..._275, - ..._276, - ..._277, - ..._278, - ..._279, - ..._505, - ..._508, - ..._511, - ..._515 + ..._296, + ..._297, + ..._298, + ..._299, + ..._300, + ..._542, + ..._545, + ..._548, + ..._552 }; } export namespace mint { export const v1beta1 = { - ..._280, - ..._281, - ..._282, - ..._283, - ..._512 + ..._301, + ..._302, + ..._303, + ..._304, + ..._549 }; } } export const ClientFactory = { - ..._559, - ..._560 + ..._598, + ..._599 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/regen/bundle.ts b/packages/types/protobuf/codegen/regen/bundle.ts index 3f2eb9a86..1109130d0 100644 --- a/packages/types/protobuf/codegen/regen/bundle.ts +++ b/packages/types/protobuf/codegen/regen/bundle.ts @@ -1,134 +1,134 @@ -import * as _284 from "./data/v1/events"; -import * as _285 from "./data/v1/state"; -import * as _286 from "./data/v1/tx"; -import * as _287 from "./data/v1/types"; -import * as _288 from "./data/v2/events"; -import * as _289 from "./data/v2/state"; -import * as _290 from "./data/v2/tx"; -import * as _291 from "./data/v2/types"; -import * as _292 from "./ecocredit/basket/v1/events"; -import * as _293 from "./ecocredit/basket/v1/state"; -import * as _294 from "./ecocredit/basket/v1/tx"; -import * as _295 from "./ecocredit/basket/v1/types"; -import * as _296 from "./ecocredit/marketplace/v1/events"; -import * as _297 from "./ecocredit/marketplace/v1/state"; -import * as _298 from "./ecocredit/marketplace/v1/tx"; -import * as _299 from "./ecocredit/marketplace/v1/types"; -import * as _300 from "./ecocredit/orderbook/v1alpha1/memory"; -import * as _301 from "./ecocredit/v1/events"; -import * as _302 from "./ecocredit/v1/state"; -import * as _303 from "./ecocredit/v1/tx"; -import * as _304 from "./ecocredit/v1/types"; -import * as _305 from "./ecocredit/v1alpha1/events"; -import * as _306 from "./ecocredit/v1alpha1/genesis"; -import * as _307 from "./ecocredit/v1alpha1/tx"; -import * as _308 from "./ecocredit/v1alpha1/types"; -import * as _309 from "./intertx/v1/query"; -import * as _310 from "./intertx/v1/tx"; -import * as _516 from "./data/v1/tx.amino"; -import * as _517 from "./data/v2/tx.amino"; -import * as _518 from "./ecocredit/basket/v1/tx.amino"; -import * as _519 from "./ecocredit/marketplace/v1/tx.amino"; -import * as _520 from "./ecocredit/v1/tx.amino"; -import * as _521 from "./ecocredit/v1alpha1/tx.amino"; -import * as _522 from "./intertx/v1/tx.amino"; -import * as _523 from "./data/v1/tx.registry"; -import * as _524 from "./data/v2/tx.registry"; -import * as _525 from "./ecocredit/basket/v1/tx.registry"; -import * as _526 from "./ecocredit/marketplace/v1/tx.registry"; -import * as _527 from "./ecocredit/v1/tx.registry"; -import * as _528 from "./ecocredit/v1alpha1/tx.registry"; -import * as _529 from "./intertx/v1/tx.registry"; -import * as _530 from "./intertx/v1/query.rpc.Query"; -import * as _531 from "./data/v1/tx.rpc.msg"; -import * as _532 from "./data/v2/tx.rpc.msg"; -import * as _533 from "./ecocredit/basket/v1/tx.rpc.msg"; -import * as _534 from "./ecocredit/marketplace/v1/tx.rpc.msg"; -import * as _535 from "./ecocredit/v1/tx.rpc.msg"; -import * as _536 from "./ecocredit/v1alpha1/tx.rpc.msg"; -import * as _537 from "./intertx/v1/tx.rpc.msg"; -import * as _561 from "./rpc.query"; -import * as _562 from "./rpc.tx"; +import * as _305 from "./data/v1/events"; +import * as _306 from "./data/v1/state"; +import * as _307 from "./data/v1/tx"; +import * as _308 from "./data/v1/types"; +import * as _309 from "./data/v2/events"; +import * as _310 from "./data/v2/state"; +import * as _311 from "./data/v2/tx"; +import * as _312 from "./data/v2/types"; +import * as _313 from "./ecocredit/basket/v1/events"; +import * as _314 from "./ecocredit/basket/v1/state"; +import * as _315 from "./ecocredit/basket/v1/tx"; +import * as _316 from "./ecocredit/basket/v1/types"; +import * as _317 from "./ecocredit/marketplace/v1/events"; +import * as _318 from "./ecocredit/marketplace/v1/state"; +import * as _319 from "./ecocredit/marketplace/v1/tx"; +import * as _320 from "./ecocredit/marketplace/v1/types"; +import * as _321 from "./ecocredit/orderbook/v1alpha1/memory"; +import * as _322 from "./ecocredit/v1/events"; +import * as _323 from "./ecocredit/v1/state"; +import * as _324 from "./ecocredit/v1/tx"; +import * as _325 from "./ecocredit/v1/types"; +import * as _326 from "./ecocredit/v1alpha1/events"; +import * as _327 from "./ecocredit/v1alpha1/genesis"; +import * as _328 from "./ecocredit/v1alpha1/tx"; +import * as _329 from "./ecocredit/v1alpha1/types"; +import * as _330 from "./intertx/v1/query"; +import * as _331 from "./intertx/v1/tx"; +import * as _553 from "./data/v1/tx.amino"; +import * as _554 from "./data/v2/tx.amino"; +import * as _555 from "./ecocredit/basket/v1/tx.amino"; +import * as _556 from "./ecocredit/marketplace/v1/tx.amino"; +import * as _557 from "./ecocredit/v1/tx.amino"; +import * as _558 from "./ecocredit/v1alpha1/tx.amino"; +import * as _559 from "./intertx/v1/tx.amino"; +import * as _560 from "./data/v1/tx.registry"; +import * as _561 from "./data/v2/tx.registry"; +import * as _562 from "./ecocredit/basket/v1/tx.registry"; +import * as _563 from "./ecocredit/marketplace/v1/tx.registry"; +import * as _564 from "./ecocredit/v1/tx.registry"; +import * as _565 from "./ecocredit/v1alpha1/tx.registry"; +import * as _566 from "./intertx/v1/tx.registry"; +import * as _567 from "./intertx/v1/query.rpc.Query"; +import * as _568 from "./data/v1/tx.rpc.msg"; +import * as _569 from "./data/v2/tx.rpc.msg"; +import * as _570 from "./ecocredit/basket/v1/tx.rpc.msg"; +import * as _571 from "./ecocredit/marketplace/v1/tx.rpc.msg"; +import * as _572 from "./ecocredit/v1/tx.rpc.msg"; +import * as _573 from "./ecocredit/v1alpha1/tx.rpc.msg"; +import * as _574 from "./intertx/v1/tx.rpc.msg"; +import * as _600 from "./rpc.query"; +import * as _601 from "./rpc.tx"; export namespace regen { export namespace data { export const v1 = { - ..._284, - ..._285, - ..._286, - ..._287, - ..._516, - ..._523, - ..._531 + ..._305, + ..._306, + ..._307, + ..._308, + ..._553, + ..._560, + ..._568 }; export const v2 = { - ..._288, - ..._289, - ..._290, - ..._291, - ..._517, - ..._524, - ..._532 + ..._309, + ..._310, + ..._311, + ..._312, + ..._554, + ..._561, + ..._569 }; } export namespace ecocredit { export namespace basket { export const v1 = { - ..._292, - ..._293, - ..._294, - ..._295, - ..._518, - ..._525, - ..._533 + ..._313, + ..._314, + ..._315, + ..._316, + ..._555, + ..._562, + ..._570 }; } export namespace marketplace { export const v1 = { - ..._296, - ..._297, - ..._298, - ..._299, - ..._519, - ..._526, - ..._534 + ..._317, + ..._318, + ..._319, + ..._320, + ..._556, + ..._563, + ..._571 }; } export namespace orderbook { export const v1alpha1 = { - ..._300 + ..._321 }; } export const v1 = { - ..._301, - ..._302, - ..._303, - ..._304, - ..._520, - ..._527, - ..._535 + ..._322, + ..._323, + ..._324, + ..._325, + ..._557, + ..._564, + ..._572 }; export const v1alpha1 = { - ..._305, - ..._306, - ..._307, - ..._308, - ..._521, - ..._528, - ..._536 + ..._326, + ..._327, + ..._328, + ..._329, + ..._558, + ..._565, + ..._573 }; } export namespace intertx { export const v1 = { - ..._309, - ..._310, - ..._522, - ..._529, - ..._530, - ..._537 + ..._330, + ..._331, + ..._559, + ..._566, + ..._567, + ..._574 }; } export const ClientFactory = { - ..._561, - ..._562 + ..._600, + ..._601 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/tendermint/bundle.ts b/packages/types/protobuf/codegen/tendermint/bundle.ts index 33ace37d1..f9b92e102 100644 --- a/packages/types/protobuf/codegen/tendermint/bundle.ts +++ b/packages/types/protobuf/codegen/tendermint/bundle.ts @@ -1,32 +1,32 @@ -import * as _314 from "./abci/types"; -import * as _315 from "./crypto/keys"; -import * as _316 from "./crypto/proof"; -import * as _317 from "./p2p/types"; -import * as _318 from "./types/block"; -import * as _319 from "./types/evidence"; -import * as _320 from "./types/params"; -import * as _321 from "./types/types"; -import * as _322 from "./types/validator"; -import * as _323 from "./version/types"; +import * as _335 from "./abci/types"; +import * as _336 from "./crypto/keys"; +import * as _337 from "./crypto/proof"; +import * as _338 from "./p2p/types"; +import * as _339 from "./types/block"; +import * as _340 from "./types/evidence"; +import * as _341 from "./types/params"; +import * as _342 from "./types/types"; +import * as _343 from "./types/validator"; +import * as _344 from "./version/types"; export namespace tendermint { export const abci = { - ..._314 + ..._335 }; export const crypto = { - ..._315, - ..._316 + ..._336, + ..._337 }; export const p2p = { - ..._317 + ..._338 }; export const types = { - ..._318, - ..._319, - ..._320, - ..._321, - ..._322 + ..._339, + ..._340, + ..._341, + ..._342, + ..._343 }; export const version = { - ..._323 + ..._344 }; } \ No newline at end of file diff --git a/packages/types/protobuf/proto/pstake/liquidstake/v1beta1/genesis.proto b/packages/types/protobuf/proto/pstake/liquidstake/v1beta1/genesis.proto new file mode 100644 index 000000000..e8222af3c --- /dev/null +++ b/packages/types/protobuf/proto/pstake/liquidstake/v1beta1/genesis.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package pstake.liquidstake.v1beta1; + +import "gogoproto/gogo.proto"; +import "pstake/liquidstake/v1beta1/liquidstake.proto"; + +option go_package = "github.com/persistenceOne/pstake-native/v2/x/liquidstake/types"; +option (gogoproto.equal_all) = true; + +// GenesisState defines the liquidstake module's genesis state. +message GenesisState { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // params defines all the parameters for the liquidstake module + Params params = 1 [ (gogoproto.nullable) = false ]; + + repeated LiquidValidator liquid_validators = 2 + [ (gogoproto.nullable) = false ]; +} diff --git a/packages/types/protobuf/proto/pstake/liquidstake/v1beta1/liquidstake.proto b/packages/types/protobuf/proto/pstake/liquidstake/v1beta1/liquidstake.proto new file mode 100644 index 000000000..f81375ef5 --- /dev/null +++ b/packages/types/protobuf/proto/pstake/liquidstake/v1beta1/liquidstake.proto @@ -0,0 +1,214 @@ +syntax = "proto3"; + +package pstake.liquidstake.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/persistenceOne/pstake-native/v2/x/liquidstake/types"; + +// Params defines the set of params for the liquidstake module. +message Params { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // LiquidBondDenom specifies the denomination of the token receiving after + // liquid stake, The value is calculated through NetAmount. + string liquid_bond_denom = 1; + + // WhitelistedValidators specifies the validators elected to become Active + // Liquid Validators. + repeated WhitelistedValidator whitelisted_validators = 2 + [ (gogoproto.nullable) = false ]; + + // UnstakeFeeRate specifies the fee rate when liquid unstake is requested, + // unbonded by subtracting it from unbondingAmount + string unstake_fee_rate = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + // LsmDisabled allows to block any msgs that convert staked tokens into + // stkXPRT through LSM. + bool lsm_disabled = 4; + + // MinLiquidStakingAmount specifies the minimum number of coins to be staked + // to the active liquid validators on liquid staking to minimize decimal loss + // and consider gas efficiency. + string min_liquid_stake_amount = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + + // CwLockedPoolAddress defines the bech32-encoded address of + // a CW smart-contract representing a time locked LP (e.g. Superfluid LP). + string cw_locked_pool_address = 6 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // FeeAccountAddress defines the bech32-encoded address of + // a an account responsible for accumulating protocol fees. + string fee_account_address = 7 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // AutocompoundFeeRate specifies the fee rate for auto redelegating the stake + // rewards. The fee is taken in favour of the fee account (see + // FeeAccountAddress). + string autocompound_fee_rate = 8 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + // WhitelistAdminAddress the bech32-encoded address of an admin authority + // that is allowed to update whitelisted validators or pause liquidstaking + // module entirely. The key is controlled by an offchain process that is + // selecting validators based on a criteria. Pausing of the module can be + // required during important migrations or failures. + string whitelist_admin_address = 9 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // ModulePaused is a safety toggle that allows to stop main module functions + // such as stake/unstake/stake-to-lp and the BeginBlocker logic. + bool module_paused = 10; +} + +// ValidatorStatus enumerates the status of a liquid validator. +enum ValidatorStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // VALIDATOR_STATUS_UNSPECIFIED defines the unspecified invalid status. + VALIDATOR_STATUS_UNSPECIFIED = 0 + [ (gogoproto.enumvalue_customname) = "ValidatorStatusUnspecified" ]; + // VALIDATOR_STATUS_ACTIVE defines the active, valid status + VALIDATOR_STATUS_ACTIVE = 1 + [ (gogoproto.enumvalue_customname) = "ValidatorStatusActive" ]; + // VALIDATOR_STATUS_INACTIVE defines the inactive, invalid status + VALIDATOR_STATUS_INACTIVE = 2 + [ (gogoproto.enumvalue_customname) = "ValidatorStatusInactive" ]; +} + +// WhitelistedValidator consists of the validator operator address and the +// target weight, which is a value for calculating the real weight to be derived +// according to the active status. +message WhitelistedValidator { + option (gogoproto.goproto_getters) = false; + + // validator_address defines the bech32-encoded address that whitelisted + // validator + string validator_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // target_weight specifies the target weight for liquid staking, unstaking + // amount, which is a value for calculating the real weight to be derived + // according to the active status + string target_weight = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} + +// LiquidValidator defines a Validator that can be the target of LiquidStaking +// and LiquidUnstaking, Active, Weight, etc. fields are derived as functions to +// deal with by maintaining consistency with the state of the staking module. +message LiquidValidator { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // operator_address defines the address of the validator's operator; bech + // encoded in JSON. + string operator_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// LiquidValidatorState is type LiquidValidator with state added to return to +// query results. +message LiquidValidatorState { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // operator_address defines the address of the validator's operator; bech + // encoded in JSON. + string operator_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // weight specifies the weight for liquid staking, unstaking amount + string weight = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + + // status is the liquid validator status + ValidatorStatus status = 3; + + // del_shares define the delegation shares of the validator + string del_shares = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + // liquid_tokens define the token amount worth of delegation shares of the + // validator (slashing applied amount) + string liquid_tokens = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} + +// NetAmountState is type for net amount raw data and mint rate, This is a value +// that depends on the several module state every time, so it is used only for +// calculation and query and is not stored in kv. +message NetAmountState { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = true; + + // mint_rate is stkXPRTTotalSupply / NetAmount + string mint_rate = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + // btoken_total_supply returns the total supply of stk/uxprt (stkXPRT denom) + string stkxprt_total_supply = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + + // net_amount is proxy account's native token balance + total liquid tokens + + // total remaining rewards + total unbonding balance + string net_amount = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + // total_del_shares define the delegation shares of all liquid validators + string total_del_shares = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + // total_liquid_tokens define the token amount worth of delegation shares of + // all liquid validator (slashing applied amount) + string total_liquid_tokens = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + + // total_remaining_rewards define the sum of remaining rewards of proxy + // account by all liquid validators + string total_remaining_rewards = 6 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + // total_unbonding_balance define the unbonding balance of proxy account by + // all liquid validator (slashing applied amount) + string total_unbonding_balance = 7 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + + // proxy_acc_balance define the balance of proxy account for the native token + string proxy_acc_balance = 8 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/types/protobuf/proto/pstake/liquidstake/v1beta1/query.proto b/packages/types/protobuf/proto/pstake/liquidstake/v1beta1/query.proto new file mode 100644 index 000000000..996090909 --- /dev/null +++ b/packages/types/protobuf/proto/pstake/liquidstake/v1beta1/query.proto @@ -0,0 +1,55 @@ +syntax = "proto3"; +package pstake.liquidstake.v1beta1; + +import "google/api/annotations.proto"; +import "pstake/liquidstake/v1beta1/liquidstake.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/persistenceOne/pstake-native/v2/x/liquidstake/types"; + +// Query defines the gRPC query service for the liquidstake module. +service Query { + // Params returns parameters of the liquidstake module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/pstake/liquidstake/v1beta1/params"; + } + + // LiquidValidators returns liquid validators with states of the liquidstake + // module. + rpc LiquidValidators(QueryLiquidValidatorsRequest) + returns (QueryLiquidValidatorsResponse) { + option (google.api.http).get = "/pstake/liquidstake/v1beta1/validators"; + } + + // States returns states of the liquidstake module. + rpc States(QueryStatesRequest) returns (QueryStatesResponse) { + option (google.api.http).get = "/pstake/liquidstake/v1beta1/states"; + } +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryLiquidValidatorsRequest is the request type for the +// Query/LiquidValidators RPC method. +message QueryLiquidValidatorsRequest {} + +// QueryLiquidValidatorsResponse is the response type for the +// Query/LiquidValidators RPC method. +message QueryLiquidValidatorsResponse { + repeated LiquidValidatorState liquid_validators = 1 + [ (gogoproto.nullable) = false ]; +} + +// QueryStatesRequest is the request type for the Query/States RPC method. +message QueryStatesRequest {} + +// QueryStatesResponse is the response type for the Query/States RPC method. +message QueryStatesResponse { + NetAmountState net_amount_state = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/packages/types/protobuf/proto/pstake/liquidstake/v1beta1/tx.proto b/packages/types/protobuf/proto/pstake/liquidstake/v1beta1/tx.proto new file mode 100644 index 000000000..9291fb10c --- /dev/null +++ b/packages/types/protobuf/proto/pstake/liquidstake/v1beta1/tx.proto @@ -0,0 +1,148 @@ +syntax = "proto3"; +package pstake.liquidstake.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/msg/v1/msg.proto"; +import "google/protobuf/timestamp.proto"; +import "pstake/liquidstake/v1beta1/liquidstake.proto"; + +option go_package = "github.com/persistenceOne/pstake-native/v2/x/liquidstake/types"; + +// Msg defines the liquid staking Msg service. +service Msg { + // LiquidStake defines a method for performing a delegation of coins + // from a delegator to whitelisted validators. + rpc LiquidStake(MsgLiquidStake) returns (MsgLiquidStakeResponse); + + // LiquidUnstake defines a method for performing an undelegation of liquid + // staking from a delegate. + rpc LiquidUnstake(MsgLiquidUnstake) returns (MsgLiquidUnstakeResponse); + + // StakeToLP defines a method for LSM-transfer of staked XPRT + // into stkXPRT with locking into an LP. + rpc StakeToLP(MsgStakeToLP) returns (MsgStakeToLPResponse); + + // UpdateParams defines a method to update the module params. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // UpdateWhitelistedValidators defines a method to update the whitelisted + // validators list. + rpc UpdateWhitelistedValidators(MsgUpdateWhitelistedValidators) + returns (MsgUpdateWhitelistedValidatorsResponse); + + // SetModulePaused defines a method to update the module's pause status, + // setting value of the safety flag in params. + rpc SetModulePaused(MsgSetModulePaused) returns (MsgSetModulePausedResponse); +} + +// MsgLiquidStake defines a SDK message for performing a liquid stake of coins +// from a delegator to whitelisted validators. +message MsgLiquidStake { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "delegator_address"; + + string delegator_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgLiquidStakeResponse defines the MsgLiquidStake response type. +message MsgLiquidStakeResponse {} + +// MsgStakeToLP defines a SDK message for performing an LSM-transfer of staked +// XPRT into stkXPRT with locking into an LP. +message MsgStakeToLP { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "delegator_address"; + + string delegator_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + string validator_address = 2 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + cosmos.base.v1beta1.Coin staked_amount = 3 [ (gogoproto.nullable) = false ]; + cosmos.base.v1beta1.Coin liquid_amount = 4 [ (gogoproto.nullable) = false ]; +} + +// MsgStakeToLPResponse defines the MsgStakeToLP response type. +message MsgStakeToLPResponse {} + +// MsgLiquidUnstake defines a SDK message for performing an undelegation of +// liquid staking from a delegate. +message MsgLiquidUnstake { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "delegator_address"; + + string delegator_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgLiquidUnstakeResponse defines the MsgLiquidUnstake response type. +message MsgLiquidUnstakeResponse { + google.protobuf.Timestamp completion_time = 1 + [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; +} + +message MsgUpdateParams { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // params defines the parameters to update. + // + // NOTE: denom and whitelisted validators are not updated. + // + Params params = 2 [ (gogoproto.nullable) = false ]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +message MsgUpdateParamsResponse {} + +message MsgUpdateWhitelistedValidators { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "authority"; + + // Authority is the address that is allowed to update whitelisted validators, + // defined as admin address in params (WhitelistAdminAddress). + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // WhitelistedValidators specifies the validators elected to become Active + // Liquid Validators. + repeated WhitelistedValidator whitelisted_validators = 2 + [ (gogoproto.nullable) = false ]; +} + +// MsgUpdateWhitelistedValidatorsResponse defines the response structure for +// executing a +message MsgUpdateWhitelistedValidatorsResponse {} + +message MsgSetModulePaused { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "authority"; + + // Authority is the address that is allowed to update module's paused state, + // defined as admin address in params (WhitelistAdminAddress). + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // IsPaused represents the target state of the paused flag. + bool is_paused = 2; +} + +// MsgSetModulePausedResponse defines the response structure for +// executing a +message MsgSetModulePausedResponse {} diff --git a/packages/types/protobuf/proto/pstake/liquidstakeibc/v1beta1/genesis.proto b/packages/types/protobuf/proto/pstake/liquidstakeibc/v1beta1/genesis.proto new file mode 100644 index 000000000..0e122ec9a --- /dev/null +++ b/packages/types/protobuf/proto/pstake/liquidstakeibc/v1beta1/genesis.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package pstake.liquidstakeibc.v1beta1; + +import "gogoproto/gogo.proto"; +import "pstake/liquidstakeibc/v1beta1/params.proto"; +import "pstake/liquidstakeibc/v1beta1/liquidstakeibc.proto"; + +// this line is used by starport scaffolding # genesis/proto/import + +option go_package = "github.com/persistenceOne/pstake-native/v2/x/liquidstakeibc/types"; + +// GenesisState defines the liquidstakeibc module's genesis state. +message GenesisState { + Params params = 1 [ (gogoproto.nullable) = false ]; + + // initial host chain list + repeated HostChain host_chains = 2; + + // initial deposit list + repeated Deposit deposits = 3; + + // initial unbondings + repeated Unbonding unbondings = 4; + + // initial user unbondings + repeated UserUnbonding user_unbondings = 5; + + // validator unbondings + repeated ValidatorUnbonding validator_unbondings = 6; +} diff --git a/packages/types/protobuf/proto/pstake/liquidstakeibc/v1beta1/liquidstakeibc.proto b/packages/types/protobuf/proto/pstake/liquidstakeibc/v1beta1/liquidstakeibc.proto new file mode 100644 index 000000000..d38fa4bd1 --- /dev/null +++ b/packages/types/protobuf/proto/pstake/liquidstakeibc/v1beta1/liquidstakeibc.proto @@ -0,0 +1,335 @@ +syntax = "proto3"; +package pstake.liquidstakeibc.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos/staking/v1beta1/staking.proto"; + +option go_package = "github.com/persistenceOne/pstake-native/v2/x/liquidstakeibc/types"; + +message HostChain { + option (gogoproto.goproto_stringer) = true; + + // host chain id + string chain_id = 1; + // ibc connection id + string connection_id = 2; + // module params + HostChainLSParams params = 3; + // native token denom + string host_denom = 4; + // ibc connection channel id + string channel_id = 5; + // ibc connection port id + string port_id = 6; + // delegation host account + ICAAccount delegation_account = 7; + // reward host account + ICAAccount rewards_account = 8; + // validator set + repeated Validator validators = 9; + // minimum ls amount + string minimum_deposit = 10 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + // redemption rate + string c_value = 11 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // previous redemption rate + string last_c_value = 12 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // undelegation epoch factor + int64 unbonding_factor = 13; + // whether the chain is ready to accept delegations or not + bool active = 14; + // factor limit for auto-compounding, daily periodic rate (APY / 365s) + string auto_compound_factor = 15 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // host chain flags + HostChainFlags flags = 16; + // non-compoundable chain reward params + RewardParams reward_params = 17; +} + +message HostChainFlags { bool lsm = 1; } + +message RewardParams { + // rewards denom on the host chain + string denom = 1; + // entity which will convert rewards to the host denom + string destination = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +message HostChainLSParams { + string deposit_fee = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // protocol fee in percentage + string restake_fee = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // protocol fee in percentage + string unstake_fee = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // protocol fee in percentage + string redemption_fee = 4 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // protocol fee in percentage + // LSM validator cap + // Should be used only when HostChainFlag.Lsm == true, orelse default + string lsm_validator_cap = 6 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // LSM bond factor + // Should be used only when HostChainFlag.Lsm == true, orelse default + string lsm_bond_factor = 7 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // UndelegateEntries + uint32 max_entries = 8; + // amount skew that is acceptable before redelegating + string redelegation_acceptable_delta = 9 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + string upper_c_value_limit = 10 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // upper limit for the c value of the host chain + + string lower_c_value_limit = 11 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // lower limit for the c value of the host chain +} + +message ICAAccount { + enum ChannelState { + // ICA channel is being created + ICA_CHANNEL_CREATING = 0; + // ICA is established and the account can be used + ICA_CHANNEL_CREATED = 1; + } + + // address of the ica on the controller chain + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // token balance of the ica + cosmos.base.v1beta1.Coin balance = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.nullable) = false + ]; + // owner string + string owner = 3; + ChannelState channel_state = 4; +} + +message Validator { + // valoper address + string operator_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // validator status + string status = 2; + // validator weight in the set + string weight = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // amount delegated by the module to the validator + string delegated_amount = 4 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + // the validator token exchange rate, total bonded tokens divided by total + // shares issued + string exchange_rate = 5 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // the unbonding epoch number when the validator transitioned into the state + int64 unbonding_epoch = 6; + // whether the validator can accept delegations or not, default true for + // non-lsm chains + bool delegable = 7; +} + +message Deposit { + enum DepositState { + // no action has been initiated on the deposit + DEPOSIT_PENDING = 0; + // deposit sent to the host chain delegator address + DEPOSIT_SENT = 1; + // deposit received by the host chain delegator address + DEPOSIT_RECEIVED = 2; + // delegation submitted for the deposit on the host chain + DEPOSIT_DELEGATING = 3; + } + + // deposit target chain + string chain_id = 1; + cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.nullable) = false ]; + // epoch number of the deposit + int64 epoch = 3; + // state + DepositState state = 4; + // sequence id of the ibc transaction + string ibc_sequence_id = 5; +} + +message LSMDeposit { + enum LSMDepositState { + // no action has been initiated on the deposit + DEPOSIT_PENDING = 0; + // deposit sent to the host chain delegator address + DEPOSIT_SENT = 1; + // deposit received by the host chain delegator address + DEPOSIT_RECEIVED = 2; + // deposit started the untokenization process + DEPOSIT_UNTOKENIZING = 3; + } + + // deposit target chain + string chain_id = 1; + // this is calculated when liquid staking [lsm_shares * + // validator_exchange_rate] + string amount = 2 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + // LSM token shares, they are mapped 1:1 with the delegator shares that are + // tokenized https://github.com/iqlusioninc/cosmos-sdk/pull/19 + string shares = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // LSM token denom + string denom = 4; + // LSM token ibc denom + string ibc_denom = 5; + // address of the delegator + string delegator_address = 6; + // state o the deposit + LSMDepositState state = 7; + // sequence id of the ibc transaction + string ibc_sequence_id = 8; +} + +message Unbonding { + enum UnbondingState { + // no action has been initiated on the unbonding + UNBONDING_PENDING = 0; + // unbonding action has been sent to the host chain + UNBONDING_INITIATED = 1; + // unbonding is waiting for the maturing period of the host chain + UNBONDING_MATURING = 2; + // unbonding has matured and is ready to transfer from the host chain + UNBONDING_MATURED = 3; + // unbonding is on the persistence chain and can be claimed + UNBONDING_CLAIMABLE = 4; + // unbonding has failed + UNBONDING_FAILED = 5; + } + + // unbonding target chain + string chain_id = 1; + // epoch number of the unbonding record + int64 epoch_number = 2; + // time when the unbonding matures and can be collected + google.protobuf.Timestamp mature_time = 3 + [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; + // stk token amount that is burned with the unbonding + cosmos.base.v1beta1.Coin burn_amount = 4 [ (gogoproto.nullable) = false ]; + // host token amount that is being unbonded + cosmos.base.v1beta1.Coin unbond_amount = 5 [ (gogoproto.nullable) = false ]; + // sequence id of the ibc transaction + string ibc_sequence_id = 6; + // state of the unbonding during the process + UnbondingState state = 7; +} + +message UserUnbonding { + // unbonding target chain + string chain_id = 1; + // epoch when the unbonding started + int64 epoch_number = 2; + // address which requested the unbonding + string address = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // stk token amount that is being unbonded + cosmos.base.v1beta1.Coin stk_amount = 4 [ (gogoproto.nullable) = false ]; + // host token amount that is being unbonded + cosmos.base.v1beta1.Coin unbond_amount = 5 [ (gogoproto.nullable) = false ]; +} + +message ValidatorUnbonding { + // unbonding target chain + string chain_id = 1; + // epoch when the unbonding started + int64 epoch_number = 2; + // time when the unbonding matures and can be collected + google.protobuf.Timestamp mature_time = 3 + [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; + // address of the validator that is being unbonded + string validator_address = 4 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // amount unbonded from the validator + cosmos.base.v1beta1.Coin amount = 5 [ (gogoproto.nullable) = false ]; + // sequence id of the ibc transaction + string ibc_sequence_id = 6; +} + +message KVUpdate { + string key = 1; + string value = 2; +} + +message Redelegations { + string chain_i_d = 1; + repeated cosmos.staking.v1beta1.Redelegation redelegations = 2; +} + +message RedelegateTx { + enum RedelegateTxState { + + // redelegate txn sent + REDELEGATE_SENT = 0; + // redelegate txn acked + REDELEGATE_ACKED = 1; + } + + // target chain + string chain_id = 1; + + string ibc_sequence_id = 2; + // state of the unbonding during the process + RedelegateTxState state = 3; +} diff --git a/packages/types/protobuf/proto/pstake/liquidstakeibc/v1beta1/msgs.proto b/packages/types/protobuf/proto/pstake/liquidstakeibc/v1beta1/msgs.proto new file mode 100644 index 000000000..01ce9c43a --- /dev/null +++ b/packages/types/protobuf/proto/pstake/liquidstakeibc/v1beta1/msgs.proto @@ -0,0 +1,161 @@ +syntax = "proto3"; +package pstake.liquidstakeibc.v1beta1; + +import "google/api/annotations.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; + +import "pstake/liquidstakeibc/v1beta1/liquidstakeibc.proto"; +import "pstake/liquidstakeibc/v1beta1/params.proto"; + +option go_package = "github.com/persistenceOne/pstake-native/v2/x/liquidstakeibc/types"; + +// Msg defines the liquidstakeibc services. +service Msg { + rpc RegisterHostChain(MsgRegisterHostChain) + returns (MsgRegisterHostChainResponse); + rpc UpdateHostChain(MsgUpdateHostChain) returns (MsgUpdateHostChainResponse); + + rpc LiquidStake(MsgLiquidStake) returns (MsgLiquidStakeResponse) { + option (google.api.http).post = + "/pstake/liquidstakeibc/v1beta1/LiquidStake"; + } + + rpc LiquidStakeLSM(MsgLiquidStakeLSM) returns (MsgLiquidStakeLSMResponse) { + option (google.api.http).post = + "/pstake/liquidstakeibc/v1beta1/LiquidStakeLSM"; + } + + rpc LiquidUnstake(MsgLiquidUnstake) returns (MsgLiquidUnstakeResponse) { + option (google.api.http).post = + "/pstake/liquidstakeibc/v1beta1/LiquidUnstake"; + } + + rpc Redeem(MsgRedeem) returns (MsgRedeemResponse) { + option (google.api.http).post = "/pstake/liquidstakeibc/v1beta1/Redeem"; + } + + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +message MsgRegisterHostChain { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "pstake/MsgRegisterHostChain"; + + // authority is the address of the governance account + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + string connection_id = 2; + string deposit_fee = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string restake_fee = 4 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string unstake_fee = 5 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string redemption_fee = 6 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string channel_id = 7; + string port_id = 8; + string host_denom = 9; + string minimum_deposit = 10 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + int64 unbonding_factor = 11; + int64 auto_compound_factor = 12; +} + +message MsgRegisterHostChainResponse {} + +message MsgUpdateHostChain { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "pstake/MsgUpdateHostChain"; + // authority is the address of the governance account + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + string chain_id = 2; + repeated KVUpdate updates = 3 [ (amino.dont_omitempty) = true ]; +} + +message MsgUpdateHostChainResponse {} + +message MsgLiquidStake { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "pstake/MsgLiquidStake"; + + string delegator_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgLiquidStakeResponse {} + +message MsgLiquidStakeLSM { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "pstake/MsgLiquidStakeLSM"; + + string delegator_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + repeated cosmos.base.v1beta1.Coin delegations = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +message MsgLiquidStakeLSMResponse {} + +message MsgLiquidUnstake { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "pstake/MsgLiquidUnstake"; + + string delegator_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgLiquidUnstakeResponse {} + +message MsgRedeem { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "pstake/MsgRedeem"; + + string delegator_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgRedeemResponse {} + +message MsgUpdateParams { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "pstake/MsgUpdateParams"; + + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + Params params = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +message MsgUpdateParamsResponse {} diff --git a/packages/types/protobuf/proto/pstake/liquidstakeibc/v1beta1/params.proto b/packages/types/protobuf/proto/pstake/liquidstakeibc/v1beta1/params.proto new file mode 100644 index 000000000..ae546698e --- /dev/null +++ b/packages/types/protobuf/proto/pstake/liquidstakeibc/v1beta1/params.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package pstake.liquidstakeibc.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/persistenceOne/pstake-native/v2/x/liquidstakeibc/types"; + +// Params defines the parameters for the module. +message Params { + option (amino.name) = "pstake/x/liquidstakeibc/Params"; + + string admin_address = 1 + [ (cosmos_proto.scalar) = + "cosmos.AddressString" ]; // protocol admin address + + string fee_address = 2 [ (cosmos_proto.scalar) = + "cosmos.AddressString" ]; // protocol fee address + + // fields 3 and 4 were migrated to on-chain params. + // check https://github.com/persistenceOne/pstake-native/pull/732. + reserved 3; // upper_c_value_limit + reserved 4; // lower_c_value_limit +} diff --git a/packages/types/protobuf/proto/pstake/liquidstakeibc/v1beta1/query.proto b/packages/types/protobuf/proto/pstake/liquidstakeibc/v1beta1/query.proto new file mode 100644 index 000000000..28bc0a46f --- /dev/null +++ b/packages/types/protobuf/proto/pstake/liquidstakeibc/v1beta1/query.proto @@ -0,0 +1,194 @@ +syntax = "proto3"; +package pstake.liquidstakeibc.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +import "pstake/liquidstakeibc/v1beta1/params.proto"; +import "pstake/liquidstakeibc/v1beta1/liquidstakeibc.proto"; + +// this line is used by starport scaffolding # 1 + +option go_package = "github.com/persistenceOne/pstake-native/v2/x/liquidstakeibc/types"; + +// Query defines the gRPC querier service. +service Query { + // Queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/pstake/liquidstakeibc/v1beta1/params"; + } + + // Queries a HostChain by id. + rpc HostChain(QueryHostChainRequest) returns (QueryHostChainResponse) { + option (google.api.http).get = + "/pstake/liquidstakeibc/v1beta1/host_chain/{chain_id}"; + } + + // Queries for all the HostChains. + rpc HostChains(QueryHostChainsRequest) returns (QueryHostChainsResponse) { + option (google.api.http).get = "/pstake/liquidstakeibc/v1beta1/host_chains"; + } + + // Queries for all the deposits for a host chain. + rpc Deposits(QueryDepositsRequest) returns (QueryDepositsResponse) { + option (google.api.http).get = + "/pstake/liquidstakeibc/v1beta1/deposits/{chain_id}"; + } + + // Queries for all the deposits for a host chain. + rpc LSMDeposits(QueryLSMDepositsRequest) returns (QueryLSMDepositsResponse) { + option (google.api.http).get = + "/pstake/liquidstakeibc/v1beta1/lsm_deposits/{chain_id}"; + } + + // Queries all unbondings for a host chain. + rpc Unbondings(QueryUnbondingsRequest) returns (QueryUnbondingsResponse) { + option (google.api.http).get = + "/pstake/liquidstakeibc/v1beta1/unbondings/{chain_id}"; + } + + // Queries an unbonding for a host chain. + rpc Unbonding(QueryUnbondingRequest) returns (QueryUnbondingResponse) { + option (google.api.http).get = + "/pstake/liquidstakeibc/v1beta1/unbonding/{chain_id}/{epoch}"; + } + + // Queries all unbondings for a delegator address. + rpc UserUnbondings(QueryUserUnbondingsRequest) + returns (QueryUserUnbondingsResponse) { + option (google.api.http).get = + "/pstake/liquidstakeibc/v1beta1/user_unbondings/{address}"; + } + + // Queries all unbondings for a host chain. + rpc HostChainUserUnbondings(QueryHostChainUserUnbondingsRequest) + returns (QueryHostChainUserUnbondingsResponse) { + option (google.api.http).get = + "/pstake/liquidstakeibc/v1beta1/user_unbondings/{chain_id}"; + } + + // Queries all validator unbondings for a host chain. + rpc ValidatorUnbondings(QueryValidatorUnbondingRequest) + returns (QueryValidatorUnbondingResponse) { + option (google.api.http).get = + "/pstake/liquidstakeibc/v1beta1/validator_unbondings/{chain_id}"; + } + + // Queries for a host chain deposit account balance. + rpc DepositAccountBalance(QueryDepositAccountBalanceRequest) + returns (QueryDepositAccountBalanceResponse) { + option (google.api.http).get = + "/pstake/liquidstakeibc/v1beta1/deposit_account_balance/{chain_id}"; + } + + // Queries for a host chain exchange rate between the host token and the stk + // token. + rpc ExchangeRate(QueryExchangeRateRequest) + returns (QueryExchangeRateResponse) { + option (google.api.http).get = + "/pstake/liquidstakeibc/v1beta1/exchange_rate/{chain_id}"; + } + + // Queries for a host chain redelegation entries on the host token delegation + // acct. + rpc Redelegations(QueryRedelegationsRequest) + returns (QueryRedelegationsResponse) { + option (google.api.http).get = + "/pstake/liquidstakeibc/v1beta1/redelegations/{chain_id}"; + } + + // Queries for a host chain redelegation-txs for the host token. + rpc RedelegationTx(QueryRedelegationTxRequest) + returns (QueryRedelegationTxResponse) { + option (google.api.http).get = + "/pstake/liquidstakeibc/v1beta1/redelegation_tx/{chain_id}"; + } +} + +message QueryParamsRequest {} + +message QueryParamsResponse { + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryHostChainRequest { string chain_id = 1; } + +message QueryHostChainResponse { + HostChain host_chain = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryHostChainsRequest {} + +message QueryHostChainsResponse { repeated HostChain host_chains = 1; } + +message QueryDepositsRequest { string chain_id = 1; } + +message QueryDepositsResponse { repeated Deposit deposits = 1; } + +message QueryLSMDepositsRequest { string chain_id = 1; } + +message QueryLSMDepositsResponse { repeated LSMDeposit deposits = 1; } + +message QueryUnbondingsRequest { string chain_id = 1; } + +message QueryUnbondingsResponse { repeated Unbonding unbondings = 1; } + +message QueryUnbondingRequest { + string chain_id = 1; + int64 epoch = 2; +} + +message QueryUnbondingResponse { Unbonding unbonding = 1; } + +message QueryUserUnbondingsRequest { string address = 1; } + +message QueryUserUnbondingsResponse { + repeated UserUnbonding user_unbondings = 1; +} + +message QueryHostChainUserUnbondingsRequest { + string chain_id = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message QueryHostChainUserUnbondingsResponse { + repeated UserUnbonding user_unbondings = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryValidatorUnbondingRequest { string chain_id = 1; } + +message QueryValidatorUnbondingResponse { + repeated ValidatorUnbonding validator_unbondings = 1; +} + +message QueryDepositAccountBalanceRequest { string chain_id = 1; } + +message QueryDepositAccountBalanceResponse { + cosmos.base.v1beta1.Coin balance = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryExchangeRateRequest { string chain_id = 1; } + +message QueryExchangeRateResponse { + string rate = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (cosmos_proto.scalar) = "cosmos.Dec" + ]; +} + +message QueryRedelegationsRequest { string chain_id = 1; } + +message QueryRedelegationsResponse { + liquidstakeibc.v1beta1.Redelegations redelegations = 1; +} + +message QueryRedelegationTxRequest { string chain_id = 1; } + +message QueryRedelegationTxResponse { + repeated liquidstakeibc.v1beta1.RedelegateTx redelegation_tx = 1; +} diff --git a/packages/types/protobuf/proto/pstake/lscosmos/v1beta1/genesis.proto b/packages/types/protobuf/proto/pstake/lscosmos/v1beta1/genesis.proto new file mode 100644 index 000000000..4e754e7ef --- /dev/null +++ b/packages/types/protobuf/proto/pstake/lscosmos/v1beta1/genesis.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package pstake.lscosmos.v1beta1; + +import "gogoproto/gogo.proto"; +import "pstake/lscosmos/v1beta1/params.proto"; +import "pstake/lscosmos/v1beta1/lscosmos.proto"; +import "pstake/lscosmos/v1beta1/governance_proposal.proto"; +// this line is used by starport scaffolding # genesis/proto/import + +option go_package = "github.com/persistenceOne/pstake-native/v2/x/lscosmos/types"; + +// GenesisState defines the lscosmos module's genesis state. +message GenesisState { + Params params = 1 [ (gogoproto.nullable) = false ]; + + // this line is used by starport scaffolding # genesis/proto/state + bool module_enabled = 2; + HostChainParams host_chain_params = 3 [ (gogoproto.nullable) = false ]; + AllowListedValidators allow_listed_validators = 4 + [ (gogoproto.nullable) = false ]; + DelegationState delegation_state = 5 [ (gogoproto.nullable) = false ]; + HostChainRewardAddress host_chain_reward_address = 6 + [ (gogoproto.nullable) = false ]; + IBCAmountTransientStore i_b_c_amount_transient_store = 7 + [ (gogoproto.nullable) = false ]; + repeated UnbondingEpochCValue unbonding_epoch_c_values = 8 + [ (gogoproto.nullable) = false ]; + repeated DelegatorUnbondingEpochEntry delegator_unbonding_epoch_entries = 9 + [ (gogoproto.nullable) = false ]; + HostAccounts host_accounts = 10 [ (gogoproto.nullable) = false ]; +} diff --git a/packages/types/protobuf/proto/pstake/lscosmos/v1beta1/governance_proposal.proto b/packages/types/protobuf/proto/pstake/lscosmos/v1beta1/governance_proposal.proto new file mode 100644 index 000000000..ea3b4a570 --- /dev/null +++ b/packages/types/protobuf/proto/pstake/lscosmos/v1beta1/governance_proposal.proto @@ -0,0 +1,69 @@ +syntax = "proto3"; +package pstake.lscosmos.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "pstake/lscosmos/v1beta1/lscosmos.proto"; + +option go_package = "github.com/persistenceOne/pstake-native/v2/x/lscosmos/types"; + +option (gogoproto.equal_all) = true; +option (gogoproto.stringer_all) = false; +option (gogoproto.goproto_getters_all) = false; + +message MinDepositAndFeeChangeProposal { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option deprecated = true; + + string title = 1; + string description = 2; + string min_deposit = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + string pstake_deposit_fee = 4 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string pstake_restake_fee = 5 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string pstake_unstake_fee = 6 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string pstake_redemption_fee = 7 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +message PstakeFeeAddressChangeProposal { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option deprecated = true; + + string title = 1; + string description = 2; + string pstake_fee_address = 3 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +message AllowListedValidatorSetChangeProposal { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option deprecated = true; + + string title = 1; + string description = 2; + AllowListedValidators allow_listed_validators = 3 + [ (gogoproto.nullable) = false ]; +} diff --git a/packages/types/protobuf/proto/pstake/lscosmos/v1beta1/lscosmos.proto b/packages/types/protobuf/proto/pstake/lscosmos/v1beta1/lscosmos.proto new file mode 100644 index 000000000..f15fdd9f6 --- /dev/null +++ b/packages/types/protobuf/proto/pstake/lscosmos/v1beta1/lscosmos.proto @@ -0,0 +1,168 @@ +syntax = "proto3"; +package pstake.lscosmos.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; +option go_package = "github.com/persistenceOne/pstake-native/v2/x/lscosmos/types"; + +option (gogoproto.equal_all) = true; +option (gogoproto.stringer_all) = false; +option (gogoproto.goproto_getters_all) = false; + +message AllowListedValidators { + repeated AllowListedValidator allow_listed_validators = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"allow_lised_validators\"" + ]; +} + +message AllowListedValidator { + + // validator_address defines the bech32-encoded address the allowlisted + // validator + string validator_address = 1 [ + (cosmos_proto.scalar) = "cosmos.AddressString", + (gogoproto.moretags) = "yaml:\"validator_address\"" + ]; + + // target_weight specifies the target weight for liquid staking, unstaking + // amount, which is a value for calculating the real weight to be derived + // according to the active status + string target_weight = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.moretags) = "yaml:\"target_weight\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +message PstakeParams { + string pstake_deposit_fee = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // protocol fee in percentage + string pstake_restake_fee = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // protocol fee in percentage + string pstake_unstake_fee = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // protocol fee in percentage + string pstake_redemption_fee = 4 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; // protocol fee in percentage + string pstake_fee_address = 5 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// HostChainParams go into the DB +message HostChainParams { + option (gogoproto.goproto_stringer) = true; + + string chain_i_d = 1; + string connection_i_d = 2; + string transfer_channel = 3; + string transfer_port = 4; + string base_denom = 5; + string mint_denom = 6; + string min_deposit = 7 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + PstakeParams pstake_params = 8 [ (gogoproto.nullable) = false ]; +} + +// DelegationState stores module account balance, ica account balance, +// delegation state, undelegation state +message DelegationState { + // This field is necessary as the address of not blocked for send coins, + // we only should care about funds that have come via proper channels. + repeated cosmos.base.v1beta1.Coin host_delegation_account_balance = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + string host_chain_delegation_address = 2 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + repeated HostAccountDelegation host_account_delegations = 3 + [ (gogoproto.nullable) = false ]; + repeated HostAccountUndelegation host_account_undelegations = 4 + [ (gogoproto.nullable) = false ]; +} + +message HostAccountDelegation { + option (gogoproto.goproto_stringer) = true; + + string validator_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.nullable) = false ]; +} + +message HostAccountUndelegation { + int64 epoch_number = 1; + cosmos.base.v1beta1.Coin total_undelegation_amount = 2 + [ (gogoproto.nullable) = false ]; + google.protobuf.Timestamp completion_time = 3 + [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; + repeated UndelegationEntry undelegation_entries = 4 + [ (gogoproto.nullable) = false ]; +} + +message UndelegationEntry { + option (gogoproto.goproto_stringer) = true; + string validator_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.nullable) = false ]; +} + +message HostChainRewardAddress { + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +message IBCAmountTransientStore { + // ibc_transfer stores only tokens which have ibc denoms "ibc/HEXHASH" + repeated cosmos.base.v1beta1.Coin i_b_c_transfer = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + // ica_delegate stores only token which has staking baseDenom + cosmos.base.v1beta1.Coin i_c_a_delegate = 2 [ (gogoproto.nullable) = false ]; + + repeated TransientUndelegationTransfer undelegaton_complete_i_b_c_transfer = 3 + [ (gogoproto.nullable) = false ]; +} + +message TransientUndelegationTransfer { + int64 epoch_number = 1; + cosmos.base.v1beta1.Coin amount_unbonded = 2 [ (gogoproto.nullable) = false ]; +} + +message UnbondingEpochCValue { + int64 epoch_number = 1; + + // c_value = stk_burn.Amount/amount_unbonded.Amount + cosmos.base.v1beta1.Coin s_t_k_burn = 2 [ (gogoproto.nullable) = false ]; + cosmos.base.v1beta1.Coin amount_unbonded = 3 [ (gogoproto.nullable) = false ]; + bool is_matured = 4; + bool is_failed = 5; +} + +message DelegatorUnbondingEpochEntry { + string delegator_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + int64 epoch_number = 2; + cosmos.base.v1beta1.Coin amount = 3 [ (gogoproto.nullable) = false ]; +} + +message HostAccounts { + string delegator_account_owner_i_d = 1; + string rewards_account_owner_i_d = 2; +} diff --git a/packages/types/protobuf/proto/pstake/lscosmos/v1beta1/msgs.proto b/packages/types/protobuf/proto/pstake/lscosmos/v1beta1/msgs.proto new file mode 100644 index 000000000..6df9756d2 --- /dev/null +++ b/packages/types/protobuf/proto/pstake/lscosmos/v1beta1/msgs.proto @@ -0,0 +1,138 @@ +syntax = "proto3"; +package pstake.lscosmos.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "pstake/lscosmos/v1beta1/lscosmos.proto"; + +option go_package = "github.com/persistenceOne/pstake-native/v2/x/lscosmos/types"; + +// Msg defines the lsCosmos services. +service Msg { + option deprecated = true; + + rpc LiquidStake(MsgLiquidStake) returns (MsgLiquidStakeResponse) { + option (google.api.http).post = "/pstake/lscosmos/v1beta1/LiquidStake"; + } + + rpc LiquidUnstake(MsgLiquidUnstake) returns (MsgLiquidUnstakeResponse) { + option (google.api.http).post = "/pstake/lscosmos/v1beta1/LiquidUnstake"; + } + + rpc Redeem(MsgRedeem) returns (MsgRedeemResponse) { + option (google.api.http).post = "/pstake/lscosmos/v1beta1/Redeem"; + } + + rpc Claim(MsgClaim) returns (MsgClaimResponse) { + option (google.api.http).post = "/pstake/lscosmos/v1beta1/Claim"; + } + + rpc RecreateICA(MsgRecreateICA) returns (MsgRecreateICAResponse) { + option (google.api.http).post = "/pstake/lscosmos/v1beta1/RecreateICA"; + } + + rpc JumpStart(MsgJumpStart) returns (MsgJumpStartResponse) { + option (google.api.http).post = "/pstake/lscosmos/v1beta1/JumpStart"; + } + + rpc ChangeModuleState(MsgChangeModuleState) + returns (MsgChangeModuleStateResponse) { + option (google.api.http).post = + "/pstake/lscosmos/v1beta1/ChangeModuleState"; + } + + rpc ReportSlashing(MsgReportSlashing) returns (MsgReportSlashingResponse) { + option (google.api.http).post = "/pstake/lscosmos/v1beta1/ReportSlashing"; + } +} + +message MsgLiquidStake { + option (cosmos.msg.v1.signer) = "delegator_address"; + + string delegator_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgLiquidStakeResponse {} + +message MsgLiquidUnstake { + option (cosmos.msg.v1.signer) = "delegator_address"; + + string delegator_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgLiquidUnstakeResponse {} + +message MsgRedeem { + option (cosmos.msg.v1.signer) = "delegator_address"; + + string delegator_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + cosmos.base.v1beta1.Coin amount = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgRedeemResponse {} + +message MsgClaim { + option (cosmos.msg.v1.signer) = "delegator_address"; + + string delegator_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +message MsgClaimResponse {} + +message MsgRecreateICA { + option (cosmos.msg.v1.signer) = "from_address"; + + string from_address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +message MsgRecreateICAResponse {} + +message MsgJumpStart { + option (cosmos.msg.v1.signer) = "pstake_address"; + + string pstake_address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string chain_i_d = 2; + string connection_i_d = 3; + string transfer_channel = 4; + string transfer_port = 5; + string base_denom = 6; + string mint_denom = 7; + string min_deposit = 8 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + AllowListedValidators allow_listed_validators = 9 + [ (gogoproto.nullable) = false ]; + PstakeParams pstake_params = 10 [ (gogoproto.nullable) = false ]; + HostAccounts host_accounts = 11 [ (gogoproto.nullable) = false ]; +} + +message MsgJumpStartResponse {} + +message MsgChangeModuleState { + option (cosmos.msg.v1.signer) = "pstake_address"; + + string pstake_address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + bool module_state = 2; +} + +message MsgChangeModuleStateResponse {} + +message MsgReportSlashing { + option (cosmos.msg.v1.signer) = "pstake_address"; + + string pstake_address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string validator_address = 2; +} + +message MsgReportSlashingResponse {} diff --git a/packages/types/protobuf/proto/pstake/lscosmos/v1beta1/params.proto b/packages/types/protobuf/proto/pstake/lscosmos/v1beta1/params.proto new file mode 100644 index 000000000..33a2b7088 --- /dev/null +++ b/packages/types/protobuf/proto/pstake/lscosmos/v1beta1/params.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package pstake.lscosmos.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/persistenceOne/pstake-native/v2/x/lscosmos/types"; + +// Params defines the parameters for the module. +message Params {} diff --git a/packages/types/protobuf/proto/pstake/lscosmos/v1beta1/query.proto b/packages/types/protobuf/proto/pstake/lscosmos/v1beta1/query.proto new file mode 100644 index 000000000..1ca5fb55f --- /dev/null +++ b/packages/types/protobuf/proto/pstake/lscosmos/v1beta1/query.proto @@ -0,0 +1,284 @@ +syntax = "proto3"; +package pstake.lscosmos.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "pstake/lscosmos/v1beta1/params.proto"; +import "pstake/lscosmos/v1beta1/genesis.proto"; +import "pstake/lscosmos/v1beta1/governance_proposal.proto"; +import "pstake/lscosmos/v1beta1/lscosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; +// this line is used by starport scaffolding # 1 + +option go_package = "github.com/persistenceOne/pstake-native/v2/x/lscosmos/types"; + +// Query defines the gRPC querier service. +service Query { + option deprecated = true; + // Parameters queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/pstake/lscosmos/v1beta1/params"; + } + // AllState returns all state of module, aka, genesis export. + rpc AllState(QueryAllStateRequest) returns (QueryAllStateResponse) { + option (google.api.http).get = "/pstake/lscosmos/v1beta1/all_state"; + } + + rpc HostChainParams(QueryHostChainParamsRequest) + returns (QueryHostChainParamsResponse) { + option (google.api.http).get = "/pstake/lscosmos/v1beta1/host_chain_params"; + } + + rpc DelegationState(QueryDelegationStateRequest) + returns (QueryDelegationStateResponse) { + option (google.api.http).get = "/pstake/lscosmos/v1beta1/delegation_state"; + } + + rpc AllowListedValidators(QueryAllowListedValidatorsRequest) + returns (QueryAllowListedValidatorsResponse) { + option (google.api.http).get = + "/pstake/lscosmos/v1beta1/allow_listed_validators"; + } + + rpc CValue(QueryCValueRequest) returns (QueryCValueResponse) { + option (google.api.http).get = "/pstake/lscosmos/v1beta1/c_value"; + } + + rpc ModuleState(QueryModuleStateRequest) returns (QueryModuleStateResponse) { + option (google.api.http).get = "/pstake/lscosmos/v1beta1/module_state"; + } + + rpc IBCTransientStore(QueryIBCTransientStoreRequest) + returns (QueryIBCTransientStoreResponse) { + option (google.api.http).get = + "/pstake/lscosmos/v1beta1/ibc_transient_store"; + } + + rpc Unclaimed(QueryUnclaimedRequest) returns (QueryUnclaimedResponse) { + option (google.api.http).get = + "/pstake/lscosmos/v1beta1/unclaimed/{delegator_address}"; + } + + rpc FailedUnbondings(QueryFailedUnbondingsRequest) + returns (QueryFailedUnbondingsResponse) { + option (google.api.http).get = + "/pstake/lscosmos/v1beta1/failed_unbondings/{delegator_address}"; + } + + rpc PendingUnbondings(QueryPendingUnbondingsRequest) + returns (QueryPendingUnbondingsResponse) { + option (google.api.http).get = + "/pstake/lscosmos/v1beta1/pending_unbondings/{delegator_address}"; + } + + rpc UnbondingEpochCValue(QueryUnbondingEpochCValueRequest) + returns (QueryUnbondingEpochCValueResponse) { + option (google.api.http).get = + "/pstake/lscosmos/v1beta1/unbonding_epoch_c_value/{epoch_number}"; + } + + rpc HostAccountUndelegation(QueryHostAccountUndelegationRequest) + returns (QueryHostAccountUndelegationResponse) { + option (google.api.http).get = + "/pstake/lscosmos/v1beta1/host_account_undelegation/{epoch_number}"; + } + + rpc DelegatorUnbondingEpochEntry(QueryDelegatorUnbondingEpochEntryRequest) + returns (QueryDelegatorUnbondingEpochEntryResponse) { + option (google.api.http).get = + "/pstake/lscosmos/v1beta1/delegator_unbonding_epoch_entry/" + "{delegator_address}/{epoch_number}"; + } + + rpc HostAccounts(QueryHostAccountsRequest) + returns (QueryHostAccountsResponse) { + option (google.api.http).get = "/pstake/lscosmos/v1beta1/host_accounts"; + } + + rpc DepositModuleAccount(QueryDepositModuleAccountRequest) + returns (QueryDepositModuleAccountResponse) { + option (google.api.http).get = + "/pstake/lscosmos/v1beta1/deposit_module_account"; + } + + rpc DelegatorUnbondingEpochEntries( + QueryAllDelegatorUnbondingEpochEntriesRequest) + returns (QueryAllDelegatorUnbondingEpochEntriesResponse) { + option (google.api.http).get = + "/pstake/lscosmos/v1beta1/delegator_unbonding_epoch_entries/" + "{delegator_address}"; + } +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryAllStateRequest is request type for the Query/AllState RPC method. +message QueryAllStateRequest {} + +// QueryAllStateResponse is response type for the Query/AllState RPC method. +message QueryAllStateResponse { + // params holds all the parameters of this module. + GenesisState genesis = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryHostChainParamsRequest is request for the Ouery/HostChainParams methods. +message QueryHostChainParamsRequest {} + +// QueryHostChainParamsResponse is response for the Ouery/HostChainParams +// methods. +message QueryHostChainParamsResponse { + HostChainParams host_chain_params = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryDelegationStateRequest is request for the Ouery/DelegationState methods. +message QueryDelegationStateRequest {} + +// QueryDelegationStateResponse is response for the Ouery/DelegationState +// methods. +message QueryDelegationStateResponse { + DelegationState delegation_state = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryListedValidatorsRequest is a request for the Query/AllowListedValidators +// methods. +message QueryAllowListedValidatorsRequest {} + +// QueryListedValidatorsResponse is a response for the +// Query/AllowListedValidators methods. +message QueryAllowListedValidatorsResponse { + AllowListedValidators allow_listed_validators = 1 + [ (gogoproto.nullable) = false ]; +} + +// QueryCValueRequest is a request for the Query/CValue methods. +message QueryCValueRequest {} + +// QueryCValueRequest is a response for the Query/CValue methods. +message QueryCValueResponse { + string c_value = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// QueryModuleStateRequest is a request for the Query/ModuleState methods. +message QueryModuleStateRequest {} + +// QueryModuleStateRequest is a response for the Query/ModuleState methods. +message QueryModuleStateResponse { bool module_state = 1; } + +// QueryIBCTransientStoreRequest is a request for the Query/IBCTransientStore +// methods. +message QueryIBCTransientStoreRequest {} + +// QueryIBCTransientStoreRequest is a response for the Query/IBCTransientStore +// methods. +message QueryIBCTransientStoreResponse { + IBCAmountTransientStore i_b_c_transient_store = 1 + [ (gogoproto.nullable) = false ]; +} + +// QueryUnclaimedRequest is a request for the Query/Unclaimed methods. +message QueryUnclaimedRequest { string delegator_address = 1; } +// QueryUnclaimedResponse is a response for the Query/Unclaimed methods. +message QueryUnclaimedResponse { + repeated UnbondingEpochCValue unclaimed = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryFailedUnbondingsRequest is a request for the Query/FailedUnbondings +// methods. +message QueryFailedUnbondingsRequest { string delegator_address = 1; } + +// QueryFailedUnbondingsResponse a response for the Query/FailedUnbondings +// methods. +message QueryFailedUnbondingsResponse { + repeated UnbondingEpochCValue failed_unbondings = 1 + [ (gogoproto.nullable) = false ]; +} + +// QueryPendingUnbondingsRequest is a request for the Query/PendingUnbondings +// methods. +message QueryPendingUnbondingsRequest { string delegator_address = 1; } + +// QueryPendingUnbondingsResponse is a response for the Query/PendingUnbondings +// methods. +message QueryPendingUnbondingsResponse { + repeated UnbondingEpochCValue pending_unbondings = 1 + [ (gogoproto.nullable) = false ]; +} + +// QueryUnbondingEpochCValueRequest is a request for the +// Query/UnbondingEpochCValue methods. +message QueryUnbondingEpochCValueRequest { int64 epoch_number = 1; } + +// QueryUnbondingEpochCValueResponse is a response for the +// Query/UnbondingEpochCValue methods. +message QueryUnbondingEpochCValueResponse { + UnbondingEpochCValue unbonding_epoch_c_value = 1 + [ (gogoproto.nullable) = false ]; +} + +// QueryHostAccountUndelegationRequest is a request for the +// Query/HostAccountUndelegation methods. +message QueryHostAccountUndelegationRequest { int64 epoch_number = 1; } + +// QueryHostAccountUndelegationResponse is a response for the +// Query/HostAccountUndelegation methods. +message QueryHostAccountUndelegationResponse { + HostAccountUndelegation host_account_undelegation = 1 + [ (gogoproto.nullable) = false ]; +} + +// QueryDelegatorUnbondingEpochEntryRequest is a request for the +// Query/DelegatorUnbondingEpochEntry methods. +message QueryDelegatorUnbondingEpochEntryRequest { + string delegator_address = 1; + int64 epoch_number = 2; +} + +// QueryDelegatorUnbondingEpochEntryResponse is a response for the +// Query/DelegatorUnbondingEpochEntry methods. +message QueryDelegatorUnbondingEpochEntryResponse { + DelegatorUnbondingEpochEntry delegator_unboding_epoch_entry = 1 + [ (gogoproto.nullable) = false ]; +} + +// QueryHostAccountsRequest is a request for the Query/HostAccounts methods. +message QueryHostAccountsRequest {} + +// QueryHostAccountsResponse is a response for the Query/HostAccounts methods. +message QueryHostAccountsResponse { + HostAccounts host_accounts = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryDepositModuleAccountRequest is a request for the +// Query/DepositModuleAccount methods. +message QueryDepositModuleAccountRequest {} + +// QueryDepositModuleAccountResponse is a response for the +// Query/DepositModuleAccount methods. +message QueryDepositModuleAccountResponse { + cosmos.base.v1beta1.Coin balance = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryAllDelegatorUnbondingEpochEntriesRequest is a request for the +// Query/DelegatorUnbondingEpochEntries methods. +message QueryAllDelegatorUnbondingEpochEntriesRequest { + string delegator_address = 1; +} + +// QueryAllDelegatorUnbondingEpochEntriesResponse is a response for the +// Query/DelegatorUnbondingEpochEntries methods. +message QueryAllDelegatorUnbondingEpochEntriesResponse { + repeated DelegatorUnbondingEpochEntry delegator_unbonding_epoch_entries = 1 + [ (gogoproto.nullable) = false ]; +} diff --git a/packages/types/protobuf/proto/pstake/ratesync/v1beta1/contract.proto b/packages/types/protobuf/proto/pstake/ratesync/v1beta1/contract.proto new file mode 100644 index 000000000..049961db7 --- /dev/null +++ b/packages/types/protobuf/proto/pstake/ratesync/v1beta1/contract.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; +package pstake.ratesync.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/persistenceOne/pstake-native/v2/x/ratesync/types"; + +// msg blob for instantiate contract. +message InstantiateLiquidStakeRateContract { + string admin = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + string transfer_channel_i_d = 2; + string transfer_port_i_d = 3; +} + +// wrapper for liquidstakerate as wasm msg should be marshalled as encodedMsg = +// { wasmMsg: { wasm MsgDetails } } +message ExecuteLiquidStakeRate { + LiquidStakeRate liquid_stake_rate = 1 [ (gogoproto.nullable) = false ]; +} + +// msg blob for execute contract. +message LiquidStakeRate { + string default_bond_denom = 1; + string stk_denom = 2; + // cvalue = default_bond_denom_price/stk_denom_price + // cvalue = stk_denom_supply/default_bond_denom_supply + string c_value = 3 [ + (gogoproto.nullable) = false, + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec" + ]; + int64 controller_chain_time = 4; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/pstake/ratesync/v1beta1/genesis.proto b/packages/types/protobuf/proto/pstake/ratesync/v1beta1/genesis.proto new file mode 100644 index 000000000..b02b2319b --- /dev/null +++ b/packages/types/protobuf/proto/pstake/ratesync/v1beta1/genesis.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package pstake.ratesync.v1beta1; + +import "gogoproto/gogo.proto"; +import "pstake/ratesync/v1beta1/params.proto"; +import "pstake/ratesync/v1beta1/ratesync.proto"; + +option go_package = "github.com/persistenceOne/pstake-native/v2/x/ratesync/types"; + +// GenesisState defines the ratesync module's genesis state. +message GenesisState { + Params params = 1 [ (gogoproto.nullable) = false ]; + repeated HostChain host_chains = 2 [ (gogoproto.nullable) = false ]; +} diff --git a/packages/types/protobuf/proto/pstake/ratesync/v1beta1/params.proto b/packages/types/protobuf/proto/pstake/ratesync/v1beta1/params.proto new file mode 100644 index 000000000..a1ae5452c --- /dev/null +++ b/packages/types/protobuf/proto/pstake/ratesync/v1beta1/params.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package pstake.ratesync.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/persistenceOne/pstake-native/v2/x/ratesync/types"; + +// Params defines the parameters for the module. +message Params { + option (gogoproto.goproto_stringer) = false; + + string admin = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} diff --git a/packages/types/protobuf/proto/pstake/ratesync/v1beta1/query.proto b/packages/types/protobuf/proto/pstake/ratesync/v1beta1/query.proto new file mode 100644 index 000000000..61933ce7b --- /dev/null +++ b/packages/types/protobuf/proto/pstake/ratesync/v1beta1/query.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; +package pstake.ratesync.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "pstake/ratesync/v1beta1/params.proto"; +import "pstake/ratesync/v1beta1/ratesync.proto"; + +option go_package = "github.com/persistenceOne/pstake-native/v2/x/ratesync/types"; + +// Query defines the gRPC querier service. +service Query { + // Parameters queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/pstake/ratesync/v1beta1/params"; + } + + // Queries a list of Chain items. + rpc HostChain(QueryGetHostChainRequest) returns (QueryGetHostChainResponse) { + option (google.api.http).get = + "/pstake-native/v2/ratesync/host_chain/{i_d}"; + } + rpc AllHostChains(QueryAllHostChainsRequest) + returns (QueryAllHostChainsResponse) { + option (google.api.http).get = "/pstake-native/v2/ratesync/host_chains"; + } +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryGetHostChainRequest { uint64 i_d = 1; } + +message QueryGetHostChainResponse { + HostChain host_chain = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryAllHostChainsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllHostChainsResponse { + repeated HostChain host_chains = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/packages/types/protobuf/proto/pstake/ratesync/v1beta1/ratesync.proto b/packages/types/protobuf/proto/pstake/ratesync/v1beta1/ratesync.proto new file mode 100644 index 000000000..af1931a20 --- /dev/null +++ b/packages/types/protobuf/proto/pstake/ratesync/v1beta1/ratesync.proto @@ -0,0 +1,71 @@ +syntax = "proto3"; +package pstake.ratesync.v1beta1; + +import "gogoproto/gogo.proto"; +import "pstake/liquidstakeibc/v1beta1/liquidstakeibc.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/persistenceOne/pstake-native/v2/x/ratesync/types"; + +// HostChain defines the ratesync module's HostChain state. +message HostChain { + // unique id + uint64 i_d = 1; + string chain_i_d = 2; // not really required, just easier readability + string connection_i_d = 3; + pstake.liquidstakeibc.v1beta1.ICAAccount i_c_a_account = 4 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + Feature features = 5 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + string transfer_channel_i_d = 6; + string transfer_port_i_d = 7; +} + +message Feature { + // triggers on hooks + LiquidStake liquid_stake_i_b_c = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + + // triggers on hour epoch + LiquidStake liquid_stake = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + + // add more features +} + +enum InstantiationState { + // Not Initiated + INSTANTIATION_NOT_INITIATED = 0; + // Initiated + INSTANTIATION_INITIATED = 1; + // we should have an address + INSTANTIATION_COMPLETED = 2; +} + +enum FeatureType { + LIQUID_STAKE_IBC = 0; + LIQUID_STAKE = 1; +} + +message LiquidStake { + FeatureType feature_type = 1; + + // needs to be uploaded before hand + uint64 code_i_d = 2; + // state of instantiation, do not support gov based instantiation. (need ICA + // to be at least admin) + InstantiationState instantiation = 3; + // address of instantiated contract. + string contract_address = 4; + // allow * as default for all denoms in case of lsibc, or default bond denom + // in case of ls. + repeated string denoms = 5; + + bool enabled = 6; +} + +// aim to keep this smaller than 256 MaxCharLen in ICA memo. +message ICAMemo { + FeatureType feature_type = 1; + uint64 host_chain_i_d = 2; +} diff --git a/packages/types/protobuf/proto/pstake/ratesync/v1beta1/tx.proto b/packages/types/protobuf/proto/pstake/ratesync/v1beta1/tx.proto new file mode 100644 index 000000000..883add883 --- /dev/null +++ b/packages/types/protobuf/proto/pstake/ratesync/v1beta1/tx.proto @@ -0,0 +1,63 @@ +syntax = "proto3"; +package pstake.ratesync.v1beta1; + +import "cosmos/msg/v1/msg.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; +import "pstake/ratesync/v1beta1/params.proto"; +import "pstake/ratesync/v1beta1/ratesync.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/persistenceOne/pstake-native/v2/x/ratesync/types"; + +// Msg defines the Msg service. +service Msg { + rpc CreateHostChain(MsgCreateHostChain) returns (MsgCreateHostChainResponse); + rpc UpdateHostChain(MsgUpdateHostChain) returns (MsgUpdateHostChainResponse); + rpc DeleteHostChain(MsgDeleteHostChain) returns (MsgDeleteHostChainResponse); + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +message MsgCreateHostChain { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "pstake/ratesync/MsgCreateHostChain"; + + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + HostChain host_chain = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +message MsgCreateHostChainResponse { uint64 i_d = 1; } + +message MsgUpdateHostChain { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "pstake/ratesync/MsgUpdateHostChain"; + + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + HostChain host_chain = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +message MsgUpdateHostChainResponse {} + +message MsgDeleteHostChain { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "pstake/ratesync/MsgDeleteHostChain"; + + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + uint64 i_d = 2; +} + +message MsgDeleteHostChainResponse {} + +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "pstake/ratesync/MsgUpdateParams"; + + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + Params params = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/packages/types/protobuf/scripts/codegen.js b/packages/types/protobuf/scripts/codegen.js index fa793c1e0..a6c49b96d 100644 --- a/packages/types/protobuf/scripts/codegen.js +++ b/packages/types/protobuf/scripts/codegen.js @@ -111,6 +111,10 @@ telescope({ 'kujira.denom', 'kujira.oracle', 'kujira.scheduler', + 'pstake.liquidstake.v1beta1', + 'pstake.liquidstakeibc.v1beta1', + 'pstake.lscosmos.v1beta1', + 'pstake.ratesync.v1beta1', ], }, // excluded: { From d45cf83b973ee573b6d75e3a66394118cadc69e0 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 2 May 2024 12:14:39 -0400 Subject: [PATCH 136/438] registered pstake protos --- packages/types/protobuf/utils.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/types/protobuf/utils.ts b/packages/types/protobuf/utils.ts index 32085c167..5652a8a06 100644 --- a/packages/types/protobuf/utils.ts +++ b/packages/types/protobuf/utils.ts @@ -39,6 +39,8 @@ import { neutronProtoRegistry, osmosisAminoConverters, osmosisProtoRegistry, + pstakeAminoConverters, + pstakeProtoRegistry, regenAminoConverters, regenProtoRegistry, publicawesomeAminoConverters as stargazeAminoConverters, @@ -555,6 +557,7 @@ export const PROTOBUF_TYPES: ReadonlyArray<[string, GeneratedType]> = [ ...allianceProtoRegistry, ...circleProtoRegistry, ...kujiraProtoRegistry, + ...pstakeProtoRegistry, // Not a query or TX so it isn't included in any of the registries. But we // want to decode this because it appears in gov props. We need to find a // better way to collect all generated types in a single registry... @@ -592,6 +595,7 @@ export const aminoTypes = new AminoTypes({ ...allianceAminoConverters, ...circleAminoConverters, ...kujiraAminoConverters, + ...pstakeAminoConverters, }) // Encodes a protobuf message value from its JSON representation into a byte From 7e41d10b862d1855f302b3f038d1ebeb480036ed Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 2 May 2024 13:57:03 -0400 Subject: [PATCH 137/438] fixed finding instantiated contract address from tx events --- packages/utils/client.ts | 16 ++++++++++++++++ packages/utils/contracts.ts | 14 +++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/packages/utils/client.ts b/packages/utils/client.ts index 9c2cd1d8e..b2c760029 100644 --- a/packages/utils/client.ts +++ b/packages/utils/client.ts @@ -114,3 +114,19 @@ export const findWasmAttributeValue = ( ) return wasmEvent?.attributes.find(({ key }) => key === attributeKey)!.value } + +/** + * In response events from a transaction, gets the first attribute value for an + * attribute key in the first event of a given type. + */ +export const findEventsAttributeValue = ( + events: readonly Event[], + eventType: string, + attributeKey: string +): string | undefined => + events.flatMap( + ({ type, attributes }) => + (type === eventType && + attributes.find(({ key }) => key === attributeKey)) || + [] + )[0]?.value diff --git a/packages/utils/contracts.ts b/packages/utils/contracts.ts index e737224a8..e9f82db6a 100644 --- a/packages/utils/contracts.ts +++ b/packages/utils/contracts.ts @@ -1,9 +1,9 @@ import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate' import { Coin, SigningStargateClient } from '@cosmjs/stargate' -import { findAttribute, parseRawLog } from '@cosmjs/stargate/build/logs' import { ContractVersion, cwMsgToEncodeObject } from '@dao-dao/types' +import { findEventsAttributeValue } from './client' import { CHAIN_GAS_MULTIPLIER } from './constants' import { encodeJsonToBase64 } from './messages' @@ -42,7 +42,7 @@ export const instantiateSmartContract = async ( funds?: Coin[], admin?: string | null ): Promise => { - const { rawLog } = await client.signAndBroadcast( + const { events } = await client.signAndBroadcast( sender, [ cwMsgToEncodeObject( @@ -64,11 +64,15 @@ export const instantiateSmartContract = async ( CHAIN_GAS_MULTIPLIER ) - const contractAddress = findAttribute( - parseRawLog(rawLog), + const contractAddress = findEventsAttributeValue( + events, 'instantiate', '_contract_address' - ).value + ) + + if (!contractAddress) { + throw new Error('Contract address not found') + } return contractAddress } From 264b4b731bbea21232ff44b41ca187c9d1110f6b Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 2 May 2024 14:43:04 -0400 Subject: [PATCH 138/438] use bigint to convert numbers to strings --- .../core/authorizations/AuthzGrantRevoke/index.tsx | 10 +++++----- .../actions/core/smart_contracting/Execute/index.tsx | 5 ++--- .../core/treasury/ManageVesting/RegisterSlash.tsx | 7 +++++-- .../actions/core/treasury/ManageVesting/index.tsx | 4 ++-- .../token_swap/stateful/InstantiateTokenSwap.tsx | 9 +++++---- packages/stateful/components/dao/tabs/HomeTab.tsx | 2 +- .../components/profile/ProfileProposalCard.tsx | 2 +- .../TokenBased/GovernanceConfigurationInput.tsx | 2 +- packages/stateful/creators/TokenBased/mutate.ts | 12 ++++++++---- .../common/actions/UpdatePreProposeConfig/index.tsx | 6 +++--- .../common/hooks/makeUsePublishProposal.ts | 2 +- .../daoCreation/getInstantiateInfo.ts | 6 +++--- .../actions/UpdatePreProposeSingleConfig/index.tsx | 6 +++--- .../common/actions/UpdateProposalConfigV1/index.tsx | 6 +++--- .../common/hooks/makeUsePublishProposal.ts | 2 +- .../daoCreation/getInstantiateInfo.ts | 6 +++--- .../DaoVotingCw20Staked/actions/Mint/index.tsx | 2 +- .../DaoVotingCw20Staked/components/StakingModal.tsx | 4 ++-- .../components/StakingModal.tsx | 5 ++--- .../DaoVotingTokenStaked/components/StakingModal.tsx | 5 ++--- .../components/StakingModal.tsx | 5 ++--- .../Renderer/components/stateful/NewSurveyForm.tsx | 10 +++++----- .../RetroactiveCompensation/Renderer/utils.ts | 8 ++++---- .../VestingPayments/Renderer/TabRenderer/index.tsx | 2 +- .../stateless/components/dao/tabs/MembersTab.tsx | 4 +++- packages/utils/conversion.ts | 2 +- packages/utils/messages/cw.ts | 2 +- packages/utils/vesting.ts | 2 +- 28 files changed, 72 insertions(+), 66 deletions(-) diff --git a/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/index.tsx b/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/index.tsx index 4793ff1d7..2bfc31f05 100644 --- a/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/index.tsx +++ b/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/index.tsx @@ -36,7 +36,7 @@ import { } from '@dao-dao/types/protobuf/codegen/cosmwasm/wasm/v1/authz' import { Any } from '@dao-dao/types/protobuf/codegen/google/protobuf/any' import { - convertDenomToMicroDenomWithDecimals, + convertDenomToMicroDenomStringWithDecimals, convertMicroDenomToDenomWithDecimals, decodePolytoneExecuteMsg, getChainAddressForActionOptions, @@ -345,10 +345,10 @@ export const makeAuthzGrantRevokeAction: ActionMaker = ( // MaxFundsLimit // CombinedLimit amounts: funds.map(({ denom, amount }) => ({ - amount: convertDenomToMicroDenomWithDecimals( + amount: convertDenomToMicroDenomStringWithDecimals( amount, getTokenForChainIdAndDenom(chainId, denom).decimals - ).toString(), + ), denom, })), }) @@ -362,10 +362,10 @@ export const makeAuthzGrantRevokeAction: ActionMaker = ( msg: msgTypeUrl, // SendAuthorization spendLimit: funds.map(({ denom, amount }) => ({ - amount: convertDenomToMicroDenomWithDecimals( + amount: convertDenomToMicroDenomStringWithDecimals( amount, getTokenForChainIdAndDenom(chainId, denom).decimals - ).toString(), + ), denom, })), allowList: [], diff --git a/packages/stateful/actions/core/smart_contracting/Execute/index.tsx b/packages/stateful/actions/core/smart_contracting/Execute/index.tsx index 38cad7d32..cadc001f0 100644 --- a/packages/stateful/actions/core/smart_contracting/Execute/index.tsx +++ b/packages/stateful/actions/core/smart_contracting/Execute/index.tsx @@ -24,7 +24,6 @@ import { } from '@dao-dao/types/actions' import { convertDenomToMicroDenomStringWithDecimals, - convertDenomToMicroDenomWithDecimals, convertMicroDenomToDenomWithDecimals, decodeJsonFromBase64, decodePolytoneExecuteMsg, @@ -121,10 +120,10 @@ const useTransformToCosmos: UseTransformToCosmos = () => { contract_addr: address, funds: funds.map(({ denom, amount }, index) => ({ denom, - amount: convertDenomToMicroDenomWithDecimals( + amount: convertDenomToMicroDenomStringWithDecimals( amount, fundsTokens[index]!.decimals - ).toString(), + ), })), msg, }, diff --git a/packages/stateful/actions/core/treasury/ManageVesting/RegisterSlash.tsx b/packages/stateful/actions/core/treasury/ManageVesting/RegisterSlash.tsx index 7dd874c7b..7c24fbc69 100644 --- a/packages/stateful/actions/core/treasury/ManageVesting/RegisterSlash.tsx +++ b/packages/stateful/actions/core/treasury/ManageVesting/RegisterSlash.tsx @@ -89,7 +89,10 @@ export const RegisterSlash: ActionComponent = ({ setValue((fieldNamePrefix + 'address') as 'address', address) setValue((fieldNamePrefix + 'validator') as 'validator', validator) // Milliseconds to nanoseconds. - setValue((fieldNamePrefix + 'time') as 'time', (timeMs * 1e6).toString()) + setValue( + (fieldNamePrefix + 'time') as 'time', + BigInt(timeMs * 1e6).toString() + ) setValue( (fieldNamePrefix + 'amount') as 'amount', unregisteredAmount.toString() @@ -232,7 +235,7 @@ const RenderVest = ({ } selected={ data.address === vestingContractAddress && - data.time === (slash.timeMs * 1e6).toString() && + data.time === BigInt(slash.timeMs * 1e6).toString() && data.duringUnbonding === slash.duringUnbonding } />, diff --git a/packages/stateful/actions/core/treasury/ManageVesting/index.tsx b/packages/stateful/actions/core/treasury/ManageVesting/index.tsx index 38310de8d..4b358d5cb 100644 --- a/packages/stateful/actions/core/treasury/ManageVesting/index.tsx +++ b/packages/stateful/actions/core/treasury/ManageVesting/index.tsx @@ -658,8 +658,8 @@ export const makeManageVestingAction: ActionMaker = ( start_time: begin.startDate && !isNaN(Date.parse(begin.startDate)) ? // milliseconds => nanoseconds - Math.round( - new Date(begin.startDate).getTime() * 1e6 + BigInt( + Math.round(new Date(begin.startDate).getTime() * 1e6) ).toString() : '', title: begin.title, diff --git a/packages/stateful/actions/core/treasury/token_swap/stateful/InstantiateTokenSwap.tsx b/packages/stateful/actions/core/treasury/token_swap/stateful/InstantiateTokenSwap.tsx index 4b6b27674..9fd55e404 100644 --- a/packages/stateful/actions/core/treasury/token_swap/stateful/InstantiateTokenSwap.tsx +++ b/packages/stateful/actions/core/treasury/token_swap/stateful/InstantiateTokenSwap.tsx @@ -15,6 +15,7 @@ import { } from '@dao-dao/types' import { InstantiateMsg } from '@dao-dao/types/contracts/CwTokenSwap' import { + convertDenomToMicroDenomStringWithDecimals, convertDenomToMicroDenomWithDecimals, getNativeTokenForChainId, instantiateSmartContract, @@ -78,19 +79,19 @@ export const InstantiateTokenSwap: ActionComponent< ? { cw20: { contract_addr: selfParty.denomOrAddress, - amount: convertDenomToMicroDenomWithDecimals( + amount: convertDenomToMicroDenomStringWithDecimals( selfParty.amount, selfParty.decimals - ).toString(), + ), }, } : { native: { denom: selfParty.denomOrAddress, - amount: convertDenomToMicroDenomWithDecimals( + amount: convertDenomToMicroDenomStringWithDecimals( selfParty.amount, selfParty.decimals - ).toString(), + ), }, }, }, diff --git a/packages/stateful/components/dao/tabs/HomeTab.tsx b/packages/stateful/components/dao/tabs/HomeTab.tsx index a6fa680a1..9e8b0dd0b 100644 --- a/packages/stateful/components/dao/tabs/HomeTab.tsx +++ b/packages/stateful/components/dao/tabs/HomeTab.tsx @@ -84,7 +84,7 @@ export const HomeTab = () => { 0 - ? maxGovernanceTokenProposalModuleDeposit.toString() + ? BigInt(maxGovernanceTokenProposalModuleDeposit).toString() : undefined } /> diff --git a/packages/stateful/components/profile/ProfileProposalCard.tsx b/packages/stateful/components/profile/ProfileProposalCard.tsx index ae30b5ccb..1a0c50426 100644 --- a/packages/stateful/components/profile/ProfileProposalCard.tsx +++ b/packages/stateful/components/profile/ProfileProposalCard.tsx @@ -131,7 +131,7 @@ export const ProfileProposalCard = () => { cantVoteOnProposal maxGovernanceTokenDeposit={ maxGovernanceTokenProposalModuleDeposit > 0 - ? maxGovernanceTokenProposalModuleDeposit.toString() + ? BigInt(maxGovernanceTokenProposalModuleDeposit).toString() : undefined } /> diff --git a/packages/stateful/creators/TokenBased/GovernanceConfigurationInput.tsx b/packages/stateful/creators/TokenBased/GovernanceConfigurationInput.tsx index 33e69d262..fab7d8015 100644 --- a/packages/stateful/creators/TokenBased/GovernanceConfigurationInput.tsx +++ b/packages/stateful/creators/TokenBased/GovernanceConfigurationInput.tsx @@ -253,7 +253,7 @@ export const GovernanceConfigurationInput = ({ 'creator.data.existingTokenSupply', existingGovernanceTokenSupply.state === 'hasValue' ? typeof existingGovernanceTokenSupply.contents === 'number' - ? existingGovernanceTokenSupply.contents.toString() + ? BigInt(existingGovernanceTokenSupply.contents).toString() : existingGovernanceTokenSupply.contents?.total_supply : undefined ) diff --git a/packages/stateful/creators/TokenBased/mutate.ts b/packages/stateful/creators/TokenBased/mutate.ts index 31ff0cdea..fa6697a84 100644 --- a/packages/stateful/creators/TokenBased/mutate.ts +++ b/packages/stateful/creators/TokenBased/mutate.ts @@ -7,6 +7,7 @@ import { import { NEW_DAO_TOKEN_DECIMALS, TokenBasedCreatorId, + convertDenomToMicroDenomStringWithDecimals, convertDenomToMicroDenomWithDecimals, convertDurationWithUnitsToDuration, encodeJsonToBase64, @@ -59,22 +60,25 @@ export const mutate: DaoCreatorMutate = ( ({ weight, members }) => members.map(({ address }) => ({ address, - amount: convertDenomToMicroDenomWithDecimals( + amount: convertDenomToMicroDenomStringWithDecimals( // Governance Token-based DAOs distribute tier weights evenly // amongst members. (weight / members.length / 100) * initialSupply, NEW_DAO_TOKEN_DECIMALS - ).toString(), + ), })) ) // To prevent rounding issues, treasury balance becomes the remaining tokens // after the member weights are distributed. - const microInitialTreasuryBalance = ( + const microInitialTreasuryBalance = BigInt( convertDenomToMicroDenomWithDecimals( initialSupply, NEW_DAO_TOKEN_DECIMALS ) - - microInitialBalances.reduce((acc, { amount }) => acc + Number(amount), 0) + microInitialBalances.reduce( + (acc, { amount }) => acc + Number(amount), + 0 + ) ).toString() votingModuleAdapterInstantiateMsg = isNative diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/actions/UpdatePreProposeConfig/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/actions/UpdatePreProposeConfig/index.tsx index a12ac0714..439f35801 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/actions/UpdatePreProposeConfig/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/actions/UpdatePreProposeConfig/index.tsx @@ -25,7 +25,7 @@ import { } from '@dao-dao/types/contracts/DaoPreProposeMultiple' import { DAO_PRE_PROPOSE_MULTIPLE_CONTRACT_NAMES, - convertDenomToMicroDenomWithDecimals, + convertDenomToMicroDenomStringWithDecimals, convertMicroDenomToDenomWithDecimals, getNativeTokenForChainId, isValidBech32Address, @@ -240,10 +240,10 @@ export const makeUpdatePreProposeConfigActionMaker = update_config: { deposit_info: depositRequired ? { - amount: convertDenomToMicroDenomWithDecimals( + amount: convertDenomToMicroDenomStringWithDecimals( depositInfo.amount, depositInfo.token?.decimals ?? 0 - ).toString(), + ), denom: depositInfo.type === 'voting_module_token' ? { diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/hooks/makeUsePublishProposal.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/hooks/makeUsePublishProposal.ts index ebf202c3a..e16281522 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/hooks/makeUsePublishProposal.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/hooks/makeUsePublishProposal.ts @@ -308,7 +308,7 @@ export const makeUsePublishProposal = if (remainingAllowanceNeeded) { try { await increaseCw20DepositAllowance({ - amount: remainingAllowanceNeeded.toString(), + amount: BigInt(remainingAllowanceNeeded).toString(), spender: // If pre-propose address set, give that one deposit allowance // instead of proposal module. diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/daoCreation/getInstantiateInfo.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/daoCreation/getInstantiateInfo.ts index 070fe11ed..9157a12c5 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/daoCreation/getInstantiateInfo.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/daoCreation/getInstantiateInfo.ts @@ -3,7 +3,7 @@ import { InstantiateMsg as DaoPreProposeMultipleInstantiateMsg } from '@dao-dao/ import { InstantiateMsg as DaoProposalMultipleInstantiateMsg } from '@dao-dao/types/contracts/DaoProposalMultiple' import { DaoProposalMultipleAdapterId, - convertDenomToMicroDenomWithDecimals, + convertDenomToMicroDenomStringWithDecimals, convertDurationWithUnitsToDuration, convertVetoConfigToCosmos, encodeJsonToBase64, @@ -39,10 +39,10 @@ export const getInstantiateInfo: DaoCreationGetInstantiateInfo< { deposit_info: proposalDeposit.enabled ? { - amount: convertDenomToMicroDenomWithDecimals( + amount: convertDenomToMicroDenomStringWithDecimals( proposalDeposit.amount, decimals - ).toString(), + ), denom: proposalDeposit.type === 'voting_module_token' ? { diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdatePreProposeSingleConfig/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdatePreProposeSingleConfig/index.tsx index a9f1bce85..a994dd0b1 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdatePreProposeSingleConfig/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdatePreProposeSingleConfig/index.tsx @@ -26,7 +26,7 @@ import { import { ContractName, DAO_PRE_PROPOSE_SINGLE_CONTRACT_NAMES, - convertDenomToMicroDenomWithDecimals, + convertDenomToMicroDenomStringWithDecimals, convertMicroDenomToDenomWithDecimals, getNativeTokenForChainId, isValidBech32Address, @@ -246,10 +246,10 @@ export const makeUpdatePreProposeSingleConfigActionMaker = update_config: { deposit_info: depositRequired ? { - amount: convertDenomToMicroDenomWithDecimals( + amount: convertDenomToMicroDenomStringWithDecimals( depositInfo.amount, depositInfo.token?.decimals ?? 0 - ).toString(), + ), denom: depositInfo.type === 'voting_module_token' ? { diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdateProposalConfigV1/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdateProposalConfigV1/index.tsx index 319d23eb1..0ad9d7214 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdateProposalConfigV1/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdateProposalConfigV1/index.tsx @@ -18,7 +18,7 @@ import { import { Threshold } from '@dao-dao/types/contracts/DaoProposalSingle.common' import { DAO_PROPOSAL_SINGLE_CONTRACT_NAMES, - convertDenomToMicroDenomWithDecimals, + convertDenomToMicroDenomStringWithDecimals, convertDurationToDurationWithUnits, convertDurationWithUnitsToDuration, convertMicroDenomToDenomWithDecimals, @@ -226,10 +226,10 @@ export const makeUpdateProposalConfigV1ActionMaker = ...(data.depositInfo && data.depositRequired && { deposit_info: { - deposit: convertDenomToMicroDenomWithDecimals( + deposit: convertDenomToMicroDenomStringWithDecimals( data.depositInfo.deposit, voteConversionDecimals - ).toString(), + ), refund_failed_proposals: data.depositInfo.refundFailedProposals, token: { voting_module_token: {} }, diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/makeUsePublishProposal.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/makeUsePublishProposal.ts index 75a37dfca..7712ae087 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/makeUsePublishProposal.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/makeUsePublishProposal.ts @@ -283,7 +283,7 @@ export const makeUsePublishProposal = if (remainingAllowanceNeeded) { try { await increaseCw20DepositAllowance({ - amount: remainingAllowanceNeeded.toString(), + amount: BigInt(remainingAllowanceNeeded).toString(), spender: // If pre-propose address set, give that one deposit allowance // instead of proposal module. diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/getInstantiateInfo.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/getInstantiateInfo.ts index 24140dadb..dd865e385 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/getInstantiateInfo.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/getInstantiateInfo.ts @@ -8,7 +8,7 @@ import { PercentageThreshold } from '@dao-dao/types/contracts/DaoProposalSingle. import { InstantiateMsg as DaoProposalSingleInstantiateMsg } from '@dao-dao/types/contracts/DaoProposalSingle.v2' import { DaoProposalSingleAdapterId, - convertDenomToMicroDenomWithDecimals, + convertDenomToMicroDenomStringWithDecimals, convertDurationWithUnitsToDuration, convertVetoConfigToCosmos, encodeJsonToBase64, @@ -46,10 +46,10 @@ export const getInstantiateInfo: DaoCreationGetInstantiateInfo< | DaoPreProposeApprovalSingleInstantiateMsg = { deposit_info: proposalDeposit.enabled ? { - amount: convertDenomToMicroDenomWithDecimals( + amount: convertDenomToMicroDenomStringWithDecimals( proposalDeposit.amount, decimals - ).toString(), + ), denom: proposalDeposit.type === 'voting_module_token' ? { diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/Mint/index.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/Mint/index.tsx index dbb260bf0..903b4891e 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/Mint/index.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/Mint/index.tsx @@ -35,7 +35,7 @@ const useTransformToCosmos: UseTransformToCosmos = () => { governanceToken.decimals ) return makeExecutableMintMessage( - makeMintMessage(amount.toString(), data.to), + makeMintMessage(BigInt(amount).toString(), data.to), governanceToken.denomOrAddress ) }, diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/StakingModal.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/StakingModal.tsx index b935bb4b4..9f1d9f3f4 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/StakingModal.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/StakingModal.tsx @@ -173,10 +173,10 @@ const InnerStakingModal = ({ try { await doCw20SendAndExecute({ - amount: convertDenomToMicroDenomWithDecimals( + amount: convertDenomToMicroDenomStringWithDecimals( amount, governanceToken.decimals - ).toString(), + ), contract: stakingContractToExecute, msg: encodeJsonToBase64({ [isOraichainCustomStaking ? 'bond' : 'stake']: {}, diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/StakingModal.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/StakingModal.tsx index f0a77c88d..c4493614d 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/StakingModal.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/StakingModal.tsx @@ -18,7 +18,6 @@ import { BaseStakingModalProps } from '@dao-dao/types' import { CHAIN_GAS_MULTIPLIER, convertDenomToMicroDenomStringWithDecimals, - convertDenomToMicroDenomWithDecimals, convertMicroDenomToDenomWithDecimals, processError, } from '@dao-dao/utils' @@ -149,10 +148,10 @@ const InnerStakingModal = ({ try { await doUnstake({ - amount: convertDenomToMicroDenomWithDecimals( + amount: convertDenomToMicroDenomStringWithDecimals( amount, governanceToken.decimals - ).toString(), + ), }) // New balances will not appear until the next block. diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/StakingModal.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/StakingModal.tsx index 8959aecea..a994ebaba 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/StakingModal.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/StakingModal.tsx @@ -18,7 +18,6 @@ import { BaseStakingModalProps } from '@dao-dao/types' import { CHAIN_GAS_MULTIPLIER, convertDenomToMicroDenomStringWithDecimals, - convertDenomToMicroDenomWithDecimals, convertMicroDenomToDenomWithDecimals, processError, } from '@dao-dao/utils' @@ -149,10 +148,10 @@ const InnerStakingModal = ({ try { await doUnstake({ - amount: convertDenomToMicroDenomWithDecimals( + amount: convertDenomToMicroDenomStringWithDecimals( amount, governanceToken.decimals - ).toString(), + ), }) // New balances will not appear until the next block. diff --git a/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/StakingModal.tsx b/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/StakingModal.tsx index 283949b55..821336f13 100644 --- a/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/StakingModal.tsx +++ b/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/StakingModal.tsx @@ -22,7 +22,6 @@ import { BaseStakingModalProps } from '@dao-dao/types' import { CHAIN_GAS_MULTIPLIER, convertDenomToMicroDenomStringWithDecimals, - convertDenomToMicroDenomWithDecimals, convertMicroDenomToDenomWithDecimals, processError, tokensEqual, @@ -205,10 +204,10 @@ const InnerStakingModal = ({ try { await doUnstake({ - amount: convertDenomToMicroDenomWithDecimals( + amount: convertDenomToMicroDenomStringWithDecimals( amount, selectedVault.bondToken.decimals - ).toString(), + ), }) // New balances will not appear until the next block. diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/NewSurveyForm.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/NewSurveyForm.tsx index c521973bd..d7f09bfb6 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/NewSurveyForm.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/NewSurveyForm.tsx @@ -11,7 +11,7 @@ import { useDaoInfoContext, } from '@dao-dao/stateless' import { TokenType } from '@dao-dao/types' -import { convertDenomToMicroDenomWithDecimals } from '@dao-dao/utils' +import { convertDenomToMicroDenomStringWithDecimals } from '@dao-dao/utils' import { SuspenseLoader } from '../../../../../../components' import { useCw20CommonGovernanceTokenInfoIfExists } from '../../../../../../voting-module-adapter/react/hooks/useCw20CommonGovernanceTokenInfoIfExists' @@ -105,18 +105,18 @@ export const NewSurveyForm = () => { if (cw20Decimals !== undefined) { cw20Tokens.push({ address: denomOrAddress, - amount: convertDenomToMicroDenomWithDecimals( + amount: convertDenomToMicroDenomStringWithDecimals( amount, cw20Decimals - ).toString(), + ), }) } else if (nativeDecimals !== undefined) { nativeTokens.push({ denom: denomOrAddress, - amount: convertDenomToMicroDenomWithDecimals( + amount: convertDenomToMicroDenomStringWithDecimals( amount, nativeDecimals - ).toString(), + ), }) } else { // Should never happen, but just in case. diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts index d125f7b76..5bc380548 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts @@ -71,8 +71,8 @@ export const computeCompensation = ( const nativeTokens = attribute.nativeTokens.map( ({ denom, amount }): AnyToken => ({ denomOrAddress: denom, - amount: Math.floor( - Number(amount) * proportionalCompensation + amount: BigInt( + Math.floor(Number(amount) * proportionalCompensation) ).toString(), }) ) @@ -80,8 +80,8 @@ export const computeCompensation = ( const cw20Tokens = attribute.cw20Tokens.map( ({ address, amount }): AnyToken => ({ denomOrAddress: address, - amount: Math.floor( - Number(amount) * proportionalCompensation + amount: BigInt( + Math.floor(Number(amount) * proportionalCompensation) ).toString(), }) ) diff --git a/packages/stateful/widgets/widgets/VestingPayments/Renderer/TabRenderer/index.tsx b/packages/stateful/widgets/widgets/VestingPayments/Renderer/TabRenderer/index.tsx index b128b0c7f..84442abaf 100644 --- a/packages/stateful/widgets/widgets/VestingPayments/Renderer/TabRenderer/index.tsx +++ b/packages/stateful/widgets/widgets/VestingPayments/Renderer/TabRenderer/index.tsx @@ -135,7 +135,7 @@ export const TabRenderer = ({ address: vestingContractAddress, validator: validatorOperatorAddress, // Milliseconds to nanoseconds. - time: (slash.timeMs * 1e6).toString(), + time: BigInt(slash.timeMs * 1e6).toString(), amount: slash.unregisteredAmount.toString(), duringUnbonding: slash.duringUnbonding, }, diff --git a/packages/stateless/components/dao/tabs/MembersTab.tsx b/packages/stateless/components/dao/tabs/MembersTab.tsx index 26641a7b5..8c47e67a8 100644 --- a/packages/stateless/components/dao/tabs/MembersTab.tsx +++ b/packages/stateless/components/dao/tabs/MembersTab.tsx @@ -298,7 +298,9 @@ export const MembersTab = ({ ...members.data.map( ({ address, balance, votingPowerPercent }) => [ address, - balance.loading ? '...' : balance.data.amount.toString(), + balance.loading + ? '...' + : BigInt(balance.data.amount).toString(), votingPowerPercent.loading ? '...' : votingPowerPercent.data, ] ), diff --git a/packages/utils/conversion.ts b/packages/utils/conversion.ts index f003f5c56..a7e7cc39a 100644 --- a/packages/utils/conversion.ts +++ b/packages/utils/conversion.ts @@ -70,7 +70,7 @@ export const expirationAtTimeToSecondsFromNow = (exp: Expiration) => { } export const zeroPad = (num: number, target: number) => { - const s = num.toString() + const s = BigInt(num).toString() if (s.length >= target) { return s } diff --git a/packages/utils/messages/cw.ts b/packages/utils/messages/cw.ts index 2282c25a5..b2a6d3da0 100644 --- a/packages/utils/messages/cw.ts +++ b/packages/utils/messages/cw.ts @@ -329,7 +329,7 @@ export const maybeMakePolytoneExecuteMessage = ( msg: { execute: { msgs: msg ? [msg].flat() : [], - timeout_seconds: IBC_TIMEOUT_SECONDS.toString(), + timeout_seconds: BigInt(IBC_TIMEOUT_SECONDS).toString(), callback: { msg: toBase64(toUtf8(uuidv4())), receiver: polytoneConnection?.listener, diff --git a/packages/utils/vesting.ts b/packages/utils/vesting.ts index 50f4f58a0..f1522ee9f 100644 --- a/packages/utils/vesting.ts +++ b/packages/utils/vesting.ts @@ -129,7 +129,7 @@ export const getVestingValidatorSlashes = ( registration.validator === validatorOperatorAddress && registration.time === // milliseconds to nanoseconds - (Number(slash.registeredBlockTimeUnixMs) * 1e6).toString() + BigInt(Number(slash.registeredBlockTimeUnixMs) * 1e6).toString() ) ?? [] const registeredStaked = registeredSlashes.reduce( (acc, slash) => From 536269ef32d594f767b78f97b3b5a5282b967e0e Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 2 May 2024 22:43:10 -0400 Subject: [PATCH 139/438] fixed bigint error --- packages/stateless/components/dao/tabs/MembersTab.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/stateless/components/dao/tabs/MembersTab.tsx b/packages/stateless/components/dao/tabs/MembersTab.tsx index 8c47e67a8..26641a7b5 100644 --- a/packages/stateless/components/dao/tabs/MembersTab.tsx +++ b/packages/stateless/components/dao/tabs/MembersTab.tsx @@ -298,9 +298,7 @@ export const MembersTab = ({ ...members.data.map( ({ address, balance, votingPowerPercent }) => [ address, - balance.loading - ? '...' - : BigInt(balance.data.amount).toString(), + balance.loading ? '...' : balance.data.amount.toString(), votingPowerPercent.loading ? '...' : votingPowerPercent.data, ] ), From a69b8bb5ddead0c6e0631ad383d75c00e847aa85 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 3 May 2024 00:14:56 -0400 Subject: [PATCH 140/438] added kujira testnet support --- packages/types/chain.ts | 1 + packages/utils/constants/chains.ts | 44 ++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/packages/types/chain.ts b/packages/types/chain.ts index b1ee07708..bed92d885 100644 --- a/packages/types/chain.ts +++ b/packages/types/chain.ts @@ -70,6 +70,7 @@ export enum ChainId { MigalooTestnet = 'narwhal-2', NobleMainnet = 'noble-1', KujiraMainnet = 'kaiyo-1', + KujiraTestnet = 'harpoon-4', ChihuahuaMainnet = 'chihuahua-1', OraichainMainnet = 'Oraichain', ArchwayMainnet = 'archway-1', diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index c9ffeb8fc..ceb1b64d3 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -1575,6 +1575,46 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ DaoVotingTokenStaked: 17, }, }, + { + chainId: ChainId.KujiraTestnet, + name: 'kujira', + mainnet: false, + accentColor: '#e53935', + factoryContractAddress: + 'kujira1v5vn69nlmkxcdlqc36ln6fyt6vpahpj9qp9ddt3vhurxsyastknqru9qkg', + explorerUrlTemplates: { + tx: 'https://finder.kujira.network/harpoon-4/tx/REPLACE', + // TODO(kujira-testnet): fix + gov: 'https://blue.kujira.network/govern', + // TODO(kujira-testnet): fix + govProp: 'https://blue.kujira.network/govern/REPLACE', + wallet: 'https://finder.kujira.network/harpoon-4/address/REPLACE', + }, + codeIds: { + // https://github.com/CosmWasm/cw-plus + Cw1Whitelist: 3361, + Cw4Group: 3362, // v0.16 + // https://github.com/CosmWasm/cw-nfts + Cw721Base: 3363, + + // ContractVersion.V242 + CwPayrollFactory: 3365, + CwTokenSwap: 3366, + CwTokenfactoryIssuerMain: 3378, + CwVesting: 3367, + DaoCore: 3368, + DaoMigrator: -1, + DaoPreProposeApprovalSingle: 3370, + DaoPreProposeApprover: 3371, + DaoPreProposeMultiple: 3372, + DaoPreProposeSingle: 3373, + DaoProposalMultiple: 3374, + DaoProposalSingle: 3375, + DaoVotingCw4: 3376, + DaoVotingCw721Staked: 3377, + DaoVotingTokenStaked: 3379, + }, + }, ] export const POLYTONE_CONFIG_PER_CHAIN: [ChainId, PolytoneConfig][] = @@ -1644,6 +1684,10 @@ export const CHAIN_ENDPOINTS: Partial< rpc: 'https://kujira-rpc.polkachu.com', rest: 'https://kujira-api.polkachu.com', }, + [ChainId.KujiraTestnet]: { + rpc: 'https://kujira-testnet-rpc.polkachu.com', + rest: 'https://kujira-testnet-api.polkachu.com', + }, [ChainId.ChihuahuaMainnet]: { rpc: 'https://chihuahua-rpc.polkachu.com', rest: 'https://chihuahua-api.polkachu.com', From 86fe4ec1f011898cc0123c08fdfa62e9ad642a46 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 3 May 2024 02:48:04 -0400 Subject: [PATCH 141/438] replaced nft.storage with filebase for content upload --- apps/dapp/.env.mainnet | 6 +- apps/dapp/.env.testnet | 6 +- apps/sda/.env.mainnet | 6 +- apps/sda/.env.testnet | 6 +- .../components/inputs/ImageUploadInput.tsx | 8 + packages/storybook/.env | 6 +- packages/utils/api/uploadImage.ts | 19 +- packages/utils/api/uploadJson.ts | 16 +- packages/utils/api/uploadNft.ts | 57 +- packages/utils/constants/env.ts | 7 +- packages/utils/package.json | 2 +- packages/utils/server/filebase.ts | 66 ++ packages/utils/server/form.ts | 29 +- packages/utils/server/index.ts | 1 + yarn.lock | 760 +++--------------- 15 files changed, 261 insertions(+), 734 deletions(-) create mode 100644 packages/utils/server/filebase.ts diff --git a/apps/dapp/.env.mainnet b/apps/dapp/.env.mainnet index 5a3d65eaa..9b8e24c27 100644 --- a/apps/dapp/.env.mainnet +++ b/apps/dapp/.env.mainnet @@ -22,8 +22,10 @@ NEXT_PUBLIC_INDEXER_URL=https://indexer.daodao.zone NEXT_PUBLIC_SEARCH_HOST=https://search.daodao.zone NEXT_PUBLIC_SEARCH_API_KEY=1d599098d24298ffd8b295508eaedccb149163f847b862069cc6de31495dc71b -# https://nft.storage/docs/#get-an-api-token -NFT_STORAGE_API_KEY= +# Filebase +FILEBASE_ACCESS_KEY_ID= +FILEBASE_SECRET_ACCESS_KEY= +FILEBASE_BUCKET=dao-dao-ui # Payroll NEXT_PUBLIC_RETROACTIVE_COMPENSATION_API_BASE=https://retroactive-compensation.daodao.zone diff --git a/apps/dapp/.env.testnet b/apps/dapp/.env.testnet index f541183d4..4738edbac 100644 --- a/apps/dapp/.env.testnet +++ b/apps/dapp/.env.testnet @@ -21,8 +21,10 @@ NEXT_PUBLIC_INDEXER_URL=https://indexer.daodao.zone NEXT_PUBLIC_SEARCH_HOST=https://search.daodao.zone NEXT_PUBLIC_SEARCH_API_KEY=1d599098d24298ffd8b295508eaedccb149163f847b862069cc6de31495dc71b -# https://nft.storage/docs/#get-an-api-token -NFT_STORAGE_API_KEY= +# Filebase +FILEBASE_ACCESS_KEY_ID= +FILEBASE_SECRET_ACCESS_KEY= +FILEBASE_BUCKET=dao-dao-ui # Payroll NEXT_PUBLIC_RETROACTIVE_COMPENSATION_API_BASE=https://retroactive-compensation.daodao.zone diff --git a/apps/sda/.env.mainnet b/apps/sda/.env.mainnet index 4bcfef679..81274baed 100644 --- a/apps/sda/.env.mainnet +++ b/apps/sda/.env.mainnet @@ -19,8 +19,10 @@ NEXT_PUBLIC_PFPK_API_BASE=https://pfpk.daodao.zone # Indexer NEXT_PUBLIC_INDEXER_URL=https://indexer.daodao.zone -# https://nft.storage/docs/#get-an-api-token -NFT_STORAGE_API_KEY= +# Filebase +FILEBASE_ACCESS_KEY_ID= +FILEBASE_SECRET_ACCESS_KEY= +FILEBASE_BUCKET=dao-dao-ui # Payroll NEXT_PUBLIC_RETROACTIVE_COMPENSATION_API_BASE=https://retroactive-compensation.daodao.zone diff --git a/apps/sda/.env.testnet b/apps/sda/.env.testnet index 631e6250e..0cc436dc0 100644 --- a/apps/sda/.env.testnet +++ b/apps/sda/.env.testnet @@ -19,8 +19,10 @@ NEXT_PUBLIC_PFPK_API_BASE=https://pfpk.daodao.zone # Indexer NEXT_PUBLIC_INDEXER_URL=https://indexer.daodao.zone -# https://nft.storage/docs/#get-an-api-token -NFT_STORAGE_API_KEY= +# Filebase +FILEBASE_ACCESS_KEY_ID= +FILEBASE_SECRET_ACCESS_KEY= +FILEBASE_BUCKET=dao-dao-ui # Payroll NEXT_PUBLIC_RETROACTIVE_COMPENSATION_API_BASE=https://retroactive-compensation.daodao.zone diff --git a/packages/stateless/components/inputs/ImageUploadInput.tsx b/packages/stateless/components/inputs/ImageUploadInput.tsx index 4c633450f..556b04510 100644 --- a/packages/stateless/components/inputs/ImageUploadInput.tsx +++ b/packages/stateless/components/inputs/ImageUploadInput.tsx @@ -30,6 +30,14 @@ export const ImageUploadInput = ({ body: form, }) + if (!response.ok) { + const fallback = `Failed to upload image. Status: ${response.status} ${response.statusText}` + throw new Error( + (await response.json().catch(() => ({ error: fallback })))?.error || + fallback + ) + } + const { cid } = await response.json() if (!cid) { throw new Error('Failed to upload image') diff --git a/packages/storybook/.env b/packages/storybook/.env index c5b03bb9a..99d44bdef 100644 --- a/packages/storybook/.env +++ b/packages/storybook/.env @@ -14,8 +14,10 @@ NEXT_PUBLIC_PFPK_API_BASE=https://pfpk.daodao.zone NEXT_PUBLIC_SEARCH_HOST=https://search.daodao.zone NEXT_PUBLIC_SEARCH_API_KEY=1d599098d24298ffd8b295508eaedccb149163f847b862069cc6de31495dc71b -# https://nft.storage/docs/#get-an-api-token -NFT_STORAGE_API_KEY= +# Filebase +FILEBASE_ACCESS_KEY_ID= +FILEBASE_SECRET_ACCESS_KEY= +FILEBASE_BUCKET=dao-dao-ui # Payroll NEXT_PUBLIC_RETROACTIVE_COMPENSATION_API_BASE=https://retroactive-compensation.daodao.zone diff --git a/packages/utils/api/uploadImage.ts b/packages/utils/api/uploadImage.ts index 8a8ce5762..6de201b76 100644 --- a/packages/utils/api/uploadImage.ts +++ b/packages/utils/api/uploadImage.ts @@ -1,8 +1,7 @@ import { NextApiRequest, NextApiResponse } from 'next' -import { Blob, NFTStorage } from 'nft.storage' +import { v4 as uuidv4 } from 'uuid' -import { NFT_STORAGE_API_KEY } from '../constants' -import { parseForm } from '../server' +import { parseForm, uploadToFilebase } from '../server' export default async function handler( req: NextApiRequest, @@ -10,20 +9,18 @@ export default async function handler( ) { try { // Parse image from form. - const { imageData, mimetype } = await parseForm(req, { + const { imageData, imageExtension, mimetype } = await parseForm(req, { requireImage: true, }) // Type-check. Parser should throw error if no image is found. - if (!imageData) { + if (!imageData || !imageExtension) { throw new Error('No image found.') } - // Upload to IPFS via NFT.Storage's API: https://nft.storage/docs/. - const client = new NFTStorage({ - token: NFT_STORAGE_API_KEY, - }) - const cid = await client.storeBlob( - new Blob([imageData], { type: mimetype ?? undefined }) + const cid = await uploadToFilebase( + imageData, + `${uuidv4()}.${imageExtension}`, + mimetype ) return res.status(200).json({ diff --git a/packages/utils/api/uploadJson.ts b/packages/utils/api/uploadJson.ts index c01a7af35..a4bb0bfee 100644 --- a/packages/utils/api/uploadJson.ts +++ b/packages/utils/api/uploadJson.ts @@ -1,7 +1,7 @@ import { NextApiRequest, NextApiResponse } from 'next' -import { Blob, NFTStorage } from 'nft.storage' +import { v4 as uuidv4 } from 'uuid' -import { NFT_STORAGE_API_KEY } from '../constants' +import { uploadToFilebase } from '../server' export default async function handler( req: NextApiRequest, @@ -14,14 +14,10 @@ export default async function handler( }) } - // Upload to IPFS via NFT.Storage's API: https://nft.storage/docs/. - const client = new NFTStorage({ - token: NFT_STORAGE_API_KEY, - }) - const cid = await client.storeBlob( - new Blob([JSON.stringify(req.body, null, 2)], { - type: 'application/json', - }) + const cid = await uploadToFilebase( + JSON.stringify(req.body, null, 2), + `${uuidv4()}.json`, + 'application/json' ) return res.status(200).json({ diff --git a/packages/utils/api/uploadNft.ts b/packages/utils/api/uploadNft.ts index 68e84434a..d71647a3f 100644 --- a/packages/utils/api/uploadNft.ts +++ b/packages/utils/api/uploadNft.ts @@ -1,10 +1,8 @@ import JSON5 from 'json5' import { NextApiRequest, NextApiResponse } from 'next' -import { Blob, File, NFTStorage } from 'nft.storage' -import { TokenInput } from 'nft.storage/dist/src/lib/interface' +import { v4 as uuidv4 } from 'uuid' -import { NFT_STORAGE_API_KEY } from '../constants' -import { parseForm } from '../server' +import { parseForm, uploadToFilebase } from '../server' export default async function handler( req: NextApiRequest, @@ -15,6 +13,7 @@ export default async function handler( const { fields: { name, description = '', extra: _extra }, imageData, + imageExtension, mimetype, } = await parseForm(req, { requireImage: false, @@ -35,16 +34,20 @@ export default async function handler( } } - // Upload to IPFS via NFT.Storage's API: https://nft.storage/docs/. This - // automatically uploads the image and creates/uploads a metadata.json file - // conforming to the ERC-1155 NFT standard. - const client = new NFTStorage({ - token: NFT_STORAGE_API_KEY, - }) + // Ensure image has extension if exists. + if (imageData && !imageExtension) { + return res.status(400).json({ error: 'No image extension found.' }) + } + + const folder = uuidv4() - let cid: string - let metadataUrl: string - let imageUrl: string | undefined + const imageCid = imageData + ? await uploadToFilebase( + imageData, + `${folder}/image.${imageExtension}`, + mimetype + ) + : undefined const metadata = { ...extra, @@ -55,27 +58,17 @@ export default async function handler( description: description || extra.description || '', // Add image if present. - ...(imageData && { - image: new Blob([imageData], { type: mimetype }), - }), - } - // If image exists and is not a string, upload it with metadata. Otherwise, - // manually upload metadata only. If image is a string, it is assumed to be - // a URL and will be used as the image URL in the metadata. - if (metadata.image && typeof metadata.image !== 'string') { - const storedMetadata = await client.store(metadata as TokenInput) - cid = storedMetadata.ipnft - metadataUrl = storedMetadata.url - imageUrl = storedMetadata.embed().image.toString() - } else { - const metadataJsonFilename = 'metadata.json' - cid = await client.storeDirectory([ - new File([JSON.stringify(metadata, null, 2)], metadataJsonFilename), - ]) - metadataUrl = `ipfs://${cid}/${metadataJsonFilename}` - imageUrl = typeof metadata.image === 'string' ? metadata.image : undefined + ...(imageCid && { image: `ipfs://${imageCid}` }), } + const cid = await uploadToFilebase( + JSON.stringify(metadata, null, 2), + `${folder}/metadata.json`, + 'application/json' + ) + const metadataUrl = `ipfs://${cid}` + const imageUrl = metadata.image + return res.status(200).json({ cid, metadataUrl, diff --git a/packages/utils/constants/env.ts b/packages/utils/constants/env.ts index 3920edf38..6c26a42e8 100644 --- a/packages/utils/constants/env.ts +++ b/packages/utils/constants/env.ts @@ -42,7 +42,12 @@ export const INDEXER_URL = process.env.NEXT_PUBLIC_INDEXER_URL export const SEARCH_HOST = process.env.NEXT_PUBLIC_SEARCH_HOST as string export const SEARCH_API_KEY = process.env.NEXT_PUBLIC_SEARCH_API_KEY as string -export const NFT_STORAGE_API_KEY = process.env.NFT_STORAGE_API_KEY as string +// Filebase +export const FILEBASE_ACCESS_KEY_ID = process.env + .FILEBASE_ACCESS_KEY_ID as string +export const FILEBASE_SECRET_ACCESS_KEY = process.env + .FILEBASE_SECRET_ACCESS_KEY as string +export const FILEBASE_BUCKET = process.env.FILEBASE_BUCKET as string export const FAST_AVERAGE_COLOR_API_TEMPLATE = process.env .NEXT_PUBLIC_FAST_AVERAGE_COLOR_API_TEMPLATE as string diff --git a/packages/utils/package.json b/packages/utils/package.json index b0eedad4e..76b683d53 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -20,6 +20,7 @@ "@types/semver": "^7.5.6", "@types/uuid": "^9.0.1", "ajv": "^8.11.0", + "aws-sdk": "^2.1612.0", "chain-registry": "^1.28.6", "json5": "^2.2.0", "lodash.clonedeep": "^4.5.0", @@ -40,7 +41,6 @@ "cosmjs-types": "^0.9.0", "jest": "^29.1.1", "next": "^13.3.0", - "nft.storage": "^7.0.0", "react": "^18.2.0", "typescript": "5.3.3" }, diff --git a/packages/utils/server/filebase.ts b/packages/utils/server/filebase.ts new file mode 100644 index 000000000..5103da19b --- /dev/null +++ b/packages/utils/server/filebase.ts @@ -0,0 +1,66 @@ +import { S3 } from 'aws-sdk' + +import { + FILEBASE_ACCESS_KEY_ID, + FILEBASE_BUCKET, + FILEBASE_SECRET_ACCESS_KEY, +} from '../constants' + +/** + * Upload data to Filebase and return the IPFS CID. + * + * https://docs.filebase.com/getting-started/developer-quick-start-guide + */ +export const uploadToFilebase = async ( + /** + * Data to upload. + */ + data: S3.Body, + /** + * File path. + */ + path: string, + /** + * Optional content type. + */ + contentType?: string + /** + * Optional subfolder. + */ +): Promise => { + const client = new S3({ + apiVersion: '2006-03-01', + accessKeyId: FILEBASE_ACCESS_KEY_ID, + secretAccessKey: FILEBASE_SECRET_ACCESS_KEY, + endpoint: 'https://s3.filebase.com', + region: 'us-east-1', + s3ForcePathStyle: true, + signatureVersion: 'v4', + }) + + return await new Promise((resolve, reject) => { + const request = client.putObject({ + Bucket: FILEBASE_BUCKET, + Key: path, + ContentType: contentType, + Body: data, + ACL: 'public-read', + }) + + // Listen for CID. + request.on('httpHeaders', (_, headers) => { + const cid = headers['x-amz-meta-cid'] + if (!cid) { + reject(new Error('No CID found.')) + } + + resolve(cid) + }) + + request.on('error', (err) => { + reject(err) + }) + + request.send() + }) +} diff --git a/packages/utils/server/form.ts b/packages/utils/server/form.ts index 0743943bc..1b0c06019 100644 --- a/packages/utils/server/form.ts +++ b/packages/utils/server/form.ts @@ -6,10 +6,17 @@ import { NextApiRequest } from 'next' // Returns contents of form from a Next.js API route request. export const parseForm = async ( req: NextApiRequest, - { requireImage = false } = {} + { + requireImage = false, + /** + * Limit the maximum size of the uploaded image in megabytes. Defaults to 3. + */ + maxFileSizeMb = 3, + } = {} ): Promise<{ fields: Record imageData: Buffer | undefined + imageExtension: string | undefined mimetype: string | undefined }> => { // Get fields and files from form. @@ -17,9 +24,22 @@ export const parseForm = async ( fields: Fields files: Files }>((resolve, reject) => { - new IncomingForm().parse(req, (err, fields, files) => { + new IncomingForm({ + maxFileSize: maxFileSizeMb * 1024 * 1024, + }).parse(req, (err, fields, files) => { if (err) { - reject(err) + if ( + err instanceof Error && + err.message.includes('options.maxFileSize') + ) { + reject( + new Error( + `Your file is too large. The maximum size is ${maxFileSizeMb} MB.` + ) + ) + } else { + reject(err) + } } else { resolve({ fields, files }) } @@ -56,6 +76,9 @@ export const parseForm = async ( return { fields, imageData, + imageExtension: file?.originalFilename?.includes('.') + ? file.originalFilename.split('.').slice(-1)[0] + : undefined, mimetype: file?.mimetype ?? undefined, } } diff --git a/packages/utils/server/index.ts b/packages/utils/server/index.ts index 54151771d..06d6a014f 100644 --- a/packages/utils/server/index.ts +++ b/packages/utils/server/index.ts @@ -1 +1,2 @@ +export * from './filebase' export * from './form' diff --git a/yarn.lock b/yarn.lock index f173e9364..4ac230f02 100644 --- a/yarn.lock +++ b/yarn.lock @@ -63,11 +63,6 @@ dependencies: node-fetch "^2.6.1" -"@assemblyscript/loader@^0.9.4": - version "0.9.4" - resolved "https://registry.yarnpkg.com/@assemblyscript/loader/-/loader-0.9.4.tgz#a483c54c1253656bb33babd464e3154a173e1577" - integrity sha512-HazVq9zwTVwGmqdwYzu7WyQ6FQVZ7SwET0KKQuKm55jD0IfUpZgN0OPIiZG3zV1iSrVYcN0bdwLRXI/VNCYsUA== - "@aws-crypto/crc32@3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@aws-crypto/crc32/-/crc32-3.0.0.tgz#07300eca214409c33e3ff769cd5697b57fdd38fa" @@ -3965,38 +3960,6 @@ resolved "https://registry.yarnpkg.com/@ioredis/commands/-/commands-1.2.0.tgz#6d61b3097470af1fdbbe622795b8921d42018e11" integrity sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg== -"@ipld/car@^3.0.1", "@ipld/car@^3.2.3": - version "3.2.4" - resolved "https://registry.yarnpkg.com/@ipld/car/-/car-3.2.4.tgz#115951ba2255ec51d865773a074e422c169fb01c" - integrity sha512-rezKd+jk8AsTGOoJKqzfjLJ3WVft7NZNH95f0pfPbicROvzTyvHCNy567HzSUd6gRXZ9im29z5ZEv9Hw49jSYw== - dependencies: - "@ipld/dag-cbor" "^7.0.0" - multiformats "^9.5.4" - varint "^6.0.0" - -"@ipld/dag-cbor@^6.0.13", "@ipld/dag-cbor@^6.0.3": - version "6.0.15" - resolved "https://registry.yarnpkg.com/@ipld/dag-cbor/-/dag-cbor-6.0.15.tgz#aebe7a26c391cae98c32faedb681b1519e3d2372" - integrity sha512-Vm3VTSTwlmGV92a3C5aeY+r2A18zbH2amehNhsX8PBa3muXICaWrN8Uri85A5hLH7D7ElhE8PdjxD6kNqUmTZA== - dependencies: - cborg "^1.5.4" - multiformats "^9.5.4" - -"@ipld/dag-cbor@^7.0.0", "@ipld/dag-cbor@^7.0.2": - version "7.0.3" - resolved "https://registry.yarnpkg.com/@ipld/dag-cbor/-/dag-cbor-7.0.3.tgz#aa31b28afb11a807c3d627828a344e5521ac4a1e" - integrity sha512-1VVh2huHsuohdXC1bGJNE8WR72slZ9XE2T3wbBBq31dm7ZBatmKLLxrB+XAqafxfRFjv08RZmj/W/ZqaM13AuA== - dependencies: - cborg "^1.6.0" - multiformats "^9.5.4" - -"@ipld/dag-pb@^2.0.2": - version "2.1.18" - resolved "https://registry.yarnpkg.com/@ipld/dag-pb/-/dag-pb-2.1.18.tgz#12d63e21580e87c75fd1a2c62e375a78e355c16f" - integrity sha512-ZBnf2fuX9y3KccADURG5vb9FaOeMjFkCrNysB0PtftME/4iCTjxfaLoNq/IAh5fTqUOMXvryN6Jyka4ZGuMLIg== - dependencies: - multiformats "^9.5.4" - "@isaacs/cliui@^8.0.2": version "8.0.2" resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" @@ -5511,14 +5474,6 @@ prop-types "^15.8.1" react-is "^18.2.0" -"@multiformats/murmur3@^1.0.3": - version "1.1.3" - resolved "https://registry.yarnpkg.com/@multiformats/murmur3/-/murmur3-1.1.3.tgz#70349166992e5f981f1ddff0200fa775b2bf6606" - integrity sha512-wAPLUErGR8g6Lt+bAZn6218k9YQPym+sjszsXL6o4zfxbA22P+gxWZuuD9wDbwL55xrKO5idpcuQUX7/E3oHcw== - dependencies: - multiformats "^9.5.4" - murmurhash3js-revisited "^3.0.0" - "@next/bundle-analyzer@^12.1.0": version "12.2.0" resolved "https://registry.yarnpkg.com/@next/bundle-analyzer/-/bundle-analyzer-12.2.0.tgz#8abe89e23c6a9bf5afba3a15ee4d5f432d3db3b9" @@ -8234,7 +8189,7 @@ resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-1.0.2.tgz#e2ce9d83a613bacf284c7be7d491945e39e1f8e9" integrity sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA== -"@types/minimatch@*", "@types/minimatch@^3.0.3", "@types/minimatch@^3.0.4": +"@types/minimatch@*", "@types/minimatch@^3.0.3": version "3.0.5" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== @@ -8388,11 +8343,6 @@ resolved "https://registry.yarnpkg.com/@types/remove-markdown/-/remove-markdown-0.3.1.tgz#82bc3664c313f50f7c77f1bb59935f567689dc63" integrity sha512-JpJNEJEsmmltyL2LdE8KRjJ0L2ad5vgLibqNj85clohT9AyTrfN6jvHxStPshDkmtcL/ShFu0p2tbY7DBS1mqQ== -"@types/retry@0.12.0": - version "0.12.0" - resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.0.tgz#2b35eccfcee7d38cd72ad99232fbd58bffb3c84d" - integrity sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA== - "@types/ripemd160@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@types/ripemd160/-/ripemd160-2.0.0.tgz#d33e49cf66edf4668828030d4aa80116bbf8ae81" @@ -8966,50 +8916,6 @@ "@walletconnect/window-getters" "^1.0.1" tslib "1.14.1" -"@web-std/blob@^3.0.1", "@web-std/blob@^3.0.3": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@web-std/blob/-/blob-3.0.4.tgz#dd67a685547331915428d69e723c7da2015c3fc5" - integrity sha512-+dibyiw+uHYK4dX5cJ7HA+gtDAaUUe6JsOryp2ZpAC7h4ICsh49E34JwHoEKPlPvP0llCrNzz45vvD+xX5QDBg== - dependencies: - "@web-std/stream" "1.0.0" - web-encoding "1.1.5" - -"@web-std/fetch@^3.0.3": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@web-std/fetch/-/fetch-3.0.3.tgz#507e1371825298aae61172b0da439570437d3982" - integrity sha512-PtaKr6qvw2AmKChugzhQWuTa12dpbogHRBxwcleAZ35UhWucnfD4N+g3f7qYK2OeioSWTK3yMf6n/kOOfqxHaQ== - dependencies: - "@web-std/blob" "^3.0.3" - "@web-std/form-data" "^3.0.2" - "@web3-storage/multipart-parser" "^1.0.0" - data-uri-to-buffer "^3.0.1" - -"@web-std/file@^3.0.0": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@web-std/file/-/file-3.0.2.tgz#b84cc9ed754608b18dcf78ac62c40dbcc6a94692" - integrity sha512-pIH0uuZsmY8YFvSHP1NsBIiMT/1ce0suPrX74fEeO3Wbr1+rW0fUGEe4d0R99iLwXtyCwyserqCFI4BJkJlkRA== - dependencies: - "@web-std/blob" "^3.0.3" - -"@web-std/form-data@^3.0.0", "@web-std/form-data@^3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@web-std/form-data/-/form-data-3.0.2.tgz#c71d9def6a593138ea92fe3d1ffbce19f43e869c" - integrity sha512-rhc8IRw66sJ0FHcnC84kT3mTN6eACTuNftkt1XSl1Ef6WRKq4Pz65xixxqZymAZl1K3USpwhLci4SKNn4PYxWQ== - dependencies: - web-encoding "1.1.5" - -"@web-std/stream@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@web-std/stream/-/stream-1.0.0.tgz#01066f40f536e4329d9b696dc29872f3a14b93c1" - integrity sha512-jyIbdVl+0ZJyKGTV0Ohb9E6UnxP+t7ZzX4Do3AHjZKxUXKMs9EmqnBDQgHF7bEw0EzbQygOjtt/7gvtmi//iCQ== - dependencies: - web-streams-polyfill "^3.1.1" - -"@web3-storage/multipart-parser@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@web3-storage/multipart-parser/-/multipart-parser-1.0.0.tgz#6b69dc2a32a5b207ba43e556c25cc136a56659c4" - integrity sha512-BEO6al7BYqcnfX15W2cnGR+Q566ACXAT9UQykORCWW80lmkpWsnEob6zJS1ZVBKsSJC8+7vJkHwlp+lXG1UCdw== - "@web3auth/base-plugin@^7.3.2": version "7.3.2" resolved "https://registry.yarnpkg.com/@web3auth/base-plugin/-/base-plugin-7.3.2.tgz#9018e393cdbf5cbf91433fb59cba0ed714e0d654" @@ -9488,11 +9394,6 @@ dependencies: argparse "^2.0.1" -"@zxing/text-encoding@0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@zxing/text-encoding/-/text-encoding-0.9.0.tgz#fb50ffabc6c7c66a0c96b4c03e3d9be74864b70b" - integrity sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA== - JSONStream@^1.0.4, JSONStream@^1.3.5: version "1.3.5" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" @@ -9800,19 +9701,6 @@ any-promise@^1.0.0: resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" integrity sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A== -any-signal@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/any-signal/-/any-signal-2.1.2.tgz#8d48270de0605f8b218cf9abe8e9c6a0e7418102" - integrity sha512-B+rDnWasMi/eWcajPcCWSlYc7muXOrcYrqgyzcdKisl2H/WTlQ0gip1KyQfr0ZlxJdsuWCj/LWwQm7fhyhRfIQ== - dependencies: - abort-controller "^3.0.0" - native-abort-controller "^1.0.3" - -any-signal@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/any-signal/-/any-signal-3.0.1.tgz#49cae34368187a3472e31de28fb5cb1430caa9a6" - integrity sha512-xgZgJtKEa9YmDqXodIgl7Fl1C8yNXr8w6gXjqK3LW4GcEiYT+6AQfJSE/8SPsEpLLmcvbv8YU+qet94UewHxqg== - anymatch@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" @@ -10142,6 +10030,22 @@ available-typed-arrays@^1.0.5: resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== +aws-sdk@^2.1612.0: + version "2.1612.0" + resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1612.0.tgz#9b55523e578f3094ff149f475bea216a84271b88" + integrity sha512-UNwmKh2IChGQzDm6Stxor2SbjealVld2awmf1Q8rxVO1UVvjRrQ97ArD2gWouJT7BuSqDsUpgMgf/LBAbLjMxQ== + dependencies: + buffer "4.9.2" + events "1.1.1" + ieee754 "1.1.13" + jmespath "0.16.0" + querystring "0.2.0" + sax "1.2.1" + url "0.10.3" + util "^0.12.4" + uuid "8.0.0" + xml2js "0.6.2" + axe-core@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.4.2.tgz#dcf7fb6dea866166c3eab33d68208afe4d5f670c" @@ -10531,36 +10435,6 @@ bl@^4.0.3, bl@^4.1.0: inherits "^2.0.4" readable-stream "^3.4.0" -bl@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/bl/-/bl-5.1.0.tgz#183715f678c7188ecef9fe475d90209400624273" - integrity sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ== - dependencies: - buffer "^6.0.3" - inherits "^2.0.4" - readable-stream "^3.4.0" - -blob-to-it@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/blob-to-it/-/blob-to-it-1.0.4.tgz#f6caf7a4e90b7bb9215fa6a318ed6bd8ad9898cb" - integrity sha512-iCmk0W4NdbrWgRRuxOriU8aM5ijeVLI61Zulsmg/lUHNr7pYjoj+U77opLefNagevtrrbMt3JQ5Qip7ar178kA== - dependencies: - browser-readablestream-to-it "^1.0.3" - -blockstore-core@^1.0.2: - version "1.0.5" - resolved "https://registry.yarnpkg.com/blockstore-core/-/blockstore-core-1.0.5.tgz#2e34b6a7faae0d4b6c98dc8573c6f998eb457f36" - integrity sha512-i/9CUMMvBALVbtSqUIuiWB3tk//a4Q2I2CEWiBuYNnhJvk/DWplXjLt8Sqc5VGkRVXVPSsEuH8fUtqJt5UFYcA== - dependencies: - err-code "^3.0.1" - interface-blockstore "^2.0.2" - interface-store "^2.0.1" - it-all "^1.0.4" - it-drain "^1.0.4" - it-filter "^1.0.2" - it-take "^1.0.1" - multiformats "^9.4.7" - bluebird@^3.5.5: version "3.7.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" @@ -10687,11 +10561,6 @@ browser-headers@^0.4.1: resolved "https://registry.yarnpkg.com/browser-headers/-/browser-headers-0.4.1.tgz#4308a7ad3b240f4203dbb45acedb38dc2d65dd02" integrity sha512-CA9hsySZVo9371qEHjHZtYxV2cFtVj5Wj/ZHi8ooEsrtm4vOnl9Y9HmyYWk9q+05d7K3rdoAE0j3MVEFVvtQtg== -browser-readablestream-to-it@^1.0.1, browser-readablestream-to-it@^1.0.2, browser-readablestream-to-it@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/browser-readablestream-to-it/-/browser-readablestream-to-it-1.0.3.tgz#ac3e406c7ee6cdf0a502dd55db33bab97f7fba76" - integrity sha512-+12sHB+Br8HIh6VAMVEG5r3UXCyESIgDW7kzk3BjIXa43DVqVwL7GC5TW3jeh+72dtcH99pPVpw0X8i0jt+/kw== - browserify-aes@^1.0.0, browserify-aes@^1.0.4: version "1.2.0" resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" @@ -10810,15 +10679,7 @@ buffer-xor@^1.0.3: resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== -buffer@6.0.3, buffer@^6.0.1, buffer@^6.0.3, buffer@~6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" - integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.2.1" - -buffer@^4.3.0: +buffer@4.9.2, buffer@^4.3.0: version "4.9.2" resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.2.tgz#230ead344002988644841ab0244af8c44bbe3ef8" integrity sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg== @@ -10827,6 +10688,14 @@ buffer@^4.3.0: ieee754 "^1.1.4" isarray "^1.0.0" +buffer@6.0.3, buffer@^6.0.3, buffer@~6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + buffer@^5.5.0: version "5.7.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" @@ -11070,16 +10939,6 @@ capture-exit@^2.0.0: dependencies: rsvp "^4.8.4" -carbites@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/carbites/-/carbites-1.0.6.tgz#0eac206c87b60e09b758a4e820af000dda4f8dd1" - integrity sha512-dS9IQvnrb5VIRvSTNz5Ff+mB9d2MFfi5mojtJi7Rlss79VeF190jr0sZdA7eW0CGHotvHkZaWuM6wgfD9PEFRg== - dependencies: - "@ipld/car" "^3.0.1" - "@ipld/dag-cbor" "^6.0.3" - "@ipld/dag-pb" "^2.0.2" - multiformats "^9.0.4" - case-sensitive-paths-webpack-plugin@^2.3.0: version "2.4.0" resolved "https://registry.yarnpkg.com/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.4.0.tgz#db64066c6422eed2e08cc14b986ca43796dbc6d4" @@ -11090,11 +10949,6 @@ case@1.6.3: resolved "https://registry.yarnpkg.com/case/-/case-1.6.3.tgz#0a4386e3e9825351ca2e6216c60467ff5f1ea1c9" integrity sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ== -cborg@^1.5.4, cborg@^1.6.0: - version "1.9.6" - resolved "https://registry.yarnpkg.com/cborg/-/cborg-1.9.6.tgz#bf90de6541d10735db878b60b4af824209b77435" - integrity sha512-XmiD+NWTk9xg31d8MdXgW46bSZd95ELllxjbjdWGyHAtpTw+cf8iG3NibWgTWRnfWfxtcihVa5Pm0gchHiO3JQ== - ccount@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.1.0.tgz#246687debb6014735131be8abab2d93898f8d043" @@ -12246,11 +12100,6 @@ dargs@7.0.0, dargs@^7.0.0: resolved "https://registry.yarnpkg.com/dargs/-/dargs-7.0.0.tgz#04015c41de0bcb69ec84050f3d9be0caf8d6d5cc" integrity sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg== -data-uri-to-buffer@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz#594b8973938c5bc2c33046535785341abc4f3636" - integrity sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og== - dataloader@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/dataloader/-/dataloader-2.2.2.tgz#216dc509b5abe39d43a9b9d97e6e5e473dfbe3e0" @@ -12630,15 +12479,6 @@ dlv@^1.1.3: resolved "https://registry.yarnpkg.com/dlv/-/dlv-1.1.3.tgz#5c198a8a11453596e751494d49874bc7732f2e79" integrity sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA== -dns-over-http-resolver@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/dns-over-http-resolver/-/dns-over-http-resolver-1.2.3.tgz#194d5e140a42153f55bb79ac5a64dd2768c36af9" - integrity sha512-miDiVSI6KSNbi4SVifzO/reD8rMnxgrlnkrlkugOLQpWQTe2qMdHsZp5DmfKjxNE+/T3VAAYLQUZMv9SMr6+AA== - dependencies: - debug "^4.3.1" - native-fetch "^3.0.0" - receptacle "^1.3.2" - doctrine@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" @@ -12837,13 +12677,6 @@ ejs@^3.1.7: dependencies: jake "^10.8.5" -electron-fetch@^1.7.2: - version "1.9.1" - resolved "https://registry.yarnpkg.com/electron-fetch/-/electron-fetch-1.9.1.tgz#e28bfe78d467de3f2dec884b1d72b8b05322f30f" - integrity sha512-M9qw6oUILGVrcENMSRRefE1MbHPIz0h79EKIeJWK9v563aT9Qkh8aEHPO1H5vi970wPirNY+jO9OpFoLiMsMGA== - dependencies: - encoding "^0.1.13" - electron-to-chromium@^1.4.477: version "1.4.490" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.490.tgz#d99286f6e915667fa18ea4554def1aa60eb4d5f1" @@ -12985,11 +12818,6 @@ err-code@^2.0.2: resolved "https://registry.yarnpkg.com/err-code/-/err-code-2.0.3.tgz#23c2f3b756ffdfc608d30e27c9a941024807e7f9" integrity sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA== -err-code@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/err-code/-/err-code-3.0.1.tgz#a444c7b992705f2b120ee320b09972eef331c920" - integrity sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA== - errno@^0.1.3, errno@~0.1.7: version "0.1.8" resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.8.tgz#8bb3e9c7d463be4976ff888f76b4809ebc2e811f" @@ -13605,6 +13433,11 @@ eventemitter3@^4.0.4, eventemitter3@^4.0.7: resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== +events@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" + integrity sha512-kEcvvCBByWXGnZy6JUlgAp2gBIUjfCAV6P6TgT1/aaQKcmuAEC4OZTV1I4EWQLz2gxZw76atuVyvHhTxvi0Flw== + events@3.3.0, events@^3.0.0, events@^3.2.0, events@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" @@ -13828,11 +13661,6 @@ fast-diff@^1.1.2: resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== -fast-fifo@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fast-fifo/-/fast-fifo-1.1.0.tgz#17d1a3646880b9891dfa0c54e69c5fef33cad779" - integrity sha512-Kl29QoNbNvn4nhDsLYjyIAaIqaJB6rBx5p3sL9VjaefJ+eMFBWVZiaoguaoZfzEKr5RhAti0UgM8703akGPJ6g== - fast-glob@3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1" @@ -14437,11 +14265,6 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1, get-intrinsic@ has-symbols "^1.0.3" hasown "^2.0.0" -get-iterator@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/get-iterator/-/get-iterator-1.0.2.tgz#cd747c02b4c084461fac14f48f6b45a80ed25c82" - integrity sha512-v+dm9bNVfOYsY1OrhaCrmyOcYoSeVvbt+hHZ0Au+T+p1y+0Uyj9aMaGIeUTT6xdpRbWzDeYKvfOslPhggQMcsg== - get-package-type@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" @@ -14831,14 +14654,6 @@ h3@^1.10.2, h3@^1.8.2: uncrypto "^0.1.3" unenv "^1.9.0" -hamt-sharding@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/hamt-sharding/-/hamt-sharding-2.0.1.tgz#f45686d0339e74b03b233bee1bde9587727129b6" - integrity sha512-vnjrmdXG9dDs1m/H4iJ6z0JFI2NtgsW5keRkTcM85NGak69Mkf5PHUqBz+Xs0T4sg0ppvj9O5EGAJo40FTxmmA== - dependencies: - sparse-array "^1.3.1" - uint8arrays "^3.0.0" - hamt_plus@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/hamt_plus/-/hamt_plus-1.0.2.tgz#e21c252968c7e33b20f6a1b094cd85787a265601" @@ -15406,11 +15221,16 @@ icss-utils@^5.0.0, icss-utils@^5.1.0: resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae" integrity sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA== -idb-keyval@^6.0.3, idb-keyval@^6.2.1: +idb-keyval@^6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/idb-keyval/-/idb-keyval-6.2.1.tgz#94516d625346d16f56f3b33855da11bfded2db33" integrity sha512-8Sb3veuYCyrZL+VBt9LJfZjLUPWVvqn8tG28VqYNFCo43KHcKuq+b4EiXGeuaLAQWL2YmyDgMp2aSpH9JHsEQg== +ieee754@1.1.13: + version "1.1.13" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" + integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== + ieee754@^1.1.13, ieee754@^1.1.4, ieee754@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" @@ -15646,28 +15466,6 @@ intercept-stdout@^0.1.2: dependencies: lodash.toarray "^3.0.0" -interface-blockstore@^2.0.2, interface-blockstore@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/interface-blockstore/-/interface-blockstore-2.0.3.tgz#b85270eb5180e65e46c9f66980a0fa4d98f5d73e" - integrity sha512-OwVUnlNcx7H5HloK0Myv6c/C1q9cNG11HX6afdeU6q6kbuNj8jKCwVnmJHhC94LZaJ+9hvVOk4IUstb3Esg81w== - dependencies: - interface-store "^2.0.2" - multiformats "^9.0.4" - -interface-datastore@^6.0.2: - version "6.1.1" - resolved "https://registry.yarnpkg.com/interface-datastore/-/interface-datastore-6.1.1.tgz#5150a00de2e7513eaadba58bcafd059cb50004c1" - integrity sha512-AmCS+9CT34pp2u0QQVXjKztkuq3y5T+BIciuiHDDtDZucZD8VudosnSdUyXJV6IsRkN5jc4RFDhCk1O6Q3Gxjg== - dependencies: - interface-store "^2.0.2" - nanoid "^3.0.2" - uint8arrays "^3.0.0" - -interface-store@^2.0.1, interface-store@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/interface-store/-/interface-store-2.0.2.tgz#83175fd2b0c501585ed96db54bb8ba9d55fce34c" - integrity sha512-rScRlhDcz6k199EkHqT8NpM87ebN89ICOzILoBHgaG36/WX50N32BnU/kpZgCGPLhARRAWUUX5/cyaIjt7Kipg== - internal-slot@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" @@ -15716,11 +15514,6 @@ ioredis@^5.3.2: redis-parser "^3.0.0" standard-as-callback "^2.1.0" -ip-regex@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-4.3.0.tgz#687275ab0f57fa76978ff8f4dddc8a23d5990db5" - integrity sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q== - ip@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ip/-/ip-2.0.0.tgz#4cf4ab182fee2314c75ede1276f8c80b479936da" @@ -15731,133 +15524,6 @@ ipaddr.js@1.9.1: resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== -ipfs-car@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/ipfs-car/-/ipfs-car-0.6.2.tgz#ec645cebe29056344abb3545e4e2e99788a4405c" - integrity sha512-tliuakkKKtCa4TTnFT3zJKjq/aD8EGKX8Y0ybCyrAW0fo/n2koZpxiLjBvtTs47Rqyji6ggXo+atPbJJ60hJmg== - dependencies: - "@ipld/car" "^3.2.3" - "@web-std/blob" "^3.0.1" - bl "^5.0.0" - blockstore-core "^1.0.2" - browser-readablestream-to-it "^1.0.2" - idb-keyval "^6.0.3" - interface-blockstore "^2.0.2" - ipfs-core-types "^0.8.3" - ipfs-core-utils "^0.12.1" - ipfs-unixfs-exporter "^7.0.4" - ipfs-unixfs-importer "^9.0.4" - ipfs-utils "^9.0.2" - it-all "^1.0.5" - it-last "^1.0.5" - it-pipe "^1.1.0" - meow "^9.0.0" - move-file "^2.1.0" - multiformats "^9.6.3" - stream-to-it "^0.2.3" - streaming-iterables "^6.0.0" - uint8arrays "^3.0.0" - -ipfs-core-types@^0.8.3, ipfs-core-types@^0.8.4: - version "0.8.4" - resolved "https://registry.yarnpkg.com/ipfs-core-types/-/ipfs-core-types-0.8.4.tgz#4d483dc6035714ea48a0b02e3f82b6c6d55c8525" - integrity sha512-sbRZA1QX3xJ6ywTiVQZMOxhlhp4osAZX2SXx3azOLxAtxmGWDMkHYt722VV4nZ2GyJy8qyk5GHQIZ0uvQnpaTg== - dependencies: - interface-datastore "^6.0.2" - multiaddr "^10.0.0" - multiformats "^9.4.13" - -ipfs-core-utils@^0.12.1: - version "0.12.2" - resolved "https://registry.yarnpkg.com/ipfs-core-utils/-/ipfs-core-utils-0.12.2.tgz#f5365ac884fd93a3bcb6e7b6f17cebe09d841501" - integrity sha512-RfxP3rPhXuqKIUmTAUhmee6fmaV3A7LMnjOUikRKpSyqESz/DR7aGK7tbttMxkZdkSEr0rFXlqbyb0vVwmn0wQ== - dependencies: - any-signal "^2.1.2" - blob-to-it "^1.0.1" - browser-readablestream-to-it "^1.0.1" - debug "^4.1.1" - err-code "^3.0.1" - ipfs-core-types "^0.8.4" - ipfs-unixfs "^6.0.3" - ipfs-utils "^9.0.2" - it-all "^1.0.4" - it-map "^1.0.4" - it-peekable "^1.0.2" - it-to-stream "^1.0.0" - merge-options "^3.0.4" - multiaddr "^10.0.0" - multiaddr-to-uri "^8.0.0" - multiformats "^9.4.13" - nanoid "^3.1.23" - parse-duration "^1.0.0" - timeout-abort-controller "^1.1.1" - uint8arrays "^3.0.0" - -ipfs-unixfs-exporter@^7.0.4: - version "7.0.11" - resolved "https://registry.yarnpkg.com/ipfs-unixfs-exporter/-/ipfs-unixfs-exporter-7.0.11.tgz#48c4c7605601bddc27cf1de97a2ad81a87e5fe32" - integrity sha512-qTYa69J7HbI2EIYNUddKPg9Y3rHkYZV0bNdmzZKA5+ZbwRVoUEuBW/cguEqTp22zHygh3sMnzYZFm0naVIdMgQ== - dependencies: - "@ipld/dag-cbor" "^7.0.2" - "@ipld/dag-pb" "^2.0.2" - "@multiformats/murmur3" "^1.0.3" - err-code "^3.0.1" - hamt-sharding "^2.0.0" - interface-blockstore "^2.0.3" - ipfs-unixfs "^6.0.0" - it-last "^1.0.5" - multiformats "^9.4.2" - uint8arrays "^3.0.0" - -ipfs-unixfs-importer@^9.0.4: - version "9.0.10" - resolved "https://registry.yarnpkg.com/ipfs-unixfs-importer/-/ipfs-unixfs-importer-9.0.10.tgz#2527ea0b4e018a9e80fa981101485babcd05c494" - integrity sha512-W+tQTVcSmXtFh7FWYWwPBGXJ1xDgREbIyI1E5JzDcimZLIyT5gGMfxR3oKPxxWj+GKMpP5ilvMQrbsPzWcm3Fw== - dependencies: - "@ipld/dag-pb" "^2.0.2" - "@multiformats/murmur3" "^1.0.3" - bl "^5.0.0" - err-code "^3.0.1" - hamt-sharding "^2.0.0" - interface-blockstore "^2.0.3" - ipfs-unixfs "^6.0.0" - it-all "^1.0.5" - it-batch "^1.0.8" - it-first "^1.0.6" - it-parallel-batch "^1.0.9" - merge-options "^3.0.4" - multiformats "^9.4.2" - rabin-wasm "^0.1.4" - uint8arrays "^3.0.0" - -ipfs-unixfs@^6.0.0, ipfs-unixfs@^6.0.3: - version "6.0.9" - resolved "https://registry.yarnpkg.com/ipfs-unixfs/-/ipfs-unixfs-6.0.9.tgz#f6613b8e081d83faa43ed96e016a694c615a9374" - integrity sha512-0DQ7p0/9dRB6XCb0mVCTli33GzIzSVx5udpJuVM47tGcD+W+Bl4LsnoLswd3ggNnNEakMv1FdoFITiEnchXDqQ== - dependencies: - err-code "^3.0.1" - protobufjs "^6.10.2" - -ipfs-utils@^9.0.2: - version "9.0.9" - resolved "https://registry.yarnpkg.com/ipfs-utils/-/ipfs-utils-9.0.9.tgz#54551093846a230be07e473187d2d063685ebe83" - integrity sha512-auKjNok5bFhid1JmnXn+QFKaGrKrxgbUpVD0v4XkIKIH7kCR9zWOihErPKBDfJXfF8YycQ+SvPgX1XOpDgUC5Q== - dependencies: - any-signal "^3.0.0" - buffer "^6.0.1" - electron-fetch "^1.7.2" - err-code "^3.0.1" - is-electron "^2.2.0" - iso-url "^1.1.5" - it-glob "^1.0.1" - it-to-stream "^1.0.0" - merge-options "^3.0.4" - nanoid "^3.1.20" - native-fetch "^3.0.0" - node-fetch "https://registry.npmjs.org/@achingbrain/node-fetch/-/node-fetch-2.6.7.tgz" - react-native-fetch-api "^2.0.0" - stream-to-it "^0.2.2" - iron-webcrypto@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/iron-webcrypto/-/iron-webcrypto-1.0.0.tgz#e3b689c0c61b434a0a4cb82d0aeabbc8b672a867" @@ -16046,11 +15712,6 @@ is-dom@^1.0.0: is-object "^1.0.1" is-window "^1.0.2" -is-electron@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/is-electron/-/is-electron-2.2.1.tgz#751b1dd8a74907422faa5c35aaa0cf66d98086e9" - integrity sha512-r8EEQQsqT+Gn0aXFx7lTFygYQhILLCB+wn0WCDL5LZRINeLH/Rvw1j2oKodELLXYNImQ3CRlVsY8wW4cGOsyuw== - is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -16131,13 +15792,6 @@ is-interactive@^1.0.0: resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== -is-ip@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-ip/-/is-ip-3.1.0.tgz#2ae5ddfafaf05cb8008a62093cf29734f657c5d8" - integrity sha512-35vd5necO7IitFPjd/YBeqwWnyDWbuLH9ZXQdMfDA8TEo7pv5X8yfrvVO3xbJbLUlERCMvf6X0hTUamQxCYJ9Q== - dependencies: - ip-regex "^4.0.0" - is-lambda@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-lambda/-/is-lambda-1.0.1.tgz#3d9877899e6a53efc0160504cde15f82e6f061d5" @@ -16202,7 +15856,7 @@ is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" integrity sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg== -is-plain-obj@^2.0.0, is-plain-obj@^2.1.0: +is-plain-obj@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== @@ -16415,11 +16069,6 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== -iso-url@^1.1.5: - version "1.2.1" - resolved "https://registry.yarnpkg.com/iso-url/-/iso-url-1.2.1.tgz#db96a49d8d9a64a1c889fc07cc525d093afb1811" - integrity sha512-9JPDgCN4B7QPkLtYAAOrEuAWvP9rWvR5offAr0/SeF046wIkglqH3VXgYYP6NcsKslH80UIVgmPqNe3j7tG2ng== - isobject@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" @@ -16497,83 +16146,6 @@ istanbul-reports@^3.1.3, istanbul-reports@^3.1.4: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -it-all@^1.0.4, it-all@^1.0.5: - version "1.0.6" - resolved "https://registry.yarnpkg.com/it-all/-/it-all-1.0.6.tgz#852557355367606295c4c3b7eff0136f07749335" - integrity sha512-3cmCc6Heqe3uWi3CVM/k51fa/XbMFpQVzFoDsV0IZNHSQDyAXl3c4MjHkFX5kF3922OGj7Myv1nSEUgRtcuM1A== - -it-batch@^1.0.8, it-batch@^1.0.9: - version "1.0.9" - resolved "https://registry.yarnpkg.com/it-batch/-/it-batch-1.0.9.tgz#7e95aaacb3f9b1b8ca6c8b8367892171d6a5b37f" - integrity sha512-7Q7HXewMhNFltTsAMdSz6luNhyhkhEtGGbYek/8Xb/GiqYMtwUmopE1ocPSiJKKp3rM4Dt045sNFoUu+KZGNyA== - -it-drain@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/it-drain/-/it-drain-1.0.5.tgz#0466d4e286b37bcd32599d4e99b37a87cb8cfdf6" - integrity sha512-r/GjkiW1bZswC04TNmUnLxa6uovme7KKwPhc+cb1hHU65E3AByypHH6Pm91WHuvqfFsm+9ws0kPtDBV3/8vmIg== - -it-filter@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/it-filter/-/it-filter-1.0.3.tgz#66ea0cc4bf84af71bebd353c05a9c5735fcba751" - integrity sha512-EI3HpzUrKjTH01miLHWmhNWy3Xpbx4OXMXltgrNprL5lDpF3giVpHIouFpr5l+evXw6aOfxhnt01BIB+4VQA+w== - -it-first@^1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/it-first/-/it-first-1.0.7.tgz#a4bef40da8be21667f7d23e44dae652f5ccd7ab1" - integrity sha512-nvJKZoBpZD/6Rtde6FXqwDqDZGF1sCADmr2Zoc0hZsIvnE449gRFnGctxDf09Bzc/FWnHXAdaHVIetY6lrE0/g== - -it-glob@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/it-glob/-/it-glob-1.0.2.tgz#bab9b04d6aaac42884502f3a0bfee84c7a29e15e" - integrity sha512-Ch2Dzhw4URfB9L/0ZHyY+uqOnKvBNeS/SMcRiPmJfpHiM0TsUZn+GkpcZxAoF3dJVdPm/PuIk3A4wlV7SUo23Q== - dependencies: - "@types/minimatch" "^3.0.4" - minimatch "^3.0.4" - -it-last@^1.0.5: - version "1.0.6" - resolved "https://registry.yarnpkg.com/it-last/-/it-last-1.0.6.tgz#4106232e5905ec11e16de15a0e9f7037eaecfc45" - integrity sha512-aFGeibeiX/lM4bX3JY0OkVCFkAw8+n9lkukkLNivbJRvNz8lI3YXv5xcqhFUV2lDJiraEK3OXRDbGuevnnR67Q== - -it-map@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/it-map/-/it-map-1.0.6.tgz#6aa547e363eedcf8d4f69d8484b450bc13c9882c" - integrity sha512-XT4/RM6UHIFG9IobGlQPFQUrlEKkU4eBUFG3qhWhfAdh1JfF2x11ShCrKCdmZ0OiZppPfoLuzcfA4cey6q3UAQ== - -it-parallel-batch@^1.0.9: - version "1.0.11" - resolved "https://registry.yarnpkg.com/it-parallel-batch/-/it-parallel-batch-1.0.11.tgz#f889b4e1c7a62ef24111dbafbaaa010b33d00f69" - integrity sha512-UWsWHv/kqBpMRmyZJzlmZeoAMA0F3SZr08FBdbhtbe+MtoEBgr/ZUAKrnenhXCBrsopy76QjRH2K/V8kNdupbQ== - dependencies: - it-batch "^1.0.9" - -it-peekable@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/it-peekable/-/it-peekable-1.0.3.tgz#8ebe933767d9c5aa0ae4ef8e9cb3a47389bced8c" - integrity sha512-5+8zemFS+wSfIkSZyf0Zh5kNN+iGyccN02914BY4w/Dj+uoFEoPSvj5vaWn8pNZJNSxzjW0zHRxC3LUb2KWJTQ== - -it-pipe@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/it-pipe/-/it-pipe-1.1.0.tgz#f5964c6bb785dd776f11a62d1e75964787ab95ce" - integrity sha512-lF0/3qTVeth13TOnHVs0BTFaziwQF7m5Gg+E6JV0BXcLKutC92YjSi7bASgkPOXaLEb+YvNZrPorGMBIJvZfxg== - -it-take@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/it-take/-/it-take-1.0.2.tgz#b5f1570014db7c3454897898b69bb7ac9c3bffc1" - integrity sha512-u7I6qhhxH7pSevcYNaMECtkvZW365ARqAIt9K+xjdK1B2WUDEjQSfETkOCT8bxFq/59LqrN3cMLUtTgmDBaygw== - -it-to-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/it-to-stream/-/it-to-stream-1.0.0.tgz#6c47f91d5b5df28bda9334c52782ef8e97fe3a4a" - integrity sha512-pLULMZMAB/+vbdvbZtebC0nWBTbG581lk6w8P7DfIIIKUfa8FbY7Oi0FxZcFPbxvISs7A9E+cMpLDBc1XhpAOA== - dependencies: - buffer "^6.0.3" - fast-fifo "^1.0.0" - get-iterator "^1.0.2" - p-defer "^3.0.0" - p-fifo "^1.0.0" - readable-stream "^3.6.0" - iterate-iterator@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/iterate-iterator/-/iterate-iterator-1.0.2.tgz#551b804c9eaa15b847ea6a7cdc2f5bf1ec150f91" @@ -17114,6 +16686,11 @@ jiti@^1.17.1, jiti@^1.18.2, jiti@^1.19.1, jiti@^1.21.0: resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.21.0.tgz#7c97f8fe045724e136a397f7340475244156105d" integrity sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q== +jmespath@0.16.0: + version "0.16.0" + resolved "https://registry.yarnpkg.com/jmespath/-/jmespath-0.16.0.tgz#b15b0a85dfd4d930d43e69ed605943c802785076" + integrity sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw== + jose@^5.0.0: version "5.1.1" resolved "https://registry.yarnpkg.com/jose/-/jose-5.1.1.tgz#d61b923baa6bdeb01040afae8295a084c4b9eb58" @@ -18347,36 +17924,11 @@ meow@^8.0.0: type-fest "^0.18.0" yargs-parser "^20.2.3" -meow@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/meow/-/meow-9.0.0.tgz#cd9510bc5cac9dee7d03c73ee1f9ad959f4ea364" - integrity sha512-+obSblOQmRhcyBt62furQqRAQpNyWXo8BuQ5bN7dG8wmwQ+vwHKp/rCFD4CrTP8CsDQD1sjoZ94K417XEUk8IQ== - dependencies: - "@types/minimist" "^1.2.0" - camelcase-keys "^6.2.2" - decamelize "^1.2.0" - decamelize-keys "^1.1.0" - hard-rejection "^2.1.0" - minimist-options "4.1.0" - normalize-package-data "^3.0.0" - read-pkg-up "^7.0.1" - redent "^3.0.0" - trim-newlines "^3.0.0" - type-fest "^0.18.0" - yargs-parser "^20.2.3" - merge-descriptors@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== -merge-options@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/merge-options/-/merge-options-3.0.4.tgz#84709c2aa2a4b24c1981f66c179fe5565cc6dbb7" - integrity sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ== - dependencies: - is-plain-obj "^2.1.0" - merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" @@ -19013,13 +18565,6 @@ move-concurrently@^1.0.1: rimraf "^2.5.4" run-queue "^1.0.3" -move-file@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/move-file/-/move-file-2.1.0.tgz#3bec9d34fbe4832df6865f112cda4492b56e8507" - integrity sha512-i9qLW6gqboJ5Ht8bauZi7KlTnQ3QFpBCvMvFfEcHADKgHGeJ9BZMO7SFCTwHPV9Qa0du9DYY1Yx3oqlGt30nXA== - dependencies: - path-exists "^4.0.0" - mri@^1.1.0, mri@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" @@ -19055,26 +18600,7 @@ ms@2.1.3, ms@^2.0.0, ms@^2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -multiaddr-to-uri@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/multiaddr-to-uri/-/multiaddr-to-uri-8.0.0.tgz#65efe4b1f9de5f6b681aa42ff36a7c8db7625e58" - integrity sha512-dq4p/vsOOUdVEd1J1gl+R2GFrXJQH8yjLtz4hodqdVbieg39LvBOdMQRdQnfbg5LSM/q1BYNVf5CBbwZFFqBgA== - dependencies: - multiaddr "^10.0.0" - -multiaddr@^10.0.0: - version "10.0.1" - resolved "https://registry.yarnpkg.com/multiaddr/-/multiaddr-10.0.1.tgz#0d15848871370860a4d266bb44d93b3dac5d90ef" - integrity sha512-G5upNcGzEGuTHkzxezPrrD6CaIHR9uo+7MwqhNVcXTs33IInon4y7nMiGxl2CY5hG7chvYQUQhz5V52/Qe3cbg== - dependencies: - dns-over-http-resolver "^1.2.3" - err-code "^3.0.1" - is-ip "^3.1.0" - multiformats "^9.4.5" - uint8arrays "^3.0.0" - varint "^6.0.0" - -multiformats@^9.0.4, multiformats@^9.4.13, multiformats@^9.4.2, multiformats@^9.4.5, multiformats@^9.4.7, multiformats@^9.5.4, multiformats@^9.6.3, multiformats@^9.6.4: +multiformats@^9.4.2: version "9.9.0" resolved "https://registry.yarnpkg.com/multiformats/-/multiformats-9.9.0.tgz#c68354e7d21037a8f1f8833c8ccd68618e8f1d37" integrity sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg== @@ -19090,11 +18616,6 @@ multimatch@^5.0.0: arrify "^2.0.1" minimatch "^3.0.4" -murmurhash3js-revisited@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/murmurhash3js-revisited/-/murmurhash3js-revisited-3.0.0.tgz#6bd36e25de8f73394222adc6e41fa3fac08a5869" - integrity sha512-/sF3ee6zvScXMb1XFJ8gDsSnY+X8PbOyjIuBhtgis10W2Jx4ZjIhikUCIF9c4gpJxVnQIsPAFrSwTCuAjicP6g== - mute-stream@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" @@ -19133,7 +18654,7 @@ nano-css@^5.6.1: stacktrace-js "^2.0.2" stylis "^4.3.0" -nanoid@^3.0.2, nanoid@^3.1.20, nanoid@^3.1.23, nanoid@^3.3.1, nanoid@^3.3.4, nanoid@^3.3.7: +nanoid@^3.3.1, nanoid@^3.3.4, nanoid@^3.3.7: version "3.3.7" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== @@ -19165,16 +18686,6 @@ napi-wasm@^1.1.0: resolved "https://registry.yarnpkg.com/napi-wasm/-/napi-wasm-1.1.0.tgz#bbe617823765ae9c1bc12ff5942370eae7b2ba4e" integrity sha512-lHwIAJbmLSjF9VDRm9GoVOy9AGp3aIvkjv+Kvz9h16QR3uSVYH78PNQUnT2U4X53mhlnV2M7wrhibQ3GHicDmg== -native-abort-controller@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/native-abort-controller/-/native-abort-controller-1.0.4.tgz#39920155cc0c18209ff93af5bc90be856143f251" - integrity sha512-zp8yev7nxczDJMoP6pDxyD20IU0T22eX8VwN2ztDccKvSZhRaV33yP1BGwKSZfXuqWUzsXopVFjBdau9OOAwMQ== - -native-fetch@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/native-fetch/-/native-fetch-3.0.0.tgz#06ccdd70e79e171c365c75117959cf4fe14a09bb" - integrity sha512-G3Z7vx0IFb/FQ4JxvtqGABsOTIqRWvgQz6e+erkB+JJD6LrszQtMozEHI4EkmgZQvnGHrpLVzUWk7t4sJCIkVw== - natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -19252,25 +18763,6 @@ next@^13.3.0: "@next/swc-win32-ia32-msvc" "13.3.0" "@next/swc-win32-x64-msvc" "13.3.0" -nft.storage@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/nft.storage/-/nft.storage-7.0.0.tgz#9855106a16649673db12684232bb0292694230fe" - integrity sha512-6ris9loxF9TNTPY/JghLzdLlvFV3UzWkUcVTfmrRn49jzDUfyT5wMhDmYRBQuknNFN1jf7jlSGNHixs5SpOoOA== - dependencies: - "@ipld/car" "^3.2.3" - "@ipld/dag-cbor" "^6.0.13" - "@web-std/blob" "^3.0.1" - "@web-std/fetch" "^3.0.3" - "@web-std/file" "^3.0.0" - "@web-std/form-data" "^3.0.0" - carbites "^1.0.6" - ipfs-car "^0.6.2" - it-pipe "^1.1.0" - multiformats "^9.6.4" - p-retry "^4.6.1" - streaming-iterables "^6.0.0" - throttled-queue "^2.1.2" - nice-try@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" @@ -19337,10 +18829,6 @@ node-fetch@^2.6.1, node-fetch@^2.6.12, node-fetch@^2.6.7: dependencies: whatwg-url "^5.0.0" -"node-fetch@https://registry.npmjs.org/@achingbrain/node-fetch/-/node-fetch-2.6.7.tgz": - version "2.6.7" - resolved "https://registry.npmjs.org/@achingbrain/node-fetch/-/node-fetch-2.6.7.tgz#1b5d62978f2ed07b99444f64f0df39f960a6d34d" - node-forge@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3" @@ -19942,11 +19430,6 @@ p-defer@^1.0.0: resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" integrity sha512-wB3wfAxZpk2AzOfUMJNL+d36xothRSyj8EXOa4f6GMqYDN9BJaaSISbsk+wS9abmnebVw95C2Kb5t85UmpCxuw== -p-defer@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-3.0.0.tgz#d1dceb4ee9b2b604b1d94ffec83760175d4e6f83" - integrity sha512-ugZxsxmtTln604yeYd29EGrNhazN2lywetzpKhfmQjW/VJmhpDmWbiX+h0zL8V91R0UXkhb3KtPmyq9PZw3aYw== - p-event@^4.1.0: version "4.2.0" resolved "https://registry.yarnpkg.com/p-event/-/p-event-4.2.0.tgz#af4b049c8acd91ae81083ebd1e6f5cae2044c1b5" @@ -19954,14 +19437,6 @@ p-event@^4.1.0: dependencies: p-timeout "^3.1.0" -p-fifo@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-fifo/-/p-fifo-1.0.0.tgz#e29d5cf17c239ba87f51dde98c1d26a9cfe20a63" - integrity sha512-IjoCxXW48tqdtDFz6fqo5q1UfFVjjVZe8TC1QRflvNUJtNfCUhxOUw6MOVZhDPjqhSzc26xKdugsO17gmzd5+A== - dependencies: - fast-fifo "^1.0.0" - p-defer "^3.0.0" - p-filter@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/p-filter/-/p-filter-2.1.0.tgz#1b1472562ae7a0f742f0f3d3d3718ea66ff9c09c" @@ -20065,14 +19540,6 @@ p-reduce@^2.0.0, p-reduce@^2.1.0: resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-2.1.0.tgz#09408da49507c6c274faa31f28df334bc712b64a" integrity sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw== -p-retry@^4.6.1: - version "4.6.2" - resolved "https://registry.yarnpkg.com/p-retry/-/p-retry-4.6.2.tgz#9baae7184057edd4e17231cee04264106e092a16" - integrity sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ== - dependencies: - "@types/retry" "0.12.0" - retry "^0.13.1" - p-timeout@^3.1.0, p-timeout@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-3.2.0.tgz#c7e17abc971d2a7962ef83626b35d635acf23dfe" @@ -20183,11 +19650,6 @@ parse-conflict-json@^2.0.1: just-diff "^5.0.1" just-diff-apply "^5.2.0" -parse-duration@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/parse-duration/-/parse-duration-1.0.2.tgz#b9aa7d3a1363cc7e8845bea8fd3baf8a11df5805" - integrity sha512-Dg27N6mfok+ow1a2rj/nRjtCfaKrHUZV2SJpEn/s8GaVUSlf4GGRCRP1c13Hj+wfPKVMrFDqLMLITkYKgKxyyg== - parse-entities@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-2.0.0.tgz#53c6eb5b9314a1f4ec99fa0fdf7ce01ecda0cbe8" @@ -20992,7 +20454,7 @@ proto-list@~1.2.1: resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" integrity sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA== -protobufjs@^6.10.2, protobufjs@^6.11.2, protobufjs@^6.8.8, protobufjs@~6.11.2: +protobufjs@^6.11.2, protobufjs@^6.8.8, protobufjs@~6.11.2: version "6.11.4" resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.4.tgz#29a412c38bf70d89e537b6d02d904a6f448173aa" integrity sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw== @@ -21076,6 +20538,11 @@ pumpify@^1.3.3: inherits "^2.0.3" pump "^2.0.0" +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + integrity sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw== + punycode@^1.2.4, punycode@^1.3.2, punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" @@ -21156,6 +20623,11 @@ querystring-es3@^0.2.0: resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" integrity sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA== +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + integrity sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g== + querystring@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.1.tgz#40d77615bb09d16902a85c3e38aa8b5ed761c2dd" @@ -21188,18 +20660,6 @@ quick-lru@^5.1.1: resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== -rabin-wasm@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/rabin-wasm/-/rabin-wasm-0.1.5.tgz#5b625ca007d6a2cbc1456c78ae71d550addbc9c9" - integrity sha512-uWgQTo7pim1Rnj5TuWcCewRDTf0PEFTSlaUjWP4eY9EbLV9em08v89oCz/WO+wRxpYuO36XEHp4wgYQnAgOHzA== - dependencies: - "@assemblyscript/loader" "^0.9.4" - bl "^5.0.0" - debug "^4.3.1" - minimist "^1.2.5" - node-fetch "^2.6.1" - readable-stream "^3.6.0" - radix3@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/radix3/-/radix3-1.1.0.tgz#9745df67a49c522e94a33d0a93cf743f104b6e0d" @@ -21398,13 +20858,6 @@ react-markdown@^8.0.0: unist-util-visit "^4.0.0" vfile "^5.0.0" -react-native-fetch-api@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/react-native-fetch-api/-/react-native-fetch-api-2.0.0.tgz#c4af188b4fce3f3eaf1f1ff4e61dae1a00d4ffa0" - integrity sha512-GOA8tc1EVYLnHvma/TU9VTgLOyralO7eATRuCDchQveXW9Fr9vXygyq9iwqmM7YRZ8qRJfEt9xOS7OYMdJvRFw== - dependencies: - p-defer "^3.0.0" - react-player@^2.12.0: version "2.12.0" resolved "https://registry.yarnpkg.com/react-player/-/react-player-2.12.0.tgz#2fc05dbfec234c829292fbca563b544064bd14f0" @@ -21632,13 +21085,6 @@ real-require@^0.1.0: resolved "https://registry.yarnpkg.com/real-require/-/real-require-0.1.0.tgz#736ac214caa20632847b7ca8c1056a0767df9381" integrity sha512-r/H9MzAWtrv8aSVjPCMFpDMl5q66GqtmmRkRjpHTsp4zBAa+snZyiQNlMONiUmEJcsnaw0wCauJ2GWODr/aFkg== -receptacle@^1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/receptacle/-/receptacle-1.3.2.tgz#a7994c7efafc7a01d0e2041839dab6c4951360d2" - integrity sha512-HrsFvqZZheusncQRiEE7GatOAETrARKV/lnfYicIm8lbvp/JQOdADOfhjBd2DajvoszEyxSM6RlAAIZgEoeu/A== - dependencies: - ms "^2.1.1" - rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" @@ -22052,21 +21498,11 @@ ret@~0.1.10: resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== -retimer@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/retimer/-/retimer-2.0.0.tgz#e8bd68c5e5a8ec2f49ccb5c636db84c04063bbca" - integrity sha512-KLXY85WkEq2V2bKex/LOO1ViXVn2KGYe4PYysAdYdjmraYIUsVkXu8O4am+8+5UbaaGl1qho4aqAAPHNQ4GSbg== - retry@^0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" integrity sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow== -retry@^0.13.1: - version "0.13.1" - resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" - integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== - reusify@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" @@ -22245,6 +21681,16 @@ sass-loader@^12.4.0: klona "^2.0.4" neo-async "^2.6.2" +sax@1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.1.tgz#7b8e656190b228e81a66aea748480d828cd2d37a" + integrity sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA== + +sax@>=0.6.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.3.0.tgz#a5dbe77db3be05c9d1ee7785dbd3ea9de51593d0" + integrity sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA== + scheduler@^0.23.0: version "0.23.0" resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe" @@ -22806,11 +22252,6 @@ space-separated-tokens@^2.0.0: resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-2.0.1.tgz#43193cec4fb858a2ce934b7f98b7f2c18107098b" integrity sha512-ekwEbFp5aqSPKaqeY1PGrlGQxPNaq+Cnx4+bE2D8sciBQrHpbwoBbawqTN2+6jPs9IdWxxiUcN0K2pkczD3zmw== -sparse-array@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/sparse-array/-/sparse-array-1.3.2.tgz#0e1a8b71706d356bc916fe754ff496d450ec20b0" - integrity sha512-ZT711fePGn3+kQyLuv1fpd3rNSkNF8vd5Kv2D+qnOANeyKs3fx6bUMGWRPvgTTcYV64QMqZKZwcuaQSP3AZ0tg== - spdx-correct@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" @@ -23055,13 +22496,6 @@ stream-shift@^1.0.0: resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== -stream-to-it@^0.2.2, stream-to-it@^0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/stream-to-it/-/stream-to-it-0.2.4.tgz#d2fd7bfbd4a899b4c0d6a7e6a533723af5749bd0" - integrity sha512-4vEbkSs83OahpmBybNJXlJd7d6/RxzkkSdT3I0mnGt79Xd2Kk+e1JqbvAvsQfCeKj3aKb0QIWkyK3/n0j506vQ== - dependencies: - get-iterator "^1.0.2" - stream@^0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/stream/-/stream-0.0.2.tgz#7f5363f057f6592c5595f00bc80a27f5cec1f0ef" @@ -23069,11 +22503,6 @@ stream@^0.0.2: dependencies: emitter-component "^1.1.1" -streaming-iterables@^6.0.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/streaming-iterables/-/streaming-iterables-6.2.0.tgz#e8079bc56272335b287e2f13274602fbef008e56" - integrity sha512-3AYC8oB60WyD1ic7uHmN/vm2oRGzRnQ3XFBl/bFMDi1q1+nc5/vjMmiE4vroIya3jG59t87VpyAj/iXYxyw9AA== - streamsearch@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" @@ -23699,11 +23128,6 @@ throttle-debounce@^3.0.1: resolved "https://registry.yarnpkg.com/throttle-debounce/-/throttle-debounce-3.0.1.tgz#32f94d84dfa894f786c9a1f290e7a645b6a19abb" integrity sha512-dTEWWNu6JmeVXY0ZYoPuH5cRIwc0MeGbJwah9KUNYSJwommQpCzTySTpEe8Gs1J23aeWEuAobe4Ag7EHVt/LOg== -throttled-queue@^2.1.2: - version "2.1.4" - resolved "https://registry.yarnpkg.com/throttled-queue/-/throttled-queue-2.1.4.tgz#4e2008c73ab3f72ba1bb09496c3cc9c5b745dbee" - integrity sha512-YGdk8sdmr4ge3g+doFj/7RLF5kLM+Mi7DEciu9PHxnMJZMeVuZeTj31g4VE7ekUffx/IdbvrtOCiz62afg0mkg== - through2@^2.0.0: version "2.0.5" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" @@ -23724,14 +23148,6 @@ through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6, through@^2.3.8: resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== -timeout-abort-controller@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/timeout-abort-controller/-/timeout-abort-controller-1.1.1.tgz#2c3c3c66f13c783237987673c276cbd7a9762f29" - integrity sha512-BsF9i3NAJag6T0ZEjki9j654zoafI2X6ayuNd6Tp8+Ul6Tr5s4jo973qFeiWrRSweqvskC+AHDKUmIW4b7pdhQ== - dependencies: - abort-controller "^3.0.0" - retimer "^2.0.0" - timers-browserify@^2.0.4: version "2.0.12" resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.12.tgz#44a45c11fbf407f34f97bccd1577c652361b00ee" @@ -24650,6 +24066,14 @@ url-loader@^4.1.1: mime-types "^2.1.27" schema-utils "^3.0.0" +url@0.10.3: + version "0.10.3" + resolved "https://registry.yarnpkg.com/url/-/url-0.10.3.tgz#021e4d9c7705f21bbf37d03ceb58767402774c64" + integrity sha512-hzSUW2q06EqL1gKM/a+obYHLIO6ct2hwPuviqTTOcfFVc61UbfJ2Q32+uGL/HCPxKqrdGB5QUwIe7UqlDgwsOQ== + dependencies: + punycode "1.3.2" + querystring "0.2.0" + url@^0.11.0, url@^0.11.1: version "0.11.1" resolved "https://registry.yarnpkg.com/url/-/url-0.11.1.tgz#26f90f615427eca1b9f4d6a28288c147e2302a32" @@ -24722,7 +24146,7 @@ util@^0.11.0: dependencies: inherits "2.0.3" -util@^0.12.3, util@^0.12.5: +util@^0.12.4, util@^0.12.5: version "0.12.5" resolved "https://registry.yarnpkg.com/util/-/util-0.12.5.tgz#5f17a6059b73db61a875668781a1c2b136bd6fbc" integrity sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA== @@ -24753,6 +24177,11 @@ uuid-browser@^3.1.0: resolved "https://registry.yarnpkg.com/uuid-browser/-/uuid-browser-3.1.0.tgz#0f05a40aef74f9e5951e20efbf44b11871e56410" integrity sha512-dsNgbLaTrd6l3MMxTtouOCFw4CBFc/3a+GgYA2YyrJvyQ1u6q4pcu3ktLoUZ/VN/Aw9WsauazbgsgdfVWgAKQg== +uuid@8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.0.0.tgz#bc6ccf91b5ff0ac07bbcdbf1c7c4e150db4dbb6c" + integrity sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw== + uuid@^3.3.2: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" @@ -24824,11 +24253,6 @@ value-or-promise@^1.0.11, value-or-promise@^1.0.12: resolved "https://registry.yarnpkg.com/value-or-promise/-/value-or-promise-1.0.12.tgz#0e5abfeec70148c78460a849f6b003ea7986f15c" integrity sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q== -varint@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/varint/-/varint-6.0.0.tgz#9881eb0ce8feaea6512439d19ddf84bf551661d0" - integrity sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg== - vary@^1, vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" @@ -24942,21 +24366,12 @@ wcwidth@^1.0.0, wcwidth@^1.0.1: dependencies: defaults "^1.0.3" -web-encoding@1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/web-encoding/-/web-encoding-1.1.5.tgz#fc810cf7667364a6335c939913f5051d3e0c4864" - integrity sha512-HYLeVCdJ0+lBYV2FvNZmv3HJ2Nt0QYXqZojk3d9FJOLkwnuhzM9tmamh8d7HPM8QqjKH8DeHkFTx+CFlWpZZDA== - dependencies: - util "^0.12.3" - optionalDependencies: - "@zxing/text-encoding" "0.9.0" - web-namespaces@^1.0.0: version "1.1.4" resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-1.1.4.tgz#bc98a3de60dadd7faefc403d1076d529f5e030ec" integrity sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw== -web-streams-polyfill@^3.1.1, web-streams-polyfill@^3.2.1: +web-streams-polyfill@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz#71c2718c52b45fd49dbeee88634b3a60ceab42a6" integrity sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q== @@ -25383,6 +24798,19 @@ x-default-browser@^0.4.0: optionalDependencies: default-browser-id "^1.0.4" +xml2js@0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.6.2.tgz#dd0b630083aa09c161e25a4d0901e2b2a929b499" + integrity sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA== + dependencies: + sax ">=0.6.0" + xmlbuilder "~11.0.0" + +xmlbuilder@~11.0.0: + version "11.0.1" + resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3" + integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA== + xmlhttprequest-ssl@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz#91360c86b914e67f44dce769180027c0da618c67" From 9be977f8cacd2634cb029564f9b368610329991c Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 3 May 2024 02:52:58 -0400 Subject: [PATCH 142/438] ignore some more errors for sentry --- apps/dapp/sentry.client.config.js | 2 ++ apps/sda/sentry.client.config.js | 2 ++ packages/stateful/server/makeGetDaoStaticProps.ts | 1 - 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/dapp/sentry.client.config.js b/apps/dapp/sentry.client.config.js index 79bbacf03..9835bc146 100644 --- a/apps/dapp/sentry.client.config.js +++ b/apps/dapp/sentry.client.config.js @@ -40,5 +40,7 @@ Sentry.init({ 'out of gas in location', 'Load failed', "'defineProperty' on proxy: trap returned falsish for property 'request'", + 'Keplr not found', + 'No wallet exists', ], }) diff --git a/apps/sda/sentry.client.config.js b/apps/sda/sentry.client.config.js index 586e685d6..9be5046a1 100644 --- a/apps/sda/sentry.client.config.js +++ b/apps/sda/sentry.client.config.js @@ -40,5 +40,7 @@ Sentry.init({ 'out of gas in location', 'Load failed', "'defineProperty' on proxy: trap returned falsish for property 'request'", + 'Keplr not found', + 'No wallet exists', ], }) diff --git a/packages/stateful/server/makeGetDaoStaticProps.ts b/packages/stateful/server/makeGetDaoStaticProps.ts index 7e4fd67ba..9842ddf3d 100644 --- a/packages/stateful/server/makeGetDaoStaticProps.ts +++ b/packages/stateful/server/makeGetDaoStaticProps.ts @@ -370,7 +370,6 @@ export const makeGetDaoStaticProps: GetDaoStaticPropsMaker = description: '', // Report to Sentry. error: processError(error, { - forceCapture: true, tags: { coreAddress, coreVersion: coreVersion ?? '', From 59a994c56a410d58b2108de8c088711a73d92dd2 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 3 May 2024 02:53:36 -0400 Subject: [PATCH 143/438] ignore more errors for sentry --- apps/dapp/sentry.client.config.js | 1 + apps/sda/sentry.client.config.js | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/dapp/sentry.client.config.js b/apps/dapp/sentry.client.config.js index 9835bc146..0e95b2da0 100644 --- a/apps/dapp/sentry.client.config.js +++ b/apps/dapp/sentry.client.config.js @@ -42,5 +42,6 @@ Sentry.init({ "'defineProperty' on proxy: trap returned falsish for property 'request'", 'Keplr not found', 'No wallet exists', + 'No internet connection', ], }) diff --git a/apps/sda/sentry.client.config.js b/apps/sda/sentry.client.config.js index 9be5046a1..29b9fd0c6 100644 --- a/apps/sda/sentry.client.config.js +++ b/apps/sda/sentry.client.config.js @@ -42,5 +42,6 @@ Sentry.init({ "'defineProperty' on proxy: trap returned falsish for property 'request'", 'Keplr not found', 'No wallet exists', + 'No internet connection', ], }) From ff56e63b84868112f0f8b69abbc86a29a2f37cdf Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 3 May 2024 02:54:57 -0400 Subject: [PATCH 144/438] recognize no such contract errors --- packages/utils/error.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/utils/error.ts b/packages/utils/error.ts index a3010d45e..df212b6dc 100644 --- a/packages/utils/error.ts +++ b/packages/utils/error.ts @@ -113,6 +113,7 @@ export enum CommonError { DaoInactive = 'This DAO is inactive, which means insufficient voting power has been staked. You cannot create a proposal at this time.', ReconnectWallet = 'Please disconnect and reconnect your wallet.', ProposalTooLarge = 'Proposal is too large. Please remove actions or shorten the description.', + NoSuchContract = 'Contract not found.', } // List of error substrings to match to determine the common error. Elements in @@ -184,6 +185,7 @@ const commonErrorPatterns: Record = { ], [CommonError.ReconnectWallet]: [['Session', 'not established yet']], [CommonError.ProposalTooLarge]: [['proposal is', 'bytes, must be <=']], + [CommonError.NoSuchContract]: ['no such contract'], } const commonErrorPatternsEntries = Object.entries(commonErrorPatterns) as [ CommonError, From 21beaeb749faf66867547ba700dcaa685be180c7 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 3 May 2024 13:22:27 -0400 Subject: [PATCH 145/438] removed kujira testnet gov prop explorer URLs --- packages/utils/constants/chains.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index ceb1b64d3..161e7dd9b 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -1584,10 +1584,10 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ 'kujira1v5vn69nlmkxcdlqc36ln6fyt6vpahpj9qp9ddt3vhurxsyastknqru9qkg', explorerUrlTemplates: { tx: 'https://finder.kujira.network/harpoon-4/tx/REPLACE', - // TODO(kujira-testnet): fix - gov: 'https://blue.kujira.network/govern', - // TODO(kujira-testnet): fix - govProp: 'https://blue.kujira.network/govern/REPLACE', + // TODO(kujira-testnet): fix once can link directly to testnet + // gov: 'https://blue.kujira.network/govern', + // TODO(kujira-testnet): fix once can link directly to testnet + // govProp: 'https://blue.kujira.network/govern/REPLACE', wallet: 'https://finder.kujira.network/harpoon-4/address/REPLACE', }, codeIds: { From 964e69b683c97e22c3e71e6a91654d88b8a18e10 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 3 May 2024 17:48:07 -0400 Subject: [PATCH 146/438] added neutron's adminmodule protobufs --- .../types/protobuf/codegen/alliance/bundle.ts | 24 +- .../protobuf/codegen/alliance/rpc.query.ts | 3 + .../types/protobuf/codegen/alliance/rpc.tx.ts | 3 + .../types/protobuf/codegen/circle/bundle.ts | 24 +- .../protobuf/codegen/circle/rpc.query.ts | 3 + .../types/protobuf/codegen/circle/rpc.tx.ts | 3 + .../cosmos/adminmodule/adminmodule/genesis.ts | 93 +++ .../adminmodule/query.rpc.Query.ts | 52 ++ .../cosmos/adminmodule/adminmodule/query.ts | 561 +++++++++++++ .../adminmodule/adminmodule/tx.amino.ts | 23 + .../adminmodule/adminmodule/tx.registry.ts | 89 ++ .../adminmodule/adminmodule/tx.rpc.msg.ts | 40 + .../cosmos/adminmodule/adminmodule/tx.ts | 764 ++++++++++++++++++ .../types/protobuf/codegen/cosmos/bundle.ts | 430 +++++----- .../types/protobuf/codegen/cosmos/client.ts | 5 +- .../protobuf/codegen/cosmos/rpc.query.ts | 3 + .../types/protobuf/codegen/cosmos/rpc.tx.ts | 3 + .../types/protobuf/codegen/cosmwasm/bundle.ts | 76 +- .../protobuf/codegen/cosmwasm/rpc.query.ts | 3 + .../types/protobuf/codegen/cosmwasm/rpc.tx.ts | 3 + .../types/protobuf/codegen/gaia/bundle.ts | 36 +- .../types/protobuf/codegen/gaia/rpc.query.ts | 3 + .../types/protobuf/codegen/gaia/rpc.tx.ts | 3 + .../protobuf/codegen/gogoproto/bundle.ts | 4 +- .../types/protobuf/codegen/google/bundle.ts | 26 +- packages/types/protobuf/codegen/ibc/bundle.ts | 168 ++-- .../types/protobuf/codegen/ibc/rpc.query.ts | 3 + packages/types/protobuf/codegen/ibc/rpc.tx.ts | 3 + .../types/protobuf/codegen/juno/bundle.ts | 68 +- .../types/protobuf/codegen/juno/rpc.query.ts | 3 + .../types/protobuf/codegen/juno/rpc.tx.ts | 3 + .../types/protobuf/codegen/kujira/bundle.ts | 86 +- .../protobuf/codegen/kujira/rpc.query.ts | 3 + .../types/protobuf/codegen/kujira/rpc.tx.ts | 3 + .../types/protobuf/codegen/neutron/bundle.ts | 204 ++--- .../protobuf/codegen/neutron/rpc.query.ts | 3 + .../types/protobuf/codegen/neutron/rpc.tx.ts | 3 + .../types/protobuf/codegen/noble/bundle.ts | 20 +- .../types/protobuf/codegen/noble/rpc.query.ts | 3 + .../types/protobuf/codegen/osmosis/bundle.ts | 428 +++++----- .../protobuf/codegen/osmosis/rpc.query.ts | 3 + .../types/protobuf/codegen/osmosis/rpc.tx.ts | 3 + .../types/protobuf/codegen/pstake/bundle.ts | 138 ++-- .../protobuf/codegen/pstake/rpc.query.ts | 3 + .../types/protobuf/codegen/pstake/rpc.tx.ts | 3 + .../protobuf/codegen/publicawesome/bundle.ts | 120 +-- .../codegen/publicawesome/rpc.query.ts | 3 + .../protobuf/codegen/publicawesome/rpc.tx.ts | 3 + .../types/protobuf/codegen/regen/bundle.ts | 178 ++-- .../types/protobuf/codegen/regen/rpc.query.ts | 3 + .../types/protobuf/codegen/regen/rpc.tx.ts | 3 + .../protobuf/codegen/tendermint/bundle.ts | 38 +- packages/types/protobuf/patches.diff | 14 +- .../adminmodule/adminmodule/genesis.proto | 11 + .../adminmodule/adminmodule/query.proto | 53 ++ .../cosmos/adminmodule/adminmodule/tx.proto | 68 ++ packages/types/protobuf/scripts/codegen.js | 1 + 57 files changed, 2890 insertions(+), 1033 deletions(-) create mode 100644 packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/genesis.ts create mode 100644 packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/query.rpc.Query.ts create mode 100644 packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/query.ts create mode 100644 packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/tx.amino.ts create mode 100644 packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/tx.registry.ts create mode 100644 packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/tx.rpc.msg.ts create mode 100644 packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/tx.ts create mode 100644 packages/types/protobuf/proto/cosmos/adminmodule/adminmodule/genesis.proto create mode 100644 packages/types/protobuf/proto/cosmos/adminmodule/adminmodule/query.proto create mode 100644 packages/types/protobuf/proto/cosmos/adminmodule/adminmodule/tx.proto diff --git a/packages/types/protobuf/codegen/alliance/bundle.ts b/packages/types/protobuf/codegen/alliance/bundle.ts index 88533f350..fdc791b01 100644 --- a/packages/types/protobuf/codegen/alliance/bundle.ts +++ b/packages/types/protobuf/codegen/alliance/bundle.ts @@ -8,12 +8,12 @@ import * as _6 from "./alliance/query"; import * as _7 from "./alliance/redelegations"; import * as _8 from "./alliance/tx"; import * as _9 from "./alliance/unbonding"; -import * as _345 from "./alliance/tx.amino"; -import * as _346 from "./alliance/tx.registry"; -import * as _347 from "./alliance/query.rpc.Query"; -import * as _348 from "./alliance/tx.rpc.msg"; -import * as _576 from "./rpc.query"; -import * as _577 from "./rpc.tx"; +import * as _348 from "./alliance/tx.amino"; +import * as _349 from "./alliance/tx.registry"; +import * as _350 from "./alliance/query.rpc.Query"; +import * as _351 from "./alliance/tx.rpc.msg"; +import * as _583 from "./rpc.query"; +import * as _584 from "./rpc.tx"; export namespace alliance { export const alliance = { ..._0, @@ -26,13 +26,13 @@ export namespace alliance { ..._7, ..._8, ..._9, - ..._345, - ..._346, - ..._347, - ..._348 + ..._348, + ..._349, + ..._350, + ..._351 }; export const ClientFactory = { - ..._576, - ..._577 + ..._583, + ..._584 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/alliance/rpc.query.ts b/packages/types/protobuf/codegen/alliance/rpc.query.ts index 5b1ec6a9e..530ae9dc3 100644 --- a/packages/types/protobuf/codegen/alliance/rpc.query.ts +++ b/packages/types/protobuf/codegen/alliance/rpc.query.ts @@ -12,6 +12,9 @@ export const createRPCQueryClient = async ({ alliance: (await import("./alliance/query.rpc.Query")).createRpcQueryExtension(client) }, cosmos: { + adminmodule: { + adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) + }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/alliance/rpc.tx.ts b/packages/types/protobuf/codegen/alliance/rpc.tx.ts index 2782bd639..ad4721c43 100644 --- a/packages/types/protobuf/codegen/alliance/rpc.tx.ts +++ b/packages/types/protobuf/codegen/alliance/rpc.tx.ts @@ -8,6 +8,9 @@ export const createRPCMsgClient = async ({ alliance: new (await import("./alliance/tx.rpc.msg")).MsgClientImpl(rpc) }, cosmos: { + adminmodule: { + adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) + }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/circle/bundle.ts b/packages/types/protobuf/codegen/circle/bundle.ts index d1fbcdc7f..35b33f38f 100644 --- a/packages/types/protobuf/codegen/circle/bundle.ts +++ b/packages/types/protobuf/codegen/circle/bundle.ts @@ -14,12 +14,12 @@ import * as _23 from "./cctp/v1/sending_and_receiving_messages_paused"; import * as _24 from "./cctp/v1/signature_threshold"; import * as _25 from "./cctp/v1/token_pair"; import * as _26 from "./cctp/v1/tx"; -import * as _349 from "./cctp/v1/tx.amino"; -import * as _350 from "./cctp/v1/tx.registry"; -import * as _351 from "./cctp/v1/query.rpc.Query"; -import * as _352 from "./cctp/v1/tx.rpc.msg"; -import * as _578 from "./rpc.query"; -import * as _579 from "./rpc.tx"; +import * as _352 from "./cctp/v1/tx.amino"; +import * as _353 from "./cctp/v1/tx.registry"; +import * as _354 from "./cctp/v1/query.rpc.Query"; +import * as _355 from "./cctp/v1/tx.rpc.msg"; +import * as _585 from "./rpc.query"; +import * as _586 from "./rpc.tx"; export namespace circle { export namespace cctp { export const v1 = { @@ -39,14 +39,14 @@ export namespace circle { ..._24, ..._25, ..._26, - ..._349, - ..._350, - ..._351, - ..._352 + ..._352, + ..._353, + ..._354, + ..._355 }; } export const ClientFactory = { - ..._578, - ..._579 + ..._585, + ..._586 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/circle/rpc.query.ts b/packages/types/protobuf/codegen/circle/rpc.query.ts index 4de7815ea..1aac0f50a 100644 --- a/packages/types/protobuf/codegen/circle/rpc.query.ts +++ b/packages/types/protobuf/codegen/circle/rpc.query.ts @@ -14,6 +14,9 @@ export const createRPCQueryClient = async ({ } }, cosmos: { + adminmodule: { + adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) + }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/circle/rpc.tx.ts b/packages/types/protobuf/codegen/circle/rpc.tx.ts index 3533e340e..978f37e3e 100644 --- a/packages/types/protobuf/codegen/circle/rpc.tx.ts +++ b/packages/types/protobuf/codegen/circle/rpc.tx.ts @@ -10,6 +10,9 @@ export const createRPCMsgClient = async ({ } }, cosmos: { + adminmodule: { + adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) + }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/genesis.ts b/packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/genesis.ts new file mode 100644 index 000000000..b5bbe5b50 --- /dev/null +++ b/packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/genesis.ts @@ -0,0 +1,93 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** GenesisState defines the adminmodule module's genesis state. */ +export interface GenesisState { + admins: string[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.adminmodule.adminmodule.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the adminmodule module's genesis state. */ +export interface GenesisStateAmino { + admins?: string[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the adminmodule module's genesis state. */ +export interface GenesisStateSDKType { + admins: string[]; +} +function createBaseGenesisState(): GenesisState { + return { + admins: [] + }; +} +export const GenesisState = { + typeUrl: "/cosmos.adminmodule.adminmodule.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.admins) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admins.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.admins = object.admins?.map(e => e) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.admins = object.admins?.map(e => e) || []; + return message; + }, + toAmino(message: GenesisState, useInterfaces: boolean = false): GenesisStateAmino { + const obj: any = {}; + if (message.admins) { + obj.admins = message.admins.map(e => e); + } else { + obj.admins = []; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState, useInterfaces: boolean = false): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg, useInterfaces: boolean = false): GenesisState { + return GenesisState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/query.rpc.Query.ts b/packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/query.rpc.Query.ts new file mode 100644 index 000000000..19fcd4631 --- /dev/null +++ b/packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/query.rpc.Query.ts @@ -0,0 +1,52 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryAdminsRequest, QueryAdminsResponse, QueryArchivedProposalsRequest, QueryArchivedProposalsResponse, QueryArchivedProposalsLegacyRequest, QueryArchivedProposalsLegacyResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Queries a list of admins items. */ + admins(request?: QueryAdminsRequest): Promise; + /** Queries a list of archived proposals. */ + archivedProposals(request?: QueryArchivedProposalsRequest): Promise; + /** Queries a list of archived proposals. */ + archivedProposalsLegacy(request?: QueryArchivedProposalsLegacyRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.admins = this.admins.bind(this); + this.archivedProposals = this.archivedProposals.bind(this); + this.archivedProposalsLegacy = this.archivedProposalsLegacy.bind(this); + } + admins(request: QueryAdminsRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryAdminsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.adminmodule.adminmodule.Query", "Admins", data); + return promise.then(data => QueryAdminsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + archivedProposals(request: QueryArchivedProposalsRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryArchivedProposalsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.adminmodule.adminmodule.Query", "ArchivedProposals", data); + return promise.then(data => QueryArchivedProposalsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + archivedProposalsLegacy(request: QueryArchivedProposalsLegacyRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryArchivedProposalsLegacyRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.adminmodule.adminmodule.Query", "ArchivedProposalsLegacy", data); + return promise.then(data => QueryArchivedProposalsLegacyResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + admins(request?: QueryAdminsRequest, useInterfaces: boolean = true): Promise { + return queryService.admins(request, useInterfaces); + }, + archivedProposals(request?: QueryArchivedProposalsRequest, useInterfaces: boolean = true): Promise { + return queryService.archivedProposals(request, useInterfaces); + }, + archivedProposalsLegacy(request?: QueryArchivedProposalsLegacyRequest, useInterfaces: boolean = true): Promise { + return queryService.archivedProposalsLegacy(request, useInterfaces); + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/query.ts b/packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/query.ts new file mode 100644 index 000000000..b60239b97 --- /dev/null +++ b/packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/query.ts @@ -0,0 +1,561 @@ +//@ts-nocheck +import { Proposal as Proposal1 } from "../../gov/v1/gov"; +import { ProposalAmino as Proposal1Amino } from "../../gov/v1/gov"; +import { ProposalSDKType as Proposal1SDKType } from "../../gov/v1/gov"; +import { Proposal as Proposal2 } from "../../gov/v1beta1/gov"; +import { ProposalAmino as Proposal2Amino } from "../../gov/v1beta1/gov"; +import { ProposalSDKType as Proposal2SDKType } from "../../gov/v1beta1/gov"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +export interface QueryAdminsRequest {} +export interface QueryAdminsRequestProtoMsg { + typeUrl: "/cosmos.adminmodule.adminmodule.QueryAdminsRequest"; + value: Uint8Array; +} +export interface QueryAdminsRequestAmino {} +export interface QueryAdminsRequestAminoMsg { + type: "cosmos-sdk/QueryAdminsRequest"; + value: QueryAdminsRequestAmino; +} +export interface QueryAdminsRequestSDKType {} +export interface QueryAdminsResponse { + admins: string[]; +} +export interface QueryAdminsResponseProtoMsg { + typeUrl: "/cosmos.adminmodule.adminmodule.QueryAdminsResponse"; + value: Uint8Array; +} +export interface QueryAdminsResponseAmino { + admins?: string[]; +} +export interface QueryAdminsResponseAminoMsg { + type: "cosmos-sdk/QueryAdminsResponse"; + value: QueryAdminsResponseAmino; +} +export interface QueryAdminsResponseSDKType { + admins: string[]; +} +export interface QueryArchivedProposalsRequest {} +export interface QueryArchivedProposalsRequestProtoMsg { + typeUrl: "/cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest"; + value: Uint8Array; +} +export interface QueryArchivedProposalsRequestAmino {} +export interface QueryArchivedProposalsRequestAminoMsg { + type: "cosmos-sdk/QueryArchivedProposalsRequest"; + value: QueryArchivedProposalsRequestAmino; +} +export interface QueryArchivedProposalsRequestSDKType {} +export interface QueryArchivedProposalsLegacyRequest {} +export interface QueryArchivedProposalsLegacyRequestProtoMsg { + typeUrl: "/cosmos.adminmodule.adminmodule.QueryArchivedProposalsLegacyRequest"; + value: Uint8Array; +} +export interface QueryArchivedProposalsLegacyRequestAmino {} +export interface QueryArchivedProposalsLegacyRequestAminoMsg { + type: "cosmos-sdk/QueryArchivedProposalsLegacyRequest"; + value: QueryArchivedProposalsLegacyRequestAmino; +} +export interface QueryArchivedProposalsLegacyRequestSDKType {} +export interface QueryProposalsResponse { + proposals: Proposal1[]; +} +export interface QueryProposalsResponseProtoMsg { + typeUrl: "/cosmos.adminmodule.adminmodule.QueryProposalsResponse"; + value: Uint8Array; +} +export interface QueryProposalsResponseAmino { + proposals?: Proposal1Amino[]; +} +export interface QueryProposalsResponseAminoMsg { + type: "cosmos-sdk/QueryProposalsResponse"; + value: QueryProposalsResponseAmino; +} +export interface QueryProposalsResponseSDKType { + proposals: Proposal1SDKType[]; +} +export interface QueryArchivedProposalsResponse { + proposals: Proposal1[]; +} +export interface QueryArchivedProposalsResponseProtoMsg { + typeUrl: "/cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse"; + value: Uint8Array; +} +export interface QueryArchivedProposalsResponseAmino { + proposals?: Proposal1Amino[]; +} +export interface QueryArchivedProposalsResponseAminoMsg { + type: "cosmos-sdk/QueryArchivedProposalsResponse"; + value: QueryArchivedProposalsResponseAmino; +} +export interface QueryArchivedProposalsResponseSDKType { + proposals: Proposal1SDKType[]; +} +export interface QueryArchivedProposalsLegacyResponse { + proposalsLegacy: Proposal2[]; +} +export interface QueryArchivedProposalsLegacyResponseProtoMsg { + typeUrl: "/cosmos.adminmodule.adminmodule.QueryArchivedProposalsLegacyResponse"; + value: Uint8Array; +} +export interface QueryArchivedProposalsLegacyResponseAmino { + proposalsLegacy?: Proposal2Amino[]; +} +export interface QueryArchivedProposalsLegacyResponseAminoMsg { + type: "cosmos-sdk/QueryArchivedProposalsLegacyResponse"; + value: QueryArchivedProposalsLegacyResponseAmino; +} +export interface QueryArchivedProposalsLegacyResponseSDKType { + proposalsLegacy: Proposal2SDKType[]; +} +function createBaseQueryAdminsRequest(): QueryAdminsRequest { + return {}; +} +export const QueryAdminsRequest = { + typeUrl: "/cosmos.adminmodule.adminmodule.QueryAdminsRequest", + encode(_: QueryAdminsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAdminsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAdminsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryAdminsRequest { + const message = createBaseQueryAdminsRequest(); + return message; + }, + fromAmino(_: QueryAdminsRequestAmino): QueryAdminsRequest { + const message = createBaseQueryAdminsRequest(); + return message; + }, + toAmino(_: QueryAdminsRequest, useInterfaces: boolean = false): QueryAdminsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAdminsRequestAminoMsg): QueryAdminsRequest { + return QueryAdminsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAdminsRequest, useInterfaces: boolean = false): QueryAdminsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAdminsRequest", + value: QueryAdminsRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryAdminsRequestProtoMsg, useInterfaces: boolean = false): QueryAdminsRequest { + return QueryAdminsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAdminsRequest): Uint8Array { + return QueryAdminsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAdminsRequest): QueryAdminsRequestProtoMsg { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.QueryAdminsRequest", + value: QueryAdminsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAdminsResponse(): QueryAdminsResponse { + return { + admins: [] + }; +} +export const QueryAdminsResponse = { + typeUrl: "/cosmos.adminmodule.adminmodule.QueryAdminsResponse", + encode(message: QueryAdminsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.admins) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryAdminsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAdminsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admins.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAdminsResponse { + const message = createBaseQueryAdminsResponse(); + message.admins = object.admins?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryAdminsResponseAmino): QueryAdminsResponse { + const message = createBaseQueryAdminsResponse(); + message.admins = object.admins?.map(e => e) || []; + return message; + }, + toAmino(message: QueryAdminsResponse, useInterfaces: boolean = false): QueryAdminsResponseAmino { + const obj: any = {}; + if (message.admins) { + obj.admins = message.admins.map(e => e); + } else { + obj.admins = []; + } + return obj; + }, + fromAminoMsg(object: QueryAdminsResponseAminoMsg): QueryAdminsResponse { + return QueryAdminsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAdminsResponse, useInterfaces: boolean = false): QueryAdminsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAdminsResponse", + value: QueryAdminsResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryAdminsResponseProtoMsg, useInterfaces: boolean = false): QueryAdminsResponse { + return QueryAdminsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryAdminsResponse): Uint8Array { + return QueryAdminsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAdminsResponse): QueryAdminsResponseProtoMsg { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.QueryAdminsResponse", + value: QueryAdminsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryArchivedProposalsRequest(): QueryArchivedProposalsRequest { + return {}; +} +export const QueryArchivedProposalsRequest = { + typeUrl: "/cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest", + encode(_: QueryArchivedProposalsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryArchivedProposalsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryArchivedProposalsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryArchivedProposalsRequest { + const message = createBaseQueryArchivedProposalsRequest(); + return message; + }, + fromAmino(_: QueryArchivedProposalsRequestAmino): QueryArchivedProposalsRequest { + const message = createBaseQueryArchivedProposalsRequest(); + return message; + }, + toAmino(_: QueryArchivedProposalsRequest, useInterfaces: boolean = false): QueryArchivedProposalsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryArchivedProposalsRequestAminoMsg): QueryArchivedProposalsRequest { + return QueryArchivedProposalsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryArchivedProposalsRequest, useInterfaces: boolean = false): QueryArchivedProposalsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryArchivedProposalsRequest", + value: QueryArchivedProposalsRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryArchivedProposalsRequestProtoMsg, useInterfaces: boolean = false): QueryArchivedProposalsRequest { + return QueryArchivedProposalsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryArchivedProposalsRequest): Uint8Array { + return QueryArchivedProposalsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryArchivedProposalsRequest): QueryArchivedProposalsRequestProtoMsg { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.QueryArchivedProposalsRequest", + value: QueryArchivedProposalsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryArchivedProposalsLegacyRequest(): QueryArchivedProposalsLegacyRequest { + return {}; +} +export const QueryArchivedProposalsLegacyRequest = { + typeUrl: "/cosmos.adminmodule.adminmodule.QueryArchivedProposalsLegacyRequest", + encode(_: QueryArchivedProposalsLegacyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryArchivedProposalsLegacyRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryArchivedProposalsLegacyRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryArchivedProposalsLegacyRequest { + const message = createBaseQueryArchivedProposalsLegacyRequest(); + return message; + }, + fromAmino(_: QueryArchivedProposalsLegacyRequestAmino): QueryArchivedProposalsLegacyRequest { + const message = createBaseQueryArchivedProposalsLegacyRequest(); + return message; + }, + toAmino(_: QueryArchivedProposalsLegacyRequest, useInterfaces: boolean = false): QueryArchivedProposalsLegacyRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryArchivedProposalsLegacyRequestAminoMsg): QueryArchivedProposalsLegacyRequest { + return QueryArchivedProposalsLegacyRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryArchivedProposalsLegacyRequest, useInterfaces: boolean = false): QueryArchivedProposalsLegacyRequestAminoMsg { + return { + type: "cosmos-sdk/QueryArchivedProposalsLegacyRequest", + value: QueryArchivedProposalsLegacyRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryArchivedProposalsLegacyRequestProtoMsg, useInterfaces: boolean = false): QueryArchivedProposalsLegacyRequest { + return QueryArchivedProposalsLegacyRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryArchivedProposalsLegacyRequest): Uint8Array { + return QueryArchivedProposalsLegacyRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryArchivedProposalsLegacyRequest): QueryArchivedProposalsLegacyRequestProtoMsg { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.QueryArchivedProposalsLegacyRequest", + value: QueryArchivedProposalsLegacyRequest.encode(message).finish() + }; + } +}; +function createBaseQueryProposalsResponse(): QueryProposalsResponse { + return { + proposals: [] + }; +} +export const QueryProposalsResponse = { + typeUrl: "/cosmos.adminmodule.adminmodule.QueryProposalsResponse", + encode(message: QueryProposalsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.proposals) { + Proposal1.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryProposalsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposals.push(Proposal1.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProposalsResponse { + const message = createBaseQueryProposalsResponse(); + message.proposals = object.proposals?.map(e => Proposal1.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryProposalsResponseAmino): QueryProposalsResponse { + const message = createBaseQueryProposalsResponse(); + message.proposals = object.proposals?.map(e => Proposal1.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryProposalsResponse, useInterfaces: boolean = false): QueryProposalsResponseAmino { + const obj: any = {}; + if (message.proposals) { + obj.proposals = message.proposals.map(e => e ? Proposal1.toAmino(e, useInterfaces) : undefined); + } else { + obj.proposals = []; + } + return obj; + }, + fromAminoMsg(object: QueryProposalsResponseAminoMsg): QueryProposalsResponse { + return QueryProposalsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryProposalsResponse, useInterfaces: boolean = false): QueryProposalsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryProposalsResponse", + value: QueryProposalsResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryProposalsResponseProtoMsg, useInterfaces: boolean = false): QueryProposalsResponse { + return QueryProposalsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryProposalsResponse): Uint8Array { + return QueryProposalsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryProposalsResponse): QueryProposalsResponseProtoMsg { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.QueryProposalsResponse", + value: QueryProposalsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryArchivedProposalsResponse(): QueryArchivedProposalsResponse { + return { + proposals: [] + }; +} +export const QueryArchivedProposalsResponse = { + typeUrl: "/cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse", + encode(message: QueryArchivedProposalsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.proposals) { + Proposal1.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryArchivedProposalsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryArchivedProposalsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposals.push(Proposal1.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryArchivedProposalsResponse { + const message = createBaseQueryArchivedProposalsResponse(); + message.proposals = object.proposals?.map(e => Proposal1.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryArchivedProposalsResponseAmino): QueryArchivedProposalsResponse { + const message = createBaseQueryArchivedProposalsResponse(); + message.proposals = object.proposals?.map(e => Proposal1.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryArchivedProposalsResponse, useInterfaces: boolean = false): QueryArchivedProposalsResponseAmino { + const obj: any = {}; + if (message.proposals) { + obj.proposals = message.proposals.map(e => e ? Proposal1.toAmino(e, useInterfaces) : undefined); + } else { + obj.proposals = []; + } + return obj; + }, + fromAminoMsg(object: QueryArchivedProposalsResponseAminoMsg): QueryArchivedProposalsResponse { + return QueryArchivedProposalsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryArchivedProposalsResponse, useInterfaces: boolean = false): QueryArchivedProposalsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryArchivedProposalsResponse", + value: QueryArchivedProposalsResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryArchivedProposalsResponseProtoMsg, useInterfaces: boolean = false): QueryArchivedProposalsResponse { + return QueryArchivedProposalsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryArchivedProposalsResponse): Uint8Array { + return QueryArchivedProposalsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryArchivedProposalsResponse): QueryArchivedProposalsResponseProtoMsg { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.QueryArchivedProposalsResponse", + value: QueryArchivedProposalsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryArchivedProposalsLegacyResponse(): QueryArchivedProposalsLegacyResponse { + return { + proposalsLegacy: [] + }; +} +export const QueryArchivedProposalsLegacyResponse = { + typeUrl: "/cosmos.adminmodule.adminmodule.QueryArchivedProposalsLegacyResponse", + encode(message: QueryArchivedProposalsLegacyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.proposalsLegacy) { + Proposal2.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryArchivedProposalsLegacyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryArchivedProposalsLegacyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalsLegacy.push(Proposal2.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryArchivedProposalsLegacyResponse { + const message = createBaseQueryArchivedProposalsLegacyResponse(); + message.proposalsLegacy = object.proposalsLegacy?.map(e => Proposal2.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryArchivedProposalsLegacyResponseAmino): QueryArchivedProposalsLegacyResponse { + const message = createBaseQueryArchivedProposalsLegacyResponse(); + message.proposalsLegacy = object.proposalsLegacy?.map(e => Proposal2.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryArchivedProposalsLegacyResponse, useInterfaces: boolean = false): QueryArchivedProposalsLegacyResponseAmino { + const obj: any = {}; + if (message.proposalsLegacy) { + obj.proposalsLegacy = message.proposalsLegacy.map(e => e ? Proposal2.toAmino(e, useInterfaces) : undefined); + } else { + obj.proposalsLegacy = []; + } + return obj; + }, + fromAminoMsg(object: QueryArchivedProposalsLegacyResponseAminoMsg): QueryArchivedProposalsLegacyResponse { + return QueryArchivedProposalsLegacyResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryArchivedProposalsLegacyResponse, useInterfaces: boolean = false): QueryArchivedProposalsLegacyResponseAminoMsg { + return { + type: "cosmos-sdk/QueryArchivedProposalsLegacyResponse", + value: QueryArchivedProposalsLegacyResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryArchivedProposalsLegacyResponseProtoMsg, useInterfaces: boolean = false): QueryArchivedProposalsLegacyResponse { + return QueryArchivedProposalsLegacyResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryArchivedProposalsLegacyResponse): Uint8Array { + return QueryArchivedProposalsLegacyResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryArchivedProposalsLegacyResponse): QueryArchivedProposalsLegacyResponseProtoMsg { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.QueryArchivedProposalsLegacyResponse", + value: QueryArchivedProposalsLegacyResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/tx.amino.ts b/packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/tx.amino.ts new file mode 100644 index 000000000..9ec61234b --- /dev/null +++ b/packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/tx.amino.ts @@ -0,0 +1,23 @@ +import { MsgDeleteAdmin, MsgAddAdmin, MsgSubmitProposal, MsgSubmitProposalLegacy } from "./tx"; +export const AminoConverter = { + "/cosmos.adminmodule.adminmodule.MsgDeleteAdmin": { + aminoType: "cosmos-sdk/MsgDeleteAdmin", + toAmino: MsgDeleteAdmin.toAmino, + fromAmino: MsgDeleteAdmin.fromAmino + }, + "/cosmos.adminmodule.adminmodule.MsgAddAdmin": { + aminoType: "cosmos-sdk/MsgAddAdmin", + toAmino: MsgAddAdmin.toAmino, + fromAmino: MsgAddAdmin.fromAmino + }, + "/cosmos.adminmodule.adminmodule.MsgSubmitProposal": { + aminoType: "cosmos-sdk/MsgSubmitProposal", + toAmino: MsgSubmitProposal.toAmino, + fromAmino: MsgSubmitProposal.fromAmino + }, + "/cosmos.adminmodule.adminmodule.MsgSubmitProposalLegacy": { + aminoType: "cosmos-sdk/MsgSubmitProposalLegacy", + toAmino: MsgSubmitProposalLegacy.toAmino, + fromAmino: MsgSubmitProposalLegacy.fromAmino + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/tx.registry.ts b/packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/tx.registry.ts new file mode 100644 index 000000000..8acd96814 --- /dev/null +++ b/packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/tx.registry.ts @@ -0,0 +1,89 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgDeleteAdmin, MsgAddAdmin, MsgSubmitProposal, MsgSubmitProposalLegacy } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.adminmodule.adminmodule.MsgDeleteAdmin", MsgDeleteAdmin], ["/cosmos.adminmodule.adminmodule.MsgAddAdmin", MsgAddAdmin], ["/cosmos.adminmodule.adminmodule.MsgSubmitProposal", MsgSubmitProposal], ["/cosmos.adminmodule.adminmodule.MsgSubmitProposalLegacy", MsgSubmitProposalLegacy]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + deleteAdmin(value: MsgDeleteAdmin) { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgDeleteAdmin", + value: MsgDeleteAdmin.encode(value).finish() + }; + }, + addAdmin(value: MsgAddAdmin) { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgAddAdmin", + value: MsgAddAdmin.encode(value).finish() + }; + }, + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgSubmitProposal", + value: MsgSubmitProposal.encode(value).finish() + }; + }, + submitProposalLegacy(value: MsgSubmitProposalLegacy) { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgSubmitProposalLegacy", + value: MsgSubmitProposalLegacy.encode(value).finish() + }; + } + }, + withTypeUrl: { + deleteAdmin(value: MsgDeleteAdmin) { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgDeleteAdmin", + value + }; + }, + addAdmin(value: MsgAddAdmin) { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgAddAdmin", + value + }; + }, + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgSubmitProposal", + value + }; + }, + submitProposalLegacy(value: MsgSubmitProposalLegacy) { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgSubmitProposalLegacy", + value + }; + } + }, + fromPartial: { + deleteAdmin(value: MsgDeleteAdmin) { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgDeleteAdmin", + value: MsgDeleteAdmin.fromPartial(value) + }; + }, + addAdmin(value: MsgAddAdmin) { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgAddAdmin", + value: MsgAddAdmin.fromPartial(value) + }; + }, + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgSubmitProposal", + value: MsgSubmitProposal.fromPartial(value) + }; + }, + submitProposalLegacy(value: MsgSubmitProposalLegacy) { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgSubmitProposalLegacy", + value: MsgSubmitProposalLegacy.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/tx.rpc.msg.ts b/packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/tx.rpc.msg.ts new file mode 100644 index 000000000..7e7369e05 --- /dev/null +++ b/packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/tx.rpc.msg.ts @@ -0,0 +1,40 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgDeleteAdmin, MsgDeleteAdminResponse, MsgAddAdmin, MsgAddAdminResponse, MsgSubmitProposal, MsgSubmitProposalResponse, MsgSubmitProposalLegacy, MsgSubmitProposalLegacyResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + deleteAdmin(request: MsgDeleteAdmin): Promise; + addAdmin(request: MsgAddAdmin): Promise; + submitProposal(request: MsgSubmitProposal): Promise; + submitProposalLegacy(request: MsgSubmitProposalLegacy): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.deleteAdmin = this.deleteAdmin.bind(this); + this.addAdmin = this.addAdmin.bind(this); + this.submitProposal = this.submitProposal.bind(this); + this.submitProposalLegacy = this.submitProposalLegacy.bind(this); + } + deleteAdmin(request: MsgDeleteAdmin, useInterfaces: boolean = true): Promise { + const data = MsgDeleteAdmin.encode(request).finish(); + const promise = this.rpc.request("cosmos.adminmodule.adminmodule.Msg", "DeleteAdmin", data); + return promise.then(data => MsgDeleteAdminResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + addAdmin(request: MsgAddAdmin, useInterfaces: boolean = true): Promise { + const data = MsgAddAdmin.encode(request).finish(); + const promise = this.rpc.request("cosmos.adminmodule.adminmodule.Msg", "AddAdmin", data); + return promise.then(data => MsgAddAdminResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + submitProposal(request: MsgSubmitProposal, useInterfaces: boolean = true): Promise { + const data = MsgSubmitProposal.encode(request).finish(); + const promise = this.rpc.request("cosmos.adminmodule.adminmodule.Msg", "SubmitProposal", data); + return promise.then(data => MsgSubmitProposalResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + submitProposalLegacy(request: MsgSubmitProposalLegacy, useInterfaces: boolean = true): Promise { + const data = MsgSubmitProposalLegacy.encode(request).finish(); + const promise = this.rpc.request("cosmos.adminmodule.adminmodule.Msg", "SubmitProposalLegacy", data); + return promise.then(data => MsgSubmitProposalLegacyResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/tx.ts b/packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/tx.ts new file mode 100644 index 000000000..96878dc1b --- /dev/null +++ b/packages/types/protobuf/codegen/cosmos/adminmodule/adminmodule/tx.ts @@ -0,0 +1,764 @@ +//@ts-nocheck +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +export interface MsgDeleteAdmin { + creator: string; + admin: string; +} +export interface MsgDeleteAdminProtoMsg { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgDeleteAdmin"; + value: Uint8Array; +} +export interface MsgDeleteAdminAmino { + creator?: string; + admin?: string; +} +export interface MsgDeleteAdminAminoMsg { + type: "cosmos-sdk/MsgDeleteAdmin"; + value: MsgDeleteAdminAmino; +} +export interface MsgDeleteAdminSDKType { + creator: string; + admin: string; +} +export interface MsgDeleteAdminResponse {} +export interface MsgDeleteAdminResponseProtoMsg { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse"; + value: Uint8Array; +} +export interface MsgDeleteAdminResponseAmino {} +export interface MsgDeleteAdminResponseAminoMsg { + type: "cosmos-sdk/MsgDeleteAdminResponse"; + value: MsgDeleteAdminResponseAmino; +} +export interface MsgDeleteAdminResponseSDKType {} +export interface MsgAddAdmin { + creator: string; + admin: string; +} +export interface MsgAddAdminProtoMsg { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgAddAdmin"; + value: Uint8Array; +} +export interface MsgAddAdminAmino { + creator?: string; + admin?: string; +} +export interface MsgAddAdminAminoMsg { + type: "cosmos-sdk/MsgAddAdmin"; + value: MsgAddAdminAmino; +} +export interface MsgAddAdminSDKType { + creator: string; + admin: string; +} +export interface MsgAddAdminResponse {} +export interface MsgAddAdminResponseProtoMsg { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgAddAdminResponse"; + value: Uint8Array; +} +export interface MsgAddAdminResponseAmino {} +export interface MsgAddAdminResponseAminoMsg { + type: "cosmos-sdk/MsgAddAdminResponse"; + value: MsgAddAdminResponseAmino; +} +export interface MsgAddAdminResponseSDKType {} +/** + * MsgSubmitProposalLegacy defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposalLegacy { + content?: (Any) | undefined; + proposer: string; +} +export interface MsgSubmitProposalLegacyProtoMsg { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgSubmitProposalLegacy"; + value: Uint8Array; +} +export type MsgSubmitProposalLegacyEncoded = Omit & { + content?: AnyProtoMsg | undefined; +}; +/** + * MsgSubmitProposalLegacy defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposalLegacyAmino { + content?: AnyAmino | undefined; + proposer?: string; +} +export interface MsgSubmitProposalLegacyAminoMsg { + type: "cosmos-sdk/MsgSubmitProposalLegacy"; + value: MsgSubmitProposalLegacyAmino; +} +/** + * MsgSubmitProposalLegacy defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposalLegacySDKType { + content?: AnySDKType | undefined; + proposer: string; +} +/** MsgSubmitProposalLegacyResponse defines the Msg/SubmitProposalLegacy response type. */ +export interface MsgSubmitProposalLegacyResponse { + proposalId: bigint; +} +export interface MsgSubmitProposalLegacyResponseProtoMsg { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgSubmitProposalLegacyResponse"; + value: Uint8Array; +} +/** MsgSubmitProposalLegacyResponse defines the Msg/SubmitProposalLegacy response type. */ +export interface MsgSubmitProposalLegacyResponseAmino { + proposal_id?: string; +} +export interface MsgSubmitProposalLegacyResponseAminoMsg { + type: "cosmos-sdk/MsgSubmitProposalLegacyResponse"; + value: MsgSubmitProposalLegacyResponseAmino; +} +/** MsgSubmitProposalLegacyResponse defines the Msg/SubmitProposalLegacy response type. */ +export interface MsgSubmitProposalLegacyResponseSDKType { + proposal_id: bigint; +} +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposal { + /** messages are the arbitrary messages to be executed if proposal passes. */ + messages: Any[]; + proposer: string; +} +export interface MsgSubmitProposalProtoMsg { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgSubmitProposal"; + value: Uint8Array; +} +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposalAmino { + /** messages are the arbitrary messages to be executed if proposal passes. */ + messages?: AnyAmino[]; + proposer?: string; +} +export interface MsgSubmitProposalAminoMsg { + type: "cosmos-sdk/MsgSubmitProposal"; + value: MsgSubmitProposalAmino; +} +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposalSDKType { + messages: AnySDKType[]; + proposer: string; +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponse { + proposalId: bigint; +} +export interface MsgSubmitProposalResponseProtoMsg { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse"; + value: Uint8Array; +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponseAmino { + proposal_id?: string; +} +export interface MsgSubmitProposalResponseAminoMsg { + type: "cosmos-sdk/MsgSubmitProposalResponse"; + value: MsgSubmitProposalResponseAmino; +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponseSDKType { + proposal_id: bigint; +} +function createBaseMsgDeleteAdmin(): MsgDeleteAdmin { + return { + creator: "", + admin: "" + }; +} +export const MsgDeleteAdmin = { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgDeleteAdmin", + encode(message: MsgDeleteAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.admin !== "") { + writer.uint32(18).string(message.admin); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgDeleteAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.admin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgDeleteAdmin { + const message = createBaseMsgDeleteAdmin(); + message.creator = object.creator ?? ""; + message.admin = object.admin ?? ""; + return message; + }, + fromAmino(object: MsgDeleteAdminAmino): MsgDeleteAdmin { + const message = createBaseMsgDeleteAdmin(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + return message; + }, + toAmino(message: MsgDeleteAdmin, useInterfaces: boolean = false): MsgDeleteAdminAmino { + const obj: any = {}; + obj.creator = message.creator; + obj.admin = message.admin; + return obj; + }, + fromAminoMsg(object: MsgDeleteAdminAminoMsg): MsgDeleteAdmin { + return MsgDeleteAdmin.fromAmino(object.value); + }, + toAminoMsg(message: MsgDeleteAdmin, useInterfaces: boolean = false): MsgDeleteAdminAminoMsg { + return { + type: "cosmos-sdk/MsgDeleteAdmin", + value: MsgDeleteAdmin.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgDeleteAdminProtoMsg, useInterfaces: boolean = false): MsgDeleteAdmin { + return MsgDeleteAdmin.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgDeleteAdmin): Uint8Array { + return MsgDeleteAdmin.encode(message).finish(); + }, + toProtoMsg(message: MsgDeleteAdmin): MsgDeleteAdminProtoMsg { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgDeleteAdmin", + value: MsgDeleteAdmin.encode(message).finish() + }; + } +}; +function createBaseMsgDeleteAdminResponse(): MsgDeleteAdminResponse { + return {}; +} +export const MsgDeleteAdminResponse = { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse", + encode(_: MsgDeleteAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgDeleteAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgDeleteAdminResponse { + const message = createBaseMsgDeleteAdminResponse(); + return message; + }, + fromAmino(_: MsgDeleteAdminResponseAmino): MsgDeleteAdminResponse { + const message = createBaseMsgDeleteAdminResponse(); + return message; + }, + toAmino(_: MsgDeleteAdminResponse, useInterfaces: boolean = false): MsgDeleteAdminResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgDeleteAdminResponseAminoMsg): MsgDeleteAdminResponse { + return MsgDeleteAdminResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgDeleteAdminResponse, useInterfaces: boolean = false): MsgDeleteAdminResponseAminoMsg { + return { + type: "cosmos-sdk/MsgDeleteAdminResponse", + value: MsgDeleteAdminResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgDeleteAdminResponseProtoMsg, useInterfaces: boolean = false): MsgDeleteAdminResponse { + return MsgDeleteAdminResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgDeleteAdminResponse): Uint8Array { + return MsgDeleteAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDeleteAdminResponse): MsgDeleteAdminResponseProtoMsg { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgDeleteAdminResponse", + value: MsgDeleteAdminResponse.encode(message).finish() + }; + } +}; +function createBaseMsgAddAdmin(): MsgAddAdmin { + return { + creator: "", + admin: "" + }; +} +export const MsgAddAdmin = { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgAddAdmin", + encode(message: MsgAddAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.admin !== "") { + writer.uint32(18).string(message.admin); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgAddAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.admin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgAddAdmin { + const message = createBaseMsgAddAdmin(); + message.creator = object.creator ?? ""; + message.admin = object.admin ?? ""; + return message; + }, + fromAmino(object: MsgAddAdminAmino): MsgAddAdmin { + const message = createBaseMsgAddAdmin(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + return message; + }, + toAmino(message: MsgAddAdmin, useInterfaces: boolean = false): MsgAddAdminAmino { + const obj: any = {}; + obj.creator = message.creator; + obj.admin = message.admin; + return obj; + }, + fromAminoMsg(object: MsgAddAdminAminoMsg): MsgAddAdmin { + return MsgAddAdmin.fromAmino(object.value); + }, + toAminoMsg(message: MsgAddAdmin, useInterfaces: boolean = false): MsgAddAdminAminoMsg { + return { + type: "cosmos-sdk/MsgAddAdmin", + value: MsgAddAdmin.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgAddAdminProtoMsg, useInterfaces: boolean = false): MsgAddAdmin { + return MsgAddAdmin.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgAddAdmin): Uint8Array { + return MsgAddAdmin.encode(message).finish(); + }, + toProtoMsg(message: MsgAddAdmin): MsgAddAdminProtoMsg { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgAddAdmin", + value: MsgAddAdmin.encode(message).finish() + }; + } +}; +function createBaseMsgAddAdminResponse(): MsgAddAdminResponse { + return {}; +} +export const MsgAddAdminResponse = { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgAddAdminResponse", + encode(_: MsgAddAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgAddAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgAddAdminResponse { + const message = createBaseMsgAddAdminResponse(); + return message; + }, + fromAmino(_: MsgAddAdminResponseAmino): MsgAddAdminResponse { + const message = createBaseMsgAddAdminResponse(); + return message; + }, + toAmino(_: MsgAddAdminResponse, useInterfaces: boolean = false): MsgAddAdminResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgAddAdminResponseAminoMsg): MsgAddAdminResponse { + return MsgAddAdminResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgAddAdminResponse, useInterfaces: boolean = false): MsgAddAdminResponseAminoMsg { + return { + type: "cosmos-sdk/MsgAddAdminResponse", + value: MsgAddAdminResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgAddAdminResponseProtoMsg, useInterfaces: boolean = false): MsgAddAdminResponse { + return MsgAddAdminResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgAddAdminResponse): Uint8Array { + return MsgAddAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAddAdminResponse): MsgAddAdminResponseProtoMsg { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgAddAdminResponse", + value: MsgAddAdminResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSubmitProposalLegacy(): MsgSubmitProposalLegacy { + return { + content: undefined, + proposer: "" + }; +} +export const MsgSubmitProposalLegacy = { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgSubmitProposalLegacy", + encode(message: MsgSubmitProposalLegacy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.content !== undefined) { + Any.encode((message.content as Any), writer.uint32(10).fork()).ldelim(); + } + if (message.proposer !== "") { + writer.uint32(18).string(message.proposer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSubmitProposalLegacy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitProposalLegacy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.content = useInterfaces ? (Content_InterfaceDecoder(reader) as Any) : Any.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.proposer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSubmitProposalLegacy { + const message = createBaseMsgSubmitProposalLegacy(); + message.content = object.content !== undefined && object.content !== null ? Any.fromPartial(object.content) : undefined; + message.proposer = object.proposer ?? ""; + return message; + }, + fromAmino(object: MsgSubmitProposalLegacyAmino): MsgSubmitProposalLegacy { + const message = createBaseMsgSubmitProposalLegacy(); + if (object.content !== undefined && object.content !== null) { + message.content = Content_FromAmino(object.content); + } + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = object.proposer; + } + return message; + }, + toAmino(message: MsgSubmitProposalLegacy, useInterfaces: boolean = false): MsgSubmitProposalLegacyAmino { + const obj: any = {}; + obj.content = message.content ? Content_ToAmino((message.content as Any), useInterfaces) : undefined; + obj.proposer = message.proposer; + return obj; + }, + fromAminoMsg(object: MsgSubmitProposalLegacyAminoMsg): MsgSubmitProposalLegacy { + return MsgSubmitProposalLegacy.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitProposalLegacy, useInterfaces: boolean = false): MsgSubmitProposalLegacyAminoMsg { + return { + type: "cosmos-sdk/MsgSubmitProposalLegacy", + value: MsgSubmitProposalLegacy.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgSubmitProposalLegacyProtoMsg, useInterfaces: boolean = false): MsgSubmitProposalLegacy { + return MsgSubmitProposalLegacy.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSubmitProposalLegacy): Uint8Array { + return MsgSubmitProposalLegacy.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitProposalLegacy): MsgSubmitProposalLegacyProtoMsg { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgSubmitProposalLegacy", + value: MsgSubmitProposalLegacy.encode(message).finish() + }; + } +}; +function createBaseMsgSubmitProposalLegacyResponse(): MsgSubmitProposalLegacyResponse { + return { + proposalId: BigInt(0) + }; +} +export const MsgSubmitProposalLegacyResponse = { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgSubmitProposalLegacyResponse", + encode(message: MsgSubmitProposalLegacyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSubmitProposalLegacyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitProposalLegacyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSubmitProposalLegacyResponse { + const message = createBaseMsgSubmitProposalLegacyResponse(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgSubmitProposalLegacyResponseAmino): MsgSubmitProposalLegacyResponse { + const message = createBaseMsgSubmitProposalLegacyResponse(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: MsgSubmitProposalLegacyResponse, useInterfaces: boolean = false): MsgSubmitProposalLegacyResponseAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgSubmitProposalLegacyResponseAminoMsg): MsgSubmitProposalLegacyResponse { + return MsgSubmitProposalLegacyResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitProposalLegacyResponse, useInterfaces: boolean = false): MsgSubmitProposalLegacyResponseAminoMsg { + return { + type: "cosmos-sdk/MsgSubmitProposalLegacyResponse", + value: MsgSubmitProposalLegacyResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgSubmitProposalLegacyResponseProtoMsg, useInterfaces: boolean = false): MsgSubmitProposalLegacyResponse { + return MsgSubmitProposalLegacyResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSubmitProposalLegacyResponse): Uint8Array { + return MsgSubmitProposalLegacyResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitProposalLegacyResponse): MsgSubmitProposalLegacyResponseProtoMsg { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgSubmitProposalLegacyResponse", + value: MsgSubmitProposalLegacyResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSubmitProposal(): MsgSubmitProposal { + return { + messages: [], + proposer: "" + }; +} +export const MsgSubmitProposal = { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgSubmitProposal", + encode(message: MsgSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.messages) { + Any.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.proposer !== "") { + writer.uint32(18).string(message.proposer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSubmitProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messages.push(Any.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.proposer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal(); + message.messages = object.messages?.map(e => Any.fromPartial(e)) || []; + message.proposer = object.proposer ?? ""; + return message; + }, + fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal(); + message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = object.proposer; + } + return message; + }, + toAmino(message: MsgSubmitProposal, useInterfaces: boolean = false): MsgSubmitProposalAmino { + const obj: any = {}; + if (message.messages) { + obj.messages = message.messages.map(e => e ? Any.toAmino(e, useInterfaces) : undefined); + } else { + obj.messages = []; + } + obj.proposer = message.proposer; + return obj; + }, + fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { + return MsgSubmitProposal.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitProposal, useInterfaces: boolean = false): MsgSubmitProposalAminoMsg { + return { + type: "cosmos-sdk/MsgSubmitProposal", + value: MsgSubmitProposal.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgSubmitProposalProtoMsg, useInterfaces: boolean = false): MsgSubmitProposal { + return MsgSubmitProposal.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSubmitProposal): Uint8Array { + return MsgSubmitProposal.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitProposal): MsgSubmitProposalProtoMsg { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgSubmitProposal", + value: MsgSubmitProposal.encode(message).finish() + }; + } +}; +function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { + return { + proposalId: BigInt(0) + }; +} +export const MsgSubmitProposalResponse = { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse", + encode(message: MsgSubmitProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSubmitProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitProposalResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSubmitProposalResponse { + const message = createBaseMsgSubmitProposalResponse(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgSubmitProposalResponseAmino): MsgSubmitProposalResponse { + const message = createBaseMsgSubmitProposalResponse(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: MsgSubmitProposalResponse, useInterfaces: boolean = false): MsgSubmitProposalResponseAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgSubmitProposalResponseAminoMsg): MsgSubmitProposalResponse { + return MsgSubmitProposalResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitProposalResponse, useInterfaces: boolean = false): MsgSubmitProposalResponseAminoMsg { + return { + type: "cosmos-sdk/MsgSubmitProposalResponse", + value: MsgSubmitProposalResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgSubmitProposalResponseProtoMsg, useInterfaces: boolean = false): MsgSubmitProposalResponse { + return MsgSubmitProposalResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSubmitProposalResponse): Uint8Array { + return MsgSubmitProposalResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseProtoMsg { + return { + typeUrl: "/cosmos.adminmodule.adminmodule.MsgSubmitProposalResponse", + value: MsgSubmitProposalResponse.encode(message).finish() + }; + } +}; +export const Content_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32(), true); + switch (data.typeUrl) { + default: + return data; + } +}; +export const Content_FromAmino = (content: AnyAmino) => { + return Any.fromAmino(content); +}; +export const Content_ToAmino = (content: Any, useInterfaces: boolean = false) => { + return Any.toAmino(content, useInterfaces); +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/bundle.ts b/packages/types/protobuf/codegen/cosmos/bundle.ts index 87adfb95a..cefa7d41c 100644 --- a/packages/types/protobuf/codegen/cosmos/bundle.ts +++ b/packages/types/protobuf/codegen/cosmos/bundle.ts @@ -1,316 +1,334 @@ -import * as _28 from "./auth/v1beta1/auth"; -import * as _29 from "./auth/v1beta1/genesis"; -import * as _30 from "./auth/v1beta1/query"; -import * as _31 from "./auth/v1beta1/tx"; -import * as _32 from "./authz/v1beta1/authz"; -import * as _33 from "./authz/v1beta1/event"; -import * as _34 from "./authz/v1beta1/genesis"; -import * as _35 from "./authz/v1beta1/query"; -import * as _36 from "./authz/v1beta1/tx"; -import * as _37 from "./bank/v1beta1/authz"; -import * as _38 from "./bank/v1beta1/bank"; -import * as _39 from "./bank/v1beta1/genesis"; -import * as _40 from "./bank/v1beta1/query"; -import * as _41 from "./bank/v1beta1/tx"; -import * as _42 from "./base/abci/v1beta1/abci"; -import * as _43 from "./base/query/v1beta1/pagination"; -import * as _44 from "./base/tendermint/v1beta1/query"; -import * as _45 from "./base/tendermint/v1beta1/types"; -import * as _46 from "./base/v1beta1/coin"; -import * as _47 from "./crypto/ed25519/keys"; -import * as _48 from "./crypto/multisig/keys"; -import * as _49 from "./crypto/secp256k1/keys"; -import * as _50 from "./distribution/v1beta1/distribution"; -import * as _51 from "./distribution/v1beta1/genesis"; -import * as _52 from "./distribution/v1beta1/query"; -import * as _53 from "./distribution/v1beta1/tx"; -import * as _54 from "./feegrant/v1beta1/feegrant"; -import * as _55 from "./feegrant/v1beta1/genesis"; -import * as _56 from "./feegrant/v1beta1/query"; -import * as _57 from "./feegrant/v1beta1/tx"; -import * as _58 from "./gov/v1/genesis"; -import * as _59 from "./gov/v1/gov"; -import * as _60 from "./gov/v1/query"; -import * as _61 from "./gov/v1/tx"; -import * as _62 from "./gov/v1beta1/genesis"; -import * as _63 from "./gov/v1beta1/gov"; -import * as _64 from "./gov/v1beta1/query"; -import * as _65 from "./gov/v1beta1/tx"; -import * as _66 from "./mint/v1beta1/genesis"; -import * as _67 from "./mint/v1beta1/mint"; -import * as _68 from "./mint/v1beta1/query"; -import * as _69 from "./mint/v1beta1/tx"; -import * as _70 from "./msg/v1/msg"; -import * as _71 from "./orm/v1/orm"; -import * as _72 from "./params/v1beta1/params"; -import * as _73 from "./params/v1beta1/query"; -import * as _74 from "./query/v1/query"; -import * as _75 from "./slashing/v1beta1/genesis"; -import * as _76 from "./slashing/v1beta1/query"; -import * as _77 from "./slashing/v1beta1/slashing"; -import * as _78 from "./slashing/v1beta1/tx"; -import * as _79 from "./staking/v1beta1/authz"; -import * as _80 from "./staking/v1beta1/genesis"; -import * as _81 from "./staking/v1beta1/query"; -import * as _82 from "./staking/v1beta1/staking"; -import * as _83 from "./staking/v1beta1/tx"; -import * as _84 from "./tx/signing/v1beta1/signing"; -import * as _85 from "./tx/v1beta1/service"; -import * as _86 from "./tx/v1beta1/tx"; -import * as _87 from "./upgrade/v1beta1/query"; -import * as _88 from "./upgrade/v1beta1/tx"; -import * as _89 from "./upgrade/v1beta1/upgrade"; -import * as _353 from "./auth/v1beta1/tx.amino"; -import * as _354 from "./authz/v1beta1/tx.amino"; -import * as _355 from "./bank/v1beta1/tx.amino"; -import * as _356 from "./distribution/v1beta1/tx.amino"; -import * as _357 from "./feegrant/v1beta1/tx.amino"; -import * as _358 from "./gov/v1/tx.amino"; -import * as _359 from "./gov/v1beta1/tx.amino"; -import * as _360 from "./mint/v1beta1/tx.amino"; -import * as _361 from "./slashing/v1beta1/tx.amino"; -import * as _362 from "./staking/v1beta1/tx.amino"; -import * as _363 from "./upgrade/v1beta1/tx.amino"; -import * as _364 from "./auth/v1beta1/tx.registry"; -import * as _365 from "./authz/v1beta1/tx.registry"; -import * as _366 from "./bank/v1beta1/tx.registry"; -import * as _367 from "./distribution/v1beta1/tx.registry"; -import * as _368 from "./feegrant/v1beta1/tx.registry"; -import * as _369 from "./gov/v1/tx.registry"; -import * as _370 from "./gov/v1beta1/tx.registry"; -import * as _371 from "./mint/v1beta1/tx.registry"; -import * as _372 from "./slashing/v1beta1/tx.registry"; -import * as _373 from "./staking/v1beta1/tx.registry"; -import * as _374 from "./upgrade/v1beta1/tx.registry"; -import * as _375 from "./auth/v1beta1/query.rpc.Query"; -import * as _376 from "./authz/v1beta1/query.rpc.Query"; -import * as _377 from "./bank/v1beta1/query.rpc.Query"; -import * as _378 from "./base/tendermint/v1beta1/query.rpc.Service"; -import * as _379 from "./distribution/v1beta1/query.rpc.Query"; -import * as _380 from "./feegrant/v1beta1/query.rpc.Query"; -import * as _381 from "./gov/v1/query.rpc.Query"; -import * as _382 from "./gov/v1beta1/query.rpc.Query"; -import * as _383 from "./mint/v1beta1/query.rpc.Query"; -import * as _384 from "./params/v1beta1/query.rpc.Query"; -import * as _385 from "./slashing/v1beta1/query.rpc.Query"; -import * as _386 from "./staking/v1beta1/query.rpc.Query"; -import * as _387 from "./tx/v1beta1/service.rpc.Service"; -import * as _388 from "./upgrade/v1beta1/query.rpc.Query"; -import * as _389 from "./auth/v1beta1/tx.rpc.msg"; -import * as _390 from "./authz/v1beta1/tx.rpc.msg"; -import * as _391 from "./bank/v1beta1/tx.rpc.msg"; -import * as _392 from "./distribution/v1beta1/tx.rpc.msg"; -import * as _393 from "./feegrant/v1beta1/tx.rpc.msg"; -import * as _394 from "./gov/v1/tx.rpc.msg"; -import * as _395 from "./gov/v1beta1/tx.rpc.msg"; -import * as _396 from "./mint/v1beta1/tx.rpc.msg"; -import * as _397 from "./slashing/v1beta1/tx.rpc.msg"; -import * as _398 from "./staking/v1beta1/tx.rpc.msg"; -import * as _399 from "./upgrade/v1beta1/tx.rpc.msg"; -import * as _580 from "./rpc.query"; -import * as _581 from "./rpc.tx"; +import * as _28 from "./adminmodule/adminmodule/genesis"; +import * as _29 from "./adminmodule/adminmodule/query"; +import * as _30 from "./adminmodule/adminmodule/tx"; +import * as _31 from "./auth/v1beta1/auth"; +import * as _32 from "./auth/v1beta1/genesis"; +import * as _33 from "./auth/v1beta1/query"; +import * as _34 from "./auth/v1beta1/tx"; +import * as _35 from "./authz/v1beta1/authz"; +import * as _36 from "./authz/v1beta1/event"; +import * as _37 from "./authz/v1beta1/genesis"; +import * as _38 from "./authz/v1beta1/query"; +import * as _39 from "./authz/v1beta1/tx"; +import * as _40 from "./bank/v1beta1/authz"; +import * as _41 from "./bank/v1beta1/bank"; +import * as _42 from "./bank/v1beta1/genesis"; +import * as _43 from "./bank/v1beta1/query"; +import * as _44 from "./bank/v1beta1/tx"; +import * as _45 from "./base/abci/v1beta1/abci"; +import * as _46 from "./base/query/v1beta1/pagination"; +import * as _47 from "./base/tendermint/v1beta1/query"; +import * as _48 from "./base/tendermint/v1beta1/types"; +import * as _49 from "./base/v1beta1/coin"; +import * as _50 from "./crypto/ed25519/keys"; +import * as _51 from "./crypto/multisig/keys"; +import * as _52 from "./crypto/secp256k1/keys"; +import * as _53 from "./distribution/v1beta1/distribution"; +import * as _54 from "./distribution/v1beta1/genesis"; +import * as _55 from "./distribution/v1beta1/query"; +import * as _56 from "./distribution/v1beta1/tx"; +import * as _57 from "./feegrant/v1beta1/feegrant"; +import * as _58 from "./feegrant/v1beta1/genesis"; +import * as _59 from "./feegrant/v1beta1/query"; +import * as _60 from "./feegrant/v1beta1/tx"; +import * as _61 from "./gov/v1/genesis"; +import * as _62 from "./gov/v1/gov"; +import * as _63 from "./gov/v1/query"; +import * as _64 from "./gov/v1/tx"; +import * as _65 from "./gov/v1beta1/genesis"; +import * as _66 from "./gov/v1beta1/gov"; +import * as _67 from "./gov/v1beta1/query"; +import * as _68 from "./gov/v1beta1/tx"; +import * as _69 from "./mint/v1beta1/genesis"; +import * as _70 from "./mint/v1beta1/mint"; +import * as _71 from "./mint/v1beta1/query"; +import * as _72 from "./mint/v1beta1/tx"; +import * as _73 from "./msg/v1/msg"; +import * as _74 from "./orm/v1/orm"; +import * as _75 from "./params/v1beta1/params"; +import * as _76 from "./params/v1beta1/query"; +import * as _77 from "./query/v1/query"; +import * as _78 from "./slashing/v1beta1/genesis"; +import * as _79 from "./slashing/v1beta1/query"; +import * as _80 from "./slashing/v1beta1/slashing"; +import * as _81 from "./slashing/v1beta1/tx"; +import * as _82 from "./staking/v1beta1/authz"; +import * as _83 from "./staking/v1beta1/genesis"; +import * as _84 from "./staking/v1beta1/query"; +import * as _85 from "./staking/v1beta1/staking"; +import * as _86 from "./staking/v1beta1/tx"; +import * as _87 from "./tx/signing/v1beta1/signing"; +import * as _88 from "./tx/v1beta1/service"; +import * as _89 from "./tx/v1beta1/tx"; +import * as _90 from "./upgrade/v1beta1/query"; +import * as _91 from "./upgrade/v1beta1/tx"; +import * as _92 from "./upgrade/v1beta1/upgrade"; +import * as _356 from "./adminmodule/adminmodule/tx.amino"; +import * as _357 from "./auth/v1beta1/tx.amino"; +import * as _358 from "./authz/v1beta1/tx.amino"; +import * as _359 from "./bank/v1beta1/tx.amino"; +import * as _360 from "./distribution/v1beta1/tx.amino"; +import * as _361 from "./feegrant/v1beta1/tx.amino"; +import * as _362 from "./gov/v1/tx.amino"; +import * as _363 from "./gov/v1beta1/tx.amino"; +import * as _364 from "./mint/v1beta1/tx.amino"; +import * as _365 from "./slashing/v1beta1/tx.amino"; +import * as _366 from "./staking/v1beta1/tx.amino"; +import * as _367 from "./upgrade/v1beta1/tx.amino"; +import * as _368 from "./adminmodule/adminmodule/tx.registry"; +import * as _369 from "./auth/v1beta1/tx.registry"; +import * as _370 from "./authz/v1beta1/tx.registry"; +import * as _371 from "./bank/v1beta1/tx.registry"; +import * as _372 from "./distribution/v1beta1/tx.registry"; +import * as _373 from "./feegrant/v1beta1/tx.registry"; +import * as _374 from "./gov/v1/tx.registry"; +import * as _375 from "./gov/v1beta1/tx.registry"; +import * as _376 from "./mint/v1beta1/tx.registry"; +import * as _377 from "./slashing/v1beta1/tx.registry"; +import * as _378 from "./staking/v1beta1/tx.registry"; +import * as _379 from "./upgrade/v1beta1/tx.registry"; +import * as _380 from "./adminmodule/adminmodule/query.rpc.Query"; +import * as _381 from "./auth/v1beta1/query.rpc.Query"; +import * as _382 from "./authz/v1beta1/query.rpc.Query"; +import * as _383 from "./bank/v1beta1/query.rpc.Query"; +import * as _384 from "./base/tendermint/v1beta1/query.rpc.Service"; +import * as _385 from "./distribution/v1beta1/query.rpc.Query"; +import * as _386 from "./feegrant/v1beta1/query.rpc.Query"; +import * as _387 from "./gov/v1/query.rpc.Query"; +import * as _388 from "./gov/v1beta1/query.rpc.Query"; +import * as _389 from "./mint/v1beta1/query.rpc.Query"; +import * as _390 from "./params/v1beta1/query.rpc.Query"; +import * as _391 from "./slashing/v1beta1/query.rpc.Query"; +import * as _392 from "./staking/v1beta1/query.rpc.Query"; +import * as _393 from "./tx/v1beta1/service.rpc.Service"; +import * as _394 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _395 from "./adminmodule/adminmodule/tx.rpc.msg"; +import * as _396 from "./auth/v1beta1/tx.rpc.msg"; +import * as _397 from "./authz/v1beta1/tx.rpc.msg"; +import * as _398 from "./bank/v1beta1/tx.rpc.msg"; +import * as _399 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _400 from "./feegrant/v1beta1/tx.rpc.msg"; +import * as _401 from "./gov/v1/tx.rpc.msg"; +import * as _402 from "./gov/v1beta1/tx.rpc.msg"; +import * as _403 from "./mint/v1beta1/tx.rpc.msg"; +import * as _404 from "./slashing/v1beta1/tx.rpc.msg"; +import * as _405 from "./staking/v1beta1/tx.rpc.msg"; +import * as _406 from "./upgrade/v1beta1/tx.rpc.msg"; +import * as _587 from "./rpc.query"; +import * as _588 from "./rpc.tx"; export namespace cosmos { - export namespace auth { - export const v1beta1 = { + export namespace adminmodule { + export const adminmodule = { ..._28, ..._29, ..._30, - ..._31, - ..._353, - ..._364, - ..._375, - ..._389 + ..._356, + ..._368, + ..._380, + ..._395 }; } - export namespace authz { + export namespace auth { export const v1beta1 = { + ..._31, ..._32, ..._33, ..._34, - ..._35, - ..._36, - ..._354, - ..._365, - ..._376, - ..._390 + ..._357, + ..._369, + ..._381, + ..._396 }; } - export namespace bank { + export namespace authz { export const v1beta1 = { + ..._35, + ..._36, ..._37, ..._38, ..._39, + ..._358, + ..._370, + ..._382, + ..._397 + }; + } + export namespace bank { + export const v1beta1 = { ..._40, ..._41, - ..._355, - ..._366, - ..._377, - ..._391 + ..._42, + ..._43, + ..._44, + ..._359, + ..._371, + ..._383, + ..._398 }; } export namespace base { export namespace abci { export const v1beta1 = { - ..._42 + ..._45 }; } export namespace query { export const v1beta1 = { - ..._43 + ..._46 }; } export namespace tendermint { export const v1beta1 = { - ..._44, - ..._45, - ..._378 + ..._47, + ..._48, + ..._384 }; } export const v1beta1 = { - ..._46 + ..._49 }; } export namespace crypto { export const ed25519 = { - ..._47 + ..._50 }; export const multisig = { - ..._48 + ..._51 }; export const secp256k1 = { - ..._49 + ..._52 }; } export namespace distribution { export const v1beta1 = { - ..._50, - ..._51, - ..._52, ..._53, - ..._356, - ..._367, - ..._379, - ..._392 + ..._54, + ..._55, + ..._56, + ..._360, + ..._372, + ..._385, + ..._399 }; } export namespace feegrant { export const v1beta1 = { - ..._54, - ..._55, - ..._56, ..._57, - ..._357, - ..._368, - ..._380, - ..._393 + ..._58, + ..._59, + ..._60, + ..._361, + ..._373, + ..._386, + ..._400 }; } export namespace gov { export const v1 = { - ..._58, - ..._59, - ..._60, ..._61, - ..._358, - ..._369, - ..._381, - ..._394 - }; - export const v1beta1 = { ..._62, ..._63, ..._64, - ..._65, - ..._359, - ..._370, - ..._382, - ..._395 + ..._362, + ..._374, + ..._387, + ..._401 }; - } - export namespace mint { export const v1beta1 = { + ..._65, ..._66, ..._67, ..._68, + ..._363, + ..._375, + ..._388, + ..._402 + }; + } + export namespace mint { + export const v1beta1 = { ..._69, - ..._360, - ..._371, - ..._383, - ..._396 + ..._70, + ..._71, + ..._72, + ..._364, + ..._376, + ..._389, + ..._403 }; } export namespace msg { export const v1 = { - ..._70 + ..._73 }; } export namespace orm { export const v1 = { - ..._71 + ..._74 }; } export namespace params { export const v1beta1 = { - ..._72, - ..._73, - ..._384 + ..._75, + ..._76, + ..._390 }; } export namespace query { export const v1 = { - ..._74 + ..._77 }; } export namespace slashing { export const v1beta1 = { - ..._75, - ..._76, - ..._77, ..._78, - ..._361, - ..._372, - ..._385, - ..._397 + ..._79, + ..._80, + ..._81, + ..._365, + ..._377, + ..._391, + ..._404 }; } export namespace staking { export const v1beta1 = { - ..._79, - ..._80, - ..._81, ..._82, ..._83, - ..._362, - ..._373, - ..._386, - ..._398 + ..._84, + ..._85, + ..._86, + ..._366, + ..._378, + ..._392, + ..._405 }; } export namespace tx { export namespace signing { export const v1beta1 = { - ..._84 + ..._87 }; } export const v1beta1 = { - ..._85, - ..._86, - ..._387 + ..._88, + ..._89, + ..._393 }; } export namespace upgrade { export const v1beta1 = { - ..._87, - ..._88, - ..._89, - ..._363, - ..._374, - ..._388, - ..._399 + ..._90, + ..._91, + ..._92, + ..._367, + ..._379, + ..._394, + ..._406 }; } export const ClientFactory = { - ..._580, - ..._581 + ..._587, + ..._588 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/client.ts b/packages/types/protobuf/codegen/cosmos/client.ts index a0691dfb2..9047cc565 100644 --- a/packages/types/protobuf/codegen/cosmos/client.ts +++ b/packages/types/protobuf/codegen/cosmos/client.ts @@ -1,6 +1,7 @@ import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; import { AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as cosmosAdminmoduleAdminmoduleTxRegistry from "./adminmodule/adminmodule/tx.registry"; import * as cosmosAuthV1beta1TxRegistry from "./auth/v1beta1/tx.registry"; import * as cosmosAuthzV1beta1TxRegistry from "./authz/v1beta1/tx.registry"; import * as cosmosBankV1beta1TxRegistry from "./bank/v1beta1/tx.registry"; @@ -12,6 +13,7 @@ import * as cosmosMintV1beta1TxRegistry from "./mint/v1beta1/tx.registry"; import * as cosmosSlashingV1beta1TxRegistry from "./slashing/v1beta1/tx.registry"; import * as cosmosStakingV1beta1TxRegistry from "./staking/v1beta1/tx.registry"; import * as cosmosUpgradeV1beta1TxRegistry from "./upgrade/v1beta1/tx.registry"; +import * as cosmosAdminmoduleAdminmoduleTxAmino from "./adminmodule/adminmodule/tx.amino"; import * as cosmosAuthV1beta1TxAmino from "./auth/v1beta1/tx.amino"; import * as cosmosAuthzV1beta1TxAmino from "./authz/v1beta1/tx.amino"; import * as cosmosBankV1beta1TxAmino from "./bank/v1beta1/tx.amino"; @@ -24,6 +26,7 @@ import * as cosmosSlashingV1beta1TxAmino from "./slashing/v1beta1/tx.amino"; import * as cosmosStakingV1beta1TxAmino from "./staking/v1beta1/tx.amino"; import * as cosmosUpgradeV1beta1TxAmino from "./upgrade/v1beta1/tx.amino"; export const cosmosAminoConverters = { + ...cosmosAdminmoduleAdminmoduleTxAmino.AminoConverter, ...cosmosAuthV1beta1TxAmino.AminoConverter, ...cosmosAuthzV1beta1TxAmino.AminoConverter, ...cosmosBankV1beta1TxAmino.AminoConverter, @@ -36,7 +39,7 @@ export const cosmosAminoConverters = { ...cosmosStakingV1beta1TxAmino.AminoConverter, ...cosmosUpgradeV1beta1TxAmino.AminoConverter }; -export const cosmosProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...cosmosAuthV1beta1TxRegistry.registry, ...cosmosAuthzV1beta1TxRegistry.registry, ...cosmosBankV1beta1TxRegistry.registry, ...cosmosDistributionV1beta1TxRegistry.registry, ...cosmosFeegrantV1beta1TxRegistry.registry, ...cosmosGovV1TxRegistry.registry, ...cosmosGovV1beta1TxRegistry.registry, ...cosmosMintV1beta1TxRegistry.registry, ...cosmosSlashingV1beta1TxRegistry.registry, ...cosmosStakingV1beta1TxRegistry.registry, ...cosmosUpgradeV1beta1TxRegistry.registry]; +export const cosmosProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...cosmosAdminmoduleAdminmoduleTxRegistry.registry, ...cosmosAuthV1beta1TxRegistry.registry, ...cosmosAuthzV1beta1TxRegistry.registry, ...cosmosBankV1beta1TxRegistry.registry, ...cosmosDistributionV1beta1TxRegistry.registry, ...cosmosFeegrantV1beta1TxRegistry.registry, ...cosmosGovV1TxRegistry.registry, ...cosmosGovV1beta1TxRegistry.registry, ...cosmosMintV1beta1TxRegistry.registry, ...cosmosSlashingV1beta1TxRegistry.registry, ...cosmosStakingV1beta1TxRegistry.registry, ...cosmosUpgradeV1beta1TxRegistry.registry]; export const getSigningCosmosClientOptions = (): { registry: Registry; aminoTypes: AminoTypes; diff --git a/packages/types/protobuf/codegen/cosmos/rpc.query.ts b/packages/types/protobuf/codegen/cosmos/rpc.query.ts index 1fdb1dc7b..af511d25d 100644 --- a/packages/types/protobuf/codegen/cosmos/rpc.query.ts +++ b/packages/types/protobuf/codegen/cosmos/rpc.query.ts @@ -9,6 +9,9 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { + adminmodule: { + adminmodule: (await import("./adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) + }, auth: { v1beta1: (await import("./auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/cosmos/rpc.tx.ts b/packages/types/protobuf/codegen/cosmos/rpc.tx.ts index 080131032..ca318bce8 100644 --- a/packages/types/protobuf/codegen/cosmos/rpc.tx.ts +++ b/packages/types/protobuf/codegen/cosmos/rpc.tx.ts @@ -5,6 +5,9 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { + adminmodule: { + adminmodule: new (await import("./adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) + }, auth: { v1beta1: new (await import("./auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/cosmwasm/bundle.ts b/packages/types/protobuf/codegen/cosmwasm/bundle.ts index 15e4aa086..68c300e6c 100644 --- a/packages/types/protobuf/codegen/cosmwasm/bundle.ts +++ b/packages/types/protobuf/codegen/cosmwasm/bundle.ts @@ -1,56 +1,56 @@ -import * as _90 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _91 from "./tokenfactory/v1beta1/genesis"; -import * as _92 from "./tokenfactory/v1beta1/params"; -import * as _93 from "./tokenfactory/v1beta1/query"; -import * as _94 from "./tokenfactory/v1beta1/tx"; -import * as _95 from "./wasm/v1/authz"; -import * as _96 from "./wasm/v1/genesis"; -import * as _97 from "./wasm/v1/ibc"; -import * as _98 from "./wasm/v1/proposal"; -import * as _99 from "./wasm/v1/query"; -import * as _100 from "./wasm/v1/tx"; -import * as _101 from "./wasm/v1/types"; -import * as _400 from "./tokenfactory/v1beta1/tx.amino"; -import * as _401 from "./wasm/v1/tx.amino"; -import * as _402 from "./tokenfactory/v1beta1/tx.registry"; -import * as _403 from "./wasm/v1/tx.registry"; -import * as _404 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _405 from "./wasm/v1/query.rpc.Query"; -import * as _406 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _407 from "./wasm/v1/tx.rpc.msg"; -import * as _582 from "./rpc.query"; -import * as _583 from "./rpc.tx"; +import * as _93 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _94 from "./tokenfactory/v1beta1/genesis"; +import * as _95 from "./tokenfactory/v1beta1/params"; +import * as _96 from "./tokenfactory/v1beta1/query"; +import * as _97 from "./tokenfactory/v1beta1/tx"; +import * as _98 from "./wasm/v1/authz"; +import * as _99 from "./wasm/v1/genesis"; +import * as _100 from "./wasm/v1/ibc"; +import * as _101 from "./wasm/v1/proposal"; +import * as _102 from "./wasm/v1/query"; +import * as _103 from "./wasm/v1/tx"; +import * as _104 from "./wasm/v1/types"; +import * as _407 from "./tokenfactory/v1beta1/tx.amino"; +import * as _408 from "./wasm/v1/tx.amino"; +import * as _409 from "./tokenfactory/v1beta1/tx.registry"; +import * as _410 from "./wasm/v1/tx.registry"; +import * as _411 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _412 from "./wasm/v1/query.rpc.Query"; +import * as _413 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _414 from "./wasm/v1/tx.rpc.msg"; +import * as _589 from "./rpc.query"; +import * as _590 from "./rpc.tx"; export namespace cosmwasm { export namespace tokenfactory { export const v1beta1 = { - ..._90, - ..._91, - ..._92, ..._93, ..._94, - ..._400, - ..._402, - ..._404, - ..._406 + ..._95, + ..._96, + ..._97, + ..._407, + ..._409, + ..._411, + ..._413 }; } export namespace wasm { export const v1 = { - ..._95, - ..._96, - ..._97, ..._98, ..._99, ..._100, ..._101, - ..._401, - ..._403, - ..._405, - ..._407 + ..._102, + ..._103, + ..._104, + ..._408, + ..._410, + ..._412, + ..._414 }; } export const ClientFactory = { - ..._582, - ..._583 + ..._589, + ..._590 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmwasm/rpc.query.ts b/packages/types/protobuf/codegen/cosmwasm/rpc.query.ts index 7d9a9b83b..69f79a13a 100644 --- a/packages/types/protobuf/codegen/cosmwasm/rpc.query.ts +++ b/packages/types/protobuf/codegen/cosmwasm/rpc.query.ts @@ -9,6 +9,9 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { + adminmodule: { + adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) + }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/cosmwasm/rpc.tx.ts b/packages/types/protobuf/codegen/cosmwasm/rpc.tx.ts index 23b50e5e8..c2d70a170 100644 --- a/packages/types/protobuf/codegen/cosmwasm/rpc.tx.ts +++ b/packages/types/protobuf/codegen/cosmwasm/rpc.tx.ts @@ -5,6 +5,9 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { + adminmodule: { + adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) + }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/gaia/bundle.ts b/packages/types/protobuf/codegen/gaia/bundle.ts index f73d90748..5d03554b4 100644 --- a/packages/types/protobuf/codegen/gaia/bundle.ts +++ b/packages/types/protobuf/codegen/gaia/bundle.ts @@ -1,26 +1,26 @@ -import * as _102 from "./globalfee/v1beta1/genesis"; -import * as _103 from "./globalfee/v1beta1/query"; -import * as _104 from "./globalfee/v1beta1/tx"; -import * as _408 from "./globalfee/v1beta1/tx.amino"; -import * as _409 from "./globalfee/v1beta1/tx.registry"; -import * as _410 from "./globalfee/v1beta1/query.rpc.Query"; -import * as _411 from "./globalfee/v1beta1/tx.rpc.msg"; -import * as _584 from "./rpc.query"; -import * as _585 from "./rpc.tx"; +import * as _105 from "./globalfee/v1beta1/genesis"; +import * as _106 from "./globalfee/v1beta1/query"; +import * as _107 from "./globalfee/v1beta1/tx"; +import * as _415 from "./globalfee/v1beta1/tx.amino"; +import * as _416 from "./globalfee/v1beta1/tx.registry"; +import * as _417 from "./globalfee/v1beta1/query.rpc.Query"; +import * as _418 from "./globalfee/v1beta1/tx.rpc.msg"; +import * as _591 from "./rpc.query"; +import * as _592 from "./rpc.tx"; export namespace gaia { export namespace globalfee { export const v1beta1 = { - ..._102, - ..._103, - ..._104, - ..._408, - ..._409, - ..._410, - ..._411 + ..._105, + ..._106, + ..._107, + ..._415, + ..._416, + ..._417, + ..._418 }; } export const ClientFactory = { - ..._584, - ..._585 + ..._591, + ..._592 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/gaia/rpc.query.ts b/packages/types/protobuf/codegen/gaia/rpc.query.ts index cc8c0b389..f618a7948 100644 --- a/packages/types/protobuf/codegen/gaia/rpc.query.ts +++ b/packages/types/protobuf/codegen/gaia/rpc.query.ts @@ -9,6 +9,9 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { + adminmodule: { + adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) + }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/gaia/rpc.tx.ts b/packages/types/protobuf/codegen/gaia/rpc.tx.ts index b8564052c..367144fa3 100644 --- a/packages/types/protobuf/codegen/gaia/rpc.tx.ts +++ b/packages/types/protobuf/codegen/gaia/rpc.tx.ts @@ -5,6 +5,9 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { + adminmodule: { + adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) + }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/gogoproto/bundle.ts b/packages/types/protobuf/codegen/gogoproto/bundle.ts index 3025fa61b..2c41b17a8 100644 --- a/packages/types/protobuf/codegen/gogoproto/bundle.ts +++ b/packages/types/protobuf/codegen/gogoproto/bundle.ts @@ -1,4 +1,4 @@ -import * as _105 from "./gogo"; +import * as _108 from "./gogo"; export const gogoproto = { - ..._105 + ..._108 }; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/google/bundle.ts b/packages/types/protobuf/codegen/google/bundle.ts index ad2059149..543e4efe9 100644 --- a/packages/types/protobuf/codegen/google/bundle.ts +++ b/packages/types/protobuf/codegen/google/bundle.ts @@ -1,20 +1,20 @@ -import * as _106 from "./api/annotations"; -import * as _107 from "./api/http"; -import * as _108 from "./protobuf/any"; -import * as _109 from "./protobuf/descriptor"; -import * as _110 from "./protobuf/duration"; -import * as _111 from "./protobuf/empty"; -import * as _112 from "./protobuf/timestamp"; +import * as _109 from "./api/annotations"; +import * as _110 from "./api/http"; +import * as _111 from "./protobuf/any"; +import * as _112 from "./protobuf/descriptor"; +import * as _113 from "./protobuf/duration"; +import * as _114 from "./protobuf/empty"; +import * as _115 from "./protobuf/timestamp"; export namespace google { export const api = { - ..._106, - ..._107 + ..._109, + ..._110 }; export const protobuf = { - ..._108, - ..._109, - ..._110, ..._111, - ..._112 + ..._112, + ..._113, + ..._114, + ..._115 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/bundle.ts b/packages/types/protobuf/codegen/ibc/bundle.ts index a1e20ded4..ea7fc9129 100644 --- a/packages/types/protobuf/codegen/ibc/bundle.ts +++ b/packages/types/protobuf/codegen/ibc/bundle.ts @@ -1,120 +1,120 @@ -import * as _113 from "./applications/interchain_accounts/controller/v1/controller"; -import * as _114 from "./applications/interchain_accounts/controller/v1/query"; -import * as _115 from "./applications/interchain_accounts/controller/v1/tx"; -import * as _116 from "./applications/interchain_accounts/host/v1/host"; -import * as _117 from "./applications/interchain_accounts/host/v1/query"; -import * as _118 from "./applications/interchain_accounts/host/v1/tx"; -import * as _119 from "./applications/interchain_accounts/v1/account"; -import * as _120 from "./applications/interchain_accounts/v1/metadata"; -import * as _121 from "./applications/interchain_accounts/v1/packet"; -import * as _122 from "./applications/transfer/v1/authz"; -import * as _123 from "./applications/transfer/v1/genesis"; -import * as _124 from "./applications/transfer/v1/query"; -import * as _125 from "./applications/transfer/v1/transfer"; -import * as _126 from "./applications/transfer/v1/tx"; -import * as _127 from "./core/channel/v1/channel"; -import * as _128 from "./core/channel/v1/genesis"; -import * as _129 from "./core/channel/v1/query"; -import * as _130 from "./core/channel/v1/tx"; -import * as _131 from "./core/client/v1/client"; -import * as _132 from "./core/client/v1/genesis"; -import * as _133 from "./core/client/v1/query"; -import * as _134 from "./core/client/v1/tx"; -import * as _412 from "./applications/interchain_accounts/controller/v1/tx.amino"; -import * as _413 from "./applications/interchain_accounts/host/v1/tx.amino"; -import * as _414 from "./applications/transfer/v1/tx.amino"; -import * as _415 from "./core/channel/v1/tx.amino"; -import * as _416 from "./core/client/v1/tx.amino"; -import * as _417 from "./applications/interchain_accounts/controller/v1/tx.registry"; -import * as _418 from "./applications/interchain_accounts/host/v1/tx.registry"; -import * as _419 from "./applications/transfer/v1/tx.registry"; -import * as _420 from "./core/channel/v1/tx.registry"; -import * as _421 from "./core/client/v1/tx.registry"; -import * as _422 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; -import * as _423 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; -import * as _424 from "./applications/transfer/v1/query.rpc.Query"; -import * as _425 from "./core/channel/v1/query.rpc.Query"; -import * as _426 from "./core/client/v1/query.rpc.Query"; -import * as _427 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; -import * as _428 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; -import * as _429 from "./applications/transfer/v1/tx.rpc.msg"; -import * as _430 from "./core/channel/v1/tx.rpc.msg"; -import * as _431 from "./core/client/v1/tx.rpc.msg"; -import * as _586 from "./rpc.query"; -import * as _587 from "./rpc.tx"; +import * as _116 from "./applications/interchain_accounts/controller/v1/controller"; +import * as _117 from "./applications/interchain_accounts/controller/v1/query"; +import * as _118 from "./applications/interchain_accounts/controller/v1/tx"; +import * as _119 from "./applications/interchain_accounts/host/v1/host"; +import * as _120 from "./applications/interchain_accounts/host/v1/query"; +import * as _121 from "./applications/interchain_accounts/host/v1/tx"; +import * as _122 from "./applications/interchain_accounts/v1/account"; +import * as _123 from "./applications/interchain_accounts/v1/metadata"; +import * as _124 from "./applications/interchain_accounts/v1/packet"; +import * as _125 from "./applications/transfer/v1/authz"; +import * as _126 from "./applications/transfer/v1/genesis"; +import * as _127 from "./applications/transfer/v1/query"; +import * as _128 from "./applications/transfer/v1/transfer"; +import * as _129 from "./applications/transfer/v1/tx"; +import * as _130 from "./core/channel/v1/channel"; +import * as _131 from "./core/channel/v1/genesis"; +import * as _132 from "./core/channel/v1/query"; +import * as _133 from "./core/channel/v1/tx"; +import * as _134 from "./core/client/v1/client"; +import * as _135 from "./core/client/v1/genesis"; +import * as _136 from "./core/client/v1/query"; +import * as _137 from "./core/client/v1/tx"; +import * as _419 from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as _420 from "./applications/interchain_accounts/host/v1/tx.amino"; +import * as _421 from "./applications/transfer/v1/tx.amino"; +import * as _422 from "./core/channel/v1/tx.amino"; +import * as _423 from "./core/client/v1/tx.amino"; +import * as _424 from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as _425 from "./applications/interchain_accounts/host/v1/tx.registry"; +import * as _426 from "./applications/transfer/v1/tx.registry"; +import * as _427 from "./core/channel/v1/tx.registry"; +import * as _428 from "./core/client/v1/tx.registry"; +import * as _429 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; +import * as _430 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; +import * as _431 from "./applications/transfer/v1/query.rpc.Query"; +import * as _432 from "./core/channel/v1/query.rpc.Query"; +import * as _433 from "./core/client/v1/query.rpc.Query"; +import * as _434 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; +import * as _435 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; +import * as _436 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _437 from "./core/channel/v1/tx.rpc.msg"; +import * as _438 from "./core/client/v1/tx.rpc.msg"; +import * as _593 from "./rpc.query"; +import * as _594 from "./rpc.tx"; export namespace ibc { export namespace applications { export namespace interchain_accounts { export namespace controller { export const v1 = { - ..._113, - ..._114, - ..._115, - ..._412, - ..._417, - ..._422, - ..._427 + ..._116, + ..._117, + ..._118, + ..._419, + ..._424, + ..._429, + ..._434 }; } export namespace host { export const v1 = { - ..._116, - ..._117, - ..._118, - ..._413, - ..._418, - ..._423, - ..._428 + ..._119, + ..._120, + ..._121, + ..._420, + ..._425, + ..._430, + ..._435 }; } export const v1 = { - ..._119, - ..._120, - ..._121 + ..._122, + ..._123, + ..._124 }; } export namespace transfer { export const v1 = { - ..._122, - ..._123, - ..._124, ..._125, ..._126, - ..._414, - ..._419, - ..._424, - ..._429 + ..._127, + ..._128, + ..._129, + ..._421, + ..._426, + ..._431, + ..._436 }; } } export namespace core { export namespace channel { export const v1 = { - ..._127, - ..._128, - ..._129, ..._130, - ..._415, - ..._420, - ..._425, - ..._430 + ..._131, + ..._132, + ..._133, + ..._422, + ..._427, + ..._432, + ..._437 }; } export namespace client { export const v1 = { - ..._131, - ..._132, - ..._133, ..._134, - ..._416, - ..._421, - ..._426, - ..._431 + ..._135, + ..._136, + ..._137, + ..._423, + ..._428, + ..._433, + ..._438 }; } } export const ClientFactory = { - ..._586, - ..._587 + ..._593, + ..._594 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/rpc.query.ts b/packages/types/protobuf/codegen/ibc/rpc.query.ts index bb51968df..1ddcf2919 100644 --- a/packages/types/protobuf/codegen/ibc/rpc.query.ts +++ b/packages/types/protobuf/codegen/ibc/rpc.query.ts @@ -9,6 +9,9 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { + adminmodule: { + adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) + }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/ibc/rpc.tx.ts b/packages/types/protobuf/codegen/ibc/rpc.tx.ts index 14f8597c8..3df7ca454 100644 --- a/packages/types/protobuf/codegen/ibc/rpc.tx.ts +++ b/packages/types/protobuf/codegen/ibc/rpc.tx.ts @@ -5,6 +5,9 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { + adminmodule: { + adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) + }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/juno/bundle.ts b/packages/types/protobuf/codegen/juno/bundle.ts index 4aa4e59cf..a5dc2540b 100644 --- a/packages/types/protobuf/codegen/juno/bundle.ts +++ b/packages/types/protobuf/codegen/juno/bundle.ts @@ -1,46 +1,46 @@ -import * as _135 from "./feeshare/v1/feeshare"; -import * as _136 from "./feeshare/v1/genesis"; -import * as _137 from "./feeshare/v1/query"; -import * as _138 from "./feeshare/v1/tx"; -import * as _139 from "./mint/genesis"; -import * as _140 from "./mint/mint"; -import * as _141 from "./mint/query"; -import * as _142 from "./mint/tx"; -import * as _432 from "./feeshare/v1/tx.amino"; -import * as _433 from "./mint/tx.amino"; -import * as _434 from "./feeshare/v1/tx.registry"; -import * as _435 from "./mint/tx.registry"; -import * as _436 from "./feeshare/v1/query.rpc.Query"; -import * as _437 from "./mint/query.rpc.Query"; -import * as _438 from "./feeshare/v1/tx.rpc.msg"; -import * as _439 from "./mint/tx.rpc.msg"; -import * as _588 from "./rpc.query"; -import * as _589 from "./rpc.tx"; +import * as _138 from "./feeshare/v1/feeshare"; +import * as _139 from "./feeshare/v1/genesis"; +import * as _140 from "./feeshare/v1/query"; +import * as _141 from "./feeshare/v1/tx"; +import * as _142 from "./mint/genesis"; +import * as _143 from "./mint/mint"; +import * as _144 from "./mint/query"; +import * as _145 from "./mint/tx"; +import * as _439 from "./feeshare/v1/tx.amino"; +import * as _440 from "./mint/tx.amino"; +import * as _441 from "./feeshare/v1/tx.registry"; +import * as _442 from "./mint/tx.registry"; +import * as _443 from "./feeshare/v1/query.rpc.Query"; +import * as _444 from "./mint/query.rpc.Query"; +import * as _445 from "./feeshare/v1/tx.rpc.msg"; +import * as _446 from "./mint/tx.rpc.msg"; +import * as _595 from "./rpc.query"; +import * as _596 from "./rpc.tx"; export namespace juno { export namespace feeshare { export const v1 = { - ..._135, - ..._136, - ..._137, ..._138, - ..._432, - ..._434, - ..._436, - ..._438 + ..._139, + ..._140, + ..._141, + ..._439, + ..._441, + ..._443, + ..._445 }; } export const mint = { - ..._139, - ..._140, - ..._141, ..._142, - ..._433, - ..._435, - ..._437, - ..._439 + ..._143, + ..._144, + ..._145, + ..._440, + ..._442, + ..._444, + ..._446 }; export const ClientFactory = { - ..._588, - ..._589 + ..._595, + ..._596 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/juno/rpc.query.ts b/packages/types/protobuf/codegen/juno/rpc.query.ts index 4cf3955e0..57dcab9eb 100644 --- a/packages/types/protobuf/codegen/juno/rpc.query.ts +++ b/packages/types/protobuf/codegen/juno/rpc.query.ts @@ -9,6 +9,9 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { + adminmodule: { + adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) + }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/juno/rpc.tx.ts b/packages/types/protobuf/codegen/juno/rpc.tx.ts index cc3112731..79bcc00da 100644 --- a/packages/types/protobuf/codegen/juno/rpc.tx.ts +++ b/packages/types/protobuf/codegen/juno/rpc.tx.ts @@ -5,6 +5,9 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { + adminmodule: { + adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) + }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/kujira/bundle.ts b/packages/types/protobuf/codegen/kujira/bundle.ts index 830aaa96a..0593a3180 100644 --- a/packages/types/protobuf/codegen/kujira/bundle.ts +++ b/packages/types/protobuf/codegen/kujira/bundle.ts @@ -1,60 +1,60 @@ -import * as _143 from "./denom/authorityMetadata"; -import * as _144 from "./denom/genesis"; -import * as _145 from "./denom/params"; -import * as _146 from "./denom/query"; -import * as _147 from "./denom/tx"; -import * as _148 from "./oracle/genesis"; -import * as _149 from "./oracle/oracle"; -import * as _150 from "./oracle/query"; -import * as _151 from "./oracle/tx"; -import * as _152 from "./scheduler/genesis"; -import * as _153 from "./scheduler/hook"; -import * as _154 from "./scheduler/params"; -import * as _155 from "./scheduler/proposal"; -import * as _156 from "./scheduler/query"; -import * as _440 from "./denom/tx.amino"; -import * as _441 from "./oracle/tx.amino"; -import * as _442 from "./denom/tx.registry"; -import * as _443 from "./oracle/tx.registry"; -import * as _444 from "./denom/query.rpc.Query"; -import * as _445 from "./oracle/query.rpc.Query"; -import * as _446 from "./scheduler/query.rpc.Query"; -import * as _447 from "./denom/tx.rpc.msg"; -import * as _448 from "./oracle/tx.rpc.msg"; -import * as _590 from "./rpc.query"; -import * as _591 from "./rpc.tx"; +import * as _146 from "./denom/authorityMetadata"; +import * as _147 from "./denom/genesis"; +import * as _148 from "./denom/params"; +import * as _149 from "./denom/query"; +import * as _150 from "./denom/tx"; +import * as _151 from "./oracle/genesis"; +import * as _152 from "./oracle/oracle"; +import * as _153 from "./oracle/query"; +import * as _154 from "./oracle/tx"; +import * as _155 from "./scheduler/genesis"; +import * as _156 from "./scheduler/hook"; +import * as _157 from "./scheduler/params"; +import * as _158 from "./scheduler/proposal"; +import * as _159 from "./scheduler/query"; +import * as _447 from "./denom/tx.amino"; +import * as _448 from "./oracle/tx.amino"; +import * as _449 from "./denom/tx.registry"; +import * as _450 from "./oracle/tx.registry"; +import * as _451 from "./denom/query.rpc.Query"; +import * as _452 from "./oracle/query.rpc.Query"; +import * as _453 from "./scheduler/query.rpc.Query"; +import * as _454 from "./denom/tx.rpc.msg"; +import * as _455 from "./oracle/tx.rpc.msg"; +import * as _597 from "./rpc.query"; +import * as _598 from "./rpc.tx"; export namespace kujira { export const denom = { - ..._143, - ..._144, - ..._145, ..._146, ..._147, - ..._440, - ..._442, - ..._444, - ..._447 - }; - export const oracle = { ..._148, ..._149, ..._150, - ..._151, - ..._441, - ..._443, - ..._445, - ..._448 + ..._447, + ..._449, + ..._451, + ..._454 }; - export const scheduler = { + export const oracle = { + ..._151, ..._152, ..._153, ..._154, + ..._448, + ..._450, + ..._452, + ..._455 + }; + export const scheduler = { ..._155, ..._156, - ..._446 + ..._157, + ..._158, + ..._159, + ..._453 }; export const ClientFactory = { - ..._590, - ..._591 + ..._597, + ..._598 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/rpc.query.ts b/packages/types/protobuf/codegen/kujira/rpc.query.ts index a7c8e57b3..727b027e9 100644 --- a/packages/types/protobuf/codegen/kujira/rpc.query.ts +++ b/packages/types/protobuf/codegen/kujira/rpc.query.ts @@ -9,6 +9,9 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { + adminmodule: { + adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) + }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/kujira/rpc.tx.ts b/packages/types/protobuf/codegen/kujira/rpc.tx.ts index b10034d26..2fd2b0fc5 100644 --- a/packages/types/protobuf/codegen/kujira/rpc.tx.ts +++ b/packages/types/protobuf/codegen/kujira/rpc.tx.ts @@ -5,6 +5,9 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { + adminmodule: { + adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) + }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/neutron/bundle.ts b/packages/types/protobuf/codegen/neutron/bundle.ts index 2549ea389..65299c457 100644 --- a/packages/types/protobuf/codegen/neutron/bundle.ts +++ b/packages/types/protobuf/codegen/neutron/bundle.ts @@ -1,88 +1,85 @@ -import * as _157 from "./contractmanager/v1/failure"; -import * as _158 from "./cron/genesis"; -import * as _159 from "./cron/params"; -import * as _160 from "./cron/query"; -import * as _161 from "./cron/schedule"; -import * as _162 from "./cron/tx"; -import * as _163 from "./dex/deposit_record"; -import * as _164 from "./dex/genesis"; -import * as _165 from "./dex/limit_order_expiration"; -import * as _166 from "./dex/limit_order_tranche_user"; -import * as _167 from "./dex/limit_order_tranche"; -import * as _168 from "./dex/pair_id"; -import * as _169 from "./dex/params"; -import * as _170 from "./dex/pool_metadata"; -import * as _171 from "./dex/pool_reserves"; -import * as _172 from "./dex/pool"; -import * as _173 from "./dex/query"; -import * as _174 from "./dex/tick_liquidity"; -import * as _175 from "./dex/trade_pair_id"; -import * as _176 from "./dex/tx"; -import * as _177 from "./feeburner/genesis"; -import * as _178 from "./feeburner/params"; -import * as _179 from "./feeburner/query"; -import * as _180 from "./feeburner/total_burned_neutrons_amount"; -import * as _181 from "./feeburner/tx"; -import * as _182 from "./feerefunder/fee"; -import * as _183 from "./feerefunder/genesis"; -import * as _184 from "./feerefunder/params"; -import * as _185 from "./feerefunder/query"; -import * as _186 from "./feerefunder/tx"; -import * as _187 from "./interchainqueries/genesis"; -import * as _188 from "./interchainqueries/params"; -import * as _189 from "./interchainqueries/query"; -import * as _190 from "./interchainqueries/tx"; -import * as _191 from "./interchaintxs/v1/genesis"; -import * as _192 from "./interchaintxs/v1/params"; -import * as _193 from "./interchaintxs/v1/query"; -import * as _194 from "./interchaintxs/v1/tx"; -import * as _449 from "./cron/tx.amino"; -import * as _450 from "./dex/tx.amino"; -import * as _451 from "./feeburner/tx.amino"; -import * as _452 from "./feerefunder/tx.amino"; -import * as _453 from "./interchainqueries/tx.amino"; -import * as _454 from "./interchaintxs/v1/tx.amino"; -import * as _455 from "./cron/tx.registry"; -import * as _456 from "./dex/tx.registry"; -import * as _457 from "./feeburner/tx.registry"; -import * as _458 from "./feerefunder/tx.registry"; -import * as _459 from "./interchainqueries/tx.registry"; -import * as _460 from "./interchaintxs/v1/tx.registry"; -import * as _461 from "./cron/query.rpc.Query"; -import * as _462 from "./dex/query.rpc.Query"; -import * as _463 from "./feeburner/query.rpc.Query"; -import * as _464 from "./feerefunder/query.rpc.Query"; -import * as _465 from "./interchainqueries/query.rpc.Query"; -import * as _466 from "./interchaintxs/v1/query.rpc.Query"; -import * as _467 from "./cron/tx.rpc.msg"; -import * as _468 from "./dex/tx.rpc.msg"; -import * as _469 from "./feeburner/tx.rpc.msg"; -import * as _470 from "./feerefunder/tx.rpc.msg"; -import * as _471 from "./interchainqueries/tx.rpc.msg"; -import * as _472 from "./interchaintxs/v1/tx.rpc.msg"; -import * as _592 from "./rpc.query"; -import * as _593 from "./rpc.tx"; +import * as _160 from "./contractmanager/v1/failure"; +import * as _161 from "./cron/genesis"; +import * as _162 from "./cron/params"; +import * as _163 from "./cron/query"; +import * as _164 from "./cron/schedule"; +import * as _165 from "./cron/tx"; +import * as _166 from "./dex/deposit_record"; +import * as _167 from "./dex/genesis"; +import * as _168 from "./dex/limit_order_expiration"; +import * as _169 from "./dex/limit_order_tranche_user"; +import * as _170 from "./dex/limit_order_tranche"; +import * as _171 from "./dex/pair_id"; +import * as _172 from "./dex/params"; +import * as _173 from "./dex/pool_metadata"; +import * as _174 from "./dex/pool_reserves"; +import * as _175 from "./dex/pool"; +import * as _176 from "./dex/query"; +import * as _177 from "./dex/tick_liquidity"; +import * as _178 from "./dex/trade_pair_id"; +import * as _179 from "./dex/tx"; +import * as _180 from "./feeburner/genesis"; +import * as _181 from "./feeburner/params"; +import * as _182 from "./feeburner/query"; +import * as _183 from "./feeburner/total_burned_neutrons_amount"; +import * as _184 from "./feeburner/tx"; +import * as _185 from "./feerefunder/fee"; +import * as _186 from "./feerefunder/genesis"; +import * as _187 from "./feerefunder/params"; +import * as _188 from "./feerefunder/query"; +import * as _189 from "./feerefunder/tx"; +import * as _190 from "./interchainqueries/genesis"; +import * as _191 from "./interchainqueries/params"; +import * as _192 from "./interchainqueries/query"; +import * as _193 from "./interchainqueries/tx"; +import * as _194 from "./interchaintxs/v1/genesis"; +import * as _195 from "./interchaintxs/v1/params"; +import * as _196 from "./interchaintxs/v1/query"; +import * as _197 from "./interchaintxs/v1/tx"; +import * as _456 from "./cron/tx.amino"; +import * as _457 from "./dex/tx.amino"; +import * as _458 from "./feeburner/tx.amino"; +import * as _459 from "./feerefunder/tx.amino"; +import * as _460 from "./interchainqueries/tx.amino"; +import * as _461 from "./interchaintxs/v1/tx.amino"; +import * as _462 from "./cron/tx.registry"; +import * as _463 from "./dex/tx.registry"; +import * as _464 from "./feeburner/tx.registry"; +import * as _465 from "./feerefunder/tx.registry"; +import * as _466 from "./interchainqueries/tx.registry"; +import * as _467 from "./interchaintxs/v1/tx.registry"; +import * as _468 from "./cron/query.rpc.Query"; +import * as _469 from "./dex/query.rpc.Query"; +import * as _470 from "./feeburner/query.rpc.Query"; +import * as _471 from "./feerefunder/query.rpc.Query"; +import * as _472 from "./interchainqueries/query.rpc.Query"; +import * as _473 from "./interchaintxs/v1/query.rpc.Query"; +import * as _474 from "./cron/tx.rpc.msg"; +import * as _475 from "./dex/tx.rpc.msg"; +import * as _476 from "./feeburner/tx.rpc.msg"; +import * as _477 from "./feerefunder/tx.rpc.msg"; +import * as _478 from "./interchainqueries/tx.rpc.msg"; +import * as _479 from "./interchaintxs/v1/tx.rpc.msg"; +import * as _599 from "./rpc.query"; +import * as _600 from "./rpc.tx"; export namespace neutron { export namespace contractmanager { export const v1 = { - ..._157 + ..._160 }; } export const cron = { - ..._158, - ..._159, - ..._160, ..._161, ..._162, - ..._449, - ..._455, - ..._461, - ..._467 - }; - export const dex = { ..._163, ..._164, ..._165, + ..._456, + ..._462, + ..._468, + ..._474 + }; + export const dex = { ..._166, ..._167, ..._168, @@ -94,57 +91,60 @@ export namespace neutron { ..._174, ..._175, ..._176, - ..._450, - ..._456, - ..._462, - ..._468 - }; - export const feeburner = { ..._177, ..._178, ..._179, - ..._180, - ..._181, - ..._451, ..._457, ..._463, - ..._469 + ..._469, + ..._475 }; - export const feerefunder = { + export const feeburner = { + ..._180, + ..._181, ..._182, ..._183, ..._184, - ..._185, - ..._186, - ..._452, ..._458, ..._464, - ..._470 + ..._470, + ..._476 }; - export const interchainqueries = { + export const feerefunder = { + ..._185, + ..._186, ..._187, ..._188, ..._189, - ..._190, - ..._453, ..._459, ..._465, - ..._471 + ..._471, + ..._477 + }; + export const interchainqueries = { + ..._190, + ..._191, + ..._192, + ..._193, + ..._460, + ..._466, + ..._472, + ..._478 }; export namespace interchaintxs { export const v1 = { - ..._191, - ..._192, - ..._193, ..._194, - ..._454, - ..._460, - ..._466, - ..._472 + ..._195, + ..._196, + ..._197, + ..._461, + ..._467, + ..._473, + ..._479 }; } export const ClientFactory = { - ..._592, - ..._593 + ..._599, + ..._600 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/neutron/rpc.query.ts b/packages/types/protobuf/codegen/neutron/rpc.query.ts index 6a2fc37fe..e61c84020 100644 --- a/packages/types/protobuf/codegen/neutron/rpc.query.ts +++ b/packages/types/protobuf/codegen/neutron/rpc.query.ts @@ -9,6 +9,9 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { + adminmodule: { + adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) + }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/neutron/rpc.tx.ts b/packages/types/protobuf/codegen/neutron/rpc.tx.ts index 9c391ea03..ef8db8cf4 100644 --- a/packages/types/protobuf/codegen/neutron/rpc.tx.ts +++ b/packages/types/protobuf/codegen/neutron/rpc.tx.ts @@ -5,6 +5,9 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { + adminmodule: { + adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) + }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/noble/bundle.ts b/packages/types/protobuf/codegen/noble/bundle.ts index 01c4dbcd4..aabc4ea37 100644 --- a/packages/types/protobuf/codegen/noble/bundle.ts +++ b/packages/types/protobuf/codegen/noble/bundle.ts @@ -1,16 +1,16 @@ -import * as _332 from "../tariff/genesis"; -import * as _333 from "../tariff/params"; -import * as _334 from "../tariff/query"; -import * as _575 from "../tariff/query.rpc.Query"; -import * as _602 from "./rpc.query"; +import * as _335 from "../tariff/genesis"; +import * as _336 from "../tariff/params"; +import * as _337 from "../tariff/query"; +import * as _582 from "../tariff/query.rpc.Query"; +import * as _609 from "./rpc.query"; export namespace noble { export const tariff = { - ..._332, - ..._333, - ..._334, - ..._575 + ..._335, + ..._336, + ..._337, + ..._582 }; export const ClientFactory = { - ..._602 + ..._609 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/noble/rpc.query.ts b/packages/types/protobuf/codegen/noble/rpc.query.ts index 00d067ffb..5009a46c2 100644 --- a/packages/types/protobuf/codegen/noble/rpc.query.ts +++ b/packages/types/protobuf/codegen/noble/rpc.query.ts @@ -9,6 +9,9 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { + adminmodule: { + adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) + }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/osmosis/bundle.ts b/packages/types/protobuf/codegen/osmosis/bundle.ts index 5832d0359..96a5b9f02 100644 --- a/packages/types/protobuf/codegen/osmosis/bundle.ts +++ b/packages/types/protobuf/codegen/osmosis/bundle.ts @@ -1,156 +1,153 @@ -import * as _195 from "./accum/v1beta1/accum"; -import * as _196 from "./concentratedliquidity/params"; -import * as _197 from "./cosmwasmpool/v1beta1/genesis"; -import * as _198 from "./cosmwasmpool/v1beta1/gov"; -import * as _199 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; -import * as _200 from "./cosmwasmpool/v1beta1/model/module_query_msg"; -import * as _201 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; -import * as _202 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; -import * as _203 from "./cosmwasmpool/v1beta1/model/pool"; -import * as _204 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; -import * as _205 from "./cosmwasmpool/v1beta1/model/tx"; -import * as _206 from "./cosmwasmpool/v1beta1/params"; -import * as _207 from "./cosmwasmpool/v1beta1/query"; -import * as _208 from "./cosmwasmpool/v1beta1/tx"; -import * as _209 from "./gamm/pool-models/balancer/balancerPool"; -import * as _210 from "./gamm/v1beta1/genesis"; -import * as _211 from "./gamm/v1beta1/gov"; -import * as _212 from "./gamm/v1beta1/query"; -import * as _213 from "./gamm/v1beta1/shared"; -import * as _214 from "./gamm/v1beta1/tx"; -import * as _215 from "./gamm/pool-models/balancer/tx/tx"; -import * as _216 from "./gamm/pool-models/stableswap/stableswap_pool"; -import * as _217 from "./gamm/pool-models/stableswap/tx"; -import * as _218 from "./incentives/gauge"; -import * as _219 from "./incentives/genesis"; -import * as _220 from "./incentives/gov"; -import * as _221 from "./incentives/group"; -import * as _222 from "./incentives/params"; -import * as _223 from "./incentives/query"; -import * as _224 from "./incentives/tx"; -import * as _225 from "./lockup/genesis"; -import * as _226 from "./lockup/lock"; -import * as _227 from "./lockup/params"; -import * as _228 from "./lockup/query"; -import * as _229 from "./lockup/tx"; -import * as _230 from "./pool-incentives/v1beta1/genesis"; -import * as _231 from "./pool-incentives/v1beta1/gov"; -import * as _232 from "./pool-incentives/v1beta1/incentives"; -import * as _233 from "./pool-incentives/v1beta1/query"; -import * as _234 from "./pool-incentives/v1beta1/shared"; -import * as _235 from "./poolmanager/v1beta1/genesis"; -import * as _236 from "./poolmanager/v1beta1/gov"; -import * as _237 from "./poolmanager/v1beta1/module_route"; -import * as _238 from "./poolmanager/v1beta1/query"; -import * as _239 from "./poolmanager/v1beta1/swap_route"; -import * as _240 from "./poolmanager/v1beta1/tx"; -import * as _241 from "./protorev/v1beta1/genesis"; -import * as _242 from "./protorev/v1beta1/gov"; -import * as _243 from "./protorev/v1beta1/params"; -import * as _244 from "./protorev/v1beta1/protorev"; -import * as _245 from "./protorev/v1beta1/query"; -import * as _246 from "./protorev/v1beta1/tx"; -import * as _247 from "./superfluid/genesis"; -import * as _248 from "./superfluid/params"; -import * as _249 from "./superfluid/query"; -import * as _250 from "./superfluid/superfluid"; -import * as _251 from "./superfluid/tx"; -import * as _252 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _253 from "./tokenfactory/v1beta1/genesis"; -import * as _254 from "./tokenfactory/v1beta1/params"; -import * as _255 from "./tokenfactory/v1beta1/query"; -import * as _256 from "./tokenfactory/v1beta1/tx"; -import * as _257 from "./txfees/v1beta1/feetoken"; -import * as _258 from "./txfees/v1beta1/genesis"; -import * as _259 from "./txfees/v1beta1/gov"; -import * as _260 from "./txfees/v1beta1/params"; -import * as _261 from "./txfees/v1beta1/query"; -import * as _262 from "./txfees/v1beta1/tx"; -import * as _263 from "./valset-pref/v1beta1/query"; -import * as _264 from "./valset-pref/v1beta1/state"; -import * as _265 from "./valset-pref/v1beta1/tx"; -import * as _473 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; -import * as _474 from "./concentratedliquidity/v1beta1/tx.amino"; -import * as _475 from "./gamm/pool-models/balancer/tx/tx.amino"; -import * as _476 from "./gamm/pool-models/stableswap/tx.amino"; -import * as _477 from "./gamm/v1beta1/tx.amino"; -import * as _478 from "./incentives/tx.amino"; -import * as _479 from "./lockup/tx.amino"; -import * as _480 from "./poolmanager/v1beta1/tx.amino"; -import * as _481 from "./protorev/v1beta1/tx.amino"; -import * as _482 from "./superfluid/tx.amino"; -import * as _483 from "./tokenfactory/v1beta1/tx.amino"; -import * as _484 from "./txfees/v1beta1/tx.amino"; -import * as _485 from "./valset-pref/v1beta1/tx.amino"; -import * as _486 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; -import * as _487 from "./concentratedliquidity/v1beta1/tx.registry"; -import * as _488 from "./gamm/pool-models/balancer/tx/tx.registry"; -import * as _489 from "./gamm/pool-models/stableswap/tx.registry"; -import * as _490 from "./gamm/v1beta1/tx.registry"; -import * as _491 from "./incentives/tx.registry"; -import * as _492 from "./lockup/tx.registry"; -import * as _493 from "./poolmanager/v1beta1/tx.registry"; -import * as _494 from "./protorev/v1beta1/tx.registry"; -import * as _495 from "./superfluid/tx.registry"; -import * as _496 from "./tokenfactory/v1beta1/tx.registry"; -import * as _497 from "./txfees/v1beta1/tx.registry"; -import * as _498 from "./valset-pref/v1beta1/tx.registry"; -import * as _499 from "./concentratedliquidity/v1beta1/query.rpc.Query"; -import * as _500 from "./cosmwasmpool/v1beta1/query.rpc.Query"; -import * as _501 from "./gamm/v1beta1/query.rpc.Query"; -import * as _502 from "./incentives/query.rpc.Query"; -import * as _503 from "./lockup/query.rpc.Query"; -import * as _504 from "./pool-incentives/v1beta1/query.rpc.Query"; -import * as _505 from "./poolmanager/v1beta1/query.rpc.Query"; -import * as _506 from "./protorev/v1beta1/query.rpc.Query"; -import * as _507 from "./superfluid/query.rpc.Query"; -import * as _508 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _509 from "./txfees/v1beta1/query.rpc.Query"; -import * as _510 from "./valset-pref/v1beta1/query.rpc.Query"; -import * as _511 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; -import * as _512 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; -import * as _513 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; -import * as _514 from "./gamm/pool-models/stableswap/tx.rpc.msg"; -import * as _515 from "./gamm/v1beta1/tx.rpc.msg"; -import * as _516 from "./incentives/tx.rpc.msg"; -import * as _517 from "./lockup/tx.rpc.msg"; -import * as _518 from "./poolmanager/v1beta1/tx.rpc.msg"; -import * as _519 from "./protorev/v1beta1/tx.rpc.msg"; -import * as _520 from "./superfluid/tx.rpc.msg"; -import * as _521 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _522 from "./txfees/v1beta1/tx.rpc.msg"; -import * as _523 from "./valset-pref/v1beta1/tx.rpc.msg"; -import * as _594 from "./rpc.query"; -import * as _595 from "./rpc.tx"; +import * as _198 from "./accum/v1beta1/accum"; +import * as _199 from "./concentratedliquidity/params"; +import * as _200 from "./cosmwasmpool/v1beta1/genesis"; +import * as _201 from "./cosmwasmpool/v1beta1/gov"; +import * as _202 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; +import * as _203 from "./cosmwasmpool/v1beta1/model/module_query_msg"; +import * as _204 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; +import * as _205 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; +import * as _206 from "./cosmwasmpool/v1beta1/model/pool"; +import * as _207 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; +import * as _208 from "./cosmwasmpool/v1beta1/model/tx"; +import * as _209 from "./cosmwasmpool/v1beta1/params"; +import * as _210 from "./cosmwasmpool/v1beta1/query"; +import * as _211 from "./cosmwasmpool/v1beta1/tx"; +import * as _212 from "./gamm/pool-models/balancer/balancerPool"; +import * as _213 from "./gamm/v1beta1/genesis"; +import * as _214 from "./gamm/v1beta1/gov"; +import * as _215 from "./gamm/v1beta1/query"; +import * as _216 from "./gamm/v1beta1/shared"; +import * as _217 from "./gamm/v1beta1/tx"; +import * as _218 from "./gamm/pool-models/balancer/tx/tx"; +import * as _219 from "./gamm/pool-models/stableswap/stableswap_pool"; +import * as _220 from "./gamm/pool-models/stableswap/tx"; +import * as _221 from "./incentives/gauge"; +import * as _222 from "./incentives/genesis"; +import * as _223 from "./incentives/gov"; +import * as _224 from "./incentives/group"; +import * as _225 from "./incentives/params"; +import * as _226 from "./incentives/query"; +import * as _227 from "./incentives/tx"; +import * as _228 from "./lockup/genesis"; +import * as _229 from "./lockup/lock"; +import * as _230 from "./lockup/params"; +import * as _231 from "./lockup/query"; +import * as _232 from "./lockup/tx"; +import * as _233 from "./pool-incentives/v1beta1/genesis"; +import * as _234 from "./pool-incentives/v1beta1/gov"; +import * as _235 from "./pool-incentives/v1beta1/incentives"; +import * as _236 from "./pool-incentives/v1beta1/query"; +import * as _237 from "./pool-incentives/v1beta1/shared"; +import * as _238 from "./poolmanager/v1beta1/genesis"; +import * as _239 from "./poolmanager/v1beta1/gov"; +import * as _240 from "./poolmanager/v1beta1/module_route"; +import * as _241 from "./poolmanager/v1beta1/query"; +import * as _242 from "./poolmanager/v1beta1/swap_route"; +import * as _243 from "./poolmanager/v1beta1/tx"; +import * as _244 from "./protorev/v1beta1/genesis"; +import * as _245 from "./protorev/v1beta1/gov"; +import * as _246 from "./protorev/v1beta1/params"; +import * as _247 from "./protorev/v1beta1/protorev"; +import * as _248 from "./protorev/v1beta1/query"; +import * as _249 from "./protorev/v1beta1/tx"; +import * as _250 from "./superfluid/genesis"; +import * as _251 from "./superfluid/params"; +import * as _252 from "./superfluid/query"; +import * as _253 from "./superfluid/superfluid"; +import * as _254 from "./superfluid/tx"; +import * as _255 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _256 from "./tokenfactory/v1beta1/genesis"; +import * as _257 from "./tokenfactory/v1beta1/params"; +import * as _258 from "./tokenfactory/v1beta1/query"; +import * as _259 from "./tokenfactory/v1beta1/tx"; +import * as _260 from "./txfees/v1beta1/feetoken"; +import * as _261 from "./txfees/v1beta1/genesis"; +import * as _262 from "./txfees/v1beta1/gov"; +import * as _263 from "./txfees/v1beta1/params"; +import * as _264 from "./txfees/v1beta1/query"; +import * as _265 from "./txfees/v1beta1/tx"; +import * as _266 from "./valset-pref/v1beta1/query"; +import * as _267 from "./valset-pref/v1beta1/state"; +import * as _268 from "./valset-pref/v1beta1/tx"; +import * as _480 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; +import * as _481 from "./concentratedliquidity/v1beta1/tx.amino"; +import * as _482 from "./gamm/pool-models/balancer/tx/tx.amino"; +import * as _483 from "./gamm/pool-models/stableswap/tx.amino"; +import * as _484 from "./gamm/v1beta1/tx.amino"; +import * as _485 from "./incentives/tx.amino"; +import * as _486 from "./lockup/tx.amino"; +import * as _487 from "./poolmanager/v1beta1/tx.amino"; +import * as _488 from "./protorev/v1beta1/tx.amino"; +import * as _489 from "./superfluid/tx.amino"; +import * as _490 from "./tokenfactory/v1beta1/tx.amino"; +import * as _491 from "./txfees/v1beta1/tx.amino"; +import * as _492 from "./valset-pref/v1beta1/tx.amino"; +import * as _493 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; +import * as _494 from "./concentratedliquidity/v1beta1/tx.registry"; +import * as _495 from "./gamm/pool-models/balancer/tx/tx.registry"; +import * as _496 from "./gamm/pool-models/stableswap/tx.registry"; +import * as _497 from "./gamm/v1beta1/tx.registry"; +import * as _498 from "./incentives/tx.registry"; +import * as _499 from "./lockup/tx.registry"; +import * as _500 from "./poolmanager/v1beta1/tx.registry"; +import * as _501 from "./protorev/v1beta1/tx.registry"; +import * as _502 from "./superfluid/tx.registry"; +import * as _503 from "./tokenfactory/v1beta1/tx.registry"; +import * as _504 from "./txfees/v1beta1/tx.registry"; +import * as _505 from "./valset-pref/v1beta1/tx.registry"; +import * as _506 from "./concentratedliquidity/v1beta1/query.rpc.Query"; +import * as _507 from "./cosmwasmpool/v1beta1/query.rpc.Query"; +import * as _508 from "./gamm/v1beta1/query.rpc.Query"; +import * as _509 from "./incentives/query.rpc.Query"; +import * as _510 from "./lockup/query.rpc.Query"; +import * as _511 from "./pool-incentives/v1beta1/query.rpc.Query"; +import * as _512 from "./poolmanager/v1beta1/query.rpc.Query"; +import * as _513 from "./protorev/v1beta1/query.rpc.Query"; +import * as _514 from "./superfluid/query.rpc.Query"; +import * as _515 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _516 from "./txfees/v1beta1/query.rpc.Query"; +import * as _517 from "./valset-pref/v1beta1/query.rpc.Query"; +import * as _518 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; +import * as _519 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; +import * as _520 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; +import * as _521 from "./gamm/pool-models/stableswap/tx.rpc.msg"; +import * as _522 from "./gamm/v1beta1/tx.rpc.msg"; +import * as _523 from "./incentives/tx.rpc.msg"; +import * as _524 from "./lockup/tx.rpc.msg"; +import * as _525 from "./poolmanager/v1beta1/tx.rpc.msg"; +import * as _526 from "./protorev/v1beta1/tx.rpc.msg"; +import * as _527 from "./superfluid/tx.rpc.msg"; +import * as _528 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _529 from "./txfees/v1beta1/tx.rpc.msg"; +import * as _530 from "./valset-pref/v1beta1/tx.rpc.msg"; +import * as _601 from "./rpc.query"; +import * as _602 from "./rpc.tx"; export namespace osmosis { export namespace accum { export const v1beta1 = { - ..._195 + ..._198 }; } export const concentratedliquidity = { - ..._196, + ..._199, poolmodel: { concentrated: { v1beta1: { - ..._473, - ..._486, - ..._511 + ..._480, + ..._493, + ..._518 } } }, v1beta1: { - ..._474, - ..._487, - ..._499, - ..._512 + ..._481, + ..._494, + ..._506, + ..._519 } }; export namespace cosmwasmpool { export const v1beta1 = { - ..._197, - ..._198, - ..._199, ..._200, ..._201, ..._202, @@ -160,155 +157,158 @@ export namespace osmosis { ..._206, ..._207, ..._208, - ..._500 + ..._209, + ..._210, + ..._211, + ..._507 }; } export namespace gamm { export const v1beta1 = { - ..._209, - ..._210, - ..._211, ..._212, ..._213, ..._214, - ..._477, - ..._490, - ..._501, - ..._515 + ..._215, + ..._216, + ..._217, + ..._484, + ..._497, + ..._508, + ..._522 }; export namespace poolmodels { export namespace balancer { export const v1beta1 = { - ..._215, - ..._475, - ..._488, - ..._513 + ..._218, + ..._482, + ..._495, + ..._520 }; } export namespace stableswap { export const v1beta1 = { - ..._216, - ..._217, - ..._476, - ..._489, - ..._514 + ..._219, + ..._220, + ..._483, + ..._496, + ..._521 }; } } } export const incentives = { - ..._218, - ..._219, - ..._220, ..._221, ..._222, ..._223, ..._224, - ..._478, - ..._491, - ..._502, - ..._516 - }; - export const lockup = { ..._225, ..._226, ..._227, + ..._485, + ..._498, + ..._509, + ..._523 + }; + export const lockup = { ..._228, ..._229, - ..._479, - ..._492, - ..._503, - ..._517 + ..._230, + ..._231, + ..._232, + ..._486, + ..._499, + ..._510, + ..._524 }; export namespace poolincentives { export const v1beta1 = { - ..._230, - ..._231, - ..._232, ..._233, ..._234, - ..._504 + ..._235, + ..._236, + ..._237, + ..._511 }; } export namespace poolmanager { export const v1beta1 = { - ..._235, - ..._236, - ..._237, ..._238, ..._239, ..._240, - ..._480, - ..._493, - ..._505, - ..._518 + ..._241, + ..._242, + ..._243, + ..._487, + ..._500, + ..._512, + ..._525 }; } export namespace protorev { export const v1beta1 = { - ..._241, - ..._242, - ..._243, ..._244, ..._245, ..._246, - ..._481, - ..._494, - ..._506, - ..._519 + ..._247, + ..._248, + ..._249, + ..._488, + ..._501, + ..._513, + ..._526 }; } export const superfluid = { - ..._247, - ..._248, - ..._249, ..._250, ..._251, - ..._482, - ..._495, - ..._507, - ..._520 + ..._252, + ..._253, + ..._254, + ..._489, + ..._502, + ..._514, + ..._527 }; export namespace tokenfactory { export const v1beta1 = { - ..._252, - ..._253, - ..._254, ..._255, ..._256, - ..._483, - ..._496, - ..._508, - ..._521 + ..._257, + ..._258, + ..._259, + ..._490, + ..._503, + ..._515, + ..._528 }; } export namespace txfees { export const v1beta1 = { - ..._257, - ..._258, - ..._259, ..._260, ..._261, ..._262, - ..._484, - ..._497, - ..._509, - ..._522 + ..._263, + ..._264, + ..._265, + ..._491, + ..._504, + ..._516, + ..._529 }; } export namespace valsetpref { export const v1beta1 = { - ..._263, - ..._264, - ..._265, - ..._485, - ..._498, - ..._510, - ..._523 + ..._266, + ..._267, + ..._268, + ..._492, + ..._505, + ..._517, + ..._530 }; } export const ClientFactory = { - ..._594, - ..._595 + ..._601, + ..._602 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/rpc.query.ts b/packages/types/protobuf/codegen/osmosis/rpc.query.ts index 4862426bf..8e4e99136 100644 --- a/packages/types/protobuf/codegen/osmosis/rpc.query.ts +++ b/packages/types/protobuf/codegen/osmosis/rpc.query.ts @@ -9,6 +9,9 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { + adminmodule: { + adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) + }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/osmosis/rpc.tx.ts b/packages/types/protobuf/codegen/osmosis/rpc.tx.ts index 572d5ff05..d1d9d5d01 100644 --- a/packages/types/protobuf/codegen/osmosis/rpc.tx.ts +++ b/packages/types/protobuf/codegen/osmosis/rpc.tx.ts @@ -5,6 +5,9 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { + adminmodule: { + adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) + }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/pstake/bundle.ts b/packages/types/protobuf/codegen/pstake/bundle.ts index 67018b2b1..a4b5e0f04 100644 --- a/packages/types/protobuf/codegen/pstake/bundle.ts +++ b/packages/types/protobuf/codegen/pstake/bundle.ts @@ -1,98 +1,98 @@ -import * as _266 from "./liquidstake/v1beta1/genesis"; -import * as _267 from "./liquidstake/v1beta1/liquidstake"; -import * as _268 from "./liquidstake/v1beta1/query"; -import * as _269 from "./liquidstake/v1beta1/tx"; -import * as _270 from "./liquidstakeibc/v1beta1/genesis"; -import * as _271 from "./liquidstakeibc/v1beta1/liquidstakeibc"; -import * as _272 from "./liquidstakeibc/v1beta1/msgs"; -import * as _273 from "./liquidstakeibc/v1beta1/params"; -import * as _274 from "./liquidstakeibc/v1beta1/query"; -import * as _275 from "./lscosmos/v1beta1/genesis"; -import * as _276 from "./lscosmos/v1beta1/governance_proposal"; -import * as _277 from "./lscosmos/v1beta1/lscosmos"; -import * as _278 from "./lscosmos/v1beta1/msgs"; -import * as _279 from "./lscosmos/v1beta1/params"; -import * as _280 from "./lscosmos/v1beta1/query"; -import * as _281 from "./ratesync/v1beta1/contract"; -import * as _282 from "./ratesync/v1beta1/genesis"; -import * as _283 from "./ratesync/v1beta1/params"; -import * as _284 from "./ratesync/v1beta1/query"; -import * as _285 from "./ratesync/v1beta1/ratesync"; -import * as _286 from "./ratesync/v1beta1/tx"; -import * as _524 from "./liquidstake/v1beta1/tx.amino"; -import * as _525 from "./liquidstakeibc/v1beta1/msgs.amino"; -import * as _526 from "./lscosmos/v1beta1/msgs.amino"; -import * as _527 from "./ratesync/v1beta1/tx.amino"; -import * as _528 from "./liquidstake/v1beta1/tx.registry"; -import * as _529 from "./liquidstakeibc/v1beta1/msgs.registry"; -import * as _530 from "./lscosmos/v1beta1/msgs.registry"; -import * as _531 from "./ratesync/v1beta1/tx.registry"; -import * as _532 from "./liquidstake/v1beta1/query.rpc.Query"; -import * as _533 from "./liquidstakeibc/v1beta1/query.rpc.Query"; -import * as _534 from "./lscosmos/v1beta1/query.rpc.Query"; -import * as _535 from "./ratesync/v1beta1/query.rpc.Query"; -import * as _536 from "./liquidstake/v1beta1/tx.rpc.msg"; -import * as _537 from "./liquidstakeibc/v1beta1/msgs.rpc.msg"; -import * as _538 from "./lscosmos/v1beta1/msgs.rpc.msg"; -import * as _539 from "./ratesync/v1beta1/tx.rpc.msg"; -import * as _596 from "./rpc.query"; -import * as _597 from "./rpc.tx"; +import * as _269 from "./liquidstake/v1beta1/genesis"; +import * as _270 from "./liquidstake/v1beta1/liquidstake"; +import * as _271 from "./liquidstake/v1beta1/query"; +import * as _272 from "./liquidstake/v1beta1/tx"; +import * as _273 from "./liquidstakeibc/v1beta1/genesis"; +import * as _274 from "./liquidstakeibc/v1beta1/liquidstakeibc"; +import * as _275 from "./liquidstakeibc/v1beta1/msgs"; +import * as _276 from "./liquidstakeibc/v1beta1/params"; +import * as _277 from "./liquidstakeibc/v1beta1/query"; +import * as _278 from "./lscosmos/v1beta1/genesis"; +import * as _279 from "./lscosmos/v1beta1/governance_proposal"; +import * as _280 from "./lscosmos/v1beta1/lscosmos"; +import * as _281 from "./lscosmos/v1beta1/msgs"; +import * as _282 from "./lscosmos/v1beta1/params"; +import * as _283 from "./lscosmos/v1beta1/query"; +import * as _284 from "./ratesync/v1beta1/contract"; +import * as _285 from "./ratesync/v1beta1/genesis"; +import * as _286 from "./ratesync/v1beta1/params"; +import * as _287 from "./ratesync/v1beta1/query"; +import * as _288 from "./ratesync/v1beta1/ratesync"; +import * as _289 from "./ratesync/v1beta1/tx"; +import * as _531 from "./liquidstake/v1beta1/tx.amino"; +import * as _532 from "./liquidstakeibc/v1beta1/msgs.amino"; +import * as _533 from "./lscosmos/v1beta1/msgs.amino"; +import * as _534 from "./ratesync/v1beta1/tx.amino"; +import * as _535 from "./liquidstake/v1beta1/tx.registry"; +import * as _536 from "./liquidstakeibc/v1beta1/msgs.registry"; +import * as _537 from "./lscosmos/v1beta1/msgs.registry"; +import * as _538 from "./ratesync/v1beta1/tx.registry"; +import * as _539 from "./liquidstake/v1beta1/query.rpc.Query"; +import * as _540 from "./liquidstakeibc/v1beta1/query.rpc.Query"; +import * as _541 from "./lscosmos/v1beta1/query.rpc.Query"; +import * as _542 from "./ratesync/v1beta1/query.rpc.Query"; +import * as _543 from "./liquidstake/v1beta1/tx.rpc.msg"; +import * as _544 from "./liquidstakeibc/v1beta1/msgs.rpc.msg"; +import * as _545 from "./lscosmos/v1beta1/msgs.rpc.msg"; +import * as _546 from "./ratesync/v1beta1/tx.rpc.msg"; +import * as _603 from "./rpc.query"; +import * as _604 from "./rpc.tx"; export namespace pstake { export namespace liquidstake { export const v1beta1 = { - ..._266, - ..._267, - ..._268, ..._269, - ..._524, - ..._528, - ..._532, - ..._536 + ..._270, + ..._271, + ..._272, + ..._531, + ..._535, + ..._539, + ..._543 }; } export namespace liquidstakeibc { export const v1beta1 = { - ..._270, - ..._271, - ..._272, ..._273, ..._274, - ..._525, - ..._529, - ..._533, - ..._537 + ..._275, + ..._276, + ..._277, + ..._532, + ..._536, + ..._540, + ..._544 }; } export namespace lscosmos { export const v1beta1 = { - ..._275, - ..._276, - ..._277, ..._278, ..._279, ..._280, - ..._526, - ..._530, - ..._534, - ..._538 + ..._281, + ..._282, + ..._283, + ..._533, + ..._537, + ..._541, + ..._545 }; } export namespace ratesync { export const v1beta1 = { - ..._281, - ..._282, - ..._283, ..._284, ..._285, ..._286, - ..._527, - ..._531, - ..._535, - ..._539 + ..._287, + ..._288, + ..._289, + ..._534, + ..._538, + ..._542, + ..._546 }; } export const ClientFactory = { - ..._596, - ..._597 + ..._603, + ..._604 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/rpc.query.ts b/packages/types/protobuf/codegen/pstake/rpc.query.ts index 059eb0f34..fe603a1f2 100644 --- a/packages/types/protobuf/codegen/pstake/rpc.query.ts +++ b/packages/types/protobuf/codegen/pstake/rpc.query.ts @@ -9,6 +9,9 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { + adminmodule: { + adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) + }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/pstake/rpc.tx.ts b/packages/types/protobuf/codegen/pstake/rpc.tx.ts index 73c4b893e..d8338e6e0 100644 --- a/packages/types/protobuf/codegen/pstake/rpc.tx.ts +++ b/packages/types/protobuf/codegen/pstake/rpc.tx.ts @@ -5,6 +5,9 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { + adminmodule: { + adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) + }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/publicawesome/bundle.ts b/packages/types/protobuf/codegen/publicawesome/bundle.ts index a15715f07..cbb194de3 100644 --- a/packages/types/protobuf/codegen/publicawesome/bundle.ts +++ b/packages/types/protobuf/codegen/publicawesome/bundle.ts @@ -1,88 +1,88 @@ -import * as _287 from "./stargaze/alloc/v1beta1/genesis"; -import * as _288 from "./stargaze/alloc/v1beta1/params"; -import * as _289 from "./stargaze/alloc/v1beta1/query"; -import * as _290 from "./stargaze/alloc/v1beta1/tx"; -import * as _291 from "./stargaze/cron/v1/cron"; -import * as _292 from "./stargaze/cron/v1/genesis"; -import * as _293 from "./stargaze/cron/v1/proposal"; -import * as _294 from "./stargaze/cron/v1/query"; -import * as _295 from "./stargaze/cron/v1/tx"; -import * as _296 from "./stargaze/globalfee/v1/genesis"; -import * as _297 from "./stargaze/globalfee/v1/globalfee"; -import * as _298 from "./stargaze/globalfee/v1/proposal"; -import * as _299 from "./stargaze/globalfee/v1/query"; -import * as _300 from "./stargaze/globalfee/v1/tx"; -import * as _301 from "./stargaze/mint/v1beta1/genesis"; -import * as _302 from "./stargaze/mint/v1beta1/mint"; -import * as _303 from "./stargaze/mint/v1beta1/query"; -import * as _304 from "./stargaze/mint/v1beta1/tx"; -import * as _540 from "./stargaze/alloc/v1beta1/tx.amino"; -import * as _541 from "./stargaze/cron/v1/tx.amino"; -import * as _542 from "./stargaze/globalfee/v1/tx.amino"; -import * as _543 from "./stargaze/alloc/v1beta1/tx.registry"; -import * as _544 from "./stargaze/cron/v1/tx.registry"; -import * as _545 from "./stargaze/globalfee/v1/tx.registry"; -import * as _546 from "./stargaze/alloc/v1beta1/query.rpc.Query"; -import * as _547 from "./stargaze/cron/v1/query.rpc.Query"; -import * as _548 from "./stargaze/globalfee/v1/query.rpc.Query"; -import * as _549 from "./stargaze/mint/v1beta1/query.rpc.Query"; -import * as _550 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; -import * as _551 from "./stargaze/cron/v1/tx.rpc.msg"; -import * as _552 from "./stargaze/globalfee/v1/tx.rpc.msg"; -import * as _598 from "./rpc.query"; -import * as _599 from "./rpc.tx"; +import * as _290 from "./stargaze/alloc/v1beta1/genesis"; +import * as _291 from "./stargaze/alloc/v1beta1/params"; +import * as _292 from "./stargaze/alloc/v1beta1/query"; +import * as _293 from "./stargaze/alloc/v1beta1/tx"; +import * as _294 from "./stargaze/cron/v1/cron"; +import * as _295 from "./stargaze/cron/v1/genesis"; +import * as _296 from "./stargaze/cron/v1/proposal"; +import * as _297 from "./stargaze/cron/v1/query"; +import * as _298 from "./stargaze/cron/v1/tx"; +import * as _299 from "./stargaze/globalfee/v1/genesis"; +import * as _300 from "./stargaze/globalfee/v1/globalfee"; +import * as _301 from "./stargaze/globalfee/v1/proposal"; +import * as _302 from "./stargaze/globalfee/v1/query"; +import * as _303 from "./stargaze/globalfee/v1/tx"; +import * as _304 from "./stargaze/mint/v1beta1/genesis"; +import * as _305 from "./stargaze/mint/v1beta1/mint"; +import * as _306 from "./stargaze/mint/v1beta1/query"; +import * as _307 from "./stargaze/mint/v1beta1/tx"; +import * as _547 from "./stargaze/alloc/v1beta1/tx.amino"; +import * as _548 from "./stargaze/cron/v1/tx.amino"; +import * as _549 from "./stargaze/globalfee/v1/tx.amino"; +import * as _550 from "./stargaze/alloc/v1beta1/tx.registry"; +import * as _551 from "./stargaze/cron/v1/tx.registry"; +import * as _552 from "./stargaze/globalfee/v1/tx.registry"; +import * as _553 from "./stargaze/alloc/v1beta1/query.rpc.Query"; +import * as _554 from "./stargaze/cron/v1/query.rpc.Query"; +import * as _555 from "./stargaze/globalfee/v1/query.rpc.Query"; +import * as _556 from "./stargaze/mint/v1beta1/query.rpc.Query"; +import * as _557 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; +import * as _558 from "./stargaze/cron/v1/tx.rpc.msg"; +import * as _559 from "./stargaze/globalfee/v1/tx.rpc.msg"; +import * as _605 from "./rpc.query"; +import * as _606 from "./rpc.tx"; export namespace publicawesome { export namespace stargaze { export namespace alloc { export const v1beta1 = { - ..._287, - ..._288, - ..._289, ..._290, - ..._540, - ..._543, - ..._546, - ..._550 - }; - } - export namespace cron { - export const v1 = { ..._291, ..._292, ..._293, - ..._294, - ..._295, - ..._541, - ..._544, ..._547, - ..._551 + ..._550, + ..._553, + ..._557 }; } - export namespace globalfee { + export namespace cron { export const v1 = { + ..._294, + ..._295, ..._296, ..._297, ..._298, - ..._299, - ..._300, - ..._542, - ..._545, ..._548, - ..._552 + ..._551, + ..._554, + ..._558 }; } - export namespace mint { - export const v1beta1 = { + export namespace globalfee { + export const v1 = { + ..._299, + ..._300, ..._301, ..._302, ..._303, + ..._549, + ..._552, + ..._555, + ..._559 + }; + } + export namespace mint { + export const v1beta1 = { ..._304, - ..._549 + ..._305, + ..._306, + ..._307, + ..._556 }; } } export const ClientFactory = { - ..._598, - ..._599 + ..._605, + ..._606 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/publicawesome/rpc.query.ts b/packages/types/protobuf/codegen/publicawesome/rpc.query.ts index 64e76ccf8..0ac181dd6 100644 --- a/packages/types/protobuf/codegen/publicawesome/rpc.query.ts +++ b/packages/types/protobuf/codegen/publicawesome/rpc.query.ts @@ -9,6 +9,9 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { + adminmodule: { + adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) + }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/publicawesome/rpc.tx.ts b/packages/types/protobuf/codegen/publicawesome/rpc.tx.ts index 645ea22f4..311ce8076 100644 --- a/packages/types/protobuf/codegen/publicawesome/rpc.tx.ts +++ b/packages/types/protobuf/codegen/publicawesome/rpc.tx.ts @@ -5,6 +5,9 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { + adminmodule: { + adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) + }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/regen/bundle.ts b/packages/types/protobuf/codegen/regen/bundle.ts index 1109130d0..050e05424 100644 --- a/packages/types/protobuf/codegen/regen/bundle.ts +++ b/packages/types/protobuf/codegen/regen/bundle.ts @@ -1,134 +1,134 @@ -import * as _305 from "./data/v1/events"; -import * as _306 from "./data/v1/state"; -import * as _307 from "./data/v1/tx"; -import * as _308 from "./data/v1/types"; -import * as _309 from "./data/v2/events"; -import * as _310 from "./data/v2/state"; -import * as _311 from "./data/v2/tx"; -import * as _312 from "./data/v2/types"; -import * as _313 from "./ecocredit/basket/v1/events"; -import * as _314 from "./ecocredit/basket/v1/state"; -import * as _315 from "./ecocredit/basket/v1/tx"; -import * as _316 from "./ecocredit/basket/v1/types"; -import * as _317 from "./ecocredit/marketplace/v1/events"; -import * as _318 from "./ecocredit/marketplace/v1/state"; -import * as _319 from "./ecocredit/marketplace/v1/tx"; -import * as _320 from "./ecocredit/marketplace/v1/types"; -import * as _321 from "./ecocredit/orderbook/v1alpha1/memory"; -import * as _322 from "./ecocredit/v1/events"; -import * as _323 from "./ecocredit/v1/state"; -import * as _324 from "./ecocredit/v1/tx"; -import * as _325 from "./ecocredit/v1/types"; -import * as _326 from "./ecocredit/v1alpha1/events"; -import * as _327 from "./ecocredit/v1alpha1/genesis"; -import * as _328 from "./ecocredit/v1alpha1/tx"; -import * as _329 from "./ecocredit/v1alpha1/types"; -import * as _330 from "./intertx/v1/query"; -import * as _331 from "./intertx/v1/tx"; -import * as _553 from "./data/v1/tx.amino"; -import * as _554 from "./data/v2/tx.amino"; -import * as _555 from "./ecocredit/basket/v1/tx.amino"; -import * as _556 from "./ecocredit/marketplace/v1/tx.amino"; -import * as _557 from "./ecocredit/v1/tx.amino"; -import * as _558 from "./ecocredit/v1alpha1/tx.amino"; -import * as _559 from "./intertx/v1/tx.amino"; -import * as _560 from "./data/v1/tx.registry"; -import * as _561 from "./data/v2/tx.registry"; -import * as _562 from "./ecocredit/basket/v1/tx.registry"; -import * as _563 from "./ecocredit/marketplace/v1/tx.registry"; -import * as _564 from "./ecocredit/v1/tx.registry"; -import * as _565 from "./ecocredit/v1alpha1/tx.registry"; -import * as _566 from "./intertx/v1/tx.registry"; -import * as _567 from "./intertx/v1/query.rpc.Query"; -import * as _568 from "./data/v1/tx.rpc.msg"; -import * as _569 from "./data/v2/tx.rpc.msg"; -import * as _570 from "./ecocredit/basket/v1/tx.rpc.msg"; -import * as _571 from "./ecocredit/marketplace/v1/tx.rpc.msg"; -import * as _572 from "./ecocredit/v1/tx.rpc.msg"; -import * as _573 from "./ecocredit/v1alpha1/tx.rpc.msg"; -import * as _574 from "./intertx/v1/tx.rpc.msg"; -import * as _600 from "./rpc.query"; -import * as _601 from "./rpc.tx"; +import * as _308 from "./data/v1/events"; +import * as _309 from "./data/v1/state"; +import * as _310 from "./data/v1/tx"; +import * as _311 from "./data/v1/types"; +import * as _312 from "./data/v2/events"; +import * as _313 from "./data/v2/state"; +import * as _314 from "./data/v2/tx"; +import * as _315 from "./data/v2/types"; +import * as _316 from "./ecocredit/basket/v1/events"; +import * as _317 from "./ecocredit/basket/v1/state"; +import * as _318 from "./ecocredit/basket/v1/tx"; +import * as _319 from "./ecocredit/basket/v1/types"; +import * as _320 from "./ecocredit/marketplace/v1/events"; +import * as _321 from "./ecocredit/marketplace/v1/state"; +import * as _322 from "./ecocredit/marketplace/v1/tx"; +import * as _323 from "./ecocredit/marketplace/v1/types"; +import * as _324 from "./ecocredit/orderbook/v1alpha1/memory"; +import * as _325 from "./ecocredit/v1/events"; +import * as _326 from "./ecocredit/v1/state"; +import * as _327 from "./ecocredit/v1/tx"; +import * as _328 from "./ecocredit/v1/types"; +import * as _329 from "./ecocredit/v1alpha1/events"; +import * as _330 from "./ecocredit/v1alpha1/genesis"; +import * as _331 from "./ecocredit/v1alpha1/tx"; +import * as _332 from "./ecocredit/v1alpha1/types"; +import * as _333 from "./intertx/v1/query"; +import * as _334 from "./intertx/v1/tx"; +import * as _560 from "./data/v1/tx.amino"; +import * as _561 from "./data/v2/tx.amino"; +import * as _562 from "./ecocredit/basket/v1/tx.amino"; +import * as _563 from "./ecocredit/marketplace/v1/tx.amino"; +import * as _564 from "./ecocredit/v1/tx.amino"; +import * as _565 from "./ecocredit/v1alpha1/tx.amino"; +import * as _566 from "./intertx/v1/tx.amino"; +import * as _567 from "./data/v1/tx.registry"; +import * as _568 from "./data/v2/tx.registry"; +import * as _569 from "./ecocredit/basket/v1/tx.registry"; +import * as _570 from "./ecocredit/marketplace/v1/tx.registry"; +import * as _571 from "./ecocredit/v1/tx.registry"; +import * as _572 from "./ecocredit/v1alpha1/tx.registry"; +import * as _573 from "./intertx/v1/tx.registry"; +import * as _574 from "./intertx/v1/query.rpc.Query"; +import * as _575 from "./data/v1/tx.rpc.msg"; +import * as _576 from "./data/v2/tx.rpc.msg"; +import * as _577 from "./ecocredit/basket/v1/tx.rpc.msg"; +import * as _578 from "./ecocredit/marketplace/v1/tx.rpc.msg"; +import * as _579 from "./ecocredit/v1/tx.rpc.msg"; +import * as _580 from "./ecocredit/v1alpha1/tx.rpc.msg"; +import * as _581 from "./intertx/v1/tx.rpc.msg"; +import * as _607 from "./rpc.query"; +import * as _608 from "./rpc.tx"; export namespace regen { export namespace data { export const v1 = { - ..._305, - ..._306, - ..._307, ..._308, - ..._553, - ..._560, - ..._568 - }; - export const v2 = { ..._309, ..._310, ..._311, + ..._560, + ..._567, + ..._575 + }; + export const v2 = { ..._312, - ..._554, + ..._313, + ..._314, + ..._315, ..._561, - ..._569 + ..._568, + ..._576 }; } export namespace ecocredit { export namespace basket { export const v1 = { - ..._313, - ..._314, - ..._315, ..._316, - ..._555, + ..._317, + ..._318, + ..._319, ..._562, - ..._570 + ..._569, + ..._577 }; } export namespace marketplace { export const v1 = { - ..._317, - ..._318, - ..._319, ..._320, - ..._556, + ..._321, + ..._322, + ..._323, ..._563, - ..._571 + ..._570, + ..._578 }; } export namespace orderbook { export const v1alpha1 = { - ..._321 + ..._324 }; } export const v1 = { - ..._322, - ..._323, - ..._324, ..._325, - ..._557, - ..._564, - ..._572 - }; - export const v1alpha1 = { ..._326, ..._327, ..._328, + ..._564, + ..._571, + ..._579 + }; + export const v1alpha1 = { ..._329, - ..._558, + ..._330, + ..._331, + ..._332, ..._565, - ..._573 + ..._572, + ..._580 }; } export namespace intertx { export const v1 = { - ..._330, - ..._331, - ..._559, + ..._333, + ..._334, ..._566, - ..._567, - ..._574 + ..._573, + ..._574, + ..._581 }; } export const ClientFactory = { - ..._600, - ..._601 + ..._607, + ..._608 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/regen/rpc.query.ts b/packages/types/protobuf/codegen/regen/rpc.query.ts index ff22cb784..e16cf9d44 100644 --- a/packages/types/protobuf/codegen/regen/rpc.query.ts +++ b/packages/types/protobuf/codegen/regen/rpc.query.ts @@ -9,6 +9,9 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { + adminmodule: { + adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) + }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/regen/rpc.tx.ts b/packages/types/protobuf/codegen/regen/rpc.tx.ts index f5da8f197..22c5a0645 100644 --- a/packages/types/protobuf/codegen/regen/rpc.tx.ts +++ b/packages/types/protobuf/codegen/regen/rpc.tx.ts @@ -5,6 +5,9 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { + adminmodule: { + adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) + }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/tendermint/bundle.ts b/packages/types/protobuf/codegen/tendermint/bundle.ts index f9b92e102..999f8a331 100644 --- a/packages/types/protobuf/codegen/tendermint/bundle.ts +++ b/packages/types/protobuf/codegen/tendermint/bundle.ts @@ -1,32 +1,32 @@ -import * as _335 from "./abci/types"; -import * as _336 from "./crypto/keys"; -import * as _337 from "./crypto/proof"; -import * as _338 from "./p2p/types"; -import * as _339 from "./types/block"; -import * as _340 from "./types/evidence"; -import * as _341 from "./types/params"; -import * as _342 from "./types/types"; -import * as _343 from "./types/validator"; -import * as _344 from "./version/types"; +import * as _338 from "./abci/types"; +import * as _339 from "./crypto/keys"; +import * as _340 from "./crypto/proof"; +import * as _341 from "./p2p/types"; +import * as _342 from "./types/block"; +import * as _343 from "./types/evidence"; +import * as _344 from "./types/params"; +import * as _345 from "./types/types"; +import * as _346 from "./types/validator"; +import * as _347 from "./version/types"; export namespace tendermint { export const abci = { - ..._335 + ..._338 }; export const crypto = { - ..._336, - ..._337 + ..._339, + ..._340 }; export const p2p = { - ..._338 + ..._341 }; export const types = { - ..._339, - ..._340, - ..._341, ..._342, - ..._343 + ..._343, + ..._344, + ..._345, + ..._346 }; export const version = { - ..._344 + ..._347 }; } \ No newline at end of file diff --git a/packages/types/protobuf/patches.diff b/packages/types/protobuf/patches.diff index ad95c7614..d89998195 100644 --- a/packages/types/protobuf/patches.diff +++ b/packages/types/protobuf/patches.diff @@ -56,7 +56,7 @@ index 9eb780900..70b01f2fc 100644 }, fromAminoMsg(object: MetadataAminoMsg): Metadata { diff --git b/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts a/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts -index 6c5cc594d..774bdbe5c 100644 +index d46b64a0f..fd09961b2 100644 --- b/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts +++ a/packages/types/protobuf/codegen/cosmos/gov/v1/tx.ts @@ -1,7 +1,8 @@ @@ -70,7 +70,7 @@ index 6c5cc594d..774bdbe5c 100644 import { Timestamp } from "../../../google/protobuf/timestamp"; import { MsgCreateAllianceProposal, MsgCreateAllianceProposalProtoMsg, MsgCreateAllianceProposalSDKType, MsgUpdateAllianceProposal, MsgUpdateAllianceProposalProtoMsg, MsgUpdateAllianceProposalSDKType, MsgDeleteAllianceProposal, MsgDeleteAllianceProposalProtoMsg, MsgDeleteAllianceProposalSDKType } from "../../../alliance/alliance/gov"; import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalSDKType, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg, CommunityPoolSpendProposalWithDepositSDKType } from "../../distribution/v1beta1/distribution"; -@@ -577,7 +578,7 @@ export const MsgSubmitProposal = { +@@ -578,7 +579,7 @@ export const MsgSubmitProposal = { }, fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { const message = createBaseMsgSubmitProposal(); @@ -79,7 +79,7 @@ index 6c5cc594d..774bdbe5c 100644 message.initialDeposit = object.initial_deposit?.map(e => Coin.fromAmino(e)) || []; if (object.proposer !== undefined && object.proposer !== null) { message.proposer = object.proposer; -@@ -598,10 +599,8 @@ export const MsgSubmitProposal = { +@@ -599,10 +600,8 @@ export const MsgSubmitProposal = { }, toAmino(message: MsgSubmitProposal, useInterfaces: boolean = false): MsgSubmitProposalAmino { const obj: any = {}; @@ -92,7 +92,7 @@ index 6c5cc594d..774bdbe5c 100644 } if (message.initialDeposit) { obj.initial_deposit = message.initialDeposit.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); -@@ -612,7 +611,9 @@ export const MsgSubmitProposal = { +@@ -613,7 +612,9 @@ export const MsgSubmitProposal = { obj.metadata = message.metadata; obj.title = message.title; obj.summary = message.summary; @@ -103,7 +103,7 @@ index 6c5cc594d..774bdbe5c 100644 return obj; }, fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { -@@ -911,7 +912,7 @@ export const MsgVote = { +@@ -912,7 +913,7 @@ export const MsgVote = { message.voter = object.voter; } if (object.option !== undefined && object.option !== null) { @@ -113,7 +113,7 @@ index 6c5cc594d..774bdbe5c 100644 if (object.metadata !== undefined && object.metadata !== null) { message.metadata = object.metadata; diff --git b/packages/types/protobuf/codegen/cosmos/gov/v1beta1/tx.ts a/packages/types/protobuf/codegen/cosmos/gov/v1beta1/tx.ts -index 0a7aa8cc5..2451cbfd8 100644 +index 3a2a34091..cced669c2 100644 --- b/packages/types/protobuf/codegen/cosmos/gov/v1beta1/tx.ts +++ a/packages/types/protobuf/codegen/cosmos/gov/v1beta1/tx.ts @@ -1,7 +1,7 @@ @@ -125,7 +125,7 @@ index 0a7aa8cc5..2451cbfd8 100644 import { MsgCreateAllianceProposal, MsgCreateAllianceProposalProtoMsg, MsgCreateAllianceProposalSDKType, MsgUpdateAllianceProposal, MsgUpdateAllianceProposalProtoMsg, MsgUpdateAllianceProposalSDKType, MsgDeleteAllianceProposal, MsgDeleteAllianceProposalProtoMsg, MsgDeleteAllianceProposalSDKType } from "../../../alliance/alliance/gov"; import { CommunityPoolSpendProposal, CommunityPoolSpendProposalProtoMsg, CommunityPoolSpendProposalSDKType, CommunityPoolSpendProposalWithDeposit, CommunityPoolSpendProposalWithDepositProtoMsg, CommunityPoolSpendProposalWithDepositSDKType } from "../../distribution/v1beta1/distribution"; import { ParameterChangeProposal, ParameterChangeProposalProtoMsg, ParameterChangeProposalSDKType } from "../../params/v1beta1/params"; -@@ -471,7 +471,7 @@ export const MsgVote = { +@@ -472,7 +472,7 @@ export const MsgVote = { message.voter = object.voter; } if (object.option !== undefined && object.option !== null) { diff --git a/packages/types/protobuf/proto/cosmos/adminmodule/adminmodule/genesis.proto b/packages/types/protobuf/proto/cosmos/adminmodule/adminmodule/genesis.proto new file mode 100644 index 000000000..c21373e5c --- /dev/null +++ b/packages/types/protobuf/proto/cosmos/adminmodule/adminmodule/genesis.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package cosmos.adminmodule.adminmodule; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/admin-module/x/adminmodule/types"; + +// GenesisState defines the adminmodule module's genesis state. +message GenesisState { + repeated string admins = 1 [(gogoproto.nullable) = false]; +} diff --git a/packages/types/protobuf/proto/cosmos/adminmodule/adminmodule/query.proto b/packages/types/protobuf/proto/cosmos/adminmodule/adminmodule/query.proto new file mode 100644 index 000000000..be2a55ac7 --- /dev/null +++ b/packages/types/protobuf/proto/cosmos/adminmodule/adminmodule/query.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; +package cosmos.adminmodule.adminmodule; + +import "google/api/annotations.proto"; +import "cosmos/gov/v1beta1/gov.proto"; +import "cosmos/gov/v1/gov.proto"; + +option go_package = "github.com/cosmos/admin-module/x/adminmodule/types"; + +// Query defines the gRPC querier service. +service Query { + + // Queries a list of admins items. + rpc Admins(QueryAdminsRequest) returns (QueryAdminsResponse) { + option (google.api.http).get = "/cosmos/adminmodule/adminmodule/admins"; + } + + // Queries a list of archived proposals. + rpc ArchivedProposals(QueryArchivedProposalsRequest) returns (QueryArchivedProposalsResponse) { + option (google.api.http).get = "/cosmos/adminmodule/adminmodule/archivedproposals"; + } + + // Queries a list of archived proposals. + rpc ArchivedProposalsLegacy(QueryArchivedProposalsLegacyRequest) returns (QueryArchivedProposalsLegacyResponse) { + option (google.api.http).get = "/cosmos/adminmodule/adminmodule/archivedproposalslegacy"; + } + +} + +message QueryAdminsRequest { +} + +message QueryAdminsResponse { + repeated string admins = 1; +} + +message QueryArchivedProposalsRequest { +} + +message QueryArchivedProposalsLegacyRequest { +} + +message QueryProposalsResponse { + repeated cosmos.gov.v1.Proposal proposals = 1; +} + +message QueryArchivedProposalsResponse { + repeated cosmos.gov.v1.Proposal proposals = 1; +} + +message QueryArchivedProposalsLegacyResponse { + repeated cosmos.gov.v1beta1.Proposal proposalsLegacy = 1; +} diff --git a/packages/types/protobuf/proto/cosmos/adminmodule/adminmodule/tx.proto b/packages/types/protobuf/proto/cosmos/adminmodule/adminmodule/tx.proto new file mode 100644 index 000000000..a953c4106 --- /dev/null +++ b/packages/types/protobuf/proto/cosmos/adminmodule/adminmodule/tx.proto @@ -0,0 +1,68 @@ +syntax = "proto3"; +package cosmos.adminmodule.adminmodule; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; + + +option go_package = "github.com/cosmos/admin-module/x/adminmodule/types"; + +// Msg defines the Msg service. +service Msg { + rpc DeleteAdmin(MsgDeleteAdmin) returns (MsgDeleteAdminResponse); + rpc AddAdmin(MsgAddAdmin) returns (MsgAddAdminResponse); + rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); + rpc SubmitProposalLegacy(MsgSubmitProposalLegacy) returns (MsgSubmitProposalLegacyResponse); +} + +message MsgDeleteAdmin { + string creator = 1; + string admin = 2; +} + +message MsgDeleteAdminResponse { +} + +message MsgAddAdmin { + string creator = 1; + string admin = 2; +} + +message MsgAddAdminResponse { +} + +// MsgSubmitProposalLegacy defines an sdk.Msg type that supports submitting arbitrary +// proposal Content. +message MsgSubmitProposalLegacy { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"]; + string proposer = 2; +} + +// MsgSubmitProposalLegacyResponse defines the Msg/SubmitProposalLegacy response type. +message MsgSubmitProposalLegacyResponse { + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; +} + +// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary +// proposal Content. +message MsgSubmitProposal { + option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + // messages are the arbitrary messages to be executed if proposal passes. + repeated google.protobuf.Any messages = 1; + string proposer = 2; +} + +// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +message MsgSubmitProposalResponse { + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; +} diff --git a/packages/types/protobuf/scripts/codegen.js b/packages/types/protobuf/scripts/codegen.js index a6c49b96d..c9ecc80d8 100644 --- a/packages/types/protobuf/scripts/codegen.js +++ b/packages/types/protobuf/scripts/codegen.js @@ -115,6 +115,7 @@ telescope({ 'pstake.liquidstakeibc.v1beta1', 'pstake.lscosmos.v1beta1', 'pstake.ratesync.v1beta1', + 'cosmos.adminmodule.adminmodule', ], }, // excluded: { From e66c5446062f22e57d801b55e99ee9866ec71b90 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 6 May 2024 16:34:46 -0400 Subject: [PATCH 147/438] added custom app warning card --- packages/i18n/locales/en/translation.json | 1 + packages/stateless/components/dao/tabs/AppsTab.tsx | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index d7fc69099..3b57bbc2a 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -948,6 +948,7 @@ "customActionDescription_dao": "Perform any custom action a wallet can.", "customActionDescription_gov": "Perform any custom action.", "customActionDescription_wallet": "Perform any custom action.", + "customAppWarning": "Apps must explicitly support DAO DAO app integration. Unless you are sure that an app is supported, it likely will not work. Custom app entry is primarily to help developers test new app integrations. Contact the app's developers if you want them to add DAO DAO support.", "daoAdminExecDescription": "Execute actions on behalf of a DAO with you as the admin. A parent DAO could use this to execute actions on behalf of a SubDAO.", "daoApproverExplanation": "An approver must approve proposals before they open for voting.", "daoCreationProcessExplanation": "Creating your DAO has never been this easy:", diff --git a/packages/stateless/components/dao/tabs/AppsTab.tsx b/packages/stateless/components/dao/tabs/AppsTab.tsx index f4420857d..64d7049d2 100644 --- a/packages/stateless/components/dao/tabs/AppsTab.tsx +++ b/packages/stateless/components/dao/tabs/AppsTab.tsx @@ -17,6 +17,7 @@ import { Button } from '../../buttons' import { IconButton } from '../../icon_buttons' import { TextInput } from '../../inputs' import { Tooltip } from '../../tooltip' +import { WarningCard } from '../../WarningCard' export type AppsTabProps = { iframeRef: RefCallback @@ -114,6 +115,8 @@ const InnerAppsTab = ({ ({ url: appUrl }) => appUrl === url || !appUrl ) + const customSelected = selectedAppIndex === DAO_APPS.length - 1 + return (
go(appUrl)} @@ -165,6 +168,13 @@ const InnerAppsTab = ({ })}
+ {customSelected && ( + + )} +
Date: Wed, 8 May 2024 22:22:13 -0400 Subject: [PATCH 148/438] detect cross-chain messages in DAO admin exec actions --- packages/utils/messages/cw.ts | 83 +++++++++++++++++++++++------------ 1 file changed, 54 insertions(+), 29 deletions(-) diff --git a/packages/utils/messages/cw.ts b/packages/utils/messages/cw.ts index b2a6d3da0..d51efc5de 100644 --- a/packages/utils/messages/cw.ts +++ b/packages/utils/messages/cw.ts @@ -526,40 +526,65 @@ export const decodeCrossChainMessages = ( srcAddress: string, msgs: CosmosMsgFor_Empty[] ): DecodedCrossChainMessage[] => - decodeMessages(msgs).flatMap((msg): DecodedCrossChainMessage | [] => { - const decodedPolytone = decodePolytoneExecuteMsg(srcChainId, msg, 'any') - if (decodedPolytone.match) { - return { - type: 'polytone', - data: decodedPolytone, - srcConnection: decodedPolytone.polytoneConnection.localConnection, - srcChannel: decodedPolytone.polytoneConnection.localChannel, - srcPort: `wasm.${decodedPolytone.polytoneConnection.note}`, - dstConnection: decodedPolytone.polytoneConnection.remoteConnection, - dstChannel: decodedPolytone.polytoneConnection.remoteChannel, - dstPort: `wasm.${decodedPolytone.polytoneConnection.voice}`, + decodeMessages(msgs).flatMap( + (msg): DecodedCrossChainMessage | DecodedCrossChainMessage[] => { + const decodedPolytone = decodePolytoneExecuteMsg(srcChainId, msg, 'any') + if (decodedPolytone.match) { + return { + type: 'polytone', + data: decodedPolytone, + srcConnection: decodedPolytone.polytoneConnection.localConnection, + srcChannel: decodedPolytone.polytoneConnection.localChannel, + srcPort: `wasm.${decodedPolytone.polytoneConnection.note}`, + dstConnection: decodedPolytone.polytoneConnection.remoteConnection, + dstChannel: decodedPolytone.polytoneConnection.remoteChannel, + dstPort: `wasm.${decodedPolytone.polytoneConnection.voice}`, + } } - } - const decodedIca = decodeIcaExecuteMsg(srcChainId, msg, 'any') - if (decodedIca.match) { - const ibcInfo = getIbcTransferInfoBetweenChains( - srcChainId, - decodedIca.chainId - ) + const decodedIca = decodeIcaExecuteMsg(srcChainId, msg, 'any') + if (decodedIca.match) { + const ibcInfo = getIbcTransferInfoBetweenChains( + srcChainId, + decodedIca.chainId + ) + + return { + type: 'ica', + data: decodedIca, + srcConnection: ibcInfo.sourceChain.connection_id, + srcPort: `icacontroller-${srcAddress}`, + dstConnection: ibcInfo.destinationChain.connection_id, + dstPort: 'icahost', + } + } - return { - type: 'ica', - data: decodedIca, - srcConnection: ibcInfo.sourceChain.connection_id, - srcPort: `icacontroller-${srcAddress}`, - dstConnection: ibcInfo.destinationChain.connection_id, - dstPort: 'icahost', + // If DAO admin exec, recurse. + if ( + objectMatchesStructure(msg, { + wasm: { + execute: { + contract_addr: {}, + funds: {}, + msg: { + execute_admin_msgs: { + msgs: {}, + }, + }, + }, + }, + }) + ) { + return decodeCrossChainMessages( + srcChainId, + srcAddress, + msg.wasm.execute.msg.execute_admin_msgs.msgs + ) } - } - return [] - }) + return [] + } + ) /** * Wrap the message in a cw1-whitelist execution message. From 86791dc760ec858af41b4f9b08e4295e3d6d0a4e Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 8 May 2024 22:34:29 -0400 Subject: [PATCH 149/438] fixed src address for DAO admin exec cross-chain msgs --- packages/utils/messages/cw.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/utils/messages/cw.ts b/packages/utils/messages/cw.ts index d51efc5de..b8b30adc7 100644 --- a/packages/utils/messages/cw.ts +++ b/packages/utils/messages/cw.ts @@ -577,7 +577,7 @@ export const decodeCrossChainMessages = ( ) { return decodeCrossChainMessages( srcChainId, - srcAddress, + msg.wasm.execute.contract_addr, msg.wasm.execute.msg.execute_admin_msgs.msgs ) } From d9342540fbb093d55bcfa96a6db8c26128378744 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 8 May 2024 22:37:04 -0400 Subject: [PATCH 150/438] fixed src address for DAO admin exec cross-chain msgs again --- packages/stateful/hooks/useProposalRelayState.ts | 2 +- packages/types/proposal.ts | 2 ++ packages/utils/messages/cw.ts | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/stateful/hooks/useProposalRelayState.ts b/packages/stateful/hooks/useProposalRelayState.ts index ec495e209..bc68fdfca 100644 --- a/packages/stateful/hooks/useProposalRelayState.ts +++ b/packages/stateful/hooks/useProposalRelayState.ts @@ -182,7 +182,7 @@ export const useProposalRelayState = ({ contractAddress: decoded.data.polytoneConnection.listener, params: [ { - initiator: coreAddress, + initiator: decoded.sender, initiatorMsg: decoded.data.initiatorMsg, }, ], diff --git a/packages/types/proposal.ts b/packages/types/proposal.ts index af49d1d2e..14c1ea202 100644 --- a/packages/types/proposal.ts +++ b/packages/types/proposal.ts @@ -104,6 +104,7 @@ export type DecodedCrossChainMessage = | { type: 'polytone' data: DecodedPolytoneMsgMatch + sender: string srcConnection: string srcChannel: string srcPort: string @@ -114,6 +115,7 @@ export type DecodedCrossChainMessage = | { type: 'ica' data: DecodedIcaMsgMatch + sender: string srcConnection: string // Cannot determine srcChannel from decoded message. srcPort: string diff --git a/packages/utils/messages/cw.ts b/packages/utils/messages/cw.ts index b8b30adc7..03054658a 100644 --- a/packages/utils/messages/cw.ts +++ b/packages/utils/messages/cw.ts @@ -533,6 +533,7 @@ export const decodeCrossChainMessages = ( return { type: 'polytone', data: decodedPolytone, + sender: srcAddress, srcConnection: decodedPolytone.polytoneConnection.localConnection, srcChannel: decodedPolytone.polytoneConnection.localChannel, srcPort: `wasm.${decodedPolytone.polytoneConnection.note}`, @@ -552,6 +553,7 @@ export const decodeCrossChainMessages = ( return { type: 'ica', data: decodedIca, + sender: srcAddress, srcConnection: ibcInfo.sourceChain.connection_id, srcPort: `icacontroller-${srcAddress}`, dstConnection: ibcInfo.destinationChain.connection_id, From 26766f29d70d3cdf93e6b2acabf4f8cc8da52423 Mon Sep 17 00:00:00 2001 From: noah Date: Thu, 9 May 2024 06:38:40 -0700 Subject: [PATCH 151/438] Support Terra Classic (#1773) --- packages/state/recoil/selectors/contract.ts | 7 +- packages/state/utils/contract.ts | 7 +- .../components/SelfRelayExecuteModal.tsx | 1 + .../components/dao/DaoPageWrapper.tsx | 7 +- .../stateful/server/makeGetDaoStaticProps.ts | 437 ++++++++++-------- packages/utils/chain.ts | 5 +- packages/utils/constants/chains.ts | 49 +- 7 files changed, 290 insertions(+), 223 deletions(-) diff --git a/packages/state/recoil/selectors/contract.ts b/packages/state/recoil/selectors/contract.ts index 9db080065..ad76c8635 100644 --- a/packages/state/recoil/selectors/contract.ts +++ b/packages/state/recoil/selectors/contract.ts @@ -144,10 +144,9 @@ export const contractInfoSelector = selectorFamily< // If indexer fails, fallback to querying chain. const client = get(cosmWasmClientForChainSelector(chainId)) - const contractInfo = await client.queryContractRaw( - contractAddress, - toUtf8('contract_info') - ) + const { data: contractInfo } = await client[ + 'forceGetQueryClient' + ]().wasm.queryContractRaw(contractAddress, toUtf8('contract_info')) if (contractInfo) { const info: InfoResponse = { info: JSON.parse(fromUtf8(contractInfo)), diff --git a/packages/state/utils/contract.ts b/packages/state/utils/contract.ts index 9ce9bc4b1..4d9304649 100644 --- a/packages/state/utils/contract.ts +++ b/packages/state/utils/contract.ts @@ -48,10 +48,9 @@ export const fetchContractInfo = async ( const client = await cosmWasmClientRouter.connect( getRpcForChainId(chainId) ) - const contractInfo = await client.queryContractRaw( - contractAddress, - toUtf8('contract_info') - ) + const { data: contractInfo } = await client[ + 'forceGetQueryClient' + ]().wasm.queryContractRaw(contractAddress, toUtf8('contract_info')) if (contractInfo) { info = JSON.parse(fromUtf8(contractInfo)) } diff --git a/packages/stateful/components/SelfRelayExecuteModal.tsx b/packages/stateful/components/SelfRelayExecuteModal.tsx index b7ee72de5..99b0cdda3 100644 --- a/packages/stateful/components/SelfRelayExecuteModal.tsx +++ b/packages/stateful/components/SelfRelayExecuteModal.tsx @@ -94,6 +94,7 @@ const RELAYER_FUNDS_NEEDED: Partial> = { [ChainId.ChihuahuaMainnet]: 1000 * 10 ** 6, [ChainId.ArchwayMainnet]: 1 * 10 ** 18, [ChainId.InjectiveMainnet]: 0.03 * 10 ** 18, + [ChainId.TerraClassicMainnet]: 1000 * 10 ** 6, } type Relayer = { diff --git a/packages/stateful/components/dao/DaoPageWrapper.tsx b/packages/stateful/components/dao/DaoPageWrapper.tsx index 5ac78086d..e08ff1f95 100644 --- a/packages/stateful/components/dao/DaoPageWrapper.tsx +++ b/packages/stateful/components/dao/DaoPageWrapper.tsx @@ -59,11 +59,12 @@ export const DaoPageWrapper = ({ const [walletChainId, setWalletChainId] = useRecoilState(walletChainIdAtom) // Update walletChainId to whatever the current DAO is so the right address // appears in the sidebar. + const currentChainId = serializedInfo?.chainId useEffect(() => { - if (serializedInfo && serializedInfo.chainId !== walletChainId) { - setWalletChainId(serializedInfo.chainId) + if (currentChainId && currentChainId !== walletChainId) { + setWalletChainId(currentChainId) } - }, [serializedInfo, setWalletChainId, walletChainId]) + }, [currentChainId, setWalletChainId, walletChainId]) // Set theme's accentColor. useEffect(() => { diff --git a/packages/stateful/server/makeGetDaoStaticProps.ts b/packages/stateful/server/makeGetDaoStaticProps.ts index 9842ddf3d..901e2e9fa 100644 --- a/packages/stateful/server/makeGetDaoStaticProps.ts +++ b/packages/stateful/server/makeGetDaoStaticProps.ts @@ -1,5 +1,5 @@ import { Chain } from '@chain-registry/types' -import type { GetStaticProps, Redirect } from 'next' +import type { GetStaticProps, GetStaticPropsResult, Redirect } from 'next' import { TFunction } from 'next-i18next' import removeMarkdown from 'remove-markdown' @@ -14,6 +14,7 @@ import { Account, AccountType, ActiveThreshold, + ChainId, CommonProposalInfo, ContractVersion, ContractVersionInfo, @@ -42,6 +43,7 @@ import { INVALID_CONTRACT_ERROR_SUBSTRINGS, LEGACY_DAO_CONTRACT_NAMES, LEGACY_URL_PREFIX, + MAINNET, MAX_META_CHARS_PROPOSAL_DESCRIPTION, addressIsModule, cosmWasmClientRouter, @@ -128,14 +130,14 @@ export const makeGetDaoStaticProps: GetDaoStaticPropsMaker = const coreAddress = _coreAddress ?? context.params?.address // Get chain ID for address based on prefix. - let chainId: string + let decodedChainId: string try { // If invalid address, display not found. if (!coreAddress || typeof coreAddress !== 'string') { throw new Error('Invalid address') } - chainId = getChainIdForAddress(coreAddress) + decodedChainId = getChainIdForAddress(coreAddress) // Validation throws error if address prefix not recognized. Display not // found in this case. @@ -152,236 +154,267 @@ export const makeGetDaoStaticProps: GetDaoStaticPropsMaker = } } - // If address is polytone proxy, redirect to DAO on native chain. - try { - const addressInfo = await queryIndexer({ - type: 'contract', - chainId, - address: coreAddress, - formula: 'info', - }) - if (addressInfo && addressInfo.contract === ContractName.PolytoneProxy) { - // Get voice for this proxy on destination chain. - const voice = await queryIndexer({ + const getForChainId = async ( + chainId: string + ): Promise> => { + // If address is polytone proxy, redirect to DAO on native chain. + try { + const addressInfo = await queryIndexer({ type: 'contract', chainId, - // proxy address: coreAddress, - formula: 'polytone/proxy/instantiator', + formula: 'info', }) - - const dao = await queryIndexer({ - type: 'contract', - chainId, - address: voice, - formula: 'polytone/voice/remoteController', - args: { + if ( + addressInfo && + addressInfo.contract === ContractName.PolytoneProxy + ) { + // Get voice for this proxy on destination chain. + const voice = await queryIndexer({ + type: 'contract', + chainId, // proxy address: coreAddress, - }, - }) + formula: 'polytone/proxy/instantiator', + }) - return { - redirect: { - destination: getDaoPath(appMode, dao), - permanent: true, - }, + const dao = await queryIndexer({ + type: 'contract', + chainId, + address: voice, + formula: 'polytone/voice/remoteController', + args: { + // proxy + address: coreAddress, + }, + }) + + return { + redirect: { + destination: getDaoPath(appMode, dao), + permanent: true, + }, + } } + } catch { + // If failed, ignore. } - } catch { - // If failed, ignore. - } - // Add to Sentry error tags if error occurs. - let coreVersion: ContractVersion | undefined - try { - const { - admin, - config, - version, - votingModule: { address: votingModuleAddress, info: votingModuleInfo }, - activeProposalModules, - created, - isActive, - activeThreshold, - parentDao, - items: _items, - polytoneProxies, - } = await daoCoreDumpState(chainId, coreAddress, serverT) - coreVersion = version - - // If no contract name, will display fallback voting module adapter. - const votingModuleContractName = - (votingModuleInfo && - 'contract' in votingModuleInfo && - votingModuleInfo.contract) || - 'fallback' - - // Get DAO proposal modules. - const proposalModules = await fetchProposalModules( - chainId, - coreAddress, - coreVersion, - activeProposalModules - ) - - // Convert items list into map. - const items = _items.reduce( - (acc, [key, value]) => ({ - ...acc, - [key]: value, - }), - {} as Record - ) - - const accounts: Account[] = [ - // Current chain. - { - chainId, - address: coreAddress, - type: AccountType.Native, - }, - // Polytone. - ...Object.entries(polytoneProxies).map( - ([chainId, address]): Account => ({ - chainId, - address, - type: AccountType.Polytone, - }) - ), - // The above accounts are the ones we already have. The rest of the - // accounts are loaded once the page loads (in `DaoPageWrapper`) since - // they are more complex and will probably expand over time. - ] - - // Must be called after server side translations has been awaited, because - // props may use the `t` function, and it won't be available until after. - const { - leadingTitle, - followingTitle, - overrideTitle, - overrideDescription, - overrideImageUrl, - additionalProps, - url, - } = - (await getProps?.({ - context, - t: serverT, + // Add to Sentry error tags if error occurs. + let coreVersion: ContractVersion | undefined + try { + const { + admin, config, - chain: getChainForChainId(chainId), - coreAddress, - coreVersion, - proposalModules, - })) ?? {} - - const props: DaoPageWrapperProps = { - ...i18nProps, - url: url ?? null, - title: - overrideTitle ?? - [leadingTitle?.trim(), config.name.trim(), followingTitle?.trim()] - .filter(Boolean) - .join(' | '), - description: overrideDescription ?? config.description, - accentColor: items[DAO_CORE_ACCENT_ITEM_KEY] || null, - serializedInfo: { - chainId, - coreAddress, - coreVersion, - supportedFeatures: getSupportedFeatures(coreVersion), - votingModuleAddress, - votingModuleContractName, - proposalModules, - name: config.name, - description: config.description, - imageUrl: overrideImageUrl ?? config.image_url ?? null, - created: created?.toJSON() ?? null, + version, + votingModule: { + address: votingModuleAddress, + info: votingModuleInfo, + }, + activeProposalModules, + created, isActive, activeThreshold, - items, - polytoneProxies, - accounts, parentDao, - admin: admin ?? null, - }, - ...additionalProps, - } + items: _items, + polytoneProxies, + } = await daoCoreDumpState(chainId, coreAddress, serverT) + coreVersion = version + + // If no contract name, will display fallback voting module adapter. + const votingModuleContractName = + (votingModuleInfo && + 'contract' in votingModuleInfo && + votingModuleInfo.contract) || + 'fallback' + + // Get DAO proposal modules. + const proposalModules = await fetchProposalModules( + chainId, + coreAddress, + coreVersion, + activeProposalModules + ) - return { - props, - // Regenerate the page at most once per `revalidate` seconds. Serves - // cached copy and refreshes in background. - revalidate: DAO_STATIC_PROPS_CACHE_SECONDS, - } - } catch (error) { - // Redirect. - if (error instanceof RedirectError) { - return { - redirect: error.redirect, + // Convert items list into map. + const items = _items.reduce( + (acc, [key, value]) => ({ + ...acc, + [key]: value, + }), + {} as Record + ) + + const accounts: Account[] = [ + // Current chain. + { + chainId, + address: coreAddress, + type: AccountType.Native, + }, + // Polytone. + ...Object.entries(polytoneProxies).map( + ([chainId, address]): Account => ({ + chainId, + address, + type: AccountType.Polytone, + }) + ), + // The above accounts are the ones we already have. The rest of the + // accounts are loaded once the page loads (in `DaoPageWrapper`) since + // they are more complex and will probably expand over time. + ] + + // Must be called after server side translations has been awaited, + // because props may use the `t` function, and it won't be available + // until after. + const { + leadingTitle, + followingTitle, + overrideTitle, + overrideDescription, + overrideImageUrl, + additionalProps, + url, + } = + (await getProps?.({ + context, + t: serverT, + config, + chain: getChainForChainId(chainId), + coreAddress, + coreVersion, + proposalModules, + })) ?? {} + + const props: DaoPageWrapperProps = { + ...i18nProps, + url: url ?? null, + title: + overrideTitle ?? + [leadingTitle?.trim(), config.name.trim(), followingTitle?.trim()] + .filter(Boolean) + .join(' | '), + description: overrideDescription ?? config.description, + accentColor: items[DAO_CORE_ACCENT_ITEM_KEY] || null, + serializedInfo: { + chainId, + coreAddress, + coreVersion, + supportedFeatures: getSupportedFeatures(coreVersion), + votingModuleAddress, + votingModuleContractName, + proposalModules, + name: config.name, + description: config.description, + imageUrl: overrideImageUrl ?? config.image_url ?? null, + created: created?.toJSON() ?? null, + isActive, + activeThreshold, + items, + polytoneProxies, + accounts, + parentDao, + admin: admin ?? null, + }, + ...additionalProps, } - } - // Redirect legacy DAOs (legacy multisigs redirected in next.config.js - // redirects list). - if ( - error instanceof LegacyDaoError || - (error instanceof Error && - error.message.includes( - 'Query failed with (18): Error parsing into type cw3_dao::msg::QueryMsg: unknown variant `dump_state`' - )) - ) { return { - redirect: { - destination: - LEGACY_URL_PREFIX + getDaoPath(DaoPageMode.Dapp, coreAddress), - permanent: false, - }, + props, + // Regenerate the page at most once per `revalidate` seconds. Serves + // cached copy and refreshes in background. + revalidate: DAO_STATIC_PROPS_CACHE_SECONDS, + } + } catch (error) { + // Redirect. + if (error instanceof RedirectError) { + return { + redirect: error.redirect, + } } - } - console.error(error) + // Redirect legacy DAOs (legacy multisigs redirected in next.config.js + // redirects list). + if ( + error instanceof LegacyDaoError || + (error instanceof Error && + error.message.includes( + 'Query failed with (18): Error parsing into type cw3_dao::msg::QueryMsg: unknown variant `dump_state`' + )) + ) { + return { + redirect: { + destination: + LEGACY_URL_PREFIX + getDaoPath(DaoPageMode.Dapp, coreAddress), + permanent: false, + }, + } + } - if ( - error instanceof Error && - (error.message.includes('contract: not found') || - error.message.includes('Error parsing into type') || - error.message.includes('decoding bech32 failed') || - error.message.includes('dumpState reason: Unexpected token')) - ) { - // Excluding `info` will render DAONotFound. + console.error(error) + + if ( + error instanceof Error && + (error.message.includes('contract: not found') || + error.message.includes('no such contract') || + error.message.includes('Error parsing into type') || + error.message.includes('decoding bech32 failed') || + error.message.includes('dumpState reason: Unexpected token')) + ) { + // Excluding `info` will render DAONotFound. + return { + props: { + ...i18nProps, + title: 'DAO not found', + description: '', + }, + // Regenerate the page at most once per second. Serves cached copy + // and refreshes in background. + revalidate: 1, + } + } + + // Return error in props to trigger client-side 500 error. return { props: { ...i18nProps, - title: 'DAO not found', + title: serverT('title.500'), description: '', + // Report to Sentry. + error: processError(error, { + tags: { + coreAddress, + coreVersion: coreVersion ?? '', + }, + extra: { context }, + }), }, // Regenerate the page at most once per second. Serves cached copy and // refreshes in background. revalidate: 1, } } + } - // Return error in props to trigger client-side 500 error. - return { - props: { - ...i18nProps, - title: serverT('title.500'), - description: '', - // Report to Sentry. - error: processError(error, { - tags: { - coreAddress, - coreVersion: coreVersion ?? '', - }, - extra: { context }, - }), - }, - // Regenerate the page at most once per second. Serves cached copy and - // refreshes in background. - revalidate: 1, - } + const result = await getForChainId(decodedChainId) + + // If not found on Terra, try Terra Classic. Let redirects and errors + // through. + if ( + MAINNET && + 'props' in result && + // If no serialized info, no DAO found. + !result.props.serializedInfo && + // Don't try Terra Classic if unexpected error occurred. + !result.props.error && + // Only try Terra Classic if Terra failed. + decodedChainId === ChainId.TerraMainnet + ) { + return await getForChainId(ChainId.TerraClassicMainnet) } + + return result } interface GetDaoProposalStaticPropsMakerOptions @@ -448,8 +481,8 @@ export const makeGetDaoProposalStaticProps = ({ throw error } - // If ProposalModuleAdapterError, treat as 404 below. - // Otherwise display 500. + // If ProposalModuleAdapterError, treat as 404 below. Otherwise display + // 500. if (!(error instanceof ProposalModuleAdapterError)) { // Report to Sentry. processError(error) diff --git a/packages/utils/chain.ts b/packages/utils/chain.ts index 37aca0511..0e01ab7c0 100644 --- a/packages/utils/chain.ts +++ b/packages/utils/chain.ts @@ -515,8 +515,9 @@ export const chainIsIndexed = (chainId: string): boolean => (config) => config.chainId === chainId && !config.noIndexer ) -// Validates whether the address is for the current chain. If so, return -// undefined. If not, return the correct subdomain. +/** + * Returns the chain ID for the given address based on the prefix. + */ export const getChainIdForAddress = (address: string): string => { const supportedChains = getSupportedChains() diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 161e7dd9b..0fcab4a6a 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -1167,6 +1167,46 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ }, }, }, + { + // Ensure this chain stays below Terra so that the logic in + // makeGetDaoStaticProps works with Terra Classic fallback. + chainId: ChainId.TerraClassicMainnet, + name: 'terraclassic', + mainnet: true, + accentColor: '#ffd842', + factoryContractAddress: + 'terra18d67ywrfwxq6924xdsg4ahrsjrtuvnu0q5v0ttj07fakw2thspps2fn9yy', + explorerUrlTemplates: { + tx: 'https://finder.terra.money/classic/tx/REPLACE', + gov: 'https://ping.pub/terra-luna/gov', + govProp: 'https://ping.pub/terra-luna/gov/REPLACE', + wallet: 'https://finder.terra.money/classic/address/REPLACE', + }, + codeIds: { + // https://github.com/CosmWasm/cw-plus + Cw1Whitelist: 8725, + Cw4Group: 8726, // v0.16 + // https://github.com/CosmWasm/cw-nfts + Cw721Base: 8727, + + // ContractVersion.V242 + CwPayrollFactory: 8729, + CwTokenSwap: 8730, + CwTokenfactoryIssuerMain: 8742, + CwVesting: 8731, + DaoCore: 8732, + DaoMigrator: -1, + DaoPreProposeApprovalSingle: 8734, + DaoPreProposeApprover: 8735, + DaoPreProposeMultiple: 8736, + DaoPreProposeSingle: 8737, + DaoProposalMultiple: 8738, + DaoProposalSingle: 8739, + DaoVotingCw4: 8740, + DaoVotingCw721Staked: 8741, + DaoVotingTokenStaked: 8743, + }, + }, { chainId: ChainId.OraichainMainnet, name: 'oraichain', @@ -1837,16 +1877,9 @@ chains } } - // Rename Terra Classic since its chain registry name is `terra` but that's - // taken by Terra 2 since it's a configured chain. - const name = - chain.chain_id === ChainId.TerraClassicMainnet - ? 'terraclassic' - : chain.chain_name - CONFIGURED_CHAINS.push({ chainId: chain.chain_id, - name, + name: chain.chain_name, mainnet: chain.network_type === 'mainnet', accentColor: '', noGov: NO_GOV_CHAIN_IDS.includes(chain.chain_id), From 2220864ea7344447e8ab1b1f416ea11de6b2f3c2 Mon Sep 17 00:00:00 2001 From: noah Date: Thu, 9 May 2024 06:40:35 -0700 Subject: [PATCH 152/438] Upgrade cosmos-kit with cosmiframe support (#1771) --- packages/state/package.json | 1 - .../stateful/components/dao/tabs/AppsTab.tsx | 107 +- .../components/wallet/WalletProvider.tsx | 79 +- .../stateful/components/wallet/WalletUi.tsx | 3 +- .../components/wallet/WalletUiWalletList.tsx | 49 +- packages/stateful/package.json | 53 +- packages/stateless/package.json | 6 +- packages/types/package.json | 8 +- packages/utils/constants/apps.ts | 15 +- packages/utils/dao.ts | 6 +- packages/utils/package.json | 4 +- yarn.lock | 2111 ++++++++++------- 12 files changed, 1462 insertions(+), 980 deletions(-) diff --git a/packages/state/package.json b/packages/state/package.json index b064c5b9c..422e55e72 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -25,7 +25,6 @@ "recoil": "^0.7.2" }, "devDependencies": { - "@cosmos-kit/core": "^2.8.9", "@dao-dao/config": "2.4.0-rc.8", "@dao-dao/types": "2.4.0-rc.8", "@graphql-codegen/cli": "^5.0.0", diff --git a/packages/stateful/components/dao/tabs/AppsTab.tsx b/packages/stateful/components/dao/tabs/AppsTab.tsx index 7f5498b9f..26966b68d 100644 --- a/packages/stateful/components/dao/tabs/AppsTab.tsx +++ b/packages/stateful/components/dao/tabs/AppsTab.tsx @@ -1,4 +1,5 @@ import { AccountData, StdSignDoc } from '@cosmjs/amino' +import { fromBech32 } from '@cosmjs/encoding' import { DirectSignDoc, SimpleAccount, WalletAccount } from '@cosmos-kit/core' import { useIframe } from '@cosmos-kit/react-lite' import cloneDeep from 'lodash.clonedeep' @@ -10,6 +11,7 @@ import { useRecoilState, useSetRecoilState } from 'recoil' import useDeepCompareEffect from 'use-deep-compare-effect' import { v4 as uuidv4 } from 'uuid' +import { OverrideHandler } from '@dao-dao/cosmiframe' import { proposalCreatedCardPropsAtom, proposalDraftsAtom, @@ -25,6 +27,7 @@ import { useDaoInfoContext, } from '@dao-dao/stateless' import { + AccountType, ActionKeyAndData, ActionKeyAndDataNoId, BaseNewProposalProps, @@ -37,14 +40,13 @@ import { import { TxBody } from '@dao-dao/types/protobuf/codegen/cosmos/tx/v1beta1/tx' import { DaoProposalSingleAdapterId, + SITE_TITLE, SITE_URL, decodeMessages, getAccountAddress, getAccountChainId, getDisplayNameForChainId, - getFallbackImage, maybeMakePolytoneExecuteMessage, - toAccessibleImageUrl, } from '@dao-dao/utils' import { useActionsForMatching } from '../../../actions' @@ -63,7 +65,6 @@ export const AppsTab = () => { const { t } = useTranslation() const { name, - imageUrl, chainId: currentChainId, coreAddress, polytoneProxies, @@ -81,11 +82,31 @@ export const AppsTab = () => { const [msgs, setMsgs] = useState() const [fullScreen, setFullScreen] = useState(false) - const addressForChainId = (chainId: string) => - getAccountAddress({ - accounts, - chainId, - }) || '' + const addressForChainId = (chainId: string) => { + const address = + getAccountAddress({ + accounts, + chainId, + types: [AccountType.Native, AccountType.Polytone], + }) || + // Fallback to ICA if exists, but don't use if a native or polytone + // account exists. + getAccountAddress({ + accounts, + chainId, + types: [AccountType.Ica], + }) + if (!address) { + throw new Error( + t('error.daoMissingAccountsOnChains', { + daoName: name, + chains: getDisplayNameForChainId(chainId), + count: 1, + }) + ) + } + return address + } const chainIdForAddress = (address: string) => getAccountChainId({ accounts, @@ -126,7 +147,7 @@ export const AppsTab = () => { setMsgs(messages) } - const enableAndConnect = (chainIds: string | string[]) => + const enableAndConnect = (chainIds: string | string[]): OverrideHandler => [chainIds].flat().some((chainId) => addressForChainId(chainId)) ? { type: 'success', @@ -144,17 +165,10 @@ export const AppsTab = () => { } const { wallet, iframeRef } = useIframe({ - walletInfo: { - prettyName: name, - logo: imageUrl - ? toAccessibleImageUrl(imageUrl) - : SITE_URL + getFallbackImage(coreAddress), + metadata: { + name: SITE_TITLE, + imageUrl: SITE_URL + '/daodao.png', }, - accountReplacement: async (chainId) => ({ - username: name, - address: addressForChainId(chainId), - pubkey: await getPubKey(chainId), - }), walletClientOverrides: { // @ts-ignore signAmino: (_chainId: string, signer: string, signDoc: StdSignDoc) => { @@ -208,49 +222,42 @@ export const AppsTab = () => { username: name, } as SimpleAccount, }), - }, - aminoSignerOverrides: { - signAmino: (signerAddress, signDoc) => { - decodeAmino(signerAddress, signDoc) - + // Needed by Graz and other Keplr clients. + getKey: async (chainId: string) => { + const bech32Address = addressForChainId(chainId) return { - type: 'error', - error: 'Handled by DAO browser.', - } - }, - getAccounts: async () => ({ - type: 'success', - // Will be overridden by `accountReplacement` function for the - // appropriate chain, so just put filler data. - value: [ - { - address: coreAddress, + type: 'success', + value: { + name, algo: 'secp256k1', - pubkey: await getPubKey(currentChainId), + pubkey: await getPubKey(chainId), + address: fromBech32(bech32Address).data, + bech32Address, + isNanoLedger: false, + isKeystone: false, }, - ...(await Promise.all( - Object.entries(polytoneProxies).map(async ([chainId, address]) => ({ - address, - algo: 'secp256k1', - pubkey: await getPubKey(chainId), - })) - )), - ] as AccountData[], - }), + } + }, }, - directSignerOverrides: { + signerOverrides: { signDirect: (signerAddress, signDoc) => { decodeDirect(signerAddress, signDoc.bodyBytes) return { type: 'error', - error: 'Handled by DAO browser.', + error: 'Handled by DAO.', + } + }, + signAmino: (signerAddress, signDoc) => { + decodeAmino(signerAddress, signDoc) + + return { + type: 'error', + error: 'Handled by DAO.', } }, getAccounts: async () => ({ type: 'success', - // Will be overridden by `accountReplacement` function for the - // appropriate chain, so just put filler data. value: [ { address: coreAddress, @@ -276,7 +283,7 @@ export const AppsTab = () => { // some dApps if simulation fails... let pubKey try { - pubKey = (await wallet.client.getAccount?.(chainId))?.pubkey + pubKey = (await wallet.client?.getAccount?.(chainId))?.pubkey } catch { pubKey = new Uint8Array([0x02, ...[...new Array(32)].map(() => 0)]) } diff --git a/packages/stateful/components/wallet/WalletProvider.tsx b/packages/stateful/components/wallet/WalletProvider.tsx index bb89818b8..de6c38857 100644 --- a/packages/stateful/components/wallet/WalletProvider.tsx +++ b/packages/stateful/components/wallet/WalletProvider.tsx @@ -28,6 +28,7 @@ import { useTranslation } from 'react-i18next' import { usePrevious } from 'react-use' import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil' +import { isInIframe } from '@dao-dao/cosmiframe' import { isKeplrMobileWebAtom, mountedInBrowserAtom, @@ -52,6 +53,16 @@ leapMetamaskWallets[0].walletInfo.prettyName = 'MetaMask (Leap Snap)' cosmosExtensionMetamaskWallets[0].walletInfo.prettyName = 'MetaMask (Cosmos Extension)' +const ALLOWED_IFRAME_PARENT_ORIGINS = [ + 'https://daodao.zone', + 'https://dao.daodao.zone', + 'https://app.osmosis.zone', +] +// Support localhost dev env and vercel preview links. +if (!ALLOWED_IFRAME_PARENT_ORIGINS.includes(SITE_URL)) { + ALLOWED_IFRAME_PARENT_ORIGINS.push(SITE_URL) +} + export type WalletProviderProps = { children: ReactNode } @@ -126,39 +137,47 @@ export const WalletProvider = ({ children }: WalletProviderProps) => { })() }, [mountedInBrowser, setIsKeplrMobileWeb]) - const allWallets = [ - ...leapMetamaskWallets, - // Alphabetize. - ...[ - ...keplrWallets, - ...leapWallets.filter((w) => !leapMetamaskWallets.includes(w)), - ...stationWallets, - ...vectisWallets, - ...trustWallets, - ...cosmostationWallets, - ...coin98Wallets, - ...omniWallets, - ...shellWallets, - ...xdefiWallets, - ...okxWallets, - ...compassWallets, - ...frontierWallets, - ...cosmosExtensionMetamaskWallets, - ...exodusWallets, - ...ledgerWallets, - ...tailwindWallets, - ...ninjiWallets, - ...owalletWallets, - ].sort((a, b) => - a.walletInfo.prettyName.localeCompare(b.walletInfo.prettyName) - ), - // Google, Apple, Discord, Twitter - ...web3AuthWallets, - ] + // If in iframe, show no wallets, which will make it only show the iframe + // wallet since that's installed by default. + const allWallets = isInIframe() + ? [] + : [ + ...leapMetamaskWallets, + // Alphabetize. + ...[ + ...keplrWallets, + ...leapWallets.filter((w) => !leapMetamaskWallets.includes(w)), + ...stationWallets, + ...vectisWallets, + ...trustWallets, + ...cosmostationWallets, + ...coin98Wallets, + ...omniWallets, + ...shellWallets, + ...xdefiWallets, + ...okxWallets, + ...compassWallets, + ...frontierWallets, + ...cosmosExtensionMetamaskWallets, + ...exodusWallets, + ...ledgerWallets, + ...tailwindWallets, + ...ninjiWallets, + ...owalletWallets, + ].sort((a, b) => + a.walletInfo.prettyName.localeCompare(b.walletInfo.prettyName) + ), + // Google, Apple, Discord, Twitter + ...web3AuthWallets, + ] return ( { getChainForChainId(chainId), [maybeGetAssetListForChainId(chainId)].filter( (al): al is AssetList => !!al - ) + // Temp fix for mismatched package types. + ) as any[] ) ) diff --git a/packages/stateful/components/wallet/WalletUiWalletList.tsx b/packages/stateful/components/wallet/WalletUiWalletList.tsx index b1bb2ecf5..9e94a3b56 100644 --- a/packages/stateful/components/wallet/WalletUiWalletList.tsx +++ b/packages/stateful/components/wallet/WalletUiWalletList.tsx @@ -60,31 +60,32 @@ export const WalletUiWalletList = ({ } } - const mobileWalletsRender = ( -
-

{t('title.mobileWallets')}

-
- {mobileWallets.map((wallet) => ( - - ))} + const mobileWalletsRender = + mobileWallets.length > 0 ? ( +
+

{t('title.mobileWallets')}

+
+ {mobileWallets.map((wallet) => ( + + ))} +
-
- ) + ) : null return (
diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 7e45814b7..628a4f953 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -14,30 +14,30 @@ "@cosmjs/encoding": "^0.32.3", "@cosmjs/proto-signing": "^0.32.3", "@cosmjs/stargate": "^0.32.3", - "@cosmos-kit/coin98": "^2.6.10", - "@cosmos-kit/compass": "^2.6.9", - "@cosmos-kit/core": "^2.8.9", - "@cosmos-kit/cosmos-extension-metamask": "^0.4.11", - "@cosmos-kit/cosmostation": "^2.6.10", - "@cosmos-kit/exodus": "^2.5.9", - "@cosmos-kit/fin": "^2.6.9", - "@cosmos-kit/frontier": "^2.5.9", - "@cosmos-kit/keplr": "^2.6.9", - "@cosmos-kit/leap": "^2.6.11", - "@cosmos-kit/leap-metamask-cosmos-snap": "^0.6.2", - "@cosmos-kit/ledger": "^2.6.9", - "@cosmos-kit/ninji": "^2.6.9", - "@cosmos-kit/okxwallet": "^2.4.9", - "@cosmos-kit/omni": "^2.5.9", - "@cosmos-kit/owallet": "^2.6.10", - "@cosmos-kit/react-lite": "^2.6.9", - "@cosmos-kit/shell": "^2.6.9", - "@cosmos-kit/station": "^2.5.9", - "@cosmos-kit/tailwind": "^1.0.2", - "@cosmos-kit/trust": "^2.6.0", - "@cosmos-kit/vectis": "^2.6.9", - "@cosmos-kit/web3auth": "^2.5.9", - "@cosmos-kit/xdefi": "^2.5.9", + "@cosmos-kit/coin98": "^2.8.0", + "@cosmos-kit/compass": "^2.8.0", + "@cosmos-kit/core": "^2.10.0", + "@cosmos-kit/cosmos-extension-metamask": "^0.6.0", + "@cosmos-kit/cosmostation": "^2.8.0", + "@cosmos-kit/exodus": "^2.7.0", + "@cosmos-kit/fin": "^2.8.0", + "@cosmos-kit/frontier": "^2.7.0", + "@cosmos-kit/keplr": "^2.8.0", + "@cosmos-kit/leap": "^2.8.0", + "@cosmos-kit/leap-metamask-cosmos-snap": "^0.8.0", + "@cosmos-kit/ledger": "^2.8.0", + "@cosmos-kit/ninji": "^2.8.0", + "@cosmos-kit/okxwallet": "^2.6.0", + "@cosmos-kit/omni": "^2.7.0", + "@cosmos-kit/owallet": "^2.8.0", + "@cosmos-kit/react-lite": "^2.8.0", + "@cosmos-kit/shell": "^2.8.0", + "@cosmos-kit/station": "^2.7.0", + "@cosmos-kit/tailwind": "^1.2.0", + "@cosmos-kit/trust": "^2.8.0", + "@cosmos-kit/vectis": "^2.8.0", + "@cosmos-kit/web3auth": "^2.7.0", + "@cosmos-kit/xdefi": "^2.7.0", "@dao-dao/i18n": "2.4.0-rc.8", "@dao-dao/state": "2.4.0-rc.8", "@dao-dao/stateless": "2.4.0-rc.8", @@ -48,7 +48,7 @@ "@mui/material": "^5.10.3", "@walletconnect/browser-utils": "^1.8.0", "buffer": "^6.0.3", - "chain-registry": "^1.28.6", + "chain-registry": "^1.46.8", "clsx": "^1.1.1", "file-saver": "^2.0.5", "fuse.js": "^6.6.2", @@ -73,9 +73,10 @@ "uuid": "^9.0.0" }, "devDependencies": { - "@chain-registry/types": "^0.17.1", + "@chain-registry/types": "^0.28.12", "@cosmjs/amino": "^0.32.3", "@dao-dao/config": "2.4.0-rc.8", + "@dao-dao/cosmiframe": "0.1.0", "@dao-dao/types": "2.4.0-rc.8", "@storybook/react": "^6.5.10", "@types/file-saver": "^2.0.5", diff --git a/packages/stateless/package.json b/packages/stateless/package.json index 8b8df9021..514809e0f 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -18,7 +18,7 @@ "@types/remove-markdown": "^0.3.1", "@walletconnect/browser-utils": "^1.8.0", "a11y-react-emoji": "^1.2.0", - "chain-registry": "^1.28.6", + "chain-registry": "^1.46.8", "chart.js": "^4.4.0", "chartjs-adapter-date-fns": "^3.0.0", "chartjs-plugin-annotation": "^3.0.1", @@ -43,8 +43,8 @@ "uuid": "^9.0.0" }, "devDependencies": { - "@chain-registry/types": "^0.17.1", - "@cosmos-kit/core": "^2.8.9", + "@chain-registry/types": "^0.28.12", + "@cosmos-kit/core": "^2.10.0", "@dao-dao/config": "2.4.0-rc.8", "@storybook/react": "^6.5.10", "@types/lodash.clonedeep": "^4.5.0", diff --git a/packages/types/package.json b/packages/types/package.json index d0112e091..7915e051e 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -11,8 +11,8 @@ "protobuf": "npm run protobuf:codegen && npm run protobuf:patch" }, "dependencies": { - "@chain-registry/types": "^0.17.1", - "@cosmos-kit/web3auth": "^2.5.9", + "@chain-registry/types": "^0.28.12", + "@cosmos-kit/web3auth": "^2.7.0", "next-i18next": "^11.0.0", "pusher-js": "^7.6.0", "react": "^18.2.0", @@ -22,8 +22,8 @@ "typescript": "5.3.3" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.8", - "@cosmology/telescope": "^1.4.12" + "@cosmology/telescope": "^1.4.12", + "@dao-dao/config": "2.4.0-rc.8" }, "peerDependencies": { "next": "^12 || ^13", diff --git a/packages/utils/constants/apps.ts b/packages/utils/constants/apps.ts index 6ed7fba8a..a9f509152 100644 --- a/packages/utils/constants/apps.ts +++ b/packages/utils/constants/apps.ts @@ -8,14 +8,13 @@ export const DAO_APPS: DaoApp[] = [ imageUrl: 'https://app.osmosis.zone/images/preview.jpg', url: 'https://app.osmosis.zone', }, - // TODO(apps): uncomment when Stargaze works - // { - // name: 'Stargaze', - // imageUrl: 'https://stargaze.zone/TwitterCard.png', - // url: MAINNET - // ? 'https://stargaze.zone' - // : 'https://testnet.publicawesome.dev', - // }, + { + name: 'Stargaze', + imageUrl: 'https://stargaze.zone/TwitterCard.png', + url: MAINNET + ? 'https://stargaze.zone' + : 'https://testnet.publicawesome.dev', + }, { name: 'Calculated Finance', imageUrl: '/apps/calcfi.jpg', diff --git a/packages/utils/dao.ts b/packages/utils/dao.ts index eb267c625..cd42ae8c7 100644 --- a/packages/utils/dao.ts +++ b/packages/utils/dao.ts @@ -88,15 +88,11 @@ export const getAccountAddress = ( export const getAccountChainId = ({ accounts, address, - types = [AccountType.Native, AccountType.Polytone], }: { accounts: Account[] address: string - types?: AccountType[] }): string | undefined => - accounts.find( - (account) => types.includes(account.type) && account.address === address - )?.chainId + accounts.find((account) => account.address === address)?.chainId /** * Filter DAO items by prefix and remove the prefix from the key. diff --git a/packages/utils/package.json b/packages/utils/package.json index 76b683d53..b13ebcd28 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -21,7 +21,7 @@ "@types/uuid": "^9.0.1", "ajv": "^8.11.0", "aws-sdk": "^2.1612.0", - "chain-registry": "^1.28.6", + "chain-registry": "^1.46.8", "json5": "^2.2.0", "lodash.clonedeep": "^4.5.0", "long": "^5.2.1", @@ -35,7 +35,7 @@ "uuid": "^9.0.0" }, "devDependencies": { - "@chain-registry/types": "^0.17.1", + "@chain-registry/types": "^0.28.12", "@cosmjs/proto-signing": "^0.32.3", "@dao-dao/config": "2.4.0-rc.8", "cosmjs-types": "^0.9.0", diff --git a/yarn.lock b/yarn.lock index 4ac230f02..0c353b99b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1939,13 +1939,20 @@ core-js-pure "^3.20.2" regenerator-runtime "^0.13.4" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.13.17", "@babel/runtime@^7.14.5", "@babel/runtime@^7.17.2", "@babel/runtime@^7.17.8", "@babel/runtime@^7.18.3", "@babel/runtime@^7.18.9", "@babel/runtime@^7.21.0", "@babel/runtime@^7.22.10", "@babel/runtime@^7.22.6", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.13.17", "@babel/runtime@^7.14.5", "@babel/runtime@^7.17.8", "@babel/runtime@^7.18.3", "@babel/runtime@^7.18.9", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7": version "7.24.0" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.0.tgz#584c450063ffda59697021430cb47101b085951e" integrity sha512-Chk32uHMg6TnQdvw2e9IlqPpFX/6NLuK0Ys2PqLb7/gL5uFn9mXvK715FGLlOLQrcO4qIkNHkvPGktzzXexsFw== dependencies: regenerator-runtime "^0.14.0" +"@babel/runtime@^7.17.2", "@babel/runtime@^7.21.0", "@babel/runtime@^7.22.10", "@babel/runtime@^7.22.6", "@babel/runtime@^7.24.5": + version "7.24.5" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.5.tgz#230946857c053a36ccc66e1dd03b17dd0c4ed02c" + integrity sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g== + dependencies: + regenerator-runtime "^0.14.0" + "@babel/template@^7.12.7", "@babel/template@^7.18.10", "@babel/template@^7.20.7", "@babel/template@^7.22.15", "@babel/template@^7.22.5", "@babel/template@^7.3.3": version "7.22.15" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" @@ -2016,13 +2023,12 @@ integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== "@chain-registry/client@^1.18.0": - version "1.19.2" - resolved "https://registry.yarnpkg.com/@chain-registry/client/-/client-1.19.2.tgz#78f114df51b6e7b1f4d94ea9f79aa98c4c23d25a" - integrity sha512-h2bENsXMQSxyaFVprlK5wQb0UY3eZKu/J6RhmG5E4hKV5k9jPQ3/+266vhbckYasi3fIPW221lFdo+tdNHB/Fg== + version "1.31.11" + resolved "https://registry.yarnpkg.com/@chain-registry/client/-/client-1.31.11.tgz#f14b4ab276546fac4d3930f53a51795efb3e5831" + integrity sha512-sXI25J1x3sZL7wn8FAO+byOkaS466Z7YCYGucdtydHKsRSyQfJxvYo471rX1uWS1aWOzaSlWxoGGyyJzbuq78A== dependencies: - "@babel/runtime" "^7.21.0" - "@chain-registry/types" "^0.18.1" - "@chain-registry/utils" "^1.18.2" + "@chain-registry/types" "^0.28.11" + "@chain-registry/utils" "^1.29.11" bfs-path "^1.0.2" cross-fetch "^3.1.5" @@ -2037,13 +2043,12 @@ "@cosmostation/extension-client" "0.1.15" "@chain-registry/cosmostation@^1.26.0": - version "1.28.0" - resolved "https://registry.yarnpkg.com/@chain-registry/cosmostation/-/cosmostation-1.28.0.tgz#47fb5081fdb6a41c30f5eb081155c90976ab5b80" - integrity sha512-NyA69X6mOGornlWp/ya64Foq/rfvhnofmAt2Ppkz3ndJYBm3zI//HOAWhRHXoY2XSCRdT+pKbqIKW2repeB0ew== + version "1.49.6" + resolved "https://registry.yarnpkg.com/@chain-registry/cosmostation/-/cosmostation-1.49.6.tgz#cefe7d5023524990db788f54a51e18b8520b1791" + integrity sha512-0YHcETVFj92sMOha2Rqe8EZXuL0iRoqqyHo6vPov+pNKcE8hNi687bKWK0KkOc0UOBpsNYxN8fTQhm5BxucoQg== dependencies: - "@babel/runtime" "^7.21.0" - "@chain-registry/types" "^0.17.1" - "@chain-registry/utils" "^1.17.0" + "@chain-registry/types" "^0.28.11" + "@chain-registry/utils" "^1.29.11" "@cosmostation/extension-client" "0.1.15" "@chain-registry/keplr@1.28.0": @@ -2057,34 +2062,29 @@ "@keplr-wallet/crypto" "0.12.28" semver "^7.5.0" -"@chain-registry/types@0.17.0": - version "0.17.0" - resolved "https://registry.yarnpkg.com/@chain-registry/types/-/types-0.17.0.tgz#bbe9176a6d30a491259fab1fcdcee2b7edf6141f" - integrity sha512-lavACU4oDxioUy8lZOFZN0Vrr2qR+Dg2yEh/mkrPfOldcioavREXJou0elDyyXwq4pGLC5YQ+IISCtQ4Du0bdw== - dependencies: - "@babel/runtime" "^7.21.0" - -"@chain-registry/types@^0.17.0", "@chain-registry/types@^0.17.1": +"@chain-registry/types@^0.17.0": version "0.17.1" resolved "https://registry.yarnpkg.com/@chain-registry/types/-/types-0.17.1.tgz#0ac7bda6178d3917834578627f232a247fe5def8" integrity sha512-O0CgrtJgIlqXvZm1CqDZe/7jZz068O/uuCIoyDXCegFHK03rdHacKcDGwEIUuI0MNUf8YV3jdE4xHQMSAX+79w== dependencies: "@babel/runtime" "^7.21.0" -"@chain-registry/types@^0.18.1": - version "0.18.1" - resolved "https://registry.yarnpkg.com/@chain-registry/types/-/types-0.18.1.tgz#bd926ddf204f2ae986a79b42f0cfe85764e2977a" - integrity sha512-H/UnOyd7WdcWHa2FGKxy4MclDDFrbE2rFwaUh9oubNJOey7UBI4dNF10oZIWM/1by15LUgDz45fVbh6uA6W5Tg== - dependencies: - "@babel/runtime" "^7.21.0" +"@chain-registry/types@^0.28.11": + version "0.28.11" + resolved "https://registry.yarnpkg.com/@chain-registry/types/-/types-0.28.11.tgz#be43fcd3d9489a5cb427cae1d25a274e210c252a" + integrity sha512-pTsd6YGq+W6qnqWkWI7VxPYrx1T8B6usjlG5XmZxUJJFpB7HULot9WLPmcB/DEUxR8pekyiIN3x93761mql4sQ== -"@chain-registry/utils@^1.15.0", "@chain-registry/utils@^1.17.0", "@chain-registry/utils@^1.18.2": - version "1.18.2" - resolved "https://registry.yarnpkg.com/@chain-registry/utils/-/utils-1.18.2.tgz#fa67e8179afad45011c031a1181824133412e6c6" - integrity sha512-X1vBFxdMVRGFW/6fLUQgJ4aG/2RaDYDDEeDA5/x/MlssGtdSBEyytd7M9zO0uS51QYy1ysIhkG3OyZLoyGdurg== +"@chain-registry/types@^0.28.12": + version "0.28.12" + resolved "https://registry.yarnpkg.com/@chain-registry/types/-/types-0.28.12.tgz#b7530ef0d35806558380d196553bb54b4c85184e" + integrity sha512-wrcbKZ3Sz0bXGWBhF9igq+LAOn3PkQLh+VFaA3J1SAVE7nt0WFlRfkvu7WmLmnSJhLlAxdyf9jWu+yXSRvpscw== + +"@chain-registry/utils@^1.15.0", "@chain-registry/utils@^1.29.11": + version "1.29.11" + resolved "https://registry.yarnpkg.com/@chain-registry/utils/-/utils-1.29.11.tgz#ddd1e5fea3b64a1e775f1958cc41d345f803c9d9" + integrity sha512-JzoWuU1CFG2cZpsk1WqnkHlKst94BnbcC2NPyRdgRIJEOqahhcuZd7azWdybCBcEPdWgzPTo1NqbNsywBBSp1g== dependencies: - "@babel/runtime" "^7.21.0" - "@chain-registry/types" "^0.18.1" + "@chain-registry/types" "^0.28.11" bignumber.js "9.1.1" sha.js "^2.4.11" @@ -2145,7 +2145,7 @@ "@cosmjs/math" "^0.31.3" "@cosmjs/utils" "^0.31.3" -"@cosmjs/amino@^0.32.2", "@cosmjs/amino@^0.32.3": +"@cosmjs/amino@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.32.3.tgz#b81d4a2b8d61568431a1afcd871e1344a19d97ff" integrity sha512-G4zXl+dJbqrz1sSJ56H/25l5NJEk/pAPIr8piAHgbXYw88OdAOlpA26PQvk2IbSN/rRgVbvlLTNgX2tzz1dyUA== @@ -2155,7 +2155,7 @@ "@cosmjs/math" "^0.32.3" "@cosmjs/utils" "^0.32.3" -"@cosmjs/cosmwasm-stargate@^0.32.1", "@cosmjs/cosmwasm-stargate@^0.32.2", "@cosmjs/cosmwasm-stargate@^0.32.3": +"@cosmjs/cosmwasm-stargate@^0.32.1", "@cosmjs/cosmwasm-stargate@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.32.3.tgz#26a110a6bb0c15fdeef647e3433bd9553a1acd5f" integrity sha512-pqkt+QsLIPNMTRh9m+igJgIpzXXgn1BxmxfAb9zlC23kvsuzY/12un9M7iAdim1NwKXDFeYw46xC2YkprwQp+g== @@ -2184,7 +2184,7 @@ elliptic "^6.5.4" libsodium-wrappers-sumo "^0.7.11" -"@cosmjs/crypto@^0.32.1", "@cosmjs/crypto@^0.32.2", "@cosmjs/crypto@^0.32.3": +"@cosmjs/crypto@^0.32.1", "@cosmjs/crypto@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.32.3.tgz#787f8e659709678722068ee1ddf379f65051a25e" integrity sha512-niQOWJHUtlJm2GG4F00yGT7sGPKxfUwz+2qQ30uO/E3p58gOusTcH2qjiJNVxb8vScYJhFYFqpm/OA/mVqoUGQ== @@ -2206,7 +2206,7 @@ bech32 "^1.1.4" readonly-date "^1.0.0" -"@cosmjs/encoding@^0.32.1", "@cosmjs/encoding@^0.32.2", "@cosmjs/encoding@^0.32.3": +"@cosmjs/encoding@^0.32.1", "@cosmjs/encoding@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.32.3.tgz#e245ff511fe4a0df7ba427b5187aab69e3468e5b" integrity sha512-p4KF7hhv8jBQX3MkB3Defuhz/W0l3PwWVYU2vkVuBJ13bJcXyhU9nJjiMkaIv+XP+W2QgRceqNNgFUC5chNR7w== @@ -2237,25 +2237,13 @@ dependencies: bn.js "^5.2.0" -"@cosmjs/math@^0.32.1", "@cosmjs/math@^0.32.2", "@cosmjs/math@^0.32.3": +"@cosmjs/math@^0.32.1", "@cosmjs/math@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.32.3.tgz#16e4256f4da507b9352327da12ae64056a2ba6c9" integrity sha512-amumUtZs8hCCnV+lSBaJIiZkGabQm22QGg/IotYrhcmoOEOjt82n7hMNlNXRs7V6WLMidGrGYcswB5zcmp0Meg== dependencies: bn.js "^5.2.0" -"@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.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.3" resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.31.3.tgz#20440b7b96fb2cd924256a10e656fd8d4481cdcd" @@ -2269,7 +2257,7 @@ cosmjs-types "^0.8.0" long "^4.0.0" -"@cosmjs/proto-signing@^0.32.1", "@cosmjs/proto-signing@^0.32.2", "@cosmjs/proto-signing@^0.32.3": +"@cosmjs/proto-signing@^0.32.1", "@cosmjs/proto-signing@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.32.3.tgz#91ae149b747d18666a6ccc924165b306431f7c0d" integrity sha512-kSZ0ZUY0DwcRT0NcIn2HkadH4NKlwjfZgbLj1ABwh/4l0RgeT84QCscZCu63tJYq3K6auwqTiZSZERwlO4/nbg== @@ -2291,7 +2279,7 @@ ws "^7" xstream "^11.14.0" -"@cosmjs/stargate@^0.32.1", "@cosmjs/stargate@^0.32.2", "@cosmjs/stargate@^0.32.3": +"@cosmjs/stargate@^0.32.1", "@cosmjs/stargate@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.32.3.tgz#5a92b222ada960ebecea72cc9f366370763f4b66" integrity sha512-OQWzO9YWKerUinPIxrO1MARbe84XkeXJAW0lyMIjXIEikajuXZ+PwftiKA5yA+8OyditVmHVLtPud6Pjna2s5w== @@ -2335,7 +2323,7 @@ resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.31.3.tgz#f97bbfda35ad69e80cd5c7fe0a270cbda16db1ed" integrity sha512-VBhAgzrrYdIe0O5IbKRqwszbQa7ZyQLx9nEQuHQ3HUplQW7P44COG/ye2n6AzCudtqxmwdX7nyX8ta1J07GoqA== -"@cosmjs/utils@^0.32.1", "@cosmjs/utils@^0.32.2", "@cosmjs/utils@^0.32.3": +"@cosmjs/utils@^0.32.1", "@cosmjs/utils@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.32.3.tgz#5dcaee6dd7cc846cdc073e9a7a7f63242f5f7e31" integrity sha512-WCZK4yksj2hBDz4w7xFZQTRZQ/RJhBX26uFHmmQFIcNUUVAihrLO+RerqJgk0dZqC42wstM9pEUQGtPmLcIYvg== @@ -2429,377 +2417,375 @@ "@cosmology/types" "^1.4.2" dotty "0.1.2" -"@cosmos-kit/coin98-extension@^2.7.10": - version "2.7.10" - resolved "https://registry.yarnpkg.com/@cosmos-kit/coin98-extension/-/coin98-extension-2.7.10.tgz#8a37aa788f809e734637c50452ca5bc0f89fdeba" - integrity sha512-xTSIEQTYrUN1xIgPYIvMMFvHVbljA04fgdSQCgvUWHCNFtoYQrYdH5sgY6L9AGe+Aejr2C6Jmejnf3GM9wXxuQ== +"@cosmos-kit/coin98-extension@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/coin98-extension/-/coin98-extension-2.9.0.tgz#05f00cccbaa17967f5a4dd6dc7db8efdc45c85d1" + integrity sha512-uyDEKBBB8Z1DZ1hF6pHpR2y1NuswqJbjB/lY04YD8GBxeP6rxrtFMUWkFFcCfPOSM931Sumu8gmP+BwSi+iMKA== dependencies: "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.8.9" + "@cosmos-kit/core" "^2.10.0" cosmjs-types ">=0.9.0" -"@cosmos-kit/coin98@^2.6.10": - version "2.6.10" - resolved "https://registry.yarnpkg.com/@cosmos-kit/coin98/-/coin98-2.6.10.tgz#7f4df0f64ac47cd2a9d30a2d0ced4123e348f1e8" - integrity sha512-bkWCtWDl18OgaMgeyRyDsasrmfCmBRqkpoltPjZ3TfQPlTIYJP667McOvi+7grxLR5Smwo/uCDCNZM6zHJtSKw== +"@cosmos-kit/coin98@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/coin98/-/coin98-2.8.0.tgz#ebc56c1023eeb3238392418d28c20dbeba371fab" + integrity sha512-j9d0t4JNR5rGDb7SF6hYFs8zPcdgO4zPp2YfTtN0Kz5TjgAO+59Vw4/NdISHxEdFBgeHaW1b9xRmYmMHsl0FEQ== dependencies: - "@cosmos-kit/coin98-extension" "^2.7.10" + "@cosmos-kit/coin98-extension" "^2.9.0" -"@cosmos-kit/compass-extension@^2.6.9": - version "2.6.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/compass-extension/-/compass-extension-2.6.9.tgz#994e8ce618e2f19e6cda92c6acd507a9604f3881" - integrity sha512-r5YVzfRThbcDbU5mQdiEMGXBDrm4m8k5clPNTTpNqk3GqSbVXhQUlDQMb7fYEtZRSu/J4lB8fZwt4C9829xIZA== +"@cosmos-kit/compass-extension@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/compass-extension/-/compass-extension-2.8.0.tgz#7d2431593de7646254a5b2d778893907c18a8764" + integrity sha512-WInvm28V3ZQNf3IW4Q2O9C7+FAYcQePwxIoK41VMt8bkQ3u1lNw7dRRQVJp8210Y1Ej7wrHNgHvpYDVNS7bLaA== dependencies: "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.8.9" + "@cosmos-kit/core" "^2.10.0" -"@cosmos-kit/compass@^2.6.9": - version "2.6.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/compass/-/compass-2.6.9.tgz#22f8bb42260691c4fedd27673d5b3664f0958e18" - integrity sha512-XHHV3rI6MxpiB3Ir7PHI/ft7VgFDUjNFpo1sttpBFWtW32PBe2EZ4COHpzUz9LtVwRhnkdWT6PK1oZshpKVXaA== +"@cosmos-kit/compass@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/compass/-/compass-2.8.0.tgz#92f62b9b0976a88f04bd00e38e020ccf25297e9b" + integrity sha512-Ky1RxiNHrZyfg16qSdX92Lhtfu3utKeplwrtiqe4rfZvyVoue967ol0Vi0GH1250fqoFSxlcdRf1oL62FLKhyQ== dependencies: - "@cosmos-kit/compass-extension" "^2.6.9" + "@cosmos-kit/compass-extension" "^2.8.0" -"@cosmos-kit/core@^2.8.9": - version "2.8.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/core/-/core-2.8.9.tgz#3e6b40fa14c5d143065d3ec6a894e386f95ea4ad" - integrity sha512-e0Fqbut9mqHlFS6QnLSbU8AFYPtXUcKVaMJsL1dKbfTotACsECgnAs4gzXaTFo3sTwEJrNZ6cq86qvqV85X6uw== +"@cosmos-kit/core@^2.10.0": + version "2.10.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/core/-/core-2.10.0.tgz#258befd2615e9afb5858825663d287b441231517" + integrity sha512-9gSmTCHh2xpG6rfcsVjxDUq1mvAKaS7Nre47ddEzLLrRni685I5ppokPwURsUZpm4lsNpDKKum0nV0P1WtYJhQ== dependencies: "@chain-registry/client" "^1.18.0" - "@chain-registry/types" "0.17.0" - "@cosmjs/amino" "^0.32.2" - "@cosmjs/cosmwasm-stargate" "^0.32.2" - "@cosmjs/proto-signing" "^0.32.2" - "@cosmjs/stargate" "^0.32.2" + "@cosmjs/amino" "^0.32.3" + "@cosmjs/cosmwasm-stargate" "^0.32.3" + "@cosmjs/proto-signing" "^0.32.3" + "@cosmjs/stargate" "^0.32.3" + "@dao-dao/cosmiframe" "^0.1.0" "@walletconnect/types" "2.11.0" bowser "2.11.0" cosmjs-types "^0.9.0" events "3.3.0" uuid "^9.0.1" -"@cosmos-kit/cosmos-extension-metamask@^0.4.11": - version "0.4.11" - resolved "https://registry.yarnpkg.com/@cosmos-kit/cosmos-extension-metamask/-/cosmos-extension-metamask-0.4.11.tgz#9c6ff32513d196a10fd5d23a8c48a05233b66325" - integrity sha512-7y7qYRJ6M1KRrXWGO4sh3KVHdR0XWAjFSeiMUo2AAYeCMG367OhD9DJWyR0Hh3KxEmArvyrUlcAJp8DCPX/VpA== +"@cosmos-kit/cosmos-extension-metamask@^0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/cosmos-extension-metamask/-/cosmos-extension-metamask-0.6.0.tgz#cfb98fcb57574b30d32234bdc8623916e0fa1876" + integrity sha512-1aurkL+BA8p01GwJ79RzCVQoWrLqYJaLCALwrmk+YqzZCZiGAtzq769iKv8lZ4ckZ8CRSeDMzP+IT17A9RQCbQ== dependencies: "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.8.9" + "@cosmos-kit/core" "^2.10.0" "@cosmsnap/snapper" "^0.1.23" cosmjs-types ">=0.9.0" -"@cosmos-kit/cosmostation-extension@^2.7.10": - version "2.7.10" - resolved "https://registry.yarnpkg.com/@cosmos-kit/cosmostation-extension/-/cosmostation-extension-2.7.10.tgz#2120fa826c692732e7c539a35141df0f8e832876" - integrity sha512-x0rBk4Ht6uicfZxIXRbwUi5WHrvKsI11oXbf9bYL9nRBfRTgpbO6zIW9791oTVjiJLzHbKaBQoqh1R233YcHbg== +"@cosmos-kit/cosmostation-extension@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/cosmostation-extension/-/cosmostation-extension-2.9.0.tgz#b3f89b44613562bc659e4505f82badd843fc5a34" + integrity sha512-HgMkcebGr/x6Z3p8o8LyBFs4EZrma8Kq70YDsdRHwsZFz6KC1Mjmh9/L4esgrXaYiZQ8EvcjtQ6yHI8lh+b9YA== dependencies: "@chain-registry/cosmostation" "^1.26.0" - "@cosmos-kit/core" "^2.8.9" + "@cosmos-kit/core" "^2.10.0" cosmjs-types "^0.9.0" -"@cosmos-kit/cosmostation-mobile@^2.6.9": - version "2.6.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/cosmostation-mobile/-/cosmostation-mobile-2.6.9.tgz#1c304ac12cccc05de93c9ed927243d51087426f6" - integrity sha512-GjZetNMFrz2oLisdp14ahxftkwPz5v1OYRGvD4MLTdMSA71JUTzX8A4At4uo4M7nwG09H1yQ2/CLQy9XGVRinA== +"@cosmos-kit/cosmostation-mobile@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/cosmostation-mobile/-/cosmostation-mobile-2.8.0.tgz#331479b55419d85d2d7d463fe91dc1eac2f14f01" + integrity sha512-AbkL7a8DJR9Nb2cNpJNDPeS23qh975GsOW2jrEJ1uWpXmtsl95GnN86/SUo01Ypdfc5SiHKWTEzgiUC74sq0Tw== dependencies: "@chain-registry/cosmostation" "1.26.0" - "@cosmos-kit/core" "^2.8.9" - "@cosmos-kit/walletconnect" "^2.5.9" + "@cosmos-kit/core" "^2.10.0" + "@cosmos-kit/walletconnect" "^2.7.0" -"@cosmos-kit/cosmostation@^2.6.10": - version "2.6.10" - resolved "https://registry.yarnpkg.com/@cosmos-kit/cosmostation/-/cosmostation-2.6.10.tgz#406d93a29c154e988f4d60425d8edbba4f0cd455" - integrity sha512-DWR28fnkv04yr5Eyo/CS7yOiYr3cwld9lE/F2qGIYGb2Tw/eUWhKSl05+2ly8S15xoKOXT7wxXOsFIXYYUQ8/g== +"@cosmos-kit/cosmostation@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/cosmostation/-/cosmostation-2.8.0.tgz#96e8e55fcbc3a57a3ecfd4a327c24a69f6b49571" + integrity sha512-GbkdVsSPSTOyv1lJ4SYf7s7jpRLUBAkx6QBGy3lZHbfLGm78C4kCBMoJZTizSugQmC5bYc20516tpMgrOPN3yA== dependencies: - "@cosmos-kit/cosmostation-extension" "^2.7.10" - "@cosmos-kit/cosmostation-mobile" "^2.6.9" + "@cosmos-kit/cosmostation-extension" "^2.9.0" + "@cosmos-kit/cosmostation-mobile" "^2.8.0" -"@cosmos-kit/exodus-extension@^2.5.9": - version "2.5.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/exodus-extension/-/exodus-extension-2.5.9.tgz#d898ef4e8794aa6ea9ce98f85cf8c05519b6b434" - integrity sha512-iPFWs3pPLYcEkRfw32qwM7/iZJX5un0tDIGdqdIR0l0qJWxwU3Fsbrrk4v/qbbRzHlHtcfiohlUOR+m52zj5zA== +"@cosmos-kit/exodus-extension@^2.7.0": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/exodus-extension/-/exodus-extension-2.7.0.tgz#305d63d2dc15b0d6229f3c46b2e52fa49e309d7d" + integrity sha512-9eN4kwVMQ77hAxD3bAkwKhLyOnK182B5LXfFlMoS2LEyEOY8hHtPha/ZPGKWoWZXq4uSUbEYXY1z29fj0ax1Hg== dependencies: - "@cosmos-kit/core" "^2.8.9" + "@cosmos-kit/core" "^2.10.0" react-icons "4.4.0" -"@cosmos-kit/exodus@^2.5.9": - version "2.5.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/exodus/-/exodus-2.5.9.tgz#b265d7e42b97e5bf2debb728e244414e51db3f66" - integrity sha512-szvol6Q5ypE8VBjrqvswnAGLfQBBqPNOqJ6cW53qRU123Y9f1PwfHwDWhtBM9UO4hnfbqgoET3ezCJlTV53zgQ== +"@cosmos-kit/exodus@^2.7.0": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/exodus/-/exodus-2.7.0.tgz#8cadccfdd10191ed6d31ba5aafaa6d5980f3c83f" + integrity sha512-3nj/42NaMRemqlr7NmIrpuZENld9NKd/6+aUIZfbCOD3Y7RzTppRjUHBmTHE8p+FXlZASTk+Cc2+670ze5SeOA== dependencies: - "@cosmos-kit/exodus-extension" "^2.5.9" + "@cosmos-kit/exodus-extension" "^2.7.0" -"@cosmos-kit/fin-extension@^2.6.9": - version "2.6.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/fin-extension/-/fin-extension-2.6.9.tgz#167e153850566a7060b3b54e060ea8e835cc1ae5" - integrity sha512-e9hcEye/7OVln40Rh6q4rQ3NHl2/toBwnDSFDDeSCbP8sXEsboVLVT8WSkgxU8OY/iP9R8DJz49JviHnMsyn5g== +"@cosmos-kit/fin-extension@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/fin-extension/-/fin-extension-2.8.0.tgz#7470403c6b13415c0c28f139dc91fe692928a1a3" + integrity sha512-HpJBm9hvXUdBBPXkExtvn8dXBoqEJXNkFC6ktQ8oOmIawRv/sD8ay7ySParatSAyvgcrpmZ38UCWJW7SKcuosA== dependencies: "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.8.9" + "@cosmos-kit/core" "^2.10.0" -"@cosmos-kit/fin@^2.6.9": - version "2.6.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/fin/-/fin-2.6.9.tgz#cb9319323623a66db1d8715c84db289dfbfd572b" - integrity sha512-lbXJnWZGMqorPj2WQI4KTS51XtJbgFsoLG7aF4wyfG7euZrlBeazOr+h49WOLvIPgiMWCYascYkuHiFuurtxQw== +"@cosmos-kit/fin@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/fin/-/fin-2.8.0.tgz#8f5f1cdcc39b49cc1e7df7a5fee1f9447a118935" + integrity sha512-9nu0HC+KUo/m2toGCCA6sHkUcdFh8o/T8som3HWzEzfuuLeuVyUZy30y0y4fcOXYT0DF7phaby8p7v0nTgPnmg== dependencies: - "@cosmos-kit/fin-extension" "^2.6.9" + "@cosmos-kit/fin-extension" "^2.8.0" -"@cosmos-kit/frontier-extension@^2.5.9": - version "2.5.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/frontier-extension/-/frontier-extension-2.5.9.tgz#1082aaa35ef02f20af4f9de4d5d76068aa15191e" - integrity sha512-YjHaxvlH1YSZj3epKXHstSNRyWdd8YZUPzpftLLuhebuaINHWk6V92MnUtXYo8UKIKOSw3UIHjZii/MieJ1STQ== +"@cosmos-kit/frontier-extension@^2.7.0": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/frontier-extension/-/frontier-extension-2.7.0.tgz#3038697fc17a135209f4c4aa7e1958c7c174ed44" + integrity sha512-TnBq41cEQ6bgRn3Jf7H/45Y/ulJdf1hHhXCaVLw8W//U+4cUB5Oq/T1U8+La1HLv3VbTIwKZRf/SR5HnrkhF/w== dependencies: - "@cosmos-kit/core" "^2.8.9" + "@cosmos-kit/core" "^2.10.0" -"@cosmos-kit/frontier@^2.5.9": - version "2.5.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/frontier/-/frontier-2.5.9.tgz#96bb0408038fa9a7fb24fb91a7095aa3cd5bda84" - integrity sha512-iYneO93TK+ksNgWl3wXafKW7UGTQ/b+cSJcneGZJ3C8r4AGdjtgmcMgFgS6NcbQxB/1l0IBmwzkhyUcBzC/hjQ== +"@cosmos-kit/frontier@^2.7.0": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/frontier/-/frontier-2.7.0.tgz#eee8c959f35d2725fce5d061d06d2e8ae99ed436" + integrity sha512-ouNG/oQZkbLvq9lhhQoHRkmAC1M3Dt/Cthfndlx2GPLGTqx/9mUbNU157tMu4AeSw7e5BDsYXgy0FTEHDWMs+A== dependencies: - "@cosmos-kit/frontier-extension" "^2.5.9" + "@cosmos-kit/frontier-extension" "^2.7.0" -"@cosmos-kit/keplr-extension@^2.7.9": - version "2.7.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/keplr-extension/-/keplr-extension-2.7.9.tgz#16586c94452a5e65713cdead07446447c511fa0e" - integrity sha512-asIjLzJjNa1mpQRohoT5zwnutk93WaQ/Y6ndb2CITfjXzM7HWrbhUzShy3FXZjHNO9CbPTjpsHNzhyScTc7fgg== +"@cosmos-kit/keplr-extension@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/keplr-extension/-/keplr-extension-2.9.0.tgz#a221e0aa2fed6d68ff8b2fb690909a689659bb40" + integrity sha512-95mDqZvkuDSep65wVs802MD83xTTIgjbMkV+VnX8GzLAK5dU4DRzklpK9ONlZopceVON6YEPLeGX4q33NXgbTA== dependencies: "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.8.9" + "@cosmos-kit/core" "^2.10.0" "@keplr-wallet/types" "^0.12.58" -"@cosmos-kit/keplr-mobile@^2.6.9": - version "2.6.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/keplr-mobile/-/keplr-mobile-2.6.9.tgz#28fcdffc8da11c34a2ece2bbef58e29dc68d0df3" - integrity sha512-kw0g/TOBKMJMDiIld2wZ7Id47hUA7G3tauijSwbMC+scXnnmOCKZ1x0lRUvW13onV7SiRT21sOm7msl8XwUlgQ== +"@cosmos-kit/keplr-mobile@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/keplr-mobile/-/keplr-mobile-2.8.0.tgz#8d2d0caa9caf6a752ce3c9212c9854e9fdcd5b03" + integrity sha512-d2JelVYMvihcN8TlRrObeFw7IZZeEgziM5nxTUjm3nqOYh9KjR+m/w2nIoTzxDxStsxWa8+DPTZ7a2MuEwLftg== dependencies: "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.8.9" - "@cosmos-kit/walletconnect" "^2.5.9" + "@cosmos-kit/core" "^2.10.0" + "@cosmos-kit/walletconnect" "^2.7.0" -"@cosmos-kit/keplr@^2.6.9": - version "2.6.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/keplr/-/keplr-2.6.9.tgz#d861f8ea4471fc72f54c19e287623341e586e8a2" - integrity sha512-HW+WhELS1dHokSq58NDNCIQaA0xRrg293uKM989XQgDOgD/xsEaRrwwTaj3guOXxVm8BE51PLTFbZesHhflmaQ== +"@cosmos-kit/keplr@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/keplr/-/keplr-2.8.0.tgz#5a1a53b73a104a10b9ec255fdf452073f12f99fd" + integrity sha512-S+pQ2hKI8G0S+YvKwZGUyXdE0agu8Cb+kOdokXu/LXxNYgo5ESEAh3PbRnrKjps/2Wt0N5qXxNVNsSMi3i1Sjg== dependencies: - "@cosmos-kit/keplr-extension" "^2.7.9" - "@cosmos-kit/keplr-mobile" "^2.6.9" + "@cosmos-kit/keplr-extension" "^2.9.0" + "@cosmos-kit/keplr-mobile" "^2.8.0" -"@cosmos-kit/leap-extension@^2.7.9": - version "2.7.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/leap-extension/-/leap-extension-2.7.9.tgz#f0d05b9adc89963a31996852d9426e4b47d38492" - integrity sha512-+F764htkzaHz/MRQOZf/iO72NmquGLU9l+nec+HlInooJ3EZianrP/3H61PVlbjdQ3RrHRFznn4FNapOVnqXCw== +"@cosmos-kit/leap-extension@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/leap-extension/-/leap-extension-2.9.0.tgz#7a2d2ac7c300bfbb64b2377d21135f7a5416ae06" + integrity sha512-a+FuMz+vPn9csGxSCNslWE6aTZOiDKjF8CogAgEM+xBKrLcMQ+x08eIKfVg9GdDEiLmW7p1VHBqAleZL3grn1w== dependencies: "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.8.9" + "@cosmos-kit/core" "^2.10.0" -"@cosmos-kit/leap-metamask-cosmos-snap@^0.6.2": - version "0.6.2" - resolved "https://registry.yarnpkg.com/@cosmos-kit/leap-metamask-cosmos-snap/-/leap-metamask-cosmos-snap-0.6.2.tgz#951d3934c781a8135247e5270bdb52a5fb6be311" - integrity sha512-47Kq0ZrXNinbTfNH0i0GtxdfIDkq7iaixLQ5p9qc56CtiqBtT4bSrZoYqUl3nlM7iFKTtrb7FdCPkAVkWpYUew== +"@cosmos-kit/leap-metamask-cosmos-snap@^0.8.0": + version "0.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/leap-metamask-cosmos-snap/-/leap-metamask-cosmos-snap-0.8.0.tgz#7cb09373020b89ca90dd2a0961530dcc6f8ed9a6" + integrity sha512-fWLKnpuyROugsjdSQsIKaCTk6azVq4g0OiOtxgUFA8qNx7/lzu++k1yt86WdgRNOeJ5AV7EVBqGu/wR55QUxEg== dependencies: "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.8.9" + "@cosmos-kit/core" "^2.10.0" "@leapwallet/cosmos-snap-provider" "0.1.25" "@metamask/providers" "^11.1.1" -"@cosmos-kit/leap-mobile@^2.6.9": - version "2.6.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/leap-mobile/-/leap-mobile-2.6.9.tgz#c772988732c9fa92ecbc52b82671e47baa0ab76e" - integrity sha512-ecyPcfeBSI8PiXbAMG9t9HLTJw7G3C3y6sZpVdJAOp0dOPbLLiHd3782veC0ts3Sps7Z148lSKkpIeRfdfRS4Q== +"@cosmos-kit/leap-mobile@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/leap-mobile/-/leap-mobile-2.8.0.tgz#37fd328395c771030c0a62ee4e49cf9b15a85df0" + integrity sha512-OskIE4kqPYTKHmiwfKYm0fvk7PZYwjtn6G/AHhgt4a8T71I/xpgf0XvaxKqR3lNRuXWiIDWClQPBK9W7ETfvrg== dependencies: "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.8.9" - "@cosmos-kit/walletconnect" "^2.5.9" + "@cosmos-kit/core" "^2.10.0" + "@cosmos-kit/walletconnect" "^2.7.0" -"@cosmos-kit/leap@^2.6.11": - version "2.6.11" - resolved "https://registry.yarnpkg.com/@cosmos-kit/leap/-/leap-2.6.11.tgz#85a8f36cd2bd871bccbf5c312b1fc43e9d9a488a" - integrity sha512-MHEi2ansrJPJzEled3L8CjoUe6sArmM77fn0Vi4Vqyi6sGVzMXq/SC8DbJ3jdfeGF5eM+kH2XJs7wraPY1Nl+g== +"@cosmos-kit/leap@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/leap/-/leap-2.8.0.tgz#40a311775ab9c3387470cb2bbaaa2aca9ad0c6de" + integrity sha512-Lf2roaDgL+lAsWYLajS62e1CxhHgVQefGTOrgpb7AHfVxoGyZdAyul9JnuBnRmw0qt9SVU1ZWrEzLWNOBQYl2w== dependencies: - "@cosmos-kit/leap-extension" "^2.7.9" - "@cosmos-kit/leap-metamask-cosmos-snap" "^0.6.2" - "@cosmos-kit/leap-mobile" "^2.6.9" + "@cosmos-kit/leap-extension" "^2.9.0" + "@cosmos-kit/leap-metamask-cosmos-snap" "^0.8.0" + "@cosmos-kit/leap-mobile" "^2.8.0" -"@cosmos-kit/ledger@^2.6.9": - version "2.6.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/ledger/-/ledger-2.6.9.tgz#e37dfb2ac5941c825477210e091c2a745daf3d61" - integrity sha512-+zn2U6v2c7vDSz8vTe/4oR4lSO/LH/FkdcrstuFTJm1Mk4tpYmJkJGmUQhYV4ZfjSHXfbfccrCl1jgu4uQgiZQ== +"@cosmos-kit/ledger@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/ledger/-/ledger-2.8.0.tgz#069a5e3d854fcb85ec06498206668ee84b8b5f3c" + integrity sha512-rEPX229WQCmTspJRmXOPQq7lVyKyO9HROFCrVnx7idmbWOOYkGfFvGSWQROuMXbGaYPDD2QiCfywbg9xRItNDg== dependencies: - "@cosmos-kit/core" "^2.8.9" + "@cosmos-kit/core" "^2.10.0" "@ledgerhq/hw-app-cosmos" "^6.28.1" "@ledgerhq/hw-transport-webhid" "^6.27.15" "@ledgerhq/hw-transport-webusb" "^6.27.15" -"@cosmos-kit/ninji-extension@^2.7.9": - version "2.7.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/ninji-extension/-/ninji-extension-2.7.9.tgz#d9c3ab6be52655bd64d3bd6ba8573442e5488dc8" - integrity sha512-nkqAgrXvqpRnzbOvgpEb5+yF981gYNKp2tlR38f0ZHOXSpNvZt62TLYy8ufAyV6c24mzSFbjnFCUXhcN3/nh5Q== +"@cosmos-kit/ninji-extension@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/ninji-extension/-/ninji-extension-2.9.0.tgz#88f91382bd6960ea1f34dc7e66e712422ca0c9a0" + integrity sha512-JhEAQ98H1Yxaac6voMeLuyJcqJwn3vDpEgQcyjfMzkKbm/IPLMyxlo7i1t/fpsANHjdGO7d+e9z/ku1SsKq8ng== dependencies: "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.8.9" + "@cosmos-kit/core" "^2.10.0" -"@cosmos-kit/ninji@^2.6.9": - version "2.6.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/ninji/-/ninji-2.6.9.tgz#b4a05e7b68ac478053f850260a6c3406713de126" - integrity sha512-d/OufHdK9ptSX77z2bNJ30YFiGxzEZ4fzW1SuCQ4spC4eAwrCaySphosaPTmAK8sPjRZJPyXVUI+P12g2fbjgA== +"@cosmos-kit/ninji@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/ninji/-/ninji-2.8.0.tgz#f4934a56b290fb55553e0764f6db50aa1a2ab340" + integrity sha512-t9KGN0fak9vaPS1DnqJn3bzNA9EW0gSEaI5fVI7cCtju3AymZXqTk3PH6exCIBsb2us0BT9e27m0jwSsyIu6iQ== dependencies: - "@cosmos-kit/ninji-extension" "^2.7.9" + "@cosmos-kit/ninji-extension" "^2.9.0" -"@cosmos-kit/okxwallet-extension@^2.6.9": - version "2.6.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/okxwallet-extension/-/okxwallet-extension-2.6.9.tgz#004a83b2b88d26951d74f7eb6747bdca68583d7b" - integrity sha512-QWPtBSd9l7C5O3P+Djvhq/54KORpvGkk/pixsYmaf2Uyq7jbQUFLdeE9ZDsikWdaYtfvb9F4P+YEA1LfbpeaEg== +"@cosmos-kit/okxwallet-extension@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/okxwallet-extension/-/okxwallet-extension-2.8.0.tgz#4e9b327302d5c07472272f6ec274a20706b5ed84" + integrity sha512-55R7SqcGQcvhLeVEFni2B5SURcHArh/xz8f+k3kXvPrzPou9SrOMbCn6qZMqibIhtC2z5jeB1b007Lx2Jc513Q== dependencies: - "@cosmos-kit/core" "^2.8.9" + "@cosmos-kit/core" "^2.10.0" -"@cosmos-kit/okxwallet@^2.4.9": - version "2.4.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/okxwallet/-/okxwallet-2.4.9.tgz#6c85c1c3da3b7bcf0cb913bc81d93683032a18d8" - integrity sha512-mAz0jG3D+ce+c+C5JDF8CnhgOc0VndHxvc9FzIwXzr7819/5i18kWqqs2iMpWU4MWDMD7EcWZyuGmB8rTZvZPQ== +"@cosmos-kit/okxwallet@^2.6.0": + version "2.6.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/okxwallet/-/okxwallet-2.6.0.tgz#2edbe60e6e25caf3d74a779e3ef1dc380d8a60ac" + integrity sha512-W7EMJmO/OFrlIq5vQsjCxJtV2uCe23Jb9+YrUdFnpVyQZIaEZ0JfWKSMyMfD+yljux4hGE2XuCE/vThajs5aWA== dependencies: - "@cosmos-kit/okxwallet-extension" "^2.6.9" + "@cosmos-kit/okxwallet-extension" "^2.8.0" -"@cosmos-kit/omni-mobile@^2.5.9": - version "2.5.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/omni-mobile/-/omni-mobile-2.5.9.tgz#c039dd9e1a99d799ad6e92d9094bd7e55bc0f480" - integrity sha512-SRu6S/PLRfVpO6BFHgPfwuO5om3HhizFYrOvynxZ7zp4yOWsc8c5tQjNcMSpQOFrLx24cJUFiCdd8hfOFthPXw== +"@cosmos-kit/omni-mobile@^2.7.0": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/omni-mobile/-/omni-mobile-2.7.0.tgz#92d81e1a1d2b4cd09925006ed4a46d14a7b9ba7a" + integrity sha512-3L80PHRDreVj1f3tU5FRmlsemoE/YZbRIuZb5cBIfNLJXvkNhOEu3ZT6p+dONAcRbwWcvv+RRHjCD+rwd2slwA== dependencies: - "@cosmos-kit/core" "^2.8.9" - "@cosmos-kit/walletconnect" "^2.5.9" + "@cosmos-kit/core" "^2.10.0" + "@cosmos-kit/walletconnect" "^2.7.0" -"@cosmos-kit/omni@^2.5.9": - version "2.5.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/omni/-/omni-2.5.9.tgz#931c15d3ea3b1d53cf73393d3f842fc4b4520aa3" - integrity sha512-oJ5ve7Sf7i7g/wpFtisPJfYGpjXweldw0LaYUWPUSttjS+WWhMFWkQGr2lKjyC1A/8Jdmsl8STOJmfyYpD8MMg== +"@cosmos-kit/omni@^2.7.0": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/omni/-/omni-2.7.0.tgz#1c153667f72df0fa545729b9ecb3b6aa6aa5c5e7" + integrity sha512-eS8nnTaMuBLNUrI5M3rCFlzfMgPQWYnsBaMd1Nxl+q4CZN2ROBai1rtExWYrjJP1+g/G/NnWViRPDNZzhKPzvA== dependencies: - "@cosmos-kit/omni-mobile" "^2.5.9" + "@cosmos-kit/omni-mobile" "^2.7.0" -"@cosmos-kit/owallet-extension@^2.7.10": - version "2.7.10" - resolved "https://registry.yarnpkg.com/@cosmos-kit/owallet-extension/-/owallet-extension-2.7.10.tgz#62a19002a83ba615dafab18528cec49b3dfb4d8d" - integrity sha512-JiOjIccx9RPFvkjCXJ76j5APGnuIJHmdHCu1NJ6BKu7uYHlRAuwV4z5ozU4KbSEqIDn+3I2ShdogQR7HoWlbGQ== +"@cosmos-kit/owallet-extension@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/owallet-extension/-/owallet-extension-2.9.0.tgz#89d8049a148605ecb7a40e9597909397cb4ca854" + integrity sha512-eb69KS2IqqjnomuEmNiRoAkFm3P2/P2Fdov8KJf7k002QR5v2yfBdw3qDxzxTr4QmA0VDqlMV8wpO7cFxyWkdg== dependencies: "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.8.9" + "@cosmos-kit/core" "^2.10.0" "@keplr-wallet/types" "^0.12.58" -"@cosmos-kit/owallet@^2.6.10": - version "2.6.10" - resolved "https://registry.yarnpkg.com/@cosmos-kit/owallet/-/owallet-2.6.10.tgz#29f6f7a0769c2f1c04d15033ad368e343b28e0b6" - integrity sha512-5/bkJYrvxYfkyU90XW8+HyK7JYFBWYM0WdZn9melDMRk7u7rKUm2BYCv0AJL4WT4xi///7ZG+3C+WPplhwr+DA== +"@cosmos-kit/owallet@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/owallet/-/owallet-2.8.0.tgz#5cf780d5d5cf45f96f6ff937c02ead11624b77bf" + integrity sha512-1IRTYNYRVaLlC7/NLzJtnXdSJnK6MuCE6vH611iF08r2jU+hqdTgegCm/9Curee8oNRU6t6qAldj7H0Jdmv9KQ== dependencies: - "@cosmos-kit/owallet-extension" "^2.7.10" + "@cosmos-kit/owallet-extension" "^2.9.0" -"@cosmos-kit/react-lite@^2.6.9": - version "2.6.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/react-lite/-/react-lite-2.6.9.tgz#11d1ad07fc087bad5cac5ee623596bdf70b80681" - integrity sha512-lDD6JcJstQrrQ5ZpdK2xk2OVma8DNwBe3ng3oNKAQmFTAagRjFS+TwkYF1Onl1kAcNmk0TIYStPzzUm9RkwSNw== +"@cosmos-kit/react-lite@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/react-lite/-/react-lite-2.8.0.tgz#ed1bc83e2fb9cfcf60dc7f5ad0f4466178d3104e" + integrity sha512-FSmnmpvVZ2It9Bjop+XX9c/U5emtDSn1VtA3+L+K0Ym5kxrO5udN6tLgCGpyHH+9VNkgO89EFhTuwfhNeKqhug== dependencies: - "@chain-registry/types" "0.17.0" - "@cosmos-kit/core" "^2.8.9" + "@cosmos-kit/core" "^2.10.0" + "@dao-dao/cosmiframe" "^0.1.0" -"@cosmos-kit/shell-extension@^2.6.9": - version "2.6.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/shell-extension/-/shell-extension-2.6.9.tgz#a6b3c4611b273fbaf034bba47b9ac196c6bb8f8c" - integrity sha512-Tl4mnWr0ns8SCNeV1cTqBcQvywl+EiR5YsdlFDnQ04u167Bxe++VXUKKSPBHcwSe2xHslzp9UGK3jGhspaQDWQ== +"@cosmos-kit/shell-extension@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/shell-extension/-/shell-extension-2.8.0.tgz#24604063ed827ee2f12aa217f28d69141e9a201d" + integrity sha512-4gG6X1WLuVYzgiReNS964By9a+GfzVlkISUrIkDCS4fGW+24uaBZ0vSsxzVtYvTobb6e0zDM7/kEO60tE+XgnQ== dependencies: "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.8.9" + "@cosmos-kit/core" "^2.10.0" -"@cosmos-kit/shell@^2.6.9": - version "2.6.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/shell/-/shell-2.6.9.tgz#61cb3390fdac87773caddd5cd5cb0880fde0acd3" - integrity sha512-YgjYw4m53IsLw9Gusq8IlewcVuR8aF/3+UU9+H1EXVpBiEEDwzEW2+k6Q8XqtSJUAy87BCwjn5cgAxQp73spLw== +"@cosmos-kit/shell@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/shell/-/shell-2.8.0.tgz#b2f6c678c6dd1cf34a28a535757a134cc856317a" + integrity sha512-5CB7TP5MKLv/mmFn8oA81OWwPireMwYEm68i67Q0Ufcb//Q1O5iDEA22IyubFbqzVPipq2BDDdfSYz0vWl3cjQ== dependencies: - "@cosmos-kit/shell-extension" "^2.6.9" + "@cosmos-kit/shell-extension" "^2.8.0" -"@cosmos-kit/station-extension@^2.6.9": - version "2.6.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/station-extension/-/station-extension-2.6.9.tgz#83beddee1cb407f89d7844735478746bc0877f90" - integrity sha512-OHtOYHGW5/i+l4VpV8zu1Vfduy+aJpH9b8yUjuumcYS1u95zDvBSFNc1ejHcBeOey+fEVObbid6e5WX5B5pmQQ== +"@cosmos-kit/station-extension@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/station-extension/-/station-extension-2.8.0.tgz#18e7c4e55423435e8eb26f7c6948f86ecaa786b4" + integrity sha512-m7RNxGsBAta7/Jjzb1BqU35noZbb4ROaifOMvoQRqgpPiDGQQ9oIx8V4DscAmwcfbuOKjUBWnZYdcm0BU3o3Yg== dependencies: - "@chain-registry/types" "0.17.0" - "@cosmos-kit/core" "^2.8.9" + "@cosmos-kit/core" "^2.10.0" "@terra-money/feather.js" "^1.0.8" - "@terra-money/station-connector" "^1.0.5" + "@terra-money/station-connector" "^1.1.0" "@terra-money/wallet-types" "^3.11.2" -"@cosmos-kit/station@^2.5.9": - version "2.5.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/station/-/station-2.5.9.tgz#a71b4bbb497c49dab3782a494da3e9a655a4268f" - integrity sha512-EIDt586MmT72sCERPOobpUxDQWMoitGIISY9X0fA0NeKTvf4l963ROewx/KHSs/oKRKI5OeM4DShJIF1B7+ZNQ== +"@cosmos-kit/station@^2.7.0": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/station/-/station-2.7.0.tgz#b2a3f8a1c40ad8b2b4393359d3338a547ed62d02" + integrity sha512-pBjePco/EVqqyVgy52wBHPLBOmLz3qhJCB+7nJJeXb7d3IrLtdfaxLWANFiLdgRdulV9i87s0rvLKkou8N9TNg== dependencies: - "@cosmos-kit/station-extension" "^2.6.9" + "@cosmos-kit/station-extension" "^2.8.0" -"@cosmos-kit/tailwind-extension@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@cosmos-kit/tailwind-extension/-/tailwind-extension-1.0.1.tgz#0c10ec807e080820f38dfc39c1b765df32d8b24b" - integrity sha512-72YVvmEvhjQeJMAcgaiG7OZj7NDRPM6whZRA4TnbULpWJ2EjCELFuzQSrvLf8pK8PPrH3AeNbTZG9XOyh0qiEg== +"@cosmos-kit/tailwind-extension@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/tailwind-extension/-/tailwind-extension-1.2.0.tgz#2e40aa7486cb74c61eb2b53b7c12aa5ef53b5eb7" + integrity sha512-ogrc+Vznuz+xVHRswSC9Zh0dWVPrEeg0ZqkSr1WEnG2jzYRiMUbdGYoAB1FrdLg0+qdq10u5ZoXUfAdXh2DwZw== dependencies: - "@cosmos-kit/core" "^2.8.9" + "@cosmos-kit/core" "^2.10.0" -"@cosmos-kit/tailwind@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@cosmos-kit/tailwind/-/tailwind-1.0.2.tgz#5bcda45a2187fa973c90452992dc6d10be826500" - integrity sha512-xPI6v537SOxSKuKxaZgDg/J1Gm/JxcJApG6UXlKP35Q73WzC3tvK52+pUrmXoWJnn0CIfBkVA07cz/2eK5otVg== +"@cosmos-kit/tailwind@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/tailwind/-/tailwind-1.2.0.tgz#3bbf7f9c96f47a85936a045b5d567fd03fd2ed09" + integrity sha512-vhIMLUiZ3F0mfoHy++G4hMIqx08uNsUB0Ep3OvVIs2fyUwRM0lnGMRx3saq8HLitgYYBNgd0WVloH5PKhBkQEQ== dependencies: - "@cosmos-kit/tailwind-extension" "^1.0.1" + "@cosmos-kit/tailwind-extension" "^1.2.0" -"@cosmos-kit/trust-extension@^2.5.9": - version "2.5.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/trust-extension/-/trust-extension-2.5.9.tgz#1c460fdaf8463442a9d8f8efa28978bb7847a41d" - integrity sha512-zmHb2eNKgoH2zqlSqJh15Uo229xUte7nufTqBBvMmW251dLaQvhMtg94onAMO1RE0221FCpTTuX/M64tSmVtCg== +"@cosmos-kit/trust-extension@^2.7.0": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/trust-extension/-/trust-extension-2.7.0.tgz#e67a8023ba7511976f545dd56a00b6116e3e15ec" + integrity sha512-QLQKxoqz4UQpvkFGwZPPQyQmy5DyrocQlO6qZdT8p0SRWL4noJFisN44ikec6s5u4/9MioR1WPKWFHBdUNwRxQ== dependencies: - "@cosmos-kit/core" "^2.8.9" + "@cosmos-kit/core" "^2.10.0" -"@cosmos-kit/trust-mobile@^2.5.9": - version "2.5.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/trust-mobile/-/trust-mobile-2.5.9.tgz#b469252096b03d2ede9bb68a7d172fd4ff7478e5" - integrity sha512-ib9Ojk02hZeKslDfu1S8rbmGu7Hnc+ldcm6hydshmubPAozF8o5Mv6KisTSdktewgkYrZzKVd6xWaB1zxQFEOA== +"@cosmos-kit/trust-mobile@^2.7.0": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/trust-mobile/-/trust-mobile-2.7.0.tgz#c8fc362800b4d979d89eec41b6f005a0becfa734" + integrity sha512-Z5E28Ce00iITomaB+2nBiQSaVNxN6G3TO1kHHmQUSy2UVOVyHoTZoQcu8aeH0ZL7qOtkvoE6XFcPXYiDms+7Pw== dependencies: - "@cosmos-kit/core" "^2.8.9" - "@cosmos-kit/walletconnect" "^2.5.9" + "@cosmos-kit/core" "^2.10.0" + "@cosmos-kit/walletconnect" "^2.7.0" -"@cosmos-kit/trust@^2.6.0": - version "2.6.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/trust/-/trust-2.6.0.tgz#718d3d991d3e468b4d0b340e4cd0508753ed6d41" - integrity sha512-4paN6EJIkHVWPEdUc+IK9jR7jj1AKHQlJLEDk3V1XYm6kGInSBf/08MXzgVwaMT2FU4UQN6kk+Z6dVrvnLOCtg== +"@cosmos-kit/trust@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/trust/-/trust-2.8.0.tgz#be158bd3a9d7a6bc141d4f80ed0843b02190664a" + integrity sha512-eAdXGG2Ab9FT1vHynI9SWDJ/MzVLuojbAzJ2QQvI4rY15aTqNoWY2XVQSxYsb4lUqF49cprMg3A66p88NTCaWQ== dependencies: - "@cosmos-kit/trust-extension" "^2.5.9" - "@cosmos-kit/trust-mobile" "^2.5.9" + "@cosmos-kit/trust-extension" "^2.7.0" + "@cosmos-kit/trust-mobile" "^2.7.0" -"@cosmos-kit/vectis-extension@^2.6.9": - version "2.6.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/vectis-extension/-/vectis-extension-2.6.9.tgz#6f0d3e19c38ef158746522ba3a622ec9c3e02636" - integrity sha512-Q8lzeOt0wEGqLWvEQ+cijkgiF7LZWVu6vsCJ6EKLl5814N92TiWOCLWEVJnaZx2rbG8dkxWQW5HpEOVfpUf4+w== +"@cosmos-kit/vectis-extension@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/vectis-extension/-/vectis-extension-2.8.0.tgz#a1fa0488aecd5a13b45a59f74889fc5494e26b3d" + integrity sha512-rUB9+bDF/Qz2hzzMuleRBMe8gaSl044MYKNRZaFk7ibdQZtPkNyOdND0EqqJt4GIywj6Of93BvVWA46KSZ75zA== dependencies: "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.8.9" + "@cosmos-kit/core" "^2.10.0" -"@cosmos-kit/vectis@^2.6.9": - version "2.6.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/vectis/-/vectis-2.6.9.tgz#9110658a0e5417b34f9168032c3db960d23c485a" - integrity sha512-9tVdus0cqudVND5GPUhQgptpHgY1BGNAOsek//WBy3wwmzu6tbZfCwQBGG7hcz1p9peDfUHSLHNvKbvX9/KgJw== +"@cosmos-kit/vectis@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/vectis/-/vectis-2.8.0.tgz#813f736370af80a5b85a5e06dce4c7842c740716" + integrity sha512-NDvirIOolkOYCAlHvh6yXt+/FXC/5bxclYhd6227Fl8jQDsheNCpk0V3/J6cRRrpb8yg38HIePTbC9U5ggfYpA== dependencies: - "@cosmos-kit/vectis-extension" "^2.6.9" + "@cosmos-kit/vectis-extension" "^2.8.0" -"@cosmos-kit/walletconnect@^2.5.9": - version "2.5.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/walletconnect/-/walletconnect-2.5.9.tgz#10c9b6f0077801e39eedf89092deb6310b47d746" - integrity sha512-wQ3qR75Q5ZpUZMO96FwBVSuLme4z4mZ8OD8fFgs1QM16Kn81+oQ00kXDT/MkokDAVCdz91qS4XHxQEAvxSm0qw== +"@cosmos-kit/walletconnect@^2.7.0": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/walletconnect/-/walletconnect-2.7.0.tgz#43087dccefb7d3db5b2410ef24fe12f125a84f4e" + integrity sha512-LhAuBt1zPxsC9TSp2GSd8Mtx9X9Id1S5c54m4SSzEWIxk78rb1dZGLrXCEjaO1nlh8Bz9MijJDCOhaN6NuBZeA== dependencies: - "@cosmjs/proto-signing" "0.32.2" - "@cosmos-kit/core" "^2.8.9" + "@cosmjs/proto-signing" "^0.32.3" + "@cosmos-kit/core" "^2.10.0" "@walletconnect/sign-client" "^2.9.0" "@walletconnect/utils" "^2.9.0" events "3.3.0" -"@cosmos-kit/web3auth@^2.5.9": - version "2.5.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/web3auth/-/web3auth-2.5.9.tgz#922a0362408e15c32871a7653151021fb2123ac1" - integrity sha512-NRt8y7KeCbB/GwYEW0wUxBSmA3fhLboOf963vcFAbABEbArit5jUmRdO9sv5nckTfF/cZ5S8M1VNx90m4K+8rA== +"@cosmos-kit/web3auth@^2.7.0": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/web3auth/-/web3auth-2.7.0.tgz#3c19be136a4cc70b2abfe5faf21b6f5417550d85" + integrity sha512-IXOQr/Pafx4qYFL8I3hc6mPCGuEUIPZtG8uMX+WtArA76tHahPQbgfvyRW5hfiwhSvfmwk+taodNjv40+/RXJQ== dependencies: - "@chain-registry/types" "0.17.0" - "@cosmos-kit/core" "^2.8.9" + "@cosmos-kit/core" "^2.10.0" "@solana/web3.js" "^1.77.3" "@toruslabs/eccrypto" "^2.1.1" "@web3auth/base" "^7.2.1" @@ -2811,19 +2797,19 @@ ethereum-cryptography "^2.1.2" url "^0.11.1" -"@cosmos-kit/xdefi-extension@^2.6.9": - version "2.6.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/xdefi-extension/-/xdefi-extension-2.6.9.tgz#d3a9938a8b907cd5ac86966fad636b9568ce13b6" - integrity sha512-TenOQOzCiYjQ+LaEkgTnwynRy7T09WK6e7FvsWFcF9HSduJvc4pUuy7Bd/oHfyMiNgeq6ccWxgkFGUh74qkAuw== +"@cosmos-kit/xdefi-extension@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/xdefi-extension/-/xdefi-extension-2.8.0.tgz#ae1b7b7f621191a091a41dde6d0cf6ab14a6e366" + integrity sha512-NFia6S2HlD4/fMxhN/p72OysKj9w2Cocdkjhz28L+A6LeiYd8mcuS3NRDBrb99jZvZzte0Gr2EPlOvvdZtSOqw== dependencies: - "@cosmos-kit/core" "^2.8.9" + "@cosmos-kit/core" "^2.10.0" -"@cosmos-kit/xdefi@^2.5.9": - version "2.5.9" - resolved "https://registry.yarnpkg.com/@cosmos-kit/xdefi/-/xdefi-2.5.9.tgz#5ec9c5eed555da4e4c7e118f1902f6fcfdc11938" - integrity sha512-GgSXDaPLBNV9AjIQkmU/NWduYJM15Qqvi2D4B6fw4aWHEsRODw15gnGQMpAvGTBtNU0iYTp7MvvvnjT1wTQxeg== +"@cosmos-kit/xdefi@^2.7.0": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/xdefi/-/xdefi-2.7.0.tgz#fdf3e00958535764aa8b65c358c9b08fde3606b4" + integrity sha512-4sMuasxJkttfVXXdhYX/mFFNI1koWZSVzXKkQu3aLj4x+lItgNMtWagFTf2Svi85lGjVSpefad6PonuHD8HBiw== dependencies: - "@cosmos-kit/xdefi-extension" "^2.6.9" + "@cosmos-kit/xdefi-extension" "^2.8.0" "@cosmostation/extension-client@0.1.15": version "0.1.15" @@ -2831,9 +2817,9 @@ integrity sha512-HlXYJjFrNpjiV/GUKhri1UL8/bhlOIFFLpRF78YDSqq16x0+plIqx5CAvEusFcKTDpVfpeD5sfUHiKvP7euNFg== "@cosmsnap/snapper@^0.1.23": - version "0.1.25" - resolved "https://registry.yarnpkg.com/@cosmsnap/snapper/-/snapper-0.1.25.tgz#612c4e5204e860a037e1036a409545b171bd129a" - integrity sha512-TVeuEpNUB8Ok+tkgKSxrxXLe1TddOezkiJW/+Xq1koLcrRU6pFZknsyh4YbzBdpMJZ8mdIq6ZyjUXKUMsdILTw== + version "0.1.29" + resolved "https://registry.yarnpkg.com/@cosmsnap/snapper/-/snapper-0.1.29.tgz#c73d43612fc1921f1fa6d050e0e9513b761c6a4f" + integrity sha512-pnCdpIJzezKSeRMZzIA9A/LZxpwvXjN8XZK3J8rlX5xrVPrYvETL0hC7KeAxnRle9LcwKqv+AwebrHrHQwpvEQ== dependencies: "@keplr-wallet/proto-types" "0.12.12" "@keplr-wallet/types" "0.12.12" @@ -2888,7 +2874,14 @@ enabled "2.0.x" kuler "^2.0.0" -"@discoveryjs/json-ext@0.5.7", "@discoveryjs/json-ext@^0.5.3": +"@dao-dao/cosmiframe@0.1.0", "@dao-dao/cosmiframe@^0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@dao-dao/cosmiframe/-/cosmiframe-0.1.0.tgz#5ba241d0c14a45d62df60cff7d48ba26844ebeac" + integrity sha512-NW4pGt1ctqDfhn/A6RU2vwnFEu3O4aBNnBMrGnw31n+L35drYNEsA9ZB7KZsHmRRlkNx+jSuJSv2Fv0BFBDDJQ== + dependencies: + uuid "^9.0.1" + +"@discoveryjs/json-ext@0.5.7", "@discoveryjs/json-ext@^0.5.0", "@discoveryjs/json-ext@^0.5.3": version "0.5.7" resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== @@ -3041,12 +3034,12 @@ "@ethereumjs/util" "^8.1.0" crc-32 "^1.2.0" -"@ethereumjs/common@^4.1.0", "@ethereumjs/common@^4.2.0": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-4.2.0.tgz#c5ccaeb71f5a9833c66ab35c22f9f965ce462ace" - integrity sha512-UWqovZQksxEY9cU+s1cF3JwFyJdKrJsURM+ORHpZZLQfsqQf+1uGbD3N0AvQ7M+Jz/LxkiVY98+Cd3OMzsrOcA== +"@ethereumjs/common@^4.1.0", "@ethereumjs/common@^4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-4.3.0.tgz#5b45eec7dcf521fa4ddaf0b383072fbcf9913553" + integrity sha512-shBNJ0ewcPNTUfZduHiczPmqkfJDn0Dh/9BR5fq7xUFTuIq7Fu1Vx00XDwQVIrpVL70oycZocOhBM6nDO+4FEQ== dependencies: - "@ethereumjs/util" "^9.0.2" + "@ethereumjs/util" "^9.0.3" "@ethereumjs/rlp@^4.0.1": version "4.0.1" @@ -3069,13 +3062,13 @@ ethereum-cryptography "^2.0.0" "@ethereumjs/tx@^5.1.0": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-5.2.1.tgz#c9965374eafebd3421bdd23b4f23f402e9a41037" - integrity sha512-BzdtUaa7KtP8T5NxJWRxo/RBoJzxYeCdx2n2C4zZLuWJBYVccfcyMiyDgr6W78Utmu/jIfGXknfh2t06+rTkiw== + version "5.3.0" + resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-5.3.0.tgz#473f351729ef4e30eaa3a3fb5aaccd4405a7ee41" + integrity sha512-uv++XYuIfuqYbvymL3/o14hHuC6zX0nRQ1nI2FHsbkkorLZ2ChEIDqVeeVk7Xc9/jQNU/22sk9qZZkRlsveXxw== dependencies: - "@ethereumjs/common" "^4.2.0" + "@ethereumjs/common" "^4.3.0" "@ethereumjs/rlp" "^5.0.2" - "@ethereumjs/util" "^9.0.2" + "@ethereumjs/util" "^9.0.3" ethereum-cryptography "^2.1.3" "@ethereumjs/util@^8.1.0": @@ -3087,10 +3080,10 @@ ethereum-cryptography "^2.0.0" micro-ftch "^0.3.1" -"@ethereumjs/util@^9.0.1", "@ethereumjs/util@^9.0.2": - version "9.0.2" - resolved "https://registry.yarnpkg.com/@ethereumjs/util/-/util-9.0.2.tgz#2719337cd43d70941491c41e3367d7b87078f847" - integrity sha512-dasKCj6Vb5spVPnNmRDFHmbfBySvokE440F0RDroPLzO4Mb4hyDqeoOMUxlbLz/BscK2pOpWUendGA+AOvGpNQ== +"@ethereumjs/util@^9.0.1", "@ethereumjs/util@^9.0.3": + version "9.0.3" + resolved "https://registry.yarnpkg.com/@ethereumjs/util/-/util-9.0.3.tgz#c2709e6127a85bbe23a71937ac78358ac93e7241" + integrity sha512-PmwzWDflky+7jlZIFqiGsBPap12tk9zK5SVH9YW2OEnDN7OEhCjUOMzbOqwuClrbkSIkM2ERivd7sXZ48Rh/vg== dependencies: "@ethereumjs/rlp" "^5.0.2" ethereum-cryptography "^2.1.3" @@ -3955,11 +3948,6 @@ dependencies: browser-headers "^0.4.1" -"@ioredis/commands@^1.1.1": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@ioredis/commands/-/commands-1.2.0.tgz#6d61b3097470af1fdbbe622795b8921d42018e11" - integrity sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg== - "@isaacs/cliui@^8.0.2": version "8.0.2" resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" @@ -4266,6 +4254,15 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" +"@jridgewell/gen-mapping@^0.3.5": + version "0.3.5" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz#dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36" + integrity sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg== + dependencies: + "@jridgewell/set-array" "^1.2.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.24" + "@jridgewell/resolve-uri@^3.0.3", "@jridgewell/resolve-uri@^3.1.0": version "3.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" @@ -4276,6 +4273,11 @@ resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== +"@jridgewell/set-array@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" + integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== + "@jridgewell/source-map@^0.3.2": version "0.3.2" resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.2.tgz#f45351aaed4527a298512ec72f81040c998580fb" @@ -4284,6 +4286,14 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" +"@jridgewell/source-map@^0.3.3": + version "0.3.6" + resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.6.tgz#9d71ca886e32502eb9362c9a74a46787c36df81a" + integrity sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ== + dependencies: + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + "@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.13", "@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.4.15": version "1.4.15" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" @@ -4305,6 +4315,14 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@jridgewell/trace-mapping@^0.3.20", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": + version "0.3.25" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" + integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@jsdevtools/ono@^7.1.3": version "7.1.3" resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" @@ -4468,9 +4486,9 @@ long "^4.0.0" "@keplr-wallet/types@^0.12.58": - version "0.12.72" - resolved "https://registry.yarnpkg.com/@keplr-wallet/types/-/types-0.12.72.tgz#0e7d35a0c4f6758aa4c89d8b2044f388031692e3" - integrity sha512-gDP+NCPa4seTT1xU9bkIKbMw7N/LPla9/4/amDLIGyFb6OEjfnFkRuReI/cZe/8aEvlkYAKnfB0UMipHobsn5g== + version "0.12.83" + resolved "https://registry.yarnpkg.com/@keplr-wallet/types/-/types-0.12.83.tgz#abab7faf9983d4200e50465b8c55bce8342f14ae" + integrity sha512-fb+Ns52EXZ+iJXwfGAJLn4MLkALuIhVv+V0ed/twzv0LqJlPYvQTeW5e/ZFRO/1UBE3T56vLQdqwvvxbuBFeUQ== dependencies: long "^4.0.0" @@ -4507,63 +4525,64 @@ bignumber.js "^9.1.2" long "^5.2.3" -"@ledgerhq/devices@^8.0.7": - version "8.0.7" - resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-8.0.7.tgz#206434dbd8a097529bbfc95f5eef94c2923c7578" - integrity sha512-BbPyET52lXnVs7CxJWrGYqmtGdbGzj+XnfCqLsDnA7QYr1CZREysxmie+Rr6BKpNDBRVesAovXjtaVaZOn+upw== +"@ledgerhq/devices@^8.3.0": + version "8.3.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-8.3.0.tgz#a1e1a21608e162fb3a512f57863bf9842b29493f" + integrity sha512-h5Scr+yIae8yjPOViCHLdMjpqn4oC2Whrsq8LinRxe48LEGMdPqSV1yY7+3Ch827wtzNpMv+/ilKnd8rY+rTlg== dependencies: - "@ledgerhq/errors" "^6.14.0" - "@ledgerhq/logs" "^6.10.1" - rxjs "6" + "@ledgerhq/errors" "^6.16.4" + "@ledgerhq/logs" "^6.12.0" + rxjs "^7.8.1" semver "^7.3.5" -"@ledgerhq/errors@^6.14.0": - version "6.14.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-6.14.0.tgz#0bf253983773ef12eebce2091f463bc719223b37" - integrity sha512-ZWJw2Ti6Dq1Ott/+qYqJdDWeZm16qI3VNG5rFlb0TQ3UcAyLIQZbnnzzdcVVwVeZiEp66WIpINd/pBdqsHVyOA== +"@ledgerhq/errors@^6.16.4": + version "6.16.4" + resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-6.16.4.tgz#a38baffe8b096d9fff3ad839cadb55704c8d8e7b" + integrity sha512-M57yFaLYSN+fZCX0E0zUqOmrV6eipK+s5RhijHoUNlHUqrsvUz7iRQgpd5gRgHB5VkIjav7KdaZjKiWGcHovaQ== "@ledgerhq/hw-app-cosmos@^6.28.1": - version "6.28.5" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-cosmos/-/hw-app-cosmos-6.28.5.tgz#ccbf7efc83f578cbb60a78c12a6c0e3cd8959c42" - integrity sha512-uaVwODERSFOSUMuhrdEygO30WsEwUXYDgyDZetqH5iAZPQ2IeuY9PjhlUIfzzMKqQ4PG3gbQmhr2BPGtSPQyAQ== + version "6.29.6" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-cosmos/-/hw-app-cosmos-6.29.6.tgz#baa64de03c9ce3dab5437814c395415730e0d43c" + integrity sha512-WjH3GMe4ppa60iwABGFx57vrvwaRYRQlsGM4kQDc64k1ZxTLv7nZ1oNOj1EgZheLfRUgCVXvntr4CmgrADyD+A== dependencies: - "@ledgerhq/errors" "^6.14.0" - "@ledgerhq/hw-transport" "^6.28.8" + "@ledgerhq/errors" "^6.16.4" + "@ledgerhq/hw-transport" "^6.30.6" bip32-path "^0.4.2" "@ledgerhq/hw-transport-webhid@^6.27.15": - version "6.27.19" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-webhid/-/hw-transport-webhid-6.27.19.tgz#5a655b497258d94ec6494db7b56e17dd0c610638" - integrity sha512-RMnktayqqLE2uFQDw9TKoW+WSP8KnT0ElKcIISf3sXVrzHD2y0moPk/wXOzGfi+cgN4uiKy86UD/5mgz3wlm6Q== + version "6.28.6" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-webhid/-/hw-transport-webhid-6.28.6.tgz#94562750136d869774cb56304573a1875ca6375f" + integrity sha512-npU1mgL97KovpTUgcdORoOZ7eVFgwCA7zt0MpgUGUMRNJWDgCFsJslx7KrVXlCGOg87gLfDojreIre502I5pYg== dependencies: - "@ledgerhq/devices" "^8.0.7" - "@ledgerhq/errors" "^6.14.0" - "@ledgerhq/hw-transport" "^6.28.8" - "@ledgerhq/logs" "^6.10.1" + "@ledgerhq/devices" "^8.3.0" + "@ledgerhq/errors" "^6.16.4" + "@ledgerhq/hw-transport" "^6.30.6" + "@ledgerhq/logs" "^6.12.0" "@ledgerhq/hw-transport-webusb@^6.27.15": - version "6.27.19" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-webusb/-/hw-transport-webusb-6.27.19.tgz#30a95c2122bcab6709665fda700276622087a930" - integrity sha512-M93sCyYREk8jCW/o7D/Ey+GQl38IALc0AY5WLKghzyjgqdPNo0x3j7CuTFJXiMWl5Mh8YDsO/MY8kkG9tuMvKQ== - dependencies: - "@ledgerhq/devices" "^8.0.7" - "@ledgerhq/errors" "^6.14.0" - "@ledgerhq/hw-transport" "^6.28.8" - "@ledgerhq/logs" "^6.10.1" - -"@ledgerhq/hw-transport@^6.28.8": - version "6.28.8" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.28.8.tgz#f99a5c71c5c09591e9bfb1b970c42aafbe81351f" - integrity sha512-XxQVl4htd018u/M66r0iu5nlHi+J6QfdPsORzDF6N39jaz+tMqItb7tUlXM/isggcuS5lc7GJo7NOuJ8rvHZaQ== - dependencies: - "@ledgerhq/devices" "^8.0.7" - "@ledgerhq/errors" "^6.14.0" + version "6.28.6" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-webusb/-/hw-transport-webusb-6.28.6.tgz#c17c193578da112ef76769e4ce72129d40d87faa" + integrity sha512-rzICsvhcFcL4wSAvRPe+b9EEWB8cxj6yWy3FZdfs7ufi/0muNpFXWckWv1TC34em55sGXu2cMcwMKXg/O/Lc0Q== + dependencies: + "@ledgerhq/devices" "^8.3.0" + "@ledgerhq/errors" "^6.16.4" + "@ledgerhq/hw-transport" "^6.30.6" + "@ledgerhq/logs" "^6.12.0" + +"@ledgerhq/hw-transport@^6.30.6": + version "6.30.6" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.30.6.tgz#c6d84672ac4828f311831998f4101ea205215a6d" + integrity sha512-fT0Z4IywiuJuZrZE/+W0blkV5UCotDPFTYKLkKCLzYzuE6javva7D/ajRaIeR+hZ4kTmKF4EqnsmDCXwElez+w== + dependencies: + "@ledgerhq/devices" "^8.3.0" + "@ledgerhq/errors" "^6.16.4" + "@ledgerhq/logs" "^6.12.0" events "^3.3.0" -"@ledgerhq/logs@^6.10.1": - version "6.10.1" - resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-6.10.1.tgz#5bd16082261d7364eabb511c788f00937dac588d" - integrity sha512-z+ILK8Q3y+nfUl43ctCPuR4Y2bIxk/ooCQFwZxhtci1EhAtMDzMAx2W25qx8G1PPL9UUOdnUax19+F0OjXoj4w== +"@ledgerhq/logs@^6.12.0": + version "6.12.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-6.12.0.tgz#ad903528bf3687a44da435d7b2479d724d374f5d" + integrity sha512-ExDoj1QV5eC6TEbMdLUMMk9cfvNKhhv5gXol4SmULRVCx/3iyCPhJ74nsb3S0Vb+/f+XujBEj3vQn5+cwS0fNA== "@lerna/add@6.4.1": version "6.4.1" @@ -5304,21 +5323,21 @@ superstruct "^1.0.3" "@metamask/eth-sig-util@^7.0.1": - version "7.0.1" - resolved "https://registry.yarnpkg.com/@metamask/eth-sig-util/-/eth-sig-util-7.0.1.tgz#ad3227d6120f15f9293478de7dd9685a5c329586" - integrity sha512-59GSrMyFH2fPfu7nKeIQdZ150zxXNNhAQIUaFRUW+MGtVA4w/ONbiQobcRBLi+jQProfIyss51G8pfLPcQ0ylg== + version "7.0.2" + resolved "https://registry.yarnpkg.com/@metamask/eth-sig-util/-/eth-sig-util-7.0.2.tgz#741de634b0d6ca96ce1ee3d064ac6a27756d8d21" + integrity sha512-DhTDMNEtED0ihIc4Tysm6qUJTvArCdgSTeeJWdo526W/cAk5mrSAvEYYgv8idAiBumDtcPWGimMTaB7MvY64bg== dependencies: "@ethereumjs/util" "^8.1.0" "@metamask/abi-utils" "^2.0.2" "@metamask/utils" "^8.1.0" + "@scure/base" "~1.1.3" ethereum-cryptography "^2.1.2" tweetnacl "^1.0.3" - tweetnacl-util "^0.15.1" "@metamask/object-multiplex@^1.1.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@metamask/object-multiplex/-/object-multiplex-1.2.0.tgz#38fc15c142f61939391e1b9a8eed679696c7e4f4" - integrity sha512-hksV602d3NWE2Q30Mf2Np1WfVKaGqfJRy9vpHAmelbaD0OkDt06/0KQkRR6UVYdMbTbkuEu8xN5JDUU80inGwQ== + version "1.3.0" + resolved "https://registry.yarnpkg.com/@metamask/object-multiplex/-/object-multiplex-1.3.0.tgz#459de4862aa5a5a025dabceadda0ffd553ca4b25" + integrity sha512-czcQeVYdSNtabd+NcYQnrM69MciiJyd1qvKH8WM2Id3C0ZiUUX5Xa/MK+/VUk633DBhVOwdNzAKIQ33lGyA+eQ== dependencies: end-of-stream "^1.4.4" once "^1.4.0" @@ -5355,14 +5374,14 @@ integrity sha512-/kSXhY692qiV1MXu6EeOZvg5nECLclxNXcKCxJ3cXQgYuRymRHpdx/t7JXfsK+JLjwA1e1c1/SBrlQYpusC29Q== "@metamask/safe-event-emitter@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@metamask/safe-event-emitter/-/safe-event-emitter-3.0.0.tgz#8c2b9073fe0722d48693143b0dc8448840daa3bd" - integrity sha512-j6Z47VOmVyGMlnKXZmL0fyvWfEYtKWCA9yGZkU3FCsGZUT5lHGmvaV9JA5F2Y+010y7+ROtR3WMXIkvl/nVzqQ== + version "3.1.1" + resolved "https://registry.yarnpkg.com/@metamask/safe-event-emitter/-/safe-event-emitter-3.1.1.tgz#e89b840a7af8097a8ed4953d8dc8470d1302d3ef" + integrity sha512-ihb3B0T/wJm1eUuArYP4lCTSEoZsClHhuWyfo/kMX3m/odpqNcPfsz5O2A3NT7dXCAgWPGDQGPqygCpgeniKMw== "@metamask/utils@^8.0.0", "@metamask/utils@^8.1.0", "@metamask/utils@^8.3.0": - version "8.3.0" - resolved "https://registry.yarnpkg.com/@metamask/utils/-/utils-8.3.0.tgz#a20de447aeb9ffb75924d822a186a597033984b6" - integrity sha512-WFVcMPEkKKRCJ8DDkZUTVbLlpwgRn98F4VM/WzN89HM8PmHMnCyk/oG0AmK/seOxtik7uC7Bbi2YBC5Z5XB2zw== + version "8.4.0" + resolved "https://registry.yarnpkg.com/@metamask/utils/-/utils-8.4.0.tgz#f44812c96467a4e1b70b2edff6ee89a9caa4e354" + integrity sha512-dbIc3C7alOe0agCuBHM1h71UaEaEqOk2W8rAtEn8QGz4haH2Qq7MoK6i7v2guzvkJVVh79c+QCzIqphC3KvrJg== dependencies: "@ethereumjs/tx" "^4.2.0" "@noble/hashes" "^1.3.1" @@ -5372,6 +5391,7 @@ pony-cause "^2.1.10" semver "^7.5.4" superstruct "^1.0.3" + uuid "^9.0.1" "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1" @@ -5545,18 +5565,30 @@ resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.3.0.tgz#db7b55fee834dc8c2c484c696469e65bae2ee770" integrity sha512-Reer6rkLLcoOvB0dd66+Y7WrWVFH7sEEkF/4bJCIfsSKnTStTYaHtwIJAwbqnt9I392Tqvku0KkoqZOryWV9LQ== -"@noble/curves@1.3.0", "@noble/curves@^1.0.0", "@noble/curves@~1.3.0": +"@noble/curves@1.3.0", "@noble/curves@~1.3.0": version "1.3.0" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.3.0.tgz#01be46da4fd195822dab821e72f71bf4aeec635e" integrity sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA== dependencies: "@noble/hashes" "1.3.3" -"@noble/hashes@1.3.3", "@noble/hashes@^1", "@noble/hashes@^1.0.0", "@noble/hashes@^1.2.0", "@noble/hashes@^1.3.1", "@noble/hashes@~1.3.2": +"@noble/curves@^1.0.0", "@noble/curves@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.4.0.tgz#f05771ef64da724997f69ee1261b2417a49522d6" + integrity sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg== + dependencies: + "@noble/hashes" "1.4.0" + +"@noble/hashes@1.3.3", "@noble/hashes@~1.3.2": version "1.3.3" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.3.tgz#39908da56a4adc270147bb07968bf3b16cfe1699" integrity sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA== +"@noble/hashes@1.4.0", "@noble/hashes@^1", "@noble/hashes@^1.0.0", "@noble/hashes@^1.2.0", "@noble/hashes@^1.3.1", "@noble/hashes@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" + integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -6302,10 +6334,10 @@ resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.1.4.tgz#0c8b74c50f29ee44f423f7416829c0bf8bb5eb27" integrity sha512-LwzQKA4vzIct1zNZzBmRKI9QuNpLgTQMEjsQLf3BXuGYb3QPTP4Yjf6mkdX+X1mYttZ808QpOwAzZjv28kq7DA== -"@scure/base@^1.1.3", "@scure/base@~1.1.4": - version "1.1.5" - resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.5.tgz#1d85d17269fe97694b9c592552dd9e5e33552157" - integrity sha512-Brj9FiG2W1MRQSTB212YVPRrcbjkv48FoZi/u4l/zds/ieRrqsh7aUf6CLwkAq61oKXr/ZlTzlY66gLIj3TFTQ== +"@scure/base@^1.1.3", "@scure/base@~1.1.3", "@scure/base@~1.1.4": + version "1.1.6" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.6.tgz#8ce5d304b436e4c84f896e0550c83e4d88cb917d" + integrity sha512-ok9AWwhcgYuGG3Zfhyqg+zwl+Wn5uE+dwC0NV/2qQkx4dABbb/bx96vWu8NSj+BNjjSjno+JRYRjle1jV08k3g== "@scure/bip32@1.3.3": version "1.3.3" @@ -6512,18 +6544,18 @@ tslib "^2.5.0" "@socket.io/component-emitter@~3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz#96116f2a912e0c02817345b3c10751069920d553" - integrity sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg== + version "3.1.2" + resolved "https://registry.yarnpkg.com/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz#821f8442f4175d8f0467b9daf26e3a18e2d02af2" + integrity sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA== -"@solana/buffer-layout@^4.0.0": +"@solana/buffer-layout@^4.0.0", "@solana/buffer-layout@^4.0.1": version "4.0.1" resolved "https://registry.yarnpkg.com/@solana/buffer-layout/-/buffer-layout-4.0.1.tgz#b996235eaec15b1e0b5092a8ed6028df77fa6c15" integrity sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA== dependencies: buffer "~6.0.3" -"@solana/web3.js@^1.75.0", "@solana/web3.js@^1.77.3": +"@solana/web3.js@^1.75.0": version "1.78.4" resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.78.4.tgz#e8ca9abe4ec2af5fc540c1d272efee24aaffedb3" integrity sha512-up5VG1dK+GPhykmuMIozJZBbVqpm77vbOG6/r5dS7NBGZonwHfTLdBbsYc3rjmaQ4DpCXUa3tUc4RZHRORvZrw== @@ -6544,6 +6576,27 @@ rpc-websockets "^7.5.1" superstruct "^0.14.2" +"@solana/web3.js@^1.77.3": + version "1.91.8" + resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.91.8.tgz#0d5eb69626a92c391b53e15bfbb0bad3f6858e51" + integrity sha512-USa6OS1jbh8zOapRJ/CBZImZ8Xb7AJjROZl5adql9TpOoBN9BUzyyouS5oPuZHft7S7eB8uJPuXWYjMi6BHgOw== + dependencies: + "@babel/runtime" "^7.24.5" + "@noble/curves" "^1.4.0" + "@noble/hashes" "^1.4.0" + "@solana/buffer-layout" "^4.0.1" + agentkeepalive "^4.5.0" + bigint-buffer "^1.1.5" + bn.js "^5.2.1" + borsh "^0.7.0" + bs58 "^4.0.1" + buffer "6.0.3" + fast-stable-stringify "^1.0.0" + jayson "^4.1.0" + node-fetch "^2.7.0" + rpc-websockets "^7.11.0" + superstruct "^0.14.2" + "@stablelib/aead@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@stablelib/aead/-/aead-1.0.1.tgz#c4b1106df9c23d1b867eb9b276d8f42d5fc4c0c3" @@ -7687,13 +7740,13 @@ lodash.merge "^4.6.2" "@terra-money/feather.js@^1.0.8": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@terra-money/feather.js/-/feather.js-1.0.11.tgz#be8368b1673f595c4bece7e15f9d245fd01fb0c0" - integrity sha512-oHXSwbbUyEw7r5r9OJMEGz/U/+KTk5IUiIJd0Oaani2FnMhdqnoEEJYGGf2+IvIMdsktzgwoXzFOOAL+Ah9q/g== + version "1.2.1" + resolved "https://registry.yarnpkg.com/@terra-money/feather.js/-/feather.js-1.2.1.tgz#e89f615aa3628a8e87720c161cecc4ae402a057f" + integrity sha512-OyXkWriNwb0lCF45eMmtjdOPEmfGKJxgGSnxpM7VxD0Vqr1qqtlcYyQG9wOHXNQrExvZv+uo922B2ZA4S77HsQ== dependencies: "@ethersproject/bytes" "^5.7.0" "@terra-money/legacy.proto" "npm:@terra-money/terra.proto@^0.1.7" - "@terra-money/terra.proto" "^3.1.0-alpha.1" + "@terra-money/terra.proto" "^4.0.3" assert "^2.0.0" axios "^0.27.2" bech32 "^2.0.0" @@ -7721,19 +7774,20 @@ long "^4.0.0" protobufjs "~6.11.2" -"@terra-money/station-connector@^1.0.5": - version "1.0.15" - resolved "https://registry.yarnpkg.com/@terra-money/station-connector/-/station-connector-1.0.15.tgz#1a0472040acec086d00a165892e335b012dd9fa1" - integrity sha512-iCLXPPmQXyP8egOi7FA3U5MuEeMMrVnUaRiCUrBLuh4QNPCmJar082ilKDEavgkczKXNIqEGCAAT0LVrky/TPA== +"@terra-money/station-connector@^1.1.0": + version "1.1.4" + resolved "https://registry.yarnpkg.com/@terra-money/station-connector/-/station-connector-1.1.4.tgz#9b812814e471e49d035e92f1b822f070b121b373" + integrity sha512-0xQ1haSJnY6ltjhptFoVa1yhNUIBsbCAEQCUukSY93GSo6tt+DN4RAku9i1ulfY/UizXnxH/mn+6aJyTCZGGcg== dependencies: bech32 "^2.0.0" -"@terra-money/terra.proto@^3.1.0-alpha.1": - version "3.1.0-alpha.1" - resolved "https://registry.yarnpkg.com/@terra-money/terra.proto/-/terra.proto-3.1.0-alpha.1.tgz#b2009b54609db7d7c1a9d61b1b05770a5e3ecc9d" - integrity sha512-aMgfEVqEPh8PUGHM8GVsgVMVLnWHuPHCA+8gfBjZ8vcC0UJYafB6jirRSMd7CRuRbkepE70eRqVt8ip35QBx2A== +"@terra-money/terra.proto@^4.0.3": + version "4.0.10" + resolved "https://registry.yarnpkg.com/@terra-money/terra.proto/-/terra.proto-4.0.10.tgz#a5c5edce2f4a4eab046bf740edde871874443d10" + integrity sha512-cSTGri/X7r+RjTHKQ40lUDM7+lwWIiodLmBvuCUWMH8svji0D45StZTVGfaQ5wCnPr7KcDbZTERzyLKiSwsBqg== dependencies: "@improbable-eng/grpc-web" "^0.14.1" + browser-headers "^0.4.1" google-protobuf "^3.17.3" long "^4.0.0" protobufjs "~6.11.2" @@ -7764,12 +7818,12 @@ lodash "^4.17.21" loglevel "^1.8.1" -"@toruslabs/base-session-manager@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@toruslabs/base-session-manager/-/base-session-manager-3.0.0.tgz#4302d0747ef71a8278af79e577cf53253c907cd5" - integrity sha512-+EqwizmSFkVEczUtaw+swbAxRIIxC/EaFE040rwfgC5fixaQMNLw2cVYXWN67Ra47wC9A7Om6xwQTuGFR+dy4w== +"@toruslabs/base-session-manager@^3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@toruslabs/base-session-manager/-/base-session-manager-3.1.1.tgz#1f115bb4abe788c6d7da795ae8058e143feaf495" + integrity sha512-/awg0VbJcfcdJTB2zYdnoFkNGOioODvBc7i3vfxR6lRpFvVwndYPwbD870bgRiSUt9hSee8pSfokejnjDZGpew== dependencies: - "@toruslabs/http-helpers" "^5.0.0" + "@toruslabs/http-helpers" "^6.1.0" "@toruslabs/broadcast-channel@^9.0.1": version "9.0.1" @@ -7786,9 +7840,9 @@ unload "^2.4.1" "@toruslabs/constants@^13.1.0": - version "13.1.0" - resolved "https://registry.yarnpkg.com/@toruslabs/constants/-/constants-13.1.0.tgz#f1077a6654d98c0444fb0831f479007fb5cff79d" - integrity sha512-W1LyRoM5xCTyNivGnxa+mOit4yWPZjyYHfM+whYBujP1nQVnJ09nSFCBn1ePm6ONxB5mp58jsI3TJugeY2KFSg== + version "13.3.0" + resolved "https://registry.yarnpkg.com/@toruslabs/constants/-/constants-13.3.0.tgz#8ac8172be09cd0ac30224c1e5b3fbee4458d8ca0" + integrity sha512-i/fX5DeEUj4EoQmFT8YdO8bwN7Na83zZq6RrSmOpRmVA0F7MMbUsxhsvAp/kOmceg0lU1ZHQTTJRmh7OTExaIw== "@toruslabs/eccrypto@^2.1.1": version "2.2.1" @@ -7812,35 +7866,24 @@ lodash.merge "^4.6.2" loglevel "^1.8.1" -"@toruslabs/http-helpers@^6.0.0": - version "6.0.0" - resolved "https://registry.yarnpkg.com/@toruslabs/http-helpers/-/http-helpers-6.0.0.tgz#2130bd92c3891a03f9d5f7664fa649ea948e8f59" - integrity sha512-/KrISB9fGV2TM+5Z+0CGj24d/G08kqbB+kodO3nbwNcS0a55dpy+RiB0naF3H1gbEt4Ah5YH8qCDyAZ+zcR2FQ== +"@toruslabs/http-helpers@^6.0.0", "@toruslabs/http-helpers@^6.1.0": + version "6.1.1" + resolved "https://registry.yarnpkg.com/@toruslabs/http-helpers/-/http-helpers-6.1.1.tgz#0869fe78a31c8a6b5d9447f353e1b59700ee00ec" + integrity sha512-bJYOaltRzklzObhRdutT1wau17vXyrCCBKJOeN46F1t99MUXi5udQNeErFOcr9qBsvrq2q67eVBkU5XOeBMX5A== dependencies: lodash.merge "^4.6.2" - loglevel "^1.8.1" + loglevel "^1.9.1" -"@toruslabs/metadata-helpers@5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@toruslabs/metadata-helpers/-/metadata-helpers-5.0.0.tgz#12be5de4e8a5d1af2dd080bdf05f5ad8953aaae7" - integrity sha512-ZUFfOHJVJC53c8wJYHjdF3bIgN2ZvfqehbTZ/zJ7oVFfrrd6O66V3gQ1i1zxBjH3yhOvZKQwc0DaMmh3G0NUXQ== - dependencies: - "@toruslabs/eccrypto" "^4.0.0" - "@toruslabs/http-helpers" "^5.0.0" - elliptic "^6.5.4" - ethereum-cryptography "^2.1.2" - json-stable-stringify "^1.0.2" - -"@toruslabs/metadata-helpers@^5.0.0": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@toruslabs/metadata-helpers/-/metadata-helpers-5.0.1.tgz#e2167c6d49754ffaa3fe36c4319d68a2d0e7cfb4" - integrity sha512-W3PcM8uluKDCJXKG/LdJ72irfTodOtU9dnES/rYfalhb0edaWwRb6SMULHpl2NxytY9ykrL6uPv+90BSMWH9VQ== +"@toruslabs/metadata-helpers@5.1.0", "@toruslabs/metadata-helpers@^5.0.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@toruslabs/metadata-helpers/-/metadata-helpers-5.1.0.tgz#a7a73c96b8afc3aaf9fa6b277218d4828c2f97a5" + integrity sha512-7fdqKuWUaJT/ng+PlqrA4XKkn8Dij4JJozfv/4gHTi0f/6JFncpzIces09jTV70hCf0JIsTCvIDlzKOdJ+aeZg== dependencies: "@toruslabs/eccrypto" "^4.0.0" - "@toruslabs/http-helpers" "^5.0.0" - elliptic "^6.5.4" - ethereum-cryptography "^2.1.2" - json-stable-stringify "^1.0.2" + "@toruslabs/http-helpers" "^6.1.0" + elliptic "^6.5.5" + ethereum-cryptography "^2.1.3" + json-stable-stringify "^1.1.1" "@toruslabs/openlogin-ed25519@^6.0.0": version "6.0.0" @@ -7864,13 +7907,13 @@ readable-stream "^4.5.2" "@toruslabs/openlogin-session-manager@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@toruslabs/openlogin-session-manager/-/openlogin-session-manager-3.0.0.tgz#2f13af3ef96ddda48803a0265a798cffc3c9f78c" - integrity sha512-S+nnZQ+Y+XCHvTYaov3ltiV2hAAPpKpwxvB4TmbMvi7KWOZ8BcUJQykSITlIXV4aE5y5BD96rsmjQ3C3MyVtUQ== + version "3.1.1" + resolved "https://registry.yarnpkg.com/@toruslabs/openlogin-session-manager/-/openlogin-session-manager-3.1.1.tgz#45801bbd7dcf4a18f6266de2a61cc95bbca870d7" + integrity sha512-hikBX7CdiWCTNNfsiacPM9O+2Ysf6ULcn9E4og9BVSt4brduUQoa9ioNY6G5m0eH/xQCzRsLpSRGNuOPTBJm3w== dependencies: - "@toruslabs/base-session-manager" "^3.0.0" + "@toruslabs/base-session-manager" "^3.1.1" "@toruslabs/eccrypto" "^4.0.0" - "@toruslabs/metadata-helpers" "5.0.0" + "@toruslabs/metadata-helpers" "5.1.0" "@toruslabs/openlogin-utils@^6.2.11": version "6.2.11" @@ -7975,9 +8018,9 @@ "@babel/types" "^7.3.0" "@types/connect@^3.4.33": - version "3.4.36" - resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.36.tgz#e511558c15a39cb29bd5357eebb57bd1459cd1ab" - integrity sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w== + version "3.4.38" + resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.38.tgz#5ba7f3bc4fbbdeaff8dded952e5ff2cc53f8d858" + integrity sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug== dependencies: "@types/node" "*" @@ -7988,13 +8031,20 @@ dependencies: "@types/node" "*" -"@types/debug@^4.0.0", "@types/debug@^4.1.7": +"@types/debug@^4.0.0": version "4.1.8" resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.8.tgz#cef723a5d0a90990313faec2d1e22aee5eecb317" integrity sha512-/vPO1EPOs306Cvhwv7KfVfYvOJqA/S/AXjaHQiJboCZzcNDb+TIJFN9/2C9DZ//ijSKWioNyUxD792QmDJ+HKQ== dependencies: "@types/ms" "*" +"@types/debug@^4.1.7": + version "4.1.12" + resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.12.tgz#a155f21690871953410df4b6b6f53187f0500917" + integrity sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ== + dependencies: + "@types/ms" "*" + "@types/eslint-scope@^3.7.3": version "3.7.3" resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.3.tgz#125b88504b61e3c8bc6f870882003253005c3224" @@ -8011,7 +8061,7 @@ "@types/estree" "*" "@types/json-schema" "*" -"@types/estree@*", "@types/estree@^1.0.0": +"@types/estree@*", "@types/estree@^1.0.0", "@types/estree@^1.0.5": version "1.0.5" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== @@ -8200,9 +8250,9 @@ integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== "@types/ms@*": - version "0.7.31" - resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197" - integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA== + version "0.7.34" + resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.34.tgz#10964ba0dee6ac4cd462e2795b6bebd407303433" + integrity sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g== "@types/node-fetch@^2.5.7": version "2.6.2" @@ -8213,9 +8263,11 @@ form-data "^3.0.0" "@types/node@*", "@types/node@>=13.7.0": - version "20.5.9" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.5.9.tgz#a70ec9d8fa0180a314c3ede0e20ea56ff71aed9a" - integrity sha512-PcGNd//40kHAS3sTlzKB9C9XL4K0sTup8nbG5lC14kzEteTNuAFh9u5nA0o5TWnSG2r/JNPRXFVcHJIIeRlmqQ== + version "20.12.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.8.tgz#35897bf2bfe3469847ab04634636de09552e8256" + integrity sha512-NU0rJLJnshZWdE/097cdCBbyW1h4hEg0xpovcoAQYHl8dnEyp/NAOiE45pvc+Bd1Dt+2r94v2eGFpQJ4R7g+2w== + dependencies: + undici-types "~5.26.4" "@types/node@10.12.18": version "10.12.18" @@ -8654,25 +8706,26 @@ "@walletconnect/window-metadata" "1.0.0" detect-browser "5.2.0" -"@walletconnect/core@2.10.0": - version "2.10.0" - resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-2.10.0.tgz#b659de4dfb374becd938964abd4f2150d410e617" - integrity sha512-Z8pdorfIMueuiBXLdnf7yloiO9JIiobuxN3j0OTal+MYc4q5/2O7d+jdD1DAXbLi1taJx3x60UXT/FPVkjIqIQ== +"@walletconnect/core@2.12.2": + version "2.12.2" + resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-2.12.2.tgz#12bd568b90daed876e58ebcc098c12843a3321e6" + integrity sha512-7Adv/b3pp9F42BkvReaaM4KS8NEvlkS7AMtwO3uF/o6aRMKtcfTJq9/jgWdKJh4RP8pPRTRFjCw6XQ/RZtT4aQ== dependencies: "@walletconnect/heartbeat" "1.2.1" "@walletconnect/jsonrpc-provider" "1.0.13" "@walletconnect/jsonrpc-types" "1.0.3" "@walletconnect/jsonrpc-utils" "1.0.8" - "@walletconnect/jsonrpc-ws-connection" "1.0.13" - "@walletconnect/keyvaluestorage" "^1.0.2" - "@walletconnect/logger" "^2.0.1" + "@walletconnect/jsonrpc-ws-connection" "1.0.14" + "@walletconnect/keyvaluestorage" "^1.1.1" + "@walletconnect/logger" "^2.1.2" "@walletconnect/relay-api" "^1.0.9" "@walletconnect/relay-auth" "^1.0.4" "@walletconnect/safe-json" "^1.0.2" "@walletconnect/time" "^1.0.2" - "@walletconnect/types" "2.10.0" - "@walletconnect/utils" "2.10.0" + "@walletconnect/types" "2.12.2" + "@walletconnect/utils" "2.12.2" events "^3.3.0" + isomorphic-unfetch "3.1.0" lodash.isequal "4.5.0" uint8arrays "^3.1.0" @@ -8726,18 +8779,17 @@ "@walletconnect/jsonrpc-types" "^1.0.3" tslib "1.14.1" -"@walletconnect/jsonrpc-ws-connection@1.0.13": - version "1.0.13" - resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-ws-connection/-/jsonrpc-ws-connection-1.0.13.tgz#23b0cdd899801bfbb44a6556936ec2b93ef2adf4" - integrity sha512-mfOM7uFH4lGtQxG+XklYuFBj6dwVvseTt5/ahOkkmpcAEgz2umuzu7fTR+h5EmjQBdrmYyEBOWADbeaFNxdySg== +"@walletconnect/jsonrpc-ws-connection@1.0.14": + version "1.0.14" + resolved "https://registry.yarnpkg.com/@walletconnect/jsonrpc-ws-connection/-/jsonrpc-ws-connection-1.0.14.tgz#eec700e74766c7887de2bd76c91a0206628732aa" + integrity sha512-Jsl6fC55AYcbkNVkwNM6Jo+ufsuCQRqViOQ8ZBPH9pRREHH9welbBiszuTLqEJiQcO/6XfFDl6bzCJIkrEi8XA== dependencies: "@walletconnect/jsonrpc-utils" "^1.0.6" "@walletconnect/safe-json" "^1.0.2" events "^3.3.0" - tslib "1.14.1" ws "^7.5.1" -"@walletconnect/keyvaluestorage@^1.0.2", "@walletconnect/keyvaluestorage@^1.1.1": +"@walletconnect/keyvaluestorage@^1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@walletconnect/keyvaluestorage/-/keyvaluestorage-1.1.1.tgz#dd2caddabfbaf80f6b8993a0704d8b83115a1842" integrity sha512-V7ZQq2+mSxAq7MrRqDxanTzu2RcElfK1PfNYiaVnJgJ7Q7G7hTVwF8voIBx92qsRyGHZihrwNPHuZd1aKkd0rA== @@ -8746,21 +8798,20 @@ idb-keyval "^6.2.1" unstorage "^1.9.0" -"@walletconnect/logger@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@walletconnect/logger/-/logger-2.0.1.tgz#7f489b96e9a1ff6bf3e58f0fbd6d69718bf844a8" - integrity sha512-SsTKdsgWm+oDTBeNE/zHxxr5eJfZmE9/5yp/Ku+zJtcTAjELb3DXueWkDXmE9h8uHIbJzIb5wj5lPdzyrjT6hQ== +"@walletconnect/logger@^2.0.1", "@walletconnect/logger@^2.1.2": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@walletconnect/logger/-/logger-2.1.2.tgz#813c9af61b96323a99f16c10089bfeb525e2a272" + integrity sha512-aAb28I3S6pYXZHQm5ESB+V6rDqIYfsnHaQyzFbwUUBFY4H0OXx/YtTl8lvhUNhMMfb9UxbwEBS253TlXUYJWSw== dependencies: + "@walletconnect/safe-json" "^1.0.2" pino "7.11.0" - tslib "1.14.1" "@walletconnect/relay-api@^1.0.9": - version "1.0.9" - resolved "https://registry.yarnpkg.com/@walletconnect/relay-api/-/relay-api-1.0.9.tgz#f8c2c3993dddaa9f33ed42197fc9bfebd790ecaf" - integrity sha512-Q3+rylJOqRkO1D9Su0DPE3mmznbAalYapJ9qmzDgK28mYF9alcP3UwG/og5V7l7CFOqzCLi7B8BvcBUrpDj0Rg== + version "1.0.10" + resolved "https://registry.yarnpkg.com/@walletconnect/relay-api/-/relay-api-1.0.10.tgz#5aef3cd07c21582b968136179aa75849dcc65499" + integrity sha512-tqrdd4zU9VBNqUaXXQASaexklv6A54yEyQQEXYOCr+Jz8Ket0dmPBDyg19LVSNUN2cipAghQc45/KVmfFJ0cYw== dependencies: "@walletconnect/jsonrpc-types" "^1.0.2" - tslib "1.14.1" "@walletconnect/relay-auth@^1.0.4": version "1.0.4" @@ -8787,18 +8838,18 @@ tslib "1.14.1" "@walletconnect/sign-client@^2.9.0": - version "2.10.0" - resolved "https://registry.yarnpkg.com/@walletconnect/sign-client/-/sign-client-2.10.0.tgz#0fee8f12821e37783099f0c7bd64e6efdfbd9d86" - integrity sha512-hbDljDS53kR/It3oXD91UkcOsT6diNnW5+Zzksm0YEfwww5dop/YfNlcdnc8+jKUhWOL/YDPNQCjzsCSNlVzbw== + version "2.12.2" + resolved "https://registry.yarnpkg.com/@walletconnect/sign-client/-/sign-client-2.12.2.tgz#10cddcba3740f726149c33ef1a9040a808d65e08" + integrity sha512-cM0ualXj6nVvLqS4BDNRk+ZWR+lubcsz/IHreH+3wYrQ2sV+C0fN6ctrd7MMGZss0C0qacWCx0pm62ZBuoKvqA== dependencies: - "@walletconnect/core" "2.10.0" + "@walletconnect/core" "2.12.2" "@walletconnect/events" "^1.0.1" "@walletconnect/heartbeat" "1.2.1" "@walletconnect/jsonrpc-utils" "1.0.8" - "@walletconnect/logger" "^2.0.1" + "@walletconnect/logger" "^2.1.2" "@walletconnect/time" "^1.0.2" - "@walletconnect/types" "2.10.0" - "@walletconnect/utils" "2.10.0" + "@walletconnect/types" "2.12.2" + "@walletconnect/utils" "2.12.2" events "^3.3.0" "@walletconnect/time@^1.0.2": @@ -8808,18 +8859,6 @@ dependencies: tslib "1.14.1" -"@walletconnect/types@2.10.0": - version "2.10.0" - resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-2.10.0.tgz#5d63235b49e03d609521402a4b49627dbc4ed514" - integrity sha512-kSTA/WZnbKdEbvbXSW16Ty6dOSzOZCHnGg6JH7q1MuraalD2HuNg00lVVu7QAZ/Rj1Gn9DAkrgP5Wd5a8Xq//Q== - dependencies: - "@walletconnect/events" "^1.0.1" - "@walletconnect/heartbeat" "1.2.1" - "@walletconnect/jsonrpc-types" "1.0.3" - "@walletconnect/keyvaluestorage" "^1.0.2" - "@walletconnect/logger" "^2.0.1" - events "^3.3.0" - "@walletconnect/types@2.11.0": version "2.11.0" resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-2.11.0.tgz#474a009c56faa9ef4063b76ed84415c801dc9f1e" @@ -8832,10 +8871,10 @@ "@walletconnect/logger" "^2.0.1" events "^3.3.0" -"@walletconnect/types@2.11.2": - version "2.11.2" - resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-2.11.2.tgz#d0359dd4106fcaa1634241a00428d3ea08d0d3c7" - integrity sha512-p632MFB+lJbip2cvtXPBQslpUdiw1sDtQ5y855bOlAGquay+6fZ4h1DcDePeKQDQM3P77ax2a9aNPZxV6y/h1Q== +"@walletconnect/types@2.12.2": + version "2.12.2" + resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-2.12.2.tgz#8b64a2015a0a96972d28acb2ff317a9a994abfdb" + integrity sha512-9CmwTlPbrFTzayTL9q7xM7s3KTJkS6kYFtH2m1/fHFgALs6pIUjf1qAx1TF2E4tv7SEzLAIzU4NqgYUt2vWXTg== dependencies: "@walletconnect/events" "^1.0.1" "@walletconnect/heartbeat" "1.2.1" @@ -8849,10 +8888,10 @@ resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-1.8.0.tgz#3f5e85b2d6b149337f727ab8a71b8471d8d9a195" integrity sha512-Cn+3I0V0vT9ghMuzh1KzZvCkiAxTq+1TR2eSqw5E5AVWfmCtECFkVZBP6uUJZ8YjwLqXheI+rnjqPy7sVM4Fyg== -"@walletconnect/utils@2.10.0": - version "2.10.0" - resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.10.0.tgz#6918d12180d797b8bd4a19fb2ff128e394e181d6" - integrity sha512-9GRyEz/7CJW+G04RvrjPET5k7hOEsB9b3fF9cWDk/iDCxSWpbkU/hv/urRB36C+gvQMAZgIZYX3dHfzJWkY/2g== +"@walletconnect/utils@2.12.2", "@walletconnect/utils@^2.11.0", "@walletconnect/utils@^2.9.0": + version "2.12.2" + resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.12.2.tgz#a2c349d4effef7c1c5e72e74a5483d8dfbb10918" + integrity sha512-zf50HeS3SfoLv1N9GPl2IXTZ9TsXfet4usVAsZmX9P6/Xzq7d/7QakjVQCHH/Wk1O9XkcsfeoZoUhRxoMJ5uJw== dependencies: "@stablelib/chacha20poly1305" "1.0.1" "@stablelib/hkdf" "1.0.1" @@ -8862,27 +8901,7 @@ "@walletconnect/relay-api" "^1.0.9" "@walletconnect/safe-json" "^1.0.2" "@walletconnect/time" "^1.0.2" - "@walletconnect/types" "2.10.0" - "@walletconnect/window-getters" "^1.0.1" - "@walletconnect/window-metadata" "^1.0.1" - detect-browser "5.3.0" - query-string "7.1.3" - uint8arrays "^3.1.0" - -"@walletconnect/utils@^2.11.0", "@walletconnect/utils@^2.9.0": - version "2.11.2" - resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.11.2.tgz#dee0f19adf5e38543612cbe9fa4de7ed28eb7e85" - integrity sha512-LyfdmrnZY6dWqlF4eDrx5jpUwsB2bEPjoqR5Z6rXPiHJKUOdJt7az+mNOn5KTSOlRpd1DmozrBrWr+G9fFLYVw== - dependencies: - "@stablelib/chacha20poly1305" "1.0.1" - "@stablelib/hkdf" "1.0.1" - "@stablelib/random" "^1.0.2" - "@stablelib/sha256" "1.0.1" - "@stablelib/x25519" "^1.0.3" - "@walletconnect/relay-api" "^1.0.9" - "@walletconnect/safe-json" "^1.0.2" - "@walletconnect/time" "^1.0.2" - "@walletconnect/types" "2.11.2" + "@walletconnect/types" "2.12.2" "@walletconnect/window-getters" "^1.0.1" "@walletconnect/window-metadata" "^1.0.1" detect-browser "5.3.0" @@ -9015,6 +9034,14 @@ "@webassemblyjs/helper-numbers" "1.11.1" "@webassemblyjs/helper-wasm-bytecode" "1.11.1" +"@webassemblyjs/ast@1.12.1", "@webassemblyjs/ast@^1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.12.1.tgz#bb16a0e8b1914f979f45864c23819cc3e3f0d4bb" + integrity sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg== + dependencies: + "@webassemblyjs/helper-numbers" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/ast@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964" @@ -9029,6 +9056,11 @@ resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz#f6c61a705f0fd7a6aecaa4e8198f23d9dc179e4f" integrity sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ== +"@webassemblyjs/floating-point-hex-parser@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz#dacbcb95aff135c8260f77fa3b4c5fea600a6431" + integrity sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw== + "@webassemblyjs/floating-point-hex-parser@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.9.0.tgz#3c3d3b271bddfc84deb00f71344438311d52ffb4" @@ -9039,6 +9071,11 @@ resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz#1a63192d8788e5c012800ba6a7a46c705288fd16" integrity sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg== +"@webassemblyjs/helper-api-error@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz#6132f68c4acd59dcd141c44b18cbebbd9f2fa768" + integrity sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q== + "@webassemblyjs/helper-api-error@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.9.0.tgz#203f676e333b96c9da2eeab3ccef33c45928b6a2" @@ -9049,6 +9086,11 @@ resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz#832a900eb444884cde9a7cad467f81500f5e5ab5" integrity sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA== +"@webassemblyjs/helper-buffer@1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz#6df20d272ea5439bf20ab3492b7fb70e9bfcb3f6" + integrity sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw== + "@webassemblyjs/helper-buffer@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.9.0.tgz#a1442d269c5feb23fcbc9ef759dac3547f29de00" @@ -9082,11 +9124,25 @@ "@webassemblyjs/helper-api-error" "1.11.1" "@xtuc/long" "4.2.2" +"@webassemblyjs/helper-numbers@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz#cbce5e7e0c1bd32cf4905ae444ef64cea919f1b5" + integrity sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g== + dependencies: + "@webassemblyjs/floating-point-hex-parser" "1.11.6" + "@webassemblyjs/helper-api-error" "1.11.6" + "@xtuc/long" "4.2.2" + "@webassemblyjs/helper-wasm-bytecode@1.11.1": version "1.11.1" resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz#f328241e41e7b199d0b20c18e88429c4433295e1" integrity sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q== +"@webassemblyjs/helper-wasm-bytecode@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz#bb2ebdb3b83aa26d9baad4c46d4315283acd51e9" + integrity sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA== + "@webassemblyjs/helper-wasm-bytecode@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.9.0.tgz#4fed8beac9b8c14f8c58b70d124d549dd1fe5790" @@ -9102,6 +9158,16 @@ "@webassemblyjs/helper-wasm-bytecode" "1.11.1" "@webassemblyjs/wasm-gen" "1.11.1" +"@webassemblyjs/helper-wasm-section@1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz#3da623233ae1a60409b509a52ade9bc22a37f7bf" + integrity sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g== + dependencies: + "@webassemblyjs/ast" "1.12.1" + "@webassemblyjs/helper-buffer" "1.12.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/wasm-gen" "1.12.1" + "@webassemblyjs/helper-wasm-section@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.9.0.tgz#5a4138d5a6292ba18b04c5ae49717e4167965346" @@ -9119,6 +9185,13 @@ dependencies: "@xtuc/ieee754" "^1.2.0" +"@webassemblyjs/ieee754@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz#bb665c91d0b14fffceb0e38298c329af043c6e3a" + integrity sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg== + dependencies: + "@xtuc/ieee754" "^1.2.0" + "@webassemblyjs/ieee754@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.9.0.tgz#15c7a0fbaae83fb26143bbacf6d6df1702ad39e4" @@ -9133,6 +9206,13 @@ dependencies: "@xtuc/long" "4.2.2" +"@webassemblyjs/leb128@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.6.tgz#70e60e5e82f9ac81118bc25381a0b283893240d7" + integrity sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ== + dependencies: + "@xtuc/long" "4.2.2" + "@webassemblyjs/leb128@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.9.0.tgz#f19ca0b76a6dc55623a09cffa769e838fa1e1c95" @@ -9145,6 +9225,11 @@ resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.1.tgz#d1f8b764369e7c6e6bae350e854dec9a59f0a3ff" integrity sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ== +"@webassemblyjs/utf8@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.6.tgz#90f8bc34c561595fe156603be7253cdbcd0fab5a" + integrity sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA== + "@webassemblyjs/utf8@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.9.0.tgz#04d33b636f78e6a6813227e82402f7637b6229ab" @@ -9178,6 +9263,20 @@ "@webassemblyjs/wasm-parser" "1.9.0" "@webassemblyjs/wast-printer" "1.9.0" +"@webassemblyjs/wasm-edit@^1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz#9f9f3ff52a14c980939be0ef9d5df9ebc678ae3b" + integrity sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g== + dependencies: + "@webassemblyjs/ast" "1.12.1" + "@webassemblyjs/helper-buffer" "1.12.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/helper-wasm-section" "1.12.1" + "@webassemblyjs/wasm-gen" "1.12.1" + "@webassemblyjs/wasm-opt" "1.12.1" + "@webassemblyjs/wasm-parser" "1.12.1" + "@webassemblyjs/wast-printer" "1.12.1" + "@webassemblyjs/wasm-gen@1.11.1": version "1.11.1" resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz#86c5ea304849759b7d88c47a32f4f039ae3c8f76" @@ -9189,6 +9288,17 @@ "@webassemblyjs/leb128" "1.11.1" "@webassemblyjs/utf8" "1.11.1" +"@webassemblyjs/wasm-gen@1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz#a6520601da1b5700448273666a71ad0a45d78547" + integrity sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w== + dependencies: + "@webassemblyjs/ast" "1.12.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/ieee754" "1.11.6" + "@webassemblyjs/leb128" "1.11.6" + "@webassemblyjs/utf8" "1.11.6" + "@webassemblyjs/wasm-gen@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.9.0.tgz#50bc70ec68ded8e2763b01a1418bf43491a7a49c" @@ -9210,6 +9320,16 @@ "@webassemblyjs/wasm-gen" "1.11.1" "@webassemblyjs/wasm-parser" "1.11.1" +"@webassemblyjs/wasm-opt@1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz#9e6e81475dfcfb62dab574ac2dda38226c232bc5" + integrity sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg== + dependencies: + "@webassemblyjs/ast" "1.12.1" + "@webassemblyjs/helper-buffer" "1.12.1" + "@webassemblyjs/wasm-gen" "1.12.1" + "@webassemblyjs/wasm-parser" "1.12.1" + "@webassemblyjs/wasm-opt@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.9.0.tgz#2211181e5b31326443cc8112eb9f0b9028721a61" @@ -9232,6 +9352,18 @@ "@webassemblyjs/leb128" "1.11.1" "@webassemblyjs/utf8" "1.11.1" +"@webassemblyjs/wasm-parser@1.12.1", "@webassemblyjs/wasm-parser@^1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz#c47acb90e6f083391e3fa61d113650eea1e95937" + integrity sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ== + dependencies: + "@webassemblyjs/ast" "1.12.1" + "@webassemblyjs/helper-api-error" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/ieee754" "1.11.6" + "@webassemblyjs/leb128" "1.11.6" + "@webassemblyjs/utf8" "1.11.6" + "@webassemblyjs/wasm-parser@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.9.0.tgz#9d48e44826df4a6598294aa6c87469d642fff65e" @@ -9264,6 +9396,14 @@ "@webassemblyjs/ast" "1.11.1" "@xtuc/long" "4.2.2" +"@webassemblyjs/wast-printer@1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz#bcecf661d7d1abdaf989d8341a4833e33e2b31ac" + integrity sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA== + dependencies: + "@webassemblyjs/ast" "1.12.1" + "@xtuc/long" "4.2.2" + "@webassemblyjs/wast-printer@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.9.0.tgz#4935d54c85fef637b00ce9f52377451d00d47899" @@ -9273,6 +9413,21 @@ "@webassemblyjs/wast-parser" "1.9.0" "@xtuc/long" "4.2.2" +"@webpack-cli/configtest@^2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-2.1.1.tgz#3b2f852e91dac6e3b85fb2a314fb8bef46d94646" + integrity sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw== + +"@webpack-cli/info@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-2.0.2.tgz#cc3fbf22efeb88ff62310cf885c5b09f44ae0fdd" + integrity sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A== + +"@webpack-cli/serve@^2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-2.0.5.tgz#325db42395cd49fe6c14057f9a900e427df8810e" + integrity sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ== + "@whatwg-node/events@^0.0.3": version "0.0.3" resolved "https://registry.yarnpkg.com/@whatwg-node/events/-/events-0.0.3.tgz#13a65dd4f5893f55280f766e29ae48074927acad" @@ -9437,6 +9592,11 @@ acorn-import-assertions@^1.7.6: resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz#ba2b5939ce62c238db6d93d81c9b111b29b855e9" integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw== +acorn-import-assertions@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz#507276249d684797c84e0734ef84860334cfb1ac" + integrity sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA== + acorn-jsx@^5.3.1, acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -9471,7 +9631,7 @@ acorn@^7.0.0, acorn@^7.4.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.0.4, acorn@^8.11.3, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0: +acorn@^8.0.4, acorn@^8.11.3, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0, acorn@^8.8.2: version "8.11.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== @@ -9513,7 +9673,7 @@ agent-base@^7.0.2, agent-base@^7.1.0: dependencies: debug "^4.3.4" -agentkeepalive@^4.2.1, agentkeepalive@^4.3.0: +agentkeepalive@^4.2.1, agentkeepalive@^4.3.0, agentkeepalive@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.5.0.tgz#2673ad1389b3c418c5a20c5d7364f93ca04be923" integrity sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew== @@ -9903,15 +10063,14 @@ asap@^2.0.0, asap@~2.0.3: resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" integrity sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA== -asn1.js@^5.2.0: - version "5.4.1" - resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-5.4.1.tgz#11a980b84ebb91781ce35b0fdc2ee294e3783f07" - integrity sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA== +asn1.js@^4.10.1: + version "4.10.1" + resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" + integrity sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw== dependencies: bn.js "^4.0.0" inherits "^2.0.1" minimalistic-assert "^1.0.0" - safer-buffer "^2.1.0" asn1js@^3.0.1, asn1js@^3.0.5: version "3.0.5" @@ -9976,9 +10135,9 @@ async-each@^1.0.1: integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== async-mutex@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/async-mutex/-/async-mutex-0.4.0.tgz#ae8048cd4d04ace94347507504b3cf15e631c25f" - integrity sha512-eJFZ1YhRR8UN8eBLoNzcDPcy/jqjsg6I1AP+KvWQX80BqOSW1oJPJXDylPUEeMr2ZQvHgnQ//Lp6f3RQ1zI7HA== + version "0.4.1" + resolved "https://registry.yarnpkg.com/async-mutex/-/async-mutex-0.4.1.tgz#bccf55b96f2baf8df90ed798cb5544a1f6ee4c2c" + integrity sha512-WfoBo4E/TbCX1G95XTjbWTE3X2XLG0m1Xbv2cwOtuPdyH9CZvnaA5nCt1ucjaKEgW2A5IF71hxrRhr83Je5xjA== dependencies: tslib "^2.4.0" @@ -10025,10 +10184,12 @@ autoprefixer@^9.8.6: postcss "^7.0.32" postcss-value-parser "^4.1.0" -available-typed-arrays@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" - integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== +available-typed-arrays@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz#a5cc375d6a03c2efc87a553f3e0b1522def14846" + integrity sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ== + dependencies: + possible-typed-array-names "^1.0.0" aws-sdk@^2.1612.0: version "2.1612.0" @@ -10059,7 +10220,7 @@ axios@^0.27.2: follow-redirects "^1.14.9" form-data "^4.0.0" -axios@^1.0.0, axios@^1.6.0, axios@^1.6.7: +axios@^1.0.0, axios@^1.6.7: version "1.6.7" resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.7.tgz#7b48c2e27c96f9c68a2f8f31e2ab19f59b06b0a7" integrity sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA== @@ -10068,6 +10229,15 @@ axios@^1.0.0, axios@^1.6.0, axios@^1.6.7: form-data "^4.0.0" proxy-from-env "^1.1.0" +axios@^1.6.0: + version "1.6.8" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.8.tgz#66d294951f5d988a00e87a0ffb955316a619ea66" + integrity sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ== + dependencies: + follow-redirects "^1.15.6" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + axobject-query@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be" @@ -10340,7 +10510,12 @@ bfs-path@^1.0.2: resolved "https://registry.yarnpkg.com/bfs-path/-/bfs-path-1.0.2.tgz#9b5fa4b8c4ad226597fc4d2ee15398bdcc644a07" integrity sha512-KTKx2JJtAAAT7C/rJYDXXWA2VLPycAS4kwFktKsxUo0hj4UTtw/Gm5PJuY7Uf3xSlIQNo7HRCSWei2ivncVwbQ== -big-integer@^1.6.48, big-integer@^1.6.7: +big-integer@^1.6.48: + version "1.6.52" + resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.52.tgz#60a887f3047614a8e1bffe5d7173490a97dc8c85" + integrity sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg== + +big-integer@^1.6.7: version "1.6.51" resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.51.tgz#0df92a5d9880560d3ff2d5fd20245c889d130686" integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg== @@ -10385,9 +10560,9 @@ binary-extensions@^1.0.0: integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== binary-extensions@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + version "2.3.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" + integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw== bindings@^1.3.0, bindings@^1.5.0: version "1.5.0" @@ -10445,7 +10620,7 @@ bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.8, bn.js@^4.11.9: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== -bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.2.0, bn.js@^5.2.1: +bn.js@^5.0.0, bn.js@^5.2.0, bn.js@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== @@ -10561,7 +10736,7 @@ browser-headers@^0.4.1: resolved "https://registry.yarnpkg.com/browser-headers/-/browser-headers-0.4.1.tgz#4308a7ad3b240f4203dbb45acedb38dc2d65dd02" integrity sha512-CA9hsySZVo9371qEHjHZtYxV2cFtVj5Wj/ZHi8ooEsrtm4vOnl9Y9HmyYWk9q+05d7K3rdoAE0j3MVEFVvtQtg== -browserify-aes@^1.0.0, browserify-aes@^1.0.4: +browserify-aes@^1.0.4, browserify-aes@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== @@ -10592,7 +10767,7 @@ browserify-des@^1.0.0: inherits "^2.0.1" safe-buffer "^5.1.2" -browserify-rsa@^4.0.0, browserify-rsa@^4.0.1: +browserify-rsa@^4.0.0, browserify-rsa@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.1.0.tgz#b2fd06b5b75ae297f7ce2dc651f918f5be158c8d" integrity sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog== @@ -10601,19 +10776,20 @@ browserify-rsa@^4.0.0, browserify-rsa@^4.0.1: randombytes "^2.0.1" browserify-sign@^4.0.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.2.1.tgz#eaf4add46dd54be3bb3b36c0cf15abbeba7956c3" - integrity sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg== + version "4.2.3" + resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.2.3.tgz#7afe4c01ec7ee59a89a558a4b75bd85ae62d4208" + integrity sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw== dependencies: - bn.js "^5.1.1" - browserify-rsa "^4.0.1" + bn.js "^5.2.1" + browserify-rsa "^4.1.0" create-hash "^1.2.0" create-hmac "^1.1.7" - elliptic "^6.5.3" + elliptic "^6.5.5" + hash-base "~3.0" inherits "^2.0.4" - parse-asn1 "^5.1.5" - readable-stream "^3.6.0" - safe-buffer "^5.2.0" + parse-asn1 "^5.1.7" + readable-stream "^2.3.8" + safe-buffer "^5.2.1" browserify-zlib@^0.2.0: version "0.2.0" @@ -10632,6 +10808,16 @@ browserslist@^4.12.0, browserslist@^4.14.5, browserslist@^4.21.0, browserslist@^ node-releases "^2.0.13" update-browserslist-db "^1.0.11" +browserslist@^4.21.10: + version "4.23.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.0.tgz#8f3acc2bbe73af7213399430890f86c63a5674ab" + integrity sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ== + dependencies: + caniuse-lite "^1.0.30001587" + electron-to-chromium "^1.4.668" + node-releases "^2.0.14" + update-browserslist-db "^1.0.13" + bs-logger@0.x: version "0.2.6" resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" @@ -10705,9 +10891,9 @@ buffer@^5.5.0: ieee754 "^1.1.13" bufferutil@^4.0.1, bufferutil@^4.0.3: - version "4.0.7" - resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.7.tgz#60c0d19ba2c992dd8273d3f73772ffc894c153ad" - integrity sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw== + version "4.0.8" + resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.8.tgz#1de6a71092d65d7766c4d8a522b261a6e787e8ea" + integrity sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw== dependencies: node-gyp-build "^4.3.0" @@ -10923,6 +11109,11 @@ caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001406, caniuse-lite@^1.0.300015 resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001570.tgz" integrity sha512-+3e0ASu4sw1SWaoCtvPeyXp+5PsjigkSt8OXZbF9StH5pQWbxEjLAZE3n8Aup5udop1uRiKA7a4utUk/uoSpUw== +caniuse-lite@^1.0.30001587: + version "1.0.30001616" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001616.tgz#4342712750d35f71ebba9fcac65e2cf8870013c3" + integrity sha512-RHVYKov7IcdNjVHJFNY/78RdG4oGVjbayxv8u5IO74Wv7Hlq4PnJE6mo/OjFijjVFNy5ijnCt6H3IIo4t+wfEw== + capital-case@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/capital-case/-/capital-case-1.0.4.tgz#9d130292353c9249f6b00fa5852bee38a717e669" @@ -10959,13 +11150,12 @@ ccount@^2.0.0: resolved "https://registry.yarnpkg.com/ccount/-/ccount-2.0.1.tgz#17a3bf82302e0870d6da43a01311a8bc02a3ecf5" integrity sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg== -chain-registry@^1.28.6: - version "1.28.6" - resolved "https://registry.yarnpkg.com/chain-registry/-/chain-registry-1.28.6.tgz#823bded9c70c64b3f4d0d32139cfd19b8fcb004e" - integrity sha512-RO5Ua/8KyuRBzrsGE82lyt04DI1vF20XnWTcVUw56aQEk/BiscoC5/nnqIsdqQkPZTi4gIMoJXrYCYeckc4vlQ== +chain-registry@^1.46.8: + version "1.46.8" + resolved "https://registry.yarnpkg.com/chain-registry/-/chain-registry-1.46.8.tgz#63d8e2c9ba2466ad4cec02bc734f93020cbbeb76" + integrity sha512-84+6NkPVKDfbfoyQjX+BdZ3roizmyt7yGQmTIIbj2WjgV2lEZyregaAeaU8RUhbEwCsEClhUCL7Oa5p6DRgJRQ== dependencies: - "@babel/runtime" "^7.21.0" - "@chain-registry/types" "^0.18.1" + "@chain-registry/types" "^0.28.12" chalk@3.0.0: version "3.0.0" @@ -11125,7 +11315,7 @@ chokidar@^2.1.8: optionalDependencies: fsevents "^1.2.7" -chokidar@^3.4.1, chokidar@^3.4.2, chokidar@^3.5.3: +chokidar@^3.4.1, chokidar@^3.4.2: version "3.5.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== @@ -11140,6 +11330,21 @@ chokidar@^3.4.1, chokidar@^3.4.2, chokidar@^3.5.3: optionalDependencies: fsevents "~2.3.2" +chokidar@^3.5.3, chokidar@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" + integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + chownr@^1.1.1: version "1.1.4" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" @@ -11341,11 +11546,6 @@ clsx@^1.1.1, clsx@^1.2.1: resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.2.1.tgz#0ddc4a20a549b59c93a4116bb26f5294ca17dc12" integrity sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg== -cluster-key-slot@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz#88ddaa46906e303b5de30d3153b7d9fe0a0c19ac" - integrity sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA== - cmd-shim@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/cmd-shim/-/cmd-shim-5.0.0.tgz#8d0aaa1a6b0708630694c4dbde070ed94c707724" @@ -11444,7 +11644,7 @@ colorette@^1.2.2: resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.4.0.tgz#5190fbb87276259a86ad700bff2c6d6faa3fca40" integrity sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g== -colorette@^2.0.16: +colorette@^2.0.14, colorette@^2.0.16: version "2.0.20" resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== @@ -11492,6 +11692,11 @@ commander@7.1.0: resolved "https://registry.yarnpkg.com/commander/-/commander-7.1.0.tgz#f2eaecf131f10e36e07d894698226e36ae0eb5ff" integrity sha512-pRxBna3MJe6HKnBGsDyMv8ETbptw3axEdYHoqNh7gu5oDcew8fs0xnivZGm06Ogk8zGAJ9VX+OPEr2GXEQK4dg== +commander@^10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" + integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== + commander@^11.0.0: version "11.0.0" resolved "https://registry.yarnpkg.com/commander/-/commander-11.0.0.tgz#43e19c25dbedc8256203538e8d7e9346877a6f67" @@ -11609,6 +11814,11 @@ condense-newlines@^0.2.1: is-whitespace "^0.3.0" kind-of "^3.0.2" +confbox@^0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/confbox/-/confbox-0.1.7.tgz#ccfc0a2bcae36a84838e83a3b7f770fb17d6c579" + integrity sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA== + config-chain@^1.1.12, config-chain@^1.1.13: version "1.1.13" resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.13.tgz#fad0795aa6a6cdaff9ed1b68e9dff94372c232f4" @@ -11753,9 +11963,9 @@ convert-source-map@^2.0.0: integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== cookie-es@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/cookie-es/-/cookie-es-1.0.0.tgz#4759684af168dfc54365b2c2dda0a8d7ee1e4865" - integrity sha512-mWYvfOLrfEc996hlKcdABeIiPHUPC6DM2QYZdGGOvhOTbA3tjm2eBwqlJpoFdjC89NI4Qt6h0Pu06Mp+1Pj5OQ== + version "1.1.0" + resolved "https://registry.yarnpkg.com/cookie-es/-/cookie-es-1.1.0.tgz#68f8d9f48aeb5a534f3896f80e792760d3d20def" + integrity sha512-L2rLOcK0wzWSfSDA33YR+PUHDG10a8px7rUHKWbGLP4YfbsMed2KFUw5fczvDPbT98DDe3LEzviswl810apTEw== cookie-signature@1.0.6: version "1.0.6" @@ -11933,13 +12143,20 @@ create-require@^1.1.0: resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== -cross-fetch@3.1.5, cross-fetch@^3.1.5: +cross-fetch@3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== dependencies: node-fetch "2.6.7" +cross-fetch@^3.1.5: + version "3.1.8" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.8.tgz#0327eba65fd68a7d119f8fb2bf9334a1a7956f82" + integrity sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg== + dependencies: + node-fetch "^2.6.12" + cross-inspect@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/cross-inspect/-/cross-inspect-1.0.0.tgz#5fda1af759a148594d2d58394a9e21364f6849af" @@ -11990,9 +12207,9 @@ crypto-browserify@^3.11.0, crypto-browserify@^3.12.0: randomfill "^1.0.3" crypto-js@^4.0.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.1.1.tgz#9e485bcf03521041bd85844786b83fb7619736cf" - integrity sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw== + version "4.2.0" + resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.2.0.tgz#4d931639ecdfd12ff80e8186dba6af2c2e856631" + integrity sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q== css-in-js-utils@^3.1.0: version "3.1.0" @@ -12226,7 +12443,7 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" -define-data-property@^1.0.1, define-data-property@^1.1.2: +define-data-property@^1.0.1, define-data-property@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== @@ -12301,11 +12518,6 @@ delegates@^1.0.0: resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" integrity sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ== -denque@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/denque/-/denque-2.1.0.tgz#e93e1a6569fb5e66f16a3c2a2964617d349d6ab1" - integrity sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw== - depd@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" @@ -12334,7 +12546,7 @@ des.js@^1.0.0: inherits "^2.0.1" minimalistic-assert "^1.0.0" -destr@^2.0.1, destr@^2.0.2, destr@^2.0.3: +destr@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/destr/-/destr-2.0.3.tgz#7f9e97cb3d16dbdca7be52aca1644ce402cfe449" integrity sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ== @@ -12641,14 +12853,14 @@ duplexify@^3.4.2, duplexify@^3.6.0: stream-shift "^1.0.0" duplexify@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-4.1.2.tgz#18b4f8d28289132fa0b9573c898d9f903f81c7b0" - integrity sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw== + version "4.1.3" + resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-4.1.3.tgz#a07e1c0d0a2c001158563d32592ba58bddb0236f" + integrity sha512-M3BmBhwJRZsSx38lZyhE53Csddgzl5R7xGJNk7CVddZD6CcmwMCH8J+7AprIrQKH7TonKxaCjcv27Qmf+sQ+oA== dependencies: end-of-stream "^1.4.1" inherits "^2.0.3" readable-stream "^3.1.1" - stream-shift "^1.0.0" + stream-shift "^1.0.2" eastasianwidth@^0.2.0: version "0.2.0" @@ -12682,7 +12894,12 @@ electron-to-chromium@^1.4.477: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.490.tgz#d99286f6e915667fa18ea4554def1aa60eb4d5f1" integrity sha512-6s7NVJz+sATdYnIwhdshx/N/9O6rvMxmhVoDSDFdj6iA45gHR8EQje70+RYsF4GeB+k0IeNSBnP7yG9ZXJFr7A== -elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.3, elliptic@^6.5.4: +electron-to-chromium@^1.4.668: + version "1.4.756" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.756.tgz#7b872ed8c8c5bee571be771730225d6d2a37fe45" + integrity sha512-RJKZ9+vEBMeiPAvKNWyZjuYyUqMndcP1f335oHqn3BEQbs2NFtVrnK5+6Xg5wSM9TknNNpWghGDUCKGYF+xWXw== + +elliptic@6.5.4: version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== @@ -12695,6 +12912,19 @@ elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.3, elliptic@^6.5.4: minimalistic-assert "^1.0.1" minimalistic-crypto-utils "^1.0.1" +elliptic@^6.4.0, elliptic@^6.5.3, elliptic@^6.5.4, elliptic@^6.5.5: + version "6.5.5" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.5.tgz#c715e09f78b6923977610d4c2346d6ce22e6dded" + integrity sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + hash.js "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" + emitter-component@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/emitter-component/-/emitter-component-1.1.1.tgz#065e2dbed6959bf470679edabeaf7981d1003ab6" @@ -12754,9 +12984,9 @@ endent@^2.0.1: objectorarray "^1.0.5" engine.io-client@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-6.5.2.tgz#8709e22c291d4297ae80318d3c8baeae71f0e002" - integrity sha512-CQZqbrpEYnrpGqC07a9dJDz4gePZUgTPMU3NKJPSeQOyw27Tst4Pl3FemKoFGAlHzgZmKjoRmiJvbWfhCXUlIg== + version "6.5.3" + resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-6.5.3.tgz#4cf6fa24845029b238f83c628916d9149c399bc5" + integrity sha512-9Z0qLB0NIisTRt1DZ/8U2k12RJn8yls/nXMZLn+/N8hANT3TcYjKFKcwbw5zFQiN4NTde3TSY9zb79e1ij6j9Q== dependencies: "@socket.io/component-emitter" "~3.1.0" debug "~4.3.1" @@ -12765,9 +12995,9 @@ engine.io-client@~6.5.2: xmlhttprequest-ssl "~2.0.0" engine.io-parser@~5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-5.2.1.tgz#9f213c77512ff1a6cc0c7a86108a7ffceb16fcfb" - integrity sha512-9JktcM3u18nU9N2Lz3bWeBgxVgOKpw7yhRaoxQA3FUDZzzw+9WlA6p4G4u0RixNkg14fH7EfEc/RhpurtiROTQ== + version "5.2.2" + resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-5.2.2.tgz#37b48e2d23116919a3453738c5720455e64e1c49" + integrity sha512-RcyUFKA93/CXH20l4SoVvzZfrSDMOTUS3bWVpTt2FuFP+XYrL8i8oonHP7WInRyVHXh0n/ORtoeiE1os+8qkSw== enhanced-resolve@^4.5.0: version "4.5.0" @@ -12786,6 +13016,14 @@ enhanced-resolve@^5.10.0, enhanced-resolve@^5.7.0: graceful-fs "^4.2.4" tapable "^2.2.0" +enhanced-resolve@^5.16.0: + version "5.16.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.16.0.tgz#65ec88778083056cb32487faa9aef82ed0864787" + integrity sha512-O+QWCviPNSSLAD9Ucn8Awv+poAkqn3T1XY5/N7kR7rQO9yfSGWkYZDwpJ+iKF7B8rxaQKWngSqACpgzeapSyoA== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + enquirer@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" @@ -12808,6 +13046,11 @@ env-paths@^2.2.0: resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== +envinfo@^7.7.3: + version "7.13.0" + resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.13.0.tgz#81fbb81e5da35d74e814941aeab7c325a606fb31" + integrity sha512-cvcaMr7KqXVh4nyzGTVqTum+gAiL265x5jUWQIDLq//zOGbW+gSW/C+OWLleY/rs9Qole6AZLMXPbtIFQbqu+Q== + envinfo@^7.7.4: version "7.8.1" resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" @@ -12904,6 +13147,11 @@ es-module-lexer@^0.9.0: resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== +es-module-lexer@^1.2.1: + version "1.5.2" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.5.2.tgz#00b423304f2500ac59359cc9b6844951f372d497" + integrity sha512-l60ETUTmLqbVbVHv1J4/qj+M8nq7AwMzEcg3kmJDt9dCNrTk+yHcYFf/Kw75pMDwd9mPcIGCG5LcS20SxYRzFA== + es-shim-unscopables@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz#702e632193201e3edf8713635d083d378e510241" @@ -12983,6 +13231,11 @@ escalade@^3.1.1: resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== +escalade@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27" + integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA== + escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" @@ -13723,9 +13976,9 @@ fast-querystring@^1.1.1: fast-decode-uri-component "^1.0.1" fast-redact@^3.0.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/fast-redact/-/fast-redact-3.3.0.tgz#7c83ce3a7be4898241a46560d51de10f653f7634" - integrity sha512-6T5V1QK1u4oF+ATxs1lWUmlEk6P2T9HqJG3e2DnHOdVgZy2rFJBoEnrIedcTXlkAHU/zKC+7KETJ+KGGKwxgMQ== + version "3.5.0" + resolved "https://registry.yarnpkg.com/fast-redact/-/fast-redact-3.5.0.tgz#e9ea02f7e57d0cd8438180083e93077e496285e4" + integrity sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A== fast-safe-stringify@2.0.4: version "2.0.4" @@ -13761,6 +14014,11 @@ fast-xml-parser@4.2.4: dependencies: strnum "^1.0.5" +fastest-levenshtein@^1.0.12: + version "1.0.16" + resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz#210e61b6ff181de91ea9b3d1b84fdedd47e034e5" + integrity sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg== + fastest-stable-stringify@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/fastest-stable-stringify/-/fastest-stable-stringify-2.0.2.tgz#3757a6774f6ec8de40c4e86ec28ea02417214c76" @@ -13994,10 +14252,10 @@ fn.name@1.x.x: resolved "https://registry.yarnpkg.com/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc" integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== -follow-redirects@^1.14.9, 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== +follow-redirects@^1.14.9, follow-redirects@^1.15.4, follow-redirects@^1.15.6: + version "1.15.6" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" + integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== for-each@^0.3.3: version "0.3.3" @@ -14180,11 +14438,16 @@ fsevents@^1.2.7: bindings "^1.5.0" nan "^2.12.1" -fsevents@^2.1.2, fsevents@^2.3.2, fsevents@~2.3.2: +fsevents@^2.1.2, fsevents@^2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== +fsevents@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + function-bind@^1.1.1, function-bind@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" @@ -14254,7 +14517,7 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.3, get-intrinsic@^1.2.4: +get-intrinsic@^1.1.0, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd" integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ== @@ -14524,13 +14787,21 @@ globals@^13.15.0: dependencies: type-fest "^0.20.2" -globalthis@^1.0.0, globalthis@^1.0.1: +globalthis@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== dependencies: define-properties "^1.1.3" +globalthis@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.4.tgz#7430ed3a975d97bfb59bcce41f5cabbafa651236" + integrity sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ== + dependencies: + define-properties "^1.2.1" + gopd "^1.0.1" + globby@^11.0.2, globby@^11.0.3, globby@^11.1.0: version "11.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" @@ -14579,6 +14850,11 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6 resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== +graceful-fs@^4.2.11: + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + grapheme-splitter@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" @@ -14638,7 +14914,7 @@ gzip-size@^6.0.0: dependencies: duplexer "^0.1.2" -h3@^1.10.2, h3@^1.8.2: +h3@^1.10.2, h3@^1.11.1: version "1.11.1" resolved "https://registry.yarnpkg.com/h3/-/h3-1.11.1.tgz#e9414ae6f2a076a345ea07256b320edb29bab9f7" integrity sha512-AbaH6IDnZN6nmbnJOH72y3c5Wwh9P97soSVdGSBbcDACRdkC0FEWf25pzx4f/NuOCK6quHmW18yF2Wx+G4Zi1A== @@ -14710,7 +14986,7 @@ has-glob@^1.0.0: dependencies: is-glob "^3.0.0" -has-property-descriptors@^1.0.0, has-property-descriptors@^1.0.1: +has-property-descriptors@^1.0.0, has-property-descriptors@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== @@ -14718,21 +14994,21 @@ has-property-descriptors@^1.0.0, has-property-descriptors@^1.0.1: es-define-property "^1.0.0" has-proto@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" - integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.3.tgz#b31ddfe9b0e6e9914536a6ab286426d0214f77fd" + integrity sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q== has-symbols@^1.0.1, has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== -has-tostringtag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" - integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== +has-tostringtag@^1.0.0, has-tostringtag@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" + integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== dependencies: - has-symbols "^1.0.2" + has-symbols "^1.0.3" has-unicode@^2.0.1: version "2.0.1" @@ -14786,6 +15062,14 @@ hash-base@^3.0.0: readable-stream "^3.6.0" safe-buffer "^5.2.0" +hash-base@~3.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" + integrity sha512-EeeoJKjTyt868liAlVmcv2ZsUfGHlE3Q+BICOXcZiwN3osr5Q/zFGYmTJpoIzuaSTAwndFy+GqhEwlU4L3j4Ow== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3: version "1.1.7" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" @@ -14795,9 +15079,9 @@ hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3: minimalistic-assert "^1.0.1" hasown@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.0.tgz#f4c513d454a57b7c7e1650778de226b11700546c" - integrity sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA== + version "2.0.2" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== dependencies: function-bind "^1.1.2" @@ -15485,6 +15769,11 @@ interpret@^2.2.0: resolved "https://registry.yarnpkg.com/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9" integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== +interpret@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-3.1.1.tgz#5be0ceed67ca79c6c4bc5cf0d7ee843dcea110c4" + integrity sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ== + intl-messageformat-parser@^5.4.0: version "5.5.1" resolved "https://registry.yarnpkg.com/intl-messageformat-parser/-/intl-messageformat-parser-5.5.1.tgz#f09a692755813e6220081e3374df3fb1698bd0c6" @@ -15499,21 +15788,6 @@ invariant@^2.2.4: dependencies: loose-envify "^1.0.0" -ioredis@^5.3.2: - version "5.3.2" - resolved "https://registry.yarnpkg.com/ioredis/-/ioredis-5.3.2.tgz#9139f596f62fc9c72d873353ac5395bcf05709f7" - integrity sha512-1DKMMzlIHM02eBBVOFQ1+AolGjs6+xEcM4PDL7NqOS6szq7H9jSaEkIUH6/a5Hl241LzW6JLSiAbNvTQjUupUA== - dependencies: - "@ioredis/commands" "^1.1.1" - cluster-key-slot "^1.1.0" - debug "^4.3.4" - denque "^2.1.0" - lodash.defaults "^4.2.0" - lodash.isarguments "^3.1.0" - redis-errors "^1.2.0" - redis-parser "^3.0.0" - standard-as-callback "^2.1.0" - ip@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ip/-/ip-2.0.0.tgz#4cf4ab182fee2314c75ede1276f8c80b479936da" @@ -15525,9 +15799,9 @@ ipaddr.js@1.9.1: integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== iron-webcrypto@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/iron-webcrypto/-/iron-webcrypto-1.0.0.tgz#e3b689c0c61b434a0a4cb82d0aeabbc8b672a867" - integrity sha512-anOK1Mktt8U1Xi7fCM3RELTuYbnFikQY5VtrDj7kPgpejV7d43tWKhzgioO0zpkazLEL/j/iayRqnJhrGfqUsg== + version "1.1.1" + resolved "https://registry.yarnpkg.com/iron-webcrypto/-/iron-webcrypto-1.1.1.tgz#245c9d467075ee810343ddfa53dd4909616aaf33" + integrity sha512-5xGwQUWHQSy039rFr+5q/zOmj7GP0Ypzvo34Ep+61bPIhaLduEDp/PvLGlU3awD2mzWUR0weN2vJ1mILydFPEg== irregular-plurals@^1.0.0: version "1.4.0" @@ -15961,11 +16235,11 @@ is-text-path@^1.0.1: text-extensions "^1.0.0" is-typed-array@^1.1.3: - version "1.1.12" - resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.12.tgz#d0bab5686ef4a76f7a73097b95470ab199c57d4a" - integrity sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg== + version "1.1.13" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.13.tgz#d6c5ca56df62334959322d7d7dd1cca50debe229" + integrity sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw== dependencies: - which-typed-array "^1.1.11" + which-typed-array "^1.1.14" is-typedarray@^1.0.0: version "1.0.0" @@ -16086,7 +16360,7 @@ isobject@^4.0.0: resolved "https://registry.yarnpkg.com/isobject/-/isobject-4.0.0.tgz#3f1c9155e73b192022a80819bacd0343711697b0" integrity sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA== -isomorphic-unfetch@^3.1.0: +isomorphic-unfetch@3.1.0, isomorphic-unfetch@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/isomorphic-unfetch/-/isomorphic-unfetch-3.1.0.tgz#87341d5f4f7b63843d468438128cb087b7c3e98f" integrity sha512-geDJjpoZ8N0kWexiwkX8F9NkTsXhetLPVbZFQ+JTW239QNOwvB0gniuR1Wc6f0AMTn7/mFGyXvHTifrCp/GH8Q== @@ -16787,11 +17061,12 @@ json-rpc-engine@^6.1.0: eth-rpc-errors "^4.0.2" json-rpc-middleware-stream@^4.2.1: - version "4.2.2" - resolved "https://registry.yarnpkg.com/json-rpc-middleware-stream/-/json-rpc-middleware-stream-4.2.2.tgz#b620d86e8f321f80c9f041c51bd783fa92a8ccb2" - integrity sha512-tmTQCI/R8wKMTWB50xlzkyh90JR5VuKiDVlWlmG7DjeKfdDtbLL/4vYCRlG5HnSSKkhrkVPI0TrHQz1Dethl7A== + version "4.2.3" + resolved "https://registry.yarnpkg.com/json-rpc-middleware-stream/-/json-rpc-middleware-stream-4.2.3.tgz#08340846ffaa2a60287930773546eb4b7f7dbba2" + integrity sha512-4iFb0yffm5vo3eFKDbQgke9o17XBcLQ2c3sONrXSbcOLzP8LTojqo8hRGVgtJShhm5q4ZDSNq039fAx9o65E1w== dependencies: "@metamask/safe-event-emitter" "^3.0.0" + json-rpc-engine "^6.1.0" readable-stream "^2.3.3" json-rpc-random-id@^1.0.1: @@ -16814,7 +17089,7 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== -json-stable-stringify@^1.0.1, json-stable-stringify@^1.0.2: +json-stable-stringify@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.1.0.tgz#43d39c7c8da34bfaf785a61a56808b0def9f747d" integrity sha512-zfA+5SuwYN2VWqN1/5HZaDzQKLJHaBVMZIIM+wuYjdptkaQsqzDdqjqf+lZZJUuJq1aanHiY8LhH8LmH+qBYJA== @@ -16824,6 +17099,16 @@ json-stable-stringify@^1.0.1, json-stable-stringify@^1.0.2: jsonify "^0.0.1" object-keys "^1.1.1" +json-stable-stringify@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.1.1.tgz#52d4361b47d49168bcc4e564189a42e5a7439454" + integrity sha512-SU/971Kt5qVQfJpyDveVhQ/vya+5hvrjClFOcr8c0Fq5aODJjMwutrOfCU+eCnVD5gpx1Q3fEqkyom77zH1iIg== + dependencies: + call-bind "^1.0.5" + isarray "^2.0.5" + jsonify "^0.0.1" + object-keys "^1.1.1" + json-stringify-nice@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/json-stringify-nice/-/json-stringify-nice-1.1.4.tgz#2c937962b80181d3f317dd39aa323e14f5a60a67" @@ -16859,11 +17144,6 @@ jsonc-parser@3.2.0: resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== -jsonc-parser@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.1.tgz#031904571ccf929d7670ee8c547545081cb37f1a" - integrity sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA== - jsonfile@^6.0.1: version "6.1.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" @@ -16934,9 +17214,9 @@ keccak256@^1.0.6: keccak "^3.0.2" keccak@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.3.tgz#4bc35ad917be1ef54ff246f904c2bbbf9ac61276" - integrity sha512-JZrLIAJWuZxKbCilMpNz5Vj7Vtb4scDG3dMXLOsbzBmQGyjwE61BbW7bJkfKKCShXiQZt3T6sBgALRtmd+nZaQ== + version "3.0.4" + resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.4.tgz#edc09b89e633c0549da444432ecf062ffadee86d" + integrity sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q== dependencies: node-addon-api "^2.0.0" node-gyp-build "^4.2.0" @@ -17092,17 +17372,17 @@ libnpmpublish@^6.0.4: semver "^7.3.7" ssri "^9.0.0" -libsodium-sumo@^0.7.11: - version "0.7.11" - resolved "https://registry.yarnpkg.com/libsodium-sumo/-/libsodium-sumo-0.7.11.tgz#ab0389e2424fca5c1dc8c4fd394906190da88a11" - integrity sha512-bY+7ph7xpk51Ez2GbE10lXAQ5sJma6NghcIDaSPbM/G9elfrjLa0COHl/7P6Wb/JizQzl5UQontOOP1z0VwbLA== +libsodium-sumo@^0.7.13: + version "0.7.13" + resolved "https://registry.yarnpkg.com/libsodium-sumo/-/libsodium-sumo-0.7.13.tgz#533b97d2be44b1277e59c1f9f60805978ac5542d" + integrity sha512-zTGdLu4b9zSNLfovImpBCbdAA4xkpkZbMnSQjP8HShyOutnGjRHmSOKlsylh1okao6QhLiz7nG98EGn+04cZjQ== libsodium-wrappers-sumo@^0.7.11: - version "0.7.11" - resolved "https://registry.yarnpkg.com/libsodium-wrappers-sumo/-/libsodium-wrappers-sumo-0.7.11.tgz#d96329ee3c0e7ec7f5fcf4cdde16cc3a1ae91d82" - integrity sha512-DGypHOmJbB1nZn89KIfGOAkDgfv5N6SBGC3Qvmy/On0P0WD1JQvNRS/e3UL3aFF+xC0m+MYz5M+MnRnK2HMrKQ== + version "0.7.13" + resolved "https://registry.yarnpkg.com/libsodium-wrappers-sumo/-/libsodium-wrappers-sumo-0.7.13.tgz#a33aea845a0bb56db067548f04feba28c730ab8e" + integrity sha512-lz4YdplzDRh6AhnLGF2Dj2IUj94xRN6Bh8T0HLNwzYGwPehQJX6c7iYVrFUPZ3QqxE0bqC+K0IIqqZJYWumwSQ== dependencies: - libsodium-sumo "^0.7.11" + libsodium-sumo "^0.7.13" lie@3.1.1: version "3.1.1" @@ -17131,7 +17411,7 @@ lines-and-columns@~2.0.3: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-2.0.3.tgz#b2f0badedb556b747020ab8ea7f0373e22efac1b" integrity sha512-cNOjgCnLB+FnvWWtyRTzmB3POJ+cXxTA81LoW7u8JdmhfXzriropYwpjShnz1QLLWsQwY7nIxoDmcPTwphDK9w== -listhen@^1.5.5: +listhen@^1.7.2: version "1.7.2" resolved "https://registry.yarnpkg.com/listhen/-/listhen-1.7.2.tgz#66b81740692269d5d8cafdc475020f2fc51afbae" integrity sha512-7/HamOm5YD9Wb7CFgAZkKgVPA96WwhcTQoqtm2VTZGVbVVn3IWKRBTgrU7cchA3Q8k9iCsG8Osoi9GX4JsGM9g== @@ -17329,17 +17609,12 @@ lodash.debounce@^4.0.8: resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== -lodash.defaults@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c" - integrity sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ== - lodash.get@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ== -lodash.isarguments@^3.0.0, lodash.isarguments@^3.1.0: +lodash.isarguments@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" integrity sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg== @@ -17454,10 +17729,10 @@ logform@^2.2.0, logform@^2.3.2: safe-stable-stringify "^2.3.1" triple-beam "^1.3.0" -loglevel@^1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.8.1.tgz#5c621f83d5b48c54ae93b6156353f555963377b4" - integrity sha512-tCRIJM51SHjAayKwC+QAg8hT8vg6z7GSgLJKGvzuPb1Wc+hLzqtuVLxp6/HzSPOozuK+8ErAhy7U/sVzw8Dgfg== +loglevel@^1.8.1, loglevel@^1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.9.1.tgz#d63976ac9bcd03c7c873116d41c2a85bafff1be7" + integrity sha512-hP3I3kCrDIMuRwAwHltphhDM1r8i55H33GgqjXbrisuJhF4kRhW1dNuxsRklp4bXl8DSdLaNLuiL4A/LWRfxvg== long@^4.0.0: version "4.0.0" @@ -17503,10 +17778,10 @@ lower-case@^2.0.2: dependencies: tslib "^2.0.3" -lru-cache@^10.0.2, "lru-cache@^9.1.1 || ^10.0.0": - version "10.2.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.0.tgz#0bd445ca57363465900f4d1f9bd8db343a4d95c3" - integrity sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q== +lru-cache@^10.2.0: + version "10.2.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.2.tgz#48206bc114c1252940c41b25b41af5b545aca878" + integrity sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ== lru-cache@^4.1.5: version "4.1.5" @@ -17535,6 +17810,11 @@ lru-cache@^7.4.4, lru-cache@^7.5.1, lru-cache@^7.7.1: resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.14.1.tgz#8da8d2f5f59827edb388e63e459ac23d6d408fea" integrity sha512-ysxwsnTKdAx96aTRdhDOCQfDgbHnt8SK0KY8SEjO0wHinhWOFTESbjVCMPbU1uGXg/ch4lifqx0wfjOawU2+WA== +"lru-cache@^9.1.1 || ^10.0.0": + version "10.2.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.0.tgz#0bd445ca57363465900f4d1f9bd8db343a4d95c3" + integrity sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q== + lru-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3" @@ -18533,20 +18813,20 @@ mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.5: dependencies: minimist "^1.2.6" -mlly@^1.2.0, mlly@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/mlly/-/mlly-1.6.1.tgz#0983067dc3366d6314fc5e12712884e6978d028f" - integrity sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA== +mlly@^1.6.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/mlly/-/mlly-1.7.0.tgz#587383ae40dda23cadb11c3c3cc972b277724271" + integrity sha512-U9SDaXGEREBYQgfejV97coK0UL1r+qnF2SyO9A3qcI8MzKnsIFKHNVEkrDyNncQTKQQumsasmeq84eNMdBfsNQ== dependencies: acorn "^8.11.3" pathe "^1.1.2" - pkg-types "^1.0.3" - ufo "^1.3.2" + pkg-types "^1.1.0" + ufo "^1.5.3" mobx@^6.1.7: - version "6.6.1" - resolved "https://registry.yarnpkg.com/mobx/-/mobx-6.6.1.tgz#70ee6aa82f25aeb7e7d522bd621207434e509318" - integrity sha512-7su3UZv5JF+ohLr2opabjbUAERfXstMY+wiBtey8yNAPoB8H187RaQXuhFjNkH8aE4iHbDWnhDFZw0+5ic4nGQ== + version "6.12.3" + resolved "https://registry.yarnpkg.com/mobx/-/mobx-6.12.3.tgz#b6a0fde4268116be602d50bffb32f1b90a8fb077" + integrity sha512-c8NKkO4R2lShkSXZ2Ongj1ycjugjzFFo/UswHBnS62y07DMcTc9Rvo03/3nRyszIvwPNljlkd4S828zIBv/piw== modify-values@^1.0.0: version "1.0.1" @@ -18635,11 +18915,16 @@ mz@^2.7.0: object-assign "^4.0.1" thenify-all "^1.0.0" -nan@^2.12.1, nan@^2.13.2: +nan@^2.12.1: version "2.17.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.17.0.tgz#c0150a2368a182f033e9aa5195ec76ea41a199cb" integrity sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ== +nan@^2.13.2: + version "2.19.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.19.0.tgz#bb58122ad55a6c5bc973303908d5b16cfdd5a8c0" + integrity sha512-nO1xXxfh/RWNxfd/XPfbIfFk5vgLsAxUR9y5O0cHMJu/AW9U95JLXqthYHjEp+8gQ5p96K9jUp8nbVOxCdRbtw== + nano-css@^5.6.1: version "5.6.1" resolved "https://registry.yarnpkg.com/nano-css/-/nano-css-5.6.1.tgz#964120cb1af6cccaa6d0717a473ccd876b34c197" @@ -18810,10 +19095,10 @@ node-dir@^0.1.10: dependencies: minimatch "^3.0.2" -node-fetch-native@^1.4.0, node-fetch-native@^1.4.1, node-fetch-native@^1.6.1: - version "1.6.2" - resolved "https://registry.yarnpkg.com/node-fetch-native/-/node-fetch-native-1.6.2.tgz#f439000d972eb0c8a741b65dcda412322955e1c6" - integrity sha512-69mtXOFZ6hSkYiXAVB5SqaRvrbITC/NPyqv7yuu/qw0nmgPyYbIMYYNIDhNtwPrzk0ptrimrLz/hhjvm4w5Z+w== +node-fetch-native@^1.6.1, node-fetch-native@^1.6.2, node-fetch-native@^1.6.3: + version "1.6.4" + resolved "https://registry.yarnpkg.com/node-fetch-native/-/node-fetch-native-1.6.4.tgz#679fc8fd8111266d47d7e72c379f1bed9acff06e" + integrity sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ== node-fetch@2.6.7: version "2.6.7" @@ -18822,7 +19107,7 @@ node-fetch@2.6.7: dependencies: whatwg-url "^5.0.0" -node-fetch@^2.6.1, node-fetch@^2.6.12, node-fetch@^2.6.7: +node-fetch@^2.6.1, node-fetch@^2.6.12, node-fetch@^2.6.7, node-fetch@^2.7.0: version "2.7.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== @@ -18835,9 +19120,9 @@ node-forge@^1.3.1: integrity sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA== node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: - version "4.6.1" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.1.tgz#24b6d075e5e391b8d5539d98c7fc5c210cac8a3e" - integrity sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ== + version "4.8.1" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.8.1.tgz#976d3ad905e71b76086f4f0b0d3637fe79b6cda5" + integrity sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw== node-gyp@^9.0.0: version "9.3.1" @@ -18894,6 +19179,11 @@ node-releases@^2.0.13: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.13.tgz#d5ed1627c23e3461e819b02e57b75e4899b1c81d" integrity sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ== +node-releases@^2.0.14: + version "2.0.14" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.14.tgz#2ffb053bceb8b2be8495ece1ab6ce600c4461b0b" + integrity sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw== + nomnom@^1.5.x: version "1.8.1" resolved "https://registry.yarnpkg.com/nomnom/-/nomnom-1.8.1.tgz#2151f722472ba79e50a76fc125bb8c8f2e4dc2a7" @@ -19164,11 +19454,16 @@ object-hash@^3.0.0: resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-3.0.0.tgz#73f97f753e7baffc0e2cc9d6e079079744ac82e9" integrity sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw== -object-inspect@^1.12.0, object-inspect@^1.9.0: +object-inspect@^1.12.0: version "1.12.3" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== +object-inspect@^1.13.1: + version "1.13.1" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.1.tgz#b96c6109324ccfef6b12216a956ca4dc2ff94bc2" + integrity sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ== + object-is@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.6.tgz#1a6a53aed2dd8f7e6775ff870bea58545956ab07" @@ -19262,13 +19557,13 @@ oblivious-set@1.1.1: integrity sha512-Oh+8fK09mgGmAshFdH6hSVco6KZmd1tTwNFWj35OvzdmJTMZtAkbn05zar2iG3v6sDs1JLEtOiBGNb6BHwkb2w== ofetch@^1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/ofetch/-/ofetch-1.3.3.tgz#588cb806a28e5c66c2c47dd8994f9059a036d8c0" - integrity sha512-s1ZCMmQWXy4b5K/TW9i/DtiN8Ku+xCiHcjQ6/J/nDdssirrQNOoB165Zu8EqLMA2lln1JUth9a0aW9Ap2ctrUg== + version "1.3.4" + resolved "https://registry.yarnpkg.com/ofetch/-/ofetch-1.3.4.tgz#7ea65ced3c592ec2b9906975ae3fe1d26a56f635" + integrity sha512-KLIET85ik3vhEfS+3fDlc/BAZiAp+43QEC/yCo5zkNoY2YaKvNkOaFr/6wCFgFH1kuYQM5pMNi0Tg8koiIemtw== dependencies: - destr "^2.0.1" - node-fetch-native "^1.4.0" - ufo "^1.3.0" + destr "^2.0.3" + node-fetch-native "^1.6.3" + ufo "^1.5.3" ohash@^1.1.3: version "1.1.3" @@ -19592,9 +19887,9 @@ pacote@^13.0.3, pacote@^13.6.1: tar "^6.1.11" pako@^2.0.2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pako/-/pako-2.0.4.tgz#6cebc4bbb0b6c73b0d5b8d7e8476e2b2fbea576d" - integrity sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg== + version "2.1.0" + resolved "https://registry.yarnpkg.com/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86" + integrity sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug== pako@~1.0.5: version "1.0.11" @@ -19630,16 +19925,17 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" -parse-asn1@^5.0.0, parse-asn1@^5.1.5: - version "5.1.6" - resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.6.tgz#385080a3ec13cb62a62d39409cb3e88844cdaed4" - integrity sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw== +parse-asn1@^5.0.0, parse-asn1@^5.1.7: + version "5.1.7" + resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.7.tgz#73cdaaa822125f9647165625eb45f8a051d2df06" + integrity sha512-CTM5kuWR3sx9IFamcl5ErfPl6ea/N8IYwiJ+vpeB2g+1iknv7zBl5uPwbMbRVznRVbrNY6lGuDoE5b30grmbqg== dependencies: - asn1.js "^5.2.0" - browserify-aes "^1.0.0" - evp_bytestokey "^1.0.0" - pbkdf2 "^3.0.3" - safe-buffer "^5.1.1" + asn1.js "^4.10.1" + browserify-aes "^1.2.0" + evp_bytestokey "^1.0.3" + hash-base "~3.0" + pbkdf2 "^3.1.2" + safe-buffer "^5.2.1" parse-conflict-json@^2.0.1: version "2.0.2" @@ -19865,12 +20161,12 @@ path@^0.12.7: process "^0.11.1" util "^0.10.3" -pathe@^1.1.0, pathe@^1.1.1, pathe@^1.1.2: +pathe@^1.1.1, pathe@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/pathe/-/pathe-1.1.2.tgz#6c4cb47a945692e48a1ddd6e4094d170516437ec" integrity sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ== -pbkdf2@^3.0.3: +pbkdf2@^3.0.3, pbkdf2@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== @@ -19989,14 +20285,14 @@ pkg-dir@^5.0.0: dependencies: find-up "^5.0.0" -pkg-types@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/pkg-types/-/pkg-types-1.0.3.tgz#988b42ab19254c01614d13f4f65a2cfc7880f868" - integrity sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A== +pkg-types@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pkg-types/-/pkg-types-1.1.0.tgz#3ec1bf33379030fd0a34c227b6c650e8ea7ca271" + integrity sha512-/RpmvKdxKf8uILTtoOhAgf30wYbP2Qw+L9p3Rvshx1JZVX+XQNZQFjlbmGHEGIm4CkVPlSn+NXmIM8+9oWQaSA== dependencies: - jsonc-parser "^3.2.0" - mlly "^1.2.0" - pathe "^1.1.0" + confbox "^0.1.7" + mlly "^1.6.1" + pathe "^1.1.2" plur@^2.1.2: version "2.1.2" @@ -20020,15 +20316,20 @@ polished@^4.2.2: "@babel/runtime" "^7.17.8" pony-cause@^2.1.10: - version "2.1.10" - resolved "https://registry.yarnpkg.com/pony-cause/-/pony-cause-2.1.10.tgz#828457ad6f13be401a075dbf14107a9057945174" - integrity sha512-3IKLNXclQgkU++2fSi93sQ6BznFuxSLB11HdvZQ6JW/spahf/P1pAHBQEahr20rs0htZW0UDkM1HmA+nZkXKsw== + version "2.1.11" + resolved "https://registry.yarnpkg.com/pony-cause/-/pony-cause-2.1.11.tgz#d69a20aaccdb3bdb8f74dd59e5c68d8e6772e4bd" + integrity sha512-M7LhCsdNbNgiLYiP4WjsfLUuFmCfnjdF6jKe2R9NKl4WFN+HZPGHJZ9lnLP7f9ZnKe3U9nuWD0szirmj+migUg== posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" integrity sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg== +possible-typed-array-names@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz#89bb63c6fada2c3e90adc4a647beeeb39cc7bf8f" + integrity sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q== + postcss-css-variables@0.18.0: version "0.18.0" resolved "https://registry.yarnpkg.com/postcss-css-variables/-/postcss-css-variables-0.18.0.tgz#d97b6da19e86245eb817006e11117382f997bb93" @@ -20601,13 +20902,20 @@ qs@6.9.3: resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.3.tgz#bfadcd296c2d549f1dffa560619132c977f5008e" integrity sha512-EbZYNarm6138UKKq46tdx08Yo/q9ZhFoAXAI1meAFd2GtbRDhbZY2WQSICskT0c5q99aFzLG1D4nvTk9tqfXIw== -qs@^6.10.0, qs@^6.11.0: +qs@^6.10.0: version "6.11.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.2.tgz#64bea51f12c1f5da1bc01496f48ffcff7c69d7d9" integrity sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA== dependencies: side-channel "^1.0.4" +qs@^6.11.0, qs@^6.11.2: + version "6.12.1" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.12.1.tgz#39422111ca7cbdb70425541cba20c7d7b216599a" + integrity sha512-zWmv4RSuB9r2mYQw3zxQuHWeU+42aKi1wWig/j4ele4ygELZ7PEO6MM7rim9oAQH2A5MWfsAVf/jPvTPgCbvUQ== + dependencies: + side-channel "^1.0.6" + query-string@7.1.3, query-string@^7.1.3: version "7.1.3" resolved "https://registry.yarnpkg.com/query-string/-/query-string-7.1.3.tgz#a1cf90e994abb113a325804a972d98276fe02328" @@ -20661,9 +20969,9 @@ quick-lru@^5.1.1: integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== radix3@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/radix3/-/radix3-1.1.0.tgz#9745df67a49c522e94a33d0a93cf743f104b6e0d" - integrity sha512-pNsHDxbGORSvuSScqNJ+3Km6QAVqk8CfsCBIEoDgpqLrkD2f3QM4I7d1ozJJ172OmIcoUcerZaNWqtLkRXTV3A== + version "1.1.2" + resolved "https://registry.yarnpkg.com/radix3/-/radix3-1.1.2.tgz#fd27d2af3896c6bf4bcdfab6427c69c2afc69ec0" + integrity sha512-b484I/7b8rDEdSDKckSSBA8knMpcdsXudlE/LNL639wFoHKwLbEkQFZHWEYwDC0wa0FKUcCY+GAF73Z7wxNVFA== ramda@^0.28.0: version "0.28.0" @@ -21016,7 +21324,7 @@ read@1, read@^1.0.7: dependencies: mute-stream "~0.0.4" -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -21038,6 +21346,19 @@ readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stre string_decoder "^1.1.1" util-deprecate "^1.0.1" +readable-stream@^2.3.3, readable-stream@^2.3.8: + version "2.3.8" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" + integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + readable-stream@^4.5.2: version "4.5.2" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-4.5.2.tgz#9e7fc4c45099baeed934bff6eb97ba6cf2729e09" @@ -21092,6 +21413,13 @@ rechoir@^0.6.2: dependencies: resolve "^1.1.6" +rechoir@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.8.0.tgz#49f866e0d32146142da3ad8f0eff352b3215ff22" + integrity sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ== + dependencies: + resolve "^1.20.0" + recoil@^0.7.2: version "0.7.4" resolved "https://registry.yarnpkg.com/recoil/-/recoil-0.7.4.tgz#d6508fa656d9c93e66fdf334e1f723a9e98801cf" @@ -21115,18 +21443,6 @@ redent@^3.0.0: indent-string "^4.0.0" strip-indent "^3.0.0" -redis-errors@^1.0.0, redis-errors@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/redis-errors/-/redis-errors-1.2.0.tgz#eb62d2adb15e4eaf4610c04afe1529384250abad" - integrity sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w== - -redis-parser@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-3.0.0.tgz#b66d828cdcafe6b4b8a428a7def4c6bcac31c8b4" - integrity sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A== - dependencies: - redis-errors "^1.0.0" - regenerate-unicode-properties@^10.0.1: version "10.0.1" resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.0.1.tgz#7f442732aa7934a3740c779bb9b3340dccc1fb56" @@ -21145,9 +21461,9 @@ regenerator-runtime@^0.13.4, regenerator-runtime@^0.13.7: integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== regenerator-runtime@^0.14.0: - version "0.14.0" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45" - integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA== + version "0.14.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" + integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== regenerator-transform@^0.15.0: version "0.15.0" @@ -21549,12 +21865,11 @@ rollup@2.78.0: optionalDependencies: fsevents "~2.3.2" -rpc-websockets@^7.5.1: - version "7.6.0" - resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.6.0.tgz#d3f4c0dac108ca35566b0e31552c32e58928cd04" - integrity sha512-Jgcs8q6t8Go98dEulww1x7RysgTkzpCMelVxZW4hvuyFtOGpeUz9prpr2KjUa/usqxgFCd9Tu3+yhHEP9GVmiQ== +rpc-websockets@^7.11.0, rpc-websockets@^7.5.1: + version "7.11.0" + resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.11.0.tgz#05451975963a7d1a4cf36d54e200bfc4402a56d7" + integrity sha512-IkLYjayPv6Io8C/TdCL5gwgzd1hFz2vmBZrjMw/SPEXo51ETOhnzgS4Qy5GWi2JQN7HKHa66J3+2mv0fgNh/7w== dependencies: - "@babel/runtime" "^7.17.2" eventemitter3 "^4.0.7" uuid "^8.3.2" ws "^8.5.0" @@ -21605,14 +21920,14 @@ rx-lite@*, rx-lite@^4.0.8: resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" integrity sha512-Cun9QucwK6MIrp3mry/Y7hqD1oFqTYLQ4pGxaHTjIdaFDWRGGLikqp6u8LcWJnzpoALg9hap+JGk8sFIUuEGNA== -rxjs@6, rxjs@^6.4.0: +rxjs@^6.4.0: version "6.6.7" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== dependencies: tslib "^1.9.0" -rxjs@^7.5.5: +rxjs@^7.5.5, rxjs@^7.8.1: version "7.8.1" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== @@ -21636,7 +21951,7 @@ safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: +safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -21653,7 +21968,7 @@ safe-stable-stringify@^2.1.0, safe-stable-stringify@^2.3.1: resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz#138c84b6f6edb3db5f8ef3ef7115b8f55ccbf886" integrity sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g== -"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.1.0: +"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== @@ -21734,6 +22049,15 @@ schema-utils@^3.0.0, schema-utils@^3.1.0, schema-utils@^3.1.1: ajv "^6.12.5" ajv-keywords "^3.5.2" +schema-utils@^3.2.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.3.0.tgz#f50a88877c3c01652a15b622ae9e9795df7a60fe" + integrity sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg== + dependencies: + "@types/json-schema" "^7.0.8" + ajv "^6.12.5" + ajv-keywords "^3.5.2" + screenfull@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/screenfull/-/screenfull-5.2.0.tgz#6533d524d30621fc1283b9692146f3f13a93d1ba" @@ -21782,7 +22106,7 @@ semver@7.3.4: dependencies: lru-cache "^6.0.0" -semver@7.x, semver@^7.0.0, semver@^7.1.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.5.0, semver@^7.5.4: +semver@7.x, semver@^7.0.0, semver@^7.1.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.7: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== @@ -21794,6 +22118,13 @@ semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0, semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== +semver@^7.3.5, semver@^7.5.0, semver@^7.5.4: + version "7.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.0.tgz#1a46a4db4bffcccd97b743b5005c8325f23d4e2d" + integrity sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg== + dependencies: + lru-cache "^6.0.0" + send@0.18.0: version "0.18.0" resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" @@ -21843,6 +22174,13 @@ serialize-javascript@^6.0.0: dependencies: randombytes "^2.1.0" +serialize-javascript@^6.0.1: + version "6.0.2" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" + integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== + dependencies: + randombytes "^2.1.0" + serve-favicon@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/serve-favicon/-/serve-favicon-2.5.0.tgz#935d240cdfe0f5805307fdfe967d88942a2cbcf0" @@ -21877,16 +22215,16 @@ set-blocking@^2.0.0: integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== set-function-length@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.1.tgz#47cc5945f2c771e2cf261c6737cf9684a2a5e425" - integrity sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g== + version "1.2.2" + resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" + integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== dependencies: - define-data-property "^1.1.2" + define-data-property "^1.1.4" es-errors "^1.3.0" function-bind "^1.1.2" - get-intrinsic "^1.2.3" + get-intrinsic "^1.2.4" gopd "^1.0.1" - has-property-descriptors "^1.0.1" + has-property-descriptors "^1.0.2" set-harmonic-interval@^1.0.1: version "1.0.1" @@ -21980,14 +22318,15 @@ shelljs@0.8.5: interpret "^1.0.0" rechoir "^0.6.2" -side-channel@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== +side-channel@^1.0.4, side-channel@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.6.tgz#abd25fb7cd24baf45466406b1096b7831c9215f2" + integrity sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA== dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" + call-bind "^1.0.7" + es-errors "^1.3.0" + get-intrinsic "^1.2.4" + object-inspect "^1.13.1" sigmund@^1.0.1: version "1.0.1" @@ -22125,9 +22464,9 @@ snapdragon@^0.8.1: use "^3.1.0" socket.io-client@^4.7.2: - version "4.7.4" - resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-4.7.4.tgz#5f0e060ff34ac0a4b4c5abaaa88e0d1d928c64c8" - integrity sha512-wh+OkeF0rAVCrABWQBaEjLfb7DVPotMbu0cgWgyR0v6eA4EoVnAwcIeIbcdTE3GT/H3kbdLl7OoH2+asoDRIIg== + version "4.7.5" + resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-4.7.5.tgz#919be76916989758bdc20eec63f7ee0ae45c05b7" + integrity sha512-sJ/tqHOCe7Z50JCBCXrsY3I2k03iOiUe+tj1OmKeD2lXPiGH/RUCdTZFoqVyN7l1MnpIzPrGtLcijffmeouNlQ== dependencies: "@socket.io/component-emitter" "~3.1.0" debug "~4.3.2" @@ -22395,11 +22734,6 @@ stacktrace-parser@^0.1.10: dependencies: type-fest "^0.7.1" -standard-as-callback@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/standard-as-callback/-/standard-as-callback-2.1.0.tgz#8953fc05359868a77b5b9739a665c5977bb7df45" - integrity sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A== - state-toggle@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.3.tgz#e123b16a88e143139b09c6852221bc9815917dfe" @@ -22491,10 +22825,10 @@ stream-http@^2.7.2: to-arraybuffer "^1.0.0" xtend "^4.0.0" -stream-shift@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" - integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== +stream-shift@^1.0.0, stream-shift@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.3.tgz#85b8fab4d71010fc3ba8772e8046cc49b8a3864b" + integrity sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ== stream@^0.0.2: version "0.0.2" @@ -22799,9 +23133,9 @@ superstruct@^0.14.2: integrity sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ== superstruct@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-1.0.3.tgz#de626a5b49c6641ff4d37da3c7598e7a87697046" - integrity sha512-8iTn3oSS8nRGn+C2pgXSKPI3jmpm6FExNazNpjvqS6ZUJQCej3PUXEKM8NjHBOs54ExM+LPW/FBRhymrdcCiSg== + version "1.0.4" + resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-1.0.4.tgz#0adb99a7578bd2f1c526220da6571b2d485d91ca" + integrity sha512-7JpaAoX2NGyoFlI9NBh66BQXGONc+uE+MRS5i2iOBKuS4e+ccgMDjATgZldkah+33DakBxDHiss9kvUcGAO8UQ== supports-color@^2.0.0: version "2.0.0" @@ -23054,6 +23388,17 @@ terser-webpack-plugin@^5.0.3, terser-webpack-plugin@^5.1.3: serialize-javascript "^6.0.0" terser "^5.14.1" +terser-webpack-plugin@^5.3.10: + version "5.3.10" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz#904f4c9193c6fd2a03f693a2150c62a92f40d199" + integrity sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w== + dependencies: + "@jridgewell/trace-mapping" "^0.3.20" + jest-worker "^27.4.5" + schema-utils "^3.1.1" + serialize-javascript "^6.0.1" + terser "^5.26.0" + terser@^4.1.2, terser@^4.6.3: version "4.8.0" resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.0.tgz#63056343d7c70bb29f3af665865a46fe03a0df17" @@ -23073,6 +23418,16 @@ terser@^5.10.0, terser@^5.14.1, terser@^5.3.4: commander "^2.20.0" source-map-support "~0.5.20" +terser@^5.26.0: + version "5.31.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.31.0.tgz#06eef86f17007dbad4593f11a574c7f5eb02c6a1" + integrity sha512-Q1JFAoUKE5IMfI4Z/lkE/E6+SwgzO+x4tq4v1AyBLRj8VSYvRO6A/rQrPg1yud4g0En9EKI1TvFRF2tQFcoUkg== + dependencies: + "@jridgewell/source-map" "^0.3.3" + acorn "^8.8.2" + commander "^2.20.0" + source-map-support "~0.5.20" + test-exclude@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" @@ -23188,7 +23543,12 @@ tmp@^0.0.33: dependencies: os-tmpdir "~1.0.2" -tmp@^0.2.1, tmp@~0.2.1: +tmp@^0.2.1: + version "0.2.3" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.3.tgz#eb783cc22bc1e8bebd0671476d46ea4eb32a79ae" + integrity sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w== + +tmp@~0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14" integrity sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ== @@ -23568,11 +23928,6 @@ tween-functions@^1.2.0: resolved "https://registry.yarnpkg.com/tween-functions/-/tween-functions-1.2.0.tgz#1ae3a50e7c60bb3def774eac707acbca73bbc3ff" integrity sha512-PZBtLYcCLtEcjL14Fzb1gSxPBeL7nWvGhO5ZFPGqziCcr8uvHp0NDmdjBchp6KHL+tExcg0m3NISmKxhU394dA== -tweetnacl-util@^0.15.1: - version "0.15.1" - resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" - integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== - tweetnacl@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" @@ -23682,10 +24037,10 @@ ua-parser-js@^1.0.35: resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.37.tgz#b5dc7b163a5c1f0c510b08446aed4da92c46373f" integrity sha512-bhTyI94tZofjo+Dn8SN6Zv8nBDvyXTymAdM3LDI/0IboIUwTu1rEhW7v2TfiVsoYWgkQ4kOVqnI8APUFbIQIFQ== -ufo@^1.3.0, ufo@^1.3.1, ufo@^1.3.2, ufo@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.4.0.tgz#39845b31be81b4f319ab1d99fd20c56cac528d32" - integrity sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ== +ufo@^1.4.0, ufo@^1.5.3: + version "1.5.3" + resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.5.3.tgz#3325bd3c977b6c6cd3160bf4ff52989adc9d3344" + integrity sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw== uglify-js@^3.1.4: version "3.16.1" @@ -23724,6 +24079,11 @@ underscore@~1.6.0: resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.6.0.tgz#8b38b10cacdef63337b8b24e4ff86d45aea529a8" integrity sha512-z4o1fvKUojIWh9XuaVLUDdf86RQiq13AC1dmHbTpoyuu+bquHms76v16CjycCbec87J7z0k//SiQVk0sMdFmpQ== +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== + unenv@^1.9.0: version "1.9.0" resolved "https://registry.yarnpkg.com/unenv/-/unenv-1.9.0.tgz#469502ae85be1bd3a6aa60f810972b1a904ca312" @@ -23976,21 +24336,20 @@ unset-value@^1.0.0: isobject "^3.0.0" unstorage@^1.9.0: - version "1.10.1" - resolved "https://registry.yarnpkg.com/unstorage/-/unstorage-1.10.1.tgz#bf8cc00a406e40a6293e893da9807057d95875b0" - integrity sha512-rWQvLRfZNBpF+x8D3/gda5nUCQL2PgXy2jNG4U7/Rc9BGEv9+CAJd0YyGCROUBKs9v49Hg8huw3aih5Bf5TAVw== + version "1.10.2" + resolved "https://registry.yarnpkg.com/unstorage/-/unstorage-1.10.2.tgz#fb7590ada8b30e83be9318f85100158b02a76dae" + integrity sha512-cULBcwDqrS8UhlIysUJs2Dk0Mmt8h7B0E6mtR+relW9nZvsf/u4SkAYyNliPiPW7XtFNb5u3IUMkxGxFTTRTgQ== dependencies: anymatch "^3.1.3" - chokidar "^3.5.3" - destr "^2.0.2" - h3 "^1.8.2" - ioredis "^5.3.2" - listhen "^1.5.5" - lru-cache "^10.0.2" + chokidar "^3.6.0" + destr "^2.0.3" + h3 "^1.11.1" + listhen "^1.7.2" + lru-cache "^10.2.0" mri "^1.2.0" - node-fetch-native "^1.4.1" + node-fetch-native "^1.6.2" ofetch "^1.3.3" - ufo "^1.3.1" + ufo "^1.4.0" untildify@^2.0.0: version "2.1.0" @@ -24026,6 +24385,14 @@ update-browserslist-db@^1.0.11: escalade "^3.1.1" picocolors "^1.0.0" +update-browserslist-db@^1.0.13: + version "1.0.15" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.15.tgz#60ed9f8cba4a728b7ecf7356f641a31e3a691d97" + integrity sha512-K9HWH62x3/EalU1U6sjSZiylm9C8tgq2mSvshZpqc7QE69RaA2qjhkW2HlNA0tFpEbtyFz7HTqbSdN4MSwUodA== + dependencies: + escalade "^3.1.2" + picocolors "^1.0.0" + upper-case-first@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/upper-case-first/-/upper-case-first-2.0.2.tgz#992c3273f882abd19d1e02894cc147117f844324" @@ -24074,7 +24441,7 @@ url@0.10.3: punycode "1.3.2" querystring "0.2.0" -url@^0.11.0, url@^0.11.1: +url@^0.11.0: version "0.11.1" resolved "https://registry.yarnpkg.com/url/-/url-0.11.1.tgz#26f90f615427eca1b9f4d6a28288c147e2302a32" integrity sha512-rWS3H04/+mzzJkv0eZ7vEDGiQbgquI1fGfOad6zKvgYQi1SzMmhl7c/DdRGxhaWrVH6z0qWITo8rpnxK/RfEhA== @@ -24082,6 +24449,14 @@ url@^0.11.0, url@^0.11.1: punycode "^1.4.1" qs "^6.11.0" +url@^0.11.1: + version "0.11.3" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.3.tgz#6f495f4b935de40ce4a0a52faee8954244f3d3ad" + integrity sha512-6hxOLGfZASQK/cijlZnZJTq8OXAkt/3YGfQX45vvMYXpZoo8NdWZcY73K108Jf759lS1Bv/8wXnHDTSz17dSRw== + dependencies: + punycode "^1.4.1" + qs "^6.11.2" + urlpattern-polyfill@^8.0.0: version "8.0.2" resolved "https://registry.yarnpkg.com/urlpattern-polyfill/-/urlpattern-polyfill-8.0.2.tgz#99f096e35eff8bf4b5a2aa7d58a1523d6ebc7ce5" @@ -24163,9 +24538,9 @@ utila@~0.4: integrity sha512-Z0DbgELS9/L/75wZbro8xAnT50pBVFQZ+hUEueGDU5FN51YSCYM+jdxsfCiHjwNP/4LCDD0i/graKpeBnOXKRA== utility-types@^3.10.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/utility-types/-/utility-types-3.10.0.tgz#ea4148f9a741015f05ed74fd615e1d20e6bed82b" - integrity sha512-O11mqxmi7wMKCo6HKFt5AhO4BwY3VV68YU07tgxfz8zJTIxr4BpsezN49Ffwy9j3ZpwwJp4fkRwjRzq3uWE6Rg== + version "3.11.0" + resolved "https://registry.yarnpkg.com/utility-types/-/utility-types-3.11.0.tgz#607c40edb4f258915e901ea7995607fdf319424c" + integrity sha512-6Z7Ma2aVEWisaL6TvBCy7P8rm2LQoPv6dJ7ecIaIixHcwfbJ0x7mWdbcwlIM5IGQxPZSFYeqRCqlOOeKoJYMkw== utils-merge@1.0.1: version "1.0.1" @@ -24359,6 +24734,14 @@ watchpack@^2.2.0, watchpack@^2.4.0: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" +watchpack@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.1.tgz#29308f2cac150fa8e4c92f90e0ec954a9fed7fff" + integrity sha512-8wrBCMtVhqcXP2Sup1ctSkga6uc2Bx0IIvKyT7yTFier5AXHooSI+QyQQAtTb7+E0IUCCKyTFmXqdqgum2XWGg== + dependencies: + glob-to-regexp "^0.4.1" + graceful-fs "^4.1.2" + wcwidth@^1.0.0, wcwidth@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" @@ -24387,7 +24770,15 @@ webcrypto-core@^1.7.7: pvtsutils "^1.3.2" tslib "^2.4.0" -"webextension-polyfill@>=0.10.0 <1.0", webextension-polyfill@^0.10.0: +"webextension-polyfill@>=0.10.0 <1.0": + version "0.11.0" + resolved "https://registry.yarnpkg.com/webextension-polyfill/-/webextension-polyfill-0.11.0.tgz#1640c0d27192424fd5b420237acbe453f88c8246" + integrity sha512-YUBSKQA0iCx2YtM75VFgvvcx1hLKaGGiph6a6UaUdSgk32VT9SzrcDAKBjeGHXoAZTnNBqS5skA4VfoKMXhEBA== + dependencies: + webpack "^5.91.0" + webpack-cli "^5.1.4" + +webextension-polyfill@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/webextension-polyfill/-/webextension-polyfill-0.10.0.tgz#ccb28101c910ba8cf955f7e6a263e662d744dbb8" integrity sha512-c5s35LgVa5tFaHhrZDnr3FpQpjj1BB+RXhLTYUxGqBVN460HkbM8TBtEqdXWbpTKfzwCcjAZVF7zXCYSKtcp9g== @@ -24431,6 +24822,25 @@ webpack-bundle-analyzer@4.3.0: sirv "^1.0.7" ws "^7.3.1" +webpack-cli@^5.1.4: + version "5.1.4" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-5.1.4.tgz#c8e046ba7eaae4911d7e71e2b25b776fcc35759b" + integrity sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg== + dependencies: + "@discoveryjs/json-ext" "^0.5.0" + "@webpack-cli/configtest" "^2.1.1" + "@webpack-cli/info" "^2.0.2" + "@webpack-cli/serve" "^2.0.5" + colorette "^2.0.14" + commander "^10.0.1" + cross-spawn "^7.0.3" + envinfo "^7.7.3" + fastest-levenshtein "^1.0.12" + import-local "^3.0.2" + interpret "^3.1.1" + rechoir "^0.8.0" + webpack-merge "^5.7.3" + webpack-dev-middleware@^3.7.3: version "3.7.3" resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-3.7.3.tgz#0639372b143262e2b84ab95d3b91a7597061c2c5" @@ -24477,6 +24887,15 @@ webpack-log@^2.0.0: ansi-colors "^3.0.0" uuid "^3.3.2" +webpack-merge@^5.7.3: + version "5.10.0" + resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.10.0.tgz#a3ad5d773241e9c682803abf628d4cd62b8a4177" + integrity sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA== + dependencies: + clone-deep "^4.0.1" + flat "^5.0.2" + wildcard "^2.0.0" + webpack-sources@^1.4.0, webpack-sources@^1.4.1, webpack-sources@^1.4.3: version "1.4.3" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.3.tgz#eedd8ec0b928fbf1cbfe994e22d2d890f330a933" @@ -24561,6 +24980,36 @@ webpack@4: watchpack "^2.4.0" webpack-sources "^3.2.3" +webpack@^5.91.0: + version "5.91.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.91.0.tgz#ffa92c1c618d18c878f06892bbdc3373c71a01d9" + integrity sha512-rzVwlLeBWHJbmgTC/8TvAcu5vpJNII+MelQpylD4jNERPwpBJOE2lEcko1zJX3QJeLjTTAnQxn/OJ8bjDzVQaw== + dependencies: + "@types/eslint-scope" "^3.7.3" + "@types/estree" "^1.0.5" + "@webassemblyjs/ast" "^1.12.1" + "@webassemblyjs/wasm-edit" "^1.12.1" + "@webassemblyjs/wasm-parser" "^1.12.1" + acorn "^8.7.1" + acorn-import-assertions "^1.9.0" + browserslist "^4.21.10" + chrome-trace-event "^1.0.2" + enhanced-resolve "^5.16.0" + es-module-lexer "^1.2.1" + eslint-scope "5.1.1" + events "^3.2.0" + glob-to-regexp "^0.4.1" + graceful-fs "^4.2.11" + json-parse-even-better-errors "^2.3.1" + loader-runner "^4.2.0" + mime-types "^2.1.27" + neo-async "^2.6.2" + schema-utils "^3.2.0" + tapable "^2.1.1" + terser-webpack-plugin "^5.3.10" + watchpack "^2.4.1" + webpack-sources "^3.2.3" + whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" @@ -24585,16 +25034,16 @@ which-module@^2.0.0: resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.1.tgz#776b1fe35d90aebe99e8ac15eb24093389a4a409" integrity sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ== -which-typed-array@^1.1.11, which-typed-array@^1.1.2: - version "1.1.11" - resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.11.tgz#99d691f23c72aab6768680805a271b69761ed61a" - integrity sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew== +which-typed-array@^1.1.14, which-typed-array@^1.1.2: + version "1.1.15" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.15.tgz#264859e9b11a649b388bfaaf4f767df1f779b38d" + integrity sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA== dependencies: - available-typed-arrays "^1.0.5" - call-bind "^1.0.2" + available-typed-arrays "^1.0.7" + call-bind "^1.0.7" for-each "^0.3.3" gopd "^1.0.1" - has-tostringtag "^1.0.0" + has-tostringtag "^1.0.2" which@^1.2.9: version "1.3.1" @@ -24631,6 +25080,11 @@ wif@^2.0.6: dependencies: bs58check "<3.0.0" +wildcard@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.1.tgz#5ab10d02487198954836b6349f74fff961e10f67" + integrity sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ== + winston-transport@^4.4.0: version "4.5.0" resolved "https://registry.yarnpkg.com/winston-transport/-/winston-transport-4.5.0.tgz#6e7b0dd04d393171ed5e4e4905db265f7ab384fa" @@ -24776,7 +25230,7 @@ ws@7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== -ws@8.14.2, ws@^8.12.0, ws@^8.13.0, ws@^8.2.3, ws@^8.5.0: +ws@8.14.2, ws@^8.12.0, ws@^8.13.0, ws@^8.2.3: version "8.14.2" resolved "https://registry.yarnpkg.com/ws/-/ws-8.14.2.tgz#6c249a806eb2db7a20d26d51e7709eab7b2e6c7f" integrity sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g== @@ -24786,6 +25240,11 @@ ws@^7, ws@^7.3.1, ws@^7.4.5, ws@^7.5.1, ws@^7.5.9: resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== +ws@^8.5.0: + version "8.17.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.0.tgz#d145d18eca2ed25aaf791a183903f7be5e295fea" + integrity sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow== + ws@~8.11.0: version "8.11.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.11.0.tgz#6a0d36b8edfd9f96d8b25683db2f8d7de6e8e143" From 9f94511cc224820b893e89d25e150207b3c480eb Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 9 May 2024 10:10:32 -0400 Subject: [PATCH 153/438] only show custom app URL warning card if URL exists --- packages/stateless/components/dao/tabs/AppsTab.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stateless/components/dao/tabs/AppsTab.tsx b/packages/stateless/components/dao/tabs/AppsTab.tsx index 64d7049d2..2c6103846 100644 --- a/packages/stateless/components/dao/tabs/AppsTab.tsx +++ b/packages/stateless/components/dao/tabs/AppsTab.tsx @@ -115,7 +115,7 @@ const InnerAppsTab = ({ ({ url: appUrl }) => appUrl === url || !appUrl ) - const customSelected = selectedAppIndex === DAO_APPS.length - 1 + const customSelected = !!url && selectedAppIndex === DAO_APPS.length - 1 return (
From 381cbd06956de28f6e0de45f46fd1d372776f039 Mon Sep 17 00:00:00 2001 From: noah Date: Thu, 9 May 2024 09:11:21 -0700 Subject: [PATCH 154/438] Profile and home UX overhaul (#1769) --- apps/dapp/next.config.js | 15 +- apps/dapp/pages/{me => }/[[...tab]].tsx | 11 +- apps/dapp/pages/dao/[address]/[[...slug]].tsx | 9 +- .../dao/[address]/proposals/[proposalId].tsx | 13 +- .../pages/dao/[address]/proposals/create.tsx | 15 +- apps/dapp/pages/{index.tsx => gov.tsx} | 5 +- apps/dapp/pages/gov/[chain]/[[...slug]].tsx | 45 -- .../gov/[chain]/proposals/[proposalId].tsx | 31 -- .../pages/gov/[chain]/proposals/create.tsx | 37 -- apps/dapp/pages/gov/index.tsx | 31 -- apps/dapp/pages/notifications/[[...slug]].tsx | 2 - apps/dapp/pages/{[chain].tsx => profile.tsx} | 16 +- apps/dapp/public/site.webmanifest | 14 +- packages/i18n/locales/en/translation.json | 10 +- packages/state/recoil/atoms/proposals.ts | 9 - packages/state/recoil/selectors/account.ts | 14 +- packages/state/recoil/selectors/chain.ts | 101 +++-- packages/state/recoil/selectors/inbox.ts | 46 +- packages/state/recoil/selectors/indexer.ts | 16 +- packages/state/recoil/selectors/treasury.ts | 6 + packages/stateful/actions/react/provider.tsx | 21 +- .../stateful/command/contexts/generic/dao.tsx | 33 +- .../command/contexts/generic/index.ts | 35 +- .../useFollowingAndFilteredDaosSections.ts | 116 +++-- .../stateful/components/DaoCreatedModal.tsx | 25 +- packages/stateful/components/DappLayout.tsx | 51 +-- .../components/SelfRelayExecuteModal.tsx | 4 +- .../stateful/components/dao/CreateDaoForm.tsx | 81 ++-- .../components/dao/CreateDaoProposal.tsx | 2 +- packages/stateful/components/dao/DaoCard.tsx | 27 +- .../components/dao/DaoPageWrapper.tsx | 39 +- .../stateful/components/dao/DaoProposal.tsx | 4 +- .../stateful/components/dao/DaoProviders.tsx | 36 +- .../stateful/components/dao/LazyDaoCard.tsx | 17 +- .../components/gov/GovPageWrapper.tsx | 133 ------ .../stateful/components/gov/GovProposal.tsx | 72 +++- .../components/gov/GovProposalLine.tsx | 14 +- .../components/gov/GovProposalList.tsx | 24 +- .../gov/GovProposalStatusAndInfo.tsx | 15 +- .../components/gov/NewGovProposal.tsx | 38 +- packages/stateful/components/gov/index.ts | 1 - .../inbox/InboxMainItemRenderer.tsx | 9 +- .../components/inbox/renderers/JoinedDao.tsx | 7 +- .../components/nft/NftSelectionModal.tsx | 10 +- .../stateful/components/pages/AccountDaos.tsx | 36 +- .../components/pages/ChainGovernanceHome.tsx | 174 -------- .../components/pages/ChainGovernanceList.tsx | 32 ++ .../stateful/components/pages/DaoDappHome.tsx | 199 +++++---- .../stateful/components/pages/EditProfile.tsx | 88 ++++ packages/stateful/components/pages/Home.tsx | 117 +++-- .../pages/NeutronGovernanceHome.tsx | 89 ---- .../pages/{Me.tsx => ProfileHome.tsx} | 103 ++--- packages/stateful/components/pages/index.ts | 6 +- .../components/profile/MergeProfilesModal.tsx | 8 +- .../components/profile/ProfileAddChains.tsx | 6 +- .../components/profile/ProfileDaos.tsx | 45 +- .../components/profile/ProfileFeed.tsx | 10 + .../components/profile/ProfileWallet.tsx | 6 +- packages/stateful/components/profile/index.ts | 1 + .../components/wallet/DisconnectWallet.tsx | 26 +- .../stateful/components/wallet/WalletDaos.tsx | 126 +++++- .../components/wallet/WalletLazyNftCard.tsx | 6 +- .../components/wallet/WalletTokenCard.tsx | 4 +- packages/stateful/feed/react/useFeed.ts | 36 +- .../OpenProposalsProposalLineProps.tsx | 11 + .../feed/sources/OpenProposals/index.ts | 81 ++-- .../feed/sources/OpenProposals/state.ts | 408 +++++++++++++----- .../feed/sources/OpenProposals/types.ts | 14 + .../feed/sources/VetoableProposals/index.ts | 86 ++-- .../feed/sources/VetoableProposals/state.ts | 60 ++- packages/stateful/hooks/index.ts | 1 + .../hooks/useCfWorkerAuthPostRequest.ts | 163 ++++--- packages/stateful/hooks/useDaoTabs.ts | 127 +++--- packages/stateful/hooks/useFollowingDaos.ts | 169 ++++---- packages/stateful/hooks/useGovDaoTabs.ts | 62 +++ packages/stateful/hooks/useInbox.ts | 46 +- packages/stateful/hooks/useInboxApi.ts | 37 +- packages/stateful/hooks/useInboxApiWithUi.tsx | 17 +- .../stateful/hooks/useLoadingDaoCardInfos.ts | 37 +- packages/stateful/hooks/useManageProfile.ts | 52 ++- packages/stateful/hooks/useProfile.ts | 21 + packages/stateful/hooks/useWebSocket.ts | 14 +- packages/stateful/package.json | 2 + .../common/components/NewProposal.tsx | 6 +- .../common/components/NewProposal.tsx | 6 +- .../stateful/recoil/selectors/dao/cards.ts | 300 ++++++++----- .../recoil/selectors/dao/following.ts | 109 +++-- .../stateful/recoil/selectors/dao/misc.ts | 61 ++- packages/stateful/recoil/selectors/entity.ts | 33 +- packages/stateful/recoil/selectors/profile.ts | 2 + packages/stateful/recoil/selectors/wallet.ts | 62 ++- packages/stateful/server/index.ts | 1 - .../stateful/server/makeGetDaoStaticProps.ts | 271 +++++++++++- .../stateful/server/makeGetGovStaticProps.ts | 339 --------------- .../components/HorizontalScroller.stories.tsx | 1 + .../components/actions/ActionsEditor.tsx | 1 + .../components/dao/DaoCard.stories.tsx | 1 + .../stateless/components/dao/DaoImage.tsx | 12 +- .../components/dao/FollowingDaos.stories.tsx | 43 -- .../components/dao/FollowingDaos.tsx | 96 ----- packages/stateless/components/dao/index.ts | 1 - packages/stateless/components/index.ts | 2 +- .../components/layout/Breadcrumbs.tsx | 21 +- .../components/layout/DappLayout.stories.tsx | 4 + .../components/layout/DappLayout.tsx | 126 +++--- .../layout/DappNavigation.stories.tsx | 7 - .../components/layout/DappNavigation.tsx | 61 +-- .../stateless/components/layout/DockItem.tsx | 4 +- .../stateless/components/layout/Footer.tsx | 7 +- packages/stateless/components/layout/Row.tsx | 8 +- .../stateless/components/layout/SdaLayout.tsx | 4 +- .../components/not_found/ProposalNotFound.tsx | 10 +- .../components/profile/ProfileDaos.tsx | 26 ++ .../{Feed.tsx => profile/ProfileFeed.tsx} | 12 +- .../stateless/components/profile/index.ts | 2 + .../proposal/GovProposalCreatedModal.tsx | 41 -- .../proposal/ProposalCard.stories.tsx | 7 +- .../components/proposal/ProposalCard.tsx | 25 +- .../proposal/ProposalCreatedModal.tsx | 5 +- .../stateless/components/proposal/index.ts | 1 - .../components/wallet/DisconnectWallet.tsx | 8 +- .../components/wallet/NavWalletConnected.tsx | 6 - .../components/wallet/WalletDaos.tsx | 123 +++--- packages/stateless/hooks/index.ts | 1 + .../stateless/hooks/useTabBarScrollReset.ts | 97 +++++ .../stateless/pages/ChainGovernanceList.tsx | 82 ++++ .../stateless/pages/DaoDappTabbedHome.tsx | 62 +-- packages/stateless/pages/EditProfile.tsx | 40 ++ packages/stateless/pages/GovernanceDaos.tsx | 29 -- packages/stateless/pages/Home.stories.tsx | 71 +-- packages/stateless/pages/Home.tsx | 75 +--- packages/stateless/pages/Profile.stories.tsx | 31 -- packages/stateless/pages/Profile.tsx | 93 ---- packages/stateless/pages/ProfileHome.tsx | 138 ++++++ packages/stateless/pages/index.ts | 5 +- packages/storybook/utils.ts | 3 +- packages/types/account.ts | 2 +- packages/types/actions.ts | 18 +- packages/types/command.ts | 3 + packages/types/components/DaoCard.tsx | 21 +- packages/types/components/DappLayout.ts | 5 + packages/types/components/DappNavigation.ts | 8 - packages/types/components/DisconnectWallet.ts | 13 + packages/types/components/GovProposalLine.ts | 6 + packages/types/components/ProposalCard.ts | 3 +- packages/types/components/WalletDaos.tsx | 27 +- packages/types/components/index.ts | 2 + packages/types/dao.ts | 16 +- packages/types/features.ts | 2 + packages/types/feed.ts | 2 +- packages/types/gov.ts | 2 +- packages/types/inbox.ts | 15 +- packages/types/profile.ts | 4 + packages/utils/chain.ts | 32 ++ packages/utils/constants/layout.ts | 3 +- packages/utils/constants/other.ts | 13 +- packages/utils/dao.ts | 44 +- packages/utils/getFallbackImage.ts | 2 +- packages/utils/url.ts | 32 +- yarn.lock | 12 + 160 files changed, 3432 insertions(+), 3223 deletions(-) rename apps/dapp/pages/{me => }/[[...tab]].tsx (77%) rename apps/dapp/pages/{index.tsx => gov.tsx} (83%) delete mode 100644 apps/dapp/pages/gov/[chain]/[[...slug]].tsx delete mode 100644 apps/dapp/pages/gov/[chain]/proposals/[proposalId].tsx delete mode 100644 apps/dapp/pages/gov/[chain]/proposals/create.tsx delete mode 100644 apps/dapp/pages/gov/index.tsx rename apps/dapp/pages/{[chain].tsx => profile.tsx} (55%) delete mode 100644 packages/stateful/components/gov/GovPageWrapper.tsx delete mode 100644 packages/stateful/components/pages/ChainGovernanceHome.tsx create mode 100644 packages/stateful/components/pages/ChainGovernanceList.tsx create mode 100644 packages/stateful/components/pages/EditProfile.tsx delete mode 100644 packages/stateful/components/pages/NeutronGovernanceHome.tsx rename packages/stateful/components/pages/{Me.tsx => ProfileHome.tsx} (59%) create mode 100644 packages/stateful/components/profile/ProfileFeed.tsx create mode 100644 packages/stateful/feed/sources/OpenProposals/OpenProposalsProposalLineProps.tsx create mode 100644 packages/stateful/feed/sources/OpenProposals/types.ts create mode 100644 packages/stateful/hooks/useGovDaoTabs.ts delete mode 100644 packages/stateful/server/makeGetGovStaticProps.ts delete mode 100644 packages/stateless/components/dao/FollowingDaos.stories.tsx delete mode 100644 packages/stateless/components/dao/FollowingDaos.tsx create mode 100644 packages/stateless/components/profile/ProfileDaos.tsx rename packages/stateless/components/{Feed.tsx => profile/ProfileFeed.tsx} (91%) delete mode 100644 packages/stateless/components/proposal/GovProposalCreatedModal.tsx create mode 100644 packages/stateless/hooks/useTabBarScrollReset.ts create mode 100644 packages/stateless/pages/ChainGovernanceList.tsx create mode 100644 packages/stateless/pages/EditProfile.tsx delete mode 100644 packages/stateless/pages/GovernanceDaos.tsx delete mode 100644 packages/stateless/pages/Profile.stories.tsx delete mode 100644 packages/stateless/pages/Profile.tsx create mode 100644 packages/stateless/pages/ProfileHome.tsx create mode 100644 packages/types/components/DisconnectWallet.ts create mode 100644 packages/types/components/GovProposalLine.ts diff --git a/apps/dapp/next.config.js b/apps/dapp/next.config.js index acae18a3c..99ec3bf23 100644 --- a/apps/dapp/next.config.js +++ b/apps/dapp/next.config.js @@ -83,8 +83,19 @@ const config = { permanent: false, }, { - source: '/me/tx', - destination: '/me/actions', + source: '/me/:slug*', + destination: '/:slug*', + permanent: false, + }, + { + source: '/tx', + destination: '/actions', + permanent: false, + }, + // Redirect all gov subpages to the dao subpage, but leave /gov alone. + { + source: '/gov/:chain/:slug*', + destination: '/dao/:chain/:slug*', permanent: false, }, ], diff --git a/apps/dapp/pages/me/[[...tab]].tsx b/apps/dapp/pages/[[...tab]].tsx similarity index 77% rename from apps/dapp/pages/me/[[...tab]].tsx rename to apps/dapp/pages/[[...tab]].tsx index ef4968e4b..9de31989b 100644 --- a/apps/dapp/pages/me/[[...tab]].tsx +++ b/apps/dapp/pages/[[...tab]].tsx @@ -4,10 +4,11 @@ import { GetStaticPaths, GetStaticProps } from 'next' import { serverSideTranslations } from '@dao-dao/i18n/serverSideTranslations' -import { Me } from '@dao-dao/stateful' +import { Home } from '@dao-dao/stateful' import { AccountTabId } from '@dao-dao/types' +import { getSupportedChains } from '@dao-dao/utils' -export default Me +export default Home export const getStaticProps: GetStaticProps = async ({ locale }) => ({ props: { @@ -29,6 +30,12 @@ export const getStaticPaths: GetStaticPaths = () => ({ tab: [tab], }, })), + // All chains. + ...getSupportedChains().map(({ name }) => ({ + params: { + tab: [name], + }, + })), ], fallback: false, }) diff --git a/apps/dapp/pages/dao/[address]/[[...slug]].tsx b/apps/dapp/pages/dao/[address]/[[...slug]].tsx index 463369bfe..1f009612d 100644 --- a/apps/dapp/pages/dao/[address]/[[...slug]].tsx +++ b/apps/dapp/pages/dao/[address]/[[...slug]].tsx @@ -5,12 +5,13 @@ import type { GetStaticPaths, GetStaticProps, NextPage } from 'next' import React from 'react' import { + ChainGovernanceDappHome, DaoDappHome, DaoPageWrapper, DaoPageWrapperProps, } from '@dao-dao/stateful' import { makeGetDaoStaticProps } from '@dao-dao/stateful/server' -import { DaoPageMode } from '@dao-dao/types' +import { ContractVersion, DaoPageMode } from '@dao-dao/types' import { SITE_URL, getDaoPath } from '@dao-dao/utils' const DaoHomePage: NextPage = ({ @@ -18,7 +19,11 @@ const DaoHomePage: NextPage = ({ ...props }) => ( - + {props.serializedInfo?.coreVersion === ContractVersion.Gov ? ( + + ) : ( + + )} ) diff --git a/apps/dapp/pages/dao/[address]/proposals/[proposalId].tsx b/apps/dapp/pages/dao/[address]/proposals/[proposalId].tsx index 42512d464..de44967af 100644 --- a/apps/dapp/pages/dao/[address]/proposals/[proposalId].tsx +++ b/apps/dapp/pages/dao/[address]/proposals/[proposalId].tsx @@ -6,18 +6,23 @@ import type { GetStaticPaths, GetStaticProps, NextPage } from 'next' import { DaoPageWrapper, DaoProposal, - DaoProposalPageWrapperProps, + DaoProposalProps, + GovProposal, } from '@dao-dao/stateful' import { makeGetDaoProposalStaticProps } from '@dao-dao/stateful/server' -import { DaoPageMode } from '@dao-dao/types' +import { ContractVersion, DaoPageMode } from '@dao-dao/types' import { SITE_URL, getDaoProposalPath } from '@dao-dao/utils' -const ProposalPage: NextPage = ({ +const ProposalPage: NextPage = ({ children: _, ...props }) => ( - + {props.serializedInfo?.coreVersion === ContractVersion.Gov ? ( + + ) : ( + + )} ) diff --git a/apps/dapp/pages/dao/[address]/proposals/create.tsx b/apps/dapp/pages/dao/[address]/proposals/create.tsx index f52d9e95c..47c85ec81 100644 --- a/apps/dapp/pages/dao/[address]/proposals/create.tsx +++ b/apps/dapp/pages/dao/[address]/proposals/create.tsx @@ -5,11 +5,13 @@ import type { GetStaticPaths, GetStaticProps, NextPage } from 'next' import { CreateDaoProposal, + CreateGovProposal, DaoPageWrapper, DaoPageWrapperProps, } from '@dao-dao/stateful' import { makeGetDaoStaticProps } from '@dao-dao/stateful/server' -import { DaoPageMode } from '@dao-dao/types' +import { PageLoader } from '@dao-dao/stateless' +import { ContractVersion, DaoPageMode } from '@dao-dao/types' import { SITE_URL, getDaoProposalPath } from '@dao-dao/utils' const ProposalCreatePage: NextPage = ({ @@ -17,14 +19,19 @@ const ProposalCreatePage: NextPage = ({ ...props }) => ( - + {!props.serializedInfo ? ( + + ) : props.serializedInfo.coreVersion === ContractVersion.Gov ? ( + + ) : ( + + )} ) export default ProposalCreatePage -// Fallback to loading screen if page has not yet been statically -// generated. +// Fallback to loading screen if page has not yet been statically generated. export const getStaticPaths: GetStaticPaths = () => ({ paths: [], fallback: true, diff --git a/apps/dapp/pages/index.tsx b/apps/dapp/pages/gov.tsx similarity index 83% rename from apps/dapp/pages/index.tsx rename to apps/dapp/pages/gov.tsx index ef5bc0e2b..59095e48a 100644 --- a/apps/dapp/pages/index.tsx +++ b/apps/dapp/pages/gov.tsx @@ -1,12 +1,11 @@ // GNU AFFERO GENERAL PUBLIC LICENSE Version 3. Copyright (C) 2022 DAO DAO Contributors. // See the "LICENSE" file in the root directory of this package for more copyright information. - import { GetStaticProps } from 'next' import { serverSideTranslations } from '@dao-dao/i18n/serverSideTranslations' -import { Home } from '@dao-dao/stateful' +import { ChainGovernanceList } from '@dao-dao/stateful' -export default Home +export default ChainGovernanceList export const getStaticProps: GetStaticProps = async ({ locale }) => ({ props: { diff --git a/apps/dapp/pages/gov/[chain]/[[...slug]].tsx b/apps/dapp/pages/gov/[chain]/[[...slug]].tsx deleted file mode 100644 index 4fe8f9e50..000000000 --- a/apps/dapp/pages/gov/[chain]/[[...slug]].tsx +++ /dev/null @@ -1,45 +0,0 @@ -// GNU AFFERO GENERAL PUBLIC LICENSE Version 3. Copyright (C) 2022 DAO DAO Contributors. -// See the "LICENSE" file in the root directory of this package for more copyright information. - -import type { GetStaticPaths, GetStaticProps, NextPage } from 'next' - -import { - ChainGovernanceHome, - GovPageWrapper, - GovPageWrapperProps, - NeutronGovernanceHome, -} from '@dao-dao/stateful' -import { makeGetGovStaticProps } from '@dao-dao/stateful/server' -import { ChainId } from '@dao-dao/types' -import { SITE_URL, getDisplayNameForChainId, getGovPath } from '@dao-dao/utils' - -const GovHomePage: NextPage = ({ - children: _, - ...props -}) => ( - - {props.serializedInfo?.chainId === ChainId.NeutronMainnet ? ( - - ) : ( - - )} - -) - -export default GovHomePage - -// Fallback to loading screen if page has not yet been statically generated. -export const getStaticPaths: GetStaticPaths = () => ({ - paths: [], - fallback: true, -}) - -export const getStaticProps: GetStaticProps = makeGetGovStaticProps({ - getProps: async ({ chain, chainName }) => ({ - url: SITE_URL + getGovPath(chainName), - followingTitle: 'Governance', - overrideDescription: `The native chain governance for ${getDisplayNameForChainId( - chain.chain_id - )}.`, - }), -}) diff --git a/apps/dapp/pages/gov/[chain]/proposals/[proposalId].tsx b/apps/dapp/pages/gov/[chain]/proposals/[proposalId].tsx deleted file mode 100644 index 2e2b4f88c..000000000 --- a/apps/dapp/pages/gov/[chain]/proposals/[proposalId].tsx +++ /dev/null @@ -1,31 +0,0 @@ -// GNU AFFERO GENERAL PUBLIC LICENSE Version 3. Copyright (C) 2022 DAO DAO Contributors. -// See the "LICENSE" file in the root directory of this package for more copyright information. - -import type { GetStaticPaths, GetStaticProps, NextPage } from 'next' - -import { - GovPageWrapper, - GovProposal, - GovProposalPageWrapperProps, -} from '@dao-dao/stateful' -import { makeGetGovProposalStaticProps } from '@dao-dao/stateful/server' - -const ProposalPage: NextPage = ({ - children: _, - ...props -}) => ( - - - -) - -export default ProposalPage - -// Fallback to loading screen if page has not yet been statically -// generated. -export const getStaticPaths: GetStaticPaths = () => ({ - paths: [], - fallback: true, -}) - -export const getStaticProps: GetStaticProps = makeGetGovProposalStaticProps() diff --git a/apps/dapp/pages/gov/[chain]/proposals/create.tsx b/apps/dapp/pages/gov/[chain]/proposals/create.tsx deleted file mode 100644 index 5cdfe187a..000000000 --- a/apps/dapp/pages/gov/[chain]/proposals/create.tsx +++ /dev/null @@ -1,37 +0,0 @@ -// GNU AFFERO GENERAL PUBLIC LICENSE Version 3. Copyright (C) 2022 DAO DAO Contributors. -// See the "LICENSE" file in the root directory of this package for more copyright information. - -import type { GetStaticPaths, GetStaticProps, NextPage } from 'next' - -import { - CreateGovProposal, - GovPageWrapper, - GovPageWrapperProps, -} from '@dao-dao/stateful' -import { makeGetGovStaticProps } from '@dao-dao/stateful/server' -import { SITE_URL, getGovProposalPath } from '@dao-dao/utils' - -const ProposalCreatePage: NextPage = ({ - children: _, - ...props -}) => ( - - - -) - -export default ProposalCreatePage - -// Fallback to loading screen if page has not yet been statically -// generated. -export const getStaticPaths: GetStaticPaths = () => ({ - paths: [], - fallback: true, -}) - -export const getStaticProps: GetStaticProps = makeGetGovStaticProps({ - getProps: ({ t, chainName }) => ({ - url: SITE_URL + getGovProposalPath(chainName, 'create'), - followingTitle: t('title.createAProposal'), - }), -}) diff --git a/apps/dapp/pages/gov/index.tsx b/apps/dapp/pages/gov/index.tsx deleted file mode 100644 index dde2ec20d..000000000 --- a/apps/dapp/pages/gov/index.tsx +++ /dev/null @@ -1,31 +0,0 @@ -// GNU AFFERO GENERAL PUBLIC LICENSE Version 3. Copyright (C) 2022 DAO DAO Contributors. -// See the "LICENSE" file in the root directory of this package for more copyright information. -import { NextPage } from 'next' -import { useRouter } from 'next/router' -import { useEffect } from 'react' -import { useRecoilValue } from 'recoil' - -import { walletChainIdAtom } from '@dao-dao/state' -import { PageLoader } from '@dao-dao/stateless' -import { - getConfiguredChainConfig, - getConfiguredChains, - getGovPath, -} from '@dao-dao/utils' - -const GovRedirectPage: NextPage = () => { - const chainId = useRecoilValue(walletChainIdAtom) - - const router = useRouter() - useEffect(() => { - router.push( - getGovPath( - getConfiguredChainConfig(chainId)?.name || getConfiguredChains()[0].name - ) - ) - }, [chainId, router]) - - return -} - -export default GovRedirectPage diff --git a/apps/dapp/pages/notifications/[[...slug]].tsx b/apps/dapp/pages/notifications/[[...slug]].tsx index fddea2143..58798e848 100644 --- a/apps/dapp/pages/notifications/[[...slug]].tsx +++ b/apps/dapp/pages/notifications/[[...slug]].tsx @@ -7,8 +7,6 @@ import { serverSideTranslations } from '@dao-dao/i18n/serverSideTranslations' import { Inbox } from '@dao-dao/stateful' import { InboxPageSlug } from '@dao-dao/types' -// This is the dynamic Me page that allows specifying a tab. It can be accessed -// via `/me/[tab]`. export default Inbox export const getStaticProps: GetStaticProps = async ({ locale }) => ({ diff --git a/apps/dapp/pages/[chain].tsx b/apps/dapp/pages/profile.tsx similarity index 55% rename from apps/dapp/pages/[chain].tsx rename to apps/dapp/pages/profile.tsx index 41729b51f..31f394aa4 100644 --- a/apps/dapp/pages/[chain].tsx +++ b/apps/dapp/pages/profile.tsx @@ -1,25 +1,15 @@ // GNU AFFERO GENERAL PUBLIC LICENSE Version 3. Copyright (C) 2022 DAO DAO Contributors. // See the "LICENSE" file in the root directory of this package for more copyright information. -import { GetStaticPaths, GetStaticProps } from 'next' +import type { GetStaticProps } from 'next' import { serverSideTranslations } from '@dao-dao/i18n/serverSideTranslations' -import { Home } from '@dao-dao/stateful' -import { getSupportedChains } from '@dao-dao/utils' +import { EditProfile } from '@dao-dao/stateful' -export default Home +export default EditProfile export const getStaticProps: GetStaticProps = async ({ locale }) => ({ props: { ...(await serverSideTranslations(locale, ['translation'])), }, }) - -export const getStaticPaths: GetStaticPaths = () => ({ - paths: getSupportedChains().map(({ name }) => ({ - params: { - chain: name, - }, - })), - fallback: false, -}) diff --git a/apps/dapp/public/site.webmanifest b/apps/dapp/public/site.webmanifest index bffc6ed83..774e15494 100644 --- a/apps/dapp/public/site.webmanifest +++ b/apps/dapp/public/site.webmanifest @@ -22,7 +22,7 @@ { "name": "Home", "short_name": "Home", - "description": "View featured and followed DAOs", + "description": "Home", "url": "/?s=pwa" }, { @@ -30,18 +30,6 @@ "short_name": "Notifications", "description": "View notifications", "url": "/notifications?s=pwa" - }, - { - "name": "Me", - "short_name": "Me", - "description": "Access your wallet and execute transactions", - "url": "/me?s=pwa" - }, - { - "name": "Governance", - "short_name": "Governance", - "description": "View native chain governance", - "url": "/gov?s=pwa" } ] } diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 3b57bbc2a..1d3cbc9f5 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -863,9 +863,9 @@ "activeThresholdDescription": "The amount of voting power that needs to be staked in order for the DAO to become active and thus allow proposals to be created.", "addCw20ToTreasuryActionDescription": "Display the DAO's balance of a CW20 token in the treasury view.", "addCw721ToTreasuryActionDescription": "Display the NFTs owned by the DAO from a CW721 NFT collection in the treasury view.", - "addToProfileExplanation": "Add the current wallet to your profile shown below.", + "addToProfileExplanation": "Add the current chain to your profile shown below.", "addWalletToProfile": "Add this wallet to your profile.", - "addWalletToProfileToEdit": "You cannot edit your profile until you add this wallet. Click to add it.", + "addWalletToProfileToEdit": "You cannot edit your profile until you add the chain your wallet is currently connected to. Click to add it.", "addedToDaoFollowPrompt": "You were added as a member to this DAO. Follow it to receive updates.", "advancedVotingConfigWarning": "These are advanced features. If you configure them without fully understanding how they work, you can lock your DAO, making it impossible for proposals to pass.", "allChains": "All chains", @@ -1396,6 +1396,7 @@ "youAreMember": "You are a member", "your": "Your", "yourBalance": "Your balance", + "yourDaosDescription": "Find the DAOs you follow or are a member of below.", "yourVaultVotingPower": "Your voting power", "yourVaultVotingPowerTooltip": "The voting power within this voting vault owned by you." }, @@ -1463,7 +1464,10 @@ "proposalClosed": "Proposal closed.", "proposalCreatedCompleteCompensationCycle": "Proposal published. Complete the compensation cycle by saving the proposal ID.", "proposalExecuted": "Executed. Updating data and refreshing page...", + "proposalOpenForVoting": "Proposal is open for voting.", "proposalOverruled": "Proposal overruled.", + "proposalPassed": "Proposal passed.", + "proposalPassedButExecutionFailed": "Proposal passed but execution failed.", "proposalRejected": "Proposal rejected.", "proposalSimulation": "Proposal simulated successfully. If executed right now, it would not fail.", "proposalVetoed": "Proposal vetoed.", @@ -1514,6 +1518,7 @@ "canceled": "Canceled", "casting": "Casting", "chain": "Chain", + "chainGovernance": "Chain Governance", "chainModule": { "gov": "Governance Module" }, @@ -1879,6 +1884,7 @@ "winningChoice": "Winning choice", "withdrawTokenSwap": "Withdraw Token Swap", "withdrawValidatorCommission": "Claim validator commission", + "yourDaos": "Your DAOs", "yourNotifiers": "Your notifiers", "yourSubmission": "Your submission" }, diff --git a/packages/state/recoil/atoms/proposals.ts b/packages/state/recoil/atoms/proposals.ts index 693d33346..5a2687e6f 100644 --- a/packages/state/recoil/atoms/proposals.ts +++ b/packages/state/recoil/atoms/proposals.ts @@ -47,12 +47,3 @@ export const proposalCreatedCardPropsAtom = atom< key: 'proposalCreatedCardProps', default: undefined, }) - -// When set, shows gov proposal created modal with these props for the -// ProposalCard shown. -export const govProposalCreatedCardPropsAtom = atom< - ProposalCreatedCardProps | undefined ->({ - key: 'govProposalCreatedCardProps', - default: undefined, -}) diff --git a/packages/state/recoil/selectors/account.ts b/packages/state/recoil/selectors/account.ts index d180bea25..87c8f6dd7 100644 --- a/packages/state/recoil/selectors/account.ts +++ b/packages/state/recoil/selectors/account.ts @@ -25,11 +25,12 @@ import { ICA_CHAINS_TX_PREFIX, POLYTONE_CONFIG_PER_CHAIN, getChainForChainId, + getConfiguredChainConfig, secp256k1PublicKeyToBech32Address, tokensEqual, } from '@dao-dao/utils' -import { cosmosRpcClientForChainSelector } from './chain' +import { cosmosRpcClientForChainSelector, moduleAddressSelector } from './chain' import { isContractSelector, isDaoSelector, @@ -62,6 +63,17 @@ export const accountsSelector = selectorFamily< get: ({ chainId, address, includeIcaChains }) => ({ get }) => { + const chainConfig = getConfiguredChainConfig(chainId) + // In case address is the name of a chain, get the gov module address. + if (chainConfig?.name === address) { + address = get( + moduleAddressSelector({ + chainId, + name: 'gov', + }) + ) + } + const [isDao, isPolytoneProxy] = get( waitForAll([ isDaoSelector({ diff --git a/packages/state/recoil/selectors/chain.ts b/packages/state/recoil/selectors/chain.ts index 1d5bb9eeb..1a488f461 100644 --- a/packages/state/recoil/selectors/chain.ts +++ b/packages/state/recoil/selectors/chain.ts @@ -76,6 +76,7 @@ import { refreshGovProposalsAtom, refreshIbcDataAtom, refreshNativeTokenStakingInfoAtom, + refreshOpenProposalsAtom, refreshWalletBalancesIdAtom, } from '../atoms/refresh' import { @@ -716,8 +717,6 @@ export const searchedDecodedGovProposalsSelector = selectorFamily< get: (options) => async ({ get }) => { - get(refreshGovProposalsAtom(options.chainId)) - const supportsV1Gov = get( chainSupportsV1GovModuleSelector({ chainId: options.chainId }) ) @@ -770,9 +769,15 @@ export const govProposalsSelector = selectorFamily< >({ key: 'govProposals', get: - ({ status, offset, limit, chainId }) => + ({ chainId, status, offset, limit }) => async ({ get }) => { get(refreshGovProposalsAtom(chainId)) + if ( + status === ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD || + status === ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD + ) { + get(refreshOpenProposalsAtom) + } // Try to load from indexer first. const indexerProposals = get( @@ -914,7 +919,7 @@ export const govProposalSelector = selectorFamily< get: ({ proposalId, chainId }) => async ({ get }) => { - get(refreshGovProposalsAtom(chainId)) + const id = get(refreshGovProposalsAtom(chainId)) const supportsV1Gov = get(chainSupportsV1GovModuleSelector({ chainId })) @@ -932,18 +937,21 @@ export const govProposalSelector = selectorFamily< args: { id: proposalId, }, + id, }) ) + let govProposal: GovProposalWithDecodedContent | undefined + if (indexerProposal) { if (supportsV1Gov) { - return await decodeGovProposal({ + govProposal = await decodeGovProposal({ version: GovProposalVersion.V1, id: BigInt(proposalId), proposal: ProposalV1.decode(fromBase64(indexerProposal.data)), }) } else { - return await decodeGovProposal({ + govProposal = await decodeGovProposal({ version: GovProposalVersion.V1_BETA_1, id: BigInt(proposalId), proposal: ProposalV1Beta1.decode( @@ -956,53 +964,70 @@ export const govProposalSelector = selectorFamily< } // Fallback to querying chain if indexer failed. - const client = get(cosmosRpcClientForChainSelector(chainId)) + if (!govProposal) { + const client = get(cosmosRpcClientForChainSelector(chainId)) - if (supportsV1Gov) { - try { - const proposal = ( - await client.gov.v1.proposal({ - proposalId: BigInt(proposalId), + if (supportsV1Gov) { + try { + const proposal = ( + await client.gov.v1.proposal({ + proposalId: BigInt(proposalId), + }) + ).proposal + if (!proposal) { + throw new Error('Proposal not found') + } + + govProposal = await decodeGovProposal({ + version: GovProposalVersion.V1, + id: BigInt(proposalId), + proposal, }) + } catch (err) { + // Fallback to v1beta1 query if v1 not supported. + if ( + !(err instanceof Error) || + !err.message.includes('unknown query path') + ) { + // Rethrow other errors. + throw err + } + } + } + + if (!govProposal) { + const proposal = ( + await client.gov.v1beta1.proposal( + { + proposalId: BigInt(proposalId), + }, + true + ) ).proposal if (!proposal) { throw new Error('Proposal not found') } - return await decodeGovProposal({ - version: GovProposalVersion.V1, + govProposal = await decodeGovProposal({ + version: GovProposalVersion.V1_BETA_1, id: BigInt(proposalId), proposal, }) - } catch (err) { - // Fallback to v1beta1 query if v1 not supported. - if ( - !(err instanceof Error) || - !err.message.includes('unknown query path') - ) { - // Rethrow other errors. - throw err - } } } - const proposal = ( - await client.gov.v1beta1.proposal( - { - proposalId: BigInt(proposalId), - }, - true - ) - ).proposal - if (!proposal) { - throw new Error('Proposal not found') + // If gov proposal is in deposit or voting period, refresh when open + // proposals refresh since it may have just opened (for voting) or closed. + if ( + govProposal.proposal.status === + ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD || + govProposal.proposal.status === + ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD + ) { + get(refreshOpenProposalsAtom) } - return await decodeGovProposal({ - version: GovProposalVersion.V1_BETA_1, - id: BigInt(proposalId), - proposal, - }) + return govProposal }, }) diff --git a/packages/state/recoil/selectors/inbox.ts b/packages/state/recoil/selectors/inbox.ts index 340f4ceea..88d2b4111 100644 --- a/packages/state/recoil/selectors/inbox.ts +++ b/packages/state/recoil/selectors/inbox.ts @@ -4,9 +4,12 @@ import { InboxItemType, InboxLoadedItem, InboxLoadedItemWithData, - WithChainId, } from '@dao-dao/types' -import { INBOX_API_BASE } from '@dao-dao/utils' +import { + INBOX_API_BASE, + MAINNET, + maybeGetChainForChainId, +} from '@dao-dao/utils' import { refreshInboxItemsAtom } from '../atoms' @@ -22,18 +25,25 @@ export const temporaryClearedInboxItemsAtom = atomFamily({ export const inboxItemsSelector = selectorFamily< InboxLoadedItemWithData[], - WithChainId<{ - walletAddress: string - // Optional type filter. + { + walletBech32Hash: string + /** + * Any chain that the bech32 hash is used with in case an item doesn't have + * chain ID set. This is needed to clear the inbox item later. + */ + fallbackChainId: string + /** + * Optional type filter. + */ type?: InboxItemType - }> + } >({ key: 'inboxItems', get: - ({ walletAddress, type, chainId }) => + ({ walletBech32Hash, fallbackChainId, type }) => async ({ get }) => { const temporaryClearedInboxLoadedItemWithDatas = get( - temporaryClearedInboxItemsAtom(walletAddress) + temporaryClearedInboxItemsAtom(walletBech32Hash) ) get(refreshInboxItemsAtom) @@ -41,10 +51,9 @@ export const inboxItemsSelector = selectorFamily< // Optional filters. const query = new URLSearchParams({ ...(type ? { type } : {}), - ...(chainId ? { chainId } : {}), }) const response = await fetch( - INBOX_API_BASE + `/load/${walletAddress}?${query.toString()}` + INBOX_API_BASE + `/load/bech32/${walletBech32Hash}?${query.toString()}` ) if (response.ok) { @@ -59,14 +68,21 @@ export const inboxItemsSelector = selectorFamily< ({ type: item.id.split('/')[0] as InboxItemType, ...item, + chainId: item.chainId || fallbackChainId, } as InboxLoadedItemWithData) ) - .filter( - (item): item is InboxLoadedItemWithData => - !!item && + .flatMap((item) => { + const { network_type } = maybeGetChainForChainId(item.chainId) ?? {} + + return item && // Filter out items that were cleared. - !temporaryClearedInboxLoadedItemWithDatas.includes(item.id) - ) + !temporaryClearedInboxLoadedItemWithDatas.includes(item.id) && + network_type && + // Only get followed DAOs that match the current network type. + (network_type === 'mainnet') === MAINNET + ? item + : [] + }) return items } else { diff --git a/packages/state/recoil/selectors/indexer.ts b/packages/state/recoil/selectors/indexer.ts index e374d7ba4..76745b6e6 100644 --- a/packages/state/recoil/selectors/indexer.ts +++ b/packages/state/recoil/selectors/indexer.ts @@ -7,6 +7,7 @@ import { IndexerUpStatus, WithChainId, } from '@dao-dao/types' +import { ProposalStatus } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1/gov' import { CommonError, WEB_SOCKET_PUSHER_APP_KEY, @@ -30,6 +31,7 @@ import { searchGovProposals, } from '../../indexer' import { + refreshGovProposalsAtom, refreshIndexerUpStatusAtom, refreshOpenProposalsAtom, refreshWalletProposalStatsAtom, @@ -222,7 +224,19 @@ export const searchGovProposalsSelector = selectorFamily< SearchGovProposalsOptions >({ key: 'searchGovProposals', - get: (options) => async () => await searchGovProposals(options), + get: + (options) => + async ({ get }) => { + get(refreshGovProposalsAtom(options.chainId)) + if ( + options.status === ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD || + options.status === ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD + ) { + get(refreshOpenProposalsAtom) + } + + return await searchGovProposals(options) + }, }) export const openProposalsSelector = selectorFamily< diff --git a/packages/state/recoil/selectors/treasury.ts b/packages/state/recoil/selectors/treasury.ts index 3e4663aaf..641c6af10 100644 --- a/packages/state/recoil/selectors/treasury.ts +++ b/packages/state/recoil/selectors/treasury.ts @@ -6,6 +6,7 @@ import { AmountWithTimestamp, WithChainId } from '@dao-dao/types' import { convertMicroDenomToDenomWithDecimals, getTokenForChainIdAndDenom, + isConfiguredChainName, } from '@dao-dao/utils' import { @@ -155,6 +156,11 @@ export const daoTvlSelector = selectorFamily< get: ({ chainId, coreAddress }) => ({ get }) => { + // Native chain x/gov module. + if (isConfiguredChainName(chainId, coreAddress)) { + return get(communityPoolTvlSelector({ chainId })) + } + const timestamp = new Date() const { total: amount } = get( diff --git a/packages/stateful/actions/react/provider.tsx b/packages/stateful/actions/react/provider.tsx index 3ef089257..b52fdb09a 100644 --- a/packages/stateful/actions/react/provider.tsx +++ b/packages/stateful/actions/react/provider.tsx @@ -1,4 +1,4 @@ -import { ReactNode, useMemo } from 'react' +import { useMemo } from 'react' import { useTranslation } from 'react-i18next' import { waitForAll } from 'recoil' @@ -19,7 +19,10 @@ import { ActionContext, ActionContextType, ActionOptions, + ActionsProviderProps, + GovActionsProviderProps, IActionsContext, + WalletActionsProviderProps, } from '@dao-dao/types' import { useProfile } from '../../hooks' @@ -33,22 +36,6 @@ import { } from '../core' import { ActionsContext } from './context' -export type ActionsProviderProps = { - children: ReactNode | ReactNode[] -} - -export type WalletActionsProviderProps = ActionsProviderProps & { - // If passed, will override the connected wallet address. - address?: string -} - -export type GovActionsProviderProps = ActionsProviderProps & { - /** - * Optionally override loader node. - */ - loader?: ReactNode -} - // Make sure this re-renders when the options change. You can do this by setting // a `key` on this component or one of its ancestors. See DaoPageWrapper.tsx // where this component is used for a usage example. diff --git a/packages/stateful/command/contexts/generic/dao.tsx b/packages/stateful/command/contexts/generic/dao.tsx index 1969ea4c3..032b511f6 100644 --- a/packages/stateful/command/contexts/generic/dao.tsx +++ b/packages/stateful/command/contexts/generic/dao.tsx @@ -16,7 +16,7 @@ import { useDaoInfoContext, useDaoNavHelpers, } from '@dao-dao/stateless' -import { Feature } from '@dao-dao/types' +import { ContractVersion, Feature } from '@dao-dao/types' import { CommandModalContextMaker, CommandModalContextSection, @@ -26,8 +26,8 @@ import { import { getDisplayNameForChainId, getFallbackImage } from '@dao-dao/utils' import { DaoProvidersWithoutInfo } from '../../../components' -import { useDaoTabs, useFollowingDaos } from '../../../hooks' -import { subDaoInfosSelector } from '../../../recoil' +import { useDaoTabs, useFollowingDaos, useGovDaoTabs } from '../../../hooks' +import { chainSubDaoInfosSelector, subDaoInfosSelector } from '../../../recoil' export const makeGenericDaoContext: CommandModalContextMaker<{ dao: CommandModalDaoInfo @@ -36,19 +36,25 @@ export const makeGenericDaoContext: CommandModalContextMaker<{ */ onDaoPage?: boolean }> = ({ - dao: { chainId, coreAddress, name, imageUrl }, + dao: { chainId, coreAddress, coreVersion, name, imageUrl }, onDaoPage, ...options }) => { + const useLoadingTabs = + coreVersion === ContractVersion.Gov ? useGovDaoTabs : useDaoTabs + const useSections = () => { const { t } = useTranslation() const { getDaoPath, getDaoProposalPath, router } = useDaoNavHelpers() const { accounts, supportedFeatures } = useDaoInfoContext() - const loadingTabs = useDaoTabs() + const loadingTabs = useLoadingTabs() const { isFollowing, setFollowing, setUnfollowing, updatingFollowing } = - useFollowingDaos(chainId) - const following = isFollowing(coreAddress) + useFollowingDaos() + const following = isFollowing({ + chainId, + coreAddress, + }) const [copied, setCopied] = useState() // Debounce clearing copied. @@ -63,7 +69,11 @@ export const makeGenericDaoContext: CommandModalContextMaker<{ const createProposalHref = getDaoProposalPath(coreAddress, 'create') const subDaosLoading = useCachedLoading( - supportedFeatures[Feature.SubDaos] + coreVersion === ContractVersion.Gov + ? chainSubDaoInfosSelector({ + chainId, + }) + : supportedFeatures[Feature.SubDaos] ? subDaoInfosSelector({ chainId, coreAddress, @@ -132,7 +142,10 @@ export const makeGenericDaoContext: CommandModalContextMaker<{ name: following ? t('button.unfollow') : t('button.follow'), Icon: CheckRounded, onChoose: () => - following ? setUnfollowing(coreAddress) : setFollowing(coreAddress), + (following ? setUnfollowing : setFollowing)({ + chainId, + coreAddress, + }), loading: updatingFollowing, }, ...accounts.map(({ chainId, address }) => ({ @@ -195,11 +208,13 @@ export const makeGenericDaoContext: CommandModalContextMaker<{ ({ chainId, coreAddress, + coreVersion, name, imageUrl, }): CommandModalDaoInfo => ({ chainId, coreAddress, + coreVersion, name, imageUrl: imageUrl || getFallbackImage(coreAddress), }) diff --git a/packages/stateful/command/contexts/generic/index.ts b/packages/stateful/command/contexts/generic/index.ts index 95cf4f70b..280abee95 100644 --- a/packages/stateful/command/contexts/generic/index.ts +++ b/packages/stateful/command/contexts/generic/index.ts @@ -1,3 +1,7 @@ +import { useSetRecoilState } from 'recoil' + +import { navigatingToHrefAtom } from '@dao-dao/state/recoil' +import { useDaoNavHelpers, useHoldingKey } from '@dao-dao/stateless' import { CommandModalContextMaker, CommandModalContextUseSections, @@ -14,18 +18,35 @@ import { makeGenericDaoContext } from './dao' export const makeGenericContext: CommandModalContextMaker = (options) => { const useSections: CommandModalContextUseSections = (sectionOptions) => { const navigationSection = useNavigationSection() + const holdingAlt = useHoldingKey({ key: 'alt' }) + const { getDaoPath, router } = useDaoNavHelpers() + const setNavigatingToHref = useSetRecoilState(navigatingToHrefAtom) const followingAndFilteredDaosSections = useFollowingAndFilteredDaosSections({ options: sectionOptions, // Open generic DAO context on click. - onChoose: (dao) => - options.openContext( - makeGenericDaoContext({ - ...options, - dao, - }) - ), + onChoose: (dao) => { + // Open advanced context menu. + if (holdingAlt) { + options.openContext( + makeGenericDaoContext({ + ...options, + dao, + }) + ) + } else { + // Go to DAO page. + const href = getDaoPath(dao.coreAddress) + router.push(href) + + // If not on destination page, set navigating state. If already + // there, do nothing. + if (router.asPath !== href) { + setNavigatingToHref(href) + } + } + }, }) return [navigationSection, ...followingAndFilteredDaosSections] diff --git a/packages/stateful/command/hooks/useFollowingAndFilteredDaosSections.ts b/packages/stateful/command/hooks/useFollowingAndFilteredDaosSections.ts index 943e5dae4..5dbffbbec 100644 --- a/packages/stateful/command/hooks/useFollowingAndFilteredDaosSections.ts +++ b/packages/stateful/command/hooks/useFollowingAndFilteredDaosSections.ts @@ -1,15 +1,24 @@ import { useTranslation } from 'react-i18next' -import { waitForAll } from 'recoil' +import { useRecoilValue, waitForAll } from 'recoil' -import { searchDaosSelector } from '@dao-dao/state/recoil' -import { useCachedLoadable } from '@dao-dao/stateless' +import { navigatingToHrefAtom, searchDaosSelector } from '@dao-dao/state/recoil' +import { useCachedLoadable, useDaoNavHelpers } from '@dao-dao/stateless' import { CommandModalContextSection, CommandModalContextSectionItem, CommandModalContextUseSectionsOptions, CommandModalDaoInfo, + ContractVersion, } from '@dao-dao/types' -import { getFallbackImage, getSupportedChains } from '@dao-dao/utils' +import { + getConfiguredChains, + getDisplayNameForChainId, + getFallbackImage, + getImageUrlForChainId, + getSupportedChains, + mustGetConfiguredChainConfig, + parseContractVersion, +} from '@dao-dao/utils' import { useLoadingFeaturedDaoCardInfos, @@ -34,6 +43,7 @@ export const useFollowingAndFilteredDaosSections = ({ const chains = getSupportedChains() const featuredDaosLoading = useLoadingFeaturedDaoCardInfos() const followingDaosLoading = useLoadingFollowingDaoCardInfos() + const { getDaoPath } = useDaoNavHelpers() const queryResults = useCachedLoadable( options.filter @@ -56,36 +66,76 @@ export const useFollowingAndFilteredDaosSections = ({ : undefined ) + const navigatingToHref = useRecoilValue(navigatingToHrefAtom) + // Use query results if filter is present. - const daos = options.filter - ? (queryResults.state !== 'hasValue' ? [] : queryResults.contents.flat()) - .filter(({ value }) => !!value?.config) - .map( - ({ - chainId, - id: coreAddress, - value: { - config: { name, image_url }, - proposalCount, - }, - }): CommandModalContextSectionItem => ({ - chainId, - coreAddress, - name, - imageUrl: image_url || getFallbackImage(coreAddress), - // If DAO has no proposals, make it less visible and give it a - // tooltip to indicate that it may not be active. - ...(proposalCount === 0 && { - className: 'opacity-50', - tooltip: t('info.inactiveDaoTooltip'), - sortLast: true, - }), - }) - ) - : // Otherwise when filter is empty, display featured DAOs. - featuredDaosLoading.loading - ? [] - : featuredDaosLoading.data + const daos = [ + ...(options.filter + ? (queryResults.state !== 'hasValue' ? [] : queryResults.contents.flat()) + .filter(({ value }) => !!value?.config) + .map( + ({ + chainId, + id: coreAddress, + value: { + config: { name, image_url }, + version, + proposalCount, + }, + }): CommandModalContextSectionItem => ({ + chainId, + coreAddress, + coreVersion: parseContractVersion(version.version), + name, + imageUrl: image_url || getFallbackImage(coreAddress), + // If DAO has no proposals, make it less visible and give it a + // tooltip to indicate that it may not be active. + ...(proposalCount === 0 && { + className: 'opacity-50', + tooltip: t('info.inactiveDaoTooltip'), + sortLast: true, + }), + loading: navigatingToHref === getDaoPath(coreAddress), + }) + ) + : // Otherwise when filter is empty, display featured DAOs. + featuredDaosLoading.loading + ? [] + : featuredDaosLoading.data), + // Add configured chains. + ...getConfiguredChains().flatMap( + ({ + chainId, + noGov, + }): CommandModalContextSectionItem | [] => { + if (noGov) { + return [] + } + + const chainName = mustGetConfiguredChainConfig(chainId).name + // Ignore chain if followed since they show up in a separate section. + if ( + !followingDaosLoading.loading && + followingDaosLoading.data.some( + (following) => + following.chainId === chainId && + following.coreVersion === ContractVersion.Gov + ) + ) { + return [] + } + + return { + chainId, + coreAddress: chainName, + coreVersion: ContractVersion.Gov, + name: getDisplayNameForChainId(chainId), + imageUrl: getImageUrlForChainId(chainId), + loading: navigatingToHref === getDaoPath(chainName), + } + } + ), + ] // When filter present, use search results. Otherwise use featured DAOs. const daosLoading = options.filter diff --git a/packages/stateful/components/DaoCreatedModal.tsx b/packages/stateful/components/DaoCreatedModal.tsx index 7d23e4e6d..271605d65 100644 --- a/packages/stateful/components/DaoCreatedModal.tsx +++ b/packages/stateful/components/DaoCreatedModal.tsx @@ -3,6 +3,7 @@ import { DaoCreatedModalProps, DaoCreatedModal as StatelessDaoCreatedModal, } from '@dao-dao/stateless' +import { DaoSource, FollowState } from '@dao-dao/types' import { useFollowingDaos } from '../hooks' import { LinkWrapper } from './LinkWrapper' @@ -19,7 +20,20 @@ export const DaoCreatedModal = ({ ...props }: StatefulDaoCreatedModalProps) => { const { isFollowing, setFollowing, setUnfollowing, updatingFollowing } = - useFollowingDaos(itemProps.chainId) + useFollowingDaos() + + const followedDao: DaoSource = { + chainId: itemProps.chainId, + coreAddress: itemProps.coreAddress, + } + const follow: FollowState = { + following: isFollowing(followedDao), + updatingFollowing, + onFollow: () => + isFollowing(followedDao) + ? setUnfollowing(followedDao) + : setFollowing(followedDao), + } return ( @@ -28,14 +42,7 @@ export const DaoCreatedModal = ({ itemProps={{ ...itemProps, - follow: { - following: isFollowing(itemProps.coreAddress), - updatingFollowing, - onFollow: () => - isFollowing(itemProps.coreAddress) - ? setUnfollowing(itemProps.coreAddress) - : setFollowing(itemProps.coreAddress), - }, + follow, LinkWrapper, }} diff --git a/packages/stateful/components/DappLayout.tsx b/packages/stateful/components/DappLayout.tsx index 1d1accb8d..596f5e0ef 100644 --- a/packages/stateful/components/DappLayout.tsx +++ b/packages/stateful/components/DappLayout.tsx @@ -7,7 +7,6 @@ import { useRecoilState, useRecoilValue, waitForAll } from 'recoil' import { betaWarningAcceptedAtom, commandModalVisibleAtom, - govProposalCreatedCardPropsAtom, mountedInBrowserAtom, navigationCompactAtom, proposalCreatedCardPropsAtom, @@ -16,7 +15,6 @@ import { import { BetaWarningModal, ChainProvider, - GovProposalCreatedModal, ProposalCreatedModal, DappLayout as StatelessDappLayout, useAppContext, @@ -34,7 +32,7 @@ import { import { ButtonLink } from './ButtonLink' import { DaoCreatedModal } from './DaoCreatedModal' import { LinkWrapper } from './LinkWrapper' -import { DockWallet, SidebarWallet } from './NavWallet' +import { DockWallet } from './NavWallet' import { WalletModals } from './wallet' export const DappLayout = ({ children }: { children: ReactNode }) => { @@ -68,8 +66,6 @@ export const DappLayout = ({ children }: { children: ReactNode }) => { ) const [proposalCreatedCardProps, setProposalCreatedCardProps] = useRecoilState(proposalCreatedCardPropsAtom) - const [govProposalCreatedCardProps, setGovProposalCreatedCardProps] = - useRecoilState(govProposalCreatedCardPropsAtom) const { rootCommandContextMaker, inbox } = useAppContext() // Type-check, should always be loaded for dapp. @@ -126,15 +122,12 @@ export const DappLayout = ({ children }: { children: ReactNode }) => { useAutoRefreshData() //! Following DAOs - const { chains } = useProfile({ - onlySupported: true, - }) + const { uniquePublicKeys } = useProfile() const followingDaoDropdownInfos = useCachedLoading( - !chains.loading + !uniquePublicKeys.loading ? waitForAll( - chains.data.map(({ chainId, publicKey }) => + uniquePublicKeys.data.map(({ publicKey }) => followingDaoDropdownInfosSelector({ - chainId, walletPublicKey: publicKey, // If not compact, remove any SubDAO from the top level that // exists as a SubDAO of another followed DAO at the top level. @@ -156,20 +149,21 @@ export const DappLayout = ({ children }: { children: ReactNode }) => { ButtonLink={ButtonLink} DockWallet={DockWallet} connect={openView} + inboxCount={ + inbox.loading || + // Prevent hydration errors by loading until mounted. + !mountedInBrowser + ? { + loading: true, + } + : { + loading: false, + data: inbox.items.length, + } + } navigationProps={{ walletConnected: isWalletConnected, LinkWrapper, - inboxCount: - inbox.loading || - // Prevent hydration errors by loading until mounted. - !mountedInBrowser - ? { - loading: true, - } - : { - loading: false, - data: inbox.items.length, - }, setCommandModalVisible: () => setCommandModalVisible(true), followingDaos: mountedInBrowser ? followingDaoDropdownInfos.loading @@ -186,7 +180,6 @@ export const DappLayout = ({ children }: { children: ReactNode }) => { compact, setCompact, mountedInBrowser, - SidebarWallet, }} > {children} @@ -227,18 +220,6 @@ export const DappLayout = ({ children }: { children: ReactNode }) => { /> )} - {govProposalCreatedCardProps && ( - setGovProposalCreatedCardProps(undefined), - }} - /> - )} - diff --git a/packages/stateful/components/SelfRelayExecuteModal.tsx b/packages/stateful/components/SelfRelayExecuteModal.tsx index 99b0cdda3..cd5ff3d3e 100644 --- a/packages/stateful/components/SelfRelayExecuteModal.tsx +++ b/packages/stateful/components/SelfRelayExecuteModal.tsx @@ -772,7 +772,7 @@ export const SelfRelayExecuteModal = ({ console.error( t('error.failedToRelayPackets', { - chain: chain.pretty_name, + chain: getDisplayNameForChainId(chain.chain_id), }) + (tries > 0 ? ' ' + t('info.tryingAgain') : ''), err ) @@ -872,7 +872,7 @@ export const SelfRelayExecuteModal = ({ console.error( t('error.failedToRelayAcks', { - chain: chain.pretty_name, + chain: getDisplayNameForChainId(chain.chain_id), }) + (tries > 0 ? ' ' + t('info.tryingAgain') : ''), err ) diff --git a/packages/stateful/components/dao/CreateDaoForm.tsx b/packages/stateful/components/dao/CreateDaoForm.tsx index a450258f9..2b6cc7cc9 100644 --- a/packages/stateful/components/dao/CreateDaoForm.tsx +++ b/packages/stateful/components/dao/CreateDaoForm.tsx @@ -1,7 +1,6 @@ import { ArrowBack } from '@mui/icons-material' import cloneDeep from 'lodash.clonedeep' import merge from 'lodash.merge' -import { useRouter } from 'next/router' import { useEffect, useMemo, useState } from 'react' import { FormProvider, @@ -14,6 +13,7 @@ import { useTranslation } from 'react-i18next' import { constSelector, useRecoilState, useRecoilValue } from 'recoil' import { averageColorSelector, walletChainIdAtom } from '@dao-dao/state/recoil' +import { fetchContractInfo } from '@dao-dao/state/utils' import { Button, ChainProvider, @@ -31,6 +31,7 @@ import { } from '@dao-dao/stateless' import { ActionKey, + ContractVersion, CreateDaoContext, CreateDaoCustomValidator, DaoPageMode, @@ -53,11 +54,11 @@ import { getDisplayNameForChainId, getFallbackImage, getFundsFromDaoInstantiateMsg, - getGovProposalPath, getNativeTokenForChainId, getSupportedChainConfig, getSupportedChains, makeValidateMsg, + parseContractVersion, processError, } from '@dao-dao/utils' @@ -146,7 +147,6 @@ export const InnerCreateDaoForm = ({ }: CreateDaoFormProps) => { const { t } = useTranslation() - const router = useRouter() const chainContext = useSupportedChainContext() const { chainId, @@ -158,8 +158,8 @@ export const InnerCreateDaoForm = ({ }, } = chainContext - const { goToDao } = useDaoNavHelpers() - const { setFollowing } = useFollowingDaos(chainId) + const { goToDao, goToDaoProposal } = useDaoNavHelpers() + const { setFollowing } = useFollowingDaos() const { mode } = useAppContext() @@ -482,38 +482,36 @@ export const InnerCreateDaoForm = ({ setCreating(true) // Redirect to prefilled chain governance prop page. - router.push( - getGovProposalPath(chainGovName, 'create', { - prefill: encodeJsonToBase64({ - chainId, - title: `Create DAO: ${name.trim()}`, - description: 'This proposal creates a new DAO.', - _actionData: [ - { - _id: 'create', - actionKey: ActionKey.Execute, - data: { - chainId, - address: factoryContractAddress, - message: JSON.stringify( - { - instantiate_contract_with_self_admin: { - code_id: codeIds.DaoCore, - instantiate_msg: encodeJsonToBase64(instantiateMsg), - label: instantiateMsg.name, - }, + goToDaoProposal(chainGovName, 'create', { + prefill: encodeJsonToBase64({ + chainId, + title: `Create DAO: ${name.trim()}`, + description: 'This proposal creates a new DAO.', + _actionData: [ + { + _id: 'create', + actionKey: ActionKey.Execute, + data: { + chainId, + address: factoryContractAddress, + message: JSON.stringify( + { + instantiate_contract_with_self_admin: { + code_id: codeIds.DaoCore, + instantiate_msg: encodeJsonToBase64(instantiateMsg), + label: instantiateMsg.name, }, - null, - 2 - ), - funds: [], - cw20: false, - } as ExecuteData, - }, - ], - } as Partial), - }) - ) + }, + null, + 2 + ), + funds: [], + cw20: false, + } as ExecuteData, + }, + ], + } as Partial), + }) } else if (isWalletConnected) { setCreating(true) try { @@ -523,9 +521,17 @@ export const InnerCreateDaoForm = ({ error: (err) => processError(err), }) + const info = await fetchContractInfo(chainId, coreAddress) + const coreVersion = + (info && parseContractVersion(info.version)) || + ContractVersion.Unknown + // Don't set following on SDA. Only dApp. if (mode !== DaoPageMode.Sda) { - setFollowing(coreAddress) + setFollowing({ + chainId, + coreAddress, + }) } // New wallet balances will not appear until the next block. @@ -589,6 +595,7 @@ export const InnerCreateDaoForm = ({ setDaoCreatedCardProps({ chainId, coreAddress, + coreVersion, name, description, imageUrl: imageUrl || getFallbackImage(coreAddress), diff --git a/packages/stateful/components/dao/CreateDaoProposal.tsx b/packages/stateful/components/dao/CreateDaoProposal.tsx index a75eba451..6edb564f0 100644 --- a/packages/stateful/components/dao/CreateDaoProposal.tsx +++ b/packages/stateful/components/dao/CreateDaoProposal.tsx @@ -354,7 +354,7 @@ const InnerCreateDaoProposal = ({ setLatestProposalSave({}) // Navigate to proposal (underneath the creation modal). - goToDaoProposal(info.dao.coreAddressOrId, info.id) + goToDaoProposal(info.dao.coreAddress, info.id) }, [ deleteDraft, diff --git a/packages/stateful/components/dao/DaoCard.tsx b/packages/stateful/components/dao/DaoCard.tsx index a0afd74d8..b3536771e 100644 --- a/packages/stateful/components/dao/DaoCard.tsx +++ b/packages/stateful/components/dao/DaoCard.tsx @@ -2,7 +2,8 @@ import { DaoCard as StatelessDaoCard, useCachedLoading, } from '@dao-dao/stateless' -import { DaoCardInfo } from '@dao-dao/types/components/DaoCard' +import { DaoSource } from '@dao-dao/types' +import { DaoCardInfo, FollowState } from '@dao-dao/types/components/DaoCard' import { useFollowingDaos, useProfile } from '../../hooks' import { daoCardInfoLazyDataSelector } from '../../recoil' @@ -15,7 +16,7 @@ export const DaoCard = (props: DaoCardInfo) => { const { chains } = useProfile() const { isFollowing, setFollowing, setUnfollowing, updatingFollowing } = - useFollowingDaos(props.chainId) + useFollowingDaos() const lazyData = useCachedLoading( daoCardInfoLazyDataSelector({ @@ -32,18 +33,24 @@ export const DaoCard = (props: DaoCardInfo) => { } ) + const followedDao: DaoSource = { + chainId: props.chainId, + coreAddress: props.coreAddress, + } + const follow: FollowState = { + following: isFollowing(followedDao), + updatingFollowing, + onFollow: () => + isFollowing(followedDao) + ? setUnfollowing(followedDao) + : setFollowing(followedDao), + } + return ( - isFollowing(props.coreAddress) - ? setUnfollowing(props.coreAddress) - : setFollowing(props.coreAddress), - }} + follow={follow} lazyData={lazyData} /> ) diff --git a/packages/stateful/components/dao/DaoPageWrapper.tsx b/packages/stateful/components/dao/DaoPageWrapper.tsx index e08ff1f95..6978c8abf 100644 --- a/packages/stateful/components/dao/DaoPageWrapper.tsx +++ b/packages/stateful/components/dao/DaoPageWrapper.tsx @@ -1,6 +1,6 @@ import { NextSeo } from 'next-seo' import { useRouter } from 'next/router' -import { PropsWithChildren, useEffect } from 'react' +import { PropsWithChildren, useEffect, useMemo } from 'react' import { useRecoilState } from 'recoil' import { accountsSelector, walletChainIdAtom } from '@dao-dao/state/recoil' @@ -38,7 +38,7 @@ export type DaoPageWrapperProps = PropsWithChildren<{ setIcon?: (icon: string | undefined) => void }> -export interface DaoProposalPageWrapperProps extends DaoPageWrapperProps { +export type DaoProposalProps = DaoPageWrapperProps & { proposalInfo: CommonProposalInfo | null } @@ -57,8 +57,8 @@ export const DaoPageWrapper = ({ const { setRootCommandContextMaker } = useAppContext() const [walletChainId, setWalletChainId] = useRecoilState(walletChainIdAtom) - // Update walletChainId to whatever the current DAO is so the right address - // appears in the sidebar. + // Update walletChainId to whatever the current DAO is to ensure we connect + // correctly. const currentChainId = serializedInfo?.chainId useEffect(() => { if (currentChainId && currentChainId !== walletChainId) { @@ -68,7 +68,9 @@ export const DaoPageWrapper = ({ // Set theme's accentColor. useEffect(() => { - if (!isReady || isFallback) return + if (!isReady || isFallback) { + return + } // Only set the accent color if we have enough contrast. if (accentColor) { @@ -100,16 +102,20 @@ export const DaoPageWrapper = ({ : undefined ) - const info: DaoInfo | undefined = serializedInfo && { - ...serializedInfo, - accounts: - accounts.loading || accounts.errored - ? serializedInfo.accounts - : accounts.data, - created: serializedInfo.created - ? new Date(serializedInfo.created) - : undefined, - } + const info = useMemo( + (): DaoInfo | undefined => + serializedInfo && { + ...serializedInfo, + accounts: + accounts.loading || accounts.errored + ? serializedInfo.accounts + : accounts.data, + created: serializedInfo.created + ? new Date(serializedInfo.created) + : undefined, + }, + [serializedInfo, accounts] + ) // Load DAO info once static props are loaded so it's more up to date. const loadingDaoInfo = useCachedLoadingWithError( @@ -148,6 +154,7 @@ export const DaoPageWrapper = ({ dao: { chainId: loadedInfo.chainId, coreAddress: loadedInfo.coreAddress, + coreVersion: loadedInfo.coreVersion, name: loadedInfo.name, imageUrl: loadedInfo.imageUrl || getFallbackImage(loadedInfo.coreAddress), @@ -186,7 +193,7 @@ export const DaoPageWrapper = ({ }> {loadedInfo ? ( - {/* Suspend children to prevent unmounting and remounting InnerDaoPageWrapper and the context providers inside it every time something needs to suspend (which causes a lot of flickering loading states). */} + {/* Suspend children to prevent unmounting and remounting the context providers inside it every time something needs to suspend (which causes a lot of flickering loading states). */} }> {children} diff --git a/packages/stateful/components/dao/DaoProposal.tsx b/packages/stateful/components/dao/DaoProposal.tsx index 0cafa5f1f..e4861ef4a 100644 --- a/packages/stateful/components/dao/DaoProposal.tsx +++ b/packages/stateful/components/dao/DaoProposal.tsx @@ -33,7 +33,7 @@ import { useOnCurrentDaoWebSocketMessage, useWallet } from '../../hooks' import { PageHeaderContent } from '../PageHeaderContent' import { SelfRelayExecuteModal } from '../SelfRelayExecuteModal' import { DaoApproverProposalContentDisplay } from './DaoApproverProposalContentDisplay' -import { DaoProposalPageWrapperProps } from './DaoPageWrapper' +import { DaoProposalProps } from './DaoPageWrapper' import { DaoPreProposeApprovalProposalContentDisplay } from './DaoPreProposeApprovalProposalContentDisplay' import { DaoProposalContentDisplay } from './DaoProposalContentDisplay' @@ -328,7 +328,7 @@ const InnerDaoProposal = ({ proposalInfo }: InnerDaoProposalProps) => { export const DaoProposal = ({ proposalInfo, serializedInfo, -}: Pick) => +}: DaoProposalProps) => proposalInfo && serializedInfo ? ( ( - // Add a unique key here to tell React to re-render everything when the - // `coreAddress` is changed, since for some insane reason, Next.js does not - // reset state when navigating between dynamic rotues. Even though the `info` - // value passed below changes, somehow no re-render occurs... unless the `key` - // prop is unique. See the issue below for more people compaining about this - // to no avail. https://github.com/vercel/next.js/issues/9992 - - +export const DaoProviders = ({ info, children }: DaoProvidersProps) => { + // Don't wrap chain governance in voting module or DAO actions provider. + const inner = + info.coreVersion === ContractVersion.Gov ? ( + children + ) : ( ( > {children} - - -) + ) + + return ( + // Add a unique key here to tell React to re-render everything when the + // `coreAddress` is changed, since for some insane reason, Next.js does not + // reset state when navigating between dynamic rotues. Even though the + // `info` value passed below changes, somehow no re-render occurs... unless + // the `key` prop is unique. See the issue below for more people compaining + // about this to no avail. https://github.com/vercel/next.js/issues/9992 + + + {inner} + + + ) +} export type DaoProvidersWithoutInfoProps = { chainId: string diff --git a/packages/stateful/components/dao/LazyDaoCard.tsx b/packages/stateful/components/dao/LazyDaoCard.tsx index 14a6d8ae8..7950b3036 100644 --- a/packages/stateful/components/dao/LazyDaoCard.tsx +++ b/packages/stateful/components/dao/LazyDaoCard.tsx @@ -33,16 +33,19 @@ export const LazyDaoCard = (props: LazyDaoCardProps) => { ) : daoCardInfo.errored || !daoCardInfo.data ? ( void -}> - -export interface GovProposalPageWrapperProps extends GovPageWrapperProps { - proposalId: string -} - -export const GovPageWrapper = ({ - url, - title, - description, - accentColor, - serializedInfo, - error, - setIcon, - children, -}: GovPageWrapperProps) => { - const { isReady, isFallback } = useRouter() - const { setAccentColor, theme } = useThemeContext() - - const [walletChainId, setWalletChainId] = useRecoilState(walletChainIdAtom) - // Update walletChainId so the sidebar shows the correct wallet address. - useEffect(() => { - if (serializedInfo && serializedInfo.chainId !== walletChainId) { - setWalletChainId(serializedInfo.chainId) - } - }, [serializedInfo, setWalletChainId, walletChainId]) - - // Set theme's accentColor. - useEffect(() => { - if (!isReady || isFallback) return - - // Only set the accent color if we have enough contrast. - if (accentColor) { - const rgb = accentColor - .replace(/^rgba?\(|\s+|\)$/g, '') - .split(',') - .map(Number) - const brightness = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000 - if ( - (theme === 'dark' && brightness < 100) || - (theme === 'light' && brightness > 255 - 100) - ) { - setAccentColor(undefined) - return - } - } - - setAccentColor(accentColor ?? undefined) - }, [accentColor, setAccentColor, isReady, isFallback, theme]) - - const info: DaoInfo | undefined = serializedInfo && { - ...serializedInfo, - created: serializedInfo.created - ? new Date(serializedInfo.created) - : undefined, - } - - // Set icon for the page from info if setIcon is present. - useEffect(() => { - if (setIcon) { - setIcon( - info?.imageUrl - ? transformIpfsUrlToHttpsIfNecessary(info.imageUrl) - : undefined - ) - } - }, [setIcon, info?.imageUrl]) - - return ( - <> - - - {/* On fallback page (waiting for static props), `info` is not yet present. Let's just display a loader until `info` is loaded. We can't access translations until static props are loaded anyways. */} - }> - {info ? ( - - - }> - {children} - - - - ) : error ? ( - - ) : ( - - )} - - - ) -} diff --git a/packages/stateful/components/gov/GovProposal.tsx b/packages/stateful/components/gov/GovProposal.tsx index 071714817..5991366ab 100644 --- a/packages/stateful/components/gov/GovProposal.tsx +++ b/packages/stateful/components/gov/GovProposal.tsx @@ -1,23 +1,32 @@ import { Dispatch, SetStateAction, useCallback, useRef } from 'react' +import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' +import { useSetRecoilState } from 'recoil' -import { govProposalSelector } from '@dao-dao/state/recoil' +import { + govProposalSelector, + refreshGovProposalsAtom, +} from '@dao-dao/state/recoil' import { PageLoader, Popup, Proposal, ProposalNotFound, - useCachedLoading, + useCachedLoadingWithError, useChain, } from '@dao-dao/stateless' import { DaoTabId, GovProposalWithDecodedContent } from '@dao-dao/types' import { ProposalStatus } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1/gov' +import { mustGetConfiguredChainConfig } from '@dao-dao/utils' import { GovActionsProvider } from '../../actions' -import { useLoadingGovProposal } from '../../hooks' +import { + useLoadingGovProposal, + useOnCurrentDaoWebSocketMessage, +} from '../../hooks' +import { DaoProposalProps } from '../dao/DaoPageWrapper' import { PageHeaderContent } from '../PageHeaderContent' import { SuspenseLoader } from '../SuspenseLoader' -import { GovProposalPageWrapperProps } from './GovPageWrapper' import { GovProposalContentDisplay } from './GovProposalContentDisplay' import { GovProposalStatusAndInfo, @@ -33,6 +42,7 @@ type InnerGovProposalProps = { const InnerGovProposal = ({ proposal }: InnerGovProposalProps) => { const { t } = useTranslation() + const { chain_id: chainId } = useChain() const proposalId = proposal.id.toString() const loadingProposal = useLoadingGovProposal(proposalId) @@ -53,6 +63,37 @@ const InnerGovProposal = ({ proposal }: InnerGovProposalProps) => { (Dispatch> | null) | null >(null) + const setRefreshGovProposalsId = useSetRecoilState( + refreshGovProposalsAtom(chainId) + ) + // Proposal status listener. Show alerts and refresh. + useOnCurrentDaoWebSocketMessage( + 'proposal', + async ({ status, proposalId }) => { + // If the current proposal updated... + if (proposalId === proposal.id.toString()) { + setRefreshGovProposalsId((id) => id + 1) + + // Manually revalidate static props. + fetch( + `/api/revalidate?d=${mustGetConfiguredChainConfig( + chainId + )}&p=${proposalId}` + ) + + if (status === ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD) { + toast.success(t('success.proposalOpenForVoting')) + } else if (status === ProposalStatus.PROPOSAL_STATUS_PASSED) { + toast.success(t('success.proposalPassed')) + } else if (status === ProposalStatus.PROPOSAL_STATUS_FAILED) { + toast.success(t('success.proposalPassedButExecutionFailed')) + } else if (status === ProposalStatus.PROPOSAL_STATUS_REJECTED) { + toast.success(t('success.proposalRejected')) + } + } + } + ) + return ( <> { ) } -export const GovProposal = ({ - proposalId, -}: Pick) => { +export const GovProposal = ({ proposalInfo }: DaoProposalProps) => { const { chain_id: chainId } = useChain() - const proposalLoading = useCachedLoading( - govProposalSelector({ - chainId, - proposalId: Number(proposalId), - }), - undefined + const proposalLoading = useCachedLoadingWithError( + proposalInfo + ? govProposalSelector({ + chainId, + proposalId: Number(proposalInfo.id), + }) + : undefined ) - return proposalId ? ( + return proposalInfo ? ( } - forceFallback={proposalLoading.loading || !proposalLoading.data} + forceFallback={proposalLoading.loading || proposalLoading.errored} > - {!proposalLoading.loading && proposalLoading.data && ( + {!proposalLoading.loading && !proposalLoading.errored && ( )} diff --git a/packages/stateful/components/gov/GovProposalLine.tsx b/packages/stateful/components/gov/GovProposalLine.tsx index 8da4f1b18..dd649b5cf 100644 --- a/packages/stateful/components/gov/GovProposalLine.tsx +++ b/packages/stateful/components/gov/GovProposalLine.tsx @@ -3,25 +3,21 @@ import { GovProposalWalletVote, ProposalLine as StatelessProposalLine, useConfiguredChainContext, + useDaoNavHelpers, useLoadingGovProposalTimestampInfo, } from '@dao-dao/stateless' -import { GovProposalWithDecodedContent } from '@dao-dao/types' +import { StatefulGovProposalLineProps } from '@dao-dao/types' import { ProposalStatus } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' -import { getGovProposalPath } from '@dao-dao/utils' import { useLoadingGovProposalWalletVoteInfo } from '../../hooks' import { LinkWrapper } from '../LinkWrapper' -export type GovProposalLineProps = { - proposalId: string - proposal: GovProposalWithDecodedContent -} - -export const GovProposalLine = (props: GovProposalLineProps) => { +export const GovProposalLine = (props: StatefulGovProposalLineProps) => { const { proposalId, proposal } = props const { config: { name }, } = useConfiguredChainContext() + const { getDaoProposalPath } = useDaoNavHelpers() const loadingTimestampInfo = useLoadingGovProposalTimestampInfo( proposal.proposal @@ -34,7 +30,7 @@ export const GovProposalLine = (props: GovProposalLineProps) => { Status={(props) => ( )} - href={getGovProposalPath(name, proposalId)} + href={getDaoProposalPath(name, proposalId)} proposalNumber={Number(proposalId)} proposalPrefix="" timestampDisplay={ diff --git a/packages/stateful/components/gov/GovProposalList.tsx b/packages/stateful/components/gov/GovProposalList.tsx index 3d62c3117..b889d03bf 100644 --- a/packages/stateful/components/gov/GovProposalList.tsx +++ b/packages/stateful/components/gov/GovProposalList.tsx @@ -1,9 +1,11 @@ import { useRouter } from 'next/router' import { useCallback, useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' +import { useSetRecoilState } from 'recoil' import { govProposalsSelector, + refreshGovProposalsAtom, searchedDecodedGovProposalsSelector, } from '@dao-dao/state/recoil' import { @@ -12,11 +14,13 @@ import { useCachedLoadingWithError, useChain, } from '@dao-dao/stateless' +import { StatefulGovProposalLineProps } from '@dao-dao/types' import { ProposalStatus } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' import { chainIsIndexed } from '@dao-dao/utils' +import { useOnCurrentDaoWebSocketMessage } from '../../hooks/useWebSocket' import { LinkWrapper } from '../LinkWrapper' -import { GovProposalLine, GovProposalLineProps } from './GovProposalLine' +import { GovProposalLine } from './GovProposalLine' const PROPSALS_PER_PAGE = 20 @@ -26,6 +30,14 @@ export const GovProposalList = () => { const { asPath } = useRouter() const hasIndexer = chainIsIndexed(chain.chain_id) + // Refresh all proposals on proposal WebSocket messages. + const setRefreshGovProposalsId = useSetRecoilState( + refreshGovProposalsAtom(chain.chain_id) + ) + useOnCurrentDaoWebSocketMessage('proposal', () => + setRefreshGovProposalsId((id) => id + 1) + ) + const openGovProposalsVotingPeriod = useCachedLoading( govProposalsSelector({ chainId: chain.chain_id, @@ -91,7 +103,7 @@ export const GovProposalList = () => { }, [loadingAllGovProposals, maxPage]) const [historyProposals, setHistoryProposals] = useState< - GovProposalLineProps[] + StatefulGovProposalLineProps[] >([]) useEffect(() => { @@ -107,7 +119,7 @@ export const GovProposalList = () => { prop.proposal.status === ProposalStatus.PROPOSAL_STATUS_FAILED ) .map( - (proposal): GovProposalLineProps => ({ + (proposal): StatefulGovProposalLineProps => ({ proposalId: proposal.id.toString(), proposal, }) @@ -128,7 +140,7 @@ export const GovProposalList = () => { ? [] : openGovProposalsVotingPeriod.data.proposals .map( - (proposal): GovProposalLineProps => ({ + (proposal): StatefulGovProposalLineProps => ({ proposalId: proposal.id.toString(), proposal, }) @@ -143,7 +155,7 @@ export const GovProposalList = () => { ? [] : govProposalsDepositPeriod.data.proposals .map( - (proposal): GovProposalLineProps => ({ + (proposal): StatefulGovProposalLineProps => ({ proposalId: proposal.id.toString(), proposal, }) @@ -212,7 +224,7 @@ export const GovProposalList = () => { searchedGovProposals.loading || searchedGovProposals.errored ? [] : searchedGovProposals.data.proposals.map( - (proposal): GovProposalLineProps => ({ + (proposal): StatefulGovProposalLineProps => ({ proposalId: proposal.id.toString(), proposal, }) diff --git a/packages/stateful/components/gov/GovProposalStatusAndInfo.tsx b/packages/stateful/components/gov/GovProposalStatusAndInfo.tsx index 4ba4fc71b..9e5c77e44 100644 --- a/packages/stateful/components/gov/GovProposalStatusAndInfo.tsx +++ b/packages/stateful/components/gov/GovProposalStatusAndInfo.tsx @@ -27,6 +27,7 @@ import { useCachedLoading, useChain, useConfiguredChainContext, + useDaoNavHelpers, } from '@dao-dao/stateless' import { GenericToken, @@ -44,7 +45,7 @@ import { convertDenomToMicroDenomStringWithDecimals, convertMicroDenomToDenomWithDecimals, formatPercentOf100, - getGovPath, + getDisplayNameForChainId, processError, } from '@dao-dao/utils' @@ -105,7 +106,7 @@ const InnerGovProposalStatusAndInfo = ({ }) => { const { t } = useTranslation() const { - chain: { chain_id: chainId, pretty_name: chainPrettyName }, + chain: { chain_id: chainId }, config: { name: chainConfigName }, } = useConfiguredChainContext() const { @@ -113,6 +114,7 @@ const InnerGovProposalStatusAndInfo = ({ address: walletAddress = '', getSigningStargateClient, } = useWallet() + const { getDaoPath } = useDaoNavHelpers() const { id: proposalId, @@ -145,11 +147,11 @@ const InnerGovProposalStatusAndInfo = ({ label: t('title.dao'), Value: (props) => ( - {chainPrettyName} + {getDisplayNameForChainId(chainId)} ), }, @@ -354,6 +356,7 @@ const InnerProposalStatusAndInfoLoader = ( config: { name }, chain, } = useConfiguredChainContext() + const { getDaoPath } = useDaoNavHelpers() const LoaderP: ComponentType<{ className: string }> = ({ className }) => (

...

@@ -363,8 +366,8 @@ const InnerProposalStatusAndInfoLoader = ( Icon: (props) => , label: t('title.dao'), Value: (props) => ( - - {chain.pretty_name} + + {getDisplayNameForChainId(chain.chain_id)} ), }, diff --git a/packages/stateful/components/gov/NewGovProposal.tsx b/packages/stateful/components/gov/NewGovProposal.tsx index 8ef719a20..68904b073 100644 --- a/packages/stateful/components/gov/NewGovProposal.tsx +++ b/packages/stateful/components/gov/NewGovProposal.tsx @@ -37,9 +37,9 @@ import { } from 'recoil' import { - govProposalCreatedCardPropsAtom, govProposalSelector, latestProposalSaveAtom, + proposalCreatedCardPropsAtom, proposalDraftsAtom, refreshGovProposalsAtom, } from '@dao-dao/state/recoil' @@ -54,6 +54,7 @@ import { ProposalContentDisplay, Tooltip, useConfiguredChainContext, + useDaoNavHelpers, useHoldingKey, } from '@dao-dao/stateless' import { @@ -78,7 +79,7 @@ import { formatDateTime, formatPercentOf100, formatTime, - getGovProposalPath, + getDisplayNameForChainId, getImageUrlForChainId, getRpcForChainId, getSignerOptions, @@ -246,6 +247,7 @@ const InnerNewGovProposal = ({ chain, chainWallet, } = useWallet() + const { getDaoProposalPath } = useDaoNavHelpers() const { context } = useActionOptions() if (context.type !== ActionContextType.Gov) { @@ -261,8 +263,8 @@ const InnerNewGovProposal = ({ const { address: walletAddress = '' } = useWallet() const { entity } = useEntity(walletAddress) - const [govProposalCreatedCardProps, setGovProposalCreatedCardProps] = - useRecoilState(govProposalCreatedCardPropsAtom) + const [proposalCreatedCardProps, setProposalCreatedCardProps] = + useRecoilState(proposalCreatedCardPropsAtom) const setLatestProposalSave = useSetRecoilState( latestProposalSaveAtom(localStorageKey) @@ -425,7 +427,7 @@ const InnerNewGovProposal = ({ : proposal.proposal.votingEndTime // Show modal. - setGovProposalCreatedCardProps({ + setProposalCreatedCardProps({ id: proposal.id.toString(), title: proposal.title, description: proposal.description, @@ -452,9 +454,8 @@ const InnerNewGovProposal = ({ : []), ], dao: { - type: 'gov', - name: chainContext.chain.pretty_name, - coreAddressOrId: chainContext.config.name, + name: getDisplayNameForChainId(chainContext.chainId), + coreAddress: chainContext.config.name, imageUrl: getImageUrlForChainId(chainContext.chainId), }, }) @@ -467,7 +468,7 @@ const InnerNewGovProposal = ({ // Navigate to proposal (underneath the creation modal). router.push( - getGovProposalPath( + getDaoProposalPath( chainContext.config.name, proposalId.toString() ) @@ -491,9 +492,8 @@ const InnerNewGovProposal = ({ getOfflineSignerDirect, holdingAltForDirectSign, chainContext.chainId, - chainContext.chain.pretty_name, chainContext.config.name, - setGovProposalCreatedCardProps, + setProposalCreatedCardProps, context.params.threshold, context.params.quorum, refreshGovProposals, @@ -513,7 +513,7 @@ const InnerNewGovProposal = ({ copyDraftLinkRef.current = () => { navigator.clipboard.writeText( SITE_URL + - getGovProposalPath(chainContext.config.name, 'create', { + getDaoProposalPath(chainContext.config.name, 'create', { prefill: encodeJsonToBase64(proposalData), }) ) @@ -525,13 +525,13 @@ const InnerNewGovProposal = ({ saveLatestProposalRef.current = () => setLatestProposalSave( // If created proposal, clear latest proposal save. - govProposalCreatedCardProps ? {} : cloneDeep(proposalData) + proposalCreatedCardProps ? {} : cloneDeep(proposalData) ) // Save latest data to atom and thus localStorage every second. useEffect(() => { // If created proposal, don't save. - if (govProposalCreatedCardProps) { + if (proposalCreatedCardProps) { return } @@ -546,7 +546,7 @@ const InnerNewGovProposal = ({ saveLatestProposalRef.current() saveQueuedRef.current = false }, 1000) - }, [govProposalCreatedCardProps, setLatestProposalSave, proposalData]) + }, [proposalCreatedCardProps, setLatestProposalSave, proposalData]) const [drafts, setDrafts] = useRecoilState( proposalDraftsAtom(localStorageKey) @@ -671,7 +671,7 @@ const InnerNewGovProposal = ({
-
+

{t('info.reviewYourProposal')} @@ -720,19 +720,19 @@ const InnerNewGovProposal = ({

{showSubmitErrorNote && ( -

+

{t('error.correctErrorsAbove')}

)} {!!submitError && ( -

+

{submitError}

)} {showPreview && ( -
+
{ const { t } = useTranslation() const { clear: _clear } = useInboxApi() - const clear = useCallback(() => _clear(item.id), [_clear, item.id]) + const clear = useCallback(() => _clear([item]), [_clear, item]) const Renderer = ITEM_RENDERER_MAP[item.type] @@ -41,7 +41,7 @@ export const InboxMainItemRenderer = ({
onCheck(item.id)} + onClick={() => onCheck(item)} > { e.stopPropagation() - onCheck(item.id) + onCheck(item) }} size="sm" variant="ghost" @@ -67,7 +67,8 @@ export const InboxMainItemRenderer = ({ ) } -// TODO: combine these into standard shape, with optional extra buttons +// TODO(inbox): combine these into standard shape, with optional extra buttons. +// also add generic fallback with clear button const ITEM_RENDERER_MAP: Partial< Record>> > = { diff --git a/packages/stateful/components/inbox/renderers/JoinedDao.tsx b/packages/stateful/components/inbox/renderers/JoinedDao.tsx index 86af4b00d..819749a08 100644 --- a/packages/stateful/components/inbox/renderers/JoinedDao.tsx +++ b/packages/stateful/components/inbox/renderers/JoinedDao.tsx @@ -32,7 +32,7 @@ export const JoinedDaoRenderer = ({ const { t } = useTranslation() const { getDaoPath } = useDaoNavHelpers() - const { setFollowing, updatingFollowing } = useFollowingDaos(chainId) + const { setFollowing, updatingFollowing } = useFollowingDaos() const timestampFormatter = useTranslatedTimeDeltaFormatter({ words: false, @@ -94,7 +94,10 @@ export const JoinedDaoRenderer = ({ onClick={(e) => { e.stopPropagation() setLoadingFollowing(true) - setFollowing(dao).then((success) => { + setFollowing({ + chainId, + coreAddress: dao, + }).then((success) => { if (success) { clear() } diff --git a/packages/stateful/components/nft/NftSelectionModal.tsx b/packages/stateful/components/nft/NftSelectionModal.tsx index 339ab0295..8e6b5ea81 100644 --- a/packages/stateful/components/nft/NftSelectionModal.tsx +++ b/packages/stateful/components/nft/NftSelectionModal.tsx @@ -100,19 +100,13 @@ export const NftSelectionModal = ({ ) const nftChains = uniqueChainIds.map(getChainForChainId) const filterOptions = useMemo( - () => [ + (): TypedOption>[] => [ { - id: 'all', label: t('title.all'), value: () => true, }, ...nftChains.map( - ( - chain - ): TypedOption> & { - id: string - } => ({ - id: chain.chain_name, + (chain): TypedOption> => ({ label: getDisplayNameForChainId(chain.chain_id), value: (nft) => nft.chainId === chain.chain_id, }) diff --git a/packages/stateful/components/pages/AccountDaos.tsx b/packages/stateful/components/pages/AccountDaos.tsx index 054f383a2..eed485533 100644 --- a/packages/stateful/components/pages/AccountDaos.tsx +++ b/packages/stateful/components/pages/AccountDaos.tsx @@ -1,8 +1,5 @@ import { useRouter } from 'next/router' -import { useChain } from '@dao-dao/stateless' - -import { useProfile } from '../../hooks' import { WalletDaos } from '../wallet' export const AccountDaos = () => { @@ -13,36 +10,5 @@ export const AccountDaos = () => { throw new Error('Invalid address.') } - const { chain_id: chainId } = useChain() - const { chains } = useProfile({ - address, - onlySupported: true, - }) - - return ( - - ) + return } diff --git a/packages/stateful/components/pages/ChainGovernanceHome.tsx b/packages/stateful/components/pages/ChainGovernanceHome.tsx deleted file mode 100644 index 919056843..000000000 --- a/packages/stateful/components/pages/ChainGovernanceHome.tsx +++ /dev/null @@ -1,174 +0,0 @@ -import { - AccountBalanceWalletOutlined, - AccountBalanceWalletRounded, - ArrowOutwardRounded, - FiberSmartRecordOutlined, - FiberSmartRecordRounded, - HowToVoteOutlined, - HowToVoteRounded, -} from '@mui/icons-material' -import { useRouter } from 'next/router' -import { useEffect, useRef, useState } from 'react' -import { useTranslation } from 'react-i18next' - -import { - ChainPickerPopup, - DaoDappTabbedHome, - useConfiguredChainContext, - useDaoInfoContext, -} from '@dao-dao/stateless' -import { ContractVersion, DaoTabId, DaoTabWithComponent } from '@dao-dao/types' -import { - CHAIN_SUBDAOS, - getConfiguredChainConfig, - getConfiguredChains, - getGovPath, -} from '@dao-dao/utils' - -import { ButtonLink } from '../ButtonLink' -import { GovCommunityPoolTab, GovProposalsTab, GovSubDaosTab } from '../gov' -import { IconButtonLink } from '../IconButtonLink' -import { LinkWrapper } from '../LinkWrapper' -import { PageHeaderContent } from '../PageHeaderContent' -import { SuspenseLoader } from '../SuspenseLoader' - -export const ChainGovernanceHome = () => { - const { t } = useTranslation() - const { - chainId, - config: { name, explorerUrlTemplates }, - } = useConfiguredChainContext() - const { coreVersion } = useDaoInfoContext() - - const router = useRouter() - - const tabs: DaoTabWithComponent[] = useRef([ - { - id: DaoTabId.Proposals, - label: t('title.proposals'), - Component: GovProposalsTab, - Icon: HowToVoteOutlined, - IconFilled: HowToVoteRounded, - }, - { - id: DaoTabId.Treasury, - label: t('title.communityPool'), - Component: GovCommunityPoolTab, - Icon: AccountBalanceWalletOutlined, - IconFilled: AccountBalanceWalletRounded, - lazy: true, - }, - // If SubDAOs exist, show them. - ...(CHAIN_SUBDAOS[chainId]?.length - ? [ - { - id: DaoTabId.SubDaos, - label: t('title.subDaos'), - Component: GovSubDaosTab, - Icon: FiberSmartRecordOutlined, - IconFilled: FiberSmartRecordRounded, - }, - ] - : []), - ]).current - const firstTabId = tabs[0].id - - // Pre-fetch tabs. - useEffect(() => { - tabs.forEach((tab) => { - router.prefetch(getGovPath(name, tab.id)) - }) - }, [name, router, tabs]) - - const slug = (router.query.slug || []) as string[] - const checkedSlug = useRef(false) - useEffect(() => { - // Only check one time, in case they load the page with no slug. - if (checkedSlug.current) { - return - } - checkedSlug.current = true - - // If no slug, redirect to first tab. - if (slug.length === 0) { - router.replace(getGovPath(name, firstTabId), undefined, { - shallow: true, - }) - } - }, [router, slug.length, firstTabId, name]) - - const tabId = - slug.length > 0 && tabs.some(({ id }) => id === slug[0]) - ? slug[0] - : // If tab is invalid, default to first tab. - firstTabId - const onSelectTabId = (tabId: string) => - router.replace(getGovPath(name, tabId), undefined, { - shallow: true, - }) - - const [goingToChainId, setGoingToChainId] = useState() - // Pre-fetch other chains. - useEffect(() => { - getConfiguredChains().forEach(({ name }) => { - router.prefetch(getGovPath(name, tabId)) - }) - }, [router, tabId]) - - const explorerButton = - coreVersion === ContractVersion.Gov && explorerUrlTemplates?.gov ? ( - // Go to governance page of chain explorer. - - ) : undefined - - return ( - <> - { - // Type-check. None option is not enabled so this shouldn't - // happen. - if (!chainId) { - return - } - - const chainConfig = getConfiguredChainConfig(chainId) - if (chainConfig) { - router.push(getGovPath(chainConfig.name, tabId)) - setGoingToChainId(chainId) - } - }} - selectedChainId={chainId} - // Match title in `PageHeader`. - selectedLabelClassName="header-text truncate text-lg leading-[5rem] sm:text-xl" - /> - ), - }} - rightNode={explorerButton} - /> - - - - ) -} diff --git a/packages/stateful/components/pages/ChainGovernanceList.tsx b/packages/stateful/components/pages/ChainGovernanceList.tsx new file mode 100644 index 000000000..9550a6877 --- /dev/null +++ b/packages/stateful/components/pages/ChainGovernanceList.tsx @@ -0,0 +1,32 @@ +import { NextSeo } from 'next-seo' +import { useTranslation } from 'react-i18next' + +import { ChainGovernanceList as StatelessChainGovernanceList } from '@dao-dao/stateless' +import { + CHAIN_GOVERNANCE_DESCRIPTION, + CHAIN_GOVERNANCE_TITLE, +} from '@dao-dao/utils' + +import { LazyDaoCard } from '../dao' +import { PageHeaderContent } from '../PageHeaderContent' + +export const ChainGovernanceList = () => { + const { t } = useTranslation() + + return ( + <> + + + + + + + ) +} diff --git a/packages/stateful/components/pages/DaoDappHome.tsx b/packages/stateful/components/pages/DaoDappHome.tsx index e396a5a83..d328e73d3 100644 --- a/packages/stateful/components/pages/DaoDappHome.tsx +++ b/packages/stateful/components/pages/DaoDappHome.tsx @@ -1,83 +1,58 @@ -import { Add, ArrowOutwardRounded } from '@mui/icons-material' +import { Add } from '@mui/icons-material' import { useEffect, useRef } from 'react' import { useTranslation } from 'react-i18next' import { DaoDappTabbedHome, FollowingToggle, - useConfiguredChainContext, useDaoInfoContext, useDaoNavHelpers, } from '@dao-dao/stateless' import { ActionKey, - ContractVersion, + DaoDappTabbedHomeProps, DaoTabId, + DaoTabWithComponent, Feature, FollowState, + LoadingData, } from '@dao-dao/types' import { getDaoProposalSinglePrefill } from '@dao-dao/utils' -import { useDaoTabs, useFollowingDaos, useMembership } from '../../hooks' +import { + useDaoTabs, + useFollowingDaos, + useGovDaoTabs, + useMembership, +} from '../../hooks' import { ButtonLink } from '../ButtonLink' -import { IconButtonLink } from '../IconButtonLink' import { LinkWrapper } from '../LinkWrapper' import { PageHeaderContent } from '../PageHeaderContent' import { SuspenseLoader } from '../SuspenseLoader' -export const DaoDappHome = () => { +export type InnerDaoDappHomeProps = Pick< + DaoDappTabbedHomeProps, + 'parentProposalRecognizeSubDaoHref' +> & { + loadingTabs: LoadingData +} + +export const InnerDaoDappHome = ({ + loadingTabs, + ...props +}: InnerDaoDappHomeProps) => { const { t } = useTranslation() const { getDaoPath, getDaoProposalPath, router } = useDaoNavHelpers() - const { config: chainConfig } = useConfiguredChainContext() const daoInfo = useDaoInfoContext() - // If no parent, fallback to current DAO since it's already loaded from the - // above hook. We won't use this value unless there's a parent. It's redundant - // but has no effect. - const { isMember: isMemberOfParent = false } = useMembership( - daoInfo.parentDao ?? daoInfo - ) - - const parentProposalRecognizeSubDaoHref = - // Only show this prefill proposal link if the wallet is a member of the - // parent. - isMemberOfParent && - // Only v2+ DAOs support SubDAOs. - daoInfo.supportedFeatures[Feature.SubDaos] && - // Only show if the parent has not already registered this as a SubDAO. - daoInfo.parentDao && - !daoInfo.parentDao.registeredSubDao - ? getDaoProposalPath(daoInfo.parentDao.coreAddress, 'create', { - prefill: getDaoProposalSinglePrefill({ - title: t('title.recognizeSubDao', { - name: daoInfo.name, - }), - description: t('info.recognizeSubDaoDescription', { - name: daoInfo.name, - }), - actions: [ - { - actionKey: ActionKey.ManageSubDaos, - data: { - toAdd: [ - { - addr: daoInfo.coreAddress, - }, - ], - toRemove: [], - }, - }, - ], - }), - }) - : undefined - const { isFollowing, setFollowing, setUnfollowing, updatingFollowing } = - useFollowingDaos(daoInfo.chainId) - const following = isFollowing(daoInfo.coreAddress) + useFollowingDaos() + const following = isFollowing({ + chainId: daoInfo.chainId, + coreAddress: daoInfo.coreAddress, + }) - const loadingTabs = useDaoTabs() // Just a type-check because some tabs are loaded at the beginning. const tabs = loadingTabs.loading ? undefined : loadingTabs.data // Default to proposals tab for type-check, but should never happen as some @@ -123,9 +98,10 @@ export const DaoDappHome = () => { const follow: FollowState = { following, onFollow: () => - following - ? setUnfollowing(daoInfo.coreAddress) - : setFollowing(daoInfo.coreAddress), + (following ? setUnfollowing : setFollowing)({ + chainId: daoInfo.chainId, + coreAddress: daoInfo.coreAddress, + }), updatingFollowing, } @@ -137,50 +113,101 @@ export const DaoDappHome = () => { current: daoInfo.name, }} rightNode={ - daoInfo.coreVersion === ContractVersion.Gov ? ( - chainConfig?.explorerUrlTemplates?.gov ? ( - // Go to governance page of chain explorer. - - ) : undefined - ) : ( - <> - {/* Show propose button on desktop. */} - - - {t('button.propose')} - - - {/* Show follow button on mobile. */} - - - ) + <> + {/* Show propose button on desktop. */} + + + {t('button.propose')} + + + {/* Show follow button on mobile. */} + + } /> ) } + +export const DaoDappHome = () => { + const { t } = useTranslation() + const { getDaoProposalPath } = useDaoNavHelpers() + + const daoInfo = useDaoInfoContext() + + // If no parent, fallback to current DAO since it's already loaded from the + // above hook. We won't use this value unless there's a parent. It's redundant + // but has no effect. + const { isMember: isMemberOfParent = false } = useMembership( + daoInfo.parentDao ?? daoInfo + ) + + const parentProposalRecognizeSubDaoHref = + // Only show this prefill proposal link if the wallet is a member of the + // parent. + isMemberOfParent && + // Only v2+ DAOs support SubDAOs. + daoInfo.supportedFeatures[Feature.SubDaos] && + // Only show if the parent has not already registered this as a SubDAO. + daoInfo.parentDao && + !daoInfo.parentDao.registeredSubDao + ? getDaoProposalPath(daoInfo.parentDao.coreAddress, 'create', { + prefill: getDaoProposalSinglePrefill({ + title: t('title.recognizeSubDao', { + name: daoInfo.name, + }), + description: t('info.recognizeSubDaoDescription', { + name: daoInfo.name, + }), + actions: [ + { + actionKey: ActionKey.ManageSubDaos, + data: { + toAdd: [ + { + addr: daoInfo.coreAddress, + }, + ], + toRemove: [], + }, + }, + ], + }), + }) + : undefined + + const loadingTabs = useDaoTabs() + + return ( + + ) +} + +export const ChainGovernanceDappHome = () => { + const loadingTabs = useGovDaoTabs() + return +} diff --git a/packages/stateful/components/pages/EditProfile.tsx b/packages/stateful/components/pages/EditProfile.tsx new file mode 100644 index 000000000..cb8ff1390 --- /dev/null +++ b/packages/stateful/components/pages/EditProfile.tsx @@ -0,0 +1,88 @@ +import { NextSeo } from 'next-seo' +import { useRouter } from 'next/router' +import { useEffect } from 'react' +import { useRecoilState, useSetRecoilState } from 'recoil' + +import { + mergeProfilesVisibleAtom, + updateProfileNftVisibleAtom, + walletChainIdAtom, +} from '@dao-dao/state/recoil' +import { Loader, EditProfile as StatelessEditProfile } from '@dao-dao/stateless' +import { + SITE_URL, + getConfiguredChainConfig, + getConfiguredChains, +} from '@dao-dao/utils' + +import { useManageProfile, useWallet } from '../../hooks' +import { PageHeaderContent } from '../PageHeaderContent' +import { DisconnectWallet } from '../wallet' + +export const EditProfile = () => { + const router = useRouter() + const { isWalletConnecting, isWalletConnected } = useWallet() + const { + profile, + updateProfile: { go: updateProfile }, + merge: { options: profileMergeOptions }, + } = useManageProfile() + + const [walletChainId, setWalletChainId] = useRecoilState(walletChainIdAtom) + // Switch to a valid chain if not configured. + const configuredChainConfig = getConfiguredChainConfig(walletChainId) + useEffect(() => { + if (!configuredChainConfig) { + setWalletChainId(getConfiguredChains()[0].chainId) + } + }, [configuredChainConfig, setWalletChainId]) + + const setUpdateProfileNftVisible = useSetRecoilState( + updateProfileNftVisibleAtom + ) + const setMergeProfilesVisible = useSetRecoilState(mergeProfilesVisibleAtom) + + // If not connecting or connected after 3 seconds, redirect to home. + useEffect(() => { + if (isWalletConnecting || isWalletConnected) { + return + } + + const timer = setTimeout(() => { + router.push('/') + }, 3000) + + return () => clearTimeout(timer) + }, [isWalletConnected, isWalletConnecting, router]) + + return ( + <> + + + + + {isWalletConnecting || isWalletConnected ? ( + setMergeProfilesVisible(true)} + openProfileNftUpdate={() => setUpdateProfileNftVisible(true)} + profile={profile} + updateProfile={updateProfile} + /> + ) : ( + + )} + + ) +} diff --git a/packages/stateful/components/pages/Home.tsx b/packages/stateful/components/pages/Home.tsx index c084b9900..ec110137b 100644 --- a/packages/stateful/components/pages/Home.tsx +++ b/packages/stateful/components/pages/Home.tsx @@ -1,39 +1,45 @@ +import { NextSeo } from 'next-seo' import { useRouter } from 'next/router' -import { useCallback, useEffect } from 'react' +import { useEffect } from 'react' import { useTranslation } from 'react-i18next' import { useSetRecoilState } from 'recoil' -import { commandModalVisibleAtom, walletChainIdAtom } from '@dao-dao/state' +import { walletChainIdAtom } from '@dao-dao/state' import { ChainPickerPopup, Logo, Home as StatelessHome, } from '@dao-dao/stateless' -import { getSupportedChainConfig, getSupportedChains } from '@dao-dao/utils' - -import { useFeed } from '../../feed' import { - useLoadingFeaturedDaoCardInfos, - useLoadingFollowingDaoCardInfos, - useWallet, -} from '../../hooks' + SITE_TITLE, + SITE_URL, + getSupportedChainConfig, + getSupportedChains, +} from '@dao-dao/utils' + +import { useLoadingFeaturedDaoCardInfos, useWallet } from '../../hooks' import { DaoCard } from '../dao' import { LinkWrapper } from '../LinkWrapper' import { PageHeaderContent } from '../PageHeaderContent' +import { ProfileHome } from './ProfileHome' export const Home = () => { const { t } = useTranslation() const { isWalletConnected } = useWallet() const router = useRouter() - const { chain } = router.query + const _tab = router.query.tab + const tabPath = _tab && Array.isArray(_tab) ? _tab[0] : undefined - // If defined, on a chain-only home page. - const chainId = chain - ? getSupportedChains().find(({ name }) => name === chain)?.chainId + // If defined, try to find matching chain. If found, show chain-only page. + const chainId = tabPath + ? getSupportedChains().find(({ name }) => name === tabPath)?.chainId : undefined - // Update wallet chain ID to the current chain if on a chain-only home page. + // Show profile page if wallet connected and not on a chain-only page. + const onProfilePage = isWalletConnected && !chainId + + // Update wallet chain ID to the current chain if on a chain-only page. const setWalletChainId = useSetRecoilState(walletChainIdAtom) useEffect(() => { if (chainId) { @@ -41,31 +47,7 @@ export const Home = () => { } }, [chainId, setWalletChainId]) - const setCommandModalVisible = useSetRecoilState(commandModalVisibleAtom) - const featuredDaosLoading = useLoadingFeaturedDaoCardInfos(chainId) - const followingDaosLoading = useLoadingFollowingDaoCardInfos(chainId) - const feed = useFeed( - chainId - ? { - filter: { - chainId, - }, - } - : undefined - ) - - const openSearch = useCallback( - () => setCommandModalVisible(true), - [setCommandModalVisible] - ) - - // Pre-fetch chain-only pages. - useEffect(() => { - getSupportedChains().forEach(({ name }) => { - router.prefetch('/' + name) - }) - }, [router]) const chainPicker = ( { return ( <> - {chainPicker}
} - rightNode={
{chainPicker}
} - title={t('title.home')} - titleClassName="hidden md:block" - /> - - + + {onProfilePage ? ( + <> + + +

{SITE_TITLE}

+ + } + /> + + + + ) : ( + <> + {chainPicker}
} + rightNode={
{chainPicker}
} + title={t('title.home')} + titleClassName="hidden md:block" + /> + + + + )} ) } diff --git a/packages/stateful/components/pages/NeutronGovernanceHome.tsx b/packages/stateful/components/pages/NeutronGovernanceHome.tsx deleted file mode 100644 index c9178c637..000000000 --- a/packages/stateful/components/pages/NeutronGovernanceHome.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import { useRouter } from 'next/router' -import { useEffect, useState } from 'react' -import { useRecoilValueLoadable } from 'recoil' - -import { DaoCoreV2Selectors } from '@dao-dao/state' -import { ChainPickerPopup, GovernanceDaos, useChain } from '@dao-dao/stateless' -import { - NEUTRON_GOVERNANCE_DAO, - getConfiguredChainConfig, - getConfiguredChains, - getGovPath, -} from '@dao-dao/utils' - -import { useLoadingDaoCardInfos } from '../../hooks' -import { DaoCard } from '../dao' -import { PageHeaderContent } from '../PageHeaderContent' - -export const NeutronGovernanceHome = () => { - const router = useRouter() - const { chain_id: chainId } = useChain() - - const neutronSubdaos = useRecoilValueLoadable( - DaoCoreV2Selectors.listAllSubDaosSelector({ - chainId, - contractAddress: NEUTRON_GOVERNANCE_DAO, - }) - ) - const daosLoading = useLoadingDaoCardInfos( - neutronSubdaos.state !== 'hasValue' - ? { loading: true } - : { - loading: false, - data: [ - { - chainId, - coreAddress: NEUTRON_GOVERNANCE_DAO, - }, - ...neutronSubdaos.contents.map(({ addr }) => ({ - chainId, - coreAddress: addr, - })), - ], - } - ) - - const [goingToChainId, setGoingToChainId] = useState() - // Pre-fetch other chains. - useEffect(() => { - getConfiguredChains().forEach(({ name }) => { - router.prefetch(getGovPath(name)) - }) - }, [router]) - - return ( - <> - { - // Type-check. None option is not enabled so this shouldn't happen. - if (!chainId) { - return - } - - const chainConfig = getConfiguredChainConfig(chainId) - if (chainConfig) { - router.push(getGovPath(chainConfig.name)) - setGoingToChainId(chainId) - } - }} - selectedChainId={chainId} - selectedIconClassName="xs:hidden" - // Match title in `PageHeader`. - selectedLabelClassName="hidden xs:block header-text truncate text-lg leading-[5rem] sm:text-xl" - /> - ), - }} - /> - - - - ) -} diff --git a/packages/stateful/components/pages/Me.tsx b/packages/stateful/components/pages/ProfileHome.tsx similarity index 59% rename from packages/stateful/components/pages/Me.tsx rename to packages/stateful/components/pages/ProfileHome.tsx index 0c58c2e0a..f22ecaccf 100644 --- a/packages/stateful/components/pages/Me.tsx +++ b/packages/stateful/components/pages/ProfileHome.tsx @@ -3,8 +3,6 @@ import { GroupRounded, WalletRounded, } from '@mui/icons-material' -import { NextPage } from 'next' -import { NextSeo } from 'next-seo' import { useRouter } from 'next/router' import { useEffect } from 'react' import { useTranslation } from 'react-i18next' @@ -18,48 +16,37 @@ import { } from '@dao-dao/state/recoil' import { ChainProvider, - Loader, PageLoader, - Profile as StatelessProfile, + ProfileHome as StatelessProfileHome, useCachedLoadable, useThemeContext, } from '@dao-dao/stateless' import { AccountTab, AccountTabId, Theme } from '@dao-dao/types' -import { - PROFILE_PAGE_DESCRIPTION, - PROFILE_PAGE_TITLE, - SITE_URL, - getConfiguredChainConfig, - getConfiguredChains, - transformBech32Address, -} from '@dao-dao/utils' +import { getConfiguredChainConfig, getConfiguredChains } from '@dao-dao/utils' import { WalletActionsProvider } from '../../actions/react/provider' import { useManageProfile } from '../../hooks' import { useWallet } from '../../hooks/useWallet' -import { ConnectWallet } from '../ConnectWallet' -import { PageHeaderContent } from '../PageHeaderContent' -import { ProfileActions, ProfileWallet } from '../profile' -import { ProfileDaos } from '../profile/ProfileDaos' +import { ProfileActions, ProfileDaos, ProfileWallet } from '../profile' import { SuspenseLoader } from '../SuspenseLoader' -export const Me: NextPage = () => { +export const ProfileHome = () => { const { t } = useTranslation() const router = useRouter() const tabs: AccountTab[] = [ - { - id: AccountTabId.Home, - label: t('title.wallet'), - Icon: WalletRounded, - Component: ProfileWallet, - }, { id: AccountTabId.Daos, label: t('title.daos'), Icon: GroupRounded, Component: ProfileDaos, }, + { + id: AccountTabId.Wallet, + label: t('title.wallet'), + Icon: WalletRounded, + Component: ProfileWallet, + }, { id: AccountTabId.Actions, label: t('title.actions'), @@ -68,11 +55,7 @@ export const Me: NextPage = () => { }, ] - const { - address: walletAddress = '', - isWalletConnected, - connect, - } = useWallet() + const { address: walletAddress } = useWallet() const { profile, updateProfile: { go: updateProfile }, @@ -134,59 +117,29 @@ export const Me: NextPage = () => { return ( <> - - - - {!configuredChainConfig ? ( - ) : isWalletConnected ? ( + ) : ( // Refresh all children when chain changes since state varies by chain. - - {/* Suspend to prevent hydration error since we load state on first render from localStorage. */} - }> - setMergeProfilesVisible(true)} - openProfileNftUpdate={() => setUpdateProfileNftVisible(true)} - profile={profile} - tabs={tabs} - updateProfile={updateProfile} - /> - - + openMergeProfilesModal={() => setMergeProfilesVisible(true)} + openProfileNftUpdate={() => setUpdateProfileNftVisible(true)} + profile={profile} + tabs={tabs} + updateProfile={updateProfile} + walletAddress={walletAddress} + /> - ) : ( - )} ) diff --git a/packages/stateful/components/pages/index.ts b/packages/stateful/components/pages/index.ts index b60d4d455..6e261fcef 100644 --- a/packages/stateful/components/pages/index.ts +++ b/packages/stateful/components/pages/index.ts @@ -1,10 +1,10 @@ export * from './Account' -export * from './ChainGovernanceHome' +export * from './ChainGovernanceList' export * from './DaoDappHome' export * from './DaoSdaHome' +export * from './EditProfile' export * from './ErrorPage404' export * from './Home' export * from './Inbox' -export * from './Me' -export * from './NeutronGovernanceHome' +export * from './ProfileHome' export * from './Status' diff --git a/packages/stateful/components/profile/MergeProfilesModal.tsx b/packages/stateful/components/profile/MergeProfilesModal.tsx index e3b4bcfe0..ebaca1503 100644 --- a/packages/stateful/components/profile/MergeProfilesModal.tsx +++ b/packages/stateful/components/profile/MergeProfilesModal.tsx @@ -98,18 +98,18 @@ const PerformMerge = ({ addingToOneProfile, onClose }: PerformMergeProps) => { const { addChains, - merge: { otherProfiles }, + merge: { profilesToMerge }, } = useManageProfile() const refreshProfiles = useRefreshProfile( - otherProfiles.map(({ address }) => address), + profilesToMerge.map(({ address }) => address), { loading: false, - data: otherProfiles.map(({ profile }) => profile), + data: profilesToMerge.map(({ profile }) => profile), } ) - const chainsToAdd = otherProfiles.map(({ chainId }) => chainId) + const chainsToAdd = profilesToMerge.map(({ chainId }) => chainId) return ( - + ) : ( isCreating && !!destinationChainId && @@ -189,12 +190,13 @@ export const CreateIcaComponent: ActionComponent = ({ {createdAddressLoading.loading ? ( ) : createdAddressLoading.errored ? ( - ) : createdAddressLoading.data ? ( = ({
)} - + ) } diff --git a/packages/stateful/actions/core/advanced/IcaExecute/index.tsx b/packages/stateful/actions/core/advanced/IcaExecute/index.tsx index 6c5d46525..7d34cc6db 100644 --- a/packages/stateful/actions/core/advanced/IcaExecute/index.tsx +++ b/packages/stateful/actions/core/advanced/IcaExecute/index.tsx @@ -14,7 +14,7 @@ import { InputErrorMessage, Loader, RocketShipEmoji, - WarningCard, + StatusCard, useCachedLoadingWithError, } from '@dao-dao/stateless' import { @@ -228,7 +228,11 @@ const Component: ActionComponent = (props) => { ))} - + ) } diff --git a/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/Component.tsx b/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/Component.tsx index fe1f79950..6046516c8 100644 --- a/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/Component.tsx +++ b/packages/stateful/actions/core/authorizations/AuthzGrantRevoke/Component.tsx @@ -16,8 +16,8 @@ import { RadioInput, SegmentedControlsTitle, SelectInput, + StatusCard, TextInput, - WarningCard, useChain, } from '@dao-dao/stateless' import { @@ -114,7 +114,9 @@ export const AuthzGrantRevokeComponent: ActionComponent< ]} /> - {mode === 'grant' && } + {mode === 'grant' && ( + + )}
= (options) => { diff --git a/packages/stateful/actions/core/treasury/ManageVesting/BeginVesting.tsx b/packages/stateful/actions/core/treasury/ManageVesting/BeginVesting.tsx index 08a2bfee2..9048d4fda 100644 --- a/packages/stateful/actions/core/treasury/ManageVesting/BeginVesting.tsx +++ b/packages/stateful/actions/core/treasury/ManageVesting/BeginVesting.tsx @@ -23,11 +23,11 @@ import { RadioInput, RadioInputOption, SelectInput, + StatusCard, TextAreaInput, TextInput, TokenInput, VestingStepsLineGraph, - WarningCard, } from '@dao-dao/stateless' import { ActionChainContextType, @@ -295,11 +295,12 @@ export const BeginVesting: ActionComponent = ({ {isCreating && !vestingManagerExists && configureVestingPaymentActionDefaults && ( - - + )}
diff --git a/packages/stateful/actions/core/treasury/Spend/Component.tsx b/packages/stateful/actions/core/treasury/Spend/Component.tsx index 69a3e563b..7dc8f819a 100644 --- a/packages/stateful/actions/core/treasury/Spend/Component.tsx +++ b/packages/stateful/actions/core/treasury/Spend/Component.tsx @@ -20,9 +20,9 @@ import { Loader, NumberInput, SelectInput, + StatusCard, TokenAmountDisplay, TokenInput, - WarningCard, useDetectWrap, } from '@dao-dao/stateless' import { @@ -599,7 +599,7 @@ export const SpendComponent: ActionComponent = ({ {isCreating && !betterNonPfmIbcPath.loading && betterNonPfmIbcPath.data && ( - @@ -627,11 +627,12 @@ export const SpendComponent: ActionComponent = ({
} + style="warning" /> )} {isCreating && !!missingAccountChainIds?.length && ( - @@ -686,6 +687,7 @@ export const SpendComponent: ActionComponent = ({ )}
} + style="warning" /> )}
diff --git a/packages/stateful/actions/core/treasury/token_swap/stateless/ExistingTokenSwap.tsx b/packages/stateful/actions/core/treasury/token_swap/stateless/ExistingTokenSwap.tsx index e9a2f34ce..fd51253ab 100644 --- a/packages/stateful/actions/core/treasury/token_swap/stateless/ExistingTokenSwap.tsx +++ b/packages/stateful/actions/core/treasury/token_swap/stateless/ExistingTokenSwap.tsx @@ -4,8 +4,8 @@ import { useTranslation } from 'react-i18next' import { CopyToClipboard, + StatusCard, TokenSwapStatus, - WarningCard, } from '@dao-dao/stateless' import { ActionComponent, TokenSwapStatusProps } from '@dao-dao/types' @@ -41,9 +41,10 @@ export const ExistingTokenSwap: ActionComponent = ({ value={tokenSwapContractAddress} /> - ) diff --git a/packages/stateful/components/ProposalLine.tsx b/packages/stateful/components/ProposalLine.tsx index b5a27486c..97c17cee9 100644 --- a/packages/stateful/components/ProposalLine.tsx +++ b/packages/stateful/components/ProposalLine.tsx @@ -1,6 +1,6 @@ import { useTranslation } from 'react-i18next' -import { ChainProvider, LineLoader, WarningCard } from '@dao-dao/stateless' +import { ChainProvider, LineLoader, StatusCard } from '@dao-dao/stateless' import { StatefulProposalLineProps } from '@dao-dao/types' import { @@ -46,7 +46,12 @@ const InnerProposalLine = ({ ? PreProposeApprovalProposalLine : ProposalLine if (!Component) { - return + return ( + + ) } return ( diff --git a/packages/stateful/components/SelfRelayExecuteModal.tsx b/packages/stateful/components/SelfRelayExecuteModal.tsx index cd5ff3d3e..91a66263f 100644 --- a/packages/stateful/components/SelfRelayExecuteModal.tsx +++ b/packages/stateful/components/SelfRelayExecuteModal.tsx @@ -115,7 +115,7 @@ type Relayer = { export const SelfRelayExecuteModal = ({ uniqueId, chainIds: _chainIds, - crossChainMessages, + crossChainPackets, transaction, onSuccess, onClose, @@ -582,7 +582,7 @@ export const SelfRelayExecuteModal = ({ try { // Parse the packets from the execution TX events. - const packets = parsePacketsFromTendermintEvents( + const txPackets = parsePacketsFromTendermintEvents( currentExecuteTx.events ).map((packet) => ({ packet, @@ -602,14 +602,14 @@ export const SelfRelayExecuteModal = ({ const { chain, client } = relayer - // Get the messages for this chain that need relaying. - const messages = crossChainMessages.filter( + // Get packets for this chain that need relaying. + const packets = crossChainPackets.filter( ({ data: { chainId } }) => chainId === chain.chain_id ) - // Get packets for this chain that need relaying. - const chainPackets = packets.filter(({ packet }) => - messages.some( + // Choose TX packets that match packets we want to relay. + const chainPackets = txPackets.filter(({ packet }) => + packets.some( ({ srcPort, dstPort }) => packet.sourcePort === srcPort && packet.destinationPort === dstPort @@ -1228,7 +1228,7 @@ export const SelfRelayExecuteModal = ({ /> - +
)} @@ -1250,7 +1250,7 @@ export const SelfRelayExecuteModal = ({ content: () => status === RelayStatus.RelayErrored ? (
-

+

{relayError}

@@ -1277,7 +1277,7 @@ export const SelfRelayExecuteModal = ({ relaying.relayer.chain.chain_id )} > -
+
-
+
- + ) : ( diff --git a/packages/stateful/components/TreasuryHistoryGraph.tsx b/packages/stateful/components/TreasuryHistoryGraph.tsx index cb519d733..9dd43a45b 100644 --- a/packages/stateful/components/TreasuryHistoryGraph.tsx +++ b/packages/stateful/components/TreasuryHistoryGraph.tsx @@ -21,7 +21,7 @@ import useDeepCompareEffect from 'use-deep-compare-effect' import { Loader, SegmentedControls, - WarningCard, + StatusCard, useCachedLoadingWithError, useNamedThemeColor, } from '@dao-dao/stateless' @@ -298,21 +298,23 @@ export const TreasuryHistoryGraph = ({
) : treasuryValueHistory.errored ? (
-
) : treasuryValueHistory.data.timestamps.length === 0 ? (
-
diff --git a/packages/stateful/components/dao/CreateDaoForm.tsx b/packages/stateful/components/dao/CreateDaoForm.tsx index 2b6cc7cc9..b45b03910 100644 --- a/packages/stateful/components/dao/CreateDaoForm.tsx +++ b/packages/stateful/components/dao/CreateDaoForm.tsx @@ -21,8 +21,8 @@ import { DaoHeader, ImageSelector, Loader, + StatusCard, TooltipInfoIcon, - WarningCard, useAppContext, useCachedLoadable, useDaoNavHelpers, @@ -810,11 +810,12 @@ export const InnerCreateDaoForm = ({ {submitValue === CreateDaoSubmitValue.Create && createViaGovernance && (
-
)} diff --git a/packages/stateful/components/dao/DaoApproverProposalContentDisplay.tsx b/packages/stateful/components/dao/DaoApproverProposalContentDisplay.tsx index 09fc98c70..ddcc4b5f0 100644 --- a/packages/stateful/components/dao/DaoApproverProposalContentDisplay.tsx +++ b/packages/stateful/components/dao/DaoApproverProposalContentDisplay.tsx @@ -6,7 +6,7 @@ import { Loader, ProposalContentDisplay, ProposalContentDisplayProps, - WarningCard, + StatusCard, useChain, } from '@dao-dao/stateless' import { @@ -179,7 +179,12 @@ const InnerDaoApproverProposalContentDisplayWithInnerContent = ({ const { entity } = useEntity(creatorAddress) if (!PreProposeApprovalInnerContentDisplay) { - return + return ( + + ) } return ( diff --git a/packages/stateful/components/dao/DaoPreProposeApprovalProposalContentDisplay.tsx b/packages/stateful/components/dao/DaoPreProposeApprovalProposalContentDisplay.tsx index 78ef05c92..1c74461d5 100644 --- a/packages/stateful/components/dao/DaoPreProposeApprovalProposalContentDisplay.tsx +++ b/packages/stateful/components/dao/DaoPreProposeApprovalProposalContentDisplay.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next' import { Loader, ProposalContentDisplay, - WarningCard, + StatusCard, useDaoInfoContext, useDaoNavHelpers, } from '@dao-dao/stateless' @@ -66,7 +66,12 @@ export const DaoPreProposeApprovalProposalContentDisplay = ({ : undefined if (!PreProposeApprovalInnerContentDisplay) { - return + return ( + + ) } if ( diff --git a/packages/stateful/components/dao/DaoProposal.tsx b/packages/stateful/components/dao/DaoProposal.tsx index e4861ef4a..f9f10cb8d 100644 --- a/packages/stateful/components/dao/DaoProposal.tsx +++ b/packages/stateful/components/dao/DaoProposal.tsx @@ -298,7 +298,7 @@ const InnerDaoProposal = ({ proposalInfo }: InnerDaoProposalProps) => { { )} ) : ( - ) } diff --git a/packages/stateful/components/inbox/InboxMainItemRenderer.tsx b/packages/stateful/components/inbox/InboxMainItemRenderer.tsx index 8936f3259..366cea28a 100644 --- a/packages/stateful/components/inbox/InboxMainItemRenderer.tsx +++ b/packages/stateful/components/inbox/InboxMainItemRenderer.tsx @@ -3,7 +3,7 @@ import clsx from 'clsx' import { ComponentType, useCallback } from 'react' import { useTranslation } from 'react-i18next' -import { IconButton, Loader, Tooltip, WarningCard } from '@dao-dao/stateless' +import { IconButton, Loader, StatusCard, Tooltip } from '@dao-dao/stateless' import { InboxItemRendererProps, InboxItemType, @@ -63,7 +63,7 @@ export const InboxMainItemRenderer = ({
) : ( - + ) } diff --git a/packages/stateful/components/pages/Inbox.tsx b/packages/stateful/components/pages/Inbox.tsx index 5d1a1f970..db8d006ed 100644 --- a/packages/stateful/components/pages/Inbox.tsx +++ b/packages/stateful/components/pages/Inbox.tsx @@ -4,7 +4,7 @@ import { NextSeo } from 'next-seo' import { useRouter } from 'next/router' import { useTranslation } from 'react-i18next' -import { Inbox as StatelessInbox, WarningCard } from '@dao-dao/stateless' +import { Inbox as StatelessInbox, StatusCard } from '@dao-dao/stateless' import { NOTIFICATIONS_PAGE_DESCRIPTION, NOTIFICATIONS_PAGE_TITLE, @@ -63,10 +63,11 @@ export const Inbox: NextPage = () => { inbox={inbox} /> ) : ( - )}
diff --git a/packages/stateful/components/wallet/WalletUi.tsx b/packages/stateful/components/wallet/WalletUi.tsx index 2c0bc3415..29f0b48fa 100644 --- a/packages/stateful/components/wallet/WalletUi.tsx +++ b/packages/stateful/components/wallet/WalletUi.tsx @@ -9,7 +9,7 @@ import { useTranslation } from 'react-i18next' import { useRecoilValue } from 'recoil' import { walletChainIdAtom } from '@dao-dao/state' -import { Modal, WarningCard } from '@dao-dao/stateless' +import { Modal, StatusCard } from '@dao-dao/stateless' import { getChainForChainId, maybeGetAssetListForChainId, @@ -87,15 +87,16 @@ export const WalletUi = (props: WalletModalProps) => { )} footerContent={ isWalletError && errorMessage ? ( - ) : qrState === State.Error && qrErrorMessage ? ( - + ) : undefined } header={{ diff --git a/packages/stateful/components/wallet/WalletUiConnected.tsx b/packages/stateful/components/wallet/WalletUiConnected.tsx index f81868a82..c2ba380f8 100644 --- a/packages/stateful/components/wallet/WalletUiConnected.tsx +++ b/packages/stateful/components/wallet/WalletUiConnected.tsx @@ -11,9 +11,9 @@ import { Button, ProfileImage, ProfileNameDisplayAndEditor, + StatusCard, Tooltip, WalletLogo, - WarningCard, } from '@dao-dao/stateless' import { useManageProfile } from '../../hooks' @@ -42,9 +42,10 @@ export const WalletUiConnected = ({ return (
{isWeb3Auth && ( - )} diff --git a/packages/stateful/hooks/useProposalRelayState.ts b/packages/stateful/hooks/useProposalRelayState.ts index bc68fdfca..1cd9d18e6 100644 --- a/packages/stateful/hooks/useProposalRelayState.ts +++ b/packages/stateful/hooks/useProposalRelayState.ts @@ -26,11 +26,14 @@ import { import { BaseProposalStatusAndInfoProps, CosmosMsgFor_Empty, + CrossChainPacketInfoState, + CrossChainPacketInfoStatus, LoadingData, ProposalRelayState, ProposalStatus, ProposalStatusEnum, } from '@dao-dao/types' +import { ExecutionResponse } from '@dao-dao/types/contracts/PolytoneListener' import { decodeCrossChainMessages, makeWasmMessage, @@ -78,19 +81,19 @@ export const useProposalRelayState = ({ ) // Decoded cross-chain execute messages. - const { crossChainMessages, dstChainIds } = useMemo(() => { - const crossChainMessages = decodeCrossChainMessages( + const { crossChainPackets, dstChainIds } = useMemo(() => { + const crossChainPackets = decodeCrossChainMessages( srcChainId, coreAddress, msgs ) const dstChainIds = uniq( - crossChainMessages.map(({ data: { chainId } }) => chainId) + crossChainPackets.map(({ data: { chainId } }) => chainId) ) return { - crossChainMessages, + crossChainPackets, dstChainIds, } }, [msgs, srcChainId, coreAddress]) @@ -100,7 +103,7 @@ export const useProposalRelayState = ({ packetsLoadable.loading || packetsLoadable.errored ? undefined : waitForAll( - crossChainMessages.map(({ data: { chainId }, srcPort, dstPort }) => { + crossChainPackets.map(({ data: { chainId }, srcPort, dstPort }) => { const packetsToCommit = (packetsLoadable.data || []).filter( (packet) => packet.sourcePort === srcPort && @@ -125,7 +128,7 @@ export const useProposalRelayState = ({ packetsLoadable.loading || packetsLoadable.errored ? undefined : waitForAll( - crossChainMessages.map(({ srcPort, dstPort }) => { + crossChainPackets.map(({ srcPort, dstPort }) => { const packetsToAck = (packetsLoadable.data || []).filter( (packet) => packet.sourcePort === srcPort && @@ -150,7 +153,7 @@ export const useProposalRelayState = ({ packetsLoadable.loading || packetsLoadable.errored ? undefined : waitForAll( - crossChainMessages.map(({ data: { chainId }, srcPort, dstPort }) => { + crossChainPackets.map(({ data: { chainId }, srcPort, dstPort }) => { const packetsToAck = (packetsLoadable.data || []).filter( (packet) => packet.sourcePort === srcPort && @@ -175,7 +178,7 @@ export const useProposalRelayState = ({ // Polytone relay results. const polytoneRelayResults = useCachedLoading( waitForAllSettled( - crossChainMessages.map((decoded) => + crossChainPackets.map((decoded) => decoded.type === 'polytone' ? PolytoneListenerSelectors.resultSelector({ chainId: srcChainId, @@ -193,9 +196,9 @@ export const useProposalRelayState = ({ [] ) - // Get unrelayed and timed-out messages. - const { relayedMsgs, unrelayedMsgs, timedOutMsgs } = useMemo(() => { - const crossChainMessageStatuses = + // Get packet states. + const states = useMemo((): ProposalRelayState['states'] => { + const packetStates = packetsLoadable.loading || packetsLoadable.errored || unreceivedPackets.loading || @@ -203,87 +206,141 @@ export const useProposalRelayState = ({ acksReceived.loading || polytoneRelayResults.loading ? [] - : crossChainMessages.flatMap((decoded, index) => { - if (decoded.type === 'polytone') { - const result = polytoneRelayResults.data[index] + : crossChainPackets.flatMap( + (packet, index): CrossChainPacketInfoState | [] => { + if (packet.type === 'polytone') { + const result = polytoneRelayResults.data[index] - return { - msg: decoded, - status: - result.state === 'hasError' && + return result.state === 'hasError' && result.contents instanceof Error && result.contents.message.includes( 'polytone::callbacks::CallbackMessage not found' ) - ? 'unrelayed' - : result.state === 'hasValue' - ? objectMatchesStructure(result.contents, { + ? { + packet, + status: CrossChainPacketInfoStatus.Pending, + } + : result.state === 'hasValue' + ? objectMatchesStructure(result.contents, { + callback: { + result: { + execute: { + Ok: {}, + }, + }, + }, + }) + ? { + packet, + status: CrossChainPacketInfoStatus.Relayed, + msgResponses: ( + (result.contents as any)!.callback.result.execute + .Ok as ExecutionResponse + ).result.map(({ events }) => ({ events })), + } + : objectMatchesStructure(result.contents, { callback: { result: { execute: { - Ok: {}, + Err: {}, }, }, }, }) - ? 'relayed' - : objectMatchesStructure(result.contents, { - callback: { - result: { - execute: { - Err: {}, - }, - }, - }, - }) && - (result.contents?.callback.result as any).execute - .Err === 'timeout' - ? 'timedOut' - : '' - : '', + ? (result.contents?.callback.result as any).execute.Err === + 'timeout' + ? { + packet, + status: CrossChainPacketInfoStatus.TimedOut, + } + : { + packet, + status: CrossChainPacketInfoStatus.Errored, + error: (result.contents as any).callback.result + .execute.Err, + } + : [] + : [] } - } - if (decoded.type === 'ica') { - // Get latest timeout of packets from this source. - const latestPacketTimeout = Math.max( - 0, - ...(packetsLoadable.data || []) - .filter((packet) => packet.sourcePort === decoded.srcPort) - .map((packet) => Number(packet.timeoutTimestamp)) - ) + if (packet.type === 'ica') { + // Get latest timeout of packets from this source. + const latestPacketTimeout = Math.max( + 0, + ...(packetsLoadable.data || []) + .filter((p) => p.sourcePort === packet.srcPort) + .map((p) => Number(p.timeoutTimestamp)) + ) - return { - msg: decoded, - status: - acksReceived.data[index]?.length && + return acksReceived.data[index]?.length && acksReceived.data[index].every(Boolean) - ? 'relayed' - : unreceivedPackets.data[index]?.length && - unreceivedPackets.data[index].some(Boolean) - ? Date.now() > Number(latestPacketTimeout) / 1e6 - ? 'timedOut' - : 'unrelayed' - : unreceivedAcks.data[index]?.length && - unreceivedAcks.data[index].some(Boolean) - ? 'unrelayed' - : // If could not find ack or packet, assume unrelayed. - 'unrelayed', + ? { + packet, + status: CrossChainPacketInfoStatus.Relayed, + // Cannot reliably fetch message events from ICA yet. + msgResponses: [], + } + : unreceivedPackets.data[index]?.length && + unreceivedPackets.data[index].some(Boolean) + ? Date.now() > Number(latestPacketTimeout) / 1e6 + ? { + packet, + status: CrossChainPacketInfoStatus.TimedOut, + } + : { + packet, + status: CrossChainPacketInfoStatus.Pending, + } + : unreceivedAcks.data[index]?.length && + unreceivedAcks.data[index].some(Boolean) + ? { + packet, + status: CrossChainPacketInfoStatus.Pending, + } + : // If could not find ack or packet, assume pending. + { + packet, + status: CrossChainPacketInfoStatus.Pending, + } } - } - return [] - }) + return [] + } + ) return { - relayedMsgs: crossChainMessageStatuses.flatMap(({ msg, status }) => - status === 'relayed' ? msg : [] + all: packetStates, + pending: packetStates.flatMap((state, index) => + state.status === CrossChainPacketInfoStatus.Pending + ? { + ...state, + index, + } + : [] ), - unrelayedMsgs: crossChainMessageStatuses.flatMap(({ msg, status }) => - status === 'unrelayed' ? msg : [] + relayed: packetStates.flatMap((state, index) => + state.status === CrossChainPacketInfoStatus.Relayed + ? { + ...state, + index, + } + : [] ), - timedOutMsgs: crossChainMessageStatuses.flatMap(({ msg, status }) => - status === 'timedOut' ? msg : [] + errored: packetStates.flatMap((state, index) => + state.status === CrossChainPacketInfoStatus.Errored + ? { + ...state, + index, + } + : [] + ), + timedOut: packetStates.flatMap((state, index) => + state.status === CrossChainPacketInfoStatus.TimedOut + ? { + ...state, + index, + } + : [] ), } }, [ @@ -291,7 +348,7 @@ export const useProposalRelayState = ({ unreceivedAcks, acksReceived, polytoneRelayResults, - crossChainMessages, + crossChainPackets, packetsLoadable, ]) @@ -307,15 +364,15 @@ export const useProposalRelayState = ({ }, useDeepCompareMemoize([srcChainId, dstChainIds]) ) - const anyUnrelayed = unrelayedMsgs.length > 0 + const anyPending = states.pending.length > 0 useEffect(() => { - if (!anyUnrelayed) { + if (!anyPending) { return } const interval = setInterval(refreshIbcData, 10 * 1000) return () => clearInterval(interval) - }, [anyUnrelayed, refreshIbcData]) + }, [anyPending, refreshIbcData]) const executedOverFiveMinutesAgo = status === ProposalStatusEnum.Executed && @@ -328,15 +385,15 @@ export const useProposalRelayState = ({ acksReceived.loading || polytoneRelayResults.loading ? undefined - : crossChainMessages.filter( - (decoded) => + : crossChainPackets.filter( + (packet) => // Not yet relayed. - unrelayedMsgs.includes(decoded) && + states.pending.some((p) => p.packet === packet) && // Executed a few minutes ago and still has not been relayed, or the // Polytone connection needs self-relay. (executedOverFiveMinutesAgo || - (decoded.type === 'polytone' && - !!decoded.data.polytoneConnection.needsSelfRelay)) + (packet.type === 'polytone' && + !!packet.data.polytoneConnection.needsSelfRelay)) ) const hasCrossChainMessagesNeedingSelfRelay = !!messagesNeedingSelfRelay?.length @@ -368,7 +425,7 @@ export const useProposalRelayState = ({ }), ], }, - crossChainMessages: messagesNeedingSelfRelay, + crossChainPackets: messagesNeedingSelfRelay, chainIds: uniq( messagesNeedingSelfRelay.map(({ data: { chainId } }) => chainId) ), @@ -385,10 +442,8 @@ export const useProposalRelayState = ({ : { loading: false, data: { - hasCrossChainMessages: crossChainMessages.length > 0, - relayedMsgs, - unrelayedMsgs, - timedOutMsgs, + hasCrossChainMessages: crossChainPackets.length > 0, + states, needsSelfRelay: hasCrossChainMessagesNeedingSelfRelay, openSelfRelay: () => status === ProposalStatusEnum.Executed && !loadingTxHash.loading diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/Mint/MintComponent.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/Mint/MintComponent.tsx index 69775ff29..5d1e0984a 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/Mint/MintComponent.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/actions/Mint/MintComponent.tsx @@ -11,7 +11,7 @@ import useDeepCompareEffect from 'use-deep-compare-effect' import { InputErrorMessage, NumberInput, - WarningCard, + StatusCard, useChain, useDetectWrap, } from '@dao-dao/stateless' @@ -135,9 +135,10 @@ export const MintComponent: ActionComponent = ({ return ( <> -
( -
- {style === 'info' && ( - - )} - {style === 'success' && } - {style === 'loading' && } - {style === 'warning' && ( - - )} - -

{content}

-
-) diff --git a/packages/stateless/components/StatusCard.stories.tsx b/packages/stateless/components/StatusCard.stories.tsx new file mode 100644 index 000000000..abd91b432 --- /dev/null +++ b/packages/stateless/components/StatusCard.stories.tsx @@ -0,0 +1,17 @@ +import { ComponentMeta, ComponentStory } from '@storybook/react' + +import { StatusCard } from './StatusCard' + +export default { + title: 'DAO DAO / packages / stateless / components / StatusCard', + component: StatusCard, +} as ComponentMeta + +const Template: ComponentStory = (args) => ( + +) + +export const Default = Template.bind({}) +Default.args = { + content: 'This is a warning.', +} diff --git a/packages/stateless/components/StatusCard.tsx b/packages/stateless/components/StatusCard.tsx new file mode 100644 index 000000000..fa361078a --- /dev/null +++ b/packages/stateless/components/StatusCard.tsx @@ -0,0 +1,109 @@ +import { Check, InfoOutlined, WarningRounded } from '@mui/icons-material' +import clsx from 'clsx' +import { ReactNode } from 'react' + +import { Loader } from './logo' + +export type StatusCardProps = { + style: 'info' | 'loading' | 'success' | 'warning' + size?: 'xs' | 'sm' | 'default' + content?: ReactNode + children?: ReactNode + className?: string + iconClassName?: string + textClassName?: string + contentContainerClassName?: string + /** + * If true, the icon will be placed at the top of the card. Otherwise, it will + * be centered vertically. + */ + iconAtTop?: boolean + onClick?: () => void +} + +export const StatusCard = ({ + style, + size = 'default', + content, + children, + className, + iconClassName, + textClassName, + contentContainerClassName, + iconAtTop = false, + onClick, +}: StatusCardProps) => { + const Icon = + style === 'info' + ? InfoOutlined + : style === 'success' + ? Check + : style === 'warning' + ? WarningRounded + : undefined + const iconColor = + style === 'info' || style === 'success' + ? 'text-icon-secondary' + : style === 'warning' + ? 'text-icon-interactive-warning' + : undefined + const textColor = + style === 'warning' ? '!text-text-interactive-warning-body' : undefined + + return ( +
+ {style === 'loading' ? ( + + ) : ( + Icon && ( + + ) + )} + +
+ {typeof content === 'string' ? ( +

+ {content} +

+ ) : ( + content + )} + + {children} +
+
+ ) +} diff --git a/packages/stateless/components/WarningCard.stories.tsx b/packages/stateless/components/WarningCard.stories.tsx deleted file mode 100644 index 9de0d691c..000000000 --- a/packages/stateless/components/WarningCard.stories.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { ComponentMeta, ComponentStory } from '@storybook/react' - -import { WarningCard } from './WarningCard' - -export default { - title: 'DAO DAO / packages / stateless / components / WarningCard', - component: WarningCard, -} as ComponentMeta - -const Template: ComponentStory = (args) => ( - -) - -export const Default = Template.bind({}) -Default.args = { - content: 'This is a warning.', -} diff --git a/packages/stateless/components/WarningCard.tsx b/packages/stateless/components/WarningCard.tsx deleted file mode 100644 index 5fba1a540..000000000 --- a/packages/stateless/components/WarningCard.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import { WarningRounded } from '@mui/icons-material' -import clsx from 'clsx' -import { ReactNode } from 'react' - -export type WarningCardProps = { - content: ReactNode - children?: ReactNode - className?: string - iconClassName?: string - textClassName?: string - size?: 'sm' | 'default' - contentContainerClassName?: string - onClick?: () => void -} - -export const WarningCard = ({ - content, - children, - className, - iconClassName, - textClassName, - size = 'default', - contentContainerClassName, - onClick, -}: WarningCardProps) => ( -
- - -
- {typeof content === 'string' ? ( -

- {content} -

- ) : ( - content - )} - - {children} -
-
-) diff --git a/packages/stateless/components/dao/tabs/AppsTab.tsx b/packages/stateless/components/dao/tabs/AppsTab.tsx index 2c6103846..33e1e4220 100644 --- a/packages/stateless/components/dao/tabs/AppsTab.tsx +++ b/packages/stateless/components/dao/tabs/AppsTab.tsx @@ -16,8 +16,8 @@ import { useQuerySyncedState } from '../../../hooks' import { Button } from '../../buttons' import { IconButton } from '../../icon_buttons' import { TextInput } from '../../inputs' +import { StatusCard } from '../../StatusCard' import { Tooltip } from '../../tooltip' -import { WarningCard } from '../../WarningCard' export type AppsTabProps = { iframeRef: RefCallback @@ -169,9 +169,10 @@ const InnerAppsTab = ({
{customSelected && ( - )} diff --git a/packages/stateless/components/dao/tabs/TreasuryTab.tsx b/packages/stateless/components/dao/tabs/TreasuryTab.tsx index 6ff8ea466..d7a555517 100644 --- a/packages/stateless/components/dao/tabs/TreasuryTab.tsx +++ b/packages/stateless/components/dao/tabs/TreasuryTab.tsx @@ -33,9 +33,9 @@ import { ErrorPage } from '../../error' import { LineLoaders } from '../../LineLoader' import { NftSection } from '../../nft/NftSection' import { ButtonPopup, FilterableItemPopup } from '../../popup' +import { StatusCard } from '../../StatusCard' import { TokenLineHeader } from '../../token' import { Tooltip, TooltipInfoIcon } from '../../tooltip' -import { WarningCard } from '../../WarningCard' export type TreasuryTabProps = { connected: boolean @@ -284,17 +284,18 @@ export const TreasuryTab = ({ {/* Show chain token load errors. */} {Object.entries(tokens).flatMap(([chainId, l]) => l && l.errored ? ( -
               {l.error instanceof Error ? l.error.message : l.error}
             
-
+ ) : ( [] ) diff --git a/packages/stateless/components/index.ts b/packages/stateless/components/index.ts index 4d93426ab..2a0ad2a68 100644 --- a/packages/stateless/components/index.ts +++ b/packages/stateless/components/index.ts @@ -37,7 +37,6 @@ export * from './GridCardContainer' export * from './HorizontalNftCard' export * from './HorizontalScroller' export * from './IbcDestinationChainPicker' -export * from './InfoCard' export * from './LineGraph' export * from './LineLoader' export * from './LinkWrapper' @@ -47,6 +46,7 @@ export * from './Notifications' export * from './OptionCard' export * from './Pagination' export * from './PayEntityDisplay' +export * from './StatusCard' export * from './StatusDisplay' export * from './SteppedWalkthrough' export * from './TabBar' @@ -54,4 +54,3 @@ export * from './Table' export * from './TokenSwapStatus' export * from './ValidatorPicker' export * from './VotingPowerDistribution' -export * from './WarningCard' diff --git a/packages/stateless/components/proposal/ProposalCrossChainRelayStatus.tsx b/packages/stateless/components/proposal/ProposalCrossChainRelayStatus.tsx index 42b2caf21..18a594ad3 100644 --- a/packages/stateless/components/proposal/ProposalCrossChainRelayStatus.tsx +++ b/packages/stateless/components/proposal/ProposalCrossChainRelayStatus.tsx @@ -1,15 +1,19 @@ +import { Check, Close } from '@mui/icons-material' import { useTranslation } from 'react-i18next' -import { ProposalRelayState } from '@dao-dao/types' +import { CrossChainPacketInfoStatus, ProposalRelayState } from '@dao-dao/types' +import { processError } from '@dao-dao/utils' -import { InfoCard } from '../InfoCard' +import { Loader } from '../logo' +import { StatusCard } from '../StatusCard' +import { Tooltip } from '../tooltip' export type ProposalCrossChainRelayStatusProps = { state: ProposalRelayState } export const ProposalCrossChainRelayStatus = ({ - state: { hasCrossChainMessages, needsSelfRelay, unrelayedMsgs, timedOutMsgs }, + state: { hasCrossChainMessages, needsSelfRelay, states }, }: ProposalCrossChainRelayStatusProps) => { const { t } = useTranslation() @@ -17,18 +21,64 @@ export const ProposalCrossChainRelayStatus = ({ return null } - return unrelayedMsgs.length > 0 ? ( + return states.pending.length > 0 ? ( !needsSelfRelay ? ( - ) : null - ) : timedOutMsgs.length > 0 ? ( - + ) : states.errored.length + states.timedOut.length > 0 ? ( + +
+ {states.all.map((state, index) => ( +
+
+

+ {t('title.actionNumber', { + number: index + 1, + })} +

+ + {state.status === CrossChainPacketInfoStatus.Pending ? ( + + + + ) : state.status === CrossChainPacketInfoStatus.Relayed ? ( + + + + ) : state.status === CrossChainPacketInfoStatus.Errored || + state.status === CrossChainPacketInfoStatus.TimedOut ? ( + + + + ) : null} +
+ + {state.status === CrossChainPacketInfoStatus.Errored ? ( +
+                {processError(state.error, { forceCapture: false })}
+              
+ ) : state.status === CrossChainPacketInfoStatus.TimedOut ? ( +

+ {t('title.timedOut')} +

+ ) : null} +
+ ))} +
+
) : ( - ) diff --git a/packages/stateless/components/proposal/ProposalStatusAndInfo.tsx b/packages/stateless/components/proposal/ProposalStatusAndInfo.tsx index 0327ecfb8..c44c27483 100644 --- a/packages/stateless/components/proposal/ProposalStatusAndInfo.tsx +++ b/packages/stateless/components/proposal/ProposalStatusAndInfo.tsx @@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next' import { ProposalVoterProps } from '@dao-dao/types' import { Button } from '../buttons' -import { InfoCard } from '../InfoCard' +import { StatusCard } from '../StatusCard' import { ProposalVoteButton } from './ProposalVoteButton' export type ProposalStatusAndInfoProps = { @@ -124,7 +124,9 @@ export const ProposalStatusAndInfo = ({ )} - {action.description && } + {action.description && ( + + )}
)} @@ -147,17 +149,23 @@ export const ProposalStatusAndInfo = ({
{!vetoOrEarlyExecute.isNeutronOverrule && vetoOrEarlyExecute.isVetoerDaoMember && ( - )} {vetoOrEarlyExecute.onEarlyExecute && ( - + )}
diff --git a/packages/stateless/components/proposal/ProposalVoter.tsx b/packages/stateless/components/proposal/ProposalVoter.tsx index 662d64bf6..74348b0a2 100644 --- a/packages/stateless/components/proposal/ProposalVoter.tsx +++ b/packages/stateless/components/proposal/ProposalVoter.tsx @@ -5,8 +5,7 @@ import { useTranslation } from 'react-i18next' import { ProposalVoterProps } from '@dao-dao/types' import { Button } from '../buttons' -import { InfoCard } from '../InfoCard' -import { WarningCard } from '../WarningCard' +import { StatusCard } from '../StatusCard' import { ProposalVoteButton } from './ProposalVoteButton' export const ProposalVoter = ({ @@ -50,15 +49,21 @@ export const ProposalVoter = ({
{/* If has not seen all action pages, and has not yet cast a vote, show warning. */} {showUnseenActionPagesWarning && !seenAllActionPages && !currentVote && ( - )} {/* If proposal no longer open but voting is allowed, explain why. */} {!proposalOpen && ( - + )}
diff --git a/packages/stateless/components/wallet/WalletProfileHeader.tsx b/packages/stateless/components/wallet/WalletProfileHeader.tsx index 6c8c65794..a262b5c01 100644 --- a/packages/stateless/components/wallet/WalletProfileHeader.tsx +++ b/packages/stateless/components/wallet/WalletProfileHeader.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next' import { WalletProfileHeaderProps } from '@dao-dao/types' import { ProfileImage, ProfileNameDisplayAndEditor } from '../profile' -import { WarningCard } from '../WarningCard' +import { StatusCard } from '../StatusCard' export const WalletProfileHeader = ({ editable, @@ -36,7 +36,7 @@ export const WalletProfileHeader = ({ !profile.loading && profile.data.nonce > -1 && mergeProfileType && ( - )} diff --git a/packages/types/components/SelfRelayExecuteModal.ts b/packages/types/components/SelfRelayExecuteModal.ts index 275049230..a48ea6773 100644 --- a/packages/types/components/SelfRelayExecuteModal.ts +++ b/packages/types/components/SelfRelayExecuteModal.ts @@ -1,5 +1,5 @@ import { CosmosMsgForEmpty } from '../contracts' -import { DecodedCrossChainMessage } from '../proposal' +import { CrossChainPacketInfo } from '../proposal' import { ModalProps } from './Modal' export type SelfRelayExecuteModalProps = Pick< @@ -14,8 +14,8 @@ export type SelfRelayExecuteModalProps = Pick< uniqueId: string // All chain IDs that will receive an IBC packet. chainIds: string[] - // Cross-chain messages that contain the packets that need self-relaying. - crossChainMessages: DecodedCrossChainMessage[] + // Cross-chain packets that contain the packets that need self-relaying. + crossChainPackets: CrossChainPacketInfo[] // Information on how to find the transaction to relay packets from. transaction: SelfRelayTransaction // Called when the self-relay execution is successful and all relayer wallets diff --git a/packages/types/proposal-module-adapter.ts b/packages/types/proposal-module-adapter.ts index 55497ed0a..28ab86818 100644 --- a/packages/types/proposal-module-adapter.ts +++ b/packages/types/proposal-module-adapter.ts @@ -277,11 +277,11 @@ export type CommonProposalInfo = { export type BaseProposalStatusAndInfoProps = { inline?: boolean - // Open self-relay modal to execute a proposal and relay polytone IBC packets. + // Open self-relay modal to execute a proposal and relay IBC packets. openSelfRelayExecute: ( props: Pick< SelfRelayExecuteModalProps, - 'uniqueId' | 'chainIds' | 'crossChainMessages' | 'transaction' + 'uniqueId' | 'chainIds' | 'crossChainPackets' | 'transaction' > ) => void onExecuteSuccess: () => void | Promise diff --git a/packages/types/proposal.ts b/packages/types/proposal.ts index 14c1ea202..f978fb179 100644 --- a/packages/types/proposal.ts +++ b/packages/types/proposal.ts @@ -5,6 +5,7 @@ import { ProposalCardProps } from './components/ProposalCard' import { CosmosMsgFor_Empty, ProposalStatus } from './contracts' import { ProposalStatusKey as PreProposeApprovalProposalStatus } from './contracts/DaoPreProposeApprovalSingle' import { ProposalResponse } from './contracts/DaoProposalSingle.v2' +import { Event } from './contracts/PolytoneListener' import { DurationWithUnits } from './units' export type ProposalCreatedCardProps = Omit< @@ -18,17 +19,15 @@ export type ProposalRelayState = { */ hasCrossChainMessages: boolean /** - * The state for the decoded messages msgs that relayed successfully. + * The relay states for the decoded message packets. */ - relayedMsgs: DecodedCrossChainMessage[] - /** - * The state for the decoded messages that are unrelayed. - */ - unrelayedMsgs: DecodedCrossChainMessage[] - /** - * The state for the decoded messages that timed out. - */ - timedOutMsgs: DecodedCrossChainMessage[] + states: { + all: CrossChainPacketInfoState[] + pending: (CrossChainPacketInfoStatePending & { index: number })[] + relayed: (CrossChainPacketInfoStateRelayed & { index: number })[] + errored: (CrossChainPacketInfoStateErrored & { index: number })[] + timedOut: (CrossChainPacketInfoStateTimedOut & { index: number })[] + } /** * Whether or not there are cross-chain messages that need to be self-relayed. * Most chains have relayers set up, so no need to self-relay on those chains. @@ -100,29 +99,81 @@ export type DecodedIcaMsgNoMatch = { export type DecodedIcaMsg = DecodedIcaMsgNoMatch | DecodedIcaMsgMatch -export type DecodedCrossChainMessage = - | { - type: 'polytone' - data: DecodedPolytoneMsgMatch - sender: string - srcConnection: string - srcChannel: string - srcPort: string - dstConnection: string - dstChannel: string - dstPort: string - } - | { - type: 'ica' - data: DecodedIcaMsgMatch - sender: string - srcConnection: string - // Cannot determine srcChannel from decoded message. - srcPort: string - dstConnection: string - // Cannot determine dstChannel from decoded message. - dstPort: string - } +export enum CrossChainPacketInfoType { + Polytone = 'polytone', + Ica = 'ica', +} + +export type PolytoneCrossChainPacketInfo = { + type: CrossChainPacketInfoType.Polytone + data: DecodedPolytoneMsgMatch + sender: string + srcConnection: string + srcChannel: string + srcPort: string + dstConnection: string + dstChannel: string + dstPort: string +} + +export type IcaCrossChainPacketInfo = { + type: CrossChainPacketInfoType.Ica + data: DecodedIcaMsgMatch + sender: string + srcConnection: string + // Cannot determine srcChannel from decoded message. + srcPort: string + dstConnection: string + // Cannot determine dstChannel from decoded message. + dstPort: string +} + +export type CrossChainPacketInfo = + | PolytoneCrossChainPacketInfo + | IcaCrossChainPacketInfo + +export enum CrossChainPacketInfoStatus { + Pending = 'pending', + Relayed = 'relayed', + Errored = 'errored', + TimedOut = 'timedOut', +} + +export type CrossChainPacketInfoStatePending = { + status: CrossChainPacketInfoStatus.Pending + packet: CrossChainPacketInfo +} + +export type CrossChainPacketInfoStateRelayed = { + status: CrossChainPacketInfoStatus.Relayed + packet: CrossChainPacketInfo + /** + * Execution events per message within the cross-chain packet. + */ + msgResponses: { + events: Event[] + }[] +} + +export type CrossChainPacketInfoStateErrored = { + status: CrossChainPacketInfoStatus.Errored + packet: CrossChainPacketInfo + /** + * The captured error string. + */ + error: string +} + +export type CrossChainPacketInfoStateTimedOut = { + status: CrossChainPacketInfoStatus.TimedOut + packet: CrossChainPacketInfo +} + +export type CrossChainPacketInfoState = + | CrossChainPacketInfoStatePending + | CrossChainPacketInfoStateRelayed + | CrossChainPacketInfoStateErrored + | CrossChainPacketInfoStateTimedOut export enum ProcessedTQType { Majority, diff --git a/packages/utils/error.ts b/packages/utils/error.ts index df212b6dc..3f07f7201 100644 --- a/packages/utils/error.ts +++ b/packages/utils/error.ts @@ -114,6 +114,10 @@ export enum CommonError { ReconnectWallet = 'Please disconnect and reconnect your wallet.', ProposalTooLarge = 'Proposal is too large. Please remove actions or shorten the description.', NoSuchContract = 'Contract not found.', + ContractInstantiationFailed = 'Contract instantiation failed.', + ContractExecutionFailed = 'Contract execution failed.', + ContractMigrationFailed = 'Contract migration failed.', + InsufficientGas = 'Insufficient gas.', } // List of error substrings to match to determine the common error. Elements in @@ -185,7 +189,27 @@ const commonErrorPatterns: Record = { ], [CommonError.ReconnectWallet]: [['Session', 'not established yet']], [CommonError.ProposalTooLarge]: [['proposal is', 'bytes, must be <=']], - [CommonError.NoSuchContract]: ['no such contract'], + [CommonError.NoSuchContract]: [ + 'no such contract', + // wasm code format from polytone listener callback error + 'codespace: wasm, code: 22', + ], + [CommonError.ContractInstantiationFailed]: [ + // wasm code format from polytone listener callback error + 'codespace: wasm, code: 4', + ], + [CommonError.ContractExecutionFailed]: [ + // wasm code format from polytone listener callback error + 'codespace: wasm, code: 5', + ], + [CommonError.ContractMigrationFailed]: [ + // wasm code format from polytone listener callback error + 'codespace: wasm, code: 11', + ], + [CommonError.InsufficientGas]: [ + // wasm code format from polytone listener callback error + 'codespace: wasm, code: 6', + ], } const commonErrorPatternsEntries = Object.entries(commonErrorPatterns) as [ CommonError, diff --git a/packages/utils/messages/cw.ts b/packages/utils/messages/cw.ts index 494cfef91..747c025c5 100644 --- a/packages/utils/messages/cw.ts +++ b/packages/utils/messages/cw.ts @@ -5,7 +5,8 @@ import cloneDeep from 'lodash.clonedeep' import { v4 as uuidv4 } from 'uuid' import { - DecodedCrossChainMessage, + CrossChainPacketInfo, + CrossChainPacketInfoType, DecodedIcaMsg, DecodedPolytoneMsg, cwMsgToProtobuf, @@ -501,13 +502,13 @@ export const decodeCrossChainMessages = ( srcChainId: string, srcAddress: string, msgs: CosmosMsgFor_Empty[] -): DecodedCrossChainMessage[] => +): CrossChainPacketInfo[] => decodeMessages(msgs).flatMap( - (msg): DecodedCrossChainMessage | DecodedCrossChainMessage[] => { + (msg): CrossChainPacketInfo | CrossChainPacketInfo[] => { const decodedPolytone = decodePolytoneExecuteMsg(srcChainId, msg, 'any') if (decodedPolytone.match) { return { - type: 'polytone', + type: CrossChainPacketInfoType.Polytone, data: decodedPolytone, sender: srcAddress, srcConnection: decodedPolytone.polytoneConnection.localConnection, @@ -527,7 +528,7 @@ export const decodeCrossChainMessages = ( ) return { - type: 'ica', + type: CrossChainPacketInfoType.Ica, data: decodedIca, sender: srcAddress, srcConnection: ibcInfo.sourceChain.connection_id, From 81f0ffcdb7509b446a19ede9b30cf9bd041c3aff Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 19 May 2024 20:12:36 -0400 Subject: [PATCH 170/438] fixed execute smart contract detection --- .../actions/core/smart_contracting/Execute/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/stateful/actions/core/smart_contracting/Execute/index.tsx b/packages/stateful/actions/core/smart_contracting/Execute/index.tsx index 4eb62301f..6772bea33 100644 --- a/packages/stateful/actions/core/smart_contracting/Execute/index.tsx +++ b/packages/stateful/actions/core/smart_contracting/Execute/index.tsx @@ -198,8 +198,11 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( // Can't match until we have the token info. if ( + !isExecute || (isCw20 && (cw20Token.loading || cw20Token.errored)) || - (!isCw20 && (fundsTokens.loading || fundsTokens.errored)) + (!isCw20 && + msg.wasm.execute.funds.length > 0 && + (fundsTokens.loading || fundsTokens.errored)) ) { return { match: false } } From a1428e22df2f9e2c5b715bd0eb7bfa4c5556e1f7 Mon Sep 17 00:00:00 2001 From: noah Date: Mon, 20 May 2024 11:42:55 -0400 Subject: [PATCH 171/438] Add BitSong testnet (#1776) --- packages/types/chain.ts | 1 + packages/utils/chain.ts | 59 ++++++++++++++++++++++++++++++ packages/utils/constants/chains.ts | 40 ++++++++++++++++++++ 3 files changed, 100 insertions(+) diff --git a/packages/types/chain.ts b/packages/types/chain.ts index c4882483f..bd41557f4 100644 --- a/packages/types/chain.ts +++ b/packages/types/chain.ts @@ -76,6 +76,7 @@ export enum ChainId { OraichainMainnet = 'Oraichain', ArchwayMainnet = 'archway-1', InjectiveMainnet = 'injective-1', + BitsongTestnet = 'bobnet', } export type BaseChainConfig = { diff --git a/packages/utils/chain.ts b/packages/utils/chain.ts index 773c2712e..f610f369c 100644 --- a/packages/utils/chain.ts +++ b/packages/utils/chain.ts @@ -34,6 +34,64 @@ import { } from './constants' import { getFallbackImage } from './getFallbackImage' +// BitSong Testnet +const bitSongTestnetChain: Chain = { + chain_name: 'bitsongtestnet', + status: 'live', + network_type: 'testnet', + pretty_name: 'BitSong Testnet', + chain_id: 'bobnet', + bech32_prefix: 'bitsong', + bech32_config: { + bech32PrefixAccAddr: 'bitsong', + bech32PrefixAccPub: 'bitsongpub', + bech32PrefixValAddr: 'bitsongvaloper', + bech32PrefixValPub: 'bitsongvaloperpub', + bech32PrefixConsAddr: 'bitsongvalcons', + bech32PrefixConsPub: 'bitsongvalconspub', + }, + slip44: 639, + logo_URIs: { + png: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/bitsong/images/btsg.png', + }, + fees: { + fee_tokens: [ + { + denom: 'ubtsg', + fixed_min_gas_price: 0, + low_gas_price: 0, + average_gas_price: 0, + high_gas_price: 0, + }, + ], + }, + staking: { + staking_tokens: [ + { + denom: 'ubtsg', + }, + ], + }, + apis: { + rpc: [ + { + address: 'https://rpc-testnet.explorebitsong.com', + }, + ], + rest: [ + { + address: 'https://lcd-testnet.explorebitsong.com', + }, + ], + }, +} +chains.push(bitSongTestnetChain) +assets.push({ + chain_name: bitSongTestnetChain.chain_name, + // Copy assets from BitSong mainnet. + assets: assets.find((a) => a.chain_name === 'bitsong')?.assets ?? [], +}) + export const getRpcForChainId = ( chainId: string, // Offset will try a different RPC from the list of available RPCs. @@ -179,6 +237,7 @@ export const maybeGetChainForChainName = ( chainName: string ): Chain | undefined => chains.find(({ chain_name }) => chain_name === chainName) + export const getChainForChainName = (chainName: string): Chain => { cachedChainsByName[chainName] ||= maybeGetChainForChainName(chainName) if (!cachedChainsByName[chainName]) { diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 1e18739e8..9b731d858 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -1694,6 +1694,42 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ DaoVotingTokenStaked: 4636, }, }, + { + chainId: ChainId.BitsongTestnet, + name: 'bitsong', + mainnet: false, + accentColor: '#c53381', + createWithCw20: true, + factoryContractAddress: + 'bitsong1ewd84afkxwxmqeu56p5mt3h446mgh3nh8yvmj2238akvu4ax7kss4a3u5c', + codeIds: { + // https://github.com/CosmWasm/cw-plus + Cw1Whitelist: 7, + Cw20Base: 24, + Cw20Stake: 25, // V240 + Cw4Group: 8, // v0.16 + // https://github.com/CosmWasm/cw-nfts + Cw721Base: 9, + + // ContractVersion.V242 + CwPayrollFactory: 11, + CwTokenSwap: 12, + CwTokenfactoryIssuerMain: -1, + CwVesting: 13, + DaoCore: 14, + DaoMigrator: -1, // not needed since only v2 DAOs exist + DaoPreProposeApprovalSingle: 16, + DaoPreProposeApprover: 17, + DaoPreProposeMultiple: 18, + DaoPreProposeSingle: 19, + DaoProposalMultiple: 20, + DaoProposalSingle: 21, + DaoVotingCw4: 22, + DaoVotingCw721Staked: 23, + DaoVotingTokenStaked: -1, + DaoVotingCw20Staked: 26, // V240 + }, + }, ] export const POLYTONE_CONFIG_PER_CHAIN: [ChainId, PolytoneConfig][] = @@ -1783,6 +1819,10 @@ export const CHAIN_ENDPOINTS: Partial< rpc: 'https://archway-rpc.polkachu.com', rest: 'https://archway-api.polkachu.com', }, + [ChainId.BitsongTestnet]: { + rpc: 'https://rpc-testnet.explorebitsong.com', + rest: 'https://lcd-testnet.explorebitsong.com', + }, } // All configured chains. Configured chains are either supported chains, which From dca38c35d1d8d5bef4a8d8bb8b29bb8b6120f6a0 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 20 May 2024 12:38:51 -0400 Subject: [PATCH 172/438] use token factory tokens for bitsong instead of cw20 --- .../stateful/components/dao/CreateDaoForm.tsx | 4 ++-- .../GovernanceConfigurationInput.tsx | 8 +++++-- .../MembershipBased/TierCard.stories.tsx | 9 ++++++-- .../creators/MembershipBased/index.ts | 4 ++-- packages/stateful/creators/NftBased/index.ts | 4 ++-- .../GovernanceConfigurationInput.tsx | 21 ++++++++++++------- .../creators/TokenBased/TierCard.stories.tsx | 6 ++++-- .../stateful/creators/TokenBased/index.ts | 8 ++++--- packages/stateful/recoil/atoms/newDao.ts | 7 ++++++- .../pages/CreateDaoGovernance.stories.tsx | 7 +++++-- .../create/pages/CreateDaoReview.stories.tsx | 15 ++++++++++--- .../create/pages/CreateDaoStart.stories.tsx | 15 ++++++++++--- .../dao/create/pages/CreateDaoStart.tsx | 6 ++++-- .../create/pages/CreateDaoVoting.stories.tsx | 15 ++++++++++--- packages/types/chain.ts | 4 ++++ packages/types/creators.ts | 4 ++-- packages/utils/constants/chains.ts | 10 ++++----- 17 files changed, 102 insertions(+), 45 deletions(-) diff --git a/packages/stateful/components/dao/CreateDaoForm.tsx b/packages/stateful/components/dao/CreateDaoForm.tsx index b45b03910..b05a9be80 100644 --- a/packages/stateful/components/dao/CreateDaoForm.tsx +++ b/packages/stateful/components/dao/CreateDaoForm.tsx @@ -204,7 +204,7 @@ export const InnerCreateDaoForm = ({ cached.creator.data = merge( {}, // Start with defaults. - creator?.defaultConfig, + creator?.makeDefaultConfig(chainContext.config), // Overwrite with existing values. cached.creator.data ) @@ -238,7 +238,7 @@ export const InnerCreateDaoForm = ({ // Use overrides passed into component. override ) - }, [_newDaoAtom, chainId, override]) + }, [_newDaoAtom, chainContext.config, chainId, override]) const form = useForm({ defaultValues: defaultForm, diff --git a/packages/stateful/creators/MembershipBased/GovernanceConfigurationInput.tsx b/packages/stateful/creators/MembershipBased/GovernanceConfigurationInput.tsx index d998c11b2..cf6295d9e 100644 --- a/packages/stateful/creators/MembershipBased/GovernanceConfigurationInput.tsx +++ b/packages/stateful/creators/MembershipBased/GovernanceConfigurationInput.tsx @@ -9,6 +9,7 @@ import { InputErrorMessage, VotingPowerDistribution, VotingPowerDistributionEntry, + useSupportedChainContext, } from '@dao-dao/stateless' import { CreateDaoCustomValidator, @@ -39,6 +40,7 @@ export const GovernanceConfigurationInput = ({ }: DaoCreationGovernanceConfigInputProps) => { const { t } = useTranslation() const { address: walletAddress, isWalletConnected } = useWallet() + const { config: chainConfig } = useSupportedChainContext() const { fields: tierFields, @@ -51,13 +53,15 @@ export const GovernanceConfigurationInput = ({ const addTierRef = useRef(null) const addTier = useCallback(() => { - appendTier(cloneDeep(MembershipBasedCreator.defaultConfig.tiers[0])) + appendTier( + cloneDeep(MembershipBasedCreator.makeDefaultConfig(chainConfig).tiers[0]) + ) // Scroll button to bottom of screen. addTierRef.current?.scrollIntoView({ behavior: 'smooth', block: 'end', }) - }, [appendTier]) + }, [appendTier, chainConfig]) // Fill in default first tier info if tiers not yet edited. const [loadedPage, setLoadedPage] = useState(false) diff --git a/packages/stateful/creators/MembershipBased/TierCard.stories.tsx b/packages/stateful/creators/MembershipBased/TierCard.stories.tsx index 6013a8e43..b03f616a5 100644 --- a/packages/stateful/creators/MembershipBased/TierCard.stories.tsx +++ b/packages/stateful/creators/MembershipBased/TierCard.stories.tsx @@ -3,7 +3,10 @@ import { useForm } from 'react-hook-form' import { CHAIN_ID } from '@dao-dao/storybook' import { NewDao } from '@dao-dao/types' -import { MembershipBasedCreatorId } from '@dao-dao/utils' +import { + MembershipBasedCreatorId, + getSupportedChainConfig, +} from '@dao-dao/utils' import { MembershipBasedCreator } from '.' import { makeDefaultNewDao } from '../../recoil/atoms' @@ -28,7 +31,9 @@ const Template: ComponentStory = (args) => { ...makeDefaultNewDao(CHAIN_ID), creator: { id: MembershipBasedCreatorId, - data: MembershipBasedCreator.defaultConfig, + data: MembershipBasedCreator.makeDefaultConfig( + getSupportedChainConfig(CHAIN_ID)! + ), }, }, }) diff --git a/packages/stateful/creators/MembershipBased/index.ts b/packages/stateful/creators/MembershipBased/index.ts index 5e07a45c0..d14f93676 100644 --- a/packages/stateful/creators/MembershipBased/index.ts +++ b/packages/stateful/creators/MembershipBased/index.ts @@ -15,7 +15,7 @@ export const MembershipBasedCreator: DaoCreator = { suppliesI18nKey: 'daoCreator.MembershipBased.supplies', membershipI18nKey: 'daoCreator.MembershipBased.membership', }, - defaultConfig: { + makeDefaultConfig: () => ({ tiers: [ { name: '', @@ -27,7 +27,7 @@ export const MembershipBasedCreator: DaoCreator = { ], }, ], - }, + }), governanceConfig: { Input: GovernanceConfigurationInput, Review: GovernanceConfigurationReview, diff --git a/packages/stateful/creators/NftBased/index.ts b/packages/stateful/creators/NftBased/index.ts index ce54398b2..34493a6c1 100644 --- a/packages/stateful/creators/NftBased/index.ts +++ b/packages/stateful/creators/NftBased/index.ts @@ -18,14 +18,14 @@ export const NftBasedCreator: DaoCreator = { suppliesI18nKey: 'daoCreator.NftBased.supplies', membershipI18nKey: 'daoCreator.NftBased.membership', }, - defaultConfig: { + makeDefaultConfig: () => ({ tokenType: GovernanceTokenType.Existing, existingGovernanceTokenDenomOrAddress: '', unstakingDuration: { value: 2, units: DurationUnits.Weeks, }, - }, + }), governanceConfig: { Input: GovernanceConfigurationInput, Review: GovernanceConfigurationReview, diff --git a/packages/stateful/creators/TokenBased/GovernanceConfigurationInput.tsx b/packages/stateful/creators/TokenBased/GovernanceConfigurationInput.tsx index fab7d8015..de0266d07 100644 --- a/packages/stateful/creators/TokenBased/GovernanceConfigurationInput.tsx +++ b/packages/stateful/creators/TokenBased/GovernanceConfigurationInput.tsx @@ -74,9 +74,9 @@ export const GovernanceConfigurationInput = ({ const { chain: { chain_id: chainId, bech32_prefix: bech32Prefix }, - config: { createWithCw20 }, + config, } = useSupportedChainContext() - const isCw20 = !!createWithCw20 + const isCw20 = !!config.createWithCw20 const { fields: tierFields, @@ -89,13 +89,13 @@ export const GovernanceConfigurationInput = ({ const addTierRef = useRef(null) const addTier = useCallback(() => { - appendTier(cloneDeep(TokenBasedCreator.defaultConfig.tiers[0])) + appendTier(cloneDeep(TokenBasedCreator.makeDefaultConfig(config).tiers[0])) // Scroll button to bottom of screen. addTierRef.current?.scrollIntoView({ behavior: 'smooth', block: 'end', }) - }, [appendTier]) + }, [appendTier, config]) // Load token factory denom creation fee. const tokenFactoryDenomCreationFeeLoading = useCachedLoading( @@ -323,13 +323,18 @@ export const GovernanceConfigurationInput = ({ <> setValue('creator.data.tokenType', tokenType)} selected={data.tokenType} tabs={[ - { - label: t('button.createAToken'), - value: GovernanceTokenType.New, - }, + ...(config.noCreateNewTokens + ? [] + : [ + { + label: t('button.createAToken'), + value: GovernanceTokenType.New, + }, + ]), { label: t('button.useExistingToken'), value: GovernanceTokenType.Existing, diff --git a/packages/stateful/creators/TokenBased/TierCard.stories.tsx b/packages/stateful/creators/TokenBased/TierCard.stories.tsx index 3ab0e4a87..f82b0f8d6 100644 --- a/packages/stateful/creators/TokenBased/TierCard.stories.tsx +++ b/packages/stateful/creators/TokenBased/TierCard.stories.tsx @@ -3,7 +3,7 @@ import { useForm } from 'react-hook-form' import { CHAIN_ID } from '@dao-dao/storybook' import { NewDao } from '@dao-dao/types' -import { TokenBasedCreatorId } from '@dao-dao/utils' +import { TokenBasedCreatorId, getSupportedChainConfig } from '@dao-dao/utils' import { TokenBasedCreator } from '.' import { makeDefaultNewDao } from '../../recoil/atoms' @@ -27,7 +27,9 @@ const Template: ComponentStory = (args) => { ...makeDefaultNewDao(CHAIN_ID), creator: { id: TokenBasedCreatorId, - data: TokenBasedCreator.defaultConfig, + data: TokenBasedCreator.makeDefaultConfig( + getSupportedChainConfig(CHAIN_ID)! + ), }, }, }) diff --git a/packages/stateful/creators/TokenBased/index.ts b/packages/stateful/creators/TokenBased/index.ts index 16ce1feeb..fad8ab69e 100644 --- a/packages/stateful/creators/TokenBased/index.ts +++ b/packages/stateful/creators/TokenBased/index.ts @@ -18,7 +18,7 @@ export const TokenBasedCreator: DaoCreator = { suppliesI18nKey: 'daoCreator.TokenBased.supplies', membershipI18nKey: 'daoCreator.TokenBased.membership', }, - defaultConfig: { + makeDefaultConfig: ({ noCreateNewTokens = false }) => ({ tiers: [ { name: '', @@ -30,7 +30,9 @@ export const TokenBasedCreator: DaoCreator = { ], }, ], - tokenType: GovernanceTokenType.New, + tokenType: noCreateNewTokens + ? GovernanceTokenType.Existing + : GovernanceTokenType.New, newInfo: { initialSupply: 10000000, initialTreasuryPercent: 90, @@ -47,7 +49,7 @@ export const TokenBasedCreator: DaoCreator = { type: 'percent', value: 10, }, - }, + }), governanceConfig: { Input: GovernanceConfigurationInput, Review: GovernanceConfigurationReview, diff --git a/packages/stateful/recoil/atoms/newDao.ts b/packages/stateful/recoil/atoms/newDao.ts index bbd382f10..7e508e4a2 100644 --- a/packages/stateful/recoil/atoms/newDao.ts +++ b/packages/stateful/recoil/atoms/newDao.ts @@ -14,6 +14,7 @@ import { MembershipBasedCreatorId, convertCosmosVetoConfigToVeto, getNativeTokenForChainId, + getSupportedChainConfig, } from '@dao-dao/utils' import { MembershipBasedCreator } from '../../creators/MembershipBased' @@ -31,7 +32,11 @@ export const makeDefaultNewDao = (chainId: string): NewDao => ({ imageUrl: undefined, creator: { id: MembershipBasedCreatorId, - data: cloneDeep(MembershipBasedCreator.defaultConfig), + data: cloneDeep( + MembershipBasedCreator.makeDefaultConfig( + getSupportedChainConfig(chainId)! + ) + ), }, // Default to single and multiple choice proposal configuration. proposalModuleAdapters: [ diff --git a/packages/stateless/components/dao/create/pages/CreateDaoGovernance.stories.tsx b/packages/stateless/components/dao/create/pages/CreateDaoGovernance.stories.tsx index 361414cbc..6835b0972 100644 --- a/packages/stateless/components/dao/create/pages/CreateDaoGovernance.stories.tsx +++ b/packages/stateless/components/dao/create/pages/CreateDaoGovernance.stories.tsx @@ -1,12 +1,13 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' import { TokenBasedCreator } from '@dao-dao/stateful/creators/TokenBased' +import { CHAIN_ID } from '@dao-dao/storybook' import { WalletProviderDecorator, makeCreateDaoFormDecorator, makeDappLayoutDecorator, } from '@dao-dao/storybook/decorators' -import { TokenBasedCreatorId } from '@dao-dao/utils' +import { TokenBasedCreatorId, getSupportedChainConfig } from '@dao-dao/utils' import { CreateDaoGovernance } from './CreateDaoGovernance' @@ -23,7 +24,9 @@ export default { 'https://ipfs.stargaze.zone/ipfs/QmbGvE3wmxex8KiBbbvMjR8f9adR28s3XkiZSTuGmHoMHV/33.jpg', creator: { id: TokenBasedCreatorId, - data: TokenBasedCreator.defaultConfig, + data: TokenBasedCreator.makeDefaultConfig( + getSupportedChainConfig(CHAIN_ID)! + ), }, }), makeDappLayoutDecorator(), diff --git a/packages/stateless/components/dao/create/pages/CreateDaoReview.stories.tsx b/packages/stateless/components/dao/create/pages/CreateDaoReview.stories.tsx index 47cb77b85..be18e6bb0 100644 --- a/packages/stateless/components/dao/create/pages/CreateDaoReview.stories.tsx +++ b/packages/stateless/components/dao/create/pages/CreateDaoReview.stories.tsx @@ -2,10 +2,15 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' import { TokenBasedCreator } from '@dao-dao/stateful/creators/TokenBased' import { DaoProposalSingleAdapter } from '@dao-dao/stateful/proposal-module-adapter/adapters/DaoProposalSingle' +import { CHAIN_ID } from '@dao-dao/storybook' import { WalletProviderDecorator } from '@dao-dao/storybook/decorators' import { makeCreateDaoFormDecorator } from '@dao-dao/storybook/decorators/makeCreateDaoFormDecorator' import { makeDappLayoutDecorator } from '@dao-dao/storybook/decorators/makeDappLayoutDecorator' -import { DaoProposalSingleAdapterId, TokenBasedCreatorId } from '@dao-dao/utils' +import { + DaoProposalSingleAdapterId, + TokenBasedCreatorId, + getSupportedChainConfig, +} from '@dao-dao/utils' import { CreateDaoReview } from './CreateDaoReview' @@ -23,9 +28,13 @@ export default { creator: { id: TokenBasedCreatorId, data: { - ...TokenBasedCreator.defaultConfig, + ...TokenBasedCreator.makeDefaultConfig( + getSupportedChainConfig(CHAIN_ID)! + ), newInfo: { - ...TokenBasedCreator.defaultConfig.newInfo, + ...TokenBasedCreator.makeDefaultConfig( + getSupportedChainConfig(CHAIN_ID)! + ).newInfo, symbol: 'TST', name: 'Test Token', }, diff --git a/packages/stateless/components/dao/create/pages/CreateDaoStart.stories.tsx b/packages/stateless/components/dao/create/pages/CreateDaoStart.stories.tsx index 299bae0a2..bf91b1264 100644 --- a/packages/stateless/components/dao/create/pages/CreateDaoStart.stories.tsx +++ b/packages/stateless/components/dao/create/pages/CreateDaoStart.stories.tsx @@ -2,12 +2,17 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' import { TokenBasedCreator } from '@dao-dao/stateful/creators/TokenBased' import { DaoProposalSingleAdapter } from '@dao-dao/stateful/proposal-module-adapter' +import { CHAIN_ID } from '@dao-dao/storybook' import { WalletProviderDecorator, makeCreateDaoFormDecorator, makeDappLayoutDecorator, } from '@dao-dao/storybook/decorators' -import { DaoProposalSingleAdapterId, TokenBasedCreatorId } from '@dao-dao/utils' +import { + DaoProposalSingleAdapterId, + TokenBasedCreatorId, + getSupportedChainConfig, +} from '@dao-dao/utils' import { CreateDaoStart } from './CreateDaoStart' @@ -21,9 +26,13 @@ export default { creator: { id: TokenBasedCreatorId, data: { - ...TokenBasedCreator.defaultConfig, + ...TokenBasedCreator.makeDefaultConfig( + getSupportedChainConfig(CHAIN_ID)! + ), newInfo: { - ...TokenBasedCreator.defaultConfig.newInfo, + ...TokenBasedCreator.makeDefaultConfig( + getSupportedChainConfig(CHAIN_ID)! + ).newInfo, symbol: 'TST', name: 'Test Token', }, diff --git a/packages/stateless/components/dao/create/pages/CreateDaoStart.tsx b/packages/stateless/components/dao/create/pages/CreateDaoStart.tsx index 6b59b7d59..49b223a0f 100644 --- a/packages/stateless/components/dao/create/pages/CreateDaoStart.tsx +++ b/packages/stateless/components/dao/create/pages/CreateDaoStart.tsx @@ -14,6 +14,7 @@ import { validateRequired, } from '@dao-dao/utils' +import { useSupportedChainContext } from '../../../../hooks' import { Button } from '../../../buttons' import { InputErrorMessage, TextAreaInput, TextInput } from '../../../inputs' import { DaoCreatorCard } from '../DaoCreatorCard' @@ -32,6 +33,7 @@ export const CreateDaoStart = ({ }: CreateDaoContext) => { const { t } = useTranslation() const daoChainId = watch('chainId') + const { config: chainConfig } = useSupportedChainContext() const data = watch() @@ -125,7 +127,7 @@ export const CreateDaoStart = ({ suppliesI18nKey, membershipI18nKey, }, - defaultConfig, + makeDefaultConfig, }) => ( = ( export type DaoCreator = { id: string - defaultConfig: Data + makeDefaultConfig: (chainConfig: SupportedChainConfig) => Data displayInfo: { Icon: ComponentType diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 9b731d858..a765db1bf 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -1699,14 +1699,13 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ name: 'bitsong', mainnet: false, accentColor: '#c53381', - createWithCw20: true, + // No token factory on BitSong. + noCreateNewTokens: true, factoryContractAddress: 'bitsong1ewd84afkxwxmqeu56p5mt3h446mgh3nh8yvmj2238akvu4ax7kss4a3u5c', codeIds: { // https://github.com/CosmWasm/cw-plus Cw1Whitelist: 7, - Cw20Base: 24, - Cw20Stake: 25, // V240 Cw4Group: 8, // v0.16 // https://github.com/CosmWasm/cw-nfts Cw721Base: 9, @@ -1714,7 +1713,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V242 CwPayrollFactory: 11, CwTokenSwap: 12, - CwTokenfactoryIssuerMain: -1, + CwTokenfactoryIssuerMain: 27, CwVesting: 13, DaoCore: 14, DaoMigrator: -1, // not needed since only v2 DAOs exist @@ -1726,8 +1725,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ DaoProposalSingle: 21, DaoVotingCw4: 22, DaoVotingCw721Staked: 23, - DaoVotingTokenStaked: -1, - DaoVotingCw20Staked: 26, // V240 + DaoVotingTokenStaked: 28, }, }, ] From fbb445fb33db5fedcba346e86bc2e5ad42f4a629 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 21 May 2024 15:57:02 -0400 Subject: [PATCH 173/438] normalize retroactive compensation survey rankings, allow weighting by rater voting power, and allow completing survey with existing or no proposal --- packages/i18n/locales/en/translation.json | 14 +- packages/stateful/components/ProposalLine.tsx | 9 +- packages/stateful/components/ProposalList.tsx | 28 +- .../components/stateful/OpenSurveySection.tsx | 195 +++++-- .../stateful/ProposalCreationForm.tsx | 55 +- .../stateless/CompletedSurveyRow.tsx | 96 ++-- .../ProposalCreationForm.stories.tsx | 2 + .../stateless/ProposalCreationForm.tsx | 523 +++++++++++------- .../components/stateless/RatingForm.tsx | 4 +- .../components/stateless/TabRenderer.tsx | 5 + .../Renderer/selectors.ts | 4 +- .../RetroactiveCompensation/Renderer/types.ts | 11 + .../Renderer/utils.test.ts | 88 +++ .../RetroactiveCompensation/Renderer/utils.ts | 36 +- .../components/dao/tabs/ProposalsTab.tsx | 8 +- .../components/proposal/ProposalLine.tsx | 3 + packages/types/components/ProposalLine.ts | 1 + packages/types/components/ProposalList.tsx | 11 + packages/types/components/index.ts | 1 + packages/types/proposal-module-adapter.ts | 1 + 20 files changed, 739 insertions(+), 356 deletions(-) create mode 100644 packages/types/components/ProposalList.tsx diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index d9bf9514a..965a4db03 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -93,6 +93,7 @@ "clickToUnfollow": "Click to unfollow", "clickToView": "Click to view", "close": "Close", + "complete": "Complete", "connect": "Connect", "connectToChain": "Connect to {{chainName}}", "continue": "Continue", @@ -123,6 +124,7 @@ "disable": "Disable", "done": "Done", "downloadMembersCsv": "Download member data (.csv)", + "downloadSurveyCsv": "Download survey data (.csv)", "downloadVotesCsv": "Download voting data (.csv)", "duplicate": "Duplicate", "earlyExecute": "Early execute", @@ -775,6 +777,8 @@ "votingWeightPerMember": "Voting weight per member", "votingWeightPerMemberTooltip": "Each member of this tier will receive {{weight}} voting power. Want to add members with different voting power? Add another tier.", "votingWeightPlaceholder": "Voting weight", + "weightByVotingPower": "Weight by voting power", + "weightByVotingPowerTooltip": "When computing a contributor's final rating used to calculate their compensation, this will weight each DAO member's ratings by their own voting power to produce a weighted average.", "whatDoWeDistributeQuestion": "What do we distribute?", "whatReceiveCounterpartyQuestion": "What do you need to <2>receive from the counterparty for the token swap to complete?", "whatSendCounterpartyQuestion": "What do you need to <2>send to the counterparty for the token swap to complete?", @@ -913,7 +917,7 @@ "closedAtDate": "Closed at {{date}}", "closesAtDate": "Closes at {{date}}", "communityPoolDepositDescription": "Deposit funds into the community pool.", - "compensationCycleClosedAwaitingCompletion": "Contributions and ratings have been submitted. Review the results and create a proposal to complete the cycle.", + "compensationCycleClosedAwaitingCompletion": "Contributions and ratings have been submitted. Review the results and create a proposal to complete the cycle. Alternatively, you may link it to an existing proposal or complete it without creating a proposal.", "completeRelayOrLoseFunds": "Make sure you have completed the relaying process, or you may lose the tokens you sent to the relayers to pay fees.", "completed": "Completed", "configureVestingPaymentsDescription": "Configure vesting payments and enable them on more chains.", @@ -1243,6 +1247,7 @@ "searchPlaceholder": "Search...", "searchProposalsPlaceholder": "Search proposals...", "searchValidatorsPlaceholder": "Find a validator...", + "selectExistingProposalBelow": "Select an existing proposal below.", "selectPressChain": "Each post will be minted as an NFT on this chain and then deposited into the DAO's treasury.", "selfRelayDescription": "One or more messages in this proposal require self-relaying across chains since automatic relayers do not exist or are inactive right now.", "setUpApproverDescription": "Set up this DAO as an approver that is responsible for approving another DAO's proposals before they open for voting.", @@ -1446,7 +1451,8 @@ "addedToProfile": "Added to profile successfully.", "addedToken": "Added token to Keplr.", "claimedRewards": "Claimed rewards.", - "compensationCycleCompleted": "Compensation cycle completed. Redirecting to proposal...", + "compensationCycleCompleted_noProposal": "Compensation cycle completed.", + "compensationCycleCompleted_withProposal": "Compensation cycle completed. Redirecting to proposal...", "compensationCycleCreated": "Compensation cycle created.", "contributionSubmitted": "Contribution submitted.", "created": "Created successfully.", @@ -1461,7 +1467,7 @@ "nominationSubmitted": "Contributor nominated for this compensation cycle.", "proposalApproved": "Proposal approved and is now open for voting.", "proposalClosed": "Proposal closed.", - "proposalCreatedCompleteCompensationCycle": "Proposal published. Complete the compensation cycle by saving the proposal ID.", + "proposalCreatedCompleteCompensationCycle": "Proposal published. Complete the compensation cycle by saving the proposal ID in the next prompt.", "proposalExecuted": "Executed. Updating data and refreshing page...", "proposalOpenForVoting": "Proposal is open for voting.", "proposalOverruled": "Proposal overruled.", @@ -1606,6 +1612,7 @@ "estUsdValue": "Est. USD value", "established": "Established", "executeSmartContract": "Execute Smart Contract", + "existingProposal": "Existing proposal", "existingToken": "Existing token", "expires": "Expires", "extension": "Extension", @@ -1686,6 +1693,7 @@ "nftCollection": "NFT Collection", "nfts": "NFTs", "noHistory": "No history", + "noProposal": "No proposal", "noWinner": "No winner", "nominateContributor": "Nominate Contributor", "noneOfTheAbove": "None of the above", diff --git a/packages/stateful/components/ProposalLine.tsx b/packages/stateful/components/ProposalLine.tsx index 97c17cee9..5b88d4f17 100644 --- a/packages/stateful/components/ProposalLine.tsx +++ b/packages/stateful/components/ProposalLine.tsx @@ -30,11 +30,12 @@ export const ProposalLine = ({ type InnerProposalLineProps = Pick< StatefulProposalLineProps, - 'proposalViewUrl' | 'isPreProposeProposal' + 'proposalViewUrl' | 'isPreProposeProposal' | 'onClick' > const InnerProposalLine = ({ proposalViewUrl, + onClick, isPreProposeProposal, }: InnerProposalLineProps) => { const { t } = useTranslation() @@ -56,7 +57,11 @@ const InnerProposalLine = ({ return ( }> - + ) } diff --git a/packages/stateful/components/ProposalList.tsx b/packages/stateful/components/ProposalList.tsx index 9eff96f39..4b7393429 100644 --- a/packages/stateful/components/ProposalList.tsx +++ b/packages/stateful/components/ProposalList.tsx @@ -10,10 +10,12 @@ import { useChain, useDaoInfoContext, useDaoNavHelpers, + useUpdatingRef, } from '@dao-dao/stateless' import { CommonProposalListInfo, StatefulProposalLineProps, + StatefulProposalListProps, } from '@dao-dao/types' import { webSocketChannelNameForDao } from '@dao-dao/utils' @@ -47,7 +49,10 @@ type CommonProposalListInfoWithType = CommonProposalListInfo & { type: ProposalType } -export const ProposalList = () => { +export const ProposalList = ({ + onClick, + hideVetoable = false, +}: StatefulProposalListProps) => { const { t } = useTranslation() const chain = useChain() const { coreAddress, proposalModules } = useDaoInfoContext() @@ -95,13 +100,17 @@ export const ProposalList = () => { }) ) const daosWithVetoableProposals = useCachedLoadingWithError( - daosWithDropdownVetoableProposalListSelector({ - chainId: chain.chain_id, - coreAddress, - daoPageMode: mode, - }) + hideVetoable + ? undefined + : daosWithDropdownVetoableProposalListSelector({ + chainId: chain.chain_id, + coreAddress, + daoPageMode: mode, + }) ) + const onClickRef = useUpdatingRef(onClick) + const [loading, setLoading] = useState(true) const [canLoadMore, setCanLoadMore] = useState(true) const loadMore = useRecoilCallback( @@ -262,7 +271,12 @@ export const ProposalList = () => { coreAddress, proposalModules, proposalId: id, - proposalViewUrl: getDaoProposalPath(coreAddress, id), + proposalViewUrl: onClickRef.current + ? '#' + : getDaoProposalPath(coreAddress, id), + onClick: onClickRef.current + ? () => onClickRef.current?.({ proposalId: id }) + : undefined, isPreProposeProposal: type === ProposalType.PreProposePending || type === ProposalType.PreProposeCompleted, diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/OpenSurveySection.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/OpenSurveySection.tsx index e454d04ca..c86109732 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/OpenSurveySection.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/OpenSurveySection.tsx @@ -1,4 +1,4 @@ -import { useCallback, useState } from 'react' +import { useCallback, useEffect, useState } from 'react' import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' @@ -24,6 +24,7 @@ import { ContributionWithCompensation, Rating, RatingsResponse, + RatingsResponseWithIdentities, StatefulOpenSurveySectionProps, SurveyStatus, } from '../../types' @@ -72,6 +73,7 @@ export const OpenSurveySection = ({ const [loading, setLoading] = useState(false) const [ratingFormData, setRatingFormData] = useState() + const [weightByVotingPower, setWeightByVotingPower] = useState(true) const [proposalCreationFormData, setProposalCreationFormData] = useState() @@ -122,70 +124,65 @@ export const OpenSurveySection = ({ } }, [bech32Prefix, coreAddress, postRequest]) - const loadProposalCreationFormData = useCallback(async () => { - setLoading(true) + const [ratingsResponse, setRatingsResponse] = + useState() - try { - // Fetch ratings. - const response: RatingsResponse = await postRequest( - `/${coreAddress}/ratings` - ) + const updateProposalCreationFormData = useCallback( + (response: RatingsResponseWithIdentities | undefined = ratingsResponse) => { + if (!response) { + return + } + + const { contributions: _contributions, ratings } = response + + // Get max voting power so we can normalize weights. + const maxVotingPower = ratings.length + ? Math.max(...ratings.map((r) => Number(r.raterVotingPower))) + : 0 // Compute compensation. const compensationPerContribution = computeCompensation( - response.contributions.map(({ id }) => id), - response.ratings.flatMap((rating) => - rating.contributions.map(({ id, attributes }) => ({ + _contributions.map(({ id }) => id), + ratings.flatMap((rating) => { + // Normalize a rater's ratings to be between 0 and 100, where 100 is + // the highest score they gave. If they ranked everyone 20, then + // they will all be normalized to 100. + const maxPerAttribute = status.survey.attributes.map((_, index) => + Math.max( + 0, + ...rating.contributions.map( + ({ attributes }) => attributes[index] || 0 + ) + ) + ) + + return rating.contributions.map(({ id, attributes }) => ({ contributionId: id, - attributes, + // Normalize weights to prevent them from getting too large and + // causing an overflow when summed together. + weight: weightByVotingPower + ? maxVotingPower === 0 + ? 0 + : Number(rating.raterVotingPower) / maxVotingPower + : // Set weight to 1 if not weighting by voting power. + 1, + attributes: attributes.map((attribute, i) => + attribute === null + ? null + : maxPerAttribute[i] === 0 + ? 0 + : (attribute / maxPerAttribute[i]) * 100 + ), })) - ), + }), status.survey.attributes ) - // Get addresses for contributor public keys, and compute compensation. - const contributions = await Promise.all( - response.contributions.map( - async ( - { contributor: publicKey, ...contribution }, - contributionIndex - ): Promise => { - const address = await secp256k1PublicKeyToBech32Address( - publicKey, - bech32Prefix - ) - - const compensation = compensationPerContribution[contributionIndex] - - return { - ...contribution, - contributor: { - publicKey, - address, - }, - compensation, - } - } - ) - ) - - const ratings = await Promise.all( - response.ratings.map( - async ({ rater: publicKey, ...rating }): Promise => { - const address = await secp256k1PublicKeyToBech32Address( - publicKey, - bech32Prefix - ) - - return { - ...rating, - rater: { - publicKey, - address, - }, - } - } - ) + const contributions = _contributions.map( + (c, index): ContributionWithCompensation => ({ + ...c, + compensation: compensationPerContribution[index], + }) ) const cosmosMsgs: CosmosMsgFor_Empty[] = contributions.flatMap( @@ -233,13 +230,89 @@ export const OpenSurveySection = ({ } setProposalCreationFormData(completeRatings) + }, + [ratingsResponse, status.survey.attributes, weightByVotingPower] + ) + + const loadRatingsAndProposalCreationFormData = useCallback(async () => { + setLoading(true) + + try { + // Fetch ratings. + const response: RatingsResponse = await postRequest( + `/${coreAddress}/ratings` + ) + + // Get addresses for contributor and rater public keys. + const [contributions, ratings] = await Promise.all([ + Promise.all( + response.contributions.map( + async ({ + contributor: publicKey, + ...contribution + }): Promise => { + const address = await secp256k1PublicKeyToBech32Address( + publicKey, + bech32Prefix + ) + + return { + ...contribution, + contributor: { + publicKey, + address, + }, + } + } + ) + ), + Promise.all( + response.ratings.map( + async ({ rater: publicKey, ...rating }): Promise => { + const address = await secp256k1PublicKeyToBech32Address( + publicKey, + bech32Prefix + ) + + return { + ...rating, + rater: { + publicKey, + address, + }, + } + } + ) + ), + ]) + + const responseWithIdentities: RatingsResponseWithIdentities = { + contributions, + ratings, + } + + setRatingsResponse(responseWithIdentities) + updateProposalCreationFormData(responseWithIdentities) } catch (err) { console.error(err) toast.error(err instanceof Error ? err.message : JSON.stringify(err)) } finally { setLoading(false) } - }, [bech32Prefix, coreAddress, postRequest, status.survey.attributes]) + }, [bech32Prefix, coreAddress, updateProposalCreationFormData, postRequest]) + + // If proposal creation form data is defined and weight by vote power changes, + // recompute based on same ratings response. + useEffect(() => { + if (!proposalCreationFormData) { + return + } + + updateProposalCreationFormData() + + // Only update when weight by voting power changes. + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [weightByVotingPower]) const onClick = status.survey.status === SurveyStatus.Inactive || @@ -249,7 +322,7 @@ export const OpenSurveySection = ({ ? status.survey.status === SurveyStatus.AcceptingRatings ? loadRatingFormData : status.survey.status === SurveyStatus.AwaitingCompletion - ? loadProposalCreationFormData + ? loadRatingsAndProposalCreationFormData : undefined : undefined @@ -276,7 +349,11 @@ export const OpenSurveySection = ({ isMember && proposalCreationFormData ? (
- +
) : ( { +} & Pick< + StatelessProposalCreationFormProps, + 'weightByVotingPower' | 'setWeightByVotingPower' +> + +export const ProposalCreationForm = ({ + data, + ...props +}: ProposalCreationFormProps) => { const { t } = useTranslation() const { chain_id: chainId } = useChain() const { goToDaoProposal } = useDaoNavHelpers() @@ -75,24 +86,36 @@ export const ProposalCreationForm = ({ data }: ProposalCreationFormProps) => { setLoading(true) try { - // Propose. - const proposalData: NewProposalData = { - ...formData, - msgs: data.cosmosMsgs, + let proposalId = '' + if (formData.type === 'new') { + // Propose. + const proposalData: NewProposalData = { + ...formData.newProposal, + msgs: data.cosmosMsgs, + } + + proposalId = (await publishProposal(proposalData)).proposalId + toast.success(t('success.proposalCreatedCompleteCompensationCycle')) + } else if (formData.type === 'existing') { + proposalId = formData.existing } - - const { proposalId } = await publishProposal(proposalData) - toast.success(t('success.proposalCreatedCompleteCompensationCycle')) + // 'none' will leave the proposal ID empty // Complete with proposal ID. await postRequest(`/${coreAddress}/complete`, { proposalId }) - toast.success(t('success.compensationCycleCompleted')) + toast.success( + t('success.compensationCycleCompleted', { + context: proposalId ? 'withProposal' : 'noProposal', + }) + ) // Reload status on success. setRefreshStatus((id) => id + 1) - // Navigate to proposal. - goToDaoProposal(coreAddress, proposalId) + // Navigate to proposal if set. + if (proposalId) { + goToDaoProposal(coreAddress, proposalId) + } // Don't stop loading on success since we are now navigating. } catch (err) { @@ -150,6 +173,7 @@ export const ProposalCreationForm = ({ data }: ProposalCreationFormProps) => { tokenPrices.state === 'hasValue' && ( { status={statusLoadable.contents} tokenPrices={tokenPrices.contents} walletAddress={walletAddress} + {...props} /> )} diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/CompletedSurveyRow.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/CompletedSurveyRow.tsx index c3e7a7214..ccb30259f 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/CompletedSurveyRow.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/CompletedSurveyRow.tsx @@ -18,6 +18,7 @@ export interface CompletedSurveyRowProps { onClick: () => void IconButtonLink: ComponentType className?: string + tooltip?: string } export const CompletedSurveyRow = ({ @@ -25,6 +26,7 @@ export const CompletedSurveyRow = ({ onClick, IconButtonLink, className, + tooltip, }: CompletedSurveyRowProps) => { const { t } = useTranslation() const { coreAddress } = useDaoInfoContext() @@ -32,71 +34,73 @@ export const CompletedSurveyRow = ({ const openedAtEpoch = Date.parse(contributionsOpenedAt) return ( -
- {/* Desktop */} -
-

{name}

- - {!!proposalId && ( - - e.stopPropagation() - } - size="sm" - variant="ghost" - /> - - )} - -

- {t('info.numContributors', { count: contributionCount })} -

- - {!isNaN(openedAtEpoch) && ( -

- {formatDate(new Date(contributionsOpenedAt))} -

+ +
+ onClick={onClick} + > + {/* Desktop */} +
+

{name}

- {/* Mobile */} -
-
-

{name}

{!!proposalId && ( e.stopPropagation() + } size="sm" variant="ghost" /> )} -
-
+

+ {t('info.numContributors', { count: contributionCount })} +

+ {!isNaN(openedAtEpoch) && ( -

+

{formatDate(new Date(contributionsOpenedAt))}

)} +
-

- {t('info.numContributors', { count: contributionCount })} -

+ {/* Mobile */} +
+
+

{name}

+ {!!proposalId && ( + + + + )} +
+ +
+ {!isNaN(openedAtEpoch) && ( +

+ {formatDate(new Date(contributionsOpenedAt))} +

+ )} + +

+ {t('info.numContributors', { count: contributionCount })} +

+
-
+ ) } diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ProposalCreationForm.stories.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ProposalCreationForm.stories.tsx index ff0a8f8a3..5ea8c3c5d 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ProposalCreationForm.stories.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ProposalCreationForm.stories.tsx @@ -108,6 +108,7 @@ Default.args = { publicKey: 'raterPublicKey1', address: 'raterAddress1', }, + raterVotingPower: '10', contributions: [ { id: 1, @@ -124,6 +125,7 @@ Default.args = { publicKey: 'raterPublicKey2', address: 'raterAddress2', }, + raterVotingPower: '10', contributions: [ { id: 1, diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ProposalCreationForm.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ProposalCreationForm.tsx index 86c2747ab..f12e5f1b0 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ProposalCreationForm.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ProposalCreationForm.tsx @@ -1,6 +1,13 @@ import { GavelRounded, Visibility, VisibilityOff } from '@mui/icons-material' import clsx from 'clsx' -import { ComponentType, Fragment, useMemo, useState } from 'react' +import { + ComponentType, + Dispatch, + Fragment, + SetStateAction, + useMemo, + useState, +} from 'react' import { useForm } from 'react-hook-form' import { useTranslation } from 'react-i18next' @@ -8,8 +15,11 @@ import { Button, CosmosMessageDisplay, InputErrorMessage, + Loader, MarkdownRenderer, ProposalContentDisplay, + SegmentedControls, + SwitchCard, TextAreaInput, TextInput, TokenAmountDisplay, @@ -19,6 +29,7 @@ import { GenericTokenWithUsdPrice, LoadingData, StatefulEntityDisplayProps, + StatefulProposalListProps, } from '@dao-dao/types' import { convertMicroDenomToDenomWithDecimals, @@ -29,7 +40,11 @@ import { import { NewProposalData } from '../../../../../../proposal-module-adapter/adapters/DaoProposalSingle/types' import { CompleteRatings, Status } from '../../types' -export type ProposalCreationFormData = Omit +export type ProposalCreationFormData = { + type: 'new' | 'existing' | 'none' + newProposal: Omit + existing: string +} export interface ProposalCreationFormProps { status: Status @@ -40,6 +55,9 @@ export interface ProposalCreationFormProps { tokenPrices: GenericTokenWithUsdPrice[] walletAddress: string entity: LoadingData + weightByVotingPower: boolean + setWeightByVotingPower: Dispatch> + ProposalList: ComponentType } export const ProposalCreationForm = ({ @@ -51,6 +69,9 @@ export const ProposalCreationForm = ({ tokenPrices, walletAddress, entity, + weightByVotingPower, + setWeightByVotingPower, + ProposalList, }: ProposalCreationFormProps) => { const { t } = useTranslation() @@ -115,16 +136,23 @@ export const ProposalCreationForm = ({ const { watch, register, + setValue, handleSubmit, formState: { errors }, } = useForm({ defaultValues: { - title: '', - description: ratingMarkdownTables, + type: 'new', + newProposal: { + title: '', + description: ratingMarkdownTables, + }, + existing: '', }, }) - const proposalTitle = watch('title') - const proposalDescription = watch('description') + const formData = watch() + const type = formData.type + const proposalTitle = formData.newProposal.title + const proposalDescription = formData.newProposal.description return (
@@ -220,227 +248,304 @@ export const ProposalCreationForm = ({
))} -

{t('title.proposal')}

-
- {/* Proposal title and description. */} -
-
-

{t('form.title')}

- -
- - -
-
-
-

- {t('form.description')} -

+ + className="self-start mb-2" + onSelect={(type) => setValue('type', type)} + selected={type} + tabs={[ + { + label: t('title.newProposal'), + value: 'new', + }, + { + label: t('title.existingProposal'), + value: 'existing', + }, + { + label: t('title.noProposal'), + value: 'none', + }, + ]} + /> -
- - + {type === 'new' ? ( + <> + {/* Proposal title and description. */} +
+
+

+ {t('form.title')} +

+ +
+ + +
+
+
+

+ {t('form.description')} +

+ +
+ + +
+
-
-
- {/* Contributor results grid. */} -
'auto') - .join(' ')} auto`, - }} - > - {/* Row for titles, which are mostly attribute names. */} -

- {t('title.contributor')} -

- {survey.attributes.map(({ name }, attributeIndex) => ( -

setWeightByVotingPower((w) => !w)} + sizing="md" + tooltip={t('form.weightByVotingPowerTooltip')} + /> + + {/* Contributor results grid. */} +

'auto') + .join(' ')} auto`, + }} > - {name} -

- ))} -

- {t('title.compensation')} -

- - {/* Row for each contributor. */} - {completeRatings.contributions.map( - ({ id, contributor, compensation }, contributionIndex) => { - // Every other row. - const backgroundClassName = - // eslint-disable-next-line i18next/no-literal-string - contributionIndex % 2 !== 0 && 'bg-background-tertiary' - - const tokens = compensation.compensationPerAttribute - .flatMap(({ cw20Tokens, nativeTokens }) => [ - ...nativeTokens, - ...cw20Tokens, - ]) - .reduce( - (acc, { denomOrAddress, amount }) => ({ - ...acc, - [denomOrAddress]: - (acc[denomOrAddress] ?? 0) + - convertMicroDenomToDenomWithDecimals( - amount, - tokenMap[denomOrAddress]?.token.decimals ?? 0 - ), - }), - {} as Record - ) - const totalUsdc = Object.entries(tokens) - .map( - ([denomOrAddress, amount]) => - (tokenMap[denomOrAddress]?.usdPrice ?? 0) * amount - ) - .reduce((acc, amount) => acc + amount, 0) - - return ( - - {/* Profile display */} - + {/* Row for titles, which are mostly attribute names. */} +

+ {t('title.contributor')} +

+ {survey.attributes.map(({ name }, attributeIndex) => ( +

+ {name} +

+ ))} +

+ {t('title.compensation')} +

- {/* Attribute averages */} - {survey.attributes.map((_, attributeIndex) => ( -

- {compensation.compensationPerAttribute[ - attributeIndex - ].averageRating.toLocaleString(undefined, { - maximumSignificantDigits: 4, - })} -

- ))} - - {/* Total compensation */} -
- {Object.entries(tokens).map( - ([denomOrAddress, amount], index) => ( - { + // Every other row. + const backgroundClassName = + // eslint-disable-next-line i18next/no-literal-string + contributionIndex % 2 !== 0 && 'bg-background-tertiary' + + const tokens = compensation.compensationPerAttribute + .flatMap(({ cw20Tokens, nativeTokens }) => [ + ...nativeTokens, + ...cw20Tokens, + ]) + .reduce( + (acc, { denomOrAddress, amount }) => ({ + ...acc, + [denomOrAddress]: + (acc[denomOrAddress] ?? 0) + + convertMicroDenomToDenomWithDecimals( + amount, tokenMap[denomOrAddress]?.token.decimals ?? 0 - } - iconUrl={tokenMap[denomOrAddress]?.token.imageUrl} - symbol={ - tokenMap[denomOrAddress]?.token.symbol ?? - denomOrAddress - } - /> - ) - )} + ), + }), + {} as Record + ) + const totalUsdc = Object.entries(tokens) + .map( + ([denomOrAddress, amount]) => + (tokenMap[denomOrAddress]?.usdPrice ?? 0) * amount + ) + .reduce((acc, amount) => acc + amount, 0) -
- + {/* Profile display */} + -
-
-
- ) - } - )} -
-
- + {/* Attribute averages */} + {survey.attributes.map((_, attributeIndex) => ( +

+ {compensation.compensationPerAttribute[ + attributeIndex + ].averageRating.toLocaleString(undefined, { + maximumSignificantDigits: 4, + })} +

+ ))} - -
+ {/* Total compensation */} +
+ {Object.entries(tokens).map( + ([denomOrAddress, amount], index) => ( + + ) + )} - {showPreview && ( -
- + +
+
+ + ) + } + )} +
+ +
+ + + +
+ + {showPreview && ( +
+ + } + title={proposalTitle} /> +
+ )} + + ) : type === 'existing' ? ( + <> +
+

+ {t('info.selectExistingProposalBelow')} +

+ + {loading && } +
+ + {} + : ({ proposalId }) => { + setValue('existing', proposalId) + onComplete({ + ...formData, + existing: proposalId, + }) + } } - title={proposalTitle} /> -
+ + ) : ( + <> + + )}
diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/RatingForm.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/RatingForm.tsx index 5afbc71b9..e889d91a4 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/RatingForm.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/RatingForm.tsx @@ -87,6 +87,8 @@ export const RatingForm = ({ reset({ ratings: data.contributions.map(({ id }) => ({ contributionId: id, + // Weight doesn't matter since it's a projection based on one rating. + weight: 1, attributes: [ // Try to find existing rating. ...(data.existingRatings.find( @@ -100,7 +102,7 @@ export const RatingForm = ({ } }, [data, ratings, reset, survey.attributes]) - // Compute compensation for each contribution. + // Compute compensation for each contribution to display projection. const compensation: ContributionCompensation[] = data ? computeCompensation( data.contributions.map(({ id }) => id), diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/TabRenderer.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/TabRenderer.tsx index b0a274880..881604060 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/TabRenderer.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/TabRenderer.tsx @@ -161,6 +161,11 @@ export const TabRenderer = ({ ) } survey={survey} + tooltip={ + wasMemberDuringSurvey + ? t('button.downloadSurveyCsv') + : t('button.goToProposal') + } /> ) })} diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/selectors.ts b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/selectors.ts index 525110e9f..38eba4c30 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/selectors.ts +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/selectors.ts @@ -52,7 +52,9 @@ export const listCompletedSurveysSelector = selectorFamily< key: 'listCompletedSurveys', get: ({ daoAddress }) => - async () => { + async ({ get }) => { + get(refreshStatusAtom({ daoAddress })) + const response = await fetch(`${API_BASE}/${daoAddress}/list`) // If not found, return undefined since there is no active survey. if (response.status === 404) { diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/types.ts b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/types.ts index 795094832..faf0fe73a 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/types.ts +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/types.ts @@ -70,6 +70,11 @@ export interface CompletedSurveyListing { export interface ContributionRating { contributionId: number + /** + * Weight can be any number. The computation utility function normalizes + * weights so that the output weighted averages are in the range [0, 100]. + */ + weight: number // The position matches the position in the survey's attributes list. attributes: (number | null)[] } @@ -99,6 +104,7 @@ export interface Contribution export interface RatingResponse { rater: string + raterVotingPower: string contributions: { id: number // The position matches the position in the survey's attributes list. @@ -115,6 +121,11 @@ export interface RatingsResponse { ratings: RatingResponse[] } +export type RatingsResponseWithIdentities = { + contributions: Contribution[] + ratings: Rating[] +} + export interface ContributionCompensation { contributionId: number compensationPerAttribute: { diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.test.ts b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.test.ts index 75ed87c0b..b5780cc27 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.test.ts +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.test.ts @@ -51,10 +51,12 @@ describe('computeCompensation', () => { const ratings: ContributionRating[] = [ { contributionId: 1, + weight: 1, attributes: [0, 0, 0], }, { contributionId: 1, + weight: 1, attributes: [100, 100, 100], }, ] @@ -111,10 +113,12 @@ describe('computeCompensation', () => { const ratings: ContributionRating[] = [ { contributionId: 1, + weight: 1, attributes: [null, null, null], }, { contributionId: 1, + weight: 1, attributes: [100, 100, 100], }, ] @@ -171,10 +175,12 @@ describe('computeCompensation', () => { const ratings: ContributionRating[] = [ { contributionId: 1, + weight: 1, attributes: [100, 100, 100], }, { contributionId: 2, + weight: 1, attributes: [100, 100, 100], }, ] @@ -231,10 +237,12 @@ describe('computeCompensation', () => { const ratings: ContributionRating[] = [ { contributionId: 1, + weight: 1, attributes: [null, null, null], }, { contributionId: 2, + weight: 1, attributes: [12, 56, 34], }, ] @@ -291,10 +299,12 @@ describe('computeCompensation', () => { const ratings: ContributionRating[] = [ { contributionId: 1, + weight: 1, attributes: [0, 0, 0], }, { contributionId: 2, + weight: 1, attributes: [null, null, null], }, ] @@ -352,19 +362,23 @@ describe('computeCompensation', () => { // Average for each: 75 { contributionId: 1, + weight: 1, attributes: [100, 70, 50], }, { contributionId: 1, + weight: 1, attributes: [50, 80, 100], }, // Average for each: 25 { contributionId: 2, + weight: 1, attributes: [0, 20, null], }, { contributionId: 2, + weight: 1, attributes: [50, 30, 25], }, ] @@ -416,4 +430,78 @@ describe('computeCompensation', () => { computeCompensation(contributionIds, ratings, attributes) ).toMatchObject(expectedCompensation) }) + + it('distributes according to contribution averages and weights', () => { + const ratings: ContributionRating[] = [ + // Weighted average for each: 87.5 + { + contributionId: 1, + weight: 0.75, + attributes: [100, 100, 100], + }, + { + contributionId: 1, + weight: 0.25, + attributes: [50, 50, 50], + }, + // Average for each: 25 + { + contributionId: 2, + weight: 1, + attributes: [0, 20, null], + }, + { + contributionId: 2, + weight: 1, + attributes: [50, 30, 25], + }, + ] + + const expectedCompensation: ContributionCompensation[] = [ + { + contributionId: 1, + compensationPerAttribute: [ + { + averageRating: 87.5, + nativeTokens: [anyNativeToken(777)], + cw20Tokens: [], + }, + { + averageRating: 87.5, + nativeTokens: [], + cw20Tokens: [anyCw20Token(777)], + }, + { + averageRating: 87.5, + nativeTokens: [anyNativeToken(777)], + cw20Tokens: [anyCw20Token(777)], + }, + ], + }, + { + contributionId: 2, + compensationPerAttribute: [ + { + averageRating: 25, + nativeTokens: [anyNativeToken(222)], + cw20Tokens: [], + }, + { + averageRating: 25, + nativeTokens: [], + cw20Tokens: [anyCw20Token(222)], + }, + { + averageRating: 25, + nativeTokens: [anyNativeToken(222)], + cw20Tokens: [anyCw20Token(222)], + }, + ], + }, + ] + + expect( + computeCompensation(contributionIds, ratings, attributes) + ).toMatchObject(expectedCompensation) + }) }) diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts index 5bc380548..b0751e00c 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts @@ -7,7 +7,7 @@ import { } from './types' // Distribute compensation per survey attribute among the contributions -// according to the average ratings. Output array matches the order of +// according to the weighted average ratings. Output array matches the order of // contributonIds input. export const computeCompensation = ( contributionIds: number[], @@ -17,27 +17,41 @@ export const computeCompensation = ( // Compute average of ratings for contributions for each attribute. const contributionsWithAverageRatings = contributionIds.map( (contributionId) => { + const contributionRatings = ratings.filter( + (rating) => rating.contributionId === contributionId + ) + // Sum weight per attribute, ignoring weights for abstains. + const totalWeightPerAttribute = surveyAttributes.map((_, index) => + contributionRatings.reduce( + (sum, rating) => + rating.attributes[index] === null ? sum : sum + rating.weight, + 0 + ) + ) + // Each item is an array of attribute ratings for this contributor. The // order of attributes matches the attribute order in the survey. - const attributeRatings = ratings - .filter((rating) => rating.contributionId === contributionId) - .map((rating) => rating.attributes) + const weightedAttributeRatings = contributionRatings.map((rating) => + rating.attributes.map((a, i) => + a === null ? a : (a * rating.weight) / totalWeightPerAttribute[i] + ) + ) - // Average attribute rating for each attribute. If the ratings were - // [50, 100], the average is 75. If the ratings were [null, 50], the - // average is 50. If the ratings were [null, null], the average is 0. + // Weighted average attribute rating for each attribute. If the ratings + // were [50, 100] with equal weight, the average is 75. If the ratings + // were [null, 50], the average is 50. If the ratings were [null, null], + // the average is 0. const averageAttributeRatings = surveyAttributes.map( (_, attributeIndex) => { - const nonAbstainRatings = attributeRatings + const nonAbstainRatings = weightedAttributeRatings .map((ratings) => ratings[attributeIndex]) .filter((rating) => typeof rating === 'number') as number[] // If all ratings are abstain, return 0. return nonAbstainRatings.length === 0 ? 0 - : // Otherwise, return average. - nonAbstainRatings.reduce((sum, rating) => sum + rating, 0) / - nonAbstainRatings.length + : // Otherwise, add together since weight was applied before. + nonAbstainRatings.reduce((sum, rating) => sum + rating, 0) } ) diff --git a/packages/stateless/components/dao/tabs/ProposalsTab.tsx b/packages/stateless/components/dao/tabs/ProposalsTab.tsx index 0c93682b2..ccc38d4dc 100644 --- a/packages/stateless/components/dao/tabs/ProposalsTab.tsx +++ b/packages/stateless/components/dao/tabs/ProposalsTab.tsx @@ -3,14 +3,18 @@ import { isMobile } from '@walletconnect/browser-utils' import { ComponentType, useEffect } from 'react' import { useTranslation } from 'react-i18next' -import { ButtonLinkProps, DaoInfo } from '@dao-dao/types' +import { + ButtonLinkProps, + DaoInfo, + StatefulProposalListProps, +} from '@dao-dao/types' import { useDaoNavHelpers, usePlatform } from '../../../hooks' import { Tooltip } from '../../tooltip/Tooltip' export interface ProposalsTabProps { daoInfo: DaoInfo - ProposalList: ComponentType + ProposalList: ComponentType ButtonLink: ComponentType } diff --git a/packages/stateless/components/proposal/ProposalLine.tsx b/packages/stateless/components/proposal/ProposalLine.tsx index 3aa00b76f..3b70617bb 100644 --- a/packages/stateless/components/proposal/ProposalLine.tsx +++ b/packages/stateless/components/proposal/ProposalLine.tsx @@ -19,6 +19,7 @@ export interface ProposalLineProps { Status: ComponentType vote: ReactNode href: string + onClick?: () => void className?: string LinkWrapper: ComponentType approvalContext?: ApprovalProposalContext @@ -32,6 +33,7 @@ export const ProposalLine = ({ Status, vote, href, + onClick, className, LinkWrapper, approvalContext, @@ -42,6 +44,7 @@ export const ProposalLine = ({ className )} href={href} + onClick={onClick} > {/* Desktop */}
diff --git a/packages/types/components/ProposalLine.ts b/packages/types/components/ProposalLine.ts index 53ae5b58a..1d02f6bea 100644 --- a/packages/types/components/ProposalLine.ts +++ b/packages/types/components/ProposalLine.ts @@ -7,5 +7,6 @@ export type StatefulProposalLineProps = { proposalModules: ProposalModule[] proposalId: string proposalViewUrl: string + onClick?: () => void isPreProposeProposal: boolean } diff --git a/packages/types/components/ProposalList.tsx b/packages/types/components/ProposalList.tsx new file mode 100644 index 000000000..eb6721544 --- /dev/null +++ b/packages/types/components/ProposalList.tsx @@ -0,0 +1,11 @@ +export type StatefulProposalListProps = { + /** + * If defined, will be called when a proposal is clicked instead of navigating + * to the proposal's page. + */ + onClick?: (props: { proposalId: string }) => void + /** + * If true, hides vetoable proposals. Defaults to false. + */ + hideVetoable?: boolean +} diff --git a/packages/types/components/index.ts b/packages/types/components/index.ts index 2bc83644d..9a0bb7235 100644 --- a/packages/types/components/index.ts +++ b/packages/types/components/index.ts @@ -42,6 +42,7 @@ export * from './ProfileVoteCard' export * from './ProfileWallet' export * from './ProposalCard' export * from './ProposalLine' +export * from './ProposalList' export * from './ProposalVoter' export * from './Row' export * from './SdaLayout' diff --git a/packages/types/proposal-module-adapter.ts b/packages/types/proposal-module-adapter.ts index 28ab86818..9e9f3520d 100644 --- a/packages/types/proposal-module-adapter.ts +++ b/packages/types/proposal-module-adapter.ts @@ -321,6 +321,7 @@ export type BaseProposalWalletVoteProps = { export type BaseProposalLineProps = { href: string + onClick?: () => void LinkWrapper: ComponentType } From 5e1f3330b46259eda5bd48a37d9b303a1cfca750 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 21 May 2024 16:17:25 -0400 Subject: [PATCH 174/438] hide following DAOs in sidebar when loading, and show more following DAOs --- .../components/layout/DappNavigation.tsx | 88 +++++++++---------- 1 file changed, 41 insertions(+), 47 deletions(-) diff --git a/packages/stateless/components/layout/DappNavigation.tsx b/packages/stateless/components/layout/DappNavigation.tsx index 40e121e84..3bab416ae 100644 --- a/packages/stateless/components/layout/DappNavigation.tsx +++ b/packages/stateless/components/layout/DappNavigation.tsx @@ -190,66 +190,60 @@ export const DappNavigation = ({ selected={pathname === '/[[...tab]]'} /> - {/* Only show following when connected. */} - {walletConnected && ( - <> + {/* Only show following when connected and following DAOs loaded. */} + {walletConnected && + !followingDaos.loading && + followingDaos.data.length > 0 && ( - {!followingDaos.loading && ( +
+ {/* Top border */}
- {/* Top border */} -
+ >
- {/* DAOs */} - {followingDaos.data.map((dao, index) => ( - - ))} + {/* DAOs */} + {followingDaos.data.map((dao, index) => ( + + ))} - {/* Bottom border */} -
-
- )} + {/* Bottom border */} +
+
- - )} + )} Date: Tue, 21 May 2024 21:54:27 -0400 Subject: [PATCH 175/438] parallelize dump state and items indexer query --- .../stateful/server/makeGetDaoStaticProps.ts | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/stateful/server/makeGetDaoStaticProps.ts b/packages/stateful/server/makeGetDaoStaticProps.ts index aeab30467..9d0aa8678 100644 --- a/packages/stateful/server/makeGetDaoStaticProps.ts +++ b/packages/stateful/server/makeGetDaoStaticProps.ts @@ -900,12 +900,20 @@ const daoCoreDumpState = async ( ) try { - const indexerDumpedState = await queryIndexer({ - type: 'contract', - address: coreAddress, - formula: 'daoCore/dumpState', - chainId, - }) + const [indexerDumpedState, items] = await Promise.all([ + queryIndexer({ + type: 'contract', + address: coreAddress, + formula: 'daoCore/dumpState', + chainId, + }), + queryIndexer({ + type: 'contract', + address: coreAddress, + formula: 'daoCore/listItems', + chainId, + }), + ]) // Use data from indexer if present. if (indexerDumpedState) { @@ -922,14 +930,6 @@ const daoCoreDumpState = async ( throw new Error(serverT('error.failedParsingCoreVersion')) } - const items = - (await queryIndexer({ - type: 'contract', - address: coreAddress, - formula: 'daoCore/listItems', - chainId, - })) ?? [] - const { admin } = indexerDumpedState const parentDaoInfo = await loadParentDaoInfo( @@ -978,7 +978,7 @@ const daoCoreDumpState = async ( : undefined, isActive, activeThreshold, - items, + items: items || [], parentDao: parentDaoInfo ? { ...parentDaoInfo, From c41e1de1be62966e29bc45d4b0e1225f4ac21d05 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 21 May 2024 22:36:24 -0400 Subject: [PATCH 176/438] don't use indexer batch client --- packages/state/indexer/query.ts | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/packages/state/indexer/query.ts b/packages/state/indexer/query.ts index a19b2dc09..bd15ab3e5 100644 --- a/packages/state/indexer/query.ts +++ b/packages/state/indexer/query.ts @@ -3,12 +3,7 @@ import { IndexerUpStatus, WithChainId, } from '@dao-dao/types' -import { - BatchClient, - CommonError, - INDEXER_URL, - chainIsIndexed, -} from '@dao-dao/utils' +import { CommonError, INDEXER_URL, chainIsIndexed } from '@dao-dao/utils' export type QueryIndexerOptions = WithChainId< { @@ -36,8 +31,6 @@ export type QueryIndexerOptions = WithChainId< ) > -const indexerBatchClient = new BatchClient(INDEXER_URL + '/batch') - export const queryIndexer = async ({ type, address = '_', @@ -76,18 +69,26 @@ export const queryIndexer = async ({ }), }) - const url = `/${chainId}/${type}/${address}/${formula}?${params.toString()}` - const { status, body } = await indexerBatchClient.execute({ - url, - }) + const response = await fetch( + INDEXER_URL + + `/${chainId}/${type}/${address}/${formula}?${params.toString()}`, + { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + } + ) + + const body = await response.text() - if (status >= 300) { + if (response.status >= 300) { throw new Error( - `Error querying indexer for ${type}/${address}/${formula}: ${status} ${body}`.trim() + `Error querying indexer for ${type}/${address}/${formula}: ${response.status} ${body}`.trim() ) } - if (status === 204) { + if (response.status === 204) { // If no content is returned, return undefined. This will happen if the // formula computed succesfully and outputted nothing (undefined or null). return undefined From b89f8ca9844257dc7a6648d4365f6e8d0fcd37f6 Mon Sep 17 00:00:00 2001 From: echel0n-HX <138946701+echel0n-HX@users.noreply.github.com> Date: Wed, 22 May 2024 07:59:52 -0700 Subject: [PATCH 177/438] Add Galaxy Station wallet (#1775) --- .../components/wallet/WalletProvider.tsx | 2 + packages/stateful/package.json | 53 +- packages/stateless/package.json | 6 +- packages/types/package.json | 4 +- packages/utils/package.json | 4 +- yarn.lock | 830 +++++++++--------- 6 files changed, 460 insertions(+), 439 deletions(-) diff --git a/packages/stateful/components/wallet/WalletProvider.tsx b/packages/stateful/components/wallet/WalletProvider.tsx index de6c38857..0831f3e21 100644 --- a/packages/stateful/components/wallet/WalletProvider.tsx +++ b/packages/stateful/components/wallet/WalletProvider.tsx @@ -5,6 +5,7 @@ import { wallets as cosmosExtensionMetamaskWallets } from '@cosmos-kit/cosmos-ex import { wallets as cosmostationWallets } from '@cosmos-kit/cosmostation' import { wallets as exodusWallets } from '@cosmos-kit/exodus' import { wallets as frontierWallets } from '@cosmos-kit/frontier' +import { wallets as galaxyStationWallets } from '@cosmos-kit/galaxy-station' import { wallets as keplrWallets } from '@cosmos-kit/keplr' import { wallets as keplrExtensionWallets } from '@cosmos-kit/keplr-extension' import { wallets as leapWallets } from '@cosmos-kit/leap' @@ -148,6 +149,7 @@ export const WalletProvider = ({ children }: WalletProviderProps) => { ...keplrWallets, ...leapWallets.filter((w) => !leapMetamaskWallets.includes(w)), ...stationWallets, + ...galaxyStationWallets, ...vectisWallets, ...trustWallets, ...cosmostationWallets, diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 493ccb10f..ca8ccb9a6 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -14,30 +14,31 @@ "@cosmjs/encoding": "^0.32.3", "@cosmjs/proto-signing": "^0.32.3", "@cosmjs/stargate": "^0.32.3", - "@cosmos-kit/coin98": "^2.8.0", - "@cosmos-kit/compass": "^2.8.0", - "@cosmos-kit/core": "^2.10.0", - "@cosmos-kit/cosmos-extension-metamask": "^0.6.0", - "@cosmos-kit/cosmostation": "^2.8.0", - "@cosmos-kit/exodus": "^2.7.0", - "@cosmos-kit/fin": "^2.8.0", - "@cosmos-kit/frontier": "^2.7.0", - "@cosmos-kit/keplr": "^2.8.0", - "@cosmos-kit/leap": "^2.8.0", - "@cosmos-kit/leap-metamask-cosmos-snap": "^0.8.0", - "@cosmos-kit/ledger": "^2.8.0", - "@cosmos-kit/ninji": "^2.8.0", - "@cosmos-kit/okxwallet": "^2.6.0", - "@cosmos-kit/omni": "^2.7.0", - "@cosmos-kit/owallet": "^2.8.0", - "@cosmos-kit/react-lite": "^2.8.0", - "@cosmos-kit/shell": "^2.8.0", - "@cosmos-kit/station": "^2.7.0", - "@cosmos-kit/tailwind": "^1.2.0", - "@cosmos-kit/trust": "^2.8.0", - "@cosmos-kit/vectis": "^2.8.0", - "@cosmos-kit/web3auth": "^2.7.0", - "@cosmos-kit/xdefi": "^2.7.0", + "@cosmos-kit/coin98": "^2.9.0", + "@cosmos-kit/compass": "^2.9.0", + "@cosmos-kit/core": "^2.11.0", + "@cosmos-kit/cosmos-extension-metamask": "^0.7.0", + "@cosmos-kit/cosmostation": "^2.9.0", + "@cosmos-kit/exodus": "^2.8.0", + "@cosmos-kit/fin": "^2.9.0", + "@cosmos-kit/frontier": "^2.8.0", + "@cosmos-kit/galaxy-station": "^2.8.0", + "@cosmos-kit/keplr": "^2.9.0", + "@cosmos-kit/leap": "^2.9.0", + "@cosmos-kit/leap-metamask-cosmos-snap": "^0.9.0", + "@cosmos-kit/ledger": "^2.9.0", + "@cosmos-kit/ninji": "^2.9.0", + "@cosmos-kit/okxwallet": "^2.7.0", + "@cosmos-kit/omni": "^2.8.0", + "@cosmos-kit/owallet": "^2.9.0", + "@cosmos-kit/react-lite": "^2.9.0", + "@cosmos-kit/shell": "^2.9.0", + "@cosmos-kit/station": "^2.8.0", + "@cosmos-kit/tailwind": "^1.3.0", + "@cosmos-kit/trust": "^2.9.0", + "@cosmos-kit/vectis": "^2.9.0", + "@cosmos-kit/web3auth": "^2.8.0", + "@cosmos-kit/xdefi": "^2.8.0", "@dao-dao/i18n": "2.4.0-rc.8", "@dao-dao/state": "2.4.0-rc.8", "@dao-dao/stateless": "2.4.0-rc.8", @@ -48,7 +49,7 @@ "@mui/material": "^5.10.3", "@walletconnect/browser-utils": "^1.8.0", "buffer": "^6.0.3", - "chain-registry": "^1.46.8", + "chain-registry": "^1.59.4", "clsx": "^1.1.1", "file-saver": "^2.0.5", "fuse.js": "^6.6.2", @@ -74,7 +75,7 @@ "uuid": "^9.0.0" }, "devDependencies": { - "@chain-registry/types": "^0.28.12", + "@chain-registry/types": "^0.41.3", "@cosmjs/amino": "^0.32.3", "@dao-dao/config": "2.4.0-rc.8", "@dao-dao/cosmiframe": "0.1.0", diff --git a/packages/stateless/package.json b/packages/stateless/package.json index 514809e0f..cb9035058 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -18,7 +18,7 @@ "@types/remove-markdown": "^0.3.1", "@walletconnect/browser-utils": "^1.8.0", "a11y-react-emoji": "^1.2.0", - "chain-registry": "^1.46.8", + "chain-registry": "^1.59.4", "chart.js": "^4.4.0", "chartjs-adapter-date-fns": "^3.0.0", "chartjs-plugin-annotation": "^3.0.1", @@ -43,8 +43,8 @@ "uuid": "^9.0.0" }, "devDependencies": { - "@chain-registry/types": "^0.28.12", - "@cosmos-kit/core": "^2.10.0", + "@chain-registry/types": "^0.41.3", + "@cosmos-kit/core": "^2.11.0", "@dao-dao/config": "2.4.0-rc.8", "@storybook/react": "^6.5.10", "@types/lodash.clonedeep": "^4.5.0", diff --git a/packages/types/package.json b/packages/types/package.json index 7915e051e..448d88fce 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -11,8 +11,8 @@ "protobuf": "npm run protobuf:codegen && npm run protobuf:patch" }, "dependencies": { - "@chain-registry/types": "^0.28.12", - "@cosmos-kit/web3auth": "^2.7.0", + "@chain-registry/types": "^0.41.3", + "@cosmos-kit/web3auth": "^2.8.0", "next-i18next": "^11.0.0", "pusher-js": "^7.6.0", "react": "^18.2.0", diff --git a/packages/utils/package.json b/packages/utils/package.json index b13ebcd28..f0cff0466 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -21,7 +21,7 @@ "@types/uuid": "^9.0.1", "ajv": "^8.11.0", "aws-sdk": "^2.1612.0", - "chain-registry": "^1.46.8", + "chain-registry": "^1.59.4", "json5": "^2.2.0", "lodash.clonedeep": "^4.5.0", "long": "^5.2.1", @@ -35,7 +35,7 @@ "uuid": "^9.0.0" }, "devDependencies": { - "@chain-registry/types": "^0.28.12", + "@chain-registry/types": "^0.41.3", "@cosmjs/proto-signing": "^0.32.3", "@dao-dao/config": "2.4.0-rc.8", "cosmjs-types": "^0.9.0", diff --git a/yarn.lock b/yarn.lock index b3fe6a54f..7d8ec1575 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2022,72 +2022,59 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@chain-registry/client@^1.18.0": - version "1.31.11" - resolved "https://registry.yarnpkg.com/@chain-registry/client/-/client-1.31.11.tgz#f14b4ab276546fac4d3930f53a51795efb3e5831" - integrity sha512-sXI25J1x3sZL7wn8FAO+byOkaS466Z7YCYGucdtydHKsRSyQfJxvYo471rX1uWS1aWOzaSlWxoGGyyJzbuq78A== +"@chain-registry/client@^1.44.3": + version "1.44.3" + resolved "https://registry.yarnpkg.com/@chain-registry/client/-/client-1.44.3.tgz#660a8dba47724860a81d908dc45776dbd4f473d0" + integrity sha512-cf49fz+jZDXMpByAD/nSwF3dM+N7nnb9E42eAM6V9N8vrE/9Bwp963mzj8wY4oZpwJCaTL7ja2zq3OD0csfiXQ== dependencies: - "@chain-registry/types" "^0.28.11" - "@chain-registry/utils" "^1.29.11" + "@chain-registry/types" "^0.41.3" + "@chain-registry/utils" "^1.42.3" bfs-path "^1.0.2" cross-fetch "^3.1.5" -"@chain-registry/cosmostation@1.26.0": - version "1.26.0" - resolved "https://registry.yarnpkg.com/@chain-registry/cosmostation/-/cosmostation-1.26.0.tgz#0d3967b8d320168a5c9c7b56b3352dcf3f2945b0" - integrity sha512-MmjThpQ0U0EJF66UJzPy67iKC9hY7ljrpGtQOPfeYGB/lUlKZTsE/mgF2XkKGUf7wJK8LugOqU5Zul7C1/ZA4Q== +"@chain-registry/cosmostation@1.62.4", "@chain-registry/cosmostation@^1.62.4": + version "1.62.4" + resolved "https://registry.yarnpkg.com/@chain-registry/cosmostation/-/cosmostation-1.62.4.tgz#cc2dff05bb23f1eac675dd880f0a6c484416d9eb" + integrity sha512-gR6yaJbaVG0merW2QA3Ao2kuHPd4JxJgL5zKA7/3gP5RxZHJ/SWqrZ13EfPSd7kBUU6jpWZr40Z2cpaPrtpZ9A== dependencies: - "@babel/runtime" "^7.21.0" - "@chain-registry/types" "^0.17.0" - "@chain-registry/utils" "^1.15.0" - "@cosmostation/extension-client" "0.1.15" - -"@chain-registry/cosmostation@^1.26.0": - version "1.49.6" - resolved "https://registry.yarnpkg.com/@chain-registry/cosmostation/-/cosmostation-1.49.6.tgz#cefe7d5023524990db788f54a51e18b8520b1791" - integrity sha512-0YHcETVFj92sMOha2Rqe8EZXuL0iRoqqyHo6vPov+pNKcE8hNi687bKWK0KkOc0UOBpsNYxN8fTQhm5BxucoQg== - dependencies: - "@chain-registry/types" "^0.28.11" - "@chain-registry/utils" "^1.29.11" + "@chain-registry/types" "^0.41.3" + "@chain-registry/utils" "^1.42.3" "@cosmostation/extension-client" "0.1.15" -"@chain-registry/keplr@1.28.0": - version "1.28.0" - resolved "https://registry.yarnpkg.com/@chain-registry/keplr/-/keplr-1.28.0.tgz#c53d52ff0487eb6798722eb1cf5bd4dc82a141be" - integrity sha512-MRAEgUpafyGLRDQc4SPB+R/If4CL2SREqdbxZMKHX9aeqzKXhJlEM5IPjJTZCWTbUP/eGXC9JNjxPNUYd92PqQ== +"@chain-registry/keplr@1.64.4": + version "1.64.4" + resolved "https://registry.yarnpkg.com/@chain-registry/keplr/-/keplr-1.64.4.tgz#8b54d97ab908312b82ae9480ef73df513476cb56" + integrity sha512-8/5FhWhH36Zo2oBkFtzauNfwWFbeIAp0PuiXztqqJluRkyFUUh4E4OcgHzqeT9C4hmAhoU4c7B0Bgc0QCYr82A== dependencies: - "@babel/runtime" "^7.21.0" - "@chain-registry/types" "^0.17.0" + "@chain-registry/types" "^0.41.3" "@keplr-wallet/cosmos" "0.12.28" "@keplr-wallet/crypto" "0.12.28" semver "^7.5.0" -"@chain-registry/types@^0.17.0": - version "0.17.1" - resolved "https://registry.yarnpkg.com/@chain-registry/types/-/types-0.17.1.tgz#0ac7bda6178d3917834578627f232a247fe5def8" - integrity sha512-O0CgrtJgIlqXvZm1CqDZe/7jZz068O/uuCIoyDXCegFHK03rdHacKcDGwEIUuI0MNUf8YV3jdE4xHQMSAX+79w== - dependencies: - "@babel/runtime" "^7.21.0" - -"@chain-registry/types@^0.28.11": - version "0.28.11" - resolved "https://registry.yarnpkg.com/@chain-registry/types/-/types-0.28.11.tgz#be43fcd3d9489a5cb427cae1d25a274e210c252a" - integrity sha512-pTsd6YGq+W6qnqWkWI7VxPYrx1T8B6usjlG5XmZxUJJFpB7HULot9WLPmcB/DEUxR8pekyiIN3x93761mql4sQ== - -"@chain-registry/types@^0.28.12": - version "0.28.12" - resolved "https://registry.yarnpkg.com/@chain-registry/types/-/types-0.28.12.tgz#b7530ef0d35806558380d196553bb54b4c85184e" - integrity sha512-wrcbKZ3Sz0bXGWBhF9igq+LAOn3PkQLh+VFaA3J1SAVE7nt0WFlRfkvu7WmLmnSJhLlAxdyf9jWu+yXSRvpscw== +"@chain-registry/types@0.41.3", "@chain-registry/types@^0.41.3": + version "0.41.3" + resolved "https://registry.yarnpkg.com/@chain-registry/types/-/types-0.41.3.tgz#67e32805a281161fe0f283aaabb5133822e1b146" + integrity sha512-pmXgS9HJ1vEbZNdgsEMVEqxSki53e35gV+WHSMioXHnCz04tpyEGSa7CvE6mDY/J67NSpJvYr+So7pu27VH5FQ== -"@chain-registry/utils@^1.15.0", "@chain-registry/utils@^1.29.11": - version "1.29.11" - resolved "https://registry.yarnpkg.com/@chain-registry/utils/-/utils-1.29.11.tgz#ddd1e5fea3b64a1e775f1958cc41d345f803c9d9" - integrity sha512-JzoWuU1CFG2cZpsk1WqnkHlKst94BnbcC2NPyRdgRIJEOqahhcuZd7azWdybCBcEPdWgzPTo1NqbNsywBBSp1g== +"@chain-registry/utils@^1.42.3": + version "1.42.3" + resolved "https://registry.yarnpkg.com/@chain-registry/utils/-/utils-1.42.3.tgz#90ad49d19bc095e991fa89bffaa70eaa8d9e8618" + integrity sha512-IJYDwy4rXAZCYET+CJkFKViZIJNE3IE5h4E4Q2+qoRGxETAm3+INth3xKrghjWtIU3jVp5JONkroqhDANSkfMA== dependencies: - "@chain-registry/types" "^0.28.11" - bignumber.js "9.1.1" + "@chain-registry/types" "^0.41.3" + bignumber.js "9.1.2" sha.js "^2.4.11" +"@classic-terra/terra.proto@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@classic-terra/terra.proto/-/terra.proto-1.1.0.tgz#e314d89f59b49e79a04db25f66f658e5e5aa1890" + integrity sha512-bYhQG5LUaGF0KPRY9hYT/HEcd1QExZPQd6zLV/rQkCe/eDxfwFRLzZHpaaAdfWoAAZjsRWqJbUCqCg7gXBbJpw== + dependencies: + "@improbable-eng/grpc-web" "^0.14.1" + google-protobuf "^3.17.3" + long "^4.0.0" + protobufjs "~6.11.2" + "@cnakazawa/watch@^1.0.3": version "1.0.4" resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a" @@ -2135,17 +2122,7 @@ triple-beam "1.3.0" winston "3.3.3" -"@cosmjs/amino@^0.31.0", "@cosmjs/amino@^0.31.3": - version "0.31.3" - resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.31.3.tgz#0f4aa6bd68331c71bd51b187fa64f00eb075db0a" - integrity sha512-36emtUq895sPRX8PTSOnG+lhJDCVyIcE0Tr5ct59sUbgQiI14y43vj/4WAlJ/utSOxy+Zhj9wxcs4AZfu0BHsw== - dependencies: - "@cosmjs/crypto" "^0.31.3" - "@cosmjs/encoding" "^0.31.3" - "@cosmjs/math" "^0.31.3" - "@cosmjs/utils" "^0.31.3" - -"@cosmjs/amino@^0.32.3": +"@cosmjs/amino@^0.32.0", "@cosmjs/amino@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.32.3.tgz#b81d4a2b8d61568431a1afcd871e1344a19d97ff" integrity sha512-G4zXl+dJbqrz1sSJ56H/25l5NJEk/pAPIr8piAHgbXYw88OdAOlpA26PQvk2IbSN/rRgVbvlLTNgX2tzz1dyUA== @@ -2171,19 +2148,6 @@ cosmjs-types "^0.9.0" pako "^2.0.2" -"@cosmjs/crypto@^0.31.3": - version "0.31.3" - resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.31.3.tgz#c752cb6d682fdc735dcb45a2519f89c56ba16c26" - integrity sha512-vRbvM9ZKR2017TO73dtJ50KxoGcFzKtKI7C8iO302BQ5p+DuB+AirUg1952UpSoLfv5ki9O416MFANNg8UN/EQ== - dependencies: - "@cosmjs/encoding" "^0.31.3" - "@cosmjs/math" "^0.31.3" - "@cosmjs/utils" "^0.31.3" - "@noble/hashes" "^1" - bn.js "^5.2.0" - elliptic "^6.5.4" - libsodium-wrappers-sumo "^0.7.11" - "@cosmjs/crypto@^0.32.1", "@cosmjs/crypto@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.32.3.tgz#787f8e659709678722068ee1ddf379f65051a25e" @@ -2197,15 +2161,6 @@ elliptic "^6.5.4" libsodium-wrappers-sumo "^0.7.11" -"@cosmjs/encoding@^0.31.3": - version "0.31.3" - resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.31.3.tgz#2519d9c9ae48368424971f253775c4580b54c5aa" - integrity sha512-6IRtG0fiVYwyP7n+8e54uTx2pLYijO48V3t9TLiROERm5aUAIzIlz6Wp0NYaI5he9nh1lcEGJ1lkquVKFw3sUg== - dependencies: - base64-js "^1.3.0" - bech32 "^1.1.4" - readonly-date "^1.0.0" - "@cosmjs/encoding@^0.32.1", "@cosmjs/encoding@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.32.3.tgz#e245ff511fe4a0df7ba427b5187aab69e3468e5b" @@ -2230,13 +2185,6 @@ "@cosmjs/stream" "^0.32.3" xstream "^11.14.0" -"@cosmjs/math@^0.31.3": - version "0.31.3" - resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.31.3.tgz#767f7263d12ba1b9ed2f01f68d857597839fd957" - integrity sha512-kZ2C6glA5HDb9hLz1WrftAjqdTBb3fWQsRR+Us2HsjAYdeE6M3VdXMsYCP5M3yiihal1WDwAY2U7HmfJw7Uh4A== - dependencies: - bn.js "^5.2.0" - "@cosmjs/math@^0.32.1", "@cosmjs/math@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.32.3.tgz#16e4256f4da507b9352327da12ae64056a2ba6c9" @@ -2244,20 +2192,7 @@ dependencies: bn.js "^5.2.0" -"@cosmjs/proto-signing@^0.31.0": - version "0.31.3" - resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.31.3.tgz#20440b7b96fb2cd924256a10e656fd8d4481cdcd" - integrity sha512-24+10/cGl6lLS4VCrGTCJeDRPQTn1K5JfknzXzDIHOx8THR31JxA7/HV5eWGHqWgAbudA7ccdSvEK08lEHHtLA== - dependencies: - "@cosmjs/amino" "^0.31.3" - "@cosmjs/crypto" "^0.31.3" - "@cosmjs/encoding" "^0.31.3" - "@cosmjs/math" "^0.31.3" - "@cosmjs/utils" "^0.31.3" - cosmjs-types "^0.8.0" - long "^4.0.0" - -"@cosmjs/proto-signing@^0.32.1", "@cosmjs/proto-signing@^0.32.3": +"@cosmjs/proto-signing@^0.32.0", "@cosmjs/proto-signing@^0.32.1", "@cosmjs/proto-signing@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.32.3.tgz#91ae149b747d18666a6ccc924165b306431f7c0d" integrity sha512-kSZ0ZUY0DwcRT0NcIn2HkadH4NKlwjfZgbLj1ABwh/4l0RgeT84QCscZCu63tJYq3K6auwqTiZSZERwlO4/nbg== @@ -2318,11 +2253,6 @@ readonly-date "^1.0.0" xstream "^11.14.0" -"@cosmjs/utils@^0.31.3": - version "0.31.3" - resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.31.3.tgz#f97bbfda35ad69e80cd5c7fe0a270cbda16db1ed" - integrity sha512-VBhAgzrrYdIe0O5IbKRqwszbQa7ZyQLx9nEQuHQ3HUplQW7P44COG/ye2n6AzCudtqxmwdX7nyX8ta1J07GoqA== - "@cosmjs/utils@^0.32.1", "@cosmjs/utils@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.32.3.tgz#5dcaee6dd7cc846cdc073e9a7a7f63242f5f7e31" @@ -2417,43 +2347,44 @@ "@cosmology/types" "^1.4.2" dotty "0.1.2" -"@cosmos-kit/coin98-extension@^2.9.0": - version "2.9.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/coin98-extension/-/coin98-extension-2.9.0.tgz#05f00cccbaa17967f5a4dd6dc7db8efdc45c85d1" - integrity sha512-uyDEKBBB8Z1DZ1hF6pHpR2y1NuswqJbjB/lY04YD8GBxeP6rxrtFMUWkFFcCfPOSM931Sumu8gmP+BwSi+iMKA== +"@cosmos-kit/coin98-extension@^2.10.0": + version "2.10.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/coin98-extension/-/coin98-extension-2.10.0.tgz#bc735e4e1d20a4b0a2e084459813630429d2635c" + integrity sha512-46tn49VuN/zW4uKzlUtznKlGhWpGmrswo7TKJ90nItgXacux1th2RMwZGC4tuGNGnJ+ZBr6r4CgUVVK3rJOcEQ== dependencies: - "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.10.0" + "@chain-registry/keplr" "1.64.4" + "@cosmos-kit/core" "^2.11.0" cosmjs-types ">=0.9.0" -"@cosmos-kit/coin98@^2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/coin98/-/coin98-2.8.0.tgz#ebc56c1023eeb3238392418d28c20dbeba371fab" - integrity sha512-j9d0t4JNR5rGDb7SF6hYFs8zPcdgO4zPp2YfTtN0Kz5TjgAO+59Vw4/NdISHxEdFBgeHaW1b9xRmYmMHsl0FEQ== +"@cosmos-kit/coin98@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/coin98/-/coin98-2.9.0.tgz#7ff4d2374a5ddb9c69a086f12e6bd0c630366be7" + integrity sha512-8NJ7MnwgsW415b1F00sDcRG9Zl47e2RXYqjmAqszqnfRv+T8qzxY41pYYCGTy/2BnY83SdYq+XZxg/JDT9q64g== dependencies: - "@cosmos-kit/coin98-extension" "^2.9.0" + "@cosmos-kit/coin98-extension" "^2.10.0" -"@cosmos-kit/compass-extension@^2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/compass-extension/-/compass-extension-2.8.0.tgz#7d2431593de7646254a5b2d778893907c18a8764" - integrity sha512-WInvm28V3ZQNf3IW4Q2O9C7+FAYcQePwxIoK41VMt8bkQ3u1lNw7dRRQVJp8210Y1Ej7wrHNgHvpYDVNS7bLaA== +"@cosmos-kit/compass-extension@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/compass-extension/-/compass-extension-2.9.0.tgz#f0381101f9e911a9b22343531a75b9d92627caa7" + integrity sha512-Cw7G/u9AhiNB+NZ6sTmzHFChKz0RUw7OwPaCDcIz0R+fim5mItL6Z2mYW92NrgfdSoyBDCoTrMyGaSyFMYrsIA== dependencies: - "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.10.0" + "@chain-registry/keplr" "1.64.4" + "@cosmos-kit/core" "^2.11.0" -"@cosmos-kit/compass@^2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/compass/-/compass-2.8.0.tgz#92f62b9b0976a88f04bd00e38e020ccf25297e9b" - integrity sha512-Ky1RxiNHrZyfg16qSdX92Lhtfu3utKeplwrtiqe4rfZvyVoue967ol0Vi0GH1250fqoFSxlcdRf1oL62FLKhyQ== +"@cosmos-kit/compass@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/compass/-/compass-2.9.0.tgz#912ea70b11fb6f6d977b7e1eaa6673c67cad8fe2" + integrity sha512-Vm9dFgP0vqZXBP2m9YS4wQOceJsg366LZ4baKJ5lF9Ydaj9KTq6tUR3VlS7BwZcB/fCFRga1bJVMYEet5u7UEQ== dependencies: - "@cosmos-kit/compass-extension" "^2.8.0" + "@cosmos-kit/compass-extension" "^2.9.0" -"@cosmos-kit/core@^2.10.0": - version "2.10.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/core/-/core-2.10.0.tgz#258befd2615e9afb5858825663d287b441231517" - integrity sha512-9gSmTCHh2xpG6rfcsVjxDUq1mvAKaS7Nre47ddEzLLrRni685I5ppokPwURsUZpm4lsNpDKKum0nV0P1WtYJhQ== +"@cosmos-kit/core@^2.11.0": + version "2.11.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/core/-/core-2.11.0.tgz#50e228041d81a77a26df370643d675dc26190ee9" + integrity sha512-jYvy/0h5hveJqzD6emVDODEY3bVI2ZUfawZx1TrMJRjZ6gqn/GDwNB4JdsIuZx/pO/XB6FBjk1tf9WptyE9Y/A== dependencies: - "@chain-registry/client" "^1.18.0" + "@chain-registry/client" "^1.44.3" + "@chain-registry/types" "^0.41.3" "@cosmjs/amino" "^0.32.3" "@cosmjs/cosmwasm-stargate" "^0.32.3" "@cosmjs/proto-signing" "^0.32.3" @@ -2463,329 +2394,350 @@ bowser "2.11.0" cosmjs-types "^0.9.0" events "3.3.0" + nock "13.5.4" uuid "^9.0.1" -"@cosmos-kit/cosmos-extension-metamask@^0.6.0": - version "0.6.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/cosmos-extension-metamask/-/cosmos-extension-metamask-0.6.0.tgz#cfb98fcb57574b30d32234bdc8623916e0fa1876" - integrity sha512-1aurkL+BA8p01GwJ79RzCVQoWrLqYJaLCALwrmk+YqzZCZiGAtzq769iKv8lZ4ckZ8CRSeDMzP+IT17A9RQCbQ== +"@cosmos-kit/cosmos-extension-metamask@^0.7.0": + version "0.7.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/cosmos-extension-metamask/-/cosmos-extension-metamask-0.7.0.tgz#8a3f1e5ce55cf7dd8e5b36da18ac8865419bb946" + integrity sha512-amLw9hg1WrgZd+KO2UMmsDcDw4PEkHTiYT/gOmkv3trmDm2a56yAnuFOBa5Orw4UiD+YaFN+hTDzSzxe3pzy2w== dependencies: - "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.10.0" + "@chain-registry/keplr" "1.64.4" + "@cosmos-kit/core" "^2.11.0" "@cosmsnap/snapper" "^0.1.23" cosmjs-types ">=0.9.0" -"@cosmos-kit/cosmostation-extension@^2.9.0": - version "2.9.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/cosmostation-extension/-/cosmostation-extension-2.9.0.tgz#b3f89b44613562bc659e4505f82badd843fc5a34" - integrity sha512-HgMkcebGr/x6Z3p8o8LyBFs4EZrma8Kq70YDsdRHwsZFz6KC1Mjmh9/L4esgrXaYiZQ8EvcjtQ6yHI8lh+b9YA== +"@cosmos-kit/cosmostation-extension@^2.10.0": + version "2.10.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/cosmostation-extension/-/cosmostation-extension-2.10.0.tgz#661a322bd68d8db09e272b2510bc94d95f3046be" + integrity sha512-63otvN5Qj8dwKW4uoEaAu7dNDR9inLucwCBOLLYvawQy38ALCL0yDVbO4iSQTswRwQkuMSJbTnMminZs5ryQ4A== dependencies: - "@chain-registry/cosmostation" "^1.26.0" - "@cosmos-kit/core" "^2.10.0" + "@chain-registry/cosmostation" "^1.62.4" + "@cosmos-kit/core" "^2.11.0" cosmjs-types "^0.9.0" -"@cosmos-kit/cosmostation-mobile@^2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/cosmostation-mobile/-/cosmostation-mobile-2.8.0.tgz#331479b55419d85d2d7d463fe91dc1eac2f14f01" - integrity sha512-AbkL7a8DJR9Nb2cNpJNDPeS23qh975GsOW2jrEJ1uWpXmtsl95GnN86/SUo01Ypdfc5SiHKWTEzgiUC74sq0Tw== +"@cosmos-kit/cosmostation-mobile@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/cosmostation-mobile/-/cosmostation-mobile-2.9.0.tgz#b1ca67af53fb0a0754870d9781c15ac06c0221b9" + integrity sha512-ZqGjUnmJKqSWv5sZRxnwEeRLRsI3RyczrwtTLT1iKYA9inBh0cStrJnCLAessH0yFV8oFZpuhyaoEfTqyxDMUA== dependencies: - "@chain-registry/cosmostation" "1.26.0" - "@cosmos-kit/core" "^2.10.0" - "@cosmos-kit/walletconnect" "^2.7.0" + "@chain-registry/cosmostation" "1.62.4" + "@cosmos-kit/core" "^2.11.0" + "@cosmos-kit/walletconnect" "^2.8.0" -"@cosmos-kit/cosmostation@^2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/cosmostation/-/cosmostation-2.8.0.tgz#96e8e55fcbc3a57a3ecfd4a327c24a69f6b49571" - integrity sha512-GbkdVsSPSTOyv1lJ4SYf7s7jpRLUBAkx6QBGy3lZHbfLGm78C4kCBMoJZTizSugQmC5bYc20516tpMgrOPN3yA== +"@cosmos-kit/cosmostation@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/cosmostation/-/cosmostation-2.9.0.tgz#560a356c31f165b7249fc3c1e9df78504fdaf539" + integrity sha512-T3neAtqFb91i5cmNrQeZ3JuqQCG7lnOOmI+d0jSFocXGT22JgfmY+BOsole7pxJT+Nro051f9F3Ab49CDx+uYw== dependencies: - "@cosmos-kit/cosmostation-extension" "^2.9.0" - "@cosmos-kit/cosmostation-mobile" "^2.8.0" + "@cosmos-kit/cosmostation-extension" "^2.10.0" + "@cosmos-kit/cosmostation-mobile" "^2.9.0" -"@cosmos-kit/exodus-extension@^2.7.0": - version "2.7.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/exodus-extension/-/exodus-extension-2.7.0.tgz#305d63d2dc15b0d6229f3c46b2e52fa49e309d7d" - integrity sha512-9eN4kwVMQ77hAxD3bAkwKhLyOnK182B5LXfFlMoS2LEyEOY8hHtPha/ZPGKWoWZXq4uSUbEYXY1z29fj0ax1Hg== +"@cosmos-kit/exodus-extension@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/exodus-extension/-/exodus-extension-2.8.0.tgz#ecd3cee6a2e0164e6392a9943106a2ed429b6049" + integrity sha512-LeIHd8VMQaaXVqiMyeDwx2bgsl8sEqJ/GWQAUMNF16ZRs/u0zJAsMKf5B4lGTeJ1To9g4ZIuGXsjagPb2VZ8lg== dependencies: - "@cosmos-kit/core" "^2.10.0" + "@cosmos-kit/core" "^2.11.0" react-icons "4.4.0" -"@cosmos-kit/exodus@^2.7.0": - version "2.7.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/exodus/-/exodus-2.7.0.tgz#8cadccfdd10191ed6d31ba5aafaa6d5980f3c83f" - integrity sha512-3nj/42NaMRemqlr7NmIrpuZENld9NKd/6+aUIZfbCOD3Y7RzTppRjUHBmTHE8p+FXlZASTk+Cc2+670ze5SeOA== +"@cosmos-kit/exodus@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/exodus/-/exodus-2.8.0.tgz#707c02d2f451050d91f45803f6504926fbdd6809" + integrity sha512-fIWk23hpqFUzVHS4p9JN6yU57Gzo01/kIj3qDdokqKp5WQTSgYZQgWCkQ03J+Hb3A/NPdzAOYCBY3AqHOTbHzA== dependencies: - "@cosmos-kit/exodus-extension" "^2.7.0" + "@cosmos-kit/exodus-extension" "^2.8.0" -"@cosmos-kit/fin-extension@^2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/fin-extension/-/fin-extension-2.8.0.tgz#7470403c6b13415c0c28f139dc91fe692928a1a3" - integrity sha512-HpJBm9hvXUdBBPXkExtvn8dXBoqEJXNkFC6ktQ8oOmIawRv/sD8ay7ySParatSAyvgcrpmZ38UCWJW7SKcuosA== +"@cosmos-kit/fin-extension@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/fin-extension/-/fin-extension-2.9.0.tgz#0acce12bc87eb696801a4436d98590939e45c14e" + integrity sha512-Y8AtNdS2tcads6ha35FaASpj1u92yDfh3liSFxx9hLD5iXi+A3BWZxfVi/+20hs6909RHsHFvVvxZUSi5lYT4w== dependencies: - "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.10.0" + "@chain-registry/keplr" "1.64.4" + "@cosmos-kit/core" "^2.11.0" -"@cosmos-kit/fin@^2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/fin/-/fin-2.8.0.tgz#8f5f1cdcc39b49cc1e7df7a5fee1f9447a118935" - integrity sha512-9nu0HC+KUo/m2toGCCA6sHkUcdFh8o/T8som3HWzEzfuuLeuVyUZy30y0y4fcOXYT0DF7phaby8p7v0nTgPnmg== +"@cosmos-kit/fin@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/fin/-/fin-2.9.0.tgz#93d859d2b85f2c94d28ba930b79e1464839b8ca5" + integrity sha512-9P50Gv/Bx5LsIHwQIcm05r9BUGr7oKDUbgdWBgmFzmAm4nosfXMcLdYLfkK+nCW1ARMnzrfAQ6slmrPG1OlRjQ== dependencies: - "@cosmos-kit/fin-extension" "^2.8.0" + "@cosmos-kit/fin-extension" "^2.9.0" -"@cosmos-kit/frontier-extension@^2.7.0": - version "2.7.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/frontier-extension/-/frontier-extension-2.7.0.tgz#3038697fc17a135209f4c4aa7e1958c7c174ed44" - integrity sha512-TnBq41cEQ6bgRn3Jf7H/45Y/ulJdf1hHhXCaVLw8W//U+4cUB5Oq/T1U8+La1HLv3VbTIwKZRf/SR5HnrkhF/w== +"@cosmos-kit/frontier-extension@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/frontier-extension/-/frontier-extension-2.8.0.tgz#ee118b43d9680f06fc7545ed2f84389afaa4626d" + integrity sha512-TqfOxtgXJ1yYU6vCz3lzyONzK/wKoBQkRQgkSTyFaQzodwDO4Hf6m7azQcplQbIpZ/H9bjQY3XAust7k04RbqA== dependencies: - "@cosmos-kit/core" "^2.10.0" + "@cosmos-kit/core" "^2.11.0" -"@cosmos-kit/frontier@^2.7.0": - version "2.7.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/frontier/-/frontier-2.7.0.tgz#eee8c959f35d2725fce5d061d06d2e8ae99ed436" - integrity sha512-ouNG/oQZkbLvq9lhhQoHRkmAC1M3Dt/Cthfndlx2GPLGTqx/9mUbNU157tMu4AeSw7e5BDsYXgy0FTEHDWMs+A== +"@cosmos-kit/frontier@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/frontier/-/frontier-2.8.0.tgz#0ab27472c4ceee8ac01b37805646dd3bda37e609" + integrity sha512-aSuEQ4V0EejdU2r50WE1gDt5XHZ44KFqtKGAsiiFtwFGN2NreLoTl8mhwtHQXa68mlR+MCyfeQ6VAU17NNyj5A== dependencies: - "@cosmos-kit/frontier-extension" "^2.7.0" + "@cosmos-kit/frontier-extension" "^2.8.0" -"@cosmos-kit/keplr-extension@^2.9.0": +"@cosmos-kit/galaxy-station-extension@^2.9.0": version "2.9.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/keplr-extension/-/keplr-extension-2.9.0.tgz#a221e0aa2fed6d68ff8b2fb690909a689659bb40" - integrity sha512-95mDqZvkuDSep65wVs802MD83xTTIgjbMkV+VnX8GzLAK5dU4DRzklpK9ONlZopceVON6YEPLeGX4q33NXgbTA== + resolved "https://registry.yarnpkg.com/@cosmos-kit/galaxy-station-extension/-/galaxy-station-extension-2.9.0.tgz#db0401dc4f2148aea13c3217e71f4ec8745f1048" + integrity sha512-L4q+6FnjQ4Udcn7T4fF06SAHjpGo0rMH0Uvnfyyavbvcq1qQVbrYVLeNDJK/81HBRgM303TLOZqu690YaOexpg== dependencies: - "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.10.0" - "@keplr-wallet/types" "^0.12.58" + "@chain-registry/types" "0.41.3" + "@cosmos-kit/core" "^2.11.0" + "@hexxagon/feather.js" "^1.0.9-beta.8" + "@hexxagon/station-connector" "^1.0.17" -"@cosmos-kit/keplr-mobile@^2.8.0": +"@cosmos-kit/galaxy-station@^2.8.0": version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/keplr-mobile/-/keplr-mobile-2.8.0.tgz#8d2d0caa9caf6a752ce3c9212c9854e9fdcd5b03" - integrity sha512-d2JelVYMvihcN8TlRrObeFw7IZZeEgziM5nxTUjm3nqOYh9KjR+m/w2nIoTzxDxStsxWa8+DPTZ7a2MuEwLftg== + resolved "https://registry.yarnpkg.com/@cosmos-kit/galaxy-station/-/galaxy-station-2.8.0.tgz#28a638234ce300e1189929576d07d041c5ecb8c6" + integrity sha512-fEmUCbqXXqwDpo0yjqtRuPDC/Sgwja0RvPtcFeFu6TJQjHKOkk5FRF4R0ABZmFTt/UxPCL2IdXz02zyVxiE+2w== dependencies: - "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.10.0" - "@cosmos-kit/walletconnect" "^2.7.0" + "@cosmos-kit/galaxy-station-extension" "^2.9.0" -"@cosmos-kit/keplr@^2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/keplr/-/keplr-2.8.0.tgz#5a1a53b73a104a10b9ec255fdf452073f12f99fd" - integrity sha512-S+pQ2hKI8G0S+YvKwZGUyXdE0agu8Cb+kOdokXu/LXxNYgo5ESEAh3PbRnrKjps/2Wt0N5qXxNVNsSMi3i1Sjg== +"@cosmos-kit/keplr-extension@^2.10.0": + version "2.10.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/keplr-extension/-/keplr-extension-2.10.0.tgz#5254fc82c4fe5db90e48d032403bc79b380edadc" + integrity sha512-wBLPJOzyQUq72rHPdLjRFWQzQXc112AO7hUI76lI3JDbfJP4Hz/EJSinNygmYfIkyd3gKaudj7PjCYaK4tXcTA== dependencies: - "@cosmos-kit/keplr-extension" "^2.9.0" - "@cosmos-kit/keplr-mobile" "^2.8.0" + "@chain-registry/keplr" "1.64.4" + "@cosmos-kit/core" "^2.11.0" + "@keplr-wallet/types" "^0.12.90" -"@cosmos-kit/leap-extension@^2.9.0": +"@cosmos-kit/keplr-mobile@^2.9.0": version "2.9.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/leap-extension/-/leap-extension-2.9.0.tgz#7a2d2ac7c300bfbb64b2377d21135f7a5416ae06" - integrity sha512-a+FuMz+vPn9csGxSCNslWE6aTZOiDKjF8CogAgEM+xBKrLcMQ+x08eIKfVg9GdDEiLmW7p1VHBqAleZL3grn1w== + resolved "https://registry.yarnpkg.com/@cosmos-kit/keplr-mobile/-/keplr-mobile-2.9.0.tgz#c245022478e8905f1bcf2783b53f67762f04bce8" + integrity sha512-DshITBhM09plONkc21q93Cbv9kCqPC/34RN1x2r4jLsujhpaMW2lQpMJl3YQoXH+MtDSmnPc/1HsujJIlAajsw== dependencies: - "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.10.0" + "@chain-registry/keplr" "1.64.4" + "@cosmos-kit/core" "^2.11.0" + "@cosmos-kit/keplr-extension" "^2.10.0" + "@cosmos-kit/walletconnect" "^2.8.0" + "@keplr-wallet/wc-client" "0.12.90" -"@cosmos-kit/leap-metamask-cosmos-snap@^0.8.0": - version "0.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/leap-metamask-cosmos-snap/-/leap-metamask-cosmos-snap-0.8.0.tgz#7cb09373020b89ca90dd2a0961530dcc6f8ed9a6" - integrity sha512-fWLKnpuyROugsjdSQsIKaCTk6azVq4g0OiOtxgUFA8qNx7/lzu++k1yt86WdgRNOeJ5AV7EVBqGu/wR55QUxEg== +"@cosmos-kit/keplr@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/keplr/-/keplr-2.9.0.tgz#a6c723ba5cb074bb50f2fd171de346937d4d600d" + integrity sha512-6/w7QZwjrUWBAfa8U6N0dWUVISSyjNuRJc7vZdmtaKa2opIW71rrD8zHRe4Sebu/7dFIu36elB+mJDo6avShOQ== + dependencies: + "@cosmos-kit/keplr-extension" "^2.10.0" + "@cosmos-kit/keplr-mobile" "^2.9.0" + +"@cosmos-kit/leap-extension@^2.10.0": + version "2.10.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/leap-extension/-/leap-extension-2.10.0.tgz#305184780e0bbf4c1bd488799cfe50216d1632ca" + integrity sha512-EYTf8AiWwShJJlylnF9WrPf6z94F56xxjPR8GMINror9GtFnuU+0jqfSSGZaOFfe/HyFncLBy8g45131z/iRog== dependencies: - "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.10.0" - "@leapwallet/cosmos-snap-provider" "0.1.25" + "@chain-registry/keplr" "1.64.4" + "@cosmos-kit/core" "^2.11.0" + +"@cosmos-kit/leap-metamask-cosmos-snap@^0.9.0": + version "0.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/leap-metamask-cosmos-snap/-/leap-metamask-cosmos-snap-0.9.0.tgz#5bc4fb95f83bd3c8bfe1fb1f006b67c008ab84e4" + integrity sha512-vCVjrH76jV83XegSDwMdtAWTzxPmd3tozAQZ8+cOaD2QP/V10jGytdDFSZ0KZ+u0AIF/9yE5F4NWz/H4IuCzrw== + dependencies: + "@chain-registry/keplr" "1.64.4" + "@cosmos-kit/core" "^2.11.0" + "@leapwallet/cosmos-snap-provider" "0.1.26" "@metamask/providers" "^11.1.1" -"@cosmos-kit/leap-mobile@^2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/leap-mobile/-/leap-mobile-2.8.0.tgz#37fd328395c771030c0a62ee4e49cf9b15a85df0" - integrity sha512-OskIE4kqPYTKHmiwfKYm0fvk7PZYwjtn6G/AHhgt4a8T71I/xpgf0XvaxKqR3lNRuXWiIDWClQPBK9W7ETfvrg== +"@cosmos-kit/leap-mobile@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/leap-mobile/-/leap-mobile-2.9.0.tgz#b3e372c504c65a6d58f24359e34c987c728700e0" + integrity sha512-I5hGjZCPMTC26m+beYVkGzUdkiJAwM2+HT9njNgzEnqtxu3nW+GT1l/thBFbmVZVbxa4il7cqESB7VmekHF6bg== dependencies: - "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.10.0" - "@cosmos-kit/walletconnect" "^2.7.0" + "@chain-registry/keplr" "1.64.4" + "@cosmos-kit/core" "^2.11.0" + "@cosmos-kit/walletconnect" "^2.8.0" -"@cosmos-kit/leap@^2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/leap/-/leap-2.8.0.tgz#40a311775ab9c3387470cb2bbaaa2aca9ad0c6de" - integrity sha512-Lf2roaDgL+lAsWYLajS62e1CxhHgVQefGTOrgpb7AHfVxoGyZdAyul9JnuBnRmw0qt9SVU1ZWrEzLWNOBQYl2w== +"@cosmos-kit/leap@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/leap/-/leap-2.9.0.tgz#9cf74b422a8d964d2e6edec25484a9fde825f1db" + integrity sha512-xFakoMlMyIfkPbdXGw7+wYpjJfc+oxcW820KWyufyR4H6hugkjJhRYQWZW+Expqa89p3cel4dzFYrpIPBOdEeQ== dependencies: - "@cosmos-kit/leap-extension" "^2.9.0" - "@cosmos-kit/leap-metamask-cosmos-snap" "^0.8.0" - "@cosmos-kit/leap-mobile" "^2.8.0" + "@cosmos-kit/leap-extension" "^2.10.0" + "@cosmos-kit/leap-metamask-cosmos-snap" "^0.9.0" + "@cosmos-kit/leap-mobile" "^2.9.0" -"@cosmos-kit/ledger@^2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/ledger/-/ledger-2.8.0.tgz#069a5e3d854fcb85ec06498206668ee84b8b5f3c" - integrity sha512-rEPX229WQCmTspJRmXOPQq7lVyKyO9HROFCrVnx7idmbWOOYkGfFvGSWQROuMXbGaYPDD2QiCfywbg9xRItNDg== +"@cosmos-kit/ledger@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/ledger/-/ledger-2.9.0.tgz#71d9324c7419acdd22d2cb13d023436a6b67c91c" + integrity sha512-TAq4X2lko2zitToM5us1XwGw8v+4u2pQQdM8Rh5Km+p4JQxOjuPkS3jA1GHy+PaSnv5pDp5I4aPWWr78NLjzPA== dependencies: - "@cosmos-kit/core" "^2.10.0" + "@cosmos-kit/core" "^2.11.0" "@ledgerhq/hw-app-cosmos" "^6.28.1" "@ledgerhq/hw-transport-webhid" "^6.27.15" "@ledgerhq/hw-transport-webusb" "^6.27.15" -"@cosmos-kit/ninji-extension@^2.9.0": - version "2.9.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/ninji-extension/-/ninji-extension-2.9.0.tgz#88f91382bd6960ea1f34dc7e66e712422ca0c9a0" - integrity sha512-JhEAQ98H1Yxaac6voMeLuyJcqJwn3vDpEgQcyjfMzkKbm/IPLMyxlo7i1t/fpsANHjdGO7d+e9z/ku1SsKq8ng== +"@cosmos-kit/ninji-extension@^2.10.0": + version "2.10.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/ninji-extension/-/ninji-extension-2.10.0.tgz#c91085d4d0b8dea155168a1ef0f890621b846c64" + integrity sha512-emsS8PeBFdvrOyhr1+9vCfHXTsycG5BLCwT89wOSpI0d1+3vwf1/89ta/AFztuEklSod8Oo7eoHRDmW1lLpbtw== dependencies: - "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.10.0" + "@chain-registry/keplr" "1.64.4" + "@cosmos-kit/core" "^2.11.0" -"@cosmos-kit/ninji@^2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/ninji/-/ninji-2.8.0.tgz#f4934a56b290fb55553e0764f6db50aa1a2ab340" - integrity sha512-t9KGN0fak9vaPS1DnqJn3bzNA9EW0gSEaI5fVI7cCtju3AymZXqTk3PH6exCIBsb2us0BT9e27m0jwSsyIu6iQ== +"@cosmos-kit/ninji@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/ninji/-/ninji-2.9.0.tgz#6b0f83b228999ad5a76a4c6a25fa6c4c1334dfeb" + integrity sha512-jwa5HbzDMXnmbqzTTSik19crs562CdI3SXz1GUoS1QAdlVgZPA3FfcNDhZCUbFvRUX5loF4mHvtRkm2U6GY63A== dependencies: - "@cosmos-kit/ninji-extension" "^2.9.0" + "@cosmos-kit/ninji-extension" "^2.10.0" -"@cosmos-kit/okxwallet-extension@^2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/okxwallet-extension/-/okxwallet-extension-2.8.0.tgz#4e9b327302d5c07472272f6ec274a20706b5ed84" - integrity sha512-55R7SqcGQcvhLeVEFni2B5SURcHArh/xz8f+k3kXvPrzPou9SrOMbCn6qZMqibIhtC2z5jeB1b007Lx2Jc513Q== +"@cosmos-kit/okxwallet-extension@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/okxwallet-extension/-/okxwallet-extension-2.9.0.tgz#4f6925f073af8f326bfdbb806c2be2eae774aba3" + integrity sha512-Ny2GNJ1kefVU/yE3p/mggJEsK3K7lenuMx12EEcuuUDAq+O2mKT+mQLKHihYzavq3aeKXDOsJYR8DzCebXop3A== dependencies: - "@cosmos-kit/core" "^2.10.0" + "@cosmos-kit/core" "^2.11.0" -"@cosmos-kit/okxwallet@^2.6.0": - version "2.6.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/okxwallet/-/okxwallet-2.6.0.tgz#2edbe60e6e25caf3d74a779e3ef1dc380d8a60ac" - integrity sha512-W7EMJmO/OFrlIq5vQsjCxJtV2uCe23Jb9+YrUdFnpVyQZIaEZ0JfWKSMyMfD+yljux4hGE2XuCE/vThajs5aWA== +"@cosmos-kit/okxwallet@^2.7.0": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/okxwallet/-/okxwallet-2.7.0.tgz#9ba0322d88a01e00e9ca247bd339fbc87d4f9285" + integrity sha512-HIo20RSzP9EaJwuJLcD5hMjVybpxgVmyjJjL0D9xZKQ6FmwQoTufHZnSNk6qEhgyH3bZ3H/O+P3tOztP4b1t4g== dependencies: - "@cosmos-kit/okxwallet-extension" "^2.8.0" + "@cosmos-kit/okxwallet-extension" "^2.9.0" -"@cosmos-kit/omni-mobile@^2.7.0": - version "2.7.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/omni-mobile/-/omni-mobile-2.7.0.tgz#92d81e1a1d2b4cd09925006ed4a46d14a7b9ba7a" - integrity sha512-3L80PHRDreVj1f3tU5FRmlsemoE/YZbRIuZb5cBIfNLJXvkNhOEu3ZT6p+dONAcRbwWcvv+RRHjCD+rwd2slwA== +"@cosmos-kit/omni-mobile@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/omni-mobile/-/omni-mobile-2.8.0.tgz#755bcefef3de068b7778753cc781ebb8e4c61bfd" + integrity sha512-+K9yzqkAPKphVEG26YM8erzM97qeC2Vakl/TW21Qca0i2Mv4YX+2QNoS1TvedhLbKywySr8+GQxZ0CWqGRFZZg== dependencies: - "@cosmos-kit/core" "^2.10.0" - "@cosmos-kit/walletconnect" "^2.7.0" + "@cosmos-kit/core" "^2.11.0" + "@cosmos-kit/walletconnect" "^2.8.0" -"@cosmos-kit/omni@^2.7.0": - version "2.7.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/omni/-/omni-2.7.0.tgz#1c153667f72df0fa545729b9ecb3b6aa6aa5c5e7" - integrity sha512-eS8nnTaMuBLNUrI5M3rCFlzfMgPQWYnsBaMd1Nxl+q4CZN2ROBai1rtExWYrjJP1+g/G/NnWViRPDNZzhKPzvA== +"@cosmos-kit/omni@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/omni/-/omni-2.8.0.tgz#92049aa6e1264bc5672ce6a087b146f689019e53" + integrity sha512-0T1m259P/haO+EJW3dzAOxuT2wqSKJHXBz7QdcY9zoKOaN3UZCPtPHc/itnwrEE0eeXMzmsGSwW/mU3pM6z34g== dependencies: - "@cosmos-kit/omni-mobile" "^2.7.0" + "@cosmos-kit/omni-mobile" "^2.8.0" -"@cosmos-kit/owallet-extension@^2.9.0": - version "2.9.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/owallet-extension/-/owallet-extension-2.9.0.tgz#89d8049a148605ecb7a40e9597909397cb4ca854" - integrity sha512-eb69KS2IqqjnomuEmNiRoAkFm3P2/P2Fdov8KJf7k002QR5v2yfBdw3qDxzxTr4QmA0VDqlMV8wpO7cFxyWkdg== +"@cosmos-kit/owallet-extension@^2.10.0": + version "2.10.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/owallet-extension/-/owallet-extension-2.10.0.tgz#2d2cacabe9bbff22d1ae8b0dba695d9174f88b70" + integrity sha512-Fhl03HzM4rzvPyNMS0xipf1DN1vZmhszI3hTTdTXGL9F3BC0i/QE3v52cGZ94KYl/y5WlQ7agLAHSXmD+9Lf3w== dependencies: - "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.10.0" - "@keplr-wallet/types" "^0.12.58" + "@chain-registry/keplr" "1.64.4" + "@cosmos-kit/core" "^2.11.0" + "@keplr-wallet/types" "^0.12.90" -"@cosmos-kit/owallet@^2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/owallet/-/owallet-2.8.0.tgz#5cf780d5d5cf45f96f6ff937c02ead11624b77bf" - integrity sha512-1IRTYNYRVaLlC7/NLzJtnXdSJnK6MuCE6vH611iF08r2jU+hqdTgegCm/9Curee8oNRU6t6qAldj7H0Jdmv9KQ== +"@cosmos-kit/owallet@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/owallet/-/owallet-2.9.0.tgz#95b9f93295c3801af8414c7070cb41fb2e87c915" + integrity sha512-5fu6cblP8qcLlZHOUUovp4IVzEEZu2t815EMIknHSMf/XlU36ccljz6kTHdXt/M31Kp1isycx4Ujh0FFIOoP3Q== dependencies: - "@cosmos-kit/owallet-extension" "^2.9.0" + "@cosmos-kit/owallet-extension" "^2.10.0" -"@cosmos-kit/react-lite@^2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/react-lite/-/react-lite-2.8.0.tgz#ed1bc83e2fb9cfcf60dc7f5ad0f4466178d3104e" - integrity sha512-FSmnmpvVZ2It9Bjop+XX9c/U5emtDSn1VtA3+L+K0Ym5kxrO5udN6tLgCGpyHH+9VNkgO89EFhTuwfhNeKqhug== +"@cosmos-kit/react-lite@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/react-lite/-/react-lite-2.9.0.tgz#890fc99cba6aac2c570f5703ab502a061d1c4014" + integrity sha512-sjExfQRXrWtp74g2yIHCzqsaYGTb/CuDMonmX1bwrmfnetXjX+Yf4LAB2kR7lsU3/V6v8f/mA/izsy/mxmQaSw== dependencies: - "@cosmos-kit/core" "^2.10.0" + "@chain-registry/types" "^0.41.3" + "@cosmos-kit/core" "^2.11.0" "@dao-dao/cosmiframe" "^0.1.0" -"@cosmos-kit/shell-extension@^2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/shell-extension/-/shell-extension-2.8.0.tgz#24604063ed827ee2f12aa217f28d69141e9a201d" - integrity sha512-4gG6X1WLuVYzgiReNS964By9a+GfzVlkISUrIkDCS4fGW+24uaBZ0vSsxzVtYvTobb6e0zDM7/kEO60tE+XgnQ== +"@cosmos-kit/shell-extension@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/shell-extension/-/shell-extension-2.9.0.tgz#41619a8856cdaa1ed5377008906bb4a53d6181ee" + integrity sha512-RALw5U2tYQ8rRKMd3rkulw43FDWLBUZnQhfLBiqC6sdd9OEaEFHRl1R6IXa2U5a63ieeYqu3/VPPnrwpeKa7Rw== dependencies: - "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.10.0" + "@chain-registry/keplr" "1.64.4" + "@cosmos-kit/core" "^2.11.0" -"@cosmos-kit/shell@^2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/shell/-/shell-2.8.0.tgz#b2f6c678c6dd1cf34a28a535757a134cc856317a" - integrity sha512-5CB7TP5MKLv/mmFn8oA81OWwPireMwYEm68i67Q0Ufcb//Q1O5iDEA22IyubFbqzVPipq2BDDdfSYz0vWl3cjQ== +"@cosmos-kit/shell@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/shell/-/shell-2.9.0.tgz#bb0a5f6a7c825488a3d25a602084fcd235d49658" + integrity sha512-fYqYo+x6jrTsq+M4OMwBZaDGBjoKLgEBC759kognybX6uU1O7xlQkJDzZlX67D5GbHMOHn2+sJkcuygdh6sYuw== dependencies: - "@cosmos-kit/shell-extension" "^2.8.0" + "@cosmos-kit/shell-extension" "^2.9.0" -"@cosmos-kit/station-extension@^2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/station-extension/-/station-extension-2.8.0.tgz#18e7c4e55423435e8eb26f7c6948f86ecaa786b4" - integrity sha512-m7RNxGsBAta7/Jjzb1BqU35noZbb4ROaifOMvoQRqgpPiDGQQ9oIx8V4DscAmwcfbuOKjUBWnZYdcm0BU3o3Yg== +"@cosmos-kit/station-extension@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/station-extension/-/station-extension-2.9.0.tgz#0542bda69b1f3cfac08d69d300c845986410c4e6" + integrity sha512-3BMHNXt3X6/zLIA8l1N6IhViTaY/3WKdwG4y5P7ri6Zzo4OxRTuWfNIuNw0NBHgY/ATavjUOULIxp0h+lApd3A== dependencies: - "@cosmos-kit/core" "^2.10.0" + "@cosmos-kit/core" "^2.11.0" "@terra-money/feather.js" "^1.0.8" "@terra-money/station-connector" "^1.1.0" "@terra-money/wallet-types" "^3.11.2" -"@cosmos-kit/station@^2.7.0": - version "2.7.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/station/-/station-2.7.0.tgz#b2a3f8a1c40ad8b2b4393359d3338a547ed62d02" - integrity sha512-pBjePco/EVqqyVgy52wBHPLBOmLz3qhJCB+7nJJeXb7d3IrLtdfaxLWANFiLdgRdulV9i87s0rvLKkou8N9TNg== +"@cosmos-kit/station@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/station/-/station-2.8.0.tgz#1beb22bf09e47e05dd583cf38e1362f575b3d5f6" + integrity sha512-DSSi7H3g1QTmrjts9EUpMMFmdjVv57C4igJ8leTswgDHAwp0qw3R/6okZFuIYPpw9hlOIkLyxmXVY6+Ryr3lRg== dependencies: - "@cosmos-kit/station-extension" "^2.8.0" + "@cosmos-kit/station-extension" "^2.9.0" -"@cosmos-kit/tailwind-extension@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/tailwind-extension/-/tailwind-extension-1.2.0.tgz#2e40aa7486cb74c61eb2b53b7c12aa5ef53b5eb7" - integrity sha512-ogrc+Vznuz+xVHRswSC9Zh0dWVPrEeg0ZqkSr1WEnG2jzYRiMUbdGYoAB1FrdLg0+qdq10u5ZoXUfAdXh2DwZw== +"@cosmos-kit/tailwind-extension@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/tailwind-extension/-/tailwind-extension-1.3.0.tgz#ab4c19279f4d8a4b773cabd88bcd4b4f5d1b965a" + integrity sha512-vLkDjOsD6RsYQm0k9nnhXQoVkeQpACOTlpru23QQX6ZBj4DCf9hRKHkWvVX+znt9EUPRm4Fi6xWXvyxIWrs8LQ== dependencies: - "@cosmos-kit/core" "^2.10.0" + "@cosmos-kit/core" "^2.11.0" -"@cosmos-kit/tailwind@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/tailwind/-/tailwind-1.2.0.tgz#3bbf7f9c96f47a85936a045b5d567fd03fd2ed09" - integrity sha512-vhIMLUiZ3F0mfoHy++G4hMIqx08uNsUB0Ep3OvVIs2fyUwRM0lnGMRx3saq8HLitgYYBNgd0WVloH5PKhBkQEQ== +"@cosmos-kit/tailwind@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/tailwind/-/tailwind-1.3.0.tgz#d7d3a74669f0a01f1eedcf1d639f6e22a5f862be" + integrity sha512-p3RFU3ljm42CvpaUHg50JEL2Kt3G7GtgtnhMrB7oGaQxjqsp7XCc1xTXyr8g8ybDcy8+gBcuRgsH9XMHbS249A== dependencies: - "@cosmos-kit/tailwind-extension" "^1.2.0" + "@cosmos-kit/tailwind-extension" "^1.3.0" -"@cosmos-kit/trust-extension@^2.7.0": - version "2.7.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/trust-extension/-/trust-extension-2.7.0.tgz#e67a8023ba7511976f545dd56a00b6116e3e15ec" - integrity sha512-QLQKxoqz4UQpvkFGwZPPQyQmy5DyrocQlO6qZdT8p0SRWL4noJFisN44ikec6s5u4/9MioR1WPKWFHBdUNwRxQ== +"@cosmos-kit/trust-extension@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/trust-extension/-/trust-extension-2.8.0.tgz#114e9329be4e03f8d92c0a21fcf6e0848d66e9ac" + integrity sha512-5jIas0XwQK4ZHDf+CvbkDNh0q1TynzJKy6yctjv8fMFIXAPskgC/rrvBunmFwTo9zd13ylyu4N4PRM/1m7TNYA== dependencies: - "@cosmos-kit/core" "^2.10.0" + "@cosmos-kit/core" "^2.11.0" -"@cosmos-kit/trust-mobile@^2.7.0": - version "2.7.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/trust-mobile/-/trust-mobile-2.7.0.tgz#c8fc362800b4d979d89eec41b6f005a0becfa734" - integrity sha512-Z5E28Ce00iITomaB+2nBiQSaVNxN6G3TO1kHHmQUSy2UVOVyHoTZoQcu8aeH0ZL7qOtkvoE6XFcPXYiDms+7Pw== +"@cosmos-kit/trust-mobile@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/trust-mobile/-/trust-mobile-2.8.0.tgz#bd39aed4101a437da7712dcb9556d41ea15c6886" + integrity sha512-gHU8dhwDGxGShNsEnvkas0qEhjvK7KkyoBoLwHS4WYtZETJSd77rrxJ3+AfEm/haLYgOpLTPc4mFqpiFfFYMmQ== dependencies: - "@cosmos-kit/core" "^2.10.0" - "@cosmos-kit/walletconnect" "^2.7.0" + "@cosmos-kit/core" "^2.11.0" + "@cosmos-kit/walletconnect" "^2.8.0" -"@cosmos-kit/trust@^2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/trust/-/trust-2.8.0.tgz#be158bd3a9d7a6bc141d4f80ed0843b02190664a" - integrity sha512-eAdXGG2Ab9FT1vHynI9SWDJ/MzVLuojbAzJ2QQvI4rY15aTqNoWY2XVQSxYsb4lUqF49cprMg3A66p88NTCaWQ== +"@cosmos-kit/trust@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/trust/-/trust-2.9.0.tgz#38e4fe6ed03d3d71eafc2515d4555256422471f2" + integrity sha512-3K2HUtG97w7/9qPVev07roHd78G/xK+3c0Yz0YQVrQ8FezSv22usKUAaE0QDu6icptlSKLZ7a52fgrcPRuQPvA== dependencies: - "@cosmos-kit/trust-extension" "^2.7.0" - "@cosmos-kit/trust-mobile" "^2.7.0" + "@cosmos-kit/trust-extension" "^2.8.0" + "@cosmos-kit/trust-mobile" "^2.8.0" -"@cosmos-kit/vectis-extension@^2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/vectis-extension/-/vectis-extension-2.8.0.tgz#a1fa0488aecd5a13b45a59f74889fc5494e26b3d" - integrity sha512-rUB9+bDF/Qz2hzzMuleRBMe8gaSl044MYKNRZaFk7ibdQZtPkNyOdND0EqqJt4GIywj6Of93BvVWA46KSZ75zA== +"@cosmos-kit/vectis-extension@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/vectis-extension/-/vectis-extension-2.9.0.tgz#eeb935d6075739c9f22eb1e45ef1cce4c573d3b6" + integrity sha512-a32psXN+mQ2UncKWmeBi7hLJUCLhEsxhnmLzWg/V/I/L0qY9bQ+tUX8kalr3yk3WTTKZrFtp4eP5aJyNDKkz4g== dependencies: - "@chain-registry/keplr" "1.28.0" - "@cosmos-kit/core" "^2.10.0" + "@chain-registry/keplr" "1.64.4" + "@cosmos-kit/core" "^2.11.0" -"@cosmos-kit/vectis@^2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/vectis/-/vectis-2.8.0.tgz#813f736370af80a5b85a5e06dce4c7842c740716" - integrity sha512-NDvirIOolkOYCAlHvh6yXt+/FXC/5bxclYhd6227Fl8jQDsheNCpk0V3/J6cRRrpb8yg38HIePTbC9U5ggfYpA== +"@cosmos-kit/vectis@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/vectis/-/vectis-2.9.0.tgz#3e24ebf87e52a4a8b9ed734c97d3133bbe843942" + integrity sha512-EQfFch8awsl0aVU2fpYHS5PPdZ4PLWig3eh98nodpmawgUmS9oUbzfN/G9yO6MIv3q2HQEOKmO34YKwE580rLA== dependencies: - "@cosmos-kit/vectis-extension" "^2.8.0" + "@cosmos-kit/vectis-extension" "^2.9.0" -"@cosmos-kit/walletconnect@^2.7.0": - version "2.7.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/walletconnect/-/walletconnect-2.7.0.tgz#43087dccefb7d3db5b2410ef24fe12f125a84f4e" - integrity sha512-LhAuBt1zPxsC9TSp2GSd8Mtx9X9Id1S5c54m4SSzEWIxk78rb1dZGLrXCEjaO1nlh8Bz9MijJDCOhaN6NuBZeA== +"@cosmos-kit/walletconnect@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/walletconnect/-/walletconnect-2.8.0.tgz#46b3f3cbb56ef92617eecd07411fda3f6541826a" + integrity sha512-HNWO4wkMjvT0+34AtlDJ1FvhB6fs9UWBJOs6ltsi/O43irFnyWNzf21s3mBuDJbPslXAKQOtAYJ2ws6WJ99v3Q== dependencies: "@cosmjs/proto-signing" "^0.32.3" - "@cosmos-kit/core" "^2.10.0" + "@cosmos-kit/core" "^2.11.0" "@walletconnect/sign-client" "^2.9.0" "@walletconnect/utils" "^2.9.0" events "3.3.0" -"@cosmos-kit/web3auth@^2.7.0": - version "2.7.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/web3auth/-/web3auth-2.7.0.tgz#3c19be136a4cc70b2abfe5faf21b6f5417550d85" - integrity sha512-IXOQr/Pafx4qYFL8I3hc6mPCGuEUIPZtG8uMX+WtArA76tHahPQbgfvyRW5hfiwhSvfmwk+taodNjv40+/RXJQ== +"@cosmos-kit/web3auth@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/web3auth/-/web3auth-2.8.0.tgz#6027fb91eedbf8fb8e51ce522c68c77e833ccbbc" + integrity sha512-/NZvXR9I86zLufLWiztFERNtcxc3DGHCdvP41+rBFI1MGuQPQYlQ72PuwlLlXbUoEZe/w6SrPJpdM6ny/5fj+Q== dependencies: - "@cosmos-kit/core" "^2.10.0" + "@cosmos-kit/core" "^2.11.0" "@solana/web3.js" "^1.77.3" "@toruslabs/eccrypto" "^2.1.1" "@web3auth/base" "^7.2.1" @@ -2797,19 +2749,19 @@ ethereum-cryptography "^2.1.2" url "^0.11.1" -"@cosmos-kit/xdefi-extension@^2.8.0": - version "2.8.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/xdefi-extension/-/xdefi-extension-2.8.0.tgz#ae1b7b7f621191a091a41dde6d0cf6ab14a6e366" - integrity sha512-NFia6S2HlD4/fMxhN/p72OysKj9w2Cocdkjhz28L+A6LeiYd8mcuS3NRDBrb99jZvZzte0Gr2EPlOvvdZtSOqw== +"@cosmos-kit/xdefi-extension@^2.9.0": + version "2.9.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/xdefi-extension/-/xdefi-extension-2.9.0.tgz#a8092d4911cf0f45c044890ae3b294016420bbb8" + integrity sha512-8MOLcTcqqoM0PgbKkZbu4CcGHP77EpF8JMOziiTW0zc7H2Oc2bneTqhUk9IT96GKvzscYM3Umtd4XWTEuGq5qA== dependencies: - "@cosmos-kit/core" "^2.10.0" + "@cosmos-kit/core" "^2.11.0" -"@cosmos-kit/xdefi@^2.7.0": - version "2.7.0" - resolved "https://registry.yarnpkg.com/@cosmos-kit/xdefi/-/xdefi-2.7.0.tgz#fdf3e00958535764aa8b65c358c9b08fde3606b4" - integrity sha512-4sMuasxJkttfVXXdhYX/mFFNI1koWZSVzXKkQu3aLj4x+lItgNMtWagFTf2Svi85lGjVSpefad6PonuHD8HBiw== +"@cosmos-kit/xdefi@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@cosmos-kit/xdefi/-/xdefi-2.8.0.tgz#b760ff7631bf67199db2293ef9d4c5785baa67d7" + integrity sha512-BiFOAqe0rJRCvpfVgx8fx2ZhXJqyAzSxJQEBgC84S9cv55ZZ33LUsionpUHI9FVZTr+vCHWlLaeVSOA4v0pnMg== dependencies: - "@cosmos-kit/xdefi-extension" "^2.8.0" + "@cosmos-kit/xdefi-extension" "^2.9.0" "@cosmostation/extension-client@0.1.15": version "0.1.15" @@ -3912,6 +3864,34 @@ resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.2.0.tgz#5f3d96ec6b2354ad6d8a28bf216a1d97b5426861" integrity sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ== +"@hexxagon/feather.js@^1.0.9-beta.8": + version "1.0.9-beta.8" + resolved "https://registry.yarnpkg.com/@hexxagon/feather.js/-/feather.js-1.0.9-beta.8.tgz#c0a67624f845a0da91232de2afe3c274b2a527e4" + integrity sha512-jkwwZOKGlEj72eAXO4dsLsMy8ySQJppnVMVIqyfFJuZ8w3uLe3yzS9cztv+A/pA8dcrrxf9ekXaFTA2J/FImxg== + dependencies: + "@classic-terra/terra.proto" "^1.1.0" + "@terra-money/legacy.proto" "npm:@terra-money/terra.proto@^0.1.7" + "@terra-money/terra.proto" "3.0.5" + axios "^0.27.2" + bech32 "^2.0.0" + bip32 "^2.0.6" + bip39 "^3.0.3" + bufferutil "^4.0.3" + decimal.js "^10.2.1" + jscrypto "^1.0.1" + readable-stream "^3.6.0" + secp256k1 "^4.0.2" + tmp "^0.2.1" + utf-8-validate "^5.0.5" + ws "^7.5.9" + +"@hexxagon/station-connector@^1.0.17": + version "1.0.17" + resolved "https://registry.yarnpkg.com/@hexxagon/station-connector/-/station-connector-1.0.17.tgz#59734345a2c84437622e6f100a9498f8d99bd470" + integrity sha512-VrwCSHUvLtJB93vyJeY1qI6zrDQC7RsxCylYMTU3QL7IJEAOVOdHkj29UmW+HdfrgiVnJhZx9yKuc/582DSZYw== + dependencies: + bech32 "^2.0.0" + "@humanwhocodes/config-array@^0.10.4": version "0.10.4" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.10.4.tgz#01e7366e57d2ad104feea63e72248f22015c520c" @@ -4434,6 +4414,17 @@ long "^4.0.0" protobufjs "^6.11.2" +"@keplr-wallet/provider@0.12.90": + version "0.12.90" + resolved "https://registry.yarnpkg.com/@keplr-wallet/provider/-/provider-0.12.90.tgz#987825f6d7aed4c71d8b92760c0df2be91110462" + integrity sha512-4x0VFDjsSTIDd8ovvSTvQ7eLJQ4Q0eYLUWyDGhY3ircH8jgCal0J5vkG8lemddZrMq/KmKlaRppbfNPO5oiBXA== + dependencies: + "@keplr-wallet/router" "0.12.90" + "@keplr-wallet/types" "0.12.90" + buffer "^6.0.3" + deepmerge "^4.2.2" + long "^4.0.0" + "@keplr-wallet/provider@^0.11.49": version "0.11.49" resolved "https://registry.yarnpkg.com/@keplr-wallet/provider/-/provider-0.11.49.tgz#f9dd57b141ad69d211aed65d8a0d1ffde09b7a57" @@ -4450,6 +4441,11 @@ resolved "https://registry.yarnpkg.com/@keplr-wallet/router/-/router-0.11.49.tgz#ee99612ecdd8aac88d0a70cdc1084e4e3899aab5" integrity sha512-MrdMVJPMXaOJ+PRKRSW7zjIvwxFuTFWgYUV4Urj4ZJGBwgZtJA8tVP3dZk+F6mR1Jw8zbAvzBscI3UsLIgtswQ== +"@keplr-wallet/router@0.12.90": + version "0.12.90" + resolved "https://registry.yarnpkg.com/@keplr-wallet/router/-/router-0.12.90.tgz#458d63de4168ef6933237007c14c2f655190a636" + integrity sha512-iYCrtqJIznMCJOQL6J2ra93u1ophLf2txFRvT1E8FCxWd0JVyH49Q6CSD6n0vuQY/aq7tWLeUo+5qRKmXwl6BQ== + "@keplr-wallet/simple-fetch@0.12.28": version "0.12.28" resolved "https://registry.yarnpkg.com/@keplr-wallet/simple-fetch/-/simple-fetch-0.12.28.tgz#44225df5b329c823076280df1ec9930a21b1373e" @@ -4477,6 +4473,13 @@ dependencies: long "^4.0.0" +"@keplr-wallet/types@0.12.90", "@keplr-wallet/types@^0.12.90": + version "0.12.90" + resolved "https://registry.yarnpkg.com/@keplr-wallet/types/-/types-0.12.90.tgz#57fa70034bcd9b5354ed4d2656ce5b2a5390b36b" + integrity sha512-MxWJOPMPDQbmy48aTepFzaDOrO70wYft6Ng1M32lS0PTO5NzmRuwCJ/WVbWcfQkAzHVq0xw7Du5Jks1MEMkBLQ== + dependencies: + long "^4.0.0" + "@keplr-wallet/types@^0.11.49": version "0.11.64" resolved "https://registry.yarnpkg.com/@keplr-wallet/types/-/types-0.11.64.tgz#5a308c8c019b4e18f894e0f35f0904b60134d605" @@ -4485,13 +4488,6 @@ axios "^0.27.2" long "^4.0.0" -"@keplr-wallet/types@^0.12.58": - version "0.12.83" - resolved "https://registry.yarnpkg.com/@keplr-wallet/types/-/types-0.12.83.tgz#abab7faf9983d4200e50465b8c55bce8342f14ae" - integrity sha512-fb+Ns52EXZ+iJXwfGAJLn4MLkALuIhVv+V0ed/twzv0LqJlPYvQTeW5e/ZFRO/1UBE3T56vLQdqwvvxbuBFeUQ== - dependencies: - long "^4.0.0" - "@keplr-wallet/unit@0.11.49": version "0.11.49" resolved "https://registry.yarnpkg.com/@keplr-wallet/unit/-/unit-0.11.49.tgz#af9ac1c55a3aa7e06a68566fe232ddb5b334d54b" @@ -4510,18 +4506,29 @@ big-integer "^1.6.48" utility-types "^3.10.0" +"@keplr-wallet/wc-client@0.12.90": + version "0.12.90" + resolved "https://registry.yarnpkg.com/@keplr-wallet/wc-client/-/wc-client-0.12.90.tgz#40852d5c09f566e495e7e76e0c01911a28946f20" + integrity sha512-5az2EIqfZLlBaCXW3ZyeOcwATELgdFKEkKG6MCoZK5WxWeNWiPKLc0379HGrCtkfprzXpZNvNY89ZjoWT2ZzOg== + dependencies: + "@keplr-wallet/provider" "0.12.90" + "@keplr-wallet/types" "0.12.90" + buffer "^6.0.3" + deepmerge "^4.2.2" + long "^3 || ^4 || ^5" + "@kurkle/color@^0.3.0": version "0.3.2" resolved "https://registry.yarnpkg.com/@kurkle/color/-/color-0.3.2.tgz#5acd38242e8bde4f9986e7913c8fdf49d3aa199f" integrity sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw== -"@leapwallet/cosmos-snap-provider@0.1.25": - version "0.1.25" - resolved "https://registry.yarnpkg.com/@leapwallet/cosmos-snap-provider/-/cosmos-snap-provider-0.1.25.tgz#f256cd4c7ef89aa9209ed8dbaf16487db24bde10" - integrity sha512-oov2jgISkvoAYvGsWkPscFt/XEEv1McTehTqJRfIJPO8uebIE6goJi4wjaaMW3wDIDsMMK54uGSdqbL6C8ciYQ== +"@leapwallet/cosmos-snap-provider@0.1.26": + version "0.1.26" + resolved "https://registry.yarnpkg.com/@leapwallet/cosmos-snap-provider/-/cosmos-snap-provider-0.1.26.tgz#023f9c0f1f9fb4ae1497256d6356ef38a865e9d9" + integrity sha512-KqT4OTECINPZohosLkAzdYotzV5YYJwzg2r/GKKMv3ndIuiqom/9WCaEs9W3KzPaRe69rOZpjbFmcu0gB4PSww== dependencies: - "@cosmjs/amino" "^0.31.0" - "@cosmjs/proto-signing" "^0.31.0" + "@cosmjs/amino" "^0.32.0" + "@cosmjs/proto-signing" "^0.32.0" bignumber.js "^9.1.2" long "^5.2.3" @@ -7781,6 +7788,16 @@ dependencies: bech32 "^2.0.0" +"@terra-money/terra.proto@3.0.5": + version "3.0.5" + resolved "https://registry.yarnpkg.com/@terra-money/terra.proto/-/terra.proto-3.0.5.tgz#96f17410a044459412491959b615c52faa2eb338" + integrity sha512-8tvT41qte2mpiNoHq2dMmV7soMxwf4ckuJ+F2pMrb7iVcqaBo30/dIfyTdFm5mEH5i5P6cTJggm+UlIZBSPhwQ== + dependencies: + "@improbable-eng/grpc-web" "^0.14.1" + google-protobuf "^3.17.3" + long "^4.0.0" + protobufjs "~6.11.2" + "@terra-money/terra.proto@^4.0.3": version "4.0.10" resolved "https://registry.yarnpkg.com/@terra-money/terra.proto/-/terra.proto-4.0.10.tgz#a5c5edce2f4a4eab046bf740edde871874443d10" @@ -10539,12 +10556,7 @@ bigint-buffer@^1.1.5: dependencies: bindings "^1.3.0" -bignumber.js@9.1.1: - version "9.1.1" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.1.tgz#c4df7dc496bd849d4c9464344c1aa74228b4dac6" - integrity sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig== - -bignumber.js@^9.1.2: +bignumber.js@9.1.2, bignumber.js@^9.1.2: version "9.1.2" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.2.tgz#b7c4242259c008903b13707983b5f4bbd31eda0c" integrity sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug== @@ -11157,12 +11169,12 @@ ccount@^2.0.0: resolved "https://registry.yarnpkg.com/ccount/-/ccount-2.0.1.tgz#17a3bf82302e0870d6da43a01311a8bc02a3ecf5" integrity sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg== -chain-registry@^1.46.8: - version "1.46.8" - resolved "https://registry.yarnpkg.com/chain-registry/-/chain-registry-1.46.8.tgz#63d8e2c9ba2466ad4cec02bc734f93020cbbeb76" - integrity sha512-84+6NkPVKDfbfoyQjX+BdZ3roizmyt7yGQmTIIbj2WjgV2lEZyregaAeaU8RUhbEwCsEClhUCL7Oa5p6DRgJRQ== +chain-registry@^1.59.4: + version "1.59.4" + resolved "https://registry.yarnpkg.com/chain-registry/-/chain-registry-1.59.4.tgz#dec12fcfe28a25066345ede5b53ffb146b206d7a" + integrity sha512-qx//X1DGIaSGH5SP7643C6bIjb3a3nmvVBZPRSZUl2Qq0A1e2WWsfBUVT+spcJGh51tWlIj7m7oGNKxpXVgFLg== dependencies: - "@chain-registry/types" "^0.28.12" + "@chain-registry/types" "^0.41.3" chalk@3.0.0: version "3.0.0" @@ -12076,14 +12088,6 @@ cosmjs-types@>=0.9.0, cosmjs-types@^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" - resolved "https://registry.yarnpkg.com/cosmjs-types/-/cosmjs-types-0.8.0.tgz#2ed78f3e990f770229726f95f3ef5bf9e2b6859b" - integrity sha512-Q2Mj95Fl0PYMWEhA2LuGEIhipF7mQwd9gTQ85DdP9jjjopeoGaDxvmPa5nakNzsq7FnO1DMTatXTAx6bxMH7Lg== - dependencies: - long "^4.0.0" - protobufjs "~6.11.2" - cp-file@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/cp-file/-/cp-file-7.0.0.tgz#b9454cfd07fe3b974ab9ea0e5f29655791a9b8cd" @@ -17746,16 +17750,16 @@ loglevel@^1.8.1, loglevel@^1.9.1: resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.9.1.tgz#d63976ac9bcd03c7c873116d41c2a85bafff1be7" integrity sha512-hP3I3kCrDIMuRwAwHltphhDM1r8i55H33GgqjXbrisuJhF4kRhW1dNuxsRklp4bXl8DSdLaNLuiL4A/LWRfxvg== +"long@^3 || ^4 || ^5", long@^5.2.0, long@^5.2.1, long@^5.2.3: + version "5.2.3" + resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1" + integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q== + long@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== -long@^5.2.0, long@^5.2.1, long@^5.2.3: - version "5.2.3" - resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1" - integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q== - longest-streak@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-3.1.0.tgz#62fa67cd958742a1574af9f39866364102d90cd4" @@ -19073,6 +19077,15 @@ no-case@^3.0.4: lower-case "^2.0.2" tslib "^2.0.3" +nock@13.5.4: + version "13.5.4" + resolved "https://registry.yarnpkg.com/nock/-/nock-13.5.4.tgz#8918f0addc70a63736170fef7106a9721e0dc479" + integrity sha512-yAyTfdeNJGGBFxWdzSKCBYxs5FxLbCg5X5Q4ets974hcQzG1+qCxvIyOo4j2Ry6MUlhWVMX4OoYDefAIIwupjw== + dependencies: + debug "^4.1.0" + json-stringify-safe "^5.0.1" + propagate "^2.0.0" + node-abi@^3.3.0: version "3.22.0" resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.22.0.tgz#00b8250e86a0816576258227edbce7bbe0039362" @@ -20750,6 +20763,11 @@ prop-types@^15.0.0, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: object-assign "^4.1.1" react-is "^16.13.1" +propagate@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/propagate/-/propagate-2.0.1.tgz#40cdedab18085c792334e64f0ac17256d38f9a45" + integrity sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag== + property-information@^5.0.0, property-information@^5.3.0: version "5.6.0" resolved "https://registry.yarnpkg.com/property-information/-/property-information-5.6.0.tgz#61675545fb23002f245c6540ec46077d4da3ed69" From bb9831d5f89d376565afdc1d1f31254aa031627c Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 22 May 2024 12:02:38 -0400 Subject: [PATCH 178/438] auto-load stargaze NFTs across all accounts --- .../recoil/selectors/contracts/DaoCore.v2.ts | 135 +++++++++++------- packages/state/recoil/selectors/nft.ts | 122 +++++++++++++++- packages/stateful/recoil/selectors/nft.ts | 110 ++------------ 3 files changed, 213 insertions(+), 154 deletions(-) diff --git a/packages/state/recoil/selectors/contracts/DaoCore.v2.ts b/packages/state/recoil/selectors/contracts/DaoCore.v2.ts index 79c73c2e5..80df9abfe 100644 --- a/packages/state/recoil/selectors/contracts/DaoCore.v2.ts +++ b/packages/state/recoil/selectors/contracts/DaoCore.v2.ts @@ -1,3 +1,4 @@ +import uniq from 'lodash.uniq' import { constSelector, selectorFamily, @@ -8,6 +9,7 @@ import { import { AccountType, + ChainId, GenericTokenBalance, GenericTokenBalanceWithOwner, IndexerDumpState, @@ -38,6 +40,7 @@ import { } from '@dao-dao/types/contracts/DaoCore.v2' import { CW721_WORKAROUND_ITEM_KEY_PREFIX, + MAINNET, POLYTONE_CW20_ITEM_KEY_PREFIX, POLYTONE_CW721_ITEM_KEY_PREFIX, getAccount, @@ -70,6 +73,7 @@ import { isPolytoneProxySelector, } from '../contract' import { queryContractIndexerSelector } from '../indexer' +import { walletStargazeNftCardInfosSelector } from '../nft' import { genericTokenSelector } from '../token' import * as Cw20BaseSelectors from './Cw20Base' @@ -935,23 +939,17 @@ export const allNativeCw721TokenListSelector = selectorFamily< }, }) -// Get all cw721 collections stored in the items list for polytone proxies -// across all chains. -export const allPolytoneCw721CollectionsSelector = selectorFamily< - Record< - string, - { - proxy: string - collectionAddresses: string[] - } - >, +// Get all cw721 collections stored in the items list across all chains. This +// used to be specific to polytone but is now generic. Map chain ID to list of +// collection addresses. +export const allCrossChainCw721CollectionsSelector = selectorFamily< + Record, QueryClientParams >({ - key: 'daoCoreV2AllPolytoneCw721Collections', + key: 'daoCoreV2AllCrossChainCw721Collections', get: (queryClientParams) => ({ get }) => { - const polytoneProxies = get(polytoneProxiesSelector(queryClientParams)) const polytoneCw721Keys = get( listAllItemsWithPrefixSelector({ ...queryClientParams, @@ -959,45 +957,27 @@ export const allPolytoneCw721CollectionsSelector = selectorFamily< }) ) - const collectionsByChain = polytoneCw721Keys.reduce( - (acc, [key]) => { - const [chainId, collectionAddress] = key.split(':') - // If no polytone proxy for this chain, skip it. This should only - // happen if a key is manually set for a chain that does not have a - // polytone proxy. - if (!(chainId in polytoneProxies)) { - return acc - } + const collectionsByChain = polytoneCw721Keys.reduce((acc, [key]) => { + const [chainId, collectionAddress] = key.split(':') - if (!acc[chainId]) { - acc[chainId] = { - proxy: polytoneProxies[chainId], - collectionAddresses: [], - } - } - acc[chainId].collectionAddresses.push(collectionAddress) + if (!acc[chainId]) { + acc[chainId] = [] + } + acc[chainId].push(collectionAddress) - return acc - }, - {} as Record< - string, - { - proxy: string - collectionAddresses: string[] - } - > - ) + return acc + }, {} as Record) return collectionsByChain }, }) -// Combine native and polytone NFT collections. +// Combine native and cross-chain NFT collections. export const allCw721CollectionsSelector = selectorFamily< Record< string, { - owner: string + owners: string[] collectionAddresses: string[] } >, @@ -1009,37 +989,82 @@ export const allCw721CollectionsSelector = selectorFamily< get: (queryClientParams) => ({ get }) => { + const accounts = get( + accountsSelector({ + chainId: queryClientParams.chainId, + address: queryClientParams.contractAddress, + }) + ) + + // Get NFTs on DAO's chain. const nativeCw721TokenList = get( allNativeCw721TokenListSelector(queryClientParams) ) - const polytoneCw721Collections = get( - allPolytoneCw721CollectionsSelector(queryClientParams) + + // Get NFTs for DAO's cross-chain accounts. + const crossChainCw721Collections = get( + allCrossChainCw721CollectionsSelector(queryClientParams) ) + // Get NFTs from Stargaze's API. + const stargazeChainId = MAINNET + ? ChainId.StargazeMainnet + : ChainId.StargazeTestnet + const stargazeAccounts = accounts.filter( + (a) => a.chainId === stargazeChainId + ) + const allStargazeNfts = stargazeAccounts.length + ? get( + waitForAll( + stargazeAccounts.map(({ address }) => + walletStargazeNftCardInfosSelector(address) + ) + ) + ).flat() + : [] + // Start with native NFTs. let allNfts: Record< string, { - owner: string + owners: string[] collectionAddresses: string[] } > = { [queryClientParams.chainId]: { - owner: queryClientParams.contractAddress, + owners: accounts + .filter((a) => a.type === AccountType.Native) + .map((a) => a.address), collectionAddresses: nativeCw721TokenList, }, } - // Add polytone NFTs. - Object.entries(polytoneCw721Collections).forEach( - ([chainId, { proxy, collectionAddresses }]) => { + // Add cross-chain NFTs. + Object.entries(crossChainCw721Collections).forEach( + ([chainId, collectionAddresses]) => { allNfts[chainId] = { - owner: proxy, + owners: accounts + .filter((a) => a.chainId === chainId) + .map((a) => a.address), collectionAddresses, } } ) + // Add Stargaze NFTs. + if (allStargazeNfts.length) { + allNfts[stargazeChainId] = { + owners: uniq([ + ...(allNfts[stargazeChainId]?.owners || []), + ...stargazeAccounts.map((a) => a.address), + ]), + collectionAddresses: uniq([ + ...(allNfts[stargazeChainId]?.collectionAddresses || []), + ...allStargazeNfts.map((n) => n.collectionAddress), + ]), + } + } + return allNfts }, }) @@ -1062,12 +1087,14 @@ export const allCw721CollectionsWithDaoAsMinterSelector = selectorFamily< // list of each collection. const collections = Object.entries( get(allCw721CollectionsSelector(queryClientParams)) - ).flatMap(([chainId, { owner, collectionAddresses }]) => - collectionAddresses.map((collectionAddress) => ({ - owner, - collectionAddress, - chainId, - })) + ).flatMap(([chainId, { owners, collectionAddresses }]) => + collectionAddresses.flatMap((collectionAddress) => + owners.map((owner) => ({ + owner, + collectionAddress, + chainId, + })) + ) ) // Get the minter for each collection. diff --git a/packages/state/recoil/selectors/nft.ts b/packages/state/recoil/selectors/nft.ts index 2eb7c1c7b..15c140671 100644 --- a/packages/state/recoil/selectors/nft.ts +++ b/packages/state/recoil/selectors/nft.ts @@ -1,10 +1,27 @@ import { selectorFamily, waitForAll } from 'recoil' -import { ChainId, NftUriData, WithChainId } from '@dao-dao/types' -import { transformIpfsUrlToHttpsIfNecessary } from '@dao-dao/utils' +import { + ChainId, + GenericToken, + NftCardInfo, + NftUriData, + TokenType, + WithChainId, +} from '@dao-dao/types' +import { + MAINNET, + nftCardInfoFromStargazeIndexerNft, + transformIpfsUrlToHttpsIfNecessary, +} from '@dao-dao/utils' +import { + stargazeIndexerClient, + stargazeTokensForOwnerQuery, +} from '../../graphql' +import { refreshWalletStargazeNftsAtom } from '../atoms' import { accountsSelector } from './account' import { stargazeWalletUsdValueSelector } from './stargaze' +import { genericTokenSelector } from './token' // Tries to parse [EIP-721] metadata out of an NFT's metadata JSON. // @@ -114,3 +131,104 @@ export const allNftUsdValueSelector = selectorFamily< const HostnameMap: Record = { 'stargaze.zone': 'Stargaze', } + +const STARGAZE_INDEXER_TOKENS_LIMIT = 100 +export const walletStargazeNftCardInfosSelector = selectorFamily< + NftCardInfo[], + string +>({ + key: 'walletStargazeNftCardInfos', + get: + (walletAddress: string) => + async ({ get }) => { + const chainId = MAINNET + ? ChainId.StargazeMainnet + : ChainId.StargazeTestnet + const timestamp = new Date() + + get(refreshWalletStargazeNftsAtom(walletAddress)) + + const allStargazeTokens: { + tokenId: string + name?: string | null + description?: string | null + collection: { + contractAddress: string + name?: string | null + } + highestOffer?: { + offerPrice?: { + amount?: number | null + amountUsd?: number | null + denom?: string | null + } | null + } | null + media?: { + url?: string | null + visualAssets?: { + lg?: { url?: string | null } | null + } | null + } | null + }[] = [] + while (true) { + const { error, data } = await stargazeIndexerClient.query({ + query: stargazeTokensForOwnerQuery, + variables: { + ownerAddrOrName: walletAddress, + limit: STARGAZE_INDEXER_TOKENS_LIMIT, + offset: allStargazeTokens.length, + }, + // Don't cache since this recoil selector handles caching. If this + // selector is re-evaluated, it should be re-fetched since an NFT may + // have changed ownership. + fetchPolicy: 'no-cache', + }) + + if (error) { + throw error + } + + if (!data.tokens?.tokens?.length) { + break + } + + allStargazeTokens.push(...data.tokens.tokens) + + if ( + data.tokens.pageInfo && + allStargazeTokens.length === data.tokens.pageInfo.total + ) { + break + } + } + + const genericTokens = get( + waitForAll( + allStargazeTokens.flatMap((token) => + token.highestOffer?.offerPrice?.denom + ? genericTokenSelector({ + chainId, + type: TokenType.Native, + denomOrAddress: token.highestOffer!.offerPrice!.denom!, + }) + : [] + ) + ) + ) + + const genericTokensMap: Map = new Map( + genericTokens.map((item) => [item.denomOrAddress, item]) + ) + + return allStargazeTokens.map((token) => + nftCardInfoFromStargazeIndexerNft( + chainId, + token, + token.highestOffer?.offerPrice?.denom + ? genericTokensMap.get(token.highestOffer.offerPrice.denom) + : undefined, + timestamp + ) + ) + }, +}) diff --git a/packages/stateful/recoil/selectors/nft.ts b/packages/stateful/recoil/selectors/nft.ts index 47625bc48..16f83ad25 100644 --- a/packages/stateful/recoil/selectors/nft.ts +++ b/packages/stateful/recoil/selectors/nft.ts @@ -1,4 +1,4 @@ -import { selectorFamily, waitForAll, waitForNone } from 'recoil' +import { selectorFamily, waitForNone } from 'recoil' import { CommonNftSelectors, @@ -7,107 +7,19 @@ import { nftUriDataSelector, queryWalletIndexerSelector, refreshWalletBalancesIdAtom, - refreshWalletStargazeNftsAtom, stargazeIndexerClient, stargazeTokenQuery, - stargazeTokensForOwnerQuery, + walletStargazeNftCardInfosSelector, } from '@dao-dao/state' import { stakerForNftSelector } from '@dao-dao/state/recoil/selectors/contracts/DaoVotingCw721Staked' -import { - ChainId, - GenericToken, - NftCardInfo, - TokenType, - WithChainId, -} from '@dao-dao/types' +import { ChainId, NftCardInfo, TokenType, WithChainId } from '@dao-dao/types' import { LazyNftCardInfo, LoadingNfts } from '@dao-dao/types/nft' import { - MAINNET, STARGAZE_URL_BASE, getNftKey, nftCardInfoFromStargazeIndexerNft, } from '@dao-dao/utils' -const STARGAZE_INDEXER_TOKENS_LIMIT = 100 -export const walletStargazeNftCardInfosSelector = selectorFamily< - NftCardInfo[], - string ->({ - key: 'walletStargazeNftCardInfos', - get: - (walletAddress: string) => - async ({ get }) => { - const chainId = MAINNET - ? ChainId.StargazeMainnet - : ChainId.StargazeTestnet - - get(refreshWalletStargazeNftsAtom(walletAddress)) - - const nftCardInfos: NftCardInfo[] = [] - - while (true) { - const { error, data } = await stargazeIndexerClient.query({ - query: stargazeTokensForOwnerQuery, - variables: { - ownerAddrOrName: walletAddress, - limit: STARGAZE_INDEXER_TOKENS_LIMIT, - offset: nftCardInfos.length, - }, - // Don't cache since this recoil selector handles caching. If this - // selector is re-evaluated, it should be re-fetched since an NFT may - // have changed ownership. - fetchPolicy: 'no-cache', - }) - const timestamp = new Date() - - if (error) { - throw error - } - - if (!data.tokens?.pageInfo) { - break - } - - const genericTokens = get( - waitForAll( - data.tokens.tokens - .filter((token) => token.highestOffer?.offerPrice?.denom) - .map((token) => - genericTokenSelector({ - chainId, - type: TokenType.Native, - denomOrAddress: token.highestOffer!.offerPrice!.denom!, - }) - ) - ) - ) - - const genericTokensMap: Map = new Map( - genericTokens.map((item) => [item.denomOrAddress, item]) - ) - - nftCardInfos.push( - ...data.tokens.tokens.map((token) => - nftCardInfoFromStargazeIndexerNft( - chainId, - token, - token.highestOffer?.offerPrice?.denom - ? genericTokensMap.get(token.highestOffer.offerPrice.denom) - : undefined, - timestamp - ) - ) - ) - - if (nftCardInfos.length === data.tokens.pageInfo.total) { - break - } - } - - return nftCardInfos - }, -}) - export const nftCardInfoWithUriSelector = selectorFamily< NftCardInfo, WithChainId<{ @@ -250,18 +162,20 @@ export const lazyNftCardInfosForDaoSelector = selectorFamily< ) return Object.entries(allNfts).reduce( - (acc, [chainId, { owner, collectionAddresses }]) => { + (acc, [chainId, { owners, collectionAddresses }]) => { collectionAddresses = Array.from(new Set(collectionAddresses)) // Get all token IDs owned by the DAO for each collection. const nftCollectionTokenIds = get( waitForNone( - collectionAddresses.map((collectionAddress) => - CommonNftSelectors.unpaginatedAllTokensForOwnerSelector({ - contractAddress: collectionAddress, - chainId, - owner, - }) + collectionAddresses.flatMap((collectionAddress) => + owners.map((owner) => + CommonNftSelectors.unpaginatedAllTokensForOwnerSelector({ + contractAddress: collectionAddress, + chainId, + owner, + }) + ) ) ) ) From 05b7f06746fdab2cb9b1d09e21a12ac2e009eb83 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 22 May 2024 13:10:11 -0400 Subject: [PATCH 179/438] fixed creation policy display bug --- .../DaoProposalMultiple/hooks/useProposalDaoInfoCards.tsx | 2 +- .../DaoProposalSingle/hooks/useProposalDaoInfoCards.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useProposalDaoInfoCards.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useProposalDaoInfoCards.tsx index f9206442b..ce389a1cc 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useProposalDaoInfoCards.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useProposalDaoInfoCards.tsx @@ -46,7 +46,7 @@ export const useProposalDaoInfoCards = (): DaoInfoCard[] => { const anyoneCanPropose = useCachedLoadingWithError( anyoneCanProposeSelector({ chainId, - preProposeAddress: proposalModule?.address ?? null, + preProposeAddress: proposalModule.prePropose?.address ?? null, }) ) const depositTokenInfo = useCachedLoadingWithError( diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalDaoInfoCards.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalDaoInfoCards.tsx index 0f8ac3d86..0ff855d60 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalDaoInfoCards.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalDaoInfoCards.tsx @@ -47,7 +47,7 @@ export const useProposalDaoInfoCards = (): DaoInfoCard[] => { const anyoneCanPropose = useCachedLoadingWithError( anyoneCanProposeSelector({ chainId, - preProposeAddress: proposalModule?.address ?? null, + preProposeAddress: proposalModule.prePropose?.address ?? null, }) ) const depositTokenInfo = useCachedLoadingWithError( From cf3accc291c7e415b7586ae461ace1e9add8efdd Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 22 May 2024 23:41:17 -0400 Subject: [PATCH 180/438] fix infinite create proposal page re-render --- .../components/dao/CreateDaoProposal.tsx | 173 +++++++++++------- 1 file changed, 105 insertions(+), 68 deletions(-) diff --git a/packages/stateful/components/dao/CreateDaoProposal.tsx b/packages/stateful/components/dao/CreateDaoProposal.tsx index 6edb564f0..8fc7fe3bc 100644 --- a/packages/stateful/components/dao/CreateDaoProposal.tsx +++ b/packages/stateful/components/dao/CreateDaoProposal.tsx @@ -4,14 +4,18 @@ import { SetStateAction, useCallback, useEffect, - useMemo, useRef, useState, } from 'react' -import { FormProvider, useForm } from 'react-hook-form' +import { FormProvider, useForm, useFormContext } from 'react-hook-form' import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' -import { useRecoilState, useSetRecoilState } from 'recoil' +import { + useRecoilCallback, + useRecoilState, + useRecoilValue, + useSetRecoilState, +} from 'recoil' import { latestProposalSaveAtom, @@ -25,6 +29,7 @@ import { ProposalModuleSelector, useDaoInfoContext, useDaoNavHelpers, + useUpdatingRef, } from '@dao-dao/stateless' import { BaseNewProposalProps, @@ -72,27 +77,47 @@ export const CreateDaoProposal = () => { ) }) - return ( + // Load saved proposal state once and then never re-render when it changes + // again, to avoid infinite re-render loops due to periodic form saving. + const [latestProposalSave, setLatestProposalSave] = useState(undefined) + const loadLatestProposalSave = useRecoilCallback( + ({ snapshot }) => + async () => + setLatestProposalSave( + await snapshot.getPromise(latestProposalSaveAtom(daoInfo.coreAddress)) + ), + [daoInfo.coreAddress] + ) + useEffect(() => { + loadLatestProposalSave() + }, [loadLatestProposalSave]) + + return latestProposalSave ? ( + ) : ( + ) } type InnerCreateDaoProposalProps = { selectedProposalModule: ProposalModule setSelectedProposalModule: Dispatch> + latestProposalSave: any } const InnerCreateDaoProposal = ({ selectedProposalModule, setSelectedProposalModule, + latestProposalSave, }: InnerCreateDaoProposalProps) => { const { t } = useTranslation() const { goToDaoProposal, router, getDaoProposalPath } = useDaoNavHelpers() @@ -109,59 +134,31 @@ const InnerCreateDaoProposal = ({ }, } = useProposalModuleAdapterCommonContext() - const [latestProposalSave, setLatestProposalSave] = useRecoilState( - latestProposalSaveAtom(daoInfo.coreAddress) - ) + // Only set defaults once to prevent unnecessary useForm re-renders. + const [firstProposalSave] = useState(() => ({ + ...makeDefaultNewProposalForm(), + ...cloneDeep(latestProposalSave), + })) + const formMethods = useForm({ mode: 'onChange', - // Don't clone every render. - defaultValues: useMemo( - () => ({ - ...makeDefaultNewProposalForm(), - ...cloneDeep(latestProposalSave), - }), - [latestProposalSave, makeDefaultNewProposalForm] - ), + defaultValues: firstProposalSave, }) + const { getValues, reset } = formMethods + + const setLatestProposalSave = useSetRecoilState( + latestProposalSaveAtom(daoInfo.coreAddress) + ) // Reset form to defaults and clear latest proposal save. const clear = useCallback(() => { - formMethods.reset(makeDefaultNewProposalForm()) + reset(makeDefaultNewProposalForm()) setLatestProposalSave({}) - }, [formMethods, makeDefaultNewProposalForm, setLatestProposalSave]) - - const [proposalCreatedCardProps, setProposalCreatedCardProps] = - useRecoilState(proposalCreatedCardPropsAtom) - - const proposalData = formMethods.watch() - - const saveQueuedRef = useRef(false) - const saveLatestProposalRef = useRef(() => {}) - saveLatestProposalRef.current = () => - setLatestProposalSave( - // If created proposal, clear latest proposal save. - proposalCreatedCardProps ? {} : cloneDeep(proposalData) - ) + }, [reset, makeDefaultNewProposalForm, setLatestProposalSave]) - // Save latest data to atom and thus localStorage every second. - useEffect(() => { - // If created proposal, don't save. - if (proposalCreatedCardProps) { - return - } - - // Queue save in 1 second if not already queued. - if (saveQueuedRef.current) { - return - } - saveQueuedRef.current = true - - // Save in one second. - setTimeout(() => { - saveLatestProposalRef.current() - saveQueuedRef.current = false - }, 1000) - }, [proposalCreatedCardProps, setLatestProposalSave, proposalData]) + const setProposalCreatedCardProps = useSetRecoilState( + proposalCreatedCardPropsAtom + ) const loadPrefill = useCallback( ({ id, data }: ProposalPrefill) => { @@ -173,10 +170,10 @@ const InnerCreateDaoProposal = ({ if (matchingProposalModule) { setSelectedProposalModule(matchingProposalModule) - formMethods.reset(data) + reset(data) } }, - [daoInfo.proposalModules, formMethods, setSelectedProposalModule] + [daoInfo.proposalModules, reset, setSelectedProposalModule] ) // Prefill form with data from parameter once ready. @@ -223,7 +220,6 @@ const InnerCreateDaoProposal = ({ router.query.prefill, router.isReady, daoInfo.proposalModules, - formMethods, prefillChecked, loadPrefill, ]) @@ -260,9 +256,8 @@ const InnerCreateDaoProposal = ({ }, [setDrafts] ) - const unloadDraft = () => setDraftIndex(undefined) + const unloadDraft = useCallback(() => setDraftIndex(undefined), []) - const proposalName = formMethods.watch(newProposalFormTitleKey) const saveDraft = useCallback(() => { // Already saving to a selected draft. if (draft) { @@ -270,24 +265,23 @@ const InnerCreateDaoProposal = ({ } const newDraft: ProposalDraft = { - name: proposalName, + name: getValues(newProposalFormTitleKey), createdAt: Date.now(), lastUpdatedAt: Date.now(), proposal: { id: proposalModuleAdapterCommonId, - data: proposalData, + data: getValues(), }, } - setDrafts([newDraft, ...drafts]) + setDrafts((existing) => [newDraft, ...existing]) setDraftIndex(0) }, [ draft, - drafts, - proposalData, + getValues, proposalModuleAdapterCommonId, setDrafts, - proposalName, + newProposalFormTitleKey, ]) // Debounce saving draft every 3 seconds. @@ -305,12 +299,12 @@ const InnerCreateDaoProposal = ({ index === draftIndex ? { ...savedDraft, - name: proposalName, + name: getValues(newProposalFormTitleKey), lastUpdatedAt: Date.now(), proposal: { id: proposalModuleAdapterCommonId, // Deep clone to prevent values from becoming readOnly. - data: cloneDeep(proposalData), + data: cloneDeep(getValues()), }, } : savedDraft @@ -320,15 +314,12 @@ const InnerCreateDaoProposal = ({ }, 3000) // Debounce. return () => clearTimeout(timeout) - // eslint-disable-next-line react-hooks/exhaustive-deps }, [ - // Instance changes every time, so compare stringified verison. - // eslint-disable-next-line react-hooks/exhaustive-deps - JSON.stringify(proposalData), + getValues, draftIndex, setDrafts, - proposalName, proposalModuleAdapterCommonId, + newProposalFormTitleKey, ]) const setRefreshProposalsId = useSetRecoilState(refreshProposalsIdAtom) @@ -372,7 +363,7 @@ const InnerCreateDaoProposal = ({ getDaoProposalPath(daoInfo.coreAddress, 'create', { prefill: encodeJsonToBase64({ id: proposalModuleAdapterCommonId, - data: proposalData, + data: getValues(), }), }) ) @@ -422,7 +413,53 @@ const InnerCreateDaoProposal = ({ } /> + + ) } + +// Component responsible for listening to form changes and save it to local +// storage periodically. +const FormSaver = () => { + const { watch, getValues } = useFormContext() + const { coreAddress } = useDaoInfoContext() + + const proposalCreatedCardProps = useRecoilValue(proposalCreatedCardPropsAtom) + const setLatestProposalSave = useSetRecoilState( + latestProposalSaveAtom(coreAddress) + ) + + const saveQueuedRef = useRef(false) + const saveLatestProposalRef = useUpdatingRef(() => + setLatestProposalSave( + // If created proposal, clear latest proposal save. + proposalCreatedCardProps ? {} : cloneDeep(getValues()) + ) + ) + + const data = watch() + + // Save latest data to atom (and thus localStorage) every second. + useEffect(() => { + // If created proposal, don't save. + if (proposalCreatedCardProps) { + return + } + + // Queue save in 1 second if not already queued. + if (saveQueuedRef.current) { + return + } + saveQueuedRef.current = true + + // Save in one second. + setTimeout(() => { + saveLatestProposalRef.current() + saveQueuedRef.current = false + }, 1000) + }, [proposalCreatedCardProps, saveLatestProposalRef, data]) + + return null +} From 2090039a72d8b07bc7812f754b2e5b465419f5e9 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 23 May 2024 09:14:00 -0400 Subject: [PATCH 181/438] fix indexer fallback to chain --- packages/state/recoil/selectors/indexer.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/state/recoil/selectors/indexer.ts b/packages/state/recoil/selectors/indexer.ts index 76745b6e6..07eaae6e4 100644 --- a/packages/state/recoil/selectors/indexer.ts +++ b/packages/state/recoil/selectors/indexer.ts @@ -83,9 +83,14 @@ export const queryIndexerSelector = selectorFamily({ return null } - // Throw other errors. Recoil throws promises when waiting for other - // selectors to finish, and we don't want to prevent that. - throw err + // Recoil throws promises when waiting for other selectors to finish, + // and we don't want to prevent that. + if (err instanceof Promise) { + throw err + } + + console.error(err) + return null } try { From 6f561fe0a645d0362014a327b43bf546bd09a4f3 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 23 May 2024 09:30:31 -0400 Subject: [PATCH 182/438] fixed fail to load prop if start height below RPC height --- .../functions/makeGetProposalInfo.ts | 16 +++++++++++----- .../functions/makeGetProposalInfo.ts | 15 ++++++++++----- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/makeGetProposalInfo.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/makeGetProposalInfo.ts index 1158fb4f9..8ed6da957 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/makeGetProposalInfo.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/makeGetProposalInfo.ts @@ -127,12 +127,18 @@ export const makeGetProposalInfo = console.error(err) } // If indexer fails, fallback to querying block info from chain. + if (!createdAtEpoch) { - createdAtEpoch = new Date( - ( - await (await getCosmWasmClient()).getBlock(proposal.start_height) - ).header.time - ).getTime() + try { + createdAtEpoch = new Date( + ( + await (await getCosmWasmClient()).getBlock(proposal.start_height) + ).header.time + ).getTime() + } catch (err) { + // Ignore error. + console.error(err) + } } return { diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/makeGetProposalInfo.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/makeGetProposalInfo.ts index d0641e65c..5c1016199 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/makeGetProposalInfo.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/makeGetProposalInfo.ts @@ -193,11 +193,16 @@ export const makeGetProposalInfo = } // If indexer fails, fallback to querying block info from chain. if (!createdAtEpoch) { - createdAtEpoch = new Date( - ( - await (await getCosmWasmClient()).getBlock(proposal.start_height) - ).header.time - ).getTime() + try { + createdAtEpoch = new Date( + ( + await (await getCosmWasmClient()).getBlock(proposal.start_height) + ).header.time + ).getTime() + } catch (err) { + // Ignore error. + console.error(err) + } } return { From 640d3231501ad21c6d84d38a61d3761fb53f12d5 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 23 May 2024 10:46:13 -0400 Subject: [PATCH 183/438] check if indexer is caught up to determine if web socket is really listening or not --- packages/stateful/hooks/useWebSocket.ts | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/packages/stateful/hooks/useWebSocket.ts b/packages/stateful/hooks/useWebSocket.ts index d91a8cc39..dc7fb618e 100644 --- a/packages/stateful/hooks/useWebSocket.ts +++ b/packages/stateful/hooks/useWebSocket.ts @@ -4,11 +4,16 @@ import { constSelector, useRecoilValue, useSetRecoilState } from 'recoil' import { useDeepCompareMemoize } from 'use-deep-compare-effect' import { + indexerUpStatusSelector, indexerWebSocketChannelSubscriptionsAtom, indexerWebSocketSelector, mountedInBrowserAtom, } from '@dao-dao/state/recoil' -import { useDaoInfoContext, useUpdatingRef } from '@dao-dao/stateless' +import { + useCachedLoadingWithError, + useDaoInfoContext, + useUpdatingRef, +} from '@dao-dao/stateless' import { ParametersExceptFirst } from '@dao-dao/types' import { objectMatchesStructure, @@ -217,11 +222,25 @@ export const useOnDaoWebSocketMessage = ( chainId: string, coreAddress: string, ...args: ParametersExceptFirst -) => - useOnWebSocketMessage( +) => { + const indexerUp = useCachedLoadingWithError( + indexerUpStatusSelector({ + chainId, + }) + ) + const response = useOnWebSocketMessage( [webSocketChannelNameForDao({ chainId, coreAddress })], ...args ) + return { + ...response, + listening: + // Unless indexer is caught up, mark as not listening. + indexerUp.loading || indexerUp.errored || !indexerUp.data.caughtUp + ? false + : response.listening, + } +} export const useOnCurrentDaoWebSocketMessage = ( ...args: ParametersExceptFirst From 1d20af282320a369151726ce0c56015fc87b1ed6 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 23 May 2024 13:45:09 -0400 Subject: [PATCH 184/438] paginate DAO votes list --- .../contracts/DaoProposalMultiple.ts | 58 ++++++++ .../contracts/DaoProposalSingle.common.ts | 117 ++++++++++++++- .../stateful/components/dao/DaoProposal.tsx | 2 +- .../stateful/components/gov/GovProposal.tsx | 29 ++-- .../components/gov/GovProposalVotes.tsx | 111 ++++++++------ .../components/ProposalVotes/index.tsx | 140 ++++++++++++------ .../components/ProposalVotes/index.tsx | 140 ++++++++++++------ .../proposal/PaginatedProposalVotes.tsx | 24 --- .../proposal/ProposalVotes.stories.tsx | 12 -- .../components/proposal/ProposalVotes.tsx | 81 +++++----- .../stateless/components/proposal/index.ts | 1 - packages/stateless/hooks/useInfiniteScroll.ts | 16 +- packages/stateless/pages/Proposal.stories.tsx | 2 +- packages/stateless/pages/Proposal.tsx | 16 +- packages/types/proposal-module-adapter.ts | 9 +- 15 files changed, 538 insertions(+), 220 deletions(-) delete mode 100644 packages/stateless/components/proposal/PaginatedProposalVotes.tsx diff --git a/packages/state/recoil/selectors/contracts/DaoProposalMultiple.ts b/packages/state/recoil/selectors/contracts/DaoProposalMultiple.ts index 762fd1f2e..1d51971f8 100644 --- a/packages/state/recoil/selectors/contracts/DaoProposalMultiple.ts +++ b/packages/state/recoil/selectors/contracts/DaoProposalMultiple.ts @@ -366,6 +366,30 @@ export const listAllVotesSelector = selectorFamily< get: ({ proposalId, ...queryClientParams }) => async ({ get }) => { + // Attempt to load all from indexer first. + const id = + get(refreshProposalsIdAtom) + + get( + refreshProposalIdAtom({ + address: queryClientParams.contractAddress, + proposalId, + }) + ) + + const indexerVotes = get( + queryContractIndexerSelector({ + ...queryClientParams, + formula: 'daoProposalMultiple/listVotes', + args: { + proposalId, + }, + id, + }) + ) + if (indexerVotes) { + return indexerVotes + } + const votes: VoteInfo[] = [] while (true) { @@ -394,3 +418,37 @@ export const listAllVotesSelector = selectorFamily< return votes }, }) + +export const voteCountSelector = selectorFamily< + number | undefined, + QueryClientParams & { + proposalId: number + } +>({ + key: 'daoProposalMultipleVoteCount', + get: + ({ proposalId, ...queryClientParams }) => + async ({ get }) => { + const id = + get(refreshProposalsIdAtom) + + get( + refreshProposalIdAtom({ + address: queryClientParams.contractAddress, + proposalId, + }) + ) + + return ( + get( + queryContractIndexerSelector({ + ...queryClientParams, + formula: 'daoProposalMultiple/voteCount', + args: { + proposalId, + }, + id, + }) + ) ?? undefined + ) + }, +}) diff --git a/packages/state/recoil/selectors/contracts/DaoProposalSingle.common.ts b/packages/state/recoil/selectors/contracts/DaoProposalSingle.common.ts index ad20745f0..8b1f8b831 100644 --- a/packages/state/recoil/selectors/contracts/DaoProposalSingle.common.ts +++ b/packages/state/recoil/selectors/contracts/DaoProposalSingle.common.ts @@ -1,6 +1,11 @@ -import { selectorFamily } from 'recoil' +import { RecoilValueReadOnly, selectorFamily } from 'recoil' -import { contractVersionSelector } from '@dao-dao/state' +import { + contractVersionSelector, + queryContractIndexerSelector, + refreshProposalIdAtom, + refreshProposalsIdAtom, +} from '@dao-dao/state' import { ContractVersion, WithChainId } from '@dao-dao/types' import { ConfigResponse as ConfigV1Response, @@ -111,6 +116,30 @@ export const listAllVotesSelector = selectorFamily< get: ({ proposalId, ...queryClientParams }) => async ({ get }) => { + // Attempt to load all from indexer first. + const id = + get(refreshProposalsIdAtom) + + get( + refreshProposalIdAtom({ + address: queryClientParams.contractAddress, + proposalId, + }) + ) + + const indexerVotes = get( + queryContractIndexerSelector({ + ...queryClientParams, + formula: 'daoProposalSingle/listVotes', + args: { + proposalId, + }, + id, + }) + ) + if (indexerVotes) { + return indexerVotes + } + const votes: VoteInfo[] = [] while (true) { @@ -140,6 +169,56 @@ export const listAllVotesSelector = selectorFamily< }, }) +export const listPaginatedVotesSelector: ( + param: QueryClientParams & { + proposalId: number + page: number + pageSize: number + } +) => RecoilValueReadOnly = selectorFamily({ + key: 'daoProposalSingleCommonListPaginatedVotes', + get: + ({ proposalId, page, pageSize, ...queryClientParams }) => + async ({ get }) => { + const proposalModuleVersion = get( + contractVersionSelector(queryClientParams) + ) + const selector = + proposalModuleVersion === ContractVersion.V1 + ? listVotesV1Selector + : listVotesV2Selector + + let startAfter: string | undefined + // Get last page so we can retrieve the last voter from it. + if (page > 1) { + const lastPage = get( + listPaginatedVotesSelector({ + ...queryClientParams, + proposalId, + page: page - 1, + pageSize, + }) + ) + if (lastPage.votes.length > 0) { + startAfter = lastPage.votes[lastPage.votes.length - 1].voter + } + } + + return get( + selector({ + ...queryClientParams, + params: [ + { + proposalId, + startAfter, + limit: pageSize, + }, + ], + }) + ) + }, +}) + export const proposalSelector = selectorFamily< ProposalV1Response | ProposalV2Response, QueryClientParams & { @@ -243,3 +322,37 @@ export const reverseProposalsSelector = selectorFamily< ) }, }) + +export const voteCountSelector = selectorFamily< + number | undefined, + QueryClientParams & { + proposalId: number + } +>({ + key: 'daoProposalSingleCommonVoteCount', + get: + ({ proposalId, ...queryClientParams }) => + async ({ get }) => { + const id = + get(refreshProposalsIdAtom) + + get( + refreshProposalIdAtom({ + address: queryClientParams.contractAddress, + proposalId, + }) + ) + + return ( + get( + queryContractIndexerSelector({ + ...queryClientParams, + formula: 'daoProposalSingle/voteCount', + args: { + proposalId, + }, + id, + }) + ) ?? undefined + ) + }, +}) diff --git a/packages/stateful/components/dao/DaoProposal.tsx b/packages/stateful/components/dao/DaoProposal.tsx index f9f10cb8d..062453fc9 100644 --- a/packages/stateful/components/dao/DaoProposal.tsx +++ b/packages/stateful/components/dao/DaoProposal.tsx @@ -272,6 +272,7 @@ const InnerDaoProposal = ({ proposalInfo }: InnerDaoProposalProps) => { ? PreProposeApprovalProposalStatusAndInfo : CachedProposalStatusAndInfo } + VotesCast={isPreProposeApprovalProposal ? undefined : ProposalVotes} contentDisplay={ proposalModule.prePropose?.type === PreProposeModuleType.Approver ? ( { voteTally={ isPreProposeApprovalProposal ? undefined : } - votesCast={isPreProposeApprovalProposal ? undefined : } /> { } ) + const GovVotesCast = useCallback( + (props: BaseProposalVotesProps) => ( + + ), + [proposalId] + ) + return ( <> { } voteTally={} - votesCast={ - (proposal.proposal.status === - ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD || - proposal.proposal.status === - ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD) && ( - - ) - } /> ) diff --git a/packages/stateful/components/gov/GovProposalVotes.tsx b/packages/stateful/components/gov/GovProposalVotes.tsx index 637651551..4c88f22f9 100644 --- a/packages/stateful/components/gov/GovProposalVotes.tsx +++ b/packages/stateful/components/gov/GovProposalVotes.tsx @@ -1,5 +1,5 @@ -import { useState } from 'react' -import { useRecoilValue } from 'recoil' +import { useEffect, useState } from 'react' +import { useRecoilCallback, useRecoilValue } from 'recoil' import { chainStakingPoolSelector, @@ -8,11 +8,12 @@ import { import { GovProposalVoteDisplay, Loader, - PaginatedProposalVotes, ProposalVote, - useCachedLoadingWithError, + ProposalVotes as StatelessProposalVotes, useChain, + useInfiniteScroll, } from '@dao-dao/stateless' +import { BaseProposalVotesProps } from '@dao-dao/types' import { VoteOption, voteOptionToJSON, @@ -23,7 +24,7 @@ import { SuspenseLoader } from '../SuspenseLoader' const VOTES_PER_PAGE = 10 -export type GovProposalVotesProps = { +export type GovProposalVotesProps = BaseProposalVotesProps & { proposalId: string } @@ -33,19 +34,12 @@ export const GovProposalVotes = (props: GovProposalVotesProps) => ( ) -const InnerGovProposalVotes = ({ proposalId }: GovProposalVotesProps) => { +const InnerGovProposalVotes = ({ + proposalId, + scrollElement, +}: GovProposalVotesProps) => { const { chain_id: chainId } = useChain() - const [page, setPage] = useState(1) - // Load total votes. - const { total } = useRecoilValue( - govProposalVotesSelector({ - chainId, - proposalId: Number(proposalId), - offset: 0, - limit: VOTES_PER_PAGE, - }) - ) // Load all staked voting power. const { bondedTokens } = useRecoilValue( chainStakingPoolSelector({ @@ -53,40 +47,71 @@ const InnerGovProposalVotes = ({ proposalId }: GovProposalVotesProps) => { }) ) - const pageVotes = useCachedLoadingWithError( - govProposalVotesSelector({ - chainId, - proposalId: Number(proposalId), - offset: (page - 1) * VOTES_PER_PAGE, - limit: VOTES_PER_PAGE, - }), - (data) => - data.votes.map( - ({ voter, options, staked }): ProposalVote => ({ - voterAddress: voter, - vote: options.sort((a, b) => Number(b.weight) - Number(a.weight))[0] - .option, - votingPowerPercent: - Number(staked) / Number(BigInt(bondedTokens) / 100n), - }) - ) + const [loading, setLoading] = useState(true) + const [noMoreVotes, setNoMoreVotes] = useState(false) + const [votes, setVotes] = useState([]) + const loadVotes = useRecoilCallback( + ({ snapshot }) => + async () => { + setLoading(true) + try { + const newVotes = ( + await snapshot.getPromise( + govProposalVotesSelector({ + chainId, + proposalId: Number(proposalId), + offset: votes.length, + limit: VOTES_PER_PAGE, + }) + ) + ).votes.map( + ({ voter, options, staked }): ProposalVote => ({ + voterAddress: voter, + vote: options.sort( + (a, b) => Number(b.weight) - Number(a.weight) + )[0].option, + votingPowerPercent: + Number(staked) / Number(BigInt(bondedTokens) / 100n), + }) + ) + + setVotes((prev) => [...prev, ...newVotes]) + setNoMoreVotes(newVotes.length < VOTES_PER_PAGE) + } finally { + setLoading(false) + } + }, + [chainId, proposalId, votes.length, bondedTokens] ) + // Load once. + useEffect(() => { + loadVotes() + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []) + + useInfiniteScroll({ + scrollElement, + loadMore: loadVotes, + disabled: loading || noMoreVotes, + infiniteScrollFactor: 0.2, + }) return ( - voteOptionToJSON(vote)} - hideDownload hideVotedAt - pagination={{ - page, - setPage, - pageSize: VOTES_PER_PAGE, - total, - }} - votes={pageVotes} + votes={ + loading && votes.length === 0 + ? { loading: true, errored: false } + : { + loading: false, + updating: loading, + errored: false, + data: votes, + } + } votingOpen={false} /> ) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx index 99a938e88..10fe0f665 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx @@ -1,20 +1,22 @@ -import { useState } from 'react' +import { useEffect, useState } from 'react' +import { useRecoilCallback } from 'recoil' import { DaoProposalMultipleSelectors } from '@dao-dao/state' import { - PaginatedProposalVotes, ProposalVote, - useCachedLoadingWithError, + ProposalVotes as StatelessProposalVotes, + useInfiniteScroll, } from '@dao-dao/stateless' +import { BaseProposalVotesProps } from '@dao-dao/types' import { EntityDisplay } from '../../../../../components/EntityDisplay' import { useProposalModuleAdapterOptions } from '../../../../react/context' import { useLoadingProposal, useLoadingVoteOptions } from '../../hooks' import { VoteDisplay } from './VoteDisplay' -const VOTES_PER_PAGE = 20 +const VOTES_PER_PAGE = 15 -export const ProposalVotes = () => { +export const ProposalVotes = ({ scrollElement }: BaseProposalVotesProps) => { const { chain: { chain_id: chainId }, proposalModule: { address: proposalModuleAddress }, @@ -28,19 +30,83 @@ export const ProposalVotes = () => { ? 0 : Number(loadingProposal.data.total_power) - const votes = useCachedLoadingWithError( - // Don't load votes until proposal is ready so that the `totalPower` - // calculation in the transformation function works correctly. - loadingProposal.loading - ? undefined - : DaoProposalMultipleSelectors.listAllVotesSelector({ - chainId, - contractAddress: proposalModuleAddress, - proposalId: proposalNumber, - }), - (data) => - data - .map( + const [loading, setLoading] = useState(true) + const [noMoreVotes, setNoMoreVotes] = useState(false) + const [votes, setVotes] = useState([]) + const loadVotes = useRecoilCallback( + ({ snapshot }) => + async () => { + // Don't load votes until proposal is ready so that the `totalPower` + // calculation in the transformation function works correctly. + if (loadingProposal.loading) { + return + } + + setLoading(true) + try { + const newVotes = ( + await snapshot.getPromise( + DaoProposalMultipleSelectors.listVotesSelector({ + chainId, + contractAddress: proposalModuleAddress, + params: [ + { + proposalId: proposalNumber, + limit: VOTES_PER_PAGE, + startAfter: + votes.length > 0 + ? votes[votes.length - 1].voterAddress + : undefined, + }, + ], + }) + ) + ).votes.map( + ({ vote, voter, power, rationale, votedAt }): ProposalVote => ({ + voterAddress: voter, + vote, + votingPowerPercent: + totalPower === 0 ? 0 : (Number(power) / totalPower) * 100, + rationale, + votedAt: votedAt ? new Date(votedAt) : undefined, + }) + ) + + setVotes((prev) => [...prev, ...newVotes]) + setNoMoreVotes(newVotes.length < VOTES_PER_PAGE) + } finally { + setLoading(false) + } + }, + [ + chainId, + proposalModuleAddress, + proposalNumber, + totalPower, + loadingProposal.loading, + votes, + ] + ) + // Load once proposal is ready. + useEffect(() => { + if (!loadingProposal.loading) { + loadVotes() + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [loadingProposal.loading]) + + const getAllVotes = useRecoilCallback( + ({ snapshot }) => + async () => + ( + await snapshot.getPromise( + DaoProposalMultipleSelectors.listAllVotesSelector({ + chainId, + contractAddress: proposalModuleAddress, + proposalId: proposalNumber, + }) + ) + ).map( ({ vote, voter, power, rationale, votedAt }): ProposalVote => ({ voterAddress: voter, vote, @@ -50,25 +116,19 @@ export const ProposalVotes = () => { votedAt: votedAt ? new Date(votedAt) : undefined, }) ) - // Sort most recent first. - .sort((a, b) => - a.votedAt && b.votedAt - ? b.votedAt.getTime() - a.votedAt.getTime() - : a.votedAt - ? -1 - : b.votedAt - ? 1 - : 0 - ) ) - const [page, setPage] = useState(1) + useInfiniteScroll({ + scrollElement, + loadMore: loadVotes, + disabled: loading || noMoreVotes, + infiniteScrollFactor: 0.2, + }) return ( - voteOptions.loading ? 'LOADING_ERROR' @@ -76,23 +136,15 @@ export const ProposalVotes = () => { (option) => option.value.option_id === vote.option_id )?.label || 'UNKNOWN_ERROR' } - pagination={{ - page, - setPage, - pageSize: VOTES_PER_PAGE, - total: votes.loading || votes.errored ? 0 : votes.data.length, - }} + getAllVotes={getAllVotes} votes={ - votes.loading || votes.errored - ? votes + loading && votes.length === 0 + ? { loading: true, errored: false } : { loading: false, + updating: loading, errored: false, - updating: votes.updating, - data: votes.data.slice( - (page - 1) * VOTES_PER_PAGE, - page * VOTES_PER_PAGE - ), + data: votes, } } votingOpen={!loadingProposal.loading && loadingProposal.data.votingOpen} diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx index 7681791d5..4dece003a 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx @@ -1,20 +1,22 @@ -import { useState } from 'react' +import { useEffect, useState } from 'react' +import { useRecoilCallback } from 'recoil' import { DaoProposalSingleCommonSelectors } from '@dao-dao/state' import { - PaginatedProposalVotes, ProposalVote, - useCachedLoadingWithError, + ProposalVotes as StatelessProposalVotes, + useInfiniteScroll, } from '@dao-dao/stateless' +import { BaseProposalVotesProps } from '@dao-dao/types' import { EntityDisplay } from '../../../../../components/EntityDisplay' import { useProposalModuleAdapterOptions } from '../../../../react/context' import { useLoadingProposal } from '../../hooks' import { VoteDisplay } from './VoteDisplay' -const VOTES_PER_PAGE = 20 +const VOTES_PER_PAGE = 15 -export const ProposalVotes = () => { +export const ProposalVotes = ({ scrollElement }: BaseProposalVotesProps) => { const { proposalModule: { address: proposalModuleAddress }, proposalNumber, @@ -27,19 +29,83 @@ export const ProposalVotes = () => { ? 0 : Number(loadingProposal.data.total_power) - const votes = useCachedLoadingWithError( - // Don't load votes until proposal is ready so that the `totalPower` - // calculation in the transformation function works correctly. - loadingProposal.loading - ? undefined - : DaoProposalSingleCommonSelectors.listAllVotesSelector({ - chainId, - contractAddress: proposalModuleAddress, - proposalId: proposalNumber, - }), - (data) => - data - .map( + const [loading, setLoading] = useState(true) + const [noMoreVotes, setNoMoreVotes] = useState(false) + const [votes, setVotes] = useState([]) + const loadVotes = useRecoilCallback( + ({ snapshot }) => + async () => { + // Don't load votes until proposal is ready so that the `totalPower` + // calculation in the transformation function works correctly. + if (loadingProposal.loading) { + return + } + + setLoading(true) + try { + const newVotes = ( + await snapshot.getPromise( + DaoProposalSingleCommonSelectors.listVotesSelector({ + chainId, + contractAddress: proposalModuleAddress, + params: [ + { + proposalId: proposalNumber, + limit: VOTES_PER_PAGE, + startAfter: + votes.length > 0 + ? votes[votes.length - 1].voterAddress + : undefined, + }, + ], + }) + ) + ).votes.map( + ({ vote, voter, power, rationale, votedAt }): ProposalVote => ({ + voterAddress: voter, + vote, + votingPowerPercent: + totalPower === 0 ? 0 : (Number(power) / totalPower) * 100, + rationale, + votedAt: votedAt ? new Date(votedAt) : undefined, + }) + ) + + setVotes((prev) => [...prev, ...newVotes]) + setNoMoreVotes(newVotes.length < VOTES_PER_PAGE) + } finally { + setLoading(false) + } + }, + [ + chainId, + proposalModuleAddress, + proposalNumber, + totalPower, + loadingProposal.loading, + votes, + ] + ) + // Load once proposal is ready. + useEffect(() => { + if (!loadingProposal.loading) { + loadVotes() + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [loadingProposal.loading]) + + const getAllVotes = useRecoilCallback( + ({ snapshot }) => + async () => + ( + await snapshot.getPromise( + DaoProposalSingleCommonSelectors.listAllVotesSelector({ + chainId, + contractAddress: proposalModuleAddress, + proposalId: proposalNumber, + }) + ) + ).map( ({ vote, voter, power, rationale, votedAt }): ProposalVote => ({ voterAddress: voter, vote, @@ -49,43 +115,29 @@ export const ProposalVotes = () => { votedAt: votedAt ? new Date(votedAt) : undefined, }) ) - // Sort most recent first. - .sort((a, b) => - a.votedAt && b.votedAt - ? b.votedAt.getTime() - a.votedAt.getTime() - : a.votedAt - ? -1 - : b.votedAt - ? 1 - : 0 - ) ) - const [page, setPage] = useState(1) + useInfiniteScroll({ + scrollElement, + loadMore: loadVotes, + disabled: loading || noMoreVotes, + infiniteScrollFactor: 0.2, + }) return ( - vote} - pagination={{ - page, - setPage, - pageSize: VOTES_PER_PAGE, - total: votes.loading || votes.errored ? 0 : votes.data.length, - }} + getAllVotes={getAllVotes} votes={ - votes.loading || votes.errored - ? votes + loading && votes.length === 0 + ? { loading: true, errored: false } : { loading: false, + updating: loading, errored: false, - updating: votes.updating, - data: votes.data.slice( - (page - 1) * VOTES_PER_PAGE, - page * VOTES_PER_PAGE - ), + data: votes, } } votingOpen={!loadingProposal.loading && loadingProposal.data.votingOpen} diff --git a/packages/stateless/components/proposal/PaginatedProposalVotes.tsx b/packages/stateless/components/proposal/PaginatedProposalVotes.tsx deleted file mode 100644 index 876baf3fe..000000000 --- a/packages/stateless/components/proposal/PaginatedProposalVotes.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { Pagination, PaginationProps } from '../Pagination' -import { ProposalVotes, ProposalVotesProps } from './ProposalVotes' - -export type PaginatedProposalVotesProps = Omit< - ProposalVotesProps, - 'footer' -> & { - pagination: Omit -} - -export const PaginatedProposalVotes = ({ - pagination, - ...props -}: PaginatedProposalVotesProps) => ( - - ) - } - /> -) diff --git a/packages/stateless/components/proposal/ProposalVotes.stories.tsx b/packages/stateless/components/proposal/ProposalVotes.stories.tsx index 7fe801de6..a41758eba 100644 --- a/packages/stateless/components/proposal/ProposalVotes.stories.tsx +++ b/packages/stateless/components/proposal/ProposalVotes.stories.tsx @@ -53,18 +53,6 @@ export const makeProps = (): ProposalVotesProps => ({ /> ), VoteDisplay, - allVotes: { - loading: false, - errored: false, - data: [...Array(10)].map(() => ({ - voterAddress: 'juno123ihuprfiuosdjfiu98349fi0ewjgui', - // 25% chance of No, 75% chance of Yes - vote: Math.random() < 0.25 ? Vote.No : Vote.Yes, - votingPowerPercent: 0.0432, - // Within the past 5 days. - votedAt: new Date(Date.now() - Math.random() * 5 * 24 * 60 * 60 * 1000), - })), - }, exportVoteTransformer: (vote) => vote, }) diff --git a/packages/stateless/components/proposal/ProposalVotes.tsx b/packages/stateless/components/proposal/ProposalVotes.tsx index fedbec548..6f76cb0df 100644 --- a/packages/stateless/components/proposal/ProposalVotes.tsx +++ b/packages/stateless/components/proposal/ProposalVotes.tsx @@ -8,6 +8,7 @@ import { useState, } from 'react' import { CSVLink } from 'react-csv' +import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' import TimeAgo from 'react-timeago' @@ -19,6 +20,7 @@ import { formatDateTimeTz, formatPercentOf100, getScrollableAncestor, + processError, } from '@dao-dao/utils' import { useTranslatedTimeDeltaFormatter } from '../../hooks' @@ -42,11 +44,11 @@ export interface ProposalVotesProps { votingOpen: boolean footer?: ReactNode hideVotedAt?: boolean - hideDownload?: boolean /** - * All votes (non-paginated) for downloading the CSV. + * Function to fetch all votes (non-paginated) for downloading the CSV. If + * undefined, download link is hidden. */ - allVotes: LoadingDataWithError[]> + getAllVotes?: () => Promise[]> /** * A function to convert the vote type into a string for the CSV. */ @@ -60,8 +62,7 @@ export const ProposalVotes = ({ votingOpen, footer, hideVotedAt, - hideDownload, - allVotes, + getAllVotes, exportVoteTransformer, }: ProposalVotesProps) => { const { t } = useTranslation() @@ -69,24 +70,32 @@ export const ProposalVotes = ({ const timeAgoFormatter = useTranslatedTimeDeltaFormatter({ words: true }) const votesLoadingOrUpdating = votes.loading || !!votes.updating - const votesWithDate = - votes.loading || votes.errored - ? [] - : votes.data.sort( - (a, b) => - // Sort descending by date, and those without a date last. - (b.votedAt?.getTime() ?? -Infinity) - - (a.votedAt?.getTime() ?? -Infinity) - ) - const allVotesWithDate = - allVotes.loading || allVotes.errored - ? [] - : allVotes.data.sort( - (a, b) => - // Sort descending by date, and those without a date last. - (b.votedAt?.getTime() ?? -Infinity) - - (a.votedAt?.getTime() ?? -Infinity) - ) + + const [loadingAllVotes, setLoadingAllVotes] = useState(false) + const [allVotes, setAllVotes] = useState[]>() + const downloadVotes = async () => { + if (!getAllVotes) { + return + } + + setLoadingAllVotes(true) + + try { + const allVotes = (await getAllVotes()).sort( + (a, b) => + // Sort descending by date, and those without a date last. + (b.votedAt?.getTime() ?? -Infinity) - + (a.votedAt?.getTime() ?? -Infinity) + ) + + setAllVotes(allVotes) + } catch (err) { + console.error(err) + toast.error(processError(err, { forceCapture: false })) + } finally { + setLoadingAllVotes(false) + } + } // If a new vote is added to existing votes and the window is scrolled to the // bottom, scroll to the bottom again to show the new vote. @@ -123,8 +132,6 @@ export const ProposalVotes = ({ setPrevVoteCount(newVoteCount) }, [prevVoteCount, votes]) - const csvLinkRef = useRef() - return ( <>
@@ -161,7 +168,7 @@ export const ProposalVotes = ({

{/* Votes */} - {votesWithDate.map( + {(votes.loading || votes.errored ? [] : votes.data).map( ( { votedAt, voterAddress, vote, votingPowerPercent, rationale }, index @@ -221,15 +228,19 @@ export const ProposalVotes = ({ )}
- {votes.loading && } + {votes.loading ? ( + + ) : votes.updating ? ( + + ) : null} {footer} - {!hideDownload && ( + {!!getAllVotes && (
- {!hideDownload && ( + {!!getAllVotes && allVotes && ( ({ ), ]} filename="votes.csv" - ref={(ref: any) => (csvLinkRef.current = ref?.link ?? undefined)} + ref={(ref: any) => { + // Download right away and clear. + ;(ref?.link as HTMLAnchorElement | undefined)?.click() + setAllVotes(undefined) + }} /> )} diff --git a/packages/stateless/components/proposal/index.ts b/packages/stateless/components/proposal/index.ts index 064439a0c..e28c57a11 100644 --- a/packages/stateless/components/proposal/index.ts +++ b/packages/stateless/components/proposal/index.ts @@ -4,7 +4,6 @@ export * from './GovProposalVoteDisplay' export * from './GovProposalWalletVote' export * from './NewProposal' export * from './NewProposalTitleDescriptionHeader' -export * from './PaginatedProposalVotes' export * from './PreProposeApprovalProposalStatus' export * from './ProgressBar' export * from './ProposalCard' diff --git a/packages/stateless/hooks/useInfiniteScroll.ts b/packages/stateless/hooks/useInfiniteScroll.ts index f28cd9d3f..b4256c710 100644 --- a/packages/stateless/hooks/useInfiniteScroll.ts +++ b/packages/stateless/hooks/useInfiniteScroll.ts @@ -5,6 +5,10 @@ export type UseInfiniteScrollOptions = { * The callback to execute when moving to the next page. */ loadMore: () => void + /** + * Optionally specify an element instead of using the ref in the return value. + */ + scrollElement?: HTMLElement | null /** * The infinite scroll factor is how close to the bottom the user has to be to * load more. 0 triggers loading when scrolled all the way to the bottom, and @@ -37,15 +41,25 @@ export type UseInfiniteScrollReturn = { */ export const useInfiniteScroll = ({ loadMore, + scrollElement, infiniteScrollFactor = 1, disabled, }: UseInfiniteScrollOptions): UseInfiniteScrollReturn => { - const [element, setElement] = useState(null) + const [element, setElement] = useState( + scrollElement || null + ) const infiniteScrollRef = useCallback( (node: HTMLElement | null) => setElement(node), [setElement] ) + // Use scrollElement from options if exists. + useEffect(() => { + if (scrollElement !== undefined && element !== scrollElement) { + setElement(scrollElement) + } + }, [element, scrollElement]) + // Memoize loadMore in case it changes between renders. const loadMoreRef = useRef(loadMore) loadMoreRef.current = loadMore diff --git a/packages/stateless/pages/Proposal.stories.tsx b/packages/stateless/pages/Proposal.stories.tsx index c8239c80c..294c84e11 100644 --- a/packages/stateless/pages/Proposal.stories.tsx +++ b/packages/stateless/pages/Proposal.stories.tsx @@ -53,7 +53,7 @@ Default.args = { {...(ProposalVoteTallyStory.args as ProposalVoteTallyProps)} /> ), - votesCast: , + VotesCast: () => , contentDisplay: ( ProposalStatusAndInfo: ComponentType<{ inline?: boolean }> } export const Proposal = ({ voteTally, - votesCast, contentDisplay, + VotesCast, ProposalStatusAndInfo, }: ProposalProps) => { // Scroll to hash manually if available since this component and thus the @@ -40,6 +41,8 @@ export const Proposal = ({ } }, []) + const [scrollElement, setScrollElement] = useState(null) + return ( // Undo page container padding so we can add those to our scrollable view // instead. Also set height to full height of parent and some overflow to @@ -63,6 +66,7 @@ export const Proposal = ({ PAGE_PADDING_BOTTOM_CLASSES, PAGE_PADDING_HORIZONTAL_CLASSES )} + ref={(ref) => setScrollElement(ref)} >
{contentDisplay}
@@ -72,7 +76,11 @@ export const Proposal = ({
{voteTally}
-
{votesCast}
+ {VotesCast && ( +
+ +
+ )}
) diff --git a/packages/types/proposal-module-adapter.ts b/packages/types/proposal-module-adapter.ts index 9e9f3520d..8771c9964 100644 --- a/packages/types/proposal-module-adapter.ts +++ b/packages/types/proposal-module-adapter.ts @@ -96,7 +96,7 @@ export type IProposalModuleAdapter = { ProposalVoter: ComponentType ProposalInnerContentDisplay: ComponentType ProposalWalletVote: ComponentType> - ProposalVotes: ComponentType + ProposalVotes: ComponentType ProposalVoteTally: ComponentType ProposalLine: ComponentType @@ -295,6 +295,13 @@ export type BaseProposalVoterProps = { onVoteSuccess: () => void | Promise } & Pick +export type BaseProposalVotesProps = { + /** + * The proposal container that scrolls. + */ + scrollElement: HTMLElement | null +} + export type BasePreProposeProposalStatusAndInfoProps = Pick< BaseProposalStatusAndInfoProps, 'inline' From fee68700381732d7822b95194e60401a4dc64325 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 23 May 2024 14:36:39 -0400 Subject: [PATCH 185/438] removed voteCount selectors --- .../contracts/DaoProposalMultiple.ts | 34 ------------------- .../contracts/DaoProposalSingle.common.ts | 34 ------------------- 2 files changed, 68 deletions(-) diff --git a/packages/state/recoil/selectors/contracts/DaoProposalMultiple.ts b/packages/state/recoil/selectors/contracts/DaoProposalMultiple.ts index 1d51971f8..d6a3cb008 100644 --- a/packages/state/recoil/selectors/contracts/DaoProposalMultiple.ts +++ b/packages/state/recoil/selectors/contracts/DaoProposalMultiple.ts @@ -418,37 +418,3 @@ export const listAllVotesSelector = selectorFamily< return votes }, }) - -export const voteCountSelector = selectorFamily< - number | undefined, - QueryClientParams & { - proposalId: number - } ->({ - key: 'daoProposalMultipleVoteCount', - get: - ({ proposalId, ...queryClientParams }) => - async ({ get }) => { - const id = - get(refreshProposalsIdAtom) + - get( - refreshProposalIdAtom({ - address: queryClientParams.contractAddress, - proposalId, - }) - ) - - return ( - get( - queryContractIndexerSelector({ - ...queryClientParams, - formula: 'daoProposalMultiple/voteCount', - args: { - proposalId, - }, - id, - }) - ) ?? undefined - ) - }, -}) diff --git a/packages/state/recoil/selectors/contracts/DaoProposalSingle.common.ts b/packages/state/recoil/selectors/contracts/DaoProposalSingle.common.ts index 8b1f8b831..1248b0240 100644 --- a/packages/state/recoil/selectors/contracts/DaoProposalSingle.common.ts +++ b/packages/state/recoil/selectors/contracts/DaoProposalSingle.common.ts @@ -322,37 +322,3 @@ export const reverseProposalsSelector = selectorFamily< ) }, }) - -export const voteCountSelector = selectorFamily< - number | undefined, - QueryClientParams & { - proposalId: number - } ->({ - key: 'daoProposalSingleCommonVoteCount', - get: - ({ proposalId, ...queryClientParams }) => - async ({ get }) => { - const id = - get(refreshProposalsIdAtom) + - get( - refreshProposalIdAtom({ - address: queryClientParams.contractAddress, - proposalId, - }) - ) - - return ( - get( - queryContractIndexerSelector({ - ...queryClientParams, - formula: 'daoProposalSingle/voteCount', - args: { - proposalId, - }, - id, - }) - ) ?? undefined - ) - }, -}) From 845a2157ffca404009db61b5b562d42031179a55 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 23 May 2024 15:40:48 -0400 Subject: [PATCH 186/438] load more votes at once and wait until closer to bottom of screen to load more --- packages/stateful/components/gov/GovProposalVotes.tsx | 4 ++-- .../DaoProposalMultiple/components/ProposalVotes/index.tsx | 4 ++-- .../DaoProposalSingle/components/ProposalVotes/index.tsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/stateful/components/gov/GovProposalVotes.tsx b/packages/stateful/components/gov/GovProposalVotes.tsx index 4c88f22f9..62ffc3a10 100644 --- a/packages/stateful/components/gov/GovProposalVotes.tsx +++ b/packages/stateful/components/gov/GovProposalVotes.tsx @@ -22,7 +22,7 @@ import { import { EntityDisplay } from '../EntityDisplay' import { SuspenseLoader } from '../SuspenseLoader' -const VOTES_PER_PAGE = 10 +const VOTES_PER_PAGE = 20 export type GovProposalVotesProps = BaseProposalVotesProps & { proposalId: string @@ -93,7 +93,7 @@ const InnerGovProposalVotes = ({ scrollElement, loadMore: loadVotes, disabled: loading || noMoreVotes, - infiniteScrollFactor: 0.2, + infiniteScrollFactor: 0.01, }) return ( diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx index 10fe0f665..56237bc52 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx @@ -14,7 +14,7 @@ import { useProposalModuleAdapterOptions } from '../../../../react/context' import { useLoadingProposal, useLoadingVoteOptions } from '../../hooks' import { VoteDisplay } from './VoteDisplay' -const VOTES_PER_PAGE = 15 +const VOTES_PER_PAGE = 20 export const ProposalVotes = ({ scrollElement }: BaseProposalVotesProps) => { const { @@ -122,7 +122,7 @@ export const ProposalVotes = ({ scrollElement }: BaseProposalVotesProps) => { scrollElement, loadMore: loadVotes, disabled: loading || noMoreVotes, - infiniteScrollFactor: 0.2, + infiniteScrollFactor: 0.01, }) return ( diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx index 4dece003a..d8d30af10 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx @@ -14,7 +14,7 @@ import { useProposalModuleAdapterOptions } from '../../../../react/context' import { useLoadingProposal } from '../../hooks' import { VoteDisplay } from './VoteDisplay' -const VOTES_PER_PAGE = 15 +const VOTES_PER_PAGE = 20 export const ProposalVotes = ({ scrollElement }: BaseProposalVotesProps) => { const { @@ -121,7 +121,7 @@ export const ProposalVotes = ({ scrollElement }: BaseProposalVotesProps) => { scrollElement, loadMore: loadVotes, disabled: loading || noMoreVotes, - infiniteScrollFactor: 0.2, + infiniteScrollFactor: 0.01, }) return ( From 0281339b3ead2ab311da02ea91d99bab08297487 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 24 May 2024 16:56:13 -0400 Subject: [PATCH 187/438] neutron stopped using N proposal prefix scheme, so stop using it --- .../stateful/utils/fetchProposalModules.ts | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/packages/stateful/utils/fetchProposalModules.ts b/packages/stateful/utils/fetchProposalModules.ts index 8408546c5..1bd15e1cc 100644 --- a/packages/stateful/utils/fetchProposalModules.ts +++ b/packages/stateful/utils/fetchProposalModules.ts @@ -4,7 +4,6 @@ import { } from '@dao-dao/state/contracts' import { queryIndexer } from '@dao-dao/state/indexer' import { - ChainId, ContractVersion, Feature, ProposalModule, @@ -15,7 +14,6 @@ import { ProposalModuleWithInfo } from '@dao-dao/types/contracts/DaoCore.v2' import { DaoProposalMultipleAdapterId, DaoProposalSingleAdapterId, - NEUTRON_GOVERNANCE_DAO, cosmWasmClientRouter, getRpcForChainId, indexToProposalModulePrefix, @@ -79,20 +77,12 @@ export const fetchProposalModules = async ( return { address, - prefix: - // Follow Neutron's naming convention. Shift prefix alphabet starting - // point from A to N. - chainId === ChainId.NeutronMainnet && - coreAddress === NEUTRON_GOVERNANCE_DAO - ? String.fromCharCode( - prefix.charCodeAt(0) + ('N'.charCodeAt(0) - 'A'.charCodeAt(0)) - ) - : isFeatureSupportedByVersion( - Feature.StaticProposalModulePrefixes, - coreVersion - ) - ? prefix - : indexToProposalModulePrefix(index), + prefix: isFeatureSupportedByVersion( + Feature.StaticProposalModulePrefixes, + coreVersion + ) + ? prefix + : indexToProposalModulePrefix(index), contractName: info?.contract || '', version, prePropose: From 50097eab70fa7a16e10f6ac842ce7bd68c62c7f1 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 26 May 2024 20:57:57 -0400 Subject: [PATCH 188/438] fixed infinite refresh if invalid proposal expiration date --- packages/stateless/hooks/useExecuteAt.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/stateless/hooks/useExecuteAt.ts b/packages/stateless/hooks/useExecuteAt.ts index 4355f6e6f..ee24dea82 100644 --- a/packages/stateless/hooks/useExecuteAt.ts +++ b/packages/stateless/hooks/useExecuteAt.ts @@ -21,11 +21,13 @@ export const useExecuteAt = ({ fn, date }: UseExecuteAtOptions) => { const fnRef = useUpdatingRef(fn) useEffect(() => { - if (!date) { + const dateTime = date?.getTime() + // Check if date defined and valid. + if (!dateTime || isNaN(dateTime)) { return } - const msRemaining = date.getTime() - Date.now() + const msRemaining = dateTime - Date.now() if (msRemaining < 0) { return } From 2c183db73cd8a8bfe40b99dc64c821450fd172a2 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 26 May 2024 21:39:57 -0400 Subject: [PATCH 189/438] fixed vote infinite scroll --- .../components/gov/GovProposalVotes.tsx | 9 ++--- .../components/ProposalVotes/index.tsx | 9 ++--- .../components/ProposalVotes/index.tsx | 9 ++--- .../components/proposal/ProposalVotes.tsx | 25 ++++++++++--- packages/stateless/hooks/useInfiniteScroll.ts | 36 +++++++++---------- packages/stateless/pages/Proposal.tsx | 11 ++---- packages/types/proposal-module-adapter.ts | 4 +-- 7 files changed, 58 insertions(+), 45 deletions(-) diff --git a/packages/stateful/components/gov/GovProposalVotes.tsx b/packages/stateful/components/gov/GovProposalVotes.tsx index 62ffc3a10..2dd186e3e 100644 --- a/packages/stateful/components/gov/GovProposalVotes.tsx +++ b/packages/stateful/components/gov/GovProposalVotes.tsx @@ -36,7 +36,7 @@ export const GovProposalVotes = (props: GovProposalVotesProps) => ( const InnerGovProposalVotes = ({ proposalId, - scrollElement, + ...props }: GovProposalVotesProps) => { const { chain_id: chainId } = useChain() @@ -89,17 +89,17 @@ const InnerGovProposalVotes = ({ // eslint-disable-next-line react-hooks/exhaustive-deps }, []) - useInfiniteScroll({ - scrollElement, + const { infiniteScrollRef } = useInfiniteScroll({ loadMore: loadVotes, disabled: loading || noMoreVotes, - infiniteScrollFactor: 0.01, + infiniteScrollFactor: 0.1, }) return ( voteOptionToJSON(vote)} hideVotedAt votes={ @@ -113,6 +113,7 @@ const InnerGovProposalVotes = ({ } } votingOpen={false} + {...props} /> ) } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx index 56237bc52..dfcaf9822 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx @@ -16,7 +16,7 @@ import { VoteDisplay } from './VoteDisplay' const VOTES_PER_PAGE = 20 -export const ProposalVotes = ({ scrollElement }: BaseProposalVotesProps) => { +export const ProposalVotes = (props: BaseProposalVotesProps) => { const { chain: { chain_id: chainId }, proposalModule: { address: proposalModuleAddress }, @@ -118,17 +118,17 @@ export const ProposalVotes = ({ scrollElement }: BaseProposalVotesProps) => { ) ) - useInfiniteScroll({ - scrollElement, + const { infiniteScrollRef } = useInfiniteScroll({ loadMore: loadVotes, disabled: loading || noMoreVotes, - infiniteScrollFactor: 0.01, + infiniteScrollFactor: 0.1, }) return ( voteOptions.loading ? 'LOADING_ERROR' @@ -148,6 +148,7 @@ export const ProposalVotes = ({ scrollElement }: BaseProposalVotesProps) => { } } votingOpen={!loadingProposal.loading && loadingProposal.data.votingOpen} + {...props} /> ) } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx index d8d30af10..0c462fa93 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx @@ -16,7 +16,7 @@ import { VoteDisplay } from './VoteDisplay' const VOTES_PER_PAGE = 20 -export const ProposalVotes = ({ scrollElement }: BaseProposalVotesProps) => { +export const ProposalVotes = (props: BaseProposalVotesProps) => { const { proposalModule: { address: proposalModuleAddress }, proposalNumber, @@ -117,17 +117,17 @@ export const ProposalVotes = ({ scrollElement }: BaseProposalVotesProps) => { ) ) - useInfiniteScroll({ - scrollElement, + const { infiniteScrollRef } = useInfiniteScroll({ loadMore: loadVotes, disabled: loading || noMoreVotes, - infiniteScrollFactor: 0.01, + infiniteScrollFactor: 0.1, }) return ( vote} getAllVotes={getAllVotes} votes={ @@ -141,6 +141,7 @@ export const ProposalVotes = ({ scrollElement }: BaseProposalVotesProps) => { } } votingOpen={!loadingProposal.loading && loadingProposal.data.votingOpen} + {...props} /> ) } diff --git a/packages/stateless/components/proposal/ProposalVotes.tsx b/packages/stateless/components/proposal/ProposalVotes.tsx index 6f76cb0df..dccd3aee1 100644 --- a/packages/stateless/components/proposal/ProposalVotes.tsx +++ b/packages/stateless/components/proposal/ProposalVotes.tsx @@ -3,6 +3,7 @@ import { ComponentType, Fragment, ReactNode, + RefCallback, useEffect, useRef, useState, @@ -53,6 +54,14 @@ export interface ProposalVotesProps { * A function to convert the vote type into a string for the CSV. */ exportVoteTransformer: (vote: Vote) => string + /** + * Optional class names to apply to the container. + */ + className?: string + /** + * Optional ref to apply to the container. + */ + containerRef?: RefCallback } export const ProposalVotes = ({ @@ -64,6 +73,8 @@ export const ProposalVotes = ({ hideVotedAt, getAllVotes, exportVoteTransformer, + className, + containerRef, }: ProposalVotesProps) => { const { t } = useTranslation() @@ -100,18 +111,18 @@ export const ProposalVotes = ({ // If a new vote is added to existing votes and the window is scrolled to the // bottom, scroll to the bottom again to show the new vote. const [prevVoteCount, setPrevVoteCount] = useState(0) - const containerRef = useRef(null) + const ourContainerRef = useRef(null) useEffect(() => { const newVoteCount = votes.loading || votes.errored ? 0 : votes.data.length if ( votes.loading || - !containerRef.current || + !ourContainerRef.current || prevVoteCount === newVoteCount ) { return } - const parent = getScrollableAncestor(containerRef.current) + const parent = getScrollableAncestor(ourContainerRef.current) if (!parent) { return } @@ -134,7 +145,13 @@ export const ProposalVotes = ({ return ( <> -
+
{ + ourContainerRef.current = ref + containerRef?.(ref) + }} + >

{t('title.votesCast')}

diff --git a/packages/stateless/hooks/useInfiniteScroll.ts b/packages/stateless/hooks/useInfiniteScroll.ts index b4256c710..28f96cedd 100644 --- a/packages/stateless/hooks/useInfiniteScroll.ts +++ b/packages/stateless/hooks/useInfiniteScroll.ts @@ -1,4 +1,6 @@ -import { RefCallback, useCallback, useEffect, useRef, useState } from 'react' +import { RefCallback, useCallback, useEffect, useState } from 'react' + +import { useUpdatingRef } from './useUpdatingRef' export type UseInfiniteScrollOptions = { /** @@ -8,7 +10,7 @@ export type UseInfiniteScrollOptions = { /** * Optionally specify an element instead of using the ref in the return value. */ - scrollElement?: HTMLElement | null + element?: HTMLElement | null /** * The infinite scroll factor is how close to the bottom the user has to be to * load more. 0 triggers loading when scrolled all the way to the bottom, and @@ -27,42 +29,40 @@ export type UseInfiniteScrollOptions = { export type UseInfiniteScrollReturn = { /** - * The ref to set on the container. + * The ref to set on the element you want to track. */ infiniteScrollRef: RefCallback } /** - * A hook that triggers a callback when the user scrolls to the bottom of the - * container, as determined by the bottom of the container reaching a certain - * threshold below the bottom of the window. + * A hook that triggers a callback when the user scrolls to the bottom of an + * element, as determined by the bottom of the element reaching a certain + * threshold below the bottom of the window. This element should NOT be the + * scrollable container itself, but instead the element inside the container + * that contains the content. * * The returned `infiniteScrollRef` should be set on the container element. */ export const useInfiniteScroll = ({ loadMore, - scrollElement, + element: _element, infiniteScrollFactor = 1, disabled, }: UseInfiniteScrollOptions): UseInfiniteScrollReturn => { - const [element, setElement] = useState( - scrollElement || null - ) + const [element, setElement] = useState(_element || null) const infiniteScrollRef = useCallback( (node: HTMLElement | null) => setElement(node), [setElement] ) - // Use scrollElement from options if exists. + // Use _element from options if exists. useEffect(() => { - if (scrollElement !== undefined && element !== scrollElement) { - setElement(scrollElement) + if (_element !== undefined && element !== _element) { + setElement(_element) } - }, [element, scrollElement]) + }, [element, _element]) - // Memoize loadMore in case it changes between renders. - const loadMoreRef = useRef(loadMore) - loadMoreRef.current = loadMore + const loadMoreRef = useUpdatingRef(loadMore) useEffect(() => { if ( @@ -103,7 +103,7 @@ export const useInfiniteScroll = ({ // waiting for them to bubble up. window.addEventListener('scroll', onScroll, true) return () => window.removeEventListener('scroll', onScroll, true) - }, [infiniteScrollFactor, disabled, element]) + }, [infiniteScrollFactor, disabled, element, loadMoreRef]) return { infiniteScrollRef, diff --git a/packages/stateless/pages/Proposal.tsx b/packages/stateless/pages/Proposal.tsx index c8f1b3429..8718bf1b6 100644 --- a/packages/stateless/pages/Proposal.tsx +++ b/packages/stateless/pages/Proposal.tsx @@ -1,5 +1,5 @@ import clsx from 'clsx' -import { ComponentType, ReactNode, useEffect, useState } from 'react' +import { ComponentType, ReactNode, useEffect } from 'react' import { BaseProposalVotesProps } from '@dao-dao/types' import { @@ -41,8 +41,6 @@ export const Proposal = ({ } }, []) - const [scrollElement, setScrollElement] = useState(null) - return ( // Undo page container padding so we can add those to our scrollable view // instead. Also set height to full height of parent and some overflow to @@ -66,7 +64,6 @@ export const Proposal = ({ PAGE_PADDING_BOTTOM_CLASSES, PAGE_PADDING_HORIZONTAL_CLASSES )} - ref={(ref) => setScrollElement(ref)} >
{contentDisplay}
@@ -76,11 +73,7 @@ export const Proposal = ({
{voteTally}
- {VotesCast && ( -
- -
- )} + {VotesCast && }
) diff --git a/packages/types/proposal-module-adapter.ts b/packages/types/proposal-module-adapter.ts index 8771c9964..e6582cf30 100644 --- a/packages/types/proposal-module-adapter.ts +++ b/packages/types/proposal-module-adapter.ts @@ -297,9 +297,9 @@ export type BaseProposalVoterProps = { export type BaseProposalVotesProps = { /** - * The proposal container that scrolls. + * An optional class name. */ - scrollElement: HTMLElement | null + className?: string } export type BasePreProposeProposalStatusAndInfoProps = Pick< From da891f956b28c187905006c4e68a572ad1b5c796 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 26 May 2024 21:40:36 -0400 Subject: [PATCH 190/438] add max height to read only code displays --- packages/stateless/components/inputs/CodeMirrorInput.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/stateless/components/inputs/CodeMirrorInput.tsx b/packages/stateless/components/inputs/CodeMirrorInput.tsx index 561d68e42..e46cbdb73 100644 --- a/packages/stateless/components/inputs/CodeMirrorInput.tsx +++ b/packages/stateless/components/inputs/CodeMirrorInput.tsx @@ -1,6 +1,7 @@ import 'codemirror/lib/codemirror.css' import 'codemirror/theme/material.css' +import clsx from 'clsx' import dynamic from 'next/dynamic' import { Control, @@ -80,7 +81,10 @@ export function CodeMirrorInput>({ name={fieldName} render={({ field: { onChange, onBlur, value } }) => ( onChange(value)} onBlur={(_instance, _event) => onBlur()} options={cmOptions} From 0dae02a09ac1ea33718dfc5f1758903bcbff1c7f Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 26 May 2024 22:02:16 -0400 Subject: [PATCH 191/438] redirect Neutron prefixes --- apps/dapp/next.config.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/apps/dapp/next.config.js b/apps/dapp/next.config.js index 99ec3bf23..e7555d19f 100644 --- a/apps/dapp/next.config.js +++ b/apps/dapp/next.config.js @@ -98,6 +98,22 @@ const config = { destination: '/dao/:chain/:slug*', permanent: false, }, + // Rename Neutron proposal IDs from starting with N to A. + { + source: + '/dao/neutron1suhgf5svhu4usrurvxzlgn54ksxmn8gljarjtxqnapv8kjnp4nrstdxvff/proposals/N:slug', + destination: + '/dao/neutron1suhgf5svhu4usrurvxzlgn54ksxmn8gljarjtxqnapv8kjnp4nrstdxvff/proposals/A:slug', + permanent: true, + }, + // Rename Neutron proposal IDs from starting with P to C. + { + source: + '/dao/neutron1suhgf5svhu4usrurvxzlgn54ksxmn8gljarjtxqnapv8kjnp4nrstdxvff/proposals/P:slug', + destination: + '/dao/neutron1suhgf5svhu4usrurvxzlgn54ksxmn8gljarjtxqnapv8kjnp4nrstdxvff/proposals/C:slug', + permanent: true, + }, ], // Only upload source maps to Sentry in CI action when token is provided. sentry: { From 37b0b9ebab2868ae63f458c4862b20c022ae9c15 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 26 May 2024 22:37:52 -0400 Subject: [PATCH 192/438] fixed displaying vote end block when proposals use block based expiration --- packages/i18n/locales/en/translation.json | 4 + .../components/ProposalStatusAndInfo.tsx | 8 +- .../hooks/useLoadingProposal.tsx | 99 ++++++++++++------- .../adapters/DaoProposalMultiple/types.ts | 14 +-- .../components/ProposalLine.tsx | 2 +- .../components/ProposalStatusAndInfo.tsx | 4 +- .../hooks/useLoadingProposal.tsx | 19 +++- .../adapters/DaoProposalSingle/types.ts | 2 +- packages/types/proposal.ts | 2 +- packages/utils/conversion.ts | 2 +- 10 files changed, 95 insertions(+), 61 deletions(-) diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 965a4db03..0b40980d6 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -1379,6 +1379,8 @@ "votingDurationTooltip": "The maximum amount of time proposals are open for voting.", "votingDurationTooltip_noRevoting": "The maximum amount of time proposals are open for voting. Because you are not allowed to change your vote, proposals can finalize early if sufficient votes are cast to guarantee an outcome.", "votingDurationTooltip_revoting": "The amount of time proposals are open for voting. Because you are allowed to change your vote, a proposal will always stay open this long.", + "votingEndBlockTooltip": "The block height at which voting ends.", + "votingEndedBlockTooltip": "The block height at which voting ended.", "votingModuleAdapterCreationDiscord": "Want to help us support this voting module? Join the <2><0>DAO DAO Discord<1/> and post in #dao-help.", "votingModuleNotYetSupported": "This DAO uses a voting module that our UI does not yet support. Functionality may be limited.", "votingPowerAtCreationTooltip": "This was your voting power at the time of proposal creation.", @@ -1517,6 +1519,7 @@ "balances": "Balances", "beforeYouEnter": "Before you enter", "beginVesting": "Begin vesting", + "blockCompleted": "Block completed", "browserWallets": "Browser wallets", "bulkImportActions": "Bulk Import Actions", "burnNft": "Burn NFT", @@ -1878,6 +1881,7 @@ "votingClosed": "Voting closed", "votingConfiguration": "Voting configuration", "votingEnd": "Voting end", + "votingEndBlock": "Voting end block", "votingOpened": "Voting opened", "votingPower": "Voting power", "votingProgress": "Voting Progress", diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalStatusAndInfo.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalStatusAndInfo.tsx index 613b24388..9a8e882d6 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalStatusAndInfo.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalStatusAndInfo.tsx @@ -172,7 +172,7 @@ const InnerProposalStatusAndInfo = ({ }, date: statusKey === ProposalStatusEnum.Open - ? timestampInfo?.expirationDate + ? timestampInfo.expirationDate : statusKey === 'veto_timelock' ? vetoTimelockExpiration : undefined, @@ -220,13 +220,15 @@ const InnerProposalStatusAndInfo = ({ }, ] as ProposalStatusAndInfoProps['info']) : []), - ...(timestampInfo?.display + ...(timestampInfo.display ? ([ { Icon: HourglassTopRounded, label: timestampInfo.display.label, Value: (props) => ( -

{timestampInfo.display!.content}

+ +

{timestampInfo.display!.content}

+
), }, ] as ProposalStatusAndInfoProps['info']) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useLoadingProposal.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useLoadingProposal.tsx index 00ea21bbe..5e2b9c4da 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useLoadingProposal.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useLoadingProposal.tsx @@ -1,4 +1,3 @@ -import { ReactNode } from 'react' import { useTranslation } from 'react-i18next' import TimeAgo from 'react-timeago' @@ -12,8 +11,16 @@ import { useCachedLoading, useTranslatedTimeDeltaFormatter, } from '@dao-dao/stateless' -import { LoadingData, ProposalStatusEnum } from '@dao-dao/types' -import { convertExpirationToDate, formatDate } from '@dao-dao/utils' +import { + LoadingData, + ProposalStatusEnum, + ProposalTimestampInfo, +} from '@dao-dao/types' +import { + convertExpirationToDate, + formatDate, + formatDateTimeTz, +} from '@dao-dao/utils' import { useProposalModuleAdapterOptions } from '../../../react' import { ProposalWithMetadata } from '../types' @@ -101,45 +108,63 @@ export const useLoadingProposal = (): LoadingData => { const executionDate = typeof executedAt === 'string' && new Date(executedAt) const closeDate = typeof closedAt === 'string' && new Date(closedAt) - const dateDisplay: { label: string; content: ReactNode } | undefined = - votingOpen - ? expirationDate && expirationDate.getTime() > Date.now() - ? { - label: vetoTimelockExpiration - ? t('title.votingTimeLeft') - : t('title.timeLeft'), - content: ( - - ), - } - : undefined - : executionDate - ? { - label: t('proposalStatusTitle.executed'), - content: formatDate(executionDate), - } - : closeDate + const dateDisplay: ProposalTimestampInfo['display'] | undefined = votingOpen + ? expirationDate && expirationDate.getTime() > Date.now() ? { - label: t('proposalStatusTitle.closed'), - content: formatDate(closeDate), + label: vetoTimelockExpiration + ? t('title.votingTimeLeft') + : t('title.timeLeft'), + tooltip: formatDateTimeTz(expirationDate), + content: ( + + ), } - : completionDate + : 'at_height' in proposal.expiration && + proposal.expiration.at_height > blockHeightLoadable.contents ? { - label: t('info.completed'), - content: formatDate(completionDate), - } - : expirationDate - ? { - label: - // If voting is closed, expiration should not be in the future, but - // just in case... - expirationDate.getTime() > Date.now() - ? t('title.expires') - : t('info.completed'), - content: formatDate(expirationDate), + label: t('title.votingEndBlock'), + tooltip: t('info.votingEndBlockTooltip'), + content: BigInt(proposal.expiration.at_height).toLocaleString(), } : undefined - const timestampInfo = expirationDate && { + : executionDate + ? { + label: t('proposalStatusTitle.executed'), + tooltip: formatDateTimeTz(executionDate), + content: formatDate(executionDate), + } + : closeDate + ? { + label: t('proposalStatusTitle.closed'), + tooltip: formatDateTimeTz(closeDate), + content: formatDate(closeDate), + } + : completionDate + ? { + label: t('info.completed'), + tooltip: formatDateTimeTz(completionDate), + content: formatDate(completionDate), + } + : expirationDate + ? { + label: + // If voting is closed, expiration should not be in the future, but + // just in case... + expirationDate.getTime() > Date.now() + ? t('title.expires') + : t('title.completed'), + tooltip: formatDateTimeTz(expirationDate), + content: formatDate(expirationDate), + } + : 'at_height' in proposal.expiration + ? { + label: t('title.blockCompleted'), + tooltip: t('info.votingEndedBlockTooltip'), + content: BigInt(proposal.expiration.at_height).toLocaleString(), + } + : undefined + + const timestampInfo: ProposalTimestampInfo = { display: dateDisplay, expirationDate, } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/types.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/types.ts index d0bf3a7b4..75a87d4b0 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/types.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/types.ts @@ -1,5 +1,3 @@ -import { ReactNode } from 'react' - import { ActionAndData, ActionKeyAndData, @@ -7,6 +5,7 @@ import { DepositInfoSelector, IProposalModuleAdapterCommonOptions, ProcessedTQ, + ProposalTimestampInfo, ProposalVoteOption, } from '@dao-dao/types' import { @@ -98,17 +97,8 @@ export type UsePublishProposal = () => { simulationBypassExpiration: Date | undefined } -export interface TimestampInfo { - display?: { - label: string - tooltip?: string - content: ReactNode - } - expirationDate: Date -} - export type ProposalWithMetadata = MultipleChoiceProposal & { - timestampInfo: TimestampInfo | undefined + timestampInfo: ProposalTimestampInfo votingOpen: boolean executedAt?: Date // If this proposal is in its veto timelock period, this is the date that the diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalLine.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalLine.tsx index 28a4a6d00..e3ead54c0 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalLine.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalLine.tsx @@ -78,7 +78,7 @@ const InnerProposalLine = ({ /> ), } - : proposal.timestampInfo?.display + : proposal.timestampInfo.display } title={proposal.title} vote={ diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfo.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfo.tsx index 4bcc8d916..35831951e 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfo.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfo.tsx @@ -227,7 +227,7 @@ const InnerProposalStatusAndInfo = ({ }, date: statusKey === ProposalStatusEnum.Open - ? timestampInfo?.expirationDate + ? timestampInfo.expirationDate : statusKey === 'veto_timelock' ? vetoTimelockExpiration : undefined, @@ -308,7 +308,7 @@ const InnerProposalStatusAndInfo = ({ }, ] as ProposalStatusAndInfoProps['info']) : []), - ...(timestampInfo?.display + ...(timestampInfo.display ? ([ { Icon: HourglassTopRounded, diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingProposal.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingProposal.tsx index b8ca94b82..b9e7336fd 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingProposal.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingProposal.tsx @@ -225,6 +225,13 @@ export const useLoadingProposal = (): LoadingData => { ), } + : 'at_height' in proposal.expiration && + proposal.expiration.at_height > blockHeightLoadable.contents + ? { + label: t('title.votingEndBlock'), + tooltip: t('info.votingEndBlockTooltip'), + content: BigInt(proposal.expiration.at_height).toLocaleString(), + } : undefined : executionDate ? { @@ -240,7 +247,7 @@ export const useLoadingProposal = (): LoadingData => { } : completionDate ? { - label: t('info.completed'), + label: t('title.completed'), tooltip: formatDateTimeTz(completionDate), content: formatDate(completionDate), } @@ -251,13 +258,19 @@ export const useLoadingProposal = (): LoadingData => { // just in case... expirationDate.getTime() > Date.now() ? t('title.expires') - : t('info.completed'), + : t('title.completed'), tooltip: formatDateTimeTz(expirationDate), content: formatDate(expirationDate), } + : 'at_height' in proposal.expiration + ? { + label: t('title.blockCompleted'), + tooltip: t('info.votingEndedBlockTooltip'), + content: BigInt(proposal.expiration.at_height).toLocaleString(), + } : undefined - const timestampInfo: ProposalTimestampInfo | undefined = expirationDate && { + const timestampInfo: ProposalTimestampInfo = { display: dateDisplay, expirationDate, } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/types.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/types.ts index 4e3553ccb..6905f6f70 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/types.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/types.ts @@ -98,7 +98,7 @@ export type UsePublishProposal = () => { } export type ProposalWithMetadata = (Proposal | SingleChoiceProposal) & { - timestampInfo: ProposalTimestampInfo | undefined + timestampInfo: ProposalTimestampInfo votingOpen: boolean executedAt?: Date // If this proposal was approved by a pre-propose-approver in another DAO, diff --git a/packages/types/proposal.ts b/packages/types/proposal.ts index f978fb179..ac1e3d6c4 100644 --- a/packages/types/proposal.ts +++ b/packages/types/proposal.ts @@ -240,5 +240,5 @@ export type ProposalTimestampInfo = { tooltip?: string content: ReactNode } - expirationDate: Date + expirationDate?: Date } diff --git a/packages/utils/conversion.ts b/packages/utils/conversion.ts index a7e7cc39a..f6011b868 100644 --- a/packages/utils/conversion.ts +++ b/packages/utils/conversion.ts @@ -295,7 +295,7 @@ export const convertExpirationToDate = ( // For converting height to rough date. currentBlockHeight: number ): Date | undefined => - 'at_height' in expiration && currentBlockHeight > 0 + 'at_height' in expiration && currentBlockHeight > 0 && blocksPerYear > 0 ? new Date( Date.now() + convertBlocksToSeconds( From 2ddd13596836d2b4830cecdba49015d1c2a3bd9c Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 27 May 2024 20:08:31 -0400 Subject: [PATCH 193/438] moved stateful selectors to state --- packages/state/recoil/atoms/dao.ts | 31 ++ packages/state/recoil/atoms/index.ts | 1 + packages/state/recoil/atoms/misc.ts | 7 + .../recoil/selectors/dao.ts} | 400 +++++++-------- packages/state/recoil/selectors/discord.ts | 13 +- .../recoil/selectors}/following.ts | 69 +-- packages/state/recoil/selectors/index.ts | 3 + packages/state/recoil/selectors/indexer.ts | 9 +- packages/state/recoil/selectors/nft.ts | 382 +++++++++++++- packages/state/recoil/selectors/profile.ts | 264 +++++++++- packages/state/recoil/selectors/token.ts | 293 ++++++++++- packages/state/recoil/selectors/treasury.ts | 309 +++++++++++- .../recoil/selectors/vesting.ts | 22 +- packages/state/recoil/selectors/wallet.ts | 464 +++++++++++++++++- .../core/dao_governance/CreateDao/index.tsx | 2 +- .../ManageVetoableDaos/index.tsx | 2 +- .../dao_governance/UpgradeV1ToV2/index.tsx | 6 +- .../actions/core/nfts/BurnNft/index.tsx | 10 +- .../actions/core/nfts/MintNft/MintNft.tsx | 2 +- .../actions/core/nfts/TransferNft/index.tsx | 10 +- .../core/treasury/ManageVesting/index.tsx | 8 +- packages/stateful/components/DappLayout.tsx | 6 +- .../components/PfpkNftSelectionModal.tsx | 2 +- packages/stateful/components/ProposalList.tsx | 10 +- .../components/TreasuryHistoryGraph.tsx | 3 +- .../stateful/components/dao/DaoTokenCard.tsx | 6 +- .../stateful/components/dao/DaoTokenLine.tsx | 2 +- .../components/dao/tabs/TreasuryTab.tsx | 8 +- .../components/gov/GovCommunityPoolTab.tsx | 6 +- .../stateful/components/gov/GovTokenLine.tsx | 2 +- .../stateful/components/nft/LazyNftCard.tsx | 10 +- .../stateful/components/pages/Account.tsx | 3 +- .../components/profile/ProfileActions.tsx | 11 +- .../components/profile/ProfileWallet.tsx | 10 +- .../components/vesting/VestingPaymentCard.tsx | 2 +- .../stateful/components/wallet/WalletDaos.tsx | 10 +- .../components/wallet/WalletTokenCard.tsx | 8 +- .../wallet/WalletTokenCardReadonly.tsx | 2 +- .../components/wallet/WalletTokenLine.tsx | 2 +- .../wallet/WalletTokenLineReadonly.tsx | 2 +- packages/stateful/feed/react/useFeed.ts | 2 +- .../feed/sources/OpenProposals/index.ts | 6 +- .../feed/sources/VetoableProposals/index.ts | 6 +- .../feed/sources/VetoableProposals/state.ts | 7 +- packages/stateful/hooks/useEntity.ts | 8 +- packages/stateful/hooks/useFollowingDaos.ts | 10 +- .../stateful/hooks/useLoadingDaoCardInfos.ts | 7 +- packages/stateful/hooks/useManageProfile.ts | 3 +- packages/stateful/hooks/useProfile.ts | 3 +- .../recoil/selectors/{dao/misc.ts => dao.ts} | 437 ++++++++++------- .../stateful/recoil/selectors/dao/index.ts | 4 - packages/stateful/recoil/selectors/entity.ts | 2 +- packages/stateful/recoil/selectors/index.ts | 8 +- packages/stateful/recoil/selectors/nft.ts | 388 --------------- packages/stateful/recoil/selectors/profile.ts | 286 ----------- .../recoil/selectors/{dao => }/proposal.ts | 2 +- packages/stateful/recoil/selectors/token.ts | 302 ------------ .../stateful/recoil/selectors/treasury.ts | 310 ------------ packages/stateful/recoil/selectors/wallet.ts | 452 ----------------- .../hooks/useStakingInfo.ts | 2 +- .../widgets/MintNft/MintNftRenderer.tsx | 3 +- .../Renderer/TabRenderer/index.tsx | 6 +- packages/utils/index.ts | 1 + packages/utils/profile.ts | 26 + 64 files changed, 2328 insertions(+), 2365 deletions(-) create mode 100644 packages/state/recoil/atoms/dao.ts rename packages/{stateful/recoil/selectors/dao/cards.ts => state/recoil/selectors/dao.ts} (52%) rename packages/{stateful/recoil/selectors/dao => state/recoil/selectors}/following.ts (64%) rename packages/{stateful => state}/recoil/selectors/vesting.ts (97%) rename packages/stateful/recoil/selectors/{dao/misc.ts => dao.ts} (73%) delete mode 100644 packages/stateful/recoil/selectors/dao/index.ts delete mode 100644 packages/stateful/recoil/selectors/nft.ts delete mode 100644 packages/stateful/recoil/selectors/profile.ts rename packages/stateful/recoil/selectors/{dao => }/proposal.ts (98%) delete mode 100644 packages/stateful/recoil/selectors/token.ts delete mode 100644 packages/stateful/recoil/selectors/treasury.ts delete mode 100644 packages/stateful/recoil/selectors/wallet.ts create mode 100644 packages/utils/profile.ts diff --git a/packages/state/recoil/atoms/dao.ts b/packages/state/recoil/atoms/dao.ts new file mode 100644 index 000000000..90555a926 --- /dev/null +++ b/packages/state/recoil/atoms/dao.ts @@ -0,0 +1,31 @@ +import { atom } from 'recoil' + +import { localStorageEffectJSON } from '../effects' + +// Following API doesn't update right away due to Cloudflare KV Store latency, +// so this serves to keep track of all successful updates for the current +// session. This will be reset on page refresh. Set this right away so the UI +// can update immediately even if the API takes up to a minute or two. Though +// likely it only takes 10 seconds or so. +export const temporaryFollowingDaosAtom = atom<{ + /** + * Serialized DaoSources. + */ + following: string[] + /** + * Serialized DaoSources. + */ + unfollowing: string[] +}>({ + key: 'temporaryFollowingDaos', + default: { following: [], unfollowing: [] }, +}) + +export const discordNotifierSetupAtom = atom<{ + state: string + coreAddress: string +} | null>({ + key: 'discordNotifierSetup', + default: null, + effects: [localStorageEffectJSON], +}) diff --git a/packages/state/recoil/atoms/index.ts b/packages/state/recoil/atoms/index.ts index 406fb9f2f..f9d832998 100644 --- a/packages/state/recoil/atoms/index.ts +++ b/packages/state/recoil/atoms/index.ts @@ -1,4 +1,5 @@ export * from './chain' +export * from './dao' export * from './loading' export * from './misc' export * from './nft' diff --git a/packages/state/recoil/atoms/misc.ts b/packages/state/recoil/atoms/misc.ts index 6a74ad8c5..08eedd49e 100644 --- a/packages/state/recoil/atoms/misc.ts +++ b/packages/state/recoil/atoms/misc.ts @@ -50,3 +50,10 @@ export const isKeplrMobileWebAtom = atom({ key: 'isKeplrMobileWeb', default: false, }) + +export const indexerWebSocketChannelSubscriptionsAtom = atom< + Partial> +>({ + key: 'indexerWebSocketChannelSubscriptions', + default: {}, +}) diff --git a/packages/stateful/recoil/selectors/dao/cards.ts b/packages/state/recoil/selectors/dao.ts similarity index 52% rename from packages/stateful/recoil/selectors/dao/cards.ts rename to packages/state/recoil/selectors/dao.ts index d5dd2561d..e48c8d2ec 100644 --- a/packages/stateful/recoil/selectors/dao/cards.ts +++ b/packages/state/recoil/selectors/dao.ts @@ -1,27 +1,23 @@ import { RecoilValueReadOnly, selectorFamily, waitForAll } from 'recoil' -import { - DaoCoreV2Selectors, - contractInfoSelector, - contractVersionSelector, - daoTvlSelector, - govProposalsSelector, - nativeDelegatedBalanceSelector, -} from '@dao-dao/state' import { ContractVersion, - DaoCardInfo, - DaoCardInfoLazyData, + ContractVersionInfo, DaoDropdownInfo, - DaoInfo, + DaoParentInfo, Feature, LazyDaoCardProps, WithChainId, } from '@dao-dao/types' +import { ConfigResponse as CwCoreV1ConfigResponse } from '@dao-dao/types/contracts/CwCore.v1' +import { ConfigResponse as DaoCoreV2ConfigResponse } from '@dao-dao/types/contracts/DaoCore.v2' import { CHAIN_SUBDAOS, + DAO_CORE_CONTRACT_NAMES, INACTIVE_DAO_NAMES, + VETOABLE_DAOS_ITEM_KEY_PREFIX, getChainGovernanceDaoDescription, + getConfiguredChainConfig, getDisplayNameForChainId, getFallbackImage, getImageUrlForChainId, @@ -30,127 +26,14 @@ import { parseContractVersion, } from '@dao-dao/utils' -import { proposalModuleAdapterProposalCountSelector } from '../../../proposal-module-adapter' -import { daoCoreProposalModulesSelector, daoInfoSelector } from './misc' - -export const daoCardInfoSelector = selectorFamily< - DaoCardInfo, - WithChainId<{ coreAddress: string }> ->({ - key: 'daoCardInfo', - get: - ({ chainId, coreAddress }) => - ({ get }) => { - const daoInfo = get( - daoInfoSelector({ - chainId, - coreAddress, - }) - ) - - return { - chainId: daoInfo.chainId, - coreAddress: daoInfo.coreAddress, - coreVersion: daoInfo.coreVersion, - name: daoInfo.name, - description: daoInfo.description, - imageUrl: daoInfo.imageUrl || getFallbackImage(daoInfo.coreAddress), - polytoneProxies: daoInfo.polytoneProxies, - established: daoInfo.created, - parentDao: daoInfo.parentDao ?? undefined, - tokenDecimals: 6, - tokenSymbol: '', - showingEstimatedUsdValue: true, - lazyData: { loading: true }, - } - }, -}) - -export const daoCardInfoLazyDataSelector = selectorFamily< - DaoCardInfoLazyData, - WithChainId<{ - coreAddress: string - walletAddress?: string - }> ->({ - key: 'daoCardInfoLazyData', - get: - ({ coreAddress, chainId, walletAddress }) => - ({ get }) => { - const { amount: tvl } = get( - daoTvlSelector({ - chainId, - coreAddress, - }) - ) - - // Native chain x/gov module. - if (isConfiguredChainName(chainId, coreAddress)) { - // Get proposal count by loading one proposal and getting the total. - const { total: proposalCount } = get( - govProposalsSelector({ - chainId, - limit: 1, - }) - ) - - const isMember = walletAddress - ? get( - nativeDelegatedBalanceSelector({ - chainId, - address: walletAddress, - }) - ).amount !== '0' - : false - - return { - isMember, - tokenBalance: tvl, - proposalCount, - } - } - - // DAO. - - const walletVotingWeight = walletAddress - ? Number( - get( - DaoCoreV2Selectors.votingPowerAtHeightSelector({ - chainId, - contractAddress: coreAddress, - params: [{ address: walletAddress }], - }) - ).power - ) - : 0 - - const proposalModules = get( - daoCoreProposalModulesSelector({ - chainId, - coreAddress, - }) - ) - const proposalModuleCounts = get( - waitForAll( - proposalModules.map(({ address }) => - proposalModuleAdapterProposalCountSelector({ - chainId, - proposalModuleAddress: address, - }) - ) - ) - ).filter(Boolean) as number[] - - return { - isMember: walletVotingWeight > 0, - tokenBalance: tvl, - proposalCount: proposalModuleCounts.reduce( - (acc, curr) => acc + curr, - 0 - ), - } - }, -}) +import { addressIsModuleSelector } from './chain' +import { + contractInfoSelector, + contractVersionSelector, + isDaoSelector, +} from './contract' +import { DaoCoreV2Selectors } from './contracts' +import { queryContractIndexerSelector } from './indexer' export const lazyDaoCardPropsSelector = selectorFamily< LazyDaoCardProps, @@ -210,85 +93,6 @@ export const lazyDaoCardPropsSelector = selectorFamily< }, }) -export const subDaoCardInfosSelector = selectorFamily< - DaoCardInfo[], - WithChainId<{ coreAddress: string }> ->({ - key: 'subDaoCardInfos', - get: - ({ coreAddress: contractAddress, chainId }) => - ({ get }) => { - const subDaos = get( - DaoCoreV2Selectors.listAllSubDaosSelector({ - contractAddress, - chainId, - }) - ) - - return get( - waitForAll( - subDaos.map(({ chainId, addr }) => - daoCardInfoSelector({ - chainId, - coreAddress: addr, - }) - ) - ) - ).filter(Boolean) as DaoCardInfo[] - }, -}) - -export const subDaoInfosSelector = selectorFamily< - DaoInfo[], - WithChainId<{ coreAddress: string }> ->({ - key: 'subDaoInfos', - get: - ({ coreAddress: contractAddress, chainId }) => - ({ get }) => { - const subDaos = get( - DaoCoreV2Selectors.listAllSubDaosSelector({ - contractAddress, - chainId, - }) - ) - - return get( - waitForAll( - subDaos.map(({ chainId, addr }) => - daoInfoSelector({ - chainId, - coreAddress: addr, - }) - ) - ) - ) - }, -}) - -export const chainSubDaoInfosSelector = selectorFamily< - DaoInfo[], - { chainId: string } ->({ - key: 'chainSubDaoInfos', - get: - ({ chainId }) => - ({ get }) => { - const subDaos = CHAIN_SUBDAOS[chainId] || [] - - return get( - waitForAll( - subDaos.map((coreAddress) => - daoInfoSelector({ - chainId, - coreAddress, - }) - ) - ) - ) - }, -}) - export const daoDropdownInfoSelector: ( params: WithChainId<{ coreAddress: string @@ -385,3 +189,177 @@ export const daoDropdownInfoSelector: ( } }, }) + +/** + * DAOs this DAO has enabled vetoable proposal listing for. + */ +export const daoVetoableDaosSelector = selectorFamily< + { chainId: string; coreAddress: string }[], + WithChainId<{ coreAddress: string }> +>({ + key: 'daoVetoableDaos', + get: + ({ chainId, coreAddress }) => + ({ get }) => + get( + DaoCoreV2Selectors.listAllItemsWithPrefixSelector({ + chainId, + contractAddress: coreAddress, + prefix: VETOABLE_DAOS_ITEM_KEY_PREFIX, + }) + ).map(([key]) => { + const [chainId, coreAdress] = key.split(':') + + return { + chainId, + coreAddress: coreAdress, + } + }), +}) + +/** + * Attempt to fetch the info needed to describe a parent DAO. Returns undefined + * if not a DAO nor the chain gov module account. + */ +export const daoParentInfoSelector = selectorFamily< + DaoParentInfo | undefined, + WithChainId<{ + parentAddress: string + /** + * To determine if the parent has registered the child, pass the child. This + * will set `registeredSubDao` appropriately. Otherwise, if undefined, + * `registeredSubDao` will be set to false. + */ + childAddress?: string + }> +>({ + key: 'daoParentInfo', + get: + ({ chainId, parentAddress, childAddress }) => + ({ get }) => { + // If address is a DAO contract... + if ( + get( + isDaoSelector({ + chainId, + address: parentAddress, + }) + ) + ) { + const parentAdmin = get( + DaoCoreV2Selectors.adminSelector({ + chainId, + contractAddress: parentAddress, + params: [], + }) + ) + const { + info: { version }, + } = get( + contractInfoSelector({ + chainId, + contractAddress: parentAddress, + }) + ) + const parentVersion = parseContractVersion(version) + + if (parentVersion) { + const { + name, + image_url, + }: CwCoreV1ConfigResponse | DaoCoreV2ConfigResponse = get( + // Both v1 and v2 have a config query. + DaoCoreV2Selectors.configSelector({ + chainId, + contractAddress: parentAddress, + params: [], + }) + ) + + // Check if parent has registered the child DAO as a SubDAO. + const registeredSubDao = + childAddress && + isFeatureSupportedByVersion(Feature.SubDaos, parentVersion) + ? get( + DaoCoreV2Selectors.listAllSubDaosSelector({ + contractAddress: parentAddress, + chainId, + }) + ).some(({ addr }) => addr === childAddress) + : false + + return { + chainId, + coreAddress: parentAddress, + coreVersion: parentVersion, + name, + imageUrl: image_url || getFallbackImage(parentAddress), + admin: parentAdmin ?? '', + registeredSubDao, + } + } + + // If address is the chain's x/gov module account... + } else if ( + get( + addressIsModuleSelector({ + chainId, + address: parentAddress, + moduleName: 'gov', + }) + ) + ) { + const chainConfig = getConfiguredChainConfig(chainId) + return ( + chainConfig && { + chainId, + coreAddress: chainConfig.name, + coreVersion: ContractVersion.Gov, + name: getDisplayNameForChainId(chainId), + imageUrl: getImageUrlForChainId(chainId), + admin: '', + registeredSubDao: + !!childAddress && + !!CHAIN_SUBDAOS[chainId]?.includes(childAddress), + } + ) + } + }, +}) + +/** + * Retrieve all potential SubDAOs of the DAO from the indexer. + */ +export const daoPotentialSubDaosSelector = selectorFamily< + string[], + WithChainId<{ + coreAddress: string + }> +>({ + key: 'daoPotentialSubDaos', + get: + ({ coreAddress, chainId }) => + ({ get }) => { + const potentialSubDaos: { + contractAddress: string + info: ContractVersionInfo + }[] = get( + queryContractIndexerSelector({ + chainId, + contractAddress: coreAddress, + formula: 'daoCore/potentialSubDaos', + noFallback: true, + }) + ) + + // Filter out those that do not appear to be DAO contracts and also the + // contract itself since it is probably its own admin. + return potentialSubDaos + .filter( + ({ contractAddress, info }) => + contractAddress !== coreAddress && + DAO_CORE_CONTRACT_NAMES.some((name) => info.contract.includes(name)) + ) + .map(({ contractAddress }) => contractAddress) + }, +}) diff --git a/packages/state/recoil/selectors/discord.ts b/packages/state/recoil/selectors/discord.ts index 8304a2c87..645bd13d1 100644 --- a/packages/state/recoil/selectors/discord.ts +++ b/packages/state/recoil/selectors/discord.ts @@ -1,18 +1,7 @@ -import { atom, atomFamily, selectorFamily } from 'recoil' +import { atomFamily, selectorFamily } from 'recoil' import { DISCORD_NOTIFIER_API_BASE } from '@dao-dao/utils' -import { localStorageEffectJSON } from '../effects' - -export const discordNotifierSetupAtom = atom<{ - state: string - coreAddress: string -} | null>({ - key: 'discordNotifierSetup', - default: null, - effects: [localStorageEffectJSON], -}) - type DiscordNotifierRegistrationsOptions = { chainId: string coreAddress: string diff --git a/packages/stateful/recoil/selectors/dao/following.ts b/packages/state/recoil/selectors/following.ts similarity index 64% rename from packages/stateful/recoil/selectors/dao/following.ts rename to packages/state/recoil/selectors/following.ts index 27e1f7f88..a37f90084 100644 --- a/packages/stateful/recoil/selectors/dao/following.ts +++ b/packages/state/recoil/selectors/following.ts @@ -1,46 +1,19 @@ import uniq from 'lodash.uniq' -import { - atom, - constSelector, - selectorFamily, - waitForAll, - waitForAllSettled, -} from 'recoil' +import { selectorFamily, waitForAllSettled } from 'recoil' -import { refreshFollowingDaosAtom } from '@dao-dao/state' -import { DaoDropdownInfo, DaoSource, ProposalModule } from '@dao-dao/types' +import { DaoDropdownInfo, DaoSource } from '@dao-dao/types' import { FOLLOWING_DAOS_PREFIX, KVPK_API_BASE, MAINNET, deserializeDaoSource, - isConfiguredChainName, keepSubDaosInDropdown, maybeGetChainForChainId, subDaoExistsInDropdown, } from '@dao-dao/utils' -import { daoDropdownInfoSelector } from './cards' -import { daoCoreProposalModulesSelector } from './misc' - -// Following API doesn't update right away due to Cloudflare KV Store latency, -// so this serves to keep track of all successful updates for the current -// session. This will be reset on page refresh. Set this right away so the UI -// can update immediately even if the API takes up to a minute or two. Though -// likely it only takes 10 seconds or so. -export const temporaryFollowingDaosAtom = atom<{ - /** - * Serialized DaoSources. - */ - following: string[] - /** - * Serialized DaoSources. - */ - unfollowing: string[] -}>({ - key: 'temporaryFollowingDaos', - default: { following: [], unfollowing: [] }, -}) +import { refreshFollowingDaosAtom, temporaryFollowingDaosAtom } from '../atoms' +import { daoDropdownInfoSelector } from './dao' export const followingDaosSelector = selectorFamily< DaoSource[], @@ -151,37 +124,3 @@ export const followingDaoDropdownInfosSelector = selectorFamily< return infos }, }) - -export const followingDaosWithProposalModulesSelector = selectorFamily< - (DaoSource & { - proposalModules: ProposalModule[] - })[], - { - walletPublicKey: string - } ->({ - key: 'followingDaosWithProposalModules', - get: - (params) => - ({ get }) => { - const following = get(followingDaosSelector(params)) - - const proposalModules = get( - waitForAll( - following.map(({ chainId, coreAddress }) => - isConfiguredChainName(chainId, coreAddress) - ? constSelector([]) - : daoCoreProposalModulesSelector({ - chainId, - coreAddress, - }) - ) - ) - ) - - return following.map((daoSource, index) => ({ - ...daoSource, - proposalModules: proposalModules[index], - })) - }, -}) diff --git a/packages/state/recoil/selectors/index.ts b/packages/state/recoil/selectors/index.ts index 38381985d..a7820615c 100644 --- a/packages/state/recoil/selectors/index.ts +++ b/packages/state/recoil/selectors/index.ts @@ -4,7 +4,9 @@ export * from './account' export * from './astroport' export * from './chain' export * from './contract' +export * from './dao' export * from './discord' +export * from './following' export * from './ica' export * from './inbox' export * from './indexer' @@ -16,5 +18,6 @@ export * from './proposal' export * from './skip' export * from './token' export * from './treasury' +export * from './vesting' export * from './wallet' export * from './whale' diff --git a/packages/state/recoil/selectors/indexer.ts b/packages/state/recoil/selectors/indexer.ts index 07eaae6e4..da60b0cef 100644 --- a/packages/state/recoil/selectors/indexer.ts +++ b/packages/state/recoil/selectors/indexer.ts @@ -1,5 +1,5 @@ import Pusher from 'pusher-js' -import { atom, selector, selectorFamily } from 'recoil' +import { selector, selectorFamily } from 'recoil' import { Expiration, @@ -328,13 +328,6 @@ export const walletAdminOfDaosSelector = selectorFamily< }, }) -export const indexerWebSocketChannelSubscriptionsAtom = atom< - Partial> ->({ - key: 'indexerWebSocketChannelSubscriptions', - default: {}, -}) - export const indexerWebSocketSelector = selector({ key: 'indexerWebSocket', get: () => diff --git a/packages/state/recoil/selectors/nft.ts b/packages/state/recoil/selectors/nft.ts index 15c140671..046304458 100644 --- a/packages/state/recoil/selectors/nft.ts +++ b/packages/state/recoil/selectors/nft.ts @@ -1,8 +1,10 @@ -import { selectorFamily, waitForAll } from 'recoil' +import { selectorFamily, waitForAll, waitForNone } from 'recoil' import { ChainId, GenericToken, + LazyNftCardInfo, + LoadingNfts, NftCardInfo, NftUriData, TokenType, @@ -10,16 +12,25 @@ import { } from '@dao-dao/types' import { MAINNET, + STARGAZE_URL_BASE, + getNftKey, nftCardInfoFromStargazeIndexerNft, transformIpfsUrlToHttpsIfNecessary, } from '@dao-dao/utils' import { stargazeIndexerClient, + stargazeTokenQuery, stargazeTokensForOwnerQuery, } from '../../graphql' -import { refreshWalletStargazeNftsAtom } from '../atoms' +import { + refreshWalletBalancesIdAtom, + refreshWalletStargazeNftsAtom, +} from '../atoms' import { accountsSelector } from './account' +import { CommonNftSelectors, DaoCoreV2Selectors } from './contracts' +import { stakerForNftSelector } from './contracts/DaoVotingCw721Staked' +import { queryWalletIndexerSelector } from './indexer' import { stargazeWalletUsdValueSelector } from './stargaze' import { genericTokenSelector } from './token' @@ -232,3 +243,370 @@ export const walletStargazeNftCardInfosSelector = selectorFamily< ) }, }) + +export const nftCardInfoWithUriSelector = selectorFamily< + NftCardInfo, + WithChainId<{ + collection: string + tokenId: string + tokenUri?: string | null | undefined + }> +>({ + key: 'nftCardInfo', + get: + ({ tokenId, collection, tokenUri, chainId }) => + async ({ get }) => { + const collectionInfo = get( + CommonNftSelectors.contractInfoSelector({ + contractAddress: collection, + chainId, + params: [], + }) + ) + + const metadata = + (tokenUri && get(nftUriDataSelector(tokenUri))) || undefined + const { name = '', description, imageUrl, externalLink } = metadata || {} + + const info: NftCardInfo = { + key: getNftKey(chainId, collection, tokenId), + collectionAddress: collection, + collectionName: collectionInfo.name, + tokenId, + externalLink: + externalLink || + (chainId === ChainId.StargazeMainnet || + chainId === ChainId.StargazeTestnet + ? { + href: `${STARGAZE_URL_BASE}/media/${collection}/${tokenId}`, + name: 'Stargaze', + } + : undefined), + // Default to tokenUri; this gets overwritten if tokenUri contains valid + // metadata and has an image. + imageUrl: imageUrl || tokenUri || undefined, + metadata, + name, + description, + chainId, + } + + return info + }, +}) + +export const nftCardInfoSelector = selectorFamily< + NftCardInfo, + WithChainId<{ tokenId: string; collection: string }> +>({ + key: 'nftCardInfo', + get: + ({ tokenId, collection, chainId }) => + async ({ get }) => { + // Use Stargaze indexer when possible. Fallback to contract query. + if ( + chainId === ChainId.StargazeMainnet || + chainId === ChainId.StargazeTestnet + ) { + let data + try { + data = ( + await stargazeIndexerClient.query({ + query: stargazeTokenQuery, + variables: { + collectionAddr: collection, + tokenId, + }, + }) + ).data + } catch (err) { + console.error(err) + } + + if (data?.token) { + const genericToken = data.token?.highestOffer?.offerPrice?.denom + ? get( + genericTokenSelector({ + chainId, + type: TokenType.Native, + denomOrAddress: data.token.highestOffer.offerPrice.denom, + }) + ) + : undefined + + return nftCardInfoFromStargazeIndexerNft( + chainId, + data.token, + genericToken + ) + } + } + + const tokenInfo = get( + CommonNftSelectors.nftInfoSelector({ + contractAddress: collection, + chainId, + params: [{ tokenId }], + }) + ) + + return get( + nftCardInfoWithUriSelector({ + tokenId, + collection, + tokenUri: tokenInfo.token_uri, + chainId, + }) + ) + }, +}) + +export const lazyNftCardInfosForDaoSelector = selectorFamily< + // Map chain ID to DAO-owned NFTs on that chain. + LoadingNfts, + WithChainId<{ + coreAddress: string + // If DAO is using the cw721-staking voting module adapter, it will have an + // NFT governance collection. If this is the case, passing it here makes + // sure we include the collection if it is not in the DAO's cw721 token + // list. + governanceCollectionAddress?: string + }> +>({ + key: 'lazyNftCardInfosForDao', + get: + ({ chainId, coreAddress, governanceCollectionAddress }) => + async ({ get }) => { + const allNfts = get( + DaoCoreV2Selectors.allCw721CollectionsSelector({ + contractAddress: coreAddress, + chainId, + governanceCollectionAddress, + }) + ) + + return Object.entries(allNfts).reduce( + (acc, [chainId, { owners, collectionAddresses }]) => { + collectionAddresses = Array.from(new Set(collectionAddresses)) + + // Get all token IDs owned by the DAO for each collection. + const nftCollectionTokenIds = get( + waitForNone( + collectionAddresses.flatMap((collectionAddress) => + owners.map((owner) => + CommonNftSelectors.unpaginatedAllTokensForOwnerSelector({ + contractAddress: collectionAddress, + chainId, + owner, + }) + ) + ) + ) + ) + + // Get all lazy info for each collection. + const lazyNftCardProps = collectionAddresses.flatMap( + (collectionAddress, index) => + nftCollectionTokenIds[index].state === 'hasValue' + ? (nftCollectionTokenIds[index].contents as string[]).map( + (tokenId): LazyNftCardInfo => ({ + key: getNftKey(chainId, collectionAddress, tokenId), + chainId, + tokenId, + collectionAddress, + type: 'collection', + }) + ) + : [] + ) + + return { + ...acc, + [chainId]: + nftCollectionTokenIds.length > 0 && + nftCollectionTokenIds.every( + (loadable) => loadable.state === 'loading' + ) + ? { + loading: true, + errored: false, + } + : { + loading: false, + errored: false, + updating: nftCollectionTokenIds.some( + (loadable) => loadable.state === 'loading' + ), + data: lazyNftCardProps, + }, + } + }, + {} as LoadingNfts + ) + }, +}) + +type CollectionWithTokens = { + collectionAddress: string + tokens: string[] +} + +// Retrieve all NFTs for a given wallet address using the indexer, but don't +// load the NFT info. +export const walletLazyNftCardInfosSelector = selectorFamily< + LoadingNfts, + WithChainId<{ + walletAddress: string + }> +>({ + key: 'walletLazyNftCardInfos', + get: + ({ walletAddress, chainId }) => + async ({ get }) => { + const id = get(refreshWalletBalancesIdAtom(walletAddress)) + // Use Stargaze's API if we're on the Stargaze chain. + if ( + chainId === ChainId.StargazeMainnet || + chainId === ChainId.StargazeTestnet + ) { + return { + [chainId]: { + loading: false, + errored: false, + data: get(walletStargazeNftCardInfosSelector(walletAddress)), + }, + } + } + + const collections: CollectionWithTokens[] = get( + queryWalletIndexerSelector({ + chainId, + walletAddress, + formula: 'nft/collections', + id, + noFallback: true, + }) + ) + if (!collections || !Array.isArray(collections)) { + return { + [chainId]: { + loading: false, + errored: false, + data: [], + }, + } + } + + // Get all lazy info for each collection. + const lazyNftCardInfos = collections.flatMap( + ({ collectionAddress, tokens }) => + tokens.map( + (tokenId): LazyNftCardInfo => ({ + key: getNftKey(chainId, collectionAddress, tokenId), + chainId, + tokenId, + collectionAddress, + type: 'collection', + }) + ) + ) + + return { + [chainId]: { + loading: false, + errored: false, + data: lazyNftCardInfos, + }, + } + }, +}) + +// Retrieve all NFTs a given wallet address has staked with a DAO (via +// dao-voting-cw721-staked) using the indexer. +export const walletStakedLazyNftCardInfosSelector = selectorFamily< + LazyNftCardInfo[], + WithChainId<{ + walletAddress: string + }> +>({ + key: 'walletStakedLazyNftCardInfos', + get: + ({ walletAddress, chainId }) => + async ({ get }) => { + const id = get(refreshWalletBalancesIdAtom(walletAddress)) + + const collections: CollectionWithTokens[] = get( + queryWalletIndexerSelector({ + chainId, + walletAddress, + formula: 'nft/stakedWithDaos', + id, + noFallback: true, + }) + ) + if (!collections || !Array.isArray(collections)) { + return [] + } + + // Get all lazy info for each collection. + const lazyNftCardInfos = collections.flatMap( + ({ collectionAddress, tokens }) => + tokens.map( + (tokenId): LazyNftCardInfo => ({ + key: getNftKey(chainId, collectionAddress, tokenId), + chainId, + tokenId, + collectionAddress, + type: 'collection', + }) + ) + ) + + return lazyNftCardInfos.map((info) => ({ + ...info, + staked: true, + })) + }, +}) + +// Get owner of NFT, or staker if NFT is staked with the given staking contract. +export const nftStakerOrOwnerSelector = selectorFamily< + { + staked: boolean + address: string + }, + WithChainId<{ + collectionAddress: string + tokenId: string + stakingContractAddress?: string + }> +>({ + key: 'nftStakerOrOwner', + get: + ({ collectionAddress, tokenId, stakingContractAddress, chainId }) => + async ({ get }) => { + const { owner } = get( + CommonNftSelectors.ownerOfSelector({ + contractAddress: collectionAddress, + params: [{ tokenId }], + chainId, + }) + ) + + const staker = + stakingContractAddress && owner === stakingContractAddress + ? get( + stakerForNftSelector({ + contractAddress: stakingContractAddress, + tokenId, + chainId, + }) + ) + : undefined + + return { + staked: staker !== undefined, + address: staker || owner, + } + }, +}) diff --git a/packages/state/recoil/selectors/profile.ts b/packages/state/recoil/selectors/profile.ts index d80b3f7a0..dc9ccdedd 100644 --- a/packages/state/recoil/selectors/profile.ts +++ b/packages/state/recoil/selectors/profile.ts @@ -1,9 +1,29 @@ -import { selectorFamily, waitForAll } from 'recoil' +import uniq from 'lodash.uniq' +import { noWait, selectorFamily, waitForAll } from 'recoil' -import { ResolvedProfile, WithChainId } from '@dao-dao/types' -import { PFPK_API_BASE, processError, toBech32Hash } from '@dao-dao/utils' +import { + ChainId, + PfpkProfile, + ResolvedProfile, + UnifiedProfile, + WithChainId, +} from '@dao-dao/types' +import { + EMPTY_PFPK_PROFILE, + MAINNET, + PFPK_API_BASE, + STARGAZE_NAMES_CONTRACT, + getChainForChainId, + makeEmptyUnifiedProfile, + objectMatchesStructure, + processError, + toBech32Hash, + transformBech32Address, +} from '@dao-dao/utils' import { refreshWalletProfileAtom } from '../atoms/refresh' +import { cosmWasmClientForChainSelector } from './chain' +import { nftCardInfoSelector } from './nft' export const searchProfilesByNamePrefixSelector = selectorFamily< ResolvedProfile[], @@ -49,3 +69,241 @@ export const searchProfilesByNamePrefixSelector = selectorFamily< return profiles }, }) + +/** + * Get profile from PFPK given a wallet address on any chain. + */ +export const pfpkProfileSelector = selectorFamily({ + key: 'pfpkProfile', + get: + (walletAddress) => + ({ get }) => + get( + pfpkProfileForBech32HashSelector( + walletAddress && toBech32Hash(walletAddress) + ) + ), +}) + +/** + * Get profile from PFPK given a wallet address's bech32 hash. + */ +export const pfpkProfileForBech32HashSelector = selectorFamily< + PfpkProfile, + string +>({ + key: 'pfpkProfileForBech32Hash', + get: + (bech32Hash) => + async ({ get }) => { + if (!bech32Hash) { + return { ...EMPTY_PFPK_PROFILE } + } + + get(refreshWalletProfileAtom(bech32Hash)) + + try { + const response = await fetch(PFPK_API_BASE + `/bech32/${bech32Hash}`) + if (response.ok) { + const profile: PfpkProfile = await response.json() + + // If profile found, add refresher dependencies for the other chains + // in the profile. This ensures that the profile will update for all + // other chains when any of the other chains update the profile. + if (profile?.chains) { + get( + waitForAll( + uniq( + Object.values(profile.chains).map(({ address }) => + toBech32Hash(address) + ) + ).map((bech32Hash) => refreshWalletProfileAtom(bech32Hash)) + ) + ) + } + + return profile + } else { + console.error(await response.json().catch(() => response.statusText)) + } + } catch (err) { + console.error(err) + } + + return { ...EMPTY_PFPK_PROFILE } + }, +}) + +// Get name for address from Stargaze Names. +export const stargazeNameSelector = selectorFamily({ + key: 'stargazeName', + get: + (walletAddress) => + async ({ get }) => { + if (!walletAddress) { + return + } + + get(refreshWalletProfileAtom(walletAddress)) + + const client = get( + cosmWasmClientForChainSelector( + MAINNET ? ChainId.StargazeMainnet : ChainId.StargazeTestnet + ) + ) + + try { + return await client.queryContractSmart(STARGAZE_NAMES_CONTRACT, { + name: { address: walletAddress }, + }) + } catch {} + }, +}) + +// Get image for address from Stargaze Names. +export const stargazeNameImageForAddressSelector = selectorFamily< + string | undefined, + string +>({ + key: 'stargazeNameImageForAddress', + get: + (walletAddress) => + async ({ get }) => { + // Get name associated with address. + const name = get(stargazeNameSelector(walletAddress)) + if (!name) { + return + } + + const chainId = MAINNET + ? ChainId.StargazeMainnet + : ChainId.StargazeTestnet + const client = get(cosmWasmClientForChainSelector(chainId)) + + // Get NFT associated with name. + let response + try { + response = await client.queryContractSmart(STARGAZE_NAMES_CONTRACT, { + image_n_f_t: { name }, + }) + } catch { + return + } + + // If NFT exists, get image associated with NFT. + if ( + objectMatchesStructure(response, { + collection: {}, + token_id: {}, + }) + ) { + const { imageUrl } = get( + nftCardInfoSelector({ + chainId, + collection: response.collection, + tokenId: response.token_id, + }) + ) + + return imageUrl + } + }, +}) + +export const profileSelector = selectorFamily< + UnifiedProfile, + WithChainId<{ address: string }> +>({ + key: 'profile', + get: + ({ address, chainId }) => + ({ get }) => { + const profile = makeEmptyUnifiedProfile(chainId, address) + if (!address) { + return profile + } + + get(refreshWalletProfileAtom(toBech32Hash(address))) + + const pfpkProfile = get(pfpkProfileSelector(address)) + if (pfpkProfile) { + profile.uuid = pfpkProfile.uuid + profile.nonce = pfpkProfile.nonce + profile.name = pfpkProfile.name + profile.nft = pfpkProfile.nft + profile.chains = pfpkProfile.chains + } + + // Load Stargaze name as backup if no PFPK name set. + if (!profile.name) { + const stargazeNameLoadable = get( + noWait( + stargazeNameSelector( + // Use profile address for Stargaze if set, falling back to + // transforming the address (which is unreliable due to different + // chains using different HD paths). + profile.chains[ChainId.StargazeMainnet]?.address || + transformBech32Address(address, ChainId.StargazeMainnet) + ) + ) + ) + if ( + stargazeNameLoadable.state === 'hasValue' && + stargazeNameLoadable.contents + ) { + profile.name = + stargazeNameLoadable.contents + + '.' + + getChainForChainId(chainId).bech32_prefix + profile.nameSource = 'stargaze' + } + } + + // Set `imageUrl` to PFPK image, defaulting to fallback image. + profile.imageUrl = pfpkProfile?.nft?.imageUrl || profile.backupImageUrl + + // If NFT present from PFPK, get image from token once loaded. + if (pfpkProfile?.nft) { + // Don't wait for NFT info to load. When it loads, it will update. + const nftInfoLoadable = get( + noWait( + nftCardInfoSelector({ + collection: pfpkProfile.nft.collectionAddress, + tokenId: pfpkProfile.nft.tokenId, + chainId: pfpkProfile.nft.chainId, + }) + ) + ) + + // Set `imageUrl` if defined, overriding PFPK image and backup. + if ( + nftInfoLoadable.state === 'hasValue' && + nftInfoLoadable.contents?.imageUrl + ) { + profile.imageUrl = nftInfoLoadable.contents.imageUrl + } + + // Load Stargaze name image if no PFPK image. + } else if (profile.nameSource === 'stargaze') { + const stargazeNameImageLoadable = get( + noWait( + stargazeNameImageForAddressSelector( + // Use profile address for Stargaze if set, falling back to + // transforming the address (which is unreliable due to different + // chains using different HD paths). + profile.chains[ChainId.StargazeMainnet]?.address || + transformBech32Address(address, ChainId.StargazeMainnet) + ) + ) + ) + if ( + stargazeNameImageLoadable.state === 'hasValue' && + stargazeNameImageLoadable.contents + ) { + profile.imageUrl = stargazeNameImageLoadable.contents + } + } + + return profile + }, +}) diff --git a/packages/state/recoil/selectors/token.ts b/packages/state/recoil/selectors/token.ts index 4e34cfcc7..9330853ba 100644 --- a/packages/state/recoil/selectors/token.ts +++ b/packages/state/recoil/selectors/token.ts @@ -12,16 +12,20 @@ import { GenericTokenBalance, GenericTokenSource, GenericTokenWithUsdPrice, + TokenCardLazyInfo, TokenPriceHistoryRange, TokenType, + UnstakingTaskStatus, WithChainId, } from '@dao-dao/types' import { MAINNET, + convertMicroDenomToDenomWithDecimals, getChainForChainId, getChainForChainName, getFallbackImage, getIbcTransferInfoFromChannel, + getNativeTokenForChainId, getTokenForChainIdAndDenom, isValidTokenFactoryDenom, isValidWalletAddress, @@ -35,10 +39,16 @@ import { nativeDelegatedBalanceSelector, nativeDelegationInfoSelector, nativeDenomBalanceSelector, + nativeUnstakingDurationSecondsSelector, } from './chain' import { isDaoSelector } from './contract' -import { Cw20BaseSelectors, DaoCoreV2Selectors } from './contracts' -import { querySnapperSelector } from './indexer' +import { + Cw20BaseSelectors, + Cw20StakeSelectors, + DaoCoreV2Selectors, + DaoVotingNativeStakedSelectors, +} from './contracts' +import { queryGenericIndexerSelector, querySnapperSelector } from './indexer' import { osmosisUsdPriceSelector } from './osmosis' import { skipAssetSelector } from './skip' import { walletCw20BalancesSelector } from './wallet' @@ -703,3 +713,282 @@ export const historicalUsdPriceSelector = selectorFamily< } }, }) + +export const tokenCardLazyInfoSelector = selectorFamily< + TokenCardLazyInfo, + { + owner: string + token: GenericToken + // For calculating totalBalance. + unstakedBalance: number + } +>({ + key: 'tokenCardLazyInfo', + get: + ({ owner, token, unstakedBalance }) => + ({ get }) => { + const { chainId, type } = token + + let stakingInfo: TokenCardLazyInfo['stakingInfo'] = undefined + let daosGoverned: TokenCardLazyInfo['daosGoverned'] = undefined + + const usdUnitPrice = get( + usdPriceSelector({ + type, + chainId, + denomOrAddress: token.denomOrAddress, + }) + ) + + // Staking info only exists for native token. + if ( + token.denomOrAddress === + getNativeTokenForChainId(chainId).denomOrAddress + ) { + // Neutron does not have staking so this may error. Ignore if so. + const nativeDelegationInfoLoadable = get( + waitForAllSettled([ + nativeDelegationInfoSelector({ + address: owner, + chainId, + }), + ]) + )[0] + const nativeDelegationInfo = + nativeDelegationInfoLoadable.state === 'hasValue' + ? nativeDelegationInfoLoadable.contents + : undefined + + if (nativeDelegationInfo) { + const unstakingDurationSeconds = get( + nativeUnstakingDurationSecondsSelector({ + chainId, + }) + ) + + const unstakingTasks = nativeDelegationInfo.unbondingDelegations.map( + ({ balance, finishesAt }) => ({ + token, + status: UnstakingTaskStatus.Unstaking, + amount: convertMicroDenomToDenomWithDecimals( + balance.amount, + token.decimals + ), + date: finishesAt, + }) + ) + + const stakes = nativeDelegationInfo.delegations.map( + ({ validator, delegated, pendingReward }) => ({ + token, + validator, + amount: convertMicroDenomToDenomWithDecimals( + delegated.amount, + token.decimals + ), + rewards: convertMicroDenomToDenomWithDecimals( + pendingReward.amount, + token.decimals + ), + }) + ) + + const totalStaked = + stakes.reduce((acc, stake) => acc + stake.amount, 0) ?? 0 + const totalPendingRewards = + stakes?.reduce((acc, stake) => acc + stake.rewards, 0) ?? 0 + const totalUnstaking = + unstakingTasks.reduce( + (acc, task) => + acc + + // Only include balance of unstaking tasks. + (task.status === UnstakingTaskStatus.Unstaking + ? task.amount + : 0), + 0 + ) ?? 0 + + stakingInfo = { + unstakingTasks, + unstakingDurationSeconds, + stakes, + totalStaked, + totalPendingRewards, + totalUnstaking, + } + } + } + + if (owner) { + daosGoverned = get( + tokenDaosWithStakedBalanceSelector({ + chainId, + type: token.type, + denomOrAddress: token.denomOrAddress, + walletAddress: owner, + }) + ) + // Only include DAOs this owner has staked with. + .filter(({ stakedBalance }) => stakedBalance > 0) + .map(({ stakedBalance, ...rest }) => ({ + ...rest, + // Convert to expected denom. + stakedBalance: convertMicroDenomToDenomWithDecimals( + stakedBalance, + token.decimals + ), + })) + } + + const totalBalance = + unstakedBalance + + // Add staked and unstaking balances. + (stakingInfo + ? stakingInfo.totalStaked + stakingInfo.totalUnstaking + : 0) + + // Add balances staked in DAOs, grouped by their + // `stakingContractAddress` so we don't double-count tokens staked with + // the same staking contract if that staking contract is used in + // different DAOs in the list. + Object.values( + daosGoverned?.reduce( + (acc, { stakingContractAddress, stakedBalance = 0 }) => ({ + ...acc, + // If the staking contract address is already in the accumulator, + // overwrite so we don't double-count. All staked balances for the + // same staking contract should be the same, so overwriting should + // do nothing. + [stakingContractAddress]: stakedBalance, + }), + {} as Record + ) || {} + ).reduce((acc, stakedBalance) => acc + stakedBalance, 0) + + return { + usdUnitPrice, + stakingInfo, + totalBalance, + daosGoverned, + } + }, +}) + +// Get DAOs that use this native token as their governance token from the +// indexer, and load their dao-voting-native-staked contracts. +export const daosWithNativeVotingContractSelector = selectorFamily< + { + coreAddress: string + votingModuleAddress: string + }[], + WithChainId<{ + denom: string + }> +>({ + key: 'daosWithNativeVotingContract', + get: + ({ denom, chainId }) => + ({ get }) => { + const daos: string[] = + get( + queryGenericIndexerSelector({ + chainId, + formula: 'token/daos', + args: { + denom, + }, + noFallback: true, + }) + ) ?? [] + const votingModuleAddresses = get( + waitForAll( + daos.map((contractAddress) => + DaoCoreV2Selectors.votingModuleSelector({ + contractAddress, + chainId, + params: [], + }) + ) + ) + ) + + return daos.map((coreAddress, index) => ({ + coreAddress, + votingModuleAddress: votingModuleAddresses[index], + })) + }, +}) + +// Returns a list of DAOs that use the given cw20 token as their governance +// token with the staked balance of the given wallet address for each. +export const tokenDaosWithStakedBalanceSelector = selectorFamily< + { + coreAddress: string + stakingContractAddress: string + stakedBalance: number + }[], + WithChainId<{ + type: TokenType + denomOrAddress: string + walletAddress: string + }> +>({ + key: 'tokenDaosWithStakedBalance', + get: + ({ type, denomOrAddress, walletAddress, chainId }) => + ({ get }) => { + const daos = + type === TokenType.Cw20 + ? get( + Cw20BaseSelectors.daosWithVotingAndStakingContractSelector({ + contractAddress: denomOrAddress, + chainId, + }) + ) + : get( + daosWithNativeVotingContractSelector({ + denom: denomOrAddress, + chainId, + }) + ).map((daoWithContracts) => ({ + ...daoWithContracts, + stakingContractAddress: daoWithContracts.votingModuleAddress, + })) + + const daosWalletStakedTokens = get( + waitForAll( + daos.map(({ stakingContractAddress }) => + type === TokenType.Cw20 + ? Cw20StakeSelectors.stakedValueSelector({ + contractAddress: stakingContractAddress, + chainId, + params: [ + { + address: walletAddress, + }, + ], + }) + : DaoVotingNativeStakedSelectors.votingPowerAtHeightSelector({ + contractAddress: stakingContractAddress, + chainId, + params: [ + { + address: walletAddress, + }, + ], + }) + ) + ) + ).map((staked) => ('value' in staked ? staked.value : staked.power)) + + const daosWithBalances = daos + .map(({ coreAddress, stakingContractAddress }, index) => ({ + coreAddress, + stakingContractAddress, + stakedBalance: Number(daosWalletStakedTokens[index]), + })) + // Sort descending by staked tokens. + .sort((a, b) => b.stakedBalance - a.stakedBalance) + + return daosWithBalances + }, +}) diff --git a/packages/state/recoil/selectors/treasury.ts b/packages/state/recoil/selectors/treasury.ts index 641c6af10..f10cb4997 100644 --- a/packages/state/recoil/selectors/treasury.ts +++ b/packages/state/recoil/selectors/treasury.ts @@ -1,21 +1,43 @@ import { parseCoins } from '@cosmjs/proto-signing' import { Event, IndexedTx } from '@cosmjs/stargate' -import { selectorFamily, waitForAll } from 'recoil' +import uniq from 'lodash.uniq' +import { noWait, selectorFamily, waitForAll, waitForNone } from 'recoil' -import { AmountWithTimestamp, WithChainId } from '@dao-dao/types' import { + Account, + AccountType, + AmountWithTimestamp, + GenericToken, + GenericTokenSource, + LoadingTokens, + TokenCardInfo, + TokenPriceHistoryRange, + TokenType, + WithChainId, +} from '@dao-dao/types' +import { + COMMUNITY_POOL_ADDRESS_PLACEHOLDER, convertMicroDenomToDenomWithDecimals, + getNativeTokenForChainId, getTokenForChainIdAndDenom, isConfiguredChainName, + loadableToLoadingData, } from '@dao-dao/utils' +import { accountsSelector } from './account' import { blockHeightTimestampSafeSelector, communityPoolBalancesSelector, cosmWasmClientForChainSelector, + nativeDelegatedBalanceSelector, } from './chain' import { querySnapperSelector } from './indexer' -import { usdPriceSelector } from './token' +import { + genericTokenBalancesSelector, + genericTokenSelector, + tokenCardLazyInfoSelector, + usdPriceSelector, +} from './token' type TreasuryTransactionsParams = WithChainId<{ address: string @@ -220,3 +242,284 @@ export const communityPoolTvlSelector = selectorFamily< } }, }) + +// lazyInfo must be loaded in the component separately, since it refreshes on a +// timer and we don't want this whole selector to reevaluate and load when that +// refreshes. Use `tokenCardLazyInfoSelector`. +export const treasuryTokenCardInfosForDaoSelector = selectorFamily< + // Map chain ID to DAO-owned tokens on that chain. + LoadingTokens, + WithChainId<{ + coreAddress: string + cw20GovernanceTokenAddress?: string + nativeGovernanceTokenDenom?: string + }> +>({ + key: 'treasuryTokenCardInfosForDao', + get: + ({ + chainId: nativeChainId, + coreAddress, + cw20GovernanceTokenAddress, + nativeGovernanceTokenDenom, + }) => + ({ get }) => { + const allAccounts = get( + accountsSelector({ + chainId: nativeChainId, + address: coreAddress, + }) + ) + + const uniqueChainIds = uniq(allAccounts.map((account) => account.chainId)) + + return uniqueChainIds.reduce((acc, chainId) => { + const accounts = allAccounts.filter( + (account) => account.chainId === chainId + ) + + const accountBalancesLoadables = get( + waitForNone( + accounts.map(({ chainId, address }) => + genericTokenBalancesSelector({ + chainId: nativeChainId, + address: coreAddress, + nativeGovernanceTokenDenom: + chainId === nativeChainId + ? nativeGovernanceTokenDenom + : undefined, + cw20GovernanceTokenAddress: + chainId === nativeChainId + ? cw20GovernanceTokenAddress + : undefined, + filter: { + account: { + chainId, + address, + }, + }, + }) + ) + ) + ) + const accountBalances = accountBalancesLoadables.flatMap( + (loadable, index) => + loadable.state === 'hasValue' + ? { + account: accounts[index], + balances: loadable.contents, + } + : [] + ) + + // Updating if any loadables are still loading. If none are loading but + // a native token is still waiting for staking info, this is updated + // below. + let updating = accountBalancesLoadables.some( + (loadable) => loadable.state === 'loading' + ) + + // Get token card infos for loaded tokens. + const infos = accountBalances.flatMap(({ account, balances }) => + balances.flatMap( + ({ + token, + balance, + isGovernanceToken = false, + }): TokenCardInfo | [] => { + const unstakedBalance = convertMicroDenomToDenomWithDecimals( + balance, + token.decimals + ) + + let hasStakingInfo = false + // Staking info only exists for native token. + if ( + token.type === TokenType.Native && + token.denomOrAddress === + getNativeTokenForChainId(chainId).denomOrAddress + ) { + // Check if anything staked. + const stakedBalance = get( + noWait( + nativeDelegatedBalanceSelector({ + chainId, + address: account.address, + }) + ) + ) + + // Ignore this token until staking info loads. + if (stakedBalance.state === 'loading') { + // Make sure updating is true if waiting on staking info. + updating = true + + return [] + } + + hasStakingInfo = + stakedBalance.state === 'hasValue' && + stakedBalance.contents.amount !== '0' + } + + const lazyInfo = get( + noWait( + tokenCardLazyInfoSelector({ + owner: account.address, + token, + unstakedBalance, + }) + ) + ) + + return { + owner: account, + token, + isGovernanceToken, + unstakedBalance, + hasStakingInfo, + lazyInfo: loadableToLoadingData(lazyInfo, { + usdUnitPrice: undefined, + stakingInfo: undefined, + totalBalance: unstakedBalance, + }), + } + } + ) + ) + + return { + ...acc, + [chainId]: + accounts.length > 0 && + accountBalancesLoadables.every( + (loadable) => loadable.state === 'loading' + ) + ? { + loading: true, + errored: false, + } + : { + loading: false, + errored: false, + updating, + data: infos, + }, + } + }, {} as LoadingTokens) + }, +}) + +const ACCOUNT_FILTER_PROPERTIES = ['type', 'chainId', 'address'] as const + +export const treasuryValueHistorySelector = selectorFamily< + { + timestamps: Date[] + tokens: { + token: GenericToken + // Value at each timestamp. + values: (number | null)[] + }[] + // Total value at each timestamp. + totals: (number | null)[] + }, + WithChainId<{ + address: string + range: TokenPriceHistoryRange + filter?: { + // Filter by any of the account properties. + account?: Partial> + // If defined, only show these tokens. + tokens?: GenericTokenSource[] + } + }> +>({ + key: 'treasuryValueHistory', + get: + ({ chainId: nativeChainId, address, range, filter }) => + ({ get }) => { + const isCommunityPool = address === COMMUNITY_POOL_ADDRESS_PLACEHOLDER + + let allAccounts: Account[] = isCommunityPool + ? [ + { + type: AccountType.Native, + chainId: nativeChainId, + address, + }, + ] + : get( + accountsSelector({ + chainId: nativeChainId, + address, + }) + ) + + // Filter by account fields. + if (filter?.account) { + allAccounts = allAccounts.filter((account) => + ACCOUNT_FILTER_PROPERTIES.every( + (key) => + !filter.account || + !(key in filter.account) || + account[key] === filter.account[key] + ) + ) + } + + // Value history for all accounts. + const { timestamps, assets, totals } = get( + querySnapperSelector({ + query: 'daodao-many-value-history', + parameters: { + accounts: allAccounts.map( + ({ chainId, address }) => `${chainId}:${address}` + ), + range, + tokenFilter: filter?.tokens + ?.map( + ({ chainId, denomOrAddress }) => `${chainId}:${denomOrAddress}` + ) + .join(','), + }, + }) + ) as { + timestamps: number[] + assets: { + origin: { + chainId: string + denom: string + } + // Value at each timestamp. + values: (number | null)[] + }[] + // Total value at each timestamp. + totals: (number | null)[] + } + + const tokens = get( + waitForAll( + assets.map(({ origin: { chainId, denom } }) => + genericTokenSelector({ + type: denom.startsWith('cw20:') + ? TokenType.Cw20 + : TokenType.Native, + chainId, + denomOrAddress: denom.startsWith('cw20:') + ? denom.slice(5) + : denom, + }) + ) + ) + ) + + return { + timestamps: timestamps.map((timestamp) => new Date(timestamp)), + tokens: assets.map(({ values }, index) => ({ + token: tokens[index], + values: values.map((value) => value ?? null), + })), + totals, + } + }, +}) diff --git a/packages/stateful/recoil/selectors/vesting.ts b/packages/state/recoil/selectors/vesting.ts similarity index 97% rename from packages/stateful/recoil/selectors/vesting.ts rename to packages/state/recoil/selectors/vesting.ts index f83018960..2f157ecd8 100644 --- a/packages/stateful/recoil/selectors/vesting.ts +++ b/packages/state/recoil/selectors/vesting.ts @@ -1,17 +1,6 @@ import uniq from 'lodash.uniq' import { selectorFamily, waitForAll, waitForAllSettled } from 'recoil' -import { - Cw1WhitelistSelectors, - CwPayrollFactorySelectors, - CwVestingSelectors, - genericTokenSelector, - isContractSelector, - nativeDelegationInfoSelector, - queryWalletIndexerSelector, - refreshVestingAtom, - validatorSlashesSelector, -} from '@dao-dao/state/recoil' import { TokenType, VestingInfo, @@ -24,6 +13,17 @@ import { getVestingValidatorSlashes, } from '@dao-dao/utils' +import { refreshVestingAtom } from '../atoms' +import { nativeDelegationInfoSelector, validatorSlashesSelector } from './chain' +import { isContractSelector } from './contract' +import { + Cw1WhitelistSelectors, + CwPayrollFactorySelectors, + CwVestingSelectors, +} from './contracts' +import { queryWalletIndexerSelector } from './indexer' +import { genericTokenSelector } from './token' + export const vestingPaymentsOwnedBySelector = selectorFamily< string[], WithChainId<{ address: string }> diff --git a/packages/state/recoil/selectors/wallet.ts b/packages/state/recoil/selectors/wallet.ts index 0acac4dd1..d8143bc28 100644 --- a/packages/state/recoil/selectors/wallet.ts +++ b/packages/state/recoil/selectors/wallet.ts @@ -1,19 +1,56 @@ -import { selectorFamily, waitForAll } from 'recoil' +import { + Loadable, + atomFamily, + noWait, + selectorFamily, + waitForAll, + waitForAny, +} from 'recoil' -import { GenericTokenBalance, TokenType, WithChainId } from '@dao-dao/types' -import { DAO_VOTING_TOKEN_STAKED_CONTRACT_NAMES } from '@dao-dao/utils' +import { + AccountTxSave, + AccountType, + ContractVersion, + ContractVersionInfo, + GenericTokenBalance, + LazyDaoCardProps, + LazyNftCardInfo, + TokenCardInfo, + TokenType, + WithChainId, +} from '@dao-dao/types' +import { Config as DaoCoreV2Config } from '@dao-dao/types/contracts/DaoCore.v2' +import { + DAO_VOTING_TOKEN_STAKED_CONTRACT_NAMES, + HIDDEN_BALANCE_PREFIX, + INACTIVE_DAO_NAMES, + KVPK_API_BASE, + ME_SAVED_TX_PREFIX, + convertMicroDenomToDenomWithDecimals, + getFallbackImage, + getNativeTokenForChainId, + loadableToLoadingData, + parseContractVersion, +} from '@dao-dao/utils' -import { refreshWalletBalancesIdAtom } from '../atoms' +import { + refreshHiddenBalancesAtom, + refreshSavedTxsAtom, + refreshWalletBalancesIdAtom, +} from '../atoms' +import { accountsSelector } from './account' +import { nativeBalancesSelector, nativeDelegatedBalanceSelector } from './chain' import { isContractSelector } from './contract' import { votingModuleSelector } from './contracts/DaoCore.v2' import * as DaoVotingTokenStaked from './contracts/DaoVotingTokenStaked' +import { lazyDaoCardPropsSelector } from './dao' +import { followingDaosSelector } from './following' import { queryWalletIndexerSelector } from './indexer' -import { genericTokenSelector } from './token' - -type ContractWithBalance = { - contractAddress: string - balance: string -} +import { + walletLazyNftCardInfosSelector, + walletStakedLazyNftCardInfosSelector, +} from './nft' +import { genericTokenSelector, tokenCardLazyInfoSelector } from './token' // Get CW20 balances for a wallet from the indexer. export const walletCw20BalancesSelector = selectorFamily< @@ -26,7 +63,10 @@ export const walletCw20BalancesSelector = selectorFamily< ({ get }) => { const id = get(refreshWalletBalancesIdAtom(walletAddress)) - const cw20Contracts: ContractWithBalance[] = + const cw20Contracts: { + contractAddress: string + balance: string + }[] = get( queryWalletIndexerSelector({ chainId, @@ -122,3 +162,405 @@ export const walletTokenDaoStakedDenomsSelector = selectorFamily< return [...uniqueDenoms] }, }) + +// This doesn't update right away due to Cloudflare KV Store latency, so this +// serves to keep track of all successful updates for the current session. This +// will be reset on page refresh. Set this right away so the UI can update +// immediately even if the API takes up to a minute or two. Though likely it +// only takes 10 seconds or so. +// +// Takes wallet public key as a parameter. +export const temporarySavedTxsAtom = atomFamily< + Record, + string +>({ + key: 'temporarySavedTxs', + default: {}, +}) + +// Takes wallet public key as a parameter. +export const savedTxsSelector = selectorFamily({ + key: 'savedTxs', + get: + (walletPublicKey) => + async ({ get }) => { + get(refreshSavedTxsAtom) + + const temporary = get(temporarySavedTxsAtom(walletPublicKey)) + + const response = await fetch( + KVPK_API_BASE + `/list/${walletPublicKey}/${ME_SAVED_TX_PREFIX}` + ) + + if (response.ok) { + const { items } = (await response.json()) as { + items: { + key: string + value: AccountTxSave + }[] + } + + const savedItems = Object.entries(temporary) + // Add any items that are in the KV store but not in the temporary map. + items.forEach(({ key, value }) => { + if (!(key in temporary)) { + savedItems.push([key, value]) + } + }) + + const saves = savedItems + .map(([, value]) => value) + // If the save is null, it came from the temporary map and means it + // was deleted, so we need to remove it from the list. + .filter((save): save is AccountTxSave => !!save) + .sort((a, b) => a.name.localeCompare(b.name)) + + return saves + } else { + throw new Error( + `Failed to fetch tx saves: ${response.status}/${ + response.statusText + } ${await response.text().catch(() => '')}`.trim() + ) + } + }, +}) + +// This doesn't update right away due to Cloudflare KV Store latency, so this +// serves to keep track of all successful updates for the current session. This +// will be reset on page refresh. Set this right away so the UI can update +// immediately even if the API takes up to a minute or two. Though likely it +// only takes 10 seconds or so. +// +// Takes wallet public key as a parameter. +export const temporaryHiddenBalancesAtom = atomFamily< + Record, + string +>({ + key: 'temporaryHiddenBalances', + default: {}, +}) + +// Takes wallet public key as a parameter. Return list of token denomOrAddress +// fields that are hidden. +export const hiddenBalancesSelector = selectorFamily({ + key: 'hiddenBalances', + get: + (walletPublicKey) => + async ({ get }) => { + get(refreshHiddenBalancesAtom) + + const temporary = get(temporaryHiddenBalancesAtom(walletPublicKey)) + + const response = await fetch( + KVPK_API_BASE + `/list/${walletPublicKey}/${HIDDEN_BALANCE_PREFIX}` + ) + + if (response.ok) { + const { items } = (await response.json()) as { + items: { + key: string + value: number | null + }[] + } + + const hiddenBalances = Object.entries(temporary) + // Add any items that are in the KV store but not in the temporary map. + items.forEach(({ key, value }) => { + if (!(key in temporary)) { + hiddenBalances.push([key, value]) + } + }) + + const hidden = hiddenBalances + .filter(([, value]) => value !== null) + // Remove prefix so it's just the token's denomOrAddress. + .map(([key]) => key.replace(HIDDEN_BALANCE_PREFIX, '')) + + return hidden + } else { + throw new Error( + `Failed to fetch hidden balances: ${response.status}/${ + response.statusText + } ${await response.text().catch(() => '')}`.trim() + ) + } + }, +}) + +// lazyInfo must be loaded in the component separately, since it refreshes on a +// timer and we don't want this whole selector to reevaluate and load when that +// refreshes. Use `tokenCardLazyInfoSelector`. +export const walletTokenCardInfosSelector = selectorFamily< + TokenCardInfo[], + WithChainId<{ + walletAddress: string + }> +>({ + key: 'walletTokenCardInfos', + get: + ({ walletAddress, chainId }) => + ({ get }) => { + const id = get(refreshWalletBalancesIdAtom(walletAddress)) + + const allAccounts = get( + accountsSelector({ + chainId, + address: walletAddress, + }) + ) + + const nativeBalances = get( + waitForAll( + allAccounts.map(({ chainId, address }) => + nativeBalancesSelector({ + address, + chainId, + }) + ) + ) + ) + const cw20ContractsLoadable: Loadable< + | { + contractAddress: string + balance: string | undefined + }[] + | undefined + > = get( + noWait( + queryWalletIndexerSelector({ + chainId, + walletAddress, + formula: 'tokens/list', + id, + noFallback: true, + }) + ) + ) + const cw20Contracts = + cw20ContractsLoadable.state === 'hasValue' + ? cw20ContractsLoadable.contents ?? [] + : [] + const cw20s = get( + noWait( + waitForAny( + cw20Contracts.map((c) => + genericTokenSelector({ + type: TokenType.Cw20, + denomOrAddress: c.contractAddress, + chainId, + }) + ) + ) + ) + ) + + const infos: TokenCardInfo[] = [ + ...nativeBalances.flatMap((accountBalances, accountIndex) => + accountBalances.map(({ token, balance }) => { + const unstakedBalance = convertMicroDenomToDenomWithDecimals( + balance, + token.decimals + ) + + // Staking info only exists for native token. + const hasStakingInfo = + token.denomOrAddress === + getNativeTokenForChainId(chainId).denomOrAddress && + // Check if anything staked. + Number( + get( + nativeDelegatedBalanceSelector({ + address: walletAddress, + chainId, + }) + ).amount + ) > 0 + + const owner = allAccounts[accountIndex] + + const lazyInfo = get( + noWait( + tokenCardLazyInfoSelector({ + owner: owner.address, + token, + unstakedBalance, + }) + ) + ) + + const info: TokenCardInfo = { + owner, + token, + isGovernanceToken: false, + unstakedBalance, + hasStakingInfo, + lazyInfo: loadableToLoadingData(lazyInfo, { + usdUnitPrice: undefined, + stakingInfo: undefined, + totalBalance: unstakedBalance, + }), + } + + return info + }) + ), + ...(cw20s.valueMaybe() || []).flatMap((tokenLoadable, index) => { + const token = tokenLoadable.valueMaybe() + if (!token) { + return [] + } + + const unstakedBalance = convertMicroDenomToDenomWithDecimals( + cw20Contracts[index].balance || '0', + token.decimals + ) + + const lazyInfo = get( + noWait( + tokenCardLazyInfoSelector({ + owner: walletAddress, + token, + unstakedBalance, + }) + ) + ) + + const info: TokenCardInfo = { + owner: { + type: AccountType.Native, + chainId, + address: walletAddress, + }, + token, + isGovernanceToken: false, + unstakedBalance, + // No unstaking info for CW20. + hasStakingInfo: false, + lazyInfo: loadableToLoadingData(lazyInfo, { + usdUnitPrice: undefined, + stakingInfo: undefined, + totalBalance: unstakedBalance, + }), + } + + return info + }), + ] + + return infos + }, +}) + +// Get NFTs for a wallet on many chains. +export const allWalletNftsSelector = selectorFamily< + LazyNftCardInfo[], + { + chainId: string + walletAddress: string + }[] +>({ + key: 'allWalletNfts', + get: + (chainWallets) => + ({ get }) => { + const nativeNfts = get( + waitForAll( + chainWallets.map(({ chainId, walletAddress }) => + walletLazyNftCardInfosSelector({ + chainId, + walletAddress, + }) + ) + ) + ).reduce( + (acc, nftCardInfos) => [ + ...acc, + ...Object.values(nftCardInfos).flatMap((data) => + !data || data.loading || data.errored ? [] : data.data + ), + ], + [] as LazyNftCardInfo[] + ) + + const nativeStakedNfts = get( + waitForAll( + chainWallets.map(({ chainId, walletAddress }) => + walletStakedLazyNftCardInfosSelector({ + chainId, + walletAddress, + }) + ) + ) + ).flat() + + return [...nativeNfts, ...nativeStakedNfts] + }, +}) + +// Get lazy card info for DAOs this wallet is a member of. +export const lazyWalletDaosSelector = selectorFamily< + LazyDaoCardProps[], + WithChainId<{ address: string }> +>({ + key: 'lazyWalletDaos', + get: + ({ chainId, address }) => + ({ get }) => { + const daos: { + dao: string + info: ContractVersionInfo + config: DaoCoreV2Config + proposalCount: number + }[] = get( + queryWalletIndexerSelector({ + chainId, + walletAddress: address, + formula: 'daos/memberOf', + noFallback: true, + }) + ) + if (!daos || !Array.isArray(daos)) { + return [] + } + + const lazyDaoCards = daos.map( + ({ dao, info, config, proposalCount }): LazyDaoCardProps => ({ + chainId, + coreAddress: dao, + coreVersion: + parseContractVersion(info.version) || ContractVersion.Unknown, + name: config.name, + description: config.description, + imageUrl: config.image_url || getFallbackImage(dao), + isInactive: + INACTIVE_DAO_NAMES.includes(config.name) || proposalCount === 0, + }) + ) + + return lazyDaoCards + }, +}) + +// Get lazy card info for DAOs this wallet is following. +export const lazyWalletFollowingDaosSelector = selectorFamily< + LazyDaoCardProps[], + { walletPublicKey: string } +>({ + key: 'lazyWalletFollowingDaos', + get: + ({ walletPublicKey }) => + ({ get }) => { + const daos = get( + followingDaosSelector({ + walletPublicKey, + }) + ) + + return daos.length > 0 + ? get( + waitForAny(daos.map((dao) => lazyDaoCardPropsSelector(dao))) + ).flatMap((loadable) => loadable.valueMaybe() || []) + : [] + }, +}) diff --git a/packages/stateful/actions/core/dao_governance/CreateDao/index.tsx b/packages/stateful/actions/core/dao_governance/CreateDao/index.tsx index 1e0a944f7..d9b78a0a1 100644 --- a/packages/stateful/actions/core/dao_governance/CreateDao/index.tsx +++ b/packages/stateful/actions/core/dao_governance/CreateDao/index.tsx @@ -1,6 +1,7 @@ import { useCallback } from 'react' import { constSelector } from 'recoil' +import { daoParentInfoSelector } from '@dao-dao/state/recoil' import { DaoEmoji, useCachedLoadingWithError, @@ -17,7 +18,6 @@ import { import { decodeJsonFromBase64, objectMatchesStructure } from '@dao-dao/utils' import { LinkWrapper } from '../../../../components' -import { daoParentInfoSelector } from '../../../../recoil' import { CreateDaoComponent, CreateDaoData } from './Component' const Component: ActionComponent = (props) => { diff --git a/packages/stateful/actions/core/dao_governance/ManageVetoableDaos/index.tsx b/packages/stateful/actions/core/dao_governance/ManageVetoableDaos/index.tsx index 477125173..8687d8330 100644 --- a/packages/stateful/actions/core/dao_governance/ManageVetoableDaos/index.tsx +++ b/packages/stateful/actions/core/dao_governance/ManageVetoableDaos/index.tsx @@ -1,5 +1,6 @@ import { useCallback } from 'react' +import { daoVetoableDaosSelector } from '@dao-dao/state/recoil' import { ThumbDownEmoji, useCachedLoadingWithError } from '@dao-dao/stateless' import { Feature } from '@dao-dao/types' import { @@ -18,7 +19,6 @@ import { } from '@dao-dao/utils' import { AddressInput, EntityDisplay } from '../../../../components' -import { daoVetoableDaosSelector } from '../../../../recoil' import { useActionOptions } from '../../../react' import { ManageVetoableDaosData, diff --git a/packages/stateful/actions/core/dao_governance/UpgradeV1ToV2/index.tsx b/packages/stateful/actions/core/dao_governance/UpgradeV1ToV2/index.tsx index 1f86feb58..fbe927287 100644 --- a/packages/stateful/actions/core/dao_governance/UpgradeV1ToV2/index.tsx +++ b/packages/stateful/actions/core/dao_governance/UpgradeV1ToV2/index.tsx @@ -4,6 +4,7 @@ import { useRecoilValueLoadable, waitForAll, waitForAllSettled } from 'recoil' import { DaoCoreV2Selectors, contractVersionSelector, + daoPotentialSubDaosSelector, isDaoSelector, } from '@dao-dao/state/recoil' import { @@ -37,10 +38,7 @@ import { DaoProposalSingleAdapter, matchAndLoadCommon, } from '../../../../proposal-module-adapter' -import { - daoCoreProposalModulesSelector, - daoPotentialSubDaosSelector, -} from '../../../../recoil' +import { daoCoreProposalModulesSelector } from '../../../../recoil' import { useActionOptions } from '../../../react' import { UpgradeV1ToV2Component, UpgradeV1ToV2Data } from './Component' diff --git a/packages/stateful/actions/core/nfts/BurnNft/index.tsx b/packages/stateful/actions/core/nfts/BurnNft/index.tsx index 47218e835..17c2fe860 100644 --- a/packages/stateful/actions/core/nfts/BurnNft/index.tsx +++ b/packages/stateful/actions/core/nfts/BurnNft/index.tsx @@ -2,6 +2,11 @@ import { useCallback } from 'react' import { useFormContext } from 'react-hook-form' import { constSelector } from 'recoil' +import { + lazyNftCardInfosForDaoSelector, + nftCardInfoSelector, + walletLazyNftCardInfosSelector, +} from '@dao-dao/state/recoil' import { FireEmoji, useCachedLoadingWithError } from '@dao-dao/stateless' import { ActionComponent, @@ -23,11 +28,6 @@ import { } from '@dao-dao/utils' import { NftSelectionModal } from '../../../../components' -import { - lazyNftCardInfosForDaoSelector, - nftCardInfoSelector, - walletLazyNftCardInfosSelector, -} from '../../../../recoil/selectors/nft' import { useCw721CommonGovernanceTokenInfoIfExists } from '../../../../voting-module-adapter' import { useActionOptions } from '../../../react' import { BurnNft, BurnNftData } from './Component' diff --git a/packages/stateful/actions/core/nfts/MintNft/MintNft.tsx b/packages/stateful/actions/core/nfts/MintNft/MintNft.tsx index 8733bc7e3..e53ae7388 100644 --- a/packages/stateful/actions/core/nfts/MintNft/MintNft.tsx +++ b/packages/stateful/actions/core/nfts/MintNft/MintNft.tsx @@ -5,6 +5,7 @@ import { constSelector, useRecoilValueLoadable } from 'recoil' import { CommonNftSelectors, DaoCoreV2Selectors, + nftCardInfoWithUriSelector, nftUriDataSelector, } from '@dao-dao/state/recoil' import { Loader, useCachedLoading } from '@dao-dao/stateless' @@ -17,7 +18,6 @@ import { import { getChainForChainId, isValidBech32Address } from '@dao-dao/utils' import { AddressInput } from '../../../../components' -import { nftCardInfoWithUriSelector } from '../../../../recoil' import { useActionOptions } from '../../../react' import { MintNft as StatelessMintNft } from './stateless/MintNft' import { MintNftData } from './types' diff --git a/packages/stateful/actions/core/nfts/TransferNft/index.tsx b/packages/stateful/actions/core/nfts/TransferNft/index.tsx index 320ef56b9..a83f0001e 100644 --- a/packages/stateful/actions/core/nfts/TransferNft/index.tsx +++ b/packages/stateful/actions/core/nfts/TransferNft/index.tsx @@ -3,6 +3,11 @@ import { useCallback } from 'react' import { useFormContext } from 'react-hook-form' import { constSelector } from 'recoil' +import { + lazyNftCardInfosForDaoSelector, + nftCardInfoSelector, + walletLazyNftCardInfosSelector, +} from '@dao-dao/state/recoil' import { BoxEmoji, useCachedLoadingWithError } from '@dao-dao/stateless' import { ActionComponent, @@ -27,11 +32,6 @@ import { import { AddressInput, NftSelectionModal } from '../../../../components' import { useWallet } from '../../../../hooks' -import { - lazyNftCardInfosForDaoSelector, - nftCardInfoSelector, - walletLazyNftCardInfosSelector, -} from '../../../../recoil/selectors/nft' import { useCw721CommonGovernanceTokenInfoIfExists } from '../../../../voting-module-adapter' import { useActionOptions } from '../../../react' import { TransferNftComponent, TransferNftData } from './Component' diff --git a/packages/stateful/actions/core/treasury/ManageVesting/index.tsx b/packages/stateful/actions/core/treasury/ManageVesting/index.tsx index 4b358d5cb..906d2e950 100644 --- a/packages/stateful/actions/core/treasury/ManageVesting/index.tsx +++ b/packages/stateful/actions/core/treasury/ManageVesting/index.tsx @@ -8,6 +8,9 @@ import { Cw1WhitelistSelectors, genericTokenSelector, nativeUnstakingDurationSecondsSelector, + vestingFactoryOwnerSelector, + vestingInfoSelector, + vestingInfosOwnedBySelector, } from '@dao-dao/state/recoil' import { Loader, @@ -70,11 +73,6 @@ import { VestingPaymentCard, } from '../../../../components' import { useCreateCw1Whitelist } from '../../../../hooks' -import { - vestingFactoryOwnerSelector, - vestingInfoSelector, - vestingInfosOwnedBySelector, -} from '../../../../recoil/selectors/vesting' import { useWidget } from '../../../../widgets' import { useTokenBalances } from '../../../hooks/useTokenBalances' import { useActionOptions } from '../../../react' diff --git a/packages/stateful/components/DappLayout.tsx b/packages/stateful/components/DappLayout.tsx index 596f5e0ef..af0b15ff4 100644 --- a/packages/stateful/components/DappLayout.tsx +++ b/packages/stateful/components/DappLayout.tsx @@ -7,6 +7,7 @@ import { useRecoilState, useRecoilValue, waitForAll } from 'recoil' import { betaWarningAcceptedAtom, commandModalVisibleAtom, + followingDaoDropdownInfosSelector, mountedInBrowserAtom, navigationCompactAtom, proposalCreatedCardPropsAtom, @@ -25,10 +26,7 @@ import { getSupportedChains, maybeGetChainForChainId } from '@dao-dao/utils' import { CommandModal } from '../command' import { useAutoRefreshData, useProfile, useWallet } from '../hooks' -import { - daoCreatedCardPropsAtom, - followingDaoDropdownInfosSelector, -} from '../recoil' +import { daoCreatedCardPropsAtom } from '../recoil' import { ButtonLink } from './ButtonLink' import { DaoCreatedModal } from './DaoCreatedModal' import { LinkWrapper } from './LinkWrapper' diff --git a/packages/stateful/components/PfpkNftSelectionModal.tsx b/packages/stateful/components/PfpkNftSelectionModal.tsx index 839ebe7a7..d0cd4dbdb 100644 --- a/packages/stateful/components/PfpkNftSelectionModal.tsx +++ b/packages/stateful/components/PfpkNftSelectionModal.tsx @@ -6,6 +6,7 @@ import { useTranslation } from 'react-i18next' import { useRecoilState, useRecoilValue } from 'recoil' import { + allWalletNftsSelector, nftCardInfosForKeyAtom, updateProfileNftVisibleAtom, } from '@dao-dao/state/recoil' @@ -40,7 +41,6 @@ import { useWallet, useWalletBalances, } from '../hooks' -import { allWalletNftsSelector } from '../recoil' import { NftSelectionModal } from './nft' import { ProfileAddChains } from './profile' import { SuspenseLoader } from './SuspenseLoader' diff --git a/packages/stateful/components/ProposalList.tsx b/packages/stateful/components/ProposalList.tsx index 4b7393429..94a0d7e6b 100644 --- a/packages/stateful/components/ProposalList.tsx +++ b/packages/stateful/components/ProposalList.tsx @@ -2,7 +2,10 @@ import { useEffect, useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' import { useRecoilCallback, useSetRecoilState, waitForAll } from 'recoil' -import { refreshProposalsIdAtom } from '@dao-dao/state/recoil' +import { + daoVetoableDaosSelector, + refreshProposalsIdAtom, +} from '@dao-dao/state/recoil' import { ProposalList as StatelessProposalList, useAppContext, @@ -25,10 +28,7 @@ import { useOnWebSocketMessage, } from '../hooks' import { matchAndLoadCommon } from '../proposal-module-adapter' -import { - daoVetoableDaosSelector, - daosWithDropdownVetoableProposalListSelector, -} from '../recoil' +import { daosWithDropdownVetoableProposalListSelector } from '../recoil' import { DiscordNotifierConfigureModal } from './dao/DiscordNotifierConfigureModal' import { LinkWrapper } from './LinkWrapper' import { ProposalLine } from './ProposalLine' diff --git a/packages/stateful/components/TreasuryHistoryGraph.tsx b/packages/stateful/components/TreasuryHistoryGraph.tsx index 9dd43a45b..51a87d3ed 100644 --- a/packages/stateful/components/TreasuryHistoryGraph.tsx +++ b/packages/stateful/components/TreasuryHistoryGraph.tsx @@ -18,6 +18,7 @@ import { Line } from 'react-chartjs-2' import { useTranslation } from 'react-i18next' import useDeepCompareEffect from 'use-deep-compare-effect' +import { treasuryValueHistorySelector } from '@dao-dao/state' import { Loader, SegmentedControls, @@ -36,8 +37,6 @@ import { shortenTokenSymbol, } from '@dao-dao/utils' -import { treasuryValueHistorySelector } from '../recoil' - import 'chartjs-adapter-date-fns' ChartJS.register( diff --git a/packages/stateful/components/dao/DaoTokenCard.tsx b/packages/stateful/components/dao/DaoTokenCard.tsx index c994379b5..e1df2e8f2 100644 --- a/packages/stateful/components/dao/DaoTokenCard.tsx +++ b/packages/stateful/components/dao/DaoTokenCard.tsx @@ -8,7 +8,10 @@ import { useCallback, useState } from 'react' import { useTranslation } from 'react-i18next' import { useSetRecoilState } from 'recoil' -import { refreshNativeTokenStakingInfoAtom } from '@dao-dao/state' +import { + refreshNativeTokenStakingInfoAtom, + tokenCardLazyInfoSelector, +} from '@dao-dao/state' import { ChainProvider, TokenCard as StatelessTokenCard, @@ -30,7 +33,6 @@ import { tokensEqual, } from '@dao-dao/utils' -import { tokenCardLazyInfoSelector } from '../../recoil' import { useVotingModuleAdapter } from '../../voting-module-adapter' import { ButtonLink } from '../ButtonLink' import { EntityDisplay } from '../EntityDisplay' diff --git a/packages/stateful/components/dao/DaoTokenLine.tsx b/packages/stateful/components/dao/DaoTokenLine.tsx index 67f7fa28a..8fab1ae43 100644 --- a/packages/stateful/components/dao/DaoTokenLine.tsx +++ b/packages/stateful/components/dao/DaoTokenLine.tsx @@ -1,3 +1,4 @@ +import { tokenCardLazyInfoSelector } from '@dao-dao/state/recoil' import { TokenLine as StatelessTokenLine, useCachedLoading, @@ -5,7 +6,6 @@ import { import { TokenCardInfo, TokenLineProps } from '@dao-dao/types' import { getDisplayNameForChainId } from '@dao-dao/utils' -import { tokenCardLazyInfoSelector } from '../../recoil' import { DaoTokenCard } from './DaoTokenCard' export const DaoTokenLine = ( diff --git a/packages/stateful/components/dao/tabs/TreasuryTab.tsx b/packages/stateful/components/dao/tabs/TreasuryTab.tsx index 2f857214d..3c2b48b67 100644 --- a/packages/stateful/components/dao/tabs/TreasuryTab.tsx +++ b/packages/stateful/components/dao/tabs/TreasuryTab.tsx @@ -1,3 +1,7 @@ +import { + lazyNftCardInfosForDaoSelector, + treasuryTokenCardInfosForDaoSelector, +} from '@dao-dao/state' import { TreasuryTab as StatelessTreasuryTab, useCachedLoading, @@ -9,10 +13,6 @@ import { getDaoProposalSinglePrefill } from '@dao-dao/utils' import { useActionForKey } from '../../../actions' import { useWallet } from '../../../hooks' -import { - lazyNftCardInfosForDaoSelector, - treasuryTokenCardInfosForDaoSelector, -} from '../../../recoil' import { useCw20CommonGovernanceTokenInfoIfExists, useCw721CommonGovernanceTokenInfoIfExists, diff --git a/packages/stateful/components/gov/GovCommunityPoolTab.tsx b/packages/stateful/components/gov/GovCommunityPoolTab.tsx index 8f4357992..d1084ed9b 100644 --- a/packages/stateful/components/gov/GovCommunityPoolTab.tsx +++ b/packages/stateful/components/gov/GovCommunityPoolTab.tsx @@ -1,6 +1,9 @@ import { waitForAny } from 'recoil' -import { communityPoolBalancesSelector } from '@dao-dao/state/recoil' +import { + communityPoolBalancesSelector, + tokenCardLazyInfoSelector, +} from '@dao-dao/state/recoil' import { ButtonPopup, ErrorPage, @@ -19,7 +22,6 @@ import { } from '@dao-dao/utils' import { GovActionsProvider } from '../../actions' -import { tokenCardLazyInfoSelector } from '../../recoil' import { GovTokenLine } from './GovTokenLine' export const GovCommunityPoolTab = () => { diff --git a/packages/stateful/components/gov/GovTokenLine.tsx b/packages/stateful/components/gov/GovTokenLine.tsx index dfb826432..a02ce2e25 100644 --- a/packages/stateful/components/gov/GovTokenLine.tsx +++ b/packages/stateful/components/gov/GovTokenLine.tsx @@ -1,3 +1,4 @@ +import { tokenCardLazyInfoSelector } from '@dao-dao/state/recoil' import { TokenLine as StatelessTokenLine, useCachedLoading, @@ -5,7 +6,6 @@ import { import { TokenCardInfo, TokenLineProps } from '@dao-dao/types' import { getDisplayNameForChainId } from '@dao-dao/utils' -import { tokenCardLazyInfoSelector } from '../../recoil' import { GovTokenCard } from './GovTokenCard' export const GovTokenLine = ( diff --git a/packages/stateful/components/nft/LazyNftCard.tsx b/packages/stateful/components/nft/LazyNftCard.tsx index eeb63d6f2..8b4cc2760 100644 --- a/packages/stateful/components/nft/LazyNftCard.tsx +++ b/packages/stateful/components/nft/LazyNftCard.tsx @@ -1,15 +1,15 @@ import { forwardRef, useEffect } from 'react' import { useSetRecoilState } from 'recoil' -import { nftCardInfosForKeyAtom } from '@dao-dao/state/recoil' +import { + nftCardInfoSelector, + nftCardInfosForKeyAtom, + nftStakerOrOwnerSelector, +} from '@dao-dao/state/recoil' import { useCachedLoadingWithError } from '@dao-dao/stateless' import { LazyNftCardProps } from '@dao-dao/types' import { processError } from '@dao-dao/utils' -import { - nftCardInfoSelector, - nftStakerOrOwnerSelector, -} from '../../recoil/selectors/nft' import { NftCard, NftCardNoCollection, StakedNftCard } from './NftCard' export const LazyNftCard = forwardRef( diff --git a/packages/stateful/components/pages/Account.tsx b/packages/stateful/components/pages/Account.tsx index 5fe672e8e..8138d5c96 100644 --- a/packages/stateful/components/pages/Account.tsx +++ b/packages/stateful/components/pages/Account.tsx @@ -7,6 +7,7 @@ import { useTranslation } from 'react-i18next' import { averageColorSelector, + profileSelector, walletHexPublicKeySelector, } from '@dao-dao/state/recoil' import { @@ -24,10 +25,10 @@ import { SITE_URL, getConfiguredChains, isValidBech32Address, + makeEmptyUnifiedProfile, transformBech32Address, } from '@dao-dao/utils' -import { makeEmptyUnifiedProfile, profileSelector } from '../../recoil' import { ButtonLink } from '../ButtonLink' import { PageHeaderContent } from '../PageHeaderContent' import { SuspenseLoader } from '../SuspenseLoader' diff --git a/packages/stateful/components/profile/ProfileActions.tsx b/packages/stateful/components/profile/ProfileActions.tsx index 5a903d189..7c6b1bf07 100644 --- a/packages/stateful/components/profile/ProfileActions.tsx +++ b/packages/stateful/components/profile/ProfileActions.tsx @@ -8,7 +8,12 @@ import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' import { useRecoilState, useSetRecoilState } from 'recoil' -import { meTransactionAtom, refreshSavedTxsAtom } from '@dao-dao/state' +import { + meTransactionAtom, + refreshSavedTxsAtom, + savedTxsSelector, + temporarySavedTxsAtom, +} from '@dao-dao/state' import { useLoadedActionsAndCategories } from '@dao-dao/stateful/actions' import { ProfileActionsProps, @@ -33,10 +38,6 @@ import { } from '@dao-dao/utils' import { useCfWorkerAuthPostRequest, useWallet } from '../../hooks' -import { - savedTxsSelector, - temporarySavedTxsAtom, -} from '../../recoil/selectors/wallet' import { SuspenseLoader } from '../SuspenseLoader' import { WalletChainSwitcher } from '../wallet' diff --git a/packages/stateful/components/profile/ProfileWallet.tsx b/packages/stateful/components/profile/ProfileWallet.tsx index 3fc88dec1..f38f48146 100644 --- a/packages/stateful/components/profile/ProfileWallet.tsx +++ b/packages/stateful/components/profile/ProfileWallet.tsx @@ -1,16 +1,16 @@ import { constSelector, waitForAny } from 'recoil' -import { accountsSelector } from '@dao-dao/state/recoil' +import { + accountsSelector, + hiddenBalancesSelector, + walletTokenCardInfosSelector, +} from '@dao-dao/state/recoil' import { ProfileWallet as StatelessProfileWallet, useCachedLoadingWithError, } from '@dao-dao/stateless' import { useProfile } from '../../hooks' -import { - hiddenBalancesSelector, - walletTokenCardInfosSelector, -} from '../../recoil' import { WalletTokenLine } from '../wallet/WalletTokenLine' import { ProfileAddChains } from './ProfileAddChains' diff --git a/packages/stateful/components/vesting/VestingPaymentCard.tsx b/packages/stateful/components/vesting/VestingPaymentCard.tsx index ff298852d..307a776b3 100644 --- a/packages/stateful/components/vesting/VestingPaymentCard.tsx +++ b/packages/stateful/components/vesting/VestingPaymentCard.tsx @@ -6,6 +6,7 @@ import { useSetRecoilState } from 'recoil' import { refreshVestingAtom, refreshWalletBalancesIdAtom, + tokenCardLazyInfoSelector, } from '@dao-dao/state/recoil' import { VestingPaymentCard as StatelessVestingPaymentCard, @@ -33,7 +34,6 @@ import { useDistribute, useWithdrawDelegatorRewards, } from '../../hooks/contracts/CwVesting' -import { tokenCardLazyInfoSelector } from '../../recoil' import { ButtonLink } from '../ButtonLink' import { EntityDisplay } from '../EntityDisplay' import { VestingStakingModal } from './VestingStakingModal' diff --git a/packages/stateful/components/wallet/WalletDaos.tsx b/packages/stateful/components/wallet/WalletDaos.tsx index 340ddea03..88d3844db 100644 --- a/packages/stateful/components/wallet/WalletDaos.tsx +++ b/packages/stateful/components/wallet/WalletDaos.tsx @@ -8,7 +8,11 @@ import { waitForAny, } from 'recoil' -import { commandModalVisibleAtom } from '@dao-dao/state/recoil' +import { + commandModalVisibleAtom, + lazyWalletDaosSelector, + lazyWalletFollowingDaosSelector, +} from '@dao-dao/state/recoil' import { WalletDaos as StatelessWalletDaos, useCachedLoadingWithError, @@ -18,10 +22,6 @@ import { StatefulWalletDaosProps } from '@dao-dao/types' import { getSupportedChains, serializeDaoSource } from '@dao-dao/utils' import { useProfile } from '../../hooks/useProfile' -import { - lazyWalletDaosSelector, - lazyWalletFollowingDaosSelector, -} from '../../recoil' import { LazyDaoCard } from '../dao' import { ProfileAddChains } from '../profile/ProfileAddChains' diff --git a/packages/stateful/components/wallet/WalletTokenCard.tsx b/packages/stateful/components/wallet/WalletTokenCard.tsx index f644213bd..658a2c24e 100644 --- a/packages/stateful/components/wallet/WalletTokenCard.tsx +++ b/packages/stateful/components/wallet/WalletTokenCard.tsx @@ -13,8 +13,11 @@ import { useTranslation } from 'react-i18next' import { useSetRecoilState } from 'recoil' import { + hiddenBalancesSelector, refreshHiddenBalancesAtom, refreshNativeTokenStakingInfoAtom, + temporaryHiddenBalancesAtom, + tokenCardLazyInfoSelector, } from '@dao-dao/state' import { ChainProvider, @@ -46,11 +49,6 @@ import { useWallet, useWalletBalances, } from '../../hooks' -import { - hiddenBalancesSelector, - temporaryHiddenBalancesAtom, - tokenCardLazyInfoSelector, -} from '../../recoil' import { ButtonLink } from '../ButtonLink' import { EntityDisplay } from '../EntityDisplay' import { WalletFiatRampModal } from './WalletFiatRampModal' diff --git a/packages/stateful/components/wallet/WalletTokenCardReadonly.tsx b/packages/stateful/components/wallet/WalletTokenCardReadonly.tsx index 97acc051b..3821dcb67 100644 --- a/packages/stateful/components/wallet/WalletTokenCardReadonly.tsx +++ b/packages/stateful/components/wallet/WalletTokenCardReadonly.tsx @@ -1,3 +1,4 @@ +import { tokenCardLazyInfoSelector } from '@dao-dao/state/recoil' import { ChainProvider, TokenCard as StatelessTokenCard, @@ -5,7 +6,6 @@ import { } from '@dao-dao/stateless' import { TokenCardInfo } from '@dao-dao/types' -import { tokenCardLazyInfoSelector } from '../../recoil' import { ButtonLink } from '../ButtonLink' import { EntityDisplay } from '../EntityDisplay' diff --git a/packages/stateful/components/wallet/WalletTokenLine.tsx b/packages/stateful/components/wallet/WalletTokenLine.tsx index 844b9ae4a..af666a652 100644 --- a/packages/stateful/components/wallet/WalletTokenLine.tsx +++ b/packages/stateful/components/wallet/WalletTokenLine.tsx @@ -1,3 +1,4 @@ +import { tokenCardLazyInfoSelector } from '@dao-dao/state/recoil' import { TokenLine as StatelessTokenLine, useCachedLoading, @@ -5,7 +6,6 @@ import { import { TokenCardInfo, TokenLineProps } from '@dao-dao/types' import { getDisplayNameForChainId } from '@dao-dao/utils' -import { tokenCardLazyInfoSelector } from '../../recoil' import { WalletTokenCard } from './WalletTokenCard' export const WalletTokenLine = ( diff --git a/packages/stateful/components/wallet/WalletTokenLineReadonly.tsx b/packages/stateful/components/wallet/WalletTokenLineReadonly.tsx index 9043df2fb..d24cc30a7 100644 --- a/packages/stateful/components/wallet/WalletTokenLineReadonly.tsx +++ b/packages/stateful/components/wallet/WalletTokenLineReadonly.tsx @@ -1,3 +1,4 @@ +import { tokenCardLazyInfoSelector } from '@dao-dao/state/recoil' import { TokenLine as StatelessTokenLine, useCachedLoading, @@ -5,7 +6,6 @@ import { import { TokenCardInfo, TokenLineProps } from '@dao-dao/types' import { getDisplayNameForChainId } from '@dao-dao/utils' -import { tokenCardLazyInfoSelector } from '../../recoil' import { WalletTokenCardReadonly } from './WalletTokenCardReadonly' export const WalletTokenLineReadonly = ( diff --git a/packages/stateful/feed/react/useFeed.ts b/packages/stateful/feed/react/useFeed.ts index 5098b486c..b3b31292e 100644 --- a/packages/stateful/feed/react/useFeed.ts +++ b/packages/stateful/feed/react/useFeed.ts @@ -1,10 +1,10 @@ import { useEffect, useMemo, useRef } from 'react' import { waitForAll } from 'recoil' +import { lazyDaoCardPropsSelector } from '@dao-dao/state/recoil' import { useCachedLoadable } from '@dao-dao/stateless' import { FeedDaoWithItems, FeedState } from '@dao-dao/types' -import { lazyDaoCardPropsSelector } from '../../recoil' import { getSources } from '../core' export const useFeed = (): FeedState => { diff --git a/packages/stateful/feed/sources/OpenProposals/index.ts b/packages/stateful/feed/sources/OpenProposals/index.ts index e1878f883..50ade7030 100644 --- a/packages/stateful/feed/sources/OpenProposals/index.ts +++ b/packages/stateful/feed/sources/OpenProposals/index.ts @@ -1,7 +1,10 @@ import { useCallback } from 'react' import { constSelector, useSetRecoilState, waitForAll } from 'recoil' -import { refreshOpenProposalsAtom } from '@dao-dao/state/recoil' +import { + followingDaosSelector, + refreshOpenProposalsAtom, +} from '@dao-dao/state/recoil' import { useCachedLoadable, useCachedLoadingWithError, @@ -10,7 +13,6 @@ import { FeedSource } from '@dao-dao/types' import { webSocketChannelNameForDao } from '@dao-dao/utils' import { useOnWebSocketMessage, useProfile } from '../../../hooks' -import { followingDaosSelector } from '../../../recoil' import { OpenProposalsProposalLine } from './OpenProposalsProposalLineProps' import { feedOpenProposalsSelector } from './state' import { OpenProposalsProposalLineProps } from './types' diff --git a/packages/stateful/feed/sources/VetoableProposals/index.ts b/packages/stateful/feed/sources/VetoableProposals/index.ts index 797bb2a0a..5635c1bcd 100644 --- a/packages/stateful/feed/sources/VetoableProposals/index.ts +++ b/packages/stateful/feed/sources/VetoableProposals/index.ts @@ -1,7 +1,10 @@ import { useCallback } from 'react' import { constSelector, useSetRecoilState, waitForAll } from 'recoil' -import { refreshOpenProposalsAtom } from '@dao-dao/state/recoil' +import { + followingDaosSelector, + refreshOpenProposalsAtom, +} from '@dao-dao/state/recoil' import { VetoableProposals as Renderer, VetoableProposalsProps, @@ -11,7 +14,6 @@ import { FeedSource, StatefulProposalLineProps } from '@dao-dao/types' import { webSocketChannelNameForDao } from '@dao-dao/utils' import { useOnWebSocketMessage, useProfile } from '../../../hooks' -import { followingDaosSelector } from '../../../recoil' import { feedVetoableProposalsSelector } from './state' export const VetoableProposals: FeedSource< diff --git a/packages/stateful/feed/sources/VetoableProposals/state.ts b/packages/stateful/feed/sources/VetoableProposals/state.ts index 5c2b627f5..f7b516f95 100644 --- a/packages/stateful/feed/sources/VetoableProposals/state.ts +++ b/packages/stateful/feed/sources/VetoableProposals/state.ts @@ -1,6 +1,6 @@ import { selectorFamily, waitForAny } from 'recoil' -import { DaoCoreV2Selectors } from '@dao-dao/state' +import { DaoCoreV2Selectors, followingDaosSelector } from '@dao-dao/state' import { VetoableProposalsProps } from '@dao-dao/stateless' import { DaoPageMode, @@ -10,10 +10,7 @@ import { import { isConfiguredChainName } from '@dao-dao/utils' import { LinkWrapper, ProposalLine } from '../../../components' -import { - daosWithDropdownVetoableProposalListSelector, - followingDaosSelector, -} from '../../../recoil' +import { daosWithDropdownVetoableProposalListSelector } from '../../../recoil' export const feedVetoableProposalsSelector = selectorFamily< FeedSourceDaoWithItems>[], diff --git a/packages/stateful/hooks/useEntity.ts b/packages/stateful/hooks/useEntity.ts index 0d6d2a69f..8ea9614d1 100644 --- a/packages/stateful/hooks/useEntity.ts +++ b/packages/stateful/hooks/useEntity.ts @@ -3,9 +3,13 @@ import { useMemo } from 'react' import { useCachedLoading, useChain } from '@dao-dao/stateless' import { Entity, EntityType, LoadingData } from '@dao-dao/types' -import { getConfiguredChains, getFallbackImage } from '@dao-dao/utils' +import { + getConfiguredChains, + getFallbackImage, + makeEmptyUnifiedProfile, +} from '@dao-dao/utils' -import { entitySelector, makeEmptyUnifiedProfile } from '../recoil' +import { entitySelector } from '../recoil' export type UseEntityReturn = { /** diff --git a/packages/stateful/hooks/useFollowingDaos.ts b/packages/stateful/hooks/useFollowingDaos.ts index c39a97bb5..fcd669cd9 100644 --- a/packages/stateful/hooks/useFollowingDaos.ts +++ b/packages/stateful/hooks/useFollowingDaos.ts @@ -4,7 +4,11 @@ import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' import { useSetRecoilState, waitForAll } from 'recoil' -import { refreshFollowingDaosAtom } from '@dao-dao/state' +import { + followingDaosSelector, + refreshFollowingDaosAtom, + temporaryFollowingDaosAtom, +} from '@dao-dao/state' import { useCachedLoadingWithError, useUpdatingRef } from '@dao-dao/stateless' import { DaoSource } from '@dao-dao/types' import { @@ -14,10 +18,6 @@ import { serializeDaoSource, } from '@dao-dao/utils' -import { - followingDaosSelector, - temporaryFollowingDaosAtom, -} from '../recoil/selectors/dao/following' import { useCfWorkerAuthPostRequest } from './useCfWorkerAuthPostRequest' import { useManageProfile } from './useManageProfile' import { useProfile } from './useProfile' diff --git a/packages/stateful/hooks/useLoadingDaoCardInfos.ts b/packages/stateful/hooks/useLoadingDaoCardInfos.ts index a01abfbcc..a9f085446 100644 --- a/packages/stateful/hooks/useLoadingDaoCardInfos.ts +++ b/packages/stateful/hooks/useLoadingDaoCardInfos.ts @@ -1,11 +1,14 @@ import { constSelector, useRecoilValueLoadable, waitForAll } from 'recoil' -import { indexerFeaturedDaosSelector } from '@dao-dao/state/recoil' +import { + followingDaosSelector, + indexerFeaturedDaosSelector, +} from '@dao-dao/state/recoil' import { useCachedLoadable } from '@dao-dao/stateless' import { DaoCardInfo, DaoSource, LoadingData } from '@dao-dao/types' import { getSupportedChains } from '@dao-dao/utils' -import { daoCardInfoSelector, followingDaosSelector } from '../recoil' +import { daoCardInfoSelector } from '../recoil' import { useProfile } from './useProfile' export const useLoadingDaoCardInfos = ( diff --git a/packages/stateful/hooks/useManageProfile.ts b/packages/stateful/hooks/useManageProfile.ts index 1eb195474..d206c4f3b 100644 --- a/packages/stateful/hooks/useManageProfile.ts +++ b/packages/stateful/hooks/useManageProfile.ts @@ -3,6 +3,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' import { waitForNone } from 'recoil' +import { profileSelector } from '@dao-dao/state' import { useCachedLoading, useCachedLoadingWithError } from '@dao-dao/stateless' import { AddChainsFunction, @@ -17,11 +18,11 @@ import { PFPK_API_BASE, SignedBody, getDisplayNameForChainId, + makeEmptyUnifiedProfile, makeManuallyResolvedPromise, signOffChainAuth, } from '@dao-dao/utils' -import { makeEmptyUnifiedProfile, profileSelector } from '../recoil' import { useCfWorkerAuthPostRequest } from './useCfWorkerAuthPostRequest' import { useRefreshProfile } from './useRefreshProfile' import { useWallet } from './useWallet' diff --git a/packages/stateful/hooks/useProfile.ts b/packages/stateful/hooks/useProfile.ts index c16925073..33b0c47a7 100644 --- a/packages/stateful/hooks/useProfile.ts +++ b/packages/stateful/hooks/useProfile.ts @@ -1,14 +1,15 @@ +import { profileSelector } from '@dao-dao/state' import { useCachedLoading } from '@dao-dao/stateless' import { LoadingData, ProfileChain, UnifiedProfile } from '@dao-dao/types' import { MAINNET, getDisplayNameForChainId, isSupportedChain, + makeEmptyUnifiedProfile, maybeGetChainForChainId, toBech32Hash, } from '@dao-dao/utils' -import { makeEmptyUnifiedProfile, profileSelector } from '../recoil' import { useRefreshProfile } from './useRefreshProfile' import { useWallet } from './useWallet' diff --git a/packages/stateful/recoil/selectors/dao/misc.ts b/packages/stateful/recoil/selectors/dao.ts similarity index 73% rename from packages/stateful/recoil/selectors/dao/misc.ts rename to packages/stateful/recoil/selectors/dao.ts index 7b710b759..5b81802d2 100644 --- a/packages/stateful/recoil/selectors/dao/misc.ts +++ b/packages/stateful/recoil/selectors/dao.ts @@ -1,17 +1,27 @@ import uniq from 'lodash.uniq' -import { selectorFamily, waitForAll, waitForAllSettled } from 'recoil' +import { + constSelector, + selectorFamily, + waitForAll, + waitForAllSettled, +} from 'recoil' import { DaoCoreV2Selectors, DaoVotingCw20StakedSelectors, accountsSelector, - addressIsModuleSelector, contractInfoSelector, contractInstantiateTimeSelector, contractVersionSelector, + daoDropdownInfoSelector, + daoParentInfoSelector, + daoTvlSelector, + daoVetoableDaosSelector, + followingDaosSelector, + govProposalsSelector, isDaoSelector, moduleAddressSelector, - queryContractIndexerSelector, + nativeDelegatedBalanceSelector, queryWalletIndexerSelector, refreshProposalsIdAtom, reverseLookupPolytoneProxySelector, @@ -19,10 +29,12 @@ import { import { ChainId, ContractVersion, - ContractVersionInfo, + DaoCardInfo, + DaoCardInfoLazyData, DaoInfo, DaoPageMode, DaoParentInfo, + DaoSource, DaoWithDropdownVetoableProposalList, DaoWithVetoableProposals, Feature, @@ -32,30 +44,255 @@ import { SupportedFeatureMap, WithChainId, } from '@dao-dao/types' -import { ConfigResponse as CwCoreV1ConfigResponse } from '@dao-dao/types/contracts/CwCore.v1' -import { ConfigResponse as DaoCoreV2ConfigResponse } from '@dao-dao/types/contracts/DaoCore.v2' import { CHAIN_SUBDAOS, - DAO_CORE_CONTRACT_NAMES, DaoVotingCw20StakedAdapterId, NEUTRON_GOVERNANCE_DAO, - VETOABLE_DAOS_ITEM_KEY_PREFIX, getChainGovernanceDaoDescription, - getConfiguredChainConfig, getDaoProposalPath, getDisplayNameForChainId, getFallbackImage, getImageUrlForChainId, getSupportedFeatures, isConfiguredChainName, - isFeatureSupportedByVersion, mustGetConfiguredChainConfig, - parseContractVersion, } from '@dao-dao/utils' -import { fetchProposalModules } from '../../../utils/fetchProposalModules' -import { matchAdapter as matchVotingModuleAdapter } from '../../../voting-module-adapter' -import { daoDropdownInfoSelector } from './cards' +import { proposalModuleAdapterProposalCountSelector } from '../../proposal-module-adapter' +import { fetchProposalModules } from '../../utils/fetchProposalModules' +import { matchAdapter as matchVotingModuleAdapter } from '../../voting-module-adapter' + +export const daoCardInfoSelector = selectorFamily< + DaoCardInfo, + WithChainId<{ coreAddress: string }> +>({ + key: 'daoCardInfo', + get: + ({ chainId, coreAddress }) => + ({ get }) => { + const daoInfo = get( + daoInfoSelector({ + chainId, + coreAddress, + }) + ) + + return { + chainId: daoInfo.chainId, + coreAddress: daoInfo.coreAddress, + coreVersion: daoInfo.coreVersion, + name: daoInfo.name, + description: daoInfo.description, + imageUrl: daoInfo.imageUrl || getFallbackImage(daoInfo.coreAddress), + polytoneProxies: daoInfo.polytoneProxies, + established: daoInfo.created, + parentDao: daoInfo.parentDao ?? undefined, + tokenDecimals: 6, + tokenSymbol: '', + showingEstimatedUsdValue: true, + lazyData: { loading: true }, + } + }, +}) + +export const daoCardInfoLazyDataSelector = selectorFamily< + DaoCardInfoLazyData, + WithChainId<{ + coreAddress: string + walletAddress?: string + }> +>({ + key: 'daoCardInfoLazyData', + get: + ({ coreAddress, chainId, walletAddress }) => + ({ get }) => { + const { amount: tvl } = get( + daoTvlSelector({ + chainId, + coreAddress, + }) + ) + + // Native chain x/gov module. + if (isConfiguredChainName(chainId, coreAddress)) { + // Get proposal count by loading one proposal and getting the total. + const { total: proposalCount } = get( + govProposalsSelector({ + chainId, + limit: 1, + }) + ) + + const isMember = walletAddress + ? get( + nativeDelegatedBalanceSelector({ + chainId, + address: walletAddress, + }) + ).amount !== '0' + : false + + return { + isMember, + tokenBalance: tvl, + proposalCount, + } + } + + // DAO. + + const walletVotingWeight = walletAddress + ? Number( + get( + DaoCoreV2Selectors.votingPowerAtHeightSelector({ + chainId, + contractAddress: coreAddress, + params: [{ address: walletAddress }], + }) + ).power + ) + : 0 + + const proposalModules = get( + daoCoreProposalModulesSelector({ + chainId, + coreAddress, + }) + ) + const proposalModuleCounts = get( + waitForAll( + proposalModules.map(({ address }) => + proposalModuleAdapterProposalCountSelector({ + chainId, + proposalModuleAddress: address, + }) + ) + ) + ).filter(Boolean) as number[] + + return { + isMember: walletVotingWeight > 0, + tokenBalance: tvl, + proposalCount: proposalModuleCounts.reduce( + (acc, curr) => acc + curr, + 0 + ), + } + }, +}) + +export const subDaoCardInfosSelector = selectorFamily< + DaoCardInfo[], + WithChainId<{ coreAddress: string }> +>({ + key: 'subDaoCardInfos', + get: + ({ coreAddress: contractAddress, chainId }) => + ({ get }) => { + const subDaos = get( + DaoCoreV2Selectors.listAllSubDaosSelector({ + contractAddress, + chainId, + }) + ) + + return get( + waitForAll( + subDaos.map(({ chainId, addr }) => + daoCardInfoSelector({ + chainId, + coreAddress: addr, + }) + ) + ) + ).filter(Boolean) as DaoCardInfo[] + }, +}) + +export const subDaoInfosSelector = selectorFamily< + DaoInfo[], + WithChainId<{ coreAddress: string }> +>({ + key: 'subDaoInfos', + get: + ({ coreAddress: contractAddress, chainId }) => + ({ get }) => { + const subDaos = get( + DaoCoreV2Selectors.listAllSubDaosSelector({ + contractAddress, + chainId, + }) + ) + + return get( + waitForAll( + subDaos.map(({ chainId, addr }) => + daoInfoSelector({ + chainId, + coreAddress: addr, + }) + ) + ) + ) + }, +}) + +export const chainSubDaoInfosSelector = selectorFamily< + DaoInfo[], + { chainId: string } +>({ + key: 'chainSubDaoInfos', + get: + ({ chainId }) => + ({ get }) => { + const subDaos = CHAIN_SUBDAOS[chainId] || [] + + return get( + waitForAll( + subDaos.map((coreAddress) => + daoInfoSelector({ + chainId, + coreAddress, + }) + ) + ) + ) + }, +}) + +export const followingDaosWithProposalModulesSelector = selectorFamily< + (DaoSource & { + proposalModules: ProposalModule[] + })[], + { + walletPublicKey: string + } +>({ + key: 'followingDaosWithProposalModules', + get: + (params) => + ({ get }) => { + const following = get(followingDaosSelector(params)) + + const proposalModules = get( + waitForAll( + following.map(({ chainId, coreAddress }) => + isConfiguredChainName(chainId, coreAddress) + ? constSelector([]) + : daoCoreProposalModulesSelector({ + chainId, + coreAddress, + }) + ) + ) + ) + + return following.map((daoSource, index) => ({ + ...daoSource, + proposalModules: proposalModules[index], + })) + }, +}) export const daoCoreProposalModulesSelector = selectorFamily< ProposalModule[], @@ -129,41 +366,6 @@ export const daoCw20GovernanceTokenAddressSelector = selectorFamily< }, }) -// Retrieve all potential SubDAOs of the DAO from the indexer. -export const daoPotentialSubDaosSelector = selectorFamily< - string[], - WithChainId<{ - coreAddress: string - }> ->({ - key: 'daoPotentialSubDaos', - get: - ({ coreAddress, chainId }) => - ({ get }) => { - const potentialSubDaos: { - contractAddress: string - info: ContractVersionInfo - }[] = get( - queryContractIndexerSelector({ - chainId, - contractAddress: coreAddress, - formula: 'daoCore/potentialSubDaos', - noFallback: true, - }) - ) - - // Filter out those that do not appear to be DAO contracts and also the - // contract itself since it is probably its own admin. - return potentialSubDaos - .filter( - ({ contractAddress, info }) => - contractAddress !== coreAddress && - DAO_CORE_CONTRACT_NAMES.some((name) => info.contract.includes(name)) - ) - .map(({ contractAddress }) => contractAddress) - }, -}) - export const daoInfoSelector = selectorFamily< DaoInfo, { @@ -361,116 +563,6 @@ export const daoInfoSelector = selectorFamily< }, }) -/** - * Attempt to fetch the info needed to describe a parent DAO. Returns undefined - * if not a DAO nor the chain gov module account. - */ -export const daoParentInfoSelector = selectorFamily< - DaoParentInfo | undefined, - WithChainId<{ - parentAddress: string - /** - * To determine if the parent has registered the child, pass the child. This - * will set `registeredSubDao` appropriately. Otherwise, if undefined, - * `registeredSubDao` will be set to false. - */ - childAddress?: string - }> ->({ - key: 'daoParentInfo', - get: - ({ chainId, parentAddress, childAddress }) => - ({ get }) => { - // If address is a DAO contract... - if ( - get( - isDaoSelector({ - chainId, - address: parentAddress, - }) - ) - ) { - const parentAdmin = get( - DaoCoreV2Selectors.adminSelector({ - chainId, - contractAddress: parentAddress, - params: [], - }) - ) - const { - info: { version }, - } = get( - contractInfoSelector({ - chainId, - contractAddress: parentAddress, - }) - ) - const parentVersion = parseContractVersion(version) - - if (parentVersion) { - const { - name, - image_url, - }: CwCoreV1ConfigResponse | DaoCoreV2ConfigResponse = get( - // Both v1 and v2 have a config query. - DaoCoreV2Selectors.configSelector({ - chainId, - contractAddress: parentAddress, - params: [], - }) - ) - - // Check if parent has registered the child DAO as a SubDAO. - const registeredSubDao = - childAddress && - isFeatureSupportedByVersion(Feature.SubDaos, parentVersion) - ? get( - DaoCoreV2Selectors.listAllSubDaosSelector({ - contractAddress: parentAddress, - chainId, - }) - ).some(({ addr }) => addr === childAddress) - : false - - return { - chainId, - coreAddress: parentAddress, - coreVersion: parentVersion, - name, - imageUrl: image_url || getFallbackImage(parentAddress), - admin: parentAdmin ?? '', - registeredSubDao, - } - } - - // If address is the chain's x/gov module account... - } else if ( - get( - addressIsModuleSelector({ - chainId, - address: parentAddress, - moduleName: 'gov', - }) - ) - ) { - const chainConfig = getConfiguredChainConfig(chainId) - return ( - chainConfig && { - chainId, - coreAddress: chainConfig.name, - coreVersion: ContractVersion.Gov, - name: getDisplayNameForChainId(chainId), - imageUrl: getImageUrlForChainId(chainId), - admin: '', - registeredSubDao: - !!childAddress && - !!CHAIN_SUBDAOS[chainId]?.includes(childAddress), - } - ) - } - }, -}) - export const daoInfoFromPolytoneProxySelector = selectorFamily< | { chainId: string @@ -506,33 +598,6 @@ export const daoInfoFromPolytoneProxySelector = selectorFamily< }, }) -/** - * DAOs this DAO has enabled vetoable proposal listing for. - */ -export const daoVetoableDaosSelector = selectorFamily< - { chainId: string; coreAddress: string }[], - WithChainId<{ coreAddress: string }> ->({ - key: 'daoVetoableDaos', - get: - ({ chainId, coreAddress }) => - ({ get }) => - get( - DaoCoreV2Selectors.listAllItemsWithPrefixSelector({ - chainId, - contractAddress: coreAddress, - prefix: VETOABLE_DAOS_ITEM_KEY_PREFIX, - }) - ).map(([key]) => { - const [chainId, coreAdress] = key.split(':') - - return { - chainId, - coreAddress: coreAdress, - } - }), -}) - /** * Proposals which this DAO can currently veto. */ diff --git a/packages/stateful/recoil/selectors/dao/index.ts b/packages/stateful/recoil/selectors/dao/index.ts deleted file mode 100644 index 110300995..000000000 --- a/packages/stateful/recoil/selectors/dao/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './cards' -export * from './following' -export * from './misc' -export * from './proposal' diff --git a/packages/stateful/recoil/selectors/entity.ts b/packages/stateful/recoil/selectors/entity.ts index a9dd7b9c7..716efa7c5 100644 --- a/packages/stateful/recoil/selectors/entity.ts +++ b/packages/stateful/recoil/selectors/entity.ts @@ -11,6 +11,7 @@ import { isDaoSelector, isPolytoneProxySelector, moduleNameForAddressSelector, + profileSelector, } from '@dao-dao/state/recoil' import { Entity, EntityType, WithChainId } from '@dao-dao/types' import { @@ -22,7 +23,6 @@ import { } from '@dao-dao/utils' import { daoInfoFromPolytoneProxySelector, daoInfoSelector } from './dao' -import { profileSelector } from './profile' // Load entity from address on chain, whether it's a wallet address, a DAO, or a // DAO's polytone account. diff --git a/packages/stateful/recoil/selectors/index.ts b/packages/stateful/recoil/selectors/index.ts index c778aaf32..5c0012a46 100644 --- a/packages/stateful/recoil/selectors/index.ts +++ b/packages/stateful/recoil/selectors/index.ts @@ -1,9 +1,3 @@ export * from './dao' - export * from './entity' -export * from './nft' -export * from './profile' -export * from './token' -export * from './treasury' -export * from './vesting' -export * from './wallet' +export * from './proposal' diff --git a/packages/stateful/recoil/selectors/nft.ts b/packages/stateful/recoil/selectors/nft.ts deleted file mode 100644 index 16f83ad25..000000000 --- a/packages/stateful/recoil/selectors/nft.ts +++ /dev/null @@ -1,388 +0,0 @@ -import { selectorFamily, waitForNone } from 'recoil' - -import { - CommonNftSelectors, - DaoCoreV2Selectors, - genericTokenSelector, - nftUriDataSelector, - queryWalletIndexerSelector, - refreshWalletBalancesIdAtom, - stargazeIndexerClient, - stargazeTokenQuery, - walletStargazeNftCardInfosSelector, -} from '@dao-dao/state' -import { stakerForNftSelector } from '@dao-dao/state/recoil/selectors/contracts/DaoVotingCw721Staked' -import { ChainId, NftCardInfo, TokenType, WithChainId } from '@dao-dao/types' -import { LazyNftCardInfo, LoadingNfts } from '@dao-dao/types/nft' -import { - STARGAZE_URL_BASE, - getNftKey, - nftCardInfoFromStargazeIndexerNft, -} from '@dao-dao/utils' - -export const nftCardInfoWithUriSelector = selectorFamily< - NftCardInfo, - WithChainId<{ - collection: string - tokenId: string - tokenUri?: string | null | undefined - }> ->({ - key: 'nftCardInfo', - get: - ({ tokenId, collection, tokenUri, chainId }) => - async ({ get }) => { - const collectionInfo = get( - CommonNftSelectors.contractInfoSelector({ - contractAddress: collection, - chainId, - params: [], - }) - ) - - const metadata = - (tokenUri && get(nftUriDataSelector(tokenUri))) || undefined - const { name = '', description, imageUrl, externalLink } = metadata || {} - - const info: NftCardInfo = { - key: getNftKey(chainId, collection, tokenId), - collectionAddress: collection, - collectionName: collectionInfo.name, - tokenId, - externalLink: - externalLink || - (chainId === ChainId.StargazeMainnet || - chainId === ChainId.StargazeTestnet - ? { - href: `${STARGAZE_URL_BASE}/media/${collection}/${tokenId}`, - name: 'Stargaze', - } - : undefined), - // Default to tokenUri; this gets overwritten if tokenUri contains valid - // metadata and has an image. - imageUrl: imageUrl || tokenUri || undefined, - metadata, - name, - description, - chainId, - } - - return info - }, -}) - -export const nftCardInfoSelector = selectorFamily< - NftCardInfo, - WithChainId<{ tokenId: string; collection: string }> ->({ - key: 'nftCardInfo', - get: - ({ tokenId, collection, chainId }) => - async ({ get }) => { - // Use Stargaze indexer when possible. Fallback to contract query. - if ( - chainId === ChainId.StargazeMainnet || - chainId === ChainId.StargazeTestnet - ) { - let data - try { - data = ( - await stargazeIndexerClient.query({ - query: stargazeTokenQuery, - variables: { - collectionAddr: collection, - tokenId, - }, - }) - ).data - } catch (err) { - console.error(err) - } - - if (data?.token) { - const genericToken = data.token?.highestOffer?.offerPrice?.denom - ? get( - genericTokenSelector({ - chainId, - type: TokenType.Native, - denomOrAddress: data.token.highestOffer.offerPrice.denom, - }) - ) - : undefined - - return nftCardInfoFromStargazeIndexerNft( - chainId, - data.token, - genericToken - ) - } - } - - const tokenInfo = get( - CommonNftSelectors.nftInfoSelector({ - contractAddress: collection, - chainId, - params: [{ tokenId }], - }) - ) - - return get( - nftCardInfoWithUriSelector({ - tokenId, - collection, - tokenUri: tokenInfo.token_uri, - chainId, - }) - ) - }, -}) - -export const lazyNftCardInfosForDaoSelector = selectorFamily< - // Map chain ID to DAO-owned NFTs on that chain. - LoadingNfts, - WithChainId<{ - coreAddress: string - // If DAO is using the cw721-staking voting module adapter, it will have an - // NFT governance collection. If this is the case, passing it here makes - // sure we include the collection if it is not in the DAO's cw721 token - // list. - governanceCollectionAddress?: string - }> ->({ - key: 'lazyNftCardInfosForDao', - get: - ({ chainId, coreAddress, governanceCollectionAddress }) => - async ({ get }) => { - const allNfts = get( - DaoCoreV2Selectors.allCw721CollectionsSelector({ - contractAddress: coreAddress, - chainId, - governanceCollectionAddress, - }) - ) - - return Object.entries(allNfts).reduce( - (acc, [chainId, { owners, collectionAddresses }]) => { - collectionAddresses = Array.from(new Set(collectionAddresses)) - - // Get all token IDs owned by the DAO for each collection. - const nftCollectionTokenIds = get( - waitForNone( - collectionAddresses.flatMap((collectionAddress) => - owners.map((owner) => - CommonNftSelectors.unpaginatedAllTokensForOwnerSelector({ - contractAddress: collectionAddress, - chainId, - owner, - }) - ) - ) - ) - ) - - // Get all lazy info for each collection. - const lazyNftCardProps = collectionAddresses.flatMap( - (collectionAddress, index) => - nftCollectionTokenIds[index].state === 'hasValue' - ? (nftCollectionTokenIds[index].contents as string[]).map( - (tokenId): LazyNftCardInfo => ({ - key: getNftKey(chainId, collectionAddress, tokenId), - chainId, - tokenId, - collectionAddress, - type: 'collection', - }) - ) - : [] - ) - - return { - ...acc, - [chainId]: - nftCollectionTokenIds.length > 0 && - nftCollectionTokenIds.every( - (loadable) => loadable.state === 'loading' - ) - ? { - loading: true, - errored: false, - } - : { - loading: false, - errored: false, - updating: nftCollectionTokenIds.some( - (loadable) => loadable.state === 'loading' - ), - data: lazyNftCardProps, - }, - } - }, - {} as LoadingNfts - ) - }, -}) - -type CollectionWithTokens = { - collectionAddress: string - tokens: string[] -} - -// Retrieve all NFTs for a given wallet address using the indexer, but don't -// load the NFT info. -export const walletLazyNftCardInfosSelector = selectorFamily< - LoadingNfts, - WithChainId<{ - walletAddress: string - }> ->({ - key: 'walletLazyNftCardInfos', - get: - ({ walletAddress, chainId }) => - async ({ get }) => { - const id = get(refreshWalletBalancesIdAtom(walletAddress)) - // Use Stargaze's API if we're on the Stargaze chain. - if ( - chainId === ChainId.StargazeMainnet || - chainId === ChainId.StargazeTestnet - ) { - return { - [chainId]: { - loading: false, - errored: false, - data: get(walletStargazeNftCardInfosSelector(walletAddress)), - }, - } - } - - const collections: CollectionWithTokens[] = get( - queryWalletIndexerSelector({ - chainId, - walletAddress, - formula: 'nft/collections', - id, - noFallback: true, - }) - ) - if (!collections || !Array.isArray(collections)) { - return { - [chainId]: { - loading: false, - errored: false, - data: [], - }, - } - } - - // Get all lazy info for each collection. - const lazyNftCardInfos = collections.flatMap( - ({ collectionAddress, tokens }) => - tokens.map( - (tokenId): LazyNftCardInfo => ({ - key: getNftKey(chainId, collectionAddress, tokenId), - chainId, - tokenId, - collectionAddress, - type: 'collection', - }) - ) - ) - - return { - [chainId]: { - loading: false, - errored: false, - data: lazyNftCardInfos, - }, - } - }, -}) - -// Retrieve all NFTs a given wallet address has staked with a DAO (via -// dao-voting-cw721-staked) using the indexer. -export const walletStakedLazyNftCardInfosSelector = selectorFamily< - LazyNftCardInfo[], - WithChainId<{ - walletAddress: string - }> ->({ - key: 'walletStakedLazyNftCardInfos', - get: - ({ walletAddress, chainId }) => - async ({ get }) => { - const id = get(refreshWalletBalancesIdAtom(walletAddress)) - - const collections: CollectionWithTokens[] = get( - queryWalletIndexerSelector({ - chainId, - walletAddress, - formula: 'nft/stakedWithDaos', - id, - noFallback: true, - }) - ) - if (!collections || !Array.isArray(collections)) { - return [] - } - - // Get all lazy info for each collection. - const lazyNftCardInfos = collections.flatMap( - ({ collectionAddress, tokens }) => - tokens.map( - (tokenId): LazyNftCardInfo => ({ - key: getNftKey(chainId, collectionAddress, tokenId), - chainId, - tokenId, - collectionAddress, - type: 'collection', - }) - ) - ) - - return lazyNftCardInfos.map((info) => ({ - ...info, - staked: true, - })) - }, -}) - -// Get owner of NFT, or staker if NFT is staked with the given staking contract. -export const nftStakerOrOwnerSelector = selectorFamily< - { - staked: boolean - address: string - }, - WithChainId<{ - collectionAddress: string - tokenId: string - stakingContractAddress?: string - }> ->({ - key: 'nftStakerOrOwner', - get: - ({ collectionAddress, tokenId, stakingContractAddress, chainId }) => - async ({ get }) => { - const { owner } = get( - CommonNftSelectors.ownerOfSelector({ - contractAddress: collectionAddress, - params: [{ tokenId }], - chainId, - }) - ) - - const staker = - stakingContractAddress && owner === stakingContractAddress - ? get( - stakerForNftSelector({ - contractAddress: stakingContractAddress, - tokenId, - chainId, - }) - ) - : undefined - - return { - staked: staker !== undefined, - address: staker || owner, - } - }, -}) diff --git a/packages/stateful/recoil/selectors/profile.ts b/packages/stateful/recoil/selectors/profile.ts deleted file mode 100644 index 6c3a80b05..000000000 --- a/packages/stateful/recoil/selectors/profile.ts +++ /dev/null @@ -1,286 +0,0 @@ -import uniq from 'lodash.uniq' -import { noWait, selectorFamily, waitForAll } from 'recoil' - -import { - cosmWasmClientForChainSelector, - refreshWalletProfileAtom, -} from '@dao-dao/state/recoil' -import { - ChainId, - PfpkProfile, - UnifiedProfile, - WithChainId, -} from '@dao-dao/types' -import { - MAINNET, - PFPK_API_BASE, - STARGAZE_NAMES_CONTRACT, - getChainForChainId, - getFallbackImage, - objectMatchesStructure, - toBech32Hash, - transformBech32Address, -} from '@dao-dao/utils' - -import { nftCardInfoSelector } from './nft' - -export const EMPTY_PFPK_PROFILE: PfpkProfile = { - uuid: null, - // Disallows editing if we don't have correct nonce from server. - nonce: -1, - name: null, - nft: null, - chains: {}, -} - -export const makeEmptyUnifiedProfile = ( - chainId: string, - address: string -): UnifiedProfile => ({ - ...EMPTY_PFPK_PROFILE, - source: { - chainId, - address, - }, - nameSource: 'pfpk', - imageUrl: getFallbackImage(address), - backupImageUrl: getFallbackImage(address), -}) - -/** - * Get profile from PFPK given a wallet address on any chain. - */ -export const pfpkProfileSelector = selectorFamily({ - key: 'pfpkProfile', - get: - (walletAddress) => - ({ get }) => - get( - pfpkProfileForBech32HashSelector( - walletAddress && toBech32Hash(walletAddress) - ) - ), -}) - -/** - * Get profile from PFPK given a wallet address's bech32 hash. - */ -export const pfpkProfileForBech32HashSelector = selectorFamily< - PfpkProfile, - string ->({ - key: 'pfpkProfileForBech32Hash', - get: - (bech32Hash) => - async ({ get }) => { - if (!bech32Hash) { - return { ...EMPTY_PFPK_PROFILE } - } - - get(refreshWalletProfileAtom(bech32Hash)) - - try { - const response = await fetch(PFPK_API_BASE + `/bech32/${bech32Hash}`) - if (response.ok) { - const profile: PfpkProfile = await response.json() - - // If profile found, add refresher dependencies for the other chains - // in the profile. This ensures that the profile will update for all - // other chains when any of the other chains update the profile. - if (profile?.chains) { - get( - waitForAll( - uniq( - Object.values(profile.chains).map(({ address }) => - toBech32Hash(address) - ) - ).map((bech32Hash) => refreshWalletProfileAtom(bech32Hash)) - ) - ) - } - - return profile - } else { - console.error(await response.json().catch(() => response.statusText)) - } - } catch (err) { - console.error(err) - } - - return { ...EMPTY_PFPK_PROFILE } - }, -}) - -// Get name for address from Stargaze Names. -export const stargazeNameSelector = selectorFamily({ - key: 'stargazeName', - get: - (walletAddress) => - async ({ get }) => { - if (!walletAddress) { - return - } - - get(refreshWalletProfileAtom(walletAddress)) - - const client = get( - cosmWasmClientForChainSelector( - MAINNET ? ChainId.StargazeMainnet : ChainId.StargazeTestnet - ) - ) - - try { - return await client.queryContractSmart(STARGAZE_NAMES_CONTRACT, { - name: { address: walletAddress }, - }) - } catch {} - }, -}) - -// Get image for address from Stargaze Names. -export const stargazeNameImageForAddressSelector = selectorFamily< - string | undefined, - string ->({ - key: 'stargazeNameImageForAddress', - get: - (walletAddress) => - async ({ get }) => { - // Get name associated with address. - const name = get(stargazeNameSelector(walletAddress)) - if (!name) { - return - } - - const chainId = MAINNET - ? ChainId.StargazeMainnet - : ChainId.StargazeTestnet - const client = get(cosmWasmClientForChainSelector(chainId)) - - // Get NFT associated with name. - let response - try { - response = await client.queryContractSmart(STARGAZE_NAMES_CONTRACT, { - image_n_f_t: { name }, - }) - } catch { - return - } - - // If NFT exists, get image associated with NFT. - if ( - objectMatchesStructure(response, { - collection: {}, - token_id: {}, - }) - ) { - const { imageUrl } = get( - nftCardInfoSelector({ - chainId, - collection: response.collection, - tokenId: response.token_id, - }) - ) - - return imageUrl - } - }, -}) - -export const profileSelector = selectorFamily< - UnifiedProfile, - WithChainId<{ address: string }> ->({ - key: 'profile', - get: - ({ address, chainId }) => - ({ get }) => { - const profile = makeEmptyUnifiedProfile(chainId, address) - if (!address) { - return profile - } - - get(refreshWalletProfileAtom(toBech32Hash(address))) - - const pfpkProfile = get(pfpkProfileSelector(address)) - if (pfpkProfile) { - profile.uuid = pfpkProfile.uuid - profile.nonce = pfpkProfile.nonce - profile.name = pfpkProfile.name - profile.nft = pfpkProfile.nft - profile.chains = pfpkProfile.chains - } - - // Load Stargaze name as backup if no PFPK name set. - if (!profile.name) { - const stargazeNameLoadable = get( - noWait( - stargazeNameSelector( - // Use profile address for Stargaze if set, falling back to - // transforming the address (which is unreliable due to different - // chains using different HD paths). - profile.chains[ChainId.StargazeMainnet]?.address || - transformBech32Address(address, ChainId.StargazeMainnet) - ) - ) - ) - if ( - stargazeNameLoadable.state === 'hasValue' && - stargazeNameLoadable.contents - ) { - profile.name = - stargazeNameLoadable.contents + - '.' + - getChainForChainId(chainId).bech32_prefix - profile.nameSource = 'stargaze' - } - } - - // Set `imageUrl` to PFPK image, defaulting to fallback image. - profile.imageUrl = pfpkProfile?.nft?.imageUrl || profile.backupImageUrl - - // If NFT present from PFPK, get image from token once loaded. - if (pfpkProfile?.nft) { - // Don't wait for NFT info to load. When it loads, it will update. - const nftInfoLoadable = get( - noWait( - nftCardInfoSelector({ - collection: pfpkProfile.nft.collectionAddress, - tokenId: pfpkProfile.nft.tokenId, - chainId: pfpkProfile.nft.chainId, - }) - ) - ) - - // Set `imageUrl` if defined, overriding PFPK image and backup. - if ( - nftInfoLoadable.state === 'hasValue' && - nftInfoLoadable.contents?.imageUrl - ) { - profile.imageUrl = nftInfoLoadable.contents.imageUrl - } - - // Load Stargaze name image if no PFPK image. - } else if (profile.nameSource === 'stargaze') { - const stargazeNameImageLoadable = get( - noWait( - stargazeNameImageForAddressSelector( - // Use profile address for Stargaze if set, falling back to - // transforming the address (which is unreliable due to different - // chains using different HD paths). - profile.chains[ChainId.StargazeMainnet]?.address || - transformBech32Address(address, ChainId.StargazeMainnet) - ) - ) - ) - if ( - stargazeNameImageLoadable.state === 'hasValue' && - stargazeNameImageLoadable.contents - ) { - profile.imageUrl = stargazeNameImageLoadable.contents - } - } - - return profile - }, -}) diff --git a/packages/stateful/recoil/selectors/dao/proposal.ts b/packages/stateful/recoil/selectors/proposal.ts similarity index 98% rename from packages/stateful/recoil/selectors/dao/proposal.ts rename to packages/stateful/recoil/selectors/proposal.ts index 9fe3cd7ce..cf168602c 100644 --- a/packages/stateful/recoil/selectors/dao/proposal.ts +++ b/packages/stateful/recoil/selectors/proposal.ts @@ -6,7 +6,7 @@ import { } from '@dao-dao/state' import { NeutronTimelockOverrule, WithChainId } from '@dao-dao/types' -import { daoCoreProposalModulesSelector } from './misc' +import { daoCoreProposalModulesSelector } from './dao' /** * For the Neutron fork, retrieve the associated overrule proposal created in diff --git a/packages/stateful/recoil/selectors/token.ts b/packages/stateful/recoil/selectors/token.ts deleted file mode 100644 index 3936ffa5b..000000000 --- a/packages/stateful/recoil/selectors/token.ts +++ /dev/null @@ -1,302 +0,0 @@ -import { selectorFamily, waitForAll, waitForAllSettled } from 'recoil' - -import { - Cw20BaseSelectors, - Cw20StakeSelectors, - DaoCoreV2Selectors, - DaoVotingNativeStakedSelectors, - nativeDelegationInfoSelector, - nativeUnstakingDurationSecondsSelector, - queryGenericIndexerSelector, - usdPriceSelector, -} from '@dao-dao/state' -import { - GenericToken, - TokenCardLazyInfo, - TokenType, - UnstakingTaskStatus, - WithChainId, -} from '@dao-dao/types' -import { - convertMicroDenomToDenomWithDecimals, - getNativeTokenForChainId, -} from '@dao-dao/utils' - -export const tokenCardLazyInfoSelector = selectorFamily< - TokenCardLazyInfo, - { - owner: string - token: GenericToken - // For calculating totalBalance. - unstakedBalance: number - } ->({ - key: 'tokenCardLazyInfo', - get: - ({ owner, token, unstakedBalance }) => - ({ get }) => { - const { chainId, type } = token - - let stakingInfo: TokenCardLazyInfo['stakingInfo'] = undefined - let daosGoverned: TokenCardLazyInfo['daosGoverned'] = undefined - - const usdUnitPrice = get( - usdPriceSelector({ - type, - chainId, - denomOrAddress: token.denomOrAddress, - }) - ) - - // Staking info only exists for native token. - if ( - token.denomOrAddress === - getNativeTokenForChainId(chainId).denomOrAddress - ) { - // Neutron does not have staking so this may error. Ignore if so. - const nativeDelegationInfoLoadable = get( - waitForAllSettled([ - nativeDelegationInfoSelector({ - address: owner, - chainId, - }), - ]) - )[0] - const nativeDelegationInfo = - nativeDelegationInfoLoadable.state === 'hasValue' - ? nativeDelegationInfoLoadable.contents - : undefined - - if (nativeDelegationInfo) { - const unstakingDurationSeconds = get( - nativeUnstakingDurationSecondsSelector({ - chainId, - }) - ) - - const unstakingTasks = nativeDelegationInfo.unbondingDelegations.map( - ({ balance, finishesAt }) => ({ - token, - status: UnstakingTaskStatus.Unstaking, - amount: convertMicroDenomToDenomWithDecimals( - balance.amount, - token.decimals - ), - date: finishesAt, - }) - ) - - const stakes = nativeDelegationInfo.delegations.map( - ({ validator, delegated, pendingReward }) => ({ - token, - validator, - amount: convertMicroDenomToDenomWithDecimals( - delegated.amount, - token.decimals - ), - rewards: convertMicroDenomToDenomWithDecimals( - pendingReward.amount, - token.decimals - ), - }) - ) - - const totalStaked = - stakes.reduce((acc, stake) => acc + stake.amount, 0) ?? 0 - const totalPendingRewards = - stakes?.reduce((acc, stake) => acc + stake.rewards, 0) ?? 0 - const totalUnstaking = - unstakingTasks.reduce( - (acc, task) => - acc + - // Only include balance of unstaking tasks. - (task.status === UnstakingTaskStatus.Unstaking - ? task.amount - : 0), - 0 - ) ?? 0 - - stakingInfo = { - unstakingTasks, - unstakingDurationSeconds, - stakes, - totalStaked, - totalPendingRewards, - totalUnstaking, - } - } - } - - if (owner) { - daosGoverned = get( - tokenDaosWithStakedBalanceSelector({ - chainId, - type: token.type, - denomOrAddress: token.denomOrAddress, - walletAddress: owner, - }) - ) - // Only include DAOs this owner has staked with. - .filter(({ stakedBalance }) => stakedBalance > 0) - .map(({ stakedBalance, ...rest }) => ({ - ...rest, - // Convert to expected denom. - stakedBalance: convertMicroDenomToDenomWithDecimals( - stakedBalance, - token.decimals - ), - })) - } - - const totalBalance = - unstakedBalance + - // Add staked and unstaking balances. - (stakingInfo - ? stakingInfo.totalStaked + stakingInfo.totalUnstaking - : 0) + - // Add balances staked in DAOs, grouped by their - // `stakingContractAddress` so we don't double-count tokens staked with - // the same staking contract if that staking contract is used in - // different DAOs in the list. - Object.values( - daosGoverned?.reduce( - (acc, { stakingContractAddress, stakedBalance = 0 }) => ({ - ...acc, - // If the staking contract address is already in the accumulator, - // overwrite so we don't double-count. All staked balances for the - // same staking contract should be the same, so overwriting should - // do nothing. - [stakingContractAddress]: stakedBalance, - }), - {} as Record - ) || {} - ).reduce((acc, stakedBalance) => acc + stakedBalance, 0) - - return { - usdUnitPrice, - stakingInfo, - totalBalance, - daosGoverned, - } - }, -}) - -// Get DAOs that use this native token as their governance token from the -// indexer, and load their dao-voting-native-staked contracts. -export const daosWithNativeVotingContractSelector = selectorFamily< - { - coreAddress: string - votingModuleAddress: string - }[], - WithChainId<{ - denom: string - }> ->({ - key: 'daosWithNativeVotingContract', - get: - ({ denom, chainId }) => - ({ get }) => { - const daos: string[] = - get( - queryGenericIndexerSelector({ - chainId, - formula: 'token/daos', - args: { - denom, - }, - noFallback: true, - }) - ) ?? [] - const votingModuleAddresses = get( - waitForAll( - daos.map((contractAddress) => - DaoCoreV2Selectors.votingModuleSelector({ - contractAddress, - chainId, - params: [], - }) - ) - ) - ) - - return daos.map((coreAddress, index) => ({ - coreAddress, - votingModuleAddress: votingModuleAddresses[index], - })) - }, -}) - -// Returns a list of DAOs that use the given cw20 token as their governance -// token with the staked balance of the given wallet address for each. -export const tokenDaosWithStakedBalanceSelector = selectorFamily< - { - coreAddress: string - stakingContractAddress: string - stakedBalance: number - }[], - WithChainId<{ - type: TokenType - denomOrAddress: string - walletAddress: string - }> ->({ - key: 'tokenDaosWithStakedBalance', - get: - ({ type, denomOrAddress, walletAddress, chainId }) => - ({ get }) => { - const daos = - type === TokenType.Cw20 - ? get( - Cw20BaseSelectors.daosWithVotingAndStakingContractSelector({ - contractAddress: denomOrAddress, - chainId, - }) - ) - : get( - daosWithNativeVotingContractSelector({ - denom: denomOrAddress, - chainId, - }) - ).map((daoWithContracts) => ({ - ...daoWithContracts, - stakingContractAddress: daoWithContracts.votingModuleAddress, - })) - - const daosWalletStakedTokens = get( - waitForAll( - daos.map(({ stakingContractAddress }) => - type === TokenType.Cw20 - ? Cw20StakeSelectors.stakedValueSelector({ - contractAddress: stakingContractAddress, - chainId, - params: [ - { - address: walletAddress, - }, - ], - }) - : DaoVotingNativeStakedSelectors.votingPowerAtHeightSelector({ - contractAddress: stakingContractAddress, - chainId, - params: [ - { - address: walletAddress, - }, - ], - }) - ) - ) - ).map((staked) => ('value' in staked ? staked.value : staked.power)) - - const daosWithBalances = daos - .map(({ coreAddress, stakingContractAddress }, index) => ({ - coreAddress, - stakingContractAddress, - stakedBalance: Number(daosWalletStakedTokens[index]), - })) - // Sort descending by staked tokens. - .sort((a, b) => b.stakedBalance - a.stakedBalance) - - return daosWithBalances - }, -}) diff --git a/packages/stateful/recoil/selectors/treasury.ts b/packages/stateful/recoil/selectors/treasury.ts deleted file mode 100644 index bac7c02e8..000000000 --- a/packages/stateful/recoil/selectors/treasury.ts +++ /dev/null @@ -1,310 +0,0 @@ -import uniq from 'lodash.uniq' -import { noWait, selectorFamily, waitForAll, waitForNone } from 'recoil' - -import { - accountsSelector, - genericTokenBalancesSelector, - genericTokenSelector, - nativeDelegatedBalanceSelector, - querySnapperSelector, -} from '@dao-dao/state' -import { - Account, - AccountType, - GenericToken, - GenericTokenSource, - LoadingTokens, - TokenCardInfo, - TokenPriceHistoryRange, - TokenType, - WithChainId, -} from '@dao-dao/types' -import { - COMMUNITY_POOL_ADDRESS_PLACEHOLDER, - convertMicroDenomToDenomWithDecimals, - getNativeTokenForChainId, - loadableToLoadingData, -} from '@dao-dao/utils' - -import { tokenCardLazyInfoSelector } from './token' - -// lazyInfo must be loaded in the component separately, since it refreshes on a -// timer and we don't want this whole selector to reevaluate and load when that -// refreshes. Use `tokenCardLazyInfoSelector`. -export const treasuryTokenCardInfosForDaoSelector = selectorFamily< - // Map chain ID to DAO-owned tokens on that chain. - LoadingTokens, - WithChainId<{ - coreAddress: string - cw20GovernanceTokenAddress?: string - nativeGovernanceTokenDenom?: string - }> ->({ - key: 'treasuryTokenCardInfosForDao', - get: - ({ - chainId: nativeChainId, - coreAddress, - cw20GovernanceTokenAddress, - nativeGovernanceTokenDenom, - }) => - ({ get }) => { - const allAccounts = get( - accountsSelector({ - chainId: nativeChainId, - address: coreAddress, - }) - ) - - const uniqueChainIds = uniq(allAccounts.map((account) => account.chainId)) - - return uniqueChainIds.reduce((acc, chainId) => { - const accounts = allAccounts.filter( - (account) => account.chainId === chainId - ) - - const accountBalancesLoadables = get( - waitForNone( - accounts.map(({ chainId, address }) => - genericTokenBalancesSelector({ - chainId: nativeChainId, - address: coreAddress, - nativeGovernanceTokenDenom: - chainId === nativeChainId - ? nativeGovernanceTokenDenom - : undefined, - cw20GovernanceTokenAddress: - chainId === nativeChainId - ? cw20GovernanceTokenAddress - : undefined, - filter: { - account: { - chainId, - address, - }, - }, - }) - ) - ) - ) - const accountBalances = accountBalancesLoadables.flatMap( - (loadable, index) => - loadable.state === 'hasValue' - ? { - account: accounts[index], - balances: loadable.contents, - } - : [] - ) - - // Updating if any loadables are still loading. If none are loading but - // a native token is still waiting for staking info, this is updated - // below. - let updating = accountBalancesLoadables.some( - (loadable) => loadable.state === 'loading' - ) - - // Get token card infos for loaded tokens. - const infos = accountBalances.flatMap(({ account, balances }) => - balances.flatMap( - ({ - token, - balance, - isGovernanceToken = false, - }): TokenCardInfo | [] => { - const unstakedBalance = convertMicroDenomToDenomWithDecimals( - balance, - token.decimals - ) - - let hasStakingInfo = false - // Staking info only exists for native token. - if ( - token.type === TokenType.Native && - token.denomOrAddress === - getNativeTokenForChainId(chainId).denomOrAddress - ) { - // Check if anything staked. - const stakedBalance = get( - noWait( - nativeDelegatedBalanceSelector({ - chainId, - address: account.address, - }) - ) - ) - - // Ignore this token until staking info loads. - if (stakedBalance.state === 'loading') { - // Make sure updating is true if waiting on staking info. - updating = true - - return [] - } - - hasStakingInfo = - stakedBalance.state === 'hasValue' && - stakedBalance.contents.amount !== '0' - } - - const lazyInfo = get( - noWait( - tokenCardLazyInfoSelector({ - owner: account.address, - token, - unstakedBalance, - }) - ) - ) - - return { - owner: account, - token, - isGovernanceToken, - unstakedBalance, - hasStakingInfo, - lazyInfo: loadableToLoadingData(lazyInfo, { - usdUnitPrice: undefined, - stakingInfo: undefined, - totalBalance: unstakedBalance, - }), - } - } - ) - ) - - return { - ...acc, - [chainId]: - accounts.length > 0 && - accountBalancesLoadables.every( - (loadable) => loadable.state === 'loading' - ) - ? { - loading: true, - errored: false, - } - : { - loading: false, - errored: false, - updating, - data: infos, - }, - } - }, {} as LoadingTokens) - }, -}) - -const ACCOUNT_FILTER_PROPERTIES = ['type', 'chainId', 'address'] as const - -export const treasuryValueHistorySelector = selectorFamily< - { - timestamps: Date[] - tokens: { - token: GenericToken - // Value at each timestamp. - values: (number | null)[] - }[] - // Total value at each timestamp. - totals: (number | null)[] - }, - WithChainId<{ - address: string - range: TokenPriceHistoryRange - filter?: { - // Filter by any of the account properties. - account?: Partial> - // If defined, only show these tokens. - tokens?: GenericTokenSource[] - } - }> ->({ - key: 'treasuryValueHistory', - get: - ({ chainId: nativeChainId, address, range, filter }) => - ({ get }) => { - const isCommunityPool = address === COMMUNITY_POOL_ADDRESS_PLACEHOLDER - - let allAccounts: Account[] = isCommunityPool - ? [ - { - type: AccountType.Native, - chainId: nativeChainId, - address, - }, - ] - : get( - accountsSelector({ - chainId: nativeChainId, - address, - }) - ) - - // Filter by account fields. - if (filter?.account) { - allAccounts = allAccounts.filter((account) => - ACCOUNT_FILTER_PROPERTIES.every( - (key) => - !filter.account || - !(key in filter.account) || - account[key] === filter.account[key] - ) - ) - } - - // Value history for all accounts. - const { timestamps, assets, totals } = get( - querySnapperSelector({ - query: 'daodao-many-value-history', - parameters: { - accounts: allAccounts.map( - ({ chainId, address }) => `${chainId}:${address}` - ), - range, - tokenFilter: filter?.tokens - ?.map( - ({ chainId, denomOrAddress }) => `${chainId}:${denomOrAddress}` - ) - .join(','), - }, - }) - ) as { - timestamps: number[] - assets: { - origin: { - chainId: string - denom: string - } - // Value at each timestamp. - values: (number | null)[] - }[] - // Total value at each timestamp. - totals: (number | null)[] - } - - const tokens = get( - waitForAll( - assets.map(({ origin: { chainId, denom } }) => - genericTokenSelector({ - type: denom.startsWith('cw20:') - ? TokenType.Cw20 - : TokenType.Native, - chainId, - denomOrAddress: denom.startsWith('cw20:') - ? denom.slice(5) - : denom, - }) - ) - ) - ) - - return { - timestamps: timestamps.map((timestamp) => new Date(timestamp)), - tokens: assets.map(({ values }, index) => ({ - token: tokens[index], - values: values.map((value) => value ?? null), - })), - totals, - } - }, -}) diff --git a/packages/stateful/recoil/selectors/wallet.ts b/packages/stateful/recoil/selectors/wallet.ts deleted file mode 100644 index 80467f910..000000000 --- a/packages/stateful/recoil/selectors/wallet.ts +++ /dev/null @@ -1,452 +0,0 @@ -import { - Loadable, - atomFamily, - noWait, - selectorFamily, - waitForAll, - waitForAny, -} from 'recoil' - -import { - accountsSelector, - genericTokenSelector, - nativeBalancesSelector, - nativeDelegatedBalanceSelector, - queryWalletIndexerSelector, - refreshHiddenBalancesAtom, - refreshSavedTxsAtom, - refreshWalletBalancesIdAtom, -} from '@dao-dao/state/recoil' -import { - AccountTxSave, - AccountType, - ContractVersion, - ContractVersionInfo, - LazyDaoCardProps, - LazyNftCardInfo, - TokenCardInfo, - TokenType, - WithChainId, -} from '@dao-dao/types' -import { Config } from '@dao-dao/types/contracts/DaoCore.v2' -import { - HIDDEN_BALANCE_PREFIX, - INACTIVE_DAO_NAMES, - KVPK_API_BASE, - ME_SAVED_TX_PREFIX, - convertMicroDenomToDenomWithDecimals, - getFallbackImage, - getNativeTokenForChainId, - loadableToLoadingData, - parseContractVersion, -} from '@dao-dao/utils' - -import { lazyDaoCardPropsSelector } from './dao' -import { followingDaosSelector } from './dao/following' -import { - walletLazyNftCardInfosSelector, - walletStakedLazyNftCardInfosSelector, -} from './nft' -import { tokenCardLazyInfoSelector } from './token' - -// This doesn't update right away due to Cloudflare KV Store latency, so this -// serves to keep track of all successful updates for the current session. This -// will be reset on page refresh. Set this right away so the UI can update -// immediately even if the API takes up to a minute or two. Though likely it -// only takes 10 seconds or so. -// -// Takes wallet public key as a parameter. -export const temporarySavedTxsAtom = atomFamily< - Record, - string ->({ - key: 'temporarySavedTxs', - default: {}, -}) - -// Takes wallet public key as a parameter. -export const savedTxsSelector = selectorFamily({ - key: 'savedTxs', - get: - (walletPublicKey) => - async ({ get }) => { - get(refreshSavedTxsAtom) - - const temporary = get(temporarySavedTxsAtom(walletPublicKey)) - - const response = await fetch( - KVPK_API_BASE + `/list/${walletPublicKey}/${ME_SAVED_TX_PREFIX}` - ) - - if (response.ok) { - const { items } = (await response.json()) as { - items: { - key: string - value: AccountTxSave - }[] - } - - const savedItems = Object.entries(temporary) - // Add any items that are in the KV store but not in the temporary map. - items.forEach(({ key, value }) => { - if (!(key in temporary)) { - savedItems.push([key, value]) - } - }) - - const saves = savedItems - .map(([, value]) => value) - // If the save is null, it came from the temporary map and means it - // was deleted, so we need to remove it from the list. - .filter((save): save is AccountTxSave => !!save) - .sort((a, b) => a.name.localeCompare(b.name)) - - return saves - } else { - throw new Error( - `Failed to fetch tx saves: ${response.status}/${ - response.statusText - } ${await response.text().catch(() => '')}`.trim() - ) - } - }, -}) - -// This doesn't update right away due to Cloudflare KV Store latency, so this -// serves to keep track of all successful updates for the current session. This -// will be reset on page refresh. Set this right away so the UI can update -// immediately even if the API takes up to a minute or two. Though likely it -// only takes 10 seconds or so. -// -// Takes wallet public key as a parameter. -export const temporaryHiddenBalancesAtom = atomFamily< - Record, - string ->({ - key: 'temporaryHiddenBalances', - default: {}, -}) - -// Takes wallet public key as a parameter. Return list of token denomOrAddress -// fields that are hidden. -export const hiddenBalancesSelector = selectorFamily({ - key: 'hiddenBalances', - get: - (walletPublicKey) => - async ({ get }) => { - get(refreshHiddenBalancesAtom) - - const temporary = get(temporaryHiddenBalancesAtom(walletPublicKey)) - - const response = await fetch( - KVPK_API_BASE + `/list/${walletPublicKey}/${HIDDEN_BALANCE_PREFIX}` - ) - - if (response.ok) { - const { items } = (await response.json()) as { - items: { - key: string - value: number | null - }[] - } - - const hiddenBalances = Object.entries(temporary) - // Add any items that are in the KV store but not in the temporary map. - items.forEach(({ key, value }) => { - if (!(key in temporary)) { - hiddenBalances.push([key, value]) - } - }) - - const hidden = hiddenBalances - .filter(([, value]) => value !== null) - // Remove prefix so it's just the token's denomOrAddress. - .map(([key]) => key.replace(HIDDEN_BALANCE_PREFIX, '')) - - return hidden - } else { - throw new Error( - `Failed to fetch hidden balances: ${response.status}/${ - response.statusText - } ${await response.text().catch(() => '')}`.trim() - ) - } - }, -}) - -type ContractWithBalance = { - contractAddress: string - balance: string | undefined -} - -// lazyInfo must be loaded in the component separately, since it refreshes on a -// timer and we don't want this whole selector to reevaluate and load when that -// refreshes. Use `tokenCardLazyInfoSelector`. -export const walletTokenCardInfosSelector = selectorFamily< - TokenCardInfo[], - WithChainId<{ - walletAddress: string - }> ->({ - key: 'walletTokenCardInfos', - get: - ({ walletAddress, chainId }) => - ({ get }) => { - const id = get(refreshWalletBalancesIdAtom(walletAddress)) - - const allAccounts = get( - accountsSelector({ - chainId, - address: walletAddress, - }) - ) - - const nativeBalances = get( - waitForAll( - allAccounts.map(({ chainId, address }) => - nativeBalancesSelector({ - address, - chainId, - }) - ) - ) - ) - const cw20ContractsLoadable: Loadable = - get( - noWait( - queryWalletIndexerSelector({ - chainId, - walletAddress, - formula: 'tokens/list', - id, - noFallback: true, - }) - ) - ) - const cw20Contracts = - cw20ContractsLoadable.state === 'hasValue' - ? cw20ContractsLoadable.contents ?? [] - : [] - const cw20s = get( - noWait( - waitForAny( - cw20Contracts.map((c) => - genericTokenSelector({ - type: TokenType.Cw20, - denomOrAddress: c.contractAddress, - chainId, - }) - ) - ) - ) - ) - - const infos: TokenCardInfo[] = [ - ...nativeBalances.flatMap((accountBalances, accountIndex) => - accountBalances.map(({ token, balance }) => { - const unstakedBalance = convertMicroDenomToDenomWithDecimals( - balance, - token.decimals - ) - - // Staking info only exists for native token. - const hasStakingInfo = - token.denomOrAddress === - getNativeTokenForChainId(chainId).denomOrAddress && - // Check if anything staked. - Number( - get( - nativeDelegatedBalanceSelector({ - address: walletAddress, - chainId, - }) - ).amount - ) > 0 - - const owner = allAccounts[accountIndex] - - const lazyInfo = get( - noWait( - tokenCardLazyInfoSelector({ - owner: owner.address, - token, - unstakedBalance, - }) - ) - ) - - const info: TokenCardInfo = { - owner, - token, - isGovernanceToken: false, - unstakedBalance, - hasStakingInfo, - lazyInfo: loadableToLoadingData(lazyInfo, { - usdUnitPrice: undefined, - stakingInfo: undefined, - totalBalance: unstakedBalance, - }), - } - - return info - }) - ), - ...(cw20s.valueMaybe() || []).flatMap((tokenLoadable, index) => { - const token = tokenLoadable.valueMaybe() - if (!token) { - return [] - } - - const unstakedBalance = convertMicroDenomToDenomWithDecimals( - cw20Contracts[index].balance || '0', - token.decimals - ) - - const lazyInfo = get( - noWait( - tokenCardLazyInfoSelector({ - owner: walletAddress, - token, - unstakedBalance, - }) - ) - ) - - const info: TokenCardInfo = { - owner: { - type: AccountType.Native, - chainId, - address: walletAddress, - }, - token, - isGovernanceToken: false, - unstakedBalance, - // No unstaking info for CW20. - hasStakingInfo: false, - lazyInfo: loadableToLoadingData(lazyInfo, { - usdUnitPrice: undefined, - stakingInfo: undefined, - totalBalance: unstakedBalance, - }), - } - - return info - }), - ] - - return infos - }, -}) - -// Get NFTs for a wallet on many chains. -export const allWalletNftsSelector = selectorFamily< - LazyNftCardInfo[], - { - chainId: string - walletAddress: string - }[] ->({ - key: 'allWalletNfts', - get: - (chainWallets) => - ({ get }) => { - const nativeNfts = get( - waitForAll( - chainWallets.map(({ chainId, walletAddress }) => - walletLazyNftCardInfosSelector({ - chainId, - walletAddress, - }) - ) - ) - ).reduce( - (acc, nftCardInfos) => [ - ...acc, - ...Object.values(nftCardInfos).flatMap((data) => - !data || data.loading || data.errored ? [] : data.data - ), - ], - [] as LazyNftCardInfo[] - ) - - const nativeStakedNfts = get( - waitForAll( - chainWallets.map(({ chainId, walletAddress }) => - walletStakedLazyNftCardInfosSelector({ - chainId, - walletAddress, - }) - ) - ) - ).flat() - - return [...nativeNfts, ...nativeStakedNfts] - }, -}) - -// Get lazy card info for DAOs this wallet is a member of. -export const lazyWalletDaosSelector = selectorFamily< - LazyDaoCardProps[], - WithChainId<{ address: string }> ->({ - key: 'lazyWalletDaos', - get: - ({ chainId, address }) => - ({ get }) => { - const daos: { - dao: string - info: ContractVersionInfo - config: Config - proposalCount: number - }[] = get( - queryWalletIndexerSelector({ - chainId, - walletAddress: address, - formula: 'daos/memberOf', - noFallback: true, - }) - ) - if (!daos || !Array.isArray(daos)) { - return [] - } - - const lazyDaoCards = daos.map( - ({ dao, info, config, proposalCount }): LazyDaoCardProps => ({ - chainId, - coreAddress: dao, - coreVersion: - parseContractVersion(info.version) || ContractVersion.Unknown, - name: config.name, - description: config.description, - imageUrl: config.image_url || getFallbackImage(dao), - isInactive: - INACTIVE_DAO_NAMES.includes(config.name) || proposalCount === 0, - }) - ) - - return lazyDaoCards - }, -}) - -// Get lazy card info for DAOs this wallet is following. -export const lazyWalletFollowingDaosSelector = selectorFamily< - LazyDaoCardProps[], - { walletPublicKey: string } ->({ - key: 'lazyWalletFollowingDaos', - get: - ({ walletPublicKey }) => - ({ get }) => { - const daos = get( - followingDaosSelector({ - walletPublicKey, - }) - ) - - return daos.length > 0 - ? get( - waitForAny(daos.map((dao) => lazyDaoCardPropsSelector(dao))) - ).flatMap((loadable) => loadable.valueMaybe() || []) - : [] - }, -}) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/hooks/useStakingInfo.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/hooks/useStakingInfo.ts index 6d7f91727..79dab9ccc 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/hooks/useStakingInfo.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/hooks/useStakingInfo.ts @@ -11,6 +11,7 @@ import { DaoVotingCw721StakedSelectors, blockHeightSelector, contractVersionSelector, + nftCardInfoSelector, refreshClaimsIdAtom, refreshWalletBalancesIdAtom, } from '@dao-dao/state' @@ -23,7 +24,6 @@ import { NftClaim } from '@dao-dao/types/contracts/DaoVotingCw721Staked' import { claimAvailable } from '@dao-dao/utils' import { useWallet } from '../../../../hooks/useWallet' -import { nftCardInfoSelector } from '../../../../recoil/selectors/nft' import { useVotingModuleAdapterOptions } from '../../../react/context' import { UseStakingInfoOptions, UseStakingInfoResponse } from '../types' import { useGovernanceCollectionInfo } from './useGovernanceCollectionInfo' diff --git a/packages/stateful/widgets/widgets/MintNft/MintNftRenderer.tsx b/packages/stateful/widgets/widgets/MintNft/MintNftRenderer.tsx index aeae8b2d4..6229e613d 100644 --- a/packages/stateful/widgets/widgets/MintNft/MintNftRenderer.tsx +++ b/packages/stateful/widgets/widgets/MintNft/MintNftRenderer.tsx @@ -3,7 +3,7 @@ import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' import { waitForAll } from 'recoil' -import { CommonNftSelectors } from '@dao-dao/state/recoil' +import { CommonNftSelectors, nftCardInfoSelector } from '@dao-dao/state/recoil' import { Button, HorizontalScroller, @@ -18,7 +18,6 @@ import { WidgetRendererProps } from '@dao-dao/types' import { CHAIN_GAS_MULTIPLIER, processError } from '@dao-dao/utils' import { useWallet } from '../../../hooks/useWallet' -import { nftCardInfoSelector } from '../../../recoil' import { MintNftData } from './types' export const MintNftRenderer = ({ diff --git a/packages/stateful/widgets/widgets/VestingPayments/Renderer/TabRenderer/index.tsx b/packages/stateful/widgets/widgets/VestingPayments/Renderer/TabRenderer/index.tsx index 84442abaf..ec5cc3b16 100644 --- a/packages/stateful/widgets/widgets/VestingPayments/Renderer/TabRenderer/index.tsx +++ b/packages/stateful/widgets/widgets/VestingPayments/Renderer/TabRenderer/index.tsx @@ -1,7 +1,10 @@ import { useEffect } from 'react' import { useSetRecoilState, waitForAll } from 'recoil' -import { refreshVestingAtom } from '@dao-dao/state/recoil' +import { + refreshVestingAtom, + vestingInfosForFactorySelector, +} from '@dao-dao/state/recoil' import { useCachedLoadingWithError, useChain, @@ -23,7 +26,6 @@ import { VestingPaymentCard, } from '../../../../../components' import { useMembership } from '../../../../../hooks/useMembership' -import { vestingInfosForFactorySelector } from '../../../../../recoil' import { TabRenderer as StatelessTabRenderer } from './TabRenderer' export const TabRenderer = ({ diff --git a/packages/utils/index.ts b/packages/utils/index.ts index 1d25691c8..3e5ed417d 100644 --- a/packages/utils/index.ts +++ b/packages/utils/index.ts @@ -28,6 +28,7 @@ export * from './nft' export * from './network' export * from './objectMatchesStructure' export * from './pagination' +export * from './profile' export * from './proposal' export * from './string' export * from './time' diff --git a/packages/utils/profile.ts b/packages/utils/profile.ts new file mode 100644 index 000000000..20d279486 --- /dev/null +++ b/packages/utils/profile.ts @@ -0,0 +1,26 @@ +import { PfpkProfile, UnifiedProfile } from '@dao-dao/types' + +import { getFallbackImage } from './getFallbackImage' + +export const EMPTY_PFPK_PROFILE: PfpkProfile = { + uuid: null, + // Disallows editing if we don't have correct nonce from server. + nonce: -1, + name: null, + nft: null, + chains: {}, +} + +export const makeEmptyUnifiedProfile = ( + chainId: string, + address: string +): UnifiedProfile => ({ + ...EMPTY_PFPK_PROFILE, + source: { + chainId, + address, + }, + nameSource: 'pfpk', + imageUrl: getFallbackImage(address), + backupImageUrl: getFallbackImage(address), +}) From 9daceba375c58f0162bf315e55d0a5172bfbcef1 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 28 May 2024 12:18:06 -0400 Subject: [PATCH 194/438] added voting config item to creation UI to change only_members_execute --- packages/i18n/locales/en/translation.json | 2 + ...roposalExecutionPolicyVotingConfigItem.tsx | 51 +++++++++++++++++++ .../dao/commonVotingConfig/index.ts | 2 + .../daoCreation/getInstantiateInfo.ts | 3 +- .../daoCreation/getInstantiateInfo.ts | 3 +- packages/stateful/recoil/atoms/newDao.ts | 1 + packages/types/dao.ts | 7 ++- 7 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 packages/stateful/components/dao/commonVotingConfig/ProposalExecutionPolicyVotingConfigItem.tsx diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 0b40980d6..baeeef44a 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -1171,6 +1171,7 @@ "proposalAllAbstainClarification": "When all voters abstain, a proposal will fail.", "proposalDepositTooltip": "The deposit required to create a proposal.", "proposalDepositWillBeRefunded": "Proposal deposit will be refunded once closed.", + "proposalExecutionPolicyDescription": "Who is allowed to execute passed proposals?", "proposalModuleInfoCardsTooltip": "Different proposal types are configured separately. This is the configuration for the {{type}} proposal type.", "proposalModuleInfoCardsTooltip_approval": "Different proposal types are configured separately. This is the configuration for proposals that approve proposals in the DAO shown.", "proposalQuorumTooltip": "This proportion of voting power must vote on a proposal for it to pass.", @@ -1739,6 +1740,7 @@ "proposal": "Proposal", "proposalAllAbstain": "All abstain clarification", "proposalCreationInfo": "Proposal creation info", + "proposalExecutionPolicy": "Proposal execution policy", "proposalId": "Proposal {{id}}", "proposalNotFound": "Proposal Not Found", "proposalTieClarification": "Tie clarification", diff --git a/packages/stateful/components/dao/commonVotingConfig/ProposalExecutionPolicyVotingConfigItem.tsx b/packages/stateful/components/dao/commonVotingConfig/ProposalExecutionPolicyVotingConfigItem.tsx new file mode 100644 index 000000000..a1f9c40fe --- /dev/null +++ b/packages/stateful/components/dao/commonVotingConfig/ProposalExecutionPolicyVotingConfigItem.tsx @@ -0,0 +1,51 @@ +import { useTranslation } from 'react-i18next' + +import { LockWithKeyEmoji, SegmentedControls } from '@dao-dao/stateless' +import { + DaoCreationVotingConfigItem, + DaoCreationVotingConfigItemInputProps, + DaoCreationVotingConfigItemReviewProps, + DaoCreationVotingConfigWithProposalExecutionPolicy, +} from '@dao-dao/types' + +const ProposalExecutionPolicyVotingConfigItemInput = ({ + data: { onlyMembersExecute }, + setValue, +}: DaoCreationVotingConfigItemInputProps) => { + const { t } = useTranslation() + + return ( + setValue('onlyMembersExecute', value)} + selected={onlyMembersExecute} + tabs={[ + { + label: t('info.onlyMembers'), + value: true, + }, + { + label: t('info.anyone'), + value: false, + }, + ]} + /> + ) +} + +const ProposalExecutionPolicyVotingConfigItemReview = ({ + data: { onlyMembersExecute }, +}: DaoCreationVotingConfigItemReviewProps) => { + const { t } = useTranslation() + return <>{onlyMembersExecute ? t('info.onlyMembers') : t('info.anyone')} +} + +export const makeProposalExecutionPolicyVotingConfigItem = + (): DaoCreationVotingConfigItem => ({ + Icon: LockWithKeyEmoji, + nameI18nKey: 'title.proposalExecutionPolicy', + descriptionI18nKey: 'info.proposalExecutionPolicyDescription', + tooltipI18nKey: 'info.proposalExecutionPolicyDescription', + Input: ProposalExecutionPolicyVotingConfigItemInput, + getInputError: ({ onlyMembersExecute } = {}) => onlyMembersExecute, + Review: ProposalExecutionPolicyVotingConfigItemReview, + }) diff --git a/packages/stateful/components/dao/commonVotingConfig/index.ts b/packages/stateful/components/dao/commonVotingConfig/index.ts index 874656e43..699f4d37b 100644 --- a/packages/stateful/components/dao/commonVotingConfig/index.ts +++ b/packages/stateful/components/dao/commonVotingConfig/index.ts @@ -4,6 +4,7 @@ import { makeAllowRevotingVotingConfigItem } from './AllowRevotingVotingConfigIt import { makeApproverVotingConfigItem } from './ApproverVotingConfigItem' import { makeMultipleChoiceVotingConfigItem } from './MultipleChoiceVotingConfigItem' import { makeProposalDepositVotingConfigItem } from './ProposalDepositVotingConfigItem' +import { makeProposalExecutionPolicyVotingConfigItem } from './ProposalExecutionPolicyVotingConfigItem' import { makeProposalSubmissionPolicyVotingConfigItem } from './ProposalSubmissionPolicyVotingConfigItem' import { makeQuorumVotingConfigItem } from './QuorumVotingConfigItem' import { makeVetoVotingConfigItem } from './VetoVotingConfigItem' @@ -20,6 +21,7 @@ export const loadCommonVotingConfigItems = makeQuorumVotingConfigItem(), makeAllowRevotingVotingConfigItem(), makeProposalSubmissionPolicyVotingConfigItem(), + makeProposalExecutionPolicyVotingConfigItem(), makeApproverVotingConfigItem(), makeVetoVotingConfigItem(), ], diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/daoCreation/getInstantiateInfo.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/daoCreation/getInstantiateInfo.ts index 9157a12c5..2b427fcd1 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/daoCreation/getInstantiateInfo.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/daoCreation/getInstantiateInfo.ts @@ -26,6 +26,7 @@ export const getInstantiateInfo: DaoCreationGetInstantiateInfo< votingDuration, proposalDeposit, anyoneCanPropose, + onlyMembersExecute, allowRevoting, veto, }, @@ -89,7 +90,7 @@ export const getInstantiateInfo: DaoCreationGetInstantiateInfo< close_proposal_on_execution_failure: true, max_voting_period: convertDurationWithUnitsToDuration(votingDuration), min_voting_period: null, - only_members_execute: true, + only_members_execute: !!onlyMembersExecute, pre_propose_info: { module_may_propose: { info: { diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/getInstantiateInfo.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/getInstantiateInfo.ts index dd865e385..e258b59e7 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/getInstantiateInfo.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/getInstantiateInfo.ts @@ -31,6 +31,7 @@ export const getInstantiateInfo: DaoCreationGetInstantiateInfo< votingDuration, proposalDeposit, anyoneCanPropose, + onlyMembersExecute, allowRevoting, approver, veto, @@ -99,7 +100,7 @@ export const getInstantiateInfo: DaoCreationGetInstantiateInfo< close_proposal_on_execution_failure: true, max_voting_period: convertDurationWithUnitsToDuration(votingDuration), min_voting_period: null, - only_members_execute: true, + only_members_execute: !!onlyMembersExecute, pre_propose_info: { module_may_propose: { info: { diff --git a/packages/stateful/recoil/atoms/newDao.ts b/packages/stateful/recoil/atoms/newDao.ts index 7e508e4a2..49cec655d 100644 --- a/packages/stateful/recoil/atoms/newDao.ts +++ b/packages/stateful/recoil/atoms/newDao.ts @@ -71,6 +71,7 @@ export const makeDefaultNewDao = (chainId: string): NewDao => ({ refundPolicy: DepositRefundPolicy.OnlyPassed, }, anyoneCanPropose: false, + onlyMembersExecute: true, allowRevoting: false, enableMultipleChoice: true, approver: { diff --git a/packages/types/dao.ts b/packages/types/dao.ts index 9e7a5660d..b967650a1 100644 --- a/packages/types/dao.ts +++ b/packages/types/dao.ts @@ -399,6 +399,10 @@ export type DaoCreationVotingConfigWithVeto = { veto: ProposalVetoConfig } +export type DaoCreationVotingConfigWithProposalExecutionPolicy = { + onlyMembersExecute: boolean +} + export type DaoCreationVotingConfig = DaoCreationVotingConfigWithAllowRevoting & DaoCreationVotingConfigWithProposalDeposit & DaoCreationVotingConfigWithProposalSubmissionPolicy & @@ -406,7 +410,8 @@ export type DaoCreationVotingConfig = DaoCreationVotingConfigWithAllowRevoting & DaoCreationVotingConfigWithVotingDuration & DaoCreationVotingConfigWithEnableMultipleChoice & DaoCreationVotingConfigWithApprover & - DaoCreationVotingConfigWithVeto + DaoCreationVotingConfigWithVeto & + DaoCreationVotingConfigWithProposalExecutionPolicy //! Other From ba909e16c9129f17fcf190d61201dab88a315963 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 28 May 2024 16:30:15 -0400 Subject: [PATCH 195/438] added dev environment info to readme --- README.md | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7816764c6..84f0c5805 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,25 @@ cd dao-dao-ui yarn ``` +### Setup environment variables + +To run the server on mainnet, copy `.env.mainnet` to `.env.local` in the app +folder you care about (likely `apps/dapp`). + +Copy `.env.testnet` instead if you want to run testnet. + +### Run dev server + +If you're here to work on any other part of the app, likely accessing live chain +data, run the `yarn dev` script (equivalent to running `yarn dev` from the +[`./apps/dapp`](./apps/dapp) package) to run the main app in development mode. + +```bash +yarn dev +``` + +### Storybook + If you're here to work on UI components in isolation, you will likely want to run the [Storybook](https://storybook.js.org/) server to mock up components and iterate quickly without having to access live chain data. Check out the @@ -36,14 +55,6 @@ To start the Storybook server, run this command from the root of this monorepo: yarn storybook start ``` -If you're here to work on any other part of the app, likely accessing live chain -data, run the `yarn dev` script (equivalent to running `yarn dev` from the -[`./apps/dapp`](./apps/dapp) package) to run the main app in development mode. - -```bash -yarn dev -``` - If something is misconfigured, check out the docs for [Turborepo](https://turborepo.org/docs), the monorepo build system we use. From 2504284acdb1af57349c1d9460b7ef50e0e1774a Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 29 May 2024 12:03:53 -0400 Subject: [PATCH 196/438] added bitsong fantoken protos --- .../types/protobuf/codegen/alliance/bundle.ts | 20 +- .../types/protobuf/codegen/bitsong/bundle.ts | 16 + .../types/protobuf/codegen/bitsong/client.ts | 47 + .../bitsong/fantoken/v1beta1/tx.amino.ts | 38 + .../bitsong/fantoken/v1beta1/tx.registry.ts | 143 ++ .../bitsong/fantoken/v1beta1/tx.rpc.msg.ts | 65 + .../codegen/bitsong/fantoken/v1beta1/tx.ts | 1279 +++++++++++++++++ .../types/protobuf/codegen/bitsong/rpc.tx.ts | 46 + .../types/protobuf/codegen/circle/bundle.ts | 58 +- .../types/protobuf/codegen/cosmos/bundle.ts | 392 ++--- .../protobuf/codegen/cosmos_proto/bundle.ts | 4 +- .../types/protobuf/codegen/cosmwasm/bundle.ts | 64 +- .../types/protobuf/codegen/gaia/bundle.ts | 32 +- .../protobuf/codegen/gogoproto/bundle.ts | 4 +- .../types/protobuf/codegen/google/bundle.ts | 22 +- packages/types/protobuf/codegen/ibc/bundle.ts | 146 +- packages/types/protobuf/codegen/index.ts | 2 + .../types/protobuf/codegen/juno/bundle.ts | 56 +- .../types/protobuf/codegen/kujira/bundle.ts | 74 +- .../types/protobuf/codegen/neutron/bundle.ts | 194 +-- .../types/protobuf/codegen/noble/bundle.ts | 16 +- .../types/protobuf/codegen/osmosis/bundle.ts | 384 ++--- .../types/protobuf/codegen/pstake/bundle.ts | 106 +- .../protobuf/codegen/publicawesome/bundle.ts | 104 +- .../types/protobuf/codegen/regen/bundle.ts | 166 +-- .../protobuf/codegen/tendermint/bundle.ts | 34 +- .../bitsong/fantoken/v1beta1/events.proto | 40 + .../bitsong/fantoken/v1beta1/fantoken.proto | 46 + .../bitsong/fantoken/v1beta1/genesis.proto | 17 + .../proto/bitsong/fantoken/v1beta1/gov.proto | 42 + .../bitsong/fantoken/v1beta1/params.proto | 29 + .../bitsong/fantoken/v1beta1/query.proto | 57 + .../proto/bitsong/fantoken/v1beta1/tx.proto | 135 ++ packages/types/protobuf/scripts/codegen.js | 1 + packages/types/protobuf/utils.ts | 4 + 35 files changed, 2945 insertions(+), 938 deletions(-) create mode 100644 packages/types/protobuf/codegen/bitsong/bundle.ts create mode 100644 packages/types/protobuf/codegen/bitsong/client.ts create mode 100644 packages/types/protobuf/codegen/bitsong/fantoken/v1beta1/tx.amino.ts create mode 100644 packages/types/protobuf/codegen/bitsong/fantoken/v1beta1/tx.registry.ts create mode 100644 packages/types/protobuf/codegen/bitsong/fantoken/v1beta1/tx.rpc.msg.ts create mode 100644 packages/types/protobuf/codegen/bitsong/fantoken/v1beta1/tx.ts create mode 100644 packages/types/protobuf/codegen/bitsong/rpc.tx.ts create mode 100644 packages/types/protobuf/proto/bitsong/fantoken/v1beta1/events.proto create mode 100644 packages/types/protobuf/proto/bitsong/fantoken/v1beta1/fantoken.proto create mode 100644 packages/types/protobuf/proto/bitsong/fantoken/v1beta1/genesis.proto create mode 100644 packages/types/protobuf/proto/bitsong/fantoken/v1beta1/gov.proto create mode 100644 packages/types/protobuf/proto/bitsong/fantoken/v1beta1/params.proto create mode 100644 packages/types/protobuf/proto/bitsong/fantoken/v1beta1/query.proto create mode 100644 packages/types/protobuf/proto/bitsong/fantoken/v1beta1/tx.proto diff --git a/packages/types/protobuf/codegen/alliance/bundle.ts b/packages/types/protobuf/codegen/alliance/bundle.ts index fdc791b01..eb0a7a37b 100644 --- a/packages/types/protobuf/codegen/alliance/bundle.ts +++ b/packages/types/protobuf/codegen/alliance/bundle.ts @@ -8,12 +8,12 @@ import * as _6 from "./alliance/query"; import * as _7 from "./alliance/redelegations"; import * as _8 from "./alliance/tx"; import * as _9 from "./alliance/unbonding"; -import * as _348 from "./alliance/tx.amino"; -import * as _349 from "./alliance/tx.registry"; -import * as _350 from "./alliance/query.rpc.Query"; -import * as _351 from "./alliance/tx.rpc.msg"; -import * as _583 from "./rpc.query"; -import * as _584 from "./rpc.tx"; +import * as _349 from "./alliance/tx.amino"; +import * as _350 from "./alliance/tx.registry"; +import * as _351 from "./alliance/query.rpc.Query"; +import * as _352 from "./alliance/tx.rpc.msg"; +import * as _587 from "./rpc.query"; +import * as _588 from "./rpc.tx"; export namespace alliance { export const alliance = { ..._0, @@ -26,13 +26,13 @@ export namespace alliance { ..._7, ..._8, ..._9, - ..._348, ..._349, ..._350, - ..._351 + ..._351, + ..._352 }; export const ClientFactory = { - ..._583, - ..._584 + ..._587, + ..._588 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/bitsong/bundle.ts b/packages/types/protobuf/codegen/bitsong/bundle.ts new file mode 100644 index 000000000..86057ff32 --- /dev/null +++ b/packages/types/protobuf/codegen/bitsong/bundle.ts @@ -0,0 +1,16 @@ +import * as _11 from "./fantoken/v1beta1/tx"; +import * as _353 from "./fantoken/v1beta1/tx.amino"; +import * as _354 from "./fantoken/v1beta1/tx.registry"; +import * as _355 from "./fantoken/v1beta1/tx.rpc.msg"; +import * as _589 from "./rpc.tx"; +export namespace bitsong { + export const fantoken = { + ..._11, + ..._353, + ..._354, + ..._355 + }; + export const ClientFactory = { + ..._589 + }; +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/bitsong/client.ts b/packages/types/protobuf/codegen/bitsong/client.ts new file mode 100644 index 000000000..01e7e027a --- /dev/null +++ b/packages/types/protobuf/codegen/bitsong/client.ts @@ -0,0 +1,47 @@ +import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; +import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; +import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as bitsongFantokenV1beta1TxRegistry from "./fantoken/v1beta1/tx.registry"; +import * as bitsongFantokenV1beta1TxAmino from "./fantoken/v1beta1/tx.amino"; +export const bitsongAminoConverters = { + ...bitsongFantokenV1beta1TxAmino.AminoConverter +}; +export const bitsongProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...bitsongFantokenV1beta1TxRegistry.registry]; +export const getSigningBitsongClientOptions = ({ + defaultTypes = defaultRegistryTypes +}: { + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +} = {}): { + registry: Registry; + aminoTypes: AminoTypes; +} => { + const registry = new Registry([...defaultTypes, ...bitsongProtoRegistry]); + const aminoTypes = new AminoTypes({ + ...bitsongAminoConverters + }); + return { + registry, + aminoTypes + }; +}; +export const getSigningBitsongClient = async ({ + rpcEndpoint, + signer, + defaultTypes = defaultRegistryTypes +}: { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +}) => { + const { + registry, + aminoTypes + } = getSigningBitsongClientOptions({ + defaultTypes + }); + const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { + registry: (registry as any), + aminoTypes + }); + return client; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/bitsong/fantoken/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/bitsong/fantoken/v1beta1/tx.amino.ts new file mode 100644 index 000000000..9e7b75119 --- /dev/null +++ b/packages/types/protobuf/codegen/bitsong/fantoken/v1beta1/tx.amino.ts @@ -0,0 +1,38 @@ +import { MsgIssue, MsgMint, MsgBurn, MsgDisableMint, MsgSetMinter, MsgSetAuthority, MsgSetUri } from "./tx"; +export const AminoConverter = { + "/bitsong.fantoken.MsgIssue": { + aminoType: "/bitsong.fantoken.MsgIssue", + toAmino: MsgIssue.toAmino, + fromAmino: MsgIssue.fromAmino + }, + "/bitsong.fantoken.MsgMint": { + aminoType: "/bitsong.fantoken.MsgMint", + toAmino: MsgMint.toAmino, + fromAmino: MsgMint.fromAmino + }, + "/bitsong.fantoken.MsgBurn": { + aminoType: "/bitsong.fantoken.MsgBurn", + toAmino: MsgBurn.toAmino, + fromAmino: MsgBurn.fromAmino + }, + "/bitsong.fantoken.MsgDisableMint": { + aminoType: "/bitsong.fantoken.MsgDisableMint", + toAmino: MsgDisableMint.toAmino, + fromAmino: MsgDisableMint.fromAmino + }, + "/bitsong.fantoken.MsgSetMinter": { + aminoType: "/bitsong.fantoken.MsgSetMinter", + toAmino: MsgSetMinter.toAmino, + fromAmino: MsgSetMinter.fromAmino + }, + "/bitsong.fantoken.MsgSetAuthority": { + aminoType: "/bitsong.fantoken.MsgSetAuthority", + toAmino: MsgSetAuthority.toAmino, + fromAmino: MsgSetAuthority.fromAmino + }, + "/bitsong.fantoken.MsgSetUri": { + aminoType: "/bitsong.fantoken.MsgSetUri", + toAmino: MsgSetUri.toAmino, + fromAmino: MsgSetUri.fromAmino + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/bitsong/fantoken/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/bitsong/fantoken/v1beta1/tx.registry.ts new file mode 100644 index 000000000..7b6ac97f1 --- /dev/null +++ b/packages/types/protobuf/codegen/bitsong/fantoken/v1beta1/tx.registry.ts @@ -0,0 +1,143 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgIssue, MsgMint, MsgBurn, MsgDisableMint, MsgSetMinter, MsgSetAuthority, MsgSetUri } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/bitsong.fantoken.MsgIssue", MsgIssue], ["/bitsong.fantoken.MsgMint", MsgMint], ["/bitsong.fantoken.MsgBurn", MsgBurn], ["/bitsong.fantoken.MsgDisableMint", MsgDisableMint], ["/bitsong.fantoken.MsgSetMinter", MsgSetMinter], ["/bitsong.fantoken.MsgSetAuthority", MsgSetAuthority], ["/bitsong.fantoken.MsgSetUri", MsgSetUri]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + issue(value: MsgIssue) { + return { + typeUrl: "/bitsong.fantoken.MsgIssue", + value: MsgIssue.encode(value).finish() + }; + }, + mint(value: MsgMint) { + return { + typeUrl: "/bitsong.fantoken.MsgMint", + value: MsgMint.encode(value).finish() + }; + }, + burn(value: MsgBurn) { + return { + typeUrl: "/bitsong.fantoken.MsgBurn", + value: MsgBurn.encode(value).finish() + }; + }, + disableMint(value: MsgDisableMint) { + return { + typeUrl: "/bitsong.fantoken.MsgDisableMint", + value: MsgDisableMint.encode(value).finish() + }; + }, + setMinter(value: MsgSetMinter) { + return { + typeUrl: "/bitsong.fantoken.MsgSetMinter", + value: MsgSetMinter.encode(value).finish() + }; + }, + setAuthority(value: MsgSetAuthority) { + return { + typeUrl: "/bitsong.fantoken.MsgSetAuthority", + value: MsgSetAuthority.encode(value).finish() + }; + }, + setUri(value: MsgSetUri) { + return { + typeUrl: "/bitsong.fantoken.MsgSetUri", + value: MsgSetUri.encode(value).finish() + }; + } + }, + withTypeUrl: { + issue(value: MsgIssue) { + return { + typeUrl: "/bitsong.fantoken.MsgIssue", + value + }; + }, + mint(value: MsgMint) { + return { + typeUrl: "/bitsong.fantoken.MsgMint", + value + }; + }, + burn(value: MsgBurn) { + return { + typeUrl: "/bitsong.fantoken.MsgBurn", + value + }; + }, + disableMint(value: MsgDisableMint) { + return { + typeUrl: "/bitsong.fantoken.MsgDisableMint", + value + }; + }, + setMinter(value: MsgSetMinter) { + return { + typeUrl: "/bitsong.fantoken.MsgSetMinter", + value + }; + }, + setAuthority(value: MsgSetAuthority) { + return { + typeUrl: "/bitsong.fantoken.MsgSetAuthority", + value + }; + }, + setUri(value: MsgSetUri) { + return { + typeUrl: "/bitsong.fantoken.MsgSetUri", + value + }; + } + }, + fromPartial: { + issue(value: MsgIssue) { + return { + typeUrl: "/bitsong.fantoken.MsgIssue", + value: MsgIssue.fromPartial(value) + }; + }, + mint(value: MsgMint) { + return { + typeUrl: "/bitsong.fantoken.MsgMint", + value: MsgMint.fromPartial(value) + }; + }, + burn(value: MsgBurn) { + return { + typeUrl: "/bitsong.fantoken.MsgBurn", + value: MsgBurn.fromPartial(value) + }; + }, + disableMint(value: MsgDisableMint) { + return { + typeUrl: "/bitsong.fantoken.MsgDisableMint", + value: MsgDisableMint.fromPartial(value) + }; + }, + setMinter(value: MsgSetMinter) { + return { + typeUrl: "/bitsong.fantoken.MsgSetMinter", + value: MsgSetMinter.fromPartial(value) + }; + }, + setAuthority(value: MsgSetAuthority) { + return { + typeUrl: "/bitsong.fantoken.MsgSetAuthority", + value: MsgSetAuthority.fromPartial(value) + }; + }, + setUri(value: MsgSetUri) { + return { + typeUrl: "/bitsong.fantoken.MsgSetUri", + value: MsgSetUri.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/bitsong/fantoken/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/bitsong/fantoken/v1beta1/tx.rpc.msg.ts new file mode 100644 index 000000000..e635f456c --- /dev/null +++ b/packages/types/protobuf/codegen/bitsong/fantoken/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,65 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgIssue, MsgIssueResponse, MsgMint, MsgMintResponse, MsgBurn, MsgBurnResponse, MsgDisableMint, MsgDisableMintResponse, MsgSetMinter, MsgSetMinterResponse, MsgSetAuthority, MsgSetAuthorityResponse, MsgSetUri, MsgSetUriResponse } from "./tx"; +/** Msg defines the oracle Msg service */ +export interface Msg { + /** Issue defines a method for issuing a new fan token */ + issue(request: MsgIssue): Promise; + /** Mint defines a method for minting some fan tokens */ + mint(request: MsgMint): Promise; + /** Burn defines a method for burning some fan tokens */ + burn(request: MsgBurn): Promise; + /** DisableMint defines a method for disable the mint function */ + disableMint(request: MsgDisableMint): Promise; + setMinter(request: MsgSetMinter): Promise; + setAuthority(request: MsgSetAuthority): Promise; + setUri(request: MsgSetUri): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.issue = this.issue.bind(this); + this.mint = this.mint.bind(this); + this.burn = this.burn.bind(this); + this.disableMint = this.disableMint.bind(this); + this.setMinter = this.setMinter.bind(this); + this.setAuthority = this.setAuthority.bind(this); + this.setUri = this.setUri.bind(this); + } + issue(request: MsgIssue, useInterfaces: boolean = true): Promise { + const data = MsgIssue.encode(request).finish(); + const promise = this.rpc.request("bitsong.fantoken.Msg", "Issue", data); + return promise.then(data => MsgIssueResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + mint(request: MsgMint, useInterfaces: boolean = true): Promise { + const data = MsgMint.encode(request).finish(); + const promise = this.rpc.request("bitsong.fantoken.Msg", "Mint", data); + return promise.then(data => MsgMintResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + burn(request: MsgBurn, useInterfaces: boolean = true): Promise { + const data = MsgBurn.encode(request).finish(); + const promise = this.rpc.request("bitsong.fantoken.Msg", "Burn", data); + return promise.then(data => MsgBurnResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + disableMint(request: MsgDisableMint, useInterfaces: boolean = true): Promise { + const data = MsgDisableMint.encode(request).finish(); + const promise = this.rpc.request("bitsong.fantoken.Msg", "DisableMint", data); + return promise.then(data => MsgDisableMintResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + setMinter(request: MsgSetMinter, useInterfaces: boolean = true): Promise { + const data = MsgSetMinter.encode(request).finish(); + const promise = this.rpc.request("bitsong.fantoken.Msg", "SetMinter", data); + return promise.then(data => MsgSetMinterResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + setAuthority(request: MsgSetAuthority, useInterfaces: boolean = true): Promise { + const data = MsgSetAuthority.encode(request).finish(); + const promise = this.rpc.request("bitsong.fantoken.Msg", "SetAuthority", data); + return promise.then(data => MsgSetAuthorityResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + setUri(request: MsgSetUri, useInterfaces: boolean = true): Promise { + const data = MsgSetUri.encode(request).finish(); + const promise = this.rpc.request("bitsong.fantoken.Msg", "SetUri", data); + return promise.then(data => MsgSetUriResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/bitsong/fantoken/v1beta1/tx.ts b/packages/types/protobuf/codegen/bitsong/fantoken/v1beta1/tx.ts new file mode 100644 index 000000000..db0cb090b --- /dev/null +++ b/packages/types/protobuf/codegen/bitsong/fantoken/v1beta1/tx.ts @@ -0,0 +1,1279 @@ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** MsgIssue defines a message for issuing a new fan token */ +export interface MsgIssue { + /** symbol which corresponds to the symbol of the fan token. It is a string and cannot change for the whole life of the fan token */ + symbol: string; + /** name which corresponds to the name of the fan token. It is a string and cannot change for the whole life of the fan token */ + name: string; + /** max_supply that represents the maximum number of possible mintable tokens. It is an integer number, expressed in micro unit 10^6 */ + maxSupply: string; + /** authority which is who can set a new uri metadata */ + authority: string; + /** minter who is who can mint new fantoken and disable the minter process, the minter key also pay the gas fee */ + minter: string; + /** URI which is the current uri of the fan token. It is a string can change during the fan token lifecycle thanks to the MsgEdit */ + uri: string; +} +export interface MsgIssueProtoMsg { + typeUrl: "/bitsong.fantoken.MsgIssue"; + value: Uint8Array; +} +/** MsgIssue defines a message for issuing a new fan token */ +export interface MsgIssueAmino { + /** symbol which corresponds to the symbol of the fan token. It is a string and cannot change for the whole life of the fan token */ + symbol?: string; + /** name which corresponds to the name of the fan token. It is a string and cannot change for the whole life of the fan token */ + name?: string; + /** max_supply that represents the maximum number of possible mintable tokens. It is an integer number, expressed in micro unit 10^6 */ + max_supply?: string; + /** authority which is who can set a new uri metadata */ + authority?: string; + /** minter who is who can mint new fantoken and disable the minter process, the minter key also pay the gas fee */ + minter?: string; + /** URI which is the current uri of the fan token. It is a string can change during the fan token lifecycle thanks to the MsgEdit */ + uri?: string; +} +export interface MsgIssueAminoMsg { + type: "/bitsong.fantoken.MsgIssue"; + value: MsgIssueAmino; +} +/** MsgIssue defines a message for issuing a new fan token */ +export interface MsgIssueSDKType { + symbol: string; + name: string; + max_supply: string; + authority: string; + minter: string; + uri: string; +} +/** MsgIssueResponse defines the MsgIssue response type */ +export interface MsgIssueResponse {} +export interface MsgIssueResponseProtoMsg { + typeUrl: "/bitsong.fantoken.MsgIssueResponse"; + value: Uint8Array; +} +/** MsgIssueResponse defines the MsgIssue response type */ +export interface MsgIssueResponseAmino {} +export interface MsgIssueResponseAminoMsg { + type: "/bitsong.fantoken.MsgIssueResponse"; + value: MsgIssueResponseAmino; +} +/** MsgIssueResponse defines the MsgIssue response type */ +export interface MsgIssueResponseSDKType {} +/** MsgDisableMint defines a message for disable the mint function */ +export interface MsgDisableMint { + denom: string; + minter: string; +} +export interface MsgDisableMintProtoMsg { + typeUrl: "/bitsong.fantoken.MsgDisableMint"; + value: Uint8Array; +} +/** MsgDisableMint defines a message for disable the mint function */ +export interface MsgDisableMintAmino { + denom?: string; + minter?: string; +} +export interface MsgDisableMintAminoMsg { + type: "/bitsong.fantoken.MsgDisableMint"; + value: MsgDisableMintAmino; +} +/** MsgDisableMint defines a message for disable the mint function */ +export interface MsgDisableMintSDKType { + denom: string; + minter: string; +} +/** MsgDisableMintResponse defines the MsgDisableMint response type */ +export interface MsgDisableMintResponse {} +export interface MsgDisableMintResponseProtoMsg { + typeUrl: "/bitsong.fantoken.MsgDisableMintResponse"; + value: Uint8Array; +} +/** MsgDisableMintResponse defines the MsgDisableMint response type */ +export interface MsgDisableMintResponseAmino {} +export interface MsgDisableMintResponseAminoMsg { + type: "/bitsong.fantoken.MsgDisableMintResponse"; + value: MsgDisableMintResponseAmino; +} +/** MsgDisableMintResponse defines the MsgDisableMint response type */ +export interface MsgDisableMintResponseSDKType {} +/** MsgMint defines a message for minting a new fan token */ +export interface MsgMint { + recipient: string; + /** coin mean the amount + denom, eg: 10000ftFADJID34MCDM */ + coin: Coin | undefined; + minter: string; +} +export interface MsgMintProtoMsg { + typeUrl: "/bitsong.fantoken.MsgMint"; + value: Uint8Array; +} +/** MsgMint defines a message for minting a new fan token */ +export interface MsgMintAmino { + recipient?: string; + /** coin mean the amount + denom, eg: 10000ftFADJID34MCDM */ + coin?: CoinAmino | undefined; + minter?: string; +} +export interface MsgMintAminoMsg { + type: "/bitsong.fantoken.MsgMint"; + value: MsgMintAmino; +} +/** MsgMint defines a message for minting a new fan token */ +export interface MsgMintSDKType { + recipient: string; + coin: CoinSDKType | undefined; + minter: string; +} +/** MsgMintResponse defines the MsgMint response type */ +export interface MsgMintResponse {} +export interface MsgMintResponseProtoMsg { + typeUrl: "/bitsong.fantoken.MsgMintResponse"; + value: Uint8Array; +} +/** MsgMintResponse defines the MsgMint response type */ +export interface MsgMintResponseAmino {} +export interface MsgMintResponseAminoMsg { + type: "/bitsong.fantoken.MsgMintResponse"; + value: MsgMintResponseAmino; +} +/** MsgMintResponse defines the MsgMint response type */ +export interface MsgMintResponseSDKType {} +/** MsgBurn defines a message for burning some fan tokens */ +export interface MsgBurn { + /** coin mean the amount + denom, eg: 10000ftFADJID34MCDM */ + coin: Coin | undefined; + sender: string; +} +export interface MsgBurnProtoMsg { + typeUrl: "/bitsong.fantoken.MsgBurn"; + value: Uint8Array; +} +/** MsgBurn defines a message for burning some fan tokens */ +export interface MsgBurnAmino { + /** coin mean the amount + denom, eg: 10000ftFADJID34MCDM */ + coin?: CoinAmino | undefined; + sender?: string; +} +export interface MsgBurnAminoMsg { + type: "/bitsong.fantoken.MsgBurn"; + value: MsgBurnAmino; +} +/** MsgBurn defines a message for burning some fan tokens */ +export interface MsgBurnSDKType { + coin: CoinSDKType | undefined; + sender: string; +} +/** MsgBurnResponse defines the MsgBurn response type */ +export interface MsgBurnResponse {} +export interface MsgBurnResponseProtoMsg { + typeUrl: "/bitsong.fantoken.MsgBurnResponse"; + value: Uint8Array; +} +/** MsgBurnResponse defines the MsgBurn response type */ +export interface MsgBurnResponseAmino {} +export interface MsgBurnResponseAminoMsg { + type: "/bitsong.fantoken.MsgBurnResponse"; + value: MsgBurnResponseAmino; +} +/** MsgBurnResponse defines the MsgBurn response type */ +export interface MsgBurnResponseSDKType {} +/** MsgSetMinter defines a message for changing the fan token minter address */ +export interface MsgSetMinter { + /** denom the fan token denom */ + denom: string; + /** old_minter, the actual minter */ + oldMinter: string; + /** new_minter, the new fan token minter */ + newMinter: string; +} +export interface MsgSetMinterProtoMsg { + typeUrl: "/bitsong.fantoken.MsgSetMinter"; + value: Uint8Array; +} +/** MsgSetMinter defines a message for changing the fan token minter address */ +export interface MsgSetMinterAmino { + /** denom the fan token denom */ + denom?: string; + /** old_minter, the actual minter */ + old_minter?: string; + /** new_minter, the new fan token minter */ + new_minter?: string; +} +export interface MsgSetMinterAminoMsg { + type: "/bitsong.fantoken.MsgSetMinter"; + value: MsgSetMinterAmino; +} +/** MsgSetMinter defines a message for changing the fan token minter address */ +export interface MsgSetMinterSDKType { + denom: string; + old_minter: string; + new_minter: string; +} +/** MsgSetMinterResponse defines the MsgTransferAuthority response type */ +export interface MsgSetMinterResponse {} +export interface MsgSetMinterResponseProtoMsg { + typeUrl: "/bitsong.fantoken.MsgSetMinterResponse"; + value: Uint8Array; +} +/** MsgSetMinterResponse defines the MsgTransferAuthority response type */ +export interface MsgSetMinterResponseAmino {} +export interface MsgSetMinterResponseAminoMsg { + type: "/bitsong.fantoken.MsgSetMinterResponse"; + value: MsgSetMinterResponseAmino; +} +/** MsgSetMinterResponse defines the MsgTransferAuthority response type */ +export interface MsgSetMinterResponseSDKType {} +/** MsgSetAuthority defines a message for changing the fan token minter address */ +export interface MsgSetAuthority { + /** denom the fan token denom */ + denom: string; + /** old_authority, the actual metadata authority */ + oldAuthority: string; + /** new_authority, the new fan token metadata authority */ + newAuthority: string; +} +export interface MsgSetAuthorityProtoMsg { + typeUrl: "/bitsong.fantoken.MsgSetAuthority"; + value: Uint8Array; +} +/** MsgSetAuthority defines a message for changing the fan token minter address */ +export interface MsgSetAuthorityAmino { + /** denom the fan token denom */ + denom?: string; + /** old_authority, the actual metadata authority */ + old_authority?: string; + /** new_authority, the new fan token metadata authority */ + new_authority?: string; +} +export interface MsgSetAuthorityAminoMsg { + type: "/bitsong.fantoken.MsgSetAuthority"; + value: MsgSetAuthorityAmino; +} +/** MsgSetAuthority defines a message for changing the fan token minter address */ +export interface MsgSetAuthoritySDKType { + denom: string; + old_authority: string; + new_authority: string; +} +/** MsgSetAuthorityResponse defines the MsgTransferAuthority response type */ +export interface MsgSetAuthorityResponse {} +export interface MsgSetAuthorityResponseProtoMsg { + typeUrl: "/bitsong.fantoken.MsgSetAuthorityResponse"; + value: Uint8Array; +} +/** MsgSetAuthorityResponse defines the MsgTransferAuthority response type */ +export interface MsgSetAuthorityResponseAmino {} +export interface MsgSetAuthorityResponseAminoMsg { + type: "/bitsong.fantoken.MsgSetAuthorityResponse"; + value: MsgSetAuthorityResponseAmino; +} +/** MsgSetAuthorityResponse defines the MsgTransferAuthority response type */ +export interface MsgSetAuthorityResponseSDKType {} +export interface MsgSetUri { + authority: string; + denom: string; + uri: string; +} +export interface MsgSetUriProtoMsg { + typeUrl: "/bitsong.fantoken.MsgSetUri"; + value: Uint8Array; +} +export interface MsgSetUriAmino { + authority?: string; + denom?: string; + uri?: string; +} +export interface MsgSetUriAminoMsg { + type: "/bitsong.fantoken.MsgSetUri"; + value: MsgSetUriAmino; +} +export interface MsgSetUriSDKType { + authority: string; + denom: string; + uri: string; +} +export interface MsgSetUriResponse {} +export interface MsgSetUriResponseProtoMsg { + typeUrl: "/bitsong.fantoken.MsgSetUriResponse"; + value: Uint8Array; +} +export interface MsgSetUriResponseAmino {} +export interface MsgSetUriResponseAminoMsg { + type: "/bitsong.fantoken.MsgSetUriResponse"; + value: MsgSetUriResponseAmino; +} +export interface MsgSetUriResponseSDKType {} +function createBaseMsgIssue(): MsgIssue { + return { + symbol: "", + name: "", + maxSupply: "", + authority: "", + minter: "", + uri: "" + }; +} +export const MsgIssue = { + typeUrl: "/bitsong.fantoken.MsgIssue", + encode(message: MsgIssue, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.symbol !== "") { + writer.uint32(10).string(message.symbol); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.maxSupply !== "") { + writer.uint32(26).string(message.maxSupply); + } + if (message.authority !== "") { + writer.uint32(34).string(message.authority); + } + if (message.minter !== "") { + writer.uint32(42).string(message.minter); + } + if (message.uri !== "") { + writer.uint32(50).string(message.uri); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgIssue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgIssue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.symbol = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.maxSupply = reader.string(); + break; + case 4: + message.authority = reader.string(); + break; + case 5: + message.minter = reader.string(); + break; + case 6: + message.uri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgIssue { + const message = createBaseMsgIssue(); + message.symbol = object.symbol ?? ""; + message.name = object.name ?? ""; + message.maxSupply = object.maxSupply ?? ""; + message.authority = object.authority ?? ""; + message.minter = object.minter ?? ""; + message.uri = object.uri ?? ""; + return message; + }, + fromAmino(object: MsgIssueAmino): MsgIssue { + const message = createBaseMsgIssue(); + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.max_supply !== undefined && object.max_supply !== null) { + message.maxSupply = object.max_supply; + } + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.minter !== undefined && object.minter !== null) { + message.minter = object.minter; + } + if (object.uri !== undefined && object.uri !== null) { + message.uri = object.uri; + } + return message; + }, + toAmino(message: MsgIssue, useInterfaces: boolean = false): MsgIssueAmino { + const obj: any = {}; + obj.symbol = message.symbol; + obj.name = message.name; + obj.max_supply = message.maxSupply; + obj.authority = message.authority; + obj.minter = message.minter; + obj.uri = message.uri; + return obj; + }, + fromAminoMsg(object: MsgIssueAminoMsg): MsgIssue { + return MsgIssue.fromAmino(object.value); + }, + fromProtoMsg(message: MsgIssueProtoMsg, useInterfaces: boolean = false): MsgIssue { + return MsgIssue.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgIssue): Uint8Array { + return MsgIssue.encode(message).finish(); + }, + toProtoMsg(message: MsgIssue): MsgIssueProtoMsg { + return { + typeUrl: "/bitsong.fantoken.MsgIssue", + value: MsgIssue.encode(message).finish() + }; + } +}; +function createBaseMsgIssueResponse(): MsgIssueResponse { + return {}; +} +export const MsgIssueResponse = { + typeUrl: "/bitsong.fantoken.MsgIssueResponse", + encode(_: MsgIssueResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgIssueResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgIssueResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgIssueResponse { + const message = createBaseMsgIssueResponse(); + return message; + }, + fromAmino(_: MsgIssueResponseAmino): MsgIssueResponse { + const message = createBaseMsgIssueResponse(); + return message; + }, + toAmino(_: MsgIssueResponse, useInterfaces: boolean = false): MsgIssueResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgIssueResponseAminoMsg): MsgIssueResponse { + return MsgIssueResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgIssueResponseProtoMsg, useInterfaces: boolean = false): MsgIssueResponse { + return MsgIssueResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgIssueResponse): Uint8Array { + return MsgIssueResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgIssueResponse): MsgIssueResponseProtoMsg { + return { + typeUrl: "/bitsong.fantoken.MsgIssueResponse", + value: MsgIssueResponse.encode(message).finish() + }; + } +}; +function createBaseMsgDisableMint(): MsgDisableMint { + return { + denom: "", + minter: "" + }; +} +export const MsgDisableMint = { + typeUrl: "/bitsong.fantoken.MsgDisableMint", + encode(message: MsgDisableMint, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.minter !== "") { + writer.uint32(18).string(message.minter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgDisableMint { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDisableMint(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.minter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgDisableMint { + const message = createBaseMsgDisableMint(); + message.denom = object.denom ?? ""; + message.minter = object.minter ?? ""; + return message; + }, + fromAmino(object: MsgDisableMintAmino): MsgDisableMint { + const message = createBaseMsgDisableMint(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.minter !== undefined && object.minter !== null) { + message.minter = object.minter; + } + return message; + }, + toAmino(message: MsgDisableMint, useInterfaces: boolean = false): MsgDisableMintAmino { + const obj: any = {}; + obj.denom = message.denom; + obj.minter = message.minter; + return obj; + }, + fromAminoMsg(object: MsgDisableMintAminoMsg): MsgDisableMint { + return MsgDisableMint.fromAmino(object.value); + }, + fromProtoMsg(message: MsgDisableMintProtoMsg, useInterfaces: boolean = false): MsgDisableMint { + return MsgDisableMint.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgDisableMint): Uint8Array { + return MsgDisableMint.encode(message).finish(); + }, + toProtoMsg(message: MsgDisableMint): MsgDisableMintProtoMsg { + return { + typeUrl: "/bitsong.fantoken.MsgDisableMint", + value: MsgDisableMint.encode(message).finish() + }; + } +}; +function createBaseMsgDisableMintResponse(): MsgDisableMintResponse { + return {}; +} +export const MsgDisableMintResponse = { + typeUrl: "/bitsong.fantoken.MsgDisableMintResponse", + encode(_: MsgDisableMintResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgDisableMintResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDisableMintResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgDisableMintResponse { + const message = createBaseMsgDisableMintResponse(); + return message; + }, + fromAmino(_: MsgDisableMintResponseAmino): MsgDisableMintResponse { + const message = createBaseMsgDisableMintResponse(); + return message; + }, + toAmino(_: MsgDisableMintResponse, useInterfaces: boolean = false): MsgDisableMintResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgDisableMintResponseAminoMsg): MsgDisableMintResponse { + return MsgDisableMintResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgDisableMintResponseProtoMsg, useInterfaces: boolean = false): MsgDisableMintResponse { + return MsgDisableMintResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgDisableMintResponse): Uint8Array { + return MsgDisableMintResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDisableMintResponse): MsgDisableMintResponseProtoMsg { + return { + typeUrl: "/bitsong.fantoken.MsgDisableMintResponse", + value: MsgDisableMintResponse.encode(message).finish() + }; + } +}; +function createBaseMsgMint(): MsgMint { + return { + recipient: "", + coin: Coin.fromPartial({}), + minter: "" + }; +} +export const MsgMint = { + typeUrl: "/bitsong.fantoken.MsgMint", + encode(message: MsgMint, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.recipient !== "") { + writer.uint32(10).string(message.recipient); + } + if (message.coin !== undefined) { + Coin.encode(message.coin, writer.uint32(18).fork()).ldelim(); + } + if (message.minter !== "") { + writer.uint32(26).string(message.minter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgMint { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMint(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.recipient = reader.string(); + break; + case 2: + message.coin = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.minter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgMint { + const message = createBaseMsgMint(); + message.recipient = object.recipient ?? ""; + message.coin = object.coin !== undefined && object.coin !== null ? Coin.fromPartial(object.coin) : undefined; + message.minter = object.minter ?? ""; + return message; + }, + fromAmino(object: MsgMintAmino): MsgMint { + const message = createBaseMsgMint(); + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + if (object.coin !== undefined && object.coin !== null) { + message.coin = Coin.fromAmino(object.coin); + } + if (object.minter !== undefined && object.minter !== null) { + message.minter = object.minter; + } + return message; + }, + toAmino(message: MsgMint, useInterfaces: boolean = false): MsgMintAmino { + const obj: any = {}; + obj.recipient = message.recipient; + obj.coin = message.coin ? Coin.toAmino(message.coin, useInterfaces) : undefined; + obj.minter = message.minter; + return obj; + }, + fromAminoMsg(object: MsgMintAminoMsg): MsgMint { + return MsgMint.fromAmino(object.value); + }, + fromProtoMsg(message: MsgMintProtoMsg, useInterfaces: boolean = false): MsgMint { + return MsgMint.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgMint): Uint8Array { + return MsgMint.encode(message).finish(); + }, + toProtoMsg(message: MsgMint): MsgMintProtoMsg { + return { + typeUrl: "/bitsong.fantoken.MsgMint", + value: MsgMint.encode(message).finish() + }; + } +}; +function createBaseMsgMintResponse(): MsgMintResponse { + return {}; +} +export const MsgMintResponse = { + typeUrl: "/bitsong.fantoken.MsgMintResponse", + encode(_: MsgMintResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgMintResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMintResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgMintResponse { + const message = createBaseMsgMintResponse(); + return message; + }, + fromAmino(_: MsgMintResponseAmino): MsgMintResponse { + const message = createBaseMsgMintResponse(); + return message; + }, + toAmino(_: MsgMintResponse, useInterfaces: boolean = false): MsgMintResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgMintResponseAminoMsg): MsgMintResponse { + return MsgMintResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgMintResponseProtoMsg, useInterfaces: boolean = false): MsgMintResponse { + return MsgMintResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgMintResponse): Uint8Array { + return MsgMintResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgMintResponse): MsgMintResponseProtoMsg { + return { + typeUrl: "/bitsong.fantoken.MsgMintResponse", + value: MsgMintResponse.encode(message).finish() + }; + } +}; +function createBaseMsgBurn(): MsgBurn { + return { + coin: Coin.fromPartial({}), + sender: "" + }; +} +export const MsgBurn = { + typeUrl: "/bitsong.fantoken.MsgBurn", + encode(message: MsgBurn, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.coin !== undefined) { + Coin.encode(message.coin, writer.uint32(10).fork()).ldelim(); + } + if (message.sender !== "") { + writer.uint32(18).string(message.sender); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgBurn { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBurn(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.coin = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgBurn { + const message = createBaseMsgBurn(); + message.coin = object.coin !== undefined && object.coin !== null ? Coin.fromPartial(object.coin) : undefined; + message.sender = object.sender ?? ""; + return message; + }, + fromAmino(object: MsgBurnAmino): MsgBurn { + const message = createBaseMsgBurn(); + if (object.coin !== undefined && object.coin !== null) { + message.coin = Coin.fromAmino(object.coin); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; + }, + toAmino(message: MsgBurn, useInterfaces: boolean = false): MsgBurnAmino { + const obj: any = {}; + obj.coin = message.coin ? Coin.toAmino(message.coin, useInterfaces) : undefined; + obj.sender = message.sender; + return obj; + }, + fromAminoMsg(object: MsgBurnAminoMsg): MsgBurn { + return MsgBurn.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBurnProtoMsg, useInterfaces: boolean = false): MsgBurn { + return MsgBurn.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgBurn): Uint8Array { + return MsgBurn.encode(message).finish(); + }, + toProtoMsg(message: MsgBurn): MsgBurnProtoMsg { + return { + typeUrl: "/bitsong.fantoken.MsgBurn", + value: MsgBurn.encode(message).finish() + }; + } +}; +function createBaseMsgBurnResponse(): MsgBurnResponse { + return {}; +} +export const MsgBurnResponse = { + typeUrl: "/bitsong.fantoken.MsgBurnResponse", + encode(_: MsgBurnResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgBurnResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBurnResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgBurnResponse { + const message = createBaseMsgBurnResponse(); + return message; + }, + fromAmino(_: MsgBurnResponseAmino): MsgBurnResponse { + const message = createBaseMsgBurnResponse(); + return message; + }, + toAmino(_: MsgBurnResponse, useInterfaces: boolean = false): MsgBurnResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgBurnResponseAminoMsg): MsgBurnResponse { + return MsgBurnResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBurnResponseProtoMsg, useInterfaces: boolean = false): MsgBurnResponse { + return MsgBurnResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgBurnResponse): Uint8Array { + return MsgBurnResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBurnResponse): MsgBurnResponseProtoMsg { + return { + typeUrl: "/bitsong.fantoken.MsgBurnResponse", + value: MsgBurnResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetMinter(): MsgSetMinter { + return { + denom: "", + oldMinter: "", + newMinter: "" + }; +} +export const MsgSetMinter = { + typeUrl: "/bitsong.fantoken.MsgSetMinter", + encode(message: MsgSetMinter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.oldMinter !== "") { + writer.uint32(18).string(message.oldMinter); + } + if (message.newMinter !== "") { + writer.uint32(26).string(message.newMinter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetMinter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetMinter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.oldMinter = reader.string(); + break; + case 3: + message.newMinter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetMinter { + const message = createBaseMsgSetMinter(); + message.denom = object.denom ?? ""; + message.oldMinter = object.oldMinter ?? ""; + message.newMinter = object.newMinter ?? ""; + return message; + }, + fromAmino(object: MsgSetMinterAmino): MsgSetMinter { + const message = createBaseMsgSetMinter(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.old_minter !== undefined && object.old_minter !== null) { + message.oldMinter = object.old_minter; + } + if (object.new_minter !== undefined && object.new_minter !== null) { + message.newMinter = object.new_minter; + } + return message; + }, + toAmino(message: MsgSetMinter, useInterfaces: boolean = false): MsgSetMinterAmino { + const obj: any = {}; + obj.denom = message.denom; + obj.old_minter = message.oldMinter; + obj.new_minter = message.newMinter; + return obj; + }, + fromAminoMsg(object: MsgSetMinterAminoMsg): MsgSetMinter { + return MsgSetMinter.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetMinterProtoMsg, useInterfaces: boolean = false): MsgSetMinter { + return MsgSetMinter.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetMinter): Uint8Array { + return MsgSetMinter.encode(message).finish(); + }, + toProtoMsg(message: MsgSetMinter): MsgSetMinterProtoMsg { + return { + typeUrl: "/bitsong.fantoken.MsgSetMinter", + value: MsgSetMinter.encode(message).finish() + }; + } +}; +function createBaseMsgSetMinterResponse(): MsgSetMinterResponse { + return {}; +} +export const MsgSetMinterResponse = { + typeUrl: "/bitsong.fantoken.MsgSetMinterResponse", + encode(_: MsgSetMinterResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetMinterResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetMinterResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetMinterResponse { + const message = createBaseMsgSetMinterResponse(); + return message; + }, + fromAmino(_: MsgSetMinterResponseAmino): MsgSetMinterResponse { + const message = createBaseMsgSetMinterResponse(); + return message; + }, + toAmino(_: MsgSetMinterResponse, useInterfaces: boolean = false): MsgSetMinterResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetMinterResponseAminoMsg): MsgSetMinterResponse { + return MsgSetMinterResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetMinterResponseProtoMsg, useInterfaces: boolean = false): MsgSetMinterResponse { + return MsgSetMinterResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetMinterResponse): Uint8Array { + return MsgSetMinterResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetMinterResponse): MsgSetMinterResponseProtoMsg { + return { + typeUrl: "/bitsong.fantoken.MsgSetMinterResponse", + value: MsgSetMinterResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetAuthority(): MsgSetAuthority { + return { + denom: "", + oldAuthority: "", + newAuthority: "" + }; +} +export const MsgSetAuthority = { + typeUrl: "/bitsong.fantoken.MsgSetAuthority", + encode(message: MsgSetAuthority, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.oldAuthority !== "") { + writer.uint32(18).string(message.oldAuthority); + } + if (message.newAuthority !== "") { + writer.uint32(26).string(message.newAuthority); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetAuthority { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetAuthority(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.oldAuthority = reader.string(); + break; + case 3: + message.newAuthority = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetAuthority { + const message = createBaseMsgSetAuthority(); + message.denom = object.denom ?? ""; + message.oldAuthority = object.oldAuthority ?? ""; + message.newAuthority = object.newAuthority ?? ""; + return message; + }, + fromAmino(object: MsgSetAuthorityAmino): MsgSetAuthority { + const message = createBaseMsgSetAuthority(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.old_authority !== undefined && object.old_authority !== null) { + message.oldAuthority = object.old_authority; + } + if (object.new_authority !== undefined && object.new_authority !== null) { + message.newAuthority = object.new_authority; + } + return message; + }, + toAmino(message: MsgSetAuthority, useInterfaces: boolean = false): MsgSetAuthorityAmino { + const obj: any = {}; + obj.denom = message.denom; + obj.old_authority = message.oldAuthority; + obj.new_authority = message.newAuthority; + return obj; + }, + fromAminoMsg(object: MsgSetAuthorityAminoMsg): MsgSetAuthority { + return MsgSetAuthority.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetAuthorityProtoMsg, useInterfaces: boolean = false): MsgSetAuthority { + return MsgSetAuthority.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetAuthority): Uint8Array { + return MsgSetAuthority.encode(message).finish(); + }, + toProtoMsg(message: MsgSetAuthority): MsgSetAuthorityProtoMsg { + return { + typeUrl: "/bitsong.fantoken.MsgSetAuthority", + value: MsgSetAuthority.encode(message).finish() + }; + } +}; +function createBaseMsgSetAuthorityResponse(): MsgSetAuthorityResponse { + return {}; +} +export const MsgSetAuthorityResponse = { + typeUrl: "/bitsong.fantoken.MsgSetAuthorityResponse", + encode(_: MsgSetAuthorityResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetAuthorityResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetAuthorityResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetAuthorityResponse { + const message = createBaseMsgSetAuthorityResponse(); + return message; + }, + fromAmino(_: MsgSetAuthorityResponseAmino): MsgSetAuthorityResponse { + const message = createBaseMsgSetAuthorityResponse(); + return message; + }, + toAmino(_: MsgSetAuthorityResponse, useInterfaces: boolean = false): MsgSetAuthorityResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetAuthorityResponseAminoMsg): MsgSetAuthorityResponse { + return MsgSetAuthorityResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetAuthorityResponseProtoMsg, useInterfaces: boolean = false): MsgSetAuthorityResponse { + return MsgSetAuthorityResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetAuthorityResponse): Uint8Array { + return MsgSetAuthorityResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetAuthorityResponse): MsgSetAuthorityResponseProtoMsg { + return { + typeUrl: "/bitsong.fantoken.MsgSetAuthorityResponse", + value: MsgSetAuthorityResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetUri(): MsgSetUri { + return { + authority: "", + denom: "", + uri: "" + }; +} +export const MsgSetUri = { + typeUrl: "/bitsong.fantoken.MsgSetUri", + encode(message: MsgSetUri, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.uri !== "") { + writer.uint32(26).string(message.uri); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetUri { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetUri(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.uri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetUri { + const message = createBaseMsgSetUri(); + message.authority = object.authority ?? ""; + message.denom = object.denom ?? ""; + message.uri = object.uri ?? ""; + return message; + }, + fromAmino(object: MsgSetUriAmino): MsgSetUri { + const message = createBaseMsgSetUri(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.uri !== undefined && object.uri !== null) { + message.uri = object.uri; + } + return message; + }, + toAmino(message: MsgSetUri, useInterfaces: boolean = false): MsgSetUriAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.denom = message.denom; + obj.uri = message.uri; + return obj; + }, + fromAminoMsg(object: MsgSetUriAminoMsg): MsgSetUri { + return MsgSetUri.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetUriProtoMsg, useInterfaces: boolean = false): MsgSetUri { + return MsgSetUri.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetUri): Uint8Array { + return MsgSetUri.encode(message).finish(); + }, + toProtoMsg(message: MsgSetUri): MsgSetUriProtoMsg { + return { + typeUrl: "/bitsong.fantoken.MsgSetUri", + value: MsgSetUri.encode(message).finish() + }; + } +}; +function createBaseMsgSetUriResponse(): MsgSetUriResponse { + return {}; +} +export const MsgSetUriResponse = { + typeUrl: "/bitsong.fantoken.MsgSetUriResponse", + encode(_: MsgSetUriResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetUriResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetUriResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetUriResponse { + const message = createBaseMsgSetUriResponse(); + return message; + }, + fromAmino(_: MsgSetUriResponseAmino): MsgSetUriResponse { + const message = createBaseMsgSetUriResponse(); + return message; + }, + toAmino(_: MsgSetUriResponse, useInterfaces: boolean = false): MsgSetUriResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetUriResponseAminoMsg): MsgSetUriResponse { + return MsgSetUriResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSetUriResponseProtoMsg, useInterfaces: boolean = false): MsgSetUriResponse { + return MsgSetUriResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetUriResponse): Uint8Array { + return MsgSetUriResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetUriResponse): MsgSetUriResponseProtoMsg { + return { + typeUrl: "/bitsong.fantoken.MsgSetUriResponse", + value: MsgSetUriResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/bitsong/rpc.tx.ts b/packages/types/protobuf/codegen/bitsong/rpc.tx.ts new file mode 100644 index 000000000..ffefec71a --- /dev/null +++ b/packages/types/protobuf/codegen/bitsong/rpc.tx.ts @@ -0,0 +1,46 @@ +import { Rpc } from "../helpers"; +export const createRPCMsgClient = async ({ + rpc +}: { + rpc: Rpc; +}) => ({ + bitsong: { + fantoken: new (await import("./fantoken/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + cosmos: { + adminmodule: { + adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) + }, + auth: { + v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + authz: { + v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + bank: { + v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + distribution: { + v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + gov: { + v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), + v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + mint: { + v1beta1: new (await import("../cosmos/mint/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + slashing: { + v1beta1: new (await import("../cosmos/slashing/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + staking: { + v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + upgrade: { + v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + } + } +}); \ No newline at end of file diff --git a/packages/types/protobuf/codegen/circle/bundle.ts b/packages/types/protobuf/codegen/circle/bundle.ts index 35b33f38f..0d2ecd6eb 100644 --- a/packages/types/protobuf/codegen/circle/bundle.ts +++ b/packages/types/protobuf/codegen/circle/bundle.ts @@ -1,29 +1,28 @@ -import * as _11 from "./cctp/v1/attester"; -import * as _12 from "./cctp/v1/burn_message"; -import * as _13 from "./cctp/v1/burning_and_minting_paused"; -import * as _14 from "./cctp/v1/events"; -import * as _15 from "./cctp/v1/genesis"; -import * as _16 from "./cctp/v1/max_message_body_size"; -import * as _17 from "./cctp/v1/message"; -import * as _18 from "./cctp/v1/nonce"; -import * as _19 from "./cctp/v1/params"; -import * as _20 from "./cctp/v1/per_message_burn_limit"; -import * as _21 from "./cctp/v1/query"; -import * as _22 from "./cctp/v1/remote_token_messenger"; -import * as _23 from "./cctp/v1/sending_and_receiving_messages_paused"; -import * as _24 from "./cctp/v1/signature_threshold"; -import * as _25 from "./cctp/v1/token_pair"; -import * as _26 from "./cctp/v1/tx"; -import * as _352 from "./cctp/v1/tx.amino"; -import * as _353 from "./cctp/v1/tx.registry"; -import * as _354 from "./cctp/v1/query.rpc.Query"; -import * as _355 from "./cctp/v1/tx.rpc.msg"; -import * as _585 from "./rpc.query"; -import * as _586 from "./rpc.tx"; +import * as _12 from "./cctp/v1/attester"; +import * as _13 from "./cctp/v1/burn_message"; +import * as _14 from "./cctp/v1/burning_and_minting_paused"; +import * as _15 from "./cctp/v1/events"; +import * as _16 from "./cctp/v1/genesis"; +import * as _17 from "./cctp/v1/max_message_body_size"; +import * as _18 from "./cctp/v1/message"; +import * as _19 from "./cctp/v1/nonce"; +import * as _20 from "./cctp/v1/params"; +import * as _21 from "./cctp/v1/per_message_burn_limit"; +import * as _22 from "./cctp/v1/query"; +import * as _23 from "./cctp/v1/remote_token_messenger"; +import * as _24 from "./cctp/v1/sending_and_receiving_messages_paused"; +import * as _25 from "./cctp/v1/signature_threshold"; +import * as _26 from "./cctp/v1/token_pair"; +import * as _27 from "./cctp/v1/tx"; +import * as _356 from "./cctp/v1/tx.amino"; +import * as _357 from "./cctp/v1/tx.registry"; +import * as _358 from "./cctp/v1/query.rpc.Query"; +import * as _359 from "./cctp/v1/tx.rpc.msg"; +import * as _590 from "./rpc.query"; +import * as _591 from "./rpc.tx"; export namespace circle { export namespace cctp { export const v1 = { - ..._11, ..._12, ..._13, ..._14, @@ -39,14 +38,15 @@ export namespace circle { ..._24, ..._25, ..._26, - ..._352, - ..._353, - ..._354, - ..._355 + ..._27, + ..._356, + ..._357, + ..._358, + ..._359 }; } export const ClientFactory = { - ..._585, - ..._586 + ..._590, + ..._591 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/bundle.ts b/packages/types/protobuf/codegen/cosmos/bundle.ts index cefa7d41c..7cf7dd0f1 100644 --- a/packages/types/protobuf/codegen/cosmos/bundle.ts +++ b/packages/types/protobuf/codegen/cosmos/bundle.ts @@ -1,334 +1,334 @@ -import * as _28 from "./adminmodule/adminmodule/genesis"; -import * as _29 from "./adminmodule/adminmodule/query"; -import * as _30 from "./adminmodule/adminmodule/tx"; -import * as _31 from "./auth/v1beta1/auth"; -import * as _32 from "./auth/v1beta1/genesis"; -import * as _33 from "./auth/v1beta1/query"; -import * as _34 from "./auth/v1beta1/tx"; -import * as _35 from "./authz/v1beta1/authz"; -import * as _36 from "./authz/v1beta1/event"; -import * as _37 from "./authz/v1beta1/genesis"; -import * as _38 from "./authz/v1beta1/query"; -import * as _39 from "./authz/v1beta1/tx"; -import * as _40 from "./bank/v1beta1/authz"; -import * as _41 from "./bank/v1beta1/bank"; -import * as _42 from "./bank/v1beta1/genesis"; -import * as _43 from "./bank/v1beta1/query"; -import * as _44 from "./bank/v1beta1/tx"; -import * as _45 from "./base/abci/v1beta1/abci"; -import * as _46 from "./base/query/v1beta1/pagination"; -import * as _47 from "./base/tendermint/v1beta1/query"; -import * as _48 from "./base/tendermint/v1beta1/types"; -import * as _49 from "./base/v1beta1/coin"; -import * as _50 from "./crypto/ed25519/keys"; -import * as _51 from "./crypto/multisig/keys"; -import * as _52 from "./crypto/secp256k1/keys"; -import * as _53 from "./distribution/v1beta1/distribution"; -import * as _54 from "./distribution/v1beta1/genesis"; -import * as _55 from "./distribution/v1beta1/query"; -import * as _56 from "./distribution/v1beta1/tx"; -import * as _57 from "./feegrant/v1beta1/feegrant"; -import * as _58 from "./feegrant/v1beta1/genesis"; -import * as _59 from "./feegrant/v1beta1/query"; -import * as _60 from "./feegrant/v1beta1/tx"; -import * as _61 from "./gov/v1/genesis"; -import * as _62 from "./gov/v1/gov"; -import * as _63 from "./gov/v1/query"; -import * as _64 from "./gov/v1/tx"; -import * as _65 from "./gov/v1beta1/genesis"; -import * as _66 from "./gov/v1beta1/gov"; -import * as _67 from "./gov/v1beta1/query"; -import * as _68 from "./gov/v1beta1/tx"; -import * as _69 from "./mint/v1beta1/genesis"; -import * as _70 from "./mint/v1beta1/mint"; -import * as _71 from "./mint/v1beta1/query"; -import * as _72 from "./mint/v1beta1/tx"; -import * as _73 from "./msg/v1/msg"; -import * as _74 from "./orm/v1/orm"; -import * as _75 from "./params/v1beta1/params"; -import * as _76 from "./params/v1beta1/query"; -import * as _77 from "./query/v1/query"; -import * as _78 from "./slashing/v1beta1/genesis"; -import * as _79 from "./slashing/v1beta1/query"; -import * as _80 from "./slashing/v1beta1/slashing"; -import * as _81 from "./slashing/v1beta1/tx"; -import * as _82 from "./staking/v1beta1/authz"; -import * as _83 from "./staking/v1beta1/genesis"; -import * as _84 from "./staking/v1beta1/query"; -import * as _85 from "./staking/v1beta1/staking"; -import * as _86 from "./staking/v1beta1/tx"; -import * as _87 from "./tx/signing/v1beta1/signing"; -import * as _88 from "./tx/v1beta1/service"; -import * as _89 from "./tx/v1beta1/tx"; -import * as _90 from "./upgrade/v1beta1/query"; -import * as _91 from "./upgrade/v1beta1/tx"; -import * as _92 from "./upgrade/v1beta1/upgrade"; -import * as _356 from "./adminmodule/adminmodule/tx.amino"; -import * as _357 from "./auth/v1beta1/tx.amino"; -import * as _358 from "./authz/v1beta1/tx.amino"; -import * as _359 from "./bank/v1beta1/tx.amino"; -import * as _360 from "./distribution/v1beta1/tx.amino"; -import * as _361 from "./feegrant/v1beta1/tx.amino"; -import * as _362 from "./gov/v1/tx.amino"; -import * as _363 from "./gov/v1beta1/tx.amino"; -import * as _364 from "./mint/v1beta1/tx.amino"; -import * as _365 from "./slashing/v1beta1/tx.amino"; -import * as _366 from "./staking/v1beta1/tx.amino"; -import * as _367 from "./upgrade/v1beta1/tx.amino"; -import * as _368 from "./adminmodule/adminmodule/tx.registry"; -import * as _369 from "./auth/v1beta1/tx.registry"; -import * as _370 from "./authz/v1beta1/tx.registry"; -import * as _371 from "./bank/v1beta1/tx.registry"; -import * as _372 from "./distribution/v1beta1/tx.registry"; -import * as _373 from "./feegrant/v1beta1/tx.registry"; -import * as _374 from "./gov/v1/tx.registry"; -import * as _375 from "./gov/v1beta1/tx.registry"; -import * as _376 from "./mint/v1beta1/tx.registry"; -import * as _377 from "./slashing/v1beta1/tx.registry"; -import * as _378 from "./staking/v1beta1/tx.registry"; -import * as _379 from "./upgrade/v1beta1/tx.registry"; -import * as _380 from "./adminmodule/adminmodule/query.rpc.Query"; -import * as _381 from "./auth/v1beta1/query.rpc.Query"; -import * as _382 from "./authz/v1beta1/query.rpc.Query"; -import * as _383 from "./bank/v1beta1/query.rpc.Query"; -import * as _384 from "./base/tendermint/v1beta1/query.rpc.Service"; -import * as _385 from "./distribution/v1beta1/query.rpc.Query"; -import * as _386 from "./feegrant/v1beta1/query.rpc.Query"; -import * as _387 from "./gov/v1/query.rpc.Query"; -import * as _388 from "./gov/v1beta1/query.rpc.Query"; -import * as _389 from "./mint/v1beta1/query.rpc.Query"; -import * as _390 from "./params/v1beta1/query.rpc.Query"; -import * as _391 from "./slashing/v1beta1/query.rpc.Query"; -import * as _392 from "./staking/v1beta1/query.rpc.Query"; -import * as _393 from "./tx/v1beta1/service.rpc.Service"; -import * as _394 from "./upgrade/v1beta1/query.rpc.Query"; -import * as _395 from "./adminmodule/adminmodule/tx.rpc.msg"; -import * as _396 from "./auth/v1beta1/tx.rpc.msg"; -import * as _397 from "./authz/v1beta1/tx.rpc.msg"; -import * as _398 from "./bank/v1beta1/tx.rpc.msg"; -import * as _399 from "./distribution/v1beta1/tx.rpc.msg"; -import * as _400 from "./feegrant/v1beta1/tx.rpc.msg"; -import * as _401 from "./gov/v1/tx.rpc.msg"; -import * as _402 from "./gov/v1beta1/tx.rpc.msg"; -import * as _403 from "./mint/v1beta1/tx.rpc.msg"; -import * as _404 from "./slashing/v1beta1/tx.rpc.msg"; -import * as _405 from "./staking/v1beta1/tx.rpc.msg"; -import * as _406 from "./upgrade/v1beta1/tx.rpc.msg"; -import * as _587 from "./rpc.query"; -import * as _588 from "./rpc.tx"; +import * as _29 from "./adminmodule/adminmodule/genesis"; +import * as _30 from "./adminmodule/adminmodule/query"; +import * as _31 from "./adminmodule/adminmodule/tx"; +import * as _32 from "./auth/v1beta1/auth"; +import * as _33 from "./auth/v1beta1/genesis"; +import * as _34 from "./auth/v1beta1/query"; +import * as _35 from "./auth/v1beta1/tx"; +import * as _36 from "./authz/v1beta1/authz"; +import * as _37 from "./authz/v1beta1/event"; +import * as _38 from "./authz/v1beta1/genesis"; +import * as _39 from "./authz/v1beta1/query"; +import * as _40 from "./authz/v1beta1/tx"; +import * as _41 from "./bank/v1beta1/authz"; +import * as _42 from "./bank/v1beta1/bank"; +import * as _43 from "./bank/v1beta1/genesis"; +import * as _44 from "./bank/v1beta1/query"; +import * as _45 from "./bank/v1beta1/tx"; +import * as _46 from "./base/abci/v1beta1/abci"; +import * as _47 from "./base/query/v1beta1/pagination"; +import * as _48 from "./base/tendermint/v1beta1/query"; +import * as _49 from "./base/tendermint/v1beta1/types"; +import * as _50 from "./base/v1beta1/coin"; +import * as _51 from "./crypto/ed25519/keys"; +import * as _52 from "./crypto/multisig/keys"; +import * as _53 from "./crypto/secp256k1/keys"; +import * as _54 from "./distribution/v1beta1/distribution"; +import * as _55 from "./distribution/v1beta1/genesis"; +import * as _56 from "./distribution/v1beta1/query"; +import * as _57 from "./distribution/v1beta1/tx"; +import * as _58 from "./feegrant/v1beta1/feegrant"; +import * as _59 from "./feegrant/v1beta1/genesis"; +import * as _60 from "./feegrant/v1beta1/query"; +import * as _61 from "./feegrant/v1beta1/tx"; +import * as _62 from "./gov/v1/genesis"; +import * as _63 from "./gov/v1/gov"; +import * as _64 from "./gov/v1/query"; +import * as _65 from "./gov/v1/tx"; +import * as _66 from "./gov/v1beta1/genesis"; +import * as _67 from "./gov/v1beta1/gov"; +import * as _68 from "./gov/v1beta1/query"; +import * as _69 from "./gov/v1beta1/tx"; +import * as _70 from "./mint/v1beta1/genesis"; +import * as _71 from "./mint/v1beta1/mint"; +import * as _72 from "./mint/v1beta1/query"; +import * as _73 from "./mint/v1beta1/tx"; +import * as _74 from "./msg/v1/msg"; +import * as _75 from "./orm/v1/orm"; +import * as _76 from "./params/v1beta1/params"; +import * as _77 from "./params/v1beta1/query"; +import * as _78 from "./query/v1/query"; +import * as _79 from "./slashing/v1beta1/genesis"; +import * as _80 from "./slashing/v1beta1/query"; +import * as _81 from "./slashing/v1beta1/slashing"; +import * as _82 from "./slashing/v1beta1/tx"; +import * as _83 from "./staking/v1beta1/authz"; +import * as _84 from "./staking/v1beta1/genesis"; +import * as _85 from "./staking/v1beta1/query"; +import * as _86 from "./staking/v1beta1/staking"; +import * as _87 from "./staking/v1beta1/tx"; +import * as _88 from "./tx/signing/v1beta1/signing"; +import * as _89 from "./tx/v1beta1/service"; +import * as _90 from "./tx/v1beta1/tx"; +import * as _91 from "./upgrade/v1beta1/query"; +import * as _92 from "./upgrade/v1beta1/tx"; +import * as _93 from "./upgrade/v1beta1/upgrade"; +import * as _360 from "./adminmodule/adminmodule/tx.amino"; +import * as _361 from "./auth/v1beta1/tx.amino"; +import * as _362 from "./authz/v1beta1/tx.amino"; +import * as _363 from "./bank/v1beta1/tx.amino"; +import * as _364 from "./distribution/v1beta1/tx.amino"; +import * as _365 from "./feegrant/v1beta1/tx.amino"; +import * as _366 from "./gov/v1/tx.amino"; +import * as _367 from "./gov/v1beta1/tx.amino"; +import * as _368 from "./mint/v1beta1/tx.amino"; +import * as _369 from "./slashing/v1beta1/tx.amino"; +import * as _370 from "./staking/v1beta1/tx.amino"; +import * as _371 from "./upgrade/v1beta1/tx.amino"; +import * as _372 from "./adminmodule/adminmodule/tx.registry"; +import * as _373 from "./auth/v1beta1/tx.registry"; +import * as _374 from "./authz/v1beta1/tx.registry"; +import * as _375 from "./bank/v1beta1/tx.registry"; +import * as _376 from "./distribution/v1beta1/tx.registry"; +import * as _377 from "./feegrant/v1beta1/tx.registry"; +import * as _378 from "./gov/v1/tx.registry"; +import * as _379 from "./gov/v1beta1/tx.registry"; +import * as _380 from "./mint/v1beta1/tx.registry"; +import * as _381 from "./slashing/v1beta1/tx.registry"; +import * as _382 from "./staking/v1beta1/tx.registry"; +import * as _383 from "./upgrade/v1beta1/tx.registry"; +import * as _384 from "./adminmodule/adminmodule/query.rpc.Query"; +import * as _385 from "./auth/v1beta1/query.rpc.Query"; +import * as _386 from "./authz/v1beta1/query.rpc.Query"; +import * as _387 from "./bank/v1beta1/query.rpc.Query"; +import * as _388 from "./base/tendermint/v1beta1/query.rpc.Service"; +import * as _389 from "./distribution/v1beta1/query.rpc.Query"; +import * as _390 from "./feegrant/v1beta1/query.rpc.Query"; +import * as _391 from "./gov/v1/query.rpc.Query"; +import * as _392 from "./gov/v1beta1/query.rpc.Query"; +import * as _393 from "./mint/v1beta1/query.rpc.Query"; +import * as _394 from "./params/v1beta1/query.rpc.Query"; +import * as _395 from "./slashing/v1beta1/query.rpc.Query"; +import * as _396 from "./staking/v1beta1/query.rpc.Query"; +import * as _397 from "./tx/v1beta1/service.rpc.Service"; +import * as _398 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _399 from "./adminmodule/adminmodule/tx.rpc.msg"; +import * as _400 from "./auth/v1beta1/tx.rpc.msg"; +import * as _401 from "./authz/v1beta1/tx.rpc.msg"; +import * as _402 from "./bank/v1beta1/tx.rpc.msg"; +import * as _403 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _404 from "./feegrant/v1beta1/tx.rpc.msg"; +import * as _405 from "./gov/v1/tx.rpc.msg"; +import * as _406 from "./gov/v1beta1/tx.rpc.msg"; +import * as _407 from "./mint/v1beta1/tx.rpc.msg"; +import * as _408 from "./slashing/v1beta1/tx.rpc.msg"; +import * as _409 from "./staking/v1beta1/tx.rpc.msg"; +import * as _410 from "./upgrade/v1beta1/tx.rpc.msg"; +import * as _592 from "./rpc.query"; +import * as _593 from "./rpc.tx"; export namespace cosmos { export namespace adminmodule { export const adminmodule = { - ..._28, ..._29, ..._30, - ..._356, - ..._368, - ..._380, - ..._395 + ..._31, + ..._360, + ..._372, + ..._384, + ..._399 }; } export namespace auth { export const v1beta1 = { - ..._31, ..._32, ..._33, ..._34, - ..._357, - ..._369, - ..._381, - ..._396 + ..._35, + ..._361, + ..._373, + ..._385, + ..._400 }; } export namespace authz { export const v1beta1 = { - ..._35, ..._36, ..._37, ..._38, ..._39, - ..._358, - ..._370, - ..._382, - ..._397 + ..._40, + ..._362, + ..._374, + ..._386, + ..._401 }; } export namespace bank { export const v1beta1 = { - ..._40, ..._41, ..._42, ..._43, ..._44, - ..._359, - ..._371, - ..._383, - ..._398 + ..._45, + ..._363, + ..._375, + ..._387, + ..._402 }; } export namespace base { export namespace abci { export const v1beta1 = { - ..._45 + ..._46 }; } export namespace query { export const v1beta1 = { - ..._46 + ..._47 }; } export namespace tendermint { export const v1beta1 = { - ..._47, ..._48, - ..._384 + ..._49, + ..._388 }; } export const v1beta1 = { - ..._49 + ..._50 }; } export namespace crypto { export const ed25519 = { - ..._50 + ..._51 }; export const multisig = { - ..._51 + ..._52 }; export const secp256k1 = { - ..._52 + ..._53 }; } export namespace distribution { export const v1beta1 = { - ..._53, ..._54, ..._55, ..._56, - ..._360, - ..._372, - ..._385, - ..._399 + ..._57, + ..._364, + ..._376, + ..._389, + ..._403 }; } export namespace feegrant { export const v1beta1 = { - ..._57, ..._58, ..._59, ..._60, - ..._361, - ..._373, - ..._386, - ..._400 + ..._61, + ..._365, + ..._377, + ..._390, + ..._404 }; } export namespace gov { export const v1 = { - ..._61, ..._62, ..._63, ..._64, - ..._362, - ..._374, - ..._387, - ..._401 + ..._65, + ..._366, + ..._378, + ..._391, + ..._405 }; export const v1beta1 = { - ..._65, ..._66, ..._67, ..._68, - ..._363, - ..._375, - ..._388, - ..._402 + ..._69, + ..._367, + ..._379, + ..._392, + ..._406 }; } export namespace mint { export const v1beta1 = { - ..._69, ..._70, ..._71, ..._72, - ..._364, - ..._376, - ..._389, - ..._403 + ..._73, + ..._368, + ..._380, + ..._393, + ..._407 }; } export namespace msg { export const v1 = { - ..._73 + ..._74 }; } export namespace orm { export const v1 = { - ..._74 + ..._75 }; } export namespace params { export const v1beta1 = { - ..._75, ..._76, - ..._390 + ..._77, + ..._394 }; } export namespace query { export const v1 = { - ..._77 + ..._78 }; } export namespace slashing { export const v1beta1 = { - ..._78, ..._79, ..._80, ..._81, - ..._365, - ..._377, - ..._391, - ..._404 + ..._82, + ..._369, + ..._381, + ..._395, + ..._408 }; } export namespace staking { export const v1beta1 = { - ..._82, ..._83, ..._84, ..._85, ..._86, - ..._366, - ..._378, - ..._392, - ..._405 + ..._87, + ..._370, + ..._382, + ..._396, + ..._409 }; } export namespace tx { export namespace signing { export const v1beta1 = { - ..._87 + ..._88 }; } export const v1beta1 = { - ..._88, ..._89, - ..._393 + ..._90, + ..._397 }; } export namespace upgrade { export const v1beta1 = { - ..._90, ..._91, ..._92, - ..._367, - ..._379, - ..._394, - ..._406 + ..._93, + ..._371, + ..._383, + ..._398, + ..._410 }; } export const ClientFactory = { - ..._587, - ..._588 + ..._592, + ..._593 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos_proto/bundle.ts b/packages/types/protobuf/codegen/cosmos_proto/bundle.ts index 67740e390..8bb0b2c6d 100644 --- a/packages/types/protobuf/codegen/cosmos_proto/bundle.ts +++ b/packages/types/protobuf/codegen/cosmos_proto/bundle.ts @@ -1,4 +1,4 @@ -import * as _27 from "./cosmos"; +import * as _28 from "./cosmos"; export const cosmos_proto = { - ..._27 + ..._28 }; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmwasm/bundle.ts b/packages/types/protobuf/codegen/cosmwasm/bundle.ts index 68c300e6c..d6176e77d 100644 --- a/packages/types/protobuf/codegen/cosmwasm/bundle.ts +++ b/packages/types/protobuf/codegen/cosmwasm/bundle.ts @@ -1,56 +1,56 @@ -import * as _93 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _94 from "./tokenfactory/v1beta1/genesis"; -import * as _95 from "./tokenfactory/v1beta1/params"; -import * as _96 from "./tokenfactory/v1beta1/query"; -import * as _97 from "./tokenfactory/v1beta1/tx"; -import * as _98 from "./wasm/v1/authz"; -import * as _99 from "./wasm/v1/genesis"; -import * as _100 from "./wasm/v1/ibc"; -import * as _101 from "./wasm/v1/proposal"; -import * as _102 from "./wasm/v1/query"; -import * as _103 from "./wasm/v1/tx"; -import * as _104 from "./wasm/v1/types"; -import * as _407 from "./tokenfactory/v1beta1/tx.amino"; -import * as _408 from "./wasm/v1/tx.amino"; -import * as _409 from "./tokenfactory/v1beta1/tx.registry"; -import * as _410 from "./wasm/v1/tx.registry"; -import * as _411 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _412 from "./wasm/v1/query.rpc.Query"; -import * as _413 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _414 from "./wasm/v1/tx.rpc.msg"; -import * as _589 from "./rpc.query"; -import * as _590 from "./rpc.tx"; +import * as _94 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _95 from "./tokenfactory/v1beta1/genesis"; +import * as _96 from "./tokenfactory/v1beta1/params"; +import * as _97 from "./tokenfactory/v1beta1/query"; +import * as _98 from "./tokenfactory/v1beta1/tx"; +import * as _99 from "./wasm/v1/authz"; +import * as _100 from "./wasm/v1/genesis"; +import * as _101 from "./wasm/v1/ibc"; +import * as _102 from "./wasm/v1/proposal"; +import * as _103 from "./wasm/v1/query"; +import * as _104 from "./wasm/v1/tx"; +import * as _105 from "./wasm/v1/types"; +import * as _411 from "./tokenfactory/v1beta1/tx.amino"; +import * as _412 from "./wasm/v1/tx.amino"; +import * as _413 from "./tokenfactory/v1beta1/tx.registry"; +import * as _414 from "./wasm/v1/tx.registry"; +import * as _415 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _416 from "./wasm/v1/query.rpc.Query"; +import * as _417 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _418 from "./wasm/v1/tx.rpc.msg"; +import * as _594 from "./rpc.query"; +import * as _595 from "./rpc.tx"; export namespace cosmwasm { export namespace tokenfactory { export const v1beta1 = { - ..._93, ..._94, ..._95, ..._96, ..._97, - ..._407, - ..._409, + ..._98, ..._411, - ..._413 + ..._413, + ..._415, + ..._417 }; } export namespace wasm { export const v1 = { - ..._98, ..._99, ..._100, ..._101, ..._102, ..._103, ..._104, - ..._408, - ..._410, + ..._105, ..._412, - ..._414 + ..._414, + ..._416, + ..._418 }; } export const ClientFactory = { - ..._589, - ..._590 + ..._594, + ..._595 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/gaia/bundle.ts b/packages/types/protobuf/codegen/gaia/bundle.ts index 5d03554b4..ad0e1c6ea 100644 --- a/packages/types/protobuf/codegen/gaia/bundle.ts +++ b/packages/types/protobuf/codegen/gaia/bundle.ts @@ -1,26 +1,26 @@ -import * as _105 from "./globalfee/v1beta1/genesis"; -import * as _106 from "./globalfee/v1beta1/query"; -import * as _107 from "./globalfee/v1beta1/tx"; -import * as _415 from "./globalfee/v1beta1/tx.amino"; -import * as _416 from "./globalfee/v1beta1/tx.registry"; -import * as _417 from "./globalfee/v1beta1/query.rpc.Query"; -import * as _418 from "./globalfee/v1beta1/tx.rpc.msg"; -import * as _591 from "./rpc.query"; -import * as _592 from "./rpc.tx"; +import * as _106 from "./globalfee/v1beta1/genesis"; +import * as _107 from "./globalfee/v1beta1/query"; +import * as _108 from "./globalfee/v1beta1/tx"; +import * as _419 from "./globalfee/v1beta1/tx.amino"; +import * as _420 from "./globalfee/v1beta1/tx.registry"; +import * as _421 from "./globalfee/v1beta1/query.rpc.Query"; +import * as _422 from "./globalfee/v1beta1/tx.rpc.msg"; +import * as _596 from "./rpc.query"; +import * as _597 from "./rpc.tx"; export namespace gaia { export namespace globalfee { export const v1beta1 = { - ..._105, ..._106, ..._107, - ..._415, - ..._416, - ..._417, - ..._418 + ..._108, + ..._419, + ..._420, + ..._421, + ..._422 }; } export const ClientFactory = { - ..._591, - ..._592 + ..._596, + ..._597 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/gogoproto/bundle.ts b/packages/types/protobuf/codegen/gogoproto/bundle.ts index 2c41b17a8..3be6436d1 100644 --- a/packages/types/protobuf/codegen/gogoproto/bundle.ts +++ b/packages/types/protobuf/codegen/gogoproto/bundle.ts @@ -1,4 +1,4 @@ -import * as _108 from "./gogo"; +import * as _109 from "./gogo"; export const gogoproto = { - ..._108 + ..._109 }; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/google/bundle.ts b/packages/types/protobuf/codegen/google/bundle.ts index 543e4efe9..622f2650e 100644 --- a/packages/types/protobuf/codegen/google/bundle.ts +++ b/packages/types/protobuf/codegen/google/bundle.ts @@ -1,20 +1,20 @@ -import * as _109 from "./api/annotations"; -import * as _110 from "./api/http"; -import * as _111 from "./protobuf/any"; -import * as _112 from "./protobuf/descriptor"; -import * as _113 from "./protobuf/duration"; -import * as _114 from "./protobuf/empty"; -import * as _115 from "./protobuf/timestamp"; +import * as _110 from "./api/annotations"; +import * as _111 from "./api/http"; +import * as _112 from "./protobuf/any"; +import * as _113 from "./protobuf/descriptor"; +import * as _114 from "./protobuf/duration"; +import * as _115 from "./protobuf/empty"; +import * as _116 from "./protobuf/timestamp"; export namespace google { export const api = { - ..._109, - ..._110 + ..._110, + ..._111 }; export const protobuf = { - ..._111, ..._112, ..._113, ..._114, - ..._115 + ..._115, + ..._116 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/bundle.ts b/packages/types/protobuf/codegen/ibc/bundle.ts index ea7fc9129..a1b279ec2 100644 --- a/packages/types/protobuf/codegen/ibc/bundle.ts +++ b/packages/types/protobuf/codegen/ibc/bundle.ts @@ -1,120 +1,120 @@ -import * as _116 from "./applications/interchain_accounts/controller/v1/controller"; -import * as _117 from "./applications/interchain_accounts/controller/v1/query"; -import * as _118 from "./applications/interchain_accounts/controller/v1/tx"; -import * as _119 from "./applications/interchain_accounts/host/v1/host"; -import * as _120 from "./applications/interchain_accounts/host/v1/query"; -import * as _121 from "./applications/interchain_accounts/host/v1/tx"; -import * as _122 from "./applications/interchain_accounts/v1/account"; -import * as _123 from "./applications/interchain_accounts/v1/metadata"; -import * as _124 from "./applications/interchain_accounts/v1/packet"; -import * as _125 from "./applications/transfer/v1/authz"; -import * as _126 from "./applications/transfer/v1/genesis"; -import * as _127 from "./applications/transfer/v1/query"; -import * as _128 from "./applications/transfer/v1/transfer"; -import * as _129 from "./applications/transfer/v1/tx"; -import * as _130 from "./core/channel/v1/channel"; -import * as _131 from "./core/channel/v1/genesis"; -import * as _132 from "./core/channel/v1/query"; -import * as _133 from "./core/channel/v1/tx"; -import * as _134 from "./core/client/v1/client"; -import * as _135 from "./core/client/v1/genesis"; -import * as _136 from "./core/client/v1/query"; -import * as _137 from "./core/client/v1/tx"; -import * as _419 from "./applications/interchain_accounts/controller/v1/tx.amino"; -import * as _420 from "./applications/interchain_accounts/host/v1/tx.amino"; -import * as _421 from "./applications/transfer/v1/tx.amino"; -import * as _422 from "./core/channel/v1/tx.amino"; -import * as _423 from "./core/client/v1/tx.amino"; -import * as _424 from "./applications/interchain_accounts/controller/v1/tx.registry"; -import * as _425 from "./applications/interchain_accounts/host/v1/tx.registry"; -import * as _426 from "./applications/transfer/v1/tx.registry"; -import * as _427 from "./core/channel/v1/tx.registry"; -import * as _428 from "./core/client/v1/tx.registry"; -import * as _429 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; -import * as _430 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; -import * as _431 from "./applications/transfer/v1/query.rpc.Query"; -import * as _432 from "./core/channel/v1/query.rpc.Query"; -import * as _433 from "./core/client/v1/query.rpc.Query"; -import * as _434 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; -import * as _435 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; -import * as _436 from "./applications/transfer/v1/tx.rpc.msg"; -import * as _437 from "./core/channel/v1/tx.rpc.msg"; -import * as _438 from "./core/client/v1/tx.rpc.msg"; -import * as _593 from "./rpc.query"; -import * as _594 from "./rpc.tx"; +import * as _117 from "./applications/interchain_accounts/controller/v1/controller"; +import * as _118 from "./applications/interchain_accounts/controller/v1/query"; +import * as _119 from "./applications/interchain_accounts/controller/v1/tx"; +import * as _120 from "./applications/interchain_accounts/host/v1/host"; +import * as _121 from "./applications/interchain_accounts/host/v1/query"; +import * as _122 from "./applications/interchain_accounts/host/v1/tx"; +import * as _123 from "./applications/interchain_accounts/v1/account"; +import * as _124 from "./applications/interchain_accounts/v1/metadata"; +import * as _125 from "./applications/interchain_accounts/v1/packet"; +import * as _126 from "./applications/transfer/v1/authz"; +import * as _127 from "./applications/transfer/v1/genesis"; +import * as _128 from "./applications/transfer/v1/query"; +import * as _129 from "./applications/transfer/v1/transfer"; +import * as _130 from "./applications/transfer/v1/tx"; +import * as _131 from "./core/channel/v1/channel"; +import * as _132 from "./core/channel/v1/genesis"; +import * as _133 from "./core/channel/v1/query"; +import * as _134 from "./core/channel/v1/tx"; +import * as _135 from "./core/client/v1/client"; +import * as _136 from "./core/client/v1/genesis"; +import * as _137 from "./core/client/v1/query"; +import * as _138 from "./core/client/v1/tx"; +import * as _423 from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as _424 from "./applications/interchain_accounts/host/v1/tx.amino"; +import * as _425 from "./applications/transfer/v1/tx.amino"; +import * as _426 from "./core/channel/v1/tx.amino"; +import * as _427 from "./core/client/v1/tx.amino"; +import * as _428 from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as _429 from "./applications/interchain_accounts/host/v1/tx.registry"; +import * as _430 from "./applications/transfer/v1/tx.registry"; +import * as _431 from "./core/channel/v1/tx.registry"; +import * as _432 from "./core/client/v1/tx.registry"; +import * as _433 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; +import * as _434 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; +import * as _435 from "./applications/transfer/v1/query.rpc.Query"; +import * as _436 from "./core/channel/v1/query.rpc.Query"; +import * as _437 from "./core/client/v1/query.rpc.Query"; +import * as _438 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; +import * as _439 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; +import * as _440 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _441 from "./core/channel/v1/tx.rpc.msg"; +import * as _442 from "./core/client/v1/tx.rpc.msg"; +import * as _598 from "./rpc.query"; +import * as _599 from "./rpc.tx"; export namespace ibc { export namespace applications { export namespace interchain_accounts { export namespace controller { export const v1 = { - ..._116, ..._117, ..._118, - ..._419, - ..._424, - ..._429, - ..._434 + ..._119, + ..._423, + ..._428, + ..._433, + ..._438 }; } export namespace host { export const v1 = { - ..._119, ..._120, ..._121, - ..._420, - ..._425, - ..._430, - ..._435 + ..._122, + ..._424, + ..._429, + ..._434, + ..._439 }; } export const v1 = { - ..._122, ..._123, - ..._124 + ..._124, + ..._125 }; } export namespace transfer { export const v1 = { - ..._125, ..._126, ..._127, ..._128, ..._129, - ..._421, - ..._426, - ..._431, - ..._436 + ..._130, + ..._425, + ..._430, + ..._435, + ..._440 }; } } export namespace core { export namespace channel { export const v1 = { - ..._130, ..._131, ..._132, ..._133, - ..._422, - ..._427, - ..._432, - ..._437 + ..._134, + ..._426, + ..._431, + ..._436, + ..._441 }; } export namespace client { export const v1 = { - ..._134, ..._135, ..._136, ..._137, - ..._423, - ..._428, - ..._433, - ..._438 + ..._138, + ..._427, + ..._432, + ..._437, + ..._442 }; } } export const ClientFactory = { - ..._593, - ..._594 + ..._598, + ..._599 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/index.ts b/packages/types/protobuf/codegen/index.ts index edc498ca6..3092c4c96 100644 --- a/packages/types/protobuf/codegen/index.ts +++ b/packages/types/protobuf/codegen/index.ts @@ -7,6 +7,8 @@ export * from "./alliance/bundle"; export * from "./alliance/client"; export * from "./amino/bundle"; +export * from "./bitsong/bundle"; +export * from "./bitsong/client"; export * from "./circle/bundle"; export * from "./circle/client"; export * from "./cosmos_proto/bundle"; diff --git a/packages/types/protobuf/codegen/juno/bundle.ts b/packages/types/protobuf/codegen/juno/bundle.ts index a5dc2540b..99890e8f7 100644 --- a/packages/types/protobuf/codegen/juno/bundle.ts +++ b/packages/types/protobuf/codegen/juno/bundle.ts @@ -1,46 +1,46 @@ -import * as _138 from "./feeshare/v1/feeshare"; -import * as _139 from "./feeshare/v1/genesis"; -import * as _140 from "./feeshare/v1/query"; -import * as _141 from "./feeshare/v1/tx"; -import * as _142 from "./mint/genesis"; -import * as _143 from "./mint/mint"; -import * as _144 from "./mint/query"; -import * as _145 from "./mint/tx"; -import * as _439 from "./feeshare/v1/tx.amino"; -import * as _440 from "./mint/tx.amino"; -import * as _441 from "./feeshare/v1/tx.registry"; -import * as _442 from "./mint/tx.registry"; -import * as _443 from "./feeshare/v1/query.rpc.Query"; -import * as _444 from "./mint/query.rpc.Query"; -import * as _445 from "./feeshare/v1/tx.rpc.msg"; -import * as _446 from "./mint/tx.rpc.msg"; -import * as _595 from "./rpc.query"; -import * as _596 from "./rpc.tx"; +import * as _139 from "./feeshare/v1/feeshare"; +import * as _140 from "./feeshare/v1/genesis"; +import * as _141 from "./feeshare/v1/query"; +import * as _142 from "./feeshare/v1/tx"; +import * as _143 from "./mint/genesis"; +import * as _144 from "./mint/mint"; +import * as _145 from "./mint/query"; +import * as _146 from "./mint/tx"; +import * as _443 from "./feeshare/v1/tx.amino"; +import * as _444 from "./mint/tx.amino"; +import * as _445 from "./feeshare/v1/tx.registry"; +import * as _446 from "./mint/tx.registry"; +import * as _447 from "./feeshare/v1/query.rpc.Query"; +import * as _448 from "./mint/query.rpc.Query"; +import * as _449 from "./feeshare/v1/tx.rpc.msg"; +import * as _450 from "./mint/tx.rpc.msg"; +import * as _600 from "./rpc.query"; +import * as _601 from "./rpc.tx"; export namespace juno { export namespace feeshare { export const v1 = { - ..._138, ..._139, ..._140, ..._141, - ..._439, - ..._441, + ..._142, ..._443, - ..._445 + ..._445, + ..._447, + ..._449 }; } export const mint = { - ..._142, ..._143, ..._144, ..._145, - ..._440, - ..._442, + ..._146, ..._444, - ..._446 + ..._446, + ..._448, + ..._450 }; export const ClientFactory = { - ..._595, - ..._596 + ..._600, + ..._601 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/bundle.ts b/packages/types/protobuf/codegen/kujira/bundle.ts index 0593a3180..c69a08947 100644 --- a/packages/types/protobuf/codegen/kujira/bundle.ts +++ b/packages/types/protobuf/codegen/kujira/bundle.ts @@ -1,60 +1,60 @@ -import * as _146 from "./denom/authorityMetadata"; -import * as _147 from "./denom/genesis"; -import * as _148 from "./denom/params"; -import * as _149 from "./denom/query"; -import * as _150 from "./denom/tx"; -import * as _151 from "./oracle/genesis"; -import * as _152 from "./oracle/oracle"; -import * as _153 from "./oracle/query"; -import * as _154 from "./oracle/tx"; -import * as _155 from "./scheduler/genesis"; -import * as _156 from "./scheduler/hook"; -import * as _157 from "./scheduler/params"; -import * as _158 from "./scheduler/proposal"; -import * as _159 from "./scheduler/query"; -import * as _447 from "./denom/tx.amino"; -import * as _448 from "./oracle/tx.amino"; -import * as _449 from "./denom/tx.registry"; -import * as _450 from "./oracle/tx.registry"; -import * as _451 from "./denom/query.rpc.Query"; -import * as _452 from "./oracle/query.rpc.Query"; -import * as _453 from "./scheduler/query.rpc.Query"; -import * as _454 from "./denom/tx.rpc.msg"; -import * as _455 from "./oracle/tx.rpc.msg"; -import * as _597 from "./rpc.query"; -import * as _598 from "./rpc.tx"; +import * as _147 from "./denom/authorityMetadata"; +import * as _148 from "./denom/genesis"; +import * as _149 from "./denom/params"; +import * as _150 from "./denom/query"; +import * as _151 from "./denom/tx"; +import * as _152 from "./oracle/genesis"; +import * as _153 from "./oracle/oracle"; +import * as _154 from "./oracle/query"; +import * as _155 from "./oracle/tx"; +import * as _156 from "./scheduler/genesis"; +import * as _157 from "./scheduler/hook"; +import * as _158 from "./scheduler/params"; +import * as _159 from "./scheduler/proposal"; +import * as _160 from "./scheduler/query"; +import * as _451 from "./denom/tx.amino"; +import * as _452 from "./oracle/tx.amino"; +import * as _453 from "./denom/tx.registry"; +import * as _454 from "./oracle/tx.registry"; +import * as _455 from "./denom/query.rpc.Query"; +import * as _456 from "./oracle/query.rpc.Query"; +import * as _457 from "./scheduler/query.rpc.Query"; +import * as _458 from "./denom/tx.rpc.msg"; +import * as _459 from "./oracle/tx.rpc.msg"; +import * as _602 from "./rpc.query"; +import * as _603 from "./rpc.tx"; export namespace kujira { export const denom = { - ..._146, ..._147, ..._148, ..._149, ..._150, - ..._447, - ..._449, + ..._151, ..._451, - ..._454 + ..._453, + ..._455, + ..._458 }; export const oracle = { - ..._151, ..._152, ..._153, ..._154, - ..._448, - ..._450, + ..._155, ..._452, - ..._455 + ..._454, + ..._456, + ..._459 }; export const scheduler = { - ..._155, ..._156, ..._157, ..._158, ..._159, - ..._453 + ..._160, + ..._457 }; export const ClientFactory = { - ..._597, - ..._598 + ..._602, + ..._603 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/neutron/bundle.ts b/packages/types/protobuf/codegen/neutron/bundle.ts index 65299c457..1a43d1408 100644 --- a/packages/types/protobuf/codegen/neutron/bundle.ts +++ b/packages/types/protobuf/codegen/neutron/bundle.ts @@ -1,86 +1,85 @@ -import * as _160 from "./contractmanager/v1/failure"; -import * as _161 from "./cron/genesis"; -import * as _162 from "./cron/params"; -import * as _163 from "./cron/query"; -import * as _164 from "./cron/schedule"; -import * as _165 from "./cron/tx"; -import * as _166 from "./dex/deposit_record"; -import * as _167 from "./dex/genesis"; -import * as _168 from "./dex/limit_order_expiration"; -import * as _169 from "./dex/limit_order_tranche_user"; -import * as _170 from "./dex/limit_order_tranche"; -import * as _171 from "./dex/pair_id"; -import * as _172 from "./dex/params"; -import * as _173 from "./dex/pool_metadata"; -import * as _174 from "./dex/pool_reserves"; -import * as _175 from "./dex/pool"; -import * as _176 from "./dex/query"; -import * as _177 from "./dex/tick_liquidity"; -import * as _178 from "./dex/trade_pair_id"; -import * as _179 from "./dex/tx"; -import * as _180 from "./feeburner/genesis"; -import * as _181 from "./feeburner/params"; -import * as _182 from "./feeburner/query"; -import * as _183 from "./feeburner/total_burned_neutrons_amount"; -import * as _184 from "./feeburner/tx"; -import * as _185 from "./feerefunder/fee"; -import * as _186 from "./feerefunder/genesis"; -import * as _187 from "./feerefunder/params"; -import * as _188 from "./feerefunder/query"; -import * as _189 from "./feerefunder/tx"; -import * as _190 from "./interchainqueries/genesis"; -import * as _191 from "./interchainqueries/params"; -import * as _192 from "./interchainqueries/query"; -import * as _193 from "./interchainqueries/tx"; -import * as _194 from "./interchaintxs/v1/genesis"; -import * as _195 from "./interchaintxs/v1/params"; -import * as _196 from "./interchaintxs/v1/query"; -import * as _197 from "./interchaintxs/v1/tx"; -import * as _456 from "./cron/tx.amino"; -import * as _457 from "./dex/tx.amino"; -import * as _458 from "./feeburner/tx.amino"; -import * as _459 from "./feerefunder/tx.amino"; -import * as _460 from "./interchainqueries/tx.amino"; -import * as _461 from "./interchaintxs/v1/tx.amino"; -import * as _462 from "./cron/tx.registry"; -import * as _463 from "./dex/tx.registry"; -import * as _464 from "./feeburner/tx.registry"; -import * as _465 from "./feerefunder/tx.registry"; -import * as _466 from "./interchainqueries/tx.registry"; -import * as _467 from "./interchaintxs/v1/tx.registry"; -import * as _468 from "./cron/query.rpc.Query"; -import * as _469 from "./dex/query.rpc.Query"; -import * as _470 from "./feeburner/query.rpc.Query"; -import * as _471 from "./feerefunder/query.rpc.Query"; -import * as _472 from "./interchainqueries/query.rpc.Query"; -import * as _473 from "./interchaintxs/v1/query.rpc.Query"; -import * as _474 from "./cron/tx.rpc.msg"; -import * as _475 from "./dex/tx.rpc.msg"; -import * as _476 from "./feeburner/tx.rpc.msg"; -import * as _477 from "./feerefunder/tx.rpc.msg"; -import * as _478 from "./interchainqueries/tx.rpc.msg"; -import * as _479 from "./interchaintxs/v1/tx.rpc.msg"; -import * as _599 from "./rpc.query"; -import * as _600 from "./rpc.tx"; +import * as _161 from "./contractmanager/v1/failure"; +import * as _162 from "./cron/genesis"; +import * as _163 from "./cron/params"; +import * as _164 from "./cron/query"; +import * as _165 from "./cron/schedule"; +import * as _166 from "./cron/tx"; +import * as _167 from "./dex/deposit_record"; +import * as _168 from "./dex/genesis"; +import * as _169 from "./dex/limit_order_expiration"; +import * as _170 from "./dex/limit_order_tranche_user"; +import * as _171 from "./dex/limit_order_tranche"; +import * as _172 from "./dex/pair_id"; +import * as _173 from "./dex/params"; +import * as _174 from "./dex/pool_metadata"; +import * as _175 from "./dex/pool_reserves"; +import * as _176 from "./dex/pool"; +import * as _177 from "./dex/query"; +import * as _178 from "./dex/tick_liquidity"; +import * as _179 from "./dex/trade_pair_id"; +import * as _180 from "./dex/tx"; +import * as _181 from "./feeburner/genesis"; +import * as _182 from "./feeburner/params"; +import * as _183 from "./feeburner/query"; +import * as _184 from "./feeburner/total_burned_neutrons_amount"; +import * as _185 from "./feeburner/tx"; +import * as _186 from "./feerefunder/fee"; +import * as _187 from "./feerefunder/genesis"; +import * as _188 from "./feerefunder/params"; +import * as _189 from "./feerefunder/query"; +import * as _190 from "./feerefunder/tx"; +import * as _191 from "./interchainqueries/genesis"; +import * as _192 from "./interchainqueries/params"; +import * as _193 from "./interchainqueries/query"; +import * as _194 from "./interchainqueries/tx"; +import * as _195 from "./interchaintxs/v1/genesis"; +import * as _196 from "./interchaintxs/v1/params"; +import * as _197 from "./interchaintxs/v1/query"; +import * as _198 from "./interchaintxs/v1/tx"; +import * as _460 from "./cron/tx.amino"; +import * as _461 from "./dex/tx.amino"; +import * as _462 from "./feeburner/tx.amino"; +import * as _463 from "./feerefunder/tx.amino"; +import * as _464 from "./interchainqueries/tx.amino"; +import * as _465 from "./interchaintxs/v1/tx.amino"; +import * as _466 from "./cron/tx.registry"; +import * as _467 from "./dex/tx.registry"; +import * as _468 from "./feeburner/tx.registry"; +import * as _469 from "./feerefunder/tx.registry"; +import * as _470 from "./interchainqueries/tx.registry"; +import * as _471 from "./interchaintxs/v1/tx.registry"; +import * as _472 from "./cron/query.rpc.Query"; +import * as _473 from "./dex/query.rpc.Query"; +import * as _474 from "./feeburner/query.rpc.Query"; +import * as _475 from "./feerefunder/query.rpc.Query"; +import * as _476 from "./interchainqueries/query.rpc.Query"; +import * as _477 from "./interchaintxs/v1/query.rpc.Query"; +import * as _478 from "./cron/tx.rpc.msg"; +import * as _479 from "./dex/tx.rpc.msg"; +import * as _480 from "./feeburner/tx.rpc.msg"; +import * as _481 from "./feerefunder/tx.rpc.msg"; +import * as _482 from "./interchainqueries/tx.rpc.msg"; +import * as _483 from "./interchaintxs/v1/tx.rpc.msg"; +import * as _604 from "./rpc.query"; +import * as _605 from "./rpc.tx"; export namespace neutron { export namespace contractmanager { export const v1 = { - ..._160 + ..._161 }; } export const cron = { - ..._161, ..._162, ..._163, ..._164, ..._165, - ..._456, - ..._462, - ..._468, - ..._474 + ..._166, + ..._460, + ..._466, + ..._472, + ..._478 }; export const dex = { - ..._166, ..._167, ..._168, ..._169, @@ -94,57 +93,58 @@ export namespace neutron { ..._177, ..._178, ..._179, - ..._457, - ..._463, - ..._469, - ..._475 + ..._180, + ..._461, + ..._467, + ..._473, + ..._479 }; export const feeburner = { - ..._180, ..._181, ..._182, ..._183, ..._184, - ..._458, - ..._464, - ..._470, - ..._476 + ..._185, + ..._462, + ..._468, + ..._474, + ..._480 }; export const feerefunder = { - ..._185, ..._186, ..._187, ..._188, ..._189, - ..._459, - ..._465, - ..._471, - ..._477 + ..._190, + ..._463, + ..._469, + ..._475, + ..._481 }; export const interchainqueries = { - ..._190, ..._191, ..._192, ..._193, - ..._460, - ..._466, - ..._472, - ..._478 + ..._194, + ..._464, + ..._470, + ..._476, + ..._482 }; export namespace interchaintxs { export const v1 = { - ..._194, ..._195, ..._196, ..._197, - ..._461, - ..._467, - ..._473, - ..._479 + ..._198, + ..._465, + ..._471, + ..._477, + ..._483 }; } export const ClientFactory = { - ..._599, - ..._600 + ..._604, + ..._605 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/noble/bundle.ts b/packages/types/protobuf/codegen/noble/bundle.ts index aabc4ea37..cfaf40dc4 100644 --- a/packages/types/protobuf/codegen/noble/bundle.ts +++ b/packages/types/protobuf/codegen/noble/bundle.ts @@ -1,16 +1,16 @@ -import * as _335 from "../tariff/genesis"; -import * as _336 from "../tariff/params"; -import * as _337 from "../tariff/query"; -import * as _582 from "../tariff/query.rpc.Query"; -import * as _609 from "./rpc.query"; +import * as _336 from "../tariff/genesis"; +import * as _337 from "../tariff/params"; +import * as _338 from "../tariff/query"; +import * as _586 from "../tariff/query.rpc.Query"; +import * as _614 from "./rpc.query"; export namespace noble { export const tariff = { - ..._335, ..._336, ..._337, - ..._582 + ..._338, + ..._586 }; export const ClientFactory = { - ..._609 + ..._614 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/bundle.ts b/packages/types/protobuf/codegen/osmosis/bundle.ts index 96a5b9f02..13b174f3e 100644 --- a/packages/types/protobuf/codegen/osmosis/bundle.ts +++ b/packages/types/protobuf/codegen/osmosis/bundle.ts @@ -1,154 +1,153 @@ -import * as _198 from "./accum/v1beta1/accum"; -import * as _199 from "./concentratedliquidity/params"; -import * as _200 from "./cosmwasmpool/v1beta1/genesis"; -import * as _201 from "./cosmwasmpool/v1beta1/gov"; -import * as _202 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; -import * as _203 from "./cosmwasmpool/v1beta1/model/module_query_msg"; -import * as _204 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; -import * as _205 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; -import * as _206 from "./cosmwasmpool/v1beta1/model/pool"; -import * as _207 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; -import * as _208 from "./cosmwasmpool/v1beta1/model/tx"; -import * as _209 from "./cosmwasmpool/v1beta1/params"; -import * as _210 from "./cosmwasmpool/v1beta1/query"; -import * as _211 from "./cosmwasmpool/v1beta1/tx"; -import * as _212 from "./gamm/pool-models/balancer/balancerPool"; -import * as _213 from "./gamm/v1beta1/genesis"; -import * as _214 from "./gamm/v1beta1/gov"; -import * as _215 from "./gamm/v1beta1/query"; -import * as _216 from "./gamm/v1beta1/shared"; -import * as _217 from "./gamm/v1beta1/tx"; -import * as _218 from "./gamm/pool-models/balancer/tx/tx"; -import * as _219 from "./gamm/pool-models/stableswap/stableswap_pool"; -import * as _220 from "./gamm/pool-models/stableswap/tx"; -import * as _221 from "./incentives/gauge"; -import * as _222 from "./incentives/genesis"; -import * as _223 from "./incentives/gov"; -import * as _224 from "./incentives/group"; -import * as _225 from "./incentives/params"; -import * as _226 from "./incentives/query"; -import * as _227 from "./incentives/tx"; -import * as _228 from "./lockup/genesis"; -import * as _229 from "./lockup/lock"; -import * as _230 from "./lockup/params"; -import * as _231 from "./lockup/query"; -import * as _232 from "./lockup/tx"; -import * as _233 from "./pool-incentives/v1beta1/genesis"; -import * as _234 from "./pool-incentives/v1beta1/gov"; -import * as _235 from "./pool-incentives/v1beta1/incentives"; -import * as _236 from "./pool-incentives/v1beta1/query"; -import * as _237 from "./pool-incentives/v1beta1/shared"; -import * as _238 from "./poolmanager/v1beta1/genesis"; -import * as _239 from "./poolmanager/v1beta1/gov"; -import * as _240 from "./poolmanager/v1beta1/module_route"; -import * as _241 from "./poolmanager/v1beta1/query"; -import * as _242 from "./poolmanager/v1beta1/swap_route"; -import * as _243 from "./poolmanager/v1beta1/tx"; -import * as _244 from "./protorev/v1beta1/genesis"; -import * as _245 from "./protorev/v1beta1/gov"; -import * as _246 from "./protorev/v1beta1/params"; -import * as _247 from "./protorev/v1beta1/protorev"; -import * as _248 from "./protorev/v1beta1/query"; -import * as _249 from "./protorev/v1beta1/tx"; -import * as _250 from "./superfluid/genesis"; -import * as _251 from "./superfluid/params"; -import * as _252 from "./superfluid/query"; -import * as _253 from "./superfluid/superfluid"; -import * as _254 from "./superfluid/tx"; -import * as _255 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _256 from "./tokenfactory/v1beta1/genesis"; -import * as _257 from "./tokenfactory/v1beta1/params"; -import * as _258 from "./tokenfactory/v1beta1/query"; -import * as _259 from "./tokenfactory/v1beta1/tx"; -import * as _260 from "./txfees/v1beta1/feetoken"; -import * as _261 from "./txfees/v1beta1/genesis"; -import * as _262 from "./txfees/v1beta1/gov"; -import * as _263 from "./txfees/v1beta1/params"; -import * as _264 from "./txfees/v1beta1/query"; -import * as _265 from "./txfees/v1beta1/tx"; -import * as _266 from "./valset-pref/v1beta1/query"; -import * as _267 from "./valset-pref/v1beta1/state"; -import * as _268 from "./valset-pref/v1beta1/tx"; -import * as _480 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; -import * as _481 from "./concentratedliquidity/v1beta1/tx.amino"; -import * as _482 from "./gamm/pool-models/balancer/tx/tx.amino"; -import * as _483 from "./gamm/pool-models/stableswap/tx.amino"; -import * as _484 from "./gamm/v1beta1/tx.amino"; -import * as _485 from "./incentives/tx.amino"; -import * as _486 from "./lockup/tx.amino"; -import * as _487 from "./poolmanager/v1beta1/tx.amino"; -import * as _488 from "./protorev/v1beta1/tx.amino"; -import * as _489 from "./superfluid/tx.amino"; -import * as _490 from "./tokenfactory/v1beta1/tx.amino"; -import * as _491 from "./txfees/v1beta1/tx.amino"; -import * as _492 from "./valset-pref/v1beta1/tx.amino"; -import * as _493 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; -import * as _494 from "./concentratedliquidity/v1beta1/tx.registry"; -import * as _495 from "./gamm/pool-models/balancer/tx/tx.registry"; -import * as _496 from "./gamm/pool-models/stableswap/tx.registry"; -import * as _497 from "./gamm/v1beta1/tx.registry"; -import * as _498 from "./incentives/tx.registry"; -import * as _499 from "./lockup/tx.registry"; -import * as _500 from "./poolmanager/v1beta1/tx.registry"; -import * as _501 from "./protorev/v1beta1/tx.registry"; -import * as _502 from "./superfluid/tx.registry"; -import * as _503 from "./tokenfactory/v1beta1/tx.registry"; -import * as _504 from "./txfees/v1beta1/tx.registry"; -import * as _505 from "./valset-pref/v1beta1/tx.registry"; -import * as _506 from "./concentratedliquidity/v1beta1/query.rpc.Query"; -import * as _507 from "./cosmwasmpool/v1beta1/query.rpc.Query"; -import * as _508 from "./gamm/v1beta1/query.rpc.Query"; -import * as _509 from "./incentives/query.rpc.Query"; -import * as _510 from "./lockup/query.rpc.Query"; -import * as _511 from "./pool-incentives/v1beta1/query.rpc.Query"; -import * as _512 from "./poolmanager/v1beta1/query.rpc.Query"; -import * as _513 from "./protorev/v1beta1/query.rpc.Query"; -import * as _514 from "./superfluid/query.rpc.Query"; -import * as _515 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _516 from "./txfees/v1beta1/query.rpc.Query"; -import * as _517 from "./valset-pref/v1beta1/query.rpc.Query"; -import * as _518 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; -import * as _519 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; -import * as _520 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; -import * as _521 from "./gamm/pool-models/stableswap/tx.rpc.msg"; -import * as _522 from "./gamm/v1beta1/tx.rpc.msg"; -import * as _523 from "./incentives/tx.rpc.msg"; -import * as _524 from "./lockup/tx.rpc.msg"; -import * as _525 from "./poolmanager/v1beta1/tx.rpc.msg"; -import * as _526 from "./protorev/v1beta1/tx.rpc.msg"; -import * as _527 from "./superfluid/tx.rpc.msg"; -import * as _528 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _529 from "./txfees/v1beta1/tx.rpc.msg"; -import * as _530 from "./valset-pref/v1beta1/tx.rpc.msg"; -import * as _601 from "./rpc.query"; -import * as _602 from "./rpc.tx"; +import * as _199 from "./accum/v1beta1/accum"; +import * as _200 from "./concentratedliquidity/params"; +import * as _201 from "./cosmwasmpool/v1beta1/genesis"; +import * as _202 from "./cosmwasmpool/v1beta1/gov"; +import * as _203 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; +import * as _204 from "./cosmwasmpool/v1beta1/model/module_query_msg"; +import * as _205 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; +import * as _206 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; +import * as _207 from "./cosmwasmpool/v1beta1/model/pool"; +import * as _208 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; +import * as _209 from "./cosmwasmpool/v1beta1/model/tx"; +import * as _210 from "./cosmwasmpool/v1beta1/params"; +import * as _211 from "./cosmwasmpool/v1beta1/query"; +import * as _212 from "./cosmwasmpool/v1beta1/tx"; +import * as _213 from "./gamm/pool-models/balancer/balancerPool"; +import * as _214 from "./gamm/v1beta1/genesis"; +import * as _215 from "./gamm/v1beta1/gov"; +import * as _216 from "./gamm/v1beta1/query"; +import * as _217 from "./gamm/v1beta1/shared"; +import * as _218 from "./gamm/v1beta1/tx"; +import * as _219 from "./gamm/pool-models/balancer/tx/tx"; +import * as _220 from "./gamm/pool-models/stableswap/stableswap_pool"; +import * as _221 from "./gamm/pool-models/stableswap/tx"; +import * as _222 from "./incentives/gauge"; +import * as _223 from "./incentives/genesis"; +import * as _224 from "./incentives/gov"; +import * as _225 from "./incentives/group"; +import * as _226 from "./incentives/params"; +import * as _227 from "./incentives/query"; +import * as _228 from "./incentives/tx"; +import * as _229 from "./lockup/genesis"; +import * as _230 from "./lockup/lock"; +import * as _231 from "./lockup/params"; +import * as _232 from "./lockup/query"; +import * as _233 from "./lockup/tx"; +import * as _234 from "./pool-incentives/v1beta1/genesis"; +import * as _235 from "./pool-incentives/v1beta1/gov"; +import * as _236 from "./pool-incentives/v1beta1/incentives"; +import * as _237 from "./pool-incentives/v1beta1/query"; +import * as _238 from "./pool-incentives/v1beta1/shared"; +import * as _239 from "./poolmanager/v1beta1/genesis"; +import * as _240 from "./poolmanager/v1beta1/gov"; +import * as _241 from "./poolmanager/v1beta1/module_route"; +import * as _242 from "./poolmanager/v1beta1/query"; +import * as _243 from "./poolmanager/v1beta1/swap_route"; +import * as _244 from "./poolmanager/v1beta1/tx"; +import * as _245 from "./protorev/v1beta1/genesis"; +import * as _246 from "./protorev/v1beta1/gov"; +import * as _247 from "./protorev/v1beta1/params"; +import * as _248 from "./protorev/v1beta1/protorev"; +import * as _249 from "./protorev/v1beta1/query"; +import * as _250 from "./protorev/v1beta1/tx"; +import * as _251 from "./superfluid/genesis"; +import * as _252 from "./superfluid/params"; +import * as _253 from "./superfluid/query"; +import * as _254 from "./superfluid/superfluid"; +import * as _255 from "./superfluid/tx"; +import * as _256 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _257 from "./tokenfactory/v1beta1/genesis"; +import * as _258 from "./tokenfactory/v1beta1/params"; +import * as _259 from "./tokenfactory/v1beta1/query"; +import * as _260 from "./tokenfactory/v1beta1/tx"; +import * as _261 from "./txfees/v1beta1/feetoken"; +import * as _262 from "./txfees/v1beta1/genesis"; +import * as _263 from "./txfees/v1beta1/gov"; +import * as _264 from "./txfees/v1beta1/params"; +import * as _265 from "./txfees/v1beta1/query"; +import * as _266 from "./txfees/v1beta1/tx"; +import * as _267 from "./valset-pref/v1beta1/query"; +import * as _268 from "./valset-pref/v1beta1/state"; +import * as _269 from "./valset-pref/v1beta1/tx"; +import * as _484 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; +import * as _485 from "./concentratedliquidity/v1beta1/tx.amino"; +import * as _486 from "./gamm/pool-models/balancer/tx/tx.amino"; +import * as _487 from "./gamm/pool-models/stableswap/tx.amino"; +import * as _488 from "./gamm/v1beta1/tx.amino"; +import * as _489 from "./incentives/tx.amino"; +import * as _490 from "./lockup/tx.amino"; +import * as _491 from "./poolmanager/v1beta1/tx.amino"; +import * as _492 from "./protorev/v1beta1/tx.amino"; +import * as _493 from "./superfluid/tx.amino"; +import * as _494 from "./tokenfactory/v1beta1/tx.amino"; +import * as _495 from "./txfees/v1beta1/tx.amino"; +import * as _496 from "./valset-pref/v1beta1/tx.amino"; +import * as _497 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; +import * as _498 from "./concentratedliquidity/v1beta1/tx.registry"; +import * as _499 from "./gamm/pool-models/balancer/tx/tx.registry"; +import * as _500 from "./gamm/pool-models/stableswap/tx.registry"; +import * as _501 from "./gamm/v1beta1/tx.registry"; +import * as _502 from "./incentives/tx.registry"; +import * as _503 from "./lockup/tx.registry"; +import * as _504 from "./poolmanager/v1beta1/tx.registry"; +import * as _505 from "./protorev/v1beta1/tx.registry"; +import * as _506 from "./superfluid/tx.registry"; +import * as _507 from "./tokenfactory/v1beta1/tx.registry"; +import * as _508 from "./txfees/v1beta1/tx.registry"; +import * as _509 from "./valset-pref/v1beta1/tx.registry"; +import * as _510 from "./concentratedliquidity/v1beta1/query.rpc.Query"; +import * as _511 from "./cosmwasmpool/v1beta1/query.rpc.Query"; +import * as _512 from "./gamm/v1beta1/query.rpc.Query"; +import * as _513 from "./incentives/query.rpc.Query"; +import * as _514 from "./lockup/query.rpc.Query"; +import * as _515 from "./pool-incentives/v1beta1/query.rpc.Query"; +import * as _516 from "./poolmanager/v1beta1/query.rpc.Query"; +import * as _517 from "./protorev/v1beta1/query.rpc.Query"; +import * as _518 from "./superfluid/query.rpc.Query"; +import * as _519 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _520 from "./txfees/v1beta1/query.rpc.Query"; +import * as _521 from "./valset-pref/v1beta1/query.rpc.Query"; +import * as _522 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; +import * as _523 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; +import * as _524 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; +import * as _525 from "./gamm/pool-models/stableswap/tx.rpc.msg"; +import * as _526 from "./gamm/v1beta1/tx.rpc.msg"; +import * as _527 from "./incentives/tx.rpc.msg"; +import * as _528 from "./lockup/tx.rpc.msg"; +import * as _529 from "./poolmanager/v1beta1/tx.rpc.msg"; +import * as _530 from "./protorev/v1beta1/tx.rpc.msg"; +import * as _531 from "./superfluid/tx.rpc.msg"; +import * as _532 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _533 from "./txfees/v1beta1/tx.rpc.msg"; +import * as _534 from "./valset-pref/v1beta1/tx.rpc.msg"; +import * as _606 from "./rpc.query"; +import * as _607 from "./rpc.tx"; export namespace osmosis { export namespace accum { export const v1beta1 = { - ..._198 + ..._199 }; } export const concentratedliquidity = { - ..._199, + ..._200, poolmodel: { concentrated: { v1beta1: { - ..._480, - ..._493, - ..._518 + ..._484, + ..._497, + ..._522 } } }, v1beta1: { - ..._481, - ..._494, - ..._506, - ..._519 + ..._485, + ..._498, + ..._510, + ..._523 } }; export namespace cosmwasmpool { export const v1beta1 = { - ..._200, ..._201, ..._202, ..._203, @@ -160,155 +159,156 @@ export namespace osmosis { ..._209, ..._210, ..._211, - ..._507 + ..._212, + ..._511 }; } export namespace gamm { export const v1beta1 = { - ..._212, ..._213, ..._214, ..._215, ..._216, ..._217, - ..._484, - ..._497, - ..._508, - ..._522 + ..._218, + ..._488, + ..._501, + ..._512, + ..._526 }; export namespace poolmodels { export namespace balancer { export const v1beta1 = { - ..._218, - ..._482, - ..._495, - ..._520 + ..._219, + ..._486, + ..._499, + ..._524 }; } export namespace stableswap { export const v1beta1 = { - ..._219, ..._220, - ..._483, - ..._496, - ..._521 + ..._221, + ..._487, + ..._500, + ..._525 }; } } } export const incentives = { - ..._221, ..._222, ..._223, ..._224, ..._225, ..._226, ..._227, - ..._485, - ..._498, - ..._509, - ..._523 + ..._228, + ..._489, + ..._502, + ..._513, + ..._527 }; export const lockup = { - ..._228, ..._229, ..._230, ..._231, ..._232, - ..._486, - ..._499, - ..._510, - ..._524 + ..._233, + ..._490, + ..._503, + ..._514, + ..._528 }; export namespace poolincentives { export const v1beta1 = { - ..._233, ..._234, ..._235, ..._236, ..._237, - ..._511 + ..._238, + ..._515 }; } export namespace poolmanager { export const v1beta1 = { - ..._238, ..._239, ..._240, ..._241, ..._242, ..._243, - ..._487, - ..._500, - ..._512, - ..._525 + ..._244, + ..._491, + ..._504, + ..._516, + ..._529 }; } export namespace protorev { export const v1beta1 = { - ..._244, ..._245, ..._246, ..._247, ..._248, ..._249, - ..._488, - ..._501, - ..._513, - ..._526 + ..._250, + ..._492, + ..._505, + ..._517, + ..._530 }; } export const superfluid = { - ..._250, ..._251, ..._252, ..._253, ..._254, - ..._489, - ..._502, - ..._514, - ..._527 + ..._255, + ..._493, + ..._506, + ..._518, + ..._531 }; export namespace tokenfactory { export const v1beta1 = { - ..._255, ..._256, ..._257, ..._258, ..._259, - ..._490, - ..._503, - ..._515, - ..._528 + ..._260, + ..._494, + ..._507, + ..._519, + ..._532 }; } export namespace txfees { export const v1beta1 = { - ..._260, ..._261, ..._262, ..._263, ..._264, ..._265, - ..._491, - ..._504, - ..._516, - ..._529 + ..._266, + ..._495, + ..._508, + ..._520, + ..._533 }; } export namespace valsetpref { export const v1beta1 = { - ..._266, ..._267, ..._268, - ..._492, - ..._505, - ..._517, - ..._530 + ..._269, + ..._496, + ..._509, + ..._521, + ..._534 }; } export const ClientFactory = { - ..._601, - ..._602 + ..._606, + ..._607 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/bundle.ts b/packages/types/protobuf/codegen/pstake/bundle.ts index a4b5e0f04..1d736c630 100644 --- a/packages/types/protobuf/codegen/pstake/bundle.ts +++ b/packages/types/protobuf/codegen/pstake/bundle.ts @@ -1,98 +1,98 @@ -import * as _269 from "./liquidstake/v1beta1/genesis"; -import * as _270 from "./liquidstake/v1beta1/liquidstake"; -import * as _271 from "./liquidstake/v1beta1/query"; -import * as _272 from "./liquidstake/v1beta1/tx"; -import * as _273 from "./liquidstakeibc/v1beta1/genesis"; -import * as _274 from "./liquidstakeibc/v1beta1/liquidstakeibc"; -import * as _275 from "./liquidstakeibc/v1beta1/msgs"; -import * as _276 from "./liquidstakeibc/v1beta1/params"; -import * as _277 from "./liquidstakeibc/v1beta1/query"; -import * as _278 from "./lscosmos/v1beta1/genesis"; -import * as _279 from "./lscosmos/v1beta1/governance_proposal"; -import * as _280 from "./lscosmos/v1beta1/lscosmos"; -import * as _281 from "./lscosmos/v1beta1/msgs"; -import * as _282 from "./lscosmos/v1beta1/params"; -import * as _283 from "./lscosmos/v1beta1/query"; -import * as _284 from "./ratesync/v1beta1/contract"; -import * as _285 from "./ratesync/v1beta1/genesis"; -import * as _286 from "./ratesync/v1beta1/params"; -import * as _287 from "./ratesync/v1beta1/query"; -import * as _288 from "./ratesync/v1beta1/ratesync"; -import * as _289 from "./ratesync/v1beta1/tx"; -import * as _531 from "./liquidstake/v1beta1/tx.amino"; -import * as _532 from "./liquidstakeibc/v1beta1/msgs.amino"; -import * as _533 from "./lscosmos/v1beta1/msgs.amino"; -import * as _534 from "./ratesync/v1beta1/tx.amino"; -import * as _535 from "./liquidstake/v1beta1/tx.registry"; -import * as _536 from "./liquidstakeibc/v1beta1/msgs.registry"; -import * as _537 from "./lscosmos/v1beta1/msgs.registry"; -import * as _538 from "./ratesync/v1beta1/tx.registry"; -import * as _539 from "./liquidstake/v1beta1/query.rpc.Query"; -import * as _540 from "./liquidstakeibc/v1beta1/query.rpc.Query"; -import * as _541 from "./lscosmos/v1beta1/query.rpc.Query"; -import * as _542 from "./ratesync/v1beta1/query.rpc.Query"; -import * as _543 from "./liquidstake/v1beta1/tx.rpc.msg"; -import * as _544 from "./liquidstakeibc/v1beta1/msgs.rpc.msg"; -import * as _545 from "./lscosmos/v1beta1/msgs.rpc.msg"; -import * as _546 from "./ratesync/v1beta1/tx.rpc.msg"; -import * as _603 from "./rpc.query"; -import * as _604 from "./rpc.tx"; +import * as _270 from "./liquidstake/v1beta1/genesis"; +import * as _271 from "./liquidstake/v1beta1/liquidstake"; +import * as _272 from "./liquidstake/v1beta1/query"; +import * as _273 from "./liquidstake/v1beta1/tx"; +import * as _274 from "./liquidstakeibc/v1beta1/genesis"; +import * as _275 from "./liquidstakeibc/v1beta1/liquidstakeibc"; +import * as _276 from "./liquidstakeibc/v1beta1/msgs"; +import * as _277 from "./liquidstakeibc/v1beta1/params"; +import * as _278 from "./liquidstakeibc/v1beta1/query"; +import * as _279 from "./lscosmos/v1beta1/genesis"; +import * as _280 from "./lscosmos/v1beta1/governance_proposal"; +import * as _281 from "./lscosmos/v1beta1/lscosmos"; +import * as _282 from "./lscosmos/v1beta1/msgs"; +import * as _283 from "./lscosmos/v1beta1/params"; +import * as _284 from "./lscosmos/v1beta1/query"; +import * as _285 from "./ratesync/v1beta1/contract"; +import * as _286 from "./ratesync/v1beta1/genesis"; +import * as _287 from "./ratesync/v1beta1/params"; +import * as _288 from "./ratesync/v1beta1/query"; +import * as _289 from "./ratesync/v1beta1/ratesync"; +import * as _290 from "./ratesync/v1beta1/tx"; +import * as _535 from "./liquidstake/v1beta1/tx.amino"; +import * as _536 from "./liquidstakeibc/v1beta1/msgs.amino"; +import * as _537 from "./lscosmos/v1beta1/msgs.amino"; +import * as _538 from "./ratesync/v1beta1/tx.amino"; +import * as _539 from "./liquidstake/v1beta1/tx.registry"; +import * as _540 from "./liquidstakeibc/v1beta1/msgs.registry"; +import * as _541 from "./lscosmos/v1beta1/msgs.registry"; +import * as _542 from "./ratesync/v1beta1/tx.registry"; +import * as _543 from "./liquidstake/v1beta1/query.rpc.Query"; +import * as _544 from "./liquidstakeibc/v1beta1/query.rpc.Query"; +import * as _545 from "./lscosmos/v1beta1/query.rpc.Query"; +import * as _546 from "./ratesync/v1beta1/query.rpc.Query"; +import * as _547 from "./liquidstake/v1beta1/tx.rpc.msg"; +import * as _548 from "./liquidstakeibc/v1beta1/msgs.rpc.msg"; +import * as _549 from "./lscosmos/v1beta1/msgs.rpc.msg"; +import * as _550 from "./ratesync/v1beta1/tx.rpc.msg"; +import * as _608 from "./rpc.query"; +import * as _609 from "./rpc.tx"; export namespace pstake { export namespace liquidstake { export const v1beta1 = { - ..._269, ..._270, ..._271, ..._272, - ..._531, + ..._273, ..._535, ..._539, - ..._543 + ..._543, + ..._547 }; } export namespace liquidstakeibc { export const v1beta1 = { - ..._273, ..._274, ..._275, ..._276, ..._277, - ..._532, + ..._278, ..._536, ..._540, - ..._544 + ..._544, + ..._548 }; } export namespace lscosmos { export const v1beta1 = { - ..._278, ..._279, ..._280, ..._281, ..._282, ..._283, - ..._533, + ..._284, ..._537, ..._541, - ..._545 + ..._545, + ..._549 }; } export namespace ratesync { export const v1beta1 = { - ..._284, ..._285, ..._286, ..._287, ..._288, ..._289, - ..._534, + ..._290, ..._538, ..._542, - ..._546 + ..._546, + ..._550 }; } export const ClientFactory = { - ..._603, - ..._604 + ..._608, + ..._609 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/publicawesome/bundle.ts b/packages/types/protobuf/codegen/publicawesome/bundle.ts index cbb194de3..efd643fee 100644 --- a/packages/types/protobuf/codegen/publicawesome/bundle.ts +++ b/packages/types/protobuf/codegen/publicawesome/bundle.ts @@ -1,88 +1,88 @@ -import * as _290 from "./stargaze/alloc/v1beta1/genesis"; -import * as _291 from "./stargaze/alloc/v1beta1/params"; -import * as _292 from "./stargaze/alloc/v1beta1/query"; -import * as _293 from "./stargaze/alloc/v1beta1/tx"; -import * as _294 from "./stargaze/cron/v1/cron"; -import * as _295 from "./stargaze/cron/v1/genesis"; -import * as _296 from "./stargaze/cron/v1/proposal"; -import * as _297 from "./stargaze/cron/v1/query"; -import * as _298 from "./stargaze/cron/v1/tx"; -import * as _299 from "./stargaze/globalfee/v1/genesis"; -import * as _300 from "./stargaze/globalfee/v1/globalfee"; -import * as _301 from "./stargaze/globalfee/v1/proposal"; -import * as _302 from "./stargaze/globalfee/v1/query"; -import * as _303 from "./stargaze/globalfee/v1/tx"; -import * as _304 from "./stargaze/mint/v1beta1/genesis"; -import * as _305 from "./stargaze/mint/v1beta1/mint"; -import * as _306 from "./stargaze/mint/v1beta1/query"; -import * as _307 from "./stargaze/mint/v1beta1/tx"; -import * as _547 from "./stargaze/alloc/v1beta1/tx.amino"; -import * as _548 from "./stargaze/cron/v1/tx.amino"; -import * as _549 from "./stargaze/globalfee/v1/tx.amino"; -import * as _550 from "./stargaze/alloc/v1beta1/tx.registry"; -import * as _551 from "./stargaze/cron/v1/tx.registry"; -import * as _552 from "./stargaze/globalfee/v1/tx.registry"; -import * as _553 from "./stargaze/alloc/v1beta1/query.rpc.Query"; -import * as _554 from "./stargaze/cron/v1/query.rpc.Query"; -import * as _555 from "./stargaze/globalfee/v1/query.rpc.Query"; -import * as _556 from "./stargaze/mint/v1beta1/query.rpc.Query"; -import * as _557 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; -import * as _558 from "./stargaze/cron/v1/tx.rpc.msg"; -import * as _559 from "./stargaze/globalfee/v1/tx.rpc.msg"; -import * as _605 from "./rpc.query"; -import * as _606 from "./rpc.tx"; +import * as _291 from "./stargaze/alloc/v1beta1/genesis"; +import * as _292 from "./stargaze/alloc/v1beta1/params"; +import * as _293 from "./stargaze/alloc/v1beta1/query"; +import * as _294 from "./stargaze/alloc/v1beta1/tx"; +import * as _295 from "./stargaze/cron/v1/cron"; +import * as _296 from "./stargaze/cron/v1/genesis"; +import * as _297 from "./stargaze/cron/v1/proposal"; +import * as _298 from "./stargaze/cron/v1/query"; +import * as _299 from "./stargaze/cron/v1/tx"; +import * as _300 from "./stargaze/globalfee/v1/genesis"; +import * as _301 from "./stargaze/globalfee/v1/globalfee"; +import * as _302 from "./stargaze/globalfee/v1/proposal"; +import * as _303 from "./stargaze/globalfee/v1/query"; +import * as _304 from "./stargaze/globalfee/v1/tx"; +import * as _305 from "./stargaze/mint/v1beta1/genesis"; +import * as _306 from "./stargaze/mint/v1beta1/mint"; +import * as _307 from "./stargaze/mint/v1beta1/query"; +import * as _308 from "./stargaze/mint/v1beta1/tx"; +import * as _551 from "./stargaze/alloc/v1beta1/tx.amino"; +import * as _552 from "./stargaze/cron/v1/tx.amino"; +import * as _553 from "./stargaze/globalfee/v1/tx.amino"; +import * as _554 from "./stargaze/alloc/v1beta1/tx.registry"; +import * as _555 from "./stargaze/cron/v1/tx.registry"; +import * as _556 from "./stargaze/globalfee/v1/tx.registry"; +import * as _557 from "./stargaze/alloc/v1beta1/query.rpc.Query"; +import * as _558 from "./stargaze/cron/v1/query.rpc.Query"; +import * as _559 from "./stargaze/globalfee/v1/query.rpc.Query"; +import * as _560 from "./stargaze/mint/v1beta1/query.rpc.Query"; +import * as _561 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; +import * as _562 from "./stargaze/cron/v1/tx.rpc.msg"; +import * as _563 from "./stargaze/globalfee/v1/tx.rpc.msg"; +import * as _610 from "./rpc.query"; +import * as _611 from "./rpc.tx"; export namespace publicawesome { export namespace stargaze { export namespace alloc { export const v1beta1 = { - ..._290, ..._291, ..._292, ..._293, - ..._547, - ..._550, - ..._553, - ..._557 + ..._294, + ..._551, + ..._554, + ..._557, + ..._561 }; } export namespace cron { export const v1 = { - ..._294, ..._295, ..._296, ..._297, ..._298, - ..._548, - ..._551, - ..._554, - ..._558 + ..._299, + ..._552, + ..._555, + ..._558, + ..._562 }; } export namespace globalfee { export const v1 = { - ..._299, ..._300, ..._301, ..._302, ..._303, - ..._549, - ..._552, - ..._555, - ..._559 + ..._304, + ..._553, + ..._556, + ..._559, + ..._563 }; } export namespace mint { export const v1beta1 = { - ..._304, ..._305, ..._306, ..._307, - ..._556 + ..._308, + ..._560 }; } } export const ClientFactory = { - ..._605, - ..._606 + ..._610, + ..._611 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/regen/bundle.ts b/packages/types/protobuf/codegen/regen/bundle.ts index 050e05424..0740d9519 100644 --- a/packages/types/protobuf/codegen/regen/bundle.ts +++ b/packages/types/protobuf/codegen/regen/bundle.ts @@ -1,134 +1,134 @@ -import * as _308 from "./data/v1/events"; -import * as _309 from "./data/v1/state"; -import * as _310 from "./data/v1/tx"; -import * as _311 from "./data/v1/types"; -import * as _312 from "./data/v2/events"; -import * as _313 from "./data/v2/state"; -import * as _314 from "./data/v2/tx"; -import * as _315 from "./data/v2/types"; -import * as _316 from "./ecocredit/basket/v1/events"; -import * as _317 from "./ecocredit/basket/v1/state"; -import * as _318 from "./ecocredit/basket/v1/tx"; -import * as _319 from "./ecocredit/basket/v1/types"; -import * as _320 from "./ecocredit/marketplace/v1/events"; -import * as _321 from "./ecocredit/marketplace/v1/state"; -import * as _322 from "./ecocredit/marketplace/v1/tx"; -import * as _323 from "./ecocredit/marketplace/v1/types"; -import * as _324 from "./ecocredit/orderbook/v1alpha1/memory"; -import * as _325 from "./ecocredit/v1/events"; -import * as _326 from "./ecocredit/v1/state"; -import * as _327 from "./ecocredit/v1/tx"; -import * as _328 from "./ecocredit/v1/types"; -import * as _329 from "./ecocredit/v1alpha1/events"; -import * as _330 from "./ecocredit/v1alpha1/genesis"; -import * as _331 from "./ecocredit/v1alpha1/tx"; -import * as _332 from "./ecocredit/v1alpha1/types"; -import * as _333 from "./intertx/v1/query"; -import * as _334 from "./intertx/v1/tx"; -import * as _560 from "./data/v1/tx.amino"; -import * as _561 from "./data/v2/tx.amino"; -import * as _562 from "./ecocredit/basket/v1/tx.amino"; -import * as _563 from "./ecocredit/marketplace/v1/tx.amino"; -import * as _564 from "./ecocredit/v1/tx.amino"; -import * as _565 from "./ecocredit/v1alpha1/tx.amino"; -import * as _566 from "./intertx/v1/tx.amino"; -import * as _567 from "./data/v1/tx.registry"; -import * as _568 from "./data/v2/tx.registry"; -import * as _569 from "./ecocredit/basket/v1/tx.registry"; -import * as _570 from "./ecocredit/marketplace/v1/tx.registry"; -import * as _571 from "./ecocredit/v1/tx.registry"; -import * as _572 from "./ecocredit/v1alpha1/tx.registry"; -import * as _573 from "./intertx/v1/tx.registry"; -import * as _574 from "./intertx/v1/query.rpc.Query"; -import * as _575 from "./data/v1/tx.rpc.msg"; -import * as _576 from "./data/v2/tx.rpc.msg"; -import * as _577 from "./ecocredit/basket/v1/tx.rpc.msg"; -import * as _578 from "./ecocredit/marketplace/v1/tx.rpc.msg"; -import * as _579 from "./ecocredit/v1/tx.rpc.msg"; -import * as _580 from "./ecocredit/v1alpha1/tx.rpc.msg"; -import * as _581 from "./intertx/v1/tx.rpc.msg"; -import * as _607 from "./rpc.query"; -import * as _608 from "./rpc.tx"; +import * as _309 from "./data/v1/events"; +import * as _310 from "./data/v1/state"; +import * as _311 from "./data/v1/tx"; +import * as _312 from "./data/v1/types"; +import * as _313 from "./data/v2/events"; +import * as _314 from "./data/v2/state"; +import * as _315 from "./data/v2/tx"; +import * as _316 from "./data/v2/types"; +import * as _317 from "./ecocredit/basket/v1/events"; +import * as _318 from "./ecocredit/basket/v1/state"; +import * as _319 from "./ecocredit/basket/v1/tx"; +import * as _320 from "./ecocredit/basket/v1/types"; +import * as _321 from "./ecocredit/marketplace/v1/events"; +import * as _322 from "./ecocredit/marketplace/v1/state"; +import * as _323 from "./ecocredit/marketplace/v1/tx"; +import * as _324 from "./ecocredit/marketplace/v1/types"; +import * as _325 from "./ecocredit/orderbook/v1alpha1/memory"; +import * as _326 from "./ecocredit/v1/events"; +import * as _327 from "./ecocredit/v1/state"; +import * as _328 from "./ecocredit/v1/tx"; +import * as _329 from "./ecocredit/v1/types"; +import * as _330 from "./ecocredit/v1alpha1/events"; +import * as _331 from "./ecocredit/v1alpha1/genesis"; +import * as _332 from "./ecocredit/v1alpha1/tx"; +import * as _333 from "./ecocredit/v1alpha1/types"; +import * as _334 from "./intertx/v1/query"; +import * as _335 from "./intertx/v1/tx"; +import * as _564 from "./data/v1/tx.amino"; +import * as _565 from "./data/v2/tx.amino"; +import * as _566 from "./ecocredit/basket/v1/tx.amino"; +import * as _567 from "./ecocredit/marketplace/v1/tx.amino"; +import * as _568 from "./ecocredit/v1/tx.amino"; +import * as _569 from "./ecocredit/v1alpha1/tx.amino"; +import * as _570 from "./intertx/v1/tx.amino"; +import * as _571 from "./data/v1/tx.registry"; +import * as _572 from "./data/v2/tx.registry"; +import * as _573 from "./ecocredit/basket/v1/tx.registry"; +import * as _574 from "./ecocredit/marketplace/v1/tx.registry"; +import * as _575 from "./ecocredit/v1/tx.registry"; +import * as _576 from "./ecocredit/v1alpha1/tx.registry"; +import * as _577 from "./intertx/v1/tx.registry"; +import * as _578 from "./intertx/v1/query.rpc.Query"; +import * as _579 from "./data/v1/tx.rpc.msg"; +import * as _580 from "./data/v2/tx.rpc.msg"; +import * as _581 from "./ecocredit/basket/v1/tx.rpc.msg"; +import * as _582 from "./ecocredit/marketplace/v1/tx.rpc.msg"; +import * as _583 from "./ecocredit/v1/tx.rpc.msg"; +import * as _584 from "./ecocredit/v1alpha1/tx.rpc.msg"; +import * as _585 from "./intertx/v1/tx.rpc.msg"; +import * as _612 from "./rpc.query"; +import * as _613 from "./rpc.tx"; export namespace regen { export namespace data { export const v1 = { - ..._308, ..._309, ..._310, ..._311, - ..._560, - ..._567, - ..._575 + ..._312, + ..._564, + ..._571, + ..._579 }; export const v2 = { - ..._312, ..._313, ..._314, ..._315, - ..._561, - ..._568, - ..._576 + ..._316, + ..._565, + ..._572, + ..._580 }; } export namespace ecocredit { export namespace basket { export const v1 = { - ..._316, ..._317, ..._318, ..._319, - ..._562, - ..._569, - ..._577 + ..._320, + ..._566, + ..._573, + ..._581 }; } export namespace marketplace { export const v1 = { - ..._320, ..._321, ..._322, ..._323, - ..._563, - ..._570, - ..._578 + ..._324, + ..._567, + ..._574, + ..._582 }; } export namespace orderbook { export const v1alpha1 = { - ..._324 + ..._325 }; } export const v1 = { - ..._325, ..._326, ..._327, ..._328, - ..._564, - ..._571, - ..._579 + ..._329, + ..._568, + ..._575, + ..._583 }; export const v1alpha1 = { - ..._329, ..._330, ..._331, ..._332, - ..._565, - ..._572, - ..._580 + ..._333, + ..._569, + ..._576, + ..._584 }; } export namespace intertx { export const v1 = { - ..._333, ..._334, - ..._566, - ..._573, - ..._574, - ..._581 + ..._335, + ..._570, + ..._577, + ..._578, + ..._585 }; } export const ClientFactory = { - ..._607, - ..._608 + ..._612, + ..._613 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/tendermint/bundle.ts b/packages/types/protobuf/codegen/tendermint/bundle.ts index 999f8a331..1beadd9c9 100644 --- a/packages/types/protobuf/codegen/tendermint/bundle.ts +++ b/packages/types/protobuf/codegen/tendermint/bundle.ts @@ -1,32 +1,32 @@ -import * as _338 from "./abci/types"; -import * as _339 from "./crypto/keys"; -import * as _340 from "./crypto/proof"; -import * as _341 from "./p2p/types"; -import * as _342 from "./types/block"; -import * as _343 from "./types/evidence"; -import * as _344 from "./types/params"; -import * as _345 from "./types/types"; -import * as _346 from "./types/validator"; -import * as _347 from "./version/types"; +import * as _339 from "./abci/types"; +import * as _340 from "./crypto/keys"; +import * as _341 from "./crypto/proof"; +import * as _342 from "./p2p/types"; +import * as _343 from "./types/block"; +import * as _344 from "./types/evidence"; +import * as _345 from "./types/params"; +import * as _346 from "./types/types"; +import * as _347 from "./types/validator"; +import * as _348 from "./version/types"; export namespace tendermint { export const abci = { - ..._338 + ..._339 }; export const crypto = { - ..._339, - ..._340 + ..._340, + ..._341 }; export const p2p = { - ..._341 + ..._342 }; export const types = { - ..._342, ..._343, ..._344, ..._345, - ..._346 + ..._346, + ..._347 }; export const version = { - ..._347 + ..._348 }; } \ No newline at end of file diff --git a/packages/types/protobuf/proto/bitsong/fantoken/v1beta1/events.proto b/packages/types/protobuf/proto/bitsong/fantoken/v1beta1/events.proto new file mode 100644 index 000000000..530295717 --- /dev/null +++ b/packages/types/protobuf/proto/bitsong/fantoken/v1beta1/events.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; +package bitsong.fantoken.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/bitsongofficial/go-bitsong/x/fantoken/types"; + +message EventIssue { + string denom = 1; +} + +message EventDisableMint { + string denom = 1; +} + +message EventMint { + string recipient = 1; + string coin = 2; +} + +message EventBurn { + string sender = 1; + string coin = 2; +} + +message EventSetAuthority { + string denom = 1; + string old_authority = 2 [ (gogoproto.moretags) = "yaml:\"old_authority\"" ]; + string new_authority = 3 [ (gogoproto.moretags) = "yaml:\"new_authority\"" ]; +} + +message EventSetMinter { + string denom = 1; + string old_minter = 2 [ (gogoproto.moretags) = "yaml:\"old_minter\"" ]; + string new_minter = 3 [ (gogoproto.moretags) = "yaml:\"new_minter\"" ]; +} + +message EventSetUri { + string denom = 1; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/bitsong/fantoken/v1beta1/fantoken.proto b/packages/types/protobuf/proto/bitsong/fantoken/v1beta1/fantoken.proto new file mode 100644 index 000000000..9904b7df1 --- /dev/null +++ b/packages/types/protobuf/proto/bitsong/fantoken/v1beta1/fantoken.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; +package bitsong.fantoken.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/bitsongofficial/go-bitsong/x/fantoken/types"; +option (gogoproto.goproto_getters_all) = false; + +message Metadata { + // name defines the name of the fantoken (eg: Kitty Punk) + string name = 1; + + // symbol is the token symbol usually shown on exchanges (eg: KITTY) + string symbol = 2; + + // URI to a document (on or off-chain) that contains additional + // information.Optional. + string uri = 3 [ (gogoproto.customname) = "URI" ]; + + // sdk.AccAddress allowed to set a new uri + string authority = 4; +} + +// FanToken defines a standard for the fungible token +message FanToken { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // denom represents the string name of the given denom unit (e.g ft). + string denom = 1; + + string max_supply = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"max_supply\"", + (gogoproto.nullable) = false + ]; + + // sdk.AccAddress allowed to mint new fantoken + string minter = 3; + + Metadata meta_data = 4 [ + (gogoproto.moretags) = "yaml:\"meta_data\"", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/bitsong/fantoken/v1beta1/genesis.proto b/packages/types/protobuf/proto/bitsong/fantoken/v1beta1/genesis.proto new file mode 100644 index 000000000..130cc3a0b --- /dev/null +++ b/packages/types/protobuf/proto/bitsong/fantoken/v1beta1/genesis.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package bitsong.fantoken.v1beta1; + +import "gogoproto/gogo.proto"; +import "bitsong/fantoken/v1beta1/fantoken.proto"; +import "bitsong/fantoken/v1beta1/params.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/bitsongofficial/go-bitsong/x/fantoken/types"; + +// GenesisState defines the fantoken module's genesis state +message GenesisState { + bitsong.fantoken.v1beta1.Params params = 1 [ (gogoproto.nullable) = false ]; + + repeated bitsong.fantoken.v1beta1.FanToken fan_tokens = 2 + [ (gogoproto.nullable) = false ]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/bitsong/fantoken/v1beta1/gov.proto b/packages/types/protobuf/proto/bitsong/fantoken/v1beta1/gov.proto new file mode 100644 index 000000000..4936a5f90 --- /dev/null +++ b/packages/types/protobuf/proto/bitsong/fantoken/v1beta1/gov.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; +package bitsong.fantoken.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/bitsongofficial/go-bitsong/x/fantoken/types"; +option (gogoproto.goproto_getters_all) = false; + +message UpdateFeesProposal { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + string title = 1; + string description = 2; + + cosmos.base.v1beta1.Coin issue_fee = 3 [ + (gogoproto.moretags) = "yaml:\"issue_fee\"", + (gogoproto.nullable) = false + ]; + + cosmos.base.v1beta1.Coin mint_fee = 4 [ + (gogoproto.moretags) = "yaml:\"mint_fee\"", + (gogoproto.nullable) = false + ]; + + cosmos.base.v1beta1.Coin burn_fee = 5 [ + (gogoproto.moretags) = "yaml:\"burn_fee\"", + (gogoproto.nullable) = false + ]; +} + +message UpdateFeesProposalWithDeposit { + option (gogoproto.goproto_stringer) = true; + + string title = 1; + string description = 2; + string issue_fee = 3; + string mint_fee = 4; + string burn_fee = 5; + string deposit = 7; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/bitsong/fantoken/v1beta1/params.proto b/packages/types/protobuf/proto/bitsong/fantoken/v1beta1/params.proto new file mode 100644 index 000000000..3a086a201 --- /dev/null +++ b/packages/types/protobuf/proto/bitsong/fantoken/v1beta1/params.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package bitsong.fantoken.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/bitsongofficial/go-bitsong/x/fantoken/types"; +option (gogoproto.goproto_getters_all) = false; + +// Params defines fantoken module's parameters +message Params { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + cosmos.base.v1beta1.Coin issue_fee = 1 [ + (gogoproto.moretags) = "yaml:\"issue_fee\"", + (gogoproto.nullable) = false + ]; + + cosmos.base.v1beta1.Coin mint_fee = 2 [ + (gogoproto.moretags) = "yaml:\"mint_fee\"", + (gogoproto.nullable) = false + ]; + + cosmos.base.v1beta1.Coin burn_fee = 3 [ + (gogoproto.moretags) = "yaml:\"burn_fee\"", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/bitsong/fantoken/v1beta1/query.proto b/packages/types/protobuf/proto/bitsong/fantoken/v1beta1/query.proto new file mode 100644 index 000000000..4b18881b0 --- /dev/null +++ b/packages/types/protobuf/proto/bitsong/fantoken/v1beta1/query.proto @@ -0,0 +1,57 @@ +syntax = "proto3"; +package bitsong.fantoken.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "bitsong/fantoken/v1beta1/fantoken.proto"; +import "bitsong/fantoken/v1beta1/params.proto"; + +option go_package = "github.com/bitsongofficial/go-bitsong/x/fantoken/types"; + +// Query creates service with fantoken as RPC +service Query { + + // FanToken returns fantoken with fantoken name + rpc FanToken(QueryFanTokenRequest) returns (QueryFanTokenResponse) { + option (google.api.http).get = "/bitsong/fantoken/v1beta1/denom/{denom}"; + } + + // FanTokens returns the fantoken list + rpc FanTokens(QueryFanTokensRequest) returns (QueryFanTokensResponse) { + option (google.api.http).get = "/bitsong/fantoken/v1beta1/fantokens"; + } + + // Params queries the fantoken parameters + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/bitsong/fantoken/v1beta1/params"; + } +} + +// QueryFanTokenRequest is request type for the Query/FanToken RPC method +message QueryFanTokenRequest { string denom = 1; } + +// QueryFanTokenResponse is response type for the Query/FanToken RPC method +message QueryFanTokenResponse { bitsong.fantoken.v1beta1.FanToken fantoken = 1; } + +// QueryFanTokensRequest is request type for the Query/FanTokens RPC method +message QueryFanTokensRequest { + string authority = 1; + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryFanTokensResponse is response type for the Query/FanTokens RPC method +message QueryFanTokensResponse { + repeated bitsong.fantoken.v1beta1.FanToken fantokens = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryParametersRequest is request type for the Query/Parameters RPC method +message QueryParamsRequest {} + +// QueryParametersResponse is response type for the Query/Parameters RPC method +message QueryParamsResponse { + bitsong.fantoken.v1beta1.Params params = 1 [ (gogoproto.nullable) = false ]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/bitsong/fantoken/v1beta1/tx.proto b/packages/types/protobuf/proto/bitsong/fantoken/v1beta1/tx.proto new file mode 100644 index 000000000..79c315c28 --- /dev/null +++ b/packages/types/protobuf/proto/bitsong/fantoken/v1beta1/tx.proto @@ -0,0 +1,135 @@ +syntax = "proto3"; +package bitsong.fantoken; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/bitsongofficial/go-bitsong/x/fantoken/types"; +option (gogoproto.goproto_getters_all) = false; + +// Msg defines the oracle Msg service +service Msg { + // Issue defines a method for issuing a new fan token + rpc Issue(MsgIssue) returns (MsgIssueResponse); + + // Mint defines a method for minting some fan tokens + rpc Mint(MsgMint) returns (MsgMintResponse); + + // Burn defines a method for burning some fan tokens + rpc Burn(MsgBurn) returns (MsgBurnResponse); + + // DisableMint defines a method for disable the mint function + rpc DisableMint(MsgDisableMint) returns (MsgDisableMintResponse); + + rpc SetMinter(MsgSetMinter) returns (MsgSetMinterResponse); + rpc SetAuthority(MsgSetAuthority) returns (MsgSetAuthorityResponse); + rpc SetUri(MsgSetUri) returns (MsgSetUriResponse); +} + +// MsgIssue defines a message for issuing a new fan token +message MsgIssue { + + // symbol which corresponds to the symbol of the fan token. It is a string and cannot change for the whole life of the fan token + string symbol = 1; + + // name which corresponds to the name of the fan token. It is a string and cannot change for the whole life of the fan token + string name = 2; + + // max_supply that represents the maximum number of possible mintable tokens. It is an integer number, expressed in micro unit 10^6 + string max_supply = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"max_supply\"", + (gogoproto.nullable) = false + ]; + + // authority which is who can set a new uri metadata + string authority = 4; + + // minter who is who can mint new fantoken and disable the minter process, the minter key also pay the gas fee + string minter = 5; + + // URI which is the current uri of the fan token. It is a string can change during the fan token lifecycle thanks to the MsgEdit + string uri = 6 [ (gogoproto.customname) = "URI" ]; +} + +// MsgIssueResponse defines the MsgIssue response type +message MsgIssueResponse {} + +// MsgDisableMint defines a message for disable the mint function +message MsgDisableMint { + string denom = 1; + string minter = 2; +} + +// MsgDisableMintResponse defines the MsgDisableMint response type +message MsgDisableMintResponse {} + +// MsgMint defines a message for minting a new fan token +message MsgMint { + string recipient = 1; + + // coin mean the amount + denom, eg: 10000ftFADJID34MCDM + cosmos.base.v1beta1.Coin coin = 2 [ + (gogoproto.moretags) = "yaml:\"coin\"", + (gogoproto.nullable) = false + ]; + + string minter = 3; +} + +// MsgMintResponse defines the MsgMint response type +message MsgMintResponse {} + +// MsgBurn defines a message for burning some fan tokens +message MsgBurn { + // coin mean the amount + denom, eg: 10000ftFADJID34MCDM + cosmos.base.v1beta1.Coin coin = 1 [ + (gogoproto.moretags) = "yaml:\"coin\"", + (gogoproto.nullable) = false + ]; + + string sender = 2; +} + +// MsgBurnResponse defines the MsgBurn response type +message MsgBurnResponse {} + +// MsgSetMinter defines a message for changing the fan token minter address +message MsgSetMinter { + + // denom the fan token denom + string denom = 1; + + // old_minter, the actual minter + string old_minter = 2 [ (gogoproto.moretags) = "yaml:\"old_minter\"" ]; + + // new_minter, the new fan token minter + string new_minter = 3 [ (gogoproto.moretags) = "yaml:\"new_minter\"" ]; +} + +// MsgSetMinterResponse defines the MsgTransferAuthority response type +message MsgSetMinterResponse {} + +// MsgSetAuthority defines a message for changing the fan token minter address +message MsgSetAuthority { + + // denom the fan token denom + string denom = 1; + + // old_authority, the actual metadata authority + string old_authority = 2 [ (gogoproto.moretags) = "yaml:\"old_authority\"" ]; + + // new_authority, the new fan token metadata authority + string new_authority = 3 [ (gogoproto.moretags) = "yaml:\"new_authority\"" ]; +} + +// MsgSetAuthorityResponse defines the MsgTransferAuthority response type +message MsgSetAuthorityResponse {} + +message MsgSetUri { + string authority = 1; + string denom = 2; + string uri = 3 [ (gogoproto.customname) = "URI" ]; +} + +message MsgSetUriResponse{} \ No newline at end of file diff --git a/packages/types/protobuf/scripts/codegen.js b/packages/types/protobuf/scripts/codegen.js index c9ecc80d8..567df0266 100644 --- a/packages/types/protobuf/scripts/codegen.js +++ b/packages/types/protobuf/scripts/codegen.js @@ -116,6 +116,7 @@ telescope({ 'pstake.lscosmos.v1beta1', 'pstake.ratesync.v1beta1', 'cosmos.adminmodule.adminmodule', + 'bitsong.fantoken', ], }, // excluded: { diff --git a/packages/types/protobuf/utils.ts b/packages/types/protobuf/utils.ts index 5652a8a06..46655d232 100644 --- a/packages/types/protobuf/utils.ts +++ b/packages/types/protobuf/utils.ts @@ -20,6 +20,8 @@ import { import { allianceAminoConverters, allianceProtoRegistry, + bitsongAminoConverters, + bitsongProtoRegistry, circleAminoConverters, circleProtoRegistry, cosmosAminoConverters, @@ -558,6 +560,7 @@ export const PROTOBUF_TYPES: ReadonlyArray<[string, GeneratedType]> = [ ...circleProtoRegistry, ...kujiraProtoRegistry, ...pstakeProtoRegistry, + ...bitsongProtoRegistry, // Not a query or TX so it isn't included in any of the registries. But we // want to decode this because it appears in gov props. We need to find a // better way to collect all generated types in a single registry... @@ -596,6 +599,7 @@ export const aminoTypes = new AminoTypes({ ...circleAminoConverters, ...kujiraAminoConverters, ...pstakeAminoConverters, + ...bitsongAminoConverters, }) // Encodes a protobuf message value from its JSON representation into a byte From 7857d44fec564b8ca3e147bfee1849a1fc08e6c7 Mon Sep 17 00:00:00 2001 From: noah Date: Sat, 1 Jun 2024 18:40:23 -0400 Subject: [PATCH 197/438] Add stats to homepage <3 (#1780) --- .github/workflows/ci.yml | 1 + apps/dapp/pages/[[...tab]].tsx | 133 ++++++++++- apps/dapp/pages/dao/[address]/[[...slug]].tsx | 2 +- .../dao/[address]/proposals/[proposalId].tsx | 2 +- .../pages/dao/[address]/proposals/create.tsx | 4 +- packages/i18n/locales/en/translation.json | 12 +- packages/state/indexer/search.ts | 56 ++++- packages/state/recoil/selectors/dao.ts | 70 +++--- packages/state/recoil/selectors/indexer.ts | 56 ++++- packages/state/recoil/selectors/treasury.ts | 50 +--- packages/state/recoil/selectors/wallet.ts | 16 +- .../useFollowingAndFilteredDaosSections.ts | 10 +- .../command/hooks/useNavigationSection.ts | 18 +- .../stateful/components/DaoCreatedModal.tsx | 8 +- packages/stateful/components/DappLayout.tsx | 1 - packages/stateful/components/ProposalLine.tsx | 42 +++- packages/stateful/components/ProposalList.tsx | 3 +- packages/stateful/components/SdaLayout.tsx | 2 - .../stateful/components/dao/CreateDaoForm.tsx | 42 ++-- packages/stateful/components/dao/DaoCard.tsx | 23 +- .../components/dao/DaoPageWrapper.tsx | 37 ++- .../stateful/components/dao/DaoProposal.tsx | 13 +- .../stateful/components/dao/LazyDaoCard.tsx | 77 +++--- .../components/dao/MainDaoInfoCards.tsx | 2 +- .../components/dao/tabs/SubDaosTab.tsx | 4 +- .../stateful/components/gov/GovInfoBar.tsx | 16 +- .../components/gov/GovProposalList.tsx | 3 +- .../stateful/components/gov/GovSubDaosTab.tsx | 8 +- packages/stateful/components/pages/Home.tsx | 201 ++++++++++++---- .../stateful/components/wallet/WalletDaos.tsx | 14 +- packages/stateful/feed/react/useFeed.ts | 4 +- packages/stateful/hooks/index.ts | 2 +- packages/stateful/hooks/useGovDaoTabs.ts | 4 +- ...adingDaoCardInfos.ts => useLoadingDaos.ts} | 52 ++-- packages/stateful/recoil/selectors/dao.ts | 195 +++++---------- .../stateful/server/makeGetDaoStaticProps.ts | 34 ++- .../components/MainDaoInfoCardsLoader.tsx | 2 +- .../components/MainDaoInfoCardsLoader.tsx | 2 +- .../components/HorizontalScroller.stories.tsx | 80 +++---- .../components/dao/DaoCard.stories.tsx | 68 +++--- packages/stateless/components/dao/DaoCard.tsx | 40 ++-- .../stateless/components/dao/DaoInfoCards.tsx | 12 +- .../dao/MainDaoInfoCardsTokenLoader.tsx | 2 +- .../dao/create/DaoCreatedModal.stories.tsx | 12 +- .../components/dao/create/DaoCreatedModal.tsx | 14 +- .../dao/tabs/SubDaosTab.stories.tsx | 19 +- .../components/dao/tabs/SubDaosTab.tsx | 11 +- .../components/inputs/NumberInput.tsx | 4 +- .../components/inputs/SelectInput.tsx | 4 +- .../components/inputs/TextAreaInput.tsx | 7 +- .../stateless/components/inputs/TextInput.tsx | 7 +- .../components/layout/DappNavigation.tsx | 38 ++- .../components/popup/ChainPickerPopup.tsx | 38 +-- .../components/proposal/ProposalList.tsx | 19 +- .../components/wallet/WalletDaos.tsx | 7 +- .../stateless/pages/ChainGovernanceList.tsx | 18 +- packages/stateless/pages/Home.stories.tsx | 40 ++-- packages/stateless/pages/Home.tsx | 224 ++++++++++++++++-- .../decorators/DaoPageWrapperDecorator.tsx | 22 +- packages/types/chain.ts | 14 ++ packages/types/components/ChainPickerPopup.ts | 4 + packages/types/components/DaoCard.tsx | 82 ++++--- packages/types/components/DaoInfoCards.ts | 4 + packages/types/components/ProposalLine.ts | 5 + .../types/contracts/DaoProposalMultiple.ts | 3 + .../types/contracts/DaoProposalSingle.v2.ts | 3 + packages/types/dao.ts | 12 +- packages/types/indexer.ts | 30 +++ packages/utils/chain.ts | 53 ++++- packages/utils/constants/chains.ts | 202 ++++++++-------- packages/utils/constants/other.ts | 17 +- 71 files changed, 1506 insertions(+), 830 deletions(-) rename packages/stateful/hooks/{useLoadingDaoCardInfos.ts => useLoadingDaos.ts} (71%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6619f9d6d..e108eb493 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,7 @@ on: - development env: + NEXT_PUBLIC_INDEXER_URL: https://indexer.daodao.zone NEXT_PUBLIC_SITE_URL: NEXT_PUBLIC_SITE_URL NEXT_PUBLIC_SEARCH_URL: NEXT_PUBLIC_SEARCH_URL NEXT_PUBLIC_SEARCH_API_KEY: NEXT_PUBLIC_SEARCH_API_KEY diff --git a/apps/dapp/pages/[[...tab]].tsx b/apps/dapp/pages/[[...tab]].tsx index 9de31989b..ff564e9c8 100644 --- a/apps/dapp/pages/[[...tab]].tsx +++ b/apps/dapp/pages/[[...tab]].tsx @@ -4,17 +4,134 @@ import { GetStaticPaths, GetStaticProps } from 'next' import { serverSideTranslations } from '@dao-dao/i18n/serverSideTranslations' -import { Home } from '@dao-dao/stateful' -import { AccountTabId } from '@dao-dao/types' -import { getSupportedChains } from '@dao-dao/utils' +import { querySnapper } from '@dao-dao/state' +import { Home, StatefulHomeProps } from '@dao-dao/stateful' +import { AccountTabId, ChainId, DaoDaoIndexerChainStats } from '@dao-dao/types' +import { + MAINNET, + getDaoInfoForChainId, + getSupportedChains, + processError, +} from '@dao-dao/utils' export default Home -export const getStaticProps: GetStaticProps = async ({ locale }) => ({ - props: { - ...(await serverSideTranslations(locale, ['translation'])), - }, -}) +export const getStaticProps: GetStaticProps = async ({ + locale, + params, +}) => { + const tabPath = + params?.tab && Array.isArray(params?.tab) ? params.tab[0] : undefined + + // If defined, try to find matching chain. If found, show chain-only page. + const selectedChain = tabPath + ? getSupportedChains().find(({ name }) => name === tabPath) + : undefined + const chainId = selectedChain?.chainId + + const chainGovDaos = chainId + ? selectedChain.noGov + ? undefined + : [getDaoInfoForChainId(chainId, [])] + : // Get chain x/gov DAOs if not on a chain-specific home. + [ + // Start with Cosmos Hub. + MAINNET ? ChainId.CosmosHubMainnet : ChainId.CosmosHubTestnet, + // Add DAO DAO-supported chains. + ...getSupportedChains().flatMap(({ chainId, noGov }) => + noGov ? [] : chainId + ), + // Add some other common chains. + ...(MAINNET + ? [ + 'akashnet-2', + 'secret-4', + 'regen-1', + 'injective-1', + 'celestia', + 'dydx-mainnet-1', + 'archway-1', + 'coreum-mainnet-1', + ] + : []), + ].map((chainId) => getDaoInfoForChainId(chainId, [])) + + // Get all or chain-specific stats and TVL. + const [tvl, allStats, monthStats, weekStats] = await Promise.all([ + querySnapper({ + query: chainId ? 'daodao-chain-tvl' : 'daodao-all-tvl', + parameters: chainId ? { chainId } : undefined, + }), + querySnapper({ + query: chainId ? 'daodao-chain-stats' : 'daodao-all-stats', + parameters: chainId ? { chainId } : undefined, + }), + querySnapper({ + query: chainId ? 'daodao-chain-stats' : 'daodao-all-stats', + parameters: { + ...(chainId ? { chainId } : undefined), + daysAgo: 30, + }, + }), + querySnapper({ + query: chainId ? 'daodao-chain-stats' : 'daodao-all-stats', + parameters: { + ...(chainId ? { chainId } : undefined), + daysAgo: 7, + }, + }), + ]) + + const validTvl = typeof tvl === 'number' + const validAllStats = !!allStats + const validMonthStats = !!monthStats + const validWeekStats = !!weekStats + if (!validTvl || !validAllStats || !validMonthStats || !validWeekStats) { + processError('Failed to fetch TVL/stats for home page', { + forceCapture: true, + tags: { + chainId, + }, + extra: { + tvl, + allStats, + monthStats, + weekStats, + }, + }) + throw new Error( + `Failed to fetch stats due to invalid: ${[ + !validTvl && 'TVL', + !validAllStats && 'all stats', + !validMonthStats && 'month stats', + !validWeekStats && 'week stats', + ] + .filter(Boolean) + .join(', ')}.` + ) + } + + return { + props: { + ...(await serverSideTranslations(locale, ['translation'])), + // Chain-specific home page. + ...(chainId && { chainId }), + // All or chain-specific stats. + stats: { + all: allStats, + month: monthStats, + week: weekStats, + // If chain is 1, it will not be shown. + chains: chainId ? 1 : getSupportedChains().length, + tvl, + }, + // Chain x/gov DAOs. + ...(chainGovDaos && { chainGovDaos }), + }, + // Revalidate every day. + revalidate: 24 * 60 * 60, + } +} export const getStaticPaths: GetStaticPaths = () => ({ paths: [ diff --git a/apps/dapp/pages/dao/[address]/[[...slug]].tsx b/apps/dapp/pages/dao/[address]/[[...slug]].tsx index 1f009612d..0301bf7d7 100644 --- a/apps/dapp/pages/dao/[address]/[[...slug]].tsx +++ b/apps/dapp/pages/dao/[address]/[[...slug]].tsx @@ -19,7 +19,7 @@ const DaoHomePage: NextPage = ({ ...props }) => ( - {props.serializedInfo?.coreVersion === ContractVersion.Gov ? ( + {props.info?.coreVersion === ContractVersion.Gov ? ( ) : ( diff --git a/apps/dapp/pages/dao/[address]/proposals/[proposalId].tsx b/apps/dapp/pages/dao/[address]/proposals/[proposalId].tsx index de44967af..7ef8fad1e 100644 --- a/apps/dapp/pages/dao/[address]/proposals/[proposalId].tsx +++ b/apps/dapp/pages/dao/[address]/proposals/[proposalId].tsx @@ -18,7 +18,7 @@ const ProposalPage: NextPage = ({ ...props }) => ( - {props.serializedInfo?.coreVersion === ContractVersion.Gov ? ( + {props.info?.coreVersion === ContractVersion.Gov ? ( ) : ( diff --git a/apps/dapp/pages/dao/[address]/proposals/create.tsx b/apps/dapp/pages/dao/[address]/proposals/create.tsx index 47c85ec81..5829c7c7c 100644 --- a/apps/dapp/pages/dao/[address]/proposals/create.tsx +++ b/apps/dapp/pages/dao/[address]/proposals/create.tsx @@ -19,9 +19,9 @@ const ProposalCreatePage: NextPage = ({ ...props }) => ( - {!props.serializedInfo ? ( + {!props.info ? ( - ) : props.serializedInfo.coreVersion === ContractVersion.Gov ? ( + ) : props.info.coreVersion === ContractVersion.Gov ? ( ) : ( diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index baeeef44a..61c14dd15 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -130,6 +130,8 @@ "earlyExecute": "Early execute", "enable": "Enable", "execute": "Execute", + "findAnotherChain": "Find another chain", + "findAnotherDao": "Find another DAO", "follow": "Follow", "forceExecute": "Force execute", "forcePublish": "Force publish", @@ -910,6 +912,7 @@ "cannotRemoveNoneOption": "You cannot remove this option. It will be added to the end of the list.", "catchingUp": "Catching up...", "chainTokensNotShowingUpPrompt": "Are your tokens not showing up? Add more chains.", + "chainsDeployedTooltip": "The number of chains with native DAO DAO deployments.", "chooseProfilePictureSubtitle": "Use an NFT you own to represent your identity, or upload an image.", "chooseTokenToPayWith": "Choose token to pay with", "claimToReceiveUnstaked": "Claim them to receive your unstaked tokens.", @@ -997,7 +1000,7 @@ "errored": "Errored", "establishedTooltip": "When the DAO was created.", "estimatedStargazeUsdValueTooltip": "USD value is estimated using price data from Stargaze. This is not fully reflective of realizable spending power due to liquidity limitations.", - "estimatedTreasuryUsdValueTooltip": "The USD value of treasuries is estimated by summing the value of all tokens held in the treasury that are listed on CoinGecko, Osmosis, Stargaze, White Whale, and Astroport. This is not fully reflective of realizable spending power due to liquidity limitations.", + "estimatedTreasuryUsdValueTooltip": "The USD value of DAO treasuries is estimated by summing the value of all tokens held in the treasury that are listed on CoinGecko, Osmosis, Astroport, Stargaze, and White Whale. This is not fully reflective of realizable spending power due to liquidity limitations.", "estimatedUsdValueTooltip": "USD value is estimated using price data from CoinGecko, Osmosis, White Whale, and Astroport. This is not fully reflective of realizable spending power due to liquidity limitations.", "executeSmartContractActionDescription": "Execute a message on a smart contract.", "failing": "Failing", @@ -1231,6 +1234,7 @@ "remainingBalanceVesting": "Remaining balance vesting", "removeCw20FromTreasuryActionDescription": "Stop displaying the DAO's balance of a CW20 token in the treasury view.", "removeCw721FromTreasuryActionDescription": "Stop displaying the NFTs owned by the DAO from a CW721 NFT collection in the treasury view.", + "required": "Required", "retroactiveCompensationDescription": "After each contribution cycle, contributors are assigned points based on their contributions. Payment is split based on the points they receive.", "reviewActionImportData": "Review the following actions to make sure they look right. If they do, click the Import button at the bottom to add them to the proposal.", "reviewYourProposal": "Review your proposal...", @@ -1528,7 +1532,7 @@ "canceled": "Canceled", "casting": "Casting", "chain": "Chain", - "chainGovernance": "Chain Governance", + "chainGovernance": "Chain governance", "chainModule": { "gov": "Governance Module" }, @@ -1582,6 +1586,7 @@ "dao": "DAO", "daoAdminExec": "DAO Admin Execute", "daoCreationProcess": "DAO Creation Process", + "daoDaoCommunityStatistics": "DAO DAO Community Statistics", "daoNotFound": "DAO Not Found", "daoRatings": "DAO Ratings", "daos": "DAOs", @@ -1758,6 +1763,7 @@ "quorum": "Quorum", "ratioOfVotes": "Ratio of votes", "rawData": "Raw data", + "recentProposals": "Recent proposals", "recipient": "Recipient", "recognizeSubDao": "Recognize {{name}} as a SubDAO", "redelegate": "Redelegate", @@ -1838,10 +1844,12 @@ "treasuryHistory": "Treasury History", "treasuryValue": "Treasury Value", "turnout": "Turnout", + "tvl": "TVL", "twitter": "Twitter", "type": "Type", "undelegate": "Undelegate", "underDevelopment": "Under development", + "uniqueVoters": "Unique voters", "unjailValidator": "Unjail validator", "unregisteredSlashAmount": "Unregistered slash amount", "unstake": "Unstake", diff --git a/packages/state/indexer/search.ts b/packages/state/indexer/search.ts index e4a86dafb..2f2d17f74 100644 --- a/packages/state/indexer/search.ts +++ b/packages/state/indexer/search.ts @@ -1,6 +1,8 @@ import MeiliSearch from 'meilisearch' import { IndexerDumpState, WithChainId } from '@dao-dao/types' +import { ProposalResponse as MultipleChoiceProposalResponse } from '@dao-dao/types/contracts/DaoProposalMultiple' +import { ProposalResponse as SingleChoiceProposalResponse } from '@dao-dao/types/contracts/DaoProposalSingle.v2' import { ProposalStatus } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1/gov' import { CommonError, @@ -27,8 +29,8 @@ export type DaoSearchResult = { chainId: string id: string block: { - height: string - timeUnixMs: string + height: number + timeUnixMs: number } value: IndexerDumpState } @@ -77,6 +79,56 @@ export const searchDaos = async ({ })) } +export type DaoProposalSearchResult = { + chainId: string + id: string + block: { + height: number + timeUnixMs: number + } + value: SingleChoiceProposalResponse | MultipleChoiceProposalResponse +} + +export type SearchDaoProposalsOptions = WithChainId<{ + limit: number +}> + +export const getRecentDaoProposals = async ({ + chainId, + limit, +}: SearchDaoProposalsOptions): Promise => { + const client = await loadMeilisearchClient() + + if (!chainIsIndexed(chainId)) { + throw new Error(CommonError.NoIndexerForChain) + } + + const index = client.index(chainId + '_proposals') + + const results = await index.search>( + null, + { + limit, + filter: [ + // Exclude hidden DAOs. + 'value.hideFromSearch NOT EXISTS OR value.hideFromSearch != true', + // Ensure DAO and proposal ID exist. + 'value.dao EXISTS', + 'value.daoProposalId EXISTS', + ] + .map((filter) => `(${filter})`) + .join(' AND '), + // Most recently created first. + sort: ['value.proposal.start_height:desc'], + } + ) + + return results.hits.map((hit) => ({ + chainId, + ...hit, + })) +} + export type GovProposalSearchResult = { chainId: string id: string diff --git a/packages/state/recoil/selectors/dao.ts b/packages/state/recoil/selectors/dao.ts index e48c8d2ec..9184949d7 100644 --- a/packages/state/recoil/selectors/dao.ts +++ b/packages/state/recoil/selectors/dao.ts @@ -12,7 +12,6 @@ import { import { ConfigResponse as CwCoreV1ConfigResponse } from '@dao-dao/types/contracts/CwCore.v1' import { ConfigResponse as DaoCoreV2ConfigResponse } from '@dao-dao/types/contracts/DaoCore.v2' import { - CHAIN_SUBDAOS, DAO_CORE_CONTRACT_NAMES, INACTIVE_DAO_NAMES, VETOABLE_DAOS_ITEM_KEY_PREFIX, @@ -21,6 +20,7 @@ import { getDisplayNameForChainId, getFallbackImage, getImageUrlForChainId, + getSupportedChainConfig, isConfiguredChainName, isFeatureSupportedByVersion, parseContractVersion, @@ -46,12 +46,14 @@ export const lazyDaoCardPropsSelector = selectorFamily< // Native chain x/gov module. if (isConfiguredChainName(chainId, coreAddress)) { return { - chainId, - coreAddress, - coreVersion: ContractVersion.Gov, - name: getDisplayNameForChainId(chainId), - description: getChainGovernanceDaoDescription(chainId), - imageUrl: getImageUrlForChainId(chainId), + info: { + chainId, + coreAddress, + coreVersion: ContractVersion.Gov, + name: getDisplayNameForChainId(chainId), + description: getChainGovernanceDaoDescription(chainId), + imageUrl: getImageUrlForChainId(chainId), + }, } } @@ -82,12 +84,14 @@ export const lazyDaoCardPropsSelector = selectorFamily< } return { - chainId, - coreAddress, - coreVersion, - name: config.name, - description: config.description, - imageUrl: config.image_url || getFallbackImage(coreAddress), + info: { + chainId, + coreAddress, + coreVersion, + name: config.name, + description: config.description, + imageUrl: config.image_url || getFallbackImage(coreAddress), + }, isInactive: INACTIVE_DAO_NAMES.includes(config.name), } }, @@ -114,28 +118,30 @@ export const daoDropdownInfoSelector: ( coreAddress, }) ) - const subDaos = CHAIN_SUBDAOS[chainId] || [] + const subDaos = getSupportedChainConfig(chainId)?.subDaos || [] return { chainId, coreAddress, - imageUrl: lazyInfo.imageUrl, - name: lazyInfo.name, - subDaos: get( - waitForAll( - subDaos.map((subDaoAddress) => - daoDropdownInfoSelector({ - chainId, - coreAddress: subDaoAddress, - parents: [...(parents ?? []), coreAddress], - // Prevents cycles. If one of our children is also our - // ancestor, don't let it load any children, but still load it - // so we can see the cycle exists. - noSubDaos: !!parents?.includes(subDaoAddress), - }) + imageUrl: lazyInfo.info.imageUrl, + name: lazyInfo.info.name, + subDaos: subDaos.length + ? get( + waitForAll( + subDaos.map((subDaoAddress) => + daoDropdownInfoSelector({ + chainId, + coreAddress: subDaoAddress, + parents: [...(parents ?? []), coreAddress], + // Prevents cycles. If one of our children is also our + // ancestor, don't let it load any children, but still load it + // so we can see the cycle exists. + noSubDaos: !!parents?.includes(subDaoAddress), + }) + ) + ) ) - ) - ), + : [], } } @@ -320,7 +326,9 @@ export const daoParentInfoSelector = selectorFamily< admin: '', registeredSubDao: !!childAddress && - !!CHAIN_SUBDAOS[chainId]?.includes(childAddress), + !!getSupportedChainConfig(chainId)?.subDaos?.includes( + childAddress + ), } ) } diff --git a/packages/state/recoil/selectors/indexer.ts b/packages/state/recoil/selectors/indexer.ts index da60b0cef..c2f0889b9 100644 --- a/packages/state/recoil/selectors/indexer.ts +++ b/packages/state/recoil/selectors/indexer.ts @@ -1,5 +1,5 @@ import Pusher from 'pusher-js' -import { selector, selectorFamily } from 'recoil' +import { selector, selectorFamily, waitForAllSettled } from 'recoil' import { Expiration, @@ -14,15 +14,19 @@ import { WEB_SOCKET_PUSHER_HOST, WEB_SOCKET_PUSHER_PORT, getSupportedChainConfig, + getSupportedChains, } from '@dao-dao/utils' import { + DaoProposalSearchResult, DaoSearchResult, GovProposalSearchResult, QueryIndexerOptions, QuerySnapperOptions, + SearchDaoProposalsOptions, SearchDaosOptions, SearchGovProposalsOptions, + getRecentDaoProposals, loadMeilisearchClient, queryIndexer, queryIndexerUpStatus, @@ -244,6 +248,56 @@ export const searchGovProposalsSelector = selectorFamily< }, }) +/** + * Get recent DAO proposals for a chain. + */ +export const chainRecentDaoProposalsSelector = selectorFamily< + DaoProposalSearchResult[], + SearchDaoProposalsOptions +>({ + key: 'chainRecentDaoProposals', + get: (options) => async () => await getRecentDaoProposals(options), +}) + +/** + * Get recent DAO proposals across all supported chains. + */ +export const recentDaoProposalsSelector = selectorFamily< + DaoProposalSearchResult[], + Omit +>({ + key: 'recentDaoProposals', + get: + (options) => + async ({ get }) => { + const chains = getSupportedChains({ hasIndexer: true }) + + // Get options.limit most recent across all chains by getting + // options.limit most recent per-chain, sorting, and then slicing only the + // first options.limit. + const all = get( + waitForAllSettled( + chains.map(({ chainId }) => + chainRecentDaoProposalsSelector({ + ...options, + chainId, + }) + ) + ) + ) + .flatMap((loadable) => loadable.valueMaybe() || []) + // Most recent first. + .sort( + (a, b) => + b.value.proposal.start_height - a.value.proposal.start_height + ) + // Get N most recent across all chains. + .slice(0, options.limit) + + return all + }, +}) + export const openProposalsSelector = selectorFamily< { proposalModuleAddress: string diff --git a/packages/state/recoil/selectors/treasury.ts b/packages/state/recoil/selectors/treasury.ts index f10cb4997..32d5a111e 100644 --- a/packages/state/recoil/selectors/treasury.ts +++ b/packages/state/recoil/selectors/treasury.ts @@ -7,6 +7,7 @@ import { Account, AccountType, AmountWithTimestamp, + ChainId, GenericToken, GenericTokenSource, LoadingTokens, @@ -17,6 +18,7 @@ import { } from '@dao-dao/types' import { COMMUNITY_POOL_ADDRESS_PLACEHOLDER, + NEUTRON_GOVERNANCE_DAO, convertMicroDenomToDenomWithDecimals, getNativeTokenForChainId, getTokenForChainIdAndDenom, @@ -27,7 +29,6 @@ import { import { accountsSelector } from './account' import { blockHeightTimestampSafeSelector, - communityPoolBalancesSelector, cosmWasmClientForChainSelector, nativeDelegatedBalanceSelector, } from './chain' @@ -36,7 +37,6 @@ import { genericTokenBalancesSelector, genericTokenSelector, tokenCardLazyInfoSelector, - usdPriceSelector, } from './token' type TreasuryTransactionsParams = WithChainId<{ @@ -180,7 +180,10 @@ export const daoTvlSelector = selectorFamily< ({ get }) => { // Native chain x/gov module. if (isConfiguredChainName(chainId, coreAddress)) { - return get(communityPoolTvlSelector({ chainId })) + coreAddress = + chainId === ChainId.NeutronMainnet + ? NEUTRON_GOVERNANCE_DAO + : COMMUNITY_POOL_ADDRESS_PLACEHOLDER } const timestamp = new Date() @@ -202,47 +205,6 @@ export const daoTvlSelector = selectorFamily< }, }) -export const communityPoolTvlSelector = selectorFamily< - AmountWithTimestamp, - WithChainId<{}> ->({ - key: 'communityPoolTvl', - get: - ({ chainId }) => - async ({ get }) => { - const timestamp = new Date() - - const tokenBalances = get(communityPoolBalancesSelector({ chainId })) - - const prices = tokenBalances.map( - ({ token: { chainId, type, denomOrAddress, decimals }, balance }) => { - // Don't calculate price if could not load token decimals correctly. - if (decimals === 0) { - return 0 - } - - const price = get( - usdPriceSelector({ - type, - denomOrAddress, - chainId, - }) - )?.usdPrice - - return price - ? convertMicroDenomToDenomWithDecimals(balance, decimals) * price - : 0 - } - ) - const amount = prices.reduce((price, total) => price + total, 0) - - return { - amount, - timestamp, - } - }, -}) - // lazyInfo must be loaded in the component separately, since it refreshes on a // timer and we don't want this whole selector to reevaluate and load when that // refreshes. Use `tokenCardLazyInfoSelector`. diff --git a/packages/state/recoil/selectors/wallet.ts b/packages/state/recoil/selectors/wallet.ts index d8143bc28..4086cfeef 100644 --- a/packages/state/recoil/selectors/wallet.ts +++ b/packages/state/recoil/selectors/wallet.ts @@ -526,13 +526,15 @@ export const lazyWalletDaosSelector = selectorFamily< const lazyDaoCards = daos.map( ({ dao, info, config, proposalCount }): LazyDaoCardProps => ({ - chainId, - coreAddress: dao, - coreVersion: - parseContractVersion(info.version) || ContractVersion.Unknown, - name: config.name, - description: config.description, - imageUrl: config.image_url || getFallbackImage(dao), + info: { + chainId, + coreAddress: dao, + coreVersion: + parseContractVersion(info.version) || ContractVersion.Unknown, + name: config.name, + description: config.description, + imageUrl: config.image_url || getFallbackImage(dao), + }, isInactive: INACTIVE_DAO_NAMES.includes(config.name) || proposalCount === 0, }) diff --git a/packages/stateful/command/hooks/useFollowingAndFilteredDaosSections.ts b/packages/stateful/command/hooks/useFollowingAndFilteredDaosSections.ts index a3f3e68c3..e626ef4e5 100644 --- a/packages/stateful/command/hooks/useFollowingAndFilteredDaosSections.ts +++ b/packages/stateful/command/hooks/useFollowingAndFilteredDaosSections.ts @@ -21,8 +21,8 @@ import { } from '@dao-dao/utils' import { - useLoadingFeaturedDaoCardInfos, - useLoadingFollowingDaoCardInfos, + useLoadingFeaturedDaoCards, + useLoadingFollowingDaos, } from '../../hooks' export interface UseFilteredDaosSectionOptions { @@ -41,8 +41,8 @@ export const useFollowingAndFilteredDaosSections = ({ const { t } = useTranslation() const chains = getSupportedChains({ hasIndexer: true }) - const featuredDaosLoading = useLoadingFeaturedDaoCardInfos() - const followingDaosLoading = useLoadingFollowingDaoCardInfos() + const featuredDaosLoading = useLoadingFeaturedDaoCards() + const followingDaosLoading = useLoadingFollowingDaos() const { getDaoPath } = useDaoNavHelpers() const queryResults = useCachedLoadable( @@ -104,7 +104,7 @@ export const useFollowingAndFilteredDaosSections = ({ : // Otherwise when filter is empty, display featured DAOs. featuredDaosLoading.loading ? [] - : featuredDaosLoading.data), + : featuredDaosLoading.data.map((d) => d.info)), // Add configured chains. ...getConfiguredChains().flatMap( ({ diff --git a/packages/stateful/command/hooks/useNavigationSection.ts b/packages/stateful/command/hooks/useNavigationSection.ts index 2cd692d3e..7d35a0fd9 100644 --- a/packages/stateful/command/hooks/useNavigationSection.ts +++ b/packages/stateful/command/hooks/useNavigationSection.ts @@ -4,10 +4,14 @@ import { useTranslation } from 'react-i18next' import { CommandModalContextSection } from '@dao-dao/types' +import { useWallet } from '../../hooks' + export const useNavigationSection = (): CommandModalContextSection => { const { t } = useTranslation() const router = useRouter() + const { isWalletConnected } = useWallet() + const navigationSection: CommandModalContextSection<{ href: string }> = { @@ -19,11 +23,15 @@ export const useNavigationSection = (): CommandModalContextSection => { Icon: HomeOutlined, href: '/', }, - { - name: t('title.notifications'), - Icon: NotificationsOutlined, - href: '/notifications', - }, + ...(isWalletConnected + ? [ + { + name: t('title.notifications'), + Icon: NotificationsOutlined, + href: '/notifications', + }, + ] + : []), { name: t('title.createADAO'), Icon: Add, diff --git a/packages/stateful/components/DaoCreatedModal.tsx b/packages/stateful/components/DaoCreatedModal.tsx index 271605d65..dd93d0eec 100644 --- a/packages/stateful/components/DaoCreatedModal.tsx +++ b/packages/stateful/components/DaoCreatedModal.tsx @@ -23,8 +23,8 @@ export const DaoCreatedModal = ({ useFollowingDaos() const followedDao: DaoSource = { - chainId: itemProps.chainId, - coreAddress: itemProps.coreAddress, + chainId: itemProps.info.chainId, + coreAddress: itemProps.info.coreAddress, } const follow: FollowState = { following: isFollowing(followedDao), @@ -36,14 +36,12 @@ export const DaoCreatedModal = ({ } return ( - + diff --git a/packages/stateful/components/DappLayout.tsx b/packages/stateful/components/DappLayout.tsx index af0b15ff4..1b5d9dc02 100644 --- a/packages/stateful/components/DappLayout.tsx +++ b/packages/stateful/components/DappLayout.tsx @@ -202,7 +202,6 @@ export const DappLayout = ({ children }: { children: ReactNode }) => { modalProps={{ onClose: () => setDaoCreatedCardProps(undefined), }} - subDao={!!daoCreatedCardProps.parentDao} /> )} diff --git a/packages/stateful/components/ProposalLine.tsx b/packages/stateful/components/ProposalLine.tsx index 5b88d4f17..d78e7631d 100644 --- a/packages/stateful/components/ProposalLine.tsx +++ b/packages/stateful/components/ProposalLine.tsx @@ -1,12 +1,22 @@ import { useTranslation } from 'react-i18next' -import { ChainProvider, LineLoader, StatusCard } from '@dao-dao/stateless' -import { StatefulProposalLineProps } from '@dao-dao/types' +import { + ChainProvider, + LineLoader, + StatusCard, + useCachedLoadingWithError, + useDaoNavHelpers, +} from '@dao-dao/stateless' +import { + StatefulLazyProposalLineProps, + StatefulProposalLineProps, +} from '@dao-dao/types' import { ProposalModuleAdapterProvider, useProposalModuleAdapter, } from '../proposal-module-adapter' +import { daoCoreProposalModulesSelector } from '../recoil' import { LinkWrapper } from './LinkWrapper' import { SuspenseLoader } from './SuspenseLoader' @@ -65,3 +75,31 @@ const InnerProposalLine = ({ ) } + +export const LazyProposalLine = (props: StatefulLazyProposalLineProps) => { + const proposalModules = useCachedLoadingWithError( + daoCoreProposalModulesSelector({ + chainId: props.chainId, + coreAddress: props.coreAddress, + }) + ) + const { getDaoProposalPath } = useDaoNavHelpers() + + return ( + } + forceFallback={proposalModules.loading || proposalModules.errored} + > + {!proposalModules.loading && !proposalModules.errored && ( + + )} + + ) +} diff --git a/packages/stateful/components/ProposalList.tsx b/packages/stateful/components/ProposalList.tsx index 94a0d7e6b..afc18e466 100644 --- a/packages/stateful/components/ProposalList.tsx +++ b/packages/stateful/components/ProposalList.tsx @@ -55,7 +55,7 @@ export const ProposalList = ({ }: StatefulProposalListProps) => { const { t } = useTranslation() const chain = useChain() - const { coreAddress, proposalModules } = useDaoInfoContext() + const { coreAddress, proposalModules, name: daoName } = useDaoInfoContext() const { getDaoProposalPath } = useDaoNavHelpers() const { mode } = useAppContext() const { isMember = false } = useMembership({ @@ -363,6 +363,7 @@ export const ProposalList = ({ ProposalLine={ProposalLine} canLoadMore={canLoadMore} createNewProposalHref={getDaoProposalPath(coreAddress, 'create')} + daoName={daoName} daosWithVetoableProposals={ daosWithVetoableProposals.loading || daosWithVetoableProposals.errored ? [] diff --git a/packages/stateful/components/SdaLayout.tsx b/packages/stateful/components/SdaLayout.tsx index f6187a95d..cf5da32d5 100644 --- a/packages/stateful/components/SdaLayout.tsx +++ b/packages/stateful/components/SdaLayout.tsx @@ -64,7 +64,6 @@ export const SdaLayout = ({ children }: { children: ReactNode }) => { { modalProps={{ onClose: () => setDaoCreatedCardProps(undefined), }} - subDao={!!daoCreatedCardProps} /> )} diff --git a/packages/stateful/components/dao/CreateDaoForm.tsx b/packages/stateful/components/dao/CreateDaoForm.tsx index b05a9be80..ea9ef92f7 100644 --- a/packages/stateful/components/dao/CreateDaoForm.tsx +++ b/packages/stateful/components/dao/CreateDaoForm.tsx @@ -593,28 +593,42 @@ export const InnerCreateDaoForm = ({ // Set card props to show modal. setDaoCreatedCardProps({ - chainId, - coreAddress, - coreVersion, - name, - description, - imageUrl: imageUrl || getFallbackImage(coreAddress), - polytoneProxies: {}, - established: new Date(), - showIsMember: false, - parentDao, - tokenDecimals, - tokenSymbol, - showingEstimatedUsdValue: false, + info: { + admin: parentDao?.coreAddress || coreAddress, + chainId, + coreAddress, + coreVersion, + name, + description, + imageUrl: imageUrl || getFallbackImage(coreAddress), + parentDao: parentDao || null, + // Unused. + supportedFeatures: {} as any, + created: Date.now(), + votingModuleAddress: '', + votingModuleContractName: '', + proposalModules: [], + isActive: true, + activeThreshold: null, + items: {}, + polytoneProxies: {}, + accounts: [], + }, lazyData: { loading: false, data: { - tokenBalance, // Does not matter, will not show. isMember: false, proposalCount: 0, + tokenWithBalance: { + balance: tokenBalance, + symbol: tokenSymbol, + decimals: tokenDecimals, + }, }, }, + showIsMember: false, + showingEstimatedUsdValue: false, }) // Clear saved form data. diff --git a/packages/stateful/components/dao/DaoCard.tsx b/packages/stateful/components/dao/DaoCard.tsx index b3536771e..f8aa7cf6c 100644 --- a/packages/stateful/components/dao/DaoCard.tsx +++ b/packages/stateful/components/dao/DaoCard.tsx @@ -3,13 +3,16 @@ import { useCachedLoading, } from '@dao-dao/stateless' import { DaoSource } from '@dao-dao/types' -import { DaoCardInfo, FollowState } from '@dao-dao/types/components/DaoCard' +import { + FollowState, + StatefulDaoCardProps, +} from '@dao-dao/types/components/DaoCard' import { useFollowingDaos, useProfile } from '../../hooks' -import { daoCardInfoLazyDataSelector } from '../../recoil' +import { daoCardLazyDataSelector } from '../../recoil' import { LinkWrapper } from '../LinkWrapper' -export const DaoCard = (props: DaoCardInfo) => { +export const DaoCard = (props: StatefulDaoCardProps) => { // Don't load chain-specific profile because the wallet may not be connected // to that chain and thus the correct profile won't load. Instead, fetch the // chains from the currently connected profile and find the correct one. @@ -19,23 +22,23 @@ export const DaoCard = (props: DaoCardInfo) => { useFollowingDaos() const lazyData = useCachedLoading( - daoCardInfoLazyDataSelector({ - coreAddress: props.coreAddress, - chainId: props.chainId, + daoCardLazyDataSelector({ + coreAddress: props.info.coreAddress, + chainId: props.info.chainId, walletAddress: chains.loading ? undefined - : chains.data.find((chain) => chain.chainId === props.chainId)?.address, + : chains.data.find((chain) => chain.chainId === props.info.chainId) + ?.address, }), { isMember: false, - tokenBalance: NaN, proposalCount: NaN, } ) const followedDao: DaoSource = { - chainId: props.chainId, - coreAddress: props.coreAddress, + chainId: props.info.chainId, + coreAddress: props.info.coreAddress, } const follow: FollowState = { following: isFollowing(followedDao), diff --git a/packages/stateful/components/dao/DaoPageWrapper.tsx b/packages/stateful/components/dao/DaoPageWrapper.tsx index 6978c8abf..54cc144a8 100644 --- a/packages/stateful/components/dao/DaoPageWrapper.tsx +++ b/packages/stateful/components/dao/DaoPageWrapper.tsx @@ -12,11 +12,7 @@ import { useCachedLoadingWithError, useThemeContext, } from '@dao-dao/stateless' -import { - CommonProposalInfo, - DaoInfo, - DaoInfoSerializable, -} from '@dao-dao/types' +import { CommonProposalInfo, DaoInfo } from '@dao-dao/types' import { getFallbackImage, transformIpfsUrlToHttpsIfNecessary, @@ -33,7 +29,7 @@ export type DaoPageWrapperProps = PropsWithChildren<{ title: string description: string accentColor?: string | null - serializedInfo?: DaoInfoSerializable + info?: DaoInfo error?: string setIcon?: (icon: string | undefined) => void }> @@ -47,7 +43,7 @@ export const DaoPageWrapper = ({ title, description, accentColor, - serializedInfo, + info: _info, error, setIcon, children, @@ -59,7 +55,7 @@ export const DaoPageWrapper = ({ const [walletChainId, setWalletChainId] = useRecoilState(walletChainIdAtom) // Update walletChainId to whatever the current DAO is to ensure we connect // correctly. - const currentChainId = serializedInfo?.chainId + const currentChainId = _info?.chainId useEffect(() => { if (currentChainId && currentChainId !== walletChainId) { setWalletChainId(currentChainId) @@ -94,35 +90,30 @@ export const DaoPageWrapper = ({ // Load all accounts since the static props only loads some. This should load // faster than the DAO info selector below that will eventually replace this. const accounts = useCachedLoadingWithError( - serializedInfo + _info ? accountsSelector({ - chainId: serializedInfo.chainId, - address: serializedInfo.coreAddress, + chainId: _info.chainId, + address: _info.coreAddress, }) : undefined ) const info = useMemo( (): DaoInfo | undefined => - serializedInfo && { - ...serializedInfo, + _info && { + ..._info, accounts: - accounts.loading || accounts.errored - ? serializedInfo.accounts - : accounts.data, - created: serializedInfo.created - ? new Date(serializedInfo.created) - : undefined, + accounts.loading || accounts.errored ? _info.accounts : accounts.data, }, - [serializedInfo, accounts] + [_info, accounts] ) // Load DAO info once static props are loaded so it's more up to date. const loadingDaoInfo = useCachedLoadingWithError( - serializedInfo + info ? daoInfoSelector({ - chainId: serializedInfo.chainId, - coreAddress: serializedInfo.coreAddress, + chainId: info.chainId, + coreAddress: info.coreAddress, }) : undefined ) diff --git a/packages/stateful/components/dao/DaoProposal.tsx b/packages/stateful/components/dao/DaoProposal.tsx index 062453fc9..8d9ddc08a 100644 --- a/packages/stateful/components/dao/DaoProposal.tsx +++ b/packages/stateful/components/dao/DaoProposal.tsx @@ -325,21 +325,18 @@ const InnerDaoProposal = ({ proposalInfo }: InnerDaoProposalProps) => { ) } -export const DaoProposal = ({ - proposalInfo, - serializedInfo, -}: DaoProposalProps) => - proposalInfo && serializedInfo ? ( +export const DaoProposal = ({ proposalInfo, info }: DaoProposalProps) => + proposalInfo && info ? ( diff --git a/packages/stateful/components/dao/LazyDaoCard.tsx b/packages/stateful/components/dao/LazyDaoCard.tsx index 7950b3036..39c05d8dc 100644 --- a/packages/stateful/components/dao/LazyDaoCard.tsx +++ b/packages/stateful/components/dao/LazyDaoCard.tsx @@ -5,53 +5,70 @@ import { useCachedLoadingWithError } from '@dao-dao/stateless' import { LazyDaoCardProps } from '@dao-dao/types' import { processError } from '@dao-dao/utils' -import { daoCardInfoSelector } from '../../recoil' +import { daoInfoSelector } from '../../recoil' import { DaoCard } from './DaoCard' export const LazyDaoCard = (props: LazyDaoCardProps) => { const { t } = useTranslation() - const daoCardInfo = useCachedLoadingWithError( - daoCardInfoSelector({ - chainId: props.chainId, - coreAddress: props.coreAddress, + const daoInfo = useCachedLoadingWithError( + daoInfoSelector({ + chainId: props.info.chainId, + coreAddress: props.info.coreAddress, }) ) - return daoCardInfo.loading ? ( + return daoInfo.loading ? ( - ) : daoCardInfo.errored || !daoCardInfo.data ? ( + ) : daoInfo.errored || !daoInfo.data ? ( ) : ( - + ) } diff --git a/packages/stateful/components/dao/MainDaoInfoCards.tsx b/packages/stateful/components/dao/MainDaoInfoCards.tsx index fb3a6e5a9..0a6f0788f 100644 --- a/packages/stateful/components/dao/MainDaoInfoCards.tsx +++ b/packages/stateful/components/dao/MainDaoInfoCards.tsx @@ -105,7 +105,7 @@ const InnerMainDaoInfoCards = () => { { label: t('title.established'), tooltip: t('info.establishedTooltip'), - value: formatDate(created), + value: formatDate(new Date(created)), }, ] : []), diff --git a/packages/stateful/components/dao/tabs/SubDaosTab.tsx b/packages/stateful/components/dao/tabs/SubDaosTab.tsx index 97119eda2..3bc53c36a 100644 --- a/packages/stateful/components/dao/tabs/SubDaosTab.tsx +++ b/packages/stateful/components/dao/tabs/SubDaosTab.tsx @@ -10,7 +10,7 @@ import { getDaoProposalSinglePrefill } from '@dao-dao/utils' import { useActionForKey } from '../../../actions' import { useMembership } from '../../../hooks' -import { subDaoCardInfosSelector } from '../../../recoil' +import { subDaoInfosSelector } from '../../../recoil' import { ButtonLink } from '../../ButtonLink' import { DaoCard } from '../DaoCard' @@ -23,7 +23,7 @@ export const SubDaosTab = () => { const subDaos = useCachedLoading( daoInfo.supportedFeatures[Feature.SubDaos] - ? subDaoCardInfosSelector({ chainId, coreAddress: daoInfo.coreAddress }) + ? subDaoInfosSelector({ chainId, coreAddress: daoInfo.coreAddress }) : // Passing undefined here returns an infinite loading state, which is // fine because it's never used. undefined, diff --git a/packages/stateful/components/gov/GovInfoBar.tsx b/packages/stateful/components/gov/GovInfoBar.tsx index ea83e664d..1bb71f019 100644 --- a/packages/stateful/components/gov/GovInfoBar.tsx +++ b/packages/stateful/components/gov/GovInfoBar.tsx @@ -1,20 +1,22 @@ import { useTranslation } from 'react-i18next' -import { communityPoolTvlSelector } from '@dao-dao/state' +import { daoTvlSelector } from '@dao-dao/state' import { DaoInfoCards, TokenAmountDisplay, useCachedLoading, useChain, } from '@dao-dao/stateless' +import { COMMUNITY_POOL_ADDRESS_PLACEHOLDER } from '@dao-dao/utils' export const GovInfoBar = () => { const { t } = useTranslation() const { chain_id: chainId } = useChain() - const treasuryUsdcValueLoading = useCachedLoading( - communityPoolTvlSelector({ + const treasuryUsdValueLoading = useCachedLoading( + daoTvlSelector({ chainId, + coreAddress: COMMUNITY_POOL_ADDRESS_PLACEHOLDER, }), { amount: -1, @@ -31,17 +33,17 @@ export const GovInfoBar = () => { value: ( { ProposalLine={GovProposalLine} canLoadMore={!showingSearchResults && page < maxPage} createNewProposalHref={asPath + '/create'} + daoName={getDisplayNameForChainId(chain.chain_id)} daosWithVetoableProposals={[]} isMember={true} loadMore={goToNextPage} diff --git a/packages/stateful/components/gov/GovSubDaosTab.tsx b/packages/stateful/components/gov/GovSubDaosTab.tsx index ca921cce4..ed142abb8 100644 --- a/packages/stateful/components/gov/GovSubDaosTab.tsx +++ b/packages/stateful/components/gov/GovSubDaosTab.tsx @@ -7,10 +7,10 @@ import { useCachedLoading, useChain, } from '@dao-dao/stateless' -import { CHAIN_SUBDAOS } from '@dao-dao/utils' +import { getSupportedChainConfig } from '@dao-dao/utils' import { GovActionsProvider } from '../../actions' -import { daoCardInfoSelector } from '../../recoil' +import { daoInfoSelector } from '../../recoil' import { ButtonLink } from '../ButtonLink' import { DaoCard } from '../dao/DaoCard' @@ -19,8 +19,8 @@ export const GovSubDaosTab = () => { const subDaos = useCachedLoading( waitForAll( - CHAIN_SUBDAOS[chainId]?.map((coreAddress) => - daoCardInfoSelector({ chainId, coreAddress }) + getSupportedChainConfig(chainId)?.subDaos?.map((coreAddress) => + daoInfoSelector({ chainId, coreAddress }) ) ?? [] ), [] diff --git a/packages/stateful/components/pages/Home.tsx b/packages/stateful/components/pages/Home.tsx index ec110137b..c10eddbb9 100644 --- a/packages/stateful/components/pages/Home.tsx +++ b/packages/stateful/components/pages/Home.tsx @@ -1,41 +1,65 @@ +import clsx from 'clsx' +import { NextPage } from 'next' import { NextSeo } from 'next-seo' import { useRouter } from 'next/router' -import { useEffect } from 'react' +import { useCallback, useEffect } from 'react' import { useTranslation } from 'react-i18next' import { useSetRecoilState } from 'recoil' -import { walletChainIdAtom } from '@dao-dao/state' +import { commandModalVisibleAtom, walletChainIdAtom } from '@dao-dao/state' import { ChainPickerPopup, Logo, Home as StatelessHome, } from '@dao-dao/stateless' +import { + DaoDaoIndexerAllStats, + DaoInfo, + DaoSource, + LoadingData, + StatefulDaoCardProps, +} from '@dao-dao/types' import { SITE_TITLE, SITE_URL, + UNDO_PAGE_PADDING_TOP_CLASSES, getSupportedChainConfig, - getSupportedChains, } from '@dao-dao/utils' -import { useLoadingFeaturedDaoCardInfos, useWallet } from '../../hooks' +import { + useLoadingDaos, + useLoadingFeaturedDaoCards, + useWallet, +} from '../../hooks' import { DaoCard } from '../dao' import { LinkWrapper } from '../LinkWrapper' import { PageHeaderContent } from '../PageHeaderContent' import { ProfileHome } from './ProfileHome' -export const Home = () => { +export type StatefulHomeProps = { + /** + * Optionally show chain-specific home page. + */ + chainId?: string + /** + * Stats for all chains or an individual chain if on a chain-specific home. + */ + stats: DaoDaoIndexerAllStats + /** + * Optionally show chain x/gov DAOs. + */ + chainGovDaos?: DaoInfo[] +} + +export const Home: NextPage = ({ + chainId, + stats, + chainGovDaos: _chainGovDaos, +}) => { const { t } = useTranslation() const { isWalletConnected } = useWallet() const router = useRouter() - const _tab = router.query.tab - const tabPath = _tab && Array.isArray(_tab) ? _tab[0] : undefined - - // If defined, try to find matching chain. If found, show chain-only page. - const chainId = tabPath - ? getSupportedChains().find(({ name }) => name === tabPath)?.chainId - : undefined - // Show profile page if wallet connected and not on a chain-only page. const onProfilePage = isWalletConnected && !chainId @@ -47,29 +71,49 @@ export const Home = () => { } }, [chainId, setWalletChainId]) - const featuredDaosLoading = useLoadingFeaturedDaoCardInfos(chainId) + const setCommandModalVisible = useSetRecoilState(commandModalVisibleAtom) + const openSearch = useCallback( + () => setCommandModalVisible(true), + [setCommandModalVisible] + ) - const chainPicker = ( - { - router.replace( - `/${(chainId && getSupportedChainConfig(chainId)?.name) || ''}`, - undefined, - { - shallow: true, - } - ) - }} - selectedChainId={chainId} - selectedLabelClassName="hidden xs:block" - showNone - /> + const selectedChain = chainId ? getSupportedChainConfig(chainId) : undefined + const selectedChainHasSubDaos = !!selectedChain?.subDaos?.length + const chainSubDaos = useLoadingDaos( + selectedChainHasSubDaos + ? { + loading: false, + data: + selectedChain?.subDaos?.map( + (coreAddress): DaoSource => ({ + chainId: chainId!, + coreAddress, + }) + ) ?? [], + } + : { + loading: true, + } ) + const chainGovDaos: LoadingData | undefined = + selectedChainHasSubDaos && chainSubDaos.loading + ? { + loading: true, + } + : _chainGovDaos?.length || + (selectedChainHasSubDaos && !chainSubDaos.loading) + ? { + loading: false, + data: [ + ...(_chainGovDaos || []), + ...(!chainSubDaos.loading ? chainSubDaos.data : []), + ].map((info): StatefulDaoCardProps => ({ info })), + } + : undefined + + const featuredDaosLoading = useLoadingFeaturedDaoCards(chainId) + return ( <> { ) : ( - <> +
{chainPicker}
} - rightNode={
{chainPicker}
} - title={t('title.home')} - titleClassName="hidden md:block" + centerNode={ + <> + {/* Mobile, centered */} + { + router.replace( + `/${ + (chainId && getSupportedChainConfig(chainId)?.name) || + '' + }` + ) + }} + selectedChainId={chainId} + selectedLabelClassName="hidden xs:block" + showNone + /> + + {/* Large screen, left-aligned */} + { + router.replace( + `/${ + (chainId && getSupportedChainConfig(chainId)?.name) || + '' + }` + ) + }} + selectedChainId={chainId} + selectedLabelClassName="!text-lg !header-text sm:!text-xl" + showNone + /> + + } /> + !chainGovDaos.data.some( + (chain) => + featured.info.coreAddress === + chain.info.coreAddress || + // If the chain itself uses a real DAO for its + // governance, such as Neutron, hide it from + // featured as well since it shows up above. This is + // needed because the DAO in the featured list uses + // the DAO's real address, while the DAO in the + // chain x/gov list is the name of the chain. + featured.info.coreAddress === + selectedChain?.govContractAddress + ) + ), + } + } + openSearch={openSearch} + stats={stats} /> - +
)} ) diff --git a/packages/stateful/components/wallet/WalletDaos.tsx b/packages/stateful/components/wallet/WalletDaos.tsx index 88d3844db..868864daa 100644 --- a/packages/stateful/components/wallet/WalletDaos.tsx +++ b/packages/stateful/components/wallet/WalletDaos.tsx @@ -76,21 +76,23 @@ export const WalletDaos = ({ address }: StatefulWalletDaosProps) => { const memberOf = memberOfLoadable.flatMap((l) => l.valueMaybe() || []) const following = allFollowing.flat() - const memberDaos = new Set(memberOf.map((dao) => serializeDaoSource(dao))) + const memberDaos = new Set( + memberOf.map((dao) => serializeDaoSource(dao.info)) + ) const followingDaos = new Set( - following.map((dao) => serializeDaoSource(dao)) + following.map((dao) => serializeDaoSource(dao.info)) ) // Combine DAOs and remove duplicates. return uniqBy([...memberOf, ...following], (dao) => - serializeDaoSource(dao) + serializeDaoSource(dao.info) ) .map((props) => ({ ...props, - isMember: memberDaos.has(serializeDaoSource(props)), - isFollowed: followingDaos.has(serializeDaoSource(props)), + isMember: memberDaos.has(serializeDaoSource(props.info)), + isFollowed: followingDaos.has(serializeDaoSource(props.info)), })) - .sort((a, b) => a.name.localeCompare(b.name)) + .sort((a, b) => a.info.name.localeCompare(b.info.name)) } ) diff --git a/packages/stateful/feed/react/useFeed.ts b/packages/stateful/feed/react/useFeed.ts index b3b31292e..abd0211be 100644 --- a/packages/stateful/feed/react/useFeed.ts +++ b/packages/stateful/feed/react/useFeed.ts @@ -140,8 +140,8 @@ export const useFeed = (): FeedState => { dao: { chainId, coreAddress, - name: daoLazyCardProps.contents[index].name, - imageUrl: daoLazyCardProps.contents[index].imageUrl, + name: daoLazyCardProps.contents[index].info.name, + imageUrl: daoLazyCardProps.contents[index].info.imageUrl, }, items, } diff --git a/packages/stateful/hooks/index.ts b/packages/stateful/hooks/index.ts index 6c2a16aca..e0767df82 100644 --- a/packages/stateful/hooks/index.ts +++ b/packages/stateful/hooks/index.ts @@ -14,7 +14,7 @@ export * from './useInbox' export * from './useInboxApi' export * from './useInboxApiWithUi' export * from './useInstantiateAndExecute' -export * from './useLoadingDaoCardInfos' +export * from './useLoadingDaos' export * from './useLoadingGovProposal' export * from './useLoadingGovProposalWalletVoteInfo' export * from './useManageProfile' diff --git a/packages/stateful/hooks/useGovDaoTabs.ts b/packages/stateful/hooks/useGovDaoTabs.ts index d6ea12ea5..267f8f428 100644 --- a/packages/stateful/hooks/useGovDaoTabs.ts +++ b/packages/stateful/hooks/useGovDaoTabs.ts @@ -11,7 +11,7 @@ import { useTranslation } from 'react-i18next' import { useChain } from '@dao-dao/stateless' import { DaoTabId, DaoTabWithComponent, LoadingData } from '@dao-dao/types' -import { CHAIN_SUBDAOS } from '@dao-dao/utils' +import { getSupportedChainConfig } from '@dao-dao/utils' import { GovCommunityPoolTab, @@ -44,7 +44,7 @@ export const useGovDaoTabs = (): LoadingData => { lazy: true, }, // If SubDAOs exist, show them. - ...(CHAIN_SUBDAOS[chainId]?.length + ...(getSupportedChainConfig(chainId)?.subDaos?.length ? [ { id: DaoTabId.SubDaos, diff --git a/packages/stateful/hooks/useLoadingDaoCardInfos.ts b/packages/stateful/hooks/useLoadingDaos.ts similarity index 71% rename from packages/stateful/hooks/useLoadingDaoCardInfos.ts rename to packages/stateful/hooks/useLoadingDaos.ts index a9f085446..2460bde3a 100644 --- a/packages/stateful/hooks/useLoadingDaoCardInfos.ts +++ b/packages/stateful/hooks/useLoadingDaos.ts @@ -5,22 +5,26 @@ import { indexerFeaturedDaosSelector, } from '@dao-dao/state/recoil' import { useCachedLoadable } from '@dao-dao/stateless' -import { DaoCardInfo, DaoSource, LoadingData } from '@dao-dao/types' +import { + DaoInfo, + DaoSource, + LoadingData, + StatefulDaoCardProps, +} from '@dao-dao/types' import { getSupportedChains } from '@dao-dao/utils' -import { daoCardInfoSelector } from '../recoil' +import { daoInfoSelector } from '../recoil' import { useProfile } from './useProfile' -export const useLoadingDaoCardInfos = ( +export const useLoadingDaos = ( daos: LoadingData, alphabetize = false -): LoadingData => { - // If `coreAddresses` is undefined, we're still loading DAOs. - const daoCardInfosLoadable = useCachedLoadable( +): LoadingData => { + const daoInfosLoadable = useCachedLoadable( !daos.loading ? waitForAll( daos.data.map(({ chainId, coreAddress }) => - daoCardInfoSelector({ + daoInfoSelector({ chainId, coreAddress, }) @@ -29,22 +33,22 @@ export const useLoadingDaoCardInfos = ( : undefined ) - return daoCardInfosLoadable.state !== 'hasValue' + return daoInfosLoadable.state !== 'hasValue' ? { loading: true } : { loading: false, - updating: daoCardInfosLoadable.updating, - data: ( - daoCardInfosLoadable.contents.filter(Boolean) as DaoCardInfo[] - ).sort((a, b) => (alphabetize ? a.name.localeCompare(b.name) : 0)), + updating: daoInfosLoadable.updating, + data: (daoInfosLoadable.contents.filter(Boolean) as DaoInfo[]).sort( + (a, b) => (alphabetize ? a.name.localeCompare(b.name) : 0) + ), } } -export const useLoadingFeaturedDaoCardInfos = ( +export const useLoadingFeaturedDaoCards = ( // If passed, will only load DAOs from this chain. Otherwise, will load // from all chains. chainId?: string -): LoadingData => { +): LoadingData => { const chains = getSupportedChains().filter( ({ chain: { chain_id } }) => !chainId || chain_id === chainId ) @@ -54,7 +58,7 @@ export const useLoadingFeaturedDaoCardInfos = ( ) ) - return useLoadingDaoCardInfos( + const daos = useLoadingDaos( featuredDaos.state === 'loading' ? { loading: true } : featuredDaos.state === 'hasError' @@ -75,13 +79,25 @@ export const useLoadingFeaturedDaoCardInfos = ( .sort((a, b) => a.order - b.order), } ) + + return daos.loading + ? daos + : { + loading: false, + updating: daos.updating, + data: daos.data.map( + (info): StatefulDaoCardProps => ({ + info, + }) + ), + } } -export const useLoadingFollowingDaoCardInfos = ( +export const useLoadingFollowingDaos = ( // If passed, will only load DAOs from this chain. Otherwise, will load from // all chains. chainId?: string -): LoadingData => { +): LoadingData => { const { uniquePublicKeys } = useProfile() const followingDaosLoading = useRecoilValueLoadable( @@ -96,7 +112,7 @@ export const useLoadingFollowingDaoCardInfos = ( : constSelector([]) ) - return useLoadingDaoCardInfos( + return useLoadingDaos( followingDaosLoading.state === 'loading' ? { loading: true } : followingDaosLoading.state === 'hasError' diff --git a/packages/stateful/recoil/selectors/dao.ts b/packages/stateful/recoil/selectors/dao.ts index 5b81802d2..f8a9efa40 100644 --- a/packages/stateful/recoil/selectors/dao.ts +++ b/packages/stateful/recoil/selectors/dao.ts @@ -28,81 +28,41 @@ import { } from '@dao-dao/state' import { ChainId, - ContractVersion, - DaoCardInfo, - DaoCardInfoLazyData, + DaoCardLazyData, DaoInfo, DaoPageMode, DaoParentInfo, DaoSource, DaoWithDropdownVetoableProposalList, DaoWithVetoableProposals, - Feature, IndexerDaoWithVetoableProposals, ProposalModule, StatefulProposalLineProps, - SupportedFeatureMap, WithChainId, } from '@dao-dao/types' import { - CHAIN_SUBDAOS, DaoVotingCw20StakedAdapterId, NEUTRON_GOVERNANCE_DAO, - getChainGovernanceDaoDescription, + getDaoInfoForChainId, getDaoProposalPath, - getDisplayNameForChainId, getFallbackImage, - getImageUrlForChainId, + getSupportedChainConfig, getSupportedFeatures, isConfiguredChainName, - mustGetConfiguredChainConfig, } from '@dao-dao/utils' import { proposalModuleAdapterProposalCountSelector } from '../../proposal-module-adapter' import { fetchProposalModules } from '../../utils/fetchProposalModules' import { matchAdapter as matchVotingModuleAdapter } from '../../voting-module-adapter' -export const daoCardInfoSelector = selectorFamily< - DaoCardInfo, - WithChainId<{ coreAddress: string }> ->({ - key: 'daoCardInfo', - get: - ({ chainId, coreAddress }) => - ({ get }) => { - const daoInfo = get( - daoInfoSelector({ - chainId, - coreAddress, - }) - ) - - return { - chainId: daoInfo.chainId, - coreAddress: daoInfo.coreAddress, - coreVersion: daoInfo.coreVersion, - name: daoInfo.name, - description: daoInfo.description, - imageUrl: daoInfo.imageUrl || getFallbackImage(daoInfo.coreAddress), - polytoneProxies: daoInfo.polytoneProxies, - established: daoInfo.created, - parentDao: daoInfo.parentDao ?? undefined, - tokenDecimals: 6, - tokenSymbol: '', - showingEstimatedUsdValue: true, - lazyData: { loading: true }, - } - }, -}) - -export const daoCardInfoLazyDataSelector = selectorFamily< - DaoCardInfoLazyData, +export const daoCardLazyDataSelector = selectorFamily< + DaoCardLazyData, WithChainId<{ coreAddress: string walletAddress?: string }> >({ - key: 'daoCardInfoLazyData', + key: 'daoCardLazyData', get: ({ coreAddress, chainId, walletAddress }) => ({ get }) => { @@ -115,27 +75,36 @@ export const daoCardInfoLazyDataSelector = selectorFamily< // Native chain x/gov module. if (isConfiguredChainName(chainId, coreAddress)) { - // Get proposal count by loading one proposal and getting the total. - const { total: proposalCount } = get( - govProposalsSelector({ - chainId, - limit: 1, - }) - ) + // Neutron uses an actual DAO so load it instead. + if (chainId === ChainId.NeutronMainnet) { + coreAddress = NEUTRON_GOVERNANCE_DAO + } else { + // Get proposal count by loading one proposal and getting the total. + const { total: proposalCount } = get( + govProposalsSelector({ + chainId, + limit: 1, + }) + ) - const isMember = walletAddress - ? get( - nativeDelegatedBalanceSelector({ - chainId, - address: walletAddress, - }) - ).amount !== '0' - : false + const isMember = walletAddress + ? get( + nativeDelegatedBalanceSelector({ + chainId, + address: walletAddress, + }) + ).amount !== '0' + : false - return { - isMember, - tokenBalance: tvl, - proposalCount, + return { + isMember, + proposalCount, + tokenWithBalance: { + balance: tvl, + symbol: 'USD', + decimals: 2, + }, + } } } @@ -172,43 +141,19 @@ export const daoCardInfoLazyDataSelector = selectorFamily< return { isMember: walletVotingWeight > 0, - tokenBalance: tvl, proposalCount: proposalModuleCounts.reduce( (acc, curr) => acc + curr, 0 ), + tokenWithBalance: { + balance: tvl, + symbol: 'USD', + decimals: 2, + }, } }, }) -export const subDaoCardInfosSelector = selectorFamily< - DaoCardInfo[], - WithChainId<{ coreAddress: string }> ->({ - key: 'subDaoCardInfos', - get: - ({ coreAddress: contractAddress, chainId }) => - ({ get }) => { - const subDaos = get( - DaoCoreV2Selectors.listAllSubDaosSelector({ - contractAddress, - chainId, - }) - ) - - return get( - waitForAll( - subDaos.map(({ chainId, addr }) => - daoCardInfoSelector({ - chainId, - coreAddress: addr, - }) - ) - ) - ).filter(Boolean) as DaoCardInfo[] - }, -}) - export const subDaoInfosSelector = selectorFamily< DaoInfo[], WithChainId<{ coreAddress: string }> @@ -245,18 +190,19 @@ export const chainSubDaoInfosSelector = selectorFamily< get: ({ chainId }) => ({ get }) => { - const subDaos = CHAIN_SUBDAOS[chainId] || [] - - return get( - waitForAll( - subDaos.map((coreAddress) => - daoInfoSelector({ - chainId, - coreAddress, - }) + const subDaos = getSupportedChainConfig(chainId)?.subDaos || [] + return subDaos.length + ? get( + waitForAll( + subDaos.map((coreAddress) => + daoInfoSelector({ + chainId, + coreAddress, + }) + ) + ) ) - ) - ) + : [] }, }) @@ -379,9 +325,11 @@ export const daoInfoSelector = selectorFamily< ({ get }) => { // Native chain governance. if (isConfiguredChainName(chainId, coreAddress)) { - // Neutron uses an actual DAO so load it instead. - if (chainId === ChainId.NeutronMainnet) { - coreAddress = NEUTRON_GOVERNANCE_DAO + // If chain uses a contract-based DAO, load it instead. + const govContractAddress = + getSupportedChainConfig(chainId)?.govContractAddress + if (govContractAddress) { + coreAddress = govContractAddress } else { const govModuleAddress = get( moduleAddressSelector({ @@ -396,32 +344,7 @@ export const daoInfoSelector = selectorFamily< }) ) - return { - chainId, - coreAddress: mustGetConfiguredChainConfig(chainId).name, - coreVersion: ContractVersion.Gov, - supportedFeatures: Object.values(Feature).reduce( - (acc, feature) => ({ - ...acc, - [feature]: false, - }), - {} as SupportedFeatureMap - ), - votingModuleAddress: '', - votingModuleContractName: '', - proposalModules: [], - name: getDisplayNameForChainId(chainId), - description: getChainGovernanceDaoDescription(chainId), - imageUrl: getImageUrlForChainId(chainId), - created: undefined, - isActive: true, - activeThreshold: null, - items: {}, - polytoneProxies: {}, - accounts, - parentDao: null, - admin: '', - } + return getDaoInfoForChainId(chainId, accounts) } } @@ -548,8 +471,8 @@ export const daoInfoSelector = selectorFamily< proposalModules, name: dumpState.config.name, description: dumpState.config.description, - imageUrl: dumpState.config.image_url || null, - created, + imageUrl: dumpState.config.image_url || getFallbackImage(coreAddress), + created: created?.getTime() || null, isActive, activeThreshold, items, diff --git a/packages/stateful/server/makeGetDaoStaticProps.ts b/packages/stateful/server/makeGetDaoStaticProps.ts index 9d0aa8678..f901eeb67 100644 --- a/packages/stateful/server/makeGetDaoStaticProps.ts +++ b/packages/stateful/server/makeGetDaoStaticProps.ts @@ -39,7 +39,6 @@ import { } from '@dao-dao/types/contracts/DaoCore.v2' import { cosmos } from '@dao-dao/types/protobuf' import { - CHAIN_SUBDAOS, CI, ContractName, DAO_CORE_ACCENT_ITEM_KEY, @@ -49,7 +48,6 @@ import { LEGACY_URL_PREFIX, MAINNET, MAX_META_CHARS_PROPOSAL_DESCRIPTION, - NEUTRON_GOVERNANCE_DAO, addressIsModule, cosmWasmClientRouter, cosmosSdkVersionIs46OrHigher, @@ -60,6 +58,7 @@ import { getConfiguredGovChainByName, getDaoPath, getDisplayNameForChainId, + getFallbackImage, getImageUrlForChainId, getRpcForChainId, getSupportedChainConfig, @@ -144,9 +143,12 @@ export const makeGetDaoStaticProps: GetDaoStaticPropsMaker = ? getConfiguredGovChainByName(coreAddress) : undefined - // Render Neutron DAO instead of chain governance. - if (chainConfig?.chainId === ChainId.NeutronMainnet) { - coreAddress = NEUTRON_GOVERNANCE_DAO + // If chain uses a contract-based DAO, load it instead. + const govContractAddress = + chainConfig && + getSupportedChainConfig(chainConfig.chainId)?.govContractAddress + if (govContractAddress) { + coreAddress = govContractAddress chainConfig = undefined } @@ -189,7 +191,7 @@ export const makeGetDaoStaticProps: GetDaoStaticPropsMaker = .join(' | '), description, accentColor, - serializedInfo: { + info: { chainId: chain.chain_id, coreAddress: chainName, coreVersion: ContractVersion.Gov, @@ -400,7 +402,7 @@ export const makeGetDaoStaticProps: GetDaoStaticPropsMaker = .join(' | '), description: overrideDescription ?? config.description, accentColor: items[DAO_CORE_ACCENT_ITEM_KEY] || null, - serializedInfo: { + info: { chainId, coreAddress, coreVersion, @@ -410,8 +412,11 @@ export const makeGetDaoStaticProps: GetDaoStaticPropsMaker = proposalModules, name: config.name, description: config.description, - imageUrl: overrideImageUrl ?? config.image_url ?? null, - created: created?.toJSON() ?? null, + imageUrl: + overrideImageUrl || + config.image_url || + getFallbackImage(coreAddress), + created: created?.getTime() ?? null, isActive, activeThreshold, items, @@ -507,8 +512,8 @@ export const makeGetDaoStaticProps: GetDaoStaticPropsMaker = if ( MAINNET && 'props' in result && - // If no serialized info, no DAO found. - !result.props.serializedInfo && + // If no info, no DAO found. + !result.props.info && // Don't try Terra Classic if unexpected error occurred. !result.props.error && // Only try Terra Classic if Terra failed. @@ -987,7 +992,9 @@ const daoCoreDumpState = async ( registeredSubDao: indexerDumpedState.adminInfo?.registeredSubDao ?? (parentDaoInfo.coreVersion === ContractVersion.Gov && - CHAIN_SUBDAOS[chainId]?.includes(coreAddress)) ?? + getSupportedChainConfig(chainId)?.subDaos?.includes( + coreAddress + )) ?? false, } : null, @@ -1099,7 +1106,8 @@ const daoCoreDumpState = async ( registeredSubDao = subdaoAddrs.includes(coreAddress) } else if (parentDao.coreVersion === ContractVersion.Gov) { - registeredSubDao = !!CHAIN_SUBDAOS[chainId]?.includes(coreAddress) + registeredSubDao = + !!getSupportedChainConfig(chainId)?.subDaos?.includes(coreAddress) } } diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/MainDaoInfoCardsLoader.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/MainDaoInfoCardsLoader.tsx index d41f7a902..251f0d407 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/MainDaoInfoCardsLoader.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/MainDaoInfoCardsLoader.tsx @@ -15,7 +15,7 @@ export const MainDaoInfoCardsLoader = () => { { label: t('title.established'), tooltip: t('info.establishedTooltip'), - value: formatDate(created), + value: formatDate(new Date(created)), }, ] : []), diff --git a/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/MainDaoInfoCardsLoader.tsx b/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/MainDaoInfoCardsLoader.tsx index 620cda6ab..fdd265aa0 100644 --- a/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/MainDaoInfoCardsLoader.tsx +++ b/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/MainDaoInfoCardsLoader.tsx @@ -15,7 +15,7 @@ export const MainDaoInfoCardsLoader = () => { { label: t('title.established'), tooltip: t('info.establishedTooltip'), - value: formatDate(created), + value: formatDate(new Date(created)), }, ] : []), diff --git a/packages/stateless/components/HorizontalScroller.stories.tsx b/packages/stateless/components/HorizontalScroller.stories.tsx index f3c4f0037..5773cfeb7 100644 --- a/packages/stateless/components/HorizontalScroller.stories.tsx +++ b/packages/stateless/components/HorizontalScroller.stories.tsx @@ -1,9 +1,9 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' -import { DaoCard } from '@dao-dao/stateful' -import { CHAIN_ID } from '@dao-dao/storybook' -import { ContractVersion, DaoCardInfo } from '@dao-dao/types' +import { DaoCardProps } from '@dao-dao/types' +import { DaoCard } from './dao' +import { makeDaoCardProps } from './dao/DaoCard.stories' import { HorizontalScroller } from './HorizontalScroller' export default { @@ -11,71 +11,45 @@ export default { component: HorizontalScroller, } as ComponentMeta -const Template: ComponentStory> = ( +const Template: ComponentStory> = ( args ) => -let id = 0 -const makeFeaturedDao = (): DaoCardInfo => ({ - chainId: CHAIN_ID, - coreAddress: 'coreAddress' + ++id, - coreVersion: ContractVersion.V2Alpha, - name: 'Modern DAO ' + id, - description: - 'This approach allows us to implement a completely custom component design without writing a single line of custom CSS.', - imageUrl: `/placeholders/${(id % 5) + 1}.svg`, - polytoneProxies: {}, - established: new Date('May 14, 2022 00:00:00'), - tokenSymbol: 'JUNO', - showingEstimatedUsdValue: false, - tokenDecimals: 6, - - parentDao: { - chainId: CHAIN_ID, - coreAddress: 'parent', - coreVersion: ContractVersion.V2Alpha, - name: 'parent', - imageUrl: `/placeholders/${((id + 1) % 5) + 1}.svg`, - admin: 'parent', - registeredSubDao: true, - }, - - lazyData: { - loading: false, - data: { - isMember: Math.random() < 0.5, - tokenBalance: 120, - proposalCount: 25, - }, - }, -}) - export const FeaturedDaos = Template.bind({}) -// Clone object to prevent comparison issues in pages with sorting (like -// `HomeConnected`). FeaturedDaos.args = { Component: DaoCard, items: { loading: false, data: [ - makeFeaturedDao(), + makeDaoCardProps(), { - ...makeFeaturedDao(), - name: 'DAO DAO', - established: new Date('August 11, 2022 16:20:00'), + ...makeDaoCardProps(), + info: { + ...makeDaoCardProps().info, + name: 'DAO DAO', + created: new Date('August 11, 2022 16:20:00').getTime(), + }, }, - makeFeaturedDao(), + makeDaoCardProps(), { - ...makeFeaturedDao(), - established: new Date(), + ...makeDaoCardProps(), + info: { + ...makeDaoCardProps().info, + name: 'DAO DAO', + created: Date.now(), + }, }, { - ...makeFeaturedDao(), - name: 'A different DAO', + ...makeDaoCardProps(), + info: { + ...makeDaoCardProps().info, + name: 'A different DAO', + created: new Date('August 11, 2022 16:20:00').getTime(), + }, }, - makeFeaturedDao(), - makeFeaturedDao(), - makeFeaturedDao(), + makeDaoCardProps(), + makeDaoCardProps(), + makeDaoCardProps(), ], }, } diff --git a/packages/stateless/components/dao/DaoCard.stories.tsx b/packages/stateless/components/dao/DaoCard.stories.tsx index 3fd374ad0..1bf29733b 100644 --- a/packages/stateless/components/dao/DaoCard.stories.tsx +++ b/packages/stateless/components/dao/DaoCard.stories.tsx @@ -1,7 +1,7 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' import { CHAIN_ID } from '@dao-dao/storybook' -import { ContractVersion, DaoCardProps } from '@dao-dao/types' +import { ContractVersion, DaoCardProps, DaoInfo } from '@dao-dao/types' import { LinkWrapper } from '../LinkWrapper' import { DaoCard } from './DaoCard' @@ -9,7 +9,7 @@ import { DaoCard } from './DaoCard' export default { title: 'DAO DAO / packages / stateless / components / dao / DaoCard', component: DaoCard, - excludeStories: ['makeProps'], + excludeStories: ['makeDaoInfo', 'makeDaoCardProps'], } as ComponentMeta const Template: ComponentStory = (args) => ( @@ -18,54 +18,62 @@ const Template: ComponentStory = (args) => (
) -export const makeProps = (id = 1): DaoCardProps => ({ +export const makeDaoInfo = (id = 1): DaoInfo => ({ chainId: CHAIN_ID, - coreAddress: 'daoCoreAddress', - coreVersion: ContractVersion.V242, - name: 'Modern DAO', + coreAddress: 'coreAddress' + ++id, + coreVersion: ContractVersion.V2Alpha, + name: 'Modern DAO ' + id, description: 'This approach allows us to implement a completely custom component design without writing a single line of custom CSS.', - imageUrl: `/placeholders/${id % 5}.svg`, + imageUrl: `/placeholders/${(id % 5) + 1}.svg`, polytoneProxies: {}, - // Random date in the past 12 months. - established: new Date( - Date.now() - Math.floor(Math.random() * 12 * 30 * 24 * 60 * 60 * 1000) - ), - tokenDecimals: 6, - tokenSymbol: '', - showingEstimatedUsdValue: true, - - follow: { - following: false, - onFollow: () => alert('follow'), - updatingFollowing: false, - }, - parentDao: { chainId: CHAIN_ID, - coreAddress: 'parentDaoCoreAddress', + coreAddress: 'parent', coreVersion: ContractVersion.V2Alpha, name: 'parent', - imageUrl: 'https://moonphase.is/image.svg', - admin: 'parentDaoCoreAddress', + imageUrl: `/placeholders/${((id + 1) % 5) + 1}.svg`, + admin: 'parent', registeredSubDao: true, }, + supportedFeatures: {} as any, + votingModuleAddress: '', + votingModuleContractName: '', + proposalModules: [], + // Random date in the past 12 months. + created: + Date.now() - Math.floor(Math.random() * 12 * 30 * 24 * 60 * 60 * 1000), + isActive: true, + activeThreshold: null, + items: {}, + accounts: [], + admin: '', +}) +export const makeDaoCardProps = (id = 1): DaoCardProps => ({ + info: makeDaoInfo(id), + follow: { + following: false, + onFollow: () => alert('follow'), + updatingFollowing: false, + }, lazyData: { loading: false, data: { - tokenBalance: 120, - proposalCount: 25, isMember: Math.random() < 0.5, + proposalCount: 25, + tokenWithBalance: { + balance: 120, + symbol: 'USD', + decimals: 2, + }, }, }, - - showIsMember: true, LinkWrapper, }) export const Default = Template.bind({}) -Default.args = makeProps() +Default.args = makeDaoCardProps() Default.parameters = { design: { type: 'figma', @@ -75,7 +83,7 @@ Default.parameters = { export const Loading = Template.bind({}) Loading.args = { - ...makeProps(), + ...makeDaoCardProps(), lazyData: { loading: true }, } Loading.parameters = { diff --git a/packages/stateless/components/dao/DaoCard.tsx b/packages/stateless/components/dao/DaoCard.tsx index 408c31a1a..b7e3a113f 100644 --- a/packages/stateless/components/dao/DaoCard.tsx +++ b/packages/stateless/components/dao/DaoCard.tsx @@ -19,22 +19,15 @@ import { Tooltip } from '../tooltip/Tooltip' import { DaoImage } from './DaoImage' export const DaoCard = ({ - coreAddress, - name, - description, - imageUrl, - established, - parentDao, - tokenSymbol, - showingEstimatedUsdValue, - tokenDecimals, + info: { coreAddress, name, description, imageUrl, created, parentDao }, lazyData, + follow, + LinkWrapper, showIsMember = true, - className, + showingEstimatedUsdValue = true, onMouseOver, onMouseLeave, - LinkWrapper, - follow, + className, }: DaoCardProps) => { const { t } = useTranslation() const { getDaoPath } = useDaoNavHelpers() @@ -98,9 +91,9 @@ export const DaoCard = ({ size="sm" />

{name}

- {established && ( + {!!created && (

- {formatDate(established)} + {formatDate(new Date(created))}

)}
@@ -110,7 +103,7 @@ export const DaoCard = ({ {removeMarkdown(description)}

- {(lazyData.loading || !isNaN(lazyData.data.tokenBalance)) && ( + {(lazyData.loading || lazyData.data.tokenWithBalance) && (
diff --git a/packages/stateless/components/dao/DaoInfoCards.tsx b/packages/stateless/components/dao/DaoInfoCards.tsx index 4cc0707be..c7951ccb0 100644 --- a/packages/stateless/components/dao/DaoInfoCards.tsx +++ b/packages/stateless/components/dao/DaoInfoCards.tsx @@ -4,7 +4,12 @@ import { DaoInfoCardsProps } from '@dao-dao/types' import { TooltipInfoIcon } from '../tooltip' -export const DaoInfoCards = ({ cards, className, wrap }: DaoInfoCardsProps) => ( +export const DaoInfoCards = ({ + cards, + className, + wrap, + valueClassName, +}: DaoInfoCardsProps) => (
( >
{Icon && ( -
+
)} @@ -36,7 +41,8 @@ export const DaoInfoCards = ({ cards, className, wrap }: DaoInfoCardsProps) => (
{/* Make sure to render 0. */} diff --git a/packages/stateless/components/dao/MainDaoInfoCardsTokenLoader.tsx b/packages/stateless/components/dao/MainDaoInfoCardsTokenLoader.tsx index 2ed48765c..6cbea0f58 100644 --- a/packages/stateless/components/dao/MainDaoInfoCardsTokenLoader.tsx +++ b/packages/stateless/components/dao/MainDaoInfoCardsTokenLoader.tsx @@ -21,7 +21,7 @@ export const MainDaoInfoCardsTokenLoader = () => { { label: t('title.established'), tooltip: t('info.establishedTooltip'), - value: formatDate(created), + value: formatDate(new Date(created)), }, ] : []), diff --git a/packages/stateless/components/dao/create/DaoCreatedModal.stories.tsx b/packages/stateless/components/dao/create/DaoCreatedModal.stories.tsx index 6c6b67728..bd4588c03 100644 --- a/packages/stateless/components/dao/create/DaoCreatedModal.stories.tsx +++ b/packages/stateless/components/dao/create/DaoCreatedModal.stories.tsx @@ -1,6 +1,6 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' -import { makeProps as makeDaoCardProps } from '../DaoCard.stories' +import { makeDaoCardProps } from '../DaoCard.stories' import { DaoCreatedModal } from './DaoCreatedModal' export default { @@ -18,7 +18,13 @@ Default.args = { modalProps: { onClose: () => alert('close'), }, - itemProps: makeDaoCardProps(), + itemProps: { + ...makeDaoCardProps(), + info: { + ...makeDaoCardProps().info, + parentDao: null, + }, + }, } Default.parameters = { design: { @@ -30,5 +36,5 @@ Default.parameters = { export const SubDao = Template.bind({}) SubDao.args = { ...Default.args, - subDao: true, + itemProps: makeDaoCardProps(), } diff --git a/packages/stateless/components/dao/create/DaoCreatedModal.tsx b/packages/stateless/components/dao/create/DaoCreatedModal.tsx index dd151a728..e72366a6f 100644 --- a/packages/stateless/components/dao/create/DaoCreatedModal.tsx +++ b/packages/stateless/components/dao/create/DaoCreatedModal.tsx @@ -12,12 +12,10 @@ import { DaoCard } from '../DaoCard' export type DaoCreatedModalProps = Omit< ItemCreatedModalProps, - 'Item' | 'header' | 'url' | '' -> & { - subDao: boolean -} + 'Item' | 'header' | 'url' +> -export const DaoCreatedModal = ({ subDao, ...props }: DaoCreatedModalProps) => { +export const DaoCreatedModal = (props: DaoCreatedModalProps) => { const { t } = useTranslation() const { getDaoPath } = useDaoNavHelpers() @@ -26,10 +24,12 @@ export const DaoCreatedModal = ({ subDao, ...props }: DaoCreatedModalProps) => { {...props} Item={DaoCard} header={{ - title: subDao ? t('title.congratsOnSubDao') : t('title.congratsOnDao'), + title: props.itemProps.info.parentDao + ? t('title.congratsOnSubDao') + : t('title.congratsOnDao'), subtitle: t('info.easilyShareLink'), }} - url={SITE_URL + getDaoPath(props.itemProps.coreAddress)} + url={SITE_URL + getDaoPath(props.itemProps.info.coreAddress)} /> ) } diff --git a/packages/stateless/components/dao/tabs/SubDaosTab.stories.tsx b/packages/stateless/components/dao/tabs/SubDaosTab.stories.tsx index 47a8cd05e..5c0bb9b9c 100644 --- a/packages/stateless/components/dao/tabs/SubDaosTab.stories.tsx +++ b/packages/stateless/components/dao/tabs/SubDaosTab.stories.tsx @@ -6,7 +6,7 @@ import { DaoPageWrapperDecorator } from '@dao-dao/storybook/decorators' import { ButtonLink } from '../../buttons' import { LinkWrapper } from '../../LinkWrapper' import { DaoCard } from '../DaoCard' -import { makeProps as makeDaoCardProps } from '../DaoCard.stories' +import { makeDaoCardProps } from '../DaoCard.stories' import { SubDaosTab } from './SubDaosTab' export default { @@ -27,15 +27,16 @@ const Template: ComponentStory = (args) => { {...props} LinkWrapper={LinkWrapper} follow={{ - following: following.includes(props.coreAddress), + following: following.includes(props.info.coreAddress), updatingFollowing: false, onFollow: () => setFollowing((current) => - current.includes(props.coreAddress) - ? current.filter((a) => a !== props.coreAddress) - : [...current, props.coreAddress] + current.includes(props.info.coreAddress) + ? current.filter((a) => a !== props.info.coreAddress) + : [...current, props.info.coreAddress] ), }} + lazyData={{ loading: true }} /> )} /> @@ -49,22 +50,22 @@ Default.args = { loading: false, data: [ { - ...makeDaoCardProps(1), + ...makeDaoCardProps(1).info, name: 'Development Fund', description: 'Manages our development and strategy.', }, { - ...makeDaoCardProps(2), + ...makeDaoCardProps(2).info, name: 'Validator', description: 'Runs our validator.', }, { - ...makeDaoCardProps(3), + ...makeDaoCardProps(3).info, name: 'Security', description: 'Protects us from those who seek to destroy us.', }, { - ...makeDaoCardProps(4), + ...makeDaoCardProps(4).info, name: 'Meme Machine', description: 'Generates memeable content for the sake of the memes.', }, diff --git a/packages/stateless/components/dao/tabs/SubDaosTab.tsx b/packages/stateless/components/dao/tabs/SubDaosTab.tsx index 94d409714..ad3ce4e34 100644 --- a/packages/stateless/components/dao/tabs/SubDaosTab.tsx +++ b/packages/stateless/components/dao/tabs/SubDaosTab.tsx @@ -5,9 +5,10 @@ import { useTranslation } from 'react-i18next' import { ButtonLinkProps, ContractVersion, - DaoCardInfo, + DaoInfo, Feature, LoadingData, + StatefulDaoCardProps, } from '@dao-dao/types' import { useDaoInfoContext, useDaoNavHelpers } from '../../../hooks' @@ -17,8 +18,8 @@ import { Tooltip } from '../../tooltip' import { DaoCardLoader } from '../DaoCard' export interface SubDaosTabProps { - DaoCard: ComponentType - subDaos: LoadingData + DaoCard: ComponentType + subDaos: LoadingData isMember: boolean createSubDaoHref?: string upgradeToV2Href?: string @@ -100,8 +101,8 @@ export const SubDaosTab = ({ {subDaos.loading ? [...Array(3)].map((_, index) => ) - : subDaos.data.map((props, index) => ( - + : subDaos.data.map((info, index) => ( + ))} diff --git a/packages/stateless/components/inputs/NumberInput.tsx b/packages/stateless/components/inputs/NumberInput.tsx index ae0321094..5a38156ee 100644 --- a/packages/stateless/components/inputs/NumberInput.tsx +++ b/packages/stateless/components/inputs/NumberInput.tsx @@ -8,6 +8,7 @@ import { UseFormRegister, Validate, } from 'react-hook-form' +import { useTranslation } from 'react-i18next' import { convertDenomToMicroDenomWithDecimals, @@ -97,6 +98,7 @@ export const NumberInput = < plusMinusButtonSize = 'sm', ...props }: NumberInputProps) => { + const { t } = useTranslation() const validate = validation?.reduce( (a, v) => ({ ...a, [v.toString()]: v }), {} @@ -215,7 +217,7 @@ export const NumberInput = < {...(register && fieldName && register(fieldName, { - required: required && 'Required', + required: required && t('info.required'), validate, setValueAs: (value) => { // If not a number AND not a string or an empty string, set NaN. diff --git a/packages/stateless/components/inputs/SelectInput.tsx b/packages/stateless/components/inputs/SelectInput.tsx index 14c49c1c7..8da2e5e3a 100644 --- a/packages/stateless/components/inputs/SelectInput.tsx +++ b/packages/stateless/components/inputs/SelectInput.tsx @@ -9,6 +9,7 @@ import { UseFormRegister, Validate, } from 'react-hook-form' +import { useTranslation } from 'react-i18next' export interface SelectInputProps< FV extends FieldValues, @@ -41,6 +42,7 @@ export const SelectInput = < disabled, ...props }: SelectInputProps) => { + const { t } = useTranslation() const validate = validation?.reduce( (a, v) => ({ ...a, [v.toString()]: v }), {} @@ -63,7 +65,7 @@ export const SelectInput = < {...props} {...(register && fieldName ? register(fieldName, { - required: required && 'Required', + required: required && t('info.required'), validate, ...(onChange && { onChange: (e: any) => onChange(e.target.value), diff --git a/packages/stateless/components/inputs/TextAreaInput.tsx b/packages/stateless/components/inputs/TextAreaInput.tsx index f3b32db95..14980f21a 100644 --- a/packages/stateless/components/inputs/TextAreaInput.tsx +++ b/packages/stateless/components/inputs/TextAreaInput.tsx @@ -8,6 +8,7 @@ import { UseFormRegister, Validate, } from 'react-hook-form' +import { useTranslation } from 'react-i18next' export interface TextAreaInputProps< FV extends FieldValues, @@ -32,6 +33,7 @@ export const TextAreaInput = < required, ...rest }: TextAreaInputProps) => { + const { t } = useTranslation() const validate = validation?.reduce( (a, v) => ({ ...a, [v.toString()]: v }), {} @@ -47,7 +49,10 @@ export const TextAreaInput = < className )} {...rest} - {...register(fieldName, { required: required && 'Required', validate })} + {...register(fieldName, { + required: required && t('info.required'), + validate, + })} > ) } diff --git a/packages/stateless/components/inputs/TextInput.tsx b/packages/stateless/components/inputs/TextInput.tsx index 0c78eece6..0ef8b002d 100644 --- a/packages/stateless/components/inputs/TextInput.tsx +++ b/packages/stateless/components/inputs/TextInput.tsx @@ -8,6 +8,7 @@ import { UseFormRegister, Validate, } from 'react-hook-form' +import { useTranslation } from 'react-i18next' export interface TextInputProps< FV extends FieldValues, @@ -41,6 +42,7 @@ export const TextInput = >({ type = 'text', ...rest }: TextInputProps) => { + const { t } = useTranslation() const validate = validation?.reduce( (a, v) => ({ ...a, [v.toString()]: v }), {} @@ -62,7 +64,10 @@ export const TextInput = >({ {...rest} {...(register && fieldName && - register(fieldName, { required: required && 'Required', validate }))} + register(fieldName, { + required: required && t('info.required'), + validate, + }))} /> ) } diff --git a/packages/stateless/components/layout/DappNavigation.tsx b/packages/stateless/components/layout/DappNavigation.tsx index 3bab416ae..588b708c8 100644 --- a/packages/stateless/components/layout/DappNavigation.tsx +++ b/packages/stateless/components/layout/DappNavigation.tsx @@ -13,9 +13,10 @@ import { useEffect, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' import { DappNavigationProps } from '@dao-dao/types' -import { SITE_TITLE } from '@dao-dao/utils' +import { SITE_TITLE, getSupportedChains } from '@dao-dao/utils' import { usePlatform } from '../../hooks' +import { ChainLogo } from '../chain/ChainLogo' import { DaoDropdown } from '../dao' import { IconButton, ThemeToggle } from '../icon_buttons' import { Logo } from '../logo/Logo' @@ -62,7 +63,14 @@ export const DappNavigation = ({ toggle: toggleResponsive, }, } = useAppContext() - const { pathname } = useRouter() + const { pathname, query } = useRouter() + + const isHome = pathname === '/[[...tab]]' + const homeTabPath = + isHome && query?.tab && Array.isArray(query?.tab) ? query.tab[0] : undefined + const homeSelectedChainId = homeTabPath + ? getSupportedChains().find(({ name }) => name === homeTabPath)?.chainId + : undefined // Use screen resize to determine when compact should be forced on or off. const [forceCompact, setForceCompact] = useState( @@ -150,8 +158,28 @@ export const DappNavigation = ({ > - + +
+ + + {/* Overlay chain icon on chain-specific home page. */} + {homeSelectedChainId && ( + + )} +
+ {!compact &&

{SITE_TITLE}

}
} @@ -187,7 +215,7 @@ export const DappNavigation = ({ compact={compact} href="/" label={t('title.home')} - selected={pathname === '/[[...tab]]'} + selected={isHome} /> {/* Only show following when connected and following DAOs loaded. */} diff --git a/packages/stateless/components/popup/ChainPickerPopup.tsx b/packages/stateless/components/popup/ChainPickerPopup.tsx index a35b6dfc9..9da0c8745 100644 --- a/packages/stateless/components/popup/ChainPickerPopup.tsx +++ b/packages/stateless/components/popup/ChainPickerPopup.tsx @@ -35,6 +35,7 @@ export const ChainPickerPopup = ({ selectedIconClassName, selectedLabelClassName, trigger, + hideSelectedIcon = false, }: ChainPickerPopupProps) => { const { t } = useTranslation() @@ -123,24 +124,25 @@ export const ChainPickerPopup = ({ children: ( <>
- {selectedChain - ? !!selectedChain.iconUrl && ( -
- ) - : showNone && - NoneIcon && ( - - )} + {!hideSelectedIcon && + (selectedChain + ? !!selectedChain.iconUrl && ( +
+ ) + : showNone && + NoneIcon && ( + + ))}

= { /** * Link to create a new proposal. */ - createNewProposalHref: string + createNewProposalHref?: string /** * Whether or not there are more proposals to load. */ @@ -69,9 +69,13 @@ export type ProposalListProps = { * Whether or not the current wallet is a member of the DAO. */ isMember: boolean + /** + * DAO name. + */ + daoName: string ProposalLine: ComponentType - DiscordNotifierConfigureModal: ComponentType | undefined + DiscordNotifierConfigureModal?: ComponentType | undefined LinkWrapper: ComponentType /** @@ -82,6 +86,10 @@ export type ProposalListProps = { * Whether or not search results are showing. */ showingSearchResults?: boolean + /** + * Optional class name. + */ + className?: string } export const ProposalList = ({ @@ -93,14 +101,15 @@ export const ProposalList = ({ loadMore, loadingMore, isMember, + daoName, ProposalLine, DiscordNotifierConfigureModal, LinkWrapper, searchBarProps, showingSearchResults, + className, }: ProposalListProps) => { const { t } = useTranslation() - const { name: daoName } = useDaoInfoContext() const proposalsExist = openProposals.length > 0 || @@ -121,7 +130,7 @@ export const ProposalList = ({ return (

diff --git a/packages/stateless/components/wallet/WalletDaos.tsx b/packages/stateless/components/wallet/WalletDaos.tsx index 16f169433..4a01b5d26 100644 --- a/packages/stateless/components/wallet/WalletDaos.tsx +++ b/packages/stateless/components/wallet/WalletDaos.tsx @@ -84,8 +84,11 @@ export const WalletDaos = ({ ) : searchedDaos.length > 0 ? ( - {searchedDaos.map(({ item: dao }) => ( - + {searchedDaos.map(({ item }) => ( + ))} ) : ( diff --git a/packages/stateless/pages/ChainGovernanceList.tsx b/packages/stateless/pages/ChainGovernanceList.tsx index 9236cf7a1..4352721e9 100644 --- a/packages/stateless/pages/ChainGovernanceList.tsx +++ b/packages/stateless/pages/ChainGovernanceList.tsx @@ -37,12 +37,14 @@ export const ChainGovernanceList = ({ }) .map( ({ chainId, name }): LazyDaoCardProps => ({ - chainId, - coreAddress: name, - coreVersion: ContractVersion.Gov, - description: getChainGovernanceDaoDescription(chainId), - imageUrl: getImageUrlForChainId(chainId), - name: getDisplayNameForChainId(chainId), + info: { + chainId, + coreAddress: name, + coreVersion: ContractVersion.Gov, + description: getChainGovernanceDaoDescription(chainId), + imageUrl: getImageUrlForChainId(chainId), + name: getDisplayNameForChainId(chainId), + }, }) ) @@ -61,8 +63,8 @@ export const ChainGovernanceList = ({ {filteredChains.length > 0 ? ( - {filteredChains.map(({ item: props }) => ( - + {filteredChains.map(({ item }) => ( + ))} ) : ( diff --git a/packages/stateless/pages/Home.stories.tsx b/packages/stateless/pages/Home.stories.tsx index d457538b8..a03c97546 100644 --- a/packages/stateless/pages/Home.stories.tsx +++ b/packages/stateless/pages/Home.stories.tsx @@ -1,8 +1,8 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' +import { DaoCard } from '@dao-dao/stateful' import { makeDappLayoutDecorator } from '@dao-dao/storybook/decorators' -import { DaoCard, LinkWrapper } from '../components' import { FeaturedDaos as FeaturedDaosScrollerStory } from '../components/HorizontalScroller.stories' import { Home } from './Home' @@ -15,20 +15,32 @@ const Template: ComponentStory = (args) => export const Default = Template.bind({}) Default.args = { - featuredDaosProps: { - items: FeaturedDaosScrollerStory.args!.items!, - Component: (props) => ( - alert('follow ' + props.coreAddress), - }} - /> - ), + stats: { + all: { + daos: 1234, + proposals: 5678, + votes: 90123, + uniqueVoters: 4567, + }, + month: { + daos: 234, + proposals: 678, + votes: 9123, + uniqueVoters: 567, + }, + week: { + daos: 34, + proposals: 78, + votes: 123, + uniqueVoters: 67, + }, + chains: 10, + tvl: 1234567890, }, + DaoCard, + chainGovDaos: FeaturedDaosScrollerStory.args!.items!, + featuredDaos: FeaturedDaosScrollerStory.args!.items!, + openSearch: () => alert('search'), } Default.parameters = { design: { diff --git a/packages/stateless/pages/Home.tsx b/packages/stateless/pages/Home.tsx index d22f29532..8fc103952 100644 --- a/packages/stateless/pages/Home.tsx +++ b/packages/stateless/pages/Home.tsx @@ -1,39 +1,215 @@ +import { + DescriptionOutlined, + HowToVote, + Link, + LockOutlined, + PeopleOutlined, + Public, + Search, +} from '@mui/icons-material' import clsx from 'clsx' +import { ComponentType, useState } from 'react' import { useTranslation } from 'react-i18next' -import { DaoCardInfo } from '@dao-dao/types' +import { + DaoDaoIndexerAllStats, + LoadingData, + StatefulDaoCardProps, +} from '@dao-dao/types' import { UNDO_PAGE_PADDING_HORIZONTAL_CLASSES } from '@dao-dao/utils' -import { HorizontalScroller, HorizontalScrollerProps } from '../components' +import { + Button, + DaoInfoCards, + HorizontalScroller, + SegmentedControls, +} from '../components' export type HomeProps = { - featuredDaosProps: Pick< - HorizontalScrollerProps, - 'Component' | 'items' - > + /** + * The stats. + */ + stats: DaoDaoIndexerAllStats + /** + * The DAO card to render. + */ + DaoCard: ComponentType + /** + * Featured DAO cards to display on the home page. + */ + featuredDaos: LoadingData + /** + * Optionally show chain x/gov DAO cards. + */ + chainGovDaos?: LoadingData + /** + * Function to open the search modal. + */ + openSearch: () => void } -export const Home = ({ featuredDaosProps }: HomeProps) => { +type StatsMode = 'all' | 'month' | 'week' + +export const Home = ({ + stats, + DaoCard, + chainGovDaos, + featuredDaos, + openSearch, +}: HomeProps) => { const { t } = useTranslation() + const [statsMode, setStatsMode] = useState('all') + return ( -
-

{t('title.featuredDaos')}

- - {/* Featured DAOs container */} - 0) && - UNDO_PAGE_PADDING_HORIZONTAL_CLASSES - )} - itemClassName="w-64" - // Max width of 5xl = 64rem, container padding of 6 = 1.5rem - shadowClassName="w-[max((100%-64rem)/2,1.5rem)]" + <> + + className="w-max mb-4" + onSelect={setStatsMode} + selected={statsMode} + tabs={[ + { + label: t('title.all'), + value: 'all', + }, + { + label: '30d', + value: 'month', + }, + { + label: '7d', + value: 'week', + }, + ]} /> -
+ + 1 + ? [ + { + Icon: Link, + label: t('title.chains'), + tooltip: t('info.chainsDeployedTooltip'), + value: stats.chains.toLocaleString(), + }, + ] + : []), + ] + : []), + ]} + className="mb-8" + valueClassName="text-text-brand-secondary font-semibold font-mono" + wrap + /> + + {/* Chain governance DAOs */} + {chainGovDaos && ( +
+
+

{t('title.chainGovernance')}

+ + +
+ + 0) && + UNDO_PAGE_PADDING_HORIZONTAL_CLASSES + )} + // Margin offsets container padding. + itemClassName="w-64" + items={chainGovDaos} + // Max width of 5xl = 64rem, container padding of 6 = 1.5rem + shadowClassName="w-[max((100%-64rem)/2,1.5rem)]" + /> +
+ )} + + {/* Featured DAOs */} +
+
+

{t('title.featuredDaos')}

+ + +
+ + 0) && + UNDO_PAGE_PADDING_HORIZONTAL_CLASSES + )} + itemClassName="w-64" + items={featuredDaos} + // Max width of 5xl = 64rem, container padding of 6 = 1.5rem + shadowClassName="w-[max((100%-64rem)/2,1.5rem)]" + /> +
+ ) } diff --git a/packages/storybook/decorators/DaoPageWrapperDecorator.tsx b/packages/storybook/decorators/DaoPageWrapperDecorator.tsx index c1e7aef8c..0deaf9cfd 100644 --- a/packages/storybook/decorators/DaoPageWrapperDecorator.tsx +++ b/packages/storybook/decorators/DaoPageWrapperDecorator.tsx @@ -3,11 +3,10 @@ import { useMemo } from 'react' import { DaoPageWrapper } from '@dao-dao/stateful' import { + AccountType, ChainId, ContractVersion, - AccountType, DaoInfo, - DaoInfoSerializable, PreProposeModuleType, ProposalModuleType, } from '@dao-dao/types' @@ -43,9 +42,8 @@ export const makeDaoInfo = (): DaoInfo => ({ 'This DAO does really important stuff. And sometimes **things**. But *mostly* stuff.', imageUrl: 'https://moonphase.is/image.svg', // Random date in the past 12 months. - created: new Date( - Date.now() - Math.floor(Math.random() * 12 * 30 * 24 * 60 * 60 * 1000) - ), + created: + Date.now() - Math.floor(Math.random() * 12 * 30 * 24 * 60 * 60 * 1000), isActive: true, activeThreshold: null, items: {}, @@ -62,19 +60,13 @@ export const makeDaoInfo = (): DaoInfo => ({ }) export const DaoPageWrapperDecorator: DecoratorFn = (Story) => { - const serializedInfo: DaoInfoSerializable = useMemo(() => { - const info = makeDaoInfo() - return { - ...info, - created: info.created?.toJSON() ?? null, - } - }, []) + const info: DaoInfo = useMemo(makeDaoInfo, []) return ( diff --git a/packages/types/chain.ts b/packages/types/chain.ts index 19268a629..6cb8f54e8 100644 --- a/packages/types/chain.ts +++ b/packages/types/chain.ts @@ -164,6 +164,20 @@ export type SupportedChainConfig = BaseChainConfig & { * Whether or not this chain has an indexer. */ noIndexer?: boolean + /** + * If this chain uses a DAO as its chain governance instead of x/gov, set this + * to the DAO's address. + */ + govContractAddress?: string + /** + * SubDAOs to display with this chain's native governance. + * + * These should be legitimate SubDAOs with the chain governance module set as + * their admin. This is necessray because chains cannot recognize SubDAOs as + * they are not DAO contracts, and we need to establish which SubDAOs of a DAO + * are legitimate for safety. + */ + subDaos?: string[] /** * Past versions of contracts, in case DAOs need a particular version of a * contract. diff --git a/packages/types/components/ChainPickerPopup.ts b/packages/types/components/ChainPickerPopup.ts index 38af21cc1..45bba752c 100644 --- a/packages/types/components/ChainPickerPopup.ts +++ b/packages/types/components/ChainPickerPopup.ts @@ -94,6 +94,10 @@ export type ChainPickerPopupProps = { * Optionally override the picker trigger entirely. */ trigger?: PopupTrigger + /** + * Optionally hide the icon from the selected chain. Defaults to false. + */ + hideSelectedIcon?: boolean } export type WalletChainSwitcherProps = { diff --git a/packages/types/components/DaoCard.tsx b/packages/types/components/DaoCard.tsx index c374af75e..ba5e50be9 100644 --- a/packages/types/components/DaoCard.tsx +++ b/packages/types/components/DaoCard.tsx @@ -1,59 +1,69 @@ import { ComponentType } from 'react' -import { DaoParentInfo, PolytoneProxies } from '../dao' -import { ContractVersion } from '../features' +import { DaoInfo } from '../dao' import { LoadingData } from '../misc' import { LinkWrapperProps } from './LinkWrapper' // Loaded by card once displaying. -export interface DaoCardInfoLazyData { +export type DaoCardLazyData = { isMember: boolean - tokenBalance: number proposalCount: number + /** + * Show a token line, typically TVL. + */ + tokenWithBalance?: { + balance: number + symbol: string + decimals: number + } } -export interface DaoCardInfo { - chainId: string - coreAddress: string - coreVersion: ContractVersion - name: string - description: string - imageUrl: string - polytoneProxies: PolytoneProxies - established?: Date - className?: string - showIsMember?: boolean - parentDao?: DaoParentInfo - tokenSymbol: string - showingEstimatedUsdValue: boolean - tokenDecimals: number - - lazyData: LoadingData -} - -export interface FollowState { +export type FollowState = { following: boolean updatingFollowing: boolean onFollow: () => void } -export interface DaoCardProps extends DaoCardInfo { +export type DaoCardProps = { + info: DaoInfo + lazyData: LoadingData + follow: { hide: true } | ({ hide?: false } & FollowState) + LinkWrapper: ComponentType + /** + * Whether or not to show the member checkmark if they're a member. Defaults + * to true. + */ + showIsMember?: boolean + /** + * Whether or not the token loaded in lazy data is USD. Defaults to true. + */ + showingEstimatedUsdValue?: boolean onMouseOver?: () => void onMouseLeave?: () => void - LinkWrapper: ComponentType - follow: { hide: true } | ({ hide?: false } & FollowState) + /** + * Optional card class name. + */ + className?: string } -export type LazyDaoCardProps = Pick< +export type StatefulDaoCardProps = Omit< DaoCardProps, - | 'chainId' - | 'coreAddress' - | 'coreVersion' - | 'name' - | 'description' - | 'imageUrl' - | 'className' -> & { + 'lazyData' | 'follow' | 'LinkWrapper' +> + +export type LazyDaoCardProps = Omit & { + /** + * A smaller set of DAO info that doesn't need many queries. + */ + info: Pick< + DaoInfo, + | 'chainId' + | 'coreAddress' + | 'coreVersion' + | 'name' + | 'description' + | 'imageUrl' + > /** * Whether or not this DAO is inactive. */ diff --git a/packages/types/components/DaoInfoCards.ts b/packages/types/components/DaoInfoCards.ts index 1cbfdbabc..66c2cffb5 100644 --- a/packages/types/components/DaoInfoCards.ts +++ b/packages/types/components/DaoInfoCards.ts @@ -36,4 +36,8 @@ export type DaoInfoCardsProps = { * Optionally allow the card values to wrap. Defaults to `false`. */ wrap?: boolean + /** + * Optionally add a class name to the value containers. + */ + valueClassName?: string } diff --git a/packages/types/components/ProposalLine.ts b/packages/types/components/ProposalLine.ts index 1d02f6bea..53c103e01 100644 --- a/packages/types/components/ProposalLine.ts +++ b/packages/types/components/ProposalLine.ts @@ -10,3 +10,8 @@ export type StatefulProposalLineProps = { onClick?: () => void isPreProposeProposal: boolean } + +export type StatefulLazyProposalLineProps = Omit< + StatefulProposalLineProps, + 'proposalModules' | 'proposalViewUrl' +> diff --git a/packages/types/contracts/DaoProposalMultiple.ts b/packages/types/contracts/DaoProposalMultiple.ts index f16fd8fb0..158a98f11 100644 --- a/packages/types/contracts/DaoProposalMultiple.ts +++ b/packages/types/contracts/DaoProposalMultiple.ts @@ -232,6 +232,9 @@ export interface ProposalResponse { id: number proposal: MultipleChoiceProposal // Indexer may return these. + hideFromSearch?: boolean + dao?: string + daoProposalId?: string createdAt?: string completedAt?: string executedAt?: string diff --git a/packages/types/contracts/DaoProposalSingle.v2.ts b/packages/types/contracts/DaoProposalSingle.v2.ts index 25668a58c..143df6888 100644 --- a/packages/types/contracts/DaoProposalSingle.v2.ts +++ b/packages/types/contracts/DaoProposalSingle.v2.ts @@ -126,6 +126,9 @@ export interface ProposalResponse { id: number proposal: SingleChoiceProposal // Indexer may return these. + hideFromSearch?: boolean + dao?: string + daoProposalId?: string createdAt?: string completedAt?: string executedAt?: string diff --git a/packages/types/dao.ts b/packages/types/dao.ts index b967650a1..edb181457 100644 --- a/packages/types/dao.ts +++ b/packages/types/dao.ts @@ -64,8 +64,8 @@ export type DaoInfo = { proposalModules: ProposalModule[] name: string description: string - imageUrl: string | null - created: Date | undefined + imageUrl: string + created: number | null isActive: boolean activeThreshold: ActiveThreshold | null items: Record @@ -90,14 +90,6 @@ export type DaoParentInfo = { registeredSubDao: boolean } -// Used in @dao-dao/stateful/components/DaoPageWrapper to serialize DaoInfo -// loaded via static props (@dao-dao/stateful/server/makeGetDaoStaticProps) to -// be fed into DaoPageWrapper and available in the UI via DaoInfoContext. -export type DaoInfoSerializable = Omit & { - // Created needs to be serialized and de-serialized. - created: string | null -} - export type DaoSource = { chainId: string coreAddress: string diff --git a/packages/types/indexer.ts b/packages/types/indexer.ts index 60ca47089..1de97b863 100644 --- a/packages/types/indexer.ts +++ b/packages/types/indexer.ts @@ -42,3 +42,33 @@ export type IndexerUpStatus = { indexerBlock: IndexerUpBlock caughtUp: boolean } + +export type DaoDaoIndexerChainStats = { + daos: number + proposals: number + votes: number + uniqueVoters: number +} + +export type DaoDaoIndexerAllStats = { + /** + * Stats from all time. + */ + all: DaoDaoIndexerChainStats + /** + * Stats from last 30 days. + */ + month: DaoDaoIndexerChainStats + /** + * Stats from last 7 days. + */ + week: DaoDaoIndexerChainStats + /** + * Number of chains DAO DAO is deployed on. + */ + chains: number + /** + * Total TVL. + */ + tvl: number +} diff --git a/packages/utils/chain.ts b/packages/utils/chain.ts index f610f369c..40a7e4d45 100644 --- a/packages/utils/chain.ts +++ b/packages/utils/chain.ts @@ -8,12 +8,17 @@ import RIPEMD160 from 'ripemd160' import semverGte from 'semver/functions/gte' import { + Account, BaseChainConfig, ChainId, ConfiguredChain, + ContractVersion, + DaoInfo, + Feature, GenericToken, SupportedChain, SupportedChainConfig, + SupportedFeatureMap, TokenType, Validator, } from '@dao-dao/types' @@ -506,12 +511,12 @@ export const getConfiguredChains = ({ }: { mainnet?: boolean } = {}): ConfiguredChain[] => - CONFIGURED_CHAINS.filter( - (config) => mainnet === undefined || config.mainnet === mainnet - ).map((config) => ({ - chain: getChainForChainId(config.chainId), - ...config, - })) + CONFIGURED_CHAINS.filter((config) => config.mainnet === mainnet).map( + (config) => ({ + chain: getChainForChainId(config.chainId), + ...config, + }) + ) /** * Find configured chain with governance module by name. @@ -587,6 +592,9 @@ export const mustGetSupportedChainConfig = ( export const isSupportedChain = (chainId: string): boolean => getSupportedChainConfig(chainId) !== undefined +/** + * Get chains with DAO DAO deployed. + */ export const getSupportedChains = ({ mainnet = MAINNET, hasIndexer, @@ -726,3 +734,36 @@ export const addressIsModule = async ( return false } + +/** + * Get the DAO info object for a given chain ID. + */ +export const getDaoInfoForChainId = ( + chainId: string, + accounts: Account[] +): DaoInfo => ({ + chainId, + coreAddress: mustGetConfiguredChainConfig(chainId).name, + coreVersion: ContractVersion.Gov, + supportedFeatures: Object.values(Feature).reduce( + (acc, feature) => ({ + ...acc, + [feature]: false, + }), + {} as SupportedFeatureMap + ), + votingModuleAddress: '', + votingModuleContractName: '', + proposalModules: [], + name: getDisplayNameForChainId(chainId), + description: getChainGovernanceDaoDescription(chainId), + imageUrl: getImageUrlForChainId(chainId), + created: null, + isActive: true, + activeThreshold: null, + items: {}, + polytoneProxies: {}, + accounts, + parentDao: null, + admin: '', +}) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index a765db1bf..a28355476 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -9,6 +9,8 @@ import { SupportedChainConfig, } from '@dao-dao/types' +import { NEUTRON_GOVERNANCE_DAO } from './other' + export const ibc: IBCInfo[] = [ ...chainRegistryIbc, // Oraichain <-> Cosmos Hub @@ -44,7 +46,9 @@ export const ibc: IBCInfo[] = [ }, ] -// Chains which DAO DAO DAOs exist on. +/** + * Chains where DAO DAO is deployed. + */ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ { chainId: ChainId.JunoMainnet, @@ -56,6 +60,12 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ kado: { network: 'JUNO', }, + subDaos: [ + 'juno1nmezpepv3lx45mndyctz2lzqxa6d9xzd2xumkxf7a6r4nxt0y95qypm6c0', + 'juno1gyjl26rnqqyk6cuh6nqtvx8t885jgqagusvpqpvtgaygcjg2wjdqz0rzle', + 'juno1n34v729jqgysm5w0unukpt4kvqu4wqyacsv4krmd40f7pz5ruzwqau7e6m', + 'juno1mjsgk02jyn72jm2x7fgw72uu9wj7xy0v6pnuj2jd3aq7rgeqg5qq4dnhes', + ], explorerUrlTemplates: { tx: 'https://ping.pub/juno/tx/REPLACE', gov: 'https://ping.pub/juno/gov', @@ -481,6 +491,11 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ accentColor: '#000000', factoryContractAddress: 'neutron1xms03jykg6e2g402dxj3cw4q6ygm0r5rctdt5d7j99xehwtevm3sxl52n5', + govContractAddress: NEUTRON_GOVERNANCE_DAO, + subDaos: [ + 'neutron1fuyxwxlsgjkfjmxfthq8427dm2am3ya3cwcdr8gls29l7jadtazsuyzwcc', + 'neutron1zjdv3u6svlazlydmje2qcp44yqkt0059chz8gmyl5yrklmgv6fzq9chelu', + ], explorerUrlTemplates: { tx: 'https://neutron.celat.one/neutron-1/txs/REPLACE', wallet: 'https://neutron.celat.one/neutron-1/accounts/REPLACE', @@ -1857,113 +1872,112 @@ export const CONFIGURED_CHAINS: BaseChainConfig[] = [ const NO_GOV_CHAIN_IDS = ['noble-1'] // Add other chains from chain registry. -chains - .filter( - (chain) => - !CONFIGURED_CHAINS.some((c) => c.chainId === chain.chain_id) && - (chain.network_type === 'mainnet' || chain.network_type === 'testnet') - ) - .forEach((chain) => { - // Skip if chain already exists in configured chains. - if (CONFIGURED_CHAINS.some((c) => c.chainId === chain.chain_id)) { - return - } +chains.forEach((chain) => { + // Skip if chain already exists in configured chains. + if (CONFIGURED_CHAINS.some((c) => c.chainId === chain.chain_id)) { + return + } - let explorerUrlTemplates: BaseChainConfig['explorerUrlTemplates'] = - undefined - if (chain.explorers) { - const pingPubOrMintscanExplorer = - chain.explorers?.find( - (explorer) => - explorer.kind?.toLowerCase() === 'ping.pub' && - // Some explorers have kind = 'ping.pub' but the wrong URL. - explorer.url?.includes('ping.pub') - ) || - chain.explorers?.find( - (explorer) => - explorer.kind?.toLowerCase() === 'mintscan' && - explorer.url?.includes('mintscan.io') - ) - if (pingPubOrMintscanExplorer) { - explorerUrlTemplates = { - tx: pingPubOrMintscanExplorer.url + '/tx/REPLACE', - gov: pingPubOrMintscanExplorer.url + '/gov', - govProp: pingPubOrMintscanExplorer.url + '/gov/REPLACE', - wallet: pingPubOrMintscanExplorer.url + '/account/REPLACE', - } + // Skip if no RPC exists for chain. Can't use `getRpcForChainId` helper + // because that file depends on this one. Yay circular dependencies. + if (!(chain.chain_id in CHAIN_ENDPOINTS) && !chain.apis?.rpc?.length) { + return + } + + let explorerUrlTemplates: BaseChainConfig['explorerUrlTemplates'] = undefined + if (chain.explorers) { + const pingPubOrMintscanExplorer = + chain.explorers?.find( + (explorer) => + explorer.kind?.toLowerCase() === 'ping.pub' && + // Some explorers have kind = 'ping.pub' but the wrong URL. + explorer.url?.includes('ping.pub') + ) || + chain.explorers?.find( + (explorer) => + explorer.kind?.toLowerCase() === 'mintscan' && + explorer.url?.includes('mintscan.io') + ) + if (pingPubOrMintscanExplorer) { + explorerUrlTemplates = { + tx: pingPubOrMintscanExplorer.url + '/tx/REPLACE', + gov: pingPubOrMintscanExplorer.url + '/gov', + govProp: pingPubOrMintscanExplorer.url + '/gov/REPLACE', + wallet: pingPubOrMintscanExplorer.url + '/account/REPLACE', } + } - if (!explorerUrlTemplates) { - const atomScanExplorer = chain.explorers?.find( - (explorer) => - explorer.kind?.toLowerCase() === 'atomscan' && - explorer.url?.includes('atomscan.com') - ) - if (atomScanExplorer) { - explorerUrlTemplates = { - tx: atomScanExplorer.url + '/transactions/REPLACE', - gov: atomScanExplorer.url + '/votes', - govProp: atomScanExplorer.url + '/votes/REPLACE', - wallet: atomScanExplorer.url + '/accounts/REPLACE', - } + if (!explorerUrlTemplates) { + const atomScanExplorer = chain.explorers?.find( + (explorer) => + explorer.kind?.toLowerCase() === 'atomscan' && + explorer.url?.includes('atomscan.com') + ) + if (atomScanExplorer) { + explorerUrlTemplates = { + tx: atomScanExplorer.url + '/transactions/REPLACE', + gov: atomScanExplorer.url + '/votes', + govProp: atomScanExplorer.url + '/votes/REPLACE', + wallet: atomScanExplorer.url + '/accounts/REPLACE', } } + } - if (!explorerUrlTemplates) { - const bigDipperExplorer = chain.explorers?.find( - (explorer) => - explorer.kind?.toLowerCase() === 'bigdipper' && - explorer.url?.includes('bigdipper.live') - ) - if (bigDipperExplorer) { - explorerUrlTemplates = { - tx: bigDipperExplorer.url + '/transactions/REPLACE', - gov: bigDipperExplorer.url + '/proposals', - govProp: bigDipperExplorer.url + '/proposals/REPLACE', - wallet: bigDipperExplorer.url + '/accounts/REPLACE', - } + if (!explorerUrlTemplates) { + const bigDipperExplorer = chain.explorers?.find( + (explorer) => + explorer.kind?.toLowerCase() === 'bigdipper' && + explorer.url?.includes('bigdipper.live') + ) + if (bigDipperExplorer) { + explorerUrlTemplates = { + tx: bigDipperExplorer.url + '/transactions/REPLACE', + gov: bigDipperExplorer.url + '/proposals', + govProp: bigDipperExplorer.url + '/proposals/REPLACE', + wallet: bigDipperExplorer.url + '/accounts/REPLACE', } } + } - if (!explorerUrlTemplates) { - const explorersGuruExplorer = chain.explorers?.find( - (explorer) => - explorer.kind?.toLowerCase() === 'explorers.guru' && - explorer.url?.includes('explorers.guru') - ) - if (explorersGuruExplorer) { - explorerUrlTemplates = { - tx: explorersGuruExplorer.url + '/transaction/REPLACE', - gov: explorersGuruExplorer.url + '/proposals', - govProp: explorersGuruExplorer.url + '/proposals/REPLACE', - wallet: explorersGuruExplorer.url + '/account/REPLACE', - } + if (!explorerUrlTemplates) { + const explorersGuruExplorer = chain.explorers?.find( + (explorer) => + explorer.kind?.toLowerCase() === 'explorers.guru' && + explorer.url?.includes('explorers.guru') + ) + if (explorersGuruExplorer) { + explorerUrlTemplates = { + tx: explorersGuruExplorer.url + '/transaction/REPLACE', + gov: explorersGuruExplorer.url + '/proposals', + govProp: explorersGuruExplorer.url + '/proposals/REPLACE', + wallet: explorersGuruExplorer.url + '/account/REPLACE', } } + } - if (!explorerUrlTemplates) { - const stakeflowExplorer = chain.explorers?.find( - (explorer) => - explorer.kind?.toLowerCase() === 'stakeflow' && - explorer.url?.includes('stakeflow.io') - ) - if (stakeflowExplorer) { - explorerUrlTemplates = { - tx: stakeflowExplorer.url + '/transactions/REPLACE', - gov: stakeflowExplorer.url + '/proposals', - govProp: stakeflowExplorer.url + '/proposals/REPLACE', - wallet: stakeflowExplorer.url + '/accounts/REPLACE', - } + if (!explorerUrlTemplates) { + const stakeflowExplorer = chain.explorers?.find( + (explorer) => + explorer.kind?.toLowerCase() === 'stakeflow' && + explorer.url?.includes('stakeflow.io') + ) + if (stakeflowExplorer) { + explorerUrlTemplates = { + tx: stakeflowExplorer.url + '/transactions/REPLACE', + gov: stakeflowExplorer.url + '/proposals', + govProp: stakeflowExplorer.url + '/proposals/REPLACE', + wallet: stakeflowExplorer.url + '/accounts/REPLACE', } } } + } - CONFIGURED_CHAINS.push({ - chainId: chain.chain_id, - name: chain.chain_name, - mainnet: chain.network_type === 'mainnet', - accentColor: '', - noGov: NO_GOV_CHAIN_IDS.includes(chain.chain_id), - explorerUrlTemplates, - }) + CONFIGURED_CHAINS.push({ + chainId: chain.chain_id, + name: chain.chain_name, + mainnet: chain.network_type === 'mainnet', + accentColor: '', + noGov: NO_GOV_CHAIN_IDS.includes(chain.chain_id), + explorerUrlTemplates, }) +}) diff --git a/packages/utils/constants/other.ts b/packages/utils/constants/other.ts index 478d49f26..84f639bfd 100644 --- a/packages/utils/constants/other.ts +++ b/packages/utils/constants/other.ts @@ -1,7 +1,5 @@ // Constants NOT derived from environment variables. -import { ChainId } from '@dao-dao/types' - export const SITE_IMAGE = '/social.jpg' export const SITE_TITLE = 'DAO DAO' export const DEFAULT_SITE_DESCRIPTION = @@ -17,7 +15,7 @@ export const NOTIFICATIONS_PAGE_DESCRIPTION = 'View notifications in your followed DAOs.' export const STATUS_PAGE_TITLE = 'Status' export const STATUS_PAGE_DESCRIPTION = "Check the status of DAO DAO's services." -export const CHAIN_GOVERNANCE_TITLE = 'Chain Governance' +export const CHAIN_GOVERNANCE_TITLE = 'Chain governance' export const CHAIN_GOVERNANCE_DESCRIPTION = 'View and vote on proposals in chain governance.' @@ -166,19 +164,6 @@ export const DISTRIBUTION_COLORS_EVERY_OTHER = [ '#F4925A', // 9 ] -// Legitimate SubDAOs with the chain governance module set as their admin. This -// is necessray because chains cannot recognize SubDAOs as they are not DAO -// contracts, and we need to establish which SubDAOs of a DAO are legitimate for -// safety. -export const CHAIN_SUBDAOS: Record = { - [ChainId.JunoMainnet]: [ - 'juno1nmezpepv3lx45mndyctz2lzqxa6d9xzd2xumkxf7a6r4nxt0y95qypm6c0', - 'juno1gyjl26rnqqyk6cuh6nqtvx8t885jgqagusvpqpvtgaygcjg2wjdqz0rzle', - 'juno1n34v729jqgysm5w0unukpt4kvqu4wqyacsv4krmd40f7pz5ruzwqau7e6m', - 'juno1mjsgk02jyn72jm2x7fgw72uu9wj7xy0v6pnuj2jd3aq7rgeqg5qq4dnhes', - ], -} - /** * Error substrings that indicate a contract is invalid or does not exist. */ From c7d8adcb4f06a1a816cd53da93802567e1575950 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 2 Jun 2024 23:43:55 -0400 Subject: [PATCH 198/438] changed terra classic RPC/REST --- packages/utils/constants/chains.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index a28355476..57c916938 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -1801,8 +1801,8 @@ export const CHAIN_ENDPOINTS: Partial< rest: 'https://terra-api.polkachu.com', }, [ChainId.TerraClassicMainnet]: { - rpc: 'https://terra-classic-rpc.publicnode.com', - rest: 'https://terra-classic-rest.publicnode.com', + rpc: 'https://terraclassic-rpc-server-01.stakely.io', + rest: 'https://terraclassic-lcd-server-01.stakely.io', }, [ChainId.MigalooMainnet]: { rpc: 'https://migaloo-rpc.polkachu.com', From effba99d11098ad5e07b4200f8708843d8b04a2d Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 3 Jun 2024 09:45:08 -0400 Subject: [PATCH 199/438] changed stats to green --- packages/stateless/pages/Home.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stateless/pages/Home.tsx b/packages/stateless/pages/Home.tsx index 8fc103952..bc65d45b4 100644 --- a/packages/stateless/pages/Home.tsx +++ b/packages/stateless/pages/Home.tsx @@ -135,7 +135,7 @@ export const Home = ({ : []), ]} className="mb-8" - valueClassName="text-text-brand-secondary font-semibold font-mono" + valueClassName="text-text-interactive-valid font-semibold font-mono" wrap /> From 85fb400f4ba5ac4960fb32546083e59dd38fe1cb Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 3 Jun 2024 11:57:12 -0400 Subject: [PATCH 200/438] fix error on gov proposal creation --- packages/state/recoil/selectors/chain.ts | 28 ++++++++++++++---------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/packages/state/recoil/selectors/chain.ts b/packages/state/recoil/selectors/chain.ts index 6cb04c426..7b1ec0339 100644 --- a/packages/state/recoil/selectors/chain.ts +++ b/packages/state/recoil/selectors/chain.ts @@ -936,22 +936,28 @@ export const govProposalSelector = selectorFamily< const supportsV1Gov = get(chainSupportsV1GovModuleSelector({ chainId })) // Try to load from indexer first. - const indexerProposal: + let indexerProposal: | { id: string version: string data: string } - | undefined = get( - queryGenericIndexerSelector({ - chainId, - formula: 'gov/proposal', - args: { - id: proposalId, - }, - id, - }) - ) + | undefined + | null + try { + indexerProposal = get( + queryGenericIndexerSelector({ + chainId, + formula: 'gov/proposal', + args: { + id: proposalId, + }, + id, + }) + ) + } catch { + // Ignore error. + } let govProposal: GovProposalWithDecodedContent | undefined From 1fa08402098e609b8589262b74dc8e37ddc03f56 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 3 Jun 2024 11:57:55 -0400 Subject: [PATCH 201/438] fix error on gov proposal creation 2 --- packages/state/recoil/selectors/chain.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/state/recoil/selectors/chain.ts b/packages/state/recoil/selectors/chain.ts index 7b1ec0339..8bc5ae70f 100644 --- a/packages/state/recoil/selectors/chain.ts +++ b/packages/state/recoil/selectors/chain.ts @@ -955,8 +955,11 @@ export const govProposalSelector = selectorFamily< id, }) ) - } catch { - // Ignore error. + } catch (err) { + // Ignore error if not Promise thrown by recoil. Otherwise rethrow. + if (err instanceof Promise) { + throw err + } } let govProposal: GovProposalWithDecodedContent | undefined From 5bdd203ac0e9cc603fe12674a0b9966be149bd48 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 4 Jun 2024 12:12:34 -0400 Subject: [PATCH 202/438] fixed injective polytone connections --- packages/utils/constants/chains.ts | 40 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 57c916938..33d7893fb 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -467,20 +467,20 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ }, [ChainId.InjectiveMainnet]: { // osmosis - note: 'osmo16passct926eern05hzuf46g9809cvavhxv9qw9rm5wnu9fk0gfxs2v37x7', + note: 'osmo1zc4fdqwswxxwp9rqh9uq3crs5ykerzn2rptsznawsq7wp6jyhj0qddwey7', // osmosis listener: - 'osmo1c6htfqceqr4vuln2ryrs7sk6mkdvqrgt5j5vlw8x5ql0cjvy29ls5dkyll', + 'osmo1x0hsnee8we57dn2rspvq7sj30l333v7mmr5kz5r2wg7nhxufrr6skvc4gz', // injective - voice: 'inj1kt7anwm5wy9e8grq04z46z08yqd49ewq97g8f0', + voice: 'inj10fxuwynmp9jtuumq27cuw0lw5quajpgxw692g5', // osmosis localConnection: 'connection-1298', // injective remoteConnection: 'connection-14', // osmosis - localChannel: 'channel-73927', + localChannel: 'channel-77133', // injective - remoteChannel: 'channel-266', + remoteChannel: 'channel-301', }, }, }, @@ -638,20 +638,20 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ }, [ChainId.InjectiveMainnet]: { // neutron - note: 'neutron1565ewvznhrw3t96ztv8gan3ykr7262gjrl4xy449mhgvl5h6gdkq027r4c', + note: 'neutron1wpt84q6qsjtlv27vgk0pwg3l7dlueknlxz0xrh7teeut9strqyysrxc5a0', // neutron listener: - 'neutron1ga58f9hz8v8fjtpspmtrmakpdapc2jdddhszpwg0dfjuwg8xt5fqgud73l', + 'neutron12x9tc008u8teyg3txy2t70rjxz8cxxuftkk3plmccn0key4mxpuskq02jx', // injective - voice: 'inj1ac4y7r7ec47jh9re379ejcl942a9c5k6f23yqa', + voice: 'inj1v37vgn6y4knzr9e7uc3u9czxj3dcxug7s5lhzh', // neutron localConnection: 'connection-58', // injective remoteConnection: 'connection-220', // neutron - localChannel: 'channel-4188', + localChannel: 'channel-4498', // injective - remoteChannel: 'channel-271', + remoteChannel: 'channel-304', }, }, }, @@ -997,20 +997,20 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ }, [ChainId.InjectiveMainnet]: { // migaloo - note: 'migaloo1e63cld4ex3062nvrx8f6dald97c5f9am3y8eledc0za7tvyzc7usvn3nwr', + note: 'migaloo190zmewmp5pv2mhv3mqpmvseh55902fae3wn0mraxyrp3cys55jksftxwan', // migaloo listener: - 'migaloo1mdz2smpj6hs4caerx0sch2hdvs2zj4eryr7unv9vqrrfw7xjuz6qd5j38z', + 'migaloo1v4sw52jhgzuhsr8fmt9an390xevvafec0gd320h2auvfnlr4tftsu99m73', // injective - voice: 'inj1ql2qpt5uudppa33yf0p03fssxtkhqawxdw4czf', + voice: 'inj1edfqvfyvpce8qm5avph43spnm5plt2en2lgdg6', // migaloo localConnection: 'connection-8', // injective remoteConnection: 'connection-123', // migaloo - localChannel: 'channel-117', + localChannel: 'channel-120', // injective - remoteChannel: 'channel-264', + remoteChannel: 'channel-309', }, }, }, @@ -1163,20 +1163,20 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ }, [ChainId.InjectiveMainnet]: { // terra - note: 'terra1pmhsahmn5eymdn07yahp9692jnqyh54f7pak82v4nwzylgfrvkaq8grraa', + note: 'terra1vf2janv5s6ywsa8lj4m5q7jdw3wfqpmgtkgdllh24l2shz0qyv4qvtjkuk', // terra listener: - 'terra1m2xgx2n6wu5lw2zk3sxpyyr7f75fe9v32u3av9lfl6h64mutw96qztacj9', + 'terra1yu9encxx42k6rswr7skl43dhfxqzljddlk3wj250q7uykxzflw7qykt6wt', // injective - voice: 'inj1eksx0xjfzdcvesfq0kk7fcdv534ajrmccg27ah', + voice: 'inj1tr0uhnh6dwtvaunnpa3zcdrq3gvq9y47jrysu8', // terra localConnection: 'connection-311', // injective remoteConnection: 'connection-202', // terra - localChannel: 'channel-397', + localChannel: 'channel-488', // injective - remoteChannel: 'channel-272', + remoteChannel: 'channel-289', }, }, }, From 657503ae89d56d1bd4d65ea1cc8e3f3284566e1c Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 4 Jun 2024 12:25:46 -0400 Subject: [PATCH 203/438] overflow scroll in status card --- packages/stateless/components/StatusCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stateless/components/StatusCard.tsx b/packages/stateless/components/StatusCard.tsx index fa361078a..33bfc7927 100644 --- a/packages/stateless/components/StatusCard.tsx +++ b/packages/stateless/components/StatusCard.tsx @@ -53,7 +53,7 @@ export const StatusCard = ({ return (
Date: Tue, 4 Jun 2024 12:38:52 -0400 Subject: [PATCH 204/438] changed terra classic RPC back --- packages/utils/constants/chains.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 33d7893fb..3e405dec4 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -1801,8 +1801,8 @@ export const CHAIN_ENDPOINTS: Partial< rest: 'https://terra-api.polkachu.com', }, [ChainId.TerraClassicMainnet]: { - rpc: 'https://terraclassic-rpc-server-01.stakely.io', - rest: 'https://terraclassic-lcd-server-01.stakely.io', + rpc: 'https://terra-classic-rpc.publicnode.com', + rest: 'https://terra-classic-lcd.publicnode.com', }, [ChainId.MigalooMainnet]: { rpc: 'https://migaloo-rpc.polkachu.com', From 417c9450bcff257fab57264c1f3ac131cffe47fb Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 4 Jun 2024 16:09:11 -0400 Subject: [PATCH 205/438] removed unnecessary loading state on first page load and --- packages/state/recoil/atoms/misc.ts | 7 +- packages/state/recoil/selectors/treasury.ts | 12 ++-- .../components/AppContextProvider.tsx | 12 ---- packages/stateful/components/DappLayout.tsx | 2 + packages/stateful/components/PageHeader.tsx | 23 +++++++ .../stateful/components/PageHeaderContent.tsx | 69 +++---------------- packages/stateful/components/SdaLayout.tsx | 2 + packages/stateful/components/index.ts | 1 + packages/stateful/recoil/selectors/dao.ts | 10 +-- .../components/layout/Breadcrumbs.tsx | 2 +- .../components/layout/DappLayout.stories.tsx | 11 ++- .../components/layout/DappLayout.tsx | 7 +- .../components/layout/PageHeader.tsx | 2 +- .../components/layout/SdaLayout.stories.tsx | 11 ++- .../stateless/components/layout/SdaLayout.tsx | 12 +++- .../decorators/makeAppContextDecorator.tsx | 10 +-- packages/types/components/AppContext.tsx | 1 - packages/types/components/DappLayout.ts | 4 ++ packages/types/components/SdaLayout.ts | 12 +++- packages/utils/messages/protobuf.ts | 5 +- 20 files changed, 100 insertions(+), 115 deletions(-) create mode 100644 packages/stateful/components/PageHeader.tsx diff --git a/packages/state/recoil/atoms/misc.ts b/packages/state/recoil/atoms/misc.ts index 08eedd49e..dceb2dbc2 100644 --- a/packages/state/recoil/atoms/misc.ts +++ b/packages/state/recoil/atoms/misc.ts @@ -1,6 +1,6 @@ import { atom } from 'recoil' -import { Web3AuthPrompt } from '@dao-dao/types' +import { PageHeaderProps, Web3AuthPrompt } from '@dao-dao/types' import { localStorageEffectJSON } from '../effects' @@ -57,3 +57,8 @@ export const indexerWebSocketChannelSubscriptionsAtom = atom< key: 'indexerWebSocketChannelSubscriptions', default: {}, }) + +export const pageHeaderPropsAtom = atom({ + key: 'pageHeaderProps', + default: {}, +}) diff --git a/packages/state/recoil/selectors/treasury.ts b/packages/state/recoil/selectors/treasury.ts index 32d5a111e..f00986988 100644 --- a/packages/state/recoil/selectors/treasury.ts +++ b/packages/state/recoil/selectors/treasury.ts @@ -7,7 +7,6 @@ import { Account, AccountType, AmountWithTimestamp, - ChainId, GenericToken, GenericTokenSource, LoadingTokens, @@ -18,9 +17,9 @@ import { } from '@dao-dao/types' import { COMMUNITY_POOL_ADDRESS_PLACEHOLDER, - NEUTRON_GOVERNANCE_DAO, convertMicroDenomToDenomWithDecimals, getNativeTokenForChainId, + getSupportedChainConfig, getTokenForChainIdAndDenom, isConfiguredChainName, loadableToLoadingData, @@ -180,10 +179,11 @@ export const daoTvlSelector = selectorFamily< ({ get }) => { // Native chain x/gov module. if (isConfiguredChainName(chainId, coreAddress)) { - coreAddress = - chainId === ChainId.NeutronMainnet - ? NEUTRON_GOVERNANCE_DAO - : COMMUNITY_POOL_ADDRESS_PLACEHOLDER + // If chain uses a contract-based DAO, load it instead. + const govContractAddress = + getSupportedChainConfig(chainId)?.govContractAddress + + coreAddress = govContractAddress || COMMUNITY_POOL_ADDRESS_PLACEHOLDER } const timestamp = new Date() diff --git a/packages/stateful/components/AppContextProvider.tsx b/packages/stateful/components/AppContextProvider.tsx index d54cd4079..a2353efd7 100644 --- a/packages/stateful/components/AppContextProvider.tsx +++ b/packages/stateful/components/AppContextProvider.tsx @@ -21,16 +21,7 @@ export const AppContextProvider = ({ const [responsiveNavigationEnabled, setResponsiveNavigationEnabled] = useState(false) - // Page header. Set state when ref is set so it re-renders immediately. - // Without this, the page header is invisible until the next render. - const [, setPageHeaderSet] = useState(false) const pageHeaderRef = useRef(null) - const setPageHeaderRef = useCallback((ref: HTMLDivElement | null) => { - pageHeaderRef.current = ref - if (ref) { - setPageHeaderSet(true) - } - }, []) // Unsubscribe from WebSocket channels when all subscriptions removed. const { pusher } = useWebSocket() @@ -68,10 +59,7 @@ export const AppContextProvider = ({ enabled: responsiveNavigationEnabled, toggle: () => setResponsiveNavigationEnabled((v) => !v), }, - // Include the page header ref in the context to be accessed by the - // component portal. pageHeaderRef, - setPageHeaderRef, } // Install service worker. diff --git a/packages/stateful/components/DappLayout.tsx b/packages/stateful/components/DappLayout.tsx index 1b5d9dc02..e68532c20 100644 --- a/packages/stateful/components/DappLayout.tsx +++ b/packages/stateful/components/DappLayout.tsx @@ -31,6 +31,7 @@ import { ButtonLink } from './ButtonLink' import { DaoCreatedModal } from './DaoCreatedModal' import { LinkWrapper } from './LinkWrapper' import { DockWallet } from './NavWallet' +import { StatefulPageHeader } from './PageHeader' import { WalletModals } from './wallet' export const DappLayout = ({ children }: { children: ReactNode }) => { @@ -146,6 +147,7 @@ export const DappLayout = ({ children }: { children: ReactNode }) => { { + const props = useRecoilValue(pageHeaderPropsAtom) + + return ( + + {props.rightNode} + + +
+ } + /> + ) +} diff --git a/packages/stateful/components/PageHeaderContent.tsx b/packages/stateful/components/PageHeaderContent.tsx index 39afd79ec..7d0436261 100644 --- a/packages/stateful/components/PageHeaderContent.tsx +++ b/packages/stateful/components/PageHeaderContent.tsx @@ -1,64 +1,17 @@ -import { createPortal } from 'react-dom' +import { useEffect } from 'react' +import { useSetRecoilState } from 'recoil' -import { - PageHeader, - PageLoader, - useAppContextIfAvailable, -} from '@dao-dao/stateless' +import { pageHeaderPropsAtom } from '@dao-dao/state/recoil' import { PageHeaderProps } from '@dao-dao/types' -import { HeaderWallet } from './NavWallet' - -// This is a portal that teleports content, used in pages to render content in -// the header (which is located in a separate React tree due to `DappLayout` and -// `SdaLayout` managing the layouts of the apps). This component uses a -// reference to the target div (stored in the `AppContext`) and provides a -// component that will funnel its `children` into a React portal -// (https://reactjs.org/docs/portals.html). This ref is accessible via the -// `useAppContext` hook so that descendants of the context provider (such as -// page components) can use the `PageHeaderContent` component below and specify -// what renders in the header. The API for a page is as simple as: -// -// export const Page = () => ( -// <> -// - -// {/* ... Page content here ... */} -// -// ) -// -// See https://malcolmkee.com/blog/portal-to-subtree/ for an example using -// portals to render components across subtrees with similar syntax. -// -// If not in an AppContext, this component will render a PageHeader normally -// instead of using the portal. +/** + * This is a component that sets props used by the page header. + */ export const PageHeaderContent = (props: PageHeaderProps) => { - const appContext = useAppContextIfAvailable() - - const pageHeader = ( - - {props.rightNode} - - -
- } - /> - ) + const setPageHeaderProps = useSetRecoilState(pageHeaderPropsAtom) + useEffect(() => { + setPageHeaderProps(props) + }, [setPageHeaderProps, props]) - // If app context is available, but the page header ref is not, render nothing - // until the ref is available. If not in an app context, render the element - // directly. The direct render is useful when outside the AppContext, such as - // error pages in the SDA. - return appContext ? ( - appContext.pageHeaderRef.current ? ( - createPortal(pageHeader, appContext.pageHeaderRef.current) - ) : ( - - ) - ) : ( - pageHeader - ) + return null } diff --git a/packages/stateful/components/SdaLayout.tsx b/packages/stateful/components/SdaLayout.tsx index cf5da32d5..0bf2e8dc4 100644 --- a/packages/stateful/components/SdaLayout.tsx +++ b/packages/stateful/components/SdaLayout.tsx @@ -19,6 +19,7 @@ import { useAutoRefreshData, useDaoTabs } from '../hooks' import { daoCreatedCardPropsAtom } from '../recoil/atoms/newDao' import { LinkWrapper } from './LinkWrapper' import { SidebarWallet } from './NavWallet' +import { StatefulPageHeader } from './PageHeader' import { SuspenseLoader } from './SuspenseLoader' import { WalletModals } from './wallet' @@ -42,6 +43,7 @@ export const SdaLayout = ({ children }: { children: ReactNode }) => { return (
diff --git a/packages/stateless/components/layout/DappLayout.stories.tsx b/packages/stateless/components/layout/DappLayout.stories.tsx index 5c81327a2..31c47a04e 100644 --- a/packages/stateless/components/layout/DappLayout.stories.tsx +++ b/packages/stateless/components/layout/DappLayout.stories.tsx @@ -27,15 +27,14 @@ export const DefaultArgs: DappLayoutProps = { data: 5, }, connect: () => alert('connect'), + PageHeader: () => ( + + ), DockWallet, ButtonLink, children: ( -
- - -
-

App content

-
+
+

App content

), } diff --git a/packages/stateless/components/layout/DappLayout.tsx b/packages/stateless/components/layout/DappLayout.tsx index dd56b70cd..c0b1bda08 100644 --- a/packages/stateless/components/layout/DappLayout.tsx +++ b/packages/stateless/components/layout/DappLayout.tsx @@ -25,6 +25,7 @@ export const DappLayout = ({ navigationProps, inboxCount, connect, + PageHeader, DockWallet, ButtonLink, children, @@ -34,7 +35,7 @@ export const DappLayout = ({ getDaoPath, getDaoFromPath, } = useDaoNavHelpers() - const { responsiveNavigation, setPageHeaderRef } = useAppContext() + const { responsiveNavigation, pageHeaderRef } = useAppContext() const scrollableContainerRef = useRef(null) @@ -123,7 +124,9 @@ export const DappLayout = ({ : 'opacity-100' )} > -
+
+ +
diff --git a/packages/stateless/components/layout/SdaLayout.stories.tsx b/packages/stateless/components/layout/SdaLayout.stories.tsx index 4f74e4b9a..9418d00a5 100644 --- a/packages/stateless/components/layout/SdaLayout.stories.tsx +++ b/packages/stateless/components/layout/SdaLayout.stories.tsx @@ -20,13 +20,12 @@ export default { export const DefaultArgs: SdaLayoutProps = { navigationProps: SdaNavigationStory.args as SdaNavigationProps, + PageHeader: () => ( + + ), children: ( -
- - -
-

App content

-
+
+

App content

), } diff --git a/packages/stateless/components/layout/SdaLayout.tsx b/packages/stateless/components/layout/SdaLayout.tsx index cc4d08a73..36a63c0d0 100644 --- a/packages/stateless/components/layout/SdaLayout.tsx +++ b/packages/stateless/components/layout/SdaLayout.tsx @@ -13,9 +13,13 @@ import { ErrorBoundary } from '../error/ErrorBoundary' import { useAppContext } from './AppContext' import { SdaNavigation } from './SdaNavigation' -export const SdaLayout = ({ navigationProps, children }: SdaLayoutProps) => { +export const SdaLayout = ({ + navigationProps, + PageHeader, + children, +}: SdaLayoutProps) => { const { pathname } = useRouter() - const { responsiveNavigation, setPageHeaderRef } = useAppContext() + const { responsiveNavigation, pageHeaderRef } = useAppContext() const scrollableContainerRef = useRef(null) @@ -51,7 +55,9 @@ export const SdaLayout = ({ navigationProps, children }: SdaLayoutProps) => { : 'opacity-100' )} > -
+
+ +
(null) - const setPageHeaderRef = useCallback((ref: HTMLDivElement | null) => { - if (ref) { - pageHeaderRef.current = ref - setPageHeaderSet(true) - } - }, []) return ( setResponsiveNavigationEnabled((v) => !v), }, pageHeaderRef, - setPageHeaderRef, rootCommandContextMaker: makeGenericContext, setRootCommandContextMaker: () => {}, inbox: EMPTY_INBOX, diff --git a/packages/types/components/AppContext.tsx b/packages/types/components/AppContext.tsx index c77fce861..75aff6231 100644 --- a/packages/types/components/AppContext.tsx +++ b/packages/types/components/AppContext.tsx @@ -14,7 +14,6 @@ export type CommonAppContext = { // Page header. pageHeaderRef: MutableRefObject - setPageHeaderRef: (ref: HTMLDivElement | null) => void } export type IAppContext = CommonAppContext & diff --git a/packages/types/components/DappLayout.ts b/packages/types/components/DappLayout.ts index 7017bfe2c..16a5017b5 100644 --- a/packages/types/components/DappLayout.ts +++ b/packages/types/components/DappLayout.ts @@ -17,6 +17,10 @@ export type DappLayoutProps = { * Function to initiate the connection process. */ connect: () => void + /** + * PageHeader stateful component. + */ + PageHeader: ComponentType /** * DockWallet stateful component. */ diff --git a/packages/types/components/SdaLayout.ts b/packages/types/components/SdaLayout.ts index ca7ddecc7..9b60c66f3 100644 --- a/packages/types/components/SdaLayout.ts +++ b/packages/types/components/SdaLayout.ts @@ -1,8 +1,18 @@ -import { ReactNode } from 'react' +import { ComponentType, ReactNode } from 'react' import { SdaNavigationProps } from './SdaNavigation' export type SdaLayoutProps = { + /** + * Props for the SdaNavigation component. + */ navigationProps: SdaNavigationProps + /** + * PageHeader stateful component. + */ + PageHeader: ComponentType + /** + * App content. + */ children: ReactNode } diff --git a/packages/utils/messages/protobuf.ts b/packages/utils/messages/protobuf.ts index 7d846e95e..4c228336a 100644 --- a/packages/utils/messages/protobuf.ts +++ b/packages/utils/messages/protobuf.ts @@ -17,7 +17,6 @@ import { TextProposal } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1 import { Any } from '@dao-dao/types/protobuf/codegen/google/protobuf/any' import { transformIpfsUrlToHttpsIfNecessary } from '../conversion' -import { processError } from '../error' import { isValidUrl } from '../isValidUrl' import { objectMatchesStructure } from '../objectMatchesStructure' import { isCosmWasmStargateMsg } from './cw' @@ -30,8 +29,8 @@ export const decodeGovProposalV1Messages = ( try { return protobufToCwMsg(msg).msg } catch (err) { - // If protobuf not found, capture error and return placeholder. - console.error(processError(err, { forceCapture: true })) + // If protobuf not found, return raw stargate message. + console.error(err) return { stargate: { type_url: msg.typeUrl, From 86e7dcf8b02c4e0bf6293269c121dd8accac3f31 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 5 Jun 2024 10:58:36 -0400 Subject: [PATCH 206/438] fixed proposal vote in page header causing context error --- .../stateful/components/dao/DaoProposal.tsx | 23 ++++++++++--- .../components/ProposalVoter.tsx | 4 +-- .../components/ProposalVoter.tsx | 4 +-- .../react/provider.tsx | 34 ++++++++++++++++--- 4 files changed, 51 insertions(+), 14 deletions(-) diff --git a/packages/stateful/components/dao/DaoProposal.tsx b/packages/stateful/components/dao/DaoProposal.tsx index 8d9ddc08a..4ed3177d6 100644 --- a/packages/stateful/components/dao/DaoProposal.tsx +++ b/packages/stateful/components/dao/DaoProposal.tsx @@ -11,6 +11,7 @@ import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' import { + ProposalModuleAdapterBothProviders, ProposalModuleAdapterProvider, useProposalModuleAdapterContext, } from '@dao-dao/stateful/proposal-module-adapter' @@ -30,6 +31,7 @@ import { } from '@dao-dao/types' import { useOnCurrentDaoWebSocketMessage, useWallet } from '../../hooks' +import { useProposalModuleAdapterCommonContext } from '../../proposal-module-adapter/react/context' import { PageHeaderContent } from '../PageHeaderContent' import { SelfRelayExecuteModal } from '../SelfRelayExecuteModal' import { DaoApproverProposalContentDisplay } from './DaoApproverProposalContentDisplay' @@ -45,6 +47,11 @@ const InnerDaoProposal = ({ proposalInfo }: InnerDaoProposalProps) => { const { t } = useTranslation() const { coreAddress } = useDaoInfoContext() const { address } = useWallet() + + const proposalModuleAdapterContext = useProposalModuleAdapterContext() + const proposalModuleAdapterCommonContext = + useProposalModuleAdapterCommonContext() + const { options: { proposalModule, isPreProposeApprovalProposal }, adapter: { @@ -57,7 +64,7 @@ const InnerDaoProposal = ({ proposalInfo }: InnerDaoProposalProps) => { }, hooks: { useProposalRefreshers, useLoadingWalletVoteInfo }, }, - } = useProposalModuleAdapterContext() + } = proposalModuleAdapterContext const { refreshProposalAndAll } = useProposalRefreshers() const loadingWalletVoteInfo = useLoadingWalletVoteInfo() @@ -256,10 +263,16 @@ const InnerDaoProposal = ({ proposalInfo }: InnerDaoProposalProps) => { }, }} > - + {/* Voter is rendered in page header outside of the current context, so this needs to be wrapped in another provider. */} + + + ) : undefined } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVoter.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVoter.tsx index dfc319be0..366d848fd 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVoter.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVoter.tsx @@ -61,9 +61,9 @@ const InnerProposalVoter = ({ }) => { const { castVote, castingVote } = useCastVote(onVoteSuccess) - // Should never be shown if canVote is false. + // Should not be shown if canVote is false. if (!walletVoteInfo.canVote) { - throw new Error('internal error: cannot vote') + return null } return ( diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVoter.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVoter.tsx index 9e573ac70..b94aed436 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVoter.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVoter.tsx @@ -61,9 +61,9 @@ const InnerProposalVoter = ({ }) => { const { castVote, castingVote } = useCastVote(onVoteSuccess) - // Should never be shown if canVote is false. + // Should not be shown if canVote is false. if (!walletVoteInfo.canVote) { - throw new Error('internal error: cannot vote') + return null } return ( diff --git a/packages/stateful/proposal-module-adapter/react/provider.tsx b/packages/stateful/proposal-module-adapter/react/provider.tsx index 1e3b81714..0068ec184 100644 --- a/packages/stateful/proposal-module-adapter/react/provider.tsx +++ b/packages/stateful/proposal-module-adapter/react/provider.tsx @@ -4,6 +4,8 @@ import { useChain } from '@dao-dao/stateless' import { IProposalModuleAdapterCommonInitialOptions, IProposalModuleAdapterInitialOptions, + IProposalModuleCommonContext, + IProposalModuleContext, ProposalModule, } from '@dao-dao/types' @@ -43,11 +45,12 @@ export const ProposalModuleAdapterProvider = ({ }, [chain, coreAddress, proposalId, proposalModules]) return ( - - - {children} - - + + {children} + ) } @@ -77,3 +80,24 @@ export const ProposalModuleAdapterCommonProvider = ({ ) } + +export type ProposalModuleAdapterBothProvidersProps = { + commonContext: IProposalModuleCommonContext + context: IProposalModuleContext + children: ReactNode | ReactNode[] +} + +/** + * Wrapper around both proposal module adapter contexts. + */ +export const ProposalModuleAdapterBothProviders = ({ + commonContext, + context, + children, +}: ProposalModuleAdapterBothProvidersProps) => ( + + + {children} + + +) From 26d64d9f287784fbcc7cb643bb81acaab15884ef Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 5 Jun 2024 11:03:00 -0400 Subject: [PATCH 207/438] dedupe proposal votes --- packages/stateful/components/gov/GovProposalVotes.tsx | 5 ++++- .../DaoProposalMultiple/components/ProposalVotes/index.tsx | 5 ++++- .../DaoProposalSingle/components/ProposalVotes/index.tsx | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/stateful/components/gov/GovProposalVotes.tsx b/packages/stateful/components/gov/GovProposalVotes.tsx index 2dd186e3e..31cf71509 100644 --- a/packages/stateful/components/gov/GovProposalVotes.tsx +++ b/packages/stateful/components/gov/GovProposalVotes.tsx @@ -1,3 +1,4 @@ +import uniqBy from 'lodash.uniqby' import { useEffect, useState } from 'react' import { useRecoilCallback, useRecoilValue } from 'recoil' @@ -75,7 +76,9 @@ const InnerGovProposalVotes = ({ }) ) - setVotes((prev) => [...prev, ...newVotes]) + setVotes((prev) => + uniqBy([...prev, ...newVotes], ({ voterAddress }) => voterAddress) + ) setNoMoreVotes(newVotes.length < VOTES_PER_PAGE) } finally { setLoading(false) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx index dfcaf9822..c0bfaff4e 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx @@ -1,3 +1,4 @@ +import uniqBy from 'lodash.uniqby' import { useEffect, useState } from 'react' import { useRecoilCallback } from 'recoil' @@ -72,7 +73,9 @@ export const ProposalVotes = (props: BaseProposalVotesProps) => { }) ) - setVotes((prev) => [...prev, ...newVotes]) + setVotes((prev) => + uniqBy([...prev, ...newVotes], ({ voterAddress }) => voterAddress) + ) setNoMoreVotes(newVotes.length < VOTES_PER_PAGE) } finally { setLoading(false) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx index 0c462fa93..c006b6e1f 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx @@ -1,3 +1,4 @@ +import uniqBy from 'lodash.uniqby' import { useEffect, useState } from 'react' import { useRecoilCallback } from 'recoil' @@ -71,7 +72,9 @@ export const ProposalVotes = (props: BaseProposalVotesProps) => { }) ) - setVotes((prev) => [...prev, ...newVotes]) + setVotes((prev) => + uniqBy([...prev, ...newVotes], ({ voterAddress }) => voterAddress) + ) setNoMoreVotes(newVotes.length < VOTES_PER_PAGE) } finally { setLoading(false) From cc03bd02c69c5173d02c689cdbdad6739823a880 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 5 Jun 2024 11:38:39 -0400 Subject: [PATCH 208/438] fixed breadcrumbs not having access to DAO info context in page header --- packages/stateful/components/dao/CreateDaoForm.tsx | 3 +++ .../stateful/components/dao/CreateDaoProposal.tsx | 1 + packages/stateful/components/dao/DaoProposal.tsx | 7 +++++-- .../stateful/components/gov/CreateGovProposal.tsx | 8 +++++++- packages/stateful/components/gov/GovProposal.tsx | 3 +++ packages/stateful/components/pages/DaoDappHome.tsx | 4 ++-- packages/stateful/components/pages/DaoSdaHome.tsx | 11 ++++++----- packages/stateless/components/layout/Breadcrumbs.tsx | 3 ++- packages/types/components/Breadcrumbs.ts | 7 ++++++- 9 files changed, 35 insertions(+), 12 deletions(-) diff --git a/packages/stateful/components/dao/CreateDaoForm.tsx b/packages/stateful/components/dao/CreateDaoForm.tsx index ea9ef92f7..2396a3e0f 100644 --- a/packages/stateful/components/dao/CreateDaoForm.tsx +++ b/packages/stateful/components/dao/CreateDaoForm.tsx @@ -25,6 +25,7 @@ import { TooltipInfoIcon, useAppContext, useCachedLoadable, + useDaoInfoContextIfAvailable, useDaoNavHelpers, useSupportedChainContext, useThemeContext, @@ -146,6 +147,7 @@ export const InnerCreateDaoForm = ({ initialPageIndex = 0, }: CreateDaoFormProps) => { const { t } = useTranslation() + const daoInfo = useDaoInfoContextIfAvailable() const chainContext = useSupportedChainContext() const { @@ -733,6 +735,7 @@ export const InnerCreateDaoForm = ({ } : undefined, current: makingSubDao ? t('title.newSubDao') : t('title.newDao'), + daoInfo, }} centerNode={ !makingSubDao && ( diff --git a/packages/stateful/components/dao/CreateDaoProposal.tsx b/packages/stateful/components/dao/CreateDaoProposal.tsx index 8fc7fe3bc..b17e0c953 100644 --- a/packages/stateful/components/dao/CreateDaoProposal.tsx +++ b/packages/stateful/components/dao/CreateDaoProposal.tsx @@ -379,6 +379,7 @@ const InnerCreateDaoProposal = ({ sdaLabel: t('title.proposals'), }, current: t('title.createProposal'), + daoInfo, }} /> diff --git a/packages/stateful/components/dao/DaoProposal.tsx b/packages/stateful/components/dao/DaoProposal.tsx index 4ed3177d6..c27c6ea9b 100644 --- a/packages/stateful/components/dao/DaoProposal.tsx +++ b/packages/stateful/components/dao/DaoProposal.tsx @@ -45,7 +45,7 @@ interface InnerDaoProposalProps { const InnerDaoProposal = ({ proposalInfo }: InnerDaoProposalProps) => { const { t } = useTranslation() - const { coreAddress } = useDaoInfoContext() + const daoInfo = useDaoInfoContext() const { address } = useWallet() const proposalModuleAdapterContext = useProposalModuleAdapterContext() @@ -135,7 +135,9 @@ const InnerDaoProposal = ({ proposalInfo }: InnerDaoProposalProps) => { toast.loading(t('success.proposalExecuted')) // Manually revalidate DAO static props. - await fetch(`/api/revalidate?d=${coreAddress}&p=${proposalInfo.id}`) + await fetch( + `/api/revalidate?d=${daoInfo.coreAddress}&p=${proposalInfo.id}` + ) // Refresh entire app since any DAO config may have changed. window.location.reload() @@ -244,6 +246,7 @@ const InnerDaoProposal = ({ proposalInfo }: InnerDaoProposalProps) => { sdaLabel: t('title.proposals'), }, current: `${t('title.proposal')} ${proposalInfo.id}`, + daoInfo, }} rightNode={ canVote ? ( diff --git a/packages/stateful/components/gov/CreateGovProposal.tsx b/packages/stateful/components/gov/CreateGovProposal.tsx index aa7278b8a..e91291aaf 100644 --- a/packages/stateful/components/gov/CreateGovProposal.tsx +++ b/packages/stateful/components/gov/CreateGovProposal.tsx @@ -1,7 +1,11 @@ import { useRef } from 'react' import { useTranslation } from 'react-i18next' -import { CreateProposal, PageLoader } from '@dao-dao/stateless' +import { + CreateProposal, + PageLoader, + useDaoInfoContextIfAvailable, +} from '@dao-dao/stateless' import { DaoTabId } from '@dao-dao/types' import { GovActionsProvider } from '../../actions' @@ -11,6 +15,7 @@ import { NewGovProposal } from './NewGovProposal' export const CreateGovProposal = () => { const { t } = useTranslation() + const daoInfo = useDaoInfoContextIfAvailable() const clearRef = useRef(() => {}) const copyDraftLinkRef = useRef(() => {}) @@ -24,6 +29,7 @@ export const CreateGovProposal = () => { sdaLabel: t('title.proposals'), }, current: t('title.createProposal'), + daoInfo, }} /> diff --git a/packages/stateful/components/gov/GovProposal.tsx b/packages/stateful/components/gov/GovProposal.tsx index 3b0130266..952b0ce0c 100644 --- a/packages/stateful/components/gov/GovProposal.tsx +++ b/packages/stateful/components/gov/GovProposal.tsx @@ -14,6 +14,7 @@ import { ProposalNotFound, useCachedLoadingWithError, useChain, + useDaoInfoContextIfAvailable, } from '@dao-dao/stateless' import { BaseProposalVotesProps, @@ -47,6 +48,7 @@ type InnerGovProposalProps = { const InnerGovProposal = ({ proposal }: InnerGovProposalProps) => { const { t } = useTranslation() const { chain_id: chainId } = useChain() + const daoInfo = useDaoInfoContextIfAvailable() const proposalId = proposal.id.toString() const loadingProposal = useLoadingGovProposal(proposalId) @@ -114,6 +116,7 @@ const InnerGovProposal = ({ proposal }: InnerGovProposalProps) => { sdaLabel: t('title.proposals'), }, current: `${t('title.proposal')} ${proposalId}`, + daoInfo, }} rightNode={ proposal.proposal.status === diff --git a/packages/stateful/components/pages/DaoDappHome.tsx b/packages/stateful/components/pages/DaoDappHome.tsx index d328e73d3..e25fbaade 100644 --- a/packages/stateful/components/pages/DaoDappHome.tsx +++ b/packages/stateful/components/pages/DaoDappHome.tsx @@ -42,9 +42,8 @@ export const InnerDaoDappHome = ({ ...props }: InnerDaoDappHomeProps) => { const { t } = useTranslation() - const { getDaoPath, getDaoProposalPath, router } = useDaoNavHelpers() - const daoInfo = useDaoInfoContext() + const { getDaoPath, getDaoProposalPath, router } = useDaoNavHelpers() const { isFollowing, setFollowing, setUnfollowing, updatingFollowing } = useFollowingDaos() @@ -111,6 +110,7 @@ export const InnerDaoDappHome = ({ breadcrumbs={{ home: true, current: daoInfo.name, + daoInfo, }} rightNode={ <> diff --git a/packages/stateful/components/pages/DaoSdaHome.tsx b/packages/stateful/components/pages/DaoSdaHome.tsx index 470639370..75135eb5e 100644 --- a/packages/stateful/components/pages/DaoSdaHome.tsx +++ b/packages/stateful/components/pages/DaoSdaHome.tsx @@ -14,7 +14,7 @@ import { SuspenseLoader } from '../SuspenseLoader' export const DaoSdaHome = () => { const router = useRouter() - const { coreAddress } = useDaoInfoContext() + const daoInfo = useDaoInfoContext() const { getDaoPath } = useDaoNavHelpers() const loadingTabs = useDaoTabs() @@ -27,9 +27,9 @@ export const DaoSdaHome = () => { // Pre-fetch tabs. useEffect(() => { tabs?.forEach((tab) => { - router.prefetch(getDaoPath(coreAddress, tab.id)) + router.prefetch(getDaoPath(daoInfo.coreAddress, tab.id)) }) - }, [coreAddress, getDaoPath, router, tabs]) + }, [daoInfo.coreAddress, getDaoPath, router, tabs]) const slug = (router.query.slug || []) as string[] const checkedSlug = useRef(false) @@ -44,11 +44,11 @@ export const DaoSdaHome = () => { // If no slug, redirect to first tab. if (slug.length === 0) { - router.replace(getDaoPath(coreAddress, firstTabId), undefined, { + router.replace(getDaoPath(daoInfo.coreAddress, firstTabId), undefined, { shallow: true, }) } - }, [coreAddress, getDaoPath, router, slug.length, firstTabId]) + }, [daoInfo.coreAddress, getDaoPath, router, slug.length, firstTabId]) const selectedTabId = slug.length > 0 && tabs?.some(({ id }) => id === slug[0]) @@ -65,6 +65,7 @@ export const DaoSdaHome = () => { breadcrumbs={{ home: true, current: activeTab?.label, + daoInfo, }} /> diff --git a/packages/stateless/components/layout/Breadcrumbs.tsx b/packages/stateless/components/layout/Breadcrumbs.tsx index 2fd5cdea6..e6ecbe216 100644 --- a/packages/stateless/components/layout/Breadcrumbs.tsx +++ b/packages/stateless/components/layout/Breadcrumbs.tsx @@ -17,11 +17,12 @@ export const Breadcrumbs = ({ override = false, homeTab, current, + daoInfo: _daoInfo, className, }: BreadcrumbsProps) => { const { t } = useTranslation() // Allow using Breadcrumbs outside of DaoPageWrapper. - const daoInfo = useDaoInfoContextIfAvailable() + const daoInfo = useDaoInfoContextIfAvailable() || _daoInfo const { mode } = useAppContext() const { getDaoPath } = useDaoNavHelpers() diff --git a/packages/types/components/Breadcrumbs.ts b/packages/types/components/Breadcrumbs.ts index 296a8e263..94bac8047 100644 --- a/packages/types/components/Breadcrumbs.ts +++ b/packages/types/components/Breadcrumbs.ts @@ -1,6 +1,6 @@ import { ReactNode } from 'react' -import { DaoTabId } from '../dao' +import { DaoInfo, DaoTabId } from '../dao' export type BreadcrumbCrumb = { href: string @@ -31,6 +31,11 @@ export type BreadcrumbsProps = { * The current crumb. */ current: ReactNode + /** + * DAO info, if this is being rendered outside of the context provider (like + * in the PageHeader), but still needs access to the DAO info. + */ + daoInfo?: DaoInfo | null /** * Optional container class name. */ From f4d10822e2ed2278ce6aa5281fe28908871ec356 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 5 Jun 2024 20:01:40 -0400 Subject: [PATCH 209/438] removed some chains from the homepage to improve performance --- apps/dapp/pages/[[...tab]].tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/dapp/pages/[[...tab]].tsx b/apps/dapp/pages/[[...tab]].tsx index ff564e9c8..5718b9982 100644 --- a/apps/dapp/pages/[[...tab]].tsx +++ b/apps/dapp/pages/[[...tab]].tsx @@ -49,9 +49,7 @@ export const getStaticProps: GetStaticProps = async ({ 'regen-1', 'injective-1', 'celestia', - 'dydx-mainnet-1', 'archway-1', - 'coreum-mainnet-1', ] : []), ].map((chainId) => getDaoInfoForChainId(chainId, [])) From 74f0ad3caf01d4628e22e8332cfcdd1ae9f8c2d4 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 5 Jun 2024 20:21:46 -0400 Subject: [PATCH 210/438] fixed chain gov list page search bar --- packages/stateless/pages/ChainGovernanceList.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/stateless/pages/ChainGovernanceList.tsx b/packages/stateless/pages/ChainGovernanceList.tsx index 4352721e9..83e7303d5 100644 --- a/packages/stateless/pages/ChainGovernanceList.tsx +++ b/packages/stateless/pages/ChainGovernanceList.tsx @@ -79,6 +79,6 @@ export const ChainGovernanceList = ({ } const FILTERABLE_KEYS: Fuse.FuseOptionKey[] = [ - 'name', - 'chainId', + 'info.name', + 'info.chainId', ] From ff31899bffb958831ede7b2cd0151779b13fa54b Mon Sep 17 00:00:00 2001 From: noah Date: Thu, 6 Jun 2024 12:02:31 -0400 Subject: [PATCH 211/438] React Query! (#1783) --- .vscode/launch.json | 17 +- apps/dapp/next.config.js | 2 + apps/dapp/package.json | 1 + apps/dapp/pages/[[...tab]].tsx | 37 +- apps/dapp/pages/_app.tsx | 7 +- apps/dapp/pages/dao/[address]/[[...slug]].tsx | 2 +- apps/dapp/pages/dao/[address]/create.tsx | 2 +- .../pages/dao/[address]/proposals/create.tsx | 2 +- apps/sda/pages/[address]/[[...slug]].tsx | 2 +- apps/sda/pages/[address]/create.tsx | 2 +- apps/sda/pages/[address]/proposals/create.tsx | 2 +- apps/sda/pages/_app.tsx | 9 +- packages/state/README.md | 2 + packages/state/contracts/PolytoneVoice.ts | 107 ++ packages/state/contracts/index.ts | 1 + packages/state/index.ts | 1 + packages/state/indexer/query.ts | 19 +- packages/state/package.json | 1 + packages/state/query/client.ts | 60 ++ packages/state/query/index.ts | 2 + packages/state/query/queries/account.ts | 193 ++++ packages/state/query/queries/chain.ts | 201 ++++ packages/state/query/queries/contract.ts | 234 +++++ .../query/queries/contracts/Cw1Whitelist.ts | 132 +++ .../query/queries/contracts/DaoDaoCore.ts | 918 ++++++++++++++++++ .../query/queries/contracts/PolytoneNote.ts | 84 ++ .../query/queries/contracts/PolytoneProxy.ts | 80 ++ .../query/queries/contracts/PolytoneVoice.ts | 95 ++ .../state/query/queries/contracts/index.ts | 6 + .../query/queries/contracts/votingModule.ts | 84 ++ packages/state/query/queries/dao.ts | 63 ++ packages/state/query/queries/index.ts | 9 + packages/state/query/queries/indexer.ts | 148 +++ packages/state/query/queries/polytone.ts | 157 +++ packages/state/query/queries/profile.ts | 338 +++++++ packages/state/recoil/atoms/misc.ts | 7 + packages/state/recoil/atoms/refresh.ts | 7 - packages/state/recoil/selectors/chain.ts | 128 +-- .../recoil/selectors/contracts/DaoCore.v2.ts | 3 +- packages/state/recoil/selectors/dao.ts | 123 +-- packages/state/recoil/selectors/index.ts | 1 - packages/state/recoil/selectors/indexer.ts | 36 - packages/state/recoil/selectors/profile.ts | 309 ------ packages/state/recoil/selectors/treasury.ts | 9 +- packages/state/recoil/selectors/wallet.ts | 4 +- packages/state/utils/contract.ts | 84 +- packages/stateful/README.md | 1 + .../core/authorizations/AuthzExec/index.tsx | 57 +- .../core/dao_governance/CreateDao/index.tsx | 28 +- .../dao_governance/DaoAdminExec/index.tsx | 34 +- .../VetoOrEarlyExecuteDaoProposal/index.tsx | 26 +- .../actions/core/treasury/Spend/index.tsx | 22 +- .../stateful/InstantiateTokenSwap.tsx | 28 +- .../stateful/command/contexts/generic/dao.tsx | 36 +- packages/stateful/components/AddressInput.tsx | 103 +- .../stateful/components/StateProvider.tsx | 59 ++ .../stateful/components/dao/CreateDaoForm.tsx | 16 +- .../dao/DaoApproverProposalContentDisplay.tsx | 7 +- packages/stateful/components/dao/DaoCard.tsx | 15 + .../components/dao/DaoPageWrapper.tsx | 80 +- .../stateful/components/dao/DaoProviders.tsx | 21 +- .../stateful/components/dao/LazyDaoCard.tsx | 23 +- .../components/dao/tabs/SubDaosTab.tsx | 24 +- .../stateful/components/gov/GovSubDaosTab.tsx | 21 +- packages/stateful/components/index.ts | 1 + .../stateful/components/pages/Account.tsx | 9 +- packages/stateful/components/pages/Home.tsx | 85 +- .../components/wallet/WalletProvider.tsx | 8 +- packages/stateful/hooks/index.ts | 2 + packages/stateful/hooks/useEntity.ts | 25 +- packages/stateful/hooks/useLoadingDaos.ts | 88 +- packages/stateful/hooks/useManageProfile.ts | 53 +- packages/stateful/hooks/useProfile.ts | 10 +- .../stateful/hooks/useQueryLoadingData.ts | 61 ++ .../hooks/useQueryLoadingDataWithError.ts | 56 ++ packages/stateful/hooks/useRefreshProfile.ts | 66 +- packages/stateful/index.ts | 1 + packages/stateful/package.json | 1 + .../functions/fetchPrePropose.ts | 3 +- .../functions/fetchPrePropose.ts | 3 +- packages/stateful/queries/dao.ts | 451 +++++++++ packages/stateful/queries/entity.ts | 214 ++++ packages/stateful/queries/index.ts | 2 + packages/stateful/recoil/selectors/dao.ts | 281 +----- packages/stateful/recoil/selectors/entity.ts | 186 ---- packages/stateful/recoil/selectors/index.ts | 1 - .../stateful/server/makeGetDaoStaticProps.ts | 862 +++------------- .../stateful/utils/fetchProposalModules.ts | 25 +- .../components/dao/DaoCard.stories.tsx | 1 + packages/stateless/components/dao/DaoCard.tsx | 3 +- .../stateless/components/dao/DaoImage.tsx | 2 +- packages/stateless/hooks/useCachedLoadable.ts | 13 +- packages/types/components/DaoCard.tsx | 9 + packages/types/components/EntityDisplay.tsx | 12 +- packages/types/contracts/DaoCore.v2.ts | 5 + packages/types/contracts/PolytoneVoice.ts | 35 + packages/types/contracts/common.ts | 4 + packages/types/dao.ts | 7 +- packages/types/misc.ts | 26 +- packages/types/package.json | 3 +- packages/types/proposal-module-adapter.ts | 2 + packages/utils/assets.ts | 2 +- packages/utils/chain.ts | 108 +-- packages/utils/client.ts | 238 +++-- packages/utils/constants/chains.ts | 77 +- packages/utils/contracts.ts | 10 +- packages/utils/conversion.ts | 51 + packages/utils/nft.ts | 20 +- packages/utils/package.json | 1 + packages/utils/profile.ts | 6 +- yarn.lock | 12 + 111 files changed, 4955 insertions(+), 2518 deletions(-) create mode 100644 packages/state/contracts/PolytoneVoice.ts create mode 100644 packages/state/query/client.ts create mode 100644 packages/state/query/index.ts create mode 100644 packages/state/query/queries/account.ts create mode 100644 packages/state/query/queries/chain.ts create mode 100644 packages/state/query/queries/contract.ts create mode 100644 packages/state/query/queries/contracts/Cw1Whitelist.ts create mode 100644 packages/state/query/queries/contracts/DaoDaoCore.ts create mode 100644 packages/state/query/queries/contracts/PolytoneNote.ts create mode 100644 packages/state/query/queries/contracts/PolytoneProxy.ts create mode 100644 packages/state/query/queries/contracts/PolytoneVoice.ts create mode 100644 packages/state/query/queries/contracts/index.ts create mode 100644 packages/state/query/queries/contracts/votingModule.ts create mode 100644 packages/state/query/queries/dao.ts create mode 100644 packages/state/query/queries/index.ts create mode 100644 packages/state/query/queries/indexer.ts create mode 100644 packages/state/query/queries/polytone.ts create mode 100644 packages/state/query/queries/profile.ts delete mode 100644 packages/state/recoil/selectors/profile.ts create mode 100644 packages/stateful/components/StateProvider.tsx create mode 100644 packages/stateful/hooks/useQueryLoadingData.ts create mode 100644 packages/stateful/hooks/useQueryLoadingDataWithError.ts create mode 100644 packages/stateful/queries/dao.ts create mode 100644 packages/stateful/queries/entity.ts create mode 100644 packages/stateful/queries/index.ts delete mode 100644 packages/stateful/recoil/selectors/entity.ts create mode 100644 packages/types/contracts/PolytoneVoice.ts diff --git a/.vscode/launch.json b/.vscode/launch.json index 962d45447..0d22cf1e6 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,10 +5,21 @@ "version": "0.2.0", "configurations": [ { - "name": "Next.js: debug server-side", - "type": "node-terminal", + "type": "node", "request": "launch", - "command": "yarn dapp dev" + "name": "Next.js: debug server-side", + "runtimeExecutable": "${workspaceFolder}/node_modules/next/dist/bin/next", + "env": { + "NODE_OPTIONS": "--inspect" + }, + "cwd": "${workspaceFolder}/apps/dapp", + "console": "integratedTerminal", + "sourceMaps": true, + "sourceMapPathOverrides": { + "webpack:///./~/*": "${workspaceFolder}/node_modules/*", + "webpack:///./*": "${workspaceRoot}/apps/dapp/*", + "webpack://?:*/*": "${workspaceFolder}/apps/dapp/*" + } }, { "name": "Next.js: debug client-side", diff --git a/apps/dapp/next.config.js b/apps/dapp/next.config.js index e7555d19f..b5bc20817 100644 --- a/apps/dapp/next.config.js +++ b/apps/dapp/next.config.js @@ -32,6 +32,8 @@ const config = { // Because @cosmos-kit/web3auth uses a Worker ESM import. experimental: { esmExternals: 'loose', + // Increase (to 1 MB) to allow for react-query pre-fetched hydration. + largePageDataBytes: 1 * 1024 * 1024, }, webpack: (config) => { // @cosmos-kit/web3auth uses eccrypto, which uses `stream`. This needs to be diff --git a/apps/dapp/package.json b/apps/dapp/package.json index 8811f51ff..9eb1e36dd 100644 --- a/apps/dapp/package.json +++ b/apps/dapp/package.json @@ -33,6 +33,7 @@ "@keplr-wallet/types": "^0.11.49", "@mui/icons-material": "^5.10.3", "@sentry/nextjs": "^7.80.0", + "@tanstack/react-query": "^5.40.0", "@types/formidable": "^2.0.5", "cors": "^2.8.5", "formidable": "^2.0.1", diff --git a/apps/dapp/pages/[[...tab]].tsx b/apps/dapp/pages/[[...tab]].tsx index 5718b9982..cd64729d3 100644 --- a/apps/dapp/pages/[[...tab]].tsx +++ b/apps/dapp/pages/[[...tab]].tsx @@ -4,8 +4,17 @@ import { GetStaticPaths, GetStaticProps } from 'next' import { serverSideTranslations } from '@dao-dao/i18n/serverSideTranslations' -import { querySnapper } from '@dao-dao/state' -import { Home, StatefulHomeProps } from '@dao-dao/stateful' +import { + daoQueries, + dehydrateSerializable, + makeReactQueryClient, + querySnapper, +} from '@dao-dao/state' +import { + Home, + StatefulHomeProps, + daoQueries as statefulDaoQueries, +} from '@dao-dao/stateful' import { AccountTabId, ChainId, DaoDaoIndexerChainStats } from '@dao-dao/types' import { MAINNET, @@ -54,8 +63,13 @@ export const getStaticProps: GetStaticProps = async ({ : []), ].map((chainId) => getDaoInfoForChainId(chainId, [])) - // Get all or chain-specific stats and TVL. - const [tvl, allStats, monthStats, weekStats] = await Promise.all([ + const queryClient = makeReactQueryClient() + + const [i18nProps, tvl, allStats, monthStats, weekStats] = await Promise.all([ + // Get i18n translations props. + serverSideTranslations(locale, ['translation']), + + // Get all or chain-specific stats and TVL. querySnapper({ query: chainId ? 'daodao-chain-tvl' : 'daodao-all-tvl', parameters: chainId ? { chainId } : undefined, @@ -78,6 +92,17 @@ export const getStaticProps: GetStaticProps = async ({ daysAgo: 7, }, }), + + // Pre-fetch featured DAOs. + queryClient + .fetchQuery(daoQueries.listFeatured()) + .then((featured) => + Promise.all( + featured?.map((dao) => + queryClient.fetchQuery(statefulDaoQueries.info(queryClient, dao)) + ) || [] + ) + ), ]) const validTvl = typeof tvl === 'number' @@ -111,7 +136,7 @@ export const getStaticProps: GetStaticProps = async ({ return { props: { - ...(await serverSideTranslations(locale, ['translation'])), + ...i18nProps, // Chain-specific home page. ...(chainId && { chainId }), // All or chain-specific stats. @@ -125,6 +150,8 @@ export const getStaticProps: GetStaticProps = async ({ }, // Chain x/gov DAOs. ...(chainGovDaos && { chainGovDaos }), + // Dehydrate react-query state with featured DAOs preloaded. + reactQueryDehydratedState: dehydrateSerializable(queryClient), }, // Revalidate every day. revalidate: 24 * 60 * 60, diff --git a/apps/dapp/pages/_app.tsx b/apps/dapp/pages/_app.tsx index 1c718f0c2..12ccaa61f 100644 --- a/apps/dapp/pages/_app.tsx +++ b/apps/dapp/pages/_app.tsx @@ -11,7 +11,7 @@ import { DefaultSeo } from 'next-seo' import type { AppProps } from 'next/app' import { useRouter } from 'next/router' import { useEffect, useState } from 'react' -import { RecoilRoot, useRecoilState, useSetRecoilState } from 'recoil' +import { useRecoilState, useSetRecoilState } from 'recoil' import { activeThemeAtom, @@ -21,6 +21,7 @@ import { import { AppContextProvider, DappLayout, + StateProvider, WalletProvider, } from '@dao-dao/stateful' import { @@ -167,9 +168,9 @@ const DApp = (props: AppProps) => ( }} /> - + - + ) diff --git a/apps/dapp/pages/dao/[address]/[[...slug]].tsx b/apps/dapp/pages/dao/[address]/[[...slug]].tsx index 0301bf7d7..ba40dd493 100644 --- a/apps/dapp/pages/dao/[address]/[[...slug]].tsx +++ b/apps/dapp/pages/dao/[address]/[[...slug]].tsx @@ -37,7 +37,7 @@ export const getStaticPaths: GetStaticPaths = () => ({ export const getStaticProps: GetStaticProps = makeGetDaoStaticProps({ appMode: DaoPageMode.Dapp, - getProps: async ({ coreAddress }) => ({ + getProps: async ({ daoInfo: { coreAddress } }) => ({ url: SITE_URL + getDaoPath(DaoPageMode.Dapp, coreAddress), }), }) diff --git a/apps/dapp/pages/dao/[address]/create.tsx b/apps/dapp/pages/dao/[address]/create.tsx index 06540a222..7329efd53 100644 --- a/apps/dapp/pages/dao/[address]/create.tsx +++ b/apps/dapp/pages/dao/[address]/create.tsx @@ -31,7 +31,7 @@ export const getStaticPaths: GetStaticPaths = () => ({ export const getStaticProps: GetStaticProps = makeGetDaoStaticProps({ appMode: DaoPageMode.Dapp, - getProps: async ({ t, coreAddress }) => ({ + getProps: async ({ t, daoInfo: { coreAddress } }) => ({ url: SITE_URL + getDaoPath(DaoPageMode.Dapp, coreAddress, 'create'), followingTitle: t('title.createASubDao'), }), diff --git a/apps/dapp/pages/dao/[address]/proposals/create.tsx b/apps/dapp/pages/dao/[address]/proposals/create.tsx index 5829c7c7c..9f1a3ad79 100644 --- a/apps/dapp/pages/dao/[address]/proposals/create.tsx +++ b/apps/dapp/pages/dao/[address]/proposals/create.tsx @@ -39,7 +39,7 @@ export const getStaticPaths: GetStaticPaths = () => ({ export const getStaticProps: GetStaticProps = makeGetDaoStaticProps({ appMode: DaoPageMode.Dapp, - getProps: ({ t, coreAddress }) => ({ + getProps: ({ t, daoInfo: { coreAddress } }) => ({ url: SITE_URL + getDaoProposalPath(DaoPageMode.Dapp, coreAddress, 'create'), followingTitle: t('title.createAProposal'), }), diff --git a/apps/sda/pages/[address]/[[...slug]].tsx b/apps/sda/pages/[address]/[[...slug]].tsx index 23738c551..18710e831 100644 --- a/apps/sda/pages/[address]/[[...slug]].tsx +++ b/apps/sda/pages/[address]/[[...slug]].tsx @@ -18,7 +18,7 @@ export const getStaticPaths: GetStaticPaths = () => ({ export const getStaticProps: GetStaticProps = makeGetDaoStaticProps({ appMode: DaoPageMode.Sda, - getProps: async ({ coreAddress }) => ({ + getProps: async ({ daoInfo: { coreAddress } }) => ({ url: SITE_URL + getDaoPath(DaoPageMode.Sda, coreAddress), }), }) diff --git a/apps/sda/pages/[address]/create.tsx b/apps/sda/pages/[address]/create.tsx index d57bd1bf2..5fbd897a6 100644 --- a/apps/sda/pages/[address]/create.tsx +++ b/apps/sda/pages/[address]/create.tsx @@ -18,7 +18,7 @@ export const getStaticPaths: GetStaticPaths = () => ({ export const getStaticProps: GetStaticProps = makeGetDaoStaticProps({ appMode: DaoPageMode.Sda, - getProps: async ({ t, coreAddress }) => ({ + getProps: async ({ t, daoInfo: { coreAddress } }) => ({ url: SITE_URL + getDaoPath(DaoPageMode.Sda, coreAddress, 'create'), followingTitle: t('title.createASubDao'), }), diff --git a/apps/sda/pages/[address]/proposals/create.tsx b/apps/sda/pages/[address]/proposals/create.tsx index edf11bddb..4f398fbd0 100644 --- a/apps/sda/pages/[address]/proposals/create.tsx +++ b/apps/sda/pages/[address]/proposals/create.tsx @@ -19,7 +19,7 @@ export const getStaticPaths: GetStaticPaths = () => ({ export const getStaticProps: GetStaticProps = makeGetDaoStaticProps({ appMode: DaoPageMode.Sda, - getProps: ({ t, coreAddress }) => ({ + getProps: ({ t, daoInfo: { coreAddress } }) => ({ url: SITE_URL + getDaoProposalPath(DaoPageMode.Sda, coreAddress, 'create'), followingTitle: t('title.createAProposal'), }), diff --git a/apps/sda/pages/_app.tsx b/apps/sda/pages/_app.tsx index 80c386cb0..4a69e3694 100644 --- a/apps/sda/pages/_app.tsx +++ b/apps/sda/pages/_app.tsx @@ -10,8 +10,8 @@ import PlausibleProvider from 'next-plausible' import { DefaultSeo } from 'next-seo' import type { AppProps } from 'next/app' import { useRouter } from 'next/router' -import { Fragment, useEffect, useState } from 'react' -import { RecoilRoot, useRecoilState, useSetRecoilState } from 'recoil' +import { useEffect, useState } from 'react' +import { useRecoilState, useSetRecoilState } from 'recoil' import { activeThemeAtom, @@ -23,6 +23,7 @@ import { DaoPageWrapper, DaoPageWrapperProps, SdaLayout, + StateProvider, WalletProvider, } from '@dao-dao/stateful' import { @@ -181,9 +182,9 @@ const Sda = (props: AppProps) => { }} /> - + - + ) } diff --git a/packages/state/README.md b/packages/state/README.md index d133584d7..292cf4332 100644 --- a/packages/state/README.md +++ b/packages/state/README.md @@ -7,5 +7,7 @@ State retrieval and management for the DAO DAO UI. | Location | Summary | | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | [`contracts`](./contracts) | Smart contract query and execute clients auto-generated with [@cosmwasm/ts-codegen](https://www.npmjs.com/package/@cosmwasm/ts-codegen). | +| [`graphql`](./graphql) | GraphQL-related state, such as the Stargaze API. | | [`indexer`](./indexer) | Functions for accessing the DAO DAO indexer. | +| [`query`](./query) | [React Query](https://tanstack.com/query/latest/docs/framework/react/overview)-related client and queries. | | [`recoil`](./recoil) | [Recoil](https://recoiljs.org/) atoms and selectors for loading and caching state. | diff --git a/packages/state/contracts/PolytoneVoice.ts b/packages/state/contracts/PolytoneVoice.ts new file mode 100644 index 000000000..bbd510de4 --- /dev/null +++ b/packages/state/contracts/PolytoneVoice.ts @@ -0,0 +1,107 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import { Coin, StdFee } from '@cosmjs/amino' +import { + CosmWasmClient, + ExecuteResult, + SigningCosmWasmClient, +} from '@cosmjs/cosmwasm-stargate' + +import { Binary, SenderInfo } from '@dao-dao/types/contracts/PolytoneVoice' + +export interface PolytoneVoiceReadOnlyInterface { + contractAddress: string + senderInfoForProxy: ({ proxy }: { proxy: string }) => Promise +} +export class PolytoneVoiceQueryClient + implements PolytoneVoiceReadOnlyInterface +{ + client: CosmWasmClient + contractAddress: string + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client + this.contractAddress = contractAddress + this.senderInfoForProxy = this.senderInfoForProxy.bind(this) + } + senderInfoForProxy = async ({ + proxy, + }: { + proxy: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sender_info_for_proxy: { + proxy, + }, + }) + } +} +export interface PolytoneVoiceInterface extends PolytoneVoiceReadOnlyInterface { + contractAddress: string + sender: string + rx: ( + { + connectionId, + counterpartyPort, + data, + }: { + connectionId: string + counterpartyPort: string + data: Binary + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise +} +export class PolytoneVoiceClient + extends PolytoneVoiceQueryClient + implements PolytoneVoiceInterface +{ + client: SigningCosmWasmClient + sender: string + contractAddress: string + constructor( + client: SigningCosmWasmClient, + sender: string, + contractAddress: string + ) { + super(client, contractAddress) + this.client = client + this.sender = sender + this.contractAddress = contractAddress + this.rx = this.rx.bind(this) + } + rx = async ( + { + connectionId, + counterpartyPort, + data, + }: { + connectionId: string + counterpartyPort: string + data: Binary + }, + fee: number | StdFee | 'auto' = 'auto', + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + rx: { + connection_id: connectionId, + counterparty_port: counterpartyPort, + data, + }, + }, + fee, + memo, + _funds + ) + } +} diff --git a/packages/state/contracts/index.ts b/packages/state/contracts/index.ts index 769157de0..e253fa69c 100644 --- a/packages/state/contracts/index.ts +++ b/packages/state/contracts/index.ts @@ -92,4 +92,5 @@ export { } from './PolytoneListener' export { PolytoneNoteClient, PolytoneNoteQueryClient } from './PolytoneNote' export { PolytoneProxyClient, PolytoneProxyQueryClient } from './PolytoneProxy' +export { PolytoneVoiceClient, PolytoneVoiceQueryClient } from './PolytoneVoice' export { Sg721BaseClient, Sg721BaseQueryClient } from './Sg721Base' diff --git a/packages/state/index.ts b/packages/state/index.ts index 3af884ad4..26e0a2327 100644 --- a/packages/state/index.ts +++ b/packages/state/index.ts @@ -3,3 +3,4 @@ export * from './graphql' export * from './indexer' export * from './recoil' export * from './utils' +export * from './query' diff --git a/packages/state/indexer/query.ts b/packages/state/indexer/query.ts index bd15ab3e5..f934f226f 100644 --- a/packages/state/indexer/query.ts +++ b/packages/state/indexer/query.ts @@ -69,22 +69,19 @@ export const queryIndexer = async ({ }), }) - const response = await fetch( - INDEXER_URL + - `/${chainId}/${type}/${address}/${formula}?${params.toString()}`, - { - method: 'GET', - headers: { - 'Content-Type': 'application/json', - }, - } - ) + const path = `/${chainId}/${type}/${address}/${formula}?${params.toString()}` + const response = await fetch(INDEXER_URL + path, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }) const body = await response.text() if (response.status >= 300) { throw new Error( - `Error querying indexer for ${type}/${address}/${formula}: ${response.status} ${body}`.trim() + `Error querying indexer for ${path}: ${response.status} ${body}`.trim() ) } diff --git a/packages/state/package.json b/packages/state/package.json index 422e55e72..1d6064cf0 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -17,6 +17,7 @@ "@cosmjs/proto-signing": "^0.32.3", "@cosmjs/stargate": "^0.32.3", "@dao-dao/utils": "2.4.0-rc.8", + "@tanstack/react-query": "^5.40.0", "graphql": "^16.8.1", "json5": "^2.2.0", "lodash.uniq": "^4.5.0", diff --git a/packages/state/query/client.ts b/packages/state/query/client.ts new file mode 100644 index 000000000..885bf6213 --- /dev/null +++ b/packages/state/query/client.ts @@ -0,0 +1,60 @@ +import { + DehydratedState, + QueryClient, + QueryKey, + dehydrate, + hydrate, +} from '@tanstack/react-query' + +/** + * Make a new instance of the react query client. + */ +export const makeReactQueryClient = ( + /** + * Optionally hydrate the query client with dehydrated state. + */ + dehydratedState?: DehydratedState +) => { + const client = new QueryClient({ + defaultOptions: { + queries: { + // Global default to 60 seconds. + staleTime: 60 * 1000, + }, + }, + }) + + // Hydate if dehydrated state is provided. + if (dehydratedState) { + hydrate(client, dehydratedState) + } + + return client +} + +/** + * Dehydrate query client and remove undefined values so it can be serialized. + */ +export const dehydrateSerializable: typeof dehydrate = (...args) => { + const dehydrated = dehydrate(...args) + return { + mutations: dehydrated.mutations, + queries: dehydrated.queries.map(({ queryKey, ...query }) => ({ + ...query, + queryKey: removeUndefinedFromQueryKey(queryKey) as QueryKey, + })), + } +} + +const removeUndefinedFromQueryKey = (value: unknown): unknown => + typeof value === 'object' && value !== null + ? Object.fromEntries( + Object.entries(value).flatMap(([k, v]) => + v === undefined ? [] : [[k, removeUndefinedFromQueryKey(v)]] + ) + ) + : Array.isArray(value) + ? value.flatMap((v) => + v === undefined ? [] : [removeUndefinedFromQueryKey(v)] + ) + : value diff --git a/packages/state/query/index.ts b/packages/state/query/index.ts new file mode 100644 index 000000000..290cc9f70 --- /dev/null +++ b/packages/state/query/index.ts @@ -0,0 +1,2 @@ +export * from './client' +export * from './queries' diff --git a/packages/state/query/queries/account.ts b/packages/state/query/queries/account.ts new file mode 100644 index 000000000..78507819c --- /dev/null +++ b/packages/state/query/queries/account.ts @@ -0,0 +1,193 @@ +import { QueryClient, queryOptions } from '@tanstack/react-query' + +import { Account, AccountType } from '@dao-dao/types' +import { + ICA_CHAINS_TX_PREFIX, + getConfiguredChainConfig, + getIbcTransferInfoBetweenChains, + ibcProtoRpcClientRouter, +} from '@dao-dao/utils' + +import { chainQueries } from './chain' +import { contractQueries } from './contract' +import { daoDaoCoreQueries } from './contracts/DaoDaoCore' +import { polytoneQueries } from './polytone' + +/** + * Fetch the list of accounts associated with the specified address, with + * support for: + * - detecting if the address is a polytone proxy + * - automatically loading a DAO's registered ICAs + */ +export const fetchAccountList = async ( + queryClient: QueryClient, + { + chainId, + address, + includeIcaChains, + }: { + chainId: string + address: string + /** + * Optionally check for ICAs on these chain IDs. + */ + includeIcaChains?: string[] + } +): Promise => { + const chainConfig = getConfiguredChainConfig(chainId) + if (chainConfig && chainConfig.name === address) { + address = await queryClient.fetchQuery( + chainQueries.moduleAddress({ + chainId, + name: chainConfig.name, + }) + ) + } + + const [isDao, isPolytoneProxy] = await Promise.all([ + queryClient.fetchQuery( + contractQueries.isDao(queryClient, { chainId, address }) + ), + queryClient.fetchQuery( + contractQueries.isPolytoneProxy(queryClient, { chainId, address }) + ), + ]) + + // If this is a DAO, get its polytone proxies and registered ICAs (which is a + // chain the DAO has indicated it has an ICA on by storing an item in its KV). + const [polytoneProxies, registeredIcas] = isDao + ? await Promise.all([ + queryClient.fetchQuery( + polytoneQueries.proxies(queryClient, { chainId, address }) + ), + queryClient.fetchQuery( + daoDaoCoreQueries.listAllItems(queryClient, { + chainId, + contractAddress: address, + args: { + prefix: ICA_CHAINS_TX_PREFIX, + }, + }) + ), + ]) + : [] + + const mainAccount: Account = { + chainId, + address, + type: isPolytoneProxy ? AccountType.Polytone : AccountType.Native, + } + + const allAccounts: Account[] = [ + // Main account. + mainAccount, + // Polytone. + ...Object.entries(polytoneProxies || {}).map( + ([chainId, address]): Account => ({ + chainId, + address, + type: AccountType.Polytone, + }) + ), + ] + + // If main account is native, load ICA accounts. + const icaChains = + mainAccount.type === AccountType.Native + ? [ + ...(registeredIcas || []).map(([key]) => key), + ...(includeIcaChains || []), + ] + : [] + + const icas = await Promise.allSettled( + icaChains.map((destChainId) => + queryClient.fetchQuery( + accountQueries.remoteIcaAddress({ + srcChainId: mainAccount.chainId, + address: mainAccount.address, + destChainId, + }) + ) + ) + ) + + // Add ICA accounts. + icas.forEach((addressLoadable, index) => { + if (addressLoadable.status === 'fulfilled' && addressLoadable.value) { + allAccounts.push({ + type: AccountType.Ica, + chainId: icaChains[index], + address: addressLoadable.value, + }) + } + }) + + return allAccounts +} + +/** + * Fetch ICA address on host (`destChainId`) controlled by `address` on + * controller (`srcChainId`). + */ +export const fetchRemoteIcaAddress = async ({ + srcChainId, + address, + destChainId, +}: { + srcChainId: string + address: string + destChainId: string +}): Promise => { + const { + sourceChain: { connection_id }, + } = getIbcTransferInfoBetweenChains(srcChainId, destChainId) + const ibcClient = await ibcProtoRpcClientRouter.connect(srcChainId) + + try { + const account = + await ibcClient.applications.interchain_accounts.controller.v1.interchainAccount( + { + owner: address, + connectionId: connection_id, + } + ) + + return account.address + } catch (err) { + // On lookup failure, return undefined. + if ( + err instanceof Error && + err.message.includes('failed to retrieve account address') && + err.message.includes('key not found') + ) { + return null + } + + // Rethrow all other errors. + throw err + } +} + +export const accountQueries = { + /** + * Fetch the list of accounts associated with the specified address. + */ + list: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['account', 'list', options], + queryFn: () => fetchAccountList(queryClient, options), + }), + /** + * Fetch ICA address on host (`destChainId`) controlled by `address` on + * controller (`srcChainId`). + */ + remoteIcaAddress: (options: Parameters[0]) => + queryOptions({ + queryKey: ['account', 'remoteIcaAddress', options], + queryFn: () => fetchRemoteIcaAddress(options), + }), +} diff --git a/packages/state/query/queries/chain.ts b/packages/state/query/queries/chain.ts new file mode 100644 index 000000000..735660229 --- /dev/null +++ b/packages/state/query/queries/chain.ts @@ -0,0 +1,201 @@ +import { QueryClient, queryOptions } from '@tanstack/react-query' + +import { ModuleAccount } from '@dao-dao/types/protobuf/codegen/cosmos/auth/v1beta1/auth' +import { + cosmWasmClientRouter, + cosmosProtoRpcClientRouter, + isValidBech32Address, +} from '@dao-dao/utils' + +/** + * Fetch the module address associated with the specified name. + */ +const fetchChainModuleAddress = async ({ + chainId, + name, +}: { + chainId: string + name: string +}): Promise => { + const client = await cosmosProtoRpcClientRouter.connect(chainId) + + let account: ModuleAccount | undefined + try { + const response = await client.auth.v1beta1.moduleAccountByName({ + name, + }) + account = response?.account + } catch (err) { + // Some chains don't support getting a module account by name directly, so + // fallback to getting all module accounts. + if (err instanceof Error && err.message.includes('unknown query path')) { + const { accounts } = await client.auth.v1beta1.moduleAccounts({}) + account = accounts.find( + (acc) => + 'name' in acc && (acc as unknown as ModuleAccount).name === name + ) as unknown as ModuleAccount | undefined + } else { + // Rethrow other errors. + throw err + } + } + + if (!account) { + throw new Error(`Failed to find ${name} module address.`) + } + + return 'baseAccount' in account ? account.baseAccount?.address ?? '' : '' +} + +/** + * Fetch the module name associated with the specified address. Returns null if + * not a module account. + */ +const fetchChainModuleName = async ({ + chainId, + address, +}: { + chainId: string + address: string +}): Promise => { + const client = await cosmosProtoRpcClientRouter.connect(chainId) + + try { + const { account } = await client.auth.v1beta1.account({ + address, + }) + + if (!account) { + return null + } + + // If not decoded automatically... + if (account.typeUrl === ModuleAccount.typeUrl) { + return ModuleAccount.decode(account.value).name + + // If decoded automatically... + } else if (account.$typeUrl === ModuleAccount.typeUrl) { + return (account as unknown as ModuleAccount).name + } + } catch (err) { + // If no account found, return null. + if ( + err instanceof Error && + err.message.includes('not found: key not found') + ) { + return null + } + + // Rethrow other errors. + throw err + } + + return null +} + +/** + * Check whether or not the address is a chain module, optionally with a + * specific name. + */ +export const isAddressModule = async ( + queryClient: QueryClient, + { + chainId, + address, + moduleName, + }: { + chainId: string + address: string + /** + * If defined, check that the module address matches the specified name. + */ + moduleName?: string + } +): Promise => { + if (!isValidBech32Address(address)) { + return false + } + + try { + const name = await queryClient.fetchQuery( + chainQueries.moduleName({ + chainId, + address, + }) + ) + + // Null if not a module. + if (!name) { + return false + } + + // If name to check provided, check it. Otherwise, return true. + return !moduleName || name === moduleName + } catch (err) { + // If invalid address, return false. Should never happen because of the + // check at the beginning, but just in case. + if ( + err instanceof Error && + err.message.includes('decoding bech32 failed') + ) { + return false + } + + // Rethrow other errors. + throw err + } +} + +/** + * Fetch the timestamp for a given block height. + */ +export const fetchBlockTimestamp = async ({ + chainId, + height, +}: { + chainId: string + height: number +}): Promise => { + const client = await cosmWasmClientRouter.connect(chainId) + return new Date((await client.getBlock(height)).header.time).getTime() +} + +export const chainQueries = { + /** + * Fetch the module address associated with the specified name. + */ + moduleAddress: (options: Parameters[0]) => + queryOptions({ + queryKey: ['chain', 'moduleAddress', options], + queryFn: () => fetchChainModuleAddress(options), + }), + /** + * Fetch the module name associated with the specified address. Returns null + * if not a module account. + */ + moduleName: (options: Parameters[0]) => + queryOptions({ + queryKey: ['chain', 'moduleName', options], + queryFn: () => fetchChainModuleName(options), + }), + /** + * Check whether or not the address is a chain module, optionally with a + * specific name. + */ + isAddressModule: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['chain', 'isAddressModule', options], + queryFn: () => isAddressModule(queryClient, options), + }), + /** + * Fetch the timestamp for a given block height. + */ + blockTimestamp: (options: Parameters[0]) => + queryOptions({ + queryKey: ['chain', 'blockTimestamp', options], + queryFn: () => fetchBlockTimestamp(options), + }), +} diff --git a/packages/state/query/queries/contract.ts b/packages/state/query/queries/contract.ts new file mode 100644 index 000000000..94d4f1dc3 --- /dev/null +++ b/packages/state/query/queries/contract.ts @@ -0,0 +1,234 @@ +import { fromUtf8, toUtf8 } from '@cosmjs/encoding' +import { QueryClient, queryOptions } from '@tanstack/react-query' + +import { InfoResponse } from '@dao-dao/types' +import { + ContractName, + DAO_CORE_CONTRACT_NAMES, + INVALID_CONTRACT_ERROR_SUBSTRINGS, + cosmWasmClientRouter, + getChainForChainId, + isValidBech32Address, +} from '@dao-dao/utils' + +import { chainQueries } from './chain' +import { indexerQueries } from './indexer' + +/** + * Fetch contract info stored in state, which contains its name and version. + */ +export const fetchContractInfo = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise => { + try { + return { + info: await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress: address, + formula: 'info', + }) + ), + } + } catch (error) { + // Rethrow contract not found errors. + if ( + error instanceof Error && + error.message.includes('contract not found') + ) { + throw error + } + + console.error(error) + } + + // If indexer fails, fallback to querying chain. + const client = await cosmWasmClientRouter.connect(chainId) + const { data: contractInfo } = await client[ + 'forceGetQueryClient' + ]().wasm.queryContractRaw(address, toUtf8('contract_info')) + if (contractInfo) { + const info: InfoResponse = { + info: JSON.parse(fromUtf8(contractInfo)), + } + return info + } + + throw new Error('Failed to query contract info for contract: ' + address) +} + +/** + * Check if a contract is a specific contract by name. + */ +export const fetchIsContract = async ( + queryClient: QueryClient, + { + chainId, + address, + nameOrNames, + }: { + chainId: string + address: string + nameOrNames: string | string[] + } +): Promise => { + if ( + !isValidBech32Address(address, getChainForChainId(chainId).bech32_prefix) + ) { + return false + } + + try { + const { + info: { contract }, + } = await queryClient.fetchQuery( + contractQueries.info(queryClient, { + chainId, + address, + }) + ) + + return Array.isArray(nameOrNames) + ? nameOrNames.some((name) => contract.includes(name)) + : contract.includes(nameOrNames) + } catch (err) { + if ( + err instanceof Error && + INVALID_CONTRACT_ERROR_SUBSTRINGS.some((substring) => + (err as Error).message.includes(substring) + ) + ) { + return false + } + + // Rethrow other errors because it should not have failed. + throw err + } +} + +/** + * Fetch contract instantiation time. + */ +export const fetchContractInstantiationTime = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise => { + try { + return new Date( + await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress: address, + formula: 'instantiatedAt', + // This never changes, and the fallback is unreliable, so attempt to + // query even if the indexer is behind. + noFallback: true, + }) + ) + ).getTime() + } catch (error) { + console.error(error) + } + + // If indexer fails, fallback to querying chain. + const client = await cosmWasmClientRouter.connect(chainId) + const events = await client.searchTx([ + { key: 'instantiate._contract_address', value: address }, + ]) + + if (events.length === 0) { + throw new Error( + 'Failed to find instantiation time due to no instantiation events for contract: ' + + address + ) + } + + return await queryClient.fetchQuery( + chainQueries.blockTimestamp({ + chainId, + height: events[0].height, + }) + ) +} + +export const contractQueries = { + /** + * Fetch contract info stored in state, which contains its name and version. + */ + info: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['contract', 'info', options], + queryFn: () => fetchContractInfo(queryClient, options), + }), + /** + * Check if a contract is a specific contract by name. + */ + isContract: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['contract', 'isContract', options], + queryFn: () => fetchIsContract(queryClient, options), + }), + /** + * Check if a contract is a DAO. + */ + isDao: ( + queryClient: QueryClient, + options: Omit[1], 'nameOrNames'> + ) => + contractQueries.isContract(queryClient, { + ...options, + nameOrNames: DAO_CORE_CONTRACT_NAMES, + }), + /** + * Check if a contract is a Polytone proxy. + */ + isPolytoneProxy: ( + queryClient: QueryClient, + options: Omit[1], 'nameOrNames'> + ) => + contractQueries.isContract(queryClient, { + ...options, + nameOrNames: ContractName.PolytoneProxy, + }), + /** + * Check if a contract is a cw1-whitelist. + */ + isCw1Whitelist: ( + queryClient: QueryClient, + options: Omit[1], 'nameOrNames'> + ) => + contractQueries.isContract(queryClient, { + ...options, + nameOrNames: ContractName.Cw1Whitelist, + }), + /** + * Fetch contract instantiation time. + */ + instantiationTime: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['contract', 'instantiationTime', options], + queryFn: () => fetchContractInstantiationTime(queryClient, options), + }), +} diff --git a/packages/state/query/queries/contracts/Cw1Whitelist.ts b/packages/state/query/queries/contracts/Cw1Whitelist.ts new file mode 100644 index 000000000..b73bbbf65 --- /dev/null +++ b/packages/state/query/queries/contracts/Cw1Whitelist.ts @@ -0,0 +1,132 @@ +import { QueryClient, UseQueryOptions } from '@tanstack/react-query' + +import { AdminListResponse } from '@dao-dao/types/contracts/Cw1Whitelist' +import { cosmWasmClientRouter } from '@dao-dao/utils' + +import { Cw1WhitelistQueryClient } from '../../../contracts/Cw1Whitelist' +import { contractQueries } from '../contract' +import { indexerQueries } from '../indexer' + +export const cw1WhitelistQueryKeys = { + contract: [ + { + contract: 'cw1Whitelist', + }, + ] as const, + address: (contractAddress: string) => + [ + { + ...cw1WhitelistQueryKeys.contract[0], + address: contractAddress, + }, + ] as const, + adminList: (contractAddress: string, args?: Record) => + [ + { + ...cw1WhitelistQueryKeys.address(contractAddress)[0], + method: 'admin_list', + ...(args && { args }), + }, + ] as const, + /** + * If this is a cw1-whitelist, return the admins. Otherwise, return null. + */ + adminsIfCw1Whitelist: ( + contractAddress: string, + args?: Record + ) => + [ + { + ...cw1WhitelistQueryKeys.address(contractAddress)[0], + method: 'adminsIfCw1Whitelist', + ...(args && { args }), + }, + ] as const, +} +export const cw1WhitelistQueries = { + adminList: ( + queryClient: QueryClient, + { chainId, contractAddress, options }: Cw1WhitelistAdminListQuery + ): UseQueryOptions => ({ + queryKey: cw1WhitelistQueryKeys.adminList(contractAddress), + queryFn: async () => { + let indexerNonExistent = false + try { + const adminList = await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'cw1Whitelist/adminList', + }) + ) + if (adminList) { + return adminList + } else { + indexerNonExistent = true + } + } catch (error) { + console.error(error) + } + + if (indexerNonExistent) { + throw new Error('Admin list not found') + } + + // If indexer query fails, fallback to contract query. + return new Cw1WhitelistQueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).adminList() + }, + ...options, + }), + /** + * If this is a cw1-whitelist, return the admins. Otherwise, return null. + */ + adminsIfCw1Whitelist: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + options, + }: Cw1WhitelistAdminsIfCw1WhitelistQuery + ): UseQueryOptions => ({ + queryKey: cw1WhitelistQueryKeys.adminsIfCw1Whitelist(contractAddress), + queryFn: async () => { + const isCw1Whitelist = await queryClient.fetchQuery( + contractQueries.isCw1Whitelist(queryClient, { + chainId, + address: contractAddress, + }) + ) + if (!isCw1Whitelist) { + return null + } + + return ( + await queryClient.fetchQuery( + cw1WhitelistQueries.adminList(queryClient, { + chainId, + contractAddress, + }) + ) + ).admins + }, + ...options, + }), +} +export interface Cw1WhitelistReactQuery { + chainId: string + contractAddress: string + options?: Omit< + UseQueryOptions, + 'queryKey' | 'queryFn' | 'initialData' + > & { + initialData?: undefined + } +} +export interface Cw1WhitelistAdminListQuery + extends Cw1WhitelistReactQuery {} + +export interface Cw1WhitelistAdminsIfCw1WhitelistQuery + extends Cw1WhitelistReactQuery {} diff --git a/packages/state/query/queries/contracts/DaoDaoCore.ts b/packages/state/query/queries/contracts/DaoDaoCore.ts new file mode 100644 index 000000000..2c7bc7c74 --- /dev/null +++ b/packages/state/query/queries/contracts/DaoDaoCore.ts @@ -0,0 +1,918 @@ +import { QueryClient, UseQueryOptions } from '@tanstack/react-query' + +import { Addr, IndexerDumpState } from '@dao-dao/types' +import { + AdminNominationResponse, + AdminResponse, + ConfigResponse, + Cw20BalancesResponse, + DaoURIResponse, + DumpStateResponse, + GetItemResponse, + InfoResponse, + ListAllSubDaosResponse, + ListItemsResponse, + ListSubDaosResponse, + PauseInfoResponse, + ProposalModulesResponse, + SubDao, + SubDaoWithChainId, + TotalPowerAtHeightResponse, + VotingPowerAtHeightResponse, +} from '@dao-dao/types/contracts/DaoCore.v2' +import { cosmWasmClientRouter } from '@dao-dao/utils' + +import { DaoCoreV2QueryClient } from '../../../contracts/DaoCore.v2' +import { contractQueries } from '../contract' +import { indexerQueries } from '../indexer' +import { polytoneQueries } from '../polytone' + +export const daoDaoCoreQueryKeys = { + contract: [ + { + contract: 'daoDaoCore', + }, + ] as const, + address: (contractAddress: string) => + [ + { + ...daoDaoCoreQueryKeys.contract[0], + address: contractAddress, + }, + ] as const, + admin: (contractAddress: string, args?: Record) => + [ + { + ...daoDaoCoreQueryKeys.address(contractAddress)[0], + method: 'admin', + ...(args && { args }), + }, + ] as const, + adminNomination: (contractAddress: string, args?: Record) => + [ + { + ...daoDaoCoreQueryKeys.address(contractAddress)[0], + method: 'admin_nomination', + ...(args && { args }), + }, + ] as const, + config: (contractAddress: string, args?: Record) => + [ + { + ...daoDaoCoreQueryKeys.address(contractAddress)[0], + method: 'config', + ...(args && { args }), + }, + ] as const, + cw20Balances: (contractAddress: string, args?: Record) => + [ + { + ...daoDaoCoreQueryKeys.address(contractAddress)[0], + method: 'cw20_balances', + ...(args && { args }), + }, + ] as const, + cw20TokenList: (contractAddress: string, args?: Record) => + [ + { + ...daoDaoCoreQueryKeys.address(contractAddress)[0], + method: 'cw20_token_list', + ...(args && { args }), + }, + ] as const, + cw721TokenList: (contractAddress: string, args?: Record) => + [ + { + ...daoDaoCoreQueryKeys.address(contractAddress)[0], + method: 'cw721_token_list', + ...(args && { args }), + }, + ] as const, + dumpState: (contractAddress: string, args?: Record) => + [ + { + ...daoDaoCoreQueryKeys.address(contractAddress)[0], + method: 'dump_state', + ...(args && { args }), + }, + ] as const, + getItem: (contractAddress: string, args?: Record) => + [ + { + ...daoDaoCoreQueryKeys.address(contractAddress)[0], + method: 'get_item', + ...(args && { args }), + }, + ] as const, + listItems: (contractAddress: string, args?: Record) => + [ + { + ...daoDaoCoreQueryKeys.address(contractAddress)[0], + method: 'list_items', + ...(args && { args }), + }, + ] as const, + listAllItems: (contractAddress: string, args?: Record) => + [ + { + ...daoDaoCoreQueryKeys.address(contractAddress)[0], + method: 'list_all_items', + ...(args && { args }), + }, + ] as const, + info: (contractAddress: string, args?: Record) => + [ + { + ...daoDaoCoreQueryKeys.address(contractAddress)[0], + method: 'info', + ...(args && { args }), + }, + ] as const, + proposalModules: (contractAddress: string, args?: Record) => + [ + { + ...daoDaoCoreQueryKeys.address(contractAddress)[0], + method: 'proposal_modules', + ...(args && { args }), + }, + ] as const, + activeProposalModules: ( + contractAddress: string, + args?: Record + ) => + [ + { + ...daoDaoCoreQueryKeys.address(contractAddress)[0], + method: 'active_proposal_modules', + ...(args && { args }), + }, + ] as const, + proposalModuleCount: ( + contractAddress: string, + args?: Record + ) => + [ + { + ...daoDaoCoreQueryKeys.address(contractAddress)[0], + method: 'proposal_module_count', + ...(args && { args }), + }, + ] as const, + pauseInfo: (contractAddress: string, args?: Record) => + [ + { + ...daoDaoCoreQueryKeys.address(contractAddress)[0], + method: 'pause_info', + ...(args && { args }), + }, + ] as const, + votingModule: (contractAddress: string, args?: Record) => + [ + { + ...daoDaoCoreQueryKeys.address(contractAddress)[0], + method: 'voting_module', + ...(args && { args }), + }, + ] as const, + listSubDaos: (contractAddress: string, args?: Record) => + [ + { + ...daoDaoCoreQueryKeys.address(contractAddress)[0], + method: 'list_sub_daos', + ...(args && { args }), + }, + ] as const, + listAllSubDaos: (contractAddress: string, args?: Record) => + [ + { + ...daoDaoCoreQueryKeys.address(contractAddress)[0], + method: 'list_all_sub_daos', + ...(args && { args }), + }, + ] as const, + daoURI: (contractAddress: string, args?: Record) => + [ + { + ...daoDaoCoreQueryKeys.address(contractAddress)[0], + method: 'dao_u_r_i', + ...(args && { args }), + }, + ] as const, + votingPowerAtHeight: ( + contractAddress: string, + args?: Record + ) => + [ + { + ...daoDaoCoreQueryKeys.address(contractAddress)[0], + method: 'voting_power_at_height', + ...(args && { args }), + }, + ] as const, + totalPowerAtHeight: ( + contractAddress: string, + args?: Record + ) => + [ + { + ...daoDaoCoreQueryKeys.address(contractAddress)[0], + method: 'total_power_at_height', + ...(args && { args }), + }, + ] as const, +} +export const daoDaoCoreQueries = { + admin: ( + queryClient: QueryClient, + { chainId, contractAddress, options }: DaoDaoCoreAdminQuery + ): UseQueryOptions => ({ + queryKey: daoDaoCoreQueryKeys.admin(contractAddress), + queryFn: async () => { + try { + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'daoCore/admin', + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new DaoCoreV2QueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).admin() + }, + ...options, + }), + adminNomination: ({ + chainId, + contractAddress, + options, + }: DaoDaoCoreAdminNominationQuery): UseQueryOptions< + AdminNominationResponse, + Error, + TData + > => ({ + queryKey: daoDaoCoreQueryKeys.adminNomination(contractAddress), + queryFn: async () => + new DaoCoreV2QueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).adminNomination(), + ...options, + }), + config: ( + queryClient: QueryClient, + { chainId, contractAddress, options }: DaoDaoCoreConfigQuery + ): UseQueryOptions => ({ + queryKey: daoDaoCoreQueryKeys.config(contractAddress), + queryFn: async () => { + try { + const config = await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'daoCore/config', + }) + ) + if (config) { + return config + } + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new DaoCoreV2QueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).config() + }, + ...options, + }), + cw20Balances: ({ + chainId, + contractAddress, + args, + options, + }: DaoDaoCoreCw20BalancesQuery): UseQueryOptions< + Cw20BalancesResponse, + Error, + TData + > => ({ + queryKey: daoDaoCoreQueryKeys.cw20Balances(contractAddress, args), + queryFn: async () => + new DaoCoreV2QueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).cw20Balances({ + limit: args.limit, + startAfter: args.startAfter, + }), + ...options, + }), + cw20TokenList: ({ + chainId, + contractAddress, + args, + options, + }: DaoDaoCoreCw20TokenListQuery): UseQueryOptions< + Addr[], + Error, + TData + > => ({ + queryKey: daoDaoCoreQueryKeys.cw20TokenList(contractAddress, args), + queryFn: async () => + new DaoCoreV2QueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).cw20TokenList({ + limit: args.limit, + startAfter: args.startAfter, + }), + ...options, + }), + cw721TokenList: ({ + chainId, + contractAddress, + args, + options, + }: DaoDaoCoreCw721TokenListQuery): UseQueryOptions< + Addr[], + Error, + TData + > => ({ + queryKey: daoDaoCoreQueryKeys.cw721TokenList(contractAddress, args), + queryFn: async () => + new DaoCoreV2QueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).cw721TokenList({ + limit: args.limit, + startAfter: args.startAfter, + }), + ...options, + }), + dumpState: ( + queryClient: QueryClient, + { chainId, contractAddress, options }: DaoDaoCoreDumpStateQuery + ): UseQueryOptions => ({ + queryKey: daoDaoCoreQueryKeys.dumpState(contractAddress), + queryFn: async () => { + try { + const indexerState = await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'daoCore/dumpState', + }) + ) + if (indexerState) { + return indexerState + } + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new DaoCoreV2QueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).dumpState() + }, + ...options, + }), + getItem: ({ + chainId, + contractAddress, + args, + options, + }: DaoDaoCoreGetItemQuery): UseQueryOptions< + GetItemResponse, + Error, + TData + > => ({ + queryKey: daoDaoCoreQueryKeys.getItem(contractAddress, args), + queryFn: async () => + new DaoCoreV2QueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).getItem({ + key: args.key, + }), + ...options, + }), + listItems: ({ + chainId, + contractAddress, + args, + options, + }: DaoDaoCoreListItemsQuery): UseQueryOptions< + ListItemsResponse, + Error, + TData + > => ({ + queryKey: daoDaoCoreQueryKeys.listItems(contractAddress, args), + queryFn: async () => + new DaoCoreV2QueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).listItems({ + limit: args.limit, + startAfter: args.startAfter, + }), + ...options, + }), + listAllItems: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + args, + options, + }: DaoDaoCoreListAllItemsQuery + ): UseQueryOptions => ({ + queryKey: daoDaoCoreQueryKeys.listAllItems(contractAddress, args), + queryFn: async () => { + let items: ListItemsResponse | undefined + + try { + const indexerItems = await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'daoCore/listItems', + }) + ) + if (indexerItems) { + items = indexerItems + } + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + if (!items) { + items = [] + const limit = 30 + while (true) { + const page = await queryClient.fetchQuery( + daoDaoCoreQueries.listItems({ + chainId, + contractAddress, + args: { + limit, + startAfter: items.length + ? items[items.length - 1]?.[0] + : undefined, + }, + }) + ) + if (!page.length) { + break + } + + items.push(...page) + + // If we have less than the limit of items, we've exhausted them. + if (page.length < limit) { + break + } + } + } + + // If we have a prefix, filter out items that don't start with it, and + // then remove the prefix from each key. + if (args?.prefix) { + items = items.flatMap(([key, value]) => + key.startsWith(args.prefix!) + ? [[key.substring(args.prefix!.length), value]] + : [] + ) + } + + return items + }, + ...options, + }), + info: ({ + chainId, + contractAddress, + options, + }: DaoDaoCoreInfoQuery): UseQueryOptions< + InfoResponse, + Error, + TData + > => ({ + queryKey: daoDaoCoreQueryKeys.info(contractAddress), + queryFn: async () => + new DaoCoreV2QueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).info(), + ...options, + }), + proposalModules: ({ + chainId, + contractAddress, + args, + options, + }: DaoDaoCoreProposalModulesQuery): UseQueryOptions< + ProposalModulesResponse, + Error, + TData + > => ({ + queryKey: daoDaoCoreQueryKeys.proposalModules(contractAddress, args), + queryFn: async () => + new DaoCoreV2QueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).proposalModules({ + limit: args.limit, + startAfter: args.startAfter, + }), + ...options, + }), + activeProposalModules: ({ + chainId, + contractAddress, + args, + options, + }: DaoDaoCoreActiveProposalModulesQuery): UseQueryOptions< + ProposalModulesResponse, + Error, + TData + > => ({ + queryKey: daoDaoCoreQueryKeys.activeProposalModules(contractAddress, args), + queryFn: async () => + new DaoCoreV2QueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).activeProposalModules({ + limit: args.limit, + startAfter: args.startAfter, + }), + ...options, + }), + pauseInfo: ({ + chainId, + contractAddress, + options, + }: DaoDaoCorePauseInfoQuery): UseQueryOptions< + PauseInfoResponse, + Error, + TData + > => ({ + queryKey: daoDaoCoreQueryKeys.pauseInfo(contractAddress), + queryFn: async () => + new DaoCoreV2QueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).pauseInfo(), + ...options, + }), + votingModule: ({ + chainId, + contractAddress, + options, + }: DaoDaoCoreVotingModuleQuery): UseQueryOptions< + Addr, + Error, + TData + > => ({ + queryKey: daoDaoCoreQueryKeys.votingModule(contractAddress), + queryFn: async () => + new DaoCoreV2QueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).votingModule(), + ...options, + }), + listSubDaos: ({ + chainId, + contractAddress, + args, + options, + }: DaoDaoCoreListSubDaosQuery): UseQueryOptions< + ListSubDaosResponse, + Error, + TData + > => ({ + queryKey: daoDaoCoreQueryKeys.listSubDaos(contractAddress, args), + queryFn: async () => + new DaoCoreV2QueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).listSubDaos({ + limit: args.limit, + startAfter: args.startAfter, + }), + ...options, + }), + listAllSubDaos: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + args, + options, + }: DaoDaoCoreListAllSubDaosQuery + ): UseQueryOptions => ({ + queryKey: daoDaoCoreQueryKeys.listAllSubDaos(contractAddress, args), + queryFn: async () => { + let subDaos: SubDao[] | undefined + + try { + const indexerSubDaos = await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'daoCore/listSubDaos', + }) + ) + if (indexerSubDaos) { + subDaos = indexerSubDaos + } + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + if (!subDaos) { + subDaos = [] + const limit = 30 + while (true) { + const page = await queryClient.fetchQuery( + daoDaoCoreQueries.listSubDaos({ + chainId, + contractAddress, + args: { + limit, + startAfter: subDaos.length + ? subDaos[subDaos.length - 1]?.addr + : undefined, + }, + }) + ) + if (!page.length) { + break + } + + subDaos.push(...page) + + // If we have less than the limit of subDaos, we've exhausted them. + if (page.length < limit) { + break + } + } + } + + const subDaosWithChainId = ( + await Promise.all( + subDaos.map(async (subDao): Promise => { + const [isDao, isPolytoneProxy] = await Promise.all([ + queryClient.fetchQuery( + contractQueries.isDao(queryClient, { + chainId, + address: subDao.addr, + }) + ), + queryClient.fetchQuery( + contractQueries.isPolytoneProxy(queryClient, { + chainId, + address: subDao.addr, + }) + ), + ]) + + if (isDao) { + // Filter SubDAO by admin if specified. + if (args?.onlyAdmin) { + const admin = await queryClient.fetchQuery( + daoDaoCoreQueries.admin(queryClient, { + chainId, + contractAddress: subDao.addr, + }) + ) + + if (admin !== contractAddress) { + return [] + } + } + + return { + ...subDao, + chainId, + } + } + + // Reverse lookup polytone proxy and verify it's a DAO, as long as + // not filtering by admin, since polytone proxies do not have admins + // and live on other chains. + if (isPolytoneProxy && !args?.onlyAdmin) { + try { + const { chainId: remoteChainId, remoteAddress } = + await queryClient.fetchQuery( + polytoneQueries.reverseLookupProxy(queryClient, { + chainId, + address: subDao.addr, + }) + ) + + return { + chainId: remoteChainId, + addr: remoteAddress, + charter: subDao.charter, + } + } catch (error) { + console.error(error) + } + } + + return [] + }) + ) + ).flat() + + return subDaosWithChainId + }, + ...options, + }), + daoURI: ({ + chainId, + contractAddress, + options, + }: DaoDaoCoreDaoURIQuery): UseQueryOptions< + DaoURIResponse, + Error, + TData + > => ({ + queryKey: daoDaoCoreQueryKeys.daoURI(contractAddress), + queryFn: async () => + new DaoCoreV2QueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).daoURI(), + ...options, + }), + votingPowerAtHeight: ({ + chainId, + contractAddress, + args, + options, + }: DaoDaoCoreVotingPowerAtHeightQuery): UseQueryOptions< + VotingPowerAtHeightResponse, + Error, + TData + > => ({ + queryKey: daoDaoCoreQueryKeys.votingPowerAtHeight(contractAddress, args), + queryFn: async () => + new DaoCoreV2QueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).votingPowerAtHeight({ + address: args.address, + height: args.height, + }), + ...options, + }), + totalPowerAtHeight: ({ + chainId, + contractAddress, + args, + options, + }: DaoDaoCoreTotalPowerAtHeightQuery): UseQueryOptions< + TotalPowerAtHeightResponse, + Error, + TData + > => ({ + queryKey: daoDaoCoreQueryKeys.totalPowerAtHeight(contractAddress, args), + queryFn: async () => + new DaoCoreV2QueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).totalPowerAtHeight({ + height: args.height, + }), + ...options, + }), +} + +export interface DaoDaoCoreReactQuery { + chainId: string + contractAddress: string + options?: Omit< + UseQueryOptions, + 'queryKey' | 'queryFn' | 'initialData' + > & { + initialData?: undefined + } +} +export interface DaoDaoCoreTotalPowerAtHeightQuery + extends DaoDaoCoreReactQuery { + args: { + height?: number + } +} +export interface DaoDaoCoreVotingPowerAtHeightQuery + extends DaoDaoCoreReactQuery { + args: { + address: string + height?: number + } +} +export interface DaoDaoCoreDaoURIQuery + extends DaoDaoCoreReactQuery {} +export interface DaoDaoCoreListSubDaosQuery + extends DaoDaoCoreReactQuery { + args: { + limit?: number + startAfter?: string + } +} +export interface DaoDaoCoreListAllSubDaosQuery + extends DaoDaoCoreReactQuery { + args?: { + /** + * Only include SubDAOs that this DAO is the admin of, meaning this DAO can + * execute on behalf of the SubDAO. Defaults to false. + */ + onlyAdmin?: boolean + } +} +export interface DaoDaoCoreVotingModuleQuery + extends DaoDaoCoreReactQuery {} +export interface DaoDaoCorePauseInfoQuery + extends DaoDaoCoreReactQuery {} +export interface DaoDaoCoreActiveProposalModulesQuery + extends DaoDaoCoreReactQuery { + args: { + limit?: number + startAfter?: string + } +} +export interface DaoDaoCoreProposalModulesQuery + extends DaoDaoCoreReactQuery { + args: { + limit?: number + startAfter?: string + } +} +export interface DaoDaoCoreInfoQuery + extends DaoDaoCoreReactQuery {} +export interface DaoDaoCoreListItemsQuery + extends DaoDaoCoreReactQuery { + args: { + limit?: number + startAfter?: string + } +} +export interface DaoDaoCoreListAllItemsQuery + extends DaoDaoCoreReactQuery { + args?: { + /** + * Optionally specify a prefix to filter results by and then remove from + * each returned key. + */ + prefix?: string + } +} +export interface DaoDaoCoreGetItemQuery + extends DaoDaoCoreReactQuery { + args: { + key: string + } +} +export interface DaoDaoCoreDumpStateQuery + extends DaoDaoCoreReactQuery {} +export interface DaoDaoCoreCw721TokenListQuery + extends DaoDaoCoreReactQuery { + args: { + limit?: number + startAfter?: string + } +} +export interface DaoDaoCoreCw20TokenListQuery + extends DaoDaoCoreReactQuery { + args: { + limit?: number + startAfter?: string + } +} +export interface DaoDaoCoreCw20BalancesQuery + extends DaoDaoCoreReactQuery { + args: { + limit?: number + startAfter?: string + } +} +export interface DaoDaoCoreConfigQuery + extends DaoDaoCoreReactQuery {} +export interface DaoDaoCoreAdminNominationQuery + extends DaoDaoCoreReactQuery {} +export interface DaoDaoCoreAdminQuery + extends DaoDaoCoreReactQuery {} diff --git a/packages/state/query/queries/contracts/PolytoneNote.ts b/packages/state/query/queries/contracts/PolytoneNote.ts new file mode 100644 index 000000000..198adfdf9 --- /dev/null +++ b/packages/state/query/queries/contracts/PolytoneNote.ts @@ -0,0 +1,84 @@ +import { QueryClient, UseQueryOptions } from '@tanstack/react-query' + +import { NullableString } from '@dao-dao/types/contracts/PolytoneNote' +import { cosmWasmClientRouter } from '@dao-dao/utils' + +import { PolytoneNoteQueryClient } from '../../../contracts/PolytoneNote' +import { indexerQueries } from '../indexer' + +export const polytoneNoteQueryKeys = { + contract: [ + { + contract: 'polytoneNote', + }, + ] as const, + address: (contractAddress: string) => + [ + { + ...polytoneNoteQueryKeys.contract[0], + address: contractAddress, + }, + ] as const, + remoteAddress: (contractAddress: string, args?: Record) => + [ + { + ...polytoneNoteQueryKeys.address(contractAddress)[0], + method: 'remote_address', + ...(args && { args }), + }, + ] as const, +} +export const polytoneNoteQueries = { + remoteAddress: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + args, + options, + }: PolytoneNoteRemoteAddressQuery + ): UseQueryOptions => ({ + queryKey: polytoneNoteQueryKeys.remoteAddress(contractAddress, args), + queryFn: async () => { + try { + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'polytone/note/remoteAddress', + args: { + address: args.localAddress, + }, + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new PolytoneNoteQueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).remoteAddress({ + localAddress: args.localAddress, + }) + }, + ...options, + }), +} +export interface PolytoneNoteReactQuery { + chainId: string + contractAddress: string + options?: Omit< + UseQueryOptions, + 'queryKey' | 'queryFn' | 'initialData' + > & { + initialData?: undefined + } +} +export interface PolytoneNoteRemoteAddressQuery + extends PolytoneNoteReactQuery { + args: { + localAddress: string + } +} diff --git a/packages/state/query/queries/contracts/PolytoneProxy.ts b/packages/state/query/queries/contracts/PolytoneProxy.ts new file mode 100644 index 000000000..82dd31b44 --- /dev/null +++ b/packages/state/query/queries/contracts/PolytoneProxy.ts @@ -0,0 +1,80 @@ +import { QueryClient, UseQueryOptions } from '@tanstack/react-query' + +import { Addr } from '@dao-dao/types' +import { cosmWasmClientRouter } from '@dao-dao/utils' + +import { PolytoneProxyQueryClient } from '../../../contracts/PolytoneProxy' +import { indexerQueries } from '../indexer' + +export const polytoneProxyQueryKeys = { + contract: [ + { + contract: 'polytoneProxy', + }, + ] as const, + address: (contractAddress: string) => + [ + { + ...polytoneProxyQueryKeys.contract[0], + address: contractAddress, + }, + ] as const, + instantiator: (contractAddress: string, args?: Record) => + [ + { + ...polytoneProxyQueryKeys.address(contractAddress)[0], + method: 'instantiator', + ...(args && { args }), + }, + ] as const, +} +export const polytoneProxyQueries = { + instantiator: ( + queryClient: QueryClient, + { chainId, contractAddress, options }: PolytoneProxyInstantiatorQuery + ): UseQueryOptions => ({ + queryKey: polytoneProxyQueryKeys.instantiator(contractAddress), + queryFn: async () => { + let indexerNonExistent = false + try { + const instantiator = await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'polytone/proxy/instantiator', + }) + ) + if (instantiator) { + return instantiator + } else { + indexerNonExistent = true + } + } catch (error) { + console.error(error) + } + + if (indexerNonExistent) { + throw new Error('Instantiator not found') + } + + // If indexer query fails, fallback to contract query. + return new PolytoneProxyQueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).instantiator() + }, + ...options, + }), +} +export interface PolytoneProxyReactQuery { + chainId: string + contractAddress: string + options?: Omit< + UseQueryOptions, + 'queryKey' | 'queryFn' | 'initialData' + > & { + initialData?: undefined + } +} +export interface PolytoneProxyInstantiatorQuery + extends PolytoneProxyReactQuery {} diff --git a/packages/state/query/queries/contracts/PolytoneVoice.ts b/packages/state/query/queries/contracts/PolytoneVoice.ts new file mode 100644 index 000000000..8a424f395 --- /dev/null +++ b/packages/state/query/queries/contracts/PolytoneVoice.ts @@ -0,0 +1,95 @@ +import { QueryClient, UseQueryOptions } from '@tanstack/react-query' + +import { SenderInfo } from '@dao-dao/types/contracts/PolytoneVoice' +import { cosmWasmClientRouter } from '@dao-dao/utils' + +import { PolytoneVoiceQueryClient } from '../../../contracts/PolytoneVoice' +import { indexerQueries } from '../indexer' + +export const polytoneVoiceQueryKeys = { + contract: [ + { + contract: 'polytoneVoice', + }, + ] as const, + address: (contractAddress: string) => + [ + { + ...polytoneVoiceQueryKeys.contract[0], + address: contractAddress, + }, + ] as const, + senderInfoForProxy: ( + contractAddress: string, + args?: Record + ) => + [ + { + ...polytoneVoiceQueryKeys.address(contractAddress)[0], + method: 'sender_info_for_proxy', + ...(args && { args }), + }, + ] as const, +} +export const polytoneVoiceQueries = { + senderInfoForProxy: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + args, + options, + }: PolytoneVoiceSenderInfoForProxyQuery + ): UseQueryOptions => ({ + queryKey: polytoneVoiceQueryKeys.senderInfoForProxy(contractAddress, args), + queryFn: async () => { + let indexerNonExistent = false + try { + const senderInfo = await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'polytone/voice/senderInfoForProxy', + args: { + address: args.proxy, + }, + }) + ) + if (senderInfo) { + return senderInfo + } else { + indexerNonExistent = true + } + } catch (error) { + console.error(error) + } + + if (indexerNonExistent) { + throw new Error('Sender info not found') + } + + // If indexer query fails, fallback to contract query. + return new PolytoneVoiceQueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).senderInfoForProxy(args) + }, + ...options, + }), +} +export interface PolytoneVoiceReactQuery { + chainId: string + contractAddress: string + options?: Omit< + UseQueryOptions, + 'queryKey' | 'queryFn' | 'initialData' + > & { + initialData?: undefined + } +} +export interface PolytoneVoiceSenderInfoForProxyQuery + extends PolytoneVoiceReactQuery { + args: { + proxy: string + } +} diff --git a/packages/state/query/queries/contracts/index.ts b/packages/state/query/queries/contracts/index.ts new file mode 100644 index 000000000..a451496e3 --- /dev/null +++ b/packages/state/query/queries/contracts/index.ts @@ -0,0 +1,6 @@ +export * from './Cw1Whitelist' +export * from './DaoDaoCore' +export * from './PolytoneNote' +export * from './PolytoneProxy' +export * from './PolytoneVoice' +export * from './votingModule' diff --git a/packages/state/query/queries/contracts/votingModule.ts b/packages/state/query/queries/contracts/votingModule.ts new file mode 100644 index 000000000..404d30f32 --- /dev/null +++ b/packages/state/query/queries/contracts/votingModule.ts @@ -0,0 +1,84 @@ +import { QueryClient, queryOptions } from '@tanstack/react-query' + +import { + ActiveThreshold, + ActiveThresholdResponse, +} from '@dao-dao/types/contracts/common' +import { cosmWasmClientRouter } from '@dao-dao/utils' + +import { indexerQueries } from '../indexer' + +/** + * Fetch whether or not the voting module is active. + */ +export const fetchVotingModuleIsActive = async ({ + chainId, + address, +}: { + chainId: string + address: string +}): Promise => + (await cosmWasmClientRouter.connect(chainId)).queryContractSmart(address, { + is_active: {}, + }) + +/** + * Fetch whether or not the voting module is active. + */ +export const fetchVotingModuleActiveThreshold = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise => { + try { + return { + active_threshold: await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress: address, + formula: 'daoVoting/activeThreshold', + }) + ), + } + } catch (error) { + console.error(error) + } + + // If indexer fails, fallback to querying chain. + return (await cosmWasmClientRouter.connect(chainId)).queryContractSmart( + address, + { + active_threshold: {}, + } + ) +} + +/** + * Common voting module queries. + */ +export const votingModuleQueries = { + /** + * Fetch whether or not the voting module is active. + */ + isActive: (options: Parameters[0]) => + queryOptions({ + queryKey: ['votingModule', 'isActive', options], + queryFn: () => fetchVotingModuleIsActive(options), + }), + /** + * Fetch the active threshold. + */ + activeThresold: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['votingModule', 'activeThresold', options], + queryFn: () => fetchVotingModuleActiveThreshold(queryClient, options), + }), +} diff --git a/packages/state/query/queries/dao.ts b/packages/state/query/queries/dao.ts new file mode 100644 index 000000000..9f1942ed0 --- /dev/null +++ b/packages/state/query/queries/dao.ts @@ -0,0 +1,63 @@ +import { QueryClient, queryOptions } from '@tanstack/react-query' + +import { AmountWithTimestamp, DaoSource } from '@dao-dao/types' +import { + COMMUNITY_POOL_ADDRESS_PLACEHOLDER, + getSupportedChainConfig, + isConfiguredChainName, +} from '@dao-dao/utils' + +import { indexerQueries } from './indexer' + +/** + * Fetch a DAO's TVL. + */ +export const fetchDaoTvl = async ( + queryClient: QueryClient, + { chainId, coreAddress }: DaoSource +): Promise => { + // Native chain x/gov module. + if (isConfiguredChainName(chainId, coreAddress)) { + coreAddress = + // Use real gov DAO's address if exists. + getSupportedChainConfig(chainId)?.govContractAddress || + COMMUNITY_POOL_ADDRESS_PLACEHOLDER + } + + const timestamp = new Date() + + const { total: amount } = (await queryClient.fetchQuery( + indexerQueries.snapper<{ total: number }>({ + query: 'daodao-tvl', + parameters: { + chainId, + address: coreAddress, + }, + }) + )) || { + total: NaN, + } + + return { + amount, + timestamp, + } +} + +export const daoQueries = { + /** + * Fetch featured DAOs. + */ + listFeatured: () => + indexerQueries.snapper({ + query: 'daodao-featured-daos', + }), + /** + * Fetch a DAO's TVL. + */ + tvl: (queryClient: QueryClient, options: Parameters[1]) => + queryOptions({ + queryKey: ['dao', 'tvl', options], + queryFn: () => fetchDaoTvl(queryClient, options), + }), +} diff --git a/packages/state/query/queries/index.ts b/packages/state/query/queries/index.ts new file mode 100644 index 000000000..cee7cc5a6 --- /dev/null +++ b/packages/state/query/queries/index.ts @@ -0,0 +1,9 @@ +export * from './contracts' + +export * from './account' +export * from './chain' +export * from './contract' +export * from './dao' +export * from './indexer' +export * from './polytone' +export * from './profile' diff --git a/packages/state/query/queries/indexer.ts b/packages/state/query/queries/indexer.ts new file mode 100644 index 000000000..e84a3fa0c --- /dev/null +++ b/packages/state/query/queries/indexer.ts @@ -0,0 +1,148 @@ +import { QueryClient, queryOptions } from '@tanstack/react-query' + +import { IndexerFormulaType } from '@dao-dao/types' + +import { + QueryIndexerOptions, + QuerySnapperOptions, + queryIndexer, + queryIndexerUpStatus, + querySnapper, +} from '../../indexer' + +/** + * Check whether or not the indexer is caught up. + */ +export const isIndexerCaughtUp = async ({ + chainId, +}: { + chainId: string +}): Promise => (await queryIndexerUpStatus({ chainId })).caughtUp + +export type FetchIndexerQueryOptions = QueryIndexerOptions & { + /** + * If there is no fallback query available, this will still query even if + * indexer is behind. Defaults to false. + */ + noFallback?: boolean +} + +/** + * Fetch indexer query, unless the indexer is behind and there is a fallback, in + * which case it errors. + */ +export const fetchIndexerQuery = async ( + queryClient: QueryClient, + { noFallback, ...options }: FetchIndexerQueryOptions +): Promise => { + // If the indexer is behind and either there's a fallback or we're on the + // server, return null to make the caller use the fallback. Throw error if no + // fallback and on client. + if (!noFallback) { + const isCaughtUp = await queryClient.fetchQuery( + indexerQueries.isCaughtUp({ chainId: options.chainId }) + ) + + if (!isCaughtUp && typeof window !== 'undefined') { + throw new Error('Indexer is behind and no fallback is available') + } + } + + // Replace undefined responses with null since react-query and static props + // can't serialize undefined. + return (await queryIndexer(options)) ?? null +} + +export const indexerQueries = { + /** + * Check whether or not the indexer is caught up. + */ + isCaughtUp: (options: Parameters[0]) => + queryOptions({ + queryKey: ['indexer', 'isCaughtUp', options], + queryFn: () => isIndexerCaughtUp(options), + }), + /** + * Fetch indexer query, unless the indexer is behind and there is a fallback. + */ + query: ( + queryClient: QueryClient, + options: FetchIndexerQueryOptions + ) => + queryOptions({ + queryKey: ['indexer', 'query', options], + queryFn: () => fetchIndexerQuery(queryClient, options), + }), + /** + * Fetch indexer query, unless the indexer is behind and there is a fallback. + */ + queryContract: ( + queryClient: QueryClient, + { + contractAddress: address, + ...options + }: Omit & { + contractAddress: string + } + ) => + indexerQueries.query(queryClient, { + ...options, + type: IndexerFormulaType.Contract, + address, + }), + /** + * Fetch indexer query, unless the indexer is behind and there is a fallback. + */ + queryGeneric: ( + queryClient: QueryClient, + options: Omit + ) => + indexerQueries.query(queryClient, { + ...options, + type: IndexerFormulaType.Generic, + }), + /** + * Fetch indexer query, unless the indexer is behind and there is a fallback. + */ + queryValidator: ( + queryClient: QueryClient, + { + validatorOperatorAddress: address, + ...options + }: Omit & { + validatorOperatorAddress: string + } + ) => + indexerQueries.query(queryClient, { + ...options, + type: IndexerFormulaType.Validator, + address, + }), + /** + * Fetch indexer query, unless the indexer is behind and there is a fallback. + */ + queryWallet: ( + queryClient: QueryClient, + { + walletAddress: address, + ...options + }: Omit & { + walletAddress: string + } + ) => + indexerQueries.query(queryClient, { + ...options, + type: IndexerFormulaType.Wallet, + address, + }), + /** + * Fetch query from Snapper. + */ + snapper: (options: QuerySnapperOptions) => + queryOptions({ + queryKey: ['indexer', 'snapper', options], + // Replace undefined responses with null since react-query and static + // props can't serialize undefined. + queryFn: async () => (await querySnapper(options)) ?? null, + }), +} diff --git a/packages/state/query/queries/polytone.ts b/packages/state/query/queries/polytone.ts new file mode 100644 index 000000000..2da750b3f --- /dev/null +++ b/packages/state/query/queries/polytone.ts @@ -0,0 +1,157 @@ +import { QueryClient, queryOptions } from '@tanstack/react-query' + +import { PolytoneProxies } from '@dao-dao/types' +import { + POLYTONE_CONFIG_PER_CHAIN, + getSupportedChainConfig, + polytoneNoteProxyMapToChainIdMap, +} from '@dao-dao/utils' + +import { polytoneProxyQueries, polytoneVoiceQueries } from './contracts' +import { polytoneNoteQueries } from './contracts/PolytoneNote' +import { indexerQueries } from './indexer' + +/** + * Fetch polytone proxies for an account. + */ +export const fetchPolytoneProxies = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise => { + // Map from polytone note contract to remote proxy address. + try { + return polytoneNoteProxyMapToChainIdMap( + chainId, + await queryClient.fetchQuery( + indexerQueries.queryWallet(queryClient, { + chainId, + walletAddress: address, + formula: 'polytone/proxies', + }) + ) + ) + } catch (error) { + console.error(error) + } + + // Fallback to contract query if indexer fails. + + // Get polytone notes on this chain. + const polytoneConnections = Object.entries( + getSupportedChainConfig(chainId)?.polytone || {} + ) + + // Fetch remote address for this address on all potential polytone + // connections, filtering out the nonexistent ones, and turn back into map of + // chain to proxy. + const proxies: PolytoneProxies = Object.fromEntries( + ( + await Promise.all( + polytoneConnections.map(async ([proxyChainId, { note }]) => { + const proxy = await queryClient.fetchQuery( + polytoneNoteQueries.remoteAddress(queryClient, { + chainId, + contractAddress: note, + args: { + localAddress: address, + }, + }) + ) + + // Null respones get filtered out. + return proxy ? ([proxyChainId, proxy] as const) : undefined + }) + ) + ).filter(Boolean) as [string, string][] + ) + + return proxies +} + +/** + * Given a polytone proxy, fetch the source chain, remote address, and polytone + * note. + */ +export const reverseLookupPolytoneProxy = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise<{ + chainId: string + remoteAddress: string + note: string +}> => { + const voice = await queryClient.fetchQuery( + polytoneProxyQueries.instantiator(queryClient, { + chainId, + contractAddress: address, + }) + ) + + // Get sender info for this voice. + const senderInfo = await queryClient.fetchQuery( + polytoneVoiceQueries.senderInfoForProxy(queryClient, { + chainId, + contractAddress: voice, + args: { + proxy: address, + }, + }) + ) + + // Get source polytone connection where the note lives for this voice. + const srcPolytoneInfo = POLYTONE_CONFIG_PER_CHAIN.find(([, config]) => + Object.entries(config).some( + ([destChainId, connection]) => + destChainId === chainId && + connection.voice === voice && + connection.remoteConnection === senderInfo.connection_id + ) + ) + if (!srcPolytoneInfo) { + throw new Error('Could not find source polytone connection') + } + + return { + chainId: srcPolytoneInfo[0], + remoteAddress: senderInfo.remote_sender, + note: srcPolytoneInfo[1][chainId].note, + } +} + +export const polytoneQueries = { + /** + * Fetch polytone proxies for an account. + */ + proxies: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['polytone', 'proxies', options], + queryFn: () => fetchPolytoneProxies(queryClient, options), + }), + /** + * Given a polytone proxy, fetch the source chain, remote address, and + * polytone note. + */ + reverseLookupProxy: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['polytone', 'reverseLookupProxy', options], + queryFn: () => reverseLookupPolytoneProxy(queryClient, options), + }), +} diff --git a/packages/state/query/queries/profile.ts b/packages/state/query/queries/profile.ts new file mode 100644 index 000000000..9c8e5be68 --- /dev/null +++ b/packages/state/query/queries/profile.ts @@ -0,0 +1,338 @@ +import { + QueryClient, + UseQueryOptions, + queryOptions, + skipToken, +} from '@tanstack/react-query' + +import { + ChainId, + PfpkProfile, + ResolvedProfile, + UnifiedProfile, +} from '@dao-dao/types' +import { + MAINNET, + PFPK_API_BASE, + STARGAZE_NAMES_CONTRACT, + cosmWasmClientRouter, + getChainForChainId, + imageUrlFromStargazeIndexerNft, + makeEmptyPfpkProfile, + makeEmptyUnifiedProfile, + processError, + toBech32Hash, + transformBech32Address, +} from '@dao-dao/utils' + +import { stargazeIndexerClient, stargazeTokenQuery } from '../../graphql' + +/** + * Fetch unified profile information for any wallet. + */ +export const fetchProfileInfo = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise => { + const profile = makeEmptyUnifiedProfile(chainId, address) + if (!address) { + return profile + } + + const pfpkProfile = await queryClient.fetchQuery( + profileQueries.pfpk({ + address, + }) + ) + // Copy PFPK profile info into unified profile. + profile.uuid = pfpkProfile.uuid + profile.nonce = pfpkProfile.nonce + profile.name = pfpkProfile.name + profile.nft = pfpkProfile.nft + profile.chains = pfpkProfile.chains + + // Use profile address for Stargaze if set, falling back to transforming the + // address (which is unreliable due to different chains using different HD + // paths). + const stargazeAddress = + profile.chains[ChainId.StargazeMainnet]?.address || + transformBech32Address(address, ChainId.StargazeMainnet) + + // Load Stargaze name as backup if no PFPK name set. + if (!profile.name) { + const stargazeName = await queryClient + .fetchQuery( + profileQueries.stargazeName({ + address: stargazeAddress, + }) + ) + .catch(() => null) + if (stargazeName) { + profile.name = + stargazeName + '.' + getChainForChainId(chainId).bech32_prefix + profile.nameSource = 'stargaze' + } + } + + // Set `imageUrl` to PFPK image, defaulting to fallback image. + profile.imageUrl = pfpkProfile?.nft?.imageUrl || profile.backupImageUrl + + // Load Stargaze name image if no PFPK image. + if (!pfpkProfile?.nft?.imageUrl) { + const stargazeNameImage = await queryClient + .fetchQuery( + profileQueries.stargazeNameImage(queryClient, { + address: stargazeAddress, + }) + ) + .catch(() => null) + if (stargazeNameImage) { + profile.imageUrl = stargazeNameImage + } + } + + return profile +} + +/** + * Fetch PFPK profile information for any wallet. + */ +export const fetchPfpkProfileInfo = async ({ + bech32Hash, +}: { + bech32Hash: string +}): Promise => { + if (!bech32Hash) { + return makeEmptyPfpkProfile() + } + + try { + const response = await fetch(PFPK_API_BASE + `/bech32/${bech32Hash}`) + if (response.ok) { + return await response.json() + } else { + console.error(await response.json().catch(() => response.statusText)) + } + } catch (err) { + console.error(err) + } + + return makeEmptyPfpkProfile() +} + +/** + * Fetch Stargaze name for a wallet adderss. + */ +export const fetchStargazeName = async ({ + address, +}: { + address: string +}): Promise => { + if (!address) { + return null + } + + const client = await cosmWasmClientRouter.connect( + MAINNET ? ChainId.StargazeMainnet : ChainId.StargazeTestnet + ) + + try { + return await client.queryContractSmart(STARGAZE_NAMES_CONTRACT, { + name: { address }, + }) + } catch {} + + return null +} + +/** + * Fetch Stargaze name's image associated an address. + */ +export const fetchStargazeNameImage = async ( + queryClient: QueryClient, + { + address, + }: { + address: string + } +): Promise => { + const name = await queryClient.fetchQuery( + profileQueries.stargazeName({ address }) + ) + if (!name) { + return null + } + + const chainId = MAINNET ? ChainId.StargazeMainnet : ChainId.StargazeTestnet + const client = await cosmWasmClientRouter.connect(chainId) + + // Get NFT associated with name. + let response + try { + response = await client.queryContractSmart(STARGAZE_NAMES_CONTRACT, { + image_n_f_t: { name }, + }) + } catch { + return null + } + + if (!response) { + return null + } + + // If NFT exists, get image associated with NFT. + try { + const { data } = await stargazeIndexerClient.query({ + query: stargazeTokenQuery, + variables: { + collectionAddr: response.collection, + tokenId: response.token_id, + }, + }) + if (data?.token) { + return imageUrlFromStargazeIndexerNft(data.token) || null + } + } catch (err) { + console.error(err) + } + + return null +} + +/** + * Search for profiles by name prefix. + */ +export const searchProfilesByNamePrefix = async ({ + chainId, + namePrefix, +}: { + chainId: string + namePrefix: string +}): Promise => { + if (namePrefix.length < 3) { + return [] + } + + // Load profiles from PFPK API. + let profiles: ResolvedProfile[] = [] + try { + const response = await fetch( + PFPK_API_BASE + `/search/${chainId}/${namePrefix}` + ) + if (response.ok) { + const { profiles: _profiles } = (await response.json()) as { + profiles: ResolvedProfile[] + } + profiles = _profiles + } else { + console.error(await response.json()) + } + } catch (err) { + console.error(processError(err)) + } + + return profiles +} + +export const profileQueries = { + /** + * Fetch unified profile. + */ + unified: ( + queryClient: QueryClient, + // If undefined, query will be disabled. + options?: Parameters[1] + ) => + queryOptions({ + queryKey: [ + { + category: 'profile', + name: 'unified', + options: options && { + ...options, + // Add this to match pfpk query key so we can invalidate and thus + // refetch both at once. + bech32Hash: toBech32Hash(options.address), + }, + }, + ], + queryFn: options + ? () => fetchProfileInfo(queryClient, options) + : skipToken, + }), + /** + * Fetch PFPK profile. + */ + pfpk: ( + /** + * Redirects address queries to bech32 hash queries. + * + * If undefined, query will be disabled. + */ + options?: { address: string } | { bech32Hash: string } + ): UseQueryOptions< + PfpkProfile, + Error, + PfpkProfile, + [ + { + category: 'profile' + name: 'pfpk' + options: { bech32Hash: string } | undefined + } + ] + > => + // Redirect address queries to bech32 hash queries. + options && 'address' in options + ? profileQueries.pfpk({ + bech32Hash: toBech32Hash(options.address), + }) + : queryOptions({ + queryKey: [ + { + category: 'profile', + name: 'pfpk', + options, + }, + ], + queryFn: options ? () => fetchPfpkProfileInfo(options) : skipToken, + }), + /** + * Fetch Stargaze name for a wallet adderss. + */ + stargazeName: (options: Parameters[0]) => + queryOptions({ + queryKey: ['profile', 'stargazeName', options], + queryFn: () => fetchStargazeName(options), + }), + /** + * Fetch Stargaze name's image associated an address. + */ + stargazeNameImage: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['profile', 'stargazeNameImage', options], + queryFn: () => fetchStargazeNameImage(queryClient, options), + }), + /** + * Search for profiles by name prefix. + */ + searchByNamePrefix: ( + /** + * If undefined, query will be disabled. + */ + options?: Parameters[0] + ) => + queryOptions({ + queryKey: ['profile', 'searchByNamePrefix', options], + queryFn: options ? () => searchProfilesByNamePrefix(options) : skipToken, + }), +} diff --git a/packages/state/recoil/atoms/misc.ts b/packages/state/recoil/atoms/misc.ts index dceb2dbc2..e7d9d8571 100644 --- a/packages/state/recoil/atoms/misc.ts +++ b/packages/state/recoil/atoms/misc.ts @@ -1,3 +1,4 @@ +import { QueryClient } from '@tanstack/react-query' import { atom } from 'recoil' import { PageHeaderProps, Web3AuthPrompt } from '@dao-dao/types' @@ -62,3 +63,9 @@ export const pageHeaderPropsAtom = atom({ key: 'pageHeaderProps', default: {}, }) + +// Store query client in Recoil atom so it's accessible from Recoil selectors +// while we migrate from Recoil to React Query. +export const queryClientAtom = atom({ + key: 'queryClient', +}) diff --git a/packages/state/recoil/atoms/refresh.ts b/packages/state/recoil/atoms/refresh.ts index 82aae626b..37e9493f9 100644 --- a/packages/state/recoil/atoms/refresh.ts +++ b/packages/state/recoil/atoms/refresh.ts @@ -50,13 +50,6 @@ export const refreshWalletStargazeNftsAtom = atomFamily({ default: 0, }) -// Change this to refresh the profile for a wallet. The argument is the address' -// bech32 data hash. -export const refreshWalletProfileAtom = atomFamily({ - key: 'refreshWalletProfile', - default: 0, -}) - // Change this to refresh native token staking info for the given address. export const refreshNativeTokenStakingInfoAtom = atomFamily< number, diff --git a/packages/state/recoil/selectors/chain.ts b/packages/state/recoil/selectors/chain.ts index 8bc5ae70f..c249e1e4b 100644 --- a/packages/state/recoil/selectors/chain.ts +++ b/packages/state/recoil/selectors/chain.ts @@ -31,15 +31,6 @@ import { ValidatorSlash, WithChainId, } from '@dao-dao/types' -import { - cosmos, - cosmwasm, - ibc, - juno, - neutron, - noble, - osmosis, -} from '@dao-dao/types/protobuf' import { ModuleAccount } from '@dao-dao/types/protobuf/codegen/cosmos/auth/v1beta1/auth' import { Metadata } from '@dao-dao/types/protobuf/codegen/cosmos/bank/v1beta1/bank' import { DecCoin } from '@dao-dao/types/protobuf/codegen/cosmos/base/v1beta1/coin' @@ -58,16 +49,20 @@ import { Fee as NeutronFee } from '@dao-dao/types/protobuf/codegen/neutron/feere import { Params as NobleTariffParams } from '@dao-dao/types/protobuf/codegen/tariff/params' import { MAINNET, - addressIsModule, cosmWasmClientRouter, + cosmosProtoRpcClientRouter, cosmosSdkVersionIs46OrHigher, cosmosSdkVersionIs47OrHigher, cosmosValidatorToValidator, + cosmwasmProtoRpcClientRouter, decodeGovProposal, getAllRpcResponse, getNativeTokenForChainId, - getRpcForChainId, - retry, + ibcProtoRpcClientRouter, + junoProtoRpcClientRouter, + neutronProtoRpcClientRouter, + nobleProtoRpcClientRouter, + osmosisProtoRpcClientRouter, stargateClientRouter, } from '@dao-dao/utils' @@ -93,14 +88,7 @@ export const stargateClientForChainSelector = selectorFamily< string >({ key: 'stargateClientForChain', - get: (chainId) => async () => - retry( - 10, - async (attempt) => - await stargateClientRouter.connect( - getRpcForChainId(chainId, attempt - 1) - ) - ), + get: (chainId) => async () => await stargateClientRouter.connect(chainId), dangerouslyAllowMutability: true, }) @@ -109,106 +97,50 @@ export const cosmWasmClientForChainSelector = selectorFamily< string >({ key: 'cosmWasmClientForChain', - get: (chainId) => async () => - retry( - 10, - async (attempt) => - await cosmWasmClientRouter.connect( - getRpcForChainId(chainId, attempt - 1) - ) - ), + get: (chainId) => async () => await cosmWasmClientRouter.connect(chainId), dangerouslyAllowMutability: true, }) export const cosmosRpcClientForChainSelector = selectorFamily({ key: 'cosmosRpcClientForChain', get: (chainId: string) => async () => - retry( - 10, - async (attempt) => - ( - await cosmos.ClientFactory.createRPCQueryClient({ - rpcEndpoint: getRpcForChainId(chainId, attempt - 1), - }) - ).cosmos - ), + await cosmosProtoRpcClientRouter.connect(chainId), dangerouslyAllowMutability: true, }) export const ibcRpcClientForChainSelector = selectorFamily({ key: 'ibcRpcClientForChain', get: (chainId: string) => async () => - retry( - 10, - async (attempt) => - ( - await ibc.ClientFactory.createRPCQueryClient({ - rpcEndpoint: getRpcForChainId(chainId, attempt - 1), - }) - ).ibc - ), + await ibcProtoRpcClientRouter.connect(chainId), dangerouslyAllowMutability: true, }) export const cosmwasmRpcClientForChainSelector = selectorFamily({ key: 'cosmwasmRpcClientForChain', get: (chainId: string) => async () => - retry( - 10, - async (attempt) => - ( - await cosmwasm.ClientFactory.createRPCQueryClient({ - rpcEndpoint: getRpcForChainId(chainId, attempt - 1), - }) - ).cosmwasm - ), + await cosmwasmProtoRpcClientRouter.connect(chainId), dangerouslyAllowMutability: true, }) export const osmosisRpcClientForChainSelector = selectorFamily({ key: 'osmosisRpcClientForChain', get: (chainId: string) => async () => - retry( - 10, - async (attempt) => - ( - await osmosis.ClientFactory.createRPCQueryClient({ - rpcEndpoint: getRpcForChainId(chainId, attempt - 1), - }) - ).osmosis - ), + await osmosisProtoRpcClientRouter.connect(chainId), dangerouslyAllowMutability: true, }) export const nobleRpcClientSelector = selector({ key: 'nobleRpcClient', get: async () => - retry( - 10, - async (attempt) => - ( - await noble.ClientFactory.createRPCQueryClient({ - rpcEndpoint: getRpcForChainId(ChainId.NobleMainnet, attempt - 1), - }) - ).noble - ), + await nobleProtoRpcClientRouter.connect(ChainId.NobleMainnet), dangerouslyAllowMutability: true, }) export const neutronRpcClientSelector = selector({ key: 'neutronRpcClient', get: async () => - retry( - 10, - async (attempt) => - ( - await neutron.ClientFactory.createRPCQueryClient({ - rpcEndpoint: getRpcForChainId( - MAINNET ? ChainId.NeutronMainnet : ChainId.NeutronTestnet, - attempt - 1 - ), - }) - ).neutron + await neutronProtoRpcClientRouter.connect( + MAINNET ? ChainId.NeutronMainnet : ChainId.NeutronTestnet ), dangerouslyAllowMutability: true, }) @@ -216,14 +148,8 @@ export const neutronRpcClientSelector = selector({ export const junoRpcClientSelector = selector({ key: 'junoRpcClient', get: async () => - retry( - 10, - async (attempt) => - ( - await juno.ClientFactory.createRPCQueryClient({ - rpcEndpoint: getRpcForChainId(ChainId.JunoMainnet, attempt - 1), - }) - ).juno + await junoProtoRpcClientRouter.connect( + MAINNET ? ChainId.JunoMainnet : ChainId.JunoTestnet ), dangerouslyAllowMutability: true, }) @@ -1311,24 +1237,6 @@ export const moduleNameForAddressSelector = selectorFamily< }, }) -// Check whether or not the address is a module account. -export const addressIsModuleSelector = selectorFamily< - boolean, - WithChainId<{ - address: string - // If passed, check if it is this specific module. - moduleName?: string - }> ->({ - key: 'addressIsModule', - get: - ({ chainId, address, moduleName }) => - async ({ get }) => { - const client = get(cosmosRpcClientForChainSelector(chainId)) - return await addressIsModule(client, address, moduleName) - }, -}) - // Get bonded and unbonded tokens. Bonded tokens represent all possible // governance voting power. export const chainStakingPoolSelector = selectorFamily>({ diff --git a/packages/state/recoil/selectors/contracts/DaoCore.v2.ts b/packages/state/recoil/selectors/contracts/DaoCore.v2.ts index 80df9abfe..a730a7f46 100644 --- a/packages/state/recoil/selectors/contracts/DaoCore.v2.ts +++ b/packages/state/recoil/selectors/contracts/DaoCore.v2.ts @@ -1418,11 +1418,12 @@ export const polytoneProxiesSelector = selectorFamily< ) } + // Fallback to contract query if indexer fails. + // Get polytone notes on this chain. const polytoneConnections = getSupportedChainConfig(queryClientParams.chainId)?.polytone || {} - // Fallback to contract query if indexer fails. return Object.entries(polytoneConnections) .map(([chainId, { note }]) => ({ chainId, diff --git a/packages/state/recoil/selectors/dao.ts b/packages/state/recoil/selectors/dao.ts index 9184949d7..f58424162 100644 --- a/packages/state/recoil/selectors/dao.ts +++ b/packages/state/recoil/selectors/dao.ts @@ -4,19 +4,15 @@ import { ContractVersion, ContractVersionInfo, DaoDropdownInfo, - DaoParentInfo, Feature, LazyDaoCardProps, WithChainId, } from '@dao-dao/types' -import { ConfigResponse as CwCoreV1ConfigResponse } from '@dao-dao/types/contracts/CwCore.v1' -import { ConfigResponse as DaoCoreV2ConfigResponse } from '@dao-dao/types/contracts/DaoCore.v2' import { DAO_CORE_CONTRACT_NAMES, INACTIVE_DAO_NAMES, VETOABLE_DAOS_ITEM_KEY_PREFIX, getChainGovernanceDaoDescription, - getConfiguredChainConfig, getDisplayNameForChainId, getFallbackImage, getImageUrlForChainId, @@ -26,12 +22,7 @@ import { parseContractVersion, } from '@dao-dao/utils' -import { addressIsModuleSelector } from './chain' -import { - contractInfoSelector, - contractVersionSelector, - isDaoSelector, -} from './contract' +import { contractInfoSelector, contractVersionSelector } from './contract' import { DaoCoreV2Selectors } from './contracts' import { queryContractIndexerSelector } from './indexer' @@ -223,118 +214,6 @@ export const daoVetoableDaosSelector = selectorFamily< }), }) -/** - * Attempt to fetch the info needed to describe a parent DAO. Returns undefined - * if not a DAO nor the chain gov module account. - */ -export const daoParentInfoSelector = selectorFamily< - DaoParentInfo | undefined, - WithChainId<{ - parentAddress: string - /** - * To determine if the parent has registered the child, pass the child. This - * will set `registeredSubDao` appropriately. Otherwise, if undefined, - * `registeredSubDao` will be set to false. - */ - childAddress?: string - }> ->({ - key: 'daoParentInfo', - get: - ({ chainId, parentAddress, childAddress }) => - ({ get }) => { - // If address is a DAO contract... - if ( - get( - isDaoSelector({ - chainId, - address: parentAddress, - }) - ) - ) { - const parentAdmin = get( - DaoCoreV2Selectors.adminSelector({ - chainId, - contractAddress: parentAddress, - params: [], - }) - ) - const { - info: { version }, - } = get( - contractInfoSelector({ - chainId, - contractAddress: parentAddress, - }) - ) - const parentVersion = parseContractVersion(version) - - if (parentVersion) { - const { - name, - image_url, - }: CwCoreV1ConfigResponse | DaoCoreV2ConfigResponse = get( - // Both v1 and v2 have a config query. - DaoCoreV2Selectors.configSelector({ - chainId, - contractAddress: parentAddress, - params: [], - }) - ) - - // Check if parent has registered the child DAO as a SubDAO. - const registeredSubDao = - childAddress && - isFeatureSupportedByVersion(Feature.SubDaos, parentVersion) - ? get( - DaoCoreV2Selectors.listAllSubDaosSelector({ - contractAddress: parentAddress, - chainId, - }) - ).some(({ addr }) => addr === childAddress) - : false - - return { - chainId, - coreAddress: parentAddress, - coreVersion: parentVersion, - name, - imageUrl: image_url || getFallbackImage(parentAddress), - admin: parentAdmin ?? '', - registeredSubDao, - } - } - - // If address is the chain's x/gov module account... - } else if ( - get( - addressIsModuleSelector({ - chainId, - address: parentAddress, - moduleName: 'gov', - }) - ) - ) { - const chainConfig = getConfiguredChainConfig(chainId) - return ( - chainConfig && { - chainId, - coreAddress: chainConfig.name, - coreVersion: ContractVersion.Gov, - name: getDisplayNameForChainId(chainId), - imageUrl: getImageUrlForChainId(chainId), - admin: '', - registeredSubDao: - !!childAddress && - !!getSupportedChainConfig(chainId)?.subDaos?.includes( - childAddress - ), - } - ) - } - }, -}) - /** * Retrieve all potential SubDAOs of the DAO from the indexer. */ diff --git a/packages/state/recoil/selectors/index.ts b/packages/state/recoil/selectors/index.ts index a7820615c..55c52c7d5 100644 --- a/packages/state/recoil/selectors/index.ts +++ b/packages/state/recoil/selectors/index.ts @@ -13,7 +13,6 @@ export * from './indexer' export * from './misc' export * from './nft' export * from './osmosis' -export * from './profile' export * from './proposal' export * from './skip' export * from './token' diff --git a/packages/state/recoil/selectors/indexer.ts b/packages/state/recoil/selectors/indexer.ts index c2f0889b9..5f0a541bc 100644 --- a/packages/state/recoil/selectors/indexer.ts +++ b/packages/state/recoil/selectors/indexer.ts @@ -13,7 +13,6 @@ import { WEB_SOCKET_PUSHER_APP_KEY, WEB_SOCKET_PUSHER_HOST, WEB_SOCKET_PUSHER_PORT, - getSupportedChainConfig, getSupportedChains, } from '@dao-dao/utils' @@ -403,38 +402,3 @@ export const indexerMeilisearchClientSelector = selector({ get: () => loadMeilisearchClient(), dangerouslyAllowMutability: true, }) - -/** - * Featured DAOs on a given chain. - */ -export const indexerFeaturedDaosSelector = selectorFamily< - { - address: string - order: number - }[], - string ->({ - key: 'indexerFeaturedDaos', - get: - (chainId) => - async ({ get }) => { - const config = getSupportedChainConfig(chainId) - if (!config) { - return [] - } - - const featuredDaos: { - address: string - order: number - }[] = - get( - queryGenericIndexerSelector({ - chainId, - formula: 'featuredDaos', - noFallback: true, - }) - ) || [] - - return featuredDaos - }, -}) diff --git a/packages/state/recoil/selectors/profile.ts b/packages/state/recoil/selectors/profile.ts deleted file mode 100644 index dc9ccdedd..000000000 --- a/packages/state/recoil/selectors/profile.ts +++ /dev/null @@ -1,309 +0,0 @@ -import uniq from 'lodash.uniq' -import { noWait, selectorFamily, waitForAll } from 'recoil' - -import { - ChainId, - PfpkProfile, - ResolvedProfile, - UnifiedProfile, - WithChainId, -} from '@dao-dao/types' -import { - EMPTY_PFPK_PROFILE, - MAINNET, - PFPK_API_BASE, - STARGAZE_NAMES_CONTRACT, - getChainForChainId, - makeEmptyUnifiedProfile, - objectMatchesStructure, - processError, - toBech32Hash, - transformBech32Address, -} from '@dao-dao/utils' - -import { refreshWalletProfileAtom } from '../atoms/refresh' -import { cosmWasmClientForChainSelector } from './chain' -import { nftCardInfoSelector } from './nft' - -export const searchProfilesByNamePrefixSelector = selectorFamily< - ResolvedProfile[], - WithChainId<{ namePrefix: string }> ->({ - key: 'searchProfilesByNamePrefix', - get: - ({ namePrefix, chainId }) => - async ({ get }) => { - if (namePrefix.length < 3) { - return [] - } - - // Load profiles from PFPK API. - let profiles: ResolvedProfile[] = [] - try { - const response = await fetch( - PFPK_API_BASE + `/search/${chainId}/${namePrefix}` - ) - if (response.ok) { - const { profiles: _profiles } = (await response.json()) as { - profiles: ResolvedProfile[] - } - profiles = _profiles - } else { - console.error(await response.json()) - } - } catch (err) { - console.error(processError(err)) - } - - // Add refresher dependencies. - if (profiles.length > 0) { - get( - waitForAll( - profiles.map((hit) => - refreshWalletProfileAtom(toBech32Hash(hit.address)) - ) - ) - ) - } - - return profiles - }, -}) - -/** - * Get profile from PFPK given a wallet address on any chain. - */ -export const pfpkProfileSelector = selectorFamily({ - key: 'pfpkProfile', - get: - (walletAddress) => - ({ get }) => - get( - pfpkProfileForBech32HashSelector( - walletAddress && toBech32Hash(walletAddress) - ) - ), -}) - -/** - * Get profile from PFPK given a wallet address's bech32 hash. - */ -export const pfpkProfileForBech32HashSelector = selectorFamily< - PfpkProfile, - string ->({ - key: 'pfpkProfileForBech32Hash', - get: - (bech32Hash) => - async ({ get }) => { - if (!bech32Hash) { - return { ...EMPTY_PFPK_PROFILE } - } - - get(refreshWalletProfileAtom(bech32Hash)) - - try { - const response = await fetch(PFPK_API_BASE + `/bech32/${bech32Hash}`) - if (response.ok) { - const profile: PfpkProfile = await response.json() - - // If profile found, add refresher dependencies for the other chains - // in the profile. This ensures that the profile will update for all - // other chains when any of the other chains update the profile. - if (profile?.chains) { - get( - waitForAll( - uniq( - Object.values(profile.chains).map(({ address }) => - toBech32Hash(address) - ) - ).map((bech32Hash) => refreshWalletProfileAtom(bech32Hash)) - ) - ) - } - - return profile - } else { - console.error(await response.json().catch(() => response.statusText)) - } - } catch (err) { - console.error(err) - } - - return { ...EMPTY_PFPK_PROFILE } - }, -}) - -// Get name for address from Stargaze Names. -export const stargazeNameSelector = selectorFamily({ - key: 'stargazeName', - get: - (walletAddress) => - async ({ get }) => { - if (!walletAddress) { - return - } - - get(refreshWalletProfileAtom(walletAddress)) - - const client = get( - cosmWasmClientForChainSelector( - MAINNET ? ChainId.StargazeMainnet : ChainId.StargazeTestnet - ) - ) - - try { - return await client.queryContractSmart(STARGAZE_NAMES_CONTRACT, { - name: { address: walletAddress }, - }) - } catch {} - }, -}) - -// Get image for address from Stargaze Names. -export const stargazeNameImageForAddressSelector = selectorFamily< - string | undefined, - string ->({ - key: 'stargazeNameImageForAddress', - get: - (walletAddress) => - async ({ get }) => { - // Get name associated with address. - const name = get(stargazeNameSelector(walletAddress)) - if (!name) { - return - } - - const chainId = MAINNET - ? ChainId.StargazeMainnet - : ChainId.StargazeTestnet - const client = get(cosmWasmClientForChainSelector(chainId)) - - // Get NFT associated with name. - let response - try { - response = await client.queryContractSmart(STARGAZE_NAMES_CONTRACT, { - image_n_f_t: { name }, - }) - } catch { - return - } - - // If NFT exists, get image associated with NFT. - if ( - objectMatchesStructure(response, { - collection: {}, - token_id: {}, - }) - ) { - const { imageUrl } = get( - nftCardInfoSelector({ - chainId, - collection: response.collection, - tokenId: response.token_id, - }) - ) - - return imageUrl - } - }, -}) - -export const profileSelector = selectorFamily< - UnifiedProfile, - WithChainId<{ address: string }> ->({ - key: 'profile', - get: - ({ address, chainId }) => - ({ get }) => { - const profile = makeEmptyUnifiedProfile(chainId, address) - if (!address) { - return profile - } - - get(refreshWalletProfileAtom(toBech32Hash(address))) - - const pfpkProfile = get(pfpkProfileSelector(address)) - if (pfpkProfile) { - profile.uuid = pfpkProfile.uuid - profile.nonce = pfpkProfile.nonce - profile.name = pfpkProfile.name - profile.nft = pfpkProfile.nft - profile.chains = pfpkProfile.chains - } - - // Load Stargaze name as backup if no PFPK name set. - if (!profile.name) { - const stargazeNameLoadable = get( - noWait( - stargazeNameSelector( - // Use profile address for Stargaze if set, falling back to - // transforming the address (which is unreliable due to different - // chains using different HD paths). - profile.chains[ChainId.StargazeMainnet]?.address || - transformBech32Address(address, ChainId.StargazeMainnet) - ) - ) - ) - if ( - stargazeNameLoadable.state === 'hasValue' && - stargazeNameLoadable.contents - ) { - profile.name = - stargazeNameLoadable.contents + - '.' + - getChainForChainId(chainId).bech32_prefix - profile.nameSource = 'stargaze' - } - } - - // Set `imageUrl` to PFPK image, defaulting to fallback image. - profile.imageUrl = pfpkProfile?.nft?.imageUrl || profile.backupImageUrl - - // If NFT present from PFPK, get image from token once loaded. - if (pfpkProfile?.nft) { - // Don't wait for NFT info to load. When it loads, it will update. - const nftInfoLoadable = get( - noWait( - nftCardInfoSelector({ - collection: pfpkProfile.nft.collectionAddress, - tokenId: pfpkProfile.nft.tokenId, - chainId: pfpkProfile.nft.chainId, - }) - ) - ) - - // Set `imageUrl` if defined, overriding PFPK image and backup. - if ( - nftInfoLoadable.state === 'hasValue' && - nftInfoLoadable.contents?.imageUrl - ) { - profile.imageUrl = nftInfoLoadable.contents.imageUrl - } - - // Load Stargaze name image if no PFPK image. - } else if (profile.nameSource === 'stargaze') { - const stargazeNameImageLoadable = get( - noWait( - stargazeNameImageForAddressSelector( - // Use profile address for Stargaze if set, falling back to - // transforming the address (which is unreliable due to different - // chains using different HD paths). - profile.chains[ChainId.StargazeMainnet]?.address || - transformBech32Address(address, ChainId.StargazeMainnet) - ) - ) - ) - if ( - stargazeNameImageLoadable.state === 'hasValue' && - stargazeNameImageLoadable.contents - ) { - profile.imageUrl = stargazeNameImageLoadable.contents - } - } - - return profile - }, -}) diff --git a/packages/state/recoil/selectors/treasury.ts b/packages/state/recoil/selectors/treasury.ts index f00986988..4ca066988 100644 --- a/packages/state/recoil/selectors/treasury.ts +++ b/packages/state/recoil/selectors/treasury.ts @@ -179,11 +179,10 @@ export const daoTvlSelector = selectorFamily< ({ get }) => { // Native chain x/gov module. if (isConfiguredChainName(chainId, coreAddress)) { - // If chain uses a contract-based DAO, load it instead. - const govContractAddress = - getSupportedChainConfig(chainId)?.govContractAddress - - coreAddress = govContractAddress || COMMUNITY_POOL_ADDRESS_PLACEHOLDER + coreAddress = + // If chain uses a contract-based DAO, load it instead. + getSupportedChainConfig(chainId)?.govContractAddress || + COMMUNITY_POOL_ADDRESS_PLACEHOLDER } const timestamp = new Date() diff --git a/packages/state/recoil/selectors/wallet.ts b/packages/state/recoil/selectors/wallet.ts index 4086cfeef..65c4555c1 100644 --- a/packages/state/recoil/selectors/wallet.ts +++ b/packages/state/recoil/selectors/wallet.ts @@ -10,7 +10,6 @@ import { import { AccountTxSave, AccountType, - ContractVersion, ContractVersionInfo, GenericTokenBalance, LazyDaoCardProps, @@ -529,8 +528,7 @@ export const lazyWalletDaosSelector = selectorFamily< info: { chainId, coreAddress: dao, - coreVersion: - parseContractVersion(info.version) || ContractVersion.Unknown, + coreVersion: parseContractVersion(info.version), name: config.name, description: config.description, imageUrl: config.image_url || getFallbackImage(dao), diff --git a/packages/state/utils/contract.ts b/packages/state/utils/contract.ts index 4d9304649..874cd3861 100644 --- a/packages/state/utils/contract.ts +++ b/packages/state/utils/contract.ts @@ -1,7 +1,6 @@ -import { fromUtf8, toUtf8 } from '@cosmjs/encoding' +import { QueryClient } from '@tanstack/react-query' import { - ContractVersionInfo, PreProposeModule, PreProposeModuleType, PreProposeModuleTypedConfig, @@ -9,7 +8,6 @@ import { import { Config as NeutronCwdSubdaoTimelockSingleConfig } from '@dao-dao/types/contracts/NeutronCwdSubdaoTimelockSingle' import { ContractName, - INVALID_CONTRACT_ERROR_SUBSTRINGS, cosmWasmClientRouter, getRpcForChainId, parseContractVersion, @@ -22,69 +20,20 @@ import { NeutronCwdSubdaoTimelockSingleQueryClient, } from '../contracts' import { queryIndexer } from '../indexer' - -export const fetchContractInfo = async ( - chainId: string, - contractAddress: string -): Promise => { - let info: ContractVersionInfo | undefined - - // Try indexer first. - try { - info = await queryIndexer({ - type: 'contract', - address: contractAddress, - formula: 'info', - chainId, - }) - } catch (err) { - // Ignore error. - console.error(err) - } - - // If indexer fails, fallback to querying chain. - if (!info) { - try { - const client = await cosmWasmClientRouter.connect( - getRpcForChainId(chainId) - ) - const { data: contractInfo } = await client[ - 'forceGetQueryClient' - ]().wasm.queryContractRaw(contractAddress, toUtf8('contract_info')) - if (contractInfo) { - info = JSON.parse(fromUtf8(contractInfo)) - } - } catch (err) { - if ( - err instanceof Error && - INVALID_CONTRACT_ERROR_SUBSTRINGS.some((substring) => - (err as Error).message.includes(substring) - ) - ) { - // Ignore error. - console.error(err) - return undefined - } - - // Rethrow other errors because it should not have failed. - throw err - } - } - - return info -} +import { contractQueries } from '../query' export const fetchPreProposeModule = async ( + queryClient: QueryClient, chainId: string, preProposeAddress: string ): Promise => { - const contractInfo = await fetchContractInfo(chainId, preProposeAddress) - const contractVersion = - contractInfo && parseContractVersion(contractInfo.version) - - if (!contractInfo || !contractVersion) { - throw new Error('Failed to fetch pre propose module info') - } + const { info: contractInfo } = await queryClient.fetchQuery( + contractQueries.info(queryClient, { + chainId, + address: preProposeAddress, + }) + ) + const contractVersion = parseContractVersion(contractInfo.version) let typedConfig: PreProposeModuleTypedConfig = { type: PreProposeModuleType.Other, @@ -122,8 +71,17 @@ export const fetchPreProposeModule = async ( } // Check if approver is an approver contract. - const approverContractInfo = await fetchContractInfo(chainId, approver) - if (approverContractInfo?.contract === ContractName.PreProposeApprover) { + const approverContractName = ( + await queryClient + .fetchQuery( + contractQueries.info(queryClient, { + chainId, + address: approver, + }) + ) + .catch(() => undefined) + )?.info.contract + if (approverContractName === ContractName.PreProposeApprover) { preProposeApproverContract = approver approver = undefined diff --git a/packages/stateful/README.md b/packages/stateful/README.md index 7edc86c7a..6d8ac5fff 100644 --- a/packages/stateful/README.md +++ b/packages/stateful/README.md @@ -15,6 +15,7 @@ intelligent components that do fun stuff with data. | [`hooks`](./hooks) | Stateful React hooks that combine elements from the [`state` package](../state) and [`stateless` package](../stateless). Notably, contains hooks for interacting with on-chain smart contracts. | | [`inbox`](./inbox) | Inbox adapter system that supports various data sources for inbox items. | | [`proposal-module-adapter`](./proposal-module-adapter) | Proposal module adapter system that allows dynamic support for proposal modules in the UI. | +| [`queries`](./queries) | [React Query](https://tanstack.com/query/latest/docs/framework/react/overview) queries. | | [`recoil`](./recoil) | [Recoil](https://recoiljs.org) atoms and selectors that require [`state`](../state) or other stateful information. | | [`server`](./server) | Isolated functions only to be run on the server. Notably, contains main [Static Site Generation](https://nextjs.org/docs/basic-features/data-fetching/get-static-props) code. | | [`utils`](./utils) | Stateful utility functions. | diff --git a/packages/stateful/actions/core/authorizations/AuthzExec/index.tsx b/packages/stateful/actions/core/authorizations/AuthzExec/index.tsx index c879c162a..325434052 100644 --- a/packages/stateful/actions/core/authorizations/AuthzExec/index.tsx +++ b/packages/stateful/actions/core/authorizations/AuthzExec/index.tsx @@ -1,11 +1,12 @@ +import { useQueryClient } from '@tanstack/react-query' import { useCallback, useMemo } from 'react' import { useFormContext } from 'react-hook-form' -import { constSelector, useRecoilValueLoadable } from 'recoil' -import { isDaoSelector } from '@dao-dao/state/recoil' +import { contractQueries } from '@dao-dao/state/query' import { ChainProvider, DaoSupportedChainPickerInput, + ErrorPage, LockWithKeyEmoji, useChain, } from '@dao-dao/stateless' @@ -37,7 +38,11 @@ import { EntityDisplay, SuspenseLoader, } from '../../../../components' -import { daoInfoSelector } from '../../../../recoil' +import { + useQueryLoadingData, + useQueryLoadingDataWithError, +} from '../../../../hooks' +import { daoQueries } from '../../../../queries/dao' import { WalletActionsProvider, useActionOptions, @@ -97,30 +102,38 @@ const InnerComponentWrapper: ActionComponent< } = props const { chain_id: chainId } = useChain() - const isDaoLoadable = useRecoilValueLoadable( - isDaoSelector({ - address, + const queryClient = useQueryClient() + const isDao = useQueryLoadingData( + contractQueries.isDao(queryClient, { chainId, - }) + address, + }), + false ) - const daoInfoLoadable = useRecoilValueLoadable( - isDaoLoadable.state === 'hasValue' && isDaoLoadable.contents - ? daoInfoSelector({ - chainId, - coreAddress: address, - }) - : constSelector(undefined) + const daoInfo = useQueryLoadingDataWithError( + daoQueries.info( + useQueryClient(), + !isDao.loading && isDao.data + ? { + chainId, + coreAddress: address, + } + : undefined + ) ) - return isDaoLoadable.state === 'loading' || - daoInfoLoadable.state === 'loading' ? ( + return isDao.loading || (isDao.data && daoInfo.loading) ? ( - ) : daoInfoLoadable.state === 'hasValue' && daoInfoLoadable.contents ? ( - }> - - - - + ) : isDao.data && !daoInfo.loading ? ( + daoInfo.errored ? ( + + ) : ( + }> + + + + + ) ) : ( diff --git a/packages/stateful/actions/core/dao_governance/CreateDao/index.tsx b/packages/stateful/actions/core/dao_governance/CreateDao/index.tsx index d9b78a0a1..fc3a30a7b 100644 --- a/packages/stateful/actions/core/dao_governance/CreateDao/index.tsx +++ b/packages/stateful/actions/core/dao_governance/CreateDao/index.tsx @@ -1,12 +1,7 @@ +import { useQueryClient } from '@tanstack/react-query' import { useCallback } from 'react' -import { constSelector } from 'recoil' -import { daoParentInfoSelector } from '@dao-dao/state/recoil' -import { - DaoEmoji, - useCachedLoadingWithError, - useChain, -} from '@dao-dao/stateless' +import { DaoEmoji, useChain } from '@dao-dao/stateless' import { ActionComponent, ActionKey, @@ -18,19 +13,24 @@ import { import { decodeJsonFromBase64, objectMatchesStructure } from '@dao-dao/utils' import { LinkWrapper } from '../../../../components' +import { useQueryLoadingDataWithError } from '../../../../hooks' +import { daoQueries } from '../../../../queries' import { CreateDaoComponent, CreateDaoData } from './Component' const Component: ActionComponent = (props) => { const { chain_id: chainId } = useChain() // If admin is set, attempt to load parent DAO info. - const parentDao = useCachedLoadingWithError( - props.data.admin - ? daoParentInfoSelector({ - chainId, - parentAddress: props.data.admin, - }) - : constSelector(undefined) + const parentDao = useQueryLoadingDataWithError( + daoQueries.parentInfo( + useQueryClient(), + props.data.admin + ? { + chainId, + parentAddress: props.data.admin, + } + : undefined + ) ) return ( diff --git a/packages/stateful/actions/core/dao_governance/DaoAdminExec/index.tsx b/packages/stateful/actions/core/dao_governance/DaoAdminExec/index.tsx index c915ff491..c1658cdcb 100644 --- a/packages/stateful/actions/core/dao_governance/DaoAdminExec/index.tsx +++ b/packages/stateful/actions/core/dao_governance/DaoAdminExec/index.tsx @@ -1,9 +1,9 @@ +import { useQueryClient } from '@tanstack/react-query' import { useCallback } from 'react' import { useFormContext } from 'react-hook-form' -import { constSelector, useRecoilValueLoadable } from 'recoil' import { DaoCoreV2Selectors, walletAdminOfDaosSelector } from '@dao-dao/state' -import { JoystickEmoji, useCachedLoadable } from '@dao-dao/stateless' +import { ErrorPage, JoystickEmoji, useCachedLoadable } from '@dao-dao/stateless' import { ActionChainContextType, ActionComponent, @@ -26,7 +26,8 @@ import { EntityDisplay, SuspenseLoader, } from '../../../../components' -import { daoInfoSelector } from '../../../../recoil' +import { useQueryLoadingDataWithError } from '../../../../hooks' +import { daoQueries } from '../../../../queries/dao' import { useActionOptions, useActionsForMatching, @@ -118,13 +119,16 @@ const Component: ActionComponent = (props) => { ? daoSubDaosLoadable : walletAdminOfDaosLoadable - const daoInfoLoadable = useRecoilValueLoadable( - coreAddress && isValidBech32Address(coreAddress, bech32Prefix) - ? daoInfoSelector({ - coreAddress, - chainId, - }) - : constSelector(undefined) + const daoInfo = useQueryLoadingDataWithError( + daoQueries.info( + useQueryClient(), + coreAddress && isValidBech32Address(coreAddress, bech32Prefix) + ? { + chainId, + coreAddress: address, + } + : undefined + ) ) const options: InnerOptions = { @@ -139,16 +143,18 @@ const Component: ActionComponent = (props) => { : { loading: true }, } - return daoInfoLoadable.state === 'hasValue' && !!daoInfoLoadable.contents ? ( + return daoInfo.loading ? ( + + ) : daoInfo.errored ? ( + + ) : ( } > - + - ) : ( - ) } diff --git a/packages/stateful/actions/core/dao_governance/VetoOrEarlyExecuteDaoProposal/index.tsx b/packages/stateful/actions/core/dao_governance/VetoOrEarlyExecuteDaoProposal/index.tsx index a4b74bf1c..0a4a47ce5 100644 --- a/packages/stateful/actions/core/dao_governance/VetoOrEarlyExecuteDaoProposal/index.tsx +++ b/packages/stateful/actions/core/dao_governance/VetoOrEarlyExecuteDaoProposal/index.tsx @@ -1,3 +1,4 @@ +import { useQueryClient } from '@tanstack/react-query' import { useCallback, useEffect } from 'react' import { useFormContext } from 'react-hook-form' @@ -29,10 +30,9 @@ import { EntityDisplay, ProposalLine, } from '../../../../components' -import { - daoInfoSelector, - daosWithVetoableProposalsSelector, -} from '../../../../recoil' +import { useQueryLoadingDataWithError } from '../../../../hooks' +import { daoQueries } from '../../../../queries/dao' +import { daosWithVetoableProposalsSelector } from '../../../../recoil' import { useActionOptions } from '../../../react' import { VetoOrEarlyExecuteDaoProposalComponent as StatelessVetoOrEarlyExecuteDaoProposalComponent, @@ -100,13 +100,17 @@ const Component: ActionComponent< setValue, ]) - const selectedDaoInfo = useCachedLoadingWithError( - chainId && coreAddress - ? daoInfoSelector({ - chainId, - coreAddress, - }) - : undefined + const queryClient = useQueryClient() + const selectedDaoInfo = useQueryLoadingDataWithError( + daoQueries.info( + queryClient, + chainId && coreAddress + ? { + chainId, + coreAddress, + } + : undefined + ) ) // Select first proposal once loaded if nothing selected. diff --git a/packages/stateful/actions/core/treasury/Spend/index.tsx b/packages/stateful/actions/core/treasury/Spend/index.tsx index b63b32d13..33f231197 100644 --- a/packages/stateful/actions/core/treasury/Spend/index.tsx +++ b/packages/stateful/actions/core/treasury/Spend/index.tsx @@ -1,4 +1,5 @@ import { coin, coins } from '@cosmjs/amino' +import { useQueryClient } from '@tanstack/react-query' import { useCallback, useEffect, useState } from 'react' import { useFormContext } from 'react-hook-form' import { constSelector, useRecoilValue } from 'recoil' @@ -69,9 +70,10 @@ import { } from '@dao-dao/utils' import { AddressInput } from '../../../../components' +import { useQueryLoadingDataWithError } from '../../../../hooks' import { useWallet } from '../../../../hooks/useWallet' import { useProposalModuleAdapterCommonContextIfAvailable } from '../../../../proposal-module-adapter/react/context' -import { entitySelector } from '../../../../recoil' +import { entityQueries } from '../../../../queries/entity' import { useTokenBalances } from '../../../hooks/useTokenBalances' import { useActionOptions } from '../../../react' import { @@ -503,13 +505,17 @@ const Component: ActionComponent = (props) => { ]) const [currentEntity, setCurrentEntity] = useState() - const loadingEntity = useCachedLoadingWithError( - validRecipient - ? entitySelector({ - address: recipient, - chainId: toChainId, - }) - : undefined + const queryClient = useQueryClient() + const loadingEntity = useQueryLoadingDataWithError( + entityQueries.info( + queryClient, + validRecipient + ? { + address: recipient, + chainId: toChainId, + } + : undefined + ) ) // Cache last successfully loaded entity. useEffect(() => { diff --git a/packages/stateful/actions/core/treasury/token_swap/stateful/InstantiateTokenSwap.tsx b/packages/stateful/actions/core/treasury/token_swap/stateful/InstantiateTokenSwap.tsx index 9fd55e404..610b66c8a 100644 --- a/packages/stateful/actions/core/treasury/token_swap/stateful/InstantiateTokenSwap.tsx +++ b/packages/stateful/actions/core/treasury/token_swap/stateful/InstantiateTokenSwap.tsx @@ -24,8 +24,8 @@ import { } from '@dao-dao/utils' import { AddressInput, Trans } from '../../../../../components' +import { useEntity } from '../../../../../hooks' import { useWallet } from '../../../../../hooks/useWallet' -import { entitySelector } from '../../../../../recoil' import { useTokenBalances } from '../../../../hooks/useTokenBalances' import { useActionOptions } from '../../../../react' import { InstantiateTokenSwap as StatelessInstantiateTokenSwap } from '../stateless/InstantiateTokenSwap' @@ -237,27 +237,23 @@ const InnerInstantiateTokenSwap: ActionComponent< // Get counterparty entity, which reverse engineers a DAO from its polytone // proxy. - const entityLoading = useCachedLoading( + const { entity } = useEntity( counterpartyAddress && isValidBech32Address(counterpartyAddress, bech32Prefix) - ? entitySelector({ - chainId, - address: counterpartyAddress, - }) - : undefined, - undefined + ? counterpartyAddress + : '' ) // Try to retrieve governance token address, failing if not a cw20-based DAO. const counterpartyDaoGovernanceTokenAddressLoadable = useRecoilValueLoadable( - !entityLoading.loading && - entityLoading.data?.type === EntityType.Dao && + !entity.loading && + entity.data.type === EntityType.Dao && // Only care about loading the governance token if on the chain we're // creating the token swap on. - entityLoading.data.chainId === chainId + entity.data.chainId === chainId ? DaoCoreV2Selectors.tryFetchGovernanceTokenAddressSelector({ chainId, - contractAddress: entityLoading.data.address, + contractAddress: entity.data.address, }) : constSelector(undefined) ) @@ -265,12 +261,12 @@ const InnerInstantiateTokenSwap: ActionComponent< // Load balances as loadables since they refresh automatically on a timer. const counterpartyTokenBalances = useCachedLoading( counterpartyAddress && - !entityLoading.loading && - entityLoading.data && + !entity.loading && + entity.data && counterpartyDaoGovernanceTokenAddressLoadable.state !== 'loading' ? genericTokenBalancesSelector({ - chainId: entityLoading.data.chainId, - address: entityLoading.data.address, + chainId: entity.data.chainId, + address: entity.data.address, cw20GovernanceTokenAddress: counterpartyDaoGovernanceTokenAddressLoadable.state === 'hasValue' ? counterpartyDaoGovernanceTokenAddressLoadable.contents diff --git a/packages/stateful/command/contexts/generic/dao.tsx b/packages/stateful/command/contexts/generic/dao.tsx index 032b511f6..38cd368df 100644 --- a/packages/stateful/command/contexts/generic/dao.tsx +++ b/packages/stateful/command/contexts/generic/dao.tsx @@ -5,17 +5,14 @@ import { HomeOutlined, InboxOutlined, } from '@mui/icons-material' +import { useQueryClient } from '@tanstack/react-query' import { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import { useRecoilState } from 'recoil' import useDeepCompareEffect from 'use-deep-compare-effect' import { navigatingToHrefAtom } from '@dao-dao/state' -import { - useCachedLoading, - useDaoInfoContext, - useDaoNavHelpers, -} from '@dao-dao/stateless' +import { useDaoInfoContext, useDaoNavHelpers } from '@dao-dao/stateless' import { ContractVersion, Feature } from '@dao-dao/types' import { CommandModalContextMaker, @@ -26,8 +23,13 @@ import { import { getDisplayNameForChainId, getFallbackImage } from '@dao-dao/utils' import { DaoProvidersWithoutInfo } from '../../../components' -import { useDaoTabs, useFollowingDaos, useGovDaoTabs } from '../../../hooks' -import { chainSubDaoInfosSelector, subDaoInfosSelector } from '../../../recoil' +import { + useDaoTabs, + useFollowingDaos, + useGovDaoTabs, + useQueryLoadingData, +} from '../../../hooks' +import { daoQueries } from '../../../queries' export const makeGenericDaoContext: CommandModalContextMaker<{ dao: CommandModalDaoInfo @@ -68,19 +70,19 @@ export const makeGenericDaoContext: CommandModalContextMaker<{ const daoPageHref = getDaoPath(coreAddress) const createProposalHref = getDaoProposalPath(coreAddress, 'create') - const subDaosLoading = useCachedLoading( + const queryClient = useQueryClient() + const subDaosLoading = useQueryLoadingData( coreVersion === ContractVersion.Gov - ? chainSubDaoInfosSelector({ - chainId, - }) - : supportedFeatures[Feature.SubDaos] - ? subDaoInfosSelector({ + ? daoQueries.chainSubDaoInfos(queryClient, { chainId, - coreAddress, }) - : // Passing undefined here returns an infinite loading state, which is - // fine because it's never used. - undefined, + : { + ...daoQueries.subDaoInfos(queryClient, { + chainId, + coreAddress, + }), + enabled: !!supportedFeatures[Feature.SubDaos], + }, [] ) diff --git a/packages/stateful/components/AddressInput.tsx b/packages/stateful/components/AddressInput.tsx index d36d476a2..2eca9a123 100644 --- a/packages/stateful/components/AddressInput.tsx +++ b/packages/stateful/components/AddressInput.tsx @@ -1,3 +1,4 @@ +import { useQueries, useQueryClient } from '@tanstack/react-query' import Fuse from 'fuse.js' import { useMemo } from 'react' import { FieldValues, Path, useFormContext } from 'react-hook-form' @@ -5,14 +6,11 @@ import { useTranslation } from 'react-i18next' import { waitForNone } from 'recoil' import { useDeepCompareMemoize } from 'use-deep-compare-effect' -import { - searchDaosSelector, - searchProfilesByNamePrefixSelector, -} from '@dao-dao/state/recoil' +import { profileQueries } from '@dao-dao/state/query' +import { searchDaosSelector } from '@dao-dao/state/recoil' import { AddressInput as StatelessAddressInput, useCachedLoadable, - useCachedLoading, useChain, } from '@dao-dao/stateless' import { AddressInputProps, Entity, EntityType } from '@dao-dao/types' @@ -20,9 +18,11 @@ import { POLYTONE_CONFIG_PER_CHAIN, getAccountAddress, isValidBech32Address, + makeCombineQueryResultsIntoLoadingData, } from '@dao-dao/utils' -import { entitySelector } from '../recoil' +import { useQueryLoadingDataWithError } from '../hooks' +import { entityQueries } from '../queries/entity' import { EntityDisplay } from './EntityDisplay' export const AddressInput = < @@ -45,14 +45,17 @@ export const AddressInput = < // Don't search name if it's an address. !isValidBech32Address(formValue, currentChain.bech32_prefix) - const searchProfilesLoadable = useCachedLoadable( - hasFormValue && props.type !== 'contract' - ? searchProfilesByNamePrefixSelector({ - chainId: currentChain.chain_id, - namePrefix: formValue, - }) - : undefined + const searchProfilesLoading = useQueryLoadingDataWithError( + profileQueries.searchByNamePrefix( + hasFormValue && props.type !== 'contract' + ? { + chainId: currentChain.chain_id, + namePrefix: formValue, + } + : undefined + ) ) + // Search DAOs on current chains and all polytone-connected chains so we can // find polytone accounts. const searchDaosLoadable = useCachedLoadable( @@ -76,13 +79,14 @@ export const AddressInput = < : undefined ) - const loadingEntities = useCachedLoading( - waitForNone([ - ...(searchProfilesLoadable.state === 'hasValue' - ? searchProfilesLoadable.contents.map(({ address }) => - entitySelector({ - address, + const queryClient = useQueryClient() + const loadingEntities = useQueries({ + queries: [ + ...(!searchProfilesLoading.loading && !searchProfilesLoading.errored + ? searchProfilesLoading.data.map(({ address }) => + entityQueries.info(queryClient, { chainId: currentChain.chain_id, + address, }) ) : []), @@ -90,7 +94,7 @@ export const AddressInput = < ? searchDaosLoadable.contents.flatMap((loadable) => loadable.state === 'hasValue' ? loadable.contents.map(({ chainId, id: address }) => - entitySelector({ + entityQueries.info(queryClient, { chainId, address, }) @@ -98,34 +102,38 @@ export const AddressInput = < : [] ) : []), - ]), - [] - ) - - const entities = loadingEntities.loading - ? [] - : // Only show entities that are on the current chain or are DAOs with - // accounts (polytone probably) on the current chain. - loadingEntities.data - .filter( - (entity) => - entity.state === 'hasValue' && - (entity.contents.chainId === currentChain.chain_id || - (entity.contents.type === EntityType.Dao && - getAccountAddress({ - accounts: entity.contents.daoInfo.accounts, - chainId: currentChain.chain_id, - }))) - ) - .map((entity) => entity.contents as Entity) + ], + combine: useMemo( + () => + makeCombineQueryResultsIntoLoadingData({ + firstLoad: 'none', + transform: (entities) => + // Only show entities that are on the current chain or are DAOs with + // accounts (polytone probably) on the current chain. + entities.filter( + (entity) => + entity.chainId === currentChain.chain_id || + (entity.type === EntityType.Dao && + getAccountAddress({ + accounts: entity.daoInfo.accounts, + chainId: currentChain.chain_id, + })) + ), + }), + [currentChain.chain_id] + ), + }) // Use Fuse to search combined profiles and DAOs by name so that is most // relevant (as opposed to just sticking DAOs after profiles). const fuse = useMemo( - () => new Fuse(entities, { keys: ['name'] }), + () => + new Fuse(loadingEntities.loading ? [] : loadingEntities.data, { + keys: ['name'], + }), // Only reinstantiate fuse when entities deeply changes. // eslint-disable-next-line react-hooks/exhaustive-deps - useDeepCompareMemoize([entities]) + useDeepCompareMemoize([loadingEntities]) ) const searchedEntities = useMemo( () => (hasFormValue ? fuse.search(formValue).map(({ item }) => item) : []), @@ -143,9 +151,9 @@ export const AddressInput = < entities: searchedEntities, loading: (props.type !== 'contract' && - (searchProfilesLoadable.state === 'loading' || - (searchProfilesLoadable.state === 'hasValue' && - searchProfilesLoadable.updating))) || + (searchProfilesLoading.loading || + (!searchProfilesLoading.errored && + searchProfilesLoading.updating))) || (props.type !== 'wallet' && (searchDaosLoadable.state === 'loading' || (searchDaosLoadable.state === 'hasValue' && @@ -154,10 +162,7 @@ export const AddressInput = < (loadable) => loadable.state === 'loading' ))))) || loadingEntities.loading || - !!loadingEntities.updating || - loadingEntities.data.some( - (loadable) => loadable.state === 'loading' - ), + !!loadingEntities.updating, } : undefined } diff --git a/packages/stateful/components/StateProvider.tsx b/packages/stateful/components/StateProvider.tsx new file mode 100644 index 000000000..3f5aeb5e0 --- /dev/null +++ b/packages/stateful/components/StateProvider.tsx @@ -0,0 +1,59 @@ +import { + DehydratedState, + QueryClientProvider, + useQueryClient, +} from '@tanstack/react-query' +import { ReactNode, useEffect, useMemo } from 'react' +import { RecoilRoot, useSetRecoilState } from 'recoil' + +import { makeReactQueryClient, queryClientAtom } from '@dao-dao/state' + +export type StateProviderProps = { + /** + * Children to render. + */ + children: ReactNode + /** + * Optional dehyrated state from a react-query client instance on the server + * to initialize data. + */ + dehyratedState?: DehydratedState +} + +/** + * A provider that wraps an app with the state providers, like React Query and + * Recoil. + */ +export const StateProvider = ({ + children, + dehyratedState, +}: StateProviderProps) => { + const client = useMemo( + () => makeReactQueryClient(dehyratedState), + [dehyratedState] + ) + + return ( + + set(queryClientAtom, client) + } + > + {children} + + + ) +} + +const InnerStateProvider = ({ children }: { children: ReactNode }) => { + const queryClient = useQueryClient() + const setQueryClient = useSetRecoilState(queryClientAtom) + // Update Recoil atom when the query client changes. + useEffect(() => { + setQueryClient(queryClient) + }, [queryClient, setQueryClient]) + + return <>{children} +} diff --git a/packages/stateful/components/dao/CreateDaoForm.tsx b/packages/stateful/components/dao/CreateDaoForm.tsx index 2396a3e0f..513d2d4d1 100644 --- a/packages/stateful/components/dao/CreateDaoForm.tsx +++ b/packages/stateful/components/dao/CreateDaoForm.tsx @@ -1,4 +1,5 @@ import { ArrowBack } from '@mui/icons-material' +import { useQueryClient } from '@tanstack/react-query' import cloneDeep from 'lodash.clonedeep' import merge from 'lodash.merge' import { useEffect, useMemo, useState } from 'react' @@ -12,8 +13,8 @@ import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' import { constSelector, useRecoilState, useRecoilValue } from 'recoil' +import { contractQueries } from '@dao-dao/state/query' import { averageColorSelector, walletChainIdAtom } from '@dao-dao/state/recoil' -import { fetchContractInfo } from '@dao-dao/state/utils' import { Button, ChainProvider, @@ -32,7 +33,6 @@ import { } from '@dao-dao/stateless' import { ActionKey, - ContractVersion, CreateDaoContext, CreateDaoCustomValidator, DaoPageMode, @@ -148,6 +148,7 @@ export const InnerCreateDaoForm = ({ }: CreateDaoFormProps) => { const { t } = useTranslation() const daoInfo = useDaoInfoContextIfAvailable() + const queryClient = useQueryClient() const chainContext = useSupportedChainContext() const { @@ -523,10 +524,13 @@ export const InnerCreateDaoForm = ({ error: (err) => processError(err), }) - const info = await fetchContractInfo(chainId, coreAddress) - const coreVersion = - (info && parseContractVersion(info.version)) || - ContractVersion.Unknown + const { info } = await queryClient.fetchQuery( + contractQueries.info(queryClient, { + chainId, + address: coreAddress, + }) + ) + const coreVersion = parseContractVersion(info.version) // Don't set following on SDA. Only dApp. if (mode !== DaoPageMode.Sda) { diff --git a/packages/stateful/components/dao/DaoApproverProposalContentDisplay.tsx b/packages/stateful/components/dao/DaoApproverProposalContentDisplay.tsx index ddcc4b5f0..abc8e82c2 100644 --- a/packages/stateful/components/dao/DaoApproverProposalContentDisplay.tsx +++ b/packages/stateful/components/dao/DaoApproverProposalContentDisplay.tsx @@ -1,3 +1,4 @@ +import { useQueryClient, useSuspenseQuery } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' import { useRecoilValue } from 'recoil' @@ -23,7 +24,7 @@ import { useProposalModuleAdapter, useProposalModuleAdapterContext, } from '../../proposal-module-adapter' -import { daoInfoSelector } from '../../recoil' +import { daoQueries } from '../../queries/dao' import { EntityDisplay } from '../EntityDisplay' import { IconButtonLink } from '../IconButtonLink' import { SuspenseLoader } from '../SuspenseLoader' @@ -69,8 +70,8 @@ export const DaoApproverProposalContentDisplay = ({ const { approvalDao, preProposeApprovalContract } = prePropose.config const { chain_id: chainId } = useChain() - const daoInfo = useRecoilValue( - daoInfoSelector({ + const { data: daoInfo } = useSuspenseQuery( + daoQueries.info(useQueryClient(), { chainId, coreAddress: approvalDao, }) diff --git a/packages/stateful/components/dao/DaoCard.tsx b/packages/stateful/components/dao/DaoCard.tsx index f8aa7cf6c..b4d51460d 100644 --- a/packages/stateful/components/dao/DaoCard.tsx +++ b/packages/stateful/components/dao/DaoCard.tsx @@ -1,3 +1,6 @@ +import { useRecoilValue } from 'recoil' + +import { mountedInBrowserAtom } from '@dao-dao/state/recoil' import { DaoCard as StatelessDaoCard, useCachedLoading, @@ -18,6 +21,8 @@ export const DaoCard = (props: StatefulDaoCardProps) => { // chains from the currently connected profile and find the correct one. const { chains } = useProfile() + const mountedInBrowser = useRecoilValue(mountedInBrowserAtom) + const { isFollowing, setFollowing, setUnfollowing, updatingFollowing } = useFollowingDaos() @@ -55,6 +60,16 @@ export const DaoCard = (props: StatefulDaoCardProps) => { LinkWrapper={LinkWrapper} follow={follow} lazyData={lazyData} + showParentDao={ + /* + * Hide the parent DAO until the app is mounted in the browser since + * rendering it on the server causes a hydration error for some horrible + * reason. I think it has something to do with the fact that you're not + * supposed to nest an A tag inside of another A tag, and maybe the + * Next.js server is sanitizing it or something. Anyways, rip. + */ + mountedInBrowser + } /> ) } diff --git a/packages/stateful/components/dao/DaoPageWrapper.tsx b/packages/stateful/components/dao/DaoPageWrapper.tsx index 54cc144a8..e2644910d 100644 --- a/packages/stateful/components/dao/DaoPageWrapper.tsx +++ b/packages/stateful/components/dao/DaoPageWrapper.tsx @@ -1,25 +1,21 @@ +import { DehydratedState } from '@tanstack/react-query' import { NextSeo } from 'next-seo' import { useRouter } from 'next/router' -import { PropsWithChildren, useEffect, useMemo } from 'react' +import { PropsWithChildren, useEffect } from 'react' import { useRecoilState } from 'recoil' -import { accountsSelector, walletChainIdAtom } from '@dao-dao/state/recoil' +import { walletChainIdAtom } from '@dao-dao/state/recoil' import { DaoNotFound, ErrorPage500, PageLoader, useAppContext, - useCachedLoadingWithError, useThemeContext, } from '@dao-dao/stateless' import { CommonProposalInfo, DaoInfo } from '@dao-dao/types' -import { - getFallbackImage, - transformIpfsUrlToHttpsIfNecessary, -} from '@dao-dao/utils' +import { transformIpfsUrlToHttpsIfNecessary } from '@dao-dao/utils' import { makeDaoContext, makeGenericContext } from '../../command' -import { daoInfoSelector } from '../../recoil' import { PageHeaderContent } from '../PageHeaderContent' import { SuspenseLoader } from '../SuspenseLoader' import { DaoProviders } from './DaoProviders' @@ -32,6 +28,7 @@ export type DaoPageWrapperProps = PropsWithChildren<{ info?: DaoInfo error?: string setIcon?: (icon: string | undefined) => void + reactQueryDehydratedState?: DehydratedState }> export type DaoProposalProps = DaoPageWrapperProps & { @@ -43,7 +40,7 @@ export const DaoPageWrapper = ({ title, description, accentColor, - info: _info, + info, error, setIcon, children, @@ -55,7 +52,7 @@ export const DaoPageWrapper = ({ const [walletChainId, setWalletChainId] = useRecoilState(walletChainIdAtom) // Update walletChainId to whatever the current DAO is to ensure we connect // correctly. - const currentChainId = _info?.chainId + const currentChainId = info?.chainId useEffect(() => { if (currentChainId && currentChainId !== walletChainId) { setWalletChainId(currentChainId) @@ -87,68 +84,29 @@ export const DaoPageWrapper = ({ setAccentColor(accentColor ?? undefined) }, [accentColor, setAccentColor, isReady, isFallback, theme]) - // Load all accounts since the static props only loads some. This should load - // faster than the DAO info selector below that will eventually replace this. - const accounts = useCachedLoadingWithError( - _info - ? accountsSelector({ - chainId: _info.chainId, - address: _info.coreAddress, - }) - : undefined - ) - - const info = useMemo( - (): DaoInfo | undefined => - _info && { - ..._info, - accounts: - accounts.loading || accounts.errored ? _info.accounts : accounts.data, - }, - [_info, accounts] - ) - - // Load DAO info once static props are loaded so it's more up to date. - const loadingDaoInfo = useCachedLoadingWithError( - info - ? daoInfoSelector({ - chainId: info.chainId, - coreAddress: info.coreAddress, - }) - : undefined - ) - - // Use the loading info once it's loaded, otherwise fallback to info from - // static props. - const loadedInfo = - !loadingDaoInfo.loading && !loadingDaoInfo.errored - ? loadingDaoInfo.data - : info - // Set icon for the page from info if setIcon is present. useEffect(() => { if (setIcon) { setIcon( - loadedInfo?.imageUrl - ? transformIpfsUrlToHttpsIfNecessary(loadedInfo.imageUrl) + info?.imageUrl + ? transformIpfsUrlToHttpsIfNecessary(info.imageUrl) : undefined ) } - }, [setIcon, loadedInfo?.imageUrl]) + }, [setIcon, info?.imageUrl]) // On load, set DAO context for command modal. useEffect(() => { - if (setRootCommandContextMaker && loadedInfo) { + if (setRootCommandContextMaker && info) { setRootCommandContextMaker((options) => makeDaoContext({ ...options, dao: { - chainId: loadedInfo.chainId, - coreAddress: loadedInfo.coreAddress, - coreVersion: loadedInfo.coreVersion, - name: loadedInfo.name, - imageUrl: - loadedInfo.imageUrl || getFallbackImage(loadedInfo.coreAddress), + chainId: info.chainId, + coreAddress: info.coreAddress, + coreVersion: info.coreVersion, + name: info.name, + imageUrl: info.imageUrl, }, }) ) @@ -160,7 +118,7 @@ export const DaoPageWrapper = ({ setRootCommandContextMaker(makeGenericContext) } } - }, [loadedInfo, setRootCommandContextMaker]) + }, [info, setRootCommandContextMaker]) return ( <> @@ -182,8 +140,8 @@ export const DaoPageWrapper = ({ {/* On fallback page (waiting for static props), `info` is not yet present. Let's just display a loader until `info` is loaded. We can't access translations until static props are loaded anyways. */} }> - {loadedInfo ? ( - + {info ? ( + {/* Suspend children to prevent unmounting and remounting the context providers inside it every time something needs to suspend (which causes a lot of flickering loading states). */} }> {children} diff --git a/packages/stateful/components/dao/DaoProviders.tsx b/packages/stateful/components/dao/DaoProviders.tsx index 2be06b1a2..bccb9b1e6 100644 --- a/packages/stateful/components/dao/DaoProviders.tsx +++ b/packages/stateful/components/dao/DaoProviders.tsx @@ -1,3 +1,4 @@ +import { useQuery, useQueryClient } from '@tanstack/react-query' import { ReactNode } from 'react' import { @@ -5,12 +6,11 @@ import { DaoInfoContext, ErrorPage, Loader, - useCachedLoadingWithError, } from '@dao-dao/stateless' import { ContractVersion, DaoInfo } from '@dao-dao/types' import { DaoActionsProvider } from '../../actions' -import { daoInfoSelector } from '../../recoil' +import { daoQueries } from '../../queries/dao' import { VotingModuleAdapterProvider } from '../../voting-module-adapter' import { SuspenseLoader } from '../SuspenseLoader' @@ -63,20 +63,23 @@ export const DaoProvidersWithoutInfo = ({ coreAddress, children, }: DaoProvidersWithoutInfoProps) => { - const infoLoading = useCachedLoadingWithError( - daoInfoSelector({ + const daoInfoQuery = useQuery( + daoQueries.info(useQueryClient(), { chainId, coreAddress, }) ) return ( - } forceFallback={infoLoading.loading}> - {!infoLoading.loading && - (infoLoading.errored ? ( - + } + forceFallback={daoInfoQuery.isPending} + > + {!daoInfoQuery.isPending && + (daoInfoQuery.isError ? ( + ) : ( - {children} + {children} ))} ) diff --git a/packages/stateful/components/dao/LazyDaoCard.tsx b/packages/stateful/components/dao/LazyDaoCard.tsx index 39c05d8dc..2ce887ad2 100644 --- a/packages/stateful/components/dao/LazyDaoCard.tsx +++ b/packages/stateful/components/dao/LazyDaoCard.tsx @@ -1,24 +1,24 @@ +import { useQuery, useQueryClient } from '@tanstack/react-query' import clsx from 'clsx' import { useTranslation } from 'react-i18next' -import { useCachedLoadingWithError } from '@dao-dao/stateless' import { LazyDaoCardProps } from '@dao-dao/types' import { processError } from '@dao-dao/utils' -import { daoInfoSelector } from '../../recoil' +import { daoQueries } from '../../queries/dao' import { DaoCard } from './DaoCard' export const LazyDaoCard = (props: LazyDaoCardProps) => { const { t } = useTranslation() - const daoInfo = useCachedLoadingWithError( - daoInfoSelector({ + const daoInfoQuery = useQuery( + daoQueries.info(useQueryClient(), { chainId: props.info.chainId, coreAddress: props.info.coreAddress, }) ) - return daoInfo.loading ? ( + return daoInfoQuery.isPending ? ( { admin: '', }} /> - ) : daoInfo.errored || !daoInfo.data ? ( + ) : daoInfoQuery.isError ? ( { description: t('error.unexpectedError') + '\n' + - processError( - daoInfo.errored ? daoInfo.error : t('error.loadingData'), - { - forceCapture: false, - } - ), + processError(daoInfoQuery.error, { + forceCapture: false, + }), // Unused. supportedFeatures: {} as any, votingModuleAddress: '', @@ -69,6 +66,6 @@ export const LazyDaoCard = (props: LazyDaoCardProps) => { }} /> ) : ( - + ) } diff --git a/packages/stateful/components/dao/tabs/SubDaosTab.tsx b/packages/stateful/components/dao/tabs/SubDaosTab.tsx index 3bc53c36a..102509dee 100644 --- a/packages/stateful/components/dao/tabs/SubDaosTab.tsx +++ b/packages/stateful/components/dao/tabs/SubDaosTab.tsx @@ -1,7 +1,7 @@ +import { useQueryClient } from '@tanstack/react-query' + import { SubDaosTab as StatelessSubDaosTab, - useCachedLoading, - useChain, useDaoInfoContext, useDaoNavHelpers, } from '@dao-dao/stateless' @@ -9,24 +9,26 @@ import { ActionKey, Feature } from '@dao-dao/types' import { getDaoProposalSinglePrefill } from '@dao-dao/utils' import { useActionForKey } from '../../../actions' -import { useMembership } from '../../../hooks' -import { subDaoInfosSelector } from '../../../recoil' +import { useMembership, useQueryLoadingData } from '../../../hooks' +import { daoQueries } from '../../../queries' import { ButtonLink } from '../../ButtonLink' import { DaoCard } from '../DaoCard' export const SubDaosTab = () => { - const { chain_id: chainId } = useChain() const daoInfo = useDaoInfoContext() const { getDaoPath, getDaoProposalPath } = useDaoNavHelpers() const { isMember = false } = useMembership(daoInfo) - const subDaos = useCachedLoading( - daoInfo.supportedFeatures[Feature.SubDaos] - ? subDaoInfosSelector({ chainId, coreAddress: daoInfo.coreAddress }) - : // Passing undefined here returns an infinite loading state, which is - // fine because it's never used. - undefined, + const queryClient = useQueryClient() + const subDaos = useQueryLoadingData( + { + ...daoQueries.subDaoInfos(queryClient, { + chainId: daoInfo.chainId, + coreAddress: daoInfo.coreAddress, + }), + enabled: !!daoInfo.supportedFeatures[Feature.SubDaos], + }, [] ) diff --git a/packages/stateful/components/gov/GovSubDaosTab.tsx b/packages/stateful/components/gov/GovSubDaosTab.tsx index ed142abb8..1b40f1bdc 100644 --- a/packages/stateful/components/gov/GovSubDaosTab.tsx +++ b/packages/stateful/components/gov/GovSubDaosTab.tsx @@ -1,30 +1,27 @@ -import { waitForAll } from 'recoil' - import { DaoCardLoader, GridCardContainer, SubDaosTab as StatelessSubDaosTab, - useCachedLoading, useChain, } from '@dao-dao/stateless' import { getSupportedChainConfig } from '@dao-dao/utils' import { GovActionsProvider } from '../../actions' -import { daoInfoSelector } from '../../recoil' +import { useLoadingDaos } from '../../hooks' import { ButtonLink } from '../ButtonLink' import { DaoCard } from '../dao/DaoCard' export const GovSubDaosTab = () => { const { chain_id: chainId } = useChain() - const subDaos = useCachedLoading( - waitForAll( - getSupportedChainConfig(chainId)?.subDaos?.map((coreAddress) => - daoInfoSelector({ chainId, coreAddress }) - ) ?? [] - ), - [] - ) + const subDaos = useLoadingDaos({ + loading: false, + data: + getSupportedChainConfig(chainId)?.subDaos?.map((coreAddress) => ({ + chainId, + coreAddress, + })) ?? [], + }) return ( { }) ) - const profile = useCachedLoading( - profileSelector({ + const profile = useQueryLoadingData( + profileQueries.unified(useQueryClient(), { chainId: configuredChain.chainId, address: accountAddress, }), diff --git a/packages/stateful/components/pages/Home.tsx b/packages/stateful/components/pages/Home.tsx index c10eddbb9..cfac0cf3f 100644 --- a/packages/stateful/components/pages/Home.tsx +++ b/packages/stateful/components/pages/Home.tsx @@ -1,3 +1,4 @@ +import { DehydratedState } from '@tanstack/react-query' import clsx from 'clsx' import { NextPage } from 'next' import { NextSeo } from 'next-seo' @@ -49,6 +50,11 @@ export type StatefulHomeProps = { * Optionally show chain x/gov DAOs. */ chainGovDaos?: DaoInfo[] + /** + * Dehydrated react query state used by the server to preload data. This is + * accessed in the _app.tsx file. + */ + reactQueryDehydratedState?: DehydratedState } export const Home: NextPage = ({ @@ -113,6 +119,35 @@ export const Home: NextPage = ({ : undefined const featuredDaosLoading = useLoadingFeaturedDaoCards(chainId) + const featuredDaos: LoadingData = + !chainId || !chainGovDaos + ? // If not on a chain-specific page, show all featured DAOs. + featuredDaosLoading + : featuredDaosLoading.loading || chainGovDaos.loading + ? { + loading: true, + } + : { + loading: false, + updating: featuredDaosLoading.updating, + // On a chain-specific page, remove featured DAOs that show + // up in the chain governance section. + data: featuredDaosLoading.data.filter( + (featured) => + !chainGovDaos.data.some( + (chain) => + featured.info.coreAddress === chain.info.coreAddress || + // If the chain itself uses a real DAO for its + // governance, such as Neutron, hide it from + // featured as well since it shows up above. This is + // needed because the DAO in the featured list uses + // the DAO's real address, while the DAO in the + // chain x/gov list is the name of the chain. + featured.info.coreAddress === + selectedChain?.govContractAddress + ) + ), + } return ( <> @@ -140,7 +175,7 @@ export const Home: NextPage = ({ ) : ( -
+ <> @@ -188,44 +223,16 @@ export const Home: NextPage = ({ } /> - - !chainGovDaos.data.some( - (chain) => - featured.info.coreAddress === - chain.info.coreAddress || - // If the chain itself uses a real DAO for its - // governance, such as Neutron, hide it from - // featured as well since it shows up above. This is - // needed because the DAO in the featured list uses - // the DAO's real address, while the DAO in the - // chain x/gov list is the name of the chain. - featured.info.coreAddress === - selectedChain?.govContractAddress - ) - ), - } - } - openSearch={openSearch} - stats={stats} - /> -
+
+ +
+ )} ) diff --git a/packages/stateful/components/wallet/WalletProvider.tsx b/packages/stateful/components/wallet/WalletProvider.tsx index 0831f3e21..cb6d8267c 100644 --- a/packages/stateful/components/wallet/WalletProvider.tsx +++ b/packages/stateful/components/wallet/WalletProvider.tsx @@ -23,7 +23,6 @@ import { wallets as trustWallets } from '@cosmos-kit/trust' import { wallets as vectisWallets } from '@cosmos-kit/vectis' import { PromptSign, makeWeb3AuthWallets } from '@cosmos-kit/web3auth' import { wallets as xdefiWallets } from '@cosmos-kit/xdefi' -import { assets, chains } from 'chain-registry' import { PropsWithChildren, ReactNode, useEffect, useMemo, useRef } from 'react' import { useTranslation } from 'react-i18next' import { usePrevious } from 'react-use' @@ -41,6 +40,8 @@ import { SITE_TITLE, SITE_URL, WEB3AUTH_CLIENT_ID, + assets, + chains, getChainForChainId, getKeplrFromWindow, getSignerOptions, @@ -176,10 +177,7 @@ export const WalletProvider = ({ children }: WalletProviderProps) => { return ( { return currentChainId }, [address, currentBech32Prefix, currentChainId]) - const entity = useCachedLoading( - address - ? entitySelector({ - chainId, - address, - }) - : undefined, - // Should never error as it uses loadables internally. + const entity = useQueryLoadingData( + entityQueries.info( + useQueryClient(), + address + ? { + chainId, + address, + } + : undefined + ), + // Should never error but just in case... { type: EntityType.Wallet, chainId, diff --git a/packages/stateful/hooks/useLoadingDaos.ts b/packages/stateful/hooks/useLoadingDaos.ts index 2460bde3a..cf8cb4c2f 100644 --- a/packages/stateful/hooks/useLoadingDaos.ts +++ b/packages/stateful/hooks/useLoadingDaos.ts @@ -1,82 +1,66 @@ +import { useQueries, useQueryClient } from '@tanstack/react-query' +import { useMemo } from 'react' import { constSelector, useRecoilValueLoadable, waitForAll } from 'recoil' -import { - followingDaosSelector, - indexerFeaturedDaosSelector, -} from '@dao-dao/state/recoil' -import { useCachedLoadable } from '@dao-dao/stateless' +import { daoQueries } from '@dao-dao/state/query' +import { followingDaosSelector } from '@dao-dao/state/recoil' import { DaoInfo, DaoSource, LoadingData, StatefulDaoCardProps, } from '@dao-dao/types' -import { getSupportedChains } from '@dao-dao/utils' +import { makeCombineQueryResultsIntoLoadingData } from '@dao-dao/utils' -import { daoInfoSelector } from '../recoil' +import { daoQueries as statefulDaoQueries } from '../queries/dao' import { useProfile } from './useProfile' +import { useQueryLoadingData } from './useQueryLoadingData' export const useLoadingDaos = ( daos: LoadingData, alphabetize = false ): LoadingData => { - const daoInfosLoadable = useCachedLoadable( - !daos.loading - ? waitForAll( - daos.data.map(({ chainId, coreAddress }) => - daoInfoSelector({ - chainId, - coreAddress, - }) - ) - ) - : undefined - ) - - return daoInfosLoadable.state !== 'hasValue' - ? { loading: true } - : { - loading: false, - updating: daoInfosLoadable.updating, - data: (daoInfosLoadable.contents.filter(Boolean) as DaoInfo[]).sort( - (a, b) => (alphabetize ? a.name.localeCompare(b.name) : 0) + const queryClient = useQueryClient() + return useQueries({ + queries: daos.loading + ? [] + : daos.data.map(({ chainId, coreAddress }) => + statefulDaoQueries.info(queryClient, { + chainId, + coreAddress, + }) ), - } + combine: useMemo( + () => + makeCombineQueryResultsIntoLoadingData({ + transform: (infos) => + infos.sort((a, b) => + alphabetize ? a.name.localeCompare(b.name) : 0 + ), + }), + [alphabetize] + ), + }) } export const useLoadingFeaturedDaoCards = ( - // If passed, will only load DAOs from this chain. Otherwise, will load - // from all chains. + /** + * If passed, only load DAOs from this chain. Otherwise, load from all chains. + */ chainId?: string ): LoadingData => { - const chains = getSupportedChains().filter( - ({ chain: { chain_id } }) => !chainId || chain_id === chainId - ) - const featuredDaos = useRecoilValueLoadable( - waitForAll( - chains.map(({ chain }) => indexerFeaturedDaosSelector(chain.chain_id)) - ) - ) + const featuredDaos = useQueryLoadingData(daoQueries.listFeatured(), []) const daos = useLoadingDaos( - featuredDaos.state === 'loading' + featuredDaos.loading ? { loading: true } - : featuredDaos.state === 'hasError' + : !featuredDaos.data ? { loading: false, data: [] } : { loading: false, - data: chains - .flatMap( - ({ chain }, index) => - featuredDaos.contents[index]?.map( - ({ address: coreAddress, order }) => ({ - chainId: chain.chain_id, - coreAddress, - order, - }) - ) || [] - ) - .sort((a, b) => a.order - b.order), + data: featuredDaos.data.filter( + (featured) => !chainId || featured.chainId === chainId + ), } ) diff --git a/packages/stateful/hooks/useManageProfile.ts b/packages/stateful/hooks/useManageProfile.ts index d206c4f3b..6ab460ae1 100644 --- a/packages/stateful/hooks/useManageProfile.ts +++ b/packages/stateful/hooks/useManageProfile.ts @@ -1,10 +1,9 @@ import { toHex } from '@cosmjs/encoding' +import { useQueries, useQueryClient } from '@tanstack/react-query' import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' -import { waitForNone } from 'recoil' -import { profileSelector } from '@dao-dao/state' -import { useCachedLoading, useCachedLoadingWithError } from '@dao-dao/stateless' +import { profileQueries } from '@dao-dao/state' import { AddChainsFunction, AddChainsStatus, @@ -18,12 +17,14 @@ import { PFPK_API_BASE, SignedBody, getDisplayNameForChainId, + makeCombineQueryResultsIntoLoadingData, makeEmptyUnifiedProfile, makeManuallyResolvedPromise, signOffChainAuth, } from '@dao-dao/utils' import { useCfWorkerAuthPostRequest } from './useCfWorkerAuthPostRequest' +import { useQueryLoadingData } from './useQueryLoadingData' import { useRefreshProfile } from './useRefreshProfile' import { useWallet } from './useWallet' @@ -145,8 +146,8 @@ export const useManageProfile = ({ loadAccount: true, }) - const profile = useCachedLoading( - profileSelector({ + const profile = useQueryLoadingData( + profileQueries.unified(useQueryClient(), { chainId: walletChainId, address, }), @@ -387,16 +388,22 @@ export const useManageProfile = ({ ).filter( (chainWallet) => !!chainWallet.isWalletConnected && !!chainWallet.address ) - const otherChainWalletProfiles = useCachedLoadingWithError( - waitForNone( - otherConnectedChainWallets.map((chainWallet) => - profileSelector({ - chainId: chainWallet.chainId, - address: chainWallet.address!, - }) - ) - ) - ) + const queryClient = useQueryClient() + const otherChainWalletProfiles = useQueries({ + queries: otherConnectedChainWallets.map((chainWallet) => + profileQueries.unified(queryClient, { + chainId: chainWallet.chainId, + address: chainWallet.address!, + }) + ), + combine: useMemo( + () => + makeCombineQueryResultsIntoLoadingData({ + firstLoad: 'none', + }), + [] + ), + }) const merge: UseManageProfileReturn['merge'] = useMemo(() => { // Get all profiles attached to this wallet that are different from the @@ -404,21 +411,17 @@ export const useManageProfile = ({ const profilesToMerge = currentChainWallet && !profile.loading && - !otherChainWalletProfiles.loading && - !otherChainWalletProfiles.errored - ? otherChainWalletProfiles.data.flatMap((loadable) => { - const chainProfile = loadable.valueMaybe() + !otherChainWalletProfiles.loading + ? otherChainWalletProfiles.data.flatMap((chainProfile) => { if ( - // If not yet loaded, ignore. - !chainProfile || // If profile exists, UUID matches current chain wallet profile // and this chain wallet has been added to the profile, ignore. If // profile does not exist or chain has not been explicitly added, // we want to merge it into the current profile. - (chainProfile.uuid && - chainProfile.uuid === profile.data.uuid && - profile.data.chains[chainProfile.source.chainId]?.address === - chainProfile.source.address) + chainProfile.uuid && + chainProfile.uuid === profile.data.uuid && + profile.data.chains[chainProfile.source.chainId]?.address === + chainProfile.source.address ) { return [] } diff --git a/packages/stateful/hooks/useProfile.ts b/packages/stateful/hooks/useProfile.ts index 33b0c47a7..d5e0255ff 100644 --- a/packages/stateful/hooks/useProfile.ts +++ b/packages/stateful/hooks/useProfile.ts @@ -1,5 +1,6 @@ -import { profileSelector } from '@dao-dao/state' -import { useCachedLoading } from '@dao-dao/stateless' +import { useQueryClient } from '@tanstack/react-query' + +import { profileQueries } from '@dao-dao/state' import { LoadingData, ProfileChain, UnifiedProfile } from '@dao-dao/types' import { MAINNET, @@ -10,6 +11,7 @@ import { toBech32Hash, } from '@dao-dao/utils' +import { useQueryLoadingData } from './useQueryLoadingData' import { useRefreshProfile } from './useRefreshProfile' import { useWallet } from './useWallet' @@ -103,8 +105,8 @@ export const useProfile = ({ const profileAddress = address || currentAddress - const profile = useCachedLoading( - profileSelector({ + const profile = useQueryLoadingData( + profileQueries.unified(useQueryClient(), { chainId: walletChainId, address: profileAddress, }), diff --git a/packages/stateful/hooks/useQueryLoadingData.ts b/packages/stateful/hooks/useQueryLoadingData.ts new file mode 100644 index 000000000..0d1d6051c --- /dev/null +++ b/packages/stateful/hooks/useQueryLoadingData.ts @@ -0,0 +1,61 @@ +import { useQuery } from '@tanstack/react-query' +import { useMemo } from 'react' +import { useDeepCompareMemoize } from 'use-deep-compare-effect' + +import { useUpdatingRef } from '@dao-dao/stateless' +import { LoadingData } from '@dao-dao/types' + +/** + * Transform react-query results into our LoadingData object that components + * use. + */ +export const useQueryLoadingData = ( + /** + * Query options to passthrough to useQuery. + */ + options: Omit>[0], 'select'>, + /** + * Default value in case of an error. + */ + defaultValue: T, + /** + * Optionally call a function on error. + */ + onError?: (error: Error) => void +): LoadingData => { + const { isPending, isError, isRefetching, data, error } = useQuery(options) + + const onErrorRef = useUpdatingRef(onError) + + // Use deep compare to prevent memoize on every re-render if an object is + // passed as the default value. + const memoizedDefaultValue = useDeepCompareMemoize(defaultValue) + + return useMemo((): LoadingData => { + if (isPending) { + return { + loading: true, + } + } else if (isError) { + onErrorRef.current?.(error) + return { + loading: false, + data: memoizedDefaultValue, + } + } else { + return { + loading: false, + updating: isRefetching, + data, + } + } + }, [ + isPending, + isError, + onErrorRef, + error, + memoizedDefaultValue, + isRefetching, + data, + ]) +} diff --git a/packages/stateful/hooks/useQueryLoadingDataWithError.ts b/packages/stateful/hooks/useQueryLoadingDataWithError.ts new file mode 100644 index 000000000..1d309cd1a --- /dev/null +++ b/packages/stateful/hooks/useQueryLoadingDataWithError.ts @@ -0,0 +1,56 @@ +import { QueryKey, useQuery } from '@tanstack/react-query' +import { useMemo } from 'react' + +import { useUpdatingRef } from '@dao-dao/stateless' +import { LoadingDataWithError } from '@dao-dao/types' + +/** + * Transform react-query results into our LoadingDataWithError abstraction that + * components use. + */ +export const useQueryLoadingDataWithError = < + TQueryFnData extends unknown, + TQueryKey extends QueryKey = QueryKey, + TTransformedData extends unknown = TQueryFnData +>( + /** + * Query options to passthrough to useQuery. + */ + options: Omit< + Parameters< + typeof useQuery + >[0], + 'select' + >, + /** + * Optional function to transform the data. + */ + transform?: (data: TQueryFnData) => TTransformedData +): LoadingDataWithError => { + const { isPending, isError, isRefetching, data, error } = useQuery(options) + const transformRef = useUpdatingRef(transform) + + return useMemo((): LoadingDataWithError => { + if (isPending) { + return { + loading: true, + errored: false, + } + } else if (isError) { + return { + loading: false, + errored: true, + error, + } + } else { + return { + loading: false, + errored: false, + updating: isRefetching, + data: transformRef.current + ? transformRef.current(data) + : (data as unknown as TTransformedData), + } + } + }, [isPending, isError, isRefetching, data, error, transformRef]) +} diff --git a/packages/stateful/hooks/useRefreshProfile.ts b/packages/stateful/hooks/useRefreshProfile.ts index 79b4e2f45..4612dfc77 100644 --- a/packages/stateful/hooks/useRefreshProfile.ts +++ b/packages/stateful/hooks/useRefreshProfile.ts @@ -1,7 +1,8 @@ +import { useQueryClient } from '@tanstack/react-query' import uniq from 'lodash.uniq' -import { useRecoilCallback } from 'recoil' +import { useCallback } from 'react' -import { refreshWalletProfileAtom } from '@dao-dao/state/recoil' +import { useUpdatingRef } from '@dao-dao/stateless' import { LoadingData, UnifiedProfile } from '@dao-dao/types' import { toBech32Hash } from '@dao-dao/utils' @@ -15,28 +16,41 @@ import { toBech32Hash } from '@dao-dao/utils' export const useRefreshProfile = ( address: string | string[], profile: LoadingData -) => - useRecoilCallback( - ({ set }) => - () => { - // Refresh all hashes in the profile(s). This ensures updates made by - // one public key propagate to the other public keys in the profile(s). - const hashes = uniq( - [ - ...[address].flat(), - ...(profile.loading - ? [] - : [profile.data] - .flat() - .flatMap((profile) => - Object.values(profile.chains).map(({ address }) => address) - )), - ].flatMap((address) => toBech32Hash(address) || []) - ) +) => { + const queryClient = useQueryClient() - hashes.forEach((hash) => - set(refreshWalletProfileAtom(hash), (id) => id + 1) - ) - }, - [profile] - ) + // Stabilize reference so callback doesn't change. The latest values will be + // used when refresh is called. + const addressRef = useUpdatingRef(address) + const profileRef = useUpdatingRef(profile) + + return useCallback(() => { + // Refresh all hashes in the profile(s). This ensures updates made by + // one public key propagate to the other public keys in the profile(s). + const hashes = uniq( + [ + ...[addressRef.current].flat(), + ...(profileRef.current.loading + ? [] + : [profileRef.current.data] + .flat() + .flatMap((profile) => + Object.values(profile.chains).map(({ address }) => address) + )), + ].flatMap((address) => toBech32Hash(address) || []) + ) + + hashes.forEach((bech32Hash) => + queryClient.invalidateQueries({ + queryKey: [ + { + category: 'profile', + options: { + bech32Hash, + }, + }, + ], + }) + ) + }, [addressRef, profileRef, queryClient]) +} diff --git a/packages/stateful/index.ts b/packages/stateful/index.ts index e67305479..7debc3022 100644 --- a/packages/stateful/index.ts +++ b/packages/stateful/index.ts @@ -1,4 +1,5 @@ export * from './components' export * from './hooks' +export * from './queries' export * from './recoil' export * from './utils' diff --git a/packages/stateful/package.json b/packages/stateful/package.json index ca8ccb9a6..34eee5c30 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -47,6 +47,7 @@ "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", "@mui/material": "^5.10.3", + "@tanstack/react-query": "^5.40.0", "@walletconnect/browser-utils": "^1.8.0", "buffer": "^6.0.3", "chain-registry": "^1.59.4", diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/fetchPrePropose.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/fetchPrePropose.ts index c8ece500a..633889bb5 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/fetchPrePropose.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/fetchPrePropose.ts @@ -11,6 +11,7 @@ import { } from '@dao-dao/utils' export const fetchPrePropose: FetchPreProposeFunction = async ( + queryClient, chainId, proposalModuleAddress, version @@ -55,5 +56,5 @@ export const fetchPrePropose: FetchPreProposeFunction = async ( return null } - return await fetchPreProposeModule(chainId, preProposeAddress) + return await fetchPreProposeModule(queryClient, chainId, preProposeAddress) } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/fetchPrePropose.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/fetchPrePropose.ts index bc8341bf1..716ed5468 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/fetchPrePropose.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/fetchPrePropose.ts @@ -11,6 +11,7 @@ import { } from '@dao-dao/utils' export const fetchPrePropose: FetchPreProposeFunction = async ( + queryClient, chainId, proposalModuleAddress, version @@ -56,5 +57,5 @@ export const fetchPrePropose: FetchPreProposeFunction = async ( return null } - return await fetchPreProposeModule(chainId, preProposeAddress) + return await fetchPreProposeModule(queryClient, chainId, preProposeAddress) } diff --git a/packages/stateful/queries/dao.ts b/packages/stateful/queries/dao.ts new file mode 100644 index 000000000..1fe6dfed5 --- /dev/null +++ b/packages/stateful/queries/dao.ts @@ -0,0 +1,451 @@ +import { QueryClient, queryOptions, skipToken } from '@tanstack/react-query' + +import { + accountQueries, + chainQueries, + contractQueries, + polytoneQueries, + votingModuleQueries, +} from '@dao-dao/state/query' +import { daoDaoCoreQueries } from '@dao-dao/state/query/queries/contracts/DaoDaoCore' +import { + DaoInfo, + DaoParentInfo, + DaoSource, + Feature, + InfoResponse, + PolytoneProxies, + ProposalModule, +} from '@dao-dao/types' +import { + getDaoInfoForChainId, + getFallbackImage, + getSupportedChainConfig, + getSupportedFeatures, + isConfiguredChainName, + isFeatureSupportedByVersion, + parseContractVersion, +} from '@dao-dao/utils' + +import { fetchProposalModules } from '../utils' + +/** + * Fetch DAO proposal modules. + */ +export const fetchDaoProposalModules = async ( + queryClient: QueryClient, + { chainId, coreAddress }: DaoSource +): Promise => { + const coreVersion = parseContractVersion( + ( + await queryClient.fetchQuery( + contractQueries.info(queryClient, { + chainId, + address: coreAddress, + }) + ) + ).info.version + ) + + return await fetchProposalModules( + queryClient, + chainId, + coreAddress, + coreVersion + ) +} + +/** + * Fetch DAO info. + */ +export const fetchDaoInfo = async ( + queryClient: QueryClient, + { chainId, coreAddress }: DaoSource +): Promise => { + // Native chain governance. + if (isConfiguredChainName(chainId, coreAddress)) { + // Use real gov DAO's address if exists. + const chainConfigGovAddress = + getSupportedChainConfig(chainId)?.govContractAddress + if (chainConfigGovAddress) { + coreAddress = chainConfigGovAddress + } else { + // Use chain x/gov module info. + const govModuleAddress = await queryClient.fetchQuery( + chainQueries.moduleAddress({ + chainId, + name: 'gov', + }) + ) + const accounts = await queryClient.fetchQuery( + accountQueries.list(queryClient, { + chainId, + address: govModuleAddress, + }) + ) + + return getDaoInfoForChainId(chainId, accounts) + } + } + + // Get DAO info from contract. + + const state = await queryClient.fetchQuery( + daoDaoCoreQueries.dumpState(queryClient, { + chainId, + contractAddress: coreAddress, + }) + ) + + const coreVersion = parseContractVersion(state.version.version) + const supportedFeatures = getSupportedFeatures(coreVersion) + + const [ + parentDao, + votingModuleInfo, + created, + proposalModules, + _items, + polytoneProxies, + accounts, + isActive, + activeThreshold, + ] = await Promise.all([ + state.admin && state.admin !== coreAddress + ? queryClient + .fetchQuery( + daoQueries.parentInfo(queryClient, { + chainId, + parentAddress: state.admin, + subDaoAddress: coreAddress, + }) + ) + .catch(() => null) + : null, + // Check if indexer returned this already. + 'votingModuleInfo' in state + ? ({ info: state.votingModuleInfo } as InfoResponse) + : queryClient.fetchQuery( + contractQueries.info(queryClient, { + chainId, + address: state.voting_module, + }) + ), + // Check if indexer returned this already. + 'createdAt' in state && state.createdAt + ? Date.parse(state.createdAt) + : queryClient + .fetchQuery( + contractQueries.instantiationTime(queryClient, { + chainId, + address: coreAddress, + }) + ) + .catch(() => null), + queryClient.fetchQuery( + daoQueries.proposalModules(queryClient, { + chainId, + coreAddress, + }) + ), + queryClient.fetchQuery( + daoDaoCoreQueries.listAllItems(queryClient, { + chainId, + contractAddress: coreAddress, + }) + ), + // Check if indexer returned this already. + 'polytoneProxies' in state && state.polytoneProxies + ? (state.polytoneProxies as PolytoneProxies) + : queryClient.fetchQuery( + polytoneQueries.proxies(queryClient, { + chainId, + address: coreAddress, + }) + ), + queryClient.fetchQuery( + accountQueries.list(queryClient, { + chainId, + address: coreAddress, + }) + ), + + // Some voting modules don't support the active threshold queries, so if the + // queries fail, assume active and no threshold. + queryClient + .fetchQuery( + votingModuleQueries.isActive({ + chainId, + address: state.voting_module, + }) + ) + // If isActive query fails, just assume it is. + .catch(() => true), + queryClient + .fetchQuery( + votingModuleQueries.activeThresold(queryClient, { + chainId, + address: state.voting_module, + }) + ) + .then(({ active_threshold }) => active_threshold || null) + .catch(() => null), + ]) + + const votingModuleContractName = votingModuleInfo.info.contract + + // Convert items list into map. + const items = Object.fromEntries(_items) + + return { + chainId, + coreAddress, + coreVersion, + supportedFeatures, + votingModuleAddress: state.voting_module, + votingModuleContractName, + proposalModules, + admin: state.admin, + name: state.config.name, + description: state.config.description, + imageUrl: state.config.image_url || getFallbackImage(coreAddress), + created, + isActive, + activeThreshold, + items, + polytoneProxies, + accounts, + parentDao, + } +} + +/** + * Fetch DAO parent info. + */ +export const fetchDaoParentInfo = async ( + queryClient: QueryClient, + { + chainId, + parentAddress, + subDaoAddress, + ignoreParents, + }: { + chainId: string + parentAddress: string + /** + * To determine if the parent has registered the subDAO, pass the subDAO. + * This will set `registeredSubDao` appropriately. Otherwise, if undefined, + * `registeredSubDao` will be set to false. + */ + subDaoAddress?: string + /** + * Prevent infinite loop if DAO SubDAO loop exists. + */ + ignoreParents?: string[] + } +): Promise => { + // If address is a DAO contract... + const isDao = await queryClient.fetchQuery( + contractQueries.isDao(queryClient, { + chainId, + address: parentAddress, + }) + ) + + if (isDao) { + const [parentVersion, parentAdmin, { name, image_url }] = await Promise.all( + [ + queryClient + .fetchQuery( + contractQueries.info(queryClient, { + chainId, + address: parentAddress, + }) + ) + .then(({ info }) => parseContractVersion(info.version)), + queryClient.fetchQuery( + daoDaoCoreQueries.admin(queryClient, { + chainId, + contractAddress: parentAddress, + }) + ), + queryClient.fetchQuery( + daoDaoCoreQueries.config(queryClient, { + chainId, + contractAddress: parentAddress, + }) + ), + ] + ) + + // Check if parent has registered the SubDAO. + const registeredSubDao = + !!subDaoAddress && + isFeatureSupportedByVersion(Feature.SubDaos, parentVersion) && + ( + await queryClient.fetchQuery( + daoDaoCoreQueries.listAllSubDaos(queryClient, { + chainId, + contractAddress: parentAddress, + }) + ) + ).some(({ addr }) => addr === subDaoAddress) + + // Recursively fetch parent. + const parentDao = + parentAdmin && parentAdmin !== parentAddress + ? await queryClient + .fetchQuery( + daoQueries.parentInfo(queryClient, { + chainId, + parentAddress: parentAdmin, + subDaoAddress: parentAddress, + // Add address to ignore list to prevent infinite loops. + ignoreParents: [...(ignoreParents || []), parentAddress], + }) + ) + .catch(() => null) + : null + + return { + chainId, + coreAddress: parentAddress, + coreVersion: parentVersion, + name, + imageUrl: image_url || getFallbackImage(parentAddress), + admin: parentAdmin ?? '', + registeredSubDao, + parentDao, + } + } else { + // If address is the chain's x/gov module... + const isGov = await queryClient.fetchQuery( + chainQueries.isAddressModule(queryClient, { + chainId, + address: parentAddress, + moduleName: 'gov', + }) + ) + if (isGov) { + const chainDaoInfo = getDaoInfoForChainId(chainId, []) + return { + chainId, + coreAddress: chainDaoInfo.coreAddress, + coreVersion: chainDaoInfo.coreVersion, + name: chainDaoInfo.name, + imageUrl: chainDaoInfo.imageUrl, + admin: '', + registeredSubDao: + !!subDaoAddress && + !!getSupportedChainConfig(chainId)?.subDaos?.includes(subDaoAddress), + parentDao: null, + } + } + } + + throw new Error('Parent is not a DAO nor the chain governance module') +} + +/** + * Fetch DAO info for all of a DAO's SubDAOs. + */ +export const fetchSubDaoInfos = async ( + queryClient: QueryClient, + { chainId, coreAddress }: DaoSource +): Promise => { + const subDaos = await queryClient.fetchQuery( + daoDaoCoreQueries.listAllSubDaos(queryClient, { + chainId, + contractAddress: coreAddress, + }) + ) + + return await Promise.all( + subDaos.map(({ addr }) => + queryClient.fetchQuery( + daoQueries.info(queryClient, { chainId, coreAddress: addr }) + ) + ) + ) +} + +/** + * Fetch DAO info for all of a chain's SubDAOs. + */ +export const fetchChainSubDaoInfos = ( + queryClient: QueryClient, + { chainId }: { chainId: string } +): Promise => + Promise.all( + (getSupportedChainConfig(chainId)?.subDaos || []).map((coreAddress) => + queryClient.fetchQuery( + daoQueries.info(queryClient, { chainId, coreAddress }) + ) + ) + ) + +export const daoQueries = { + /** + * Fetch DAO proposal modules. + */ + proposalModules: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['dao', 'proposalModules', options], + queryFn: () => fetchDaoProposalModules(queryClient, options), + }), + /** + * Fetch DAO info. + */ + info: ( + queryClient: QueryClient, + /** + * If undefined, query will be disabled. + */ + options?: Parameters[1] + ) => + queryOptions({ + queryKey: ['dao', 'info', options], + queryFn: options ? () => fetchDaoInfo(queryClient, options) : skipToken, + }), + /** + * Fetch DAO parent info. + */ + parentInfo: ( + queryClient: QueryClient, + /** + * If undefined, query will be disabled. + */ + options?: Parameters[1] + ) => + queryOptions({ + queryKey: ['dao', 'parentInfo', options], + queryFn: options + ? () => fetchDaoParentInfo(queryClient, options) + : skipToken, + }), + /** + * Fetch DAO info for all of a DAO's SubDAOs. + */ + subDaoInfos: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['dao', 'subDaoInfos', options], + queryFn: () => fetchSubDaoInfos(queryClient, options), + }), + /** + * Fetch DAO info for all of a chain's SubDAOs. + */ + chainSubDaoInfos: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['dao', 'chainSubDaoInfos', options], + queryFn: () => fetchChainSubDaoInfos(queryClient, options), + }), +} diff --git a/packages/stateful/queries/entity.ts b/packages/stateful/queries/entity.ts new file mode 100644 index 000000000..4354a61af --- /dev/null +++ b/packages/stateful/queries/entity.ts @@ -0,0 +1,214 @@ +import { QueryClient, queryOptions, skipToken } from '@tanstack/react-query' + +import { + chainQueries, + contractQueries, + cw1WhitelistQueries, + polytoneQueries, + profileQueries, +} from '@dao-dao/state/query' +import { Entity, EntityType } from '@dao-dao/types' +import { + getChainForChainId, + getFallbackImage, + getImageUrlForChainId, + isValidWalletAddress, +} from '@dao-dao/utils' + +import { daoQueries } from './dao' + +/** + * Fetch entity information for any address on any chain. + */ +export const fetchEntityInfo = async ( + queryClient: QueryClient, + { + chainId, + address, + ignoreEntities, + }: { + chainId: string + address: string + /** + * Prevent infinite loop if cw1-whitelist nests itself. + */ + ignoreEntities?: string[] + } +): Promise => { + const { bech32_prefix: bech32Prefix } = getChainForChainId(chainId) + + // Check if address is module account. + const moduleName = await queryClient + .fetchQuery( + chainQueries.moduleName({ + chainId, + address, + }) + ) + .catch(() => null) + if (moduleName) { + const entity: Entity = { + type: EntityType.Module, + chainId, + address, + name: moduleName, + imageUrl: getImageUrlForChainId(chainId), + } + return entity + } + + const [ + daoInfo, + entityFromPolytoneProxy, + walletProfile, + cw1WhitelistAdminEntities, + ] = await Promise.all([ + // Attempt to load DAO. + queryClient + .fetchQuery( + contractQueries.isDao(queryClient, { + chainId, + address, + }) + ) + .then((isDao) => + isDao + ? queryClient.fetchQuery( + daoQueries.info(queryClient, { + chainId, + coreAddress: address, + }) + ) + : undefined + ) + .catch(() => undefined), + // Attempt to load polytone proxy. + queryClient + .fetchQuery( + contractQueries.isPolytoneProxy(queryClient, { + chainId, + address, + }) + ) + .then(async (isPolytoneProxy): Promise => { + if (!isPolytoneProxy) { + return + } + + const controller = await queryClient.fetchQuery( + polytoneQueries.reverseLookupProxy(queryClient, { + chainId, + address, + }) + ) + + return { + ...(await queryClient.fetchQuery( + entityQueries.info(queryClient, { + chainId: controller.chainId, + address: controller.remoteAddress, + }) + )), + polytoneProxy: { + chainId, + address, + }, + } + }) + .catch(() => undefined), + // Attempt to load wallet profile. + isValidWalletAddress(address, bech32Prefix) + ? queryClient.fetchQuery( + profileQueries.unified(queryClient, { + chainId, + address, + }) + ) + : undefined, + // Attempt to load cw1-whitelist admins. + queryClient + .fetchQuery( + cw1WhitelistQueries.adminsIfCw1Whitelist(queryClient, { + chainId, + contractAddress: address, + }) + ) + .then((admins): Promise | undefined => { + if (!admins) { + return + } + + return Promise.all( + admins.map((admin) => + ignoreEntities?.includes(admin) + ? // Placeholder entity to prevent infinite loop. + { + chainId, + type: EntityType.Wallet, + address: admin, + name: null, + imageUrl: getFallbackImage(admin), + } + : queryClient.fetchQuery( + entityQueries.info(queryClient, { + chainId, + address: admin, + // Add address to ignore list to prevent infinite loops. + ignoreEntities: [...(ignoreEntities || []), address], + }) + ) + ) + ) + }) + .catch(() => undefined), + ]) + + if (daoInfo) { + return { + type: EntityType.Dao, + daoInfo, + chainId, + address, + name: daoInfo.name, + imageUrl: daoInfo.imageUrl || getFallbackImage(address), + } + } else if (entityFromPolytoneProxy) { + return entityFromPolytoneProxy + } else if (cw1WhitelistAdminEntities) { + return { + type: EntityType.Cw1Whitelist, + chainId, + address, + name: null, + imageUrl: getFallbackImage(address), + entities: cw1WhitelistAdminEntities, + } + } else { + // Default to wallet. + return { + type: EntityType.Wallet, + chainId, + address, + name: walletProfile?.name || null, + imageUrl: walletProfile?.imageUrl || getFallbackImage(address), + profile: walletProfile, + } + } +} + +export const entityQueries = { + /** + * Fetch entity. + */ + info: ( + queryClient: QueryClient, + // If undefined, query will be disabled. + options?: Parameters[1] + ) => + queryOptions({ + queryKey: ['entity', 'info', options], + queryFn: options + ? () => fetchEntityInfo(queryClient, options) + : skipToken, + }), +} diff --git a/packages/stateful/queries/index.ts b/packages/stateful/queries/index.ts new file mode 100644 index 000000000..5ea48df29 --- /dev/null +++ b/packages/stateful/queries/index.ts @@ -0,0 +1,2 @@ +export * from './dao' +export * from './entity' diff --git a/packages/stateful/recoil/selectors/dao.ts b/packages/stateful/recoil/selectors/dao.ts index 112c64872..ed0975dbb 100644 --- a/packages/stateful/recoil/selectors/dao.ts +++ b/packages/stateful/recoil/selectors/dao.ts @@ -11,26 +11,21 @@ import { DaoVotingCw20StakedSelectors, accountsSelector, contractInfoSelector, - contractInstantiateTimeSelector, contractVersionSelector, daoDropdownInfoSelector, - daoParentInfoSelector, daoTvlSelector, daoVetoableDaosSelector, followingDaosSelector, govProposalsSelector, isDaoSelector, - moduleAddressSelector, nativeDelegatedBalanceSelector, + queryClientAtom, queryWalletIndexerSelector, refreshProposalsIdAtom, - reverseLookupPolytoneProxySelector, } from '@dao-dao/state' import { DaoCardLazyData, - DaoInfo, DaoPageMode, - DaoParentInfo, DaoSource, DaoWithDropdownVetoableProposalList, DaoWithVetoableProposals, @@ -41,11 +36,8 @@ import { } from '@dao-dao/types' import { DaoVotingCw20StakedAdapterId, - getDaoInfoForChainId, getDaoProposalPath, - getFallbackImage, getSupportedChainConfig, - getSupportedFeatures, isConfiguredChainName, } from '@dao-dao/utils' @@ -79,6 +71,8 @@ export const daoCardLazyDataSelector = selectorFamily< if (govContractAddress) { coreAddress = govContractAddress } else { + // Use chain x/gov module info. + // Get proposal count by loading one proposal and getting the total. const { total: proposalCount } = get( govProposalsSelector({ @@ -154,58 +148,6 @@ export const daoCardLazyDataSelector = selectorFamily< }, }) -export const subDaoInfosSelector = selectorFamily< - DaoInfo[], - WithChainId<{ coreAddress: string }> ->({ - key: 'subDaoInfos', - get: - ({ coreAddress: contractAddress, chainId }) => - ({ get }) => { - const subDaos = get( - DaoCoreV2Selectors.listAllSubDaosSelector({ - contractAddress, - chainId, - }) - ) - - return get( - waitForAll( - subDaos.map(({ chainId, addr }) => - daoInfoSelector({ - chainId, - coreAddress: addr, - }) - ) - ) - ) - }, -}) - -export const chainSubDaoInfosSelector = selectorFamily< - DaoInfo[], - { chainId: string } ->({ - key: 'chainSubDaoInfos', - get: - ({ chainId }) => - ({ get }) => { - const subDaos = getSupportedChainConfig(chainId)?.subDaos || [] - return subDaos.length - ? get( - waitForAll( - subDaos.map((coreAddress) => - daoInfoSelector({ - chainId, - coreAddress, - }) - ) - ) - ) - : [] - }, -}) - export const followingDaosWithProposalModulesSelector = selectorFamily< (DaoSource & { proposalModules: ProposalModule[] @@ -248,6 +190,7 @@ export const daoCoreProposalModulesSelector = selectorFamily< get: ({ coreAddress, chainId }) => async ({ get }) => { + const queryClient = get(queryClientAtom) const coreVersion = get( contractVersionSelector({ contractAddress: coreAddress, @@ -255,7 +198,12 @@ export const daoCoreProposalModulesSelector = selectorFamily< }) ) - return await fetchProposalModules(chainId, coreAddress, coreVersion) + return await fetchProposalModules( + queryClient, + chainId, + coreAddress, + coreVersion + ) }, }) @@ -312,215 +260,6 @@ export const daoCw20GovernanceTokenAddressSelector = selectorFamily< }, }) -export const daoInfoSelector = selectorFamily< - DaoInfo, - { - chainId: string - coreAddress: string - } ->({ - key: 'daoInfo', - get: - ({ chainId, coreAddress }) => - ({ get }) => { - // Native chain governance. - if (isConfiguredChainName(chainId, coreAddress)) { - // If chain uses a contract-based DAO, load it instead. - const govContractAddress = - getSupportedChainConfig(chainId)?.govContractAddress - if (govContractAddress) { - coreAddress = govContractAddress - } else { - const govModuleAddress = get( - moduleAddressSelector({ - chainId, - name: 'gov', - }) - ) - const accounts = get( - accountsSelector({ - chainId, - address: govModuleAddress, - }) - ) - - return getDaoInfoForChainId(chainId, accounts) - } - } - - // Otherwise get DAO info from contract. - - const dumpState = get( - DaoCoreV2Selectors.dumpStateSelector({ - contractAddress: coreAddress, - chainId, - params: [], - }) - ) - if (!dumpState) { - throw new Error('DAO failed to dump state.') - } - - const [ - // Non-loadables - [ - coreVersion, - votingModuleInfo, - proposalModules, - created, - _items, - polytoneProxies, - accounts, - ], - // Loadables - [isActiveResponse, activeThresholdResponse], - ] = get( - waitForAll([ - // Non-loadables - waitForAll([ - contractVersionSelector({ - contractAddress: coreAddress, - chainId, - }), - contractInfoSelector({ - contractAddress: dumpState.voting_module, - chainId, - }), - daoCoreProposalModulesSelector({ - coreAddress, - chainId, - }), - contractInstantiateTimeSelector({ - address: coreAddress, - chainId, - }), - DaoCoreV2Selectors.listAllItemsSelector({ - contractAddress: coreAddress, - chainId, - }), - DaoCoreV2Selectors.polytoneProxiesSelector({ - contractAddress: coreAddress, - chainId, - }), - accountsSelector({ - address: coreAddress, - chainId, - }), - ]), - // Loadables - waitForAllSettled([ - // All voting modules use the same active threshold queries, so it's - // safe to use the cw20-staked selector. - DaoVotingCw20StakedSelectors.isActiveSelector({ - contractAddress: dumpState.voting_module, - chainId, - params: [], - }), - DaoVotingCw20StakedSelectors.activeThresholdSelector({ - contractAddress: dumpState.voting_module, - chainId, - params: [], - }), - ]), - ]) - ) - - const votingModuleContractName = - votingModuleInfo?.info.contract || 'fallback' - - // Some voting modules don't support the isActive query, so if the query - // fails, assume active. - const isActive = - isActiveResponse.state === 'hasError' || - (isActiveResponse.state === 'hasValue' && - isActiveResponse.contents.active) - const activeThreshold = - (activeThresholdResponse.state === 'hasValue' && - activeThresholdResponse.contents.active_threshold) || - null - - // Convert items list into map. - const items = _items.reduce( - (acc, [key, value]) => ({ - ...acc, - [key]: value, - }), - {} as Record - ) - - const { admin } = dumpState - - const parentDao: DaoParentInfo | null = - admin && admin !== coreAddress - ? get( - daoParentInfoSelector({ - chainId, - parentAddress: admin, - childAddress: coreAddress, - }) - ) || null - : null - - const daoInfo: DaoInfo = { - chainId, - coreAddress, - coreVersion, - supportedFeatures: getSupportedFeatures(coreVersion), - votingModuleAddress: dumpState.voting_module, - votingModuleContractName, - proposalModules, - name: dumpState.config.name, - description: dumpState.config.description, - imageUrl: dumpState.config.image_url || getFallbackImage(coreAddress), - created: created?.getTime() || null, - isActive, - activeThreshold, - items, - polytoneProxies, - accounts, - parentDao, - admin, - } - - return daoInfo - }, -}) - -export const daoInfoFromPolytoneProxySelector = selectorFamily< - | { - chainId: string - coreAddress: string - info: DaoInfo - } - | undefined, - WithChainId<{ proxy: string }> ->({ - key: 'daoInfoFromPolytoneProxy', - get: - (params) => - ({ get }) => { - const { chainId, address } = - get(reverseLookupPolytoneProxySelector(params)) ?? {} - if (!chainId || !address) { - return - } - - // Get DAO info on source chain. - const info = get( - daoInfoSelector({ - chainId, - coreAddress: address, - }) - ) - - return { - chainId, - coreAddress: address, - info, - } - }, -}) - /** * Proposals which this DAO can currently veto. */ diff --git a/packages/stateful/recoil/selectors/entity.ts b/packages/stateful/recoil/selectors/entity.ts deleted file mode 100644 index 716efa7c5..000000000 --- a/packages/stateful/recoil/selectors/entity.ts +++ /dev/null @@ -1,186 +0,0 @@ -import { - RecoilValueReadOnly, - constSelector, - selectorFamily, - waitForAll, - waitForAllSettled, -} from 'recoil' - -import { - Cw1WhitelistSelectors, - isDaoSelector, - isPolytoneProxySelector, - moduleNameForAddressSelector, - profileSelector, -} from '@dao-dao/state/recoil' -import { Entity, EntityType, WithChainId } from '@dao-dao/types' -import { - getChainForChainId, - getFallbackImage, - getImageUrlForChainId, - isConfiguredChainName, - isValidWalletAddress, -} from '@dao-dao/utils' - -import { daoInfoFromPolytoneProxySelector, daoInfoSelector } from './dao' - -// Load entity from address on chain, whether it's a wallet address, a DAO, or a -// DAO's polytone account. -export const entitySelector: ( - param: WithChainId<{ - address: string - // Prevent infinite loop if cw1-whitelist nests itself. - ignoreEntities?: string[] - }> -) => RecoilValueReadOnly = selectorFamily({ - key: 'entity', - get: - ({ chainId, address, ignoreEntities }) => - ({ get }) => { - const { bech32_prefix: bech32Prefix } = getChainForChainId(chainId) - - // Check if address is module account. - const moduleName = get( - waitForAllSettled([ - moduleNameForAddressSelector({ - chainId, - address, - }), - ]) - )[0].valueMaybe() - if (moduleName) { - const entity: Entity = { - type: EntityType.Module, - chainId, - address, - name: moduleName, - imageUrl: getImageUrlForChainId(chainId), - } - return entity - } - - const [isDao, isPolytoneProxy, cw1WhitelistAdmins] = address - ? get( - waitForAllSettled([ - isConfiguredChainName(chainId, address) - ? constSelector(true) - : isDaoSelector({ - chainId, - address, - }), - isPolytoneProxySelector({ - chainId, - address, - }), - Cw1WhitelistSelectors.adminsIfCw1Whitelist({ - chainId, - contractAddress: address, - }), - ]) - ) - : [] - - const [ - daoInfoLoadable, - daoInfoFromPolytoneProxyLoadable, - profileLoadable, - cw1WhitelistEntitiesLoadable, - ] = get( - waitForAllSettled([ - // Try to load config assuming the address is a DAO. - isDao?.state === 'hasValue' && isDao.contents - ? daoInfoSelector({ - chainId, - coreAddress: address, - }) - : constSelector(undefined), - isPolytoneProxy?.state === 'hasValue' && isPolytoneProxy.contents - ? daoInfoFromPolytoneProxySelector({ - chainId, - proxy: address, - }) - : constSelector(undefined), - // Try to load profile assuming the address is a wallet. - address && isValidWalletAddress(address, bech32Prefix) - ? profileSelector({ - chainId, - address, - }) - : constSelector(undefined), - // Try to load all contained entities for cw1-whitelist. - cw1WhitelistAdmins?.state === 'hasValue' && - cw1WhitelistAdmins.contents - ? waitForAll( - cw1WhitelistAdmins.contents.map((entityAddress) => - ignoreEntities?.includes(entityAddress) - ? // Placeholder entity to prevent infinite loop. - constSelector({ - chainId, - type: EntityType.Wallet, - address: entityAddress, - name: null, - imageUrl: getFallbackImage(entityAddress), - } as const) - : entitySelector({ - chainId, - address: entityAddress, - // Prevent infinite loop if cw1-whitelist nests itself. - ignoreEntities: [...(ignoreEntities || []), address], - }) - ) - ) - : constSelector(undefined), - ]) - ) - - const daoInfo = daoInfoLoadable.valueMaybe() - const daoInfoFromPolytoneProxy = - daoInfoFromPolytoneProxyLoadable.valueMaybe() - const profile = profileLoadable.valueMaybe() - const cw1WhitelistEntities = cw1WhitelistEntitiesLoadable.valueMaybe() - - if (daoInfo) { - return { - type: EntityType.Dao, - daoInfo, - chainId, - address, - name: daoInfo.name, - imageUrl: daoInfo.imageUrl || getFallbackImage(address), - } - } else if (daoInfoFromPolytoneProxy) { - return { - type: EntityType.Dao, - daoInfo: daoInfoFromPolytoneProxy.info, - polytoneProxy: { - chainId, - address, - }, - chainId: daoInfoFromPolytoneProxy.chainId, - address: daoInfoFromPolytoneProxy.coreAddress, - name: daoInfoFromPolytoneProxy.info.name, - imageUrl: - daoInfoFromPolytoneProxy.info.imageUrl || - getFallbackImage(daoInfoFromPolytoneProxy.coreAddress), - } - } else if (cw1WhitelistEntities) { - return { - type: EntityType.Cw1Whitelist, - chainId, - address, - name: null, - imageUrl: getFallbackImage(address), - entities: cw1WhitelistEntities, - } - } else { - return { - type: EntityType.Wallet, - chainId, - address, - name: profile?.name || null, - imageUrl: profile?.imageUrl || getFallbackImage(address), - profile: profile, - } - } - }, -}) diff --git a/packages/stateful/recoil/selectors/index.ts b/packages/stateful/recoil/selectors/index.ts index 5c0012a46..8eb7e6071 100644 --- a/packages/stateful/recoil/selectors/index.ts +++ b/packages/stateful/recoil/selectors/index.ts @@ -1,3 +1,2 @@ export * from './dao' -export * from './entity' export * from './proposal' diff --git a/packages/stateful/server/makeGetDaoStaticProps.ts b/packages/stateful/server/makeGetDaoStaticProps.ts index f901eeb67..06616a293 100644 --- a/packages/stateful/server/makeGetDaoStaticProps.ts +++ b/packages/stateful/server/makeGetDaoStaticProps.ts @@ -1,72 +1,45 @@ import { Chain } from '@chain-registry/types' import { fromBase64 } from '@cosmjs/encoding' +import { QueryClient } from '@tanstack/react-query' import type { GetStaticProps, GetStaticPropsResult, Redirect } from 'next' import { TFunction } from 'next-i18next' import removeMarkdown from 'remove-markdown' import { serverSideTranslationsWithServerT } from '@dao-dao/i18n/serverSideTranslations' import { - DaoCoreV2QueryClient, - DaoVotingCw20StakedQueryClient, - PolytoneNoteQueryClient, + contractQueries, + dehydrateSerializable, + makeReactQueryClient, + polytoneQueries, queryIndexer, } from '@dao-dao/state' import { - Account, - AccountType, - ActiveThreshold, ChainId, CommonProposalInfo, ContractVersion, - ContractVersionInfo, + DaoInfo, DaoPageMode, - DaoParentInfo, - Feature, GovProposalVersion, GovProposalWithDecodedContent, - IndexerDumpState, - InfoResponse, - PolytoneProxies, - ProposalModule, ProposalV1, ProposalV1Beta1, - SupportedFeatureMap, } from '@dao-dao/types' -import { - Config, - ListItemsResponse, - ProposalModuleWithInfo, -} from '@dao-dao/types/contracts/DaoCore.v2' import { cosmos } from '@dao-dao/types/protobuf' import { CI, - ContractName, DAO_CORE_ACCENT_ITEM_KEY, DAO_STATIC_PROPS_CACHE_SECONDS, - INVALID_CONTRACT_ERROR_SUBSTRINGS, LEGACY_DAO_CONTRACT_NAMES, LEGACY_URL_PREFIX, MAINNET, MAX_META_CHARS_PROPOSAL_DESCRIPTION, - addressIsModule, - cosmWasmClientRouter, cosmosSdkVersionIs46OrHigher, decodeGovProposal, getChainForChainId, - getChainGovernanceDaoDescription, getChainIdForAddress, getConfiguredGovChainByName, getDaoPath, - getDisplayNameForChainId, - getFallbackImage, - getImageUrlForChainId, getRpcForChainId, - getSupportedChainConfig, - getSupportedFeatures, - isFeatureSupportedByVersion, - isValidBech32Address, - parseContractVersion, - polytoneNoteProxyMapToChainIdMap, processError, retry, } from '@dao-dao/utils' @@ -76,17 +49,13 @@ import { ProposalModuleAdapterError, matchAndLoadAdapter, } from '../proposal-module-adapter' -import { - fetchProposalModules, - fetchProposalModulesWithInfoFromChain, -} from '../utils/fetchProposalModules' +import { daoQueries } from '../queries/dao' interface GetDaoStaticPropsMakerProps { leadingTitle?: string followingTitle?: string overrideTitle?: string overrideDescription?: string - overrideImageUrl?: string additionalProps?: Record | null | undefined url?: string } @@ -97,10 +66,9 @@ interface GetDaoStaticPropsMakerOptions { getProps?: (options: { context: Parameters[0] t: TFunction + queryClient: QueryClient chain: Chain - coreAddress: string - coreVersion: ContractVersion - proposalModules: ProposalModule[] + daoInfo: DaoInfo }) => | GetDaoStaticPropsMakerProps | undefined @@ -138,238 +106,72 @@ export const makeGetDaoStaticProps: GetDaoStaticPropsMaker = // Check if address is actually the name of a chain so we can resolve the // gov module. - let chainConfig = + const configuredGovChain = coreAddress && typeof coreAddress === 'string' ? getConfiguredGovChainByName(coreAddress) : undefined - // If chain uses a contract-based DAO, load it instead. - const govContractAddress = - chainConfig && - getSupportedChainConfig(chainConfig.chainId)?.govContractAddress - if (govContractAddress) { - coreAddress = govContractAddress - chainConfig = undefined - } - - // Load chain gov module. - if (chainConfig) { - const { name: chainName, chain, accentColor } = chainConfig - - // Must be called after server side translations has been awaited, because - // props may use the `t` function, and it won't be available until after. - const { - leadingTitle, - followingTitle, - overrideTitle, - overrideDescription, - additionalProps, - url, - } = - (await getProps?.({ - context, - t: serverT, - chain, - coreAddress: chainName, - coreVersion: ContractVersion.Gov, - proposalModules: [], - })) ?? {} - - const description = - overrideDescription ?? getChainGovernanceDaoDescription(chain.chain_id) - const props: DaoPageWrapperProps = { - ...i18nProps, - url: url ?? null, - title: - overrideTitle ?? - [ - leadingTitle?.trim(), - getDisplayNameForChainId(chain.chain_id), - followingTitle?.trim(), - ] - .filter(Boolean) - .join(' | '), - description, - accentColor, - info: { - chainId: chain.chain_id, - coreAddress: chainName, - coreVersion: ContractVersion.Gov, - supportedFeatures: Object.values(Feature).reduce( - (acc, feature) => ({ - ...acc, - [feature]: false, - }), - {} as SupportedFeatureMap - ), - votingModuleAddress: '', - votingModuleContractName: '', - proposalModules: [], - name: getDisplayNameForChainId(chain.chain_id), - description, - imageUrl: getImageUrlForChainId(chain.chain_id), - created: null, - isActive: true, - activeThreshold: null, - items: {}, - polytoneProxies: {}, - accounts: [ - { - type: AccountType.Native, - chainId: chain.chain_id, - address: chainConfig.name, - }, - ], - parentDao: null, - admin: '', - }, - ...additionalProps, - } - - return { - props, - // No need to regenerate this page as the props for a chain's DAO are - // constant. The values above can only change when a new version of the - // frontend is deployed, in which case the static pages will regenerate. - revalidate: false, - } - } - - // Get chain ID for address based on prefix. - let decodedChainId: string - try { - // If invalid address, display not found. - if (!coreAddress || typeof coreAddress !== 'string') { - throw new Error('Invalid address') - } - - decodedChainId = getChainIdForAddress(coreAddress) - - // Validation throws error if address prefix not recognized. Display not - // found in this case. - } catch (err) { - console.error(err) - - // Excluding `info` will render DAONotFound. - return { - props: { - ...i18nProps, - title: serverT('title.daoNotFound'), - description: err instanceof Error ? err.message : `${err}`, - }, - } - } + const queryClient = makeReactQueryClient() const getForChainId = async ( chainId: string ): Promise> => { // If address is polytone proxy, redirect to DAO on native chain. - try { - const addressInfo = await queryIndexer({ - type: 'contract', - chainId, - address: coreAddress, - formula: 'info', - }) - if ( - addressInfo && - addressInfo.contract === ContractName.PolytoneProxy - ) { - // Get voice for this proxy on destination chain. - const voice = await queryIndexer({ - type: 'contract', - chainId, - // proxy - address: coreAddress, - formula: 'polytone/proxy/instantiator', - }) - - const dao = await queryIndexer({ - type: 'contract', - chainId, - address: voice, - formula: 'polytone/voice/remoteController', - args: { - // proxy + if (!configuredGovChain) { + try { + const isPolytoneProxy = await queryClient.fetchQuery( + contractQueries.isPolytoneProxy(queryClient, { + chainId, address: coreAddress, - }, - }) + }) + ) + if (isPolytoneProxy) { + const { remoteAddress } = await queryClient.fetchQuery( + polytoneQueries.reverseLookupProxy(queryClient, { + chainId, + address: coreAddress, + }) + ) - return { - redirect: { - destination: getDaoPath(appMode, dao), - permanent: true, - }, + return { + redirect: { + destination: getDaoPath(appMode, remoteAddress), + permanent: true, + }, + } } + } catch { + // If failed, ignore. } - } catch { - // If failed, ignore. } // Add to Sentry error tags if error occurs. - let coreVersion: ContractVersion | undefined + let daoInfo: DaoInfo | undefined try { - const { - admin, - config, - version, - votingModule: { - address: votingModuleAddress, - info: votingModuleInfo, - }, - activeProposalModules, - created, - isActive, - activeThreshold, - parentDao, - items: _items, - polytoneProxies, - } = await daoCoreDumpState(chainId, coreAddress, serverT) - coreVersion = version - - // If no contract name, will display fallback voting module adapter. - const votingModuleContractName = - (votingModuleInfo && - 'contract' in votingModuleInfo && - votingModuleInfo.contract) || - 'fallback' - - // Get DAO proposal modules. - const proposalModules = await fetchProposalModules( - chainId, - coreAddress, - coreVersion, - activeProposalModules - ) - - // Convert items list into map. - const items = _items.reduce( - (acc, [key, value]) => ({ - ...acc, - [key]: value, - }), - {} as Record - ) + // Check for legacy contract. + const contractInfo = !configuredGovChain + ? ( + await queryClient.fetchQuery( + contractQueries.info(queryClient, { + chainId, + address: coreAddress, + }) + ) + )?.info + : undefined + if ( + contractInfo && + LEGACY_DAO_CONTRACT_NAMES.includes(contractInfo.contract) + ) { + throw new LegacyDaoError() + } - const accounts: Account[] = [ - // Current chain. - { + daoInfo = await queryClient.fetchQuery( + daoQueries.info(queryClient, { chainId, - address: coreAddress, - type: AccountType.Native, - }, - // Polytone. - ...Object.entries(polytoneProxies).map( - ([chainId, address]): Account => ({ - chainId, - address, - type: AccountType.Polytone, - }) - ), - // The above accounts are the ones we already have. The rest of the - // accounts are loaded once the page loads (in `DaoPageWrapper`) since - // they are more complex and will probably expand over time. - ] + coreAddress, + }) + ) // Must be called after server side translations has been awaited, // because props may use the `t` function, and it won't be available @@ -379,60 +181,52 @@ export const makeGetDaoStaticProps: GetDaoStaticPropsMaker = followingTitle, overrideTitle, overrideDescription, - overrideImageUrl, additionalProps, url, } = (await getProps?.({ context, t: serverT, + queryClient, chain: getChainForChainId(chainId), - coreAddress, - coreVersion, - proposalModules, + daoInfo, })) ?? {} + const title = + overrideTitle ?? + [leadingTitle?.trim(), daoInfo.name, followingTitle?.trim()] + .filter(Boolean) + .join(' | ') + const description = overrideDescription ?? daoInfo.description + const accentColor = + // If viewing configured gov chain, use its accent color. + configuredGovChain?.accentColor || + daoInfo.items[DAO_CORE_ACCENT_ITEM_KEY] || + null + const props: DaoPageWrapperProps = { ...i18nProps, url: url ?? null, - title: - overrideTitle ?? - [leadingTitle?.trim(), config.name.trim(), followingTitle?.trim()] - .filter(Boolean) - .join(' | '), - description: overrideDescription ?? config.description, - accentColor: items[DAO_CORE_ACCENT_ITEM_KEY] || null, - info: { - chainId, - coreAddress, - coreVersion, - supportedFeatures: getSupportedFeatures(coreVersion), - votingModuleAddress, - votingModuleContractName, - proposalModules, - name: config.name, - description: config.description, - imageUrl: - overrideImageUrl || - config.image_url || - getFallbackImage(coreAddress), - created: created?.getTime() ?? null, - isActive, - activeThreshold, - items, - polytoneProxies, - accounts, - parentDao, - admin: admin ?? null, - }, + title, + description, + accentColor, + info: daoInfo, + reactQueryDehydratedState: dehydrateSerializable(queryClient), ...additionalProps, } return { props, - // Regenerate the page at most once per `revalidate` seconds. Serves - // cached copy and refreshes in background. - revalidate: DAO_STATIC_PROPS_CACHE_SECONDS, + // For chain governance DAOs: no need to regenerate this page for + // since the props are constant. The values above can only change when + // a new version of the frontend is deployed, in which case the static + // pages will regenerate. + // + // For real DAOs, revalidate the page at most once per `revalidate` + // seconds. Serves cached copy and refreshes in background. + revalidate: configuredGovChain + ? false + : DAO_STATIC_PROPS_CACHE_SECONDS, } } catch (error) { // Redirect. @@ -476,6 +270,7 @@ export const makeGetDaoStaticProps: GetDaoStaticPropsMaker = ...i18nProps, title: 'DAO not found', description: '', + reactQueryDehydratedState: dehydrateSerializable(queryClient), }, // Regenerate the page at most once per second. Serves cached copy // and refreshes in background. @@ -489,11 +284,13 @@ export const makeGetDaoStaticProps: GetDaoStaticPropsMaker = ...i18nProps, title: serverT('title.500'), description: '', + reactQueryDehydratedState: dehydrateSerializable(queryClient), // Report to Sentry. error: processError(error, { tags: { + chainId, coreAddress, - coreVersion: coreVersion ?? '', + coreVersion: daoInfo?.coreVersion ?? '', }, extra: { context }, }), @@ -505,21 +302,52 @@ export const makeGetDaoStaticProps: GetDaoStaticPropsMaker = } } - const result = await getForChainId(decodedChainId) + let result + if (configuredGovChain) { + result = await getForChainId(configuredGovChain.chainId) + } else { + // Get chain ID for address based on prefix. + let decodedChainId: string + try { + // If invalid address, display not found. + if (!coreAddress || typeof coreAddress !== 'string') { + throw new Error('Invalid address') + } + + decodedChainId = getChainIdForAddress(coreAddress) + + // Validation throws error if address prefix not recognized. Display not + // found in this case. + } catch (err) { + console.error(err) - // If not found on Terra, try Terra Classic. Let redirects and errors - // through. - if ( - MAINNET && - 'props' in result && - // If no info, no DAO found. - !result.props.info && - // Don't try Terra Classic if unexpected error occurred. - !result.props.error && - // Only try Terra Classic if Terra failed. - decodedChainId === ChainId.TerraMainnet - ) { - return await getForChainId(ChainId.TerraClassicMainnet) + // Excluding `info` will render DAONotFound. + return { + props: { + ...i18nProps, + title: serverT('title.daoNotFound'), + description: err instanceof Error ? err.message : `${err}`, + reactQueryDehydratedState: dehydrateSerializable(queryClient), + }, + } + } + + result = await getForChainId(decodedChainId) + + // If not found on Terra, try Terra Classic. Let redirects and errors + // through. + if ( + MAINNET && + 'props' in result && + // If no info, no DAO found. + !result.props.info && + // Don't try Terra Classic if unexpected error occurred. + !result.props.error && + // Only try Terra Classic if Terra failed. + decodedChainId === ChainId.TerraMainnet + ) { + result = await getForChainId(ChainId.TerraClassicMainnet) + } } return result @@ -540,14 +368,7 @@ export const makeGetDaoProposalStaticProps = ({ }: GetDaoProposalStaticPropsMakerOptions) => makeGetDaoStaticProps({ ...options, - getProps: async ({ - context: { params = {} }, - t, - chain, - coreVersion, - coreAddress, - proposalModules, - }) => { + getProps: async ({ context: { params = {} }, t, chain, daoInfo }) => { const proposalId = params[proposalIdParamKey] // If invalid proposal ID, not found. @@ -561,7 +382,7 @@ export const makeGetDaoProposalStaticProps = ({ } // Gov module. - if (coreVersion === ContractVersion.Gov) { + if (daoInfo.coreVersion === ContractVersion.Gov) { const url = getProposalUrlPrefix(params) + proposalId const client = await retry( @@ -726,9 +547,9 @@ export const makeGetDaoProposalStaticProps = ({ adapter: { functions: { getProposalInfo }, }, - } = await matchAndLoadAdapter(proposalModules, proposalId, { + } = await matchAndLoadAdapter(daoInfo.proposalModules, proposalId, { chain, - coreAddress, + coreAddress: daoInfo.coreAddress, }) // If proposal is numeric, i.e. has no prefix, redirect to prefixed URL. @@ -778,410 +599,3 @@ export const makeGetDaoProposalStaticProps = ({ export class RedirectError { constructor(public redirect: Redirect) {} } - -const loadParentDaoInfo = async ( - chainId: string, - subDaoAddress: string, - potentialParentAddress: string | null | undefined, - serverT: TFunction, - // Prevent cycles by ensuring admin has not already been seen. - previousParentAddresses: string[] -): Promise | null> => { - // If no admin, or admin is set to itself, or admin is a wallet, no parent - // DAO. - if ( - !potentialParentAddress || - potentialParentAddress === subDaoAddress || - previousParentAddresses?.includes(potentialParentAddress) - ) { - return null - } - - try { - // Check if address is chain module account. - const cosmosClient = await retry( - 10, - async (attempt) => - ( - await cosmos.ClientFactory.createRPCQueryClient({ - rpcEndpoint: getRpcForChainId(chainId, attempt - 1), - }) - ).cosmos - ) - // If chain module gov account... - if (await addressIsModule(cosmosClient, potentialParentAddress, 'gov')) { - const chainConfig = getSupportedChainConfig(chainId) - return chainConfig - ? { - chainId, - coreAddress: chainConfig.name, - coreVersion: ContractVersion.Gov, - name: getDisplayNameForChainId(chainId), - imageUrl: getImageUrlForChainId(chainId), - parentDao: null, - admin: '', - } - : null - } - - if ( - !isValidBech32Address( - potentialParentAddress, - getChainForChainId(chainId).bech32_prefix - ) - ) { - return null - } - - const { - admin, - version, - config: { name, image_url }, - parentDao, - } = await daoCoreDumpState(chainId, potentialParentAddress, serverT, [ - ...(previousParentAddresses ?? []), - potentialParentAddress, - ]) - - return { - chainId, - coreAddress: potentialParentAddress, - coreVersion: version, - name: name, - imageUrl: image_url ?? null, - parentDao, - admin: admin ?? null, - } - } catch (err) { - // If contract not found, ignore error. Otherwise, log it. - if ( - !(err instanceof Error) || - !INVALID_CONTRACT_ERROR_SUBSTRINGS.some((substring) => - (err as Error).message.includes(substring) - ) - ) { - console.error(err) - console.error( - `Error loading parent DAO (${potentialParentAddress}) of ${subDaoAddress}`, - processError(err) - ) - } - - // Don't prevent page render if failed to load parent DAO info. - return null - } -} - -const ITEM_LIST_LIMIT = 30 - -interface DaoCoreDumpState { - admin: string - config: Config - version: ContractVersion - votingModule: { - address: string - info: ContractVersionInfo - } - activeProposalModules: ProposalModuleWithInfo[] - created: Date | undefined - parentDao: DaoParentInfo | null - items: ListItemsResponse - polytoneProxies: PolytoneProxies - isActive: boolean - activeThreshold: ActiveThreshold | null -} - -const daoCoreDumpState = async ( - chainId: string, - coreAddress: string, - serverT: TFunction, - // Prevent cycles by ensuring admin has not already been seen. - previousParentAddresses?: string[] -): Promise => { - const cwClient = await retry( - 10, - async (attempt) => - await cosmWasmClientRouter.connect(getRpcForChainId(chainId, attempt - 1)) - ) - - try { - const [indexerDumpedState, items] = await Promise.all([ - queryIndexer({ - type: 'contract', - address: coreAddress, - formula: 'daoCore/dumpState', - chainId, - }), - queryIndexer({ - type: 'contract', - address: coreAddress, - formula: 'daoCore/listItems', - chainId, - }), - ]) - - // Use data from indexer if present. - if (indexerDumpedState) { - if ( - LEGACY_DAO_CONTRACT_NAMES.includes(indexerDumpedState.version?.contract) - ) { - throw new LegacyDaoError() - } - - const coreVersion = parseContractVersion( - indexerDumpedState.version.version - ) - if (!coreVersion) { - throw new Error(serverT('error.failedParsingCoreVersion')) - } - - const { admin } = indexerDumpedState - - const parentDaoInfo = await loadParentDaoInfo( - chainId, - coreAddress, - admin, - serverT, - [...(previousParentAddresses ?? []), coreAddress] - ) - - // Convert to chainId -> proxy map. - const polytoneProxies = polytoneNoteProxyMapToChainIdMap( - chainId, - indexerDumpedState.polytoneProxies || {} - ) - - let isActive = true - let activeThreshold: ActiveThreshold | null = null - try { - // All voting modules use the same active queries, so it's safe to just - // use one here. - const client = new DaoVotingCw20StakedQueryClient( - cwClient, - indexerDumpedState.voting_module - ) - isActive = (await client.isActive()).active - activeThreshold = - (await client.activeThreshold()).active_threshold || null - } catch { - // Some voting modules don't support the active queries, so if they - // fail, assume it's active. - } - - return { - ...indexerDumpedState, - version: coreVersion, - votingModule: { - address: indexerDumpedState.voting_module, - info: indexerDumpedState.votingModuleInfo, - }, - activeProposalModules: indexerDumpedState.proposal_modules.filter( - ({ status }) => status === 'enabled' || status === 'Enabled' - ), - created: indexerDumpedState.createdAt - ? new Date(indexerDumpedState.createdAt) - : undefined, - isActive, - activeThreshold, - items: items || [], - parentDao: parentDaoInfo - ? { - ...parentDaoInfo, - // Whether or not this parent has registered its child as a - // SubDAO. - registeredSubDao: - indexerDumpedState.adminInfo?.registeredSubDao ?? - (parentDaoInfo.coreVersion === ContractVersion.Gov && - getSupportedChainConfig(chainId)?.subDaos?.includes( - coreAddress - )) ?? - false, - } - : null, - polytoneProxies, - } - } - } catch (error) { - // Rethrow if legacy DAO. - if (error instanceof LegacyDaoError) { - throw error - } - - // Ignore error. Fallback to querying chain below. - console.error(error, processError(error)) - } - - const daoCoreClient = new DaoCoreV2QueryClient(cwClient, coreAddress) - - const dumpedState = await daoCoreClient.dumpState() - if (LEGACY_DAO_CONTRACT_NAMES.includes(dumpedState.version.contract)) { - throw new LegacyDaoError() - } - - const [coreVersion, { info: votingModuleInfo }] = await Promise.all([ - parseContractVersion(dumpedState.version.version), - (await cwClient.queryContractSmart(dumpedState.voting_module, { - info: {}, - })) as InfoResponse, - ]) - - if (!coreVersion) { - throw new Error(serverT('error.failedParsingCoreVersion')) - } - - const proposalModules = await fetchProposalModulesWithInfoFromChain( - chainId, - coreAddress, - coreVersion - ) - - // Get all items. - const items: ListItemsResponse = [] - while (true) { - const _items = await daoCoreClient.listItems({ - startAfter: items[items.length - 1]?.[0], - limit: ITEM_LIST_LIMIT, - }) - if (!_items.length) { - break - } - - items.push(..._items) - - // If we got less than the limit, we've reached the end. - if (_items.length < ITEM_LIST_LIMIT) { - break - } - } - - let isActive = true - let activeThreshold: ActiveThreshold | null = null - try { - // All voting modules use the same active queries, so it's safe to just use - // one here. - const client = new DaoVotingCw20StakedQueryClient( - cwClient, - dumpedState.voting_module - ) - isActive = (await client.isActive()).active - activeThreshold = (await client.activeThreshold()).active_threshold || null - } catch { - // Some voting modules don't support the active queries, so if they fail, - // assume it's active. - } - - const { admin } = dumpedState - const parentDao = await loadParentDaoInfo( - chainId, - coreAddress, - admin, - serverT, - [...(previousParentAddresses ?? []), coreAddress] - ) - let registeredSubDao = false - // If parent DAO exists, check if this DAO is a SubDAO of the parent. - if (parentDao) { - if ( - parentDao.coreVersion !== ContractVersion.Gov && - isFeatureSupportedByVersion(Feature.SubDaos, parentDao.coreVersion) - ) { - const parentDaoCoreClient = new DaoCoreV2QueryClient(cwClient, admin) - - // Get all SubDAOs. - const subdaoAddrs: string[] = [] - while (true) { - const response = await parentDaoCoreClient.listSubDaos({ - startAfter: subdaoAddrs[subdaoAddrs.length - 1], - limit: SUBDAO_LIST_LIMIT, - }) - if (!response?.length) break - - subdaoAddrs.push(...response.map(({ addr }) => addr)) - - // If we have less than the limit of items, we've exhausted them. - if (response.length < SUBDAO_LIST_LIMIT) { - break - } - } - - registeredSubDao = subdaoAddrs.includes(coreAddress) - } else if (parentDao.coreVersion === ContractVersion.Gov) { - registeredSubDao = - !!getSupportedChainConfig(chainId)?.subDaos?.includes(coreAddress) - } - } - - // Get DAO polytone proxies. - const polytoneProxies = ( - await Promise.all( - Object.entries(getSupportedChainConfig(chainId)?.polytone || {}).map( - async ([chainId, { note }]) => { - let proxy - try { - proxy = await queryIndexer({ - type: 'contract', - address: note, - formula: 'polytone/note/remoteAddress', - args: { - address: coreAddress, - }, - chainId, - }) - } catch { - // Ignore error. - } - if (!proxy) { - const polytoneNoteClient = new PolytoneNoteQueryClient( - cwClient, - note - ) - proxy = - (await polytoneNoteClient.remoteAddress({ - localAddress: coreAddress, - })) || undefined - } - - return { - chainId, - proxy, - } - } - ) - ) - ).reduce( - (acc, { chainId, proxy }) => ({ - ...acc, - ...(proxy - ? { - [chainId]: proxy, - } - : {}), - }), - {} as PolytoneProxies - ) - - return { - ...dumpedState, - version: coreVersion, - votingModule: { - address: dumpedState.voting_module, - info: votingModuleInfo, - }, - activeProposalModules: proposalModules.filter( - ({ status }) => status === 'enabled' || status === 'Enabled' - ), - created: undefined, - isActive, - activeThreshold, - items, - parentDao: parentDao - ? { - ...parentDao, - registeredSubDao, - } - : null, - polytoneProxies, - } -} - -const SUBDAO_LIST_LIMIT = 30 diff --git a/packages/stateful/utils/fetchProposalModules.ts b/packages/stateful/utils/fetchProposalModules.ts index 1bd15e1cc..6ec65f889 100644 --- a/packages/stateful/utils/fetchProposalModules.ts +++ b/packages/stateful/utils/fetchProposalModules.ts @@ -1,8 +1,10 @@ +import { QueryClient } from '@tanstack/react-query' + import { CwCoreV1QueryClient, DaoCoreV2QueryClient, } from '@dao-dao/state/contracts' -import { queryIndexer } from '@dao-dao/state/indexer' +import { indexerQueries } from '@dao-dao/state/query' import { ContractVersion, Feature, @@ -24,6 +26,7 @@ import { import { matchAdapter } from '../proposal-module-adapter' export const fetchProposalModules = async ( + queryClient: QueryClient, chainId: string, coreAddress: string, coreVersion: ContractVersion, @@ -33,12 +36,13 @@ export const fetchProposalModules = async ( // Try indexer first. if (!activeProposalModules) { try { - activeProposalModules = await queryIndexer({ - type: 'contract', - address: coreAddress, - formula: 'daoCore/activeProposalModules', - chainId, - }) + activeProposalModules = await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress: coreAddress, + formula: 'daoCore/activeProposalModules', + }) + ) } catch (err) { // Ignore error. console.error(err) @@ -70,7 +74,12 @@ export const fetchProposalModules = async ( const [prePropose, veto] = await Promise.allSettled([ // Get pre-propose address if exists. - adapter?.functions.fetchPrePropose?.(chainId, address, version), + adapter?.functions.fetchPrePropose?.( + queryClient, + chainId, + address, + version + ), // Get veto config if exists. adapter?.functions.fetchVetoConfig?.(chainId, address, version), ]) diff --git a/packages/stateless/components/dao/DaoCard.stories.tsx b/packages/stateless/components/dao/DaoCard.stories.tsx index 1bf29733b..d4e040e39 100644 --- a/packages/stateless/components/dao/DaoCard.stories.tsx +++ b/packages/stateless/components/dao/DaoCard.stories.tsx @@ -35,6 +35,7 @@ export const makeDaoInfo = (id = 1): DaoInfo => ({ imageUrl: `/placeholders/${((id + 1) % 5) + 1}.svg`, admin: 'parent', registeredSubDao: true, + parentDao: null, }, supportedFeatures: {} as any, votingModuleAddress: '', diff --git a/packages/stateless/components/dao/DaoCard.tsx b/packages/stateless/components/dao/DaoCard.tsx index b7e3a113f..48825498a 100644 --- a/packages/stateless/components/dao/DaoCard.tsx +++ b/packages/stateless/components/dao/DaoCard.tsx @@ -25,6 +25,7 @@ export const DaoCard = ({ LinkWrapper, showIsMember = true, showingEstimatedUsdValue = true, + showParentDao = true, onMouseOver, onMouseLeave, className, @@ -87,7 +88,7 @@ export const DaoCard = ({ coreAddress={coreAddress} daoName={name} imageUrl={imageUrl} - parentDao={parentDao} + parentDao={showParentDao ? parentDao : null} size="sm" />

{name}

diff --git a/packages/stateless/components/dao/DaoImage.tsx b/packages/stateless/components/dao/DaoImage.tsx index 2d5bce961..79f44ca12 100644 --- a/packages/stateless/components/dao/DaoImage.tsx +++ b/packages/stateless/components/dao/DaoImage.tsx @@ -100,7 +100,7 @@ export const DaoImage = ({ U ): LoadingDataWithError => { const loadable = useCachedLoadable(recoilValue) - - const transformRef = useRef(transform) - transformRef.current = transform + const transformRef = useUpdatingRef(transform) return useMemo(() => { const data = loadableToLoadingDataWithError(loadable) @@ -176,7 +176,7 @@ export const useCachedLoadingWithError = < return transformLoadingDataWithError(data, transformRef.current) } return data as LoadingDataWithError - }, [loadable]) + }, [loadable, transformRef]) } // Convert to LoadingData for convenience, memoized. @@ -187,8 +187,7 @@ export const useCachedLoading = ( ): LoadingData => { const loadable = useCachedLoadable(recoilValue) - const onErrorRef = useRef(onError) - onErrorRef.current = onError + const onErrorRef = useUpdatingRef(onError) // Use deep compare to prevent memoize on every re-render if an object is // passed as the default value. @@ -197,6 +196,6 @@ export const useCachedLoading = ( return useMemo( () => loadableToLoadingData(loadable, memoizedDefaultValue, onErrorRef.current), - [loadable, memoizedDefaultValue] + [loadable, memoizedDefaultValue, onErrorRef] ) } diff --git a/packages/types/components/DaoCard.tsx b/packages/types/components/DaoCard.tsx index ba5e50be9..a518ff937 100644 --- a/packages/types/components/DaoCard.tsx +++ b/packages/types/components/DaoCard.tsx @@ -38,6 +38,15 @@ export type DaoCardProps = { * Whether or not the token loaded in lazy data is USD. Defaults to true. */ showingEstimatedUsdValue?: boolean + /** + * Whether or not to show the parent DAO if it exists. This is used primarily + * to hide the parent DAO until the app is mounted in the browser since + * rendering it on the server causes a hydration error for some horrible + * reason. I think it has something to do with the fact that you're not + * supposed to nest an a tag inside of another a tag, and maybe the Next.js + * server is sanitizing it or something. Anyways, rip. Defaults to true. + */ + showParentDao?: boolean onMouseOver?: () => void onMouseLeave?: () => void /** diff --git a/packages/types/components/EntityDisplay.tsx b/packages/types/components/EntityDisplay.tsx index 7056fb0fe..01ed4e111 100644 --- a/packages/types/components/EntityDisplay.tsx +++ b/packages/types/components/EntityDisplay.tsx @@ -17,6 +17,13 @@ export type Entity = { address: string name: string | null imageUrl: string + /** + * If loaded from a Polytone proxy, this will be set to the proxy. + */ + polytoneProxy?: { + chainId: string + address: string + } } & ( | { type: EntityType.Wallet @@ -28,11 +35,6 @@ export type Entity = { | { type: EntityType.Dao daoInfo: DaoInfo - // If loaded from a DAO's Polytone proxy, this will be set. - polytoneProxy?: { - chainId: string - address: string - } } | { type: EntityType.Cw1Whitelist diff --git a/packages/types/contracts/DaoCore.v2.ts b/packages/types/contracts/DaoCore.v2.ts index e7382eaa7..704756717 100644 --- a/packages/types/contracts/DaoCore.v2.ts +++ b/packages/types/contracts/DaoCore.v2.ts @@ -310,3 +310,8 @@ export interface VotingPowerAtHeightResponse { export type ProposalModuleWithInfo = ProposalModule & { info?: ContractVersionInfo } + +export type SubDaoWithChainId = SubDao & { + chainId: string +} +export type ListAllSubDaosResponse = SubDaoWithChainId[] diff --git a/packages/types/contracts/PolytoneVoice.ts b/packages/types/contracts/PolytoneVoice.ts new file mode 100644 index 000000000..f9128e046 --- /dev/null +++ b/packages/types/contracts/PolytoneVoice.ts @@ -0,0 +1,35 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +export type Uint64 = string +export interface InstantiateMsg { + block_max_gas: Uint64 + contract_addr_len?: number | null + proxy_code_id: Uint64 +} +export type ExecuteMsg = { + rx: { + connection_id: string + counterparty_port: string + data: Binary + } +} +export type Binary = string +export type QueryMsg = + | 'block_max_gas' + | 'proxy_code_id' + | 'contract_addr_len' + | { + sender_info_for_proxy: { + proxy: string + } + } +export type Uint8 = number +export interface SenderInfo { + connection_id: string + remote_port: string + remote_sender: string +} diff --git a/packages/types/contracts/common.ts b/packages/types/contracts/common.ts index 94cef65ba..05da5dc0e 100644 --- a/packages/types/contracts/common.ts +++ b/packages/types/contracts/common.ts @@ -341,3 +341,7 @@ export type ActiveThreshold = percent: Decimal } } + +export type ActiveThresholdResponse = { + active_threshold?: ActiveThreshold | null +} diff --git a/packages/types/dao.ts b/packages/types/dao.ts index edb181457..950fef555 100644 --- a/packages/types/dao.ts +++ b/packages/types/dao.ts @@ -62,6 +62,7 @@ export type DaoInfo = { votingModuleAddress: string votingModuleContractName: string proposalModules: ProposalModule[] + admin: string name: string description: string imageUrl: string @@ -72,9 +73,7 @@ export type DaoInfo = { // Map chain ID to polytone proxy address. polytoneProxies: PolytoneProxies accounts: Account[] - parentDao: DaoParentInfo | null - admin: string } export type DaoParentInfo = { @@ -82,9 +81,9 @@ export type DaoParentInfo = { coreAddress: string coreVersion: ContractVersion name: string - imageUrl?: string | null - parentDao?: DaoParentInfo | null + imageUrl: string admin: string + parentDao: DaoParentInfo | null // Whether or not this parent has registered its child as a SubDAO. registeredSubDao: boolean diff --git a/packages/types/misc.ts b/packages/types/misc.ts index b80280722..3ac553e16 100644 --- a/packages/types/misc.ts +++ b/packages/types/misc.ts @@ -20,14 +20,15 @@ export type CachedLoadable = contents: Error } -// These are convenience types that are more useful in UI components. They force -// you to check if data is loading before TypeScript allows you to access the -// data, and they also allow you to check if the data is updating. It is hard to -// use Recoil's loadable types in Storybook stories (to mock components), and -// these types make it much easier. See them used in -// `packages/utils/conversion.ts` and -// `packages/stateless/hooks/useCachedLoadable.ts`. - +/** + * Convenience type that is easier to use in UI components. This serves to + * separate the component from the library used to load state/data, preventing + * us from having to use a specific library's types inside of our components. + * This makes it easier to migrate between different data layers and other + * libraries in the future, such as moving from Recoil to React Query. + * + * See this used in `packages/stateful/hooks/useQueryLoadingData.ts` + */ export type LoadingData = | { loading: true @@ -38,6 +39,15 @@ export type LoadingData = data: D } +/** + * Convenience type that is easier to use in UI components. This serves to + * separate the component from the library used to load state/data, preventing + * us from having to use a specific library's types inside of our components. + * This makes it easier to migrate between different data layers and other + * libraries in the future, such as moving from Recoil to React Query. + * + * See this used in `packages/stateful/hooks/useQueryLoadingDataWithError.ts` + */ export type LoadingDataWithError = | { loading: true diff --git a/packages/types/package.json b/packages/types/package.json index 448d88fce..14ec0dbeb 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -23,7 +23,8 @@ }, "devDependencies": { "@cosmology/telescope": "^1.4.12", - "@dao-dao/config": "2.4.0-rc.8" + "@dao-dao/config": "2.4.0-rc.8", + "@tanstack/react-query": "^5.40.0" }, "peerDependencies": { "next": "^12 || ^13", diff --git a/packages/types/proposal-module-adapter.ts b/packages/types/proposal-module-adapter.ts index e6582cf30..ea50ee5a4 100644 --- a/packages/types/proposal-module-adapter.ts +++ b/packages/types/proposal-module-adapter.ts @@ -1,4 +1,5 @@ import { Chain } from '@chain-registry/types' +import { QueryClient } from '@tanstack/react-query' import { CSSProperties, ComponentType, ReactNode } from 'react' import { FieldPath, FieldValues } from 'react-hook-form' import { RecoilValueReadOnly } from 'recoil' @@ -221,6 +222,7 @@ export type IProposalModuleCommonContext = { // Internal Adapter Types export type FetchPreProposeFunction = ( + queryClient: QueryClient, chainId: string, proposalModuleAddress: string, version: ContractVersion | null diff --git a/packages/utils/assets.ts b/packages/utils/assets.ts index 953b7e3f5..f0c3a084c 100644 --- a/packages/utils/assets.ts +++ b/packages/utils/assets.ts @@ -1,9 +1,9 @@ import { fromBech32 } from '@cosmjs/encoding' -import { assets } from 'chain-registry' import { GenericToken, TokenType } from '@dao-dao/types' import { getChainForChainId } from './chain' +import { assets } from './constants' import { concatAddressStartEnd } from './conversion' import { getFallbackImage } from './getFallbackImage' diff --git a/packages/utils/chain.ts b/packages/utils/chain.ts index 40a7e4d45..cc0c79785 100644 --- a/packages/utils/chain.ts +++ b/packages/utils/chain.ts @@ -3,7 +3,6 @@ import { Buffer } from 'buffer' import { AssetList, Chain, IBCInfo } from '@chain-registry/types' import { fromBech32, fromHex, toBech32 } from '@cosmjs/encoding' import { GasPrice } from '@cosmjs/stargate' -import { assets, chains } from 'chain-registry' import RIPEMD160 from 'ripemd160' import semverGte from 'semver/functions/gte' @@ -22,8 +21,7 @@ import { TokenType, Validator, } from '@dao-dao/types' -import { aminoTypes, cosmos, typesRegistry } from '@dao-dao/types/protobuf' -import { ModuleAccount } from '@dao-dao/types/protobuf/codegen/cosmos/auth/v1beta1/auth' +import { aminoTypes, typesRegistry } from '@dao-dao/types/protobuf' import { Validator as RpcValidator, bondStatusToJSON, @@ -35,68 +33,12 @@ import { CONFIGURED_CHAINS, MAINNET, SUPPORTED_CHAINS, + assets, + chains, ibc, } from './constants' import { getFallbackImage } from './getFallbackImage' -// BitSong Testnet -const bitSongTestnetChain: Chain = { - chain_name: 'bitsongtestnet', - status: 'live', - network_type: 'testnet', - pretty_name: 'BitSong Testnet', - chain_id: 'bobnet', - bech32_prefix: 'bitsong', - bech32_config: { - bech32PrefixAccAddr: 'bitsong', - bech32PrefixAccPub: 'bitsongpub', - bech32PrefixValAddr: 'bitsongvaloper', - bech32PrefixValPub: 'bitsongvaloperpub', - bech32PrefixConsAddr: 'bitsongvalcons', - bech32PrefixConsPub: 'bitsongvalconspub', - }, - slip44: 639, - logo_URIs: { - png: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/bitsong/images/btsg.png', - }, - fees: { - fee_tokens: [ - { - denom: 'ubtsg', - fixed_min_gas_price: 0, - low_gas_price: 0, - average_gas_price: 0, - high_gas_price: 0, - }, - ], - }, - staking: { - staking_tokens: [ - { - denom: 'ubtsg', - }, - ], - }, - apis: { - rpc: [ - { - address: 'https://rpc-testnet.explorebitsong.com', - }, - ], - rest: [ - { - address: 'https://lcd-testnet.explorebitsong.com', - }, - ], - }, -} -chains.push(bitSongTestnetChain) -assets.push({ - chain_name: bitSongTestnetChain.chain_name, - // Copy assets from BitSong mainnet. - assets: assets.find((a) => a.chain_name === 'bitsong')?.assets ?? [], -}) - export const getRpcForChainId = ( chainId: string, // Offset will try a different RPC from the list of available RPCs. @@ -691,50 +633,6 @@ export const getSignerOptions = ({ chain_id, fees }: Chain) => { } } -// Check whether or not the address is a module account. -export const addressIsModule = async ( - client: Awaited< - ReturnType - >['cosmos'], - address: string, - // If defined, check that the module is this module. - moduleName?: string -): Promise => { - try { - const { account } = await client.auth.v1beta1.account({ - address, - }) - - if (!account) { - return false - } - - if (account.typeUrl === ModuleAccount.typeUrl) { - const moduleAccount = ModuleAccount.decode(account.value) - return !moduleName || moduleAccount.name === moduleName - - // If already decoded automatically. - } else if (account.$typeUrl === ModuleAccount.typeUrl) { - return ( - !moduleName || (account as unknown as ModuleAccount).name === moduleName - ) - } - } catch (err) { - if ( - err instanceof Error && - (err.message.includes('not found: key not found') || - err.message.includes('decoding bech32 failed')) - ) { - return false - } - - // Rethrow other errors. - throw err - } - - return false -} - /** * Get the DAO info object for a given chain ID. */ diff --git a/packages/utils/client.ts b/packages/utils/client.ts index b2c760029..29739b5bd 100644 --- a/packages/utils/client.ts +++ b/packages/utils/client.ts @@ -8,90 +8,220 @@ import { connectComet, } from '@cosmjs/tendermint-rpc' -type ChainClientRoutes = { - [rpcEndpoint: string]: T -} +import { + cosmos, + cosmwasm, + ibc, + juno, + neutron, + noble, + osmosis, +} from '@dao-dao/types/protobuf' + +import { getRpcForChainId } from './chain' +import { retry } from './network' -type HandleConnect = (rpcEndpoint: string) => Promise +type HandleConnect = (chainId: string) => Promise +type ChainClientRouterOptions = { + /** + * The connection handler that returns the client for a given chain ID. + */ + handleConnect: HandleConnect +} /* - * This is a workaround for `@cosmjs` clients to avoid connecting to the chain more than once. + * This is a client wrapper that preserves singletons of connected clients for + * many chains. * * @example + * ``` * export const stargateClientRouter = new ChainClientRouter({ - * handleConnect: (rpcEndpoint: string) => StargateClient.connect(rpcEndpoint), + * handleConnect: (chainId: string) => StargateClient.connect( + * getRpcForChainId(chainId) + * ), * }) * - * const client = await stargateClientRouter.connect(RPC_ENDPOINT); + * const client = await stargateClientRouter.connect(CHAIN_ID); * * const queryResponse = await client.queryContractSmart(...); - * */ + * ``` + */ class ChainClientRouter { private readonly handleConnect: HandleConnect - private instances: ChainClientRoutes = {} + private instances: Record = {} - constructor({ handleConnect }: { handleConnect: HandleConnect }) { + constructor({ handleConnect }: ChainClientRouterOptions) { this.handleConnect = handleConnect } /* - * Connect to the chain and return the client - * or return an existing instance of the client. - * */ - async connect(rpcEndpoint: string) { - if (!this.getClientInstance(rpcEndpoint)) { - const instance = await this.handleConnect(rpcEndpoint) - this.setClientInstance(rpcEndpoint, instance) + * Connect to the chain and return the client or return an existing instance + * of the client. + */ + async connect(chainId: string): Promise { + if (!this.instances[chainId]) { + const instance = await this.handleConnect(chainId) + this.instances[chainId] = instance } - return this.getClientInstance(rpcEndpoint) - } - - private getClientInstance(rpcEndpoint: string) { - return this.instances[rpcEndpoint] - } - - private setClientInstance(rpcEndpoint: string, client: T) { - this.instances[rpcEndpoint] = client + return this.instances[chainId] } } /* * Router for connecting to `CosmWasmClient`. - * */ + */ export const cosmWasmClientRouter = new ChainClientRouter({ - handleConnect: async (rpcEndpoint: string) => { - const httpClient = new HttpBatchClient(rpcEndpoint) - const tmClient = await ( - ( - await connectComet(rpcEndpoint) - ).constructor as - | typeof Tendermint34Client - | typeof Tendermint37Client - | typeof Comet38Client - ).create(httpClient) - - return await CosmWasmClient.create(tmClient) - }, + handleConnect: async (chainId: string) => + retry(10, async (attempt) => { + const rpc = getRpcForChainId(chainId, attempt - 1) + + const httpClient = new HttpBatchClient(rpc) + const tmClient = await ( + ( + await connectComet(rpc) + ).constructor as + | typeof Tendermint34Client + | typeof Tendermint37Client + | typeof Comet38Client + ).create(httpClient) + + return await CosmWasmClient.create(tmClient) + }), }) /* * Router for connecting to `StargateClient`. - * */ + */ export const stargateClientRouter = new ChainClientRouter({ - handleConnect: async (rpcEndpoint: string) => { - const httpClient = new HttpBatchClient(rpcEndpoint) - const tmClient = await ( - ( - await connectComet(rpcEndpoint) - ).constructor as - | typeof Tendermint34Client - | typeof Tendermint37Client - | typeof Comet38Client - ).create(httpClient) - - return await StargateClient.create(tmClient, {}) - }, + handleConnect: async (chainId: string) => + retry(10, async (attempt) => { + const rpc = getRpcForChainId(chainId, attempt - 1) + + const httpClient = new HttpBatchClient(rpc) + const tmClient = await ( + ( + await connectComet(rpc) + ).constructor as + | typeof Tendermint34Client + | typeof Tendermint37Client + | typeof Comet38Client + ).create(httpClient) + + return await StargateClient.create(tmClient) + }), +}) + +/* + * Router for connecting to an RPC client with Cosmos protobufs. + */ +export const cosmosProtoRpcClientRouter = new ChainClientRouter({ + handleConnect: async (chainId: string) => + retry( + 10, + async (attempt) => + ( + await cosmos.ClientFactory.createRPCQueryClient({ + rpcEndpoint: getRpcForChainId(chainId, attempt - 1), + }) + ).cosmos + ), +}) + +/* + * Router for connecting to an RPC client with IBC protobufs. + */ +export const ibcProtoRpcClientRouter = new ChainClientRouter({ + handleConnect: async (chainId: string) => + retry( + 10, + async (attempt) => + ( + await ibc.ClientFactory.createRPCQueryClient({ + rpcEndpoint: getRpcForChainId(chainId, attempt - 1), + }) + ).ibc + ), +}) + +/* + * Router for connecting to an RPC client with CosmWasm protobufs. + */ +export const cosmwasmProtoRpcClientRouter = new ChainClientRouter({ + handleConnect: async (chainId: string) => + retry( + 10, + async (attempt) => + ( + await cosmwasm.ClientFactory.createRPCQueryClient({ + rpcEndpoint: getRpcForChainId(chainId, attempt - 1), + }) + ).cosmwasm + ), +}) + +/* + * Router for connecting to an RPC client with Osmosis protobufs. + */ +export const osmosisProtoRpcClientRouter = new ChainClientRouter({ + handleConnect: async (chainId: string) => + retry( + 10, + async (attempt) => + ( + await osmosis.ClientFactory.createRPCQueryClient({ + rpcEndpoint: getRpcForChainId(chainId, attempt - 1), + }) + ).osmosis + ), +}) + +/* + * Router for connecting to an RPC client with Noble protobufs. + */ +export const nobleProtoRpcClientRouter = new ChainClientRouter({ + handleConnect: async (chainId: string) => + retry( + 10, + async (attempt) => + ( + await noble.ClientFactory.createRPCQueryClient({ + rpcEndpoint: getRpcForChainId(chainId, attempt - 1), + }) + ).noble + ), +}) + +/* + * Router for connecting to an RPC client with Neutron protobufs. + */ +export const neutronProtoRpcClientRouter = new ChainClientRouter({ + handleConnect: async (chainId: string) => + retry( + 10, + async (attempt) => + ( + await neutron.ClientFactory.createRPCQueryClient({ + rpcEndpoint: getRpcForChainId(chainId, attempt - 1), + }) + ).neutron + ), +}) + +/* + * Router for connecting to an RPC client with Juno protobufs. + */ +export const junoProtoRpcClientRouter = new ChainClientRouter({ + handleConnect: async (chainId: string) => + retry( + 10, + async (attempt) => + ( + await juno.ClientFactory.createRPCQueryClient({ + rpcEndpoint: getRpcForChainId(chainId, attempt - 1), + }) + ).juno + ), }) /** diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 3e405dec4..2f7de3bc6 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -1,5 +1,9 @@ -import { IBCInfo } from '@chain-registry/types' -import { ibc as chainRegistryIbc, chains } from 'chain-registry' +import { Chain, IBCInfo } from '@chain-registry/types' +import { + assets as chainRegistryAssets, + chains as chainRegistryChains, + ibc as chainRegistryIbc, +} from 'chain-registry' import { BaseChainConfig, @@ -11,6 +15,75 @@ import { import { NEUTRON_GOVERNANCE_DAO } from './other' +//! ----- Modified chain-registry ----- +let chains = [...chainRegistryChains] +const assets = [...chainRegistryAssets] + +// BitSong Testnet +const bitSongTestnetChain: Chain = { + chain_name: 'bitsongtestnet', + status: 'live', + network_type: 'testnet', + pretty_name: 'BitSong Testnet', + chain_id: 'bobnet', + bech32_prefix: 'bitsong', + bech32_config: { + bech32PrefixAccAddr: 'bitsong', + bech32PrefixAccPub: 'bitsongpub', + bech32PrefixValAddr: 'bitsongvaloper', + bech32PrefixValPub: 'bitsongvaloperpub', + bech32PrefixConsAddr: 'bitsongvalcons', + bech32PrefixConsPub: 'bitsongvalconspub', + }, + slip44: 639, + logo_URIs: { + png: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/bitsong/images/btsg.png', + }, + fees: { + fee_tokens: [ + { + denom: 'ubtsg', + fixed_min_gas_price: 0, + low_gas_price: 0, + average_gas_price: 0, + high_gas_price: 0, + }, + ], + }, + staking: { + staking_tokens: [ + { + denom: 'ubtsg', + }, + ], + }, + apis: { + rpc: [ + { + address: 'https://rpc-testnet.explorebitsong.com', + }, + ], + rest: [ + { + address: 'https://lcd-testnet.explorebitsong.com', + }, + ], + }, +} +chains.push(bitSongTestnetChain) +assets.push({ + chain_name: bitSongTestnetChain.chain_name, + // Copy assets from BitSong mainnet. + assets: assets.find((a) => a.chain_name === 'bitsong')?.assets ?? [], +}) + +// Remove thorchain and althea since they spam the console. +const chainsToRemove = ['thorchain', 'althea'] +chains = chains.filter((chain) => !chainsToRemove.includes(chain.chain_name)) + +export { chains, assets } +//! ----- Modified chain-registry ----- + export const ibc: IBCInfo[] = [ ...chainRegistryIbc, // Oraichain <-> Cosmos Hub diff --git a/packages/utils/contracts.ts b/packages/utils/contracts.ts index e9f82db6a..6324246a0 100644 --- a/packages/utils/contracts.ts +++ b/packages/utils/contracts.ts @@ -9,12 +9,10 @@ import { encodeJsonToBase64 } from './messages' const CONTRACT_VERSIONS = Object.values(ContractVersion) -// If version is defined, returns it. Otherwise, returns `undefined`. -// Essentially just filters version by its presence in the `ContractVersion` -// enum. -export const parseContractVersion = ( - version: string -): ContractVersion | undefined => CONTRACT_VERSIONS.find((v) => v === version) +// If version is defined, returns it. Otherwise, returns +// ContractVersion.Unknown. +export const parseContractVersion = (version: string): ContractVersion => + CONTRACT_VERSIONS.find((v) => v === version) || ContractVersion.Unknown export const indexToProposalModulePrefix = (index: number) => { index += 1 diff --git a/packages/utils/conversion.ts b/packages/utils/conversion.ts index f6011b868..adc58b7a9 100644 --- a/packages/utils/conversion.ts +++ b/packages/utils/conversion.ts @@ -1,4 +1,5 @@ import { fromBech32, toBech32, toHex } from '@cosmjs/encoding' +import { UseQueryResult } from '@tanstack/react-query' import { TFunction } from 'next-i18next' import { Loadable } from 'recoil' @@ -243,6 +244,56 @@ export const combineLoadingDataWithErrors = ( data: loadables.flatMap((l) => (l.loading || l.errored ? [] : l.data)), } +/** + * Combine react-query results into LoadingData list. + */ +export const makeCombineQueryResultsIntoLoadingData = + ({ + firstLoad = 'all', + transform = (results: T[]) => results as R, + }: { + /** + * Whether or not to show loading until all of the results are loaded, at + * least one result is loaded, or none of the results are loaded. If 'one', + * will show not loading (just updating) once the first result is loaded. If + * 'none', will never show loading. + * + * Defaults to 'all'. + */ + firstLoad?: 'all' | 'one' | 'none' + /** + * Optional transformation function that acts on combined list of data. + */ + transform?: (results: T[]) => R + }) => + (results: UseQueryResult[]): LoadingData => { + const isLoading = + firstLoad === 'all' + ? results.some((r) => r.isPending) + : firstLoad === 'one' + ? results.every((r) => r.isPending) + : false + + if (isLoading) { + return { + loading: true, + } + } else { + return { + loading: false, + updating: results.some((r) => r.isPending || r.isFetching), + // Cast data to T if not pending since it's possible that data has + // successfully loaded and returned undefined. isPending will be true if + // data is not yet loaded. + data: transform( + results.flatMap((r) => + r.isPending || r.isError ? [] : [r.data as T] + ) + ), + } + } + } + // Convert Recoil loadable into our generic data loader with error type. See the // comment above the LoadingData type for more details. export const loadableToLoadingDataWithError = ( diff --git a/packages/utils/nft.ts b/packages/utils/nft.ts index 19969266c..1ae46d7d9 100644 --- a/packages/utils/nft.ts +++ b/packages/utils/nft.ts @@ -73,6 +73,17 @@ export const getNftKey = ( .filter(Boolean) .join(':') +export const imageUrlFromStargazeIndexerNft = ( + token: StargazeNft +): string | undefined => + // The Stargaze API resizes animated images (gifs) into `video/mp4` mimetype, + // which cannot display in an `img` tag. If this is a gif, use the original + // media URL instead of the resized one. + (token.media?.type !== StargazeNftMediaType.AnimatedImage && + token.media?.visualAssets?.lg?.url) || + token.media?.url || + undefined + export const nftCardInfoFromStargazeIndexerNft = ( chainId: string, token: StargazeNft, @@ -92,14 +103,7 @@ export const nftCardInfoFromStargazeIndexerNft = ( href: `${STARGAZE_URL_BASE}/media/${token.collection.contractAddress}/${token.tokenId}`, name: 'Stargaze', }, - imageUrl: - // The Stargaze API resizes animated images (gifs) into `video/mp4` - // mimetype, which cannot display in an `img` tag. If this is a gif, use the - // original media URL instead of the resized one. - (token.media?.type !== StargazeNftMediaType.AnimatedImage && - token.media?.visualAssets?.lg?.url) || - token.media?.url || - undefined, + imageUrl: imageUrlFromStargazeIndexerNft(token), name: token.name || token.tokenId || 'Unknown NFT', description: token.description || undefined, highestOffer: offerToken diff --git a/packages/utils/package.json b/packages/utils/package.json index f0cff0466..4a32c6fb8 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -38,6 +38,7 @@ "@chain-registry/types": "^0.41.3", "@cosmjs/proto-signing": "^0.32.3", "@dao-dao/config": "2.4.0-rc.8", + "@tanstack/react-query": "^5.40.0", "cosmjs-types": "^0.9.0", "jest": "^29.1.1", "next": "^13.3.0", diff --git a/packages/utils/profile.ts b/packages/utils/profile.ts index 20d279486..b5f3f8f53 100644 --- a/packages/utils/profile.ts +++ b/packages/utils/profile.ts @@ -2,20 +2,20 @@ import { PfpkProfile, UnifiedProfile } from '@dao-dao/types' import { getFallbackImage } from './getFallbackImage' -export const EMPTY_PFPK_PROFILE: PfpkProfile = { +export const makeEmptyPfpkProfile = (): PfpkProfile => ({ uuid: null, // Disallows editing if we don't have correct nonce from server. nonce: -1, name: null, nft: null, chains: {}, -} +}) export const makeEmptyUnifiedProfile = ( chainId: string, address: string ): UnifiedProfile => ({ - ...EMPTY_PFPK_PROFILE, + ...makeEmptyPfpkProfile(), source: { chainId, address, diff --git a/yarn.lock b/yarn.lock index 7d8ec1575..6baedf888 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7746,6 +7746,18 @@ lodash.isplainobject "^4.0.6" lodash.merge "^4.6.2" +"@tanstack/query-core@5.40.0": + version "5.40.0" + resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.40.0.tgz#c74ae8303752ed4b5a0ab848ec71a0e6e8179f83" + integrity sha512-eD8K8jsOIq0Z5u/QbvOmfvKKE/XC39jA7yv4hgpl/1SRiU+J8QCIwgM/mEHuunQsL87dcvnHqSVLmf9pD4CiaA== + +"@tanstack/react-query@^5.40.0": + version "5.40.0" + resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.40.0.tgz#654afa2d9ab328c22be7e1f025ec9b6267c6baa9" + integrity sha512-iv/W0Axc4aXhFzkrByToE1JQqayxTPNotCoSCnarR/A1vDIHaoKpg7FTIfP3Ev2mbKn1yrxq0ZKYUdLEJxs6Tg== + dependencies: + "@tanstack/query-core" "5.40.0" + "@terra-money/feather.js@^1.0.8": version "1.2.1" resolved "https://registry.yarnpkg.com/@terra-money/feather.js/-/feather.js-1.2.1.tgz#e89f615aa3628a8e87720c161cecc4ae402a057f" From 6c8f7986f985be010607dbcaf51dcf362ce69082 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 6 Jun 2024 12:20:28 -0400 Subject: [PATCH 212/438] sped up and cache home page static props queries --- apps/dapp/pages/[[...tab]].tsx | 59 ++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/apps/dapp/pages/[[...tab]].tsx b/apps/dapp/pages/[[...tab]].tsx index cd64729d3..e31d5cc93 100644 --- a/apps/dapp/pages/[[...tab]].tsx +++ b/apps/dapp/pages/[[...tab]].tsx @@ -7,8 +7,8 @@ import { serverSideTranslations } from '@dao-dao/i18n/serverSideTranslations' import { daoQueries, dehydrateSerializable, + indexerQueries, makeReactQueryClient, - querySnapper, } from '@dao-dao/state' import { Home, @@ -25,6 +25,9 @@ import { export default Home +// Share query client across static props generators since the data is the same. +const queryClient = makeReactQueryClient() + export const getStaticProps: GetStaticProps = async ({ locale, params, @@ -63,35 +66,41 @@ export const getStaticProps: GetStaticProps = async ({ : []), ].map((chainId) => getDaoInfoForChainId(chainId, [])) - const queryClient = makeReactQueryClient() - const [i18nProps, tvl, allStats, monthStats, weekStats] = await Promise.all([ // Get i18n translations props. serverSideTranslations(locale, ['translation']), // Get all or chain-specific stats and TVL. - querySnapper({ - query: chainId ? 'daodao-chain-tvl' : 'daodao-all-tvl', - parameters: chainId ? { chainId } : undefined, - }), - querySnapper({ - query: chainId ? 'daodao-chain-stats' : 'daodao-all-stats', - parameters: chainId ? { chainId } : undefined, - }), - querySnapper({ - query: chainId ? 'daodao-chain-stats' : 'daodao-all-stats', - parameters: { - ...(chainId ? { chainId } : undefined), - daysAgo: 30, - }, - }), - querySnapper({ - query: chainId ? 'daodao-chain-stats' : 'daodao-all-stats', - parameters: { - ...(chainId ? { chainId } : undefined), - daysAgo: 7, - }, - }), + queryClient.fetchQuery( + indexerQueries.snapper({ + query: chainId ? 'daodao-chain-tvl' : 'daodao-all-tvl', + parameters: chainId ? { chainId } : undefined, + }) + ), + queryClient.fetchQuery( + indexerQueries.snapper({ + query: chainId ? 'daodao-chain-stats' : 'daodao-all-stats', + parameters: chainId ? { chainId } : undefined, + }) + ), + queryClient.fetchQuery( + indexerQueries.snapper({ + query: chainId ? 'daodao-chain-stats' : 'daodao-all-stats', + parameters: { + ...(chainId ? { chainId } : undefined), + daysAgo: 30, + }, + }) + ), + queryClient.fetchQuery( + indexerQueries.snapper({ + query: chainId ? 'daodao-chain-stats' : 'daodao-all-stats', + parameters: { + ...(chainId ? { chainId } : undefined), + daysAgo: 7, + }, + }) + ), // Pre-fetch featured DAOs. queryClient From 745f124e6a4c441ad71ed6c5cc27a421261f75d5 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 6 Jun 2024 14:26:40 -0400 Subject: [PATCH 213/438] fixed terra classic DAOs --- packages/stateful/server/makeGetDaoStaticProps.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/stateful/server/makeGetDaoStaticProps.ts b/packages/stateful/server/makeGetDaoStaticProps.ts index 06616a293..14cb23db0 100644 --- a/packages/stateful/server/makeGetDaoStaticProps.ts +++ b/packages/stateful/server/makeGetDaoStaticProps.ts @@ -254,12 +254,11 @@ export const makeGetDaoStaticProps: GetDaoStaticPropsMaker = } } - console.error(error) - if ( error instanceof Error && (error.message.includes('contract: not found') || error.message.includes('no such contract') || + error.message.includes('404 contract not found') || error.message.includes('Error parsing into type') || error.message.includes('decoding bech32 failed') || error.message.includes('dumpState reason: Unexpected token')) @@ -278,6 +277,8 @@ export const makeGetDaoStaticProps: GetDaoStaticPropsMaker = } } + console.error(error) + // Return error in props to trigger client-side 500 error. return { props: { From 227bbf9ad802454508c0249cd1fecc9cf491e20c Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 7 Jun 2024 12:01:04 -0400 Subject: [PATCH 214/438] revalidate home page static props every 6 hours to make sure the queries are fresh --- apps/dapp/pages/[[...tab]].tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dapp/pages/[[...tab]].tsx b/apps/dapp/pages/[[...tab]].tsx index e31d5cc93..98709fe79 100644 --- a/apps/dapp/pages/[[...tab]].tsx +++ b/apps/dapp/pages/[[...tab]].tsx @@ -162,8 +162,8 @@ export const getStaticProps: GetStaticProps = async ({ // Dehydrate react-query state with featured DAOs preloaded. reactQueryDehydratedState: dehydrateSerializable(queryClient), }, - // Revalidate every day. - revalidate: 24 * 60 * 60, + // Revalidate every 6 hours. + revalidate: 6 * 60 * 60, } } From 3cf38be6cc5cb3527b134964576599756e792e0e Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 7 Jun 2024 12:23:24 -0400 Subject: [PATCH 215/438] increase juno self-relay amount --- packages/stateful/components/SelfRelayExecuteModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stateful/components/SelfRelayExecuteModal.tsx b/packages/stateful/components/SelfRelayExecuteModal.tsx index 91a66263f..3abfa88df 100644 --- a/packages/stateful/components/SelfRelayExecuteModal.tsx +++ b/packages/stateful/components/SelfRelayExecuteModal.tsx @@ -83,7 +83,7 @@ enum RelayStatus { } const RELAYER_FUNDS_NEEDED: Partial> = { - [ChainId.JunoMainnet]: 0.1 * 10 ** 6, + [ChainId.JunoMainnet]: 1 * 10 ** 6, [ChainId.OsmosisMainnet]: 0.1 * 10 ** 6, [ChainId.StargazeMainnet]: 2 * 10 ** 6, [ChainId.NeutronMainnet]: 0.5 * 10 ** 6, From b37956e2002bfc1643dbc53aea7f714d62fc067d Mon Sep 17 00:00:00 2001 From: noah Date: Fri, 7 Jun 2024 13:09:00 -0400 Subject: [PATCH 216/438] add playwright for e2e testing (#1782) --- .github/workflows/playwright.yml | 42 +++++++++ .gitignore | 11 ++- apps/dapp/package.json | 3 + apps/dapp/playwright.config.ts | 80 +++++++++++++++++ apps/dapp/tests/chain.spec.ts | 30 +++++++ apps/dapp/tests/create.spec.ts | 21 +++++ apps/dapp/tests/dao.spec.ts | 85 +++++++++++++++++++ apps/dapp/tests/home.spec.ts | 36 ++++++++ apps/dapp/tests/setup.ts | 16 ++++ apps/dapp/tests/status.spec.ts | 15 ++++ jest.config.js | 9 +- package.json | 1 + .../stateful/server/makeGetDaoStaticProps.ts | 6 -- yarn.lock | 38 +++++++-- 14 files changed, 376 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/playwright.yml create mode 100644 apps/dapp/playwright.config.ts create mode 100644 apps/dapp/tests/chain.spec.ts create mode 100644 apps/dapp/tests/create.spec.ts create mode 100644 apps/dapp/tests/dao.spec.ts create mode 100644 apps/dapp/tests/home.spec.ts create mode 100644 apps/dapp/tests/setup.ts create mode 100644 apps/dapp/tests/status.spec.ts diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml new file mode 100644 index 000000000..443b08a31 --- /dev/null +++ b/.github/workflows/playwright.yml @@ -0,0 +1,42 @@ +name: Playwright Tests + +on: + push: + branches: + - main + - development + pull_request: + branches: + - main + - development + +env: + # override value from .env.testnet used in CI + NEXT_PUBLIC_SITE_URL: http://127.0.0.1:3000 + +jobs: + test: + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: yarn + - name: Install packages + run: yarn install + - name: Install Playwright browsers + run: yarn playwright install --with-deps + - name: Set up testnet environment + run: cp apps/dapp/.env.testnet apps/dapp/.env.local + - name: Build dApp + run: yarn dapp build + - name: Run Playwright tests + run: yarn test:e2e + - uses: actions/upload-artifact@v4 + if: always() + with: + name: playwright-report + path: apps/dapp/playwright-report/ + retention-days: 30 diff --git a/.gitignore b/.gitignore index 0aa576f5d..02259aa85 100644 --- a/.gitignore +++ b/.gitignore @@ -15,10 +15,7 @@ node_modules/ out/ .env -.env.development.local -.env.local -.env.production.local -.env.test.local +.env*.local *.swo *.swp @@ -28,3 +25,9 @@ out/ \#*\# .turbo + +# playwright +test-results/ +playwright-report/ +blob-report/ +playwright/.cache/ diff --git a/apps/dapp/package.json b/apps/dapp/package.json index 9eb1e36dd..f24982fbf 100644 --- a/apps/dapp/package.json +++ b/apps/dapp/package.json @@ -15,6 +15,7 @@ "start": "next start", "test": "jest --passWithNoTests", "test:watch": "jest --watch", + "test:e2e": "cp .env.testnet .env.local && playwright test", "ts": "tsc --noEmit --incremental", "ts:watch": "ts --watch" }, @@ -53,10 +54,12 @@ "devDependencies": { "@dao-dao/config": "2.4.0-rc.8", "@next/bundle-analyzer": "^14.1.0", + "@playwright/test": "^1.44.1", "@sentry/cli": "^2.21.3", "@solana/web3.js": "^1.75.0", "@types/cors": "^2.8.13", "@types/lodash.clonedeep": "^4.5.0", + "@types/node": "^20.14.2", "@types/react": "^17.0.37", "autoprefixer": "^9.8.6", "eslint": "^8.23.1", diff --git a/apps/dapp/playwright.config.ts b/apps/dapp/playwright.config.ts new file mode 100644 index 000000000..7199867a2 --- /dev/null +++ b/apps/dapp/playwright.config.ts @@ -0,0 +1,80 @@ +// GNU AFFERO GENERAL PUBLIC LICENSE Version 3. Copyright (C) 2022 DAO DAO Contributors. +// See the "LICENSE" file in the root directory of this package for more copyright information. +import { defineConfig, devices } from '@playwright/test' + +/** + * See https://playwright.dev/docs/test-configuration. + */ +export default defineConfig({ + testDir: './tests', + /* Run tests in files in parallel */ + fullyParallel: true, + /* Fail the build on CI if you accidentally left test.only in the source code. */ + forbidOnly: !!process.env.CI, + /* Retry on CI only */ + retries: process.env.CI ? 2 : 0, + /* Opt out of parallel tests on CI. */ + // workers: process.env.CI ? 1 : undefined, + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ + reporter: 'html', + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ + use: { + /* Base URL to use in actions like `await page.goto('/')`. */ + baseURL: 'http://127.0.0.1:3000', + + /* In CI, store all traces for analysis. Locally, just use failed traces. */ + trace: process.env.CI ? 'on' : 'retain-on-failure', + }, + + /* Configure projects for major browsers */ + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + + { + name: 'firefox', + use: { ...devices['Desktop Firefox'] }, + }, + + { + name: 'webkit', + use: { ...devices['Desktop Safari'] }, + }, + + /* Test against mobile viewports. */ + // { + // name: 'Mobile Chrome', + // use: { ...devices['Pixel 5'] }, + // }, + // { + // name: 'Mobile Safari', + // use: { ...devices['iPhone 12'] }, + // }, + + /* Test against branded browsers. */ + // { + // name: 'Microsoft Edge', + // use: { ...devices['Desktop Edge'], channel: 'msedge' }, + // }, + // { + // name: 'Google Chrome', + // use: { ...devices['Desktop Chrome'], channel: 'chrome' }, + // }, + ], + + /* Build and run server before starting the tests */ + webServer: { + command: 'yarn start', + url: 'http://127.0.0.1:3000', + reuseExistingServer: !process.env.CI, + // allow 10 minutes for the server to build + timeout: 10 * 60 * 1000, + }, + + expect: { + // Default expect timeout to 20 seconds. + timeout: 20 * 1000, + }, +}) diff --git a/apps/dapp/tests/chain.spec.ts b/apps/dapp/tests/chain.spec.ts new file mode 100644 index 000000000..0510c6038 --- /dev/null +++ b/apps/dapp/tests/chain.spec.ts @@ -0,0 +1,30 @@ +// GNU AFFERO GENERAL PUBLIC LICENSE Version 3. Copyright (C) 2022 DAO DAO Contributors. +// See the "LICENSE" file in the root directory of this package for more copyright information. + +import { expect, test } from '@playwright/test' + +import './setup' + +test('chain home/proposals tab renders', async ({ page }) => { + await page.goto('/dao/juno/proposals') + + // Expect description to exist. + await expect( + page.getByText('Native chain governance for Juno Testnet.') + ).toBeVisible() + + // Expect "New proposal" button to exist. + await expect(page.getByText('New proposal', { exact: true })).toBeVisible() +}) + +test('chain treasury tab renders', async ({ page }) => { + await page.goto('/dao/juno/treasury') + + // Expect description to exist. + await expect( + page.getByText('Native chain governance for Juno Testnet.') + ).toBeVisible() + + // Expect "Token" title to exist. + await expect(page.getByText('Token', { exact: true })).toBeVisible() +}) diff --git a/apps/dapp/tests/create.spec.ts b/apps/dapp/tests/create.spec.ts new file mode 100644 index 000000000..5e657bcb9 --- /dev/null +++ b/apps/dapp/tests/create.spec.ts @@ -0,0 +1,21 @@ +// GNU AFFERO GENERAL PUBLIC LICENSE Version 3. Copyright (C) 2022 DAO DAO Contributors. +// See the "LICENSE" file in the root directory of this package for more copyright information. + +import { expect, test } from '@playwright/test' + +import './setup' + +test('create DAO page renders', async ({ page }) => { + await page.goto('/dao/create') + + // Expect "New DAO" header to exist. + await expect( + page.locator('div.header-text').filter({ hasText: 'New DAO' }).first() + ).toBeVisible() + + // Expect "Log in" button to exist. + await expect(page.getByRole('button', { name: 'Log in' })).toBeVisible() + + // Expect "Continue" button to exist. + await expect(page.getByRole('button', { name: 'Continue' })).toBeVisible() +}) diff --git a/apps/dapp/tests/dao.spec.ts b/apps/dapp/tests/dao.spec.ts new file mode 100644 index 000000000..bff3743db --- /dev/null +++ b/apps/dapp/tests/dao.spec.ts @@ -0,0 +1,85 @@ +// GNU AFFERO GENERAL PUBLIC LICENSE Version 3. Copyright (C) 2022 DAO DAO Contributors. +// See the "LICENSE" file in the root directory of this package for more copyright information. + +import { expect, test } from '@playwright/test' + +import './setup' + +test('DAO home tab renders', async ({ page }) => { + await page.goto( + '/dao/juno1vh0xndu9pj8g0lat6k3500mxusfduh804sf9hj7jpt4kgj0gmreq3jmqj4' + ) + + // Expect description to exist. + await expect(page.getByText('Worship the moon.')).toBeVisible() +}) + +test('DAO proposals tab renders', async ({ page }) => { + await page.goto( + '/dao/juno1vh0xndu9pj8g0lat6k3500mxusfduh804sf9hj7jpt4kgj0gmreq3jmqj4/proposals' + ) + + // Expect description to exist. + await expect(page.getByText('Worship the moon.')).toBeVisible() + + // Expect "New proposal" button to exist. + await expect(page.getByText('New proposal', { exact: true })).toBeVisible() +}) + +test('DAO treasury tab renders', async ({ page }) => { + await page.goto( + '/dao/juno1vh0xndu9pj8g0lat6k3500mxusfduh804sf9hj7jpt4kgj0gmreq3jmqj4/treasury' + ) + + // Expect no 404 error. + await expect(page.getByText('404: Not Found')).not.toBeVisible({ + timeout: 1000, + }) + + // Expect description to exist. + await expect(page.getByText('Worship the moon.')).toBeVisible() + + // Expect "Copy address" button to exist. + await expect(page.getByText('Copy address', { exact: true })).toBeVisible() + + // Expect "Tokens" title to exist. + await expect(page.getByText('Tokens', { exact: true })).toBeVisible() +}) + +test('DAO subDAOs tab renders', async ({ page }) => { + await page.goto( + '/dao/juno1vh0xndu9pj8g0lat6k3500mxusfduh804sf9hj7jpt4kgj0gmreq3jmqj4/subdaos' + ) + + // Expect description to exist. + await expect(page.getByText('Worship the moon.')).toBeVisible() + + // Expect "New SubDAO" button to exist. + await expect(page.getByText('New SubDAO', { exact: true })).toBeVisible() +}) + +test('DAO members tab renders', async ({ page }) => { + await page.goto( + '/dao/juno1vh0xndu9pj8g0lat6k3500mxusfduh804sf9hj7jpt4kgj0gmreq3jmqj4/members' + ) + + // Expect description to exist. + await expect(page.getByText('Worship the moon.')).toBeVisible() + + // Expect member voting power title to exist. + await expect( + page.getByText('Voting power', { exact: true }).first() + ).toBeVisible() +}) + +test('DAO apps tab renders', async ({ page }) => { + await page.goto( + '/dao/juno1vh0xndu9pj8g0lat6k3500mxusfduh804sf9hj7jpt4kgj0gmreq3jmqj4/apps' + ) + + // Expect description to exist. + await expect(page.getByText('Worship the moon.')).toBeVisible() + + // Expect member voting power title to exist. + await expect(page.getByRole('button', { name: 'Go' }).first()).toBeVisible() +}) diff --git a/apps/dapp/tests/home.spec.ts b/apps/dapp/tests/home.spec.ts new file mode 100644 index 000000000..d52576165 --- /dev/null +++ b/apps/dapp/tests/home.spec.ts @@ -0,0 +1,36 @@ +// GNU AFFERO GENERAL PUBLIC LICENSE Version 3. Copyright (C) 2022 DAO DAO Contributors. +// See the "LICENSE" file in the root directory of this package for more copyright information. + +import { expect, test } from '@playwright/test' + +import './setup' + +test('home page renders', async ({ page }) => { + await page.goto('/') + + // Expect "Log in" button to exist. + await expect(page.getByRole('button', { name: 'Log in' })).toBeVisible() + + // Expect "Chain governance" title to exist. + await expect( + page.getByText('Chain governance', { exact: true }) + ).toBeVisible() + + // Expect "Featured DAOs" title to exist. + await expect(page.getByText('Featured DAOs', { exact: true })).toBeVisible() +}) + +test('chain-specific home page renders', async ({ page }) => { + await page.goto('/juno') + + // Expect "Log in" button to exist. + await expect(page.getByRole('button', { name: 'Log in' })).toBeVisible() + + // Expect "Chain governance" title to exist. + await expect( + page.getByText('Chain governance', { exact: true }) + ).toBeVisible() + + // Expect "Featured DAOs" title to exist. + await expect(page.getByText('Featured DAOs', { exact: true })).toBeVisible() +}) diff --git a/apps/dapp/tests/setup.ts b/apps/dapp/tests/setup.ts new file mode 100644 index 000000000..55beac57e --- /dev/null +++ b/apps/dapp/tests/setup.ts @@ -0,0 +1,16 @@ +// GNU AFFERO GENERAL PUBLIC LICENSE Version 3. Copyright (C) 2022 DAO DAO Contributors. +// See the "LICENSE" file in the root directory of this package for more copyright information. + +/** + * Set up tests. + */ + +import { test } from '@playwright/test' + +test.beforeEach(async ({ page }) => { + await page.addInitScript(() => { + // Mark beta warning as approved so it doesn't appear and block the rest of + // the page. + window.localStorage.setItem('betaWarningAccepted', 'true') + }) +}) diff --git a/apps/dapp/tests/status.spec.ts b/apps/dapp/tests/status.spec.ts new file mode 100644 index 000000000..580c94f34 --- /dev/null +++ b/apps/dapp/tests/status.spec.ts @@ -0,0 +1,15 @@ +// GNU AFFERO GENERAL PUBLIC LICENSE Version 3. Copyright (C) 2022 DAO DAO Contributors. +// See the "LICENSE" file in the root directory of this package for more copyright information. + +import { expect, test } from '@playwright/test' + +import './setup' + +test('status page renders', async ({ page }) => { + await page.goto('/status') + + // Expect "Status" header to exist. + await expect( + page.locator('p.header-text').filter({ hasText: 'Status' }) + ).toBeVisible() +}) diff --git a/jest.config.js b/jest.config.js index e75538534..407d8a813 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,10 +1,15 @@ // GNU AFFERO GENERAL PUBLIC LICENSE Version 3. Copyright (C) 2022 DAO DAO Contributors. // See the "LICENSE" file in the root directory of this package for more copyright information. -/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ +/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ module.exports = { moduleDirectories: ['node_modules', ''], - testPathIgnorePatterns: ['/.next/', '/node_modules/'], + testPathIgnorePatterns: [ + '/.next/', + '/node_modules/', + // playwright e2e tests, not jest. jest unit tests are spread throughout + '/apps/dapp/tests/' + ], preset: 'ts-jest', testEnvironment: 'node', } diff --git a/package.json b/package.json index 192520cc4..55754aa47 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "format": "prettier --write \"**/*.{css,json,md}\" && turbo run format --continue --parallel", "lint": "prettier --check \"**/*.{css,json,md}\" && turbo run lint --continue --parallel", "test": "jest", + "test:e2e": "yarn dapp test:e2e", "dapp": "yarn workspace @dao-dao/dapp", "sda": "yarn workspace @dao-dao/sda", "i18n": "yarn workspace @dao-dao/i18n", diff --git a/packages/stateful/server/makeGetDaoStaticProps.ts b/packages/stateful/server/makeGetDaoStaticProps.ts index 14cb23db0..0d7bc886f 100644 --- a/packages/stateful/server/makeGetDaoStaticProps.ts +++ b/packages/stateful/server/makeGetDaoStaticProps.ts @@ -26,7 +26,6 @@ import { } from '@dao-dao/types' import { cosmos } from '@dao-dao/types/protobuf' import { - CI, DAO_CORE_ACCENT_ITEM_KEY, DAO_STATIC_PROPS_CACHE_SECONDS, LEGACY_DAO_CONTRACT_NAMES, @@ -91,11 +90,6 @@ export class LegacyDaoError extends Error { export const makeGetDaoStaticProps: GetDaoStaticPropsMaker = ({ appMode, coreAddress: _coreAddress, getProps }) => async (context) => { - // Don't query chain if running in CI. - if (CI) { - return { notFound: true } - } - // Load server translations and get T function for use in getProps. const { i18nProps, serverT } = await serverSideTranslationsWithServerT( context.locale, diff --git a/yarn.lock b/yarn.lock index 6baedf888..b0985b4b9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6042,6 +6042,13 @@ resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== +"@playwright/test@^1.44.1": + version "1.44.1" + resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.44.1.tgz#cc874ec31342479ad99838040e99b5f604299bcb" + integrity sha512-1hZ4TNvD5z9VuhNJ/walIjvMVvYkZKf71axoF/uiAqpntQJXpG64dlXhoDXE3OczPuTuvjf/M5KWFg5VAVUS3Q== + dependencies: + playwright "1.44.1" + "@pmmmwh/react-refresh-webpack-plugin@^0.5.3": version "0.5.7" resolved "https://registry.yarnpkg.com/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.7.tgz#58f8217ba70069cc6a73f5d7e05e85b458c150e2" @@ -8325,6 +8332,13 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.36.tgz#c414052cb9d43fab67d679d5f3c641be911f5835" integrity sha512-FXKWbsJ6a1hIrRxv+FoukuHnGTgEzKYGi7kilfMae96AL9UNkPFNWJEEYWzdRI9ooIkbr4AKldyuSTLql06vLQ== +"@types/node@^20.14.2": + version "20.14.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.2.tgz#a5f4d2bcb4b6a87bffcaa717718c5a0f208f4a18" + integrity sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q== + dependencies: + undici-types "~5.26.4" + "@types/normalize-package-data@^2.4.0": version "2.4.1" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" @@ -14453,6 +14467,11 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== +fsevents@2.3.2, fsevents@^2.1.2, fsevents@^2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + fsevents@^1.2.7: version "1.2.13" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38" @@ -14461,11 +14480,6 @@ fsevents@^1.2.7: bindings "^1.5.0" nan "^2.12.1" -fsevents@^2.1.2, fsevents@^2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== - fsevents@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" @@ -20331,6 +20345,20 @@ pkg-types@^1.1.0: mlly "^1.6.1" pathe "^1.1.2" +playwright-core@1.44.1: + version "1.44.1" + resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.44.1.tgz#53ec975503b763af6fc1a7aa995f34bc09ff447c" + integrity sha512-wh0JWtYTrhv1+OSsLPgFzGzt67Y7BE/ZS3jEqgGBlp2ppp1ZDj8c+9IARNW4dwf1poq5MgHreEM2KV/GuR4cFA== + +playwright@1.44.1: + version "1.44.1" + resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.44.1.tgz#5634369d777111c1eea9180430b7a184028e7892" + integrity sha512-qr/0UJ5CFAtloI3avF95Y0L1xQo6r3LQArLIg/z/PoGJ6xa+EwzrwO5lpNr/09STxdHuUoP2mvuELJS+hLdtgg== + dependencies: + playwright-core "1.44.1" + optionalDependencies: + fsevents "2.3.2" + plur@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/plur/-/plur-2.1.2.tgz#7482452c1a0f508e3e344eaec312c91c29dc655a" From 2025f8e0bbbf53cd20a78b13a77b906165fe5e58 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 9 Jun 2024 11:35:11 -0400 Subject: [PATCH 217/438] removed dapp middleware --- apps/dapp/middleware.ts | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 apps/dapp/middleware.ts diff --git a/apps/dapp/middleware.ts b/apps/dapp/middleware.ts deleted file mode 100644 index 8b4870989..000000000 --- a/apps/dapp/middleware.ts +++ /dev/null @@ -1,26 +0,0 @@ -// GNU AFFERO GENERAL PUBLIC LICENSE Version 3. Copyright (C) 2022 DAO DAO Contributors. -// See the "LICENSE" file in the root directory of this package for more copyright information. - -import { NextRequest, NextResponse } from 'next/server' - -const PUBLIC_FILE = /\.(.*)$/ - -export async function middleware(req: NextRequest) { - if ( - req.nextUrl.pathname.startsWith('/_next') || - req.nextUrl.pathname.includes('/api/') || - PUBLIC_FILE.test(req.nextUrl.pathname) - ) { - return - } - - // Use the `bad` locale sub-path for badbad.zone. - if ( - req.nextUrl.host.includes('badbad.zone') && - req.nextUrl.locale !== 'bad' - ) { - return NextResponse.redirect( - new URL(`/bad${req.nextUrl.pathname}${req.nextUrl.search}`, req.url) - ) - } -} From 0d77dbbf1d0c012ad7f4c45dd4b815866e53a4a0 Mon Sep 17 00:00:00 2001 From: Jake Hartnell Date: Sun, 9 Jun 2024 14:31:23 -0400 Subject: [PATCH 218/438] fixed RPC client fallback connections --- packages/state/utils/contract.ts | 13 ++++++------- .../functions/fetchPrePropose.ts | 3 +-- .../functions/fetchVetoConfig.ts | 3 +-- .../functions/makeGetProposalInfo.ts | 6 ++---- .../DaoProposalSingle/functions/fetchPrePropose.ts | 3 +-- .../DaoProposalSingle/functions/fetchVetoConfig.ts | 3 +-- .../functions/makeGetProposalInfo.ts | 10 ++-------- packages/stateful/utils/fetchProposalModules.ts | 3 +-- 8 files changed, 15 insertions(+), 29 deletions(-) diff --git a/packages/state/utils/contract.ts b/packages/state/utils/contract.ts index 874cd3861..c1fd1a93e 100644 --- a/packages/state/utils/contract.ts +++ b/packages/state/utils/contract.ts @@ -9,7 +9,6 @@ import { Config as NeutronCwdSubdaoTimelockSingleConfig } from '@dao-dao/types/c import { ContractName, cosmWasmClientRouter, - getRpcForChainId, parseContractVersion, } from '@dao-dao/utils' @@ -59,7 +58,7 @@ export const fetchPreProposeModule = async ( // If indexer fails, fallback to querying chain. if (!approver) { const client = new DaoPreProposeApprovalSingleQueryClient( - await cosmWasmClientRouter.connect(getRpcForChainId(chainId)), + await cosmWasmClientRouter.connect(chainId), preProposeAddress ) @@ -101,7 +100,7 @@ export const fetchPreProposeModule = async ( // If indexer fails, fallback to querying chain. if (!approver) { const client = new DaoPreProposeApproverQueryClient( - await cosmWasmClientRouter.connect(getRpcForChainId(chainId)), + await cosmWasmClientRouter.connect(chainId), preProposeApproverContract ) @@ -135,7 +134,7 @@ export const fetchPreProposeModule = async ( // If indexer fails, fallback to querying chain. if (!preProposeApprovalContract) { const client = new DaoPreProposeApproverQueryClient( - await cosmWasmClientRouter.connect(getRpcForChainId(chainId)), + await cosmWasmClientRouter.connect(chainId), preProposeAddress ) @@ -162,7 +161,7 @@ export const fetchPreProposeModule = async ( // If indexer fails, fallback to querying chain. if (!approvalDao) { const client = new DaoPreProposeApprovalSingleQueryClient( - await cosmWasmClientRouter.connect(getRpcForChainId(chainId)), + await cosmWasmClientRouter.connect(chainId), preProposeApprovalContract ) @@ -195,7 +194,7 @@ export const fetchPreProposeModule = async ( // If indexer fails, fallback to querying chain. if (!timelockAddress) { const client = new NeutronCwdSubdaoPreProposeSingleQueryClient( - await cosmWasmClientRouter.connect(getRpcForChainId(chainId)), + await cosmWasmClientRouter.connect(chainId), preProposeAddress ) @@ -222,7 +221,7 @@ export const fetchPreProposeModule = async ( // If indexer fails, fallback to querying chain. if (!config) { const client = new NeutronCwdSubdaoTimelockSingleQueryClient( - await cosmWasmClientRouter.connect(getRpcForChainId(chainId)), + await cosmWasmClientRouter.connect(chainId), timelockAddress ) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/fetchPrePropose.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/fetchPrePropose.ts index 633889bb5..1db1fc978 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/fetchPrePropose.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/fetchPrePropose.ts @@ -6,7 +6,6 @@ import { import { Feature, FetchPreProposeFunction } from '@dao-dao/types' import { cosmWasmClientRouter, - getRpcForChainId, isFeatureSupportedByVersion, } from '@dao-dao/utils' @@ -36,7 +35,7 @@ export const fetchPrePropose: FetchPreProposeFunction = async ( // If indexer fails, fallback to querying chain. if (!creationPolicy) { const client = new DaoProposalMultipleQueryClient( - await cosmWasmClientRouter.connect(getRpcForChainId(chainId)), + await cosmWasmClientRouter.connect(chainId), proposalModuleAddress ) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/fetchVetoConfig.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/fetchVetoConfig.ts index 2821255cc..7d154b65e 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/fetchVetoConfig.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/fetchVetoConfig.ts @@ -3,7 +3,6 @@ import { Feature, FetchVetoConfig } from '@dao-dao/types' import { Config } from '@dao-dao/types/contracts/DaoProposalMultiple' import { cosmWasmClientRouter, - getRpcForChainId, isFeatureSupportedByVersion, } from '@dao-dao/utils' @@ -33,7 +32,7 @@ export const fetchVetoConfig: FetchVetoConfig = async ( // If indexer fails, fallback to querying chain. if (!config) { const client = new DaoProposalMultipleQueryClient( - await cosmWasmClientRouter.connect(getRpcForChainId(chainId)), + await cosmWasmClientRouter.connect(chainId), proposalModuleAddress ) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/makeGetProposalInfo.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/makeGetProposalInfo.ts index 8ed6da957..752c71178 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/makeGetProposalInfo.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/makeGetProposalInfo.ts @@ -8,7 +8,7 @@ import { InfoResponse, } from '@dao-dao/types' import { ProposalResponse } from '@dao-dao/types/contracts/DaoProposalMultiple' -import { cosmWasmClientRouter, getRpcForChainId } from '@dao-dao/utils' +import { cosmWasmClientRouter } from '@dao-dao/utils' export const makeGetProposalInfo = ({ @@ -27,9 +27,7 @@ export const makeGetProposalInfo = let _cosmWasmClient: CosmWasmClient const getCosmWasmClient = async () => { if (!_cosmWasmClient) { - _cosmWasmClient = await cosmWasmClientRouter.connect( - getRpcForChainId(chainId) - ) + _cosmWasmClient = await cosmWasmClientRouter.connect(chainId) } return _cosmWasmClient } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/fetchPrePropose.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/fetchPrePropose.ts index 716ed5468..08f992a0a 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/fetchPrePropose.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/fetchPrePropose.ts @@ -6,7 +6,6 @@ import { import { Feature, FetchPreProposeFunction } from '@dao-dao/types' import { cosmWasmClientRouter, - getRpcForChainId, isFeatureSupportedByVersion, } from '@dao-dao/utils' @@ -37,7 +36,7 @@ export const fetchPrePropose: FetchPreProposeFunction = async ( // If indexer fails, fallback to querying chain. if (!creationPolicy) { const client = new DaoProposalSingleV2QueryClient( - await cosmWasmClientRouter.connect(getRpcForChainId(chainId)), + await cosmWasmClientRouter.connect(chainId), proposalModuleAddress ) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/fetchVetoConfig.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/fetchVetoConfig.ts index 098fee827..167b4b61f 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/fetchVetoConfig.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/fetchVetoConfig.ts @@ -3,7 +3,6 @@ import { Feature, FetchVetoConfig } from '@dao-dao/types' import { ConfigResponse } from '@dao-dao/types/contracts/DaoProposalSingle.v2' import { cosmWasmClientRouter, - getRpcForChainId, isFeatureSupportedByVersion, } from '@dao-dao/utils' @@ -33,7 +32,7 @@ export const fetchVetoConfig: FetchVetoConfig = async ( // If indexer fails, fallback to querying chain. if (!config) { const client = new DaoProposalSingleV2QueryClient( - await cosmWasmClientRouter.connect(getRpcForChainId(chainId)), + await cosmWasmClientRouter.connect(chainId), proposalModuleAddress ) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/makeGetProposalInfo.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/makeGetProposalInfo.ts index 5c1016199..52795d6e0 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/makeGetProposalInfo.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/makeGetProposalInfo.ts @@ -16,11 +16,7 @@ import { import { ProposalResponse as ProposalV1Response } from '@dao-dao/types/contracts/CwProposalSingle.v1' import { Proposal as DaoPreProposeApprovalSingleProposal } from '@dao-dao/types/contracts/DaoPreProposeApprovalSingle' import { ProposalResponse as ProposalV2Response } from '@dao-dao/types/contracts/DaoProposalSingle.v2' -import { - cosmWasmClientRouter, - getRpcForChainId, - parseContractVersion, -} from '@dao-dao/utils' +import { cosmWasmClientRouter, parseContractVersion } from '@dao-dao/utils' export const makeGetProposalInfo = ({ @@ -34,9 +30,7 @@ export const makeGetProposalInfo = let _cosmWasmClient: CosmWasmClient const getCosmWasmClient = async () => { if (!_cosmWasmClient) { - _cosmWasmClient = await cosmWasmClientRouter.connect( - getRpcForChainId(chainId) - ) + _cosmWasmClient = await cosmWasmClientRouter.connect(chainId) } return _cosmWasmClient } diff --git a/packages/stateful/utils/fetchProposalModules.ts b/packages/stateful/utils/fetchProposalModules.ts index 6ec65f889..9fa6f1bda 100644 --- a/packages/stateful/utils/fetchProposalModules.ts +++ b/packages/stateful/utils/fetchProposalModules.ts @@ -17,7 +17,6 @@ import { DaoProposalMultipleAdapterId, DaoProposalSingleAdapterId, cosmWasmClientRouter, - getRpcForChainId, indexToProposalModulePrefix, isFeatureSupportedByVersion, parseContractVersion, @@ -119,7 +118,7 @@ export const fetchProposalModulesWithInfoFromChain = async ( coreAddress: string, coreVersion: ContractVersion ): Promise => { - const cwClient = await cosmWasmClientRouter.connect(getRpcForChainId(chainId)) + const cwClient = await cosmWasmClientRouter.connect(chainId) let paginationStart: string | undefined From d79e6d8b64aa6bbece5f7fcca392b4cd664586fe Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 10 Jun 2024 01:38:52 -0400 Subject: [PATCH 219/438] replaced last manual client RPC connection with router --- packages/stateful/server/makeGetDaoStaticProps.ts | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/packages/stateful/server/makeGetDaoStaticProps.ts b/packages/stateful/server/makeGetDaoStaticProps.ts index 0d7bc886f..5485fb2b6 100644 --- a/packages/stateful/server/makeGetDaoStaticProps.ts +++ b/packages/stateful/server/makeGetDaoStaticProps.ts @@ -24,7 +24,6 @@ import { ProposalV1, ProposalV1Beta1, } from '@dao-dao/types' -import { cosmos } from '@dao-dao/types/protobuf' import { DAO_CORE_ACCENT_ITEM_KEY, DAO_STATIC_PROPS_CACHE_SECONDS, @@ -32,15 +31,14 @@ import { LEGACY_URL_PREFIX, MAINNET, MAX_META_CHARS_PROPOSAL_DESCRIPTION, + cosmosProtoRpcClientRouter, cosmosSdkVersionIs46OrHigher, decodeGovProposal, getChainForChainId, getChainIdForAddress, getConfiguredGovChainByName, getDaoPath, - getRpcForChainId, processError, - retry, } from '@dao-dao/utils' import { DaoPageWrapperProps } from '../components' @@ -380,15 +378,7 @@ export const makeGetDaoProposalStaticProps = ({ if (daoInfo.coreVersion === ContractVersion.Gov) { const url = getProposalUrlPrefix(params) + proposalId - const client = await retry( - 10, - async (attempt) => - ( - await cosmos.ClientFactory.createRPCQueryClient({ - rpcEndpoint: getRpcForChainId(chain.chain_id, attempt - 1), - }) - ).cosmos - ) + const client = await cosmosProtoRpcClientRouter.connect(chain.chain_id) const cosmosSdkVersion = ( await client.base.tendermint.v1beta1.getNodeInfo() From ed45fc17c506b91de1afd8ba3a983fb9d3b3e022 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 10 Jun 2024 03:01:06 -0400 Subject: [PATCH 220/438] removed unused cw3-fixed-multisig contract files --- packages/state/contracts/Cw3FixedMultisig.ts | 371 ------------------ packages/state/contracts/index.ts | 4 - .../selectors/contracts/Cw3FixedMultisig.ts | 146 ------- .../state/recoil/selectors/contracts/index.ts | 1 - 4 files changed, 522 deletions(-) delete mode 100644 packages/state/contracts/Cw3FixedMultisig.ts delete mode 100644 packages/state/recoil/selectors/contracts/Cw3FixedMultisig.ts diff --git a/packages/state/contracts/Cw3FixedMultisig.ts b/packages/state/contracts/Cw3FixedMultisig.ts deleted file mode 100644 index f0bdf558a..000000000 --- a/packages/state/contracts/Cw3FixedMultisig.ts +++ /dev/null @@ -1,371 +0,0 @@ -/** - * This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, - * and run the @cosmwasm/ts-codegen generate command to regenerate this file. - */ - -import { StdFee } from '@cosmjs/amino' -import { - CosmWasmClient, - ExecuteResult, - SigningCosmWasmClient, -} from '@cosmjs/cosmwasm-stargate' - -import { - Coin, - CosmosMsgForEmpty, - Expiration, - ProposalListResponseForEmpty, - ProposalResponseForEmpty, - ThresholdResponse, - Vote, - VoteListResponse, - VoteResponse, - VoterListResponse, - VoterResponse, -} from '@dao-dao/types/contracts/Cw3FixedMultisig' - -export interface Cw3FixedMultisigReadOnlyInterface { - contractAddress: string - threshold: () => Promise - proposal: ({ - proposalId, - }: { - proposalId: number - }) => Promise - listProposals: ({ - limit, - startAfter, - }: { - limit?: number - startAfter?: number - }) => Promise - reverseProposals: ({ - limit, - startBefore, - }: { - limit?: number - startBefore?: number - }) => Promise - getVote: ({ - proposalId, - voter, - }: { - proposalId: number - voter: string - }) => Promise - listVotes: ({ - limit, - proposalId, - startAfter, - }: { - limit?: number - proposalId: number - startAfter?: string - }) => Promise - voter: ({ address }: { address: string }) => Promise - listVoters: ({ - limit, - startAfter, - }: { - limit?: number - startAfter?: string - }) => Promise -} -export class Cw3FixedMultisigQueryClient - implements Cw3FixedMultisigReadOnlyInterface -{ - client: CosmWasmClient - contractAddress: string - - constructor(client: CosmWasmClient, contractAddress: string) { - this.client = client - this.contractAddress = contractAddress - this.threshold = this.threshold.bind(this) - this.proposal = this.proposal.bind(this) - this.listProposals = this.listProposals.bind(this) - this.reverseProposals = this.reverseProposals.bind(this) - this.getVote = this.getVote.bind(this) - this.listVotes = this.listVotes.bind(this) - this.voter = this.voter.bind(this) - this.listVoters = this.listVoters.bind(this) - } - - threshold = async (): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - threshold: {}, - }) - } - proposal = async ({ - proposalId, - }: { - proposalId: number - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - proposal: { - proposal_id: proposalId, - }, - }) - } - listProposals = async ({ - limit, - startAfter, - }: { - limit?: number - startAfter?: number - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - list_proposals: { - limit, - start_after: startAfter, - }, - }) - } - reverseProposals = async ({ - limit, - startBefore, - }: { - limit?: number - startBefore?: number - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - reverse_proposals: { - limit, - start_before: startBefore, - }, - }) - } - getVote = async ({ - proposalId, - voter, - }: { - proposalId: number - voter: string - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - vote: { - proposal_id: proposalId, - voter, - }, - }) - } - listVotes = async ({ - limit, - proposalId, - startAfter, - }: { - limit?: number - proposalId: number - startAfter?: string - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - list_votes: { - limit, - proposal_id: proposalId, - start_after: startAfter, - }, - }) - } - voter = async ({ address }: { address: string }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - voter: { - address, - }, - }) - } - listVoters = async ({ - limit, - startAfter, - }: { - limit?: number - startAfter?: string - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - list_voters: { - limit, - start_after: startAfter, - }, - }) - } -} -export interface Cw3FixedMultisigInterface - extends Cw3FixedMultisigReadOnlyInterface { - contractAddress: string - sender: string - propose: ( - { - description, - latest, - msgs, - title, - }: { - description: string - latest?: Expiration - msgs: CosmosMsgForEmpty[] - title: string - }, - fee?: number | StdFee | 'auto', - memo?: string, - _funds?: Coin[] - ) => Promise - vote: ( - { - proposalId, - vote, - }: { - proposalId: number - vote: Vote - }, - fee?: number | StdFee | 'auto', - memo?: string, - _funds?: Coin[] - ) => Promise - execute: ( - { - proposalId, - }: { - proposalId: number - }, - fee?: number | StdFee | 'auto', - memo?: string, - _funds?: Coin[] - ) => Promise - close: ( - { - proposalId, - }: { - proposalId: number - }, - fee?: number | StdFee | 'auto', - memo?: string, - _funds?: Coin[] - ) => Promise -} -export class Cw3FixedMultisigClient - extends Cw3FixedMultisigQueryClient - implements Cw3FixedMultisigInterface -{ - client: SigningCosmWasmClient - sender: string - contractAddress: string - - constructor( - client: SigningCosmWasmClient, - sender: string, - contractAddress: string - ) { - super(client, contractAddress) - this.client = client - this.sender = sender - this.contractAddress = contractAddress - this.propose = this.propose.bind(this) - this.vote = this.vote.bind(this) - this.execute = this.execute.bind(this) - this.close = this.close.bind(this) - } - - propose = async ( - { - description, - latest, - msgs, - title, - }: { - description: string - latest?: Expiration - msgs: CosmosMsgForEmpty[] - title: string - }, - fee: number | StdFee | 'auto' = 'auto', - memo?: string, - _funds?: Coin[] - ): Promise => { - return await this.client.execute( - this.sender, - this.contractAddress, - { - propose: { - description, - latest, - msgs, - title, - }, - }, - fee, - memo, - _funds - ) - } - vote = async ( - { - proposalId, - vote, - }: { - proposalId: number - vote: Vote - }, - fee: number | StdFee | 'auto' = 'auto', - memo?: string, - _funds?: Coin[] - ): Promise => { - return await this.client.execute( - this.sender, - this.contractAddress, - { - vote: { - proposal_id: proposalId, - vote, - }, - }, - fee, - memo, - _funds - ) - } - execute = async ( - { - proposalId, - }: { - proposalId: number - }, - fee: number | StdFee | 'auto' = 'auto', - memo?: string, - _funds?: Coin[] - ): Promise => { - return await this.client.execute( - this.sender, - this.contractAddress, - { - execute: { - proposal_id: proposalId, - }, - }, - fee, - memo, - _funds - ) - } - close = async ( - { - proposalId, - }: { - proposalId: number - }, - fee: number | StdFee | 'auto' = 'auto', - memo?: string, - _funds?: Coin[] - ): Promise => { - return await this.client.execute( - this.sender, - this.contractAddress, - { - close: { - proposal_id: proposalId, - }, - }, - fee, - memo, - _funds - ) - } -} diff --git a/packages/state/contracts/index.ts b/packages/state/contracts/index.ts index e253fa69c..2e229ac27 100644 --- a/packages/state/contracts/index.ts +++ b/packages/state/contracts/index.ts @@ -1,8 +1,4 @@ export { Cw1WhitelistClient, Cw1WhitelistQueryClient } from './Cw1Whitelist' -export { - Cw3FixedMultisigClient, - Cw3FixedMultisigQueryClient, -} from './Cw3FixedMultisig' export { Cw3FlexMultisigClient, Cw3FlexMultisigQueryClient, diff --git a/packages/state/recoil/selectors/contracts/Cw3FixedMultisig.ts b/packages/state/recoil/selectors/contracts/Cw3FixedMultisig.ts deleted file mode 100644 index 4bf983b7f..000000000 --- a/packages/state/recoil/selectors/contracts/Cw3FixedMultisig.ts +++ /dev/null @@ -1,146 +0,0 @@ -import { selectorFamily } from 'recoil' - -import { WithChainId } from '@dao-dao/types' -import { - ProposalListResponseForEmpty, - ProposalResponseForEmpty, - ThresholdResponse, - VoteListResponse, - VoteResponse, - VoterListResponse, - VoterResponse, -} from '@dao-dao/types/contracts/Cw3FixedMultisig' - -import { Cw3FixedMultisigQueryClient } from '../../../contracts/Cw3FixedMultisig' -import { cosmWasmClientForChainSelector } from '../chain' - -type QueryClientParams = WithChainId<{ - contractAddress: string -}> - -export const queryClient = selectorFamily< - Cw3FixedMultisigQueryClient, - QueryClientParams ->({ - key: 'cw3FixedMultisigQueryClient', - get: - ({ contractAddress, chainId }) => - ({ get }) => { - const client = get(cosmWasmClientForChainSelector(chainId)) - return new Cw3FixedMultisigQueryClient(client, contractAddress) - }, - dangerouslyAllowMutability: true, -}) - -export const thresholdSelector = selectorFamily< - ThresholdResponse, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cw3FixedMultisigThreshold', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.threshold(...params) - }, -}) -export const proposalSelector = selectorFamily< - ProposalResponseForEmpty, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cw3FixedMultisigProposal', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.proposal(...params) - }, -}) -export const listProposalsSelector = selectorFamily< - ProposalListResponseForEmpty, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cw3FixedMultisigListProposals', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.listProposals(...params) - }, -}) -export const reverseProposalsSelector = selectorFamily< - ProposalListResponseForEmpty, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cw3FixedMultisigReverseProposals', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.reverseProposals(...params) - }, -}) -export const getVoteSelector = selectorFamily< - VoteResponse, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cw3FixedMultisigVote', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.getVote(...params) - }, -}) -export const listVotesSelector = selectorFamily< - VoteListResponse, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cw3FixedMultisigListVotes', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.listVotes(...params) - }, -}) -export const voterSelector = selectorFamily< - VoterResponse, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cw3FixedMultisigVoter', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.voter(...params) - }, -}) -export const listVotersSelector = selectorFamily< - VoterListResponse, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cw3FixedMultisigListVoters', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.listVoters(...params) - }, -}) diff --git a/packages/state/recoil/selectors/contracts/index.ts b/packages/state/recoil/selectors/contracts/index.ts index 397eb9dbb..d3901523a 100644 --- a/packages/state/recoil/selectors/contracts/index.ts +++ b/packages/state/recoil/selectors/contracts/index.ts @@ -1,6 +1,5 @@ export * as CommonNftSelectors from './CommonNft' export * as Cw1WhitelistSelectors from './Cw1Whitelist' -export * as Cw3FixedMultisigSelectors from './Cw3FixedMultisig' export * as Cw3FlexMultisigSelectors from './Cw3FlexMultisig' export * as Cw4GroupSelectors from './Cw4Group' export * as Cw20BaseSelectors from './Cw20Base' From 2bce5a7674b4564b392c92a55668dd4585d45aa1 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 10 Jun 2024 03:11:34 -0400 Subject: [PATCH 221/438] added cwgen script to generate types, clients, and queries for contracts --- package.json | 1 + packages/config/README.md | 15 +++ packages/config/package.json | 8 ++ packages/config/scripts/cwgen.ts | 176 +++++++++++++++++++++++++++++++ yarn.lock | 176 ++++++++++++++++++++++++++++++- 5 files changed, 375 insertions(+), 1 deletion(-) create mode 100644 packages/config/scripts/cwgen.ts diff --git a/package.json b/package.json index 55754aa47..fc3aed936 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "lint": "prettier --check \"**/*.{css,json,md}\" && turbo run lint --continue --parallel", "test": "jest", "test:e2e": "yarn dapp test:e2e", + "cwgen": "yarn workspace @dao-dao/config cwgen", "dapp": "yarn workspace @dao-dao/dapp", "sda": "yarn workspace @dao-dao/sda", "i18n": "yarn workspace @dao-dao/i18n", diff --git a/packages/config/README.md b/packages/config/README.md index ecd3d49c2..4cb714f06 100644 --- a/packages/config/README.md +++ b/packages/config/README.md @@ -10,3 +10,18 @@ Configuration package for various dev tools (e.g. ESLint, Prettier, TSC, etc.) | [`prettier`](./prettier/index.js) | [Prettier](https://prettier.io/) config. | | [`tailwind`](./tailwind) | [Tailwind CSS](https://tailwindcss.com/) config. | | [`ts`](./ts) | [TypeScript](https://www.typescriptlang.org/) config. | + +## Commands + +### cwgen + +``` +Usage: yarn cwgen [options] + +Generate types, clients, and queries for CosmWasm contracts, modify them for use with this codebase, and install them in the right places. + +Options: + -n, --name contract name + -p, --path path to contract folder that contains "schema" folder + -h, --help display help for command +``` diff --git a/packages/config/package.json b/packages/config/package.json index f0f4b6755..0a23e0de4 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -2,6 +2,9 @@ "name": "@dao-dao/config", "version": "2.4.0-rc.8", "license": "BSD-3-Clause-Clear", + "scripts": { + "cwgen": "ts-node ./scripts/cwgen.ts" + }, "dependencies": { "@tailwindcss/typography": "^0.5.1", "@typescript-eslint/eslint-plugin": "6.14.0", @@ -24,6 +27,11 @@ "tailwindcss-safe-area": "^0.4.1", "typescript": "5.3.3" }, + "devDependencies": { + "@cosmwasm/ts-codegen": "^1.10.0", + "commander": "^12.1.0", + "ts-node": "^10.9.2" + }, "prettier": "./prettier/index.js", "gitHead": "67c8ffb27c34ee37b9367d3fde6856085081f40c" } diff --git a/packages/config/scripts/cwgen.ts b/packages/config/scripts/cwgen.ts new file mode 100644 index 000000000..ac659b2ea --- /dev/null +++ b/packages/config/scripts/cwgen.ts @@ -0,0 +1,176 @@ +/** + * Generate types, clients, and queries for CosmWasm contracts based on their + * schema JSON. + */ + +import { execSync } from 'child_process' +import fs from 'fs' +import path from 'path' + +import codegen from '@cosmwasm/ts-codegen' +import { Command } from 'commander' + +const TMP_FOLDER = '.cwgen.tmp' +const CLIENTS_INDEX = path.join(__dirname, '../../state/contracts/index.ts') +const QUERIES_INDEX = path.join( + __dirname, + '../../state/query/queries/contracts/index.ts' +) + +// Parse arguments. +const program = new Command() +program.description( + 'Generate types, clients, and queries for CosmWasm contracts, modify them for use with this codebase, and install them in the right places.' +) +program.requiredOption('-n, --name ', 'contract name') +program.requiredOption( + '-p, --path ', + 'path to contract folder that contains "schema" folder' +) +program.parse() +const { name, path: dir } = program.opts() + +codegen({ + contracts: [ + { + name, + dir, + }, + ], + outPath: TMP_FOLDER, + options: { + types: { + enabled: true, + }, + client: { + enabled: true, + }, + reactQuery: { + enabled: true, + optionalClient: false, + version: 'v4', + mutations: false, + queryKeys: true, + queryFactory: true, + }, + bundle: { + enabled: false, + }, + recoil: { + enabled: false, + }, + messageComposer: { + enabled: false, + }, + messageBuilder: { + enabled: false, + }, + useContractsHook: { + enabled: false, + }, + }, +}).then(() => { + // modify the generated files + const files = fs.readdirSync('.cwgen.tmp') + for (const file of files) { + const contractName = file.split('.')[0] + + const filePath = path.join('.cwgen.tmp', file) + let content = fs.readFileSync(filePath, 'utf8') + + // remove comment from beginning + // content = content.replace(/^\/\*\*[\s\S]+\*\/\n\n/gm, '') + + // fix types imports + content = content.replace( + /from "\.\/(.+)\.types"/, + 'from "@dao-dao/types/contracts/$1"' + ) + + // modify client + if (file.endsWith('.client.ts')) { + // replace default fee with CHAIN_GAS_MULTIPLIER constant + content = content.replace( + /"auto" = "auto"/g, + '"auto" = CHAIN_GAS_MULTIPLIER' + ) + // insert import on line 3 + content = content.replace( + 'export interface', + "import { CHAIN_GAS_MULTIPLIER } from '@dao-dao/utils'\n\nexport interface" + ) + + // add index export if not already added + if (!fs.readFileSync(CLIENTS_INDEX, 'utf8').includes(contractName)) { + fs.appendFileSync( + CLIENTS_INDEX, + `export { ${contractName}Client, ${contractName}QueryClient } from './${contractName}'\n` + ) + } + } + // modify react-query + else if (file.endsWith('.react-query.ts')) { + // fix client import + content = content.replace( + /from "\.\/(.+)\.client"/, + 'from "../../../contracts/$1"\n' + ) + // add import + content = content.replace( + 'export const', + "import { cosmWasmClientRouter } from '@dao-dao/utils'\n\nexport const" + ) + // remove hooks + content = content.replace(/\nexport function use.+\n[^;]+;\n\}/gm, '') + // fix type bug + content = content.replace( + `"'queryKey' | 'queryFn' | 'initialData'"`, + '"queryKey" | "queryFn" | "initialData"' + ) + // replace client with chain ID and contract address + content = content.replace( + /client: [^;]+;/g, + 'chainId: string;\n contractAddress: string;' + ) + content = content.replace(/client,/g, 'chainId, contractAddress,') + content = content.replace(/client\?\.contractAddress/g, 'contractAddress') + content = content.replace( + /queryFn: \(\) => client/g, + `queryFn: async () => new ${contractName}QueryClient(await cosmWasmClientRouter.connect(chainId), contractAddress)` + ) + // remove enabled lines + content = content.replace(/ +enabled:[^)]+\)\n/g, '') + + // add index export if not already added + if (!fs.readFileSync(QUERIES_INDEX, 'utf8').includes(contractName)) { + fs.appendFileSync(QUERIES_INDEX, `export * from './${contractName}'\n`) + } + } + + // save modified files to proper homes + const outPath = file.endsWith('.types.ts') + ? path.join(__dirname, '../../types/contracts/', contractName + '.ts') + : file.endsWith('.client.ts') + ? path.join(__dirname, '../../state/contracts/', contractName + '.ts') + : file.endsWith('.react-query.ts') + ? path.join( + __dirname, + '../../state/query/queries/contracts/', + contractName + '.ts' + ) + : undefined + + if (!outPath) { + throw new Error('unexpected file: ' + file) + } + + fs.writeFileSync(outPath, content) + } + + // remove tmp folder + fs.rmSync(TMP_FOLDER, { recursive: true }) + + // format the generated files + execSync(`cd ${path.join(__dirname, '../../types')} && yarn format`) + execSync(`cd ${path.join(__dirname, '../../state')} && yarn format`) +}) diff --git a/yarn.lock b/yarn.lock index b0985b4b9..690c4a293 100644 --- a/yarn.lock +++ b/yarn.lock @@ -804,6 +804,14 @@ "@babel/highlight" "^7.23.4" chalk "^2.4.2" +"@babel/code-frame@^7.24.1": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.7.tgz#882fd9e09e8ee324e496bd040401c6f046ef4465" + integrity sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA== + dependencies: + "@babel/highlight" "^7.24.7" + picocolors "^1.0.0" + "@babel/compat-data@^7.17.7", "@babel/compat-data@^7.18.8", "@babel/compat-data@^7.20.5", "@babel/compat-data@^7.22.9": version "7.22.9" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.9.tgz#71cdb00a1ce3a329ce4cbec3a44f9fef35669730" @@ -882,6 +890,16 @@ "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" +"@babel/generator@7.24.4": + version "7.24.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.24.4.tgz#1fc55532b88adf952025d5d2d1e71f946cb1c498" + integrity sha512-Xd6+v6SnjWVx/nus+y0l1sxMOTOMBkyL4+BIdbALyatQnAe/SRVjANeDPSCYaX+i1iJmuGSKf3Z+E+V/va1Hvw== + dependencies: + "@babel/types" "^7.24.0" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^2.5.1" + "@babel/generator@^7.12.11", "@babel/generator@^7.12.5", "@babel/generator@^7.14.0", "@babel/generator@^7.18.10", "@babel/generator@^7.18.13", "@babel/generator@^7.23.3", "@babel/generator@^7.23.6", "@babel/generator@^7.7.2": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.6.tgz#9e1fca4811c77a10580d17d26b57b036133f3c2e" @@ -892,6 +910,16 @@ "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" +"@babel/generator@^7.24.1": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.24.7.tgz#1654d01de20ad66b4b4d99c135471bc654c55e6d" + integrity sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA== + dependencies: + "@babel/types" "^7.24.7" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^2.5.1" + "@babel/helper-annotate-as-pure@^7.18.6", "@babel/helper-annotate-as-pure@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" @@ -1080,11 +1108,21 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== +"@babel/helper-string-parser@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz#4d2d0f14820ede3b9807ea5fc36dfc8cd7da07f2" + integrity sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg== + "@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.22.20", "@babel/helper-validator-identifier@^7.22.5": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== +"@babel/helper-validator-identifier@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz#75b889cfaf9e35c2aaf42cf0d72c8e91719251db" + integrity sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w== + "@babel/helper-validator-option@^7.18.6", "@babel/helper-validator-option@^7.22.15", "@babel/helper-validator-option@^7.22.5": version "7.22.15" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz#694c30dfa1d09a6534cdfcafbe56789d36aba040" @@ -1117,6 +1155,16 @@ chalk "^2.4.2" js-tokens "^4.0.0" +"@babel/highlight@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.24.7.tgz#a05ab1df134b286558aae0ed41e6c5f731bf409d" + integrity sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw== + dependencies: + "@babel/helper-validator-identifier" "^7.24.7" + chalk "^2.4.2" + js-tokens "^4.0.0" + picocolors "^1.0.0" + "@babel/parser@7.18.11": version "7.18.11" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.11.tgz#68bb07ab3d380affa9a3f96728df07969645d2d9" @@ -1127,6 +1175,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.6.tgz#ba1c9e512bda72a47e285ae42aff9d2a635a9e3b" integrity sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ== +"@babel/parser@^7.24.1": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.7.tgz#9a5226f92f0c5c8ead550b750f5608e766c8ce85" + integrity sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw== + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz#da5b8f9a580acdfbe53494dba45ea389fb09a4d2" @@ -1994,6 +2047,22 @@ debug "^4.3.1" globals "^11.1.0" +"@babel/traverse@7.24.1": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.24.1.tgz#d65c36ac9dd17282175d1e4a3c49d5b7988f530c" + integrity sha512-xuU6o9m68KeqZbQuDt2TcKSxUw/mrsvavlEqQ1leZ/B+C9tk6E4sRWy97WaXgvq5E+nU3cXMxv3WKOCanVMCmQ== + dependencies: + "@babel/code-frame" "^7.24.1" + "@babel/generator" "^7.24.1" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/parser" "^7.24.1" + "@babel/types" "^7.24.0" + debug "^4.3.1" + globals "^11.1.0" + "@babel/types@7.18.10": version "7.18.10" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.18.10.tgz#4908e81b6b339ca7c6b7a555a5fc29446f26dde6" @@ -2012,6 +2081,24 @@ "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" +"@babel/types@7.24.0": + version "7.24.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.24.0.tgz#3b951f435a92e7333eba05b7566fd297960ea1bf" + integrity sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w== + dependencies: + "@babel/helper-string-parser" "^7.23.4" + "@babel/helper-validator-identifier" "^7.22.20" + to-fast-properties "^2.0.0" + +"@babel/types@^7.24.0", "@babel/types@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.24.7.tgz#6027fe12bc1aa724cd32ab113fb7f1988f1f66f2" + integrity sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q== + dependencies: + "@babel/helper-string-parser" "^7.24.7" + "@babel/helper-validator-identifier" "^7.24.7" + to-fast-properties "^2.0.0" + "@base2/pretty-print-object@1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@base2/pretty-print-object/-/pretty-print-object-1.0.1.tgz#371ba8be66d556812dc7fb169ebc3c08378f69d4" @@ -2777,6 +2864,22 @@ "@keplr-wallet/types" "0.12.12" ses "^0.18.4" +"@cosmwasm/ts-codegen-ast@^1.6.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@cosmwasm/ts-codegen-ast/-/ts-codegen-ast-1.6.0.tgz#c3d0ffd6e24526ae83069be82e553472d61cdb73" + integrity sha512-Wf1jOkWWXJLd1H5DbZEf4+jZ/imrbbr8kbLbEwKwggvi4j3frwbeO7uUJMz6PulrHImaCBO0fWjVoeqsc210Gg== + dependencies: + "@babel/types" "7.24.0" + "@cosmwasm/ts-codegen-types" "^1.3.0" + ast-stringify "0.1.0" + case "1.6.3" + deepmerge "4.2.2" + +"@cosmwasm/ts-codegen-types@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@cosmwasm/ts-codegen-types/-/ts-codegen-types-1.3.0.tgz#9839d0521a3e1acc7145a5efe907590c93938b75" + integrity sha512-DF6CM+Pq+gqFY0jtLLzvxJaHsUrszn3WdyIrsM1SrEXzTtS9yg/pGMedVJ83SEREoz7MiG/0ori3Ghi3WSgnOg== + "@cosmwasm/ts-codegen@0.34.0": version "0.34.0" resolved "https://registry.yarnpkg.com/@cosmwasm/ts-codegen/-/ts-codegen-0.34.0.tgz#659bb69fc5f74cbd623567f3090e69072f08b23c" @@ -2810,6 +2913,32 @@ shelljs "0.8.5" wasm-ast-types "^0.25.0" +"@cosmwasm/ts-codegen@^1.10.0": + version "1.10.0" + resolved "https://registry.yarnpkg.com/@cosmwasm/ts-codegen/-/ts-codegen-1.10.0.tgz#0c73e15e0e74c297ef61d1c660a601d15319c642" + integrity sha512-c/I4XOU2+28mJOeuHYSLRxGdCe7gXqY2v8u7UfC/t//W/gQ29sV5MxV0nYTLJDwqE3l45eje3Hx6DSj13Aspyg== + dependencies: + "@babel/generator" "7.24.4" + "@babel/traverse" "7.24.1" + "@babel/types" "7.24.0" + "@cosmwasm/ts-codegen-ast" "^1.6.0" + "@cosmwasm/ts-codegen-types" "^1.3.0" + "@pyramation/json-schema-to-typescript" " 11.0.4" + "@types/rimraf" "3.0.2" + "@types/shelljs" "0.8.15" + case "1.6.3" + dargs "7.0.0" + deepmerge "4.2.2" + fuzzy "0.1.3" + glob "8.0.3" + inquirerer "0.1.3" + minimist "1.2.6" + mkdirp "1.0.4" + nested-obj "0.0.1" + parse-package-name "1.0.0" + rimraf "3.0.2" + shelljs "0.8.5" + "@cspotcode/source-map-support@^0.8.0": version "0.8.1" resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" @@ -8128,7 +8257,7 @@ dependencies: "@types/node" "*" -"@types/glob@*", "@types/glob@^7.1.1", "@types/glob@^7.1.3": +"@types/glob@*", "@types/glob@^7.1.1", "@types/glob@^7.1.3", "@types/glob@~7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb" integrity sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA== @@ -8445,6 +8574,14 @@ resolved "https://registry.yarnpkg.com/@types/remove-markdown/-/remove-markdown-0.3.1.tgz#82bc3664c313f50f7c77f1bb59935f567689dc63" integrity sha512-JpJNEJEsmmltyL2LdE8KRjJ0L2ad5vgLibqNj85clohT9AyTrfN6jvHxStPshDkmtcL/ShFu0p2tbY7DBS1mqQ== +"@types/rimraf@3.0.2": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-3.0.2.tgz#a63d175b331748e5220ad48c901d7bbf1f44eef8" + integrity sha512-F3OznnSLAUxFrCEu/L5PY8+ny8DtcFRjx7fZZ9bycvXRi3KPTRS9HOitGZwvPg0juRhXFWIeKX58cnX5YqLohQ== + dependencies: + "@types/glob" "*" + "@types/node" "*" + "@types/ripemd160@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@types/ripemd160/-/ripemd160-2.0.0.tgz#d33e49cf66edf4668828030d4aa80116bbf8ae81" @@ -8462,6 +8599,14 @@ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.6.tgz#c65b2bfce1bec346582c07724e3f8c1017a20339" integrity sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A== +"@types/shelljs@0.8.15": + version "0.8.15" + resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.8.15.tgz#22c6ab9dfe05cec57d8e6cb1a95ea173aee9fcac" + integrity sha512-vzmnCHl6hViPu9GNLQJ+DZFd6BQI2DBTUeOvYHqkWQLMfKAAQYMb/xAmZkTogZI/vqXHCWkqDRymDI5p0QTi5Q== + dependencies: + "@types/glob" "~7.2.0" + "@types/node" "*" + "@types/source-list-map@*": version "0.1.2" resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9" @@ -11747,6 +11892,11 @@ commander@^11.0.0: resolved "https://registry.yarnpkg.com/commander/-/commander-11.0.0.tgz#43e19c25dbedc8256203538e8d7e9346877a6f67" integrity sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ== +commander@^12.1.0: + version "12.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3" + integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA== + commander@^2.19.0, commander@^2.20.0, commander@^2.20.3: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" @@ -19033,6 +19183,11 @@ nested-error-stacks@^2.0.0, nested-error-stacks@^2.1.0: resolved "https://registry.yarnpkg.com/nested-error-stacks/-/nested-error-stacks-2.1.1.tgz#26c8a3cee6cc05fbcf1e333cd2fc3e003326c0b5" integrity sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw== +nested-obj@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/nested-obj/-/nested-obj-0.0.1.tgz#efe1da127c3d00826fa10ec25673e0f9ec1224fd" + integrity sha512-kB1WKTng+IePQhZVs1UXtFaHBx4QEM5a0XKGAzYfCKvdx5DhNjCytNDWMUGpNNpHLotln+tiwcA52kWCIgGq1Q== + next-i18next@^11.0.0: version "11.0.0" resolved "https://registry.yarnpkg.com/next-i18next/-/next-i18next-11.0.0.tgz#2857d13c58a5ed976fe57c44286f1520b07f7c96" @@ -23822,6 +23977,25 @@ ts-node@^10.9.1: v8-compile-cache-lib "^3.0.1" yn "3.1.1" +ts-node@^10.9.2: + version "10.9.2" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" + integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + ts-pnp@^1.1.6: version "1.2.0" resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.2.0.tgz#a500ad084b0798f1c3071af391e65912c86bca92" From 0bf4ff24fa5d6846d8e04b08d0e41cb8bc47f255 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 10 Jun 2024 03:35:36 -0400 Subject: [PATCH 222/438] turned multisig selectors into queries --- packages/state/contracts/Cw3FlexMultisig.ts | 17 +- packages/state/query/queries/account.ts | 243 ++++++++++- .../queries/contracts/Cw3FlexMultisig.ts | 404 ++++++++++++++++++ .../state/query/queries/contracts/index.ts | 1 + packages/state/recoil/selectors/account.ts | 194 +-------- .../selectors/contracts/Cw3FlexMultisig.ts | 203 --------- .../state/recoil/selectors/contracts/index.ts | 1 - .../components/dao/ImportMultisigModal.tsx | 26 +- .../dao/create/ImportMultisigModal.tsx | 35 +- .../dao/create/pages/CreateDaoStart.tsx | 6 +- packages/types/account.ts | 86 ++-- .../types/components/ImportMultisigModal.ts | 8 +- packages/types/contracts/Cw3FlexMultisig.ts | 2 +- 13 files changed, 747 insertions(+), 479 deletions(-) create mode 100644 packages/state/query/queries/contracts/Cw3FlexMultisig.ts delete mode 100644 packages/state/recoil/selectors/contracts/Cw3FlexMultisig.ts diff --git a/packages/state/contracts/Cw3FlexMultisig.ts b/packages/state/contracts/Cw3FlexMultisig.ts index 5a8cc5c78..14bf95a34 100644 --- a/packages/state/contracts/Cw3FlexMultisig.ts +++ b/packages/state/contracts/Cw3FlexMultisig.ts @@ -1,5 +1,5 @@ /** - * This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -26,6 +26,7 @@ import { VoterListResponse, VoterResponse, } from '@dao-dao/types/contracts/Cw3FlexMultisig' +import { CHAIN_GAS_MULTIPLIER } from '@dao-dao/utils' export interface Cw3FlexMultisigReadOnlyInterface { contractAddress: string @@ -80,7 +81,6 @@ export class Cw3FlexMultisigQueryClient { client: CosmWasmClient contractAddress: string - constructor(client: CosmWasmClient, contractAddress: string) { this.client = client this.contractAddress = contractAddress @@ -94,7 +94,6 @@ export class Cw3FlexMultisigQueryClient this.listVoters = this.listVoters.bind(this) this.config = this.config.bind(this) } - threshold = async (): Promise => { return this.client.queryContractSmart(this.contractAddress, { threshold: {}, @@ -267,7 +266,6 @@ export class Cw3FlexMultisigClient client: SigningCosmWasmClient sender: string contractAddress: string - constructor( client: SigningCosmWasmClient, sender: string, @@ -283,7 +281,6 @@ export class Cw3FlexMultisigClient this.close = this.close.bind(this) this.memberChangedHook = this.memberChangedHook.bind(this) } - propose = async ( { description, @@ -296,7 +293,7 @@ export class Cw3FlexMultisigClient msgs: CosmosMsgForEmpty[] title: string }, - fee: number | StdFee | 'auto' = 'auto', + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, _funds?: Coin[] ): Promise => { @@ -324,7 +321,7 @@ export class Cw3FlexMultisigClient proposalId: number vote: Vote }, - fee: number | StdFee | 'auto' = 'auto', + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, _funds?: Coin[] ): Promise => { @@ -348,7 +345,7 @@ export class Cw3FlexMultisigClient }: { proposalId: number }, - fee: number | StdFee | 'auto' = 'auto', + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, _funds?: Coin[] ): Promise => { @@ -371,7 +368,7 @@ export class Cw3FlexMultisigClient }: { proposalId: number }, - fee: number | StdFee | 'auto' = 'auto', + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, _funds?: Coin[] ): Promise => { @@ -394,7 +391,7 @@ export class Cw3FlexMultisigClient }: { diffs: MemberDiff[] }, - fee: number | StdFee | 'auto' = 'auto', + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, _funds?: Coin[] ): Promise => { diff --git a/packages/state/query/queries/account.ts b/packages/state/query/queries/account.ts index 78507819c..3bc0bafd1 100644 --- a/packages/state/query/queries/account.ts +++ b/packages/state/query/queries/account.ts @@ -1,15 +1,31 @@ -import { QueryClient, queryOptions } from '@tanstack/react-query' +import { toHex } from '@cosmjs/encoding' +import { QueryClient, queryOptions, skipToken } from '@tanstack/react-query' -import { Account, AccountType } from '@dao-dao/types' import { + Account, + AccountType, + CryptographicMultisigAccount, + Cw3MultisigAccount, + MultisigAccount, +} from '@dao-dao/types' +import { Threshold } from '@dao-dao/types/contracts/DaoProposalSingle.common' +import { BaseAccount } from '@dao-dao/types/protobuf/codegen/cosmos/auth/v1beta1/auth' +import { LegacyAminoPubKey } from '@dao-dao/types/protobuf/codegen/cosmos/crypto/multisig/keys' +import { PubKey as Secp256k1PubKey } from '@dao-dao/types/protobuf/codegen/cosmos/crypto/secp256k1/keys' +import { + ContractName, ICA_CHAINS_TX_PREFIX, + cosmosProtoRpcClientRouter, + getChainForChainId, getConfiguredChainConfig, getIbcTransferInfoBetweenChains, ibcProtoRpcClientRouter, + secp256k1PublicKeyToBech32Address, } from '@dao-dao/utils' import { chainQueries } from './chain' import { contractQueries } from './contract' +import { cw3FlexMultisigQueries } from './contracts' import { daoDaoCoreQueries } from './contracts/DaoDaoCore' import { polytoneQueries } from './polytone' @@ -169,6 +185,195 @@ export const fetchRemoteIcaAddress = async ({ } } +/** + * Fetch the details of a cryptographic multisig account. + */ +export const fetchCryptographicMultisigAccount = async ({ + chainId, + address, +}: { + chainId: string + address: string +}): Promise => { + const { bech32_prefix: bech32Prefix } = getChainForChainId(chainId) + const client = await cosmosProtoRpcClientRouter.connect(chainId) + + const { account } = await client.auth.v1beta1.account({ + address, + }) + + if ( + !account || + account.$typeUrl !== BaseAccount.typeUrl || + account.pubKey?.typeUrl !== LegacyAminoPubKey.typeUrl + ) { + throw new Error('Not a multisig address.') + } + + const { publicKeys, threshold } = LegacyAminoPubKey.decode( + account.pubKey.value + ) + + if (publicKeys.some(({ typeUrl }) => typeUrl !== Secp256k1PubKey.typeUrl)) { + throw new Error('Unsupported multisig.') + } + + const addresses = await Promise.all( + publicKeys.map((key) => + secp256k1PublicKeyToBech32Address( + toHex(Secp256k1PubKey.decode(key.value).key), + bech32Prefix + ) + ) + ) + + return { + type: AccountType.CryptographicMultisig, + chainId, + address, + config: { + members: addresses.map((address) => ({ + address, + weight: 1, + })), + threshold: { + absolute_count: { + threshold: BigInt(threshold).toString(), + }, + }, + totalWeight: addresses.length, + }, + } +} + +/** + * Fetch the details of a cw3-fixed or cw3-flex multisig account. + */ +export const fetchCw3MultisigAccount = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise => { + const isCw3Multisig = await queryClient.fetchQuery( + contractQueries.isContract(queryClient, { + chainId, + address, + nameOrNames: [ + ContractName.Cw3FixedMultisig, + ContractName.Cw3FlexMultisig, + ], + }) + ) + + if (!isCw3Multisig) { + throw new Error('Not a multisig address.') + } + + const [_threshold, { voters }] = await Promise.all([ + queryClient.fetchQuery( + cw3FlexMultisigQueries.threshold({ + chainId, + contractAddress: address, + }) + ), + queryClient.fetchQuery( + cw3FlexMultisigQueries.listAllVoters({ + queryClient, + chainId, + contractAddress: address, + }) + ), + ]) + + const threshold: Threshold | undefined = + 'absolute_count' in _threshold + ? { + absolute_count: { + threshold: BigInt(_threshold.absolute_count.weight).toString(), + }, + } + : 'absolute_percentage' in _threshold + ? { + absolute_percentage: { + percentage: { + percent: _threshold.absolute_percentage.percentage, + }, + }, + } + : 'threshold_quorum' in _threshold + ? { + threshold_quorum: { + quorum: { + percent: _threshold.threshold_quorum.quorum, + }, + threshold: { + percent: _threshold.threshold_quorum.threshold, + }, + }, + } + : undefined + + if (!threshold) { + throw new Error('Unsupported cw3 multisig.') + } + + return { + type: AccountType.Cw3Multisig, + chainId, + address, + config: { + members: voters.map(({ addr, weight }) => ({ + address: addr, + weight, + })), + threshold, + totalWeight: voters.reduce((acc, { weight }) => acc + weight, 0), + }, + } +} + +/** + * Fetch the details of any multisig account. + */ +export const fetchMultisigAccount = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise => { + const [cryptographicMultisig, cw3Multisig] = await Promise.allSettled([ + queryClient.fetchQuery( + accountQueries.cryptographicMultisig({ + chainId, + address, + }) + ), + queryClient.fetchQuery( + accountQueries.cw3Multisig(queryClient, { + chainId, + address, + }) + ), + ]) + + if (cryptographicMultisig.status === 'fulfilled') { + return cryptographicMultisig.value + } else if (cw3Multisig.status === 'fulfilled') { + return cw3Multisig.value + } else { + throw new Error('Not a multisig address.') + } +} + export const accountQueries = { /** * Fetch the list of accounts associated with the specified address. @@ -190,4 +395,38 @@ export const accountQueries = { queryKey: ['account', 'remoteIcaAddress', options], queryFn: () => fetchRemoteIcaAddress(options), }), + /** + * Fetch the details of a cryptographic multisig account. + */ + cryptographicMultisig: ( + options: Parameters[0] + ) => + queryOptions({ + queryKey: ['account', 'cryptographicMultisig', options], + queryFn: () => fetchCryptographicMultisigAccount(options), + }), + /** + * Fetch the details of a cw3-fixed or cw3-flex multisig account. + */ + cw3Multisig: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['account', 'cw3Multisig', options], + queryFn: () => fetchCw3MultisigAccount(queryClient, options), + }), + /** + * Fetch the details of any type of multisig. + */ + multisig: ( + queryClient: QueryClient, + options?: Parameters[1] + ) => + queryOptions({ + queryKey: ['account', 'multisig', options], + queryFn: options + ? () => fetchMultisigAccount(queryClient, options) + : skipToken, + }), } diff --git a/packages/state/query/queries/contracts/Cw3FlexMultisig.ts b/packages/state/query/queries/contracts/Cw3FlexMultisig.ts new file mode 100644 index 000000000..fe1dc1d4a --- /dev/null +++ b/packages/state/query/queries/contracts/Cw3FlexMultisig.ts @@ -0,0 +1,404 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import { QueryClient, UseQueryOptions } from '@tanstack/react-query' + +import { + Config, + ProposalListResponseForEmpty, + ProposalResponseForEmpty, + ThresholdResponse, + VoteListResponse, + VoteResponse, + VoterListResponse, + VoterResponse, +} from '@dao-dao/types/contracts/Cw3FlexMultisig' +import { cosmWasmClientRouter } from '@dao-dao/utils' + +import { Cw3FlexMultisigQueryClient } from '../../../contracts/Cw3FlexMultisig' + +export const cw3FlexMultisigQueryKeys = { + contract: [ + { + contract: 'cw3FlexMultisig', + }, + ] as const, + address: (contractAddress: string) => + [ + { + ...cw3FlexMultisigQueryKeys.contract[0], + address: contractAddress, + }, + ] as const, + threshold: (contractAddress: string, args?: Record) => + [ + { + ...cw3FlexMultisigQueryKeys.address(contractAddress)[0], + method: 'threshold', + args, + }, + ] as const, + proposal: (contractAddress: string, args?: Record) => + [ + { + ...cw3FlexMultisigQueryKeys.address(contractAddress)[0], + method: 'proposal', + args, + }, + ] as const, + listProposals: (contractAddress: string, args?: Record) => + [ + { + ...cw3FlexMultisigQueryKeys.address(contractAddress)[0], + method: 'list_proposals', + args, + }, + ] as const, + reverseProposals: (contractAddress: string, args?: Record) => + [ + { + ...cw3FlexMultisigQueryKeys.address(contractAddress)[0], + method: 'reverse_proposals', + args, + }, + ] as const, + getVote: (contractAddress: string, args?: Record) => + [ + { + ...cw3FlexMultisigQueryKeys.address(contractAddress)[0], + method: 'vote', + args, + }, + ] as const, + listVotes: (contractAddress: string, args?: Record) => + [ + { + ...cw3FlexMultisigQueryKeys.address(contractAddress)[0], + method: 'list_votes', + args, + }, + ] as const, + voter: (contractAddress: string, args?: Record) => + [ + { + ...cw3FlexMultisigQueryKeys.address(contractAddress)[0], + method: 'voter', + args, + }, + ] as const, + listVoters: (contractAddress: string, args?: Record) => + [ + { + ...cw3FlexMultisigQueryKeys.address(contractAddress)[0], + method: 'list_voters', + args, + }, + ] as const, + config: (contractAddress: string, args?: Record) => + [ + { + ...cw3FlexMultisigQueryKeys.address(contractAddress)[0], + method: 'config', + args, + }, + ] as const, +} +export const cw3FlexMultisigQueries = { + threshold: ({ + chainId, + contractAddress, + options, + }: Cw3FlexMultisigThresholdQuery): UseQueryOptions< + ThresholdResponse, + Error, + TData + > => ({ + queryKey: cw3FlexMultisigQueryKeys.threshold(contractAddress), + queryFn: async () => + new Cw3FlexMultisigQueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).threshold(), + ...options, + }), + proposal: ({ + chainId, + contractAddress, + args, + options, + }: Cw3FlexMultisigProposalQuery): UseQueryOptions< + ProposalResponseForEmpty, + Error, + TData + > => ({ + queryKey: cw3FlexMultisigQueryKeys.proposal(contractAddress, args), + queryFn: async () => + new Cw3FlexMultisigQueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).proposal({ + proposalId: args.proposalId, + }), + ...options, + }), + listProposals: ({ + chainId, + contractAddress, + args, + options, + }: Cw3FlexMultisigListProposalsQuery): UseQueryOptions< + ProposalListResponseForEmpty, + Error, + TData + > => ({ + queryKey: cw3FlexMultisigQueryKeys.listProposals(contractAddress, args), + queryFn: async () => + new Cw3FlexMultisigQueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).listProposals({ + limit: args.limit, + startAfter: args.startAfter, + }), + ...options, + }), + reverseProposals: ({ + chainId, + contractAddress, + args, + options, + }: Cw3FlexMultisigReverseProposalsQuery): UseQueryOptions< + ProposalListResponseForEmpty, + Error, + TData + > => ({ + queryKey: cw3FlexMultisigQueryKeys.reverseProposals(contractAddress, args), + queryFn: async () => + new Cw3FlexMultisigQueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).reverseProposals({ + limit: args.limit, + startBefore: args.startBefore, + }), + ...options, + }), + getVote: ({ + chainId, + contractAddress, + args, + options, + }: Cw3FlexMultisigVoteQuery): UseQueryOptions< + VoteResponse, + Error, + TData + > => ({ + queryKey: cw3FlexMultisigQueryKeys.getVote(contractAddress, args), + queryFn: async () => + new Cw3FlexMultisigQueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).getVote({ + proposalId: args.proposalId, + voter: args.voter, + }), + ...options, + }), + listVotes: ({ + chainId, + contractAddress, + args, + options, + }: Cw3FlexMultisigListVotesQuery): UseQueryOptions< + VoteListResponse, + Error, + TData + > => ({ + queryKey: cw3FlexMultisigQueryKeys.listVotes(contractAddress, args), + queryFn: async () => + new Cw3FlexMultisigQueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).listVotes({ + limit: args.limit, + proposalId: args.proposalId, + startAfter: args.startAfter, + }), + ...options, + }), + voter: ({ + chainId, + contractAddress, + args, + options, + }: Cw3FlexMultisigVoterQuery): UseQueryOptions< + VoterResponse, + Error, + TData + > => ({ + queryKey: cw3FlexMultisigQueryKeys.voter(contractAddress, args), + queryFn: async () => + new Cw3FlexMultisigQueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).voter({ + address: args.address, + }), + ...options, + }), + listVoters: ({ + chainId, + contractAddress, + args, + options, + }: Cw3FlexMultisigListVotersQuery): UseQueryOptions< + VoterListResponse, + Error, + TData + > => ({ + queryKey: cw3FlexMultisigQueryKeys.listVoters(contractAddress, args), + queryFn: async () => + new Cw3FlexMultisigQueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).listVoters({ + limit: args.limit, + startAfter: args.startAfter, + }), + ...options, + }), + listAllVoters: ({ + queryClient, + chainId, + contractAddress, + options, + }: Cw3FlexMultisigListAllVotersQuery): UseQueryOptions< + VoterListResponse, + Error, + TData + > => ({ + queryKey: cw3FlexMultisigQueryKeys.listVoters(contractAddress), + queryFn: async () => { + const voters: VoterListResponse['voters'] = [] + + const limit = 30 + while (true) { + const page = await queryClient.fetchQuery( + cw3FlexMultisigQueries.listVoters({ + chainId, + contractAddress, + args: { + limit, + startAfter: + voters.length > 0 ? voters[voters.length - 1].addr : undefined, + }, + }) + ) + if (!page.voters.length) { + break + } + + voters.push(...page.voters) + + // If we have less than the limit of voters, we've exhausted them. + if (page.voters.length < limit) { + break + } + } + + return { + voters, + } + }, + ...options, + }), + config: ({ + chainId, + contractAddress, + options, + }: Cw3FlexMultisigConfigQuery): UseQueryOptions< + Config, + Error, + TData + > => ({ + queryKey: cw3FlexMultisigQueryKeys.config(contractAddress), + queryFn: async () => + new Cw3FlexMultisigQueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).config(), + ...options, + }), +} +export interface Cw3FlexMultisigReactQuery { + chainId: string + contractAddress: string + options?: Omit< + UseQueryOptions, + 'queryKey' | 'queryFn' | 'initialData' + > & { + initialData?: undefined + } +} +export interface Cw3FlexMultisigConfigQuery + extends Cw3FlexMultisigReactQuery {} +export interface Cw3FlexMultisigListVotersQuery + extends Cw3FlexMultisigReactQuery { + args: { + limit?: number + startAfter?: string + } +} +export interface Cw3FlexMultisigListAllVotersQuery + extends Cw3FlexMultisigReactQuery { + queryClient: QueryClient +} +export interface Cw3FlexMultisigVoterQuery + extends Cw3FlexMultisigReactQuery { + args: { + address: string + } +} +export interface Cw3FlexMultisigListVotesQuery + extends Cw3FlexMultisigReactQuery { + args: { + limit?: number + proposalId: number + startAfter?: string + } +} +export interface Cw3FlexMultisigVoteQuery + extends Cw3FlexMultisigReactQuery { + args: { + proposalId: number + voter: string + } +} +export interface Cw3FlexMultisigReverseProposalsQuery + extends Cw3FlexMultisigReactQuery { + args: { + limit?: number + startBefore?: number + } +} +export interface Cw3FlexMultisigListProposalsQuery + extends Cw3FlexMultisigReactQuery { + args: { + limit?: number + startAfter?: number + } +} +export interface Cw3FlexMultisigProposalQuery + extends Cw3FlexMultisigReactQuery { + args: { + proposalId: number + } +} +export interface Cw3FlexMultisigThresholdQuery + extends Cw3FlexMultisigReactQuery {} + +export interface Cw3FlexMultisigAccountQuery + extends Cw3FlexMultisigReactQuery {} diff --git a/packages/state/query/queries/contracts/index.ts b/packages/state/query/queries/contracts/index.ts index a451496e3..a27e41ef0 100644 --- a/packages/state/query/queries/contracts/index.ts +++ b/packages/state/query/queries/contracts/index.ts @@ -1,4 +1,5 @@ export * from './Cw1Whitelist' +export * from './Cw3FlexMultisig' export * from './DaoDaoCore' export * from './PolytoneNote' export * from './PolytoneProxy' diff --git a/packages/state/recoil/selectors/account.ts b/packages/state/recoil/selectors/account.ts index 87c8f6dd7..2a31b7e44 100644 --- a/packages/state/recoil/selectors/account.ts +++ b/packages/state/recoil/selectors/account.ts @@ -1,4 +1,3 @@ -import { toHex } from '@cosmjs/encoding' import { constSelector, selectorFamily, @@ -12,35 +11,19 @@ import { GenericToken, GenericTokenBalanceWithOwner, IcaAccount, - MultisigDetails as MultisigDetails, TokenType, WithChainId, } from '@dao-dao/types' -import { Threshold } from '@dao-dao/types/contracts/DaoProposalSingle.common' -import { BaseAccount } from '@dao-dao/types/protobuf/codegen/cosmos/auth/v1beta1/auth' -import { LegacyAminoPubKey } from '@dao-dao/types/protobuf/codegen/cosmos/crypto/multisig/keys' -import { PubKey } from '@dao-dao/types/protobuf/codegen/cosmos/crypto/secp256k1/keys' import { - ContractName, ICA_CHAINS_TX_PREFIX, POLYTONE_CONFIG_PER_CHAIN, - getChainForChainId, getConfiguredChainConfig, - secp256k1PublicKeyToBech32Address, tokensEqual, } from '@dao-dao/utils' -import { cosmosRpcClientForChainSelector, moduleAddressSelector } from './chain' -import { - isContractSelector, - isDaoSelector, - isPolytoneProxySelector, -} from './contract' -import { - Cw3FlexMultisigSelectors, - DaoCoreV2Selectors, - PolytoneProxySelectors, -} from './contracts' +import { moduleAddressSelector } from './chain' +import { isDaoSelector, isPolytoneProxySelector } from './contract' +import { DaoCoreV2Selectors, PolytoneProxySelectors } from './contracts' import { icaRemoteAddressSelector } from './ica' import { genericTokenBalanceSelector, @@ -354,174 +337,3 @@ export const reverseLookupPolytoneProxySelector = selectorFamily< } }, }) - -/** - * Get the details of a cryptographic multisig account. - */ -export const cryptographicMultisigDetailsSelector = selectorFamily< - MultisigDetails, - WithChainId<{ address: string }> ->({ - key: 'cryptographicMultisigDetails', - get: - ({ address, chainId }) => - async ({ get }) => { - const { bech32_prefix: bech32Prefix } = getChainForChainId(chainId) - const client = get(cosmosRpcClientForChainSelector(chainId)) - - const { account } = await client.auth.v1beta1.account({ - address, - }) - - if ( - !account || - account.$typeUrl !== BaseAccount.typeUrl || - account.pubKey?.typeUrl !== LegacyAminoPubKey.typeUrl - ) { - throw new Error('Not a multisig address.') - } - - const { publicKeys, threshold } = LegacyAminoPubKey.decode( - account.pubKey.value - ) - - if (publicKeys.some(({ typeUrl }) => typeUrl !== PubKey.typeUrl)) { - throw new Error('Unsupported multisig.') - } - - const addresses = await Promise.all( - publicKeys.map((key) => - secp256k1PublicKeyToBech32Address( - toHex(PubKey.decode(key.value).key), - bech32Prefix - ) - ) - ) - - return { - chainId, - address, - members: addresses.map((address) => ({ - address, - weight: 1, - })), - threshold: { - absolute_count: { - threshold: BigInt(threshold).toString(), - }, - }, - totalWeight: addresses.length, - } - }, -}) - -/** - * Get the details of a cw3-fixed or cw3-flex multisig account. - */ -export const cw3MultisigDetailsSelector = selectorFamily< - MultisigDetails, - WithChainId<{ address: string }> ->({ - key: 'cw3MultisigDetails', - get: - ({ address, chainId }) => - async ({ get }) => { - const isCw3Multisig = get( - isContractSelector({ - chainId, - contractAddress: address, - names: [ContractName.Cw3FixedMultisig, ContractName.Cw3FlexMultisig], - }) - ) - - if (!isCw3Multisig) { - throw new Error('Not a multisig address.') - } - - const [_threshold, { voters }] = get( - waitForAll([ - Cw3FlexMultisigSelectors.thresholdSelector({ - chainId, - contractAddress: address, - params: [], - }), - Cw3FlexMultisigSelectors.listAllVotersSelector({ - chainId, - contractAddress: address, - }), - ]) - ) - - const threshold: Threshold | undefined = - 'absolute_count' in _threshold - ? { - absolute_count: { - threshold: BigInt(_threshold.absolute_count.weight).toString(), - }, - } - : 'absolute_percentage' in _threshold - ? { - absolute_percentage: { - percentage: { - percent: _threshold.absolute_percentage.percentage, - }, - }, - } - : 'threshold_quorum' in _threshold - ? { - threshold_quorum: { - quorum: { - percent: _threshold.threshold_quorum.quorum, - }, - threshold: { - percent: _threshold.threshold_quorum.threshold, - }, - }, - } - : undefined - - if (!threshold) { - throw new Error('Unsupported multisig.') - } - - return { - chainId, - address, - members: voters.map(({ addr, weight }) => ({ - address: addr, - weight, - })), - threshold, - totalWeight: voters.reduce((acc, { weight }) => acc + weight, 0), - } - }, -}) - -/** - * Get the details of a cryptographic, cw3-fixed, or cw3-flex multisig account. - */ -export const multisigDetailsSelector = selectorFamily< - MultisigDetails, - WithChainId<{ address: string }> ->({ - key: 'multisigDetails', - get: - (params) => - async ({ get }) => { - const [cryptographicMultisig, cw3Multisig] = get( - waitForAllSettled([ - cryptographicMultisigDetailsSelector(params), - cw3MultisigDetailsSelector(params), - ]) - ) - - if (cryptographicMultisig.state === 'hasValue') { - return cryptographicMultisig.contents - } - if (cw3Multisig.state === 'hasValue') { - return cw3Multisig.contents - } - - throw new Error('Not a multisig address.') - }, -}) diff --git a/packages/state/recoil/selectors/contracts/Cw3FlexMultisig.ts b/packages/state/recoil/selectors/contracts/Cw3FlexMultisig.ts deleted file mode 100644 index bf04404f0..000000000 --- a/packages/state/recoil/selectors/contracts/Cw3FlexMultisig.ts +++ /dev/null @@ -1,203 +0,0 @@ -import { selectorFamily } from 'recoil' - -import { WithChainId } from '@dao-dao/types' -import { - Config, - ProposalListResponseForEmpty, - ProposalResponseForEmpty, - ThresholdResponse, - VoteListResponse, - VoteResponse, - VoterListResponse, - VoterResponse, -} from '@dao-dao/types/contracts/Cw3FlexMultisig' - -import { Cw3FlexMultisigQueryClient } from '../../../contracts/Cw3FlexMultisig' -import { cosmWasmClientForChainSelector } from '../chain' - -type QueryClientParams = WithChainId<{ - contractAddress: string -}> - -export const queryClient = selectorFamily< - Cw3FlexMultisigQueryClient, - QueryClientParams ->({ - key: 'cw3FlexMultisigQueryClient', - get: - ({ contractAddress, chainId }) => - ({ get }) => { - const client = get(cosmWasmClientForChainSelector(chainId)) - return new Cw3FlexMultisigQueryClient(client, contractAddress) - }, - dangerouslyAllowMutability: true, -}) - -export const thresholdSelector = selectorFamily< - ThresholdResponse, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cw3FlexMultisigThreshold', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.threshold(...params) - }, -}) -export const proposalSelector = selectorFamily< - ProposalResponseForEmpty, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cw3FlexMultisigProposal', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.proposal(...params) - }, -}) -export const listProposalsSelector = selectorFamily< - ProposalListResponseForEmpty, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cw3FlexMultisigListProposals', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.listProposals(...params) - }, -}) -export const reverseProposalsSelector = selectorFamily< - ProposalListResponseForEmpty, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cw3FlexMultisigReverseProposals', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.reverseProposals(...params) - }, -}) -export const getVoteSelector = selectorFamily< - VoteResponse, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cw3FlexMultisigVote', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.getVote(...params) - }, -}) -export const listVotesSelector = selectorFamily< - VoteListResponse, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cw3FlexMultisigListVotes', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.listVotes(...params) - }, -}) -export const voterSelector = selectorFamily< - VoterResponse, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cw3FlexMultisigVoter', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.voter(...params) - }, -}) -export const listVotersSelector = selectorFamily< - VoterListResponse, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cw3FlexMultisigListVoters', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.listVoters(...params) - }, -}) -export const configSelector = selectorFamily< - Config, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cw3FlexMultisigConfig', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.config(...params) - }, -}) - -// Custom - -const LIST_VOTERS_LIMIT = 30 -export const listAllVotersSelector = selectorFamily< - VoterListResponse, - QueryClientParams ->({ - key: 'cw3FlexMultisigListAllVoters', - get: - (queryClientParams) => - async ({ get }) => { - const voters: VoterListResponse['voters'] = [] - - while (true) { - const response = await get( - listVotersSelector({ - ...queryClientParams, - params: [ - { - limit: LIST_VOTERS_LIMIT, - startAfter: - voters.length > 0 - ? voters[voters.length - 1].addr - : undefined, - }, - ], - }) - ) - - voters.push(...response.voters) - - if (response.voters.length < LIST_VOTERS_LIMIT) { - break - } - } - - return { - voters, - } - }, -}) diff --git a/packages/state/recoil/selectors/contracts/index.ts b/packages/state/recoil/selectors/contracts/index.ts index d3901523a..dc948f88e 100644 --- a/packages/state/recoil/selectors/contracts/index.ts +++ b/packages/state/recoil/selectors/contracts/index.ts @@ -1,6 +1,5 @@ export * as CommonNftSelectors from './CommonNft' export * as Cw1WhitelistSelectors from './Cw1Whitelist' -export * as Cw3FlexMultisigSelectors from './Cw3FlexMultisig' export * as Cw4GroupSelectors from './Cw4Group' export * as Cw20BaseSelectors from './Cw20Base' export * as Cw20StakeSelectors from './Cw20Stake' diff --git a/packages/stateful/components/dao/ImportMultisigModal.tsx b/packages/stateful/components/dao/ImportMultisigModal.tsx index a10b802c0..1f6446f17 100644 --- a/packages/stateful/components/dao/ImportMultisigModal.tsx +++ b/packages/stateful/components/dao/ImportMultisigModal.tsx @@ -1,10 +1,10 @@ +import { useQueryClient } from '@tanstack/react-query' import { FormProvider, useForm } from 'react-hook-form' -import { multisigDetailsSelector } from '@dao-dao/state/recoil' +import { accountQueries } from '@dao-dao/state/query' import { ChainProvider, ImportMultisigModal as StatelessImportMultisigModal, - useCachedLoadingWithError, useChain, } from '@dao-dao/stateless' import { @@ -13,6 +13,7 @@ import { } from '@dao-dao/types' import { getChainForChainId, isValidBech32Address } from '@dao-dao/utils' +import { useQueryLoadingDataWithError } from '../../hooks' import { AddressInput } from '../AddressInput' import { EntityDisplay } from '../EntityDisplay' @@ -28,15 +29,18 @@ export const ImportMultisigModal = ( const chainId = form.watch('chainId') const address = form.watch('address') - const loadingMultisig = useCachedLoadingWithError( - chainId && - address && - isValidBech32Address(address, getChainForChainId(chainId).bech32_prefix) - ? multisigDetailsSelector({ - chainId, - address, - }) - : undefined + const loadingMultisig = useQueryLoadingDataWithError( + accountQueries.multisig( + useQueryClient(), + chainId && + address && + isValidBech32Address(address, getChainForChainId(chainId).bech32_prefix) + ? { + chainId, + address, + } + : undefined + ) ) return ( diff --git a/packages/stateless/components/dao/create/ImportMultisigModal.tsx b/packages/stateless/components/dao/create/ImportMultisigModal.tsx index f7092990f..a8376b53c 100644 --- a/packages/stateless/components/dao/create/ImportMultisigModal.tsx +++ b/packages/stateless/components/dao/create/ImportMultisigModal.tsx @@ -39,15 +39,15 @@ export const ImportMultisigModal = ({ const processedMultisigTQ = loadingMultisig.loading || loadingMultisig.errored ? undefined - : processTQ(loadingMultisig.data.threshold) + : processTQ(loadingMultisig.data.config.threshold) const multisigType = loadingMultisig.loading || loadingMultisig.errored || !processedMultisigTQ ? 'unknown' - : 'absolute_count' in loadingMultisig.data.threshold + : 'absolute_count' in loadingMultisig.data.config.threshold ? t('info.xOfYMultisig', { x: processedMultisigTQ.threshold.display, - y: loadingMultisig.data.totalWeight, + y: loadingMultisig.data.config.totalWeight, }) : [ t('title.threshold') + ': ' + processedMultisigTQ.threshold.display, @@ -143,20 +143,23 @@ export const ImportMultisigModal = ({
{t('title.members')} - {loadingMultisig.data.members.map(({ address, weight }) => ( -
- + {loadingMultisig.data.config.members.map( + ({ address, weight }) => ( +
+ -

- {formatPercentOf100( - (weight / loadingMultisig.data.totalWeight) * 100 - )} -

-
- ))} +

+ {formatPercentOf100( + (weight / loadingMultisig.data.config.totalWeight) * + 100 + )} +

+
+ ) + )}
diff --git a/packages/stateless/components/dao/create/pages/CreateDaoStart.tsx b/packages/stateless/components/dao/create/pages/CreateDaoStart.tsx index 49b223a0f..0dd6f481b 100644 --- a/packages/stateless/components/dao/create/pages/CreateDaoStart.tsx +++ b/packages/stateless/components/dao/create/pages/CreateDaoStart.tsx @@ -152,7 +152,11 @@ export const CreateDaoStart = ({ setImportMultisigVisible(false)} - onImport={({ chainId, address, members, threshold, totalWeight }) => { + onImport={({ + chainId, + address, + config: { members, threshold, totalWeight }, + }) => { // Group members by weight and sort descending. const groupedMembers = Object.entries( members.reduce( diff --git a/packages/types/account.ts b/packages/types/account.ts index e955c6af0..42dc6490c 100644 --- a/packages/types/account.ts +++ b/packages/types/account.ts @@ -20,33 +20,70 @@ export enum AccountType { * An ICA controlled by an account on another chain. */ Ica = 'ica', + /** + * A cryptographic multisig. + */ + CryptographicMultisig = 'cryptographicMultisig', + /** + * A cw3 smart-contract-based multisig. + */ + Cw3Multisig = 'cw3Multisig', } -export type NativeAccountTypeConfig = { +export type BaseAccount = { + chainId: string + address: string +} + +export type NativeAccount = BaseAccount & { type: AccountType.Native config?: undefined } -export type PolytoneAccountTypeConfig = { +export type PolytoneAccount = BaseAccount & { type: AccountType.Polytone config?: undefined } -export type IcaAccountTypeConfig = { +export type IcaAccount = BaseAccount & { type: AccountType.Ica config?: undefined } -export type BaseAccount = { - chainId: string - address: string +export type CryptographicMultisigAccount = BaseAccount & { + type: AccountType.CryptographicMultisig + config: { + /** + * The members of the multisig. + */ + members: { + address: string + weight: number + }[] + /** + * The threshold of members that must sign a transaction for it to be valid. + */ + threshold: Threshold + /** + * The sum of all members' weights. + */ + totalWeight: number + } } -export type NativeAccount = BaseAccount & NativeAccountTypeConfig -export type PolytoneAccount = BaseAccount & PolytoneAccountTypeConfig -export type IcaAccount = BaseAccount & IcaAccountTypeConfig +export type Cw3MultisigAccount = BaseAccount & { + type: AccountType.Cw3Multisig + config: CryptographicMultisigAccount['config'] +} + +export type MultisigAccount = CryptographicMultisigAccount | Cw3MultisigAccount -export type Account = NativeAccount | PolytoneAccount | IcaAccount +export type Account = + | NativeAccount + | PolytoneAccount + | IcaAccount + | CryptographicMultisigAccount + | Cw3MultisigAccount /** * Unique identifier for account tabs, which is used in the URL path. @@ -72,32 +109,3 @@ export type AccountTxSave = AccountTxForm & { name: string description?: string } - -/** - * The details that describe a multisig membership and threshold. - */ -export type MultisigDetails = { - /** - * The multisig's chain ID. - */ - chainId: string - /** - * The multisig's address. - */ - address: string - /** - * The members of the multisig. - */ - members: { - address: string - weight: number - }[] - /** - * The threshold of members that must sign a transaction for it to be valid. - */ - threshold: Threshold - /** - * The sum of all members' weights. - */ - totalWeight: number -} diff --git a/packages/types/components/ImportMultisigModal.ts b/packages/types/components/ImportMultisigModal.ts index ed18dc39f..db1402f84 100644 --- a/packages/types/components/ImportMultisigModal.ts +++ b/packages/types/components/ImportMultisigModal.ts @@ -1,6 +1,6 @@ import { ComponentType } from 'react' -import { MultisigDetails } from '../account' +import { MultisigAccount } from '../account' import { LoadingDataWithError } from '../misc' import { AddressInputProps } from './AddressInput' import { StatefulEntityDisplayProps } from './EntityDisplay' @@ -11,13 +11,13 @@ export type ImportMultisigModalProps = Pick< 'visible' | 'onClose' > & { /** - * Multisig details loading from the entered address. + * Multisig account loading from the entered address. */ - loadingMultisig: LoadingDataWithError + loadingMultisig: LoadingDataWithError /** * Import callback. */ - onImport: (details: MultisigDetails) => void + onImport: (details: MultisigAccount) => void /** * The stateful address input component. */ diff --git a/packages/types/contracts/Cw3FlexMultisig.ts b/packages/types/contracts/Cw3FlexMultisig.ts index 215284515..aeba6aeca 100644 --- a/packages/types/contracts/Cw3FlexMultisig.ts +++ b/packages/types/contracts/Cw3FlexMultisig.ts @@ -1,5 +1,5 @@ /** - * This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ From 3c6745a41618f75c48f7496adb9b9783416dc632 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 10 Jun 2024 15:42:26 -0400 Subject: [PATCH 223/438] fixed polytone proxy detection for DAOs --- packages/stateful/queries/dao.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/stateful/queries/dao.ts b/packages/stateful/queries/dao.ts index 1fe6dfed5..8d7eafff0 100644 --- a/packages/stateful/queries/dao.ts +++ b/packages/stateful/queries/dao.ts @@ -14,7 +14,6 @@ import { DaoSource, Feature, InfoResponse, - PolytoneProxies, ProposalModule, } from '@dao-dao/types' import { @@ -25,6 +24,7 @@ import { isConfiguredChainName, isFeatureSupportedByVersion, parseContractVersion, + polytoneNoteProxyMapToChainIdMap, } from '@dao-dao/utils' import { fetchProposalModules } from '../utils' @@ -156,7 +156,7 @@ export const fetchDaoInfo = async ( ), // Check if indexer returned this already. 'polytoneProxies' in state && state.polytoneProxies - ? (state.polytoneProxies as PolytoneProxies) + ? polytoneNoteProxyMapToChainIdMap(chainId, state.polytoneProxies) : queryClient.fetchQuery( polytoneQueries.proxies(queryClient, { chainId, From 2ddadc680ff1b132266500bb78af85f19d66f873 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 10 Jun 2024 16:00:01 -0400 Subject: [PATCH 224/438] added stargaze <> injective polytone --- packages/utils/constants/chains.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 2f7de3bc6..90435de80 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -912,6 +912,23 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // archway remoteChannel: 'channel-86', }, + [ChainId.InjectiveMainnet]: { + // stargaze + note: 'stars1fgdeujlyhymvh2malsdeckcjc9zfar8qc4rw77m4eldxmg4xly7s2n828w', + // stargaze + listener: + 'stars1hfhv66uu0t5kcku4rj506vvxp7l7h3aafjfruth5ss3yah76svuq59usx7', + // injective + voice: 'inj147yyg4ccmpwjut9e8marlmupx6myw8lj2wg4gn', + // stargaze + localConnection: 'connection-301', + // injective + remoteConnection: 'connection-270', + // stargaze + localChannel: 'channel-331', + // injective + remoteChannel: 'channel-310', + }, }, }, { From 949da7a27e7240eb2d6fb3eda594302f0311da92 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 10 Jun 2024 16:28:15 -0400 Subject: [PATCH 225/438] moved INDEXER_URL env var to constant --- .github/workflows/ci.yml | 1 - apps/dapp/.env.mainnet | 3 --- apps/dapp/.env.testnet | 3 --- apps/sda/.env.mainnet | 3 --- apps/sda/.env.testnet | 3 --- packages/utils/constants/env.ts | 3 --- packages/utils/constants/other.ts | 3 +++ 7 files changed, 3 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e108eb493..6619f9d6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,6 @@ on: - development env: - NEXT_PUBLIC_INDEXER_URL: https://indexer.daodao.zone NEXT_PUBLIC_SITE_URL: NEXT_PUBLIC_SITE_URL NEXT_PUBLIC_SEARCH_URL: NEXT_PUBLIC_SEARCH_URL NEXT_PUBLIC_SEARCH_API_KEY: NEXT_PUBLIC_SEARCH_API_KEY diff --git a/apps/dapp/.env.mainnet b/apps/dapp/.env.mainnet index 9b8e24c27..1eac362a6 100644 --- a/apps/dapp/.env.mainnet +++ b/apps/dapp/.env.mainnet @@ -15,9 +15,6 @@ NEXT_PUBLIC_STARGAZE_NAMES_CONTRACT=stars1fx74nkqkw2748av8j7ew7r3xt9cgjqduwn8m0u # Wallet profiles NEXT_PUBLIC_PFPK_API_BASE=https://pfpk.daodao.zone -# Indexer -NEXT_PUBLIC_INDEXER_URL=https://indexer.daodao.zone - # Search NEXT_PUBLIC_SEARCH_HOST=https://search.daodao.zone NEXT_PUBLIC_SEARCH_API_KEY=1d599098d24298ffd8b295508eaedccb149163f847b862069cc6de31495dc71b diff --git a/apps/dapp/.env.testnet b/apps/dapp/.env.testnet index 4738edbac..9339522c0 100644 --- a/apps/dapp/.env.testnet +++ b/apps/dapp/.env.testnet @@ -14,9 +14,6 @@ NEXT_PUBLIC_STARGAZE_NAMES_CONTRACT=stars1rgn9tuxnl3ju9td3mfxdl2vm4t8xuaztcdakgt # Wallet profiles NEXT_PUBLIC_PFPK_API_BASE=https://pfpk.daodao.zone -# Indexer -NEXT_PUBLIC_INDEXER_URL=https://indexer.daodao.zone - # Search NEXT_PUBLIC_SEARCH_HOST=https://search.daodao.zone NEXT_PUBLIC_SEARCH_API_KEY=1d599098d24298ffd8b295508eaedccb149163f847b862069cc6de31495dc71b diff --git a/apps/sda/.env.mainnet b/apps/sda/.env.mainnet index 81274baed..df618585c 100644 --- a/apps/sda/.env.mainnet +++ b/apps/sda/.env.mainnet @@ -16,9 +16,6 @@ NEXT_PUBLIC_STARGAZE_NAMES_CONTRACT=stars1fx74nkqkw2748av8j7ew7r3xt9cgjqduwn8m0u # Wallet profiles NEXT_PUBLIC_PFPK_API_BASE=https://pfpk.daodao.zone -# Indexer -NEXT_PUBLIC_INDEXER_URL=https://indexer.daodao.zone - # Filebase FILEBASE_ACCESS_KEY_ID= FILEBASE_SECRET_ACCESS_KEY= diff --git a/apps/sda/.env.testnet b/apps/sda/.env.testnet index 0cc436dc0..63f6de405 100644 --- a/apps/sda/.env.testnet +++ b/apps/sda/.env.testnet @@ -16,9 +16,6 @@ NEXT_PUBLIC_STARGAZE_NAMES_CONTRACT=stars1rgn9tuxnl3ju9td3mfxdl2vm4t8xuaztcdakgt # Wallet profiles NEXT_PUBLIC_PFPK_API_BASE=https://pfpk.daodao.zone -# Indexer -NEXT_PUBLIC_INDEXER_URL=https://indexer.daodao.zone - # Filebase FILEBASE_ACCESS_KEY_ID= FILEBASE_SECRET_ACCESS_KEY= diff --git a/packages/utils/constants/env.ts b/packages/utils/constants/env.ts index 6c26a42e8..3cfc77f20 100644 --- a/packages/utils/constants/env.ts +++ b/packages/utils/constants/env.ts @@ -35,9 +35,6 @@ export const STARGAZE_NAMES_CONTRACT = process.env // Wallet profiles export const PFPK_API_BASE = process.env.NEXT_PUBLIC_PFPK_API_BASE as string -// Indexer -export const INDEXER_URL = process.env.NEXT_PUBLIC_INDEXER_URL - // Search export const SEARCH_HOST = process.env.NEXT_PUBLIC_SEARCH_HOST as string export const SEARCH_API_KEY = process.env.NEXT_PUBLIC_SEARCH_API_KEY as string diff --git a/packages/utils/constants/other.ts b/packages/utils/constants/other.ts index 84f639bfd..332df2a57 100644 --- a/packages/utils/constants/other.ts +++ b/packages/utils/constants/other.ts @@ -90,6 +90,9 @@ export const WHITE_WHALE_PRICES_API = export const ASTROPORT_PRICES_API = 'https://api.astroport.fi/api/tokens/DENOM?chainId=neutron-1' +// Indexer +export const INDEXER_URL = 'https://indexer.daodao.zone' + // Snapper API export const SNAPPER_API_BASE = 'https://snapper.daodao.zone' From e577ba3a8d38795d01842fc66d684e6b099a0b5a Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 11 Jun 2024 19:45:44 -0400 Subject: [PATCH 226/438] sped up gov prop creation loading and removed unnecessary suspenses --- .../GovernanceDeposit/index.tsx | 10 +-- .../GovernanceProposal/index.tsx | 75 ++++++++++--------- .../chain_governance/GovernanceVote/index.tsx | 18 ++--- .../components/gov/CreateGovProposal.tsx | 12 +-- .../components/gov/NewGovProposal.tsx | 35 +++------ 5 files changed, 68 insertions(+), 82 deletions(-) diff --git a/packages/stateful/actions/core/chain_governance/GovernanceDeposit/index.tsx b/packages/stateful/actions/core/chain_governance/GovernanceDeposit/index.tsx index 1c59dde66..93719fbba 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceDeposit/index.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceDeposit/index.tsx @@ -12,7 +12,6 @@ import { import { BankEmoji, DaoSupportedChainPickerInput, - Loader, useCachedLoading, useChain, } from '@dao-dao/stateless' @@ -37,7 +36,6 @@ import { } from '@dao-dao/utils' import { GovProposalActionDisplay } from '../../../../components' -import { SuspenseLoader } from '../../../../components/SuspenseLoader' import { TokenAmountDisplay } from '../../../../components/TokenAmountDisplay' import { GovActionsProvider, useActionOptions } from '../../../react' import { @@ -66,11 +64,9 @@ const Component: ActionComponent = ( /> )} - }> - - - - + + + ) } diff --git a/packages/stateful/actions/core/chain_governance/GovernanceProposal/index.tsx b/packages/stateful/actions/core/chain_governance/GovernanceProposal/index.tsx index 8c512b65c..c24b3f78d 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceProposal/index.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceProposal/index.tsx @@ -13,12 +13,12 @@ import { import { ChainProvider, DaoSupportedChainPickerInput, - Loader, RaisedHandEmoji, useCachedLoading, useCachedLoadingWithError, } from '@dao-dao/stateless' import { + AccountType, ActionComponent, ActionComponentProps, ActionContextType, @@ -84,22 +84,19 @@ const Component: ActionComponent = ( )} - } > - - - - + + ) @@ -286,44 +283,52 @@ export const makeGovernanceProposalAction: ActionMaker< context, } = options + const defaultChainId = + // Neutron does not use the x/gov module. If this is a DAO on Neutron, see + // if it has polytone accounts on any other chain. If it does, default to + // one of them. Otherwise, hide the action since it cannot be used. + currentChainId === ChainId.NeutronMainnet || + currentChainId === ChainId.NeutronTestnet + ? context.type === ActionContextType.Dao + ? context.info.accounts.find((a) => a.type === AccountType.Polytone) + ?.chainId + : undefined + : // If not on Neutron, default to current chain. + currentChainId + if ( // Governance module cannot participate in governance. context.type === ActionContextType.Gov || - // Neutron does not use the x/gov module. - currentChainId === ChainId.NeutronMainnet || - currentChainId === ChainId.NeutronTestnet + !defaultChainId ) { return null } const useDefaults: UseDefaults = () => { - const govParams = useCachedLoadingWithError( - govParamsSelector({ - chainId: currentChainId, - }) + const loadingData = useCachedLoadingWithError( + waitForAll([ + govParamsSelector({ + chainId: defaultChainId, + }), + chainSupportsV1GovModuleSelector({ + chainId: defaultChainId, + }), + ]) ) - const supportsV1GovProposals = useCachedLoadingWithError( - chainSupportsV1GovModuleSelector({ - chainId: currentChainId, - }) - ) - - if (govParams.loading || supportsV1GovProposals.loading) { + if (loadingData.loading) { return } - if (govParams.errored) { - return govParams.error - } - if (supportsV1GovProposals.errored) { - return supportsV1GovProposals.error + if (loadingData.errored) { + return loadingData.error } - const deposit = govParams.data.minDeposit[0] + const [{ minDeposit }, supportsV1GovProposals] = loadingData.data + const deposit = minDeposit[0] return { - chainId: currentChainId, - version: supportsV1GovProposals.data + chainId: defaultChainId, + version: supportsV1GovProposals ? GovProposalVersion.V1 : GovProposalVersion.V1_BETA_1, title: '', @@ -338,7 +343,7 @@ export const makeGovernanceProposalAction: ActionMaker< ] : [ { - denom: getNativeTokenForChainId(currentChainId).denomOrAddress, + denom: getNativeTokenForChainId(defaultChainId).denomOrAddress, amount: 0, }, ], diff --git a/packages/stateful/actions/core/chain_governance/GovernanceVote/index.tsx b/packages/stateful/actions/core/chain_governance/GovernanceVote/index.tsx index 1a45815d1..88346cb83 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceVote/index.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceVote/index.tsx @@ -140,12 +140,12 @@ const Component: ActionComponent = (props) => { /> )} - } - forceFallback={openProposalsLoadable.state !== 'hasValue'} - > - - + + + } + forceFallback={openProposalsLoadable.state !== 'hasValue'} + > = (props) => { GovProposalActionDisplay, }} /> - - - + + + ) } diff --git a/packages/stateful/components/gov/CreateGovProposal.tsx b/packages/stateful/components/gov/CreateGovProposal.tsx index e91291aaf..a0476e862 100644 --- a/packages/stateful/components/gov/CreateGovProposal.tsx +++ b/packages/stateful/components/gov/CreateGovProposal.tsx @@ -3,14 +3,12 @@ import { useTranslation } from 'react-i18next' import { CreateProposal, - PageLoader, useDaoInfoContextIfAvailable, } from '@dao-dao/stateless' import { DaoTabId } from '@dao-dao/types' import { GovActionsProvider } from '../../actions' import { PageHeaderContent } from '../PageHeaderContent' -import { SuspenseLoader } from '../SuspenseLoader' import { NewGovProposal } from './NewGovProposal' export const CreateGovProposal = () => { @@ -38,12 +36,10 @@ export const CreateGovProposal = () => { copyDraftLink={() => copyDraftLinkRef.current()} newProposal={ - }> - - + } /> diff --git a/packages/stateful/components/gov/NewGovProposal.tsx b/packages/stateful/components/gov/NewGovProposal.tsx index 68904b073..0463d418a 100644 --- a/packages/stateful/components/gov/NewGovProposal.tsx +++ b/packages/stateful/components/gov/NewGovProposal.tsx @@ -49,7 +49,6 @@ import { FilterableItem, FilterableItemPopup, IconButton, - Loader, PageLoader, ProposalContentDisplay, Tooltip, @@ -94,7 +93,6 @@ import { makeGovernanceProposalAction } from '../../actions/core/chain_governanc import { useEntity } from '../../hooks' import { useWallet } from '../../hooks/useWallet' import { EntityDisplay } from '../EntityDisplay' -import { SuspenseLoader } from '../SuspenseLoader' import { GovProposalActionDisplay } from './GovProposalActionDisplay' enum ProposeSubmitValue { @@ -648,27 +646,18 @@ const InnerNewGovProposal = ({ onSubmit={handleSubmit(onSubmitForm, onSubmitError)} >
- }> - - {}} - allActionsWithData={[]} - data={proposalData} - errors={errors} - fieldNamePrefix="" - index={-1} - isCreating - remove={() => {}} - /> - - + + {}} + allActionsWithData={[]} + data={proposalData} + errors={errors} + fieldNamePrefix="" + index={-1} + isCreating + remove={() => {}} + /> +
From d62c5bb714c609131160a3b328cb568d8f88e86d Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 11 Jun 2024 19:51:12 -0400 Subject: [PATCH 227/438] store proposal draft data for links on IPFS --- packages/i18n/locales/en/translation.json | 2 + .../components/dao/CreateDaoProposal.tsx | 91 ++++++++++++------- .../components/gov/CreateGovProposal.tsx | 2 +- .../components/gov/NewGovProposal.tsx | 88 +++++++++++------- packages/stateless/components/logo/Loader.tsx | 14 ++- packages/stateless/pages/CreateProposal.tsx | 41 +++++++-- packages/utils/index.ts | 1 + packages/utils/ipfs.ts | 35 +++++++ 8 files changed, 198 insertions(+), 76 deletions(-) create mode 100644 packages/utils/ipfs.ts diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 61c14dd15..720886489 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -407,6 +407,7 @@ "failedToGetFactoryTokenInfo": "Failed to get factory token info. Please enter a valid factory denom.", "failedToGetTokenInfo": "Failed to get token info. Please enter a valid {{tokenType}} contract address.", "failedToLoadIbcConnection": "Failed to load IBC connection.", + "failedToLoadIpfsProposalSave": "Failed to load proposal save from IPFS.", "failedToLoadWidget": "Failed to load widget.", "failedToRelayAcks": "Failed to relay acknowledgements from {{chain}}.", "failedToRelayAndGetAcks": "Failed to relay packets and get acknowledgements.", @@ -931,6 +932,7 @@ "copiedLinkToClipboard": "Copied link to clipboard.", "copiedToClipboard": "Copied to clipboard.", "copyWalletAddressTooltip": "Copy wallet address", + "copying": "Copying...", "count": "Count", "createCrossChainAccountDescription": "Create an account for this DAO on another chain.", "createCrossChainAccountExplanation": "This action creates an account on another chain, allowing this DAO to perform actions on that chain.", diff --git a/packages/stateful/components/dao/CreateDaoProposal.tsx b/packages/stateful/components/dao/CreateDaoProposal.tsx index b17e0c953..d26ac5e37 100644 --- a/packages/stateful/components/dao/CreateDaoProposal.tsx +++ b/packages/stateful/components/dao/CreateDaoProposal.tsx @@ -43,8 +43,9 @@ import { DaoProposalSingleAdapterId, SITE_URL, decodeJsonFromBase64, - encodeJsonToBase64, objectMatchesStructure, + transformIpfsUrlToHttpsIfNecessary, + uploadJsonToIpfs, } from '@dao-dao/utils' import { @@ -182,45 +183,68 @@ const InnerCreateDaoProposal = ({ return } - const potentialPrefill = router.query.prefill - if (typeof potentialPrefill !== 'string' || !potentialPrefill) { - setPrefillChecked(true) - return - } + const loadFromPrefill = async () => { + let potentialPrefill = router.query.prefill + + // If no potential prefill found, try to load from IPFS. + if (!potentialPrefill) { + if (router.query.pi && typeof router.query.pi === 'string') { + try { + // Parse as text (not JSON) since JSON will be parsed below. + potentialPrefill = await ( + await fetch( + transformIpfsUrlToHttpsIfNecessary(`ipfs://${router.query.pi}`) + ) + ).text() + } catch (error) { + console.error(error) + toast.error(t('error.failedToLoadIpfsProposalSave')) + } + } + } - // Try to parse as JSON. - let prefillData - try { - prefillData = JSON.parse(potentialPrefill) - } catch (error) { - console.error(error) - } + if (typeof potentialPrefill !== 'string' || !potentialPrefill) { + setPrefillChecked(true) + return + } - // Try to parse as base64. - if (!prefillData) { + // Try to parse as JSON. + let prefillData try { - prefillData = decodeJsonFromBase64(potentialPrefill) + prefillData = JSON.parse(potentialPrefill) } catch (error) { console.error(error) } - } - // If prefillData looks valid, use it. - if ( - objectMatchesStructure(prefillData, { - id: {}, - data: {}, - }) - ) { - loadPrefill(prefillData) + // Try to parse as base64. + if (!prefillData) { + try { + prefillData = decodeJsonFromBase64(potentialPrefill) + } catch (error) { + console.error(error) + } + } + + // If prefillData looks valid, use it. + if ( + objectMatchesStructure(prefillData, { + id: {}, + data: {}, + }) + ) { + loadPrefill(prefillData) + } + + setPrefillChecked(true) } - setPrefillChecked(true) + loadFromPrefill() }, [ router.query.prefill, + router.query.pi, router.isReady, - daoInfo.proposalModules, prefillChecked, + t, loadPrefill, ]) @@ -357,14 +381,17 @@ const InnerCreateDaoProposal = ({ ] ) - const copyDraftLink = () => { + const copyDraftLink = async () => { + // Upload data to IPFS. + const cid = await uploadJsonToIpfs({ + id: proposalModuleAdapterCommonId, + data: getValues(), + }) + // Copy link to clipboard. navigator.clipboard.writeText( SITE_URL + getDaoProposalPath(daoInfo.coreAddress, 'create', { - prefill: encodeJsonToBase64({ - id: proposalModuleAdapterCommonId, - data: getValues(), - }), + pi: cid, }) ) toast.success(t('info.copiedLinkToClipboard')) diff --git a/packages/stateful/components/gov/CreateGovProposal.tsx b/packages/stateful/components/gov/CreateGovProposal.tsx index a0476e862..e777451a1 100644 --- a/packages/stateful/components/gov/CreateGovProposal.tsx +++ b/packages/stateful/components/gov/CreateGovProposal.tsx @@ -16,7 +16,7 @@ export const CreateGovProposal = () => { const daoInfo = useDaoInfoContextIfAvailable() const clearRef = useRef(() => {}) - const copyDraftLinkRef = useRef(() => {}) + const copyDraftLinkRef = useRef(async () => {}) return ( <> diff --git a/packages/stateful/components/gov/NewGovProposal.tsx b/packages/stateful/components/gov/NewGovProposal.tsx index 0463d418a..a3496b511 100644 --- a/packages/stateful/components/gov/NewGovProposal.tsx +++ b/packages/stateful/components/gov/NewGovProposal.tsx @@ -74,7 +74,6 @@ import { SITE_URL, dateToWdhms, decodeJsonFromBase64, - encodeJsonToBase64, formatDateTime, formatPercentOf100, formatTime, @@ -86,6 +85,8 @@ import { isCosmWasmStargateMsg, objectMatchesStructure, processError, + transformIpfsUrlToHttpsIfNecessary, + uploadJsonToIpfs, } from '@dao-dao/utils' import { WalletActionsProvider, useActionOptions } from '../../actions' @@ -143,42 +144,64 @@ export const NewGovProposal = (innerProps: NewGovProposalProps) => { return } - const potentialPrefill = router.query.prefill - if (typeof potentialPrefill !== 'string' || !potentialPrefill) { - setPrefillChecked(true) - return - } + const loadFromPrefill = async () => { + let potentialPrefill = router.query.prefill - // Try to parse as JSON. - let prefillData - try { - prefillData = JSON.parse(potentialPrefill) - } catch (error) { - console.error(error) - } + // If no potential prefill found, try to load from IPFS. + if (!potentialPrefill) { + if (router.query.pi && typeof router.query.pi === 'string') { + try { + // Parse as text (not JSON) since JSON will be parsed below. + potentialPrefill = await ( + await fetch( + transformIpfsUrlToHttpsIfNecessary(`ipfs://${router.query.pi}`) + ) + ).text() + } catch (error) { + console.error(error) + toast.error(t('error.failedToLoadIpfsProposalSave')) + } + } + } + + if (typeof potentialPrefill !== 'string' || !potentialPrefill) { + setPrefillChecked(true) + return + } - // Try to parse as base64. - if (!prefillData) { + // Try to parse as JSON. + let prefillData try { - prefillData = decodeJsonFromBase64(potentialPrefill) + prefillData = JSON.parse(potentialPrefill) } catch (error) { console.error(error) } - } - // If prefillData looks valid, use it. - if ( - objectMatchesStructure(prefillData, { - chainId: {}, - title: {}, - description: {}, - }) - ) { - setUsePrefill(prefillData) + // Try to parse as base64. + if (!prefillData) { + try { + prefillData = decodeJsonFromBase64(potentialPrefill) + } catch (error) { + console.error(error) + } + } + + // If prefillData looks valid, use it. + if ( + objectMatchesStructure(prefillData, { + chainId: {}, + title: {}, + description: {}, + }) + ) { + setUsePrefill(prefillData) + } + + setPrefillChecked(true) } - setPrefillChecked(true) - }, [router.query.prefill, router.isReady, prefillChecked]) + loadFromPrefill() + }, [router.query.prefill, router.query.pi, router.isReady, prefillChecked, t]) return !defaults || !prefillChecked ? ( @@ -224,7 +247,7 @@ type InnerNewGovProposalProps = { /** * A function ref that copies a link to the current draft. */ - copyDraftLinkRef: MutableRefObject<() => void> + copyDraftLinkRef: MutableRefObject<() => Promise> } const InnerNewGovProposal = ({ @@ -508,11 +531,14 @@ const InnerNewGovProposal = ({ } // Copy link to current draft. - copyDraftLinkRef.current = () => { + copyDraftLinkRef.current = async () => { + // Upload data to IPFS. + const cid = await uploadJsonToIpfs(proposalData) + // Copy link to clipboard. navigator.clipboard.writeText( SITE_URL + getDaoProposalPath(chainContext.config.name, 'create', { - prefill: encodeJsonToBase64(proposalData), + pi: cid, }) ) toast.success(t('info.copiedLinkToClipboard')) diff --git a/packages/stateless/components/logo/Loader.tsx b/packages/stateless/components/logo/Loader.tsx index 0c09f7acd..1399f3f9e 100644 --- a/packages/stateless/components/logo/Loader.tsx +++ b/packages/stateless/components/logo/Loader.tsx @@ -21,6 +21,14 @@ export const Loader = ({
) -export const PageLoader = ({ size = 64, ...props }: LoaderProps) => ( - -) +export const SmallLoader = ({ + fill = false, + size = 24, + ...props +}: LoaderProps) => + +export const PageLoader = ({ + fill = true, + size = 64, + ...props +}: LoaderProps) => diff --git a/packages/stateless/pages/CreateProposal.tsx b/packages/stateless/pages/CreateProposal.tsx index 1f3ff436e..4255970fc 100644 --- a/packages/stateless/pages/CreateProposal.tsx +++ b/packages/stateless/pages/CreateProposal.tsx @@ -1,8 +1,11 @@ import { Check, Clear, CopyAll } from '@mui/icons-material' import { ReactNode, useEffect, useState } from 'react' +import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' -import { IconButton, Tooltip } from '../components' +import { processError } from '@dao-dao/utils' + +import { IconButton, SmallLoader, Tooltip } from '../components' export type CreateProposalProps = { /** @@ -12,7 +15,7 @@ export type CreateProposalProps = { /** * Optionally show a button that copies a link to the current draft. */ - copyDraftLink?: () => void + copyDraftLink?: () => Promise /** * Optionally show a button that clears the form. */ @@ -21,7 +24,7 @@ export type CreateProposalProps = { export const CreateProposal = ({ newProposal, - copyDraftLink, + copyDraftLink: _copyDraftLink, clear, }: CreateProposalProps) => { const { t } = useTranslation() @@ -33,6 +36,22 @@ export const CreateProposal = ({ return () => clearTimeout(timeout) }, [copied]) + const [copying, setCopying] = useState(false) + const copyDraftLink = + _copyDraftLink && + (async () => { + setCopying(true) + try { + await _copyDraftLink() + setCopied(true) + } catch (error) { + console.error(error) + toast.error(processError(error)) + } finally { + setCopying(false) + } + }) + return (
@@ -40,14 +59,18 @@ export const CreateProposal = ({
{copyDraftLink && ( - + { - copyDraftLink() - setCopied(true) - }} + disabled={copying} + onClick={copyDraftLink} variant="ghost" /> diff --git a/packages/utils/index.ts b/packages/utils/index.ts index 3e5ed417d..76fc9208c 100644 --- a/packages/utils/index.ts +++ b/packages/utils/index.ts @@ -21,6 +21,7 @@ export * from './features' export * from './format' export * from './getFallbackImage' export * from './gov' +export * from './ipfs' export * from './isValidUrl' export * from './keplr' export * from './misc' diff --git a/packages/utils/ipfs.ts b/packages/utils/ipfs.ts new file mode 100644 index 000000000..775e69de2 --- /dev/null +++ b/packages/utils/ipfs.ts @@ -0,0 +1,35 @@ +/** + * Upload JSON to IPFS and return the CID. + */ +export const uploadJsonToIpfs = async ( + data: Record +): Promise => { + // Next.js API route. + const response = await fetch('/api/uploadJson', { + method: 'POST', + body: JSON.stringify(data), + headers: { + 'Content-Type': 'application/json', + }, + }) + + if (response.ok) { + const { cid } = await response.json() + if (!cid) { + throw new Error('Failed to get CID from response.') + } + + return cid + } else { + // Vercel limits file size to 4.5MB and responds with 413 if exceeded. Add + // some buffer to make room for the other fields. + if (response.status === 413) { + throw new Error('Data too large to upload. Max 4MB.') + } + + const { error } = await response + .json() + .catch(() => ({ error: 'Unknown error' })) + throw new Error(error) + } +} From f30d1c39c0cb02d2a29605ff3a9adf5e86dbe310 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 11 Jun 2024 20:08:19 -0400 Subject: [PATCH 228/438] use aws sdk v3 --- packages/email/package.json | 2 +- packages/utils/package.json | 2 +- packages/utils/server/filebase.ts | 57 +- yarn.lock | 1689 +++++++++++++++++------------ 4 files changed, 1034 insertions(+), 716 deletions(-) diff --git a/packages/email/package.json b/packages/email/package.json index ead86e5aa..6e46b3d76 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -9,7 +9,7 @@ "ses": "ts-node ./scripts/ses" }, "devDependencies": { - "@aws-sdk/client-ses": "^3.354.0", + "@aws-sdk/client-ses": "^3.592.0", "@dao-dao/config": "2.4.0-rc.8", "@dao-dao/types": "2.4.0-rc.8", "@react-email/components": "^0.0.7", diff --git a/packages/utils/package.json b/packages/utils/package.json index 4a32c6fb8..b87a6d8ac 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -8,6 +8,7 @@ "test": "jest" }, "dependencies": { + "@aws-sdk/client-s3": "^3.592.0", "@cosmjs/amino": "^0.32.3", "@cosmjs/cosmwasm-stargate": "^0.32.3", "@cosmjs/encoding": "^0.32.3", @@ -20,7 +21,6 @@ "@types/semver": "^7.5.6", "@types/uuid": "^9.0.1", "ajv": "^8.11.0", - "aws-sdk": "^2.1612.0", "chain-registry": "^1.59.4", "json5": "^2.2.0", "lodash.clonedeep": "^4.5.0", diff --git a/packages/utils/server/filebase.ts b/packages/utils/server/filebase.ts index 5103da19b..efca5cdf4 100644 --- a/packages/utils/server/filebase.ts +++ b/packages/utils/server/filebase.ts @@ -1,4 +1,5 @@ -import { S3 } from 'aws-sdk' +import { PutObjectCommand, S3 } from '@aws-sdk/client-s3' +import { StreamingBlobPayloadInputTypes } from '@smithy/types' import { FILEBASE_ACCESS_KEY_ID, @@ -15,7 +16,7 @@ export const uploadToFilebase = async ( /** * Data to upload. */ - data: S3.Body, + data: StreamingBlobPayloadInputTypes, /** * File path. */ @@ -29,17 +30,19 @@ export const uploadToFilebase = async ( */ ): Promise => { const client = new S3({ - apiVersion: '2006-03-01', - accessKeyId: FILEBASE_ACCESS_KEY_ID, - secretAccessKey: FILEBASE_SECRET_ACCESS_KEY, + credentials: { + accessKeyId: FILEBASE_ACCESS_KEY_ID, + secretAccessKey: FILEBASE_SECRET_ACCESS_KEY, + }, endpoint: 'https://s3.filebase.com', region: 'us-east-1', - s3ForcePathStyle: true, - signatureVersion: 'v4', + forcePathStyle: true, }) - return await new Promise((resolve, reject) => { - const request = client.putObject({ + return await new Promise(async (resolve, reject) => { + // https://docs.filebase.com/code-development-+-sdks/sdk-examples-pinning-files-and-folders-to-ipfs/aws-sdk-for-javascript#aws-sdk-v3 + + const command = new PutObjectCommand({ Bucket: FILEBASE_BUCKET, Key: path, ContentType: contentType, @@ -47,20 +50,32 @@ export const uploadToFilebase = async ( ACL: 'public-read', }) - // Listen for CID. - request.on('httpHeaders', (_, headers) => { - const cid = headers['x-amz-meta-cid'] - if (!cid) { - reject(new Error('No CID found.')) - } + command.middlewareStack.add( + (next) => async (args) => { + // Check if request is incoming as middleware works both ways + const response = await next(args) + if (!(response.response as any).statusCode) return response - resolve(cid) - }) + // Get cid from headers + const cid = (response.response as any).headers['x-amz-meta-cid'] + if (cid) { + resolve(cid) + } else { + reject(new Error('No CID found.')) + } - request.on('error', (err) => { - reject(err) - }) + return response + }, + { + step: 'build', + name: 'addCidToOutput', + } + ) - request.send() + try { + await client.send(command) + } catch (err) { + reject(err) + } }) } diff --git a/yarn.lock b/yarn.lock index 690c4a293..de74b95fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -72,6 +72,15 @@ "@aws-sdk/types" "^3.222.0" tslib "^1.11.1" +"@aws-crypto/crc32c@3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@aws-crypto/crc32c/-/crc32c-3.0.0.tgz#016c92da559ef638a84a245eecb75c3e97cb664f" + integrity sha512-ENNPPManmnVJ4BTXlOjAgD7URidbAznURqD0KvfREyc4o20DPYdEldU1f5cQ7Jbj0CJJSPaMIk/9ZshdB3210w== + dependencies: + "@aws-crypto/util" "^3.0.0" + "@aws-sdk/types" "^3.222.0" + tslib "^1.11.1" + "@aws-crypto/ie11-detection@^3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@aws-crypto/ie11-detection/-/ie11-detection-3.0.0.tgz#640ae66b4ec3395cee6a8e94ebcd9f80c24cd688" @@ -79,6 +88,19 @@ dependencies: tslib "^1.11.1" +"@aws-crypto/sha1-browser@3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@aws-crypto/sha1-browser/-/sha1-browser-3.0.0.tgz#f9083c00782b24714f528b1a1fef2174002266a3" + integrity sha512-NJth5c997GLHs6nOYTzFKTbYdMNA6/1XlKVgnZoaZcQ7z7UJlOgj2JdbHE8tiYLS3fzXNCguct77SPGat2raSw== + dependencies: + "@aws-crypto/ie11-detection" "^3.0.0" + "@aws-crypto/supports-web-crypto" "^3.0.0" + "@aws-crypto/util" "^3.0.0" + "@aws-sdk/types" "^3.222.0" + "@aws-sdk/util-locate-window" "^3.0.0" + "@aws-sdk/util-utf8-browser" "^3.0.0" + tslib "^1.11.1" + "@aws-crypto/sha256-browser@3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@aws-crypto/sha256-browser/-/sha256-browser-3.0.0.tgz#05f160138ab893f1c6ba5be57cfd108f05827766" @@ -118,612 +140,550 @@ "@aws-sdk/util-utf8-browser" "^3.0.0" tslib "^1.11.1" -"@aws-sdk/abort-controller@3.347.0": - version "3.347.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/abort-controller/-/abort-controller-3.347.0.tgz#8f1dc9f7e2030b3eabe2f05722d3d99e783e295f" - integrity sha512-P/2qE6ntYEmYG4Ez535nJWZbXqgbkJx8CMz7ChEuEg3Gp3dvVYEKg+iEUEvlqQ2U5dWP5J3ehw5po9t86IsVPQ== - dependencies: - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" - -"@aws-sdk/client-ses@^3.354.0": - version "3.354.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/client-ses/-/client-ses-3.354.0.tgz#0f0812a855979e099be8619731bf0773ae9041a4" - integrity sha512-uNyKceqmV0TunR8nktGiY+lRMA84fRvI/3BWuhNHcL72S7kOg7YadqaV5oEIzqbCz2Vaf6pV1B/16CZ6w75VCg== +"@aws-sdk/client-s3@^3.592.0": + version "3.592.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/client-s3/-/client-s3-3.592.0.tgz#ed9cfb1e968ecad06b716ffc20c02687ca789801" + integrity sha512-abn1XYk9HW2nXIvyD6ldwrNcF5/7a2p06OSWEr7zVTo954kArg8N0yTsy83ezznEHZfaZpdZn/DLDl2GxrE1Xw== dependencies: + "@aws-crypto/sha1-browser" "3.0.0" "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/client-sts" "3.354.0" - "@aws-sdk/config-resolver" "3.354.0" - "@aws-sdk/credential-provider-node" "3.354.0" - "@aws-sdk/fetch-http-handler" "3.353.0" - "@aws-sdk/hash-node" "3.347.0" - "@aws-sdk/invalid-dependency" "3.347.0" - "@aws-sdk/middleware-content-length" "3.347.0" - "@aws-sdk/middleware-endpoint" "3.347.0" - "@aws-sdk/middleware-host-header" "3.347.0" - "@aws-sdk/middleware-logger" "3.347.0" - "@aws-sdk/middleware-recursion-detection" "3.347.0" - "@aws-sdk/middleware-retry" "3.354.0" - "@aws-sdk/middleware-serde" "3.347.0" - "@aws-sdk/middleware-signing" "3.354.0" - "@aws-sdk/middleware-stack" "3.347.0" - "@aws-sdk/middleware-user-agent" "3.352.0" - "@aws-sdk/node-config-provider" "3.354.0" - "@aws-sdk/node-http-handler" "3.350.0" - "@aws-sdk/smithy-client" "3.347.0" - "@aws-sdk/types" "3.347.0" - "@aws-sdk/url-parser" "3.347.0" - "@aws-sdk/util-base64" "3.310.0" - "@aws-sdk/util-body-length-browser" "3.310.0" - "@aws-sdk/util-body-length-node" "3.310.0" - "@aws-sdk/util-defaults-mode-browser" "3.353.0" - "@aws-sdk/util-defaults-mode-node" "3.354.0" - "@aws-sdk/util-endpoints" "3.352.0" - "@aws-sdk/util-retry" "3.347.0" - "@aws-sdk/util-user-agent-browser" "3.347.0" - "@aws-sdk/util-user-agent-node" "3.354.0" - "@aws-sdk/util-utf8" "3.310.0" - "@aws-sdk/util-waiter" "3.347.0" - "@smithy/protocol-http" "^1.0.1" - "@smithy/types" "^1.0.0" - fast-xml-parser "4.2.4" - tslib "^2.5.0" + "@aws-sdk/client-sso-oidc" "3.592.0" + "@aws-sdk/client-sts" "3.592.0" + "@aws-sdk/core" "3.592.0" + "@aws-sdk/credential-provider-node" "3.592.0" + "@aws-sdk/middleware-bucket-endpoint" "3.587.0" + "@aws-sdk/middleware-expect-continue" "3.577.0" + "@aws-sdk/middleware-flexible-checksums" "3.587.0" + "@aws-sdk/middleware-host-header" "3.577.0" + "@aws-sdk/middleware-location-constraint" "3.577.0" + "@aws-sdk/middleware-logger" "3.577.0" + "@aws-sdk/middleware-recursion-detection" "3.577.0" + "@aws-sdk/middleware-sdk-s3" "3.587.0" + "@aws-sdk/middleware-signing" "3.587.0" + "@aws-sdk/middleware-ssec" "3.577.0" + "@aws-sdk/middleware-user-agent" "3.587.0" + "@aws-sdk/region-config-resolver" "3.587.0" + "@aws-sdk/signature-v4-multi-region" "3.587.0" + "@aws-sdk/types" "3.577.0" + "@aws-sdk/util-endpoints" "3.587.0" + "@aws-sdk/util-user-agent-browser" "3.577.0" + "@aws-sdk/util-user-agent-node" "3.587.0" + "@aws-sdk/xml-builder" "3.575.0" + "@smithy/config-resolver" "^3.0.1" + "@smithy/core" "^2.2.0" + "@smithy/eventstream-serde-browser" "^3.0.0" + "@smithy/eventstream-serde-config-resolver" "^3.0.0" + "@smithy/eventstream-serde-node" "^3.0.0" + "@smithy/fetch-http-handler" "^3.0.1" + "@smithy/hash-blob-browser" "^3.0.0" + "@smithy/hash-node" "^3.0.0" + "@smithy/hash-stream-node" "^3.0.0" + "@smithy/invalid-dependency" "^3.0.0" + "@smithy/md5-js" "^3.0.0" + "@smithy/middleware-content-length" "^3.0.0" + "@smithy/middleware-endpoint" "^3.0.1" + "@smithy/middleware-retry" "^3.0.3" + "@smithy/middleware-serde" "^3.0.0" + "@smithy/middleware-stack" "^3.0.0" + "@smithy/node-config-provider" "^3.1.0" + "@smithy/node-http-handler" "^3.0.0" + "@smithy/protocol-http" "^4.0.0" + "@smithy/smithy-client" "^3.1.1" + "@smithy/types" "^3.0.0" + "@smithy/url-parser" "^3.0.0" + "@smithy/util-base64" "^3.0.0" + "@smithy/util-body-length-browser" "^3.0.0" + "@smithy/util-body-length-node" "^3.0.0" + "@smithy/util-defaults-mode-browser" "^3.0.3" + "@smithy/util-defaults-mode-node" "^3.0.3" + "@smithy/util-endpoints" "^2.0.1" + "@smithy/util-retry" "^3.0.0" + "@smithy/util-stream" "^3.0.1" + "@smithy/util-utf8" "^3.0.0" + "@smithy/util-waiter" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/client-sso-oidc@3.354.0": - version "3.354.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.354.0.tgz#2a99ed5579a65c0157d99d9f43236863c450bbee" - integrity sha512-XZcg4s2zKb4S8ltluiw5yxpm974uZqzo2HTECt1lbzUJgVgLsMAh/nPJ1fLqg4jadT+rf8Lq2FEFqOM/vxWT8A== +"@aws-sdk/client-ses@^3.592.0": + version "3.592.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/client-ses/-/client-ses-3.592.0.tgz#3951bb9d98c4248243c2a9ea4b85cfaf1507112c" + integrity sha512-do8PkdH/gHV91tiz4F1V7oMkz3lhLeq0ejGPZerpo3PqrKqHRXpcL0TMZ3ukKEIALqv8wGwGvyvuJfBZpAxCzw== dependencies: "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/config-resolver" "3.354.0" - "@aws-sdk/fetch-http-handler" "3.353.0" - "@aws-sdk/hash-node" "3.347.0" - "@aws-sdk/invalid-dependency" "3.347.0" - "@aws-sdk/middleware-content-length" "3.347.0" - "@aws-sdk/middleware-endpoint" "3.347.0" - "@aws-sdk/middleware-host-header" "3.347.0" - "@aws-sdk/middleware-logger" "3.347.0" - "@aws-sdk/middleware-recursion-detection" "3.347.0" - "@aws-sdk/middleware-retry" "3.354.0" - "@aws-sdk/middleware-serde" "3.347.0" - "@aws-sdk/middleware-stack" "3.347.0" - "@aws-sdk/middleware-user-agent" "3.352.0" - "@aws-sdk/node-config-provider" "3.354.0" - "@aws-sdk/node-http-handler" "3.350.0" - "@aws-sdk/smithy-client" "3.347.0" - "@aws-sdk/types" "3.347.0" - "@aws-sdk/url-parser" "3.347.0" - "@aws-sdk/util-base64" "3.310.0" - "@aws-sdk/util-body-length-browser" "3.310.0" - "@aws-sdk/util-body-length-node" "3.310.0" - "@aws-sdk/util-defaults-mode-browser" "3.353.0" - "@aws-sdk/util-defaults-mode-node" "3.354.0" - "@aws-sdk/util-endpoints" "3.352.0" - "@aws-sdk/util-retry" "3.347.0" - "@aws-sdk/util-user-agent-browser" "3.347.0" - "@aws-sdk/util-user-agent-node" "3.354.0" - "@aws-sdk/util-utf8" "3.310.0" - "@smithy/protocol-http" "^1.0.1" - "@smithy/types" "^1.0.0" - tslib "^2.5.0" + "@aws-sdk/client-sso-oidc" "3.592.0" + "@aws-sdk/client-sts" "3.592.0" + "@aws-sdk/core" "3.592.0" + "@aws-sdk/credential-provider-node" "3.592.0" + "@aws-sdk/middleware-host-header" "3.577.0" + "@aws-sdk/middleware-logger" "3.577.0" + "@aws-sdk/middleware-recursion-detection" "3.577.0" + "@aws-sdk/middleware-user-agent" "3.587.0" + "@aws-sdk/region-config-resolver" "3.587.0" + "@aws-sdk/types" "3.577.0" + "@aws-sdk/util-endpoints" "3.587.0" + "@aws-sdk/util-user-agent-browser" "3.577.0" + "@aws-sdk/util-user-agent-node" "3.587.0" + "@smithy/config-resolver" "^3.0.1" + "@smithy/core" "^2.2.0" + "@smithy/fetch-http-handler" "^3.0.1" + "@smithy/hash-node" "^3.0.0" + "@smithy/invalid-dependency" "^3.0.0" + "@smithy/middleware-content-length" "^3.0.0" + "@smithy/middleware-endpoint" "^3.0.1" + "@smithy/middleware-retry" "^3.0.3" + "@smithy/middleware-serde" "^3.0.0" + "@smithy/middleware-stack" "^3.0.0" + "@smithy/node-config-provider" "^3.1.0" + "@smithy/node-http-handler" "^3.0.0" + "@smithy/protocol-http" "^4.0.0" + "@smithy/smithy-client" "^3.1.1" + "@smithy/types" "^3.0.0" + "@smithy/url-parser" "^3.0.0" + "@smithy/util-base64" "^3.0.0" + "@smithy/util-body-length-browser" "^3.0.0" + "@smithy/util-body-length-node" "^3.0.0" + "@smithy/util-defaults-mode-browser" "^3.0.3" + "@smithy/util-defaults-mode-node" "^3.0.3" + "@smithy/util-endpoints" "^2.0.1" + "@smithy/util-middleware" "^3.0.0" + "@smithy/util-retry" "^3.0.0" + "@smithy/util-utf8" "^3.0.0" + "@smithy/util-waiter" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/client-sso@3.354.0": - version "3.354.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/client-sso/-/client-sso-3.354.0.tgz#60810abfe575ef3f5f4a078e965eb8d3da95ea5f" - integrity sha512-4jmvjJYDaaPmm1n2TG4LYfTEnHLKcJmImgBqhgzhMgaypb4u/k1iw0INV2r/afYPL/FsrLFwc46RM3HYx3nc4A== +"@aws-sdk/client-sso-oidc@3.592.0": + version "3.592.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.592.0.tgz#0e5826e17a3d4db52cd38d0146e6faf520812cfe" + integrity sha512-11Zvm8nm0s/UF3XCjzFRpQU+8FFVW5rcr3BHfnH6xAe5JEoN6bJN/n+wOfnElnjek+90hh+Qc7s141AMrCjiiw== dependencies: "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/config-resolver" "3.354.0" - "@aws-sdk/fetch-http-handler" "3.353.0" - "@aws-sdk/hash-node" "3.347.0" - "@aws-sdk/invalid-dependency" "3.347.0" - "@aws-sdk/middleware-content-length" "3.347.0" - "@aws-sdk/middleware-endpoint" "3.347.0" - "@aws-sdk/middleware-host-header" "3.347.0" - "@aws-sdk/middleware-logger" "3.347.0" - "@aws-sdk/middleware-recursion-detection" "3.347.0" - "@aws-sdk/middleware-retry" "3.354.0" - "@aws-sdk/middleware-serde" "3.347.0" - "@aws-sdk/middleware-stack" "3.347.0" - "@aws-sdk/middleware-user-agent" "3.352.0" - "@aws-sdk/node-config-provider" "3.354.0" - "@aws-sdk/node-http-handler" "3.350.0" - "@aws-sdk/smithy-client" "3.347.0" - "@aws-sdk/types" "3.347.0" - "@aws-sdk/url-parser" "3.347.0" - "@aws-sdk/util-base64" "3.310.0" - "@aws-sdk/util-body-length-browser" "3.310.0" - "@aws-sdk/util-body-length-node" "3.310.0" - "@aws-sdk/util-defaults-mode-browser" "3.353.0" - "@aws-sdk/util-defaults-mode-node" "3.354.0" - "@aws-sdk/util-endpoints" "3.352.0" - "@aws-sdk/util-retry" "3.347.0" - "@aws-sdk/util-user-agent-browser" "3.347.0" - "@aws-sdk/util-user-agent-node" "3.354.0" - "@aws-sdk/util-utf8" "3.310.0" - "@smithy/protocol-http" "^1.0.1" - "@smithy/types" "^1.0.0" - tslib "^2.5.0" + "@aws-sdk/client-sts" "3.592.0" + "@aws-sdk/core" "3.592.0" + "@aws-sdk/credential-provider-node" "3.592.0" + "@aws-sdk/middleware-host-header" "3.577.0" + "@aws-sdk/middleware-logger" "3.577.0" + "@aws-sdk/middleware-recursion-detection" "3.577.0" + "@aws-sdk/middleware-user-agent" "3.587.0" + "@aws-sdk/region-config-resolver" "3.587.0" + "@aws-sdk/types" "3.577.0" + "@aws-sdk/util-endpoints" "3.587.0" + "@aws-sdk/util-user-agent-browser" "3.577.0" + "@aws-sdk/util-user-agent-node" "3.587.0" + "@smithy/config-resolver" "^3.0.1" + "@smithy/core" "^2.2.0" + "@smithy/fetch-http-handler" "^3.0.1" + "@smithy/hash-node" "^3.0.0" + "@smithy/invalid-dependency" "^3.0.0" + "@smithy/middleware-content-length" "^3.0.0" + "@smithy/middleware-endpoint" "^3.0.1" + "@smithy/middleware-retry" "^3.0.3" + "@smithy/middleware-serde" "^3.0.0" + "@smithy/middleware-stack" "^3.0.0" + "@smithy/node-config-provider" "^3.1.0" + "@smithy/node-http-handler" "^3.0.0" + "@smithy/protocol-http" "^4.0.0" + "@smithy/smithy-client" "^3.1.1" + "@smithy/types" "^3.0.0" + "@smithy/url-parser" "^3.0.0" + "@smithy/util-base64" "^3.0.0" + "@smithy/util-body-length-browser" "^3.0.0" + "@smithy/util-body-length-node" "^3.0.0" + "@smithy/util-defaults-mode-browser" "^3.0.3" + "@smithy/util-defaults-mode-node" "^3.0.3" + "@smithy/util-endpoints" "^2.0.1" + "@smithy/util-middleware" "^3.0.0" + "@smithy/util-retry" "^3.0.0" + "@smithy/util-utf8" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/client-sts@3.354.0": - version "3.354.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/client-sts/-/client-sts-3.354.0.tgz#3ff15a95c8361aef485954b23a2051d1c77e0d04" - integrity sha512-l9Ar/C/3PNlToM1ukHVfBtp4plbRUxLMYY2DOTMI0nb3jzfcvETBcdEGCP51fX4uAfJ2vc4g5qBF/qXKX0LMWA== +"@aws-sdk/client-sso@3.592.0": + version "3.592.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/client-sso/-/client-sso-3.592.0.tgz#90462e744998990079c28a083553090af9ac2902" + integrity sha512-w+SuW47jQqvOC7fonyjFjsOh3yjqJ+VpWdVrmrl0E/KryBE7ho/Wn991Buf/EiHHeJikoWgHsAIPkBH29+ntdA== dependencies: "@aws-crypto/sha256-browser" "3.0.0" "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/config-resolver" "3.354.0" - "@aws-sdk/credential-provider-node" "3.354.0" - "@aws-sdk/fetch-http-handler" "3.353.0" - "@aws-sdk/hash-node" "3.347.0" - "@aws-sdk/invalid-dependency" "3.347.0" - "@aws-sdk/middleware-content-length" "3.347.0" - "@aws-sdk/middleware-endpoint" "3.347.0" - "@aws-sdk/middleware-host-header" "3.347.0" - "@aws-sdk/middleware-logger" "3.347.0" - "@aws-sdk/middleware-recursion-detection" "3.347.0" - "@aws-sdk/middleware-retry" "3.354.0" - "@aws-sdk/middleware-sdk-sts" "3.354.0" - "@aws-sdk/middleware-serde" "3.347.0" - "@aws-sdk/middleware-signing" "3.354.0" - "@aws-sdk/middleware-stack" "3.347.0" - "@aws-sdk/middleware-user-agent" "3.352.0" - "@aws-sdk/node-config-provider" "3.354.0" - "@aws-sdk/node-http-handler" "3.350.0" - "@aws-sdk/smithy-client" "3.347.0" - "@aws-sdk/types" "3.347.0" - "@aws-sdk/url-parser" "3.347.0" - "@aws-sdk/util-base64" "3.310.0" - "@aws-sdk/util-body-length-browser" "3.310.0" - "@aws-sdk/util-body-length-node" "3.310.0" - "@aws-sdk/util-defaults-mode-browser" "3.353.0" - "@aws-sdk/util-defaults-mode-node" "3.354.0" - "@aws-sdk/util-endpoints" "3.352.0" - "@aws-sdk/util-retry" "3.347.0" - "@aws-sdk/util-user-agent-browser" "3.347.0" - "@aws-sdk/util-user-agent-node" "3.354.0" - "@aws-sdk/util-utf8" "3.310.0" - "@smithy/protocol-http" "^1.0.1" - "@smithy/types" "^1.0.0" - fast-xml-parser "4.2.4" - tslib "^2.5.0" - -"@aws-sdk/config-resolver@3.354.0": - version "3.354.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/config-resolver/-/config-resolver-3.354.0.tgz#8e8c85f7fc09b6fedfbfefdf41fadcfb9d2e0b07" - integrity sha512-K4XWie8yJPT8bpYVX54VJMQhiJRTw8PrjEs9QrKqvwoCcZ3G4qEt40tIu33XksuokXxk8rrVH5d7odOPBsAtdg== - dependencies: - "@aws-sdk/types" "3.347.0" - "@aws-sdk/util-config-provider" "3.310.0" - "@aws-sdk/util-middleware" "3.347.0" - tslib "^2.5.0" - -"@aws-sdk/credential-provider-env@3.353.0": - version "3.353.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-env/-/credential-provider-env-3.353.0.tgz#ef8c72978af09f4582cf98325f7f328e8f41574d" - integrity sha512-Y4VsNS8O1FAD5J7S5itOhnOghQ5LIXlZ44t35nF8cbcF+JPvY3ToKzYpjYN1jM7DXKqU4shtqgYpzSqxlvEgKQ== - dependencies: - "@aws-sdk/property-provider" "3.353.0" - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" - -"@aws-sdk/credential-provider-imds@3.354.0": - version "3.354.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-imds/-/credential-provider-imds-3.354.0.tgz#3b3face6881817deedc3a06892990f90df3d4321" - integrity sha512-AB+PuDd1jX6qgz+JYvIyOn8Kz9/lQ60KuY1TFb7g3S8zURw+DSeMJNR1jzEsorWICTzhxXmyasHVMa4Eo4Uq+Q== - dependencies: - "@aws-sdk/node-config-provider" "3.354.0" - "@aws-sdk/property-provider" "3.353.0" - "@aws-sdk/types" "3.347.0" - "@aws-sdk/url-parser" "3.347.0" - tslib "^2.5.0" - -"@aws-sdk/credential-provider-ini@3.354.0": - version "3.354.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.354.0.tgz#ec0d9df76a4c8bc422013a8ae5d66f38e3a475b1" - integrity sha512-bn2ifrRsxWpxzwXa25jRdUECQ1dC+NB3YlRYnGdIaIQLF559N2jnfCabYzqyfKI++WU7aQeMofPe2PxVGlbv9Q== - dependencies: - "@aws-sdk/credential-provider-env" "3.353.0" - "@aws-sdk/credential-provider-imds" "3.354.0" - "@aws-sdk/credential-provider-process" "3.354.0" - "@aws-sdk/credential-provider-sso" "3.354.0" - "@aws-sdk/credential-provider-web-identity" "3.354.0" - "@aws-sdk/property-provider" "3.353.0" - "@aws-sdk/shared-ini-file-loader" "3.354.0" - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" - -"@aws-sdk/credential-provider-node@3.354.0": - version "3.354.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-node/-/credential-provider-node-3.354.0.tgz#1ab83974a0522dd784fcb7a4cb5a07b3864cb1fe" - integrity sha512-ltKiRtHfqDaCcrb44DIoSHQ9MposFl/aDtNdu5OdQv/2Q1r7M/r2fQdq9DHOrxeQQjaUH4C6k6fGTsxALTHyNA== - dependencies: - "@aws-sdk/credential-provider-env" "3.353.0" - "@aws-sdk/credential-provider-imds" "3.354.0" - "@aws-sdk/credential-provider-ini" "3.354.0" - "@aws-sdk/credential-provider-process" "3.354.0" - "@aws-sdk/credential-provider-sso" "3.354.0" - "@aws-sdk/credential-provider-web-identity" "3.354.0" - "@aws-sdk/property-provider" "3.353.0" - "@aws-sdk/shared-ini-file-loader" "3.354.0" - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" - -"@aws-sdk/credential-provider-process@3.354.0": - version "3.354.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-process/-/credential-provider-process-3.354.0.tgz#674f8eccaeffe17a3fff7d85878569be05ee9d8f" - integrity sha512-AxpASm+tS8V1PY4PLfG9dtqa96lzBJ3niTQb+RAm4uYCddW7gxNDkGB+jSCzVdUPVa3xA2ITBS/ka3C5yM8YWg== - dependencies: - "@aws-sdk/property-provider" "3.353.0" - "@aws-sdk/shared-ini-file-loader" "3.354.0" - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" - -"@aws-sdk/credential-provider-sso@3.354.0": - version "3.354.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.354.0.tgz#bdcf18778415d69ec6cbeaff28ad5a373f8a2e67" - integrity sha512-ihiaUxh8V/nQgTOgQZxWQcbckXhM+J6Wdc4F0z9soi48iSOqzRpzPw5E14wSZScEZjNY/gKEDz8gCt8WkT/G0w== - dependencies: - "@aws-sdk/client-sso" "3.354.0" - "@aws-sdk/property-provider" "3.353.0" - "@aws-sdk/shared-ini-file-loader" "3.354.0" - "@aws-sdk/token-providers" "3.354.0" - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" - -"@aws-sdk/credential-provider-web-identity@3.354.0": - version "3.354.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.354.0.tgz#f7e557cf7f85bc9b41905e6ae9cbf5c0f7c62ba3" - integrity sha512-scx9mAf4m3Hc3uMX2Vh8GciEcC/5GqeDI8qc0zBj+UF/5c/GtihZA4WoCV3Sg3jMPDUKY81DiFCtcKHhtUqKfg== - dependencies: - "@aws-sdk/property-provider" "3.353.0" - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" - -"@aws-sdk/eventstream-codec@3.347.0": - version "3.347.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/eventstream-codec/-/eventstream-codec-3.347.0.tgz#4ba2c87a2f6e4bb10a833910a4427d16ceec09f0" - integrity sha512-61q+SyspjsaQ4sdgjizMyRgVph2CiW4aAtfpoH69EJFJfTxTR/OqnZ9Jx/3YiYi0ksrvDenJddYodfWWJqD8/w== - dependencies: - "@aws-crypto/crc32" "3.0.0" - "@aws-sdk/types" "3.347.0" - "@aws-sdk/util-hex-encoding" "3.310.0" - tslib "^2.5.0" + "@aws-sdk/core" "3.592.0" + "@aws-sdk/middleware-host-header" "3.577.0" + "@aws-sdk/middleware-logger" "3.577.0" + "@aws-sdk/middleware-recursion-detection" "3.577.0" + "@aws-sdk/middleware-user-agent" "3.587.0" + "@aws-sdk/region-config-resolver" "3.587.0" + "@aws-sdk/types" "3.577.0" + "@aws-sdk/util-endpoints" "3.587.0" + "@aws-sdk/util-user-agent-browser" "3.577.0" + "@aws-sdk/util-user-agent-node" "3.587.0" + "@smithy/config-resolver" "^3.0.1" + "@smithy/core" "^2.2.0" + "@smithy/fetch-http-handler" "^3.0.1" + "@smithy/hash-node" "^3.0.0" + "@smithy/invalid-dependency" "^3.0.0" + "@smithy/middleware-content-length" "^3.0.0" + "@smithy/middleware-endpoint" "^3.0.1" + "@smithy/middleware-retry" "^3.0.3" + "@smithy/middleware-serde" "^3.0.0" + "@smithy/middleware-stack" "^3.0.0" + "@smithy/node-config-provider" "^3.1.0" + "@smithy/node-http-handler" "^3.0.0" + "@smithy/protocol-http" "^4.0.0" + "@smithy/smithy-client" "^3.1.1" + "@smithy/types" "^3.0.0" + "@smithy/url-parser" "^3.0.0" + "@smithy/util-base64" "^3.0.0" + "@smithy/util-body-length-browser" "^3.0.0" + "@smithy/util-body-length-node" "^3.0.0" + "@smithy/util-defaults-mode-browser" "^3.0.3" + "@smithy/util-defaults-mode-node" "^3.0.3" + "@smithy/util-endpoints" "^2.0.1" + "@smithy/util-middleware" "^3.0.0" + "@smithy/util-retry" "^3.0.0" + "@smithy/util-utf8" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/fetch-http-handler@3.353.0": - version "3.353.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/fetch-http-handler/-/fetch-http-handler-3.353.0.tgz#0fe801aaf0ceeb21e878803b0e397464f1890537" - integrity sha512-8ic2+4E6jzfDevd++QS1rOR05QFkAhEFbi5Ja3/Zzp7TkWIS8wv5wwMATjNkbbdsXYuB5Lhl/OsjfZmIv5aqRw== +"@aws-sdk/client-sts@3.592.0": + version "3.592.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/client-sts/-/client-sts-3.592.0.tgz#8a24080785355ced48ed5b49ab23d1eaf9f70f47" + integrity sha512-KUrOdszZfcrlpKr4dpdkGibZ/qq3Lnfu1rjv1U+V1QJQ9OuMo9J3sDWpWV9tigNqY0aGllarWH5cJbz9868W/w== dependencies: - "@aws-sdk/protocol-http" "3.347.0" - "@aws-sdk/querystring-builder" "3.347.0" - "@aws-sdk/types" "3.347.0" - "@aws-sdk/util-base64" "3.310.0" - tslib "^2.5.0" + "@aws-crypto/sha256-browser" "3.0.0" + "@aws-crypto/sha256-js" "3.0.0" + "@aws-sdk/client-sso-oidc" "3.592.0" + "@aws-sdk/core" "3.592.0" + "@aws-sdk/credential-provider-node" "3.592.0" + "@aws-sdk/middleware-host-header" "3.577.0" + "@aws-sdk/middleware-logger" "3.577.0" + "@aws-sdk/middleware-recursion-detection" "3.577.0" + "@aws-sdk/middleware-user-agent" "3.587.0" + "@aws-sdk/region-config-resolver" "3.587.0" + "@aws-sdk/types" "3.577.0" + "@aws-sdk/util-endpoints" "3.587.0" + "@aws-sdk/util-user-agent-browser" "3.577.0" + "@aws-sdk/util-user-agent-node" "3.587.0" + "@smithy/config-resolver" "^3.0.1" + "@smithy/core" "^2.2.0" + "@smithy/fetch-http-handler" "^3.0.1" + "@smithy/hash-node" "^3.0.0" + "@smithy/invalid-dependency" "^3.0.0" + "@smithy/middleware-content-length" "^3.0.0" + "@smithy/middleware-endpoint" "^3.0.1" + "@smithy/middleware-retry" "^3.0.3" + "@smithy/middleware-serde" "^3.0.0" + "@smithy/middleware-stack" "^3.0.0" + "@smithy/node-config-provider" "^3.1.0" + "@smithy/node-http-handler" "^3.0.0" + "@smithy/protocol-http" "^4.0.0" + "@smithy/smithy-client" "^3.1.1" + "@smithy/types" "^3.0.0" + "@smithy/url-parser" "^3.0.0" + "@smithy/util-base64" "^3.0.0" + "@smithy/util-body-length-browser" "^3.0.0" + "@smithy/util-body-length-node" "^3.0.0" + "@smithy/util-defaults-mode-browser" "^3.0.3" + "@smithy/util-defaults-mode-node" "^3.0.3" + "@smithy/util-endpoints" "^2.0.1" + "@smithy/util-middleware" "^3.0.0" + "@smithy/util-retry" "^3.0.0" + "@smithy/util-utf8" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/hash-node@3.347.0": - version "3.347.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/hash-node/-/hash-node-3.347.0.tgz#575b31227306c03b491b814178a72b0b79625ed5" - integrity sha512-96+ml/4EaUaVpzBdOLGOxdoXOjkPgkoJp/0i1fxOJEvl8wdAQSwc3IugVK9wZkCxy2DlENtgOe6DfIOhfffm/g== - dependencies: - "@aws-sdk/types" "3.347.0" - "@aws-sdk/util-buffer-from" "3.310.0" - "@aws-sdk/util-utf8" "3.310.0" - tslib "^2.5.0" +"@aws-sdk/core@3.592.0": + version "3.592.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/core/-/core-3.592.0.tgz#d903a3993f8ba6836480314c2a8af8b7857bb943" + integrity sha512-gLPMXR/HXDP+9gXAt58t7gaMTvRts9i6Q7NMISpkGF54wehskl5WGrbdtHJFylrlJ5BQo3XVY6i661o+EuR1wg== + dependencies: + "@smithy/core" "^2.2.0" + "@smithy/protocol-http" "^4.0.0" + "@smithy/signature-v4" "^3.0.0" + "@smithy/smithy-client" "^3.1.1" + "@smithy/types" "^3.0.0" + fast-xml-parser "4.2.5" + tslib "^2.6.2" -"@aws-sdk/invalid-dependency@3.347.0": - version "3.347.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/invalid-dependency/-/invalid-dependency-3.347.0.tgz#2e5994cdd51dc3fe0310ce355e1ab115b66b7cb5" - integrity sha512-8imQcwLwqZ/wTJXZqzXT9pGLIksTRckhGLZaXT60tiBOPKuerTsus2L59UstLs5LP8TKaVZKFFSsjRIn9dQdmQ== +"@aws-sdk/credential-provider-env@3.587.0": + version "3.587.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-env/-/credential-provider-env-3.587.0.tgz#40435be331773e4b1b665a1f4963518d4647505c" + integrity sha512-Hyg/5KFECIk2k5o8wnVEiniV86yVkhn5kzITUydmNGCkXdBFHMHRx6hleQ1bqwJHbBskyu8nbYamzcwymmGwmw== dependencies: - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" + "@aws-sdk/types" "3.577.0" + "@smithy/property-provider" "^3.1.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/is-array-buffer@3.310.0": - version "3.310.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/is-array-buffer/-/is-array-buffer-3.310.0.tgz#f87a79f1b858c88744f07e8d8d0a791df204017e" - integrity sha512-urnbcCR+h9NWUnmOtet/s4ghvzsidFmspfhYaHAmSRdy9yDjdjBJMFjjsn85A1ODUktztm+cVncXjQ38WCMjMQ== - dependencies: - tslib "^2.5.0" +"@aws-sdk/credential-provider-http@3.587.0": + version "3.587.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-http/-/credential-provider-http-3.587.0.tgz#dc23c6d6708bc67baea54bfab0f256c5fe4df023" + integrity sha512-Su1SRWVRCuR1e32oxX3C1V4c5hpPN20WYcRfdcr2wXwHqSvys5DrnmuCC+JoEnS/zt3adUJhPliTqpfKgSdMrA== + dependencies: + "@aws-sdk/types" "3.577.0" + "@smithy/fetch-http-handler" "^3.0.1" + "@smithy/node-http-handler" "^3.0.0" + "@smithy/property-provider" "^3.1.0" + "@smithy/protocol-http" "^4.0.0" + "@smithy/smithy-client" "^3.1.1" + "@smithy/types" "^3.0.0" + "@smithy/util-stream" "^3.0.1" + tslib "^2.6.2" -"@aws-sdk/middleware-content-length@3.347.0": - version "3.347.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-content-length/-/middleware-content-length-3.347.0.tgz#ee6063ebb0215355b7a7dacd0a3bbe2e1a8d108f" - integrity sha512-i4qtWTDImMaDUtwKQPbaZpXsReiwiBomM1cWymCU4bhz81HL01oIxOxOBuiM+3NlDoCSPr3KI6txZSz/8cqXCQ== - dependencies: - "@aws-sdk/protocol-http" "3.347.0" - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" +"@aws-sdk/credential-provider-ini@3.592.0": + version "3.592.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.592.0.tgz#02b85eaca21fe54d4d285009b64a8add032a042b" + integrity sha512-3kG6ngCIOPbLJZZ3RV+NsU7HVK6vX1+1DrPJKj9fVlPYn7IXsk8NAaUT5885yC7+jKizjv0cWLrLKvAJV5gfUA== + dependencies: + "@aws-sdk/credential-provider-env" "3.587.0" + "@aws-sdk/credential-provider-http" "3.587.0" + "@aws-sdk/credential-provider-process" "3.587.0" + "@aws-sdk/credential-provider-sso" "3.592.0" + "@aws-sdk/credential-provider-web-identity" "3.587.0" + "@aws-sdk/types" "3.577.0" + "@smithy/credential-provider-imds" "^3.1.0" + "@smithy/property-provider" "^3.1.0" + "@smithy/shared-ini-file-loader" "^3.1.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/middleware-endpoint@3.347.0": - version "3.347.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-endpoint/-/middleware-endpoint-3.347.0.tgz#d577265e79cdc0241d863e2582820010ea942736" - integrity sha512-unF0c6dMaUL1ffU+37Ugty43DgMnzPWXr/Jup/8GbK5fzzWT5NQq6dj9KHPubMbWeEjQbmczvhv25JuJdK8gNQ== - dependencies: - "@aws-sdk/middleware-serde" "3.347.0" - "@aws-sdk/types" "3.347.0" - "@aws-sdk/url-parser" "3.347.0" - "@aws-sdk/util-middleware" "3.347.0" - tslib "^2.5.0" +"@aws-sdk/credential-provider-node@3.592.0": + version "3.592.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-node/-/credential-provider-node-3.592.0.tgz#b8339b1bfdea39b17e5da1a502b60f0fe3dde126" + integrity sha512-BguihBGTrEjVBQ07hm+ZsO29eNJaxwBwUZMftgGAm2XcMIEClNPfm5hydxu2BmA4ouIJQJ6nG8pNYghEumM+Aw== + dependencies: + "@aws-sdk/credential-provider-env" "3.587.0" + "@aws-sdk/credential-provider-http" "3.587.0" + "@aws-sdk/credential-provider-ini" "3.592.0" + "@aws-sdk/credential-provider-process" "3.587.0" + "@aws-sdk/credential-provider-sso" "3.592.0" + "@aws-sdk/credential-provider-web-identity" "3.587.0" + "@aws-sdk/types" "3.577.0" + "@smithy/credential-provider-imds" "^3.1.0" + "@smithy/property-provider" "^3.1.0" + "@smithy/shared-ini-file-loader" "^3.1.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/middleware-host-header@3.347.0": - version "3.347.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-host-header/-/middleware-host-header-3.347.0.tgz#6166c137044672b2229e6ee0ce8a3e59fd8c49c4" - integrity sha512-kpKmR9OvMlnReqp5sKcJkozbj1wmlblbVSbnQAIkzeQj2xD5dnVR3Nn2ogQKxSmU1Fv7dEroBtrruJ1o3fY38A== +"@aws-sdk/credential-provider-process@3.587.0": + version "3.587.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-process/-/credential-provider-process-3.587.0.tgz#1e5cc562a68438a77f464adc0493b02e04dd3ea1" + integrity sha512-V4xT3iCqkF8uL6QC4gqBJg/2asd/damswP1h9HCfqTllmPWzImS+8WD3VjgTLw5b0KbTy+ZdUhKc0wDnyzkzxg== dependencies: - "@aws-sdk/protocol-http" "3.347.0" - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" + "@aws-sdk/types" "3.577.0" + "@smithy/property-provider" "^3.1.0" + "@smithy/shared-ini-file-loader" "^3.1.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/middleware-logger@3.347.0": - version "3.347.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-logger/-/middleware-logger-3.347.0.tgz#d75a6bbda38c85200219f4ef88e7696d72f94100" - integrity sha512-NYC+Id5UCkVn+3P1t/YtmHt75uED06vwaKyxDy0UmB2K66PZLVtwWbLpVWrhbroaw1bvUHYcRyQ9NIfnVcXQjA== - dependencies: - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" +"@aws-sdk/credential-provider-sso@3.592.0": + version "3.592.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.592.0.tgz#340649b4f5b4fbcb816f248089979d7d38ce96d3" + integrity sha512-fYFzAdDHKHvhtufPPtrLdSv8lO6GuW3em6n3erM5uFdpGytNpjXvr3XGokIsuXcNkETAY/Xihg+G9ksNE8WJxQ== + dependencies: + "@aws-sdk/client-sso" "3.592.0" + "@aws-sdk/token-providers" "3.587.0" + "@aws-sdk/types" "3.577.0" + "@smithy/property-provider" "^3.1.0" + "@smithy/shared-ini-file-loader" "^3.1.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/middleware-recursion-detection@3.347.0": - version "3.347.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.347.0.tgz#00faf00d9346cb88dafdfddfd33e956ba563bf99" - integrity sha512-qfnSvkFKCAMjMHR31NdsT0gv5Sq/ZHTUD4yQsSLpbVQ6iYAS834lrzXt41iyEHt57Y514uG7F/Xfvude3u4icQ== +"@aws-sdk/credential-provider-web-identity@3.587.0": + version "3.587.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.587.0.tgz#daa41e3cc9309594327056e431b8065145c5297a" + integrity sha512-XqIx/I2PG7kyuw3WjAP9wKlxy8IvFJwB8asOFT1xPFoVfZYKIogjG9oLP5YiRtfvDkWIztHmg5MlVv3HdJDGRw== dependencies: - "@aws-sdk/protocol-http" "3.347.0" - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" + "@aws-sdk/types" "3.577.0" + "@smithy/property-provider" "^3.1.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/middleware-retry@3.354.0": - version "3.354.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-retry/-/middleware-retry-3.354.0.tgz#7797ef55c94999f6eaa3671e14b53b6a1758acf3" - integrity sha512-dnG5Nd/mobbhcWCM71DQWI9+f6b6fDSzALXftFIP/8lsXKRcWDSQuYjrnVST2wZzk/QmdF8TnVD0C1xL14K6CQ== - dependencies: - "@aws-sdk/protocol-http" "3.347.0" - "@aws-sdk/service-error-classification" "3.347.0" - "@aws-sdk/types" "3.347.0" - "@aws-sdk/util-middleware" "3.347.0" - "@aws-sdk/util-retry" "3.347.0" - tslib "^2.5.0" - uuid "^8.3.2" +"@aws-sdk/middleware-bucket-endpoint@3.587.0": + version "3.587.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-bucket-endpoint/-/middleware-bucket-endpoint-3.587.0.tgz#def5edbadf53bdfe765aa9acf12f119eb208b22f" + integrity sha512-HkFXLPl8pr6BH/Q0JpOESqEKL0ZK3sk7aSZ1S6GE4RXET7H5R94THULXqQFZzD48gZcyFooO/yNKZTqrZFaWKg== + dependencies: + "@aws-sdk/types" "3.577.0" + "@aws-sdk/util-arn-parser" "3.568.0" + "@smithy/node-config-provider" "^3.1.0" + "@smithy/protocol-http" "^4.0.0" + "@smithy/types" "^3.0.0" + "@smithy/util-config-provider" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/middleware-sdk-sts@3.354.0": - version "3.354.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-sdk-sts/-/middleware-sdk-sts-3.354.0.tgz#a438c56127baadb036a89473341fd2c1250363da" - integrity sha512-L6vyAwYrdcOoB4YgCqNJNr+ZZtLHEF2Ym3CTfmFm2srXHqHuRB+mBu0NLV/grz77znIArK1H1ZL/ZaH2I5hclA== +"@aws-sdk/middleware-expect-continue@3.577.0": + version "3.577.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-expect-continue/-/middleware-expect-continue-3.577.0.tgz#47add47f17873a6044cb140f17033cb6e1d02744" + integrity sha512-6dPp8Tv4F0of4un5IAyG6q++GrRrNQQ4P2NAMB1W0VO4JoEu1C8GievbbDLi88TFIFmtKpnHB0ODCzwnoe8JsA== dependencies: - "@aws-sdk/middleware-signing" "3.354.0" - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" + "@aws-sdk/types" "3.577.0" + "@smithy/protocol-http" "^4.0.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/middleware-serde@3.347.0": - version "3.347.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-serde/-/middleware-serde-3.347.0.tgz#f20a63290e16d631a8aa7d9eb331b139bf2531ac" - integrity sha512-x5Foi7jRbVJXDu9bHfyCbhYDH5pKK+31MmsSJ3k8rY8keXLBxm2XEEg/AIoV9/TUF9EeVvZ7F1/RmMpJnWQsEg== +"@aws-sdk/middleware-flexible-checksums@3.587.0": + version "3.587.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-flexible-checksums/-/middleware-flexible-checksums-3.587.0.tgz#74afe7bd3088adf05b2ed843ad41386e793e0397" + integrity sha512-URMwp/budDvKhIvZ4a6zIBfFTun/iDlPWXqsGKYjEtHt8jz27OSjCZtDtIeqW4WTBdKL8KZgQcl+DdaE5M1qiQ== dependencies: - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" + "@aws-crypto/crc32" "3.0.0" + "@aws-crypto/crc32c" "3.0.0" + "@aws-sdk/types" "3.577.0" + "@smithy/is-array-buffer" "^3.0.0" + "@smithy/protocol-http" "^4.0.0" + "@smithy/types" "^3.0.0" + "@smithy/util-utf8" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/middleware-signing@3.354.0": - version "3.354.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-signing/-/middleware-signing-3.354.0.tgz#7249c77694a3b4f04551f150129324b8ba9fbacf" - integrity sha512-Dd+vIhJL0VqqKWqlTKlKC5jkCaEIk73ZEXNfv44XbsI25a0vXbatHp1M8jB/cgkJC/Mri1TX9dmckP/C0FDEwA== +"@aws-sdk/middleware-host-header@3.577.0": + version "3.577.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-host-header/-/middleware-host-header-3.577.0.tgz#a3fc626d409ec850296740478c64ef5806d8b878" + integrity sha512-9ca5MJz455CODIVXs0/sWmJm7t3QO4EUa1zf8pE8grLpzf0J94bz/skDWm37Pli13T3WaAQBHCTiH2gUVfCsWg== dependencies: - "@aws-sdk/property-provider" "3.353.0" - "@aws-sdk/protocol-http" "3.347.0" - "@aws-sdk/signature-v4" "3.354.0" - "@aws-sdk/types" "3.347.0" - "@aws-sdk/util-middleware" "3.347.0" - tslib "^2.5.0" + "@aws-sdk/types" "3.577.0" + "@smithy/protocol-http" "^4.0.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/middleware-stack@3.347.0": - version "3.347.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-stack/-/middleware-stack-3.347.0.tgz#de8f94349273e1b30e19b6e8ace95a7982a24579" - integrity sha512-Izidg4rqtYMcKuvn2UzgEpPLSmyd8ub9+LQ2oIzG3mpIzCBITq7wp40jN1iNkMg+X6KEnX9vdMJIYZsPYMCYuQ== +"@aws-sdk/middleware-location-constraint@3.577.0": + version "3.577.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-location-constraint/-/middleware-location-constraint-3.577.0.tgz#9372441a4ac5747b3176ac6378d92866a51de815" + integrity sha512-DKPTD2D2s+t2QUo/IXYtVa/6Un8GZ+phSTBkyBNx2kfZz4Kwavhl/JJzSqTV3GfCXkVdFu7CrjoX7BZ6qWeTUA== dependencies: - tslib "^2.5.0" + "@aws-sdk/types" "3.577.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/middleware-user-agent@3.352.0": - version "3.352.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.352.0.tgz#ca32fc2296e9b4565c2878ff44c2756a952f42b4" - integrity sha512-QGqblMTsVDqeomy22KPm9LUW8PHZXBA2Hjk9Hcw8U1uFS8IKYJrewInG3ae2+9FAcTyug4LFWDf8CRr9YH2B3Q== +"@aws-sdk/middleware-logger@3.577.0": + version "3.577.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-logger/-/middleware-logger-3.577.0.tgz#6da3b13ae284fb3930961f0fc8e20b1f6cf8be30" + integrity sha512-aPFGpGjTZcJYk+24bg7jT4XdIp42mFXSuPt49lw5KygefLyJM/sB0bKKqPYYivW0rcuZ9brQ58eZUNthrzYAvg== dependencies: - "@aws-sdk/protocol-http" "3.347.0" - "@aws-sdk/types" "3.347.0" - "@aws-sdk/util-endpoints" "3.352.0" - tslib "^2.5.0" + "@aws-sdk/types" "3.577.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/node-config-provider@3.354.0": - version "3.354.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/node-config-provider/-/node-config-provider-3.354.0.tgz#4169d2957315aa23f8b45e4d53eafc97dcb3760c" - integrity sha512-pF1ZGWWvmwbrloNHYF3EDqCb9hq5wfZwDqAwAPhWkYnUYKkR7E7MZVuTwUDU48io8k6Z5pM52l/54w8e8aedTw== +"@aws-sdk/middleware-recursion-detection@3.577.0": + version "3.577.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.577.0.tgz#fff76abc6d4521636f9e654ce5bf2c4c79249417" + integrity sha512-pn3ZVEd2iobKJlR3H+bDilHjgRnNrQ6HMmK9ZzZw89Ckn3Dcbv48xOv4RJvu0aU8SDLl/SNCxppKjeLDTPGBNA== dependencies: - "@aws-sdk/property-provider" "3.353.0" - "@aws-sdk/shared-ini-file-loader" "3.354.0" - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" + "@aws-sdk/types" "3.577.0" + "@smithy/protocol-http" "^4.0.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/node-http-handler@3.350.0": - version "3.350.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/node-http-handler/-/node-http-handler-3.350.0.tgz#c3d3af4e24e7dc823bdb04c73dcae4d12d8a6221" - integrity sha512-oD96GAlmpzYilCdC8wwyURM5lNfNHZCjm/kxBkQulHKa2kRbIrnD9GfDqdCkWA5cTpjh1NzGLT4D6e6UFDjt9w== - dependencies: - "@aws-sdk/abort-controller" "3.347.0" - "@aws-sdk/protocol-http" "3.347.0" - "@aws-sdk/querystring-builder" "3.347.0" - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" +"@aws-sdk/middleware-sdk-s3@3.587.0": + version "3.587.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.587.0.tgz#720620ccdc2eb6ecab0f3a6adbd28fc27fdc70ce" + integrity sha512-vtXTGEiw1E9Fax4LmcU2Z208gbrC8ShrdsSLmGcRPpu5NPOGBFBSDG5sy5EDNClrFxIl/Le8coQnD0EDBtx+uQ== + dependencies: + "@aws-sdk/types" "3.577.0" + "@aws-sdk/util-arn-parser" "3.568.0" + "@smithy/node-config-provider" "^3.1.0" + "@smithy/protocol-http" "^4.0.0" + "@smithy/signature-v4" "^3.0.0" + "@smithy/smithy-client" "^3.1.1" + "@smithy/types" "^3.0.0" + "@smithy/util-config-provider" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/property-provider@3.353.0": - version "3.353.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/property-provider/-/property-provider-3.353.0.tgz#a877ca6d4a165773609eb776483ffb8606f03b7e" - integrity sha512-Iu6J59hncaew7eBKroTcLjZ8cgrom0IWyZZ09rsow3rZDHVtw7LQSrUyuqsSbKGY9eRtL7Wa6ZtYHnXFiAE2kg== - dependencies: - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" +"@aws-sdk/middleware-signing@3.587.0": + version "3.587.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-signing/-/middleware-signing-3.587.0.tgz#593c418c09c51c0bc55f23a7a6b0fda8502a8103" + integrity sha512-tiZaTDj4RvhXGRAlncFn7CSEfL3iNPO67WSaxAq+Ls5j1VgczPhu5262cWONNoMgth3nXR1hhLC4ITSl/a6AzA== + dependencies: + "@aws-sdk/types" "3.577.0" + "@smithy/property-provider" "^3.1.0" + "@smithy/protocol-http" "^4.0.0" + "@smithy/signature-v4" "^3.0.0" + "@smithy/types" "^3.0.0" + "@smithy/util-middleware" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/protocol-http@3.347.0": - version "3.347.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/protocol-http/-/protocol-http-3.347.0.tgz#9f61f4e0d892dc0a1e02211963827f386bc447b9" - integrity sha512-2YdBhc02Wvy03YjhGwUxF0UQgrPWEy8Iq75pfS42N+/0B/+eWX1aQgfjFxIpLg7YSjT5eKtYOQGlYd4MFTgj9g== +"@aws-sdk/middleware-ssec@3.577.0": + version "3.577.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-ssec/-/middleware-ssec-3.577.0.tgz#9fcd74e8bf2c277b4349c537cbeceba279166f32" + integrity sha512-i2BPJR+rp8xmRVIGc0h1kDRFcM2J9GnClqqpc+NLSjmYadlcg4mPklisz9HzwFVcRPJ5XcGf3U4BYs5G8+iTyg== dependencies: - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" + "@aws-sdk/types" "3.577.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/querystring-builder@3.347.0": - version "3.347.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/querystring-builder/-/querystring-builder-3.347.0.tgz#9a6bb16441f32fa05c25dc7e57d4692858824574" - integrity sha512-phtKTe6FXoV02MoPkIVV6owXI8Mwr5IBN3bPoxhcPvJG2AjEmnetSIrhb8kwc4oNhlwfZwH6Jo5ARW/VEWbZtg== +"@aws-sdk/middleware-user-agent@3.587.0": + version "3.587.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.587.0.tgz#2a68900cfb29afbae2952d901de4fcb91850bd3d" + integrity sha512-SyDomN+IOrygLucziG7/nOHkjUXES5oH5T7p8AboO8oakMQJdnudNXiYWTicQWO52R51U6CR27rcMPTGeMedYA== dependencies: - "@aws-sdk/types" "3.347.0" - "@aws-sdk/util-uri-escape" "3.310.0" - tslib "^2.5.0" + "@aws-sdk/types" "3.577.0" + "@aws-sdk/util-endpoints" "3.587.0" + "@smithy/protocol-http" "^4.0.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/querystring-parser@3.347.0": - version "3.347.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/querystring-parser/-/querystring-parser-3.347.0.tgz#c85213a835c0f02580e013d168d1ee2f6fee65a1" - integrity sha512-5VXOhfZz78T2W7SuXf2avfjKglx1VZgZgp9Zfhrt/Rq+MTu2D+PZc5zmJHhYigD7x83jLSLogpuInQpFMA9LgA== +"@aws-sdk/region-config-resolver@3.587.0": + version "3.587.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/region-config-resolver/-/region-config-resolver-3.587.0.tgz#ad1c15494f44dfc4c7a7bce389f8b128dace923f" + integrity sha512-93I7IPZtulZQoRK+O20IJ4a1syWwYPzoO2gc3v+/GNZflZPV3QJXuVbIm0pxBsu0n/mzKGUKqSOLPIaN098HcQ== dependencies: - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" - -"@aws-sdk/service-error-classification@3.347.0": - version "3.347.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/service-error-classification/-/service-error-classification-3.347.0.tgz#c5a242d953eae0ff0290c776d93b3f5ebd85d2e2" - integrity sha512-xZ3MqSY81Oy2gh5g0fCtooAbahqh9VhsF8vcKjVX8+XPbGC8y+kej82+MsMg4gYL8gRFB9u4hgYbNgIS6JTAvg== + "@aws-sdk/types" "3.577.0" + "@smithy/node-config-provider" "^3.1.0" + "@smithy/types" "^3.0.0" + "@smithy/util-config-provider" "^3.0.0" + "@smithy/util-middleware" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/shared-ini-file-loader@3.354.0": - version "3.354.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/shared-ini-file-loader/-/shared-ini-file-loader-3.354.0.tgz#8dc6db99e12dd39abf7a70d31205c1d718e84c7a" - integrity sha512-UL9loGEsdzpHBu/PtlwUvkl/yRdmWXkySp22jUaeeRtBhiGAnyeYhxJLIt+u+UkX7Mwz+810SaZJqA9ptOXNAg== +"@aws-sdk/signature-v4-multi-region@3.587.0": + version "3.587.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.587.0.tgz#f8bb6de9135f3fafab04b9220409cd0d0549b7d8" + integrity sha512-TR9+ZSjdXvXUz54ayHcCihhcvxI9W7102J1OK6MrLgBlPE7uRhAx42BR9L5lLJ86Xj3LuqPWf//o9d/zR9WVIg== dependencies: - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" - -"@aws-sdk/signature-v4@3.354.0": - version "3.354.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/signature-v4/-/signature-v4-3.354.0.tgz#7e0dfdea39f2f438eb2f09838c44c97a81d8c580" - integrity sha512-bDp43P5NkwwznpZqmsr78DuyqNcjtS4mriuajb8XPhFNo8DrMXUrdrKJ+5aNABW7YG8uK8PSKBpq88ado692/w== - dependencies: - "@aws-sdk/eventstream-codec" "3.347.0" - "@aws-sdk/is-array-buffer" "3.310.0" - "@aws-sdk/types" "3.347.0" - "@aws-sdk/util-hex-encoding" "3.310.0" - "@aws-sdk/util-middleware" "3.347.0" - "@aws-sdk/util-uri-escape" "3.310.0" - "@aws-sdk/util-utf8" "3.310.0" - tslib "^2.5.0" + "@aws-sdk/middleware-sdk-s3" "3.587.0" + "@aws-sdk/types" "3.577.0" + "@smithy/protocol-http" "^4.0.0" + "@smithy/signature-v4" "^3.0.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/smithy-client@3.347.0": - version "3.347.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/smithy-client/-/smithy-client-3.347.0.tgz#ec11b292917f6269eecc124dae723ac6e1203f8f" - integrity sha512-PaGTDsJLGK0sTjA6YdYQzILRlPRN3uVFyqeBUkfltXssvUzkm8z2t1lz2H4VyJLAhwnG5ZuZTNEV/2mcWrU7JQ== +"@aws-sdk/token-providers@3.587.0": + version "3.587.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/token-providers/-/token-providers-3.587.0.tgz#f9fd2ddfc554c1370f8d0f467c76a4c8cb904ae6" + integrity sha512-ULqhbnLy1hmJNRcukANBWJmum3BbjXnurLPSFXoGdV0llXYlG55SzIla2VYqdveQEEjmsBuTZdFvXAtNpmS5Zg== dependencies: - "@aws-sdk/middleware-stack" "3.347.0" - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" + "@aws-sdk/types" "3.577.0" + "@smithy/property-provider" "^3.1.0" + "@smithy/shared-ini-file-loader" "^3.1.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/token-providers@3.354.0": - version "3.354.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/token-providers/-/token-providers-3.354.0.tgz#4a653781b13cb6729e88be28cdc3e1b81c0bdfcf" - integrity sha512-KcijiySy0oIyafKQagcwgu0fo35mK+2K8pwxRU1WfXqe80Gn1qGceeWcG4iW+t/rUaxa/LVo857N0LcagxCrZA== +"@aws-sdk/types@3.577.0": + version "3.577.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/types/-/types-3.577.0.tgz#7700784d368ce386745f8c340d9d68cea4716f90" + integrity sha512-FT2JZES3wBKN/alfmhlo+3ZOq/XJ0C7QOZcDNrpKjB0kqYoKjhVKZ/Hx6ArR0czkKfHzBBEs6y40ebIHx2nSmA== dependencies: - "@aws-sdk/client-sso-oidc" "3.354.0" - "@aws-sdk/property-provider" "3.353.0" - "@aws-sdk/shared-ini-file-loader" "3.354.0" - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" -"@aws-sdk/types@3.347.0", "@aws-sdk/types@^3.222.0": +"@aws-sdk/types@^3.222.0": version "3.347.0" resolved "https://registry.yarnpkg.com/@aws-sdk/types/-/types-3.347.0.tgz#4affe91de36ef227f6375d64a6efda8d4ececd5d" integrity sha512-GkCMy79mdjU9OTIe5KT58fI/6uqdf8UmMdWqVHmFJ+UpEzOci7L/uw4sOXWo7xpPzLs6cJ7s5ouGZW4GRPmHFA== dependencies: tslib "^2.5.0" -"@aws-sdk/url-parser@3.347.0": - version "3.347.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/url-parser/-/url-parser-3.347.0.tgz#b3c31fc9ffb1ac5586ab088f9b109386e6b4c7a8" - integrity sha512-lhrnVjxdV7hl+yCnJfDZOaVLSqKjxN20MIOiijRiqaWGLGEAiSqBreMhL89X1WKCifxAs4zZf9YB9SbdziRpAA== - dependencies: - "@aws-sdk/querystring-parser" "3.347.0" - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" - -"@aws-sdk/util-base64@3.310.0": - version "3.310.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-base64/-/util-base64-3.310.0.tgz#d0fd49aff358c5a6e771d0001c63b1f97acbe34c" - integrity sha512-v3+HBKQvqgdzcbL+pFswlx5HQsd9L6ZTlyPVL2LS9nNXnCcR3XgGz9jRskikRUuUvUXtkSG1J88GAOnJ/apTPg== - dependencies: - "@aws-sdk/util-buffer-from" "3.310.0" - tslib "^2.5.0" - -"@aws-sdk/util-body-length-browser@3.310.0": - version "3.310.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-body-length-browser/-/util-body-length-browser-3.310.0.tgz#3fca9d2f73c058edf1907e4a1d99a392fdd23eca" - integrity sha512-sxsC3lPBGfpHtNTUoGXMQXLwjmR0zVpx0rSvzTPAuoVILVsp5AU/w5FphNPxD5OVIjNbZv9KsKTuvNTiZjDp9g== - dependencies: - tslib "^2.5.0" - -"@aws-sdk/util-body-length-node@3.310.0": - version "3.310.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-body-length-node/-/util-body-length-node-3.310.0.tgz#4846ae72834ab0636f29f89fc1878520f6543fed" - integrity sha512-2tqGXdyKhyA6w4zz7UPoS8Ip+7sayOg9BwHNidiGm2ikbDxm1YrCfYXvCBdwaJxa4hJfRVz+aL9e+d3GqPI9pQ== +"@aws-sdk/util-arn-parser@3.568.0": + version "3.568.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-arn-parser/-/util-arn-parser-3.568.0.tgz#6a19a8c6bbaa520b6be1c278b2b8c17875b91527" + integrity sha512-XUKJWWo+KOB7fbnPP0+g/o5Ulku/X53t7i/h+sPHr5xxYTJJ9CYnbToo95mzxe7xWvkLrsNtJ8L+MnNn9INs2w== dependencies: - tslib "^2.5.0" - -"@aws-sdk/util-buffer-from@3.310.0": - version "3.310.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-buffer-from/-/util-buffer-from-3.310.0.tgz#7a72cb965984d3c6a7e256ae6cf1621f52e54a57" - integrity sha512-i6LVeXFtGih5Zs8enLrt+ExXY92QV25jtEnTKHsmlFqFAuL3VBeod6boeMXkN2p9lbSVVQ1sAOOYZOHYbYkntw== - dependencies: - "@aws-sdk/is-array-buffer" "3.310.0" - tslib "^2.5.0" - -"@aws-sdk/util-config-provider@3.310.0": - version "3.310.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-config-provider/-/util-config-provider-3.310.0.tgz#ff21f73d4774cfd7bd16ae56f905828600dda95f" - integrity sha512-xIBaYo8dwiojCw8vnUcIL4Z5tyfb1v3yjqyJKJWV/dqKUFOOS0U591plmXbM+M/QkXyML3ypon1f8+BoaDExrg== - dependencies: - tslib "^2.5.0" - -"@aws-sdk/util-defaults-mode-browser@3.353.0": - version "3.353.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-defaults-mode-browser/-/util-defaults-mode-browser-3.353.0.tgz#b90b8b354bfb582a9cc7b87b67ce1508d57176ea" - integrity sha512-ushvOQKJIH7S6E//xMDPyf2/Bbu0K2A0GJRB88qQV6VKRBo4PEbeHTb6BbzPhYVX0IbY3uR/X7+Xwk4FeEkMWg== - dependencies: - "@aws-sdk/property-provider" "3.353.0" - "@aws-sdk/types" "3.347.0" - bowser "^2.11.0" - tslib "^2.5.0" - -"@aws-sdk/util-defaults-mode-node@3.354.0": - version "3.354.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-defaults-mode-node/-/util-defaults-mode-node-3.354.0.tgz#55949d8ee4403b6c54dc3d7dc732f0eeb081c5cd" - integrity sha512-CaaRVBdOYX4wZadj+CDUxpO+4RjyYJcSv71A60jV6CZ/ya1+oYfmPbG5QZ4AlV6crdev2B+aUoR2LPIYqn/GnQ== - dependencies: - "@aws-sdk/config-resolver" "3.354.0" - "@aws-sdk/credential-provider-imds" "3.354.0" - "@aws-sdk/node-config-provider" "3.354.0" - "@aws-sdk/property-provider" "3.353.0" - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" + tslib "^2.6.2" -"@aws-sdk/util-endpoints@3.352.0": - version "3.352.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-endpoints/-/util-endpoints-3.352.0.tgz#89c10e00a257f88fb72c4d3b362fbfbeb00513cf" - integrity sha512-PjWMPdoIUWfBPgAWLyOrWFbdSS/3DJtc0OmFb/JrE8C8rKFYl+VGW5f1p0cVdRWiDR0xCGr0s67p8itAakVqjw== +"@aws-sdk/util-endpoints@3.587.0": + version "3.587.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-endpoints/-/util-endpoints-3.587.0.tgz#781e0822a95dba15f7ac8f22a6f6d7f0c8819818" + integrity sha512-8I1HG6Em8wQWqKcRW6m358mqebRVNpL8XrrEoT4In7xqkKkmYtHRNVYP6lcmiQh5pZ/c/FXu8dSchuFIWyEtqQ== dependencies: - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" - -"@aws-sdk/util-hex-encoding@3.310.0": - version "3.310.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-hex-encoding/-/util-hex-encoding-3.310.0.tgz#19294c78986c90ae33f04491487863dc1d33bd87" - integrity sha512-sVN7mcCCDSJ67pI1ZMtk84SKGqyix6/0A1Ab163YKn+lFBQRMKexleZzpYzNGxYzmQS6VanP/cfU7NiLQOaSfA== - dependencies: - tslib "^2.5.0" + "@aws-sdk/types" "3.577.0" + "@smithy/types" "^3.0.0" + "@smithy/util-endpoints" "^2.0.1" + tslib "^2.6.2" "@aws-sdk/util-locate-window@^3.0.0": version "3.310.0" @@ -732,45 +692,25 @@ dependencies: tslib "^2.5.0" -"@aws-sdk/util-middleware@3.347.0": - version "3.347.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-middleware/-/util-middleware-3.347.0.tgz#464b2e416486776fa39c926e7f04c2a0d822e8b5" - integrity sha512-8owqUA3ePufeYTUvlzdJ7Z0miLorTwx+rNol5lourGQZ9JXsVMo23+yGA7nOlFuXSGkoKpMOtn6S0BT2bcfeiw== +"@aws-sdk/util-user-agent-browser@3.577.0": + version "3.577.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.577.0.tgz#d4d2cdb3a2b3d1c8b35f239ee9f7b2c87bee66ea" + integrity sha512-zEAzHgR6HWpZOH7xFgeJLc6/CzMcx4nxeQolZxVZoB5pPaJd3CjyRhZN0xXeZB0XIRCWmb4yJBgyiugXLNMkLA== dependencies: - tslib "^2.5.0" - -"@aws-sdk/util-retry@3.347.0": - version "3.347.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-retry/-/util-retry-3.347.0.tgz#9a24ebcd6c34888eee0ffb81c1529ea51a5cdecc" - integrity sha512-NxnQA0/FHFxriQAeEgBonA43Q9/VPFQa8cfJDuT2A1YZruMasgjcltoZszi1dvoIRWSZsFTW42eY2gdOd0nffQ== - dependencies: - "@aws-sdk/service-error-classification" "3.347.0" - tslib "^2.5.0" - -"@aws-sdk/util-uri-escape@3.310.0": - version "3.310.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-uri-escape/-/util-uri-escape-3.310.0.tgz#9f942f09a715d8278875013a416295746b6085ba" - integrity sha512-drzt+aB2qo2LgtDoiy/3sVG8w63cgLkqFIa2NFlGpUgHFWTXkqtbgf4L5QdjRGKWhmZsnqkbtL7vkSWEcYDJ4Q== - dependencies: - tslib "^2.5.0" - -"@aws-sdk/util-user-agent-browser@3.347.0": - version "3.347.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.347.0.tgz#90bedd2031561b9d45aef54991eeca49ec8d950b" - integrity sha512-ydxtsKVtQefgbk1Dku1q7pMkjDYThauG9/8mQkZUAVik55OUZw71Zzr3XO8J8RKvQG8lmhPXuAQ0FKAyycc0RA== - dependencies: - "@aws-sdk/types" "3.347.0" + "@aws-sdk/types" "3.577.0" + "@smithy/types" "^3.0.0" bowser "^2.11.0" - tslib "^2.5.0" + tslib "^2.6.2" -"@aws-sdk/util-user-agent-node@3.354.0": - version "3.354.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.354.0.tgz#153d5748d707a42c765c353769e4d41cbf27215d" - integrity sha512-2xkblZS3PGxxh//0lgCwJw2gvh9ZBcI9H9xv05YP7hcwlz9BmkAlbei2i6Uew6agJMLO4unfgWoBTpzp3WLaKg== +"@aws-sdk/util-user-agent-node@3.587.0": + version "3.587.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.587.0.tgz#a6bf422f307a68e16a6c19ee5d731fcc32696fb9" + integrity sha512-Pnl+DUe/bvnbEEDHP3iVJrOtE3HbFJBPgsD6vJ+ml/+IYk1Eq49jEG+EHZdNTPz3SDG0kbp2+7u41MKYJHR/iQ== dependencies: - "@aws-sdk/node-config-provider" "3.354.0" - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" + "@aws-sdk/types" "3.577.0" + "@smithy/node-config-provider" "^3.1.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" "@aws-sdk/util-utf8-browser@^3.0.0": version "3.259.0" @@ -779,22 +719,13 @@ dependencies: tslib "^2.3.1" -"@aws-sdk/util-utf8@3.310.0": - version "3.310.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-utf8/-/util-utf8-3.310.0.tgz#4a7b9dcebb88e830d3811aeb21e9a6df4273afb4" - integrity sha512-DnLfFT8uCO22uOJc0pt0DsSNau1GTisngBCDw8jQuWT5CqogMJu4b/uXmwEqfj8B3GX6Xsz8zOd6JpRlPftQoA== +"@aws-sdk/xml-builder@3.575.0": + version "3.575.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/xml-builder/-/xml-builder-3.575.0.tgz#233b2aae422dd789a078073032da1bc60317aa1d" + integrity sha512-cWgAwmbFYNCFzPwxL705+lWps0F3ZvOckufd2KKoEZUmtpVw9/txUXNrPySUXSmRTSRhoatIMABNfStWR043bQ== dependencies: - "@aws-sdk/util-buffer-from" "3.310.0" - tslib "^2.5.0" - -"@aws-sdk/util-waiter@3.347.0": - version "3.347.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-waiter/-/util-waiter-3.347.0.tgz#c1edc4467198ce2dfce1e17e917e1cb7e2e41bbe" - integrity sha512-3ze/0PkwkzUzLncukx93tZgGL0JX9NaP8DxTi6WzflnL/TEul5Z63PCruRNK0om17iZYAWKrf8q2mFoHYb4grA== - dependencies: - "@aws-sdk/abort-controller" "3.347.0" - "@aws-sdk/types" "3.347.0" - tslib "^2.5.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.18.6", "@babel/code-frame@^7.22.13", "@babel/code-frame@^7.23.5", "@babel/code-frame@^7.5.5", "@babel/code-frame@^7.8.3": version "7.23.5" @@ -6671,20 +6602,469 @@ dependencies: "@sinonjs/commons" "^2.0.0" -"@smithy/protocol-http@^1.0.1": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@smithy/protocol-http/-/protocol-http-1.1.0.tgz#caf22e01cb825d7490a4915e03d6fa64954ff535" - integrity sha512-H5y/kZOqfJSqRkwtcAoVbqONmhdXwSgYNJ1Glk5Ry8qlhVVy5qUzD9EklaCH8/XLnoCsLO/F/Giee8MIvaBRkg== +"@smithy/abort-controller@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/abort-controller/-/abort-controller-3.0.0.tgz#5815f5d4618e14bf8d031bb98a99adabbb831168" + integrity sha512-p6GlFGBt9K4MYLu72YuJ523NVR4A8oHlC5M2JO6OmQqN8kAc/uh1JqLE+FizTokrSJGg0CSvC+BrsmGzKtsZKA== dependencies: - "@smithy/types" "^1.1.0" - tslib "^2.5.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" -"@smithy/types@^1.0.0", "@smithy/types@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@smithy/types/-/types-1.1.0.tgz#f30a23202c97634cca5c1ac955a9bf149c955226" - integrity sha512-KzmvisMmuwD2jZXuC9e65JrgsZM97y5NpDU7g347oB+Q+xQLU6hQZ5zFNNbEfwwOJHoOvEVTna+dk1h/lW7alw== +"@smithy/chunked-blob-reader-native@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/chunked-blob-reader-native/-/chunked-blob-reader-native-3.0.0.tgz#f1104b30030f76f9aadcbd3cdca4377bd1ba2695" + integrity sha512-VDkpCYW+peSuM4zJip5WDfqvg2Mo/e8yxOv3VF1m11y7B8KKMKVFtmZWDe36Fvk8rGuWrPZHHXZ7rR7uM5yWyg== dependencies: - tslib "^2.5.0" + "@smithy/util-base64" "^3.0.0" + tslib "^2.6.2" + +"@smithy/chunked-blob-reader@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/chunked-blob-reader/-/chunked-blob-reader-3.0.0.tgz#e5d3b04e9b273ba8b7ede47461e2aa96c8aa49e0" + integrity sha512-sbnURCwjF0gSToGlsBiAmd1lRCmSn72nu9axfJu5lIx6RUEgHu6GwTMbqCdhQSi0Pumcm5vFxsi9XWXb2mTaoA== + dependencies: + tslib "^2.6.2" + +"@smithy/config-resolver@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@smithy/config-resolver/-/config-resolver-3.0.1.tgz#4e0917e5a02139ef978a1ed470543ab41dd3626b" + integrity sha512-hbkYJc20SBDz2qqLzttjI/EqXemtmWk0ooRznLsiXp3066KQRTvuKHa7U4jCZCJq6Dozqvy0R1/vNESC9inPJg== + dependencies: + "@smithy/node-config-provider" "^3.1.0" + "@smithy/types" "^3.0.0" + "@smithy/util-config-provider" "^3.0.0" + "@smithy/util-middleware" "^3.0.0" + tslib "^2.6.2" + +"@smithy/core@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@smithy/core/-/core-2.2.0.tgz#f1b0837b7afa5507a9693c1e93da6ca9808022c1" + integrity sha512-ygLZSSKgt9bR8HAxR9mK+U5obvAJBr6zlQuhN5soYWx/amjDoQN4dTkydTypgKe6rIbUjTILyLU+W5XFwXr4kg== + dependencies: + "@smithy/middleware-endpoint" "^3.0.1" + "@smithy/middleware-retry" "^3.0.3" + "@smithy/middleware-serde" "^3.0.0" + "@smithy/protocol-http" "^4.0.0" + "@smithy/smithy-client" "^3.1.1" + "@smithy/types" "^3.0.0" + "@smithy/util-middleware" "^3.0.0" + tslib "^2.6.2" + +"@smithy/credential-provider-imds@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@smithy/credential-provider-imds/-/credential-provider-imds-3.1.0.tgz#7e58b78aa8de13dd04e94829241cd1cbde59b6d3" + integrity sha512-q4A4d38v8pYYmseu/jTS3Z5I3zXlEOe5Obi+EJreVKgSVyWUHOd7/yaVCinC60QG4MRyCs98tcxBH1IMC0bu7Q== + dependencies: + "@smithy/node-config-provider" "^3.1.0" + "@smithy/property-provider" "^3.1.0" + "@smithy/types" "^3.0.0" + "@smithy/url-parser" "^3.0.0" + tslib "^2.6.2" + +"@smithy/eventstream-codec@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/eventstream-codec/-/eventstream-codec-3.0.0.tgz#81d30391220f73d41f432f65384b606d67673e46" + integrity sha512-PUtyEA0Oik50SaEFCZ0WPVtF9tz/teze2fDptW6WRXl+RrEenH8UbEjudOz8iakiMl3lE3lCVqYf2Y+znL8QFQ== + dependencies: + "@aws-crypto/crc32" "3.0.0" + "@smithy/types" "^3.0.0" + "@smithy/util-hex-encoding" "^3.0.0" + tslib "^2.6.2" + +"@smithy/eventstream-serde-browser@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/eventstream-serde-browser/-/eventstream-serde-browser-3.0.0.tgz#94721b01f01d8b7eb1db5814275a774ed4d38190" + integrity sha512-NB7AFiPN4NxP/YCAnrvYR18z2/ZsiHiF7VtG30gshO9GbFrIb1rC8ep4NGpJSWrz6P64uhPXeo4M0UsCLnZKqw== + dependencies: + "@smithy/eventstream-serde-universal" "^3.0.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" + +"@smithy/eventstream-serde-config-resolver@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/eventstream-serde-config-resolver/-/eventstream-serde-config-resolver-3.0.0.tgz#420447d1d284d41f7f070a5d92fc3686cc922581" + integrity sha512-RUQG3vQ3LX7peqqHAbmayhgrF5aTilPnazinaSGF1P0+tgM3vvIRWPHmlLIz2qFqB9LqFIxditxc8O2Z6psrRw== + dependencies: + "@smithy/types" "^3.0.0" + tslib "^2.6.2" + +"@smithy/eventstream-serde-node@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/eventstream-serde-node/-/eventstream-serde-node-3.0.0.tgz#6519523fbb429307be29b151b8ba35bcca2b6e64" + integrity sha512-baRPdMBDMBExZXIUAoPGm/hntixjt/VFpU6+VmCyiYJYzRHRxoaI1MN+5XE+hIS8AJ2GCHLMFEIOLzq9xx1EgQ== + dependencies: + "@smithy/eventstream-serde-universal" "^3.0.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" + +"@smithy/eventstream-serde-universal@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/eventstream-serde-universal/-/eventstream-serde-universal-3.0.0.tgz#cb8441a73fbde4cbaa68e4a21236f658d914a073" + integrity sha512-HNFfShmotWGeAoW4ujP8meV9BZavcpmerDbPIjkJbxKbN8RsUcpRQ/2OyIxWNxXNH2GWCAxuSB7ynmIGJlQ3Dw== + dependencies: + "@smithy/eventstream-codec" "^3.0.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" + +"@smithy/fetch-http-handler@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@smithy/fetch-http-handler/-/fetch-http-handler-3.0.1.tgz#dacfdf6e70d639fac4a0f57c42ce13f0ed14ff22" + integrity sha512-uaH74i5BDj+rBwoQaXioKpI0SHBJFtOVwzrCpxZxphOW0ki5jhj7dXvDMYM2IJem8TpdFvS2iC08sjOblfFGFg== + dependencies: + "@smithy/protocol-http" "^4.0.0" + "@smithy/querystring-builder" "^3.0.0" + "@smithy/types" "^3.0.0" + "@smithy/util-base64" "^3.0.0" + tslib "^2.6.2" + +"@smithy/hash-blob-browser@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/hash-blob-browser/-/hash-blob-browser-3.0.0.tgz#63ef4c98f74c53cbcad8ec73387c68ec4708f55b" + integrity sha512-/Wbpdg+bwJvW7lxR/zpWAc1/x/YkcqguuF2bAzkJrvXriZu1vm8r+PUdE4syiVwQg7PPR2dXpi3CLBb9qRDaVQ== + dependencies: + "@smithy/chunked-blob-reader" "^3.0.0" + "@smithy/chunked-blob-reader-native" "^3.0.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" + +"@smithy/hash-node@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/hash-node/-/hash-node-3.0.0.tgz#f44b5fff193e241c1cdcc957b296b60f186f0e59" + integrity sha512-84qXstNemP3XS5jcof0el6+bDfjzuvhJPQTEfro3lgtbCtKgzPm3MgiS6ehXVPjeQ5+JS0HqmTz8f/RYfzHVxw== + dependencies: + "@smithy/types" "^3.0.0" + "@smithy/util-buffer-from" "^3.0.0" + "@smithy/util-utf8" "^3.0.0" + tslib "^2.6.2" + +"@smithy/hash-stream-node@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/hash-stream-node/-/hash-stream-node-3.0.0.tgz#b395a8a0d2427e4a8effc56135b37cb299339f8f" + integrity sha512-J0i7de+EgXDEGITD4fxzmMX8CyCNETTIRXlxjMiNUvvu76Xn3GJ31wQR85ynlPk2wI1lqoknAFJaD1fiNDlbIA== + dependencies: + "@smithy/types" "^3.0.0" + "@smithy/util-utf8" "^3.0.0" + tslib "^2.6.2" + +"@smithy/invalid-dependency@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/invalid-dependency/-/invalid-dependency-3.0.0.tgz#21cb6b5203ee15321bfcc751f21f7a19536d4ae8" + integrity sha512-F6wBBaEFgJzj0s4KUlliIGPmqXemwP6EavgvDqYwCH40O5Xr2iMHvS8todmGVZtuJCorBkXsYLyTu4PuizVq5g== + dependencies: + "@smithy/types" "^3.0.0" + tslib "^2.6.2" + +"@smithy/is-array-buffer@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz#9a95c2d46b8768946a9eec7f935feaddcffa5e7a" + integrity sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ== + dependencies: + tslib "^2.6.2" + +"@smithy/md5-js@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/md5-js/-/md5-js-3.0.0.tgz#6a2d1c496f4d4476a0fc84f7724d79b234c3eb13" + integrity sha512-Tm0vrrVzjlD+6RCQTx7D3Ls58S3FUH1ZCtU1MIh/qQmaOo1H9lMN2as6CikcEwgattnA9SURSdoJJ27xMcEfMA== + dependencies: + "@smithy/types" "^3.0.0" + "@smithy/util-utf8" "^3.0.0" + tslib "^2.6.2" + +"@smithy/middleware-content-length@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/middleware-content-length/-/middleware-content-length-3.0.0.tgz#084b3d22248967885d496eb0b105d9090e8ababd" + integrity sha512-3C4s4d/iGobgCtk2tnWW6+zSTOBg1PRAm2vtWZLdriwTroFbbWNSr3lcyzHdrQHnEXYCC5K52EbpfodaIUY8sg== + dependencies: + "@smithy/protocol-http" "^4.0.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" + +"@smithy/middleware-endpoint@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@smithy/middleware-endpoint/-/middleware-endpoint-3.0.1.tgz#49e8defb8e892e70417bd05f1faaf207070f32c7" + integrity sha512-lQ/UOdGD4KM5kLZiAl0q8Qy3dPbynvAXKAdXnYlrA1OpaUwr+neSsVokDZpY6ZVb5Yx8jnus29uv6XWpM9P4SQ== + dependencies: + "@smithy/middleware-serde" "^3.0.0" + "@smithy/node-config-provider" "^3.1.0" + "@smithy/shared-ini-file-loader" "^3.1.0" + "@smithy/types" "^3.0.0" + "@smithy/url-parser" "^3.0.0" + "@smithy/util-middleware" "^3.0.0" + tslib "^2.6.2" + +"@smithy/middleware-retry@^3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@smithy/middleware-retry/-/middleware-retry-3.0.3.tgz#8e9af1c9db4bc8904d73126225211b42b562f961" + integrity sha512-Wve1qzJb83VEU/6q+/I0cQdAkDnuzELC6IvIBwDzUEiGpKqXgX1v10FUuZGbRS6Ov/P+HHthcAoHOJZQvZNAkA== + dependencies: + "@smithy/node-config-provider" "^3.1.0" + "@smithy/protocol-http" "^4.0.0" + "@smithy/service-error-classification" "^3.0.0" + "@smithy/smithy-client" "^3.1.1" + "@smithy/types" "^3.0.0" + "@smithy/util-middleware" "^3.0.0" + "@smithy/util-retry" "^3.0.0" + tslib "^2.6.2" + uuid "^9.0.1" + +"@smithy/middleware-serde@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/middleware-serde/-/middleware-serde-3.0.0.tgz#786da6a6bc0e5e51d669dac834c19965245dd302" + integrity sha512-I1vKG1foI+oPgG9r7IMY1S+xBnmAn1ISqployvqkwHoSb8VPsngHDTOgYGYBonuOKndaWRUGJZrKYYLB+Ane6w== + dependencies: + "@smithy/types" "^3.0.0" + tslib "^2.6.2" + +"@smithy/middleware-stack@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/middleware-stack/-/middleware-stack-3.0.0.tgz#00f112bae7af5fc3bd37d4fab95ebce0f17a7774" + integrity sha512-+H0jmyfAyHRFXm6wunskuNAqtj7yfmwFB6Fp37enytp2q047/Od9xetEaUbluyImOlGnGpaVGaVfjwawSr+i6Q== + dependencies: + "@smithy/types" "^3.0.0" + tslib "^2.6.2" + +"@smithy/node-config-provider@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@smithy/node-config-provider/-/node-config-provider-3.1.0.tgz#e962987c4e2e2b8b50397de5f4745eb21ee7bdbb" + integrity sha512-ngfB8QItUfTFTfHMvKuc2g1W60V1urIgZHqD1JNFZC2tTWXahqf2XvKXqcBS7yZqR7GqkQQZy11y/lNOUWzq7Q== + dependencies: + "@smithy/property-provider" "^3.1.0" + "@smithy/shared-ini-file-loader" "^3.1.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" + +"@smithy/node-http-handler@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/node-http-handler/-/node-http-handler-3.0.0.tgz#e771ea95d03e259f04b7b37e8aece8a4fffc8cdc" + integrity sha512-3trD4r7NOMygwLbUJo4eodyQuypAWr7uvPnebNJ9a70dQhVn+US8j/lCnvoJS6BXfZeF7PkkkI0DemVJw+n+eQ== + dependencies: + "@smithy/abort-controller" "^3.0.0" + "@smithy/protocol-http" "^4.0.0" + "@smithy/querystring-builder" "^3.0.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" + +"@smithy/property-provider@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@smithy/property-provider/-/property-provider-3.1.0.tgz#b78d4964a1016b90331cc0c770b472160361fde7" + integrity sha512-Tj3+oVhqdZgemjCiWjFlADfhvLF4C/uKDuKo7/tlEsRQ9+3emCreR2xndj970QSRSsiCEU8hZW3/8JQu+n5w4Q== + dependencies: + "@smithy/types" "^3.0.0" + tslib "^2.6.2" + +"@smithy/protocol-http@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@smithy/protocol-http/-/protocol-http-4.0.0.tgz#04df3b5674b540323f678e7c4113e8abd8b26432" + integrity sha512-qOQZOEI2XLWRWBO9AgIYuHuqjZ2csyr8/IlgFDHDNuIgLAMRx2Bl8ck5U5D6Vh9DPdoaVpuzwWMa0xcdL4O/AQ== + dependencies: + "@smithy/types" "^3.0.0" + tslib "^2.6.2" + +"@smithy/querystring-builder@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/querystring-builder/-/querystring-builder-3.0.0.tgz#48a9aa7b700e8409368c21bc0adf7564e001daea" + integrity sha512-bW8Fi0NzyfkE0TmQphDXr1AmBDbK01cA4C1Z7ggwMAU5RDz5AAv/KmoRwzQAS0kxXNf/D2ALTEgwK0U2c4LtRg== + dependencies: + "@smithy/types" "^3.0.0" + "@smithy/util-uri-escape" "^3.0.0" + tslib "^2.6.2" + +"@smithy/querystring-parser@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/querystring-parser/-/querystring-parser-3.0.0.tgz#fa1ed0cee408cd4d622070fa874bc50ac1a379b7" + integrity sha512-UzHwthk0UEccV4dHzPySnBy34AWw3V9lIqUTxmozQ+wPDAO9csCWMfOLe7V9A2agNYy7xE+Pb0S6K/J23JSzfQ== + dependencies: + "@smithy/types" "^3.0.0" + tslib "^2.6.2" + +"@smithy/service-error-classification@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/service-error-classification/-/service-error-classification-3.0.0.tgz#06a45cb91b15b8b0d5f3b1df2b3743d2ca42f5c4" + integrity sha512-3BsBtOUt2Gsnc3X23ew+r2M71WwtpHfEDGhHYHSDg6q1t8FrWh15jT25DLajFV1H+PpxAJ6gqe9yYeRUsmSdFA== + dependencies: + "@smithy/types" "^3.0.0" + +"@smithy/shared-ini-file-loader@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-3.1.0.tgz#a4cb9304c3be1c232ec661132ca88d177ac7a5b1" + integrity sha512-dAM7wSX0NR3qTNyGVN/nwwpEDzfV9T/3AN2eABExWmda5VqZKSsjlINqomO5hjQWGv+IIkoXfs3u2vGSNz8+Rg== + dependencies: + "@smithy/types" "^3.0.0" + tslib "^2.6.2" + +"@smithy/signature-v4@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/signature-v4/-/signature-v4-3.0.0.tgz#f536d0abebfeeca8e9aab846a4042658ca07d3b7" + integrity sha512-kXFOkNX+BQHe2qnLxpMEaCRGap9J6tUGLzc3A9jdn+nD4JdMwCKTJ+zFwQ20GkY+mAXGatyTw3HcoUlR39HwmA== + dependencies: + "@smithy/is-array-buffer" "^3.0.0" + "@smithy/types" "^3.0.0" + "@smithy/util-hex-encoding" "^3.0.0" + "@smithy/util-middleware" "^3.0.0" + "@smithy/util-uri-escape" "^3.0.0" + "@smithy/util-utf8" "^3.0.0" + tslib "^2.6.2" + +"@smithy/smithy-client@^3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@smithy/smithy-client/-/smithy-client-3.1.1.tgz#9aa770edd9b6277dc4124c924c617a436cdb670e" + integrity sha512-tj4Ku7MpzZR8cmVuPcSbrLFVxmptWktmJMwST/uIEq4sarabEdF8CbmQdYB7uJ/X51Qq2EYwnRsoS7hdR4B7rA== + dependencies: + "@smithy/middleware-endpoint" "^3.0.1" + "@smithy/middleware-stack" "^3.0.0" + "@smithy/protocol-http" "^4.0.0" + "@smithy/types" "^3.0.0" + "@smithy/util-stream" "^3.0.1" + tslib "^2.6.2" + +"@smithy/types@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/types/-/types-3.0.0.tgz#00231052945159c64ffd8b91e8909d8d3006cb7e" + integrity sha512-VvWuQk2RKFuOr98gFhjca7fkBS+xLLURT8bUjk5XQoV0ZLm7WPwWPPY3/AwzTLuUBDeoKDCthfe1AsTUWaSEhw== + dependencies: + tslib "^2.6.2" + +"@smithy/url-parser@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/url-parser/-/url-parser-3.0.0.tgz#5fdc77cd22051c1aac6531be0315bfcba0fa705d" + integrity sha512-2XLazFgUu+YOGHtWihB3FSLAfCUajVfNBXGGYjOaVKjLAuAxx3pSBY3hBgLzIgB17haf59gOG3imKqTy8mcrjw== + dependencies: + "@smithy/querystring-parser" "^3.0.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" + +"@smithy/util-base64@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/util-base64/-/util-base64-3.0.0.tgz#f7a9a82adf34e27a72d0719395713edf0e493017" + integrity sha512-Kxvoh5Qtt0CDsfajiZOCpJxgtPHXOKwmM+Zy4waD43UoEMA+qPxxa98aE/7ZhdnBFZFXMOiBR5xbcaMhLtznQQ== + dependencies: + "@smithy/util-buffer-from" "^3.0.0" + "@smithy/util-utf8" "^3.0.0" + tslib "^2.6.2" + +"@smithy/util-body-length-browser@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/util-body-length-browser/-/util-body-length-browser-3.0.0.tgz#86ec2f6256310b4845a2f064e2f571c1ca164ded" + integrity sha512-cbjJs2A1mLYmqmyVl80uoLTJhAcfzMOyPgjwAYusWKMdLeNtzmMz9YxNl3/jRLoxSS3wkqkf0jwNdtXWtyEBaQ== + dependencies: + tslib "^2.6.2" + +"@smithy/util-body-length-node@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/util-body-length-node/-/util-body-length-node-3.0.0.tgz#99a291bae40d8932166907fe981d6a1f54298a6d" + integrity sha512-Tj7pZ4bUloNUP6PzwhN7K386tmSmEET9QtQg0TgdNOnxhZvCssHji+oZTUIuzxECRfG8rdm2PMw2WCFs6eIYkA== + dependencies: + tslib "^2.6.2" + +"@smithy/util-buffer-from@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz#559fc1c86138a89b2edaefc1e6677780c24594e3" + integrity sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA== + dependencies: + "@smithy/is-array-buffer" "^3.0.0" + tslib "^2.6.2" + +"@smithy/util-config-provider@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/util-config-provider/-/util-config-provider-3.0.0.tgz#62c6b73b22a430e84888a8f8da4b6029dd5b8efe" + integrity sha512-pbjk4s0fwq3Di/ANL+rCvJMKM5bzAQdE5S/6RL5NXgMExFAi6UgQMPOm5yPaIWPpr+EOXKXRonJ3FoxKf4mCJQ== + dependencies: + tslib "^2.6.2" + +"@smithy/util-defaults-mode-browser@^3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-3.0.3.tgz#6fff11a6c407ca1d5a1dc009768bd09271b199c2" + integrity sha512-3DFON2bvXJAukJe+qFgPV/rorG7ZD3m4gjCXHD1V5z/tgKQp5MCTCLntrd686tX6tj8Uli3lefWXJudNg5WmCA== + dependencies: + "@smithy/property-provider" "^3.1.0" + "@smithy/smithy-client" "^3.1.1" + "@smithy/types" "^3.0.0" + bowser "^2.11.0" + tslib "^2.6.2" + +"@smithy/util-defaults-mode-node@^3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-3.0.3.tgz#0b52ba9cb1138ee9076feba9a733462b2e2e6093" + integrity sha512-D0b8GJXecT00baoSQ3Iieu3k3mZ7GY8w1zmg8pdogYrGvWJeLcIclqk2gbkG4K0DaBGWrO6v6r20iwIFfDYrmA== + dependencies: + "@smithy/config-resolver" "^3.0.1" + "@smithy/credential-provider-imds" "^3.1.0" + "@smithy/node-config-provider" "^3.1.0" + "@smithy/property-provider" "^3.1.0" + "@smithy/smithy-client" "^3.1.1" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" + +"@smithy/util-endpoints@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@smithy/util-endpoints/-/util-endpoints-2.0.1.tgz#4ea8069bfbf3ebbcbe106b5156ff59a7a627b7dd" + integrity sha512-ZRT0VCOnKlVohfoABMc8lWeQo/JEFuPWctfNRXgTHbyOVssMOLYFUNWukxxiHRGVAhV+n3c0kPW+zUqckjVPEA== + dependencies: + "@smithy/node-config-provider" "^3.1.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" + +"@smithy/util-hex-encoding@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/util-hex-encoding/-/util-hex-encoding-3.0.0.tgz#32938b33d5bf2a15796cd3f178a55b4155c535e6" + integrity sha512-eFndh1WEK5YMUYvy3lPlVmYY/fZcQE1D8oSf41Id2vCeIkKJXPcYDCZD+4+xViI6b1XSd7tE+s5AmXzz5ilabQ== + dependencies: + tslib "^2.6.2" + +"@smithy/util-middleware@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/util-middleware/-/util-middleware-3.0.0.tgz#64d775628b99a495ca83ce982f5c83aa45f1e894" + integrity sha512-q5ITdOnV2pXHSVDnKWrwgSNTDBAMHLptFE07ua/5Ty5WJ11bvr0vk2a7agu7qRhrCFRQlno5u3CneU5EELK+DQ== + dependencies: + "@smithy/types" "^3.0.0" + tslib "^2.6.2" + +"@smithy/util-retry@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/util-retry/-/util-retry-3.0.0.tgz#8a0c47496aab74e1dfde4905d462ad636a8824bb" + integrity sha512-nK99bvJiziGv/UOKJlDvFF45F00WgPLKVIGUfAK+mDhzVN2hb/S33uW2Tlhg5PVBoqY7tDVqL0zmu4OxAHgo9g== + dependencies: + "@smithy/service-error-classification" "^3.0.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" + +"@smithy/util-stream@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@smithy/util-stream/-/util-stream-3.0.1.tgz#3cf527bcd3fec82c231c38d47dd75f3364747edb" + integrity sha512-7F7VNNhAsfMRA8I986YdOY5fE0/T1/ZjFF6OLsqkvQVNP3vZ/szYDfGCyphb7ioA09r32K/0qbSFfNFU68aSzA== + dependencies: + "@smithy/fetch-http-handler" "^3.0.1" + "@smithy/node-http-handler" "^3.0.0" + "@smithy/types" "^3.0.0" + "@smithy/util-base64" "^3.0.0" + "@smithy/util-buffer-from" "^3.0.0" + "@smithy/util-hex-encoding" "^3.0.0" + "@smithy/util-utf8" "^3.0.0" + tslib "^2.6.2" + +"@smithy/util-uri-escape@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/util-uri-escape/-/util-uri-escape-3.0.0.tgz#e43358a78bf45d50bb736770077f0f09195b6f54" + integrity sha512-LqR7qYLgZTD7nWLBecUi4aqolw8Mhza9ArpNEQ881MJJIU2sE5iHCK6TdyqqzcDLy0OPe10IY4T8ctVdtynubg== + dependencies: + tslib "^2.6.2" + +"@smithy/util-utf8@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/util-utf8/-/util-utf8-3.0.0.tgz#1a6a823d47cbec1fd6933e5fc87df975286d9d6a" + integrity sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA== + dependencies: + "@smithy/util-buffer-from" "^3.0.0" + tslib "^2.6.2" + +"@smithy/util-waiter@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@smithy/util-waiter/-/util-waiter-3.0.0.tgz#26bcc5bbbf1de9360a7aeb3b3919926fc6afa2bc" + integrity sha512-+fEXJxGDLCoqRKVSmo0auGxaqbiCo+8oph+4auefYjaNxjOLKSY2MxVQfRzo65PaZv4fr+5lWg+au7vSuJJ/zw== + dependencies: + "@smithy/abort-controller" "^3.0.0" + "@smithy/types" "^3.0.0" + tslib "^2.6.2" "@socket.io/component-emitter@~3.1.0": version "3.1.2" @@ -10386,22 +10766,6 @@ available-typed-arrays@^1.0.7: dependencies: possible-typed-array-names "^1.0.0" -aws-sdk@^2.1612.0: - version "2.1612.0" - resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1612.0.tgz#9b55523e578f3094ff149f475bea216a84271b88" - integrity sha512-UNwmKh2IChGQzDm6Stxor2SbjealVld2awmf1Q8rxVO1UVvjRrQ97ArD2gWouJT7BuSqDsUpgMgf/LBAbLjMxQ== - dependencies: - buffer "4.9.2" - events "1.1.1" - ieee754 "1.1.13" - jmespath "0.16.0" - querystring "0.2.0" - sax "1.2.1" - url "0.10.3" - util "^0.12.4" - uuid "8.0.0" - xml2js "0.6.2" - axe-core@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.4.2.tgz#dcf7fb6dea866166c3eab33d68208afe4d5f670c" @@ -11055,15 +11419,6 @@ buffer-xor@^1.0.3: resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== -buffer@4.9.2, buffer@^4.3.0: - version "4.9.2" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.2.tgz#230ead344002988644841ab0244af8c44bbe3ef8" - integrity sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg== - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - isarray "^1.0.0" - buffer@6.0.3, buffer@^6.0.3, buffer@~6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" @@ -11072,6 +11427,15 @@ buffer@6.0.3, buffer@^6.0.3, buffer@~6.0.3: base64-js "^1.3.1" ieee754 "^1.2.1" +buffer@^4.3.0: + version "4.9.2" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.2.tgz#230ead344002988644841ab0244af8c44bbe3ef8" + integrity sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg== + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + isarray "^1.0.0" + buffer@^5.5.0: version "5.7.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" @@ -13873,11 +14237,6 @@ eventemitter3@^4.0.4, eventemitter3@^4.0.7: resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== -events@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" - integrity sha512-kEcvvCBByWXGnZy6JUlgAp2gBIUjfCAV6P6TgT1/aaQKcmuAEC4OZTV1I4EWQLz2gxZw76atuVyvHhTxvi0Flw== - events@3.3.0, events@^3.0.0, events@^3.2.0, events@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" @@ -14194,10 +14553,10 @@ fast-url-parser@^1.1.3: dependencies: punycode "^1.3.2" -fast-xml-parser@4.2.4: - version "4.2.4" - resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.2.4.tgz#6e846ede1e56ad9e5ef07d8720809edf0ed07e9b" - integrity sha512-fbfMDvgBNIdDJLdLOwacjFAPYt67tr31H9ZhWSm45CDAxvd0I6WTlSOUo7K2P/K5sA5JgMKG64PI3DMcaFdWpQ== +fast-xml-parser@4.2.5: + version "4.2.5" + resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.2.5.tgz#a6747a09296a6cb34f2ae634019bf1738f3b421f" + integrity sha512-B9/wizE4WngqQftFPmdaMYlXoJlJOYxGQOanC77fq9k8+Z0v5dDSVh+3glErdIROP//s/jgb7ZuxKfB8nVyo0g== dependencies: strnum "^1.0.5" @@ -15697,11 +16056,6 @@ idb-keyval@^6.2.1: resolved "https://registry.yarnpkg.com/idb-keyval/-/idb-keyval-6.2.1.tgz#94516d625346d16f56f3b33855da11bfded2db33" integrity sha512-8Sb3veuYCyrZL+VBt9LJfZjLUPWVvqn8tG28VqYNFCo43KHcKuq+b4EiXGeuaLAQWL2YmyDgMp2aSpH9JHsEQg== -ieee754@1.1.13: - version "1.1.13" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" - integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== - ieee754@^1.1.13, ieee754@^1.1.4, ieee754@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" @@ -17147,11 +17501,6 @@ jiti@^1.17.1, jiti@^1.18.2, jiti@^1.19.1, jiti@^1.21.0: resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.21.0.tgz#7c97f8fe045724e136a397f7340475244156105d" integrity sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q== -jmespath@0.16.0: - version "0.16.0" - resolved "https://registry.yarnpkg.com/jmespath/-/jmespath-0.16.0.tgz#b15b0a85dfd4d930d43e69ed605943c802785076" - integrity sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw== - jose@^5.0.0: version "5.1.1" resolved "https://registry.yarnpkg.com/jose/-/jose-5.1.1.tgz#d61b923baa6bdeb01040afae8295a084c4b9eb58" @@ -21064,11 +21413,6 @@ pumpify@^1.3.3: inherits "^2.0.3" pump "^2.0.0" -punycode@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - integrity sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw== - punycode@^1.2.4, punycode@^1.3.2, punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" @@ -21156,11 +21500,6 @@ querystring-es3@^0.2.0: resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" integrity sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA== -querystring@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - integrity sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g== - querystring@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.1.tgz#40d77615bb09d16902a85c3e38aa8b5ed761c2dd" @@ -22221,16 +22560,6 @@ sass-loader@^12.4.0: klona "^2.0.4" neo-async "^2.6.2" -sax@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.1.tgz#7b8e656190b228e81a66aea748480d828cd2d37a" - integrity sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA== - -sax@>=0.6.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.3.0.tgz#a5dbe77db3be05c9d1ee7785dbd3ea9de51593d0" - integrity sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA== - scheduler@^0.23.0: version "0.23.0" resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe" @@ -24677,14 +25006,6 @@ url-loader@^4.1.1: mime-types "^2.1.27" schema-utils "^3.0.0" -url@0.10.3: - version "0.10.3" - resolved "https://registry.yarnpkg.com/url/-/url-0.10.3.tgz#021e4d9c7705f21bbf37d03ceb58767402774c64" - integrity sha512-hzSUW2q06EqL1gKM/a+obYHLIO6ct2hwPuviqTTOcfFVc61UbfJ2Q32+uGL/HCPxKqrdGB5QUwIe7UqlDgwsOQ== - dependencies: - punycode "1.3.2" - querystring "0.2.0" - url@^0.11.0: version "0.11.1" resolved "https://registry.yarnpkg.com/url/-/url-0.11.1.tgz#26f90f615427eca1b9f4d6a28288c147e2302a32" @@ -24765,7 +25086,7 @@ util@^0.11.0: dependencies: inherits "2.0.3" -util@^0.12.4, util@^0.12.5: +util@^0.12.5: version "0.12.5" resolved "https://registry.yarnpkg.com/util/-/util-0.12.5.tgz#5f17a6059b73db61a875668781a1c2b136bd6fbc" integrity sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA== @@ -24796,11 +25117,6 @@ uuid-browser@^3.1.0: resolved "https://registry.yarnpkg.com/uuid-browser/-/uuid-browser-3.1.0.tgz#0f05a40aef74f9e5951e20efbf44b11871e56410" integrity sha512-dsNgbLaTrd6l3MMxTtouOCFw4CBFc/3a+GgYA2YyrJvyQ1u6q4pcu3ktLoUZ/VN/Aw9WsauazbgsgdfVWgAKQg== -uuid@8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.0.0.tgz#bc6ccf91b5ff0ac07bbcdbf1c7c4e150db4dbb6c" - integrity sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw== - uuid@^3.3.2: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" @@ -25501,19 +25817,6 @@ x-default-browser@^0.4.0: optionalDependencies: default-browser-id "^1.0.4" -xml2js@0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.6.2.tgz#dd0b630083aa09c161e25a4d0901e2b2a929b499" - integrity sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA== - dependencies: - sax ">=0.6.0" - xmlbuilder "~11.0.0" - -xmlbuilder@~11.0.0: - version "11.0.1" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3" - integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA== - xmlhttprequest-ssl@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz#91360c86b914e67f44dce769180027c0da618c67" From c941987bd6c411ffd12f97cc081858692cf4502e Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 11 Jun 2024 20:16:11 -0400 Subject: [PATCH 229/438] updated caniuse-lite --- yarn.lock | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/yarn.lock b/yarn.lock index de74b95fe..8ea86afa9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11658,15 +11658,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001406, caniuse-lite@^1.0.30001517: - version "1.0.30001570" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001570.tgz" - integrity sha512-+3e0ASu4sw1SWaoCtvPeyXp+5PsjigkSt8OXZbF9StH5pQWbxEjLAZE3n8Aup5udop1uRiKA7a4utUk/uoSpUw== - -caniuse-lite@^1.0.30001587: - version "1.0.30001616" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001616.tgz#4342712750d35f71ebba9fcac65e2cf8870013c3" - integrity sha512-RHVYKov7IcdNjVHJFNY/78RdG4oGVjbayxv8u5IO74Wv7Hlq4PnJE6mo/OjFijjVFNy5ijnCt6H3IIo4t+wfEw== +caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001406, caniuse-lite@^1.0.30001517, caniuse-lite@^1.0.30001587: + version "1.0.30001632" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001632.tgz" + integrity sha512-udx3o7yHJfUxMLkGohMlVHCvFvWmirKh9JAH/d7WOLPetlH+LTL5cocMZ0t7oZx/mdlOWXti97xLZWc8uURRHg== capital-case@^1.0.4: version "1.0.4" From fcf4bbeb25b32e7df59ffb33bb1623bd0905da00 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 11 Jun 2024 21:11:01 -0400 Subject: [PATCH 230/438] gzip wasm contract uploads --- packages/i18n/locales/en/translation.json | 2 +- .../UploadCode/Component.tsx | 52 +++++++++++++++---- .../smart_contracting/UploadCode/README.md | 5 +- .../smart_contracting/UploadCode/index.tsx | 9 +++- packages/stateful/package.json | 3 +- packages/utils/messages/encoding.ts | 9 ++++ yarn.lock | 5 ++ 7 files changed, 71 insertions(+), 14 deletions(-) diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 720886489..7cff463e2 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -434,7 +434,7 @@ "invalidImportFormatJson": "Invalid format. Expected `actions` array, with each action containing `key` and `data`.", "invalidMessage": "Invalid message", "invalidVerificationCode": "Invalid verification code.", - "invalidWasmFile": "Invalid file type. Expected WASM (.wasm extension).", + "invalidWasmFile": "Invalid file type. Expected WASM (.wasm extension) or gzipped WASM (.wasm.gz extension).", "loadingChainTokens": "Failed to load tokens on {{chain}}. Try refreshing the page, or try again later.", "loadingData": "Failed to load data.", "logInToContinue": "Log in to continue.", diff --git a/packages/stateful/actions/core/smart_contracting/UploadCode/Component.tsx b/packages/stateful/actions/core/smart_contracting/UploadCode/Component.tsx index b08a0b659..044882950 100644 --- a/packages/stateful/actions/core/smart_contracting/UploadCode/Component.tsx +++ b/packages/stateful/actions/core/smart_contracting/UploadCode/Component.tsx @@ -5,6 +5,7 @@ import { ComponentType, useCallback, useEffect, useState } from 'react' import { useFieldArray, useFormContext } from 'react-hook-form' import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' +import gzipInit, { compress, decompress, freeBuffer } from 'wasm-gzip' import { Button, @@ -29,6 +30,8 @@ export type UploadCodeData = { chainId: string // Set when file is chosen. data?: string + // Whether or not data is gzipped. + gzipped?: boolean accessType: AccessType // Only used when accessType === AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES allowedAddresses: { @@ -64,21 +67,35 @@ export const UploadCodeComponent: ActionComponent = ({ }) const data = watch((fieldNamePrefix + 'data') as 'data') + const gzipped = watch((fieldNamePrefix + 'gzipped') as 'gzipped') const [fileName, setFileName] = useState() const [sha256Checksum, setSha256Checksum] = useState() const updateSha256Checksum = useCallback( - async (_data: string | undefined = data) => { + async ( + _data: string | undefined = data, + _gzipped: boolean | undefined = gzipped + ) => { if (!_data) { return } - const sha256Hash = await crypto.subtle.digest( - 'SHA-256', - fromBase64(_data) - ) + let rawData = fromBase64(_data) + + // Decompress gzip data if needed. + if (_gzipped) { + await gzipInit() + rawData = decompress(rawData) + } + + const sha256Hash = await crypto.subtle.digest('SHA-256', rawData) setSha256Checksum(toHex(new Uint8Array(sha256Hash))) + + // Free buffer once the hash has been computed. + if (_gzipped) { + freeBuffer() + } }, - [data] + [data, gzipped] ) // When data is set, if no hash, compute sha256 hash. useEffect(() => { @@ -88,7 +105,7 @@ export const UploadCodeComponent: ActionComponent = ({ }, [data, sha256Checksum, updateSha256Checksum]) const onSelect = async (file: File) => { - if (!file.name.endsWith('.wasm') && !file.name.endsWith('.gz')) { + if (!file.name.endsWith('.wasm') && !file.name.endsWith('.wasm.gz')) { toast.error(t('error.invalidWasmFile')) return } @@ -105,10 +122,25 @@ export const UploadCodeComponent: ActionComponent = ({ throw new Error(t('error.emptyFile')) } - const newData = toBase64(new Uint8Array(data)) - await updateSha256Checksum(newData) + await gzipInit() + + const fileData = new Uint8Array(data) + const alreadyGzipped = file.name.endsWith('.wasm.gz') + + const rawData = alreadyGzipped ? decompress(fileData) : fileData + + // Update sha256 hash with raw data. + await updateSha256Checksum(toBase64(rawData), false) + + // Gzip compress data if not already gzipped. + const gzippedData = alreadyGzipped ? fileData : compress(rawData) + const gzippedDataBase64 = toBase64(gzippedData) + + // Free buffer once it's been converted to base64. + freeBuffer() - setValue((fieldNamePrefix + 'data') as 'data', newData) + setValue((fieldNamePrefix + 'gzipped') as 'gzipped', true) + setValue((fieldNamePrefix + 'data') as 'data', gzippedDataBase64) } catch (err) { console.error(err) toast.error(processError(err, { forceCapture: false })) diff --git a/packages/stateful/actions/core/smart_contracting/UploadCode/README.md b/packages/stateful/actions/core/smart_contracting/UploadCode/README.md index 6bca5f915..9ff13d74b 100644 --- a/packages/stateful/actions/core/smart_contracting/UploadCode/README.md +++ b/packages/stateful/actions/core/smart_contracting/UploadCode/README.md @@ -16,6 +16,9 @@ guide](https://github.com/DA0-DA0/dao-dao-ui/wiki/Bulk-importing-actions). ```json { "chainId": "", - "data": "" + "data": "", + "gzipped": } ``` + +Set gzipped to true if the base64 data is gzipped wasm. diff --git a/packages/stateful/actions/core/smart_contracting/UploadCode/index.tsx b/packages/stateful/actions/core/smart_contracting/UploadCode/index.tsx index 9ba79d009..c2b362795 100644 --- a/packages/stateful/actions/core/smart_contracting/UploadCode/index.tsx +++ b/packages/stateful/actions/core/smart_contracting/UploadCode/index.tsx @@ -22,6 +22,7 @@ import { decodePolytoneExecuteMsg, getChainAddressForActionOptions, isDecodedStargateMsg, + isGzipped, maybeMakePolytoneExecuteMessage, } from '@dao-dao/utils' @@ -116,11 +117,17 @@ export const makeUploadCodeAction: ActionMaker = (options) => { } } + const wasmByteCode = msg.stargate.value.wasmByteCode as Uint8Array + // gzipped data starts with 0x1f 0x8b + const gzipped = + wasmByteCode instanceof Uint8Array && isGzipped(wasmByteCode) + return { match: true, data: { chainId, - data: toBase64(msg.stargate.value.wasmByteCode), + data: toBase64(wasmByteCode), + gzipped, accessType: msg.stargate.value.instantiatePermission?.permission ?? AccessType.UNRECOGNIZED, diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 34eee5c30..7ecf74b34 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -73,7 +73,8 @@ "recoil": "^0.7.2", "remove-markdown": "^0.5.0", "use-deep-compare-effect": "^1.8.1", - "uuid": "^9.0.0" + "uuid": "^9.0.0", + "wasm-gzip": "^2.0.3" }, "devDependencies": { "@chain-registry/types": "^0.41.3", diff --git a/packages/utils/messages/encoding.ts b/packages/utils/messages/encoding.ts index b7b2e7645..f0f79224e 100644 --- a/packages/utils/messages/encoding.ts +++ b/packages/utils/messages/encoding.ts @@ -29,3 +29,12 @@ export const decodeJsonFromBase64 = ( } } } + +/** + * Determine whether or not the data appears to be gzipped. + * + * Gzip's magic number is 0x1f 0x8b, meaning it will start with those two bytes. + * Other data could also start with those two bytes, but it's unlikely. + */ +export const isGzipped = (data: Uint8Array) => + data.length >= 2 && data[0] === 0x1f && data[1] === 0x8b diff --git a/yarn.lock b/yarn.lock index 8ea86afa9..f4aaa7851 100644 --- a/yarn.lock +++ b/yarn.lock @@ -25263,6 +25263,11 @@ wasm-ast-types@^0.25.0: case "1.6.3" deepmerge "4.2.2" +wasm-gzip@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/wasm-gzip/-/wasm-gzip-2.0.3.tgz#66da82e63f2898868fc1b4e53fef58b0cc3fa82d" + integrity sha512-HX0F/gSliIYLkNbpqH0uFjJWOcDFjn3mN1/FQx/j3XvHgig8asGZM5hP7lznWbHvma/iZaQtC8LAT05RaLB+qw== + watchpack-chokidar2@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/watchpack-chokidar2/-/watchpack-chokidar2-2.0.1.tgz#38500072ee6ece66f3769936950ea1771be1c957" From b935cdb8d2d03228e6a428e2c7feb754fea6590d Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 12 Jun 2024 11:17:58 -0400 Subject: [PATCH 231/438] fixed decoding invalid unregistered stargate msg --- packages/utils/messages/protobuf.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/utils/messages/protobuf.ts b/packages/utils/messages/protobuf.ts index 4c228336a..6210c89fe 100644 --- a/packages/utils/messages/protobuf.ts +++ b/packages/utils/messages/protobuf.ts @@ -173,7 +173,13 @@ export const decodeRawDataForDisplay = (msg: any): any => })() : // Stargate message isCosmWasmStargateMsg(msg) - ? decodeRawDataForDisplay(decodeStargateMessage(msg)) + ? (() => { + try { + return decodeRawDataForDisplay(decodeStargateMessage(msg)) + } catch { + return msg + } + })() : Object.entries(msg).reduce( (acc, [key, value]) => ({ ...acc, From 047474574b765f5b5e8b9e3c3bdb05a84151635c Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 12 Jun 2024 11:22:58 -0400 Subject: [PATCH 232/438] added osmosis.smartacount protos --- .../types/protobuf/codegen/alliance/bundle.ts | 24 +- .../types/protobuf/codegen/bitsong/bundle.ts | 16 +- .../types/protobuf/codegen/circle/bundle.ts | 24 +- .../types/protobuf/codegen/cosmos/bundle.ts | 212 +++--- .../types/protobuf/codegen/cosmwasm/bundle.ts | 40 +- .../types/protobuf/codegen/gaia/bundle.ts | 24 +- packages/types/protobuf/codegen/ibc/bundle.ts | 68 +- .../types/protobuf/codegen/juno/bundle.ts | 40 +- .../types/protobuf/codegen/kujira/bundle.ts | 44 +- .../types/protobuf/codegen/neutron/bundle.ts | 104 +-- .../types/protobuf/codegen/noble/bundle.ts | 20 +- .../types/protobuf/codegen/osmosis/bundle.ts | 304 ++++---- .../types/protobuf/codegen/osmosis/client.ts | 5 +- .../protobuf/codegen/osmosis/rpc.query.ts | 3 + .../types/protobuf/codegen/osmosis/rpc.tx.ts | 3 + .../osmosis/smartaccount/v1beta1/genesis.ts | 265 +++++++ .../osmosis/smartaccount/v1beta1/models.ts | 157 ++++ .../osmosis/smartaccount/v1beta1/params.ts | 150 ++++ .../smartaccount/v1beta1/query.rpc.Query.ts | 50 ++ .../osmosis/smartaccount/v1beta1/query.ts | 540 +++++++++++++ .../osmosis/smartaccount/v1beta1/tx.amino.ts | 18 + .../smartaccount/v1beta1/tx.registry.ts | 71 ++ .../smartaccount/v1beta1/tx.rpc.msg.ts | 37 + .../osmosis/smartaccount/v1beta1/tx.ts | 717 ++++++++++++++++++ .../types/protobuf/codegen/pstake/bundle.ts | 134 ++-- .../protobuf/codegen/publicawesome/bundle.ts | 120 +-- .../types/protobuf/codegen/regen/bundle.ts | 200 ++--- .../protobuf/codegen/tendermint/bundle.ts | 40 +- .../smartaccount/v1beta1/genesis.proto | 35 + .../osmosis/smartaccount/v1beta1/models.proto | 23 + .../osmosis/smartaccount/v1beta1/params.proto | 26 + .../osmosis/smartaccount/v1beta1/query.proto | 58 ++ .../osmosis/smartaccount/v1beta1/tx.proto | 64 ++ packages/types/protobuf/scripts/codegen.js | 1 + 34 files changed, 2940 insertions(+), 697 deletions(-) create mode 100644 packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/genesis.ts create mode 100644 packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/models.ts create mode 100644 packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/params.ts create mode 100644 packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/query.rpc.Query.ts create mode 100644 packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/query.ts create mode 100644 packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/tx.amino.ts create mode 100644 packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/tx.registry.ts create mode 100644 packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/tx.rpc.msg.ts create mode 100644 packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/tx.ts create mode 100644 packages/types/protobuf/proto/osmosis/smartaccount/v1beta1/genesis.proto create mode 100644 packages/types/protobuf/proto/osmosis/smartaccount/v1beta1/models.proto create mode 100644 packages/types/protobuf/proto/osmosis/smartaccount/v1beta1/params.proto create mode 100644 packages/types/protobuf/proto/osmosis/smartaccount/v1beta1/query.proto create mode 100644 packages/types/protobuf/proto/osmosis/smartaccount/v1beta1/tx.proto diff --git a/packages/types/protobuf/codegen/alliance/bundle.ts b/packages/types/protobuf/codegen/alliance/bundle.ts index eb0a7a37b..1cb960388 100644 --- a/packages/types/protobuf/codegen/alliance/bundle.ts +++ b/packages/types/protobuf/codegen/alliance/bundle.ts @@ -8,12 +8,12 @@ import * as _6 from "./alliance/query"; import * as _7 from "./alliance/redelegations"; import * as _8 from "./alliance/tx"; import * as _9 from "./alliance/unbonding"; -import * as _349 from "./alliance/tx.amino"; -import * as _350 from "./alliance/tx.registry"; -import * as _351 from "./alliance/query.rpc.Query"; -import * as _352 from "./alliance/tx.rpc.msg"; -import * as _587 from "./rpc.query"; -import * as _588 from "./rpc.tx"; +import * as _354 from "./alliance/tx.amino"; +import * as _355 from "./alliance/tx.registry"; +import * as _356 from "./alliance/query.rpc.Query"; +import * as _357 from "./alliance/tx.rpc.msg"; +import * as _596 from "./rpc.query"; +import * as _597 from "./rpc.tx"; export namespace alliance { export const alliance = { ..._0, @@ -26,13 +26,13 @@ export namespace alliance { ..._7, ..._8, ..._9, - ..._349, - ..._350, - ..._351, - ..._352 + ..._354, + ..._355, + ..._356, + ..._357 }; export const ClientFactory = { - ..._587, - ..._588 + ..._596, + ..._597 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/bitsong/bundle.ts b/packages/types/protobuf/codegen/bitsong/bundle.ts index 86057ff32..0a8c57e7f 100644 --- a/packages/types/protobuf/codegen/bitsong/bundle.ts +++ b/packages/types/protobuf/codegen/bitsong/bundle.ts @@ -1,16 +1,16 @@ import * as _11 from "./fantoken/v1beta1/tx"; -import * as _353 from "./fantoken/v1beta1/tx.amino"; -import * as _354 from "./fantoken/v1beta1/tx.registry"; -import * as _355 from "./fantoken/v1beta1/tx.rpc.msg"; -import * as _589 from "./rpc.tx"; +import * as _358 from "./fantoken/v1beta1/tx.amino"; +import * as _359 from "./fantoken/v1beta1/tx.registry"; +import * as _360 from "./fantoken/v1beta1/tx.rpc.msg"; +import * as _598 from "./rpc.tx"; export namespace bitsong { export const fantoken = { ..._11, - ..._353, - ..._354, - ..._355 + ..._358, + ..._359, + ..._360 }; export const ClientFactory = { - ..._589 + ..._598 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/circle/bundle.ts b/packages/types/protobuf/codegen/circle/bundle.ts index 0d2ecd6eb..f5a0648c1 100644 --- a/packages/types/protobuf/codegen/circle/bundle.ts +++ b/packages/types/protobuf/codegen/circle/bundle.ts @@ -14,12 +14,12 @@ import * as _24 from "./cctp/v1/sending_and_receiving_messages_paused"; import * as _25 from "./cctp/v1/signature_threshold"; import * as _26 from "./cctp/v1/token_pair"; import * as _27 from "./cctp/v1/tx"; -import * as _356 from "./cctp/v1/tx.amino"; -import * as _357 from "./cctp/v1/tx.registry"; -import * as _358 from "./cctp/v1/query.rpc.Query"; -import * as _359 from "./cctp/v1/tx.rpc.msg"; -import * as _590 from "./rpc.query"; -import * as _591 from "./rpc.tx"; +import * as _361 from "./cctp/v1/tx.amino"; +import * as _362 from "./cctp/v1/tx.registry"; +import * as _363 from "./cctp/v1/query.rpc.Query"; +import * as _364 from "./cctp/v1/tx.rpc.msg"; +import * as _599 from "./rpc.query"; +import * as _600 from "./rpc.tx"; export namespace circle { export namespace cctp { export const v1 = { @@ -39,14 +39,14 @@ export namespace circle { ..._25, ..._26, ..._27, - ..._356, - ..._357, - ..._358, - ..._359 + ..._361, + ..._362, + ..._363, + ..._364 }; } export const ClientFactory = { - ..._590, - ..._591 + ..._599, + ..._600 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/bundle.ts b/packages/types/protobuf/codegen/cosmos/bundle.ts index 7cf7dd0f1..b2d4f5e63 100644 --- a/packages/types/protobuf/codegen/cosmos/bundle.ts +++ b/packages/types/protobuf/codegen/cosmos/bundle.ts @@ -63,69 +63,69 @@ import * as _90 from "./tx/v1beta1/tx"; import * as _91 from "./upgrade/v1beta1/query"; import * as _92 from "./upgrade/v1beta1/tx"; import * as _93 from "./upgrade/v1beta1/upgrade"; -import * as _360 from "./adminmodule/adminmodule/tx.amino"; -import * as _361 from "./auth/v1beta1/tx.amino"; -import * as _362 from "./authz/v1beta1/tx.amino"; -import * as _363 from "./bank/v1beta1/tx.amino"; -import * as _364 from "./distribution/v1beta1/tx.amino"; -import * as _365 from "./feegrant/v1beta1/tx.amino"; -import * as _366 from "./gov/v1/tx.amino"; -import * as _367 from "./gov/v1beta1/tx.amino"; -import * as _368 from "./mint/v1beta1/tx.amino"; -import * as _369 from "./slashing/v1beta1/tx.amino"; -import * as _370 from "./staking/v1beta1/tx.amino"; -import * as _371 from "./upgrade/v1beta1/tx.amino"; -import * as _372 from "./adminmodule/adminmodule/tx.registry"; -import * as _373 from "./auth/v1beta1/tx.registry"; -import * as _374 from "./authz/v1beta1/tx.registry"; -import * as _375 from "./bank/v1beta1/tx.registry"; -import * as _376 from "./distribution/v1beta1/tx.registry"; -import * as _377 from "./feegrant/v1beta1/tx.registry"; -import * as _378 from "./gov/v1/tx.registry"; -import * as _379 from "./gov/v1beta1/tx.registry"; -import * as _380 from "./mint/v1beta1/tx.registry"; -import * as _381 from "./slashing/v1beta1/tx.registry"; -import * as _382 from "./staking/v1beta1/tx.registry"; -import * as _383 from "./upgrade/v1beta1/tx.registry"; -import * as _384 from "./adminmodule/adminmodule/query.rpc.Query"; -import * as _385 from "./auth/v1beta1/query.rpc.Query"; -import * as _386 from "./authz/v1beta1/query.rpc.Query"; -import * as _387 from "./bank/v1beta1/query.rpc.Query"; -import * as _388 from "./base/tendermint/v1beta1/query.rpc.Service"; -import * as _389 from "./distribution/v1beta1/query.rpc.Query"; -import * as _390 from "./feegrant/v1beta1/query.rpc.Query"; -import * as _391 from "./gov/v1/query.rpc.Query"; -import * as _392 from "./gov/v1beta1/query.rpc.Query"; -import * as _393 from "./mint/v1beta1/query.rpc.Query"; -import * as _394 from "./params/v1beta1/query.rpc.Query"; -import * as _395 from "./slashing/v1beta1/query.rpc.Query"; -import * as _396 from "./staking/v1beta1/query.rpc.Query"; -import * as _397 from "./tx/v1beta1/service.rpc.Service"; -import * as _398 from "./upgrade/v1beta1/query.rpc.Query"; -import * as _399 from "./adminmodule/adminmodule/tx.rpc.msg"; -import * as _400 from "./auth/v1beta1/tx.rpc.msg"; -import * as _401 from "./authz/v1beta1/tx.rpc.msg"; -import * as _402 from "./bank/v1beta1/tx.rpc.msg"; -import * as _403 from "./distribution/v1beta1/tx.rpc.msg"; -import * as _404 from "./feegrant/v1beta1/tx.rpc.msg"; -import * as _405 from "./gov/v1/tx.rpc.msg"; -import * as _406 from "./gov/v1beta1/tx.rpc.msg"; -import * as _407 from "./mint/v1beta1/tx.rpc.msg"; -import * as _408 from "./slashing/v1beta1/tx.rpc.msg"; -import * as _409 from "./staking/v1beta1/tx.rpc.msg"; -import * as _410 from "./upgrade/v1beta1/tx.rpc.msg"; -import * as _592 from "./rpc.query"; -import * as _593 from "./rpc.tx"; +import * as _365 from "./adminmodule/adminmodule/tx.amino"; +import * as _366 from "./auth/v1beta1/tx.amino"; +import * as _367 from "./authz/v1beta1/tx.amino"; +import * as _368 from "./bank/v1beta1/tx.amino"; +import * as _369 from "./distribution/v1beta1/tx.amino"; +import * as _370 from "./feegrant/v1beta1/tx.amino"; +import * as _371 from "./gov/v1/tx.amino"; +import * as _372 from "./gov/v1beta1/tx.amino"; +import * as _373 from "./mint/v1beta1/tx.amino"; +import * as _374 from "./slashing/v1beta1/tx.amino"; +import * as _375 from "./staking/v1beta1/tx.amino"; +import * as _376 from "./upgrade/v1beta1/tx.amino"; +import * as _377 from "./adminmodule/adminmodule/tx.registry"; +import * as _378 from "./auth/v1beta1/tx.registry"; +import * as _379 from "./authz/v1beta1/tx.registry"; +import * as _380 from "./bank/v1beta1/tx.registry"; +import * as _381 from "./distribution/v1beta1/tx.registry"; +import * as _382 from "./feegrant/v1beta1/tx.registry"; +import * as _383 from "./gov/v1/tx.registry"; +import * as _384 from "./gov/v1beta1/tx.registry"; +import * as _385 from "./mint/v1beta1/tx.registry"; +import * as _386 from "./slashing/v1beta1/tx.registry"; +import * as _387 from "./staking/v1beta1/tx.registry"; +import * as _388 from "./upgrade/v1beta1/tx.registry"; +import * as _389 from "./adminmodule/adminmodule/query.rpc.Query"; +import * as _390 from "./auth/v1beta1/query.rpc.Query"; +import * as _391 from "./authz/v1beta1/query.rpc.Query"; +import * as _392 from "./bank/v1beta1/query.rpc.Query"; +import * as _393 from "./base/tendermint/v1beta1/query.rpc.Service"; +import * as _394 from "./distribution/v1beta1/query.rpc.Query"; +import * as _395 from "./feegrant/v1beta1/query.rpc.Query"; +import * as _396 from "./gov/v1/query.rpc.Query"; +import * as _397 from "./gov/v1beta1/query.rpc.Query"; +import * as _398 from "./mint/v1beta1/query.rpc.Query"; +import * as _399 from "./params/v1beta1/query.rpc.Query"; +import * as _400 from "./slashing/v1beta1/query.rpc.Query"; +import * as _401 from "./staking/v1beta1/query.rpc.Query"; +import * as _402 from "./tx/v1beta1/service.rpc.Service"; +import * as _403 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _404 from "./adminmodule/adminmodule/tx.rpc.msg"; +import * as _405 from "./auth/v1beta1/tx.rpc.msg"; +import * as _406 from "./authz/v1beta1/tx.rpc.msg"; +import * as _407 from "./bank/v1beta1/tx.rpc.msg"; +import * as _408 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _409 from "./feegrant/v1beta1/tx.rpc.msg"; +import * as _410 from "./gov/v1/tx.rpc.msg"; +import * as _411 from "./gov/v1beta1/tx.rpc.msg"; +import * as _412 from "./mint/v1beta1/tx.rpc.msg"; +import * as _413 from "./slashing/v1beta1/tx.rpc.msg"; +import * as _414 from "./staking/v1beta1/tx.rpc.msg"; +import * as _415 from "./upgrade/v1beta1/tx.rpc.msg"; +import * as _601 from "./rpc.query"; +import * as _602 from "./rpc.tx"; export namespace cosmos { export namespace adminmodule { export const adminmodule = { ..._29, ..._30, ..._31, - ..._360, - ..._372, - ..._384, - ..._399 + ..._365, + ..._377, + ..._389, + ..._404 }; } export namespace auth { @@ -134,10 +134,10 @@ export namespace cosmos { ..._33, ..._34, ..._35, - ..._361, - ..._373, - ..._385, - ..._400 + ..._366, + ..._378, + ..._390, + ..._405 }; } export namespace authz { @@ -147,10 +147,10 @@ export namespace cosmos { ..._38, ..._39, ..._40, - ..._362, - ..._374, - ..._386, - ..._401 + ..._367, + ..._379, + ..._391, + ..._406 }; } export namespace bank { @@ -160,10 +160,10 @@ export namespace cosmos { ..._43, ..._44, ..._45, - ..._363, - ..._375, - ..._387, - ..._402 + ..._368, + ..._380, + ..._392, + ..._407 }; } export namespace base { @@ -181,7 +181,7 @@ export namespace cosmos { export const v1beta1 = { ..._48, ..._49, - ..._388 + ..._393 }; } export const v1beta1 = { @@ -205,10 +205,10 @@ export namespace cosmos { ..._55, ..._56, ..._57, - ..._364, - ..._376, - ..._389, - ..._403 + ..._369, + ..._381, + ..._394, + ..._408 }; } export namespace feegrant { @@ -217,10 +217,10 @@ export namespace cosmos { ..._59, ..._60, ..._61, - ..._365, - ..._377, - ..._390, - ..._404 + ..._370, + ..._382, + ..._395, + ..._409 }; } export namespace gov { @@ -229,20 +229,20 @@ export namespace cosmos { ..._63, ..._64, ..._65, - ..._366, - ..._378, - ..._391, - ..._405 + ..._371, + ..._383, + ..._396, + ..._410 }; export const v1beta1 = { ..._66, ..._67, ..._68, ..._69, - ..._367, - ..._379, - ..._392, - ..._406 + ..._372, + ..._384, + ..._397, + ..._411 }; } export namespace mint { @@ -251,10 +251,10 @@ export namespace cosmos { ..._71, ..._72, ..._73, - ..._368, - ..._380, - ..._393, - ..._407 + ..._373, + ..._385, + ..._398, + ..._412 }; } export namespace msg { @@ -271,7 +271,7 @@ export namespace cosmos { export const v1beta1 = { ..._76, ..._77, - ..._394 + ..._399 }; } export namespace query { @@ -285,10 +285,10 @@ export namespace cosmos { ..._80, ..._81, ..._82, - ..._369, - ..._381, - ..._395, - ..._408 + ..._374, + ..._386, + ..._400, + ..._413 }; } export namespace staking { @@ -298,10 +298,10 @@ export namespace cosmos { ..._85, ..._86, ..._87, - ..._370, - ..._382, - ..._396, - ..._409 + ..._375, + ..._387, + ..._401, + ..._414 }; } export namespace tx { @@ -313,7 +313,7 @@ export namespace cosmos { export const v1beta1 = { ..._89, ..._90, - ..._397 + ..._402 }; } export namespace upgrade { @@ -321,14 +321,14 @@ export namespace cosmos { ..._91, ..._92, ..._93, - ..._371, - ..._383, - ..._398, - ..._410 + ..._376, + ..._388, + ..._403, + ..._415 }; } export const ClientFactory = { - ..._592, - ..._593 + ..._601, + ..._602 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmwasm/bundle.ts b/packages/types/protobuf/codegen/cosmwasm/bundle.ts index d6176e77d..e999518cd 100644 --- a/packages/types/protobuf/codegen/cosmwasm/bundle.ts +++ b/packages/types/protobuf/codegen/cosmwasm/bundle.ts @@ -10,16 +10,16 @@ import * as _102 from "./wasm/v1/proposal"; import * as _103 from "./wasm/v1/query"; import * as _104 from "./wasm/v1/tx"; import * as _105 from "./wasm/v1/types"; -import * as _411 from "./tokenfactory/v1beta1/tx.amino"; -import * as _412 from "./wasm/v1/tx.amino"; -import * as _413 from "./tokenfactory/v1beta1/tx.registry"; -import * as _414 from "./wasm/v1/tx.registry"; -import * as _415 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _416 from "./wasm/v1/query.rpc.Query"; -import * as _417 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _418 from "./wasm/v1/tx.rpc.msg"; -import * as _594 from "./rpc.query"; -import * as _595 from "./rpc.tx"; +import * as _416 from "./tokenfactory/v1beta1/tx.amino"; +import * as _417 from "./wasm/v1/tx.amino"; +import * as _418 from "./tokenfactory/v1beta1/tx.registry"; +import * as _419 from "./wasm/v1/tx.registry"; +import * as _420 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _421 from "./wasm/v1/query.rpc.Query"; +import * as _422 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _423 from "./wasm/v1/tx.rpc.msg"; +import * as _603 from "./rpc.query"; +import * as _604 from "./rpc.tx"; export namespace cosmwasm { export namespace tokenfactory { export const v1beta1 = { @@ -28,10 +28,10 @@ export namespace cosmwasm { ..._96, ..._97, ..._98, - ..._411, - ..._413, - ..._415, - ..._417 + ..._416, + ..._418, + ..._420, + ..._422 }; } export namespace wasm { @@ -43,14 +43,14 @@ export namespace cosmwasm { ..._103, ..._104, ..._105, - ..._412, - ..._414, - ..._416, - ..._418 + ..._417, + ..._419, + ..._421, + ..._423 }; } export const ClientFactory = { - ..._594, - ..._595 + ..._603, + ..._604 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/gaia/bundle.ts b/packages/types/protobuf/codegen/gaia/bundle.ts index ad0e1c6ea..1895eab61 100644 --- a/packages/types/protobuf/codegen/gaia/bundle.ts +++ b/packages/types/protobuf/codegen/gaia/bundle.ts @@ -1,26 +1,26 @@ import * as _106 from "./globalfee/v1beta1/genesis"; import * as _107 from "./globalfee/v1beta1/query"; import * as _108 from "./globalfee/v1beta1/tx"; -import * as _419 from "./globalfee/v1beta1/tx.amino"; -import * as _420 from "./globalfee/v1beta1/tx.registry"; -import * as _421 from "./globalfee/v1beta1/query.rpc.Query"; -import * as _422 from "./globalfee/v1beta1/tx.rpc.msg"; -import * as _596 from "./rpc.query"; -import * as _597 from "./rpc.tx"; +import * as _424 from "./globalfee/v1beta1/tx.amino"; +import * as _425 from "./globalfee/v1beta1/tx.registry"; +import * as _426 from "./globalfee/v1beta1/query.rpc.Query"; +import * as _427 from "./globalfee/v1beta1/tx.rpc.msg"; +import * as _605 from "./rpc.query"; +import * as _606 from "./rpc.tx"; export namespace gaia { export namespace globalfee { export const v1beta1 = { ..._106, ..._107, ..._108, - ..._419, - ..._420, - ..._421, - ..._422 + ..._424, + ..._425, + ..._426, + ..._427 }; } export const ClientFactory = { - ..._596, - ..._597 + ..._605, + ..._606 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/bundle.ts b/packages/types/protobuf/codegen/ibc/bundle.ts index a1b279ec2..08c1f1797 100644 --- a/packages/types/protobuf/codegen/ibc/bundle.ts +++ b/packages/types/protobuf/codegen/ibc/bundle.ts @@ -20,28 +20,28 @@ import * as _135 from "./core/client/v1/client"; import * as _136 from "./core/client/v1/genesis"; import * as _137 from "./core/client/v1/query"; import * as _138 from "./core/client/v1/tx"; -import * as _423 from "./applications/interchain_accounts/controller/v1/tx.amino"; -import * as _424 from "./applications/interchain_accounts/host/v1/tx.amino"; -import * as _425 from "./applications/transfer/v1/tx.amino"; -import * as _426 from "./core/channel/v1/tx.amino"; -import * as _427 from "./core/client/v1/tx.amino"; -import * as _428 from "./applications/interchain_accounts/controller/v1/tx.registry"; -import * as _429 from "./applications/interchain_accounts/host/v1/tx.registry"; -import * as _430 from "./applications/transfer/v1/tx.registry"; -import * as _431 from "./core/channel/v1/tx.registry"; -import * as _432 from "./core/client/v1/tx.registry"; -import * as _433 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; -import * as _434 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; -import * as _435 from "./applications/transfer/v1/query.rpc.Query"; -import * as _436 from "./core/channel/v1/query.rpc.Query"; -import * as _437 from "./core/client/v1/query.rpc.Query"; -import * as _438 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; -import * as _439 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; -import * as _440 from "./applications/transfer/v1/tx.rpc.msg"; -import * as _441 from "./core/channel/v1/tx.rpc.msg"; -import * as _442 from "./core/client/v1/tx.rpc.msg"; -import * as _598 from "./rpc.query"; -import * as _599 from "./rpc.tx"; +import * as _428 from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as _429 from "./applications/interchain_accounts/host/v1/tx.amino"; +import * as _430 from "./applications/transfer/v1/tx.amino"; +import * as _431 from "./core/channel/v1/tx.amino"; +import * as _432 from "./core/client/v1/tx.amino"; +import * as _433 from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as _434 from "./applications/interchain_accounts/host/v1/tx.registry"; +import * as _435 from "./applications/transfer/v1/tx.registry"; +import * as _436 from "./core/channel/v1/tx.registry"; +import * as _437 from "./core/client/v1/tx.registry"; +import * as _438 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; +import * as _439 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; +import * as _440 from "./applications/transfer/v1/query.rpc.Query"; +import * as _441 from "./core/channel/v1/query.rpc.Query"; +import * as _442 from "./core/client/v1/query.rpc.Query"; +import * as _443 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; +import * as _444 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; +import * as _445 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _446 from "./core/channel/v1/tx.rpc.msg"; +import * as _447 from "./core/client/v1/tx.rpc.msg"; +import * as _607 from "./rpc.query"; +import * as _608 from "./rpc.tx"; export namespace ibc { export namespace applications { export namespace interchain_accounts { @@ -50,10 +50,10 @@ export namespace ibc { ..._117, ..._118, ..._119, - ..._423, ..._428, ..._433, - ..._438 + ..._438, + ..._443 }; } export namespace host { @@ -61,10 +61,10 @@ export namespace ibc { ..._120, ..._121, ..._122, - ..._424, ..._429, ..._434, - ..._439 + ..._439, + ..._444 }; } export const v1 = { @@ -80,10 +80,10 @@ export namespace ibc { ..._128, ..._129, ..._130, - ..._425, ..._430, ..._435, - ..._440 + ..._440, + ..._445 }; } } @@ -94,10 +94,10 @@ export namespace ibc { ..._132, ..._133, ..._134, - ..._426, ..._431, ..._436, - ..._441 + ..._441, + ..._446 }; } export namespace client { @@ -106,15 +106,15 @@ export namespace ibc { ..._136, ..._137, ..._138, - ..._427, ..._432, ..._437, - ..._442 + ..._442, + ..._447 }; } } export const ClientFactory = { - ..._598, - ..._599 + ..._607, + ..._608 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/juno/bundle.ts b/packages/types/protobuf/codegen/juno/bundle.ts index 99890e8f7..0e402f74e 100644 --- a/packages/types/protobuf/codegen/juno/bundle.ts +++ b/packages/types/protobuf/codegen/juno/bundle.ts @@ -6,16 +6,16 @@ import * as _143 from "./mint/genesis"; import * as _144 from "./mint/mint"; import * as _145 from "./mint/query"; import * as _146 from "./mint/tx"; -import * as _443 from "./feeshare/v1/tx.amino"; -import * as _444 from "./mint/tx.amino"; -import * as _445 from "./feeshare/v1/tx.registry"; -import * as _446 from "./mint/tx.registry"; -import * as _447 from "./feeshare/v1/query.rpc.Query"; -import * as _448 from "./mint/query.rpc.Query"; -import * as _449 from "./feeshare/v1/tx.rpc.msg"; -import * as _450 from "./mint/tx.rpc.msg"; -import * as _600 from "./rpc.query"; -import * as _601 from "./rpc.tx"; +import * as _448 from "./feeshare/v1/tx.amino"; +import * as _449 from "./mint/tx.amino"; +import * as _450 from "./feeshare/v1/tx.registry"; +import * as _451 from "./mint/tx.registry"; +import * as _452 from "./feeshare/v1/query.rpc.Query"; +import * as _453 from "./mint/query.rpc.Query"; +import * as _454 from "./feeshare/v1/tx.rpc.msg"; +import * as _455 from "./mint/tx.rpc.msg"; +import * as _609 from "./rpc.query"; +import * as _610 from "./rpc.tx"; export namespace juno { export namespace feeshare { export const v1 = { @@ -23,10 +23,10 @@ export namespace juno { ..._140, ..._141, ..._142, - ..._443, - ..._445, - ..._447, - ..._449 + ..._448, + ..._450, + ..._452, + ..._454 }; } export const mint = { @@ -34,13 +34,13 @@ export namespace juno { ..._144, ..._145, ..._146, - ..._444, - ..._446, - ..._448, - ..._450 + ..._449, + ..._451, + ..._453, + ..._455 }; export const ClientFactory = { - ..._600, - ..._601 + ..._609, + ..._610 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/bundle.ts b/packages/types/protobuf/codegen/kujira/bundle.ts index c69a08947..0e695a6b2 100644 --- a/packages/types/protobuf/codegen/kujira/bundle.ts +++ b/packages/types/protobuf/codegen/kujira/bundle.ts @@ -12,17 +12,17 @@ import * as _157 from "./scheduler/hook"; import * as _158 from "./scheduler/params"; import * as _159 from "./scheduler/proposal"; import * as _160 from "./scheduler/query"; -import * as _451 from "./denom/tx.amino"; -import * as _452 from "./oracle/tx.amino"; -import * as _453 from "./denom/tx.registry"; -import * as _454 from "./oracle/tx.registry"; -import * as _455 from "./denom/query.rpc.Query"; -import * as _456 from "./oracle/query.rpc.Query"; -import * as _457 from "./scheduler/query.rpc.Query"; -import * as _458 from "./denom/tx.rpc.msg"; -import * as _459 from "./oracle/tx.rpc.msg"; -import * as _602 from "./rpc.query"; -import * as _603 from "./rpc.tx"; +import * as _456 from "./denom/tx.amino"; +import * as _457 from "./oracle/tx.amino"; +import * as _458 from "./denom/tx.registry"; +import * as _459 from "./oracle/tx.registry"; +import * as _460 from "./denom/query.rpc.Query"; +import * as _461 from "./oracle/query.rpc.Query"; +import * as _462 from "./scheduler/query.rpc.Query"; +import * as _463 from "./denom/tx.rpc.msg"; +import * as _464 from "./oracle/tx.rpc.msg"; +import * as _611 from "./rpc.query"; +import * as _612 from "./rpc.tx"; export namespace kujira { export const denom = { ..._147, @@ -30,20 +30,20 @@ export namespace kujira { ..._149, ..._150, ..._151, - ..._451, - ..._453, - ..._455, - ..._458 + ..._456, + ..._458, + ..._460, + ..._463 }; export const oracle = { ..._152, ..._153, ..._154, ..._155, - ..._452, - ..._454, - ..._456, - ..._459 + ..._457, + ..._459, + ..._461, + ..._464 }; export const scheduler = { ..._156, @@ -51,10 +51,10 @@ export namespace kujira { ..._158, ..._159, ..._160, - ..._457 + ..._462 }; export const ClientFactory = { - ..._602, - ..._603 + ..._611, + ..._612 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/neutron/bundle.ts b/packages/types/protobuf/codegen/neutron/bundle.ts index 1a43d1408..983fd647c 100644 --- a/packages/types/protobuf/codegen/neutron/bundle.ts +++ b/packages/types/protobuf/codegen/neutron/bundle.ts @@ -36,32 +36,32 @@ import * as _195 from "./interchaintxs/v1/genesis"; import * as _196 from "./interchaintxs/v1/params"; import * as _197 from "./interchaintxs/v1/query"; import * as _198 from "./interchaintxs/v1/tx"; -import * as _460 from "./cron/tx.amino"; -import * as _461 from "./dex/tx.amino"; -import * as _462 from "./feeburner/tx.amino"; -import * as _463 from "./feerefunder/tx.amino"; -import * as _464 from "./interchainqueries/tx.amino"; -import * as _465 from "./interchaintxs/v1/tx.amino"; -import * as _466 from "./cron/tx.registry"; -import * as _467 from "./dex/tx.registry"; -import * as _468 from "./feeburner/tx.registry"; -import * as _469 from "./feerefunder/tx.registry"; -import * as _470 from "./interchainqueries/tx.registry"; -import * as _471 from "./interchaintxs/v1/tx.registry"; -import * as _472 from "./cron/query.rpc.Query"; -import * as _473 from "./dex/query.rpc.Query"; -import * as _474 from "./feeburner/query.rpc.Query"; -import * as _475 from "./feerefunder/query.rpc.Query"; -import * as _476 from "./interchainqueries/query.rpc.Query"; -import * as _477 from "./interchaintxs/v1/query.rpc.Query"; -import * as _478 from "./cron/tx.rpc.msg"; -import * as _479 from "./dex/tx.rpc.msg"; -import * as _480 from "./feeburner/tx.rpc.msg"; -import * as _481 from "./feerefunder/tx.rpc.msg"; -import * as _482 from "./interchainqueries/tx.rpc.msg"; -import * as _483 from "./interchaintxs/v1/tx.rpc.msg"; -import * as _604 from "./rpc.query"; -import * as _605 from "./rpc.tx"; +import * as _465 from "./cron/tx.amino"; +import * as _466 from "./dex/tx.amino"; +import * as _467 from "./feeburner/tx.amino"; +import * as _468 from "./feerefunder/tx.amino"; +import * as _469 from "./interchainqueries/tx.amino"; +import * as _470 from "./interchaintxs/v1/tx.amino"; +import * as _471 from "./cron/tx.registry"; +import * as _472 from "./dex/tx.registry"; +import * as _473 from "./feeburner/tx.registry"; +import * as _474 from "./feerefunder/tx.registry"; +import * as _475 from "./interchainqueries/tx.registry"; +import * as _476 from "./interchaintxs/v1/tx.registry"; +import * as _477 from "./cron/query.rpc.Query"; +import * as _478 from "./dex/query.rpc.Query"; +import * as _479 from "./feeburner/query.rpc.Query"; +import * as _480 from "./feerefunder/query.rpc.Query"; +import * as _481 from "./interchainqueries/query.rpc.Query"; +import * as _482 from "./interchaintxs/v1/query.rpc.Query"; +import * as _483 from "./cron/tx.rpc.msg"; +import * as _484 from "./dex/tx.rpc.msg"; +import * as _485 from "./feeburner/tx.rpc.msg"; +import * as _486 from "./feerefunder/tx.rpc.msg"; +import * as _487 from "./interchainqueries/tx.rpc.msg"; +import * as _488 from "./interchaintxs/v1/tx.rpc.msg"; +import * as _613 from "./rpc.query"; +import * as _614 from "./rpc.tx"; export namespace neutron { export namespace contractmanager { export const v1 = { @@ -74,10 +74,10 @@ export namespace neutron { ..._164, ..._165, ..._166, - ..._460, - ..._466, - ..._472, - ..._478 + ..._465, + ..._471, + ..._477, + ..._483 }; export const dex = { ..._167, @@ -94,10 +94,10 @@ export namespace neutron { ..._178, ..._179, ..._180, - ..._461, - ..._467, - ..._473, - ..._479 + ..._466, + ..._472, + ..._478, + ..._484 }; export const feeburner = { ..._181, @@ -105,10 +105,10 @@ export namespace neutron { ..._183, ..._184, ..._185, - ..._462, - ..._468, - ..._474, - ..._480 + ..._467, + ..._473, + ..._479, + ..._485 }; export const feerefunder = { ..._186, @@ -116,20 +116,20 @@ export namespace neutron { ..._188, ..._189, ..._190, - ..._463, - ..._469, - ..._475, - ..._481 + ..._468, + ..._474, + ..._480, + ..._486 }; export const interchainqueries = { ..._191, ..._192, ..._193, ..._194, - ..._464, - ..._470, - ..._476, - ..._482 + ..._469, + ..._475, + ..._481, + ..._487 }; export namespace interchaintxs { export const v1 = { @@ -137,14 +137,14 @@ export namespace neutron { ..._196, ..._197, ..._198, - ..._465, - ..._471, - ..._477, - ..._483 + ..._470, + ..._476, + ..._482, + ..._488 }; } export const ClientFactory = { - ..._604, - ..._605 + ..._613, + ..._614 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/noble/bundle.ts b/packages/types/protobuf/codegen/noble/bundle.ts index cfaf40dc4..4d1233adf 100644 --- a/packages/types/protobuf/codegen/noble/bundle.ts +++ b/packages/types/protobuf/codegen/noble/bundle.ts @@ -1,16 +1,16 @@ -import * as _336 from "../tariff/genesis"; -import * as _337 from "../tariff/params"; -import * as _338 from "../tariff/query"; -import * as _586 from "../tariff/query.rpc.Query"; -import * as _614 from "./rpc.query"; +import * as _341 from "../tariff/genesis"; +import * as _342 from "../tariff/params"; +import * as _343 from "../tariff/query"; +import * as _595 from "../tariff/query.rpc.Query"; +import * as _623 from "./rpc.query"; export namespace noble { export const tariff = { - ..._336, - ..._337, - ..._338, - ..._586 + ..._341, + ..._342, + ..._343, + ..._595 }; export const ClientFactory = { - ..._614 + ..._623 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/bundle.ts b/packages/types/protobuf/codegen/osmosis/bundle.ts index 13b174f3e..dc3891b34 100644 --- a/packages/types/protobuf/codegen/osmosis/bundle.ts +++ b/packages/types/protobuf/codegen/osmosis/bundle.ts @@ -50,78 +50,87 @@ import * as _247 from "./protorev/v1beta1/params"; import * as _248 from "./protorev/v1beta1/protorev"; import * as _249 from "./protorev/v1beta1/query"; import * as _250 from "./protorev/v1beta1/tx"; -import * as _251 from "./superfluid/genesis"; -import * as _252 from "./superfluid/params"; -import * as _253 from "./superfluid/query"; -import * as _254 from "./superfluid/superfluid"; -import * as _255 from "./superfluid/tx"; -import * as _256 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _257 from "./tokenfactory/v1beta1/genesis"; -import * as _258 from "./tokenfactory/v1beta1/params"; -import * as _259 from "./tokenfactory/v1beta1/query"; -import * as _260 from "./tokenfactory/v1beta1/tx"; -import * as _261 from "./txfees/v1beta1/feetoken"; -import * as _262 from "./txfees/v1beta1/genesis"; -import * as _263 from "./txfees/v1beta1/gov"; -import * as _264 from "./txfees/v1beta1/params"; -import * as _265 from "./txfees/v1beta1/query"; -import * as _266 from "./txfees/v1beta1/tx"; -import * as _267 from "./valset-pref/v1beta1/query"; -import * as _268 from "./valset-pref/v1beta1/state"; -import * as _269 from "./valset-pref/v1beta1/tx"; -import * as _484 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; -import * as _485 from "./concentratedliquidity/v1beta1/tx.amino"; -import * as _486 from "./gamm/pool-models/balancer/tx/tx.amino"; -import * as _487 from "./gamm/pool-models/stableswap/tx.amino"; -import * as _488 from "./gamm/v1beta1/tx.amino"; -import * as _489 from "./incentives/tx.amino"; -import * as _490 from "./lockup/tx.amino"; -import * as _491 from "./poolmanager/v1beta1/tx.amino"; -import * as _492 from "./protorev/v1beta1/tx.amino"; -import * as _493 from "./superfluid/tx.amino"; -import * as _494 from "./tokenfactory/v1beta1/tx.amino"; -import * as _495 from "./txfees/v1beta1/tx.amino"; -import * as _496 from "./valset-pref/v1beta1/tx.amino"; -import * as _497 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; -import * as _498 from "./concentratedliquidity/v1beta1/tx.registry"; -import * as _499 from "./gamm/pool-models/balancer/tx/tx.registry"; -import * as _500 from "./gamm/pool-models/stableswap/tx.registry"; -import * as _501 from "./gamm/v1beta1/tx.registry"; -import * as _502 from "./incentives/tx.registry"; -import * as _503 from "./lockup/tx.registry"; -import * as _504 from "./poolmanager/v1beta1/tx.registry"; -import * as _505 from "./protorev/v1beta1/tx.registry"; -import * as _506 from "./superfluid/tx.registry"; -import * as _507 from "./tokenfactory/v1beta1/tx.registry"; -import * as _508 from "./txfees/v1beta1/tx.registry"; -import * as _509 from "./valset-pref/v1beta1/tx.registry"; -import * as _510 from "./concentratedliquidity/v1beta1/query.rpc.Query"; -import * as _511 from "./cosmwasmpool/v1beta1/query.rpc.Query"; -import * as _512 from "./gamm/v1beta1/query.rpc.Query"; -import * as _513 from "./incentives/query.rpc.Query"; -import * as _514 from "./lockup/query.rpc.Query"; -import * as _515 from "./pool-incentives/v1beta1/query.rpc.Query"; -import * as _516 from "./poolmanager/v1beta1/query.rpc.Query"; -import * as _517 from "./protorev/v1beta1/query.rpc.Query"; -import * as _518 from "./superfluid/query.rpc.Query"; -import * as _519 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _520 from "./txfees/v1beta1/query.rpc.Query"; -import * as _521 from "./valset-pref/v1beta1/query.rpc.Query"; -import * as _522 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; -import * as _523 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; -import * as _524 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; -import * as _525 from "./gamm/pool-models/stableswap/tx.rpc.msg"; -import * as _526 from "./gamm/v1beta1/tx.rpc.msg"; -import * as _527 from "./incentives/tx.rpc.msg"; -import * as _528 from "./lockup/tx.rpc.msg"; -import * as _529 from "./poolmanager/v1beta1/tx.rpc.msg"; -import * as _530 from "./protorev/v1beta1/tx.rpc.msg"; -import * as _531 from "./superfluid/tx.rpc.msg"; -import * as _532 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _533 from "./txfees/v1beta1/tx.rpc.msg"; -import * as _534 from "./valset-pref/v1beta1/tx.rpc.msg"; -import * as _606 from "./rpc.query"; -import * as _607 from "./rpc.tx"; +import * as _251 from "./smartaccount/v1beta1/genesis"; +import * as _252 from "./smartaccount/v1beta1/models"; +import * as _253 from "./smartaccount/v1beta1/params"; +import * as _254 from "./smartaccount/v1beta1/query"; +import * as _255 from "./smartaccount/v1beta1/tx"; +import * as _256 from "./superfluid/genesis"; +import * as _257 from "./superfluid/params"; +import * as _258 from "./superfluid/query"; +import * as _259 from "./superfluid/superfluid"; +import * as _260 from "./superfluid/tx"; +import * as _261 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _262 from "./tokenfactory/v1beta1/genesis"; +import * as _263 from "./tokenfactory/v1beta1/params"; +import * as _264 from "./tokenfactory/v1beta1/query"; +import * as _265 from "./tokenfactory/v1beta1/tx"; +import * as _266 from "./txfees/v1beta1/feetoken"; +import * as _267 from "./txfees/v1beta1/genesis"; +import * as _268 from "./txfees/v1beta1/gov"; +import * as _269 from "./txfees/v1beta1/params"; +import * as _270 from "./txfees/v1beta1/query"; +import * as _271 from "./txfees/v1beta1/tx"; +import * as _272 from "./valset-pref/v1beta1/query"; +import * as _273 from "./valset-pref/v1beta1/state"; +import * as _274 from "./valset-pref/v1beta1/tx"; +import * as _489 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; +import * as _490 from "./concentratedliquidity/v1beta1/tx.amino"; +import * as _491 from "./gamm/pool-models/balancer/tx/tx.amino"; +import * as _492 from "./gamm/pool-models/stableswap/tx.amino"; +import * as _493 from "./gamm/v1beta1/tx.amino"; +import * as _494 from "./incentives/tx.amino"; +import * as _495 from "./lockup/tx.amino"; +import * as _496 from "./poolmanager/v1beta1/tx.amino"; +import * as _497 from "./protorev/v1beta1/tx.amino"; +import * as _498 from "./smartaccount/v1beta1/tx.amino"; +import * as _499 from "./superfluid/tx.amino"; +import * as _500 from "./tokenfactory/v1beta1/tx.amino"; +import * as _501 from "./txfees/v1beta1/tx.amino"; +import * as _502 from "./valset-pref/v1beta1/tx.amino"; +import * as _503 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; +import * as _504 from "./concentratedliquidity/v1beta1/tx.registry"; +import * as _505 from "./gamm/pool-models/balancer/tx/tx.registry"; +import * as _506 from "./gamm/pool-models/stableswap/tx.registry"; +import * as _507 from "./gamm/v1beta1/tx.registry"; +import * as _508 from "./incentives/tx.registry"; +import * as _509 from "./lockup/tx.registry"; +import * as _510 from "./poolmanager/v1beta1/tx.registry"; +import * as _511 from "./protorev/v1beta1/tx.registry"; +import * as _512 from "./smartaccount/v1beta1/tx.registry"; +import * as _513 from "./superfluid/tx.registry"; +import * as _514 from "./tokenfactory/v1beta1/tx.registry"; +import * as _515 from "./txfees/v1beta1/tx.registry"; +import * as _516 from "./valset-pref/v1beta1/tx.registry"; +import * as _517 from "./concentratedliquidity/v1beta1/query.rpc.Query"; +import * as _518 from "./cosmwasmpool/v1beta1/query.rpc.Query"; +import * as _519 from "./gamm/v1beta1/query.rpc.Query"; +import * as _520 from "./incentives/query.rpc.Query"; +import * as _521 from "./lockup/query.rpc.Query"; +import * as _522 from "./pool-incentives/v1beta1/query.rpc.Query"; +import * as _523 from "./poolmanager/v1beta1/query.rpc.Query"; +import * as _524 from "./protorev/v1beta1/query.rpc.Query"; +import * as _525 from "./smartaccount/v1beta1/query.rpc.Query"; +import * as _526 from "./superfluid/query.rpc.Query"; +import * as _527 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _528 from "./txfees/v1beta1/query.rpc.Query"; +import * as _529 from "./valset-pref/v1beta1/query.rpc.Query"; +import * as _530 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; +import * as _531 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; +import * as _532 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; +import * as _533 from "./gamm/pool-models/stableswap/tx.rpc.msg"; +import * as _534 from "./gamm/v1beta1/tx.rpc.msg"; +import * as _535 from "./incentives/tx.rpc.msg"; +import * as _536 from "./lockup/tx.rpc.msg"; +import * as _537 from "./poolmanager/v1beta1/tx.rpc.msg"; +import * as _538 from "./protorev/v1beta1/tx.rpc.msg"; +import * as _539 from "./smartaccount/v1beta1/tx.rpc.msg"; +import * as _540 from "./superfluid/tx.rpc.msg"; +import * as _541 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _542 from "./txfees/v1beta1/tx.rpc.msg"; +import * as _543 from "./valset-pref/v1beta1/tx.rpc.msg"; +import * as _615 from "./rpc.query"; +import * as _616 from "./rpc.tx"; export namespace osmosis { export namespace accum { export const v1beta1 = { @@ -133,17 +142,17 @@ export namespace osmosis { poolmodel: { concentrated: { v1beta1: { - ..._484, - ..._497, - ..._522 + ..._489, + ..._503, + ..._530 } } }, v1beta1: { - ..._485, - ..._498, - ..._510, - ..._523 + ..._490, + ..._504, + ..._517, + ..._531 } }; export namespace cosmwasmpool { @@ -160,7 +169,7 @@ export namespace osmosis { ..._210, ..._211, ..._212, - ..._511 + ..._518 }; } export namespace gamm { @@ -171,27 +180,27 @@ export namespace osmosis { ..._216, ..._217, ..._218, - ..._488, - ..._501, - ..._512, - ..._526 + ..._493, + ..._507, + ..._519, + ..._534 }; export namespace poolmodels { export namespace balancer { export const v1beta1 = { ..._219, - ..._486, - ..._499, - ..._524 + ..._491, + ..._505, + ..._532 }; } export namespace stableswap { export const v1beta1 = { ..._220, ..._221, - ..._487, - ..._500, - ..._525 + ..._492, + ..._506, + ..._533 }; } } @@ -204,10 +213,10 @@ export namespace osmosis { ..._226, ..._227, ..._228, - ..._489, - ..._502, - ..._513, - ..._527 + ..._494, + ..._508, + ..._520, + ..._535 }; export const lockup = { ..._229, @@ -215,10 +224,10 @@ export namespace osmosis { ..._231, ..._232, ..._233, - ..._490, - ..._503, - ..._514, - ..._528 + ..._495, + ..._509, + ..._521, + ..._536 }; export namespace poolincentives { export const v1beta1 = { @@ -227,7 +236,7 @@ export namespace osmosis { ..._236, ..._237, ..._238, - ..._515 + ..._522 }; } export namespace poolmanager { @@ -238,10 +247,10 @@ export namespace osmosis { ..._242, ..._243, ..._244, - ..._491, - ..._504, - ..._516, - ..._529 + ..._496, + ..._510, + ..._523, + ..._537 }; } export namespace protorev { @@ -252,63 +261,76 @@ export namespace osmosis { ..._248, ..._249, ..._250, - ..._492, - ..._505, - ..._517, - ..._530 + ..._497, + ..._511, + ..._524, + ..._538 }; } - export const superfluid = { - ..._251, - ..._252, - ..._253, - ..._254, - ..._255, - ..._493, - ..._506, - ..._518, - ..._531 - }; - export namespace tokenfactory { + export namespace smartaccount { export const v1beta1 = { - ..._256, - ..._257, - ..._258, - ..._259, - ..._260, - ..._494, - ..._507, - ..._519, - ..._532 + ..._251, + ..._252, + ..._253, + ..._254, + ..._255, + ..._498, + ..._512, + ..._525, + ..._539 }; } - export namespace txfees { + export const superfluid = { + ..._256, + ..._257, + ..._258, + ..._259, + ..._260, + ..._499, + ..._513, + ..._526, + ..._540 + }; + export namespace tokenfactory { export const v1beta1 = { ..._261, ..._262, ..._263, ..._264, ..._265, - ..._266, - ..._495, - ..._508, - ..._520, - ..._533 + ..._500, + ..._514, + ..._527, + ..._541 }; } - export namespace valsetpref { + export namespace txfees { export const v1beta1 = { + ..._266, ..._267, ..._268, ..._269, - ..._496, - ..._509, - ..._521, - ..._534 + ..._270, + ..._271, + ..._501, + ..._515, + ..._528, + ..._542 + }; + } + export namespace valsetpref { + export const v1beta1 = { + ..._272, + ..._273, + ..._274, + ..._502, + ..._516, + ..._529, + ..._543 }; } export const ClientFactory = { - ..._606, - ..._607 + ..._615, + ..._616 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/client.ts b/packages/types/protobuf/codegen/osmosis/client.ts index f75b950bf..59e2550c1 100644 --- a/packages/types/protobuf/codegen/osmosis/client.ts +++ b/packages/types/protobuf/codegen/osmosis/client.ts @@ -10,6 +10,7 @@ import * as osmosisIncentivesTxRegistry from "./incentives/tx.registry"; import * as osmosisLockupTxRegistry from "./lockup/tx.registry"; import * as osmosisPoolmanagerV1beta1TxRegistry from "./poolmanager/v1beta1/tx.registry"; import * as osmosisProtorevV1beta1TxRegistry from "./protorev/v1beta1/tx.registry"; +import * as osmosisSmartaccountV1beta1TxRegistry from "./smartaccount/v1beta1/tx.registry"; import * as osmosisSuperfluidTxRegistry from "./superfluid/tx.registry"; import * as osmosisTokenfactoryV1beta1TxRegistry from "./tokenfactory/v1beta1/tx.registry"; import * as osmosisTxfeesV1beta1TxRegistry from "./txfees/v1beta1/tx.registry"; @@ -23,6 +24,7 @@ import * as osmosisIncentivesTxAmino from "./incentives/tx.amino"; import * as osmosisLockupTxAmino from "./lockup/tx.amino"; import * as osmosisPoolmanagerV1beta1TxAmino from "./poolmanager/v1beta1/tx.amino"; import * as osmosisProtorevV1beta1TxAmino from "./protorev/v1beta1/tx.amino"; +import * as osmosisSmartaccountV1beta1TxAmino from "./smartaccount/v1beta1/tx.amino"; import * as osmosisSuperfluidTxAmino from "./superfluid/tx.amino"; import * as osmosisTokenfactoryV1beta1TxAmino from "./tokenfactory/v1beta1/tx.amino"; import * as osmosisTxfeesV1beta1TxAmino from "./txfees/v1beta1/tx.amino"; @@ -37,12 +39,13 @@ export const osmosisAminoConverters = { ...osmosisLockupTxAmino.AminoConverter, ...osmosisPoolmanagerV1beta1TxAmino.AminoConverter, ...osmosisProtorevV1beta1TxAmino.AminoConverter, + ...osmosisSmartaccountV1beta1TxAmino.AminoConverter, ...osmosisSuperfluidTxAmino.AminoConverter, ...osmosisTokenfactoryV1beta1TxAmino.AminoConverter, ...osmosisTxfeesV1beta1TxAmino.AminoConverter, ...osmosisValsetprefV1beta1TxAmino.AminoConverter }; -export const osmosisProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...osmosisConcentratedliquidityPoolmodelConcentratedV1beta1TxRegistry.registry, ...osmosisConcentratedliquidityV1beta1TxRegistry.registry, ...osmosisGammPoolmodelsBalancerTxTxRegistry.registry, ...osmosisGammPoolmodelsStableswapTxRegistry.registry, ...osmosisGammV1beta1TxRegistry.registry, ...osmosisIncentivesTxRegistry.registry, ...osmosisLockupTxRegistry.registry, ...osmosisPoolmanagerV1beta1TxRegistry.registry, ...osmosisProtorevV1beta1TxRegistry.registry, ...osmosisSuperfluidTxRegistry.registry, ...osmosisTokenfactoryV1beta1TxRegistry.registry, ...osmosisTxfeesV1beta1TxRegistry.registry, ...osmosisValsetprefV1beta1TxRegistry.registry]; +export const osmosisProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...osmosisConcentratedliquidityPoolmodelConcentratedV1beta1TxRegistry.registry, ...osmosisConcentratedliquidityV1beta1TxRegistry.registry, ...osmosisGammPoolmodelsBalancerTxTxRegistry.registry, ...osmosisGammPoolmodelsStableswapTxRegistry.registry, ...osmosisGammV1beta1TxRegistry.registry, ...osmosisIncentivesTxRegistry.registry, ...osmosisLockupTxRegistry.registry, ...osmosisPoolmanagerV1beta1TxRegistry.registry, ...osmosisProtorevV1beta1TxRegistry.registry, ...osmosisSmartaccountV1beta1TxRegistry.registry, ...osmosisSuperfluidTxRegistry.registry, ...osmosisTokenfactoryV1beta1TxRegistry.registry, ...osmosisTxfeesV1beta1TxRegistry.registry, ...osmosisValsetprefV1beta1TxRegistry.registry]; export const getSigningOsmosisClientOptions = ({ defaultTypes = defaultRegistryTypes }: { diff --git a/packages/types/protobuf/codegen/osmosis/rpc.query.ts b/packages/types/protobuf/codegen/osmosis/rpc.query.ts index 8e4e99136..672335001 100644 --- a/packages/types/protobuf/codegen/osmosis/rpc.query.ts +++ b/packages/types/protobuf/codegen/osmosis/rpc.query.ts @@ -76,6 +76,9 @@ export const createRPCQueryClient = async ({ protorev: { v1beta1: (await import("./protorev/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + smartaccount: { + v1beta1: (await import("./smartaccount/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, superfluid: (await import("./superfluid/query.rpc.Query")).createRpcQueryExtension(client), tokenfactory: { v1beta1: (await import("./tokenfactory/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) diff --git a/packages/types/protobuf/codegen/osmosis/rpc.tx.ts b/packages/types/protobuf/codegen/osmosis/rpc.tx.ts index d1d9d5d01..47a15171d 100644 --- a/packages/types/protobuf/codegen/osmosis/rpc.tx.ts +++ b/packages/types/protobuf/codegen/osmosis/rpc.tx.ts @@ -68,6 +68,9 @@ export const createRPCMsgClient = async ({ protorev: { v1beta1: new (await import("./protorev/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + smartaccount: { + v1beta1: new (await import("./smartaccount/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, superfluid: new (await import("./superfluid/tx.rpc.msg")).MsgClientImpl(rpc), tokenfactory: { v1beta1: new (await import("./tokenfactory/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) diff --git a/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/genesis.ts b/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/genesis.ts new file mode 100644 index 000000000..052507379 --- /dev/null +++ b/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/genesis.ts @@ -0,0 +1,265 @@ +//@ts-nocheck +import { AccountAuthenticator, AccountAuthenticatorAmino, AccountAuthenticatorSDKType } from "./models"; +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * AuthenticatorData represents a genesis exported account with Authenticators. + * The address is used as the key, and the account authenticators are stored in + * the authenticators field. + */ +export interface AuthenticatorData { + /** address is an account address, one address can have many authenticators */ + address: string; + /** + * authenticators are the account's authenticators, these can be multiple + * types including SignatureVerification, AllOfs, CosmWasmAuthenticators, etc + */ + authenticators: AccountAuthenticator[]; +} +export interface AuthenticatorDataProtoMsg { + typeUrl: "/osmosis.smartaccount.v1beta1.AuthenticatorData"; + value: Uint8Array; +} +/** + * AuthenticatorData represents a genesis exported account with Authenticators. + * The address is used as the key, and the account authenticators are stored in + * the authenticators field. + */ +export interface AuthenticatorDataAmino { + /** address is an account address, one address can have many authenticators */ + address?: string; + /** + * authenticators are the account's authenticators, these can be multiple + * types including SignatureVerification, AllOfs, CosmWasmAuthenticators, etc + */ + authenticators?: AccountAuthenticatorAmino[]; +} +export interface AuthenticatorDataAminoMsg { + type: "osmosis/smartaccount/authenticator-data"; + value: AuthenticatorDataAmino; +} +/** + * AuthenticatorData represents a genesis exported account with Authenticators. + * The address is used as the key, and the account authenticators are stored in + * the authenticators field. + */ +export interface AuthenticatorDataSDKType { + address: string; + authenticators: AccountAuthenticatorSDKType[]; +} +/** GenesisState defines the authenticator module's genesis state. */ +export interface GenesisState { + /** params define the parameters for the authenticator module. */ + params: Params | undefined; + /** next_authenticator_id is the next available authenticator ID. */ + nextAuthenticatorId: bigint; + /** + * authenticator_data contains the data for multiple accounts, each with their + * authenticators. + */ + authenticatorData: AuthenticatorData[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/osmosis.smartaccount.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the authenticator module's genesis state. */ +export interface GenesisStateAmino { + /** params define the parameters for the authenticator module. */ + params?: ParamsAmino | undefined; + /** next_authenticator_id is the next available authenticator ID. */ + next_authenticator_id?: string; + /** + * authenticator_data contains the data for multiple accounts, each with their + * authenticators. + */ + authenticator_data?: AuthenticatorDataAmino[]; +} +export interface GenesisStateAminoMsg { + type: "osmosis/smartaccount/genesis-state"; + value: GenesisStateAmino; +} +/** GenesisState defines the authenticator module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType | undefined; + next_authenticator_id: bigint; + authenticator_data: AuthenticatorDataSDKType[]; +} +function createBaseAuthenticatorData(): AuthenticatorData { + return { + address: "", + authenticators: [] + }; +} +export const AuthenticatorData = { + typeUrl: "/osmosis.smartaccount.v1beta1.AuthenticatorData", + encode(message: AuthenticatorData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + for (const v of message.authenticators) { + AccountAuthenticator.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): AuthenticatorData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAuthenticatorData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.authenticators.push(AccountAuthenticator.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AuthenticatorData { + const message = createBaseAuthenticatorData(); + message.address = object.address ?? ""; + message.authenticators = object.authenticators?.map(e => AccountAuthenticator.fromPartial(e)) || []; + return message; + }, + fromAmino(object: AuthenticatorDataAmino): AuthenticatorData { + const message = createBaseAuthenticatorData(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.authenticators = object.authenticators?.map(e => AccountAuthenticator.fromAmino(e)) || []; + return message; + }, + toAmino(message: AuthenticatorData, useInterfaces: boolean = false): AuthenticatorDataAmino { + const obj: any = {}; + obj.address = message.address; + if (message.authenticators) { + obj.authenticators = message.authenticators.map(e => e ? AccountAuthenticator.toAmino(e, useInterfaces) : undefined); + } else { + obj.authenticators = []; + } + return obj; + }, + fromAminoMsg(object: AuthenticatorDataAminoMsg): AuthenticatorData { + return AuthenticatorData.fromAmino(object.value); + }, + toAminoMsg(message: AuthenticatorData, useInterfaces: boolean = false): AuthenticatorDataAminoMsg { + return { + type: "osmosis/smartaccount/authenticator-data", + value: AuthenticatorData.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: AuthenticatorDataProtoMsg, useInterfaces: boolean = false): AuthenticatorData { + return AuthenticatorData.decode(message.value, undefined, useInterfaces); + }, + toProto(message: AuthenticatorData): Uint8Array { + return AuthenticatorData.encode(message).finish(); + }, + toProtoMsg(message: AuthenticatorData): AuthenticatorDataProtoMsg { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.AuthenticatorData", + value: AuthenticatorData.encode(message).finish() + }; + } +}; +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + nextAuthenticatorId: BigInt(0), + authenticatorData: [] + }; +} +export const GenesisState = { + typeUrl: "/osmosis.smartaccount.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + if (message.nextAuthenticatorId !== BigInt(0)) { + writer.uint32(16).uint64(message.nextAuthenticatorId); + } + for (const v of message.authenticatorData) { + AuthenticatorData.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.nextAuthenticatorId = reader.uint64(); + break; + case 3: + message.authenticatorData.push(AuthenticatorData.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.nextAuthenticatorId = object.nextAuthenticatorId !== undefined && object.nextAuthenticatorId !== null ? BigInt(object.nextAuthenticatorId.toString()) : BigInt(0); + message.authenticatorData = object.authenticatorData?.map(e => AuthenticatorData.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.next_authenticator_id !== undefined && object.next_authenticator_id !== null) { + message.nextAuthenticatorId = BigInt(object.next_authenticator_id); + } + message.authenticatorData = object.authenticator_data?.map(e => AuthenticatorData.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState, useInterfaces: boolean = false): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + obj.next_authenticator_id = message.nextAuthenticatorId ? message.nextAuthenticatorId.toString() : undefined; + if (message.authenticatorData) { + obj.authenticator_data = message.authenticatorData.map(e => e ? AuthenticatorData.toAmino(e, useInterfaces) : undefined); + } else { + obj.authenticator_data = []; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState, useInterfaces: boolean = false): GenesisStateAminoMsg { + return { + type: "osmosis/smartaccount/genesis-state", + value: GenesisState.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg, useInterfaces: boolean = false): GenesisState { + return GenesisState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/models.ts b/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/models.ts new file mode 100644 index 000000000..330cf8fea --- /dev/null +++ b/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/models.ts @@ -0,0 +1,157 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** + * AccountAuthenticator represents a foundational model for all authenticators. + * It provides extensibility by allowing concrete types to interpret and + * validate transactions based on the encapsulated data. + */ +export interface AccountAuthenticator { + /** ID uniquely identifies the authenticator instance. */ + id: bigint; + /** + * Type specifies the category of the AccountAuthenticator. + * This type information is essential for differentiating authenticators + * and ensuring precise data retrieval from the storage layer. + */ + type: string; + /** + * Config is a versatile field used in conjunction with the specific type of + * account authenticator to facilitate complex authentication processes. + * The interpretation of this field is overloaded, enabling multiple + * authenticators to utilize it for their respective purposes. + */ + config: Uint8Array; +} +export interface AccountAuthenticatorProtoMsg { + typeUrl: "/osmosis.smartaccount.v1beta1.AccountAuthenticator"; + value: Uint8Array; +} +/** + * AccountAuthenticator represents a foundational model for all authenticators. + * It provides extensibility by allowing concrete types to interpret and + * validate transactions based on the encapsulated data. + */ +export interface AccountAuthenticatorAmino { + /** ID uniquely identifies the authenticator instance. */ + id?: string; + /** + * Type specifies the category of the AccountAuthenticator. + * This type information is essential for differentiating authenticators + * and ensuring precise data retrieval from the storage layer. + */ + type?: string; + /** + * Config is a versatile field used in conjunction with the specific type of + * account authenticator to facilitate complex authentication processes. + * The interpretation of this field is overloaded, enabling multiple + * authenticators to utilize it for their respective purposes. + */ + config?: string; +} +export interface AccountAuthenticatorAminoMsg { + type: "osmosis/smartaccount/account-authenticator"; + value: AccountAuthenticatorAmino; +} +/** + * AccountAuthenticator represents a foundational model for all authenticators. + * It provides extensibility by allowing concrete types to interpret and + * validate transactions based on the encapsulated data. + */ +export interface AccountAuthenticatorSDKType { + id: bigint; + type: string; + config: Uint8Array; +} +function createBaseAccountAuthenticator(): AccountAuthenticator { + return { + id: BigInt(0), + type: "", + config: new Uint8Array() + }; +} +export const AccountAuthenticator = { + typeUrl: "/osmosis.smartaccount.v1beta1.AccountAuthenticator", + encode(message: AccountAuthenticator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).uint64(message.id); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + if (message.config.length !== 0) { + writer.uint32(26).bytes(message.config); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): AccountAuthenticator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountAuthenticator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint64(); + break; + case 2: + message.type = reader.string(); + break; + case 3: + message.config = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AccountAuthenticator { + const message = createBaseAccountAuthenticator(); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + message.type = object.type ?? ""; + message.config = object.config ?? new Uint8Array(); + return message; + }, + fromAmino(object: AccountAuthenticatorAmino): AccountAuthenticator { + const message = createBaseAccountAuthenticator(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.config !== undefined && object.config !== null) { + message.config = bytesFromBase64(object.config); + } + return message; + }, + toAmino(message: AccountAuthenticator, useInterfaces: boolean = false): AccountAuthenticatorAmino { + const obj: any = {}; + obj.id = message.id ? message.id.toString() : undefined; + obj.type = message.type; + obj.config = message.config ? base64FromBytes(message.config) : undefined; + return obj; + }, + fromAminoMsg(object: AccountAuthenticatorAminoMsg): AccountAuthenticator { + return AccountAuthenticator.fromAmino(object.value); + }, + toAminoMsg(message: AccountAuthenticator, useInterfaces: boolean = false): AccountAuthenticatorAminoMsg { + return { + type: "osmosis/smartaccount/account-authenticator", + value: AccountAuthenticator.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: AccountAuthenticatorProtoMsg, useInterfaces: boolean = false): AccountAuthenticator { + return AccountAuthenticator.decode(message.value, undefined, useInterfaces); + }, + toProto(message: AccountAuthenticator): Uint8Array { + return AccountAuthenticator.encode(message).finish(); + }, + toProtoMsg(message: AccountAuthenticator): AccountAuthenticatorProtoMsg { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.AccountAuthenticator", + value: AccountAuthenticator.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/params.ts b/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/params.ts new file mode 100644 index 000000000..3d3563f93 --- /dev/null +++ b/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/params.ts @@ -0,0 +1,150 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** Params defines the parameters for the module. */ +export interface Params { + /** + * MaximumUnauthenticatedGas defines the maximum amount of gas that can be + * used to authenticate a transaction in ante handler without having fee payer + * authenticated. + */ + maximumUnauthenticatedGas: bigint; + /** + * IsSmartAccountActive defines the state of the authenticator. + * If set to false, the authenticator module will not be used + * and the classic cosmos sdk authentication will be used instead. + */ + isSmartAccountActive: boolean; + /** + * CircuitBreakerControllers defines list of addresses that are allowed to + * set is_smart_account_active without going through governance. + */ + circuitBreakerControllers: string[]; +} +export interface ParamsProtoMsg { + typeUrl: "/osmosis.smartaccount.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the module. */ +export interface ParamsAmino { + /** + * MaximumUnauthenticatedGas defines the maximum amount of gas that can be + * used to authenticate a transaction in ante handler without having fee payer + * authenticated. + */ + maximum_unauthenticated_gas?: string; + /** + * IsSmartAccountActive defines the state of the authenticator. + * If set to false, the authenticator module will not be used + * and the classic cosmos sdk authentication will be used instead. + */ + is_smart_account_active?: boolean; + /** + * CircuitBreakerControllers defines list of addresses that are allowed to + * set is_smart_account_active without going through governance. + */ + circuit_breaker_controllers?: string[]; +} +export interface ParamsAminoMsg { + type: "osmosis/smartaccount/params"; + value: ParamsAmino; +} +/** Params defines the parameters for the module. */ +export interface ParamsSDKType { + maximum_unauthenticated_gas: bigint; + is_smart_account_active: boolean; + circuit_breaker_controllers: string[]; +} +function createBaseParams(): Params { + return { + maximumUnauthenticatedGas: BigInt(0), + isSmartAccountActive: false, + circuitBreakerControllers: [] + }; +} +export const Params = { + typeUrl: "/osmosis.smartaccount.v1beta1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maximumUnauthenticatedGas !== BigInt(0)) { + writer.uint32(8).uint64(message.maximumUnauthenticatedGas); + } + if (message.isSmartAccountActive === true) { + writer.uint32(16).bool(message.isSmartAccountActive); + } + for (const v of message.circuitBreakerControllers) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maximumUnauthenticatedGas = reader.uint64(); + break; + case 2: + message.isSmartAccountActive = reader.bool(); + break; + case 3: + message.circuitBreakerControllers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.maximumUnauthenticatedGas = object.maximumUnauthenticatedGas !== undefined && object.maximumUnauthenticatedGas !== null ? BigInt(object.maximumUnauthenticatedGas.toString()) : BigInt(0); + message.isSmartAccountActive = object.isSmartAccountActive ?? false; + message.circuitBreakerControllers = object.circuitBreakerControllers?.map(e => e) || []; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.maximum_unauthenticated_gas !== undefined && object.maximum_unauthenticated_gas !== null) { + message.maximumUnauthenticatedGas = BigInt(object.maximum_unauthenticated_gas); + } + if (object.is_smart_account_active !== undefined && object.is_smart_account_active !== null) { + message.isSmartAccountActive = object.is_smart_account_active; + } + message.circuitBreakerControllers = object.circuit_breaker_controllers?.map(e => e) || []; + return message; + }, + toAmino(message: Params, useInterfaces: boolean = false): ParamsAmino { + const obj: any = {}; + obj.maximum_unauthenticated_gas = message.maximumUnauthenticatedGas ? message.maximumUnauthenticatedGas.toString() : undefined; + obj.is_smart_account_active = message.isSmartAccountActive; + if (message.circuitBreakerControllers) { + obj.circuit_breaker_controllers = message.circuitBreakerControllers.map(e => e); + } else { + obj.circuit_breaker_controllers = []; + } + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params, useInterfaces: boolean = false): ParamsAminoMsg { + return { + type: "osmosis/smartaccount/params", + value: Params.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: ParamsProtoMsg, useInterfaces: boolean = false): Params { + return Params.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/query.rpc.Query.ts new file mode 100644 index 000000000..4685ec759 --- /dev/null +++ b/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/query.rpc.Query.ts @@ -0,0 +1,50 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryParamsRequest, QueryParamsResponse, GetAuthenticatorRequest, GetAuthenticatorResponse, GetAuthenticatorsRequest, GetAuthenticatorsResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Parameters queries the parameters of the module. */ + params(request?: QueryParamsRequest): Promise; + getAuthenticator(request: GetAuthenticatorRequest): Promise; + getAuthenticators(request: GetAuthenticatorsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + this.getAuthenticator = this.getAuthenticator.bind(this); + this.getAuthenticators = this.getAuthenticators.bind(this); + } + params(request: QueryParamsRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.smartaccount.v1beta1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + getAuthenticator(request: GetAuthenticatorRequest, useInterfaces: boolean = true): Promise { + const data = GetAuthenticatorRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.smartaccount.v1beta1.Query", "GetAuthenticator", data); + return promise.then(data => GetAuthenticatorResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + getAuthenticators(request: GetAuthenticatorsRequest, useInterfaces: boolean = true): Promise { + const data = GetAuthenticatorsRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.smartaccount.v1beta1.Query", "GetAuthenticators", data); + return promise.then(data => GetAuthenticatorsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest, useInterfaces: boolean = true): Promise { + return queryService.params(request, useInterfaces); + }, + getAuthenticator(request: GetAuthenticatorRequest, useInterfaces: boolean = true): Promise { + return queryService.getAuthenticator(request, useInterfaces); + }, + getAuthenticators(request: GetAuthenticatorsRequest, useInterfaces: boolean = true): Promise { + return queryService.getAuthenticators(request, useInterfaces); + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/query.ts b/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/query.ts new file mode 100644 index 000000000..f9592c165 --- /dev/null +++ b/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/query.ts @@ -0,0 +1,540 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { AccountAuthenticator, AccountAuthenticatorAmino, AccountAuthenticatorSDKType } from "./models"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/osmosis.smartaccount.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "osmosis/smartaccount/query-params-request"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params holds all the parameters of this module. */ + params: Params | undefined; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/osmosis.smartaccount.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** params holds all the parameters of this module. */ + params?: ParamsAmino | undefined; +} +export interface QueryParamsResponseAminoMsg { + type: "osmosis/smartaccount/query-params-response"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType | undefined; +} +/** MsgGetAuthenticatorsRequest defines the Msg/GetAuthenticators request type. */ +export interface GetAuthenticatorsRequest { + /** MsgGetAuthenticatorsRequest defines the Msg/GetAuthenticators request type. */ + account: string; +} +export interface GetAuthenticatorsRequestProtoMsg { + typeUrl: "/osmosis.smartaccount.v1beta1.GetAuthenticatorsRequest"; + value: Uint8Array; +} +/** MsgGetAuthenticatorsRequest defines the Msg/GetAuthenticators request type. */ +export interface GetAuthenticatorsRequestAmino { + /** MsgGetAuthenticatorsRequest defines the Msg/GetAuthenticators request type. */ + account?: string; +} +export interface GetAuthenticatorsRequestAminoMsg { + type: "osmosis/smartaccount/get-authenticators-request"; + value: GetAuthenticatorsRequestAmino; +} +/** MsgGetAuthenticatorsRequest defines the Msg/GetAuthenticators request type. */ +export interface GetAuthenticatorsRequestSDKType { + account: string; +} +/** MsgGetAuthenticatorsResponse defines the Msg/GetAuthenticators response type. */ +export interface GetAuthenticatorsResponse { + accountAuthenticators: AccountAuthenticator[]; +} +export interface GetAuthenticatorsResponseProtoMsg { + typeUrl: "/osmosis.smartaccount.v1beta1.GetAuthenticatorsResponse"; + value: Uint8Array; +} +/** MsgGetAuthenticatorsResponse defines the Msg/GetAuthenticators response type. */ +export interface GetAuthenticatorsResponseAmino { + account_authenticators?: AccountAuthenticatorAmino[]; +} +export interface GetAuthenticatorsResponseAminoMsg { + type: "osmosis/smartaccount/get-authenticators-response"; + value: GetAuthenticatorsResponseAmino; +} +/** MsgGetAuthenticatorsResponse defines the Msg/GetAuthenticators response type. */ +export interface GetAuthenticatorsResponseSDKType { + account_authenticators: AccountAuthenticatorSDKType[]; +} +/** MsgGetAuthenticatorRequest defines the Msg/GetAuthenticator request type. */ +export interface GetAuthenticatorRequest { + account: string; + authenticatorId: bigint; +} +export interface GetAuthenticatorRequestProtoMsg { + typeUrl: "/osmosis.smartaccount.v1beta1.GetAuthenticatorRequest"; + value: Uint8Array; +} +/** MsgGetAuthenticatorRequest defines the Msg/GetAuthenticator request type. */ +export interface GetAuthenticatorRequestAmino { + account?: string; + authenticator_id?: string; +} +export interface GetAuthenticatorRequestAminoMsg { + type: "osmosis/smartaccount/get-authenticator-request"; + value: GetAuthenticatorRequestAmino; +} +/** MsgGetAuthenticatorRequest defines the Msg/GetAuthenticator request type. */ +export interface GetAuthenticatorRequestSDKType { + account: string; + authenticator_id: bigint; +} +/** MsgGetAuthenticatorResponse defines the Msg/GetAuthenticator response type. */ +export interface GetAuthenticatorResponse { + accountAuthenticator?: AccountAuthenticator | undefined; +} +export interface GetAuthenticatorResponseProtoMsg { + typeUrl: "/osmosis.smartaccount.v1beta1.GetAuthenticatorResponse"; + value: Uint8Array; +} +/** MsgGetAuthenticatorResponse defines the Msg/GetAuthenticator response type. */ +export interface GetAuthenticatorResponseAmino { + account_authenticator?: AccountAuthenticatorAmino | undefined; +} +export interface GetAuthenticatorResponseAminoMsg { + type: "osmosis/smartaccount/get-authenticator-response"; + value: GetAuthenticatorResponseAmino; +} +/** MsgGetAuthenticatorResponse defines the Msg/GetAuthenticator response type. */ +export interface GetAuthenticatorResponseSDKType { + account_authenticator?: AccountAuthenticatorSDKType | undefined; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/osmosis.smartaccount.v1beta1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest, useInterfaces: boolean = false): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsRequest, useInterfaces: boolean = false): QueryParamsRequestAminoMsg { + return { + type: "osmosis/smartaccount/query-params-request", + value: QueryParamsRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg, useInterfaces: boolean = false): QueryParamsRequest { + return QueryParamsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/osmosis.smartaccount.v1beta1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse, useInterfaces: boolean = false): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsResponse, useInterfaces: boolean = false): QueryParamsResponseAminoMsg { + return { + type: "osmosis/smartaccount/query-params-response", + value: QueryParamsResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg, useInterfaces: boolean = false): QueryParamsResponse { + return QueryParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseGetAuthenticatorsRequest(): GetAuthenticatorsRequest { + return { + account: "" + }; +} +export const GetAuthenticatorsRequest = { + typeUrl: "/osmosis.smartaccount.v1beta1.GetAuthenticatorsRequest", + encode(message: GetAuthenticatorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GetAuthenticatorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetAuthenticatorsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetAuthenticatorsRequest { + const message = createBaseGetAuthenticatorsRequest(); + message.account = object.account ?? ""; + return message; + }, + fromAmino(object: GetAuthenticatorsRequestAmino): GetAuthenticatorsRequest { + const message = createBaseGetAuthenticatorsRequest(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + return message; + }, + toAmino(message: GetAuthenticatorsRequest, useInterfaces: boolean = false): GetAuthenticatorsRequestAmino { + const obj: any = {}; + obj.account = message.account; + return obj; + }, + fromAminoMsg(object: GetAuthenticatorsRequestAminoMsg): GetAuthenticatorsRequest { + return GetAuthenticatorsRequest.fromAmino(object.value); + }, + toAminoMsg(message: GetAuthenticatorsRequest, useInterfaces: boolean = false): GetAuthenticatorsRequestAminoMsg { + return { + type: "osmosis/smartaccount/get-authenticators-request", + value: GetAuthenticatorsRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: GetAuthenticatorsRequestProtoMsg, useInterfaces: boolean = false): GetAuthenticatorsRequest { + return GetAuthenticatorsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GetAuthenticatorsRequest): Uint8Array { + return GetAuthenticatorsRequest.encode(message).finish(); + }, + toProtoMsg(message: GetAuthenticatorsRequest): GetAuthenticatorsRequestProtoMsg { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.GetAuthenticatorsRequest", + value: GetAuthenticatorsRequest.encode(message).finish() + }; + } +}; +function createBaseGetAuthenticatorsResponse(): GetAuthenticatorsResponse { + return { + accountAuthenticators: [] + }; +} +export const GetAuthenticatorsResponse = { + typeUrl: "/osmosis.smartaccount.v1beta1.GetAuthenticatorsResponse", + encode(message: GetAuthenticatorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accountAuthenticators) { + AccountAuthenticator.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GetAuthenticatorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetAuthenticatorsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accountAuthenticators.push(AccountAuthenticator.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetAuthenticatorsResponse { + const message = createBaseGetAuthenticatorsResponse(); + message.accountAuthenticators = object.accountAuthenticators?.map(e => AccountAuthenticator.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GetAuthenticatorsResponseAmino): GetAuthenticatorsResponse { + const message = createBaseGetAuthenticatorsResponse(); + message.accountAuthenticators = object.account_authenticators?.map(e => AccountAuthenticator.fromAmino(e)) || []; + return message; + }, + toAmino(message: GetAuthenticatorsResponse, useInterfaces: boolean = false): GetAuthenticatorsResponseAmino { + const obj: any = {}; + if (message.accountAuthenticators) { + obj.account_authenticators = message.accountAuthenticators.map(e => e ? AccountAuthenticator.toAmino(e, useInterfaces) : undefined); + } else { + obj.account_authenticators = []; + } + return obj; + }, + fromAminoMsg(object: GetAuthenticatorsResponseAminoMsg): GetAuthenticatorsResponse { + return GetAuthenticatorsResponse.fromAmino(object.value); + }, + toAminoMsg(message: GetAuthenticatorsResponse, useInterfaces: boolean = false): GetAuthenticatorsResponseAminoMsg { + return { + type: "osmosis/smartaccount/get-authenticators-response", + value: GetAuthenticatorsResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: GetAuthenticatorsResponseProtoMsg, useInterfaces: boolean = false): GetAuthenticatorsResponse { + return GetAuthenticatorsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GetAuthenticatorsResponse): Uint8Array { + return GetAuthenticatorsResponse.encode(message).finish(); + }, + toProtoMsg(message: GetAuthenticatorsResponse): GetAuthenticatorsResponseProtoMsg { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.GetAuthenticatorsResponse", + value: GetAuthenticatorsResponse.encode(message).finish() + }; + } +}; +function createBaseGetAuthenticatorRequest(): GetAuthenticatorRequest { + return { + account: "", + authenticatorId: BigInt(0) + }; +} +export const GetAuthenticatorRequest = { + typeUrl: "/osmosis.smartaccount.v1beta1.GetAuthenticatorRequest", + encode(message: GetAuthenticatorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== "") { + writer.uint32(10).string(message.account); + } + if (message.authenticatorId !== BigInt(0)) { + writer.uint32(16).uint64(message.authenticatorId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GetAuthenticatorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetAuthenticatorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = reader.string(); + break; + case 2: + message.authenticatorId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetAuthenticatorRequest { + const message = createBaseGetAuthenticatorRequest(); + message.account = object.account ?? ""; + message.authenticatorId = object.authenticatorId !== undefined && object.authenticatorId !== null ? BigInt(object.authenticatorId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: GetAuthenticatorRequestAmino): GetAuthenticatorRequest { + const message = createBaseGetAuthenticatorRequest(); + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + if (object.authenticator_id !== undefined && object.authenticator_id !== null) { + message.authenticatorId = BigInt(object.authenticator_id); + } + return message; + }, + toAmino(message: GetAuthenticatorRequest, useInterfaces: boolean = false): GetAuthenticatorRequestAmino { + const obj: any = {}; + obj.account = message.account; + obj.authenticator_id = message.authenticatorId ? message.authenticatorId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: GetAuthenticatorRequestAminoMsg): GetAuthenticatorRequest { + return GetAuthenticatorRequest.fromAmino(object.value); + }, + toAminoMsg(message: GetAuthenticatorRequest, useInterfaces: boolean = false): GetAuthenticatorRequestAminoMsg { + return { + type: "osmosis/smartaccount/get-authenticator-request", + value: GetAuthenticatorRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: GetAuthenticatorRequestProtoMsg, useInterfaces: boolean = false): GetAuthenticatorRequest { + return GetAuthenticatorRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GetAuthenticatorRequest): Uint8Array { + return GetAuthenticatorRequest.encode(message).finish(); + }, + toProtoMsg(message: GetAuthenticatorRequest): GetAuthenticatorRequestProtoMsg { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.GetAuthenticatorRequest", + value: GetAuthenticatorRequest.encode(message).finish() + }; + } +}; +function createBaseGetAuthenticatorResponse(): GetAuthenticatorResponse { + return { + accountAuthenticator: undefined + }; +} +export const GetAuthenticatorResponse = { + typeUrl: "/osmosis.smartaccount.v1beta1.GetAuthenticatorResponse", + encode(message: GetAuthenticatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.accountAuthenticator !== undefined) { + AccountAuthenticator.encode(message.accountAuthenticator, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GetAuthenticatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetAuthenticatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accountAuthenticator = AccountAuthenticator.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetAuthenticatorResponse { + const message = createBaseGetAuthenticatorResponse(); + message.accountAuthenticator = object.accountAuthenticator !== undefined && object.accountAuthenticator !== null ? AccountAuthenticator.fromPartial(object.accountAuthenticator) : undefined; + return message; + }, + fromAmino(object: GetAuthenticatorResponseAmino): GetAuthenticatorResponse { + const message = createBaseGetAuthenticatorResponse(); + if (object.account_authenticator !== undefined && object.account_authenticator !== null) { + message.accountAuthenticator = AccountAuthenticator.fromAmino(object.account_authenticator); + } + return message; + }, + toAmino(message: GetAuthenticatorResponse, useInterfaces: boolean = false): GetAuthenticatorResponseAmino { + const obj: any = {}; + obj.account_authenticator = message.accountAuthenticator ? AccountAuthenticator.toAmino(message.accountAuthenticator, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: GetAuthenticatorResponseAminoMsg): GetAuthenticatorResponse { + return GetAuthenticatorResponse.fromAmino(object.value); + }, + toAminoMsg(message: GetAuthenticatorResponse, useInterfaces: boolean = false): GetAuthenticatorResponseAminoMsg { + return { + type: "osmosis/smartaccount/get-authenticator-response", + value: GetAuthenticatorResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: GetAuthenticatorResponseProtoMsg, useInterfaces: boolean = false): GetAuthenticatorResponse { + return GetAuthenticatorResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GetAuthenticatorResponse): Uint8Array { + return GetAuthenticatorResponse.encode(message).finish(); + }, + toProtoMsg(message: GetAuthenticatorResponse): GetAuthenticatorResponseProtoMsg { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.GetAuthenticatorResponse", + value: GetAuthenticatorResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/tx.amino.ts new file mode 100644 index 000000000..2810b8531 --- /dev/null +++ b/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/tx.amino.ts @@ -0,0 +1,18 @@ +import { MsgAddAuthenticator, MsgRemoveAuthenticator, MsgSetActiveState } from "./tx"; +export const AminoConverter = { + "/osmosis.smartaccount.v1beta1.MsgAddAuthenticator": { + aminoType: "osmosis/MsgAddAuthenticator", + toAmino: MsgAddAuthenticator.toAmino, + fromAmino: MsgAddAuthenticator.fromAmino + }, + "/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator": { + aminoType: "osmosis/MsgRemoveAuthenticator", + toAmino: MsgRemoveAuthenticator.toAmino, + fromAmino: MsgRemoveAuthenticator.fromAmino + }, + "/osmosis.smartaccount.v1beta1.MsgSetActiveState": { + aminoType: "osmosis/MsgSetActiveState", + toAmino: MsgSetActiveState.toAmino, + fromAmino: MsgSetActiveState.fromAmino + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/tx.registry.ts new file mode 100644 index 000000000..93c35f82a --- /dev/null +++ b/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/tx.registry.ts @@ -0,0 +1,71 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgAddAuthenticator, MsgRemoveAuthenticator, MsgSetActiveState } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.smartaccount.v1beta1.MsgAddAuthenticator", MsgAddAuthenticator], ["/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator", MsgRemoveAuthenticator], ["/osmosis.smartaccount.v1beta1.MsgSetActiveState", MsgSetActiveState]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + addAuthenticator(value: MsgAddAuthenticator) { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgAddAuthenticator", + value: MsgAddAuthenticator.encode(value).finish() + }; + }, + removeAuthenticator(value: MsgRemoveAuthenticator) { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator", + value: MsgRemoveAuthenticator.encode(value).finish() + }; + }, + setActiveState(value: MsgSetActiveState) { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgSetActiveState", + value: MsgSetActiveState.encode(value).finish() + }; + } + }, + withTypeUrl: { + addAuthenticator(value: MsgAddAuthenticator) { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgAddAuthenticator", + value + }; + }, + removeAuthenticator(value: MsgRemoveAuthenticator) { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator", + value + }; + }, + setActiveState(value: MsgSetActiveState) { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgSetActiveState", + value + }; + } + }, + fromPartial: { + addAuthenticator(value: MsgAddAuthenticator) { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgAddAuthenticator", + value: MsgAddAuthenticator.fromPartial(value) + }; + }, + removeAuthenticator(value: MsgRemoveAuthenticator) { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator", + value: MsgRemoveAuthenticator.fromPartial(value) + }; + }, + setActiveState(value: MsgSetActiveState) { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgSetActiveState", + value: MsgSetActiveState.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/tx.rpc.msg.ts new file mode 100644 index 000000000..e61c8e225 --- /dev/null +++ b/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,37 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgAddAuthenticator, MsgAddAuthenticatorResponse, MsgRemoveAuthenticator, MsgRemoveAuthenticatorResponse, MsgSetActiveState, MsgSetActiveStateResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + addAuthenticator(request: MsgAddAuthenticator): Promise; + removeAuthenticator(request: MsgRemoveAuthenticator): Promise; + /** + * SetActiveState sets the active state of the authenticator. + * Primarily used for circuit breaking. + */ + setActiveState(request: MsgSetActiveState): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.addAuthenticator = this.addAuthenticator.bind(this); + this.removeAuthenticator = this.removeAuthenticator.bind(this); + this.setActiveState = this.setActiveState.bind(this); + } + addAuthenticator(request: MsgAddAuthenticator, useInterfaces: boolean = true): Promise { + const data = MsgAddAuthenticator.encode(request).finish(); + const promise = this.rpc.request("osmosis.smartaccount.v1beta1.Msg", "AddAuthenticator", data); + return promise.then(data => MsgAddAuthenticatorResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + removeAuthenticator(request: MsgRemoveAuthenticator, useInterfaces: boolean = true): Promise { + const data = MsgRemoveAuthenticator.encode(request).finish(); + const promise = this.rpc.request("osmosis.smartaccount.v1beta1.Msg", "RemoveAuthenticator", data); + return promise.then(data => MsgRemoveAuthenticatorResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + setActiveState(request: MsgSetActiveState, useInterfaces: boolean = true): Promise { + const data = MsgSetActiveState.encode(request).finish(); + const promise = this.rpc.request("osmosis.smartaccount.v1beta1.Msg", "SetActiveState", data); + return promise.then(data => MsgSetActiveStateResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/tx.ts b/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/tx.ts new file mode 100644 index 000000000..82d8d6fee --- /dev/null +++ b/packages/types/protobuf/codegen/osmosis/smartaccount/v1beta1/tx.ts @@ -0,0 +1,717 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** MsgAddAuthenticatorRequest defines the Msg/AddAuthenticator request type. */ +export interface MsgAddAuthenticator { + sender: string; + type: string; + data: Uint8Array; +} +export interface MsgAddAuthenticatorProtoMsg { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgAddAuthenticator"; + value: Uint8Array; +} +/** MsgAddAuthenticatorRequest defines the Msg/AddAuthenticator request type. */ +export interface MsgAddAuthenticatorAmino { + sender?: string; + type?: string; + data?: string; +} +export interface MsgAddAuthenticatorAminoMsg { + type: "osmosis/MsgAddAuthenticator"; + value: MsgAddAuthenticatorAmino; +} +/** MsgAddAuthenticatorRequest defines the Msg/AddAuthenticator request type. */ +export interface MsgAddAuthenticatorSDKType { + sender: string; + type: string; + data: Uint8Array; +} +/** MsgAddAuthenticatorResponse defines the Msg/AddAuthenticator response type. */ +export interface MsgAddAuthenticatorResponse { + /** MsgAddAuthenticatorResponse defines the Msg/AddAuthenticator response type. */ + success: boolean; +} +export interface MsgAddAuthenticatorResponseProtoMsg { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgAddAuthenticatorResponse"; + value: Uint8Array; +} +/** MsgAddAuthenticatorResponse defines the Msg/AddAuthenticator response type. */ +export interface MsgAddAuthenticatorResponseAmino { + /** MsgAddAuthenticatorResponse defines the Msg/AddAuthenticator response type. */ + success?: boolean; +} +export interface MsgAddAuthenticatorResponseAminoMsg { + type: "osmosis/smartaccount/add-authenticator-response"; + value: MsgAddAuthenticatorResponseAmino; +} +/** MsgAddAuthenticatorResponse defines the Msg/AddAuthenticator response type. */ +export interface MsgAddAuthenticatorResponseSDKType { + success: boolean; +} +/** + * MsgRemoveAuthenticatorRequest defines the Msg/RemoveAuthenticator request + * type. + */ +export interface MsgRemoveAuthenticator { + sender: string; + id: bigint; +} +export interface MsgRemoveAuthenticatorProtoMsg { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator"; + value: Uint8Array; +} +/** + * MsgRemoveAuthenticatorRequest defines the Msg/RemoveAuthenticator request + * type. + */ +export interface MsgRemoveAuthenticatorAmino { + sender?: string; + id?: string; +} +export interface MsgRemoveAuthenticatorAminoMsg { + type: "osmosis/MsgRemoveAuthenticator"; + value: MsgRemoveAuthenticatorAmino; +} +/** + * MsgRemoveAuthenticatorRequest defines the Msg/RemoveAuthenticator request + * type. + */ +export interface MsgRemoveAuthenticatorSDKType { + sender: string; + id: bigint; +} +/** + * MsgRemoveAuthenticatorResponse defines the Msg/RemoveAuthenticator response + * type. + */ +export interface MsgRemoveAuthenticatorResponse { + /** + * MsgRemoveAuthenticatorResponse defines the Msg/RemoveAuthenticator response + * type. + */ + success: boolean; +} +export interface MsgRemoveAuthenticatorResponseProtoMsg { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticatorResponse"; + value: Uint8Array; +} +/** + * MsgRemoveAuthenticatorResponse defines the Msg/RemoveAuthenticator response + * type. + */ +export interface MsgRemoveAuthenticatorResponseAmino { + /** + * MsgRemoveAuthenticatorResponse defines the Msg/RemoveAuthenticator response + * type. + */ + success?: boolean; +} +export interface MsgRemoveAuthenticatorResponseAminoMsg { + type: "osmosis/smartaccount/remove-authenticator-response"; + value: MsgRemoveAuthenticatorResponseAmino; +} +/** + * MsgRemoveAuthenticatorResponse defines the Msg/RemoveAuthenticator response + * type. + */ +export interface MsgRemoveAuthenticatorResponseSDKType { + success: boolean; +} +export interface MsgSetActiveState { + sender: string; + active: boolean; +} +export interface MsgSetActiveStateProtoMsg { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgSetActiveState"; + value: Uint8Array; +} +export interface MsgSetActiveStateAmino { + sender?: string; + active?: boolean; +} +export interface MsgSetActiveStateAminoMsg { + type: "osmosis/MsgSetActiveState"; + value: MsgSetActiveStateAmino; +} +export interface MsgSetActiveStateSDKType { + sender: string; + active: boolean; +} +export interface MsgSetActiveStateResponse {} +export interface MsgSetActiveStateResponseProtoMsg { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgSetActiveStateResponse"; + value: Uint8Array; +} +export interface MsgSetActiveStateResponseAmino {} +export interface MsgSetActiveStateResponseAminoMsg { + type: "osmosis/smartaccount/set-active-state-response"; + value: MsgSetActiveStateResponseAmino; +} +export interface MsgSetActiveStateResponseSDKType {} +/** + * TxExtension allows for additional authenticator-specific data in + * transactions. + */ +export interface TxExtension { + /** + * selected_authenticators holds the authenticator_id for the chosen + * authenticator per message. + */ + selectedAuthenticators: bigint[]; +} +export interface TxExtensionProtoMsg { + typeUrl: "/osmosis.smartaccount.v1beta1.TxExtension"; + value: Uint8Array; +} +/** + * TxExtension allows for additional authenticator-specific data in + * transactions. + */ +export interface TxExtensionAmino { + /** + * selected_authenticators holds the authenticator_id for the chosen + * authenticator per message. + */ + selected_authenticators?: string[]; +} +export interface TxExtensionAminoMsg { + type: "osmosis/smartaccount/tx-extension"; + value: TxExtensionAmino; +} +/** + * TxExtension allows for additional authenticator-specific data in + * transactions. + */ +export interface TxExtensionSDKType { + selected_authenticators: bigint[]; +} +function createBaseMsgAddAuthenticator(): MsgAddAuthenticator { + return { + sender: "", + type: "", + data: new Uint8Array() + }; +} +export const MsgAddAuthenticator = { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgAddAuthenticator", + encode(message: MsgAddAuthenticator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + if (message.data.length !== 0) { + writer.uint32(26).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgAddAuthenticator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddAuthenticator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.type = reader.string(); + break; + case 3: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgAddAuthenticator { + const message = createBaseMsgAddAuthenticator(); + message.sender = object.sender ?? ""; + message.type = object.type ?? ""; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgAddAuthenticatorAmino): MsgAddAuthenticator { + const message = createBaseMsgAddAuthenticator(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgAddAuthenticator, useInterfaces: boolean = false): MsgAddAuthenticatorAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.type = message.type; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgAddAuthenticatorAminoMsg): MsgAddAuthenticator { + return MsgAddAuthenticator.fromAmino(object.value); + }, + toAminoMsg(message: MsgAddAuthenticator, useInterfaces: boolean = false): MsgAddAuthenticatorAminoMsg { + return { + type: "osmosis/MsgAddAuthenticator", + value: MsgAddAuthenticator.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgAddAuthenticatorProtoMsg, useInterfaces: boolean = false): MsgAddAuthenticator { + return MsgAddAuthenticator.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgAddAuthenticator): Uint8Array { + return MsgAddAuthenticator.encode(message).finish(); + }, + toProtoMsg(message: MsgAddAuthenticator): MsgAddAuthenticatorProtoMsg { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgAddAuthenticator", + value: MsgAddAuthenticator.encode(message).finish() + }; + } +}; +function createBaseMsgAddAuthenticatorResponse(): MsgAddAuthenticatorResponse { + return { + success: false + }; +} +export const MsgAddAuthenticatorResponse = { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgAddAuthenticatorResponse", + encode(message: MsgAddAuthenticatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.success === true) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgAddAuthenticatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAddAuthenticatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.success = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgAddAuthenticatorResponse { + const message = createBaseMsgAddAuthenticatorResponse(); + message.success = object.success ?? false; + return message; + }, + fromAmino(object: MsgAddAuthenticatorResponseAmino): MsgAddAuthenticatorResponse { + const message = createBaseMsgAddAuthenticatorResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + return message; + }, + toAmino(message: MsgAddAuthenticatorResponse, useInterfaces: boolean = false): MsgAddAuthenticatorResponseAmino { + const obj: any = {}; + obj.success = message.success; + return obj; + }, + fromAminoMsg(object: MsgAddAuthenticatorResponseAminoMsg): MsgAddAuthenticatorResponse { + return MsgAddAuthenticatorResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgAddAuthenticatorResponse, useInterfaces: boolean = false): MsgAddAuthenticatorResponseAminoMsg { + return { + type: "osmosis/smartaccount/add-authenticator-response", + value: MsgAddAuthenticatorResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgAddAuthenticatorResponseProtoMsg, useInterfaces: boolean = false): MsgAddAuthenticatorResponse { + return MsgAddAuthenticatorResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgAddAuthenticatorResponse): Uint8Array { + return MsgAddAuthenticatorResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAddAuthenticatorResponse): MsgAddAuthenticatorResponseProtoMsg { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgAddAuthenticatorResponse", + value: MsgAddAuthenticatorResponse.encode(message).finish() + }; + } +}; +function createBaseMsgRemoveAuthenticator(): MsgRemoveAuthenticator { + return { + sender: "", + id: BigInt(0) + }; +} +export const MsgRemoveAuthenticator = { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator", + encode(message: MsgRemoveAuthenticator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.id !== BigInt(0)) { + writer.uint32(16).uint64(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRemoveAuthenticator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRemoveAuthenticator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.id = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRemoveAuthenticator { + const message = createBaseMsgRemoveAuthenticator(); + message.sender = object.sender ?? ""; + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgRemoveAuthenticatorAmino): MsgRemoveAuthenticator { + const message = createBaseMsgRemoveAuthenticator(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + return message; + }, + toAmino(message: MsgRemoveAuthenticator, useInterfaces: boolean = false): MsgRemoveAuthenticatorAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.id = message.id ? message.id.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgRemoveAuthenticatorAminoMsg): MsgRemoveAuthenticator { + return MsgRemoveAuthenticator.fromAmino(object.value); + }, + toAminoMsg(message: MsgRemoveAuthenticator, useInterfaces: boolean = false): MsgRemoveAuthenticatorAminoMsg { + return { + type: "osmosis/MsgRemoveAuthenticator", + value: MsgRemoveAuthenticator.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgRemoveAuthenticatorProtoMsg, useInterfaces: boolean = false): MsgRemoveAuthenticator { + return MsgRemoveAuthenticator.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgRemoveAuthenticator): Uint8Array { + return MsgRemoveAuthenticator.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveAuthenticator): MsgRemoveAuthenticatorProtoMsg { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticator", + value: MsgRemoveAuthenticator.encode(message).finish() + }; + } +}; +function createBaseMsgRemoveAuthenticatorResponse(): MsgRemoveAuthenticatorResponse { + return { + success: false + }; +} +export const MsgRemoveAuthenticatorResponse = { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticatorResponse", + encode(message: MsgRemoveAuthenticatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.success === true) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRemoveAuthenticatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRemoveAuthenticatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.success = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRemoveAuthenticatorResponse { + const message = createBaseMsgRemoveAuthenticatorResponse(); + message.success = object.success ?? false; + return message; + }, + fromAmino(object: MsgRemoveAuthenticatorResponseAmino): MsgRemoveAuthenticatorResponse { + const message = createBaseMsgRemoveAuthenticatorResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + return message; + }, + toAmino(message: MsgRemoveAuthenticatorResponse, useInterfaces: boolean = false): MsgRemoveAuthenticatorResponseAmino { + const obj: any = {}; + obj.success = message.success; + return obj; + }, + fromAminoMsg(object: MsgRemoveAuthenticatorResponseAminoMsg): MsgRemoveAuthenticatorResponse { + return MsgRemoveAuthenticatorResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgRemoveAuthenticatorResponse, useInterfaces: boolean = false): MsgRemoveAuthenticatorResponseAminoMsg { + return { + type: "osmosis/smartaccount/remove-authenticator-response", + value: MsgRemoveAuthenticatorResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgRemoveAuthenticatorResponseProtoMsg, useInterfaces: boolean = false): MsgRemoveAuthenticatorResponse { + return MsgRemoveAuthenticatorResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgRemoveAuthenticatorResponse): Uint8Array { + return MsgRemoveAuthenticatorResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveAuthenticatorResponse): MsgRemoveAuthenticatorResponseProtoMsg { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgRemoveAuthenticatorResponse", + value: MsgRemoveAuthenticatorResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetActiveState(): MsgSetActiveState { + return { + sender: "", + active: false + }; +} +export const MsgSetActiveState = { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgSetActiveState", + encode(message: MsgSetActiveState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.active === true) { + writer.uint32(16).bool(message.active); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetActiveState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetActiveState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.active = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetActiveState { + const message = createBaseMsgSetActiveState(); + message.sender = object.sender ?? ""; + message.active = object.active ?? false; + return message; + }, + fromAmino(object: MsgSetActiveStateAmino): MsgSetActiveState { + const message = createBaseMsgSetActiveState(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.active !== undefined && object.active !== null) { + message.active = object.active; + } + return message; + }, + toAmino(message: MsgSetActiveState, useInterfaces: boolean = false): MsgSetActiveStateAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.active = message.active; + return obj; + }, + fromAminoMsg(object: MsgSetActiveStateAminoMsg): MsgSetActiveState { + return MsgSetActiveState.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetActiveState, useInterfaces: boolean = false): MsgSetActiveStateAminoMsg { + return { + type: "osmosis/MsgSetActiveState", + value: MsgSetActiveState.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgSetActiveStateProtoMsg, useInterfaces: boolean = false): MsgSetActiveState { + return MsgSetActiveState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetActiveState): Uint8Array { + return MsgSetActiveState.encode(message).finish(); + }, + toProtoMsg(message: MsgSetActiveState): MsgSetActiveStateProtoMsg { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgSetActiveState", + value: MsgSetActiveState.encode(message).finish() + }; + } +}; +function createBaseMsgSetActiveStateResponse(): MsgSetActiveStateResponse { + return {}; +} +export const MsgSetActiveStateResponse = { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgSetActiveStateResponse", + encode(_: MsgSetActiveStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSetActiveStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetActiveStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetActiveStateResponse { + const message = createBaseMsgSetActiveStateResponse(); + return message; + }, + fromAmino(_: MsgSetActiveStateResponseAmino): MsgSetActiveStateResponse { + const message = createBaseMsgSetActiveStateResponse(); + return message; + }, + toAmino(_: MsgSetActiveStateResponse, useInterfaces: boolean = false): MsgSetActiveStateResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetActiveStateResponseAminoMsg): MsgSetActiveStateResponse { + return MsgSetActiveStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetActiveStateResponse, useInterfaces: boolean = false): MsgSetActiveStateResponseAminoMsg { + return { + type: "osmosis/smartaccount/set-active-state-response", + value: MsgSetActiveStateResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgSetActiveStateResponseProtoMsg, useInterfaces: boolean = false): MsgSetActiveStateResponse { + return MsgSetActiveStateResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSetActiveStateResponse): Uint8Array { + return MsgSetActiveStateResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetActiveStateResponse): MsgSetActiveStateResponseProtoMsg { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.MsgSetActiveStateResponse", + value: MsgSetActiveStateResponse.encode(message).finish() + }; + } +}; +function createBaseTxExtension(): TxExtension { + return { + selectedAuthenticators: [] + }; +} +export const TxExtension = { + typeUrl: "/osmosis.smartaccount.v1beta1.TxExtension", + encode(message: TxExtension, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.selectedAuthenticators) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): TxExtension { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxExtension(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.selectedAuthenticators.push(reader.uint64()); + } + } else { + message.selectedAuthenticators.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxExtension { + const message = createBaseTxExtension(); + message.selectedAuthenticators = object.selectedAuthenticators?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: TxExtensionAmino): TxExtension { + const message = createBaseTxExtension(); + message.selectedAuthenticators = object.selected_authenticators?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: TxExtension, useInterfaces: boolean = false): TxExtensionAmino { + const obj: any = {}; + if (message.selectedAuthenticators) { + obj.selected_authenticators = message.selectedAuthenticators.map(e => e.toString()); + } else { + obj.selected_authenticators = []; + } + return obj; + }, + fromAminoMsg(object: TxExtensionAminoMsg): TxExtension { + return TxExtension.fromAmino(object.value); + }, + toAminoMsg(message: TxExtension, useInterfaces: boolean = false): TxExtensionAminoMsg { + return { + type: "osmosis/smartaccount/tx-extension", + value: TxExtension.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: TxExtensionProtoMsg, useInterfaces: boolean = false): TxExtension { + return TxExtension.decode(message.value, undefined, useInterfaces); + }, + toProto(message: TxExtension): Uint8Array { + return TxExtension.encode(message).finish(); + }, + toProtoMsg(message: TxExtension): TxExtensionProtoMsg { + return { + typeUrl: "/osmosis.smartaccount.v1beta1.TxExtension", + value: TxExtension.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/bundle.ts b/packages/types/protobuf/codegen/pstake/bundle.ts index 1d736c630..4263003c8 100644 --- a/packages/types/protobuf/codegen/pstake/bundle.ts +++ b/packages/types/protobuf/codegen/pstake/bundle.ts @@ -1,98 +1,98 @@ -import * as _270 from "./liquidstake/v1beta1/genesis"; -import * as _271 from "./liquidstake/v1beta1/liquidstake"; -import * as _272 from "./liquidstake/v1beta1/query"; -import * as _273 from "./liquidstake/v1beta1/tx"; -import * as _274 from "./liquidstakeibc/v1beta1/genesis"; -import * as _275 from "./liquidstakeibc/v1beta1/liquidstakeibc"; -import * as _276 from "./liquidstakeibc/v1beta1/msgs"; -import * as _277 from "./liquidstakeibc/v1beta1/params"; -import * as _278 from "./liquidstakeibc/v1beta1/query"; -import * as _279 from "./lscosmos/v1beta1/genesis"; -import * as _280 from "./lscosmos/v1beta1/governance_proposal"; -import * as _281 from "./lscosmos/v1beta1/lscosmos"; -import * as _282 from "./lscosmos/v1beta1/msgs"; -import * as _283 from "./lscosmos/v1beta1/params"; -import * as _284 from "./lscosmos/v1beta1/query"; -import * as _285 from "./ratesync/v1beta1/contract"; -import * as _286 from "./ratesync/v1beta1/genesis"; -import * as _287 from "./ratesync/v1beta1/params"; -import * as _288 from "./ratesync/v1beta1/query"; -import * as _289 from "./ratesync/v1beta1/ratesync"; -import * as _290 from "./ratesync/v1beta1/tx"; -import * as _535 from "./liquidstake/v1beta1/tx.amino"; -import * as _536 from "./liquidstakeibc/v1beta1/msgs.amino"; -import * as _537 from "./lscosmos/v1beta1/msgs.amino"; -import * as _538 from "./ratesync/v1beta1/tx.amino"; -import * as _539 from "./liquidstake/v1beta1/tx.registry"; -import * as _540 from "./liquidstakeibc/v1beta1/msgs.registry"; -import * as _541 from "./lscosmos/v1beta1/msgs.registry"; -import * as _542 from "./ratesync/v1beta1/tx.registry"; -import * as _543 from "./liquidstake/v1beta1/query.rpc.Query"; -import * as _544 from "./liquidstakeibc/v1beta1/query.rpc.Query"; -import * as _545 from "./lscosmos/v1beta1/query.rpc.Query"; -import * as _546 from "./ratesync/v1beta1/query.rpc.Query"; -import * as _547 from "./liquidstake/v1beta1/tx.rpc.msg"; -import * as _548 from "./liquidstakeibc/v1beta1/msgs.rpc.msg"; -import * as _549 from "./lscosmos/v1beta1/msgs.rpc.msg"; -import * as _550 from "./ratesync/v1beta1/tx.rpc.msg"; -import * as _608 from "./rpc.query"; -import * as _609 from "./rpc.tx"; +import * as _275 from "./liquidstake/v1beta1/genesis"; +import * as _276 from "./liquidstake/v1beta1/liquidstake"; +import * as _277 from "./liquidstake/v1beta1/query"; +import * as _278 from "./liquidstake/v1beta1/tx"; +import * as _279 from "./liquidstakeibc/v1beta1/genesis"; +import * as _280 from "./liquidstakeibc/v1beta1/liquidstakeibc"; +import * as _281 from "./liquidstakeibc/v1beta1/msgs"; +import * as _282 from "./liquidstakeibc/v1beta1/params"; +import * as _283 from "./liquidstakeibc/v1beta1/query"; +import * as _284 from "./lscosmos/v1beta1/genesis"; +import * as _285 from "./lscosmos/v1beta1/governance_proposal"; +import * as _286 from "./lscosmos/v1beta1/lscosmos"; +import * as _287 from "./lscosmos/v1beta1/msgs"; +import * as _288 from "./lscosmos/v1beta1/params"; +import * as _289 from "./lscosmos/v1beta1/query"; +import * as _290 from "./ratesync/v1beta1/contract"; +import * as _291 from "./ratesync/v1beta1/genesis"; +import * as _292 from "./ratesync/v1beta1/params"; +import * as _293 from "./ratesync/v1beta1/query"; +import * as _294 from "./ratesync/v1beta1/ratesync"; +import * as _295 from "./ratesync/v1beta1/tx"; +import * as _544 from "./liquidstake/v1beta1/tx.amino"; +import * as _545 from "./liquidstakeibc/v1beta1/msgs.amino"; +import * as _546 from "./lscosmos/v1beta1/msgs.amino"; +import * as _547 from "./ratesync/v1beta1/tx.amino"; +import * as _548 from "./liquidstake/v1beta1/tx.registry"; +import * as _549 from "./liquidstakeibc/v1beta1/msgs.registry"; +import * as _550 from "./lscosmos/v1beta1/msgs.registry"; +import * as _551 from "./ratesync/v1beta1/tx.registry"; +import * as _552 from "./liquidstake/v1beta1/query.rpc.Query"; +import * as _553 from "./liquidstakeibc/v1beta1/query.rpc.Query"; +import * as _554 from "./lscosmos/v1beta1/query.rpc.Query"; +import * as _555 from "./ratesync/v1beta1/query.rpc.Query"; +import * as _556 from "./liquidstake/v1beta1/tx.rpc.msg"; +import * as _557 from "./liquidstakeibc/v1beta1/msgs.rpc.msg"; +import * as _558 from "./lscosmos/v1beta1/msgs.rpc.msg"; +import * as _559 from "./ratesync/v1beta1/tx.rpc.msg"; +import * as _617 from "./rpc.query"; +import * as _618 from "./rpc.tx"; export namespace pstake { export namespace liquidstake { export const v1beta1 = { - ..._270, - ..._271, - ..._272, - ..._273, - ..._535, - ..._539, - ..._543, - ..._547 - }; - } - export namespace liquidstakeibc { - export const v1beta1 = { - ..._274, ..._275, ..._276, ..._277, ..._278, - ..._536, - ..._540, ..._544, - ..._548 + ..._548, + ..._552, + ..._556 }; } - export namespace lscosmos { + export namespace liquidstakeibc { export const v1beta1 = { ..._279, ..._280, ..._281, ..._282, ..._283, - ..._284, - ..._537, - ..._541, ..._545, - ..._549 + ..._549, + ..._553, + ..._557 }; } - export namespace ratesync { + export namespace lscosmos { export const v1beta1 = { + ..._284, ..._285, ..._286, ..._287, ..._288, ..._289, - ..._290, - ..._538, - ..._542, ..._546, - ..._550 + ..._550, + ..._554, + ..._558 + }; + } + export namespace ratesync { + export const v1beta1 = { + ..._290, + ..._291, + ..._292, + ..._293, + ..._294, + ..._295, + ..._547, + ..._551, + ..._555, + ..._559 }; } export const ClientFactory = { - ..._608, - ..._609 + ..._617, + ..._618 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/publicawesome/bundle.ts b/packages/types/protobuf/codegen/publicawesome/bundle.ts index efd643fee..86dbb1e3c 100644 --- a/packages/types/protobuf/codegen/publicawesome/bundle.ts +++ b/packages/types/protobuf/codegen/publicawesome/bundle.ts @@ -1,88 +1,88 @@ -import * as _291 from "./stargaze/alloc/v1beta1/genesis"; -import * as _292 from "./stargaze/alloc/v1beta1/params"; -import * as _293 from "./stargaze/alloc/v1beta1/query"; -import * as _294 from "./stargaze/alloc/v1beta1/tx"; -import * as _295 from "./stargaze/cron/v1/cron"; -import * as _296 from "./stargaze/cron/v1/genesis"; -import * as _297 from "./stargaze/cron/v1/proposal"; -import * as _298 from "./stargaze/cron/v1/query"; -import * as _299 from "./stargaze/cron/v1/tx"; -import * as _300 from "./stargaze/globalfee/v1/genesis"; -import * as _301 from "./stargaze/globalfee/v1/globalfee"; -import * as _302 from "./stargaze/globalfee/v1/proposal"; -import * as _303 from "./stargaze/globalfee/v1/query"; -import * as _304 from "./stargaze/globalfee/v1/tx"; -import * as _305 from "./stargaze/mint/v1beta1/genesis"; -import * as _306 from "./stargaze/mint/v1beta1/mint"; -import * as _307 from "./stargaze/mint/v1beta1/query"; -import * as _308 from "./stargaze/mint/v1beta1/tx"; -import * as _551 from "./stargaze/alloc/v1beta1/tx.amino"; -import * as _552 from "./stargaze/cron/v1/tx.amino"; -import * as _553 from "./stargaze/globalfee/v1/tx.amino"; -import * as _554 from "./stargaze/alloc/v1beta1/tx.registry"; -import * as _555 from "./stargaze/cron/v1/tx.registry"; -import * as _556 from "./stargaze/globalfee/v1/tx.registry"; -import * as _557 from "./stargaze/alloc/v1beta1/query.rpc.Query"; -import * as _558 from "./stargaze/cron/v1/query.rpc.Query"; -import * as _559 from "./stargaze/globalfee/v1/query.rpc.Query"; -import * as _560 from "./stargaze/mint/v1beta1/query.rpc.Query"; -import * as _561 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; -import * as _562 from "./stargaze/cron/v1/tx.rpc.msg"; -import * as _563 from "./stargaze/globalfee/v1/tx.rpc.msg"; -import * as _610 from "./rpc.query"; -import * as _611 from "./rpc.tx"; +import * as _296 from "./stargaze/alloc/v1beta1/genesis"; +import * as _297 from "./stargaze/alloc/v1beta1/params"; +import * as _298 from "./stargaze/alloc/v1beta1/query"; +import * as _299 from "./stargaze/alloc/v1beta1/tx"; +import * as _300 from "./stargaze/cron/v1/cron"; +import * as _301 from "./stargaze/cron/v1/genesis"; +import * as _302 from "./stargaze/cron/v1/proposal"; +import * as _303 from "./stargaze/cron/v1/query"; +import * as _304 from "./stargaze/cron/v1/tx"; +import * as _305 from "./stargaze/globalfee/v1/genesis"; +import * as _306 from "./stargaze/globalfee/v1/globalfee"; +import * as _307 from "./stargaze/globalfee/v1/proposal"; +import * as _308 from "./stargaze/globalfee/v1/query"; +import * as _309 from "./stargaze/globalfee/v1/tx"; +import * as _310 from "./stargaze/mint/v1beta1/genesis"; +import * as _311 from "./stargaze/mint/v1beta1/mint"; +import * as _312 from "./stargaze/mint/v1beta1/query"; +import * as _313 from "./stargaze/mint/v1beta1/tx"; +import * as _560 from "./stargaze/alloc/v1beta1/tx.amino"; +import * as _561 from "./stargaze/cron/v1/tx.amino"; +import * as _562 from "./stargaze/globalfee/v1/tx.amino"; +import * as _563 from "./stargaze/alloc/v1beta1/tx.registry"; +import * as _564 from "./stargaze/cron/v1/tx.registry"; +import * as _565 from "./stargaze/globalfee/v1/tx.registry"; +import * as _566 from "./stargaze/alloc/v1beta1/query.rpc.Query"; +import * as _567 from "./stargaze/cron/v1/query.rpc.Query"; +import * as _568 from "./stargaze/globalfee/v1/query.rpc.Query"; +import * as _569 from "./stargaze/mint/v1beta1/query.rpc.Query"; +import * as _570 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; +import * as _571 from "./stargaze/cron/v1/tx.rpc.msg"; +import * as _572 from "./stargaze/globalfee/v1/tx.rpc.msg"; +import * as _619 from "./rpc.query"; +import * as _620 from "./rpc.tx"; export namespace publicawesome { export namespace stargaze { export namespace alloc { export const v1beta1 = { - ..._291, - ..._292, - ..._293, - ..._294, - ..._551, - ..._554, - ..._557, - ..._561 - }; - } - export namespace cron { - export const v1 = { - ..._295, ..._296, ..._297, ..._298, ..._299, - ..._552, - ..._555, - ..._558, - ..._562 + ..._560, + ..._563, + ..._566, + ..._570 }; } - export namespace globalfee { + export namespace cron { export const v1 = { ..._300, ..._301, ..._302, ..._303, ..._304, - ..._553, - ..._556, - ..._559, - ..._563 + ..._561, + ..._564, + ..._567, + ..._571 }; } - export namespace mint { - export const v1beta1 = { + export namespace globalfee { + export const v1 = { ..._305, ..._306, ..._307, ..._308, - ..._560 + ..._309, + ..._562, + ..._565, + ..._568, + ..._572 + }; + } + export namespace mint { + export const v1beta1 = { + ..._310, + ..._311, + ..._312, + ..._313, + ..._569 }; } } export const ClientFactory = { - ..._610, - ..._611 + ..._619, + ..._620 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/regen/bundle.ts b/packages/types/protobuf/codegen/regen/bundle.ts index 0740d9519..efc75e00e 100644 --- a/packages/types/protobuf/codegen/regen/bundle.ts +++ b/packages/types/protobuf/codegen/regen/bundle.ts @@ -1,134 +1,134 @@ -import * as _309 from "./data/v1/events"; -import * as _310 from "./data/v1/state"; -import * as _311 from "./data/v1/tx"; -import * as _312 from "./data/v1/types"; -import * as _313 from "./data/v2/events"; -import * as _314 from "./data/v2/state"; -import * as _315 from "./data/v2/tx"; -import * as _316 from "./data/v2/types"; -import * as _317 from "./ecocredit/basket/v1/events"; -import * as _318 from "./ecocredit/basket/v1/state"; -import * as _319 from "./ecocredit/basket/v1/tx"; -import * as _320 from "./ecocredit/basket/v1/types"; -import * as _321 from "./ecocredit/marketplace/v1/events"; -import * as _322 from "./ecocredit/marketplace/v1/state"; -import * as _323 from "./ecocredit/marketplace/v1/tx"; -import * as _324 from "./ecocredit/marketplace/v1/types"; -import * as _325 from "./ecocredit/orderbook/v1alpha1/memory"; -import * as _326 from "./ecocredit/v1/events"; -import * as _327 from "./ecocredit/v1/state"; -import * as _328 from "./ecocredit/v1/tx"; -import * as _329 from "./ecocredit/v1/types"; -import * as _330 from "./ecocredit/v1alpha1/events"; -import * as _331 from "./ecocredit/v1alpha1/genesis"; -import * as _332 from "./ecocredit/v1alpha1/tx"; -import * as _333 from "./ecocredit/v1alpha1/types"; -import * as _334 from "./intertx/v1/query"; -import * as _335 from "./intertx/v1/tx"; -import * as _564 from "./data/v1/tx.amino"; -import * as _565 from "./data/v2/tx.amino"; -import * as _566 from "./ecocredit/basket/v1/tx.amino"; -import * as _567 from "./ecocredit/marketplace/v1/tx.amino"; -import * as _568 from "./ecocredit/v1/tx.amino"; -import * as _569 from "./ecocredit/v1alpha1/tx.amino"; -import * as _570 from "./intertx/v1/tx.amino"; -import * as _571 from "./data/v1/tx.registry"; -import * as _572 from "./data/v2/tx.registry"; -import * as _573 from "./ecocredit/basket/v1/tx.registry"; -import * as _574 from "./ecocredit/marketplace/v1/tx.registry"; -import * as _575 from "./ecocredit/v1/tx.registry"; -import * as _576 from "./ecocredit/v1alpha1/tx.registry"; -import * as _577 from "./intertx/v1/tx.registry"; -import * as _578 from "./intertx/v1/query.rpc.Query"; -import * as _579 from "./data/v1/tx.rpc.msg"; -import * as _580 from "./data/v2/tx.rpc.msg"; -import * as _581 from "./ecocredit/basket/v1/tx.rpc.msg"; -import * as _582 from "./ecocredit/marketplace/v1/tx.rpc.msg"; -import * as _583 from "./ecocredit/v1/tx.rpc.msg"; -import * as _584 from "./ecocredit/v1alpha1/tx.rpc.msg"; -import * as _585 from "./intertx/v1/tx.rpc.msg"; -import * as _612 from "./rpc.query"; -import * as _613 from "./rpc.tx"; +import * as _314 from "./data/v1/events"; +import * as _315 from "./data/v1/state"; +import * as _316 from "./data/v1/tx"; +import * as _317 from "./data/v1/types"; +import * as _318 from "./data/v2/events"; +import * as _319 from "./data/v2/state"; +import * as _320 from "./data/v2/tx"; +import * as _321 from "./data/v2/types"; +import * as _322 from "./ecocredit/basket/v1/events"; +import * as _323 from "./ecocredit/basket/v1/state"; +import * as _324 from "./ecocredit/basket/v1/tx"; +import * as _325 from "./ecocredit/basket/v1/types"; +import * as _326 from "./ecocredit/marketplace/v1/events"; +import * as _327 from "./ecocredit/marketplace/v1/state"; +import * as _328 from "./ecocredit/marketplace/v1/tx"; +import * as _329 from "./ecocredit/marketplace/v1/types"; +import * as _330 from "./ecocredit/orderbook/v1alpha1/memory"; +import * as _331 from "./ecocredit/v1/events"; +import * as _332 from "./ecocredit/v1/state"; +import * as _333 from "./ecocredit/v1/tx"; +import * as _334 from "./ecocredit/v1/types"; +import * as _335 from "./ecocredit/v1alpha1/events"; +import * as _336 from "./ecocredit/v1alpha1/genesis"; +import * as _337 from "./ecocredit/v1alpha1/tx"; +import * as _338 from "./ecocredit/v1alpha1/types"; +import * as _339 from "./intertx/v1/query"; +import * as _340 from "./intertx/v1/tx"; +import * as _573 from "./data/v1/tx.amino"; +import * as _574 from "./data/v2/tx.amino"; +import * as _575 from "./ecocredit/basket/v1/tx.amino"; +import * as _576 from "./ecocredit/marketplace/v1/tx.amino"; +import * as _577 from "./ecocredit/v1/tx.amino"; +import * as _578 from "./ecocredit/v1alpha1/tx.amino"; +import * as _579 from "./intertx/v1/tx.amino"; +import * as _580 from "./data/v1/tx.registry"; +import * as _581 from "./data/v2/tx.registry"; +import * as _582 from "./ecocredit/basket/v1/tx.registry"; +import * as _583 from "./ecocredit/marketplace/v1/tx.registry"; +import * as _584 from "./ecocredit/v1/tx.registry"; +import * as _585 from "./ecocredit/v1alpha1/tx.registry"; +import * as _586 from "./intertx/v1/tx.registry"; +import * as _587 from "./intertx/v1/query.rpc.Query"; +import * as _588 from "./data/v1/tx.rpc.msg"; +import * as _589 from "./data/v2/tx.rpc.msg"; +import * as _590 from "./ecocredit/basket/v1/tx.rpc.msg"; +import * as _591 from "./ecocredit/marketplace/v1/tx.rpc.msg"; +import * as _592 from "./ecocredit/v1/tx.rpc.msg"; +import * as _593 from "./ecocredit/v1alpha1/tx.rpc.msg"; +import * as _594 from "./intertx/v1/tx.rpc.msg"; +import * as _621 from "./rpc.query"; +import * as _622 from "./rpc.tx"; export namespace regen { export namespace data { export const v1 = { - ..._309, - ..._310, - ..._311, - ..._312, - ..._564, - ..._571, - ..._579 - }; - export const v2 = { - ..._313, ..._314, ..._315, ..._316, - ..._565, - ..._572, - ..._580 + ..._317, + ..._573, + ..._580, + ..._588 + }; + export const v2 = { + ..._318, + ..._319, + ..._320, + ..._321, + ..._574, + ..._581, + ..._589 }; } export namespace ecocredit { export namespace basket { export const v1 = { - ..._317, - ..._318, - ..._319, - ..._320, - ..._566, - ..._573, - ..._581 + ..._322, + ..._323, + ..._324, + ..._325, + ..._575, + ..._582, + ..._590 }; } export namespace marketplace { export const v1 = { - ..._321, - ..._322, - ..._323, - ..._324, - ..._567, - ..._574, - ..._582 + ..._326, + ..._327, + ..._328, + ..._329, + ..._576, + ..._583, + ..._591 }; } export namespace orderbook { export const v1alpha1 = { - ..._325 + ..._330 }; } export const v1 = { - ..._326, - ..._327, - ..._328, - ..._329, - ..._568, - ..._575, - ..._583 - }; - export const v1alpha1 = { - ..._330, ..._331, ..._332, ..._333, - ..._569, - ..._576, - ..._584 + ..._334, + ..._577, + ..._584, + ..._592 + }; + export const v1alpha1 = { + ..._335, + ..._336, + ..._337, + ..._338, + ..._578, + ..._585, + ..._593 }; } export namespace intertx { export const v1 = { - ..._334, - ..._335, - ..._570, - ..._577, - ..._578, - ..._585 + ..._339, + ..._340, + ..._579, + ..._586, + ..._587, + ..._594 }; } export const ClientFactory = { - ..._612, - ..._613 + ..._621, + ..._622 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/tendermint/bundle.ts b/packages/types/protobuf/codegen/tendermint/bundle.ts index 1beadd9c9..6516ee341 100644 --- a/packages/types/protobuf/codegen/tendermint/bundle.ts +++ b/packages/types/protobuf/codegen/tendermint/bundle.ts @@ -1,32 +1,32 @@ -import * as _339 from "./abci/types"; -import * as _340 from "./crypto/keys"; -import * as _341 from "./crypto/proof"; -import * as _342 from "./p2p/types"; -import * as _343 from "./types/block"; -import * as _344 from "./types/evidence"; -import * as _345 from "./types/params"; -import * as _346 from "./types/types"; -import * as _347 from "./types/validator"; -import * as _348 from "./version/types"; +import * as _344 from "./abci/types"; +import * as _345 from "./crypto/keys"; +import * as _346 from "./crypto/proof"; +import * as _347 from "./p2p/types"; +import * as _348 from "./types/block"; +import * as _349 from "./types/evidence"; +import * as _350 from "./types/params"; +import * as _351 from "./types/types"; +import * as _352 from "./types/validator"; +import * as _353 from "./version/types"; export namespace tendermint { export const abci = { - ..._339 + ..._344 }; export const crypto = { - ..._340, - ..._341 + ..._345, + ..._346 }; export const p2p = { - ..._342 + ..._347 }; export const types = { - ..._343, - ..._344, - ..._345, - ..._346, - ..._347 + ..._348, + ..._349, + ..._350, + ..._351, + ..._352 }; export const version = { - ..._348 + ..._353 }; } \ No newline at end of file diff --git a/packages/types/protobuf/proto/osmosis/smartaccount/v1beta1/genesis.proto b/packages/types/protobuf/proto/osmosis/smartaccount/v1beta1/genesis.proto new file mode 100644 index 000000000..12d5c9a83 --- /dev/null +++ b/packages/types/protobuf/proto/osmosis/smartaccount/v1beta1/genesis.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; +package osmosis.smartaccount.v1beta1; + +import "gogoproto/gogo.proto"; +import "osmosis/smartaccount/v1beta1/params.proto"; +import "osmosis/smartaccount/v1beta1/models.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v25/x/smart-account/types"; + +// AuthenticatorData represents a genesis exported account with Authenticators. +// The address is used as the key, and the account authenticators are stored in +// the authenticators field. +message AuthenticatorData { + // address is an account address, one address can have many authenticators + string address = 1; + + // authenticators are the account's authenticators, these can be multiple + // types including SignatureVerification, AllOfs, CosmWasmAuthenticators, etc + repeated AccountAuthenticator authenticators = 2 + [ (gogoproto.nullable) = false ]; +} + +// GenesisState defines the authenticator module's genesis state. +message GenesisState { + // params define the parameters for the authenticator module. + Params params = 1 [ (gogoproto.nullable) = false ]; + + // next_authenticator_id is the next available authenticator ID. + uint64 next_authenticator_id = 2; + + // authenticator_data contains the data for multiple accounts, each with their + // authenticators. + repeated AuthenticatorData authenticator_data = 3 + [ (gogoproto.nullable) = false ]; +} diff --git a/packages/types/protobuf/proto/osmosis/smartaccount/v1beta1/models.proto b/packages/types/protobuf/proto/osmosis/smartaccount/v1beta1/models.proto new file mode 100644 index 000000000..d80a0391f --- /dev/null +++ b/packages/types/protobuf/proto/osmosis/smartaccount/v1beta1/models.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; +package osmosis.smartaccount.v1beta1; + +option go_package = "github.com/osmosis-labs/osmosis/v25/x/smart-account/types"; + +// AccountAuthenticator represents a foundational model for all authenticators. +// It provides extensibility by allowing concrete types to interpret and +// validate transactions based on the encapsulated data. +message AccountAuthenticator { + // ID uniquely identifies the authenticator instance. + uint64 id = 1; + + // Type specifies the category of the AccountAuthenticator. + // This type information is essential for differentiating authenticators + // and ensuring precise data retrieval from the storage layer. + string type = 2; + + // Config is a versatile field used in conjunction with the specific type of + // account authenticator to facilitate complex authentication processes. + // The interpretation of this field is overloaded, enabling multiple + // authenticators to utilize it for their respective purposes. + bytes config = 3; +} diff --git a/packages/types/protobuf/proto/osmosis/smartaccount/v1beta1/params.proto b/packages/types/protobuf/proto/osmosis/smartaccount/v1beta1/params.proto new file mode 100644 index 000000000..734d19dcc --- /dev/null +++ b/packages/types/protobuf/proto/osmosis/smartaccount/v1beta1/params.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; +package osmosis.smartaccount.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v25/x/smart-account/types"; + +// Params defines the parameters for the module. +message Params { + // MaximumUnauthenticatedGas defines the maximum amount of gas that can be + // used to authenticate a transaction in ante handler without having fee payer + // authenticated. + uint64 maximum_unauthenticated_gas = 1 + [ (gogoproto.moretags) = "yaml:\"maximum_unauthenticated_gas\"" ]; + + // IsSmartAccountActive defines the state of the authenticator. + // If set to false, the authenticator module will not be used + // and the classic cosmos sdk authentication will be used instead. + bool is_smart_account_active = 2 + [ (gogoproto.moretags) = "yaml:\"is_smart_account_active\"" ]; + + // CircuitBreakerControllers defines list of addresses that are allowed to + // set is_smart_account_active without going through governance. + repeated string circuit_breaker_controllers = 3 + [ (gogoproto.moretags) = "yaml:\"circuit_breaker_controllers\"" ]; +} diff --git a/packages/types/protobuf/proto/osmosis/smartaccount/v1beta1/query.proto b/packages/types/protobuf/proto/osmosis/smartaccount/v1beta1/query.proto new file mode 100644 index 000000000..75196ff84 --- /dev/null +++ b/packages/types/protobuf/proto/osmosis/smartaccount/v1beta1/query.proto @@ -0,0 +1,58 @@ +syntax = "proto3"; +package osmosis.smartaccount.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "osmosis/smartaccount/v1beta1/params.proto"; +import "osmosis/smartaccount/v1beta1/models.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v25/x/smart-account/types"; + +// Query defines the gRPC querier service. +service Query { + // Parameters queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/osmosis/smartaccount/params"; + } + + rpc GetAuthenticator(GetAuthenticatorRequest) + returns (GetAuthenticatorResponse) { + option (google.api.http).get = + "/osmosis/smartaccount/authenticator/{account}/{authenticator_id}"; + } + + rpc GetAuthenticators(GetAuthenticatorsRequest) + returns (GetAuthenticatorsResponse) { + option (google.api.http).get = + "/osmosis/smartaccount/authenticators/{account}"; + } +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +// MsgGetAuthenticatorsRequest defines the Msg/GetAuthenticators request type. +message GetAuthenticatorsRequest { string account = 1; } + +// MsgGetAuthenticatorsResponse defines the Msg/GetAuthenticators response type. +message GetAuthenticatorsResponse { + repeated AccountAuthenticator account_authenticators = 1; +} + +// MsgGetAuthenticatorRequest defines the Msg/GetAuthenticator request type. +message GetAuthenticatorRequest { + string account = 1; + uint64 authenticator_id = 2; +} + +// MsgGetAuthenticatorResponse defines the Msg/GetAuthenticator response type. +message GetAuthenticatorResponse { + AccountAuthenticator account_authenticator = 1; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/osmosis/smartaccount/v1beta1/tx.proto b/packages/types/protobuf/proto/osmosis/smartaccount/v1beta1/tx.proto new file mode 100644 index 000000000..d24214dc8 --- /dev/null +++ b/packages/types/protobuf/proto/osmosis/smartaccount/v1beta1/tx.proto @@ -0,0 +1,64 @@ +syntax = "proto3"; +package osmosis.smartaccount.v1beta1; + +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v25/x/smart-account/types"; + +// Msg defines the Msg service. +service Msg { + rpc AddAuthenticator(MsgAddAuthenticator) + returns (MsgAddAuthenticatorResponse); + rpc RemoveAuthenticator(MsgRemoveAuthenticator) + returns (MsgRemoveAuthenticatorResponse); + + // SetActiveState sets the active state of the authenticator. + // Primarily used for circuit breaking. + rpc SetActiveState(MsgSetActiveState) returns (MsgSetActiveStateResponse); +} + +// MsgAddAuthenticatorRequest defines the Msg/AddAuthenticator request type. +message MsgAddAuthenticator { + option (amino.name) = "osmosis/MsgAddAuthenticator"; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + string type = 2; + bytes data = 3; +} + +// MsgAddAuthenticatorResponse defines the Msg/AddAuthenticator response type. +message MsgAddAuthenticatorResponse { bool success = 1; } + +// MsgRemoveAuthenticatorRequest defines the Msg/RemoveAuthenticator request +// type. +message MsgRemoveAuthenticator { + option (amino.name) = "osmosis/MsgRemoveAuthenticator"; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + uint64 id = 2; +} + +// MsgRemoveAuthenticatorResponse defines the Msg/RemoveAuthenticator response +// type. +message MsgRemoveAuthenticatorResponse { bool success = 1; } + +message MsgSetActiveState { + option (amino.name) = "osmosis/MsgSetActiveState"; + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1; + bool active = 2; +} + +message MsgSetActiveStateResponse {} + +// TxExtension allows for additional authenticator-specific data in +// transactions. +message TxExtension { + // selected_authenticators holds the authenticator_id for the chosen + // authenticator per message. + repeated uint64 selected_authenticators = 1; +} diff --git a/packages/types/protobuf/scripts/codegen.js b/packages/types/protobuf/scripts/codegen.js index 567df0266..3c59077ef 100644 --- a/packages/types/protobuf/scripts/codegen.js +++ b/packages/types/protobuf/scripts/codegen.js @@ -89,6 +89,7 @@ telescope({ 'osmosis.poolincentives.v1beta1', 'osmosis.poolmanager.v1beta1', 'osmosis.protorev.v1beta1', + 'osmosis.smartaccount.v1beta1', 'osmosis.superfluid', 'osmosis.superfluid.v1beta1', 'osmosis.tokenfactory.v1beta1', From 4d836b65a1ebf50815ceec87d6a130654bba7767 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 12 Jun 2024 12:57:47 -0400 Subject: [PATCH 233/438] fix MsgStoreCode amino encoding --- .../codegen/cosmwasm/wasm/v1/types.ts | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/types/protobuf/codegen/cosmwasm/wasm/v1/types.ts b/packages/types/protobuf/codegen/cosmwasm/wasm/v1/types.ts index d2a323eb5..2ede42783 100644 --- a/packages/types/protobuf/codegen/cosmwasm/wasm/v1/types.ts +++ b/packages/types/protobuf/codegen/cosmwasm/wasm/v1/types.ts @@ -19,16 +19,16 @@ export const AccessTypeAmino = AccessType; export function accessTypeFromJSON(object: any): AccessType { switch (object) { case 0: - case "ACCESS_TYPE_UNSPECIFIED": + case "Unspecified": return AccessType.ACCESS_TYPE_UNSPECIFIED; case 1: - case "ACCESS_TYPE_NOBODY": + case "Nobody": return AccessType.ACCESS_TYPE_NOBODY; case 3: - case "ACCESS_TYPE_EVERYBODY": + case "Everybody": return AccessType.ACCESS_TYPE_EVERYBODY; case 4: - case "ACCESS_TYPE_ANY_OF_ADDRESSES": + case "AnyOfAddresses": return AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES; case -1: case "UNRECOGNIZED": @@ -39,13 +39,13 @@ export function accessTypeFromJSON(object: any): AccessType { export function accessTypeToJSON(object: AccessType): string { switch (object) { case AccessType.ACCESS_TYPE_UNSPECIFIED: - return "ACCESS_TYPE_UNSPECIFIED"; + return "Unspecified"; case AccessType.ACCESS_TYPE_NOBODY: - return "ACCESS_TYPE_NOBODY"; + return "Nobody"; case AccessType.ACCESS_TYPE_EVERYBODY: - return "ACCESS_TYPE_EVERYBODY"; + return "Everybody"; case AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES: - return "ACCESS_TYPE_ANY_OF_ADDRESSES"; + return "AnyOfAddresses"; case AccessType.UNRECOGNIZED: default: return "UNRECOGNIZED"; @@ -485,11 +485,9 @@ export const AccessConfig = { }, toAmino(message: AccessConfig, useInterfaces: boolean = false): AccessConfigAmino { const obj: any = {}; - obj.permission = message.permission; - if (message.addresses) { + obj.permission = accessTypeToJSON(message.permission); + if (message.addresses?.length) { obj.addresses = message.addresses.map(e => e); - } else { - obj.addresses = []; } return obj; }, From 0ccfe1f4cfd94e27d266de3084e04ebbce3f76e3 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 12 Jun 2024 13:15:23 -0400 Subject: [PATCH 234/438] updated patches --- packages/types/protobuf/patches.diff | 57 ++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/packages/types/protobuf/patches.diff b/packages/types/protobuf/patches.diff index d89998195..f364bd518 100644 --- a/packages/types/protobuf/patches.diff +++ b/packages/types/protobuf/patches.diff @@ -149,6 +149,63 @@ index 11d5dba92..e5ef23ea1 100644 return obj; }, fromAminoMsg(object: MsgInstantiateContract2AminoMsg): MsgInstantiateContract2 { +diff --git b/packages/types/protobuf/codegen/cosmwasm/wasm/v1/types.ts a/packages/types/protobuf/codegen/cosmwasm/wasm/v1/types.ts +index d2a323eb5..2ede42783 100644 +--- b/packages/types/protobuf/codegen/cosmwasm/wasm/v1/types.ts ++++ a/packages/types/protobuf/codegen/cosmwasm/wasm/v1/types.ts +@@ -19,16 +19,16 @@ export const AccessTypeAmino = AccessType; + export function accessTypeFromJSON(object: any): AccessType { + switch (object) { + case 0: +- case "ACCESS_TYPE_UNSPECIFIED": ++ case "Unspecified": + return AccessType.ACCESS_TYPE_UNSPECIFIED; + case 1: +- case "ACCESS_TYPE_NOBODY": ++ case "Nobody": + return AccessType.ACCESS_TYPE_NOBODY; + case 3: +- case "ACCESS_TYPE_EVERYBODY": ++ case "Everybody": + return AccessType.ACCESS_TYPE_EVERYBODY; + case 4: +- case "ACCESS_TYPE_ANY_OF_ADDRESSES": ++ case "AnyOfAddresses": + return AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES; + case -1: + case "UNRECOGNIZED": +@@ -39,13 +39,13 @@ export function accessTypeFromJSON(object: any): AccessType { + export function accessTypeToJSON(object: AccessType): string { + switch (object) { + case AccessType.ACCESS_TYPE_UNSPECIFIED: +- return "ACCESS_TYPE_UNSPECIFIED"; ++ return "Unspecified"; + case AccessType.ACCESS_TYPE_NOBODY: +- return "ACCESS_TYPE_NOBODY"; ++ return "Nobody"; + case AccessType.ACCESS_TYPE_EVERYBODY: +- return "ACCESS_TYPE_EVERYBODY"; ++ return "Everybody"; + case AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES: +- return "ACCESS_TYPE_ANY_OF_ADDRESSES"; ++ return "AnyOfAddresses"; + case AccessType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; +@@ -485,11 +485,9 @@ export const AccessConfig = { + }, + toAmino(message: AccessConfig, useInterfaces: boolean = false): AccessConfigAmino { + const obj: any = {}; +- obj.permission = message.permission; +- if (message.addresses) { ++ obj.permission = accessTypeToJSON(message.permission); ++ if (message.addresses?.length) { + obj.addresses = message.addresses.map(e => e); +- } else { +- obj.addresses = []; + } + return obj; + }, diff --git b/packages/types/protobuf/codegen/neutron/client.ts a/packages/types/protobuf/codegen/neutron/client.ts index 1caf8781d..9d864d753 100644 --- b/packages/types/protobuf/codegen/neutron/client.ts From 87be8bce4a39c957ce99ee6dd6e9f749110306af Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 12 Jun 2024 14:52:53 -0400 Subject: [PATCH 235/438] use native browser gzip APIs --- .../UploadCode/Component.tsx | 25 ++++++----------- packages/stateful/package.json | 3 +- packages/utils/messages/encoding.ts | 28 +++++++++++++++++++ yarn.lock | 5 ---- 4 files changed, 37 insertions(+), 24 deletions(-) diff --git a/packages/stateful/actions/core/smart_contracting/UploadCode/Component.tsx b/packages/stateful/actions/core/smart_contracting/UploadCode/Component.tsx index 044882950..b2cfc082d 100644 --- a/packages/stateful/actions/core/smart_contracting/UploadCode/Component.tsx +++ b/packages/stateful/actions/core/smart_contracting/UploadCode/Component.tsx @@ -5,7 +5,6 @@ import { ComponentType, useCallback, useEffect, useState } from 'react' import { useFieldArray, useFormContext } from 'react-hook-form' import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' -import gzipInit, { compress, decompress, freeBuffer } from 'wasm-gzip' import { Button, @@ -21,6 +20,8 @@ import { AddressInputProps, TransProps } from '@dao-dao/types' import { ActionComponent } from '@dao-dao/types/actions' import { AccessType } from '@dao-dao/types/protobuf/codegen/cosmwasm/wasm/v1/types' import { + gzipCompress, + gzipDecompress, makeValidateAddress, processError, validateRequired, @@ -83,17 +84,11 @@ export const UploadCodeComponent: ActionComponent = ({ // Decompress gzip data if needed. if (_gzipped) { - await gzipInit() - rawData = decompress(rawData) + rawData = await gzipDecompress(rawData) } const sha256Hash = await crypto.subtle.digest('SHA-256', rawData) setSha256Checksum(toHex(new Uint8Array(sha256Hash))) - - // Free buffer once the hash has been computed. - if (_gzipped) { - freeBuffer() - } }, [data, gzipped] ) @@ -122,25 +117,21 @@ export const UploadCodeComponent: ActionComponent = ({ throw new Error(t('error.emptyFile')) } - await gzipInit() - const fileData = new Uint8Array(data) const alreadyGzipped = file.name.endsWith('.wasm.gz') - const rawData = alreadyGzipped ? decompress(fileData) : fileData + const rawData = alreadyGzipped ? await gzipDecompress(fileData) : fileData // Update sha256 hash with raw data. await updateSha256Checksum(toBase64(rawData), false) // Gzip compress data if not already gzipped. - const gzippedData = alreadyGzipped ? fileData : compress(rawData) - const gzippedDataBase64 = toBase64(gzippedData) - - // Free buffer once it's been converted to base64. - freeBuffer() + const gzippedData = alreadyGzipped + ? fileData + : await gzipCompress(rawData) setValue((fieldNamePrefix + 'gzipped') as 'gzipped', true) - setValue((fieldNamePrefix + 'data') as 'data', gzippedDataBase64) + setValue((fieldNamePrefix + 'data') as 'data', toBase64(gzippedData)) } catch (err) { console.error(err) toast.error(processError(err, { forceCapture: false })) diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 7ecf74b34..34eee5c30 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -73,8 +73,7 @@ "recoil": "^0.7.2", "remove-markdown": "^0.5.0", "use-deep-compare-effect": "^1.8.1", - "uuid": "^9.0.0", - "wasm-gzip": "^2.0.3" + "uuid": "^9.0.0" }, "devDependencies": { "@chain-registry/types": "^0.41.3", diff --git a/packages/utils/messages/encoding.ts b/packages/utils/messages/encoding.ts index f0f79224e..23140da81 100644 --- a/packages/utils/messages/encoding.ts +++ b/packages/utils/messages/encoding.ts @@ -38,3 +38,31 @@ export const decodeJsonFromBase64 = ( */ export const isGzipped = (data: Uint8Array) => data.length >= 2 && data[0] === 0x1f && data[1] === 0x8b + +/** + * Compress data with gzip. + */ +export const gzipCompress = async (data: Uint8Array): Promise => { + const compressionStream = new CompressionStream('gzip') + const writer = compressionStream.writable.getWriter() + writer.write(data) + writer.close() + const compressedData = await new Response( + compressionStream.readable + ).arrayBuffer() + return new Uint8Array(compressedData) +} + +/** + * Decompress data with gzip. + */ +export const gzipDecompress = async (data: Uint8Array): Promise => { + const decompressionStream = new DecompressionStream('gzip') + const writer = decompressionStream.writable.getWriter() + writer.write(data) + writer.close() + const decompressedData = await new Response( + decompressionStream.readable + ).arrayBuffer() + return new Uint8Array(decompressedData) +} diff --git a/yarn.lock b/yarn.lock index f4aaa7851..8ea86afa9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -25263,11 +25263,6 @@ wasm-ast-types@^0.25.0: case "1.6.3" deepmerge "4.2.2" -wasm-gzip@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/wasm-gzip/-/wasm-gzip-2.0.3.tgz#66da82e63f2898868fc1b4e53fef58b0cc3fa82d" - integrity sha512-HX0F/gSliIYLkNbpqH0uFjJWOcDFjn3mN1/FQx/j3XvHgig8asGZM5hP7lznWbHvma/iZaQtC8LAT05RaLB+qw== - watchpack-chokidar2@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/watchpack-chokidar2/-/watchpack-chokidar2-2.0.1.tgz#38500072ee6ece66f3769936950ea1771be1c957" From 82ead12d4a3f9fb4beb1d624212b14c5fc42d3a0 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 12 Jun 2024 14:55:02 -0400 Subject: [PATCH 236/438] fixed smart contract checksum overflow --- .../actions/core/smart_contracting/UploadCode/Component.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/stateful/actions/core/smart_contracting/UploadCode/Component.tsx b/packages/stateful/actions/core/smart_contracting/UploadCode/Component.tsx index b2cfc082d..bd982dcfc 100644 --- a/packages/stateful/actions/core/smart_contracting/UploadCode/Component.tsx +++ b/packages/stateful/actions/core/smart_contracting/UploadCode/Component.tsx @@ -154,8 +154,8 @@ export const UploadCodeComponent: ActionComponent = ({ {sha256Checksum ? ( ) : ( From fa58e11e11446595ad3e128da48c6d1b1fd097db Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 12 Jun 2024 15:18:04 -0400 Subject: [PATCH 237/438] fixed neutron DAO on testnet --- packages/utils/constants/chains.ts | 3 ++- packages/utils/constants/env.ts | 8 ++++++++ packages/utils/constants/other.ts | 6 ------ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 90435de80..7105cd2fe 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -13,7 +13,7 @@ import { SupportedChainConfig, } from '@dao-dao/types' -import { NEUTRON_GOVERNANCE_DAO } from './other' +import { NEUTRON_GOVERNANCE_DAO } from './env' //! ----- Modified chain-registry ----- let chains = [...chainRegistryChains] @@ -1770,6 +1770,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ accentColor: '#000000', factoryContractAddress: 'neutron1gu2c0ddyrzk78cuzdlwwtz4c07mfyumx43wefe2fgtv5rf7fvlrq5upnkr', + govContractAddress: NEUTRON_GOVERNANCE_DAO, explorerUrlTemplates: { tx: 'https://neutron.celat.one/pion-1/txs/REPLACE', wallet: 'https://neutron.celat.one/pion-1/accounts/REPLACE', diff --git a/packages/utils/constants/env.ts b/packages/utils/constants/env.ts index 3cfc77f20..85d44435f 100644 --- a/packages/utils/constants/env.ts +++ b/packages/utils/constants/env.ts @@ -15,6 +15,14 @@ export const LEGACY_URL_PREFIX = process.env // True if on mainnet, false if on testnet. export const MAINNET = process.env.NEXT_PUBLIC_MAINNET === 'true' +// Neutron DAOs. +export const NEUTRON_GOVERNANCE_DAO = MAINNET + ? 'neutron1suhgf5svhu4usrurvxzlgn54ksxmn8gljarjtxqnapv8kjnp4nrstdxvff' + : 'neutron1kvxlf27r0h7mzjqgdydqdf76dtlyvwz6u9q8tysfae53ajv8urtq4fdkvy' +export const NEUTRON_SECURITY_SUBDAO = MAINNET + ? 'neutron1fuyxwxlsgjkfjmxfthq8427dm2am3ya3cwcdr8gls29l7jadtazsuyzwcc' + : 'neutron1zv35zgj7d6khqxfl3tx95scjljz0rvmkxcsxmggqxrltkm8ystsqvt0qc7' + export const DAO_DAO_DAO_ADDRESS = process.env .NEXT_PUBLIC_DAO_DAO_DAO_ADDRESS as string diff --git a/packages/utils/constants/other.ts b/packages/utils/constants/other.ts index 332df2a57..a41b40402 100644 --- a/packages/utils/constants/other.ts +++ b/packages/utils/constants/other.ts @@ -104,12 +104,6 @@ export const ICA_CHAINS_TX_PREFIX = 'ica:' export const CHAIN_GAS_MULTIPLIER = 2 -// Neutron DAOs. -export const NEUTRON_GOVERNANCE_DAO = - 'neutron1suhgf5svhu4usrurvxzlgn54ksxmn8gljarjtxqnapv8kjnp4nrstdxvff' -export const NEUTRON_SECURITY_SUBDAO = - 'neutron1fuyxwxlsgjkfjmxfthq8427dm2am3ya3cwcdr8gls29l7jadtazsuyzwcc' - export const IPFS_GATEWAY_TEMPLATE = 'https://ipfs.daodao.zone/ipfs/PATH' export const SKIP_API_BASE = 'https://api.skip.money' From 91409cced7ebf281034fe524776e1648b7af6a9a Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 13 Jun 2024 12:34:40 -0400 Subject: [PATCH 238/438] try rpc.cosmos.directory first, falling back to chain registry list --- packages/utils/chain.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/utils/chain.ts b/packages/utils/chain.ts index cc0c79785..a1e8f8568 100644 --- a/packages/utils/chain.ts +++ b/packages/utils/chain.ts @@ -65,10 +65,12 @@ export const getRpcForChainId = ( throw new Error(`Unknown chain ID "${chainId}"`) } - const rpcs = chain?.apis?.rpc ?? [] - if (rpcs.length === 0) { - throw new Error(`No RPCs found for chain ID "${chainId}"`) - } + const rpcs = [ + // Try cosmos.directory RPC first. + { address: 'https://rpc.cosmos.directory/' + chain.chain_name }, + // Fallback to chain registry. + ...(chain?.apis?.rpc ?? []), + ] return rpcs[offset % rpcs.length].address.replace(/http:\/\//, 'https://') } From 1a4d7d0d493cbd5dd0d5a95ec2702f7a76b4c354 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 13 Jun 2024 13:11:07 -0400 Subject: [PATCH 239/438] removed cosmos adminmodule types --- .../types/protobuf/codegen/alliance/bundle.ts | 24 +- .../protobuf/codegen/alliance/rpc.query.ts | 3 - .../types/protobuf/codegen/alliance/rpc.tx.ts | 3 - .../types/protobuf/codegen/bitsong/bundle.ts | 16 +- .../types/protobuf/codegen/bitsong/rpc.tx.ts | 3 - .../types/protobuf/codegen/circle/bundle.ts | 24 +- .../protobuf/codegen/circle/rpc.query.ts | 3 - .../types/protobuf/codegen/circle/rpc.tx.ts | 3 - .../types/protobuf/codegen/cosmos/bundle.ts | 430 ++++++++-------- .../types/protobuf/codegen/cosmos/client.ts | 5 +- .../protobuf/codegen/cosmos/rpc.query.ts | 3 - .../types/protobuf/codegen/cosmos/rpc.tx.ts | 3 - .../types/protobuf/codegen/cosmwasm/bundle.ts | 76 +-- .../protobuf/codegen/cosmwasm/rpc.query.ts | 3 - .../types/protobuf/codegen/cosmwasm/rpc.tx.ts | 3 - .../types/protobuf/codegen/gaia/bundle.ts | 36 +- .../types/protobuf/codegen/gaia/rpc.query.ts | 3 - .../types/protobuf/codegen/gaia/rpc.tx.ts | 3 - .../protobuf/codegen/gogoproto/bundle.ts | 4 +- .../types/protobuf/codegen/google/bundle.ts | 26 +- packages/types/protobuf/codegen/ibc/bundle.ts | 168 +++---- .../types/protobuf/codegen/ibc/rpc.query.ts | 3 - packages/types/protobuf/codegen/ibc/rpc.tx.ts | 3 - .../types/protobuf/codegen/juno/bundle.ts | 68 +-- .../types/protobuf/codegen/juno/rpc.query.ts | 3 - .../types/protobuf/codegen/juno/rpc.tx.ts | 3 - .../types/protobuf/codegen/kujira/bundle.ts | 86 ++-- .../protobuf/codegen/kujira/rpc.query.ts | 3 - .../types/protobuf/codegen/kujira/rpc.tx.ts | 3 - .../types/protobuf/codegen/neutron/bundle.ts | 204 ++++---- .../protobuf/codegen/neutron/rpc.query.ts | 3 - .../types/protobuf/codegen/neutron/rpc.tx.ts | 3 - .../types/protobuf/codegen/noble/bundle.ts | 20 +- .../types/protobuf/codegen/noble/rpc.query.ts | 3 - .../types/protobuf/codegen/osmosis/bundle.ts | 460 +++++++++--------- .../protobuf/codegen/osmosis/rpc.query.ts | 3 - .../types/protobuf/codegen/osmosis/rpc.tx.ts | 3 - .../types/protobuf/codegen/pstake/bundle.ts | 138 +++--- .../protobuf/codegen/pstake/rpc.query.ts | 3 - .../types/protobuf/codegen/pstake/rpc.tx.ts | 3 - .../protobuf/codegen/publicawesome/bundle.ts | 120 ++--- .../codegen/publicawesome/rpc.query.ts | 3 - .../protobuf/codegen/publicawesome/rpc.tx.ts | 3 - .../types/protobuf/codegen/regen/bundle.ts | 178 +++---- .../types/protobuf/codegen/regen/rpc.query.ts | 3 - .../types/protobuf/codegen/regen/rpc.tx.ts | 3 - .../protobuf/codegen/tendermint/bundle.ts | 38 +- packages/types/protobuf/scripts/codegen.js | 2 +- 48 files changed, 1051 insertions(+), 1156 deletions(-) diff --git a/packages/types/protobuf/codegen/alliance/bundle.ts b/packages/types/protobuf/codegen/alliance/bundle.ts index 1cb960388..a3c73977d 100644 --- a/packages/types/protobuf/codegen/alliance/bundle.ts +++ b/packages/types/protobuf/codegen/alliance/bundle.ts @@ -8,12 +8,12 @@ import * as _6 from "./alliance/query"; import * as _7 from "./alliance/redelegations"; import * as _8 from "./alliance/tx"; import * as _9 from "./alliance/unbonding"; -import * as _354 from "./alliance/tx.amino"; -import * as _355 from "./alliance/tx.registry"; -import * as _356 from "./alliance/query.rpc.Query"; -import * as _357 from "./alliance/tx.rpc.msg"; -import * as _596 from "./rpc.query"; -import * as _597 from "./rpc.tx"; +import * as _351 from "./alliance/tx.amino"; +import * as _352 from "./alliance/tx.registry"; +import * as _353 from "./alliance/query.rpc.Query"; +import * as _354 from "./alliance/tx.rpc.msg"; +import * as _589 from "./rpc.query"; +import * as _590 from "./rpc.tx"; export namespace alliance { export const alliance = { ..._0, @@ -26,13 +26,13 @@ export namespace alliance { ..._7, ..._8, ..._9, - ..._354, - ..._355, - ..._356, - ..._357 + ..._351, + ..._352, + ..._353, + ..._354 }; export const ClientFactory = { - ..._596, - ..._597 + ..._589, + ..._590 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/alliance/rpc.query.ts b/packages/types/protobuf/codegen/alliance/rpc.query.ts index 530ae9dc3..5b1ec6a9e 100644 --- a/packages/types/protobuf/codegen/alliance/rpc.query.ts +++ b/packages/types/protobuf/codegen/alliance/rpc.query.ts @@ -12,9 +12,6 @@ export const createRPCQueryClient = async ({ alliance: (await import("./alliance/query.rpc.Query")).createRpcQueryExtension(client) }, cosmos: { - adminmodule: { - adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) - }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/alliance/rpc.tx.ts b/packages/types/protobuf/codegen/alliance/rpc.tx.ts index ad4721c43..2782bd639 100644 --- a/packages/types/protobuf/codegen/alliance/rpc.tx.ts +++ b/packages/types/protobuf/codegen/alliance/rpc.tx.ts @@ -8,9 +8,6 @@ export const createRPCMsgClient = async ({ alliance: new (await import("./alliance/tx.rpc.msg")).MsgClientImpl(rpc) }, cosmos: { - adminmodule: { - adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) - }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/bitsong/bundle.ts b/packages/types/protobuf/codegen/bitsong/bundle.ts index 0a8c57e7f..6e5c52a9e 100644 --- a/packages/types/protobuf/codegen/bitsong/bundle.ts +++ b/packages/types/protobuf/codegen/bitsong/bundle.ts @@ -1,16 +1,16 @@ import * as _11 from "./fantoken/v1beta1/tx"; -import * as _358 from "./fantoken/v1beta1/tx.amino"; -import * as _359 from "./fantoken/v1beta1/tx.registry"; -import * as _360 from "./fantoken/v1beta1/tx.rpc.msg"; -import * as _598 from "./rpc.tx"; +import * as _355 from "./fantoken/v1beta1/tx.amino"; +import * as _356 from "./fantoken/v1beta1/tx.registry"; +import * as _357 from "./fantoken/v1beta1/tx.rpc.msg"; +import * as _591 from "./rpc.tx"; export namespace bitsong { export const fantoken = { ..._11, - ..._358, - ..._359, - ..._360 + ..._355, + ..._356, + ..._357 }; export const ClientFactory = { - ..._598 + ..._591 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/bitsong/rpc.tx.ts b/packages/types/protobuf/codegen/bitsong/rpc.tx.ts index ffefec71a..c5c521265 100644 --- a/packages/types/protobuf/codegen/bitsong/rpc.tx.ts +++ b/packages/types/protobuf/codegen/bitsong/rpc.tx.ts @@ -8,9 +8,6 @@ export const createRPCMsgClient = async ({ fantoken: new (await import("./fantoken/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, cosmos: { - adminmodule: { - adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) - }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/circle/bundle.ts b/packages/types/protobuf/codegen/circle/bundle.ts index f5a0648c1..b8a1eab75 100644 --- a/packages/types/protobuf/codegen/circle/bundle.ts +++ b/packages/types/protobuf/codegen/circle/bundle.ts @@ -14,12 +14,12 @@ import * as _24 from "./cctp/v1/sending_and_receiving_messages_paused"; import * as _25 from "./cctp/v1/signature_threshold"; import * as _26 from "./cctp/v1/token_pair"; import * as _27 from "./cctp/v1/tx"; -import * as _361 from "./cctp/v1/tx.amino"; -import * as _362 from "./cctp/v1/tx.registry"; -import * as _363 from "./cctp/v1/query.rpc.Query"; -import * as _364 from "./cctp/v1/tx.rpc.msg"; -import * as _599 from "./rpc.query"; -import * as _600 from "./rpc.tx"; +import * as _358 from "./cctp/v1/tx.amino"; +import * as _359 from "./cctp/v1/tx.registry"; +import * as _360 from "./cctp/v1/query.rpc.Query"; +import * as _361 from "./cctp/v1/tx.rpc.msg"; +import * as _592 from "./rpc.query"; +import * as _593 from "./rpc.tx"; export namespace circle { export namespace cctp { export const v1 = { @@ -39,14 +39,14 @@ export namespace circle { ..._25, ..._26, ..._27, - ..._361, - ..._362, - ..._363, - ..._364 + ..._358, + ..._359, + ..._360, + ..._361 }; } export const ClientFactory = { - ..._599, - ..._600 + ..._592, + ..._593 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/circle/rpc.query.ts b/packages/types/protobuf/codegen/circle/rpc.query.ts index 1aac0f50a..4de7815ea 100644 --- a/packages/types/protobuf/codegen/circle/rpc.query.ts +++ b/packages/types/protobuf/codegen/circle/rpc.query.ts @@ -14,9 +14,6 @@ export const createRPCQueryClient = async ({ } }, cosmos: { - adminmodule: { - adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) - }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/circle/rpc.tx.ts b/packages/types/protobuf/codegen/circle/rpc.tx.ts index 978f37e3e..3533e340e 100644 --- a/packages/types/protobuf/codegen/circle/rpc.tx.ts +++ b/packages/types/protobuf/codegen/circle/rpc.tx.ts @@ -10,9 +10,6 @@ export const createRPCMsgClient = async ({ } }, cosmos: { - adminmodule: { - adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) - }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/cosmos/bundle.ts b/packages/types/protobuf/codegen/cosmos/bundle.ts index b2d4f5e63..417a8ba09 100644 --- a/packages/types/protobuf/codegen/cosmos/bundle.ts +++ b/packages/types/protobuf/codegen/cosmos/bundle.ts @@ -1,334 +1,316 @@ -import * as _29 from "./adminmodule/adminmodule/genesis"; -import * as _30 from "./adminmodule/adminmodule/query"; -import * as _31 from "./adminmodule/adminmodule/tx"; -import * as _32 from "./auth/v1beta1/auth"; -import * as _33 from "./auth/v1beta1/genesis"; -import * as _34 from "./auth/v1beta1/query"; -import * as _35 from "./auth/v1beta1/tx"; -import * as _36 from "./authz/v1beta1/authz"; -import * as _37 from "./authz/v1beta1/event"; -import * as _38 from "./authz/v1beta1/genesis"; -import * as _39 from "./authz/v1beta1/query"; -import * as _40 from "./authz/v1beta1/tx"; -import * as _41 from "./bank/v1beta1/authz"; -import * as _42 from "./bank/v1beta1/bank"; -import * as _43 from "./bank/v1beta1/genesis"; -import * as _44 from "./bank/v1beta1/query"; -import * as _45 from "./bank/v1beta1/tx"; -import * as _46 from "./base/abci/v1beta1/abci"; -import * as _47 from "./base/query/v1beta1/pagination"; -import * as _48 from "./base/tendermint/v1beta1/query"; -import * as _49 from "./base/tendermint/v1beta1/types"; -import * as _50 from "./base/v1beta1/coin"; -import * as _51 from "./crypto/ed25519/keys"; -import * as _52 from "./crypto/multisig/keys"; -import * as _53 from "./crypto/secp256k1/keys"; -import * as _54 from "./distribution/v1beta1/distribution"; -import * as _55 from "./distribution/v1beta1/genesis"; -import * as _56 from "./distribution/v1beta1/query"; -import * as _57 from "./distribution/v1beta1/tx"; -import * as _58 from "./feegrant/v1beta1/feegrant"; -import * as _59 from "./feegrant/v1beta1/genesis"; -import * as _60 from "./feegrant/v1beta1/query"; -import * as _61 from "./feegrant/v1beta1/tx"; -import * as _62 from "./gov/v1/genesis"; -import * as _63 from "./gov/v1/gov"; -import * as _64 from "./gov/v1/query"; -import * as _65 from "./gov/v1/tx"; -import * as _66 from "./gov/v1beta1/genesis"; -import * as _67 from "./gov/v1beta1/gov"; -import * as _68 from "./gov/v1beta1/query"; -import * as _69 from "./gov/v1beta1/tx"; -import * as _70 from "./mint/v1beta1/genesis"; -import * as _71 from "./mint/v1beta1/mint"; -import * as _72 from "./mint/v1beta1/query"; -import * as _73 from "./mint/v1beta1/tx"; -import * as _74 from "./msg/v1/msg"; -import * as _75 from "./orm/v1/orm"; -import * as _76 from "./params/v1beta1/params"; -import * as _77 from "./params/v1beta1/query"; -import * as _78 from "./query/v1/query"; -import * as _79 from "./slashing/v1beta1/genesis"; -import * as _80 from "./slashing/v1beta1/query"; -import * as _81 from "./slashing/v1beta1/slashing"; -import * as _82 from "./slashing/v1beta1/tx"; -import * as _83 from "./staking/v1beta1/authz"; -import * as _84 from "./staking/v1beta1/genesis"; -import * as _85 from "./staking/v1beta1/query"; -import * as _86 from "./staking/v1beta1/staking"; -import * as _87 from "./staking/v1beta1/tx"; -import * as _88 from "./tx/signing/v1beta1/signing"; -import * as _89 from "./tx/v1beta1/service"; -import * as _90 from "./tx/v1beta1/tx"; -import * as _91 from "./upgrade/v1beta1/query"; -import * as _92 from "./upgrade/v1beta1/tx"; -import * as _93 from "./upgrade/v1beta1/upgrade"; -import * as _365 from "./adminmodule/adminmodule/tx.amino"; -import * as _366 from "./auth/v1beta1/tx.amino"; -import * as _367 from "./authz/v1beta1/tx.amino"; -import * as _368 from "./bank/v1beta1/tx.amino"; -import * as _369 from "./distribution/v1beta1/tx.amino"; -import * as _370 from "./feegrant/v1beta1/tx.amino"; -import * as _371 from "./gov/v1/tx.amino"; -import * as _372 from "./gov/v1beta1/tx.amino"; -import * as _373 from "./mint/v1beta1/tx.amino"; -import * as _374 from "./slashing/v1beta1/tx.amino"; -import * as _375 from "./staking/v1beta1/tx.amino"; -import * as _376 from "./upgrade/v1beta1/tx.amino"; -import * as _377 from "./adminmodule/adminmodule/tx.registry"; -import * as _378 from "./auth/v1beta1/tx.registry"; -import * as _379 from "./authz/v1beta1/tx.registry"; -import * as _380 from "./bank/v1beta1/tx.registry"; -import * as _381 from "./distribution/v1beta1/tx.registry"; -import * as _382 from "./feegrant/v1beta1/tx.registry"; -import * as _383 from "./gov/v1/tx.registry"; -import * as _384 from "./gov/v1beta1/tx.registry"; -import * as _385 from "./mint/v1beta1/tx.registry"; -import * as _386 from "./slashing/v1beta1/tx.registry"; -import * as _387 from "./staking/v1beta1/tx.registry"; -import * as _388 from "./upgrade/v1beta1/tx.registry"; -import * as _389 from "./adminmodule/adminmodule/query.rpc.Query"; -import * as _390 from "./auth/v1beta1/query.rpc.Query"; -import * as _391 from "./authz/v1beta1/query.rpc.Query"; -import * as _392 from "./bank/v1beta1/query.rpc.Query"; -import * as _393 from "./base/tendermint/v1beta1/query.rpc.Service"; -import * as _394 from "./distribution/v1beta1/query.rpc.Query"; -import * as _395 from "./feegrant/v1beta1/query.rpc.Query"; -import * as _396 from "./gov/v1/query.rpc.Query"; -import * as _397 from "./gov/v1beta1/query.rpc.Query"; -import * as _398 from "./mint/v1beta1/query.rpc.Query"; -import * as _399 from "./params/v1beta1/query.rpc.Query"; -import * as _400 from "./slashing/v1beta1/query.rpc.Query"; -import * as _401 from "./staking/v1beta1/query.rpc.Query"; -import * as _402 from "./tx/v1beta1/service.rpc.Service"; -import * as _403 from "./upgrade/v1beta1/query.rpc.Query"; -import * as _404 from "./adminmodule/adminmodule/tx.rpc.msg"; -import * as _405 from "./auth/v1beta1/tx.rpc.msg"; -import * as _406 from "./authz/v1beta1/tx.rpc.msg"; -import * as _407 from "./bank/v1beta1/tx.rpc.msg"; -import * as _408 from "./distribution/v1beta1/tx.rpc.msg"; -import * as _409 from "./feegrant/v1beta1/tx.rpc.msg"; -import * as _410 from "./gov/v1/tx.rpc.msg"; -import * as _411 from "./gov/v1beta1/tx.rpc.msg"; -import * as _412 from "./mint/v1beta1/tx.rpc.msg"; -import * as _413 from "./slashing/v1beta1/tx.rpc.msg"; -import * as _414 from "./staking/v1beta1/tx.rpc.msg"; -import * as _415 from "./upgrade/v1beta1/tx.rpc.msg"; -import * as _601 from "./rpc.query"; -import * as _602 from "./rpc.tx"; +import * as _29 from "./auth/v1beta1/auth"; +import * as _30 from "./auth/v1beta1/genesis"; +import * as _31 from "./auth/v1beta1/query"; +import * as _32 from "./auth/v1beta1/tx"; +import * as _33 from "./authz/v1beta1/authz"; +import * as _34 from "./authz/v1beta1/event"; +import * as _35 from "./authz/v1beta1/genesis"; +import * as _36 from "./authz/v1beta1/query"; +import * as _37 from "./authz/v1beta1/tx"; +import * as _38 from "./bank/v1beta1/authz"; +import * as _39 from "./bank/v1beta1/bank"; +import * as _40 from "./bank/v1beta1/genesis"; +import * as _41 from "./bank/v1beta1/query"; +import * as _42 from "./bank/v1beta1/tx"; +import * as _43 from "./base/abci/v1beta1/abci"; +import * as _44 from "./base/query/v1beta1/pagination"; +import * as _45 from "./base/tendermint/v1beta1/query"; +import * as _46 from "./base/tendermint/v1beta1/types"; +import * as _47 from "./base/v1beta1/coin"; +import * as _48 from "./crypto/ed25519/keys"; +import * as _49 from "./crypto/multisig/keys"; +import * as _50 from "./crypto/secp256k1/keys"; +import * as _51 from "./distribution/v1beta1/distribution"; +import * as _52 from "./distribution/v1beta1/genesis"; +import * as _53 from "./distribution/v1beta1/query"; +import * as _54 from "./distribution/v1beta1/tx"; +import * as _55 from "./feegrant/v1beta1/feegrant"; +import * as _56 from "./feegrant/v1beta1/genesis"; +import * as _57 from "./feegrant/v1beta1/query"; +import * as _58 from "./feegrant/v1beta1/tx"; +import * as _59 from "./gov/v1/genesis"; +import * as _60 from "./gov/v1/gov"; +import * as _61 from "./gov/v1/query"; +import * as _62 from "./gov/v1/tx"; +import * as _63 from "./gov/v1beta1/genesis"; +import * as _64 from "./gov/v1beta1/gov"; +import * as _65 from "./gov/v1beta1/query"; +import * as _66 from "./gov/v1beta1/tx"; +import * as _67 from "./mint/v1beta1/genesis"; +import * as _68 from "./mint/v1beta1/mint"; +import * as _69 from "./mint/v1beta1/query"; +import * as _70 from "./mint/v1beta1/tx"; +import * as _71 from "./msg/v1/msg"; +import * as _72 from "./orm/v1/orm"; +import * as _73 from "./params/v1beta1/params"; +import * as _74 from "./params/v1beta1/query"; +import * as _75 from "./query/v1/query"; +import * as _76 from "./slashing/v1beta1/genesis"; +import * as _77 from "./slashing/v1beta1/query"; +import * as _78 from "./slashing/v1beta1/slashing"; +import * as _79 from "./slashing/v1beta1/tx"; +import * as _80 from "./staking/v1beta1/authz"; +import * as _81 from "./staking/v1beta1/genesis"; +import * as _82 from "./staking/v1beta1/query"; +import * as _83 from "./staking/v1beta1/staking"; +import * as _84 from "./staking/v1beta1/tx"; +import * as _85 from "./tx/signing/v1beta1/signing"; +import * as _86 from "./tx/v1beta1/service"; +import * as _87 from "./tx/v1beta1/tx"; +import * as _88 from "./upgrade/v1beta1/query"; +import * as _89 from "./upgrade/v1beta1/tx"; +import * as _90 from "./upgrade/v1beta1/upgrade"; +import * as _362 from "./auth/v1beta1/tx.amino"; +import * as _363 from "./authz/v1beta1/tx.amino"; +import * as _364 from "./bank/v1beta1/tx.amino"; +import * as _365 from "./distribution/v1beta1/tx.amino"; +import * as _366 from "./feegrant/v1beta1/tx.amino"; +import * as _367 from "./gov/v1/tx.amino"; +import * as _368 from "./gov/v1beta1/tx.amino"; +import * as _369 from "./mint/v1beta1/tx.amino"; +import * as _370 from "./slashing/v1beta1/tx.amino"; +import * as _371 from "./staking/v1beta1/tx.amino"; +import * as _372 from "./upgrade/v1beta1/tx.amino"; +import * as _373 from "./auth/v1beta1/tx.registry"; +import * as _374 from "./authz/v1beta1/tx.registry"; +import * as _375 from "./bank/v1beta1/tx.registry"; +import * as _376 from "./distribution/v1beta1/tx.registry"; +import * as _377 from "./feegrant/v1beta1/tx.registry"; +import * as _378 from "./gov/v1/tx.registry"; +import * as _379 from "./gov/v1beta1/tx.registry"; +import * as _380 from "./mint/v1beta1/tx.registry"; +import * as _381 from "./slashing/v1beta1/tx.registry"; +import * as _382 from "./staking/v1beta1/tx.registry"; +import * as _383 from "./upgrade/v1beta1/tx.registry"; +import * as _384 from "./auth/v1beta1/query.rpc.Query"; +import * as _385 from "./authz/v1beta1/query.rpc.Query"; +import * as _386 from "./bank/v1beta1/query.rpc.Query"; +import * as _387 from "./base/tendermint/v1beta1/query.rpc.Service"; +import * as _388 from "./distribution/v1beta1/query.rpc.Query"; +import * as _389 from "./feegrant/v1beta1/query.rpc.Query"; +import * as _390 from "./gov/v1/query.rpc.Query"; +import * as _391 from "./gov/v1beta1/query.rpc.Query"; +import * as _392 from "./mint/v1beta1/query.rpc.Query"; +import * as _393 from "./params/v1beta1/query.rpc.Query"; +import * as _394 from "./slashing/v1beta1/query.rpc.Query"; +import * as _395 from "./staking/v1beta1/query.rpc.Query"; +import * as _396 from "./tx/v1beta1/service.rpc.Service"; +import * as _397 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _398 from "./auth/v1beta1/tx.rpc.msg"; +import * as _399 from "./authz/v1beta1/tx.rpc.msg"; +import * as _400 from "./bank/v1beta1/tx.rpc.msg"; +import * as _401 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _402 from "./feegrant/v1beta1/tx.rpc.msg"; +import * as _403 from "./gov/v1/tx.rpc.msg"; +import * as _404 from "./gov/v1beta1/tx.rpc.msg"; +import * as _405 from "./mint/v1beta1/tx.rpc.msg"; +import * as _406 from "./slashing/v1beta1/tx.rpc.msg"; +import * as _407 from "./staking/v1beta1/tx.rpc.msg"; +import * as _408 from "./upgrade/v1beta1/tx.rpc.msg"; +import * as _594 from "./rpc.query"; +import * as _595 from "./rpc.tx"; export namespace cosmos { - export namespace adminmodule { - export const adminmodule = { + export namespace auth { + export const v1beta1 = { ..._29, ..._30, ..._31, - ..._365, - ..._377, - ..._389, - ..._404 + ..._32, + ..._362, + ..._373, + ..._384, + ..._398 }; } - export namespace auth { + export namespace authz { export const v1beta1 = { - ..._32, ..._33, ..._34, ..._35, - ..._366, - ..._378, - ..._390, - ..._405 - }; - } - export namespace authz { - export const v1beta1 = { ..._36, ..._37, - ..._38, - ..._39, - ..._40, - ..._367, - ..._379, - ..._391, - ..._406 + ..._363, + ..._374, + ..._385, + ..._399 }; } export namespace bank { export const v1beta1 = { + ..._38, + ..._39, + ..._40, ..._41, ..._42, - ..._43, - ..._44, - ..._45, - ..._368, - ..._380, - ..._392, - ..._407 + ..._364, + ..._375, + ..._386, + ..._400 }; } export namespace base { export namespace abci { export const v1beta1 = { - ..._46 + ..._43 }; } export namespace query { export const v1beta1 = { - ..._47 + ..._44 }; } export namespace tendermint { export const v1beta1 = { - ..._48, - ..._49, - ..._393 + ..._45, + ..._46, + ..._387 }; } export const v1beta1 = { - ..._50 + ..._47 }; } export namespace crypto { export const ed25519 = { - ..._51 + ..._48 }; export const multisig = { - ..._52 + ..._49 }; export const secp256k1 = { - ..._53 + ..._50 }; } export namespace distribution { export const v1beta1 = { + ..._51, + ..._52, + ..._53, ..._54, - ..._55, - ..._56, - ..._57, - ..._369, - ..._381, - ..._394, - ..._408 + ..._365, + ..._376, + ..._388, + ..._401 }; } export namespace feegrant { export const v1beta1 = { + ..._55, + ..._56, + ..._57, ..._58, - ..._59, - ..._60, - ..._61, - ..._370, - ..._382, - ..._395, - ..._409 + ..._366, + ..._377, + ..._389, + ..._402 }; } export namespace gov { export const v1 = { + ..._59, + ..._60, + ..._61, ..._62, + ..._367, + ..._378, + ..._390, + ..._403 + }; + export const v1beta1 = { ..._63, ..._64, ..._65, - ..._371, - ..._383, - ..._396, - ..._410 - }; - export const v1beta1 = { ..._66, - ..._67, - ..._68, - ..._69, - ..._372, - ..._384, - ..._397, - ..._411 + ..._368, + ..._379, + ..._391, + ..._404 }; } export namespace mint { export const v1beta1 = { + ..._67, + ..._68, + ..._69, ..._70, - ..._71, - ..._72, - ..._73, - ..._373, - ..._385, - ..._398, - ..._412 + ..._369, + ..._380, + ..._392, + ..._405 }; } export namespace msg { export const v1 = { - ..._74 + ..._71 }; } export namespace orm { export const v1 = { - ..._75 + ..._72 }; } export namespace params { export const v1beta1 = { - ..._76, - ..._77, - ..._399 + ..._73, + ..._74, + ..._393 }; } export namespace query { export const v1 = { - ..._78 + ..._75 }; } export namespace slashing { export const v1beta1 = { + ..._76, + ..._77, + ..._78, ..._79, - ..._80, - ..._81, - ..._82, - ..._374, - ..._386, - ..._400, - ..._413 + ..._370, + ..._381, + ..._394, + ..._406 }; } export namespace staking { export const v1beta1 = { + ..._80, + ..._81, + ..._82, ..._83, ..._84, - ..._85, - ..._86, - ..._87, - ..._375, - ..._387, - ..._401, - ..._414 + ..._371, + ..._382, + ..._395, + ..._407 }; } export namespace tx { export namespace signing { export const v1beta1 = { - ..._88 + ..._85 }; } export const v1beta1 = { - ..._89, - ..._90, - ..._402 + ..._86, + ..._87, + ..._396 }; } export namespace upgrade { export const v1beta1 = { - ..._91, - ..._92, - ..._93, - ..._376, - ..._388, - ..._403, - ..._415 + ..._88, + ..._89, + ..._90, + ..._372, + ..._383, + ..._397, + ..._408 }; } export const ClientFactory = { - ..._601, - ..._602 + ..._594, + ..._595 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/client.ts b/packages/types/protobuf/codegen/cosmos/client.ts index 9047cc565..a0691dfb2 100644 --- a/packages/types/protobuf/codegen/cosmos/client.ts +++ b/packages/types/protobuf/codegen/cosmos/client.ts @@ -1,7 +1,6 @@ import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; import { AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; -import * as cosmosAdminmoduleAdminmoduleTxRegistry from "./adminmodule/adminmodule/tx.registry"; import * as cosmosAuthV1beta1TxRegistry from "./auth/v1beta1/tx.registry"; import * as cosmosAuthzV1beta1TxRegistry from "./authz/v1beta1/tx.registry"; import * as cosmosBankV1beta1TxRegistry from "./bank/v1beta1/tx.registry"; @@ -13,7 +12,6 @@ import * as cosmosMintV1beta1TxRegistry from "./mint/v1beta1/tx.registry"; import * as cosmosSlashingV1beta1TxRegistry from "./slashing/v1beta1/tx.registry"; import * as cosmosStakingV1beta1TxRegistry from "./staking/v1beta1/tx.registry"; import * as cosmosUpgradeV1beta1TxRegistry from "./upgrade/v1beta1/tx.registry"; -import * as cosmosAdminmoduleAdminmoduleTxAmino from "./adminmodule/adminmodule/tx.amino"; import * as cosmosAuthV1beta1TxAmino from "./auth/v1beta1/tx.amino"; import * as cosmosAuthzV1beta1TxAmino from "./authz/v1beta1/tx.amino"; import * as cosmosBankV1beta1TxAmino from "./bank/v1beta1/tx.amino"; @@ -26,7 +24,6 @@ import * as cosmosSlashingV1beta1TxAmino from "./slashing/v1beta1/tx.amino"; import * as cosmosStakingV1beta1TxAmino from "./staking/v1beta1/tx.amino"; import * as cosmosUpgradeV1beta1TxAmino from "./upgrade/v1beta1/tx.amino"; export const cosmosAminoConverters = { - ...cosmosAdminmoduleAdminmoduleTxAmino.AminoConverter, ...cosmosAuthV1beta1TxAmino.AminoConverter, ...cosmosAuthzV1beta1TxAmino.AminoConverter, ...cosmosBankV1beta1TxAmino.AminoConverter, @@ -39,7 +36,7 @@ export const cosmosAminoConverters = { ...cosmosStakingV1beta1TxAmino.AminoConverter, ...cosmosUpgradeV1beta1TxAmino.AminoConverter }; -export const cosmosProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...cosmosAdminmoduleAdminmoduleTxRegistry.registry, ...cosmosAuthV1beta1TxRegistry.registry, ...cosmosAuthzV1beta1TxRegistry.registry, ...cosmosBankV1beta1TxRegistry.registry, ...cosmosDistributionV1beta1TxRegistry.registry, ...cosmosFeegrantV1beta1TxRegistry.registry, ...cosmosGovV1TxRegistry.registry, ...cosmosGovV1beta1TxRegistry.registry, ...cosmosMintV1beta1TxRegistry.registry, ...cosmosSlashingV1beta1TxRegistry.registry, ...cosmosStakingV1beta1TxRegistry.registry, ...cosmosUpgradeV1beta1TxRegistry.registry]; +export const cosmosProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...cosmosAuthV1beta1TxRegistry.registry, ...cosmosAuthzV1beta1TxRegistry.registry, ...cosmosBankV1beta1TxRegistry.registry, ...cosmosDistributionV1beta1TxRegistry.registry, ...cosmosFeegrantV1beta1TxRegistry.registry, ...cosmosGovV1TxRegistry.registry, ...cosmosGovV1beta1TxRegistry.registry, ...cosmosMintV1beta1TxRegistry.registry, ...cosmosSlashingV1beta1TxRegistry.registry, ...cosmosStakingV1beta1TxRegistry.registry, ...cosmosUpgradeV1beta1TxRegistry.registry]; export const getSigningCosmosClientOptions = (): { registry: Registry; aminoTypes: AminoTypes; diff --git a/packages/types/protobuf/codegen/cosmos/rpc.query.ts b/packages/types/protobuf/codegen/cosmos/rpc.query.ts index af511d25d..1fdb1dc7b 100644 --- a/packages/types/protobuf/codegen/cosmos/rpc.query.ts +++ b/packages/types/protobuf/codegen/cosmos/rpc.query.ts @@ -9,9 +9,6 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { - adminmodule: { - adminmodule: (await import("./adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) - }, auth: { v1beta1: (await import("./auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/cosmos/rpc.tx.ts b/packages/types/protobuf/codegen/cosmos/rpc.tx.ts index ca318bce8..080131032 100644 --- a/packages/types/protobuf/codegen/cosmos/rpc.tx.ts +++ b/packages/types/protobuf/codegen/cosmos/rpc.tx.ts @@ -5,9 +5,6 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { - adminmodule: { - adminmodule: new (await import("./adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) - }, auth: { v1beta1: new (await import("./auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/cosmwasm/bundle.ts b/packages/types/protobuf/codegen/cosmwasm/bundle.ts index e999518cd..635940756 100644 --- a/packages/types/protobuf/codegen/cosmwasm/bundle.ts +++ b/packages/types/protobuf/codegen/cosmwasm/bundle.ts @@ -1,56 +1,56 @@ -import * as _94 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _95 from "./tokenfactory/v1beta1/genesis"; -import * as _96 from "./tokenfactory/v1beta1/params"; -import * as _97 from "./tokenfactory/v1beta1/query"; -import * as _98 from "./tokenfactory/v1beta1/tx"; -import * as _99 from "./wasm/v1/authz"; -import * as _100 from "./wasm/v1/genesis"; -import * as _101 from "./wasm/v1/ibc"; -import * as _102 from "./wasm/v1/proposal"; -import * as _103 from "./wasm/v1/query"; -import * as _104 from "./wasm/v1/tx"; -import * as _105 from "./wasm/v1/types"; -import * as _416 from "./tokenfactory/v1beta1/tx.amino"; -import * as _417 from "./wasm/v1/tx.amino"; -import * as _418 from "./tokenfactory/v1beta1/tx.registry"; -import * as _419 from "./wasm/v1/tx.registry"; -import * as _420 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _421 from "./wasm/v1/query.rpc.Query"; -import * as _422 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _423 from "./wasm/v1/tx.rpc.msg"; -import * as _603 from "./rpc.query"; -import * as _604 from "./rpc.tx"; +import * as _91 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _92 from "./tokenfactory/v1beta1/genesis"; +import * as _93 from "./tokenfactory/v1beta1/params"; +import * as _94 from "./tokenfactory/v1beta1/query"; +import * as _95 from "./tokenfactory/v1beta1/tx"; +import * as _96 from "./wasm/v1/authz"; +import * as _97 from "./wasm/v1/genesis"; +import * as _98 from "./wasm/v1/ibc"; +import * as _99 from "./wasm/v1/proposal"; +import * as _100 from "./wasm/v1/query"; +import * as _101 from "./wasm/v1/tx"; +import * as _102 from "./wasm/v1/types"; +import * as _409 from "./tokenfactory/v1beta1/tx.amino"; +import * as _410 from "./wasm/v1/tx.amino"; +import * as _411 from "./tokenfactory/v1beta1/tx.registry"; +import * as _412 from "./wasm/v1/tx.registry"; +import * as _413 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _414 from "./wasm/v1/query.rpc.Query"; +import * as _415 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _416 from "./wasm/v1/tx.rpc.msg"; +import * as _596 from "./rpc.query"; +import * as _597 from "./rpc.tx"; export namespace cosmwasm { export namespace tokenfactory { export const v1beta1 = { + ..._91, + ..._92, + ..._93, ..._94, ..._95, - ..._96, - ..._97, - ..._98, - ..._416, - ..._418, - ..._420, - ..._422 + ..._409, + ..._411, + ..._413, + ..._415 }; } export namespace wasm { export const v1 = { + ..._96, + ..._97, + ..._98, ..._99, ..._100, ..._101, ..._102, - ..._103, - ..._104, - ..._105, - ..._417, - ..._419, - ..._421, - ..._423 + ..._410, + ..._412, + ..._414, + ..._416 }; } export const ClientFactory = { - ..._603, - ..._604 + ..._596, + ..._597 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmwasm/rpc.query.ts b/packages/types/protobuf/codegen/cosmwasm/rpc.query.ts index 69f79a13a..7d9a9b83b 100644 --- a/packages/types/protobuf/codegen/cosmwasm/rpc.query.ts +++ b/packages/types/protobuf/codegen/cosmwasm/rpc.query.ts @@ -9,9 +9,6 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { - adminmodule: { - adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) - }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/cosmwasm/rpc.tx.ts b/packages/types/protobuf/codegen/cosmwasm/rpc.tx.ts index c2d70a170..23b50e5e8 100644 --- a/packages/types/protobuf/codegen/cosmwasm/rpc.tx.ts +++ b/packages/types/protobuf/codegen/cosmwasm/rpc.tx.ts @@ -5,9 +5,6 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { - adminmodule: { - adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) - }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/gaia/bundle.ts b/packages/types/protobuf/codegen/gaia/bundle.ts index 1895eab61..e3bb970e5 100644 --- a/packages/types/protobuf/codegen/gaia/bundle.ts +++ b/packages/types/protobuf/codegen/gaia/bundle.ts @@ -1,26 +1,26 @@ -import * as _106 from "./globalfee/v1beta1/genesis"; -import * as _107 from "./globalfee/v1beta1/query"; -import * as _108 from "./globalfee/v1beta1/tx"; -import * as _424 from "./globalfee/v1beta1/tx.amino"; -import * as _425 from "./globalfee/v1beta1/tx.registry"; -import * as _426 from "./globalfee/v1beta1/query.rpc.Query"; -import * as _427 from "./globalfee/v1beta1/tx.rpc.msg"; -import * as _605 from "./rpc.query"; -import * as _606 from "./rpc.tx"; +import * as _103 from "./globalfee/v1beta1/genesis"; +import * as _104 from "./globalfee/v1beta1/query"; +import * as _105 from "./globalfee/v1beta1/tx"; +import * as _417 from "./globalfee/v1beta1/tx.amino"; +import * as _418 from "./globalfee/v1beta1/tx.registry"; +import * as _419 from "./globalfee/v1beta1/query.rpc.Query"; +import * as _420 from "./globalfee/v1beta1/tx.rpc.msg"; +import * as _598 from "./rpc.query"; +import * as _599 from "./rpc.tx"; export namespace gaia { export namespace globalfee { export const v1beta1 = { - ..._106, - ..._107, - ..._108, - ..._424, - ..._425, - ..._426, - ..._427 + ..._103, + ..._104, + ..._105, + ..._417, + ..._418, + ..._419, + ..._420 }; } export const ClientFactory = { - ..._605, - ..._606 + ..._598, + ..._599 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/gaia/rpc.query.ts b/packages/types/protobuf/codegen/gaia/rpc.query.ts index f618a7948..cc8c0b389 100644 --- a/packages/types/protobuf/codegen/gaia/rpc.query.ts +++ b/packages/types/protobuf/codegen/gaia/rpc.query.ts @@ -9,9 +9,6 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { - adminmodule: { - adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) - }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/gaia/rpc.tx.ts b/packages/types/protobuf/codegen/gaia/rpc.tx.ts index 367144fa3..b8564052c 100644 --- a/packages/types/protobuf/codegen/gaia/rpc.tx.ts +++ b/packages/types/protobuf/codegen/gaia/rpc.tx.ts @@ -5,9 +5,6 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { - adminmodule: { - adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) - }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/gogoproto/bundle.ts b/packages/types/protobuf/codegen/gogoproto/bundle.ts index 3be6436d1..b00af3007 100644 --- a/packages/types/protobuf/codegen/gogoproto/bundle.ts +++ b/packages/types/protobuf/codegen/gogoproto/bundle.ts @@ -1,4 +1,4 @@ -import * as _109 from "./gogo"; +import * as _106 from "./gogo"; export const gogoproto = { - ..._109 + ..._106 }; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/google/bundle.ts b/packages/types/protobuf/codegen/google/bundle.ts index 622f2650e..4fa43f377 100644 --- a/packages/types/protobuf/codegen/google/bundle.ts +++ b/packages/types/protobuf/codegen/google/bundle.ts @@ -1,20 +1,20 @@ -import * as _110 from "./api/annotations"; -import * as _111 from "./api/http"; -import * as _112 from "./protobuf/any"; -import * as _113 from "./protobuf/descriptor"; -import * as _114 from "./protobuf/duration"; -import * as _115 from "./protobuf/empty"; -import * as _116 from "./protobuf/timestamp"; +import * as _107 from "./api/annotations"; +import * as _108 from "./api/http"; +import * as _109 from "./protobuf/any"; +import * as _110 from "./protobuf/descriptor"; +import * as _111 from "./protobuf/duration"; +import * as _112 from "./protobuf/empty"; +import * as _113 from "./protobuf/timestamp"; export namespace google { export const api = { - ..._110, - ..._111 + ..._107, + ..._108 }; export const protobuf = { + ..._109, + ..._110, + ..._111, ..._112, - ..._113, - ..._114, - ..._115, - ..._116 + ..._113 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/bundle.ts b/packages/types/protobuf/codegen/ibc/bundle.ts index 08c1f1797..d0eba8f4d 100644 --- a/packages/types/protobuf/codegen/ibc/bundle.ts +++ b/packages/types/protobuf/codegen/ibc/bundle.ts @@ -1,120 +1,120 @@ -import * as _117 from "./applications/interchain_accounts/controller/v1/controller"; -import * as _118 from "./applications/interchain_accounts/controller/v1/query"; -import * as _119 from "./applications/interchain_accounts/controller/v1/tx"; -import * as _120 from "./applications/interchain_accounts/host/v1/host"; -import * as _121 from "./applications/interchain_accounts/host/v1/query"; -import * as _122 from "./applications/interchain_accounts/host/v1/tx"; -import * as _123 from "./applications/interchain_accounts/v1/account"; -import * as _124 from "./applications/interchain_accounts/v1/metadata"; -import * as _125 from "./applications/interchain_accounts/v1/packet"; -import * as _126 from "./applications/transfer/v1/authz"; -import * as _127 from "./applications/transfer/v1/genesis"; -import * as _128 from "./applications/transfer/v1/query"; -import * as _129 from "./applications/transfer/v1/transfer"; -import * as _130 from "./applications/transfer/v1/tx"; -import * as _131 from "./core/channel/v1/channel"; -import * as _132 from "./core/channel/v1/genesis"; -import * as _133 from "./core/channel/v1/query"; -import * as _134 from "./core/channel/v1/tx"; -import * as _135 from "./core/client/v1/client"; -import * as _136 from "./core/client/v1/genesis"; -import * as _137 from "./core/client/v1/query"; -import * as _138 from "./core/client/v1/tx"; -import * as _428 from "./applications/interchain_accounts/controller/v1/tx.amino"; -import * as _429 from "./applications/interchain_accounts/host/v1/tx.amino"; -import * as _430 from "./applications/transfer/v1/tx.amino"; -import * as _431 from "./core/channel/v1/tx.amino"; -import * as _432 from "./core/client/v1/tx.amino"; -import * as _433 from "./applications/interchain_accounts/controller/v1/tx.registry"; -import * as _434 from "./applications/interchain_accounts/host/v1/tx.registry"; -import * as _435 from "./applications/transfer/v1/tx.registry"; -import * as _436 from "./core/channel/v1/tx.registry"; -import * as _437 from "./core/client/v1/tx.registry"; -import * as _438 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; -import * as _439 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; -import * as _440 from "./applications/transfer/v1/query.rpc.Query"; -import * as _441 from "./core/channel/v1/query.rpc.Query"; -import * as _442 from "./core/client/v1/query.rpc.Query"; -import * as _443 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; -import * as _444 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; -import * as _445 from "./applications/transfer/v1/tx.rpc.msg"; -import * as _446 from "./core/channel/v1/tx.rpc.msg"; -import * as _447 from "./core/client/v1/tx.rpc.msg"; -import * as _607 from "./rpc.query"; -import * as _608 from "./rpc.tx"; +import * as _114 from "./applications/interchain_accounts/controller/v1/controller"; +import * as _115 from "./applications/interchain_accounts/controller/v1/query"; +import * as _116 from "./applications/interchain_accounts/controller/v1/tx"; +import * as _117 from "./applications/interchain_accounts/host/v1/host"; +import * as _118 from "./applications/interchain_accounts/host/v1/query"; +import * as _119 from "./applications/interchain_accounts/host/v1/tx"; +import * as _120 from "./applications/interchain_accounts/v1/account"; +import * as _121 from "./applications/interchain_accounts/v1/metadata"; +import * as _122 from "./applications/interchain_accounts/v1/packet"; +import * as _123 from "./applications/transfer/v1/authz"; +import * as _124 from "./applications/transfer/v1/genesis"; +import * as _125 from "./applications/transfer/v1/query"; +import * as _126 from "./applications/transfer/v1/transfer"; +import * as _127 from "./applications/transfer/v1/tx"; +import * as _128 from "./core/channel/v1/channel"; +import * as _129 from "./core/channel/v1/genesis"; +import * as _130 from "./core/channel/v1/query"; +import * as _131 from "./core/channel/v1/tx"; +import * as _132 from "./core/client/v1/client"; +import * as _133 from "./core/client/v1/genesis"; +import * as _134 from "./core/client/v1/query"; +import * as _135 from "./core/client/v1/tx"; +import * as _421 from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as _422 from "./applications/interchain_accounts/host/v1/tx.amino"; +import * as _423 from "./applications/transfer/v1/tx.amino"; +import * as _424 from "./core/channel/v1/tx.amino"; +import * as _425 from "./core/client/v1/tx.amino"; +import * as _426 from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as _427 from "./applications/interchain_accounts/host/v1/tx.registry"; +import * as _428 from "./applications/transfer/v1/tx.registry"; +import * as _429 from "./core/channel/v1/tx.registry"; +import * as _430 from "./core/client/v1/tx.registry"; +import * as _431 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; +import * as _432 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; +import * as _433 from "./applications/transfer/v1/query.rpc.Query"; +import * as _434 from "./core/channel/v1/query.rpc.Query"; +import * as _435 from "./core/client/v1/query.rpc.Query"; +import * as _436 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; +import * as _437 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; +import * as _438 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _439 from "./core/channel/v1/tx.rpc.msg"; +import * as _440 from "./core/client/v1/tx.rpc.msg"; +import * as _600 from "./rpc.query"; +import * as _601 from "./rpc.tx"; export namespace ibc { export namespace applications { export namespace interchain_accounts { export namespace controller { export const v1 = { - ..._117, - ..._118, - ..._119, - ..._428, - ..._433, - ..._438, - ..._443 + ..._114, + ..._115, + ..._116, + ..._421, + ..._426, + ..._431, + ..._436 }; } export namespace host { export const v1 = { - ..._120, - ..._121, - ..._122, - ..._429, - ..._434, - ..._439, - ..._444 + ..._117, + ..._118, + ..._119, + ..._422, + ..._427, + ..._432, + ..._437 }; } export const v1 = { - ..._123, - ..._124, - ..._125 + ..._120, + ..._121, + ..._122 }; } export namespace transfer { export const v1 = { + ..._123, + ..._124, + ..._125, ..._126, ..._127, - ..._128, - ..._129, - ..._130, - ..._430, - ..._435, - ..._440, - ..._445 + ..._423, + ..._428, + ..._433, + ..._438 }; } } export namespace core { export namespace channel { export const v1 = { + ..._128, + ..._129, + ..._130, ..._131, - ..._132, - ..._133, - ..._134, - ..._431, - ..._436, - ..._441, - ..._446 + ..._424, + ..._429, + ..._434, + ..._439 }; } export namespace client { export const v1 = { + ..._132, + ..._133, + ..._134, ..._135, - ..._136, - ..._137, - ..._138, - ..._432, - ..._437, - ..._442, - ..._447 + ..._425, + ..._430, + ..._435, + ..._440 }; } } export const ClientFactory = { - ..._607, - ..._608 + ..._600, + ..._601 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/rpc.query.ts b/packages/types/protobuf/codegen/ibc/rpc.query.ts index 1ddcf2919..bb51968df 100644 --- a/packages/types/protobuf/codegen/ibc/rpc.query.ts +++ b/packages/types/protobuf/codegen/ibc/rpc.query.ts @@ -9,9 +9,6 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { - adminmodule: { - adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) - }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/ibc/rpc.tx.ts b/packages/types/protobuf/codegen/ibc/rpc.tx.ts index 3df7ca454..14f8597c8 100644 --- a/packages/types/protobuf/codegen/ibc/rpc.tx.ts +++ b/packages/types/protobuf/codegen/ibc/rpc.tx.ts @@ -5,9 +5,6 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { - adminmodule: { - adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) - }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/juno/bundle.ts b/packages/types/protobuf/codegen/juno/bundle.ts index 0e402f74e..416c0d3f8 100644 --- a/packages/types/protobuf/codegen/juno/bundle.ts +++ b/packages/types/protobuf/codegen/juno/bundle.ts @@ -1,46 +1,46 @@ -import * as _139 from "./feeshare/v1/feeshare"; -import * as _140 from "./feeshare/v1/genesis"; -import * as _141 from "./feeshare/v1/query"; -import * as _142 from "./feeshare/v1/tx"; -import * as _143 from "./mint/genesis"; -import * as _144 from "./mint/mint"; -import * as _145 from "./mint/query"; -import * as _146 from "./mint/tx"; -import * as _448 from "./feeshare/v1/tx.amino"; -import * as _449 from "./mint/tx.amino"; -import * as _450 from "./feeshare/v1/tx.registry"; -import * as _451 from "./mint/tx.registry"; -import * as _452 from "./feeshare/v1/query.rpc.Query"; -import * as _453 from "./mint/query.rpc.Query"; -import * as _454 from "./feeshare/v1/tx.rpc.msg"; -import * as _455 from "./mint/tx.rpc.msg"; -import * as _609 from "./rpc.query"; -import * as _610 from "./rpc.tx"; +import * as _136 from "./feeshare/v1/feeshare"; +import * as _137 from "./feeshare/v1/genesis"; +import * as _138 from "./feeshare/v1/query"; +import * as _139 from "./feeshare/v1/tx"; +import * as _140 from "./mint/genesis"; +import * as _141 from "./mint/mint"; +import * as _142 from "./mint/query"; +import * as _143 from "./mint/tx"; +import * as _441 from "./feeshare/v1/tx.amino"; +import * as _442 from "./mint/tx.amino"; +import * as _443 from "./feeshare/v1/tx.registry"; +import * as _444 from "./mint/tx.registry"; +import * as _445 from "./feeshare/v1/query.rpc.Query"; +import * as _446 from "./mint/query.rpc.Query"; +import * as _447 from "./feeshare/v1/tx.rpc.msg"; +import * as _448 from "./mint/tx.rpc.msg"; +import * as _602 from "./rpc.query"; +import * as _603 from "./rpc.tx"; export namespace juno { export namespace feeshare { export const v1 = { + ..._136, + ..._137, + ..._138, ..._139, - ..._140, - ..._141, - ..._142, - ..._448, - ..._450, - ..._452, - ..._454 + ..._441, + ..._443, + ..._445, + ..._447 }; } export const mint = { + ..._140, + ..._141, + ..._142, ..._143, - ..._144, - ..._145, - ..._146, - ..._449, - ..._451, - ..._453, - ..._455 + ..._442, + ..._444, + ..._446, + ..._448 }; export const ClientFactory = { - ..._609, - ..._610 + ..._602, + ..._603 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/juno/rpc.query.ts b/packages/types/protobuf/codegen/juno/rpc.query.ts index 57dcab9eb..4cf3955e0 100644 --- a/packages/types/protobuf/codegen/juno/rpc.query.ts +++ b/packages/types/protobuf/codegen/juno/rpc.query.ts @@ -9,9 +9,6 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { - adminmodule: { - adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) - }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/juno/rpc.tx.ts b/packages/types/protobuf/codegen/juno/rpc.tx.ts index 79bcc00da..cc3112731 100644 --- a/packages/types/protobuf/codegen/juno/rpc.tx.ts +++ b/packages/types/protobuf/codegen/juno/rpc.tx.ts @@ -5,9 +5,6 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { - adminmodule: { - adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) - }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/kujira/bundle.ts b/packages/types/protobuf/codegen/kujira/bundle.ts index 0e695a6b2..6338ef311 100644 --- a/packages/types/protobuf/codegen/kujira/bundle.ts +++ b/packages/types/protobuf/codegen/kujira/bundle.ts @@ -1,60 +1,60 @@ -import * as _147 from "./denom/authorityMetadata"; -import * as _148 from "./denom/genesis"; -import * as _149 from "./denom/params"; -import * as _150 from "./denom/query"; -import * as _151 from "./denom/tx"; -import * as _152 from "./oracle/genesis"; -import * as _153 from "./oracle/oracle"; -import * as _154 from "./oracle/query"; -import * as _155 from "./oracle/tx"; -import * as _156 from "./scheduler/genesis"; -import * as _157 from "./scheduler/hook"; -import * as _158 from "./scheduler/params"; -import * as _159 from "./scheduler/proposal"; -import * as _160 from "./scheduler/query"; -import * as _456 from "./denom/tx.amino"; -import * as _457 from "./oracle/tx.amino"; -import * as _458 from "./denom/tx.registry"; -import * as _459 from "./oracle/tx.registry"; -import * as _460 from "./denom/query.rpc.Query"; -import * as _461 from "./oracle/query.rpc.Query"; -import * as _462 from "./scheduler/query.rpc.Query"; -import * as _463 from "./denom/tx.rpc.msg"; -import * as _464 from "./oracle/tx.rpc.msg"; -import * as _611 from "./rpc.query"; -import * as _612 from "./rpc.tx"; +import * as _144 from "./denom/authorityMetadata"; +import * as _145 from "./denom/genesis"; +import * as _146 from "./denom/params"; +import * as _147 from "./denom/query"; +import * as _148 from "./denom/tx"; +import * as _149 from "./oracle/genesis"; +import * as _150 from "./oracle/oracle"; +import * as _151 from "./oracle/query"; +import * as _152 from "./oracle/tx"; +import * as _153 from "./scheduler/genesis"; +import * as _154 from "./scheduler/hook"; +import * as _155 from "./scheduler/params"; +import * as _156 from "./scheduler/proposal"; +import * as _157 from "./scheduler/query"; +import * as _449 from "./denom/tx.amino"; +import * as _450 from "./oracle/tx.amino"; +import * as _451 from "./denom/tx.registry"; +import * as _452 from "./oracle/tx.registry"; +import * as _453 from "./denom/query.rpc.Query"; +import * as _454 from "./oracle/query.rpc.Query"; +import * as _455 from "./scheduler/query.rpc.Query"; +import * as _456 from "./denom/tx.rpc.msg"; +import * as _457 from "./oracle/tx.rpc.msg"; +import * as _604 from "./rpc.query"; +import * as _605 from "./rpc.tx"; export namespace kujira { export const denom = { + ..._144, + ..._145, + ..._146, ..._147, ..._148, + ..._449, + ..._451, + ..._453, + ..._456 + }; + export const oracle = { ..._149, ..._150, ..._151, - ..._456, - ..._458, - ..._460, - ..._463 - }; - export const oracle = { ..._152, + ..._450, + ..._452, + ..._454, + ..._457 + }; + export const scheduler = { ..._153, ..._154, ..._155, - ..._457, - ..._459, - ..._461, - ..._464 - }; - export const scheduler = { ..._156, ..._157, - ..._158, - ..._159, - ..._160, - ..._462 + ..._455 }; export const ClientFactory = { - ..._611, - ..._612 + ..._604, + ..._605 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/rpc.query.ts b/packages/types/protobuf/codegen/kujira/rpc.query.ts index 727b027e9..a7c8e57b3 100644 --- a/packages/types/protobuf/codegen/kujira/rpc.query.ts +++ b/packages/types/protobuf/codegen/kujira/rpc.query.ts @@ -9,9 +9,6 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { - adminmodule: { - adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) - }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/kujira/rpc.tx.ts b/packages/types/protobuf/codegen/kujira/rpc.tx.ts index 2fd2b0fc5..b10034d26 100644 --- a/packages/types/protobuf/codegen/kujira/rpc.tx.ts +++ b/packages/types/protobuf/codegen/kujira/rpc.tx.ts @@ -5,9 +5,6 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { - adminmodule: { - adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) - }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/neutron/bundle.ts b/packages/types/protobuf/codegen/neutron/bundle.ts index 983fd647c..5a2956f3f 100644 --- a/packages/types/protobuf/codegen/neutron/bundle.ts +++ b/packages/types/protobuf/codegen/neutron/bundle.ts @@ -1,85 +1,88 @@ -import * as _161 from "./contractmanager/v1/failure"; -import * as _162 from "./cron/genesis"; -import * as _163 from "./cron/params"; -import * as _164 from "./cron/query"; -import * as _165 from "./cron/schedule"; -import * as _166 from "./cron/tx"; -import * as _167 from "./dex/deposit_record"; -import * as _168 from "./dex/genesis"; -import * as _169 from "./dex/limit_order_expiration"; -import * as _170 from "./dex/limit_order_tranche_user"; -import * as _171 from "./dex/limit_order_tranche"; -import * as _172 from "./dex/pair_id"; -import * as _173 from "./dex/params"; -import * as _174 from "./dex/pool_metadata"; -import * as _175 from "./dex/pool_reserves"; -import * as _176 from "./dex/pool"; -import * as _177 from "./dex/query"; -import * as _178 from "./dex/tick_liquidity"; -import * as _179 from "./dex/trade_pair_id"; -import * as _180 from "./dex/tx"; -import * as _181 from "./feeburner/genesis"; -import * as _182 from "./feeburner/params"; -import * as _183 from "./feeburner/query"; -import * as _184 from "./feeburner/total_burned_neutrons_amount"; -import * as _185 from "./feeburner/tx"; -import * as _186 from "./feerefunder/fee"; -import * as _187 from "./feerefunder/genesis"; -import * as _188 from "./feerefunder/params"; -import * as _189 from "./feerefunder/query"; -import * as _190 from "./feerefunder/tx"; -import * as _191 from "./interchainqueries/genesis"; -import * as _192 from "./interchainqueries/params"; -import * as _193 from "./interchainqueries/query"; -import * as _194 from "./interchainqueries/tx"; -import * as _195 from "./interchaintxs/v1/genesis"; -import * as _196 from "./interchaintxs/v1/params"; -import * as _197 from "./interchaintxs/v1/query"; -import * as _198 from "./interchaintxs/v1/tx"; -import * as _465 from "./cron/tx.amino"; -import * as _466 from "./dex/tx.amino"; -import * as _467 from "./feeburner/tx.amino"; -import * as _468 from "./feerefunder/tx.amino"; -import * as _469 from "./interchainqueries/tx.amino"; -import * as _470 from "./interchaintxs/v1/tx.amino"; -import * as _471 from "./cron/tx.registry"; -import * as _472 from "./dex/tx.registry"; -import * as _473 from "./feeburner/tx.registry"; -import * as _474 from "./feerefunder/tx.registry"; -import * as _475 from "./interchainqueries/tx.registry"; -import * as _476 from "./interchaintxs/v1/tx.registry"; -import * as _477 from "./cron/query.rpc.Query"; -import * as _478 from "./dex/query.rpc.Query"; -import * as _479 from "./feeburner/query.rpc.Query"; -import * as _480 from "./feerefunder/query.rpc.Query"; -import * as _481 from "./interchainqueries/query.rpc.Query"; -import * as _482 from "./interchaintxs/v1/query.rpc.Query"; -import * as _483 from "./cron/tx.rpc.msg"; -import * as _484 from "./dex/tx.rpc.msg"; -import * as _485 from "./feeburner/tx.rpc.msg"; -import * as _486 from "./feerefunder/tx.rpc.msg"; -import * as _487 from "./interchainqueries/tx.rpc.msg"; -import * as _488 from "./interchaintxs/v1/tx.rpc.msg"; -import * as _613 from "./rpc.query"; -import * as _614 from "./rpc.tx"; +import * as _158 from "./contractmanager/v1/failure"; +import * as _159 from "./cron/genesis"; +import * as _160 from "./cron/params"; +import * as _161 from "./cron/query"; +import * as _162 from "./cron/schedule"; +import * as _163 from "./cron/tx"; +import * as _164 from "./dex/deposit_record"; +import * as _165 from "./dex/genesis"; +import * as _166 from "./dex/limit_order_expiration"; +import * as _167 from "./dex/limit_order_tranche_user"; +import * as _168 from "./dex/limit_order_tranche"; +import * as _169 from "./dex/pair_id"; +import * as _170 from "./dex/params"; +import * as _171 from "./dex/pool_metadata"; +import * as _172 from "./dex/pool_reserves"; +import * as _173 from "./dex/pool"; +import * as _174 from "./dex/query"; +import * as _175 from "./dex/tick_liquidity"; +import * as _176 from "./dex/trade_pair_id"; +import * as _177 from "./dex/tx"; +import * as _178 from "./feeburner/genesis"; +import * as _179 from "./feeburner/params"; +import * as _180 from "./feeburner/query"; +import * as _181 from "./feeburner/total_burned_neutrons_amount"; +import * as _182 from "./feeburner/tx"; +import * as _183 from "./feerefunder/fee"; +import * as _184 from "./feerefunder/genesis"; +import * as _185 from "./feerefunder/params"; +import * as _186 from "./feerefunder/query"; +import * as _187 from "./feerefunder/tx"; +import * as _188 from "./interchainqueries/genesis"; +import * as _189 from "./interchainqueries/params"; +import * as _190 from "./interchainqueries/query"; +import * as _191 from "./interchainqueries/tx"; +import * as _192 from "./interchaintxs/v1/genesis"; +import * as _193 from "./interchaintxs/v1/params"; +import * as _194 from "./interchaintxs/v1/query"; +import * as _195 from "./interchaintxs/v1/tx"; +import * as _458 from "./cron/tx.amino"; +import * as _459 from "./dex/tx.amino"; +import * as _460 from "./feeburner/tx.amino"; +import * as _461 from "./feerefunder/tx.amino"; +import * as _462 from "./interchainqueries/tx.amino"; +import * as _463 from "./interchaintxs/v1/tx.amino"; +import * as _464 from "./cron/tx.registry"; +import * as _465 from "./dex/tx.registry"; +import * as _466 from "./feeburner/tx.registry"; +import * as _467 from "./feerefunder/tx.registry"; +import * as _468 from "./interchainqueries/tx.registry"; +import * as _469 from "./interchaintxs/v1/tx.registry"; +import * as _470 from "./cron/query.rpc.Query"; +import * as _471 from "./dex/query.rpc.Query"; +import * as _472 from "./feeburner/query.rpc.Query"; +import * as _473 from "./feerefunder/query.rpc.Query"; +import * as _474 from "./interchainqueries/query.rpc.Query"; +import * as _475 from "./interchaintxs/v1/query.rpc.Query"; +import * as _476 from "./cron/tx.rpc.msg"; +import * as _477 from "./dex/tx.rpc.msg"; +import * as _478 from "./feeburner/tx.rpc.msg"; +import * as _479 from "./feerefunder/tx.rpc.msg"; +import * as _480 from "./interchainqueries/tx.rpc.msg"; +import * as _481 from "./interchaintxs/v1/tx.rpc.msg"; +import * as _606 from "./rpc.query"; +import * as _607 from "./rpc.tx"; export namespace neutron { export namespace contractmanager { export const v1 = { - ..._161 + ..._158 }; } export const cron = { + ..._159, + ..._160, + ..._161, ..._162, ..._163, + ..._458, + ..._464, + ..._470, + ..._476 + }; + export const dex = { ..._164, ..._165, ..._166, - ..._465, - ..._471, - ..._477, - ..._483 - }; - export const dex = { ..._167, ..._168, ..._169, @@ -91,60 +94,57 @@ export namespace neutron { ..._175, ..._176, ..._177, + ..._459, + ..._465, + ..._471, + ..._477 + }; + export const feeburner = { ..._178, ..._179, ..._180, + ..._181, + ..._182, + ..._460, ..._466, ..._472, - ..._478, - ..._484 + ..._478 }; - export const feeburner = { - ..._181, - ..._182, + export const feerefunder = { ..._183, ..._184, ..._185, + ..._186, + ..._187, + ..._461, ..._467, ..._473, - ..._479, - ..._485 + ..._479 }; - export const feerefunder = { - ..._186, - ..._187, + export const interchainqueries = { ..._188, ..._189, ..._190, + ..._191, + ..._462, ..._468, ..._474, - ..._480, - ..._486 - }; - export const interchainqueries = { - ..._191, - ..._192, - ..._193, - ..._194, - ..._469, - ..._475, - ..._481, - ..._487 + ..._480 }; export namespace interchaintxs { export const v1 = { + ..._192, + ..._193, + ..._194, ..._195, - ..._196, - ..._197, - ..._198, - ..._470, - ..._476, - ..._482, - ..._488 + ..._463, + ..._469, + ..._475, + ..._481 }; } export const ClientFactory = { - ..._613, - ..._614 + ..._606, + ..._607 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/neutron/rpc.query.ts b/packages/types/protobuf/codegen/neutron/rpc.query.ts index e61c84020..6a2fc37fe 100644 --- a/packages/types/protobuf/codegen/neutron/rpc.query.ts +++ b/packages/types/protobuf/codegen/neutron/rpc.query.ts @@ -9,9 +9,6 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { - adminmodule: { - adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) - }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/neutron/rpc.tx.ts b/packages/types/protobuf/codegen/neutron/rpc.tx.ts index ef8db8cf4..9c391ea03 100644 --- a/packages/types/protobuf/codegen/neutron/rpc.tx.ts +++ b/packages/types/protobuf/codegen/neutron/rpc.tx.ts @@ -5,9 +5,6 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { - adminmodule: { - adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) - }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/noble/bundle.ts b/packages/types/protobuf/codegen/noble/bundle.ts index 4d1233adf..45d38bbc9 100644 --- a/packages/types/protobuf/codegen/noble/bundle.ts +++ b/packages/types/protobuf/codegen/noble/bundle.ts @@ -1,16 +1,16 @@ -import * as _341 from "../tariff/genesis"; -import * as _342 from "../tariff/params"; -import * as _343 from "../tariff/query"; -import * as _595 from "../tariff/query.rpc.Query"; -import * as _623 from "./rpc.query"; +import * as _338 from "../tariff/genesis"; +import * as _339 from "../tariff/params"; +import * as _340 from "../tariff/query"; +import * as _588 from "../tariff/query.rpc.Query"; +import * as _616 from "./rpc.query"; export namespace noble { export const tariff = { - ..._341, - ..._342, - ..._343, - ..._595 + ..._338, + ..._339, + ..._340, + ..._588 }; export const ClientFactory = { - ..._623 + ..._616 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/noble/rpc.query.ts b/packages/types/protobuf/codegen/noble/rpc.query.ts index 5009a46c2..00d067ffb 100644 --- a/packages/types/protobuf/codegen/noble/rpc.query.ts +++ b/packages/types/protobuf/codegen/noble/rpc.query.ts @@ -9,9 +9,6 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { - adminmodule: { - adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) - }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/osmosis/bundle.ts b/packages/types/protobuf/codegen/osmosis/bundle.ts index dc3891b34..76c592f6f 100644 --- a/packages/types/protobuf/codegen/osmosis/bundle.ts +++ b/packages/types/protobuf/codegen/osmosis/bundle.ts @@ -1,162 +1,165 @@ -import * as _199 from "./accum/v1beta1/accum"; -import * as _200 from "./concentratedliquidity/params"; -import * as _201 from "./cosmwasmpool/v1beta1/genesis"; -import * as _202 from "./cosmwasmpool/v1beta1/gov"; -import * as _203 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; -import * as _204 from "./cosmwasmpool/v1beta1/model/module_query_msg"; -import * as _205 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; -import * as _206 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; -import * as _207 from "./cosmwasmpool/v1beta1/model/pool"; -import * as _208 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; -import * as _209 from "./cosmwasmpool/v1beta1/model/tx"; -import * as _210 from "./cosmwasmpool/v1beta1/params"; -import * as _211 from "./cosmwasmpool/v1beta1/query"; -import * as _212 from "./cosmwasmpool/v1beta1/tx"; -import * as _213 from "./gamm/pool-models/balancer/balancerPool"; -import * as _214 from "./gamm/v1beta1/genesis"; -import * as _215 from "./gamm/v1beta1/gov"; -import * as _216 from "./gamm/v1beta1/query"; -import * as _217 from "./gamm/v1beta1/shared"; -import * as _218 from "./gamm/v1beta1/tx"; -import * as _219 from "./gamm/pool-models/balancer/tx/tx"; -import * as _220 from "./gamm/pool-models/stableswap/stableswap_pool"; -import * as _221 from "./gamm/pool-models/stableswap/tx"; -import * as _222 from "./incentives/gauge"; -import * as _223 from "./incentives/genesis"; -import * as _224 from "./incentives/gov"; -import * as _225 from "./incentives/group"; -import * as _226 from "./incentives/params"; -import * as _227 from "./incentives/query"; -import * as _228 from "./incentives/tx"; -import * as _229 from "./lockup/genesis"; -import * as _230 from "./lockup/lock"; -import * as _231 from "./lockup/params"; -import * as _232 from "./lockup/query"; -import * as _233 from "./lockup/tx"; -import * as _234 from "./pool-incentives/v1beta1/genesis"; -import * as _235 from "./pool-incentives/v1beta1/gov"; -import * as _236 from "./pool-incentives/v1beta1/incentives"; -import * as _237 from "./pool-incentives/v1beta1/query"; -import * as _238 from "./pool-incentives/v1beta1/shared"; -import * as _239 from "./poolmanager/v1beta1/genesis"; -import * as _240 from "./poolmanager/v1beta1/gov"; -import * as _241 from "./poolmanager/v1beta1/module_route"; -import * as _242 from "./poolmanager/v1beta1/query"; -import * as _243 from "./poolmanager/v1beta1/swap_route"; -import * as _244 from "./poolmanager/v1beta1/tx"; -import * as _245 from "./protorev/v1beta1/genesis"; -import * as _246 from "./protorev/v1beta1/gov"; -import * as _247 from "./protorev/v1beta1/params"; -import * as _248 from "./protorev/v1beta1/protorev"; -import * as _249 from "./protorev/v1beta1/query"; -import * as _250 from "./protorev/v1beta1/tx"; -import * as _251 from "./smartaccount/v1beta1/genesis"; -import * as _252 from "./smartaccount/v1beta1/models"; -import * as _253 from "./smartaccount/v1beta1/params"; -import * as _254 from "./smartaccount/v1beta1/query"; -import * as _255 from "./smartaccount/v1beta1/tx"; -import * as _256 from "./superfluid/genesis"; -import * as _257 from "./superfluid/params"; -import * as _258 from "./superfluid/query"; -import * as _259 from "./superfluid/superfluid"; -import * as _260 from "./superfluid/tx"; -import * as _261 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _262 from "./tokenfactory/v1beta1/genesis"; -import * as _263 from "./tokenfactory/v1beta1/params"; -import * as _264 from "./tokenfactory/v1beta1/query"; -import * as _265 from "./tokenfactory/v1beta1/tx"; -import * as _266 from "./txfees/v1beta1/feetoken"; -import * as _267 from "./txfees/v1beta1/genesis"; -import * as _268 from "./txfees/v1beta1/gov"; -import * as _269 from "./txfees/v1beta1/params"; -import * as _270 from "./txfees/v1beta1/query"; -import * as _271 from "./txfees/v1beta1/tx"; -import * as _272 from "./valset-pref/v1beta1/query"; -import * as _273 from "./valset-pref/v1beta1/state"; -import * as _274 from "./valset-pref/v1beta1/tx"; -import * as _489 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; -import * as _490 from "./concentratedliquidity/v1beta1/tx.amino"; -import * as _491 from "./gamm/pool-models/balancer/tx/tx.amino"; -import * as _492 from "./gamm/pool-models/stableswap/tx.amino"; -import * as _493 from "./gamm/v1beta1/tx.amino"; -import * as _494 from "./incentives/tx.amino"; -import * as _495 from "./lockup/tx.amino"; -import * as _496 from "./poolmanager/v1beta1/tx.amino"; -import * as _497 from "./protorev/v1beta1/tx.amino"; -import * as _498 from "./smartaccount/v1beta1/tx.amino"; -import * as _499 from "./superfluid/tx.amino"; -import * as _500 from "./tokenfactory/v1beta1/tx.amino"; -import * as _501 from "./txfees/v1beta1/tx.amino"; -import * as _502 from "./valset-pref/v1beta1/tx.amino"; -import * as _503 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; -import * as _504 from "./concentratedliquidity/v1beta1/tx.registry"; -import * as _505 from "./gamm/pool-models/balancer/tx/tx.registry"; -import * as _506 from "./gamm/pool-models/stableswap/tx.registry"; -import * as _507 from "./gamm/v1beta1/tx.registry"; -import * as _508 from "./incentives/tx.registry"; -import * as _509 from "./lockup/tx.registry"; -import * as _510 from "./poolmanager/v1beta1/tx.registry"; -import * as _511 from "./protorev/v1beta1/tx.registry"; -import * as _512 from "./smartaccount/v1beta1/tx.registry"; -import * as _513 from "./superfluid/tx.registry"; -import * as _514 from "./tokenfactory/v1beta1/tx.registry"; -import * as _515 from "./txfees/v1beta1/tx.registry"; -import * as _516 from "./valset-pref/v1beta1/tx.registry"; -import * as _517 from "./concentratedliquidity/v1beta1/query.rpc.Query"; -import * as _518 from "./cosmwasmpool/v1beta1/query.rpc.Query"; -import * as _519 from "./gamm/v1beta1/query.rpc.Query"; -import * as _520 from "./incentives/query.rpc.Query"; -import * as _521 from "./lockup/query.rpc.Query"; -import * as _522 from "./pool-incentives/v1beta1/query.rpc.Query"; -import * as _523 from "./poolmanager/v1beta1/query.rpc.Query"; -import * as _524 from "./protorev/v1beta1/query.rpc.Query"; -import * as _525 from "./smartaccount/v1beta1/query.rpc.Query"; -import * as _526 from "./superfluid/query.rpc.Query"; -import * as _527 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _528 from "./txfees/v1beta1/query.rpc.Query"; -import * as _529 from "./valset-pref/v1beta1/query.rpc.Query"; -import * as _530 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; -import * as _531 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; -import * as _532 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; -import * as _533 from "./gamm/pool-models/stableswap/tx.rpc.msg"; -import * as _534 from "./gamm/v1beta1/tx.rpc.msg"; -import * as _535 from "./incentives/tx.rpc.msg"; -import * as _536 from "./lockup/tx.rpc.msg"; -import * as _537 from "./poolmanager/v1beta1/tx.rpc.msg"; -import * as _538 from "./protorev/v1beta1/tx.rpc.msg"; -import * as _539 from "./smartaccount/v1beta1/tx.rpc.msg"; -import * as _540 from "./superfluid/tx.rpc.msg"; -import * as _541 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _542 from "./txfees/v1beta1/tx.rpc.msg"; -import * as _543 from "./valset-pref/v1beta1/tx.rpc.msg"; -import * as _615 from "./rpc.query"; -import * as _616 from "./rpc.tx"; +import * as _196 from "./accum/v1beta1/accum"; +import * as _197 from "./concentratedliquidity/params"; +import * as _198 from "./cosmwasmpool/v1beta1/genesis"; +import * as _199 from "./cosmwasmpool/v1beta1/gov"; +import * as _200 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; +import * as _201 from "./cosmwasmpool/v1beta1/model/module_query_msg"; +import * as _202 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; +import * as _203 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; +import * as _204 from "./cosmwasmpool/v1beta1/model/pool"; +import * as _205 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; +import * as _206 from "./cosmwasmpool/v1beta1/model/tx"; +import * as _207 from "./cosmwasmpool/v1beta1/params"; +import * as _208 from "./cosmwasmpool/v1beta1/query"; +import * as _209 from "./cosmwasmpool/v1beta1/tx"; +import * as _210 from "./gamm/pool-models/balancer/balancerPool"; +import * as _211 from "./gamm/v1beta1/genesis"; +import * as _212 from "./gamm/v1beta1/gov"; +import * as _213 from "./gamm/v1beta1/query"; +import * as _214 from "./gamm/v1beta1/shared"; +import * as _215 from "./gamm/v1beta1/tx"; +import * as _216 from "./gamm/pool-models/balancer/tx/tx"; +import * as _217 from "./gamm/pool-models/stableswap/stableswap_pool"; +import * as _218 from "./gamm/pool-models/stableswap/tx"; +import * as _219 from "./incentives/gauge"; +import * as _220 from "./incentives/genesis"; +import * as _221 from "./incentives/gov"; +import * as _222 from "./incentives/group"; +import * as _223 from "./incentives/params"; +import * as _224 from "./incentives/query"; +import * as _225 from "./incentives/tx"; +import * as _226 from "./lockup/genesis"; +import * as _227 from "./lockup/lock"; +import * as _228 from "./lockup/params"; +import * as _229 from "./lockup/query"; +import * as _230 from "./lockup/tx"; +import * as _231 from "./pool-incentives/v1beta1/genesis"; +import * as _232 from "./pool-incentives/v1beta1/gov"; +import * as _233 from "./pool-incentives/v1beta1/incentives"; +import * as _234 from "./pool-incentives/v1beta1/query"; +import * as _235 from "./pool-incentives/v1beta1/shared"; +import * as _236 from "./poolmanager/v1beta1/genesis"; +import * as _237 from "./poolmanager/v1beta1/gov"; +import * as _238 from "./poolmanager/v1beta1/module_route"; +import * as _239 from "./poolmanager/v1beta1/query"; +import * as _240 from "./poolmanager/v1beta1/swap_route"; +import * as _241 from "./poolmanager/v1beta1/tx"; +import * as _242 from "./protorev/v1beta1/genesis"; +import * as _243 from "./protorev/v1beta1/gov"; +import * as _244 from "./protorev/v1beta1/params"; +import * as _245 from "./protorev/v1beta1/protorev"; +import * as _246 from "./protorev/v1beta1/query"; +import * as _247 from "./protorev/v1beta1/tx"; +import * as _248 from "./smartaccount/v1beta1/genesis"; +import * as _249 from "./smartaccount/v1beta1/models"; +import * as _250 from "./smartaccount/v1beta1/params"; +import * as _251 from "./smartaccount/v1beta1/query"; +import * as _252 from "./smartaccount/v1beta1/tx"; +import * as _253 from "./superfluid/genesis"; +import * as _254 from "./superfluid/params"; +import * as _255 from "./superfluid/query"; +import * as _256 from "./superfluid/superfluid"; +import * as _257 from "./superfluid/tx"; +import * as _258 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _259 from "./tokenfactory/v1beta1/genesis"; +import * as _260 from "./tokenfactory/v1beta1/params"; +import * as _261 from "./tokenfactory/v1beta1/query"; +import * as _262 from "./tokenfactory/v1beta1/tx"; +import * as _263 from "./txfees/v1beta1/feetoken"; +import * as _264 from "./txfees/v1beta1/genesis"; +import * as _265 from "./txfees/v1beta1/gov"; +import * as _266 from "./txfees/v1beta1/params"; +import * as _267 from "./txfees/v1beta1/query"; +import * as _268 from "./txfees/v1beta1/tx"; +import * as _269 from "./valset-pref/v1beta1/query"; +import * as _270 from "./valset-pref/v1beta1/state"; +import * as _271 from "./valset-pref/v1beta1/tx"; +import * as _482 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; +import * as _483 from "./concentratedliquidity/v1beta1/tx.amino"; +import * as _484 from "./gamm/pool-models/balancer/tx/tx.amino"; +import * as _485 from "./gamm/pool-models/stableswap/tx.amino"; +import * as _486 from "./gamm/v1beta1/tx.amino"; +import * as _487 from "./incentives/tx.amino"; +import * as _488 from "./lockup/tx.amino"; +import * as _489 from "./poolmanager/v1beta1/tx.amino"; +import * as _490 from "./protorev/v1beta1/tx.amino"; +import * as _491 from "./smartaccount/v1beta1/tx.amino"; +import * as _492 from "./superfluid/tx.amino"; +import * as _493 from "./tokenfactory/v1beta1/tx.amino"; +import * as _494 from "./txfees/v1beta1/tx.amino"; +import * as _495 from "./valset-pref/v1beta1/tx.amino"; +import * as _496 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; +import * as _497 from "./concentratedliquidity/v1beta1/tx.registry"; +import * as _498 from "./gamm/pool-models/balancer/tx/tx.registry"; +import * as _499 from "./gamm/pool-models/stableswap/tx.registry"; +import * as _500 from "./gamm/v1beta1/tx.registry"; +import * as _501 from "./incentives/tx.registry"; +import * as _502 from "./lockup/tx.registry"; +import * as _503 from "./poolmanager/v1beta1/tx.registry"; +import * as _504 from "./protorev/v1beta1/tx.registry"; +import * as _505 from "./smartaccount/v1beta1/tx.registry"; +import * as _506 from "./superfluid/tx.registry"; +import * as _507 from "./tokenfactory/v1beta1/tx.registry"; +import * as _508 from "./txfees/v1beta1/tx.registry"; +import * as _509 from "./valset-pref/v1beta1/tx.registry"; +import * as _510 from "./concentratedliquidity/v1beta1/query.rpc.Query"; +import * as _511 from "./cosmwasmpool/v1beta1/query.rpc.Query"; +import * as _512 from "./gamm/v1beta1/query.rpc.Query"; +import * as _513 from "./incentives/query.rpc.Query"; +import * as _514 from "./lockup/query.rpc.Query"; +import * as _515 from "./pool-incentives/v1beta1/query.rpc.Query"; +import * as _516 from "./poolmanager/v1beta1/query.rpc.Query"; +import * as _517 from "./protorev/v1beta1/query.rpc.Query"; +import * as _518 from "./smartaccount/v1beta1/query.rpc.Query"; +import * as _519 from "./superfluid/query.rpc.Query"; +import * as _520 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _521 from "./txfees/v1beta1/query.rpc.Query"; +import * as _522 from "./valset-pref/v1beta1/query.rpc.Query"; +import * as _523 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; +import * as _524 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; +import * as _525 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; +import * as _526 from "./gamm/pool-models/stableswap/tx.rpc.msg"; +import * as _527 from "./gamm/v1beta1/tx.rpc.msg"; +import * as _528 from "./incentives/tx.rpc.msg"; +import * as _529 from "./lockup/tx.rpc.msg"; +import * as _530 from "./poolmanager/v1beta1/tx.rpc.msg"; +import * as _531 from "./protorev/v1beta1/tx.rpc.msg"; +import * as _532 from "./smartaccount/v1beta1/tx.rpc.msg"; +import * as _533 from "./superfluid/tx.rpc.msg"; +import * as _534 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _535 from "./txfees/v1beta1/tx.rpc.msg"; +import * as _536 from "./valset-pref/v1beta1/tx.rpc.msg"; +import * as _608 from "./rpc.query"; +import * as _609 from "./rpc.tx"; export namespace osmosis { export namespace accum { export const v1beta1 = { - ..._199 + ..._196 }; } export const concentratedliquidity = { - ..._200, + ..._197, poolmodel: { concentrated: { v1beta1: { - ..._489, - ..._503, - ..._530 + ..._482, + ..._496, + ..._523 } } }, v1beta1: { - ..._490, - ..._504, - ..._517, - ..._531 + ..._483, + ..._497, + ..._510, + ..._524 } }; export namespace cosmwasmpool { export const v1beta1 = { + ..._198, + ..._199, + ..._200, ..._201, ..._202, ..._203, @@ -166,171 +169,168 @@ export namespace osmosis { ..._207, ..._208, ..._209, - ..._210, - ..._211, - ..._212, - ..._518 + ..._511 }; } export namespace gamm { export const v1beta1 = { + ..._210, + ..._211, + ..._212, ..._213, ..._214, ..._215, - ..._216, - ..._217, - ..._218, - ..._493, - ..._507, - ..._519, - ..._534 + ..._486, + ..._500, + ..._512, + ..._527 }; export namespace poolmodels { export namespace balancer { export const v1beta1 = { - ..._219, - ..._491, - ..._505, - ..._532 + ..._216, + ..._484, + ..._498, + ..._525 }; } export namespace stableswap { export const v1beta1 = { - ..._220, - ..._221, - ..._492, - ..._506, - ..._533 + ..._217, + ..._218, + ..._485, + ..._499, + ..._526 }; } } } export const incentives = { + ..._219, + ..._220, + ..._221, ..._222, ..._223, ..._224, ..._225, + ..._487, + ..._501, + ..._513, + ..._528 + }; + export const lockup = { ..._226, ..._227, ..._228, - ..._494, - ..._508, - ..._520, - ..._535 - }; - export const lockup = { ..._229, ..._230, - ..._231, - ..._232, - ..._233, - ..._495, - ..._509, - ..._521, - ..._536 + ..._488, + ..._502, + ..._514, + ..._529 }; export namespace poolincentives { export const v1beta1 = { + ..._231, + ..._232, + ..._233, ..._234, ..._235, - ..._236, - ..._237, - ..._238, - ..._522 + ..._515 }; } export namespace poolmanager { export const v1beta1 = { + ..._236, + ..._237, + ..._238, ..._239, ..._240, ..._241, - ..._242, - ..._243, - ..._244, - ..._496, - ..._510, - ..._523, - ..._537 + ..._489, + ..._503, + ..._516, + ..._530 }; } export namespace protorev { export const v1beta1 = { + ..._242, + ..._243, + ..._244, ..._245, ..._246, ..._247, - ..._248, - ..._249, - ..._250, - ..._497, - ..._511, - ..._524, - ..._538 + ..._490, + ..._504, + ..._517, + ..._531 }; } export namespace smartaccount { export const v1beta1 = { + ..._248, + ..._249, + ..._250, ..._251, ..._252, - ..._253, - ..._254, - ..._255, - ..._498, - ..._512, - ..._525, - ..._539 + ..._491, + ..._505, + ..._518, + ..._532 }; } export const superfluid = { + ..._253, + ..._254, + ..._255, ..._256, ..._257, - ..._258, - ..._259, - ..._260, - ..._499, - ..._513, - ..._526, - ..._540 + ..._492, + ..._506, + ..._519, + ..._533 }; export namespace tokenfactory { export const v1beta1 = { + ..._258, + ..._259, + ..._260, ..._261, ..._262, - ..._263, - ..._264, - ..._265, - ..._500, - ..._514, - ..._527, - ..._541 + ..._493, + ..._507, + ..._520, + ..._534 }; } export namespace txfees { export const v1beta1 = { + ..._263, + ..._264, + ..._265, ..._266, ..._267, ..._268, - ..._269, - ..._270, - ..._271, - ..._501, - ..._515, - ..._528, - ..._542 + ..._494, + ..._508, + ..._521, + ..._535 }; } export namespace valsetpref { export const v1beta1 = { - ..._272, - ..._273, - ..._274, - ..._502, - ..._516, - ..._529, - ..._543 + ..._269, + ..._270, + ..._271, + ..._495, + ..._509, + ..._522, + ..._536 }; } export const ClientFactory = { - ..._615, - ..._616 + ..._608, + ..._609 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/rpc.query.ts b/packages/types/protobuf/codegen/osmosis/rpc.query.ts index 672335001..fe0cef3a0 100644 --- a/packages/types/protobuf/codegen/osmosis/rpc.query.ts +++ b/packages/types/protobuf/codegen/osmosis/rpc.query.ts @@ -9,9 +9,6 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { - adminmodule: { - adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) - }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/osmosis/rpc.tx.ts b/packages/types/protobuf/codegen/osmosis/rpc.tx.ts index 47a15171d..007e34119 100644 --- a/packages/types/protobuf/codegen/osmosis/rpc.tx.ts +++ b/packages/types/protobuf/codegen/osmosis/rpc.tx.ts @@ -5,9 +5,6 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { - adminmodule: { - adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) - }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/pstake/bundle.ts b/packages/types/protobuf/codegen/pstake/bundle.ts index 4263003c8..b17905106 100644 --- a/packages/types/protobuf/codegen/pstake/bundle.ts +++ b/packages/types/protobuf/codegen/pstake/bundle.ts @@ -1,98 +1,98 @@ -import * as _275 from "./liquidstake/v1beta1/genesis"; -import * as _276 from "./liquidstake/v1beta1/liquidstake"; -import * as _277 from "./liquidstake/v1beta1/query"; -import * as _278 from "./liquidstake/v1beta1/tx"; -import * as _279 from "./liquidstakeibc/v1beta1/genesis"; -import * as _280 from "./liquidstakeibc/v1beta1/liquidstakeibc"; -import * as _281 from "./liquidstakeibc/v1beta1/msgs"; -import * as _282 from "./liquidstakeibc/v1beta1/params"; -import * as _283 from "./liquidstakeibc/v1beta1/query"; -import * as _284 from "./lscosmos/v1beta1/genesis"; -import * as _285 from "./lscosmos/v1beta1/governance_proposal"; -import * as _286 from "./lscosmos/v1beta1/lscosmos"; -import * as _287 from "./lscosmos/v1beta1/msgs"; -import * as _288 from "./lscosmos/v1beta1/params"; -import * as _289 from "./lscosmos/v1beta1/query"; -import * as _290 from "./ratesync/v1beta1/contract"; -import * as _291 from "./ratesync/v1beta1/genesis"; -import * as _292 from "./ratesync/v1beta1/params"; -import * as _293 from "./ratesync/v1beta1/query"; -import * as _294 from "./ratesync/v1beta1/ratesync"; -import * as _295 from "./ratesync/v1beta1/tx"; -import * as _544 from "./liquidstake/v1beta1/tx.amino"; -import * as _545 from "./liquidstakeibc/v1beta1/msgs.amino"; -import * as _546 from "./lscosmos/v1beta1/msgs.amino"; -import * as _547 from "./ratesync/v1beta1/tx.amino"; -import * as _548 from "./liquidstake/v1beta1/tx.registry"; -import * as _549 from "./liquidstakeibc/v1beta1/msgs.registry"; -import * as _550 from "./lscosmos/v1beta1/msgs.registry"; -import * as _551 from "./ratesync/v1beta1/tx.registry"; -import * as _552 from "./liquidstake/v1beta1/query.rpc.Query"; -import * as _553 from "./liquidstakeibc/v1beta1/query.rpc.Query"; -import * as _554 from "./lscosmos/v1beta1/query.rpc.Query"; -import * as _555 from "./ratesync/v1beta1/query.rpc.Query"; -import * as _556 from "./liquidstake/v1beta1/tx.rpc.msg"; -import * as _557 from "./liquidstakeibc/v1beta1/msgs.rpc.msg"; -import * as _558 from "./lscosmos/v1beta1/msgs.rpc.msg"; -import * as _559 from "./ratesync/v1beta1/tx.rpc.msg"; -import * as _617 from "./rpc.query"; -import * as _618 from "./rpc.tx"; +import * as _272 from "./liquidstake/v1beta1/genesis"; +import * as _273 from "./liquidstake/v1beta1/liquidstake"; +import * as _274 from "./liquidstake/v1beta1/query"; +import * as _275 from "./liquidstake/v1beta1/tx"; +import * as _276 from "./liquidstakeibc/v1beta1/genesis"; +import * as _277 from "./liquidstakeibc/v1beta1/liquidstakeibc"; +import * as _278 from "./liquidstakeibc/v1beta1/msgs"; +import * as _279 from "./liquidstakeibc/v1beta1/params"; +import * as _280 from "./liquidstakeibc/v1beta1/query"; +import * as _281 from "./lscosmos/v1beta1/genesis"; +import * as _282 from "./lscosmos/v1beta1/governance_proposal"; +import * as _283 from "./lscosmos/v1beta1/lscosmos"; +import * as _284 from "./lscosmos/v1beta1/msgs"; +import * as _285 from "./lscosmos/v1beta1/params"; +import * as _286 from "./lscosmos/v1beta1/query"; +import * as _287 from "./ratesync/v1beta1/contract"; +import * as _288 from "./ratesync/v1beta1/genesis"; +import * as _289 from "./ratesync/v1beta1/params"; +import * as _290 from "./ratesync/v1beta1/query"; +import * as _291 from "./ratesync/v1beta1/ratesync"; +import * as _292 from "./ratesync/v1beta1/tx"; +import * as _537 from "./liquidstake/v1beta1/tx.amino"; +import * as _538 from "./liquidstakeibc/v1beta1/msgs.amino"; +import * as _539 from "./lscosmos/v1beta1/msgs.amino"; +import * as _540 from "./ratesync/v1beta1/tx.amino"; +import * as _541 from "./liquidstake/v1beta1/tx.registry"; +import * as _542 from "./liquidstakeibc/v1beta1/msgs.registry"; +import * as _543 from "./lscosmos/v1beta1/msgs.registry"; +import * as _544 from "./ratesync/v1beta1/tx.registry"; +import * as _545 from "./liquidstake/v1beta1/query.rpc.Query"; +import * as _546 from "./liquidstakeibc/v1beta1/query.rpc.Query"; +import * as _547 from "./lscosmos/v1beta1/query.rpc.Query"; +import * as _548 from "./ratesync/v1beta1/query.rpc.Query"; +import * as _549 from "./liquidstake/v1beta1/tx.rpc.msg"; +import * as _550 from "./liquidstakeibc/v1beta1/msgs.rpc.msg"; +import * as _551 from "./lscosmos/v1beta1/msgs.rpc.msg"; +import * as _552 from "./ratesync/v1beta1/tx.rpc.msg"; +import * as _610 from "./rpc.query"; +import * as _611 from "./rpc.tx"; export namespace pstake { export namespace liquidstake { export const v1beta1 = { + ..._272, + ..._273, + ..._274, ..._275, - ..._276, - ..._277, - ..._278, - ..._544, - ..._548, - ..._552, - ..._556 + ..._537, + ..._541, + ..._545, + ..._549 }; } export namespace liquidstakeibc { export const v1beta1 = { + ..._276, + ..._277, + ..._278, ..._279, ..._280, - ..._281, - ..._282, - ..._283, - ..._545, - ..._549, - ..._553, - ..._557 + ..._538, + ..._542, + ..._546, + ..._550 }; } export namespace lscosmos { export const v1beta1 = { + ..._281, + ..._282, + ..._283, ..._284, ..._285, ..._286, - ..._287, - ..._288, - ..._289, - ..._546, - ..._550, - ..._554, - ..._558 + ..._539, + ..._543, + ..._547, + ..._551 }; } export namespace ratesync { export const v1beta1 = { + ..._287, + ..._288, + ..._289, ..._290, ..._291, ..._292, - ..._293, - ..._294, - ..._295, - ..._547, - ..._551, - ..._555, - ..._559 + ..._540, + ..._544, + ..._548, + ..._552 }; } export const ClientFactory = { - ..._617, - ..._618 + ..._610, + ..._611 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/rpc.query.ts b/packages/types/protobuf/codegen/pstake/rpc.query.ts index fe603a1f2..059eb0f34 100644 --- a/packages/types/protobuf/codegen/pstake/rpc.query.ts +++ b/packages/types/protobuf/codegen/pstake/rpc.query.ts @@ -9,9 +9,6 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { - adminmodule: { - adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) - }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/pstake/rpc.tx.ts b/packages/types/protobuf/codegen/pstake/rpc.tx.ts index d8338e6e0..73c4b893e 100644 --- a/packages/types/protobuf/codegen/pstake/rpc.tx.ts +++ b/packages/types/protobuf/codegen/pstake/rpc.tx.ts @@ -5,9 +5,6 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { - adminmodule: { - adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) - }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/publicawesome/bundle.ts b/packages/types/protobuf/codegen/publicawesome/bundle.ts index 86dbb1e3c..c581cd7ed 100644 --- a/packages/types/protobuf/codegen/publicawesome/bundle.ts +++ b/packages/types/protobuf/codegen/publicawesome/bundle.ts @@ -1,88 +1,88 @@ -import * as _296 from "./stargaze/alloc/v1beta1/genesis"; -import * as _297 from "./stargaze/alloc/v1beta1/params"; -import * as _298 from "./stargaze/alloc/v1beta1/query"; -import * as _299 from "./stargaze/alloc/v1beta1/tx"; -import * as _300 from "./stargaze/cron/v1/cron"; -import * as _301 from "./stargaze/cron/v1/genesis"; -import * as _302 from "./stargaze/cron/v1/proposal"; -import * as _303 from "./stargaze/cron/v1/query"; -import * as _304 from "./stargaze/cron/v1/tx"; -import * as _305 from "./stargaze/globalfee/v1/genesis"; -import * as _306 from "./stargaze/globalfee/v1/globalfee"; -import * as _307 from "./stargaze/globalfee/v1/proposal"; -import * as _308 from "./stargaze/globalfee/v1/query"; -import * as _309 from "./stargaze/globalfee/v1/tx"; -import * as _310 from "./stargaze/mint/v1beta1/genesis"; -import * as _311 from "./stargaze/mint/v1beta1/mint"; -import * as _312 from "./stargaze/mint/v1beta1/query"; -import * as _313 from "./stargaze/mint/v1beta1/tx"; -import * as _560 from "./stargaze/alloc/v1beta1/tx.amino"; -import * as _561 from "./stargaze/cron/v1/tx.amino"; -import * as _562 from "./stargaze/globalfee/v1/tx.amino"; -import * as _563 from "./stargaze/alloc/v1beta1/tx.registry"; -import * as _564 from "./stargaze/cron/v1/tx.registry"; -import * as _565 from "./stargaze/globalfee/v1/tx.registry"; -import * as _566 from "./stargaze/alloc/v1beta1/query.rpc.Query"; -import * as _567 from "./stargaze/cron/v1/query.rpc.Query"; -import * as _568 from "./stargaze/globalfee/v1/query.rpc.Query"; -import * as _569 from "./stargaze/mint/v1beta1/query.rpc.Query"; -import * as _570 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; -import * as _571 from "./stargaze/cron/v1/tx.rpc.msg"; -import * as _572 from "./stargaze/globalfee/v1/tx.rpc.msg"; -import * as _619 from "./rpc.query"; -import * as _620 from "./rpc.tx"; +import * as _293 from "./stargaze/alloc/v1beta1/genesis"; +import * as _294 from "./stargaze/alloc/v1beta1/params"; +import * as _295 from "./stargaze/alloc/v1beta1/query"; +import * as _296 from "./stargaze/alloc/v1beta1/tx"; +import * as _297 from "./stargaze/cron/v1/cron"; +import * as _298 from "./stargaze/cron/v1/genesis"; +import * as _299 from "./stargaze/cron/v1/proposal"; +import * as _300 from "./stargaze/cron/v1/query"; +import * as _301 from "./stargaze/cron/v1/tx"; +import * as _302 from "./stargaze/globalfee/v1/genesis"; +import * as _303 from "./stargaze/globalfee/v1/globalfee"; +import * as _304 from "./stargaze/globalfee/v1/proposal"; +import * as _305 from "./stargaze/globalfee/v1/query"; +import * as _306 from "./stargaze/globalfee/v1/tx"; +import * as _307 from "./stargaze/mint/v1beta1/genesis"; +import * as _308 from "./stargaze/mint/v1beta1/mint"; +import * as _309 from "./stargaze/mint/v1beta1/query"; +import * as _310 from "./stargaze/mint/v1beta1/tx"; +import * as _553 from "./stargaze/alloc/v1beta1/tx.amino"; +import * as _554 from "./stargaze/cron/v1/tx.amino"; +import * as _555 from "./stargaze/globalfee/v1/tx.amino"; +import * as _556 from "./stargaze/alloc/v1beta1/tx.registry"; +import * as _557 from "./stargaze/cron/v1/tx.registry"; +import * as _558 from "./stargaze/globalfee/v1/tx.registry"; +import * as _559 from "./stargaze/alloc/v1beta1/query.rpc.Query"; +import * as _560 from "./stargaze/cron/v1/query.rpc.Query"; +import * as _561 from "./stargaze/globalfee/v1/query.rpc.Query"; +import * as _562 from "./stargaze/mint/v1beta1/query.rpc.Query"; +import * as _563 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; +import * as _564 from "./stargaze/cron/v1/tx.rpc.msg"; +import * as _565 from "./stargaze/globalfee/v1/tx.rpc.msg"; +import * as _612 from "./rpc.query"; +import * as _613 from "./rpc.tx"; export namespace publicawesome { export namespace stargaze { export namespace alloc { export const v1beta1 = { + ..._293, + ..._294, + ..._295, ..._296, - ..._297, - ..._298, - ..._299, - ..._560, - ..._563, - ..._566, - ..._570 + ..._553, + ..._556, + ..._559, + ..._563 }; } export namespace cron { export const v1 = { + ..._297, + ..._298, + ..._299, ..._300, ..._301, - ..._302, - ..._303, - ..._304, - ..._561, - ..._564, - ..._567, - ..._571 + ..._554, + ..._557, + ..._560, + ..._564 }; } export namespace globalfee { export const v1 = { + ..._302, + ..._303, + ..._304, ..._305, ..._306, - ..._307, - ..._308, - ..._309, - ..._562, - ..._565, - ..._568, - ..._572 + ..._555, + ..._558, + ..._561, + ..._565 }; } export namespace mint { export const v1beta1 = { + ..._307, + ..._308, + ..._309, ..._310, - ..._311, - ..._312, - ..._313, - ..._569 + ..._562 }; } } export const ClientFactory = { - ..._619, - ..._620 + ..._612, + ..._613 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/publicawesome/rpc.query.ts b/packages/types/protobuf/codegen/publicawesome/rpc.query.ts index 0ac181dd6..64e76ccf8 100644 --- a/packages/types/protobuf/codegen/publicawesome/rpc.query.ts +++ b/packages/types/protobuf/codegen/publicawesome/rpc.query.ts @@ -9,9 +9,6 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { - adminmodule: { - adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) - }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/publicawesome/rpc.tx.ts b/packages/types/protobuf/codegen/publicawesome/rpc.tx.ts index 311ce8076..645ea22f4 100644 --- a/packages/types/protobuf/codegen/publicawesome/rpc.tx.ts +++ b/packages/types/protobuf/codegen/publicawesome/rpc.tx.ts @@ -5,9 +5,6 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { - adminmodule: { - adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) - }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/regen/bundle.ts b/packages/types/protobuf/codegen/regen/bundle.ts index efc75e00e..e1fa73d4b 100644 --- a/packages/types/protobuf/codegen/regen/bundle.ts +++ b/packages/types/protobuf/codegen/regen/bundle.ts @@ -1,134 +1,134 @@ -import * as _314 from "./data/v1/events"; -import * as _315 from "./data/v1/state"; -import * as _316 from "./data/v1/tx"; -import * as _317 from "./data/v1/types"; -import * as _318 from "./data/v2/events"; -import * as _319 from "./data/v2/state"; -import * as _320 from "./data/v2/tx"; -import * as _321 from "./data/v2/types"; -import * as _322 from "./ecocredit/basket/v1/events"; -import * as _323 from "./ecocredit/basket/v1/state"; -import * as _324 from "./ecocredit/basket/v1/tx"; -import * as _325 from "./ecocredit/basket/v1/types"; -import * as _326 from "./ecocredit/marketplace/v1/events"; -import * as _327 from "./ecocredit/marketplace/v1/state"; -import * as _328 from "./ecocredit/marketplace/v1/tx"; -import * as _329 from "./ecocredit/marketplace/v1/types"; -import * as _330 from "./ecocredit/orderbook/v1alpha1/memory"; -import * as _331 from "./ecocredit/v1/events"; -import * as _332 from "./ecocredit/v1/state"; -import * as _333 from "./ecocredit/v1/tx"; -import * as _334 from "./ecocredit/v1/types"; -import * as _335 from "./ecocredit/v1alpha1/events"; -import * as _336 from "./ecocredit/v1alpha1/genesis"; -import * as _337 from "./ecocredit/v1alpha1/tx"; -import * as _338 from "./ecocredit/v1alpha1/types"; -import * as _339 from "./intertx/v1/query"; -import * as _340 from "./intertx/v1/tx"; -import * as _573 from "./data/v1/tx.amino"; -import * as _574 from "./data/v2/tx.amino"; -import * as _575 from "./ecocredit/basket/v1/tx.amino"; -import * as _576 from "./ecocredit/marketplace/v1/tx.amino"; -import * as _577 from "./ecocredit/v1/tx.amino"; -import * as _578 from "./ecocredit/v1alpha1/tx.amino"; -import * as _579 from "./intertx/v1/tx.amino"; -import * as _580 from "./data/v1/tx.registry"; -import * as _581 from "./data/v2/tx.registry"; -import * as _582 from "./ecocredit/basket/v1/tx.registry"; -import * as _583 from "./ecocredit/marketplace/v1/tx.registry"; -import * as _584 from "./ecocredit/v1/tx.registry"; -import * as _585 from "./ecocredit/v1alpha1/tx.registry"; -import * as _586 from "./intertx/v1/tx.registry"; -import * as _587 from "./intertx/v1/query.rpc.Query"; -import * as _588 from "./data/v1/tx.rpc.msg"; -import * as _589 from "./data/v2/tx.rpc.msg"; -import * as _590 from "./ecocredit/basket/v1/tx.rpc.msg"; -import * as _591 from "./ecocredit/marketplace/v1/tx.rpc.msg"; -import * as _592 from "./ecocredit/v1/tx.rpc.msg"; -import * as _593 from "./ecocredit/v1alpha1/tx.rpc.msg"; -import * as _594 from "./intertx/v1/tx.rpc.msg"; -import * as _621 from "./rpc.query"; -import * as _622 from "./rpc.tx"; +import * as _311 from "./data/v1/events"; +import * as _312 from "./data/v1/state"; +import * as _313 from "./data/v1/tx"; +import * as _314 from "./data/v1/types"; +import * as _315 from "./data/v2/events"; +import * as _316 from "./data/v2/state"; +import * as _317 from "./data/v2/tx"; +import * as _318 from "./data/v2/types"; +import * as _319 from "./ecocredit/basket/v1/events"; +import * as _320 from "./ecocredit/basket/v1/state"; +import * as _321 from "./ecocredit/basket/v1/tx"; +import * as _322 from "./ecocredit/basket/v1/types"; +import * as _323 from "./ecocredit/marketplace/v1/events"; +import * as _324 from "./ecocredit/marketplace/v1/state"; +import * as _325 from "./ecocredit/marketplace/v1/tx"; +import * as _326 from "./ecocredit/marketplace/v1/types"; +import * as _327 from "./ecocredit/orderbook/v1alpha1/memory"; +import * as _328 from "./ecocredit/v1/events"; +import * as _329 from "./ecocredit/v1/state"; +import * as _330 from "./ecocredit/v1/tx"; +import * as _331 from "./ecocredit/v1/types"; +import * as _332 from "./ecocredit/v1alpha1/events"; +import * as _333 from "./ecocredit/v1alpha1/genesis"; +import * as _334 from "./ecocredit/v1alpha1/tx"; +import * as _335 from "./ecocredit/v1alpha1/types"; +import * as _336 from "./intertx/v1/query"; +import * as _337 from "./intertx/v1/tx"; +import * as _566 from "./data/v1/tx.amino"; +import * as _567 from "./data/v2/tx.amino"; +import * as _568 from "./ecocredit/basket/v1/tx.amino"; +import * as _569 from "./ecocredit/marketplace/v1/tx.amino"; +import * as _570 from "./ecocredit/v1/tx.amino"; +import * as _571 from "./ecocredit/v1alpha1/tx.amino"; +import * as _572 from "./intertx/v1/tx.amino"; +import * as _573 from "./data/v1/tx.registry"; +import * as _574 from "./data/v2/tx.registry"; +import * as _575 from "./ecocredit/basket/v1/tx.registry"; +import * as _576 from "./ecocredit/marketplace/v1/tx.registry"; +import * as _577 from "./ecocredit/v1/tx.registry"; +import * as _578 from "./ecocredit/v1alpha1/tx.registry"; +import * as _579 from "./intertx/v1/tx.registry"; +import * as _580 from "./intertx/v1/query.rpc.Query"; +import * as _581 from "./data/v1/tx.rpc.msg"; +import * as _582 from "./data/v2/tx.rpc.msg"; +import * as _583 from "./ecocredit/basket/v1/tx.rpc.msg"; +import * as _584 from "./ecocredit/marketplace/v1/tx.rpc.msg"; +import * as _585 from "./ecocredit/v1/tx.rpc.msg"; +import * as _586 from "./ecocredit/v1alpha1/tx.rpc.msg"; +import * as _587 from "./intertx/v1/tx.rpc.msg"; +import * as _614 from "./rpc.query"; +import * as _615 from "./rpc.tx"; export namespace regen { export namespace data { export const v1 = { + ..._311, + ..._312, + ..._313, ..._314, - ..._315, - ..._316, - ..._317, + ..._566, ..._573, - ..._580, - ..._588 + ..._581 }; export const v2 = { + ..._315, + ..._316, + ..._317, ..._318, - ..._319, - ..._320, - ..._321, + ..._567, ..._574, - ..._581, - ..._589 + ..._582 }; } export namespace ecocredit { export namespace basket { export const v1 = { + ..._319, + ..._320, + ..._321, ..._322, - ..._323, - ..._324, - ..._325, + ..._568, ..._575, - ..._582, - ..._590 + ..._583 }; } export namespace marketplace { export const v1 = { + ..._323, + ..._324, + ..._325, ..._326, - ..._327, - ..._328, - ..._329, + ..._569, ..._576, - ..._583, - ..._591 + ..._584 }; } export namespace orderbook { export const v1alpha1 = { - ..._330 + ..._327 }; } export const v1 = { + ..._328, + ..._329, + ..._330, ..._331, - ..._332, - ..._333, - ..._334, + ..._570, ..._577, - ..._584, - ..._592 + ..._585 }; export const v1alpha1 = { + ..._332, + ..._333, + ..._334, ..._335, - ..._336, - ..._337, - ..._338, + ..._571, ..._578, - ..._585, - ..._593 + ..._586 }; } export namespace intertx { export const v1 = { - ..._339, - ..._340, + ..._336, + ..._337, + ..._572, ..._579, - ..._586, - ..._587, - ..._594 + ..._580, + ..._587 }; } export const ClientFactory = { - ..._621, - ..._622 + ..._614, + ..._615 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/regen/rpc.query.ts b/packages/types/protobuf/codegen/regen/rpc.query.ts index e16cf9d44..ff22cb784 100644 --- a/packages/types/protobuf/codegen/regen/rpc.query.ts +++ b/packages/types/protobuf/codegen/regen/rpc.query.ts @@ -9,9 +9,6 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { - adminmodule: { - adminmodule: (await import("../cosmos/adminmodule/adminmodule/query.rpc.Query")).createRpcQueryExtension(client) - }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/packages/types/protobuf/codegen/regen/rpc.tx.ts b/packages/types/protobuf/codegen/regen/rpc.tx.ts index 22c5a0645..f5da8f197 100644 --- a/packages/types/protobuf/codegen/regen/rpc.tx.ts +++ b/packages/types/protobuf/codegen/regen/rpc.tx.ts @@ -5,9 +5,6 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { - adminmodule: { - adminmodule: new (await import("../cosmos/adminmodule/adminmodule/tx.rpc.msg")).MsgClientImpl(rpc) - }, auth: { v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, diff --git a/packages/types/protobuf/codegen/tendermint/bundle.ts b/packages/types/protobuf/codegen/tendermint/bundle.ts index 6516ee341..5e3553a99 100644 --- a/packages/types/protobuf/codegen/tendermint/bundle.ts +++ b/packages/types/protobuf/codegen/tendermint/bundle.ts @@ -1,32 +1,32 @@ -import * as _344 from "./abci/types"; -import * as _345 from "./crypto/keys"; -import * as _346 from "./crypto/proof"; -import * as _347 from "./p2p/types"; -import * as _348 from "./types/block"; -import * as _349 from "./types/evidence"; -import * as _350 from "./types/params"; -import * as _351 from "./types/types"; -import * as _352 from "./types/validator"; -import * as _353 from "./version/types"; +import * as _341 from "./abci/types"; +import * as _342 from "./crypto/keys"; +import * as _343 from "./crypto/proof"; +import * as _344 from "./p2p/types"; +import * as _345 from "./types/block"; +import * as _346 from "./types/evidence"; +import * as _347 from "./types/params"; +import * as _348 from "./types/types"; +import * as _349 from "./types/validator"; +import * as _350 from "./version/types"; export namespace tendermint { export const abci = { - ..._344 + ..._341 }; export const crypto = { - ..._345, - ..._346 + ..._342, + ..._343 }; export const p2p = { - ..._347 + ..._344 }; export const types = { + ..._345, + ..._346, + ..._347, ..._348, - ..._349, - ..._350, - ..._351, - ..._352 + ..._349 }; export const version = { - ..._353 + ..._350 }; } \ No newline at end of file diff --git a/packages/types/protobuf/scripts/codegen.js b/packages/types/protobuf/scripts/codegen.js index 3c59077ef..b66b66edc 100644 --- a/packages/types/protobuf/scripts/codegen.js +++ b/packages/types/protobuf/scripts/codegen.js @@ -116,7 +116,7 @@ telescope({ 'pstake.liquidstakeibc.v1beta1', 'pstake.lscosmos.v1beta1', 'pstake.ratesync.v1beta1', - 'cosmos.adminmodule.adminmodule', + // 'cosmos.adminmodule.adminmodule', 'bitsong.fantoken', ], }, From 9584b09e7400a91d683cf744516727173edceb06 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 13 Jun 2024 13:12:52 -0400 Subject: [PATCH 240/438] added explanatory comment --- packages/types/protobuf/scripts/codegen.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/types/protobuf/scripts/codegen.js b/packages/types/protobuf/scripts/codegen.js index b66b66edc..57fc989fb 100644 --- a/packages/types/protobuf/scripts/codegen.js +++ b/packages/types/protobuf/scripts/codegen.js @@ -116,8 +116,12 @@ telescope({ 'pstake.liquidstakeibc.v1beta1', 'pstake.lscosmos.v1beta1', 'pstake.ratesync.v1beta1', - // 'cosmos.adminmodule.adminmodule', 'bitsong.fantoken', + + // interferes with v1beta1 MsgSubmitProposal amino encoders since the + // type names overlap + // + // 'cosmos.adminmodule.adminmodule', ], }, // excluded: { From 35ab7fa88ce449525e8ce454309af5fb0ad9d823 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 13 Jun 2024 13:17:28 -0400 Subject: [PATCH 241/438] fixed gov proposal no indexer selector --- packages/state/recoil/selectors/chain.ts | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/packages/state/recoil/selectors/chain.ts b/packages/state/recoil/selectors/chain.ts index c249e1e4b..b2520be43 100644 --- a/packages/state/recoil/selectors/chain.ts +++ b/packages/state/recoil/selectors/chain.ts @@ -862,16 +862,15 @@ export const govProposalSelector = selectorFamily< const supportsV1Gov = get(chainSupportsV1GovModuleSelector({ chainId })) // Try to load from indexer first. - let indexerProposal: + const indexerProposal: | { id: string version: string data: string } | undefined - | null - try { - indexerProposal = get( + | null = get( + waitForAllSettled([ queryGenericIndexerSelector({ chainId, formula: 'gov/proposal', @@ -879,14 +878,9 @@ export const govProposalSelector = selectorFamily< id: proposalId, }, id, - }) - ) - } catch (err) { - // Ignore error if not Promise thrown by recoil. Otherwise rethrow. - if (err instanceof Promise) { - throw err - } - } + }), + ]) + )[0].valueMaybe() let govProposal: GovProposalWithDecodedContent | undefined From 1fb54e99c346d48dc2c526fa3d38084caf6e003d Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 14 Jun 2024 18:09:26 -0400 Subject: [PATCH 242/438] added utils scripts and more polytone connections --- packages/utils/README.md | 136 ++++--------------------- packages/utils/constants/chains.ts | 93 ++++++++++++++++- packages/utils/package.json | 6 +- packages/utils/scripts/dump-relayer.ts | 103 +++++++++++++++++++ packages/utils/scripts/log-code-ids.ts | 33 ++++++ 5 files changed, 253 insertions(+), 118 deletions(-) create mode 100644 packages/utils/scripts/dump-relayer.ts create mode 100644 packages/utils/scripts/log-code-ids.ts diff --git a/packages/utils/README.md b/packages/utils/README.md index 8aeed3f4a..2d6c14abe 100644 --- a/packages/utils/README.md +++ b/packages/utils/README.md @@ -2,131 +2,35 @@ A collection of simple utility functions used across packages. -## Miscellaneous +## Scripts -### Log Code IDs +### log-code-ids -To log the Code IDs from their config object in -[`src/constants/chains.ts`](./src/constants/chains.ts) in a format to put into a +Get Code IDs for a chain in the format for a [dao-contracts](https://github.com/DA0-DA0/dao-contracts/releases) tagged -release: +release. -```js -let output = (obj) => - console.log(Object.entries(obj).map(([key, value]) => { - const convertedKey = [...Array(key.length)].map((_, idx) => { - const c = key.charAt(idx) - // Convert capital letter to lowercase with a hyphen before. - if (/[A-Z]/.test(c)) { - return `${idx > 0 ? '-' : ''}${c.toLowerCase()}` - } - return c - }).join('') - return `${convertedKey}: ${value}` - }).join('\n')) +```sh +Usage: yarn log-code-ids [options] -output({ - ... - DaoCore: 1, - ... -}) +Options: + -c, --chain-id chain ID + -h, --help display help for command ``` -### Log Polytone Hermes Packet Filter +### dump-relayer -To retrieve the Hermes packet filter entries for a given chain pair connected -via Polytone: +Dump the specified chain Polytone connection(s) in the format expected by the +Hermes relayer. -```js -import { SUPPORTED_CHAINS } from '@dao-dao/utils/constants/chains' +```sh +Usage: yarn dump-relayer [options] -let output = (chainIdA: string, chainIdB: string) => { - const chainA = SUPPORTED_CHAINS.find((chain) => chain.chainId === chainIdA) - ?.polytone?.[chainIdB] - const chainB = SUPPORTED_CHAINS.find((chain) => chain.chainId === chainIdB) - ?.polytone?.[chainIdA] - if (!chainA && !chainB) { - throw new Error('Invalid chain pair') - } - - console.log(chainIdA + ':') - if (chainA) { - console.log(` - # polytone to ${chainIdB} (note) - ["wasm.${chainA.note}", "${chainA.localChannel}"],`) - } - if (chainB) { - console.log(` - # polytone from ${chainIdB} (voice) - ["wasm.${chainB.voice}", "${chainB.remoteChannel}"],`) - } - - console.log('\n\n' + chainIdB + ':') - if (chainB) { - console.log(` - # polytone to ${chainIdA} (note) - ["wasm.${chainB.note}", "${chainB.localChannel}"],`) - } - if (chainA) { - console.log(` - # polytone from ${chainIdA} (voice) - ["wasm.${chainA.voice}", "${chainA.remoteChannel}"],`) - } -} - -output('chain-id-A', 'chain-id-B') +Options: + -a, --chain-a chain A + -b, --chain-b chain B + -h, --help display help for command ``` -To retrieve the Hermes packet filter entries for a single chain's Polytone -connections: - -```js -import { SUPPORTED_CHAINS } from '@dao-dao/utils/constants/chains' - -let output = (chainId: string) => { - const chainPolytonesTo = Object.entries( - SUPPORTED_CHAINS.find((chain) => chain.chainId === chainId)?.polytone || {} - ) - const chainPolytonesFrom = SUPPORTED_CHAINS.flatMap((chain) => - chain.polytone?.[chainId] - ? { - chainId: chain.chainId, - polytone: chain.polytone[chainId], - } - : [] - ) - - const isolatedFroms = chainPolytonesFrom.filter( - ({ chainId }) => - !chainPolytonesTo.some((polytoneTo) => polytoneTo[0] === chainId) - ) - - const lines = [ - ...chainPolytonesTo.flatMap(([chainId, to]) => { - const toLine = ` # polytone to ${chainId} (note)\n ["wasm.${to.note}", "${to.localChannel}"]` - - const from = chainPolytonesFrom.find( - (from) => from.chainId === chainId - )?.polytone - const fromLine = - from && - ` # polytone from ${chainId} (voice)\n ["wasm.${from.voice}", "${from.remoteChannel}"]` - - return [toLine, ...(fromLine ? [fromLine] : [])] - }), - ...isolatedFroms.map( - ({ chainId, polytone }) => - ` # polytone from ${chainId} (voice)\n ["wasm.${polytone.voice}", "${polytone.remoteChannel}"]` - ), - ...isolatedFroms.map( - (from) => - `\n${from.chainId}:\n # polytone to ${chainId} (note)\n ["wasm.${from.polytone.note}", "${from.polytone.localChannel}"]` - ), - ] - - console.log('\n' + chainId + ':') - console.log(lines.join(',\n')) -} - -output('chain-id') -``` +To dump the entries between two specific chains, specify both chains. To dump +all entries for a single chain, only specify one. diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 7105cd2fe..6d6d3a03b 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -972,7 +972,6 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // There are no IBC connections with: // - Neutron // TODO(polytone): Polytone does not yet exist with: - // - Kujira // - Archway polytone: { [ChainId.JunoMainnet]: { @@ -1102,6 +1101,24 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // injective remoteChannel: 'channel-309', }, + [ChainId.KujiraMainnet]: { + // migaloo + note: 'migaloo1ra5czh604fv2k3rhrmesasa45afse97ulnwdz77zx9qkngyzx6jsfmvn6g', + // migaloo + listener: + 'migaloo1s06ndhqa93tmx244e6jefpv0mr0dgzwjkjj0nvvn9jpj0hd756tqrzygkw', + // kujira + voice: + 'kujira1dxcg652grz88gnur0cqelqks8aeazus6l44fejdnzjw2hel8x49skf5c96', + // migaloo + localConnection: 'connection-19', + // kujira + remoteConnection: 'connection-59', + // migaloo + localChannel: 'channel-123', + // kujira + remoteChannel: 'channel-167', + }, }, }, { @@ -1314,6 +1331,80 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ Cw20Stake: 8786, DaoVotingCw20Staked: 8787, }, + polytone: { + [ChainId.OsmosisMainnet]: { + // terra + note: 'terra1mudpw50amrmmj66j8gcxcvuervrmdpfpskjfjz8ccq2n6vs8messcqc26w', + // terra + listener: + 'terra1d4ge6jklal6enlfjuz8wgzzdlwmtqtuj87rnxf3wzw9ykw3wrl7srzx0lz', + // osmosis + voice: + 'osmo1sgyvze8v2jr600pjxll6leg3lpuz2grte0aceelzz0q3r7kv4dtsrgd9y8', + // terra + localConnection: 'connection-11', + // osmosis + remoteConnection: 'connection-1215', + // terra + localChannel: 'channel-93', + // osmosis + remoteChannel: 'channel-78083', + }, + [ChainId.StargazeMainnet]: { + // terra + note: 'terra1wnvlwpdgug7sp3gan9cgdplfe9368apunh09dakurgjmvxwhn9gqk3t70u', + // terra + listener: + 'terra1306eg6lp30zdet9dkp0td4a2lw6wfp88ufuwppccp2eu7uva8thqv7h5qt', + // stargaze + voice: + 'stars19nlxjdrdqaphvnckuhl50jjdtwe6pflcr7rgjfhcs66nwlfr0ees0dwpqp', + // terra + localConnection: 'connection-152', + // stargaze + remoteConnection: 'connection-298', + // terra + localChannel: 'channel-100', + // stargaze + remoteChannel: 'channel-336', + }, + [ChainId.MigalooMainnet]: { + // terra + note: 'terra16c0fhcrm0ez0e4an644lynknwxhru9wjeacg9xsplayrzrhs7uxs5y7vtx', + // terra + listener: + 'terra196xqr5ngsr483lvh4alux0rcnspep45gad484h6pdappqnf70jys7wpmkq', + // migaloo + voice: + 'migaloo10snk2jzmgxhzg3348gy8tljlah42wcw0jm3wpjsv6zhfz2cdls8sl573w4', + // terra + localConnection: 'connection-141', + // migaloo + remoteConnection: 'connection-88', + // terra + localChannel: 'channel-101', + // migaloo + remoteChannel: 'channel-121', + }, + [ChainId.KujiraMainnet]: { + // terra + note: 'terra14peyt0qrvayqj3vcy2rtq6tpp2frgw0qyt4stks6enf42gnuwrnsx2skls', + // terra + listener: + 'terra1s7vmxcrtuuhetl5qjqhc0ldjlwqxd87r4m5uym428mky4s36vwfsl3jcm7', + // kujira + voice: + 'kujira1fnv7ar6xt2y8lsnv9zvdfykdnels04vfjwnq4n0edqgvkm9cj2aqss5ftx', + // terra + localConnection: 'connection-102', + // kujira + remoteConnection: 'connection-79', + // terra + localChannel: 'channel-106', + // kujira + remoteChannel: 'channel-166', + }, + }, }, { chainId: ChainId.OraichainMainnet, diff --git a/packages/utils/package.json b/packages/utils/package.json index b87a6d8ac..1a790063e 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -5,7 +5,9 @@ "scripts": { "format": "eslint . --fix", "lint": "eslint .", - "test": "jest" + "test": "jest", + "dump-relayer": "ts-node ./scripts/dump-relayer.ts", + "log-code-ids": "ts-node ./scripts/log-code-ids.ts" }, "dependencies": { "@aws-sdk/client-s3": "^3.592.0", @@ -39,10 +41,12 @@ "@cosmjs/proto-signing": "^0.32.3", "@dao-dao/config": "2.4.0-rc.8", "@tanstack/react-query": "^5.40.0", + "commander": "^12.1.0", "cosmjs-types": "^0.9.0", "jest": "^29.1.1", "next": "^13.3.0", "react": "^18.2.0", + "ts-node": "^10.9.2", "typescript": "5.3.3" }, "peerDependencies": { diff --git a/packages/utils/scripts/dump-relayer.ts b/packages/utils/scripts/dump-relayer.ts new file mode 100644 index 000000000..b59cd291a --- /dev/null +++ b/packages/utils/scripts/dump-relayer.ts @@ -0,0 +1,103 @@ +import { Command } from 'commander' + +import { SUPPORTED_CHAINS } from '../constants/chains' + +// Parse arguments. +const program = new Command() +program.option('-a, --chain-a ', 'chain A') +program.option('-b, --chain-b ', 'chain B') +program.parse(process.argv) +const { chainA, chainB } = program.opts() + +const dumpOne = (chainId: string) => { + // get the polytone connections out of this chain + const chainPolytonesOut = Object.entries( + SUPPORTED_CHAINS.find((chain) => chain.chainId === chainId)?.polytone || {} + ) + + // get the polytone connections into this chain + const chainPolytonesInto = SUPPORTED_CHAINS.flatMap((chain) => + chain.polytone?.[chainId] + ? { + chainId: chain.chainId, + polytone: chain.polytone[chainId], + } + : [] + ) + + const chainLines = { + [chainId]: [ + // notes out + ...chainPolytonesOut.map( + ([inChainId, polytone]) => + ` # polytone to ${inChainId} (note)\n ["wasm.${polytone.note}", "${polytone.localChannel}"]` + ), + + // voices in + ...chainPolytonesInto.map( + ({ chainId: outChainId, polytone }) => + ` # polytone from ${outChainId} (voice)\n ["wasm.${polytone.voice}", "${polytone.remoteChannel}"]` + ), + ], + } + + chainPolytonesOut.forEach(([intoChainId, polytone]) => { + chainLines[intoChainId] ||= [] + // voices in + chainLines[intoChainId].push( + ` # polytone from ${chainId} (voice)\n ["wasm.${polytone.voice}", "${polytone.remoteChannel}"]` + ) + }) + + Object.entries(chainLines).forEach(([chainId, lines]) => { + console.log('\n' + chainId + ':') + lines.forEach((line) => console.log(line)) + }) + + console.log() +} + +const dumpTwo = (chainIdA: string, chainIdB: string) => { + const chainA = SUPPORTED_CHAINS.find((chain) => chain.chainId === chainIdA) + ?.polytone?.[chainIdB] + const chainB = SUPPORTED_CHAINS.find((chain) => chain.chainId === chainIdB) + ?.polytone?.[chainIdA] + if (!chainA && !chainB) { + console.error('Invalid chain pair') + return + } + + console.log(chainIdA + ':') + if (chainA) { + console.log(` + # polytone to ${chainIdB} (note) + ["wasm.${chainA.note}", "${chainA.localChannel}"],`) + } + if (chainB) { + console.log(` + # polytone from ${chainIdB} (voice) + ["wasm.${chainB.voice}", "${chainB.remoteChannel}"],`) + } + + console.log('\n\n' + chainIdB + ':') + if (chainB) { + console.log(` + # polytone to ${chainIdA} (note) + ["wasm.${chainB.note}", "${chainB.localChannel}"],`) + } + if (chainA) { + console.log(` + # polytone from ${chainIdA} (voice) + ["wasm.${chainA.voice}", "${chainA.remoteChannel}"],`) + } +} + +if (chainA && chainB) { + dumpTwo(chainA, chainB) +} else if (chainA) { + dumpOne(chainA) +} else if (chainB) { + dumpOne(chainB) +} else { + console.error('No chain specified') +} diff --git a/packages/utils/scripts/log-code-ids.ts b/packages/utils/scripts/log-code-ids.ts new file mode 100644 index 000000000..5b913bf10 --- /dev/null +++ b/packages/utils/scripts/log-code-ids.ts @@ -0,0 +1,33 @@ +import { Command } from 'commander' + +import { SUPPORTED_CHAINS } from '../constants/chains' + +// Parse arguments. +const program = new Command() +program.requiredOption('-c, --chain-id ', 'chain ID') +program.parse(process.argv) +const { chainId } = program.opts() + +const chain = SUPPORTED_CHAINS.find((c) => c.chainId === chainId) +if (!chain) { + console.error(`Invalid chain ID: ${chainId}`) + process.exit(1) +} + +console.log( + Object.entries(chain.codeIds) + .map(([key, value]) => { + const convertedKey = [...Array(key.length)] + .map((_, idx) => { + const c = key.charAt(idx) + // Convert capital letter to lowercase with a hyphen before. + if (/[A-Z]/.test(c)) { + return `${idx > 0 ? '-' : ''}${c.toLowerCase()}` + } + return c + }) + .join('') + return `${convertedKey}: ${value}` + }) + .join('\n') +) From 20a74bedd55b8056616d6c6c6347d8400189395b Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 16 Jun 2024 19:41:24 -0400 Subject: [PATCH 243/438] renamed types tsx to ts --- packages/types/components/{AddressInput.tsx => AddressInput.ts} | 0 packages/types/components/{AppContext.tsx => AppContext.ts} | 0 packages/types/components/{Buttonifier.tsx => Buttonifier.ts} | 0 packages/types/components/{DaoCard.tsx => DaoCard.ts} | 0 .../types/components/{DaoSplashHeader.tsx => DaoSplashHeader.ts} | 0 packages/types/components/{EntityDisplay.tsx => EntityDisplay.ts} | 0 packages/types/components/{ProposalList.tsx => ProposalList.ts} | 0 .../types/components/{TokenSwapStatus.tsx => TokenSwapStatus.ts} | 0 packages/types/components/{WalletDaos.tsx => WalletDaos.ts} | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename packages/types/components/{AddressInput.tsx => AddressInput.ts} (100%) rename packages/types/components/{AppContext.tsx => AppContext.ts} (100%) rename packages/types/components/{Buttonifier.tsx => Buttonifier.ts} (100%) rename packages/types/components/{DaoCard.tsx => DaoCard.ts} (100%) rename packages/types/components/{DaoSplashHeader.tsx => DaoSplashHeader.ts} (100%) rename packages/types/components/{EntityDisplay.tsx => EntityDisplay.ts} (100%) rename packages/types/components/{ProposalList.tsx => ProposalList.ts} (100%) rename packages/types/components/{TokenSwapStatus.tsx => TokenSwapStatus.ts} (100%) rename packages/types/components/{WalletDaos.tsx => WalletDaos.ts} (100%) diff --git a/packages/types/components/AddressInput.tsx b/packages/types/components/AddressInput.ts similarity index 100% rename from packages/types/components/AddressInput.tsx rename to packages/types/components/AddressInput.ts diff --git a/packages/types/components/AppContext.tsx b/packages/types/components/AppContext.ts similarity index 100% rename from packages/types/components/AppContext.tsx rename to packages/types/components/AppContext.ts diff --git a/packages/types/components/Buttonifier.tsx b/packages/types/components/Buttonifier.ts similarity index 100% rename from packages/types/components/Buttonifier.tsx rename to packages/types/components/Buttonifier.ts diff --git a/packages/types/components/DaoCard.tsx b/packages/types/components/DaoCard.ts similarity index 100% rename from packages/types/components/DaoCard.tsx rename to packages/types/components/DaoCard.ts diff --git a/packages/types/components/DaoSplashHeader.tsx b/packages/types/components/DaoSplashHeader.ts similarity index 100% rename from packages/types/components/DaoSplashHeader.tsx rename to packages/types/components/DaoSplashHeader.ts diff --git a/packages/types/components/EntityDisplay.tsx b/packages/types/components/EntityDisplay.ts similarity index 100% rename from packages/types/components/EntityDisplay.tsx rename to packages/types/components/EntityDisplay.ts diff --git a/packages/types/components/ProposalList.tsx b/packages/types/components/ProposalList.ts similarity index 100% rename from packages/types/components/ProposalList.tsx rename to packages/types/components/ProposalList.ts diff --git a/packages/types/components/TokenSwapStatus.tsx b/packages/types/components/TokenSwapStatus.ts similarity index 100% rename from packages/types/components/TokenSwapStatus.tsx rename to packages/types/components/TokenSwapStatus.ts diff --git a/packages/types/components/WalletDaos.tsx b/packages/types/components/WalletDaos.ts similarity index 100% rename from packages/types/components/WalletDaos.tsx rename to packages/types/components/WalletDaos.ts From 0d76facc26ddc496b58d1f5c7458e5db243cdd14 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 16 Jun 2024 19:42:52 -0400 Subject: [PATCH 244/438] v2.4.0-rc.9 --- apps/dapp/package.json | 16 ++++++++-------- apps/sda/package.json | 16 ++++++++-------- lerna.json | 2 +- package.json | 2 +- packages/config/package.json | 2 +- packages/email/package.json | 6 +++--- packages/i18n/package.json | 4 ++-- packages/state/package.json | 8 ++++---- packages/stateful/package.json | 16 ++++++++-------- packages/stateless/package.json | 12 ++++++------ packages/storybook/package.json | 16 ++++++++-------- packages/types/package.json | 4 ++-- packages/utils/package.json | 6 +++--- 13 files changed, 55 insertions(+), 55 deletions(-) diff --git a/apps/dapp/package.json b/apps/dapp/package.json index f24982fbf..a8c7699ef 100644 --- a/apps/dapp/package.json +++ b/apps/dapp/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/dapp", - "version": "2.4.0-rc.8", + "version": "2.4.0-rc.9", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -20,12 +20,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.4.0-rc.8", - "@dao-dao/state": "2.4.0-rc.8", - "@dao-dao/stateful": "2.4.0-rc.8", - "@dao-dao/stateless": "2.4.0-rc.8", - "@dao-dao/types": "2.4.0-rc.8", - "@dao-dao/utils": "2.4.0-rc.8", + "@dao-dao/i18n": "2.4.0-rc.9", + "@dao-dao/state": "2.4.0-rc.9", + "@dao-dao/stateful": "2.4.0-rc.9", + "@dao-dao/stateless": "2.4.0-rc.9", + "@dao-dao/types": "2.4.0-rc.9", + "@dao-dao/utils": "2.4.0-rc.9", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -52,7 +52,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.8", + "@dao-dao/config": "2.4.0-rc.9", "@next/bundle-analyzer": "^14.1.0", "@playwright/test": "^1.44.1", "@sentry/cli": "^2.21.3", diff --git a/apps/sda/package.json b/apps/sda/package.json index 9e81b2fb6..337b0458b 100644 --- a/apps/sda/package.json +++ b/apps/sda/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/sda", - "version": "2.4.0-rc.8", + "version": "2.4.0-rc.9", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -17,12 +17,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.4.0-rc.8", - "@dao-dao/state": "2.4.0-rc.8", - "@dao-dao/stateful": "2.4.0-rc.8", - "@dao-dao/stateless": "2.4.0-rc.8", - "@dao-dao/types": "2.4.0-rc.8", - "@dao-dao/utils": "2.4.0-rc.8", + "@dao-dao/i18n": "2.4.0-rc.9", + "@dao-dao/state": "2.4.0-rc.9", + "@dao-dao/stateful": "2.4.0-rc.9", + "@dao-dao/stateless": "2.4.0-rc.9", + "@dao-dao/types": "2.4.0-rc.9", + "@dao-dao/utils": "2.4.0-rc.9", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -48,7 +48,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.8", + "@dao-dao/config": "2.4.0-rc.9", "@next/bundle-analyzer": "^12.1.0", "@sentry/cli": "^2.21.3", "@solana/web3.js": "^1.75.0", diff --git a/lerna.json b/lerna.json index db03e707f..bba00a099 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", "useWorkspaces": true, - "version": "2.4.0-rc.8" + "version": "2.4.0-rc.9" } diff --git a/package.json b/package.json index fc3aed936..73f90fab1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dao-dao-ui", - "version": "2.4.0-rc.8", + "version": "2.4.0-rc.9", "workspaces": [ "apps/*", "packages/*" diff --git a/packages/config/package.json b/packages/config/package.json index 0a23e0de4..e877db88e 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/config", - "version": "2.4.0-rc.8", + "version": "2.4.0-rc.9", "license": "BSD-3-Clause-Clear", "scripts": { "cwgen": "ts-node ./scripts/cwgen.ts" diff --git a/packages/email/package.json b/packages/email/package.json index 6e46b3d76..66a809915 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/email", - "version": "2.4.0-rc.8", + "version": "2.4.0-rc.9", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -10,8 +10,8 @@ }, "devDependencies": { "@aws-sdk/client-ses": "^3.592.0", - "@dao-dao/config": "2.4.0-rc.8", - "@dao-dao/types": "2.4.0-rc.8", + "@dao-dao/config": "2.4.0-rc.9", + "@dao-dao/types": "2.4.0-rc.9", "@react-email/components": "^0.0.7", "@react-email/render": "0.0.7", "commander": "^11.0.0", diff --git a/packages/i18n/package.json b/packages/i18n/package.json index e12a72e62..05df2a234 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/i18n", - "version": "2.4.0-rc.8", + "version": "2.4.0-rc.9", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -17,7 +17,7 @@ "react-i18next": "^11.0.0" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.8", + "@dao-dao/config": "2.4.0-rc.9", "eslint-plugin-i18n-json": "^3.1.0", "i18n-unused": "^0.10.0" }, diff --git a/packages/state/package.json b/packages/state/package.json index 1d6064cf0..b712ba2d2 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/state", - "version": "2.4.0-rc.8", + "version": "2.4.0-rc.9", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc && npm run build:gql", @@ -16,7 +16,7 @@ "@cosmjs/encoding": "^0.32.3", "@cosmjs/proto-signing": "^0.32.3", "@cosmjs/stargate": "^0.32.3", - "@dao-dao/utils": "2.4.0-rc.8", + "@dao-dao/utils": "2.4.0-rc.9", "@tanstack/react-query": "^5.40.0", "graphql": "^16.8.1", "json5": "^2.2.0", @@ -26,8 +26,8 @@ "recoil": "^0.7.2" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.8", - "@dao-dao/types": "2.4.0-rc.8", + "@dao-dao/config": "2.4.0-rc.9", + "@dao-dao/types": "2.4.0-rc.9", "@graphql-codegen/cli": "^5.0.0", "@graphql-codegen/client-preset": "^4.1.0", "@graphql-typed-document-node/core": "^3.2.0", diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 34eee5c30..46d247bd7 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateful", - "version": "2.4.0-rc.8", + "version": "2.4.0-rc.9", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -39,10 +39,10 @@ "@cosmos-kit/vectis": "^2.9.0", "@cosmos-kit/web3auth": "^2.8.0", "@cosmos-kit/xdefi": "^2.8.0", - "@dao-dao/i18n": "2.4.0-rc.8", - "@dao-dao/state": "2.4.0-rc.8", - "@dao-dao/stateless": "2.4.0-rc.8", - "@dao-dao/utils": "2.4.0-rc.8", + "@dao-dao/i18n": "2.4.0-rc.9", + "@dao-dao/state": "2.4.0-rc.9", + "@dao-dao/stateless": "2.4.0-rc.9", + "@dao-dao/utils": "2.4.0-rc.9", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -78,9 +78,9 @@ "devDependencies": { "@chain-registry/types": "^0.41.3", "@cosmjs/amino": "^0.32.3", - "@dao-dao/config": "2.4.0-rc.8", + "@dao-dao/config": "2.4.0-rc.9", "@dao-dao/cosmiframe": "0.1.0", - "@dao-dao/types": "2.4.0-rc.8", + "@dao-dao/types": "2.4.0-rc.9", "@storybook/react": "^6.5.10", "@types/file-saver": "^2.0.5", "@types/lodash.clonedeep": "^4.5.0", @@ -101,7 +101,7 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/storybook": "2.4.0-rc.8", + "@dao-dao/storybook": "2.4.0-rc.9", "next": "^12 || ^13", "react": "^17 || ^18" }, diff --git a/packages/stateless/package.json b/packages/stateless/package.json index cb9035058..477c18c39 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateless", - "version": "2.4.0-rc.8", + "version": "2.4.0-rc.9", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -9,8 +9,8 @@ }, "dependencies": { "@cosmjs/encoding": "^0.32.3", - "@dao-dao/types": "2.4.0-rc.8", - "@dao-dao/utils": "2.4.0-rc.8", + "@dao-dao/types": "2.4.0-rc.9", + "@dao-dao/utils": "2.4.0-rc.9", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -45,7 +45,7 @@ "devDependencies": { "@chain-registry/types": "^0.41.3", "@cosmos-kit/core": "^2.11.0", - "@dao-dao/config": "2.4.0-rc.8", + "@dao-dao/config": "2.4.0-rc.9", "@storybook/react": "^6.5.10", "@types/lodash.clonedeep": "^4.5.0", "@types/react": "^17.0.37", @@ -68,8 +68,8 @@ "unist-util-visit-parents": "^5.1.3" }, "peerDependencies": { - "@dao-dao/stateful": "2.4.0-rc.8", - "@dao-dao/storybook": "2.4.0-rc.8", + "@dao-dao/stateful": "2.4.0-rc.9", + "@dao-dao/storybook": "2.4.0-rc.9", "next": "^12 || ^13", "react": "^17 || ^18", "react-dom": "^17 || ^18" diff --git a/packages/storybook/package.json b/packages/storybook/package.json index c2fcf9c7e..1cf42b43a 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/storybook", - "version": "2.4.0-rc.8", + "version": "2.4.0-rc.9", "license": "BSD-3-Clause-Clear", "scripts": { "build": "build-storybook", @@ -8,10 +8,10 @@ "generate": "ts-node --esm ./scripts/generate.ts" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.8", - "@dao-dao/i18n": "2.4.0-rc.8", - "@dao-dao/types": "2.4.0-rc.8", - "@dao-dao/utils": "2.4.0-rc.8", + "@dao-dao/config": "2.4.0-rc.9", + "@dao-dao/i18n": "2.4.0-rc.9", + "@dao-dao/types": "2.4.0-rc.9", + "@dao-dao/utils": "2.4.0-rc.9", "@storybook/addon-actions": "^6.5.12", "@storybook/addon-essentials": "^6.5.12", "@storybook/addon-links": "^6.5.12", @@ -45,9 +45,9 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/state": "2.4.0-rc.8", - "@dao-dao/stateful": "2.4.0-rc.8", - "@dao-dao/stateless": "2.4.0-rc.8" + "@dao-dao/state": "2.4.0-rc.9", + "@dao-dao/stateful": "2.4.0-rc.9", + "@dao-dao/stateless": "2.4.0-rc.9" }, "prettier": "@dao-dao/config/prettier", "gitHead": "67c8ffb27c34ee37b9367d3fde6856085081f40c" diff --git a/packages/types/package.json b/packages/types/package.json index 14ec0dbeb..d8ff1c9ac 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/types", - "version": "2.4.0-rc.8", + "version": "2.4.0-rc.9", "license": "BSD-3-Clause-Clear", "scripts": { "lint": "eslint .", @@ -23,7 +23,7 @@ }, "devDependencies": { "@cosmology/telescope": "^1.4.12", - "@dao-dao/config": "2.4.0-rc.8", + "@dao-dao/config": "2.4.0-rc.9", "@tanstack/react-query": "^5.40.0" }, "peerDependencies": { diff --git a/packages/utils/package.json b/packages/utils/package.json index 1a790063e..9460d0f05 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/utils", - "version": "2.4.0-rc.8", + "version": "2.4.0-rc.9", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -16,7 +16,7 @@ "@cosmjs/encoding": "^0.32.3", "@cosmjs/stargate": "^0.32.3", "@cosmjs/tendermint-rpc": "^0.32.3", - "@dao-dao/types": "2.4.0-rc.8", + "@dao-dao/types": "2.4.0-rc.9", "@sentry/nextjs": "^7.7.0", "@types/lodash.clonedeep": "^4.5.0", "@types/ripemd160": "^2.0.0", @@ -39,7 +39,7 @@ "devDependencies": { "@chain-registry/types": "^0.41.3", "@cosmjs/proto-signing": "^0.32.3", - "@dao-dao/config": "2.4.0-rc.8", + "@dao-dao/config": "2.4.0-rc.9", "@tanstack/react-query": "^5.40.0", "commander": "^12.1.0", "cosmjs-types": "^0.9.0", From 87021c5d72d31276e1a9c43eca5d6b9c88bf371a Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 16 Jun 2024 19:44:40 -0400 Subject: [PATCH 245/438] v2.4.0-rc.9 published and updated gitHead --- packages/config/package.json | 2 +- packages/email/package.json | 2 +- packages/i18n/package.json | 2 +- packages/state/package.json | 2 +- packages/stateful/package.json | 2 +- packages/stateless/package.json | 2 +- packages/storybook/package.json | 2 +- packages/types/package.json | 2 +- packages/utils/package.json | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/config/package.json b/packages/config/package.json index e877db88e..b2ccf9a63 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -33,5 +33,5 @@ "ts-node": "^10.9.2" }, "prettier": "./prettier/index.js", - "gitHead": "67c8ffb27c34ee37b9367d3fde6856085081f40c" + "gitHead": "0d76facc26ddc496b58d1f5c7458e5db243cdd14" } diff --git a/packages/email/package.json b/packages/email/package.json index 66a809915..b906c0050 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -25,5 +25,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "67c8ffb27c34ee37b9367d3fde6856085081f40c" + "gitHead": "0d76facc26ddc496b58d1f5c7458e5db243cdd14" } diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 05df2a234..2934186ea 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -22,5 +22,5 @@ "i18n-unused": "^0.10.0" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "67c8ffb27c34ee37b9367d3fde6856085081f40c" + "gitHead": "0d76facc26ddc496b58d1f5c7458e5db243cdd14" } diff --git a/packages/state/package.json b/packages/state/package.json index b712ba2d2..ac0c1ec23 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -35,5 +35,5 @@ "typescript": "5.3.3" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "67c8ffb27c34ee37b9367d3fde6856085081f40c" + "gitHead": "0d76facc26ddc496b58d1f5c7458e5db243cdd14" } diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 46d247bd7..5849b6771 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -106,5 +106,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "67c8ffb27c34ee37b9367d3fde6856085081f40c" + "gitHead": "0d76facc26ddc496b58d1f5c7458e5db243cdd14" } diff --git a/packages/stateless/package.json b/packages/stateless/package.json index 477c18c39..c2ea4de29 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -75,5 +75,5 @@ "react-dom": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "67c8ffb27c34ee37b9367d3fde6856085081f40c" + "gitHead": "0d76facc26ddc496b58d1f5c7458e5db243cdd14" } diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 1cf42b43a..1e2e472ce 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -50,5 +50,5 @@ "@dao-dao/stateless": "2.4.0-rc.9" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "67c8ffb27c34ee37b9367d3fde6856085081f40c" + "gitHead": "0d76facc26ddc496b58d1f5c7458e5db243cdd14" } diff --git a/packages/types/package.json b/packages/types/package.json index d8ff1c9ac..ed7aaa9d8 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -31,5 +31,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "67c8ffb27c34ee37b9367d3fde6856085081f40c" + "gitHead": "0d76facc26ddc496b58d1f5c7458e5db243cdd14" } diff --git a/packages/utils/package.json b/packages/utils/package.json index 9460d0f05..67a708c29 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -54,5 +54,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "67c8ffb27c34ee37b9367d3fde6856085081f40c" + "gitHead": "0d76facc26ddc496b58d1f5c7458e5db243cdd14" } From 7fc06d4fca54437c15be6e8240b50855b2a07656 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 17 Jun 2024 11:41:08 -0400 Subject: [PATCH 246/438] improved dump-relayer script --- packages/utils/README.md | 8 ++- packages/utils/scripts/dump-relayer.ts | 87 +++++++++++++++----------- 2 files changed, 55 insertions(+), 40 deletions(-) diff --git a/packages/utils/README.md b/packages/utils/README.md index 2d6c14abe..719664e5c 100644 --- a/packages/utils/README.md +++ b/packages/utils/README.md @@ -26,11 +26,15 @@ Hermes relayer. ```sh Usage: yarn dump-relayer [options] +dump Polytone relayer entries for one or multiple chains. passing no arguments will dump entries for all chains + Options: -a, --chain-a chain A -b, --chain-b chain B + -m, --many comma-separated list of chains to dump -h, --help display help for command ``` -To dump the entries between two specific chains, specify both chains. To dump -all entries for a single chain, only specify one. +To dump the entries between two specific chains, specify both chains (with `-a` +and `-b`). To dump all entries for one or multiple chains, use either `-a`, +`-b`, or `-m`. To dump all entries for all chains, pass no arguments. diff --git a/packages/utils/scripts/dump-relayer.ts b/packages/utils/scripts/dump-relayer.ts index b59cd291a..791a62001 100644 --- a/packages/utils/scripts/dump-relayer.ts +++ b/packages/utils/scripts/dump-relayer.ts @@ -4,49 +4,58 @@ import { SUPPORTED_CHAINS } from '../constants/chains' // Parse arguments. const program = new Command() +program.description( + 'dump Polytone relayer entries for one or multiple chains. passing no arguments will dump entries for all chains' +) program.option('-a, --chain-a ', 'chain A') program.option('-b, --chain-b ', 'chain B') +program.option('-m, --many ', 'comma-separated list of chains to dump') program.parse(process.argv) -const { chainA, chainB } = program.opts() +const { chainA, chainB, many } = program.opts() -const dumpOne = (chainId: string) => { - // get the polytone connections out of this chain - const chainPolytonesOut = Object.entries( - SUPPORTED_CHAINS.find((chain) => chain.chainId === chainId)?.polytone || {} - ) +const dumpAll = (...chainIds: string[]) => { + const chainLines: Record> = {} - // get the polytone connections into this chain - const chainPolytonesInto = SUPPORTED_CHAINS.flatMap((chain) => - chain.polytone?.[chainId] - ? { - chainId: chain.chainId, - polytone: chain.polytone[chainId], - } - : [] - ) + chainIds.forEach((chainId) => { + // get the polytone connections out of this chain + const chainPolytonesOut = Object.entries( + SUPPORTED_CHAINS.find((chain) => chain.chainId === chainId)?.polytone || + {} + ) - const chainLines = { - [chainId]: [ - // notes out - ...chainPolytonesOut.map( - ([inChainId, polytone]) => - ` # polytone to ${inChainId} (note)\n ["wasm.${polytone.note}", "${polytone.localChannel}"]` - ), + // get the polytone connections into this chain + const chainPolytonesInto = SUPPORTED_CHAINS.flatMap((chain) => + chain.polytone?.[chainId] + ? { + chainId: chain.chainId, + polytone: chain.polytone[chainId], + } + : [] + ) - // voices in - ...chainPolytonesInto.map( - ({ chainId: outChainId, polytone }) => - ` # polytone from ${outChainId} (voice)\n ["wasm.${polytone.voice}", "${polytone.remoteChannel}"]` - ), - ], - } + chainLines[chainId] ||= new Set() + + // notes out + chainPolytonesOut.forEach(([inChainId, polytone]) => + chainLines[chainId].add( + ` # polytone to ${inChainId} (note)\n ["wasm.${polytone.note}", "${polytone.localChannel}"],` + ) + ) - chainPolytonesOut.forEach(([intoChainId, polytone]) => { - chainLines[intoChainId] ||= [] // voices in - chainLines[intoChainId].push( - ` # polytone from ${chainId} (voice)\n ["wasm.${polytone.voice}", "${polytone.remoteChannel}"]` + chainPolytonesInto.forEach(({ chainId: outChainId, polytone }) => + chainLines[chainId].add( + ` # polytone from ${outChainId} (voice)\n ["wasm.${polytone.voice}", "${polytone.remoteChannel}"],` + ) ) + + chainPolytonesOut.forEach(([intoChainId, polytone]) => { + chainLines[intoChainId] ||= new Set() + // voices in + chainLines[intoChainId].add( + ` # polytone from ${chainId} (voice)\n ["wasm.${polytone.voice}", "${polytone.remoteChannel}"],` + ) + }) }) Object.entries(chainLines).forEach(([chainId, lines]) => { @@ -57,7 +66,7 @@ const dumpOne = (chainId: string) => { console.log() } -const dumpTwo = (chainIdA: string, chainIdB: string) => { +const dumpBidirectional = (chainIdA: string, chainIdB: string) => { const chainA = SUPPORTED_CHAINS.find((chain) => chain.chainId === chainIdA) ?.polytone?.[chainIdB] const chainB = SUPPORTED_CHAINS.find((chain) => chain.chainId === chainIdB) @@ -93,11 +102,13 @@ const dumpTwo = (chainIdA: string, chainIdB: string) => { } if (chainA && chainB) { - dumpTwo(chainA, chainB) + dumpBidirectional(chainA, chainB) } else if (chainA) { - dumpOne(chainA) + dumpAll(...chainA.split(',')) } else if (chainB) { - dumpOne(chainB) + dumpAll(...chainB.split(',')) +} else if (many) { + dumpAll(...many.split(',')) } else { - console.error('No chain specified') + dumpAll(...SUPPORTED_CHAINS.flatMap((c) => (c.polytone ? c.chainId : []))) } From 44b2d0bc4c7ad1ecb8f477e9bc1c567677f260ae Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 18 Jun 2024 16:55:15 -0400 Subject: [PATCH 247/438] fix contract-level SubDAO admin --- .../stateful/components/dao/CreateDaoForm.tsx | 53 +++++++++++++------ 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/packages/stateful/components/dao/CreateDaoForm.tsx b/packages/stateful/components/dao/CreateDaoForm.tsx index 513d2d4d1..05ec9a39b 100644 --- a/packages/stateful/components/dao/CreateDaoForm.tsx +++ b/packages/stateful/components/dao/CreateDaoForm.tsx @@ -58,6 +58,7 @@ import { getNativeTokenForChainId, getSupportedChainConfig, getSupportedChains, + instantiateSmartContract, makeValidateMsg, parseContractVersion, processError, @@ -406,7 +407,11 @@ export const InnerCreateDaoForm = ({ //! Submit handlers const [creating, setCreating] = useState(false) - const { isWalletConnected, address: walletAddress } = useWallet() + const { + isWalletConnected, + address: walletAddress, + getSigningCosmWasmClient, + } = useWallet() const { refreshBalances } = useWalletBalances() const instantiateWithFactory = @@ -420,23 +425,39 @@ export const InnerCreateDaoForm = ({ throw new Error(instantiateMsgError) } else if (!instantiateMsg) { throw new Error(t('error.loadingData')) + } else if (!walletAddress) { + throw new Error(t('error.logInToContinue')) } - const { events } = await instantiateWithFactory( - { - codeId: codeIds.DaoCore, - instantiateMsg: encodeJsonToBase64(instantiateMsg), - label: instantiateMsg.name, - }, - CHAIN_GAS_MULTIPLIER, - undefined, - getFundsFromDaoInstantiateMsg(instantiateMsg) - ) - return findWasmAttributeValue( - events, - factoryContractAddress, - 'set contract admin as itself' - )! + // if admin is set, use it as the contract-level admin as well (for creating + // SubDAOs). otherwise, instantiate with self as admin via factory. + if (instantiateMsg.admin) { + return await instantiateSmartContract( + await getSigningCosmWasmClient(), + walletAddress, + codeIds.DaoCore, + instantiateMsg.name, + instantiateMsg, + getFundsFromDaoInstantiateMsg(instantiateMsg), + instantiateMsg.admin + ) + } else { + const { events } = await instantiateWithFactory( + { + codeId: codeIds.DaoCore, + instantiateMsg: encodeJsonToBase64(instantiateMsg), + label: instantiateMsg.name, + }, + CHAIN_GAS_MULTIPLIER, + undefined, + getFundsFromDaoInstantiateMsg(instantiateMsg) + ) + return findWasmAttributeValue( + events, + factoryContractAddress, + 'set contract admin as itself' + )! + } } const parseSubmitterValueDelta = (value: string): number => { From 804d2676fd6351253aa607ac160b188ec0109425 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 18 Jun 2024 17:03:06 -0400 Subject: [PATCH 248/438] fix not navigating to new DAO if indexer not ready right after creation --- packages/stateful/components/dao/CreateDaoForm.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/stateful/components/dao/CreateDaoForm.tsx b/packages/stateful/components/dao/CreateDaoForm.tsx index 05ec9a39b..f181a64dd 100644 --- a/packages/stateful/components/dao/CreateDaoForm.tsx +++ b/packages/stateful/components/dao/CreateDaoForm.tsx @@ -545,12 +545,14 @@ export const InnerCreateDaoForm = ({ error: (err) => processError(err), }) - const { info } = await queryClient.fetchQuery( - contractQueries.info(queryClient, { - chainId, - address: coreAddress, - }) - ) + const { info } = await queryClient + .fetchQuery( + contractQueries.info(queryClient, { + chainId, + address: coreAddress, + }) + ) + .catch(() => ({ info: { version: 'unknown' } })) const coreVersion = parseContractVersion(info.version) // Don't set following on SDA. Only dApp. From 569aa275619f50136ae6f6d557e8d789594167bb Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 18 Jun 2024 17:15:49 -0400 Subject: [PATCH 249/438] fixed searching for invisible actions --- .../components/actions/ActionLibrary.tsx | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/stateless/components/actions/ActionLibrary.tsx b/packages/stateless/components/actions/ActionLibrary.tsx index dffcd0b7e..dd41618bf 100644 --- a/packages/stateless/components/actions/ActionLibrary.tsx +++ b/packages/stateless/components/actions/ActionLibrary.tsx @@ -130,30 +130,30 @@ export const ActionLibrary = ({ ? categories.find((c) => c.key === categoryKeySelected) : undefined + const filterVisibleActions = (action: Action) => + // Never show programmatic actions. + !action.programmaticOnly && + // Show if reusable or not already used. + (!action.notReusable || !actionData.some((a) => a.actionKey === action.key)) + const showingActions = ( categoryKeySelected - ? (selectedCategory || categories[0]).actions - : filteredActions.slice(0, 10).map(({ item }) => item) + ? (selectedCategory || categories[0]).actions.filter(filterVisibleActions) + : filteredActions + .map(({ item }) => item) + .filter(filterVisibleActions) + .slice(0, 10) + ).sort((a, b) => + a.order !== undefined && b.order !== undefined + ? a.order - b.order + : // Prioritize the action with an order set. + a.order + ? -1 + : b.order + ? 1 + : // Leave them sorted by the original order in the category definition. + 0 ) - .filter( - (action) => - // Never show programmatic actions. - !action.programmaticOnly && - // Show if reusable or not already used. - (!action.notReusable || - !actionData.some((a) => a.actionKey === action.key)) - ) - .sort((a, b) => - a.order !== undefined && b.order !== undefined - ? a.order - b.order - : // Prioritize the action with an order set. - a.order - ? -1 - : b.order - ? 1 - : // Leave them sorted by the original order in the category definition. - 0 - ) // Ensure selected item is scrolled into view. useEffect(() => { From c46935f5247640f8f35245dd36c6145da1d0cc93 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 18 Jun 2024 17:19:06 -0400 Subject: [PATCH 250/438] fixed searching for invisible actions 2 --- packages/stateless/components/actions/ActionLibrary.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/stateless/components/actions/ActionLibrary.tsx b/packages/stateless/components/actions/ActionLibrary.tsx index dd41618bf..b5db31c0c 100644 --- a/packages/stateless/components/actions/ActionLibrary.tsx +++ b/packages/stateless/components/actions/ActionLibrary.tsx @@ -133,6 +133,8 @@ export const ActionLibrary = ({ const filterVisibleActions = (action: Action) => // Never show programmatic actions. !action.programmaticOnly && + // Never show actions that should be hidden from the picker. + !action.hideFromPicker && // Show if reusable or not already used. (!action.notReusable || !actionData.some((a) => a.actionKey === action.key)) From ac0d231316eb6c574d2256b47c29995c948dcca9 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 18 Jun 2024 17:37:43 -0400 Subject: [PATCH 251/438] allow creating chain-level SubDAOs --- packages/state/query/queries/chain.ts | 48 ++++++++++++++++++- .../stateful/components/dao/CreateSubDao.tsx | 12 ++++- .../stateful/components/gov/GovSubDaosTab.tsx | 3 +- packages/stateful/hooks/useGovDaoTabs.ts | 6 +-- packages/stateful/hooks/useWalletBalances.ts | 20 +++++++- .../components/dao/tabs/SubDaosTab.tsx | 46 ++++++++---------- 6 files changed, 101 insertions(+), 34 deletions(-) diff --git a/packages/state/query/queries/chain.ts b/packages/state/query/queries/chain.ts index 735660229..de01b9fff 100644 --- a/packages/state/query/queries/chain.ts +++ b/packages/state/query/queries/chain.ts @@ -1,10 +1,14 @@ -import { QueryClient, queryOptions } from '@tanstack/react-query' +import { Coin } from '@cosmjs/stargate' +import { QueryClient, queryOptions, skipToken } from '@tanstack/react-query' +import { ChainId } from '@dao-dao/types' import { ModuleAccount } from '@dao-dao/types/protobuf/codegen/cosmos/auth/v1beta1/auth' import { cosmWasmClientRouter, cosmosProtoRpcClientRouter, + getNativeTokenForChainId, isValidBech32Address, + stargateClientRouter, } from '@dao-dao/utils' /** @@ -160,6 +164,38 @@ export const fetchBlockTimestamp = async ({ return new Date((await client.getBlock(height)).header.time).getTime() } +/** + * Fetch the sum of native tokens staked across all validators. + */ +export const fetchNativeStakedBalance = async ({ + chainId, + address, +}: { + chainId: string + address: string +}): Promise => { + // Neutron does not have staking. + if ( + chainId === ChainId.NeutronMainnet || + chainId === ChainId.NeutronTestnet + ) { + return { + amount: '0', + denom: getNativeTokenForChainId(chainId).denomOrAddress, + } + } + + const client = await stargateClientRouter.connect(chainId) + const balance = await client.getBalanceStaked(address) + + return ( + balance ?? { + amount: '0', + denom: getNativeTokenForChainId(chainId).denomOrAddress, + } + ) +} + export const chainQueries = { /** * Fetch the module address associated with the specified name. @@ -198,4 +234,14 @@ export const chainQueries = { queryKey: ['chain', 'blockTimestamp', options], queryFn: () => fetchBlockTimestamp(options), }), + /** + * Fetch the sum of native tokens staked across all validators. + */ + nativeStakedBalance: ( + options?: Parameters[0] + ) => + queryOptions({ + queryKey: ['chain', 'nativeStakedBalance', options], + queryFn: options ? () => fetchNativeStakedBalance(options) : skipToken, + }), } diff --git a/packages/stateful/components/dao/CreateSubDao.tsx b/packages/stateful/components/dao/CreateSubDao.tsx index deede3108..fb0228da8 100644 --- a/packages/stateful/components/dao/CreateSubDao.tsx +++ b/packages/stateful/components/dao/CreateSubDao.tsx @@ -1,4 +1,5 @@ import { useDaoInfoContext } from '@dao-dao/stateless' +import { ContractVersion } from '@dao-dao/types' import { getFallbackImage } from '@dao-dao/utils' import { CreateDaoForm } from './CreateDaoForm' @@ -7,14 +8,21 @@ import { CreateDaoForm } from './CreateDaoForm' export const CreateSubDao = () => { const { chainId, - coreAddress, + coreAddress: _coreAddress, coreVersion, name, imageUrl, parentDao, admin, + accounts, } = useDaoInfoContext() + // Chain x/gov DAO infos have coreAddress set to their name for URL + // resolution, so retrieve their gov module address from their accounts list + // instead to be used as the SubDAO admin during creation. + const coreAddress = + coreVersion === ContractVersion.Gov ? accounts[0].address : _coreAddress + return ( { parentDao, admin, - // If creating a SubDao, it is not yet registered. + // If creating a SubDAO, it is not yet registered. registeredSubDao: false, }} /> diff --git a/packages/stateful/components/gov/GovSubDaosTab.tsx b/packages/stateful/components/gov/GovSubDaosTab.tsx index 1b40f1bdc..1bc284146 100644 --- a/packages/stateful/components/gov/GovSubDaosTab.tsx +++ b/packages/stateful/components/gov/GovSubDaosTab.tsx @@ -36,8 +36,7 @@ export const GovSubDaosTab = () => { => { IconFilled: AccountBalanceWalletRounded, lazy: true, }, - // If SubDAOs exist, show them. - ...(getSupportedChainConfig(chainId)?.subDaos?.length + // If chain has DAO DAO deployed and thus can create SubDAOs, show tab. + ...(isSupportedChain(chainId) ? [ { id: DaoTabId.SubDaos, diff --git a/packages/stateful/hooks/useWalletBalances.ts b/packages/stateful/hooks/useWalletBalances.ts index d16ad6bc6..e907d03a6 100644 --- a/packages/stateful/hooks/useWalletBalances.ts +++ b/packages/stateful/hooks/useWalletBalances.ts @@ -1,3 +1,4 @@ +import { useQueryClient } from '@tanstack/react-query' import { useCallback } from 'react' import { useSetRecoilState } from 'recoil' @@ -66,10 +67,27 @@ export const useWalletBalances = ({ const setRefreshStakingId = useSetRecoilState( refreshNativeTokenStakingInfoAtom(address ?? '') ) + const queryClient = useQueryClient() const refreshBalances = useCallback(() => { setRefreshWalletBalancesId((id) => id + 1) setRefreshStakingId((id) => id + 1) - }, [setRefreshStakingId, setRefreshWalletBalancesId]) + queryClient.invalidateQueries({ + queryKey: [ + 'chain', + 'nativeStakedBalance', + { + chainId, + address: address ?? '', + }, + ], + }) + }, [ + address, + chainId, + queryClient, + setRefreshStakingId, + setRefreshWalletBalancesId, + ]) return { isWalletConnected, diff --git a/packages/stateless/components/dao/tabs/SubDaosTab.tsx b/packages/stateless/components/dao/tabs/SubDaosTab.tsx index ad3ce4e34..95b88cdd6 100644 --- a/packages/stateless/components/dao/tabs/SubDaosTab.tsx +++ b/packages/stateless/components/dao/tabs/SubDaosTab.tsx @@ -23,7 +23,6 @@ export interface SubDaosTabProps { isMember: boolean createSubDaoHref?: string upgradeToV2Href?: string - hideCreateButton?: boolean ButtonLink: ComponentType } @@ -33,7 +32,6 @@ export const SubDaosTab = ({ isMember, createSubDaoHref, upgradeToV2Href, - hideCreateButton, ButtonLink, }: SubDaosTabProps) => { const { t } = useTranslation() @@ -53,30 +51,28 @@ export const SubDaosTab = ({

{t('info.subDaoExplanation')}

- {!hideCreateButton && ( - + - - - {t('button.newSubDao')} - {t('button.new')} - - - )} + + {t('button.newSubDao')} + {t('button.new')} + +
{!subDaosSupported ? ( From bb081625bb01a6b67bd5d1974c538913597718ae Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 19 Jun 2024 18:09:51 -0400 Subject: [PATCH 252/438] fixed kujira denom creation fee not being detected --- packages/state/recoil/selectors/chain.ts | 10 ++++++++++ packages/utils/client.ts | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/packages/state/recoil/selectors/chain.ts b/packages/state/recoil/selectors/chain.ts index b2520be43..0260d738e 100644 --- a/packages/state/recoil/selectors/chain.ts +++ b/packages/state/recoil/selectors/chain.ts @@ -60,6 +60,7 @@ import { getNativeTokenForChainId, ibcProtoRpcClientRouter, junoProtoRpcClientRouter, + kujiraProtoRpcClientRouter, neutronProtoRpcClientRouter, nobleProtoRpcClientRouter, osmosisProtoRpcClientRouter, @@ -372,6 +373,15 @@ export const tokenFactoryDenomCreationFeeSelector = selectorFamily< get: (chainId) => async ({ get }) => { + if ( + chainId === ChainId.KujiraTestnet || + chainId === ChainId.KujiraMainnet + ) { + const kujiraClient = await kujiraProtoRpcClientRouter.connect(chainId) + const { params } = await kujiraClient.denom.params() + return params?.creationFee + } + const osmosisClient = get(osmosisRpcClientForChainSelector(chainId)) try { return (await osmosisClient.tokenfactory.v1beta1.params()).params diff --git a/packages/utils/client.ts b/packages/utils/client.ts index 29739b5bd..89713aa91 100644 --- a/packages/utils/client.ts +++ b/packages/utils/client.ts @@ -13,6 +13,7 @@ import { cosmwasm, ibc, juno, + kujira, neutron, noble, osmosis, @@ -224,6 +225,22 @@ export const junoProtoRpcClientRouter = new ChainClientRouter({ ), }) +/* + * Router for connecting to an RPC client with Kujira protobufs. + */ +export const kujiraProtoRpcClientRouter = new ChainClientRouter({ + handleConnect: async (chainId: string) => + retry( + 10, + async (attempt) => + ( + await kujira.ClientFactory.createRPCQueryClient({ + rpcEndpoint: getRpcForChainId(chainId, attempt - 1), + }) + ).kujira + ), +}) + /** * In response events from a transaction with a wasm event, gets the attribute * key for a given contract address. From 47ec3af5084493b04aad298f363a51740762969f Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 20 Jun 2024 17:37:01 -0400 Subject: [PATCH 253/438] plausible wallet login events --- apps/dapp/pages/_app.tsx | 1 + apps/sda/pages/_app.tsx | 1 + .../stateful/components/wallet/WalletUiWalletList.tsx | 9 +++++++++ packages/stateful/package.json | 1 + packages/types/index.ts | 1 + packages/types/plausible.ts | 11 +++++++++++ 6 files changed, 24 insertions(+) create mode 100644 packages/types/plausible.ts diff --git a/apps/dapp/pages/_app.tsx b/apps/dapp/pages/_app.tsx index 12ccaa61f..15cb13ce8 100644 --- a/apps/dapp/pages/_app.tsx +++ b/apps/dapp/pages/_app.tsx @@ -81,6 +81,7 @@ const InnerApp = ({ Component, pageProps }: AppProps) => { // @ts-ignore 'data-api': 'https://vis.daodao.zone/dao/event', }} + taggedEvents trackOutboundLinks > & { connect: (wallet: ChainWalletBase) => void @@ -19,6 +21,7 @@ export const WalletUiWalletList = ({ connect, }: WalletUiWalletListProps) => { const { t } = useTranslation() + const plausible = usePlausible() if (!walletRepo) { return null @@ -49,6 +52,12 @@ export const WalletUiWalletList = ({ current?.isWalletConnecting && current.walletName === wallet.walletName const makeWalletOnClick = (wallet: ChainWalletBase) => async () => { + plausible('login', { + props: { + wallet: wallet.walletName, + }, + }) + try { await current?.disconnect(true) } catch (error) { diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 5849b6771..6424210b4 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -61,6 +61,7 @@ "lodash.merge": "^4.6.2", "lodash.uniq": "^4.5.0", "lodash.uniqby": "^4.7.0", + "next-plausible": "^3.12.0", "next-seo": "^5.4.0", "papaparse": "^5.4.1", "pusher-js": "^7.6.0", diff --git a/packages/types/index.ts b/packages/types/index.ts index 6b5dacd99..124aa3b93 100644 --- a/packages/types/index.ts +++ b/packages/types/index.ts @@ -14,6 +14,7 @@ export * from './inbox' export * from './indexer' export * from './misc' export * from './nft' +export * from './plausible' export * from './profile' export * from './proposal-module-adapter' export * from './proposal' diff --git a/packages/types/plausible.ts b/packages/types/plausible.ts new file mode 100644 index 000000000..4b2ddb219 --- /dev/null +++ b/packages/types/plausible.ts @@ -0,0 +1,11 @@ +/** + * Plausible events. + */ +export type PlausibleEvents = { + /** + * Wallet login event. + */ + login: { + wallet: string + } +} From 7eee6930dc08d27c791a217027ff0201fb9584f1 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 21 Jun 2024 00:56:09 -0400 Subject: [PATCH 254/438] support dynamic gas prices on osmosis and neutron --- packages/state/package.json | 1 + packages/state/query/queries/chain.ts | 81 +++ packages/state/utils/DynamicGasPrice.ts | 74 ++ packages/state/utils/chain.ts | 33 + packages/state/utils/index.ts | 2 + .../components/gov/NewGovProposal.tsx | 7 +- .../components/profile/ProfileActions.tsx | 7 +- .../components/wallet/WalletProvider.tsx | 17 +- packages/stateful/hooks/useAutoRefreshData.ts | 20 +- packages/stateful/hooks/useWallet.ts | 13 + .../types/protobuf/codegen/alliance/bundle.ts | 24 +- .../types/protobuf/codegen/bitsong/bundle.ts | 16 +- .../types/protobuf/codegen/circle/bundle.ts | 24 +- .../types/protobuf/codegen/cosmos/bundle.ts | 196 +++--- .../types/protobuf/codegen/cosmwasm/bundle.ts | 36 +- .../protobuf/codegen/feemarket/bundle.ts | 28 + .../protobuf/codegen/feemarket/client.ts | 47 ++ .../codegen/feemarket/feemarket/v1/genesis.ts | 287 ++++++++ .../codegen/feemarket/feemarket/v1/params.ts | 349 ++++++++++ .../feemarket/feemarket/v1/query.rpc.Query.ts | 69 ++ .../codegen/feemarket/feemarket/v1/query.ts | 638 ++++++++++++++++++ .../feemarket/feemarket/v1/tx.amino.ts | 8 + .../feemarket/feemarket/v1/tx.registry.ts | 35 + .../feemarket/feemarket/v1/tx.rpc.msg.ts | 21 + .../codegen/feemarket/feemarket/v1/tx.ts | 184 +++++ .../protobuf/codegen/feemarket/rpc.query.ts | 61 ++ .../protobuf/codegen/feemarket/rpc.tx.ts | 45 ++ .../types/protobuf/codegen/gaia/bundle.ts | 36 +- .../protobuf/codegen/gogoproto/bundle.ts | 4 +- .../types/protobuf/codegen/google/bundle.ts | 28 +- packages/types/protobuf/codegen/ibc/bundle.ts | 172 ++--- packages/types/protobuf/codegen/index.ts | 2 + .../types/protobuf/codegen/juno/bundle.ts | 72 +- .../types/protobuf/codegen/kujira/bundle.ts | 86 +-- .../types/protobuf/codegen/neutron/bundle.ts | 214 +++--- .../types/protobuf/codegen/noble/bundle.ts | 20 +- .../types/protobuf/codegen/osmosis/bundle.ts | 476 ++++++------- .../types/protobuf/codegen/pstake/bundle.ts | 138 ++-- .../protobuf/codegen/publicawesome/bundle.ts | 122 ++-- .../types/protobuf/codegen/regen/bundle.ts | 188 +++--- .../protobuf/codegen/tendermint/bundle.ts | 40 +- .../feemarket/module/v1/module.proto | 16 + .../feemarket/feemarket/v1/genesis.proto | 47 ++ .../proto/feemarket/feemarket/v1/params.proto | 92 +++ .../proto/feemarket/feemarket/v1/query.proto | 82 +++ .../proto/feemarket/feemarket/v1/tx.proto | 33 + packages/types/protobuf/scripts/codegen.js | 1 + packages/utils/chain.ts | 28 - packages/utils/client.ts | 17 + 49 files changed, 3249 insertions(+), 988 deletions(-) create mode 100644 packages/state/utils/DynamicGasPrice.ts create mode 100644 packages/state/utils/chain.ts create mode 100644 packages/types/protobuf/codegen/feemarket/bundle.ts create mode 100644 packages/types/protobuf/codegen/feemarket/client.ts create mode 100644 packages/types/protobuf/codegen/feemarket/feemarket/v1/genesis.ts create mode 100644 packages/types/protobuf/codegen/feemarket/feemarket/v1/params.ts create mode 100644 packages/types/protobuf/codegen/feemarket/feemarket/v1/query.rpc.Query.ts create mode 100644 packages/types/protobuf/codegen/feemarket/feemarket/v1/query.ts create mode 100644 packages/types/protobuf/codegen/feemarket/feemarket/v1/tx.amino.ts create mode 100644 packages/types/protobuf/codegen/feemarket/feemarket/v1/tx.registry.ts create mode 100644 packages/types/protobuf/codegen/feemarket/feemarket/v1/tx.rpc.msg.ts create mode 100644 packages/types/protobuf/codegen/feemarket/feemarket/v1/tx.ts create mode 100644 packages/types/protobuf/codegen/feemarket/rpc.query.ts create mode 100644 packages/types/protobuf/codegen/feemarket/rpc.tx.ts create mode 100644 packages/types/protobuf/proto/feemarket/feemarket/module/v1/module.proto create mode 100644 packages/types/protobuf/proto/feemarket/feemarket/v1/genesis.proto create mode 100644 packages/types/protobuf/proto/feemarket/feemarket/v1/params.proto create mode 100644 packages/types/protobuf/proto/feemarket/feemarket/v1/query.proto create mode 100644 packages/types/protobuf/proto/feemarket/feemarket/v1/tx.proto diff --git a/packages/state/package.json b/packages/state/package.json index ac0c1ec23..00f97da4e 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -26,6 +26,7 @@ "recoil": "^0.7.2" }, "devDependencies": { + "@chain-registry/types": "^0.41.3", "@dao-dao/config": "2.4.0-rc.9", "@dao-dao/types": "2.4.0-rc.9", "@graphql-codegen/cli": "^5.0.0", diff --git a/packages/state/query/queries/chain.ts b/packages/state/query/queries/chain.ts index de01b9fff..9a66e4c4c 100644 --- a/packages/state/query/queries/chain.ts +++ b/packages/state/query/queries/chain.ts @@ -3,11 +3,14 @@ import { QueryClient, queryOptions, skipToken } from '@tanstack/react-query' import { ChainId } from '@dao-dao/types' import { ModuleAccount } from '@dao-dao/types/protobuf/codegen/cosmos/auth/v1beta1/auth' +import { DecCoin } from '@dao-dao/types/protobuf/codegen/cosmos/base/v1beta1/coin' import { cosmWasmClientRouter, cosmosProtoRpcClientRouter, + feemarketProtoRpcClientRouter, getNativeTokenForChainId, isValidBech32Address, + osmosisProtoRpcClientRouter, stargateClientRouter, } from '@dao-dao/utils' @@ -196,6 +199,66 @@ export const fetchNativeStakedBalance = async ({ ) } +/** + * Fetch the total native tokens staked across the whole chain. + */ +export const fetchTotalNativeStakedBalance = async ({ + chainId, +}: { + chainId: string +}): Promise => { + // Neutron does not have staking. + if ( + chainId === ChainId.NeutronMainnet || + chainId === ChainId.NeutronTestnet + ) { + return '0' + } + + const client = await cosmosProtoRpcClientRouter.connect(chainId) + const { pool } = await client.staking.v1beta1.pool() + + if (!pool) { + throw new Error('No staking pool found') + } + + return pool.bondedTokens +} + +/** + * Fetch the dynamic gas price for the native fee token. + */ +export const fetchDynamicGasPrice = async ({ + chainId, +}: { + chainId: string +}): Promise => { + // Osmosis uses osmosis.txfees module. + if ( + chainId === ChainId.OsmosisMainnet || + chainId === ChainId.OsmosisTestnet + ) { + const client = await osmosisProtoRpcClientRouter.connect(chainId) + const { baseFee } = await client.txfees.v1beta1.getEipBaseFee() + return { + amount: baseFee, + denom: getNativeTokenForChainId(chainId).denomOrAddress, + } + } + + // Neutron (and maybe others) uses Skip's feemarket module. + const client = await feemarketProtoRpcClientRouter.connect(chainId) + const { price } = await client.feemarket.v1.gasPrice({ + denom: getNativeTokenForChainId(chainId).denomOrAddress, + }) + + if (!price) { + throw new Error('No dynamic gas price found') + } + + return price +} + export const chainQueries = { /** * Fetch the module address associated with the specified name. @@ -244,4 +307,22 @@ export const chainQueries = { queryKey: ['chain', 'nativeStakedBalance', options], queryFn: options ? () => fetchNativeStakedBalance(options) : skipToken, }), + /** + * Fetch the total native tokens staked across the whole chain. + */ + totalNativeStakedBalance: ( + options: Parameters[0] + ) => + queryOptions({ + queryKey: ['chain', 'totalNativeStakedBalance', options], + queryFn: () => fetchTotalNativeStakedBalance(options), + }), + /** + * Fetch the dynamic gas price for the native fee token. + */ + dynamicGasPrice: (options: Parameters[0]) => + queryOptions({ + queryKey: ['chain', 'dynamicGasPrice', options], + queryFn: () => fetchDynamicGasPrice(options), + }), } diff --git a/packages/state/utils/DynamicGasPrice.ts b/packages/state/utils/DynamicGasPrice.ts new file mode 100644 index 000000000..7f9f3b830 --- /dev/null +++ b/packages/state/utils/DynamicGasPrice.ts @@ -0,0 +1,74 @@ +import { Chain } from '@chain-registry/types' +import { Decimal } from '@cosmjs/math' +import { GasPrice } from '@cosmjs/stargate' +import { QueryClient } from '@tanstack/react-query' + +import { DecCoin } from '@dao-dao/types/protobuf/codegen/cosmos/base/v1beta1/coin' +import { maybeGetNativeTokenForChainId } from '@dao-dao/utils' + +import { chainQueries } from '../query' + +/** + * A dynamic gas price that attempts to fetch from the query client cache, + * defaulting to the local chain registry if the query does not exist. + * + * This does not fetch the query—that must be handled by the caller. + */ +export class DynamicGasPrice implements GasPrice { + public readonly defaultGasPrice: { + amount: Decimal + denom: string + } + + public constructor( + private readonly queryClient: QueryClient, + private readonly chain: Chain + ) { + const feeDenom = maybeGetNativeTokenForChainId( + this.chain.chain_id + )?.denomOrAddress + if (!feeDenom) { + throw new Error(`Chain ${chain.chain_id} has no fee token`) + } + + const feeToken = this.chain.fees?.fee_tokens.find( + ({ denom }) => denom === feeDenom + ) + + const gasPriceAmount = + feeToken?.average_gas_price ?? + feeToken?.high_gas_price ?? + feeToken?.low_gas_price ?? + feeToken?.fixed_min_gas_price ?? + 0 + + this.defaultGasPrice = { + amount: Decimal.fromUserInput(Number(gasPriceAmount).toFixed(18), 18), + denom: feeDenom, + } + } + + get dynamicGasPrice(): DecCoin | undefined { + const d = this.queryClient.getQueryData( + chainQueries.dynamicGasPrice({ + chainId: this.chain.chain_id, + }).queryKey + ) + console.log('DYNAMIC', this.chain.chain_id, d) + return d + } + + get denom(): string { + return this.dynamicGasPrice?.denom ?? this.defaultGasPrice.denom + } + + get amount(): Decimal { + return this.dynamicGasPrice + ? Decimal.fromUserInput(this.dynamicGasPrice.amount, 18) + : this.defaultGasPrice.amount + } + + public toString(): string { + return this.amount.toString() + this.denom + } +} diff --git a/packages/state/utils/chain.ts b/packages/state/utils/chain.ts new file mode 100644 index 000000000..0ef24a918 --- /dev/null +++ b/packages/state/utils/chain.ts @@ -0,0 +1,33 @@ +import { Chain } from '@chain-registry/types' +import { SigningCosmWasmClientOptions } from '@cosmjs/cosmwasm-stargate' +import { QueryClient } from '@tanstack/react-query' + +import { aminoTypes, typesRegistry } from '@dao-dao/types' +import { getChainForChainName } from '@dao-dao/utils' + +import { DynamicGasPrice } from './DynamicGasPrice' + +/** + * Fetch the signer options for the given chain ID. getSignerOptions function + * signature is defined by cosmos-kit. + */ +export const makeGetSignerOptions = + (queryClient: QueryClient) => + (chainOrName: Chain | string): SigningCosmWasmClientOptions => { + const chain = + typeof chainOrName === 'string' + ? getChainForChainName(chainOrName) + : chainOrName + + // Chains without fee tokens configured will error. + let gasPrice + try { + gasPrice = new DynamicGasPrice(queryClient, chain) + } catch {} + + return { + gasPrice, + registry: typesRegistry, + aminoTypes, + } + } diff --git a/packages/state/utils/index.ts b/packages/state/utils/index.ts index da4753bb7..2ebcf1968 100644 --- a/packages/state/utils/index.ts +++ b/packages/state/utils/index.ts @@ -1 +1,3 @@ +export * from './chain' export * from './contract' +export * from './DynamicGasPrice' diff --git a/packages/stateful/components/gov/NewGovProposal.tsx b/packages/stateful/components/gov/NewGovProposal.tsx index a3496b511..4d0ee228a 100644 --- a/packages/stateful/components/gov/NewGovProposal.tsx +++ b/packages/stateful/components/gov/NewGovProposal.tsx @@ -10,6 +10,7 @@ import { Visibility, VisibilityOff, } from '@mui/icons-material' +import { useQueryClient } from '@tanstack/react-query' import clsx from 'clsx' import Fuse from 'fuse.js' import cloneDeep from 'lodash.clonedeep' @@ -43,6 +44,7 @@ import { proposalDraftsAtom, refreshGovProposalsAtom, } from '@dao-dao/state/recoil' +import { makeGetSignerOptions } from '@dao-dao/state/utils' import { Button, ErrorPage, @@ -80,7 +82,6 @@ import { getDisplayNameForChainId, getImageUrlForChainId, getRpcForChainId, - getSignerOptions, govProposalActionDataToDecodedContent, isCosmWasmStargateMsg, objectMatchesStructure, @@ -269,6 +270,7 @@ const InnerNewGovProposal = ({ chainWallet, } = useWallet() const { getDaoProposalPath } = useDaoNavHelpers() + const queryClient = useQueryClient() const { context } = useActionOptions() if (context.type !== ActionContextType.Gov) { @@ -408,7 +410,7 @@ const InnerNewGovProposal = ({ const signingClient = await SigningStargateClient.connectWithSigner( getRpcForChainId(chain.chain_id), signer, - getSignerOptions(chain) + makeGetSignerOptions(queryClient)(chain) ) const { events } = await signingClient.signAndBroadcast( @@ -520,6 +522,7 @@ const InnerNewGovProposal = ({ refreshGovProposals, setLatestProposalSave, router, + queryClient, ] ) const proposalData = watch() diff --git a/packages/stateful/components/profile/ProfileActions.tsx b/packages/stateful/components/profile/ProfileActions.tsx index 7c6b1bf07..16427d54d 100644 --- a/packages/stateful/components/profile/ProfileActions.tsx +++ b/packages/stateful/components/profile/ProfileActions.tsx @@ -1,5 +1,6 @@ import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate' import { toHex } from '@cosmjs/encoding' +import { useQueryClient } from '@tanstack/react-query' import cloneDeep from 'lodash.clonedeep' import { useRouter } from 'next/router' import { useCallback, useEffect, useMemo, useState } from 'react' @@ -9,6 +10,7 @@ import { useTranslation } from 'react-i18next' import { useRecoilState, useSetRecoilState } from 'recoil' import { + makeGetSignerOptions, meTransactionAtom, refreshSavedTxsAtom, savedTxsSelector, @@ -32,7 +34,6 @@ import { ME_SAVED_TX_PREFIX, decodeJsonFromBase64, getRpcForChainId, - getSignerOptions, objectMatchesStructure, processError, } from '@dao-dao/utils' @@ -43,6 +44,7 @@ import { WalletChainSwitcher } from '../wallet' export const ProfileActions = () => { const { t } = useTranslation() + const queryClient = useQueryClient() const { address: walletAddress = '', @@ -144,7 +146,7 @@ export const ProfileActions = () => { await SigningCosmWasmClient.connectWithSigner( getRpcForChainId(chain.chain_id), signer, - getSignerOptions(chain) + makeGetSignerOptions(queryClient)(chain) ) const encodeObjects = data.map((msg) => @@ -171,6 +173,7 @@ export const ProfileActions = () => { getOfflineSignerAmino, getOfflineSignerDirect, holdingAltForDirectSign, + queryClient, t, walletAddress, ] diff --git a/packages/stateful/components/wallet/WalletProvider.tsx b/packages/stateful/components/wallet/WalletProvider.tsx index cb6d8267c..6189f48f8 100644 --- a/packages/stateful/components/wallet/WalletProvider.tsx +++ b/packages/stateful/components/wallet/WalletProvider.tsx @@ -1,6 +1,6 @@ import { wallets as coin98Wallets } from '@cosmos-kit/coin98' import { wallets as compassWallets } from '@cosmos-kit/compass' -import { Endpoints, SignerOptions } from '@cosmos-kit/core' +import { Endpoints } from '@cosmos-kit/core' import { wallets as cosmosExtensionMetamaskWallets } from '@cosmos-kit/cosmos-extension-metamask' import { wallets as cosmostationWallets } from '@cosmos-kit/cosmostation' import { wallets as exodusWallets } from '@cosmos-kit/exodus' @@ -23,12 +23,14 @@ import { wallets as trustWallets } from '@cosmos-kit/trust' import { wallets as vectisWallets } from '@cosmos-kit/vectis' import { PromptSign, makeWeb3AuthWallets } from '@cosmos-kit/web3auth' import { wallets as xdefiWallets } from '@cosmos-kit/xdefi' +import { useQueryClient } from '@tanstack/react-query' import { PropsWithChildren, ReactNode, useEffect, useMemo, useRef } from 'react' import { useTranslation } from 'react-i18next' import { usePrevious } from 'react-use' import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil' import { isInIframe } from '@dao-dao/cosmiframe' +import { makeGetSignerOptions } from '@dao-dao/state' import { isKeplrMobileWebAtom, mountedInBrowserAtom, @@ -44,7 +46,6 @@ import { chains, getChainForChainId, getKeplrFromWindow, - getSignerOptions, } from '@dao-dao/utils' import { useSyncWalletSigner, useWallet } from '../../hooks' @@ -118,12 +119,7 @@ export const WalletProvider = ({ children }: WalletProviderProps) => { [setWeb3AuthPrompt] ) - const signerOptions: SignerOptions = { - // cosmos-kit has an older version of the package. This is a workaround. - signingStargate: getSignerOptions as any, - // cosmos-kit has an older version of the package. This is a workaround. - signingCosmwasm: getSignerOptions as any, - } + const getSigningOptions = makeGetSignerOptions(useQueryClient()) // Auto-connect to Keplr mobile web if in that context. const mountedInBrowser = useRecoilValue(mountedInBrowserAtom) @@ -193,7 +189,10 @@ export const WalletProvider = ({ children }: WalletProviderProps) => { {} as Record ), }} - signerOptions={signerOptions} + signerOptions={{ + signingStargate: getSigningOptions, + signingCosmwasm: getSigningOptions, + }} walletConnectOptions={{ signClient: { // https://cloud.walletconnect.com diff --git a/packages/stateful/hooks/useAutoRefreshData.ts b/packages/stateful/hooks/useAutoRefreshData.ts index ad28682af..45d37ccbf 100644 --- a/packages/stateful/hooks/useAutoRefreshData.ts +++ b/packages/stateful/hooks/useAutoRefreshData.ts @@ -1,6 +1,8 @@ +import { useQueryClient } from '@tanstack/react-query' import { useEffect } from 'react' import { useSetRecoilState } from 'recoil' +import { chainQueries } from '@dao-dao/state/query' import { refreshBlockHeightAtom, refreshIndexerUpStatusAtom, @@ -12,19 +14,35 @@ import { * - block height * - prices * - indexer status + * - dynamic gas prices */ export const useAutoRefreshData = () => { const setRefreshBlockHeight = useSetRecoilState(refreshBlockHeightAtom) const setRefreshUsdcPrices = useSetRecoilState(refreshTokenUsdcPriceAtom('')) const setRefreshIndexerStatus = useSetRecoilState(refreshIndexerUpStatusAtom) + const queryClient = useQueryClient() + useEffect(() => { const interval = setInterval(() => { setRefreshBlockHeight((id) => id + 1) setRefreshUsdcPrices((id) => id + 1) setRefreshIndexerStatus((id) => id + 1) + + queryClient.refetchQueries({ + queryKey: chainQueries + .dynamicGasPrice({ chainId: '' }) + // Remove the final parameter in the key (options) so we match the + // query key for all chains. + .queryKey.slice(0, -1), + }) }, 60 * 1000) return () => clearInterval(interval) - }, [setRefreshBlockHeight, setRefreshIndexerStatus, setRefreshUsdcPrices]) + }, [ + queryClient, + setRefreshBlockHeight, + setRefreshIndexerStatus, + setRefreshUsdcPrices, + ]) } diff --git a/packages/stateful/hooks/useWallet.ts b/packages/stateful/hooks/useWallet.ts index 453c1b12c..b50cce7d4 100644 --- a/packages/stateful/hooks/useWallet.ts +++ b/packages/stateful/hooks/useWallet.ts @@ -2,9 +2,11 @@ import { Chain } from '@chain-registry/types' import { toHex } from '@cosmjs/encoding' import { ChainContext, WalletAccount } from '@cosmos-kit/core' import { useChain, useManager } from '@cosmos-kit/react-lite' +import { useQueryClient } from '@tanstack/react-query' import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { useRecoilValue } from 'recoil' +import { chainQueries } from '@dao-dao/state/query' import { walletChainIdAtom, walletHexPublicKeySelector, @@ -166,6 +168,17 @@ export const useWallet = ({ walletChainRef.current.status, ]) + // Pre-fetch dynamic gas price for this chain when the wallet is used. + const queryClient = useQueryClient() + useEffect(() => { + queryClient.prefetchQuery({ + ...chainQueries.dynamicGasPrice({ chainId: chain.chain_id }), + // Make stale in less than a minute so it refreshes in the + // `useAutoRefreshData` hook that runs every minute. + staleTime: 50 * 1000, + }) + }, [queryClient, chain.chain_id]) + const response = useMemo( (): UseWalletReturn => ({ ...walletChainRef.current, diff --git a/packages/types/protobuf/codegen/alliance/bundle.ts b/packages/types/protobuf/codegen/alliance/bundle.ts index a3c73977d..dc139efd8 100644 --- a/packages/types/protobuf/codegen/alliance/bundle.ts +++ b/packages/types/protobuf/codegen/alliance/bundle.ts @@ -8,12 +8,12 @@ import * as _6 from "./alliance/query"; import * as _7 from "./alliance/redelegations"; import * as _8 from "./alliance/tx"; import * as _9 from "./alliance/unbonding"; -import * as _351 from "./alliance/tx.amino"; -import * as _352 from "./alliance/tx.registry"; -import * as _353 from "./alliance/query.rpc.Query"; -import * as _354 from "./alliance/tx.rpc.msg"; -import * as _589 from "./rpc.query"; -import * as _590 from "./rpc.tx"; +import * as _355 from "./alliance/tx.amino"; +import * as _356 from "./alliance/tx.registry"; +import * as _357 from "./alliance/query.rpc.Query"; +import * as _358 from "./alliance/tx.rpc.msg"; +import * as _597 from "./rpc.query"; +import * as _598 from "./rpc.tx"; export namespace alliance { export const alliance = { ..._0, @@ -26,13 +26,13 @@ export namespace alliance { ..._7, ..._8, ..._9, - ..._351, - ..._352, - ..._353, - ..._354 + ..._355, + ..._356, + ..._357, + ..._358 }; export const ClientFactory = { - ..._589, - ..._590 + ..._597, + ..._598 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/bitsong/bundle.ts b/packages/types/protobuf/codegen/bitsong/bundle.ts index 6e5c52a9e..15eea2ff9 100644 --- a/packages/types/protobuf/codegen/bitsong/bundle.ts +++ b/packages/types/protobuf/codegen/bitsong/bundle.ts @@ -1,16 +1,16 @@ import * as _11 from "./fantoken/v1beta1/tx"; -import * as _355 from "./fantoken/v1beta1/tx.amino"; -import * as _356 from "./fantoken/v1beta1/tx.registry"; -import * as _357 from "./fantoken/v1beta1/tx.rpc.msg"; -import * as _591 from "./rpc.tx"; +import * as _359 from "./fantoken/v1beta1/tx.amino"; +import * as _360 from "./fantoken/v1beta1/tx.registry"; +import * as _361 from "./fantoken/v1beta1/tx.rpc.msg"; +import * as _599 from "./rpc.tx"; export namespace bitsong { export const fantoken = { ..._11, - ..._355, - ..._356, - ..._357 + ..._359, + ..._360, + ..._361 }; export const ClientFactory = { - ..._591 + ..._599 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/circle/bundle.ts b/packages/types/protobuf/codegen/circle/bundle.ts index b8a1eab75..690cf20a5 100644 --- a/packages/types/protobuf/codegen/circle/bundle.ts +++ b/packages/types/protobuf/codegen/circle/bundle.ts @@ -14,12 +14,12 @@ import * as _24 from "./cctp/v1/sending_and_receiving_messages_paused"; import * as _25 from "./cctp/v1/signature_threshold"; import * as _26 from "./cctp/v1/token_pair"; import * as _27 from "./cctp/v1/tx"; -import * as _358 from "./cctp/v1/tx.amino"; -import * as _359 from "./cctp/v1/tx.registry"; -import * as _360 from "./cctp/v1/query.rpc.Query"; -import * as _361 from "./cctp/v1/tx.rpc.msg"; -import * as _592 from "./rpc.query"; -import * as _593 from "./rpc.tx"; +import * as _362 from "./cctp/v1/tx.amino"; +import * as _363 from "./cctp/v1/tx.registry"; +import * as _364 from "./cctp/v1/query.rpc.Query"; +import * as _365 from "./cctp/v1/tx.rpc.msg"; +import * as _600 from "./rpc.query"; +import * as _601 from "./rpc.tx"; export namespace circle { export namespace cctp { export const v1 = { @@ -39,14 +39,14 @@ export namespace circle { ..._25, ..._26, ..._27, - ..._358, - ..._359, - ..._360, - ..._361 + ..._362, + ..._363, + ..._364, + ..._365 }; } export const ClientFactory = { - ..._592, - ..._593 + ..._600, + ..._601 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/bundle.ts b/packages/types/protobuf/codegen/cosmos/bundle.ts index 417a8ba09..5c0e92498 100644 --- a/packages/types/protobuf/codegen/cosmos/bundle.ts +++ b/packages/types/protobuf/codegen/cosmos/bundle.ts @@ -60,55 +60,55 @@ import * as _87 from "./tx/v1beta1/tx"; import * as _88 from "./upgrade/v1beta1/query"; import * as _89 from "./upgrade/v1beta1/tx"; import * as _90 from "./upgrade/v1beta1/upgrade"; -import * as _362 from "./auth/v1beta1/tx.amino"; -import * as _363 from "./authz/v1beta1/tx.amino"; -import * as _364 from "./bank/v1beta1/tx.amino"; -import * as _365 from "./distribution/v1beta1/tx.amino"; -import * as _366 from "./feegrant/v1beta1/tx.amino"; -import * as _367 from "./gov/v1/tx.amino"; -import * as _368 from "./gov/v1beta1/tx.amino"; -import * as _369 from "./mint/v1beta1/tx.amino"; -import * as _370 from "./slashing/v1beta1/tx.amino"; -import * as _371 from "./staking/v1beta1/tx.amino"; -import * as _372 from "./upgrade/v1beta1/tx.amino"; -import * as _373 from "./auth/v1beta1/tx.registry"; -import * as _374 from "./authz/v1beta1/tx.registry"; -import * as _375 from "./bank/v1beta1/tx.registry"; -import * as _376 from "./distribution/v1beta1/tx.registry"; -import * as _377 from "./feegrant/v1beta1/tx.registry"; -import * as _378 from "./gov/v1/tx.registry"; -import * as _379 from "./gov/v1beta1/tx.registry"; -import * as _380 from "./mint/v1beta1/tx.registry"; -import * as _381 from "./slashing/v1beta1/tx.registry"; -import * as _382 from "./staking/v1beta1/tx.registry"; -import * as _383 from "./upgrade/v1beta1/tx.registry"; -import * as _384 from "./auth/v1beta1/query.rpc.Query"; -import * as _385 from "./authz/v1beta1/query.rpc.Query"; -import * as _386 from "./bank/v1beta1/query.rpc.Query"; -import * as _387 from "./base/tendermint/v1beta1/query.rpc.Service"; -import * as _388 from "./distribution/v1beta1/query.rpc.Query"; -import * as _389 from "./feegrant/v1beta1/query.rpc.Query"; -import * as _390 from "./gov/v1/query.rpc.Query"; -import * as _391 from "./gov/v1beta1/query.rpc.Query"; -import * as _392 from "./mint/v1beta1/query.rpc.Query"; -import * as _393 from "./params/v1beta1/query.rpc.Query"; -import * as _394 from "./slashing/v1beta1/query.rpc.Query"; -import * as _395 from "./staking/v1beta1/query.rpc.Query"; -import * as _396 from "./tx/v1beta1/service.rpc.Service"; -import * as _397 from "./upgrade/v1beta1/query.rpc.Query"; -import * as _398 from "./auth/v1beta1/tx.rpc.msg"; -import * as _399 from "./authz/v1beta1/tx.rpc.msg"; -import * as _400 from "./bank/v1beta1/tx.rpc.msg"; -import * as _401 from "./distribution/v1beta1/tx.rpc.msg"; -import * as _402 from "./feegrant/v1beta1/tx.rpc.msg"; -import * as _403 from "./gov/v1/tx.rpc.msg"; -import * as _404 from "./gov/v1beta1/tx.rpc.msg"; -import * as _405 from "./mint/v1beta1/tx.rpc.msg"; -import * as _406 from "./slashing/v1beta1/tx.rpc.msg"; -import * as _407 from "./staking/v1beta1/tx.rpc.msg"; -import * as _408 from "./upgrade/v1beta1/tx.rpc.msg"; -import * as _594 from "./rpc.query"; -import * as _595 from "./rpc.tx"; +import * as _366 from "./auth/v1beta1/tx.amino"; +import * as _367 from "./authz/v1beta1/tx.amino"; +import * as _368 from "./bank/v1beta1/tx.amino"; +import * as _369 from "./distribution/v1beta1/tx.amino"; +import * as _370 from "./feegrant/v1beta1/tx.amino"; +import * as _371 from "./gov/v1/tx.amino"; +import * as _372 from "./gov/v1beta1/tx.amino"; +import * as _373 from "./mint/v1beta1/tx.amino"; +import * as _374 from "./slashing/v1beta1/tx.amino"; +import * as _375 from "./staking/v1beta1/tx.amino"; +import * as _376 from "./upgrade/v1beta1/tx.amino"; +import * as _377 from "./auth/v1beta1/tx.registry"; +import * as _378 from "./authz/v1beta1/tx.registry"; +import * as _379 from "./bank/v1beta1/tx.registry"; +import * as _380 from "./distribution/v1beta1/tx.registry"; +import * as _381 from "./feegrant/v1beta1/tx.registry"; +import * as _382 from "./gov/v1/tx.registry"; +import * as _383 from "./gov/v1beta1/tx.registry"; +import * as _384 from "./mint/v1beta1/tx.registry"; +import * as _385 from "./slashing/v1beta1/tx.registry"; +import * as _386 from "./staking/v1beta1/tx.registry"; +import * as _387 from "./upgrade/v1beta1/tx.registry"; +import * as _388 from "./auth/v1beta1/query.rpc.Query"; +import * as _389 from "./authz/v1beta1/query.rpc.Query"; +import * as _390 from "./bank/v1beta1/query.rpc.Query"; +import * as _391 from "./base/tendermint/v1beta1/query.rpc.Service"; +import * as _392 from "./distribution/v1beta1/query.rpc.Query"; +import * as _393 from "./feegrant/v1beta1/query.rpc.Query"; +import * as _394 from "./gov/v1/query.rpc.Query"; +import * as _395 from "./gov/v1beta1/query.rpc.Query"; +import * as _396 from "./mint/v1beta1/query.rpc.Query"; +import * as _397 from "./params/v1beta1/query.rpc.Query"; +import * as _398 from "./slashing/v1beta1/query.rpc.Query"; +import * as _399 from "./staking/v1beta1/query.rpc.Query"; +import * as _400 from "./tx/v1beta1/service.rpc.Service"; +import * as _401 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _402 from "./auth/v1beta1/tx.rpc.msg"; +import * as _403 from "./authz/v1beta1/tx.rpc.msg"; +import * as _404 from "./bank/v1beta1/tx.rpc.msg"; +import * as _405 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _406 from "./feegrant/v1beta1/tx.rpc.msg"; +import * as _407 from "./gov/v1/tx.rpc.msg"; +import * as _408 from "./gov/v1beta1/tx.rpc.msg"; +import * as _409 from "./mint/v1beta1/tx.rpc.msg"; +import * as _410 from "./slashing/v1beta1/tx.rpc.msg"; +import * as _411 from "./staking/v1beta1/tx.rpc.msg"; +import * as _412 from "./upgrade/v1beta1/tx.rpc.msg"; +import * as _602 from "./rpc.query"; +import * as _603 from "./rpc.tx"; export namespace cosmos { export namespace auth { export const v1beta1 = { @@ -116,10 +116,10 @@ export namespace cosmos { ..._30, ..._31, ..._32, - ..._362, - ..._373, - ..._384, - ..._398 + ..._366, + ..._377, + ..._388, + ..._402 }; } export namespace authz { @@ -129,10 +129,10 @@ export namespace cosmos { ..._35, ..._36, ..._37, - ..._363, - ..._374, - ..._385, - ..._399 + ..._367, + ..._378, + ..._389, + ..._403 }; } export namespace bank { @@ -142,10 +142,10 @@ export namespace cosmos { ..._40, ..._41, ..._42, - ..._364, - ..._375, - ..._386, - ..._400 + ..._368, + ..._379, + ..._390, + ..._404 }; } export namespace base { @@ -163,7 +163,7 @@ export namespace cosmos { export const v1beta1 = { ..._45, ..._46, - ..._387 + ..._391 }; } export const v1beta1 = { @@ -187,10 +187,10 @@ export namespace cosmos { ..._52, ..._53, ..._54, - ..._365, - ..._376, - ..._388, - ..._401 + ..._369, + ..._380, + ..._392, + ..._405 }; } export namespace feegrant { @@ -199,10 +199,10 @@ export namespace cosmos { ..._56, ..._57, ..._58, - ..._366, - ..._377, - ..._389, - ..._402 + ..._370, + ..._381, + ..._393, + ..._406 }; } export namespace gov { @@ -211,20 +211,20 @@ export namespace cosmos { ..._60, ..._61, ..._62, - ..._367, - ..._378, - ..._390, - ..._403 + ..._371, + ..._382, + ..._394, + ..._407 }; export const v1beta1 = { ..._63, ..._64, ..._65, ..._66, - ..._368, - ..._379, - ..._391, - ..._404 + ..._372, + ..._383, + ..._395, + ..._408 }; } export namespace mint { @@ -233,10 +233,10 @@ export namespace cosmos { ..._68, ..._69, ..._70, - ..._369, - ..._380, - ..._392, - ..._405 + ..._373, + ..._384, + ..._396, + ..._409 }; } export namespace msg { @@ -253,7 +253,7 @@ export namespace cosmos { export const v1beta1 = { ..._73, ..._74, - ..._393 + ..._397 }; } export namespace query { @@ -267,10 +267,10 @@ export namespace cosmos { ..._77, ..._78, ..._79, - ..._370, - ..._381, - ..._394, - ..._406 + ..._374, + ..._385, + ..._398, + ..._410 }; } export namespace staking { @@ -280,10 +280,10 @@ export namespace cosmos { ..._82, ..._83, ..._84, - ..._371, - ..._382, - ..._395, - ..._407 + ..._375, + ..._386, + ..._399, + ..._411 }; } export namespace tx { @@ -295,7 +295,7 @@ export namespace cosmos { export const v1beta1 = { ..._86, ..._87, - ..._396 + ..._400 }; } export namespace upgrade { @@ -303,14 +303,14 @@ export namespace cosmos { ..._88, ..._89, ..._90, - ..._372, - ..._383, - ..._397, - ..._408 + ..._376, + ..._387, + ..._401, + ..._412 }; } export const ClientFactory = { - ..._594, - ..._595 + ..._602, + ..._603 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmwasm/bundle.ts b/packages/types/protobuf/codegen/cosmwasm/bundle.ts index 635940756..c32d4886c 100644 --- a/packages/types/protobuf/codegen/cosmwasm/bundle.ts +++ b/packages/types/protobuf/codegen/cosmwasm/bundle.ts @@ -10,16 +10,16 @@ import * as _99 from "./wasm/v1/proposal"; import * as _100 from "./wasm/v1/query"; import * as _101 from "./wasm/v1/tx"; import * as _102 from "./wasm/v1/types"; -import * as _409 from "./tokenfactory/v1beta1/tx.amino"; -import * as _410 from "./wasm/v1/tx.amino"; -import * as _411 from "./tokenfactory/v1beta1/tx.registry"; -import * as _412 from "./wasm/v1/tx.registry"; -import * as _413 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _414 from "./wasm/v1/query.rpc.Query"; -import * as _415 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _416 from "./wasm/v1/tx.rpc.msg"; -import * as _596 from "./rpc.query"; -import * as _597 from "./rpc.tx"; +import * as _413 from "./tokenfactory/v1beta1/tx.amino"; +import * as _414 from "./wasm/v1/tx.amino"; +import * as _415 from "./tokenfactory/v1beta1/tx.registry"; +import * as _416 from "./wasm/v1/tx.registry"; +import * as _417 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _418 from "./wasm/v1/query.rpc.Query"; +import * as _419 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _420 from "./wasm/v1/tx.rpc.msg"; +import * as _604 from "./rpc.query"; +import * as _605 from "./rpc.tx"; export namespace cosmwasm { export namespace tokenfactory { export const v1beta1 = { @@ -28,10 +28,10 @@ export namespace cosmwasm { ..._93, ..._94, ..._95, - ..._409, - ..._411, ..._413, - ..._415 + ..._415, + ..._417, + ..._419 }; } export namespace wasm { @@ -43,14 +43,14 @@ export namespace cosmwasm { ..._100, ..._101, ..._102, - ..._410, - ..._412, ..._414, - ..._416 + ..._416, + ..._418, + ..._420 }; } export const ClientFactory = { - ..._596, - ..._597 + ..._604, + ..._605 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/feemarket/bundle.ts b/packages/types/protobuf/codegen/feemarket/bundle.ts new file mode 100644 index 000000000..adc770dda --- /dev/null +++ b/packages/types/protobuf/codegen/feemarket/bundle.ts @@ -0,0 +1,28 @@ +import * as _103 from "./feemarket/v1/genesis"; +import * as _104 from "./feemarket/v1/params"; +import * as _105 from "./feemarket/v1/query"; +import * as _106 from "./feemarket/v1/tx"; +import * as _421 from "./feemarket/v1/tx.amino"; +import * as _422 from "./feemarket/v1/tx.registry"; +import * as _423 from "./feemarket/v1/query.rpc.Query"; +import * as _424 from "./feemarket/v1/tx.rpc.msg"; +import * as _606 from "./rpc.query"; +import * as _607 from "./rpc.tx"; +export namespace feemarket { + export namespace feemarket { + export const v1 = { + ..._103, + ..._104, + ..._105, + ..._106, + ..._421, + ..._422, + ..._423, + ..._424 + }; + } + export const ClientFactory = { + ..._606, + ..._607 + }; +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/feemarket/client.ts b/packages/types/protobuf/codegen/feemarket/client.ts new file mode 100644 index 000000000..3e4fc5d4c --- /dev/null +++ b/packages/types/protobuf/codegen/feemarket/client.ts @@ -0,0 +1,47 @@ +import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; +import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; +import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as feemarketFeemarketV1TxRegistry from "./feemarket/v1/tx.registry"; +import * as feemarketFeemarketV1TxAmino from "./feemarket/v1/tx.amino"; +export const feemarketAminoConverters = { + ...feemarketFeemarketV1TxAmino.AminoConverter +}; +export const feemarketProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...feemarketFeemarketV1TxRegistry.registry]; +export const getSigningFeemarketClientOptions = ({ + defaultTypes = defaultRegistryTypes +}: { + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +} = {}): { + registry: Registry; + aminoTypes: AminoTypes; +} => { + const registry = new Registry([...defaultTypes, ...feemarketProtoRegistry]); + const aminoTypes = new AminoTypes({ + ...feemarketAminoConverters + }); + return { + registry, + aminoTypes + }; +}; +export const getSigningFeemarketClient = async ({ + rpcEndpoint, + signer, + defaultTypes = defaultRegistryTypes +}: { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +}) => { + const { + registry, + aminoTypes + } = getSigningFeemarketClientOptions({ + defaultTypes + }); + const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { + registry: (registry as any), + aminoTypes + }); + return client; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/feemarket/feemarket/v1/genesis.ts b/packages/types/protobuf/codegen/feemarket/feemarket/v1/genesis.ts new file mode 100644 index 000000000..d4af27520 --- /dev/null +++ b/packages/types/protobuf/codegen/feemarket/feemarket/v1/genesis.ts @@ -0,0 +1,287 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +/** GenesisState defines the feemarket module's genesis state. */ +export interface GenesisState { + /** + * Params are the parameters for the feemarket module. These parameters + * can be utilized to implement both the base EIP-1559 fee market and + * and the AIMD EIP-1559 fee market. + */ + params: Params | undefined; + /** State contains the current state of the AIMD fee market. */ + state: State | undefined; +} +export interface GenesisStateProtoMsg { + typeUrl: "/feemarket.feemarket.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the feemarket module's genesis state. */ +export interface GenesisStateAmino { + /** + * Params are the parameters for the feemarket module. These parameters + * can be utilized to implement both the base EIP-1559 fee market and + * and the AIMD EIP-1559 fee market. + */ + params?: ParamsAmino | undefined; + /** State contains the current state of the AIMD fee market. */ + state?: StateAmino | undefined; +} +export interface GenesisStateAminoMsg { + type: "/feemarket.feemarket.v1.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the feemarket module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType | undefined; + state: StateSDKType | undefined; +} +/** + * State is utilized to track the current state of the fee market. This includes + * the current base fee, learning rate, and block utilization within the + * specified AIMD window. + */ +export interface State { + /** + * BaseGasPrice is the current base fee. This is denominated in the fee per + * gas unit. + */ + baseGasPrice: string; + /** LearningRate is the current learning rate. */ + learningRate: string; + /** + * Window contains a list of the last blocks' utilization values. This is used + * to calculate the next base fee. This stores the number of units of gas + * consumed per block. + */ + window: bigint[]; + /** Index is the index of the current block in the block utilization window. */ + index: bigint; +} +export interface StateProtoMsg { + typeUrl: "/feemarket.feemarket.v1.State"; + value: Uint8Array; +} +/** + * State is utilized to track the current state of the fee market. This includes + * the current base fee, learning rate, and block utilization within the + * specified AIMD window. + */ +export interface StateAmino { + /** + * BaseGasPrice is the current base fee. This is denominated in the fee per + * gas unit. + */ + base_gas_price?: string; + /** LearningRate is the current learning rate. */ + learning_rate?: string; + /** + * Window contains a list of the last blocks' utilization values. This is used + * to calculate the next base fee. This stores the number of units of gas + * consumed per block. + */ + window?: string[]; + /** Index is the index of the current block in the block utilization window. */ + index?: string; +} +export interface StateAminoMsg { + type: "/feemarket.feemarket.v1.State"; + value: StateAmino; +} +/** + * State is utilized to track the current state of the fee market. This includes + * the current base fee, learning rate, and block utilization within the + * specified AIMD window. + */ +export interface StateSDKType { + base_gas_price: string; + learning_rate: string; + window: bigint[]; + index: bigint; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + state: State.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/feemarket.feemarket.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + if (message.state !== undefined) { + State.encode(message.state, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.state = State.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.state = object.state !== undefined && object.state !== null ? State.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.state !== undefined && object.state !== null) { + message.state = State.fromAmino(object.state); + } + return message; + }, + toAmino(message: GenesisState, useInterfaces: boolean = false): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + obj.state = message.state ? State.toAmino(message.state, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg, useInterfaces: boolean = false): GenesisState { + return GenesisState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/feemarket.feemarket.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +function createBaseState(): State { + return { + baseGasPrice: "", + learningRate: "", + window: [], + index: BigInt(0) + }; +} +export const State = { + typeUrl: "/feemarket.feemarket.v1.State", + encode(message: State, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.baseGasPrice !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.baseGasPrice, 18).atomics); + } + if (message.learningRate !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.learningRate, 18).atomics); + } + writer.uint32(26).fork(); + for (const v of message.window) { + writer.uint64(v); + } + writer.ldelim(); + if (message.index !== BigInt(0)) { + writer.uint32(32).uint64(message.index); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): State { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseGasPrice = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 2: + message.learningRate = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.window.push(reader.uint64()); + } + } else { + message.window.push(reader.uint64()); + } + break; + case 4: + message.index = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): State { + const message = createBaseState(); + message.baseGasPrice = object.baseGasPrice ?? ""; + message.learningRate = object.learningRate ?? ""; + message.window = object.window?.map(e => BigInt(e.toString())) || []; + message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); + return message; + }, + fromAmino(object: StateAmino): State { + const message = createBaseState(); + if (object.base_gas_price !== undefined && object.base_gas_price !== null) { + message.baseGasPrice = object.base_gas_price; + } + if (object.learning_rate !== undefined && object.learning_rate !== null) { + message.learningRate = object.learning_rate; + } + message.window = object.window?.map(e => BigInt(e)) || []; + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + return message; + }, + toAmino(message: State, useInterfaces: boolean = false): StateAmino { + const obj: any = {}; + obj.base_gas_price = message.baseGasPrice; + obj.learning_rate = message.learningRate; + if (message.window) { + obj.window = message.window.map(e => e.toString()); + } else { + obj.window = []; + } + obj.index = message.index ? message.index.toString() : undefined; + return obj; + }, + fromAminoMsg(object: StateAminoMsg): State { + return State.fromAmino(object.value); + }, + fromProtoMsg(message: StateProtoMsg, useInterfaces: boolean = false): State { + return State.decode(message.value, undefined, useInterfaces); + }, + toProto(message: State): Uint8Array { + return State.encode(message).finish(); + }, + toProtoMsg(message: State): StateProtoMsg { + return { + typeUrl: "/feemarket.feemarket.v1.State", + value: State.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/feemarket/feemarket/v1/params.ts b/packages/types/protobuf/codegen/feemarket/feemarket/v1/params.ts new file mode 100644 index 000000000..c30038267 --- /dev/null +++ b/packages/types/protobuf/codegen/feemarket/feemarket/v1/params.ts @@ -0,0 +1,349 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +/** + * Params contains the required set of parameters for the EIP1559 fee market + * plugin implementation. + */ +export interface Params { + /** + * Alpha is the amount we additively increase the learning rate + * when it is above or below the target +/- threshold. + * + * Must be > 0. + */ + alpha: string; + /** + * Beta is the amount we multiplicatively decrease the learning rate + * when it is within the target +/- threshold. + * + * Must be [0, 1]. + */ + beta: string; + /** + * Gamma is the threshold for the learning rate. If the learning rate is + * above or below the target +/- threshold, we additively increase the + * learning rate by Alpha. Otherwise, we multiplicatively decrease the + * learning rate by Beta. + * + * Must be [0, 0.5]. + */ + gamma: string; + /** + * Delta is the amount we additively increase/decrease the gas price when the + * net block utilization difference in the window is above/below the target + * utilization. + */ + delta: string; + /** + * MinBaseGasPrice determines the initial gas price of the module and the + * global minimum for the network. + */ + minBaseGasPrice: string; + /** MinLearningRate is the lower bound for the learning rate. */ + minLearningRate: string; + /** MaxLearningRate is the upper bound for the learning rate. */ + maxLearningRate: string; + /** MaxBlockUtilization is the maximum block utilization. */ + maxBlockUtilization: bigint; + /** + * Window defines the window size for calculating an adaptive learning rate + * over a moving window of blocks. + */ + window: bigint; + /** FeeDenom is the denom that will be used for all fee payments. */ + feeDenom: string; + /** + * Enabled is a boolean that determines whether the EIP1559 fee market is + * enabled. + */ + enabled: boolean; + /** + * DistributeFees is a boolean that determines whether the fees are burned or + * distributed to all stakers. + */ + distributeFees: boolean; +} +export interface ParamsProtoMsg { + typeUrl: "/feemarket.feemarket.v1.Params"; + value: Uint8Array; +} +/** + * Params contains the required set of parameters for the EIP1559 fee market + * plugin implementation. + */ +export interface ParamsAmino { + /** + * Alpha is the amount we additively increase the learning rate + * when it is above or below the target +/- threshold. + * + * Must be > 0. + */ + alpha?: string; + /** + * Beta is the amount we multiplicatively decrease the learning rate + * when it is within the target +/- threshold. + * + * Must be [0, 1]. + */ + beta?: string; + /** + * Gamma is the threshold for the learning rate. If the learning rate is + * above or below the target +/- threshold, we additively increase the + * learning rate by Alpha. Otherwise, we multiplicatively decrease the + * learning rate by Beta. + * + * Must be [0, 0.5]. + */ + gamma?: string; + /** + * Delta is the amount we additively increase/decrease the gas price when the + * net block utilization difference in the window is above/below the target + * utilization. + */ + delta?: string; + /** + * MinBaseGasPrice determines the initial gas price of the module and the + * global minimum for the network. + */ + min_base_gas_price?: string; + /** MinLearningRate is the lower bound for the learning rate. */ + min_learning_rate?: string; + /** MaxLearningRate is the upper bound for the learning rate. */ + max_learning_rate?: string; + /** MaxBlockUtilization is the maximum block utilization. */ + max_block_utilization?: string; + /** + * Window defines the window size for calculating an adaptive learning rate + * over a moving window of blocks. + */ + window?: string; + /** FeeDenom is the denom that will be used for all fee payments. */ + fee_denom?: string; + /** + * Enabled is a boolean that determines whether the EIP1559 fee market is + * enabled. + */ + enabled?: boolean; + /** + * DistributeFees is a boolean that determines whether the fees are burned or + * distributed to all stakers. + */ + distribute_fees?: boolean; +} +export interface ParamsAminoMsg { + type: "/feemarket.feemarket.v1.Params"; + value: ParamsAmino; +} +/** + * Params contains the required set of parameters for the EIP1559 fee market + * plugin implementation. + */ +export interface ParamsSDKType { + alpha: string; + beta: string; + gamma: string; + delta: string; + min_base_gas_price: string; + min_learning_rate: string; + max_learning_rate: string; + max_block_utilization: bigint; + window: bigint; + fee_denom: string; + enabled: boolean; + distribute_fees: boolean; +} +function createBaseParams(): Params { + return { + alpha: "", + beta: "", + gamma: "", + delta: "", + minBaseGasPrice: "", + minLearningRate: "", + maxLearningRate: "", + maxBlockUtilization: BigInt(0), + window: BigInt(0), + feeDenom: "", + enabled: false, + distributeFees: false + }; +} +export const Params = { + typeUrl: "/feemarket.feemarket.v1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.alpha !== "") { + writer.uint32(10).string(Decimal.fromUserInput(message.alpha, 18).atomics); + } + if (message.beta !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.beta, 18).atomics); + } + if (message.gamma !== "") { + writer.uint32(26).string(Decimal.fromUserInput(message.gamma, 18).atomics); + } + if (message.delta !== "") { + writer.uint32(34).string(Decimal.fromUserInput(message.delta, 18).atomics); + } + if (message.minBaseGasPrice !== "") { + writer.uint32(42).string(Decimal.fromUserInput(message.minBaseGasPrice, 18).atomics); + } + if (message.minLearningRate !== "") { + writer.uint32(50).string(Decimal.fromUserInput(message.minLearningRate, 18).atomics); + } + if (message.maxLearningRate !== "") { + writer.uint32(58).string(Decimal.fromUserInput(message.maxLearningRate, 18).atomics); + } + if (message.maxBlockUtilization !== BigInt(0)) { + writer.uint32(64).uint64(message.maxBlockUtilization); + } + if (message.window !== BigInt(0)) { + writer.uint32(72).uint64(message.window); + } + if (message.feeDenom !== "") { + writer.uint32(82).string(message.feeDenom); + } + if (message.enabled === true) { + writer.uint32(88).bool(message.enabled); + } + if (message.distributeFees === true) { + writer.uint32(96).bool(message.distributeFees); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.alpha = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 2: + message.beta = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 3: + message.gamma = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 4: + message.delta = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 5: + message.minBaseGasPrice = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 6: + message.minLearningRate = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 7: + message.maxLearningRate = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 8: + message.maxBlockUtilization = reader.uint64(); + break; + case 9: + message.window = reader.uint64(); + break; + case 10: + message.feeDenom = reader.string(); + break; + case 11: + message.enabled = reader.bool(); + break; + case 12: + message.distributeFees = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.alpha = object.alpha ?? ""; + message.beta = object.beta ?? ""; + message.gamma = object.gamma ?? ""; + message.delta = object.delta ?? ""; + message.minBaseGasPrice = object.minBaseGasPrice ?? ""; + message.minLearningRate = object.minLearningRate ?? ""; + message.maxLearningRate = object.maxLearningRate ?? ""; + message.maxBlockUtilization = object.maxBlockUtilization !== undefined && object.maxBlockUtilization !== null ? BigInt(object.maxBlockUtilization.toString()) : BigInt(0); + message.window = object.window !== undefined && object.window !== null ? BigInt(object.window.toString()) : BigInt(0); + message.feeDenom = object.feeDenom ?? ""; + message.enabled = object.enabled ?? false; + message.distributeFees = object.distributeFees ?? false; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.alpha !== undefined && object.alpha !== null) { + message.alpha = object.alpha; + } + if (object.beta !== undefined && object.beta !== null) { + message.beta = object.beta; + } + if (object.gamma !== undefined && object.gamma !== null) { + message.gamma = object.gamma; + } + if (object.delta !== undefined && object.delta !== null) { + message.delta = object.delta; + } + if (object.min_base_gas_price !== undefined && object.min_base_gas_price !== null) { + message.minBaseGasPrice = object.min_base_gas_price; + } + if (object.min_learning_rate !== undefined && object.min_learning_rate !== null) { + message.minLearningRate = object.min_learning_rate; + } + if (object.max_learning_rate !== undefined && object.max_learning_rate !== null) { + message.maxLearningRate = object.max_learning_rate; + } + if (object.max_block_utilization !== undefined && object.max_block_utilization !== null) { + message.maxBlockUtilization = BigInt(object.max_block_utilization); + } + if (object.window !== undefined && object.window !== null) { + message.window = BigInt(object.window); + } + if (object.fee_denom !== undefined && object.fee_denom !== null) { + message.feeDenom = object.fee_denom; + } + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + if (object.distribute_fees !== undefined && object.distribute_fees !== null) { + message.distributeFees = object.distribute_fees; + } + return message; + }, + toAmino(message: Params, useInterfaces: boolean = false): ParamsAmino { + const obj: any = {}; + obj.alpha = message.alpha; + obj.beta = message.beta; + obj.gamma = message.gamma; + obj.delta = message.delta; + obj.min_base_gas_price = message.minBaseGasPrice; + obj.min_learning_rate = message.minLearningRate; + obj.max_learning_rate = message.maxLearningRate; + obj.max_block_utilization = message.maxBlockUtilization ? message.maxBlockUtilization.toString() : undefined; + obj.window = message.window ? message.window.toString() : undefined; + obj.fee_denom = message.feeDenom; + obj.enabled = message.enabled; + obj.distribute_fees = message.distributeFees; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsProtoMsg, useInterfaces: boolean = false): Params { + return Params.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/feemarket.feemarket.v1.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/feemarket/feemarket/v1/query.rpc.Query.ts b/packages/types/protobuf/codegen/feemarket/feemarket/v1/query.rpc.Query.ts new file mode 100644 index 000000000..15d80ecba --- /dev/null +++ b/packages/types/protobuf/codegen/feemarket/feemarket/v1/query.rpc.Query.ts @@ -0,0 +1,69 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { ParamsRequest, ParamsResponse, StateRequest, StateResponse, GasPriceRequest, GasPriceResponse, GasPricesRequest, GasPricesResponse } from "./query"; +/** Query Service for the feemarket module. */ +export interface Query { + /** Params returns the current feemarket module parameters. */ + params(request?: ParamsRequest): Promise; + /** State returns the current feemarket module state. */ + state(request?: StateRequest): Promise; + /** + * GasPrice returns the current feemarket module gas price + * for specified denom. + */ + gasPrice(request: GasPriceRequest): Promise; + /** + * GasPrices returns the current feemarket module list of gas prices + * in all available denoms. + */ + gasPrices(request?: GasPricesRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + this.state = this.state.bind(this); + this.gasPrice = this.gasPrice.bind(this); + this.gasPrices = this.gasPrices.bind(this); + } + params(request: ParamsRequest = {}, useInterfaces: boolean = true): Promise { + const data = ParamsRequest.encode(request).finish(); + const promise = this.rpc.request("feemarket.feemarket.v1.Query", "Params", data); + return promise.then(data => ParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + state(request: StateRequest = {}, useInterfaces: boolean = true): Promise { + const data = StateRequest.encode(request).finish(); + const promise = this.rpc.request("feemarket.feemarket.v1.Query", "State", data); + return promise.then(data => StateResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + gasPrice(request: GasPriceRequest, useInterfaces: boolean = true): Promise { + const data = GasPriceRequest.encode(request).finish(); + const promise = this.rpc.request("feemarket.feemarket.v1.Query", "GasPrice", data); + return promise.then(data => GasPriceResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + gasPrices(request: GasPricesRequest = {}, useInterfaces: boolean = true): Promise { + const data = GasPricesRequest.encode(request).finish(); + const promise = this.rpc.request("feemarket.feemarket.v1.Query", "GasPrices", data); + return promise.then(data => GasPricesResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: ParamsRequest, useInterfaces: boolean = true): Promise { + return queryService.params(request, useInterfaces); + }, + state(request?: StateRequest, useInterfaces: boolean = true): Promise { + return queryService.state(request, useInterfaces); + }, + gasPrice(request: GasPriceRequest, useInterfaces: boolean = true): Promise { + return queryService.gasPrice(request, useInterfaces); + }, + gasPrices(request?: GasPricesRequest, useInterfaces: boolean = true): Promise { + return queryService.gasPrices(request, useInterfaces); + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/feemarket/feemarket/v1/query.ts b/packages/types/protobuf/codegen/feemarket/feemarket/v1/query.ts new file mode 100644 index 000000000..5317c79d1 --- /dev/null +++ b/packages/types/protobuf/codegen/feemarket/feemarket/v1/query.ts @@ -0,0 +1,638 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { State, StateAmino, StateSDKType } from "./genesis"; +import { DecCoin, DecCoinAmino, DecCoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** ParamsRequest is the request type for the Query/Params RPC method. */ +export interface ParamsRequest {} +export interface ParamsRequestProtoMsg { + typeUrl: "/feemarket.feemarket.v1.ParamsRequest"; + value: Uint8Array; +} +/** ParamsRequest is the request type for the Query/Params RPC method. */ +export interface ParamsRequestAmino {} +export interface ParamsRequestAminoMsg { + type: "/feemarket.feemarket.v1.ParamsRequest"; + value: ParamsRequestAmino; +} +/** ParamsRequest is the request type for the Query/Params RPC method. */ +export interface ParamsRequestSDKType {} +/** ParamsResponse is the response type for the Query/Params RPC method. */ +export interface ParamsResponse { + /** ParamsResponse is the response type for the Query/Params RPC method. */ + params: Params | undefined; +} +export interface ParamsResponseProtoMsg { + typeUrl: "/feemarket.feemarket.v1.ParamsResponse"; + value: Uint8Array; +} +/** ParamsResponse is the response type for the Query/Params RPC method. */ +export interface ParamsResponseAmino { + /** ParamsResponse is the response type for the Query/Params RPC method. */ + params?: ParamsAmino | undefined; +} +export interface ParamsResponseAminoMsg { + type: "/feemarket.feemarket.v1.ParamsResponse"; + value: ParamsResponseAmino; +} +/** ParamsResponse is the response type for the Query/Params RPC method. */ +export interface ParamsResponseSDKType { + params: ParamsSDKType | undefined; +} +/** StateRequest is the request type for the Query/State RPC method. */ +export interface StateRequest {} +export interface StateRequestProtoMsg { + typeUrl: "/feemarket.feemarket.v1.StateRequest"; + value: Uint8Array; +} +/** StateRequest is the request type for the Query/State RPC method. */ +export interface StateRequestAmino {} +export interface StateRequestAminoMsg { + type: "/feemarket.feemarket.v1.StateRequest"; + value: StateRequestAmino; +} +/** StateRequest is the request type for the Query/State RPC method. */ +export interface StateRequestSDKType {} +/** StateResponse is the response type for the Query/State RPC method. */ +export interface StateResponse { + /** StateResponse is the response type for the Query/State RPC method. */ + state: State | undefined; +} +export interface StateResponseProtoMsg { + typeUrl: "/feemarket.feemarket.v1.StateResponse"; + value: Uint8Array; +} +/** StateResponse is the response type for the Query/State RPC method. */ +export interface StateResponseAmino { + /** StateResponse is the response type for the Query/State RPC method. */ + state?: StateAmino | undefined; +} +export interface StateResponseAminoMsg { + type: "/feemarket.feemarket.v1.StateResponse"; + value: StateResponseAmino; +} +/** StateResponse is the response type for the Query/State RPC method. */ +export interface StateResponseSDKType { + state: StateSDKType | undefined; +} +/** GasPriceRequest is the request type for the Query/GasPrice RPC method. */ +export interface GasPriceRequest { + /** denom we are querying gas price in */ + denom: string; +} +export interface GasPriceRequestProtoMsg { + typeUrl: "/feemarket.feemarket.v1.GasPriceRequest"; + value: Uint8Array; +} +/** GasPriceRequest is the request type for the Query/GasPrice RPC method. */ +export interface GasPriceRequestAmino { + /** denom we are querying gas price in */ + denom?: string; +} +export interface GasPriceRequestAminoMsg { + type: "/feemarket.feemarket.v1.GasPriceRequest"; + value: GasPriceRequestAmino; +} +/** GasPriceRequest is the request type for the Query/GasPrice RPC method. */ +export interface GasPriceRequestSDKType { + denom: string; +} +/** + * GasPriceResponse is the response type for the Query/GasPrice RPC method. + * Returns a gas price in specified denom. + */ +export interface GasPriceResponse { + price: DecCoin | undefined; +} +export interface GasPriceResponseProtoMsg { + typeUrl: "/feemarket.feemarket.v1.GasPriceResponse"; + value: Uint8Array; +} +/** + * GasPriceResponse is the response type for the Query/GasPrice RPC method. + * Returns a gas price in specified denom. + */ +export interface GasPriceResponseAmino { + price: DecCoinAmino | undefined; +} +export interface GasPriceResponseAminoMsg { + type: "/feemarket.feemarket.v1.GasPriceResponse"; + value: GasPriceResponseAmino; +} +/** + * GasPriceResponse is the response type for the Query/GasPrice RPC method. + * Returns a gas price in specified denom. + */ +export interface GasPriceResponseSDKType { + price: DecCoinSDKType | undefined; +} +/** GasPriceRequest is the request type for the Query/GasPrices RPC method. */ +export interface GasPricesRequest {} +export interface GasPricesRequestProtoMsg { + typeUrl: "/feemarket.feemarket.v1.GasPricesRequest"; + value: Uint8Array; +} +/** GasPriceRequest is the request type for the Query/GasPrices RPC method. */ +export interface GasPricesRequestAmino {} +export interface GasPricesRequestAminoMsg { + type: "/feemarket.feemarket.v1.GasPricesRequest"; + value: GasPricesRequestAmino; +} +/** GasPriceRequest is the request type for the Query/GasPrices RPC method. */ +export interface GasPricesRequestSDKType {} +/** + * GasPricesResponse is the response type for the Query/GasPrices RPC method. + * Returns a gas price in all available denoms. + */ +export interface GasPricesResponse { + prices: DecCoin[]; +} +export interface GasPricesResponseProtoMsg { + typeUrl: "/feemarket.feemarket.v1.GasPricesResponse"; + value: Uint8Array; +} +/** + * GasPricesResponse is the response type for the Query/GasPrices RPC method. + * Returns a gas price in all available denoms. + */ +export interface GasPricesResponseAmino { + prices: DecCoinAmino[]; +} +export interface GasPricesResponseAminoMsg { + type: "/feemarket.feemarket.v1.GasPricesResponse"; + value: GasPricesResponseAmino; +} +/** + * GasPricesResponse is the response type for the Query/GasPrices RPC method. + * Returns a gas price in all available denoms. + */ +export interface GasPricesResponseSDKType { + prices: DecCoinSDKType[]; +} +function createBaseParamsRequest(): ParamsRequest { + return {}; +} +export const ParamsRequest = { + typeUrl: "/feemarket.feemarket.v1.ParamsRequest", + encode(_: ParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): ParamsRequest { + const message = createBaseParamsRequest(); + return message; + }, + fromAmino(_: ParamsRequestAmino): ParamsRequest { + const message = createBaseParamsRequest(); + return message; + }, + toAmino(_: ParamsRequest, useInterfaces: boolean = false): ParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: ParamsRequestAminoMsg): ParamsRequest { + return ParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsRequestProtoMsg, useInterfaces: boolean = false): ParamsRequest { + return ParamsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ParamsRequest): Uint8Array { + return ParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: ParamsRequest): ParamsRequestProtoMsg { + return { + typeUrl: "/feemarket.feemarket.v1.ParamsRequest", + value: ParamsRequest.encode(message).finish() + }; + } +}; +function createBaseParamsResponse(): ParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const ParamsResponse = { + typeUrl: "/feemarket.feemarket.v1.ParamsResponse", + encode(message: ParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ParamsResponse { + const message = createBaseParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: ParamsResponseAmino): ParamsResponse { + const message = createBaseParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: ParamsResponse, useInterfaces: boolean = false): ParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: ParamsResponseAminoMsg): ParamsResponse { + return ParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsResponseProtoMsg, useInterfaces: boolean = false): ParamsResponse { + return ParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ParamsResponse): Uint8Array { + return ParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: ParamsResponse): ParamsResponseProtoMsg { + return { + typeUrl: "/feemarket.feemarket.v1.ParamsResponse", + value: ParamsResponse.encode(message).finish() + }; + } +}; +function createBaseStateRequest(): StateRequest { + return {}; +} +export const StateRequest = { + typeUrl: "/feemarket.feemarket.v1.StateRequest", + encode(_: StateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): StateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): StateRequest { + const message = createBaseStateRequest(); + return message; + }, + fromAmino(_: StateRequestAmino): StateRequest { + const message = createBaseStateRequest(); + return message; + }, + toAmino(_: StateRequest, useInterfaces: boolean = false): StateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: StateRequestAminoMsg): StateRequest { + return StateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: StateRequestProtoMsg, useInterfaces: boolean = false): StateRequest { + return StateRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: StateRequest): Uint8Array { + return StateRequest.encode(message).finish(); + }, + toProtoMsg(message: StateRequest): StateRequestProtoMsg { + return { + typeUrl: "/feemarket.feemarket.v1.StateRequest", + value: StateRequest.encode(message).finish() + }; + } +}; +function createBaseStateResponse(): StateResponse { + return { + state: State.fromPartial({}) + }; +} +export const StateResponse = { + typeUrl: "/feemarket.feemarket.v1.StateResponse", + encode(message: StateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== undefined) { + State.encode(message.state, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): StateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = State.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StateResponse { + const message = createBaseStateResponse(); + message.state = object.state !== undefined && object.state !== null ? State.fromPartial(object.state) : undefined; + return message; + }, + fromAmino(object: StateResponseAmino): StateResponse { + const message = createBaseStateResponse(); + if (object.state !== undefined && object.state !== null) { + message.state = State.fromAmino(object.state); + } + return message; + }, + toAmino(message: StateResponse, useInterfaces: boolean = false): StateResponseAmino { + const obj: any = {}; + obj.state = message.state ? State.toAmino(message.state, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: StateResponseAminoMsg): StateResponse { + return StateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: StateResponseProtoMsg, useInterfaces: boolean = false): StateResponse { + return StateResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: StateResponse): Uint8Array { + return StateResponse.encode(message).finish(); + }, + toProtoMsg(message: StateResponse): StateResponseProtoMsg { + return { + typeUrl: "/feemarket.feemarket.v1.StateResponse", + value: StateResponse.encode(message).finish() + }; + } +}; +function createBaseGasPriceRequest(): GasPriceRequest { + return { + denom: "" + }; +} +export const GasPriceRequest = { + typeUrl: "/feemarket.feemarket.v1.GasPriceRequest", + encode(message: GasPriceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GasPriceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGasPriceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GasPriceRequest { + const message = createBaseGasPriceRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: GasPriceRequestAmino): GasPriceRequest { + const message = createBaseGasPriceRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: GasPriceRequest, useInterfaces: boolean = false): GasPriceRequestAmino { + const obj: any = {}; + obj.denom = message.denom; + return obj; + }, + fromAminoMsg(object: GasPriceRequestAminoMsg): GasPriceRequest { + return GasPriceRequest.fromAmino(object.value); + }, + fromProtoMsg(message: GasPriceRequestProtoMsg, useInterfaces: boolean = false): GasPriceRequest { + return GasPriceRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GasPriceRequest): Uint8Array { + return GasPriceRequest.encode(message).finish(); + }, + toProtoMsg(message: GasPriceRequest): GasPriceRequestProtoMsg { + return { + typeUrl: "/feemarket.feemarket.v1.GasPriceRequest", + value: GasPriceRequest.encode(message).finish() + }; + } +}; +function createBaseGasPriceResponse(): GasPriceResponse { + return { + price: DecCoin.fromPartial({}) + }; +} +export const GasPriceResponse = { + typeUrl: "/feemarket.feemarket.v1.GasPriceResponse", + encode(message: GasPriceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.price !== undefined) { + DecCoin.encode(message.price, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GasPriceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGasPriceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.price = DecCoin.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GasPriceResponse { + const message = createBaseGasPriceResponse(); + message.price = object.price !== undefined && object.price !== null ? DecCoin.fromPartial(object.price) : undefined; + return message; + }, + fromAmino(object: GasPriceResponseAmino): GasPriceResponse { + const message = createBaseGasPriceResponse(); + if (object.price !== undefined && object.price !== null) { + message.price = DecCoin.fromAmino(object.price); + } + return message; + }, + toAmino(message: GasPriceResponse, useInterfaces: boolean = false): GasPriceResponseAmino { + const obj: any = {}; + obj.price = message.price ? DecCoin.toAmino(message.price, useInterfaces) : DecCoin.fromPartial({}); + return obj; + }, + fromAminoMsg(object: GasPriceResponseAminoMsg): GasPriceResponse { + return GasPriceResponse.fromAmino(object.value); + }, + fromProtoMsg(message: GasPriceResponseProtoMsg, useInterfaces: boolean = false): GasPriceResponse { + return GasPriceResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GasPriceResponse): Uint8Array { + return GasPriceResponse.encode(message).finish(); + }, + toProtoMsg(message: GasPriceResponse): GasPriceResponseProtoMsg { + return { + typeUrl: "/feemarket.feemarket.v1.GasPriceResponse", + value: GasPriceResponse.encode(message).finish() + }; + } +}; +function createBaseGasPricesRequest(): GasPricesRequest { + return {}; +} +export const GasPricesRequest = { + typeUrl: "/feemarket.feemarket.v1.GasPricesRequest", + encode(_: GasPricesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GasPricesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGasPricesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): GasPricesRequest { + const message = createBaseGasPricesRequest(); + return message; + }, + fromAmino(_: GasPricesRequestAmino): GasPricesRequest { + const message = createBaseGasPricesRequest(); + return message; + }, + toAmino(_: GasPricesRequest, useInterfaces: boolean = false): GasPricesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: GasPricesRequestAminoMsg): GasPricesRequest { + return GasPricesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: GasPricesRequestProtoMsg, useInterfaces: boolean = false): GasPricesRequest { + return GasPricesRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GasPricesRequest): Uint8Array { + return GasPricesRequest.encode(message).finish(); + }, + toProtoMsg(message: GasPricesRequest): GasPricesRequestProtoMsg { + return { + typeUrl: "/feemarket.feemarket.v1.GasPricesRequest", + value: GasPricesRequest.encode(message).finish() + }; + } +}; +function createBaseGasPricesResponse(): GasPricesResponse { + return { + prices: [] + }; +} +export const GasPricesResponse = { + typeUrl: "/feemarket.feemarket.v1.GasPricesResponse", + encode(message: GasPricesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.prices) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GasPricesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGasPricesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prices.push(DecCoin.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GasPricesResponse { + const message = createBaseGasPricesResponse(); + message.prices = object.prices?.map(e => DecCoin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GasPricesResponseAmino): GasPricesResponse { + const message = createBaseGasPricesResponse(); + message.prices = object.prices?.map(e => DecCoin.fromAmino(e)) || []; + return message; + }, + toAmino(message: GasPricesResponse, useInterfaces: boolean = false): GasPricesResponseAmino { + const obj: any = {}; + if (message.prices) { + obj.prices = message.prices.map(e => e ? DecCoin.toAmino(e, useInterfaces) : undefined); + } else { + obj.prices = []; + } + return obj; + }, + fromAminoMsg(object: GasPricesResponseAminoMsg): GasPricesResponse { + return GasPricesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: GasPricesResponseProtoMsg, useInterfaces: boolean = false): GasPricesResponse { + return GasPricesResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GasPricesResponse): Uint8Array { + return GasPricesResponse.encode(message).finish(); + }, + toProtoMsg(message: GasPricesResponse): GasPricesResponseProtoMsg { + return { + typeUrl: "/feemarket.feemarket.v1.GasPricesResponse", + value: GasPricesResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/feemarket/feemarket/v1/tx.amino.ts b/packages/types/protobuf/codegen/feemarket/feemarket/v1/tx.amino.ts new file mode 100644 index 000000000..ff94a2950 --- /dev/null +++ b/packages/types/protobuf/codegen/feemarket/feemarket/v1/tx.amino.ts @@ -0,0 +1,8 @@ +import { MsgParams } from "./tx"; +export const AminoConverter = { + "/feemarket.feemarket.v1.MsgParams": { + aminoType: "/feemarket.feemarket.v1.MsgParams", + toAmino: MsgParams.toAmino, + fromAmino: MsgParams.fromAmino + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/feemarket/feemarket/v1/tx.registry.ts b/packages/types/protobuf/codegen/feemarket/feemarket/v1/tx.registry.ts new file mode 100644 index 000000000..a179004d2 --- /dev/null +++ b/packages/types/protobuf/codegen/feemarket/feemarket/v1/tx.registry.ts @@ -0,0 +1,35 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/feemarket.feemarket.v1.MsgParams", MsgParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + params(value: MsgParams) { + return { + typeUrl: "/feemarket.feemarket.v1.MsgParams", + value: MsgParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + params(value: MsgParams) { + return { + typeUrl: "/feemarket.feemarket.v1.MsgParams", + value + }; + } + }, + fromPartial: { + params(value: MsgParams) { + return { + typeUrl: "/feemarket.feemarket.v1.MsgParams", + value: MsgParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/feemarket/feemarket/v1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/feemarket/feemarket/v1/tx.rpc.msg.ts new file mode 100644 index 000000000..5f24b1611 --- /dev/null +++ b/packages/types/protobuf/codegen/feemarket/feemarket/v1/tx.rpc.msg.ts @@ -0,0 +1,21 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgParams, MsgParamsResponse } from "./tx"; +/** Message service defines the types of messages supported by the feemarket + module. */ +export interface Msg { + /** Params defines a method for updating the feemarket module parameters. */ + params(request: MsgParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + } + params(request: MsgParams, useInterfaces: boolean = true): Promise { + const data = MsgParams.encode(request).finish(); + const promise = this.rpc.request("feemarket.feemarket.v1.Msg", "Params", data); + return promise.then(data => MsgParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/feemarket/feemarket/v1/tx.ts b/packages/types/protobuf/codegen/feemarket/feemarket/v1/tx.ts new file mode 100644 index 000000000..c8b6c46d1 --- /dev/null +++ b/packages/types/protobuf/codegen/feemarket/feemarket/v1/tx.ts @@ -0,0 +1,184 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * MsgParams defines the Msg/Params request type. It contains the + * new parameters for the feemarket module. + */ +export interface MsgParams { + /** Params defines the new parameters for the feemarket module. */ + params: Params | undefined; + /** + * Authority defines the authority that is updating the feemarket module + * parameters. + */ + authority: string; +} +export interface MsgParamsProtoMsg { + typeUrl: "/feemarket.feemarket.v1.MsgParams"; + value: Uint8Array; +} +/** + * MsgParams defines the Msg/Params request type. It contains the + * new parameters for the feemarket module. + */ +export interface MsgParamsAmino { + /** Params defines the new parameters for the feemarket module. */ + params?: ParamsAmino | undefined; + /** + * Authority defines the authority that is updating the feemarket module + * parameters. + */ + authority?: string; +} +export interface MsgParamsAminoMsg { + type: "/feemarket.feemarket.v1.MsgParams"; + value: MsgParamsAmino; +} +/** + * MsgParams defines the Msg/Params request type. It contains the + * new parameters for the feemarket module. + */ +export interface MsgParamsSDKType { + params: ParamsSDKType | undefined; + authority: string; +} +/** MsgParamsResponse defines the Msg/Params response type. */ +export interface MsgParamsResponse {} +export interface MsgParamsResponseProtoMsg { + typeUrl: "/feemarket.feemarket.v1.MsgParamsResponse"; + value: Uint8Array; +} +/** MsgParamsResponse defines the Msg/Params response type. */ +export interface MsgParamsResponseAmino {} +export interface MsgParamsResponseAminoMsg { + type: "/feemarket.feemarket.v1.MsgParamsResponse"; + value: MsgParamsResponseAmino; +} +/** MsgParamsResponse defines the Msg/Params response type. */ +export interface MsgParamsResponseSDKType {} +function createBaseMsgParams(): MsgParams { + return { + params: Params.fromPartial({}), + authority: "" + }; +} +export const MsgParams = { + typeUrl: "/feemarket.feemarket.v1.MsgParams", + encode(message: MsgParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + if (message.authority !== "") { + writer.uint32(18).string(message.authority); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.authority = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgParams { + const message = createBaseMsgParams(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.authority = object.authority ?? ""; + return message; + }, + fromAmino(object: MsgParamsAmino): MsgParams { + const message = createBaseMsgParams(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + return message; + }, + toAmino(message: MsgParams, useInterfaces: boolean = false): MsgParamsAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + obj.authority = message.authority; + return obj; + }, + fromAminoMsg(object: MsgParamsAminoMsg): MsgParams { + return MsgParams.fromAmino(object.value); + }, + fromProtoMsg(message: MsgParamsProtoMsg, useInterfaces: boolean = false): MsgParams { + return MsgParams.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgParams): Uint8Array { + return MsgParams.encode(message).finish(); + }, + toProtoMsg(message: MsgParams): MsgParamsProtoMsg { + return { + typeUrl: "/feemarket.feemarket.v1.MsgParams", + value: MsgParams.encode(message).finish() + }; + } +}; +function createBaseMsgParamsResponse(): MsgParamsResponse { + return {}; +} +export const MsgParamsResponse = { + typeUrl: "/feemarket.feemarket.v1.MsgParamsResponse", + encode(_: MsgParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgParamsResponse { + const message = createBaseMsgParamsResponse(); + return message; + }, + fromAmino(_: MsgParamsResponseAmino): MsgParamsResponse { + const message = createBaseMsgParamsResponse(); + return message; + }, + toAmino(_: MsgParamsResponse, useInterfaces: boolean = false): MsgParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgParamsResponseAminoMsg): MsgParamsResponse { + return MsgParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgParamsResponseProtoMsg, useInterfaces: boolean = false): MsgParamsResponse { + return MsgParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgParamsResponse): Uint8Array { + return MsgParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgParamsResponse): MsgParamsResponseProtoMsg { + return { + typeUrl: "/feemarket.feemarket.v1.MsgParamsResponse", + value: MsgParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/feemarket/rpc.query.ts b/packages/types/protobuf/codegen/feemarket/rpc.query.ts new file mode 100644 index 000000000..ee72f5388 --- /dev/null +++ b/packages/types/protobuf/codegen/feemarket/rpc.query.ts @@ -0,0 +1,61 @@ +import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import { QueryClient } from "@cosmjs/stargate"; +export const createRPCQueryClient = async ({ + rpcEndpoint +}: { + rpcEndpoint: string | HttpEndpoint; +}) => { + const tmClient = await Tendermint34Client.connect(rpcEndpoint); + const client = new QueryClient(tmClient); + return { + cosmos: { + auth: { + v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + authz: { + v1beta1: (await import("../cosmos/authz/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + bank: { + v1beta1: (await import("../cosmos/bank/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + base: { + tendermint: { + v1beta1: (await import("../cosmos/base/tendermint/v1beta1/query.rpc.Service")).createRpcQueryExtension(client) + } + }, + distribution: { + v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + gov: { + v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), + v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + mint: { + v1beta1: (await import("../cosmos/mint/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + params: { + v1beta1: (await import("../cosmos/params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + slashing: { + v1beta1: (await import("../cosmos/slashing/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + staking: { + v1beta1: (await import("../cosmos/staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + tx: { + v1beta1: (await import("../cosmos/tx/v1beta1/service.rpc.Service")).createRpcQueryExtension(client) + }, + upgrade: { + v1beta1: (await import("../cosmos/upgrade/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, + feemarket: { + feemarket: { + v1: (await import("./feemarket/v1/query.rpc.Query")).createRpcQueryExtension(client) + } + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/feemarket/rpc.tx.ts b/packages/types/protobuf/codegen/feemarket/rpc.tx.ts new file mode 100644 index 000000000..9bd7d4875 --- /dev/null +++ b/packages/types/protobuf/codegen/feemarket/rpc.tx.ts @@ -0,0 +1,45 @@ +import { Rpc } from "../helpers"; +export const createRPCMsgClient = async ({ + rpc +}: { + rpc: Rpc; +}) => ({ + cosmos: { + auth: { + v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + authz: { + v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + bank: { + v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + distribution: { + v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + gov: { + v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), + v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + mint: { + v1beta1: new (await import("../cosmos/mint/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + slashing: { + v1beta1: new (await import("../cosmos/slashing/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + staking: { + v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + upgrade: { + v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + } + }, + feemarket: { + feemarket: { + v1: new (await import("./feemarket/v1/tx.rpc.msg")).MsgClientImpl(rpc) + } + } +}); \ No newline at end of file diff --git a/packages/types/protobuf/codegen/gaia/bundle.ts b/packages/types/protobuf/codegen/gaia/bundle.ts index e3bb970e5..39654b5ca 100644 --- a/packages/types/protobuf/codegen/gaia/bundle.ts +++ b/packages/types/protobuf/codegen/gaia/bundle.ts @@ -1,26 +1,26 @@ -import * as _103 from "./globalfee/v1beta1/genesis"; -import * as _104 from "./globalfee/v1beta1/query"; -import * as _105 from "./globalfee/v1beta1/tx"; -import * as _417 from "./globalfee/v1beta1/tx.amino"; -import * as _418 from "./globalfee/v1beta1/tx.registry"; -import * as _419 from "./globalfee/v1beta1/query.rpc.Query"; -import * as _420 from "./globalfee/v1beta1/tx.rpc.msg"; -import * as _598 from "./rpc.query"; -import * as _599 from "./rpc.tx"; +import * as _107 from "./globalfee/v1beta1/genesis"; +import * as _108 from "./globalfee/v1beta1/query"; +import * as _109 from "./globalfee/v1beta1/tx"; +import * as _425 from "./globalfee/v1beta1/tx.amino"; +import * as _426 from "./globalfee/v1beta1/tx.registry"; +import * as _427 from "./globalfee/v1beta1/query.rpc.Query"; +import * as _428 from "./globalfee/v1beta1/tx.rpc.msg"; +import * as _608 from "./rpc.query"; +import * as _609 from "./rpc.tx"; export namespace gaia { export namespace globalfee { export const v1beta1 = { - ..._103, - ..._104, - ..._105, - ..._417, - ..._418, - ..._419, - ..._420 + ..._107, + ..._108, + ..._109, + ..._425, + ..._426, + ..._427, + ..._428 }; } export const ClientFactory = { - ..._598, - ..._599 + ..._608, + ..._609 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/gogoproto/bundle.ts b/packages/types/protobuf/codegen/gogoproto/bundle.ts index b00af3007..7c55fbc57 100644 --- a/packages/types/protobuf/codegen/gogoproto/bundle.ts +++ b/packages/types/protobuf/codegen/gogoproto/bundle.ts @@ -1,4 +1,4 @@ -import * as _106 from "./gogo"; +import * as _110 from "./gogo"; export const gogoproto = { - ..._106 + ..._110 }; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/google/bundle.ts b/packages/types/protobuf/codegen/google/bundle.ts index 4fa43f377..4fe26b93b 100644 --- a/packages/types/protobuf/codegen/google/bundle.ts +++ b/packages/types/protobuf/codegen/google/bundle.ts @@ -1,20 +1,20 @@ -import * as _107 from "./api/annotations"; -import * as _108 from "./api/http"; -import * as _109 from "./protobuf/any"; -import * as _110 from "./protobuf/descriptor"; -import * as _111 from "./protobuf/duration"; -import * as _112 from "./protobuf/empty"; -import * as _113 from "./protobuf/timestamp"; +import * as _111 from "./api/annotations"; +import * as _112 from "./api/http"; +import * as _113 from "./protobuf/any"; +import * as _114 from "./protobuf/descriptor"; +import * as _115 from "./protobuf/duration"; +import * as _116 from "./protobuf/empty"; +import * as _117 from "./protobuf/timestamp"; export namespace google { export const api = { - ..._107, - ..._108 + ..._111, + ..._112 }; export const protobuf = { - ..._109, - ..._110, - ..._111, - ..._112, - ..._113 + ..._113, + ..._114, + ..._115, + ..._116, + ..._117 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/bundle.ts b/packages/types/protobuf/codegen/ibc/bundle.ts index d0eba8f4d..464c16855 100644 --- a/packages/types/protobuf/codegen/ibc/bundle.ts +++ b/packages/types/protobuf/codegen/ibc/bundle.ts @@ -1,120 +1,120 @@ -import * as _114 from "./applications/interchain_accounts/controller/v1/controller"; -import * as _115 from "./applications/interchain_accounts/controller/v1/query"; -import * as _116 from "./applications/interchain_accounts/controller/v1/tx"; -import * as _117 from "./applications/interchain_accounts/host/v1/host"; -import * as _118 from "./applications/interchain_accounts/host/v1/query"; -import * as _119 from "./applications/interchain_accounts/host/v1/tx"; -import * as _120 from "./applications/interchain_accounts/v1/account"; -import * as _121 from "./applications/interchain_accounts/v1/metadata"; -import * as _122 from "./applications/interchain_accounts/v1/packet"; -import * as _123 from "./applications/transfer/v1/authz"; -import * as _124 from "./applications/transfer/v1/genesis"; -import * as _125 from "./applications/transfer/v1/query"; -import * as _126 from "./applications/transfer/v1/transfer"; -import * as _127 from "./applications/transfer/v1/tx"; -import * as _128 from "./core/channel/v1/channel"; -import * as _129 from "./core/channel/v1/genesis"; -import * as _130 from "./core/channel/v1/query"; -import * as _131 from "./core/channel/v1/tx"; -import * as _132 from "./core/client/v1/client"; -import * as _133 from "./core/client/v1/genesis"; -import * as _134 from "./core/client/v1/query"; -import * as _135 from "./core/client/v1/tx"; -import * as _421 from "./applications/interchain_accounts/controller/v1/tx.amino"; -import * as _422 from "./applications/interchain_accounts/host/v1/tx.amino"; -import * as _423 from "./applications/transfer/v1/tx.amino"; -import * as _424 from "./core/channel/v1/tx.amino"; -import * as _425 from "./core/client/v1/tx.amino"; -import * as _426 from "./applications/interchain_accounts/controller/v1/tx.registry"; -import * as _427 from "./applications/interchain_accounts/host/v1/tx.registry"; -import * as _428 from "./applications/transfer/v1/tx.registry"; -import * as _429 from "./core/channel/v1/tx.registry"; -import * as _430 from "./core/client/v1/tx.registry"; -import * as _431 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; -import * as _432 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; -import * as _433 from "./applications/transfer/v1/query.rpc.Query"; -import * as _434 from "./core/channel/v1/query.rpc.Query"; -import * as _435 from "./core/client/v1/query.rpc.Query"; -import * as _436 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; -import * as _437 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; -import * as _438 from "./applications/transfer/v1/tx.rpc.msg"; -import * as _439 from "./core/channel/v1/tx.rpc.msg"; -import * as _440 from "./core/client/v1/tx.rpc.msg"; -import * as _600 from "./rpc.query"; -import * as _601 from "./rpc.tx"; +import * as _118 from "./applications/interchain_accounts/controller/v1/controller"; +import * as _119 from "./applications/interchain_accounts/controller/v1/query"; +import * as _120 from "./applications/interchain_accounts/controller/v1/tx"; +import * as _121 from "./applications/interchain_accounts/host/v1/host"; +import * as _122 from "./applications/interchain_accounts/host/v1/query"; +import * as _123 from "./applications/interchain_accounts/host/v1/tx"; +import * as _124 from "./applications/interchain_accounts/v1/account"; +import * as _125 from "./applications/interchain_accounts/v1/metadata"; +import * as _126 from "./applications/interchain_accounts/v1/packet"; +import * as _127 from "./applications/transfer/v1/authz"; +import * as _128 from "./applications/transfer/v1/genesis"; +import * as _129 from "./applications/transfer/v1/query"; +import * as _130 from "./applications/transfer/v1/transfer"; +import * as _131 from "./applications/transfer/v1/tx"; +import * as _132 from "./core/channel/v1/channel"; +import * as _133 from "./core/channel/v1/genesis"; +import * as _134 from "./core/channel/v1/query"; +import * as _135 from "./core/channel/v1/tx"; +import * as _136 from "./core/client/v1/client"; +import * as _137 from "./core/client/v1/genesis"; +import * as _138 from "./core/client/v1/query"; +import * as _139 from "./core/client/v1/tx"; +import * as _429 from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as _430 from "./applications/interchain_accounts/host/v1/tx.amino"; +import * as _431 from "./applications/transfer/v1/tx.amino"; +import * as _432 from "./core/channel/v1/tx.amino"; +import * as _433 from "./core/client/v1/tx.amino"; +import * as _434 from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as _435 from "./applications/interchain_accounts/host/v1/tx.registry"; +import * as _436 from "./applications/transfer/v1/tx.registry"; +import * as _437 from "./core/channel/v1/tx.registry"; +import * as _438 from "./core/client/v1/tx.registry"; +import * as _439 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; +import * as _440 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; +import * as _441 from "./applications/transfer/v1/query.rpc.Query"; +import * as _442 from "./core/channel/v1/query.rpc.Query"; +import * as _443 from "./core/client/v1/query.rpc.Query"; +import * as _444 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; +import * as _445 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; +import * as _446 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _447 from "./core/channel/v1/tx.rpc.msg"; +import * as _448 from "./core/client/v1/tx.rpc.msg"; +import * as _610 from "./rpc.query"; +import * as _611 from "./rpc.tx"; export namespace ibc { export namespace applications { export namespace interchain_accounts { export namespace controller { export const v1 = { - ..._114, - ..._115, - ..._116, - ..._421, - ..._426, - ..._431, - ..._436 + ..._118, + ..._119, + ..._120, + ..._429, + ..._434, + ..._439, + ..._444 }; } export namespace host { export const v1 = { - ..._117, - ..._118, - ..._119, - ..._422, - ..._427, - ..._432, - ..._437 + ..._121, + ..._122, + ..._123, + ..._430, + ..._435, + ..._440, + ..._445 }; } export const v1 = { - ..._120, - ..._121, - ..._122 - }; - } - export namespace transfer { - export const v1 = { - ..._123, ..._124, ..._125, - ..._126, - ..._127, - ..._423, - ..._428, - ..._433, - ..._438 + ..._126 }; } - } - export namespace core { - export namespace channel { + export namespace transfer { export const v1 = { + ..._127, ..._128, ..._129, ..._130, ..._131, - ..._424, - ..._429, - ..._434, - ..._439 + ..._431, + ..._436, + ..._441, + ..._446 }; } - export namespace client { + } + export namespace core { + export namespace channel { export const v1 = { ..._132, ..._133, ..._134, ..._135, - ..._425, - ..._430, - ..._435, - ..._440 + ..._432, + ..._437, + ..._442, + ..._447 + }; + } + export namespace client { + export const v1 = { + ..._136, + ..._137, + ..._138, + ..._139, + ..._433, + ..._438, + ..._443, + ..._448 }; } } export const ClientFactory = { - ..._600, - ..._601 + ..._610, + ..._611 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/index.ts b/packages/types/protobuf/codegen/index.ts index 3092c4c96..2c266afd8 100644 --- a/packages/types/protobuf/codegen/index.ts +++ b/packages/types/protobuf/codegen/index.ts @@ -16,6 +16,8 @@ export * from "./cosmos/bundle"; export * from "./cosmos/client"; export * from "./cosmwasm/bundle"; export * from "./cosmwasm/client"; +export * from "./feemarket/bundle"; +export * from "./feemarket/client"; export * from "./gaia/bundle"; export * from "./gaia/client"; export * from "./gogoproto/bundle"; diff --git a/packages/types/protobuf/codegen/juno/bundle.ts b/packages/types/protobuf/codegen/juno/bundle.ts index 416c0d3f8..c371d2ffa 100644 --- a/packages/types/protobuf/codegen/juno/bundle.ts +++ b/packages/types/protobuf/codegen/juno/bundle.ts @@ -1,46 +1,46 @@ -import * as _136 from "./feeshare/v1/feeshare"; -import * as _137 from "./feeshare/v1/genesis"; -import * as _138 from "./feeshare/v1/query"; -import * as _139 from "./feeshare/v1/tx"; -import * as _140 from "./mint/genesis"; -import * as _141 from "./mint/mint"; -import * as _142 from "./mint/query"; -import * as _143 from "./mint/tx"; -import * as _441 from "./feeshare/v1/tx.amino"; -import * as _442 from "./mint/tx.amino"; -import * as _443 from "./feeshare/v1/tx.registry"; -import * as _444 from "./mint/tx.registry"; -import * as _445 from "./feeshare/v1/query.rpc.Query"; -import * as _446 from "./mint/query.rpc.Query"; -import * as _447 from "./feeshare/v1/tx.rpc.msg"; -import * as _448 from "./mint/tx.rpc.msg"; -import * as _602 from "./rpc.query"; -import * as _603 from "./rpc.tx"; +import * as _140 from "./feeshare/v1/feeshare"; +import * as _141 from "./feeshare/v1/genesis"; +import * as _142 from "./feeshare/v1/query"; +import * as _143 from "./feeshare/v1/tx"; +import * as _144 from "./mint/genesis"; +import * as _145 from "./mint/mint"; +import * as _146 from "./mint/query"; +import * as _147 from "./mint/tx"; +import * as _449 from "./feeshare/v1/tx.amino"; +import * as _450 from "./mint/tx.amino"; +import * as _451 from "./feeshare/v1/tx.registry"; +import * as _452 from "./mint/tx.registry"; +import * as _453 from "./feeshare/v1/query.rpc.Query"; +import * as _454 from "./mint/query.rpc.Query"; +import * as _455 from "./feeshare/v1/tx.rpc.msg"; +import * as _456 from "./mint/tx.rpc.msg"; +import * as _612 from "./rpc.query"; +import * as _613 from "./rpc.tx"; export namespace juno { export namespace feeshare { export const v1 = { - ..._136, - ..._137, - ..._138, - ..._139, - ..._441, - ..._443, - ..._445, - ..._447 + ..._140, + ..._141, + ..._142, + ..._143, + ..._449, + ..._451, + ..._453, + ..._455 }; } export const mint = { - ..._140, - ..._141, - ..._142, - ..._143, - ..._442, - ..._444, - ..._446, - ..._448 + ..._144, + ..._145, + ..._146, + ..._147, + ..._450, + ..._452, + ..._454, + ..._456 }; export const ClientFactory = { - ..._602, - ..._603 + ..._612, + ..._613 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/bundle.ts b/packages/types/protobuf/codegen/kujira/bundle.ts index 6338ef311..3d7e17f5d 100644 --- a/packages/types/protobuf/codegen/kujira/bundle.ts +++ b/packages/types/protobuf/codegen/kujira/bundle.ts @@ -1,60 +1,60 @@ -import * as _144 from "./denom/authorityMetadata"; -import * as _145 from "./denom/genesis"; -import * as _146 from "./denom/params"; -import * as _147 from "./denom/query"; -import * as _148 from "./denom/tx"; -import * as _149 from "./oracle/genesis"; -import * as _150 from "./oracle/oracle"; -import * as _151 from "./oracle/query"; -import * as _152 from "./oracle/tx"; -import * as _153 from "./scheduler/genesis"; -import * as _154 from "./scheduler/hook"; -import * as _155 from "./scheduler/params"; -import * as _156 from "./scheduler/proposal"; -import * as _157 from "./scheduler/query"; -import * as _449 from "./denom/tx.amino"; -import * as _450 from "./oracle/tx.amino"; -import * as _451 from "./denom/tx.registry"; -import * as _452 from "./oracle/tx.registry"; -import * as _453 from "./denom/query.rpc.Query"; -import * as _454 from "./oracle/query.rpc.Query"; -import * as _455 from "./scheduler/query.rpc.Query"; -import * as _456 from "./denom/tx.rpc.msg"; -import * as _457 from "./oracle/tx.rpc.msg"; -import * as _604 from "./rpc.query"; -import * as _605 from "./rpc.tx"; +import * as _148 from "./denom/authorityMetadata"; +import * as _149 from "./denom/genesis"; +import * as _150 from "./denom/params"; +import * as _151 from "./denom/query"; +import * as _152 from "./denom/tx"; +import * as _153 from "./oracle/genesis"; +import * as _154 from "./oracle/oracle"; +import * as _155 from "./oracle/query"; +import * as _156 from "./oracle/tx"; +import * as _157 from "./scheduler/genesis"; +import * as _158 from "./scheduler/hook"; +import * as _159 from "./scheduler/params"; +import * as _160 from "./scheduler/proposal"; +import * as _161 from "./scheduler/query"; +import * as _457 from "./denom/tx.amino"; +import * as _458 from "./oracle/tx.amino"; +import * as _459 from "./denom/tx.registry"; +import * as _460 from "./oracle/tx.registry"; +import * as _461 from "./denom/query.rpc.Query"; +import * as _462 from "./oracle/query.rpc.Query"; +import * as _463 from "./scheduler/query.rpc.Query"; +import * as _464 from "./denom/tx.rpc.msg"; +import * as _465 from "./oracle/tx.rpc.msg"; +import * as _614 from "./rpc.query"; +import * as _615 from "./rpc.tx"; export namespace kujira { export const denom = { - ..._144, - ..._145, - ..._146, - ..._147, ..._148, - ..._449, - ..._451, - ..._453, - ..._456 - }; - export const oracle = { ..._149, ..._150, ..._151, ..._152, - ..._450, - ..._452, - ..._454, - ..._457 + ..._457, + ..._459, + ..._461, + ..._464 }; - export const scheduler = { + export const oracle = { ..._153, ..._154, ..._155, ..._156, + ..._458, + ..._460, + ..._462, + ..._465 + }; + export const scheduler = { ..._157, - ..._455 + ..._158, + ..._159, + ..._160, + ..._161, + ..._463 }; export const ClientFactory = { - ..._604, - ..._605 + ..._614, + ..._615 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/neutron/bundle.ts b/packages/types/protobuf/codegen/neutron/bundle.ts index 5a2956f3f..6720f7c58 100644 --- a/packages/types/protobuf/codegen/neutron/bundle.ts +++ b/packages/types/protobuf/codegen/neutron/bundle.ts @@ -1,89 +1,85 @@ -import * as _158 from "./contractmanager/v1/failure"; -import * as _159 from "./cron/genesis"; -import * as _160 from "./cron/params"; -import * as _161 from "./cron/query"; -import * as _162 from "./cron/schedule"; -import * as _163 from "./cron/tx"; -import * as _164 from "./dex/deposit_record"; -import * as _165 from "./dex/genesis"; -import * as _166 from "./dex/limit_order_expiration"; -import * as _167 from "./dex/limit_order_tranche_user"; -import * as _168 from "./dex/limit_order_tranche"; -import * as _169 from "./dex/pair_id"; -import * as _170 from "./dex/params"; -import * as _171 from "./dex/pool_metadata"; -import * as _172 from "./dex/pool_reserves"; -import * as _173 from "./dex/pool"; -import * as _174 from "./dex/query"; -import * as _175 from "./dex/tick_liquidity"; -import * as _176 from "./dex/trade_pair_id"; -import * as _177 from "./dex/tx"; -import * as _178 from "./feeburner/genesis"; -import * as _179 from "./feeburner/params"; -import * as _180 from "./feeburner/query"; -import * as _181 from "./feeburner/total_burned_neutrons_amount"; -import * as _182 from "./feeburner/tx"; -import * as _183 from "./feerefunder/fee"; -import * as _184 from "./feerefunder/genesis"; -import * as _185 from "./feerefunder/params"; -import * as _186 from "./feerefunder/query"; -import * as _187 from "./feerefunder/tx"; -import * as _188 from "./interchainqueries/genesis"; -import * as _189 from "./interchainqueries/params"; -import * as _190 from "./interchainqueries/query"; -import * as _191 from "./interchainqueries/tx"; -import * as _192 from "./interchaintxs/v1/genesis"; -import * as _193 from "./interchaintxs/v1/params"; -import * as _194 from "./interchaintxs/v1/query"; -import * as _195 from "./interchaintxs/v1/tx"; -import * as _458 from "./cron/tx.amino"; -import * as _459 from "./dex/tx.amino"; -import * as _460 from "./feeburner/tx.amino"; -import * as _461 from "./feerefunder/tx.amino"; -import * as _462 from "./interchainqueries/tx.amino"; -import * as _463 from "./interchaintxs/v1/tx.amino"; -import * as _464 from "./cron/tx.registry"; -import * as _465 from "./dex/tx.registry"; -import * as _466 from "./feeburner/tx.registry"; -import * as _467 from "./feerefunder/tx.registry"; -import * as _468 from "./interchainqueries/tx.registry"; -import * as _469 from "./interchaintxs/v1/tx.registry"; -import * as _470 from "./cron/query.rpc.Query"; -import * as _471 from "./dex/query.rpc.Query"; -import * as _472 from "./feeburner/query.rpc.Query"; -import * as _473 from "./feerefunder/query.rpc.Query"; -import * as _474 from "./interchainqueries/query.rpc.Query"; -import * as _475 from "./interchaintxs/v1/query.rpc.Query"; -import * as _476 from "./cron/tx.rpc.msg"; -import * as _477 from "./dex/tx.rpc.msg"; -import * as _478 from "./feeburner/tx.rpc.msg"; -import * as _479 from "./feerefunder/tx.rpc.msg"; -import * as _480 from "./interchainqueries/tx.rpc.msg"; -import * as _481 from "./interchaintxs/v1/tx.rpc.msg"; -import * as _606 from "./rpc.query"; -import * as _607 from "./rpc.tx"; +import * as _162 from "./contractmanager/v1/failure"; +import * as _163 from "./cron/genesis"; +import * as _164 from "./cron/params"; +import * as _165 from "./cron/query"; +import * as _166 from "./cron/schedule"; +import * as _167 from "./cron/tx"; +import * as _168 from "./dex/deposit_record"; +import * as _169 from "./dex/genesis"; +import * as _170 from "./dex/limit_order_expiration"; +import * as _171 from "./dex/limit_order_tranche_user"; +import * as _172 from "./dex/limit_order_tranche"; +import * as _173 from "./dex/pair_id"; +import * as _174 from "./dex/params"; +import * as _175 from "./dex/pool_metadata"; +import * as _176 from "./dex/pool_reserves"; +import * as _177 from "./dex/pool"; +import * as _178 from "./dex/query"; +import * as _179 from "./dex/tick_liquidity"; +import * as _180 from "./dex/trade_pair_id"; +import * as _181 from "./dex/tx"; +import * as _182 from "./feeburner/genesis"; +import * as _183 from "./feeburner/params"; +import * as _184 from "./feeburner/query"; +import * as _185 from "./feeburner/total_burned_neutrons_amount"; +import * as _186 from "./feeburner/tx"; +import * as _187 from "./feerefunder/fee"; +import * as _188 from "./feerefunder/genesis"; +import * as _189 from "./feerefunder/params"; +import * as _190 from "./feerefunder/query"; +import * as _191 from "./feerefunder/tx"; +import * as _192 from "./interchainqueries/genesis"; +import * as _193 from "./interchainqueries/params"; +import * as _194 from "./interchainqueries/query"; +import * as _195 from "./interchainqueries/tx"; +import * as _196 from "./interchaintxs/v1/genesis"; +import * as _197 from "./interchaintxs/v1/params"; +import * as _198 from "./interchaintxs/v1/query"; +import * as _199 from "./interchaintxs/v1/tx"; +import * as _466 from "./cron/tx.amino"; +import * as _467 from "./dex/tx.amino"; +import * as _468 from "./feeburner/tx.amino"; +import * as _469 from "./feerefunder/tx.amino"; +import * as _470 from "./interchainqueries/tx.amino"; +import * as _471 from "./interchaintxs/v1/tx.amino"; +import * as _472 from "./cron/tx.registry"; +import * as _473 from "./dex/tx.registry"; +import * as _474 from "./feeburner/tx.registry"; +import * as _475 from "./feerefunder/tx.registry"; +import * as _476 from "./interchainqueries/tx.registry"; +import * as _477 from "./interchaintxs/v1/tx.registry"; +import * as _478 from "./cron/query.rpc.Query"; +import * as _479 from "./dex/query.rpc.Query"; +import * as _480 from "./feeburner/query.rpc.Query"; +import * as _481 from "./feerefunder/query.rpc.Query"; +import * as _482 from "./interchainqueries/query.rpc.Query"; +import * as _483 from "./interchaintxs/v1/query.rpc.Query"; +import * as _484 from "./cron/tx.rpc.msg"; +import * as _485 from "./dex/tx.rpc.msg"; +import * as _486 from "./feeburner/tx.rpc.msg"; +import * as _487 from "./feerefunder/tx.rpc.msg"; +import * as _488 from "./interchainqueries/tx.rpc.msg"; +import * as _489 from "./interchaintxs/v1/tx.rpc.msg"; +import * as _616 from "./rpc.query"; +import * as _617 from "./rpc.tx"; export namespace neutron { export namespace contractmanager { export const v1 = { - ..._158 + ..._162 }; } export const cron = { - ..._159, - ..._160, - ..._161, - ..._162, ..._163, - ..._458, - ..._464, - ..._470, - ..._476 - }; - export const dex = { ..._164, ..._165, ..._166, ..._167, + ..._466, + ..._472, + ..._478, + ..._484 + }; + export const dex = { ..._168, ..._169, ..._170, @@ -94,57 +90,61 @@ export namespace neutron { ..._175, ..._176, ..._177, - ..._459, - ..._465, - ..._471, - ..._477 - }; - export const feeburner = { ..._178, ..._179, ..._180, ..._181, - ..._182, - ..._460, - ..._466, - ..._472, - ..._478 + ..._467, + ..._473, + ..._479, + ..._485 }; - export const feerefunder = { + export const feeburner = { + ..._182, ..._183, ..._184, ..._185, ..._186, - ..._187, - ..._461, - ..._467, - ..._473, - ..._479 + ..._468, + ..._474, + ..._480, + ..._486 }; - export const interchainqueries = { + export const feerefunder = { + ..._187, ..._188, ..._189, ..._190, ..._191, - ..._462, - ..._468, - ..._474, - ..._480 + ..._469, + ..._475, + ..._481, + ..._487 + }; + export const interchainqueries = { + ..._192, + ..._193, + ..._194, + ..._195, + ..._470, + ..._476, + ..._482, + ..._488 }; export namespace interchaintxs { export const v1 = { - ..._192, - ..._193, - ..._194, - ..._195, - ..._463, - ..._469, - ..._475, - ..._481 + ..._196, + ..._197, + ..._198, + ..._199, + ..._471, + ..._477, + ..._483, + ..._489 }; } export const ClientFactory = { - ..._606, - ..._607 + ..._616, + ..._617 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/noble/bundle.ts b/packages/types/protobuf/codegen/noble/bundle.ts index 45d38bbc9..5bc575140 100644 --- a/packages/types/protobuf/codegen/noble/bundle.ts +++ b/packages/types/protobuf/codegen/noble/bundle.ts @@ -1,16 +1,16 @@ -import * as _338 from "../tariff/genesis"; -import * as _339 from "../tariff/params"; -import * as _340 from "../tariff/query"; -import * as _588 from "../tariff/query.rpc.Query"; -import * as _616 from "./rpc.query"; +import * as _342 from "../tariff/genesis"; +import * as _343 from "../tariff/params"; +import * as _344 from "../tariff/query"; +import * as _596 from "../tariff/query.rpc.Query"; +import * as _626 from "./rpc.query"; export namespace noble { export const tariff = { - ..._338, - ..._339, - ..._340, - ..._588 + ..._342, + ..._343, + ..._344, + ..._596 }; export const ClientFactory = { - ..._616 + ..._626 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/bundle.ts b/packages/types/protobuf/codegen/osmosis/bundle.ts index 76c592f6f..d9cc3f94e 100644 --- a/packages/types/protobuf/codegen/osmosis/bundle.ts +++ b/packages/types/protobuf/codegen/osmosis/bundle.ts @@ -1,166 +1,162 @@ -import * as _196 from "./accum/v1beta1/accum"; -import * as _197 from "./concentratedliquidity/params"; -import * as _198 from "./cosmwasmpool/v1beta1/genesis"; -import * as _199 from "./cosmwasmpool/v1beta1/gov"; -import * as _200 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; -import * as _201 from "./cosmwasmpool/v1beta1/model/module_query_msg"; -import * as _202 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; -import * as _203 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; -import * as _204 from "./cosmwasmpool/v1beta1/model/pool"; -import * as _205 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; -import * as _206 from "./cosmwasmpool/v1beta1/model/tx"; -import * as _207 from "./cosmwasmpool/v1beta1/params"; -import * as _208 from "./cosmwasmpool/v1beta1/query"; -import * as _209 from "./cosmwasmpool/v1beta1/tx"; -import * as _210 from "./gamm/pool-models/balancer/balancerPool"; -import * as _211 from "./gamm/v1beta1/genesis"; -import * as _212 from "./gamm/v1beta1/gov"; -import * as _213 from "./gamm/v1beta1/query"; -import * as _214 from "./gamm/v1beta1/shared"; -import * as _215 from "./gamm/v1beta1/tx"; -import * as _216 from "./gamm/pool-models/balancer/tx/tx"; -import * as _217 from "./gamm/pool-models/stableswap/stableswap_pool"; -import * as _218 from "./gamm/pool-models/stableswap/tx"; -import * as _219 from "./incentives/gauge"; -import * as _220 from "./incentives/genesis"; -import * as _221 from "./incentives/gov"; -import * as _222 from "./incentives/group"; -import * as _223 from "./incentives/params"; -import * as _224 from "./incentives/query"; -import * as _225 from "./incentives/tx"; -import * as _226 from "./lockup/genesis"; -import * as _227 from "./lockup/lock"; -import * as _228 from "./lockup/params"; -import * as _229 from "./lockup/query"; -import * as _230 from "./lockup/tx"; -import * as _231 from "./pool-incentives/v1beta1/genesis"; -import * as _232 from "./pool-incentives/v1beta1/gov"; -import * as _233 from "./pool-incentives/v1beta1/incentives"; -import * as _234 from "./pool-incentives/v1beta1/query"; -import * as _235 from "./pool-incentives/v1beta1/shared"; -import * as _236 from "./poolmanager/v1beta1/genesis"; -import * as _237 from "./poolmanager/v1beta1/gov"; -import * as _238 from "./poolmanager/v1beta1/module_route"; -import * as _239 from "./poolmanager/v1beta1/query"; -import * as _240 from "./poolmanager/v1beta1/swap_route"; -import * as _241 from "./poolmanager/v1beta1/tx"; -import * as _242 from "./protorev/v1beta1/genesis"; -import * as _243 from "./protorev/v1beta1/gov"; -import * as _244 from "./protorev/v1beta1/params"; -import * as _245 from "./protorev/v1beta1/protorev"; -import * as _246 from "./protorev/v1beta1/query"; -import * as _247 from "./protorev/v1beta1/tx"; -import * as _248 from "./smartaccount/v1beta1/genesis"; -import * as _249 from "./smartaccount/v1beta1/models"; -import * as _250 from "./smartaccount/v1beta1/params"; -import * as _251 from "./smartaccount/v1beta1/query"; -import * as _252 from "./smartaccount/v1beta1/tx"; -import * as _253 from "./superfluid/genesis"; -import * as _254 from "./superfluid/params"; -import * as _255 from "./superfluid/query"; -import * as _256 from "./superfluid/superfluid"; -import * as _257 from "./superfluid/tx"; -import * as _258 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _259 from "./tokenfactory/v1beta1/genesis"; -import * as _260 from "./tokenfactory/v1beta1/params"; -import * as _261 from "./tokenfactory/v1beta1/query"; -import * as _262 from "./tokenfactory/v1beta1/tx"; -import * as _263 from "./txfees/v1beta1/feetoken"; -import * as _264 from "./txfees/v1beta1/genesis"; -import * as _265 from "./txfees/v1beta1/gov"; -import * as _266 from "./txfees/v1beta1/params"; -import * as _267 from "./txfees/v1beta1/query"; -import * as _268 from "./txfees/v1beta1/tx"; -import * as _269 from "./valset-pref/v1beta1/query"; -import * as _270 from "./valset-pref/v1beta1/state"; -import * as _271 from "./valset-pref/v1beta1/tx"; -import * as _482 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; -import * as _483 from "./concentratedliquidity/v1beta1/tx.amino"; -import * as _484 from "./gamm/pool-models/balancer/tx/tx.amino"; -import * as _485 from "./gamm/pool-models/stableswap/tx.amino"; -import * as _486 from "./gamm/v1beta1/tx.amino"; -import * as _487 from "./incentives/tx.amino"; -import * as _488 from "./lockup/tx.amino"; -import * as _489 from "./poolmanager/v1beta1/tx.amino"; -import * as _490 from "./protorev/v1beta1/tx.amino"; -import * as _491 from "./smartaccount/v1beta1/tx.amino"; -import * as _492 from "./superfluid/tx.amino"; -import * as _493 from "./tokenfactory/v1beta1/tx.amino"; -import * as _494 from "./txfees/v1beta1/tx.amino"; -import * as _495 from "./valset-pref/v1beta1/tx.amino"; -import * as _496 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; -import * as _497 from "./concentratedliquidity/v1beta1/tx.registry"; -import * as _498 from "./gamm/pool-models/balancer/tx/tx.registry"; -import * as _499 from "./gamm/pool-models/stableswap/tx.registry"; -import * as _500 from "./gamm/v1beta1/tx.registry"; -import * as _501 from "./incentives/tx.registry"; -import * as _502 from "./lockup/tx.registry"; -import * as _503 from "./poolmanager/v1beta1/tx.registry"; -import * as _504 from "./protorev/v1beta1/tx.registry"; -import * as _505 from "./smartaccount/v1beta1/tx.registry"; -import * as _506 from "./superfluid/tx.registry"; -import * as _507 from "./tokenfactory/v1beta1/tx.registry"; -import * as _508 from "./txfees/v1beta1/tx.registry"; -import * as _509 from "./valset-pref/v1beta1/tx.registry"; -import * as _510 from "./concentratedliquidity/v1beta1/query.rpc.Query"; -import * as _511 from "./cosmwasmpool/v1beta1/query.rpc.Query"; -import * as _512 from "./gamm/v1beta1/query.rpc.Query"; -import * as _513 from "./incentives/query.rpc.Query"; -import * as _514 from "./lockup/query.rpc.Query"; -import * as _515 from "./pool-incentives/v1beta1/query.rpc.Query"; -import * as _516 from "./poolmanager/v1beta1/query.rpc.Query"; -import * as _517 from "./protorev/v1beta1/query.rpc.Query"; -import * as _518 from "./smartaccount/v1beta1/query.rpc.Query"; -import * as _519 from "./superfluid/query.rpc.Query"; -import * as _520 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _521 from "./txfees/v1beta1/query.rpc.Query"; -import * as _522 from "./valset-pref/v1beta1/query.rpc.Query"; -import * as _523 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; -import * as _524 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; -import * as _525 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; -import * as _526 from "./gamm/pool-models/stableswap/tx.rpc.msg"; -import * as _527 from "./gamm/v1beta1/tx.rpc.msg"; -import * as _528 from "./incentives/tx.rpc.msg"; -import * as _529 from "./lockup/tx.rpc.msg"; -import * as _530 from "./poolmanager/v1beta1/tx.rpc.msg"; -import * as _531 from "./protorev/v1beta1/tx.rpc.msg"; -import * as _532 from "./smartaccount/v1beta1/tx.rpc.msg"; -import * as _533 from "./superfluid/tx.rpc.msg"; -import * as _534 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _535 from "./txfees/v1beta1/tx.rpc.msg"; -import * as _536 from "./valset-pref/v1beta1/tx.rpc.msg"; -import * as _608 from "./rpc.query"; -import * as _609 from "./rpc.tx"; +import * as _200 from "./accum/v1beta1/accum"; +import * as _201 from "./concentratedliquidity/params"; +import * as _202 from "./cosmwasmpool/v1beta1/genesis"; +import * as _203 from "./cosmwasmpool/v1beta1/gov"; +import * as _204 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; +import * as _205 from "./cosmwasmpool/v1beta1/model/module_query_msg"; +import * as _206 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; +import * as _207 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; +import * as _208 from "./cosmwasmpool/v1beta1/model/pool"; +import * as _209 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; +import * as _210 from "./cosmwasmpool/v1beta1/model/tx"; +import * as _211 from "./cosmwasmpool/v1beta1/params"; +import * as _212 from "./cosmwasmpool/v1beta1/query"; +import * as _213 from "./cosmwasmpool/v1beta1/tx"; +import * as _214 from "./gamm/pool-models/balancer/balancerPool"; +import * as _215 from "./gamm/v1beta1/genesis"; +import * as _216 from "./gamm/v1beta1/gov"; +import * as _217 from "./gamm/v1beta1/query"; +import * as _218 from "./gamm/v1beta1/shared"; +import * as _219 from "./gamm/v1beta1/tx"; +import * as _220 from "./gamm/pool-models/balancer/tx/tx"; +import * as _221 from "./gamm/pool-models/stableswap/stableswap_pool"; +import * as _222 from "./gamm/pool-models/stableswap/tx"; +import * as _223 from "./incentives/gauge"; +import * as _224 from "./incentives/genesis"; +import * as _225 from "./incentives/gov"; +import * as _226 from "./incentives/group"; +import * as _227 from "./incentives/params"; +import * as _228 from "./incentives/query"; +import * as _229 from "./incentives/tx"; +import * as _230 from "./lockup/genesis"; +import * as _231 from "./lockup/lock"; +import * as _232 from "./lockup/params"; +import * as _233 from "./lockup/query"; +import * as _234 from "./lockup/tx"; +import * as _235 from "./pool-incentives/v1beta1/genesis"; +import * as _236 from "./pool-incentives/v1beta1/gov"; +import * as _237 from "./pool-incentives/v1beta1/incentives"; +import * as _238 from "./pool-incentives/v1beta1/query"; +import * as _239 from "./pool-incentives/v1beta1/shared"; +import * as _240 from "./poolmanager/v1beta1/genesis"; +import * as _241 from "./poolmanager/v1beta1/gov"; +import * as _242 from "./poolmanager/v1beta1/module_route"; +import * as _243 from "./poolmanager/v1beta1/query"; +import * as _244 from "./poolmanager/v1beta1/swap_route"; +import * as _245 from "./poolmanager/v1beta1/tx"; +import * as _246 from "./protorev/v1beta1/genesis"; +import * as _247 from "./protorev/v1beta1/gov"; +import * as _248 from "./protorev/v1beta1/params"; +import * as _249 from "./protorev/v1beta1/protorev"; +import * as _250 from "./protorev/v1beta1/query"; +import * as _251 from "./protorev/v1beta1/tx"; +import * as _252 from "./smartaccount/v1beta1/genesis"; +import * as _253 from "./smartaccount/v1beta1/models"; +import * as _254 from "./smartaccount/v1beta1/params"; +import * as _255 from "./smartaccount/v1beta1/query"; +import * as _256 from "./smartaccount/v1beta1/tx"; +import * as _257 from "./superfluid/genesis"; +import * as _258 from "./superfluid/params"; +import * as _259 from "./superfluid/query"; +import * as _260 from "./superfluid/superfluid"; +import * as _261 from "./superfluid/tx"; +import * as _262 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _263 from "./tokenfactory/v1beta1/genesis"; +import * as _264 from "./tokenfactory/v1beta1/params"; +import * as _265 from "./tokenfactory/v1beta1/query"; +import * as _266 from "./tokenfactory/v1beta1/tx"; +import * as _267 from "./txfees/v1beta1/feetoken"; +import * as _268 from "./txfees/v1beta1/genesis"; +import * as _269 from "./txfees/v1beta1/gov"; +import * as _270 from "./txfees/v1beta1/params"; +import * as _271 from "./txfees/v1beta1/query"; +import * as _272 from "./txfees/v1beta1/tx"; +import * as _273 from "./valset-pref/v1beta1/query"; +import * as _274 from "./valset-pref/v1beta1/state"; +import * as _275 from "./valset-pref/v1beta1/tx"; +import * as _490 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; +import * as _491 from "./concentratedliquidity/v1beta1/tx.amino"; +import * as _492 from "./gamm/pool-models/balancer/tx/tx.amino"; +import * as _493 from "./gamm/pool-models/stableswap/tx.amino"; +import * as _494 from "./gamm/v1beta1/tx.amino"; +import * as _495 from "./incentives/tx.amino"; +import * as _496 from "./lockup/tx.amino"; +import * as _497 from "./poolmanager/v1beta1/tx.amino"; +import * as _498 from "./protorev/v1beta1/tx.amino"; +import * as _499 from "./smartaccount/v1beta1/tx.amino"; +import * as _500 from "./superfluid/tx.amino"; +import * as _501 from "./tokenfactory/v1beta1/tx.amino"; +import * as _502 from "./txfees/v1beta1/tx.amino"; +import * as _503 from "./valset-pref/v1beta1/tx.amino"; +import * as _504 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; +import * as _505 from "./concentratedliquidity/v1beta1/tx.registry"; +import * as _506 from "./gamm/pool-models/balancer/tx/tx.registry"; +import * as _507 from "./gamm/pool-models/stableswap/tx.registry"; +import * as _508 from "./gamm/v1beta1/tx.registry"; +import * as _509 from "./incentives/tx.registry"; +import * as _510 from "./lockup/tx.registry"; +import * as _511 from "./poolmanager/v1beta1/tx.registry"; +import * as _512 from "./protorev/v1beta1/tx.registry"; +import * as _513 from "./smartaccount/v1beta1/tx.registry"; +import * as _514 from "./superfluid/tx.registry"; +import * as _515 from "./tokenfactory/v1beta1/tx.registry"; +import * as _516 from "./txfees/v1beta1/tx.registry"; +import * as _517 from "./valset-pref/v1beta1/tx.registry"; +import * as _518 from "./concentratedliquidity/v1beta1/query.rpc.Query"; +import * as _519 from "./cosmwasmpool/v1beta1/query.rpc.Query"; +import * as _520 from "./gamm/v1beta1/query.rpc.Query"; +import * as _521 from "./incentives/query.rpc.Query"; +import * as _522 from "./lockup/query.rpc.Query"; +import * as _523 from "./pool-incentives/v1beta1/query.rpc.Query"; +import * as _524 from "./poolmanager/v1beta1/query.rpc.Query"; +import * as _525 from "./protorev/v1beta1/query.rpc.Query"; +import * as _526 from "./smartaccount/v1beta1/query.rpc.Query"; +import * as _527 from "./superfluid/query.rpc.Query"; +import * as _528 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _529 from "./txfees/v1beta1/query.rpc.Query"; +import * as _530 from "./valset-pref/v1beta1/query.rpc.Query"; +import * as _531 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; +import * as _532 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; +import * as _533 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; +import * as _534 from "./gamm/pool-models/stableswap/tx.rpc.msg"; +import * as _535 from "./gamm/v1beta1/tx.rpc.msg"; +import * as _536 from "./incentives/tx.rpc.msg"; +import * as _537 from "./lockup/tx.rpc.msg"; +import * as _538 from "./poolmanager/v1beta1/tx.rpc.msg"; +import * as _539 from "./protorev/v1beta1/tx.rpc.msg"; +import * as _540 from "./smartaccount/v1beta1/tx.rpc.msg"; +import * as _541 from "./superfluid/tx.rpc.msg"; +import * as _542 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _543 from "./txfees/v1beta1/tx.rpc.msg"; +import * as _544 from "./valset-pref/v1beta1/tx.rpc.msg"; +import * as _618 from "./rpc.query"; +import * as _619 from "./rpc.tx"; export namespace osmosis { export namespace accum { export const v1beta1 = { - ..._196 + ..._200 }; } export const concentratedliquidity = { - ..._197, + ..._201, poolmodel: { concentrated: { v1beta1: { - ..._482, - ..._496, - ..._523 + ..._490, + ..._504, + ..._531 } } }, v1beta1: { - ..._483, - ..._497, - ..._510, - ..._524 + ..._491, + ..._505, + ..._518, + ..._532 } }; export namespace cosmwasmpool { export const v1beta1 = { - ..._198, - ..._199, - ..._200, - ..._201, ..._202, ..._203, ..._204, @@ -169,168 +165,172 @@ export namespace osmosis { ..._207, ..._208, ..._209, - ..._511 - }; - } - export namespace gamm { - export const v1beta1 = { ..._210, ..._211, ..._212, ..._213, + ..._519 + }; + } + export namespace gamm { + export const v1beta1 = { ..._214, ..._215, - ..._486, - ..._500, - ..._512, - ..._527 + ..._216, + ..._217, + ..._218, + ..._219, + ..._494, + ..._508, + ..._520, + ..._535 }; export namespace poolmodels { export namespace balancer { export const v1beta1 = { - ..._216, - ..._484, - ..._498, - ..._525 + ..._220, + ..._492, + ..._506, + ..._533 }; } export namespace stableswap { export const v1beta1 = { - ..._217, - ..._218, - ..._485, - ..._499, - ..._526 + ..._221, + ..._222, + ..._493, + ..._507, + ..._534 }; } } } export const incentives = { - ..._219, - ..._220, - ..._221, - ..._222, ..._223, ..._224, ..._225, - ..._487, - ..._501, - ..._513, - ..._528 - }; - export const lockup = { ..._226, ..._227, ..._228, ..._229, + ..._495, + ..._509, + ..._521, + ..._536 + }; + export const lockup = { ..._230, - ..._488, - ..._502, - ..._514, - ..._529 + ..._231, + ..._232, + ..._233, + ..._234, + ..._496, + ..._510, + ..._522, + ..._537 }; export namespace poolincentives { export const v1beta1 = { - ..._231, - ..._232, - ..._233, - ..._234, ..._235, - ..._515 - }; - } - export namespace poolmanager { - export const v1beta1 = { ..._236, ..._237, ..._238, ..._239, - ..._240, - ..._241, - ..._489, - ..._503, - ..._516, - ..._530 + ..._523 }; } - export namespace protorev { + export namespace poolmanager { export const v1beta1 = { + ..._240, + ..._241, ..._242, ..._243, ..._244, ..._245, - ..._246, - ..._247, - ..._490, - ..._504, - ..._517, - ..._531 + ..._497, + ..._511, + ..._524, + ..._538 }; } - export namespace smartaccount { + export namespace protorev { export const v1beta1 = { + ..._246, + ..._247, ..._248, ..._249, ..._250, ..._251, + ..._498, + ..._512, + ..._525, + ..._539 + }; + } + export namespace smartaccount { + export const v1beta1 = { ..._252, - ..._491, - ..._505, - ..._518, - ..._532 + ..._253, + ..._254, + ..._255, + ..._256, + ..._499, + ..._513, + ..._526, + ..._540 }; } export const superfluid = { - ..._253, - ..._254, - ..._255, - ..._256, ..._257, - ..._492, - ..._506, - ..._519, - ..._533 + ..._258, + ..._259, + ..._260, + ..._261, + ..._500, + ..._514, + ..._527, + ..._541 }; export namespace tokenfactory { export const v1beta1 = { - ..._258, - ..._259, - ..._260, - ..._261, ..._262, - ..._493, - ..._507, - ..._520, - ..._534 - }; - } - export namespace txfees { - export const v1beta1 = { ..._263, ..._264, ..._265, ..._266, - ..._267, - ..._268, - ..._494, - ..._508, - ..._521, - ..._535 + ..._501, + ..._515, + ..._528, + ..._542 }; } - export namespace valsetpref { + export namespace txfees { export const v1beta1 = { + ..._267, + ..._268, ..._269, ..._270, ..._271, - ..._495, - ..._509, - ..._522, - ..._536 + ..._272, + ..._502, + ..._516, + ..._529, + ..._543 + }; + } + export namespace valsetpref { + export const v1beta1 = { + ..._273, + ..._274, + ..._275, + ..._503, + ..._517, + ..._530, + ..._544 }; } export const ClientFactory = { - ..._608, - ..._609 + ..._618, + ..._619 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/bundle.ts b/packages/types/protobuf/codegen/pstake/bundle.ts index b17905106..3ec16c173 100644 --- a/packages/types/protobuf/codegen/pstake/bundle.ts +++ b/packages/types/protobuf/codegen/pstake/bundle.ts @@ -1,98 +1,98 @@ -import * as _272 from "./liquidstake/v1beta1/genesis"; -import * as _273 from "./liquidstake/v1beta1/liquidstake"; -import * as _274 from "./liquidstake/v1beta1/query"; -import * as _275 from "./liquidstake/v1beta1/tx"; -import * as _276 from "./liquidstakeibc/v1beta1/genesis"; -import * as _277 from "./liquidstakeibc/v1beta1/liquidstakeibc"; -import * as _278 from "./liquidstakeibc/v1beta1/msgs"; -import * as _279 from "./liquidstakeibc/v1beta1/params"; -import * as _280 from "./liquidstakeibc/v1beta1/query"; -import * as _281 from "./lscosmos/v1beta1/genesis"; -import * as _282 from "./lscosmos/v1beta1/governance_proposal"; -import * as _283 from "./lscosmos/v1beta1/lscosmos"; -import * as _284 from "./lscosmos/v1beta1/msgs"; -import * as _285 from "./lscosmos/v1beta1/params"; -import * as _286 from "./lscosmos/v1beta1/query"; -import * as _287 from "./ratesync/v1beta1/contract"; -import * as _288 from "./ratesync/v1beta1/genesis"; -import * as _289 from "./ratesync/v1beta1/params"; -import * as _290 from "./ratesync/v1beta1/query"; -import * as _291 from "./ratesync/v1beta1/ratesync"; -import * as _292 from "./ratesync/v1beta1/tx"; -import * as _537 from "./liquidstake/v1beta1/tx.amino"; -import * as _538 from "./liquidstakeibc/v1beta1/msgs.amino"; -import * as _539 from "./lscosmos/v1beta1/msgs.amino"; -import * as _540 from "./ratesync/v1beta1/tx.amino"; -import * as _541 from "./liquidstake/v1beta1/tx.registry"; -import * as _542 from "./liquidstakeibc/v1beta1/msgs.registry"; -import * as _543 from "./lscosmos/v1beta1/msgs.registry"; -import * as _544 from "./ratesync/v1beta1/tx.registry"; -import * as _545 from "./liquidstake/v1beta1/query.rpc.Query"; -import * as _546 from "./liquidstakeibc/v1beta1/query.rpc.Query"; -import * as _547 from "./lscosmos/v1beta1/query.rpc.Query"; -import * as _548 from "./ratesync/v1beta1/query.rpc.Query"; -import * as _549 from "./liquidstake/v1beta1/tx.rpc.msg"; -import * as _550 from "./liquidstakeibc/v1beta1/msgs.rpc.msg"; -import * as _551 from "./lscosmos/v1beta1/msgs.rpc.msg"; -import * as _552 from "./ratesync/v1beta1/tx.rpc.msg"; -import * as _610 from "./rpc.query"; -import * as _611 from "./rpc.tx"; +import * as _276 from "./liquidstake/v1beta1/genesis"; +import * as _277 from "./liquidstake/v1beta1/liquidstake"; +import * as _278 from "./liquidstake/v1beta1/query"; +import * as _279 from "./liquidstake/v1beta1/tx"; +import * as _280 from "./liquidstakeibc/v1beta1/genesis"; +import * as _281 from "./liquidstakeibc/v1beta1/liquidstakeibc"; +import * as _282 from "./liquidstakeibc/v1beta1/msgs"; +import * as _283 from "./liquidstakeibc/v1beta1/params"; +import * as _284 from "./liquidstakeibc/v1beta1/query"; +import * as _285 from "./lscosmos/v1beta1/genesis"; +import * as _286 from "./lscosmos/v1beta1/governance_proposal"; +import * as _287 from "./lscosmos/v1beta1/lscosmos"; +import * as _288 from "./lscosmos/v1beta1/msgs"; +import * as _289 from "./lscosmos/v1beta1/params"; +import * as _290 from "./lscosmos/v1beta1/query"; +import * as _291 from "./ratesync/v1beta1/contract"; +import * as _292 from "./ratesync/v1beta1/genesis"; +import * as _293 from "./ratesync/v1beta1/params"; +import * as _294 from "./ratesync/v1beta1/query"; +import * as _295 from "./ratesync/v1beta1/ratesync"; +import * as _296 from "./ratesync/v1beta1/tx"; +import * as _545 from "./liquidstake/v1beta1/tx.amino"; +import * as _546 from "./liquidstakeibc/v1beta1/msgs.amino"; +import * as _547 from "./lscosmos/v1beta1/msgs.amino"; +import * as _548 from "./ratesync/v1beta1/tx.amino"; +import * as _549 from "./liquidstake/v1beta1/tx.registry"; +import * as _550 from "./liquidstakeibc/v1beta1/msgs.registry"; +import * as _551 from "./lscosmos/v1beta1/msgs.registry"; +import * as _552 from "./ratesync/v1beta1/tx.registry"; +import * as _553 from "./liquidstake/v1beta1/query.rpc.Query"; +import * as _554 from "./liquidstakeibc/v1beta1/query.rpc.Query"; +import * as _555 from "./lscosmos/v1beta1/query.rpc.Query"; +import * as _556 from "./ratesync/v1beta1/query.rpc.Query"; +import * as _557 from "./liquidstake/v1beta1/tx.rpc.msg"; +import * as _558 from "./liquidstakeibc/v1beta1/msgs.rpc.msg"; +import * as _559 from "./lscosmos/v1beta1/msgs.rpc.msg"; +import * as _560 from "./ratesync/v1beta1/tx.rpc.msg"; +import * as _620 from "./rpc.query"; +import * as _621 from "./rpc.tx"; export namespace pstake { export namespace liquidstake { - export const v1beta1 = { - ..._272, - ..._273, - ..._274, - ..._275, - ..._537, - ..._541, - ..._545, - ..._549 - }; - } - export namespace liquidstakeibc { export const v1beta1 = { ..._276, ..._277, ..._278, ..._279, - ..._280, - ..._538, - ..._542, - ..._546, - ..._550 + ..._545, + ..._549, + ..._553, + ..._557 }; } - export namespace lscosmos { + export namespace liquidstakeibc { export const v1beta1 = { + ..._280, ..._281, ..._282, ..._283, ..._284, - ..._285, - ..._286, - ..._539, - ..._543, - ..._547, - ..._551 + ..._546, + ..._550, + ..._554, + ..._558 }; } - export namespace ratesync { + export namespace lscosmos { export const v1beta1 = { + ..._285, + ..._286, ..._287, ..._288, ..._289, ..._290, + ..._547, + ..._551, + ..._555, + ..._559 + }; + } + export namespace ratesync { + export const v1beta1 = { ..._291, ..._292, - ..._540, - ..._544, + ..._293, + ..._294, + ..._295, + ..._296, ..._548, - ..._552 + ..._552, + ..._556, + ..._560 }; } export const ClientFactory = { - ..._610, - ..._611 + ..._620, + ..._621 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/publicawesome/bundle.ts b/packages/types/protobuf/codegen/publicawesome/bundle.ts index c581cd7ed..1c212f4db 100644 --- a/packages/types/protobuf/codegen/publicawesome/bundle.ts +++ b/packages/types/protobuf/codegen/publicawesome/bundle.ts @@ -1,88 +1,88 @@ -import * as _293 from "./stargaze/alloc/v1beta1/genesis"; -import * as _294 from "./stargaze/alloc/v1beta1/params"; -import * as _295 from "./stargaze/alloc/v1beta1/query"; -import * as _296 from "./stargaze/alloc/v1beta1/tx"; -import * as _297 from "./stargaze/cron/v1/cron"; -import * as _298 from "./stargaze/cron/v1/genesis"; -import * as _299 from "./stargaze/cron/v1/proposal"; -import * as _300 from "./stargaze/cron/v1/query"; -import * as _301 from "./stargaze/cron/v1/tx"; -import * as _302 from "./stargaze/globalfee/v1/genesis"; -import * as _303 from "./stargaze/globalfee/v1/globalfee"; -import * as _304 from "./stargaze/globalfee/v1/proposal"; -import * as _305 from "./stargaze/globalfee/v1/query"; -import * as _306 from "./stargaze/globalfee/v1/tx"; -import * as _307 from "./stargaze/mint/v1beta1/genesis"; -import * as _308 from "./stargaze/mint/v1beta1/mint"; -import * as _309 from "./stargaze/mint/v1beta1/query"; -import * as _310 from "./stargaze/mint/v1beta1/tx"; -import * as _553 from "./stargaze/alloc/v1beta1/tx.amino"; -import * as _554 from "./stargaze/cron/v1/tx.amino"; -import * as _555 from "./stargaze/globalfee/v1/tx.amino"; -import * as _556 from "./stargaze/alloc/v1beta1/tx.registry"; -import * as _557 from "./stargaze/cron/v1/tx.registry"; -import * as _558 from "./stargaze/globalfee/v1/tx.registry"; -import * as _559 from "./stargaze/alloc/v1beta1/query.rpc.Query"; -import * as _560 from "./stargaze/cron/v1/query.rpc.Query"; -import * as _561 from "./stargaze/globalfee/v1/query.rpc.Query"; -import * as _562 from "./stargaze/mint/v1beta1/query.rpc.Query"; -import * as _563 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; -import * as _564 from "./stargaze/cron/v1/tx.rpc.msg"; -import * as _565 from "./stargaze/globalfee/v1/tx.rpc.msg"; -import * as _612 from "./rpc.query"; -import * as _613 from "./rpc.tx"; +import * as _297 from "./stargaze/alloc/v1beta1/genesis"; +import * as _298 from "./stargaze/alloc/v1beta1/params"; +import * as _299 from "./stargaze/alloc/v1beta1/query"; +import * as _300 from "./stargaze/alloc/v1beta1/tx"; +import * as _301 from "./stargaze/cron/v1/cron"; +import * as _302 from "./stargaze/cron/v1/genesis"; +import * as _303 from "./stargaze/cron/v1/proposal"; +import * as _304 from "./stargaze/cron/v1/query"; +import * as _305 from "./stargaze/cron/v1/tx"; +import * as _306 from "./stargaze/globalfee/v1/genesis"; +import * as _307 from "./stargaze/globalfee/v1/globalfee"; +import * as _308 from "./stargaze/globalfee/v1/proposal"; +import * as _309 from "./stargaze/globalfee/v1/query"; +import * as _310 from "./stargaze/globalfee/v1/tx"; +import * as _311 from "./stargaze/mint/v1beta1/genesis"; +import * as _312 from "./stargaze/mint/v1beta1/mint"; +import * as _313 from "./stargaze/mint/v1beta1/query"; +import * as _314 from "./stargaze/mint/v1beta1/tx"; +import * as _561 from "./stargaze/alloc/v1beta1/tx.amino"; +import * as _562 from "./stargaze/cron/v1/tx.amino"; +import * as _563 from "./stargaze/globalfee/v1/tx.amino"; +import * as _564 from "./stargaze/alloc/v1beta1/tx.registry"; +import * as _565 from "./stargaze/cron/v1/tx.registry"; +import * as _566 from "./stargaze/globalfee/v1/tx.registry"; +import * as _567 from "./stargaze/alloc/v1beta1/query.rpc.Query"; +import * as _568 from "./stargaze/cron/v1/query.rpc.Query"; +import * as _569 from "./stargaze/globalfee/v1/query.rpc.Query"; +import * as _570 from "./stargaze/mint/v1beta1/query.rpc.Query"; +import * as _571 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; +import * as _572 from "./stargaze/cron/v1/tx.rpc.msg"; +import * as _573 from "./stargaze/globalfee/v1/tx.rpc.msg"; +import * as _622 from "./rpc.query"; +import * as _623 from "./rpc.tx"; export namespace publicawesome { export namespace stargaze { export namespace alloc { export const v1beta1 = { - ..._293, - ..._294, - ..._295, - ..._296, - ..._553, - ..._556, - ..._559, - ..._563 - }; - } - export namespace cron { - export const v1 = { ..._297, ..._298, ..._299, ..._300, - ..._301, - ..._554, - ..._557, - ..._560, - ..._564 + ..._561, + ..._564, + ..._567, + ..._571 }; } - export namespace globalfee { + export namespace cron { export const v1 = { + ..._301, ..._302, ..._303, ..._304, ..._305, - ..._306, - ..._555, - ..._558, - ..._561, - ..._565 + ..._562, + ..._565, + ..._568, + ..._572 }; } - export namespace mint { - export const v1beta1 = { + export namespace globalfee { + export const v1 = { + ..._306, ..._307, ..._308, ..._309, ..._310, - ..._562 + ..._563, + ..._566, + ..._569, + ..._573 + }; + } + export namespace mint { + export const v1beta1 = { + ..._311, + ..._312, + ..._313, + ..._314, + ..._570 }; } } export const ClientFactory = { - ..._612, - ..._613 + ..._622, + ..._623 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/regen/bundle.ts b/packages/types/protobuf/codegen/regen/bundle.ts index e1fa73d4b..6742470ff 100644 --- a/packages/types/protobuf/codegen/regen/bundle.ts +++ b/packages/types/protobuf/codegen/regen/bundle.ts @@ -1,134 +1,134 @@ -import * as _311 from "./data/v1/events"; -import * as _312 from "./data/v1/state"; -import * as _313 from "./data/v1/tx"; -import * as _314 from "./data/v1/types"; -import * as _315 from "./data/v2/events"; -import * as _316 from "./data/v2/state"; -import * as _317 from "./data/v2/tx"; -import * as _318 from "./data/v2/types"; -import * as _319 from "./ecocredit/basket/v1/events"; -import * as _320 from "./ecocredit/basket/v1/state"; -import * as _321 from "./ecocredit/basket/v1/tx"; -import * as _322 from "./ecocredit/basket/v1/types"; -import * as _323 from "./ecocredit/marketplace/v1/events"; -import * as _324 from "./ecocredit/marketplace/v1/state"; -import * as _325 from "./ecocredit/marketplace/v1/tx"; -import * as _326 from "./ecocredit/marketplace/v1/types"; -import * as _327 from "./ecocredit/orderbook/v1alpha1/memory"; -import * as _328 from "./ecocredit/v1/events"; -import * as _329 from "./ecocredit/v1/state"; -import * as _330 from "./ecocredit/v1/tx"; -import * as _331 from "./ecocredit/v1/types"; -import * as _332 from "./ecocredit/v1alpha1/events"; -import * as _333 from "./ecocredit/v1alpha1/genesis"; -import * as _334 from "./ecocredit/v1alpha1/tx"; -import * as _335 from "./ecocredit/v1alpha1/types"; -import * as _336 from "./intertx/v1/query"; -import * as _337 from "./intertx/v1/tx"; -import * as _566 from "./data/v1/tx.amino"; -import * as _567 from "./data/v2/tx.amino"; -import * as _568 from "./ecocredit/basket/v1/tx.amino"; -import * as _569 from "./ecocredit/marketplace/v1/tx.amino"; -import * as _570 from "./ecocredit/v1/tx.amino"; -import * as _571 from "./ecocredit/v1alpha1/tx.amino"; -import * as _572 from "./intertx/v1/tx.amino"; -import * as _573 from "./data/v1/tx.registry"; -import * as _574 from "./data/v2/tx.registry"; -import * as _575 from "./ecocredit/basket/v1/tx.registry"; -import * as _576 from "./ecocredit/marketplace/v1/tx.registry"; -import * as _577 from "./ecocredit/v1/tx.registry"; -import * as _578 from "./ecocredit/v1alpha1/tx.registry"; -import * as _579 from "./intertx/v1/tx.registry"; -import * as _580 from "./intertx/v1/query.rpc.Query"; -import * as _581 from "./data/v1/tx.rpc.msg"; -import * as _582 from "./data/v2/tx.rpc.msg"; -import * as _583 from "./ecocredit/basket/v1/tx.rpc.msg"; -import * as _584 from "./ecocredit/marketplace/v1/tx.rpc.msg"; -import * as _585 from "./ecocredit/v1/tx.rpc.msg"; -import * as _586 from "./ecocredit/v1alpha1/tx.rpc.msg"; -import * as _587 from "./intertx/v1/tx.rpc.msg"; -import * as _614 from "./rpc.query"; -import * as _615 from "./rpc.tx"; +import * as _315 from "./data/v1/events"; +import * as _316 from "./data/v1/state"; +import * as _317 from "./data/v1/tx"; +import * as _318 from "./data/v1/types"; +import * as _319 from "./data/v2/events"; +import * as _320 from "./data/v2/state"; +import * as _321 from "./data/v2/tx"; +import * as _322 from "./data/v2/types"; +import * as _323 from "./ecocredit/basket/v1/events"; +import * as _324 from "./ecocredit/basket/v1/state"; +import * as _325 from "./ecocredit/basket/v1/tx"; +import * as _326 from "./ecocredit/basket/v1/types"; +import * as _327 from "./ecocredit/marketplace/v1/events"; +import * as _328 from "./ecocredit/marketplace/v1/state"; +import * as _329 from "./ecocredit/marketplace/v1/tx"; +import * as _330 from "./ecocredit/marketplace/v1/types"; +import * as _331 from "./ecocredit/orderbook/v1alpha1/memory"; +import * as _332 from "./ecocredit/v1/events"; +import * as _333 from "./ecocredit/v1/state"; +import * as _334 from "./ecocredit/v1/tx"; +import * as _335 from "./ecocredit/v1/types"; +import * as _336 from "./ecocredit/v1alpha1/events"; +import * as _337 from "./ecocredit/v1alpha1/genesis"; +import * as _338 from "./ecocredit/v1alpha1/tx"; +import * as _339 from "./ecocredit/v1alpha1/types"; +import * as _340 from "./intertx/v1/query"; +import * as _341 from "./intertx/v1/tx"; +import * as _574 from "./data/v1/tx.amino"; +import * as _575 from "./data/v2/tx.amino"; +import * as _576 from "./ecocredit/basket/v1/tx.amino"; +import * as _577 from "./ecocredit/marketplace/v1/tx.amino"; +import * as _578 from "./ecocredit/v1/tx.amino"; +import * as _579 from "./ecocredit/v1alpha1/tx.amino"; +import * as _580 from "./intertx/v1/tx.amino"; +import * as _581 from "./data/v1/tx.registry"; +import * as _582 from "./data/v2/tx.registry"; +import * as _583 from "./ecocredit/basket/v1/tx.registry"; +import * as _584 from "./ecocredit/marketplace/v1/tx.registry"; +import * as _585 from "./ecocredit/v1/tx.registry"; +import * as _586 from "./ecocredit/v1alpha1/tx.registry"; +import * as _587 from "./intertx/v1/tx.registry"; +import * as _588 from "./intertx/v1/query.rpc.Query"; +import * as _589 from "./data/v1/tx.rpc.msg"; +import * as _590 from "./data/v2/tx.rpc.msg"; +import * as _591 from "./ecocredit/basket/v1/tx.rpc.msg"; +import * as _592 from "./ecocredit/marketplace/v1/tx.rpc.msg"; +import * as _593 from "./ecocredit/v1/tx.rpc.msg"; +import * as _594 from "./ecocredit/v1alpha1/tx.rpc.msg"; +import * as _595 from "./intertx/v1/tx.rpc.msg"; +import * as _624 from "./rpc.query"; +import * as _625 from "./rpc.tx"; export namespace regen { export namespace data { export const v1 = { - ..._311, - ..._312, - ..._313, - ..._314, - ..._566, - ..._573, - ..._581 - }; - export const v2 = { ..._315, ..._316, ..._317, ..._318, - ..._567, ..._574, - ..._582 + ..._581, + ..._589 + }; + export const v2 = { + ..._319, + ..._320, + ..._321, + ..._322, + ..._575, + ..._582, + ..._590 }; } export namespace ecocredit { export namespace basket { - export const v1 = { - ..._319, - ..._320, - ..._321, - ..._322, - ..._568, - ..._575, - ..._583 - }; - } - export namespace marketplace { export const v1 = { ..._323, ..._324, ..._325, ..._326, - ..._569, ..._576, - ..._584 + ..._583, + ..._591 + }; + } + export namespace marketplace { + export const v1 = { + ..._327, + ..._328, + ..._329, + ..._330, + ..._577, + ..._584, + ..._592 }; } export namespace orderbook { export const v1alpha1 = { - ..._327 + ..._331 }; } export const v1 = { - ..._328, - ..._329, - ..._330, - ..._331, - ..._570, - ..._577, - ..._585 - }; - export const v1alpha1 = { ..._332, ..._333, ..._334, ..._335, - ..._571, ..._578, - ..._586 + ..._585, + ..._593 }; - } - export namespace intertx { - export const v1 = { + export const v1alpha1 = { ..._336, ..._337, - ..._572, + ..._338, + ..._339, ..._579, + ..._586, + ..._594 + }; + } + export namespace intertx { + export const v1 = { + ..._340, + ..._341, ..._580, - ..._587 + ..._587, + ..._588, + ..._595 }; } export const ClientFactory = { - ..._614, - ..._615 + ..._624, + ..._625 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/tendermint/bundle.ts b/packages/types/protobuf/codegen/tendermint/bundle.ts index 5e3553a99..f4eac2ef8 100644 --- a/packages/types/protobuf/codegen/tendermint/bundle.ts +++ b/packages/types/protobuf/codegen/tendermint/bundle.ts @@ -1,32 +1,32 @@ -import * as _341 from "./abci/types"; -import * as _342 from "./crypto/keys"; -import * as _343 from "./crypto/proof"; -import * as _344 from "./p2p/types"; -import * as _345 from "./types/block"; -import * as _346 from "./types/evidence"; -import * as _347 from "./types/params"; -import * as _348 from "./types/types"; -import * as _349 from "./types/validator"; -import * as _350 from "./version/types"; +import * as _345 from "./abci/types"; +import * as _346 from "./crypto/keys"; +import * as _347 from "./crypto/proof"; +import * as _348 from "./p2p/types"; +import * as _349 from "./types/block"; +import * as _350 from "./types/evidence"; +import * as _351 from "./types/params"; +import * as _352 from "./types/types"; +import * as _353 from "./types/validator"; +import * as _354 from "./version/types"; export namespace tendermint { export const abci = { - ..._341 + ..._345 }; export const crypto = { - ..._342, - ..._343 + ..._346, + ..._347 }; export const p2p = { - ..._344 + ..._348 }; export const types = { - ..._345, - ..._346, - ..._347, - ..._348, - ..._349 + ..._349, + ..._350, + ..._351, + ..._352, + ..._353 }; export const version = { - ..._350 + ..._354 }; } \ No newline at end of file diff --git a/packages/types/protobuf/proto/feemarket/feemarket/module/v1/module.proto b/packages/types/protobuf/proto/feemarket/feemarket/module/v1/module.proto new file mode 100644 index 000000000..9bddd0327 --- /dev/null +++ b/packages/types/protobuf/proto/feemarket/feemarket/module/v1/module.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package feemarket.feemarket.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the builder module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import : "github.com/skip-mev/feemarket/x/feemarket" + }; + + // Authority defines the custom module authority. If not set, defaults to the + // governance module. + string authority = 1; +} diff --git a/packages/types/protobuf/proto/feemarket/feemarket/v1/genesis.proto b/packages/types/protobuf/proto/feemarket/feemarket/v1/genesis.proto new file mode 100644 index 000000000..e1a7933fe --- /dev/null +++ b/packages/types/protobuf/proto/feemarket/feemarket/v1/genesis.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; +package feemarket.feemarket.v1; + +option go_package = "github.com/skip-mev/feemarket/x/feemarket/types"; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "feemarket/feemarket/v1/params.proto"; + +// GenesisState defines the feemarket module's genesis state. +message GenesisState { + // Params are the parameters for the feemarket module. These parameters + // can be utilized to implement both the base EIP-1559 fee market and + // and the AIMD EIP-1559 fee market. + Params params = 1 [ (gogoproto.nullable) = false ]; + + // State contains the current state of the AIMD fee market. + State state = 2 [ (gogoproto.nullable) = false ]; +} + +// State is utilized to track the current state of the fee market. This includes +// the current base fee, learning rate, and block utilization within the +// specified AIMD window. +message State { + // BaseGasPrice is the current base fee. This is denominated in the fee per + // gas unit. + string base_gas_price = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // LearningRate is the current learning rate. + string learning_rate = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // Window contains a list of the last blocks' utilization values. This is used + // to calculate the next base fee. This stores the number of units of gas + // consumed per block. + repeated uint64 window = 3; + + // Index is the index of the current block in the block utilization window. + uint64 index = 4; +} diff --git a/packages/types/protobuf/proto/feemarket/feemarket/v1/params.proto b/packages/types/protobuf/proto/feemarket/feemarket/v1/params.proto new file mode 100644 index 000000000..3038ada11 --- /dev/null +++ b/packages/types/protobuf/proto/feemarket/feemarket/v1/params.proto @@ -0,0 +1,92 @@ +syntax = "proto3"; +package feemarket.feemarket.v1; + +option go_package = "github.com/skip-mev/feemarket/x/feemarket/types"; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; + +// Params contains the required set of parameters for the EIP1559 fee market +// plugin implementation. +message Params { + // Alpha is the amount we additively increase the learning rate + // when it is above or below the target +/- threshold. + // + // Must be > 0. + string alpha = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // Beta is the amount we multiplicatively decrease the learning rate + // when it is within the target +/- threshold. + // + // Must be [0, 1]. + string beta = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // Gamma is the threshold for the learning rate. If the learning rate is + // above or below the target +/- threshold, we additively increase the + // learning rate by Alpha. Otherwise, we multiplicatively decrease the + // learning rate by Beta. + // + // Must be [0, 0.5]. + string gamma = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // Delta is the amount we additively increase/decrease the gas price when the + // net block utilization difference in the window is above/below the target + // utilization. + string delta = 4 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // MinBaseGasPrice determines the initial gas price of the module and the + // global minimum for the network. + string min_base_gas_price = 5 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // MinLearningRate is the lower bound for the learning rate. + string min_learning_rate = 6 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // MaxLearningRate is the upper bound for the learning rate. + string max_learning_rate = 7 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; + + // MaxBlockUtilization is the maximum block utilization. + uint64 max_block_utilization = 8; + + // Window defines the window size for calculating an adaptive learning rate + // over a moving window of blocks. + uint64 window = 9; + + // FeeDenom is the denom that will be used for all fee payments. + string fee_denom = 10; + + // Enabled is a boolean that determines whether the EIP1559 fee market is + // enabled. + bool enabled = 11; + + // DistributeFees is a boolean that determines whether the fees are burned or + // distributed to all stakers. + bool distribute_fees = 12; +} diff --git a/packages/types/protobuf/proto/feemarket/feemarket/v1/query.proto b/packages/types/protobuf/proto/feemarket/feemarket/v1/query.proto new file mode 100644 index 000000000..d9a1d102d --- /dev/null +++ b/packages/types/protobuf/proto/feemarket/feemarket/v1/query.proto @@ -0,0 +1,82 @@ +syntax = "proto3"; +package feemarket.feemarket.v1; + +option go_package = "github.com/skip-mev/feemarket/x/feemarket/types"; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; +import "feemarket/feemarket/v1/params.proto"; +import "feemarket/feemarket/v1/genesis.proto"; + +// Query Service for the feemarket module. +service Query { + // Params returns the current feemarket module parameters. + rpc Params(ParamsRequest) returns (ParamsResponse) { + option (google.api.http) = { + get : "/feemarket/v1/params" + }; + }; + + // State returns the current feemarket module state. + rpc State(StateRequest) returns (StateResponse) { + option (google.api.http) = { + get : "/feemarket/v1/state" + }; + }; + + // GasPrice returns the current feemarket module gas price + // for specified denom. + rpc GasPrice(GasPriceRequest) returns (GasPriceResponse) { + option (google.api.http) = { + get : "/feemarket/v1/gas_price/{denom}" + }; + }; + + // GasPrices returns the current feemarket module list of gas prices + // in all available denoms. + rpc GasPrices(GasPricesRequest) returns (GasPricesResponse) { + option (google.api.http) = { + get : "/feemarket/v1/gas_prices" + }; + }; +} + +// ParamsRequest is the request type for the Query/Params RPC method. +message ParamsRequest {} + +// ParamsResponse is the response type for the Query/Params RPC method. +message ParamsResponse { Params params = 1 [ (gogoproto.nullable) = false ]; } + +// StateRequest is the request type for the Query/State RPC method. +message StateRequest {} + +// StateResponse is the response type for the Query/State RPC method. +message StateResponse { State state = 1 [ (gogoproto.nullable) = false ]; } + +// GasPriceRequest is the request type for the Query/GasPrice RPC method. +message GasPriceRequest { + // denom we are querying gas price in + string denom = 1; +} + +// GasPriceResponse is the response type for the Query/GasPrice RPC method. +// Returns a gas price in specified denom. +message GasPriceResponse { + cosmos.base.v1beta1.DecCoin price = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +// GasPriceRequest is the request type for the Query/GasPrices RPC method. +message GasPricesRequest {} + +// GasPricesResponse is the response type for the Query/GasPrices RPC method. +// Returns a gas price in all available denoms. +message GasPricesResponse { + repeated cosmos.base.v1beta1.DecCoin prices = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" + ]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/feemarket/feemarket/v1/tx.proto b/packages/types/protobuf/proto/feemarket/feemarket/v1/tx.proto new file mode 100644 index 000000000..29f178f41 --- /dev/null +++ b/packages/types/protobuf/proto/feemarket/feemarket/v1/tx.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; +package feemarket.feemarket.v1; + +import "feemarket/feemarket/v1/params.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/skip-mev/feemarket/x/feemarket/types"; + +// Message service defines the types of messages supported by the feemarket +// module. +service Msg { + option (cosmos.msg.v1.service) = true; + + // Params defines a method for updating the feemarket module parameters. + rpc Params(MsgParams) returns (MsgParamsResponse); +} + +// MsgParams defines the Msg/Params request type. It contains the +// new parameters for the feemarket module. +message MsgParams { + option (cosmos.msg.v1.signer) = "authority"; + + // Params defines the new parameters for the feemarket module. + Params params = 1 [ (gogoproto.nullable) = false ]; + // Authority defines the authority that is updating the feemarket module + // parameters. + string authority = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// MsgParamsResponse defines the Msg/Params response type. +message MsgParamsResponse {} diff --git a/packages/types/protobuf/scripts/codegen.js b/packages/types/protobuf/scripts/codegen.js index 57fc989fb..1d07203f8 100644 --- a/packages/types/protobuf/scripts/codegen.js +++ b/packages/types/protobuf/scripts/codegen.js @@ -117,6 +117,7 @@ telescope({ 'pstake.lscosmos.v1beta1', 'pstake.ratesync.v1beta1', 'bitsong.fantoken', + 'feemarket.feemarket.v1', // interferes with v1beta1 MsgSubmitProposal amino encoders since the // type names overlap diff --git a/packages/utils/chain.ts b/packages/utils/chain.ts index a1e8f8568..a73db10e5 100644 --- a/packages/utils/chain.ts +++ b/packages/utils/chain.ts @@ -2,7 +2,6 @@ import { Buffer } from 'buffer' import { AssetList, Chain, IBCInfo } from '@chain-registry/types' import { fromBech32, fromHex, toBech32 } from '@cosmjs/encoding' -import { GasPrice } from '@cosmjs/stargate' import RIPEMD160 from 'ripemd160' import semverGte from 'semver/functions/gte' @@ -21,7 +20,6 @@ import { TokenType, Validator, } from '@dao-dao/types' -import { aminoTypes, typesRegistry } from '@dao-dao/types/protobuf' import { Validator as RpcValidator, bondStatusToJSON, @@ -609,32 +607,6 @@ export const cosmosSdkVersionIs46OrHigher = (version: string) => export const cosmosSdkVersionIs47OrHigher = (version: string) => semverGte(version, '0.47.0') -export const getSignerOptions = ({ chain_id, fees }: Chain) => { - let gasPrice - try { - const nativeToken = getNativeTokenForChainId(chain_id) - const feeToken = fees?.fee_tokens.find( - ({ denom }) => denom === nativeToken.denomOrAddress - ) - const gasPriceAmount = - feeToken?.average_gas_price ?? - feeToken?.high_gas_price ?? - feeToken?.low_gas_price ?? - feeToken?.fixed_min_gas_price - - gasPrice = - feeToken && feeToken.denom.length >= 3 && gasPriceAmount !== undefined - ? GasPrice.fromString(gasPriceAmount + feeToken.denom) - : undefined - } catch {} - - return { - gasPrice, - registry: typesRegistry, - aminoTypes, - } -} - /** * Get the DAO info object for a given chain ID. */ diff --git a/packages/utils/client.ts b/packages/utils/client.ts index 89713aa91..fe51c52fe 100644 --- a/packages/utils/client.ts +++ b/packages/utils/client.ts @@ -11,6 +11,7 @@ import { import { cosmos, cosmwasm, + feemarket, ibc, juno, kujira, @@ -241,6 +242,22 @@ export const kujiraProtoRpcClientRouter = new ChainClientRouter({ ), }) +/* + * Router for connecting to an RPC client with feemarket protobufs. + */ +export const feemarketProtoRpcClientRouter = new ChainClientRouter({ + handleConnect: async (chainId: string) => + retry( + 10, + async (attempt) => + ( + await feemarket.ClientFactory.createRPCQueryClient({ + rpcEndpoint: getRpcForChainId(chainId, attempt - 1), + }) + ).feemarket + ), +}) + /** * In response events from a transaction with a wasm event, gets the attribute * key for a given contract address. From 02cb4ebd2be30ae99c2cad01790db07f084f8dff Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 21 Jun 2024 00:58:54 -0400 Subject: [PATCH 255/438] removed log --- packages/state/utils/DynamicGasPrice.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/state/utils/DynamicGasPrice.ts b/packages/state/utils/DynamicGasPrice.ts index 7f9f3b830..6aa543559 100644 --- a/packages/state/utils/DynamicGasPrice.ts +++ b/packages/state/utils/DynamicGasPrice.ts @@ -49,13 +49,11 @@ export class DynamicGasPrice implements GasPrice { } get dynamicGasPrice(): DecCoin | undefined { - const d = this.queryClient.getQueryData( + return this.queryClient.getQueryData( chainQueries.dynamicGasPrice({ chainId: this.chain.chain_id, }).queryKey ) - console.log('DYNAMIC', this.chain.chain_id, d) - return d } get denom(): string { From 9822c657b0d6861594a7b575e5bbe6df8e05820d Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 21 Jun 2024 11:47:57 -0400 Subject: [PATCH 256/438] added banner prompt to fix SubDAO admin --- packages/i18n/locales/en/translation.json | 5 ++ packages/state/query/queries/chain.ts | 22 ++++++ .../dao_governance/DaoAdminExec/index.tsx | 2 +- .../smart_contracting/Migrate/Component.tsx | 6 +- .../UpdateAdmin/Component.tsx | 6 +- .../stateful/components/dao/CreateDaoForm.tsx | 1 + .../stateful/components/dao/LazyDaoCard.tsx | 2 + .../stateful/components/pages/DaoDappHome.tsx | 78 ++++++++++++++++++- packages/stateful/queries/dao.ts | 21 +++-- .../components/actions/IsAdminWarning.tsx | 19 ----- .../stateless/components/actions/index.ts | 1 - .../components/dao/DaoCard.stories.tsx | 1 + .../components/dao/DaoSplashHeader.tsx | 29 ++++++- .../stateless/pages/DaoDappTabbedHome.tsx | 6 +- .../decorators/DaoPageWrapperDecorator.tsx | 1 + .../types/components/DaoDappTabbedHome.ts | 6 -- packages/types/components/DaoSplashHeader.ts | 6 ++ packages/types/dao.ts | 4 + packages/utils/chain.ts | 1 + 19 files changed, 174 insertions(+), 43 deletions(-) delete mode 100644 packages/stateless/components/actions/IsAdminWarning.tsx diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 7cff463e2..b2d49d627 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -87,6 +87,7 @@ "clearNotification": "Clear notification", "clearSelected": "Clear {{count}} selected", "clickHereToProposeAdding": "Click here to propose adding it.", + "clickHereToProposeFixing": "Click here to propose fixing it.", "clickHereToProposeRecognizingIt": "Click here to propose recognizing it.", "clickToCopyAddress": "Click to copy address", "clickToFollow": "Click to follow", @@ -1155,6 +1156,7 @@ "overruleSubDaoProposalDescription": "Overrule a proposal in a SubDAO.", "overwritingSave": "This save will overwrite the existing one with the same name.", "paid": "Paid", + "parentDaoNotAdmin": "{{child}} is a SubDAO of {{parent}}, but its contract-level admin is not {{parent}}, meaning {{child}} can migrate and modify its own code.", "passing": "Passing", "passingThresholdTooltip_noQuorum": "The proportion of all members who must vote 'Yes' on a single choice proposal for it to pass. Because quorum is disabled, this threshold is calculated from all members.", "passingThresholdTooltip_quorum": "The proportion of voters who must vote 'Yes' on a single choice proposal for it to pass. Because quorum is enabled, this threshold is calculated only from those who voted.", @@ -1177,6 +1179,7 @@ "proposalDepositTooltip": "The deposit required to create a proposal.", "proposalDepositWillBeRefunded": "Proposal deposit will be refunded once closed.", "proposalExecutionPolicyDescription": "Who is allowed to execute passed proposals?", + "proposalFixesChildAdmin": "This proposal fixes that by setting the contract-level admin of {{child}} to {{parent}}.", "proposalModuleInfoCardsTooltip": "Different proposal types are configured separately. This is the configuration for the {{type}} proposal type.", "proposalModuleInfoCardsTooltip_approval": "Different proposal types are configured separately. This is the configuration for proposals that approve proposals in the DAO shown.", "proposalQuorumTooltip": "This proportion of voting power must vote on a proposal for it to pass.", @@ -1635,6 +1638,7 @@ "fiatOnOffRamp": "Fiat on/off ramp", "filter": "Filter", "finished": "Finished", + "fixChildAdmin": "Fix {{child}} admin", "following": "Following", "fundAndExecute": "Fund and execute", "github": "GitHub", @@ -1791,6 +1795,7 @@ "selectNftToBurn": "Select NFT To Burn", "selectNftToTransfer": "Select NFT To Transfer", "send": "Send", + "setAdminToParent": "Set admin to {{parent}}", "setItem": "Set Item", "setUpApprover": "Set Up Approver", "setWithdrawAddress": "Set Withdraw Address", diff --git a/packages/state/query/queries/chain.ts b/packages/state/query/queries/chain.ts index 9a66e4c4c..55278934e 100644 --- a/packages/state/query/queries/chain.ts +++ b/packages/state/query/queries/chain.ts @@ -259,6 +259,20 @@ export const fetchDynamicGasPrice = async ({ return price } +/** + * Fetch the wasm contract-level admin for a contract. + */ +export const fetchWasmContractAdmin = async ({ + chainId, + address, +}: { + chainId: string + address: string +}): Promise => { + const client = await cosmWasmClientRouter.connect(chainId) + return (await client.getContract(address))?.admin ?? null +} + export const chainQueries = { /** * Fetch the module address associated with the specified name. @@ -325,4 +339,12 @@ export const chainQueries = { queryKey: ['chain', 'dynamicGasPrice', options], queryFn: () => fetchDynamicGasPrice(options), }), + /** + * Fetch the wasm contract-level admin for a contract. + */ + wasmContractAdmin: (options: Parameters[0]) => + queryOptions({ + queryKey: ['chain', 'wasmContractAdmin', options], + queryFn: () => fetchWasmContractAdmin(options), + }), } diff --git a/packages/stateful/actions/core/dao_governance/DaoAdminExec/index.tsx b/packages/stateful/actions/core/dao_governance/DaoAdminExec/index.tsx index c1658cdcb..0eea89c1c 100644 --- a/packages/stateful/actions/core/dao_governance/DaoAdminExec/index.tsx +++ b/packages/stateful/actions/core/dao_governance/DaoAdminExec/index.tsx @@ -125,7 +125,7 @@ const Component: ActionComponent = (props) => { coreAddress && isValidBech32Address(coreAddress, bech32Prefix) ? { chainId, - coreAddress: address, + coreAddress, } : undefined ) diff --git a/packages/stateful/actions/core/smart_contracting/Migrate/Component.tsx b/packages/stateful/actions/core/smart_contracting/Migrate/Component.tsx index 0d7f5c3bd..f19063591 100644 --- a/packages/stateful/actions/core/smart_contracting/Migrate/Component.tsx +++ b/packages/stateful/actions/core/smart_contracting/Migrate/Component.tsx @@ -6,8 +6,8 @@ import { CodeMirrorInput, InputErrorMessage, InputLabel, - IsAdminWarning, NumberInput, + StatusCard, useChain, } from '@dao-dao/stateless' import { ActionComponent } from '@dao-dao/types/actions' @@ -82,7 +82,9 @@ export const MigrateContractComponent: ActionComponent = ({
- + {contractAdmin !== address && ( + + )}
diff --git a/packages/stateful/actions/core/smart_contracting/UpdateAdmin/Component.tsx b/packages/stateful/actions/core/smart_contracting/UpdateAdmin/Component.tsx index 38f814cff..387c5d54b 100644 --- a/packages/stateful/actions/core/smart_contracting/UpdateAdmin/Component.tsx +++ b/packages/stateful/actions/core/smart_contracting/UpdateAdmin/Component.tsx @@ -5,7 +5,7 @@ import { AddressInput, InputErrorMessage, InputLabel, - IsAdminWarning, + StatusCard, useChain, } from '@dao-dao/stateless' import { ActionComponent } from '@dao-dao/types/actions' @@ -59,7 +59,9 @@ export const UpdateAdminComponent: ActionComponent = ({
- + {contractAdmin !== address && ( + + )} ) } diff --git a/packages/stateful/components/dao/CreateDaoForm.tsx b/packages/stateful/components/dao/CreateDaoForm.tsx index f181a64dd..cde3547ab 100644 --- a/packages/stateful/components/dao/CreateDaoForm.tsx +++ b/packages/stateful/components/dao/CreateDaoForm.tsx @@ -642,6 +642,7 @@ export const InnerCreateDaoForm = ({ items: {}, polytoneProxies: {}, accounts: [], + contractAdmin: null, }, lazyData: { loading: false, diff --git a/packages/stateful/components/dao/LazyDaoCard.tsx b/packages/stateful/components/dao/LazyDaoCard.tsx index 2ce887ad2..26206047e 100644 --- a/packages/stateful/components/dao/LazyDaoCard.tsx +++ b/packages/stateful/components/dao/LazyDaoCard.tsx @@ -37,6 +37,7 @@ export const LazyDaoCard = (props: LazyDaoCardProps) => { accounts: [], parentDao: null, admin: '', + contractAdmin: null, }} /> ) : daoInfoQuery.isError ? ( @@ -63,6 +64,7 @@ export const LazyDaoCard = (props: LazyDaoCardProps) => { accounts: [], parentDao: null, admin: '', + contractAdmin: null, }} /> ) : ( diff --git a/packages/stateful/components/pages/DaoDappHome.tsx b/packages/stateful/components/pages/DaoDappHome.tsx index e25fbaade..a57b88704 100644 --- a/packages/stateful/components/pages/DaoDappHome.tsx +++ b/packages/stateful/components/pages/DaoDappHome.tsx @@ -32,7 +32,7 @@ import { SuspenseLoader } from '../SuspenseLoader' export type InnerDaoDappHomeProps = Pick< DaoDappTabbedHomeProps, - 'parentProposalRecognizeSubDaoHref' + 'parentProposalRecognizeSubDaoHref' | 'proposeUpdateAdminToParentHref' > & { loadingTabs: LoadingData } @@ -156,6 +156,7 @@ export const DaoDappHome = () => { const daoInfo = useDaoInfoContext() + const { isMember = false } = useMembership(daoInfo) // If no parent, fallback to current DAO since it's already loaded from the // above hook. We won't use this value unless there's a parent. It's redundant // but has no effect. @@ -197,12 +198,87 @@ export const DaoDappHome = () => { }) : undefined + const proposeUpdateAdminToParentHref = + // Only show if this DAO has a parent DAO but its contract-level admin is + // set to itself. Only the current contract-level admin can change it. + daoInfo.parentDao && daoInfo.contractAdmin === daoInfo.coreAddress + ? // Make proposal in SubDAO if current wallet is a member of the SubDAO or not a member of the parent DAO (just to make it clear that this is a prompt to fix it). + isMember || !isMemberOfParent + ? getDaoProposalPath(daoInfo.coreAddress, 'create', { + prefill: getDaoProposalSinglePrefill({ + title: t('title.setAdminToParent', { + parent: daoInfo.parentDao.name, + }), + description: + t('info.parentDaoNotAdmin', { + child: daoInfo.name, + parent: daoInfo.parentDao.name, + }) + + ' ' + + t('info.proposalFixesChildAdmin', { + child: daoInfo.name, + parent: daoInfo.parentDao.name, + }), + actions: [ + { + actionKey: ActionKey.UpdateAdmin, + data: { + chainId: daoInfo.chainId, + contract: daoInfo.coreAddress, + newAdmin: daoInfo.parentDao.coreAddress, + }, + }, + ], + }), + }) + : // Make proposal in parent DAO if current wallet is a member. + isMemberOfParent + ? getDaoProposalPath(daoInfo.parentDao.coreAddress, 'create', { + prefill: getDaoProposalSinglePrefill({ + title: t('title.fixChildAdmin', { + child: daoInfo.name, + }), + description: + t('info.parentDaoNotAdmin', { + child: daoInfo.name, + parent: daoInfo.parentDao.name, + }) + + ' ' + + t('info.proposalFixesChildAdmin', { + child: daoInfo.name, + parent: daoInfo.parentDao.name, + }), + actions: [ + { + actionKey: ActionKey.DaoAdminExec, + data: { + coreAddress: daoInfo.coreAddress, + msgs: [], + _actionData: [ + { + actionKey: ActionKey.UpdateAdmin, + data: { + chainId: daoInfo.chainId, + contract: daoInfo.coreAddress, + newAdmin: daoInfo.parentDao.coreAddress, + }, + }, + ], + }, + }, + ], + }), + }) + : undefined + : undefined + const loadingTabs = useDaoTabs() return ( ) } diff --git a/packages/stateful/queries/dao.ts b/packages/stateful/queries/dao.ts index 8d7eafff0..a13bf7887 100644 --- a/packages/stateful/queries/dao.ts +++ b/packages/stateful/queries/dao.ts @@ -90,12 +90,20 @@ export const fetchDaoInfo = async ( // Get DAO info from contract. - const state = await queryClient.fetchQuery( - daoDaoCoreQueries.dumpState(queryClient, { - chainId, - contractAddress: coreAddress, - }) - ) + const [state, contractAdmin] = await Promise.all([ + queryClient.fetchQuery( + daoDaoCoreQueries.dumpState(queryClient, { + chainId, + contractAddress: coreAddress, + }) + ), + queryClient.fetchQuery( + chainQueries.wasmContractAdmin({ + chainId, + address: coreAddress, + }) + ), + ]) const coreVersion = parseContractVersion(state.version.version) const supportedFeatures = getSupportedFeatures(coreVersion) @@ -205,6 +213,7 @@ export const fetchDaoInfo = async ( votingModuleAddress: state.voting_module, votingModuleContractName, proposalModules, + contractAdmin, admin: state.admin, name: state.config.name, description: state.config.description, diff --git a/packages/stateless/components/actions/IsAdminWarning.tsx b/packages/stateless/components/actions/IsAdminWarning.tsx deleted file mode 100644 index a93251375..000000000 --- a/packages/stateless/components/actions/IsAdminWarning.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { WarningRounded } from '@mui/icons-material' -import { useTranslation } from 'react-i18next' - -export const IsAdminWarning = ({ - admin, - maybeAdmin, -}: { - admin: string | undefined - maybeAdmin: string -}) => { - const { t } = useTranslation() - - return admin !== undefined && admin !== maybeAdmin ? ( -
- -

{t('info.notAdmin')}

-
- ) : null -} diff --git a/packages/stateless/components/actions/index.ts b/packages/stateless/components/actions/index.ts index e75219d7c..da70df918 100644 --- a/packages/stateless/components/actions/index.ts +++ b/packages/stateless/components/actions/index.ts @@ -1,7 +1,6 @@ export * from './ActionCard' export * from './ActionsEditor' export * from './ActionsRenderer' -export * from './IsAdminWarning' export * from './NativeCoinSelector' export * from './NestedActionsEditor' export * from './NestedActionsRenderer' diff --git a/packages/stateless/components/dao/DaoCard.stories.tsx b/packages/stateless/components/dao/DaoCard.stories.tsx index d4e040e39..96dbbdced 100644 --- a/packages/stateless/components/dao/DaoCard.stories.tsx +++ b/packages/stateless/components/dao/DaoCard.stories.tsx @@ -49,6 +49,7 @@ export const makeDaoInfo = (id = 1): DaoInfo => ({ items: {}, accounts: [], admin: '', + contractAdmin: null, }) export const makeDaoCardProps = (id = 1): DaoCardProps => ({ diff --git a/packages/stateless/components/dao/DaoSplashHeader.tsx b/packages/stateless/components/dao/DaoSplashHeader.tsx index c0c56bfd6..5a9d7d535 100644 --- a/packages/stateless/components/dao/DaoSplashHeader.tsx +++ b/packages/stateless/components/dao/DaoSplashHeader.tsx @@ -12,6 +12,7 @@ export const DaoSplashHeader = ({ ButtonLink, LinkWrapper, parentProposalRecognizeSubDaoHref, + proposeUpdateAdminToParentHref, }: DaoSplashHeaderProps) => { const { t } = useTranslation() @@ -45,7 +46,7 @@ export const DaoSplashHeader = ({ {daoInfo.parentDao && !daoInfo.parentDao.registeredSubDao && ( )} + {daoInfo.parentDao && daoInfo.contractAdmin === daoInfo.coreAddress && ( + + + +

+ {t('info.parentDaoNotAdmin', { + parent: daoInfo.parentDao.name, + child: daoInfo.name, + })} + + {!!proposeUpdateAdminToParentHref && ( + + {' ' + t('button.clickHereToProposeFixing')} + + )} +

+
+ )} + { const daoInfo = useDaoInfoContext() @@ -35,8 +34,7 @@ export const DaoDappTabbedHome = ({ ButtonLink={ButtonLink} LinkWrapper={LinkWrapper} daoInfo={daoInfo} - follow={follow} - parentProposalRecognizeSubDaoHref={parentProposalRecognizeSubDaoHref} + {...headerProps} />
diff --git a/packages/storybook/decorators/DaoPageWrapperDecorator.tsx b/packages/storybook/decorators/DaoPageWrapperDecorator.tsx index 0deaf9cfd..85778c21d 100644 --- a/packages/storybook/decorators/DaoPageWrapperDecorator.tsx +++ b/packages/storybook/decorators/DaoPageWrapperDecorator.tsx @@ -57,6 +57,7 @@ export const makeDaoInfo = (): DaoInfo => ({ ], parentDao: null, admin: '', + contractAdmin: null, }) export const DaoPageWrapperDecorator: DecoratorFn = (Story) => { diff --git a/packages/types/components/DaoDappTabbedHome.ts b/packages/types/components/DaoDappTabbedHome.ts index 42d744811..d02874a59 100644 --- a/packages/types/components/DaoDappTabbedHome.ts +++ b/packages/types/components/DaoDappTabbedHome.ts @@ -13,10 +13,4 @@ export type DaoDappTabbedHomeProps = Omit & { tabs: DaoTabWithComponent[] selectedTabId: string onSelectTabId: (tab: string) => void - /** - * If this DAO is not recognized by its parent DAO as a SubDAO, and the - * current wallet is a member of the parent DAO, link to a new proposal in the - * parent DAO with the SubDAO recognition action pre-filled. - */ - parentProposalRecognizeSubDaoHref?: string } diff --git a/packages/types/components/DaoSplashHeader.ts b/packages/types/components/DaoSplashHeader.ts index 7b8dcf6c3..00b8270a2 100644 --- a/packages/types/components/DaoSplashHeader.ts +++ b/packages/types/components/DaoSplashHeader.ts @@ -17,4 +17,10 @@ export type DaoSplashHeaderProps = { * `DaoDappTabbedHome.tsx`. */ parentProposalRecognizeSubDaoHref?: string + /** + * If this DAO has a parent DAO set but its contract-level admin is set to + * itself, link to a new proposal that changes its admin. Passed from + * `DaoDappTabbedHome.tsx`. + */ + proposeUpdateAdminToParentHref?: string } diff --git a/packages/types/dao.ts b/packages/types/dao.ts index 950fef555..5c6d557aa 100644 --- a/packages/types/dao.ts +++ b/packages/types/dao.ts @@ -62,6 +62,10 @@ export type DaoInfo = { votingModuleAddress: string votingModuleContractName: string proposalModules: ProposalModule[] + /** + * Wasm contract-level admin that can migrate. + */ + contractAdmin: string | null admin: string name: string description: string diff --git a/packages/utils/chain.ts b/packages/utils/chain.ts index a73db10e5..8af739e8a 100644 --- a/packages/utils/chain.ts +++ b/packages/utils/chain.ts @@ -638,4 +638,5 @@ export const getDaoInfoForChainId = ( accounts, parentDao: null, admin: '', + contractAdmin: null, }) From cd25f59eca45294a87256020399b0d8208dde3df Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 21 Jun 2024 12:21:45 -0400 Subject: [PATCH 257/438] fix logo edge pixel clipping --- packages/stateless/components/logo/Logo.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/stateless/components/logo/Logo.tsx b/packages/stateless/components/logo/Logo.tsx index 405f2886e..8fbb96e1e 100644 --- a/packages/stateless/components/logo/Logo.tsx +++ b/packages/stateless/components/logo/Logo.tsx @@ -10,6 +10,8 @@ export const Logo = ({ size = 28, invert, className }: LogoProps) => { { return ( From 80c071b327458baf61ed6a33ea32762370973674 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 21 Jun 2024 12:28:57 -0400 Subject: [PATCH 258/438] adjusted splash header banner spacing --- packages/stateless/components/dao/DaoSplashHeader.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/stateless/components/dao/DaoSplashHeader.tsx b/packages/stateless/components/dao/DaoSplashHeader.tsx index 5a9d7d535..4e928cdfa 100644 --- a/packages/stateless/components/dao/DaoSplashHeader.tsx +++ b/packages/stateless/components/dao/DaoSplashHeader.tsx @@ -19,7 +19,7 @@ export const DaoSplashHeader = ({ return ( <> {!daoInfo.isActive && daoInfo.activeThreshold && ( -
+

@@ -46,7 +46,7 @@ export const DaoSplashHeader = ({ {daoInfo.parentDao && !daoInfo.parentDao.registeredSubDao && ( Date: Fri, 21 Jun 2024 12:55:38 -0400 Subject: [PATCH 259/438] updated banner --- packages/i18n/locales/en/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index b2d49d627..5645872d8 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -1156,7 +1156,7 @@ "overruleSubDaoProposalDescription": "Overrule a proposal in a SubDAO.", "overwritingSave": "This save will overwrite the existing one with the same name.", "paid": "Paid", - "parentDaoNotAdmin": "{{child}} is a SubDAO of {{parent}}, but its contract-level admin is not {{parent}}, meaning {{child}} can migrate and modify its own code.", + "parentDaoNotAdmin": "{{child}} is a SubDAO of {{parent}}, but its contract-level admin is set to itself, meaning {{child}} can migrate and modify its own code.", "passing": "Passing", "passingThresholdTooltip_noQuorum": "The proportion of all members who must vote 'Yes' on a single choice proposal for it to pass. Because quorum is disabled, this threshold is calculated from all members.", "passingThresholdTooltip_quorum": "The proportion of voters who must vote 'Yes' on a single choice proposal for it to pass. Because quorum is enabled, this threshold is calculated only from those who voted.", From 2dea7481c25aef93cab62145938445506ee190f1 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 21 Jun 2024 13:25:37 -0400 Subject: [PATCH 260/438] updated banner text again --- packages/i18n/locales/en/translation.json | 4 ++-- packages/stateless/components/dao/DaoSplashHeader.tsx | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 5645872d8..85fea59a1 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -87,8 +87,8 @@ "clearNotification": "Clear notification", "clearSelected": "Clear {{count}} selected", "clickHereToProposeAdding": "Click here to propose adding it.", - "clickHereToProposeFixing": "Click here to propose fixing it.", "clickHereToProposeRecognizingIt": "Click here to propose recognizing it.", + "clickHereToProposeSettingAdminToParent": "Click here to propose setting the admin to {{parent}}.", "clickToCopyAddress": "Click to copy address", "clickToFollow": "Click to follow", "clickToUnfollow": "Click to unfollow", @@ -1156,7 +1156,7 @@ "overruleSubDaoProposalDescription": "Overrule a proposal in a SubDAO.", "overwritingSave": "This save will overwrite the existing one with the same name.", "paid": "Paid", - "parentDaoNotAdmin": "{{child}} is a SubDAO of {{parent}}, but its contract-level admin is set to itself, meaning {{child}} can migrate and modify its own code.", + "parentDaoNotAdmin": "{{child}} is a SubDAO of {{parent}}, but its contract-level admin is set to itself, so {{child}} can migrate and modify its own code.", "passing": "Passing", "passingThresholdTooltip_noQuorum": "The proportion of all members who must vote 'Yes' on a single choice proposal for it to pass. Because quorum is disabled, this threshold is calculated from all members.", "passingThresholdTooltip_quorum": "The proportion of voters who must vote 'Yes' on a single choice proposal for it to pass. Because quorum is enabled, this threshold is calculated only from those who voted.", diff --git a/packages/stateless/components/dao/DaoSplashHeader.tsx b/packages/stateless/components/dao/DaoSplashHeader.tsx index 4e928cdfa..6f77047b3 100644 --- a/packages/stateless/components/dao/DaoSplashHeader.tsx +++ b/packages/stateless/components/dao/DaoSplashHeader.tsx @@ -88,7 +88,10 @@ export const DaoSplashHeader = ({ {!!proposeUpdateAdminToParentHref && ( - {' ' + t('button.clickHereToProposeFixing')} + {' ' + + t('button.clickHereToProposeSettingAdminToParent', { + parent: daoInfo.parentDao.name, + })} )}

From fa5fcac882ace9d46981d5353d09dc5cc8f9ed91 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 21 Jun 2024 16:21:45 -0400 Subject: [PATCH 261/438] fixed missing chain context on gov proposal line --- packages/state/recoil/selectors/chain.ts | 13 +++++++------ .../stateful/components/gov/GovProposalLine.tsx | 9 ++++++++- packages/stateful/server/makeGetDaoStaticProps.ts | 8 ++++---- packages/types/gov.ts | 2 ++ packages/utils/messages/protobuf.ts | 3 +++ 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/packages/state/recoil/selectors/chain.ts b/packages/state/recoil/selectors/chain.ts index 0260d738e..64bc92cdd 100644 --- a/packages/state/recoil/selectors/chain.ts +++ b/packages/state/recoil/selectors/chain.ts @@ -675,6 +675,7 @@ export const searchedDecodedGovProposalsSelector = selectorFamily< await Promise.allSettled( results.map(async ({ value: { id, data } }) => decodeGovProposal( + options.chainId, supportsV1Gov ? { version: GovProposalVersion.V1, @@ -836,14 +837,14 @@ export const govProposalsSelector = selectorFamily< const proposals = await Promise.all([ ...(v1Beta1Proposals || []).map((proposal) => - decodeGovProposal({ + decodeGovProposal(chainId, { version: GovProposalVersion.V1_BETA_1, id: proposal.proposalId, proposal, }) ), ...(v1Proposals || []).map((proposal) => - decodeGovProposal({ + decodeGovProposal(chainId, { version: GovProposalVersion.V1, id: proposal.id, proposal, @@ -896,13 +897,13 @@ export const govProposalSelector = selectorFamily< if (indexerProposal) { if (supportsV1Gov) { - govProposal = await decodeGovProposal({ + govProposal = await decodeGovProposal(chainId, { version: GovProposalVersion.V1, id: BigInt(proposalId), proposal: ProposalV1.decode(fromBase64(indexerProposal.data)), }) } else { - govProposal = await decodeGovProposal({ + govProposal = await decodeGovProposal(chainId, { version: GovProposalVersion.V1_BETA_1, id: BigInt(proposalId), proposal: ProposalV1Beta1.decode( @@ -929,7 +930,7 @@ export const govProposalSelector = selectorFamily< throw new Error('Proposal not found') } - govProposal = await decodeGovProposal({ + govProposal = await decodeGovProposal(chainId, { version: GovProposalVersion.V1, id: BigInt(proposalId), proposal, @@ -959,7 +960,7 @@ export const govProposalSelector = selectorFamily< throw new Error('Proposal not found') } - govProposal = await decodeGovProposal({ + govProposal = await decodeGovProposal(chainId, { version: GovProposalVersion.V1_BETA_1, id: BigInt(proposalId), proposal, diff --git a/packages/stateful/components/gov/GovProposalLine.tsx b/packages/stateful/components/gov/GovProposalLine.tsx index dd649b5cf..8c4cf7ebd 100644 --- a/packages/stateful/components/gov/GovProposalLine.tsx +++ b/packages/stateful/components/gov/GovProposalLine.tsx @@ -1,4 +1,5 @@ import { + ChainProvider, GovProposalStatus, GovProposalWalletVote, ProposalLine as StatelessProposalLine, @@ -12,7 +13,13 @@ import { ProposalStatus } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1bet import { useLoadingGovProposalWalletVoteInfo } from '../../hooks' import { LinkWrapper } from '../LinkWrapper' -export const GovProposalLine = (props: StatefulGovProposalLineProps) => { +export const GovProposalLine = (props: StatefulGovProposalLineProps) => ( + + + +) + +const InnerGovProposalLine = (props: StatefulGovProposalLineProps) => { const { proposalId, proposal } = props const { config: { name }, diff --git a/packages/stateful/server/makeGetDaoStaticProps.ts b/packages/stateful/server/makeGetDaoStaticProps.ts index 5485fb2b6..329775f86 100644 --- a/packages/stateful/server/makeGetDaoStaticProps.ts +++ b/packages/stateful/server/makeGetDaoStaticProps.ts @@ -404,13 +404,13 @@ export const makeGetDaoProposalStaticProps = ({ if (indexerProposal) { if (supportsV1Gov) { - proposal = await decodeGovProposal({ + proposal = await decodeGovProposal(chain.chain_id, { version: GovProposalVersion.V1, id: BigInt(proposalId), proposal: ProposalV1.decode(fromBase64(indexerProposal.data)), }) } else { - proposal = await decodeGovProposal({ + proposal = await decodeGovProposal(chain.chain_id, { version: GovProposalVersion.V1_BETA_1, id: BigInt(proposalId), proposal: ProposalV1Beta1.decode( @@ -441,7 +441,7 @@ export const makeGetDaoProposalStaticProps = ({ throw new Error('NOT_FOUND') } - proposal = await decodeGovProposal({ + proposal = await decodeGovProposal(chain.chain_id, { version: GovProposalVersion.V1, id: BigInt(proposalId), proposal: proposalV1, @@ -471,7 +471,7 @@ export const makeGetDaoProposalStaticProps = ({ throw new Error('NOT_FOUND') } - proposal = await decodeGovProposal({ + proposal = await decodeGovProposal(chain.chain_id, { version: GovProposalVersion.V1_BETA_1, id: BigInt(proposalId), proposal: proposalV1Beta1, diff --git a/packages/types/gov.ts b/packages/types/gov.ts index 2a525fa57..f3afe3a56 100644 --- a/packages/types/gov.ts +++ b/packages/types/gov.ts @@ -35,6 +35,7 @@ export type GovProposalV1Beta1 = { export type GovProposalV1Beta1DecodedContent = ProposalV1Beta1['content'] export type GovProposalV1Beta1WithDecodedContent = GovProposalV1Beta1 & { + chainId: string title: string description: string decodedContent: GovProposalV1Beta1DecodedContent @@ -48,6 +49,7 @@ export type GovProposalV1 = { export type GovProposalV1DecodedMessages = CosmosMsgFor_Empty[] export type GovProposalV1WithDecodedMessages = GovProposalV1 & { + chainId: string title: string description: string decodedMessages: GovProposalV1DecodedMessages diff --git a/packages/utils/messages/protobuf.ts b/packages/utils/messages/protobuf.ts index 6210c89fe..0be944cc6 100644 --- a/packages/utils/messages/protobuf.ts +++ b/packages/utils/messages/protobuf.ts @@ -42,6 +42,7 @@ export const decodeGovProposalV1Messages = ( // Decode governance proposal content using a protobuf. export const decodeGovProposal = async ( + chainId: string, govProposal: GovProposal ): Promise => { if (govProposal.version === GovProposalVersion.V1_BETA_1) { @@ -65,6 +66,7 @@ export const decodeGovProposal = async ( return { ...govProposal, + chainId, title, description, decodedContent: govProposal.proposal.content, @@ -124,6 +126,7 @@ export const decodeGovProposal = async ( return { ...govProposal, + chainId, title, description, decodedMessages, From 8e4fd61ca3099be2a3cf360594892d46662eac75 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 21 Jun 2024 16:24:39 -0400 Subject: [PATCH 262/438] fixed build --- .../chain_governance/GovernanceDeposit/Component.stories.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/stateful/actions/core/chain_governance/GovernanceDeposit/Component.stories.tsx b/packages/stateful/actions/core/chain_governance/GovernanceDeposit/Component.stories.tsx index 4fb498047..dd5fa5eb4 100644 --- a/packages/stateful/actions/core/chain_governance/GovernanceDeposit/Component.stories.tsx +++ b/packages/stateful/actions/core/chain_governance/GovernanceDeposit/Component.stories.tsx @@ -25,6 +25,7 @@ const Template: ComponentStory = (args) => ( ) export const makeProposal = (): GovProposalWithDecodedContent => ({ + chainId: CHAIN_ID, version: GovProposalVersion.V1_BETA_1, id: 1n, title: 'Upgrade to v10 Alpha 1', From b06c57fd26d8518cb96029ad18d0161b7819c03d Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sat, 22 Jun 2024 02:05:32 -0400 Subject: [PATCH 263/438] fixed wasm contract admin query for terra classic --- packages/state/query/queries/chain.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/state/query/queries/chain.ts b/packages/state/query/queries/chain.ts index 55278934e..9394bec58 100644 --- a/packages/state/query/queries/chain.ts +++ b/packages/state/query/queries/chain.ts @@ -7,6 +7,7 @@ import { DecCoin } from '@dao-dao/types/protobuf/codegen/cosmos/base/v1beta1/coi import { cosmWasmClientRouter, cosmosProtoRpcClientRouter, + cosmwasmProtoRpcClientRouter, feemarketProtoRpcClientRouter, getNativeTokenForChainId, isValidBech32Address, @@ -269,8 +270,16 @@ export const fetchWasmContractAdmin = async ({ chainId: string address: string }): Promise => { - const client = await cosmWasmClientRouter.connect(chainId) - return (await client.getContract(address))?.admin ?? null + // CosmWasmClient.getContract is not compatible with Terra Classic for some + // reason, so use protobuf query directly. + const client = await cosmwasmProtoRpcClientRouter.connect(chainId) + return ( + ( + await client.wasm.v1.contractInfo({ + address, + }) + )?.contractInfo?.admin ?? null + ) } export const chainQueries = { From e856604397513bc4b8d014831e0316abde28cfbe Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sat, 22 Jun 2024 02:53:25 -0400 Subject: [PATCH 264/438] fixed self relay bugs --- .../components/SelfRelayExecuteModal.tsx | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/packages/stateful/components/SelfRelayExecuteModal.tsx b/packages/stateful/components/SelfRelayExecuteModal.tsx index 3abfa88df..ad9dfe939 100644 --- a/packages/stateful/components/SelfRelayExecuteModal.tsx +++ b/packages/stateful/components/SelfRelayExecuteModal.tsx @@ -44,6 +44,7 @@ import { Tooltip, useCachedLoadingWithError, useSupportedChainContext, + useUpdatingRef, } from '@dao-dao/stateless' import { ChainId, @@ -223,6 +224,15 @@ export const SelfRelayExecuteModal = ({ return () => clearInterval(interval) }, [relayers, refreshBalances]) + // Create memoized function that returns the relayer funds for a chain, + // adjusting for number of packets. + const getRelayerFundsRef = useUpdatingRef( + (chainId: string): number => + // Use relayer funds as base and increase by 5% per packet + (RELAYER_FUNDS_NEEDED[chainId] ?? 0) * + (1 + crossChainPackets.length * 0.05) + ) + const walletFunds = useCachedLoadingWithError( relayers ? waitForAll( @@ -242,7 +252,7 @@ export const SelfRelayExecuteModal = ({ ? walletFunds.data.map( ({ balance }, index) => Number(balance) >= - (RELAYER_FUNDS_NEEDED[relayers[index].chain.chain_id] ?? 0) + getRelayerFundsRef.current(relayers[index].chain.chain_id) ) : undefined @@ -270,7 +280,7 @@ export const SelfRelayExecuteModal = ({ .every( ({ amount }, index) => Number(amount) >= - (RELAYER_FUNDS_NEEDED[relayers[index + 1].chain.chain_id] ?? 0) + getRelayerFundsRef.current(relayers[index + 1].chain.chain_id) ) const setupRelayer = async () => { @@ -426,7 +436,7 @@ export const SelfRelayExecuteModal = ({ const fundsNeeded = // Give a little extra to cover the authz tx fee. - (RELAYER_FUNDS_NEEDED[chainId] ?? 0) * 1.3 - + getRelayerFundsRef.current(chainId) * 1.2 - Number(currentBalance.amount) let msgs: EncodeObject[] = @@ -765,6 +775,7 @@ export const SelfRelayExecuteModal = ({ ) { // Refresh all balances. relayers.map(refreshBalances) + console.error(err) throw new Error(t('error.relayerWalletNeedsFunds')) } @@ -806,8 +817,11 @@ export const SelfRelayExecuteModal = ({ await Promise.all( uniquePackets.map( async ({ srcChannel, srcPort }) => + // Just search one page (instead of all pages via + // txSearchAll) because it incorrectly paginates sometimes + // and throws an error. ( - await link.endB.client.tm.txSearchAll({ + await link.endB.client.tm.txSearch({ query: `write_acknowledgement.packet_connection='${dstConnection}' AND write_acknowledgement.packet_src_port='${srcPort}' AND write_acknowledgement.packet_src_channel='${srcChannel}' AND write_acknowledgement.packet_sequence>=${smallestSequenceNumber} AND write_acknowledgement.packet_sequence<=${largestSequenceNumber}`, }) ).txs @@ -865,6 +879,7 @@ export const SelfRelayExecuteModal = ({ ) { // Refresh all balances. relayers.map(refreshBalances) + console.error(err) throw new Error(t('error.relayerWalletNeedsFunds')) } @@ -1132,8 +1147,7 @@ export const SelfRelayExecuteModal = ({ fundedAmount[chain_id] ?? 0 const empty = funds === 0 - const funded = - funds >= (RELAYER_FUNDS_NEEDED[chain_id] ?? 0) + const funded = funds >= getRelayerFundsRef.current(chain_id) const isExecute = index === 0 // If this is the execute, we need to make sure all From 5e19a3b477fd58d5ec328f63ba23d601df30a90a Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sat, 22 Jun 2024 16:27:53 -0400 Subject: [PATCH 265/438] added omniflix polytone connections from juno and osmosis --- .../components/SelfRelayExecuteModal.tsx | 1 + packages/types/chain.ts | 1 + packages/utils/constants/chains.ts | 36 +++++++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/packages/stateful/components/SelfRelayExecuteModal.tsx b/packages/stateful/components/SelfRelayExecuteModal.tsx index ad9dfe939..23a7106e1 100644 --- a/packages/stateful/components/SelfRelayExecuteModal.tsx +++ b/packages/stateful/components/SelfRelayExecuteModal.tsx @@ -96,6 +96,7 @@ const RELAYER_FUNDS_NEEDED: Partial> = { [ChainId.ArchwayMainnet]: 1 * 10 ** 18, [ChainId.InjectiveMainnet]: 0.03 * 10 ** 18, [ChainId.TerraClassicMainnet]: 1000 * 10 ** 6, + [ChainId.OmniflixHubMainnet]: 1 * 10 ** 6, } type Relayer = { diff --git a/packages/types/chain.ts b/packages/types/chain.ts index 6cb8f54e8..12cd520f4 100644 --- a/packages/types/chain.ts +++ b/packages/types/chain.ts @@ -77,6 +77,7 @@ export enum ChainId { ArchwayMainnet = 'archway-1', InjectiveMainnet = 'injective-1', BitsongTestnet = 'bobnet', + OmniflixHubMainnet = 'omniflixhub-1', } export type BaseChainConfig = { diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 6d6d3a03b..e7220b608 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -325,6 +325,24 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // archway remoteChannel: 'channel-45', }, + [ChainId.OmniflixHubMainnet]: { + // juno + note: 'juno128ace0g69ghvgw0quxptxmeg8kjex6mrw5fguulssllge6qnca6sjykzsw', + // juno + listener: + 'juno1ts88k8s6he69uew3y89pg7l9e3zjqplctj4nwg6jw40d9le3r4esvp42s9', + // omniflixhub + voice: + 'omniflix18cszlvm6pze0x9sz32qnjq4vtd45xehqs8dq7cwy8yhq35wfnn3q3wy4uv', + // juno + localConnection: 'connection-104', + // omniflixhub + remoteConnection: 'connection-27', + // juno + localChannel: 'channel-566', + // omniflixhub + remoteChannel: 'channel-41', + }, }, }, { @@ -555,6 +573,24 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // injective remoteChannel: 'channel-301', }, + [ChainId.OmniflixHubMainnet]: { + // osmosis + note: 'osmo19p2k2wdzdvrr0np5jmef4qa2wpsxjgmumu3k35d3myxcwjf9yufq9xl65h', + // osmosis + listener: + 'osmo148g8aue5zvry9wy5zdspcghswqs7gg0qlh9wwzgm4g82t7c6w34qqvs433', + // omniflixhub + voice: + 'omniflix1wkwy0xh89ksdgj9hr347dyd2dw7zesmtrue6kfzyml4vdtz6e5wsnmv63u', + // osmosis + localConnection: 'connection-1431', + // omniflixhub + remoteConnection: 'connection-8', + // osmosis + localChannel: 'channel-78358', + // omniflixhub + remoteChannel: 'channel-42', + }, }, }, { From b6ccbe6dc95cc7f53dc8c3e90391637884b37fbe Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sat, 22 Jun 2024 16:34:30 -0400 Subject: [PATCH 266/438] show self relay if takes longer than 1 min --- packages/stateful/hooks/useProposalRelayState.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/stateful/hooks/useProposalRelayState.ts b/packages/stateful/hooks/useProposalRelayState.ts index 1cd9d18e6..a9ec46a67 100644 --- a/packages/stateful/hooks/useProposalRelayState.ts +++ b/packages/stateful/hooks/useProposalRelayState.ts @@ -377,8 +377,8 @@ export const useProposalRelayState = ({ const executedOverFiveMinutesAgo = status === ProposalStatusEnum.Executed && executedAt !== undefined && - // If executed over 5 minutes ago... - Date.now() - executedAt.getTime() > 5 * 60 * 1000 + // If executed over 1 minute ago... + Date.now() - executedAt.getTime() > 1 * 60 * 1000 const messagesNeedingSelfRelay = unreceivedPackets.loading || unreceivedAcks.loading || From 74c743fdc910c45693afaf7ac4268d88c26fda31 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sat, 22 Jun 2024 16:34:54 -0400 Subject: [PATCH 267/438] updated variable name --- packages/stateful/hooks/useProposalRelayState.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/stateful/hooks/useProposalRelayState.ts b/packages/stateful/hooks/useProposalRelayState.ts index a9ec46a67..ab3c931dd 100644 --- a/packages/stateful/hooks/useProposalRelayState.ts +++ b/packages/stateful/hooks/useProposalRelayState.ts @@ -374,7 +374,7 @@ export const useProposalRelayState = ({ return () => clearInterval(interval) }, [anyPending, refreshIbcData]) - const executedOverFiveMinutesAgo = + const executedOverOneMinuteAgo = status === ProposalStatusEnum.Executed && executedAt !== undefined && // If executed over 1 minute ago... @@ -391,7 +391,7 @@ export const useProposalRelayState = ({ states.pending.some((p) => p.packet === packet) && // Executed a few minutes ago and still has not been relayed, or the // Polytone connection needs self-relay. - (executedOverFiveMinutesAgo || + (executedOverOneMinuteAgo || (packet.type === 'polytone' && !!packet.data.polytoneConnection.needsSelfRelay)) ) From 629adb9aa7ed4aed8474642ee466b8070f05594e Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 24 Jun 2024 20:29:29 -0400 Subject: [PATCH 268/438] fixed scrollbars on status card --- packages/stateless/components/StatusCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stateless/components/StatusCard.tsx b/packages/stateless/components/StatusCard.tsx index 33bfc7927..9263886db 100644 --- a/packages/stateless/components/StatusCard.tsx +++ b/packages/stateless/components/StatusCard.tsx @@ -53,7 +53,7 @@ export const StatusCard = ({ return (
Date: Tue, 25 Jun 2024 14:51:57 -0400 Subject: [PATCH 269/438] fixed wasm MsgUpdateParams message --- packages/types/protobuf/codegen/cosmwasm/wasm/v1/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/protobuf/codegen/cosmwasm/wasm/v1/types.ts b/packages/types/protobuf/codegen/cosmwasm/wasm/v1/types.ts index 2ede42783..2038d7725 100644 --- a/packages/types/protobuf/codegen/cosmwasm/wasm/v1/types.ts +++ b/packages/types/protobuf/codegen/cosmwasm/wasm/v1/types.ts @@ -569,7 +569,7 @@ export const Params = { toAmino(message: Params, useInterfaces: boolean = false): ParamsAmino { const obj: any = {}; obj.code_upload_access = message.codeUploadAccess ? AccessConfig.toAmino(message.codeUploadAccess, useInterfaces) : AccessConfig.fromPartial({}); - obj.instantiate_default_permission = message.instantiateDefaultPermission; + obj.instantiate_default_permission = accessTypeToJSON(message.instantiateDefaultPermission); return obj; }, fromAminoMsg(object: ParamsAminoMsg): Params { From e0cda70e7deb184f42a958bccb7f2fb358d201e4 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 10 Jun 2024 18:43:21 -0400 Subject: [PATCH 270/438] add skip and token queries --- packages/state/contracts/Cw20Base.ts | 600 ++++++++++++------ packages/state/query/queries/account.ts | 36 +- packages/state/query/queries/chain.ts | 67 ++ .../state/query/queries/contracts/Cw20Base.ts | 342 ++++++++++ .../state/query/queries/contracts/index.ts | 1 + packages/state/query/queries/index.ts | 2 + packages/state/query/queries/skip.ts | 82 +++ packages/state/query/queries/token.ts | 314 +++++++++ packages/types/contracts/Cw20Base.ts | 188 +++++- packages/utils/chain.ts | 11 +- 10 files changed, 1424 insertions(+), 219 deletions(-) create mode 100644 packages/state/query/queries/contracts/Cw20Base.ts create mode 100644 packages/state/query/queries/skip.ts create mode 100644 packages/state/query/queries/token.ts diff --git a/packages/state/contracts/Cw20Base.ts b/packages/state/contracts/Cw20Base.ts index c2b86e9ce..37f95b7e0 100644 --- a/packages/state/contracts/Cw20Base.ts +++ b/packages/state/contracts/Cw20Base.ts @@ -1,19 +1,30 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import { Coin, StdFee } from '@cosmjs/amino' import { CosmWasmClient, ExecuteResult, SigningCosmWasmClient, } from '@cosmjs/cosmwasm-stargate' -import { Binary, Expiration, Uint128 } from '@dao-dao/types/contracts/common' import { AllAccountsResponse, AllAllowancesResponse, + AllSpenderAllowancesResponse, AllowanceResponse, BalanceResponse, + Binary, DownloadLogoResponse, + Expiration, + Logo, MarketingInfoResponse, MinterResponse, TokenInfoResponse, + Uint128, } from '@dao-dao/types/contracts/Cw20Base' import { CHAIN_GAS_MULTIPLIER } from '@dao-dao/utils' @@ -21,6 +32,7 @@ export interface Cw20BaseReadOnlyInterface { contractAddress: string balance: ({ address }: { address: string }) => Promise tokenInfo: () => Promise + minter: () => Promise allowance: ({ owner, spender, @@ -28,9 +40,6 @@ export interface Cw20BaseReadOnlyInterface { owner: string spender: string }) => Promise - minter: () => Promise - marketingInfo: () => Promise - downloadLogo: () => Promise allAllowances: ({ limit, owner, @@ -40,6 +49,15 @@ export interface Cw20BaseReadOnlyInterface { owner: string startAfter?: string }) => Promise + allSpenderAllowances: ({ + limit, + spender, + startAfter, + }: { + limit?: number + spender: string + startAfter?: string + }) => Promise allAccounts: ({ limit, startAfter, @@ -47,24 +65,25 @@ export interface Cw20BaseReadOnlyInterface { limit?: number startAfter?: string }) => Promise + marketingInfo: () => Promise + downloadLogo: () => Promise } export class Cw20BaseQueryClient implements Cw20BaseReadOnlyInterface { client: CosmWasmClient contractAddress: string - constructor(client: CosmWasmClient, contractAddress: string) { this.client = client this.contractAddress = contractAddress this.balance = this.balance.bind(this) this.tokenInfo = this.tokenInfo.bind(this) - this.allowance = this.allowance.bind(this) this.minter = this.minter.bind(this) - this.marketingInfo = this.marketingInfo.bind(this) - this.downloadLogo = this.downloadLogo.bind(this) + this.allowance = this.allowance.bind(this) this.allAllowances = this.allAllowances.bind(this) + this.allSpenderAllowances = this.allSpenderAllowances.bind(this) this.allAccounts = this.allAccounts.bind(this) + this.marketingInfo = this.marketingInfo.bind(this) + this.downloadLogo = this.downloadLogo.bind(this) } - balance = async ({ address, }: { @@ -81,6 +100,11 @@ export class Cw20BaseQueryClient implements Cw20BaseReadOnlyInterface { token_info: {}, }) } + minter = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + minter: {}, + }) + } allowance = async ({ owner, spender, @@ -95,21 +119,6 @@ export class Cw20BaseQueryClient implements Cw20BaseReadOnlyInterface { }, }) } - minter = async (): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - minter: {}, - }) - } - marketingInfo = async (): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - marketing_info: {}, - }) - } - downloadLogo = async (): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - download_logo: {}, - }) - } allAllowances = async ({ limit, owner, @@ -127,6 +136,23 @@ export class Cw20BaseQueryClient implements Cw20BaseReadOnlyInterface { }, }) } + allSpenderAllowances = async ({ + limit, + spender, + startAfter, + }: { + limit?: number + spender: string + startAfter?: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_spender_allowances: { + limit, + spender, + start_after: startAfter, + }, + }) + } allAccounts = async ({ limit, startAfter, @@ -141,89 +167,168 @@ export class Cw20BaseQueryClient implements Cw20BaseReadOnlyInterface { }, }) } + marketingInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + marketing_info: {}, + }) + } + downloadLogo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + download_logo: {}, + }) + } } export interface Cw20BaseInterface extends Cw20BaseReadOnlyInterface { contractAddress: string sender: string - transfer: ({ - amount, - recipient, - }: { - amount: Uint128 - recipient: string - }) => Promise - burn: ({ amount }: { amount: Uint128 }) => Promise - send: ({ - amount, - contract, - msg, - }: { - amount: Uint128 - contract: string - msg: Binary - }) => Promise - increaseAllowance: ({ - amount, - expires, - spender, - }: { - amount: Uint128 - expires?: Expiration - spender: string - }) => Promise - decreaseAllowance: ({ - amount, - expires, - spender, - }: { - amount: Uint128 - expires?: Expiration - spender: string - }) => Promise - transferFrom: ({ - amount, - owner, - recipient, - }: { - amount: Uint128 - owner: string - recipient: string - }) => Promise - sendFrom: ({ - amount, - contract, - msg, - owner, - }: { - amount: Uint128 - contract: string - msg: Binary - owner: string - }) => Promise - burnFrom: ({ - amount, - owner, - }: { - amount: Uint128 - owner: string - }) => Promise - mint: ({ - amount, - recipient, - }: { - amount: Uint128 - recipient: string - }) => Promise - updateMarketing: ({ - description, - marketing, - project, - }: { - description?: string - marketing?: string - project?: string - }) => Promise - uploadLogo: () => Promise + transfer: ( + { + amount, + recipient, + }: { + amount: Uint128 + recipient: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + burn: ( + { + amount, + }: { + amount: Uint128 + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + send: ( + { + amount, + contract, + msg, + }: { + amount: Uint128 + contract: string + msg: Binary + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + increaseAllowance: ( + { + amount, + expires, + spender, + }: { + amount: Uint128 + expires?: Expiration + spender: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + decreaseAllowance: ( + { + amount, + expires, + spender, + }: { + amount: Uint128 + expires?: Expiration + spender: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + transferFrom: ( + { + amount, + owner, + recipient, + }: { + amount: Uint128 + owner: string + recipient: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + sendFrom: ( + { + amount, + contract, + msg, + owner, + }: { + amount: Uint128 + contract: string + msg: Binary + owner: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + burnFrom: ( + { + amount, + owner, + }: { + amount: Uint128 + owner: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + mint: ( + { + amount, + recipient, + }: { + amount: Uint128 + recipient: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + updateMinter: ( + { + newMinter, + }: { + newMinter?: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + updateMarketing: ( + { + description, + marketing, + project, + }: { + description?: string + marketing?: string + project?: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + uploadLogo: ( + logo: Logo, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise } export class Cw20BaseClient extends Cw20BaseQueryClient @@ -232,7 +337,6 @@ export class Cw20BaseClient client: SigningCosmWasmClient sender: string contractAddress: string - constructor( client: SigningCosmWasmClient, sender: string, @@ -251,17 +355,22 @@ export class Cw20BaseClient this.sendFrom = this.sendFrom.bind(this) this.burnFrom = this.burnFrom.bind(this) this.mint = this.mint.bind(this) + this.updateMinter = this.updateMinter.bind(this) this.updateMarketing = this.updateMarketing.bind(this) this.uploadLogo = this.uploadLogo.bind(this) } - - transfer = async ({ - amount, - recipient, - }: { - amount: Uint128 - recipient: string - }): Promise => { + transfer = async ( + { + amount, + recipient, + }: { + amount: Uint128 + recipient: string + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { return await this.client.execute( this.sender, this.contractAddress, @@ -271,10 +380,21 @@ export class Cw20BaseClient recipient, }, }, - CHAIN_GAS_MULTIPLIER + fee, + memo, + _funds ) } - burn = async ({ amount }: { amount: Uint128 }): Promise => { + burn = async ( + { + amount, + }: { + amount: Uint128 + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { return await this.client.execute( this.sender, this.contractAddress, @@ -283,18 +403,25 @@ export class Cw20BaseClient amount, }, }, - CHAIN_GAS_MULTIPLIER + fee, + memo, + _funds ) } - send = async ({ - amount, - contract, - msg, - }: { - amount: Uint128 - contract: string - msg: Binary - }): Promise => { + send = async ( + { + amount, + contract, + msg, + }: { + amount: Uint128 + contract: string + msg: Binary + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { return await this.client.execute( this.sender, this.contractAddress, @@ -305,18 +432,25 @@ export class Cw20BaseClient msg, }, }, - CHAIN_GAS_MULTIPLIER + fee, + memo, + _funds ) } - increaseAllowance = async ({ - amount, - expires, - spender, - }: { - amount: Uint128 - expires?: Expiration - spender: string - }): Promise => { + increaseAllowance = async ( + { + amount, + expires, + spender, + }: { + amount: Uint128 + expires?: Expiration + spender: string + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { return await this.client.execute( this.sender, this.contractAddress, @@ -327,18 +461,25 @@ export class Cw20BaseClient spender, }, }, - CHAIN_GAS_MULTIPLIER + fee, + memo, + _funds ) } - decreaseAllowance = async ({ - amount, - expires, - spender, - }: { - amount: Uint128 - expires?: Expiration - spender: string - }): Promise => { + decreaseAllowance = async ( + { + amount, + expires, + spender, + }: { + amount: Uint128 + expires?: Expiration + spender: string + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { return await this.client.execute( this.sender, this.contractAddress, @@ -349,18 +490,25 @@ export class Cw20BaseClient spender, }, }, - CHAIN_GAS_MULTIPLIER + fee, + memo, + _funds ) } - transferFrom = async ({ - amount, - owner, - recipient, - }: { - amount: Uint128 - owner: string - recipient: string - }): Promise => { + transferFrom = async ( + { + amount, + owner, + recipient, + }: { + amount: Uint128 + owner: string + recipient: string + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { return await this.client.execute( this.sender, this.contractAddress, @@ -371,20 +519,27 @@ export class Cw20BaseClient recipient, }, }, - CHAIN_GAS_MULTIPLIER + fee, + memo, + _funds ) } - sendFrom = async ({ - amount, - contract, - msg, - owner, - }: { - amount: Uint128 - contract: string - msg: Binary - owner: string - }): Promise => { + sendFrom = async ( + { + amount, + contract, + msg, + owner, + }: { + amount: Uint128 + contract: string + msg: Binary + owner: string + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { return await this.client.execute( this.sender, this.contractAddress, @@ -396,16 +551,23 @@ export class Cw20BaseClient owner, }, }, - CHAIN_GAS_MULTIPLIER + fee, + memo, + _funds ) } - burnFrom = async ({ - amount, - owner, - }: { - amount: Uint128 - owner: string - }): Promise => { + burnFrom = async ( + { + amount, + owner, + }: { + amount: Uint128 + owner: string + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { return await this.client.execute( this.sender, this.contractAddress, @@ -415,16 +577,23 @@ export class Cw20BaseClient owner, }, }, - CHAIN_GAS_MULTIPLIER + fee, + memo, + _funds ) } - mint = async ({ - amount, - recipient, - }: { - amount: Uint128 - recipient: string - }): Promise => { + mint = async ( + { + amount, + recipient, + }: { + amount: Uint128 + recipient: string + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { return await this.client.execute( this.sender, this.contractAddress, @@ -434,18 +603,48 @@ export class Cw20BaseClient recipient, }, }, - CHAIN_GAS_MULTIPLIER + fee, + memo, + _funds ) } - updateMarketing = async ({ - description, - marketing, - project, - }: { - description?: string - marketing?: string - project?: string - }): Promise => { + updateMinter = async ( + { + newMinter, + }: { + newMinter?: string + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + update_minter: { + new_minter: newMinter, + }, + }, + fee, + memo, + _funds + ) + } + updateMarketing = async ( + { + description, + marketing, + project, + }: { + description?: string + marketing?: string + project?: string + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { return await this.client.execute( this.sender, this.contractAddress, @@ -456,17 +655,26 @@ export class Cw20BaseClient project, }, }, - CHAIN_GAS_MULTIPLIER + fee, + memo, + _funds ) } - uploadLogo = async (): Promise => { + uploadLogo = async ( + logo: Logo, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { return await this.client.execute( this.sender, this.contractAddress, { - upload_logo: {}, + upload_logo: logo, }, - CHAIN_GAS_MULTIPLIER + fee, + memo, + _funds ) } } diff --git a/packages/state/query/queries/account.ts b/packages/state/query/queries/account.ts index 3bc0bafd1..d43ba29ec 100644 --- a/packages/state/query/queries/account.ts +++ b/packages/state/query/queries/account.ts @@ -7,7 +7,9 @@ import { CryptographicMultisigAccount, Cw3MultisigAccount, MultisigAccount, + PolytoneProxies, } from '@dao-dao/types' +import { ListItemsResponse } from '@dao-dao/types/contracts/DaoCore.v2' import { Threshold } from '@dao-dao/types/contracts/DaoProposalSingle.common' import { BaseAccount } from '@dao-dao/types/protobuf/codegen/cosmos/auth/v1beta1/auth' import { LegacyAminoPubKey } from '@dao-dao/types/protobuf/codegen/cosmos/crypto/multisig/keys' @@ -69,14 +71,22 @@ export const fetchAccountList = async ( ), ]) - // If this is a DAO, get its polytone proxies and registered ICAs (which is a - // chain the DAO has indicated it has an ICA on by storing an item in its KV). - const [polytoneProxies, registeredIcas] = isDao - ? await Promise.all([ - queryClient.fetchQuery( + const mainAccount: Account = { + chainId, + address, + type: isPolytoneProxy ? AccountType.Polytone : AccountType.Native, + } + + const [polytoneProxies, registeredIcas] = await Promise.all([ + mainAccount.type !== AccountType.Polytone + ? queryClient.fetchQuery( polytoneQueries.proxies(queryClient, { chainId, address }) - ), - queryClient.fetchQuery( + ) + : ({} as PolytoneProxies), + // If this is a DAO, get its registered ICAs (which is a chain the DAO has + // indicated it has an ICA on by storing an item in its KV). + isDao + ? queryClient.fetchQuery( daoDaoCoreQueries.listAllItems(queryClient, { chainId, contractAddress: address, @@ -84,15 +94,9 @@ export const fetchAccountList = async ( prefix: ICA_CHAINS_TX_PREFIX, }, }) - ), - ]) - : [] - - const mainAccount: Account = { - chainId, - address, - type: isPolytoneProxy ? AccountType.Polytone : AccountType.Native, - } + ) + : ([] as ListItemsResponse), + ]) const allAccounts: Account[] = [ // Main account. diff --git a/packages/state/query/queries/chain.ts b/packages/state/query/queries/chain.ts index 9394bec58..eb5618e92 100644 --- a/packages/state/query/queries/chain.ts +++ b/packages/state/query/queries/chain.ts @@ -3,6 +3,7 @@ import { QueryClient, queryOptions, skipToken } from '@tanstack/react-query' import { ChainId } from '@dao-dao/types' import { ModuleAccount } from '@dao-dao/types/protobuf/codegen/cosmos/auth/v1beta1/auth' +import { Metadata } from '@dao-dao/types/protobuf/codegen/cosmos/bank/v1beta1/bank' import { DecCoin } from '@dao-dao/types/protobuf/codegen/cosmos/base/v1beta1/coin' import { cosmWasmClientRouter, @@ -282,6 +283,64 @@ export const fetchWasmContractAdmin = async ({ ) } +/** + * Fetch the on-chain metadata for a denom if it exists. Returns null if denom + * not found. This likely exists for token factory denoms. + */ +export const fetchDenomMetadata = async ({ + chainId, + denom, +}: { + chainId: string + denom: string +}): Promise<{ + metadata: Metadata + preferredSymbol: string + preferredDecimals: number +} | null> => { + const client = await cosmosProtoRpcClientRouter.connect(chainId) + try { + const { metadata } = await client.bank.v1beta1.denomMetadata({ denom }) + + if (metadata) { + const { base, denomUnits, symbol, display } = metadata + + // If display is equal to the base, use the symbol denom unit if + // available. This fixes the case where display was not updated even + // though a nonzero exponent was created. + const searchDenom = display === base ? symbol : display + + const displayDenom = + denomUnits.find(({ denom }) => denom === searchDenom) ?? + denomUnits.find(({ denom }) => denom === display) ?? + denomUnits.find(({ exponent }) => exponent > 0) ?? + denomUnits[0] + + return { + metadata, + // If factory denom, extract symbol at the end. + preferredSymbol: + (displayDenom + ? displayDenom.denom.startsWith('factory/') + ? displayDenom.denom.split('/').pop()! + : displayDenom.denom + : metadata.symbol) || denom, + preferredDecimals: displayDenom?.exponent ?? 0, + } + } + } catch (err) { + // If denom not found, return null. + if (err instanceof Error && err.message.includes('key not found')) { + return null + } + + // Rethrow other errors. + throw err + } + + return null +} + export const chainQueries = { /** * Fetch the module address associated with the specified name. @@ -356,4 +415,12 @@ export const chainQueries = { queryKey: ['chain', 'wasmContractAdmin', options], queryFn: () => fetchWasmContractAdmin(options), }), + /** + * Fetch the on-chain metadata for a denom if it exists. + */ + denomMetadata: (options: Parameters[0]) => + queryOptions({ + queryKey: ['chain', 'denomMetadata', options], + queryFn: () => fetchDenomMetadata(options), + }), } diff --git a/packages/state/query/queries/contracts/Cw20Base.ts b/packages/state/query/queries/contracts/Cw20Base.ts new file mode 100644 index 000000000..b40268824 --- /dev/null +++ b/packages/state/query/queries/contracts/Cw20Base.ts @@ -0,0 +1,342 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import { UseQueryOptions } from '@tanstack/react-query' + +import { + AllAccountsResponse, + AllAllowancesResponse, + AllSpenderAllowancesResponse, + AllowanceResponse, + BalanceResponse, + DownloadLogoResponse, + MarketingInfoResponse, + MinterResponse, + TokenInfoResponse, +} from '@dao-dao/types/contracts/Cw20Base' +import { cosmWasmClientRouter } from '@dao-dao/utils' + +import { Cw20BaseQueryClient } from '../../../contracts/Cw20Base' + +export const cw20BaseQueryKeys = { + contract: [ + { + contract: 'cw20Base', + }, + ] as const, + address: (contractAddress: string) => + [ + { + ...cw20BaseQueryKeys.contract[0], + address: contractAddress, + }, + ] as const, + balance: (contractAddress: string, args?: Record) => + [ + { + ...cw20BaseQueryKeys.address(contractAddress)[0], + method: 'balance', + args, + }, + ] as const, + tokenInfo: (contractAddress: string, args?: Record) => + [ + { + ...cw20BaseQueryKeys.address(contractAddress)[0], + method: 'token_info', + args, + }, + ] as const, + minter: (contractAddress: string, args?: Record) => + [ + { + ...cw20BaseQueryKeys.address(contractAddress)[0], + method: 'minter', + args, + }, + ] as const, + allowance: (contractAddress: string, args?: Record) => + [ + { + ...cw20BaseQueryKeys.address(contractAddress)[0], + method: 'allowance', + args, + }, + ] as const, + allAllowances: (contractAddress: string, args?: Record) => + [ + { + ...cw20BaseQueryKeys.address(contractAddress)[0], + method: 'all_allowances', + args, + }, + ] as const, + allSpenderAllowances: ( + contractAddress: string, + args?: Record + ) => + [ + { + ...cw20BaseQueryKeys.address(contractAddress)[0], + method: 'all_spender_allowances', + args, + }, + ] as const, + allAccounts: (contractAddress: string, args?: Record) => + [ + { + ...cw20BaseQueryKeys.address(contractAddress)[0], + method: 'all_accounts', + args, + }, + ] as const, + marketingInfo: (contractAddress: string, args?: Record) => + [ + { + ...cw20BaseQueryKeys.address(contractAddress)[0], + method: 'marketing_info', + args, + }, + ] as const, + downloadLogo: (contractAddress: string, args?: Record) => + [ + { + ...cw20BaseQueryKeys.address(contractAddress)[0], + method: 'download_logo', + args, + }, + ] as const, +} +export const cw20BaseQueries = { + balance: ({ + chainId, + contractAddress, + args, + options, + }: Cw20BaseBalanceQuery): UseQueryOptions< + BalanceResponse, + Error, + TData + > => ({ + queryKey: cw20BaseQueryKeys.balance(contractAddress, args), + queryFn: async () => + new Cw20BaseQueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).balance({ + address: args.address, + }), + ...options, + }), + tokenInfo: ({ + chainId, + contractAddress, + options, + }: Cw20BaseTokenInfoQuery): UseQueryOptions< + TokenInfoResponse, + Error, + TData + > => ({ + queryKey: cw20BaseQueryKeys.tokenInfo(contractAddress), + queryFn: async () => + new Cw20BaseQueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).tokenInfo(), + ...options, + }), + minter: ({ + chainId, + contractAddress, + options, + }: Cw20BaseMinterQuery): UseQueryOptions< + MinterResponse, + Error, + TData + > => ({ + queryKey: cw20BaseQueryKeys.minter(contractAddress), + queryFn: async () => + new Cw20BaseQueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).minter(), + ...options, + }), + allowance: ({ + chainId, + contractAddress, + args, + options, + }: Cw20BaseAllowanceQuery): UseQueryOptions< + AllowanceResponse, + Error, + TData + > => ({ + queryKey: cw20BaseQueryKeys.allowance(contractAddress, args), + queryFn: async () => + new Cw20BaseQueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).allowance({ + owner: args.owner, + spender: args.spender, + }), + ...options, + }), + allAllowances: ({ + chainId, + contractAddress, + args, + options, + }: Cw20BaseAllAllowancesQuery): UseQueryOptions< + AllAllowancesResponse, + Error, + TData + > => ({ + queryKey: cw20BaseQueryKeys.allAllowances(contractAddress, args), + queryFn: async () => + new Cw20BaseQueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).allAllowances({ + limit: args.limit, + owner: args.owner, + startAfter: args.startAfter, + }), + ...options, + }), + allSpenderAllowances: ({ + chainId, + contractAddress, + args, + options, + }: Cw20BaseAllSpenderAllowancesQuery): UseQueryOptions< + AllSpenderAllowancesResponse, + Error, + TData + > => ({ + queryKey: cw20BaseQueryKeys.allSpenderAllowances(contractAddress, args), + queryFn: async () => + new Cw20BaseQueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).allSpenderAllowances({ + limit: args.limit, + spender: args.spender, + startAfter: args.startAfter, + }), + ...options, + }), + allAccounts: ({ + chainId, + contractAddress, + args, + options, + }: Cw20BaseAllAccountsQuery): UseQueryOptions< + AllAccountsResponse, + Error, + TData + > => ({ + queryKey: cw20BaseQueryKeys.allAccounts(contractAddress, args), + queryFn: async () => + new Cw20BaseQueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).allAccounts({ + limit: args.limit, + startAfter: args.startAfter, + }), + ...options, + }), + marketingInfo: ({ + chainId, + contractAddress, + options, + }: Cw20BaseMarketingInfoQuery): UseQueryOptions< + MarketingInfoResponse, + Error, + TData + > => ({ + queryKey: cw20BaseQueryKeys.marketingInfo(contractAddress), + queryFn: async () => + new Cw20BaseQueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).marketingInfo(), + ...options, + }), + downloadLogo: ({ + chainId, + contractAddress, + options, + }: Cw20BaseDownloadLogoQuery): UseQueryOptions< + DownloadLogoResponse, + Error, + TData + > => ({ + queryKey: cw20BaseQueryKeys.downloadLogo(contractAddress), + queryFn: async () => + new Cw20BaseQueryClient( + await cosmWasmClientRouter.connect(chainId), + contractAddress + ).downloadLogo(), + ...options, + }), +} +export interface Cw20BaseReactQuery { + chainId: string + contractAddress: string + options?: Omit< + UseQueryOptions, + 'queryKey' | 'queryFn' | 'initialData' + > & { + initialData?: undefined + } +} +export interface Cw20BaseDownloadLogoQuery + extends Cw20BaseReactQuery {} +export interface Cw20BaseMarketingInfoQuery + extends Cw20BaseReactQuery {} +export interface Cw20BaseAllAccountsQuery + extends Cw20BaseReactQuery { + args: { + limit?: number + startAfter?: string + } +} +export interface Cw20BaseAllSpenderAllowancesQuery + extends Cw20BaseReactQuery { + args: { + limit?: number + spender: string + startAfter?: string + } +} +export interface Cw20BaseAllAllowancesQuery + extends Cw20BaseReactQuery { + args: { + limit?: number + owner: string + startAfter?: string + } +} +export interface Cw20BaseAllowanceQuery + extends Cw20BaseReactQuery { + args: { + owner: string + spender: string + } +} +export interface Cw20BaseMinterQuery + extends Cw20BaseReactQuery {} +export interface Cw20BaseTokenInfoQuery + extends Cw20BaseReactQuery {} +export interface Cw20BaseBalanceQuery + extends Cw20BaseReactQuery { + args: { + address: string + } +} diff --git a/packages/state/query/queries/contracts/index.ts b/packages/state/query/queries/contracts/index.ts index a27e41ef0..fb2c0320d 100644 --- a/packages/state/query/queries/contracts/index.ts +++ b/packages/state/query/queries/contracts/index.ts @@ -1,4 +1,5 @@ export * from './Cw1Whitelist' +export * from './Cw20Base' export * from './Cw3FlexMultisig' export * from './DaoDaoCore' export * from './PolytoneNote' diff --git a/packages/state/query/queries/index.ts b/packages/state/query/queries/index.ts index cee7cc5a6..991727698 100644 --- a/packages/state/query/queries/index.ts +++ b/packages/state/query/queries/index.ts @@ -7,3 +7,5 @@ export * from './dao' export * from './indexer' export * from './polytone' export * from './profile' +export * from './skip' +export * from './token' diff --git a/packages/state/query/queries/skip.ts b/packages/state/query/queries/skip.ts new file mode 100644 index 000000000..49856e736 --- /dev/null +++ b/packages/state/query/queries/skip.ts @@ -0,0 +1,82 @@ +import { QueryClient, queryOptions } from '@tanstack/react-query' + +import { GenericTokenSource, SkipAsset, TokenType } from '@dao-dao/types' + +import { indexerQueries } from './indexer' + +/** + * Fetch Skip chain. + */ +export const fetchSkipChain = async ( + queryClient: QueryClient, + { + chainId, + }: { + chainId: string + } +): Promise => { + const chain = await queryClient.fetchQuery( + indexerQueries.snapper({ + query: 'skip-chain', + parameters: { + chainId, + }, + }) + ) + + if (!chain) { + throw new Error('No Skip chain found') + } + + return chain +} + +/** + * Fetch Skip asset. + */ +export const fetchSkipAsset = async ( + queryClient: QueryClient, + { type, chainId, denomOrAddress }: GenericTokenSource +): Promise => { + const asset = await queryClient.fetchQuery( + indexerQueries.snapper({ + query: 'skip-asset', + parameters: { + chainId, + denom: denomOrAddress, + cw20: (type === TokenType.Cw20).toString(), + }, + }) + ) + + if (!asset) { + throw new Error('No Skip asset found') + } + + return asset +} + +export const skipQueries = { + /** + * Fetch Skip chain. + */ + chain: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['skip', 'chain', options], + queryFn: () => fetchSkipChain(queryClient, options), + }), + /** + * Fetch Skip asset. + */ + asset: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['skip', 'asset', options], + queryFn: () => fetchSkipAsset(queryClient, options), + }), +} diff --git a/packages/state/query/queries/token.ts b/packages/state/query/queries/token.ts new file mode 100644 index 000000000..77e2f8b64 --- /dev/null +++ b/packages/state/query/queries/token.ts @@ -0,0 +1,314 @@ +import { QueryClient, queryOptions } from '@tanstack/react-query' + +import { GenericToken, GenericTokenSource, TokenType } from '@dao-dao/types' +import { + getChainForChainName, + getFallbackImage, + getIbcTransferInfoFromChannel, + getTokenForChainIdAndDenom, + ibcProtoRpcClientRouter, +} from '@dao-dao/utils' + +import { chainQueries } from './chain' +import { cw20BaseQueries } from './contracts' +import { indexerQueries } from './indexer' +import { skipQueries } from './skip' + +/** + * Fetch info for a token. + */ +export const fetchTokenInfo = async ( + queryClient: QueryClient, + { chainId, type, denomOrAddress }: GenericTokenSource +): Promise => { + const [source, asset] = await Promise.all([ + queryClient.fetchQuery( + tokenQueries.source(queryClient, { + chainId, + type, + denomOrAddress, + }) + ), + queryClient + .fetchQuery( + skipQueries.asset(queryClient, { + chainId, + type, + denomOrAddress, + }) + ) + .catch(() => undefined), + ]) + + if (asset) { + return { + chainId: asset.chain_id, + type: asset.is_cw20 ? TokenType.Cw20 : TokenType.Native, + denomOrAddress: (asset.is_cw20 && asset.token_contract) || asset.denom, + symbol: asset.recommended_symbol || asset.symbol || asset.denom, + decimals: asset.decimals || 0, + imageUrl: asset.logo_uri || getFallbackImage(denomOrAddress), + source, + } + } else if (source.chainId !== chainId) { + // If Skip API does not have the info, check if Skip API has the source + // if it's different. This has happened before when Skip does not have + // an IBC asset that we were able to reverse engineer the source for. + const sourceAsset = await queryClient.fetchQuery( + skipQueries.asset(queryClient, source) + ) + + if (sourceAsset) { + return { + chainId, + type, + denomOrAddress, + symbol: + sourceAsset.recommended_symbol || + sourceAsset.symbol || + sourceAsset.denom, + decimals: sourceAsset.decimals || 0, + imageUrl: sourceAsset.logo_uri || getFallbackImage(denomOrAddress), + source, + } + } + } + + if (type === TokenType.Cw20) { + const [tokenInfo, imageUrl] = await Promise.all([ + queryClient.fetchQuery( + cw20BaseQueries.tokenInfo({ + chainId, + contractAddress: denomOrAddress, + }) + ), + queryClient.fetchQuery( + tokenQueries.cw20LogoUrl(queryClient, { + chainId, + address: denomOrAddress, + }) + ), + ]) + + return { + chainId, + type, + denomOrAddress, + symbol: tokenInfo.symbol, + decimals: tokenInfo.decimals, + imageUrl: imageUrl || getFallbackImage(denomOrAddress), + source, + } + } + + // Attempt to fetch from local asset list, erroring if not found. + try { + return { + ...getTokenForChainIdAndDenom(chainId, denomOrAddress, false), + source, + } + } catch (err) { + console.error(err) + } + + // Attempt to fetch from chain. + try { + const chainMetadata = await queryClient.fetchQuery( + chainQueries.denomMetadata({ + chainId, + denom: denomOrAddress, + }) + ) + + if (chainMetadata) { + return { + chainId, + type, + denomOrAddress, + symbol: chainMetadata.preferredSymbol, + decimals: chainMetadata.preferredDecimals, + imageUrl: getFallbackImage(denomOrAddress), + source, + } + } + } catch (err) { + console.error(err) + } + + // If nothing found, just return empty token. + return { + chainId, + type: TokenType.Native, + denomOrAddress, + symbol: denomOrAddress, + decimals: 0, + imageUrl: getFallbackImage(denomOrAddress), + source, + } +} + +/** + * Resolve a denom on a chain to its source chain and base denom. If an IBC + * asset, reverse engineer IBC denom. Otherwise returns the inputs. + */ +export const fetchTokenSource = async ( + queryClient: QueryClient, + { chainId, type, denomOrAddress }: GenericTokenSource +): Promise => { + // Check if Skip API has the info. + const skipAsset = await queryClient.fetchQuery( + skipQueries.asset(queryClient, { + chainId, + type, + denomOrAddress, + }) + ) + + if (skipAsset) { + const sourceType = skipAsset.origin_denom.startsWith('cw20:') + ? TokenType.Cw20 + : TokenType.Native + return { + chainId: skipAsset.origin_chain_id, + type: sourceType, + denomOrAddress: + sourceType === TokenType.Cw20 + ? skipAsset.origin_denom.replace(/^cw20:/, '') + : skipAsset.origin_denom, + } + } + + let sourceChainId = chainId + let sourceDenom = (type === TokenType.Cw20 ? 'cw20:' : '') + denomOrAddress + + // Try to reverse engineer IBC denom. + if (denomOrAddress.startsWith('ibc/')) { + const ibc = await ibcProtoRpcClientRouter.connect(chainId) + + try { + const { denomTrace } = await ibc.applications.transfer.v1.denomTrace({ + hash: denomOrAddress, + }) + + // If trace exists, resolve IBC denom. + if (denomTrace) { + let channels = denomTrace.path.split('transfer/').slice(1) + // Trim trailing slash from all but last channel. + channels = channels.map((channel, index) => + index === channels.length - 1 ? channel : channel.slice(0, -1) + ) + if (channels.length) { + // Retrace channel paths to find source chain of denom. + sourceChainId = channels.reduce( + (currentChainId, channel) => + getChainForChainName( + getIbcTransferInfoFromChannel(currentChainId, channel) + .destinationChain.chain_name + ).chain_id, + chainId + ) + + sourceDenom = denomTrace.baseDenom + } + } + } catch (err) { + console.error(err) + // Ignore resolution error. + } + } + + const sourceType = sourceDenom.startsWith('cw20:') + ? TokenType.Cw20 + : TokenType.Native + + return { + chainId: sourceChainId, + type: sourceType, + denomOrAddress: + sourceType === TokenType.Cw20 + ? sourceDenom.replace(/^cw20:/, '') + : sourceDenom, + } +} + +/** + * Fetch the logo URL for a cw20 token if it exists. Returns null if not found. + */ +export const fetchCw20LogoUrl = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise => { + try { + const logoUrl = await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress: address, + formula: 'cw20/logoUrl', + }) + ) + return logoUrl ?? null + } catch (err) { + // Ignore error. + console.error(err) + } + + // If indexer query fails, fallback to contract query. + const logoInfo = ( + await queryClient + .fetchQuery( + cw20BaseQueries.marketingInfo({ + chainId, + contractAddress: address, + }) + ) + // Cw20 on some chains do not support marketing info. + .catch(() => undefined) + )?.logo + + return logoInfo && logoInfo !== 'embedded' && 'url' in logoInfo + ? logoInfo.url + : null +} + +export const tokenQueries = { + /** + * Fetch info for a token. + */ + info: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['token', 'info', options], + queryFn: () => fetchTokenInfo(queryClient, options), + }), + /** + * Resolve a denom on a chain to its source chain and base denom. If an IBC + * asset, reverse engineer IBC denom. Otherwise returns the inputs. + */ + source: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['token', 'source', options], + queryFn: () => fetchTokenSource(queryClient, options), + }), + /** + * Fetch the logo URL for a cw20 token if it exists. + */ + cw20LogoUrl: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['token', 'cw20LogoUrl', options], + queryFn: () => fetchCw20LogoUrl(queryClient, options), + }), +} diff --git a/packages/types/contracts/Cw20Base.ts b/packages/types/contracts/Cw20Base.ts index 4259a0b08..033a11e4f 100644 --- a/packages/types/contracts/Cw20Base.ts +++ b/packages/types/contracts/Cw20Base.ts @@ -1,5 +1,178 @@ -import { Addr, Binary, Expiration, Uint128 } from './common' +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ +export type Uint128 = string +export type Logo = + | { + url: string + } + | { + embedded: EmbeddedLogo + } +export type EmbeddedLogo = + | { + svg: Binary + } + | { + png: Binary + } +export type Binary = string +export interface InstantiateMsg { + decimals: number + initial_balances: Cw20Coin[] + marketing?: InstantiateMarketingInfo | null + mint?: MinterResponse | null + name: string + symbol: string +} +export interface Cw20Coin { + address: string + amount: Uint128 +} +export interface InstantiateMarketingInfo { + description?: string | null + logo?: Logo | null + marketing?: string | null + project?: string | null +} +export interface MinterResponse { + cap?: Uint128 | null + minter: string +} +export type ExecuteMsg = + | { + transfer: { + amount: Uint128 + recipient: string + } + } + | { + burn: { + amount: Uint128 + } + } + | { + send: { + amount: Uint128 + contract: string + msg: Binary + } + } + | { + increase_allowance: { + amount: Uint128 + expires?: Expiration | null + spender: string + } + } + | { + decrease_allowance: { + amount: Uint128 + expires?: Expiration | null + spender: string + } + } + | { + transfer_from: { + amount: Uint128 + owner: string + recipient: string + } + } + | { + send_from: { + amount: Uint128 + contract: string + msg: Binary + owner: string + } + } + | { + burn_from: { + amount: Uint128 + owner: string + } + } + | { + mint: { + amount: Uint128 + recipient: string + } + } + | { + update_minter: { + new_minter?: string | null + } + } + | { + update_marketing: { + description?: string | null + marketing?: string | null + project?: string | null + } + } + | { + upload_logo: Logo + } +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export type Timestamp = Uint64 +export type Uint64 = string +export type QueryMsg = + | { + balance: { + address: string + } + } + | { + token_info: {} + } + | { + minter: {} + } + | { + allowance: { + owner: string + spender: string + } + } + | { + all_allowances: { + limit?: number | null + owner: string + start_after?: string | null + } + } + | { + all_spender_allowances: { + limit?: number | null + spender: string + start_after?: string | null + } + } + | { + all_accounts: { + limit?: number | null + start_after?: string | null + } + } + | { + marketing_info: {} + } + | { + download_logo: {} + } export interface AllAccountsResponse { accounts: string[] } @@ -11,6 +184,14 @@ export interface AllowanceInfo { expires: Expiration spender: string } +export interface AllSpenderAllowancesResponse { + allowances: SpenderAllowanceInfo[] +} +export interface SpenderAllowanceInfo { + allowance: Uint128 + expires: Expiration + owner: string +} export interface AllowanceResponse { allowance: Uint128 expires: Expiration @@ -27,16 +208,13 @@ export type LogoInfo = | { url: string } +export type Addr = string export interface MarketingInfoResponse { description?: string | null logo?: LogoInfo | null marketing?: Addr | null project?: string | null } -export interface MinterResponse { - cap?: Uint128 | null - minter: string -} export interface TokenInfoResponse { decimals: number name: string diff --git a/packages/utils/chain.ts b/packages/utils/chain.ts index 8af739e8a..2066c1984 100644 --- a/packages/utils/chain.ts +++ b/packages/utils/chain.ts @@ -261,11 +261,18 @@ export const maybeGetNativeTokenForChainId = ( } const cachedTokens: Record = {} +/** + * Find a token in the local asset list, if it exists. Depending on the value of + * the `placeholder` argument, it will either return an empty token placeholder + * or error. + */ export const getTokenForChainIdAndDenom = ( chainId: string, denom: string, - // If true, will return placeholder token if not found. If false, will throw - // error. + /** + * If true, will return placeholder token if not found. If false, will throw + * error. + */ placeholder = true ): GenericToken => { try { From 0525d1b5d7114af77d6ed54e46cfe8975891f597 Mon Sep 17 00:00:00 2001 From: noah Date: Tue, 25 Jun 2024 16:58:02 -0400 Subject: [PATCH 271/438] Deploy on BitSong Mainnet (#1792) --- packages/i18n/locales/en/translation.json | 1 + packages/state/utils/DynamicGasPrice.ts | 2 +- .../components/SelfRelayExecuteModal.tsx | 45 +++---- .../GovernanceConfigurationInput.tsx | 21 ++- .../stateful/creators/TokenBased/index.ts | 4 +- .../components/inputs/SegmentedControls.tsx | 16 ++- packages/types/chain.ts | 6 +- .../types/components/SegmentedControls.ts | 11 +- packages/utils/constants/chains.ts | 121 +++++++++++++++++- 9 files changed, 177 insertions(+), 50 deletions(-) diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 85fea59a1..f932f683c 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -1301,6 +1301,7 @@ "today": "today", "token": "token", "tokenBurned": "NFT with ID {{tokenId}} has been burned.", + "tokenCreationUnderDevelopment": "Token creation is under development and will be available soon.", "tokenDaoNotMemberInfo_dao": "You are not a member of {{daoName}}. To become a member, you must obtain and stake ${{tokenSymbol}}.", "tokenDaoNotMemberInfo_proposal": "You were not a member of {{daoName}} when this proposal was created, so you cannot vote on it. You will be able to vote on future proposals as long as you have ${{tokenSymbol}} staked at the time those proposals are created.", "tokenOnChain": "${{token}} on {{chain}}", diff --git a/packages/state/utils/DynamicGasPrice.ts b/packages/state/utils/DynamicGasPrice.ts index 6aa543559..dc4693a40 100644 --- a/packages/state/utils/DynamicGasPrice.ts +++ b/packages/state/utils/DynamicGasPrice.ts @@ -36,9 +36,9 @@ export class DynamicGasPrice implements GasPrice { ) const gasPriceAmount = + feeToken?.low_gas_price ?? feeToken?.average_gas_price ?? feeToken?.high_gas_price ?? - feeToken?.low_gas_price ?? feeToken?.fixed_min_gas_price ?? 0 diff --git a/packages/stateful/components/SelfRelayExecuteModal.tsx b/packages/stateful/components/SelfRelayExecuteModal.tsx index 23a7106e1..3b8e0e91f 100644 --- a/packages/stateful/components/SelfRelayExecuteModal.tsx +++ b/packages/stateful/components/SelfRelayExecuteModal.tsx @@ -10,7 +10,6 @@ import { import { toHex } from '@cosmjs/encoding' import { DirectSecp256k1HdWallet, EncodeObject } from '@cosmjs/proto-signing' import { - GasPrice, IndexedTx, SigningStargateClient, calculateFee, @@ -19,6 +18,7 @@ import { } from '@cosmjs/stargate' import { ChainWalletBase } from '@cosmos-kit/core' import { Check, Close, Send, Verified } from '@mui/icons-material' +import { useQueryClient } from '@tanstack/react-query' import { MsgGrant as MsgGrantEncoder } from 'cosmjs-types/cosmos/authz/v1beta1/tx' import uniq from 'lodash.uniq' import { Fragment, useEffect, useState } from 'react' @@ -34,6 +34,7 @@ import { refreshPolytoneListenerResultsAtom, refreshWalletBalancesIdAtom, } from '@dao-dao/state/recoil' +import { DynamicGasPrice } from '@dao-dao/state/utils' import { Button, FlyingAnimation, @@ -97,15 +98,13 @@ const RELAYER_FUNDS_NEEDED: Partial> = { [ChainId.InjectiveMainnet]: 0.03 * 10 ** 18, [ChainId.TerraClassicMainnet]: 1000 * 10 ** 6, [ChainId.OmniflixHubMainnet]: 1 * 10 ** 6, + [ChainId.BitsongMainnet]: 10 * 10 ** 6, } type Relayer = { chain: Chain chainImageUrl: string - feeToken: { - denom: string - average_gas_price?: number - } + feeDenom: string wallet: { address: string signingStargateClient: SigningStargateClient @@ -124,6 +123,8 @@ export const SelfRelayExecuteModal = ({ visible, }: SelfRelayExecuteModalProps) => { const { t } = useTranslation() + const queryClient = useQueryClient() + const mnemonicKey = `relayer_mnemonic_${uniqueId}` // Current chain. @@ -237,11 +238,11 @@ export const SelfRelayExecuteModal = ({ const walletFunds = useCachedLoadingWithError( relayers ? waitForAll( - relayers.map(({ chain: { chain_id: chainId }, feeToken, wallet }) => + relayers.map(({ chain: { chain_id: chainId }, feeDenom, wallet }) => genericTokenBalanceSelector({ type: TokenType.Native, chainId, - denomOrAddress: feeToken.denom, + denomOrAddress: feeDenom, address: wallet.address, }) ) @@ -261,10 +262,10 @@ export const SelfRelayExecuteModal = ({ relayers ? waitForAll( relayers.map( - ({ chain: { chain_id: chainId }, feeToken, relayerAddress }) => + ({ chain: { chain_id: chainId }, feeDenom, relayerAddress }) => nativeDenomBalanceSelector({ walletAddress: relayerAddress, - denom: feeToken.denom, + denom: feeDenom, chainId, }) ) @@ -337,8 +338,8 @@ export const SelfRelayExecuteModal = ({ getImageUrlForChainId(chain.chain_id) || getFallbackImage(chain.chain_id) - const feeToken = chain.fees?.fee_tokens[0] - if (!feeToken) { + const feeDenom = chain.fees?.fee_tokens[0]?.denom + if (!feeDenom) { throw new Error(t('error.feeTokenNotFound')) } @@ -367,16 +368,14 @@ export const SelfRelayExecuteModal = ({ estimatedBlockTime: 3000, // How long it waits until looking for acks. estimatedIndexerTime: 3000, - gasPrice: GasPrice.fromString( - `${feeToken.average_gas_price ?? 0}${feeToken.denom}` - ), + gasPrice: new DynamicGasPrice(queryClient, chain), } ) return { chain, chainImageUrl, - feeToken, + feeDenom, wallet: { address, // cosmos-kit has an older version of the package. This is a @@ -432,7 +431,7 @@ export const SelfRelayExecuteModal = ({ // Get current balance of relayer wallet. const currentBalance = await relayer.client.query.bank.balance( relayer.relayerAddress, - relayer.feeToken.denom + relayer.feeDenom ) const fundsNeeded = @@ -450,7 +449,7 @@ export const SelfRelayExecuteModal = ({ send: { amount: coins( BigInt(fundsNeeded).toString(), - relayer.feeToken.denom + relayer.feeDenom ), to_address: relayer.relayerAddress, }, @@ -489,7 +488,7 @@ export const SelfRelayExecuteModal = ({ ( await relayer.client.query.bank.balance( relayer.relayerAddress, - relayer.feeToken.denom + relayer.feeDenom ) ).amount ) @@ -521,7 +520,7 @@ export const SelfRelayExecuteModal = ({ SendAuthorization.fromPartial({ spendLimit: coins( BigInt(newBalance).toString(), - relayer.feeToken.denom + relayer.feeDenom ), }) ), @@ -1350,11 +1349,7 @@ export const SelfRelayExecuteModal = ({ ...(relayers ? [relayers[0]] : []), ].map( ( - { - chain: { chain_id }, - chainImageUrl, - feeToken: { denom }, - }, + { chain: { chain_id }, chainImageUrl, feeDenom }, index ) => { // Adjust the index to reflect the reordering above. @@ -1369,7 +1364,7 @@ export const SelfRelayExecuteModal = ({ const refunded = refundedAmount[chain_id] ?? 0 const feeToken = getTokenForChainIdAndDenom( chain_id, - denom + feeDenom ) return ( diff --git a/packages/stateful/creators/TokenBased/GovernanceConfigurationInput.tsx b/packages/stateful/creators/TokenBased/GovernanceConfigurationInput.tsx index de0266d07..e1701a52d 100644 --- a/packages/stateful/creators/TokenBased/GovernanceConfigurationInput.tsx +++ b/packages/stateful/creators/TokenBased/GovernanceConfigurationInput.tsx @@ -323,18 +323,17 @@ export const GovernanceConfigurationInput = ({ <> setValue('creator.data.tokenType', tokenType)} selected={data.tokenType} tabs={[ - ...(config.noCreateNewTokens - ? [] - : [ - { - label: t('button.createAToken'), - value: GovernanceTokenType.New, - }, - ]), + { + label: t('button.createAToken'), + value: GovernanceTokenType.New, + disabled: config.tokenCreationUnderDevelopment, + tooltip: config.tokenCreationUnderDevelopment + ? t('info.tokenCreationUnderDevelopment') + : undefined, + }, { label: t('button.useExistingToken'), value: GovernanceTokenType.Existing, @@ -563,9 +562,7 @@ export const GovernanceConfigurationInput = ({ fieldName="creator.data.existingTokenDenomOrAddress" ghost placeholder={ - isCw20 - ? bech32Prefix + '...' - : `"denom" OR "ibc/HASH" OR "factory/${bech32Prefix}.../denom"` + isCw20 ? bech32Prefix + '...' : `denom OR ibc/HASH` } register={register} validation={[ diff --git a/packages/stateful/creators/TokenBased/index.ts b/packages/stateful/creators/TokenBased/index.ts index fad8ab69e..8518ac3c8 100644 --- a/packages/stateful/creators/TokenBased/index.ts +++ b/packages/stateful/creators/TokenBased/index.ts @@ -18,7 +18,7 @@ export const TokenBasedCreator: DaoCreator = { suppliesI18nKey: 'daoCreator.TokenBased.supplies', membershipI18nKey: 'daoCreator.TokenBased.membership', }, - makeDefaultConfig: ({ noCreateNewTokens = false }) => ({ + makeDefaultConfig: ({ tokenCreationUnderDevelopment = false }) => ({ tiers: [ { name: '', @@ -30,7 +30,7 @@ export const TokenBasedCreator: DaoCreator = { ], }, ], - tokenType: noCreateNewTokens + tokenType: tokenCreationUnderDevelopment ? GovernanceTokenType.Existing : GovernanceTokenType.New, newInfo: { diff --git a/packages/stateless/components/inputs/SegmentedControls.tsx b/packages/stateless/components/inputs/SegmentedControls.tsx index 00a751967..15db0f83d 100644 --- a/packages/stateless/components/inputs/SegmentedControls.tsx +++ b/packages/stateless/components/inputs/SegmentedControls.tsx @@ -80,9 +80,10 @@ export const SegmentedControls = ({ )} onMouseLeave={() => setHoveringIndex(undefined)} > - {tabs.map(({ label, value, tooltip }, index) => ( + {tabs.map(({ label, value, tooltip, disabled }, index) => ( ({ ref={onDropdownRef} >
- {moreTabs.map(({ label, value, tooltip }, index) => ( + {moreTabs.map(({ label, value, tooltip, disabled }, index) => ( + ) : ( <>

{t('info.logInToViewMembership')}

diff --git a/packages/stateful/components/dao/tabs/SubDaosTab.tsx b/packages/stateful/components/dao/tabs/SubDaosTab.tsx index 102509dee..1db14d71f 100644 --- a/packages/stateful/components/dao/tabs/SubDaosTab.tsx +++ b/packages/stateful/components/dao/tabs/SubDaosTab.tsx @@ -15,19 +15,19 @@ import { ButtonLink } from '../../ButtonLink' import { DaoCard } from '../DaoCard' export const SubDaosTab = () => { - const daoInfo = useDaoInfoContext() + const { chainId, coreAddress, supportedFeatures } = useDaoInfoContext() const { getDaoPath, getDaoProposalPath } = useDaoNavHelpers() - const { isMember = false } = useMembership(daoInfo) + const { isMember = false } = useMembership() const queryClient = useQueryClient() const subDaos = useQueryLoadingData( { ...daoQueries.subDaoInfos(queryClient, { - chainId: daoInfo.chainId, - coreAddress: daoInfo.coreAddress, + chainId, + coreAddress, }), - enabled: !!daoInfo.supportedFeatures[Feature.SubDaos], + enabled: !!supportedFeatures[Feature.SubDaos], }, [] ) @@ -39,10 +39,10 @@ export const SubDaosTab = () => { { const { t } = useTranslation() - const { chain_id: chainId } = useChain() - const treasuryUsdValueLoading = useCachedLoading( - daoTvlSelector({ - chainId, - coreAddress: COMMUNITY_POOL_ADDRESS_PLACEHOLDER, - }), - { - amount: -1, - timestamp: new Date(), - } - ) + const { dao } = useDaoContext() + const tvlLoading = useQueryLoadingData(dao.tvlQuery, { + amount: -1, + timestamp: Date.now(), + }) return ( { value: ( { const { t } = useTranslation() const { getDaoProposalPath } = useDaoNavHelpers() - const daoInfo = useDaoInfoContext() + const { + chainId, + coreAddress, + name, + contractAdmin, + supportedFeatures, + parentDao, + } = useDaoInfoContext() - const { isMember = false } = useMembership(daoInfo) - // If no parent, fallback to current DAO since it's already loaded from the - // above hook. We won't use this value unless there's a parent. It's redundant - // but has no effect. - const { isMember: isMemberOfParent = false } = useMembership( - daoInfo.parentDao ?? daoInfo - ) + const { isMember = false } = useMembership() + // We won't use this value unless there's a parent, so the undefined DAO + // override (which loads the current DAO) will be ignored. + const { isMember: isMemberOfParent = false } = useMembership({ + dao: parentDao || undefined, + }) const parentProposalRecognizeSubDaoHref = // Only show this prefill proposal link if the wallet is a member of the // parent. isMemberOfParent && // Only v2+ DAOs support SubDAOs. - daoInfo.supportedFeatures[Feature.SubDaos] && + supportedFeatures[Feature.SubDaos] && // Only show if the parent has not already registered this as a SubDAO. - daoInfo.parentDao && - !daoInfo.parentDao.registeredSubDao - ? getDaoProposalPath(daoInfo.parentDao.coreAddress, 'create', { + parentDao && + !parentDao.registeredSubDao + ? getDaoProposalPath(parentDao.coreAddress, 'create', { prefill: getDaoProposalSinglePrefill({ title: t('title.recognizeSubDao', { - name: daoInfo.name, + name: name, }), description: t('info.recognizeSubDaoDescription', { - name: daoInfo.name, + name: name, }), actions: [ { @@ -187,7 +193,7 @@ export const DaoDappHome = () => { data: { toAdd: [ { - addr: daoInfo.coreAddress, + addr: coreAddress, }, ], toRemove: [], @@ -201,31 +207,31 @@ export const DaoDappHome = () => { const proposeUpdateAdminToParentHref = // Only show if this DAO has a parent DAO but its contract-level admin is // set to itself. Only the current contract-level admin can change it. - daoInfo.parentDao && daoInfo.contractAdmin === daoInfo.coreAddress + parentDao && contractAdmin === coreAddress ? // Make proposal in SubDAO if current wallet is a member of the SubDAO or not a member of the parent DAO (just to make it clear that this is a prompt to fix it). isMember || !isMemberOfParent - ? getDaoProposalPath(daoInfo.coreAddress, 'create', { + ? getDaoProposalPath(coreAddress, 'create', { prefill: getDaoProposalSinglePrefill({ title: t('title.setAdminToParent', { - parent: daoInfo.parentDao.name, + parent: parentDao.name, }), description: t('info.parentDaoNotAdmin', { - child: daoInfo.name, - parent: daoInfo.parentDao.name, + child: name, + parent: parentDao.name, }) + ' ' + t('info.proposalFixesChildAdmin', { - child: daoInfo.name, - parent: daoInfo.parentDao.name, + child: name, + parent: parentDao.name, }), actions: [ { actionKey: ActionKey.UpdateAdmin, data: { - chainId: daoInfo.chainId, - contract: daoInfo.coreAddress, - newAdmin: daoInfo.parentDao.coreAddress, + chainId: chainId, + contract: coreAddress, + newAdmin: parentDao.coreAddress, }, }, ], @@ -233,34 +239,34 @@ export const DaoDappHome = () => { }) : // Make proposal in parent DAO if current wallet is a member. isMemberOfParent - ? getDaoProposalPath(daoInfo.parentDao.coreAddress, 'create', { + ? getDaoProposalPath(parentDao.coreAddress, 'create', { prefill: getDaoProposalSinglePrefill({ title: t('title.fixChildAdmin', { - child: daoInfo.name, + child: name, }), description: t('info.parentDaoNotAdmin', { - child: daoInfo.name, - parent: daoInfo.parentDao.name, + child: name, + parent: parentDao.name, }) + ' ' + t('info.proposalFixesChildAdmin', { - child: daoInfo.name, - parent: daoInfo.parentDao.name, + child: name, + parent: parentDao.name, }), actions: [ { actionKey: ActionKey.DaoAdminExec, data: { - coreAddress: daoInfo.coreAddress, + coreAddress: coreAddress, msgs: [], _actionData: [ { actionKey: ActionKey.UpdateAdmin, data: { - chainId: daoInfo.chainId, - contract: daoInfo.coreAddress, - newAdmin: daoInfo.parentDao.coreAddress, + chainId: chainId, + contract: coreAddress, + newAdmin: parentDao.coreAddress, }, }, ], diff --git a/packages/stateful/components/profile/ProfileActions.tsx b/packages/stateful/components/profile/ProfileActions.tsx index 16427d54d..f4bde3555 100644 --- a/packages/stateful/components/profile/ProfileActions.tsx +++ b/packages/stateful/components/profile/ProfileActions.tsx @@ -150,7 +150,7 @@ export const ProfileActions = () => { ) const encodeObjects = data.map((msg) => - cwMsgToEncodeObject(msg, walletAddress) + cwMsgToEncodeObject(chain.chain_id, msg, walletAddress) ) const tx = await signingCosmWasmClient.signAndBroadcast( walletAddress, diff --git a/packages/stateful/components/profile/ProfileProposalCard.tsx b/packages/stateful/components/profile/ProfileProposalCard.tsx index 1a0c50426..932a28b58 100644 --- a/packages/stateful/components/profile/ProfileProposalCard.tsx +++ b/packages/stateful/components/profile/ProfileProposalCard.tsx @@ -7,8 +7,7 @@ import { ProfileCantVoteCard, ProfileVoteCard, useCachedLoadable, - useChain, - useDaoInfoContext, + useDaoContext, } from '@dao-dao/stateless' import { CheckedDepositInfo } from '@dao-dao/types/contracts/common' @@ -25,8 +24,7 @@ export interface ProfileProposalCardProps { } export const ProfileProposalCard = () => { - const chain = useChain() - const { coreAddress, name: daoName, proposalModules } = useDaoInfoContext() + const { dao } = useDaoContext() const { profile, updateProfile: { go: updateProfile }, @@ -47,14 +45,11 @@ export const ProfileProposalCard = () => { const depositInfoSelectors = useMemo( () => - proposalModules.map( + dao.proposalModules.map( (proposalModule) => - matchAndLoadCommon(proposalModule, { - chain, - coreAddress, - }).selectors.depositInfo + matchAndLoadCommon(dao, proposalModule.address).selectors.depositInfo ), - [chain, coreAddress, proposalModules] + [dao] ) const proposalModuleDepositInfosLoadable = useCachedLoadable( waitForAll(depositInfoSelectors) @@ -82,9 +77,7 @@ export const ProfileProposalCard = () => { // If wallet is a member right now as opposed to when the proposal was open. // Relevant for showing them membership join info or not. - const { isMember = false } = useMembership({ - coreAddress, - }) + const { isMember = false } = useMembership() const loadingWalletVoteInfo = useLoadingWalletVoteInfo() @@ -101,7 +94,7 @@ export const ProfileProposalCard = () => { const commonProps = { votingPower: votingPowerPercent, - daoName, + daoName: dao.name, profile, showUpdateProfileNft: () => setUpdateProfileNftVisible(true), updateProfile, diff --git a/packages/stateful/components/wallet/WalletStakingModal.tsx b/packages/stateful/components/wallet/WalletStakingModal.tsx index fe86d64b8..613d9bb1a 100644 --- a/packages/stateful/components/wallet/WalletStakingModal.tsx +++ b/packages/stateful/components/wallet/WalletStakingModal.tsx @@ -39,7 +39,7 @@ export const WalletStakingModal = (props: WalletStakingModalProps) => { chain: { chain_id: chainId }, nativeToken, } = useChainContext() - const { address: walletAddress = '', getSigningCosmWasmClient } = useWallet() + const { address: walletAddress = '', getSigningStargateClient } = useWallet() if (!nativeToken) { throw new Error(t('error.missingNativeToken')) @@ -108,7 +108,7 @@ export const WalletStakingModal = (props: WalletStakingModalProps) => { setLoading(true) try { - const signingCosmWasmClient = await getSigningCosmWasmClient() + const signingClient = await getSigningStargateClient() const microAmount = convertDenomToMicroDenomStringWithDecimals( amount, @@ -116,10 +116,11 @@ export const WalletStakingModal = (props: WalletStakingModalProps) => { ) if (mode === StakingMode.Stake) { - await signingCosmWasmClient.signAndBroadcast( + await signingClient.signAndBroadcast( walletAddress, [ cwMsgToEncodeObject( + chainId, { staking: { delegate: { @@ -134,10 +135,11 @@ export const WalletStakingModal = (props: WalletStakingModalProps) => { CHAIN_GAS_MULTIPLIER ) } else if (mode === StakingMode.Unstake) { - await signingCosmWasmClient.signAndBroadcast( + await signingClient.signAndBroadcast( walletAddress, [ cwMsgToEncodeObject( + chainId, { staking: { undelegate: { diff --git a/packages/stateful/components/wallet/WalletTokenCard.tsx b/packages/stateful/components/wallet/WalletTokenCard.tsx index 658a2c24e..e87ff8acd 100644 --- a/packages/stateful/components/wallet/WalletTokenCard.tsx +++ b/packages/stateful/components/wallet/WalletTokenCard.tsx @@ -185,12 +185,13 @@ export const WalletTokenCard = (props: TokenCardInfo) => { throw new Error(t('error.logInToContinue')) } - const signingCosmWasmClient = await chainWallet.getSigningCosmWasmClient() + const signingCosmWasmClient = await chainWallet.getSigningStargateClient() await signingCosmWasmClient.signAndBroadcast( chainWallet.address, (lazyInfo.loading ? [] : lazyInfo.data.stakingInfo!.stakes).map( ({ validator }) => cwMsgToEncodeObject( + chainWallet.chainId, { distribution: { withdraw_delegator_reward: { diff --git a/packages/stateful/components/wallet/Web3AuthPromptModal.tsx b/packages/stateful/components/wallet/Web3AuthPromptModal.tsx index 615964517..151f0c743 100644 --- a/packages/stateful/components/wallet/Web3AuthPromptModal.tsx +++ b/packages/stateful/components/wallet/Web3AuthPromptModal.tsx @@ -11,8 +11,11 @@ import { Modal, } from '@dao-dao/stateless' import { ActionAndData, protobufToCwMsg } from '@dao-dao/types' -import { TxBody } from '@dao-dao/types/protobuf/codegen/cosmos/tx/v1beta1/tx' -import { decodeMessages } from '@dao-dao/utils' +import { + SignDoc, + TxBody, +} from '@dao-dao/types/protobuf/codegen/cosmos/tx/v1beta1/tx' +import { decodeMessages, getChainForChainId } from '@dao-dao/utils' import { useActionsForMatching } from '../../actions' import { WalletActionsProvider } from '../../actions/react/provider' @@ -32,7 +35,11 @@ export const Web3AuthPromptModal = () => { if (prompt.signData.type === 'direct') { const messages = decodeMessages( TxBody.decode(prompt.signData.value.bodyBytes).messages.map( - (msg) => protobufToCwMsg(msg).msg + (msg) => + protobufToCwMsg( + getChainForChainId((prompt.signData.value as SignDoc).chainId), + msg + ).msg ) ) diff --git a/packages/stateful/creators/MembershipBased/getInstantiateInfo.ts b/packages/stateful/creators/MembershipBased/getInstantiateInfo.ts new file mode 100644 index 000000000..381034d8c --- /dev/null +++ b/packages/stateful/creators/MembershipBased/getInstantiateInfo.ts @@ -0,0 +1,28 @@ +import { DaoCreatorGetInstantiateInfo } from '@dao-dao/types' +import { Member } from '@dao-dao/types/contracts/DaoVotingCw4' +import { isSecretNetwork } from '@dao-dao/utils' + +import { Cw4VotingModule } from '../../clients/voting-module/Cw4VotingModule' +import { SecretCw4VotingModule } from '../../clients/voting-module/Cw4VotingModule.secret' +import { CreatorData } from './types' + +export const getInstantiateInfo: DaoCreatorGetInstantiateInfo = ({ + chainConfig: { chainId }, + newDao: { name }, + data: { tiers }, +}) => + (isSecretNetwork(chainId) + ? SecretCw4VotingModule + : Cw4VotingModule + ).generateModuleInstantiateInfo(chainId, name, { + new: { + members: tiers.flatMap(({ weight, members }) => + members.map( + ({ address }): Member => ({ + addr: address, + weight, + }) + ) + ), + }, + }) diff --git a/packages/stateful/creators/MembershipBased/index.ts b/packages/stateful/creators/MembershipBased/index.ts index d14f93676..b661c18ca 100644 --- a/packages/stateful/creators/MembershipBased/index.ts +++ b/packages/stateful/creators/MembershipBased/index.ts @@ -2,9 +2,9 @@ import { HandshakeEmoji } from '@dao-dao/stateless' import { DaoCreator } from '@dao-dao/types' import { MembershipBasedCreatorId } from '@dao-dao/utils' +import { getInstantiateInfo } from './getInstantiateInfo' import { GovernanceConfigurationInput } from './GovernanceConfigurationInput' import { GovernanceConfigurationReview } from './GovernanceConfigurationReview' -import { mutate } from './mutate' export const MembershipBasedCreator: DaoCreator = { id: MembershipBasedCreatorId, @@ -35,5 +35,5 @@ export const MembershipBasedCreator: DaoCreator = { votingConfig: { items: [], }, - mutate, + getInstantiateInfo, } diff --git a/packages/stateful/creators/MembershipBased/instantiate_schema.json b/packages/stateful/creators/MembershipBased/instantiate_schema.json deleted file mode 100644 index 165b9c5a6..000000000 --- a/packages/stateful/creators/MembershipBased/instantiate_schema.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "InstantiateMsg", - "type": "object", - "required": ["group_contract"], - "properties": { - "group_contract": { - "$ref": "#/definitions/GroupContract" - } - }, - "additionalProperties": false, - "definitions": { - "GroupContract": { - "oneOf": [ - { - "type": "object", - "required": ["existing"], - "properties": { - "existing": { - "type": "object", - "required": ["address"], - "properties": { - "address": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": ["new"], - "properties": { - "new": { - "type": "object", - "required": ["cw4_group_code_id", "initial_members"], - "properties": { - "cw4_group_code_id": { - "type": "integer", - "minimum": 0.0 - }, - "initial_members": { - "type": "array", - "items": { - "$ref": "#/definitions/Member" - } - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "Member": { - "description": "A group member has a weight associated with them. This may all be equal, or may have meaning in the app that makes use of the group (eg. voting power)", - "type": "object", - "required": ["addr", "weight"], - "properties": { - "addr": { - "type": "string" - }, - "weight": { - "type": "integer", - "minimum": 0.0 - } - }, - "additionalProperties": false - } - } -} diff --git a/packages/stateful/creators/MembershipBased/mutate.ts b/packages/stateful/creators/MembershipBased/mutate.ts deleted file mode 100644 index dc3ca9df3..000000000 --- a/packages/stateful/creators/MembershipBased/mutate.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { DaoCreatorMutate } from '@dao-dao/types' -import { InstantiateMsg, Member } from '@dao-dao/types/contracts/DaoVotingCw4' -import { MembershipBasedCreatorId, encodeJsonToBase64 } from '@dao-dao/utils' -import { makeValidateMsg } from '@dao-dao/utils/validation/makeValidateMsg' - -import instantiateSchema from './instantiate_schema.json' -import { CreatorData } from './types' - -export const mutate: DaoCreatorMutate = ( - msg, - { name }, - { tiers }, - t, - codeIds -) => { - const initialMembers: Member[] = tiers.flatMap(({ weight, members }) => - members.map(({ address }) => ({ - addr: address, - weight, - })) - ) - - const newData = { - cw4_group_code_id: codeIds.Cw4Group, - initial_members: initialMembers, - } - - const votingModuleAdapterInstantiateMsg: InstantiateMsg = { - group_contract: { - new: newData, - }, - } - - // Validate and throw error if invalid according to JSON schema. - makeValidateMsg( - instantiateSchema, - t - )(votingModuleAdapterInstantiateMsg) - - msg.voting_module_instantiate_info = { - admin: { core_module: {} }, - code_id: codeIds.DaoVotingCw4, - label: `DAO_${name.trim()}_${MembershipBasedCreatorId}`, - msg: encodeJsonToBase64(votingModuleAdapterInstantiateMsg), - funds: [], - } - - return msg -} diff --git a/packages/stateful/creators/NftBased/GovernanceConfigurationInput.tsx b/packages/stateful/creators/NftBased/GovernanceConfigurationInput.tsx index 758cb1b3d..a839d8c42 100644 --- a/packages/stateful/creators/NftBased/GovernanceConfigurationInput.tsx +++ b/packages/stateful/creators/NftBased/GovernanceConfigurationInput.tsx @@ -1,16 +1,20 @@ import { useEffect } from 'react' import { useTranslation } from 'react-i18next' -import { constSelector, useRecoilValueLoadable } from 'recoil' +import { constSelector, useRecoilValueLoadable, waitForAll } from 'recoil' -import { CommonNftSelectors } from '@dao-dao/state' import { - FormattedJsonDisplay, + CommonNftSelectors, + secretContractCodeHashSelector, +} from '@dao-dao/state' +import { InputErrorMessage, + Loader, TextInput, useChain, } from '@dao-dao/stateless' import { DaoCreationGovernanceConfigInputProps } from '@dao-dao/types' import { + isSecretNetwork, isValidBech32Address, makeValidateAddress, validateRequired, @@ -34,56 +38,62 @@ export const GovernanceConfigurationInput = ({ const { chain_id: chainId, bech32_prefix: bech32Prefix } = useChain() //! Validate existing governance token. - const existingGovernanceTokenDenomOrAddress = + const existingGovernanceNftCollectionAddress = data.tokenType === GovernanceTokenType.Existing - ? data.existingGovernanceTokenDenomOrAddress + ? data.existingGovernanceNftCollectionAddress : undefined - const existingGovernanceTokenInfoLoadable = useRecoilValueLoadable( - existingGovernanceTokenDenomOrAddress && - isValidBech32Address(existingGovernanceTokenDenomOrAddress, bech32Prefix) - ? CommonNftSelectors.contractInfoSelector({ - chainId, - contractAddress: existingGovernanceTokenDenomOrAddress, - params: [], - }) - : constSelector(undefined) - ) - const numOfTokensLoadable = useRecoilValueLoadable( - existingGovernanceTokenDenomOrAddress && - isValidBech32Address(existingGovernanceTokenDenomOrAddress, bech32Prefix) - ? CommonNftSelectors.numTokensSelector({ - chainId, - contractAddress: existingGovernanceTokenDenomOrAddress, - params: [], - }) + const collectionInfoLoadable = useRecoilValueLoadable( + existingGovernanceNftCollectionAddress && + isValidBech32Address(existingGovernanceNftCollectionAddress, bech32Prefix) + ? waitForAll([ + CommonNftSelectors.contractInfoSelector({ + chainId, + contractAddress: existingGovernanceNftCollectionAddress, + params: [], + }), + CommonNftSelectors.numTokensSelector({ + chainId, + contractAddress: existingGovernanceNftCollectionAddress, + params: [], + }), + isSecretNetwork(chainId) + ? secretContractCodeHashSelector({ + chainId, + contractAddress: existingGovernanceNftCollectionAddress, + }) + : constSelector(undefined), + ]) : constSelector(undefined) ) useEffect(() => { - setValue( - 'creator.data.existingGovernanceTokenInfo', - existingGovernanceTokenInfoLoadable.state === 'hasValue' - ? existingGovernanceTokenInfoLoadable.contents - : undefined - ) + if (isSecretNetwork(chainId)) { + setValue( + 'creator.data.secretCodeHash', + collectionInfoLoadable.valueMaybe()?.[2] + ? collectionInfoLoadable.contents[2] + : undefined + ) + } - if (existingGovernanceTokenInfoLoadable.state !== 'hasError') { - if (errors?.creator?.data?.existingGovernanceTokenInfo) { - clearErrors('creator.data.existingGovernanceTokenInfo._error') + if (collectionInfoLoadable.state !== 'hasError') { + if (errors?.creator?.data?._existingError) { + clearErrors('creator.data._existingError') } return } - if (!errors?.creator?.data?.existingGovernanceTokenInfo) { - setError('creator.data.existingGovernanceTokenInfo._error', { + if (!errors?.creator?.data?._existingError) { + setError('creator.data._existingError', { type: 'manual', message: t('error.failedToGetTokenInfo', { tokenType: 'CW721' }), }) } }, [ + chainId, clearErrors, - errors?.creator?.data?.existingGovernanceTokenInfo, - existingGovernanceTokenInfoLoadable, + collectionInfoLoadable, + errors?.creator?.data?._existingError, setError, setValue, t, @@ -103,9 +113,9 @@ export const GovernanceConfigurationInput = ({
- - + + {collectionInfoLoadable.state === 'loading' ? ( + + ) : collectionInfoLoadable.state === 'hasValue' ? ( +

+ ${collectionInfoLoadable.valueMaybe()?.[0].symbol} +

+ ) : ( + + )}
diff --git a/packages/stateful/creators/NftBased/GovernanceConfigurationReview.tsx b/packages/stateful/creators/NftBased/GovernanceConfigurationReview.tsx index 3cc85b314..b0f0d5b8d 100644 --- a/packages/stateful/creators/NftBased/GovernanceConfigurationReview.tsx +++ b/packages/stateful/creators/NftBased/GovernanceConfigurationReview.tsx @@ -2,33 +2,21 @@ import { useTranslation } from 'react-i18next' import { useRecoilValueLoadable } from 'recoil' import { CommonNftSelectors } from '@dao-dao/state' -import { - CopyToClipboard, - FormattedJsonDisplay, - useChain, -} from '@dao-dao/stateless' +import { CopyToClipboard, Loader, useChain } from '@dao-dao/stateless' import { DaoCreationGovernanceConfigReviewProps } from '@dao-dao/types' import { CreatorData } from './types' export const GovernanceConfigurationReview = ({ - data: { existingGovernanceTokenDenomOrAddress }, + data: { existingGovernanceNftCollectionAddress }, }: DaoCreationGovernanceConfigReviewProps) => { const { t } = useTranslation() const { chain_id: chainId } = useChain() - const existingGovernanceTokenInfoLoadable = useRecoilValueLoadable( + const collectionInfoLoadable = useRecoilValueLoadable( CommonNftSelectors.contractInfoSelector({ chainId, - contractAddress: existingGovernanceTokenDenomOrAddress, - params: [], - }) - ) - - const numOfTokensLoadable = useRecoilValueLoadable( - CommonNftSelectors.numTokensSelector({ - chainId, - contractAddress: existingGovernanceTokenDenomOrAddress, + contractAddress: existingGovernanceNftCollectionAddress, params: [], }) ) @@ -44,17 +32,18 @@ export const GovernanceConfigurationReview = ({
- - + {collectionInfoLoadable.state === 'loading' ? ( + + ) : ( + collectionInfoLoadable.state === 'hasValue' && ( +

+ ${collectionInfoLoadable.valueMaybe()?.symbol} +

+ ) + )}
) diff --git a/packages/stateful/creators/NftBased/getInstantiateInfo.ts b/packages/stateful/creators/NftBased/getInstantiateInfo.ts new file mode 100644 index 000000000..a8f07dc82 --- /dev/null +++ b/packages/stateful/creators/NftBased/getInstantiateInfo.ts @@ -0,0 +1,52 @@ +import { DaoCreatorGetInstantiateInfo } from '@dao-dao/types' +import { + convertDurationWithUnitsToDuration, + isSecretNetwork, +} from '@dao-dao/utils' + +import { Cw721StakedVotingModule } from '../../clients/voting-module/Cw721StakedVotingModule' +import { SecretSnip721StakedVotingModule } from '../../clients/voting-module/Snip721StakedVotingModule.secret' +import { CreatorData } from './types' + +export const getInstantiateInfo: DaoCreatorGetInstantiateInfo = ({ + chainConfig: { chainId }, + newDao: { name }, + data: { + existingGovernanceNftCollectionAddress, + secretCodeHash, + unstakingDuration, + activeThreshold, + }, +}) => { + if (isSecretNetwork(chainId) && !secretCodeHash) { + throw new Error('SNIP721 code hash is missing') + } + + return ( + isSecretNetwork(chainId) + ? SecretSnip721StakedVotingModule + : Cw721StakedVotingModule + ).generateModuleInstantiateInfo(chainId, name, { + activeThreshold: activeThreshold?.enabled + ? !activeThreshold.type || activeThreshold.type === 'percent' + ? { + percentage: { + percent: (activeThreshold.value / 100).toString(), + }, + } + : { + absolute_count: { + count: BigInt(activeThreshold.value).toString(), + }, + } + : null, + nft: { + existing: { + address: existingGovernanceNftCollectionAddress, + // Type-checked above. + codeHash: secretCodeHash || '', + }, + }, + unstakingDuration: convertDurationWithUnitsToDuration(unstakingDuration), + }) +} diff --git a/packages/stateful/creators/NftBased/index.ts b/packages/stateful/creators/NftBased/index.ts index 34493a6c1..87c3fb2cf 100644 --- a/packages/stateful/creators/NftBased/index.ts +++ b/packages/stateful/creators/NftBased/index.ts @@ -4,9 +4,9 @@ import { NftBasedCreatorId } from '@dao-dao/utils' import { makeActiveThresholdVotingConfigItem } from '../../components/dao/commonVotingConfig/ActiveThresholdVotingConfigItem' import { GovernanceTokenType } from '../TokenBased/types' +import { getInstantiateInfo } from './getInstantiateInfo' import { GovernanceConfigurationInput } from './GovernanceConfigurationInput' import { GovernanceConfigurationReview } from './GovernanceConfigurationReview' -import { mutate } from './mutate' import { UnstakingDurationVotingConfigItem } from './UnstakingDurationVotingConfigItem' export const NftBasedCreator: DaoCreator = { @@ -20,7 +20,7 @@ export const NftBasedCreator: DaoCreator = { }, makeDefaultConfig: () => ({ tokenType: GovernanceTokenType.Existing, - existingGovernanceTokenDenomOrAddress: '', + existingGovernanceNftCollectionAddress: '', unstakingDuration: { value: 2, units: DurationUnits.Weeks, @@ -34,5 +34,5 @@ export const NftBasedCreator: DaoCreator = { items: [UnstakingDurationVotingConfigItem], advancedItems: [makeActiveThresholdVotingConfigItem()], }, - mutate, + getInstantiateInfo, } diff --git a/packages/stateful/creators/NftBased/instantiate_schema.json b/packages/stateful/creators/NftBased/instantiate_schema.json deleted file mode 100644 index 0006a0c5a..000000000 --- a/packages/stateful/creators/NftBased/instantiate_schema.json +++ /dev/null @@ -1,190 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "InstantiateMsg", - "type": "object", - "required": ["nft_contract"], - "properties": { - "active_threshold": { - "description": "The number or percentage of tokens that must be staked for the DAO to be active", - "anyOf": [ - { - "$ref": "#/definitions/ActiveThreshold" - }, - { - "type": "null" - } - ] - }, - "nft_contract": { - "description": "Address of the cw721 NFT contract that may be staked.", - "allOf": [ - { - "$ref": "#/definitions/NftContract" - } - ] - }, - "unstaking_duration": { - "description": "Amount of time between unstaking and tokens being avaliable. To unstake with no delay, leave as `None`.", - "anyOf": [ - { - "$ref": "#/definitions/Duration" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false, - "definitions": { - "ActiveThreshold": { - "description": "The threshold of tokens that must be staked in order for this voting module to be active. If this is not reached, this module will response to `is_active` queries with false and proposal modules which respect active thresholds will not allow the creation of proposals.", - "oneOf": [ - { - "description": "The absolute number of tokens that must be staked for the module to be active.", - "type": "object", - "required": ["absolute_count"], - "properties": { - "absolute_count": { - "type": "object", - "required": ["count"], - "properties": { - "count": { - "$ref": "#/definitions/Uint128" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "The percentage of tokens that must be staked for the module to be active. Computed as `staked / total_supply`.", - "type": "object", - "required": ["percentage"], - "properties": { - "percentage": { - "type": "object", - "required": ["percent"], - "properties": { - "percent": { - "$ref": "#/definitions/Decimal" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "Binary": { - "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", - "type": "string" - }, - "Decimal": { - "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", - "type": "string" - }, - "Duration": { - "description": "Duration is a delta of time. You can add it to a BlockInfo or Expiration to move that further in the future. Note that an height-based Duration and a time-based Expiration cannot be combined", - "oneOf": [ - { - "type": "object", - "required": ["height"], - "properties": { - "height": { - "type": "integer", - "minimum": 0.0 - } - }, - "additionalProperties": false - }, - { - "description": "Time in seconds", - "type": "object", - "required": ["time"], - "properties": { - "time": { - "type": "integer", - "minimum": 0.0 - } - }, - "additionalProperties": false - } - ] - }, - "NftContract": { - "oneOf": [ - { - "description": "Uses an existing cw721 or sg721 token contract.", - "type": "object", - "required": ["existing"], - "properties": { - "existing": { - "type": "object", - "required": ["address"], - "properties": { - "address": { - "description": "Address of an already instantiated cw721 or sg721 token contract.", - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Creates a new NFT collection used for staking and governance.", - "type": "object", - "required": ["new"], - "properties": { - "new": { - "type": "object", - "required": ["code_id", "initial_nfts", "label", "msg"], - "properties": { - "code_id": { - "description": "Code ID for cw721 token contract.", - "type": "integer", - "minimum": 0.0 - }, - "initial_nfts": { - "description": "Initial NFTs to mint when creating the NFT contract. If empty, an error is thrown. The binary should be a valid mint message for the corresponding cw721 contract.", - "type": "array", - "items": { - "$ref": "#/definitions/Binary" - } - }, - "label": { - "description": "Label to use for instantiated cw721 contract.", - "type": "string" - }, - "msg": { - "$ref": "#/definitions/Binary" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Uses a factory contract that must return the address of the NFT contract. The binary must serialize to a `WasmMsg::Execute` message. Validation happens in the factory contract itself, so be sure to use a trusted factory contract.", - "type": "object", - "required": ["factory"], - "properties": { - "factory": { - "$ref": "#/definitions/Binary" - } - }, - "additionalProperties": false - } - ] - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - } - } -} diff --git a/packages/stateful/creators/NftBased/mutate.ts b/packages/stateful/creators/NftBased/mutate.ts deleted file mode 100644 index e9963e7e7..000000000 --- a/packages/stateful/creators/NftBased/mutate.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { ActiveThreshold, DaoCreatorMutate } from '@dao-dao/types' -import { InstantiateMsg } from '@dao-dao/types/contracts/DaoVotingCw721Staked' -import { - NftBasedCreatorId, - convertDurationWithUnitsToDuration, - encodeJsonToBase64, -} from '@dao-dao/utils' -import { makeValidateMsg } from '@dao-dao/utils/validation/makeValidateMsg' - -import instantiateSchema from './instantiate_schema.json' -import { CreatorData } from './types' - -export const mutate: DaoCreatorMutate = ( - msg, - { name: daoName }, - { existingGovernanceTokenDenomOrAddress, unstakingDuration, activeThreshold }, - t, - codeIds -) => { - if (!existingGovernanceTokenDenomOrAddress) { - throw new Error(t('error.missingGovernanceTokenAddress')) - } - - const active_threshold: ActiveThreshold | null = activeThreshold?.enabled - ? !activeThreshold.type || activeThreshold.type === 'percent' - ? { - percentage: { - percent: (activeThreshold.value / 100).toString(), - }, - } - : { - absolute_count: { - count: BigInt(activeThreshold.value).toString(), - }, - } - : null - - const votingModuleAdapterInstantiateMsg: InstantiateMsg = { - active_threshold, - nft_contract: { - existing: { - address: existingGovernanceTokenDenomOrAddress, - }, - }, - unstaking_duration: convertDurationWithUnitsToDuration(unstakingDuration), - } - - // Validate and throw error if invalid according to JSON schema. - makeValidateMsg( - instantiateSchema, - t - )(votingModuleAdapterInstantiateMsg) - - msg.voting_module_instantiate_info = { - admin: { core_module: {} }, - code_id: codeIds.DaoVotingCw721Staked, - label: `DAO_${daoName.trim()}_${NftBasedCreatorId}`, - msg: encodeJsonToBase64(votingModuleAdapterInstantiateMsg), - funds: [], - } - - return msg -} diff --git a/packages/stateful/creators/NftBased/types.ts b/packages/stateful/creators/NftBased/types.ts index 0e5452dd3..55da2f317 100644 --- a/packages/stateful/creators/NftBased/types.ts +++ b/packages/stateful/creators/NftBased/types.ts @@ -10,13 +10,9 @@ export enum GovernanceTokenType { export type CreatorData = { tokenType: GovernanceTokenType - existingGovernanceTokenDenomOrAddress: string - // TokenInfoResponse - existingGovernanceTokenInfo?: { - name: string - symbol: string - total_supply?: string - _error?: undefined - } + existingGovernanceNftCollectionAddress: string + _existingError?: any + // Must be loaded on Secret Network. + secretCodeHash?: string unstakingDuration: DurationWithUnits } & DaoCreationVotingConfigWithActiveThreshold diff --git a/packages/stateful/creators/TokenBased/GovernanceConfigurationInput.tsx b/packages/stateful/creators/TokenBased/GovernanceConfigurationInput.tsx index e1701a52d..c814165f0 100644 --- a/packages/stateful/creators/TokenBased/GovernanceConfigurationInput.tsx +++ b/packages/stateful/creators/TokenBased/GovernanceConfigurationInput.tsx @@ -582,13 +582,14 @@ export const GovernanceConfigurationInput = ({ {existingGovernanceTokenLoadable.state === 'loading' ? ( + ) : existingGovernanceTokenLoadable.state === 'hasValue' ? ( +

+ ${existingGovernanceTokenLoadable.valueMaybe()?.symbol} +

) : ( - existingGovernanceTokenLoadable.state === 'hasValue' && - !!existingGovernanceTokenLoadable.contents && ( -

- ${existingGovernanceTokenLoadable.contents?.symbol} -

- ) + )}
diff --git a/packages/stateful/creators/TokenBased/UnstakingDurationVotingConfigItem.tsx b/packages/stateful/creators/TokenBased/UnstakingDurationVotingConfigItem.tsx index ea5964bf1..957a2eb75 100644 --- a/packages/stateful/creators/TokenBased/UnstakingDurationVotingConfigItem.tsx +++ b/packages/stateful/creators/TokenBased/UnstakingDurationVotingConfigItem.tsx @@ -1,6 +1,9 @@ +import { useEffect } from 'react' import { UseFormWatch } from 'react-hook-form' import { useTranslation } from 'react-i18next' +import { constSelector, useRecoilValueLoadable } from 'recoil' +import { secretContractCodeHashSelector } from '@dao-dao/state/recoil' import { ClockEmoji, InputErrorMessage, @@ -18,6 +21,8 @@ import { } from '@dao-dao/types' import { convertDurationWithUnitsToHumanReadableString, + isSecretNetwork, + isValidBech32Address, makeValidateAddress, validatePositive, validateRequired, @@ -38,6 +43,7 @@ export const UnstakingDurationInput = ({ const holdingAltForCustomStaking = useHoldingKey({ key: 'alt' }) const { + chainId, chain: { bech32_prefix: bech32Prefix }, config: { createWithCw20 }, } = useSupportedChainContext() @@ -45,6 +51,28 @@ export const UnstakingDurationInput = ({ const showCustomStakingAddress = createWithCw20 && customStakingAddress !== undefined + // Load custom staking contract code hash on Secret Network. + const customStakingCodeHashLoadable = useRecoilValueLoadable( + isSecretNetwork(chainId) && + customStakingAddress && + isValidBech32Address(customStakingAddress, bech32Prefix) + ? secretContractCodeHashSelector({ + chainId, + contractAddress: customStakingAddress, + }) + : constSelector(undefined) + ) + useEffect(() => { + if (!isSecretNetwork(chainId)) { + return + } + + setValue( + 'customStakingCodeHash', + customStakingCodeHashLoadable.valueMaybe() + ) + }, [setValue, chainId, customStakingCodeHashLoadable]) + return ( <> {createWithCw20 && @@ -79,7 +107,12 @@ export const UnstakingDurationInput = ({ watch={watch as UseFormWatch} /> - +
) : (
diff --git a/packages/stateful/creators/TokenBased/getInstantiateInfo.ts b/packages/stateful/creators/TokenBased/getInstantiateInfo.ts new file mode 100644 index 000000000..add38945a --- /dev/null +++ b/packages/stateful/creators/TokenBased/getInstantiateInfo.ts @@ -0,0 +1,203 @@ +import { DaoCreatorGetInstantiateInfo } from '@dao-dao/types' +import { InitialBalance } from '@dao-dao/types/contracts/DaoVotingTokenStaked' +import { + NEW_DAO_TOKEN_DECIMALS, + convertDenomToMicroDenomStringWithDecimals, + convertDenomToMicroDenomWithDecimals, + convertDurationWithUnitsToDuration, + isSecretNetwork, +} from '@dao-dao/utils' + +import { Cw20StakedVotingModule } from '../../clients/voting-module/Cw20StakedVotingModule' +import { SecretSnip20StakedVotingModule } from '../../clients/voting-module/Snip20StakedVotingModule.secret' +import { TokenStakedVotingModule } from '../../clients/voting-module/TokenStakedVotingModule' +import { SecretTokenStakedVotingModule } from '../../clients/voting-module/TokenStakedVotingModule.secret' +import { CreatorData, GovernanceTokenType } from './types' + +export const getInstantiateInfo: DaoCreatorGetInstantiateInfo = ({ + chainConfig: { createWithCw20 }, + newDao: { chainId, name: daoName }, + data: { + tiers, + tokenType, + newInfo: { initialSupply, imageUrl, symbol, name }, + existingTokenDenomOrAddress, + existingToken, + unstakingDuration: unstakingDurationWithUnits, + customStakingAddress, + customStakingCodeHash, + activeThreshold, + tokenFactoryDenomCreationFee, + }, + t, +}) => { + const isNative = !createWithCw20 + const isSecret = isSecretNetwork(chainId) + + const commonConfig = { + activeThreshold: activeThreshold?.enabled + ? !activeThreshold.type || activeThreshold.type === 'percent' + ? { + percentage: { + percent: (activeThreshold.value / 100).toString(), + }, + } + : { + absolute_count: { + count: BigInt(activeThreshold.value).toString(), + }, + } + : null, + } + const unstakingDuration = + unstakingDurationWithUnits.value === 0 + ? null + : convertDurationWithUnitsToDuration(unstakingDurationWithUnits) + + if (tokenType === GovernanceTokenType.New) { + const microInitialBalances: InitialBalance[] = tiers.flatMap( + ({ weight, members }) => + members.map(({ address }) => ({ + address, + amount: convertDenomToMicroDenomStringWithDecimals( + // Governance Token-based DAOs distribute tier weights evenly + // amongst members. + (weight / members.length / 100) * initialSupply, + NEW_DAO_TOKEN_DECIMALS + ), + })) + ) + // To prevent rounding issues, treasury balance becomes the remaining tokens + // after the member weights are distributed. + const microInitialTreasuryBalance = BigInt( + convertDenomToMicroDenomWithDecimals( + initialSupply, + NEW_DAO_TOKEN_DECIMALS + ) - + microInitialBalances.reduce( + (acc, { amount }) => acc + Number(amount), + 0 + ) + ).toString() + + // Secret Network only supports creating new CW20 DAOs (SNIP20). Native + // tokens are supported on other chains. This should never happen, but just + // in case... + if (isSecret && isNative) { + throw new Error( + 'Creating native tokens is not supported on Secret Network.' + ) + } + + return isNative + ? TokenStakedVotingModule.generateModuleInstantiateInfo( + chainId, + daoName, + { + ...commonConfig, + unstakingDuration, + token: { + new: { + symbol, + decimals: NEW_DAO_TOKEN_DECIMALS, + name, + initialBalances: microInitialBalances, + initialDaoBalance: microInitialTreasuryBalance, + funds: tokenFactoryDenomCreationFee, + }, + }, + } + ) + : (isSecret + ? SecretSnip20StakedVotingModule + : Cw20StakedVotingModule + ).generateModuleInstantiateInfo(chainId, daoName, { + ...commonConfig, + token: { + new: { + symbol, + decimals: NEW_DAO_TOKEN_DECIMALS, + name: symbol, + initialBalances: microInitialBalances, + initialDaoBalance: microInitialTreasuryBalance, + marketingInfo: imageUrl ? { logo: { url: imageUrl } } : null, + unstakingDuration, + }, + }, + }) + } else { + if (!existingTokenDenomOrAddress) { + throw new Error(t('error.missingGovernanceTokenDenom')) + } + + if (isSecret && !isNative && !existingToken?.snip20CodeHash) { + throw new Error('SNIP20 code hash not found') + } + if (isSecret && !isNative && !customStakingCodeHash) { + throw new Error('Custom staking contract code hash not found') + } + + return isNative + ? (isSecret + ? SecretTokenStakedVotingModule + : TokenStakedVotingModule + ).generateModuleInstantiateInfo(chainId, daoName, { + ...commonConfig, + unstakingDuration, + token: { + existing: { + denom: existingTokenDenomOrAddress, + }, + }, + }) + : isSecret + ? SecretSnip20StakedVotingModule.generateModuleInstantiateInfo( + chainId, + daoName, + { + ...commonConfig, + token: { + existing: { + address: existingTokenDenomOrAddress, + // Type-checked above. + codeHash: existingToken!.snip20CodeHash!, + stakingContract: + customStakingAddress !== undefined + ? { + existing: { + address: customStakingAddress, + // Type-checked above. + codeHash: customStakingCodeHash!, + }, + } + : { + new: { + unstakingDuration, + }, + }, + }, + }, + } + ) + : Cw20StakedVotingModule.generateModuleInstantiateInfo(chainId, daoName, { + ...commonConfig, + token: { + existing: { + address: existingTokenDenomOrAddress, + stakingContract: + customStakingAddress !== undefined + ? { + existing: { + address: customStakingAddress, + }, + } + : { + new: { + unstakingDuration, + }, + }, + }, + }, + }) + } +} diff --git a/packages/stateful/creators/TokenBased/index.ts b/packages/stateful/creators/TokenBased/index.ts index 8518ac3c8..b044a959e 100644 --- a/packages/stateful/creators/TokenBased/index.ts +++ b/packages/stateful/creators/TokenBased/index.ts @@ -3,9 +3,9 @@ import { DaoCreator, DurationUnits } from '@dao-dao/types' import { TokenBasedCreatorId } from '@dao-dao/utils' import { makeActiveThresholdVotingConfigItem } from '../../components/dao/commonVotingConfig/ActiveThresholdVotingConfigItem' +import { getInstantiateInfo } from './getInstantiateInfo' import { GovernanceConfigurationInput } from './GovernanceConfigurationInput' import { GovernanceConfigurationReview } from './GovernanceConfigurationReview' -import { mutate } from './mutate' import { CreatorData, GovernanceTokenType } from './types' import { UnstakingDurationVotingConfigItem } from './UnstakingDurationVotingConfigItem' @@ -58,5 +58,5 @@ export const TokenBasedCreator: DaoCreator = { items: [UnstakingDurationVotingConfigItem], advancedItems: [makeActiveThresholdVotingConfigItem()], }, - mutate, + getInstantiateInfo, } diff --git a/packages/stateful/creators/TokenBased/instantiate_schema_cw20.json b/packages/stateful/creators/TokenBased/instantiate_schema_cw20.json deleted file mode 100644 index d79de71fa..000000000 --- a/packages/stateful/creators/TokenBased/instantiate_schema_cw20.json +++ /dev/null @@ -1,362 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "InstantiateMsg", - "type": "object", - "required": ["token_info"], - "properties": { - "active_threshold": { - "description": "The number or percentage of tokens that must be staked for the DAO to be active", - "anyOf": [ - { - "$ref": "#/definitions/ActiveThreshold" - }, - { - "type": "null" - } - ] - }, - "token_info": { - "$ref": "#/definitions/TokenInfo" - } - }, - "additionalProperties": false, - "definitions": { - "ActiveThreshold": { - "description": "The threshold of tokens that must be staked in order for this voting module to be active. If this is not reached, this module will response to `is_active` queries with false and proposal modules which respect active thresholds will not allow the creation of proposals.", - "oneOf": [ - { - "description": "The absolute number of tokens that must be staked for the module to be active.", - "type": "object", - "required": ["absolute_count"], - "properties": { - "absolute_count": { - "type": "object", - "required": ["count"], - "properties": { - "count": { - "$ref": "#/definitions/Uint128" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "The percentage of tokens that must be staked for the module to be active. Computed as `staked / total_supply`.", - "type": "object", - "required": ["percentage"], - "properties": { - "percentage": { - "type": "object", - "required": ["percent"], - "properties": { - "percent": { - "$ref": "#/definitions/Decimal" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "Binary": { - "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", - "type": "string" - }, - "Cw20Coin": { - "type": "object", - "required": ["address", "amount"], - "properties": { - "address": { - "type": "string" - }, - "amount": { - "$ref": "#/definitions/Uint128" - } - }, - "additionalProperties": false - }, - "Decimal": { - "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", - "type": "string" - }, - "Duration": { - "description": "Duration is a delta of time. You can add it to a BlockInfo or Expiration to move that further in the future. Note that an height-based Duration and a time-based Expiration cannot be combined", - "oneOf": [ - { - "type": "object", - "required": ["height"], - "properties": { - "height": { - "type": "integer", - "minimum": 0.0 - } - }, - "additionalProperties": false - }, - { - "description": "Time in seconds", - "type": "object", - "required": ["time"], - "properties": { - "time": { - "type": "integer", - "minimum": 0.0 - } - }, - "additionalProperties": false - } - ] - }, - "EmbeddedLogo": { - "description": "This is used to store the logo on the blockchain in an accepted format. Enforce maximum size of 5KB on all variants.", - "oneOf": [ - { - "description": "Store the Logo as an SVG file. The content must conform to the spec at https://en.wikipedia.org/wiki/Scalable_Vector_Graphics (The contract should do some light-weight sanity-check validation)", - "type": "object", - "required": ["svg"], - "properties": { - "svg": { - "$ref": "#/definitions/Binary" - } - }, - "additionalProperties": false - }, - { - "description": "Store the Logo as a PNG file. This will likely only support up to 64x64 or so within the 5KB limit.", - "type": "object", - "required": ["png"], - "properties": { - "png": { - "$ref": "#/definitions/Binary" - } - }, - "additionalProperties": false - } - ] - }, - "InstantiateMarketingInfo": { - "type": "object", - "properties": { - "description": { - "type": ["string", "null"] - }, - "logo": { - "anyOf": [ - { - "$ref": "#/definitions/Logo" - }, - { - "type": "null" - } - ] - }, - "marketing": { - "type": ["string", "null"] - }, - "project": { - "type": ["string", "null"] - } - }, - "additionalProperties": false - }, - "Logo": { - "description": "This is used for uploading logo data, or setting it in InstantiateData", - "oneOf": [ - { - "description": "A reference to an externally hosted logo. Must be a valid HTTP or HTTPS URL.", - "type": "object", - "required": ["url"], - "properties": { - "url": { - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "Logo content stored on the blockchain. Enforce maximum size of 5KB on all variants", - "type": "object", - "required": ["embedded"], - "properties": { - "embedded": { - "$ref": "#/definitions/EmbeddedLogo" - } - }, - "additionalProperties": false - } - ] - }, - "StakingInfo": { - "description": "Information about the staking contract to be used with this voting module.", - "oneOf": [ - { - "type": "object", - "required": ["existing"], - "properties": { - "existing": { - "type": "object", - "required": ["staking_contract_address"], - "properties": { - "staking_contract_address": { - "description": "Address of an already instantiated staking contract.", - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": ["new"], - "properties": { - "new": { - "type": "object", - "required": ["staking_code_id"], - "properties": { - "staking_code_id": { - "description": "Code ID for staking contract to instantiate.", - "type": "integer", - "minimum": 0.0 - }, - "unstaking_duration": { - "description": "See corresponding field in cw20-stake's instantiation. This will be used when instantiating the new staking contract.", - "anyOf": [ - { - "$ref": "#/definitions/Duration" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "TokenInfo": { - "oneOf": [ - { - "type": "object", - "required": ["existing"], - "properties": { - "existing": { - "type": "object", - "required": ["address", "staking_contract"], - "properties": { - "address": { - "description": "Address of an already instantiated cw20 token contract.", - "type": "string" - }, - "staking_contract": { - "description": "Information about the staking contract to use.", - "allOf": [ - { - "$ref": "#/definitions/StakingInfo" - } - ] - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": ["new"], - "properties": { - "new": { - "type": "object", - "required": [ - "code_id", - "decimals", - "initial_balances", - "label", - "name", - "staking_code_id", - "symbol" - ], - "properties": { - "code_id": { - "description": "Code ID for cw20 token contract.", - "type": "integer", - "minimum": 0.0 - }, - "decimals": { - "type": "integer", - "minimum": 0.0 - }, - "initial_balances": { - "type": "array", - "items": { - "$ref": "#/definitions/Cw20Coin" - } - }, - "initial_dao_balance": { - "anyOf": [ - { - "$ref": "#/definitions/Uint128" - }, - { - "type": "null" - } - ] - }, - "label": { - "description": "Label to use for instantiated cw20 contract.", - "type": "string" - }, - "marketing": { - "anyOf": [ - { - "$ref": "#/definitions/InstantiateMarketingInfo" - }, - { - "type": "null" - } - ] - }, - "name": { - "type": "string" - }, - "staking_code_id": { - "type": "integer", - "minimum": 0.0 - }, - "symbol": { - "type": "string" - }, - "unstaking_duration": { - "anyOf": [ - { - "$ref": "#/definitions/Duration" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - } - } -} diff --git a/packages/stateful/creators/TokenBased/instantiate_schema_native.json b/packages/stateful/creators/TokenBased/instantiate_schema_native.json deleted file mode 100644 index c47d43023..000000000 --- a/packages/stateful/creators/TokenBased/instantiate_schema_native.json +++ /dev/null @@ -1,277 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "InstantiateMsg", - "type": "object", - "required": ["token_info"], - "properties": { - "active_threshold": { - "description": "The number or percentage of tokens that must be staked for the DAO to be active", - "anyOf": [ - { - "$ref": "#/definitions/ActiveThreshold" - }, - { - "type": "null" - } - ] - }, - "token_info": { - "description": "New or existing native token to use for voting power.", - "allOf": [ - { - "$ref": "#/definitions/TokenInfo" - } - ] - }, - "unstaking_duration": { - "description": "How long until the tokens become liquid again", - "anyOf": [ - { - "$ref": "#/definitions/Duration" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false, - "definitions": { - "ActiveThreshold": { - "description": "The threshold of tokens that must be staked in order for this voting module to be active. If this is not reached, this module will response to `is_active` queries with false and proposal modules which respect active thresholds will not allow the creation of proposals.", - "oneOf": [ - { - "description": "The absolute number of tokens that must be staked for the module to be active.", - "type": "object", - "required": ["absolute_count"], - "properties": { - "absolute_count": { - "type": "object", - "required": ["count"], - "properties": { - "count": { - "$ref": "#/definitions/Uint128" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "The percentage of tokens that must be staked for the module to be active. Computed as `staked / total_supply`.", - "type": "object", - "required": ["percentage"], - "properties": { - "percentage": { - "type": "object", - "required": ["percent"], - "properties": { - "percent": { - "$ref": "#/definitions/Decimal" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "Binary": { - "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", - "type": "string" - }, - "Decimal": { - "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", - "type": "string" - }, - "DenomUnit": { - "description": "DenomUnit represents a struct that describes a given denomination unit of the basic token.", - "type": "object", - "required": ["aliases", "denom", "exponent"], - "properties": { - "aliases": { - "description": "aliases is a list of string aliases for the given denom", - "type": "array", - "items": { - "type": "string" - } - }, - "denom": { - "description": "denom represents the string name of the given denom unit (e.g uatom).", - "type": "string" - }, - "exponent": { - "description": "exponent represents power of 10 exponent that one must raise the base_denom to in order to equal the given DenomUnit's denom 1 denom = 1^exponent base_denom (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with exponent = 6, thus: 1 atom = 10^6 uatom).", - "type": "string" - } - } - }, - "Duration": { - "description": "Duration is a delta of time. You can add it to a BlockInfo or Expiration to move that further in the future. Note that an height-based Duration and a time-based Expiration cannot be combined", - "oneOf": [ - { - "type": "object", - "required": ["height"], - "properties": { - "height": { - "type": "integer", - "minimum": 0.0 - } - }, - "additionalProperties": false - }, - { - "description": "Time in seconds", - "type": "object", - "required": ["time"], - "properties": { - "time": { - "type": "integer", - "minimum": 0.0 - } - }, - "additionalProperties": false - } - ] - }, - "InitialBalance": { - "type": "object", - "required": ["address", "amount"], - "properties": { - "address": { - "type": "string" - }, - "amount": { - "$ref": "#/definitions/Uint128" - } - }, - "additionalProperties": false - }, - "NewDenomMetadata": { - "type": "object", - "required": ["description", "display", "name", "symbol"], - "properties": { - "additional_denom_units": { - "description": "Used define additional units of the token (e.g. \"tiger\") These must have an exponent larger than 0.", - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/DenomUnit" - } - }, - "description": { - "description": "The description of the token", - "type": "string" - }, - "display": { - "description": "The unit commonly used in communication (e.g. \"cat\")", - "type": "string" - }, - "name": { - "description": "The name of the token (e.g. \"Cat Coin\")", - "type": "string" - }, - "symbol": { - "description": "The ticker symbol of the token (e.g. \"CAT\")", - "type": "string" - } - }, - "additionalProperties": false - }, - "NewTokenInfo": { - "type": "object", - "required": ["initial_balances", "subdenom", "token_issuer_code_id"], - "properties": { - "initial_balances": { - "description": "The initial balances to set for the token, cannot be empty.", - "type": "array", - "items": { - "$ref": "#/definitions/InitialBalance" - } - }, - "initial_dao_balance": { - "description": "Optional balance to mint for the DAO.", - "anyOf": [ - { - "$ref": "#/definitions/Uint128" - }, - { - "type": "null" - } - ] - }, - "metadata": { - "description": "Optional metadata for the token, this can additionally be set later.", - "anyOf": [ - { - "$ref": "#/definitions/NewDenomMetadata" - }, - { - "type": "null" - } - ] - }, - "subdenom": { - "description": "The subdenom of the token to create, will also be used as an alias for the denom. The Token Factory denom will have the format of factory/{contract_address}/{subdenom}", - "type": "string" - }, - "token_issuer_code_id": { - "description": "The code id of the cw-tokenfactory-issuer contract", - "type": "integer", - "minimum": 0.0 - } - }, - "additionalProperties": false - }, - "TokenInfo": { - "oneOf": [ - { - "description": "Uses an existing Token Factory token and creates a new issuer contract. Full setup, such as transferring ownership or setting up MsgSetBeforeSendHook, must be done manually.", - "type": "object", - "required": ["existing"], - "properties": { - "existing": { - "type": "object", - "required": ["denom"], - "properties": { - "denom": { - "description": "Token factory denom", - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Creates a new Token Factory token via the issue contract with the DAO automatically setup as admin and owner.", - "type": "object", - "required": ["new"], - "properties": { - "new": { - "$ref": "#/definitions/NewTokenInfo" - } - }, - "additionalProperties": false - }, - { - "description": "Uses a factory contract that must return the denom, optionally a Token Contract address. The binary must serialize to a `WasmMsg::Execute` message. Validation happens in the factory contract itself, so be sure to use a trusted factory contract.", - "type": "object", - "required": ["factory"], - "properties": { - "factory": { - "$ref": "#/definitions/Binary" - } - }, - "additionalProperties": false - } - ] - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - } - } -} diff --git a/packages/stateful/creators/TokenBased/mutate.ts b/packages/stateful/creators/TokenBased/mutate.ts deleted file mode 100644 index fa6697a84..000000000 --- a/packages/stateful/creators/TokenBased/mutate.ts +++ /dev/null @@ -1,192 +0,0 @@ -import { ActiveThreshold, DaoCreatorMutate } from '@dao-dao/types' -import { InstantiateMsg as DaoVotingCw20StakedInstantiateMsg } from '@dao-dao/types/contracts/DaoVotingCw20Staked' -import { - InstantiateMsg as DaoVotingTokenStakedInstantiateMsg, - InitialBalance, -} from '@dao-dao/types/contracts/DaoVotingTokenStaked' -import { - NEW_DAO_TOKEN_DECIMALS, - TokenBasedCreatorId, - convertDenomToMicroDenomStringWithDecimals, - convertDenomToMicroDenomWithDecimals, - convertDurationWithUnitsToDuration, - encodeJsonToBase64, - mustGetSupportedChainConfig, -} from '@dao-dao/utils' -import { makeValidateMsg } from '@dao-dao/utils/validation/makeValidateMsg' - -import instantiateSchemaCw20 from './instantiate_schema_cw20.json' -import instantiateSchemaNative from './instantiate_schema_native.json' -import { CreatorData, GovernanceTokenType } from './types' - -export const mutate: DaoCreatorMutate = ( - msg, - { chainId, name: daoName }, - { - tiers, - tokenType, - newInfo: { initialSupply, imageUrl, symbol, name }, - existingTokenDenomOrAddress, - unstakingDuration, - customStakingAddress, - activeThreshold, - tokenFactoryDenomCreationFee, - }, - t, - codeIds -) => { - const isNative = !mustGetSupportedChainConfig(chainId)?.createWithCw20 - - let votingModuleAdapterInstantiateMsg: - | DaoVotingTokenStakedInstantiateMsg - | DaoVotingCw20StakedInstantiateMsg - - const active_threshold: ActiveThreshold | null = activeThreshold?.enabled - ? !activeThreshold.type || activeThreshold.type === 'percent' - ? { - percentage: { - percent: (activeThreshold.value / 100).toString(), - }, - } - : { - absolute_count: { - count: BigInt(activeThreshold.value).toString(), - }, - } - : null - - if (tokenType === GovernanceTokenType.New) { - const microInitialBalances: InitialBalance[] = tiers.flatMap( - ({ weight, members }) => - members.map(({ address }) => ({ - address, - amount: convertDenomToMicroDenomStringWithDecimals( - // Governance Token-based DAOs distribute tier weights evenly - // amongst members. - (weight / members.length / 100) * initialSupply, - NEW_DAO_TOKEN_DECIMALS - ), - })) - ) - // To prevent rounding issues, treasury balance becomes the remaining tokens - // after the member weights are distributed. - const microInitialTreasuryBalance = BigInt( - convertDenomToMicroDenomWithDecimals( - initialSupply, - NEW_DAO_TOKEN_DECIMALS - ) - - microInitialBalances.reduce( - (acc, { amount }) => acc + Number(amount), - 0 - ) - ).toString() - - votingModuleAdapterInstantiateMsg = isNative - ? { - active_threshold, - token_info: { - new: { - token_issuer_code_id: codeIds.CwTokenfactoryIssuerMain, - subdenom: symbol.toLowerCase(), - initial_balances: microInitialBalances, - initial_dao_balance: microInitialTreasuryBalance, - metadata: { - additional_denom_units: [ - { - aliases: [], - denom: symbol, - exponent: `${NEW_DAO_TOKEN_DECIMALS}`, - }, - ], - description: `${daoName}'s Governance Token`, - display: symbol, - name, - symbol, - }, - }, - }, - unstaking_duration: - convertDurationWithUnitsToDuration(unstakingDuration), - } - : { - active_threshold, - token_info: { - new: { - code_id: codeIds.Cw20Base ?? -1, - decimals: NEW_DAO_TOKEN_DECIMALS, - initial_balances: microInitialBalances, - initial_dao_balance: microInitialTreasuryBalance, - label: name, - marketing: imageUrl ? { logo: { url: imageUrl } } : null, - name, - staking_code_id: codeIds.Cw20Stake ?? -1, - symbol, - unstaking_duration: - convertDurationWithUnitsToDuration(unstakingDuration), - }, - }, - } - } else { - if (!existingTokenDenomOrAddress) { - throw new Error(t('error.missingGovernanceTokenDenom')) - } - - votingModuleAdapterInstantiateMsg = isNative - ? { - active_threshold, - token_info: { - existing: { - denom: existingTokenDenomOrAddress, - }, - }, - unstaking_duration: - unstakingDuration.value === 0 - ? null - : convertDurationWithUnitsToDuration(unstakingDuration), - } - : { - active_threshold, - token_info: { - existing: { - address: existingTokenDenomOrAddress, - staking_contract: - customStakingAddress !== undefined - ? { - existing: { - staking_contract_address: customStakingAddress, - }, - } - : { - new: { - staking_code_id: codeIds.Cw20Stake ?? -1, - unstaking_duration: - convertDurationWithUnitsToDuration(unstakingDuration), - }, - }, - }, - }, - } - } - - // Validate and throw error if invalid according to JSON schema. - makeValidateMsg< - DaoVotingTokenStakedInstantiateMsg | DaoVotingCw20StakedInstantiateMsg - >( - isNative ? instantiateSchemaNative : instantiateSchemaCw20, - t - )(votingModuleAdapterInstantiateMsg) - - msg.voting_module_instantiate_info = { - admin: { core_module: {} }, - code_id: isNative - ? codeIds.DaoVotingTokenStaked - : codeIds.DaoVotingCw20Staked ?? -1, - label: `DAO_${daoName.trim()}_${TokenBasedCreatorId}_${ - isNative ? 'native' : 'cw20' - }`, - msg: encodeJsonToBase64(votingModuleAdapterInstantiateMsg), - funds: tokenFactoryDenomCreationFee || [], - } - - return msg -} diff --git a/packages/stateful/creators/TokenBased/types.ts b/packages/stateful/creators/TokenBased/types.ts index 95414e70f..922533480 100644 --- a/packages/stateful/creators/TokenBased/types.ts +++ b/packages/stateful/creators/TokenBased/types.ts @@ -36,6 +36,10 @@ export type CreatorData = { * one with the specified unstaking duration. Does not work for native. */ customStakingAddress?: string + /** + * On Secret Network, load the code hash of the custom staking contract. + */ + customStakingCodeHash?: string // If token factory denom requires a creation fee, this should be set. tokenFactoryDenomCreationFee?: Coin[] } & DaoCreationVotingConfigWithActiveThreshold diff --git a/packages/stateful/feed/sources/OpenProposals/state.ts b/packages/stateful/feed/sources/OpenProposals/state.ts index f64520850..6f07be7ae 100644 --- a/packages/stateful/feed/sources/OpenProposals/state.ts +++ b/packages/stateful/feed/sources/OpenProposals/state.ts @@ -8,7 +8,7 @@ import { } from 'recoil' import { - DaoCoreV2Selectors, + DaoDaoCoreSelectors, blockHeightSelector, blocksPerYearSelector, govProposalVoteSelector, @@ -146,7 +146,7 @@ export const feedOpenProposalsSelector = selectorFamily< coreAddress, height: start_height, selector: address - ? DaoCoreV2Selectors.votingPowerAtHeightSelector({ + ? DaoDaoCoreSelectors.votingPowerAtHeightSelector({ chainId, contractAddress: coreAddress, params: [ @@ -303,7 +303,6 @@ export const feedOpenProposalsSelector = selectorFamily< chainId, coreAddress, proposalId: `${proposalModule.prefix}${id}`, - proposalModules, proposalViewUrl: getDaoProposalPath( DaoPageMode.Dapp, coreAddress, diff --git a/packages/stateful/feed/sources/VetoableProposals/state.ts b/packages/stateful/feed/sources/VetoableProposals/state.ts index f7b516f95..2e7e95ed1 100644 --- a/packages/stateful/feed/sources/VetoableProposals/state.ts +++ b/packages/stateful/feed/sources/VetoableProposals/state.ts @@ -1,6 +1,6 @@ import { selectorFamily, waitForAny } from 'recoil' -import { DaoCoreV2Selectors, followingDaosSelector } from '@dao-dao/state' +import { DaoDaoCoreSelectors, followingDaosSelector } from '@dao-dao/state' import { VetoableProposalsProps } from '@dao-dao/stateless' import { DaoPageMode, @@ -48,7 +48,7 @@ export const feedVetoableProposalsSelector = selectorFamily< const followingDaoConfigs = get( waitForAny( followingDaos.map(({ chainId, coreAddress }) => - DaoCoreV2Selectors.configSelector({ + DaoDaoCoreSelectors.configSelector({ chainId, contractAddress: coreAddress, params: [], diff --git a/packages/stateful/hooks/contracts/SecretCwAdminFactoryClient.ts b/packages/stateful/hooks/contracts/SecretCwAdminFactoryClient.ts new file mode 100644 index 000000000..9c3f086c5 --- /dev/null +++ b/packages/stateful/hooks/contracts/SecretCwAdminFactoryClient.ts @@ -0,0 +1,52 @@ +/* eslint-disable react-hooks/rules-of-hooks */ + +import { ExecuteResult } from '@cosmjs/cosmwasm-stargate' +import { useCallback } from 'react' +import { useRecoilValueLoadable } from 'recoil' + +import { SecretCwAdminFactoryClient as ExecuteClient } from '@dao-dao/state/contracts/SecretCwAdminFactory' +import { + ExecuteClientParams, + executeClient, +} from '@dao-dao/state/recoil/selectors/contracts/SecretCwAdminFactory' +import { useChain } from '@dao-dao/stateless' +import { FunctionKeyOf } from '@dao-dao/types' + +import { useSyncWalletSigner } from '../useSyncWalletSigner' + +// This hook wrapper lets us easily make hooks out of all execution functions on +// the contract clients, without having to fetch the `executeClient` selector as +// a loadable and add `useCallback` hooks in all the components. +const wrapExecuteHook = + >(fn: T) => + (params: Omit) => { + // Make sure we have the signing client for this chain and wallet. + useSyncWalletSigner() + + const { chain_id: chainId } = useChain() + const clientLoadable = useRecoilValueLoadable( + executeClient({ + ...params, + chainId, + }) + ) + const client = + clientLoadable.state === 'hasValue' ? clientLoadable.contents : undefined + + return useCallback( + (...args: Parameters) => { + if (client) + return ( + client[fn] as ( + ...args: Parameters + ) => Promise + )(...args) + throw new Error('Wallet signer not set up.') + }, + [client] + ) + } + +export const useInstantiateContractWithSelfAdmin = wrapExecuteHook( + 'instantiateContractWithSelfAdmin' +) diff --git a/packages/stateful/hooks/contracts/index.ts b/packages/stateful/hooks/contracts/index.ts index bd6804b26..433e70861 100644 --- a/packages/stateful/hooks/contracts/index.ts +++ b/packages/stateful/hooks/contracts/index.ts @@ -14,3 +14,4 @@ export * as DaoVotingNativeStakedHooks from './DaoVotingNativeStaked' export * as DaoVotingTokenStakedHooks from './DaoVotingTokenStaked' export * as NeutronVaultHooks from './NeutronVault' export * as OraichainCw20StakingHooks from './OraichainCw20Staking' +export * as SecretCwAdminFactoryHooks from './SecretCwAdminFactoryClient' diff --git a/packages/stateful/hooks/index.ts b/packages/stateful/hooks/index.ts index bec905cf7..3df2e6df2 100644 --- a/packages/stateful/hooks/index.ts +++ b/packages/stateful/hooks/index.ts @@ -4,8 +4,10 @@ export * from './useAutoRefreshData' export * from './useAwaitNextBlock' export * from './useCfWorkerAuthPostRequest' export * from './useCreateCw1Whitelist' +export * from './useDaoClient' export * from './useDaoProposalSinglePublishProposal' export * from './useDaoTabs' +export * from './useDaoWithWalletSecretNetworkPermit' export * from './useEntity' export * from './useExecutedProposalTxLoadable' export * from './useFollowingDaos' @@ -19,6 +21,7 @@ export * from './useLoadingGovProposal' export * from './useLoadingGovProposalWalletVoteInfo' export * from './useManageProfile' export * from './useMembership' +export * from './useOnSecretNetworkPermitUpdate' export * from './useProfile' export * from './useProposalActionState' export * from './useProposalRelayState' diff --git a/packages/stateful/hooks/useCreateCw1Whitelist.ts b/packages/stateful/hooks/useCreateCw1Whitelist.ts index 8ae2910ff..bbc81472c 100644 --- a/packages/stateful/hooks/useCreateCw1Whitelist.ts +++ b/packages/stateful/hooks/useCreateCw1Whitelist.ts @@ -44,7 +44,7 @@ export const useCreateCw1Whitelist = ({ const { t } = useTranslation() const { address: walletAddress, - getSigningCosmWasmClient, + getSigningClient, chain: { chain_id: chainId, bech32_prefix: bech32Prefix }, } = useWallet({ chainId: _chainId, @@ -77,7 +77,7 @@ export const useCreateCw1Whitelist = ({ } const contractAddress = await instantiateSmartContract( - await getSigningCosmWasmClient(), + getSigningClient, walletAddress, cw1WhitelistCodeId, contractLabel, @@ -103,7 +103,7 @@ export const useCreateCw1Whitelist = ({ bech32Prefix, contractLabel, cw1WhitelistCodeId, - getSigningCosmWasmClient, + getSigningClient, t, walletAddress, ] diff --git a/packages/stateful/hooks/useDaoClient.ts b/packages/stateful/hooks/useDaoClient.ts new file mode 100644 index 000000000..8331436a5 --- /dev/null +++ b/packages/stateful/hooks/useDaoClient.ts @@ -0,0 +1,60 @@ +import { useQueryClient } from '@tanstack/react-query' +import { useMemo } from 'react' + +import { useDaoContextIfAvailable } from '@dao-dao/stateless' +import { DaoSource, IDaoBase } from '@dao-dao/types' + +import { getDao } from '../clients/dao' + +export type UseDaoClientOptions = { + /** + * DAO to fetch the client for. If undefined, uses the current DAO context. + * Otherwise, throws an error. + */ + dao?: DaoSource +} + +export type UseDaoClientReturn = { + /** + * DAO client. + */ + dao: IDaoBase +} + +/** + * Hook to get or create a DAO client. It will not be initialized. + */ +export const useDaoClient = ({ + dao: daoSource, +}: UseDaoClientOptions): UseDaoClientReturn => { + const queryClient = useQueryClient() + const currentDao = useDaoContextIfAvailable()?.dao + + // Get DAO client. If matches current DAO context, use that one instead. + const dao = useMemo( + () => + currentDao && + (!daoSource || + (currentDao.chainId === daoSource.chainId && + currentDao.coreAddress === daoSource.coreAddress)) + ? currentDao + : daoSource + ? getDao({ + queryClient, + chainId: daoSource.chainId, + coreAddress: daoSource.coreAddress, + }) + : undefined, + [currentDao, daoSource, queryClient] + ) + + if (!dao) { + throw new Error( + 'Cannot use useDaoClient hook with no DAO provided and when not in a DAO context.' + ) + } + + return { + dao, + } +} diff --git a/packages/stateful/hooks/useDaoProposalSinglePublishProposal.ts b/packages/stateful/hooks/useDaoProposalSinglePublishProposal.ts index b8cc386ba..da8ec7b7b 100644 --- a/packages/stateful/hooks/useDaoProposalSinglePublishProposal.ts +++ b/packages/stateful/hooks/useDaoProposalSinglePublishProposal.ts @@ -1,6 +1,6 @@ import { useMemo } from 'react' -import { useChain, useDaoInfoContext } from '@dao-dao/stateless' +import { useDaoContext } from '@dao-dao/stateless' import { DaoProposalSingleAdapterId } from '@dao-dao/utils' import { @@ -16,14 +16,13 @@ import { PublishProposal } from '../proposal-module-adapter/adapters/DaoProposal export const useDaoProposalSinglePublishProposal = (): | PublishProposal | undefined => { - const chain = useChain() - const { coreAddress, proposalModules } = useDaoInfoContext() + const { dao } = useDaoContext() // Memoize hook getter since we don't want to create the hook more than once. // `useDaoInfoContext` always returns the same instances of the data, so no // hook rules are violated here. const useProposalModule = useMemo(() => { - const daoProposalSingleModule = proposalModules.find( + const daoProposalSingleModule = dao.proposalModules.find( ({ contractName }) => matchProposalModuleAdapter(contractName)?.id === DaoProposalSingleAdapterId @@ -32,20 +31,13 @@ export const useDaoProposalSinglePublishProposal = (): return undefined } - const common = matchAndLoadCommon(daoProposalSingleModule, { - chain, - coreAddress, - }) + const common = matchAndLoadCommon(dao, daoProposalSingleModule.address) return makeUsePublishProposal({ - options: { - chain, - proposalModule: daoProposalSingleModule, - coreAddress, - }, + proposalModule: daoProposalSingleModule, depositInfoSelector: common.selectors.depositInfo, }) - }, [proposalModules, chain, coreAddress]) + }, [dao]) const { publishProposal } = useProposalModule?.() ?? {} diff --git a/packages/stateful/hooks/useDaoWithWalletSecretNetworkPermit.ts b/packages/stateful/hooks/useDaoWithWalletSecretNetworkPermit.ts new file mode 100644 index 000000000..2900b7cb4 --- /dev/null +++ b/packages/stateful/hooks/useDaoWithWalletSecretNetworkPermit.ts @@ -0,0 +1,126 @@ +import { useCallback, useEffect, useMemo, useState } from 'react' + +import { useUpdatingRef } from '@dao-dao/stateless' +import { DaoSource, IDaoBase, PermitForPermitData } from '@dao-dao/types' +import { isSecretNetwork } from '@dao-dao/utils' + +import { SecretCwDao } from '../clients/dao' +import { useDaoClient } from './useDaoClient' +import { useOnSecretNetworkPermitUpdate } from './useOnSecretNetworkPermitUpdate' +import { UseWalletOptions, UseWalletReturn, useWallet } from './useWallet' + +export type UseWalletWithSecretNetworkPermitOptions = UseWalletOptions & { + /** + * DAO to fetch the permit for, or the current DAO context. + */ + dao?: DaoSource +} + +export type UseWalletWithSecretNetworkPermitReturn = UseWalletReturn & { + /** + * Whether or not the current chain is Secret Network. + */ + isSecretNetwork: boolean + /** + * DAO client. + */ + dao: IDaoBase + /** + * Permit saved for the given DAO, if exists. + */ + permit: PermitForPermitData | undefined + /** + * Function to create and return a permit for the given DAO. + */ + getPermit: () => Promise +} + +/** + * Hook to help manage a wallet's Secret Network permits for a DAO. + * + * TODO(dao-client): refactor this into a more general wallet / DAO client hook + */ +export const useDaoWithWalletSecretNetworkPermit = ({ + dao, + ...options +}: UseWalletWithSecretNetworkPermitOptions = {}): UseWalletWithSecretNetworkPermitReturn => { + const { dao: daoClient } = useDaoClient({ + dao, + }) + const wallet = useWallet(options) + + // Stabilize reference so callback doesn't change. This only needs to update + // on wallet connection state change anyway. + const getOfflineSignerAminoRef = useUpdatingRef(wallet.getOfflineSignerAmino) + // Register for offline signer if Secret DAO. + useEffect(() => { + if (daoClient instanceof SecretCwDao && wallet.isWalletConnected) { + daoClient.registerOfflineSignerAminoGetter( + getOfflineSignerAminoRef.current + ) + } + }, [daoClient, getOfflineSignerAminoRef, wallet.isWalletConnected]) + + // Attempt to initialize with existing permit. + const [permit, setPermit] = useState(() => + daoClient instanceof SecretCwDao && + wallet.isWalletConnected && + wallet.address + ? daoClient.getExistingPermit(wallet.address) + : undefined + ) + + // On wallet address change, re-fetch existing permit. + useEffect(() => { + if ( + daoClient instanceof SecretCwDao && + wallet.isWalletConnected && + wallet.address + ) { + setPermit(daoClient.getExistingPermit(wallet.address)) + } + }, [daoClient, wallet.address, wallet.isWalletConnected]) + + // Attempt to fetch existing permit on change if not already set. + useOnSecretNetworkPermitUpdate({ + dao, + callback: + daoClient instanceof SecretCwDao && wallet.isWalletConnected + ? () => { + if (wallet.address) { + setPermit(daoClient.getExistingPermit(wallet.address)) + } + } + : undefined, + // We already set state and re-render in the callback. + reRender: false, + }) + + const getPermit = useCallback(async (): Promise => { + if (!(daoClient instanceof SecretCwDao)) { + throw new Error('Not a Secret DAO.') + } + + if (!wallet.address || !wallet.isWalletConnected) { + throw new Error('Log in to continue.') + } + + const permit = await daoClient.getPermit(wallet.address) + setPermit(permit) + + return permit + }, [daoClient, wallet.address, wallet.isWalletConnected]) + + const response = useMemo( + (): UseWalletWithSecretNetworkPermitReturn => ({ + ...wallet, + isSecretNetwork: isSecretNetwork(wallet.chain.chain_id), + dao: daoClient, + permit, + getPermit, + }), + [wallet, daoClient, permit, getPermit] + ) + + return response +} diff --git a/packages/stateful/hooks/useInstantiateAndExecute.ts b/packages/stateful/hooks/useInstantiateAndExecute.ts index f6a7da63c..a8f9e007c 100644 --- a/packages/stateful/hooks/useInstantiateAndExecute.ts +++ b/packages/stateful/hooks/useInstantiateAndExecute.ts @@ -9,8 +9,12 @@ import { v4 as uuidv4 } from 'uuid' import { codeDetailsSelector } from '@dao-dao/state/recoil' import { useCachedLoadable } from '@dao-dao/stateless' -import { Coin, CosmosMsgFor_Empty, cwMsgToEncodeObject } from '@dao-dao/types' -import { CHAIN_GAS_MULTIPLIER, makeWasmMessage } from '@dao-dao/utils' +import { Coin, UnifiedCosmosMsg, cwMsgToEncodeObject } from '@dao-dao/types' +import { + CHAIN_GAS_MULTIPLIER, + isSecretNetwork, + makeWasmMessage, +} from '@dao-dao/utils' import { useWallet } from './useWallet' @@ -52,7 +56,7 @@ export const useInstantiateAndExecute = ( codeId: number ): UseInstantiateAndExecuteResult => { const { t } = useTranslation() - const { getSigningCosmWasmClient, address, chain } = useWallet({ + const { getSigningClient, address, chain } = useWallet({ chainId, }) @@ -76,6 +80,11 @@ export const useInstantiateAndExecute = ( throw new Error(t('error.logInToContinue')) } + // Ensure active chain is not Secret Network. + if (isSecretNetwork(chain.chain_id)) { + throw new Error('Secret Network does not support instantiate2.') + } + // Get the checksum of the contract code. const checksum = fromHex(codeDetailsLoadable.contents.checksum) // Random salt. @@ -87,7 +96,7 @@ export const useInstantiateAndExecute = ( toUtf8(salt), chain.bech32_prefix ) - const messages: CosmosMsgFor_Empty[] = [ + const messages: UnifiedCosmosMsg[] = [ // Instantiate the contract. makeWasmMessage({ wasm: { @@ -112,10 +121,12 @@ export const useInstantiateAndExecute = ( ), ] - const signingCosmWasmClient = await getSigningCosmWasmClient() - const response = (await signingCosmWasmClient.signAndBroadcast( + const signingClient = await getSigningClient() + const response = (await signingClient.signAndBroadcast( address, - messages.map((msg) => cwMsgToEncodeObject(msg, address)), + messages.map((msg) => + cwMsgToEncodeObject(chain.chain_id, msg, address) + ), CHAIN_GAS_MULTIPLIER // cosmos-kit has an older version of the package. This is a workaround. )) as DeliverTxResponse @@ -125,7 +136,7 @@ export const useInstantiateAndExecute = ( response, } }, - [address, chain, codeDetailsLoadable, codeId, getSigningCosmWasmClient, t] + [address, chain, codeDetailsLoadable, codeId, getSigningClient, t] ) return { diff --git a/packages/stateful/hooks/useLoadingDaos.ts b/packages/stateful/hooks/useLoadingDaos.ts index cf8cb4c2f..adf0ccdf6 100644 --- a/packages/stateful/hooks/useLoadingDaos.ts +++ b/packages/stateful/hooks/useLoadingDaos.ts @@ -1,5 +1,4 @@ import { useQueries, useQueryClient } from '@tanstack/react-query' -import { useMemo } from 'react' import { constSelector, useRecoilValueLoadable, waitForAll } from 'recoil' import { daoQueries } from '@dao-dao/state/query' @@ -30,16 +29,10 @@ export const useLoadingDaos = ( coreAddress, }) ), - combine: useMemo( - () => - makeCombineQueryResultsIntoLoadingData({ - transform: (infos) => - infos.sort((a, b) => - alphabetize ? a.name.localeCompare(b.name) : 0 - ), - }), - [alphabetize] - ), + combine: makeCombineQueryResultsIntoLoadingData({ + transform: (infos) => + infos.sort((a, b) => (alphabetize ? a.name.localeCompare(b.name) : 0)), + }), }) } diff --git a/packages/stateful/hooks/useManageProfile.ts b/packages/stateful/hooks/useManageProfile.ts index 6ab460ae1..e52885a6e 100644 --- a/packages/stateful/hooks/useManageProfile.ts +++ b/packages/stateful/hooks/useManageProfile.ts @@ -396,13 +396,9 @@ export const useManageProfile = ({ address: chainWallet.address!, }) ), - combine: useMemo( - () => - makeCombineQueryResultsIntoLoadingData({ - firstLoad: 'none', - }), - [] - ), + combine: makeCombineQueryResultsIntoLoadingData({ + firstLoad: 'none', + }), }) const merge: UseManageProfileReturn['merge'] = useMemo(() => { diff --git a/packages/stateful/hooks/useMembership.ts b/packages/stateful/hooks/useMembership.ts index 9b803406f..a0c129284 100644 --- a/packages/stateful/hooks/useMembership.ts +++ b/packages/stateful/hooks/useMembership.ts @@ -1,10 +1,16 @@ -import { DaoCoreV2Selectors } from '@dao-dao/state' -import { useCachedLoadable, useChain } from '@dao-dao/stateless' +import { DaoSource } from '@dao-dao/types' +import { useDaoClient } from './useDaoClient' +import { useOnSecretNetworkPermitUpdate } from './useOnSecretNetworkPermitUpdate' +import { useProfile } from './useProfile' +import { useQueryLoadingDataWithError } from './useQueryLoadingDataWithError' import { useWallet } from './useWallet' interface UseMembershipOptions { - coreAddress: string + /** + * Override current DAO context. + */ + dao?: DaoSource blockHeight?: number } @@ -16,49 +22,48 @@ interface UseMembershipResponse { } export const useMembership = ({ - coreAddress, + dao: daoSource, blockHeight, -}: UseMembershipOptions): UseMembershipResponse => { - const { chain_id: chainId } = useChain() - const { address: walletAddress, isWalletConnecting } = useWallet() +}: UseMembershipOptions = {}): UseMembershipResponse => { + const { dao } = useDaoClient({ + dao: daoSource, + }) - // Use loadable to prevent flickering loading states when wallet address - // changes and on initial load if wallet is connecting. - const _walletVotingWeight = useCachedLoadable( - walletAddress - ? DaoCoreV2Selectors.votingPowerAtHeightSelector({ - contractAddress: coreAddress, - chainId, - params: [ - { - address: walletAddress, - height: blockHeight, - }, - ], - }) - : undefined + // Don't load chain-specific profile because the wallet may not be connected + // to that chain and thus the correct profile won't load. Instead, fetch the + // chains from the currently connected profile and find the correct address. + const { chains } = useProfile() + const { address: currentWalletAddress, isWalletConnecting } = useWallet({ + chainId: dao.chainId, + }) + + // Use profile chains if present, falling back to the current wallet address. + const walletAddress = + (!chains.loading && + chains.data.find((c) => c.chainId === dao.chainId)?.address) || + currentWalletAddress + + const _walletVotingWeight = useQueryLoadingDataWithError( + dao.getVotingPowerQuery(walletAddress, blockHeight) ) - const _totalVotingWeight = useCachedLoadable( - DaoCoreV2Selectors.totalPowerAtHeightSelector({ - contractAddress: coreAddress, - chainId, - params: [ - { - height: blockHeight, - }, - ], - }) + const _totalVotingWeight = useQueryLoadingDataWithError( + dao.getTotalVotingPowerQuery(blockHeight) ) + // Make sure this component re-renders if the Secret Network permit changes so + // the voting query above refreshes. + useOnSecretNetworkPermitUpdate() const walletVotingWeight = - _walletVotingWeight.state === 'hasValue' && - !isNaN(Number(_walletVotingWeight.contents.power)) - ? Number(_walletVotingWeight.contents.power) + !_walletVotingWeight.loading && + !_walletVotingWeight.errored && + !isNaN(Number(_walletVotingWeight.data.power)) + ? Number(_walletVotingWeight.data.power) : undefined const totalVotingWeight = - _totalVotingWeight.state === 'hasValue' && - !isNaN(Number(_totalVotingWeight.contents.power)) - ? Number(_totalVotingWeight.contents.power) + !_totalVotingWeight.loading && + !_totalVotingWeight.errored && + !isNaN(Number(_totalVotingWeight.data.power)) + ? Number(_totalVotingWeight.data.power) : undefined const isMember = walletVotingWeight !== undefined ? walletVotingWeight > 0 : undefined @@ -68,8 +73,8 @@ export const useMembership = ({ walletVotingWeight, totalVotingWeight, loading: - _walletVotingWeight.state === 'loading' || - _totalVotingWeight.state === 'loading' || + _walletVotingWeight.loading || + _totalVotingWeight.loading || isWalletConnecting, } } diff --git a/packages/stateful/hooks/useOnSecretNetworkPermitUpdate.ts b/packages/stateful/hooks/useOnSecretNetworkPermitUpdate.ts new file mode 100644 index 000000000..74bd105b4 --- /dev/null +++ b/packages/stateful/hooks/useOnSecretNetworkPermitUpdate.ts @@ -0,0 +1,79 @@ +import { useEffect, useState } from 'react' + +import { useDaoContextIfAvailable, useUpdatingRef } from '@dao-dao/stateless' +import { DaoSource, PermitForPermitData } from '@dao-dao/types' +import { serializeDaoSource } from '@dao-dao/utils' + +import { + SECRET_PERMIT_UPDATE_EVENT_PREFIX, + SecretPermitUpdateEvent, +} from '../clients/dao/SecretCwDao' + +export type OnSecretNetworkPermitUpdateOptions = { + /** + * Optionally specify a DAO or DAOs to listen for permit updates for. If + * undefined, the current DAO context will be used. If no DAO is specified and + * the hook is not used in a DAO context, nothing will happen. + */ + dao?: DaoSource | DaoSource[] + /** + * Whether or not to re-render the component when the permit is updated. + * Defaults to true. + */ + reRender?: boolean + /** + * An optional callback to execute when the permit is updated. This is + * automatically memoized. + */ + callback?: (permit: PermitForPermitData) => void +} + +/** + * A hook that listens for a Secret Network Permit update for the current DAO + * and re-renders or executes a callback when detected. + */ +export const useOnSecretNetworkPermitUpdate = ({ + dao, + reRender = true, + callback, +}: OnSecretNetworkPermitUpdateOptions = {}) => { + const currentDaoSource = useDaoContextIfAvailable()?.dao.source + + // Memoize callback into a ref. + const callbackRef = useUpdatingRef(callback) + + const [_, setForceRender] = useState(-1) + + const daoSource = dao || currentDaoSource + useEffect(() => { + if (typeof window === 'undefined' || !daoSource) { + return + } + + const types = [daoSource] + .flat() + .map((dao) => SECRET_PERMIT_UPDATE_EVENT_PREFIX + serializeDaoSource(dao)) + + const listener = (event: Event) => { + if (!(event instanceof CustomEvent)) { + console.error('Unexpected event for Secret Network permit update.') + return + } + + const { permit } = event.detail as SecretPermitUpdateEvent + + // Re-render the component by changing a state variable. + if (reRender) { + setForceRender((prev) => prev * -1) + } + + // Call the callback if provided. + callbackRef.current?.(permit) + } + + types.forEach((type) => window.addEventListener(type, listener)) + return () => { + types.forEach((type) => window.removeEventListener(type, listener)) + } + }, [callbackRef, daoSource, reRender]) +} diff --git a/packages/stateful/hooks/useProposalActionState.tsx b/packages/stateful/hooks/useProposalActionState.tsx index 4282440a0..18602f6fa 100644 --- a/packages/stateful/hooks/useProposalActionState.tsx +++ b/packages/stateful/hooks/useProposalActionState.tsx @@ -1,4 +1,3 @@ -import { ExecuteResult } from '@cosmjs/cosmwasm-stargate' import { CancelOutlined, Key, Send } from '@mui/icons-material' import { useCallback, useEffect, useState } from 'react' import toast from 'react-hot-toast' @@ -27,7 +26,7 @@ import { } from '@dao-dao/utils' import { ProfileProposalCard } from '../components' -import { useProposalModuleAdapterOptions } from '../proposal-module-adapter' +import { useProposalModuleAdapterContext } from '../proposal-module-adapter' import { useMembership } from './useMembership' import { UseProposalRelayStateReturn } from './useProposalRelayState' import { useWallet } from './useWallet' @@ -36,13 +35,6 @@ export type UseProposalActionStateOptions = { relayState: UseProposalRelayStateReturn statusKey: ProposalStatusKey loadingExecutionTxHash: LoadingData - executeProposal: ( - options: { proposalId: number }, - // No need. - fee?: undefined, - memo?: string | undefined - ) => Promise - closeProposal: (options: { proposalId: number }) => Promise onExecuteSuccess: () => void | Promise onCloseSuccess: () => void | Promise } @@ -61,8 +53,6 @@ export const useProposalActionState = ({ relayState, statusKey, loadingExecutionTxHash, - executeProposal, - closeProposal, onExecuteSuccess, onCloseSuccess, }: UseProposalActionStateOptions): UseProposalActionStateReturn => { @@ -71,11 +61,16 @@ export const useProposalActionState = ({ chain: { chain_id: chainId }, } = useConfiguredChainContext() const { coreAddress, items } = useDaoInfoContext() - const { proposalModule, proposalNumber } = useProposalModuleAdapterOptions() - const { isWalletConnected } = useWallet() - const { isMember = false } = useMembership({ - coreAddress, - }) + const { + options: { proposalNumber }, + proposalModule, + } = useProposalModuleAdapterContext() + const { + isWalletConnected, + address: walletAddress = '', + getSigningClient, + } = useWallet() + const { isMember = false } = useMembership() const config = useRecoilValue( DaoProposalSingleCommonSelectors.configSelector({ @@ -103,13 +98,12 @@ export const useProposalActionState = ({ setActionLoading(true) try { - await executeProposal( - { - proposalId: proposalNumber, - }, - undefined, - allowMemoOnExecute && memo ? memo : undefined - ) + await proposalModule.execute({ + proposalId: proposalNumber, + getSigningClient, + sender: walletAddress, + memo: allowMemoOnExecute && memo ? memo : undefined, + }) await onExecuteSuccess() } catch (err) { @@ -123,8 +117,10 @@ export const useProposalActionState = ({ // Loading will stop on success when status refreshes. }, [ isWalletConnected, - executeProposal, + proposalModule, proposalNumber, + getSigningClient, + walletAddress, allowMemoOnExecute, memo, onExecuteSuccess, @@ -138,8 +134,10 @@ export const useProposalActionState = ({ setActionLoading(true) try { - await closeProposal({ + await proposalModule.close({ proposalId: proposalNumber, + getSigningClient, + sender: walletAddress, }) await onCloseSuccess() @@ -152,7 +150,14 @@ export const useProposalActionState = ({ } // Loading will stop on success when status refreshes. - }, [isWalletConnected, closeProposal, proposalNumber, onCloseSuccess]) + }, [ + isWalletConnected, + proposalModule, + proposalNumber, + getSigningClient, + walletAddress, + onCloseSuccess, + ]) const showRelayStatus = !relayState.loading && diff --git a/packages/stateful/hooks/useProposalRelayState.ts b/packages/stateful/hooks/useProposalRelayState.ts index ab3c931dd..631311a2d 100644 --- a/packages/stateful/hooks/useProposalRelayState.ts +++ b/packages/stateful/hooks/useProposalRelayState.ts @@ -25,13 +25,13 @@ import { } from '@dao-dao/stateless' import { BaseProposalStatusAndInfoProps, - CosmosMsgFor_Empty, CrossChainPacketInfoState, CrossChainPacketInfoStatus, LoadingData, ProposalRelayState, ProposalStatus, ProposalStatusEnum, + UnifiedCosmosMsg, } from '@dao-dao/types' import { ExecutionResponse } from '@dao-dao/types/contracts/PolytoneListener' import { @@ -41,7 +41,7 @@ import { } from '@dao-dao/utils' export type UseProposalRelayStateOptions = { - msgs: CosmosMsgFor_Empty[] + msgs: UnifiedCosmosMsg[] status: ProposalStatus executedAt: Date | undefined proposalModuleAddress: string diff --git a/packages/stateful/hooks/useProposalVetoState.tsx b/packages/stateful/hooks/useProposalVetoState.tsx index 9c546d60e..e31024153 100644 --- a/packages/stateful/hooks/useProposalVetoState.tsx +++ b/packages/stateful/hooks/useProposalVetoState.tsx @@ -1,15 +1,13 @@ import { ThumbDownOutlined } from '@mui/icons-material' +import { useQueries, useQueryClient } from '@tanstack/react-query' import { useRouter } from 'next/router' -import { useCallback, useState } from 'react' +import { useCallback, useMemo, useState } from 'react' import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' -import { waitForAll } from 'recoil' -import { DaoCoreV2Selectors } from '@dao-dao/state' import { ProposalStatusAndInfoProps, Tooltip, - useCachedLoading, useConfiguredChainContext, useDaoInfoContext, useDaoNavHelpers, @@ -24,16 +22,18 @@ import { } from '@dao-dao/types' import { VetoConfig } from '@dao-dao/types/contracts/DaoProposalSingle.v2' import { - CHAIN_GAS_MULTIPLIER, + executeSmartContract, getDaoProposalSinglePrefill, makeCw1WhitelistExecuteMessage, makeWasmMessage, processError, } from '@dao-dao/utils' +import { getDao } from '../clients' import { ButtonLink, EntityDisplay } from '../components' import { useProposalModuleAdapterOptions } from '../proposal-module-adapter' import { useEntity } from './useEntity' +import { useOnSecretNetworkPermitUpdate } from './useOnSecretNetworkPermitUpdate' import { useWallet } from './useWallet' export type UseProposalVetoStateOptions = { @@ -71,7 +71,8 @@ export const useProposalVetoState = ({ const { coreAddress } = useDaoInfoContext() const { getDaoProposalPath } = useDaoNavHelpers() const { proposalModule, proposalNumber } = useProposalModuleAdapterOptions() - const { address: walletAddress = '', getSigningCosmWasmClient } = useWallet() + const { address: walletAddress = '', getSigningClient } = useWallet() + const queryClient = useQueryClient() const vetoEnabled = !!vetoConfig || !!neutronTimelockOverrule const [vetoLoading, setVetoLoading] = useState< @@ -80,30 +81,46 @@ export const useProposalVetoState = ({ const { entity: vetoerEntity } = useEntity( vetoConfig?.vetoer || neutronTimelockOverrule?.dao || '' ) - // Flatten vetoer entities in case a cw1-whitelist is the vetoer. - const vetoerEntities = !vetoerEntity.loading - ? vetoerEntity.data.type === EntityType.Cw1Whitelist - ? vetoerEntity.data.entities - : [vetoerEntity.data] - : [] - const vetoerDaoEntities = vetoerEntities.filter( - (entity) => entity.type === EntityType.Dao - ) + const { vetoerEntities, vetoerDaoEntities, vetoerDaoClients } = + useMemo(() => { + // Flatten vetoer entities in case a cw1-whitelist is the vetoer. + const vetoerEntities = !vetoerEntity.loading + ? vetoerEntity.data.type === EntityType.Cw1Whitelist + ? vetoerEntity.data.entities + : [vetoerEntity.data] + : [] + + const vetoerDaoEntities = vetoerEntities.filter( + (entity) => entity.type === EntityType.Dao + ) + + const vetoerDaoClients = vetoerDaoEntities.map((entity) => + getDao({ + queryClient, + chainId, + coreAddress: entity.address, + }) + ) + + return { + vetoerEntities, + vetoerDaoEntities, + vetoerDaoClients, + } + }, [chainId, queryClient, vetoerEntity]) + // This is the voting power the current wallet has in each of the DAO vetoers. - const walletDaoVetoerMemberships = useCachedLoading( - !vetoerEntity.loading && walletAddress - ? waitForAll( - vetoerDaoEntities.map((entity) => - DaoCoreV2Selectors.votingPowerAtHeightSelector({ - contractAddress: entity.address, - chainId, - params: [{ address: walletAddress }], - }) - ) - ) - : undefined, - undefined - ) + const walletDaoVetoerMemberships = useQueries({ + queries: walletAddress + ? vetoerDaoClients.map((dao) => dao.getVotingPowerQuery(walletAddress)) + : [], + }) + // Make sure this component re-renders if the Secret Network permit changes so + // the voting queries above refresh. + useOnSecretNetworkPermitUpdate({ + dao: vetoerDaoClients, + }) + const canBeVetoed = vetoEnabled && (statusKey === 'veto_timelock' || @@ -115,17 +132,22 @@ export const useProposalVetoState = ({ // wallet can veto. const matchingWalletVetoer = canBeVetoed && !vetoerEntity.loading - ? vetoerEntities.find( + ? // Find wallet that matches address. + vetoerEntities.find( (entity) => entity.type === EntityType.Wallet && entity.address === walletAddress ) || - (!walletDaoVetoerMemberships.loading && walletDaoVetoerMemberships.data - ? vetoerDaoEntities.find( - (_, index) => - walletDaoVetoerMemberships.data![index].power !== '0' - ) - : undefined) + // Find DAO where wallet is a member. + vetoerDaoEntities.find((_, index) => { + const membershipQuery = walletDaoVetoerMemberships[index] + return ( + !!membershipQuery && + !membershipQuery.isPending && + !membershipQuery.isError && + membershipQuery.data.power !== '0' + ) + }) : undefined const walletCanEarlyExecute = !!matchingWalletVetoer && @@ -153,7 +175,6 @@ export const useProposalVetoState = ({ (vetoerEntity.data.type === EntityType.Cw1Whitelist && matchingWalletVetoer.type === EntityType.Wallet) ) { - const client = await getSigningCosmWasmClient() const msg = makeWasmMessage({ wasm: { execute: { @@ -168,24 +189,18 @@ export const useProposalVetoState = ({ }, }) - if (vetoerEntity.data.type === EntityType.Wallet) { - await client.signAndBroadcast( - walletAddress, - [cwMsgToEncodeObject(msg, walletAddress)], - CHAIN_GAS_MULTIPLIER + await executeSmartContract( + getSigningClient, + walletAddress, + proposalModule.address, + cwMsgToEncodeObject( + chainId, + vetoerEntity.data.type === EntityType.Wallet + ? msg + : makeCw1WhitelistExecuteMessage(vetoerEntity.data.address, msg), + walletAddress ) - } else { - await client.signAndBroadcast( - walletAddress, - [ - cwMsgToEncodeObject( - makeCw1WhitelistExecuteMessage(vetoerEntity.data.address, msg), - walletAddress - ), - ], - CHAIN_GAS_MULTIPLIER - ) - } + ) await onVetoSuccess() } else if (matchingWalletVetoer.type === EntityType.Dao) { @@ -223,7 +238,7 @@ export const useProposalVetoState = ({ neutronTimelockOverrule, router, getDaoProposalPath, - getSigningCosmWasmClient, + getSigningClient, proposalModule.address, proposalNumber, onVetoSuccess, @@ -243,7 +258,6 @@ export const useProposalVetoState = ({ (vetoerEntity.data.type === EntityType.Cw1Whitelist && matchingWalletVetoer.type === EntityType.Wallet) ) { - const client = await getSigningCosmWasmClient() const msg = makeWasmMessage({ wasm: { execute: { @@ -258,24 +272,18 @@ export const useProposalVetoState = ({ }, }) - if (vetoerEntity.data.type === EntityType.Wallet) { - await client.signAndBroadcast( - walletAddress, - [cwMsgToEncodeObject(msg, walletAddress)], - CHAIN_GAS_MULTIPLIER - ) - } else { - await client.signAndBroadcast( - walletAddress, - [ - cwMsgToEncodeObject( - makeCw1WhitelistExecuteMessage(vetoerEntity.data.address, msg), - walletAddress - ), - ], - CHAIN_GAS_MULTIPLIER + await executeSmartContract( + getSigningClient, + walletAddress, + proposalModule.address, + cwMsgToEncodeObject( + chainId, + vetoerEntity.data.type === EntityType.Wallet + ? msg + : makeCw1WhitelistExecuteMessage(vetoerEntity.data.address, msg), + walletAddress ) - } + ) await onExecuteSuccess() } else if (matchingWalletVetoer.type === EntityType.Dao) { @@ -310,7 +318,7 @@ export const useProposalVetoState = ({ }, [ vetoerEntity, matchingWalletVetoer, - getSigningCosmWasmClient, + getSigningClient, proposalModule.address, proposalNumber, onExecuteSuccess, diff --git a/packages/stateful/hooks/useQueryLoadingDataWithError.ts b/packages/stateful/hooks/useQueryLoadingDataWithError.ts index 1d309cd1a..72312a806 100644 --- a/packages/stateful/hooks/useQueryLoadingDataWithError.ts +++ b/packages/stateful/hooks/useQueryLoadingDataWithError.ts @@ -1,4 +1,4 @@ -import { QueryKey, useQuery } from '@tanstack/react-query' +import { QueryKey, skipToken, useQuery } from '@tanstack/react-query' import { useMemo } from 'react' import { useUpdatingRef } from '@dao-dao/stateless' @@ -16,7 +16,7 @@ export const useQueryLoadingDataWithError = < /** * Query options to passthrough to useQuery. */ - options: Omit< + options?: Omit< Parameters< typeof useQuery >[0], @@ -27,7 +27,13 @@ export const useQueryLoadingDataWithError = < */ transform?: (data: TQueryFnData) => TTransformedData ): LoadingDataWithError => { - const { isPending, isError, isRefetching, data, error } = useQuery(options) + const { isPending, isError, isRefetching, data, error } = useQuery( + // Loading state if options undefined. + options || { + queryKey: [] as any, + queryFn: skipToken, + } + ) const transformRef = useUpdatingRef(transform) return useMemo((): LoadingDataWithError => { diff --git a/packages/stateful/hooks/useSimulateCosmosMsgs.ts b/packages/stateful/hooks/useSimulateCosmosMsgs.ts index 80f10452d..e7e3e9161 100644 --- a/packages/stateful/hooks/useSimulateCosmosMsgs.ts +++ b/packages/stateful/hooks/useSimulateCosmosMsgs.ts @@ -1,12 +1,10 @@ -import { constSelector, useRecoilCallback, useRecoilValue } from 'recoil' +import { useCallback } from 'react' +import { constSelector, useRecoilValue } from 'recoil' -import { - DaoCoreV2Selectors, - cosmosRpcClientForChainSelector, -} from '@dao-dao/state/recoil' +import { DaoDaoCoreSelectors } from '@dao-dao/state/recoil' import { useChain } from '@dao-dao/stateless' import { - CosmosMsgFor_Empty, + UnifiedCosmosMsg, cwMsgToEncodeObject, typesRegistry, } from '@dao-dao/types' @@ -21,11 +19,14 @@ import { } from '@dao-dao/types/protobuf/codegen/cosmos/tx/v1beta1/tx' import { Any } from '@dao-dao/types/protobuf/codegen/google/protobuf/any' import { + cosmosProtoRpcClientRouter, decodeMessages, decodePolytoneExecuteMsg, isValidBech32Address, } from '@dao-dao/utils' +// TODO(secret): prevent simulating if it contains compute/wasm messages + // Simulate executing Cosmos messages on-chain. We can't just use the simulate // function on SigningCosmWasmClient or SigningStargateClient because they // include signer info from the wallet. We may want to simulate these messages @@ -38,68 +39,59 @@ import { export const useSimulateCosmosMsgs = (senderAddress: string) => { const { chain_id: chainId, bech32_prefix: bech32Prefix } = useChain() - const polytoneProxies = - useRecoilValue( - isValidBech32Address(senderAddress, bech32Prefix) - ? DaoCoreV2Selectors.polytoneProxiesSelector({ - chainId, - contractAddress: senderAddress, - }) - : constSelector(undefined) - ) ?? {} - - const simulate = useRecoilCallback( - ({ snapshot }) => - async (msgs: CosmosMsgFor_Empty[]): Promise => { - // If no messages, nothing to simulate. - if (msgs.length === 0) { - return - } - - const cosmosRpcClient = await snapshot.getPromise( - cosmosRpcClientForChainSelector(chainId) - ) - - await doSimulation(cosmosRpcClient, msgs, senderAddress) - - // Also simulate polytone messages on receiving chains. - const decodedPolytoneMessages = decodeMessages(msgs).flatMap((msg) => { - const decoded = decodePolytoneExecuteMsg(chainId, msg, 'any') - return decoded.match && decoded.cosmosMsg ? decoded : [] + const polytoneProxies = useRecoilValue( + isValidBech32Address(senderAddress, bech32Prefix) + ? DaoDaoCoreSelectors.polytoneProxiesSelector({ + chainId, + contractAddress: senderAddress, }) + : constSelector(undefined) + ) - if (decodedPolytoneMessages.length) { - const polytoneGroupedByChainId = decodedPolytoneMessages.reduce( - (acc, decoded) => ({ - ...acc, - [decoded.chainId]: [ - ...(acc[decoded.chainId] ?? []), - ...decoded.cosmosMsgs, - ], - }), - {} as Record - ) + const simulate = useCallback( + async (msgs: UnifiedCosmosMsg[]): Promise => { + // If no messages, nothing to simulate. + if (msgs.length === 0) { + return + } - await Promise.all( - Object.entries(polytoneGroupedByChainId).map( - async ([chainId, msgs]) => { - const polytoneProxy = polytoneProxies[chainId] - const cosmosRpcClient = await snapshot.getPromise( - cosmosRpcClientForChainSelector(chainId) - ) - if (!polytoneProxy || !msgs?.length) { - return - } - - await doSimulation(cosmosRpcClient, msgs, polytoneProxy) + await doSimulation(chainId, msgs, senderAddress) + + // Also simulate polytone messages on receiving chains. + const decodedPolytoneMessages = decodeMessages(msgs).flatMap((msg) => { + const decoded = decodePolytoneExecuteMsg(chainId, msg, 'any') + return decoded.match && decoded.cosmosMsg ? decoded : [] + }) + + if (decodedPolytoneMessages.length) { + const polytoneGroupedByChainId = decodedPolytoneMessages.reduce( + (acc, decoded) => ({ + ...acc, + [decoded.chainId]: [ + ...(acc[decoded.chainId] ?? []), + ...decoded.cosmosMsgs, + ], + }), + {} as Record + ) + + await Promise.all( + Object.entries(polytoneGroupedByChainId).map( + async ([chainId, msgs]) => { + const polytoneProxy = (polytoneProxies || {})[chainId] + if (!polytoneProxy || !msgs?.length) { + return } - ) + + await doSimulation(chainId, msgs, polytoneProxy) + } ) - } + ) + } - // Unfortunately we can't simulate messages from an ICA for weird - // cosmos-sdk reasons... YOLO - }, + // Unfortunately we can't simulate messages from an ICA for weird + // cosmos-sdk reasons... YOLO + }, [chainId, polytoneProxies, senderAddress] ) @@ -107,14 +99,14 @@ export const useSimulateCosmosMsgs = (senderAddress: string) => { } const doSimulation = async ( - cosmosRpcClient: Awaited< - ReturnType - >['cosmos'], - msgs: CosmosMsgFor_Empty[], + chainId: string, + msgs: UnifiedCosmosMsg[], senderAddress: string ) => { + const cosmosRpcClient = await cosmosProtoRpcClientRouter.connect(chainId) + const encodedMsgs = msgs.map((msg) => { - const encoded = cwMsgToEncodeObject(msg, senderAddress) + const encoded = cwMsgToEncodeObject(chainId, msg, senderAddress) return typesRegistry.encodeAsAny(encoded) }) diff --git a/packages/stateful/hooks/useSyncWalletSigner.ts b/packages/stateful/hooks/useSyncWalletSigner.ts index bc9544317..1892df867 100644 --- a/packages/stateful/hooks/useSyncWalletSigner.ts +++ b/packages/stateful/hooks/useSyncWalletSigner.ts @@ -1,4 +1,3 @@ -import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate' import { useEffect } from 'react' import { useSetRecoilState } from 'recoil' @@ -10,7 +9,7 @@ import { useWallet } from './useWallet' export const useSyncWalletSigner = () => { const { chain: { chain_id: chainId }, - getSigningCosmWasmClient, + getSigningClient, address, isWalletConnected, } = useWallet() @@ -28,19 +27,11 @@ export const useSyncWalletSigner = () => { ;(async () => { try { - const signingCosmWasmClient = await getSigningCosmWasmClient() - setSigningCosmWasmClient( - // cosmos-kit has an older version of the package. This is a workaround. - signingCosmWasmClient as unknown as SigningCosmWasmClient - ) + const signingCosmWasmClient = await getSigningClient() + setSigningCosmWasmClient(signingCosmWasmClient) } catch (err) { console.error(err) } })() - }, [ - setSigningCosmWasmClient, - address, - isWalletConnected, - getSigningCosmWasmClient, - ]) + }, [getSigningClient, address, isWalletConnected, setSigningCosmWasmClient]) } diff --git a/packages/stateful/hooks/useWallet.ts b/packages/stateful/hooks/useWallet.ts index b50cce7d4..84f19be3e 100644 --- a/packages/stateful/hooks/useWallet.ts +++ b/packages/stateful/hooks/useWallet.ts @@ -2,6 +2,7 @@ import { Chain } from '@chain-registry/types' import { toHex } from '@cosmjs/encoding' import { ChainContext, WalletAccount } from '@cosmos-kit/core' import { useChain, useManager } from '@cosmos-kit/react-lite' +import { SecretUtils } from '@keplr-wallet/types' import { useQueryClient } from '@tanstack/react-query' import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { useRecoilValue } from 'recoil' @@ -11,12 +12,21 @@ import { walletChainIdAtom, walletHexPublicKeySelector, } from '@dao-dao/state/recoil' +import { makeGetSignerOptions } from '@dao-dao/state/utils' import { useCachedLoading, useChainContextIfAvailable, } from '@dao-dao/stateless' import { LoadingData } from '@dao-dao/types' -import { getSupportedChains, maybeGetChainForChainId } from '@dao-dao/utils' +import { + SecretSigningCosmWasmClient, + SupportedSigningCosmWasmClient, + getLcdForChainId, + getRpcForChainId, + getSupportedChains, + isSecretNetwork, + maybeGetChainForChainId, +} from '@dao-dao/utils' export type UseWalletOptions = { /** @@ -40,6 +50,18 @@ export type UseWalletReturn = Omit & { chain: Chain account: WalletAccount | undefined hexPublicKey: LoadingData + /** + * Fetch the Secret Network signing client for the current wallet. + */ + getSecretSigningCosmWasmClient: () => Promise + /** + * Fetch the relevant signing client for the current wallet. + */ + getSigningClient: () => Promise + /** + * Fetch SecretUtils from the wallet if available + */ + getSecretUtils: () => SecretUtils } export const useWallet = ({ @@ -180,27 +202,69 @@ export const useWallet = ({ }, [queryClient, chain.chain_id]) const response = useMemo( - (): UseWalletReturn => ({ - ...walletChainRef.current, - chainWallet: - walletChainRef.current.chainWallet || - // Fallback to getting chain wallet from repo if not set on walletChain. - // This won't be set if the walletChain is disconnected. - (mainWalletRef.current - ? getWalletRepo(chain.chain_name).getWallet( - mainWalletRef.current.walletName - ) - : undefined), - connect, - // Use chain from our version of the chain-registry. - chain, - account, - hexPublicKey: hexPublicKeyData - ? { loading: false, data: hexPublicKeyData } - : !hexPublicKeyFromChain.loading && hexPublicKeyFromChain.data - ? { loading: false, data: hexPublicKeyFromChain.data } - : { loading: true }, - }), + (): UseWalletReturn => { + // TODO(secret): support different enigma utils sources based on connected + // wallet + const getSecretUtils = () => { + const secretUtils = window.keplr?.getEnigmaUtils(chain.chain_id) + if (!secretUtils) { + throw new Error('No Secret utils found') + } + return secretUtils + } + + // Get Secret Network signing client with Keplr's encryption utils. + const getSecretSigningCosmWasmClient = async () => { + if (!isSecretNetwork(chain.chain_id)) { + throw new Error('Not on Secret Network') + } + + const signer = walletChainRef.current.getOfflineSignerAmino() + + return await SecretSigningCosmWasmClient.secretConnectWithSigner( + getRpcForChainId(chain.chain_id), + signer, + makeGetSignerOptions(queryClient)(chain), + { + url: getLcdForChainId(chain.chain_id), + chainId: chain.chain_id, + wallet: signer, + walletAddress: walletChainRef.current.address, + encryptionUtils: getSecretUtils(), + } + ) + } + + // Get relevant signing client based on chain. + const getSigningClient = isSecretNetwork(chain.chain_id) + ? getSecretSigningCosmWasmClient + : walletChainRef.current.getSigningCosmWasmClient + + return { + ...walletChainRef.current, + chainWallet: + walletChainRef.current.chainWallet || + // Fallback to getting chain wallet from repo if not set on + // walletChain. This won't be set if the walletChain is disconnected. + (mainWalletRef.current + ? getWalletRepo(chain.chain_name).getWallet( + mainWalletRef.current.walletName + ) + : undefined), + connect, + // Use chain from our version of the chain-registry. + chain, + account, + hexPublicKey: hexPublicKeyData + ? { loading: false, data: hexPublicKeyData } + : !hexPublicKeyFromChain.loading && hexPublicKeyFromChain.data + ? { loading: false, data: hexPublicKeyFromChain.data } + : { loading: true }, + getSecretSigningCosmWasmClient, + getSigningClient, + getSecretUtils, + } + }, // eslint-disable-next-line react-hooks/exhaustive-deps [ connect, @@ -211,6 +275,7 @@ export const useWallet = ({ walletChainRef.current?.chain.chain_id, walletChainRef.current?.status, hexPublicKeyFromChain, + queryClient, ] ) diff --git a/packages/stateful/index.ts b/packages/stateful/index.ts index 7debc3022..eb1750abc 100644 --- a/packages/stateful/index.ts +++ b/packages/stateful/index.ts @@ -1,3 +1,4 @@ +export * from './clients' export * from './components' export * from './hooks' export * from './queries' diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 6424210b4..4999a4669 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -73,6 +73,7 @@ "react-use": "^17.4.2", "recoil": "^0.7.2", "remove-markdown": "^0.5.0", + "secretjs": "^1.12.5", "use-deep-compare-effect": "^1.8.1", "uuid": "^9.0.0" }, diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/actions/UpdatePreProposeConfig/UpdatePreProposeConfigComponent.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/actions/UpdatePreProposeConfig/UpdatePreProposeConfigComponent.tsx index 747d97dac..41c109339 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/actions/UpdatePreProposeConfig/UpdatePreProposeConfigComponent.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/actions/UpdatePreProposeConfig/UpdatePreProposeConfigComponent.tsx @@ -41,7 +41,9 @@ export interface UpdatePreProposeConfigData { denomOrAddress: string // Loaded from token input fields to access metadata. token?: GenericToken - refundPolicy: DepositRefundPolicy + // make compatible with string union types with matching values, which is + // what gets auto-generated + refundPolicy: `${DepositRefundPolicy}` } anyoneCanPropose: boolean } @@ -248,7 +250,7 @@ export const UpdatePreProposeConfigComponent: ActionComponent<

{t('form.refundPolicyTitle')}

- + disabled={!isCreating} onSelect={(refundPolicy) => setValue( diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/actions/UpdatePreProposeConfig/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/actions/UpdatePreProposeConfig/index.tsx index 439f35801..76b252edc 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/actions/UpdatePreProposeConfig/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/actions/UpdatePreProposeConfig/index.tsx @@ -13,7 +13,8 @@ import { ActionKey, ActionMaker, DepositRefundPolicy, - ProposalModule, + Feature, + IProposalModuleBase, TokenType, UseDecodedCosmosMsg, UseDefaults, @@ -28,6 +29,7 @@ import { convertDenomToMicroDenomStringWithDecimals, convertMicroDenomToDenomWithDecimals, getNativeTokenForChainId, + isFeatureSupportedByVersion, isValidBech32Address, makeWasmMessage, } from '@dao-dao/utils' @@ -120,7 +122,9 @@ export const Component: ActionComponent = (props) => { } export const makeUpdatePreProposeConfigActionMaker = - ({ prePropose }: ProposalModule): ActionMaker => + ({ + prePropose, + }: IProposalModuleBase): ActionMaker => ({ t, chain: { chain_id: chainId } }) => { // Only when pre propose address present. if (!prePropose) { @@ -215,7 +219,12 @@ export const makeUpdatePreProposeConfigActionMaker = return { depositRequired, depositInfo, - anyoneCanPropose: config.open_proposal_submission, + anyoneCanPropose: isFeatureSupportedByVersion( + Feature.GranularSubmissionPolicy, + prePropose.version + ) + ? !!config.submission_policy && 'anyone' in config.submission_policy + : !!config.open_proposal_submission, } } @@ -273,7 +282,24 @@ export const makeUpdatePreProposeConfigActionMaker = refund_policy: depositInfo.refundPolicy, } : null, - open_proposal_submission: anyoneCanPropose, + ...(isFeatureSupportedByVersion( + Feature.GranularSubmissionPolicy, + prePropose.version + ) + ? { + submission_policy: anyoneCanPropose + ? { + anyone: {}, + } + : { + specific: { + dao_members: true, + }, + }, + } + : { + open_proposal_submission: anyoneCanPropose, + }), }, } @@ -299,7 +325,6 @@ export const makeUpdatePreProposeConfigActionMaker = { update_config: { deposit_info: {}, - open_proposal_submission: {}, }, } ) @@ -337,7 +362,17 @@ export const makeUpdatePreProposeConfigActionMaker = } const anyoneCanPropose = - !!msg.wasm.execute.msg.update_config.open_proposal_submission + // < v2.5.0 + 'open_proposal_submission' in msg.wasm.execute.msg.update_config + ? !!msg.wasm.execute.msg.update_config.open_proposal_submission + : // >= v2.5.0 + 'submission_policy' in msg.wasm.execute.msg.update_config + ? 'anyone' in msg.wasm.execute.msg.update_config.submission_policy + : undefined + + if (anyoneCanPropose === undefined) { + return { match: false } + } if (!configDepositInfo || !token.data) { return { diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/actions/UpdateProposalConfig/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/actions/UpdateProposalConfig/index.tsx index 5718cc1f7..db94f2013 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/actions/UpdateProposalConfig/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/actions/UpdateProposalConfig/index.tsx @@ -17,7 +17,7 @@ import { ActionKey, ActionMaker, Feature, - ProposalModule, + IProposalModuleBase, UseDecodedCosmosMsg, UseDefaults, UseTransformToCosmos, @@ -89,7 +89,7 @@ const typePercentageToPercentageThreshold = ( export const makeUpdateProposalConfigActionMaker = ({ version, address: proposalModuleAddress, -}: ProposalModule): ActionMaker => { +}: IProposalModuleBase): ActionMaker => { const Component: ActionComponent = (props) => { const { t } = useTranslation() const { setError, clearErrors, watch, trigger } = diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/components/NewProposal.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/components/NewProposal.tsx index 812392e58..de0e67a0e 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/components/NewProposal.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/components/NewProposal.tsx @@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next' import { useRecoilCallback, useRecoilValueLoadable } from 'recoil' import { - DaoCoreV2Selectors, + DaoDaoCoreSelectors, DaoProposalMultipleSelectors, blocksPerYearSelector, } from '@dao-dao/state' @@ -18,10 +18,7 @@ import { useChain, useDaoInfoContext, } from '@dao-dao/stateless' -import { - BaseNewProposalProps, - IProposalModuleAdapterCommonOptions, -} from '@dao-dao/types' +import { BaseNewProposalProps, IProposalModuleBase } from '@dao-dao/types' import { MAX_NUM_PROPOSAL_CHOICES, convertActionsToMessages, @@ -44,13 +41,13 @@ import { NewProposalMain } from './NewProposalMain' import { NewProposalPreview } from './NewProposalPreview' export type NewProposalProps = BaseNewProposalProps & { - options: IProposalModuleAdapterCommonOptions + proposalModule: IProposalModuleBase usePublishProposal: UsePublishProposal } export const NewProposal = ({ onCreateSuccess, - options, + proposalModule, usePublishProposal, ...props }: NewProposalProps) => { @@ -70,9 +67,7 @@ export const NewProposal = ({ const proposalTitle = watch('title') const choices = watch('choices') ?? [] - const { isMember = false, loading: membershipLoading } = useMembership({ - coreAddress, - }) + const { isMember = false, loading: membershipLoading } = useMembership() const [loading, setLoading] = useState(false) @@ -80,7 +75,7 @@ export const NewProposal = ({ // which is refreshed periodically, so use a loadable to avoid unnecessary // re-renders. const pauseInfo = useCachedLoadable( - DaoCoreV2Selectors.pauseInfoSelector({ + DaoDaoCoreSelectors.pauseInfoSelector({ chainId, contractAddress: coreAddress, params: [], @@ -101,7 +96,7 @@ export const NewProposal = ({ const { simulateProposal: _simulateProposal, publishProposal, - anyoneCanPropose, + cannotProposeReason, depositUnsatisfied, simulationBypassExpiration, } = usePublishProposal() @@ -145,7 +140,9 @@ export const NewProposal = ({ ) const proposalInfo = await makeGetProposalInfo({ - ...options, + chain: proposalModule.dao.chain, + coreAddress: proposalModule.dao.coreAddress, + proposalModule: proposalModule.info, proposalNumber, proposalId, isPreProposeApprovalProposal: false, @@ -162,7 +159,7 @@ export const NewProposal = ({ await snapshot.getPromise( DaoProposalMultipleSelectors.proposalSelector({ chainId, - contractAddress: options.proposalModule.address, + contractAddress: proposalModule.address, params: [ { proposalId: proposalNumber, @@ -223,7 +220,7 @@ export const NewProposal = ({ isWalletConnected, t, publishProposal, - options, + proposalModule, blocksPerYearLoadable, getStargateClient, chainId, @@ -247,7 +244,11 @@ export const NewProposal = ({ options: choices.map((option) => ({ title: option.title, description: option.description, - msgs: convertActionsToMessages(loadedActions, option.actionData), + // Type mismatch between Cosmos msgs and Secret Network Cosmos msgs. The + // contract execution will fail if the messages are invalid, so this is + // safe. The UI should ensure that the co rrect messages are used for + // the given chain anyways. + msgs: convertActionsToMessages(loadedActions, option.actionData) as any, })), }, }) @@ -264,7 +265,7 @@ export const NewProposal = ({ }) : undefined } - anyoneCanPropose={anyoneCanPropose} + cannotProposeReason={cannotProposeReason} connected={isWalletConnected} content={{ Header: NewProposalTitleDescriptionHeader, diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/components/NewProposalPreview.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/components/NewProposalPreview.tsx index 1b4aed653..3f013774f 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/components/NewProposalPreview.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/components/NewProposalPreview.tsx @@ -3,7 +3,6 @@ import { useFormContext } from 'react-hook-form' import { useTranslation } from 'react-i18next' import { ProposalContentDisplay } from '@dao-dao/stateless' -import { MultipleChoiceOptionType } from '@dao-dao/types/contracts/DaoProposalMultiple' import { convertActionsToMessages } from '@dao-dao/utils' import { useLoadedActionsAndCategories } from '../../../../../actions' @@ -48,7 +47,7 @@ export const NewProposalPreview = () => { index, msgs: [], title, - option_type: MultipleChoiceOptionType.Standard, + option_type: 'standard', vote_count: '0', }, actionData: [], @@ -83,7 +82,7 @@ export const NewProposalPreview = () => { index: choices.length, msgs: [], title: '', - option_type: MultipleChoiceOptionType.None, + option_type: 'none', vote_count: '0', }, actionData: [], diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/hooks/makeUsePublishProposal.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/hooks/makeUsePublishProposal.ts index e16281522..a0167eae0 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/hooks/makeUsePublishProposal.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/hooks/makeUsePublishProposal.ts @@ -15,17 +15,14 @@ import { } from '@dao-dao/state' import { useCachedLoadable } from '@dao-dao/stateless' import { - CHAIN_GAS_MULTIPLIER, MAX_NUM_PROPOSAL_CHOICES, + checkProposalSubmissionPolicy, expirationExpired, - findWasmAttributeValue, processError, } from '@dao-dao/utils' import { Cw20BaseHooks, - DaoPreProposeMultipleHooks, - DaoProposalMultipleHooks, useAwaitNextBlock, useMembership, useSimulateCosmosMsgs, @@ -38,36 +35,24 @@ import { SimulateProposal, UsePublishProposal, } from '../../types' -import { anyoneCanProposeSelector } from '../selectors' export const makeUsePublishProposal = ({ - options: { - chain: { chain_id: chainId }, - coreAddress, - proposalModule, - }, + proposalModule, depositInfoSelector, }: MakeUsePublishProposalOptions): UsePublishProposal => () => { const { t } = useTranslation() + const { + dao: { chainId, coreAddress }, + prePropose, + } = proposalModule const { isWalletConnected, address: walletAddress, - getStargateClient, - } = useWallet({ - chainId, - }) - const { isMember = false } = useMembership({ - coreAddress, - }) - - const anyoneCanPropose = useRecoilValueLoadable( - anyoneCanProposeSelector({ - chainId, - preProposeAddress: proposalModule.prePropose?.address ?? null, - }) - ) + getSigningClient, + } = useWallet() + const { isMember = false } = useMembership() const depositInfo = useRecoilValueLoadable(depositInfoSelector) const depositInfoCw20TokenAddress = @@ -97,8 +82,7 @@ export const makeUsePublishProposal = owner: walletAddress, // If pre-propose address set, give that one deposit allowance // instead of proposal module. - spender: - proposalModule.prePropose?.address || proposalModule.address, + spender: prePropose?.address || proposalModule.address, }, ], }) @@ -164,15 +148,6 @@ export const makeUsePublishProposal = sender: walletAddress ?? '', }) - const doPropose = DaoProposalMultipleHooks.usePropose({ - contractAddress: proposalModule.address, - sender: walletAddress ?? '', - }) - const doProposePrePropose = DaoPreProposeMultipleHooks.usePropose({ - contractAddress: proposalModule.prePropose?.address ?? '', - sender: walletAddress ?? '', - }) - const awaitNextBlock = useAwaitNextBlock() const simulateMsgs = useSimulateCosmosMsgs(coreAddress) @@ -219,20 +194,23 @@ export const makeUsePublishProposal = [simulateMsgs, t] ) + const cannotProposeReason = checkProposalSubmissionPolicy({ + proposalModule: proposalModule.info, + address: walletAddress, + isMember, + t, + }) + const publishProposal: PublishProposal = useCallback( async ( { title, description, choices }, { failedSimulationBypassSeconds = 0 } = {} ) => { - if (!isWalletConnected) { + if (!isWalletConnected || !walletAddress) { throw new Error(t('error.logInToContinue')) } - if ( - anyoneCanPropose.state === 'hasValue' && - !anyoneCanPropose.contents && - !isMember - ) { - throw new Error(t('error.mustBeMemberToCreateProposal')) + if (cannotProposeReason) { + throw new Error(cannotProposeReason) } if (depositUnsatisfied) { throw new Error(t('error.notEnoughForDeposit')) @@ -298,7 +276,7 @@ export const makeUsePublishProposal = // If allowance expired, none. (expirationExpired( cw20DepositTokenAllowanceResponse.expires, - (await (await getStargateClient()).getBlock()).header.height + (await (await getSigningClient()).getBlock()).header.height ) ? 0 : Number(cw20DepositTokenAllowanceResponse.allowance)) @@ -312,7 +290,7 @@ export const makeUsePublishProposal = spender: // If pre-propose address set, give that one deposit allowance // instead of proposal module. - proposalModule.prePropose?.address || proposalModule.address, + prePropose?.address || proposalModule.address, }) // Allowances will not update until the next block has been added. @@ -346,61 +324,34 @@ export const makeUsePublishProposal = choices, } - let { events } = proposalModule.prePropose - ? await doProposePrePropose( - { - msg: { - propose: proposalData, - }, - }, - CHAIN_GAS_MULTIPLIER, - undefined, - proposeFunds - ) - : await doPropose( - proposalData, - CHAIN_GAS_MULTIPLIER, - undefined, - proposeFunds - ) + const response = await proposalModule.propose({ + data: proposalData, + getSigningClient, + sender: walletAddress, + funds: proposeFunds, + }) if (proposeFunds?.length) { refreshBalances() } - const proposalNumber = Number( - findWasmAttributeValue( - events, - proposalModule.address, - 'proposal_id' - ) ?? -1 - ) - if (proposalNumber === -1) { - throw new Error(t('error.proposalIdNotFound')) - } - const proposalId = `${proposalModule.prefix}${proposalNumber}` - - return { - proposalNumber, - proposalId, - } + return response }, [ isWalletConnected, - anyoneCanPropose, - isMember, + walletAddress, + cannotProposeReason, depositUnsatisfied, simulationBypassExpiration, requiredProposalDeposit, depositInfoCw20TokenAddress, depositInfoNativeTokenDenom, - doProposePrePropose, - doPropose, + getSigningClient, t, simulateMsgs, cw20DepositTokenAllowanceResponse, - getStargateClient, increaseCw20DepositAllowance, + prePropose?.address, awaitNextBlock, refreshBalances, ] @@ -409,10 +360,7 @@ export const makeUsePublishProposal = return { simulateProposal, publishProposal, - // Default to true while loading. This is safe because the contract will - // reject anyone who is unauthorized. Defaulting to true here results in - // hiding the error until the real value is ready. - anyoneCanPropose: anyoneCanPropose.valueMaybe() ?? true, + cannotProposeReason, depositUnsatisfied, simulationBypassExpiration, } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/selectors.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/selectors.ts index 0c7f2ceb2..acac3a8df 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/selectors.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/selectors.ts @@ -147,30 +147,3 @@ export const depositInfoSelector: ( return depositInfo }, }) - -export const anyoneCanProposeSelector = selectorFamily< - boolean, - WithChainId<{ - // Null if doesn't have pre-propose module. - preProposeAddress: string | null - }> ->({ - key: 'daoPreProposeMultipleAnyoneCanPropose', - get: - ({ chainId, preProposeAddress }) => - ({ get }) => { - if (preProposeAddress) { - const config = get( - DaoPreProposeMultipleSelectors.configSelector({ - contractAddress: preProposeAddress, - chainId, - params: [], - }) - ) - - return config.open_proposal_submission - } - - return false - }, -}) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/MultipleChoiceOptionViewer.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/MultipleChoiceOptionViewer.tsx index f20e78719..22e1868eb 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/MultipleChoiceOptionViewer.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/MultipleChoiceOptionViewer.tsx @@ -13,7 +13,6 @@ import { Tooltip, } from '@dao-dao/stateless' import { SuspenseLoaderProps } from '@dao-dao/types' -import { MultipleChoiceOptionType } from '@dao-dao/types/contracts/DaoProposalMultiple' import { decodeRawDataForDisplay } from '@dao-dao/utils' import { MultipleChoiceOptionData } from '../types' @@ -42,13 +41,13 @@ export const MultipleChoiceOptionViewer = ({ const [showRaw, setShowRaw] = useState(false) - const isNoneOption = choice.option_type === MultipleChoiceOptionType.None + const isNoneOption = choice.option_type === 'none' const noMessages = decodedMessages.length === 0 const noContent = noMessages && !choice.description // Close none of the above and disallow expanding. const [expanded, setExpanded] = useState( - choice.option_type !== MultipleChoiceOptionType.None && + choice.option_type !== 'none' && // Default collapsed if there is a winner and it is not this one. (winner === undefined || winner) && // Default collapsed if there are no messages and no description. diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalInnerContentDisplay.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalInnerContentDisplay.tsx index 907bc6900..340ab5872 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalInnerContentDisplay.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalInnerContentDisplay.tsx @@ -11,7 +11,6 @@ import { ProposalVoteOption, } from '@dao-dao/types' import { - MultipleChoiceOptionType, MultipleChoiceProposal, MultipleChoiceVote, } from '@dao-dao/types/contracts/DaoProposalMultiple' @@ -120,9 +119,7 @@ export const InnerProposalInnerContentDisplay = ({ title: proposal.title, description: proposal.description, choices: optionsData - .filter( - ({ choice }) => choice.option_type !== MultipleChoiceOptionType.None - ) + .filter(({ choice }) => choice.option_type !== 'none') .map(({ choice, actionData }) => ({ title: choice.title, description: choice.description, diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalLine.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalLine.tsx index c2861a47b..59044aa73 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalLine.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalLine.tsx @@ -37,14 +37,11 @@ const InnerProposalLine = ({ proposal: ProposalWithMetadata }) => { const { - coreAddress, proposalModule: { prefix: proposalPrefix }, proposalNumber, } = useProposalModuleAdapterOptions() - const { isMember = false } = useMembership({ - coreAddress, - }) + const { isMember = false } = useMembership() const loadingWalletVoteInfo = useLoadingWalletVoteInfo() const timeAgoFormatter = useTranslatedTimeDeltaFormatter({ words: false }) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalStatusAndInfo.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalStatusAndInfo.tsx index 9a8e882d6..ced04c1aa 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalStatusAndInfo.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalStatusAndInfo.tsx @@ -43,12 +43,10 @@ import { import { EntityDisplay, SuspenseLoader } from '../../../../components' import { ButtonLink } from '../../../../components/ButtonLink' import { - DaoProposalMultipleHooks, useAwaitNextBlock, useProposalActionState, useProposalRelayState, useProposalVetoState, - useWallet, } from '../../../../hooks' import { useProposalModuleAdapterOptions } from '../../../react' import { @@ -114,7 +112,6 @@ const InnerProposalStatusAndInfo = ({ } = useConfiguredChainContext() const { coreAddress } = useDaoInfoContext() const { proposalModule, proposalNumber } = useProposalModuleAdapterOptions() - const { address: walletAddress = '' } = useWallet() const config = useRecoilValue( DaoProposalMultipleSelectors.configSelector({ @@ -129,15 +126,6 @@ const InnerProposalStatusAndInfo = ({ const statusKey = getProposalStatusKey(proposal.status) - const executeProposal = DaoProposalMultipleHooks.useExecute({ - contractAddress: proposalModule.address, - sender: walletAddress, - }) - const closeProposal = DaoProposalMultipleHooks.useClose({ - contractAddress: proposalModule.address, - sender: walletAddress, - }) - const relayState = useProposalRelayState({ msgs: winningChoice?.msgs || [], status: proposal.status, @@ -151,8 +139,6 @@ const InnerProposalStatusAndInfo = ({ statusKey, relayState, loadingExecutionTxHash, - executeProposal, - closeProposal, onExecuteSuccess, onCloseSuccess, }) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVoteTally/ProposalVoteTally.stories.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVoteTally/ProposalVoteTally.stories.tsx index b695f01ab..84124ce76 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVoteTally/ProposalVoteTally.stories.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVoteTally/ProposalVoteTally.stories.tsx @@ -1,8 +1,8 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' import { ProcessedTQType, ProposalStatusEnum } from '@dao-dao/types' -import { MultipleChoiceOptionType } from '@dao-dao/types/contracts/DaoProposalMultiple' +import { ProcessedMultipleChoiceOption } from '../../types' import { ProposalVoteTally } from './ProposalVoteTally' export default { @@ -17,12 +17,12 @@ const Template: ComponentStory = (args) => (
) -const choices = [ +const choices: ProcessedMultipleChoiceOption[] = [ { description: 'description', index: 0, msgs: [], - optionType: MultipleChoiceOptionType.Standard, + optionType: 'standard', title: 'OPTION 1', turnoutVotePercentage: 100, color: '#8B2EFF', @@ -31,7 +31,7 @@ const choices = [ description: 'description', index: 0, msgs: [], - optionType: MultipleChoiceOptionType.Standard, + optionType: 'standard', title: 'OPTION 3', turnoutVotePercentage: 0, color: '#004EFF', @@ -40,7 +40,7 @@ const choices = [ description: 'description', index: 0, msgs: [], - optionType: MultipleChoiceOptionType.Standard, + optionType: 'standard', title: 'OPTION 2', turnoutVotePercentage: 0, color: '#4F00FF', @@ -49,19 +49,19 @@ const choices = [ description: 'description', index: 1, msgs: [], - optionType: MultipleChoiceOptionType.None, + optionType: 'none', title: 'titular_none_option', turnoutVotePercentage: 0, color: '#00B3FF', }, ] -const choicesTied = [ +const choicesTied: ProcessedMultipleChoiceOption[] = [ { description: 'description', index: 0, msgs: [], - optionType: MultipleChoiceOptionType.Standard, + optionType: 'standard', title: 'OPTION 1', turnoutVotePercentage: 25, color: '#00B3FF', @@ -70,7 +70,7 @@ const choicesTied = [ description: 'description', index: 0, msgs: [], - optionType: MultipleChoiceOptionType.Standard, + optionType: 'standard', title: 'OPTION 3', turnoutVotePercentage: 25, color: '#4F00FF', @@ -79,7 +79,7 @@ const choicesTied = [ description: 'description', index: 0, msgs: [], - optionType: MultipleChoiceOptionType.Standard, + optionType: 'standard', title: 'OPTION 2', turnoutVotePercentage: 25, color: '#8B2EFF', @@ -88,7 +88,7 @@ const choicesTied = [ description: 'description', index: 1, msgs: [], - optionType: MultipleChoiceOptionType.None, + optionType: 'none', title: 'titular_none_option', turnoutVotePercentage: 25, color: '#004EFF', diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/daoCreation/getInstantiateInfo.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/daoCreation/getInstantiateInfo.ts index 2b427fcd1..591d64787 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/daoCreation/getInstantiateInfo.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/daoCreation/getInstantiateInfo.ts @@ -1,24 +1,20 @@ -import { ContractVersion, DaoCreationGetInstantiateInfo } from '@dao-dao/types' -import { InstantiateMsg as DaoPreProposeMultipleInstantiateMsg } from '@dao-dao/types/contracts/DaoPreProposeMultiple' -import { InstantiateMsg as DaoProposalMultipleInstantiateMsg } from '@dao-dao/types/contracts/DaoProposalMultiple' +import { DaoCreationGetInstantiateInfo } from '@dao-dao/types' import { - DaoProposalMultipleAdapterId, convertDenomToMicroDenomStringWithDecimals, convertDurationWithUnitsToDuration, convertVetoConfigToCosmos, - encodeJsonToBase64, + isSecretNetwork, } from '@dao-dao/utils' -import { makeValidateMsg } from '@dao-dao/utils/validation/makeValidateMsg' +import { MultipleChoiceProposalModule } from '../../../../clients/proposal-module/MultipleChoiceProposalModule' +import { SecretMultipleChoiceProposalModule } from '../../../../clients/proposal-module/MultipleChoiceProposalModule.secret' import { DaoCreationExtraVotingConfig } from '../types' import { convertPercentOrMajorityValueToPercentageThreshold } from '../utils' -import instantiateSchema from './instantiate_schema.json' -import preProposeInstantiateSchema from './pre_propose_instantiate_schema.json' export const getInstantiateInfo: DaoCreationGetInstantiateInfo< DaoCreationExtraVotingConfig > = ( - { createWithCw20, codeIds, historicalCodeIds }, + { chainId, createWithCw20 }, { name, votingConfig: { @@ -31,103 +27,109 @@ export const getInstantiateInfo: DaoCreationGetInstantiateInfo< veto, }, }, - { moduleInstantiateFundsUnsupported }, - t + { moduleInstantiateFundsUnsupported } ) => { - const decimals = proposalDeposit.token?.decimals ?? 0 + const commonConfig = { + quorum: convertPercentOrMajorityValueToPercentageThreshold(quorum), + maxVotingPeriod: convertDurationWithUnitsToDuration(votingDuration), + allowRevoting, + veto: convertVetoConfigToCosmos(veto), + submissionPolicy: anyoneCanPropose ? 'anyone' : 'members', + onlyMembersExecute: onlyMembersExecute, + } as const - const preProposeMultipleInstantiateMsg: DaoPreProposeMultipleInstantiateMsg = - { - deposit_info: proposalDeposit.enabled - ? { - amount: convertDenomToMicroDenomStringWithDecimals( - proposalDeposit.amount, - decimals - ), - denom: - proposalDeposit.type === 'voting_module_token' - ? { - voting_module_token: { - token_type: createWithCw20 ? 'cw20' : 'native', - }, - } - : { - token: { - denom: - proposalDeposit.type === 'native' - ? { - native: proposalDeposit.denomOrAddress, - } - : // proposalDeposit.type === 'cw20' - { - cw20: proposalDeposit.denomOrAddress, - }, - }, - }, - refund_policy: proposalDeposit.refundPolicy, - } - : null, - extension: {}, - open_proposal_submission: anyoneCanPropose, + if (isSecretNetwork(chainId)) { + if ( + proposalDeposit.enabled && + proposalDeposit.type === 'cw20' && + !proposalDeposit.token?.snip20CodeHash + ) { + throw new Error('SNIP20 proposal deposit token code hash not loaded') } - // Validate and throw error if invalid according to JSON schema. - makeValidateMsg( - preProposeInstantiateSchema, - t - )(preProposeMultipleInstantiateMsg) - - const codeIdsToUse = { - ...codeIds, - // If module instantiation funds are unsupported, use the v2.1.0 contracts - // which are the last ones that did not support funds. - ...(moduleInstantiateFundsUnsupported && - historicalCodeIds?.[ContractVersion.V210]), - } - - const msg: DaoProposalMultipleInstantiateMsg = { - allow_revoting: allowRevoting, - close_proposal_on_execution_failure: true, - max_voting_period: convertDurationWithUnitsToDuration(votingDuration), - min_voting_period: null, - only_members_execute: !!onlyMembersExecute, - pre_propose_info: { - module_may_propose: { - info: { - admin: { core_module: {} }, - code_id: codeIdsToUse.DaoPreProposeMultiple, - label: `DAO_${name.trim()}_pre-propose-${DaoProposalMultipleAdapterId}`, - msg: encodeJsonToBase64(preProposeMultipleInstantiateMsg), - // This function is used by the enable multiple choice action, and - // DAOs before v2.3.0 still might want to enable multiple choice, so - // make sure to support the old version without the `funds` field. - ...(!moduleInstantiateFundsUnsupported && { - funds: [], - }), - }, - }, - }, - voting_strategy: { - single_choice: { - quorum: convertPercentOrMajorityValueToPercentageThreshold(quorum), + return SecretMultipleChoiceProposalModule.generateModuleInstantiateInfo( + chainId, + name, + { + ...commonConfig, + deposit: proposalDeposit.enabled + ? { + amount: convertDenomToMicroDenomStringWithDecimals( + proposalDeposit.amount, + proposalDeposit.token?.decimals ?? 0 + ), + denom: + proposalDeposit.type === 'voting_module_token' + ? { + voting_module_token: { + token_type: createWithCw20 ? 'cw20' : 'native', + }, + } + : { + token: { + denom: + proposalDeposit.type === 'native' + ? { + native: proposalDeposit.denomOrAddress, + } + : // proposalDeposit.type === 'cw20' + { + snip20: [ + proposalDeposit.denomOrAddress, + // Type-checked above. + proposalDeposit.token!.snip20CodeHash!, + ], + }, + }, + }, + refund_policy: proposalDeposit.refundPolicy, + } + : null, + } + ) + } else { + return MultipleChoiceProposalModule.generateModuleInstantiateInfo( + chainId, + name, + { + ...commonConfig, + deposit: proposalDeposit.enabled + ? { + amount: convertDenomToMicroDenomStringWithDecimals( + proposalDeposit.amount, + proposalDeposit.token?.decimals ?? 0 + ), + denom: + proposalDeposit.type === 'voting_module_token' + ? { + voting_module_token: { + token_type: createWithCw20 ? 'cw20' : 'native', + }, + } + : { + token: { + denom: + proposalDeposit.type === 'native' + ? { + native: proposalDeposit.denomOrAddress, + } + : // proposalDeposit.type === 'cw20' + { + cw20: proposalDeposit.denomOrAddress, + }, + }, + }, + refund_policy: proposalDeposit.refundPolicy, + } + : null, }, - }, - veto: convertVetoConfigToCosmos(veto), - } - - // Validate and throw error if invalid according to JSON schema. - makeValidateMsg(instantiateSchema, t)(msg) - - return { - admin: { core_module: {} }, - code_id: codeIdsToUse.DaoProposalMultiple, - label: `DAO_${name.trim()}_${DaoProposalMultipleAdapterId}`, - msg: encodeJsonToBase64(msg), - // This function is used by the enable multiple choice action, and DAOs - // before v2.3.0 still might want to enable multiple choice, so make sure to - // support the old version without the `funds` field. - ...(!moduleInstantiateFundsUnsupported && { - funds: [], - }), + { + // Omit the funds field from the module instantiate info objects and use + // v2.1.0 contracts. This is used when enabling multiple choice via the + // action for a DAO that is on a version below v2.3.0, since there was a + // breaking change on the `funds` field. + useV210WithoutFunds: moduleInstantiateFundsUnsupported, + } + ) } } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/daoCreation/instantiate_schema.json b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/daoCreation/instantiate_schema.json deleted file mode 100644 index 566e71ae0..000000000 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/daoCreation/instantiate_schema.json +++ /dev/null @@ -1,322 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "InstantiateMsg", - "type": "object", - "required": [ - "allow_revoting", - "close_proposal_on_execution_failure", - "max_voting_period", - "only_members_execute", - "pre_propose_info", - "voting_strategy" - ], - "properties": { - "allow_revoting": { - "description": "Allows changing votes before the proposal expires. If this is enabled proposals will not be able to complete early as final vote information is not known until the time of proposal expiration.", - "type": "boolean" - }, - "close_proposal_on_execution_failure": { - "description": "If set to true proposals will be closed if their execution fails. Otherwise, proposals will remain open after execution failure. For example, with this enabled a proposal to send 5 tokens out of a DAO's treasury with 4 tokens would be closed when it is executed. With this disabled, that same proposal would remain open until the DAO's treasury was large enough for it to be executed.", - "type": "boolean" - }, - "max_voting_period": { - "description": "The amount of time a proposal can be voted on before expiring", - "allOf": [ - { - "$ref": "#/definitions/Duration" - } - ] - }, - "min_voting_period": { - "description": "The minimum amount of time a proposal must be open before passing. A proposal may fail before this amount of time has elapsed, but it will not pass. This can be useful for preventing governance attacks wherein an attacker aquires a large number of tokens and forces a proposal through.", - "anyOf": [ - { - "$ref": "#/definitions/Duration" - }, - { - "type": "null" - } - ] - }, - "only_members_execute": { - "description": "If set to true only members may execute passed proposals. Otherwise, any address may execute a passed proposal.", - "type": "boolean" - }, - "pre_propose_info": { - "description": "Information about what addresses may create proposals.", - "allOf": [ - { - "$ref": "#/definitions/PreProposeInfo" - } - ] - }, - "veto": { - "description": "Optional veto configuration for proposal execution. If set, proposals can only be executed after the timelock delay expiration. During this period an oversight account (`veto.vetoer`) can veto the proposal.", - "anyOf": [ - { - "$ref": "#/definitions/VetoConfig" - }, - { - "type": "null" - } - ] - }, - "voting_strategy": { - "description": "Voting params configuration", - "allOf": [ - { - "$ref": "#/definitions/VotingStrategy" - } - ] - } - }, - "additionalProperties": false, - "definitions": { - "Admin": { - "description": "Information about the CosmWasm level admin of a contract. Used in conjunction with `ModuleInstantiateInfo` to instantiate modules.", - "oneOf": [ - { - "description": "Set the admin to a specified address.", - "type": "object", - "required": ["address"], - "properties": { - "address": { - "type": "object", - "required": ["addr"], - "properties": { - "addr": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Sets the admin as the core module address.", - "type": "object", - "required": ["core_module"], - "properties": { - "core_module": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "Binary": { - "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", - "type": "string" - }, - "Coin": { - "type": "object", - "required": ["amount", "denom"], - "properties": { - "amount": { - "$ref": "#/definitions/Uint128" - }, - "denom": { - "type": "string" - } - } - }, - "Decimal": { - "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", - "type": "string" - }, - "Duration": { - "description": "Duration is a delta of time. You can add it to a BlockInfo or Expiration to move that further in the future. Note that an height-based Duration and a time-based Expiration cannot be combined", - "oneOf": [ - { - "type": "object", - "required": ["height"], - "properties": { - "height": { - "type": "integer", - "minimum": 0.0 - } - }, - "additionalProperties": false - }, - { - "description": "Time in seconds", - "type": "object", - "required": ["time"], - "properties": { - "time": { - "type": "integer", - "minimum": 0.0 - } - }, - "additionalProperties": false - } - ] - }, - "ModuleInstantiateInfo": { - "description": "Information needed to instantiate a module.", - "type": "object", - "required": ["code_id", "label", "msg"], - "properties": { - "admin": { - "description": "CosmWasm level admin of the instantiated contract. See: ", - "anyOf": [ - { - "$ref": "#/definitions/Admin" - }, - { - "type": "null" - } - ] - }, - "code_id": { - "description": "Code ID of the contract to be instantiated.", - "type": "integer", - "minimum": 0.0 - }, - "funds": { - "description": "Funds to be sent to the instantiated contract.", - "type": "array", - "items": { - "$ref": "#/definitions/Coin" - } - }, - "label": { - "description": "Label for the instantiated contract.", - "type": "string" - }, - "msg": { - "description": "Instantiate message to be used to create the contract.", - "allOf": [ - { - "$ref": "#/definitions/Binary" - } - ] - } - }, - "additionalProperties": false - }, - "PercentageThreshold": { - "description": "A percentage of voting power that must vote yes for a proposal to pass. An example of why this is needed:\n\nIf a user specifies a 60% passing threshold, and there are 10 voters they likely expect that proposal to pass when there are 6 yes votes. This implies that the condition for passing should be `vote_weights >= total_votes * threshold`.\n\nWith this in mind, how should a user specify that they would like proposals to pass if the majority of voters choose yes? Selecting a 50% passing threshold with those rules doesn't properly cover that case as 5 voters voting yes out of 10 would pass the proposal. Selecting 50.0001% or or some variation of that also does not work as a very small yes vote which technically makes the majority yes may not reach that threshold.\n\nTo handle these cases we provide both a majority and percent option for all percentages. If majority is selected passing will be determined by `yes > total_votes * 0.5`. If percent is selected passing is determined by `yes >= total_votes * percent`.\n\nIn both of these cases a proposal with only abstain votes must fail. This requires a special case passing logic.", - "oneOf": [ - { - "description": "The majority of voters must vote yes for the proposal to pass.", - "type": "object", - "required": ["majority"], - "properties": { - "majority": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "A percentage of voting power >= percent must vote yes for the proposal to pass.", - "type": "object", - "required": ["percent"], - "properties": { - "percent": { - "$ref": "#/definitions/Decimal" - } - }, - "additionalProperties": false - } - ] - }, - "PreProposeInfo": { - "oneOf": [ - { - "description": "Anyone may create a proposal free of charge.", - "type": "object", - "required": ["anyone_may_propose"], - "properties": { - "anyone_may_propose": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "The module specified in INFO has exclusive rights to proposal creation.", - "type": "object", - "required": ["module_may_propose"], - "properties": { - "module_may_propose": { - "type": "object", - "required": ["info"], - "properties": { - "info": { - "$ref": "#/definitions/ModuleInstantiateInfo" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - }, - "VetoConfig": { - "type": "object", - "required": [ - "early_execute", - "timelock_duration", - "veto_before_passed", - "vetoer" - ], - "properties": { - "early_execute": { - "description": "Whether or not the vetoer can execute a proposal early before the timelock duration has expired", - "type": "boolean" - }, - "timelock_duration": { - "description": "The time duration to lock a proposal for after its expiration to allow the vetoer to veto.", - "allOf": [ - { - "$ref": "#/definitions/Duration" - } - ] - }, - "veto_before_passed": { - "description": "Whether or not the vetoer can veto a proposal before it passes.", - "type": "boolean" - }, - "vetoer": { - "description": "The address able to veto proposals.", - "type": "string" - } - }, - "additionalProperties": false - }, - "VotingStrategy": { - "description": "Determines how many choices may be selected.", - "oneOf": [ - { - "type": "object", - "required": ["single_choice"], - "properties": { - "single_choice": { - "type": "object", - "required": ["quorum"], - "properties": { - "quorum": { - "$ref": "#/definitions/PercentageThreshold" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - } - } -} diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/daoCreation/pre_propose_instantiate_schema.json b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/daoCreation/pre_propose_instantiate_schema.json deleted file mode 100644 index 9f04ad913..000000000 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/daoCreation/pre_propose_instantiate_schema.json +++ /dev/null @@ -1,165 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "InstantiateMsg", - "type": "object", - "required": ["extension", "open_proposal_submission"], - "properties": { - "deposit_info": { - "description": "Information about the deposit requirements for this module. None if no deposit.", - "anyOf": [ - { - "$ref": "#/definitions/UncheckedDepositInfo" - }, - { - "type": "null" - } - ] - }, - "extension": { - "description": "Extension for instantiation. The default implementation will do nothing with this data.", - "allOf": [ - { - "$ref": "#/definitions/Empty" - } - ] - }, - "open_proposal_submission": { - "description": "If false, only members (addresses with voting power) may create proposals in the DAO. Otherwise, any address may create a proposal so long as they pay the deposit.", - "type": "boolean" - } - }, - "additionalProperties": false, - "definitions": { - "DepositRefundPolicy": { - "oneOf": [ - { - "description": "Deposits should always be refunded.", - "type": "string", - "enum": ["always"] - }, - { - "description": "Deposits should only be refunded for passed proposals.", - "type": "string", - "enum": ["only_passed"] - }, - { - "description": "Deposits should never be refunded.", - "type": "string", - "enum": ["never"] - } - ] - }, - "DepositToken": { - "description": "Information about the token to use for proposal deposits.", - "oneOf": [ - { - "description": "Use a specific token address as the deposit token.", - "type": "object", - "required": ["token"], - "properties": { - "token": { - "type": "object", - "required": ["denom"], - "properties": { - "denom": { - "$ref": "#/definitions/UncheckedDenom" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Use the token native denom or cw20 contract address of the associated DAO's voting module. NOTE: in order to retrieve the token automatically via this variant, the voting module must either (1) use a native token and implement the `Denom {}` query type defined by `dao_dao_macros::native_token_query` OR (2) use a cw20 token and implement the `TokenContract {}` query type defined by `dao_dao_macros::cw20_token_query`. Failing to implement correctly will cause this option to fail to instantiate.", - "type": "object", - "required": ["voting_module_token"], - "properties": { - "voting_module_token": { - "type": "object", - "required": ["token_type"], - "properties": { - "token_type": { - "$ref": "#/definitions/VotingModuleTokenType" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "Empty": { - "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", - "type": "object" - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - }, - "UncheckedDenom": { - "description": "A denom that has not been checked to confirm it points to a valid asset.", - "oneOf": [ - { - "description": "A native (bank module) asset.", - "type": "object", - "required": ["native"], - "properties": { - "native": { - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "A cw20 asset.", - "type": "object", - "required": ["cw20"], - "properties": { - "cw20": { - "type": "string" - } - }, - "additionalProperties": false - } - ] - }, - "UncheckedDepositInfo": { - "description": "Information about the deposit required to create a proposal.", - "type": "object", - "required": ["amount", "denom", "refund_policy"], - "properties": { - "amount": { - "description": "The number of tokens that must be deposited to create a proposal. Must be a positive, non-zero number.", - "allOf": [ - { - "$ref": "#/definitions/Uint128" - } - ] - }, - "denom": { - "description": "The address of the token to be used for proposal deposits.", - "allOf": [ - { - "$ref": "#/definitions/DepositToken" - } - ] - }, - "refund_policy": { - "description": "The policy used for refunding deposits on proposal completion.", - "allOf": [ - { - "$ref": "#/definitions/DepositRefundPolicy" - } - ] - } - }, - "additionalProperties": false - }, - "VotingModuleTokenType": { - "type": "string", - "enum": ["native", "cw20"] - } - } -} diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/fetchPrePropose.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/fetchPrePropose.ts index 1db1fc978..2ed716eb4 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/fetchPrePropose.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/fetchPrePropose.ts @@ -1,13 +1,6 @@ -import { - DaoProposalMultipleQueryClient, - fetchPreProposeModule, - queryIndexer, -} from '@dao-dao/state' +import { daoProposalMultipleQueries, proposalQueries } from '@dao-dao/state' import { Feature, FetchPreProposeFunction } from '@dao-dao/types' -import { - cosmWasmClientRouter, - isFeatureSupportedByVersion, -} from '@dao-dao/utils' +import { isFeatureSupportedByVersion } from '@dao-dao/utils' export const fetchPrePropose: FetchPreProposeFunction = async ( queryClient, @@ -19,41 +12,30 @@ export const fetchPrePropose: FetchPreProposeFunction = async ( return null } - // Try indexer first. - let creationPolicy - try { - creationPolicy = await queryIndexer({ - type: 'contract', - address: proposalModuleAddress, - formula: 'daoProposalMultiple/creationPolicy', + const creationPolicy = await queryClient.fetchQuery( + daoProposalMultipleQueries.proposalCreationPolicy(queryClient, { chainId, + contractAddress: proposalModuleAddress, }) - } catch (err) { - // Ignore error. - console.error(err) - - // If indexer fails, fallback to querying chain. - if (!creationPolicy) { - const client = new DaoProposalMultipleQueryClient( - await cosmWasmClientRouter.connect(chainId), - proposalModuleAddress - ) - - creationPolicy = await client.proposalCreationPolicy() - } - } + ) const preProposeAddress = - creationPolicy && 'Module' in creationPolicy && creationPolicy.Module.addr + 'Module' in creationPolicy && creationPolicy.Module.addr ? creationPolicy.Module.addr : creationPolicy && 'module' in creationPolicy && creationPolicy.module.addr ? creationPolicy.module.addr : null + if (!preProposeAddress) { return null } - return await fetchPreProposeModule(queryClient, chainId, preProposeAddress) + return await queryClient.fetchQuery( + proposalQueries.preProposeModule(queryClient, { + chainId, + address: preProposeAddress, + }) + ) } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/fetchVetoConfig.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/fetchVetoConfig.ts index 7d154b65e..d8ad13c26 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/fetchVetoConfig.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/fetchVetoConfig.ts @@ -2,7 +2,7 @@ import { DaoProposalMultipleQueryClient, queryIndexer } from '@dao-dao/state' import { Feature, FetchVetoConfig } from '@dao-dao/types' import { Config } from '@dao-dao/types/contracts/DaoProposalMultiple' import { - cosmWasmClientRouter, + getCosmWasmClientForChainId, isFeatureSupportedByVersion, } from '@dao-dao/utils' @@ -32,7 +32,7 @@ export const fetchVetoConfig: FetchVetoConfig = async ( // If indexer fails, fallback to querying chain. if (!config) { const client = new DaoProposalMultipleQueryClient( - await cosmWasmClientRouter.connect(chainId), + await getCosmWasmClientForChainId(chainId), proposalModuleAddress ) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/makeGetProposalInfo.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/makeGetProposalInfo.ts index 752c71178..b7564ee2d 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/makeGetProposalInfo.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/functions/makeGetProposalInfo.ts @@ -8,7 +8,7 @@ import { InfoResponse, } from '@dao-dao/types' import { ProposalResponse } from '@dao-dao/types/contracts/DaoProposalMultiple' -import { cosmWasmClientRouter } from '@dao-dao/utils' +import { getCosmWasmClientForChainId } from '@dao-dao/utils' export const makeGetProposalInfo = ({ @@ -27,7 +27,7 @@ export const makeGetProposalInfo = let _cosmWasmClient: CosmWasmClient const getCosmWasmClient = async () => { if (!_cosmWasmClient) { - _cosmWasmClient = await cosmWasmClientRouter.connect(chainId) + _cosmWasmClient = await getCosmWasmClientForChainId(chainId) } return _cosmWasmClient } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useCastVote.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useCastVote.ts index c35fa5a06..ea79d81e1 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useCastVote.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useCastVote.ts @@ -4,19 +4,20 @@ import toast from 'react-hot-toast' import { MultipleChoiceVote } from '@dao-dao/types/contracts/DaoProposalMultiple' import { processError } from '@dao-dao/utils' -import { DaoProposalMultipleHooks } from '../../../../hooks' -import { useWallet } from '../../../../hooks/useWallet' -import { useProposalModuleAdapterOptions } from '../../../react' +import { useWallet } from '../../../../hooks' +import { useProposalModuleAdapterContext } from '../../../react' import { useLoadingWalletVoteInfo } from './useLoadingWalletVoteInfo' export const useCastVote = (onSuccess?: () => void | Promise) => { - const { proposalModule, proposalNumber } = useProposalModuleAdapterOptions() - const { isWalletConnected, address: walletAddress = '' } = useWallet() - - const _castVote = DaoProposalMultipleHooks.useVote({ - contractAddress: proposalModule.address, - sender: walletAddress, - }) + const { + proposalModule, + options: { proposalNumber }, + } = useProposalModuleAdapterContext() + const { + isWalletConnected, + address: walletAddress = '', + getSigningClient, + } = useWallet() const [castingVote, setCastingVote] = useState(false) @@ -33,14 +34,19 @@ export const useCastVote = (onSuccess?: () => void | Promise) => { const castVote = useCallback( async (vote: MultipleChoiceVote) => { - if (!isWalletConnected) return + if (!isWalletConnected) { + toast.error('Log in to continue.') + return + } setCastingVote(true) try { - await _castVote({ + await proposalModule.vote({ proposalId: proposalNumber, vote, + getSigningClient, + sender: walletAddress, }) await onSuccess?.() @@ -54,7 +60,14 @@ export const useCastVote = (onSuccess?: () => void | Promise) => { // Loading will stop on success when vote data refreshes. }, - [isWalletConnected, setCastingVote, _castVote, proposalNumber, onSuccess] + [ + isWalletConnected, + proposalModule, + proposalNumber, + getSigningClient, + walletAddress, + onSuccess, + ] ) return { diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useLoadingWalletVoteInfo.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useLoadingWalletVoteInfo.ts new file mode 100644 index 000000000..93e3a8ae3 --- /dev/null +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useLoadingWalletVoteInfo.ts @@ -0,0 +1,110 @@ +import { LoadingData, WalletVoteInfo } from '@dao-dao/types' +import { MultipleChoiceVote } from '@dao-dao/types/contracts/DaoProposalMultiple' + +import { + useDaoWithWalletSecretNetworkPermit, + useQueryLoadingDataWithError, +} from '../../../../hooks' +import { useProposalModuleAdapterContext } from '../../../react' +import { useLoadingProposal } from './useLoadingProposal' + +export const useLoadingWalletVoteInfo = (): + | undefined + | LoadingData> => { + const { + proposalModule, + options: { proposalNumber }, + } = useProposalModuleAdapterContext() + + // Re-renders when permit is updated. + const { + address: walletAddress, + permit, + isSecretNetwork, + } = useDaoWithWalletSecretNetworkPermit({ + dao: proposalModule.dao, + }) + + const loadingProposal = useLoadingProposal() + + // Refreshes when Secret Network permit is updated since the wallet hook + // above re-renders. + const walletVoteLoading = useQueryLoadingDataWithError( + proposalModule.getVoteQuery({ + proposalId: proposalNumber, + voter: walletAddress, + }) + ) + + // Refreshes when Secret Network permit is updated since the wallet hook + // above re-renders. + const walletVotingPowerWhenProposalCreatedLoading = + useQueryLoadingDataWithError( + loadingProposal.loading + ? // loading state if proposal not yet loaded + undefined + : proposalModule.dao.getVotingPowerQuery( + walletAddress, + loadingProposal.data.start_height + ) + ) + + const totalVotingPowerWhenProposalCreatedLoading = + useQueryLoadingDataWithError( + loadingProposal.loading + ? // loading state if proposal not yet loaded + undefined + : proposalModule.dao.getTotalVotingPowerQuery( + loadingProposal.data.start_height + ) + ) + + // Return undefined when no permit on Secret Network. + if (isSecretNetwork && !permit) { + return undefined + } + + if ( + loadingProposal.loading || + walletVoteLoading.loading || + walletVotingPowerWhenProposalCreatedLoading.loading || + totalVotingPowerWhenProposalCreatedLoading.loading + ) { + return { + loading: true, + } + } + + const proposal = loadingProposal.data + const walletVote = + (!walletVoteLoading.errored && walletVoteLoading.data?.vote?.vote) || + undefined + const walletVotingPowerWhenProposalCreated = + walletVotingPowerWhenProposalCreatedLoading.errored + ? 0 + : Number(walletVotingPowerWhenProposalCreatedLoading.data.power) + const couldVote = walletVotingPowerWhenProposalCreated > 0 + const totalVotingPowerWhenProposalCreated = + totalVotingPowerWhenProposalCreatedLoading.errored + ? 0 + : Number(totalVotingPowerWhenProposalCreatedLoading.data.power) + + const canVote = + couldVote && proposal.votingOpen && (!walletVote || proposal.allow_revoting) + + return { + loading: false, + data: { + vote: walletVote, + // If wallet could vote when this was open. + couldVote, + // If wallet can vote now. + canVote, + votingPowerPercent: + (totalVotingPowerWhenProposalCreated === 0 + ? 0 + : walletVotingPowerWhenProposalCreated / + totalVotingPowerWhenProposalCreated) * 100, + }, + } +} diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useLoadingWalletVoteInfo.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useLoadingWalletVoteInfo.tsx deleted file mode 100644 index d7a18ec6e..000000000 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useLoadingWalletVoteInfo.tsx +++ /dev/null @@ -1,109 +0,0 @@ -import { - DaoCoreV2Selectors, - DaoProposalMultipleSelectors, -} from '@dao-dao/state' -import { useCachedLoadable } from '@dao-dao/stateless' -import { LoadingData, WalletVoteInfo } from '@dao-dao/types' -import { MultipleChoiceVote } from '@dao-dao/types/contracts/DaoProposalMultiple' - -import { useWallet } from '../../../../hooks/useWallet' -import { useProposalModuleAdapterOptions } from '../../../react' -import { useLoadingProposal } from './useLoadingProposal' - -export const useLoadingWalletVoteInfo = (): - | undefined - | LoadingData> => { - const { - coreAddress, - proposalModule, - proposalNumber, - chain: { chain_id: chainId }, - } = useProposalModuleAdapterOptions() - const { address: walletAddress } = useWallet() - - const loadingProposal = useLoadingProposal() - - const walletVoteLoadable = useCachedLoadable( - walletAddress - ? DaoProposalMultipleSelectors.getVoteSelector({ - chainId, - contractAddress: proposalModule.address, - params: [{ proposalId: proposalNumber, voter: walletAddress }], - }) - : undefined - ) - - const walletVotingPowerWhenProposalCreatedLoadable = useCachedLoadable( - walletAddress && !loadingProposal.loading - ? DaoCoreV2Selectors.votingPowerAtHeightSelector({ - chainId, - contractAddress: coreAddress, - params: [ - { - address: walletAddress, - height: loadingProposal.data.start_height, - }, - ], - }) - : undefined - ) - - const totalVotingPowerWhenProposalCreatedLoadable = useCachedLoadable( - !loadingProposal.loading - ? DaoCoreV2Selectors.totalPowerAtHeightSelector({ - chainId, - contractAddress: coreAddress, - params: [ - { - height: loadingProposal.data.start_height, - }, - ], - }) - : undefined - ) - - // Return undefined when not connected. - if (!walletAddress) { - return undefined - } - - if ( - loadingProposal.loading || - walletVoteLoadable.state !== 'hasValue' || - walletVotingPowerWhenProposalCreatedLoadable.state !== 'hasValue' || - totalVotingPowerWhenProposalCreatedLoadable.state !== 'hasValue' - ) { - return { - loading: true, - } - } - - const proposal = loadingProposal.data - const walletVote = walletVoteLoadable.contents.vote?.vote ?? undefined - const walletVotingPowerWhenProposalCreated = Number( - walletVotingPowerWhenProposalCreatedLoadable.contents.power - ) - const couldVote = walletVotingPowerWhenProposalCreated > 0 - const totalVotingPowerWhenProposalCreated = Number( - totalVotingPowerWhenProposalCreatedLoadable.contents.power - ) - - const canVote = - couldVote && proposal.votingOpen && (!walletVote || proposal.allow_revoting) - - return { - loading: false, - data: { - vote: walletVote, - // If wallet could vote when this was open. - couldVote, - // If wallet can vote now. - canVote, - votingPowerPercent: - (totalVotingPowerWhenProposalCreated === 0 - ? 0 - : walletVotingPowerWhenProposalCreated / - totalVotingPowerWhenProposalCreated) * 100, - }, - } -} diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useProposalDaoInfoCards.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useProposalDaoInfoCards.tsx index ce389a1cc..a5d78192f 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useProposalDaoInfoCards.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useProposalDaoInfoCards.tsx @@ -24,37 +24,28 @@ import { import { EntityDisplay } from '../../../../components' import { useProposalModuleAdapterCommonContext } from '../../../react/context' -import { anyoneCanProposeSelector, useProcessQ } from '../common' +import { useProcessQ } from '../common' export const useProposalDaoInfoCards = (): DaoInfoCard[] => { const { t } = useTranslation() const { - options: { - chain: { chain_id: chainId }, - proposalModule, - }, + options: { proposalModule }, common: { selectors }, } = useProposalModuleAdapterCommonContext() const config = useCachedLoadingWithError( DaoProposalMultipleSelectors.configSelector({ - chainId, + chainId: proposalModule.dao.chainId, contractAddress: proposalModule.address, }) ) const depositInfo = useCachedLoadingWithError(selectors.depositInfo) - const anyoneCanPropose = useCachedLoadingWithError( - anyoneCanProposeSelector({ - chainId, - preProposeAddress: proposalModule.prePropose?.address ?? null, - }) - ) const depositTokenInfo = useCachedLoadingWithError( depositInfo.loading ? undefined : !depositInfo.errored && depositInfo.data ? genericTokenSelector({ - chainId, + chainId: proposalModule.dao.chainId, type: 'native' in depositInfo.data.denom ? TokenType.Native @@ -82,7 +73,7 @@ export const useProposalDaoInfoCards = (): DaoInfoCard[] => { : config.errored || !('veto' in config.data) || !config.data.veto ? constSelector(undefined) : Cw1WhitelistSelectors.adminsIfCw1Whitelist({ - chainId, + chainId: proposalModule.dao.chainId, contractAddress: config.data.veto.vetoer, }) ) @@ -188,14 +179,14 @@ export const useProposalDaoInfoCards = (): DaoInfoCard[] => { { label: t('title.creationPolicy'), tooltip: t('info.creationPolicyTooltip'), - loading: anyoneCanPropose.loading, - value: anyoneCanPropose.loading - ? undefined - : anyoneCanPropose.errored - ? '' - : anyoneCanPropose.data - ? t('info.anyone') - : t('info.onlyMembers'), + value: proposalModule.prePropose + ? 'anyone' in proposalModule.prePropose.submissionPolicy + ? t('info.anyone') + : proposalModule.prePropose.submissionPolicy.specific.dao_members + ? t('info.onlyMembers') + : t('info.allowlist') + : // If no pre-propose module, only members can create proposals. + t('info.onlyMembers'), }, // If vetoer(s) found, show all of them. Otherwise, show loading and none // iff this proposal module version supports veto. diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/index.tsx index 39b84fc14..d09192f71 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/index.tsx @@ -49,17 +49,17 @@ export const DaoProposalMultipleAdapter: ProposalModuleAdapter< id: DaoProposalMultipleAdapterId, contractNames: DAO_PROPOSAL_MULTIPLE_CONTRACT_NAMES, - loadCommon: (options) => { + loadCommon: ({ proposalModule }) => { // Make here so we can pass into common hooks and components that need it. const depositInfoSelector = makeDepositInfoSelector({ - chainId: options.chain.chain_id, - proposalModuleAddress: options.proposalModule.address, - version: options.proposalModule.version, - preProposeAddress: options.proposalModule.prePropose?.address ?? null, + chainId: proposalModule.dao.chainId, + proposalModuleAddress: proposalModule.address, + version: proposalModule.version, + preProposeAddress: proposalModule.prePropose?.address ?? null, }) const usePublishProposal = makeUsePublishProposal({ - options, + proposalModule, depositInfoSelector, }) @@ -72,30 +72,29 @@ export const DaoProposalMultipleAdapter: ProposalModuleAdapter< choices: [], }), newProposalFormTitleKey: 'title', - updateConfigActionMaker: makeUpdateProposalConfigActionMaker( - options.proposalModule - ), + updateConfigActionMaker: + makeUpdateProposalConfigActionMaker(proposalModule), updatePreProposeConfigActionMaker: - makeUpdatePreProposeConfigActionMaker(options.proposalModule), + makeUpdatePreProposeConfigActionMaker(proposalModule), }, // Selectors selectors: { proposalCount: proposalCountSelector({ - chainId: options.chain.chain_id, - proposalModuleAddress: options.proposalModule.address, + chainId: proposalModule.dao.chainId, + proposalModuleAddress: proposalModule.address, }), reverseProposalInfos: (props) => reverseProposalInfosSelector({ - chainId: options.chain.chain_id, - proposalModuleAddress: options.proposalModule.address, - proposalModulePrefix: options.proposalModule.prefix, + chainId: proposalModule.dao.chainId, + proposalModuleAddress: proposalModule.address, + proposalModulePrefix: proposalModule.prefix, ...props, }), depositInfo: depositInfoSelector, maxVotingPeriod: maxVotingPeriodSelector({ - chainId: options.chain.chain_id, - proposalModuleAddress: options.proposalModule.address, + chainId: proposalModule.dao.chainId, + proposalModuleAddress: proposalModule.address, }), }, @@ -108,7 +107,7 @@ export const DaoProposalMultipleAdapter: ProposalModuleAdapter< components: { NewProposal: (props) => ( diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/types.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/types.ts index 75a87d4b0..b8d493fd2 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/types.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/types.ts @@ -1,12 +1,12 @@ import { ActionAndData, ActionKeyAndData, - CosmosMsgForEmpty, DepositInfoSelector, - IProposalModuleAdapterCommonOptions, + IProposalModuleBase, ProcessedTQ, ProposalTimestampInfo, ProposalVoteOption, + UnifiedCosmosMsg, } from '@dao-dao/types' import { CheckedMultipleChoiceOption, @@ -44,7 +44,7 @@ export interface PercentOrMajorityValue { export type ProcessedMultipleChoiceOption = { description: string index: number - msgs: CosmosMsgForEmpty[] + msgs: UnifiedCosmosMsg[] optionType: MultipleChoiceOptionType title: string turnoutVotePercentage: number @@ -85,14 +85,18 @@ export type PublishProposal = ( }> export interface MakeUsePublishProposalOptions { - options: IProposalModuleAdapterCommonOptions + proposalModule: IProposalModuleBase depositInfoSelector: DepositInfoSelector } export type UsePublishProposal = () => { simulateProposal: SimulateProposal publishProposal: PublishProposal - anyoneCanPropose: boolean + /** + * If defined, the current wallet cannot propose for this reason. If + * undefined, the current wallet can propose. + */ + cannotProposeReason?: string depositUnsatisfied: boolean simulationBypassExpiration: Date | undefined } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdatePreProposeSingleConfig/UpdatePreProposeSingleConfigComponent.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdatePreProposeSingleConfig/UpdatePreProposeSingleConfigComponent.tsx index 43b2e88f0..7b5289aaf 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdatePreProposeSingleConfig/UpdatePreProposeSingleConfigComponent.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdatePreProposeSingleConfig/UpdatePreProposeSingleConfigComponent.tsx @@ -41,7 +41,9 @@ export interface UpdatePreProposeSingleConfigData { denomOrAddress: string // Loaded from token input fields to access metadata. token?: GenericToken - refundPolicy: DepositRefundPolicy + // make compatible with string union types with matching values, which is + // what gets auto-generated + refundPolicy: `${DepositRefundPolicy}` } anyoneCanPropose: boolean } @@ -249,7 +251,7 @@ export const UpdatePreProposeSingleConfigComponent: ActionComponent<

{t('form.refundPolicyTitle')}

- + disabled={!isCreating} onSelect={(refundPolicy) => setValue( diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdatePreProposeSingleConfig/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdatePreProposeSingleConfig/index.tsx index a994dd0b1..45708586d 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdatePreProposeSingleConfig/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdatePreProposeSingleConfig/index.tsx @@ -13,7 +13,8 @@ import { ActionKey, ActionMaker, DepositRefundPolicy, - ProposalModule, + Feature, + IProposalModuleBase, TokenType, UseDecodedCosmosMsg, UseDefaults, @@ -29,6 +30,7 @@ import { convertDenomToMicroDenomStringWithDecimals, convertMicroDenomToDenomWithDecimals, getNativeTokenForChainId, + isFeatureSupportedByVersion, isValidBech32Address, makeWasmMessage, } from '@dao-dao/utils' @@ -123,7 +125,7 @@ export const Component: ActionComponent = (props) => { export const makeUpdatePreProposeSingleConfigActionMaker = ({ prePropose, - }: ProposalModule): ActionMaker => + }: IProposalModuleBase): ActionMaker => ({ t, chain: { chain_id: chainId } }) => { // Only when pre propose is used. if ( @@ -221,7 +223,12 @@ export const makeUpdatePreProposeSingleConfigActionMaker = return { depositRequired, depositInfo, - anyoneCanPropose: config.open_proposal_submission, + anyoneCanPropose: isFeatureSupportedByVersion( + Feature.GranularSubmissionPolicy, + prePropose.version + ) + ? !!config.submission_policy && 'anyone' in config.submission_policy + : !!config.open_proposal_submission, } } @@ -279,7 +286,24 @@ export const makeUpdatePreProposeSingleConfigActionMaker = refund_policy: depositInfo.refundPolicy, } : null, - open_proposal_submission: anyoneCanPropose, + ...(isFeatureSupportedByVersion( + Feature.GranularSubmissionPolicy, + prePropose.version + ) + ? { + submission_policy: anyoneCanPropose + ? { + anyone: {}, + } + : { + specific: { + dao_members: true, + }, + }, + } + : { + open_proposal_submission: anyoneCanPropose, + }), }, } @@ -305,7 +329,6 @@ export const makeUpdatePreProposeSingleConfigActionMaker = { update_config: { deposit_info: {}, - open_proposal_submission: {}, }, } ) @@ -343,7 +366,17 @@ export const makeUpdatePreProposeSingleConfigActionMaker = } const anyoneCanPropose = - !!msg.wasm.execute.msg.update_config.open_proposal_submission + // < v2.5.0 + 'open_proposal_submission' in msg.wasm.execute.msg.update_config + ? !!msg.wasm.execute.msg.update_config.open_proposal_submission + : // >= v2.5.0 + 'submission_policy' in msg.wasm.execute.msg.update_config + ? 'anyone' in msg.wasm.execute.msg.update_config.submission_policy + : undefined + + if (anyoneCanPropose === undefined) { + return { match: false } + } if (!configDepositInfo || !token.data) { return { diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdateProposalConfigV1/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdateProposalConfigV1/index.tsx index 0ad9d7214..d0dcc192a 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdateProposalConfigV1/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdateProposalConfigV1/index.tsx @@ -10,7 +10,7 @@ import { ActionComponent, ActionKey, ActionMaker, - ProposalModule, + IProposalModuleBase, UseDecodedCosmosMsg, UseDefaults, UseTransformToCosmos, @@ -115,7 +115,7 @@ const Component: ActionComponent = (props) => { export const makeUpdateProposalConfigV1ActionMaker = ({ address: proposalModuleAddress, - }: ProposalModule): ActionMaker => + }: IProposalModuleBase): ActionMaker => ({ t, address, chain: { chain_id: chainId } }) => { const useDefaults: UseDefaults = () => { const proposalModuleConfig = useCachedLoadingWithError( diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdateProposalConfigV2/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdateProposalConfigV2/index.tsx index aa78e5ded..8a0c314e5 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdateProposalConfigV2/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdateProposalConfigV2/index.tsx @@ -18,7 +18,7 @@ import { ActionMaker, ContractVersion, Feature, - ProposalModule, + IProposalModuleBase, UseDecodedCosmosMsg, UseDefaults, UseTransformToCosmos, @@ -118,7 +118,7 @@ export const makeUpdateProposalConfigV2ActionMaker = ({ version, address: proposalModuleAddress, prePropose, -}: ProposalModule): ActionMaker => { +}: IProposalModuleBase): ActionMaker => { const Component: ActionComponent = (props) => { const { t } = useTranslation() const { setError, clearErrors, watch, trigger } = diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/components/NewProposal.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/components/NewProposal.tsx index 7f71f58a2..34988b716 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/components/NewProposal.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/components/NewProposal.tsx @@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next' import { useRecoilCallback, useRecoilValueLoadable } from 'recoil' import { - DaoCoreV2Selectors, + DaoDaoCoreSelectors, DaoProposalSingleCommonSelectors, blocksPerYearSelector, } from '@dao-dao/state' @@ -19,10 +19,7 @@ import { useDaoInfoContext, useProcessTQ, } from '@dao-dao/stateless' -import { - BaseNewProposalProps, - IProposalModuleAdapterCommonOptions, -} from '@dao-dao/types' +import { BaseNewProposalProps, IProposalModuleBase } from '@dao-dao/types' import { convertActionsToMessages, convertExpirationToDate, @@ -43,13 +40,13 @@ import { NewProposalMain } from './NewProposalMain' import { NewProposalPreview } from './NewProposalPreview' export type NewProposalProps = BaseNewProposalProps & { - options: IProposalModuleAdapterCommonOptions + proposalModule: IProposalModuleBase usePublishProposal: UsePublishProposal } export const NewProposal = ({ onCreateSuccess, - options, + proposalModule, usePublishProposal, ...props }: NewProposalProps) => { @@ -68,9 +65,7 @@ export const NewProposal = ({ const { watch } = useFormContext() const proposalTitle = watch('title') - const { isMember = false, loading: membershipLoading } = useMembership({ - coreAddress, - }) + const { isMember = false, loading: membershipLoading } = useMembership() const [loading, setLoading] = useState(false) @@ -78,7 +73,7 @@ export const NewProposal = ({ // which is refreshed periodically, so use a loadable to avoid unnecessary // re-renders. const pauseInfo = useCachedLoadable( - DaoCoreV2Selectors.pauseInfoSelector({ + DaoDaoCoreSelectors.pauseInfoSelector({ chainId, contractAddress: coreAddress, params: [], @@ -99,7 +94,7 @@ export const NewProposal = ({ const { simulateProposal: _simulateProposal, publishProposal, - anyoneCanPropose, + cannotProposeReason, depositUnsatisfied, simulationBypassExpiration, } = usePublishProposal() @@ -142,7 +137,9 @@ export const NewProposal = ({ // Get proposal info to display card. const proposalInfo = await makeGetProposalInfo({ - ...options, + chain: proposalModule.dao.chain, + coreAddress: proposalModule.dao.coreAddress, + proposalModule: proposalModule.info, proposalNumber, proposalId, isPreProposeApprovalProposal, @@ -158,7 +155,7 @@ export const NewProposal = ({ const config = await snapshot.getPromise( DaoProposalSingleCommonSelectors.configSelector({ chainId, - contractAddress: options.proposalModule.address, + contractAddress: proposalModule.address, }) ) @@ -220,7 +217,7 @@ export const NewProposal = ({ [ isWalletConnected, publishProposal, - options, + proposalModule, blocksPerYearLoadable, getStargateClient, chainId, @@ -247,7 +244,7 @@ export const NewProposal = ({ return ( activeThreshold={activeThreshold} - anyoneCanPropose={anyoneCanPropose} + cannotProposeReason={cannotProposeReason} connected={isWalletConnected} content={{ Header: NewProposalTitleDescriptionHeader, diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/makeUsePublishProposal.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/makeUsePublishProposal.ts index 7712ae087..a122d94ff 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/makeUsePublishProposal.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/makeUsePublishProposal.ts @@ -14,20 +14,14 @@ import { refreshWalletBalancesIdAtom, } from '@dao-dao/state' import { useCachedLoadable } from '@dao-dao/stateless' -import { ContractVersion } from '@dao-dao/types' import { - CHAIN_GAS_MULTIPLIER, - ContractName, + checkProposalSubmissionPolicy, expirationExpired, - findWasmAttributeValue, processError, } from '@dao-dao/utils' import { Cw20BaseHooks, - CwProposalSingleV1Hooks, - DaoPreProposeSingleHooks, - DaoProposalSingleV2Hooks, useAwaitNextBlock, useMembership, useSimulateCosmosMsgs, @@ -40,34 +34,24 @@ import { SimulateProposal, UsePublishProposal, } from '../../types' -import { anyoneCanProposeSelector } from '../selectors' export const makeUsePublishProposal = ({ - options: { - chain: { chain_id: chainId }, - coreAddress, - proposalModule, - }, + proposalModule, depositInfoSelector, }: MakeUsePublishProposalOptions): UsePublishProposal => () => { const { t } = useTranslation() + const { + dao: { chainId, coreAddress }, + prePropose, + } = proposalModule const { isWalletConnected, address: walletAddress, - getStargateClient, + getSigningClient, } = useWallet() - const { isMember = false } = useMembership({ - coreAddress, - }) - - const anyoneCanPropose = useRecoilValueLoadable( - anyoneCanProposeSelector({ - chainId: chainId, - preProposeAddress: proposalModule.prePropose?.address ?? null, - }) - ) + const { isMember = false } = useMembership() const depositInfo = useRecoilValueLoadable(depositInfoSelector) const depositInfoCw20TokenAddress = @@ -97,8 +81,7 @@ export const makeUsePublishProposal = owner: walletAddress, // If pre-propose address set, give that one deposit allowance // instead of proposal module. - spender: - proposalModule.prePropose?.address || proposalModule.address, + spender: prePropose?.address || proposalModule.address, }, ], }) @@ -163,18 +146,6 @@ export const makeUsePublishProposal = contractAddress: depositInfoCw20TokenAddress ?? '', sender: walletAddress ?? '', }) - const doProposeV1 = CwProposalSingleV1Hooks.usePropose({ - contractAddress: proposalModule.address, - sender: walletAddress ?? '', - }) - const doProposeV2 = DaoProposalSingleV2Hooks.usePropose({ - contractAddress: proposalModule.address, - sender: walletAddress ?? '', - }) - const doProposePrePropose = DaoPreProposeSingleHooks.usePropose({ - contractAddress: proposalModule.prePropose?.address ?? '', - sender: walletAddress ?? '', - }) const awaitNextBlock = useAwaitNextBlock() const simulateMsgs = useSimulateCosmosMsgs(coreAddress) @@ -213,20 +184,23 @@ export const makeUsePublishProposal = [simulateMsgs, t] ) + const cannotProposeReason = checkProposalSubmissionPolicy({ + proposalModule: proposalModule.info, + address: walletAddress, + isMember, + t, + }) + const publishProposal: PublishProposal = useCallback( async ( { title, description, msgs }, { failedSimulationBypassSeconds = 0 } = {} ) => { - if (!isWalletConnected) { + if (!isWalletConnected || !walletAddress) { throw new Error(t('error.logInToContinue')) } - if ( - anyoneCanPropose.state === 'hasValue' && - !anyoneCanPropose.contents && - !isMember - ) { - throw new Error(t('error.mustBeMemberToCreateProposal')) + if (cannotProposeReason) { + throw new Error(cannotProposeReason) } if (depositUnsatisfied) { throw new Error(t('error.notEnoughForDeposit')) @@ -273,7 +247,7 @@ export const makeUsePublishProposal = // If allowance expired, none. (expirationExpired( cw20DepositTokenAllowanceResponse.expires, - (await (await getStargateClient()).getBlock()).header.height + (await (await getSigningClient()).getBlock()).header.height ) ? 0 : Number(cw20DepositTokenAllowanceResponse.allowance)) @@ -287,7 +261,7 @@ export const makeUsePublishProposal = spender: // If pre-propose address set, give that one deposit allowance // instead of proposal module. - proposalModule.prePropose?.address || proposalModule.address, + prePropose?.address || proposalModule.address, }) // Allowances will not update until the next block has been added. @@ -321,99 +295,46 @@ export const makeUsePublishProposal = msgs, } - let response - let isPreProposeApprovalProposal = false - // V1 does not support pre-propose - if (proposalModule.version === ContractVersion.V1) { - response = await doProposeV1( - proposalData, - CHAIN_GAS_MULTIPLIER, - undefined, - proposeFunds - ) - // Every other version supports pre-propose. - } else { - isPreProposeApprovalProposal = - proposalModule.prePropose?.contractName === - ContractName.PreProposeApprovalSingle - response = proposalModule.prePropose - ? await doProposePrePropose( - { - msg: { - propose: proposalData, - }, - }, - CHAIN_GAS_MULTIPLIER, - undefined, - proposeFunds - ) - : await doProposeV2( - proposalData, - CHAIN_GAS_MULTIPLIER, - undefined, - proposeFunds - ) - } + const response = await proposalModule.propose({ + data: proposalData, + getSigningClient, + sender: walletAddress, + funds: proposeFunds, + }) if (proposeFunds?.length) { refreshBalances() } - const proposalNumber = Number( - (isPreProposeApprovalProposal && proposalModule.prePropose - ? findWasmAttributeValue( - response.events, - proposalModule.prePropose.address, - 'id' - ) - : findWasmAttributeValue( - response.events, - proposalModule.address, - 'proposal_id' - )) ?? -1 - ) - if (proposalNumber === -1) { - throw new Error(t('error.proposalIdNotFound')) - } - const proposalId = `${proposalModule.prefix}${ - isPreProposeApprovalProposal ? '*' : '' - }${proposalNumber}` - return { - proposalNumber, - proposalId, - isPreProposeApprovalProposal, + ...response, + isPreProposeApprovalProposal: response.proposalId.includes('*'), } }, [ isWalletConnected, - anyoneCanPropose, - isMember, + walletAddress, + cannotProposeReason, depositUnsatisfied, simulationBypassExpiration, requiredProposalDeposit, depositInfoCw20TokenAddress, depositInfoNativeTokenDenom, + getSigningClient, t, simulateMsgs, cw20DepositTokenAllowanceResponse, - getStargateClient, increaseCw20DepositAllowance, + prePropose?.address, awaitNextBlock, refreshBalances, - doProposeV1, - doProposePrePropose, - doProposeV2, ] ) return { simulateProposal, publishProposal, - // Default to true while loading. This is safe because the contract will - // reject anyone who is unauthorized. Defaulting to true here results in - // hiding the error until the real value is ready. - anyoneCanPropose: anyoneCanPropose.valueMaybe() ?? true, + cannotProposeReason, depositUnsatisfied, simulationBypassExpiration, } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/selectors.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/selectors.ts index 3f78629e4..74b90fa65 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/selectors.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/selectors.ts @@ -276,30 +276,3 @@ export const depositInfoSelector: ( return depositInfo }, }) - -export const anyoneCanProposeSelector = selectorFamily< - boolean, - WithChainId<{ - // Null if not v2 or doesn't have pre-propose module. - preProposeAddress: string | null - }> ->({ - key: 'daoPreProposeSingleAnyoneCanPropose', - get: - ({ chainId, preProposeAddress }) => - ({ get }) => { - if (preProposeAddress) { - const config = get( - DaoPreProposeSingleSelectors.configSelector({ - contractAddress: preProposeAddress, - chainId, - params: [], - }) - ) - - return config.open_proposal_submission - } - - return false - }, -}) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalLine.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalLine.tsx index e3ead54c0..661566f56 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalLine.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalLine.tsx @@ -41,14 +41,11 @@ const InnerProposalLine = ({ proposal: ProposalWithMetadata }) => { const { - coreAddress, proposalModule: { prefix: proposalPrefix, prePropose }, proposalNumber, } = useProposalModuleAdapterOptions() - const { isMember = false } = useMembership({ - coreAddress, - }) + const { isMember = false } = useMembership() const loadingWalletVoteInfo = useLoadingWalletVoteInfo() const timeAgoFormatter = useTranslatedTimeDeltaFormatter({ words: false }) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfo.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfo.tsx index 35831951e..14d805dfd 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfo.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfo.tsx @@ -30,7 +30,6 @@ import { import { BaseProposalStatusAndInfoProps, CheckedDepositInfo, - ContractVersion, DepositRefundPolicy, PreProposeModuleType, ProposalStatusEnum, @@ -45,13 +44,10 @@ import { import { ButtonLink, SuspenseLoader } from '../../../../components' import { EntityDisplay } from '../../../../components/EntityDisplay' import { - CwProposalSingleV1Hooks, - DaoProposalSingleV2Hooks, useAwaitNextBlock, useProposalActionState, useProposalRelayState, useProposalVetoState, - useWallet, } from '../../../../hooks' import { useProposalModuleAdapterOptions } from '../../../react' import { @@ -131,7 +127,6 @@ const InnerProposalStatusAndInfo = ({ const { coreAddress } = useDaoInfoContext() const { getDaoProposalPath } = useDaoNavHelpers() const { proposalModule, proposalNumber } = useProposalModuleAdapterOptions() - const { address: walletAddress = '' } = useWallet() const config = useRecoilValue( DaoProposalSingleCommonSelectors.configSelector({ @@ -176,23 +171,6 @@ const InnerProposalStatusAndInfo = ({ const timeAgoFormatter = useTranslatedTimeDeltaFormatter({ words: false }) - const executeProposal = ( - proposalModule.version === ContractVersion.V1 - ? CwProposalSingleV1Hooks.useExecute - : DaoProposalSingleV2Hooks.useExecute - )({ - contractAddress: proposalModule.address, - sender: walletAddress, - }) - const closeProposal = ( - proposalModule.version === ContractVersion.V1 - ? CwProposalSingleV1Hooks.useClose - : DaoProposalSingleV2Hooks.useClose - )({ - contractAddress: proposalModule.address, - sender: walletAddress, - }) - const relayState = useProposalRelayState({ msgs: proposal.msgs, status: proposal.status, @@ -206,8 +184,6 @@ const InnerProposalStatusAndInfo = ({ statusKey, relayState, loadingExecutionTxHash, - executeProposal, - closeProposal, onExecuteSuccess, onCloseSuccess, }) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/VoteDisplay.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/VoteDisplay.tsx index 8313717b4..d57cad28b 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/VoteDisplay.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/VoteDisplay.tsx @@ -43,15 +43,15 @@ export const ProposalVoteColorMap: Record< textClassName: string } > = { - [Vote.Yes]: { + yes: { iconClassName: 'text-icon-interactive-valid', textClassName: 'text-text-interactive-valid', }, - [Vote.No]: { + no: { iconClassName: 'text-icon-interactive-error', textClassName: 'text-text-interactive-error', }, - [Vote.Abstain]: { + abstain: { iconClassName: 'text-icon-secondary', textClassName: 'text-text-secondary', }, diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalWalletVote.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalWalletVote.tsx index 33a0ab414..1f7cf37da 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalWalletVote.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalWalletVote.tsx @@ -48,15 +48,14 @@ export const ProposalWalletVote = ({ } export const ProposalWalletVoteClassNameMap: Record = { - [Vote.Yes]: 'text-text-body ring-2 ring-inset ring-component-badge-valid', - [Vote.No]: 'text-text-body ring-2 ring-inset ring-component-badge-error', - [Vote.Abstain]: - 'text-text-body ring-2 ring-inset ring-component-badge-primary', + yes: 'text-text-body ring-2 ring-inset ring-component-badge-valid', + no: 'text-text-body ring-2 ring-inset ring-component-badge-error', + abstain: 'text-text-body ring-2 ring-inset ring-component-badge-primary', pending: 'text-text-body ring-2 ring-inset ring-component-badge-brand', hasNoVote: 'text-text-tertiary ring-2 ring-inset ring-border-secondary', } const APPROVER_VOTE_MAP: Partial> = { - [Vote.Yes]: 'approve', - [Vote.No]: 'reject', + yes: 'approve', + no: 'reject', } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/getInstantiateInfo.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/getInstantiateInfo.ts index e258b59e7..2b5156b2b 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/getInstantiateInfo.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/getInstantiateInfo.ts @@ -2,28 +2,22 @@ import { DaoCreationGetInstantiateInfo, PercentOrMajorityValue, } from '@dao-dao/types' -import { InstantiateMsg as DaoPreProposeApprovalSingleInstantiateMsg } from '@dao-dao/types/contracts/DaoPreProposeApprovalSingle' -import { InstantiateMsg as DaoPreProposeSingleInstantiateMsg } from '@dao-dao/types/contracts/DaoPreProposeSingle' import { PercentageThreshold } from '@dao-dao/types/contracts/DaoProposalSingle.common' -import { InstantiateMsg as DaoProposalSingleInstantiateMsg } from '@dao-dao/types/contracts/DaoProposalSingle.v2' import { - DaoProposalSingleAdapterId, convertDenomToMicroDenomStringWithDecimals, convertDurationWithUnitsToDuration, convertVetoConfigToCosmos, - encodeJsonToBase64, + isSecretNetwork, } from '@dao-dao/utils' -import { makeValidateMsg } from '@dao-dao/utils/validation/makeValidateMsg' +import { SingleChoiceProposalModule } from '../../../../clients/proposal-module/SingleChoiceProposalModule' +import { SecretSingleChoiceProposalModule } from '../../../../clients/proposal-module/SingleChoiceProposalModule.secret' import { DaoCreationExtraVotingConfig } from '../types' -import instantiateSchema from './instantiate_schema.json' -import preProposeApprovalInstantiateSchema from './pre_propose_approval_instantiate_schema.json' -import preProposeInstantiateSchema from './pre_propose_instantiate_schema.json' export const getInstantiateInfo: DaoCreationGetInstantiateInfo< DaoCreationExtraVotingConfig > = ( - { createWithCw20, codeIds }, + { chainId, createWithCw20 }, { name, votingConfig: { @@ -37,85 +31,9 @@ export const getInstantiateInfo: DaoCreationGetInstantiateInfo< veto, }, }, - { quorumEnabled, threshold }, - t + { quorumEnabled, threshold } ) => { - const decimals = proposalDeposit.token?.decimals ?? 0 - - const preProposeInstantiateMsgCommon: - | DaoPreProposeSingleInstantiateMsg - | DaoPreProposeApprovalSingleInstantiateMsg = { - deposit_info: proposalDeposit.enabled - ? { - amount: convertDenomToMicroDenomStringWithDecimals( - proposalDeposit.amount, - decimals - ), - denom: - proposalDeposit.type === 'voting_module_token' - ? { - voting_module_token: { - token_type: createWithCw20 ? 'cw20' : 'native', - }, - } - : { - token: { - denom: - proposalDeposit.type === 'native' - ? { - native: proposalDeposit.denomOrAddress, - } - : // proposalDeposit.type === 'cw20' - { - cw20: proposalDeposit.denomOrAddress, - }, - }, - }, - refund_policy: proposalDeposit.refundPolicy, - } - : null, - extension: {}, - open_proposal_submission: anyoneCanPropose, - } - - const preProposeInstantiateMsg = approver.enabled - ? ({ - ...preProposeInstantiateMsgCommon, - extension: { - approver: approver.address, - }, - } as DaoPreProposeApprovalSingleInstantiateMsg) - : (preProposeInstantiateMsgCommon as DaoPreProposeSingleInstantiateMsg) - - // Validate and throw error if invalid according to JSON schema. - makeValidateMsg( - approver.enabled - ? preProposeApprovalInstantiateSchema - : preProposeInstantiateSchema, - t - )(preProposeInstantiateMsg) - - const msg: DaoProposalSingleInstantiateMsg = { - allow_revoting: allowRevoting, - close_proposal_on_execution_failure: true, - max_voting_period: convertDurationWithUnitsToDuration(votingDuration), - min_voting_period: null, - only_members_execute: !!onlyMembersExecute, - pre_propose_info: { - module_may_propose: { - info: { - admin: { core_module: {} }, - code_id: approver.enabled - ? codeIds.DaoPreProposeApprovalSingle - : codeIds.DaoPreProposeSingle, - label: `DAO_${name.trim()}_pre-propose${ - approver.enabled ? '-approval' : '' - }_${DaoProposalSingleAdapterId}`, - msg: encodeJsonToBase64(preProposeInstantiateMsg), - funds: [], - }, - }, - }, + const commonConfig = { threshold: quorumEnabled ? { threshold_quorum: { @@ -130,18 +48,100 @@ export const getInstantiateInfo: DaoCreationGetInstantiateInfo< convertPercentOrMajorityValueToPercentageThreshold(threshold), }, }, + maxVotingPeriod: convertDurationWithUnitsToDuration(votingDuration), + allowRevoting, veto: convertVetoConfigToCosmos(veto), - } + approver: approver.enabled ? approver.address : undefined, + submissionPolicy: anyoneCanPropose ? 'anyone' : 'members', + onlyMembersExecute: onlyMembersExecute, + } as const - // Validate and throw error if invalid according to JSON schema. - makeValidateMsg(instantiateSchema, t)(msg) + if (isSecretNetwork(chainId)) { + if ( + proposalDeposit.enabled && + proposalDeposit.type === 'cw20' && + !proposalDeposit.token?.snip20CodeHash + ) { + throw new Error('SNIP20 proposal deposit token code hash not loaded') + } - return { - admin: { core_module: {} }, - code_id: codeIds.DaoProposalSingle, - label: `DAO_${name.trim()}_${DaoProposalSingleAdapterId}`, - msg: encodeJsonToBase64(msg), - funds: [], + return SecretSingleChoiceProposalModule.generateModuleInstantiateInfo( + chainId, + name, + { + ...commonConfig, + deposit: proposalDeposit.enabled + ? { + amount: convertDenomToMicroDenomStringWithDecimals( + proposalDeposit.amount, + proposalDeposit.token?.decimals ?? 0 + ), + denom: + proposalDeposit.type === 'voting_module_token' + ? { + voting_module_token: { + token_type: createWithCw20 ? 'cw20' : 'native', + }, + } + : { + token: { + denom: + proposalDeposit.type === 'native' + ? { + native: proposalDeposit.denomOrAddress, + } + : // proposalDeposit.type === 'cw20' + { + snip20: [ + proposalDeposit.denomOrAddress, + // Type-checked above. + proposalDeposit.token!.snip20CodeHash!, + ], + }, + }, + }, + refund_policy: proposalDeposit.refundPolicy, + } + : null, + } + ) + } else { + return SingleChoiceProposalModule.generateModuleInstantiateInfo( + chainId, + name, + { + ...commonConfig, + deposit: proposalDeposit.enabled + ? { + amount: convertDenomToMicroDenomStringWithDecimals( + proposalDeposit.amount, + proposalDeposit.token?.decimals ?? 0 + ), + denom: + proposalDeposit.type === 'voting_module_token' + ? { + voting_module_token: { + token_type: createWithCw20 ? 'cw20' : 'native', + }, + } + : { + token: { + denom: + proposalDeposit.type === 'native' + ? { + native: proposalDeposit.denomOrAddress, + } + : // proposalDeposit.type === 'cw20' + { + cw20: proposalDeposit.denomOrAddress, + }, + }, + }, + refund_policy: proposalDeposit.refundPolicy, + } + : null, + } + ) } } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/instantiate_schema.json b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/instantiate_schema.json deleted file mode 100644 index 5b0ea6496..000000000 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/instantiate_schema.json +++ /dev/null @@ -1,362 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "InstantiateMsg", - "type": "object", - "required": [ - "allow_revoting", - "close_proposal_on_execution_failure", - "max_voting_period", - "only_members_execute", - "pre_propose_info", - "threshold" - ], - "properties": { - "allow_revoting": { - "description": "Allows changing votes before the proposal expires. If this is enabled proposals will not be able to complete early as final vote information is not known until the time of proposal expiration.", - "type": "boolean" - }, - "close_proposal_on_execution_failure": { - "description": "If set to true proposals will be closed if their execution fails. Otherwise, proposals will remain open after execution failure. For example, with this enabled a proposal to send 5 tokens out of a DAO's treasury with 4 tokens would be closed when it is executed. With this disabled, that same proposal would remain open until the DAO's treasury was large enough for it to be executed.", - "type": "boolean" - }, - "max_voting_period": { - "description": "The default maximum amount of time a proposal may be voted on before expiring.", - "allOf": [ - { - "$ref": "#/definitions/Duration" - } - ] - }, - "min_voting_period": { - "description": "The minimum amount of time a proposal must be open before passing. A proposal may fail before this amount of time has elapsed, but it will not pass. This can be useful for preventing governance attacks wherein an attacker aquires a large number of tokens and forces a proposal through.", - "anyOf": [ - { - "$ref": "#/definitions/Duration" - }, - { - "type": "null" - } - ] - }, - "only_members_execute": { - "description": "If set to true only members may execute passed proposals. Otherwise, any address may execute a passed proposal.", - "type": "boolean" - }, - "pre_propose_info": { - "description": "Information about what addresses may create proposals.", - "allOf": [ - { - "$ref": "#/definitions/PreProposeInfo" - } - ] - }, - "threshold": { - "description": "The threshold a proposal must reach to complete.", - "allOf": [ - { - "$ref": "#/definitions/Threshold" - } - ] - }, - "veto": { - "description": "Optional veto configuration for proposal execution. If set, proposals can only be executed after the timelock delay expiration. During this period an oversight account (`veto.vetoer`) can veto the proposal.", - "anyOf": [ - { - "$ref": "#/definitions/VetoConfig" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false, - "definitions": { - "Admin": { - "description": "Information about the CosmWasm level admin of a contract. Used in conjunction with `ModuleInstantiateInfo` to instantiate modules.", - "oneOf": [ - { - "description": "Set the admin to a specified address.", - "type": "object", - "required": ["address"], - "properties": { - "address": { - "type": "object", - "required": ["addr"], - "properties": { - "addr": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Sets the admin as the core module address.", - "type": "object", - "required": ["core_module"], - "properties": { - "core_module": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "Binary": { - "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", - "type": "string" - }, - "Coin": { - "type": "object", - "required": ["amount", "denom"], - "properties": { - "amount": { - "$ref": "#/definitions/Uint128" - }, - "denom": { - "type": "string" - } - } - }, - "Decimal": { - "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", - "type": "string" - }, - "Duration": { - "description": "Duration is a delta of time. You can add it to a BlockInfo or Expiration to move that further in the future. Note that an height-based Duration and a time-based Expiration cannot be combined", - "oneOf": [ - { - "type": "object", - "required": ["height"], - "properties": { - "height": { - "type": "integer", - "minimum": 0.0 - } - }, - "additionalProperties": false - }, - { - "description": "Time in seconds", - "type": "object", - "required": ["time"], - "properties": { - "time": { - "type": "integer", - "minimum": 0.0 - } - }, - "additionalProperties": false - } - ] - }, - "ModuleInstantiateInfo": { - "description": "Information needed to instantiate a module.", - "type": "object", - "required": ["code_id", "funds", "label", "msg"], - "properties": { - "admin": { - "description": "CosmWasm level admin of the instantiated contract. See: ", - "anyOf": [ - { - "$ref": "#/definitions/Admin" - }, - { - "type": "null" - } - ] - }, - "code_id": { - "description": "Code ID of the contract to be instantiated.", - "type": "integer", - "minimum": 0.0 - }, - "funds": { - "description": "Funds to be sent to the instantiated contract.", - "type": "array", - "items": { - "$ref": "#/definitions/Coin" - } - }, - "label": { - "description": "Label for the instantiated contract.", - "type": "string" - }, - "msg": { - "description": "Instantiate message to be used to create the contract.", - "allOf": [ - { - "$ref": "#/definitions/Binary" - } - ] - } - }, - "additionalProperties": false - }, - "PercentageThreshold": { - "description": "A percentage of voting power that must vote yes for a proposal to pass. An example of why this is needed:\n\nIf a user specifies a 60% passing threshold, and there are 10 voters they likely expect that proposal to pass when there are 6 yes votes. This implies that the condition for passing should be `vote_weights >= total_votes * threshold`.\n\nWith this in mind, how should a user specify that they would like proposals to pass if the majority of voters choose yes? Selecting a 50% passing threshold with those rules doesn't properly cover that case as 5 voters voting yes out of 10 would pass the proposal. Selecting 50.0001% or or some variation of that also does not work as a very small yes vote which technically makes the majority yes may not reach that threshold.\n\nTo handle these cases we provide both a majority and percent option for all percentages. If majority is selected passing will be determined by `yes > total_votes * 0.5`. If percent is selected passing is determined by `yes >= total_votes * percent`.\n\nIn both of these cases a proposal with only abstain votes must fail. This requires a special case passing logic.", - "oneOf": [ - { - "description": "The majority of voters must vote yes for the proposal to pass.", - "type": "object", - "required": ["majority"], - "properties": { - "majority": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "A percentage of voting power >= percent must vote yes for the proposal to pass.", - "type": "object", - "required": ["percent"], - "properties": { - "percent": { - "$ref": "#/definitions/Decimal" - } - }, - "additionalProperties": false - } - ] - }, - "PreProposeInfo": { - "oneOf": [ - { - "description": "Anyone may create a proposal free of charge.", - "type": "object", - "required": ["anyone_may_propose"], - "properties": { - "anyone_may_propose": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "The module specified in INFO has exclusive rights to proposal creation.", - "type": "object", - "required": ["module_may_propose"], - "properties": { - "module_may_propose": { - "type": "object", - "required": ["info"], - "properties": { - "info": { - "$ref": "#/definitions/ModuleInstantiateInfo" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "Threshold": { - "description": "The ways a proposal may reach its passing / failing threshold.", - "oneOf": [ - { - "description": "Declares a percentage of the total weight that must cast Yes votes in order for a proposal to pass. See `ThresholdResponse::AbsolutePercentage` in the cw3 spec for details.", - "type": "object", - "required": ["absolute_percentage"], - "properties": { - "absolute_percentage": { - "type": "object", - "required": ["percentage"], - "properties": { - "percentage": { - "$ref": "#/definitions/PercentageThreshold" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Declares a `quorum` of the total votes that must participate in the election in order for the vote to be considered at all. See `ThresholdResponse::ThresholdQuorum` in the cw3 spec for details.", - "type": "object", - "required": ["threshold_quorum"], - "properties": { - "threshold_quorum": { - "type": "object", - "required": ["quorum", "threshold"], - "properties": { - "quorum": { - "$ref": "#/definitions/PercentageThreshold" - }, - "threshold": { - "$ref": "#/definitions/PercentageThreshold" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "An absolute number of votes needed for something to cross the threshold. Useful for multisig style voting.", - "type": "object", - "required": ["absolute_count"], - "properties": { - "absolute_count": { - "type": "object", - "required": ["threshold"], - "properties": { - "threshold": { - "$ref": "#/definitions/Uint128" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - }, - "VetoConfig": { - "type": "object", - "required": [ - "early_execute", - "timelock_duration", - "veto_before_passed", - "vetoer" - ], - "properties": { - "early_execute": { - "description": "Whether or not the vetoer can execute a proposal early before the timelock duration has expired", - "type": "boolean" - }, - "timelock_duration": { - "description": "The time duration to lock a proposal for after its expiration to allow the vetoer to veto.", - "allOf": [ - { - "$ref": "#/definitions/Duration" - } - ] - }, - "veto_before_passed": { - "description": "Whether or not the vetoer can veto a proposal before it passes.", - "type": "boolean" - }, - "vetoer": { - "description": "The address able to veto proposals.", - "type": "string" - } - }, - "additionalProperties": false - } - } -} diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/pre_propose_approval_instantiate_schema.json b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/pre_propose_approval_instantiate_schema.json deleted file mode 100644 index 300087986..000000000 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/pre_propose_approval_instantiate_schema.json +++ /dev/null @@ -1,161 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "InstantiateMsg", - "type": "object", - "required": ["extension", "open_proposal_submission"], - "properties": { - "deposit_info": { - "description": "Information about the deposit requirements for this module. None if no deposit.", - "anyOf": [ - { - "$ref": "#/definitions/UncheckedDepositInfo" - }, - { - "type": "null" - } - ] - }, - "extension": { - "description": "Extension for instantiation. The default implementation will do nothing with this data.", - "allOf": [ - { - "$ref": "#/definitions/InstantiateExt" - } - ] - }, - "open_proposal_submission": { - "description": "If false, only members (addresses with voting power) may create proposals in the DAO. Otherwise, any address may create a proposal so long as they pay the deposit.", - "type": "boolean" - } - }, - "additionalProperties": false, - "definitions": { - "DepositRefundPolicy": { - "oneOf": [ - { - "description": "Deposits should always be refunded.", - "type": "string", - "enum": ["always"] - }, - { - "description": "Deposits should only be refunded for passed proposals.", - "type": "string", - "enum": ["only_passed"] - }, - { - "description": "Deposits should never be refunded.", - "type": "string", - "enum": ["never"] - } - ] - }, - "DepositToken": { - "description": "Information about the token to use for proposal deposits.", - "oneOf": [ - { - "description": "Use a specific token address as the deposit token.", - "type": "object", - "required": ["token"], - "properties": { - "token": { - "type": "object", - "required": ["denom"], - "properties": { - "denom": { - "$ref": "#/definitions/UncheckedDenom" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Use the token address of the associated DAO's voting module. NOTE: in order to use the token address of the voting module the voting module must (1) use a cw20 token and (2) implement the `TokenContract {}` query type defined by `dao_dao_macros::token_query`. Failing to implement that and using this option will cause instantiation to fail.", - "type": "object", - "required": ["voting_module_token"], - "properties": { - "voting_module_token": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "InstantiateExt": { - "type": "object", - "required": ["approver"], - "properties": { - "approver": { - "type": "string" - } - }, - "additionalProperties": false - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - }, - "UncheckedDenom": { - "description": "A denom that has not been checked to confirm it points to a valid asset.", - "oneOf": [ - { - "description": "A native (bank module) asset.", - "type": "object", - "required": ["native"], - "properties": { - "native": { - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "A cw20 asset.", - "type": "object", - "required": ["cw20"], - "properties": { - "cw20": { - "type": "string" - } - }, - "additionalProperties": false - } - ] - }, - "UncheckedDepositInfo": { - "description": "Information about the deposit required to create a proposal.", - "type": "object", - "required": ["amount", "denom", "refund_policy"], - "properties": { - "amount": { - "description": "The number of tokens that must be deposited to create a proposal. Must be a positive, non-zero number.", - "allOf": [ - { - "$ref": "#/definitions/Uint128" - } - ] - }, - "denom": { - "description": "The address of the token to be used for proposal deposits.", - "allOf": [ - { - "$ref": "#/definitions/DepositToken" - } - ] - }, - "refund_policy": { - "description": "The policy used for refunding deposits on proposal completion.", - "allOf": [ - { - "$ref": "#/definitions/DepositRefundPolicy" - } - ] - } - }, - "additionalProperties": false - } - } -} diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/pre_propose_instantiate_schema.json b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/pre_propose_instantiate_schema.json deleted file mode 100644 index 9f04ad913..000000000 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/daoCreation/pre_propose_instantiate_schema.json +++ /dev/null @@ -1,165 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "InstantiateMsg", - "type": "object", - "required": ["extension", "open_proposal_submission"], - "properties": { - "deposit_info": { - "description": "Information about the deposit requirements for this module. None if no deposit.", - "anyOf": [ - { - "$ref": "#/definitions/UncheckedDepositInfo" - }, - { - "type": "null" - } - ] - }, - "extension": { - "description": "Extension for instantiation. The default implementation will do nothing with this data.", - "allOf": [ - { - "$ref": "#/definitions/Empty" - } - ] - }, - "open_proposal_submission": { - "description": "If false, only members (addresses with voting power) may create proposals in the DAO. Otherwise, any address may create a proposal so long as they pay the deposit.", - "type": "boolean" - } - }, - "additionalProperties": false, - "definitions": { - "DepositRefundPolicy": { - "oneOf": [ - { - "description": "Deposits should always be refunded.", - "type": "string", - "enum": ["always"] - }, - { - "description": "Deposits should only be refunded for passed proposals.", - "type": "string", - "enum": ["only_passed"] - }, - { - "description": "Deposits should never be refunded.", - "type": "string", - "enum": ["never"] - } - ] - }, - "DepositToken": { - "description": "Information about the token to use for proposal deposits.", - "oneOf": [ - { - "description": "Use a specific token address as the deposit token.", - "type": "object", - "required": ["token"], - "properties": { - "token": { - "type": "object", - "required": ["denom"], - "properties": { - "denom": { - "$ref": "#/definitions/UncheckedDenom" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Use the token native denom or cw20 contract address of the associated DAO's voting module. NOTE: in order to retrieve the token automatically via this variant, the voting module must either (1) use a native token and implement the `Denom {}` query type defined by `dao_dao_macros::native_token_query` OR (2) use a cw20 token and implement the `TokenContract {}` query type defined by `dao_dao_macros::cw20_token_query`. Failing to implement correctly will cause this option to fail to instantiate.", - "type": "object", - "required": ["voting_module_token"], - "properties": { - "voting_module_token": { - "type": "object", - "required": ["token_type"], - "properties": { - "token_type": { - "$ref": "#/definitions/VotingModuleTokenType" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "Empty": { - "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", - "type": "object" - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - }, - "UncheckedDenom": { - "description": "A denom that has not been checked to confirm it points to a valid asset.", - "oneOf": [ - { - "description": "A native (bank module) asset.", - "type": "object", - "required": ["native"], - "properties": { - "native": { - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "A cw20 asset.", - "type": "object", - "required": ["cw20"], - "properties": { - "cw20": { - "type": "string" - } - }, - "additionalProperties": false - } - ] - }, - "UncheckedDepositInfo": { - "description": "Information about the deposit required to create a proposal.", - "type": "object", - "required": ["amount", "denom", "refund_policy"], - "properties": { - "amount": { - "description": "The number of tokens that must be deposited to create a proposal. Must be a positive, non-zero number.", - "allOf": [ - { - "$ref": "#/definitions/Uint128" - } - ] - }, - "denom": { - "description": "The address of the token to be used for proposal deposits.", - "allOf": [ - { - "$ref": "#/definitions/DepositToken" - } - ] - }, - "refund_policy": { - "description": "The policy used for refunding deposits on proposal completion.", - "allOf": [ - { - "$ref": "#/definitions/DepositRefundPolicy" - } - ] - } - }, - "additionalProperties": false - }, - "VotingModuleTokenType": { - "type": "string", - "enum": ["native", "cw20"] - } - } -} diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/fetchPrePropose.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/fetchPrePropose.ts index 08f992a0a..a71b8ecab 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/fetchPrePropose.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/fetchPrePropose.ts @@ -1,13 +1,6 @@ -import { - DaoProposalSingleV2QueryClient, - fetchPreProposeModule, - queryIndexer, -} from '@dao-dao/state' +import { daoProposalSingleV2Queries, proposalQueries } from '@dao-dao/state' import { Feature, FetchPreProposeFunction } from '@dao-dao/types' -import { - cosmWasmClientRouter, - isFeatureSupportedByVersion, -} from '@dao-dao/utils' +import { isFeatureSupportedByVersion } from '@dao-dao/utils' export const fetchPrePropose: FetchPreProposeFunction = async ( queryClient, @@ -19,32 +12,15 @@ export const fetchPrePropose: FetchPreProposeFunction = async ( return null } - // Try indexer first. - let creationPolicy - try { - creationPolicy = await queryIndexer({ - type: 'contract', - address: proposalModuleAddress, - formula: 'daoProposalSingle/creationPolicy', + const creationPolicy = await queryClient.fetchQuery( + daoProposalSingleV2Queries.proposalCreationPolicy(queryClient, { chainId, + contractAddress: proposalModuleAddress, }) - } catch (err) { - // Ignore error. - console.error(err) - } - - // If indexer fails, fallback to querying chain. - if (!creationPolicy) { - const client = new DaoProposalSingleV2QueryClient( - await cosmWasmClientRouter.connect(chainId), - proposalModuleAddress - ) - - creationPolicy = await client.proposalCreationPolicy() - } + ) const preProposeAddress = - creationPolicy && 'Module' in creationPolicy && creationPolicy.Module.addr + 'Module' in creationPolicy && creationPolicy.Module.addr ? creationPolicy.Module.addr : creationPolicy && 'module' in creationPolicy && @@ -56,5 +32,10 @@ export const fetchPrePropose: FetchPreProposeFunction = async ( return null } - return await fetchPreProposeModule(queryClient, chainId, preProposeAddress) + return await queryClient.fetchQuery( + proposalQueries.preProposeModule(queryClient, { + chainId, + address: preProposeAddress, + }) + ) } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/fetchVetoConfig.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/fetchVetoConfig.ts index 167b4b61f..4b055ed19 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/fetchVetoConfig.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/fetchVetoConfig.ts @@ -1,8 +1,8 @@ import { DaoProposalSingleV2QueryClient, queryIndexer } from '@dao-dao/state' import { Feature, FetchVetoConfig } from '@dao-dao/types' -import { ConfigResponse } from '@dao-dao/types/contracts/DaoProposalSingle.v2' +import { Config } from '@dao-dao/types/contracts/DaoProposalSingle.v2' import { - cosmWasmClientRouter, + getCosmWasmClientForChainId, isFeatureSupportedByVersion, } from '@dao-dao/utils' @@ -16,7 +16,7 @@ export const fetchVetoConfig: FetchVetoConfig = async ( } // Try indexer first. - let config: ConfigResponse | undefined + let config: Config | undefined try { config = await queryIndexer({ type: 'contract', @@ -32,7 +32,7 @@ export const fetchVetoConfig: FetchVetoConfig = async ( // If indexer fails, fallback to querying chain. if (!config) { const client = new DaoProposalSingleV2QueryClient( - await cosmWasmClientRouter.connect(chainId), + await getCosmWasmClientForChainId(chainId), proposalModuleAddress ) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/makeGetProposalInfo.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/makeGetProposalInfo.ts index 52795d6e0..0ed36d953 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/makeGetProposalInfo.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/functions/makeGetProposalInfo.ts @@ -16,7 +16,10 @@ import { import { ProposalResponse as ProposalV1Response } from '@dao-dao/types/contracts/CwProposalSingle.v1' import { Proposal as DaoPreProposeApprovalSingleProposal } from '@dao-dao/types/contracts/DaoPreProposeApprovalSingle' import { ProposalResponse as ProposalV2Response } from '@dao-dao/types/contracts/DaoProposalSingle.v2' -import { cosmWasmClientRouter, parseContractVersion } from '@dao-dao/utils' +import { + getCosmWasmClientForChainId, + parseContractVersion, +} from '@dao-dao/utils' export const makeGetProposalInfo = ({ @@ -30,7 +33,7 @@ export const makeGetProposalInfo = let _cosmWasmClient: CosmWasmClient const getCosmWasmClient = async () => { if (!_cosmWasmClient) { - _cosmWasmClient = await cosmWasmClientRouter.connect(chainId) + _cosmWasmClient = await getCosmWasmClientForChainId(chainId) } return _cosmWasmClient } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useCastVote.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useCastVote.ts index d8908b3e7..7d803d6d5 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useCastVote.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useCastVote.ts @@ -8,14 +8,21 @@ import { processError } from '@dao-dao/utils' import { CwProposalSingleV1Hooks, DaoProposalSingleV2Hooks, + useWallet, } from '../../../../hooks' -import { useWallet } from '../../../../hooks/useWallet' -import { useProposalModuleAdapterOptions } from '../../../react' +import { useProposalModuleAdapterContext } from '../../../react' import { useLoadingWalletVoteInfo } from './useLoadingWalletVoteInfo' export const useCastVote = (onSuccess?: () => void | Promise) => { - const { proposalModule, proposalNumber } = useProposalModuleAdapterOptions() - const { isWalletConnected, address: walletAddress = '' } = useWallet() + const { + proposalModule, + options: { proposalNumber }, + } = useProposalModuleAdapterContext() + const { + isWalletConnected, + address: walletAddress = '', + getSigningClient, + } = useWallet() const _castVote = ( proposalModule.version === ContractVersion.V1 @@ -41,14 +48,19 @@ export const useCastVote = (onSuccess?: () => void | Promise) => { const castVote = useCallback( async (vote: Vote) => { - if (!isWalletConnected) return + if (!isWalletConnected) { + toast.error('Log in to continue.') + return + } setCastingVote(true) try { - await _castVote({ + await proposalModule.vote({ proposalId: proposalNumber, vote, + getSigningClient, + sender: walletAddress, }) await onSuccess?.() @@ -62,7 +74,14 @@ export const useCastVote = (onSuccess?: () => void | Promise) => { // Loading will stop on success when vote data refreshes. }, - [isWalletConnected, setCastingVote, _castVote, proposalNumber, onSuccess] + [ + isWalletConnected, + proposalModule, + proposalNumber, + getSigningClient, + walletAddress, + onSuccess, + ] ) return { diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingProposal.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingProposal.tsx index b9e7336fd..cf0d3f807 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingProposal.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingProposal.tsx @@ -19,6 +19,7 @@ import { Feature, LoadingData, PreProposeModuleType, + ProposalStatus, ProposalStatusEnum, ProposalTimestampInfo, } from '@dao-dao/types' @@ -61,9 +62,10 @@ export const useLoadingProposal = (): LoadingData => { (err) => console.error(err) ) - let proposalStatus = loadingProposalResponse.loading - ? undefined - : loadingProposalResponse.data?.proposal.status + let proposalStatus: ProposalStatus | undefined = + loadingProposalResponse.loading + ? undefined + : loadingProposalResponse.data?.proposal.status // Update status to take into account Neutron pre-propose timelock/overrule // system. const usesNeutronPreProposeTimelockOverruleSystem = diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingVoteOptions.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingVoteOptions.ts index 20cbb8530..9c9b0cca4 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingVoteOptions.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingVoteOptions.ts @@ -31,19 +31,19 @@ export const useLoadingVoteOptions = (): LoadingData< label: isPreProposeApproverProposal ? t('button.approve') : t('info.yesVote'), - value: Vote.Yes, + value: 'yes', }, { Icon: Close, label: isPreProposeApproverProposal ? t('button.reject') : t('info.noVote'), - value: Vote.No, + value: 'no', }, { Icon: Texture, label: t('info.abstainVote'), - value: Vote.Abstain, + value: 'abstain', }, ], } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingWalletVoteInfo.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingWalletVoteInfo.ts new file mode 100644 index 000000000..5d971d8fb --- /dev/null +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingWalletVoteInfo.ts @@ -0,0 +1,111 @@ +import { LoadingData, WalletVoteInfo } from '@dao-dao/types' +import { Vote } from '@dao-dao/types/contracts/DaoProposalSingle.common' + +import { + useDaoWithWalletSecretNetworkPermit, + useQueryLoadingDataWithError, +} from '../../../../hooks' +import { useProposalModuleAdapterContext } from '../../../react' +import { useLoadingProposal } from './useLoadingProposal' + +export const useLoadingWalletVoteInfo = (): + | undefined + | LoadingData> => { + const { + proposalModule, + options: { proposalNumber, isPreProposeApprovalProposal }, + } = useProposalModuleAdapterContext() + + // Re-renders when permit is updated. + const { + address: walletAddress, + permit, + isSecretNetwork, + } = useDaoWithWalletSecretNetworkPermit({ + dao: proposalModule.dao, + }) + + const loadingProposal = useLoadingProposal() + + // Refreshes when Secret Network permit is updated since the wallet hook + // above re-renders. + const walletVoteLoading = useQueryLoadingDataWithError( + proposalModule.getVoteQuery({ + proposalId: proposalNumber, + voter: walletAddress, + }) + ) + + // Refreshes when Secret Network permit is updated since the wallet hook + // above re-renders. + const walletVotingPowerWhenProposalCreatedLoading = + useQueryLoadingDataWithError( + loadingProposal.loading + ? // loading state if proposal not yet loaded + undefined + : proposalModule.dao.getVotingPowerQuery( + walletAddress, + loadingProposal.data.start_height + ) + ) + + const totalVotingPowerWhenProposalCreatedLoading = + useQueryLoadingDataWithError( + loadingProposal.loading + ? // loading state if proposal not yet loaded + undefined + : proposalModule.dao.getTotalVotingPowerQuery( + loadingProposal.data.start_height + ) + ) + + // Return undefined when no permit on Secret Network or when pre-propose + // proposal (which doesn't have voting). + if ((isSecretNetwork && !permit) || isPreProposeApprovalProposal) { + return undefined + } + + if ( + loadingProposal.loading || + walletVoteLoading.loading || + walletVotingPowerWhenProposalCreatedLoading.loading || + totalVotingPowerWhenProposalCreatedLoading.loading + ) { + return { + loading: true, + } + } + + const proposal = loadingProposal.data + const walletVote = + (!walletVoteLoading.errored && walletVoteLoading.data?.vote?.vote) || + undefined + const walletVotingPowerWhenProposalCreated = + walletVotingPowerWhenProposalCreatedLoading.errored + ? 0 + : Number(walletVotingPowerWhenProposalCreatedLoading.data.power) + const couldVote = walletVotingPowerWhenProposalCreated > 0 + const totalVotingPowerWhenProposalCreated = + totalVotingPowerWhenProposalCreatedLoading.errored + ? 0 + : Number(totalVotingPowerWhenProposalCreatedLoading.data.power) + + const canVote = + couldVote && proposal.votingOpen && (!walletVote || proposal.allow_revoting) + + return { + loading: false, + data: { + vote: walletVote, + // If wallet could vote when this was open. + couldVote, + // If wallet can vote now. + canVote, + votingPowerPercent: + (totalVotingPowerWhenProposalCreated === 0 + ? 0 + : walletVotingPowerWhenProposalCreated / + totalVotingPowerWhenProposalCreated) * 100, + }, + } +} diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingWalletVoteInfo.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingWalletVoteInfo.tsx deleted file mode 100644 index 96d356e9e..000000000 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useLoadingWalletVoteInfo.tsx +++ /dev/null @@ -1,111 +0,0 @@ -import { - DaoCoreV2Selectors, - DaoProposalSingleCommonSelectors, -} from '@dao-dao/state' -import { useCachedLoadable } from '@dao-dao/stateless' -import { LoadingData, WalletVoteInfo } from '@dao-dao/types' -import { Vote } from '@dao-dao/types/contracts/DaoProposalSingle.common' - -import { useWallet } from '../../../../hooks/useWallet' -import { useProposalModuleAdapterOptions } from '../../../react' -import { useLoadingProposal } from './useLoadingProposal' - -export const useLoadingWalletVoteInfo = (): - | undefined - | LoadingData> => { - const { - coreAddress, - proposalModule, - proposalNumber, - chain: { chain_id: chainId }, - isPreProposeApprovalProposal, - } = useProposalModuleAdapterOptions() - const { address: walletAddress } = useWallet() - - const loadingProposal = useLoadingProposal() - - const walletVoteLoadable = useCachedLoadable( - walletAddress - ? DaoProposalSingleCommonSelectors.getVoteSelector({ - chainId, - contractAddress: proposalModule.address, - params: [{ proposalId: proposalNumber, voter: walletAddress }], - }) - : undefined - ) - - const walletVotingPowerWhenProposalCreatedLoadable = useCachedLoadable( - walletAddress && !loadingProposal.loading - ? DaoCoreV2Selectors.votingPowerAtHeightSelector({ - chainId, - contractAddress: coreAddress, - params: [ - { - address: walletAddress, - height: loadingProposal.data.start_height, - }, - ], - }) - : undefined - ) - - const totalVotingPowerWhenProposalCreatedLoadable = useCachedLoadable( - !loadingProposal.loading - ? DaoCoreV2Selectors.totalPowerAtHeightSelector({ - chainId, - contractAddress: coreAddress, - params: [ - { - height: loadingProposal.data.start_height, - }, - ], - }) - : undefined - ) - - // Return undefined when not connected or when pre-propose proposal (which - // doesn't have voting). - if (!walletAddress || isPreProposeApprovalProposal) { - return undefined - } - - if ( - loadingProposal.loading || - walletVoteLoadable.state !== 'hasValue' || - walletVotingPowerWhenProposalCreatedLoadable.state !== 'hasValue' || - totalVotingPowerWhenProposalCreatedLoadable.state !== 'hasValue' - ) { - return { - loading: true, - } - } - - const proposal = loadingProposal.data - const walletVote = walletVoteLoadable.contents.vote?.vote ?? undefined - const walletVotingPowerWhenProposalCreated = Number( - walletVotingPowerWhenProposalCreatedLoadable.contents.power - ) - const couldVote = walletVotingPowerWhenProposalCreated > 0 - const totalVotingPowerWhenProposalCreated = Number( - totalVotingPowerWhenProposalCreatedLoadable.contents.power - ) - - const canVote = - couldVote && proposal.votingOpen && (!walletVote || proposal.allow_revoting) - - return { - loading: false, - data: { - vote: walletVote, - // If wallet could vote when this was open. - couldVote, - // If wallet can vote now. - canVote, - votingPowerPercent: - (totalVotingPowerWhenProposalCreated === 0 - ? 0 - : walletVotingPowerWhenProposalCreated / - totalVotingPowerWhenProposalCreated) * 100, - }, - } -} diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalDaoInfoCards.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalDaoInfoCards.tsx index 0ff855d60..68c48fcca 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalDaoInfoCards.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalDaoInfoCards.tsx @@ -25,37 +25,27 @@ import { import { EntityDisplay } from '../../../../components' import { useProposalModuleAdapterCommonContext } from '../../../react/context' -import { anyoneCanProposeSelector } from '../common' export const useProposalDaoInfoCards = (): DaoInfoCard[] => { const { t } = useTranslation() const { - options: { - chain: { chain_id: chainId }, - proposalModule, - }, + options: { proposalModule }, common: { selectors }, } = useProposalModuleAdapterCommonContext() const config = useCachedLoadingWithError( DaoProposalSingleCommonSelectors.configSelector({ - chainId, + chainId: proposalModule.dao.chainId, contractAddress: proposalModule.address, }) ) const depositInfo = useCachedLoadingWithError(selectors.depositInfo) - const anyoneCanPropose = useCachedLoadingWithError( - anyoneCanProposeSelector({ - chainId, - preProposeAddress: proposalModule.prePropose?.address ?? null, - }) - ) const depositTokenInfo = useCachedLoadingWithError( depositInfo.loading ? undefined : !depositInfo.errored && depositInfo.data ? genericTokenSelector({ - chainId, + chainId: proposalModule.dao.chainId, type: 'native' in depositInfo.data.denom ? TokenType.Native @@ -83,7 +73,7 @@ export const useProposalDaoInfoCards = (): DaoInfoCard[] => { : config.errored || !('veto' in config.data) || !config.data.veto ? constSelector(undefined) : Cw1WhitelistSelectors.adminsIfCw1Whitelist({ - chainId, + chainId: proposalModule.dao.chainId, contractAddress: config.data.veto.vetoer, }) ) @@ -205,14 +195,14 @@ export const useProposalDaoInfoCards = (): DaoInfoCard[] => { { label: t('title.creationPolicy'), tooltip: t('info.creationPolicyTooltip'), - loading: anyoneCanPropose.loading, - value: anyoneCanPropose.loading - ? undefined - : anyoneCanPropose.errored - ? '' - : anyoneCanPropose.data - ? t('info.anyone') - : t('info.onlyMembers'), + value: proposalModule.prePropose + ? 'anyone' in proposalModule.prePropose.submissionPolicy + ? t('info.anyone') + : proposalModule.prePropose.submissionPolicy.specific.dao_members + ? t('info.onlyMembers') + : t('info.allowlist') + : // If no pre-propose module, only members can create proposals. + t('info.onlyMembers'), }, // If vetoer(s) found, show all of them. Otherwise, show loading and none // iff this proposal module version supports veto. diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/index.tsx index c76f76a40..b168168e6 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/index.tsx @@ -60,17 +60,17 @@ export const DaoProposalSingleAdapter: ProposalModuleAdapter< id: DaoProposalSingleAdapterId, contractNames: DAO_PROPOSAL_SINGLE_CONTRACT_NAMES, - loadCommon: (options) => { + loadCommon: ({ proposalModule }) => { // Make here so we can pass into common hooks and components that need it. const depositInfoSelector = makeDepositInfoSelector({ - chainId: options.chain.chain_id, - proposalModuleAddress: options.proposalModule.address, - version: options.proposalModule.version, - preProposeAddress: options.proposalModule.prePropose?.address ?? null, + chainId: proposalModule.dao.chainId, + proposalModuleAddress: proposalModule.address, + version: proposalModule.version, + preProposeAddress: proposalModule.prePropose?.address ?? null, }) const usePublishProposal = makeUsePublishProposal({ - options, + proposalModule, depositInfoSelector, }) @@ -83,52 +83,48 @@ export const DaoProposalSingleAdapter: ProposalModuleAdapter< actionData: [], }), newProposalFormTitleKey: 'title', - updateConfigActionMaker: (!options.proposalModule.version || - options.proposalModule.version === ContractVersion.V1 + updateConfigActionMaker: (proposalModule.version === ContractVersion.V1 ? makeUpdateProposalConfigV1ActionMaker - : makeUpdateProposalConfigV2ActionMaker)(options.proposalModule), + : makeUpdateProposalConfigV2ActionMaker)(proposalModule), updatePreProposeConfigActionMaker: - makeUpdatePreProposeSingleConfigActionMaker(options.proposalModule), + makeUpdatePreProposeSingleConfigActionMaker(proposalModule), }, // Selectors selectors: { proposalCount: proposalCountSelector({ - chainId: options.chain.chain_id, - proposalModuleAddress: options.proposalModule.address, + chainId: proposalModule.dao.chainId, + proposalModuleAddress: proposalModule.address, }), reverseProposalInfos: (props) => reverseProposalInfosSelector({ - chainId: options.chain.chain_id, - proposalModuleAddress: options.proposalModule.address, - proposalModulePrefix: options.proposalModule.prefix, + chainId: proposalModule.dao.chainId, + proposalModuleAddress: proposalModule.address, + proposalModulePrefix: proposalModule.prefix, ...props, }), depositInfo: depositInfoSelector, - ...(options.proposalModule.prePropose?.type === - PreProposeModuleType.Approval + ...(proposalModule.prePropose?.type === PreProposeModuleType.Approval ? { reversePreProposePendingProposalInfos: (props) => reversePreProposePendingProposalInfosSelector({ - chainId: options.chain.chain_id, - proposalModuleAddress: - options.proposalModule.prePropose!.address, - proposalModulePrefix: options.proposalModule.prefix, + chainId: proposalModule.dao.chainId, + proposalModuleAddress: proposalModule.prePropose!.address, + proposalModulePrefix: proposalModule.prefix, ...props, }), reversePreProposeCompletedProposalInfos: (props) => reversePreProposeCompletedProposalInfosSelector({ - chainId: options.chain.chain_id, - proposalModuleAddress: - options.proposalModule.prePropose!.address, - proposalModulePrefix: options.proposalModule.prefix, + chainId: proposalModule.dao.chainId, + proposalModuleAddress: proposalModule.prePropose!.address, + proposalModulePrefix: proposalModule.prefix, ...props, }), } : {}), maxVotingPeriod: maxVotingPeriodSelector({ - chainId: options.chain.chain_id, - proposalModuleAddress: options.proposalModule.address, + chainId: proposalModule.dao.chainId, + proposalModuleAddress: proposalModule.address, }), }, @@ -141,7 +137,7 @@ export const DaoProposalSingleAdapter: ProposalModuleAdapter< components: { NewProposal: (props) => ( diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/types.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/types.ts index 6905f6f70..aeab3fa1e 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/types.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/types.ts @@ -2,13 +2,13 @@ import { ActionAndData, ActionKeyAndData, DepositInfoSelector, - IProposalModuleAdapterCommonOptions, + IProposalModuleBase, NeutronTimelockOverrule, PercentOrMajorityValue, ProcessedTQ, ProposalTimestampInfo, + UnifiedCosmosMsg, } from '@dao-dao/types' -import { CosmosMsgFor_Empty } from '@dao-dao/types/contracts/common' import { Proposal } from '@dao-dao/types/contracts/CwProposalSingle.v1' import { SingleChoiceProposal } from '@dao-dao/types/contracts/DaoProposalSingle.v2' @@ -20,7 +20,7 @@ export interface NewProposalForm { // Converted data from actions into Cosmos messages. export interface NewProposalData extends Omit { - msgs: CosmosMsgFor_Empty[] + msgs: UnifiedCosmosMsg[] } export type DaoCreationExtraVotingConfig = { @@ -85,14 +85,18 @@ export type PublishProposal = ( }> export interface MakeUsePublishProposalOptions { - options: IProposalModuleAdapterCommonOptions + proposalModule: IProposalModuleBase depositInfoSelector: DepositInfoSelector } export type UsePublishProposal = () => { simulateProposal: SimulateProposal publishProposal: PublishProposal - anyoneCanPropose: boolean + /** + * If defined, the current wallet cannot propose for this reason. If + * undefined, the current wallet can propose. + */ + cannotProposeReason?: string depositUnsatisfied: boolean simulationBypassExpiration: Date | undefined } diff --git a/packages/stateful/proposal-module-adapter/adapters/index.tsx b/packages/stateful/proposal-module-adapter/adapters/index.ts similarity index 100% rename from packages/stateful/proposal-module-adapter/adapters/index.tsx rename to packages/stateful/proposal-module-adapter/adapters/index.ts diff --git a/packages/stateful/proposal-module-adapter/core.ts b/packages/stateful/proposal-module-adapter/core.ts index da417d790..5137822dd 100644 --- a/packages/stateful/proposal-module-adapter/core.ts +++ b/packages/stateful/proposal-module-adapter/core.ts @@ -1,11 +1,10 @@ import { + IDaoBase, IProposalModuleAdapterCommon, - IProposalModuleAdapterCommonInitialOptions, - IProposalModuleAdapterInitialOptions, IProposalModuleAdapterOptions, + IProposalModuleBase, IProposalModuleCommonContext, IProposalModuleContext, - ProposalModule, ProposalModuleAdapter, } from '@dao-dao/types' @@ -38,11 +37,20 @@ export const matchAdapter = (contractNameToMatch: string) => ) export const matchAndLoadCommon = ( - proposalModule: ProposalModule, - initialOptions: IProposalModuleAdapterCommonInitialOptions -): IProposalModuleAdapterCommon & { id: string } => { - const adapter = matchAdapter(proposalModule.contractName) + dao: IDaoBase, + proposalModuleAddress: string +): IProposalModuleAdapterCommon & { + id: string + proposalModule: IProposalModuleBase +} => { + const proposalModule = dao.getProposalModule(proposalModuleAddress) + if (!proposalModule) { + throw new ProposalModuleAdapterError( + `Failed to find proposal module with address ${proposalModuleAddress}.` + ) + } + const adapter = matchAdapter(proposalModule.contractName) if (!adapter) { throw new ProposalModuleAdapterError( `Failed to find proposal module adapter matching contract "${ @@ -56,16 +64,15 @@ export const matchAndLoadCommon = ( return { id: adapter.id, ...adapter.loadCommon({ - ...initialOptions, proposalModule, }), + proposalModule, } } export const matchAndLoadAdapter = ( - proposalModules: ProposalModule[], - proposalId: string, - initialOptions: IProposalModuleAdapterInitialOptions + dao: IDaoBase, + proposalId: string ): IProposalModuleContext => { // Prefix is alphabetical, followed by numeric prop number. If there is an // asterisk between the prefix and the prop number, this is a pre-propose @@ -88,13 +95,13 @@ export const matchAndLoadAdapter = ( } const proposalModule = proposalPrefix - ? proposalModules.find(({ prefix }) => prefix === proposalPrefix) + ? dao.proposalModules.find((p) => p.info.prefix === proposalPrefix) : // If no proposalPrefix (i.e. proposalId is just a number), and there is // only one proposal module, return it. This should handle backwards // compatibility when there were no prefixes and every DAO used a single // choice proposal module. - proposalModules.length === 1 - ? proposalModules[0] + dao.proposalModules.length === 1 + ? dao.proposalModules[0] : undefined if (!proposalModule) { throw new ProposalModuleAdapterError( @@ -115,8 +122,9 @@ export const matchAndLoadAdapter = ( } const adapterOptions: IProposalModuleAdapterOptions = { - ...initialOptions, - proposalModule, + chain: dao.chain, + coreAddress: dao.coreAddress, + proposalModule: proposalModule.info, proposalId, proposalNumber, isPreProposeApprovalProposal, @@ -127,9 +135,9 @@ export const matchAndLoadAdapter = ( options: adapterOptions, adapter: adapter.load(adapterOptions), common: adapter.loadCommon({ - ...initialOptions, proposalModule, }), + proposalModule, } } @@ -139,23 +147,20 @@ export const commonContextFromAdapterContext = ( id: adapterContext.id, common: adapterContext.common, options: { - chain: adapterContext.options.chain, - coreAddress: adapterContext.options.coreAddress, - proposalModule: adapterContext.options.proposalModule, + proposalModule: adapterContext.proposalModule, }, }) export const matchAndLoadCommonContext = ( ...params: Parameters ): IProposalModuleCommonContext => { - const { id, ...common } = matchAndLoadCommon(...params) + const { id, proposalModule, ...common } = matchAndLoadCommon(...params) return { id, common, options: { - ...params[1], - proposalModule: params[0], + proposalModule, }, } } diff --git a/packages/stateful/proposal-module-adapter/react/provider.tsx b/packages/stateful/proposal-module-adapter/react/provider.tsx index 0068ec184..5d545bc1c 100644 --- a/packages/stateful/proposal-module-adapter/react/provider.tsx +++ b/packages/stateful/proposal-module-adapter/react/provider.tsx @@ -1,12 +1,9 @@ import { ReactNode, useMemo } from 'react' -import { useChain } from '@dao-dao/stateless' +import { useDaoContext } from '@dao-dao/stateless' import { - IProposalModuleAdapterCommonInitialOptions, - IProposalModuleAdapterInitialOptions, IProposalModuleCommonContext, IProposalModuleContext, - ProposalModule, } from '@dao-dao/types' import { @@ -20,29 +17,23 @@ import { } from './context' export type ProposalModuleAdapterProviderProps = { - proposalModules: ProposalModule[] proposalId: string children: ReactNode | ReactNode[] -} & Omit +} export const ProposalModuleAdapterProvider = ({ - coreAddress, - proposalModules, proposalId, children, }: ProposalModuleAdapterProviderProps) => { - const chain = useChain() + const { dao } = useDaoContext() const { context, commonContext } = useMemo(() => { - const context = matchAndLoadAdapter(proposalModules, proposalId, { - coreAddress, - chain, - }) + const context = matchAndLoadAdapter(dao, proposalId) const commonContext = commonContextFromAdapterContext(context) return { context, commonContext, } - }, [chain, coreAddress, proposalId, proposalModules]) + }, [dao, proposalId]) return ( +} export const ProposalModuleAdapterCommonProvider = ({ - coreAddress, - proposalModule, + proposalModuleAddress, children, }: ProposalModuleAdapterCommonProviderProps) => { - const chain = useChain() + const { dao } = useDaoContext() const context = useMemo( - () => - matchAndLoadCommonContext(proposalModule, { - coreAddress, - chain, - }), - [chain, coreAddress, proposalModule] + () => matchAndLoadCommonContext(dao, proposalModuleAddress), + [dao, proposalModuleAddress] ) return ( diff --git a/packages/stateful/queries/dao.ts b/packages/stateful/queries/dao.ts index d1f3a5ebc..c8847747d 100644 --- a/packages/stateful/queries/dao.ts +++ b/packages/stateful/queries/dao.ts @@ -110,7 +110,7 @@ export const fetchDaoInfo = async ( const [ parentDao, - votingModuleInfo, + { info: votingModuleInfo }, created, proposalModules, _items, @@ -200,8 +200,6 @@ export const fetchDaoInfo = async ( .catch(() => null), ]) - const votingModuleContractName = votingModuleInfo.info.contract - // Convert items list into map. const items = Object.fromEntries(_items) @@ -211,7 +209,7 @@ export const fetchDaoInfo = async ( coreVersion, supportedFeatures, votingModuleAddress: state.voting_module, - votingModuleContractName, + votingModuleInfo, proposalModules: proposalModules.sort((a, b) => a.prefix.localeCompare(b.prefix) ), diff --git a/packages/stateful/recoil/selectors/dao.ts b/packages/stateful/recoil/selectors/dao.ts index ed0975dbb..91e02627b 100644 --- a/packages/stateful/recoil/selectors/dao.ts +++ b/packages/stateful/recoil/selectors/dao.ts @@ -7,24 +7,20 @@ import { } from 'recoil' import { - DaoCoreV2Selectors, + DaoDaoCoreSelectors, DaoVotingCw20StakedSelectors, accountsSelector, contractInfoSelector, contractVersionSelector, daoDropdownInfoSelector, - daoTvlSelector, daoVetoableDaosSelector, followingDaosSelector, - govProposalsSelector, isDaoSelector, - nativeDelegatedBalanceSelector, queryClientAtom, queryWalletIndexerSelector, refreshProposalsIdAtom, } from '@dao-dao/state' import { - DaoCardLazyData, DaoPageMode, DaoSource, DaoWithDropdownVetoableProposalList, @@ -37,117 +33,12 @@ import { import { DaoVotingCw20StakedAdapterId, getDaoProposalPath, - getSupportedChainConfig, isConfiguredChainName, } from '@dao-dao/utils' -import { proposalModuleAdapterProposalCountSelector } from '../../proposal-module-adapter' import { fetchProposalModules } from '../../utils/fetchProposalModules' import { matchAdapter as matchVotingModuleAdapter } from '../../voting-module-adapter' -export const daoCardLazyDataSelector = selectorFamily< - DaoCardLazyData, - WithChainId<{ - coreAddress: string - walletAddress?: string - }> ->({ - key: 'daoCardLazyData', - get: - ({ coreAddress, chainId, walletAddress }) => - ({ get }) => { - const { amount: tvl } = get( - daoTvlSelector({ - chainId, - coreAddress, - }) - ) - - // Native chain x/gov module. - if (isConfiguredChainName(chainId, coreAddress)) { - // If chain uses a contract-based DAO, load it instead. - const govContractAddress = - getSupportedChainConfig(chainId)?.govContractAddress - if (govContractAddress) { - coreAddress = govContractAddress - } else { - // Use chain x/gov module info. - - // Get proposal count by loading one proposal and getting the total. - const { total: proposalCount } = get( - govProposalsSelector({ - chainId, - limit: 1, - }) - ) - - const isMember = walletAddress - ? get( - nativeDelegatedBalanceSelector({ - chainId, - address: walletAddress, - }) - ).amount !== '0' - : false - - return { - isMember, - proposalCount, - tokenWithBalance: { - balance: tvl, - symbol: 'USD', - decimals: 2, - }, - } - } - } - - // DAO. - - const walletVotingWeight = walletAddress - ? Number( - get( - DaoCoreV2Selectors.votingPowerAtHeightSelector({ - chainId, - contractAddress: coreAddress, - params: [{ address: walletAddress }], - }) - ).power - ) - : 0 - - const proposalModules = get( - daoCoreProposalModulesSelector({ - chainId, - coreAddress, - }) - ) - const proposalModuleCounts = get( - waitForAll( - proposalModules.map(({ address }) => - proposalModuleAdapterProposalCountSelector({ - chainId, - proposalModuleAddress: address, - }) - ) - ) - ).filter(Boolean) as number[] - - return { - isMember: walletVotingWeight > 0, - proposalCount: proposalModuleCounts.reduce( - (acc, curr) => acc + curr, - 0 - ), - tokenWithBalance: { - balance: tvl, - symbol: 'USD', - decimals: 2, - }, - } - }, -}) - export const followingDaosWithProposalModulesSelector = selectorFamily< (DaoSource & { proposalModules: ProposalModule[] @@ -220,7 +111,7 @@ export const daoCw20GovernanceTokenAddressSelector = selectorFamily< ({ coreAddress, chainId }) => ({ get }) => { const votingModuleAddress = get( - DaoCoreV2Selectors.votingModuleSelector({ + DaoDaoCoreSelectors.votingModuleSelector({ contractAddress: coreAddress, chainId, params: [], @@ -343,34 +234,27 @@ export const daosWithVetoableProposalsSelector = selectorFamily< ) ) - const daoConfigAndProposalModules = get( + const daoConfigs = get( waitForAllSettled( uniqueChainsAndDaos.map((chainAndDao) => { const [chainId, coreAddress] = chainAndDao.split(':') - return waitForAll([ - DaoCoreV2Selectors.configSelector({ - chainId, - contractAddress: coreAddress, - params: [], - }), - daoCoreProposalModulesSelector({ - chainId, - coreAddress, - }), - ]) + return DaoDaoCoreSelectors.configSelector({ + chainId, + contractAddress: coreAddress, + params: [], + }) }) ) ) return uniqueChainsAndDaos.flatMap((chainAndDao, index) => { - const daoData = daoConfigAndProposalModules[index] + const config = daoConfigs[index] - return daoData.state === 'hasValue' + return config.state === 'hasValue' ? { chainId: chainAndDao.split(':')[0], dao: chainAndDao.split(':')[1], - name: daoData.contents[0].name, - proposalModules: daoData.contents[1], + name: config.contents.name, proposalsWithModule: daoVetoableProposalsPerChain.find( (vetoable) => `${vetoable.chainId}:${vetoable.dao}` === chainAndDao @@ -412,7 +296,6 @@ export const daosWithDropdownVetoableProposalListSelector = selectorFamily< ({ chainId, dao, - proposalModules, proposalsWithModule, }): | DaoWithDropdownVetoableProposalList @@ -438,7 +321,6 @@ export const daosWithDropdownVetoableProposalListSelector = selectorFamily< ({ id }): StatefulProposalLineProps => ({ chainId, coreAddress: dao, - proposalModules, proposalId: `${prefix}${id}`, proposalViewUrl: getDaoProposalPath( daoPageMode, diff --git a/packages/stateful/server/makeGetDaoStaticProps.ts b/packages/stateful/server/makeGetDaoStaticProps.ts index 329775f86..7022dbc91 100644 --- a/packages/stateful/server/makeGetDaoStaticProps.ts +++ b/packages/stateful/server/makeGetDaoStaticProps.ts @@ -16,11 +16,10 @@ import { import { ChainId, CommonProposalInfo, - ContractVersion, - DaoInfo, DaoPageMode, GovProposalVersion, GovProposalWithDecodedContent, + IDaoBase, ProposalV1, ProposalV1Beta1, } from '@dao-dao/types' @@ -41,12 +40,12 @@ import { processError, } from '@dao-dao/utils' +import { ChainXGovDao, getDao } from '../clients' import { DaoPageWrapperProps } from '../components' import { ProposalModuleAdapterError, matchAndLoadAdapter, } from '../proposal-module-adapter' -import { daoQueries } from '../queries/dao' interface GetDaoStaticPropsMakerProps { leadingTitle?: string @@ -65,7 +64,7 @@ interface GetDaoStaticPropsMakerOptions { t: TFunction queryClient: QueryClient chain: Chain - daoInfo: DaoInfo + dao: IDaoBase }) => | GetDaoStaticPropsMakerProps | undefined @@ -138,7 +137,6 @@ export const makeGetDaoStaticProps: GetDaoStaticPropsMaker = } // Add to Sentry error tags if error occurs. - let daoInfo: DaoInfo | undefined try { // Check for legacy contract. const contractInfo = !configuredGovChain @@ -158,12 +156,18 @@ export const makeGetDaoStaticProps: GetDaoStaticPropsMaker = throw new LegacyDaoError() } - daoInfo = await queryClient.fetchQuery( - daoQueries.info(queryClient, { - chainId, - coreAddress, - }) - ) + const dao = getDao({ + queryClient, + chainId, + coreAddress, + }) + + await Promise.all([ + // Initialize to load info. + dao.init(), + // Pre-fetch TVL. + dao.getTvl(), + ]) // Must be called after server side translations has been awaited, // because props may use the `t` function, and it won't be available @@ -181,19 +185,19 @@ export const makeGetDaoStaticProps: GetDaoStaticPropsMaker = t: serverT, queryClient, chain: getChainForChainId(chainId), - daoInfo, + dao, })) ?? {} const title = overrideTitle ?? - [leadingTitle?.trim(), daoInfo.name, followingTitle?.trim()] + [leadingTitle?.trim(), dao.name, followingTitle?.trim()] .filter(Boolean) .join(' | ') - const description = overrideDescription ?? daoInfo.description + const description = overrideDescription ?? dao.description const accentColor = // If viewing configured gov chain, use its accent color. configuredGovChain?.accentColor || - daoInfo.items[DAO_CORE_ACCENT_ITEM_KEY] || + dao.info.items[DAO_CORE_ACCENT_ITEM_KEY] || null const props: DaoPageWrapperProps = { @@ -202,7 +206,7 @@ export const makeGetDaoStaticProps: GetDaoStaticPropsMaker = title, description, accentColor, - info: daoInfo, + info: dao.info, reactQueryDehydratedState: dehydrateSerializable(queryClient), ...additionalProps, } @@ -283,7 +287,6 @@ export const makeGetDaoStaticProps: GetDaoStaticPropsMaker = tags: { chainId, coreAddress, - coreVersion: daoInfo?.coreVersion ?? '', }, extra: { context }, }), @@ -361,7 +364,7 @@ export const makeGetDaoProposalStaticProps = ({ }: GetDaoProposalStaticPropsMakerOptions) => makeGetDaoStaticProps({ ...options, - getProps: async ({ context: { params = {} }, t, chain, daoInfo }) => { + getProps: async ({ context: { params = {} }, t, chain, dao }) => { const proposalId = params[proposalIdParamKey] // If invalid proposal ID, not found. @@ -375,7 +378,7 @@ export const makeGetDaoProposalStaticProps = ({ } // Gov module. - if (daoInfo.coreVersion === ContractVersion.Gov) { + if (dao instanceof ChainXGovDao) { const url = getProposalUrlPrefix(params) + proposalId const client = await cosmosProtoRpcClientRouter.connect(chain.chain_id) @@ -532,10 +535,7 @@ export const makeGetDaoProposalStaticProps = ({ adapter: { functions: { getProposalInfo }, }, - } = await matchAndLoadAdapter(daoInfo.proposalModules, proposalId, { - chain, - coreAddress: daoInfo.coreAddress, - }) + } = await matchAndLoadAdapter(dao, proposalId) // If proposal is numeric, i.e. has no prefix, redirect to prefixed URL. if (!isNaN(Number(proposalId))) { diff --git a/packages/stateful/utils/fetchProposalModules.ts b/packages/stateful/utils/fetchProposalModules.ts index 5704884a8..7fa451a7a 100644 --- a/packages/stateful/utils/fetchProposalModules.ts +++ b/packages/stateful/utils/fetchProposalModules.ts @@ -2,7 +2,7 @@ import { QueryClient } from '@tanstack/react-query' import { CwCoreV1QueryClient, - DaoCoreV2QueryClient, + DaoDaoCoreQueryClient, } from '@dao-dao/state/contracts' import { indexerQueries } from '@dao-dao/state/query' import { @@ -11,11 +11,11 @@ import { ProposalModuleType, } from '@dao-dao/types' import { InfoResponse } from '@dao-dao/types/contracts/common' -import { ProposalModuleWithInfo } from '@dao-dao/types/contracts/DaoCore.v2' +import { ProposalModuleWithInfo } from '@dao-dao/types/contracts/DaoDaoCore' import { DaoProposalMultipleAdapterId, DaoProposalSingleAdapterId, - cosmWasmClientRouter, + getCosmWasmClientForChainId, indexToProposalModulePrefix, parseContractVersion, } from '@dao-dao/utils' @@ -56,7 +56,8 @@ export const fetchProposalModules = async ( const proposalModules: ProposalModule[] = await Promise.all( activeProposalModules.map(async ({ info, address, prefix }) => { - const version = (info && parseContractVersion(info.version)) ?? null + const version = + (info && parseContractVersion(info.version)) ?? ContractVersion.Unknown // Get adapter for this contract. const adapter = info && matchAdapter(info.contract) @@ -111,7 +112,7 @@ export const fetchProposalModulesWithInfoFromChain = async ( coreAddress: string, coreVersion: ContractVersion ): Promise => { - const cwClient = await cosmWasmClientRouter.connect(chainId) + const cwClient = await getCosmWasmClientForChainId(chainId) let paginationStart: string | undefined @@ -145,7 +146,7 @@ export const fetchProposalModulesWithInfoFromChain = async ( const getV2ProposalModules = async () => ( - await new DaoCoreV2QueryClient( + await new DaoDaoCoreQueryClient( cwClient, coreAddress ).activeProposalModules({ diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useMainDaoInfoCards.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useMainDaoInfoCards.tsx index 0ed6b96d2..27748e39b 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useMainDaoInfoCards.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useMainDaoInfoCards.tsx @@ -19,11 +19,8 @@ import { useStakingInfo } from './useStakingInfo' export const useMainDaoInfoCards = (): DaoInfoCard[] => { const { t } = useTranslation() - const { chainId, votingModuleAddress, coreAddress } = - useVotingModuleAdapterOptions() - const { totalVotingWeight } = useMembership({ - coreAddress, - }) + const { chainId, votingModuleAddress } = useVotingModuleAdapterOptions() + const { totalVotingWeight } = useMembership() const { unstakingDuration } = useStakingInfo() diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/MembersTab.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/MembersTab.tsx index e71b31fbd..4fc8b5a9b 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/MembersTab.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/MembersTab.tsx @@ -21,9 +21,7 @@ export const MembersTab = () => { const { coreAddress } = useVotingModuleAdapterOptions() const { getDaoProposalPath } = useDaoNavHelpers() - const { isMember = false, totalVotingWeight } = useMembership({ - coreAddress, - }) + const { isMember = false, totalVotingWeight } = useMembership() const votingModule = useLoadingVotingModule(coreAddress, { fetchMembers: true, }) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/ProfileCardMemberInfo/index.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/ProfileCardMemberInfo/index.tsx index ae83c3377..dc80113d1 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/ProfileCardMemberInfo/index.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/ProfileCardMemberInfo/index.tsx @@ -8,11 +8,9 @@ export const ProfileCardMemberInfo = ({ maxGovernanceTokenDeposit: _, ...props }: BaseProfileCardMemberInfoProps) => { - const { name: daoName, coreAddress } = useDaoInfoContext() + const { name: daoName } = useDaoInfoContext() - const { walletVotingWeight, totalVotingWeight } = useMembership({ - coreAddress, - }) + const { walletVotingWeight, totalVotingWeight } = useMembership() return ( { const { t } = useTranslation() const { chain_id: chainId } = useChain() - const { coreAddress, items } = useDaoInfoContext() - const { isMember = false } = useMembership({ - coreAddress, - }) + const { items } = useDaoInfoContext() + const { isMember = false } = useMembership() const loadingWidgets = useMemo((): LoadingData => { const parsedWidgets = getFilteredDaoItemsByPrefix( diff --git a/packages/stateful/widgets/widgets/MintNft/MintNftEditor.tsx b/packages/stateful/widgets/widgets/MintNft/MintNftEditor.tsx index c0d85e4b5..cafc21ff7 100644 --- a/packages/stateful/widgets/widgets/MintNft/MintNftEditor.tsx +++ b/packages/stateful/widgets/widgets/MintNft/MintNftEditor.tsx @@ -9,7 +9,7 @@ import { waitForAny, } from 'recoil' -import { CommonNftSelectors, DaoCoreV2Selectors } from '@dao-dao/state/recoil' +import { CommonNftSelectors, DaoDaoCoreSelectors } from '@dao-dao/state/recoil' import { AddressInput, Button, @@ -59,7 +59,7 @@ export const MintNftEditor = ({ ) const existingTokenAddresses = useRecoilValue( - DaoCoreV2Selectors.allCw721CollectionsSelector({ + DaoDaoCoreSelectors.allCw721CollectionsSelector({ contractAddress: address, chainId, }) diff --git a/packages/stateful/widgets/widgets/MintNft/MintNftRenderer.tsx b/packages/stateful/widgets/widgets/MintNft/MintNftRenderer.tsx index 6229e613d..aa6db05bc 100644 --- a/packages/stateful/widgets/widgets/MintNft/MintNftRenderer.tsx +++ b/packages/stateful/widgets/widgets/MintNft/MintNftRenderer.tsx @@ -15,7 +15,7 @@ import { useChain, } from '@dao-dao/stateless' import { WidgetRendererProps } from '@dao-dao/types' -import { CHAIN_GAS_MULTIPLIER, processError } from '@dao-dao/utils' +import { executeSmartContract, processError } from '@dao-dao/utils' import { useWallet } from '../../../hooks/useWallet' import { MintNftData } from './types' @@ -31,7 +31,7 @@ export const MintNftRenderer = ({ const { chain_id: chainId } = useChain() const { address: walletAddress = '', - getSigningCosmWasmClient, + getSigningClient, isWalletConnected, } = useWallet() @@ -67,12 +67,11 @@ export const MintNftRenderer = ({ setMinting(true) try { - const signingCosmWasmClient = await getSigningCosmWasmClient() - await signingCosmWasmClient.execute( + await executeSmartContract( + getSigningClient, walletAddress, contract, - JSON.parse(msg.replaceAll('{{wallet}}', walletAddress)), - CHAIN_GAS_MULTIPLIER + JSON.parse(msg.replaceAll('{{wallet}}', walletAddress)) ) } catch (err) { console.error(err) diff --git a/packages/stateful/widgets/widgets/Press/PressEditor.tsx b/packages/stateful/widgets/widgets/Press/PressEditor.tsx index 7975655f5..d8ab656b4 100644 --- a/packages/stateful/widgets/widgets/Press/PressEditor.tsx +++ b/packages/stateful/widgets/widgets/Press/PressEditor.tsx @@ -61,7 +61,7 @@ export const PressEditor = ({ const { address: walletAddress = '', - getSigningCosmWasmClient, + getSigningClient, chain, } = useWallet({ chainId, @@ -86,12 +86,11 @@ export const PressEditor = ({ setInstantiating(true) try { const codeId = getSupportedChainConfig(chainId)?.codeIds?.Cw721Base - const signingCosmWasmClient = await getSigningCosmWasmClient() const name = `${daoName}'s Press` const contractAddress = codeId ? await instantiateSmartContract( - signingCosmWasmClient, + getSigningClient, walletAddress, codeId, name, diff --git a/packages/stateful/widgets/widgets/Press/Renderer/index.tsx b/packages/stateful/widgets/widgets/Press/Renderer/index.tsx index ba0bb3895..650c17152 100644 --- a/packages/stateful/widgets/widgets/Press/Renderer/index.tsx +++ b/packages/stateful/widgets/widgets/Press/Renderer/index.tsx @@ -18,9 +18,7 @@ export const Renderer = ({ }: WidgetRendererProps) => { const { chainId: daoChainId, coreAddress } = useDaoInfoContext() const { getDaoProposalPath } = useDaoNavHelpers() - const { isMember = false } = useMembership({ - coreAddress, - }) + const { isMember = false } = useMembership() // The chain that Press is set up on. If chain ID is undefined, default to // native DAO chain for backwards compatibility. diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/OpenSurveySection.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/OpenSurveySection.tsx index c86109732..757fee0d4 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/OpenSurveySection.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/OpenSurveySection.tsx @@ -7,7 +7,7 @@ import { useDaoInfoContext, useDaoNavHelpers, } from '@dao-dao/stateless' -import { CosmosMsgFor_Empty, WidgetId } from '@dao-dao/types' +import { UnifiedCosmosMsg, WidgetId } from '@dao-dao/types' import { makeBankMessage, makeWasmMessage, @@ -67,7 +67,6 @@ export const OpenSurveySection = ({ // Voting power at time of survey creation, which determines what access level // this wallet has. const { isMember = false } = useMembership({ - coreAddress, blockHeight: status.survey.createdAtBlockHeight, }) @@ -185,14 +184,14 @@ export const OpenSurveySection = ({ }) ) - const cosmosMsgs: CosmosMsgFor_Empty[] = contributions.flatMap( + const cosmosMsgs: UnifiedCosmosMsg[] = contributions.flatMap( ({ contributor, compensation }) => compensation.compensationPerAttribute.flatMap( - ({ nativeTokens, cw20Tokens }): CosmosMsgFor_Empty[] => [ + ({ nativeTokens, cw20Tokens }): UnifiedCosmosMsg[] => [ ...nativeTokens .filter(({ amount }) => amount !== '0') .map( - ({ denomOrAddress, amount }): CosmosMsgFor_Empty => ({ + ({ denomOrAddress, amount }): UnifiedCosmosMsg => ({ bank: makeBankMessage( amount, contributor.address, @@ -203,7 +202,7 @@ export const OpenSurveySection = ({ ...cw20Tokens .filter(({ amount }) => amount !== '0') .map( - ({ denomOrAddress, amount }): CosmosMsgFor_Empty => + ({ denomOrAddress, amount }): UnifiedCosmosMsg => makeWasmMessage({ wasm: { execute: { diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/TabRenderer.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/TabRenderer.tsx index f70498d45..1ec8977dd 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/TabRenderer.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/TabRenderer.tsx @@ -1,19 +1,22 @@ +import { FetchQueryOptions, useQueries } from '@tanstack/react-query' import { saveAs } from 'file-saver' import { unparse as jsonToCsv } from 'papaparse' import { useCallback, useState } from 'react' import toast from 'react-hot-toast' -import { waitForAll } from 'recoil' -import { DaoCoreV2Selectors } from '@dao-dao/state/recoil' +import { useCachedLoading, useChain, useDaoContext } from '@dao-dao/stateless' +import { VotingPowerAtHeightResponse } from '@dao-dao/types/contracts/DaoDaoCore' import { - useCachedLoading, - useChain, - useDaoInfoContext, -} from '@dao-dao/stateless' -import { secp256k1PublicKeyToBech32Address } from '@dao-dao/utils' + makeCombineQueryResultsIntoLoadingDataWithError, + secp256k1PublicKeyToBech32Address, +} from '@dao-dao/utils' import { IconButtonLink } from '../../../../../../components' -import { useMembership, useWallet } from '../../../../../../hooks' +import { + useMembership, + useOnSecretNetworkPermitUpdate, + useWallet, +} from '../../../../../../hooks' import { usePostRequest } from '../../hooks/usePostRequest' import { listCompletedSurveysSelector, statusSelector } from '../../selectors' import { CompletedSurvey, CompletedSurveyListing } from '../../types' @@ -22,49 +25,43 @@ import { NewSurveyForm } from './NewSurveyForm' import { OpenSurveySection } from './OpenSurveySection' export const TabRenderer = () => { - const { coreAddress } = useDaoInfoContext() - const { chain_id: chainId, bech32_prefix: bech32Prefix } = useChain() - const { address: walletAddress = '', hexPublicKey } = useWallet({ + const { dao } = useDaoContext() + const { bech32_prefix: bech32Prefix } = useChain() + const { address: walletAddress, hexPublicKey } = useWallet({ loadAccount: true, }) - const { isMember = false } = useMembership({ - coreAddress, - }) + const { isMember = false } = useMembership() const loadingStatus = useCachedLoading( statusSelector({ - daoAddress: coreAddress, + daoAddress: dao.coreAddress, walletPublicKey: !hexPublicKey.loading ? hexPublicKey.data : '_', }), undefined ) const loadingCompletedSurveys = useCachedLoading( listCompletedSurveysSelector({ - daoAddress: coreAddress, + daoAddress: dao.coreAddress, }), [] ) + // Get voting power at time of each completed survey creation to determine if // we can download the CSV or not. - const loadingMembershipDuringCompletedSurveys = useCachedLoading( - loadingCompletedSurveys.loading || !walletAddress - ? undefined - : waitForAll( - loadingCompletedSurveys.data.map(({ createdAtBlockHeight }) => - DaoCoreV2Selectors.votingPowerAtHeightSelector({ - contractAddress: coreAddress, - chainId, - params: [ - { - address: walletAddress, - height: createdAtBlockHeight, - }, - ], - }) - ) - ), - [] - ) + const loadingMembershipDuringCompletedSurveys = useQueries({ + queries: + loadingCompletedSurveys.loading || !walletAddress + ? ([] as FetchQueryOptions[]) + : loadingCompletedSurveys.data.map(({ createdAtBlockHeight }) => + dao.getVotingPowerQuery(walletAddress, createdAtBlockHeight) + ), + combine: makeCombineQueryResultsIntoLoadingDataWithError({ + transform: (results) => results.map((r) => r.power), + }), + }) + // Make sure this component re-renders if the Secret Network permit changes so + // the voting queries above refresh. + useOnSecretNetworkPermitUpdate() const postRequest = usePostRequest() @@ -75,7 +72,7 @@ export const TabRenderer = () => { setLoadingCompletedSurveyId(id) try { const { survey }: { survey: CompletedSurvey } = await postRequest( - `/${coreAddress}/view/${id}` + `/${dao.coreAddress}/view/${id}` ) const raterTitles = ( @@ -133,7 +130,7 @@ export const TabRenderer = () => { setLoadingCompletedSurveyId(undefined) } }, - [bech32Prefix, coreAddress, postRequest] + [bech32Prefix, dao.coreAddress, postRequest] ) return ( diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/TabRenderer.stories.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/TabRenderer.stories.tsx index e04df9209..2676e7ba8 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/TabRenderer.stories.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/TabRenderer.stories.tsx @@ -54,20 +54,8 @@ Default.args = { }, loadingMembershipDuringCompletedSurveys: { loading: false, - data: [ - { - height: 1, - power: '0', - }, - { - height: 2, - power: '5', - }, - { - height: 3, - power: '10', - }, - ], + errored: false, + data: ['0', '5', '10'], }, isMember: true, NewSurveyForm: () => , diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/TabRenderer.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/TabRenderer.tsx index 881604060..06c1254ce 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/TabRenderer.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/TabRenderer.tsx @@ -12,9 +12,8 @@ import { useDaoInfoContext, useDaoNavHelpers, } from '@dao-dao/stateless' -import { LoadingData } from '@dao-dao/types' +import { LoadingData, LoadingDataWithError } from '@dao-dao/types' import { IconButtonLinkProps } from '@dao-dao/types/components/IconButtonLink' -import { VotingPowerAtHeightResponse } from '@dao-dao/types/contracts/DaoCore.v2' import { CompletedSurveyListing, @@ -33,9 +32,7 @@ export interface TabRendererProps { > downloadCompletedSurvey: (pastSurvey: CompletedSurveyListing) => void loadingCompletedSurveyId: number | undefined - loadingMembershipDuringCompletedSurveys: LoadingData< - VotingPowerAtHeightResponse[] - > + loadingMembershipDuringCompletedSurveys: LoadingDataWithError IconButtonLink: ComponentType } @@ -132,9 +129,9 @@ export const TabRenderer = ({ {loadingCompletedSurveys.data.map((survey, index) => { const wasMemberDuringSurvey = !loadingMembershipDuringCompletedSurveys.loading && - Number( - loadingMembershipDuringCompletedSurveys.data[index].power - ) > 0 + !loadingMembershipDuringCompletedSurveys.errored && + Number(loadingMembershipDuringCompletedSurveys.data[index]) > + 0 return ( & { diff --git a/packages/stateful/widgets/widgets/VestingPayments/Renderer/TabRenderer/index.tsx b/packages/stateful/widgets/widgets/VestingPayments/Renderer/TabRenderer/index.tsx index ec5cc3b16..b98c0e9a5 100644 --- a/packages/stateful/widgets/widgets/VestingPayments/Renderer/TabRenderer/index.tsx +++ b/packages/stateful/widgets/widgets/VestingPayments/Renderer/TabRenderer/index.tsx @@ -7,7 +7,6 @@ import { } from '@dao-dao/state/recoil' import { useCachedLoadingWithError, - useChain, useDaoInfoContext, useDaoNavHelpers, } from '@dao-dao/stateless' @@ -31,12 +30,9 @@ import { TabRenderer as StatelessTabRenderer } from './TabRenderer' export const TabRenderer = ({ variables: { factories, factory, oldFactories }, }: WidgetRendererProps) => { - const { chain_id: defaultChainId } = useChain() - const { coreAddress } = useDaoInfoContext() + const { chainId: defaultChainId, coreAddress } = useDaoInfoContext() const { getDaoProposalPath } = useDaoNavHelpers() - const { isMember = false } = useMembership({ - coreAddress, - }) + const { isMember = false } = useMembership() const setRefresh = useSetRecoilState(refreshVestingAtom('')) // Refresh vesting data every 30 seconds. diff --git a/packages/stateful/widgets/widgets/VestingPayments/VestingPaymentsEditor.tsx b/packages/stateful/widgets/widgets/VestingPayments/VestingPaymentsEditor.tsx index 8af244c91..bad3a712b 100644 --- a/packages/stateful/widgets/widgets/VestingPayments/VestingPaymentsEditor.tsx +++ b/packages/stateful/widgets/widgets/VestingPayments/VestingPaymentsEditor.tsx @@ -126,7 +126,7 @@ const VestingFactoryChain = ({ const { address: walletAddress, isWalletConnected, - getSigningCosmWasmClient, + getSigningClient, } = useWallet({ chainId, }) @@ -187,7 +187,7 @@ const VestingFactoryChain = ({ setInstantiating(true) try { const createdFactoryAddress = await instantiateSmartContract( - await getSigningCosmWasmClient(), + getSigningClient, walletAddress, codeIds.CwPayrollFactory, `DAO_${name}_VestingFactory-v${LATEST_VESTING_CONTRACT_VERSION}_${chainId}`, diff --git a/packages/stateless/components/EntityDisplay.tsx b/packages/stateless/components/EntityDisplay.tsx index 5a98fc16f..cdde2ced8 100644 --- a/packages/stateless/components/EntityDisplay.tsx +++ b/packages/stateless/components/EntityDisplay.tsx @@ -12,7 +12,8 @@ import { toAccessibleImageUrl, } from '@dao-dao/utils' -import { useChainContext, useDaoNavHelpers, useDetectTruncate } from '../hooks' +import { useChainContext } from '../contexts' +import { useDaoNavHelpers, useDetectTruncate } from '../hooks' import { ButtonLink } from './buttons' import { IconButton } from './icon_buttons' import { Tooltip } from './tooltip/Tooltip' diff --git a/packages/stateless/components/actions/ActionsEditor.tsx b/packages/stateless/components/actions/ActionsEditor.tsx index 282d3ff88..677e3cb09 100644 --- a/packages/stateless/components/actions/ActionsEditor.tsx +++ b/packages/stateless/components/actions/ActionsEditor.tsx @@ -22,7 +22,7 @@ import { LoadedActions, } from '@dao-dao/types/actions' -import { useDaoInfoContextIfAvailable } from '../../hooks' +import { useDaoInfoContextIfAvailable } from '../../contexts' import { IconButton } from '../icon_buttons' import { PAGINATION_MIN_PAGE, Pagination } from '../Pagination' import { Tooltip } from '../tooltip' diff --git a/packages/stateless/components/actions/NestedActionsEditor.tsx b/packages/stateless/components/actions/NestedActionsEditor.tsx index 631d0bde8..17f4efcf0 100644 --- a/packages/stateless/components/actions/NestedActionsEditor.tsx +++ b/packages/stateless/components/actions/NestedActionsEditor.tsx @@ -5,10 +5,10 @@ import useDeepCompareEffect from 'use-deep-compare-effect' import { ActionCategoryWithLabel, ActionComponent, - CosmosMsgFor_Empty, LoadedActions, NestedActionsEditorFormData, SuspenseLoaderProps, + UnifiedCosmosMsg, } from '@dao-dao/types' import { convertActionsToMessages } from '@dao-dao/utils' @@ -35,7 +35,7 @@ export const NestedActionsEditor: ActionComponent< watch((fieldNamePrefix + '_actionData') as '_actionData') || [] // Update action msgs from actions form data. - let msgs: CosmosMsgFor_Empty[] = [] + let msgs: UnifiedCosmosMsg[] = [] try { msgs = convertActionsToMessages(loadedActions, actionData) diff --git a/packages/stateless/components/actions/NestedActionsRenderer.tsx b/packages/stateless/components/actions/NestedActionsRenderer.tsx index d4c3f1f87..9379168c5 100644 --- a/packages/stateless/components/actions/NestedActionsRenderer.tsx +++ b/packages/stateless/components/actions/NestedActionsRenderer.tsx @@ -4,8 +4,8 @@ import { useFormContext } from 'react-hook-form' import { Action, ActionAndData, - CosmosMsgFor_Empty, SuspenseLoaderProps, + UnifiedCosmosMsg, } from '@dao-dao/types' import { decodeMessages } from '@dao-dao/utils' @@ -25,7 +25,7 @@ export const NestedActionsRenderer = ({ SuspenseLoader, }: NestedActionsRendererProps) => { const { watch } = useFormContext<{ - msgs: CosmosMsgFor_Empty[] + msgs: UnifiedCosmosMsg[] }>() const msgs = watch(msgsFieldName as 'msgs') diff --git a/packages/stateless/components/buttons/Buttonifier.tsx b/packages/stateless/components/buttons/Buttonifier.tsx index 20b60028b..9c611534b 100644 --- a/packages/stateless/components/buttons/Buttonifier.tsx +++ b/packages/stateless/components/buttons/Buttonifier.tsx @@ -31,6 +31,7 @@ export const getPassthroughProps =

({ disabled, loading, allowClickWhileLoading, + loadingVariant: _loadingVariant, ...props }: P) => ({ ...props, diff --git a/packages/stateless/components/chain/ChainProvider.tsx b/packages/stateless/components/chain/ChainProvider.tsx index 6c63223a3..220d4a851 100644 --- a/packages/stateless/components/chain/ChainProvider.tsx +++ b/packages/stateless/components/chain/ChainProvider.tsx @@ -7,7 +7,7 @@ import { maybeGetNativeTokenForChainId, } from '@dao-dao/utils' -import { ChainContext } from '../../hooks/useChainContext' +import { ChainContext } from '../../contexts/Chain' export type ChainProviderProps = { chainId: string diff --git a/packages/stateless/components/dao/DaoCard.stories.tsx b/packages/stateless/components/dao/DaoCard.stories.tsx index 96dbbdced..c1f88c4be 100644 --- a/packages/stateless/components/dao/DaoCard.stories.tsx +++ b/packages/stateless/components/dao/DaoCard.stories.tsx @@ -39,7 +39,10 @@ export const makeDaoInfo = (id = 1): DaoInfo => ({ }, supportedFeatures: {} as any, votingModuleAddress: '', - votingModuleContractName: '', + votingModuleInfo: { + contract: '', + version: '', + }, proposalModules: [], // Random date in the past 12 months. created: @@ -61,8 +64,8 @@ export const makeDaoCardProps = (id = 1): DaoCardProps => ({ }, lazyData: { loading: false, + errored: false, data: { - isMember: Math.random() < 0.5, proposalCount: 25, tokenWithBalance: { balance: 120, @@ -71,6 +74,7 @@ export const makeDaoCardProps = (id = 1): DaoCardProps => ({ }, }, }, + isMember: true, LinkWrapper, }) @@ -86,7 +90,7 @@ Default.parameters = { export const Loading = Template.bind({}) Loading.args = { ...makeDaoCardProps(), - lazyData: { loading: true }, + lazyData: { loading: true, errored: false }, } Loading.parameters = { design: { diff --git a/packages/stateless/components/dao/DaoCard.tsx b/packages/stateless/components/dao/DaoCard.tsx index 48825498a..6c0495fca 100644 --- a/packages/stateless/components/dao/DaoCard.tsx +++ b/packages/stateless/components/dao/DaoCard.tsx @@ -23,6 +23,7 @@ export const DaoCard = ({ lazyData, follow, LinkWrapper, + isMember, showIsMember = true, showingEstimatedUsdValue = true, showParentDao = true, @@ -45,7 +46,7 @@ export const DaoCard = ({ prefetch >

- {showIsMember && !lazyData.loading && lazyData.data.isMember ? ( + {showIsMember && isMember ? ( @@ -104,7 +105,8 @@ export const DaoCard = ({ {removeMarkdown(description)}

- {(lazyData.loading || lazyData.data.tokenWithBalance) && ( + {(lazyData.loading || + (!lazyData.errored && lazyData.data.tokenWithBalance)) && (
)} - {(lazyData.loading || !isNaN(lazyData.data.proposalCount)) && ( + {(lazyData.loading || !lazyData.errored) && (
= (args) => { : [...current, props.info.coreAddress] ), }} - lazyData={{ loading: true }} + lazyData={{ loading: true, errored: false }} /> )} /> diff --git a/packages/stateless/components/dao/tabs/SubDaosTab.tsx b/packages/stateless/components/dao/tabs/SubDaosTab.tsx index 95b88cdd6..4c7476177 100644 --- a/packages/stateless/components/dao/tabs/SubDaosTab.tsx +++ b/packages/stateless/components/dao/tabs/SubDaosTab.tsx @@ -11,7 +11,8 @@ import { StatefulDaoCardProps, } from '@dao-dao/types' -import { useDaoInfoContext, useDaoNavHelpers } from '../../../hooks' +import { useDaoInfoContext } from '../../../contexts' +import { useDaoNavHelpers } from '../../../hooks' import { GridCardContainer } from '../../GridCardContainer' import { NoContent } from '../../NoContent' import { Tooltip } from '../../tooltip' diff --git a/packages/stateless/components/dao/tabs/TreasuryTab.tsx b/packages/stateless/components/dao/tabs/TreasuryTab.tsx index 66b29aa00..e113cbcfa 100644 --- a/packages/stateless/components/dao/tabs/TreasuryTab.tsx +++ b/packages/stateless/components/dao/tabs/TreasuryTab.tsx @@ -23,12 +23,8 @@ import { serializeTokenSource, } from '@dao-dao/utils' -import { - useButtonPopupSorter, - useDaoInfoContext, - useSupportedChainContext, - useTokenSortOptions, -} from '../../../hooks' +import { useDaoInfoContext, useSupportedChainContext } from '../../../contexts' +import { useButtonPopupSorter, useTokenSortOptions } from '../../../hooks' import { ErrorPage } from '../../error' import { LineLoaders } from '../../LineLoader' import { NftSection } from '../../nft/NftSection' diff --git a/packages/stateless/components/inputs/AddressInput.tsx b/packages/stateless/components/inputs/AddressInput.tsx index 7556d255c..d794d8209 100644 --- a/packages/stateless/components/inputs/AddressInput.tsx +++ b/packages/stateless/components/inputs/AddressInput.tsx @@ -7,7 +7,7 @@ import { FieldValues, Path, useFormContext } from 'react-hook-form' import { AddressInputProps, EntityType } from '@dao-dao/types' import { getAccountAddress, isValidBech32Address } from '@dao-dao/utils' -import { useChain } from '../../hooks/useChainContext' +import { useChain } from '../../contexts/Chain' import { useTrackDropdown } from '../../hooks/useTrackDropdown' import { EntityDisplay as StatelessEntityDisplay } from '../EntityDisplay' import { Loader } from '../logo/Loader' diff --git a/packages/stateless/components/inputs/DaoSupportedChainPickerInput.tsx b/packages/stateless/components/inputs/DaoSupportedChainPickerInput.tsx index 4d9358c64..c31ff5c94 100644 --- a/packages/stateless/components/inputs/DaoSupportedChainPickerInput.tsx +++ b/packages/stateless/components/inputs/DaoSupportedChainPickerInput.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next' import { ChainPickerPopupProps } from '@dao-dao/types' -import { useChainContext, useDaoInfoContextIfAvailable } from '../../hooks' +import { useChainContext, useDaoInfoContextIfAvailable } from '../../contexts' import { ChainPickerPopup } from '../popup' import { InputLabel } from './InputLabel' diff --git a/packages/stateless/components/layout/Breadcrumbs.tsx b/packages/stateless/components/layout/Breadcrumbs.tsx index e6ecbe216..49ff985f5 100644 --- a/packages/stateless/components/layout/Breadcrumbs.tsx +++ b/packages/stateless/components/layout/Breadcrumbs.tsx @@ -5,7 +5,8 @@ import { useTranslation } from 'react-i18next' import { BreadcrumbsProps, DaoPageMode } from '@dao-dao/types' -import { useDaoInfoContextIfAvailable, useDaoNavHelpers } from '../../hooks' +import { useDaoInfoContextIfAvailable } from '../../contexts' +import { useDaoNavHelpers } from '../../hooks' import { Button } from '../buttons/Button' import { IconButton } from '../icon_buttons/IconButton' import { LinkWrapper } from '../LinkWrapper' diff --git a/packages/stateless/components/layout/SdaNavigation.tsx b/packages/stateless/components/layout/SdaNavigation.tsx index 0224c932f..9b1d6b4e5 100644 --- a/packages/stateless/components/layout/SdaNavigation.tsx +++ b/packages/stateless/components/layout/SdaNavigation.tsx @@ -13,7 +13,8 @@ import { DaoPageMode, DaoTabId } from '@dao-dao/types' import { SdaNavigationProps } from '@dao-dao/types/components/SdaNavigation' import { MAINNET, getDaoPath as baseGetDaoPath } from '@dao-dao/utils' -import { useDaoInfoContext, useDaoNavHelpers } from '../../hooks' +import { useDaoInfoContext } from '../../contexts' +import { useDaoNavHelpers } from '../../hooks' import { DaoImage } from '../dao/DaoImage' import { IconButton, ThemeToggle } from '../icon_buttons' import { Tooltip } from '../tooltip/Tooltip' diff --git a/packages/stateless/components/modals/DiscordNotifierConfigureModal.tsx b/packages/stateless/components/modals/DiscordNotifierConfigureModal.tsx index 6fcba07b3..5ae89455c 100644 --- a/packages/stateless/components/modals/DiscordNotifierConfigureModal.tsx +++ b/packages/stateless/components/modals/DiscordNotifierConfigureModal.tsx @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next' import { DiscordNotifierRegistration } from '@dao-dao/state/recoil' import { ModalProps } from '@dao-dao/types' -import { useDaoInfoContext } from '../../hooks' +import { useDaoInfoContext } from '../../contexts' import { Button } from '../buttons' import { IconButton, IconButtonLink } from '../icon_buttons' import { DiscordIcon } from '../icons' diff --git a/packages/stateless/components/modals/Modal.tsx b/packages/stateless/components/modals/Modal.tsx index e702959ae..1aab24637 100644 --- a/packages/stateless/components/modals/Modal.tsx +++ b/packages/stateless/components/modals/Modal.tsx @@ -74,7 +74,7 @@ export const Modal = ({ ? createPortal(
alert(amount), diff --git a/packages/stateless/components/modals/TokenDepositModal.tsx b/packages/stateless/components/modals/TokenDepositModal.tsx index ed4038ff5..88f3416a5 100644 --- a/packages/stateless/components/modals/TokenDepositModal.tsx +++ b/packages/stateless/components/modals/TokenDepositModal.tsx @@ -104,7 +104,9 @@ export const TokenDepositModal = ({ : { loading: false, data: loadingBalance.data.amount } } dateFetched={ - loadingBalance.loading ? undefined : loadingBalance.data.timestamp + loadingBalance.loading + ? undefined + : new Date(loadingBalance.data.timestamp) } decimals={token.decimals} iconUrl={token.imageUrl} diff --git a/packages/stateless/components/not_found/ProposalNotFound.tsx b/packages/stateless/components/not_found/ProposalNotFound.tsx index 7ecfcd519..6dfb06b23 100644 --- a/packages/stateless/components/not_found/ProposalNotFound.tsx +++ b/packages/stateless/components/not_found/ProposalNotFound.tsx @@ -3,8 +3,8 @@ import { useTranslation } from 'react-i18next' import { DaoTabId, PageHeaderProps } from '@dao-dao/types' -import { useDaoInfoContext } from '../../hooks' -import { useDaoNavHelpers } from '../../hooks/useDaoNavHelpers' +import { useDaoInfoContext } from '../../contexts' +import { useDaoNavHelpers } from '../../hooks' import { ButtonLink } from '../buttons' import { ErrorPage } from '../error/ErrorPage' diff --git a/packages/stateless/components/profile/ProfileActions.tsx b/packages/stateless/components/profile/ProfileActions.tsx index bd74241d1..ec5275021 100644 --- a/packages/stateless/components/profile/ProfileActions.tsx +++ b/packages/stateless/components/profile/ProfileActions.tsx @@ -21,10 +21,10 @@ import { AccountTxForm, AccountTxSave, ActionCategoryWithLabel, - CosmosMsgFor_Empty, LoadedActions, LoadingData, SuspenseLoaderProps, + UnifiedCosmosMsg, WalletChainSwitcherProps, } from '@dao-dao/types' import { @@ -33,7 +33,8 @@ import { validateRequired, } from '@dao-dao/utils' -import { useChainContext, useHoldingKey } from '../../hooks' +import { useChainContext } from '../../contexts' +import { useHoldingKey } from '../../hooks' import { ActionsEditor, RawActionsRenderer } from '../actions' import { Button, ButtonLink } from '../buttons' import { CopyToClipboard } from '../CopyToClipboard' @@ -51,7 +52,7 @@ export type ProfileActionsProps = { categories: ActionCategoryWithLabel[] loadedActions: LoadedActions formMethods: UseFormReturn - execute: (messages: CosmosMsgFor_Empty[]) => Promise + execute: (messages: UnifiedCosmosMsg[]) => Promise loading: boolean SuspenseLoader: ComponentType error?: string diff --git a/packages/stateless/components/profile/ProfileVoteCard.stories.tsx b/packages/stateless/components/profile/ProfileVoteCard.stories.tsx index 595edc6f5..f7b7e3b08 100644 --- a/packages/stateless/components/profile/ProfileVoteCard.stories.tsx +++ b/packages/stateless/components/profile/ProfileVoteCard.stories.tsx @@ -2,7 +2,6 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' import { ProposalWalletVote } from '@dao-dao/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalWalletVote' import { WALLET_PROFILE_DATA } from '@dao-dao/storybook' -import { Vote } from '@dao-dao/types/contracts/DaoProposalSingle.common' import { ProfileVoteCard } from './ProfileVoteCard' @@ -26,7 +25,7 @@ Default.args = { loading: false, data: WALLET_PROFILE_DATA, }, - vote: , + vote: , } Default.parameters = { diff --git a/packages/stateless/components/proposal/GovernanceProposal.tsx b/packages/stateless/components/proposal/GovernanceProposal.tsx index 965d080c2..ba8edf863 100644 --- a/packages/stateless/components/proposal/GovernanceProposal.tsx +++ b/packages/stateless/components/proposal/GovernanceProposal.tsx @@ -20,7 +20,8 @@ import { import { ProposalStatus } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' import { formatDateTimeTz, govProposalToDecodedContent } from '@dao-dao/utils' -import { useChainContext, useTranslatedTimeDeltaFormatter } from '../../hooks' +import { useChainContext } from '../../contexts' +import { useTranslatedTimeDeltaFormatter } from '../../hooks' import { IconButtonLink } from '../icon_buttons' import { MarkdownRenderer } from '../MarkdownRenderer' import { Tooltip } from '../tooltip' diff --git a/packages/stateless/components/proposal/NewProposal.tsx b/packages/stateless/components/proposal/NewProposal.tsx index bf5672741..f8c4364ae 100644 --- a/packages/stateless/components/proposal/NewProposal.tsx +++ b/packages/stateless/components/proposal/NewProposal.tsx @@ -68,7 +68,10 @@ export type NewProposalProps< isActive: boolean activeThreshold: ActiveThreshold | null isMember: LoadingData - anyoneCanPropose: boolean + /** + * If defined, this is the reason why the user cannot propose. + */ + cannotProposeReason?: string depositUnsatisfied: boolean connected: boolean simulationBypassExpiration?: Date @@ -90,7 +93,7 @@ export const NewProposal = < isActive, activeThreshold, isMember, - anyoneCanPropose, + cannotProposeReason, depositUnsatisfied, connected, draft, @@ -267,9 +270,7 @@ export const NewProposal = < // simulating. (!holdingAltForSimulation && (!connected || - (!anyoneCanPropose && - !isMember.loading && - !isMember.data) || + !!cannotProposeReason || depositUnsatisfied || isPaused || !isActive)) || @@ -320,14 +321,11 @@ export const NewProposal = <
- {!anyoneCanPropose && - !isMember.loading && - !isMember.data && - !isWalletConnecting && ( -

- {t('error.mustBeMemberToCreateProposal')} -

- )} + {!!cannotProposeReason && !isMember.loading && !isWalletConnecting && ( +

+ {cannotProposeReason} +

+ )} {simulationBypassExpiration && (

diff --git a/packages/stateless/components/proposal/ProposalModuleSelector.tsx b/packages/stateless/components/proposal/ProposalModuleSelector.tsx index 23bc18869..2329e60e9 100644 --- a/packages/stateless/components/proposal/ProposalModuleSelector.tsx +++ b/packages/stateless/components/proposal/ProposalModuleSelector.tsx @@ -10,7 +10,7 @@ import { } from '@dao-dao/types' import { ContractName } from '@dao-dao/utils' -import { useDaoInfoContext } from '../../hooks' +import { useDaoInfoContext } from '../../contexts' import { SegmentedControls } from '../inputs/SegmentedControls' export type ProposalModuleSelectorProps = { diff --git a/packages/stateless/components/proposal/ProposalVetoConfigurer.tsx b/packages/stateless/components/proposal/ProposalVetoConfigurer.tsx index fd9e52cbe..865649231 100644 --- a/packages/stateless/components/proposal/ProposalVetoConfigurer.tsx +++ b/packages/stateless/components/proposal/ProposalVetoConfigurer.tsx @@ -17,7 +17,7 @@ import { validateRequired, } from '@dao-dao/utils' -import { useChain } from '../../hooks' +import { useChain } from '../../contexts' import { Button } from '../buttons' import { IconButton } from '../icon_buttons' import { diff --git a/packages/stateless/components/proposal/ProposalVoteButton.stories.tsx b/packages/stateless/components/proposal/ProposalVoteButton.stories.tsx index 23f4fbb88..b9e6ad95e 100644 --- a/packages/stateless/components/proposal/ProposalVoteButton.stories.tsx +++ b/packages/stateless/components/proposal/ProposalVoteButton.stories.tsx @@ -22,7 +22,7 @@ Default.args = { option: { Icon: Texture, label: 'Abstain', - value: Vote.Abstain, + value: 'abstain', }, } Default.parameters = { diff --git a/packages/stateless/components/proposal/ProposalVoter.stories.tsx b/packages/stateless/components/proposal/ProposalVoter.stories.tsx index 981c1c0ef..58bf0b17d 100644 --- a/packages/stateless/components/proposal/ProposalVoter.stories.tsx +++ b/packages/stateless/components/proposal/ProposalVoter.stories.tsx @@ -20,12 +20,12 @@ const Template: ComponentStory> = (args) => ( export const Default = Template.bind({}) Default.args = { loading: false, - currentVote: VoteType.Yes, + currentVote: 'yes', onCastVote: (vote) => alert('vote: ' + vote), options: [ - { Icon: Check, label: 'Yes', value: VoteType.Yes }, - { Icon: CloseIcon, label: 'No', value: VoteType.No }, - { Icon: Texture, label: 'Abstain', value: VoteType.Abstain }, + { Icon: Check, label: 'Yes', value: 'yes' }, + { Icon: CloseIcon, label: 'No', value: 'no' }, + { Icon: Texture, label: 'Abstain', value: 'abstain' }, ], proposalOpen: true, } diff --git a/packages/stateless/components/proposal/ProposalVotes.stories.tsx b/packages/stateless/components/proposal/ProposalVotes.stories.tsx index a41758eba..2e3268296 100644 --- a/packages/stateless/components/proposal/ProposalVotes.stories.tsx +++ b/packages/stateless/components/proposal/ProposalVotes.stories.tsx @@ -30,7 +30,7 @@ export const makeProps = (): ProposalVotesProps => ({ data: [...Array(10)].map(() => ({ voterAddress: 'juno123ihuprfiuosdjfiu98349fi0ewjgui', // 25% chance of No, 75% chance of Yes - vote: Math.random() < 0.25 ? Vote.No : Vote.Yes, + vote: Math.random() < 0.25 ? 'no' : 'yes', votingPowerPercent: 0.0432, // Within the past 5 days. votedAt: new Date(Date.now() - Math.random() * 5 * 24 * 60 * 60 * 1000), diff --git a/packages/stateless/components/proposal/ProposalWalletVote.stories.tsx b/packages/stateless/components/proposal/ProposalWalletVote.stories.tsx index f00f2190f..aa96833a1 100644 --- a/packages/stateless/components/proposal/ProposalWalletVote.stories.tsx +++ b/packages/stateless/components/proposal/ProposalWalletVote.stories.tsx @@ -1,7 +1,6 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' import { ProposalWalletVoteClassNameMap } from '@dao-dao/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalWalletVote' -import { Vote } from '@dao-dao/types/contracts/DaoProposalSingle.common' import { ProposalWalletVote } from './ProposalWalletVote' @@ -30,7 +29,7 @@ Pending.parameters = { export const Yes = Template.bind({}) Yes.args = { - className: ProposalWalletVoteClassNameMap[Vote.Yes], + className: ProposalWalletVoteClassNameMap.yes, label: 'Yes', showBadge: false, } @@ -38,7 +37,7 @@ Yes.parameters = Pending.parameters export const No = Template.bind({}) No.args = { - className: ProposalWalletVoteClassNameMap[Vote.No], + className: ProposalWalletVoteClassNameMap.no, label: 'No', showBadge: false, } @@ -46,7 +45,7 @@ No.parameters = Pending.parameters export const Abstain = Template.bind({}) Abstain.args = { - className: ProposalWalletVoteClassNameMap[Vote.Abstain], + className: ProposalWalletVoteClassNameMap.abstain, label: 'Abstain', showBadge: false, } diff --git a/packages/stateless/components/token/TokenCard.tsx b/packages/stateless/components/token/TokenCard.tsx index 61ce7aa70..5e8628a75 100644 --- a/packages/stateless/components/token/TokenCard.tsx +++ b/packages/stateless/components/token/TokenCard.tsx @@ -18,7 +18,8 @@ import { toAccessibleImageUrl, } from '@dao-dao/utils' -import { useAddToken, useDaoInfoContextIfAvailable } from '../../hooks' +import { useDaoInfoContextIfAvailable } from '../../contexts' +import { useAddToken } from '../../hooks' import { Button } from '../buttons/Button' import { CopyToClipboard } from '../CopyToClipboard' import { CrownIcon } from '../icons/CrownIcon' diff --git a/packages/stateless/hooks/useChainContext.ts b/packages/stateless/contexts/Chain.ts similarity index 100% rename from packages/stateless/hooks/useChainContext.ts rename to packages/stateless/contexts/Chain.ts diff --git a/packages/stateless/contexts/Dao.ts b/packages/stateless/contexts/Dao.ts new file mode 100644 index 000000000..d77a8e19f --- /dev/null +++ b/packages/stateless/contexts/Dao.ts @@ -0,0 +1,26 @@ +import { createContext, useContext } from 'react' + +import { IDaoBase } from '@dao-dao/types/clients' + +export type IDaoContext = { + dao: IDaoBase +} + +export const DaoContext = createContext(null) + +export const useDaoContext = () => { + const context = useContext(DaoContext) + if (!context) { + throw new Error( + 'useDaoContext can only be used in a descendant of DaoContext.Provider.' + ) + } + + return context +} + +export const useDaoContextIfAvailable = () => useContext(DaoContext) + +export const useDaoInfoContext = () => useDaoContext().dao.info +export const useDaoInfoContextIfAvailable = () => + useDaoContextIfAvailable()?.dao.info diff --git a/packages/stateless/contexts/index.ts b/packages/stateless/contexts/index.ts new file mode 100644 index 000000000..b25e3a3c8 --- /dev/null +++ b/packages/stateless/contexts/index.ts @@ -0,0 +1,2 @@ +export * from './Chain' +export * from './Dao' diff --git a/packages/stateless/hooks/index.ts b/packages/stateless/hooks/index.ts index 781d141cf..f58656cb8 100644 --- a/packages/stateless/hooks/index.ts +++ b/packages/stateless/hooks/index.ts @@ -3,8 +3,6 @@ export * from './useAnimationFrame' export * from './useButtonPopupFilter' export * from './useButtonPopupSorter' export * from './useCachedLoadable' -export * from './useChainContext' -export * from './useDaoInfoContext' export * from './useDaoNavHelpers' export * from './useDetectTruncate' export * from './useDetectWrap' @@ -13,7 +11,9 @@ export * from './useGovProposalVoteOptions' export * from './useHoldingKey' export * from './useInfiniteScroll' export * from './useLoadingGovProposalTimestampInfo' +export * from './useLoadingPromise' export * from './useMountedInBrowser' +export * from './useOnScreen' export * from './usePlatform' export * from './useProcessTQ' export * from './useQuerySyncedState' diff --git a/packages/stateless/hooks/useAddToken.ts b/packages/stateless/hooks/useAddToken.ts index 8b5c552ba..5b5e48b96 100644 --- a/packages/stateless/hooks/useAddToken.ts +++ b/packages/stateless/hooks/useAddToken.ts @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next' import { MAINNET, suggestToken } from '@dao-dao/utils' -import { useChain } from './useChainContext' +import { useChain } from '../contexts/Chain' export const useAddToken = () => { const { t } = useTranslation() diff --git a/packages/stateless/hooks/useDaoInfoContext.ts b/packages/stateless/hooks/useDaoInfoContext.ts deleted file mode 100644 index ad2f25345..000000000 --- a/packages/stateless/hooks/useDaoInfoContext.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { createContext, useContext } from 'react' - -import { DaoInfo } from '@dao-dao/types' - -export const DaoInfoContext = createContext(null) - -export const useDaoInfoContext = () => { - const context = useContext(DaoInfoContext) - if (!context) { - throw new Error( - 'useDaoInfoContext can only be used in a descendant of DaoInfoContext.Provider.' - ) - } - - return context -} - -export const useDaoInfoContextIfAvailable = () => useContext(DaoInfoContext) diff --git a/packages/stateless/hooks/useInfiniteScroll.ts b/packages/stateless/hooks/useInfiniteScroll.ts index 28f96cedd..a9515e1f5 100644 --- a/packages/stateless/hooks/useInfiniteScroll.ts +++ b/packages/stateless/hooks/useInfiniteScroll.ts @@ -1,5 +1,6 @@ import { RefCallback, useCallback, useEffect, useState } from 'react' +import { useOnScreen } from './useOnScreen' import { useUpdatingRef } from './useUpdatingRef' export type UseInfiniteScrollOptions = { @@ -54,6 +55,7 @@ export const useInfiniteScroll = ({ (node: HTMLElement | null) => setElement(node), [setElement] ) + const isVisible = useOnScreen(element) // Use _element from options if exists. useEffect(() => { @@ -68,6 +70,7 @@ export const useInfiniteScroll = ({ if ( disabled || !element || + !isVisible || infiniteScrollFactor < 0 || typeof window === 'undefined' ) { @@ -103,7 +106,7 @@ export const useInfiniteScroll = ({ // waiting for them to bubble up. window.addEventListener('scroll', onScroll, true) return () => window.removeEventListener('scroll', onScroll, true) - }, [infiniteScrollFactor, disabled, element, loadMoreRef]) + }, [infiniteScrollFactor, disabled, element, loadMoreRef, isVisible]) return { infiniteScrollRef, diff --git a/packages/stateless/hooks/useLoadingPromise.ts b/packages/stateless/hooks/useLoadingPromise.ts new file mode 100644 index 000000000..be770deba --- /dev/null +++ b/packages/stateless/hooks/useLoadingPromise.ts @@ -0,0 +1,108 @@ +import { useEffect, useMemo, useState } from 'react' + +import { LoadingDataWithError } from '@dao-dao/types' + +import { useUpdatingRef } from './useUpdatingRef' + +export type UseLoadingPromiseOptions = { + /** + * A function that returns the promise to use. If undefined, will be in + * loading state. The function will be memoized and thus not reset on every + * render. Use `deps` if you want the promise to be reloaded when certain + * dependencies change. + */ + promise: (() => Promise | undefined) | undefined + /** + * Additional dependencies that, if changed, will cause the promise function + * to be reloaded. The length of this array must never change, since it is + * spread into a `useMemo` dependency array. + */ + deps?: any[] +} + +/** + * A hook that wraps a Promise and causes re-renders when it changes, returning + * a conveniently-typed object. + */ +export const useLoadingPromise = ({ + promise: _promise, + deps, +}: UseLoadingPromiseOptions): LoadingDataWithError => { + const [state, setState] = useState<{ + status: 'loading' | 'success' | 'error' + value: T | null + error: Error | null + was: 'success' | 'error' | null + }>({ + status: 'loading', + value: null, + error: null, + was: null, + }) + + const promiseRef = useUpdatingRef(_promise) + const promiseIsDefined = !!_promise + + const promise = useMemo( + () => promiseRef.current?.(), + // eslint-disable-next-line react-hooks/exhaustive-deps + [ + // Use memoized ref so it doesn't reset on every render. + promiseRef, + // Update if the promise switches between a function and undefined so that + // the loading state updates immediately. + promiseIsDefined, + // eslint-disable-next-line react-hooks/exhaustive-deps + ...(deps || []), + ] + ) + + // Load promise when it changes. + useEffect(() => { + setState((s) => ({ + ...s, + status: 'loading', + })) + + promise + ?.then((value) => + setState({ + status: 'success', + value, + error: null, + was: 'success', + }) + ) + .catch((error) => + setState({ + status: 'error', + value: null, + error, + was: 'error', + }) + ) + }, [promise]) + + return useMemo( + (): LoadingDataWithError => + state.status === 'success' || state.was === 'success' + ? { + loading: false, + errored: false, + updating: state.status === 'loading', + data: state.value as T, + } + : state.status === 'error' || state.was === 'error' + ? { + loading: false, + errored: true, + updating: state.status === 'loading', + error: state.error as Error, + } + : { + loading: true, + errored: false, + }, + [state] + ) +} diff --git a/packages/stateless/hooks/useOnScreen.ts b/packages/stateless/hooks/useOnScreen.ts new file mode 100644 index 000000000..4267378c3 --- /dev/null +++ b/packages/stateless/hooks/useOnScreen.ts @@ -0,0 +1,25 @@ +import { useEffect, useState } from 'react' + +/** + * A hook that returns whether or not the given element is currently on screen. + * + * Inspired by https://stackoverflow.com/a/67826055 + */ +export const useOnScreen = (element: HTMLElement | null) => { + const [isOnScreen, setIsOnScreen] = useState(false) + const [observer] = useState( + () => + new IntersectionObserver(([entry]) => setIsOnScreen(entry.isIntersecting)) + ) + + useEffect(() => { + if (!element) { + return + } + + observer.observe(element) + return () => observer.disconnect() + }, [observer, element]) + + return isOnScreen +} diff --git a/packages/stateless/index.tsx b/packages/stateless/index.ts similarity index 78% rename from packages/stateless/index.tsx rename to packages/stateless/index.ts index ad7177170..934e504dd 100644 --- a/packages/stateless/index.tsx +++ b/packages/stateless/index.ts @@ -1,4 +1,5 @@ export * from './components' +export * from './contexts' export * from './hooks' export * from './pages' export * from './theme' diff --git a/packages/stateless/pages/DaoDappTabbedHome.tsx b/packages/stateless/pages/DaoDappTabbedHome.tsx index 7ad21b026..195de9f7d 100644 --- a/packages/stateless/pages/DaoDappTabbedHome.tsx +++ b/packages/stateless/pages/DaoDappTabbedHome.tsx @@ -9,7 +9,8 @@ import { import { PageLoader, TabBar } from '../components' import { DaoSplashHeader } from '../components/dao/DaoSplashHeader' -import { useDaoInfoContext, useTabBarScrollReset } from '../hooks' +import { useDaoInfoContext } from '../contexts' +import { useTabBarScrollReset } from '../hooks' export const DaoDappTabbedHome = ({ SuspenseLoader, diff --git a/packages/stateless/pages/Home.tsx b/packages/stateless/pages/Home.tsx index bc65d45b4..da708694d 100644 --- a/packages/stateless/pages/Home.tsx +++ b/packages/stateless/pages/Home.tsx @@ -88,22 +88,22 @@ export const Home = ({ { Icon: Public, label: t('title.daos'), - value: stats[statsMode].daos.toLocaleString(), + value: stats[statsMode]?.daos.toLocaleString() ?? 'N/A', }, { Icon: DescriptionOutlined, label: t('title.proposals'), - value: stats[statsMode].proposals.toLocaleString(), + value: stats[statsMode]?.proposals.toLocaleString() ?? 'N/A', }, { Icon: HowToVote, label: t('title.votesCast'), - value: stats[statsMode].votes.toLocaleString(), + value: stats[statsMode]?.votes.toLocaleString() ?? 'N/A', }, { Icon: PeopleOutlined, label: t('title.uniqueVoters'), - value: stats[statsMode].uniqueVoters.toLocaleString(), + value: stats[statsMode]?.uniqueVoters.toLocaleString() ?? 'N/A', }, // Only show TVL and chain count when all is selected. ...(statsMode === 'all' @@ -113,11 +113,13 @@ export const Home = ({ label: t('title.tvl'), tooltip: t('info.estimatedTreasuryUsdValueTooltip'), value: - '$' + - stats.tvl.toLocaleString(undefined, { - minimumFractionDigits: 2, - maximumFractionDigits: 2, - }), + stats.tvl !== null + ? '$' + + stats.tvl.toLocaleString(undefined, { + minimumFractionDigits: 2, + maximumFractionDigits: 2, + }) + : 'N/A', }, // Only show the chain count if more than 1 (i.e. not on a // chain-specific home page). diff --git a/packages/stateless/pages/ProfileHome.tsx b/packages/stateless/pages/ProfileHome.tsx index 58e3c8d42..1188841c6 100644 --- a/packages/stateless/pages/ProfileHome.tsx +++ b/packages/stateless/pages/ProfileHome.tsx @@ -18,7 +18,8 @@ import { } from '@dao-dao/utils' import { Loader, TabBar, WalletProfileHeader } from '../components' -import { useChain, useTabBarScrollReset } from '../hooks' +import { useChain } from '../contexts' +import { useTabBarScrollReset } from '../hooks' export type ProfileHomeProps = { tabs: AccountTab[] diff --git a/packages/storybook/.storybook/preview.js b/packages/storybook/.storybook/preview.js index a19a53baf..9fc11f188 100644 --- a/packages/storybook/.storybook/preview.js +++ b/packages/storybook/.storybook/preview.js @@ -6,7 +6,7 @@ import i18n from './i18next' import { ChainDecorator, NotificationsDecorator, - RecoilDecorator, + StateDecorator, ThemeDecorator, makeAppContextDecorator, } from '../decorators' @@ -55,7 +55,7 @@ export const parameters = { export const decorators = [ ChainDecorator, ThemeDecorator, - RecoilDecorator, + StateDecorator, NotificationsDecorator, makeAppContextDecorator(), ] diff --git a/packages/storybook/decorators/DaoPageWrapperDecorator.tsx b/packages/storybook/decorators/DaoPageWrapperDecorator.tsx index 85778c21d..98ca9bf04 100644 --- a/packages/storybook/decorators/DaoPageWrapperDecorator.tsx +++ b/packages/storybook/decorators/DaoPageWrapperDecorator.tsx @@ -18,7 +18,10 @@ export const makeDaoInfo = (): DaoInfo => ({ coreVersion: ContractVersion.V2Alpha, supportedFeatures: getSupportedFeatures(ContractVersion.V2Alpha), votingModuleAddress: 'votingModuleAddress', - votingModuleContractName: 'crates.io:dao-voting-cw20-staked', + votingModuleInfo: { + contract: 'crates.io:dao-voting-cw20-staked', + version: ContractVersion.V2Alpha, + }, proposalModules: [ { type: ProposalModuleType.Single, @@ -31,6 +34,11 @@ export const makeDaoInfo = (): DaoInfo => ({ version: ContractVersion.V2Alpha, address: 'preProposeModuleAddress', type: PreProposeModuleType.Other, + submissionPolicy: { + specific: { + dao_members: true, + }, + }, }, config: { veto: null, diff --git a/packages/storybook/decorators/RecoilDecorator.tsx b/packages/storybook/decorators/RecoilDecorator.tsx deleted file mode 100644 index 2a59de5e7..000000000 --- a/packages/storybook/decorators/RecoilDecorator.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { DecoratorFn } from '@storybook/react' -import { RecoilRoot } from 'recoil' - -import { mountedInBrowserAtom } from '@dao-dao/state' - -export const RecoilDecorator: DecoratorFn = (Story) => ( - { - set(mountedInBrowserAtom, true) - }} - > - - -) diff --git a/packages/storybook/decorators/StateDecorator.tsx b/packages/storybook/decorators/StateDecorator.tsx new file mode 100644 index 000000000..4d772031c --- /dev/null +++ b/packages/storybook/decorators/StateDecorator.tsx @@ -0,0 +1,14 @@ +import { DecoratorFn } from '@storybook/react' + +import { mountedInBrowserAtom } from '@dao-dao/state' +import { StateProvider } from '@dao-dao/stateful' + +export const StateDecorator: DecoratorFn = (Story) => ( + { + set(mountedInBrowserAtom, true) + }} + > + + +) diff --git a/packages/storybook/decorators/index.tsx b/packages/storybook/decorators/index.tsx index e5144aeff..4845690e0 100644 --- a/packages/storybook/decorators/index.tsx +++ b/packages/storybook/decorators/index.tsx @@ -8,7 +8,7 @@ export * from './makeProposalModuleAdapterDecorator' export * from './makeSdaLayoutDecorator' export * from './NotificationsDecorator' export * from './ReactHookFormDecorator' -export * from './RecoilDecorator' +export * from './StateDecorator' export * from './ThemeDecorator' export * from './WalletActionsProviderDecorator' export * from './WalletProviderDecorator' diff --git a/packages/storybook/decorators/makeDaoProvidersDecorator.tsx b/packages/storybook/decorators/makeDaoProvidersDecorator.tsx index 7c235e726..4b7556fb7 100644 --- a/packages/storybook/decorators/makeDaoProvidersDecorator.tsx +++ b/packages/storybook/decorators/makeDaoProvidersDecorator.tsx @@ -1,12 +1,27 @@ import { DecoratorFn } from '@storybook/react' +import { useQueryClient } from '@tanstack/react-query' +import { useMemo } from 'react' -import { DaoProviders } from '@dao-dao/stateful' +import { DaoProviders, daoQueries } from '@dao-dao/stateful' import { DaoInfo } from '@dao-dao/types' export const makeDaoProvidersDecorator = (info: DaoInfo): DecoratorFn => function DaoActionsProviderDecorator(Story) { + const queryClient = useQueryClient() + // Store provided info in query cache so the DAO client in the provider is + // initialized immediately and doesn't try to fetch it. + useMemo(() => { + queryClient.setQueryData( + daoQueries.info(queryClient, { + chainId: info.chainId, + coreAddress: info.coreAddress, + }).queryKey, + info + ) + }, [queryClient]) + return ( - + ) diff --git a/packages/storybook/decorators/makeProposalModuleAdapterDecorator.tsx b/packages/storybook/decorators/makeProposalModuleAdapterDecorator.tsx index c48f9a574..91833d7c4 100644 --- a/packages/storybook/decorators/makeProposalModuleAdapterDecorator.tsx +++ b/packages/storybook/decorators/makeProposalModuleAdapterDecorator.tsx @@ -1,20 +1,13 @@ import { DecoratorFn } from '@storybook/react' import { ProposalModuleAdapterProvider } from '@dao-dao/stateful/proposal-module-adapter' -import { useDaoInfoContext } from '@dao-dao/stateless' export const makeProposalModuleAdapterDecorator: ( proposalId: string ) => DecoratorFn = (proposalId) => function ProposalModuleAdapterDecorator(Story) { - const { coreAddress, proposalModules } = useDaoInfoContext() - return ( - + ) diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 1e2e472ce..650877d8d 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -21,6 +21,7 @@ "@storybook/react": "^6.5.12", "@tailwindcss/line-clamp": "^0.3.1", "@tailwindcss/typography": "^0.5.1", + "@tanstack/react-query": "^5.40.0", "autoprefixer": "^9.8.6", "clsx": "^1.1.1", "eslint": "^8.23.1", diff --git a/packages/types/actions.ts b/packages/types/actions.ts index ba55f6ed6..0952486a9 100644 --- a/packages/types/actions.ts +++ b/packages/types/actions.ts @@ -9,8 +9,8 @@ import { IChainContext, SupportedChainContext, } from './chain' -import { CosmosMsgFor_Empty } from './contracts/common' -import { DaoInfo } from './dao' +import { IDaoBase } from './clients' +import { UnifiedCosmosMsg } from './contracts/common' import { AllGovParams } from './gov' import { PfpkProfile } from './profile' @@ -149,7 +149,7 @@ export type UseDefaults = () => D | Error | undefined export type UseTransformToCosmos = () => ( data: D -) => CosmosMsgFor_Empty | undefined +) => UnifiedCosmosMsg | undefined export interface DecodeCosmosMsgNoMatch { match: false @@ -201,7 +201,7 @@ export interface Action { order?: number // Hook to get default fields for form display. useDefaults: UseDefaults - // Hook to make function to convert action data to CosmosMsgFor_Empty. + // Hook to make function to convert action data to UnifiedCosmosMsg. useTransformToCosmos: UseTransformToCosmos // Hook to make function to convert decoded msg to form display fields. useDecodedCosmosMsg: UseDecodedCosmosMsg @@ -239,7 +239,7 @@ export enum ActionContextType { export type ActionContext = | { type: ActionContextType.Dao - info: DaoInfo + dao: IDaoBase } | { type: ActionContextType.Wallet @@ -330,7 +330,7 @@ export type LoadedAction = { export type LoadedActions = Partial> export type NestedActionsEditorFormData = { - msgs: CosmosMsgFor_Empty[] + msgs: UnifiedCosmosMsg[] // Internal action data so that errors are added to main form. _actionData?: ActionKeyAndData[] diff --git a/packages/types/chain.ts b/packages/types/chain.ts index 65fb9d779..19f0047f4 100644 --- a/packages/types/chain.ts +++ b/packages/types/chain.ts @@ -79,6 +79,8 @@ export enum ChainId { BitsongMainnet = 'bitsong-2b', BitsongTestnet = 'bobnet', OmniflixHubMainnet = 'omniflixhub-1', + SecretMainnet = 'secret-4', + SecretTestnet = 'pulsar-3', } export type BaseChainConfig = { @@ -145,10 +147,18 @@ export type SupportedChainConfig = BaseChainConfig & { */ network: string } + /** + * Version of the code IDs in the config below. + */ + codeIdsVersion: ContractVersion /** * Code IDs stored on this chain that are used throughout the UI. */ codeIds: CodeIdConfig + /** + * Code hashes for IDs above. Only used by Secret Network. + */ + codeHashes?: CodeHashConfig /** * Whether or not to create DAOs with CW20s. The alternative is to use token * factory native tokens. Defaults to false. @@ -225,6 +235,9 @@ export type CodeIdConfig = { DaoVotingCw721Staked: number DaoVotingTokenStaked: number + // For Secret Network + QueryAuth?: number + // For migrating Migaloo DAOs from cosmwasm to osmosis x/tokenfactory. CwTokenfactoryIssuerCosmWasm?: number @@ -234,6 +247,10 @@ export type CodeIdConfig = { DaoVotingCw20Staked?: number } +export type CodeHashConfig = { + [K in keyof CodeIdConfig]: string +} + export type PolytoneConnection = { // Contract address of note on the local/current chain. note: string diff --git a/packages/types/clients/dao.ts b/packages/types/clients/dao.ts new file mode 100644 index 000000000..7a8231513 --- /dev/null +++ b/packages/types/clients/dao.ts @@ -0,0 +1,143 @@ +import { Chain } from '@chain-registry/types' +import { FetchQueryOptions } from '@tanstack/react-query' + +import { Account } from '../account' +import { DaoCardLazyData } from '../components' +import { + TotalPowerAtHeightResponse, + VotingPowerAtHeightResponse, +} from '../contracts/DaoDaoCore' +import { DaoInfo, DaoSource } from '../dao' +import { ContractVersion } from '../features' +import { AmountWithTimestamp } from '../token' +import { IProposalModuleBase } from './proposal-module' +import { IVotingModuleBase } from './voting-module' + +export interface IDaoBase { + /** + * DAO info object. + */ + info: DaoInfo + + /** + * Chain ID of the DAO. + */ + chainId: string + + /** + * Chain of the DAO. + */ + chain: Chain + + /** + * Core address of the DAO. + */ + coreAddress: string + + /** + * DAO source object. + */ + source: DaoSource + + /** + * Core contract version. + */ + coreVersion: ContractVersion + + /** + * Voting module for the DAO. + */ + votingModule: IVotingModuleBase + + /** + * Proposal modules for the DAO. + */ + proposalModules: readonly IProposalModuleBase[] + + /** + * DAO-controlled accounts. + */ + accounts: readonly Account[] + + /** + * DAO name. + */ + name: string + + /** + * DAO description. + */ + description: string + + /** + * DAO image URL. + */ + imageUrl: string + + /** + * Whether or not the client has been initialized. This only matters for some + * functions, depending on the implementation. + */ + initialized: boolean + + /** + * Initialize the client. This only matters for some functions, depending on + * the implementation. + */ + init(): Promise + + /** + * Get the proposal module with the given address. + */ + getProposalModule(address: string): IProposalModuleBase | undefined + + /** + * Query options to fetch the voting power for a given address. Optionally + * specify a block height. If undefined, the latest block height will be used. + * If address is undefined, will return query in loading state. + */ + getVotingPowerQuery( + address?: string, + height?: number + ): FetchQueryOptions + + /** + * Fetch the voting power for a given address. Optionally specify a block + * height. If undefined, the latest block height will be used. + */ + getVotingPower(address: string, height?: number): Promise + + /** + * Query options to fetch the total voting power. Optionally specify a block + * height. If undefined, the latest block height will be used. + */ + getTotalVotingPowerQuery( + height?: number + ): FetchQueryOptions + + /** + * Fetch the total voting power. Optional specify a block height. If + * undefined, the latest block height will be used. + */ + getTotalVotingPower(height?: number): Promise + + /** + * Fetch the lazy data for the DAO card. + */ + getDaoCardLazyData(): Promise + + /** + * Fetch the number of proposals in the DAO. + */ + getProposalCount(): Promise + + /** + * Query options to fetch the TVL. + */ + tvlQuery: FetchQueryOptions + + /** + * Fetch the TVL. + */ + getTvl(): Promise +} diff --git a/packages/types/clients/index.ts b/packages/types/clients/index.ts new file mode 100644 index 000000000..cb2b75f7c --- /dev/null +++ b/packages/types/clients/index.ts @@ -0,0 +1,4 @@ +export * from './dao' +export * from './proposal-module' +export * from './types' +export * from './voting-module' diff --git a/packages/types/clients/proposal-module.ts b/packages/types/clients/proposal-module.ts new file mode 100644 index 000000000..14203b67f --- /dev/null +++ b/packages/types/clients/proposal-module.ts @@ -0,0 +1,120 @@ +import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate' +import { FetchQueryOptions } from '@tanstack/react-query' + +import { Coin } from '../contracts/common' +import { PreProposeModule, ProposalModule } from '../dao' +import { ContractVersion } from '../features' +import { IDaoBase } from './dao' + +export interface IProposalModuleBase< + Dao extends IDaoBase = IDaoBase, + Proposal = any, + VoteResponse = any, + VoteInfo = any, + Vote = any +> { + /** + * DAO this module belongs to. + */ + dao: Dao + + /** + * Proposal module info. + */ + info: ProposalModule + + /** + * Contract address. + */ + address: string + + /** + * Contract version. + */ + version: ContractVersion + + /** + * Contract name. + */ + contractName: string + + /** + * Proposal module prefix in the DAO. + */ + prefix: string + + /** + * Pre-propose module, or null if none. + */ + prePropose: PreProposeModule | null + + /** + * Make a proposal. + */ + propose(options: { + data: Proposal + getSigningClient: () => Promise + sender: string + funds?: Coin[] + }): Promise<{ + proposalNumber: number + proposalId: string + }> + + /** + * Vote on a proposal. + */ + vote(options: { + proposalId: number + vote: Vote + getSigningClient: () => Promise + sender: string + }): Promise + + /** + * Execute a passed proposal. + */ + execute(options: { + proposalId: number + getSigningClient: () => Promise + sender: string + memo?: string + }): Promise + + /** + * Close a rejected proposal. + */ + close(options: { + proposalId: number + getSigningClient: () => Promise + sender: string + }): Promise + + /** + * Query options to fetch the vote on a proposal by a given address. If voter + * is undefined, will return query in loading state. + */ + getVoteQuery(options: { + proposalId: number + voter: string | undefined + }): FetchQueryOptions + + /** + * Fetch the vote on a proposal by a given address. If the address has not + * voted, it will return null. + */ + getVote(options: { + proposalId: number + voter: string + }): Promise + + /** + * Query options to fetch the total number of proposals. + */ + getProposalCountQuery(): FetchQueryOptions + + /** + * Fetch the total number of proposals. + */ + getProposalCount(): Promise +} diff --git a/packages/types/clients/types.ts b/packages/types/clients/types.ts new file mode 100644 index 000000000..c48216d16 --- /dev/null +++ b/packages/types/clients/types.ts @@ -0,0 +1,16 @@ +import { Coin } from '../contracts' + +export type { ModuleInstantiateInfo } from '../contracts' +export type { ModuleInstantiateInfo as SecretModuleInstantiateInfo } from '../contracts/SecretDaoDaoCore' + +export type InstantiateInfo = { + admin: string | null + codeId: number + label: string + msg: string + funds: Coin[] +} + +export type SecretInstantiateInfo = InstantiateInfo & { + codeHash: string +} diff --git a/packages/types/clients/voting-module.ts b/packages/types/clients/voting-module.ts new file mode 100644 index 000000000..210f7c713 --- /dev/null +++ b/packages/types/clients/voting-module.ts @@ -0,0 +1,60 @@ +import { FetchQueryOptions } from '@tanstack/react-query' + +import { + TotalPowerAtHeightResponse, + VotingPowerAtHeightResponse, +} from '../contracts/DaoDaoCore' +import { ContractVersion } from '../features' +import { IDaoBase } from './dao' + +export interface IVotingModuleBase { + /** + * DAO this module belongs to. + */ + dao: Dao + + /** + * Address of the voting module. + */ + address: string + + /** + * Contract version. + */ + version: ContractVersion + + /** + * Contract name. + */ + contractName: string + + /** + * Query options to fetch the voting power for a given address. Optionally + * specify a block height. If undefined, the latest block height will be used. + * If address is undefined, will return query in loading state. + */ + getVotingPowerQuery( + address?: string, + height?: number + ): FetchQueryOptions + + /** + * Fetch the voting power for a given address. Optionally specify a block + * height. If undefined, the latest block height will be used. + */ + getVotingPower(address: string, height?: number): Promise + + /** + * Query options to fetch the total voting power. Optionally specify a block + * height. If undefined, the latest block height will be used. + */ + getTotalVotingPowerQuery( + height?: number + ): FetchQueryOptions + + /** + * Fetch the total voting power. Optional specify a block height. If + * undefined, the latest block height will be used. + */ + getTotalVotingPower(height?: number): Promise +} diff --git a/packages/types/components/DaoCard.ts b/packages/types/components/DaoCard.ts index a518ff937..d8c4d63f0 100644 --- a/packages/types/components/DaoCard.ts +++ b/packages/types/components/DaoCard.ts @@ -1,12 +1,11 @@ import { ComponentType } from 'react' import { DaoInfo } from '../dao' -import { LoadingData } from '../misc' +import { LoadingDataWithError } from '../misc' import { LinkWrapperProps } from './LinkWrapper' // Loaded by card once displaying. export type DaoCardLazyData = { - isMember: boolean proposalCount: number /** * Show a token line, typically TVL. @@ -26,9 +25,10 @@ export type FollowState = { export type DaoCardProps = { info: DaoInfo - lazyData: LoadingData + lazyData: LoadingDataWithError follow: { hide: true } | ({ hide?: false } & FollowState) LinkWrapper: ComponentType + isMember?: boolean /** * Whether or not to show the member checkmark if they're a member. Defaults * to true. diff --git a/packages/types/components/ProposalLine.ts b/packages/types/components/ProposalLine.ts index 53c103e01..f18844015 100644 --- a/packages/types/components/ProposalLine.ts +++ b/packages/types/components/ProposalLine.ts @@ -1,17 +1,9 @@ -import { ProposalModule } from '../dao' - export type StatefulProposalLineProps = { // This may be shown in the inbox, outside of the context of a DAO or chain. chainId: string coreAddress: string - proposalModules: ProposalModule[] proposalId: string proposalViewUrl: string onClick?: () => void isPreProposeProposal: boolean } - -export type StatefulLazyProposalLineProps = Omit< - StatefulProposalLineProps, - 'proposalModules' | 'proposalViewUrl' -> diff --git a/packages/types/components/SelfRelayExecuteModal.ts b/packages/types/components/SelfRelayExecuteModal.ts index a48ea6773..a48b3f842 100644 --- a/packages/types/components/SelfRelayExecuteModal.ts +++ b/packages/types/components/SelfRelayExecuteModal.ts @@ -1,4 +1,4 @@ -import { CosmosMsgForEmpty } from '../contracts' +import { UnifiedCosmosMsg } from '../contracts' import { CrossChainPacketInfo } from '../proposal' import { ModalProps } from './Modal' @@ -28,7 +28,7 @@ export type SelfRelayTransaction = type: 'execute' // CosmWasm-formatted messages to execute that will create IBC packets // that need self-relaying. - msgs: CosmosMsgForEmpty[] + msgs: UnifiedCosmosMsg[] } | { type: 'exists' diff --git a/packages/types/contracts/Cw20Stake.ts b/packages/types/contracts/Cw20Stake.ts index 30f027f9f..7da5c9acb 100644 --- a/packages/types/contracts/Cw20Stake.ts +++ b/packages/types/contracts/Cw20Stake.ts @@ -120,8 +120,7 @@ export type QueryMsg = } export interface StakedBalanceAtHeightResponse { balance: Uint128 - // Optional because the indexer does not provide this. - height?: number + height: number } export interface StakedValueResponse { value: Uint128 @@ -133,8 +132,7 @@ export interface TokenInfoResponse { total_supply: Uint128 } export interface TotalStakedAtHeightResponse { - // Optional because the indexer does not provide this. - height?: number + height: number total: Uint128 } export interface TotalValueResponse { diff --git a/packages/types/contracts/CwProposalSingle.v1.ts b/packages/types/contracts/CwProposalSingle.v1.ts index d8641cdbe..13a25c395 100644 --- a/packages/types/contracts/CwProposalSingle.v1.ts +++ b/packages/types/contracts/CwProposalSingle.v1.ts @@ -1,19 +1,49 @@ -import { - Addr, - ContractVersionInfo, - CosmosMsgFor_Empty, - Duration, - Expiration, - ProposalStatus, - Uint128, -} from './common' -import { Threshold, Votes } from './DaoProposalSingle.common' +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ +export type Addr = string +export type Uint128 = string +export type Duration = + | { + height: number + } + | { + time: number + } +export type Threshold = + | { + absolute_percentage: { + percentage: PercentageThreshold + } + } + | { + threshold_quorum: { + quorum: PercentageThreshold + threshold: PercentageThreshold + } + } + | { + absolute_count: { + threshold: Uint128 + } + } +export type PercentageThreshold = + | { + majority: {} + } + | { + percent: Decimal + } +export type Decimal = string export interface ConfigResponse { allow_revoting: boolean dao: Addr deposit_info?: CheckedDepositInfo | null max_voting_period: Duration + min_voting_period?: Duration | null only_members_execute: boolean threshold: Threshold } @@ -22,10 +52,199 @@ export interface CheckedDepositInfo { refund_failed_proposals: boolean token: Addr } -export type GovernanceModulesResponse = Addr[] -export interface InfoResponse { - info: ContractVersionInfo +export type ExecuteMsg = + | { + propose: { + description: string + msgs: CosmosMsgForEmpty[] + title: string + } + } + | { + vote: { + proposal_id: number + vote: Vote + } + } + | { + execute: { + proposal_id: number + } + } + | { + close: { + proposal_id: number + } + } + | { + update_config: { + allow_revoting: boolean + dao: string + deposit_info?: DepositInfo | null + max_voting_period: Duration + min_voting_period?: Duration | null + only_members_execute: boolean + threshold: Threshold + } + } + | { + add_proposal_hook: { + address: string + } + } + | { + remove_proposal_hook: { + address: string + } + } + | { + add_vote_hook: { + address: string + } + } + | { + remove_vote_hook: { + address: string + } + } +export type CosmosMsgForEmpty = + | { + bank: BankMsg + } + | { + custom: Empty + } + | { + staking: StakingMsg + } + | { + distribution: DistributionMsg + } + | { + stargate: { + type_url: string + value: Binary + } + } + | { + ibc: IbcMsg + } + | { + wasm: WasmMsg + } + | { + gov: GovMsg + } +export type BankMsg = + | { + send: { + amount: Coin[] + to_address: string + } + } + | { + burn: { + amount: Coin[] + } + } +export type StakingMsg = + | { + delegate: { + amount: Coin + validator: string + } + } + | { + undelegate: { + amount: Coin + validator: string + } + } + | { + redelegate: { + amount: Coin + dst_validator: string + src_validator: string + } + } +export type DistributionMsg = + | { + set_withdraw_address: { + address: string + } + } + | { + withdraw_delegator_reward: { + validator: string + } + } +export type Binary = string +export type IbcMsg = + | { + transfer: { + amount: Coin + channel_id: string + timeout: IbcTimeout + to_address: string + } + } + | { + send_packet: { + channel_id: string + data: Binary + timeout: IbcTimeout + } + } + | { + close_channel: { + channel_id: string + } + } +export type Timestamp = Uint64 +export type Uint64 = string +export type WasmMsg = + | { + execute: { + contract_addr: string + funds: Coin[] + msg: Binary + } + } + | { + instantiate: { + admin?: string | null + code_id: number + funds: Coin[] + label: string + msg: Binary + } + } + | { + migrate: { + contract_addr: string + msg: Binary + new_code_id: number + } + } + | { + update_admin: { + admin: string + contract_addr: string + } + } + | { + clear_admin: { + contract_addr: string + } + } +export type GovMsg = { + vote: { + proposal_id: number + vote: VoteOption + } } +export type VoteOption = 'yes' | 'no' | 'abstain' | 'no_with_veto' +export type Vote = 'yes' | 'no' | 'abstain' export type DepositToken = | { token: { @@ -35,18 +254,51 @@ export type DepositToken = | { voting_module_token: {} } +export interface Coin { + amount: Uint128 + denom: string +} +export interface Empty {} +export interface IbcTimeout { + block?: IbcTimeoutBlock | null + timestamp?: Timestamp | null +} +export interface IbcTimeoutBlock { + height: number + revision: number +} +export interface DepositInfo { + deposit: Uint128 + refund_failed_proposals: boolean + token: DepositToken +} +export type GovernanceModulesResponse = Addr[] +export interface InfoResponse { + info: ContractVersion +} +export interface ContractVersion { + contract: string + version: string +} export interface InstantiateMsg { allow_revoting: boolean deposit_info?: DepositInfo | null max_voting_period: Duration + min_voting_period?: Duration | null only_members_execute: boolean threshold: Threshold } -export interface DepositInfo { - deposit: Uint128 - refund_failed_proposals: boolean - token: DepositToken -} +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export type Status = 'open' | 'rejected' | 'passed' | 'executed' | 'closed' export interface ListProposalsResponse { proposals: ProposalResponse[] } @@ -54,6 +306,9 @@ export interface ProposalResponse { id: number proposal: Proposal // Indexer may return these. + hideFromSearch?: boolean + dao?: string + daoProposalId?: string createdAt?: string completedAt?: string executedAt?: string @@ -64,22 +319,86 @@ export interface Proposal { deposit_info?: CheckedDepositInfo | null description: string expiration: Expiration - msgs: CosmosMsgFor_Empty[] + min_voting_period?: Expiration | null + msgs: CosmosMsgForEmpty[] proposer: Addr start_height: number - status: ProposalStatus + status: Status threshold: Threshold title: string total_power: Uint128 votes: Votes } +export interface Votes { + abstain: Uint128 + no: Uint128 + yes: Uint128 +} +export interface ListVotesResponse { + votes: VoteInfo[] +} +export interface VoteInfo { + power: Uint128 + vote: Vote + voter: Addr +} +export interface MigrateMsg {} export type ProposalCountResponse = number export interface ProposalHooksResponse { hooks: string[] } +export type QueryMsg = + | { + config: {} + } + | { + proposal: { + proposal_id: number + } + } + | { + list_proposals: { + limit?: number | null + start_after?: number | null + } + } + | { + reverse_proposals: { + limit?: number | null + start_before?: number | null + } + } + | { + proposal_count: {} + } + | { + vote: { + proposal_id: number + voter: string + } + } + | { + list_votes: { + limit?: number | null + proposal_id: number + start_after?: string | null + } + } + | { + proposal_hooks: {} + } + | { + vote_hooks: {} + } + | { + info: {} + } export interface ReverseProposalsResponse { proposals: ProposalResponse[] } export interface VoteHooksResponse { hooks: string[] } +export interface VoteResponse { + vote?: VoteInfo | null +} diff --git a/packages/types/contracts/DaoCore.v2.instantiate_schema.json b/packages/types/contracts/DaoCore.v2.instantiate_schema.json deleted file mode 100644 index a560daf15..000000000 --- a/packages/types/contracts/DaoCore.v2.instantiate_schema.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "InstantiateMsg", - "type": "object", - "required": [ - "automatically_add_cw20s", - "automatically_add_cw721s", - "description", - "name", - "proposal_modules_instantiate_info", - "voting_module_instantiate_info" - ], - "properties": { - "admin": { - "description": "Optional Admin with the ability to execute DAO messages directly. Useful for building SubDAOs controlled by a parent DAO. If no admin is specified the contract is set as its own admin so that the admin may be updated later by governance.", - "type": ["string", "null"] - }, - "automatically_add_cw20s": { - "description": "If true the contract will automatically add received cw20 tokens to its treasury.", - "type": "boolean" - }, - "automatically_add_cw721s": { - "description": "If true the contract will automatically add received cw721 tokens to its treasury.", - "type": "boolean" - }, - "dao_uri": { - "description": "Implements the DAO Star standard: ", - "type": ["string", "null"] - }, - "description": { - "description": "A description of the core contract.", - "type": "string" - }, - "image_url": { - "description": "An image URL to describe the core module contract.", - "type": ["string", "null"] - }, - "initial_items": { - "description": "The items to instantiate this DAO with. Items are arbitrary key-value pairs whose contents are controlled by governance.\n\nIt is an error to provide two items with the same key.", - "type": ["array", "null"], - "items": { - "$ref": "#/definitions/InitialItem" - } - }, - "name": { - "description": "The name of the core contract.", - "type": "string" - }, - "proposal_modules_instantiate_info": { - "description": "Instantiate information for the core contract's proposal modules. NOTE: the pre-propose-base package depends on it being the case that the core module instantiates its proposal module.", - "type": "array", - "items": { - "$ref": "#/definitions/ModuleInstantiateInfo" - } - }, - "voting_module_instantiate_info": { - "description": "Instantiate information for the core contract's voting power module.", - "allOf": [ - { - "$ref": "#/definitions/ModuleInstantiateInfo" - } - ] - } - }, - "additionalProperties": false, - "definitions": { - "Admin": { - "description": "Information about the CosmWasm level admin of a contract. Used in conjunction with `ModuleInstantiateInfo` to instantiate modules.", - "oneOf": [ - { - "description": "Set the admin to a specified address.", - "type": "object", - "required": ["address"], - "properties": { - "address": { - "type": "object", - "required": ["addr"], - "properties": { - "addr": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Sets the admin as the core module address.", - "type": "object", - "required": ["core_module"], - "properties": { - "core_module": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "Binary": { - "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", - "type": "string" - }, - "Coin": { - "type": "object", - "required": ["amount", "denom"], - "properties": { - "amount": { - "$ref": "#/definitions/Uint128" - }, - "denom": { - "type": "string" - } - } - }, - "InitialItem": { - "description": "Information about an item to be stored in the items list.", - "type": "object", - "required": ["key", "value"], - "properties": { - "key": { - "description": "The name of the item.", - "type": "string" - }, - "value": { - "description": "The value the item will have at instantiation time.", - "type": "string" - } - }, - "additionalProperties": false - }, - "ModuleInstantiateInfo": { - "description": "Information needed to instantiate a module.", - "type": "object", - "required": ["code_id", "label", "msg"], - "properties": { - "admin": { - "description": "CosmWasm level admin of the instantiated contract. See: ", - "anyOf": [ - { - "$ref": "#/definitions/Admin" - }, - { - "type": "null" - } - ] - }, - "code_id": { - "description": "Code ID of the contract to be instantiated.", - "type": "integer", - "minimum": 0.0 - }, - "funds": { - "description": "Funds to be sent to the instantiated contract.", - "type": "array", - "items": { - "$ref": "#/definitions/Coin" - } - }, - "label": { - "description": "Label for the instantiated contract.", - "type": "string" - }, - "msg": { - "description": "Instantiate message to be used to create the contract.", - "allOf": [ - { - "$ref": "#/definitions/Binary" - } - ] - } - }, - "additionalProperties": false - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - } - } -} diff --git a/packages/types/contracts/DaoCore.v2.ts b/packages/types/contracts/DaoDaoCore.ts similarity index 52% rename from packages/types/contracts/DaoCore.v2.ts rename to packages/types/contracts/DaoDaoCore.ts index 3987805df..527a7ab17 100644 --- a/packages/types/contracts/DaoCore.v2.ts +++ b/packages/types/contracts/DaoDaoCore.ts @@ -1,91 +1,41 @@ -import { - Addr, - Binary, - ContractVersionInfo, - CosmosMsgForEmpty, - Duration, - Expiration, - ModuleInstantiateInfo, - Timestamp, - Uint128, -} from './common' +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ -// v2 changed case. -export type ProposalModuleStatus = - | 'enabled' - | 'Enabled' - | 'disabled' - | 'Disabled' -export type ActiveProposalModulesResponse = ProposalModule[] -export interface ProposalModule { - address: Addr - prefix: string - status: ProposalModuleStatus -} -export interface AdminNominationResponse { - nomination?: Addr | null -} -export type AdminResponse = Addr | null -export interface ConfigResponse { - automatically_add_cw20s: boolean - automatically_add_cw721s: boolean - dao_uri?: string | null - description: string - image_url?: string | null - name: string -} -export interface Cw20BalanceResponse { - addr: Addr - balance: Uint128 -} -export type Cw20BalancesResponse = Cw20BalanceResponse[] -export type Cw20TokenListResponse = Addr[] -export type Cw721TokenListResponse = Addr[] -export type DaoURIResponse = string | null -// v2 changed case. -export type PauseInfoResponse = - | { - Paused: { - expiration: Expiration - } - } - | { - paused: { - expiration: Expiration - } - } - // Neutron SubDAOs: - // https://github.com/neutron-org/neutron-dao/blob/v0.5.0/packages/exec-control/src/pause.rs#L56-L62 +import { ContractVersionInfo, ModuleInstantiateInfo } from './common' + +export type Admin = | { - Paused: { - until_height: number + address: { + addr: string } } | { - Unpaused: {} + core_module: {} } - | { - unpaused: {} - } -export interface DumpStateResponse { - active_proposal_module_count: number - // Neutron DAO returns undefined admin. - admin: Addr | undefined - config: Config - created_timestamp?: Timestamp | null - pause_info: PauseInfoResponse - proposal_modules: ProposalModule[] - total_proposal_module_count: number - version: ContractVersionInfo - voting_module: Addr -} -export interface Config { +export type Uint128 = string +export type Binary = string +export interface InstantiateMsg { + admin?: string | null automatically_add_cw20s: boolean automatically_add_cw721s: boolean dao_uri?: string | null description: string image_url?: string | null + initial_items?: InitialItem[] | null name: string + proposal_modules_instantiate_info: ModuleInstantiateInfo[] + voting_module_instantiate_info: ModuleInstantiateInfo +} +export interface InitialItem { + key: string + value: string +} +export interface Coin { + amount: Uint128 + denom: string } export type ExecuteMsg = | { @@ -103,6 +53,9 @@ export type ExecuteMsg = duration: Duration } } + | { + unpause: {} + } | { receive: Cw20ReceiveMsg } @@ -116,8 +69,8 @@ export type ExecuteMsg = } | { set_item: { - addr: string key: string + value: string } } | { @@ -165,6 +118,158 @@ export type ExecuteMsg = to_remove: string[] } } +export type CosmosMsgForEmpty = + | { + bank: BankMsg + } + | { + custom: Empty + } + | { + staking: StakingMsg + } + | { + distribution: DistributionMsg + } + | { + stargate: { + type_url: string + value: Binary + } + } + | { + ibc: IbcMsg + } + | { + wasm: WasmMsg + } + | { + gov: GovMsg + } +export type BankMsg = + | { + send: { + amount: Coin[] + to_address: string + } + } + | { + burn: { + amount: Coin[] + } + } +export type StakingMsg = + | { + delegate: { + amount: Coin + validator: string + } + } + | { + undelegate: { + amount: Coin + validator: string + } + } + | { + redelegate: { + amount: Coin + dst_validator: string + src_validator: string + } + } +export type DistributionMsg = + | { + set_withdraw_address: { + address: string + } + } + | { + withdraw_delegator_reward: { + validator: string + } + } +export type IbcMsg = + | { + transfer: { + amount: Coin + channel_id: string + timeout: IbcTimeout + to_address: string + } + } + | { + send_packet: { + channel_id: string + data: Binary + timeout: IbcTimeout + } + } + | { + close_channel: { + channel_id: string + } + } +export type Timestamp = Uint64 +export type Uint64 = string +export type WasmMsg = + | { + execute: { + contract_addr: string + funds: Coin[] + msg: Binary + } + } + | { + instantiate: { + admin?: string | null + code_id: number + funds: Coin[] + label: string + msg: Binary + } + } + | { + migrate: { + contract_addr: string + msg: Binary + new_code_id: number + } + } + | { + update_admin: { + admin: string + contract_addr: string + } + } + | { + clear_admin: { + contract_addr: string + } + } +export type GovMsg = { + vote: { + proposal_id: number + vote: VoteOption + } +} +export type VoteOption = 'yes' | 'no' | 'abstain' | 'no_with_veto' +export type Duration = + | { + height: number + } + | { + time: number + } +export interface Empty {} +export interface IbcTimeout { + block?: IbcTimeoutBlock | null + timestamp?: Timestamp | null +} +export interface IbcTimeoutBlock { + height: number + revision: number +} export interface Cw20ReceiveMsg { amount: Uint128 msg: Binary @@ -175,44 +280,18 @@ export interface Cw721ReceiveMsg { sender: string token_id: string } -export interface SubDao { - addr: string - charter?: string | null -} -export interface GetItemResponse { - item?: string | null -} -export interface InfoResponse { - info: ContractVersionInfo -} -export interface InstantiateMsg { - admin?: string | null +export interface Config { automatically_add_cw20s: boolean automatically_add_cw721s: boolean dao_uri?: string | null description: string image_url?: string | null - initial_items?: InitialItem[] | null name: string - proposal_modules_instantiate_info: ModuleInstantiateInfo[] - voting_module_instantiate_info: ModuleInstantiateInfo } -export interface InitialItem { - key: string - value: string +export interface SubDao { + addr: string + charter?: string | null } -export type ListItemsResponse = [string, string][] -export type ListSubDaosResponse = SubDao[] -export type MigrateMsg = - | { - from_v1: { - dao_uri?: string | null - } - } - | { - from_compatible: {} - } -export type ProposalModulesResponse = ProposalModule[] export type QueryMsg = | { admin: {} @@ -255,6 +334,9 @@ export type QueryMsg = start_after?: string | null } } + | { + info: {} + } | { proposal_modules: { limit?: number | null @@ -267,6 +349,9 @@ export type QueryMsg = start_after?: string | null } } + | { + proposal_module_count: {} + } | { pause_info: {} } @@ -293,21 +378,155 @@ export type QueryMsg = height?: number | null } } +export type MigrateMsg = | { - info: {} + from_v1: { + dao_uri?: string | null + params?: MigrateParams | null + } + } + | { + from_compatible: {} + } +export type PreProposeInfo = + | { + anyone_may_propose: {} + } + | { + module_may_propose: { + info: ModuleInstantiateInfo + } + } +export interface MigrateParams { + migrator_code_id: number + params: MigrateV1ToV2 +} +export interface MigrateV1ToV2 { + migration_params: MigrationModuleParams + sub_daos: SubDao[] + v1_code_ids: V1CodeIds + v2_code_ids: V2CodeIds +} +export interface MigrationModuleParams { + migrate_stake_cw20_manager?: boolean | null + proposal_params: [string, ProposalParams][] +} +export interface ProposalParams { + close_proposal_on_execution_failure: boolean + pre_propose_info: PreProposeInfo +} +export interface V1CodeIds { + cw20_stake: number + cw20_staked_balances_voting: number + cw4_voting: number + proposal_single: number +} +export interface V2CodeIds { + cw20_stake: number + cw20_staked_balances_voting: number + cw4_voting: number + proposal_single: number +} +export type Addr = string +export type ProposalModuleStatus = + // v2-beta uppercase + | 'Enabled' + | 'Disabled' + // v2 + | 'enabled' + | 'disabled' +export type ArrayOfProposalModule = ProposalModule[] +export interface ProposalModule { + address: Addr + prefix: string + status: ProposalModuleStatus +} +export interface AdminNominationResponse { + nomination?: Addr | null +} +export interface Cw20BalanceResponse { + addr: Addr + balance: Uint128 +} +export type Cw20BalancesResponse = Cw20BalanceResponse[] +export type ArrayOfAddr = Addr[] +export interface DaoURIResponse { + dao_uri?: string | null +} +export type PauseInfoResponse = + // v2-beta + | { + Paused: { + expiration: Expiration + } } + | { + Unpaused: {} + } + // v2 + | { + paused: { + expiration: Expiration + } + } + | { + unpaused: {} + } + // Neutron SubDAOs: + // https://github.com/neutron-org/neutron-dao/blob/v0.5.0/packages/exec-control/src/pause.rs#L56-L62 + | { + Paused: { + until_height: number + } + } +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export interface DumpStateResponse { + active_proposal_module_count: number + // Neutron DAO returns undefined admin. + admin: Addr | undefined + config: Config + pause_info: PauseInfoResponse + proposal_modules: ProposalModule[] + total_proposal_module_count: number + version: ContractVersion + voting_module: Addr +} +export interface ContractVersion { + contract: string + version: string +} +export interface GetItemResponse { + item?: string | null +} +export interface InfoResponse { + info: ContractVersion +} +export type ListItemsResponse = [string, string][] +export type ArrayOfSubDao = SubDao[] +export interface ProposalModuleCountResponse { + active_proposal_module_count: number + total_proposal_module_count: number +} export interface TotalPowerAtHeightResponse { - // Optional because the indexer does not provide this. - height?: number + height: number power: Uint128 } -export type VotingModuleResponse = string export interface VotingPowerAtHeightResponse { - // Optional because the indexer does not provide this. - height?: number + height: number power: Uint128 } +// Custom + export type ProposalModuleWithInfo = ProposalModule & { info?: ContractVersionInfo } diff --git a/packages/types/contracts/DaoPreProposeApprovalSingle.ts b/packages/types/contracts/DaoPreProposeApprovalSingle.ts index 2bae2b694..6b47874ca 100644 --- a/packages/types/contracts/DaoPreProposeApprovalSingle.ts +++ b/packages/types/contracts/DaoPreProposeApprovalSingle.ts @@ -1,5 +1,10 @@ -import { Addr, CosmosMsgForEmpty, Uint128 } from './common' +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ +export type Uint128 = string export type DepositToken = | { token: { @@ -7,7 +12,9 @@ export type DepositToken = } } | { - voting_module_token: {} + voting_module_token: { + token_type: VotingModuleTokenType + } } export type UncheckedDenom = | { @@ -16,11 +23,32 @@ export type UncheckedDenom = | { cw20: string } +export type VotingModuleTokenType = 'native' | 'cw20' export type DepositRefundPolicy = 'always' | 'only_passed' | 'never' +export type PreProposeSubmissionPolicy = + | { + anyone: { + denylist?: string[] | null + } + } + | { + specific: { + allowlist?: string[] | null + dao_members: boolean + denylist?: string[] | null + } + } export interface InstantiateMsg { deposit_info?: UncheckedDepositInfo | null extension: InstantiateExt - open_proposal_submission: boolean + /** + * < v2.5.0 + */ + open_proposal_submission?: boolean + /** + * >= v2.5.0 + */ + submission_policy?: PreProposeSubmissionPolicy } export interface UncheckedDepositInfo { amount: Uint128 @@ -39,7 +67,23 @@ export type ExecuteMsg = | { update_config: { deposit_info?: UncheckedDepositInfo | null - open_proposal_submission: boolean + /** + * < v2.5.0 + */ + open_proposal_submission?: boolean + /** + * >= v2.5.0 + */ + submission_policy?: PreProposeSubmissionPolicy | null + } + } + | { + update_submission_policy: { + allowlist_add?: string[] | null + allowlist_remove?: string[] | null + denylist_add?: string[] | null + denylist_remove?: string[] | null + set_dao_members?: boolean | null } } | { @@ -73,8 +117,147 @@ export type ProposeMessage = { description: string msgs: CosmosMsgForEmpty[] title: string + vote?: SingleChoiceAutoVote | null } } +export type CosmosMsgForEmpty = + | { + bank: BankMsg + } + | { + custom: Empty + } + | { + staking: StakingMsg + } + | { + distribution: DistributionMsg + } + | { + stargate: { + type_url: string + value: Binary + } + } + | { + ibc: IbcMsg + } + | { + wasm: WasmMsg + } + | { + gov: GovMsg + } +export type BankMsg = + | { + send: { + amount: Coin[] + to_address: string + } + } + | { + burn: { + amount: Coin[] + } + } +export type StakingMsg = + | { + delegate: { + amount: Coin + validator: string + } + } + | { + undelegate: { + amount: Coin + validator: string + } + } + | { + redelegate: { + amount: Coin + dst_validator: string + src_validator: string + } + } +export type DistributionMsg = + | { + set_withdraw_address: { + address: string + } + } + | { + withdraw_delegator_reward: { + validator: string + } + } +export type Binary = string +export type IbcMsg = + | { + transfer: { + amount: Coin + channel_id: string + timeout: IbcTimeout + to_address: string + } + } + | { + send_packet: { + channel_id: string + data: Binary + timeout: IbcTimeout + } + } + | { + close_channel: { + channel_id: string + } + } +export type Timestamp = Uint64 +export type Uint64 = string +export type WasmMsg = + | { + execute: { + contract_addr: string + funds: Coin[] + msg: Binary + } + } + | { + instantiate: { + admin?: string | null + code_id: number + funds: Coin[] + label: string + msg: Binary + } + } + | { + migrate: { + contract_addr: string + msg: Binary + new_code_id: number + } + } + | { + update_admin: { + admin: string + contract_addr: string + } + } + | { + clear_admin: { + contract_addr: string + } + } +export type GovMsg = { + vote: { + proposal_id: number + vote: VoteOption + } +} +export type VoteOption = 'yes' | 'no' | 'abstain' | 'no_with_veto' +export type Vote = 'yes' | 'no' | 'abstain' export type ExecuteExt = | { approve: { @@ -98,6 +281,39 @@ export type Status = | 'executed' | 'closed' | 'execution_failed' + | { + veto_timelock: { + expiration: Expiration + } + } + | 'vetoed' +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export interface Coin { + amount: Uint128 + denom: string +} +export interface Empty {} +export interface IbcTimeout { + block?: IbcTimeoutBlock | null + timestamp?: Timestamp | null +} +export interface IbcTimeoutBlock { + height: number + revision: number +} +export interface SingleChoiceAutoVote { + rationale?: string | null + vote: Vote +} export type QueryMsg = | { proposal_module: {} @@ -113,6 +329,11 @@ export type QueryMsg = proposal_id: number } } + | { + can_propose: { + address: string + } + } | { proposal_submitted_hooks: {} } @@ -174,6 +395,7 @@ export type QueryExt = id: number } } +export type Boolean = boolean export type CheckedDenom = | { native: string @@ -181,9 +403,17 @@ export type CheckedDenom = | { cw20: Addr } +export type Addr = string export interface Config { deposit_info?: CheckedDepositInfo | null - open_proposal_submission: boolean + /** + * < v2.5.0 + */ + open_proposal_submission?: boolean + /** + * >= v2.5.0 + */ + submission_policy?: PreProposeSubmissionPolicy } export interface CheckedDepositInfo { amount: Uint128 diff --git a/packages/types/contracts/DaoPreProposeApprover.ts b/packages/types/contracts/DaoPreProposeApprover.ts index 5f69aa12f..36d6cf4d9 100644 --- a/packages/types/contracts/DaoPreProposeApprover.ts +++ b/packages/types/contracts/DaoPreProposeApprover.ts @@ -1,4 +1,8 @@ -import { Addr, Empty, Uint128 } from './common' +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ export interface InstantiateMsg { pre_propose_approval_contract: string @@ -12,7 +16,23 @@ export type ExecuteMsg = | { update_config: { deposit_info?: UncheckedDepositInfo | null - open_proposal_submission: boolean + /** + * < v2.5.0 + */ + open_proposal_submission?: boolean + /** + * >= v2.5.0 + */ + submission_policy?: PreProposeSubmissionPolicy | null + } + } + | { + update_submission_policy: { + allowlist_add?: string[] | null + allowlist_remove?: string[] | null + denylist_add?: string[] | null + denylist_remove?: string[] | null + set_dao_members?: boolean | null } } | { @@ -22,7 +42,7 @@ export type ExecuteMsg = } | { extension: { - msg: Empty + msg: ExecuteExt } } | { @@ -48,6 +68,7 @@ export type ApproverProposeMessage = { title: string } } +export type Uint128 = string export type DepositToken = | { token: { @@ -55,7 +76,9 @@ export type DepositToken = } } | { - voting_module_token: {} + voting_module_token: { + token_type: VotingModuleTokenType + } } export type UncheckedDenom = | { @@ -64,7 +87,24 @@ export type UncheckedDenom = | { cw20: string } +export type VotingModuleTokenType = 'native' | 'cw20' export type DepositRefundPolicy = 'always' | 'only_passed' | 'never' +export type PreProposeSubmissionPolicy = + | { + anyone: { + denylist?: string[] | null + } + } + | { + specific: { + allowlist?: string[] | null + dao_members: boolean + denylist?: string[] | null + } + } +export type ExecuteExt = { + reset_approver: {} +} export type Status = | 'open' | 'rejected' @@ -72,6 +112,24 @@ export type Status = | 'executed' | 'closed' | 'execution_failed' + | { + veto_timelock: { + expiration: Expiration + } + } + | 'vetoed' +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export type Timestamp = Uint64 +export type Uint64 = string export interface UncheckedDepositInfo { amount: Uint128 denom: DepositToken @@ -92,6 +150,11 @@ export type QueryMsg = proposal_id: number } } + | { + can_propose: { + address: string + } + } | { proposal_submitted_hooks: {} } @@ -114,6 +177,7 @@ export type QueryExt = id: number } } +export type Boolean = boolean export type CheckedDenom = | { native: string @@ -121,9 +185,17 @@ export type CheckedDenom = | { cw20: Addr } +export type Addr = string export interface Config { deposit_info?: CheckedDepositInfo | null - open_proposal_submission: boolean + /** + * < v2.5.0 + */ + open_proposal_submission?: boolean + /** + * >= v2.5.0 + */ + submission_policy?: PreProposeSubmissionPolicy } export interface CheckedDepositInfo { amount: Uint128 @@ -137,3 +209,4 @@ export interface DepositInfoResponse { export interface HooksResponse { hooks: string[] } +export type Binary = string diff --git a/packages/types/contracts/DaoPreProposeMultiple.ts b/packages/types/contracts/DaoPreProposeMultiple.ts index 5acca7bb7..3fd452990 100644 --- a/packages/types/contracts/DaoPreProposeMultiple.ts +++ b/packages/types/contracts/DaoPreProposeMultiple.ts @@ -1,17 +1,10 @@ -import { - Addr, - CosmosMsgForEmpty, - Empty, - ProposalStatus, - Uint128, -} from './common' +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ -export interface ConfigResponse { - deposit_info?: CheckedDepositInfo | null - open_proposal_submission: boolean -} -export type ProposalModuleResponse = string -export type DaoResponse = string +export type Uint128 = string export type DepositToken = | { token: { @@ -23,7 +16,6 @@ export type DepositToken = token_type: VotingModuleTokenType } } -export type VotingModuleTokenType = 'native' | 'cw20' export type UncheckedDenom = | { native: string @@ -31,21 +23,39 @@ export type UncheckedDenom = | { cw20: string } -export enum DepositRefundPolicy { - Always = 'always', - OnlyPassed = 'only_passed', - Never = 'never', -} +export type VotingModuleTokenType = 'native' | 'cw20' +export type DepositRefundPolicy = 'always' | 'only_passed' | 'never' +export type PreProposeSubmissionPolicy = + | { + anyone: { + denylist?: string[] | null + } + } + | { + specific: { + allowlist?: string[] | null + dao_members: boolean + denylist?: string[] | null + } + } export interface InstantiateMsg { deposit_info?: UncheckedDepositInfo | null extension: Empty - open_proposal_submission: boolean + /** + * < v2.5.0 + */ + open_proposal_submission?: boolean + /** + * >= v2.5.0 + */ + submission_policy?: PreProposeSubmissionPolicy } export interface UncheckedDepositInfo { amount: Uint128 denom: DepositToken refund_policy: DepositRefundPolicy } +export interface Empty {} export type ExecuteMsg = | { propose: { @@ -55,7 +65,23 @@ export type ExecuteMsg = | { update_config: { deposit_info?: UncheckedDepositInfo | null - open_proposal_submission: boolean + /** + * < v2.5.0 + */ + open_proposal_submission?: boolean + /** + * >= v2.5.0 + */ + submission_policy?: PreProposeSubmissionPolicy | null + } + } + | { + update_submission_policy: { + allowlist_add?: string[] | null + allowlist_remove?: string[] | null + denylist_add?: string[] | null + denylist_remove?: string[] | null + set_dao_members?: boolean | null } } | { @@ -69,14 +95,18 @@ export type ExecuteMsg = } } | { - proposal_created_hook: { - proposal_id: number - proposer: string + add_proposal_submitted_hook: { + address: string + } + } + | { + remove_proposal_submitted_hook: { + address: string } } | { proposal_completed_hook: { - new_status: ProposalStatus + new_status: Status proposal_id: number } } @@ -85,8 +115,169 @@ export type ProposeMessage = { choices: MultipleChoiceOptions description: string title: string + vote?: MultipleChoiceAutoVote | null } } +export type CosmosMsgForEmpty = + | { + bank: BankMsg + } + | { + custom: Empty + } + | { + staking: StakingMsg + } + | { + distribution: DistributionMsg + } + | { + stargate: { + type_url: string + value: Binary + } + } + | { + ibc: IbcMsg + } + | { + wasm: WasmMsg + } + | { + gov: GovMsg + } +export type BankMsg = + | { + send: { + amount: Coin[] + to_address: string + } + } + | { + burn: { + amount: Coin[] + } + } +export type StakingMsg = + | { + delegate: { + amount: Coin + validator: string + } + } + | { + undelegate: { + amount: Coin + validator: string + } + } + | { + redelegate: { + amount: Coin + dst_validator: string + src_validator: string + } + } +export type DistributionMsg = + | { + set_withdraw_address: { + address: string + } + } + | { + withdraw_delegator_reward: { + validator: string + } + } +export type Binary = string +export type IbcMsg = + | { + transfer: { + amount: Coin + channel_id: string + timeout: IbcTimeout + to_address: string + } + } + | { + send_packet: { + channel_id: string + data: Binary + timeout: IbcTimeout + } + } + | { + close_channel: { + channel_id: string + } + } +export type Timestamp = Uint64 +export type Uint64 = string +export type WasmMsg = + | { + execute: { + contract_addr: string + funds: Coin[] + msg: Binary + } + } + | { + instantiate: { + admin?: string | null + code_id: number + funds: Coin[] + label: string + msg: Binary + } + } + | { + migrate: { + contract_addr: string + msg: Binary + new_code_id: number + } + } + | { + update_admin: { + admin: string + contract_addr: string + } + } + | { + clear_admin: { + contract_addr: string + } + } +export type GovMsg = { + vote: { + proposal_id: number + vote: VoteOption + } +} +export type VoteOption = 'yes' | 'no' | 'abstain' | 'no_with_veto' +export type Status = + | 'open' + | 'rejected' + | 'passed' + | 'executed' + | 'closed' + | 'execution_failed' + | { + veto_timelock: { + expiration: Expiration + } + } + | 'vetoed' +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } export interface MultipleChoiceOptions { options: MultipleChoiceOption[] } @@ -95,6 +286,25 @@ export interface MultipleChoiceOption { msgs: CosmosMsgForEmpty[] title: string } +export interface Coin { + amount: Uint128 + denom: string +} +export interface IbcTimeout { + block?: IbcTimeoutBlock | null + timestamp?: Timestamp | null +} +export interface IbcTimeoutBlock { + height: number + revision: number +} +export interface MultipleChoiceAutoVote { + rationale?: string | null + vote: MultipleChoiceVote +} +export interface MultipleChoiceVote { + option_id: number +} export type QueryMsg = | { proposal_module: {} @@ -110,11 +320,20 @@ export type QueryMsg = proposal_id: number } } + | { + can_propose: { + address: string + } + } + | { + proposal_submitted_hooks: {} + } | { query_extension: { msg: Empty } } +export type Boolean = boolean export type CheckedDenom = | { native: string @@ -122,9 +341,17 @@ export type CheckedDenom = | { cw20: Addr } +export type Addr = string export interface Config { deposit_info?: CheckedDepositInfo | null - open_proposal_submission: boolean + /** + * < v2.5.0 + */ + open_proposal_submission?: boolean + /** + * >= v2.5.0 + */ + submission_policy?: PreProposeSubmissionPolicy } export interface CheckedDepositInfo { amount: Uint128 @@ -135,3 +362,6 @@ export interface DepositInfoResponse { deposit_info?: CheckedDepositInfo | null proposer: Addr } +export interface HooksResponse { + hooks: string[] +} diff --git a/packages/types/contracts/DaoPreProposeSingle.ts b/packages/types/contracts/DaoPreProposeSingle.ts index 8fceab193..a4a1f22f0 100644 --- a/packages/types/contracts/DaoPreProposeSingle.ts +++ b/packages/types/contracts/DaoPreProposeSingle.ts @@ -1,21 +1,61 @@ -import { - Addr, - CheckedDepositInfo, - CosmosMsgFor_Empty, - DepositRefundPolicy, - Empty, - Uint128, -} from './common' +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ -export interface ConfigResponse { - deposit_info?: CheckedDepositInfo | null - open_proposal_submission: boolean +export type Uint128 = string +export type DepositToken = + | { + token: { + denom: UncheckedDenom + } + } + | { + voting_module_token: { + token_type: VotingModuleTokenType + } + } +export type UncheckedDenom = + | { + native: string + } + | { + cw20: string + } +export type VotingModuleTokenType = 'native' | 'cw20' +export type DepositRefundPolicy = 'always' | 'only_passed' | 'never' +export type PreProposeSubmissionPolicy = + | { + anyone: { + denylist?: string[] | null + } + } + | { + specific: { + allowlist?: string[] | null + dao_members: boolean + denylist?: string[] | null + } + } +export interface InstantiateMsg { + deposit_info?: UncheckedDepositInfo | null + extension: Empty + /** + * < v2.5.0 + */ + open_proposal_submission?: boolean + /** + * >= v2.5.0 + */ + submission_policy?: PreProposeSubmissionPolicy } -export type DaoResponse = string -export interface DepositInfoResponse { - deposit_info?: CheckedDepositInfo | null - proposer: Addr +export interface UncheckedDepositInfo { + amount: Uint128 + denom: DepositToken + refund_policy: DepositRefundPolicy } +export interface Empty {} export type ExecuteMsg = | { propose: { @@ -25,7 +65,23 @@ export type ExecuteMsg = | { update_config: { deposit_info?: UncheckedDepositInfo | null - open_proposal_submission: boolean + /** + * < v2.5.0 + */ + open_proposal_submission?: boolean + /** + * >= v2.5.0 + */ + submission_policy?: PreProposeSubmissionPolicy | null + } + } + | { + update_submission_policy: { + allowlist_add?: string[] | null + allowlist_remove?: string[] | null + denylist_add?: string[] | null + denylist_remove?: string[] | null + set_dao_members?: boolean | null } } | { @@ -39,9 +95,13 @@ export type ExecuteMsg = } } | { - proposal_created_hook: { - proposal_id: number - proposer: string + add_proposal_submitted_hook: { + address: string + } + } + | { + remove_proposal_submitted_hook: { + address: string } } | { @@ -53,29 +113,149 @@ export type ExecuteMsg = export type ProposeMessage = { propose: { description: string - msgs: CosmosMsgFor_Empty[] + msgs: CosmosMsgForEmpty[] title: string + vote?: SingleChoiceAutoVote | null } } -export type DepositToken = +export type CosmosMsgForEmpty = | { - token: { - denom: UncheckedDenom + bank: BankMsg + } + | { + custom: Empty + } + | { + staking: StakingMsg + } + | { + distribution: DistributionMsg + } + | { + stargate: { + type_url: string + value: Binary } } | { - voting_module_token: { - token_type: VotingModuleTokenType + ibc: IbcMsg + } + | { + wasm: WasmMsg + } + | { + gov: GovMsg + } +export type BankMsg = + | { + send: { + amount: Coin[] + to_address: string } } -export type VotingModuleTokenType = 'native' | 'cw20' -export type UncheckedDenom = | { - native: string + burn: { + amount: Coin[] + } } +export type StakingMsg = | { - cw20: string + delegate: { + amount: Coin + validator: string + } + } + | { + undelegate: { + amount: Coin + validator: string + } + } + | { + redelegate: { + amount: Coin + dst_validator: string + src_validator: string + } + } +export type DistributionMsg = + | { + set_withdraw_address: { + address: string + } + } + | { + withdraw_delegator_reward: { + validator: string + } + } +export type Binary = string +export type IbcMsg = + | { + transfer: { + amount: Coin + channel_id: string + timeout: IbcTimeout + to_address: string + } + } + | { + send_packet: { + channel_id: string + data: Binary + timeout: IbcTimeout + } + } + | { + close_channel: { + channel_id: string + } + } +export type Timestamp = Uint64 +export type Uint64 = string +export type WasmMsg = + | { + execute: { + contract_addr: string + funds: Coin[] + msg: Binary + } + } + | { + instantiate: { + admin?: string | null + code_id: number + funds: Coin[] + label: string + msg: Binary + } + } + | { + migrate: { + contract_addr: string + msg: Binary + new_code_id: number + } + } + | { + update_admin: { + admin: string + contract_addr: string + } + } + | { + clear_admin: { + contract_addr: string + } } +export type GovMsg = { + vote: { + proposal_id: number + vote: VoteOption + } +} +export type VoteOption = 'yes' | 'no' | 'abstain' | 'no_with_veto' +export type Vote = 'yes' | 'no' | 'abstain' export type Status = | 'open' | 'rejected' @@ -83,18 +263,38 @@ export type Status = | 'executed' | 'closed' | 'execution_failed' -export interface UncheckedDepositInfo { + | { + veto_timelock: { + expiration: Expiration + } + } + | 'vetoed' +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export interface Coin { amount: Uint128 - denom: DepositToken - refund_policy: DepositRefundPolicy + denom: string } -export type ExtensionResponse = string -export interface InstantiateMsg { - deposit_info?: UncheckedDepositInfo | null - extension: Empty - open_proposal_submission: boolean +export interface IbcTimeout { + block?: IbcTimeoutBlock | null + timestamp?: Timestamp | null +} +export interface IbcTimeoutBlock { + height: number + revision: number +} +export interface SingleChoiceAutoVote { + rationale?: string | null + vote: Vote } -export type ProposalModuleResponse = string export type QueryMsg = | { proposal_module: {} @@ -111,7 +311,47 @@ export type QueryMsg = } } | { - extension: { + can_propose: { + address: string + } + } + | { + proposal_submitted_hooks: {} + } + | { + query_extension: { msg: Empty } } +export type Boolean = boolean +export type CheckedDenom = + | { + native: string + } + | { + cw20: Addr + } +export type Addr = string +export interface Config { + deposit_info?: CheckedDepositInfo | null + /** + * < v2.5.0 + */ + open_proposal_submission?: boolean + /** + * >= v2.5.0 + */ + submission_policy?: PreProposeSubmissionPolicy +} +export interface CheckedDepositInfo { + amount: Uint128 + denom: CheckedDenom + refund_policy: DepositRefundPolicy +} +export interface DepositInfoResponse { + deposit_info?: CheckedDepositInfo | null + proposer: Addr +} +export interface HooksResponse { + hooks: string[] +} diff --git a/packages/types/contracts/DaoProposalMultiple.ts b/packages/types/contracts/DaoProposalMultiple.ts index 158a98f11..d4aab6ed1 100644 --- a/packages/types/contracts/DaoProposalMultiple.ts +++ b/packages/types/contracts/DaoProposalMultiple.ts @@ -1,14 +1,16 @@ -import { - Addr, - CosmosMsgForEmpty, - Decimal, - Duration, - Expiration, - ModuleInstantiateInfo, - ProposalStatus, - Uint128, -} from './common' +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ +export type Duration = + | { + height: number + } + | { + time: number + } export type PreProposeInfo = | { anyone_may_propose: {} @@ -27,6 +29,8 @@ export type Admin = | { core_module: {} } +export type Uint128 = string +export type Binary = string export type VotingStrategy = { single_choice: { quorum: PercentageThreshold @@ -39,6 +43,7 @@ export type PercentageThreshold = | { percent: Decimal } +export type Decimal = string export interface InstantiateMsg { allow_revoting: boolean close_proposal_on_execution_failure: boolean @@ -46,8 +51,20 @@ export interface InstantiateMsg { min_voting_period?: Duration | null only_members_execute: boolean pre_propose_info: PreProposeInfo - voting_strategy: VotingStrategy veto?: VetoConfig | null + voting_strategy: VotingStrategy +} +export interface ModuleInstantiateInfo { + admin?: Admin | null + code_id: number + // added in v2.3.0 + funds?: Coin[] + label: string + msg: Binary +} +export interface Coin { + amount: Uint128 + denom: string } export interface VetoConfig { early_execute: boolean @@ -57,16 +74,12 @@ export interface VetoConfig { } export type ExecuteMsg = | { - propose: { - choices: MultipleChoiceOptions - description: string - proposer?: string | null - title: string - } + propose: MultipleChoiceProposeMsg } | { vote: { proposal_id: number + rationale?: string | null vote: MultipleChoiceVote } } @@ -80,11 +93,6 @@ export type ExecuteMsg = proposal_id: number } } - | { - veto: { - proposal_id: number - } - } | { close: { proposal_id: number @@ -98,8 +106,14 @@ export type ExecuteMsg = max_voting_period: Duration min_voting_period?: Duration | null only_members_execute: boolean - voting_strategy: VotingStrategy veto?: VetoConfig | null + voting_strategy: VotingStrategy + } + } + | { + update_rationale: { + proposal_id: number + rationale?: string | null } } | { @@ -127,6 +141,149 @@ export type ExecuteMsg = address: string } } +export type CosmosMsgForEmpty = + | { + bank: BankMsg + } + | { + custom: Empty + } + | { + staking: StakingMsg + } + | { + distribution: DistributionMsg + } + | { + stargate: { + type_url: string + value: Binary + } + } + | { + ibc: IbcMsg + } + | { + wasm: WasmMsg + } + | { + gov: GovMsg + } +export type BankMsg = + | { + send: { + amount: Coin[] + to_address: string + } + } + | { + burn: { + amount: Coin[] + } + } +export type StakingMsg = + | { + delegate: { + amount: Coin + validator: string + } + } + | { + undelegate: { + amount: Coin + validator: string + } + } + | { + redelegate: { + amount: Coin + dst_validator: string + src_validator: string + } + } +export type DistributionMsg = + | { + set_withdraw_address: { + address: string + } + } + | { + withdraw_delegator_reward: { + validator: string + } + } +export type IbcMsg = + | { + transfer: { + amount: Coin + channel_id: string + timeout: IbcTimeout + to_address: string + } + } + | { + send_packet: { + channel_id: string + data: Binary + timeout: IbcTimeout + } + } + | { + close_channel: { + channel_id: string + } + } +export type Timestamp = Uint64 +export type Uint64 = string +export type WasmMsg = + | { + execute: { + contract_addr: string + funds: Coin[] + msg: Binary + } + } + | { + instantiate: { + admin?: string | null + code_id: number + funds: Coin[] + label: string + msg: Binary + } + } + | { + migrate: { + contract_addr: string + msg: Binary + new_code_id: number + } + } + | { + update_admin: { + admin: string + contract_addr: string + } + } + | { + clear_admin: { + contract_addr: string + } + } +export type GovMsg = { + vote: { + proposal_id: number + vote: VoteOption + } +} +export type VoteOption = 'yes' | 'no' | 'abstain' | 'no_with_veto' +export interface MultipleChoiceProposeMsg { + choices: MultipleChoiceOptions + description: string + proposer?: string | null + title: string + vote?: MultipleChoiceAutoVote | null +} export interface MultipleChoiceOptions { options: MultipleChoiceOption[] } @@ -135,6 +292,19 @@ export interface MultipleChoiceOption { msgs: CosmosMsgForEmpty[] title: string } +export interface Empty {} +export interface IbcTimeout { + block?: IbcTimeoutBlock | null + timestamp?: Timestamp | null +} +export interface IbcTimeoutBlock { + height: number + revision: number +} +export interface MultipleChoiceAutoVote { + rationale?: string | null + vote: MultipleChoiceVote +} export interface MultipleChoiceVote { option_id: number } @@ -159,9 +329,6 @@ export type QueryMsg = start_before?: number | null } } - | { - proposal_count: {} - } | { get_vote: { proposal_id: number @@ -175,6 +342,9 @@ export type QueryMsg = start_after?: string | null } } + | { + proposal_count: {} + } | { proposal_creation_policy: {} } @@ -190,6 +360,9 @@ export type QueryMsg = | { info: {} } + | { + next_proposal_id: {} + } export type MigrateMsg = | { from_v1: { @@ -201,6 +374,7 @@ export type MigrateMsg = | { from_compatible: {} } +export type Addr = string export interface Config { allow_revoting: boolean close_proposal_on_execution_failure: boolean @@ -216,15 +390,43 @@ export interface VoteResponse { } export interface VoteInfo { power: Uint128 + rationale?: string | null vote: MultipleChoiceVote voter: Addr - rationale?: string | null + // Indexer may return these. votedAt?: string } -export enum MultipleChoiceOptionType { - Standard = 'standard', - None = 'none', +export interface InfoResponse { + info: ContractVersion +} +export interface ContractVersion { + contract: string + version: string } +export type MultipleChoiceOptionType = 'standard' | 'none' +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export type Status = + | 'open' + | 'rejected' + | 'passed' + | 'executed' + | 'closed' + | 'execution_failed' + | { + veto_timelock: { + expiration: Expiration + } + } + | 'vetoed' export interface ProposalListResponse { proposals: ProposalResponse[] } @@ -248,7 +450,7 @@ export interface MultipleChoiceProposal { min_voting_period?: Expiration | null proposer: Addr start_height: number - status: ProposalStatus + status: Status title: string total_power: Uint128 veto?: VetoConfig | null @@ -269,7 +471,8 @@ export interface MultipleChoiceVotes { export interface VoteListResponse { votes: VoteInfo[] } -export type ProposalCreationPolicyResponse = +export type ProposalCreationPolicy = + // v2-beta | { Anyone: {} } @@ -278,6 +481,15 @@ export type ProposalCreationPolicyResponse = addr: Addr } } + // v2 + | { + anyone: {} + } + | { + module: { + addr: Addr + } + } export interface HooksResponse { hooks: string[] } diff --git a/packages/types/contracts/DaoProposalSingle.common.ts b/packages/types/contracts/DaoProposalSingle.common.ts index 4112e4f4e..6d93ecb86 100644 --- a/packages/types/contracts/DaoProposalSingle.common.ts +++ b/packages/types/contracts/DaoProposalSingle.common.ts @@ -1,10 +1,6 @@ import { Addr, Decimal, Uint128 } from './common' -export enum Vote { - Yes = 'yes', - No = 'no', - Abstain = 'abstain', -} +export type Vote = 'yes' | 'no' | 'abstain' export type Threshold = | { diff --git a/packages/types/contracts/DaoProposalSingle.v2.ts b/packages/types/contracts/DaoProposalSingle.v2.ts index 143df6888..9f36761e8 100644 --- a/packages/types/contracts/DaoProposalSingle.v2.ts +++ b/packages/types/contracts/DaoProposalSingle.v2.ts @@ -1,42 +1,105 @@ -import { - Addr, - Binary, - ContractVersionInfo, - CosmosMsgFor_Empty, - Duration, - Expiration, - ModuleInstantiateInfo, - ProposalStatus, - Uint128, -} from './common' -import { Threshold, Vote, Votes } from './DaoProposalSingle.common' +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ -export interface ConfigResponse { +export type Duration = + | { + height: number + } + | { + time: number + } +export type PreProposeInfo = + | { + anyone_may_propose: {} + } + | { + module_may_propose: { + info: ModuleInstantiateInfo + } + } +export type Admin = + | { + address: { + addr: string + } + } + | { + core_module: {} + } +export type Uint128 = string +export type Binary = string +export type Threshold = + | { + absolute_percentage: { + percentage: PercentageThreshold + } + } + | { + threshold_quorum: { + quorum: PercentageThreshold + threshold: PercentageThreshold + } + } + | { + absolute_count: { + threshold: Uint128 + } + } +export type PercentageThreshold = + | { + majority: {} + } + | { + percent: Decimal + } +export type Decimal = string +export interface InstantiateMsg { allow_revoting: boolean close_proposal_on_execution_failure: boolean - dao: Addr max_voting_period: Duration min_voting_period?: Duration | null only_members_execute: boolean + pre_propose_info: PreProposeInfo threshold: Threshold veto?: VetoConfig | null } -export type DaoResponse = string +export interface ModuleInstantiateInfo { + admin?: Admin | null + code_id: number + funds: Coin[] + label: string + msg: Binary +} +export interface Coin { + amount: Uint128 + denom: string +} +export interface VetoConfig { + early_execute: boolean + timelock_duration: Duration + veto_before_passed: boolean + vetoer: string +} export type ExecuteMsg = | { - propose: { - description: string - msgs: CosmosMsgFor_Empty[] - proposer?: string | null - title: string - } + propose: SingleChoiceProposeMsg } | { vote: { proposal_id: number + rationale?: string | null vote: Vote } } + | { + update_rationale: { + proposal_id: number + rationale?: string | null + } + } | { execute: { proposal_id: number @@ -89,98 +152,162 @@ export type ExecuteMsg = address: string } } -export type PreProposeInfo = +export type CosmosMsgForEmpty = | { - anyone_may_propose: {} + bank: BankMsg } | { - module_may_propose: { - info: ModuleInstantiateInfo + custom: Empty + } + | { + staking: StakingMsg + } + | { + distribution: DistributionMsg + } + | { + stargate: { + type_url: string + value: Binary } } -export type GovernanceModulesResponse = Addr[] -export type ExtensionResponse = Binary -export interface InfoResponse { - info: ContractVersionInfo -} -export interface InstantiateMsg { - allow_revoting: boolean - close_proposal_on_execution_failure: boolean - max_voting_period: Duration - min_voting_period?: Duration | null - only_members_execute: boolean - pre_propose_info: PreProposeInfo - threshold: Threshold - veto?: VetoConfig | null -} -export interface VetoConfig { - early_execute: boolean - timelock_duration: Duration - veto_before_passed: boolean - vetoer: string -} -export interface ListProposalsResponse { - proposals: ProposalResponse[] -} -export interface ProposalResponse { - id: number - proposal: SingleChoiceProposal - // Indexer may return these. - hideFromSearch?: boolean - dao?: string - daoProposalId?: string - createdAt?: string - completedAt?: string - executedAt?: string - closedAt?: string -} -export interface SingleChoiceProposal { - allow_revoting: boolean - description: string - expiration: Expiration - min_voting_period?: Expiration | null - msgs: CosmosMsgFor_Empty[] - proposer: Addr - start_height: number - status: ProposalStatus - threshold: Threshold - title: string - total_power: Uint128 - veto?: VetoConfig | null - votes: Votes -} -export type MigrateMsg = | { - from_v1: { - close_proposal_on_execution_failure: boolean - pre_propose_info: PreProposeInfo - veto?: VetoConfig | null + ibc: IbcMsg + } + | { + wasm: WasmMsg + } + | { + gov: GovMsg + } +export type BankMsg = + | { + send: { + amount: Coin[] + to_address: string } } | { - from_compatible: {} + burn: { + amount: Coin[] + } } -export type ProposalCountResponse = number -// v2 changed case. -export type ProposalCreationPolicyResponse = +export type StakingMsg = | { - Anyone: {} + delegate: { + amount: Coin + validator: string + } } | { - anyone: {} + undelegate: { + amount: Coin + validator: string + } } | { - Module: { - addr: Addr + redelegate: { + amount: Coin + dst_validator: string + src_validator: string } } +export type DistributionMsg = | { - module: { - addr: Addr + set_withdraw_address: { + address: string } } -export interface ProposalHooksResponse { - hooks: string[] + | { + withdraw_delegator_reward: { + validator: string + } + } +export type IbcMsg = + | { + transfer: { + amount: Coin + channel_id: string + timeout: IbcTimeout + to_address: string + } + } + | { + send_packet: { + channel_id: string + data: Binary + timeout: IbcTimeout + } + } + | { + close_channel: { + channel_id: string + } + } +export type Timestamp = Uint64 +export type Uint64 = string +export type WasmMsg = + | { + execute: { + contract_addr: string + funds: Coin[] + msg: Binary + } + } + | { + instantiate: { + admin?: string | null + code_id: number + funds: Coin[] + label: string + msg: Binary + } + } + | { + migrate: { + contract_addr: string + msg: Binary + new_code_id: number + } + } + | { + update_admin: { + admin: string + contract_addr: string + } + } + | { + clear_admin: { + contract_addr: string + } + } +export type GovMsg = { + vote: { + proposal_id: number + vote: VoteOption + } +} +export type VoteOption = 'yes' | 'no' | 'abstain' | 'no_with_veto' +export type Vote = 'yes' | 'no' | 'abstain' +export interface SingleChoiceProposeMsg { + description: string + msgs: CosmosMsgForEmpty[] + proposer?: string | null + title: string + vote?: SingleChoiceAutoVote | null +} +export interface Empty {} +export interface IbcTimeout { + block?: IbcTimeoutBlock | null + timestamp?: Timestamp | null +} +export interface IbcTimeoutBlock { + height: number + revision: number +} +export interface SingleChoiceAutoVote { + rationale?: string | null + vote: Vote } export type QueryMsg = | { @@ -203,9 +330,6 @@ export type QueryMsg = start_before?: number | null } } - | { - proposal_count: {} - } | { get_vote: { proposal_id: number @@ -219,6 +343,9 @@ export type QueryMsg = start_after?: string | null } } + | { + proposal_count: {} + } | { proposal_creation_policy: {} } @@ -234,9 +361,130 @@ export type QueryMsg = | { info: {} } -export interface ReverseProposalsResponse { + | { + next_proposal_id: {} + } +export type MigrateMsg = + | { + from_v1: { + close_proposal_on_execution_failure: boolean + pre_propose_info: PreProposeInfo + veto?: VetoConfig | null + } + } + | { + from_compatible: {} + } +export type Addr = string +export interface Config { + allow_revoting: boolean + close_proposal_on_execution_failure: boolean + dao: Addr + max_voting_period: Duration + min_voting_period?: Duration | null + only_members_execute: boolean + threshold: Threshold + veto?: VetoConfig | null +} +export interface VoteResponse { + vote?: VoteInfo | null +} +export interface VoteInfo { + power: Uint128 + rationale?: string | null + vote: Vote + voter: Addr + // Indexer may return these. + votedAt?: string +} +export interface InfoResponse { + info: ContractVersion +} +export interface ContractVersion { + contract: string + version: string +} +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export type Status = + | 'open' + | 'rejected' + | 'passed' + | 'executed' + | 'closed' + | 'execution_failed' + | { + veto_timelock: { + expiration: Expiration + } + } + | 'vetoed' +export interface ProposalListResponse { proposals: ProposalResponse[] } -export interface VoteHooksResponse { +export interface ProposalResponse { + id: number + proposal: SingleChoiceProposal + + // Indexer may return these. + hideFromSearch?: boolean + dao?: string + daoProposalId?: string + createdAt?: string + completedAt?: string + executedAt?: string + closedAt?: string +} +export interface SingleChoiceProposal { + allow_revoting: boolean + description: string + expiration: Expiration + min_voting_period?: Expiration | null + msgs: CosmosMsgForEmpty[] + proposer: Addr + start_height: number + status: Status + threshold: Threshold + title: string + total_power: Uint128 + veto?: VetoConfig | null + votes: Votes +} +export interface Votes { + abstain: Uint128 + no: Uint128 + yes: Uint128 +} +export interface VoteListResponse { + votes: VoteInfo[] +} +export type ProposalCreationPolicy = + // v2-beta + | { + Anyone: {} + } + | { + Module: { + addr: Addr + } + } + // v2 + | { + anyone: {} + } + | { + module: { + addr: Addr + } + } +export interface HooksResponse { hooks: string[] } diff --git a/packages/types/contracts/DaoVotingCw20Staked.ts b/packages/types/contracts/DaoVotingCw20Staked.ts index e1d494d4a..70e2772fa 100644 --- a/packages/types/contracts/DaoVotingCw20Staked.ts +++ b/packages/types/contracts/DaoVotingCw20Staked.ts @@ -1,23 +1,22 @@ -import { - ActiveThreshold, - Binary, - ContractVersionInfo, - Duration, - Uint128, -} from './common' +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ -export interface ActiveThresholdResponse { - active_threshold?: ActiveThreshold | null -} -export type DaoResponse = string -export type ExecuteMsg = { - update_active_threshold: { - new_threshold?: ActiveThreshold | null - } -} -export interface InfoResponse { - info: ContractVersionInfo -} +export type ActiveThreshold = + | { + absolute_count: { + count: Uint128 + } + } + | { + percentage: { + percent: Decimal + } + } +export type Uint128 = string +export type Decimal = string export type TokenInfo = | { existing: { @@ -51,6 +50,13 @@ export type StakingInfo = unstaking_duration?: Duration | null } } +export type Duration = + | { + height: number + } + | { + time: number + } export type Logo = | { url: string @@ -65,6 +71,7 @@ export type EmbeddedLogo = | { png: Binary } +export type Binary = string export interface InstantiateMsg { active_threshold?: ActiveThreshold | null token_info: TokenInfo @@ -79,17 +86,15 @@ export interface InstantiateMarketingInfo { marketing?: string | null project?: string | null } -export interface IsActiveResponse { - active: boolean +export type ExecuteMsg = { + update_active_threshold: { + new_threshold?: ActiveThreshold | null + } } -export interface MigrateMsg {} export type QueryMsg = | { staking_contract: {} } - | { - dao: {} - } | { active_threshold: {} } @@ -104,6 +109,9 @@ export type QueryMsg = height?: number | null } } + | { + dao: {} + } | { info: {} } @@ -113,15 +121,24 @@ export type QueryMsg = | { is_active: {} } -export type StakingContractResponse = string -export type TokenContractResponse = string +export interface MigrateMsg {} +export interface ActiveThresholdResponse { + active_threshold?: ActiveThreshold | null +} +export type Addr = string +export interface InfoResponse { + info: ContractVersion +} +export interface ContractVersion { + contract: string + version: string +} +export type Boolean = boolean export interface TotalPowerAtHeightResponse { - // Optional because the indexer does not provide this. - height?: number + height: number power: Uint128 } export interface VotingPowerAtHeightResponse { - // Optional because the indexer does not provide this. - height?: number + height: number power: Uint128 } diff --git a/packages/types/contracts/DaoVotingCw4.ts b/packages/types/contracts/DaoVotingCw4.ts index a12236eba..050d249af 100644 --- a/packages/types/contracts/DaoVotingCw4.ts +++ b/packages/types/contracts/DaoVotingCw4.ts @@ -1,10 +1,9 @@ -import { ContractVersionInfo, Uint128 } from './common' +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ -export type DaoResponse = string -export type GroupContractResponse = string -export interface InfoResponse { - info: ContractVersionInfo -} export type GroupContract = | { existing: { @@ -24,14 +23,11 @@ export interface Member { addr: string weight: number } -export interface MigrateMsg {} +export type ExecuteMsg = string export type QueryMsg = | { group_contract: {} } - | { - dao: {} - } | { voting_power_at_height: { address: string @@ -43,16 +39,27 @@ export type QueryMsg = height?: number | null } } + | { + dao: {} + } | { info: {} } +export interface MigrateMsg {} +export type Addr = string +export interface InfoResponse { + info: ContractVersion +} +export interface ContractVersion { + contract: string + version: string +} +export type Uint128 = string export interface TotalPowerAtHeightResponse { - // Optional because the indexer does not provide this. - height?: number + height: number power: Uint128 } export interface VotingPowerAtHeightResponse { - // Optional because the indexer does not provide this. - height?: number + height: number power: Uint128 } diff --git a/packages/types/contracts/DaoVotingCw721Staked.ts b/packages/types/contracts/DaoVotingCw721Staked.ts index 0b933d699..079d0a92a 100644 --- a/packages/types/contracts/DaoVotingCw721Staked.ts +++ b/packages/types/contracts/DaoVotingCw721Staked.ts @@ -1,18 +1,22 @@ /** - * This file was automatically generated by @cosmwasm/ts-codegen@0.19.0. + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { - ActiveThreshold, - Addr, - Binary, - Duration, - Expiration, - Uint128, -} from './common' - +export type ActiveThreshold = + | { + absolute_count: { + count: Uint128 + } + } + | { + percentage: { + percent: Decimal + } + } +export type Uint128 = string +export type Decimal = string export type NftContract = | { existing: { @@ -30,6 +34,14 @@ export type NftContract = | { factory: Binary } +export type Binary = string +export type Duration = + | { + height: number + } + | { + time: number + } export interface InstantiateMsg { active_threshold?: ActiveThreshold | null nft_contract: NftContract @@ -114,6 +126,10 @@ export type QueryMsg = | { info: {} } +export interface ActiveThresholdResponse { + active_threshold?: ActiveThreshold | null +} +export type Addr = string export interface Config { nft_address: Addr unstaking_duration?: Duration | null @@ -121,6 +137,26 @@ export interface Config { export interface HooksResponse { hooks: string[] } +export interface InfoResponse { + info: ContractVersion +} +export interface ContractVersion { + contract: string + version: string +} +export type Boolean = boolean +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export type Timestamp = Uint64 +export type Uint64 = string export interface NftClaimsResponse { nft_claims: NftClaim[] } diff --git a/packages/types/contracts/DaoVotingNativeStaked.ts b/packages/types/contracts/DaoVotingNativeStaked.ts index 8da9a3d1a..1ac3c07d1 100644 --- a/packages/types/contracts/DaoVotingNativeStaked.ts +++ b/packages/types/contracts/DaoVotingNativeStaked.ts @@ -1,19 +1,31 @@ -import { - Addr, - ContractVersionInfo, - Duration, - Expiration, - Uint128, -} from './common' +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ -export interface ClaimsResponse { - claims: Claim[] -} -export interface Claim { - amount: Uint128 - release_at: Expiration +export type Admin = + | { + address: { + addr: string + } + } + | { + core_module: {} + } +export type Duration = + | { + height: number + } + | { + time: number + } +export interface InstantiateMsg { + denom: string + manager?: string | null + owner?: Admin | null + unstaking_duration?: Duration | null } -export type DaoResponse = string export type ExecuteMsg = | { stake: {} @@ -33,45 +45,8 @@ export type ExecuteMsg = | { claim: {} } -export interface GetConfigResponse { - denom: string - manager?: Addr | null - owner?: Addr | null - unstaking_duration?: Duration | null -} -export interface InfoResponse { - info: ContractVersionInfo -} -export type Admin = - | { - address: { - addr: string - } - } - | { - core_module: {} - } -export interface InstantiateMsg { - denom: string - manager?: string | null - owner?: Admin | null - unstaking_duration?: Duration | null -} -export interface IsActiveResponse { - active: boolean -} -export interface ListStakersResponse { - stakers: StakerBalanceResponse[] -} -export interface StakerBalanceResponse { - address: string - balance: Uint128 -} -export interface MigrateMsg {} +export type Uint128 = string export type QueryMsg = - | { - dao: {} - } | { get_config: {} } @@ -97,16 +72,58 @@ export type QueryMsg = height?: number | null } } + | { + dao: {} + } | { info: {} } +export interface MigrateMsg {} +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export type Timestamp = Uint64 +export type Uint64 = string +export interface ClaimsResponse { + claims: Claim[] +} +export interface Claim { + amount: Uint128 + release_at: Expiration +} +export type Addr = string +export interface Config { + denom: string + manager?: Addr | null + owner?: Addr | null + unstaking_duration?: Duration | null +} +export interface InfoResponse { + info: ContractVersion +} +export interface ContractVersion { + contract: string + version: string +} +export interface ListStakersResponse { + stakers: StakerBalanceResponse[] +} +export interface StakerBalanceResponse { + address: string + balance: Uint128 +} export interface TotalPowerAtHeightResponse { - // Optional because the indexer does not provide this. - height?: number + height: number power: Uint128 } export interface VotingPowerAtHeightResponse { - // Optional because the indexer does not provide this. - height?: number + height: number power: Uint128 } diff --git a/packages/types/contracts/DaoVotingTokenStaked.ts b/packages/types/contracts/DaoVotingTokenStaked.ts index 3d97a14cb..69dce8753 100644 --- a/packages/types/contracts/DaoVotingTokenStaked.ts +++ b/packages/types/contracts/DaoVotingTokenStaked.ts @@ -1,13 +1,22 @@ -import { - ActiveThreshold, - Addr, - Binary, - ContractVersionInfo, - Duration, - Expiration, - Uint128, -} from './common' +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ +export type ActiveThreshold = + | { + absolute_count: { + count: Uint128 + } + } + | { + percentage: { + percent: Decimal + } + } +export type Uint128 = string +export type Decimal = string export type TokenInfo = | { existing: { @@ -20,6 +29,14 @@ export type TokenInfo = | { factory: Binary } +export type Binary = string +export type Duration = + | { + height: number + } + | { + time: number + } export interface InstantiateMsg { active_threshold?: ActiveThreshold | null token_info: TokenInfo @@ -85,9 +102,6 @@ export type QueryMsg = | { get_config: {} } - | { - denom: {} - } | { claims: { address: string @@ -108,6 +122,9 @@ export type QueryMsg = | { token_contract: {} } + | { + denom: {} + } | { is_active: {} } @@ -132,6 +149,18 @@ export interface MigrateMsg {} export interface ActiveThresholdResponse { active_threshold?: ActiveThreshold | null } +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export type Timestamp = Uint64 +export type Uint64 = string export interface ClaimsResponse { claims: Claim[] } @@ -139,6 +168,7 @@ export interface Claim { amount: Uint128 release_at: Expiration } +export type Addr = string export interface DenomResponse { denom: string } @@ -149,7 +179,11 @@ export interface GetHooksResponse { hooks: string[] } export interface InfoResponse { - info: ContractVersionInfo + info: ContractVersion +} +export interface ContractVersion { + contract: string + version: string } export type Boolean = boolean export interface ListStakersResponse { @@ -161,12 +195,10 @@ export interface StakerBalanceResponse { } export type NullableAddr = Addr | null export interface TotalPowerAtHeightResponse { - // Optional because the indexer does not provide this. - height?: number + height: number power: Uint128 } export interface VotingPowerAtHeightResponse { - // Optional because the indexer does not provide this. - height?: number + height: number power: Uint128 } diff --git a/packages/types/contracts/NeutronVotingRegistry.ts b/packages/types/contracts/NeutronVotingRegistry.ts index 4db3bf1b3..b327765b1 100644 --- a/packages/types/contracts/NeutronVotingRegistry.ts +++ b/packages/types/contracts/NeutronVotingRegistry.ts @@ -1,11 +1,9 @@ /** - * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { Addr, Uint128 } from './common' - export interface InstantiateMsg { owner: string voting_vaults: string[] @@ -57,9 +55,18 @@ export type QueryMsg = | { info: {} } +export type Addr = string export interface Config { owner: Addr } +export interface InfoResponse { + info: ContractVersion +} +export interface ContractVersion { + contract: string + version: string +} +export type Uint128 = string export interface TotalPowerAtHeightResponse { height: number power: Uint128 diff --git a/packages/types/contracts/SecretCwAdminFactory.ts b/packages/types/contracts/SecretCwAdminFactory.ts new file mode 100644 index 000000000..d1b08fb37 --- /dev/null +++ b/packages/types/contracts/SecretCwAdminFactory.ts @@ -0,0 +1,31 @@ +export interface InstantiateMsg {} +export type ExecuteMsg = { + instantiate_contract_with_self_admin: { + module_info: ModuleInstantiateInfo + } +} +export type Admin = + | { + address: { + addr: string + } + } + | { + core_module: {} + } +export type Uint128 = string +export type Binary = string +export interface ModuleInstantiateInfo { + admin?: Admin | null + code_hash: string + code_id: number + funds: Coin[] + label: string + msg: Binary +} +export interface Coin { + amount: Uint128 + denom: string +} +export type QueryMsg = string +export interface MigrateMsg {} diff --git a/packages/types/contracts/SecretDaoDaoCore.ts b/packages/types/contracts/SecretDaoDaoCore.ts new file mode 100644 index 000000000..c9142e812 --- /dev/null +++ b/packages/types/contracts/SecretDaoDaoCore.ts @@ -0,0 +1,560 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +export type Admin = + | { + address: { + addr: string + } + } + | { + core_module: {} + } +export type Uint128 = string +export type Binary = string +export interface InstantiateMsg { + admin?: string | null + dao_uri?: string | null + description: string + image_url?: string | null + initial_items?: InitialItem[] | null + name: string + proposal_modules_instantiate_info: ModuleInstantiateInfo[] + query_auth_code_hash: string + query_auth_code_id: number + snip20_code_hash: string + snip721_code_hash: string + voting_module_instantiate_info: ModuleInstantiateInfo +} +export interface InitialItem { + key: string + value: string +} +export interface ModuleInstantiateInfo { + admin?: Admin | null + code_hash: string + code_id: number + funds: Coin[] + label: string + msg: Binary +} +export interface Coin { + amount: Uint128 + denom: string +} +export type ExecuteMsg = + | { + execute_admin_msgs: { + msgs: CosmosMsgForEmpty[] + } + } + | { + execute_proposal_hook: { + msgs: CosmosMsgForEmpty[] + } + } + | { + pause: { + duration: Duration + } + } + | { + receive: Snip20ReceiveMsg + } + | { + receive_nft: { + msg?: Binary | null + sender: Addr + token_id: string + } + } + | { + remove_item: { + key: string + } + } + | { + set_item: { + key: string + value: string + } + } + | { + nominate_admin: { + admin?: string | null + } + } + | { + accept_admin_nomination: {} + } + | { + withdraw_admin_nomination: {} + } + | { + update_config: { + config: Config + } + } + | { + update_snip20_list: { + to_add: string[] + to_remove: string[] + } + } + | { + update_snip721_list: { + to_add: string[] + to_remove: string[] + } + } + | { + update_proposal_modules: { + to_add: ModuleInstantiateInfo[] + to_disable: string[] + } + } + | { + update_voting_module: { + module: ModuleInstantiateInfo + } + } + | { + update_sub_daos: { + to_add: SubDao[] + to_remove: string[] + } + } +export type CosmosMsgForEmpty = + | { + bank: BankMsg + } + | { + custom: Empty + } + | { + staking: StakingMsg + } + | { + distribution: DistributionMsg + } + | { + stargate: { + type_url: string + value: Binary + } + } + | { + ibc: IbcMsg + } + | { + wasm: WasmMsg + } + | { + gov: GovMsg + } + | { + finalize_tx: Empty + } +export type BankMsg = + | { + send: { + amount: Coin[] + to_address: string + } + } + | { + burn: { + amount: Coin[] + } + } +export type StakingMsg = + | { + delegate: { + amount: Coin + validator: string + } + } + | { + undelegate: { + amount: Coin + validator: string + } + } + | { + redelegate: { + amount: Coin + dst_validator: string + src_validator: string + } + } +export type DistributionMsg = + | { + set_withdraw_address: { + address: string + } + } + | { + withdraw_delegator_reward: { + validator: string + } + } +export type IbcMsg = + | { + transfer: { + amount: Coin + channel_id: string + memo: string + timeout: IbcTimeout + to_address: string + } + } + | { + send_packet: { + channel_id: string + data: Binary + timeout: IbcTimeout + } + } + | { + close_channel: { + channel_id: string + } + } +export type Timestamp = Uint64 +export type Uint64 = string +export type WasmMsg = + | { + execute: { + code_hash: string + contract_addr: string + msg: Binary + send: Coin[] + } + } + | { + instantiate: { + admin?: string | null + code_hash: string + code_id: number + label: string + msg: Binary + send: Coin[] + } + } + | { + migrate: { + code_hash: string + code_id: number + contract_addr: string + msg: Binary + } + } + | { + update_admin: { + admin: string + contract_addr: string + } + } + | { + clear_admin: { + contract_addr: string + } + } +export type GovMsg = { + vote: { + proposal_id: number + vote: VoteOption + } +} +export type VoteOption = 'yes' | 'no' | 'abstain' | 'no_with_veto' +export type Duration = + | { + height: number + } + | { + time: number + } +export type Addr = string +export interface Empty {} +export interface IbcTimeout { + block?: IbcTimeoutBlock | null + timestamp?: Timestamp | null +} +export interface IbcTimeoutBlock { + height: number + revision: number +} +export interface Snip20ReceiveMsg { + amount: Uint128 + from: Addr + memo?: string | null + msg?: Binary | null + sender: Addr +} +export interface Config { + dao_uri?: string | null + description: string + image_url?: string | null + name: string + snip20_code_hash: string + snip721_code_hash: string +} +export interface SubDao { + addr: string + charter?: string | null + code_hash: string +} +export type QueryMsg = + | { + admin: {} + } + | { + admin_nomination: {} + } + | { + config: {} + } + | { + cw20_balances: { + limit?: number | null + start_after?: string | null + } + } + | { + cw20_token_list: { + limit?: number | null + start_after?: string | null + } + } + | { + cw721_token_list: { + limit?: number | null + start_after?: string | null + } + } + | { + dump_state: {} + } + | { + get_item: { + key: string + } + } + | { + list_items: { + limit?: number | null + start_after?: string | null + } + } + | { + info: {} + } + | { + proposal_modules: { + limit?: number | null + start_after?: string | null + } + } + | { + active_proposal_modules: { + limit?: number | null + start_after?: string | null + } + } + | { + proposal_module_count: {} + } + | { + pause_info: {} + } + | { + voting_module: {} + } + | { + list_sub_daos: { + limit?: number | null + start_after?: string | null + } + } + | { + dao_u_r_i: {} + } + | { + voting_power_at_height: { + auth: Auth + height?: number | null + } + } + | { + total_power_at_height: { + height?: number | null + } + } +export type Auth = + | { + viewing_key: { + address: string + key: string + } + } + | { + permit: PermitForPermitData + } +export interface PermitForPermitData { + account_number?: Uint128 | null + chain_id?: string | null + memo?: string | null + params: PermitData + sequence?: Uint128 | null + signature: PermitSignature +} +export interface PermitData { + data: Binary + key: string +} +export interface PermitSignature { + pub_key: PubKey + signature: Binary +} +export interface PubKey { + type: string + value: Binary +} +export type MigrateMsg = + | { + from_v1: { + dao_uri?: string | null + params?: MigrateParams | null + } + } + | { + from_compatible: {} + } +export type PreProposeInfo = + | { + anyone_may_propose: {} + } + | { + module_may_propose: { + info: ModuleInstantiateInfo + } + } +export interface MigrateParams { + migrator_code_id: number + params: MigrateV1ToV2 +} +export interface MigrateV1ToV2 { + migration_params: MigrationModuleParams + sub_daos: SubDao[] + v1_code_ids_and_hashes: V1CodeIdsAndHashes + v2_code_ids_and_hashes: V2CodeIdsAndHashes +} +export interface MigrationModuleParams { + migrate_stake_snip20_manager?: boolean | null + proposal_params: [string, ProposalParams][] +} +export interface ProposalParams { + close_proposal_on_execution_failure: boolean + pre_propose_info: PreProposeInfo +} +export interface V1CodeIdsAndHashes { + cw4_voting: number + cw4_voting_code_hash: string + proposal_single: number + proposal_single_code_hash: string + snip20_stake: number + snip20_stake_code_hash: string + snip20_staked_balances_code_hash: string + snip20_staked_balances_voting: number +} +export interface V2CodeIdsAndHashes { + cw4_voting: number + cw4_voting_code_hash: string + proposal_single: number + proposal_single_code_hash: string + snip20_stake: number + snip20_stake_code_hash: string + snip20_staked_balances_code_hash: string + snip20_staked_balances_voting: number +} +export type ProposalModuleStatus = 'enabled' | 'disabled' +export type ArrayOfProposalModule = ProposalModule[] +export interface ProposalModule { + address: Addr + code_hash: string + prefix: string + status: ProposalModuleStatus +} +export interface AdminNominationResponse { + nomination?: Addr | null +} +export type ArrayOfSnip20BalanceResponse = Snip20BalanceResponse[] +export interface Snip20BalanceResponse { + addr: string + balance: Uint128 +} +export type ArrayOfAddr = Addr[] +export interface DaoURIResponse { + dao_uri?: string | null +} +export type PauseInfoResponse = + | { + paused: { + expiration: Expiration + } + } + | { + unpaused: {} + } +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export interface DumpStateResponse { + active_proposal_module_count: number + admin: Addr + config: Config + pause_info: PauseInfoResponse + proposal_modules: ProposalModule[] + total_proposal_module_count: number + version: ContractVersion + voting_module: Addr + voting_module_code_hash: string +} +export interface ContractVersion { + contract: string + version: string +} +export interface GetItemResponse { + item?: string | null +} +export interface InfoResponse { + info: ContractVersion +} +export type ArrayOfTupleOfStringAndString = [string, string][] +export type ArrayOfSubDao = SubDao[] +export interface ProposalModuleCountResponse { + active_proposal_module_count: number + total_proposal_module_count: number +} +export interface TotalPowerAtHeightResponse { + height: number + power: Uint128 +} +export interface VotingModuleInfo { + addr: Addr + code_hash: string +} +export interface VotingPowerAtHeightResponse { + height: number + power: Uint128 +} diff --git a/packages/types/contracts/SecretDaoPreProposeApprovalSingle.ts b/packages/types/contracts/SecretDaoPreProposeApprovalSingle.ts new file mode 100644 index 000000000..cb81a71aa --- /dev/null +++ b/packages/types/contracts/SecretDaoPreProposeApprovalSingle.ts @@ -0,0 +1,424 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +export type Uint128 = string +export type DepositToken = + | { + token: { + denom: UncheckedDenom + } + } + | { + voting_module_token: { + token_type: VotingModuleTokenType + } + } +export type UncheckedDenom = + | { + native: string + } + | { + snip20: [string, string] + } +export type VotingModuleTokenType = 'native' | 'cw20' +export type DepositRefundPolicy = 'always' | 'only_passed' | 'never' +export interface InstantiateMsg { + deposit_info?: UncheckedDepositInfo | null + extension: InstantiateExt + open_proposal_submission: boolean + proposal_module_code_hash: string +} +export interface UncheckedDepositInfo { + amount: Uint128 + denom: DepositToken + refund_policy: DepositRefundPolicy +} +export interface InstantiateExt { + approver: string +} +export type ExecuteMsg = + | { + propose: { + auth: Auth + msg: ProposeMessage + } + } + | { + update_config: { + deposit_info?: UncheckedDepositInfo | null + open_proposal_submission: boolean + } + } + | { + withdraw: { + denom?: UncheckedDenom | null + key?: string | null + } + } + | { + extension: { + msg: ExecuteExt + } + } + | { + add_proposal_submitted_hook: { + address: string + code_hash: string + } + } + | { + remove_proposal_submitted_hook: { + address: string + code_hash: string + } + } + | { + proposal_completed_hook: { + new_status: Status + proposal_id: number + } + } +export type Auth = + | { + viewing_key: { + address: string + key: string + } + } + | { + permit: PermitForPermitData + } +export type Binary = string +export type ProposeMessage = { + propose: { + description: string + msgs: CosmosMsgForEmpty[] + title: string + } +} +export type CosmosMsgForEmpty = + | { + bank: BankMsg + } + | { + custom: Empty + } + | { + staking: StakingMsg + } + | { + distribution: DistributionMsg + } + | { + stargate: { + type_url: string + value: Binary + } + } + | { + ibc: IbcMsg + } + | { + wasm: WasmMsg + } + | { + gov: GovMsg + } + | { + finalize_tx: Empty + } +export type BankMsg = + | { + send: { + amount: Coin[] + to_address: string + } + } + | { + burn: { + amount: Coin[] + } + } +export type StakingMsg = + | { + delegate: { + amount: Coin + validator: string + } + } + | { + undelegate: { + amount: Coin + validator: string + } + } + | { + redelegate: { + amount: Coin + dst_validator: string + src_validator: string + } + } +export type DistributionMsg = + | { + set_withdraw_address: { + address: string + } + } + | { + withdraw_delegator_reward: { + validator: string + } + } +export type IbcMsg = + | { + transfer: { + amount: Coin + channel_id: string + memo: string + timeout: IbcTimeout + to_address: string + } + } + | { + send_packet: { + channel_id: string + data: Binary + timeout: IbcTimeout + } + } + | { + close_channel: { + channel_id: string + } + } +export type Timestamp = Uint64 +export type Uint64 = string +export type WasmMsg = + | { + execute: { + code_hash: string + contract_addr: string + msg: Binary + send: Coin[] + } + } + | { + instantiate: { + admin?: string | null + code_hash: string + code_id: number + label: string + msg: Binary + send: Coin[] + } + } + | { + migrate: { + code_hash: string + code_id: number + contract_addr: string + msg: Binary + } + } + | { + update_admin: { + admin: string + contract_addr: string + } + } + | { + clear_admin: { + contract_addr: string + } + } +export type GovMsg = { + vote: { + proposal_id: number + vote: VoteOption + } +} +export type VoteOption = 'yes' | 'no' | 'abstain' | 'no_with_veto' +export type ExecuteExt = + | { + approve: { + id: number + } + } + | { + reject: { + id: number + } + } + | { + update_approver: { + address: string + } + } +export type Status = + | 'open' + | 'rejected' + | 'passed' + | 'executed' + | 'closed' + | 'execution_failed' + | { + veto_timelock: { + expiration: Expiration + } + } + | 'vetoed' +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export interface PermitForPermitData { + account_number?: Uint128 | null + chain_id?: string | null + memo?: string | null + params: PermitData + sequence?: Uint128 | null + signature: PermitSignature +} +export interface PermitData { + data: Binary + key: string +} +export interface PermitSignature { + pub_key: PubKey + signature: Binary +} +export interface PubKey { + type: string + value: Binary +} +export interface Coin { + amount: Uint128 + denom: string +} +export interface Empty {} +export interface IbcTimeout { + block?: IbcTimeoutBlock | null + timestamp?: Timestamp | null +} +export interface IbcTimeoutBlock { + height: number + revision: number +} +export type QueryMsg = + | { + proposal_module: {} + } + | { + dao: {} + } + | { + config: {} + } + | { + deposit_info: { + proposal_id: number + } + } + | { + proposal_submitted_hooks: {} + } + | { + query_extension: { + msg: QueryExt + } + } +export type QueryExt = + | { + approver: {} + } + | { + is_pending: { + id: number + } + } + | { + proposal: { + id: number + } + } + | { + pending_proposal: { + id: number + } + } + | { + pending_proposals: { + limit?: number | null + start_after?: number | null + } + } + | { + reverse_pending_proposals: { + limit?: number | null + start_before?: number | null + } + } + | { + completed_proposal: { + id: number + } + } + | { + completed_proposals: { + limit?: number | null + start_after?: number | null + } + } + | { + reverse_completed_proposals: { + limit?: number | null + start_before?: number | null + } + } + | { + completed_proposal_id_for_created_proposal_id: { + id: number + } + } +export type CheckedDenom = + | { + native: string + } + | { + snip20: [Addr, string] + } +export type Addr = string +export interface Config { + deposit_info?: CheckedDepositInfo | null + open_proposal_submission: boolean +} +export interface CheckedDepositInfo { + amount: Uint128 + denom: CheckedDenom + refund_policy: DepositRefundPolicy +} +export interface AnyContractInfo { + addr: Addr + code_hash: string +} +export interface DepositInfoResponse { + deposit_info?: CheckedDepositInfo | null + proposer: Addr +} +export interface HooksResponse { + hooks: HookItem[] +} +export interface HookItem { + addr: Addr + code_hash: string +} diff --git a/packages/types/contracts/SecretDaoPreProposeMultiple.ts b/packages/types/contracts/SecretDaoPreProposeMultiple.ts new file mode 100644 index 000000000..48d1c2dcc --- /dev/null +++ b/packages/types/contracts/SecretDaoPreProposeMultiple.ts @@ -0,0 +1,360 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +export type Uint128 = string +export type DepositToken = + | { + token: { + denom: UncheckedDenom + } + } + | { + voting_module_token: { + token_type: VotingModuleTokenType + } + } +export type UncheckedDenom = + | { + native: string + } + | { + snip20: [string, string] + } +export type VotingModuleTokenType = 'native' | 'cw20' +export type DepositRefundPolicy = 'always' | 'only_passed' | 'never' +export interface InstantiateMsg { + deposit_info?: UncheckedDepositInfo | null + extension: Empty + open_proposal_submission: boolean + proposal_module_code_hash: string +} +export interface UncheckedDepositInfo { + amount: Uint128 + denom: DepositToken + refund_policy: DepositRefundPolicy +} +export interface Empty {} +export type ExecuteMsg = + | { + propose: { + auth: Auth + msg: ProposeMessage + } + } + | { + update_config: { + deposit_info?: UncheckedDepositInfo | null + open_proposal_submission: boolean + } + } + | { + withdraw: { + denom?: UncheckedDenom | null + key?: string | null + } + } + | { + extension: { + msg: Empty + } + } + | { + add_proposal_submitted_hook: { + address: string + code_hash: string + } + } + | { + remove_proposal_submitted_hook: { + address: string + code_hash: string + } + } + | { + proposal_completed_hook: { + new_status: Status + proposal_id: number + } + } +export type Auth = + | { + viewing_key: { + address: string + key: string + } + } + | { + permit: PermitForPermitData + } +export type Binary = string +export type ProposeMessage = { + propose: { + choices: MultipleChoiceOptions + description: string + title: string + } +} +export type CosmosMsgForEmpty = + | { + bank: BankMsg + } + | { + custom: Empty + } + | { + staking: StakingMsg + } + | { + distribution: DistributionMsg + } + | { + stargate: { + type_url: string + value: Binary + } + } + | { + ibc: IbcMsg + } + | { + wasm: WasmMsg + } + | { + gov: GovMsg + } + | { + finalize_tx: Empty + } +export type BankMsg = + | { + send: { + amount: Coin[] + to_address: string + } + } + | { + burn: { + amount: Coin[] + } + } +export type StakingMsg = + | { + delegate: { + amount: Coin + validator: string + } + } + | { + undelegate: { + amount: Coin + validator: string + } + } + | { + redelegate: { + amount: Coin + dst_validator: string + src_validator: string + } + } +export type DistributionMsg = + | { + set_withdraw_address: { + address: string + } + } + | { + withdraw_delegator_reward: { + validator: string + } + } +export type IbcMsg = + | { + transfer: { + amount: Coin + channel_id: string + memo: string + timeout: IbcTimeout + to_address: string + } + } + | { + send_packet: { + channel_id: string + data: Binary + timeout: IbcTimeout + } + } + | { + close_channel: { + channel_id: string + } + } +export type Timestamp = Uint64 +export type Uint64 = string +export type WasmMsg = + | { + execute: { + code_hash: string + contract_addr: string + msg: Binary + send: Coin[] + } + } + | { + instantiate: { + admin?: string | null + code_hash: string + code_id: number + label: string + msg: Binary + send: Coin[] + } + } + | { + migrate: { + code_hash: string + code_id: number + contract_addr: string + msg: Binary + } + } + | { + update_admin: { + admin: string + contract_addr: string + } + } + | { + clear_admin: { + contract_addr: string + } + } +export type GovMsg = { + vote: { + proposal_id: number + vote: VoteOption + } +} +export type VoteOption = 'yes' | 'no' | 'abstain' | 'no_with_veto' +export type Status = + | 'open' + | 'rejected' + | 'passed' + | 'executed' + | 'closed' + | 'execution_failed' + | { + veto_timelock: { + expiration: Expiration + } + } + | 'vetoed' +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export interface PermitForPermitData { + account_number?: Uint128 | null + chain_id?: string | null + memo?: string | null + params: PermitData + sequence?: Uint128 | null + signature: PermitSignature +} +export interface PermitData { + data: Binary + key: string +} +export interface PermitSignature { + pub_key: PubKey + signature: Binary +} +export interface PubKey { + type: string + value: Binary +} +export interface MultipleChoiceOptions { + options: MultipleChoiceOption[] +} +export interface MultipleChoiceOption { + description: string + msgs: CosmosMsgForEmpty[] + title: string +} +export interface Coin { + amount: Uint128 + denom: string +} +export interface IbcTimeout { + block?: IbcTimeoutBlock | null + timestamp?: Timestamp | null +} +export interface IbcTimeoutBlock { + height: number + revision: number +} +export type QueryMsg = + | { + proposal_module: {} + } + | { + dao: {} + } + | { + config: {} + } + | { + deposit_info: { + proposal_id: number + } + } + | { + proposal_submitted_hooks: {} + } + | { + query_extension: { + msg: Empty + } + } +export type CheckedDenom = + | { + native: string + } + | { + snip20: [Addr, string] + } +export type Addr = string +export interface Config { + deposit_info?: CheckedDepositInfo | null + open_proposal_submission: boolean +} +export interface CheckedDepositInfo { + amount: Uint128 + denom: CheckedDenom + refund_policy: DepositRefundPolicy +} +export interface AnyContractInfo { + addr: Addr + code_hash: string +} +export interface DepositInfoResponse { + deposit_info?: CheckedDepositInfo | null + proposer: Addr +} +export interface HooksResponse { + hooks: HookItem[] +} +export interface HookItem { + addr: Addr + code_hash: string +} diff --git a/packages/types/contracts/SecretDaoPreProposeSingle.ts b/packages/types/contracts/SecretDaoPreProposeSingle.ts new file mode 100644 index 000000000..31eeae5c3 --- /dev/null +++ b/packages/types/contracts/SecretDaoPreProposeSingle.ts @@ -0,0 +1,352 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +export type Uint128 = string +export type DepositToken = + | { + token: { + denom: UncheckedDenom + } + } + | { + voting_module_token: { + token_type: VotingModuleTokenType + } + } +export type UncheckedDenom = + | { + native: string + } + | { + snip20: [string, string] + } +export type VotingModuleTokenType = 'native' | 'cw20' +export type DepositRefundPolicy = 'always' | 'only_passed' | 'never' +export interface InstantiateMsg { + deposit_info?: UncheckedDepositInfo | null + extension: Empty + open_proposal_submission: boolean + proposal_module_code_hash: string +} +export interface UncheckedDepositInfo { + amount: Uint128 + denom: DepositToken + refund_policy: DepositRefundPolicy +} +export interface Empty {} +export type ExecuteMsg = + | { + propose: { + auth: Auth + msg: ProposeMessage + } + } + | { + update_config: { + deposit_info?: UncheckedDepositInfo | null + open_proposal_submission: boolean + } + } + | { + withdraw: { + denom?: UncheckedDenom | null + key?: string | null + } + } + | { + extension: { + msg: Empty + } + } + | { + add_proposal_submitted_hook: { + address: string + code_hash: string + } + } + | { + remove_proposal_submitted_hook: { + address: string + code_hash: string + } + } + | { + proposal_completed_hook: { + new_status: Status + proposal_id: number + } + } +export type Auth = + | { + viewing_key: { + address: string + key: string + } + } + | { + permit: PermitForPermitData + } +export type Binary = string +export type ProposeMessage = { + propose: { + description: string + msgs: CosmosMsgForEmpty[] + title: string + } +} +export type CosmosMsgForEmpty = + | { + bank: BankMsg + } + | { + custom: Empty + } + | { + staking: StakingMsg + } + | { + distribution: DistributionMsg + } + | { + stargate: { + type_url: string + value: Binary + } + } + | { + ibc: IbcMsg + } + | { + wasm: WasmMsg + } + | { + gov: GovMsg + } + | { + finalize_tx: Empty + } +export type BankMsg = + | { + send: { + amount: Coin[] + to_address: string + } + } + | { + burn: { + amount: Coin[] + } + } +export type StakingMsg = + | { + delegate: { + amount: Coin + validator: string + } + } + | { + undelegate: { + amount: Coin + validator: string + } + } + | { + redelegate: { + amount: Coin + dst_validator: string + src_validator: string + } + } +export type DistributionMsg = + | { + set_withdraw_address: { + address: string + } + } + | { + withdraw_delegator_reward: { + validator: string + } + } +export type IbcMsg = + | { + transfer: { + amount: Coin + channel_id: string + memo: string + timeout: IbcTimeout + to_address: string + } + } + | { + send_packet: { + channel_id: string + data: Binary + timeout: IbcTimeout + } + } + | { + close_channel: { + channel_id: string + } + } +export type Timestamp = Uint64 +export type Uint64 = string +export type WasmMsg = + | { + execute: { + code_hash: string + contract_addr: string + msg: Binary + send: Coin[] + } + } + | { + instantiate: { + admin?: string | null + code_hash: string + code_id: number + label: string + msg: Binary + send: Coin[] + } + } + | { + migrate: { + code_hash: string + code_id: number + contract_addr: string + msg: Binary + } + } + | { + update_admin: { + admin: string + contract_addr: string + } + } + | { + clear_admin: { + contract_addr: string + } + } +export type GovMsg = { + vote: { + proposal_id: number + vote: VoteOption + } +} +export type VoteOption = 'yes' | 'no' | 'abstain' | 'no_with_veto' +export type Status = + | 'open' + | 'rejected' + | 'passed' + | 'executed' + | 'closed' + | 'execution_failed' + | { + veto_timelock: { + expiration: Expiration + } + } + | 'vetoed' +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export interface PermitForPermitData { + account_number?: Uint128 | null + chain_id?: string | null + memo?: string | null + params: PermitData + sequence?: Uint128 | null + signature: PermitSignature +} +export interface PermitData { + data: Binary + key: string +} +export interface PermitSignature { + pub_key: PubKey + signature: Binary +} +export interface PubKey { + type: string + value: Binary +} +export interface Coin { + amount: Uint128 + denom: string +} +export interface IbcTimeout { + block?: IbcTimeoutBlock | null + timestamp?: Timestamp | null +} +export interface IbcTimeoutBlock { + height: number + revision: number +} +export type QueryMsg = + | { + proposal_module: {} + } + | { + dao: {} + } + | { + config: {} + } + | { + deposit_info: { + proposal_id: number + } + } + | { + proposal_submitted_hooks: {} + } + | { + query_extension: { + msg: Empty + } + } +export type CheckedDenom = + | { + native: string + } + | { + snip20: [Addr, string] + } +export type Addr = string +export interface Config { + deposit_info?: CheckedDepositInfo | null + open_proposal_submission: boolean +} +export interface CheckedDepositInfo { + amount: Uint128 + denom: CheckedDenom + refund_policy: DepositRefundPolicy +} +export interface AnyContractInfo { + addr: Addr + code_hash: string +} +export interface DepositInfoResponse { + deposit_info?: CheckedDepositInfo | null + proposer: Addr +} +export interface HooksResponse { + hooks: HookItem[] +} +export interface HookItem { + addr: Addr + code_hash: string +} diff --git a/packages/types/contracts/SecretDaoProposalMultiple.ts b/packages/types/contracts/SecretDaoProposalMultiple.ts new file mode 100644 index 000000000..05c7505d2 --- /dev/null +++ b/packages/types/contracts/SecretDaoProposalMultiple.ts @@ -0,0 +1,532 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +export type Duration = + | { + height: number + } + | { + time: number + } +export type PreProposeInfo = + | { + anyone_may_propose: {} + } + | { + module_may_propose: { + info: ModuleInstantiateInfo + } + } +export type Admin = + | { + address: { + addr: string + } + } + | { + core_module: {} + } +export type Uint128 = string +export type Binary = string +export type VotingStrategy = { + single_choice: { + quorum: PercentageThreshold + } +} +export type PercentageThreshold = + | { + majority: {} + } + | { + percent: Decimal + } +export type Decimal = string +export interface InstantiateMsg { + allow_revoting: boolean + close_proposal_on_execution_failure: boolean + dao_code_hash: string + max_voting_period: Duration + min_voting_period?: Duration | null + only_members_execute: boolean + pre_propose_info: PreProposeInfo + query_auth?: RawContract | null + veto?: VetoConfig | null + voting_strategy: VotingStrategy +} +export interface ModuleInstantiateInfo { + admin?: Admin | null + code_hash: string + code_id: number + funds: Coin[] + label: string + msg: Binary +} +export interface Coin { + amount: Uint128 + denom: string +} +export interface RawContract { + address: string + code_hash: string +} +export interface VetoConfig { + early_execute: boolean + timelock_duration: Duration + veto_before_passed: boolean + vetoer: string +} +export type ExecuteMsg = + | { + propose: { + choices: MultipleChoiceOptions + description: string + proposer?: string | null + title: string + } + } + | { + vote: { + auth: Auth + proposal_id: number + rationale?: string | null + vote: MultipleChoiceVote + } + } + | { + execute: { + auth: Auth + proposal_id: number + } + } + | { + veto: { + proposal_id: number + } + } + | { + close: { + proposal_id: number + } + } + | { + update_config: { + allow_revoting: boolean + close_proposal_on_execution_failure: boolean + max_voting_period: Duration + min_voting_period?: Duration | null + only_members_execute: boolean + veto?: VetoConfig | null + voting_strategy: VotingStrategy + } + } + | { + update_rationale: { + proposal_id: number + rationale?: string | null + } + } + | { + update_pre_propose_info: { + info: PreProposeInfo + } + } + | { + add_proposal_hook: { + address: string + code_hash: string + } + } + | { + remove_proposal_hook: { + address: string + code_hash: string + } + } + | { + add_vote_hook: { + address: string + code_hash: string + } + } + | { + remove_vote_hook: { + address: string + code_hash: string + } + } + | { + update_dao_info: { + address: Addr + code_hash: string + } + } +export type CosmosMsgForEmpty = + | { + bank: BankMsg + } + | { + custom: Empty + } + | { + staking: StakingMsg + } + | { + distribution: DistributionMsg + } + | { + stargate: { + type_url: string + value: Binary + } + } + | { + ibc: IbcMsg + } + | { + wasm: WasmMsg + } + | { + gov: GovMsg + } + | { + finalize_tx: Empty + } +export type BankMsg = + | { + send: { + amount: Coin[] + to_address: string + } + } + | { + burn: { + amount: Coin[] + } + } +export type StakingMsg = + | { + delegate: { + amount: Coin + validator: string + } + } + | { + undelegate: { + amount: Coin + validator: string + } + } + | { + redelegate: { + amount: Coin + dst_validator: string + src_validator: string + } + } +export type DistributionMsg = + | { + set_withdraw_address: { + address: string + } + } + | { + withdraw_delegator_reward: { + validator: string + } + } +export type IbcMsg = + | { + transfer: { + amount: Coin + channel_id: string + memo: string + timeout: IbcTimeout + to_address: string + } + } + | { + send_packet: { + channel_id: string + data: Binary + timeout: IbcTimeout + } + } + | { + close_channel: { + channel_id: string + } + } +export type Timestamp = Uint64 +export type Uint64 = string +export type WasmMsg = + | { + execute: { + code_hash: string + contract_addr: string + msg: Binary + send: Coin[] + } + } + | { + instantiate: { + admin?: string | null + code_hash: string + code_id: number + label: string + msg: Binary + send: Coin[] + } + } + | { + migrate: { + code_hash: string + code_id: number + contract_addr: string + msg: Binary + } + } + | { + update_admin: { + admin: string + contract_addr: string + } + } + | { + clear_admin: { + contract_addr: string + } + } +export type GovMsg = { + vote: { + proposal_id: number + vote: VoteOption + } +} +export type VoteOption = 'yes' | 'no' | 'abstain' | 'no_with_veto' +export type Auth = + | { + viewing_key: { + address: string + key: string + } + } + | { + permit: PermitForPermitData + } +export type Addr = string +export interface MultipleChoiceOptions { + options: MultipleChoiceOption[] +} +export interface MultipleChoiceOption { + description: string + msgs: CosmosMsgForEmpty[] + title: string +} +export interface Empty {} +export interface IbcTimeout { + block?: IbcTimeoutBlock | null + timestamp?: Timestamp | null +} +export interface IbcTimeoutBlock { + height: number + revision: number +} +export interface PermitForPermitData { + account_number?: Uint128 | null + chain_id?: string | null + memo?: string | null + params: PermitData + sequence?: Uint128 | null + signature: PermitSignature +} +export interface PermitData { + data: Binary + key: string +} +export interface PermitSignature { + pub_key: PubKey + signature: Binary +} +export interface PubKey { + type: string + value: Binary +} +export interface MultipleChoiceVote { + option_id: number +} +export type QueryMsg = + | { + config: {} + } + | { + proposal: { + proposal_id: number + } + } + | { + list_proposals: { + limit?: number | null + start_after?: number | null + } + } + | { + reverse_proposals: { + limit?: number | null + start_before?: number | null + } + } + | { + get_vote: { + auth: Auth + proposal_id: number + } + } + | { + list_votes: { + limit?: number | null + proposal_id: number + start_after?: string | null + } + } + | { + proposal_count: {} + } + | { + proposal_creation_policy: {} + } + | { + proposal_hooks: {} + } + | { + vote_hooks: {} + } + | { + dao: {} + } + | { + info: {} + } + | { + next_proposal_id: {} + } +export type MigrateMsg = + | { + from_v1: { + close_proposal_on_execution_failure: boolean + pre_propose_info: PreProposeInfo + veto?: VetoConfig | null + } + } + | { + from_compatible: {} + } +export interface Config { + allow_revoting: boolean + close_proposal_on_execution_failure: boolean + max_voting_period: Duration + min_voting_period?: Duration | null + only_members_execute: boolean + query_auth: Contract + veto?: VetoConfig | null + voting_strategy: VotingStrategy +} +export interface Contract { + address: Addr + code_hash: string +} +export interface VoteResponse { + vote?: VoteInfo | null +} +export interface VoteInfo { + power: Uint128 + rationale?: string | null + vote: MultipleChoiceVote + voter: Addr +} +export interface InfoResponse { + info: ContractVersion +} +export interface ContractVersion { + contract: string + version: string +} +export type MultipleChoiceOptionType = 'standard' | 'none' +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export type Status = + | 'open' + | 'rejected' + | 'passed' + | 'executed' + | 'closed' + | 'execution_failed' + | { + veto_timelock: { + expiration: Expiration + } + } + | 'vetoed' +export interface ProposalListResponse { + proposals: ProposalResponse[] +} +export interface ProposalResponse { + id: number + proposal: MultipleChoiceProposal +} +export interface MultipleChoiceProposal { + allow_revoting: boolean + choices: CheckedMultipleChoiceOption[] + description: string + expiration: Expiration + min_voting_period?: Expiration | null + proposer: Addr + start_height: number + status: Status + title: string + total_power: Uint128 + veto?: VetoConfig | null + votes: MultipleChoiceVotes + voting_strategy: VotingStrategy +} +export interface CheckedMultipleChoiceOption { + description: string + index: number + msgs: CosmosMsgForEmpty[] + option_type: MultipleChoiceOptionType + title: string + vote_count: Uint128 +} +export interface MultipleChoiceVotes { + vote_weights: Uint128[] +} +export interface VoteListResponse { + votes: VoteInfo[] +} +export type ProposalCreationPolicy = + | { + anyone: {} + } + | { + module: { + addr: Addr + code_hash: string + } + } +export interface HooksResponse { + hooks: HookItem[] +} +export interface HookItem { + addr: Addr + code_hash: string +} diff --git a/packages/types/contracts/SecretDaoProposalSingle.ts b/packages/types/contracts/SecretDaoProposalSingle.ts new file mode 100644 index 000000000..b0f32aeb0 --- /dev/null +++ b/packages/types/contracts/SecretDaoProposalSingle.ts @@ -0,0 +1,528 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +export type Duration = + | { + height: number + } + | { + time: number + } +export type PreProposeInfo = + | { + anyone_may_propose: {} + } + | { + module_may_propose: { + info: ModuleInstantiateInfo + } + } +export type Admin = + | { + address: { + addr: string + } + } + | { + core_module: {} + } +export type Uint128 = string +export type Binary = string +export type Threshold = + | { + absolute_percentage: { + percentage: PercentageThreshold + } + } + | { + threshold_quorum: { + quorum: PercentageThreshold + threshold: PercentageThreshold + } + } + | { + absolute_count: { + threshold: Uint128 + } + } +export type PercentageThreshold = + | { + majority: {} + } + | { + percent: Decimal + } +export type Decimal = string +export interface InstantiateMsg { + allow_revoting: boolean + close_proposal_on_execution_failure: boolean + dao_code_hash: string + max_voting_period: Duration + min_voting_period?: Duration | null + only_members_execute: boolean + pre_propose_info: PreProposeInfo + query_auth?: RawContract | null + threshold: Threshold + veto?: VetoConfig | null +} +export interface ModuleInstantiateInfo { + admin?: Admin | null + code_hash: string + code_id: number + funds: Coin[] + label: string + msg: Binary +} +export interface Coin { + amount: Uint128 + denom: string +} +export interface RawContract { + address: string + code_hash: string +} +export interface VetoConfig { + early_execute: boolean + timelock_duration: Duration + veto_before_passed: boolean + vetoer: string +} +export type ExecuteMsg = + | { + propose: SingleChoiceProposeMsg + } + | { + vote: { + auth: Auth + proposal_id: number + rationale?: string | null + vote: Vote + } + } + | { + update_rationale: { + proposal_id: number + rationale?: string | null + } + } + | { + execute: { + auth: Auth + proposal_id: number + } + } + | { + veto: { + proposal_id: number + } + } + | { + close: { + proposal_id: number + } + } + | { + update_config: { + allow_revoting: boolean + close_proposal_on_execution_failure: boolean + max_voting_period: Duration + min_voting_period?: Duration | null + only_members_execute: boolean + threshold: Threshold + veto?: VetoConfig | null + } + } + | { + update_pre_propose_info: { + info: PreProposeInfo + } + } + | { + add_proposal_hook: { + address: string + code_hash: string + } + } + | { + remove_proposal_hook: { + address: string + code_hash: string + } + } + | { + add_vote_hook: { + address: string + code_hash: string + } + } + | { + remove_vote_hook: { + address: string + code_hash: string + } + } + | { + update_dao_info: { + address: Addr + code_hash: string + } + } +export type CosmosMsgForEmpty = + | { + bank: BankMsg + } + | { + custom: Empty + } + | { + staking: StakingMsg + } + | { + distribution: DistributionMsg + } + | { + stargate: { + type_url: string + value: Binary + } + } + | { + ibc: IbcMsg + } + | { + wasm: WasmMsg + } + | { + gov: GovMsg + } + | { + finalize_tx: Empty + } +export type BankMsg = + | { + send: { + amount: Coin[] + to_address: string + } + } + | { + burn: { + amount: Coin[] + } + } +export type StakingMsg = + | { + delegate: { + amount: Coin + validator: string + } + } + | { + undelegate: { + amount: Coin + validator: string + } + } + | { + redelegate: { + amount: Coin + dst_validator: string + src_validator: string + } + } +export type DistributionMsg = + | { + set_withdraw_address: { + address: string + } + } + | { + withdraw_delegator_reward: { + validator: string + } + } +export type IbcMsg = + | { + transfer: { + amount: Coin + channel_id: string + memo: string + timeout: IbcTimeout + to_address: string + } + } + | { + send_packet: { + channel_id: string + data: Binary + timeout: IbcTimeout + } + } + | { + close_channel: { + channel_id: string + } + } +export type Timestamp = Uint64 +export type Uint64 = string +export type WasmMsg = + | { + execute: { + code_hash: string + contract_addr: string + msg: Binary + send: Coin[] + } + } + | { + instantiate: { + admin?: string | null + code_hash: string + code_id: number + label: string + msg: Binary + send: Coin[] + } + } + | { + migrate: { + code_hash: string + code_id: number + contract_addr: string + msg: Binary + } + } + | { + update_admin: { + admin: string + contract_addr: string + } + } + | { + clear_admin: { + contract_addr: string + } + } +export type GovMsg = { + vote: { + proposal_id: number + vote: VoteOption + } +} +export type VoteOption = 'yes' | 'no' | 'abstain' | 'no_with_veto' +export type Auth = + | { + viewing_key: { + address: string + key: string + } + } + | { + permit: PermitForPermitData + } +export type Vote = 'yes' | 'no' | 'abstain' +export type Addr = string +export interface SingleChoiceProposeMsg { + description: string + msgs: CosmosMsgForEmpty[] + proposer?: string | null + title: string +} +export interface Empty {} +export interface IbcTimeout { + block?: IbcTimeoutBlock | null + timestamp?: Timestamp | null +} +export interface IbcTimeoutBlock { + height: number + revision: number +} +export interface PermitForPermitData { + account_number?: Uint128 | null + chain_id?: string | null + memo?: string | null + params: PermitData + sequence?: Uint128 | null + signature: PermitSignature +} +export interface PermitData { + data: Binary + key: string +} +export interface PermitSignature { + pub_key: PubKey + signature: Binary +} +export interface PubKey { + type: string + value: Binary +} +export type QueryMsg = + | { + config: {} + } + | { + proposal: { + proposal_id: number + } + } + | { + list_proposals: { + limit?: number | null + start_after?: number | null + } + } + | { + reverse_proposals: { + limit?: number | null + start_before?: number | null + } + } + | { + get_vote: { + auth: Auth + proposal_id: number + } + } + | { + list_votes: { + limit?: number | null + proposal_id: number + start_after?: string | null + } + } + | { + proposal_count: {} + } + | { + proposal_creation_policy: {} + } + | { + proposal_hooks: {} + } + | { + vote_hooks: {} + } + | { + dao: {} + } + | { + info: {} + } + | { + next_proposal_id: {} + } +export type MigrateMsg = + | { + from_v1: { + close_proposal_on_execution_failure: boolean + pre_propose_info: PreProposeInfo + veto?: VetoConfig | null + } + } + | { + from_compatible: {} + } +export interface Config { + allow_revoting: boolean + close_proposal_on_execution_failure: boolean + max_voting_period: Duration + min_voting_period?: Duration | null + only_members_execute: boolean + query_auth: Contract + threshold: Threshold + veto?: VetoConfig | null +} +export interface Contract { + address: Addr + code_hash: string +} +export interface VoteResponse { + vote?: VoteInfo | null +} +export interface VoteInfo { + power: Uint128 + rationale?: string | null + vote: Vote + voter: Addr +} +export interface InfoResponse { + info: ContractVersion +} +export interface ContractVersion { + contract: string + version: string +} +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export type Status = + | 'open' + | 'rejected' + | 'passed' + | 'executed' + | 'closed' + | 'execution_failed' + | { + veto_timelock: { + expiration: Expiration + } + } + | 'vetoed' +export interface ProposalListResponse { + proposals: ProposalResponse[] +} +export interface ProposalResponse { + id: number + proposal: SingleChoiceProposal +} +export interface SingleChoiceProposal { + allow_revoting: boolean + description: string + expiration: Expiration + min_voting_period?: Expiration | null + msgs: CosmosMsgForEmpty[] + proposer: Addr + start_height: number + status: Status + threshold: Threshold + title: string + total_power: Uint128 + veto?: VetoConfig | null + votes: Votes +} +export interface Votes { + abstain: Uint128 + no: Uint128 + yes: Uint128 +} +export interface VoteListResponse { + votes: VoteInfo[] +} +export type ProposalCreationPolicy = + | { + anyone: {} + } + | { + module: { + addr: Addr + code_hash: string + } + } +export interface HooksResponse { + hooks: HookItem[] +} +export interface HookItem { + addr: Addr + code_hash: string +} diff --git a/packages/types/contracts/SecretDaoVotingCw4.ts b/packages/types/contracts/SecretDaoVotingCw4.ts new file mode 100644 index 000000000..981bff980 --- /dev/null +++ b/packages/types/contracts/SecretDaoVotingCw4.ts @@ -0,0 +1,108 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +export type GroupContract = + | { + existing: { + address: string + code_hash: string + } + } + | { + new: { + cw4_group_code_hash: string + cw4_group_code_id: number + initial_members: Member[] + query_auth?: RawContract | null + } + } +export interface InstantiateMsg { + dao_code_hash: string + group_contract: GroupContract +} +export interface Member { + addr: string + weight: number +} +export interface RawContract { + address: string + code_hash: string +} +export type ExecuteMsg = string +export type QueryMsg = + | { + group_contract: {} + } + | { + voting_power_at_height: { + auth: Auth + height?: number | null + } + } + | { + total_power_at_height: { + height?: number | null + } + } + | { + dao: {} + } + | { + info: {} + } +export type Auth = + | { + viewing_key: { + address: string + key: string + } + } + | { + permit: PermitForPermitData + } +export type Uint128 = string +export type Binary = string +export interface PermitForPermitData { + account_number?: Uint128 | null + chain_id?: string | null + memo?: string | null + params: PermitData + sequence?: Uint128 | null + signature: PermitSignature +} +export interface PermitData { + data: Binary + key: string +} +export interface PermitSignature { + pub_key: PubKey + signature: Binary +} +export interface PubKey { + type: string + value: Binary +} +export interface MigrateMsg {} +export type Addr = string +export interface AnyContractInfo { + addr: Addr + code_hash: string +} +export interface InfoResponse { + info: ContractVersion +} +export interface ContractVersion { + contract: string + version: string +} +export interface TotalPowerAtHeightResponse { + height: number + power: Uint128 +} +export interface VotingPowerAtHeightResponse { + height: number + power: Uint128 +} diff --git a/packages/types/contracts/SecretDaoVotingSnip20Staked.ts b/packages/types/contracts/SecretDaoVotingSnip20Staked.ts new file mode 100644 index 000000000..bf32cab79 --- /dev/null +++ b/packages/types/contracts/SecretDaoVotingSnip20Staked.ts @@ -0,0 +1,168 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +export type ActiveThreshold = + | { + absolute_count: { + count: Uint128 + } + } + | { + percentage: { + percent: Decimal + } + } +export type Uint128 = string +export type Decimal = string +export type Snip20TokenInfo = + | { + existing: { + address: string + code_hash: string + staking_contract: StakingInfo + } + } + | { + new: { + code_hash: string + code_id: number + decimals: number + initial_balances: InitialBalance[] + initial_dao_balance?: Uint128 | null + name: string + staking_code_hash: string + staking_code_id: number + symbol: string + unstaking_duration?: Duration | null + } + } +export type StakingInfo = + | { + existing: { + staking_contract_address: string + staking_contract_code_hash: string + } + } + | { + new: { + label: string + staking_code_hash: string + staking_code_id: number + unstaking_duration?: Duration | null + } + } +export type Duration = + | { + height: number + } + | { + time: number + } +export interface InstantiateMsg { + active_threshold?: ActiveThreshold | null + dao_code_hash: string + query_auth?: RawContract | null + token_info: Snip20TokenInfo +} +export interface RawContract { + address: string + code_hash: string +} +export interface InitialBalance { + address: string + amount: Uint128 +} +export type ExecuteMsg = { + UpdateActiveThreshold: { + new_threshold?: ActiveThreshold | null + } +} +export type QueryMsg = + | { + staking_contract: {} + } + | { + active_threshold: {} + } + | { + voting_power_at_height: { + auth: Auth + height?: number | null + } + } + | { + total_power_at_height: { + height?: number | null + } + } + | { + dao: {} + } + | { + info: {} + } + | { + token_contract: {} + } + | { + is_active: {} + } +export type Auth = + | { + viewing_key: { + address: string + key: string + } + } + | { + permit: PermitForPermitData + } +export type Binary = string +export interface PermitForPermitData { + account_number?: Uint128 | null + chain_id?: string | null + memo?: string | null + params: PermitData + sequence?: Uint128 | null + signature: PermitSignature +} +export interface PermitData { + data: Binary + key: string +} +export interface PermitSignature { + pub_key: PubKey + signature: Binary +} +export interface PubKey { + type: string + value: Binary +} +export interface MigrateMsg {} +export interface ActiveThresholdResponse { + active_threshold?: ActiveThreshold | null +} +export type Addr = string +export interface AnyContractInfo { + addr: Addr + code_hash: string +} +export interface InfoResponse { + info: ContractVersion +} +export interface ContractVersion { + contract: string + version: string +} +export type Boolean = boolean +export interface TotalPowerAtHeightResponse { + height: number + power: Uint128 +} +export interface VotingPowerAtHeightResponse { + height: number + power: Uint128 +} diff --git a/packages/types/contracts/SecretDaoVotingSnip721Staked.ts b/packages/types/contracts/SecretDaoVotingSnip721Staked.ts new file mode 100644 index 000000000..5420ea0ec --- /dev/null +++ b/packages/types/contracts/SecretDaoVotingSnip721Staked.ts @@ -0,0 +1,226 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +export type ActiveThreshold = + | { + absolute_count: { + count: Uint128 + } + } + | { + percentage: { + percent: Decimal + } + } +export type Uint128 = string +export type Decimal = string +export type NftContract = + | { + existing: { + address: string + code_hash: string + } + } + | { + new: { + code_hash: string + code_id: number + initial_nfts: Binary[] + label: string + msg: Binary + } + } + | { + factory: Binary + } +export type Binary = string +export type Duration = + | { + height: number + } + | { + time: number + } +export interface InstantiateMsg { + active_threshold?: ActiveThreshold | null + dao_code_hash: string + nft_contract: NftContract + query_auth?: RawContract | null + unstaking_duration?: Duration | null +} +export interface RawContract { + address: string + code_hash: string +} +export type ExecuteMsg = + | { + receive_nft: { + msg?: Binary | null + sender: Addr + token_id: string + } + } + | { + unstake: { + token_ids: string[] + } + } + | { + claim_nfts: {} + } + | { + update_config: { + duration?: Duration | null + } + } + | { + add_hook: { + addr: string + code_hash: string + } + } + | { + remove_hook: { + addr: string + code_hash: string + } + } + | { + update_active_threshold: { + new_threshold?: ActiveThreshold | null + } + } +export type Addr = string +export type QueryMsg = + | { + config: {} + } + | { + nft_claims: { + auth: Auth + } + } + | { + hooks: {} + } + | { + staked_nfts: { + auth: Auth + } + } + | { + active_threshold: {} + } + | { + is_active: {} + } + | { + voting_power_at_height: { + auth: Auth + height?: number | null + } + } + | { + total_power_at_height: { + height?: number | null + } + } + | { + dao: {} + } + | { + info: {} + } +export type Auth = + | { + viewing_key: { + address: string + key: string + } + } + | { + permit: PermitForPermitData + } +export interface PermitForPermitData { + account_number?: Uint128 | null + chain_id?: string | null + memo?: string | null + params: PermitData + sequence?: Uint128 | null + signature: PermitSignature +} +export interface PermitData { + data: Binary + key: string +} +export interface PermitSignature { + pub_key: PubKey + signature: Binary +} +export interface PubKey { + type: string + value: Binary +} +export interface ActiveThresholdResponse { + active_threshold?: ActiveThreshold | null +} +export interface Config { + nft_address: Addr + nft_code_hash: string + query_auth: Contract + unstaking_duration?: Duration | null +} +export interface Contract { + address: Addr + code_hash: string +} +export interface AnyContractInfo { + addr: Addr + code_hash: string +} +export interface HooksResponse { + hooks: HookItem[] +} +export interface HookItem { + addr: Addr + code_hash: string +} +export interface InfoResponse { + info: ContractVersion +} +export interface ContractVersion { + contract: string + version: string +} +export type Boolean = boolean +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export type Timestamp = Uint64 +export type Uint64 = string +export interface NftClaimsResponse { + nft_claims: NftClaim[] +} +export interface NftClaim { + release_at: Expiration + token_id: string +} +export type ArrayOfString = string[] +export interface TotalPowerAtHeightResponse { + height: number + power: Uint128 +} +export interface VotingPowerAtHeightResponse { + height: number + power: Uint128 +} diff --git a/packages/types/contracts/SecretDaoVotingTokenStaked.ts b/packages/types/contracts/SecretDaoVotingTokenStaked.ts new file mode 100644 index 000000000..21e868ea4 --- /dev/null +++ b/packages/types/contracts/SecretDaoVotingTokenStaked.ts @@ -0,0 +1,224 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +export type ActiveThreshold = + | { + absolute_count: { + count: Uint128 + } + } + | { + percentage: { + percent: Decimal + } + } +export type Uint128 = string +export type Decimal = string +export type TokenInfo = { + existing: { + denom: string + } +} +export type Duration = + | { + height: number + } + | { + time: number + } +export interface InstantiateMsg { + active_threshold?: ActiveThreshold | null + dao_code_hash: string + query_auth?: RawContract | null + token_info: TokenInfo + unstaking_duration?: Duration | null +} +export interface RawContract { + address: string + code_hash: string +} +export type ExecuteMsg = + | { + stake: {} + } + | { + unstake: { + amount: Uint128 + } + } + | { + update_config: { + duration?: Duration | null + } + } + | { + claim: {} + } + | { + update_active_threshold: { + new_threshold?: ActiveThreshold | null + } + } + | { + add_hook: { + addr: string + code_hash: string + } + } + | { + remove_hook: { + addr: string + code_hash: string + } + } +export type QueryMsg = + | { + get_config: {} + } + | { + claims: { + auth: Auth + } + } + | { + list_stakers: { + limit?: number | null + start_after?: string | null + } + } + | { + active_threshold: {} + } + | { + get_hooks: {} + } + | { + token_contract: {} + } + | { + denom: {} + } + | { + is_active: {} + } + | { + voting_power_at_height: { + auth: Auth + height?: number | null + } + } + | { + total_power_at_height: { + height?: number | null + } + } + | { + dao: {} + } + | { + info: {} + } +export type Auth = + | { + viewing_key: { + address: string + key: string + } + } + | { + permit: PermitForPermitData + } +export type Binary = string +export interface PermitForPermitData { + account_number?: Uint128 | null + chain_id?: string | null + memo?: string | null + params: PermitData + sequence?: Uint128 | null + signature: PermitSignature +} +export interface PermitData { + data: Binary + key: string +} +export interface PermitSignature { + pub_key: PubKey + signature: Binary +} +export interface PubKey { + type: string + value: Binary +} +export interface MigrateMsg {} +export interface ActiveThresholdResponse { + active_threshold?: ActiveThreshold | null +} +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export type Timestamp = Uint64 +export type Uint64 = string +export interface ClaimsResponse { + claims: Claim[] +} +export interface Claim { + amount: Uint128 + release_at: Expiration +} +export type Addr = string +export interface AnyContractInfo { + addr: Addr + code_hash: string +} +export interface DenomResponse { + denom: string +} +export interface Config { + query_auth: Contract + unstaking_duration?: Duration | null +} +export interface Contract { + address: Addr + code_hash: string +} +export interface GetHooksResponse { + hooks: HookItem[] +} +export interface HookItem { + addr: Addr + code_hash: string +} +export interface InfoResponse { + info: ContractVersion +} +export interface ContractVersion { + contract: string + version: string +} +export type Boolean = boolean +export interface ListStakersResponse { + stakers: StakerBalanceResponse[] +} +export interface StakerBalanceResponse { + address: string + balance: Uint128 +} +export type NullableAddr = Addr | null +export interface TotalPowerAtHeightResponse { + height: number + power: Uint128 +} +export interface VotingPowerAtHeightResponse { + height: number + power: Uint128 +} diff --git a/packages/types/contracts/common.ts b/packages/types/contracts/common.ts index 05da5dc0e..f270f73b7 100644 --- a/packages/types/contracts/common.ts +++ b/packages/types/contracts/common.ts @@ -288,7 +288,9 @@ export enum DepositRefundPolicy { export interface CheckedDepositInfo { amount: Uint128 denom: CheckedDenom - refund_policy: DepositRefundPolicy + // make compatible with string union types with matching values, which is what + // gets auto-generated + refund_policy: `${DepositRefundPolicy}` } /** @@ -321,7 +323,10 @@ export type ProposalStatusVetoTimelock = { * * Used by both DaoProposalSingle and DaoProposalMultiple. */ -export type ProposalStatus = ProposalStatusEnum | ProposalStatusVetoTimelock +export type ProposalStatus = + // make compatible with string union types with matching values, which is what + // gets auto-generated + `${ProposalStatusEnum}` | ProposalStatusVetoTimelock /** * The flattened set of proposal status keys that can be represented as strings. * This uses the strings as-is and the key of the object enum variants. @@ -345,3 +350,108 @@ export type ActiveThreshold = export type ActiveThresholdResponse = { active_threshold?: ActiveThreshold | null } + +export type UnifiedCosmosMsg = CosmosMsgFor_Empty | SecretCosmosMsgForEmpty + +// Secret Network + +export type SecretAnyContractInfo = { + addr: Addr + code_hash: string +} + +export type SecretCosmosMsgForEmpty = + | { + bank: BankMsg + } + | { + custom: Empty + } + | { + staking: StakingMsg + } + | { + distribution: DistributionMsg + } + | { + ibc: IbcMsg + } + | { + wasm: SecretWasmMsg + } + | { + gov: GovMsg + } + | { + finalize_tx: Empty + } + | StargateMsg +export type SecretWasmMsg = + | { + execute: { + code_hash: string + contract_addr: string + msg: Binary + send: Coin[] + } + } + | { + instantiate: { + admin?: string | null + code_hash: string + code_id: number + label: string + msg: Binary + send: Coin[] + } + } + | { + migrate: { + code_hash: string + code_id: number + contract_addr: string + msg: Binary + } + } + | { + update_admin: { + admin: string + contract_addr: string + } + } + | { + clear_admin: { + contract_addr: string + } + } + +export type Auth = + | { + viewing_key: { + address: string + key: string + } + } + | { + permit: PermitForPermitData + } +export interface PermitForPermitData { + account_number?: Uint128 | null + chain_id?: string | null + memo?: string | null + params: PermitData + sequence?: Uint128 | null + signature: PermitSignature +} +export interface PermitData { + data: Binary + key: string +} +export interface PermitSignature { + pub_key: PubKey + signature: Binary +} +export interface PubKey { + type: string + value: Binary +} diff --git a/packages/types/creators.ts b/packages/types/creators.ts index a36942d13..89b4c186c 100644 --- a/packages/types/creators.ts +++ b/packages/types/creators.ts @@ -2,8 +2,9 @@ import { ComponentType } from 'react' import { FieldValues } from 'react-hook-form' import { TFunction } from 'react-i18next' -import { CodeIdConfig, SupportedChainConfig } from './chain' -import { InstantiateMsg } from './contracts/DaoCore.v2' +import { SupportedChainConfig } from './chain' +import { SecretModuleInstantiateInfo } from './clients' +import { ModuleInstantiateInfo } from './contracts' import { DaoCreationGovernanceConfigInputProps, DaoCreationGovernanceConfigReviewProps, @@ -11,15 +12,16 @@ import { NewDao, } from './dao' -export type DaoCreatorMutate = ( - msg: InstantiateMsg, - // Used within voting and proposal module adapters, so the data generic passed - // in may not necessarily be the voting module adapter data. Must use `any`. - newDao: NewDao, - data: Data, - t: TFunction, - codeIds: CodeIdConfig -) => InstantiateMsg +export type DaoCreatorGetInstantiateInfo = + (options: { + chainConfig: SupportedChainConfig + // Used within voting and proposal module adapters, so the data generic + // passed in may not necessarily be the voting module adapter data. Must use + // `any`. + newDao: NewDao + data: Data + t: TFunction + }) => ModuleInstantiateInfo | SecretModuleInstantiateInfo export type DaoCreator = { id: string @@ -45,5 +47,5 @@ export type DaoCreator = { // Modify `msg` to add any additional fields the creator needs to set based on // its own config. - mutate: DaoCreatorMutate + getInstantiateInfo: DaoCreatorGetInstantiateInfo } diff --git a/packages/types/dao.ts b/packages/types/dao.ts index 5c6d557aa..9283695eb 100644 --- a/packages/types/dao.ts +++ b/packages/types/dao.ts @@ -14,6 +14,7 @@ import { import { Account } from './account' import { SupportedChainConfig, WithChainId } from './chain' +import { SecretModuleInstantiateInfo } from './clients' import { DaoCardProps, DaoDropdownInfo, @@ -22,13 +23,15 @@ import { } from './components' import { ActiveThreshold, + ContractVersionInfo, DepositRefundPolicy, ModuleInstantiateInfo, } from './contracts/common' import { - InstantiateMsg as DaoCoreV2InstantiateMsg, + InstantiateMsg as DaoDaoCoreInstantiateMsg, ProposalModuleWithInfo, -} from './contracts/DaoCore.v2' +} from './contracts/DaoDaoCore' +import { PreProposeSubmissionPolicy } from './contracts/DaoPreProposeSingle' import { ProposalResponse as MultipleChoiceProposalResponse } from './contracts/DaoProposalMultiple' import { ProposalResponse as SingleChoiceProposalResponse, @@ -36,6 +39,7 @@ import { } from './contracts/DaoProposalSingle.v2' import { Config as NeutronCwdSubdaoTimelockSingleConfig } from './contracts/NeutronCwdSubdaoTimelockSingle' import { VotingVault } from './contracts/NeutronVotingRegistry' +import { InstantiateMsg as SecretDaoDaoCoreInstantiateMsg } from './contracts/SecretDaoDaoCore' import { DaoCreator } from './creators' import { ContractVersion, SupportedFeatureMap } from './features' import { ProposalVetoConfig } from './proposal' @@ -60,7 +64,7 @@ export type DaoInfo = { coreVersion: ContractVersion supportedFeatures: SupportedFeatureMap votingModuleAddress: string - votingModuleContractName: string + votingModuleInfo: ContractVersionInfo proposalModules: ProposalModule[] /** * Wasm contract-level admin that can migrate. @@ -160,6 +164,7 @@ export type PreProposeModule = { contractName: string version: ContractVersion address: string + submissionPolicy: PreProposeSubmissionPolicy } & PreProposeModuleTypedConfig export enum ProposalModuleType { @@ -189,7 +194,7 @@ export type ProposalModuleTypedConfig = export type ProposalModule = { contractName: string - version: ContractVersion | null + version: ContractVersion address: string prefix: string // If set, this uses a pre-propose module. @@ -216,7 +221,10 @@ export type CreateDaoCustomValidator = (setNewErrors: boolean) => void export interface CreateDaoContext { form: UseFormReturn> - instantiateMsg: DaoCoreV2InstantiateMsg | undefined + instantiateMsg: + | DaoDaoCoreInstantiateMsg + | SecretDaoDaoCoreInstantiateMsg + | undefined instantiateMsgError: string | undefined commonVotingConfig: DaoCreationCommonVotingConfigItems availableCreators: readonly DaoCreator[] @@ -335,7 +343,7 @@ export type DaoCreationGetInstantiateInfo< newDao: NewDao, data: DaoCreationVotingConfig & ModuleData, t: TFunction -) => ModuleInstantiateInfo +) => ModuleInstantiateInfo | SecretModuleInstantiateInfo export type DaoCreatedCardProps = Omit< DaoCardProps, @@ -500,7 +508,6 @@ export type IndexerDaoWithVetoableProposals = { export type DaoWithVetoableProposals = WithChainId< IndexerDaoWithVetoableProposals & { name: string - proposalModules: ProposalModule[] } > diff --git a/packages/types/features.ts b/packages/types/features.ts index 902207071..f731fa464 100644 --- a/packages/types/features.ts +++ b/packages/types/features.ts @@ -29,6 +29,7 @@ export enum ContractVersion { V240 = '2.4.0', // https://github.com/DA0-DA0/dao-contracts/releases/tag/v2.4.2 V242 = '2.4.2', + V250 = '2.5.0', } /** @@ -88,6 +89,10 @@ export enum Feature { * Veto was added. */ Veto, + /** + * The ability to specify a more granular pre-propose submission policy. + */ + GranularSubmissionPolicy, } /** diff --git a/packages/types/gov.ts b/packages/types/gov.ts index f3afe3a56..353ef6c96 100644 --- a/packages/types/gov.ts +++ b/packages/types/gov.ts @@ -1,5 +1,5 @@ import { NestedActionsEditorFormData } from './actions' -import { Coin, CosmosMsgFor_Empty } from './contracts' +import { Coin, UnifiedCosmosMsg } from './contracts' import { LoadingData } from './misc' import { ProcessedTQ, ProposalTimestampInfo } from './proposal' import { CommunityPoolSpendProposal } from './protobuf/codegen/cosmos/distribution/v1beta1/distribution' @@ -47,7 +47,7 @@ export type GovProposalV1 = { proposal: ProposalV1 } -export type GovProposalV1DecodedMessages = CosmosMsgFor_Empty[] +export type GovProposalV1DecodedMessages = UnifiedCosmosMsg[] export type GovProposalV1WithDecodedMessages = GovProposalV1 & { chainId: string title: string diff --git a/packages/types/index.ts b/packages/types/index.ts index 124aa3b93..24be76aa3 100644 --- a/packages/types/index.ts +++ b/packages/types/index.ts @@ -1,6 +1,7 @@ export * from './account' export * from './actions' export * from './chain' +export * from './clients' export * from './command' export * from './components' export * from './contracts' diff --git a/packages/types/indexer.ts b/packages/types/indexer.ts index 1de97b863..46973ff86 100644 --- a/packages/types/indexer.ts +++ b/packages/types/indexer.ts @@ -3,7 +3,7 @@ import { Config, DumpStateResponse, ProposalModuleWithInfo, -} from './contracts/DaoCore.v2' +} from './contracts/DaoDaoCore' export enum IndexerFormulaType { Contract = 'contract', @@ -52,23 +52,26 @@ export type DaoDaoIndexerChainStats = { export type DaoDaoIndexerAllStats = { /** - * Stats from all time. + * Stats from all time. If null, we have no stats for the chain (probably + * because we don't have an indexer running). */ - all: DaoDaoIndexerChainStats + all: DaoDaoIndexerChainStats | null /** - * Stats from last 30 days. + * Stats from last 30 days. If null, we have no stats for the chain (probably + * because we don't have an indexer running). */ - month: DaoDaoIndexerChainStats + month: DaoDaoIndexerChainStats | null /** - * Stats from last 7 days. + * Stats from last 7 days. If null, we have no stats for the chain (probably + * because we don't have an indexer running). */ - week: DaoDaoIndexerChainStats + week: DaoDaoIndexerChainStats | null /** - * Number of chains DAO DAO is deployed on. + * Total TVL. */ - chains: number + tvl: number | null /** - * Total TVL. + * Number of chains DAO DAO is deployed on. */ - tvl: number + chains: number } diff --git a/packages/types/package.json b/packages/types/package.json index ed7aaa9d8..7737003b9 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -22,6 +22,7 @@ "typescript": "5.3.3" }, "devDependencies": { + "@cosmjs/cosmwasm-stargate": "^0.32.3", "@cosmology/telescope": "^1.4.12", "@dao-dao/config": "2.4.0-rc.9", "@tanstack/react-query": "^5.40.0" diff --git a/packages/types/proposal-module-adapter.ts b/packages/types/proposal-module-adapter.ts index ea50ee5a4..dbc81e25e 100644 --- a/packages/types/proposal-module-adapter.ts +++ b/packages/types/proposal-module-adapter.ts @@ -5,6 +5,7 @@ import { FieldPath, FieldValues } from 'react-hook-form' import { RecoilValueReadOnly } from 'recoil' import { Action, ActionCategoryMaker, ActionMaker } from './actions' +import { IProposalModuleBase } from './clients' import { DaoInfoCard, LinkWrapperProps, @@ -147,16 +148,9 @@ export type ProposalModuleAdapter< } export type IProposalModuleAdapterCommonOptions = { - chain: Chain - coreAddress: string - proposalModule: ProposalModule + proposalModule: IProposalModuleBase } -export type IProposalModuleAdapterCommonInitialOptions = Omit< - IProposalModuleAdapterCommonOptions, - 'proposalModule' -> - export type IProposalModuleAdapterOptions = { /** * The DAO's native chain. @@ -206,6 +200,7 @@ export type IProposalModuleContext = { options: IProposalModuleAdapterOptions adapter: IProposalModuleAdapter common: IProposalModuleAdapterCommon + proposalModule: IProposalModuleBase } /** diff --git a/packages/types/proposal.ts b/packages/types/proposal.ts index ac1e3d6c4..c0248950a 100644 --- a/packages/types/proposal.ts +++ b/packages/types/proposal.ts @@ -2,7 +2,7 @@ import { ReactNode } from 'react' import { PolytoneConnection } from './chain' import { ProposalCardProps } from './components/ProposalCard' -import { CosmosMsgFor_Empty, ProposalStatus } from './contracts' +import { ProposalStatus, UnifiedCosmosMsg } from './contracts' import { ProposalStatusKey as PreProposeApprovalProposalStatus } from './contracts/DaoPreProposeApprovalSingle' import { ProposalResponse } from './contracts/DaoProposalSingle.v2' import { Event } from './contracts/PolytoneListener' @@ -50,10 +50,10 @@ export type DecodedPolytoneMsgMatch = { // The first message, or empty object if none. msg: Record // The first message, or undefined if none. - cosmosMsg: CosmosMsgFor_Empty | undefined + cosmosMsg: UnifiedCosmosMsg | undefined // All messages. msgs: Record[] - cosmosMsgs: CosmosMsgFor_Empty[] + cosmosMsgs: UnifiedCosmosMsg[] initiatorMsg: string } @@ -79,7 +79,7 @@ export type DecodedIcaMsgMatch = { cosmosMsgWithSender: | { sender: string - msg: CosmosMsgFor_Empty + msg: UnifiedCosmosMsg } | undefined // All messages. @@ -89,7 +89,7 @@ export type DecodedIcaMsgMatch = { }[] cosmosMsgsWithSenders: { sender: string - msg: CosmosMsgFor_Empty + msg: UnifiedCosmosMsg }[] } diff --git a/packages/types/protobuf/codegen/alliance/bundle.ts b/packages/types/protobuf/codegen/alliance/bundle.ts index dc139efd8..b65aac5b7 100644 --- a/packages/types/protobuf/codegen/alliance/bundle.ts +++ b/packages/types/protobuf/codegen/alliance/bundle.ts @@ -8,12 +8,12 @@ import * as _6 from "./alliance/query"; import * as _7 from "./alliance/redelegations"; import * as _8 from "./alliance/tx"; import * as _9 from "./alliance/unbonding"; -import * as _355 from "./alliance/tx.amino"; -import * as _356 from "./alliance/tx.registry"; -import * as _357 from "./alliance/query.rpc.Query"; -import * as _358 from "./alliance/tx.rpc.msg"; -import * as _597 from "./rpc.query"; -import * as _598 from "./rpc.tx"; +import * as _369 from "./alliance/tx.amino"; +import * as _370 from "./alliance/tx.registry"; +import * as _371 from "./alliance/query.rpc.Query"; +import * as _372 from "./alliance/tx.rpc.msg"; +import * as _624 from "./rpc.query"; +import * as _625 from "./rpc.tx"; export namespace alliance { export const alliance = { ..._0, @@ -26,13 +26,13 @@ export namespace alliance { ..._7, ..._8, ..._9, - ..._355, - ..._356, - ..._357, - ..._358 + ..._369, + ..._370, + ..._371, + ..._372 }; export const ClientFactory = { - ..._597, - ..._598 + ..._624, + ..._625 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/bitsong/bundle.ts b/packages/types/protobuf/codegen/bitsong/bundle.ts index 15eea2ff9..580f4a0bf 100644 --- a/packages/types/protobuf/codegen/bitsong/bundle.ts +++ b/packages/types/protobuf/codegen/bitsong/bundle.ts @@ -1,16 +1,16 @@ import * as _11 from "./fantoken/v1beta1/tx"; -import * as _359 from "./fantoken/v1beta1/tx.amino"; -import * as _360 from "./fantoken/v1beta1/tx.registry"; -import * as _361 from "./fantoken/v1beta1/tx.rpc.msg"; -import * as _599 from "./rpc.tx"; +import * as _373 from "./fantoken/v1beta1/tx.amino"; +import * as _374 from "./fantoken/v1beta1/tx.registry"; +import * as _375 from "./fantoken/v1beta1/tx.rpc.msg"; +import * as _626 from "./rpc.tx"; export namespace bitsong { export const fantoken = { ..._11, - ..._359, - ..._360, - ..._361 + ..._373, + ..._374, + ..._375 }; export const ClientFactory = { - ..._599 + ..._626 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/circle/bundle.ts b/packages/types/protobuf/codegen/circle/bundle.ts index 690cf20a5..606d608b8 100644 --- a/packages/types/protobuf/codegen/circle/bundle.ts +++ b/packages/types/protobuf/codegen/circle/bundle.ts @@ -14,12 +14,12 @@ import * as _24 from "./cctp/v1/sending_and_receiving_messages_paused"; import * as _25 from "./cctp/v1/signature_threshold"; import * as _26 from "./cctp/v1/token_pair"; import * as _27 from "./cctp/v1/tx"; -import * as _362 from "./cctp/v1/tx.amino"; -import * as _363 from "./cctp/v1/tx.registry"; -import * as _364 from "./cctp/v1/query.rpc.Query"; -import * as _365 from "./cctp/v1/tx.rpc.msg"; -import * as _600 from "./rpc.query"; -import * as _601 from "./rpc.tx"; +import * as _376 from "./cctp/v1/tx.amino"; +import * as _377 from "./cctp/v1/tx.registry"; +import * as _378 from "./cctp/v1/query.rpc.Query"; +import * as _379 from "./cctp/v1/tx.rpc.msg"; +import * as _627 from "./rpc.query"; +import * as _628 from "./rpc.tx"; export namespace circle { export namespace cctp { export const v1 = { @@ -39,14 +39,14 @@ export namespace circle { ..._25, ..._26, ..._27, - ..._362, - ..._363, - ..._364, - ..._365 + ..._376, + ..._377, + ..._378, + ..._379 }; } export const ClientFactory = { - ..._600, - ..._601 + ..._627, + ..._628 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/bundle.ts b/packages/types/protobuf/codegen/cosmos/bundle.ts index 5c0e92498..4613157a4 100644 --- a/packages/types/protobuf/codegen/cosmos/bundle.ts +++ b/packages/types/protobuf/codegen/cosmos/bundle.ts @@ -60,55 +60,55 @@ import * as _87 from "./tx/v1beta1/tx"; import * as _88 from "./upgrade/v1beta1/query"; import * as _89 from "./upgrade/v1beta1/tx"; import * as _90 from "./upgrade/v1beta1/upgrade"; -import * as _366 from "./auth/v1beta1/tx.amino"; -import * as _367 from "./authz/v1beta1/tx.amino"; -import * as _368 from "./bank/v1beta1/tx.amino"; -import * as _369 from "./distribution/v1beta1/tx.amino"; -import * as _370 from "./feegrant/v1beta1/tx.amino"; -import * as _371 from "./gov/v1/tx.amino"; -import * as _372 from "./gov/v1beta1/tx.amino"; -import * as _373 from "./mint/v1beta1/tx.amino"; -import * as _374 from "./slashing/v1beta1/tx.amino"; -import * as _375 from "./staking/v1beta1/tx.amino"; -import * as _376 from "./upgrade/v1beta1/tx.amino"; -import * as _377 from "./auth/v1beta1/tx.registry"; -import * as _378 from "./authz/v1beta1/tx.registry"; -import * as _379 from "./bank/v1beta1/tx.registry"; -import * as _380 from "./distribution/v1beta1/tx.registry"; -import * as _381 from "./feegrant/v1beta1/tx.registry"; -import * as _382 from "./gov/v1/tx.registry"; -import * as _383 from "./gov/v1beta1/tx.registry"; -import * as _384 from "./mint/v1beta1/tx.registry"; -import * as _385 from "./slashing/v1beta1/tx.registry"; -import * as _386 from "./staking/v1beta1/tx.registry"; -import * as _387 from "./upgrade/v1beta1/tx.registry"; -import * as _388 from "./auth/v1beta1/query.rpc.Query"; -import * as _389 from "./authz/v1beta1/query.rpc.Query"; -import * as _390 from "./bank/v1beta1/query.rpc.Query"; -import * as _391 from "./base/tendermint/v1beta1/query.rpc.Service"; -import * as _392 from "./distribution/v1beta1/query.rpc.Query"; -import * as _393 from "./feegrant/v1beta1/query.rpc.Query"; -import * as _394 from "./gov/v1/query.rpc.Query"; -import * as _395 from "./gov/v1beta1/query.rpc.Query"; -import * as _396 from "./mint/v1beta1/query.rpc.Query"; -import * as _397 from "./params/v1beta1/query.rpc.Query"; -import * as _398 from "./slashing/v1beta1/query.rpc.Query"; -import * as _399 from "./staking/v1beta1/query.rpc.Query"; -import * as _400 from "./tx/v1beta1/service.rpc.Service"; -import * as _401 from "./upgrade/v1beta1/query.rpc.Query"; -import * as _402 from "./auth/v1beta1/tx.rpc.msg"; -import * as _403 from "./authz/v1beta1/tx.rpc.msg"; -import * as _404 from "./bank/v1beta1/tx.rpc.msg"; -import * as _405 from "./distribution/v1beta1/tx.rpc.msg"; -import * as _406 from "./feegrant/v1beta1/tx.rpc.msg"; -import * as _407 from "./gov/v1/tx.rpc.msg"; -import * as _408 from "./gov/v1beta1/tx.rpc.msg"; -import * as _409 from "./mint/v1beta1/tx.rpc.msg"; -import * as _410 from "./slashing/v1beta1/tx.rpc.msg"; -import * as _411 from "./staking/v1beta1/tx.rpc.msg"; -import * as _412 from "./upgrade/v1beta1/tx.rpc.msg"; -import * as _602 from "./rpc.query"; -import * as _603 from "./rpc.tx"; +import * as _380 from "./auth/v1beta1/tx.amino"; +import * as _381 from "./authz/v1beta1/tx.amino"; +import * as _382 from "./bank/v1beta1/tx.amino"; +import * as _383 from "./distribution/v1beta1/tx.amino"; +import * as _384 from "./feegrant/v1beta1/tx.amino"; +import * as _385 from "./gov/v1/tx.amino"; +import * as _386 from "./gov/v1beta1/tx.amino"; +import * as _387 from "./mint/v1beta1/tx.amino"; +import * as _388 from "./slashing/v1beta1/tx.amino"; +import * as _389 from "./staking/v1beta1/tx.amino"; +import * as _390 from "./upgrade/v1beta1/tx.amino"; +import * as _391 from "./auth/v1beta1/tx.registry"; +import * as _392 from "./authz/v1beta1/tx.registry"; +import * as _393 from "./bank/v1beta1/tx.registry"; +import * as _394 from "./distribution/v1beta1/tx.registry"; +import * as _395 from "./feegrant/v1beta1/tx.registry"; +import * as _396 from "./gov/v1/tx.registry"; +import * as _397 from "./gov/v1beta1/tx.registry"; +import * as _398 from "./mint/v1beta1/tx.registry"; +import * as _399 from "./slashing/v1beta1/tx.registry"; +import * as _400 from "./staking/v1beta1/tx.registry"; +import * as _401 from "./upgrade/v1beta1/tx.registry"; +import * as _402 from "./auth/v1beta1/query.rpc.Query"; +import * as _403 from "./authz/v1beta1/query.rpc.Query"; +import * as _404 from "./bank/v1beta1/query.rpc.Query"; +import * as _405 from "./base/tendermint/v1beta1/query.rpc.Service"; +import * as _406 from "./distribution/v1beta1/query.rpc.Query"; +import * as _407 from "./feegrant/v1beta1/query.rpc.Query"; +import * as _408 from "./gov/v1/query.rpc.Query"; +import * as _409 from "./gov/v1beta1/query.rpc.Query"; +import * as _410 from "./mint/v1beta1/query.rpc.Query"; +import * as _411 from "./params/v1beta1/query.rpc.Query"; +import * as _412 from "./slashing/v1beta1/query.rpc.Query"; +import * as _413 from "./staking/v1beta1/query.rpc.Query"; +import * as _414 from "./tx/v1beta1/service.rpc.Service"; +import * as _415 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _416 from "./auth/v1beta1/tx.rpc.msg"; +import * as _417 from "./authz/v1beta1/tx.rpc.msg"; +import * as _418 from "./bank/v1beta1/tx.rpc.msg"; +import * as _419 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _420 from "./feegrant/v1beta1/tx.rpc.msg"; +import * as _421 from "./gov/v1/tx.rpc.msg"; +import * as _422 from "./gov/v1beta1/tx.rpc.msg"; +import * as _423 from "./mint/v1beta1/tx.rpc.msg"; +import * as _424 from "./slashing/v1beta1/tx.rpc.msg"; +import * as _425 from "./staking/v1beta1/tx.rpc.msg"; +import * as _426 from "./upgrade/v1beta1/tx.rpc.msg"; +import * as _629 from "./rpc.query"; +import * as _630 from "./rpc.tx"; export namespace cosmos { export namespace auth { export const v1beta1 = { @@ -116,10 +116,10 @@ export namespace cosmos { ..._30, ..._31, ..._32, - ..._366, - ..._377, - ..._388, - ..._402 + ..._380, + ..._391, + ..._402, + ..._416 }; } export namespace authz { @@ -129,10 +129,10 @@ export namespace cosmos { ..._35, ..._36, ..._37, - ..._367, - ..._378, - ..._389, - ..._403 + ..._381, + ..._392, + ..._403, + ..._417 }; } export namespace bank { @@ -142,10 +142,10 @@ export namespace cosmos { ..._40, ..._41, ..._42, - ..._368, - ..._379, - ..._390, - ..._404 + ..._382, + ..._393, + ..._404, + ..._418 }; } export namespace base { @@ -163,7 +163,7 @@ export namespace cosmos { export const v1beta1 = { ..._45, ..._46, - ..._391 + ..._405 }; } export const v1beta1 = { @@ -187,10 +187,10 @@ export namespace cosmos { ..._52, ..._53, ..._54, - ..._369, - ..._380, - ..._392, - ..._405 + ..._383, + ..._394, + ..._406, + ..._419 }; } export namespace feegrant { @@ -199,10 +199,10 @@ export namespace cosmos { ..._56, ..._57, ..._58, - ..._370, - ..._381, - ..._393, - ..._406 + ..._384, + ..._395, + ..._407, + ..._420 }; } export namespace gov { @@ -211,20 +211,20 @@ export namespace cosmos { ..._60, ..._61, ..._62, - ..._371, - ..._382, - ..._394, - ..._407 + ..._385, + ..._396, + ..._408, + ..._421 }; export const v1beta1 = { ..._63, ..._64, ..._65, ..._66, - ..._372, - ..._383, - ..._395, - ..._408 + ..._386, + ..._397, + ..._409, + ..._422 }; } export namespace mint { @@ -233,10 +233,10 @@ export namespace cosmos { ..._68, ..._69, ..._70, - ..._373, - ..._384, - ..._396, - ..._409 + ..._387, + ..._398, + ..._410, + ..._423 }; } export namespace msg { @@ -253,7 +253,7 @@ export namespace cosmos { export const v1beta1 = { ..._73, ..._74, - ..._397 + ..._411 }; } export namespace query { @@ -267,10 +267,10 @@ export namespace cosmos { ..._77, ..._78, ..._79, - ..._374, - ..._385, - ..._398, - ..._410 + ..._388, + ..._399, + ..._412, + ..._424 }; } export namespace staking { @@ -280,10 +280,10 @@ export namespace cosmos { ..._82, ..._83, ..._84, - ..._375, - ..._386, - ..._399, - ..._411 + ..._389, + ..._400, + ..._413, + ..._425 }; } export namespace tx { @@ -295,7 +295,7 @@ export namespace cosmos { export const v1beta1 = { ..._86, ..._87, - ..._400 + ..._414 }; } export namespace upgrade { @@ -303,14 +303,14 @@ export namespace cosmos { ..._88, ..._89, ..._90, - ..._376, - ..._387, + ..._390, ..._401, - ..._412 + ..._415, + ..._426 }; } export const ClientFactory = { - ..._602, - ..._603 + ..._629, + ..._630 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmwasm/bundle.ts b/packages/types/protobuf/codegen/cosmwasm/bundle.ts index c32d4886c..462214bac 100644 --- a/packages/types/protobuf/codegen/cosmwasm/bundle.ts +++ b/packages/types/protobuf/codegen/cosmwasm/bundle.ts @@ -10,16 +10,16 @@ import * as _99 from "./wasm/v1/proposal"; import * as _100 from "./wasm/v1/query"; import * as _101 from "./wasm/v1/tx"; import * as _102 from "./wasm/v1/types"; -import * as _413 from "./tokenfactory/v1beta1/tx.amino"; -import * as _414 from "./wasm/v1/tx.amino"; -import * as _415 from "./tokenfactory/v1beta1/tx.registry"; -import * as _416 from "./wasm/v1/tx.registry"; -import * as _417 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _418 from "./wasm/v1/query.rpc.Query"; -import * as _419 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _420 from "./wasm/v1/tx.rpc.msg"; -import * as _604 from "./rpc.query"; -import * as _605 from "./rpc.tx"; +import * as _427 from "./tokenfactory/v1beta1/tx.amino"; +import * as _428 from "./wasm/v1/tx.amino"; +import * as _429 from "./tokenfactory/v1beta1/tx.registry"; +import * as _430 from "./wasm/v1/tx.registry"; +import * as _431 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _432 from "./wasm/v1/query.rpc.Query"; +import * as _433 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _434 from "./wasm/v1/tx.rpc.msg"; +import * as _631 from "./rpc.query"; +import * as _632 from "./rpc.tx"; export namespace cosmwasm { export namespace tokenfactory { export const v1beta1 = { @@ -28,10 +28,10 @@ export namespace cosmwasm { ..._93, ..._94, ..._95, - ..._413, - ..._415, - ..._417, - ..._419 + ..._427, + ..._429, + ..._431, + ..._433 }; } export namespace wasm { @@ -43,14 +43,14 @@ export namespace cosmwasm { ..._100, ..._101, ..._102, - ..._414, - ..._416, - ..._418, - ..._420 + ..._428, + ..._430, + ..._432, + ..._434 }; } export const ClientFactory = { - ..._604, - ..._605 + ..._631, + ..._632 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/feemarket/bundle.ts b/packages/types/protobuf/codegen/feemarket/bundle.ts index adc770dda..bccbbb731 100644 --- a/packages/types/protobuf/codegen/feemarket/bundle.ts +++ b/packages/types/protobuf/codegen/feemarket/bundle.ts @@ -2,12 +2,12 @@ import * as _103 from "./feemarket/v1/genesis"; import * as _104 from "./feemarket/v1/params"; import * as _105 from "./feemarket/v1/query"; import * as _106 from "./feemarket/v1/tx"; -import * as _421 from "./feemarket/v1/tx.amino"; -import * as _422 from "./feemarket/v1/tx.registry"; -import * as _423 from "./feemarket/v1/query.rpc.Query"; -import * as _424 from "./feemarket/v1/tx.rpc.msg"; -import * as _606 from "./rpc.query"; -import * as _607 from "./rpc.tx"; +import * as _435 from "./feemarket/v1/tx.amino"; +import * as _436 from "./feemarket/v1/tx.registry"; +import * as _437 from "./feemarket/v1/query.rpc.Query"; +import * as _438 from "./feemarket/v1/tx.rpc.msg"; +import * as _633 from "./rpc.query"; +import * as _634 from "./rpc.tx"; export namespace feemarket { export namespace feemarket { export const v1 = { @@ -15,14 +15,14 @@ export namespace feemarket { ..._104, ..._105, ..._106, - ..._421, - ..._422, - ..._423, - ..._424 + ..._435, + ..._436, + ..._437, + ..._438 }; } export const ClientFactory = { - ..._606, - ..._607 + ..._633, + ..._634 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/gaia/bundle.ts b/packages/types/protobuf/codegen/gaia/bundle.ts index 39654b5ca..4811e38b3 100644 --- a/packages/types/protobuf/codegen/gaia/bundle.ts +++ b/packages/types/protobuf/codegen/gaia/bundle.ts @@ -1,26 +1,26 @@ import * as _107 from "./globalfee/v1beta1/genesis"; import * as _108 from "./globalfee/v1beta1/query"; import * as _109 from "./globalfee/v1beta1/tx"; -import * as _425 from "./globalfee/v1beta1/tx.amino"; -import * as _426 from "./globalfee/v1beta1/tx.registry"; -import * as _427 from "./globalfee/v1beta1/query.rpc.Query"; -import * as _428 from "./globalfee/v1beta1/tx.rpc.msg"; -import * as _608 from "./rpc.query"; -import * as _609 from "./rpc.tx"; +import * as _439 from "./globalfee/v1beta1/tx.amino"; +import * as _440 from "./globalfee/v1beta1/tx.registry"; +import * as _441 from "./globalfee/v1beta1/query.rpc.Query"; +import * as _442 from "./globalfee/v1beta1/tx.rpc.msg"; +import * as _635 from "./rpc.query"; +import * as _636 from "./rpc.tx"; export namespace gaia { export namespace globalfee { export const v1beta1 = { ..._107, ..._108, ..._109, - ..._425, - ..._426, - ..._427, - ..._428 + ..._439, + ..._440, + ..._441, + ..._442 }; } export const ClientFactory = { - ..._608, - ..._609 + ..._635, + ..._636 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/bundle.ts b/packages/types/protobuf/codegen/ibc/bundle.ts index 464c16855..5d1baf6df 100644 --- a/packages/types/protobuf/codegen/ibc/bundle.ts +++ b/packages/types/protobuf/codegen/ibc/bundle.ts @@ -20,28 +20,28 @@ import * as _136 from "./core/client/v1/client"; import * as _137 from "./core/client/v1/genesis"; import * as _138 from "./core/client/v1/query"; import * as _139 from "./core/client/v1/tx"; -import * as _429 from "./applications/interchain_accounts/controller/v1/tx.amino"; -import * as _430 from "./applications/interchain_accounts/host/v1/tx.amino"; -import * as _431 from "./applications/transfer/v1/tx.amino"; -import * as _432 from "./core/channel/v1/tx.amino"; -import * as _433 from "./core/client/v1/tx.amino"; -import * as _434 from "./applications/interchain_accounts/controller/v1/tx.registry"; -import * as _435 from "./applications/interchain_accounts/host/v1/tx.registry"; -import * as _436 from "./applications/transfer/v1/tx.registry"; -import * as _437 from "./core/channel/v1/tx.registry"; -import * as _438 from "./core/client/v1/tx.registry"; -import * as _439 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; -import * as _440 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; -import * as _441 from "./applications/transfer/v1/query.rpc.Query"; -import * as _442 from "./core/channel/v1/query.rpc.Query"; -import * as _443 from "./core/client/v1/query.rpc.Query"; -import * as _444 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; -import * as _445 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; -import * as _446 from "./applications/transfer/v1/tx.rpc.msg"; -import * as _447 from "./core/channel/v1/tx.rpc.msg"; -import * as _448 from "./core/client/v1/tx.rpc.msg"; -import * as _610 from "./rpc.query"; -import * as _611 from "./rpc.tx"; +import * as _443 from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as _444 from "./applications/interchain_accounts/host/v1/tx.amino"; +import * as _445 from "./applications/transfer/v1/tx.amino"; +import * as _446 from "./core/channel/v1/tx.amino"; +import * as _447 from "./core/client/v1/tx.amino"; +import * as _448 from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as _449 from "./applications/interchain_accounts/host/v1/tx.registry"; +import * as _450 from "./applications/transfer/v1/tx.registry"; +import * as _451 from "./core/channel/v1/tx.registry"; +import * as _452 from "./core/client/v1/tx.registry"; +import * as _453 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; +import * as _454 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; +import * as _455 from "./applications/transfer/v1/query.rpc.Query"; +import * as _456 from "./core/channel/v1/query.rpc.Query"; +import * as _457 from "./core/client/v1/query.rpc.Query"; +import * as _458 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; +import * as _459 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; +import * as _460 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _461 from "./core/channel/v1/tx.rpc.msg"; +import * as _462 from "./core/client/v1/tx.rpc.msg"; +import * as _637 from "./rpc.query"; +import * as _638 from "./rpc.tx"; export namespace ibc { export namespace applications { export namespace interchain_accounts { @@ -50,10 +50,10 @@ export namespace ibc { ..._118, ..._119, ..._120, - ..._429, - ..._434, - ..._439, - ..._444 + ..._443, + ..._448, + ..._453, + ..._458 }; } export namespace host { @@ -61,10 +61,10 @@ export namespace ibc { ..._121, ..._122, ..._123, - ..._430, - ..._435, - ..._440, - ..._445 + ..._444, + ..._449, + ..._454, + ..._459 }; } export const v1 = { @@ -80,10 +80,10 @@ export namespace ibc { ..._129, ..._130, ..._131, - ..._431, - ..._436, - ..._441, - ..._446 + ..._445, + ..._450, + ..._455, + ..._460 }; } } @@ -94,10 +94,10 @@ export namespace ibc { ..._133, ..._134, ..._135, - ..._432, - ..._437, - ..._442, - ..._447 + ..._446, + ..._451, + ..._456, + ..._461 }; } export namespace client { @@ -106,15 +106,15 @@ export namespace ibc { ..._137, ..._138, ..._139, - ..._433, - ..._438, - ..._443, - ..._448 + ..._447, + ..._452, + ..._457, + ..._462 }; } } export const ClientFactory = { - ..._610, - ..._611 + ..._637, + ..._638 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/index.ts b/packages/types/protobuf/codegen/index.ts index 2c266afd8..33d823734 100644 --- a/packages/types/protobuf/codegen/index.ts +++ b/packages/types/protobuf/codegen/index.ts @@ -38,6 +38,8 @@ export * from "./publicawesome/bundle"; export * from "./publicawesome/client"; export * from "./regen/bundle"; export * from "./regen/client"; +export * from "./secret/bundle"; +export * from "./secret/client"; export * from "./noble/bundle"; export * from "./tendermint/bundle"; export * from "./varint"; diff --git a/packages/types/protobuf/codegen/juno/bundle.ts b/packages/types/protobuf/codegen/juno/bundle.ts index c371d2ffa..587058688 100644 --- a/packages/types/protobuf/codegen/juno/bundle.ts +++ b/packages/types/protobuf/codegen/juno/bundle.ts @@ -6,16 +6,16 @@ import * as _144 from "./mint/genesis"; import * as _145 from "./mint/mint"; import * as _146 from "./mint/query"; import * as _147 from "./mint/tx"; -import * as _449 from "./feeshare/v1/tx.amino"; -import * as _450 from "./mint/tx.amino"; -import * as _451 from "./feeshare/v1/tx.registry"; -import * as _452 from "./mint/tx.registry"; -import * as _453 from "./feeshare/v1/query.rpc.Query"; -import * as _454 from "./mint/query.rpc.Query"; -import * as _455 from "./feeshare/v1/tx.rpc.msg"; -import * as _456 from "./mint/tx.rpc.msg"; -import * as _612 from "./rpc.query"; -import * as _613 from "./rpc.tx"; +import * as _463 from "./feeshare/v1/tx.amino"; +import * as _464 from "./mint/tx.amino"; +import * as _465 from "./feeshare/v1/tx.registry"; +import * as _466 from "./mint/tx.registry"; +import * as _467 from "./feeshare/v1/query.rpc.Query"; +import * as _468 from "./mint/query.rpc.Query"; +import * as _469 from "./feeshare/v1/tx.rpc.msg"; +import * as _470 from "./mint/tx.rpc.msg"; +import * as _639 from "./rpc.query"; +import * as _640 from "./rpc.tx"; export namespace juno { export namespace feeshare { export const v1 = { @@ -23,10 +23,10 @@ export namespace juno { ..._141, ..._142, ..._143, - ..._449, - ..._451, - ..._453, - ..._455 + ..._463, + ..._465, + ..._467, + ..._469 }; } export const mint = { @@ -34,13 +34,13 @@ export namespace juno { ..._145, ..._146, ..._147, - ..._450, - ..._452, - ..._454, - ..._456 + ..._464, + ..._466, + ..._468, + ..._470 }; export const ClientFactory = { - ..._612, - ..._613 + ..._639, + ..._640 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/bundle.ts b/packages/types/protobuf/codegen/kujira/bundle.ts index 3d7e17f5d..95969085d 100644 --- a/packages/types/protobuf/codegen/kujira/bundle.ts +++ b/packages/types/protobuf/codegen/kujira/bundle.ts @@ -12,17 +12,17 @@ import * as _158 from "./scheduler/hook"; import * as _159 from "./scheduler/params"; import * as _160 from "./scheduler/proposal"; import * as _161 from "./scheduler/query"; -import * as _457 from "./denom/tx.amino"; -import * as _458 from "./oracle/tx.amino"; -import * as _459 from "./denom/tx.registry"; -import * as _460 from "./oracle/tx.registry"; -import * as _461 from "./denom/query.rpc.Query"; -import * as _462 from "./oracle/query.rpc.Query"; -import * as _463 from "./scheduler/query.rpc.Query"; -import * as _464 from "./denom/tx.rpc.msg"; -import * as _465 from "./oracle/tx.rpc.msg"; -import * as _614 from "./rpc.query"; -import * as _615 from "./rpc.tx"; +import * as _471 from "./denom/tx.amino"; +import * as _472 from "./oracle/tx.amino"; +import * as _473 from "./denom/tx.registry"; +import * as _474 from "./oracle/tx.registry"; +import * as _475 from "./denom/query.rpc.Query"; +import * as _476 from "./oracle/query.rpc.Query"; +import * as _477 from "./scheduler/query.rpc.Query"; +import * as _478 from "./denom/tx.rpc.msg"; +import * as _479 from "./oracle/tx.rpc.msg"; +import * as _641 from "./rpc.query"; +import * as _642 from "./rpc.tx"; export namespace kujira { export const denom = { ..._148, @@ -30,20 +30,20 @@ export namespace kujira { ..._150, ..._151, ..._152, - ..._457, - ..._459, - ..._461, - ..._464 + ..._471, + ..._473, + ..._475, + ..._478 }; export const oracle = { ..._153, ..._154, ..._155, ..._156, - ..._458, - ..._460, - ..._462, - ..._465 + ..._472, + ..._474, + ..._476, + ..._479 }; export const scheduler = { ..._157, @@ -51,10 +51,10 @@ export namespace kujira { ..._159, ..._160, ..._161, - ..._463 + ..._477 }; export const ClientFactory = { - ..._614, - ..._615 + ..._641, + ..._642 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/neutron/bundle.ts b/packages/types/protobuf/codegen/neutron/bundle.ts index 6720f7c58..7d3d1d705 100644 --- a/packages/types/protobuf/codegen/neutron/bundle.ts +++ b/packages/types/protobuf/codegen/neutron/bundle.ts @@ -36,32 +36,32 @@ import * as _196 from "./interchaintxs/v1/genesis"; import * as _197 from "./interchaintxs/v1/params"; import * as _198 from "./interchaintxs/v1/query"; import * as _199 from "./interchaintxs/v1/tx"; -import * as _466 from "./cron/tx.amino"; -import * as _467 from "./dex/tx.amino"; -import * as _468 from "./feeburner/tx.amino"; -import * as _469 from "./feerefunder/tx.amino"; -import * as _470 from "./interchainqueries/tx.amino"; -import * as _471 from "./interchaintxs/v1/tx.amino"; -import * as _472 from "./cron/tx.registry"; -import * as _473 from "./dex/tx.registry"; -import * as _474 from "./feeburner/tx.registry"; -import * as _475 from "./feerefunder/tx.registry"; -import * as _476 from "./interchainqueries/tx.registry"; -import * as _477 from "./interchaintxs/v1/tx.registry"; -import * as _478 from "./cron/query.rpc.Query"; -import * as _479 from "./dex/query.rpc.Query"; -import * as _480 from "./feeburner/query.rpc.Query"; -import * as _481 from "./feerefunder/query.rpc.Query"; -import * as _482 from "./interchainqueries/query.rpc.Query"; -import * as _483 from "./interchaintxs/v1/query.rpc.Query"; -import * as _484 from "./cron/tx.rpc.msg"; -import * as _485 from "./dex/tx.rpc.msg"; -import * as _486 from "./feeburner/tx.rpc.msg"; -import * as _487 from "./feerefunder/tx.rpc.msg"; -import * as _488 from "./interchainqueries/tx.rpc.msg"; -import * as _489 from "./interchaintxs/v1/tx.rpc.msg"; -import * as _616 from "./rpc.query"; -import * as _617 from "./rpc.tx"; +import * as _480 from "./cron/tx.amino"; +import * as _481 from "./dex/tx.amino"; +import * as _482 from "./feeburner/tx.amino"; +import * as _483 from "./feerefunder/tx.amino"; +import * as _484 from "./interchainqueries/tx.amino"; +import * as _485 from "./interchaintxs/v1/tx.amino"; +import * as _486 from "./cron/tx.registry"; +import * as _487 from "./dex/tx.registry"; +import * as _488 from "./feeburner/tx.registry"; +import * as _489 from "./feerefunder/tx.registry"; +import * as _490 from "./interchainqueries/tx.registry"; +import * as _491 from "./interchaintxs/v1/tx.registry"; +import * as _492 from "./cron/query.rpc.Query"; +import * as _493 from "./dex/query.rpc.Query"; +import * as _494 from "./feeburner/query.rpc.Query"; +import * as _495 from "./feerefunder/query.rpc.Query"; +import * as _496 from "./interchainqueries/query.rpc.Query"; +import * as _497 from "./interchaintxs/v1/query.rpc.Query"; +import * as _498 from "./cron/tx.rpc.msg"; +import * as _499 from "./dex/tx.rpc.msg"; +import * as _500 from "./feeburner/tx.rpc.msg"; +import * as _501 from "./feerefunder/tx.rpc.msg"; +import * as _502 from "./interchainqueries/tx.rpc.msg"; +import * as _503 from "./interchaintxs/v1/tx.rpc.msg"; +import * as _643 from "./rpc.query"; +import * as _644 from "./rpc.tx"; export namespace neutron { export namespace contractmanager { export const v1 = { @@ -74,10 +74,10 @@ export namespace neutron { ..._165, ..._166, ..._167, - ..._466, - ..._472, - ..._478, - ..._484 + ..._480, + ..._486, + ..._492, + ..._498 }; export const dex = { ..._168, @@ -94,10 +94,10 @@ export namespace neutron { ..._179, ..._180, ..._181, - ..._467, - ..._473, - ..._479, - ..._485 + ..._481, + ..._487, + ..._493, + ..._499 }; export const feeburner = { ..._182, @@ -105,10 +105,10 @@ export namespace neutron { ..._184, ..._185, ..._186, - ..._468, - ..._474, - ..._480, - ..._486 + ..._482, + ..._488, + ..._494, + ..._500 }; export const feerefunder = { ..._187, @@ -116,20 +116,20 @@ export namespace neutron { ..._189, ..._190, ..._191, - ..._469, - ..._475, - ..._481, - ..._487 + ..._483, + ..._489, + ..._495, + ..._501 }; export const interchainqueries = { ..._192, ..._193, ..._194, ..._195, - ..._470, - ..._476, - ..._482, - ..._488 + ..._484, + ..._490, + ..._496, + ..._502 }; export namespace interchaintxs { export const v1 = { @@ -137,14 +137,14 @@ export namespace neutron { ..._197, ..._198, ..._199, - ..._471, - ..._477, - ..._483, - ..._489 + ..._485, + ..._491, + ..._497, + ..._503 }; } export const ClientFactory = { - ..._616, - ..._617 + ..._643, + ..._644 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/noble/bundle.ts b/packages/types/protobuf/codegen/noble/bundle.ts index 5bc575140..6b12c7bd2 100644 --- a/packages/types/protobuf/codegen/noble/bundle.ts +++ b/packages/types/protobuf/codegen/noble/bundle.ts @@ -1,16 +1,16 @@ -import * as _342 from "../tariff/genesis"; -import * as _343 from "../tariff/params"; -import * as _344 from "../tariff/query"; -import * as _596 from "../tariff/query.rpc.Query"; -import * as _626 from "./rpc.query"; +import * as _356 from "../tariff/genesis"; +import * as _357 from "../tariff/params"; +import * as _358 from "../tariff/query"; +import * as _623 from "../tariff/query.rpc.Query"; +import * as _655 from "./rpc.query"; export namespace noble { export const tariff = { - ..._342, - ..._343, - ..._344, - ..._596 + ..._356, + ..._357, + ..._358, + ..._623 }; export const ClientFactory = { - ..._626 + ..._655 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/bundle.ts b/packages/types/protobuf/codegen/osmosis/bundle.ts index d9cc3f94e..b5429427a 100644 --- a/packages/types/protobuf/codegen/osmosis/bundle.ts +++ b/packages/types/protobuf/codegen/osmosis/bundle.ts @@ -74,63 +74,63 @@ import * as _272 from "./txfees/v1beta1/tx"; import * as _273 from "./valset-pref/v1beta1/query"; import * as _274 from "./valset-pref/v1beta1/state"; import * as _275 from "./valset-pref/v1beta1/tx"; -import * as _490 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; -import * as _491 from "./concentratedliquidity/v1beta1/tx.amino"; -import * as _492 from "./gamm/pool-models/balancer/tx/tx.amino"; -import * as _493 from "./gamm/pool-models/stableswap/tx.amino"; -import * as _494 from "./gamm/v1beta1/tx.amino"; -import * as _495 from "./incentives/tx.amino"; -import * as _496 from "./lockup/tx.amino"; -import * as _497 from "./poolmanager/v1beta1/tx.amino"; -import * as _498 from "./protorev/v1beta1/tx.amino"; -import * as _499 from "./smartaccount/v1beta1/tx.amino"; -import * as _500 from "./superfluid/tx.amino"; -import * as _501 from "./tokenfactory/v1beta1/tx.amino"; -import * as _502 from "./txfees/v1beta1/tx.amino"; -import * as _503 from "./valset-pref/v1beta1/tx.amino"; -import * as _504 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; -import * as _505 from "./concentratedliquidity/v1beta1/tx.registry"; -import * as _506 from "./gamm/pool-models/balancer/tx/tx.registry"; -import * as _507 from "./gamm/pool-models/stableswap/tx.registry"; -import * as _508 from "./gamm/v1beta1/tx.registry"; -import * as _509 from "./incentives/tx.registry"; -import * as _510 from "./lockup/tx.registry"; -import * as _511 from "./poolmanager/v1beta1/tx.registry"; -import * as _512 from "./protorev/v1beta1/tx.registry"; -import * as _513 from "./smartaccount/v1beta1/tx.registry"; -import * as _514 from "./superfluid/tx.registry"; -import * as _515 from "./tokenfactory/v1beta1/tx.registry"; -import * as _516 from "./txfees/v1beta1/tx.registry"; -import * as _517 from "./valset-pref/v1beta1/tx.registry"; -import * as _518 from "./concentratedliquidity/v1beta1/query.rpc.Query"; -import * as _519 from "./cosmwasmpool/v1beta1/query.rpc.Query"; -import * as _520 from "./gamm/v1beta1/query.rpc.Query"; -import * as _521 from "./incentives/query.rpc.Query"; -import * as _522 from "./lockup/query.rpc.Query"; -import * as _523 from "./pool-incentives/v1beta1/query.rpc.Query"; -import * as _524 from "./poolmanager/v1beta1/query.rpc.Query"; -import * as _525 from "./protorev/v1beta1/query.rpc.Query"; -import * as _526 from "./smartaccount/v1beta1/query.rpc.Query"; -import * as _527 from "./superfluid/query.rpc.Query"; -import * as _528 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _529 from "./txfees/v1beta1/query.rpc.Query"; -import * as _530 from "./valset-pref/v1beta1/query.rpc.Query"; -import * as _531 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; -import * as _532 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; -import * as _533 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; -import * as _534 from "./gamm/pool-models/stableswap/tx.rpc.msg"; -import * as _535 from "./gamm/v1beta1/tx.rpc.msg"; -import * as _536 from "./incentives/tx.rpc.msg"; -import * as _537 from "./lockup/tx.rpc.msg"; -import * as _538 from "./poolmanager/v1beta1/tx.rpc.msg"; -import * as _539 from "./protorev/v1beta1/tx.rpc.msg"; -import * as _540 from "./smartaccount/v1beta1/tx.rpc.msg"; -import * as _541 from "./superfluid/tx.rpc.msg"; -import * as _542 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _543 from "./txfees/v1beta1/tx.rpc.msg"; -import * as _544 from "./valset-pref/v1beta1/tx.rpc.msg"; -import * as _618 from "./rpc.query"; -import * as _619 from "./rpc.tx"; +import * as _504 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; +import * as _505 from "./concentratedliquidity/v1beta1/tx.amino"; +import * as _506 from "./gamm/pool-models/balancer/tx/tx.amino"; +import * as _507 from "./gamm/pool-models/stableswap/tx.amino"; +import * as _508 from "./gamm/v1beta1/tx.amino"; +import * as _509 from "./incentives/tx.amino"; +import * as _510 from "./lockup/tx.amino"; +import * as _511 from "./poolmanager/v1beta1/tx.amino"; +import * as _512 from "./protorev/v1beta1/tx.amino"; +import * as _513 from "./smartaccount/v1beta1/tx.amino"; +import * as _514 from "./superfluid/tx.amino"; +import * as _515 from "./tokenfactory/v1beta1/tx.amino"; +import * as _516 from "./txfees/v1beta1/tx.amino"; +import * as _517 from "./valset-pref/v1beta1/tx.amino"; +import * as _518 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; +import * as _519 from "./concentratedliquidity/v1beta1/tx.registry"; +import * as _520 from "./gamm/pool-models/balancer/tx/tx.registry"; +import * as _521 from "./gamm/pool-models/stableswap/tx.registry"; +import * as _522 from "./gamm/v1beta1/tx.registry"; +import * as _523 from "./incentives/tx.registry"; +import * as _524 from "./lockup/tx.registry"; +import * as _525 from "./poolmanager/v1beta1/tx.registry"; +import * as _526 from "./protorev/v1beta1/tx.registry"; +import * as _527 from "./smartaccount/v1beta1/tx.registry"; +import * as _528 from "./superfluid/tx.registry"; +import * as _529 from "./tokenfactory/v1beta1/tx.registry"; +import * as _530 from "./txfees/v1beta1/tx.registry"; +import * as _531 from "./valset-pref/v1beta1/tx.registry"; +import * as _532 from "./concentratedliquidity/v1beta1/query.rpc.Query"; +import * as _533 from "./cosmwasmpool/v1beta1/query.rpc.Query"; +import * as _534 from "./gamm/v1beta1/query.rpc.Query"; +import * as _535 from "./incentives/query.rpc.Query"; +import * as _536 from "./lockup/query.rpc.Query"; +import * as _537 from "./pool-incentives/v1beta1/query.rpc.Query"; +import * as _538 from "./poolmanager/v1beta1/query.rpc.Query"; +import * as _539 from "./protorev/v1beta1/query.rpc.Query"; +import * as _540 from "./smartaccount/v1beta1/query.rpc.Query"; +import * as _541 from "./superfluid/query.rpc.Query"; +import * as _542 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _543 from "./txfees/v1beta1/query.rpc.Query"; +import * as _544 from "./valset-pref/v1beta1/query.rpc.Query"; +import * as _545 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; +import * as _546 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; +import * as _547 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; +import * as _548 from "./gamm/pool-models/stableswap/tx.rpc.msg"; +import * as _549 from "./gamm/v1beta1/tx.rpc.msg"; +import * as _550 from "./incentives/tx.rpc.msg"; +import * as _551 from "./lockup/tx.rpc.msg"; +import * as _552 from "./poolmanager/v1beta1/tx.rpc.msg"; +import * as _553 from "./protorev/v1beta1/tx.rpc.msg"; +import * as _554 from "./smartaccount/v1beta1/tx.rpc.msg"; +import * as _555 from "./superfluid/tx.rpc.msg"; +import * as _556 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _557 from "./txfees/v1beta1/tx.rpc.msg"; +import * as _558 from "./valset-pref/v1beta1/tx.rpc.msg"; +import * as _645 from "./rpc.query"; +import * as _646 from "./rpc.tx"; export namespace osmosis { export namespace accum { export const v1beta1 = { @@ -142,17 +142,17 @@ export namespace osmosis { poolmodel: { concentrated: { v1beta1: { - ..._490, ..._504, - ..._531 + ..._518, + ..._545 } } }, v1beta1: { - ..._491, ..._505, - ..._518, - ..._532 + ..._519, + ..._532, + ..._546 } }; export namespace cosmwasmpool { @@ -169,7 +169,7 @@ export namespace osmosis { ..._211, ..._212, ..._213, - ..._519 + ..._533 }; } export namespace gamm { @@ -180,27 +180,27 @@ export namespace osmosis { ..._217, ..._218, ..._219, - ..._494, ..._508, - ..._520, - ..._535 + ..._522, + ..._534, + ..._549 }; export namespace poolmodels { export namespace balancer { export const v1beta1 = { ..._220, - ..._492, ..._506, - ..._533 + ..._520, + ..._547 }; } export namespace stableswap { export const v1beta1 = { ..._221, ..._222, - ..._493, ..._507, - ..._534 + ..._521, + ..._548 }; } } @@ -213,10 +213,10 @@ export namespace osmosis { ..._227, ..._228, ..._229, - ..._495, ..._509, - ..._521, - ..._536 + ..._523, + ..._535, + ..._550 }; export const lockup = { ..._230, @@ -224,10 +224,10 @@ export namespace osmosis { ..._232, ..._233, ..._234, - ..._496, ..._510, - ..._522, - ..._537 + ..._524, + ..._536, + ..._551 }; export namespace poolincentives { export const v1beta1 = { @@ -236,7 +236,7 @@ export namespace osmosis { ..._237, ..._238, ..._239, - ..._523 + ..._537 }; } export namespace poolmanager { @@ -247,10 +247,10 @@ export namespace osmosis { ..._243, ..._244, ..._245, - ..._497, ..._511, - ..._524, - ..._538 + ..._525, + ..._538, + ..._552 }; } export namespace protorev { @@ -261,10 +261,10 @@ export namespace osmosis { ..._249, ..._250, ..._251, - ..._498, ..._512, - ..._525, - ..._539 + ..._526, + ..._539, + ..._553 }; } export namespace smartaccount { @@ -274,10 +274,10 @@ export namespace osmosis { ..._254, ..._255, ..._256, - ..._499, ..._513, - ..._526, - ..._540 + ..._527, + ..._540, + ..._554 }; } export const superfluid = { @@ -286,10 +286,10 @@ export namespace osmosis { ..._259, ..._260, ..._261, - ..._500, ..._514, - ..._527, - ..._541 + ..._528, + ..._541, + ..._555 }; export namespace tokenfactory { export const v1beta1 = { @@ -298,10 +298,10 @@ export namespace osmosis { ..._264, ..._265, ..._266, - ..._501, ..._515, - ..._528, - ..._542 + ..._529, + ..._542, + ..._556 }; } export namespace txfees { @@ -312,10 +312,10 @@ export namespace osmosis { ..._270, ..._271, ..._272, - ..._502, ..._516, - ..._529, - ..._543 + ..._530, + ..._543, + ..._557 }; } export namespace valsetpref { @@ -323,14 +323,14 @@ export namespace osmosis { ..._273, ..._274, ..._275, - ..._503, ..._517, - ..._530, - ..._544 + ..._531, + ..._544, + ..._558 }; } export const ClientFactory = { - ..._618, - ..._619 + ..._645, + ..._646 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/bundle.ts b/packages/types/protobuf/codegen/pstake/bundle.ts index 3ec16c173..be67c481a 100644 --- a/packages/types/protobuf/codegen/pstake/bundle.ts +++ b/packages/types/protobuf/codegen/pstake/bundle.ts @@ -19,24 +19,24 @@ import * as _293 from "./ratesync/v1beta1/params"; import * as _294 from "./ratesync/v1beta1/query"; import * as _295 from "./ratesync/v1beta1/ratesync"; import * as _296 from "./ratesync/v1beta1/tx"; -import * as _545 from "./liquidstake/v1beta1/tx.amino"; -import * as _546 from "./liquidstakeibc/v1beta1/msgs.amino"; -import * as _547 from "./lscosmos/v1beta1/msgs.amino"; -import * as _548 from "./ratesync/v1beta1/tx.amino"; -import * as _549 from "./liquidstake/v1beta1/tx.registry"; -import * as _550 from "./liquidstakeibc/v1beta1/msgs.registry"; -import * as _551 from "./lscosmos/v1beta1/msgs.registry"; -import * as _552 from "./ratesync/v1beta1/tx.registry"; -import * as _553 from "./liquidstake/v1beta1/query.rpc.Query"; -import * as _554 from "./liquidstakeibc/v1beta1/query.rpc.Query"; -import * as _555 from "./lscosmos/v1beta1/query.rpc.Query"; -import * as _556 from "./ratesync/v1beta1/query.rpc.Query"; -import * as _557 from "./liquidstake/v1beta1/tx.rpc.msg"; -import * as _558 from "./liquidstakeibc/v1beta1/msgs.rpc.msg"; -import * as _559 from "./lscosmos/v1beta1/msgs.rpc.msg"; -import * as _560 from "./ratesync/v1beta1/tx.rpc.msg"; -import * as _620 from "./rpc.query"; -import * as _621 from "./rpc.tx"; +import * as _559 from "./liquidstake/v1beta1/tx.amino"; +import * as _560 from "./liquidstakeibc/v1beta1/msgs.amino"; +import * as _561 from "./lscosmos/v1beta1/msgs.amino"; +import * as _562 from "./ratesync/v1beta1/tx.amino"; +import * as _563 from "./liquidstake/v1beta1/tx.registry"; +import * as _564 from "./liquidstakeibc/v1beta1/msgs.registry"; +import * as _565 from "./lscosmos/v1beta1/msgs.registry"; +import * as _566 from "./ratesync/v1beta1/tx.registry"; +import * as _567 from "./liquidstake/v1beta1/query.rpc.Query"; +import * as _568 from "./liquidstakeibc/v1beta1/query.rpc.Query"; +import * as _569 from "./lscosmos/v1beta1/query.rpc.Query"; +import * as _570 from "./ratesync/v1beta1/query.rpc.Query"; +import * as _571 from "./liquidstake/v1beta1/tx.rpc.msg"; +import * as _572 from "./liquidstakeibc/v1beta1/msgs.rpc.msg"; +import * as _573 from "./lscosmos/v1beta1/msgs.rpc.msg"; +import * as _574 from "./ratesync/v1beta1/tx.rpc.msg"; +import * as _647 from "./rpc.query"; +import * as _648 from "./rpc.tx"; export namespace pstake { export namespace liquidstake { export const v1beta1 = { @@ -44,10 +44,10 @@ export namespace pstake { ..._277, ..._278, ..._279, - ..._545, - ..._549, - ..._553, - ..._557 + ..._559, + ..._563, + ..._567, + ..._571 }; } export namespace liquidstakeibc { @@ -57,10 +57,10 @@ export namespace pstake { ..._282, ..._283, ..._284, - ..._546, - ..._550, - ..._554, - ..._558 + ..._560, + ..._564, + ..._568, + ..._572 }; } export namespace lscosmos { @@ -71,10 +71,10 @@ export namespace pstake { ..._288, ..._289, ..._290, - ..._547, - ..._551, - ..._555, - ..._559 + ..._561, + ..._565, + ..._569, + ..._573 }; } export namespace ratesync { @@ -85,14 +85,14 @@ export namespace pstake { ..._294, ..._295, ..._296, - ..._548, - ..._552, - ..._556, - ..._560 + ..._562, + ..._566, + ..._570, + ..._574 }; } export const ClientFactory = { - ..._620, - ..._621 + ..._647, + ..._648 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/publicawesome/bundle.ts b/packages/types/protobuf/codegen/publicawesome/bundle.ts index 1c212f4db..d025cc08e 100644 --- a/packages/types/protobuf/codegen/publicawesome/bundle.ts +++ b/packages/types/protobuf/codegen/publicawesome/bundle.ts @@ -16,21 +16,21 @@ import * as _311 from "./stargaze/mint/v1beta1/genesis"; import * as _312 from "./stargaze/mint/v1beta1/mint"; import * as _313 from "./stargaze/mint/v1beta1/query"; import * as _314 from "./stargaze/mint/v1beta1/tx"; -import * as _561 from "./stargaze/alloc/v1beta1/tx.amino"; -import * as _562 from "./stargaze/cron/v1/tx.amino"; -import * as _563 from "./stargaze/globalfee/v1/tx.amino"; -import * as _564 from "./stargaze/alloc/v1beta1/tx.registry"; -import * as _565 from "./stargaze/cron/v1/tx.registry"; -import * as _566 from "./stargaze/globalfee/v1/tx.registry"; -import * as _567 from "./stargaze/alloc/v1beta1/query.rpc.Query"; -import * as _568 from "./stargaze/cron/v1/query.rpc.Query"; -import * as _569 from "./stargaze/globalfee/v1/query.rpc.Query"; -import * as _570 from "./stargaze/mint/v1beta1/query.rpc.Query"; -import * as _571 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; -import * as _572 from "./stargaze/cron/v1/tx.rpc.msg"; -import * as _573 from "./stargaze/globalfee/v1/tx.rpc.msg"; -import * as _622 from "./rpc.query"; -import * as _623 from "./rpc.tx"; +import * as _575 from "./stargaze/alloc/v1beta1/tx.amino"; +import * as _576 from "./stargaze/cron/v1/tx.amino"; +import * as _577 from "./stargaze/globalfee/v1/tx.amino"; +import * as _578 from "./stargaze/alloc/v1beta1/tx.registry"; +import * as _579 from "./stargaze/cron/v1/tx.registry"; +import * as _580 from "./stargaze/globalfee/v1/tx.registry"; +import * as _581 from "./stargaze/alloc/v1beta1/query.rpc.Query"; +import * as _582 from "./stargaze/cron/v1/query.rpc.Query"; +import * as _583 from "./stargaze/globalfee/v1/query.rpc.Query"; +import * as _584 from "./stargaze/mint/v1beta1/query.rpc.Query"; +import * as _585 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; +import * as _586 from "./stargaze/cron/v1/tx.rpc.msg"; +import * as _587 from "./stargaze/globalfee/v1/tx.rpc.msg"; +import * as _649 from "./rpc.query"; +import * as _650 from "./rpc.tx"; export namespace publicawesome { export namespace stargaze { export namespace alloc { @@ -39,10 +39,10 @@ export namespace publicawesome { ..._298, ..._299, ..._300, - ..._561, - ..._564, - ..._567, - ..._571 + ..._575, + ..._578, + ..._581, + ..._585 }; } export namespace cron { @@ -52,10 +52,10 @@ export namespace publicawesome { ..._303, ..._304, ..._305, - ..._562, - ..._565, - ..._568, - ..._572 + ..._576, + ..._579, + ..._582, + ..._586 }; } export namespace globalfee { @@ -65,10 +65,10 @@ export namespace publicawesome { ..._308, ..._309, ..._310, - ..._563, - ..._566, - ..._569, - ..._573 + ..._577, + ..._580, + ..._583, + ..._587 }; } export namespace mint { @@ -77,12 +77,12 @@ export namespace publicawesome { ..._312, ..._313, ..._314, - ..._570 + ..._584 }; } } export const ClientFactory = { - ..._622, - ..._623 + ..._649, + ..._650 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/regen/bundle.ts b/packages/types/protobuf/codegen/regen/bundle.ts index 6742470ff..20954122c 100644 --- a/packages/types/protobuf/codegen/regen/bundle.ts +++ b/packages/types/protobuf/codegen/regen/bundle.ts @@ -25,30 +25,30 @@ import * as _338 from "./ecocredit/v1alpha1/tx"; import * as _339 from "./ecocredit/v1alpha1/types"; import * as _340 from "./intertx/v1/query"; import * as _341 from "./intertx/v1/tx"; -import * as _574 from "./data/v1/tx.amino"; -import * as _575 from "./data/v2/tx.amino"; -import * as _576 from "./ecocredit/basket/v1/tx.amino"; -import * as _577 from "./ecocredit/marketplace/v1/tx.amino"; -import * as _578 from "./ecocredit/v1/tx.amino"; -import * as _579 from "./ecocredit/v1alpha1/tx.amino"; -import * as _580 from "./intertx/v1/tx.amino"; -import * as _581 from "./data/v1/tx.registry"; -import * as _582 from "./data/v2/tx.registry"; -import * as _583 from "./ecocredit/basket/v1/tx.registry"; -import * as _584 from "./ecocredit/marketplace/v1/tx.registry"; -import * as _585 from "./ecocredit/v1/tx.registry"; -import * as _586 from "./ecocredit/v1alpha1/tx.registry"; -import * as _587 from "./intertx/v1/tx.registry"; -import * as _588 from "./intertx/v1/query.rpc.Query"; -import * as _589 from "./data/v1/tx.rpc.msg"; -import * as _590 from "./data/v2/tx.rpc.msg"; -import * as _591 from "./ecocredit/basket/v1/tx.rpc.msg"; -import * as _592 from "./ecocredit/marketplace/v1/tx.rpc.msg"; -import * as _593 from "./ecocredit/v1/tx.rpc.msg"; -import * as _594 from "./ecocredit/v1alpha1/tx.rpc.msg"; -import * as _595 from "./intertx/v1/tx.rpc.msg"; -import * as _624 from "./rpc.query"; -import * as _625 from "./rpc.tx"; +import * as _588 from "./data/v1/tx.amino"; +import * as _589 from "./data/v2/tx.amino"; +import * as _590 from "./ecocredit/basket/v1/tx.amino"; +import * as _591 from "./ecocredit/marketplace/v1/tx.amino"; +import * as _592 from "./ecocredit/v1/tx.amino"; +import * as _593 from "./ecocredit/v1alpha1/tx.amino"; +import * as _594 from "./intertx/v1/tx.amino"; +import * as _595 from "./data/v1/tx.registry"; +import * as _596 from "./data/v2/tx.registry"; +import * as _597 from "./ecocredit/basket/v1/tx.registry"; +import * as _598 from "./ecocredit/marketplace/v1/tx.registry"; +import * as _599 from "./ecocredit/v1/tx.registry"; +import * as _600 from "./ecocredit/v1alpha1/tx.registry"; +import * as _601 from "./intertx/v1/tx.registry"; +import * as _602 from "./intertx/v1/query.rpc.Query"; +import * as _603 from "./data/v1/tx.rpc.msg"; +import * as _604 from "./data/v2/tx.rpc.msg"; +import * as _605 from "./ecocredit/basket/v1/tx.rpc.msg"; +import * as _606 from "./ecocredit/marketplace/v1/tx.rpc.msg"; +import * as _607 from "./ecocredit/v1/tx.rpc.msg"; +import * as _608 from "./ecocredit/v1alpha1/tx.rpc.msg"; +import * as _609 from "./intertx/v1/tx.rpc.msg"; +import * as _651 from "./rpc.query"; +import * as _652 from "./rpc.tx"; export namespace regen { export namespace data { export const v1 = { @@ -56,18 +56,18 @@ export namespace regen { ..._316, ..._317, ..._318, - ..._574, - ..._581, - ..._589 + ..._588, + ..._595, + ..._603 }; export const v2 = { ..._319, ..._320, ..._321, ..._322, - ..._575, - ..._582, - ..._590 + ..._589, + ..._596, + ..._604 }; } export namespace ecocredit { @@ -77,9 +77,9 @@ export namespace regen { ..._324, ..._325, ..._326, - ..._576, - ..._583, - ..._591 + ..._590, + ..._597, + ..._605 }; } export namespace marketplace { @@ -88,9 +88,9 @@ export namespace regen { ..._328, ..._329, ..._330, - ..._577, - ..._584, - ..._592 + ..._591, + ..._598, + ..._606 }; } export namespace orderbook { @@ -103,32 +103,32 @@ export namespace regen { ..._333, ..._334, ..._335, - ..._578, - ..._585, - ..._593 + ..._592, + ..._599, + ..._607 }; export const v1alpha1 = { ..._336, ..._337, ..._338, ..._339, - ..._579, - ..._586, - ..._594 + ..._593, + ..._600, + ..._608 }; } export namespace intertx { export const v1 = { ..._340, ..._341, - ..._580, - ..._587, - ..._588, - ..._595 + ..._594, + ..._601, + ..._602, + ..._609 }; } export const ClientFactory = { - ..._624, - ..._625 + ..._651, + ..._652 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/bundle.ts b/packages/types/protobuf/codegen/secret/bundle.ts new file mode 100644 index 000000000..203747186 --- /dev/null +++ b/packages/types/protobuf/codegen/secret/bundle.ts @@ -0,0 +1,78 @@ +import * as _342 from "./compute/v1beta1/genesis"; +import * as _343 from "./compute/v1beta1/msg"; +import * as _344 from "./compute/v1beta1/query"; +import * as _345 from "./compute/v1beta1/types"; +import * as _346 from "./emergencybutton/v1beta1/genesis"; +import * as _347 from "./emergencybutton/v1beta1/params"; +import * as _348 from "./emergencybutton/v1beta1/query"; +import * as _349 from "./emergencybutton/v1beta1/tx"; +import * as _350 from "./intertx/v1beta1/query"; +import * as _351 from "./intertx/v1beta1/tx"; +import * as _352 from "./registration/v1beta1/genesis"; +import * as _353 from "./registration/v1beta1/msg"; +import * as _354 from "./registration/v1beta1/query"; +import * as _355 from "./registration/v1beta1/types"; +import * as _610 from "./compute/v1beta1/msg.amino"; +import * as _611 from "./emergencybutton/v1beta1/tx.amino"; +import * as _612 from "./intertx/v1beta1/tx.amino"; +import * as _613 from "./compute/v1beta1/msg.registry"; +import * as _614 from "./emergencybutton/v1beta1/tx.registry"; +import * as _615 from "./intertx/v1beta1/tx.registry"; +import * as _616 from "./compute/v1beta1/query.rpc.Query"; +import * as _617 from "./emergencybutton/v1beta1/query.rpc.Query"; +import * as _618 from "./intertx/v1beta1/query.rpc.Query"; +import * as _619 from "./registration/v1beta1/query.rpc.Query"; +import * as _620 from "./compute/v1beta1/msg.rpc.msg"; +import * as _621 from "./emergencybutton/v1beta1/tx.rpc.msg"; +import * as _622 from "./intertx/v1beta1/tx.rpc.msg"; +import * as _653 from "./rpc.query"; +import * as _654 from "./rpc.tx"; +export namespace secret { + export namespace compute { + export const v1beta1 = { + ..._342, + ..._343, + ..._344, + ..._345, + ..._610, + ..._613, + ..._616, + ..._620 + }; + } + export namespace emergencybutton { + export const v1beta1 = { + ..._346, + ..._347, + ..._348, + ..._349, + ..._611, + ..._614, + ..._617, + ..._621 + }; + } + export namespace intertx { + export const v1beta1 = { + ..._350, + ..._351, + ..._612, + ..._615, + ..._618, + ..._622 + }; + } + export namespace registration { + export const v1beta1 = { + ..._352, + ..._353, + ..._354, + ..._355, + ..._619 + }; + } + export const ClientFactory = { + ..._653, + ..._654 + }; +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/client.ts b/packages/types/protobuf/codegen/secret/client.ts new file mode 100644 index 000000000..98d4bf94c --- /dev/null +++ b/packages/types/protobuf/codegen/secret/client.ts @@ -0,0 +1,53 @@ +import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; +import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; +import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as secretComputeV1beta1MsgRegistry from "./compute/v1beta1/msg.registry"; +import * as secretEmergencybuttonV1beta1TxRegistry from "./emergencybutton/v1beta1/tx.registry"; +import * as secretIntertxV1beta1TxRegistry from "./intertx/v1beta1/tx.registry"; +import * as secretComputeV1beta1MsgAmino from "./compute/v1beta1/msg.amino"; +import * as secretEmergencybuttonV1beta1TxAmino from "./emergencybutton/v1beta1/tx.amino"; +import * as secretIntertxV1beta1TxAmino from "./intertx/v1beta1/tx.amino"; +export const secretAminoConverters = { + ...secretComputeV1beta1MsgAmino.AminoConverter, + ...secretEmergencybuttonV1beta1TxAmino.AminoConverter, + ...secretIntertxV1beta1TxAmino.AminoConverter +}; +export const secretProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...secretComputeV1beta1MsgRegistry.registry, ...secretEmergencybuttonV1beta1TxRegistry.registry, ...secretIntertxV1beta1TxRegistry.registry]; +export const getSigningSecretClientOptions = ({ + defaultTypes = defaultRegistryTypes +}: { + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +} = {}): { + registry: Registry; + aminoTypes: AminoTypes; +} => { + const registry = new Registry([...defaultTypes, ...secretProtoRegistry]); + const aminoTypes = new AminoTypes({ + ...secretAminoConverters + }); + return { + registry, + aminoTypes + }; +}; +export const getSigningSecretClient = async ({ + rpcEndpoint, + signer, + defaultTypes = defaultRegistryTypes +}: { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +}) => { + const { + registry, + aminoTypes + } = getSigningSecretClientOptions({ + defaultTypes + }); + const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { + registry: (registry as any), + aminoTypes + }); + return client; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/compute/v1beta1/genesis.ts b/packages/types/protobuf/codegen/secret/compute/v1beta1/genesis.ts new file mode 100644 index 000000000..756255e4e --- /dev/null +++ b/packages/types/protobuf/codegen/secret/compute/v1beta1/genesis.ts @@ -0,0 +1,466 @@ +//@ts-nocheck +import { CodeInfo, CodeInfoAmino, CodeInfoSDKType, ContractInfo, ContractInfoAmino, ContractInfoSDKType, Model, ModelAmino, ModelSDKType, ContractCustomInfo, ContractCustomInfoAmino, ContractCustomInfoSDKType } from "./types"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** GenesisState - genesis state of x/wasm */ +export interface GenesisState { + /** Params params = 1 [(gogoproto.nullable) = false]; */ + codes: Code[]; + contracts: Contract[]; + sequences: Sequence[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/secret.compute.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState - genesis state of x/wasm */ +export interface GenesisStateAmino { + /** Params params = 1 [(gogoproto.nullable) = false]; */ + codes?: CodeAmino[]; + contracts?: ContractAmino[]; + sequences?: SequenceAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/secret.compute.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState - genesis state of x/wasm */ +export interface GenesisStateSDKType { + codes: CodeSDKType[]; + contracts: ContractSDKType[]; + sequences: SequenceSDKType[]; +} +/** Code struct encompasses CodeInfo and CodeBytes */ +export interface Code { + codeId: bigint; + codeInfo: CodeInfo | undefined; + codeBytes: Uint8Array; +} +export interface CodeProtoMsg { + typeUrl: "/secret.compute.v1beta1.Code"; + value: Uint8Array; +} +/** Code struct encompasses CodeInfo and CodeBytes */ +export interface CodeAmino { + code_id?: string; + code_info?: CodeInfoAmino | undefined; + code_bytes?: string; +} +export interface CodeAminoMsg { + type: "/secret.compute.v1beta1.Code"; + value: CodeAmino; +} +/** Code struct encompasses CodeInfo and CodeBytes */ +export interface CodeSDKType { + code_id: bigint; + code_info: CodeInfoSDKType | undefined; + code_bytes: Uint8Array; +} +/** Contract struct encompasses ContractAddress, ContractInfo, and ContractState */ +export interface Contract { + contractAddress: Uint8Array; + contractInfo: ContractInfo | undefined; + contractState: Model[]; + contractCustomInfo?: ContractCustomInfo | undefined; +} +export interface ContractProtoMsg { + typeUrl: "/secret.compute.v1beta1.Contract"; + value: Uint8Array; +} +/** Contract struct encompasses ContractAddress, ContractInfo, and ContractState */ +export interface ContractAmino { + contract_address?: string; + contract_info?: ContractInfoAmino | undefined; + contract_state?: ModelAmino[]; + contract_custom_info?: ContractCustomInfoAmino | undefined; +} +export interface ContractAminoMsg { + type: "/secret.compute.v1beta1.Contract"; + value: ContractAmino; +} +/** Contract struct encompasses ContractAddress, ContractInfo, and ContractState */ +export interface ContractSDKType { + contract_address: Uint8Array; + contract_info: ContractInfoSDKType | undefined; + contract_state: ModelSDKType[]; + contract_custom_info?: ContractCustomInfoSDKType | undefined; +} +/** Sequence id and value of a counter */ +export interface Sequence { + idKey: Uint8Array; + value: bigint; +} +export interface SequenceProtoMsg { + typeUrl: "/secret.compute.v1beta1.Sequence"; + value: Uint8Array; +} +/** Sequence id and value of a counter */ +export interface SequenceAmino { + id_key?: string; + value?: string; +} +export interface SequenceAminoMsg { + type: "/secret.compute.v1beta1.Sequence"; + value: SequenceAmino; +} +/** Sequence id and value of a counter */ +export interface SequenceSDKType { + id_key: Uint8Array; + value: bigint; +} +function createBaseGenesisState(): GenesisState { + return { + codes: [], + contracts: [], + sequences: [] + }; +} +export const GenesisState = { + typeUrl: "/secret.compute.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.codes) { + Code.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.contracts) { + Contract.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.sequences) { + Sequence.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.codes.push(Code.decode(reader, reader.uint32(), useInterfaces)); + break; + case 3: + message.contracts.push(Contract.decode(reader, reader.uint32(), useInterfaces)); + break; + case 4: + message.sequences.push(Sequence.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.codes = object.codes?.map(e => Code.fromPartial(e)) || []; + message.contracts = object.contracts?.map(e => Contract.fromPartial(e)) || []; + message.sequences = object.sequences?.map(e => Sequence.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.codes = object.codes?.map(e => Code.fromAmino(e)) || []; + message.contracts = object.contracts?.map(e => Contract.fromAmino(e)) || []; + message.sequences = object.sequences?.map(e => Sequence.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState, useInterfaces: boolean = false): GenesisStateAmino { + const obj: any = {}; + if (message.codes) { + obj.codes = message.codes.map(e => e ? Code.toAmino(e, useInterfaces) : undefined); + } else { + obj.codes = []; + } + if (message.contracts) { + obj.contracts = message.contracts.map(e => e ? Contract.toAmino(e, useInterfaces) : undefined); + } else { + obj.contracts = []; + } + if (message.sequences) { + obj.sequences = message.sequences.map(e => e ? Sequence.toAmino(e, useInterfaces) : undefined); + } else { + obj.sequences = []; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg, useInterfaces: boolean = false): GenesisState { + return GenesisState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +function createBaseCode(): Code { + return { + codeId: BigInt(0), + codeInfo: CodeInfo.fromPartial({}), + codeBytes: new Uint8Array() + }; +} +export const Code = { + typeUrl: "/secret.compute.v1beta1.Code", + encode(message: Code, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.codeInfo !== undefined) { + CodeInfo.encode(message.codeInfo, writer.uint32(18).fork()).ldelim(); + } + if (message.codeBytes.length !== 0) { + writer.uint32(26).bytes(message.codeBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Code { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCode(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.codeInfo = CodeInfo.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.codeBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Code { + const message = createBaseCode(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.codeInfo = object.codeInfo !== undefined && object.codeInfo !== null ? CodeInfo.fromPartial(object.codeInfo) : undefined; + message.codeBytes = object.codeBytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: CodeAmino): Code { + const message = createBaseCode(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.code_info !== undefined && object.code_info !== null) { + message.codeInfo = CodeInfo.fromAmino(object.code_info); + } + if (object.code_bytes !== undefined && object.code_bytes !== null) { + message.codeBytes = bytesFromBase64(object.code_bytes); + } + return message; + }, + toAmino(message: Code, useInterfaces: boolean = false): CodeAmino { + const obj: any = {}; + obj.code_id = message.codeId ? message.codeId.toString() : undefined; + obj.code_info = message.codeInfo ? CodeInfo.toAmino(message.codeInfo, useInterfaces) : undefined; + obj.code_bytes = message.codeBytes ? base64FromBytes(message.codeBytes) : undefined; + return obj; + }, + fromAminoMsg(object: CodeAminoMsg): Code { + return Code.fromAmino(object.value); + }, + fromProtoMsg(message: CodeProtoMsg, useInterfaces: boolean = false): Code { + return Code.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Code): Uint8Array { + return Code.encode(message).finish(); + }, + toProtoMsg(message: Code): CodeProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.Code", + value: Code.encode(message).finish() + }; + } +}; +function createBaseContract(): Contract { + return { + contractAddress: new Uint8Array(), + contractInfo: ContractInfo.fromPartial({}), + contractState: [], + contractCustomInfo: undefined + }; +} +export const Contract = { + typeUrl: "/secret.compute.v1beta1.Contract", + encode(message: Contract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress.length !== 0) { + writer.uint32(10).bytes(message.contractAddress); + } + if (message.contractInfo !== undefined) { + ContractInfo.encode(message.contractInfo, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.contractState) { + Model.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.contractCustomInfo !== undefined) { + ContractCustomInfo.encode(message.contractCustomInfo, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Contract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.bytes(); + break; + case 2: + message.contractInfo = ContractInfo.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.contractState.push(Model.decode(reader, reader.uint32(), useInterfaces)); + break; + case 4: + message.contractCustomInfo = ContractCustomInfo.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Contract { + const message = createBaseContract(); + message.contractAddress = object.contractAddress ?? new Uint8Array(); + message.contractInfo = object.contractInfo !== undefined && object.contractInfo !== null ? ContractInfo.fromPartial(object.contractInfo) : undefined; + message.contractState = object.contractState?.map(e => Model.fromPartial(e)) || []; + message.contractCustomInfo = object.contractCustomInfo !== undefined && object.contractCustomInfo !== null ? ContractCustomInfo.fromPartial(object.contractCustomInfo) : undefined; + return message; + }, + fromAmino(object: ContractAmino): Contract { + const message = createBaseContract(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = bytesFromBase64(object.contract_address); + } + if (object.contract_info !== undefined && object.contract_info !== null) { + message.contractInfo = ContractInfo.fromAmino(object.contract_info); + } + message.contractState = object.contract_state?.map(e => Model.fromAmino(e)) || []; + if (object.contract_custom_info !== undefined && object.contract_custom_info !== null) { + message.contractCustomInfo = ContractCustomInfo.fromAmino(object.contract_custom_info); + } + return message; + }, + toAmino(message: Contract, useInterfaces: boolean = false): ContractAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress ? base64FromBytes(message.contractAddress) : undefined; + obj.contract_info = message.contractInfo ? ContractInfo.toAmino(message.contractInfo, useInterfaces) : undefined; + if (message.contractState) { + obj.contract_state = message.contractState.map(e => e ? Model.toAmino(e, useInterfaces) : undefined); + } else { + obj.contract_state = []; + } + obj.contract_custom_info = message.contractCustomInfo ? ContractCustomInfo.toAmino(message.contractCustomInfo, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: ContractAminoMsg): Contract { + return Contract.fromAmino(object.value); + }, + fromProtoMsg(message: ContractProtoMsg, useInterfaces: boolean = false): Contract { + return Contract.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Contract): Uint8Array { + return Contract.encode(message).finish(); + }, + toProtoMsg(message: Contract): ContractProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.Contract", + value: Contract.encode(message).finish() + }; + } +}; +function createBaseSequence(): Sequence { + return { + idKey: new Uint8Array(), + value: BigInt(0) + }; +} +export const Sequence = { + typeUrl: "/secret.compute.v1beta1.Sequence", + encode(message: Sequence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.idKey.length !== 0) { + writer.uint32(10).bytes(message.idKey); + } + if (message.value !== BigInt(0)) { + writer.uint32(16).uint64(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Sequence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSequence(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.idKey = reader.bytes(); + break; + case 2: + message.value = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Sequence { + const message = createBaseSequence(); + message.idKey = object.idKey ?? new Uint8Array(); + message.value = object.value !== undefined && object.value !== null ? BigInt(object.value.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SequenceAmino): Sequence { + const message = createBaseSequence(); + if (object.id_key !== undefined && object.id_key !== null) { + message.idKey = bytesFromBase64(object.id_key); + } + if (object.value !== undefined && object.value !== null) { + message.value = BigInt(object.value); + } + return message; + }, + toAmino(message: Sequence, useInterfaces: boolean = false): SequenceAmino { + const obj: any = {}; + obj.id_key = message.idKey ? base64FromBytes(message.idKey) : undefined; + obj.value = message.value ? message.value.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SequenceAminoMsg): Sequence { + return Sequence.fromAmino(object.value); + }, + fromProtoMsg(message: SequenceProtoMsg, useInterfaces: boolean = false): Sequence { + return Sequence.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Sequence): Uint8Array { + return Sequence.encode(message).finish(); + }, + toProtoMsg(message: Sequence): SequenceProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.Sequence", + value: Sequence.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/compute/v1beta1/msg.amino.ts b/packages/types/protobuf/codegen/secret/compute/v1beta1/msg.amino.ts new file mode 100644 index 000000000..ec9cfd70a --- /dev/null +++ b/packages/types/protobuf/codegen/secret/compute/v1beta1/msg.amino.ts @@ -0,0 +1,33 @@ +import { MsgStoreCode, MsgInstantiateContract, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin } from "./msg"; +export const AminoConverter = { + "/secret.compute.v1beta1.MsgStoreCode": { + aminoType: "/secret.compute.v1beta1.MsgStoreCode", + toAmino: MsgStoreCode.toAmino, + fromAmino: MsgStoreCode.fromAmino + }, + "/secret.compute.v1beta1.MsgInstantiateContract": { + aminoType: "/secret.compute.v1beta1.MsgInstantiateContract", + toAmino: MsgInstantiateContract.toAmino, + fromAmino: MsgInstantiateContract.fromAmino + }, + "/secret.compute.v1beta1.MsgExecuteContract": { + aminoType: "/secret.compute.v1beta1.MsgExecuteContract", + toAmino: MsgExecuteContract.toAmino, + fromAmino: MsgExecuteContract.fromAmino + }, + "/secret.compute.v1beta1.MsgMigrateContract": { + aminoType: "/secret.compute.v1beta1.MsgMigrateContract", + toAmino: MsgMigrateContract.toAmino, + fromAmino: MsgMigrateContract.fromAmino + }, + "/secret.compute.v1beta1.MsgUpdateAdmin": { + aminoType: "/secret.compute.v1beta1.MsgUpdateAdmin", + toAmino: MsgUpdateAdmin.toAmino, + fromAmino: MsgUpdateAdmin.fromAmino + }, + "/secret.compute.v1beta1.MsgClearAdmin": { + aminoType: "/secret.compute.v1beta1.MsgClearAdmin", + toAmino: MsgClearAdmin.toAmino, + fromAmino: MsgClearAdmin.fromAmino + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/compute/v1beta1/msg.registry.ts b/packages/types/protobuf/codegen/secret/compute/v1beta1/msg.registry.ts new file mode 100644 index 000000000..eaed30d07 --- /dev/null +++ b/packages/types/protobuf/codegen/secret/compute/v1beta1/msg.registry.ts @@ -0,0 +1,125 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgStoreCode, MsgInstantiateContract, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin } from "./msg"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/secret.compute.v1beta1.MsgStoreCode", MsgStoreCode], ["/secret.compute.v1beta1.MsgInstantiateContract", MsgInstantiateContract], ["/secret.compute.v1beta1.MsgExecuteContract", MsgExecuteContract], ["/secret.compute.v1beta1.MsgMigrateContract", MsgMigrateContract], ["/secret.compute.v1beta1.MsgUpdateAdmin", MsgUpdateAdmin], ["/secret.compute.v1beta1.MsgClearAdmin", MsgClearAdmin]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: "/secret.compute.v1beta1.MsgStoreCode", + value: MsgStoreCode.encode(value).finish() + }; + }, + instantiateContract(value: MsgInstantiateContract) { + return { + typeUrl: "/secret.compute.v1beta1.MsgInstantiateContract", + value: MsgInstantiateContract.encode(value).finish() + }; + }, + executeContract(value: MsgExecuteContract) { + return { + typeUrl: "/secret.compute.v1beta1.MsgExecuteContract", + value: MsgExecuteContract.encode(value).finish() + }; + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: "/secret.compute.v1beta1.MsgMigrateContract", + value: MsgMigrateContract.encode(value).finish() + }; + }, + updateAdmin(value: MsgUpdateAdmin) { + return { + typeUrl: "/secret.compute.v1beta1.MsgUpdateAdmin", + value: MsgUpdateAdmin.encode(value).finish() + }; + }, + clearAdmin(value: MsgClearAdmin) { + return { + typeUrl: "/secret.compute.v1beta1.MsgClearAdmin", + value: MsgClearAdmin.encode(value).finish() + }; + } + }, + withTypeUrl: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: "/secret.compute.v1beta1.MsgStoreCode", + value + }; + }, + instantiateContract(value: MsgInstantiateContract) { + return { + typeUrl: "/secret.compute.v1beta1.MsgInstantiateContract", + value + }; + }, + executeContract(value: MsgExecuteContract) { + return { + typeUrl: "/secret.compute.v1beta1.MsgExecuteContract", + value + }; + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: "/secret.compute.v1beta1.MsgMigrateContract", + value + }; + }, + updateAdmin(value: MsgUpdateAdmin) { + return { + typeUrl: "/secret.compute.v1beta1.MsgUpdateAdmin", + value + }; + }, + clearAdmin(value: MsgClearAdmin) { + return { + typeUrl: "/secret.compute.v1beta1.MsgClearAdmin", + value + }; + } + }, + fromPartial: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: "/secret.compute.v1beta1.MsgStoreCode", + value: MsgStoreCode.fromPartial(value) + }; + }, + instantiateContract(value: MsgInstantiateContract) { + return { + typeUrl: "/secret.compute.v1beta1.MsgInstantiateContract", + value: MsgInstantiateContract.fromPartial(value) + }; + }, + executeContract(value: MsgExecuteContract) { + return { + typeUrl: "/secret.compute.v1beta1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial(value) + }; + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: "/secret.compute.v1beta1.MsgMigrateContract", + value: MsgMigrateContract.fromPartial(value) + }; + }, + updateAdmin(value: MsgUpdateAdmin) { + return { + typeUrl: "/secret.compute.v1beta1.MsgUpdateAdmin", + value: MsgUpdateAdmin.fromPartial(value) + }; + }, + clearAdmin(value: MsgClearAdmin) { + return { + typeUrl: "/secret.compute.v1beta1.MsgClearAdmin", + value: MsgClearAdmin.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/compute/v1beta1/msg.rpc.msg.ts b/packages/types/protobuf/codegen/secret/compute/v1beta1/msg.rpc.msg.ts new file mode 100644 index 000000000..3398bbf85 --- /dev/null +++ b/packages/types/protobuf/codegen/secret/compute/v1beta1/msg.rpc.msg.ts @@ -0,0 +1,60 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgStoreCode, MsgStoreCodeResponse, MsgInstantiateContract, MsgInstantiateContractResponse, MsgExecuteContract, MsgExecuteContractResponse, MsgMigrateContract, MsgMigrateContractResponse, MsgUpdateAdmin, MsgUpdateAdminResponse, MsgClearAdmin, MsgClearAdminResponse } from "./msg"; +/** Msg defines the wasm Msg service. */ +export interface Msg { + /** StoreCode to submit Wasm code to the system */ + storeCode(request: MsgStoreCode): Promise; + /** Instantiate creates a new smart contract instance for the given code id. */ + instantiateContract(request: MsgInstantiateContract): Promise; + /** Execute submits the given message data to a smart contract */ + executeContract(request: MsgExecuteContract): Promise; + /** Migrate runs a code upgrade/ downgrade for a smart contract */ + migrateContract(request: MsgMigrateContract): Promise; + /** UpdateAdmin sets a new admin for a smart contract */ + updateAdmin(request: MsgUpdateAdmin): Promise; + /** ClearAdmin removes any admin stored for a smart contract */ + clearAdmin(request: MsgClearAdmin): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.storeCode = this.storeCode.bind(this); + this.instantiateContract = this.instantiateContract.bind(this); + this.executeContract = this.executeContract.bind(this); + this.migrateContract = this.migrateContract.bind(this); + this.updateAdmin = this.updateAdmin.bind(this); + this.clearAdmin = this.clearAdmin.bind(this); + } + storeCode(request: MsgStoreCode, useInterfaces: boolean = true): Promise { + const data = MsgStoreCode.encode(request).finish(); + const promise = this.rpc.request("secret.compute.v1beta1.Msg", "StoreCode", data); + return promise.then(data => MsgStoreCodeResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + instantiateContract(request: MsgInstantiateContract, useInterfaces: boolean = true): Promise { + const data = MsgInstantiateContract.encode(request).finish(); + const promise = this.rpc.request("secret.compute.v1beta1.Msg", "InstantiateContract", data); + return promise.then(data => MsgInstantiateContractResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + executeContract(request: MsgExecuteContract, useInterfaces: boolean = true): Promise { + const data = MsgExecuteContract.encode(request).finish(); + const promise = this.rpc.request("secret.compute.v1beta1.Msg", "ExecuteContract", data); + return promise.then(data => MsgExecuteContractResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + migrateContract(request: MsgMigrateContract, useInterfaces: boolean = true): Promise { + const data = MsgMigrateContract.encode(request).finish(); + const promise = this.rpc.request("secret.compute.v1beta1.Msg", "MigrateContract", data); + return promise.then(data => MsgMigrateContractResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + updateAdmin(request: MsgUpdateAdmin, useInterfaces: boolean = true): Promise { + const data = MsgUpdateAdmin.encode(request).finish(); + const promise = this.rpc.request("secret.compute.v1beta1.Msg", "UpdateAdmin", data); + return promise.then(data => MsgUpdateAdminResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + clearAdmin(request: MsgClearAdmin, useInterfaces: boolean = true): Promise { + const data = MsgClearAdmin.encode(request).finish(); + const promise = this.rpc.request("secret.compute.v1beta1.Msg", "ClearAdmin", data); + return promise.then(data => MsgClearAdminResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/compute/v1beta1/msg.ts b/packages/types/protobuf/codegen/secret/compute/v1beta1/msg.ts new file mode 100644 index 000000000..6db30fad0 --- /dev/null +++ b/packages/types/protobuf/codegen/secret/compute/v1beta1/msg.ts @@ -0,0 +1,1415 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { fromBase64, toBase64 } from "@cosmjs/encoding"; +export interface MsgStoreCode { + /** sender is the canonical address of the sender */ + sender: Uint8Array; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** Source is a valid absolute HTTPS URI to the contract's source code, optional */ + source: string; + /** Builder is a valid docker image name with tag, optional */ + builder: string; +} +export interface MsgStoreCodeProtoMsg { + typeUrl: "/secret.compute.v1beta1.MsgStoreCode"; + value: Uint8Array; +} +export interface MsgStoreCodeAmino { + /** sender is the canonical address of the sender */ + sender?: string; + /** WASMByteCode can be raw or gzip compressed */ + wasm_byte_code?: string; + /** Source is a valid absolute HTTPS URI to the contract's source code, optional */ + source?: string; + /** Builder is a valid docker image name with tag, optional */ + builder?: string; +} +export interface MsgStoreCodeAminoMsg { + type: "/secret.compute.v1beta1.MsgStoreCode"; + value: MsgStoreCodeAmino; +} +export interface MsgStoreCodeSDKType { + sender: Uint8Array; + wasm_byte_code: Uint8Array; + source: string; + builder: string; +} +/** MsgStoreCodeResponse returns store result data. */ +export interface MsgStoreCodeResponse { + /** CodeID is the reference to the stored WASM code */ + codeId: bigint; +} +export interface MsgStoreCodeResponseProtoMsg { + typeUrl: "/secret.compute.v1beta1.MsgStoreCodeResponse"; + value: Uint8Array; +} +/** MsgStoreCodeResponse returns store result data. */ +export interface MsgStoreCodeResponseAmino { + /** CodeID is the reference to the stored WASM code */ + code_id?: string; +} +export interface MsgStoreCodeResponseAminoMsg { + type: "/secret.compute.v1beta1.MsgStoreCodeResponse"; + value: MsgStoreCodeResponseAmino; +} +/** MsgStoreCodeResponse returns store result data. */ +export interface MsgStoreCodeResponseSDKType { + code_id: bigint; +} +export interface MsgInstantiateContract { + /** sender is the canonical address of the sender */ + sender: Uint8Array; + callbackCodeHash: string; + codeId: bigint; + label: string; + /** init_msg is an encrypted input to pass to the contract on init */ + initMsg: Uint8Array; + initFunds: Coin[]; + /** used internally for encryption, should always be empty in a signed transaction */ + callbackSig: Uint8Array; + /** Admin is an optional address that can execute migrations */ + admin: string; +} +export interface MsgInstantiateContractProtoMsg { + typeUrl: "/secret.compute.v1beta1.MsgInstantiateContract"; + value: Uint8Array; +} +export interface MsgInstantiateContractAmino { + /** sender is the canonical address of the sender */ + sender?: string; + callback_code_hash?: string; + code_id?: string; + label?: string; + /** init_msg is an encrypted input to pass to the contract on init */ + init_msg?: string; + init_funds?: CoinAmino[]; + /** used internally for encryption, should always be empty in a signed transaction */ + callback_sig?: string; + /** Admin is an optional address that can execute migrations */ + admin?: string; +} +export interface MsgInstantiateContractAminoMsg { + type: "/secret.compute.v1beta1.MsgInstantiateContract"; + value: MsgInstantiateContractAmino; +} +export interface MsgInstantiateContractSDKType { + sender: Uint8Array; + callback_code_hash: string; + code_id: bigint; + label: string; + init_msg: Uint8Array; + init_funds: CoinSDKType[]; + callback_sig: Uint8Array; + admin: string; +} +/** MsgInstantiateContractResponse return instantiation result data */ +export interface MsgInstantiateContractResponse { + /** Address is the bech32 address of the new contract instance. */ + address: string; + /** Data contains base64-encoded bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgInstantiateContractResponseProtoMsg { + typeUrl: "/secret.compute.v1beta1.MsgInstantiateContractResponse"; + value: Uint8Array; +} +/** MsgInstantiateContractResponse return instantiation result data */ +export interface MsgInstantiateContractResponseAmino { + /** Address is the bech32 address of the new contract instance. */ + address?: string; + /** Data contains base64-encoded bytes to returned from the contract */ + data?: string; +} +export interface MsgInstantiateContractResponseAminoMsg { + type: "/secret.compute.v1beta1.MsgInstantiateContractResponse"; + value: MsgInstantiateContractResponseAmino; +} +/** MsgInstantiateContractResponse return instantiation result data */ +export interface MsgInstantiateContractResponseSDKType { + address: string; + data: Uint8Array; +} +export interface MsgExecuteContract { + /** sender is the canonical address of the sender */ + sender: Uint8Array; + /** contract is the canonical address of the contract */ + contract: Uint8Array; + /** msg is an encrypted input to pass to the contract on execute */ + msg: Uint8Array; + /** used internally for encryption, should always be empty in a signed transaction */ + callbackCodeHash: string; + sentFunds: Coin[]; + /** used internally for encryption, should always be empty in a signed transaction */ + callbackSig: Uint8Array; +} +export interface MsgExecuteContractProtoMsg { + typeUrl: "/secret.compute.v1beta1.MsgExecuteContract"; + value: Uint8Array; +} +export interface MsgExecuteContractAmino { + /** sender is the canonical address of the sender */ + sender?: string; + /** contract is the canonical address of the contract */ + contract?: string; + /** msg is an encrypted input to pass to the contract on execute */ + msg?: string; + /** used internally for encryption, should always be empty in a signed transaction */ + callback_code_hash?: string; + sent_funds?: CoinAmino[]; + /** used internally for encryption, should always be empty in a signed transaction */ + callback_sig?: string; +} +export interface MsgExecuteContractAminoMsg { + type: "/secret.compute.v1beta1.MsgExecuteContract"; + value: MsgExecuteContractAmino; +} +export interface MsgExecuteContractSDKType { + sender: Uint8Array; + contract: Uint8Array; + msg: Uint8Array; + callback_code_hash: string; + sent_funds: CoinSDKType[]; + callback_sig: Uint8Array; +} +/** MsgExecuteContractResponse returns execution result data. */ +export interface MsgExecuteContractResponse { + /** Data contains base64-encoded bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgExecuteContractResponseProtoMsg { + typeUrl: "/secret.compute.v1beta1.MsgExecuteContractResponse"; + value: Uint8Array; +} +/** MsgExecuteContractResponse returns execution result data. */ +export interface MsgExecuteContractResponseAmino { + /** Data contains base64-encoded bytes to returned from the contract */ + data?: string; +} +export interface MsgExecuteContractResponseAminoMsg { + type: "/secret.compute.v1beta1.MsgExecuteContractResponse"; + value: MsgExecuteContractResponseAmino; +} +/** MsgExecuteContractResponse returns execution result data. */ +export interface MsgExecuteContractResponseSDKType { + data: Uint8Array; +} +/** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */ +export interface MsgMigrateContract { + /** Sender is the that actor that signed the messages */ + sender: string; + /** Contract is the address of the smart contract */ + contract: string; + /** CodeID references the new WASM code */ + codeId: bigint; + /** msg is an encrypted input to pass to the contract on migration */ + msg: Uint8Array; + /** used internally for encryption, should always be empty in a signed transaction */ + callbackSig: Uint8Array; + /** used internally for encryption, should always be empty in a signed transaction */ + callbackCodeHash: string; +} +export interface MsgMigrateContractProtoMsg { + typeUrl: "/secret.compute.v1beta1.MsgMigrateContract"; + value: Uint8Array; +} +/** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */ +export interface MsgMigrateContractAmino { + /** Sender is the that actor that signed the messages */ + sender?: string; + /** Contract is the address of the smart contract */ + contract?: string; + /** CodeID references the new WASM code */ + code_id?: string; + /** msg is an encrypted input to pass to the contract on migration */ + msg?: string; + /** used internally for encryption, should always be empty in a signed transaction */ + callback_sig?: string; + /** used internally for encryption, should always be empty in a signed transaction */ + callback_code_hash?: string; +} +export interface MsgMigrateContractAminoMsg { + type: "/secret.compute.v1beta1.MsgMigrateContract"; + value: MsgMigrateContractAmino; +} +/** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */ +export interface MsgMigrateContractSDKType { + sender: string; + contract: string; + code_id: bigint; + msg: Uint8Array; + callback_sig: Uint8Array; + callback_code_hash: string; +} +/** MsgMigrateContractResponse returns contract migration result data. */ +export interface MsgMigrateContractResponse { + /** + * Data contains same raw bytes returned as data from the wasm contract. + * (May be empty) + */ + data: Uint8Array; +} +export interface MsgMigrateContractResponseProtoMsg { + typeUrl: "/secret.compute.v1beta1.MsgMigrateContractResponse"; + value: Uint8Array; +} +/** MsgMigrateContractResponse returns contract migration result data. */ +export interface MsgMigrateContractResponseAmino { + /** + * Data contains same raw bytes returned as data from the wasm contract. + * (May be empty) + */ + data?: string; +} +export interface MsgMigrateContractResponseAminoMsg { + type: "/secret.compute.v1beta1.MsgMigrateContractResponse"; + value: MsgMigrateContractResponseAmino; +} +/** MsgMigrateContractResponse returns contract migration result data. */ +export interface MsgMigrateContractResponseSDKType { + data: Uint8Array; +} +/** MsgUpdateAdmin sets a new admin for a smart contract */ +export interface MsgUpdateAdmin { + /** Sender is the that actor that signed the messages */ + sender: string; + /** NewAdmin address to be set */ + newAdmin: string; + /** Contract is the address of the smart contract */ + contract: string; + /** used internally for encryption, should always be empty in a signed transaction */ + callbackSig: Uint8Array; +} +export interface MsgUpdateAdminProtoMsg { + typeUrl: "/secret.compute.v1beta1.MsgUpdateAdmin"; + value: Uint8Array; +} +/** MsgUpdateAdmin sets a new admin for a smart contract */ +export interface MsgUpdateAdminAmino { + /** Sender is the that actor that signed the messages */ + sender?: string; + /** NewAdmin address to be set */ + new_admin?: string; + /** Contract is the address of the smart contract */ + contract?: string; + /** used internally for encryption, should always be empty in a signed transaction */ + callback_sig?: string; +} +export interface MsgUpdateAdminAminoMsg { + type: "/secret.compute.v1beta1.MsgUpdateAdmin"; + value: MsgUpdateAdminAmino; +} +/** MsgUpdateAdmin sets a new admin for a smart contract */ +export interface MsgUpdateAdminSDKType { + sender: string; + new_admin: string; + contract: string; + callback_sig: Uint8Array; +} +/** MsgUpdateAdminResponse returns empty data */ +export interface MsgUpdateAdminResponse {} +export interface MsgUpdateAdminResponseProtoMsg { + typeUrl: "/secret.compute.v1beta1.MsgUpdateAdminResponse"; + value: Uint8Array; +} +/** MsgUpdateAdminResponse returns empty data */ +export interface MsgUpdateAdminResponseAmino {} +export interface MsgUpdateAdminResponseAminoMsg { + type: "/secret.compute.v1beta1.MsgUpdateAdminResponse"; + value: MsgUpdateAdminResponseAmino; +} +/** MsgUpdateAdminResponse returns empty data */ +export interface MsgUpdateAdminResponseSDKType {} +/** MsgClearAdmin removes any admin stored for a smart contract */ +export interface MsgClearAdmin { + /** Sender is the that actor that signed the messages */ + sender: string; + /** Contract is the address of the smart contract */ + contract: string; + /** used internally for encryption, should always be empty in a signed transaction */ + callbackSig: Uint8Array; +} +export interface MsgClearAdminProtoMsg { + typeUrl: "/secret.compute.v1beta1.MsgClearAdmin"; + value: Uint8Array; +} +/** MsgClearAdmin removes any admin stored for a smart contract */ +export interface MsgClearAdminAmino { + /** Sender is the that actor that signed the messages */ + sender?: string; + /** Contract is the address of the smart contract */ + contract?: string; + /** used internally for encryption, should always be empty in a signed transaction */ + callback_sig?: string; +} +export interface MsgClearAdminAminoMsg { + type: "/secret.compute.v1beta1.MsgClearAdmin"; + value: MsgClearAdminAmino; +} +/** MsgClearAdmin removes any admin stored for a smart contract */ +export interface MsgClearAdminSDKType { + sender: string; + contract: string; + callback_sig: Uint8Array; +} +/** MsgClearAdminResponse returns empty data */ +export interface MsgClearAdminResponse {} +export interface MsgClearAdminResponseProtoMsg { + typeUrl: "/secret.compute.v1beta1.MsgClearAdminResponse"; + value: Uint8Array; +} +/** MsgClearAdminResponse returns empty data */ +export interface MsgClearAdminResponseAmino {} +export interface MsgClearAdminResponseAminoMsg { + type: "/secret.compute.v1beta1.MsgClearAdminResponse"; + value: MsgClearAdminResponseAmino; +} +/** MsgClearAdminResponse returns empty data */ +export interface MsgClearAdminResponseSDKType {} +function createBaseMsgStoreCode(): MsgStoreCode { + return { + sender: new Uint8Array(), + wasmByteCode: new Uint8Array(), + source: "", + builder: "" + }; +} +export const MsgStoreCode = { + typeUrl: "/secret.compute.v1beta1.MsgStoreCode", + encode(message: MsgStoreCode, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender.length !== 0) { + writer.uint32(10).bytes(message.sender); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(18).bytes(message.wasmByteCode); + } + if (message.source !== "") { + writer.uint32(26).string(message.source); + } + if (message.builder !== "") { + writer.uint32(34).string(message.builder); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgStoreCode { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreCode(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.bytes(); + break; + case 2: + message.wasmByteCode = reader.bytes(); + break; + case 3: + message.source = reader.string(); + break; + case 4: + message.builder = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgStoreCode { + const message = createBaseMsgStoreCode(); + message.sender = object.sender ?? new Uint8Array(); + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.source = object.source ?? ""; + message.builder = object.builder ?? ""; + return message; + }, + fromAmino(object: MsgStoreCodeAmino): MsgStoreCode { + const message = createBaseMsgStoreCode(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = bytesFromBase64(object.sender); + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.source !== undefined && object.source !== null) { + message.source = object.source; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = object.builder; + } + return message; + }, + toAmino(message: MsgStoreCode, useInterfaces: boolean = false): MsgStoreCodeAmino { + const obj: any = {}; + obj.sender = message.sender ? base64FromBytes(message.sender) : undefined; + obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; + obj.source = message.source; + obj.builder = message.builder; + return obj; + }, + fromAminoMsg(object: MsgStoreCodeAminoMsg): MsgStoreCode { + return MsgStoreCode.fromAmino(object.value); + }, + fromProtoMsg(message: MsgStoreCodeProtoMsg, useInterfaces: boolean = false): MsgStoreCode { + return MsgStoreCode.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgStoreCode): Uint8Array { + return MsgStoreCode.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreCode): MsgStoreCodeProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.MsgStoreCode", + value: MsgStoreCode.encode(message).finish() + }; + } +}; +function createBaseMsgStoreCodeResponse(): MsgStoreCodeResponse { + return { + codeId: BigInt(0) + }; +} +export const MsgStoreCodeResponse = { + typeUrl: "/secret.compute.v1beta1.MsgStoreCodeResponse", + encode(message: MsgStoreCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgStoreCodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreCodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgStoreCodeResponse { + const message = createBaseMsgStoreCodeResponse(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgStoreCodeResponseAmino): MsgStoreCodeResponse { + const message = createBaseMsgStoreCodeResponse(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + return message; + }, + toAmino(message: MsgStoreCodeResponse, useInterfaces: boolean = false): MsgStoreCodeResponseAmino { + const obj: any = {}; + obj.code_id = message.codeId ? message.codeId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgStoreCodeResponseAminoMsg): MsgStoreCodeResponse { + return MsgStoreCodeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgStoreCodeResponseProtoMsg, useInterfaces: boolean = false): MsgStoreCodeResponse { + return MsgStoreCodeResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgStoreCodeResponse): Uint8Array { + return MsgStoreCodeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreCodeResponse): MsgStoreCodeResponseProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.MsgStoreCodeResponse", + value: MsgStoreCodeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgInstantiateContract(): MsgInstantiateContract { + return { + sender: new Uint8Array(), + callbackCodeHash: "", + codeId: BigInt(0), + label: "", + initMsg: new Uint8Array(), + initFunds: [], + callbackSig: new Uint8Array(), + admin: "" + }; +} +export const MsgInstantiateContract = { + typeUrl: "/secret.compute.v1beta1.MsgInstantiateContract", + encode(message: MsgInstantiateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender.length !== 0) { + writer.uint32(10).bytes(message.sender); + } + if (message.callbackCodeHash !== "") { + writer.uint32(18).string(message.callbackCodeHash); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(24).uint64(message.codeId); + } + if (message.label !== "") { + writer.uint32(34).string(message.label); + } + if (message.initMsg.length !== 0) { + writer.uint32(42).bytes(message.initMsg); + } + for (const v of message.initFunds) { + Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + } + if (message.callbackSig.length !== 0) { + writer.uint32(58).bytes(message.callbackSig); + } + if (message.admin !== "") { + writer.uint32(66).string(message.admin); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgInstantiateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantiateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.bytes(); + break; + case 2: + message.callbackCodeHash = reader.string(); + break; + case 3: + message.codeId = reader.uint64(); + break; + case 4: + message.label = reader.string(); + break; + case 5: + message.initMsg = reader.bytes(); + break; + case 6: + message.initFunds.push(Coin.decode(reader, reader.uint32(), useInterfaces)); + break; + case 7: + message.callbackSig = reader.bytes(); + break; + case 8: + message.admin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgInstantiateContract { + const message = createBaseMsgInstantiateContract(); + message.sender = object.sender ?? new Uint8Array(); + message.callbackCodeHash = object.callbackCodeHash ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.label = object.label ?? ""; + message.initMsg = object.initMsg ?? new Uint8Array(); + message.initFunds = object.initFunds?.map(e => Coin.fromPartial(e)) || []; + message.callbackSig = object.callbackSig ?? new Uint8Array(); + message.admin = object.admin ?? ""; + return message; + }, + fromAmino(object: MsgInstantiateContractAmino): MsgInstantiateContract { + const message = createBaseMsgInstantiateContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = bytesFromBase64(object.sender); + } + if (object.callback_code_hash !== undefined && object.callback_code_hash !== null) { + message.callbackCodeHash = object.callback_code_hash; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.init_msg !== undefined && object.init_msg !== null) { + message.initMsg = bytesFromBase64(object.init_msg); + } + message.initFunds = object.init_funds?.map(e => Coin.fromAmino(e)) || []; + if (object.callback_sig !== undefined && object.callback_sig !== null) { + message.callbackSig = bytesFromBase64(object.callback_sig); + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + return message; + }, + toAmino(message: MsgInstantiateContract, useInterfaces: boolean = false): MsgInstantiateContractAmino { + const obj: any = {}; + obj.sender = message.sender ? base64FromBytes(message.sender) : undefined; + obj.callback_code_hash = message.callbackCodeHash; + obj.code_id = message.codeId ? message.codeId.toString() : undefined; + obj.label = message.label; + obj.init_msg = message.initMsg ? base64FromBytes(message.initMsg) : undefined; + if (message.initFunds) { + obj.init_funds = message.initFunds.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); + } else { + obj.init_funds = []; + } + obj.callback_sig = message.callbackSig ? base64FromBytes(message.callbackSig) : undefined; + obj.admin = message.admin; + return obj; + }, + fromAminoMsg(object: MsgInstantiateContractAminoMsg): MsgInstantiateContract { + return MsgInstantiateContract.fromAmino(object.value); + }, + fromProtoMsg(message: MsgInstantiateContractProtoMsg, useInterfaces: boolean = false): MsgInstantiateContract { + return MsgInstantiateContract.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgInstantiateContract): Uint8Array { + return MsgInstantiateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantiateContract): MsgInstantiateContractProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.MsgInstantiateContract", + value: MsgInstantiateContract.encode(message).finish() + }; + } +}; +function createBaseMsgInstantiateContractResponse(): MsgInstantiateContractResponse { + return { + address: "", + data: new Uint8Array() + }; +} +export const MsgInstantiateContractResponse = { + typeUrl: "/secret.compute.v1beta1.MsgInstantiateContractResponse", + encode(message: MsgInstantiateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgInstantiateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantiateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgInstantiateContractResponse { + const message = createBaseMsgInstantiateContractResponse(); + message.address = object.address ?? ""; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgInstantiateContractResponseAmino): MsgInstantiateContractResponse { + const message = createBaseMsgInstantiateContractResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgInstantiateContractResponse, useInterfaces: boolean = false): MsgInstantiateContractResponseAmino { + const obj: any = {}; + obj.address = message.address; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgInstantiateContractResponseAminoMsg): MsgInstantiateContractResponse { + return MsgInstantiateContractResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgInstantiateContractResponseProtoMsg, useInterfaces: boolean = false): MsgInstantiateContractResponse { + return MsgInstantiateContractResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgInstantiateContractResponse): Uint8Array { + return MsgInstantiateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.MsgInstantiateContractResponse", + value: MsgInstantiateContractResponse.encode(message).finish() + }; + } +}; +function createBaseMsgExecuteContract(): MsgExecuteContract { + return { + sender: new Uint8Array(), + contract: new Uint8Array(), + msg: new Uint8Array(), + callbackCodeHash: "", + sentFunds: [], + callbackSig: new Uint8Array() + }; +} +export const MsgExecuteContract = { + typeUrl: "/secret.compute.v1beta1.MsgExecuteContract", + encode(message: MsgExecuteContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender.length !== 0) { + writer.uint32(10).bytes(message.sender); + } + if (message.contract.length !== 0) { + writer.uint32(18).bytes(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(26).bytes(message.msg); + } + if (message.callbackCodeHash !== "") { + writer.uint32(34).string(message.callbackCodeHash); + } + for (const v of message.sentFunds) { + Coin.encode(v!, writer.uint32(42).fork()).ldelim(); + } + if (message.callbackSig.length !== 0) { + writer.uint32(50).bytes(message.callbackSig); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgExecuteContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecuteContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.bytes(); + break; + case 2: + message.contract = reader.bytes(); + break; + case 3: + message.msg = reader.bytes(); + break; + case 4: + message.callbackCodeHash = reader.string(); + break; + case 5: + message.sentFunds.push(Coin.decode(reader, reader.uint32(), useInterfaces)); + break; + case 6: + message.callbackSig = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgExecuteContract { + const message = createBaseMsgExecuteContract(); + message.sender = object.sender ?? new Uint8Array(); + message.contract = object.contract ?? new Uint8Array(); + message.msg = object.msg ?? new Uint8Array(); + message.callbackCodeHash = object.callbackCodeHash ?? ""; + message.sentFunds = object.sentFunds?.map(e => Coin.fromPartial(e)) || []; + message.callbackSig = object.callbackSig ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgExecuteContractAmino): MsgExecuteContract { + const message = createBaseMsgExecuteContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = bytesFromBase64(object.sender); + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = bytesFromBase64(object.contract); + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = bytesFromBase64(object.msg); + } + if (object.callback_code_hash !== undefined && object.callback_code_hash !== null) { + message.callbackCodeHash = object.callback_code_hash; + } + message.sentFunds = object.sent_funds?.map(e => Coin.fromAmino(e)) || []; + if (object.callback_sig !== undefined && object.callback_sig !== null) { + message.callbackSig = bytesFromBase64(object.callback_sig); + } + return message; + }, + toAmino(message: MsgExecuteContract, useInterfaces: boolean = false): MsgExecuteContractAmino { + const obj: any = {}; + obj.sender = message.sender ? base64FromBytes(message.sender) : undefined; + obj.contract = message.contract ? base64FromBytes(message.contract) : undefined; + obj.msg = message.msg ? base64FromBytes(message.msg) : undefined; + obj.callback_code_hash = message.callbackCodeHash; + if (message.sentFunds) { + obj.sent_funds = message.sentFunds.map(e => e ? Coin.toAmino(e, useInterfaces) : undefined); + } else { + obj.sent_funds = []; + } + obj.callback_sig = message.callbackSig ? base64FromBytes(message.callbackSig) : undefined; + return obj; + }, + fromAminoMsg(object: MsgExecuteContractAminoMsg): MsgExecuteContract { + return MsgExecuteContract.fromAmino(object.value); + }, + fromProtoMsg(message: MsgExecuteContractProtoMsg, useInterfaces: boolean = false): MsgExecuteContract { + return MsgExecuteContract.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgExecuteContract): Uint8Array { + return MsgExecuteContract.encode(message).finish(); + }, + toProtoMsg(message: MsgExecuteContract): MsgExecuteContractProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.MsgExecuteContract", + value: MsgExecuteContract.encode(message).finish() + }; + } +}; +function createBaseMsgExecuteContractResponse(): MsgExecuteContractResponse { + return { + data: new Uint8Array() + }; +} +export const MsgExecuteContractResponse = { + typeUrl: "/secret.compute.v1beta1.MsgExecuteContractResponse", + encode(message: MsgExecuteContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgExecuteContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecuteContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgExecuteContractResponse { + const message = createBaseMsgExecuteContractResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgExecuteContractResponseAmino): MsgExecuteContractResponse { + const message = createBaseMsgExecuteContractResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgExecuteContractResponse, useInterfaces: boolean = false): MsgExecuteContractResponseAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgExecuteContractResponseAminoMsg): MsgExecuteContractResponse { + return MsgExecuteContractResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgExecuteContractResponseProtoMsg, useInterfaces: boolean = false): MsgExecuteContractResponse { + return MsgExecuteContractResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgExecuteContractResponse): Uint8Array { + return MsgExecuteContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgExecuteContractResponse): MsgExecuteContractResponseProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.MsgExecuteContractResponse", + value: MsgExecuteContractResponse.encode(message).finish() + }; + } +}; +function createBaseMsgMigrateContract(): MsgMigrateContract { + return { + sender: "", + contract: "", + codeId: BigInt(0), + msg: new Uint8Array(), + callbackSig: new Uint8Array(), + callbackCodeHash: "" + }; +} +export const MsgMigrateContract = { + typeUrl: "/secret.compute.v1beta1.MsgMigrateContract", + encode(message: MsgMigrateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contract !== "") { + writer.uint32(18).string(message.contract); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(24).uint64(message.codeId); + } + if (message.msg.length !== 0) { + writer.uint32(34).bytes(message.msg); + } + if (message.callbackSig.length !== 0) { + writer.uint32(58).bytes(message.callbackSig); + } + if (message.callbackCodeHash !== "") { + writer.uint32(66).string(message.callbackCodeHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgMigrateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMigrateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contract = reader.string(); + break; + case 3: + message.codeId = reader.uint64(); + break; + case 4: + message.msg = reader.bytes(); + break; + case 7: + message.callbackSig = reader.bytes(); + break; + case 8: + message.callbackCodeHash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgMigrateContract { + const message = createBaseMsgMigrateContract(); + message.sender = object.sender ?? ""; + message.contract = object.contract ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.msg = object.msg ?? new Uint8Array(); + message.callbackSig = object.callbackSig ?? new Uint8Array(); + message.callbackCodeHash = object.callbackCodeHash ?? ""; + return message; + }, + fromAmino(object: MsgMigrateContractAmino): MsgMigrateContract { + const message = createBaseMsgMigrateContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = bytesFromBase64(object.msg); + } + if (object.callback_sig !== undefined && object.callback_sig !== null) { + message.callbackSig = bytesFromBase64(object.callback_sig); + } + if (object.callback_code_hash !== undefined && object.callback_code_hash !== null) { + message.callbackCodeHash = object.callback_code_hash; + } + return message; + }, + toAmino(message: MsgMigrateContract, useInterfaces: boolean = false): MsgMigrateContractAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.contract = message.contract; + obj.code_id = message.codeId ? message.codeId.toString() : undefined; + obj.msg = message.msg ? base64FromBytes(message.msg) : undefined; + obj.callback_sig = message.callbackSig ? base64FromBytes(message.callbackSig) : undefined; + obj.callback_code_hash = message.callbackCodeHash; + return obj; + }, + fromAminoMsg(object: MsgMigrateContractAminoMsg): MsgMigrateContract { + return MsgMigrateContract.fromAmino(object.value); + }, + fromProtoMsg(message: MsgMigrateContractProtoMsg, useInterfaces: boolean = false): MsgMigrateContract { + return MsgMigrateContract.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgMigrateContract): Uint8Array { + return MsgMigrateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgMigrateContract): MsgMigrateContractProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.MsgMigrateContract", + value: MsgMigrateContract.encode(message).finish() + }; + } +}; +function createBaseMsgMigrateContractResponse(): MsgMigrateContractResponse { + return { + data: new Uint8Array() + }; +} +export const MsgMigrateContractResponse = { + typeUrl: "/secret.compute.v1beta1.MsgMigrateContractResponse", + encode(message: MsgMigrateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgMigrateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMigrateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgMigrateContractResponse { + const message = createBaseMsgMigrateContractResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgMigrateContractResponseAmino): MsgMigrateContractResponse { + const message = createBaseMsgMigrateContractResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgMigrateContractResponse, useInterfaces: boolean = false): MsgMigrateContractResponseAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgMigrateContractResponseAminoMsg): MsgMigrateContractResponse { + return MsgMigrateContractResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgMigrateContractResponseProtoMsg, useInterfaces: boolean = false): MsgMigrateContractResponse { + return MsgMigrateContractResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgMigrateContractResponse): Uint8Array { + return MsgMigrateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgMigrateContractResponse): MsgMigrateContractResponseProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.MsgMigrateContractResponse", + value: MsgMigrateContractResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateAdmin(): MsgUpdateAdmin { + return { + sender: "", + newAdmin: "", + contract: "", + callbackSig: new Uint8Array() + }; +} +export const MsgUpdateAdmin = { + typeUrl: "/secret.compute.v1beta1.MsgUpdateAdmin", + encode(message: MsgUpdateAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.newAdmin !== "") { + writer.uint32(18).string(message.newAdmin); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + if (message.callbackSig.length !== 0) { + writer.uint32(58).bytes(message.callbackSig); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.newAdmin = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + case 7: + message.callbackSig = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateAdmin { + const message = createBaseMsgUpdateAdmin(); + message.sender = object.sender ?? ""; + message.newAdmin = object.newAdmin ?? ""; + message.contract = object.contract ?? ""; + message.callbackSig = object.callbackSig ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgUpdateAdminAmino): MsgUpdateAdmin { + const message = createBaseMsgUpdateAdmin(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.callback_sig !== undefined && object.callback_sig !== null) { + message.callbackSig = bytesFromBase64(object.callback_sig); + } + return message; + }, + toAmino(message: MsgUpdateAdmin, useInterfaces: boolean = false): MsgUpdateAdminAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.new_admin = message.newAdmin; + obj.contract = message.contract; + obj.callback_sig = message.callbackSig ? base64FromBytes(message.callbackSig) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateAdminAminoMsg): MsgUpdateAdmin { + return MsgUpdateAdmin.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateAdminProtoMsg, useInterfaces: boolean = false): MsgUpdateAdmin { + return MsgUpdateAdmin.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateAdmin): Uint8Array { + return MsgUpdateAdmin.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateAdmin): MsgUpdateAdminProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.MsgUpdateAdmin", + value: MsgUpdateAdmin.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateAdminResponse(): MsgUpdateAdminResponse { + return {}; +} +export const MsgUpdateAdminResponse = { + typeUrl: "/secret.compute.v1beta1.MsgUpdateAdminResponse", + encode(_: MsgUpdateAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateAdminResponse { + const message = createBaseMsgUpdateAdminResponse(); + return message; + }, + fromAmino(_: MsgUpdateAdminResponseAmino): MsgUpdateAdminResponse { + const message = createBaseMsgUpdateAdminResponse(); + return message; + }, + toAmino(_: MsgUpdateAdminResponse, useInterfaces: boolean = false): MsgUpdateAdminResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateAdminResponseAminoMsg): MsgUpdateAdminResponse { + return MsgUpdateAdminResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateAdminResponseProtoMsg, useInterfaces: boolean = false): MsgUpdateAdminResponse { + return MsgUpdateAdminResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateAdminResponse): Uint8Array { + return MsgUpdateAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateAdminResponse): MsgUpdateAdminResponseProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.MsgUpdateAdminResponse", + value: MsgUpdateAdminResponse.encode(message).finish() + }; + } +}; +function createBaseMsgClearAdmin(): MsgClearAdmin { + return { + sender: "", + contract: "", + callbackSig: new Uint8Array() + }; +} +export const MsgClearAdmin = { + typeUrl: "/secret.compute.v1beta1.MsgClearAdmin", + encode(message: MsgClearAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + if (message.callbackSig.length !== 0) { + writer.uint32(58).bytes(message.callbackSig); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgClearAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClearAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + case 7: + message.callbackSig = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgClearAdmin { + const message = createBaseMsgClearAdmin(); + message.sender = object.sender ?? ""; + message.contract = object.contract ?? ""; + message.callbackSig = object.callbackSig ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgClearAdminAmino): MsgClearAdmin { + const message = createBaseMsgClearAdmin(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.callback_sig !== undefined && object.callback_sig !== null) { + message.callbackSig = bytesFromBase64(object.callback_sig); + } + return message; + }, + toAmino(message: MsgClearAdmin, useInterfaces: boolean = false): MsgClearAdminAmino { + const obj: any = {}; + obj.sender = message.sender; + obj.contract = message.contract; + obj.callback_sig = message.callbackSig ? base64FromBytes(message.callbackSig) : undefined; + return obj; + }, + fromAminoMsg(object: MsgClearAdminAminoMsg): MsgClearAdmin { + return MsgClearAdmin.fromAmino(object.value); + }, + fromProtoMsg(message: MsgClearAdminProtoMsg, useInterfaces: boolean = false): MsgClearAdmin { + return MsgClearAdmin.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgClearAdmin): Uint8Array { + return MsgClearAdmin.encode(message).finish(); + }, + toProtoMsg(message: MsgClearAdmin): MsgClearAdminProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.MsgClearAdmin", + value: MsgClearAdmin.encode(message).finish() + }; + } +}; +function createBaseMsgClearAdminResponse(): MsgClearAdminResponse { + return {}; +} +export const MsgClearAdminResponse = { + typeUrl: "/secret.compute.v1beta1.MsgClearAdminResponse", + encode(_: MsgClearAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgClearAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClearAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgClearAdminResponse { + const message = createBaseMsgClearAdminResponse(); + return message; + }, + fromAmino(_: MsgClearAdminResponseAmino): MsgClearAdminResponse { + const message = createBaseMsgClearAdminResponse(); + return message; + }, + toAmino(_: MsgClearAdminResponse, useInterfaces: boolean = false): MsgClearAdminResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgClearAdminResponseAminoMsg): MsgClearAdminResponse { + return MsgClearAdminResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgClearAdminResponseProtoMsg, useInterfaces: boolean = false): MsgClearAdminResponse { + return MsgClearAdminResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgClearAdminResponse): Uint8Array { + return MsgClearAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgClearAdminResponse): MsgClearAdminResponseProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.MsgClearAdminResponse", + value: MsgClearAdminResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/compute/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/secret/compute/v1beta1/query.rpc.Query.ts new file mode 100644 index 000000000..264b5385f --- /dev/null +++ b/packages/types/protobuf/codegen/secret/compute/v1beta1/query.rpc.Query.ts @@ -0,0 +1,130 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryByContractAddressRequest, QueryContractInfoResponse, QueryByCodeIdRequest, QueryContractsByCodeIdResponse, QuerySecretContractRequest, QuerySecretContractResponse, QueryCodeResponse, QueryCodesResponse, QueryCodeHashResponse, QueryContractLabelResponse, QueryByLabelRequest, QueryContractAddressResponse, QueryContractHistoryRequest, QueryContractHistoryResponse } from "./query"; +import { Empty } from "../../../google/protobuf/empty"; +/** Query defines the gRPC querier service */ +export interface Query { + /** Query contract info by address */ + contractInfo(request: QueryByContractAddressRequest): Promise; + /** Query code info by id */ + contractsByCodeId(request: QueryByCodeIdRequest): Promise; + /** Query secret contract */ + querySecretContract(request: QuerySecretContractRequest): Promise; + /** Query a specific contract code by id */ + code(request: QueryByCodeIdRequest): Promise; + /** Query all contract codes on-chain */ + codes(request?: Empty): Promise; + /** Query code hash by contract address */ + codeHashByContractAddress(request: QueryByContractAddressRequest): Promise; + /** Query code hash by code id */ + codeHashByCodeId(request: QueryByCodeIdRequest): Promise; + /** Query contract label by address */ + labelByAddress(request: QueryByContractAddressRequest): Promise; + /** Query contract address by label */ + addressByLabel(request: QueryByLabelRequest): Promise; + /** ContractHistory gets the contract code history */ + contractHistory(request: QueryContractHistoryRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.contractInfo = this.contractInfo.bind(this); + this.contractsByCodeId = this.contractsByCodeId.bind(this); + this.querySecretContract = this.querySecretContract.bind(this); + this.code = this.code.bind(this); + this.codes = this.codes.bind(this); + this.codeHashByContractAddress = this.codeHashByContractAddress.bind(this); + this.codeHashByCodeId = this.codeHashByCodeId.bind(this); + this.labelByAddress = this.labelByAddress.bind(this); + this.addressByLabel = this.addressByLabel.bind(this); + this.contractHistory = this.contractHistory.bind(this); + } + contractInfo(request: QueryByContractAddressRequest, useInterfaces: boolean = true): Promise { + const data = QueryByContractAddressRequest.encode(request).finish(); + const promise = this.rpc.request("secret.compute.v1beta1.Query", "ContractInfo", data); + return promise.then(data => QueryContractInfoResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + contractsByCodeId(request: QueryByCodeIdRequest, useInterfaces: boolean = true): Promise { + const data = QueryByCodeIdRequest.encode(request).finish(); + const promise = this.rpc.request("secret.compute.v1beta1.Query", "ContractsByCodeId", data); + return promise.then(data => QueryContractsByCodeIdResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + querySecretContract(request: QuerySecretContractRequest, useInterfaces: boolean = true): Promise { + const data = QuerySecretContractRequest.encode(request).finish(); + const promise = this.rpc.request("secret.compute.v1beta1.Query", "QuerySecretContract", data); + return promise.then(data => QuerySecretContractResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + code(request: QueryByCodeIdRequest, useInterfaces: boolean = true): Promise { + const data = QueryByCodeIdRequest.encode(request).finish(); + const promise = this.rpc.request("secret.compute.v1beta1.Query", "Code", data); + return promise.then(data => QueryCodeResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + codes(request: Empty = {}, useInterfaces: boolean = true): Promise { + const data = Empty.encode(request).finish(); + const promise = this.rpc.request("secret.compute.v1beta1.Query", "Codes", data); + return promise.then(data => QueryCodesResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + codeHashByContractAddress(request: QueryByContractAddressRequest, useInterfaces: boolean = true): Promise { + const data = QueryByContractAddressRequest.encode(request).finish(); + const promise = this.rpc.request("secret.compute.v1beta1.Query", "CodeHashByContractAddress", data); + return promise.then(data => QueryCodeHashResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + codeHashByCodeId(request: QueryByCodeIdRequest, useInterfaces: boolean = true): Promise { + const data = QueryByCodeIdRequest.encode(request).finish(); + const promise = this.rpc.request("secret.compute.v1beta1.Query", "CodeHashByCodeId", data); + return promise.then(data => QueryCodeHashResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + labelByAddress(request: QueryByContractAddressRequest, useInterfaces: boolean = true): Promise { + const data = QueryByContractAddressRequest.encode(request).finish(); + const promise = this.rpc.request("secret.compute.v1beta1.Query", "LabelByAddress", data); + return promise.then(data => QueryContractLabelResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + addressByLabel(request: QueryByLabelRequest, useInterfaces: boolean = true): Promise { + const data = QueryByLabelRequest.encode(request).finish(); + const promise = this.rpc.request("secret.compute.v1beta1.Query", "AddressByLabel", data); + return promise.then(data => QueryContractAddressResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + contractHistory(request: QueryContractHistoryRequest, useInterfaces: boolean = true): Promise { + const data = QueryContractHistoryRequest.encode(request).finish(); + const promise = this.rpc.request("secret.compute.v1beta1.Query", "ContractHistory", data); + return promise.then(data => QueryContractHistoryResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + contractInfo(request: QueryByContractAddressRequest, useInterfaces: boolean = true): Promise { + return queryService.contractInfo(request, useInterfaces); + }, + contractsByCodeId(request: QueryByCodeIdRequest, useInterfaces: boolean = true): Promise { + return queryService.contractsByCodeId(request, useInterfaces); + }, + querySecretContract(request: QuerySecretContractRequest, useInterfaces: boolean = true): Promise { + return queryService.querySecretContract(request, useInterfaces); + }, + code(request: QueryByCodeIdRequest, useInterfaces: boolean = true): Promise { + return queryService.code(request, useInterfaces); + }, + codes(request?: Empty, useInterfaces: boolean = true): Promise { + return queryService.codes(request, useInterfaces); + }, + codeHashByContractAddress(request: QueryByContractAddressRequest, useInterfaces: boolean = true): Promise { + return queryService.codeHashByContractAddress(request, useInterfaces); + }, + codeHashByCodeId(request: QueryByCodeIdRequest, useInterfaces: boolean = true): Promise { + return queryService.codeHashByCodeId(request, useInterfaces); + }, + labelByAddress(request: QueryByContractAddressRequest, useInterfaces: boolean = true): Promise { + return queryService.labelByAddress(request, useInterfaces); + }, + addressByLabel(request: QueryByLabelRequest, useInterfaces: boolean = true): Promise { + return queryService.addressByLabel(request, useInterfaces); + }, + contractHistory(request: QueryContractHistoryRequest, useInterfaces: boolean = true): Promise { + return queryService.contractHistory(request, useInterfaces); + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/compute/v1beta1/query.ts b/packages/types/protobuf/codegen/secret/compute/v1beta1/query.ts new file mode 100644 index 000000000..36b0201e2 --- /dev/null +++ b/packages/types/protobuf/codegen/secret/compute/v1beta1/query.ts @@ -0,0 +1,1712 @@ +//@ts-nocheck +import { ContractInfo, ContractInfoAmino, ContractInfoSDKType, ContractCodeHistoryEntry, ContractCodeHistoryEntryAmino, ContractCodeHistoryEntrySDKType } from "./types"; +import { StringEvent, StringEventAmino, StringEventSDKType } from "../../../cosmos/base/abci/v1beta1/abci"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +export interface QuerySecretContractRequest { + /** address is the bech32 human readable address of the contract */ + contractAddress: string; + query: Uint8Array; +} +export interface QuerySecretContractRequestProtoMsg { + typeUrl: "/secret.compute.v1beta1.QuerySecretContractRequest"; + value: Uint8Array; +} +export interface QuerySecretContractRequestAmino { + /** address is the bech32 human readable address of the contract */ + contract_address?: string; + query?: string; +} +export interface QuerySecretContractRequestAminoMsg { + type: "/secret.compute.v1beta1.QuerySecretContractRequest"; + value: QuerySecretContractRequestAmino; +} +export interface QuerySecretContractRequestSDKType { + contract_address: string; + query: Uint8Array; +} +export interface QueryByLabelRequest { + label: string; +} +export interface QueryByLabelRequestProtoMsg { + typeUrl: "/secret.compute.v1beta1.QueryByLabelRequest"; + value: Uint8Array; +} +export interface QueryByLabelRequestAmino { + label?: string; +} +export interface QueryByLabelRequestAminoMsg { + type: "/secret.compute.v1beta1.QueryByLabelRequest"; + value: QueryByLabelRequestAmino; +} +export interface QueryByLabelRequestSDKType { + label: string; +} +export interface QueryByContractAddressRequest { + /** address is the bech32 human readable address of the contract */ + contractAddress: string; +} +export interface QueryByContractAddressRequestProtoMsg { + typeUrl: "/secret.compute.v1beta1.QueryByContractAddressRequest"; + value: Uint8Array; +} +export interface QueryByContractAddressRequestAmino { + /** address is the bech32 human readable address of the contract */ + contract_address?: string; +} +export interface QueryByContractAddressRequestAminoMsg { + type: "/secret.compute.v1beta1.QueryByContractAddressRequest"; + value: QueryByContractAddressRequestAmino; +} +export interface QueryByContractAddressRequestSDKType { + contract_address: string; +} +export interface QueryByCodeIdRequest { + codeId: bigint; +} +export interface QueryByCodeIdRequestProtoMsg { + typeUrl: "/secret.compute.v1beta1.QueryByCodeIdRequest"; + value: Uint8Array; +} +export interface QueryByCodeIdRequestAmino { + code_id?: string; +} +export interface QueryByCodeIdRequestAminoMsg { + type: "/secret.compute.v1beta1.QueryByCodeIdRequest"; + value: QueryByCodeIdRequestAmino; +} +export interface QueryByCodeIdRequestSDKType { + code_id: bigint; +} +export interface QuerySecretContractResponse { + data: Uint8Array; +} +export interface QuerySecretContractResponseProtoMsg { + typeUrl: "/secret.compute.v1beta1.QuerySecretContractResponse"; + value: Uint8Array; +} +export interface QuerySecretContractResponseAmino { + data?: string; +} +export interface QuerySecretContractResponseAminoMsg { + type: "/secret.compute.v1beta1.QuerySecretContractResponse"; + value: QuerySecretContractResponseAmino; +} +export interface QuerySecretContractResponseSDKType { + data: Uint8Array; +} +/** QueryContractInfoResponse is the response type for the Query/ContractInfo RPC method */ +export interface QueryContractInfoResponse { + /** contract_address is the bech32 human readable address of the contract */ + contractAddress: string; + contractInfo?: ContractInfo | undefined; +} +export interface QueryContractInfoResponseProtoMsg { + typeUrl: "/secret.compute.v1beta1.QueryContractInfoResponse"; + value: Uint8Array; +} +/** QueryContractInfoResponse is the response type for the Query/ContractInfo RPC method */ +export interface QueryContractInfoResponseAmino { + /** contract_address is the bech32 human readable address of the contract */ + contract_address?: string; + contract_info?: ContractInfoAmino | undefined; +} +export interface QueryContractInfoResponseAminoMsg { + type: "/secret.compute.v1beta1.QueryContractInfoResponse"; + value: QueryContractInfoResponseAmino; +} +/** QueryContractInfoResponse is the response type for the Query/ContractInfo RPC method */ +export interface QueryContractInfoResponseSDKType { + contract_address: string; + contract_info?: ContractInfoSDKType | undefined; +} +/** ContractInfoWithAddress adds the contract address to the ContractInfo representation */ +export interface ContractInfoWithAddress { + /** contract_address is the bech32 human readable address of the contract */ + contractAddress: string; + contractInfo?: ContractInfo | undefined; +} +export interface ContractInfoWithAddressProtoMsg { + typeUrl: "/secret.compute.v1beta1.ContractInfoWithAddress"; + value: Uint8Array; +} +/** ContractInfoWithAddress adds the contract address to the ContractInfo representation */ +export interface ContractInfoWithAddressAmino { + /** contract_address is the bech32 human readable address of the contract */ + contract_address?: string; + contract_info?: ContractInfoAmino | undefined; +} +export interface ContractInfoWithAddressAminoMsg { + type: "/secret.compute.v1beta1.ContractInfoWithAddress"; + value: ContractInfoWithAddressAmino; +} +/** ContractInfoWithAddress adds the contract address to the ContractInfo representation */ +export interface ContractInfoWithAddressSDKType { + contract_address: string; + contract_info?: ContractInfoSDKType | undefined; +} +export interface QueryContractsByCodeIdResponse { + contractInfos: ContractInfoWithAddress[]; +} +export interface QueryContractsByCodeIdResponseProtoMsg { + typeUrl: "/secret.compute.v1beta1.QueryContractsByCodeIdResponse"; + value: Uint8Array; +} +export interface QueryContractsByCodeIdResponseAmino { + contract_infos?: ContractInfoWithAddressAmino[]; +} +export interface QueryContractsByCodeIdResponseAminoMsg { + type: "/secret.compute.v1beta1.QueryContractsByCodeIdResponse"; + value: QueryContractsByCodeIdResponseAmino; +} +export interface QueryContractsByCodeIdResponseSDKType { + contract_infos: ContractInfoWithAddressSDKType[]; +} +export interface CodeInfoResponse { + codeId: bigint; + /** creator is the bech32 human readable address of the contract */ + creator: string; + codeHash: string; + source: string; + builder: string; +} +export interface CodeInfoResponseProtoMsg { + typeUrl: "/secret.compute.v1beta1.CodeInfoResponse"; + value: Uint8Array; +} +export interface CodeInfoResponseAmino { + code_id?: string; + /** creator is the bech32 human readable address of the contract */ + creator?: string; + code_hash?: string; + source?: string; + builder?: string; +} +export interface CodeInfoResponseAminoMsg { + type: "/secret.compute.v1beta1.CodeInfoResponse"; + value: CodeInfoResponseAmino; +} +export interface CodeInfoResponseSDKType { + code_id: bigint; + creator: string; + code_hash: string; + source: string; + builder: string; +} +export interface QueryCodeResponse { + codeInfo?: CodeInfoResponse | undefined; + wasm: Uint8Array; +} +export interface QueryCodeResponseProtoMsg { + typeUrl: "/secret.compute.v1beta1.QueryCodeResponse"; + value: Uint8Array; +} +export interface QueryCodeResponseAmino { + code_info?: CodeInfoResponseAmino | undefined; + wasm?: string; +} +export interface QueryCodeResponseAminoMsg { + type: "/secret.compute.v1beta1.QueryCodeResponse"; + value: QueryCodeResponseAmino; +} +export interface QueryCodeResponseSDKType { + code_info?: CodeInfoResponseSDKType | undefined; + wasm: Uint8Array; +} +export interface QueryCodesResponse { + codeInfos: CodeInfoResponse[]; +} +export interface QueryCodesResponseProtoMsg { + typeUrl: "/secret.compute.v1beta1.QueryCodesResponse"; + value: Uint8Array; +} +export interface QueryCodesResponseAmino { + code_infos?: CodeInfoResponseAmino[]; +} +export interface QueryCodesResponseAminoMsg { + type: "/secret.compute.v1beta1.QueryCodesResponse"; + value: QueryCodesResponseAmino; +} +export interface QueryCodesResponseSDKType { + code_infos: CodeInfoResponseSDKType[]; +} +export interface QueryContractAddressResponse { + /** address is the bech32 human readable address of the contract */ + contractAddress: string; +} +export interface QueryContractAddressResponseProtoMsg { + typeUrl: "/secret.compute.v1beta1.QueryContractAddressResponse"; + value: Uint8Array; +} +export interface QueryContractAddressResponseAmino { + /** address is the bech32 human readable address of the contract */ + contract_address?: string; +} +export interface QueryContractAddressResponseAminoMsg { + type: "/secret.compute.v1beta1.QueryContractAddressResponse"; + value: QueryContractAddressResponseAmino; +} +export interface QueryContractAddressResponseSDKType { + contract_address: string; +} +export interface QueryContractLabelResponse { + label: string; +} +export interface QueryContractLabelResponseProtoMsg { + typeUrl: "/secret.compute.v1beta1.QueryContractLabelResponse"; + value: Uint8Array; +} +export interface QueryContractLabelResponseAmino { + label?: string; +} +export interface QueryContractLabelResponseAminoMsg { + type: "/secret.compute.v1beta1.QueryContractLabelResponse"; + value: QueryContractLabelResponseAmino; +} +export interface QueryContractLabelResponseSDKType { + label: string; +} +export interface QueryCodeHashResponse { + codeHash: string; +} +export interface QueryCodeHashResponseProtoMsg { + typeUrl: "/secret.compute.v1beta1.QueryCodeHashResponse"; + value: Uint8Array; +} +export interface QueryCodeHashResponseAmino { + code_hash?: string; +} +export interface QueryCodeHashResponseAminoMsg { + type: "/secret.compute.v1beta1.QueryCodeHashResponse"; + value: QueryCodeHashResponseAmino; +} +export interface QueryCodeHashResponseSDKType { + code_hash: string; +} +/** DecryptedAnswer is a struct that represents a decrypted tx-query */ +export interface DecryptedAnswer { + type: string; + input: string; + outputData: string; + outputDataAsString: string; +} +export interface DecryptedAnswerProtoMsg { + typeUrl: "/secret.compute.v1beta1.DecryptedAnswer"; + value: Uint8Array; +} +/** DecryptedAnswer is a struct that represents a decrypted tx-query */ +export interface DecryptedAnswerAmino { + type?: string; + input?: string; + output_data?: string; + output_data_as_string?: string; +} +export interface DecryptedAnswerAminoMsg { + type: "/secret.compute.v1beta1.DecryptedAnswer"; + value: DecryptedAnswerAmino; +} +/** DecryptedAnswer is a struct that represents a decrypted tx-query */ +export interface DecryptedAnswerSDKType { + type: string; + input: string; + output_data: string; + output_data_as_string: string; +} +export interface DecryptedAnswers { + answers: DecryptedAnswer[]; + outputLogs: StringEvent[]; + outputError: string; + plaintextError: string; +} +export interface DecryptedAnswersProtoMsg { + typeUrl: "/secret.compute.v1beta1.DecryptedAnswers"; + value: Uint8Array; +} +export interface DecryptedAnswersAmino { + answers?: DecryptedAnswerAmino[]; + output_logs?: StringEventAmino[]; + output_error?: string; + plaintext_error?: string; +} +export interface DecryptedAnswersAminoMsg { + type: "/secret.compute.v1beta1.DecryptedAnswers"; + value: DecryptedAnswersAmino; +} +export interface DecryptedAnswersSDKType { + answers: DecryptedAnswerSDKType[]; + output_logs: StringEventSDKType[]; + output_error: string; + plaintext_error: string; +} +/** + * QueryContractHistoryRequest is the request type for the Query/ContractHistory + * RPC method + */ +export interface QueryContractHistoryRequest { + /** address is the address of the contract to query */ + contractAddress: string; +} +export interface QueryContractHistoryRequestProtoMsg { + typeUrl: "/secret.compute.v1beta1.QueryContractHistoryRequest"; + value: Uint8Array; +} +/** + * QueryContractHistoryRequest is the request type for the Query/ContractHistory + * RPC method + */ +export interface QueryContractHistoryRequestAmino { + /** address is the address of the contract to query */ + contract_address?: string; +} +export interface QueryContractHistoryRequestAminoMsg { + type: "/secret.compute.v1beta1.QueryContractHistoryRequest"; + value: QueryContractHistoryRequestAmino; +} +/** + * QueryContractHistoryRequest is the request type for the Query/ContractHistory + * RPC method + */ +export interface QueryContractHistoryRequestSDKType { + contract_address: string; +} +/** + * QueryContractHistoryResponse is the response type for the + * Query/ContractHistory RPC method + */ +export interface QueryContractHistoryResponse { + entries: ContractCodeHistoryEntry[]; +} +export interface QueryContractHistoryResponseProtoMsg { + typeUrl: "/secret.compute.v1beta1.QueryContractHistoryResponse"; + value: Uint8Array; +} +/** + * QueryContractHistoryResponse is the response type for the + * Query/ContractHistory RPC method + */ +export interface QueryContractHistoryResponseAmino { + entries?: ContractCodeHistoryEntryAmino[]; +} +export interface QueryContractHistoryResponseAminoMsg { + type: "/secret.compute.v1beta1.QueryContractHistoryResponse"; + value: QueryContractHistoryResponseAmino; +} +/** + * QueryContractHistoryResponse is the response type for the + * Query/ContractHistory RPC method + */ +export interface QueryContractHistoryResponseSDKType { + entries: ContractCodeHistoryEntrySDKType[]; +} +function createBaseQuerySecretContractRequest(): QuerySecretContractRequest { + return { + contractAddress: "", + query: new Uint8Array() + }; +} +export const QuerySecretContractRequest = { + typeUrl: "/secret.compute.v1beta1.QuerySecretContractRequest", + encode(message: QuerySecretContractRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + if (message.query.length !== 0) { + writer.uint32(18).bytes(message.query); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QuerySecretContractRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySecretContractRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + case 2: + message.query = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySecretContractRequest { + const message = createBaseQuerySecretContractRequest(); + message.contractAddress = object.contractAddress ?? ""; + message.query = object.query ?? new Uint8Array(); + return message; + }, + fromAmino(object: QuerySecretContractRequestAmino): QuerySecretContractRequest { + const message = createBaseQuerySecretContractRequest(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.query !== undefined && object.query !== null) { + message.query = bytesFromBase64(object.query); + } + return message; + }, + toAmino(message: QuerySecretContractRequest, useInterfaces: boolean = false): QuerySecretContractRequestAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress; + obj.query = message.query ? base64FromBytes(message.query) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySecretContractRequestAminoMsg): QuerySecretContractRequest { + return QuerySecretContractRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySecretContractRequestProtoMsg, useInterfaces: boolean = false): QuerySecretContractRequest { + return QuerySecretContractRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QuerySecretContractRequest): Uint8Array { + return QuerySecretContractRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySecretContractRequest): QuerySecretContractRequestProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.QuerySecretContractRequest", + value: QuerySecretContractRequest.encode(message).finish() + }; + } +}; +function createBaseQueryByLabelRequest(): QueryByLabelRequest { + return { + label: "" + }; +} +export const QueryByLabelRequest = { + typeUrl: "/secret.compute.v1beta1.QueryByLabelRequest", + encode(message: QueryByLabelRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.label !== "") { + writer.uint32(10).string(message.label); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryByLabelRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryByLabelRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.label = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryByLabelRequest { + const message = createBaseQueryByLabelRequest(); + message.label = object.label ?? ""; + return message; + }, + fromAmino(object: QueryByLabelRequestAmino): QueryByLabelRequest { + const message = createBaseQueryByLabelRequest(); + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + return message; + }, + toAmino(message: QueryByLabelRequest, useInterfaces: boolean = false): QueryByLabelRequestAmino { + const obj: any = {}; + obj.label = message.label; + return obj; + }, + fromAminoMsg(object: QueryByLabelRequestAminoMsg): QueryByLabelRequest { + return QueryByLabelRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryByLabelRequestProtoMsg, useInterfaces: boolean = false): QueryByLabelRequest { + return QueryByLabelRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryByLabelRequest): Uint8Array { + return QueryByLabelRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryByLabelRequest): QueryByLabelRequestProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.QueryByLabelRequest", + value: QueryByLabelRequest.encode(message).finish() + }; + } +}; +function createBaseQueryByContractAddressRequest(): QueryByContractAddressRequest { + return { + contractAddress: "" + }; +} +export const QueryByContractAddressRequest = { + typeUrl: "/secret.compute.v1beta1.QueryByContractAddressRequest", + encode(message: QueryByContractAddressRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryByContractAddressRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryByContractAddressRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryByContractAddressRequest { + const message = createBaseQueryByContractAddressRequest(); + message.contractAddress = object.contractAddress ?? ""; + return message; + }, + fromAmino(object: QueryByContractAddressRequestAmino): QueryByContractAddressRequest { + const message = createBaseQueryByContractAddressRequest(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + return message; + }, + toAmino(message: QueryByContractAddressRequest, useInterfaces: boolean = false): QueryByContractAddressRequestAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress; + return obj; + }, + fromAminoMsg(object: QueryByContractAddressRequestAminoMsg): QueryByContractAddressRequest { + return QueryByContractAddressRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryByContractAddressRequestProtoMsg, useInterfaces: boolean = false): QueryByContractAddressRequest { + return QueryByContractAddressRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryByContractAddressRequest): Uint8Array { + return QueryByContractAddressRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryByContractAddressRequest): QueryByContractAddressRequestProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.QueryByContractAddressRequest", + value: QueryByContractAddressRequest.encode(message).finish() + }; + } +}; +function createBaseQueryByCodeIdRequest(): QueryByCodeIdRequest { + return { + codeId: BigInt(0) + }; +} +export const QueryByCodeIdRequest = { + typeUrl: "/secret.compute.v1beta1.QueryByCodeIdRequest", + encode(message: QueryByCodeIdRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryByCodeIdRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryByCodeIdRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryByCodeIdRequest { + const message = createBaseQueryByCodeIdRequest(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryByCodeIdRequestAmino): QueryByCodeIdRequest { + const message = createBaseQueryByCodeIdRequest(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + return message; + }, + toAmino(message: QueryByCodeIdRequest, useInterfaces: boolean = false): QueryByCodeIdRequestAmino { + const obj: any = {}; + obj.code_id = message.codeId ? message.codeId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryByCodeIdRequestAminoMsg): QueryByCodeIdRequest { + return QueryByCodeIdRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryByCodeIdRequestProtoMsg, useInterfaces: boolean = false): QueryByCodeIdRequest { + return QueryByCodeIdRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryByCodeIdRequest): Uint8Array { + return QueryByCodeIdRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryByCodeIdRequest): QueryByCodeIdRequestProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.QueryByCodeIdRequest", + value: QueryByCodeIdRequest.encode(message).finish() + }; + } +}; +function createBaseQuerySecretContractResponse(): QuerySecretContractResponse { + return { + data: new Uint8Array() + }; +} +export const QuerySecretContractResponse = { + typeUrl: "/secret.compute.v1beta1.QuerySecretContractResponse", + encode(message: QuerySecretContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QuerySecretContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySecretContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySecretContractResponse { + const message = createBaseQuerySecretContractResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: QuerySecretContractResponseAmino): QuerySecretContractResponse { + const message = createBaseQuerySecretContractResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: QuerySecretContractResponse, useInterfaces: boolean = false): QuerySecretContractResponseAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySecretContractResponseAminoMsg): QuerySecretContractResponse { + return QuerySecretContractResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySecretContractResponseProtoMsg, useInterfaces: boolean = false): QuerySecretContractResponse { + return QuerySecretContractResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QuerySecretContractResponse): Uint8Array { + return QuerySecretContractResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySecretContractResponse): QuerySecretContractResponseProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.QuerySecretContractResponse", + value: QuerySecretContractResponse.encode(message).finish() + }; + } +}; +function createBaseQueryContractInfoResponse(): QueryContractInfoResponse { + return { + contractAddress: "", + contractInfo: undefined + }; +} +export const QueryContractInfoResponse = { + typeUrl: "/secret.compute.v1beta1.QueryContractInfoResponse", + encode(message: QueryContractInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + if (message.contractInfo !== undefined) { + ContractInfo.encode(message.contractInfo, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryContractInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + case 2: + message.contractInfo = ContractInfo.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryContractInfoResponse { + const message = createBaseQueryContractInfoResponse(); + message.contractAddress = object.contractAddress ?? ""; + message.contractInfo = object.contractInfo !== undefined && object.contractInfo !== null ? ContractInfo.fromPartial(object.contractInfo) : undefined; + return message; + }, + fromAmino(object: QueryContractInfoResponseAmino): QueryContractInfoResponse { + const message = createBaseQueryContractInfoResponse(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.contract_info !== undefined && object.contract_info !== null) { + message.contractInfo = ContractInfo.fromAmino(object.contract_info); + } + return message; + }, + toAmino(message: QueryContractInfoResponse, useInterfaces: boolean = false): QueryContractInfoResponseAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress; + obj.contract_info = message.contractInfo ? ContractInfo.toAmino(message.contractInfo, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryContractInfoResponseAminoMsg): QueryContractInfoResponse { + return QueryContractInfoResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryContractInfoResponseProtoMsg, useInterfaces: boolean = false): QueryContractInfoResponse { + return QueryContractInfoResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryContractInfoResponse): Uint8Array { + return QueryContractInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryContractInfoResponse): QueryContractInfoResponseProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.QueryContractInfoResponse", + value: QueryContractInfoResponse.encode(message).finish() + }; + } +}; +function createBaseContractInfoWithAddress(): ContractInfoWithAddress { + return { + contractAddress: "", + contractInfo: undefined + }; +} +export const ContractInfoWithAddress = { + typeUrl: "/secret.compute.v1beta1.ContractInfoWithAddress", + encode(message: ContractInfoWithAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + if (message.contractInfo !== undefined) { + ContractInfo.encode(message.contractInfo, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ContractInfoWithAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractInfoWithAddress(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + case 2: + message.contractInfo = ContractInfo.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ContractInfoWithAddress { + const message = createBaseContractInfoWithAddress(); + message.contractAddress = object.contractAddress ?? ""; + message.contractInfo = object.contractInfo !== undefined && object.contractInfo !== null ? ContractInfo.fromPartial(object.contractInfo) : undefined; + return message; + }, + fromAmino(object: ContractInfoWithAddressAmino): ContractInfoWithAddress { + const message = createBaseContractInfoWithAddress(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.contract_info !== undefined && object.contract_info !== null) { + message.contractInfo = ContractInfo.fromAmino(object.contract_info); + } + return message; + }, + toAmino(message: ContractInfoWithAddress, useInterfaces: boolean = false): ContractInfoWithAddressAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress; + obj.contract_info = message.contractInfo ? ContractInfo.toAmino(message.contractInfo, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: ContractInfoWithAddressAminoMsg): ContractInfoWithAddress { + return ContractInfoWithAddress.fromAmino(object.value); + }, + fromProtoMsg(message: ContractInfoWithAddressProtoMsg, useInterfaces: boolean = false): ContractInfoWithAddress { + return ContractInfoWithAddress.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ContractInfoWithAddress): Uint8Array { + return ContractInfoWithAddress.encode(message).finish(); + }, + toProtoMsg(message: ContractInfoWithAddress): ContractInfoWithAddressProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.ContractInfoWithAddress", + value: ContractInfoWithAddress.encode(message).finish() + }; + } +}; +function createBaseQueryContractsByCodeIdResponse(): QueryContractsByCodeIdResponse { + return { + contractInfos: [] + }; +} +export const QueryContractsByCodeIdResponse = { + typeUrl: "/secret.compute.v1beta1.QueryContractsByCodeIdResponse", + encode(message: QueryContractsByCodeIdResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.contractInfos) { + ContractInfoWithAddress.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryContractsByCodeIdResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractsByCodeIdResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractInfos.push(ContractInfoWithAddress.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryContractsByCodeIdResponse { + const message = createBaseQueryContractsByCodeIdResponse(); + message.contractInfos = object.contractInfos?.map(e => ContractInfoWithAddress.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryContractsByCodeIdResponseAmino): QueryContractsByCodeIdResponse { + const message = createBaseQueryContractsByCodeIdResponse(); + message.contractInfos = object.contract_infos?.map(e => ContractInfoWithAddress.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryContractsByCodeIdResponse, useInterfaces: boolean = false): QueryContractsByCodeIdResponseAmino { + const obj: any = {}; + if (message.contractInfos) { + obj.contract_infos = message.contractInfos.map(e => e ? ContractInfoWithAddress.toAmino(e, useInterfaces) : undefined); + } else { + obj.contract_infos = []; + } + return obj; + }, + fromAminoMsg(object: QueryContractsByCodeIdResponseAminoMsg): QueryContractsByCodeIdResponse { + return QueryContractsByCodeIdResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryContractsByCodeIdResponseProtoMsg, useInterfaces: boolean = false): QueryContractsByCodeIdResponse { + return QueryContractsByCodeIdResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryContractsByCodeIdResponse): Uint8Array { + return QueryContractsByCodeIdResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryContractsByCodeIdResponse): QueryContractsByCodeIdResponseProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.QueryContractsByCodeIdResponse", + value: QueryContractsByCodeIdResponse.encode(message).finish() + }; + } +}; +function createBaseCodeInfoResponse(): CodeInfoResponse { + return { + codeId: BigInt(0), + creator: "", + codeHash: "", + source: "", + builder: "" + }; +} +export const CodeInfoResponse = { + typeUrl: "/secret.compute.v1beta1.CodeInfoResponse", + encode(message: CodeInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.creator !== "") { + writer.uint32(18).string(message.creator); + } + if (message.codeHash !== "") { + writer.uint32(26).string(message.codeHash); + } + if (message.source !== "") { + writer.uint32(34).string(message.source); + } + if (message.builder !== "") { + writer.uint32(42).string(message.builder); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): CodeInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCodeInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.creator = reader.string(); + break; + case 3: + message.codeHash = reader.string(); + break; + case 4: + message.source = reader.string(); + break; + case 5: + message.builder = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CodeInfoResponse { + const message = createBaseCodeInfoResponse(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.creator = object.creator ?? ""; + message.codeHash = object.codeHash ?? ""; + message.source = object.source ?? ""; + message.builder = object.builder ?? ""; + return message; + }, + fromAmino(object: CodeInfoResponseAmino): CodeInfoResponse { + const message = createBaseCodeInfoResponse(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = object.code_hash; + } + if (object.source !== undefined && object.source !== null) { + message.source = object.source; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = object.builder; + } + return message; + }, + toAmino(message: CodeInfoResponse, useInterfaces: boolean = false): CodeInfoResponseAmino { + const obj: any = {}; + obj.code_id = message.codeId ? message.codeId.toString() : undefined; + obj.creator = message.creator; + obj.code_hash = message.codeHash; + obj.source = message.source; + obj.builder = message.builder; + return obj; + }, + fromAminoMsg(object: CodeInfoResponseAminoMsg): CodeInfoResponse { + return CodeInfoResponse.fromAmino(object.value); + }, + fromProtoMsg(message: CodeInfoResponseProtoMsg, useInterfaces: boolean = false): CodeInfoResponse { + return CodeInfoResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: CodeInfoResponse): Uint8Array { + return CodeInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: CodeInfoResponse): CodeInfoResponseProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.CodeInfoResponse", + value: CodeInfoResponse.encode(message).finish() + }; + } +}; +function createBaseQueryCodeResponse(): QueryCodeResponse { + return { + codeInfo: undefined, + wasm: new Uint8Array() + }; +} +export const QueryCodeResponse = { + typeUrl: "/secret.compute.v1beta1.QueryCodeResponse", + encode(message: QueryCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeInfo !== undefined) { + CodeInfoResponse.encode(message.codeInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.wasm.length !== 0) { + writer.uint32(18).bytes(message.wasm); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryCodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeInfo = CodeInfoResponse.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.wasm = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCodeResponse { + const message = createBaseQueryCodeResponse(); + message.codeInfo = object.codeInfo !== undefined && object.codeInfo !== null ? CodeInfoResponse.fromPartial(object.codeInfo) : undefined; + message.wasm = object.wasm ?? new Uint8Array(); + return message; + }, + fromAmino(object: QueryCodeResponseAmino): QueryCodeResponse { + const message = createBaseQueryCodeResponse(); + if (object.code_info !== undefined && object.code_info !== null) { + message.codeInfo = CodeInfoResponse.fromAmino(object.code_info); + } + if (object.wasm !== undefined && object.wasm !== null) { + message.wasm = bytesFromBase64(object.wasm); + } + return message; + }, + toAmino(message: QueryCodeResponse, useInterfaces: boolean = false): QueryCodeResponseAmino { + const obj: any = {}; + obj.code_info = message.codeInfo ? CodeInfoResponse.toAmino(message.codeInfo, useInterfaces) : undefined; + obj.wasm = message.wasm ? base64FromBytes(message.wasm) : undefined; + return obj; + }, + fromAminoMsg(object: QueryCodeResponseAminoMsg): QueryCodeResponse { + return QueryCodeResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCodeResponseProtoMsg, useInterfaces: boolean = false): QueryCodeResponse { + return QueryCodeResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryCodeResponse): Uint8Array { + return QueryCodeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCodeResponse): QueryCodeResponseProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.QueryCodeResponse", + value: QueryCodeResponse.encode(message).finish() + }; + } +}; +function createBaseQueryCodesResponse(): QueryCodesResponse { + return { + codeInfos: [] + }; +} +export const QueryCodesResponse = { + typeUrl: "/secret.compute.v1beta1.QueryCodesResponse", + encode(message: QueryCodesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.codeInfos) { + CodeInfoResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryCodesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeInfos.push(CodeInfoResponse.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCodesResponse { + const message = createBaseQueryCodesResponse(); + message.codeInfos = object.codeInfos?.map(e => CodeInfoResponse.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryCodesResponseAmino): QueryCodesResponse { + const message = createBaseQueryCodesResponse(); + message.codeInfos = object.code_infos?.map(e => CodeInfoResponse.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryCodesResponse, useInterfaces: boolean = false): QueryCodesResponseAmino { + const obj: any = {}; + if (message.codeInfos) { + obj.code_infos = message.codeInfos.map(e => e ? CodeInfoResponse.toAmino(e, useInterfaces) : undefined); + } else { + obj.code_infos = []; + } + return obj; + }, + fromAminoMsg(object: QueryCodesResponseAminoMsg): QueryCodesResponse { + return QueryCodesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCodesResponseProtoMsg, useInterfaces: boolean = false): QueryCodesResponse { + return QueryCodesResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryCodesResponse): Uint8Array { + return QueryCodesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCodesResponse): QueryCodesResponseProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.QueryCodesResponse", + value: QueryCodesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryContractAddressResponse(): QueryContractAddressResponse { + return { + contractAddress: "" + }; +} +export const QueryContractAddressResponse = { + typeUrl: "/secret.compute.v1beta1.QueryContractAddressResponse", + encode(message: QueryContractAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryContractAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryContractAddressResponse { + const message = createBaseQueryContractAddressResponse(); + message.contractAddress = object.contractAddress ?? ""; + return message; + }, + fromAmino(object: QueryContractAddressResponseAmino): QueryContractAddressResponse { + const message = createBaseQueryContractAddressResponse(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + return message; + }, + toAmino(message: QueryContractAddressResponse, useInterfaces: boolean = false): QueryContractAddressResponseAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress; + return obj; + }, + fromAminoMsg(object: QueryContractAddressResponseAminoMsg): QueryContractAddressResponse { + return QueryContractAddressResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryContractAddressResponseProtoMsg, useInterfaces: boolean = false): QueryContractAddressResponse { + return QueryContractAddressResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryContractAddressResponse): Uint8Array { + return QueryContractAddressResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryContractAddressResponse): QueryContractAddressResponseProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.QueryContractAddressResponse", + value: QueryContractAddressResponse.encode(message).finish() + }; + } +}; +function createBaseQueryContractLabelResponse(): QueryContractLabelResponse { + return { + label: "" + }; +} +export const QueryContractLabelResponse = { + typeUrl: "/secret.compute.v1beta1.QueryContractLabelResponse", + encode(message: QueryContractLabelResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.label !== "") { + writer.uint32(10).string(message.label); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryContractLabelResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractLabelResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.label = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryContractLabelResponse { + const message = createBaseQueryContractLabelResponse(); + message.label = object.label ?? ""; + return message; + }, + fromAmino(object: QueryContractLabelResponseAmino): QueryContractLabelResponse { + const message = createBaseQueryContractLabelResponse(); + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + return message; + }, + toAmino(message: QueryContractLabelResponse, useInterfaces: boolean = false): QueryContractLabelResponseAmino { + const obj: any = {}; + obj.label = message.label; + return obj; + }, + fromAminoMsg(object: QueryContractLabelResponseAminoMsg): QueryContractLabelResponse { + return QueryContractLabelResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryContractLabelResponseProtoMsg, useInterfaces: boolean = false): QueryContractLabelResponse { + return QueryContractLabelResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryContractLabelResponse): Uint8Array { + return QueryContractLabelResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryContractLabelResponse): QueryContractLabelResponseProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.QueryContractLabelResponse", + value: QueryContractLabelResponse.encode(message).finish() + }; + } +}; +function createBaseQueryCodeHashResponse(): QueryCodeHashResponse { + return { + codeHash: "" + }; +} +export const QueryCodeHashResponse = { + typeUrl: "/secret.compute.v1beta1.QueryCodeHashResponse", + encode(message: QueryCodeHashResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeHash !== "") { + writer.uint32(10).string(message.codeHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryCodeHashResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodeHashResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeHash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCodeHashResponse { + const message = createBaseQueryCodeHashResponse(); + message.codeHash = object.codeHash ?? ""; + return message; + }, + fromAmino(object: QueryCodeHashResponseAmino): QueryCodeHashResponse { + const message = createBaseQueryCodeHashResponse(); + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = object.code_hash; + } + return message; + }, + toAmino(message: QueryCodeHashResponse, useInterfaces: boolean = false): QueryCodeHashResponseAmino { + const obj: any = {}; + obj.code_hash = message.codeHash; + return obj; + }, + fromAminoMsg(object: QueryCodeHashResponseAminoMsg): QueryCodeHashResponse { + return QueryCodeHashResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCodeHashResponseProtoMsg, useInterfaces: boolean = false): QueryCodeHashResponse { + return QueryCodeHashResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryCodeHashResponse): Uint8Array { + return QueryCodeHashResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCodeHashResponse): QueryCodeHashResponseProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.QueryCodeHashResponse", + value: QueryCodeHashResponse.encode(message).finish() + }; + } +}; +function createBaseDecryptedAnswer(): DecryptedAnswer { + return { + type: "", + input: "", + outputData: "", + outputDataAsString: "" + }; +} +export const DecryptedAnswer = { + typeUrl: "/secret.compute.v1beta1.DecryptedAnswer", + encode(message: DecryptedAnswer, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.type !== "") { + writer.uint32(10).string(message.type); + } + if (message.input !== "") { + writer.uint32(18).string(message.input); + } + if (message.outputData !== "") { + writer.uint32(26).string(message.outputData); + } + if (message.outputDataAsString !== "") { + writer.uint32(34).string(message.outputDataAsString); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): DecryptedAnswer { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDecryptedAnswer(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.input = reader.string(); + break; + case 3: + message.outputData = reader.string(); + break; + case 4: + message.outputDataAsString = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DecryptedAnswer { + const message = createBaseDecryptedAnswer(); + message.type = object.type ?? ""; + message.input = object.input ?? ""; + message.outputData = object.outputData ?? ""; + message.outputDataAsString = object.outputDataAsString ?? ""; + return message; + }, + fromAmino(object: DecryptedAnswerAmino): DecryptedAnswer { + const message = createBaseDecryptedAnswer(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.input !== undefined && object.input !== null) { + message.input = object.input; + } + if (object.output_data !== undefined && object.output_data !== null) { + message.outputData = object.output_data; + } + if (object.output_data_as_string !== undefined && object.output_data_as_string !== null) { + message.outputDataAsString = object.output_data_as_string; + } + return message; + }, + toAmino(message: DecryptedAnswer, useInterfaces: boolean = false): DecryptedAnswerAmino { + const obj: any = {}; + obj.type = message.type; + obj.input = message.input; + obj.output_data = message.outputData; + obj.output_data_as_string = message.outputDataAsString; + return obj; + }, + fromAminoMsg(object: DecryptedAnswerAminoMsg): DecryptedAnswer { + return DecryptedAnswer.fromAmino(object.value); + }, + fromProtoMsg(message: DecryptedAnswerProtoMsg, useInterfaces: boolean = false): DecryptedAnswer { + return DecryptedAnswer.decode(message.value, undefined, useInterfaces); + }, + toProto(message: DecryptedAnswer): Uint8Array { + return DecryptedAnswer.encode(message).finish(); + }, + toProtoMsg(message: DecryptedAnswer): DecryptedAnswerProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.DecryptedAnswer", + value: DecryptedAnswer.encode(message).finish() + }; + } +}; +function createBaseDecryptedAnswers(): DecryptedAnswers { + return { + answers: [], + outputLogs: [], + outputError: "", + plaintextError: "" + }; +} +export const DecryptedAnswers = { + typeUrl: "/secret.compute.v1beta1.DecryptedAnswers", + encode(message: DecryptedAnswers, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.answers) { + DecryptedAnswer.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.outputLogs) { + StringEvent.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.outputError !== "") { + writer.uint32(26).string(message.outputError); + } + if (message.plaintextError !== "") { + writer.uint32(34).string(message.plaintextError); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): DecryptedAnswers { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDecryptedAnswers(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.answers.push(DecryptedAnswer.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.outputLogs.push(StringEvent.decode(reader, reader.uint32(), useInterfaces)); + break; + case 3: + message.outputError = reader.string(); + break; + case 4: + message.plaintextError = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DecryptedAnswers { + const message = createBaseDecryptedAnswers(); + message.answers = object.answers?.map(e => DecryptedAnswer.fromPartial(e)) || []; + message.outputLogs = object.outputLogs?.map(e => StringEvent.fromPartial(e)) || []; + message.outputError = object.outputError ?? ""; + message.plaintextError = object.plaintextError ?? ""; + return message; + }, + fromAmino(object: DecryptedAnswersAmino): DecryptedAnswers { + const message = createBaseDecryptedAnswers(); + message.answers = object.answers?.map(e => DecryptedAnswer.fromAmino(e)) || []; + message.outputLogs = object.output_logs?.map(e => StringEvent.fromAmino(e)) || []; + if (object.output_error !== undefined && object.output_error !== null) { + message.outputError = object.output_error; + } + if (object.plaintext_error !== undefined && object.plaintext_error !== null) { + message.plaintextError = object.plaintext_error; + } + return message; + }, + toAmino(message: DecryptedAnswers, useInterfaces: boolean = false): DecryptedAnswersAmino { + const obj: any = {}; + if (message.answers) { + obj.answers = message.answers.map(e => e ? DecryptedAnswer.toAmino(e, useInterfaces) : undefined); + } else { + obj.answers = []; + } + if (message.outputLogs) { + obj.output_logs = message.outputLogs.map(e => e ? StringEvent.toAmino(e, useInterfaces) : undefined); + } else { + obj.output_logs = []; + } + obj.output_error = message.outputError; + obj.plaintext_error = message.plaintextError; + return obj; + }, + fromAminoMsg(object: DecryptedAnswersAminoMsg): DecryptedAnswers { + return DecryptedAnswers.fromAmino(object.value); + }, + fromProtoMsg(message: DecryptedAnswersProtoMsg, useInterfaces: boolean = false): DecryptedAnswers { + return DecryptedAnswers.decode(message.value, undefined, useInterfaces); + }, + toProto(message: DecryptedAnswers): Uint8Array { + return DecryptedAnswers.encode(message).finish(); + }, + toProtoMsg(message: DecryptedAnswers): DecryptedAnswersProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.DecryptedAnswers", + value: DecryptedAnswers.encode(message).finish() + }; + } +}; +function createBaseQueryContractHistoryRequest(): QueryContractHistoryRequest { + return { + contractAddress: "" + }; +} +export const QueryContractHistoryRequest = { + typeUrl: "/secret.compute.v1beta1.QueryContractHistoryRequest", + encode(message: QueryContractHistoryRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryContractHistoryRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractHistoryRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryContractHistoryRequest { + const message = createBaseQueryContractHistoryRequest(); + message.contractAddress = object.contractAddress ?? ""; + return message; + }, + fromAmino(object: QueryContractHistoryRequestAmino): QueryContractHistoryRequest { + const message = createBaseQueryContractHistoryRequest(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + return message; + }, + toAmino(message: QueryContractHistoryRequest, useInterfaces: boolean = false): QueryContractHistoryRequestAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress; + return obj; + }, + fromAminoMsg(object: QueryContractHistoryRequestAminoMsg): QueryContractHistoryRequest { + return QueryContractHistoryRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryContractHistoryRequestProtoMsg, useInterfaces: boolean = false): QueryContractHistoryRequest { + return QueryContractHistoryRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryContractHistoryRequest): Uint8Array { + return QueryContractHistoryRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryContractHistoryRequest): QueryContractHistoryRequestProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.QueryContractHistoryRequest", + value: QueryContractHistoryRequest.encode(message).finish() + }; + } +}; +function createBaseQueryContractHistoryResponse(): QueryContractHistoryResponse { + return { + entries: [] + }; +} +export const QueryContractHistoryResponse = { + typeUrl: "/secret.compute.v1beta1.QueryContractHistoryResponse", + encode(message: QueryContractHistoryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.entries) { + ContractCodeHistoryEntry.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryContractHistoryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryContractHistoryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entries.push(ContractCodeHistoryEntry.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryContractHistoryResponse { + const message = createBaseQueryContractHistoryResponse(); + message.entries = object.entries?.map(e => ContractCodeHistoryEntry.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryContractHistoryResponseAmino): QueryContractHistoryResponse { + const message = createBaseQueryContractHistoryResponse(); + message.entries = object.entries?.map(e => ContractCodeHistoryEntry.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryContractHistoryResponse, useInterfaces: boolean = false): QueryContractHistoryResponseAmino { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map(e => e ? ContractCodeHistoryEntry.toAmino(e, useInterfaces) : undefined); + } else { + obj.entries = []; + } + return obj; + }, + fromAminoMsg(object: QueryContractHistoryResponseAminoMsg): QueryContractHistoryResponse { + return QueryContractHistoryResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryContractHistoryResponseProtoMsg, useInterfaces: boolean = false): QueryContractHistoryResponse { + return QueryContractHistoryResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryContractHistoryResponse): Uint8Array { + return QueryContractHistoryResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryContractHistoryResponse): QueryContractHistoryResponseProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.QueryContractHistoryResponse", + value: QueryContractHistoryResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/compute/v1beta1/types.ts b/packages/types/protobuf/codegen/secret/compute/v1beta1/types.ts new file mode 100644 index 000000000..40e548a87 --- /dev/null +++ b/packages/types/protobuf/codegen/secret/compute/v1beta1/types.ts @@ -0,0 +1,1029 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +export enum AccessType { + UNDEFINED = 0, + NOBODY = 1, + ONLY_ADDRESS = 2, + EVERYBODY = 3, + UNRECOGNIZED = -1, +} +export const AccessTypeSDKType = AccessType; +export const AccessTypeAmino = AccessType; +export function accessTypeFromJSON(object: any): AccessType { + switch (object) { + case 0: + case "UNDEFINED": + return AccessType.UNDEFINED; + case 1: + case "NOBODY": + return AccessType.NOBODY; + case 2: + case "ONLY_ADDRESS": + return AccessType.ONLY_ADDRESS; + case 3: + case "EVERYBODY": + return AccessType.EVERYBODY; + case -1: + case "UNRECOGNIZED": + default: + return AccessType.UNRECOGNIZED; + } +} +export function accessTypeToJSON(object: AccessType): string { + switch (object) { + case AccessType.UNDEFINED: + return "UNDEFINED"; + case AccessType.NOBODY: + return "NOBODY"; + case AccessType.ONLY_ADDRESS: + return "ONLY_ADDRESS"; + case AccessType.EVERYBODY: + return "EVERYBODY"; + case AccessType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** ContractCodeHistoryOperationType actions that caused a code change */ +export enum ContractCodeHistoryOperationType { + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED - ContractCodeHistoryOperationTypeUnspecified placeholder for empty value */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED = 0, + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT - ContractCodeHistoryOperationTypeInit on chain contract instantiation */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT = 1, + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE - ContractCodeHistoryOperationTypeMigrate code migration */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE = 2, + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS - ContractCodeHistoryOperationTypeGenesis based on genesis data */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS = 3, + UNRECOGNIZED = -1, +} +export const ContractCodeHistoryOperationTypeSDKType = ContractCodeHistoryOperationType; +export const ContractCodeHistoryOperationTypeAmino = ContractCodeHistoryOperationType; +export function contractCodeHistoryOperationTypeFromJSON(object: any): ContractCodeHistoryOperationType { + switch (object) { + case 0: + case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED": + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED; + case 1: + case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT": + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT; + case 2: + case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE": + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE; + case 3: + case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS": + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS; + case -1: + case "UNRECOGNIZED": + default: + return ContractCodeHistoryOperationType.UNRECOGNIZED; + } +} +export function contractCodeHistoryOperationTypeToJSON(object: ContractCodeHistoryOperationType): string { + switch (object) { + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED: + return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED"; + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT: + return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT"; + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE: + return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE"; + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS: + return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS"; + case ContractCodeHistoryOperationType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export interface AccessTypeParam { + value: AccessType; +} +export interface AccessTypeParamProtoMsg { + typeUrl: "/secret.compute.v1beta1.AccessTypeParam"; + value: Uint8Array; +} +export interface AccessTypeParamAmino { + value?: AccessType; +} +export interface AccessTypeParamAminoMsg { + type: "/secret.compute.v1beta1.AccessTypeParam"; + value: AccessTypeParamAmino; +} +export interface AccessTypeParamSDKType { + value: AccessType; +} +/** CodeInfo is data for the uploaded contract WASM code */ +export interface CodeInfo { + codeHash: Uint8Array; + creator: Uint8Array; + source: string; + builder: string; +} +export interface CodeInfoProtoMsg { + typeUrl: "/secret.compute.v1beta1.CodeInfo"; + value: Uint8Array; +} +/** CodeInfo is data for the uploaded contract WASM code */ +export interface CodeInfoAmino { + code_hash?: string; + creator?: string; + source?: string; + builder?: string; +} +export interface CodeInfoAminoMsg { + type: "/secret.compute.v1beta1.CodeInfo"; + value: CodeInfoAmino; +} +/** CodeInfo is data for the uploaded contract WASM code */ +export interface CodeInfoSDKType { + code_hash: Uint8Array; + creator: Uint8Array; + source: string; + builder: string; +} +export interface ContractKey { + ogContractKey: Uint8Array; + currentContractKey: Uint8Array; + currentContractKeyProof: Uint8Array; +} +export interface ContractKeyProtoMsg { + typeUrl: "/secret.compute.v1beta1.ContractKey"; + value: Uint8Array; +} +export interface ContractKeyAmino { + og_contract_key?: string; + current_contract_key?: string; + current_contract_key_proof?: string; +} +export interface ContractKeyAminoMsg { + type: "/secret.compute.v1beta1.ContractKey"; + value: ContractKeyAmino; +} +export interface ContractKeySDKType { + og_contract_key: Uint8Array; + current_contract_key: Uint8Array; + current_contract_key_proof: Uint8Array; +} +export interface ContractCustomInfo { + enclaveKey?: ContractKey | undefined; + label: string; +} +export interface ContractCustomInfoProtoMsg { + typeUrl: "/secret.compute.v1beta1.ContractCustomInfo"; + value: Uint8Array; +} +export interface ContractCustomInfoAmino { + enclave_key?: ContractKeyAmino | undefined; + label?: string; +} +export interface ContractCustomInfoAminoMsg { + type: "/secret.compute.v1beta1.ContractCustomInfo"; + value: ContractCustomInfoAmino; +} +export interface ContractCustomInfoSDKType { + enclave_key?: ContractKeySDKType | undefined; + label: string; +} +/** ContractInfo stores a WASM contract instance */ +export interface ContractInfo { + /** CodeID is the reference to the stored Wasm code */ + codeId: bigint; + /** Creator address who initially instantiated the contract */ + creator: Uint8Array; + /** Label is mandatory metadata to be stored with a contract instance. */ + label: string; + /** Created Tx position when the contract was instantiated. */ + created?: AbsoluteTxPosition | undefined; + ibcPortId: string; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** Proof that enclave executed the instantiate command */ + adminProof: Uint8Array; +} +export interface ContractInfoProtoMsg { + typeUrl: "/secret.compute.v1beta1.ContractInfo"; + value: Uint8Array; +} +/** ContractInfo stores a WASM contract instance */ +export interface ContractInfoAmino { + /** CodeID is the reference to the stored Wasm code */ + code_id?: string; + /** Creator address who initially instantiated the contract */ + creator?: string; + /** Label is mandatory metadata to be stored with a contract instance. */ + label?: string; + /** Created Tx position when the contract was instantiated. */ + created?: AbsoluteTxPositionAmino | undefined; + ibc_port_id?: string; + /** Admin is an optional address that can execute migrations */ + admin?: string; + /** Proof that enclave executed the instantiate command */ + admin_proof?: string; +} +export interface ContractInfoAminoMsg { + type: "/secret.compute.v1beta1.ContractInfo"; + value: ContractInfoAmino; +} +/** ContractInfo stores a WASM contract instance */ +export interface ContractInfoSDKType { + code_id: bigint; + creator: Uint8Array; + label: string; + created?: AbsoluteTxPositionSDKType | undefined; + ibc_port_id: string; + admin: string; + admin_proof: Uint8Array; +} +/** AbsoluteTxPosition can be used to sort contracts */ +export interface AbsoluteTxPosition { + /** BlockHeight is the block the contract was created at */ + blockHeight: bigint; + /** TxIndex is a monotonic counter within the block (actual transaction index, or gas consumed) */ + txIndex: bigint; +} +export interface AbsoluteTxPositionProtoMsg { + typeUrl: "/secret.compute.v1beta1.AbsoluteTxPosition"; + value: Uint8Array; +} +/** AbsoluteTxPosition can be used to sort contracts */ +export interface AbsoluteTxPositionAmino { + /** BlockHeight is the block the contract was created at */ + block_height?: string; + /** TxIndex is a monotonic counter within the block (actual transaction index, or gas consumed) */ + tx_index?: string; +} +export interface AbsoluteTxPositionAminoMsg { + type: "/secret.compute.v1beta1.AbsoluteTxPosition"; + value: AbsoluteTxPositionAmino; +} +/** AbsoluteTxPosition can be used to sort contracts */ +export interface AbsoluteTxPositionSDKType { + block_height: bigint; + tx_index: bigint; +} +/** Model is a struct that holds a KV pair */ +export interface Model { + /** hex-encode key to read it better (this is often ascii) */ + Key: Uint8Array; + /** base64-encode raw value */ + Value: Uint8Array; +} +export interface ModelProtoMsg { + typeUrl: "/secret.compute.v1beta1.Model"; + value: Uint8Array; +} +/** Model is a struct that holds a KV pair */ +export interface ModelAmino { + /** hex-encode key to read it better (this is often ascii) */ + Key?: string; + /** base64-encode raw value */ + Value?: string; +} +export interface ModelAminoMsg { + type: "/secret.compute.v1beta1.Model"; + value: ModelAmino; +} +/** Model is a struct that holds a KV pair */ +export interface ModelSDKType { + Key: Uint8Array; + Value: Uint8Array; +} +/** ContractCodeHistoryEntry metadata to a contract. */ +export interface ContractCodeHistoryEntry { + operation: ContractCodeHistoryOperationType; + /** CodeID is the reference to the stored WASM code */ + codeId: bigint; + /** Updated Tx position when the operation was executed. */ + updated?: AbsoluteTxPosition | undefined; + msg: Uint8Array; +} +export interface ContractCodeHistoryEntryProtoMsg { + typeUrl: "/secret.compute.v1beta1.ContractCodeHistoryEntry"; + value: Uint8Array; +} +/** ContractCodeHistoryEntry metadata to a contract. */ +export interface ContractCodeHistoryEntryAmino { + operation?: ContractCodeHistoryOperationType; + /** CodeID is the reference to the stored WASM code */ + code_id?: string; + /** Updated Tx position when the operation was executed. */ + updated?: AbsoluteTxPositionAmino | undefined; + msg?: string; +} +export interface ContractCodeHistoryEntryAminoMsg { + type: "/secret.compute.v1beta1.ContractCodeHistoryEntry"; + value: ContractCodeHistoryEntryAmino; +} +/** ContractCodeHistoryEntry metadata to a contract. */ +export interface ContractCodeHistoryEntrySDKType { + operation: ContractCodeHistoryOperationType; + code_id: bigint; + updated?: AbsoluteTxPositionSDKType | undefined; + msg: Uint8Array; +} +function createBaseAccessTypeParam(): AccessTypeParam { + return { + value: 0 + }; +} +export const AccessTypeParam = { + typeUrl: "/secret.compute.v1beta1.AccessTypeParam", + encode(message: AccessTypeParam, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.value !== 0) { + writer.uint32(8).int32(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): AccessTypeParam { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccessTypeParam(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AccessTypeParam { + const message = createBaseAccessTypeParam(); + message.value = object.value ?? 0; + return message; + }, + fromAmino(object: AccessTypeParamAmino): AccessTypeParam { + const message = createBaseAccessTypeParam(); + if (object.value !== undefined && object.value !== null) { + message.value = accessTypeFromJSON(object.value); + } + return message; + }, + toAmino(message: AccessTypeParam, useInterfaces: boolean = false): AccessTypeParamAmino { + const obj: any = {}; + obj.value = message.value; + return obj; + }, + fromAminoMsg(object: AccessTypeParamAminoMsg): AccessTypeParam { + return AccessTypeParam.fromAmino(object.value); + }, + fromProtoMsg(message: AccessTypeParamProtoMsg, useInterfaces: boolean = false): AccessTypeParam { + return AccessTypeParam.decode(message.value, undefined, useInterfaces); + }, + toProto(message: AccessTypeParam): Uint8Array { + return AccessTypeParam.encode(message).finish(); + }, + toProtoMsg(message: AccessTypeParam): AccessTypeParamProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.AccessTypeParam", + value: AccessTypeParam.encode(message).finish() + }; + } +}; +function createBaseCodeInfo(): CodeInfo { + return { + codeHash: new Uint8Array(), + creator: new Uint8Array(), + source: "", + builder: "" + }; +} +export const CodeInfo = { + typeUrl: "/secret.compute.v1beta1.CodeInfo", + encode(message: CodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeHash.length !== 0) { + writer.uint32(10).bytes(message.codeHash); + } + if (message.creator.length !== 0) { + writer.uint32(18).bytes(message.creator); + } + if (message.source !== "") { + writer.uint32(26).string(message.source); + } + if (message.builder !== "") { + writer.uint32(34).string(message.builder); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): CodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeHash = reader.bytes(); + break; + case 2: + message.creator = reader.bytes(); + break; + case 3: + message.source = reader.string(); + break; + case 4: + message.builder = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CodeInfo { + const message = createBaseCodeInfo(); + message.codeHash = object.codeHash ?? new Uint8Array(); + message.creator = object.creator ?? new Uint8Array(); + message.source = object.source ?? ""; + message.builder = object.builder ?? ""; + return message; + }, + fromAmino(object: CodeInfoAmino): CodeInfo { + const message = createBaseCodeInfo(); + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = bytesFromBase64(object.creator); + } + if (object.source !== undefined && object.source !== null) { + message.source = object.source; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = object.builder; + } + return message; + }, + toAmino(message: CodeInfo, useInterfaces: boolean = false): CodeInfoAmino { + const obj: any = {}; + obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; + obj.creator = message.creator ? base64FromBytes(message.creator) : undefined; + obj.source = message.source; + obj.builder = message.builder; + return obj; + }, + fromAminoMsg(object: CodeInfoAminoMsg): CodeInfo { + return CodeInfo.fromAmino(object.value); + }, + fromProtoMsg(message: CodeInfoProtoMsg, useInterfaces: boolean = false): CodeInfo { + return CodeInfo.decode(message.value, undefined, useInterfaces); + }, + toProto(message: CodeInfo): Uint8Array { + return CodeInfo.encode(message).finish(); + }, + toProtoMsg(message: CodeInfo): CodeInfoProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.CodeInfo", + value: CodeInfo.encode(message).finish() + }; + } +}; +function createBaseContractKey(): ContractKey { + return { + ogContractKey: new Uint8Array(), + currentContractKey: new Uint8Array(), + currentContractKeyProof: new Uint8Array() + }; +} +export const ContractKey = { + typeUrl: "/secret.compute.v1beta1.ContractKey", + encode(message: ContractKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ogContractKey.length !== 0) { + writer.uint32(10).bytes(message.ogContractKey); + } + if (message.currentContractKey.length !== 0) { + writer.uint32(18).bytes(message.currentContractKey); + } + if (message.currentContractKeyProof.length !== 0) { + writer.uint32(26).bytes(message.currentContractKeyProof); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ContractKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ogContractKey = reader.bytes(); + break; + case 2: + message.currentContractKey = reader.bytes(); + break; + case 3: + message.currentContractKeyProof = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ContractKey { + const message = createBaseContractKey(); + message.ogContractKey = object.ogContractKey ?? new Uint8Array(); + message.currentContractKey = object.currentContractKey ?? new Uint8Array(); + message.currentContractKeyProof = object.currentContractKeyProof ?? new Uint8Array(); + return message; + }, + fromAmino(object: ContractKeyAmino): ContractKey { + const message = createBaseContractKey(); + if (object.og_contract_key !== undefined && object.og_contract_key !== null) { + message.ogContractKey = bytesFromBase64(object.og_contract_key); + } + if (object.current_contract_key !== undefined && object.current_contract_key !== null) { + message.currentContractKey = bytesFromBase64(object.current_contract_key); + } + if (object.current_contract_key_proof !== undefined && object.current_contract_key_proof !== null) { + message.currentContractKeyProof = bytesFromBase64(object.current_contract_key_proof); + } + return message; + }, + toAmino(message: ContractKey, useInterfaces: boolean = false): ContractKeyAmino { + const obj: any = {}; + obj.og_contract_key = message.ogContractKey ? base64FromBytes(message.ogContractKey) : undefined; + obj.current_contract_key = message.currentContractKey ? base64FromBytes(message.currentContractKey) : undefined; + obj.current_contract_key_proof = message.currentContractKeyProof ? base64FromBytes(message.currentContractKeyProof) : undefined; + return obj; + }, + fromAminoMsg(object: ContractKeyAminoMsg): ContractKey { + return ContractKey.fromAmino(object.value); + }, + fromProtoMsg(message: ContractKeyProtoMsg, useInterfaces: boolean = false): ContractKey { + return ContractKey.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ContractKey): Uint8Array { + return ContractKey.encode(message).finish(); + }, + toProtoMsg(message: ContractKey): ContractKeyProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.ContractKey", + value: ContractKey.encode(message).finish() + }; + } +}; +function createBaseContractCustomInfo(): ContractCustomInfo { + return { + enclaveKey: undefined, + label: "" + }; +} +export const ContractCustomInfo = { + typeUrl: "/secret.compute.v1beta1.ContractCustomInfo", + encode(message: ContractCustomInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.enclaveKey !== undefined) { + ContractKey.encode(message.enclaveKey, writer.uint32(10).fork()).ldelim(); + } + if (message.label !== "") { + writer.uint32(18).string(message.label); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ContractCustomInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractCustomInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enclaveKey = ContractKey.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.label = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ContractCustomInfo { + const message = createBaseContractCustomInfo(); + message.enclaveKey = object.enclaveKey !== undefined && object.enclaveKey !== null ? ContractKey.fromPartial(object.enclaveKey) : undefined; + message.label = object.label ?? ""; + return message; + }, + fromAmino(object: ContractCustomInfoAmino): ContractCustomInfo { + const message = createBaseContractCustomInfo(); + if (object.enclave_key !== undefined && object.enclave_key !== null) { + message.enclaveKey = ContractKey.fromAmino(object.enclave_key); + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + return message; + }, + toAmino(message: ContractCustomInfo, useInterfaces: boolean = false): ContractCustomInfoAmino { + const obj: any = {}; + obj.enclave_key = message.enclaveKey ? ContractKey.toAmino(message.enclaveKey, useInterfaces) : undefined; + obj.label = message.label; + return obj; + }, + fromAminoMsg(object: ContractCustomInfoAminoMsg): ContractCustomInfo { + return ContractCustomInfo.fromAmino(object.value); + }, + fromProtoMsg(message: ContractCustomInfoProtoMsg, useInterfaces: boolean = false): ContractCustomInfo { + return ContractCustomInfo.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ContractCustomInfo): Uint8Array { + return ContractCustomInfo.encode(message).finish(); + }, + toProtoMsg(message: ContractCustomInfo): ContractCustomInfoProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.ContractCustomInfo", + value: ContractCustomInfo.encode(message).finish() + }; + } +}; +function createBaseContractInfo(): ContractInfo { + return { + codeId: BigInt(0), + creator: new Uint8Array(), + label: "", + created: undefined, + ibcPortId: "", + admin: "", + adminProof: new Uint8Array() + }; +} +export const ContractInfo = { + typeUrl: "/secret.compute.v1beta1.ContractInfo", + encode(message: ContractInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.creator.length !== 0) { + writer.uint32(18).bytes(message.creator); + } + if (message.label !== "") { + writer.uint32(34).string(message.label); + } + if (message.created !== undefined) { + AbsoluteTxPosition.encode(message.created, writer.uint32(42).fork()).ldelim(); + } + if (message.ibcPortId !== "") { + writer.uint32(50).string(message.ibcPortId); + } + if (message.admin !== "") { + writer.uint32(58).string(message.admin); + } + if (message.adminProof.length !== 0) { + writer.uint32(66).bytes(message.adminProof); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ContractInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.creator = reader.bytes(); + break; + case 4: + message.label = reader.string(); + break; + case 5: + message.created = AbsoluteTxPosition.decode(reader, reader.uint32(), useInterfaces); + break; + case 6: + message.ibcPortId = reader.string(); + break; + case 7: + message.admin = reader.string(); + break; + case 8: + message.adminProof = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ContractInfo { + const message = createBaseContractInfo(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.creator = object.creator ?? new Uint8Array(); + message.label = object.label ?? ""; + message.created = object.created !== undefined && object.created !== null ? AbsoluteTxPosition.fromPartial(object.created) : undefined; + message.ibcPortId = object.ibcPortId ?? ""; + message.admin = object.admin ?? ""; + message.adminProof = object.adminProof ?? new Uint8Array(); + return message; + }, + fromAmino(object: ContractInfoAmino): ContractInfo { + const message = createBaseContractInfo(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = bytesFromBase64(object.creator); + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.created !== undefined && object.created !== null) { + message.created = AbsoluteTxPosition.fromAmino(object.created); + } + if (object.ibc_port_id !== undefined && object.ibc_port_id !== null) { + message.ibcPortId = object.ibc_port_id; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.admin_proof !== undefined && object.admin_proof !== null) { + message.adminProof = bytesFromBase64(object.admin_proof); + } + return message; + }, + toAmino(message: ContractInfo, useInterfaces: boolean = false): ContractInfoAmino { + const obj: any = {}; + obj.code_id = message.codeId ? message.codeId.toString() : undefined; + obj.creator = message.creator ? base64FromBytes(message.creator) : undefined; + obj.label = message.label; + obj.created = message.created ? AbsoluteTxPosition.toAmino(message.created, useInterfaces) : undefined; + obj.ibc_port_id = message.ibcPortId; + obj.admin = message.admin; + obj.admin_proof = message.adminProof ? base64FromBytes(message.adminProof) : undefined; + return obj; + }, + fromAminoMsg(object: ContractInfoAminoMsg): ContractInfo { + return ContractInfo.fromAmino(object.value); + }, + fromProtoMsg(message: ContractInfoProtoMsg, useInterfaces: boolean = false): ContractInfo { + return ContractInfo.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ContractInfo): Uint8Array { + return ContractInfo.encode(message).finish(); + }, + toProtoMsg(message: ContractInfo): ContractInfoProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.ContractInfo", + value: ContractInfo.encode(message).finish() + }; + } +}; +function createBaseAbsoluteTxPosition(): AbsoluteTxPosition { + return { + blockHeight: BigInt(0), + txIndex: BigInt(0) + }; +} +export const AbsoluteTxPosition = { + typeUrl: "/secret.compute.v1beta1.AbsoluteTxPosition", + encode(message: AbsoluteTxPosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockHeight !== BigInt(0)) { + writer.uint32(8).int64(message.blockHeight); + } + if (message.txIndex !== BigInt(0)) { + writer.uint32(16).uint64(message.txIndex); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): AbsoluteTxPosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAbsoluteTxPosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.int64(); + break; + case 2: + message.txIndex = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AbsoluteTxPosition { + const message = createBaseAbsoluteTxPosition(); + message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); + message.txIndex = object.txIndex !== undefined && object.txIndex !== null ? BigInt(object.txIndex.toString()) : BigInt(0); + return message; + }, + fromAmino(object: AbsoluteTxPositionAmino): AbsoluteTxPosition { + const message = createBaseAbsoluteTxPosition(); + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + if (object.tx_index !== undefined && object.tx_index !== null) { + message.txIndex = BigInt(object.tx_index); + } + return message; + }, + toAmino(message: AbsoluteTxPosition, useInterfaces: boolean = false): AbsoluteTxPositionAmino { + const obj: any = {}; + obj.block_height = message.blockHeight ? message.blockHeight.toString() : undefined; + obj.tx_index = message.txIndex ? message.txIndex.toString() : undefined; + return obj; + }, + fromAminoMsg(object: AbsoluteTxPositionAminoMsg): AbsoluteTxPosition { + return AbsoluteTxPosition.fromAmino(object.value); + }, + fromProtoMsg(message: AbsoluteTxPositionProtoMsg, useInterfaces: boolean = false): AbsoluteTxPosition { + return AbsoluteTxPosition.decode(message.value, undefined, useInterfaces); + }, + toProto(message: AbsoluteTxPosition): Uint8Array { + return AbsoluteTxPosition.encode(message).finish(); + }, + toProtoMsg(message: AbsoluteTxPosition): AbsoluteTxPositionProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.AbsoluteTxPosition", + value: AbsoluteTxPosition.encode(message).finish() + }; + } +}; +function createBaseModel(): Model { + return { + Key: new Uint8Array(), + Value: new Uint8Array() + }; +} +export const Model = { + typeUrl: "/secret.compute.v1beta1.Model", + encode(message: Model, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.Key.length !== 0) { + writer.uint32(10).bytes(message.Key); + } + if (message.Value.length !== 0) { + writer.uint32(18).bytes(message.Value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Model { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.Key = reader.bytes(); + break; + case 2: + message.Value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Model { + const message = createBaseModel(); + message.Key = object.Key ?? new Uint8Array(); + message.Value = object.Value ?? new Uint8Array(); + return message; + }, + fromAmino(object: ModelAmino): Model { + const message = createBaseModel(); + if (object.Key !== undefined && object.Key !== null) { + message.Key = bytesFromBase64(object.Key); + } + if (object.Value !== undefined && object.Value !== null) { + message.Value = bytesFromBase64(object.Value); + } + return message; + }, + toAmino(message: Model, useInterfaces: boolean = false): ModelAmino { + const obj: any = {}; + obj.Key = message.Key ? base64FromBytes(message.Key) : undefined; + obj.Value = message.Value ? base64FromBytes(message.Value) : undefined; + return obj; + }, + fromAminoMsg(object: ModelAminoMsg): Model { + return Model.fromAmino(object.value); + }, + fromProtoMsg(message: ModelProtoMsg, useInterfaces: boolean = false): Model { + return Model.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Model): Uint8Array { + return Model.encode(message).finish(); + }, + toProtoMsg(message: Model): ModelProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.Model", + value: Model.encode(message).finish() + }; + } +}; +function createBaseContractCodeHistoryEntry(): ContractCodeHistoryEntry { + return { + operation: 0, + codeId: BigInt(0), + updated: undefined, + msg: new Uint8Array() + }; +} +export const ContractCodeHistoryEntry = { + typeUrl: "/secret.compute.v1beta1.ContractCodeHistoryEntry", + encode(message: ContractCodeHistoryEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.operation !== 0) { + writer.uint32(8).int32(message.operation); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(16).uint64(message.codeId); + } + if (message.updated !== undefined) { + AbsoluteTxPosition.encode(message.updated, writer.uint32(26).fork()).ldelim(); + } + if (message.msg.length !== 0) { + writer.uint32(34).bytes(message.msg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ContractCodeHistoryEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContractCodeHistoryEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operation = (reader.int32() as any); + break; + case 2: + message.codeId = reader.uint64(); + break; + case 3: + message.updated = AbsoluteTxPosition.decode(reader, reader.uint32(), useInterfaces); + break; + case 4: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ContractCodeHistoryEntry { + const message = createBaseContractCodeHistoryEntry(); + message.operation = object.operation ?? 0; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.updated = object.updated !== undefined && object.updated !== null ? AbsoluteTxPosition.fromPartial(object.updated) : undefined; + message.msg = object.msg ?? new Uint8Array(); + return message; + }, + fromAmino(object: ContractCodeHistoryEntryAmino): ContractCodeHistoryEntry { + const message = createBaseContractCodeHistoryEntry(); + if (object.operation !== undefined && object.operation !== null) { + message.operation = contractCodeHistoryOperationTypeFromJSON(object.operation); + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.updated !== undefined && object.updated !== null) { + message.updated = AbsoluteTxPosition.fromAmino(object.updated); + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = bytesFromBase64(object.msg); + } + return message; + }, + toAmino(message: ContractCodeHistoryEntry, useInterfaces: boolean = false): ContractCodeHistoryEntryAmino { + const obj: any = {}; + obj.operation = message.operation; + obj.code_id = message.codeId ? message.codeId.toString() : undefined; + obj.updated = message.updated ? AbsoluteTxPosition.toAmino(message.updated, useInterfaces) : undefined; + obj.msg = message.msg ? base64FromBytes(message.msg) : undefined; + return obj; + }, + fromAminoMsg(object: ContractCodeHistoryEntryAminoMsg): ContractCodeHistoryEntry { + return ContractCodeHistoryEntry.fromAmino(object.value); + }, + fromProtoMsg(message: ContractCodeHistoryEntryProtoMsg, useInterfaces: boolean = false): ContractCodeHistoryEntry { + return ContractCodeHistoryEntry.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ContractCodeHistoryEntry): Uint8Array { + return ContractCodeHistoryEntry.encode(message).finish(); + }, + toProtoMsg(message: ContractCodeHistoryEntry): ContractCodeHistoryEntryProtoMsg { + return { + typeUrl: "/secret.compute.v1beta1.ContractCodeHistoryEntry", + value: ContractCodeHistoryEntry.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/genesis.ts b/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/genesis.ts new file mode 100644 index 000000000..8e3678375 --- /dev/null +++ b/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/genesis.ts @@ -0,0 +1,86 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** GenesisState - genesis state of x/wasm */ +export interface GenesisState { + params: Params | undefined; +} +export interface GenesisStateProtoMsg { + typeUrl: "/secret.emergencybutton.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState - genesis state of x/wasm */ +export interface GenesisStateAmino { + params?: ParamsAmino | undefined; +} +export interface GenesisStateAminoMsg { + type: "/secret.emergencybutton.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState - genesis state of x/wasm */ +export interface GenesisStateSDKType { + params: ParamsSDKType | undefined; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/secret.emergencybutton.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: GenesisState, useInterfaces: boolean = false): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg, useInterfaces: boolean = false): GenesisState { + return GenesisState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/secret.emergencybutton.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/params.ts b/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/params.ts new file mode 100644 index 000000000..84c90defd --- /dev/null +++ b/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/params.ts @@ -0,0 +1,99 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** Params defines the parameters for the ibc-rate-limit module. */ +export interface Params { + switchStatus: string; + pauserAddress: string; +} +export interface ParamsProtoMsg { + typeUrl: "/secret.emergencybutton.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the ibc-rate-limit module. */ +export interface ParamsAmino { + switch_status?: string; + pauser_address?: string; +} +export interface ParamsAminoMsg { + type: "/secret.emergencybutton.v1beta1.Params"; + value: ParamsAmino; +} +/** Params defines the parameters for the ibc-rate-limit module. */ +export interface ParamsSDKType { + switch_status: string; + pauser_address: string; +} +function createBaseParams(): Params { + return { + switchStatus: "", + pauserAddress: "" + }; +} +export const Params = { + typeUrl: "/secret.emergencybutton.v1beta1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.switchStatus !== "") { + writer.uint32(10).string(message.switchStatus); + } + if (message.pauserAddress !== "") { + writer.uint32(18).string(message.pauserAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.switchStatus = reader.string(); + break; + case 2: + message.pauserAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.switchStatus = object.switchStatus ?? ""; + message.pauserAddress = object.pauserAddress ?? ""; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.switch_status !== undefined && object.switch_status !== null) { + message.switchStatus = object.switch_status; + } + if (object.pauser_address !== undefined && object.pauser_address !== null) { + message.pauserAddress = object.pauser_address; + } + return message; + }, + toAmino(message: Params, useInterfaces: boolean = false): ParamsAmino { + const obj: any = {}; + obj.switch_status = message.switchStatus; + obj.pauser_address = message.pauserAddress; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsProtoMsg, useInterfaces: boolean = false): Params { + return Params.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/secret.emergencybutton.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/query.rpc.Query.ts new file mode 100644 index 000000000..b25941b2c --- /dev/null +++ b/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/query.rpc.Query.ts @@ -0,0 +1,33 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { ParamsRequest, ParamsResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** + * Params defines a gRPC query method that returns the emergencybutton module's + * parameters. + */ + params(request?: ParamsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + } + params(request: ParamsRequest = {}, useInterfaces: boolean = true): Promise { + const data = ParamsRequest.encode(request).finish(); + const promise = this.rpc.request("secret.emergencybutton.v1beta1.Query", "Params", data); + return promise.then(data => ParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: ParamsRequest, useInterfaces: boolean = true): Promise { + return queryService.params(request, useInterfaces); + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/query.ts b/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/query.ts new file mode 100644 index 000000000..af53af77c --- /dev/null +++ b/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/query.ts @@ -0,0 +1,152 @@ +//@ts-nocheck +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** ParamsRequest is the request type for the Query/Params RPC method. */ +export interface ParamsRequest {} +export interface ParamsRequestProtoMsg { + typeUrl: "/secret.emergencybutton.v1beta1.ParamsRequest"; + value: Uint8Array; +} +/** ParamsRequest is the request type for the Query/Params RPC method. */ +export interface ParamsRequestAmino {} +export interface ParamsRequestAminoMsg { + type: "/secret.emergencybutton.v1beta1.ParamsRequest"; + value: ParamsRequestAmino; +} +/** ParamsRequest is the request type for the Query/Params RPC method. */ +export interface ParamsRequestSDKType {} +/** ParamsResponse is the response type for the Query/Params RPC method. */ +export interface ParamsResponse { + /** params defines the parameters of the module. */ + params: Params | undefined; +} +export interface ParamsResponseProtoMsg { + typeUrl: "/secret.emergencybutton.v1beta1.ParamsResponse"; + value: Uint8Array; +} +/** ParamsResponse is the response type for the Query/Params RPC method. */ +export interface ParamsResponseAmino { + /** params defines the parameters of the module. */ + params?: ParamsAmino | undefined; +} +export interface ParamsResponseAminoMsg { + type: "/secret.emergencybutton.v1beta1.ParamsResponse"; + value: ParamsResponseAmino; +} +/** ParamsResponse is the response type for the Query/Params RPC method. */ +export interface ParamsResponseSDKType { + params: ParamsSDKType | undefined; +} +function createBaseParamsRequest(): ParamsRequest { + return {}; +} +export const ParamsRequest = { + typeUrl: "/secret.emergencybutton.v1beta1.ParamsRequest", + encode(_: ParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): ParamsRequest { + const message = createBaseParamsRequest(); + return message; + }, + fromAmino(_: ParamsRequestAmino): ParamsRequest { + const message = createBaseParamsRequest(); + return message; + }, + toAmino(_: ParamsRequest, useInterfaces: boolean = false): ParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: ParamsRequestAminoMsg): ParamsRequest { + return ParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsRequestProtoMsg, useInterfaces: boolean = false): ParamsRequest { + return ParamsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ParamsRequest): Uint8Array { + return ParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: ParamsRequest): ParamsRequestProtoMsg { + return { + typeUrl: "/secret.emergencybutton.v1beta1.ParamsRequest", + value: ParamsRequest.encode(message).finish() + }; + } +}; +function createBaseParamsResponse(): ParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const ParamsResponse = { + typeUrl: "/secret.emergencybutton.v1beta1.ParamsResponse", + encode(message: ParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ParamsResponse { + const message = createBaseParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: ParamsResponseAmino): ParamsResponse { + const message = createBaseParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: ParamsResponse, useInterfaces: boolean = false): ParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: ParamsResponseAminoMsg): ParamsResponse { + return ParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsResponseProtoMsg, useInterfaces: boolean = false): ParamsResponse { + return ParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ParamsResponse): Uint8Array { + return ParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: ParamsResponse): ParamsResponseProtoMsg { + return { + typeUrl: "/secret.emergencybutton.v1beta1.ParamsResponse", + value: ParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/tx.amino.ts new file mode 100644 index 000000000..3754c0460 --- /dev/null +++ b/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/tx.amino.ts @@ -0,0 +1,8 @@ +import { MsgToggleIbcSwitch } from "./tx"; +export const AminoConverter = { + "/secret.emergencybutton.v1beta1.MsgToggleIbcSwitch": { + aminoType: "/secret.emergencybutton.v1beta1.MsgToggleIbcSwitch", + toAmino: MsgToggleIbcSwitch.toAmino, + fromAmino: MsgToggleIbcSwitch.fromAmino + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/tx.registry.ts new file mode 100644 index 000000000..249563a79 --- /dev/null +++ b/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/tx.registry.ts @@ -0,0 +1,35 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgToggleIbcSwitch } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/secret.emergencybutton.v1beta1.MsgToggleIbcSwitch", MsgToggleIbcSwitch]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + toggleIbcSwitch(value: MsgToggleIbcSwitch) { + return { + typeUrl: "/secret.emergencybutton.v1beta1.MsgToggleIbcSwitch", + value: MsgToggleIbcSwitch.encode(value).finish() + }; + } + }, + withTypeUrl: { + toggleIbcSwitch(value: MsgToggleIbcSwitch) { + return { + typeUrl: "/secret.emergencybutton.v1beta1.MsgToggleIbcSwitch", + value + }; + } + }, + fromPartial: { + toggleIbcSwitch(value: MsgToggleIbcSwitch) { + return { + typeUrl: "/secret.emergencybutton.v1beta1.MsgToggleIbcSwitch", + value: MsgToggleIbcSwitch.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/tx.rpc.msg.ts new file mode 100644 index 000000000..1b3f30924 --- /dev/null +++ b/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,20 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgToggleIbcSwitch, MsgToggleIbcSwitchResponse } from "./tx"; +/** Msg defines the bank Msg service. */ +export interface Msg { + /** ToggleIbcSwitch defines a method for toggling the status of the emergencybutton. */ + toggleIbcSwitch(request: MsgToggleIbcSwitch): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.toggleIbcSwitch = this.toggleIbcSwitch.bind(this); + } + toggleIbcSwitch(request: MsgToggleIbcSwitch, useInterfaces: boolean = true): Promise { + const data = MsgToggleIbcSwitch.encode(request).finish(); + const promise = this.rpc.request("secret.emergencybutton.v1beta1.Msg", "ToggleIbcSwitch", data); + return promise.then(data => MsgToggleIbcSwitchResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/tx.ts b/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/tx.ts new file mode 100644 index 000000000..123f2a71b --- /dev/null +++ b/packages/types/protobuf/codegen/secret/emergencybutton/v1beta1/tx.ts @@ -0,0 +1,149 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** MsgToggleIbcSwitch represents a message to toggle the emergencybutton status by the defined pauser. */ +export interface MsgToggleIbcSwitch { + sender: string; +} +export interface MsgToggleIbcSwitchProtoMsg { + typeUrl: "/secret.emergencybutton.v1beta1.MsgToggleIbcSwitch"; + value: Uint8Array; +} +/** MsgToggleIbcSwitch represents a message to toggle the emergencybutton status by the defined pauser. */ +export interface MsgToggleIbcSwitchAmino { + sender?: string; +} +export interface MsgToggleIbcSwitchAminoMsg { + type: "/secret.emergencybutton.v1beta1.MsgToggleIbcSwitch"; + value: MsgToggleIbcSwitchAmino; +} +/** MsgToggleIbcSwitch represents a message to toggle the emergencybutton status by the defined pauser. */ +export interface MsgToggleIbcSwitchSDKType { + sender: string; +} +/** MsgToggleIbcSwitchResponse defines the response type for the toggle. */ +export interface MsgToggleIbcSwitchResponse {} +export interface MsgToggleIbcSwitchResponseProtoMsg { + typeUrl: "/secret.emergencybutton.v1beta1.MsgToggleIbcSwitchResponse"; + value: Uint8Array; +} +/** MsgToggleIbcSwitchResponse defines the response type for the toggle. */ +export interface MsgToggleIbcSwitchResponseAmino {} +export interface MsgToggleIbcSwitchResponseAminoMsg { + type: "/secret.emergencybutton.v1beta1.MsgToggleIbcSwitchResponse"; + value: MsgToggleIbcSwitchResponseAmino; +} +/** MsgToggleIbcSwitchResponse defines the response type for the toggle. */ +export interface MsgToggleIbcSwitchResponseSDKType {} +function createBaseMsgToggleIbcSwitch(): MsgToggleIbcSwitch { + return { + sender: "" + }; +} +export const MsgToggleIbcSwitch = { + typeUrl: "/secret.emergencybutton.v1beta1.MsgToggleIbcSwitch", + encode(message: MsgToggleIbcSwitch, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgToggleIbcSwitch { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgToggleIbcSwitch(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgToggleIbcSwitch { + const message = createBaseMsgToggleIbcSwitch(); + message.sender = object.sender ?? ""; + return message; + }, + fromAmino(object: MsgToggleIbcSwitchAmino): MsgToggleIbcSwitch { + const message = createBaseMsgToggleIbcSwitch(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; + }, + toAmino(message: MsgToggleIbcSwitch, useInterfaces: boolean = false): MsgToggleIbcSwitchAmino { + const obj: any = {}; + obj.sender = message.sender; + return obj; + }, + fromAminoMsg(object: MsgToggleIbcSwitchAminoMsg): MsgToggleIbcSwitch { + return MsgToggleIbcSwitch.fromAmino(object.value); + }, + fromProtoMsg(message: MsgToggleIbcSwitchProtoMsg, useInterfaces: boolean = false): MsgToggleIbcSwitch { + return MsgToggleIbcSwitch.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgToggleIbcSwitch): Uint8Array { + return MsgToggleIbcSwitch.encode(message).finish(); + }, + toProtoMsg(message: MsgToggleIbcSwitch): MsgToggleIbcSwitchProtoMsg { + return { + typeUrl: "/secret.emergencybutton.v1beta1.MsgToggleIbcSwitch", + value: MsgToggleIbcSwitch.encode(message).finish() + }; + } +}; +function createBaseMsgToggleIbcSwitchResponse(): MsgToggleIbcSwitchResponse { + return {}; +} +export const MsgToggleIbcSwitchResponse = { + typeUrl: "/secret.emergencybutton.v1beta1.MsgToggleIbcSwitchResponse", + encode(_: MsgToggleIbcSwitchResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgToggleIbcSwitchResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgToggleIbcSwitchResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgToggleIbcSwitchResponse { + const message = createBaseMsgToggleIbcSwitchResponse(); + return message; + }, + fromAmino(_: MsgToggleIbcSwitchResponseAmino): MsgToggleIbcSwitchResponse { + const message = createBaseMsgToggleIbcSwitchResponse(); + return message; + }, + toAmino(_: MsgToggleIbcSwitchResponse, useInterfaces: boolean = false): MsgToggleIbcSwitchResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgToggleIbcSwitchResponseAminoMsg): MsgToggleIbcSwitchResponse { + return MsgToggleIbcSwitchResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgToggleIbcSwitchResponseProtoMsg, useInterfaces: boolean = false): MsgToggleIbcSwitchResponse { + return MsgToggleIbcSwitchResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgToggleIbcSwitchResponse): Uint8Array { + return MsgToggleIbcSwitchResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgToggleIbcSwitchResponse): MsgToggleIbcSwitchResponseProtoMsg { + return { + typeUrl: "/secret.emergencybutton.v1beta1.MsgToggleIbcSwitchResponse", + value: MsgToggleIbcSwitchResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/intertx/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/secret/intertx/v1beta1/query.rpc.Query.ts new file mode 100644 index 000000000..535945225 --- /dev/null +++ b/packages/types/protobuf/codegen/secret/intertx/v1beta1/query.rpc.Query.ts @@ -0,0 +1,30 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryInterchainAccountFromAddressRequest, QueryInterchainAccountFromAddressResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** QueryInterchainAccountFromAddress returns the interchain account for given owner address on a given connection pair */ + interchainAccountFromAddress(request: QueryInterchainAccountFromAddressRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.interchainAccountFromAddress = this.interchainAccountFromAddress.bind(this); + } + interchainAccountFromAddress(request: QueryInterchainAccountFromAddressRequest, useInterfaces: boolean = true): Promise { + const data = QueryInterchainAccountFromAddressRequest.encode(request).finish(); + const promise = this.rpc.request("secret.intertx.v1beta1.Query", "InterchainAccountFromAddress", data); + return promise.then(data => QueryInterchainAccountFromAddressResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + interchainAccountFromAddress(request: QueryInterchainAccountFromAddressRequest, useInterfaces: boolean = true): Promise { + return queryService.interchainAccountFromAddress(request, useInterfaces); + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/intertx/v1beta1/query.ts b/packages/types/protobuf/codegen/secret/intertx/v1beta1/query.ts new file mode 100644 index 000000000..e9f877add --- /dev/null +++ b/packages/types/protobuf/codegen/secret/intertx/v1beta1/query.ts @@ -0,0 +1,183 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryInterchainAccountFromAddressRequest is the request type for the Query/InterchainAccountAddress RPC */ +export interface QueryInterchainAccountFromAddressRequest { + owner: string; + connectionId: string; +} +export interface QueryInterchainAccountFromAddressRequestProtoMsg { + typeUrl: "/secret.intertx.v1beta1.QueryInterchainAccountFromAddressRequest"; + value: Uint8Array; +} +/** QueryInterchainAccountFromAddressRequest is the request type for the Query/InterchainAccountAddress RPC */ +export interface QueryInterchainAccountFromAddressRequestAmino { + owner?: string; + connection_id?: string; +} +export interface QueryInterchainAccountFromAddressRequestAminoMsg { + type: "/secret.intertx.v1beta1.QueryInterchainAccountFromAddressRequest"; + value: QueryInterchainAccountFromAddressRequestAmino; +} +/** QueryInterchainAccountFromAddressRequest is the request type for the Query/InterchainAccountAddress RPC */ +export interface QueryInterchainAccountFromAddressRequestSDKType { + owner: string; + connection_id: string; +} +/** QueryInterchainAccountFromAddressResponse the response type for the Query/InterchainAccountAddress RPC */ +export interface QueryInterchainAccountFromAddressResponse { + interchainAccountAddress: string; +} +export interface QueryInterchainAccountFromAddressResponseProtoMsg { + typeUrl: "/secret.intertx.v1beta1.QueryInterchainAccountFromAddressResponse"; + value: Uint8Array; +} +/** QueryInterchainAccountFromAddressResponse the response type for the Query/InterchainAccountAddress RPC */ +export interface QueryInterchainAccountFromAddressResponseAmino { + interchain_account_address?: string; +} +export interface QueryInterchainAccountFromAddressResponseAminoMsg { + type: "/secret.intertx.v1beta1.QueryInterchainAccountFromAddressResponse"; + value: QueryInterchainAccountFromAddressResponseAmino; +} +/** QueryInterchainAccountFromAddressResponse the response type for the Query/InterchainAccountAddress RPC */ +export interface QueryInterchainAccountFromAddressResponseSDKType { + interchain_account_address: string; +} +function createBaseQueryInterchainAccountFromAddressRequest(): QueryInterchainAccountFromAddressRequest { + return { + owner: "", + connectionId: "" + }; +} +export const QueryInterchainAccountFromAddressRequest = { + typeUrl: "/secret.intertx.v1beta1.QueryInterchainAccountFromAddressRequest", + encode(message: QueryInterchainAccountFromAddressRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.owner !== "") { + writer.uint32(10).string(message.owner); + } + if (message.connectionId !== "") { + writer.uint32(18).string(message.connectionId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryInterchainAccountFromAddressRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryInterchainAccountFromAddressRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.connectionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryInterchainAccountFromAddressRequest { + const message = createBaseQueryInterchainAccountFromAddressRequest(); + message.owner = object.owner ?? ""; + message.connectionId = object.connectionId ?? ""; + return message; + }, + fromAmino(object: QueryInterchainAccountFromAddressRequestAmino): QueryInterchainAccountFromAddressRequest { + const message = createBaseQueryInterchainAccountFromAddressRequest(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + return message; + }, + toAmino(message: QueryInterchainAccountFromAddressRequest, useInterfaces: boolean = false): QueryInterchainAccountFromAddressRequestAmino { + const obj: any = {}; + obj.owner = message.owner; + obj.connection_id = message.connectionId; + return obj; + }, + fromAminoMsg(object: QueryInterchainAccountFromAddressRequestAminoMsg): QueryInterchainAccountFromAddressRequest { + return QueryInterchainAccountFromAddressRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryInterchainAccountFromAddressRequestProtoMsg, useInterfaces: boolean = false): QueryInterchainAccountFromAddressRequest { + return QueryInterchainAccountFromAddressRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryInterchainAccountFromAddressRequest): Uint8Array { + return QueryInterchainAccountFromAddressRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryInterchainAccountFromAddressRequest): QueryInterchainAccountFromAddressRequestProtoMsg { + return { + typeUrl: "/secret.intertx.v1beta1.QueryInterchainAccountFromAddressRequest", + value: QueryInterchainAccountFromAddressRequest.encode(message).finish() + }; + } +}; +function createBaseQueryInterchainAccountFromAddressResponse(): QueryInterchainAccountFromAddressResponse { + return { + interchainAccountAddress: "" + }; +} +export const QueryInterchainAccountFromAddressResponse = { + typeUrl: "/secret.intertx.v1beta1.QueryInterchainAccountFromAddressResponse", + encode(message: QueryInterchainAccountFromAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.interchainAccountAddress !== "") { + writer.uint32(10).string(message.interchainAccountAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryInterchainAccountFromAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryInterchainAccountFromAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.interchainAccountAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryInterchainAccountFromAddressResponse { + const message = createBaseQueryInterchainAccountFromAddressResponse(); + message.interchainAccountAddress = object.interchainAccountAddress ?? ""; + return message; + }, + fromAmino(object: QueryInterchainAccountFromAddressResponseAmino): QueryInterchainAccountFromAddressResponse { + const message = createBaseQueryInterchainAccountFromAddressResponse(); + if (object.interchain_account_address !== undefined && object.interchain_account_address !== null) { + message.interchainAccountAddress = object.interchain_account_address; + } + return message; + }, + toAmino(message: QueryInterchainAccountFromAddressResponse, useInterfaces: boolean = false): QueryInterchainAccountFromAddressResponseAmino { + const obj: any = {}; + obj.interchain_account_address = message.interchainAccountAddress; + return obj; + }, + fromAminoMsg(object: QueryInterchainAccountFromAddressResponseAminoMsg): QueryInterchainAccountFromAddressResponse { + return QueryInterchainAccountFromAddressResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryInterchainAccountFromAddressResponseProtoMsg, useInterfaces: boolean = false): QueryInterchainAccountFromAddressResponse { + return QueryInterchainAccountFromAddressResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryInterchainAccountFromAddressResponse): Uint8Array { + return QueryInterchainAccountFromAddressResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryInterchainAccountFromAddressResponse): QueryInterchainAccountFromAddressResponseProtoMsg { + return { + typeUrl: "/secret.intertx.v1beta1.QueryInterchainAccountFromAddressResponse", + value: QueryInterchainAccountFromAddressResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/intertx/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/secret/intertx/v1beta1/tx.amino.ts new file mode 100644 index 000000000..0cfc81d1d --- /dev/null +++ b/packages/types/protobuf/codegen/secret/intertx/v1beta1/tx.amino.ts @@ -0,0 +1,13 @@ +import { MsgRegisterAccount, MsgSubmitTx } from "./tx"; +export const AminoConverter = { + "/secret.intertx.v1beta1.MsgRegisterAccount": { + aminoType: "/secret.intertx.v1beta1.MsgRegisterAccount", + toAmino: MsgRegisterAccount.toAmino, + fromAmino: MsgRegisterAccount.fromAmino + }, + "/secret.intertx.v1beta1.MsgSubmitTx": { + aminoType: "/secret.intertx.v1beta1.MsgSubmitTx", + toAmino: MsgSubmitTx.toAmino, + fromAmino: MsgSubmitTx.fromAmino + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/intertx/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/secret/intertx/v1beta1/tx.registry.ts new file mode 100644 index 000000000..799c830c1 --- /dev/null +++ b/packages/types/protobuf/codegen/secret/intertx/v1beta1/tx.registry.ts @@ -0,0 +1,53 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgRegisterAccount, MsgSubmitTx } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/secret.intertx.v1beta1.MsgRegisterAccount", MsgRegisterAccount], ["/secret.intertx.v1beta1.MsgSubmitTx", MsgSubmitTx]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + registerAccount(value: MsgRegisterAccount) { + return { + typeUrl: "/secret.intertx.v1beta1.MsgRegisterAccount", + value: MsgRegisterAccount.encode(value).finish() + }; + }, + submitTx(value: MsgSubmitTx) { + return { + typeUrl: "/secret.intertx.v1beta1.MsgSubmitTx", + value: MsgSubmitTx.encode(value).finish() + }; + } + }, + withTypeUrl: { + registerAccount(value: MsgRegisterAccount) { + return { + typeUrl: "/secret.intertx.v1beta1.MsgRegisterAccount", + value + }; + }, + submitTx(value: MsgSubmitTx) { + return { + typeUrl: "/secret.intertx.v1beta1.MsgSubmitTx", + value + }; + } + }, + fromPartial: { + registerAccount(value: MsgRegisterAccount) { + return { + typeUrl: "/secret.intertx.v1beta1.MsgRegisterAccount", + value: MsgRegisterAccount.fromPartial(value) + }; + }, + submitTx(value: MsgSubmitTx) { + return { + typeUrl: "/secret.intertx.v1beta1.MsgSubmitTx", + value: MsgSubmitTx.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/intertx/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/secret/intertx/v1beta1/tx.rpc.msg.ts new file mode 100644 index 000000000..36dabf944 --- /dev/null +++ b/packages/types/protobuf/codegen/secret/intertx/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,27 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgRegisterAccount, MsgRegisterAccountResponse, MsgSubmitTx, MsgSubmitTxResponse } from "./tx"; +/** Msg defines the ica-authentication Msg service. */ +export interface Msg { + /** Register defines a rpc handler for MsgRegisterAccount */ + registerAccount(request: MsgRegisterAccount): Promise; + submitTx(request: MsgSubmitTx): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.registerAccount = this.registerAccount.bind(this); + this.submitTx = this.submitTx.bind(this); + } + registerAccount(request: MsgRegisterAccount, useInterfaces: boolean = true): Promise { + const data = MsgRegisterAccount.encode(request).finish(); + const promise = this.rpc.request("secret.intertx.v1beta1.Msg", "RegisterAccount", data); + return promise.then(data => MsgRegisterAccountResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + submitTx(request: MsgSubmitTx, useInterfaces: boolean = true): Promise { + const data = MsgSubmitTx.encode(request).finish(); + const promise = this.rpc.request("secret.intertx.v1beta1.Msg", "SubmitTx", data); + return promise.then(data => MsgSubmitTxResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/intertx/v1beta1/tx.ts b/packages/types/protobuf/codegen/secret/intertx/v1beta1/tx.ts new file mode 100644 index 000000000..214974984 --- /dev/null +++ b/packages/types/protobuf/codegen/secret/intertx/v1beta1/tx.ts @@ -0,0 +1,358 @@ +//@ts-nocheck +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** MsgRegisterAccount registers an interchain account for the given owner over the specified connection pair */ +export interface MsgRegisterAccount { + owner: string; + connectionId: string; + version: string; +} +export interface MsgRegisterAccountProtoMsg { + typeUrl: "/secret.intertx.v1beta1.MsgRegisterAccount"; + value: Uint8Array; +} +/** MsgRegisterAccount registers an interchain account for the given owner over the specified connection pair */ +export interface MsgRegisterAccountAmino { + owner?: string; + connection_id?: string; + version?: string; +} +export interface MsgRegisterAccountAminoMsg { + type: "/secret.intertx.v1beta1.MsgRegisterAccount"; + value: MsgRegisterAccountAmino; +} +/** MsgRegisterAccount registers an interchain account for the given owner over the specified connection pair */ +export interface MsgRegisterAccountSDKType { + owner: string; + connection_id: string; + version: string; +} +/** MsgRegisterAccountResponse is the response type for Msg/RegisterAccount */ +export interface MsgRegisterAccountResponse {} +export interface MsgRegisterAccountResponseProtoMsg { + typeUrl: "/secret.intertx.v1beta1.MsgRegisterAccountResponse"; + value: Uint8Array; +} +/** MsgRegisterAccountResponse is the response type for Msg/RegisterAccount */ +export interface MsgRegisterAccountResponseAmino {} +export interface MsgRegisterAccountResponseAminoMsg { + type: "/secret.intertx.v1beta1.MsgRegisterAccountResponse"; + value: MsgRegisterAccountResponseAmino; +} +/** MsgRegisterAccountResponse is the response type for Msg/RegisterAccount */ +export interface MsgRegisterAccountResponseSDKType {} +/** MsgSubmitTx creates and submits an arbitrary transaction msg to be executed using an interchain account */ +export interface MsgSubmitTx { + owner: Uint8Array; + connectionId: string; + msg?: Any | undefined; +} +export interface MsgSubmitTxProtoMsg { + typeUrl: "/secret.intertx.v1beta1.MsgSubmitTx"; + value: Uint8Array; +} +/** MsgSubmitTx creates and submits an arbitrary transaction msg to be executed using an interchain account */ +export interface MsgSubmitTxAmino { + owner?: string; + connection_id?: string; + msg?: AnyAmino | undefined; +} +export interface MsgSubmitTxAminoMsg { + type: "/secret.intertx.v1beta1.MsgSubmitTx"; + value: MsgSubmitTxAmino; +} +/** MsgSubmitTx creates and submits an arbitrary transaction msg to be executed using an interchain account */ +export interface MsgSubmitTxSDKType { + owner: Uint8Array; + connection_id: string; + msg?: AnySDKType | undefined; +} +/** MsgSubmitTxResponse defines the MsgSubmitTx response type */ +export interface MsgSubmitTxResponse {} +export interface MsgSubmitTxResponseProtoMsg { + typeUrl: "/secret.intertx.v1beta1.MsgSubmitTxResponse"; + value: Uint8Array; +} +/** MsgSubmitTxResponse defines the MsgSubmitTx response type */ +export interface MsgSubmitTxResponseAmino {} +export interface MsgSubmitTxResponseAminoMsg { + type: "/secret.intertx.v1beta1.MsgSubmitTxResponse"; + value: MsgSubmitTxResponseAmino; +} +/** MsgSubmitTxResponse defines the MsgSubmitTx response type */ +export interface MsgSubmitTxResponseSDKType {} +function createBaseMsgRegisterAccount(): MsgRegisterAccount { + return { + owner: "", + connectionId: "", + version: "" + }; +} +export const MsgRegisterAccount = { + typeUrl: "/secret.intertx.v1beta1.MsgRegisterAccount", + encode(message: MsgRegisterAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.owner !== "") { + writer.uint32(10).string(message.owner); + } + if (message.connectionId !== "") { + writer.uint32(18).string(message.connectionId); + } + if (message.version !== "") { + writer.uint32(26).string(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRegisterAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRegisterAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.connectionId = reader.string(); + break; + case 3: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRegisterAccount { + const message = createBaseMsgRegisterAccount(); + message.owner = object.owner ?? ""; + message.connectionId = object.connectionId ?? ""; + message.version = object.version ?? ""; + return message; + }, + fromAmino(object: MsgRegisterAccountAmino): MsgRegisterAccount { + const message = createBaseMsgRegisterAccount(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; + }, + toAmino(message: MsgRegisterAccount, useInterfaces: boolean = false): MsgRegisterAccountAmino { + const obj: any = {}; + obj.owner = message.owner; + obj.connection_id = message.connectionId; + obj.version = message.version; + return obj; + }, + fromAminoMsg(object: MsgRegisterAccountAminoMsg): MsgRegisterAccount { + return MsgRegisterAccount.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRegisterAccountProtoMsg, useInterfaces: boolean = false): MsgRegisterAccount { + return MsgRegisterAccount.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgRegisterAccount): Uint8Array { + return MsgRegisterAccount.encode(message).finish(); + }, + toProtoMsg(message: MsgRegisterAccount): MsgRegisterAccountProtoMsg { + return { + typeUrl: "/secret.intertx.v1beta1.MsgRegisterAccount", + value: MsgRegisterAccount.encode(message).finish() + }; + } +}; +function createBaseMsgRegisterAccountResponse(): MsgRegisterAccountResponse { + return {}; +} +export const MsgRegisterAccountResponse = { + typeUrl: "/secret.intertx.v1beta1.MsgRegisterAccountResponse", + encode(_: MsgRegisterAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgRegisterAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRegisterAccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgRegisterAccountResponse { + const message = createBaseMsgRegisterAccountResponse(); + return message; + }, + fromAmino(_: MsgRegisterAccountResponseAmino): MsgRegisterAccountResponse { + const message = createBaseMsgRegisterAccountResponse(); + return message; + }, + toAmino(_: MsgRegisterAccountResponse, useInterfaces: boolean = false): MsgRegisterAccountResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRegisterAccountResponseAminoMsg): MsgRegisterAccountResponse { + return MsgRegisterAccountResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRegisterAccountResponseProtoMsg, useInterfaces: boolean = false): MsgRegisterAccountResponse { + return MsgRegisterAccountResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgRegisterAccountResponse): Uint8Array { + return MsgRegisterAccountResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRegisterAccountResponse): MsgRegisterAccountResponseProtoMsg { + return { + typeUrl: "/secret.intertx.v1beta1.MsgRegisterAccountResponse", + value: MsgRegisterAccountResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSubmitTx(): MsgSubmitTx { + return { + owner: new Uint8Array(), + connectionId: "", + msg: undefined + }; +} +export const MsgSubmitTx = { + typeUrl: "/secret.intertx.v1beta1.MsgSubmitTx", + encode(message: MsgSubmitTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.owner.length !== 0) { + writer.uint32(10).bytes(message.owner); + } + if (message.connectionId !== "") { + writer.uint32(18).string(message.connectionId); + } + if (message.msg !== undefined) { + Any.encode(message.msg, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSubmitTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitTx(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.bytes(); + break; + case 2: + message.connectionId = reader.string(); + break; + case 3: + message.msg = Any.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSubmitTx { + const message = createBaseMsgSubmitTx(); + message.owner = object.owner ?? new Uint8Array(); + message.connectionId = object.connectionId ?? ""; + message.msg = object.msg !== undefined && object.msg !== null ? Any.fromPartial(object.msg) : undefined; + return message; + }, + fromAmino(object: MsgSubmitTxAmino): MsgSubmitTx { + const message = createBaseMsgSubmitTx(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = bytesFromBase64(object.owner); + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = Any.fromAmino(object.msg); + } + return message; + }, + toAmino(message: MsgSubmitTx, useInterfaces: boolean = false): MsgSubmitTxAmino { + const obj: any = {}; + obj.owner = message.owner ? base64FromBytes(message.owner) : undefined; + obj.connection_id = message.connectionId; + obj.msg = message.msg ? Any.toAmino(message.msg, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSubmitTxAminoMsg): MsgSubmitTx { + return MsgSubmitTx.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSubmitTxProtoMsg, useInterfaces: boolean = false): MsgSubmitTx { + return MsgSubmitTx.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSubmitTx): Uint8Array { + return MsgSubmitTx.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitTx): MsgSubmitTxProtoMsg { + return { + typeUrl: "/secret.intertx.v1beta1.MsgSubmitTx", + value: MsgSubmitTx.encode(message).finish() + }; + } +}; +function createBaseMsgSubmitTxResponse(): MsgSubmitTxResponse { + return {}; +} +export const MsgSubmitTxResponse = { + typeUrl: "/secret.intertx.v1beta1.MsgSubmitTxResponse", + encode(_: MsgSubmitTxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgSubmitTxResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitTxResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSubmitTxResponse { + const message = createBaseMsgSubmitTxResponse(); + return message; + }, + fromAmino(_: MsgSubmitTxResponseAmino): MsgSubmitTxResponse { + const message = createBaseMsgSubmitTxResponse(); + return message; + }, + toAmino(_: MsgSubmitTxResponse, useInterfaces: boolean = false): MsgSubmitTxResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSubmitTxResponseAminoMsg): MsgSubmitTxResponse { + return MsgSubmitTxResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSubmitTxResponseProtoMsg, useInterfaces: boolean = false): MsgSubmitTxResponse { + return MsgSubmitTxResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgSubmitTxResponse): Uint8Array { + return MsgSubmitTxResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitTxResponse): MsgSubmitTxResponseProtoMsg { + return { + typeUrl: "/secret.intertx.v1beta1.MsgSubmitTxResponse", + value: MsgSubmitTxResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/registration/v1beta1/genesis.ts b/packages/types/protobuf/codegen/secret/registration/v1beta1/genesis.ts new file mode 100644 index 000000000..2c7690cd8 --- /dev/null +++ b/packages/types/protobuf/codegen/secret/registration/v1beta1/genesis.ts @@ -0,0 +1,116 @@ +//@ts-nocheck +import { RegistrationNodeInfo, RegistrationNodeInfoAmino, RegistrationNodeInfoSDKType } from "./types"; +import { MasterKey, MasterKeyAmino, MasterKeySDKType } from "./msg"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +export interface GenesisState { + registration: RegistrationNodeInfo[]; + nodeExchMasterKey?: MasterKey | undefined; + ioMasterKey?: MasterKey | undefined; +} +export interface GenesisStateProtoMsg { + typeUrl: "/secret.registration.v1beta1.GenesisState"; + value: Uint8Array; +} +export interface GenesisStateAmino { + registration?: RegistrationNodeInfoAmino[]; + node_exch_master_key?: MasterKeyAmino | undefined; + io_master_key?: MasterKeyAmino | undefined; +} +export interface GenesisStateAminoMsg { + type: "/secret.registration.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +export interface GenesisStateSDKType { + registration: RegistrationNodeInfoSDKType[]; + node_exch_master_key?: MasterKeySDKType | undefined; + io_master_key?: MasterKeySDKType | undefined; +} +function createBaseGenesisState(): GenesisState { + return { + registration: [], + nodeExchMasterKey: undefined, + ioMasterKey: undefined + }; +} +export const GenesisState = { + typeUrl: "/secret.registration.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.registration) { + RegistrationNodeInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.nodeExchMasterKey !== undefined) { + MasterKey.encode(message.nodeExchMasterKey, writer.uint32(18).fork()).ldelim(); + } + if (message.ioMasterKey !== undefined) { + MasterKey.encode(message.ioMasterKey, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.registration.push(RegistrationNodeInfo.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.nodeExchMasterKey = MasterKey.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.ioMasterKey = MasterKey.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.registration = object.registration?.map(e => RegistrationNodeInfo.fromPartial(e)) || []; + message.nodeExchMasterKey = object.nodeExchMasterKey !== undefined && object.nodeExchMasterKey !== null ? MasterKey.fromPartial(object.nodeExchMasterKey) : undefined; + message.ioMasterKey = object.ioMasterKey !== undefined && object.ioMasterKey !== null ? MasterKey.fromPartial(object.ioMasterKey) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.registration = object.registration?.map(e => RegistrationNodeInfo.fromAmino(e)) || []; + if (object.node_exch_master_key !== undefined && object.node_exch_master_key !== null) { + message.nodeExchMasterKey = MasterKey.fromAmino(object.node_exch_master_key); + } + if (object.io_master_key !== undefined && object.io_master_key !== null) { + message.ioMasterKey = MasterKey.fromAmino(object.io_master_key); + } + return message; + }, + toAmino(message: GenesisState, useInterfaces: boolean = false): GenesisStateAmino { + const obj: any = {}; + if (message.registration) { + obj.registration = message.registration.map(e => e ? RegistrationNodeInfo.toAmino(e, useInterfaces) : undefined); + } else { + obj.registration = []; + } + obj.node_exch_master_key = message.nodeExchMasterKey ? MasterKey.toAmino(message.nodeExchMasterKey, useInterfaces) : undefined; + obj.io_master_key = message.ioMasterKey ? MasterKey.toAmino(message.ioMasterKey, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg, useInterfaces: boolean = false): GenesisState { + return GenesisState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/secret.registration.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/registration/v1beta1/msg.ts b/packages/types/protobuf/codegen/secret/registration/v1beta1/msg.ts new file mode 100644 index 000000000..c8f3595b6 --- /dev/null +++ b/packages/types/protobuf/codegen/secret/registration/v1beta1/msg.ts @@ -0,0 +1,257 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +export interface RaAuthenticate { + sender: Uint8Array; + certificate: Uint8Array; +} +export interface RaAuthenticateProtoMsg { + typeUrl: "/secret.registration.v1beta1.RaAuthenticate"; + value: Uint8Array; +} +export interface RaAuthenticateAmino { + sender?: string; + certificate?: string; +} +export interface RaAuthenticateAminoMsg { + type: "/secret.registration.v1beta1.RaAuthenticate"; + value: RaAuthenticateAmino; +} +export interface RaAuthenticateSDKType { + sender: Uint8Array; + certificate: Uint8Array; +} +export interface MasterKey { + bytes: Uint8Array; +} +export interface MasterKeyProtoMsg { + typeUrl: "/secret.registration.v1beta1.MasterKey"; + value: Uint8Array; +} +export interface MasterKeyAmino { + bytes?: string; +} +export interface MasterKeyAminoMsg { + type: "/secret.registration.v1beta1.MasterKey"; + value: MasterKeyAmino; +} +export interface MasterKeySDKType { + bytes: Uint8Array; +} +export interface Key { + key: Uint8Array; +} +export interface KeyProtoMsg { + typeUrl: "/secret.registration.v1beta1.Key"; + value: Uint8Array; +} +export interface KeyAmino { + key?: string; +} +export interface KeyAminoMsg { + type: "/secret.registration.v1beta1.Key"; + value: KeyAmino; +} +export interface KeySDKType { + key: Uint8Array; +} +function createBaseRaAuthenticate(): RaAuthenticate { + return { + sender: new Uint8Array(), + certificate: new Uint8Array() + }; +} +export const RaAuthenticate = { + typeUrl: "/secret.registration.v1beta1.RaAuthenticate", + encode(message: RaAuthenticate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender.length !== 0) { + writer.uint32(10).bytes(message.sender); + } + if (message.certificate.length !== 0) { + writer.uint32(18).bytes(message.certificate); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): RaAuthenticate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRaAuthenticate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.bytes(); + break; + case 2: + message.certificate = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RaAuthenticate { + const message = createBaseRaAuthenticate(); + message.sender = object.sender ?? new Uint8Array(); + message.certificate = object.certificate ?? new Uint8Array(); + return message; + }, + fromAmino(object: RaAuthenticateAmino): RaAuthenticate { + const message = createBaseRaAuthenticate(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = bytesFromBase64(object.sender); + } + if (object.certificate !== undefined && object.certificate !== null) { + message.certificate = bytesFromBase64(object.certificate); + } + return message; + }, + toAmino(message: RaAuthenticate, useInterfaces: boolean = false): RaAuthenticateAmino { + const obj: any = {}; + obj.sender = message.sender ? base64FromBytes(message.sender) : undefined; + obj.certificate = message.certificate ? base64FromBytes(message.certificate) : undefined; + return obj; + }, + fromAminoMsg(object: RaAuthenticateAminoMsg): RaAuthenticate { + return RaAuthenticate.fromAmino(object.value); + }, + fromProtoMsg(message: RaAuthenticateProtoMsg, useInterfaces: boolean = false): RaAuthenticate { + return RaAuthenticate.decode(message.value, undefined, useInterfaces); + }, + toProto(message: RaAuthenticate): Uint8Array { + return RaAuthenticate.encode(message).finish(); + }, + toProtoMsg(message: RaAuthenticate): RaAuthenticateProtoMsg { + return { + typeUrl: "/secret.registration.v1beta1.RaAuthenticate", + value: RaAuthenticate.encode(message).finish() + }; + } +}; +function createBaseMasterKey(): MasterKey { + return { + bytes: new Uint8Array() + }; +} +export const MasterKey = { + typeUrl: "/secret.registration.v1beta1.MasterKey", + encode(message: MasterKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bytes.length !== 0) { + writer.uint32(10).bytes(message.bytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MasterKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMasterKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MasterKey { + const message = createBaseMasterKey(); + message.bytes = object.bytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: MasterKeyAmino): MasterKey { + const message = createBaseMasterKey(); + if (object.bytes !== undefined && object.bytes !== null) { + message.bytes = bytesFromBase64(object.bytes); + } + return message; + }, + toAmino(message: MasterKey, useInterfaces: boolean = false): MasterKeyAmino { + const obj: any = {}; + obj.bytes = message.bytes ? base64FromBytes(message.bytes) : undefined; + return obj; + }, + fromAminoMsg(object: MasterKeyAminoMsg): MasterKey { + return MasterKey.fromAmino(object.value); + }, + fromProtoMsg(message: MasterKeyProtoMsg, useInterfaces: boolean = false): MasterKey { + return MasterKey.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MasterKey): Uint8Array { + return MasterKey.encode(message).finish(); + }, + toProtoMsg(message: MasterKey): MasterKeyProtoMsg { + return { + typeUrl: "/secret.registration.v1beta1.MasterKey", + value: MasterKey.encode(message).finish() + }; + } +}; +function createBaseKey(): Key { + return { + key: new Uint8Array() + }; +} +export const Key = { + typeUrl: "/secret.registration.v1beta1.Key", + encode(message: Key, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Key { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseKey(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Key { + const message = createBaseKey(); + message.key = object.key ?? new Uint8Array(); + return message; + }, + fromAmino(object: KeyAmino): Key { + const message = createBaseKey(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + toAmino(message: Key, useInterfaces: boolean = false): KeyAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + return obj; + }, + fromAminoMsg(object: KeyAminoMsg): Key { + return Key.fromAmino(object.value); + }, + fromProtoMsg(message: KeyProtoMsg, useInterfaces: boolean = false): Key { + return Key.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Key): Uint8Array { + return Key.encode(message).finish(); + }, + toProtoMsg(message: Key): KeyProtoMsg { + return { + typeUrl: "/secret.registration.v1beta1.Key", + value: Key.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/registration/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/secret/registration/v1beta1/query.rpc.Query.ts new file mode 100644 index 000000000..9617817a2 --- /dev/null +++ b/packages/types/protobuf/codegen/secret/registration/v1beta1/query.rpc.Query.ts @@ -0,0 +1,54 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { Empty } from "../../../google/protobuf/empty"; +import { Key } from "./msg"; +import { QueryEncryptedSeedRequest, QueryEncryptedSeedResponse } from "./query"; +/** Query provides defines the gRPC querier service */ +export interface Query { + /** Returns the key used for transactions */ + txKey(request?: Empty): Promise; + /** Returns the key used for registration */ + registrationKey(request?: Empty): Promise; + /** Returns the encrypted seed for a registered node by public key */ + encryptedSeed(request: QueryEncryptedSeedRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.txKey = this.txKey.bind(this); + this.registrationKey = this.registrationKey.bind(this); + this.encryptedSeed = this.encryptedSeed.bind(this); + } + txKey(request: Empty = {}, useInterfaces: boolean = true): Promise { + const data = Empty.encode(request).finish(); + const promise = this.rpc.request("secret.registration.v1beta1.Query", "TxKey", data); + return promise.then(data => Key.decode(new BinaryReader(data), undefined, useInterfaces)); + } + registrationKey(request: Empty = {}, useInterfaces: boolean = true): Promise { + const data = Empty.encode(request).finish(); + const promise = this.rpc.request("secret.registration.v1beta1.Query", "RegistrationKey", data); + return promise.then(data => Key.decode(new BinaryReader(data), undefined, useInterfaces)); + } + encryptedSeed(request: QueryEncryptedSeedRequest, useInterfaces: boolean = true): Promise { + const data = QueryEncryptedSeedRequest.encode(request).finish(); + const promise = this.rpc.request("secret.registration.v1beta1.Query", "EncryptedSeed", data); + return promise.then(data => QueryEncryptedSeedResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + txKey(request?: Empty, useInterfaces: boolean = true): Promise { + return queryService.txKey(request, useInterfaces); + }, + registrationKey(request?: Empty, useInterfaces: boolean = true): Promise { + return queryService.registrationKey(request, useInterfaces); + }, + encryptedSeed(request: QueryEncryptedSeedRequest, useInterfaces: boolean = true): Promise { + return queryService.encryptedSeed(request, useInterfaces); + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/registration/v1beta1/query.ts b/packages/types/protobuf/codegen/secret/registration/v1beta1/query.ts new file mode 100644 index 000000000..74ce7aef1 --- /dev/null +++ b/packages/types/protobuf/codegen/secret/registration/v1beta1/query.ts @@ -0,0 +1,165 @@ +//@ts-nocheck +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +export interface QueryEncryptedSeedRequest { + pubKey: Uint8Array; +} +export interface QueryEncryptedSeedRequestProtoMsg { + typeUrl: "/secret.registration.v1beta1.QueryEncryptedSeedRequest"; + value: Uint8Array; +} +export interface QueryEncryptedSeedRequestAmino { + pub_key?: string; +} +export interface QueryEncryptedSeedRequestAminoMsg { + type: "/secret.registration.v1beta1.QueryEncryptedSeedRequest"; + value: QueryEncryptedSeedRequestAmino; +} +export interface QueryEncryptedSeedRequestSDKType { + pub_key: Uint8Array; +} +export interface QueryEncryptedSeedResponse { + /** [(gogoproto.nullable) = false]; */ + encryptedSeed: Uint8Array; +} +export interface QueryEncryptedSeedResponseProtoMsg { + typeUrl: "/secret.registration.v1beta1.QueryEncryptedSeedResponse"; + value: Uint8Array; +} +export interface QueryEncryptedSeedResponseAmino { + /** [(gogoproto.nullable) = false]; */ + encrypted_seed?: string; +} +export interface QueryEncryptedSeedResponseAminoMsg { + type: "/secret.registration.v1beta1.QueryEncryptedSeedResponse"; + value: QueryEncryptedSeedResponseAmino; +} +export interface QueryEncryptedSeedResponseSDKType { + encrypted_seed: Uint8Array; +} +function createBaseQueryEncryptedSeedRequest(): QueryEncryptedSeedRequest { + return { + pubKey: new Uint8Array() + }; +} +export const QueryEncryptedSeedRequest = { + typeUrl: "/secret.registration.v1beta1.QueryEncryptedSeedRequest", + encode(message: QueryEncryptedSeedRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pubKey.length !== 0) { + writer.uint32(10).bytes(message.pubKey); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryEncryptedSeedRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEncryptedSeedRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKey = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryEncryptedSeedRequest { + const message = createBaseQueryEncryptedSeedRequest(); + message.pubKey = object.pubKey ?? new Uint8Array(); + return message; + }, + fromAmino(object: QueryEncryptedSeedRequestAmino): QueryEncryptedSeedRequest { + const message = createBaseQueryEncryptedSeedRequest(); + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = bytesFromBase64(object.pub_key); + } + return message; + }, + toAmino(message: QueryEncryptedSeedRequest, useInterfaces: boolean = false): QueryEncryptedSeedRequestAmino { + const obj: any = {}; + obj.pub_key = message.pubKey ? base64FromBytes(message.pubKey) : undefined; + return obj; + }, + fromAminoMsg(object: QueryEncryptedSeedRequestAminoMsg): QueryEncryptedSeedRequest { + return QueryEncryptedSeedRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryEncryptedSeedRequestProtoMsg, useInterfaces: boolean = false): QueryEncryptedSeedRequest { + return QueryEncryptedSeedRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryEncryptedSeedRequest): Uint8Array { + return QueryEncryptedSeedRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryEncryptedSeedRequest): QueryEncryptedSeedRequestProtoMsg { + return { + typeUrl: "/secret.registration.v1beta1.QueryEncryptedSeedRequest", + value: QueryEncryptedSeedRequest.encode(message).finish() + }; + } +}; +function createBaseQueryEncryptedSeedResponse(): QueryEncryptedSeedResponse { + return { + encryptedSeed: new Uint8Array() + }; +} +export const QueryEncryptedSeedResponse = { + typeUrl: "/secret.registration.v1beta1.QueryEncryptedSeedResponse", + encode(message: QueryEncryptedSeedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.encryptedSeed.length !== 0) { + writer.uint32(10).bytes(message.encryptedSeed); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryEncryptedSeedResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEncryptedSeedResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.encryptedSeed = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryEncryptedSeedResponse { + const message = createBaseQueryEncryptedSeedResponse(); + message.encryptedSeed = object.encryptedSeed ?? new Uint8Array(); + return message; + }, + fromAmino(object: QueryEncryptedSeedResponseAmino): QueryEncryptedSeedResponse { + const message = createBaseQueryEncryptedSeedResponse(); + if (object.encrypted_seed !== undefined && object.encrypted_seed !== null) { + message.encryptedSeed = bytesFromBase64(object.encrypted_seed); + } + return message; + }, + toAmino(message: QueryEncryptedSeedResponse, useInterfaces: boolean = false): QueryEncryptedSeedResponseAmino { + const obj: any = {}; + obj.encrypted_seed = message.encryptedSeed ? base64FromBytes(message.encryptedSeed) : undefined; + return obj; + }, + fromAminoMsg(object: QueryEncryptedSeedResponseAminoMsg): QueryEncryptedSeedResponse { + return QueryEncryptedSeedResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryEncryptedSeedResponseProtoMsg, useInterfaces: boolean = false): QueryEncryptedSeedResponse { + return QueryEncryptedSeedResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryEncryptedSeedResponse): Uint8Array { + return QueryEncryptedSeedResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryEncryptedSeedResponse): QueryEncryptedSeedResponseProtoMsg { + return { + typeUrl: "/secret.registration.v1beta1.QueryEncryptedSeedResponse", + value: QueryEncryptedSeedResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/registration/v1beta1/types.ts b/packages/types/protobuf/codegen/secret/registration/v1beta1/types.ts new file mode 100644 index 000000000..993339f68 --- /dev/null +++ b/packages/types/protobuf/codegen/secret/registration/v1beta1/types.ts @@ -0,0 +1,302 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +export interface SeedConfig { + masterKey: string; + encryptedKey: string; + version: number; +} +export interface SeedConfigProtoMsg { + typeUrl: "/secret.registration.v1beta1.SeedConfig"; + value: Uint8Array; +} +export interface SeedConfigAmino { + master_key?: string; + encrypted_key?: string; + version?: number; +} +export interface SeedConfigAminoMsg { + type: "/secret.registration.v1beta1.SeedConfig"; + value: SeedConfigAmino; +} +export interface SeedConfigSDKType { + master_key: string; + encrypted_key: string; + version: number; +} +export interface LegacySeedConfig { + masterCert: string; + encryptedKey: string; +} +export interface LegacySeedConfigProtoMsg { + typeUrl: "/secret.registration.v1beta1.LegacySeedConfig"; + value: Uint8Array; +} +export interface LegacySeedConfigAmino { + master_cert?: string; + encrypted_key?: string; +} +export interface LegacySeedConfigAminoMsg { + type: "/secret.registration.v1beta1.LegacySeedConfig"; + value: LegacySeedConfigAmino; +} +export interface LegacySeedConfigSDKType { + master_cert: string; + encrypted_key: string; +} +export interface RegistrationNodeInfo { + certificate: Uint8Array; + encryptedSeed: Uint8Array; +} +export interface RegistrationNodeInfoProtoMsg { + typeUrl: "/secret.registration.v1beta1.RegistrationNodeInfo"; + value: Uint8Array; +} +export interface RegistrationNodeInfoAmino { + certificate?: string; + encrypted_seed?: string; +} +export interface RegistrationNodeInfoAminoMsg { + type: "/secret.registration.v1beta1.RegistrationNodeInfo"; + value: RegistrationNodeInfoAmino; +} +export interface RegistrationNodeInfoSDKType { + certificate: Uint8Array; + encrypted_seed: Uint8Array; +} +function createBaseSeedConfig(): SeedConfig { + return { + masterKey: "", + encryptedKey: "", + version: 0 + }; +} +export const SeedConfig = { + typeUrl: "/secret.registration.v1beta1.SeedConfig", + encode(message: SeedConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.masterKey !== "") { + writer.uint32(10).string(message.masterKey); + } + if (message.encryptedKey !== "") { + writer.uint32(18).string(message.encryptedKey); + } + if (message.version !== 0) { + writer.uint32(24).uint32(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): SeedConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSeedConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.masterKey = reader.string(); + break; + case 2: + message.encryptedKey = reader.string(); + break; + case 3: + message.version = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SeedConfig { + const message = createBaseSeedConfig(); + message.masterKey = object.masterKey ?? ""; + message.encryptedKey = object.encryptedKey ?? ""; + message.version = object.version ?? 0; + return message; + }, + fromAmino(object: SeedConfigAmino): SeedConfig { + const message = createBaseSeedConfig(); + if (object.master_key !== undefined && object.master_key !== null) { + message.masterKey = object.master_key; + } + if (object.encrypted_key !== undefined && object.encrypted_key !== null) { + message.encryptedKey = object.encrypted_key; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; + }, + toAmino(message: SeedConfig, useInterfaces: boolean = false): SeedConfigAmino { + const obj: any = {}; + obj.master_key = message.masterKey; + obj.encrypted_key = message.encryptedKey; + obj.version = message.version; + return obj; + }, + fromAminoMsg(object: SeedConfigAminoMsg): SeedConfig { + return SeedConfig.fromAmino(object.value); + }, + fromProtoMsg(message: SeedConfigProtoMsg, useInterfaces: boolean = false): SeedConfig { + return SeedConfig.decode(message.value, undefined, useInterfaces); + }, + toProto(message: SeedConfig): Uint8Array { + return SeedConfig.encode(message).finish(); + }, + toProtoMsg(message: SeedConfig): SeedConfigProtoMsg { + return { + typeUrl: "/secret.registration.v1beta1.SeedConfig", + value: SeedConfig.encode(message).finish() + }; + } +}; +function createBaseLegacySeedConfig(): LegacySeedConfig { + return { + masterCert: "", + encryptedKey: "" + }; +} +export const LegacySeedConfig = { + typeUrl: "/secret.registration.v1beta1.LegacySeedConfig", + encode(message: LegacySeedConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.masterCert !== "") { + writer.uint32(10).string(message.masterCert); + } + if (message.encryptedKey !== "") { + writer.uint32(18).string(message.encryptedKey); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): LegacySeedConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLegacySeedConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.masterCert = reader.string(); + break; + case 2: + message.encryptedKey = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LegacySeedConfig { + const message = createBaseLegacySeedConfig(); + message.masterCert = object.masterCert ?? ""; + message.encryptedKey = object.encryptedKey ?? ""; + return message; + }, + fromAmino(object: LegacySeedConfigAmino): LegacySeedConfig { + const message = createBaseLegacySeedConfig(); + if (object.master_cert !== undefined && object.master_cert !== null) { + message.masterCert = object.master_cert; + } + if (object.encrypted_key !== undefined && object.encrypted_key !== null) { + message.encryptedKey = object.encrypted_key; + } + return message; + }, + toAmino(message: LegacySeedConfig, useInterfaces: boolean = false): LegacySeedConfigAmino { + const obj: any = {}; + obj.master_cert = message.masterCert; + obj.encrypted_key = message.encryptedKey; + return obj; + }, + fromAminoMsg(object: LegacySeedConfigAminoMsg): LegacySeedConfig { + return LegacySeedConfig.fromAmino(object.value); + }, + fromProtoMsg(message: LegacySeedConfigProtoMsg, useInterfaces: boolean = false): LegacySeedConfig { + return LegacySeedConfig.decode(message.value, undefined, useInterfaces); + }, + toProto(message: LegacySeedConfig): Uint8Array { + return LegacySeedConfig.encode(message).finish(); + }, + toProtoMsg(message: LegacySeedConfig): LegacySeedConfigProtoMsg { + return { + typeUrl: "/secret.registration.v1beta1.LegacySeedConfig", + value: LegacySeedConfig.encode(message).finish() + }; + } +}; +function createBaseRegistrationNodeInfo(): RegistrationNodeInfo { + return { + certificate: new Uint8Array(), + encryptedSeed: new Uint8Array() + }; +} +export const RegistrationNodeInfo = { + typeUrl: "/secret.registration.v1beta1.RegistrationNodeInfo", + encode(message: RegistrationNodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.certificate.length !== 0) { + writer.uint32(10).bytes(message.certificate); + } + if (message.encryptedSeed.length !== 0) { + writer.uint32(18).bytes(message.encryptedSeed); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): RegistrationNodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRegistrationNodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.certificate = reader.bytes(); + break; + case 2: + message.encryptedSeed = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RegistrationNodeInfo { + const message = createBaseRegistrationNodeInfo(); + message.certificate = object.certificate ?? new Uint8Array(); + message.encryptedSeed = object.encryptedSeed ?? new Uint8Array(); + return message; + }, + fromAmino(object: RegistrationNodeInfoAmino): RegistrationNodeInfo { + const message = createBaseRegistrationNodeInfo(); + if (object.certificate !== undefined && object.certificate !== null) { + message.certificate = bytesFromBase64(object.certificate); + } + if (object.encrypted_seed !== undefined && object.encrypted_seed !== null) { + message.encryptedSeed = bytesFromBase64(object.encrypted_seed); + } + return message; + }, + toAmino(message: RegistrationNodeInfo, useInterfaces: boolean = false): RegistrationNodeInfoAmino { + const obj: any = {}; + obj.certificate = message.certificate ? base64FromBytes(message.certificate) : undefined; + obj.encrypted_seed = message.encryptedSeed ? base64FromBytes(message.encryptedSeed) : undefined; + return obj; + }, + fromAminoMsg(object: RegistrationNodeInfoAminoMsg): RegistrationNodeInfo { + return RegistrationNodeInfo.fromAmino(object.value); + }, + fromProtoMsg(message: RegistrationNodeInfoProtoMsg, useInterfaces: boolean = false): RegistrationNodeInfo { + return RegistrationNodeInfo.decode(message.value, undefined, useInterfaces); + }, + toProto(message: RegistrationNodeInfo): Uint8Array { + return RegistrationNodeInfo.encode(message).finish(); + }, + toProtoMsg(message: RegistrationNodeInfo): RegistrationNodeInfoProtoMsg { + return { + typeUrl: "/secret.registration.v1beta1.RegistrationNodeInfo", + value: RegistrationNodeInfo.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/rpc.query.ts b/packages/types/protobuf/codegen/secret/rpc.query.ts new file mode 100644 index 000000000..56514336a --- /dev/null +++ b/packages/types/protobuf/codegen/secret/rpc.query.ts @@ -0,0 +1,70 @@ +import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import { QueryClient } from "@cosmjs/stargate"; +export const createRPCQueryClient = async ({ + rpcEndpoint +}: { + rpcEndpoint: string | HttpEndpoint; +}) => { + const tmClient = await Tendermint34Client.connect(rpcEndpoint); + const client = new QueryClient(tmClient); + return { + cosmos: { + auth: { + v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + authz: { + v1beta1: (await import("../cosmos/authz/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + bank: { + v1beta1: (await import("../cosmos/bank/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + base: { + tendermint: { + v1beta1: (await import("../cosmos/base/tendermint/v1beta1/query.rpc.Service")).createRpcQueryExtension(client) + } + }, + distribution: { + v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + gov: { + v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), + v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + mint: { + v1beta1: (await import("../cosmos/mint/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + params: { + v1beta1: (await import("../cosmos/params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + slashing: { + v1beta1: (await import("../cosmos/slashing/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + staking: { + v1beta1: (await import("../cosmos/staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + tx: { + v1beta1: (await import("../cosmos/tx/v1beta1/service.rpc.Service")).createRpcQueryExtension(client) + }, + upgrade: { + v1beta1: (await import("../cosmos/upgrade/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, + secret: { + compute: { + v1beta1: (await import("./compute/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + emergencybutton: { + v1beta1: (await import("./emergencybutton/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + intertx: { + v1beta1: (await import("./intertx/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + registration: { + v1beta1: (await import("./registration/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + } + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/rpc.tx.ts b/packages/types/protobuf/codegen/secret/rpc.tx.ts new file mode 100644 index 000000000..c461dc4f1 --- /dev/null +++ b/packages/types/protobuf/codegen/secret/rpc.tx.ts @@ -0,0 +1,51 @@ +import { Rpc } from "../helpers"; +export const createRPCMsgClient = async ({ + rpc +}: { + rpc: Rpc; +}) => ({ + cosmos: { + auth: { + v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + authz: { + v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + bank: { + v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + distribution: { + v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + gov: { + v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), + v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + mint: { + v1beta1: new (await import("../cosmos/mint/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + slashing: { + v1beta1: new (await import("../cosmos/slashing/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + staking: { + v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + upgrade: { + v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + } + }, + secret: { + compute: { + v1beta1: new (await import("./compute/v1beta1/msg.rpc.msg")).MsgClientImpl(rpc) + }, + emergencybutton: { + v1beta1: new (await import("./emergencybutton/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + intertx: { + v1beta1: new (await import("./intertx/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + } + } +}); \ No newline at end of file diff --git a/packages/types/protobuf/codegen/tendermint/bundle.ts b/packages/types/protobuf/codegen/tendermint/bundle.ts index f4eac2ef8..d9bf879a8 100644 --- a/packages/types/protobuf/codegen/tendermint/bundle.ts +++ b/packages/types/protobuf/codegen/tendermint/bundle.ts @@ -1,32 +1,32 @@ -import * as _345 from "./abci/types"; -import * as _346 from "./crypto/keys"; -import * as _347 from "./crypto/proof"; -import * as _348 from "./p2p/types"; -import * as _349 from "./types/block"; -import * as _350 from "./types/evidence"; -import * as _351 from "./types/params"; -import * as _352 from "./types/types"; -import * as _353 from "./types/validator"; -import * as _354 from "./version/types"; +import * as _359 from "./abci/types"; +import * as _360 from "./crypto/keys"; +import * as _361 from "./crypto/proof"; +import * as _362 from "./p2p/types"; +import * as _363 from "./types/block"; +import * as _364 from "./types/evidence"; +import * as _365 from "./types/params"; +import * as _366 from "./types/types"; +import * as _367 from "./types/validator"; +import * as _368 from "./version/types"; export namespace tendermint { export const abci = { - ..._345 + ..._359 }; export const crypto = { - ..._346, - ..._347 + ..._360, + ..._361 }; export const p2p = { - ..._348 + ..._362 }; export const types = { - ..._349, - ..._350, - ..._351, - ..._352, - ..._353 + ..._363, + ..._364, + ..._365, + ..._366, + ..._367 }; export const version = { - ..._354 + ..._368 }; } \ No newline at end of file diff --git a/packages/types/protobuf/patches.diff b/packages/types/protobuf/patches.diff index f364bd518..753e28133 100644 --- a/packages/types/protobuf/patches.diff +++ b/packages/types/protobuf/patches.diff @@ -259,3 +259,83 @@ index fe58afb74..f0e94453b 100644 import { Timestamp } from "../../../google/protobuf/timestamp"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { toTimestamp, fromTimestamp } from "../../../helpers"; +diff --git b/packages/types/protobuf/codegen/secret/compute/v1beta1/query.rpc.Query.ts a/packages/types/protobuf/codegen/secret/compute/v1beta1/query.rpc.Query.ts +index a1a896a5e..264b5385f 100644 +--- b/packages/types/protobuf/codegen/secret/compute/v1beta1/query.rpc.Query.ts ++++ a/packages/types/protobuf/codegen/secret/compute/v1beta1/query.rpc.Query.ts +@@ -14,7 +14,7 @@ export interface Query { + /** Query a specific contract code by id */ + code(request: QueryByCodeIdRequest): Promise; + /** Query all contract codes on-chain */ +- codes(request?: google.protobuf.Empty): Promise; ++ codes(request?: Empty): Promise; + /** Query code hash by contract address */ + codeHashByContractAddress(request: QueryByContractAddressRequest): Promise; + /** Query code hash by code id */ +@@ -61,8 +61,8 @@ export class QueryClientImpl implements Query { + const promise = this.rpc.request("secret.compute.v1beta1.Query", "Code", data); + return promise.then(data => QueryCodeResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +- codes(request: google.protobuf.Empty = {}, useInterfaces: boolean = true): Promise { +- const data = google.protobuf.Empty.encode(request).finish(); ++ codes(request: Empty = {}, useInterfaces: boolean = true): Promise { ++ const data = Empty.encode(request).finish(); + const promise = this.rpc.request("secret.compute.v1beta1.Query", "Codes", data); + return promise.then(data => QueryCodesResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +@@ -108,7 +108,7 @@ export const createRpcQueryExtension = (base: QueryClient) => { + code(request: QueryByCodeIdRequest, useInterfaces: boolean = true): Promise { + return queryService.code(request, useInterfaces); + }, +- codes(request?: google.protobuf.Empty, useInterfaces: boolean = true): Promise { ++ codes(request?: Empty, useInterfaces: boolean = true): Promise { + return queryService.codes(request, useInterfaces); + }, + codeHashByContractAddress(request: QueryByContractAddressRequest, useInterfaces: boolean = true): Promise { +diff --git b/packages/types/protobuf/codegen/secret/registration/v1beta1/query.rpc.Query.ts a/packages/types/protobuf/codegen/secret/registration/v1beta1/query.rpc.Query.ts +index cefd5a01c..9617817a2 100644 +--- b/packages/types/protobuf/codegen/secret/registration/v1beta1/query.rpc.Query.ts ++++ a/packages/types/protobuf/codegen/secret/registration/v1beta1/query.rpc.Query.ts +@@ -7,9 +7,9 @@ import { QueryEncryptedSeedRequest, QueryEncryptedSeedResponse } from "./query"; + /** Query provides defines the gRPC querier service */ + export interface Query { + /** Returns the key used for transactions */ +- txKey(request?: google.protobuf.Empty): Promise; ++ txKey(request?: Empty): Promise; + /** Returns the key used for registration */ +- registrationKey(request?: google.protobuf.Empty): Promise; ++ registrationKey(request?: Empty): Promise; + /** Returns the encrypted seed for a registered node by public key */ + encryptedSeed(request: QueryEncryptedSeedRequest): Promise; + } +@@ -21,13 +21,13 @@ export class QueryClientImpl implements Query { + this.registrationKey = this.registrationKey.bind(this); + this.encryptedSeed = this.encryptedSeed.bind(this); + } +- txKey(request: google.protobuf.Empty = {}, useInterfaces: boolean = true): Promise { +- const data = google.protobuf.Empty.encode(request).finish(); ++ txKey(request: Empty = {}, useInterfaces: boolean = true): Promise { ++ const data = Empty.encode(request).finish(); + const promise = this.rpc.request("secret.registration.v1beta1.Query", "TxKey", data); + return promise.then(data => Key.decode(new BinaryReader(data), undefined, useInterfaces)); + } +- registrationKey(request: google.protobuf.Empty = {}, useInterfaces: boolean = true): Promise { +- const data = google.protobuf.Empty.encode(request).finish(); ++ registrationKey(request: Empty = {}, useInterfaces: boolean = true): Promise { ++ const data = Empty.encode(request).finish(); + const promise = this.rpc.request("secret.registration.v1beta1.Query", "RegistrationKey", data); + return promise.then(data => Key.decode(new BinaryReader(data), undefined, useInterfaces)); + } +@@ -41,10 +41,10 @@ export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { +- txKey(request?: google.protobuf.Empty, useInterfaces: boolean = true): Promise { ++ txKey(request?: Empty, useInterfaces: boolean = true): Promise { + return queryService.txKey(request, useInterfaces); + }, +- registrationKey(request?: google.protobuf.Empty, useInterfaces: boolean = true): Promise { ++ registrationKey(request?: Empty, useInterfaces: boolean = true): Promise { + return queryService.registrationKey(request, useInterfaces); + }, + encryptedSeed(request: QueryEncryptedSeedRequest, useInterfaces: boolean = true): Promise { diff --git a/packages/types/protobuf/proto/secret/compute/v1beta1/genesis.proto b/packages/types/protobuf/proto/secret/compute/v1beta1/genesis.proto new file mode 100644 index 000000000..1b7d2dbb6 --- /dev/null +++ b/packages/types/protobuf/proto/secret/compute/v1beta1/genesis.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; +package secret.compute.v1beta1; + +import "gogoproto/gogo.proto"; +import "secret/compute/v1beta1/types.proto"; + +option go_package = "github.com/scrtlabs/SecretNetwork/x/compute/internal/types"; + +// GenesisState - genesis state of x/wasm +message GenesisState { +// Params params = 1 [(gogoproto.nullable) = false]; + repeated Code codes = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "codes,omitempty"]; + repeated Contract contracts = 3 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "contracts,omitempty"]; + repeated Sequence sequences = 4 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "sequences,omitempty"]; +} + +// Code struct encompasses CodeInfo and CodeBytes +message Code { + uint64 code_id = 1 [(gogoproto.customname) = "CodeID"]; + CodeInfo code_info = 2 [(gogoproto.nullable) = false]; + bytes code_bytes = 3; +} + +// Contract struct encompasses ContractAddress, ContractInfo, and ContractState +message Contract { + bytes contract_address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + ContractInfo contract_info = 2 [(gogoproto.nullable) = false]; + repeated Model contract_state = 3 [(gogoproto.nullable) = false]; + ContractCustomInfo contract_custom_info = 4; +} + +// Sequence id and value of a counter +message Sequence { + bytes id_key = 1 [(gogoproto.customname) = "IDKey"]; + uint64 value = 2; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/secret/compute/v1beta1/msg.proto b/packages/types/protobuf/proto/secret/compute/v1beta1/msg.proto new file mode 100644 index 000000000..d128e6239 --- /dev/null +++ b/packages/types/protobuf/proto/secret/compute/v1beta1/msg.proto @@ -0,0 +1,139 @@ +syntax = "proto3"; +package secret.compute.v1beta1; + +option go_package = "github.com/scrtlabs/SecretNetwork/x/compute/internal/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +// Msg defines the wasm Msg service. +service Msg { + // StoreCode to submit Wasm code to the system + rpc StoreCode(MsgStoreCode) returns (MsgStoreCodeResponse); + // Instantiate creates a new smart contract instance for the given code id. + rpc InstantiateContract(MsgInstantiateContract) returns (MsgInstantiateContractResponse); + // Execute submits the given message data to a smart contract + rpc ExecuteContract(MsgExecuteContract) returns (MsgExecuteContractResponse); + // Migrate runs a code upgrade/ downgrade for a smart contract + rpc MigrateContract(MsgMigrateContract) returns (MsgMigrateContractResponse); + // UpdateAdmin sets a new admin for a smart contract + rpc UpdateAdmin(MsgUpdateAdmin) returns (MsgUpdateAdminResponse); + // ClearAdmin removes any admin stored for a smart contract + rpc ClearAdmin(MsgClearAdmin) returns (MsgClearAdminResponse); +} + +message MsgStoreCode { + option (gogoproto.goproto_getters) = false; + // sender is the canonical address of the sender + bytes sender = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + // WASMByteCode can be raw or gzip compressed + bytes wasm_byte_code = 2 [(gogoproto.customname) = "WASMByteCode"]; + // Source is a valid absolute HTTPS URI to the contract's source code, optional + string source = 3; + // Builder is a valid docker image name with tag, optional + string builder = 4; +} + +// MsgStoreCodeResponse returns store result data. +message MsgStoreCodeResponse { + // CodeID is the reference to the stored WASM code + uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; +} + +message MsgInstantiateContract { + option (gogoproto.goproto_getters) = false; + + // sender is the canonical address of the sender + bytes sender = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + string callback_code_hash = 2; + uint64 code_id = 3 [(gogoproto.customname) = "CodeID"]; + string label = 4; + // init_msg is an encrypted input to pass to the contract on init + bytes init_msg = 5; + repeated cosmos.base.v1beta1.Coin init_funds = 6 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + // used internally for encryption, should always be empty in a signed transaction + bytes callback_sig = 7 [(gogoproto.customname) = "CallbackSig"]; + // Admin is an optional address that can execute migrations + string admin = 8; +} + +// MsgInstantiateContractResponse return instantiation result data +message MsgInstantiateContractResponse { + // Address is the bech32 address of the new contract instance. + string address = 1; + // Data contains base64-encoded bytes to returned from the contract + bytes data = 2; +} + +message MsgExecuteContract { + option (gogoproto.goproto_getters) = false; + + // sender is the canonical address of the sender + bytes sender = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + // contract is the canonical address of the contract + bytes contract = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + // msg is an encrypted input to pass to the contract on execute + bytes msg = 3; + // used internally for encryption, should always be empty in a signed transaction + string callback_code_hash = 4; + repeated cosmos.base.v1beta1.Coin sent_funds = 5 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + // used internally for encryption, should always be empty in a signed transaction + bytes callback_sig = 6 [(gogoproto.customname) = "CallbackSig"]; +} + +// MsgExecuteContractResponse returns execution result data. +message MsgExecuteContractResponse { + // Data contains base64-encoded bytes to returned from the contract + bytes data = 1; +} + +// MsgMigrateContract runs a code upgrade/ downgrade for a smart contract +message MsgMigrateContract { + // Sender is the that actor that signed the messages + string sender = 1; + // Contract is the address of the smart contract + string contract = 2; + // CodeID references the new WASM code + uint64 code_id = 3 [ (gogoproto.customname) = "CodeID" ]; + // msg is an encrypted input to pass to the contract on migration + bytes msg = 4; + // used internally for encryption, should always be empty in a signed transaction + bytes callback_sig = 7 [(gogoproto.customname) = "CallbackSig"]; + // used internally for encryption, should always be empty in a signed transaction + string callback_code_hash = 8; +} + +// MsgMigrateContractResponse returns contract migration result data. +message MsgMigrateContractResponse { + // Data contains same raw bytes returned as data from the wasm contract. + // (May be empty) + bytes data = 1; +} + +// MsgUpdateAdmin sets a new admin for a smart contract +message MsgUpdateAdmin { + // Sender is the that actor that signed the messages + string sender = 1; + // NewAdmin address to be set + string new_admin = 2; + // Contract is the address of the smart contract + string contract = 3; + // used internally for encryption, should always be empty in a signed transaction + bytes callback_sig = 7 [(gogoproto.customname) = "CallbackSig"]; +} + +// MsgUpdateAdminResponse returns empty data +message MsgUpdateAdminResponse {} + +// MsgClearAdmin removes any admin stored for a smart contract +message MsgClearAdmin { + // Sender is the that actor that signed the messages + string sender = 1; + // Contract is the address of the smart contract + string contract = 3; + // used internally for encryption, should always be empty in a signed transaction + bytes callback_sig = 7 [(gogoproto.customname) = "CallbackSig"]; +} + +// MsgClearAdminResponse returns empty data +message MsgClearAdminResponse {} \ No newline at end of file diff --git a/packages/types/protobuf/proto/secret/compute/v1beta1/query.proto b/packages/types/protobuf/proto/secret/compute/v1beta1/query.proto new file mode 100644 index 000000000..a82240683 --- /dev/null +++ b/packages/types/protobuf/proto/secret/compute/v1beta1/query.proto @@ -0,0 +1,173 @@ +syntax = "proto3"; +package secret.compute.v1beta1; + +import "gogoproto/gogo.proto"; +import "secret/compute/v1beta1/types.proto"; +import "google/protobuf/empty.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/abci/v1beta1/abci.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; + +option go_package = "github.com/scrtlabs/SecretNetwork/x/compute/internal/types"; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.equal_all) = true; + +// Query defines the gRPC querier service +service Query { + // Query contract info by address + rpc ContractInfo(QueryByContractAddressRequest) + returns (QueryContractInfoResponse) { + option (google.api.http).get = + "/compute/v1beta1/info/{contract_address}"; + } + // Query code info by id + rpc ContractsByCodeId(QueryByCodeIdRequest) + returns (QueryContractsByCodeIdResponse) { + option (google.api.http).get = "/compute/v1beta1/contracts/{code_id}"; + } + // Query secret contract + rpc QuerySecretContract(QuerySecretContractRequest) + returns (QuerySecretContractResponse) { + option (google.api.http).get = + "/compute/v1beta1/query/{contract_address}"; + } + // Query a specific contract code by id + rpc Code(QueryByCodeIdRequest) returns (QueryCodeResponse) { + option (google.api.http).get = "/compute/v1beta1/code/{code_id}"; + } + // Query all contract codes on-chain + rpc Codes(google.protobuf.Empty) returns (QueryCodesResponse) { + option (google.api.http).get = "/compute/v1beta1/codes"; + } + // Query code hash by contract address + rpc CodeHashByContractAddress(QueryByContractAddressRequest) + returns (QueryCodeHashResponse) { + option (google.api.http).get = + "/compute/v1beta1/code_hash/by_contract_address/{contract_address}"; + } + // Query code hash by code id + rpc CodeHashByCodeId(QueryByCodeIdRequest) returns (QueryCodeHashResponse) { + option (google.api.http).get = "/compute/v1beta1/code_hash/by_code_id/{code_id}"; + } + // Query contract label by address + rpc LabelByAddress(QueryByContractAddressRequest) + returns (QueryContractLabelResponse) { + option (google.api.http).get = + "/compute/v1beta1/label/{contract_address}"; + } + // Query contract address by label + rpc AddressByLabel(QueryByLabelRequest) + returns (QueryContractAddressResponse) { + option (google.api.http).get = + "/compute/v1beta1/contract_address/{label}"; + } + // ContractHistory gets the contract code history + rpc ContractHistory(QueryContractHistoryRequest) + returns (QueryContractHistoryResponse) { + option (google.api.http).get = + "/compute/v1beta1/contract_history/{contract_address}"; + } +} + +message QuerySecretContractRequest { + // address is the bech32 human readable address of the contract + string contract_address = 1; + bytes query = 2; +} + +message QueryByLabelRequest { string label = 1; } + +message QueryByContractAddressRequest { + // address is the bech32 human readable address of the contract + string contract_address = 1; +} + +message QueryByCodeIdRequest { uint64 code_id = 1; } + +message QuerySecretContractResponse { bytes data = 1; } + +// QueryContractInfoResponse is the response type for the Query/ContractInfo RPC method +message QueryContractInfoResponse { + // contract_address is the bech32 human readable address of the contract + string contract_address = 1; + ContractInfo contract_info = 2 + [ (gogoproto.embed) = true, (gogoproto.jsontag) = "" ]; +} + +// ContractInfoWithAddress adds the contract address to the ContractInfo representation +message ContractInfoWithAddress { + // contract_address is the bech32 human readable address of the contract + string contract_address = 1; + ContractInfo contract_info = 2 + [ (gogoproto.embed) = true, (gogoproto.jsontag) = "" ]; +} + +message QueryContractsByCodeIdResponse { + repeated ContractInfoWithAddress contract_infos = 1 + [ (gogoproto.nullable) = false ]; +} + +message CodeInfoResponse { + uint64 code_id = 1; + // creator is the bech32 human readable address of the contract + string creator = 2; + string code_hash = 3; + string source = 4; + string builder = 5; +} + +message QueryCodeResponse { + CodeInfoResponse code_info = 1 + [ (gogoproto.embed) = true, (gogoproto.jsontag) = "" ]; + bytes wasm = 2; +} + +message QueryCodesResponse { + repeated CodeInfoResponse code_infos = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryContractAddressResponse { + // address is the bech32 human readable address of the contract + string contract_address = 1; +} + +message QueryContractLabelResponse { string label = 1; } + +message QueryCodeHashResponse { string code_hash = 1; } + +// DecryptedAnswer is a struct that represents a decrypted tx-query +message DecryptedAnswer { + option (gogoproto.equal) = false; + + string type = 1; + string input = 2; + string output_data = 3; + string output_data_as_string = 4; +} + +message DecryptedAnswers { + option (gogoproto.equal) = false; + + repeated DecryptedAnswer answers = 1; + repeated cosmos.base.abci.v1beta1.StringEvent output_logs = 2 + [ (gogoproto.nullable) = false ]; + string output_error = 3; + string plaintext_error = 4; +} + +// QueryContractHistoryRequest is the request type for the Query/ContractHistory +// RPC method +message QueryContractHistoryRequest { + option (gogoproto.equal) = false; + // address is the address of the contract to query + string contract_address = 1; +} + +// QueryContractHistoryResponse is the response type for the +// Query/ContractHistory RPC method +message QueryContractHistoryResponse { + option (gogoproto.equal) = false; + + repeated ContractCodeHistoryEntry entries = 1 + [ (gogoproto.nullable) = false ]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/secret/compute/v1beta1/types.proto b/packages/types/protobuf/proto/secret/compute/v1beta1/types.proto new file mode 100644 index 000000000..97aa8d7df --- /dev/null +++ b/packages/types/protobuf/proto/secret/compute/v1beta1/types.proto @@ -0,0 +1,105 @@ +syntax = "proto3"; +package secret.compute.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/scrtlabs/SecretNetwork/x/compute/internal/types"; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.equal_all) = true; + +enum AccessType { + option (gogoproto.goproto_enum_prefix) = false; + option (gogoproto.goproto_enum_stringer) = false; + UNDEFINED = 0 [(gogoproto.enumvalue_customname) = "AccessTypeUndefined"]; + NOBODY = 1 [(gogoproto.enumvalue_customname) = "AccessTypeNobody"]; + ONLY_ADDRESS = 2 [(gogoproto.enumvalue_customname) = "AccessTypeOnlyAddress"]; + EVERYBODY = 3 [(gogoproto.enumvalue_customname) = "AccessTypeEverybody"]; +} + +message AccessTypeParam { + option (gogoproto.goproto_stringer) = true; + AccessType value = 1 [(gogoproto.moretags) = "yaml:\"value\""]; +} + +// CodeInfo is data for the uploaded contract WASM code +message CodeInfo { + bytes code_hash = 1; + bytes creator = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + string source = 3; + string builder = 4; +} + +message ContractKey { + bytes og_contract_key = 1; + bytes current_contract_key = 2; + bytes current_contract_key_proof = 3; +} + +message ContractCustomInfo { + ContractKey enclave_key = 1 [(gogoproto.customname) = "EnclaveKey"]; + string label = 2; +} + +// ContractInfo stores a WASM contract instance +message ContractInfo { + // CodeID is the reference to the stored Wasm code + uint64 code_id = 1 [(gogoproto.customname) = "CodeID"]; + // Creator address who initially instantiated the contract + bytes creator = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + // Label is mandatory metadata to be stored with a contract instance. + string label = 4; + // Created Tx position when the contract was instantiated. + AbsoluteTxPosition created = 5; + string ibc_port_id = 6 [ (gogoproto.customname) = "IBCPortID" ]; + // Admin is an optional address that can execute migrations + string admin = 7; + // Proof that enclave executed the instantiate command + bytes admin_proof = 8; +} + +// AbsoluteTxPosition can be used to sort contracts +message AbsoluteTxPosition { + // BlockHeight is the block the contract was created at + int64 block_height = 1; + // TxIndex is a monotonic counter within the block (actual transaction index, or gas consumed) + uint64 tx_index = 2; +} + +// Model is a struct that holds a KV pair +message Model { + // hex-encode key to read it better (this is often ascii) + bytes Key = 1 [(gogoproto.casttype) = "github.com/tendermint/tendermint/libs/bytes.HexBytes"]; + // base64-encode raw value + bytes Value = 2; +} + +// ContractCodeHistoryOperationType actions that caused a code change +enum ContractCodeHistoryOperationType { + option (gogoproto.goproto_enum_prefix) = false; + // ContractCodeHistoryOperationTypeUnspecified placeholder for empty value + CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED = 0 + [ (gogoproto.enumvalue_customname) = + "ContractCodeHistoryOperationTypeUnspecified" ]; + // ContractCodeHistoryOperationTypeInit on chain contract instantiation + CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT = 1 + [ (gogoproto.enumvalue_customname) = + "ContractCodeHistoryOperationTypeInit" ]; + // ContractCodeHistoryOperationTypeMigrate code migration + CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE = 2 + [ (gogoproto.enumvalue_customname) = + "ContractCodeHistoryOperationTypeMigrate" ]; + // ContractCodeHistoryOperationTypeGenesis based on genesis data + CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS = 3 + [ (gogoproto.enumvalue_customname) = + "ContractCodeHistoryOperationTypeGenesis" ]; +} + +// ContractCodeHistoryEntry metadata to a contract. +message ContractCodeHistoryEntry { + ContractCodeHistoryOperationType operation = 1; + // CodeID is the reference to the stored WASM code + uint64 code_id = 2 [ (gogoproto.customname) = "CodeID" ]; + // Updated Tx position when the operation was executed. + AbsoluteTxPosition updated = 3; + bytes msg = 4; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/secret/emergencybutton/v1beta1/genesis.proto b/packages/types/protobuf/proto/secret/emergencybutton/v1beta1/genesis.proto new file mode 100644 index 000000000..7115c4a79 --- /dev/null +++ b/packages/types/protobuf/proto/secret/emergencybutton/v1beta1/genesis.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package secret.emergencybutton.v1beta1; + +import "gogoproto/gogo.proto"; +import "secret/emergencybutton/v1beta1/params.proto"; + +option go_package = "github.com/scrtlabs/SecretNetwork/x/emergencybutton/types"; + +// GenesisState - genesis state of x/wasm +message GenesisState { + Params params = 1 [(gogoproto.nullable) = false]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/secret/emergencybutton/v1beta1/params.proto b/packages/types/protobuf/proto/secret/emergencybutton/v1beta1/params.proto new file mode 100644 index 000000000..ad267d3b2 --- /dev/null +++ b/packages/types/protobuf/proto/secret/emergencybutton/v1beta1/params.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package secret.emergencybutton.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/scrtlabs/SecretNetwork/x/emergencybutton/types"; + +// Params defines the parameters for the ibc-rate-limit module. +message Params { + string switch_status = 1 [(gogoproto.jsontag) = "switch_status,omitempty"]; + string pauser_address = 2 [(gogoproto.jsontag) = "pauser_address,omitempty"]; +} diff --git a/packages/types/protobuf/proto/secret/emergencybutton/v1beta1/query.proto b/packages/types/protobuf/proto/secret/emergencybutton/v1beta1/query.proto new file mode 100644 index 000000000..369c11f7a --- /dev/null +++ b/packages/types/protobuf/proto/secret/emergencybutton/v1beta1/query.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; +package secret.emergencybutton.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +// todo verify that pagination isn't needed +// import "cosmos/base/query/v1beta1/pagination.proto"; +import "secret/emergencybutton/v1beta1/params.proto"; + +option go_package = "github.com/scrtlabs/SecretNetwork/x/emergencybutton/types"; + +// Query defines the gRPC querier service. +service Query { + // Params defines a gRPC query method that returns the emergencybutton module's + // parameters. + rpc Params(ParamsRequest) returns (ParamsResponse) { + option (google.api.http).get = "/emergencybutton/v1beta1/params"; + } +} + +// ParamsRequest is the request type for the Query/Params RPC method. +message ParamsRequest {} + +// ParamsResponse is the response type for the Query/Params RPC method. +message ParamsResponse { + // params defines the parameters of the module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/packages/types/protobuf/proto/secret/emergencybutton/v1beta1/tx.proto b/packages/types/protobuf/proto/secret/emergencybutton/v1beta1/tx.proto new file mode 100644 index 000000000..ace755102 --- /dev/null +++ b/packages/types/protobuf/proto/secret/emergencybutton/v1beta1/tx.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package secret.emergencybutton.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/scrtlabs/SecretNetwork/x/emergencybutton/types"; + +// Msg defines the bank Msg service. +service Msg { + // ToggleIbcSwitch defines a method for toggling the status of the emergencybutton. + rpc ToggleIbcSwitch(MsgToggleIbcSwitch) returns (MsgToggleIbcSwitchResponse); +} + +// MsgToggleIbcSwitch represents a message to toggle the emergencybutton status by the defined pauser. +message MsgToggleIbcSwitch { + string sender = 1; +} + +// MsgToggleIbcSwitchResponse defines the response type for the toggle. +message MsgToggleIbcSwitchResponse {} \ No newline at end of file diff --git a/packages/types/protobuf/proto/secret/intertx/v1beta1/query.proto b/packages/types/protobuf/proto/secret/intertx/v1beta1/query.proto new file mode 100644 index 000000000..8719eff4c --- /dev/null +++ b/packages/types/protobuf/proto/secret/intertx/v1beta1/query.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package secret.intertx.v1beta1; + + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; + +option go_package = "github.com/scrtlabs/SecretNetwork/x/mauth/types"; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.equal_all) = true; + +// Query defines the gRPC querier service. +service Query { + // QueryInterchainAccountFromAddress returns the interchain account for given owner address on a given connection pair + rpc InterchainAccountFromAddress(QueryInterchainAccountFromAddressRequest) returns (QueryInterchainAccountFromAddressResponse) { + option (google.api.http).get = "/mauth/interchain_account/owner/{owner}/connection/{connection_id}"; + }; +} + +// QueryInterchainAccountFromAddressRequest is the request type for the Query/InterchainAccountAddress RPC +message QueryInterchainAccountFromAddressRequest { + string owner = 1; + string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; +} + +// QueryInterchainAccountFromAddressResponse the response type for the Query/InterchainAccountAddress RPC +message QueryInterchainAccountFromAddressResponse { + string interchain_account_address = 1 [(gogoproto.moretags) = "yaml:\"interchain_account_address\""]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/secret/intertx/v1beta1/tx.proto b/packages/types/protobuf/proto/secret/intertx/v1beta1/tx.proto new file mode 100644 index 000000000..b1ae919ac --- /dev/null +++ b/packages/types/protobuf/proto/secret/intertx/v1beta1/tx.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; + +package secret.intertx.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/scrtlabs/SecretNetwork/x/mauth/types"; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.equal_all) = true; + +// Msg defines the ica-authentication Msg service. +service Msg { + // Register defines a rpc handler for MsgRegisterAccount + rpc RegisterAccount(MsgRegisterAccount) returns (MsgRegisterAccountResponse) { + option (google.api.http).post = "/mauth/v1beta1/register-account"; + }; + rpc SubmitTx(MsgSubmitTx) returns (MsgSubmitTxResponse) { + option (google.api.http).post = "/mauth/v1beta1/submit-tx"; + }; +} + +// MsgRegisterAccount registers an interchain account for the given owner over the specified connection pair +message MsgRegisterAccount { + + string owner = 1; + string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + string version = 3; +} + +// MsgRegisterAccountResponse is the response type for Msg/RegisterAccount +message MsgRegisterAccountResponse {} + +// MsgSubmitTx creates and submits an arbitrary transaction msg to be executed using an interchain account +message MsgSubmitTx { + + bytes owner = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + google.protobuf.Any msg = 3; +} + +// MsgSubmitTxResponse defines the MsgSubmitTx response type +message MsgSubmitTxResponse {} \ No newline at end of file diff --git a/packages/types/protobuf/proto/secret/registration/v1beta1/genesis.proto b/packages/types/protobuf/proto/secret/registration/v1beta1/genesis.proto new file mode 100644 index 000000000..58ba147fb --- /dev/null +++ b/packages/types/protobuf/proto/secret/registration/v1beta1/genesis.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package secret.registration.v1beta1; + +import "gogoproto/gogo.proto"; +import "secret/registration/v1beta1/types.proto"; +import "secret/registration/v1beta1/msg.proto"; + +option go_package = "github.com/scrtlabs/SecretNetwork/x/registration/internal/types"; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.equal_all) = true; + +message GenesisState { + repeated RegistrationNodeInfo registration = 1 [(gogoproto.jsontag) = "reg_info"]; + MasterKey node_exch_master_key = 2 [(gogoproto.jsontag) = "node_exch_key"]; + MasterKey io_master_key = 3 [(gogoproto.jsontag) = "io_exch_key"]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/secret/registration/v1beta1/msg.proto b/packages/types/protobuf/proto/secret/registration/v1beta1/msg.proto new file mode 100644 index 000000000..3dbd54c99 --- /dev/null +++ b/packages/types/protobuf/proto/secret/registration/v1beta1/msg.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; +package secret.registration.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/scrtlabs/SecretNetwork/x/registration/internal/types"; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.equal_all) = true; + +message RaAuthenticate { + bytes sender = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + bytes certificate = 2 [(gogoproto.casttype) = "github.com/scrtlabs/SecretNetwork/x/registration/remote_attestation.Certificate", (gogoproto.jsontag) = "ra_cert"]; +} + +message MasterKey { + bytes bytes = 1; +} + +message Key { + bytes key = 1 [(gogoproto.jsontag) = "key"]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/secret/registration/v1beta1/query.proto b/packages/types/protobuf/proto/secret/registration/v1beta1/query.proto new file mode 100644 index 000000000..02cad6ffb --- /dev/null +++ b/packages/types/protobuf/proto/secret/registration/v1beta1/query.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; +package secret.registration.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/empty.proto"; +import "google/api/annotations.proto"; +import "secret/registration/v1beta1/msg.proto"; +import "secret/registration/v1beta1/genesis.proto"; + +option go_package = "github.com/scrtlabs/SecretNetwork/x/registration/internal/types"; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.equal_all) = true; + +// Query provides defines the gRPC querier service +service Query { + // Returns the key used for transactions + rpc TxKey (google.protobuf.Empty) returns (Key) { + option (google.api.http).get = "/registration/v1beta1/tx-key"; + } + // Returns the key used for registration + rpc RegistrationKey (google.protobuf.Empty) returns (Key) { + option (google.api.http).get = "/registration/v1beta1/registration-key"; + } + + // Returns the encrypted seed for a registered node by public key + rpc EncryptedSeed (QueryEncryptedSeedRequest) returns (QueryEncryptedSeedResponse) { + option (google.api.http).get = "/registration/v1beta1/encrypted-seed/{pub_key}"; + } +} + +message QueryEncryptedSeedRequest { + bytes pub_key = 1; +} + +message QueryEncryptedSeedResponse { + bytes encrypted_seed = 1; // [(gogoproto.nullable) = false]; +} + + diff --git a/packages/types/protobuf/proto/secret/registration/v1beta1/remote_attestation/types.proto b/packages/types/protobuf/proto/secret/registration/v1beta1/remote_attestation/types.proto new file mode 100644 index 000000000..8a35196ff --- /dev/null +++ b/packages/types/protobuf/proto/secret/registration/v1beta1/remote_attestation/types.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; +package secret.registration.remote_attestation.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/scrtlabs/SecretNetwork/x/registration/remote_attestation"; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.equal_all) = true; + +message QuoteReport { + string id = 1 [(gogoproto.customname) = "ID"]; + string timestamp = 2; + uint64 version = 3; + string isv_enclave_quote_status = 4 [(gogoproto.jsontag) = "isvEnclaveQuoteStatus"]; + string platform_info_blob = 5 [(gogoproto.jsontag) = "platformInfoBlob"]; + string isv_enclave_quote_body = 6 [(gogoproto.jsontag) = "isvEnclaveQuoteBody"]; + repeated string advisory_ids = 7 [(gogoproto.customname) = "AdvisoryIDs", (gogoproto.jsontag) = "advisoryIDs"]; +} + +message QuoteReportBody { + string mr_enclave = 1; + string mr_signer = 2; + string report_data = 3; +} + +message QuoteReportData { + uint64 version = 1; + uint64 sign_type = 2; + QuoteReportBody report_body = 3; +} + +message EndorsedAttestationReport { + bytes report = 1; + bytes signature = 2; + bytes signing_cert = 3; +} + +message SGXEC256Signature { + string gx = 1; + string gy = 2; +} + +message PlatformInfoBlob { + uint32 sgx_epid_group_flags = 1; + uint32 sgx_tcb_evaluation_flags = 2; + uint32 pse_evaluation_flags = 3; + string latest_equivalent_tcb_psvn = 4; + string latest_pse_isvsvn = 5; + string latest_psda_svn = 6; + uint32 xeid = 7; + uint32 gid = 8; + SGXEC256Signature sgx_ec256_signature_t = 9; +} diff --git a/packages/types/protobuf/proto/secret/registration/v1beta1/types.proto b/packages/types/protobuf/proto/secret/registration/v1beta1/types.proto new file mode 100644 index 000000000..d1c9607da --- /dev/null +++ b/packages/types/protobuf/proto/secret/registration/v1beta1/types.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; +package secret.registration.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/scrtlabs/SecretNetwork/x/registration/internal/types"; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.equal_all) = true; + +message SeedConfig { + string master_key = 1 [(gogoproto.jsontag) = "pk2"]; + string encrypted_key = 2 [(gogoproto.jsontag) = "encKey"]; + uint32 version = 3 [(gogoproto.jsontag) = "version"]; +} + +message LegacySeedConfig { + string master_cert = 1 [(gogoproto.jsontag) = "pk"]; + string encrypted_key = 2 [(gogoproto.jsontag) = "encKey"]; +} + +message RegistrationNodeInfo { + bytes certificate = 1 [(gogoproto.casttype) = "github.com/scrtlabs/SecretNetwork/x/registration/remote_attestation.Certificate"]; + bytes encrypted_seed = 2; +} diff --git a/packages/types/protobuf/scripts/codegen.js b/packages/types/protobuf/scripts/codegen.js index 1d07203f8..247dde379 100644 --- a/packages/types/protobuf/scripts/codegen.js +++ b/packages/types/protobuf/scripts/codegen.js @@ -118,6 +118,10 @@ telescope({ 'pstake.ratesync.v1beta1', 'bitsong.fantoken', 'feemarket.feemarket.v1', + 'secret.compute.v1beta1', + 'secret.emergencybutton.v1beta1', + 'secret.intertx.v1beta1', + 'secret.registration.v1beta1', // interferes with v1beta1 MsgSubmitProposal amino encoders since the // type names overlap diff --git a/packages/types/protobuf/utils.ts b/packages/types/protobuf/utils.ts index 46655d232..de3d1920a 100644 --- a/packages/types/protobuf/utils.ts +++ b/packages/types/protobuf/utils.ts @@ -6,16 +6,17 @@ // to @dao-dao/utils when telescope internally handles a type registry that can // encode the nested types like we do below. +import { Chain } from '@chain-registry/types' import { AminoMsg } from '@cosmjs/amino' -import { fromBase64, toBase64 } from '@cosmjs/encoding' +import { fromBase64, fromBech32, toBase64, toBech32 } from '@cosmjs/encoding' import { EncodeObject, GeneratedType, Registry } from '@cosmjs/proto-signing' import { AminoTypes } from '@cosmjs/stargate' -import { DecodedStargateMsg } from '../chain' +import { ChainId, DecodedStargateMsg } from '../chain' import { - CosmosMsgFor_Empty, VoteOption as CwVoteOption, StargateMsg, + UnifiedCosmosMsg, } from '../contracts' import { allianceAminoConverters, @@ -45,6 +46,8 @@ import { pstakeProtoRegistry, regenAminoConverters, regenProtoRegistry, + secretAminoConverters, + secretProtoRegistry, publicawesomeAminoConverters as stargazeAminoConverters, publicawesomeProtoRegistry as stargazeProtoRegistry, } from './codegen' @@ -76,6 +79,13 @@ import { } from './codegen/cosmwasm/wasm/v1/tx' import { Any } from './codegen/google/protobuf/any' import { UploadCosmWasmPoolCodeAndWhiteListProposal } from './codegen/osmosis/cosmwasmpool/v1beta1/gov' +import { + MsgClearAdmin as SecretMsgClearAdmin, + MsgExecuteContract as SecretMsgExecuteContract, + MsgInstantiateContract as SecretMsgInstantiateContract, + MsgMigrateContract as SecretMsgMigrateContract, + MsgUpdateAdmin as SecretMsgUpdateAdmin, +} from './codegen/secret/compute/v1beta1/msg' // Convert CosmWasm message to its encoded protobuf equivalent. export const cwMsgToProtobuf = ( @@ -90,14 +100,16 @@ export const cwMsgToProtobuf = ( // Convert protobuf to its CosmWasm message equivalent. export const protobufToCwMsg = ( + chain: Chain, ...params: Parameters ): { - msg: CosmosMsgFor_Empty + msg: UnifiedCosmosMsg sender: string -} => decodedStargateMsgToCw(decodeRawProtobufMsg(...params)) +} => decodedStargateMsgToCw(chain, decodeRawProtobufMsg(...params)) export const cwMsgToEncodeObject = ( - msg: CosmosMsgFor_Empty, + chainId: string, + msg: UnifiedCosmosMsg, sender: string ): EncodeObject => { if ('bank' in msg) { @@ -198,38 +210,80 @@ export const cwMsgToEncodeObject = ( if ('wasm' in msg) { const wasmMsg = msg.wasm + const isSecret = + chainId === ChainId.SecretMainnet || chainId === ChainId.SecretTestnet - // MsgStoreCodeEncodeObject missing from CosmosMsgFor_Empty. + // MsgStoreCodeEncodeObject missing from UnifiedCosmosMsg. if ('execute' in wasmMsg) { + if (isSecret !== 'send' in wasmMsg.execute) { + throw new Error('Unsupported Secret wasm module message.') + } + const encodeObject: EncodeObject = { - typeUrl: MsgExecuteContract.typeUrl, - value: { - sender, - contract: wasmMsg.execute.contract_addr, - funds: wasmMsg.execute.funds, - msg: fromBase64(wasmMsg.execute.msg), - }, + typeUrl: + 'send' in wasmMsg.execute + ? SecretMsgExecuteContract.typeUrl + : MsgExecuteContract.typeUrl, + value: + 'send' in wasmMsg.execute + ? ({ + sender: fromBech32(sender).data, + contract: fromBech32(wasmMsg.execute.contract_addr).data, + msg: fromBase64(wasmMsg.execute.msg), + callbackCodeHash: wasmMsg.execute.code_hash, + sentFunds: wasmMsg.execute.send, + callbackSig: new Uint8Array(), + } as SecretMsgExecuteContract) + : ({ + sender, + contract: wasmMsg.execute.contract_addr, + funds: wasmMsg.execute.funds, + msg: fromBase64(wasmMsg.execute.msg), + } as MsgExecuteContract), } return encodeObject } if ('instantiate' in wasmMsg) { + if (isSecret !== 'send' in wasmMsg.instantiate) { + throw new Error('Unsupported Secret wasm module message.') + } + const encodeObject: EncodeObject = { - typeUrl: MsgInstantiateContract.typeUrl, - value: { - sender, - admin: wasmMsg.instantiate.admin ?? undefined, - codeId: BigInt(wasmMsg.instantiate.code_id), - label: wasmMsg.instantiate.label, - msg: fromBase64(wasmMsg.instantiate.msg), - funds: wasmMsg.instantiate.funds, - }, + typeUrl: + 'send' in wasmMsg.instantiate + ? SecretMsgInstantiateContract.typeUrl + : MsgInstantiateContract.typeUrl, + value: + 'send' in wasmMsg.instantiate + ? ({ + sender: fromBech32(sender).data, + callbackCodeHash: wasmMsg.instantiate.code_hash, + codeId: BigInt(wasmMsg.instantiate.code_id), + label: wasmMsg.instantiate.label, + initMsg: fromBase64(wasmMsg.instantiate.msg), + initFunds: wasmMsg.instantiate.send, + callbackSig: new Uint8Array(), + admin: wasmMsg.instantiate.admin ?? undefined, + } as SecretMsgInstantiateContract) + : ({ + sender, + admin: wasmMsg.instantiate.admin ?? undefined, + codeId: BigInt(wasmMsg.instantiate.code_id), + label: wasmMsg.instantiate.label, + msg: fromBase64(wasmMsg.instantiate.msg), + funds: wasmMsg.instantiate.funds, + } as MsgInstantiateContract), } return encodeObject } if ('instantiate2' in wasmMsg) { + if (isSecret) { + throw new Error('Unsupported Secret wasm module message.') + } + const encodeObject: EncodeObject = { typeUrl: MsgInstantiateContract2.typeUrl, value: { @@ -247,37 +301,69 @@ export const cwMsgToEncodeObject = ( } if ('migrate' in wasmMsg) { + if (isSecret !== 'code_hash' in wasmMsg.migrate) { + throw new Error('Unsupported Secret wasm module message.') + } + const encodeObject: EncodeObject = { - typeUrl: MsgMigrateContract.typeUrl, - value: { - sender, - contract: wasmMsg.migrate.contract_addr, - codeId: BigInt(wasmMsg.migrate.new_code_id), - msg: fromBase64(wasmMsg.migrate.msg), - }, + typeUrl: + 'code_hash' in wasmMsg.migrate + ? SecretMsgMigrateContract.typeUrl + : MsgMigrateContract.typeUrl, + value: + 'code_hash' in wasmMsg.migrate + ? ({ + sender, + contract: wasmMsg.migrate.contract_addr, + codeId: BigInt(wasmMsg.migrate.code_id), + msg: fromBase64(wasmMsg.migrate.msg), + callbackSig: new Uint8Array(), + callbackCodeHash: wasmMsg.migrate.code_hash, + } as SecretMsgMigrateContract) + : ({ + sender, + contract: wasmMsg.migrate.contract_addr, + codeId: BigInt(wasmMsg.migrate.new_code_id), + msg: fromBase64(wasmMsg.migrate.msg), + } as MsgMigrateContract), } return encodeObject } if ('update_admin' in wasmMsg) { const encodeObject: EncodeObject = { - typeUrl: MsgUpdateAdmin.typeUrl, - value: { - sender, - newAdmin: wasmMsg.update_admin.admin, - contract: wasmMsg.update_admin.contract_addr, - }, + typeUrl: isSecret + ? SecretMsgUpdateAdmin.typeUrl + : MsgUpdateAdmin.typeUrl, + value: isSecret + ? ({ + sender, + newAdmin: wasmMsg.update_admin.admin, + contract: wasmMsg.update_admin.contract_addr, + callbackSig: new Uint8Array(), + } as SecretMsgUpdateAdmin) + : ({ + sender, + newAdmin: wasmMsg.update_admin.admin, + contract: wasmMsg.update_admin.contract_addr, + } as MsgUpdateAdmin), } return encodeObject } if ('clear_admin' in wasmMsg) { const encodeObject: EncodeObject = { - typeUrl: MsgClearAdmin.typeUrl, - value: { - sender, - contract: wasmMsg.clear_admin.contract_addr, - }, + typeUrl: isSecret ? SecretMsgClearAdmin.typeUrl : MsgClearAdmin.typeUrl, + value: isSecret + ? ({ + sender, + contract: wasmMsg.clear_admin.contract_addr, + callbackSig: new Uint8Array(), + } as SecretMsgClearAdmin) + : ({ + sender, + contract: wasmMsg.clear_admin.contract_addr, + } as MsgClearAdmin), } return encodeObject } @@ -289,7 +375,7 @@ export const cwMsgToEncodeObject = ( const govMsg = msg.gov // MsgDepositEncodeObject and MsgSubmitProposalEncodeObject missing from - // CosmosMsgFor_Empty. + // UnifiedCosmosMsg. if ('vote' in govMsg) { const encodeObject: EncodeObject = { @@ -314,14 +400,14 @@ export const cwMsgToEncodeObject = ( // `useDecodedCosmosMsg` hook in actions. That's because the default case with // `makeStargateMessage` needs a non-recursively encoded message due to // technicalities with nested protobufs. -export const decodedStargateMsgToCw = ({ - typeUrl, - value, -}: DecodedStargateMsg['stargate']): { - msg: CosmosMsgFor_Empty +export const decodedStargateMsgToCw = ( + chain: Chain, + { typeUrl, value }: DecodedStargateMsg['stargate'] +): { + msg: UnifiedCosmosMsg sender: string } => { - let msg: CosmosMsgFor_Empty + let msg: UnifiedCosmosMsg let sender = '' switch (typeUrl) { case MsgSend.typeUrl: @@ -401,6 +487,19 @@ export const decodedStargateMsgToCw = ({ } sender = value.sender break + case SecretMsgExecuteContract.typeUrl: + msg = { + wasm: { + execute: { + code_hash: value.callbackCodeHash, + contract_addr: toBech32(chain.bech32_prefix, value.contract), + msg: toBase64(value.msg), + send: value.sentFunds, + }, + }, + } + sender = toBech32(chain.bech32_prefix, value.sender) + break case MsgInstantiateContract.typeUrl: msg = { wasm: { @@ -415,6 +514,21 @@ export const decodedStargateMsgToCw = ({ } sender = value.sender break + case SecretMsgInstantiateContract.typeUrl: + msg = { + wasm: { + instantiate: { + admin: value.admin, + code_hash: value.callbackCodeHash, + code_id: Number(value.codeId), + label: value.label, + msg: toBase64(value.initMsg), + send: value.initFunds, + }, + }, + } + sender = toBech32(chain.bech32_prefix, value.sender) + break case MsgInstantiateContract2.typeUrl: msg = { wasm: { @@ -443,7 +557,21 @@ export const decodedStargateMsgToCw = ({ } sender = value.sender break + case SecretMsgMigrateContract.typeUrl: + msg = { + wasm: { + migrate: { + code_hash: value.callbackCodeHash, + contract_addr: value.contract, + code_id: Number(value.codeId), + msg: toBase64(value.msg), + }, + }, + } + sender = value.sender + break case MsgUpdateAdmin.typeUrl: + case SecretMsgUpdateAdmin.typeUrl: msg = { wasm: { update_admin: { @@ -455,6 +583,7 @@ export const decodedStargateMsgToCw = ({ sender = value.sender break case MsgClearAdmin.typeUrl: + case SecretMsgClearAdmin.typeUrl: msg = { wasm: { clear_admin: { @@ -496,7 +625,7 @@ export const decodedStargateMsgToCw = ({ export const decodedStakingStargateMsgToCw = ({ typeUrl, value, -}: DecodedStargateMsg['stargate']): CosmosMsgFor_Empty | undefined => { +}: DecodedStargateMsg['stargate']): UnifiedCosmosMsg | undefined => { switch (typeUrl) { case MsgDelegate.typeUrl: return { @@ -561,6 +690,7 @@ export const PROTOBUF_TYPES: ReadonlyArray<[string, GeneratedType]> = [ ...kujiraProtoRegistry, ...pstakeProtoRegistry, ...bitsongProtoRegistry, + ...secretProtoRegistry, // Not a query or TX so it isn't included in any of the registries. But we // want to decode this because it appears in gov props. We need to find a // better way to collect all generated types in a single registry... @@ -600,6 +730,7 @@ export const aminoTypes = new AminoTypes({ ...kujiraAminoConverters, ...pstakeAminoConverters, ...bitsongAminoConverters, + ...secretAminoConverters, }) // Encodes a protobuf message value from its JSON representation into a byte diff --git a/packages/types/token.ts b/packages/types/token.ts index eace00466..0ea27ce1f 100644 --- a/packages/types/token.ts +++ b/packages/types/token.ts @@ -37,6 +37,10 @@ export type GenericToken = { * native, and contract address when type is cw20/cw721. */ denomOrAddress: string + /** + * SNIP-20 code hash if isSecretNetwork(chainId) && type === TokenType.Cw20 + */ + snip20CodeHash?: string | null /** * The symbol for this token. */ @@ -202,7 +206,7 @@ export type TokenInfoResponseWithAddressAndLogo = TokenInfoResponse & { export type AmountWithTimestamp = { amount: number - timestamp: Date + timestamp: number } export enum TokenPriceHistoryRange { diff --git a/packages/utils/actions.ts b/packages/utils/actions.ts index e5557b528..104cc7620 100644 --- a/packages/utils/actions.ts +++ b/packages/utils/actions.ts @@ -2,8 +2,8 @@ import { ActionContextType, ActionKeyAndData, ActionOptions, - CosmosMsgForEmpty, LoadedActions, + UnifiedCosmosMsg, } from '@dao-dao/types' import { getAccountAddress } from './dao' @@ -19,7 +19,7 @@ export const convertActionsToMessages = ( }: { throwErrors?: boolean } = {} -): CosmosMsgForEmpty[] => +): UnifiedCosmosMsg[] => actions .map(({ actionKey, data }) => { // If no action, skip it. @@ -58,7 +58,7 @@ export const convertActionsToMessages = ( } }) // Filter out undefined messages. - .filter(Boolean) as CosmosMsgForEmpty[] + .filter(Boolean) as UnifiedCosmosMsg[] /** * Get the address for the given action options for the given chain. If a DAO, @@ -76,7 +76,7 @@ export const getChainAddressForActionOptions = ( : // If on different chain, return DAO's polytone proxy address. context.type === ActionContextType.Dao ? getAccountAddress({ - accounts: context.info.accounts, + accounts: context.dao.accounts, chainId, }) : // If on different chain, return wallet's chain profile address if set. diff --git a/packages/utils/chain.ts b/packages/utils/chain.ts index 2066c1984..07513055b 100644 --- a/packages/utils/chain.ts +++ b/packages/utils/chain.ts @@ -37,6 +37,14 @@ import { } from './constants' import { getFallbackImage } from './getFallbackImage' +/** + * Get the RPC for the given chain. + * + * @param chainId Chain to get RPC for. + * @param offset Offset will try a different URL from the list of available + * RPCs. + * @returns RPC for the given chain. + */ export const getRpcForChainId = ( chainId: string, // Offset will try a different RPC from the list of available RPCs. @@ -73,6 +81,48 @@ export const getRpcForChainId = ( return rpcs[offset % rpcs.length].address.replace(/http:\/\//, 'https://') } +/** + * Get the LCD for the given chain. + * + * @param chainId Chain to get LCD for. + * @param offset Offset will try a different URL from the list of available + * LCDs. + * @returns LCD for the given chain. + */ +export const getLcdForChainId = ( + chainId: string, + // Offset will try a different LCD from the list of available LCDs. + offset = 0 +): string => { + let lcd = ( + (chainId in CHAIN_ENDPOINTS && + CHAIN_ENDPOINTS[chainId as keyof typeof CHAIN_ENDPOINTS]) || + {} + )?.rest + if (lcd && offset === 0) { + return lcd + } + + // If LCD was found but not used, offset > 0, and subtract 1 from offset so we + // try the first LCD in the chain registry list. + if (lcd) { + offset -= 1 + } + + // Fallback to chain registry. + const chain = maybeGetChainForChainId(chainId) + if (!chain) { + throw new Error(`Unknown chain ID "${chainId}"`) + } + + const lcds = chain?.apis?.rest ?? [] + if (lcds.length === 0) { + throw new Error(`No LCD found for chain ID "${chainId}"`) + } + + return lcds[offset % lcds.length].address.replace(/http:\/\//, 'https://') +} + export const cosmosValidatorToValidator = ({ operatorAddress: address, description: { moniker, website, details } = { @@ -632,7 +682,10 @@ export const getDaoInfoForChainId = ( {} as SupportedFeatureMap ), votingModuleAddress: '', - votingModuleContractName: '', + votingModuleInfo: { + contract: '', + version: '', + }, proposalModules: [], name: getDisplayNameForChainId(chainId), description: getChainGovernanceDaoDescription(chainId), @@ -647,3 +700,9 @@ export const getDaoInfoForChainId = ( admin: '', contractAdmin: null, }) + +/** + * Whether or not the chain ID is Secret Network mainnet or testnet. + */ +export const isSecretNetwork = (chainId: string): boolean => + chainId === ChainId.SecretMainnet || chainId === ChainId.SecretTestnet diff --git a/packages/utils/client.ts b/packages/utils/client.ts index fe51c52fe..9b21c2059 100644 --- a/packages/utils/client.ts +++ b/packages/utils/client.ts @@ -20,15 +20,16 @@ import { osmosis, } from '@dao-dao/types/protobuf' -import { getRpcForChainId } from './chain' +import { getLcdForChainId, getRpcForChainId, isSecretNetwork } from './chain' import { retry } from './network' +import { SecretCosmWasmClient } from './secret' -type HandleConnect = (chainId: string) => Promise -type ChainClientRouterOptions = { +type HandleConnect = (chainId: string, ...args: P[]) => Promise +type ChainClientRouterOptions = { /** * The connection handler that returns the client for a given chain ID. */ - handleConnect: HandleConnect + handleConnect: HandleConnect } /* @@ -48,11 +49,11 @@ type ChainClientRouterOptions = { * const queryResponse = await client.queryContractSmart(...); * ``` */ -class ChainClientRouter { - private readonly handleConnect: HandleConnect +class ChainClientRouter { + private readonly handleConnect: HandleConnect private instances: Record = {} - constructor({ handleConnect }: ChainClientRouterOptions) { + constructor({ handleConnect }: ChainClientRouterOptions) { this.handleConnect = handleConnect } @@ -60,9 +61,9 @@ class ChainClientRouter { * Connect to the chain and return the client or return an existing instance * of the client. */ - async connect(chainId: string): Promise { + async connect(chainId: string, ...args: P[]): Promise { if (!this.instances[chainId]) { - const instance = await this.handleConnect(chainId) + const instance = await this.handleConnect(chainId, ...args) this.instances[chainId] = instance } @@ -70,8 +71,12 @@ class ChainClientRouter { } } -/* - * Router for connecting to `CosmWasmClient`. +/** + * Router for connecting to CosmWasmClient for the appropriate chain. + * + * Uses SecretCosmWasmClient for Secret Network mainnet and testnet. + * + * Defaults to CosmWasmClient for all other chains. */ export const cosmWasmClientRouter = new ChainClientRouter({ handleConnect: async (chainId: string) => @@ -88,7 +93,37 @@ export const cosmWasmClientRouter = new ChainClientRouter({ | typeof Comet38Client ).create(httpClient) - return await CosmWasmClient.create(tmClient) + return isSecretNetwork(chainId) + ? await SecretCosmWasmClient.secretCreate(tmClient, { + chainId, + url: getLcdForChainId(chainId, attempt - 1), + }) + : await CosmWasmClient.create(tmClient) + }), +}) + +/** + * Router for connecting to SecretCosmWasmClient. + */ +export const secretCosmWasmClientRouter = new ChainClientRouter({ + handleConnect: async (chainId: string) => + retry(10, async (attempt) => { + const rpc = getRpcForChainId(chainId, attempt - 1) + + const httpClient = new HttpBatchClient(rpc) + const tmClient = await ( + ( + await connectComet(rpc) + ).constructor as + | typeof Tendermint34Client + | typeof Tendermint37Client + | typeof Comet38Client + ).create(httpClient) + + return await SecretCosmWasmClient.secretCreate(tmClient, { + chainId, + url: getLcdForChainId(chainId, attempt - 1), + }) }), }) @@ -258,6 +293,20 @@ export const feemarketProtoRpcClientRouter = new ChainClientRouter({ ), }) +/** + * Get CosmWasmClient for the appropriate chain. + * + * Uses SecretCosmWasmClient for Secret Network mainnet and testnet. + * + * Defaults to CosmWasmClient for all other chains. + */ +export const getCosmWasmClientForChainId = async ( + chainId: string +): Promise => + isSecretNetwork(chainId) + ? await secretCosmWasmClientRouter.connect(chainId) + : await cosmWasmClientRouter.connect(chainId) + /** * In response events from a transaction with a wasm event, gets the attribute * key for a given contract address. diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 9b62bf568..8fc79742c 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -145,6 +145,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ govProp: 'https://ping.pub/juno/gov/REPLACE', wallet: 'https://ping.pub/juno/account/REPLACE', }, + codeIdsVersion: ContractVersion.V240, codeIds: { // https://github.com/CosmWasm/cw-plus Cw1Whitelist: 3914, @@ -152,7 +153,6 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // https://github.com/CosmWasm/cw-nfts Cw721Base: 1994, // v0.16 - // ContractVersion.V240 CwPayrollFactory: 4042, CwTokenSwap: 4043, CwTokenfactoryIssuerMain: 4045, @@ -379,6 +379,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ govProp: 'https://ping.pub/osmosis/gov/REPLACE', wallet: 'https://ping.pub/osmosis/account/REPLACE', }, + codeIdsVersion: ContractVersion.V240, codeIds: { // https://github.com/CosmWasm/cw-plus Cw1Whitelist: 351, @@ -386,7 +387,6 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // https://github.com/CosmWasm/cw-nfts Cw721Base: 124, // v0.16 - // ContractVersion.V240 CwPayrollFactory: 353, CwTokenSwap: 354, CwTokenfactoryIssuerMain: 364, @@ -645,6 +645,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ tx: 'https://neutron.celat.one/neutron-1/txs/REPLACE', wallet: 'https://neutron.celat.one/neutron-1/accounts/REPLACE', }, + codeIdsVersion: ContractVersion.V240, codeIds: { // https://github.com/CosmWasm/cw-plus Cw1Whitelist: 552, @@ -652,7 +653,6 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // https://github.com/CosmWasm/cw-nfts Cw721Base: 232, - // ContractVersion.V240 CwPayrollFactory: 553, CwTokenSwap: 564, CwTokenfactoryIssuerMain: 565, @@ -813,12 +813,12 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ govProp: 'https://ping.pub/stargaze/gov/REPLACE', wallet: 'https://ping.pub/stargaze/account/REPLACE', }, + codeIdsVersion: ContractVersion.V240, codeIds: { // https://github.com/CosmWasm/cw-plus Cw1Whitelist: 152, Cw4Group: 83, // v0.16 - // ContractVersion.V240 CwPayrollFactory: 148, CwTokenSwap: 149, CwTokenfactoryIssuerMain: 150, @@ -1016,6 +1016,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ govProp: 'https://inbloc.org/migaloo/proposal/REPLACE', wallet: 'https://inbloc.org/migaloo/account/REPLACE', }, + codeIdsVersion: ContractVersion.V240, codeIds: { // https://github.com/CosmWasm/cw-plus Cw1Whitelist: 304, @@ -1023,7 +1024,6 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // https://github.com/CosmWasm/cw-nfts Cw721Base: 303, - // ContractVersion.V240 CwPayrollFactory: 286, CwTokenSwap: 287, CwTokenfactoryIssuerMain: 401, @@ -1207,6 +1207,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ govProp: 'https://ping.pub/terra/gov/REPLACE', wallet: 'https://finder.terra.money/mainnet/address/REPLACE', }, + codeIdsVersion: ContractVersion.V240, codeIds: { // https://github.com/CosmWasm/cw-plus Cw1Whitelist: 2627, @@ -1214,7 +1215,6 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // https://github.com/CosmWasm/cw-nfts Cw721Base: 2629, - // ContractVersion.V240 CwPayrollFactory: 2631, CwTokenSwap: 2632, CwTokenfactoryIssuerMain: 2633, @@ -1375,6 +1375,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ govProp: 'https://ping.pub/terra-luna/gov/REPLACE', wallet: 'https://finder.terra.money/classic/address/REPLACE', }, + codeIdsVersion: ContractVersion.V242, codeIds: { // https://github.com/CosmWasm/cw-plus Cw1Whitelist: 8725, @@ -1382,7 +1383,6 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // https://github.com/CosmWasm/cw-nfts Cw721Base: 8727, - // ContractVersion.V242 CwPayrollFactory: 8729, CwTokenSwap: 8730, CwTokenfactoryIssuerMain: -1, // Not used @@ -1493,6 +1493,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ govProp: 'https://scan.orai.io/proposals/REPLACE', wallet: 'https://scan.orai.io/account/REPLACE', }, + codeIdsVersion: ContractVersion.V240, codeIds: { // https://github.com/CosmWasm/cw-plus Cw1Whitelist: 1546, @@ -1500,7 +1501,6 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // https://github.com/CosmWasm/cw-nfts Cw721Base: 1548, - // ContractVersion.V240 CwPayrollFactory: 1550, CwTokenSwap: 1551, CwTokenfactoryIssuerMain: 1552, @@ -1576,6 +1576,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ govProp: 'https://blue.kujira.network/govern/REPLACE', wallet: 'https://finder.kujira.network/kaiyo-1/address/REPLACE', }, + codeIdsVersion: ContractVersion.V242, codeIds: { // https://github.com/CosmWasm/cw-plus Cw1Whitelist: 259, @@ -1583,7 +1584,6 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // https://github.com/CosmWasm/cw-nfts Cw721Base: 261, - // ContractVersion.V242 CwPayrollFactory: 262, CwTokenSwap: 263, CwTokenfactoryIssuerMain: 264, @@ -1728,6 +1728,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ govProp: 'https://ping.pub/bitsong/gov/REPLACE', wallet: 'https://ping.pub/bitsong/account/REPLACE', }, + codeIdsVersion: ContractVersion.V242, codeIds: { Cw1Whitelist: 7, Cw4Group: 8, @@ -1805,6 +1806,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ govProp: 'https://ping.pub/omniflixhub/gov/REPLACE', wallet: 'https://ping.pub/omniflixhub/account/REPLACE', }, + codeIdsVersion: ContractVersion.V242, codeIds: { Cw1Whitelist: 5, Cw4Group: 6, @@ -1840,6 +1842,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ govProp: 'https://testnet.ping.pub/juno/gov/REPLACE', wallet: 'https://testnet.ping.pub/juno/account/REPLACE', }, + codeIdsVersion: ContractVersion.V240, codeIds: { // https://github.com/CosmWasm/cw-plus Cw1Whitelist: 4060, @@ -1847,7 +1850,6 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // https://github.com/CosmWasm/cw-nfts Cw721Base: 179, - // ContractVersion.V240 CwPayrollFactory: 4062, CwTokenSwap: 4063, CwTokenfactoryIssuerMain: 4065, @@ -1888,6 +1890,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ govProp: 'https://testnet.ping.pub/osmosis/gov/REPLACE', wallet: 'https://testnet.ping.pub/osmosis/account/REPLACE', }, + codeIdsVersion: ContractVersion.V240, codeIds: { // https://github.com/CosmWasm/cw-plus Cw1Whitelist: 5839, @@ -1895,7 +1898,6 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // https://github.com/CosmWasm/cw-nfts Cw721Base: 1326, // v0.16 - // ContractVersion.V240 CwPayrollFactory: 5841, CwTokenSwap: 5842, CwTokenfactoryIssuerMain: 5843, @@ -1932,27 +1934,27 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ govProp: 'https://testnet.ping.pub/stargaze/gov/REPLACE', wallet: 'https://testnet.ping.pub/stargaze/account/REPLACE', }, + codeIdsVersion: ContractVersion.V250, codeIds: { // https://github.com/CosmWasm/cw-plus Cw1Whitelist: 3459, Cw4Group: 2887, // v0.16 - // ContractVersion.V240 - CwPayrollFactory: 3461, - CwTokenSwap: 3462, - CwTokenfactoryIssuerMain: 3463, - CwVesting: 3464, - DaoCore: 3465, + CwPayrollFactory: 4355, + CwTokenSwap: 4356, + CwTokenfactoryIssuerMain: 4357, + CwVesting: 4358, + DaoCore: 4359, DaoMigrator: -1, // not needed since only v2 DAOs exist - DaoPreProposeApprovalSingle: 3467, - DaoPreProposeApprover: 3468, - DaoPreProposeMultiple: 3469, - DaoPreProposeSingle: 3470, - DaoProposalMultiple: 3471, - DaoProposalSingle: 3472, - DaoVotingCw4: 3473, - DaoVotingCw721Staked: 3474, - DaoVotingTokenStaked: 3475, + DaoPreProposeApprovalSingle: 4360, + DaoPreProposeApprover: 4361, + DaoPreProposeMultiple: 4362, + DaoPreProposeSingle: 4363, + DaoProposalMultiple: 4364, + DaoProposalSingle: 4365, + DaoVotingCw4: 4366, + DaoVotingCw721Staked: 4367, + DaoVotingTokenStaked: 4368, }, historicalCodeIds: { [ContractVersion.V210]: { @@ -1974,6 +1976,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ govProp: 'https://testnet.ping.pub/migaloo/gov/REPLACE', wallet: 'https://testnet.ping.pub/migaloo/account/REPLACE', }, + codeIdsVersion: ContractVersion.V240, codeIds: { // https://github.com/CosmWasm/cw-plus Cw1Whitelist: 1, @@ -1981,7 +1984,6 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // https://github.com/CosmWasm/cw-nfts Cw721Base: 19, - // ContractVersion.V240 CwPayrollFactory: 3, CwTokenSwap: 4, CwTokenfactoryIssuerMain: 65, @@ -2015,6 +2017,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // govProp: 'https://blue.kujira.network/govern/REPLACE', wallet: 'https://finder.kujira.network/harpoon-4/address/REPLACE', }, + codeIdsVersion: ContractVersion.V242, codeIds: { // https://github.com/CosmWasm/cw-plus Cw1Whitelist: 3361, @@ -2022,7 +2025,6 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // https://github.com/CosmWasm/cw-nfts Cw721Base: 3363, - // ContractVersion.V242 CwPayrollFactory: 3365, CwTokenSwap: 3366, CwTokenfactoryIssuerMain: 3378, @@ -2052,6 +2054,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ tx: 'https://neutron.celat.one/pion-1/txs/REPLACE', wallet: 'https://neutron.celat.one/pion-1/accounts/REPLACE', }, + codeIdsVersion: ContractVersion.V242, codeIds: { // https://github.com/CosmWasm/cw-plus Cw1Whitelist: 4618, @@ -2059,7 +2062,6 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // https://github.com/CosmWasm/cw-nfts Cw721Base: 4620, - // ContractVersion.V242 CwPayrollFactory: 4622, CwTokenSwap: 4623, CwTokenfactoryIssuerMain: 4635, @@ -2086,6 +2088,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ tokenCreationUnderDevelopment: true, factoryContractAddress: 'bitsong1ewd84afkxwxmqeu56p5mt3h446mgh3nh8yvmj2238akvu4ax7kss4a3u5c', + codeIdsVersion: ContractVersion.V242, codeIds: { // https://github.com/CosmWasm/cw-plus Cw1Whitelist: 7, @@ -2093,7 +2096,6 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // https://github.com/CosmWasm/cw-nfts Cw721Base: 9, - // ContractVersion.V242 CwPayrollFactory: 11, CwTokenSwap: 12, CwTokenfactoryIssuerMain: 27, @@ -2111,6 +2113,93 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ DaoVotingTokenStaked: 28, }, }, + // TODO(secret-testnet) + // { + // chainId: ChainId.SecretTestnet, + // name: 'secret', + // mainnet: false, + // accentColor: '#000000', + // factoryContractAddress: 'secret13dk93ms25qu8j06pxn2p9yphzmsskpejtmddh0', + // noIndexer: true, + // createWithCw20: true, + // explorerUrlTemplates: { + // tx: 'https://testnet.ping.pub/secret/tx/REPLACE', + // gov: 'https://testnet.ping.pub/secret/gov', + // govProp: 'https://testnet.ping.pub/secret/gov/REPLACE', + // wallet: 'https://testnet.ping.pub/secret/account/REPLACE', + // }, + // codeIdsVersion: ContractVersion.V242, + // codeIds: { + // // TODO(secret-testnet) + // Cw1Whitelist: -1, + // Cw4Group: 8168, + // Cw20Base: 8164, // snip20 + // Cw721Base: 8172, // snip721 + // CwPayrollFactory: 8186, + // CwTokenSwap: 8187, + // CwVesting: 8189, + // DaoCore: 8607, + // DaoPreProposeApprovalSingle: 8180, + // DaoPreProposeApprover: 8181, + // DaoPreProposeMultiple: 8177, + // DaoPreProposeSingle: 8175, + // DaoProposalMultiple: 8178, + // DaoProposalSingle: 8176, + // DaoVotingCw4: 8169, + // DaoVotingCw20Staked: 8170, // snip20 + // DaoVotingCw721Staked: 8182, // snip721 + // DaoVotingTokenStaked: 8174, + // QueryAuth: 8195, + + // // unused + // CwTokenfactoryIssuerMain: -1, + // DaoMigrator: -1, + // }, + // codeHashes: { + // // TODO(secret-testnet) + // Cw1Whitelist: '', + // Cw4Group: + // '0945d46e86259fffb84c5d7d501f773071ef8101a4112ae5ce1847c2abe297ab', + // Cw20Base: + // 'c2508a75824974eeaa578a5d1af07006b1c3911b5c2909813d74672797264775', // snip20 + // Cw721Base: + // 'ab0f16b065e766eee7181c4357d29bc6f947d73dbd48943fc0e501b2147a492e', // snip721 + // CwPayrollFactory: + // 'f6f0bd62757f19c513fd2e0bccea1aa4d6bc57ff65c2cdd1f5c849a397eea9fd', + // CwTokenSwap: + // '26f2ce755019de01c65a5742ac3c8e704130a2feaa92bd69d161e76030998f2c', + // CwVesting: + // '0dae83b3616c066d0cdbf061b977707f99d6b91bdc7b44a81285a688e37552b0', + // DaoCore: + // 'ad3f67d0983fd13726f34148835e07f65f9225ad698a30d0b55e78e783363fd4', + // DaoPreProposeApprovalSingle: + // '88410e9c96687c01af289c59730d90a425a974c81abf20a76597f076959cb7fc', + // DaoPreProposeApprover: + // '5fc6a014fd017a62bbfea437322857e952eac7572c901a0a6ca23ef7598f971f', + // DaoPreProposeMultiple: + // '24e2a494b9450e6747bdf2b00b01e0f9afb54d455121c58b3857396af74d298f', + // DaoPreProposeSingle: + // 'd5fde27c749424968f14a70f4383d3aa1df97ba9ab4933a7e648186ecf8afa1c', + // DaoProposalMultiple: + // '78584b7acdbeae211e71b8711147985217999ab7cf146812df456c48a24835b9', + // DaoProposalSingle: + // '0d412146fccc5936cacc463db54e7721eae03d13977e4c3c3ee570fdbba530c6', + // DaoVotingCw4: + // '732a247721d7629a0c33bbf39c40a5b410fcd7d9b58415f3bcd91fb68a792176', + // DaoVotingCw20Staked: + // '715b7aa5925b46a7fcff277f4ad3763016429daec8ddedd568f892dad2eb88d0', // snip20 + // DaoVotingCw721Staked: + // '90f91337256cb3db1b44567ced0457b51271263f67e5df3590de77d22c04a3b3', // snip721 + // DaoVotingTokenStaked: + // '3bc835c9e0fdd0deea88202d3de32caa8125891eb0821973f1c5244f818f2d45', + // QueryAuth: + // 'dbedf461d93392c5f5e36e07feb46ac4ce0700069d1be6c0796980ef48d1aab4', + + // // unused + // CwTokenfactoryIssuerMain: '', + // DaoMigrator: '', + // }, + // }, ] export const POLYTONE_CONFIG_PER_CHAIN: [ChainId, PolytoneConfig][] = @@ -2212,6 +2301,10 @@ export const CHAIN_ENDPOINTS: Partial< rpc: 'https://omniflix-rpc.polkachu.com', rest: 'https://omniflix-api.polkachu.com', }, + [ChainId.SecretTestnet]: { + rpc: 'https://rpc.pulsar.scrttestnet.com', + rest: 'https://api.pulsar.scrttestnet.com', + }, } const INITIAL_CONFIGURED_CHAINS: BaseChainConfig[] = [ diff --git a/packages/utils/constants/contracts.ts b/packages/utils/constants/contracts.ts index aadd5e4e7..5e5462fab 100644 --- a/packages/utils/constants/contracts.ts +++ b/packages/utils/constants/contracts.ts @@ -44,6 +44,9 @@ export const DAO_VOTING_CW20_STAKED_CONTRACT_NAMES = [ // V2+ 'crates.io:cwd-voting-cw20-staked', 'crates.io:dao-voting-cw20-staked', + + // Secret + 'crates.io:dao-voting-snip20-staked', ] export const DAO_VOTING_CW4_CONTRACT_NAMES = [ @@ -57,6 +60,9 @@ export const DAO_VOTING_CW4_CONTRACT_NAMES = [ export const DAO_VOTING_CW721_STAKED_CONTRACT_NAMES = [ // V2+ 'crates.io:dao-voting-cw721-staked', + + // Secret + 'crates.io:dao-voting-snip721-staked', ] export const DAO_VOTING_TOKEN_STAKED_CONTRACT_NAMES = [ diff --git a/packages/utils/contracts.ts b/packages/utils/contracts.ts index 6324246a0..51e3f8bf1 100644 --- a/packages/utils/contracts.ts +++ b/packages/utils/contracts.ts @@ -1,11 +1,19 @@ -import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate' -import { Coin, SigningStargateClient } from '@cosmjs/stargate' +import { ExecuteResult, SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate' +import { fromBech32, toBase64, toBech32 } from '@cosmjs/encoding' +import { Coin, DeliverTxResponse, isDeliverTxFailure } from '@cosmjs/stargate' +import { parseRawLog } from '@cosmjs/stargate/build/logs' +import { toUtf8 } from 'secretjs' -import { ContractVersion, cwMsgToEncodeObject } from '@dao-dao/types' +import { ContractVersion } from '@dao-dao/types' +import { + MsgExecuteContract, + MsgInstantiateContract, +} from '@dao-dao/types/protobuf/codegen/cosmwasm/wasm/v1/tx' +import { getChainForChainId } from './chain' import { findEventsAttributeValue } from './client' import { CHAIN_GAS_MULTIPLIER } from './constants' -import { encodeJsonToBase64 } from './messages' +import { SecretSigningCosmWasmClient } from './secret' const CONTRACT_VERSIONS = Object.values(ContractVersion) @@ -27,50 +35,152 @@ export const indexToProposalModulePrefix = (index: number) => { return prefix } -// Use our custom instantiate encoder since CosmJS is unreliable due to the SDK -// version (47+) change that improperly handles the optional admin field as an -// empty string. The normal signing client `instantiate` function is thus no -// longer reliable. +export type SupportedSigningCosmWasmClient = + | SigningCosmWasmClient + | SecretSigningCosmWasmClient + +/** + * Instantiate a smart contract from any supported client. + * + * This uses our custom instantiate encoder since CosmJS is unreliable due to + * the SDK version (47+) change that improperly handles the optional admin field + * as an empty string. The normal signing client `instantiate` function is thus + * no longer reliable. + */ export const instantiateSmartContract = async ( - client: SigningCosmWasmClient | SigningStargateClient, + client: + | SupportedSigningCosmWasmClient + | (() => Promise), sender: string, codeId: number, label: string, - msg: unknown, + msg: object, funds?: Coin[], - admin?: string | null + admin?: string | null, + fee = CHAIN_GAS_MULTIPLIER, + memo: string | undefined = undefined ): Promise => { - const { events } = await client.signAndBroadcast( - sender, - [ - cwMsgToEncodeObject( + client = typeof client === 'function' ? await client() : client + + if (client instanceof SecretSigningCosmWasmClient) { + const { contractAddress } = await client.instantiate( + sender, + codeId, + msg, + label, + fee, + { + funds, + admin: typeof admin === 'string' ? admin : undefined, + memo, + } + ) + + return contractAddress + } else { + const result = await client.signAndBroadcast( + sender, + [ { - wasm: { - instantiate: { - code_id: codeId, - msg: encodeJsonToBase64(msg), - funds: funds || [], - label, - // Replace empty string with undefined. - admin: admin || undefined, - }, - }, + typeUrl: MsgInstantiateContract.typeUrl, + value: MsgInstantiateContract.fromPartial({ + sender, + admin: admin ?? undefined, + codeId: BigInt(codeId), + label, + msg: toUtf8(JSON.stringify(msg)), + funds, + }), }, - sender - ), - ], - CHAIN_GAS_MULTIPLIER - ) - - const contractAddress = findEventsAttributeValue( - events, - 'instantiate', - '_contract_address' - ) - - if (!contractAddress) { - throw new Error('Contract address not found') + ], + fee, + memo + ) + + if (isDeliverTxFailure(result)) { + throw new Error(createDeliverTxResponseErrorMessage(result)) + } + + const contractAddress = findEventsAttributeValue( + result.events, + 'instantiate', + '_contract_address' + ) + + if (!contractAddress) { + throw new Error( + `Contract address not found for TX: ${result.transactionHash}` + ) + } + + return contractAddress } +} - return contractAddress +/** + * Execute a smart contract from any supported client. + */ +export const executeSmartContract = async ( + client: + | SupportedSigningCosmWasmClient + | (() => Promise), + sender: string, + contractAddress: string, + msg: object, + funds?: Coin[], + fee = CHAIN_GAS_MULTIPLIER, + memo: string | undefined = undefined +): Promise => { + client = typeof client === 'function' ? await client() : client + + if (client instanceof SecretSigningCosmWasmClient) { + return await client.execute(sender, contractAddress, msg, fee, memo, funds) + } else { + const result = await client.signAndBroadcast( + sender, + [ + { + typeUrl: MsgExecuteContract.typeUrl, + value: MsgExecuteContract.fromPartial({ + sender, + contract: contractAddress, + msg: toUtf8(JSON.stringify(msg)), + funds, + }), + }, + ], + fee, + memo + ) + + if (isDeliverTxFailure(result)) { + throw new Error(createDeliverTxResponseErrorMessage(result)) + } + + return { + logs: parseRawLog(result.rawLog), + height: result.height, + transactionHash: result.transactionHash, + events: result.events, + gasWanted: result.gasWanted, + gasUsed: result.gasUsed, + } + } } + +const createDeliverTxResponseErrorMessage = (result: DeliverTxResponse) => + `Error when broadcasting tx ${result.transactionHash} at height ${result.height}. Code: ${result.code}; Raw log: ${result.rawLog}` + +/** + * Convert bech32 address data to address string for the given chain. + */ +export const bech32DataToAddress = ( + chainId: string, + bech32Bytes: Uint8Array +): string => toBech32(getChainForChainId(chainId).bech32_prefix, bech32Bytes) + +/** + * Convert bech32 address string to base64 string with bech32 data. + */ +export const bech32AddressToBase64 = (bech32Address: string): string => + toBase64(fromBech32(bech32Address).data) diff --git a/packages/utils/conversion.ts b/packages/utils/conversion.ts index adc58b7a9..5df6b62b5 100644 --- a/packages/utils/conversion.ts +++ b/packages/utils/conversion.ts @@ -245,7 +245,8 @@ export const combineLoadingDataWithErrors = ( } /** - * Combine react-query results into LoadingData list. + * Combine react-query results into LoadingData list. Filters out any errored + * results. */ export const makeCombineQueryResultsIntoLoadingData = ({ @@ -265,7 +266,7 @@ export const makeCombineQueryResultsIntoLoadingData = * Optional transformation function that acts on combined list of data. */ transform?: (results: T[]) => R - }) => + } = {}) => (results: UseQueryResult[]): LoadingData => { const isLoading = firstLoad === 'all' @@ -294,6 +295,80 @@ export const makeCombineQueryResultsIntoLoadingData = } } +/** + * Combine react-query results into LoadingDataWithError list. + */ +export const makeCombineQueryResultsIntoLoadingDataWithError = + ({ + firstLoad = 'all', + errorIf = 'any', + transform = (results: T[]) => results as R, + }: { + /** + * Whether or not to show loading until all of the results are loaded, at + * least one result is loaded, or none of the results are loaded. If 'one', + * will show not loading (just updating) once the first result is loaded. If + * 'none', will never show loading. + * + * Defaults to 'all'. + */ + firstLoad?: 'all' | 'one' | 'none' + /** + * Whether or not to show error if any of the results are errored or all. If + * set to 'all' but only some of the results are errored, the errored + * results will be filtered out of the data. + * + * Defaults to 'any'. + */ + errorIf?: 'any' | 'all' + /** + * Optional transformation function that acts on combined list of data. + */ + transform?: (results: T[]) => R + } = {}) => + (results: UseQueryResult[]): LoadingDataWithError => { + const isLoading = + firstLoad === 'all' + ? results.some((r) => r.isPending) + : firstLoad === 'one' + ? results.every((r) => r.isPending) + : false + const isError = + errorIf === 'any' + ? results.some((r) => r.isError) + : errorIf === 'all' + ? results.every((r) => r.isError) + : false + + if (isLoading) { + return { + loading: true, + errored: false, + } + } else if (isError) { + return { + loading: false, + errored: true, + // First error. + error: results.flatMap((r) => (r.isError ? r.error : []))[0], + } + } else { + return { + loading: false, + errored: false, + updating: results.some((r) => r.isPending || r.isFetching), + // Cast data to T if not pending since it's possible that data has + // successfully loaded and returned undefined. isPending will be true if + // data is not yet loaded. Filter out errored data. + data: transform( + results.flatMap((r) => + r.isPending || r.isError ? [] : [r.data as T] + ) + ), + } + } + } + // Convert Recoil loadable into our generic data loader with error type. See the // comment above the LoadingData type for more details. export const loadableToLoadingDataWithError = ( diff --git a/packages/utils/dao.ts b/packages/utils/dao.ts index bb47b21a9..81c557d53 100644 --- a/packages/utils/dao.ts +++ b/packages/utils/dao.ts @@ -8,7 +8,7 @@ import { DaoWebSocketChannelInfo, PolytoneProxies, } from '@dao-dao/types' -import { InstantiateMsg as DaoCoreV2InstantiateMsg } from '@dao-dao/types/contracts/DaoCore.v2' +import { InstantiateMsg as DaoDaoCoreInstantiateMsg } from '@dao-dao/types/contracts/DaoDaoCore' import { getSupportedChainConfig } from './chain' @@ -57,7 +57,10 @@ export const polytoneNoteProxyMapToChainIdMap = ( export const getFundsFromDaoInstantiateMsg = ({ voting_module_instantiate_info, proposal_modules_instantiate_info, -}: DaoCoreV2InstantiateMsg) => [ +}: Pick< + DaoDaoCoreInstantiateMsg, + 'voting_module_instantiate_info' | 'proposal_modules_instantiate_info' +>) => [ ...(voting_module_instantiate_info.funds || []), ...proposal_modules_instantiate_info.flatMap(({ funds }) => funds || []), ] @@ -68,9 +71,9 @@ export const getAccount = ({ chainId, types = [AccountType.Native, AccountType.Polytone], }: { - accounts: Account[] + accounts: readonly Account[] chainId: string - types?: AccountType[] + types?: readonly AccountType[] }): Account | undefined => accounts.find( (account) => types.includes(account.type) && account.chainId === chainId diff --git a/packages/utils/features.ts b/packages/utils/features.ts index 4c6ab5a73..b61bc3c1d 100644 --- a/packages/utils/features.ts +++ b/packages/utils/features.ts @@ -30,6 +30,8 @@ export const isFeatureSupportedByVersion = ( case Feature.Approval: case Feature.Veto: return versionGte(version, ContractVersion.V240) + case Feature.GranularSubmissionPolicy: + return versionGte(version, ContractVersion.V250) default: return true } diff --git a/packages/utils/index.ts b/packages/utils/index.ts index 76fc9208c..856ca867f 100644 --- a/packages/utils/index.ts +++ b/packages/utils/index.ts @@ -31,6 +31,7 @@ export * from './objectMatchesStructure' export * from './pagination' export * from './profile' export * from './proposal' +export * from './secret' export * from './string' export * from './time' export * from './token' diff --git a/packages/utils/messages/cw.ts b/packages/utils/messages/cw.ts index 747c025c5..7b20df688 100644 --- a/packages/utils/messages/cw.ts +++ b/packages/utils/messages/cw.ts @@ -16,8 +16,8 @@ import { } from '@dao-dao/types' import { BankMsg, - CosmosMsgFor_Empty, StargateMsg, + UnifiedCosmosMsg, WasmMsg, } from '@dao-dao/types/contracts/common' import { MsgSendTx } from '@dao-dao/types/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx' @@ -27,14 +27,17 @@ import { Type, } from '@dao-dao/types/protobuf/codegen/ibc/applications/interchain_accounts/v1/packet' import { MsgTransfer } from '@dao-dao/types/protobuf/codegen/ibc/applications/transfer/v1/tx' +import { MsgExecuteContract as SecretMsgExecuteContract } from '@dao-dao/types/protobuf/codegen/secret/compute/v1beta1/msg' import { getChainForChainName, getIbcTransferInfoBetweenChains, getIbcTransferInfoFromConnection, getSupportedChainConfig, + isSecretNetwork, } from '../chain' import { IBC_TIMEOUT_SECONDS } from '../constants' +import { bech32AddressToBase64 } from '../contracts' import { processError } from '../error' import { objectMatchesStructure } from '../objectMatchesStructure' import { decodeJsonFromBase64, encodeJsonToBase64 } from './encoding' @@ -63,7 +66,7 @@ const BINARY_WASM_TYPES: { [key: string]: boolean } = { migrate: true, } -export function isWasmMsg(msg?: CosmosMsgFor_Empty): msg is { wasm: WasmMsg } { +export function isWasmMsg(msg?: UnifiedCosmosMsg): msg is { wasm: WasmMsg } { if (msg) { return (msg as any).wasm !== undefined } @@ -94,7 +97,7 @@ function isBinaryType(msgType?: WasmMsgType): boolean { return false } -export const decodeMessage = (msg: CosmosMsgFor_Empty): Record => { +export const decodeMessage = (msg: UnifiedCosmosMsg): Record => { // Decode base64 wasm binary into object. if (isWasmMsg(msg)) { const msgType = getWasmMsgType(msg.wasm) @@ -129,14 +132,53 @@ export const decodeMessage = (msg: CosmosMsgFor_Empty): Record => { } export const decodeMessages = ( - msgs: CosmosMsgFor_Empty[] + msgs: UnifiedCosmosMsg[] ): Record[] => msgs.map(decodeMessage) -export function decodedMessagesString(msgs: CosmosMsgFor_Empty[]): string { +export function decodedMessagesString(msgs: UnifiedCosmosMsg[]): string { const decodedMessageArray = decodeMessages(msgs) return JSON.stringify(decodedMessageArray, undefined, 2) } +/** + * Make a Cosmos message that executes a smart contract, intelligently encoded + * to support Secret Network if necessary. + */ +export const makeExecuteSmartContractMessage = ({ + chainId, + sender, + contractAddress, + msg, + funds, +}: { + chainId: string + sender: string + contractAddress: string + msg: Record + funds?: Coin[] +}): UnifiedCosmosMsg => + isSecretNetwork(chainId) + ? makeStargateMessage({ + stargate: { + typeUrl: SecretMsgExecuteContract.typeUrl, + value: SecretMsgExecuteContract.fromAmino({ + sender: bech32AddressToBase64(sender), + contract: bech32AddressToBase64(contractAddress), + sent_funds: funds || [], + msg: encodeJsonToBase64(msg), + }), + }, + }) + : makeWasmMessage({ + wasm: { + execute: { + contract_addr: contractAddress, + funds: funds || [], + msg, + }, + }, + }) + /** * Encode relevant components of wasm messages into base64 strings as the chain * expects. @@ -220,9 +262,9 @@ export const makeBankMessage = ( /** * Convert stringified JSON object into CosmWasm-formatted Cosmos message. Used - * by the Custom action component to encode generic a JSON string. + * by the Custom action component to encode a generic JSON string. */ -export const convertJsonToCWCosmosMsg = (value: string): CosmosMsgFor_Empty => { +export const convertJsonToCWCosmosMsg = (value: string): UnifiedCosmosMsg => { let msg = JSON5.parse(value) // Convert the wasm message component to base64 if necessary. @@ -284,8 +326,8 @@ export const maybeMakePolytoneExecuteMessage = ( destChainId: string, // Allow passing no message, which just creates an account. `msg` cannot be an // array if the chains are the same. - msg?: CosmosMsgFor_Empty | CosmosMsgFor_Empty[] -): CosmosMsgFor_Empty => { + msg?: UnifiedCosmosMsg | UnifiedCosmosMsg[] +): UnifiedCosmosMsg => { // If on same chain, just return the message. if (srcChainId === destChainId && msg) { if (Array.isArray(msg)) { @@ -394,8 +436,8 @@ export const maybeMakeIcaExecuteMessage = ( icaHostAddress: string, // The ICA remote address on the destination chain (i.e. the dest sender). icaRemoteAddress: string, - msg: CosmosMsgFor_Empty | CosmosMsgFor_Empty[] -): CosmosMsgFor_Empty => { + msg: UnifiedCosmosMsg | UnifiedCosmosMsg[] +): UnifiedCosmosMsg => { // If on same chain, just return the message. if (srcChainId === destChainId && msg) { if (Array.isArray(msg)) { @@ -420,7 +462,9 @@ export const maybeMakeIcaExecuteMessage = ( data: CosmosTx.toProto({ messages: [msg] .flat() - .map((msg) => cwMsgToProtobuf(msg, icaRemoteAddress)), + .map((msg) => + cwMsgToProtobuf(destChainId, msg, icaRemoteAddress) + ), }), memo: '', }), @@ -456,13 +500,14 @@ export const decodeIcaExecuteMsg = ( srcChainId, connectionId ) - const chainId = getChainForChainName(destinationChain.chain_name).chain_id + const chain = getChainForChainName(destinationChain.chain_name) const { packetData: { data } = {} } = decodedMsg.stargate.value as MsgSendTx const protobufMessages = data && CosmosTx.decode(data).messages const cosmosMsgsWithSenders = - protobufMessages?.map((protobuf) => protobufToCwMsg(protobuf, false)) || - [] + protobufMessages?.map((protobuf) => + protobufToCwMsg(chain, protobuf, false) + ) || [] if ( (type === 'zero' && cosmosMsgsWithSenders.length !== 0) || @@ -481,7 +526,7 @@ export const decodeIcaExecuteMsg = ( return { match: true, - chainId, + chainId: chain.chain_id, msgWithSender: msgsWithSenders[0], cosmosMsgWithSender: cosmosMsgsWithSenders[0], msgsWithSenders, @@ -501,7 +546,7 @@ export const decodeIcaExecuteMsg = ( export const decodeCrossChainMessages = ( srcChainId: string, srcAddress: string, - msgs: CosmosMsgFor_Empty[] + msgs: UnifiedCosmosMsg[] ): CrossChainPacketInfo[] => decodeMessages(msgs).flatMap( (msg): CrossChainPacketInfo | CrossChainPacketInfo[] => { @@ -570,8 +615,8 @@ export const decodeCrossChainMessages = ( */ export const makeCw1WhitelistExecuteMessage = ( cw1WhitelistContract: string, - msg: CosmosMsgFor_Empty | CosmosMsgFor_Empty[] -): CosmosMsgFor_Empty => + msg: UnifiedCosmosMsg | UnifiedCosmosMsg[] +): UnifiedCosmosMsg => makeWasmMessage({ wasm: { execute: { @@ -598,7 +643,7 @@ export const decodeCw1WhitelistExecuteMsg = ( | { address: string msgs: Record[] - cosmosMsgs: CosmosMsgFor_Empty[] + cosmosMsgs: UnifiedCosmosMsg[] } | undefined => { if ( @@ -634,7 +679,7 @@ export const decodeCw1WhitelistExecuteMsg = ( } } -export const getFundsUsedInCwMessage = (msg: CosmosMsgFor_Empty): Coin[] => +export const getFundsUsedInCwMessage = (msg: UnifiedCosmosMsg): Coin[] => 'bank' in msg ? 'send' in msg.bank ? msg.bank.send.amount @@ -655,11 +700,15 @@ export const getFundsUsedInCwMessage = (msg: CosmosMsgFor_Empty): Coin[] => : [] : 'wasm' in msg ? 'execute' in msg.wasm - ? msg.wasm.execute.funds + ? 'funds' in msg.wasm.execute + ? msg.wasm.execute.funds + : // Secret Network + msg.wasm.execute.send : 'instantiate' in msg.wasm - ? msg.wasm.instantiate.funds - : 'instantiate2' in msg.wasm - ? msg.wasm.instantiate2.funds + ? 'funds' in msg.wasm.instantiate + ? msg.wasm.instantiate.funds + : // Secret Network + msg.wasm.instantiate.send : [] : isCosmWasmStargateMsg(msg) ? (() => { diff --git a/packages/utils/messages/protobuf.ts b/packages/utils/messages/protobuf.ts index 0be944cc6..ec377dd70 100644 --- a/packages/utils/messages/protobuf.ts +++ b/packages/utils/messages/protobuf.ts @@ -16,6 +16,7 @@ import { MsgExecLegacyContent } from '@dao-dao/types/protobuf/codegen/cosmos/gov import { TextProposal } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' import { Any } from '@dao-dao/types/protobuf/codegen/google/protobuf/any' +import { getChainForChainId } from '../chain' import { transformIpfsUrlToHttpsIfNecessary } from '../conversion' import { isValidUrl } from '../isValidUrl' import { objectMatchesStructure } from '../objectMatchesStructure' @@ -23,11 +24,12 @@ import { isCosmWasmStargateMsg } from './cw' // Decode governance proposal v1 messages using a protobuf. export const decodeGovProposalV1Messages = ( + chainId: string, messages: GovProposalV1['proposal']['messages'] ): GovProposalV1DecodedMessages => messages.map((msg) => { try { - return protobufToCwMsg(msg).msg + return protobufToCwMsg(getChainForChainId(chainId), msg).msg } catch (err) { // If protobuf not found, return raw stargate message. console.error(err) @@ -74,6 +76,7 @@ export const decodeGovProposal = async ( } const decodedMessages = decodeGovProposalV1Messages( + chainId, govProposal.proposal.messages.filter( ({ typeUrl }) => typeUrl !== MsgExecLegacyContent.typeUrl ) diff --git a/packages/utils/package.json b/packages/utils/package.json index 67a708c29..6ec81627f 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -33,6 +33,7 @@ "react-i18next": "^11.0.0", "recoil": "^0.7.2", "ripemd160": "^2.0.2", + "secretjs": "^1.12.5", "semver": "^7.5.4", "uuid": "^9.0.0" }, @@ -41,6 +42,7 @@ "@cosmjs/proto-signing": "^0.32.3", "@dao-dao/config": "2.4.0-rc.9", "@tanstack/react-query": "^5.40.0", + "@types/pako": "^2.0.3", "commander": "^12.1.0", "cosmjs-types": "^0.9.0", "jest": "^29.1.1", diff --git a/packages/utils/proposal.ts b/packages/utils/proposal.ts index c4a32b4b3..cf85d39f5 100644 --- a/packages/utils/proposal.ts +++ b/packages/utils/proposal.ts @@ -1,4 +1,10 @@ -import { DurationUnits, ProposalVetoConfig } from '@dao-dao/types' +import { TFunction } from 'react-i18next' + +import { + DurationUnits, + ProposalModule, + ProposalVetoConfig, +} from '@dao-dao/types' import { ProposalStatus, ProposalStatusKey, @@ -102,3 +108,56 @@ export const convertCosmosVetoConfigToVeto = ( earlyExecute: true, vetoBeforePassed: false, } + +/** + * Check whether or not the submission policy allows an address and return an + * error text if not. If allowed to propose, return undefined. + */ +export const checkProposalSubmissionPolicy = ({ + proposalModule: { prePropose }, + address, + isMember, + t, +}: { + /** + * The proposal module. + */ + proposalModule: ProposalModule + /** + * Current wallet address. Undefined if not connected. + */ + address?: string + /** + * Whether or not the current wallet is a member of the DAO. + */ + isMember?: boolean + /** + * I18n translation getter. + */ + t: TFunction +}): string | undefined => + prePropose + ? 'anyone' in prePropose.submissionPolicy + ? // Cannot create proposal if on denylist. + address && + prePropose.submissionPolicy.anyone.denylist?.includes(address) + ? t('error.notAllowedToCreateProposal') + : undefined + : // Cannot create proposal if on denylist. + address && + prePropose.submissionPolicy.specific.denylist?.includes(address) + ? t('error.notAllowedToCreateProposal') + : // Cannot create proposal if not a member. + (!prePropose.submissionPolicy.specific.dao_members || !isMember) && + (!address || + !prePropose.submissionPolicy.specific.allowlist?.includes(address)) + ? // If members can propose and current wallet is not a member, prioritize that as the reason... + prePropose.submissionPolicy.specific.dao_members && !isMember + ? t('error.mustBeMemberToCreateProposal') + : // ...otherwise their membership doesn't matter and they aren't on the allowlist. + t('error.notAllowedToCreateProposal') + : undefined + : // If no pre-propose module in use, only DAO members can propose. + isMember + ? undefined + : t('error.mustBeMemberToCreateProposal') diff --git a/packages/utils/secret/client.ts b/packages/utils/secret/client.ts new file mode 100644 index 000000000..520aa625e --- /dev/null +++ b/packages/utils/secret/client.ts @@ -0,0 +1,289 @@ +import { + Code, + CodeDetails, + Contract, + ContractCodeHistoryEntry, + CosmWasmClient, + JsonObject, +} from '@cosmjs/cosmwasm-stargate' +import { toBech32 } from '@cosmjs/encoding' +import { CometClient, HttpEndpoint, connectComet } from '@cosmjs/tendermint-rpc' +import { assert } from '@cosmjs/utils' +import { + ContractCodeHistoryOperationType, + contractCodeHistoryOperationTypeFromJSON, +} from 'cosmjs-types/cosmwasm/wasm/v1/types' +import { + CreateClientOptions as CreateSecretNetworkClientOptions, + SecretNetworkClient, +} from 'secretjs' + +/** + * A wrapper around CosmWasmClient that uses secretjs under the hood for smart + * contract queries, to support Secret Network. + */ +export class SecretCosmWasmClient extends CosmWasmClient { + private readonly secretNetworkClient: SecretNetworkClient | undefined + private readonly secretCodesCache = new Map() + + /** + * Creates an instance by connecting to the given CometBFT RPC endpoint. + * + * This uses auto-detection to decide between a CometBFT 0.38, Tendermint 0.37 and 0.34 client. + * To set the Comet client explicitly, use `create`. + */ + public static async secretConnect( + endpoint: string | HttpEndpoint, + options: CreateSecretNetworkClientOptions + ): Promise { + const cometClient = await connectComet(endpoint) + return SecretCosmWasmClient.secretCreate(cometClient, options) + } + + /** + * Creates an instance from a manually created Comet client. + * Use this to use `Comet38Client` or `Tendermint37Client` instead of `Tendermint34Client`. + */ + public static async secretCreate( + cometClient: CometClient, + options: CreateSecretNetworkClientOptions + ): Promise { + return new SecretCosmWasmClient(cometClient, options) + } + + protected constructor( + cometClient: CometClient | undefined, + options: CreateSecretNetworkClientOptions + ) { + super(cometClient) + this.secretNetworkClient = new SecretNetworkClient(options) + } + + protected getSecretNetworkClient(): SecretNetworkClient | undefined { + return this.secretNetworkClient + } + + protected forceGetSecretNetworkClient(): SecretNetworkClient { + if (!this.secretNetworkClient) { + throw new Error( + 'Secret network client not available. You cannot use online functionality in offline mode.' + ) + } + return this.secretNetworkClient + } + + /** + * getCodes() returns all codes and is just looping through all pagination pages. + * + * This is potentially inefficient and advanced apps should consider creating + * their own query client to handle pagination together with the app's screens. + */ + public async getCodes(): Promise { + throw new Error('Unsupported by Secret Network') + } + + public async getCodeDetails(codeId: number): Promise { + const cached = this.secretCodesCache.get(codeId) + if (cached) return cached + + const { code_info: codeInfo, wasm } = + await this.forceGetSecretNetworkClient().query.compute.code({ + code_id: BigInt(codeId).toString(), + }) + assert( + codeInfo && + codeInfo.code_id && + codeInfo.creator && + codeInfo.code_hash && + wasm, + 'code_info missing or incomplete' + ) + const codeDetails: CodeDetails = { + id: Number(codeInfo.code_id), + creator: codeInfo.creator, + checksum: codeInfo.code_hash, + data: wasm, + } + this.secretCodesCache.set(codeId, codeDetails) + return codeDetails + } + + /** + * getContracts() returns all contract instances for one code and is just looping through all pagination pages. + * + * This is potentially inefficient and advanced apps should consider creating + * their own query client to handle pagination together with the app's screens. + */ + public async getContracts(codeId: number): Promise { + const { contract_infos } = await ( + await this.forceGetSecretNetworkClient() + ).query.compute.contractsByCodeId({ code_id: BigInt(codeId).toString() }) + + return ( + contract_infos?.flatMap( + ({ contract_address }) => contract_address || [] + ) || [] + ) + } + + /** + * Returns a list of contract addresses created by the given creator. + * This just loops through all pagination pages. + */ + public async getContractsByCreator(_creator: string): Promise { + throw new Error('Unsupported by Secret Network') + } + + /** + * Throws an error if no contract was found at the address + */ + public async getContract(address: string): Promise { + const { contract_address: retrievedAddress, contract_info: contractInfo } = + await this.forceGetSecretNetworkClient().query.compute.contractInfo({ + contract_address: address, + }) + if (!contractInfo) + throw new Error(`No contract found at address "${address}"`) + assert(retrievedAddress, 'address missing') + assert( + contractInfo.code_id && contractInfo.creator && contractInfo.label, + 'contractInfo incomplete' + ) + return { + address: retrievedAddress, + codeId: Number(contractInfo.code_id), + creator: contractInfo.creator + ? toBech32('secret', contractInfo.creator) + : '', + admin: contractInfo.admin || undefined, + label: contractInfo.label, + ibcPortId: contractInfo.ibc_port_id || undefined, + } + } + + /** + * Throws an error if no contract was found at the address + */ + public async getContractCodeHistory( + address: string + ): Promise { + const result = + await this.forceGetSecretNetworkClient().query.compute.contractHistory({ + contract_address: address, + }) + if (!result) + throw new Error(`No contract history found for address "${address}"`) + const operations: Record = { + [ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT]: + 'Init', + [ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS]: + 'Genesis', + [ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE]: + 'Migrate', + } + return (result.entries || []).map((entry): ContractCodeHistoryEntry => { + assert(entry.operation && entry.code_id && entry.msg) + return { + operation: + operations[contractCodeHistoryOperationTypeFromJSON(entry.operation)], + codeId: Number(entry.code_id), + msg: JSON.parse(entry.msg), + } + }) + } + + /** + * Returns the code hash for a given contract address. + * + * Promise is rejected if no code hash found. + */ + public async queryCodeHashForContractAddress( + address: string + ): Promise { + const { code_hash } = + await this.forceGetSecretNetworkClient().query.compute.codeHashByContractAddress( + { + contract_address: address, + } + ) + + if (!code_hash) { + throw new Error(`No code hash found for address "${address}"`) + } + + return code_hash + } + + /** + * Returns the data at the key if present (raw contract dependent storage data) + * or null if no data at this key. + * + * Promise is rejected when contract does not exist. + */ + public async queryContractRaw( + _address: string, + _key: Uint8Array + ): Promise { + throw new Error('Unsupported by Secret Network') + } + + /** + * Makes a smart query on the contract, returns the parsed JSON document. + * + * Promise is rejected when contract does not exist. + * Promise is rejected for invalid query format. + * Promise is rejected for invalid response format. + */ + public async queryContractSmart( + address: string, + queryMsg: JsonObject + ): Promise { + return await this.queryContractSmartWithCodeHash( + address, + undefined, + queryMsg + ) + } + + /** + * Makes a smart query on the contract, returns the parsed JSON document. + * + * Promise is rejected when contract does not exist. + * Promise is rejected for invalid query format. + * Promise is rejected for invalid response format. + */ + public async queryContractSmartWithCodeHash( + address: string, + codeHash: string | undefined, + queryMsg: JsonObject + ): Promise { + try { + const response = + await this.forceGetSecretNetworkClient().query.compute.queryContract({ + contract_address: address, + code_hash: codeHash, + query: queryMsg, + }) + + // secretjs' queryContract returns query errors as strings... rip + if ( + typeof response === 'string' && + response.includes('Error parsing into type') + ) { + throw new Error(response) + } + + return response + } catch (error) { + if (error instanceof Error) { + if (error.message.startsWith('not found: contract')) { + throw new Error(`No contract found at address "${address}"`) + } else { + throw error + } + } else { + throw error + } + } + } +} diff --git a/packages/utils/secret/contract.ts b/packages/utils/secret/contract.ts new file mode 100644 index 000000000..85437dabc --- /dev/null +++ b/packages/utils/secret/contract.ts @@ -0,0 +1,16 @@ +import { SecretAnyContractInfo } from '@dao-dao/types' + +/** + * Get address from a type that may be an address or a Secret network contract + * info object. + */ +export const extractAddressFromMaybeSecretContractInfo = ( + data: string | SecretAnyContractInfo +): string => { + const address = + typeof data === 'string' ? data : 'addr' in data ? data.addr : undefined + if (!address) { + throw new Error('No address found') + } + return address +} diff --git a/packages/utils/secret/index.ts b/packages/utils/secret/index.ts new file mode 100644 index 000000000..d2a4ed135 --- /dev/null +++ b/packages/utils/secret/index.ts @@ -0,0 +1,4 @@ +export * from './client' +export * from './contract' +export * from './permit' +export * from './signingClient' diff --git a/packages/utils/secret/permit.ts b/packages/utils/secret/permit.ts new file mode 100644 index 000000000..22853708b --- /dev/null +++ b/packages/utils/secret/permit.ts @@ -0,0 +1,86 @@ +import { OfflineAminoSigner, makeSignDoc } from '@cosmjs/amino' + +import { PermitForPermitData } from '@dao-dao/types' + +import { encodeJsonToBase64 } from '../messages' + +export type CreateSecretNetworkPermitOptions = { + /** + * Chain ID. + */ + chainId: string + /** + * Wallet address. + */ + address: string + /** + * Arbitrary string. + */ + key: string + /** + * Optional data object. Defaults to empty object. + */ + data?: Record + /** + * Offline Amino signer that corresponds with chain ID and wallet address. + */ + offlineSignerAmino: OfflineAminoSigner +} + +/** + * Function to create Secret Network permit. + */ +export const createSecretNetworkPermit = async ({ + chainId, + address, + key, + data = {}, + offlineSignerAmino, +}: CreateSecretNetworkPermitOptions): Promise => { + const encodedData = encodeJsonToBase64(data) + + // Generate data to sign. + const signDoc = makeSignDoc( + [ + { + type: 'signature_proof', + value: { + key, + data: encodedData, + }, + }, + ], + { + gas: '1', + amount: [ + { + denom: 'uscrt', + amount: '0', + }, + ], + }, + chainId, + '', + 0, + 0 + ) + + const { signed, signature } = await offlineSignerAmino.signAmino( + address, + signDoc + ) + + const permit: PermitForPermitData = { + account_number: signed.account_number, + chain_id: signed.chain_id, + memo: signed.memo, + params: { + key, + data: encodedData, + }, + sequence: signed.sequence, + signature, + } + + return permit +} diff --git a/packages/utils/secret/signingClient.ts b/packages/utils/secret/signingClient.ts new file mode 100644 index 000000000..9d0a240d1 --- /dev/null +++ b/packages/utils/secret/signingClient.ts @@ -0,0 +1,647 @@ +import { + ChangeAdminResult, + Code, + CodeDetails, + Contract, + ContractCodeHistoryEntry, + ExecuteInstruction, + InstantiateOptions, + InstantiateResult, + JsonObject, + SigningCosmWasmClient, + SigningCosmWasmClientOptions, + UploadResult, + createWasmAminoConverters, + wasmTypes, +} from '@cosmjs/cosmwasm-stargate' +import { sha256 } from '@cosmjs/crypto' +import { toBech32, toHex } from '@cosmjs/encoding' +import { OfflineSigner, Registry } from '@cosmjs/proto-signing' +import { + AminoTypes, + GasPrice, + StdFee, + createDefaultAminoConverters, + defaultRegistryTypes as defaultStargateTypes, + logs, +} from '@cosmjs/stargate' +import { findAttribute } from '@cosmjs/stargate/build/logs' +import { CometClient, HttpEndpoint, connectComet } from '@cosmjs/tendermint-rpc' +import { assert } from '@cosmjs/utils' +import { + AccessConfig, + ContractCodeHistoryOperationType, + contractCodeHistoryOperationTypeFromJSON, +} from 'cosmjs-types/cosmwasm/wasm/v1/types' +import pako from 'pako' +import { + CreateClientOptions as CreateSecretNetworkClientOptions, + MsgExecuteContract, + SecretNetworkClient, + TxResponse, +} from 'secretjs' + +import { + secretAminoConverters, + secretProtoRegistry, +} from '@dao-dao/types/protobuf' + +const isDeliverTxFailure = (result: TxResponse) => !!result.code +const createDeliverTxResponseErrorMessage = (result: TxResponse) => + `Error when broadcasting tx ${result.transactionHash} at height ${result.height}. Code: ${result.code}; Raw log: ${result.rawLog}` + +/** + * A wrapper around CosmWasmClient that uses secretjs under the hood for smart + * contract queries, to support Secret Network. + */ +export class SecretSigningCosmWasmClient extends SigningCosmWasmClient { + private readonly secretNetworkClient: SecretNetworkClient | undefined + private readonly secretCodesCache = new Map() + private readonly secretGasPrice: GasPrice | undefined + + /** + * Creates an instance by connecting to the given CometBFT RPC endpoint. + * + * This uses auto-detection to decide between a CometBFT 0.38, Tendermint 0.37 and 0.34 client. + * To set the Comet client explicitly, use `createWithSigner`. + */ + public static async secretConnectWithSigner( + endpoint: string | HttpEndpoint, + signer: OfflineSigner, + options: SigningCosmWasmClientOptions = {}, + secretOptions: CreateSecretNetworkClientOptions + ): Promise { + const cometClient = await connectComet(endpoint) + return SecretSigningCosmWasmClient.secretCreateWithSigner( + cometClient, + signer, + options, + secretOptions + ) + } + + /** + * Creates an instance from a manually created Comet client. + * Use this to use `Comet38Client` or `Tendermint37Client` instead of `Tendermint34Client`. + */ + public static async secretCreateWithSigner( + cometClient: CometClient, + signer: OfflineSigner, + options: SigningCosmWasmClientOptions = {}, + secretOptions: CreateSecretNetworkClientOptions + ): Promise { + return new SecretSigningCosmWasmClient( + cometClient, + signer, + options, + secretOptions + ) + } + + protected constructor( + cometClient: CometClient | undefined, + signer: OfflineSigner, + options: SigningCosmWasmClientOptions, + secretOptions: CreateSecretNetworkClientOptions + ) { + const registry = new Registry([ + // Fallback to default from @cosmjs/cosmwasm-stargate if not provided. + ...Object.entries( + options.registry?.['register'] || [ + ...defaultStargateTypes, + ...wasmTypes, + ] + ), + // Add Secret Network types to existing ones. + ...secretProtoRegistry, + ]) + + const aminoTypes = new AminoTypes({ + // Fallback to default from @cosmjs/cosmwasm-stargate if not provided. + ...(options.aminoTypes?.['register'] || { + ...createDefaultAminoConverters(), + ...createWasmAminoConverters(), + }), + // Add Secret Network amino types to existing ones. + ...secretAminoConverters, + }) + + super(cometClient, signer, { + ...options, + registry, + aminoTypes, + }) + + this.secretGasPrice = options.gasPrice + + this.secretNetworkClient = new SecretNetworkClient(secretOptions) + } + + protected getSecretNetworkClient(): SecretNetworkClient | undefined { + return this.secretNetworkClient + } + + protected forceGetSecretNetworkClient(): SecretNetworkClient { + if (!this.secretNetworkClient) { + throw new Error( + 'Secret network client not available. You cannot use online functionality in offline mode.' + ) + } + return this.secretNetworkClient + } + + /** + * getCodes() returns all codes and is just looping through all pagination pages. + * + * This is potentially inefficient and advanced apps should consider creating + * their own query client to handle pagination together with the app's screens. + */ + public async getCodes(): Promise { + throw new Error('Unsupported by Secret Network') + } + + public async getCodeDetails(codeId: number): Promise { + const cached = this.secretCodesCache.get(codeId) + if (cached) return cached + + const { code_info: codeInfo, wasm } = + await this.forceGetSecretNetworkClient().query.compute.code({ + code_id: BigInt(codeId).toString(), + }) + assert( + codeInfo && + codeInfo.code_id && + codeInfo.creator && + codeInfo.code_hash && + wasm, + 'code_info missing or incomplete' + ) + const codeDetails: CodeDetails = { + id: Number(codeInfo.code_id), + creator: codeInfo.creator, + checksum: codeInfo.code_hash, + data: wasm, + } + this.secretCodesCache.set(codeId, codeDetails) + return codeDetails + } + + /** + * getContracts() returns all contract instances for one code and is just looping through all pagination pages. + * + * This is potentially inefficient and advanced apps should consider creating + * their own query client to handle pagination together with the app's screens. + */ + public async getContracts(codeId: number): Promise { + const { contract_infos } = await ( + await this.forceGetSecretNetworkClient() + ).query.compute.contractsByCodeId({ code_id: BigInt(codeId).toString() }) + + return ( + contract_infos?.flatMap( + ({ contract_address }) => contract_address || [] + ) || [] + ) + } + + /** + * Returns a list of contract addresses created by the given creator. + * This just loops through all pagination pages. + */ + public async getContractsByCreator(_creator: string): Promise { + throw new Error('Unsupported by Secret Network') + } + + /** + * Throws an error if no contract was found at the address + */ + public async getContract(address: string): Promise { + const { contract_address: retrievedAddress, contract_info: contractInfo } = + await this.forceGetSecretNetworkClient().query.compute.contractInfo({ + contract_address: address, + }) + if (!contractInfo) + throw new Error(`No contract found at address "${address}"`) + assert(retrievedAddress, 'address missing') + assert( + contractInfo.code_id && contractInfo.creator && contractInfo.label, + 'contractInfo incomplete' + ) + return { + address: retrievedAddress, + codeId: Number(contractInfo.code_id), + creator: contractInfo.creator + ? toBech32('secret', contractInfo.creator) + : '', + admin: contractInfo.admin || undefined, + label: contractInfo.label, + ibcPortId: contractInfo.ibc_port_id || undefined, + } + } + + /** + * Throws an error if no contract was found at the address + */ + public async getContractCodeHistory( + address: string + ): Promise { + const result = + await this.forceGetSecretNetworkClient().query.compute.contractHistory({ + contract_address: address, + }) + if (!result) + throw new Error(`No contract history found for address "${address}"`) + const operations: Record = { + [ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT]: + 'Init', + [ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS]: + 'Genesis', + [ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE]: + 'Migrate', + } + return (result.entries || []).map((entry): ContractCodeHistoryEntry => { + assert(entry.operation && entry.code_id && entry.msg) + return { + operation: + operations[contractCodeHistoryOperationTypeFromJSON(entry.operation)], + codeId: Number(entry.code_id), + msg: JSON.parse(entry.msg), + } + }) + } + + /** + * Returns the data at the key if present (raw contract dependent storage data) + * or null if no data at this key. + * + * Promise is rejected when contract does not exist. + */ + public async queryContractRaw( + _address: string, + _key: Uint8Array + ): Promise { + throw new Error('Unsupported by Secret Network') + } + + /** + * Makes a smart query on the contract, returns the parsed JSON document. + * + * Promise is rejected when contract does not exist. + * Promise is rejected for invalid query format. + * Promise is rejected for invalid response format. + */ + public async queryContractSmart( + address: string, + queryMsg: JsonObject + ): Promise { + return await this.queryContractSmartWithCodeHash( + address, + undefined, + queryMsg + ) + } + + /** + * Makes a smart query on the contract, returns the parsed JSON document. + * + * Promise is rejected when contract does not exist. + * Promise is rejected for invalid query format. + * Promise is rejected for invalid response format. + */ + public async queryContractSmartWithCodeHash( + address: string, + codeHash: string | undefined, + queryMsg: JsonObject + ): Promise { + try { + const response = + await this.forceGetSecretNetworkClient().query.compute.queryContract({ + contract_address: address, + code_hash: codeHash, + query: queryMsg, + }) + + // secretjs' queryContract returns query errors as strings... rip + if ( + typeof response === 'string' && + response.includes('Error parsing into type') + ) { + throw new Error(response) + } + + return response + } catch (error) { + if (error instanceof Error) { + if (error.message.startsWith('not found: contract')) { + throw new Error(`No contract found at address "${address}"`) + } else { + throw error + } + } else { + throw error + } + } + } + + /** Uploads code and returns a receipt, including the code ID */ + public async upload( + senderAddress: string, + wasmCode: Uint8Array, + fee: StdFee | 'auto' | number, + memo = '', + // Unused. + _instantiatePermission?: AccessConfig + ): Promise { + if (typeof fee !== 'number') { + throw new Error( + 'Secret Network signing client requires a numeric fee to use as the gasLimit.' + ) + } + + const result = + await this.forceGetSecretNetworkClient().tx.compute.storeCode( + { + sender: senderAddress, + wasm_byte_code: wasmCode, + source: '', + builder: '', + }, + { + gasLimit: fee, + gasPriceInFeeDenom: + this.secretGasPrice?.amount.toFloatApproximation(), + memo, + } + ) + + if (isDeliverTxFailure(result)) { + throw new Error(createDeliverTxResponseErrorMessage(result)) + } + + const parsedLogs = logs.parseRawLog(result.rawLog) + const codeIdAttr = findAttribute(parsedLogs, 'store_code', 'code_id') + + // compression used by secretjs + const compressed = pako.gzip(wasmCode, { level: 9 }) + + return { + checksum: toHex(sha256(wasmCode)), + originalSize: wasmCode.length, + compressedSize: compressed.length, + codeId: Number.parseInt(codeIdAttr.value, 10), + logs: parsedLogs, + height: result.height, + transactionHash: result.transactionHash, + events: result.jsonLog?.flatMap((log) => log.events) || [], + gasWanted: BigInt(Math.round(result.gasWanted)), + gasUsed: BigInt(Math.round(result.gasUsed)), + } + } + + public async instantiate( + senderAddress: string, + codeId: number, + msg: JsonObject, + label: string, + fee: StdFee | 'auto' | number, + options: InstantiateOptions = {} + ): Promise { + if (typeof fee !== 'number') { + throw new Error( + 'Secret Network signing client requires a numeric fee to use as the gasLimit.' + ) + } + + const result = + await this.forceGetSecretNetworkClient().tx.compute.instantiateContract( + { + sender: senderAddress, + code_id: codeId, + label, + init_msg: msg, + init_funds: [...(options.funds || [])], + admin: options.admin, + }, + { + gasLimit: fee, + gasPriceInFeeDenom: + this.secretGasPrice?.amount.toFloatApproximation(), + memo: options.memo, + } + ) + + if (isDeliverTxFailure(result)) { + throw new Error(createDeliverTxResponseErrorMessage(result)) + } + + const parsedLogs = logs.parseRawLog(result.rawLog) + + const contractAddressAttr = findAttribute( + parsedLogs, + 'instantiate', + '_contract_address' + ) + + return { + contractAddress: contractAddressAttr.value, + logs: parsedLogs, + height: result.height, + transactionHash: result.transactionHash, + events: result.jsonLog?.flatMap((log) => log.events) || [], + gasWanted: BigInt(Math.round(result.gasWanted)), + gasUsed: BigInt(Math.round(result.gasUsed)), + } + } + + public async instantiate2( + _senderAddress: string, + _codeId: number, + _salt: Uint8Array, + _msg: JsonObject, + _label: string, + _fee: StdFee | 'auto' | number, + _options: InstantiateOptions = {} + ): Promise { + throw new Error('Unsupported by Secret Network') + } + + public async updateAdmin( + senderAddress: string, + contractAddress: string, + newAdmin: string, + fee: StdFee | 'auto' | number, + memo = '' + ): Promise { + if (typeof fee !== 'number') { + throw new Error( + 'Secret Network signing client requires a numeric fee to use as the gasLimit.' + ) + } + + const result = + await this.forceGetSecretNetworkClient().tx.compute.updateAdmin( + { + sender: senderAddress, + contract_address: contractAddress, + new_admin: newAdmin, + }, + { + gasLimit: fee, + gasPriceInFeeDenom: + this.secretGasPrice?.amount.toFloatApproximation(), + memo, + } + ) + + if (isDeliverTxFailure(result)) { + throw new Error(createDeliverTxResponseErrorMessage(result)) + } + + const parsedLogs = logs.parseRawLog(result.rawLog) + + return { + logs: parsedLogs, + height: result.height, + transactionHash: result.transactionHash, + events: result.jsonLog?.flatMap((log) => log.events) || [], + gasWanted: BigInt(Math.round(result.gasWanted)), + gasUsed: BigInt(Math.round(result.gasUsed)), + } + } + + public async clearAdmin( + senderAddress: string, + contractAddress: string, + fee: StdFee | 'auto' | number, + memo = '' + ): Promise { + if (typeof fee !== 'number') { + throw new Error( + 'Secret Network signing client requires a numeric fee to use as the gasLimit.' + ) + } + + const result = + await this.forceGetSecretNetworkClient().tx.compute.clearAdmin( + { + sender: senderAddress, + contract_address: contractAddress, + }, + { + gasLimit: fee, + gasPriceInFeeDenom: + this.secretGasPrice?.amount.toFloatApproximation(), + memo, + } + ) + + if (isDeliverTxFailure(result)) { + throw new Error(createDeliverTxResponseErrorMessage(result)) + } + + const parsedLogs = logs.parseRawLog(result.rawLog) + + return { + logs: parsedLogs, + height: result.height, + transactionHash: result.transactionHash, + events: result.jsonLog?.flatMap((log) => log.events) || [], + gasWanted: BigInt(Math.round(result.gasWanted)), + gasUsed: BigInt(Math.round(result.gasUsed)), + } + } + + public async migrate( + senderAddress: string, + contractAddress: string, + codeId: number, + migrateMsg: JsonObject, + fee: StdFee | 'auto' | number, + memo = '' + ): Promise { + if (typeof fee !== 'number') { + throw new Error( + 'Secret Network signing client requires a numeric fee to use as the gasLimit.' + ) + } + + const result = + await this.forceGetSecretNetworkClient().tx.compute.migrateContract( + { + sender: senderAddress, + contract_address: contractAddress, + code_id: codeId, + msg: migrateMsg, + }, + { + gasLimit: fee, + gasPriceInFeeDenom: + this.secretGasPrice?.amount.toFloatApproximation(), + memo, + } + ) + + if (isDeliverTxFailure(result)) { + throw new Error(createDeliverTxResponseErrorMessage(result)) + } + + const parsedLogs = logs.parseRawLog(result.rawLog) + + return { + logs: parsedLogs, + height: result.height, + transactionHash: result.transactionHash, + events: result.jsonLog?.flatMap((log) => log.events) || [], + gasWanted: BigInt(Math.round(result.gasWanted)), + gasUsed: BigInt(Math.round(result.gasUsed)), + } + } + + /** + * Like `execute` but allows executing multiple messages in one transaction. + */ + public async executeMultiple( + senderAddress: string, + instructions: readonly ExecuteInstruction[], + fee: StdFee | 'auto' | number, + memo = '' + ): Promise { + if (typeof fee !== 'number') { + throw new Error( + 'Secret Network signing client requires a numeric fee to use as the gasLimit.' + ) + } + + const msgs = instructions.map( + ({ contractAddress, msg, funds }) => + new MsgExecuteContract({ + sender: senderAddress, + contract_address: contractAddress, + msg, + sent_funds: [...(funds || [])], + code_hash: undefined, + }) + ) + + const result = await this.forceGetSecretNetworkClient().tx.broadcast(msgs, { + gasLimit: fee, + gasPriceInFeeDenom: this.secretGasPrice?.amount.toFloatApproximation(), + memo, + }) + + if (isDeliverTxFailure(result)) { + throw new Error(createDeliverTxResponseErrorMessage(result)) + } + + const parsedLogs = logs.parseRawLog(result.rawLog) + + return { + logs: parsedLogs, + height: result.height, + transactionHash: result.transactionHash, + events: result.jsonLog?.flatMap((log) => log.events) || [], + gasWanted: BigInt(Math.round(result.gasWanted)), + gasUsed: BigInt(Math.round(result.gasUsed)), + } + } +} diff --git a/packages/utils/cosmos_msg.json b/packages/utils/validation/cosmos_msg.json similarity index 88% rename from packages/utils/cosmos_msg.json rename to packages/utils/validation/cosmos_msg.json index b3efef912..6a145b280 100644 --- a/packages/utils/cosmos_msg.json +++ b/packages/utils/validation/cosmos_msg.json @@ -143,7 +143,7 @@ ] }, "Binary": { - "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec", + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", "type": "string" }, "Coin": { @@ -204,6 +204,7 @@ "type": "object" }, "GovMsg": { + "description": "This message type allows the contract interact with the [x/gov] module in order to cast votes.\n\n[x/gov]: https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov\n\n## Examples\n\nCast a simple vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); use cosmwasm_std::{GovMsg, VoteOption};\n\n#[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result { // ... Ok(Response::new().add_message(GovMsg::Vote { proposal_id: 4, vote: VoteOption::Yes, })) } ```\n\nCast a weighted vote:\n\n``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); # #[cfg(feature = \"cosmwasm_1_2\")] use cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption};\n\n# #[cfg(feature = \"cosmwasm_1_2\")] #[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result { // ... Ok(Response::new().add_message(GovMsg::VoteWeighted { proposal_id: 4, options: vec![ WeightedVoteOption { option: VoteOption::Yes, weight: Decimal::percent(65), }, WeightedVoteOption { option: VoteOption::Abstain, weight: Decimal::percent(35), }, ], })) } ```", "oneOf": [ { "description": "This maps directly to [MsgVote](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/gov/v1beta1/tx.proto#L46-L56) in the Cosmos SDK with voter set to the contract address.", @@ -219,7 +220,12 @@ "minimum": 0.0 }, "vote": { - "$ref": "#/definitions/VoteOption" + "description": "The vote option.\n\nThis should be called \"option\" for consistency with Cosmos SDK. Sorry for that. See .", + "allOf": [ + { + "$ref": "#/definitions/VoteOption" + } + ] } } } @@ -249,7 +255,7 @@ ] }, "channel_id": { - "description": "exisiting channel to send the tokens over", + "description": "existing channel to send the tokens over", "type": "string" }, "timeout": { @@ -353,7 +359,7 @@ "minimum": 0.0 }, "revision": { - "description": "the version that the client is currently on (eg. after reseting the chain this could increment 1 as height drops to 0)", + "description": "the version that the client is currently on (e.g. after resetting the chain this could increment 1 as height drops to 0)", "type": "integer", "minimum": 0.0 } @@ -482,7 +488,7 @@ "additionalProperties": false }, { - "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha1/x/wasm/internal/types/tx.proto#L47-L61). `sender` is automatically filled with the current contract's address.", + "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThe contract address is non-predictable. But it is guaranteed that when emitting the same Instantiate message multiple times, multiple instances on different addresses will be generated. See also Instantiate2.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L53-L71). `sender` is automatically filled with the current contract's address.", "type": "object", "required": ["instantiate"], "properties": { @@ -504,7 +510,7 @@ } }, "label": { - "description": "A human-readbale label for the contract", + "description": "A human-readable label for the contract.\n\nValid values should: - not be empty - not be bigger than 128 bytes (or some chain-specific limit) - not start / end with whitespace", "type": "string" }, "msg": { diff --git a/packages/utils/validation/cosmos_msg.secret.json b/packages/utils/validation/cosmos_msg.secret.json new file mode 100644 index 000000000..ce9d3eea8 --- /dev/null +++ b/packages/utils/validation/cosmos_msg.secret.json @@ -0,0 +1,626 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CosmosMsg", + "oneOf": [ + { + "type": "object", + "required": ["bank"], + "properties": { + "bank": { + "$ref": "#/definitions/BankMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": ["custom"], + "properties": { + "custom": { + "$ref": "#/definitions/Empty" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": ["staking"], + "properties": { + "staking": { + "$ref": "#/definitions/StakingMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": ["distribution"], + "properties": { + "distribution": { + "$ref": "#/definitions/DistributionMsg" + } + }, + "additionalProperties": false + }, + { + "description": "A Stargate message encoded the same way as a protobuf [Any](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto). This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md)", + "type": "object", + "required": ["stargate"], + "properties": { + "stargate": { + "type": "object", + "required": ["type_url", "value"], + "properties": { + "type_url": { + "description": "this is the fully qualified msg path used for routing, e.g. /cosmos.bank.v1beta1.MsgSend NOTE: the type_url can be changed after a chain upgrade", + "type": "string" + }, + "value": { + "$ref": "#/definitions/Binary" + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": ["ibc"], + "properties": { + "ibc": { + "$ref": "#/definitions/IbcMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": ["wasm"], + "properties": { + "wasm": { + "$ref": "#/definitions/WasmMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": ["gov"], + "properties": { + "gov": { + "$ref": "#/definitions/GovMsg" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": ["finalize_tx"], + "properties": { + "finalize_tx": { + "$ref": "#/definitions/Empty" + } + }, + "additionalProperties": false + } + ], + "definitions": { + "BankMsg": { + "description": "The message types of the bank module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto", + "oneOf": [ + { + "description": "Sends native tokens from the contract to the given address.\n\nThis is translated to a [MsgSend](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto#L19-L28). `from_address` is automatically filled with the current contract's address.", + "type": "object", + "required": ["send"], + "properties": { + "send": { + "type": "object", + "required": ["amount", "to_address"], + "properties": { + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + }, + "to_address": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "This will burn the given coins from the contract's account. There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. Important if a contract controls significant token supply that must be retired.", + "type": "object", + "required": ["burn"], + "properties": { + "burn": { + "type": "object", + "required": ["amount"], + "properties": { + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false + } + ] + }, + "Binary": { + "description": "Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also .", + "type": "string" + }, + "Coin": { + "type": "object", + "required": ["amount", "denom"], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "DistributionMsg": { + "description": "The message types of the distribution module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto", + "oneOf": [ + { + "description": "This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": ["set_withdraw_address"], + "properties": { + "set_withdraw_address": { + "type": "object", + "required": ["address"], + "properties": { + "address": { + "description": "The `withdraw_address`", + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": ["withdraw_delegator_reward"], + "properties": { + "withdraw_delegator_reward": { + "type": "object", + "required": ["validator"], + "properties": { + "validator": { + "description": "The `validator_address`", + "type": "string" + } + } + } + }, + "additionalProperties": false + } + ] + }, + "Empty": { + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object" + }, + "GovMsg": { + "oneOf": [ + { + "description": "This maps directly to [MsgVote](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/gov/v1beta1/tx.proto#L46-L56) in the Cosmos SDK with voter set to the contract address.", + "type": "object", + "required": ["vote"], + "properties": { + "vote": { + "type": "object", + "required": ["proposal_id", "vote"], + "properties": { + "proposal_id": { + "type": "integer", + "minimum": 0.0 + }, + "vote": { + "$ref": "#/definitions/VoteOption" + } + } + } + }, + "additionalProperties": false + } + ] + }, + "IbcMsg": { + "description": "These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts (contracts that directly speak the IBC protocol via 6 entry points)", + "oneOf": [ + { + "description": "Sends bank tokens owned by the contract to the given address on another chain. The channel must already be established between the ibctransfer module on this chain and a matching module on the remote chain. We cannot select the port_id, this is whatever the local chain has bound the ibctransfer module to.", + "type": "object", + "required": ["transfer"], + "properties": { + "transfer": { + "type": "object", + "required": [ + "amount", + "channel_id", + "memo", + "timeout", + "to_address" + ], + "properties": { + "amount": { + "description": "packet data only supports one coin https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/applications/transfer/v1/transfer.proto#L11-L20", + "allOf": [ + { + "$ref": "#/definitions/Coin" + } + ] + }, + "channel_id": { + "description": "exisiting channel to send the tokens over", + "type": "string" + }, + "memo": { + "description": "optional memo can put here `{\"ibc_callback\":\"secret1contractAddr\"}` to get a callback on ack/timeout see this for more info: https://github.com/scrtlabs/SecretNetwork/blob/78a5f82a4/x/ibc-hooks/README.md?plain=1#L144-L188", + "type": "string" + }, + "timeout": { + "description": "when packet times out, measured on remote chain", + "allOf": [ + { + "$ref": "#/definitions/IbcTimeout" + } + ] + }, + "to_address": { + "description": "address on the remote chain to receive these tokens", + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Sends an IBC packet with given data over the existing channel. Data should be encoded in a format defined by the channel version, and the module on the other side should know how to parse this.", + "type": "object", + "required": ["send_packet"], + "properties": { + "send_packet": { + "type": "object", + "required": ["channel_id", "data", "timeout"], + "properties": { + "channel_id": { + "type": "string" + }, + "data": { + "$ref": "#/definitions/Binary" + }, + "timeout": { + "description": "when packet times out, measured on remote chain", + "allOf": [ + { + "$ref": "#/definitions/IbcTimeout" + } + ] + } + } + } + }, + "additionalProperties": false + }, + { + "description": "This will close an existing channel that is owned by this contract. Port is auto-assigned to the contract's IBC port", + "type": "object", + "required": ["close_channel"], + "properties": { + "close_channel": { + "type": "object", + "required": ["channel_id"], + "properties": { + "channel_id": { + "type": "string" + } + } + } + }, + "additionalProperties": false + } + ] + }, + "IbcTimeout": { + "description": "In IBC each package must set at least one type of timeout: the timestamp or the block height. Using this rather complex enum instead of two timeout fields we ensure that at least one timeout is set.", + "type": "object", + "properties": { + "block": { + "anyOf": [ + { + "$ref": "#/definitions/IbcTimeoutBlock" + }, + { + "type": "null" + } + ] + }, + "timestamp": { + "anyOf": [ + { + "$ref": "#/definitions/Timestamp" + }, + { + "type": "null" + } + ] + } + } + }, + "IbcTimeoutBlock": { + "description": "IBCTimeoutHeight Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients. Ordering is (revision_number, timeout_height)", + "type": "object", + "required": ["height", "revision"], + "properties": { + "height": { + "description": "block height after which the packet times out. the height within the given revision", + "type": "integer", + "minimum": 0.0 + }, + "revision": { + "description": "the version that the client is currently on (eg. after reseting the chain this could increment 1 as height drops to 0)", + "type": "integer", + "minimum": 0.0 + } + } + }, + "StakingMsg": { + "description": "The message types of the staking module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto", + "oneOf": [ + { + "description": "This is translated to a [MsgDelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L81-L90). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": ["delegate"], + "properties": { + "delegate": { + "type": "object", + "required": ["amount", "validator"], + "properties": { + "amount": { + "$ref": "#/definitions/Coin" + }, + "validator": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [MsgUndelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L112-L121). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": ["undelegate"], + "properties": { + "undelegate": { + "type": "object", + "required": ["amount", "validator"], + "properties": { + "amount": { + "$ref": "#/definitions/Coin" + }, + "validator": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "This is translated to a [MsgBeginRedelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105). `delegator_address` is automatically filled with the current contract's address.", + "type": "object", + "required": ["redelegate"], + "properties": { + "redelegate": { + "type": "object", + "required": ["amount", "dst_validator", "src_validator"], + "properties": { + "amount": { + "$ref": "#/definitions/Coin" + }, + "dst_validator": { + "type": "string" + }, + "src_validator": { + "type": "string" + } + } + } + }, + "additionalProperties": false + } + ] + }, + "Timestamp": { + "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use secret_cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", + "allOf": [ + { + "$ref": "#/definitions/Uint64" + } + ] + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use secret_cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + }, + "Uint64": { + "description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use secret_cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```", + "type": "string" + }, + "VoteOption": { + "type": "string", + "enum": ["yes", "no", "abstain", "no_with_veto"] + }, + "WasmMsg": { + "description": "The message types of the wasm module.\n\nSee https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto", + "oneOf": [ + { + "description": "Dispatches a call to another contract at a known address (with known ABI).\n\nThis is translated to a [MsgExecuteContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L68-L78). `sender` is automatically filled with the current contract's address.", + "type": "object", + "required": ["execute"], + "properties": { + "execute": { + "type": "object", + "required": ["code_hash", "contract_addr", "msg", "send"], + "properties": { + "code_hash": { + "description": "code_hash is the hex encoded hash of the code. This is used by Secret Network to harden against replaying the contract It is used to bind the request to a destination contract in a stronger way than just the contract address which can be faked", + "type": "string" + }, + "contract_addr": { + "type": "string" + }, + "msg": { + "description": "msg is the json-encoded ExecuteMsg struct (as raw Binary)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "send": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Instantiates a new contracts from previously uploaded Wasm code.\n\nThis is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.16.0-alpha1/x/wasm/internal/types/tx.proto#L47-L61). `sender` is automatically filled with the current contract's address.", + "type": "object", + "required": ["instantiate"], + "properties": { + "instantiate": { + "type": "object", + "required": ["code_hash", "code_id", "label", "msg", "send"], + "properties": { + "admin": { + "type": ["string", "null"] + }, + "code_hash": { + "description": "code_hash is the hex encoded hash of the code. This is used by Secret Network to harden against replaying the contract It is used to bind the request to a destination contract in a stronger way than just the contract address which can be faked", + "type": "string" + }, + "code_id": { + "type": "integer", + "minimum": 0.0 + }, + "label": { + "description": "A human-readbale label for the contract, must be unique across all contracts", + "type": "string" + }, + "msg": { + "description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + }, + "send": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to customize behavior.\n\nOnly the contract admin (as defined in wasmd), if any, is able to make this call.\n\nThis is translated to a [MsgMigrateContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L86-L96). `sender` is automatically filled with the current contract's address.", + "type": "object", + "required": ["migrate"], + "properties": { + "migrate": { + "type": "object", + "required": ["code_hash", "code_id", "contract_addr", "msg"], + "properties": { + "code_hash": { + "description": "code_hash is the hex encoded hash of the **new** code. This is used by Secret Network to harden against replaying the contract It is used to bind the request to a destination contract in a stronger way than just the contract address which can be faked", + "type": "string" + }, + "code_id": { + "description": "the code_id of the **new** logic to place in the given contract", + "type": "integer", + "minimum": 0.0 + }, + "contract_addr": { + "type": "string" + }, + "msg": { + "description": "msg is the json-encoded MigrateMsg struct that will be passed to the new code", + "allOf": [ + { + "$ref": "#/definitions/Binary" + } + ] + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Sets a new admin (for migrate) on the given contract. Fails if this contract is not currently admin of the target contract.", + "type": "object", + "required": ["update_admin"], + "properties": { + "update_admin": { + "type": "object", + "required": ["admin", "contract_addr"], + "properties": { + "admin": { + "type": "string" + }, + "contract_addr": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Clears the admin on the given contract, so no more migration possible. Fails if this contract is not currently admin of the target contract.", + "type": "object", + "required": ["clear_admin"], + "properties": { + "clear_admin": { + "type": "object", + "required": ["contract_addr"], + "properties": { + "contract_addr": { + "type": "string" + } + } + } + }, + "additionalProperties": false + } + ] + } + } +} diff --git a/packages/utils/validation/index.ts b/packages/utils/validation/index.ts index 5666982d6..d22597551 100644 --- a/packages/utils/validation/index.ts +++ b/packages/utils/validation/index.ts @@ -7,8 +7,10 @@ import { isValidValidatorAddress, } from '../address' import { isValidNativeTokenDenom } from '../assets' -import cosmosMsgSchema from '../cosmos_msg.json' +import { isSecretNetwork } from '../chain' import { isValidUrl } from '../isValidUrl' +import cosmosMsgSchema from './cosmos_msg.json' +import secretCosmosMsgSchema from './cosmos_msg.secret.json' import { makeValidateMsg } from './makeValidateMsg' export * from './makeValidateMsg' @@ -77,6 +79,15 @@ export const validateJSON = (v: string) => { } export const validateCosmosMsg = makeValidateMsg(cosmosMsgSchema) +export const validateSecretCosmosMsg = makeValidateMsg(secretCosmosMsgSchema) + +export const validateCosmosMsgForChain = ( + chainId: string, + obj: Record +) => + isSecretNetwork(chainId) + ? validateSecretCosmosMsg(obj) + : validateCosmosMsg(obj) export const validateTokenSymbol = (v: string) => /^[a-zA-Z\-]{3,12}$/.test(v) || diff --git a/yarn.lock b/yarn.lock index 0ab3c07d7..e34c8525e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2179,6 +2179,15 @@ elliptic "^6.5.4" libsodium-wrappers-sumo "^0.7.11" +"@cosmjs/encoding@0.27.1": + version "0.27.1" + resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.27.1.tgz#3cd5bc0af743485eb2578cdb08cfa84c86d610e1" + integrity sha512-rayLsA0ojHeniaRfWWcqSsrE/T1rl1gl0OXVNtXlPwLJifKBeLEefGbOUiAQaT0wgJ8VNGBazVtAZBpJidfDhw== + dependencies: + base64-js "^1.3.0" + bech32 "^1.1.4" + readonly-date "^1.0.0" + "@cosmjs/encoding@^0.32.1", "@cosmjs/encoding@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.32.3.tgz#e245ff511fe4a0df7ba427b5187aab69e3468e5b" @@ -2203,6 +2212,13 @@ "@cosmjs/stream" "^0.32.3" xstream "^11.14.0" +"@cosmjs/math@0.27.1": + version "0.27.1" + resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.27.1.tgz#be78857b008ffc6b1ed6fecaa1c4cd5bc38c07d7" + integrity sha512-cHWVjmfIjtRc7f80n7x+J5k8pe+vTVTQ0lA82tIxUgqUvgS6rogPP/TmGtTiZ4+NxWxd11DUISY6gVpr18/VNQ== + dependencies: + bn.js "^5.2.0" + "@cosmjs/math@^0.32.1", "@cosmjs/math@^0.32.3": version "0.32.3" resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.32.3.tgz#16e4256f4da507b9352327da12ae64056a2ba6c9" @@ -5639,23 +5655,45 @@ dependencies: "@noble/hashes" "1.3.3" -"@noble/curves@^1.0.0", "@noble/curves@^1.4.0": +"@noble/curves@^1.0.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" + integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== + dependencies: + "@noble/hashes" "1.3.2" + +"@noble/curves@^1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.4.0.tgz#f05771ef64da724997f69ee1261b2417a49522d6" integrity sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg== dependencies: "@noble/hashes" "1.4.0" +"@noble/hashes@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.0.0.tgz#d5e38bfbdaba174805a4e649f13be9a9ed3351ae" + integrity sha512-DZVbtY62kc3kkBtMHqwCOfXrT/hnoORy5BJ4+HU1IR59X0KWAOqsfzQPcUl/lQLlG7qXbe/fZ3r/emxtAl+sqg== + +"@noble/hashes@1.3.2", "@noble/hashes@^1", "@noble/hashes@^1.0.0", "@noble/hashes@^1.2.0", "@noble/hashes@^1.3.1": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" + integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== + "@noble/hashes@1.3.3", "@noble/hashes@~1.3.2": version "1.3.3" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.3.tgz#39908da56a4adc270147bb07968bf3b16cfe1699" integrity sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA== -"@noble/hashes@1.4.0", "@noble/hashes@^1", "@noble/hashes@^1.0.0", "@noble/hashes@^1.2.0", "@noble/hashes@^1.3.1", "@noble/hashes@^1.4.0": +"@noble/hashes@1.4.0", "@noble/hashes@^1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== +"@noble/secp256k1@1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.0.tgz#d15357f7c227e751d90aa06b05a0e5cf993ba8c1" + integrity sha512-kbacwGSsH/CTout0ZnZWxnW1B+jH/7r/WAAKLBtrRJ/+CUH7lgmQzl3GTrQua3SGKWNSDsS6lmjnDpIJ5Dxyaw== + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -8826,6 +8864,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== +"@types/node@11.11.6": + version "11.11.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.6.tgz#df929d1bb2eee5afdda598a41930fe50b43eaa6a" + integrity sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ== + "@types/node@^12.12.54": version "12.20.55" resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240" @@ -8858,6 +8901,11 @@ resolved "https://registry.yarnpkg.com/@types/npmlog/-/npmlog-4.1.4.tgz#30eb872153c7ead3e8688c476054ddca004115f6" integrity sha512-WKG4gTr8przEZBiJ5r3s8ZIAoMXNbOgQ+j/d5O4X3x6kZJRLNvyUJuUK/KoG3+8BaOHPhp2m7WC6JKKeovDSzQ== +"@types/pako@^2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@types/pako/-/pako-2.0.3.tgz#b6993334f3af27c158f3fe0dfeeba987c578afb1" + integrity sha512-bq0hMV9opAcrmE0Byyo0fY3Ew4tgOevJmQ9grUhpXQhYfyLJ1Kqg3P33JT5fdbT2AjeAjR51zqqVjAL/HMkx7Q== + "@types/papaparse@^5.3.7": version "5.3.7" resolved "https://registry.yarnpkg.com/@types/papaparse/-/papaparse-5.3.7.tgz#8d3bf9e62ac2897df596f49d9ca59a15451aa247" @@ -11047,7 +11095,7 @@ bech32@1.1.4, bech32@^1.1.4: resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== -bech32@^2.0.0: +bech32@2.0.0, bech32@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/bech32/-/bech32-2.0.0.tgz#078d3686535075c8c79709f054b1b226a133b355" integrity sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg== @@ -11069,12 +11117,7 @@ bfs-path@^1.0.2: resolved "https://registry.yarnpkg.com/bfs-path/-/bfs-path-1.0.2.tgz#9b5fa4b8c4ad226597fc4d2ee15398bdcc644a07" integrity sha512-KTKx2JJtAAAT7C/rJYDXXWA2VLPycAS4kwFktKsxUo0hj4UTtw/Gm5PJuY7Uf3xSlIQNo7HRCSWei2ivncVwbQ== -big-integer@^1.6.48: - version "1.6.52" - resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.52.tgz#60a887f3047614a8e1bffe5d7173490a97dc8c85" - integrity sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg== - -big-integer@^1.6.7: +big-integer@1.6.51, big-integer@^1.6.48, big-integer@^1.6.7: version "1.6.51" resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.51.tgz#0df92a5d9880560d3ff2d5fd20245c889d130686" integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg== @@ -11091,6 +11134,11 @@ bigint-buffer@^1.1.5: dependencies: bindings "^1.3.0" +bignumber.js@9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.2.tgz#71c6c6bed38de64e24a65ebe16cfcf23ae693673" + integrity sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw== + bignumber.js@9.1.2, bignumber.js@^9.1.2: version "9.1.2" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.2.tgz#b7c4242259c008903b13707983b5f4bbd31eda0c" @@ -11135,7 +11183,7 @@ bip32-path@^0.4.2: resolved "https://registry.yarnpkg.com/bip32-path/-/bip32-path-0.4.2.tgz#5db0416ad6822712f077836e2557b8697c0c7c99" integrity sha512-ZBMCELjJfcNMkz5bDuJ1WrYvjlhEF5k6mQ8vUr4N7MbVRsXei7ZOg8VhhwMfNiW68NWmLkgkc6WvTickrLGprQ== -bip32@^2.0.6: +bip32@2.0.6, bip32@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/bip32/-/bip32-2.0.6.tgz#6a81d9f98c4cd57d05150c60d8f9e75121635134" integrity sha512-HpV5OMLLGTjSVblmrtYRfFFKuQB+GArM0+XP8HGWfJ5vxYBqo+DesvJwOdC2WJ3bCkZShGf0QIfoIpeomVzVdA== @@ -11148,6 +11196,16 @@ bip32@^2.0.6: typeforce "^1.11.5" wif "^2.0.6" +bip39@3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.4.tgz#5b11fed966840b5e1b8539f0f54ab6392969b2a0" + integrity sha512-YZKQlb752TrUWqHWj7XAwCSjYEgGAk+/Aas3V7NyjQeZYsztO8JnQUaCWhcnL4T+jL8nvB8typ2jRPzTlgugNw== + dependencies: + "@types/node" "11.11.6" + create-hash "^1.1.0" + pbkdf2 "^3.0.9" + randombytes "^2.0.1" + bip39@^3.0.3: version "3.1.0" resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.1.0.tgz#c55a418deaf48826a6ceb34ac55b3ee1577e18a3" @@ -12840,6 +12898,11 @@ currently-unhandled@^0.4.1: dependencies: array-find-index "^1.0.1" +curve25519-js@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/curve25519-js/-/curve25519-js-0.0.4.tgz#e6ad967e8cd284590d657bbfc90d8b50e49ba060" + integrity sha512-axn2UMEnkhyDUPWOwVKBMVIzSQy2ejH2xRGy1wq81dqRwApXfIzfbE3hIX0ZRFBIihf/KDqK158DLwESu4AK1w== + cyclist@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" @@ -15379,7 +15442,7 @@ goober@^2.1.1: resolved "https://registry.yarnpkg.com/goober/-/goober-2.1.10.tgz#058def43ba1e3b06f973dbb372a4978aa42f1049" integrity sha512-7PpuQMH10jaTWm33sQgBQvz45pHR8N4l3Cu3WMGEWmHShAcTuuP7I+5/DwKo39fwti5A80WAjvqgz6SSlgWmGA== -google-protobuf@^3.17.3: +google-protobuf@^3.14.0, google-protobuf@^3.17.3: version "3.21.2" resolved "https://registry.yarnpkg.com/google-protobuf/-/google-protobuf-3.21.2.tgz#4580a2bea8bbb291ee579d1fefb14d6fa3070ea4" integrity sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA== @@ -18275,7 +18338,7 @@ loglevel@^1.8.1, loglevel@^1.9.1: resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.9.1.tgz#d63976ac9bcd03c7c873116d41c2a85bafff1be7" integrity sha512-hP3I3kCrDIMuRwAwHltphhDM1r8i55H33GgqjXbrisuJhF4kRhW1dNuxsRklp4bXl8DSdLaNLuiL4A/LWRfxvg== -"long@^3 || ^4 || ^5", long@^5.2.0, long@^5.2.1, long@^5.2.3: +"long@^3 || ^4 || ^5", long@^5.0.0, long@^5.2.0, long@^5.2.1, long@^5.2.3: version "5.2.3" resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1" integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q== @@ -19299,6 +19362,11 @@ minizlib@^2.1.1, minizlib@^2.1.2: minipass "^3.0.0" yallist "^4.0.0" +miscreant@0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/miscreant/-/miscreant-0.3.2.tgz#a91c046566cca70bd6b5e9fbdd3f67617fa85034" + integrity sha512-fL9KxsQz9BJB2KGPMHFrReioywkiomBiuaLk6EuChijK0BsJsIKJXdVomR+/bPj5mvbFD6wM0CM3bZio9g7OHA== + mississippi@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022" @@ -20441,10 +20509,10 @@ pacote@^13.0.3, pacote@^13.6.1: ssri "^9.0.0" tar "^6.1.11" -pako@^2.0.2: - version "2.1.0" - resolved "https://registry.yarnpkg.com/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86" - integrity sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug== +pako@2.0.4, pako@^2.0.2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pako/-/pako-2.0.4.tgz#6cebc4bbb0b6c73b0d5b8d7e8476e2b2fbea576d" + integrity sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg== pako@~1.0.5: version "1.0.11" @@ -20721,7 +20789,7 @@ pathe@^1.1.1, pathe@^1.1.2: resolved "https://registry.yarnpkg.com/pathe/-/pathe-1.1.2.tgz#6c4cb47a945692e48a1ddd6e4094d170516437ec" integrity sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ== -pbkdf2@^3.0.3, pbkdf2@^3.1.2: +pbkdf2@^3.0.3, pbkdf2@^3.0.9, pbkdf2@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== @@ -21329,6 +21397,24 @@ proto-list@~1.2.1: resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" integrity sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA== +protobufjs@7.2.5: + version "7.2.5" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.2.5.tgz#45d5c57387a6d29a17aab6846dcc283f9b8e7f2d" + integrity sha512-gGXRSXvxQ7UiPgfw8gevrfRWcTlSbOFg+p/N+JVJEK5VhueL2miT6qTymqAmjr1Q5WbOCyJbyrk6JfWKwlFn6A== + 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/node" ">=13.7.0" + long "^5.0.0" + protobufjs@^6.11.2, protobufjs@^6.8.8, protobufjs@~6.11.2: version "6.11.4" resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.4.tgz#29a412c38bf70d89e537b6d02d904a6f448173aa" @@ -22636,6 +22722,33 @@ secp256k1@^4.0.2: node-addon-api "^2.0.0" node-gyp-build "^4.2.0" +secretjs@^1.12.5: + version "1.12.5" + resolved "https://registry.yarnpkg.com/secretjs/-/secretjs-1.12.5.tgz#347a1593dfb97610bf4af5c4df5fa90badbeda63" + integrity sha512-JEnvJcfQRuJyu2QtsFQOZ3Vb0sQO8puKV1hK7rVsgROFWHE0s2wSmamTn9SV+hncgRwEtEtGht3Mu1WtQ5xfYA== + dependencies: + "@cosmjs/encoding" "0.27.1" + "@cosmjs/math" "0.27.1" + "@noble/hashes" "1.0.0" + "@noble/secp256k1" "1.7.0" + bech32 "2.0.0" + big-integer "1.6.51" + bignumber.js "9.0.2" + bip32 "2.0.6" + bip39 "3.0.4" + cross-fetch "3.1.5" + curve25519-js "0.0.4" + google-protobuf "^3.14.0" + miscreant "0.3.2" + pako "2.0.4" + protobufjs "7.2.5" + secure-random "1.1.2" + +secure-random@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/secure-random/-/secure-random-1.1.2.tgz#ed103b460a851632d420d46448b2a900a41e7f7c" + integrity sha512-H2bdSKERKdBV1SwoqYm6C0y+9EA94v6SUBOWO8kDndc4NoUih7Dv6Tsgma7zO1lv27wIvjlD0ZpMQk7um5dheQ== + selderee@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/selderee/-/selderee-0.10.0.tgz#ec83d6044d9026668dc9bd2561acfde99a4e3a1c" From 6b3b4eb7165f33d9972f15e297d6c4f9c24641b0 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 7 Jul 2024 21:15:32 -0400 Subject: [PATCH 288/438] v2.4.2-rc.0 --- apps/dapp/package.json | 16 ++++++++-------- apps/sda/package.json | 16 ++++++++-------- lerna.json | 2 +- package.json | 2 +- packages/config/package.json | 2 +- packages/dispatch/package.json | 11 ++++++----- packages/email/package.json | 6 +++--- packages/i18n/package.json | 4 ++-- packages/state/package.json | 8 ++++---- packages/stateful/package.json | 16 ++++++++-------- packages/stateless/package.json | 12 ++++++------ packages/storybook/package.json | 16 ++++++++-------- packages/types/package.json | 4 ++-- packages/utils/package.json | 6 +++--- 14 files changed, 61 insertions(+), 60 deletions(-) diff --git a/apps/dapp/package.json b/apps/dapp/package.json index a8c7699ef..bb224a7bf 100644 --- a/apps/dapp/package.json +++ b/apps/dapp/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/dapp", - "version": "2.4.0-rc.9", + "version": "2.4.2-rc.0", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -20,12 +20,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.4.0-rc.9", - "@dao-dao/state": "2.4.0-rc.9", - "@dao-dao/stateful": "2.4.0-rc.9", - "@dao-dao/stateless": "2.4.0-rc.9", - "@dao-dao/types": "2.4.0-rc.9", - "@dao-dao/utils": "2.4.0-rc.9", + "@dao-dao/i18n": "2.4.2-rc.0", + "@dao-dao/state": "2.4.2-rc.0", + "@dao-dao/stateful": "2.4.2-rc.0", + "@dao-dao/stateless": "2.4.2-rc.0", + "@dao-dao/types": "2.4.2-rc.0", + "@dao-dao/utils": "2.4.2-rc.0", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -52,7 +52,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.9", + "@dao-dao/config": "2.4.2-rc.0", "@next/bundle-analyzer": "^14.1.0", "@playwright/test": "^1.44.1", "@sentry/cli": "^2.21.3", diff --git a/apps/sda/package.json b/apps/sda/package.json index 337b0458b..1a4e73b53 100644 --- a/apps/sda/package.json +++ b/apps/sda/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/sda", - "version": "2.4.0-rc.9", + "version": "2.4.2-rc.0", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -17,12 +17,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.4.0-rc.9", - "@dao-dao/state": "2.4.0-rc.9", - "@dao-dao/stateful": "2.4.0-rc.9", - "@dao-dao/stateless": "2.4.0-rc.9", - "@dao-dao/types": "2.4.0-rc.9", - "@dao-dao/utils": "2.4.0-rc.9", + "@dao-dao/i18n": "2.4.2-rc.0", + "@dao-dao/state": "2.4.2-rc.0", + "@dao-dao/stateful": "2.4.2-rc.0", + "@dao-dao/stateless": "2.4.2-rc.0", + "@dao-dao/types": "2.4.2-rc.0", + "@dao-dao/utils": "2.4.2-rc.0", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -48,7 +48,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.9", + "@dao-dao/config": "2.4.2-rc.0", "@next/bundle-analyzer": "^12.1.0", "@sentry/cli": "^2.21.3", "@solana/web3.js": "^1.75.0", diff --git a/lerna.json b/lerna.json index bba00a099..703642740 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", "useWorkspaces": true, - "version": "2.4.0-rc.9" + "version": "2.4.2-rc.0" } diff --git a/package.json b/package.json index aff63d778..6cf734b8d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dao-dao-ui", - "version": "2.4.0-rc.9", + "version": "2.4.2-rc.0", "workspaces": [ "apps/*", "packages/*" diff --git a/packages/config/package.json b/packages/config/package.json index b2ccf9a63..7eb6b792f 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/config", - "version": "2.4.0-rc.9", + "version": "2.4.2-rc.0", "license": "BSD-3-Clause-Clear", "scripts": { "cwgen": "ts-node ./scripts/cwgen.ts" diff --git a/packages/dispatch/package.json b/packages/dispatch/package.json index 9fa4930d7..adc192ebf 100644 --- a/packages/dispatch/package.json +++ b/packages/dispatch/package.json @@ -1,17 +1,18 @@ { "name": "@dao-dao/dispatch", - "version": "2.4.0-rc.9", + "version": "2.4.2-rc.0", "license": "BSD-3-Clause-Clear", + "private": true, "scripts": { "format": "eslint . --fix", "lint": "eslint .", "deploy": "ts-node ./scripts/deploy.ts" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.9", - "@dao-dao/state": "2.4.0-rc.9", - "@dao-dao/types": "2.4.0-rc.9", - "@dao-dao/utils": "2.4.0-rc.9", + "@dao-dao/config": "2.4.2-rc.0", + "@dao-dao/state": "2.4.2-rc.0", + "@dao-dao/types": "2.4.2-rc.0", + "@dao-dao/utils": "2.4.2-rc.0", "chalk": "^4", "commander": "^11.0.0", "dotenv": "^16.4.5", diff --git a/packages/email/package.json b/packages/email/package.json index b906c0050..d26d34f4d 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/email", - "version": "2.4.0-rc.9", + "version": "2.4.2-rc.0", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -10,8 +10,8 @@ }, "devDependencies": { "@aws-sdk/client-ses": "^3.592.0", - "@dao-dao/config": "2.4.0-rc.9", - "@dao-dao/types": "2.4.0-rc.9", + "@dao-dao/config": "2.4.2-rc.0", + "@dao-dao/types": "2.4.2-rc.0", "@react-email/components": "^0.0.7", "@react-email/render": "0.0.7", "commander": "^11.0.0", diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 2934186ea..483aabb4c 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/i18n", - "version": "2.4.0-rc.9", + "version": "2.4.2-rc.0", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -17,7 +17,7 @@ "react-i18next": "^11.0.0" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.9", + "@dao-dao/config": "2.4.2-rc.0", "eslint-plugin-i18n-json": "^3.1.0", "i18n-unused": "^0.10.0" }, diff --git a/packages/state/package.json b/packages/state/package.json index 983633e5c..51f802e89 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/state", - "version": "2.4.0-rc.9", + "version": "2.4.2-rc.0", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc && npm run build:gql", @@ -17,7 +17,7 @@ "@cosmjs/proto-signing": "^0.32.3", "@cosmjs/stargate": "^0.32.3", "@cosmjs/tendermint-rpc": "^0.32.3", - "@dao-dao/utils": "2.4.0-rc.9", + "@dao-dao/utils": "2.4.2-rc.0", "@tanstack/react-query": "^5.40.0", "graphql": "^16.8.1", "json5": "^2.2.0", @@ -29,8 +29,8 @@ }, "devDependencies": { "@chain-registry/types": "^0.41.3", - "@dao-dao/config": "2.4.0-rc.9", - "@dao-dao/types": "2.4.0-rc.9", + "@dao-dao/config": "2.4.2-rc.0", + "@dao-dao/types": "2.4.2-rc.0", "@graphql-codegen/cli": "^5.0.0", "@graphql-codegen/client-preset": "^4.1.0", "@graphql-typed-document-node/core": "^3.2.0", diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 4999a4669..ac6a6b6d2 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateful", - "version": "2.4.0-rc.9", + "version": "2.4.2-rc.0", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -39,10 +39,10 @@ "@cosmos-kit/vectis": "^2.9.0", "@cosmos-kit/web3auth": "^2.8.0", "@cosmos-kit/xdefi": "^2.8.0", - "@dao-dao/i18n": "2.4.0-rc.9", - "@dao-dao/state": "2.4.0-rc.9", - "@dao-dao/stateless": "2.4.0-rc.9", - "@dao-dao/utils": "2.4.0-rc.9", + "@dao-dao/i18n": "2.4.2-rc.0", + "@dao-dao/state": "2.4.2-rc.0", + "@dao-dao/stateless": "2.4.2-rc.0", + "@dao-dao/utils": "2.4.2-rc.0", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -80,9 +80,9 @@ "devDependencies": { "@chain-registry/types": "^0.41.3", "@cosmjs/amino": "^0.32.3", - "@dao-dao/config": "2.4.0-rc.9", + "@dao-dao/config": "2.4.2-rc.0", "@dao-dao/cosmiframe": "0.1.0", - "@dao-dao/types": "2.4.0-rc.9", + "@dao-dao/types": "2.4.2-rc.0", "@storybook/react": "^6.5.10", "@types/file-saver": "^2.0.5", "@types/lodash.clonedeep": "^4.5.0", @@ -103,7 +103,7 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/storybook": "2.4.0-rc.9", + "@dao-dao/storybook": "2.4.2-rc.0", "next": "^12 || ^13", "react": "^17 || ^18" }, diff --git a/packages/stateless/package.json b/packages/stateless/package.json index c2ea4de29..68abd7fb6 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateless", - "version": "2.4.0-rc.9", + "version": "2.4.2-rc.0", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -9,8 +9,8 @@ }, "dependencies": { "@cosmjs/encoding": "^0.32.3", - "@dao-dao/types": "2.4.0-rc.9", - "@dao-dao/utils": "2.4.0-rc.9", + "@dao-dao/types": "2.4.2-rc.0", + "@dao-dao/utils": "2.4.2-rc.0", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -45,7 +45,7 @@ "devDependencies": { "@chain-registry/types": "^0.41.3", "@cosmos-kit/core": "^2.11.0", - "@dao-dao/config": "2.4.0-rc.9", + "@dao-dao/config": "2.4.2-rc.0", "@storybook/react": "^6.5.10", "@types/lodash.clonedeep": "^4.5.0", "@types/react": "^17.0.37", @@ -68,8 +68,8 @@ "unist-util-visit-parents": "^5.1.3" }, "peerDependencies": { - "@dao-dao/stateful": "2.4.0-rc.9", - "@dao-dao/storybook": "2.4.0-rc.9", + "@dao-dao/stateful": "2.4.2-rc.0", + "@dao-dao/storybook": "2.4.2-rc.0", "next": "^12 || ^13", "react": "^17 || ^18", "react-dom": "^17 || ^18" diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 650877d8d..2a7b30412 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/storybook", - "version": "2.4.0-rc.9", + "version": "2.4.2-rc.0", "license": "BSD-3-Clause-Clear", "scripts": { "build": "build-storybook", @@ -8,10 +8,10 @@ "generate": "ts-node --esm ./scripts/generate.ts" }, "devDependencies": { - "@dao-dao/config": "2.4.0-rc.9", - "@dao-dao/i18n": "2.4.0-rc.9", - "@dao-dao/types": "2.4.0-rc.9", - "@dao-dao/utils": "2.4.0-rc.9", + "@dao-dao/config": "2.4.2-rc.0", + "@dao-dao/i18n": "2.4.2-rc.0", + "@dao-dao/types": "2.4.2-rc.0", + "@dao-dao/utils": "2.4.2-rc.0", "@storybook/addon-actions": "^6.5.12", "@storybook/addon-essentials": "^6.5.12", "@storybook/addon-links": "^6.5.12", @@ -46,9 +46,9 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/state": "2.4.0-rc.9", - "@dao-dao/stateful": "2.4.0-rc.9", - "@dao-dao/stateless": "2.4.0-rc.9" + "@dao-dao/state": "2.4.2-rc.0", + "@dao-dao/stateful": "2.4.2-rc.0", + "@dao-dao/stateless": "2.4.2-rc.0" }, "prettier": "@dao-dao/config/prettier", "gitHead": "0d76facc26ddc496b58d1f5c7458e5db243cdd14" diff --git a/packages/types/package.json b/packages/types/package.json index 7737003b9..e32cca417 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/types", - "version": "2.4.0-rc.9", + "version": "2.4.2-rc.0", "license": "BSD-3-Clause-Clear", "scripts": { "lint": "eslint .", @@ -24,7 +24,7 @@ "devDependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.3", "@cosmology/telescope": "^1.4.12", - "@dao-dao/config": "2.4.0-rc.9", + "@dao-dao/config": "2.4.2-rc.0", "@tanstack/react-query": "^5.40.0" }, "peerDependencies": { diff --git a/packages/utils/package.json b/packages/utils/package.json index 6ec81627f..8bbcfd2f1 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/utils", - "version": "2.4.0-rc.9", + "version": "2.4.2-rc.0", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -16,7 +16,7 @@ "@cosmjs/encoding": "^0.32.3", "@cosmjs/stargate": "^0.32.3", "@cosmjs/tendermint-rpc": "^0.32.3", - "@dao-dao/types": "2.4.0-rc.9", + "@dao-dao/types": "2.4.2-rc.0", "@sentry/nextjs": "^7.7.0", "@types/lodash.clonedeep": "^4.5.0", "@types/ripemd160": "^2.0.0", @@ -40,7 +40,7 @@ "devDependencies": { "@chain-registry/types": "^0.41.3", "@cosmjs/proto-signing": "^0.32.3", - "@dao-dao/config": "2.4.0-rc.9", + "@dao-dao/config": "2.4.2-rc.0", "@tanstack/react-query": "^5.40.0", "@types/pako": "^2.0.3", "commander": "^12.1.0", From de61239af12eb6a2873d56cd9edc41582738cbdc Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 7 Jul 2024 21:17:17 -0400 Subject: [PATCH 289/438] published --- packages/config/package.json | 2 +- packages/email/package.json | 2 +- packages/i18n/package.json | 2 +- packages/state/package.json | 2 +- packages/stateful/package.json | 2 +- packages/stateless/package.json | 2 +- packages/storybook/package.json | 2 +- packages/types/package.json | 2 +- packages/utils/package.json | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/config/package.json b/packages/config/package.json index 7eb6b792f..1ea32aa4a 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -33,5 +33,5 @@ "ts-node": "^10.9.2" }, "prettier": "./prettier/index.js", - "gitHead": "0d76facc26ddc496b58d1f5c7458e5db243cdd14" + "gitHead": "6b3b4eb7165f33d9972f15e297d6c4f9c24641b0" } diff --git a/packages/email/package.json b/packages/email/package.json index d26d34f4d..e2b88f088 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -25,5 +25,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "0d76facc26ddc496b58d1f5c7458e5db243cdd14" + "gitHead": "6b3b4eb7165f33d9972f15e297d6c4f9c24641b0" } diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 483aabb4c..84a479202 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -22,5 +22,5 @@ "i18n-unused": "^0.10.0" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "0d76facc26ddc496b58d1f5c7458e5db243cdd14" + "gitHead": "6b3b4eb7165f33d9972f15e297d6c4f9c24641b0" } diff --git a/packages/state/package.json b/packages/state/package.json index 51f802e89..1ed2e43a5 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -38,5 +38,5 @@ "typescript": "5.3.3" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "0d76facc26ddc496b58d1f5c7458e5db243cdd14" + "gitHead": "6b3b4eb7165f33d9972f15e297d6c4f9c24641b0" } diff --git a/packages/stateful/package.json b/packages/stateful/package.json index ac6a6b6d2..0c433eb82 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -108,5 +108,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "0d76facc26ddc496b58d1f5c7458e5db243cdd14" + "gitHead": "6b3b4eb7165f33d9972f15e297d6c4f9c24641b0" } diff --git a/packages/stateless/package.json b/packages/stateless/package.json index 68abd7fb6..ab5ba18b9 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -75,5 +75,5 @@ "react-dom": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "0d76facc26ddc496b58d1f5c7458e5db243cdd14" + "gitHead": "6b3b4eb7165f33d9972f15e297d6c4f9c24641b0" } diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 2a7b30412..ae6be0e0a 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -51,5 +51,5 @@ "@dao-dao/stateless": "2.4.2-rc.0" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "0d76facc26ddc496b58d1f5c7458e5db243cdd14" + "gitHead": "6b3b4eb7165f33d9972f15e297d6c4f9c24641b0" } diff --git a/packages/types/package.json b/packages/types/package.json index e32cca417..4d54b591e 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -32,5 +32,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "0d76facc26ddc496b58d1f5c7458e5db243cdd14" + "gitHead": "6b3b4eb7165f33d9972f15e297d6c4f9c24641b0" } diff --git a/packages/utils/package.json b/packages/utils/package.json index 8bbcfd2f1..443e66455 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -56,5 +56,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "0d76facc26ddc496b58d1f5c7458e5db243cdd14" + "gitHead": "6b3b4eb7165f33d9972f15e297d6c4f9c24641b0" } From b3b99fea427eb26648a97bda45d2697df732211b Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 7 Jul 2024 22:19:18 -0400 Subject: [PATCH 290/438] Fixed type issue in indexer queries. --- packages/state/query/queries/indexer.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/state/query/queries/indexer.ts b/packages/state/query/queries/indexer.ts index e84a3fa0c..9b6a035b4 100644 --- a/packages/state/query/queries/indexer.ts +++ b/packages/state/query/queries/indexer.ts @@ -34,7 +34,7 @@ export type FetchIndexerQueryOptions = QueryIndexerOptions & { export const fetchIndexerQuery = async ( queryClient: QueryClient, { noFallback, ...options }: FetchIndexerQueryOptions -): Promise => { +): Promise => { // If the indexer is behind and either there's a fallback or we're on the // server, return null to make the caller use the fallback. Throw error if no // fallback and on client. @@ -49,8 +49,9 @@ export const fetchIndexerQuery = async ( } // Replace undefined responses with null since react-query and static props - // can't serialize undefined. - return (await queryIndexer(options)) ?? null + // can't serialize undefined. Rely on caller knowing that this may return + // null to type it correctly. + return (await queryIndexer(options)) ?? (null as T) } export const indexerQueries = { From d7b959f412c3990123b0e2afb11f32acd9c3764c Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 7 Jul 2024 22:19:46 -0400 Subject: [PATCH 291/438] v2.4.2-rc.1 --- apps/dapp/package.json | 16 ++++++++-------- apps/sda/package.json | 16 ++++++++-------- lerna.json | 2 +- package.json | 2 +- packages/config/package.json | 2 +- packages/dispatch/package.json | 10 +++++----- packages/email/package.json | 6 +++--- packages/i18n/package.json | 4 ++-- packages/state/package.json | 8 ++++---- packages/stateful/package.json | 16 ++++++++-------- packages/stateless/package.json | 12 ++++++------ packages/storybook/package.json | 16 ++++++++-------- packages/types/package.json | 4 ++-- packages/utils/package.json | 6 +++--- 14 files changed, 60 insertions(+), 60 deletions(-) diff --git a/apps/dapp/package.json b/apps/dapp/package.json index bb224a7bf..e4f77d8e8 100644 --- a/apps/dapp/package.json +++ b/apps/dapp/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/dapp", - "version": "2.4.2-rc.0", + "version": "2.4.2-rc.1", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -20,12 +20,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.4.2-rc.0", - "@dao-dao/state": "2.4.2-rc.0", - "@dao-dao/stateful": "2.4.2-rc.0", - "@dao-dao/stateless": "2.4.2-rc.0", - "@dao-dao/types": "2.4.2-rc.0", - "@dao-dao/utils": "2.4.2-rc.0", + "@dao-dao/i18n": "2.4.2-rc.1", + "@dao-dao/state": "2.4.2-rc.1", + "@dao-dao/stateful": "2.4.2-rc.1", + "@dao-dao/stateless": "2.4.2-rc.1", + "@dao-dao/types": "2.4.2-rc.1", + "@dao-dao/utils": "2.4.2-rc.1", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -52,7 +52,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.4.2-rc.0", + "@dao-dao/config": "2.4.2-rc.1", "@next/bundle-analyzer": "^14.1.0", "@playwright/test": "^1.44.1", "@sentry/cli": "^2.21.3", diff --git a/apps/sda/package.json b/apps/sda/package.json index 1a4e73b53..7d9972255 100644 --- a/apps/sda/package.json +++ b/apps/sda/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/sda", - "version": "2.4.2-rc.0", + "version": "2.4.2-rc.1", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -17,12 +17,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.4.2-rc.0", - "@dao-dao/state": "2.4.2-rc.0", - "@dao-dao/stateful": "2.4.2-rc.0", - "@dao-dao/stateless": "2.4.2-rc.0", - "@dao-dao/types": "2.4.2-rc.0", - "@dao-dao/utils": "2.4.2-rc.0", + "@dao-dao/i18n": "2.4.2-rc.1", + "@dao-dao/state": "2.4.2-rc.1", + "@dao-dao/stateful": "2.4.2-rc.1", + "@dao-dao/stateless": "2.4.2-rc.1", + "@dao-dao/types": "2.4.2-rc.1", + "@dao-dao/utils": "2.4.2-rc.1", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -48,7 +48,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.4.2-rc.0", + "@dao-dao/config": "2.4.2-rc.1", "@next/bundle-analyzer": "^12.1.0", "@sentry/cli": "^2.21.3", "@solana/web3.js": "^1.75.0", diff --git a/lerna.json b/lerna.json index 703642740..abef9a383 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", "useWorkspaces": true, - "version": "2.4.2-rc.0" + "version": "2.4.2-rc.1" } diff --git a/package.json b/package.json index 6cf734b8d..cb7bf06e9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dao-dao-ui", - "version": "2.4.2-rc.0", + "version": "2.4.2-rc.1", "workspaces": [ "apps/*", "packages/*" diff --git a/packages/config/package.json b/packages/config/package.json index 1ea32aa4a..a60db4471 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/config", - "version": "2.4.2-rc.0", + "version": "2.4.2-rc.1", "license": "BSD-3-Clause-Clear", "scripts": { "cwgen": "ts-node ./scripts/cwgen.ts" diff --git a/packages/dispatch/package.json b/packages/dispatch/package.json index adc192ebf..fab6884b4 100644 --- a/packages/dispatch/package.json +++ b/packages/dispatch/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/dispatch", - "version": "2.4.2-rc.0", + "version": "2.4.2-rc.1", "license": "BSD-3-Clause-Clear", "private": true, "scripts": { @@ -9,10 +9,10 @@ "deploy": "ts-node ./scripts/deploy.ts" }, "devDependencies": { - "@dao-dao/config": "2.4.2-rc.0", - "@dao-dao/state": "2.4.2-rc.0", - "@dao-dao/types": "2.4.2-rc.0", - "@dao-dao/utils": "2.4.2-rc.0", + "@dao-dao/config": "2.4.2-rc.1", + "@dao-dao/state": "2.4.2-rc.1", + "@dao-dao/types": "2.4.2-rc.1", + "@dao-dao/utils": "2.4.2-rc.1", "chalk": "^4", "commander": "^11.0.0", "dotenv": "^16.4.5", diff --git a/packages/email/package.json b/packages/email/package.json index e2b88f088..fdcbd4ef8 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/email", - "version": "2.4.2-rc.0", + "version": "2.4.2-rc.1", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -10,8 +10,8 @@ }, "devDependencies": { "@aws-sdk/client-ses": "^3.592.0", - "@dao-dao/config": "2.4.2-rc.0", - "@dao-dao/types": "2.4.2-rc.0", + "@dao-dao/config": "2.4.2-rc.1", + "@dao-dao/types": "2.4.2-rc.1", "@react-email/components": "^0.0.7", "@react-email/render": "0.0.7", "commander": "^11.0.0", diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 84a479202..d7bee251f 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/i18n", - "version": "2.4.2-rc.0", + "version": "2.4.2-rc.1", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -17,7 +17,7 @@ "react-i18next": "^11.0.0" }, "devDependencies": { - "@dao-dao/config": "2.4.2-rc.0", + "@dao-dao/config": "2.4.2-rc.1", "eslint-plugin-i18n-json": "^3.1.0", "i18n-unused": "^0.10.0" }, diff --git a/packages/state/package.json b/packages/state/package.json index 1ed2e43a5..deb6730cc 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/state", - "version": "2.4.2-rc.0", + "version": "2.4.2-rc.1", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc && npm run build:gql", @@ -17,7 +17,7 @@ "@cosmjs/proto-signing": "^0.32.3", "@cosmjs/stargate": "^0.32.3", "@cosmjs/tendermint-rpc": "^0.32.3", - "@dao-dao/utils": "2.4.2-rc.0", + "@dao-dao/utils": "2.4.2-rc.1", "@tanstack/react-query": "^5.40.0", "graphql": "^16.8.1", "json5": "^2.2.0", @@ -29,8 +29,8 @@ }, "devDependencies": { "@chain-registry/types": "^0.41.3", - "@dao-dao/config": "2.4.2-rc.0", - "@dao-dao/types": "2.4.2-rc.0", + "@dao-dao/config": "2.4.2-rc.1", + "@dao-dao/types": "2.4.2-rc.1", "@graphql-codegen/cli": "^5.0.0", "@graphql-codegen/client-preset": "^4.1.0", "@graphql-typed-document-node/core": "^3.2.0", diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 0c433eb82..830eb2522 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateful", - "version": "2.4.2-rc.0", + "version": "2.4.2-rc.1", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -39,10 +39,10 @@ "@cosmos-kit/vectis": "^2.9.0", "@cosmos-kit/web3auth": "^2.8.0", "@cosmos-kit/xdefi": "^2.8.0", - "@dao-dao/i18n": "2.4.2-rc.0", - "@dao-dao/state": "2.4.2-rc.0", - "@dao-dao/stateless": "2.4.2-rc.0", - "@dao-dao/utils": "2.4.2-rc.0", + "@dao-dao/i18n": "2.4.2-rc.1", + "@dao-dao/state": "2.4.2-rc.1", + "@dao-dao/stateless": "2.4.2-rc.1", + "@dao-dao/utils": "2.4.2-rc.1", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -80,9 +80,9 @@ "devDependencies": { "@chain-registry/types": "^0.41.3", "@cosmjs/amino": "^0.32.3", - "@dao-dao/config": "2.4.2-rc.0", + "@dao-dao/config": "2.4.2-rc.1", "@dao-dao/cosmiframe": "0.1.0", - "@dao-dao/types": "2.4.2-rc.0", + "@dao-dao/types": "2.4.2-rc.1", "@storybook/react": "^6.5.10", "@types/file-saver": "^2.0.5", "@types/lodash.clonedeep": "^4.5.0", @@ -103,7 +103,7 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/storybook": "2.4.2-rc.0", + "@dao-dao/storybook": "2.4.2-rc.1", "next": "^12 || ^13", "react": "^17 || ^18" }, diff --git a/packages/stateless/package.json b/packages/stateless/package.json index ab5ba18b9..6efecb328 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateless", - "version": "2.4.2-rc.0", + "version": "2.4.2-rc.1", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -9,8 +9,8 @@ }, "dependencies": { "@cosmjs/encoding": "^0.32.3", - "@dao-dao/types": "2.4.2-rc.0", - "@dao-dao/utils": "2.4.2-rc.0", + "@dao-dao/types": "2.4.2-rc.1", + "@dao-dao/utils": "2.4.2-rc.1", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -45,7 +45,7 @@ "devDependencies": { "@chain-registry/types": "^0.41.3", "@cosmos-kit/core": "^2.11.0", - "@dao-dao/config": "2.4.2-rc.0", + "@dao-dao/config": "2.4.2-rc.1", "@storybook/react": "^6.5.10", "@types/lodash.clonedeep": "^4.5.0", "@types/react": "^17.0.37", @@ -68,8 +68,8 @@ "unist-util-visit-parents": "^5.1.3" }, "peerDependencies": { - "@dao-dao/stateful": "2.4.2-rc.0", - "@dao-dao/storybook": "2.4.2-rc.0", + "@dao-dao/stateful": "2.4.2-rc.1", + "@dao-dao/storybook": "2.4.2-rc.1", "next": "^12 || ^13", "react": "^17 || ^18", "react-dom": "^17 || ^18" diff --git a/packages/storybook/package.json b/packages/storybook/package.json index ae6be0e0a..ec82efd0c 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/storybook", - "version": "2.4.2-rc.0", + "version": "2.4.2-rc.1", "license": "BSD-3-Clause-Clear", "scripts": { "build": "build-storybook", @@ -8,10 +8,10 @@ "generate": "ts-node --esm ./scripts/generate.ts" }, "devDependencies": { - "@dao-dao/config": "2.4.2-rc.0", - "@dao-dao/i18n": "2.4.2-rc.0", - "@dao-dao/types": "2.4.2-rc.0", - "@dao-dao/utils": "2.4.2-rc.0", + "@dao-dao/config": "2.4.2-rc.1", + "@dao-dao/i18n": "2.4.2-rc.1", + "@dao-dao/types": "2.4.2-rc.1", + "@dao-dao/utils": "2.4.2-rc.1", "@storybook/addon-actions": "^6.5.12", "@storybook/addon-essentials": "^6.5.12", "@storybook/addon-links": "^6.5.12", @@ -46,9 +46,9 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/state": "2.4.2-rc.0", - "@dao-dao/stateful": "2.4.2-rc.0", - "@dao-dao/stateless": "2.4.2-rc.0" + "@dao-dao/state": "2.4.2-rc.1", + "@dao-dao/stateful": "2.4.2-rc.1", + "@dao-dao/stateless": "2.4.2-rc.1" }, "prettier": "@dao-dao/config/prettier", "gitHead": "6b3b4eb7165f33d9972f15e297d6c4f9c24641b0" diff --git a/packages/types/package.json b/packages/types/package.json index 4d54b591e..e3d45cebc 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/types", - "version": "2.4.2-rc.0", + "version": "2.4.2-rc.1", "license": "BSD-3-Clause-Clear", "scripts": { "lint": "eslint .", @@ -24,7 +24,7 @@ "devDependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.3", "@cosmology/telescope": "^1.4.12", - "@dao-dao/config": "2.4.2-rc.0", + "@dao-dao/config": "2.4.2-rc.1", "@tanstack/react-query": "^5.40.0" }, "peerDependencies": { diff --git a/packages/utils/package.json b/packages/utils/package.json index 443e66455..3fc6a532a 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/utils", - "version": "2.4.2-rc.0", + "version": "2.4.2-rc.1", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -16,7 +16,7 @@ "@cosmjs/encoding": "^0.32.3", "@cosmjs/stargate": "^0.32.3", "@cosmjs/tendermint-rpc": "^0.32.3", - "@dao-dao/types": "2.4.2-rc.0", + "@dao-dao/types": "2.4.2-rc.1", "@sentry/nextjs": "^7.7.0", "@types/lodash.clonedeep": "^4.5.0", "@types/ripemd160": "^2.0.0", @@ -40,7 +40,7 @@ "devDependencies": { "@chain-registry/types": "^0.41.3", "@cosmjs/proto-signing": "^0.32.3", - "@dao-dao/config": "2.4.2-rc.0", + "@dao-dao/config": "2.4.2-rc.1", "@tanstack/react-query": "^5.40.0", "@types/pako": "^2.0.3", "commander": "^12.1.0", From 4c91c99738bce10697dae8b740e4e3eb309a73e2 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 7 Jul 2024 22:21:57 -0400 Subject: [PATCH 292/438] published --- packages/config/package.json | 2 +- packages/email/package.json | 2 +- packages/i18n/package.json | 2 +- packages/state/package.json | 2 +- packages/stateful/package.json | 2 +- packages/stateless/package.json | 2 +- packages/storybook/package.json | 2 +- packages/types/package.json | 2 +- packages/utils/package.json | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/config/package.json b/packages/config/package.json index a60db4471..8eacc0ff6 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -33,5 +33,5 @@ "ts-node": "^10.9.2" }, "prettier": "./prettier/index.js", - "gitHead": "6b3b4eb7165f33d9972f15e297d6c4f9c24641b0" + "gitHead": "d7b959f412c3990123b0e2afb11f32acd9c3764c" } diff --git a/packages/email/package.json b/packages/email/package.json index fdcbd4ef8..c36a66e40 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -25,5 +25,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "6b3b4eb7165f33d9972f15e297d6c4f9c24641b0" + "gitHead": "d7b959f412c3990123b0e2afb11f32acd9c3764c" } diff --git a/packages/i18n/package.json b/packages/i18n/package.json index d7bee251f..f52c51c9b 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -22,5 +22,5 @@ "i18n-unused": "^0.10.0" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "6b3b4eb7165f33d9972f15e297d6c4f9c24641b0" + "gitHead": "d7b959f412c3990123b0e2afb11f32acd9c3764c" } diff --git a/packages/state/package.json b/packages/state/package.json index deb6730cc..4a74fc9b3 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -38,5 +38,5 @@ "typescript": "5.3.3" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "6b3b4eb7165f33d9972f15e297d6c4f9c24641b0" + "gitHead": "d7b959f412c3990123b0e2afb11f32acd9c3764c" } diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 830eb2522..f38fee9a4 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -108,5 +108,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "6b3b4eb7165f33d9972f15e297d6c4f9c24641b0" + "gitHead": "d7b959f412c3990123b0e2afb11f32acd9c3764c" } diff --git a/packages/stateless/package.json b/packages/stateless/package.json index 6efecb328..e538a4adc 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -75,5 +75,5 @@ "react-dom": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "6b3b4eb7165f33d9972f15e297d6c4f9c24641b0" + "gitHead": "d7b959f412c3990123b0e2afb11f32acd9c3764c" } diff --git a/packages/storybook/package.json b/packages/storybook/package.json index ec82efd0c..e757dc5c8 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -51,5 +51,5 @@ "@dao-dao/stateless": "2.4.2-rc.1" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "6b3b4eb7165f33d9972f15e297d6c4f9c24641b0" + "gitHead": "d7b959f412c3990123b0e2afb11f32acd9c3764c" } diff --git a/packages/types/package.json b/packages/types/package.json index e3d45cebc..e60548a1d 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -32,5 +32,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "6b3b4eb7165f33d9972f15e297d6c4f9c24641b0" + "gitHead": "d7b959f412c3990123b0e2afb11f32acd9c3764c" } diff --git a/packages/utils/package.json b/packages/utils/package.json index 3fc6a532a..8f66c07d6 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -56,5 +56,5 @@ "react": "^17 || ^18" }, "prettier": "@dao-dao/config/prettier", - "gitHead": "6b3b4eb7165f33d9972f15e297d6c4f9c24641b0" + "gitHead": "d7b959f412c3990123b0e2afb11f32acd9c3764c" } From 5f48d8d06a51b5f31b650cdf67fa3a772aba7599 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 8 Jul 2024 12:36:01 -0400 Subject: [PATCH 293/438] fix signer mismatch when adding chain to profile --- .../hooks/useCfWorkerAuthPostRequest.ts | 16 ++++++++-------- packages/stateful/hooks/useManageProfile.ts | 8 ++++---- packages/utils/auth.ts | 17 +++++------------ 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/packages/stateful/hooks/useCfWorkerAuthPostRequest.ts b/packages/stateful/hooks/useCfWorkerAuthPostRequest.ts index 2f7313533..03ee7cb07 100644 --- a/packages/stateful/hooks/useCfWorkerAuthPostRequest.ts +++ b/packages/stateful/hooks/useCfWorkerAuthPostRequest.ts @@ -49,7 +49,6 @@ export const useCfWorkerAuthPostRequest = ( getChainForChainId(overrideChainId).chain_name ) : chainWallet - const thisChainId = overrideChainId || chain.chain_id // If hex public key not loaded, load it from the wallet. if (!thisChainWallet) { @@ -67,8 +66,9 @@ export const useCfWorkerAuthPostRequest = ( } // Get public key from wallet client, if possible. - const publicKey = (await thisChainWallet.client.getAccount?.(thisChainId)) - ?.pubkey + const publicKey = ( + await thisChainWallet.client.getAccount?.(thisChainWallet.chainId) + )?.pubkey if (!publicKey) { throw new Error(t('error.unsupportedWallet')) } @@ -126,13 +126,12 @@ export const useCfWorkerAuthPostRequest = ( getChainForChainId(overrideChainId).chain_name ) : chainWallet - const thisChainId = overrideChainId || chain.chain_id const offlineSignerAmino = await thisChainWallet?.client.getOfflineSignerAmino?.bind( thisChainWallet.client - )?.(thisChainId) - if (!offlineSignerAmino) { + )?.(thisChainWallet.chainId) + if (!thisChainWallet?.address || !offlineSignerAmino) { throw new Error(t('error.unsupportedWallet')) } @@ -142,7 +141,8 @@ export const useCfWorkerAuthPostRequest = ( const body = await signOffChainAuth({ type: signatureType, nonce, - chainId: thisChainId, + chainId: thisChainWallet.chainId, + address: thisChainWallet.address, hexPublicKey, data, offlineSignerAmino, @@ -179,9 +179,9 @@ export const useCfWorkerAuthPostRequest = ( [ defaultSignatureType, getHexPublicKey, + chain.chain_id, chainWallet, getNonce, - chain.chain_id, apiBase, t, ] diff --git a/packages/stateful/hooks/useManageProfile.ts b/packages/stateful/hooks/useManageProfile.ts index e52885a6e..26032ff15 100644 --- a/packages/stateful/hooks/useManageProfile.ts +++ b/packages/stateful/hooks/useManageProfile.ts @@ -299,10 +299,9 @@ export const useManageProfile = ({ } // Get the account public key. - const pubkeyData = ( - await chainWallet.client.getAccount?.(chainWallet.chainId) - )?.pubkey - if (!pubkeyData) { + const { address, pubkey: pubkeyData } = + (await chainWallet.client.getAccount?.(chainWallet.chainId)) ?? {} + if (!address || !pubkeyData) { throw new Error(t('error.failedToGetAccountFromWallet')) } @@ -324,6 +323,7 @@ export const useManageProfile = ({ type: 'DAO DAO Profile | Add Chain Allowance', nonce, chainId: chainWallet.chainId, + address, hexPublicKey, data: { allow: currentHexPublicKey.data, diff --git a/packages/utils/auth.ts b/packages/utils/auth.ts index be9bb2909..7528c8893 100644 --- a/packages/utils/auth.ts +++ b/packages/utils/auth.ts @@ -1,10 +1,6 @@ import { OfflineAminoSigner, makeSignDoc } from '@cosmjs/amino' -import { - getChainForChainId, - getNativeTokenForChainId, - secp256k1PublicKeyToBech32Address, -} from './chain' +import { getChainForChainId, getNativeTokenForChainId } from './chain' export type SignatureOptions< Data extends Record | undefined = Record @@ -12,6 +8,7 @@ export type SignatureOptions< type: string nonce: number chainId: string + address: string hexPublicKey: string data: Data offlineSignerAmino: OfflineAminoSigner @@ -50,6 +47,7 @@ export const signOffChainAuth = async < type, nonce, chainId, + address, hexPublicKey, data, offlineSignerAmino, @@ -69,18 +67,13 @@ export const signOffChainAuth = async < }, } - const signer = await secp256k1PublicKeyToBech32Address( - hexPublicKey, - chain.bech32_prefix - ) - // Generate data to sign. const signDocAmino = makeSignDoc( [ { type: dataWithAuth.auth.type, value: { - signer, + signer: address, data: JSON.stringify(dataWithAuth, undefined, 2), }, }, @@ -103,7 +96,7 @@ export const signOffChainAuth = async < let signature = '' // Sign data. if (!generateOnly) { - signature = (await offlineSignerAmino.signAmino(signer, signDocAmino)) + signature = (await offlineSignerAmino.signAmino(address, signDocAmino)) .signature.signature } From b4a3fd1bcf25c60a32af429ab9bcff5fee0e2a34 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 8 Jul 2024 12:38:38 -0400 Subject: [PATCH 294/438] added comment about secp256k1 public key to address conversion --- packages/state/query/queries/account.ts | 1 + packages/utils/chain.ts | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/state/query/queries/account.ts b/packages/state/query/queries/account.ts index 13f35ceb8..842ebb293 100644 --- a/packages/state/query/queries/account.ts +++ b/packages/state/query/queries/account.ts @@ -224,6 +224,7 @@ export const fetchCryptographicMultisigAccount = async ({ const addresses = await Promise.all( publicKeys.map((key) => + // Safe to use since we validated the public key curve above. secp256k1PublicKeyToBech32Address( toHex(Secp256k1PubKey.decode(key.value).key), bech32Prefix diff --git a/packages/utils/chain.ts b/packages/utils/chain.ts index 07513055b..4b00242b8 100644 --- a/packages/utils/chain.ts +++ b/packages/utils/chain.ts @@ -181,10 +181,18 @@ export const getImageUrlForChainId = (chainId: string): string => { return image } -// Convert public key in hex format to a bech32 address. -// https://github.com/cosmos/cosmos-sdk/blob/e09516f4795c637ab12b30bf732ce5d86da78424/crypto/keys/secp256k1/secp256k1.go#L152-L162 -// Keplr implementation: -// https://github.com/chainapsis/keplr-wallet/blob/088dc701ce14df77a1ee22b7e39c651e50879d9f/packages/crypto/src/key.ts#L56-L63 +/** + * Convert secp256k1 public key in hex format to a bech32 address. + * + * Be very careful to ensure the public key is actually a secp256k1 key. Some + * chains, like Injective, use a different curve than secp256k1 and thus this + * will not work. + * + * https://github.com/cosmos/cosmos-sdk/blob/e09516f4795c637ab12b30bf732ce5d86da78424/crypto/keys/secp256k1/secp256k1.go#L152-L162 + * + * Keplr implementation: + * https://github.com/chainapsis/keplr-wallet/blob/088dc701ce14df77a1ee22b7e39c651e50879d9f/packages/crypto/src/key.ts#L56-L63 + */ export const secp256k1PublicKeyToBech32Address = async ( hexPublicKey: string, bech32Prefix: string From 7016f531894185e7f4c61988ff5b3ccf72734a60 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 8 Jul 2024 13:16:16 -0400 Subject: [PATCH 295/438] added omniflix hub testnet --- packages/types/chain.ts | 1 + packages/utils/constants/chains.ts | 102 ++++++++++++++++++++--------- 2 files changed, 72 insertions(+), 31 deletions(-) diff --git a/packages/types/chain.ts b/packages/types/chain.ts index 19f0047f4..437e8e227 100644 --- a/packages/types/chain.ts +++ b/packages/types/chain.ts @@ -79,6 +79,7 @@ export enum ChainId { BitsongMainnet = 'bitsong-2b', BitsongTestnet = 'bobnet', OmniflixHubMainnet = 'omniflixhub-1', + OmniflixHubTestnet = 'flixnet-4', SecretMainnet = 'secret-4', SecretTestnet = 'pulsar-3', } diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 8fc79742c..7a8638b39 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -21,60 +21,58 @@ const assets = [...chainRegistryAssets] // BitSong Testnet const bitSongTestnetChain: Chain = { + ...chains.find((c) => c.chain_id === ChainId.BitsongMainnet)!, chain_name: 'bitsongtestnet', status: 'live', network_type: 'testnet', pretty_name: 'BitSong Testnet', - chain_id: 'bobnet', - bech32_prefix: 'bitsong', - bech32_config: { - bech32PrefixAccAddr: 'bitsong', - bech32PrefixAccPub: 'bitsongpub', - bech32PrefixValAddr: 'bitsongvaloper', - bech32PrefixValPub: 'bitsongvaloperpub', - bech32PrefixConsAddr: 'bitsongvalcons', - bech32PrefixConsPub: 'bitsongvalconspub', - }, - slip44: 639, - logo_URIs: { - png: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/bitsong/images/btsg.png', - }, - fees: { - fee_tokens: [ + chain_id: ChainId.BitsongTestnet, + apis: { + rpc: [ { - denom: 'ubtsg', - fixed_min_gas_price: 0, - low_gas_price: 0, - average_gas_price: 0, - high_gas_price: 0, + address: 'https://rpc-testnet.explorebitsong.com', }, ], - }, - staking: { - staking_tokens: [ + rest: [ { - denom: 'ubtsg', + address: 'https://lcd-testnet.explorebitsong.com', }, ], }, +} +chains.push(bitSongTestnetChain) +assets.push({ + chain_name: bitSongTestnetChain.chain_name, + // Copy assets from BitSong mainnet. + assets: assets.find((a) => a.chain_name === 'bitsong')?.assets ?? [], +}) + +// OmniFlix Hub Testnet +const omniFlixHubTestnetChain: Chain = { + ...chains.find((c) => c.chain_id === ChainId.OmniflixHubMainnet)!, + chain_name: 'omniflixhubtestnet', + status: 'live', + network_type: 'testnet', + pretty_name: 'OmniFlix Hub Testnet', + chain_id: ChainId.OmniflixHubTestnet, apis: { rpc: [ { - address: 'https://rpc-testnet.explorebitsong.com', + address: 'https://rpc.testnet.omniflix.network', }, ], rest: [ { - address: 'https://lcd-testnet.explorebitsong.com', + address: 'https://api.testnet.omniflix.network', }, ], }, } -chains.push(bitSongTestnetChain) +chains.push(omniFlixHubTestnetChain) assets.push({ - chain_name: bitSongTestnetChain.chain_name, - // Copy assets from BitSong mainnet. - assets: assets.find((a) => a.chain_name === 'bitsong')?.assets ?? [], + chain_name: omniFlixHubTestnetChain.chain_name, + // Copy assets from OmniFlix Hub mainnet. + assets: assets.find((a) => a.chain_name === 'omniflixhub')?.assets ?? [], }) // Remove thorchain and althea since they spam the console. @@ -2113,6 +2111,44 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ DaoVotingTokenStaked: 28, }, }, + { + chainId: ChainId.OmniflixHubTestnet, + name: 'omniflixhub', + mainnet: false, + accentColor: '#d71d6a', + // NFT DAOs not yet ready. + nftDaosUnderDevelopment: true, + factoryContractAddress: + 'omniflix1990vf0gumc2wqynl6cr836avhfd89y9225q0dk0s5dwzm7pnkgtqmn4dy7', + explorerUrlTemplates: { + tx: 'https://testnet.ping.pub/omniflix/tx/REPLACE', + gov: 'https://testnet.ping.pub/omniflix/gov', + govProp: 'https://testnet.ping.pub/omniflix/gov/REPLACE', + wallet: 'https://testnet.ping.pub/omniflix/account/REPLACE', + }, + codeIdsVersion: ContractVersion.V242, + codeIds: { + Cw1Whitelist: 181, + Cw4Group: 182, + CwPayrollFactory: 184, + CwTokenSwap: 185, + CwTokenfactoryIssuerMain: 196, + CwVesting: 186, + DaoCore: 187, + DaoMigrator: -1, + DaoPreProposeApprovalSingle: 189, + DaoPreProposeApprover: 190, + DaoPreProposeMultiple: 191, + DaoPreProposeSingle: 192, + DaoProposalMultiple: 193, + DaoProposalSingle: 194, + DaoVotingCw4: 195, + DaoVotingTokenStaked: 197, + + // Unused + DaoVotingCw721Staked: -1, + }, + }, // TODO(secret-testnet) // { // chainId: ChainId.SecretTestnet, @@ -2301,6 +2337,10 @@ export const CHAIN_ENDPOINTS: Partial< rpc: 'https://omniflix-rpc.polkachu.com', rest: 'https://omniflix-api.polkachu.com', }, + [ChainId.OmniflixHubTestnet]: { + rpc: 'https://rpc.testnet.omniflix.network', + rest: 'https://api.testnet.omniflix.network', + }, [ChainId.SecretTestnet]: { rpc: 'https://rpc.pulsar.scrttestnet.com', rest: 'https://api.pulsar.scrttestnet.com', From ffecf34ccbdcf26c3aa441c4203c22ff35ef9085 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 8 Jul 2024 13:16:20 -0400 Subject: [PATCH 296/438] fixed dispatch script --- packages/dispatch/scripts/deploy.ts | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/packages/dispatch/scripts/deploy.ts b/packages/dispatch/scripts/deploy.ts index 7fda28fb1..4227d3a41 100644 --- a/packages/dispatch/scripts/deploy.ts +++ b/packages/dispatch/scripts/deploy.ts @@ -13,7 +13,11 @@ import { makeReactQueryClient, skipQueries, } from '@dao-dao/state' -import { SupportedChainConfig, cwMsgToEncodeObject } from '@dao-dao/types' +import { + ContractVersion, + SupportedChainConfig, + cwMsgToEncodeObject, +} from '@dao-dao/types' import { MsgExec } from '@dao-dao/types/protobuf/codegen/cosmos/authz/v1beta1/tx' import { MsgStoreCode } from '@dao-dao/types/protobuf/codegen/cosmwasm/wasm/v1/tx' import { AccessType } from '@dao-dao/types/protobuf/codegen/cosmwasm/wasm/v1/types' @@ -371,21 +375,23 @@ const main = async () => { log() log(chalk.green('Done! UI config entry:')) + const mainnet = + 'is_testnet' in chain ? !chain.is_testnet : chain.network_type === 'mainnet' + const explorerUrlDomain = mainnet ? 'ping.pub' : 'testnet.ping.pub' + const config: SupportedChainConfig = { chainId, name: chainName, - mainnet: - 'is_testnet' in chain - ? !chain.is_testnet - : chain.network_type === 'mainnet', + mainnet, accentColor: 'ACCENT_COLOR', factoryContractAddress: adminFactoryAddress, explorerUrlTemplates: { - tx: `https://ping.pub/${chainName}/tx/REPLACE`, - gov: `https://ping.pub/${chainName}/gov`, - govProp: `https://ping.pub/${chainName}/gov/REPLACE`, - wallet: `https://ping.pub/${chainName}/account/REPLACE`, + tx: `https://${explorerUrlDomain}/${chainName}/tx/REPLACE`, + gov: `https://${explorerUrlDomain}/${chainName}/gov`, + govProp: `https://${explorerUrlDomain}/${chainName}/gov/REPLACE`, + wallet: `https://${explorerUrlDomain}/${chainName}/account/REPLACE`, }, + codeIdsVersion: ContractVersion.Unknown, codeIds: { Cw1Whitelist: codeIdMap['cw1_whitelist'] ?? -1, Cw4Group: codeIdMap['cw4_group'] ?? -1, From b4653e5acf3771e837de1abd4e73584341d635a5 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 8 Jul 2024 13:25:13 -0400 Subject: [PATCH 297/438] fixed type --- .../queries/contracts/DaoVotingCw721Staked.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/state/query/queries/contracts/DaoVotingCw721Staked.ts b/packages/state/query/queries/contracts/DaoVotingCw721Staked.ts index 8e0208153..b6982c703 100644 --- a/packages/state/query/queries/contracts/DaoVotingCw721Staked.ts +++ b/packages/state/query/queries/contracts/DaoVotingCw721Staked.ts @@ -259,14 +259,13 @@ export const daoVotingCw721StakedQueries = { try { // Attempt to fetch data from the indexer. return { - active_threshold: - (await queryClient.fetchQuery( - indexerQueries.queryContract(queryClient, { - chainId, - contractAddress, - formula: 'daoVotingCw721Staked/activeThreshold', - }) - )) || null, + active_threshold: await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'daoVotingCw721Staked/activeThreshold', + }) + ), } } catch (error) { console.error(error) From a02f9190839b48de1b6a35e926ecbbc3f670f6ea Mon Sep 17 00:00:00 2001 From: noah Date: Mon, 8 Jul 2024 18:30:02 -0400 Subject: [PATCH 298/438] Support OmniFlix testnet (#1801) --- packages/state/contracts/Cw721Base.ts | 170 +- .../state/contracts/DaoVotingOnftStaked.ts | 485 +++++ packages/state/contracts/index.ts | 4 + packages/state/query/queries/chain.ts | 51 +- .../query/queries/contracts/Cw721Base.ts | 543 +++++ .../contracts/DaoVotingCw721Staked.extra.ts | 88 + .../queries/contracts/DaoVotingCw721Staked.ts | 18 +- .../contracts/DaoVotingOnftStaked.extra.ts | 89 + .../queries/contracts/DaoVotingOnftStaked.ts | 453 ++++ .../state/query/queries/contracts/index.ts | 4 + packages/state/query/queries/index.ts | 2 + packages/state/query/queries/nft.ts | 103 + packages/state/query/queries/omniflix.ts | 254 +++ packages/state/recoil/selectors/chain.ts | 52 +- .../recoil/selectors/contracts/CommonNft.ts | 107 +- .../recoil/selectors/contracts/Cw721Base.ts | 15 +- .../contracts/DaoVotingCw721Staked.ts | 61 - packages/state/recoil/selectors/nft.ts | 85 +- packages/stateful/clients/dao/CwDao.ts | 2 + .../voting-module/OnftStakedVotingModule.ts | 100 + .../stateful/clients/voting-module/index.ts | 1 + .../stateful/components/nft/LazyNftCard.tsx | 25 +- .../components/nft/NftSelectionModal.tsx | 1 + .../NftBased/GovernanceConfigurationInput.tsx | 129 +- .../GovernanceConfigurationReview.tsx | 27 +- .../creators/NftBased/getInstantiateInfo.ts | 69 +- packages/stateful/creators/NftBased/types.ts | 4 +- .../stateful/server/makeGetDaoStaticProps.ts | 2 +- .../adapters/DaoVotingCw20Staked/types.ts | 1 - .../components/MembersTab.tsx | 16 +- .../components/StakingModal.tsx | 2 +- .../hooks/useMainDaoInfoCards.tsx | 18 +- .../hooks/useStakingInfo.ts | 28 +- .../adapters/DaoVotingCw721Staked/types.ts | 2 +- .../adapters/DaoVotingNativeStaked/types.ts | 1 - .../UpdateStakingConfig/Component.stories.tsx | 37 + .../actions/UpdateStakingConfig/Component.tsx | 112 + .../actions/UpdateStakingConfig/README.md | 24 + .../actions/UpdateStakingConfig/index.ts | 113 + .../DaoVotingOnftStaked/actions/index.ts | 1 + .../components/MembersTab.tsx | 63 + .../components/NftCollectionTab.tsx | 77 + .../components/ProfileCardMemberInfo.tsx | 222 ++ .../components/StakingModal.tsx | 321 +++ .../DaoVotingOnftStaked/components/index.ts | 4 + .../DaoVotingOnftStaked/hooks/index.ts | 5 + .../hooks/useCommonGovernanceTokenInfo.ts | 46 + .../hooks/useGovernanceCollectionInfo.ts | 127 ++ .../hooks/useMainDaoInfoCards.tsx | 82 + .../hooks/useStakingInfo.ts | 319 +++ .../hooks/useVotingModuleRelevantAddresses.ts | 26 + .../adapters/DaoVotingOnftStaked/index.ts | 73 + .../adapters/DaoVotingOnftStaked/types.ts | 61 + .../adapters/DaoVotingTokenStaked/types.ts | 1 - .../voting-module-adapter/adapters/index.ts | 1 + .../stateful/voting-module-adapter/core.ts | 2 + packages/types/chain.ts | 3 + packages/types/contracts/Cw721Base.ts | 154 +- .../types/contracts/DaoVotingOnftStaked.ts | 170 ++ .../types/protobuf/codegen/OmniFlix/bundle.ts | 30 + .../types/protobuf/codegen/OmniFlix/client.ts | 47 + .../codegen/OmniFlix/onft/v1beta1/genesis.ts | 104 + .../codegen/OmniFlix/onft/v1beta1/onft.ts | 1355 ++++++++++++ .../codegen/OmniFlix/onft/v1beta1/params.ts | 82 + .../OmniFlix/onft/v1beta1/query.rpc.Query.ts | 138 ++ .../codegen/OmniFlix/onft/v1beta1/query.ts | 1825 +++++++++++++++++ .../codegen/OmniFlix/onft/v1beta1/tx.amino.ts | 43 + .../OmniFlix/onft/v1beta1/tx.registry.ts | 161 ++ .../OmniFlix/onft/v1beta1/tx.rpc.msg.ts | 73 + .../codegen/OmniFlix/onft/v1beta1/tx.ts | 1735 ++++++++++++++++ .../protobuf/codegen/OmniFlix/rpc.query.ts | 61 + .../types/protobuf/codegen/OmniFlix/rpc.tx.ts | 45 + .../types/protobuf/codegen/alliance/bundle.ts | 24 +- .../types/protobuf/codegen/bitsong/bundle.ts | 16 +- .../types/protobuf/codegen/circle/bundle.ts | 24 +- .../types/protobuf/codegen/cosmos/bundle.ts | 196 +- .../types/protobuf/codegen/cosmwasm/bundle.ts | 40 +- .../codegen/cosmwasm/wasm/v1/types.ts | 2 +- .../protobuf/codegen/feemarket/bundle.ts | 24 +- .../types/protobuf/codegen/gaia/bundle.ts | 24 +- packages/types/protobuf/codegen/ibc/bundle.ts | 68 +- packages/types/protobuf/codegen/index.ts | 2 + .../types/protobuf/codegen/juno/bundle.ts | 40 +- .../types/protobuf/codegen/kujira/bundle.ts | 44 +- .../types/protobuf/codegen/neutron/bundle.ts | 104 +- .../types/protobuf/codegen/noble/bundle.ts | 20 +- .../types/protobuf/codegen/osmosis/bundle.ts | 480 ++--- .../types/protobuf/codegen/pstake/bundle.ts | 134 +- .../protobuf/codegen/publicawesome/bundle.ts | 120 +- .../types/protobuf/codegen/regen/bundle.ts | 200 +- .../types/protobuf/codegen/secret/bundle.ts | 116 +- .../protobuf/codegen/tendermint/bundle.ts | 40 +- .../OmniFlix/alloc/v1beta1/genesis.proto | 12 + .../proto/OmniFlix/alloc/v1beta1/params.proto | 66 + .../proto/OmniFlix/alloc/v1beta1/query.proto | 27 + .../proto/OmniFlix/alloc/v1beta1/tx.proto | 39 + .../OmniFlix/globalfee/v1beta1/genesis.proto | 43 + .../OmniFlix/globalfee/v1beta1/query.proto | 27 + .../proto/OmniFlix/globalfee/v1beta1/tx.proto | 42 + .../proto/OmniFlix/itc/v1/genesis.proto | 16 + .../protobuf/proto/OmniFlix/itc/v1/itc.proto | 121 ++ .../proto/OmniFlix/itc/v1/params.proto | 23 + .../proto/OmniFlix/itc/v1/query.proto | 75 + .../protobuf/proto/OmniFlix/itc/v1/tx.proto | 133 ++ .../marketplace/v1beta1/auction.proto | 60 + .../OmniFlix/marketplace/v1beta1/events.proto | 63 + .../marketplace/v1beta1/genesis.proto | 19 + .../marketplace/v1beta1/listing.proto | 35 + .../OmniFlix/marketplace/v1beta1/params.proto | 42 + .../OmniFlix/marketplace/v1beta1/query.proto | 173 ++ .../OmniFlix/marketplace/v1beta1/tx.proto | 187 ++ .../proto/OmniFlix/onft/v1beta1/genesis.proto | 13 + .../proto/OmniFlix/onft/v1beta1/onft.proto | 131 ++ .../proto/OmniFlix/onft/v1beta1/params.proto | 18 + .../proto/OmniFlix/onft/v1beta1/query.proto | 151 ++ .../proto/OmniFlix/onft/v1beta1/tx.proto | 179 ++ packages/types/protobuf/scripts/codegen.js | 1 + packages/types/protobuf/utils.ts | 4 + packages/types/token.ts | 13 + packages/utils/client.ts | 17 + packages/utils/constants/chains.ts | 3 +- packages/utils/constants/contracts.ts | 4 + packages/utils/pagination.ts | 26 +- 123 files changed, 12864 insertions(+), 1372 deletions(-) create mode 100644 packages/state/contracts/DaoVotingOnftStaked.ts create mode 100644 packages/state/query/queries/contracts/Cw721Base.ts create mode 100644 packages/state/query/queries/contracts/DaoVotingCw721Staked.extra.ts create mode 100644 packages/state/query/queries/contracts/DaoVotingOnftStaked.extra.ts create mode 100644 packages/state/query/queries/contracts/DaoVotingOnftStaked.ts create mode 100644 packages/state/query/queries/nft.ts create mode 100644 packages/state/query/queries/omniflix.ts create mode 100644 packages/stateful/clients/voting-module/OnftStakedVotingModule.ts create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/actions/UpdateStakingConfig/Component.stories.tsx create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/actions/UpdateStakingConfig/Component.tsx create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/actions/UpdateStakingConfig/README.md create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/actions/UpdateStakingConfig/index.ts create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/actions/index.ts create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/components/MembersTab.tsx create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/components/NftCollectionTab.tsx create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/components/ProfileCardMemberInfo.tsx create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/components/StakingModal.tsx create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/components/index.ts create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/index.ts create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useCommonGovernanceTokenInfo.ts create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useGovernanceCollectionInfo.ts create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useMainDaoInfoCards.tsx create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useStakingInfo.ts create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useVotingModuleRelevantAddresses.ts create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/index.ts create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/types.ts create mode 100644 packages/types/contracts/DaoVotingOnftStaked.ts create mode 100644 packages/types/protobuf/codegen/OmniFlix/bundle.ts create mode 100644 packages/types/protobuf/codegen/OmniFlix/client.ts create mode 100644 packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/genesis.ts create mode 100644 packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/onft.ts create mode 100644 packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/params.ts create mode 100644 packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/query.rpc.Query.ts create mode 100644 packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/query.ts create mode 100644 packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/tx.amino.ts create mode 100644 packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/tx.registry.ts create mode 100644 packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/tx.rpc.msg.ts create mode 100644 packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/tx.ts create mode 100644 packages/types/protobuf/codegen/OmniFlix/rpc.query.ts create mode 100644 packages/types/protobuf/codegen/OmniFlix/rpc.tx.ts create mode 100644 packages/types/protobuf/proto/OmniFlix/alloc/v1beta1/genesis.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/alloc/v1beta1/params.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/alloc/v1beta1/query.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/alloc/v1beta1/tx.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/globalfee/v1beta1/genesis.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/globalfee/v1beta1/query.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/globalfee/v1beta1/tx.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/itc/v1/genesis.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/itc/v1/itc.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/itc/v1/params.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/itc/v1/query.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/itc/v1/tx.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/auction.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/events.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/genesis.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/listing.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/params.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/query.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/tx.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/onft/v1beta1/genesis.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/onft/v1beta1/onft.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/onft/v1beta1/params.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/onft/v1beta1/query.proto create mode 100644 packages/types/protobuf/proto/OmniFlix/onft/v1beta1/tx.proto diff --git a/packages/state/contracts/Cw721Base.ts b/packages/state/contracts/Cw721Base.ts index 9a7b0878f..7b3f60a82 100644 --- a/packages/state/contracts/Cw721Base.ts +++ b/packages/state/contracts/Cw721Base.ts @@ -1,3 +1,9 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + import { Coin, StdFee } from '@cosmjs/amino' import { CosmWasmClient, @@ -6,18 +12,23 @@ import { SigningCosmWasmClient, } from '@cosmjs/cosmwasm-stargate' -import { Empty, Expiration } from '@dao-dao/types/contracts/common' import { - AllNftInfoResponse, - AllOperatorsResponse, - AllTokensResponse, + Action, + AllNftInfoResponseForEmpty, ApprovalResponse, ApprovalsResponse, + Binary, ContractInfoResponse, + Empty, + Expiration, MinterResponse, - NftInfoResponse, + NftInfoResponseForEmpty, + Null, NumTokensResponse, + OperatorResponse, + OperatorsResponse, OwnerOfResponse, + OwnershipForString, TokensResponse, } from '@dao-dao/types/contracts/Cw721Base' import { CHAIN_GAS_MULTIPLIER } from '@dao-dao/utils' @@ -47,6 +58,15 @@ export interface Cw721BaseReadOnlyInterface { includeExpired?: boolean tokenId: string }) => Promise + operator: ({ + includeExpired, + operator, + owner, + }: { + includeExpired?: boolean + operator: string + owner: string + }) => Promise allOperators: ({ includeExpired, limit, @@ -57,17 +77,21 @@ export interface Cw721BaseReadOnlyInterface { limit?: number owner: string startAfter?: string - }) => Promise + }) => Promise numTokens: () => Promise contractInfo: () => Promise - nftInfo: ({ tokenId }: { tokenId: string }) => Promise + nftInfo: ({ + tokenId, + }: { + tokenId: string + }) => Promise allNftInfo: ({ includeExpired, tokenId, }: { includeExpired?: boolean tokenId: string - }) => Promise + }) => Promise tokens: ({ limit, owner, @@ -83,19 +107,21 @@ export interface Cw721BaseReadOnlyInterface { }: { limit?: number startAfter?: string - }) => Promise + }) => Promise minter: () => Promise + extension: ({ msg }: { msg: Empty }) => Promise + ownership: () => Promise } export class Cw721BaseQueryClient implements Cw721BaseReadOnlyInterface { client: CosmWasmClient contractAddress: string - constructor(client: CosmWasmClient, contractAddress: string) { this.client = client this.contractAddress = contractAddress this.ownerOf = this.ownerOf.bind(this) this.approval = this.approval.bind(this) this.approvals = this.approvals.bind(this) + this.operator = this.operator.bind(this) this.allOperators = this.allOperators.bind(this) this.numTokens = this.numTokens.bind(this) this.contractInfo = this.contractInfo.bind(this) @@ -104,8 +130,9 @@ export class Cw721BaseQueryClient implements Cw721BaseReadOnlyInterface { this.tokens = this.tokens.bind(this) this.allTokens = this.allTokens.bind(this) this.minter = this.minter.bind(this) + this.extension = this.extension.bind(this) + this.ownership = this.ownership.bind(this) } - ownerOf = async ({ includeExpired, tokenId, @@ -151,6 +178,23 @@ export class Cw721BaseQueryClient implements Cw721BaseReadOnlyInterface { }, }) } + operator = async ({ + includeExpired, + operator, + owner, + }: { + includeExpired?: boolean + operator: string + owner: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operator: { + include_expired: includeExpired, + operator, + owner, + }, + }) + } allOperators = async ({ includeExpired, limit, @@ -161,7 +205,7 @@ export class Cw721BaseQueryClient implements Cw721BaseReadOnlyInterface { limit?: number owner: string startAfter?: string - }): Promise => { + }): Promise => { return this.client.queryContractSmart(this.contractAddress, { all_operators: { include_expired: includeExpired, @@ -185,7 +229,7 @@ export class Cw721BaseQueryClient implements Cw721BaseReadOnlyInterface { tokenId, }: { tokenId: string - }): Promise => { + }): Promise => { return this.client.queryContractSmart(this.contractAddress, { nft_info: { token_id: tokenId, @@ -198,7 +242,7 @@ export class Cw721BaseQueryClient implements Cw721BaseReadOnlyInterface { }: { includeExpired?: boolean tokenId: string - }): Promise => { + }): Promise => { return this.client.queryContractSmart(this.contractAddress, { all_nft_info: { include_expired: includeExpired, @@ -229,7 +273,7 @@ export class Cw721BaseQueryClient implements Cw721BaseReadOnlyInterface { }: { limit?: number startAfter?: string - }): Promise => { + }): Promise => { return this.client.queryContractSmart(this.contractAddress, { all_tokens: { limit, @@ -242,6 +286,18 @@ export class Cw721BaseQueryClient implements Cw721BaseReadOnlyInterface { minter: {}, }) } + extension = async ({ msg }: { msg: Empty }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + extension: { + msg, + }, + }) + } + ownership = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership: {}, + }) + } } export interface Cw721BaseInterface extends Cw721BaseReadOnlyInterface { contractAddress: string @@ -256,7 +312,7 @@ export interface Cw721BaseInterface extends Cw721BaseReadOnlyInterface { }, fee?: number | StdFee | 'auto', memo?: string, - funds?: readonly Coin[] + _funds?: Coin[] ) => Promise sendNft: ( { @@ -265,12 +321,12 @@ export interface Cw721BaseInterface extends Cw721BaseReadOnlyInterface { tokenId, }: { contract: string - msg: string + msg: Binary tokenId: string }, fee?: number | StdFee | 'auto', memo?: string, - funds?: readonly Coin[] + _funds?: Coin[] ) => Promise approve: ( { @@ -284,7 +340,7 @@ export interface Cw721BaseInterface extends Cw721BaseReadOnlyInterface { }, fee?: number | StdFee | 'auto', memo?: string, - funds?: readonly Coin[] + _funds?: Coin[] ) => Promise revoke: ( { @@ -296,7 +352,7 @@ export interface Cw721BaseInterface extends Cw721BaseReadOnlyInterface { }, fee?: number | StdFee | 'auto', memo?: string, - funds?: readonly Coin[] + _funds?: Coin[] ) => Promise approveAll: ( { @@ -308,7 +364,7 @@ export interface Cw721BaseInterface extends Cw721BaseReadOnlyInterface { }, fee?: number | StdFee | 'auto', memo?: string, - funds?: readonly Coin[] + _funds?: Coin[] ) => Promise revokeAll: ( { @@ -318,7 +374,7 @@ export interface Cw721BaseInterface extends Cw721BaseReadOnlyInterface { }, fee?: number | StdFee | 'auto', memo?: string, - funds?: readonly Coin[] + _funds?: Coin[] ) => Promise mint: ( { @@ -327,14 +383,14 @@ export interface Cw721BaseInterface extends Cw721BaseReadOnlyInterface { tokenId, tokenUri, }: { - extension?: Empty + extension: Empty owner: string tokenId: string tokenUri?: string }, fee?: number | StdFee | 'auto', memo?: string, - funds?: readonly Coin[] + _funds?: Coin[] ) => Promise burn: ( { @@ -344,7 +400,13 @@ export interface Cw721BaseInterface extends Cw721BaseReadOnlyInterface { }, fee?: number | StdFee | 'auto', memo?: string, - funds?: readonly Coin[] + _funds?: Coin[] + ) => Promise + updateOwnership: ( + action: Action, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] ) => Promise } export class Cw721BaseClient @@ -354,7 +416,6 @@ export class Cw721BaseClient client: SigningCosmWasmClient sender: string contractAddress: string - constructor( client: SigningCosmWasmClient, sender: string, @@ -373,8 +434,8 @@ export class Cw721BaseClient this.revokeAll = this.revokeAll.bind(this) this.mint = this.mint.bind(this) this.burn = this.burn.bind(this) + this.updateOwnership = this.updateOwnership.bind(this) } - transferNft = async ( { recipient, @@ -385,7 +446,7 @@ export class Cw721BaseClient }, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: readonly Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, @@ -398,7 +459,7 @@ export class Cw721BaseClient }, fee, memo, - funds + _funds ) } sendNft = async ( @@ -408,12 +469,12 @@ export class Cw721BaseClient tokenId, }: { contract: string - msg: string + msg: Binary tokenId: string }, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: readonly Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, @@ -427,7 +488,7 @@ export class Cw721BaseClient }, fee, memo, - funds + _funds ) } sendNftMultiple = async ( @@ -437,7 +498,7 @@ export class Cw721BaseClient tokenIds, }: { contract: string - msg: string + msg: Binary tokenIds: string[] }, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, @@ -475,7 +536,7 @@ export class Cw721BaseClient }, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: readonly Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, @@ -489,7 +550,7 @@ export class Cw721BaseClient }, fee, memo, - funds + _funds ) } revoke = async ( @@ -502,7 +563,7 @@ export class Cw721BaseClient }, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: readonly Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, @@ -515,7 +576,7 @@ export class Cw721BaseClient }, fee, memo, - funds + _funds ) } approveAll = async ( @@ -528,7 +589,7 @@ export class Cw721BaseClient }, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: readonly Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, @@ -541,7 +602,7 @@ export class Cw721BaseClient }, fee, memo, - funds + _funds ) } revokeAll = async ( @@ -552,7 +613,7 @@ export class Cw721BaseClient }, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: readonly Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, @@ -564,7 +625,7 @@ export class Cw721BaseClient }, fee, memo, - funds + _funds ) } mint = async ( @@ -574,14 +635,14 @@ export class Cw721BaseClient tokenId, tokenUri, }: { - extension?: Empty + extension: Empty owner: string tokenId: string tokenUri?: string }, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: readonly Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, @@ -596,7 +657,7 @@ export class Cw721BaseClient }, fee, memo, - funds + _funds ) } burn = async ( @@ -607,7 +668,7 @@ export class Cw721BaseClient }, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: readonly Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, @@ -619,7 +680,24 @@ export class Cw721BaseClient }, fee, memo, - funds + _funds + ) + } + updateOwnership = async ( + action: Action, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + update_ownership: action, + }, + fee, + memo, + _funds ) } } diff --git a/packages/state/contracts/DaoVotingOnftStaked.ts b/packages/state/contracts/DaoVotingOnftStaked.ts new file mode 100644 index 000000000..5a0b798dc --- /dev/null +++ b/packages/state/contracts/DaoVotingOnftStaked.ts @@ -0,0 +1,485 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import { Coin, StdFee } from '@cosmjs/amino' +import { + CosmWasmClient, + ExecuteResult, + SigningCosmWasmClient, +} from '@cosmjs/cosmwasm-stargate' + +import { + ActiveThreshold, + ActiveThresholdResponse, + Addr, + ArrayOfString, + Boolean, + Config, + Duration, + HooksResponse, + InfoResponse, + NftClaimsResponse, + TotalPowerAtHeightResponse, + VotingPowerAtHeightResponse, +} from '@dao-dao/types/contracts/DaoVotingOnftStaked' +import { CHAIN_GAS_MULTIPLIER } from '@dao-dao/utils' + +export interface DaoVotingOnftStakedReadOnlyInterface { + contractAddress: string + config: () => Promise + nftClaims: ({ address }: { address: string }) => Promise + hooks: () => Promise + stakedNfts: ({ + address, + limit, + startAfter, + }: { + address: string + limit?: number + startAfter?: string + }) => Promise + activeThreshold: () => Promise + isActive: () => Promise + votingPowerAtHeight: ({ + address, + height, + }: { + address: string + height?: number + }) => Promise + totalPowerAtHeight: ({ + height, + }: { + height?: number + }) => Promise + dao: () => Promise + info: () => Promise +} +export class DaoVotingOnftStakedQueryClient + implements DaoVotingOnftStakedReadOnlyInterface +{ + client: CosmWasmClient + contractAddress: string + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client + this.contractAddress = contractAddress + this.config = this.config.bind(this) + this.nftClaims = this.nftClaims.bind(this) + this.hooks = this.hooks.bind(this) + this.stakedNfts = this.stakedNfts.bind(this) + this.activeThreshold = this.activeThreshold.bind(this) + this.isActive = this.isActive.bind(this) + this.votingPowerAtHeight = this.votingPowerAtHeight.bind(this) + this.totalPowerAtHeight = this.totalPowerAtHeight.bind(this) + this.dao = this.dao.bind(this) + this.info = this.info.bind(this) + } + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {}, + }) + } + nftClaims = async ({ + address, + }: { + address: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + nft_claims: { + address, + }, + }) + } + hooks = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + hooks: {}, + }) + } + stakedNfts = async ({ + address, + limit, + startAfter, + }: { + address: string + limit?: number + startAfter?: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + staked_nfts: { + address, + limit, + start_after: startAfter, + }, + }) + } + activeThreshold = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + active_threshold: {}, + }) + } + isActive = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_active: {}, + }) + } + votingPowerAtHeight = async ({ + address, + height, + }: { + address: string + height?: number + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + voting_power_at_height: { + address, + height, + }, + }) + } + totalPowerAtHeight = async ({ + height, + }: { + height?: number + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + total_power_at_height: { + height, + }, + }) + } + dao = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + dao: {}, + }) + } + info = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + info: {}, + }) + } +} +export interface DaoVotingOnftStakedInterface + extends DaoVotingOnftStakedReadOnlyInterface { + contractAddress: string + sender: string + prepareStake: ( + { + tokenIds, + }: { + tokenIds: string[] + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + confirmStake: ( + { + tokenIds, + }: { + tokenIds: string[] + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + cancelStake: ( + { + recipient, + tokenIds, + }: { + recipient?: string + tokenIds: string[] + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + unstake: ( + { + tokenIds, + }: { + tokenIds: string[] + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + claimNfts: ( + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + updateConfig: ( + { + duration, + }: { + duration?: Duration + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + addHook: ( + { + addr, + }: { + addr: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + removeHook: ( + { + addr, + }: { + addr: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + updateActiveThreshold: ( + { + newThreshold, + }: { + newThreshold?: ActiveThreshold + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise +} +export class DaoVotingOnftStakedClient + extends DaoVotingOnftStakedQueryClient + implements DaoVotingOnftStakedInterface +{ + client: SigningCosmWasmClient + sender: string + contractAddress: string + constructor( + client: SigningCosmWasmClient, + sender: string, + contractAddress: string + ) { + super(client, contractAddress) + this.client = client + this.sender = sender + this.contractAddress = contractAddress + this.prepareStake = this.prepareStake.bind(this) + this.confirmStake = this.confirmStake.bind(this) + this.cancelStake = this.cancelStake.bind(this) + this.unstake = this.unstake.bind(this) + this.claimNfts = this.claimNfts.bind(this) + this.updateConfig = this.updateConfig.bind(this) + this.addHook = this.addHook.bind(this) + this.removeHook = this.removeHook.bind(this) + this.updateActiveThreshold = this.updateActiveThreshold.bind(this) + } + prepareStake = async ( + { + tokenIds, + }: { + tokenIds: string[] + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + prepare_stake: { + token_ids: tokenIds, + }, + }, + fee, + memo, + _funds + ) + } + confirmStake = async ( + { + tokenIds, + }: { + tokenIds: string[] + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + confirm_stake: { + token_ids: tokenIds, + }, + }, + fee, + memo, + _funds + ) + } + cancelStake = async ( + { + recipient, + tokenIds, + }: { + recipient?: string + tokenIds: string[] + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + cancel_stake: { + recipient, + token_ids: tokenIds, + }, + }, + fee, + memo, + _funds + ) + } + unstake = async ( + { + tokenIds, + }: { + tokenIds: string[] + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + unstake: { + token_ids: tokenIds, + }, + }, + fee, + memo, + _funds + ) + } + claimNfts = async ( + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + claim_nfts: {}, + }, + fee, + memo, + _funds + ) + } + updateConfig = async ( + { + duration, + }: { + duration?: Duration + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + update_config: { + duration, + }, + }, + fee, + memo, + _funds + ) + } + addHook = async ( + { + addr, + }: { + addr: string + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + add_hook: { + addr, + }, + }, + fee, + memo, + _funds + ) + } + removeHook = async ( + { + addr, + }: { + addr: string + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + remove_hook: { + addr, + }, + }, + fee, + memo, + _funds + ) + } + updateActiveThreshold = async ( + { + newThreshold, + }: { + newThreshold?: ActiveThreshold + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + update_active_threshold: { + new_threshold: newThreshold, + }, + }, + fee, + memo, + _funds + ) + } +} diff --git a/packages/state/contracts/index.ts b/packages/state/contracts/index.ts index 1b23db70b..35a14f452 100644 --- a/packages/state/contracts/index.ts +++ b/packages/state/contracts/index.ts @@ -132,3 +132,7 @@ export { SecretDaoVotingSnip20StakedClient, SecretDaoVotingSnip20StakedQueryClient, } from './SecretDaoVotingSnip20Staked' +export { + DaoVotingOnftStakedClient, + DaoVotingOnftStakedQueryClient, +} from './DaoVotingOnftStaked' diff --git a/packages/state/query/queries/chain.ts b/packages/state/query/queries/chain.ts index 38a3af6f1..d02757c23 100644 --- a/packages/state/query/queries/chain.ts +++ b/packages/state/query/queries/chain.ts @@ -522,18 +522,19 @@ export const fetchGovProposals = async ( if (supportsV1Gov) { try { if (limit === undefined && offset === undefined) { - v1Proposals = await getAllRpcResponse( - client.gov.v1.proposals, - { - proposalStatus: - status || ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED, - voter: '', - depositor: '', - pagination: undefined, - }, - 'proposals', - true - ) + v1Proposals = + (await getAllRpcResponse( + client.gov.v1.proposals, + { + proposalStatus: + status || ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED, + voter: '', + depositor: '', + pagination: undefined, + }, + 'proposals', + true + )) || [] total = v1Proposals.length } else { const response = await client.gov.v1.proposals({ @@ -565,18 +566,20 @@ export const fetchGovProposals = async ( if (!v1Proposals) { if (limit === undefined && offset === undefined) { - v1Beta1Proposals = await getAllRpcResponse( - client.gov.v1beta1.proposals, - { - proposalStatus: status || ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED, - voter: '', - depositor: '', - pagination: undefined, - }, - 'proposals', - true, - true - ) + v1Beta1Proposals = + (await getAllRpcResponse( + client.gov.v1beta1.proposals, + { + proposalStatus: + status || ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED, + voter: '', + depositor: '', + pagination: undefined, + }, + 'proposals', + true, + true + )) || [] total = v1Beta1Proposals.length } else { const response = await client.gov.v1beta1.proposals( diff --git a/packages/state/query/queries/contracts/Cw721Base.ts b/packages/state/query/queries/contracts/Cw721Base.ts new file mode 100644 index 000000000..dd5aed14b --- /dev/null +++ b/packages/state/query/queries/contracts/Cw721Base.ts @@ -0,0 +1,543 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +/** + * Don't use indexer in this file since there are too many possible cw721 + * contracts and people modify them heavily, so we can't reliably index them. + */ + +import { UseQueryOptions } from '@tanstack/react-query' + +import { + AllNftInfoResponseForEmpty, + ApprovalResponse, + ApprovalsResponse, + ContractInfoResponse, + Empty, + MinterResponse, + NftInfoResponseForEmpty, + Null, + NumTokensResponse, + OperatorResponse, + OperatorsResponse, + OwnerOfResponse, + OwnershipForString, + TokensResponse, +} from '@dao-dao/types/contracts/Cw721Base' +import { getCosmWasmClientForChainId } from '@dao-dao/utils' + +import { Cw721BaseQueryClient } from '../../../contracts/Cw721Base' + +export const cw721BaseQueryKeys = { + contract: [ + { + contract: 'cw721Base', + }, + ] as const, + address: (contractAddress: string) => + [ + { + ...cw721BaseQueryKeys.contract[0], + address: contractAddress, + }, + ] as const, + ownerOf: (contractAddress: string, args?: Record) => + [ + { + ...cw721BaseQueryKeys.address(contractAddress)[0], + method: 'owner_of', + args, + }, + ] as const, + approval: (contractAddress: string, args?: Record) => + [ + { + ...cw721BaseQueryKeys.address(contractAddress)[0], + method: 'approval', + args, + }, + ] as const, + approvals: (contractAddress: string, args?: Record) => + [ + { + ...cw721BaseQueryKeys.address(contractAddress)[0], + method: 'approvals', + args, + }, + ] as const, + operator: (contractAddress: string, args?: Record) => + [ + { + ...cw721BaseQueryKeys.address(contractAddress)[0], + method: 'operator', + args, + }, + ] as const, + allOperators: (contractAddress: string, args?: Record) => + [ + { + ...cw721BaseQueryKeys.address(contractAddress)[0], + method: 'all_operators', + args, + }, + ] as const, + numTokens: (contractAddress: string, args?: Record) => + [ + { + ...cw721BaseQueryKeys.address(contractAddress)[0], + method: 'num_tokens', + args, + }, + ] as const, + contractInfo: (contractAddress: string, args?: Record) => + [ + { + ...cw721BaseQueryKeys.address(contractAddress)[0], + method: 'contract_info', + args, + }, + ] as const, + nftInfo: (contractAddress: string, args?: Record) => + [ + { + ...cw721BaseQueryKeys.address(contractAddress)[0], + method: 'nft_info', + args, + }, + ] as const, + allNftInfo: (contractAddress: string, args?: Record) => + [ + { + ...cw721BaseQueryKeys.address(contractAddress)[0], + method: 'all_nft_info', + args, + }, + ] as const, + tokens: (contractAddress: string, args?: Record) => + [ + { + ...cw721BaseQueryKeys.address(contractAddress)[0], + method: 'tokens', + args, + }, + ] as const, + allTokens: (contractAddress: string, args?: Record) => + [ + { + ...cw721BaseQueryKeys.address(contractAddress)[0], + method: 'all_tokens', + args, + }, + ] as const, + minter: (contractAddress: string, args?: Record) => + [ + { + ...cw721BaseQueryKeys.address(contractAddress)[0], + method: 'minter', + args, + }, + ] as const, + extension: (contractAddress: string, args?: Record) => + [ + { + ...cw721BaseQueryKeys.address(contractAddress)[0], + method: 'extension', + args, + }, + ] as const, + ownership: (contractAddress: string, args?: Record) => + [ + { + ...cw721BaseQueryKeys.address(contractAddress)[0], + method: 'ownership', + args, + }, + ] as const, +} +export const cw721BaseQueries = { + ownerOf: ({ + chainId, + contractAddress, + args, + options, + }: Cw721BaseOwnerOfQuery): UseQueryOptions< + OwnerOfResponse, + Error, + TData + > => ({ + queryKey: cw721BaseQueryKeys.ownerOf(contractAddress, args), + queryFn: async () => { + return new Cw721BaseQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).ownerOf({ + includeExpired: args.includeExpired, + tokenId: args.tokenId, + }) + }, + ...options, + }), + approval: ({ + chainId, + contractAddress, + args, + options, + }: Cw721BaseApprovalQuery): UseQueryOptions< + ApprovalResponse, + Error, + TData + > => ({ + queryKey: cw721BaseQueryKeys.approval(contractAddress, args), + queryFn: async () => { + return new Cw721BaseQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).approval({ + includeExpired: args.includeExpired, + spender: args.spender, + tokenId: args.tokenId, + }) + }, + ...options, + }), + approvals: ({ + chainId, + contractAddress, + args, + options, + }: Cw721BaseApprovalsQuery): UseQueryOptions< + ApprovalsResponse, + Error, + TData + > => ({ + queryKey: cw721BaseQueryKeys.approvals(contractAddress, args), + queryFn: async () => { + return new Cw721BaseQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).approvals({ + includeExpired: args.includeExpired, + tokenId: args.tokenId, + }) + }, + ...options, + }), + operator: ({ + chainId, + contractAddress, + args, + options, + }: Cw721BaseOperatorQuery): UseQueryOptions< + OperatorResponse, + Error, + TData + > => ({ + queryKey: cw721BaseQueryKeys.operator(contractAddress, args), + queryFn: async () => { + return new Cw721BaseQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).operator({ + includeExpired: args.includeExpired, + operator: args.operator, + owner: args.owner, + }) + }, + ...options, + }), + allOperators: ({ + chainId, + contractAddress, + args, + options, + }: Cw721BaseAllOperatorsQuery): UseQueryOptions< + OperatorsResponse, + Error, + TData + > => ({ + queryKey: cw721BaseQueryKeys.allOperators(contractAddress, args), + queryFn: async () => { + return new Cw721BaseQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).allOperators({ + includeExpired: args.includeExpired, + limit: args.limit, + owner: args.owner, + startAfter: args.startAfter, + }) + }, + ...options, + }), + numTokens: ({ + chainId, + contractAddress, + options, + }: Cw721BaseNumTokensQuery): UseQueryOptions< + NumTokensResponse, + Error, + TData + > => ({ + queryKey: cw721BaseQueryKeys.numTokens(contractAddress), + queryFn: async () => { + return new Cw721BaseQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).numTokens() + }, + ...options, + }), + contractInfo: ({ + chainId, + contractAddress, + options, + }: Cw721BaseContractInfoQuery): UseQueryOptions< + ContractInfoResponse, + Error, + TData + > => ({ + queryKey: cw721BaseQueryKeys.contractInfo(contractAddress), + queryFn: async () => { + return new Cw721BaseQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).contractInfo() + }, + ...options, + }), + nftInfo: ({ + chainId, + contractAddress, + args, + options, + }: Cw721BaseNftInfoQuery): UseQueryOptions< + NftInfoResponseForEmpty, + Error, + TData + > => ({ + queryKey: cw721BaseQueryKeys.nftInfo(contractAddress, args), + queryFn: async () => { + return new Cw721BaseQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).nftInfo({ + tokenId: args.tokenId, + }) + }, + ...options, + }), + allNftInfo: ({ + chainId, + contractAddress, + args, + options, + }: Cw721BaseAllNftInfoQuery): UseQueryOptions< + AllNftInfoResponseForEmpty, + Error, + TData + > => ({ + queryKey: cw721BaseQueryKeys.allNftInfo(contractAddress, args), + queryFn: async () => { + return new Cw721BaseQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).allNftInfo({ + includeExpired: args.includeExpired, + tokenId: args.tokenId, + }) + }, + ...options, + }), + tokens: ({ + chainId, + contractAddress, + args, + options, + }: Cw721BaseTokensQuery): UseQueryOptions< + TokensResponse, + Error, + TData + > => ({ + queryKey: cw721BaseQueryKeys.tokens(contractAddress, args), + queryFn: async () => { + return new Cw721BaseQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).tokens({ + limit: args.limit, + owner: args.owner, + startAfter: args.startAfter, + }) + }, + ...options, + }), + allTokens: ({ + chainId, + contractAddress, + args, + options, + }: Cw721BaseAllTokensQuery): UseQueryOptions< + TokensResponse, + Error, + TData + > => ({ + queryKey: cw721BaseQueryKeys.allTokens(contractAddress, args), + queryFn: async () => { + return new Cw721BaseQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).allTokens({ + limit: args.limit, + startAfter: args.startAfter, + }) + }, + ...options, + }), + minter: ({ + chainId, + contractAddress, + options, + }: Cw721BaseMinterQuery): UseQueryOptions< + MinterResponse, + Error, + TData + > => ({ + queryKey: cw721BaseQueryKeys.minter(contractAddress), + queryFn: async () => { + return new Cw721BaseQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).minter() + }, + ...options, + }), + extension: ({ + chainId, + contractAddress, + args, + options, + }: Cw721BaseExtensionQuery): UseQueryOptions => ({ + queryKey: cw721BaseQueryKeys.extension(contractAddress, args), + queryFn: async () => { + return new Cw721BaseQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).extension({ + msg: args.msg, + }) + }, + ...options, + }), + ownership: ({ + chainId, + contractAddress, + options, + }: Cw721BaseOwnershipQuery): UseQueryOptions< + OwnershipForString, + Error, + TData + > => ({ + queryKey: cw721BaseQueryKeys.ownership(contractAddress), + queryFn: async () => { + return new Cw721BaseQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).ownership() + }, + ...options, + }), +} +export interface Cw721BaseReactQuery { + chainId: string + contractAddress: string + options?: Omit< + UseQueryOptions, + 'queryKey' | 'queryFn' | 'initialData' + > & { + initialData?: undefined + } +} +export interface Cw721BaseOwnershipQuery + extends Cw721BaseReactQuery {} +export interface Cw721BaseExtensionQuery + extends Cw721BaseReactQuery { + args: { + msg: Empty + } +} +export interface Cw721BaseMinterQuery + extends Cw721BaseReactQuery {} +export interface Cw721BaseAllTokensQuery + extends Cw721BaseReactQuery { + args: { + limit?: number + startAfter?: string + } +} +export interface Cw721BaseTokensQuery + extends Cw721BaseReactQuery { + args: { + limit?: number + owner: string + startAfter?: string + } +} +export interface Cw721BaseAllNftInfoQuery + extends Cw721BaseReactQuery { + args: { + includeExpired?: boolean + tokenId: string + } +} +export interface Cw721BaseNftInfoQuery + extends Cw721BaseReactQuery { + args: { + tokenId: string + } +} +export interface Cw721BaseContractInfoQuery + extends Cw721BaseReactQuery {} +export interface Cw721BaseNumTokensQuery + extends Cw721BaseReactQuery {} +export interface Cw721BaseAllOperatorsQuery + extends Cw721BaseReactQuery { + args: { + includeExpired?: boolean + limit?: number + owner: string + startAfter?: string + } +} +export interface Cw721BaseOperatorQuery + extends Cw721BaseReactQuery { + args: { + includeExpired?: boolean + operator: string + owner: string + } +} +export interface Cw721BaseApprovalsQuery + extends Cw721BaseReactQuery { + args: { + includeExpired?: boolean + tokenId: string + } +} +export interface Cw721BaseApprovalQuery + extends Cw721BaseReactQuery { + args: { + includeExpired?: boolean + spender: string + tokenId: string + } +} +export interface Cw721BaseOwnerOfQuery + extends Cw721BaseReactQuery { + args: { + includeExpired?: boolean + tokenId: string + } +} diff --git a/packages/state/query/queries/contracts/DaoVotingCw721Staked.extra.ts b/packages/state/query/queries/contracts/DaoVotingCw721Staked.extra.ts new file mode 100644 index 000000000..116a573e4 --- /dev/null +++ b/packages/state/query/queries/contracts/DaoVotingCw721Staked.extra.ts @@ -0,0 +1,88 @@ +import { QueryClient, queryOptions } from '@tanstack/react-query' + +import { indexerQueries } from '../indexer' + +/** + * Fetch cw721-staked voting module top stakers. + */ +export const fetchDaoVotingCw721StakedTopStakers = async ( + queryClient: QueryClient, + { + chainId, + address, + limit, + }: { + chainId: string + address: string + limit?: number + } +): Promise< + { + address: string + count: number + votingPowerPercent: number + }[] +> => + (await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress: address, + formula: 'daoVotingCw721Staked/topStakers', + ...(limit && { args: { limit } }), + noFallback: true, + }) + )) || [] + +/** + * Fetch staker for given NFT in cw721-staked voting module. Returns null if not + * staked. + */ +export const fetchDaoVotingCw721StakedStaker = ( + queryClient: QueryClient, + { + chainId, + address, + tokenId, + }: { + chainId: string + address: string + tokenId: string + } +): Promise => + queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress: address, + formula: 'daoVotingCw721Staked/staker', + args: { + tokenId, + }, + noFallback: true, + }) + ) + +export const daoVotingCw721StakedExtraQueries = { + /** + * Fetch cw721-staked voting module top stakers. + */ + topStakers: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['daoVotingCw721StakedExtra', 'topStakers', options], + queryFn: () => fetchDaoVotingCw721StakedTopStakers(queryClient, options), + }), + /** + * Fetch staker for given NFT in cw721-staked voting module. Returns null if + * not staked. + */ + staker: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['daoVotingCw721StakedExtra', 'staker', options], + queryFn: () => fetchDaoVotingCw721StakedStaker(queryClient, options), + }), +} diff --git a/packages/state/query/queries/contracts/DaoVotingCw721Staked.ts b/packages/state/query/queries/contracts/DaoVotingCw721Staked.ts index b6982c703..99558064e 100644 --- a/packages/state/query/queries/contracts/DaoVotingCw721Staked.ts +++ b/packages/state/query/queries/contracts/DaoVotingCw721Staked.ts @@ -169,14 +169,16 @@ export const daoVotingCw721StakedQueries = { queryFn: async () => { try { // Attempt to fetch data from the indexer. - return await queryClient.fetchQuery( - indexerQueries.queryContract(queryClient, { - chainId, - contractAddress, - formula: 'daoVotingCw721Staked/nftClaims', - args, - }) - ) + return { + nft_claims: await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'daoVotingCw721Staked/nftClaims', + args, + }) + ), + } } catch (error) { console.error(error) } diff --git a/packages/state/query/queries/contracts/DaoVotingOnftStaked.extra.ts b/packages/state/query/queries/contracts/DaoVotingOnftStaked.extra.ts new file mode 100644 index 000000000..159f9abf0 --- /dev/null +++ b/packages/state/query/queries/contracts/DaoVotingOnftStaked.extra.ts @@ -0,0 +1,89 @@ +import { QueryClient, queryOptions } from '@tanstack/react-query' + +import { indexerQueries } from '../indexer' + +/** + * Fetch ONFT-staked voting module top stakers. + */ +export const fetchDaoVotingOnftStakedTopStakers = async ( + queryClient: QueryClient, + { + chainId, + address, + limit, + }: { + chainId: string + address: string + limit?: number + } +): Promise< + { + address: string + count: number + votingPowerPercent: number + }[] +> => + (await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress: address, + formula: 'daoVotingOnftStaked/topStakers', + ...(limit && { args: { limit } }), + noFallback: true, + }) + )) || [] + +/** + * Fetch staker for given ONFT in ONFT-staked voting module. Returns null if not + * staked. + */ +export const fetchDaoVotingOnftStakedStaker = ( + queryClient: QueryClient, + { + chainId, + address, + tokenId, + }: { + chainId: string + address: string + tokenId: string + } +): Promise => + queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress: address, + formula: 'daoVotingOnftStaked/staker', + args: { + tokenId, + }, + noFallback: true, + }) + ) + +export const daoVotingOnftStakedExtraQueries = { + /** + * Fetch top stakers. + */ + topStakers: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['daoVotingOnftStakedExtra', 'topStakers', options], + queryFn: () => fetchDaoVotingOnftStakedTopStakers(queryClient, options), + }), + + /** + * Fetch staker for given ONFT in ONFT-staked voting module. Returns null if + * not staked. + */ + staker: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['daoVotingOnftStakedExtra', 'staker', options], + queryFn: () => fetchDaoVotingOnftStakedStaker(queryClient, options), + }), +} diff --git a/packages/state/query/queries/contracts/DaoVotingOnftStaked.ts b/packages/state/query/queries/contracts/DaoVotingOnftStaked.ts new file mode 100644 index 000000000..2726cc9b6 --- /dev/null +++ b/packages/state/query/queries/contracts/DaoVotingOnftStaked.ts @@ -0,0 +1,453 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import { QueryClient, UseQueryOptions } from '@tanstack/react-query' + +import { + ActiveThresholdResponse, + Addr, + ArrayOfString, + Boolean, + Config, + HooksResponse, + InfoResponse, + NftClaimsResponse, + TotalPowerAtHeightResponse, + VotingPowerAtHeightResponse, +} from '@dao-dao/types/contracts/DaoVotingOnftStaked' +import { getCosmWasmClientForChainId } from '@dao-dao/utils' + +import { DaoVotingOnftStakedQueryClient } from '../../../contracts/DaoVotingOnftStaked' +import { contractQueries } from '../contract' +import { indexerQueries } from '../indexer' + +export const daoVotingOnftStakedQueryKeys = { + contract: [ + { + contract: 'daoVotingOnftStaked', + }, + ] as const, + address: (contractAddress: string) => + [ + { + ...daoVotingOnftStakedQueryKeys.contract[0], + address: contractAddress, + }, + ] as const, + config: (contractAddress: string, args?: Record) => + [ + { + ...daoVotingOnftStakedQueryKeys.address(contractAddress)[0], + method: 'config', + args, + }, + ] as const, + nftClaims: (contractAddress: string, args?: Record) => + [ + { + ...daoVotingOnftStakedQueryKeys.address(contractAddress)[0], + method: 'nft_claims', + args, + }, + ] as const, + hooks: (contractAddress: string, args?: Record) => + [ + { + ...daoVotingOnftStakedQueryKeys.address(contractAddress)[0], + method: 'hooks', + args, + }, + ] as const, + stakedNfts: (contractAddress: string, args?: Record) => + [ + { + ...daoVotingOnftStakedQueryKeys.address(contractAddress)[0], + method: 'staked_nfts', + args, + }, + ] as const, + activeThreshold: (contractAddress: string, args?: Record) => + [ + { + ...daoVotingOnftStakedQueryKeys.address(contractAddress)[0], + method: 'active_threshold', + args, + }, + ] as const, + isActive: (contractAddress: string, args?: Record) => + [ + { + ...daoVotingOnftStakedQueryKeys.address(contractAddress)[0], + method: 'is_active', + args, + }, + ] as const, + votingPowerAtHeight: ( + contractAddress: string, + args?: Record + ) => + [ + { + ...daoVotingOnftStakedQueryKeys.address(contractAddress)[0], + method: 'voting_power_at_height', + args, + }, + ] as const, + totalPowerAtHeight: ( + contractAddress: string, + args?: Record + ) => + [ + { + ...daoVotingOnftStakedQueryKeys.address(contractAddress)[0], + method: 'total_power_at_height', + args, + }, + ] as const, + dao: (contractAddress: string, args?: Record) => + [ + { + ...daoVotingOnftStakedQueryKeys.address(contractAddress)[0], + method: 'dao', + args, + }, + ] as const, + info: (contractAddress: string, args?: Record) => + [ + { + ...daoVotingOnftStakedQueryKeys.address(contractAddress)[0], + method: 'info', + args, + }, + ] as const, +} +export const daoVotingOnftStakedQueries = { + config: ( + queryClient: QueryClient, + { chainId, contractAddress, options }: DaoVotingOnftStakedConfigQuery + ): UseQueryOptions => ({ + queryKey: daoVotingOnftStakedQueryKeys.config(contractAddress), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'daoVotingOnftStaked/config', + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new DaoVotingOnftStakedQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).config() + }, + ...options, + }), + nftClaims: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + args, + options, + }: DaoVotingOnftStakedNftClaimsQuery + ): UseQueryOptions => ({ + queryKey: daoVotingOnftStakedQueryKeys.nftClaims(contractAddress, args), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return { + nft_claims: await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'daoVotingOnftStaked/nftClaims', + args, + }) + ), + } + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new DaoVotingOnftStakedQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).nftClaims({ + address: args.address, + }) + }, + ...options, + }), + hooks: ({ + chainId, + contractAddress, + options, + }: DaoVotingOnftStakedHooksQuery): UseQueryOptions< + HooksResponse, + Error, + TData + > => ({ + queryKey: daoVotingOnftStakedQueryKeys.hooks(contractAddress), + queryFn: async () => { + return new DaoVotingOnftStakedQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).hooks() + }, + ...options, + }), + stakedNfts: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + args, + options, + }: DaoVotingOnftStakedStakedNftsQuery + ): UseQueryOptions => ({ + queryKey: daoVotingOnftStakedQueryKeys.stakedNfts(contractAddress, args), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'daoVotingOnftStaked/stakedNfts', + args, + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new DaoVotingOnftStakedQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).stakedNfts({ + address: args.address, + limit: args.limit, + startAfter: args.startAfter, + }) + }, + ...options, + }), + activeThreshold: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + options, + }: DaoVotingOnftStakedActiveThresholdQuery + ): UseQueryOptions => ({ + queryKey: daoVotingOnftStakedQueryKeys.activeThreshold(contractAddress), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'daoVotingOnftStaked/activeThreshold', + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new DaoVotingOnftStakedQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).activeThreshold() + }, + ...options, + }), + isActive: ({ + chainId, + contractAddress, + options, + }: DaoVotingOnftStakedIsActiveQuery): UseQueryOptions< + Boolean, + Error, + TData + > => ({ + queryKey: daoVotingOnftStakedQueryKeys.isActive(contractAddress), + queryFn: async () => { + return new DaoVotingOnftStakedQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).isActive() + }, + ...options, + }), + votingPowerAtHeight: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + args, + options, + }: DaoVotingOnftStakedVotingPowerAtHeightQuery + ): UseQueryOptions => ({ + queryKey: daoVotingOnftStakedQueryKeys.votingPowerAtHeight( + contractAddress, + args + ), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'daoVotingOnftStaked/votingPowerAtHeight', + args: { + address: args.address, + }, + ...(args.height && { block: { height: args.height } }), + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new DaoVotingOnftStakedQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).votingPowerAtHeight({ + address: args.address, + height: args.height, + }) + }, + ...options, + }), + totalPowerAtHeight: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + args, + options, + }: DaoVotingOnftStakedTotalPowerAtHeightQuery + ): UseQueryOptions => ({ + queryKey: daoVotingOnftStakedQueryKeys.totalPowerAtHeight( + contractAddress, + args + ), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'daoVotingOnftStaked/totalPowerAtHeight', + ...(args.height && { block: { height: args.height } }), + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new DaoVotingOnftStakedQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).totalPowerAtHeight({ + height: args.height, + }) + }, + ...options, + }), + dao: ( + queryClient: QueryClient, + { chainId, contractAddress, options }: DaoVotingOnftStakedDaoQuery + ): UseQueryOptions => ({ + queryKey: daoVotingOnftStakedQueryKeys.dao(contractAddress), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'daoVotingOnftStaked/dao', + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new DaoVotingOnftStakedQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).dao() + }, + ...options, + }), + info: contractQueries.info, +} +export interface DaoVotingOnftStakedReactQuery { + chainId: string + contractAddress: string + options?: Omit< + UseQueryOptions, + 'queryKey' | 'queryFn' | 'initialData' + > & { + initialData?: undefined + } +} +export interface DaoVotingOnftStakedInfoQuery + extends DaoVotingOnftStakedReactQuery {} +export interface DaoVotingOnftStakedDaoQuery + extends DaoVotingOnftStakedReactQuery {} +export interface DaoVotingOnftStakedTotalPowerAtHeightQuery + extends DaoVotingOnftStakedReactQuery { + args: { + height?: number + } +} +export interface DaoVotingOnftStakedVotingPowerAtHeightQuery + extends DaoVotingOnftStakedReactQuery { + args: { + address: string + height?: number + } +} +export interface DaoVotingOnftStakedIsActiveQuery + extends DaoVotingOnftStakedReactQuery {} +export interface DaoVotingOnftStakedActiveThresholdQuery + extends DaoVotingOnftStakedReactQuery {} +export interface DaoVotingOnftStakedStakedNftsQuery + extends DaoVotingOnftStakedReactQuery { + args: { + address: string + limit?: number + startAfter?: string + } +} +export interface DaoVotingOnftStakedHooksQuery + extends DaoVotingOnftStakedReactQuery {} +export interface DaoVotingOnftStakedNftClaimsQuery + extends DaoVotingOnftStakedReactQuery { + args: { + address: string + } +} +export interface DaoVotingOnftStakedConfigQuery + extends DaoVotingOnftStakedReactQuery {} diff --git a/packages/state/query/queries/contracts/index.ts b/packages/state/query/queries/contracts/index.ts index 7195bbca8..a636fb7ef 100644 --- a/packages/state/query/queries/contracts/index.ts +++ b/packages/state/query/queries/contracts/index.ts @@ -18,6 +18,7 @@ export * from './SecretDaoPreProposeMultiple' export * from './DaoVotingCw4' export * from './DaoVotingCw20Staked' export * from './DaoVotingCw721Staked' +export * from './DaoVotingCw721Staked.extra' export * from './DaoVotingTokenStaked' export * from './DaoVotingNativeStaked' export * from './SecretDaoVotingCw4' @@ -26,3 +27,6 @@ export * from './SecretDaoVotingSnip721Staked' export * from './SecretDaoPreProposeApprovalSingle' export * from './SecretDaoVotingSnip20Staked' export * from './NeutronVotingRegistry' +export * from './DaoVotingOnftStaked' +export * from './DaoVotingOnftStaked.extra' +export * from './Cw721Base' diff --git a/packages/state/query/queries/index.ts b/packages/state/query/queries/index.ts index 87eeaf476..b940a37a8 100644 --- a/packages/state/query/queries/index.ts +++ b/packages/state/query/queries/index.ts @@ -5,6 +5,8 @@ export * from './chain' export * from './contract' export * from './dao' export * from './indexer' +export * from './nft' +export * from './omniflix' export * from './polytone' export * from './profile' export * from './proposal' diff --git a/packages/state/query/queries/nft.ts b/packages/state/query/queries/nft.ts new file mode 100644 index 000000000..4eb2aed7d --- /dev/null +++ b/packages/state/query/queries/nft.ts @@ -0,0 +1,103 @@ +import { QueryClient, queryOptions } from '@tanstack/react-query' + +import { ChainId } from '@dao-dao/types' + +import { + cw721BaseQueries, + daoVotingCw721StakedExtraQueries, + daoVotingOnftStakedExtraQueries, +} from './contracts' +import { omniflixQueries } from './omniflix' + +/** + * Fetch owner of NFT, or staked if NFT is staked with the given staking + * contract (probably a DAO voting module.) + */ +export const fetchNftOwnerOrStaker = async ( + queryClient: QueryClient, + { + chainId, + collection, + tokenId, + stakingContractAddress, + }: { + chainId: string + collection: string + tokenId: string + /** + * If defined, will resolve the NFT's staker if it is currently staked with + * this staking contract address. + */ + stakingContractAddress?: string + } +): Promise<{ + address: string + /** + * If true, the address is staking with the given staking contract. If false, + * the address is the owner of the NFT. + */ + staked: boolean +}> => { + const isOmniFlix = + chainId === ChainId.OmniflixHubMainnet || + chainId === ChainId.OmniflixHubTestnet + + const owner = isOmniFlix + ? ( + await queryClient.fetchQuery( + omniflixQueries.onft({ + chainId, + collectionId: collection, + tokenId, + }) + ) + ).owner + : ( + await queryClient.fetchQuery( + cw721BaseQueries.ownerOf({ + chainId, + contractAddress: collection, + args: { + tokenId, + }, + }) + ) + ).owner + + const staker = + stakingContractAddress && owner === stakingContractAddress + ? await queryClient.fetchQuery( + isOmniFlix + ? daoVotingOnftStakedExtraQueries.staker(queryClient, { + chainId, + address: stakingContractAddress, + tokenId, + }) + : daoVotingCw721StakedExtraQueries.staker(queryClient, { + chainId, + address: stakingContractAddress, + tokenId, + }) + ) + : null + + return { + address: staker || owner, + staked: !!staker, + } +} + +export const nftQueries = { + /** + * Fetch owner of NFT, or staked if NFT is staked with the given staking + * contract (probably a DAO voting module.) + */ + ownerOrStaker: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['nft', 'ownerOrStaker', options], + queryFn: () => fetchNftOwnerOrStaker(queryClient, options), + }), +} diff --git a/packages/state/query/queries/omniflix.ts b/packages/state/query/queries/omniflix.ts new file mode 100644 index 000000000..4a1b163b2 --- /dev/null +++ b/packages/state/query/queries/omniflix.ts @@ -0,0 +1,254 @@ +import { QueryClient, queryOptions, skipToken } from '@tanstack/react-query' + +import { + ONFT, + Denom as OnftCollectionInfo, +} from '@dao-dao/types/protobuf/codegen/OmniFlix/onft/v1beta1/onft' +import { getAllRpcResponse, omniflixProtoRpcClientRouter } from '@dao-dao/utils' + +/** + * Fetch ONFT collection info. + */ +export const fetchOnftCollectionInfo = async ({ + chainId, + id, +}: { + chainId: string + id: string +}): Promise => { + const client = await omniflixProtoRpcClientRouter.connect(chainId) + const { denom } = await client.onft.v1beta1.denom({ + denomId: id, + }) + + if (!denom) { + throw new Error(`Collection not found for denom ${id}`) + } + + return denom +} + +/** + * Fetch ONFT collection supply. + */ +export const fetchOnftCollectionSupply = async ({ + chainId, + id, + owner = '', +}: { + chainId: string + id: string + /** + * Optionally filter by owner, returning how many are owned by this address. + */ + owner?: string +}): Promise => { + const client = await omniflixProtoRpcClientRouter.connect(chainId) + const { amount } = await client.onft.v1beta1.supply({ + denomId: id, + owner, + }) + + return Number(amount) +} + +/** + * Fetch paginated ONFTs. + */ +export const fetchPaginatedOnfts = async ( + queryClient: QueryClient, + { + chainId, + id, + page, + pageSize, + }: { + chainId: string + id: string + page: number + pageSize: number + } +): Promise => { + const client = await omniflixProtoRpcClientRouter.connect(chainId) + const { collection } = await client.onft.v1beta1.collection({ + denomId: id, + pagination: { + key: new Uint8Array(), + offset: BigInt((page - 1) * pageSize), + limit: BigInt(pageSize), + countTotal: false, + reverse: false, + }, + }) + + if (!collection) { + throw new Error(`Collection not found for denom ${id}`) + } + + // Pre-cache loaded ONFTs. + collection.onfts.forEach((onft: ONFT) => { + queryClient.setQueryData( + omniflixQueries.onft({ + chainId, + collectionId: id, + tokenId: onft.id, + }).queryKey, + onft + ) + }) + + return collection.onfts +} + +/** + * Fetch all ONFTs. + */ +export const fetchAllOnfts = async ( + queryClient: QueryClient, + { + chainId, + id, + owner, + }: { + chainId: string + id: string + /** + * Optionally filter by owner, returning only those owned by this address. + */ + owner?: string + } +): Promise => { + const client = await omniflixProtoRpcClientRouter.connect(chainId) + + if (owner) { + const onftIds = ( + await getAllRpcResponse( + client.onft.v1beta1.ownerONFTs, + { + denomId: id, + owner, + }, + 'owner' + ) + ).flatMap((owner) => owner?.idCollections.flatMap((c) => c.onftIds) || []) + + return await Promise.all( + onftIds.map((tokenId) => + queryClient.fetchQuery( + omniflixQueries.onft({ + chainId, + collectionId: id, + tokenId, + }) + ) + ) + ) + } else { + const onfts = ( + await getAllRpcResponse( + client.onft.v1beta1.collection, + { + denomId: id, + }, + 'collection' + ) + ).flatMap((collection) => collection?.onfts || []) + + // Pre-cache loaded ONFTs. + onfts.forEach((onft: ONFT) => { + queryClient.setQueryData( + omniflixQueries.onft({ + chainId, + collectionId: id, + tokenId: onft.id, + }).queryKey, + onft + ) + }) + + return onfts + } +} + +/** + * Fetch ONFT. + */ +export const fetchOnft = async ({ + chainId, + collectionId, + tokenId, +}: { + chainId: string + collectionId: string + tokenId: string +}): Promise => { + const client = await omniflixProtoRpcClientRouter.connect(chainId) + const { onft } = await client.onft.v1beta1.oNFT({ + denomId: collectionId, + id: tokenId, + }) + + if (!onft) { + throw new Error( + `ONFT not found for collection ${collectionId} and token ${tokenId}` + ) + } + + return onft +} + +export const omniflixQueries = { + /** + * Fetch ONFT collection info. + */ + onftCollectionInfo: ( + options: Parameters[0] + ) => + queryOptions({ + queryKey: ['omniflix', 'onftCollectionInfo', options], + queryFn: () => fetchOnftCollectionInfo(options), + }), + /** + * Fetch ONFT collection supply. + */ + onftCollectionSupply: ( + /** + * If undefined, returns loading state. + */ + options?: Parameters[0] + ) => + queryOptions({ + queryKey: ['omniflix', 'onftCollectionSupply', options], + queryFn: options ? () => fetchOnftCollectionSupply(options) : skipToken, + }), + /** + * Fetch paginated ONFTs. + */ + paginatedOnfts: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['omniflix', 'paginatedOnfts', options], + queryFn: () => fetchPaginatedOnfts(queryClient, options), + }), + /** + * Fetch all ONFTs. + */ + allOnfts: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['omniflix', 'allOnfts', options], + queryFn: () => fetchAllOnfts(queryClient, options), + }), + /** + * Fetch ONFT. + */ + onft: (options: Parameters[0]) => + queryOptions({ + queryKey: ['omniflix', 'onft', options], + queryFn: () => fetchOnft(options), + }), +} diff --git a/packages/state/recoil/selectors/chain.ts b/packages/state/recoil/selectors/chain.ts index b14083685..29df3ff1f 100644 --- a/packages/state/recoil/selectors/chain.ts +++ b/packages/state/recoil/selectors/chain.ts @@ -767,18 +767,19 @@ export const govProposalsSelector = selectorFamily< if (supportsV1Gov) { try { if (limit === undefined && offset === undefined) { - v1Proposals = await getAllRpcResponse( - client.gov.v1.proposals, - { - proposalStatus: - status || ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED, - voter: '', - depositor: '', - pagination: undefined, - }, - 'proposals', - true - ) + v1Proposals = + (await getAllRpcResponse( + client.gov.v1.proposals, + { + proposalStatus: + status || ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED, + voter: '', + depositor: '', + pagination: undefined, + }, + 'proposals', + true + )) || [] total = v1Proposals.length } else { const response = await client.gov.v1.proposals({ @@ -811,19 +812,20 @@ export const govProposalsSelector = selectorFamily< if (!v1Proposals) { if (limit === undefined && offset === undefined) { - v1Beta1Proposals = await getAllRpcResponse( - client.gov.v1beta1.proposals, - { - proposalStatus: - status || ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED, - voter: '', - depositor: '', - pagination: undefined, - }, - 'proposals', - true, - true - ) + v1Beta1Proposals = + (await getAllRpcResponse( + client.gov.v1beta1.proposals, + { + proposalStatus: + status || ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED, + voter: '', + depositor: '', + pagination: undefined, + }, + 'proposals', + true, + true + )) || [] total = v1Beta1Proposals.length } else { const response = await client.gov.v1beta1.proposals( diff --git a/packages/state/recoil/selectors/contracts/CommonNft.ts b/packages/state/recoil/selectors/contracts/CommonNft.ts index 7e6501d83..0f18a7aaa 100644 --- a/packages/state/recoil/selectors/contracts/CommonNft.ts +++ b/packages/state/recoil/selectors/contracts/CommonNft.ts @@ -2,16 +2,10 @@ import { RecoilValueReadOnly, selectorFamily } from 'recoil' import { ChainId, WithChainId } from '@dao-dao/types' import { - AllNftInfoResponse, - AllOperatorsResponse, - AllTokensResponse, - ApprovalResponse, - ApprovalsResponse, ContractInfoResponse, MinterResponse, - NftInfoResponse, + NftInfoResponseForEmpty, NumTokensResponse, - OwnerOfResponse, TokensResponse, } from '@dao-dao/types/contracts/Cw721Base' @@ -44,75 +38,6 @@ export const queryClient = selectorFamily< : get(commonNftQueryClient(params)), dangerouslyAllowMutability: true, }) - -export const ownerOfSelector = selectorFamily< - OwnerOfResponse, - QueryClientParams & { - params: Parameters - } ->({ - key: 'commonNftOwnerOf', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - // Don't use the indexer for this since various NFT contracts have - // different methods of storing NFT info, and the indexer does not know - // about every different way. - const client = get(queryClient(queryClientParams)) - return await client.ownerOf(...params) - }, -}) -export const approvalSelector = selectorFamily< - ApprovalResponse, - QueryClientParams & { - params: Parameters - } ->({ - key: 'commonNftApproval', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - // Don't use the indexer for this since various NFT contracts have - // different methods of storing NFT info, and the indexer does not know - // about every different way. - const client = get(queryClient(queryClientParams)) - return await client.approval(...params) - }, -}) -export const approvalsSelector = selectorFamily< - ApprovalsResponse, - QueryClientParams & { - params: Parameters - } ->({ - key: 'commonNftApprovals', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - // Don't use the indexer for this since various NFT contracts have - // different methods of storing NFT info, and the indexer does not know - // about every different way. - const client = get(queryClient(queryClientParams)) - return await client.approvals(...params) - }, -}) -export const allOperatorsSelector = selectorFamily< - AllOperatorsResponse, - QueryClientParams & { - params: Parameters - } ->({ - key: 'commonNftAllOperators', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - // Don't use the indexer for this since various NFT contracts have - // different methods of storing NFT info, and the indexer does not know - // about every different way. - const client = get(queryClient(queryClientParams)) - return await client.allOperators(...params) - }, -}) export const numTokensSelector = selectorFamily< NumTokensResponse, QueryClientParams & { @@ -148,7 +73,7 @@ export const contractInfoSelector = selectorFamily< }, }) export const nftInfoSelector = selectorFamily< - NftInfoResponse, + NftInfoResponseForEmpty, QueryClientParams & { params: Parameters } @@ -164,24 +89,6 @@ export const nftInfoSelector = selectorFamily< return await client.nftInfo(...params) }, }) -export const allNftInfoSelector = selectorFamily< - AllNftInfoResponse, - QueryClientParams & { - params: Parameters - } ->({ - key: 'commonNftAllNftInfo', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - // Don't use the indexer for this since various NFT contracts have - // different methods of storing NFT info, and the indexer does not know - // about every different way. - const client = get(queryClient(queryClientParams)) - return await client.allNftInfo(...params) - }, -}) - export const tokensSelector = selectorFamily< TokensResponse, QueryClientParams & { @@ -198,7 +105,7 @@ export const tokensSelector = selectorFamily< }, }) export const allTokensSelector = selectorFamily< - AllTokensResponse, + TokensResponse, QueryClientParams & { params: Parameters } @@ -233,7 +140,7 @@ export const minterSelector = selectorFamily< }) export const paginatedStargazeAllTokensSelector = selectorFamily< - AllTokensResponse['tokens'], + TokensResponse['tokens'], QueryClientParams & { limit: number; offset: number } >({ key: 'commonNftPaginatedStargazeAllTokens', @@ -270,7 +177,7 @@ export const paginatedStargazeAllTokensSelector = selectorFamily< export const paginatedAllTokensSelector: ( param: QueryClientParams & { page: number; pageSize: number } -) => RecoilValueReadOnly = selectorFamily({ +) => RecoilValueReadOnly = selectorFamily({ key: 'commonNftPaginatedAllTokens', get: ({ chainId, contractAddress, page, pageSize }) => @@ -330,14 +237,14 @@ export const paginatedAllTokensSelector: ( const ALL_TOKENS_LIMIT = 30 const ALL_TOKENS_STARGAZE_INDEXER_LIMIT = 100 export const unpaginatedAllTokensSelector = selectorFamily< - AllTokensResponse['tokens'], + TokensResponse['tokens'], QueryClientParams >({ key: 'commonNftUnpaginatedAllTokens', get: (queryClientParams) => async ({ get }) => { - const allTokens: AllTokensResponse['tokens'] = [] + const allTokens: TokensResponse['tokens'] = [] // Use Stargaze indexer if collection is on Stargaze. if ( diff --git a/packages/state/recoil/selectors/contracts/Cw721Base.ts b/packages/state/recoil/selectors/contracts/Cw721Base.ts index 4a1282bb8..4d91d3bfd 100644 --- a/packages/state/recoil/selectors/contracts/Cw721Base.ts +++ b/packages/state/recoil/selectors/contracts/Cw721Base.ts @@ -2,15 +2,14 @@ import { selectorFamily } from 'recoil' import { WithChainId } from '@dao-dao/types' import { - AllNftInfoResponse, - AllOperatorsResponse, - AllTokensResponse, + AllNftInfoResponseForEmpty, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, - NftInfoResponse, + NftInfoResponseForEmpty, NumTokensResponse, + OperatorsResponse, OwnerOfResponse, TokensResponse, } from '@dao-dao/types/contracts/Cw721Base' @@ -115,7 +114,7 @@ export const approvalsSelector = selectorFamily< }, }) export const allOperatorsSelector = selectorFamily< - AllOperatorsResponse, + OperatorsResponse, QueryClientParams & { params: Parameters } @@ -166,7 +165,7 @@ export const contractInfoSelector = selectorFamily< }, }) export const nftInfoSelector = selectorFamily< - NftInfoResponse, + NftInfoResponseForEmpty, QueryClientParams & { params: Parameters } @@ -183,7 +182,7 @@ export const nftInfoSelector = selectorFamily< }, }) export const allNftInfoSelector = selectorFamily< - AllNftInfoResponse, + AllNftInfoResponseForEmpty, QueryClientParams & { params: Parameters } @@ -216,7 +215,7 @@ export const tokensSelector = selectorFamily< }, }) export const allTokensSelector = selectorFamily< - AllTokensResponse, + TokensResponse, QueryClientParams & { params: Parameters } diff --git a/packages/state/recoil/selectors/contracts/DaoVotingCw721Staked.ts b/packages/state/recoil/selectors/contracts/DaoVotingCw721Staked.ts index e735bc5c8..c385f1ac5 100644 --- a/packages/state/recoil/selectors/contracts/DaoVotingCw721Staked.ts +++ b/packages/state/recoil/selectors/contracts/DaoVotingCw721Staked.ts @@ -20,7 +20,6 @@ import { signingCosmWasmClientAtom, } from '../../atoms' import { cosmWasmClientForChainSelector } from '../chain' -import { queryContractIndexerSelector } from '../indexer' type QueryClientParams = WithChainId<{ contractAddress: string @@ -136,63 +135,3 @@ export const votingPowerAtHeightSelector = selectorFamily< return await client.votingPowerAtHeight(...params) }, }) - -///! Custom selectors - -// Retrieve the staker for a given NFT from the indexer. -export const stakerForNftSelector = selectorFamily< - string | undefined, - WithChainId<{ - contractAddress: string - tokenId: string - }> ->({ - key: 'stakerForNft', - get: - ({ contractAddress, tokenId, chainId }) => - ({ get }) => - get( - queryContractIndexerSelector({ - chainId, - contractAddress, - formula: 'daoVotingCw721Staked/staker', - args: { - tokenId, - }, - noFallback: true, - }) - ), -}) - -export const topStakersSelector = selectorFamily< - | { - address: string - count: number - votingPowerPercent: number - }[] - | undefined, - QueryClientParams & { limit?: number } ->({ - key: 'daoVotingCw721StakedTopStakers', - get: - ({ limit, ...queryClientParams }) => - ({ get }) => { - const id = - get(refreshWalletBalancesIdAtom(undefined)) + - get(refreshDaoVotingPowerAtom(queryClientParams.contractAddress)) - - return ( - get( - queryContractIndexerSelector({ - ...queryClientParams, - formula: 'daoVotingCw721Staked/topStakers', - args: { - limit, - }, - id, - noFallback: true, - }) - ) ?? undefined - ) - }, -}) diff --git a/packages/state/recoil/selectors/nft.ts b/packages/state/recoil/selectors/nft.ts index d33f17d57..ab26834e4 100644 --- a/packages/state/recoil/selectors/nft.ts +++ b/packages/state/recoil/selectors/nft.ts @@ -23,13 +23,14 @@ import { stargazeTokenQuery, stargazeTokensForOwnerQuery, } from '../../graphql' +import { omniflixQueries } from '../../query' import { + queryClientAtom, refreshWalletBalancesIdAtom, refreshWalletStargazeNftsAtom, } from '../atoms' import { accountsSelector } from './account' import { CommonNftSelectors, DaoDaoCoreSelectors } from './contracts' -import { stakerForNftSelector } from './contracts/DaoVotingCw721Staked' import { queryWalletIndexerSelector } from './indexer' import { stargazeWalletUsdValueSelector } from './stargaze' import { genericTokenSelector } from './token' @@ -295,6 +296,7 @@ export const nftCardInfoWithUriSelector = selectorFamily< }, }) +// TODO(omniflix): move this to react-query and load ONFT JSON metadata URI export const nftCardInfoSelector = selectorFamily< NftCardInfo, WithChainId<{ tokenId: string; collection: string }> @@ -342,6 +344,45 @@ export const nftCardInfoSelector = selectorFamily< } } + if ( + chainId === ChainId.OmniflixHubMainnet || + chainId === ChainId.OmniflixHubTestnet + ) { + const queryClient = get(queryClientAtom) + + const [collectionInfo, onft] = await Promise.all([ + queryClient.fetchQuery( + omniflixQueries.onftCollectionInfo({ + chainId, + id: collection, + }) + ), + queryClient.fetchQuery( + omniflixQueries.onft({ + chainId, + collectionId: collection, + tokenId, + }) + ), + ]) + + return { + chainId, + key: getNftKey(chainId, collection, tokenId), + collectionAddress: collection, + collectionName: collectionInfo.name, + tokenId, + owner: onft.owner, + externalLink: { + href: `https://omniflix.market/c/${collection}/${tokenId}`, + name: 'OmniFlix', + }, + imageUrl: onft.metadata?.mediaUri, + name: onft.metadata?.name || tokenId, + description: onft.metadata?.description, + } + } + const tokenInfo = get( CommonNftSelectors.nftInfoSelector({ contractAddress: collection, @@ -568,45 +609,3 @@ export const walletStakedLazyNftCardInfosSelector = selectorFamily< })) }, }) - -// Get owner of NFT, or staker if NFT is staked with the given staking contract. -export const nftStakerOrOwnerSelector = selectorFamily< - { - staked: boolean - address: string - }, - WithChainId<{ - collectionAddress: string - tokenId: string - stakingContractAddress?: string - }> ->({ - key: 'nftStakerOrOwner', - get: - ({ collectionAddress, tokenId, stakingContractAddress, chainId }) => - async ({ get }) => { - const { owner } = get( - CommonNftSelectors.ownerOfSelector({ - contractAddress: collectionAddress, - params: [{ tokenId }], - chainId, - }) - ) - - const staker = - stakingContractAddress && owner === stakingContractAddress - ? get( - stakerForNftSelector({ - contractAddress: stakingContractAddress, - tokenId, - chainId, - }) - ) - : undefined - - return { - staked: staker !== undefined, - address: staker || owner, - } - }, -}) diff --git a/packages/stateful/clients/dao/CwDao.ts b/packages/stateful/clients/dao/CwDao.ts index 768ed8f45..d3f5cf9c6 100644 --- a/packages/stateful/clients/dao/CwDao.ts +++ b/packages/stateful/clients/dao/CwDao.ts @@ -37,6 +37,7 @@ import { Cw721StakedVotingModule, NativeStakedVotingModule, NeutronVotingRegistryVotingModule, + OnftStakedVotingModule, TokenStakedVotingModule, } from '../voting-module' import { DaoBase } from './base' @@ -48,6 +49,7 @@ const getVotingModuleBases = () => [ NativeStakedVotingModule, TokenStakedVotingModule, NeutronVotingRegistryVotingModule, + OnftStakedVotingModule, ] const getProposalModuleBases = () => [ diff --git a/packages/stateful/clients/voting-module/OnftStakedVotingModule.ts b/packages/stateful/clients/voting-module/OnftStakedVotingModule.ts new file mode 100644 index 000000000..de9eb8c90 --- /dev/null +++ b/packages/stateful/clients/voting-module/OnftStakedVotingModule.ts @@ -0,0 +1,100 @@ +import { FetchQueryOptions, skipToken } from '@tanstack/react-query' + +import { daoVotingOnftStakedQueries } from '@dao-dao/state/query' +import { ModuleInstantiateInfo } from '@dao-dao/types' +import { + ActiveThreshold, + Duration, + InstantiateMsg, + TotalPowerAtHeightResponse, + VotingPowerAtHeightResponse, +} from '@dao-dao/types/contracts/DaoVotingOnftStaked' +import { + DAO_VOTING_ONFT_STAKED_CONTRACT_NAMES, + encodeJsonToBase64, + mustGetSupportedChainConfig, +} from '@dao-dao/utils' + +import { CwDao } from '../dao/CwDao' +import { VotingModuleBase } from './base' + +export class OnftStakedVotingModule extends VotingModuleBase { + static contractNames: readonly string[] = + DAO_VOTING_ONFT_STAKED_CONTRACT_NAMES + + /** + * Generate the module instantiate info to plug into the DAO instantiate info + * generator function. + */ + static generateModuleInstantiateInfo( + chainId: string, + daoName: string, + config: { + activeThreshold?: ActiveThreshold | null + unstakingDuration?: Duration | null + onft: { + /** + * Use an existing ONFT collection. + */ + existing: { + id: string + } + } + } + ): ModuleInstantiateInfo { + const { codeIds } = mustGetSupportedChainConfig(chainId) + if (!codeIds.DaoVotingOnftStaked) { + throw new Error('Codes not configured for chain ' + chainId) + } + + return { + admin: { core_module: {} }, + code_id: codeIds.DaoVotingOnftStaked, + label: `DAO_${daoName.trim()}_onft-staked`, + msg: encodeJsonToBase64({ + active_threshold: config.activeThreshold, + onft_collection: { + existing: { + id: config.onft.existing.id, + }, + }, + unstaking_duration: config.unstakingDuration, + } as InstantiateMsg), + funds: [], + } + } + + getVotingPowerQuery( + address?: string, + height?: number + ): FetchQueryOptions { + // If no address, return query in loading state. + if (!address) { + return { + queryKey: [], + queryFn: skipToken, + } + } + + return daoVotingOnftStakedQueries.votingPowerAtHeight(this.queryClient, { + chainId: this.dao.chainId, + contractAddress: this.address, + args: { + address, + height, + }, + }) + } + + getTotalVotingPowerQuery( + height?: number + ): FetchQueryOptions { + return daoVotingOnftStakedQueries.totalPowerAtHeight(this.queryClient, { + chainId: this.dao.chainId, + contractAddress: this.address, + args: { + height, + }, + }) + } +} diff --git a/packages/stateful/clients/voting-module/index.ts b/packages/stateful/clients/voting-module/index.ts index 880782565..fea572ea9 100644 --- a/packages/stateful/clients/voting-module/index.ts +++ b/packages/stateful/clients/voting-module/index.ts @@ -4,6 +4,7 @@ export * from './Cw20StakedVotingModule' export * from './Cw721StakedVotingModule' export * from './NativeStakedVotingModule' export * from './NeutronVotingRegistryVotingModule' +export * from './OnftStakedVotingModule' export * from './Snip20StakedVotingModule.secret' export * from './Snip721StakedVotingModule.secret' export * from './TokenStakedVotingModule.secret' diff --git a/packages/stateful/components/nft/LazyNftCard.tsx b/packages/stateful/components/nft/LazyNftCard.tsx index 8b4cc2760..1beb72f3b 100644 --- a/packages/stateful/components/nft/LazyNftCard.tsx +++ b/packages/stateful/components/nft/LazyNftCard.tsx @@ -1,15 +1,17 @@ +import { useQueryClient } from '@tanstack/react-query' import { forwardRef, useEffect } from 'react' import { useSetRecoilState } from 'recoil' +import { nftQueries } from '@dao-dao/state/query' import { nftCardInfoSelector, nftCardInfosForKeyAtom, - nftStakerOrOwnerSelector, } from '@dao-dao/state/recoil' import { useCachedLoadingWithError } from '@dao-dao/stateless' import { LazyNftCardProps } from '@dao-dao/types' import { processError } from '@dao-dao/utils' +import { useQueryLoadingDataWithError } from '../../hooks' import { NftCard, NftCardNoCollection, StakedNftCard } from './NftCard' export const LazyNftCard = forwardRef( @@ -45,16 +47,17 @@ export const LazyNftCard = forwardRef( } }, [info, setNftCardInfoForKey]) - const stakerOrOwner = useCachedLoadingWithError( + const queryClient = useQueryClient() + const stakerOrOwner = useQueryLoadingDataWithError( // If showing owner instead of showing collection, load staker or owner if // not staker. The owner in the `type` and the owner of the NFT are // unrelated. Sorry... I just confused myself and then re-learned this. type === 'owner' - ? nftStakerOrOwnerSelector({ - collectionAddress, + ? nftQueries.ownerOrStaker(queryClient, { + chainId, + collection: collectionAddress, tokenId, stakingContractAddress, - chainId, }) : undefined ) @@ -72,18 +75,19 @@ export const LazyNftCard = forwardRef( return info.loading ? ( ) : info.errored ? ( ( name={processError(info.error, { forceCapture: false, })} - tokenId={tokenId} - {...props} ref={ref} + tokenId={tokenId} /> ) : ( ) diff --git a/packages/stateful/components/nft/NftSelectionModal.tsx b/packages/stateful/components/nft/NftSelectionModal.tsx index 8e6b5ea81..9629ac8df 100644 --- a/packages/stateful/components/nft/NftSelectionModal.tsx +++ b/packages/stateful/components/nft/NftSelectionModal.tsx @@ -310,6 +310,7 @@ export const NftSelectionModal = ({ .map(({ item }) => ( ) => { const { t } = useTranslation() const { chain_id: chainId, bech32_prefix: bech32Prefix } = useChain() + const isOmniFlix = + chainId === ChainId.OmniflixHubMainnet || + chainId === ChainId.OmniflixHubTestnet //! Validate existing governance token. const existingGovernanceNftCollectionAddress = data.tokenType === GovernanceTokenType.Existing ? data.existingGovernanceNftCollectionAddress : undefined - const collectionInfoLoadable = useRecoilValueLoadable( - existingGovernanceNftCollectionAddress && - isValidBech32Address(existingGovernanceNftCollectionAddress, bech32Prefix) - ? waitForAll([ - CommonNftSelectors.contractInfoSelector({ - chainId, - contractAddress: existingGovernanceNftCollectionAddress, - params: [], - }), - CommonNftSelectors.numTokensSelector({ - chainId, - contractAddress: existingGovernanceNftCollectionAddress, - params: [], - }), - isSecretNetwork(chainId) - ? secretContractCodeHashSelector({ - chainId, - contractAddress: existingGovernanceNftCollectionAddress, - }) - : constSelector(undefined), - ]) + const existingAddressValid = + !!existingGovernanceNftCollectionAddress && + (isOmniFlix || + isValidBech32Address( + existingGovernanceNftCollectionAddress, + bech32Prefix + )) + + const collectionInfoLoadable = useQueries({ + queries: [ + { + ...omniflixQueries.onftCollectionInfo({ + chainId, + id: existingGovernanceNftCollectionAddress || '', + }), + enabled: isOmniFlix && existingAddressValid, + }, + { + ...cw721BaseQueries.contractInfo({ + chainId, + contractAddress: existingGovernanceNftCollectionAddress || '', + }), + enabled: !isOmniFlix && existingAddressValid, + }, + ], + combine: ([omniflixResult, cw721Result]) => + isOmniFlix ? omniflixResult : cw721Result, + }) + + const secretCodeHashLoadable = useRecoilValueLoadable( + existingAddressValid && isSecretNetwork(chainId) + ? secretContractCodeHashSelector({ + chainId, + contractAddress: existingGovernanceNftCollectionAddress, + }) : constSelector(undefined) ) @@ -70,30 +89,39 @@ export const GovernanceConfigurationInput = ({ if (isSecretNetwork(chainId)) { setValue( 'creator.data.secretCodeHash', - collectionInfoLoadable.valueMaybe()?.[2] - ? collectionInfoLoadable.contents[2] - : undefined + secretCodeHashLoadable.valueMaybe() ) } - if (collectionInfoLoadable.state !== 'hasError') { - if (errors?.creator?.data?._existingError) { - clearErrors('creator.data._existingError') + setValue( + 'creator.data.existingCollectionInfo', + !collectionInfoLoadable.isFetched || collectionInfoLoadable.isFetching + ? undefined + : collectionInfoLoadable.data + ) + + if (!collectionInfoLoadable.isError) { + if (errors?.creator?.data?.existingCollectionInfo) { + clearErrors('creator.data.existingCollectionInfo') } return } - if (!errors?.creator?.data?._existingError) { - setError('creator.data._existingError', { + if (!errors?.creator?.data?.existingCollectionInfo) { + setError('creator.data.existingCollectionInfo', { type: 'manual', - message: t('error.failedToGetTokenInfo', { tokenType: 'CW721' }), + message: t('error.failedToGetTokenInfo', { + tokenType: isOmniFlix ? 'ONFT' : 'CW721', + }), }) } }, [ chainId, clearErrors, collectionInfoLoadable, - errors?.creator?.data?._existingError, + errors?.creator?.data?.existingCollectionInfo, + isOmniFlix, + secretCodeHashLoadable, setError, setValue, t, @@ -117,27 +145,36 @@ export const GovernanceConfigurationInput = ({ } fieldName="creator.data.existingGovernanceNftCollectionAddress" ghost - placeholder={bech32Prefix + '...'} + placeholder={ + (isOmniFlix + ? // eslint-disable-next-line i18next/no-literal-string + 'onftdenom' + : bech32Prefix) + '...' + } register={register} - validation={[validateRequired, makeValidateAddress(bech32Prefix)]} + validation={[ + validateRequired, + ...(!isOmniFlix ? [makeValidateAddress(bech32Prefix)] : []), + ]} />

- {collectionInfoLoadable.state === 'loading' ? ( - - ) : collectionInfoLoadable.state === 'hasValue' ? ( -

- ${collectionInfoLoadable.valueMaybe()?.[0].symbol} -

- ) : ( - - )} + {!!existingAddressValid && + (collectionInfoLoadable.isPending ? ( + + ) : !collectionInfoLoadable.isError ? ( +

+ ${collectionInfoLoadable.data.symbol} +

+ ) : ( + + ))}
diff --git a/packages/stateful/creators/NftBased/GovernanceConfigurationReview.tsx b/packages/stateful/creators/NftBased/GovernanceConfigurationReview.tsx index b0f0d5b8d..f39e7e429 100644 --- a/packages/stateful/creators/NftBased/GovernanceConfigurationReview.tsx +++ b/packages/stateful/creators/NftBased/GovernanceConfigurationReview.tsx @@ -1,25 +1,14 @@ import { useTranslation } from 'react-i18next' -import { useRecoilValueLoadable } from 'recoil' -import { CommonNftSelectors } from '@dao-dao/state' -import { CopyToClipboard, Loader, useChain } from '@dao-dao/stateless' +import { CopyToClipboard } from '@dao-dao/stateless' import { DaoCreationGovernanceConfigReviewProps } from '@dao-dao/types' import { CreatorData } from './types' export const GovernanceConfigurationReview = ({ - data: { existingGovernanceNftCollectionAddress }, + data: { existingGovernanceNftCollectionAddress, existingCollectionInfo }, }: DaoCreationGovernanceConfigReviewProps) => { const { t } = useTranslation() - const { chain_id: chainId } = useChain() - - const collectionInfoLoadable = useRecoilValueLoadable( - CommonNftSelectors.contractInfoSelector({ - chainId, - contractAddress: existingGovernanceNftCollectionAddress, - params: [], - }) - ) return (
@@ -35,14 +24,10 @@ export const GovernanceConfigurationReview = ({ value={existingGovernanceNftCollectionAddress} /> - {collectionInfoLoadable.state === 'loading' ? ( - - ) : ( - collectionInfoLoadable.state === 'hasValue' && ( -

- ${collectionInfoLoadable.valueMaybe()?.symbol} -

- ) + {existingCollectionInfo && ( +

+ ${existingCollectionInfo.symbol} +

)}
diff --git a/packages/stateful/creators/NftBased/getInstantiateInfo.ts b/packages/stateful/creators/NftBased/getInstantiateInfo.ts index a8f07dc82..32c5967d0 100644 --- a/packages/stateful/creators/NftBased/getInstantiateInfo.ts +++ b/packages/stateful/creators/NftBased/getInstantiateInfo.ts @@ -1,10 +1,10 @@ -import { DaoCreatorGetInstantiateInfo } from '@dao-dao/types' +import { ChainId, DaoCreatorGetInstantiateInfo } from '@dao-dao/types' import { convertDurationWithUnitsToDuration, isSecretNetwork, } from '@dao-dao/utils' -import { Cw721StakedVotingModule } from '../../clients/voting-module/Cw721StakedVotingModule' +import { Cw721StakedVotingModule, OnftStakedVotingModule } from '../../clients' import { SecretSnip721StakedVotingModule } from '../../clients/voting-module/Snip721StakedVotingModule.secret' import { CreatorData } from './types' @@ -18,15 +18,7 @@ export const getInstantiateInfo: DaoCreatorGetInstantiateInfo = ({ activeThreshold, }, }) => { - if (isSecretNetwork(chainId) && !secretCodeHash) { - throw new Error('SNIP721 code hash is missing') - } - - return ( - isSecretNetwork(chainId) - ? SecretSnip721StakedVotingModule - : Cw721StakedVotingModule - ).generateModuleInstantiateInfo(chainId, name, { + const commonConfig = { activeThreshold: activeThreshold?.enabled ? !activeThreshold.type || activeThreshold.type === 'percent' ? { @@ -40,13 +32,52 @@ export const getInstantiateInfo: DaoCreatorGetInstantiateInfo = ({ }, } : null, - nft: { - existing: { - address: existingGovernanceNftCollectionAddress, - // Type-checked above. - codeHash: secretCodeHash || '', - }, - }, + unstakingDuration: convertDurationWithUnitsToDuration(unstakingDuration), - }) + } + + if (isSecretNetwork(chainId)) { + if (!secretCodeHash) { + throw new Error('SNIP721 code hash is missing') + } + + return SecretSnip721StakedVotingModule.generateModuleInstantiateInfo( + chainId, + name, + { + ...commonConfig, + nft: { + existing: { + address: existingGovernanceNftCollectionAddress, + codeHash: secretCodeHash, + }, + }, + } + ) + } else if ( + chainId === ChainId.OmniflixHubMainnet || + chainId === ChainId.OmniflixHubTestnet + ) { + return OnftStakedVotingModule.generateModuleInstantiateInfo(chainId, name, { + ...commonConfig, + onft: { + existing: { + id: existingGovernanceNftCollectionAddress, + }, + }, + }) + } else { + return Cw721StakedVotingModule.generateModuleInstantiateInfo( + chainId, + name, + { + ...commonConfig, + nft: { + existing: { + address: existingGovernanceNftCollectionAddress, + }, + }, + } + ) + } } diff --git a/packages/stateful/creators/NftBased/types.ts b/packages/stateful/creators/NftBased/types.ts index 55da2f317..2c6e41698 100644 --- a/packages/stateful/creators/NftBased/types.ts +++ b/packages/stateful/creators/NftBased/types.ts @@ -11,7 +11,9 @@ export enum GovernanceTokenType { export type CreatorData = { tokenType: GovernanceTokenType existingGovernanceNftCollectionAddress: string - _existingError?: any + existingCollectionInfo?: { + symbol: string + } // Must be loaded on Secret Network. secretCodeHash?: string unstakingDuration: DurationWithUnits diff --git a/packages/stateful/server/makeGetDaoStaticProps.ts b/packages/stateful/server/makeGetDaoStaticProps.ts index 7022dbc91..8aefc7539 100644 --- a/packages/stateful/server/makeGetDaoStaticProps.ts +++ b/packages/stateful/server/makeGetDaoStaticProps.ts @@ -166,7 +166,7 @@ export const makeGetDaoStaticProps: GetDaoStaticPropsMaker = // Initialize to load info. dao.init(), // Pre-fetch TVL. - dao.getTvl(), + dao.getTvl().catch(() => undefined), ]) // Must be called after server side translations has been awaited, diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/types.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/types.ts index 728507d54..408269401 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/types.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/types.ts @@ -10,7 +10,6 @@ export interface UseStakingInfoOptions { fetchClaims?: boolean fetchTotalStakedValue?: boolean fetchWalletStakedValue?: boolean - fetchWalletUnstakedValue?: boolean } export interface UseStakingInfoResponse { diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/MembersTab.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/MembersTab.tsx index c7475d452..623ccd908 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/MembersTab.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/MembersTab.tsx @@ -1,10 +1,8 @@ +import { useQueryClient } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' -import { DaoVotingCw721StakedSelectors } from '@dao-dao/state/recoil' -import { - MembersTab as StatelessMembersTab, - useCachedLoadingWithError, -} from '@dao-dao/stateless' +import { daoVotingCw721StakedExtraQueries } from '@dao-dao/state/query' +import { MembersTab as StatelessMembersTab } from '@dao-dao/stateless' import { StatefulDaoMemberCardProps } from '@dao-dao/types' import { @@ -12,6 +10,7 @@ import { DaoMemberCard, EntityDisplay, } from '../../../../components' +import { useQueryLoadingDataWithError } from '../../../../hooks' import { useVotingModuleAdapterOptions } from '../../../react/context' import { useCommonGovernanceTokenInfo } from '../hooks' @@ -20,10 +19,11 @@ export const MembersTab = () => { const { chainId, votingModuleAddress } = useVotingModuleAdapterOptions() const token = useCommonGovernanceTokenInfo() - const members = useCachedLoadingWithError( - DaoVotingCw721StakedSelectors.topStakersSelector({ + const queryClient = useQueryClient() + const members = useQueryLoadingDataWithError( + daoVotingCw721StakedExtraQueries.topStakers(queryClient, { chainId, - contractAddress: votingModuleAddress, + address: votingModuleAddress, }), (data) => data?.map( diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/StakingModal.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/StakingModal.tsx index 103f2962b..f662f7419 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/StakingModal.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/StakingModal.tsx @@ -78,7 +78,7 @@ const InnerStakingModal = ({ fetchClaims: true, fetchTotalStakedValue: false, fetchWalletStakedValue: true, - fetchWalletUnstakedValue: true, + fetchWalletUnstakedNfts: true, }) const hasStake = diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/hooks/useMainDaoInfoCards.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/hooks/useMainDaoInfoCards.tsx index 4469b4acd..03e212e9a 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/hooks/useMainDaoInfoCards.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/hooks/useMainDaoInfoCards.tsx @@ -1,16 +1,15 @@ +import { useQueryClient } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' -import { DaoVotingCw721StakedSelectors } from '@dao-dao/state' -import { - TokenAmountDisplay, - useCachedLoadingWithError, -} from '@dao-dao/stateless' +import { daoVotingCw721StakedExtraQueries } from '@dao-dao/state' +import { TokenAmountDisplay } from '@dao-dao/stateless' import { DaoInfoCard } from '@dao-dao/types' import { convertDurationToHumanReadableString, formatPercentOf100, } from '@dao-dao/utils' +import { useQueryLoadingDataWithError } from '../../../../hooks' import { useVotingModuleAdapterOptions } from '../../../react/context' import { useGovernanceCollectionInfo } from './useGovernanceCollectionInfo' import { useStakingInfo } from './useStakingInfo' @@ -31,10 +30,11 @@ export const useMainDaoInfoCards = (): DaoInfoCard[] => { collectionInfo: { symbol, totalSupply }, } = useGovernanceCollectionInfo() - const loadingMembers = useCachedLoadingWithError( - DaoVotingCw721StakedSelectors.topStakersSelector({ + const queryClient = useQueryClient() + const loadingMembers = useQueryLoadingDataWithError( + daoVotingCw721StakedExtraQueries.topStakers(queryClient, { chainId, - contractAddress: votingModuleAddress, + address: votingModuleAddress, }) ) @@ -47,7 +47,7 @@ export const useMainDaoInfoCards = (): DaoInfoCard[] => { ? undefined : loadingMembers.errored ? '' - : loadingMembers.data?.length ?? '', + : loadingMembers.data.length ?? '', }, { label: t('title.totalSupply'), diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/hooks/useStakingInfo.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/hooks/useStakingInfo.ts index 79dab9ccc..1486fc339 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/hooks/useStakingInfo.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/hooks/useStakingInfo.ts @@ -32,7 +32,7 @@ export const useStakingInfo = ({ fetchClaims = false, fetchTotalStakedValue = false, fetchWalletStakedValue = false, - fetchWalletUnstakedValue = false, + fetchWalletUnstakedNfts = false, }: UseStakingInfoOptions = {}): UseStakingInfoResponse => { const { chainId, votingModuleAddress } = useVotingModuleAdapterOptions() const { address: walletAddress } = useWallet({ @@ -99,20 +99,16 @@ export const useStakingInfo = ({ : constSelector(undefined), undefined ) - const claims = loadingClaims.loading - ? [] - : !loadingClaims.data - ? undefined - : loadingClaims.data.nft_claims - - const nftClaims = claims - ? claims.map( - ({ token_id, release_at }): NftClaim => ({ - release_at, - token_id, - }) - ) - : [] + const claims = + loadingClaims.loading || !loadingClaims.data + ? [] + : loadingClaims.data.nft_claims + const nftClaims = claims.map( + ({ token_id, release_at }): NftClaim => ({ + release_at, + token_id, + }) + ) const claimsPending = blockHeight ? nftClaims?.filter((c) => !claimAvailable(c, blockHeight)) @@ -162,7 +158,7 @@ export const useStakingInfo = ({ ) const loadingWalletUnstakedNftsLoadable = useCachedLoadingWithError( - fetchWalletUnstakedValue && walletAddress && governanceTokenAddress + fetchWalletUnstakedNfts && walletAddress && governanceTokenAddress ? CommonNftSelectors.unpaginatedAllTokensForOwnerSelector({ chainId, contractAddress: governanceTokenAddress, diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/types.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/types.ts index 825de80f9..6a1c30b14 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/types.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/types.ts @@ -12,7 +12,7 @@ export interface UseStakingInfoOptions { fetchClaims?: boolean fetchTotalStakedValue?: boolean fetchWalletStakedValue?: boolean - fetchWalletUnstakedValue?: boolean + fetchWalletUnstakedNfts?: boolean } export interface UseStakingInfoResponse { diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/types.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/types.ts index 53d2b3660..b2ab2d052 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/types.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/types.ts @@ -17,7 +17,6 @@ export interface UseStakingInfoOptions { fetchClaims?: boolean fetchTotalStakedValue?: boolean fetchWalletStakedValue?: boolean - fetchWalletUnstakedValue?: boolean } export interface UseStakingInfoResponse { diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/actions/UpdateStakingConfig/Component.stories.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/actions/UpdateStakingConfig/Component.stories.tsx new file mode 100644 index 000000000..0af9dab62 --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/actions/UpdateStakingConfig/Component.stories.tsx @@ -0,0 +1,37 @@ +import { ComponentMeta, ComponentStory } from '@storybook/react' + +import { makeReactHookFormDecorator } from '@dao-dao/storybook' +import { DurationUnits } from '@dao-dao/types' + +import { + UpdateStakingConfigComponent, + UpdateStakingConfigData, +} from './Component' + +export default { + title: + 'DAO DAO / packages / stateful / voting-module-adapter / adapters / DaoVotingOnftStaked / actions / UpdateStakingConfig', + component: UpdateStakingConfigComponent, + decorators: [ + makeReactHookFormDecorator({ + unstakingDurationEnabled: true, + unstakingDuration: { + value: 4, + units: DurationUnits.Days, + }, + }), + ], +} as ComponentMeta + +const Template: ComponentStory = ( + args +) => + +export const Default = Template.bind({}) +Default.args = { + fieldNamePrefix: '', + allActionsWithData: [], + index: 0, + data: {}, + isCreating: true, +} diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/actions/UpdateStakingConfig/Component.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/actions/UpdateStakingConfig/Component.tsx new file mode 100644 index 000000000..9e2fa6f60 --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/actions/UpdateStakingConfig/Component.tsx @@ -0,0 +1,112 @@ +import { useFormContext } from 'react-hook-form' +import { useTranslation } from 'react-i18next' + +import { + FormSwitchCard, + InputErrorMessage, + NumberInput, + SelectInput, +} from '@dao-dao/stateless' +import { + ActionComponent, + BooleanFieldNames, + DurationUnitsValues, + DurationWithUnits, +} from '@dao-dao/types' +import { validatePositive, validateRequired } from '@dao-dao/utils' + +export type UpdateStakingConfigData = { + unstakingDurationEnabled: boolean + unstakingDuration: DurationWithUnits +} + +export const UpdateStakingConfigComponent: ActionComponent = ({ + fieldNamePrefix, + errors, + isCreating, +}) => { + const { t } = useTranslation() + const { register, watch, setValue } = + useFormContext() + + const unstakingDurationEnabled = watch( + (fieldNamePrefix + 'unstakingDurationEnabled') as 'unstakingDurationEnabled' + ) + const unstakingDuration = watch( + (fieldNamePrefix + 'unstakingDuration') as 'unstakingDuration' + ) + + return ( + <> + + > + containerClassName="self-start" + fieldName={ + (fieldNamePrefix + + 'unstakingDurationEnabled') as 'unstakingDurationEnabled' + } + label={t('form.unstakingDurationTitle')} + readOnly={!isCreating} + setValue={setValue} + tooltip={t('form.unstakingDurationDescription')} + value={unstakingDurationEnabled} + /> + + {unstakingDurationEnabled && ( + <> +
+ + + {isCreating && ( + + {DurationUnitsValues.map((type, idx) => ( + + ))} + + )} +
+ + + + )} + + ) +} diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/actions/UpdateStakingConfig/README.md b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/actions/UpdateStakingConfig/README.md new file mode 100644 index 000000000..74171ed2c --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/actions/UpdateStakingConfig/README.md @@ -0,0 +1,24 @@ +# UpdateStakingConfig + +Update token staking configuration. + +## Bulk import format + +This is relevant when bulk importing actions, as described in [this +guide](https://github.com/DA0-DA0/dao-dao-ui/wiki/Bulk-importing-actions). + +### Key + +`updateStakingConfig` + +### Data format + +```json +{ + "unstakingDurationEnabled": , + "unstakingDuration": { + "value": "", + "units": "" + } +} +``` diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/actions/UpdateStakingConfig/index.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/actions/UpdateStakingConfig/index.ts new file mode 100644 index 000000000..bddfdf908 --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/actions/UpdateStakingConfig/index.ts @@ -0,0 +1,113 @@ +import { useCallback } from 'react' + +import { GearEmoji } from '@dao-dao/stateless' +import { DurationUnits } from '@dao-dao/types' +import { + ActionKey, + ActionMaker, + UseDecodedCosmosMsg, + UseDefaults, + UseTransformToCosmos, +} from '@dao-dao/types/actions' +import { + convertDurationToDurationWithUnits, + convertDurationWithUnitsToDuration, + makeWasmMessage, + objectMatchesStructure, +} from '@dao-dao/utils' + +import { useStakingInfo } from '../../hooks' +import { + UpdateStakingConfigComponent as Component, + UpdateStakingConfigData, +} from './Component' + +const useDefaults: UseDefaults = () => { + const { unstakingDuration } = useStakingInfo() + + return { + unstakingDurationEnabled: !!unstakingDuration, + unstakingDuration: unstakingDuration + ? convertDurationToDurationWithUnits(unstakingDuration) + : { + value: 2, + units: DurationUnits.Weeks, + }, + } +} + +const useTransformToCosmos: UseTransformToCosmos< + UpdateStakingConfigData +> = () => { + const { stakingContractAddress } = useStakingInfo() + + return useCallback( + ({ unstakingDurationEnabled, unstakingDuration }) => + makeWasmMessage({ + wasm: { + execute: { + contract_addr: stakingContractAddress, + funds: [], + msg: { + update_config: { + duration: unstakingDurationEnabled + ? convertDurationWithUnitsToDuration(unstakingDuration) + : null, + }, + }, + }, + }, + }), + [stakingContractAddress] + ) +} + +const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( + msg: Record +) => { + const { stakingContractAddress } = useStakingInfo() + + return objectMatchesStructure(msg, { + wasm: { + execute: { + contract_addr: {}, + funds: {}, + msg: { + update_config: {}, + }, + }, + }, + }) && msg.wasm.execute.contract_addr === stakingContractAddress + ? { + match: true, + data: { + unstakingDurationEnabled: + !!msg.wasm.execute.msg.update_config.duration, + unstakingDuration: msg.wasm.execute.msg.update_config.duration + ? convertDurationToDurationWithUnits( + msg.wasm.execute.msg.update_config.duration + ) + : { + value: 2, + units: DurationUnits.Weeks, + }, + }, + } + : { + match: false, + } +} + +export const makeUpdateStakingConfigAction: ActionMaker< + UpdateStakingConfigData +> = ({ t }) => ({ + key: ActionKey.UpdateStakingConfig, + Icon: GearEmoji, + label: t('title.updateStakingConfig'), + description: t('info.updateStakingConfigDescription'), + Component, + useDefaults, + useTransformToCosmos, + useDecodedCosmosMsg, + notReusable: true, +}) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/actions/index.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/actions/index.ts new file mode 100644 index 000000000..fdf789090 --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/actions/index.ts @@ -0,0 +1 @@ +export * from './UpdateStakingConfig' diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/components/MembersTab.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/components/MembersTab.tsx new file mode 100644 index 000000000..a419c9475 --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/components/MembersTab.tsx @@ -0,0 +1,63 @@ +import { useQueryClient } from '@tanstack/react-query' +import { useTranslation } from 'react-i18next' + +import { daoVotingOnftStakedExtraQueries } from '@dao-dao/state' +import { MembersTab as StatelessMembersTab } from '@dao-dao/stateless' +import { StatefulDaoMemberCardProps } from '@dao-dao/types' + +import { + ButtonLink, + DaoMemberCard, + EntityDisplay, +} from '../../../../components' +import { useQueryLoadingDataWithError } from '../../../../hooks' +import { useVotingModuleAdapterOptions } from '../../../react/context' +import { useCommonGovernanceTokenInfo } from '../hooks' + +export const MembersTab = () => { + const { t } = useTranslation() + const { chainId, votingModuleAddress } = useVotingModuleAdapterOptions() + const token = useCommonGovernanceTokenInfo() + + const queryClient = useQueryClient() + const members = useQueryLoadingDataWithError( + daoVotingOnftStakedExtraQueries.topStakers(queryClient, { + chainId, + address: votingModuleAddress, + }), + (data) => + data?.map( + ({ + address, + count, + votingPowerPercent, + }): StatefulDaoMemberCardProps => ({ + address, + balanceLabel: t('title.staked'), + balance: { + loading: false, + data: { + amount: count, + token, + }, + }, + votingPowerPercent: { + loading: false, + data: votingPowerPercent, + }, + }) + ) ?? [] + ) + + return ( + + ) +} diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/components/NftCollectionTab.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/components/NftCollectionTab.tsx new file mode 100644 index 000000000..233eb39aa --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/components/NftCollectionTab.tsx @@ -0,0 +1,77 @@ +import { useQueryClient } from '@tanstack/react-query' +import { useTranslation } from 'react-i18next' + +import { omniflixQueries } from '@dao-dao/state/query' +import { + NftsTab, + PAGINATION_MIN_PAGE, + useChain, + useQuerySyncedState, +} from '@dao-dao/stateless' +import { LazyNftCardInfo } from '@dao-dao/types' +import { getNftKey } from '@dao-dao/utils' + +import { LazyNftCard } from '../../../../components' +import { useQueryLoadingData } from '../../../../hooks' +import { useGovernanceCollectionInfo } from '../hooks' + +const NFTS_PER_PAGE = 30 + +export const NftCollectionTab = () => { + const { t } = useTranslation() + const { chain_id: chainId } = useChain() + const { collectionAddress, stakingContractAddress } = + useGovernanceCollectionInfo() + + const [page, setPage] = useQuerySyncedState({ + param: 'np', + defaultValue: PAGINATION_MIN_PAGE, + }) + + const numNfts = useQueryLoadingData( + omniflixQueries.onftCollectionSupply({ + chainId, + id: collectionAddress, + }), + 0 + ) + + const queryClient = useQueryClient() + const allTokens = useQueryLoadingData( + omniflixQueries.paginatedOnfts(queryClient, { + chainId, + id: collectionAddress, + page, + pageSize: NFTS_PER_PAGE, + }), + [] + ) + + return ( + ({ + key: getNftKey(chainId, collectionAddress, id), + chainId, + collectionAddress, + tokenId: id, + stakingContractAddress, + type: 'owner', + }) + ), + } + } + numNfts={numNfts} + page={page} + pageSize={NFTS_PER_PAGE} + setPage={setPage} + /> + ) +} diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/components/ProfileCardMemberInfo.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/components/ProfileCardMemberInfo.tsx new file mode 100644 index 000000000..42db582b0 --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/components/ProfileCardMemberInfo.tsx @@ -0,0 +1,222 @@ +import { useCallback, useState } from 'react' +import toast from 'react-hot-toast' +import { useTranslation } from 'react-i18next' +import { useRecoilValue } from 'recoil' + +import { + blockHeightSelector, + blocksPerYearSelector, + stakingLoadingAtom, +} from '@dao-dao/state' +import { + useCachedLoadable, + useChain, + useDaoInfoContext, +} from '@dao-dao/stateless' +import { + BaseProfileCardMemberInfoProps, + UnstakingTask, + UnstakingTaskStatus, +} from '@dao-dao/types' +import { + CHAIN_GAS_MULTIPLIER, + convertExpirationToDate, + durationToSeconds, + executeSmartContract, + processError, +} from '@dao-dao/utils' + +import { useAwaitNextBlock, useWallet } from '../../../../hooks' +import { ProfileCardMemberInfoTokens } from '../../../components' +import { useGovernanceCollectionInfo, useStakingInfo } from '../hooks' +import { StakingModal } from './StakingModal' + +export const ProfileCardMemberInfo = ({ + maxGovernanceTokenDeposit, + ...props +}: BaseProfileCardMemberInfoProps) => { + const { t } = useTranslation() + const { chain_id: chainId } = useChain() + const { name: daoName } = useDaoInfoContext() + const { + address: walletAddress, + isWalletConnected, + getSigningClient, + } = useWallet() + const [showStakingModal, setShowStakingModal] = useState(false) + const [claimingLoading, setClaimingLoading] = useState(false) + const stakingLoading = useRecoilValue(stakingLoadingAtom) + + const { + collectionInfo, + token, + loadingWalletBalance: loadingUnstakedBalance, + } = useGovernanceCollectionInfo({ + fetchWalletBalance: true, + }) + + const { + stakingContractAddress, + unstakingDuration, + refreshTotals, + claimsPending, + claimsAvailable, + sumClaimsAvailable, + loadingWalletStakedValue, + loadingTotalStakedValue, + refreshClaims, + } = useStakingInfo({ + fetchClaims: true, + fetchWalletStakedValue: true, + fetchTotalStakedValue: true, + }) + + const awaitNextBlock = useAwaitNextBlock() + const onClaim = useCallback(async () => { + if (!isWalletConnected || !walletAddress) { + return toast.error(t('error.logInToContinue')) + } + if (!sumClaimsAvailable) { + return toast.error(t('error.noClaimsAvailable')) + } + + setClaimingLoading(true) + try { + await executeSmartContract( + getSigningClient, + walletAddress, + stakingContractAddress, + { + claim_nfts: {}, + }, + undefined, + CHAIN_GAS_MULTIPLIER + ) + + // New balances will not appear until the next block. + await awaitNextBlock() + + refreshTotals() + refreshClaims?.() + + toast.success( + `Claimed ${sumClaimsAvailable.toLocaleString()} $${ + collectionInfo.symbol + }` + ) + } catch (err) { + console.error(err) + toast.error(processError(err)) + } finally { + setClaimingLoading(false) + } + }, [ + isWalletConnected, + walletAddress, + sumClaimsAvailable, + t, + getSigningClient, + stakingContractAddress, + awaitNextBlock, + refreshTotals, + refreshClaims, + collectionInfo.symbol, + ]) + + const blockHeightLoadable = useCachedLoadable( + blockHeightSelector({ + chainId, + }) + ) + const blocksPerYear = useRecoilValue( + blocksPerYearSelector({ + chainId, + }) + ) + + const unstakingTasks: UnstakingTask[] = [ + ...(claimsPending ?? []).map(({ release_at }) => ({ + token, + status: UnstakingTaskStatus.Unstaking, + amount: Number(1), + date: convertExpirationToDate( + blocksPerYear, + release_at, + blockHeightLoadable.state === 'hasValue' + ? blockHeightLoadable.contents + : 0 + ), + })), + ...(claimsAvailable ?? []).map(({ release_at }) => ({ + token, + status: UnstakingTaskStatus.ReadyToClaim, + amount: Number(1), + date: convertExpirationToDate( + blocksPerYear, + release_at, + blockHeightLoadable.state === 'hasValue' + ? blockHeightLoadable.contents + : 0 + ), + })), + ] + + return ( + <> + setShowStakingModal(true)} + refreshUnstakingTasks={() => refreshClaims?.()} + stakingLoading={stakingLoading} + unstakingDurationSeconds={ + (unstakingDuration && + durationToSeconds(blocksPerYear, unstakingDuration)) || + undefined + } + unstakingTasks={unstakingTasks} + {...props} + /> + + setShowStakingModal(false)} + visible={showStakingModal} + /> + + ) +} diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/components/StakingModal.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/components/StakingModal.tsx new file mode 100644 index 000000000..9676295c0 --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/components/StakingModal.tsx @@ -0,0 +1,321 @@ +import { toUtf8 } from '@cosmjs/encoding' +import { useState } from 'react' +import toast from 'react-hot-toast' +import { useTranslation } from 'react-i18next' +import { useRecoilState } from 'recoil' + +import { stakingLoadingAtom } from '@dao-dao/state' +import { + ModalLoader, + SegmentedControls, + StakingMode, + useDaoContext, +} from '@dao-dao/stateless' +import { + BaseStakingModalProps, + LazyNftCardInfo, + LoadingDataWithError, +} from '@dao-dao/types' +import { MsgExecuteContract } from '@dao-dao/types/protobuf/codegen/cosmwasm/wasm/v1/tx' +import { MsgTransferONFT } from '@dao-dao/types/protobuf/codegen/OmniFlix/onft/v1beta1/tx' +import { + CHAIN_GAS_MULTIPLIER, + executeSmartContract, + getNftKey, + processError, +} from '@dao-dao/utils' + +import { NftSelectionModal, SuspenseLoader } from '../../../../components' +import { + useAwaitNextBlock, + useQueryLoadingDataWithError, + useWallet, +} from '../../../../hooks' +import { useGovernanceCollectionInfo, useStakingInfo } from '../hooks' + +export const StakingModal = (props: BaseStakingModalProps) => ( + } + > + + +) + +const InnerStakingModal = ({ + onClose, + visible, + initialMode = StakingMode.Stake, +}: BaseStakingModalProps) => { + const { t } = useTranslation() + const { dao } = useDaoContext() + const { + address: walletAddress, + isWalletConnected, + getSigningClient, + } = useWallet({ + chainId: dao.chainId, + }) + + const [mode, setMode] = useState(initialMode) + + const [stakeTokenIds, setStakeTokenIds] = useState([] as string[]) + const [unstakeTokenIds, setUnstakeTokenIds] = useState([] as string[]) + + const [stakingLoading, setStakingLoading] = useRecoilState(stakingLoadingAtom) + + const { collectionAddress, collectionInfo } = useGovernanceCollectionInfo({ + fetchWalletBalance: true, + }) + const { + stakingContractAddress, + refreshTotals, + loadingWalletStakedValue, + refreshClaims, + loadingWalletStakedNfts, + loadingWalletUnstakedNfts, + unstakingDuration, + } = useStakingInfo({ + fetchClaims: true, + fetchTotalStakedValue: false, + fetchWalletStakedValue: true, + fetchWalletUnstakedNfts: true, + }) + + const hasStake = + loadingWalletStakedValue !== undefined && + !loadingWalletStakedValue.loading && + loadingWalletStakedValue.data > 0 + + const walletStakedBalanceLoading = useQueryLoadingDataWithError( + dao.votingModule.getVotingPowerQuery(walletAddress) + ) + const walletStakedBalance = + !walletStakedBalanceLoading.loading && !walletStakedBalanceLoading.errored + ? Number(walletStakedBalanceLoading.data.power) + : undefined + + const awaitNextBlock = useAwaitNextBlock() + + const onAction = async () => { + if (!isWalletConnected || !walletAddress) { + toast.error(t('error.logInToContinue')) + return + } + + setStakingLoading(true) + + switch (mode) { + case StakingMode.Stake: { + setStakingLoading(true) + + try { + await ( + await getSigningClient() + ).signAndBroadcast( + walletAddress, + [ + // Prepare + { + typeUrl: MsgExecuteContract.typeUrl, + value: MsgExecuteContract.fromPartial({ + sender: walletAddress, + contract: stakingContractAddress, + msg: toUtf8( + JSON.stringify({ + prepare_stake: { + token_ids: stakeTokenIds, + }, + }) + ), + funds: [], + }), + }, + // Transfer + ...stakeTokenIds.map((id) => ({ + typeUrl: MsgTransferONFT.typeUrl, + value: MsgTransferONFT.fromPartial({ + id, + denomId: collectionAddress, + sender: walletAddress, + recipient: stakingContractAddress, + }), + })), + // Confirm + { + typeUrl: MsgExecuteContract.typeUrl, + value: MsgExecuteContract.fromPartial({ + sender: walletAddress, + contract: stakingContractAddress, + msg: toUtf8( + JSON.stringify({ + confirm_stake: { + token_ids: stakeTokenIds, + }, + }) + ), + funds: [], + }), + }, + ], + CHAIN_GAS_MULTIPLIER + ) + + // New balances will not appear until the next block. + await awaitNextBlock() + + refreshTotals() + + toast.success( + `Staked ${stakeTokenIds.length} $${collectionInfo.symbol}` + ) + setStakeTokenIds([]) + + // Close once done. + onClose() + } catch (err) { + console.error(err) + toast.error(processError(err)) + } finally { + setStakingLoading(false) + } + + break + } + case StakingMode.Unstake: { + if (walletStakedBalance === undefined) { + toast.error(t('error.loadingData')) + return + } + + setStakingLoading(true) + + try { + await executeSmartContract( + getSigningClient, + walletAddress, + stakingContractAddress, + { + unstake: { + token_ids: unstakeTokenIds, + }, + }, + undefined, + CHAIN_GAS_MULTIPLIER + ) + + // New balances will not appear until the next block. + await awaitNextBlock() + + refreshTotals() + refreshClaims?.() + + toast.success( + `Unstaked ${unstakeTokenIds.length} $${collectionInfo.symbol}` + ) + setUnstakeTokenIds([]) + + // Close once done. + onClose() + } catch (err) { + console.error(err) + toast.error(processError(err)) + } finally { + setStakingLoading(false) + } + + break + } + default: + toast.error('Internal error while staking. Unrecognized mode.') + } + } + + const currentTokenIds = + mode === StakingMode.Stake ? stakeTokenIds : unstakeTokenIds + const setCurrentTokenIds = + mode === StakingMode.Stake ? setStakeTokenIds : setUnstakeTokenIds + + // Toggle on/off a token ID selection. + const onNftClick = ({ tokenId }: LazyNftCardInfo) => + setCurrentTokenIds((tokenIds) => + tokenIds.includes(tokenId) + ? tokenIds.filter((id) => id !== tokenId) + : [...tokenIds, tokenId] + ) + + const onDeselectAll = () => setCurrentTokenIds([]) + + const nfts = + (mode === StakingMode.Stake + ? loadingWalletUnstakedNfts + : mode === StakingMode.Unstake + ? loadingWalletStakedNfts + : undefined) ?? + ({ loading: false, errored: true } as LoadingDataWithError< + LazyNftCardInfo[] + >) + + const onSelectAll = () => + setCurrentTokenIds( + !nfts.loading && !nfts.errored ? nfts.data.map((nft) => nft.tokenId) : [] + ) + + return ( + + ) : undefined + } + nfts={nfts} + onClose={onClose} + onDeselectAll={onDeselectAll} + onNftClick={onNftClick} + onSelectAll={onSelectAll} + selectedKeys={currentTokenIds.map((tokenId) => + getNftKey(dao.chainId, collectionAddress, tokenId) + )} + unstakingDuration={unstakingDuration} + visible={visible} + /> + ) +} diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/components/index.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/components/index.ts new file mode 100644 index 000000000..52001f018 --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/components/index.ts @@ -0,0 +1,4 @@ +export * from './MembersTab' +export * from './NftCollectionTab' +export * from './ProfileCardMemberInfo' +export * from './StakingModal' diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/index.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/index.ts new file mode 100644 index 000000000..4e2bb40ef --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/index.ts @@ -0,0 +1,5 @@ +export * from './useCommonGovernanceTokenInfo' +export * from './useGovernanceCollectionInfo' +export * from './useMainDaoInfoCards' +export * from './useStakingInfo' +export * from './useVotingModuleRelevantAddresses' diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useCommonGovernanceTokenInfo.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useCommonGovernanceTokenInfo.ts new file mode 100644 index 000000000..297a12641 --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useCommonGovernanceTokenInfo.ts @@ -0,0 +1,46 @@ +import { useQueryClient, useSuspenseQuery } from '@tanstack/react-query' + +import { + daoVotingOnftStakedQueries, + omniflixQueries, +} from '@dao-dao/state/query' +import { GenericToken, TokenType } from '@dao-dao/types' + +import { useVotingModuleAdapterOptions } from '../../../react/context' + +export const useCommonGovernanceTokenInfo = (): GenericToken => { + const { chainId, votingModuleAddress } = useVotingModuleAdapterOptions() + + const queryClient = useQueryClient() + const { + data: { onft_collection_id }, + } = useSuspenseQuery( + daoVotingOnftStakedQueries.config(queryClient, { + chainId, + contractAddress: votingModuleAddress, + }) + ) + + const { + data: { symbol, previewUri }, + } = useSuspenseQuery( + omniflixQueries.onftCollectionInfo({ + chainId, + id: onft_collection_id, + }) + ) + + return { + chainId, + type: TokenType.Onft, + denomOrAddress: onft_collection_id, + symbol, + decimals: 0, + imageUrl: previewUri, + source: { + chainId, + type: TokenType.Onft, + denomOrAddress: onft_collection_id, + }, + } +} diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useGovernanceCollectionInfo.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useGovernanceCollectionInfo.ts new file mode 100644 index 000000000..f9f1a81ad --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useGovernanceCollectionInfo.ts @@ -0,0 +1,127 @@ +import { + useQueryClient, + useSuspenseQueries, + useSuspenseQuery, +} from '@tanstack/react-query' + +import { daoVotingOnftStakedQueries, omniflixQueries } from '@dao-dao/state' +import { TokenType } from '@dao-dao/types' + +import { useQueryLoadingDataWithError } from '../../../../hooks' +import { useWallet } from '../../../../hooks/useWallet' +import { useVotingModuleAdapterOptions } from '../../../react/context' +import { + UseGovernanceCollectionInfoOptions, + UseGovernanceCollectionInfoResponse, +} from '../types' + +export const useGovernanceCollectionInfo = ({ + fetchWalletBalance = false, + fetchTreasuryBalance = false, +}: UseGovernanceCollectionInfoOptions = {}): UseGovernanceCollectionInfoResponse => { + const { chainId, coreAddress, votingModuleAddress } = + useVotingModuleAdapterOptions() + const { address: walletAddress } = useWallet({ + chainId, + }) + + const queryClient = useQueryClient() + const { + data: { onft_collection_id }, + } = useSuspenseQuery( + daoVotingOnftStakedQueries.config(queryClient, { + chainId, + contractAddress: votingModuleAddress, + }) + ) + + const [ + { + data: { name, symbol, previewUri }, + }, + { data: totalSupply }, + ] = useSuspenseQueries({ + queries: [ + omniflixQueries.onftCollectionInfo({ + chainId, + id: onft_collection_id, + }), + omniflixQueries.onftCollectionSupply({ + chainId, + id: onft_collection_id, + }), + ], + }) + + /// Optional + + // Wallet balance + const loadingWalletBalance = useQueryLoadingDataWithError( + omniflixQueries.onftCollectionSupply( + fetchWalletBalance && walletAddress + ? { + chainId, + id: onft_collection_id, + owner: walletAddress, + } + : undefined + ) + ) + + // Treasury balance + const loadingTreasuryBalance = useQueryLoadingDataWithError( + omniflixQueries.onftCollectionSupply( + fetchTreasuryBalance + ? { + chainId, + id: onft_collection_id, + owner: coreAddress, + } + : undefined + ) + ) + + return { + stakingContractAddress: votingModuleAddress, + collectionAddress: onft_collection_id, + collectionInfo: { + name, + symbol, + totalSupply, + }, + token: { + chainId, + type: TokenType.Onft, + denomOrAddress: onft_collection_id, + symbol, + decimals: 0, + imageUrl: previewUri, + source: { + chainId, + type: TokenType.Onft, + denomOrAddress: onft_collection_id, + }, + }, + /// Optional + // Wallet balance + loadingWalletBalance: + !fetchWalletBalance || loadingWalletBalance.errored + ? undefined + : loadingWalletBalance.loading + ? { loading: true } + : { + loading: false, + data: loadingWalletBalance.data, + }, + // Treasury balance + loadingTreasuryBalance: + !fetchTreasuryBalance || loadingTreasuryBalance.errored + ? undefined + : loadingTreasuryBalance.loading + ? { loading: true } + : { + loading: false, + data: loadingTreasuryBalance.data, + }, + } +} diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useMainDaoInfoCards.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useMainDaoInfoCards.tsx new file mode 100644 index 000000000..0dab5d00d --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useMainDaoInfoCards.tsx @@ -0,0 +1,82 @@ +import { useQueryClient } from '@tanstack/react-query' +import { useTranslation } from 'react-i18next' + +import { daoVotingOnftStakedExtraQueries } from '@dao-dao/state' +import { TokenAmountDisplay } from '@dao-dao/stateless' +import { DaoInfoCard } from '@dao-dao/types' +import { + convertDurationToHumanReadableString, + formatPercentOf100, +} from '@dao-dao/utils' + +import { useQueryLoadingDataWithError } from '../../../../hooks' +import { useVotingModuleAdapterOptions } from '../../../react/context' +import { useGovernanceCollectionInfo } from './useGovernanceCollectionInfo' +import { useStakingInfo } from './useStakingInfo' + +export const useMainDaoInfoCards = (): DaoInfoCard[] => { + const { t } = useTranslation() + const { chainId, votingModuleAddress } = useVotingModuleAdapterOptions() + + const { loadingTotalStakedValue, unstakingDuration } = useStakingInfo({ + fetchTotalStakedValue: true, + }) + + if (loadingTotalStakedValue === undefined) { + throw new Error(t('error.loadingData')) + } + + const { + collectionInfo: { symbol, totalSupply }, + } = useGovernanceCollectionInfo() + + const queryClient = useQueryClient() + const loadingMembers = useQueryLoadingDataWithError( + daoVotingOnftStakedExtraQueries.topStakers(queryClient, { + chainId, + address: votingModuleAddress, + }) + ) + + return [ + { + label: t('title.members'), + tooltip: t('info.membersTooltip'), + loading: loadingMembers.loading, + value: loadingMembers.loading + ? undefined + : loadingMembers.errored + ? '' + : loadingMembers.data?.length ?? '', + }, + { + label: t('title.totalSupply'), + tooltip: t('info.totalSupplyTooltip', { + tokenSymbol: symbol, + }), + value: ( + + ), + }, + { + label: t('title.totalStaked'), + tooltip: t('info.totalStakedTooltip', { + tokenSymbol: symbol, + }), + value: loadingTotalStakedValue.loading + ? '...' + : formatPercentOf100( + (loadingTotalStakedValue.data / totalSupply) * 100 + ), + }, + { + label: t('title.unstakingPeriod'), + tooltip: t('info.unstakingPeriodTooltip', { + tokenSymbol: symbol, + }), + value: unstakingDuration + ? convertDurationToHumanReadableString(t, unstakingDuration) + : t('info.none'), + }, + ] +} diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useStakingInfo.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useStakingInfo.ts new file mode 100644 index 000000000..cc04b9d65 --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useStakingInfo.ts @@ -0,0 +1,319 @@ +import { useQueryClient, useSuspenseQueries } from '@tanstack/react-query' +import { useCallback } from 'react' +import { useSetRecoilState, waitForAll } from 'recoil' + +import { + blockHeightSelector, + contractQueries, + daoVotingOnftStakedQueries, + daoVotingOnftStakedQueryKeys, + nftCardInfoSelector, + omniflixQueries, + refreshDaoVotingPowerAtom, +} from '@dao-dao/state' +import { + useCachedLoadable, + useCachedLoadingWithError, + useDaoContext, +} from '@dao-dao/stateless' +import { NftClaim } from '@dao-dao/types/contracts/DaoVotingOnftStaked' +import { claimAvailable, parseContractVersion } from '@dao-dao/utils' + +import { + useQueryLoadingData, + useQueryLoadingDataWithError, +} from '../../../../hooks' +import { useWallet } from '../../../../hooks/useWallet' +import { useVotingModuleAdapterOptions } from '../../../react/context' +import { UseStakingInfoOptions, UseStakingInfoResponse } from '../types' +import { useGovernanceCollectionInfo } from './useGovernanceCollectionInfo' + +export const useStakingInfo = ({ + fetchClaims = false, + fetchTotalStakedValue = false, + fetchWalletStakedValue = false, + fetchWalletUnstakedNfts = false, +}: UseStakingInfoOptions = {}): UseStakingInfoResponse => { + const { dao } = useDaoContext() + const { chainId, votingModuleAddress } = useVotingModuleAdapterOptions() + const { address: walletAddress } = useWallet({ + chainId, + }) + + const { collectionAddress } = useGovernanceCollectionInfo() + + const queryClient = useQueryClient() + const [stakingContractVersion, unstakingDuration] = useSuspenseQueries({ + queries: [ + contractQueries.info(queryClient, { + chainId, + address: votingModuleAddress, + }), + daoVotingOnftStakedQueries.config(queryClient, { + chainId, + contractAddress: votingModuleAddress, + }), + ], + combine: ([ + { + data: { info }, + }, + { data: config }, + ]) => [ + parseContractVersion(info.version), + config.unstaking_duration || undefined, + ], + }) + + const setRefreshDaoVotingPower = useSetRecoilState( + refreshDaoVotingPowerAtom(dao.coreAddress) + ) + + // Refresh totals, mostly for total staked power. + const refreshTotals = useCallback(() => { + setRefreshDaoVotingPower((id) => id + 1) + queryClient.invalidateQueries({ + queryKey: dao.getVotingPowerQuery(walletAddress).queryKey, + }) + queryClient.invalidateQueries({ + queryKey: dao.getTotalVotingPowerQuery().queryKey, + }) + queryClient.invalidateQueries({ + queryKey: dao.votingModule.getVotingPowerQuery(walletAddress).queryKey, + }) + queryClient.invalidateQueries({ + queryKey: dao.votingModule.getTotalVotingPowerQuery().queryKey, + }) + queryClient.invalidateQueries({ + queryKey: omniflixQueries.onftCollectionSupply({ + chainId, + id: collectionAddress, + }).queryKey, + }) + queryClient.invalidateQueries({ + queryKey: [ + 'omniflix', + 'paginatedOnfts', + { + chainId, + id: collectionAddress, + }, + ], + }) + queryClient.invalidateQueries({ + queryKey: [ + 'omniflix', + 'allOnfts', + { + chainId, + id: collectionAddress, + }, + ], + }) + queryClient.invalidateQueries({ + queryKey: [ + 'indexer', + 'query', + { + chainId, + contractAddress: votingModuleAddress, + formula: 'daoVotingOnftStaked/topStakers', + }, + ], + }) + + // Invalidate indexer query first. + queryClient.invalidateQueries({ + queryKey: [ + 'indexer', + 'query', + { + chainId, + contractAddress: votingModuleAddress, + formula: 'daoVotingOnftStaked/stakedNfts', + args: { + address: walletAddress, + }, + }, + ], + }) + // Then invalidate contract query that uses indexer query. + queryClient.invalidateQueries({ + queryKey: daoVotingOnftStakedQueryKeys.stakedNfts(votingModuleAddress, { + address: walletAddress, + }), + }) + }, [ + chainId, + dao, + collectionAddress, + queryClient, + setRefreshDaoVotingPower, + votingModuleAddress, + walletAddress, + ]) + + /// Optional + + // Claims + const blockHeightLoadable = useCachedLoadable( + fetchClaims + ? blockHeightSelector({ + chainId, + }) + : undefined + ) + const blockHeight = + blockHeightLoadable.state === 'hasValue' ? blockHeightLoadable.contents : 0 + + const refreshClaims = useCallback(() => { + // Invalidate indexer query first. + queryClient.invalidateQueries({ + queryKey: [ + 'indexer', + 'query', + { + chainId, + contractAddress: votingModuleAddress, + formula: 'daoVotingOnftStaked/nftClaims', + args: { + address: walletAddress, + }, + }, + ], + }) + // Then invalidate contract query that uses indexer query. + queryClient.invalidateQueries({ + queryKey: daoVotingOnftStakedQueryKeys.nftClaims(votingModuleAddress, { + address: walletAddress, + }), + }) + }, [chainId, queryClient, votingModuleAddress, walletAddress]) + + const loadingClaims = useQueryLoadingData( + daoVotingOnftStakedQueries.nftClaims(queryClient, { + chainId, + contractAddress: votingModuleAddress, + args: { + address: walletAddress || '', + }, + options: { + enabled: fetchClaims && !!walletAddress, + }, + }), + { nft_claims: [] } + ) + const nftClaims = ( + loadingClaims.loading ? [] : loadingClaims.data.nft_claims + ).map( + ({ token_id, release_at }): NftClaim => ({ + release_at, + token_id, + }) + ) + + const claimsPending = blockHeight + ? nftClaims?.filter((c) => !claimAvailable(c, blockHeight)) + : undefined + const claimsAvailable = blockHeight + ? nftClaims?.filter((c) => claimAvailable(c, blockHeight)) + : undefined + const sumClaimsAvailable = claimsAvailable?.length + + // Total staked value + const loadingTotalStakedValue = useQueryLoadingDataWithError({ + ...dao.votingModule.getTotalVotingPowerQuery(), + enabled: fetchTotalStakedValue, + }) + + // Wallet staked value + const loadingWalletStakedNftIds = useQueryLoadingDataWithError( + daoVotingOnftStakedQueries.stakedNfts(queryClient, { + chainId, + contractAddress: votingModuleAddress, + args: { + address: walletAddress ?? '', + }, + options: { + enabled: fetchWalletStakedValue && !!walletAddress, + }, + }) + ) + + const loadingWalletStakedNfts = useCachedLoadingWithError( + !loadingWalletStakedNftIds.loading && !loadingWalletStakedNftIds.errored + ? waitForAll( + loadingWalletStakedNftIds.data.map((tokenId) => + nftCardInfoSelector({ + chainId, + collection: collectionAddress, + tokenId, + }) + ) + ) + : undefined + ) + + const loadingWalletUnstakedOnfts = useQueryLoadingDataWithError({ + ...omniflixQueries.allOnfts(queryClient, { + chainId, + id: collectionAddress, + owner: walletAddress ?? '', + }), + enabled: fetchWalletUnstakedNfts && !!walletAddress, + }) + + const loadingWalletUnstakedNfts = useCachedLoadingWithError( + !loadingWalletUnstakedOnfts.loading && !loadingWalletUnstakedOnfts.errored + ? waitForAll( + loadingWalletUnstakedOnfts.data.map(({ id }) => + nftCardInfoSelector({ + chainId, + collection: collectionAddress, + tokenId: id, + }) + ) + ) + : undefined + ) + + return { + stakingContractVersion, + stakingContractAddress: votingModuleAddress, + unstakingDuration, + refreshTotals, + /// Optional + // Claims + blockHeight: + blockHeightLoadable.state === 'hasValue' + ? blockHeightLoadable.contents + : 0, + refreshClaims: fetchClaims ? refreshClaims : undefined, + claims: nftClaims, + claimsPending, + claimsAvailable, + sumClaimsAvailable, + // Total staked value + loadingTotalStakedValue: + !fetchTotalStakedValue || loadingTotalStakedValue.errored + ? undefined + : loadingTotalStakedValue.loading + ? { loading: true } + : { + loading: false, + data: Number(loadingTotalStakedValue.data.power), + }, + // Wallet staked value + loadingWalletStakedValue: + !fetchWalletStakedValue || loadingWalletStakedNftIds.errored + ? undefined + : loadingWalletStakedNftIds.loading + ? { loading: true } + : { + loading: false, + data: loadingWalletStakedNftIds.data.length, + }, + loadingWalletStakedNfts, + loadingWalletUnstakedNfts, + } +} diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useVotingModuleRelevantAddresses.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useVotingModuleRelevantAddresses.ts new file mode 100644 index 000000000..11089724e --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useVotingModuleRelevantAddresses.ts @@ -0,0 +1,26 @@ +import { useTranslation } from 'react-i18next' + +import { VotingModuleRelevantAddress } from '@dao-dao/types' + +import { useGovernanceCollectionInfo } from './useGovernanceCollectionInfo' + +export const useVotingModuleRelevantAddresses = + (): VotingModuleRelevantAddress[] => { + const { t } = useTranslation() + + const { + stakingContractAddress, + collectionAddress: governanceTokenAddress, + } = useGovernanceCollectionInfo() + + return [ + { + label: t('info.govNftCollection'), + address: governanceTokenAddress, + }, + { + label: t('info.stakingAddress'), + address: stakingContractAddress, + }, + ] + } diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/index.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/index.ts new file mode 100644 index 000000000..30f9cb88c --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/index.ts @@ -0,0 +1,73 @@ +import { + ImageRounded, + PeopleAltOutlined, + PeopleAltRounded, +} from '@mui/icons-material' + +import { MainDaoInfoCardsTokenLoader } from '@dao-dao/stateless' +import { + ActionCategoryKey, + DaoTabId, + VotingModuleAdapter, +} from '@dao-dao/types' +import { DAO_VOTING_ONFT_STAKED_CONTRACT_NAMES } from '@dao-dao/utils' + +import { makeUpdateStakingConfigAction } from './actions' +import { + MembersTab, + NftCollectionTab, + ProfileCardMemberInfo, +} from './components' +import { + useCommonGovernanceTokenInfo, + useMainDaoInfoCards, + useVotingModuleRelevantAddresses, +} from './hooks' + +export const DaoVotingOnftStakedAdapter: VotingModuleAdapter = { + id: 'DaoVotingOnftStaked', + contractNames: DAO_VOTING_ONFT_STAKED_CONTRACT_NAMES, + + load: () => ({ + // Hooks + hooks: { + useMainDaoInfoCards, + useVotingModuleRelevantAddresses, + useCommonGovernanceTokenInfo, + }, + + // Components + components: { + extraTabs: [ + { + id: DaoTabId.Members, + labelI18nKey: 'title.members', + Component: MembersTab, + Icon: PeopleAltOutlined, + IconFilled: PeopleAltRounded, + }, + { + id: DaoTabId.Collection, + labelI18nKey: 'title.nftCollection', + Component: NftCollectionTab, + Icon: ImageRounded, + IconFilled: ImageRounded, + }, + ], + + MainDaoInfoCardsLoader: MainDaoInfoCardsTokenLoader, + ProfileCardMemberInfo, + }, + + // Functions + fields: { + actionCategoryMakers: [ + () => ({ + // Add to DAO Governance category. + key: ActionCategoryKey.DaoGovernance, + actionMakers: [makeUpdateStakingConfigAction], + }), + ], + }, + }), +} diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/types.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/types.ts new file mode 100644 index 000000000..67b25e23b --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/types.ts @@ -0,0 +1,61 @@ +import { + ContractVersion, + Duration, + GenericToken, + LoadingData, + LoadingDataWithError, + NftCardInfo, +} from '@dao-dao/types' +import { NftClaim } from '@dao-dao/types/contracts/DaoVotingOnftStaked' + +export interface UseStakingInfoOptions { + fetchClaims?: boolean + fetchTotalStakedValue?: boolean + fetchWalletStakedValue?: boolean + fetchWalletUnstakedNfts?: boolean +} + +export interface UseStakingInfoResponse { + stakingContractVersion: ContractVersion + stakingContractAddress: string + unstakingDuration?: Duration + refreshTotals: () => void + /// Optional + // Claims + blockHeight?: number + refreshClaims?: () => void + claims?: NftClaim[] + claimsPending?: NftClaim[] + claimsAvailable?: NftClaim[] + sumClaimsAvailable?: number + // Total staked value + loadingTotalStakedValue?: LoadingData + // Wallet staked value + loadingWalletStakedValue?: LoadingData + loadingWalletStakedNfts?: LoadingDataWithError + loadingWalletUnstakedNfts?: LoadingDataWithError +} + +export interface UseGovernanceCollectionInfoOptions { + fetchWalletBalance?: boolean + fetchTreasuryBalance?: boolean + // fetchUsdcPrice?: boolean +} + +export interface UseGovernanceCollectionInfoResponse { + stakingContractAddress: string + collectionAddress: string + collectionInfo: { + name: string + symbol: string + totalSupply: number + } + token: GenericToken + /// Optional + // Wallet balance + loadingWalletBalance?: LoadingData + // Treasury balance + loadingTreasuryBalance?: LoadingData + // Price + // loadingPrice?: LoadingData +} diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/types.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/types.ts index af650b924..54c794113 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/types.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/types.ts @@ -17,7 +17,6 @@ export interface UseStakingInfoOptions { fetchClaims?: boolean fetchTotalStakedValue?: boolean fetchWalletStakedValue?: boolean - fetchWalletUnstakedValue?: boolean } export interface UseStakingInfoResponse { diff --git a/packages/stateful/voting-module-adapter/adapters/index.ts b/packages/stateful/voting-module-adapter/adapters/index.ts index 4bfdac485..616f8bdb0 100644 --- a/packages/stateful/voting-module-adapter/adapters/index.ts +++ b/packages/stateful/voting-module-adapter/adapters/index.ts @@ -2,6 +2,7 @@ export * from './DaoVotingCw4' export * from './DaoVotingCw20Staked' export * from './DaoVotingCw721Staked' export * from './DaoVotingNativeStaked' +export * from './DaoVotingOnftStaked' export * from './DaoVotingTokenStaked' export * from './Fallback' export * from './NeutronVotingRegistry' diff --git a/packages/stateful/voting-module-adapter/core.ts b/packages/stateful/voting-module-adapter/core.ts index 4a0593cc6..30f31c72d 100644 --- a/packages/stateful/voting-module-adapter/core.ts +++ b/packages/stateful/voting-module-adapter/core.ts @@ -9,6 +9,7 @@ import { DaoVotingCw4Adapter, DaoVotingCw721StakedAdapter, DaoVotingNativeStakedAdapter, + DaoVotingOnftStakedAdapter, DaoVotingTokenStakedAdapter, FallbackAdapter, } from './adapters' @@ -28,6 +29,7 @@ export const getAdapters = (): readonly VotingModuleAdapter[] => [ DaoVotingCw20StakedAdapter, DaoVotingCw721StakedAdapter, DaoVotingNativeStakedAdapter, + DaoVotingOnftStakedAdapter, DaoVotingTokenStakedAdapter, NeutronVotingRegistryAdapter, ] diff --git a/packages/types/chain.ts b/packages/types/chain.ts index 437e8e227..984b1454d 100644 --- a/packages/types/chain.ts +++ b/packages/types/chain.ts @@ -239,6 +239,9 @@ export type CodeIdConfig = { // For Secret Network QueryAuth?: number + // For OmniFlix + DaoVotingOnftStaked?: number + // For migrating Migaloo DAOs from cosmwasm to osmosis x/tokenfactory. CwTokenfactoryIssuerCosmWasm?: number diff --git a/packages/types/contracts/Cw721Base.ts b/packages/types/contracts/Cw721Base.ts index 5994424c0..b0d6e6331 100644 --- a/packages/types/contracts/Cw721Base.ts +++ b/packages/types/contracts/Cw721Base.ts @@ -1,34 +1,11 @@ -import { Binary, Empty, Expiration } from './common' +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ -export interface AllNftInfoResponse { - access: OwnerOfResponse - info: NftInfoResponseForNullable_Empty -} -export interface OwnerOfResponse { - approvals: Approval[] - owner: string -} -export interface Approval { - expires: Expiration - spender: string -} -export interface NftInfoResponseForNullable_Empty { - extension?: Empty | null - token_uri?: string | null -} -export interface AllOperatorsResponse { - operators: Approval[] -} -export interface AllTokensResponse { - tokens: string[] -} -export interface ApprovalResponse { - approval: Approval -} -export interface ApprovalsResponse { - approvals: Approval[] -} -export interface ContractInfoResponse { +export interface InstantiateMsg { + minter: string name: string symbol: string } @@ -78,27 +55,37 @@ export type ExecuteMsg = token_id: string } } -export interface MintMsgForNullable_Empty { - extension?: Empty | null - owner: string - token_id: string - token_uri?: string | null -} -export interface InstantiateMsg { - minter: string - name: string - symbol: string -} -export interface MinterResponse { - minter: string -} -export interface NftInfoResponse { - extension?: Empty | null - token_uri?: string | null -} -export interface NumTokensResponse { - count: number -} + | { + extension: { + msg: Empty + } + } + | { + update_ownership: Action + } +export type Binary = string +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export type Timestamp = Uint64 +export type Uint64 = string +export type Action = + | { + transfer_ownership: { + expiry?: Expiration | null + new_owner: string + } + } + | 'accept_ownership' + | 'renounce_ownership' +export interface Empty {} export type QueryMsg = | { owner_of: { @@ -119,6 +106,13 @@ export type QueryMsg = token_id: string } } + | { + operator: { + include_expired?: boolean | null + operator: string + owner: string + } + } | { all_operators: { include_expired?: boolean | null @@ -160,6 +154,64 @@ export type QueryMsg = | { minter: {} } + | { + extension: { + msg: Empty + } + } + | { + ownership: {} + } +export interface AllNftInfoResponseForEmpty { + access: OwnerOfResponse + info: NftInfoResponseForEmpty +} +export interface OwnerOfResponse { + approvals: Approval[] + owner: string +} +export interface Approval { + expires: Expiration + spender: string +} +export interface NftInfoResponseForEmpty { + extension?: Empty | null + token_uri?: string | null +} +export interface OperatorsResponse { + operators: Approval[] +} export interface TokensResponse { tokens: string[] } +export interface ApprovalResponse { + approval: Approval +} +export interface ApprovalsResponse { + approvals: Approval[] +} +export interface ContractInfoResponse { + name: string + symbol: string +} +export type Null = null +export interface MinterResponse { + minter?: string | null +} +export interface NumTokensResponse { + count: number +} +export interface OperatorResponse { + approval: Approval +} +export interface OwnershipForString { + owner?: string | null + pending_expiry?: Expiration | null + pending_owner?: string | null +} +export interface MintMsgForNullable_Empty { + extension?: Empty | null + owner: string + token_id: string + token_uri?: string | null +} diff --git a/packages/types/contracts/DaoVotingOnftStaked.ts b/packages/types/contracts/DaoVotingOnftStaked.ts new file mode 100644 index 000000000..bb7292fea --- /dev/null +++ b/packages/types/contracts/DaoVotingOnftStaked.ts @@ -0,0 +1,170 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +export type ActiveThreshold = + | { + absolute_count: { + count: Uint128 + } + } + | { + percentage: { + percent: Decimal + } + } +export type Uint128 = string +export type Decimal = string +export type OnftCollection = { + existing: { + id: string + } +} +export type Duration = + | { + height: number + } + | { + time: number + } +export interface InstantiateMsg { + active_threshold?: ActiveThreshold | null + onft_collection: OnftCollection + unstaking_duration?: Duration | null +} +export type ExecuteMsg = + | { + prepare_stake: { + token_ids: string[] + } + } + | { + confirm_stake: { + token_ids: string[] + } + } + | { + cancel_stake: { + recipient?: string | null + token_ids: string[] + } + } + | { + unstake: { + token_ids: string[] + } + } + | { + claim_nfts: {} + } + | { + update_config: { + duration?: Duration | null + } + } + | { + add_hook: { + addr: string + } + } + | { + remove_hook: { + addr: string + } + } + | { + update_active_threshold: { + new_threshold?: ActiveThreshold | null + } + } +export type QueryMsg = + | { + config: {} + } + | { + nft_claims: { + address: string + } + } + | { + hooks: {} + } + | { + staked_nfts: { + address: string + limit?: number | null + start_after?: string | null + } + } + | { + active_threshold: {} + } + | { + is_active: {} + } + | { + voting_power_at_height: { + address: string + height?: number | null + } + } + | { + total_power_at_height: { + height?: number | null + } + } + | { + dao: {} + } + | { + info: {} + } +export interface ActiveThresholdResponse { + active_threshold?: ActiveThreshold | null +} +export interface Config { + onft_collection_id: string + unstaking_duration?: Duration | null +} +export type Addr = string +export interface HooksResponse { + hooks: string[] +} +export interface InfoResponse { + info: ContractVersion +} +export interface ContractVersion { + contract: string + version: string +} +export type Boolean = boolean +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export type Timestamp = Uint64 +export type Uint64 = string +export interface NftClaimsResponse { + nft_claims: NftClaim[] +} +export interface NftClaim { + release_at: Expiration + token_id: string +} +export type ArrayOfString = string[] +export interface TotalPowerAtHeightResponse { + height: number + power: Uint128 +} +export interface VotingPowerAtHeightResponse { + height: number + power: Uint128 +} diff --git a/packages/types/protobuf/codegen/OmniFlix/bundle.ts b/packages/types/protobuf/codegen/OmniFlix/bundle.ts new file mode 100644 index 000000000..5b7206f1a --- /dev/null +++ b/packages/types/protobuf/codegen/OmniFlix/bundle.ts @@ -0,0 +1,30 @@ +import * as _200 from "./onft/v1beta1/genesis"; +import * as _201 from "./onft/v1beta1/onft"; +import * as _202 from "./onft/v1beta1/params"; +import * as _203 from "./onft/v1beta1/query"; +import * as _204 from "./onft/v1beta1/tx"; +import * as _509 from "./onft/v1beta1/tx.amino"; +import * as _510 from "./onft/v1beta1/tx.registry"; +import * as _511 from "./onft/v1beta1/query.rpc.Query"; +import * as _512 from "./onft/v1beta1/tx.rpc.msg"; +import * as _654 from "./rpc.query"; +import * as _655 from "./rpc.tx"; +export namespace OmniFlix { + export namespace onft { + export const v1beta1 = { + ..._200, + ..._201, + ..._202, + ..._203, + ..._204, + ..._509, + ..._510, + ..._511, + ..._512 + }; + } + export const ClientFactory = { + ..._654, + ..._655 + }; +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/OmniFlix/client.ts b/packages/types/protobuf/codegen/OmniFlix/client.ts new file mode 100644 index 000000000..0e5fc37a3 --- /dev/null +++ b/packages/types/protobuf/codegen/OmniFlix/client.ts @@ -0,0 +1,47 @@ +import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; +import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; +import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as omniflixOnftV1beta1TxRegistry from "./onft/v1beta1/tx.registry"; +import * as omniflixOnftV1beta1TxAmino from "./onft/v1beta1/tx.amino"; +export const omniFlixAminoConverters = { + ...omniflixOnftV1beta1TxAmino.AminoConverter +}; +export const omniFlixProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...omniflixOnftV1beta1TxRegistry.registry]; +export const getSigningOmniFlixClientOptions = ({ + defaultTypes = defaultRegistryTypes +}: { + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +} = {}): { + registry: Registry; + aminoTypes: AminoTypes; +} => { + const registry = new Registry([...defaultTypes, ...omniFlixProtoRegistry]); + const aminoTypes = new AminoTypes({ + ...omniFlixAminoConverters + }); + return { + registry, + aminoTypes + }; +}; +export const getSigningOmniFlixClient = async ({ + rpcEndpoint, + signer, + defaultTypes = defaultRegistryTypes +}: { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +}) => { + const { + registry, + aminoTypes + } = getSigningOmniFlixClientOptions({ + defaultTypes + }); + const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { + registry: (registry as any), + aminoTypes + }); + return client; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/genesis.ts b/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/genesis.ts new file mode 100644 index 000000000..a493deea6 --- /dev/null +++ b/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/genesis.ts @@ -0,0 +1,104 @@ +//@ts-nocheck +import { Collection, CollectionAmino, CollectionSDKType } from "./onft"; +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** GenesisState defines the nft module's genesis state. */ +export interface GenesisState { + collections: Collection[]; + params: Params | undefined; +} +export interface GenesisStateProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the nft module's genesis state. */ +export interface GenesisStateAmino { + collections?: CollectionAmino[]; + params?: ParamsAmino | undefined; +} +export interface GenesisStateAminoMsg { + type: "/OmniFlix.onft.v1beta1.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the nft module's genesis state. */ +export interface GenesisStateSDKType { + collections: CollectionSDKType[]; + params: ParamsSDKType | undefined; +} +function createBaseGenesisState(): GenesisState { + return { + collections: [], + params: Params.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/OmniFlix.onft.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.collections) { + Collection.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.collections.push(Collection.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.collections = object.collections?.map(e => Collection.fromPartial(e)) || []; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.collections = object.collections?.map(e => Collection.fromAmino(e)) || []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: GenesisState, useInterfaces: boolean = false): GenesisStateAmino { + const obj: any = {}; + if (message.collections) { + obj.collections = message.collections.map(e => e ? Collection.toAmino(e, useInterfaces) : undefined); + } else { + obj.collections = []; + } + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg, useInterfaces: boolean = false): GenesisState { + return GenesisState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/onft.ts b/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/onft.ts new file mode 100644 index 000000000..136820e8d --- /dev/null +++ b/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/onft.ts @@ -0,0 +1,1355 @@ +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +import { Decimal } from "@cosmjs/math"; +/** Collection */ +export interface Collection { + denom: Denom | undefined; + onfts: ONFT[]; +} +export interface CollectionProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.Collection"; + value: Uint8Array; +} +/** Collection */ +export interface CollectionAmino { + denom?: DenomAmino | undefined; + onfts?: ONFTAmino[]; +} +export interface CollectionAminoMsg { + type: "/OmniFlix.onft.v1beta1.Collection"; + value: CollectionAmino; +} +/** Collection */ +export interface CollectionSDKType { + denom: DenomSDKType | undefined; + onfts: ONFTSDKType[]; +} +export interface IDCollection { + denomId: string; + onftIds: string[]; +} +export interface IDCollectionProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.IDCollection"; + value: Uint8Array; +} +export interface IDCollectionAmino { + denom_id?: string; + onft_ids?: string[]; +} +export interface IDCollectionAminoMsg { + type: "/OmniFlix.onft.v1beta1.IDCollection"; + value: IDCollectionAmino; +} +export interface IDCollectionSDKType { + denom_id: string; + onft_ids: string[]; +} +export interface Denom { + id: string; + symbol: string; + name: string; + schema: string; + creator: string; + description: string; + previewUri: string; + uri: string; + uriHash: string; + data: string; + royaltyReceivers: WeightedAddress[]; +} +export interface DenomProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.Denom"; + value: Uint8Array; +} +export interface DenomAmino { + id?: string; + symbol?: string; + name?: string; + schema?: string; + creator?: string; + description?: string; + preview_uri?: string; + uri?: string; + uri_hash?: string; + data?: string; + royalty_receivers?: WeightedAddressAmino[]; +} +export interface DenomAminoMsg { + type: "/OmniFlix.onft.v1beta1.Denom"; + value: DenomAmino; +} +export interface DenomSDKType { + id: string; + symbol: string; + name: string; + schema: string; + creator: string; + description: string; + preview_uri: string; + uri: string; + uri_hash: string; + data: string; + royalty_receivers: WeightedAddressSDKType[]; +} +export interface DenomMetadata { + creator: string; + schema: string; + description: string; + previewUri: string; + data: string; + uriHash: string; + royaltyReceivers: WeightedAddress[]; +} +export interface DenomMetadataProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.DenomMetadata"; + value: Uint8Array; +} +export interface DenomMetadataAmino { + creator?: string; + schema?: string; + description?: string; + preview_uri?: string; + data?: string; + uri_hash?: string; + royalty_receivers?: WeightedAddressAmino[]; +} +export interface DenomMetadataAminoMsg { + type: "/OmniFlix.onft.v1beta1.DenomMetadata"; + value: DenomMetadataAmino; +} +export interface DenomMetadataSDKType { + creator: string; + schema: string; + description: string; + preview_uri: string; + data: string; + uri_hash: string; + royalty_receivers: WeightedAddressSDKType[]; +} +/** ASSET or ONFT */ +export interface ONFT { + id: string; + metadata: Metadata | undefined; + data: string; + owner: string; + transferable: boolean; + extensible: boolean; + createdAt: Date | undefined; + nsfw: boolean; + royaltyShare: string; +} +export interface ONFTProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.ONFT"; + value: Uint8Array; +} +/** ASSET or ONFT */ +export interface ONFTAmino { + id?: string; + metadata?: MetadataAmino | undefined; + data?: string; + owner?: string; + transferable?: boolean; + extensible?: boolean; + created_at?: string | undefined; + nsfw?: boolean; + royalty_share?: string; +} +export interface ONFTAminoMsg { + type: "/OmniFlix.onft.v1beta1.ONFT"; + value: ONFTAmino; +} +/** ASSET or ONFT */ +export interface ONFTSDKType { + id: string; + metadata: MetadataSDKType | undefined; + data: string; + owner: string; + transferable: boolean; + extensible: boolean; + created_at: Date | undefined; + nsfw: boolean; + royalty_share: string; +} +export interface Metadata { + name: string; + description: string; + mediaUri: string; + previewUri: string; + uriHash: string; +} +export interface MetadataProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.Metadata"; + value: Uint8Array; +} +export interface MetadataAmino { + name?: string; + description?: string; + media_uri?: string; + preview_uri?: string; + uri_hash?: string; +} +export interface MetadataAminoMsg { + type: "/OmniFlix.onft.v1beta1.Metadata"; + value: MetadataAmino; +} +export interface MetadataSDKType { + name: string; + description: string; + media_uri: string; + preview_uri: string; + uri_hash: string; +} +export interface ONFTMetadata { + name: string; + description: string; + previewUri: string; + data: string; + transferable: boolean; + extensible: boolean; + createdAt: Date | undefined; + nsfw: boolean; + royaltyShare: string; + uriHash: string; +} +export interface ONFTMetadataProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.ONFTMetadata"; + value: Uint8Array; +} +export interface ONFTMetadataAmino { + name?: string; + description?: string; + preview_uri?: string; + data?: string; + transferable?: boolean; + extensible?: boolean; + created_at?: string | undefined; + nsfw?: boolean; + royalty_share?: string; + uri_hash?: string; +} +export interface ONFTMetadataAminoMsg { + type: "/OmniFlix.onft.v1beta1.ONFTMetadata"; + value: ONFTMetadataAmino; +} +export interface ONFTMetadataSDKType { + name: string; + description: string; + preview_uri: string; + data: string; + transferable: boolean; + extensible: boolean; + created_at: Date | undefined; + nsfw: boolean; + royalty_share: string; + uri_hash: string; +} +export interface Owner { + address: string; + idCollections: IDCollection[]; +} +export interface OwnerProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.Owner"; + value: Uint8Array; +} +export interface OwnerAmino { + address?: string; + id_collections?: IDCollectionAmino[]; +} +export interface OwnerAminoMsg { + type: "/OmniFlix.onft.v1beta1.Owner"; + value: OwnerAmino; +} +export interface OwnerSDKType { + address: string; + id_collections: IDCollectionSDKType[]; +} +export interface WeightedAddress { + address: string; + weight: string; +} +export interface WeightedAddressProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.WeightedAddress"; + value: Uint8Array; +} +export interface WeightedAddressAmino { + address?: string; + weight?: string; +} +export interface WeightedAddressAminoMsg { + type: "/OmniFlix.onft.v1beta1.WeightedAddress"; + value: WeightedAddressAmino; +} +export interface WeightedAddressSDKType { + address: string; + weight: string; +} +function createBaseCollection(): Collection { + return { + denom: Denom.fromPartial({}), + onfts: [] + }; +} +export const Collection = { + typeUrl: "/OmniFlix.onft.v1beta1.Collection", + encode(message: Collection, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== undefined) { + Denom.encode(message.denom, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.onfts) { + ONFT.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Collection { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCollection(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = Denom.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.onfts.push(ONFT.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Collection { + const message = createBaseCollection(); + message.denom = object.denom !== undefined && object.denom !== null ? Denom.fromPartial(object.denom) : undefined; + message.onfts = object.onfts?.map(e => ONFT.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CollectionAmino): Collection { + const message = createBaseCollection(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = Denom.fromAmino(object.denom); + } + message.onfts = object.onfts?.map(e => ONFT.fromAmino(e)) || []; + return message; + }, + toAmino(message: Collection, useInterfaces: boolean = false): CollectionAmino { + const obj: any = {}; + obj.denom = message.denom ? Denom.toAmino(message.denom, useInterfaces) : undefined; + if (message.onfts) { + obj.onfts = message.onfts.map(e => e ? ONFT.toAmino(e, useInterfaces) : undefined); + } else { + obj.onfts = []; + } + return obj; + }, + fromAminoMsg(object: CollectionAminoMsg): Collection { + return Collection.fromAmino(object.value); + }, + fromProtoMsg(message: CollectionProtoMsg, useInterfaces: boolean = false): Collection { + return Collection.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Collection): Uint8Array { + return Collection.encode(message).finish(); + }, + toProtoMsg(message: Collection): CollectionProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.Collection", + value: Collection.encode(message).finish() + }; + } +}; +function createBaseIDCollection(): IDCollection { + return { + denomId: "", + onftIds: [] + }; +} +export const IDCollection = { + typeUrl: "/OmniFlix.onft.v1beta1.IDCollection", + encode(message: IDCollection, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denomId !== "") { + writer.uint32(10).string(message.denomId); + } + for (const v of message.onftIds) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): IDCollection { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIDCollection(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomId = reader.string(); + break; + case 2: + message.onftIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IDCollection { + const message = createBaseIDCollection(); + message.denomId = object.denomId ?? ""; + message.onftIds = object.onftIds?.map(e => e) || []; + return message; + }, + fromAmino(object: IDCollectionAmino): IDCollection { + const message = createBaseIDCollection(); + if (object.denom_id !== undefined && object.denom_id !== null) { + message.denomId = object.denom_id; + } + message.onftIds = object.onft_ids?.map(e => e) || []; + return message; + }, + toAmino(message: IDCollection, useInterfaces: boolean = false): IDCollectionAmino { + const obj: any = {}; + obj.denom_id = message.denomId; + if (message.onftIds) { + obj.onft_ids = message.onftIds.map(e => e); + } else { + obj.onft_ids = []; + } + return obj; + }, + fromAminoMsg(object: IDCollectionAminoMsg): IDCollection { + return IDCollection.fromAmino(object.value); + }, + fromProtoMsg(message: IDCollectionProtoMsg, useInterfaces: boolean = false): IDCollection { + return IDCollection.decode(message.value, undefined, useInterfaces); + }, + toProto(message: IDCollection): Uint8Array { + return IDCollection.encode(message).finish(); + }, + toProtoMsg(message: IDCollection): IDCollectionProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.IDCollection", + value: IDCollection.encode(message).finish() + }; + } +}; +function createBaseDenom(): Denom { + return { + id: "", + symbol: "", + name: "", + schema: "", + creator: "", + description: "", + previewUri: "", + uri: "", + uriHash: "", + data: "", + royaltyReceivers: [] + }; +} +export const Denom = { + typeUrl: "/OmniFlix.onft.v1beta1.Denom", + encode(message: Denom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.symbol !== "") { + writer.uint32(18).string(message.symbol); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.schema !== "") { + writer.uint32(34).string(message.schema); + } + if (message.creator !== "") { + writer.uint32(42).string(message.creator); + } + if (message.description !== "") { + writer.uint32(50).string(message.description); + } + if (message.previewUri !== "") { + writer.uint32(58).string(message.previewUri); + } + if (message.uri !== "") { + writer.uint32(66).string(message.uri); + } + if (message.uriHash !== "") { + writer.uint32(74).string(message.uriHash); + } + if (message.data !== "") { + writer.uint32(82).string(message.data); + } + for (const v of message.royaltyReceivers) { + WeightedAddress.encode(v!, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Denom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenom(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.symbol = reader.string(); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.schema = reader.string(); + break; + case 5: + message.creator = reader.string(); + break; + case 6: + message.description = reader.string(); + break; + case 7: + message.previewUri = reader.string(); + break; + case 8: + message.uri = reader.string(); + break; + case 9: + message.uriHash = reader.string(); + break; + case 10: + message.data = reader.string(); + break; + case 11: + message.royaltyReceivers.push(WeightedAddress.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Denom { + const message = createBaseDenom(); + message.id = object.id ?? ""; + message.symbol = object.symbol ?? ""; + message.name = object.name ?? ""; + message.schema = object.schema ?? ""; + message.creator = object.creator ?? ""; + message.description = object.description ?? ""; + message.previewUri = object.previewUri ?? ""; + message.uri = object.uri ?? ""; + message.uriHash = object.uriHash ?? ""; + message.data = object.data ?? ""; + message.royaltyReceivers = object.royaltyReceivers?.map(e => WeightedAddress.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DenomAmino): Denom { + const message = createBaseDenom(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.schema !== undefined && object.schema !== null) { + message.schema = object.schema; + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.preview_uri !== undefined && object.preview_uri !== null) { + message.previewUri = object.preview_uri; + } + if (object.uri !== undefined && object.uri !== null) { + message.uri = object.uri; + } + if (object.uri_hash !== undefined && object.uri_hash !== null) { + message.uriHash = object.uri_hash; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + message.royaltyReceivers = object.royalty_receivers?.map(e => WeightedAddress.fromAmino(e)) || []; + return message; + }, + toAmino(message: Denom, useInterfaces: boolean = false): DenomAmino { + const obj: any = {}; + obj.id = message.id; + obj.symbol = message.symbol; + obj.name = message.name; + obj.schema = message.schema; + obj.creator = message.creator; + obj.description = message.description; + obj.preview_uri = message.previewUri; + obj.uri = message.uri; + obj.uri_hash = message.uriHash; + obj.data = message.data; + if (message.royaltyReceivers) { + obj.royalty_receivers = message.royaltyReceivers.map(e => e ? WeightedAddress.toAmino(e, useInterfaces) : undefined); + } else { + obj.royalty_receivers = []; + } + return obj; + }, + fromAminoMsg(object: DenomAminoMsg): Denom { + return Denom.fromAmino(object.value); + }, + fromProtoMsg(message: DenomProtoMsg, useInterfaces: boolean = false): Denom { + return Denom.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Denom): Uint8Array { + return Denom.encode(message).finish(); + }, + toProtoMsg(message: Denom): DenomProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.Denom", + value: Denom.encode(message).finish() + }; + } +}; +function createBaseDenomMetadata(): DenomMetadata { + return { + creator: "", + schema: "", + description: "", + previewUri: "", + data: "", + uriHash: "", + royaltyReceivers: [] + }; +} +export const DenomMetadata = { + typeUrl: "/OmniFlix.onft.v1beta1.DenomMetadata", + encode(message: DenomMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + if (message.schema !== "") { + writer.uint32(18).string(message.schema); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + if (message.previewUri !== "") { + writer.uint32(34).string(message.previewUri); + } + if (message.data !== "") { + writer.uint32(42).string(message.data); + } + if (message.uriHash !== "") { + writer.uint32(50).string(message.uriHash); + } + for (const v of message.royaltyReceivers) { + WeightedAddress.encode(v!, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): DenomMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + case 2: + message.schema = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.previewUri = reader.string(); + break; + case 5: + message.data = reader.string(); + break; + case 6: + message.uriHash = reader.string(); + break; + case 7: + message.royaltyReceivers.push(WeightedAddress.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DenomMetadata { + const message = createBaseDenomMetadata(); + message.creator = object.creator ?? ""; + message.schema = object.schema ?? ""; + message.description = object.description ?? ""; + message.previewUri = object.previewUri ?? ""; + message.data = object.data ?? ""; + message.uriHash = object.uriHash ?? ""; + message.royaltyReceivers = object.royaltyReceivers?.map(e => WeightedAddress.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DenomMetadataAmino): DenomMetadata { + const message = createBaseDenomMetadata(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + if (object.schema !== undefined && object.schema !== null) { + message.schema = object.schema; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.preview_uri !== undefined && object.preview_uri !== null) { + message.previewUri = object.preview_uri; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + if (object.uri_hash !== undefined && object.uri_hash !== null) { + message.uriHash = object.uri_hash; + } + message.royaltyReceivers = object.royalty_receivers?.map(e => WeightedAddress.fromAmino(e)) || []; + return message; + }, + toAmino(message: DenomMetadata, useInterfaces: boolean = false): DenomMetadataAmino { + const obj: any = {}; + obj.creator = message.creator; + obj.schema = message.schema; + obj.description = message.description; + obj.preview_uri = message.previewUri; + obj.data = message.data; + obj.uri_hash = message.uriHash; + if (message.royaltyReceivers) { + obj.royalty_receivers = message.royaltyReceivers.map(e => e ? WeightedAddress.toAmino(e, useInterfaces) : undefined); + } else { + obj.royalty_receivers = []; + } + return obj; + }, + fromAminoMsg(object: DenomMetadataAminoMsg): DenomMetadata { + return DenomMetadata.fromAmino(object.value); + }, + fromProtoMsg(message: DenomMetadataProtoMsg, useInterfaces: boolean = false): DenomMetadata { + return DenomMetadata.decode(message.value, undefined, useInterfaces); + }, + toProto(message: DenomMetadata): Uint8Array { + return DenomMetadata.encode(message).finish(); + }, + toProtoMsg(message: DenomMetadata): DenomMetadataProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.DenomMetadata", + value: DenomMetadata.encode(message).finish() + }; + } +}; +function createBaseONFT(): ONFT { + return { + id: "", + metadata: Metadata.fromPartial({}), + data: "", + owner: "", + transferable: false, + extensible: false, + createdAt: new Date(), + nsfw: false, + royaltyShare: "" + }; +} +export const ONFT = { + typeUrl: "/OmniFlix.onft.v1beta1.ONFT", + encode(message: ONFT, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.metadata !== undefined) { + Metadata.encode(message.metadata, writer.uint32(18).fork()).ldelim(); + } + if (message.data !== "") { + writer.uint32(26).string(message.data); + } + if (message.owner !== "") { + writer.uint32(34).string(message.owner); + } + if (message.transferable === true) { + writer.uint32(40).bool(message.transferable); + } + if (message.extensible === true) { + writer.uint32(48).bool(message.extensible); + } + if (message.createdAt !== undefined) { + Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(58).fork()).ldelim(); + } + if (message.nsfw === true) { + writer.uint32(64).bool(message.nsfw); + } + if (message.royaltyShare !== "") { + writer.uint32(74).string(Decimal.fromUserInput(message.royaltyShare, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ONFT { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseONFT(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.metadata = Metadata.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.data = reader.string(); + break; + case 4: + message.owner = reader.string(); + break; + case 5: + message.transferable = reader.bool(); + break; + case 6: + message.extensible = reader.bool(); + break; + case 7: + message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 8: + message.nsfw = reader.bool(); + break; + case 9: + message.royaltyShare = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ONFT { + const message = createBaseONFT(); + message.id = object.id ?? ""; + message.metadata = object.metadata !== undefined && object.metadata !== null ? Metadata.fromPartial(object.metadata) : undefined; + message.data = object.data ?? ""; + message.owner = object.owner ?? ""; + message.transferable = object.transferable ?? false; + message.extensible = object.extensible ?? false; + message.createdAt = object.createdAt ?? undefined; + message.nsfw = object.nsfw ?? false; + message.royaltyShare = object.royaltyShare ?? ""; + return message; + }, + fromAmino(object: ONFTAmino): ONFT { + const message = createBaseONFT(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = Metadata.fromAmino(object.metadata); + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.transferable !== undefined && object.transferable !== null) { + message.transferable = object.transferable; + } + if (object.extensible !== undefined && object.extensible !== null) { + message.extensible = object.extensible; + } + if (object.created_at !== undefined && object.created_at !== null) { + message.createdAt = fromTimestamp(Timestamp.fromAmino(object.created_at)); + } + if (object.nsfw !== undefined && object.nsfw !== null) { + message.nsfw = object.nsfw; + } + if (object.royalty_share !== undefined && object.royalty_share !== null) { + message.royaltyShare = object.royalty_share; + } + return message; + }, + toAmino(message: ONFT, useInterfaces: boolean = false): ONFTAmino { + const obj: any = {}; + obj.id = message.id; + obj.metadata = message.metadata ? Metadata.toAmino(message.metadata, useInterfaces) : undefined; + obj.data = message.data; + obj.owner = message.owner; + obj.transferable = message.transferable; + obj.extensible = message.extensible; + obj.created_at = message.createdAt ? Timestamp.toAmino(toTimestamp(message.createdAt)) : undefined; + obj.nsfw = message.nsfw; + obj.royalty_share = message.royaltyShare; + return obj; + }, + fromAminoMsg(object: ONFTAminoMsg): ONFT { + return ONFT.fromAmino(object.value); + }, + fromProtoMsg(message: ONFTProtoMsg, useInterfaces: boolean = false): ONFT { + return ONFT.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ONFT): Uint8Array { + return ONFT.encode(message).finish(); + }, + toProtoMsg(message: ONFT): ONFTProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.ONFT", + value: ONFT.encode(message).finish() + }; + } +}; +function createBaseMetadata(): Metadata { + return { + name: "", + description: "", + mediaUri: "", + previewUri: "", + uriHash: "" + }; +} +export const Metadata = { + typeUrl: "/OmniFlix.onft.v1beta1.Metadata", + encode(message: Metadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.mediaUri !== "") { + writer.uint32(26).string(message.mediaUri); + } + if (message.previewUri !== "") { + writer.uint32(34).string(message.previewUri); + } + if (message.uriHash !== "") { + writer.uint32(42).string(message.uriHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Metadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.mediaUri = reader.string(); + break; + case 4: + message.previewUri = reader.string(); + break; + case 5: + message.uriHash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Metadata { + const message = createBaseMetadata(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.mediaUri = object.mediaUri ?? ""; + message.previewUri = object.previewUri ?? ""; + message.uriHash = object.uriHash ?? ""; + return message; + }, + fromAmino(object: MetadataAmino): Metadata { + const message = createBaseMetadata(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.media_uri !== undefined && object.media_uri !== null) { + message.mediaUri = object.media_uri; + } + if (object.preview_uri !== undefined && object.preview_uri !== null) { + message.previewUri = object.preview_uri; + } + if (object.uri_hash !== undefined && object.uri_hash !== null) { + message.uriHash = object.uri_hash; + } + return message; + }, + toAmino(message: Metadata, useInterfaces: boolean = false): MetadataAmino { + const obj: any = {}; + obj.name = message.name; + obj.description = message.description; + obj.media_uri = message.mediaUri; + obj.preview_uri = message.previewUri; + obj.uri_hash = message.uriHash; + return obj; + }, + fromAminoMsg(object: MetadataAminoMsg): Metadata { + return Metadata.fromAmino(object.value); + }, + fromProtoMsg(message: MetadataProtoMsg, useInterfaces: boolean = false): Metadata { + return Metadata.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Metadata): Uint8Array { + return Metadata.encode(message).finish(); + }, + toProtoMsg(message: Metadata): MetadataProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.Metadata", + value: Metadata.encode(message).finish() + }; + } +}; +function createBaseONFTMetadata(): ONFTMetadata { + return { + name: "", + description: "", + previewUri: "", + data: "", + transferable: false, + extensible: false, + createdAt: new Date(), + nsfw: false, + royaltyShare: "", + uriHash: "" + }; +} +export const ONFTMetadata = { + typeUrl: "/OmniFlix.onft.v1beta1.ONFTMetadata", + encode(message: ONFTMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.previewUri !== "") { + writer.uint32(26).string(message.previewUri); + } + if (message.data !== "") { + writer.uint32(34).string(message.data); + } + if (message.transferable === true) { + writer.uint32(40).bool(message.transferable); + } + if (message.extensible === true) { + writer.uint32(48).bool(message.extensible); + } + if (message.createdAt !== undefined) { + Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(58).fork()).ldelim(); + } + if (message.nsfw === true) { + writer.uint32(64).bool(message.nsfw); + } + if (message.royaltyShare !== "") { + writer.uint32(74).string(Decimal.fromUserInput(message.royaltyShare, 18).atomics); + } + if (message.uriHash !== "") { + writer.uint32(82).string(message.uriHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ONFTMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseONFTMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.previewUri = reader.string(); + break; + case 4: + message.data = reader.string(); + break; + case 5: + message.transferable = reader.bool(); + break; + case 6: + message.extensible = reader.bool(); + break; + case 7: + message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 8: + message.nsfw = reader.bool(); + break; + case 9: + message.royaltyShare = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 10: + message.uriHash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ONFTMetadata { + const message = createBaseONFTMetadata(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.previewUri = object.previewUri ?? ""; + message.data = object.data ?? ""; + message.transferable = object.transferable ?? false; + message.extensible = object.extensible ?? false; + message.createdAt = object.createdAt ?? undefined; + message.nsfw = object.nsfw ?? false; + message.royaltyShare = object.royaltyShare ?? ""; + message.uriHash = object.uriHash ?? ""; + return message; + }, + fromAmino(object: ONFTMetadataAmino): ONFTMetadata { + const message = createBaseONFTMetadata(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.preview_uri !== undefined && object.preview_uri !== null) { + message.previewUri = object.preview_uri; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + if (object.transferable !== undefined && object.transferable !== null) { + message.transferable = object.transferable; + } + if (object.extensible !== undefined && object.extensible !== null) { + message.extensible = object.extensible; + } + if (object.created_at !== undefined && object.created_at !== null) { + message.createdAt = fromTimestamp(Timestamp.fromAmino(object.created_at)); + } + if (object.nsfw !== undefined && object.nsfw !== null) { + message.nsfw = object.nsfw; + } + if (object.royalty_share !== undefined && object.royalty_share !== null) { + message.royaltyShare = object.royalty_share; + } + if (object.uri_hash !== undefined && object.uri_hash !== null) { + message.uriHash = object.uri_hash; + } + return message; + }, + toAmino(message: ONFTMetadata, useInterfaces: boolean = false): ONFTMetadataAmino { + const obj: any = {}; + obj.name = message.name; + obj.description = message.description; + obj.preview_uri = message.previewUri; + obj.data = message.data; + obj.transferable = message.transferable; + obj.extensible = message.extensible; + obj.created_at = message.createdAt ? Timestamp.toAmino(toTimestamp(message.createdAt)) : undefined; + obj.nsfw = message.nsfw; + obj.royalty_share = message.royaltyShare; + obj.uri_hash = message.uriHash; + return obj; + }, + fromAminoMsg(object: ONFTMetadataAminoMsg): ONFTMetadata { + return ONFTMetadata.fromAmino(object.value); + }, + fromProtoMsg(message: ONFTMetadataProtoMsg, useInterfaces: boolean = false): ONFTMetadata { + return ONFTMetadata.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ONFTMetadata): Uint8Array { + return ONFTMetadata.encode(message).finish(); + }, + toProtoMsg(message: ONFTMetadata): ONFTMetadataProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.ONFTMetadata", + value: ONFTMetadata.encode(message).finish() + }; + } +}; +function createBaseOwner(): Owner { + return { + address: "", + idCollections: [] + }; +} +export const Owner = { + typeUrl: "/OmniFlix.onft.v1beta1.Owner", + encode(message: Owner, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + for (const v of message.idCollections) { + IDCollection.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Owner { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOwner(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.idCollections.push(IDCollection.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Owner { + const message = createBaseOwner(); + message.address = object.address ?? ""; + message.idCollections = object.idCollections?.map(e => IDCollection.fromPartial(e)) || []; + return message; + }, + fromAmino(object: OwnerAmino): Owner { + const message = createBaseOwner(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + message.idCollections = object.id_collections?.map(e => IDCollection.fromAmino(e)) || []; + return message; + }, + toAmino(message: Owner, useInterfaces: boolean = false): OwnerAmino { + const obj: any = {}; + obj.address = message.address; + if (message.idCollections) { + obj.id_collections = message.idCollections.map(e => e ? IDCollection.toAmino(e, useInterfaces) : undefined); + } else { + obj.id_collections = []; + } + return obj; + }, + fromAminoMsg(object: OwnerAminoMsg): Owner { + return Owner.fromAmino(object.value); + }, + fromProtoMsg(message: OwnerProtoMsg, useInterfaces: boolean = false): Owner { + return Owner.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Owner): Uint8Array { + return Owner.encode(message).finish(); + }, + toProtoMsg(message: Owner): OwnerProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.Owner", + value: Owner.encode(message).finish() + }; + } +}; +function createBaseWeightedAddress(): WeightedAddress { + return { + address: "", + weight: "" + }; +} +export const WeightedAddress = { + typeUrl: "/OmniFlix.onft.v1beta1.WeightedAddress", + encode(message: WeightedAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.weight !== "") { + writer.uint32(18).string(Decimal.fromUserInput(message.weight, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): WeightedAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseWeightedAddress(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.weight = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): WeightedAddress { + const message = createBaseWeightedAddress(); + message.address = object.address ?? ""; + message.weight = object.weight ?? ""; + return message; + }, + fromAmino(object: WeightedAddressAmino): WeightedAddress { + const message = createBaseWeightedAddress(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + return message; + }, + toAmino(message: WeightedAddress, useInterfaces: boolean = false): WeightedAddressAmino { + const obj: any = {}; + obj.address = message.address; + obj.weight = message.weight; + return obj; + }, + fromAminoMsg(object: WeightedAddressAminoMsg): WeightedAddress { + return WeightedAddress.fromAmino(object.value); + }, + fromProtoMsg(message: WeightedAddressProtoMsg, useInterfaces: boolean = false): WeightedAddress { + return WeightedAddress.decode(message.value, undefined, useInterfaces); + }, + toProto(message: WeightedAddress): Uint8Array { + return WeightedAddress.encode(message).finish(); + }, + toProtoMsg(message: WeightedAddress): WeightedAddressProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.WeightedAddress", + value: WeightedAddress.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/params.ts b/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/params.ts new file mode 100644 index 000000000..86bf0e4a1 --- /dev/null +++ b/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/params.ts @@ -0,0 +1,82 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +export interface Params { + denomCreationFee: Coin | undefined; +} +export interface ParamsProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.Params"; + value: Uint8Array; +} +export interface ParamsAmino { + denom_creation_fee?: CoinAmino | undefined; +} +export interface ParamsAminoMsg { + type: "/OmniFlix.onft.v1beta1.Params"; + value: ParamsAmino; +} +export interface ParamsSDKType { + denom_creation_fee: CoinSDKType | undefined; +} +function createBaseParams(): Params { + return { + denomCreationFee: Coin.fromPartial({}) + }; +} +export const Params = { + typeUrl: "/OmniFlix.onft.v1beta1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denomCreationFee !== undefined) { + Coin.encode(message.denomCreationFee, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomCreationFee = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.denomCreationFee = object.denomCreationFee !== undefined && object.denomCreationFee !== null ? Coin.fromPartial(object.denomCreationFee) : undefined; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.denom_creation_fee !== undefined && object.denom_creation_fee !== null) { + message.denomCreationFee = Coin.fromAmino(object.denom_creation_fee); + } + return message; + }, + toAmino(message: Params, useInterfaces: boolean = false): ParamsAmino { + const obj: any = {}; + obj.denom_creation_fee = message.denomCreationFee ? Coin.toAmino(message.denomCreationFee, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsProtoMsg, useInterfaces: boolean = false): Params { + return Params.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/query.rpc.Query.ts b/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/query.rpc.Query.ts new file mode 100644 index 000000000..0921c00f1 --- /dev/null +++ b/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/query.rpc.Query.ts @@ -0,0 +1,138 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryCollectionRequest, QueryCollectionResponse, QueryIBCCollectionRequest, QueryDenomRequest, QueryDenomResponse, QueryIBCDenomRequest, QueryDenomsRequest, QueryDenomsResponse, QueryONFTRequest, QueryONFTResponse, QueryIBCDenomONFTRequest, QueryOwnerONFTsRequest, QueryOwnerONFTsResponse, QueryOwnerIBCDenomONFTsRequest, QuerySupplyRequest, QuerySupplyResponse, QueryIBCDenomSupplyRequest, QueryParamsRequest, QueryParamsResponse } from "./query"; +export interface Query { + collection(request: QueryCollectionRequest): Promise; + iBCCollection(request: QueryIBCCollectionRequest): Promise; + denom(request: QueryDenomRequest): Promise; + iBCDenom(request: QueryIBCDenomRequest): Promise; + denoms(request: QueryDenomsRequest): Promise; + oNFT(request: QueryONFTRequest): Promise; + iBCDenomONFT(request: QueryIBCDenomONFTRequest): Promise; + ownerONFTs(request: QueryOwnerONFTsRequest): Promise; + ownerIBCDenomONFTs(request: QueryOwnerIBCDenomONFTsRequest): Promise; + supply(request: QuerySupplyRequest): Promise; + iBCDenomSupply(request: QueryIBCDenomSupplyRequest): Promise; + params(request?: QueryParamsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.collection = this.collection.bind(this); + this.iBCCollection = this.iBCCollection.bind(this); + this.denom = this.denom.bind(this); + this.iBCDenom = this.iBCDenom.bind(this); + this.denoms = this.denoms.bind(this); + this.oNFT = this.oNFT.bind(this); + this.iBCDenomONFT = this.iBCDenomONFT.bind(this); + this.ownerONFTs = this.ownerONFTs.bind(this); + this.ownerIBCDenomONFTs = this.ownerIBCDenomONFTs.bind(this); + this.supply = this.supply.bind(this); + this.iBCDenomSupply = this.iBCDenomSupply.bind(this); + this.params = this.params.bind(this); + } + collection(request: QueryCollectionRequest, useInterfaces: boolean = true): Promise { + const data = QueryCollectionRequest.encode(request).finish(); + const promise = this.rpc.request("OmniFlix.onft.v1beta1.Query", "Collection", data); + return promise.then(data => QueryCollectionResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + iBCCollection(request: QueryIBCCollectionRequest, useInterfaces: boolean = true): Promise { + const data = QueryIBCCollectionRequest.encode(request).finish(); + const promise = this.rpc.request("OmniFlix.onft.v1beta1.Query", "IBCCollection", data); + return promise.then(data => QueryCollectionResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + denom(request: QueryDenomRequest, useInterfaces: boolean = true): Promise { + const data = QueryDenomRequest.encode(request).finish(); + const promise = this.rpc.request("OmniFlix.onft.v1beta1.Query", "Denom", data); + return promise.then(data => QueryDenomResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + iBCDenom(request: QueryIBCDenomRequest, useInterfaces: boolean = true): Promise { + const data = QueryIBCDenomRequest.encode(request).finish(); + const promise = this.rpc.request("OmniFlix.onft.v1beta1.Query", "IBCDenom", data); + return promise.then(data => QueryDenomResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + denoms(request: QueryDenomsRequest, useInterfaces: boolean = true): Promise { + const data = QueryDenomsRequest.encode(request).finish(); + const promise = this.rpc.request("OmniFlix.onft.v1beta1.Query", "Denoms", data); + return promise.then(data => QueryDenomsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + oNFT(request: QueryONFTRequest, useInterfaces: boolean = true): Promise { + const data = QueryONFTRequest.encode(request).finish(); + const promise = this.rpc.request("OmniFlix.onft.v1beta1.Query", "ONFT", data); + return promise.then(data => QueryONFTResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + iBCDenomONFT(request: QueryIBCDenomONFTRequest, useInterfaces: boolean = true): Promise { + const data = QueryIBCDenomONFTRequest.encode(request).finish(); + const promise = this.rpc.request("OmniFlix.onft.v1beta1.Query", "IBCDenomONFT", data); + return promise.then(data => QueryONFTResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + ownerONFTs(request: QueryOwnerONFTsRequest, useInterfaces: boolean = true): Promise { + const data = QueryOwnerONFTsRequest.encode(request).finish(); + const promise = this.rpc.request("OmniFlix.onft.v1beta1.Query", "OwnerONFTs", data); + return promise.then(data => QueryOwnerONFTsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + ownerIBCDenomONFTs(request: QueryOwnerIBCDenomONFTsRequest, useInterfaces: boolean = true): Promise { + const data = QueryOwnerIBCDenomONFTsRequest.encode(request).finish(); + const promise = this.rpc.request("OmniFlix.onft.v1beta1.Query", "OwnerIBCDenomONFTs", data); + return promise.then(data => QueryOwnerONFTsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + supply(request: QuerySupplyRequest, useInterfaces: boolean = true): Promise { + const data = QuerySupplyRequest.encode(request).finish(); + const promise = this.rpc.request("OmniFlix.onft.v1beta1.Query", "Supply", data); + return promise.then(data => QuerySupplyResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + iBCDenomSupply(request: QueryIBCDenomSupplyRequest, useInterfaces: boolean = true): Promise { + const data = QueryIBCDenomSupplyRequest.encode(request).finish(); + const promise = this.rpc.request("OmniFlix.onft.v1beta1.Query", "IBCDenomSupply", data); + return promise.then(data => QuerySupplyResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + params(request: QueryParamsRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("OmniFlix.onft.v1beta1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + collection(request: QueryCollectionRequest, useInterfaces: boolean = true): Promise { + return queryService.collection(request, useInterfaces); + }, + iBCCollection(request: QueryIBCCollectionRequest, useInterfaces: boolean = true): Promise { + return queryService.iBCCollection(request, useInterfaces); + }, + denom(request: QueryDenomRequest, useInterfaces: boolean = true): Promise { + return queryService.denom(request, useInterfaces); + }, + iBCDenom(request: QueryIBCDenomRequest, useInterfaces: boolean = true): Promise { + return queryService.iBCDenom(request, useInterfaces); + }, + denoms(request: QueryDenomsRequest, useInterfaces: boolean = true): Promise { + return queryService.denoms(request, useInterfaces); + }, + oNFT(request: QueryONFTRequest, useInterfaces: boolean = true): Promise { + return queryService.oNFT(request, useInterfaces); + }, + iBCDenomONFT(request: QueryIBCDenomONFTRequest, useInterfaces: boolean = true): Promise { + return queryService.iBCDenomONFT(request, useInterfaces); + }, + ownerONFTs(request: QueryOwnerONFTsRequest, useInterfaces: boolean = true): Promise { + return queryService.ownerONFTs(request, useInterfaces); + }, + ownerIBCDenomONFTs(request: QueryOwnerIBCDenomONFTsRequest, useInterfaces: boolean = true): Promise { + return queryService.ownerIBCDenomONFTs(request, useInterfaces); + }, + supply(request: QuerySupplyRequest, useInterfaces: boolean = true): Promise { + return queryService.supply(request, useInterfaces); + }, + iBCDenomSupply(request: QueryIBCDenomSupplyRequest, useInterfaces: boolean = true): Promise { + return queryService.iBCDenomSupply(request, useInterfaces); + }, + params(request?: QueryParamsRequest, useInterfaces: boolean = true): Promise { + return queryService.params(request, useInterfaces); + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/query.ts b/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/query.ts new file mode 100644 index 000000000..2ed6a60dc --- /dev/null +++ b/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/query.ts @@ -0,0 +1,1825 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../cosmos/base/query/v1beta1/pagination"; +import { Collection, CollectionAmino, CollectionSDKType, Denom, DenomAmino, DenomSDKType, ONFT, ONFTAmino, ONFTSDKType, Owner, OwnerAmino, OwnerSDKType } from "./onft"; +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +export interface QueryCollectionRequest { + denomId: string; + pagination?: PageRequest | undefined; +} +export interface QueryCollectionRequestProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.QueryCollectionRequest"; + value: Uint8Array; +} +export interface QueryCollectionRequestAmino { + denom_id?: string; + pagination?: PageRequestAmino | undefined; +} +export interface QueryCollectionRequestAminoMsg { + type: "/OmniFlix.onft.v1beta1.QueryCollectionRequest"; + value: QueryCollectionRequestAmino; +} +export interface QueryCollectionRequestSDKType { + denom_id: string; + pagination?: PageRequestSDKType | undefined; +} +export interface QueryCollectionResponse { + collection?: Collection | undefined; + pagination?: PageResponse | undefined; +} +export interface QueryCollectionResponseProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.QueryCollectionResponse"; + value: Uint8Array; +} +export interface QueryCollectionResponseAmino { + collection?: CollectionAmino | undefined; + pagination?: PageResponseAmino | undefined; +} +export interface QueryCollectionResponseAminoMsg { + type: "/OmniFlix.onft.v1beta1.QueryCollectionResponse"; + value: QueryCollectionResponseAmino; +} +export interface QueryCollectionResponseSDKType { + collection?: CollectionSDKType | undefined; + pagination?: PageResponseSDKType | undefined; +} +export interface QueryIBCCollectionRequest { + hash: string; + pagination?: PageRequest | undefined; +} +export interface QueryIBCCollectionRequestProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.QueryIBCCollectionRequest"; + value: Uint8Array; +} +export interface QueryIBCCollectionRequestAmino { + hash?: string; + pagination?: PageRequestAmino | undefined; +} +export interface QueryIBCCollectionRequestAminoMsg { + type: "/OmniFlix.onft.v1beta1.QueryIBCCollectionRequest"; + value: QueryIBCCollectionRequestAmino; +} +export interface QueryIBCCollectionRequestSDKType { + hash: string; + pagination?: PageRequestSDKType | undefined; +} +export interface QueryDenomRequest { + denomId: string; +} +export interface QueryDenomRequestProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.QueryDenomRequest"; + value: Uint8Array; +} +export interface QueryDenomRequestAmino { + denom_id?: string; +} +export interface QueryDenomRequestAminoMsg { + type: "/OmniFlix.onft.v1beta1.QueryDenomRequest"; + value: QueryDenomRequestAmino; +} +export interface QueryDenomRequestSDKType { + denom_id: string; +} +export interface QueryDenomResponse { + denom?: Denom | undefined; +} +export interface QueryDenomResponseProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.QueryDenomResponse"; + value: Uint8Array; +} +export interface QueryDenomResponseAmino { + denom?: DenomAmino | undefined; +} +export interface QueryDenomResponseAminoMsg { + type: "/OmniFlix.onft.v1beta1.QueryDenomResponse"; + value: QueryDenomResponseAmino; +} +export interface QueryDenomResponseSDKType { + denom?: DenomSDKType | undefined; +} +export interface QueryIBCDenomRequest { + hash: string; +} +export interface QueryIBCDenomRequestProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.QueryIBCDenomRequest"; + value: Uint8Array; +} +export interface QueryIBCDenomRequestAmino { + hash?: string; +} +export interface QueryIBCDenomRequestAminoMsg { + type: "/OmniFlix.onft.v1beta1.QueryIBCDenomRequest"; + value: QueryIBCDenomRequestAmino; +} +export interface QueryIBCDenomRequestSDKType { + hash: string; +} +export interface QueryDenomsRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest | undefined; + owner: string; +} +export interface QueryDenomsRequestProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.QueryDenomsRequest"; + value: Uint8Array; +} +export interface QueryDenomsRequestAmino { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino | undefined; + owner?: string; +} +export interface QueryDenomsRequestAminoMsg { + type: "/OmniFlix.onft.v1beta1.QueryDenomsRequest"; + value: QueryDenomsRequestAmino; +} +export interface QueryDenomsRequestSDKType { + pagination?: PageRequestSDKType | undefined; + owner: string; +} +export interface QueryDenomsResponse { + denoms: Denom[]; + pagination?: PageResponse | undefined; +} +export interface QueryDenomsResponseProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.QueryDenomsResponse"; + value: Uint8Array; +} +export interface QueryDenomsResponseAmino { + denoms?: DenomAmino[]; + pagination?: PageResponseAmino | undefined; +} +export interface QueryDenomsResponseAminoMsg { + type: "/OmniFlix.onft.v1beta1.QueryDenomsResponse"; + value: QueryDenomsResponseAmino; +} +export interface QueryDenomsResponseSDKType { + denoms: DenomSDKType[]; + pagination?: PageResponseSDKType | undefined; +} +export interface QueryONFTRequest { + denomId: string; + id: string; +} +export interface QueryONFTRequestProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.QueryONFTRequest"; + value: Uint8Array; +} +export interface QueryONFTRequestAmino { + denom_id?: string; + id?: string; +} +export interface QueryONFTRequestAminoMsg { + type: "/OmniFlix.onft.v1beta1.QueryONFTRequest"; + value: QueryONFTRequestAmino; +} +export interface QueryONFTRequestSDKType { + denom_id: string; + id: string; +} +export interface QueryONFTResponse { + onft?: ONFT | undefined; +} +export interface QueryONFTResponseProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.QueryONFTResponse"; + value: Uint8Array; +} +export interface QueryONFTResponseAmino { + onft?: ONFTAmino | undefined; +} +export interface QueryONFTResponseAminoMsg { + type: "/OmniFlix.onft.v1beta1.QueryONFTResponse"; + value: QueryONFTResponseAmino; +} +export interface QueryONFTResponseSDKType { + onft?: ONFTSDKType | undefined; +} +export interface QueryIBCDenomONFTRequest { + hash: string; + id: string; +} +export interface QueryIBCDenomONFTRequestProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.QueryIBCDenomONFTRequest"; + value: Uint8Array; +} +export interface QueryIBCDenomONFTRequestAmino { + hash?: string; + id?: string; +} +export interface QueryIBCDenomONFTRequestAminoMsg { + type: "/OmniFlix.onft.v1beta1.QueryIBCDenomONFTRequest"; + value: QueryIBCDenomONFTRequestAmino; +} +export interface QueryIBCDenomONFTRequestSDKType { + hash: string; + id: string; +} +export interface QueryOwnerONFTsRequest { + denomId: string; + owner: string; + pagination?: PageRequest | undefined; +} +export interface QueryOwnerONFTsRequestProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.QueryOwnerONFTsRequest"; + value: Uint8Array; +} +export interface QueryOwnerONFTsRequestAmino { + denom_id?: string; + owner?: string; + pagination?: PageRequestAmino | undefined; +} +export interface QueryOwnerONFTsRequestAminoMsg { + type: "/OmniFlix.onft.v1beta1.QueryOwnerONFTsRequest"; + value: QueryOwnerONFTsRequestAmino; +} +export interface QueryOwnerONFTsRequestSDKType { + denom_id: string; + owner: string; + pagination?: PageRequestSDKType | undefined; +} +export interface QueryOwnerONFTsResponse { + owner?: Owner | undefined; + pagination?: PageResponse | undefined; +} +export interface QueryOwnerONFTsResponseProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.QueryOwnerONFTsResponse"; + value: Uint8Array; +} +export interface QueryOwnerONFTsResponseAmino { + owner?: OwnerAmino | undefined; + pagination?: PageResponseAmino | undefined; +} +export interface QueryOwnerONFTsResponseAminoMsg { + type: "/OmniFlix.onft.v1beta1.QueryOwnerONFTsResponse"; + value: QueryOwnerONFTsResponseAmino; +} +export interface QueryOwnerONFTsResponseSDKType { + owner?: OwnerSDKType | undefined; + pagination?: PageResponseSDKType | undefined; +} +export interface QueryOwnerIBCDenomONFTsRequest { + hash: string; + owner: string; + pagination?: PageRequest | undefined; +} +export interface QueryOwnerIBCDenomONFTsRequestProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.QueryOwnerIBCDenomONFTsRequest"; + value: Uint8Array; +} +export interface QueryOwnerIBCDenomONFTsRequestAmino { + hash?: string; + owner?: string; + pagination?: PageRequestAmino | undefined; +} +export interface QueryOwnerIBCDenomONFTsRequestAminoMsg { + type: "/OmniFlix.onft.v1beta1.QueryOwnerIBCDenomONFTsRequest"; + value: QueryOwnerIBCDenomONFTsRequestAmino; +} +export interface QueryOwnerIBCDenomONFTsRequestSDKType { + hash: string; + owner: string; + pagination?: PageRequestSDKType | undefined; +} +export interface QuerySupplyRequest { + denomId: string; + owner: string; +} +export interface QuerySupplyRequestProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.QuerySupplyRequest"; + value: Uint8Array; +} +export interface QuerySupplyRequestAmino { + denom_id?: string; + owner?: string; +} +export interface QuerySupplyRequestAminoMsg { + type: "/OmniFlix.onft.v1beta1.QuerySupplyRequest"; + value: QuerySupplyRequestAmino; +} +export interface QuerySupplyRequestSDKType { + denom_id: string; + owner: string; +} +export interface QuerySupplyResponse { + amount: bigint; +} +export interface QuerySupplyResponseProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.QuerySupplyResponse"; + value: Uint8Array; +} +export interface QuerySupplyResponseAmino { + amount?: string; +} +export interface QuerySupplyResponseAminoMsg { + type: "/OmniFlix.onft.v1beta1.QuerySupplyResponse"; + value: QuerySupplyResponseAmino; +} +export interface QuerySupplyResponseSDKType { + amount: bigint; +} +export interface QueryIBCDenomSupplyRequest { + hash: string; + owner: string; +} +export interface QueryIBCDenomSupplyRequestProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.QueryIBCDenomSupplyRequest"; + value: Uint8Array; +} +export interface QueryIBCDenomSupplyRequestAmino { + hash?: string; + owner?: string; +} +export interface QueryIBCDenomSupplyRequestAminoMsg { + type: "/OmniFlix.onft.v1beta1.QueryIBCDenomSupplyRequest"; + value: QueryIBCDenomSupplyRequestAmino; +} +export interface QueryIBCDenomSupplyRequestSDKType { + hash: string; + owner: string; +} +export interface OwnerONFTCollection { + denom: Denom | undefined; + onfts: ONFT[]; +} +export interface OwnerONFTCollectionProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.OwnerONFTCollection"; + value: Uint8Array; +} +export interface OwnerONFTCollectionAmino { + denom?: DenomAmino | undefined; + onfts?: ONFTAmino[]; +} +export interface OwnerONFTCollectionAminoMsg { + type: "/OmniFlix.onft.v1beta1.OwnerONFTCollection"; + value: OwnerONFTCollectionAmino; +} +export interface OwnerONFTCollectionSDKType { + denom: DenomSDKType | undefined; + onfts: ONFTSDKType[]; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/OmniFlix.onft.v1beta1.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params defines the parameters of the module. */ + params: Params | undefined; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** params defines the parameters of the module. */ + params?: ParamsAmino | undefined; +} +export interface QueryParamsResponseAminoMsg { + type: "/OmniFlix.onft.v1beta1.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType | undefined; +} +function createBaseQueryCollectionRequest(): QueryCollectionRequest { + return { + denomId: "", + pagination: undefined + }; +} +export const QueryCollectionRequest = { + typeUrl: "/OmniFlix.onft.v1beta1.QueryCollectionRequest", + encode(message: QueryCollectionRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denomId !== "") { + writer.uint32(10).string(message.denomId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryCollectionRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCollectionRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomId = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCollectionRequest { + const message = createBaseQueryCollectionRequest(); + message.denomId = object.denomId ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryCollectionRequestAmino): QueryCollectionRequest { + const message = createBaseQueryCollectionRequest(); + if (object.denom_id !== undefined && object.denom_id !== null) { + message.denomId = object.denom_id; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryCollectionRequest, useInterfaces: boolean = false): QueryCollectionRequestAmino { + const obj: any = {}; + obj.denom_id = message.denomId; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryCollectionRequestAminoMsg): QueryCollectionRequest { + return QueryCollectionRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCollectionRequestProtoMsg, useInterfaces: boolean = false): QueryCollectionRequest { + return QueryCollectionRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryCollectionRequest): Uint8Array { + return QueryCollectionRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCollectionRequest): QueryCollectionRequestProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.QueryCollectionRequest", + value: QueryCollectionRequest.encode(message).finish() + }; + } +}; +function createBaseQueryCollectionResponse(): QueryCollectionResponse { + return { + collection: undefined, + pagination: undefined + }; +} +export const QueryCollectionResponse = { + typeUrl: "/OmniFlix.onft.v1beta1.QueryCollectionResponse", + encode(message: QueryCollectionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.collection !== undefined) { + Collection.encode(message.collection, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryCollectionResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCollectionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.collection = Collection.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCollectionResponse { + const message = createBaseQueryCollectionResponse(); + message.collection = object.collection !== undefined && object.collection !== null ? Collection.fromPartial(object.collection) : undefined; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryCollectionResponseAmino): QueryCollectionResponse { + const message = createBaseQueryCollectionResponse(); + if (object.collection !== undefined && object.collection !== null) { + message.collection = Collection.fromAmino(object.collection); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryCollectionResponse, useInterfaces: boolean = false): QueryCollectionResponseAmino { + const obj: any = {}; + obj.collection = message.collection ? Collection.toAmino(message.collection, useInterfaces) : undefined; + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryCollectionResponseAminoMsg): QueryCollectionResponse { + return QueryCollectionResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCollectionResponseProtoMsg, useInterfaces: boolean = false): QueryCollectionResponse { + return QueryCollectionResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryCollectionResponse): Uint8Array { + return QueryCollectionResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCollectionResponse): QueryCollectionResponseProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.QueryCollectionResponse", + value: QueryCollectionResponse.encode(message).finish() + }; + } +}; +function createBaseQueryIBCCollectionRequest(): QueryIBCCollectionRequest { + return { + hash: "", + pagination: undefined + }; +} +export const QueryIBCCollectionRequest = { + typeUrl: "/OmniFlix.onft.v1beta1.QueryIBCCollectionRequest", + encode(message: QueryIBCCollectionRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash !== "") { + writer.uint32(10).string(message.hash); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryIBCCollectionRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryIBCCollectionRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryIBCCollectionRequest { + const message = createBaseQueryIBCCollectionRequest(); + message.hash = object.hash ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryIBCCollectionRequestAmino): QueryIBCCollectionRequest { + const message = createBaseQueryIBCCollectionRequest(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryIBCCollectionRequest, useInterfaces: boolean = false): QueryIBCCollectionRequestAmino { + const obj: any = {}; + obj.hash = message.hash; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryIBCCollectionRequestAminoMsg): QueryIBCCollectionRequest { + return QueryIBCCollectionRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryIBCCollectionRequestProtoMsg, useInterfaces: boolean = false): QueryIBCCollectionRequest { + return QueryIBCCollectionRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryIBCCollectionRequest): Uint8Array { + return QueryIBCCollectionRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryIBCCollectionRequest): QueryIBCCollectionRequestProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.QueryIBCCollectionRequest", + value: QueryIBCCollectionRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDenomRequest(): QueryDenomRequest { + return { + denomId: "" + }; +} +export const QueryDenomRequest = { + typeUrl: "/OmniFlix.onft.v1beta1.QueryDenomRequest", + encode(message: QueryDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denomId !== "") { + writer.uint32(10).string(message.denomId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryDenomRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomRequest { + const message = createBaseQueryDenomRequest(); + message.denomId = object.denomId ?? ""; + return message; + }, + fromAmino(object: QueryDenomRequestAmino): QueryDenomRequest { + const message = createBaseQueryDenomRequest(); + if (object.denom_id !== undefined && object.denom_id !== null) { + message.denomId = object.denom_id; + } + return message; + }, + toAmino(message: QueryDenomRequest, useInterfaces: boolean = false): QueryDenomRequestAmino { + const obj: any = {}; + obj.denom_id = message.denomId; + return obj; + }, + fromAminoMsg(object: QueryDenomRequestAminoMsg): QueryDenomRequest { + return QueryDenomRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDenomRequestProtoMsg, useInterfaces: boolean = false): QueryDenomRequest { + return QueryDenomRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryDenomRequest): Uint8Array { + return QueryDenomRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomRequest): QueryDenomRequestProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.QueryDenomRequest", + value: QueryDenomRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDenomResponse(): QueryDenomResponse { + return { + denom: undefined + }; +} +export const QueryDenomResponse = { + typeUrl: "/OmniFlix.onft.v1beta1.QueryDenomResponse", + encode(message: QueryDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== undefined) { + Denom.encode(message.denom, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = Denom.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomResponse { + const message = createBaseQueryDenomResponse(); + message.denom = object.denom !== undefined && object.denom !== null ? Denom.fromPartial(object.denom) : undefined; + return message; + }, + fromAmino(object: QueryDenomResponseAmino): QueryDenomResponse { + const message = createBaseQueryDenomResponse(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = Denom.fromAmino(object.denom); + } + return message; + }, + toAmino(message: QueryDenomResponse, useInterfaces: boolean = false): QueryDenomResponseAmino { + const obj: any = {}; + obj.denom = message.denom ? Denom.toAmino(message.denom, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomResponseAminoMsg): QueryDenomResponse { + return QueryDenomResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDenomResponseProtoMsg, useInterfaces: boolean = false): QueryDenomResponse { + return QueryDenomResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryDenomResponse): Uint8Array { + return QueryDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomResponse): QueryDenomResponseProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.QueryDenomResponse", + value: QueryDenomResponse.encode(message).finish() + }; + } +}; +function createBaseQueryIBCDenomRequest(): QueryIBCDenomRequest { + return { + hash: "" + }; +} +export const QueryIBCDenomRequest = { + typeUrl: "/OmniFlix.onft.v1beta1.QueryIBCDenomRequest", + encode(message: QueryIBCDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash !== "") { + writer.uint32(10).string(message.hash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryIBCDenomRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryIBCDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryIBCDenomRequest { + const message = createBaseQueryIBCDenomRequest(); + message.hash = object.hash ?? ""; + return message; + }, + fromAmino(object: QueryIBCDenomRequestAmino): QueryIBCDenomRequest { + const message = createBaseQueryIBCDenomRequest(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + return message; + }, + toAmino(message: QueryIBCDenomRequest, useInterfaces: boolean = false): QueryIBCDenomRequestAmino { + const obj: any = {}; + obj.hash = message.hash; + return obj; + }, + fromAminoMsg(object: QueryIBCDenomRequestAminoMsg): QueryIBCDenomRequest { + return QueryIBCDenomRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryIBCDenomRequestProtoMsg, useInterfaces: boolean = false): QueryIBCDenomRequest { + return QueryIBCDenomRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryIBCDenomRequest): Uint8Array { + return QueryIBCDenomRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryIBCDenomRequest): QueryIBCDenomRequestProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.QueryIBCDenomRequest", + value: QueryIBCDenomRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDenomsRequest(): QueryDenomsRequest { + return { + pagination: undefined, + owner: "" + }; +} +export const QueryDenomsRequest = { + typeUrl: "/OmniFlix.onft.v1beta1.QueryDenomsRequest", + encode(message: QueryDenomsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + if (message.owner !== "") { + writer.uint32(18).string(message.owner); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryDenomsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.owner = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomsRequest { + const message = createBaseQueryDenomsRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + message.owner = object.owner ?? ""; + return message; + }, + fromAmino(object: QueryDenomsRequestAmino): QueryDenomsRequest { + const message = createBaseQueryDenomsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; + }, + toAmino(message: QueryDenomsRequest, useInterfaces: boolean = false): QueryDenomsRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + obj.owner = message.owner; + return obj; + }, + fromAminoMsg(object: QueryDenomsRequestAminoMsg): QueryDenomsRequest { + return QueryDenomsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDenomsRequestProtoMsg, useInterfaces: boolean = false): QueryDenomsRequest { + return QueryDenomsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryDenomsRequest): Uint8Array { + return QueryDenomsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomsRequest): QueryDenomsRequestProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.QueryDenomsRequest", + value: QueryDenomsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDenomsResponse(): QueryDenomsResponse { + return { + denoms: [], + pagination: undefined + }; +} +export const QueryDenomsResponse = { + typeUrl: "/OmniFlix.onft.v1beta1.QueryDenomsResponse", + encode(message: QueryDenomsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.denoms) { + Denom.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryDenomsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denoms.push(Denom.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomsResponse { + const message = createBaseQueryDenomsResponse(); + message.denoms = object.denoms?.map(e => Denom.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDenomsResponseAmino): QueryDenomsResponse { + const message = createBaseQueryDenomsResponse(); + message.denoms = object.denoms?.map(e => Denom.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDenomsResponse, useInterfaces: boolean = false): QueryDenomsResponseAmino { + const obj: any = {}; + if (message.denoms) { + obj.denoms = message.denoms.map(e => e ? Denom.toAmino(e, useInterfaces) : undefined); + } else { + obj.denoms = []; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomsResponseAminoMsg): QueryDenomsResponse { + return QueryDenomsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryDenomsResponseProtoMsg, useInterfaces: boolean = false): QueryDenomsResponse { + return QueryDenomsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryDenomsResponse): Uint8Array { + return QueryDenomsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomsResponse): QueryDenomsResponseProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.QueryDenomsResponse", + value: QueryDenomsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryONFTRequest(): QueryONFTRequest { + return { + denomId: "", + id: "" + }; +} +export const QueryONFTRequest = { + typeUrl: "/OmniFlix.onft.v1beta1.QueryONFTRequest", + encode(message: QueryONFTRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denomId !== "") { + writer.uint32(10).string(message.denomId); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryONFTRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryONFTRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomId = reader.string(); + break; + case 2: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryONFTRequest { + const message = createBaseQueryONFTRequest(); + message.denomId = object.denomId ?? ""; + message.id = object.id ?? ""; + return message; + }, + fromAmino(object: QueryONFTRequestAmino): QueryONFTRequest { + const message = createBaseQueryONFTRequest(); + if (object.denom_id !== undefined && object.denom_id !== null) { + message.denomId = object.denom_id; + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; + }, + toAmino(message: QueryONFTRequest, useInterfaces: boolean = false): QueryONFTRequestAmino { + const obj: any = {}; + obj.denom_id = message.denomId; + obj.id = message.id; + return obj; + }, + fromAminoMsg(object: QueryONFTRequestAminoMsg): QueryONFTRequest { + return QueryONFTRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryONFTRequestProtoMsg, useInterfaces: boolean = false): QueryONFTRequest { + return QueryONFTRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryONFTRequest): Uint8Array { + return QueryONFTRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryONFTRequest): QueryONFTRequestProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.QueryONFTRequest", + value: QueryONFTRequest.encode(message).finish() + }; + } +}; +function createBaseQueryONFTResponse(): QueryONFTResponse { + return { + onft: undefined + }; +} +export const QueryONFTResponse = { + typeUrl: "/OmniFlix.onft.v1beta1.QueryONFTResponse", + encode(message: QueryONFTResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.onft !== undefined) { + ONFT.encode(message.onft, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryONFTResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryONFTResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.onft = ONFT.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryONFTResponse { + const message = createBaseQueryONFTResponse(); + message.onft = object.onft !== undefined && object.onft !== null ? ONFT.fromPartial(object.onft) : undefined; + return message; + }, + fromAmino(object: QueryONFTResponseAmino): QueryONFTResponse { + const message = createBaseQueryONFTResponse(); + if (object.onft !== undefined && object.onft !== null) { + message.onft = ONFT.fromAmino(object.onft); + } + return message; + }, + toAmino(message: QueryONFTResponse, useInterfaces: boolean = false): QueryONFTResponseAmino { + const obj: any = {}; + obj.onft = message.onft ? ONFT.toAmino(message.onft, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryONFTResponseAminoMsg): QueryONFTResponse { + return QueryONFTResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryONFTResponseProtoMsg, useInterfaces: boolean = false): QueryONFTResponse { + return QueryONFTResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryONFTResponse): Uint8Array { + return QueryONFTResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryONFTResponse): QueryONFTResponseProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.QueryONFTResponse", + value: QueryONFTResponse.encode(message).finish() + }; + } +}; +function createBaseQueryIBCDenomONFTRequest(): QueryIBCDenomONFTRequest { + return { + hash: "", + id: "" + }; +} +export const QueryIBCDenomONFTRequest = { + typeUrl: "/OmniFlix.onft.v1beta1.QueryIBCDenomONFTRequest", + encode(message: QueryIBCDenomONFTRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash !== "") { + writer.uint32(10).string(message.hash); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryIBCDenomONFTRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryIBCDenomONFTRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.string(); + break; + case 2: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryIBCDenomONFTRequest { + const message = createBaseQueryIBCDenomONFTRequest(); + message.hash = object.hash ?? ""; + message.id = object.id ?? ""; + return message; + }, + fromAmino(object: QueryIBCDenomONFTRequestAmino): QueryIBCDenomONFTRequest { + const message = createBaseQueryIBCDenomONFTRequest(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; + }, + toAmino(message: QueryIBCDenomONFTRequest, useInterfaces: boolean = false): QueryIBCDenomONFTRequestAmino { + const obj: any = {}; + obj.hash = message.hash; + obj.id = message.id; + return obj; + }, + fromAminoMsg(object: QueryIBCDenomONFTRequestAminoMsg): QueryIBCDenomONFTRequest { + return QueryIBCDenomONFTRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryIBCDenomONFTRequestProtoMsg, useInterfaces: boolean = false): QueryIBCDenomONFTRequest { + return QueryIBCDenomONFTRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryIBCDenomONFTRequest): Uint8Array { + return QueryIBCDenomONFTRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryIBCDenomONFTRequest): QueryIBCDenomONFTRequestProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.QueryIBCDenomONFTRequest", + value: QueryIBCDenomONFTRequest.encode(message).finish() + }; + } +}; +function createBaseQueryOwnerONFTsRequest(): QueryOwnerONFTsRequest { + return { + denomId: "", + owner: "", + pagination: undefined + }; +} +export const QueryOwnerONFTsRequest = { + typeUrl: "/OmniFlix.onft.v1beta1.QueryOwnerONFTsRequest", + encode(message: QueryOwnerONFTsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denomId !== "") { + writer.uint32(10).string(message.denomId); + } + if (message.owner !== "") { + writer.uint32(18).string(message.owner); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryOwnerONFTsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOwnerONFTsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomId = reader.string(); + break; + case 2: + message.owner = reader.string(); + break; + case 3: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryOwnerONFTsRequest { + const message = createBaseQueryOwnerONFTsRequest(); + message.denomId = object.denomId ?? ""; + message.owner = object.owner ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryOwnerONFTsRequestAmino): QueryOwnerONFTsRequest { + const message = createBaseQueryOwnerONFTsRequest(); + if (object.denom_id !== undefined && object.denom_id !== null) { + message.denomId = object.denom_id; + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryOwnerONFTsRequest, useInterfaces: boolean = false): QueryOwnerONFTsRequestAmino { + const obj: any = {}; + obj.denom_id = message.denomId; + obj.owner = message.owner; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryOwnerONFTsRequestAminoMsg): QueryOwnerONFTsRequest { + return QueryOwnerONFTsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOwnerONFTsRequestProtoMsg, useInterfaces: boolean = false): QueryOwnerONFTsRequest { + return QueryOwnerONFTsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryOwnerONFTsRequest): Uint8Array { + return QueryOwnerONFTsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryOwnerONFTsRequest): QueryOwnerONFTsRequestProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.QueryOwnerONFTsRequest", + value: QueryOwnerONFTsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryOwnerONFTsResponse(): QueryOwnerONFTsResponse { + return { + owner: undefined, + pagination: undefined + }; +} +export const QueryOwnerONFTsResponse = { + typeUrl: "/OmniFlix.onft.v1beta1.QueryOwnerONFTsResponse", + encode(message: QueryOwnerONFTsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.owner !== undefined) { + Owner.encode(message.owner, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryOwnerONFTsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOwnerONFTsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = Owner.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryOwnerONFTsResponse { + const message = createBaseQueryOwnerONFTsResponse(); + message.owner = object.owner !== undefined && object.owner !== null ? Owner.fromPartial(object.owner) : undefined; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryOwnerONFTsResponseAmino): QueryOwnerONFTsResponse { + const message = createBaseQueryOwnerONFTsResponse(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = Owner.fromAmino(object.owner); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryOwnerONFTsResponse, useInterfaces: boolean = false): QueryOwnerONFTsResponseAmino { + const obj: any = {}; + obj.owner = message.owner ? Owner.toAmino(message.owner, useInterfaces) : undefined; + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryOwnerONFTsResponseAminoMsg): QueryOwnerONFTsResponse { + return QueryOwnerONFTsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOwnerONFTsResponseProtoMsg, useInterfaces: boolean = false): QueryOwnerONFTsResponse { + return QueryOwnerONFTsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryOwnerONFTsResponse): Uint8Array { + return QueryOwnerONFTsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryOwnerONFTsResponse): QueryOwnerONFTsResponseProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.QueryOwnerONFTsResponse", + value: QueryOwnerONFTsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryOwnerIBCDenomONFTsRequest(): QueryOwnerIBCDenomONFTsRequest { + return { + hash: "", + owner: "", + pagination: undefined + }; +} +export const QueryOwnerIBCDenomONFTsRequest = { + typeUrl: "/OmniFlix.onft.v1beta1.QueryOwnerIBCDenomONFTsRequest", + encode(message: QueryOwnerIBCDenomONFTsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash !== "") { + writer.uint32(10).string(message.hash); + } + if (message.owner !== "") { + writer.uint32(18).string(message.owner); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryOwnerIBCDenomONFTsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOwnerIBCDenomONFTsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.string(); + break; + case 2: + message.owner = reader.string(); + break; + case 3: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryOwnerIBCDenomONFTsRequest { + const message = createBaseQueryOwnerIBCDenomONFTsRequest(); + message.hash = object.hash ?? ""; + message.owner = object.owner ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryOwnerIBCDenomONFTsRequestAmino): QueryOwnerIBCDenomONFTsRequest { + const message = createBaseQueryOwnerIBCDenomONFTsRequest(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryOwnerIBCDenomONFTsRequest, useInterfaces: boolean = false): QueryOwnerIBCDenomONFTsRequestAmino { + const obj: any = {}; + obj.hash = message.hash; + obj.owner = message.owner; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryOwnerIBCDenomONFTsRequestAminoMsg): QueryOwnerIBCDenomONFTsRequest { + return QueryOwnerIBCDenomONFTsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryOwnerIBCDenomONFTsRequestProtoMsg, useInterfaces: boolean = false): QueryOwnerIBCDenomONFTsRequest { + return QueryOwnerIBCDenomONFTsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryOwnerIBCDenomONFTsRequest): Uint8Array { + return QueryOwnerIBCDenomONFTsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryOwnerIBCDenomONFTsRequest): QueryOwnerIBCDenomONFTsRequestProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.QueryOwnerIBCDenomONFTsRequest", + value: QueryOwnerIBCDenomONFTsRequest.encode(message).finish() + }; + } +}; +function createBaseQuerySupplyRequest(): QuerySupplyRequest { + return { + denomId: "", + owner: "" + }; +} +export const QuerySupplyRequest = { + typeUrl: "/OmniFlix.onft.v1beta1.QuerySupplyRequest", + encode(message: QuerySupplyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denomId !== "") { + writer.uint32(10).string(message.denomId); + } + if (message.owner !== "") { + writer.uint32(18).string(message.owner); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QuerySupplyRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySupplyRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomId = reader.string(); + break; + case 2: + message.owner = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySupplyRequest { + const message = createBaseQuerySupplyRequest(); + message.denomId = object.denomId ?? ""; + message.owner = object.owner ?? ""; + return message; + }, + fromAmino(object: QuerySupplyRequestAmino): QuerySupplyRequest { + const message = createBaseQuerySupplyRequest(); + if (object.denom_id !== undefined && object.denom_id !== null) { + message.denomId = object.denom_id; + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; + }, + toAmino(message: QuerySupplyRequest, useInterfaces: boolean = false): QuerySupplyRequestAmino { + const obj: any = {}; + obj.denom_id = message.denomId; + obj.owner = message.owner; + return obj; + }, + fromAminoMsg(object: QuerySupplyRequestAminoMsg): QuerySupplyRequest { + return QuerySupplyRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySupplyRequestProtoMsg, useInterfaces: boolean = false): QuerySupplyRequest { + return QuerySupplyRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QuerySupplyRequest): Uint8Array { + return QuerySupplyRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySupplyRequest): QuerySupplyRequestProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.QuerySupplyRequest", + value: QuerySupplyRequest.encode(message).finish() + }; + } +}; +function createBaseQuerySupplyResponse(): QuerySupplyResponse { + return { + amount: BigInt(0) + }; +} +export const QuerySupplyResponse = { + typeUrl: "/OmniFlix.onft.v1beta1.QuerySupplyResponse", + encode(message: QuerySupplyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.amount !== BigInt(0)) { + writer.uint32(8).uint64(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QuerySupplyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySupplyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySupplyResponse { + const message = createBaseQuerySupplyResponse(); + message.amount = object.amount !== undefined && object.amount !== null ? BigInt(object.amount.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QuerySupplyResponseAmino): QuerySupplyResponse { + const message = createBaseQuerySupplyResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = BigInt(object.amount); + } + return message; + }, + toAmino(message: QuerySupplyResponse, useInterfaces: boolean = false): QuerySupplyResponseAmino { + const obj: any = {}; + obj.amount = message.amount ? message.amount.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QuerySupplyResponseAminoMsg): QuerySupplyResponse { + return QuerySupplyResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QuerySupplyResponseProtoMsg, useInterfaces: boolean = false): QuerySupplyResponse { + return QuerySupplyResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QuerySupplyResponse): Uint8Array { + return QuerySupplyResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySupplyResponse): QuerySupplyResponseProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.QuerySupplyResponse", + value: QuerySupplyResponse.encode(message).finish() + }; + } +}; +function createBaseQueryIBCDenomSupplyRequest(): QueryIBCDenomSupplyRequest { + return { + hash: "", + owner: "" + }; +} +export const QueryIBCDenomSupplyRequest = { + typeUrl: "/OmniFlix.onft.v1beta1.QueryIBCDenomSupplyRequest", + encode(message: QueryIBCDenomSupplyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash !== "") { + writer.uint32(10).string(message.hash); + } + if (message.owner !== "") { + writer.uint32(18).string(message.owner); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryIBCDenomSupplyRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryIBCDenomSupplyRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.string(); + break; + case 2: + message.owner = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryIBCDenomSupplyRequest { + const message = createBaseQueryIBCDenomSupplyRequest(); + message.hash = object.hash ?? ""; + message.owner = object.owner ?? ""; + return message; + }, + fromAmino(object: QueryIBCDenomSupplyRequestAmino): QueryIBCDenomSupplyRequest { + const message = createBaseQueryIBCDenomSupplyRequest(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; + }, + toAmino(message: QueryIBCDenomSupplyRequest, useInterfaces: boolean = false): QueryIBCDenomSupplyRequestAmino { + const obj: any = {}; + obj.hash = message.hash; + obj.owner = message.owner; + return obj; + }, + fromAminoMsg(object: QueryIBCDenomSupplyRequestAminoMsg): QueryIBCDenomSupplyRequest { + return QueryIBCDenomSupplyRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryIBCDenomSupplyRequestProtoMsg, useInterfaces: boolean = false): QueryIBCDenomSupplyRequest { + return QueryIBCDenomSupplyRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryIBCDenomSupplyRequest): Uint8Array { + return QueryIBCDenomSupplyRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryIBCDenomSupplyRequest): QueryIBCDenomSupplyRequestProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.QueryIBCDenomSupplyRequest", + value: QueryIBCDenomSupplyRequest.encode(message).finish() + }; + } +}; +function createBaseOwnerONFTCollection(): OwnerONFTCollection { + return { + denom: Denom.fromPartial({}), + onfts: [] + }; +} +export const OwnerONFTCollection = { + typeUrl: "/OmniFlix.onft.v1beta1.OwnerONFTCollection", + encode(message: OwnerONFTCollection, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== undefined) { + Denom.encode(message.denom, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.onfts) { + ONFT.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): OwnerONFTCollection { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOwnerONFTCollection(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = Denom.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.onfts.push(ONFT.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OwnerONFTCollection { + const message = createBaseOwnerONFTCollection(); + message.denom = object.denom !== undefined && object.denom !== null ? Denom.fromPartial(object.denom) : undefined; + message.onfts = object.onfts?.map(e => ONFT.fromPartial(e)) || []; + return message; + }, + fromAmino(object: OwnerONFTCollectionAmino): OwnerONFTCollection { + const message = createBaseOwnerONFTCollection(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = Denom.fromAmino(object.denom); + } + message.onfts = object.onfts?.map(e => ONFT.fromAmino(e)) || []; + return message; + }, + toAmino(message: OwnerONFTCollection, useInterfaces: boolean = false): OwnerONFTCollectionAmino { + const obj: any = {}; + obj.denom = message.denom ? Denom.toAmino(message.denom, useInterfaces) : undefined; + if (message.onfts) { + obj.onfts = message.onfts.map(e => e ? ONFT.toAmino(e, useInterfaces) : undefined); + } else { + obj.onfts = []; + } + return obj; + }, + fromAminoMsg(object: OwnerONFTCollectionAminoMsg): OwnerONFTCollection { + return OwnerONFTCollection.fromAmino(object.value); + }, + fromProtoMsg(message: OwnerONFTCollectionProtoMsg, useInterfaces: boolean = false): OwnerONFTCollection { + return OwnerONFTCollection.decode(message.value, undefined, useInterfaces); + }, + toProto(message: OwnerONFTCollection): Uint8Array { + return OwnerONFTCollection.encode(message).finish(); + }, + toProtoMsg(message: OwnerONFTCollection): OwnerONFTCollectionProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.OwnerONFTCollection", + value: OwnerONFTCollection.encode(message).finish() + }; + } +}; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/OmniFlix.onft.v1beta1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest, useInterfaces: boolean = false): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg, useInterfaces: boolean = false): QueryParamsRequest { + return QueryParamsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/OmniFlix.onft.v1beta1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse, useInterfaces: boolean = false): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg, useInterfaces: boolean = false): QueryParamsResponse { + return QueryParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/tx.amino.ts b/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/tx.amino.ts new file mode 100644 index 000000000..1c28290b0 --- /dev/null +++ b/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/tx.amino.ts @@ -0,0 +1,43 @@ +import { MsgCreateDenom, MsgUpdateDenom, MsgTransferDenom, MsgPurgeDenom, MsgMintONFT, MsgTransferONFT, MsgBurnONFT, MsgUpdateParams } from "./tx"; +export const AminoConverter = { + "/OmniFlix.onft.v1beta1.MsgCreateDenom": { + aminoType: "OmniFlix/onft/MsgCreateDenom", + toAmino: MsgCreateDenom.toAmino, + fromAmino: MsgCreateDenom.fromAmino + }, + "/OmniFlix.onft.v1beta1.MsgUpdateDenom": { + aminoType: "OmniFlix/onft/MsgUpdateDenom", + toAmino: MsgUpdateDenom.toAmino, + fromAmino: MsgUpdateDenom.fromAmino + }, + "/OmniFlix.onft.v1beta1.MsgTransferDenom": { + aminoType: "OmniFlix/onft/MsgTransferDenom", + toAmino: MsgTransferDenom.toAmino, + fromAmino: MsgTransferDenom.fromAmino + }, + "/OmniFlix.onft.v1beta1.MsgPurgeDenom": { + aminoType: "OmniFlix/onft/MsgPurgeDenom", + toAmino: MsgPurgeDenom.toAmino, + fromAmino: MsgPurgeDenom.fromAmino + }, + "/OmniFlix.onft.v1beta1.MsgMintONFT": { + aminoType: "OmniFlix/onft/MsgMintONFT", + toAmino: MsgMintONFT.toAmino, + fromAmino: MsgMintONFT.fromAmino + }, + "/OmniFlix.onft.v1beta1.MsgTransferONFT": { + aminoType: "OmniFlix/onft/MsgTransferONFT", + toAmino: MsgTransferONFT.toAmino, + fromAmino: MsgTransferONFT.fromAmino + }, + "/OmniFlix.onft.v1beta1.MsgBurnONFT": { + aminoType: "OmniFlix/onft/MsgBurnONFT", + toAmino: MsgBurnONFT.toAmino, + fromAmino: MsgBurnONFT.fromAmino + }, + "/OmniFlix.onft.v1beta1.MsgUpdateParams": { + aminoType: "/OmniFlix.onft.v1beta1.MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/tx.registry.ts b/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/tx.registry.ts new file mode 100644 index 000000000..cf81fce03 --- /dev/null +++ b/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/tx.registry.ts @@ -0,0 +1,161 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgCreateDenom, MsgUpdateDenom, MsgTransferDenom, MsgPurgeDenom, MsgMintONFT, MsgTransferONFT, MsgBurnONFT, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/OmniFlix.onft.v1beta1.MsgCreateDenom", MsgCreateDenom], ["/OmniFlix.onft.v1beta1.MsgUpdateDenom", MsgUpdateDenom], ["/OmniFlix.onft.v1beta1.MsgTransferDenom", MsgTransferDenom], ["/OmniFlix.onft.v1beta1.MsgPurgeDenom", MsgPurgeDenom], ["/OmniFlix.onft.v1beta1.MsgMintONFT", MsgMintONFT], ["/OmniFlix.onft.v1beta1.MsgTransferONFT", MsgTransferONFT], ["/OmniFlix.onft.v1beta1.MsgBurnONFT", MsgBurnONFT], ["/OmniFlix.onft.v1beta1.MsgUpdateParams", MsgUpdateParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createDenom(value: MsgCreateDenom) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgCreateDenom", + value: MsgCreateDenom.encode(value).finish() + }; + }, + updateDenom(value: MsgUpdateDenom) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgUpdateDenom", + value: MsgUpdateDenom.encode(value).finish() + }; + }, + transferDenom(value: MsgTransferDenom) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgTransferDenom", + value: MsgTransferDenom.encode(value).finish() + }; + }, + purgeDenom(value: MsgPurgeDenom) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgPurgeDenom", + value: MsgPurgeDenom.encode(value).finish() + }; + }, + mintONFT(value: MsgMintONFT) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgMintONFT", + value: MsgMintONFT.encode(value).finish() + }; + }, + transferONFT(value: MsgTransferONFT) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgTransferONFT", + value: MsgTransferONFT.encode(value).finish() + }; + }, + burnONFT(value: MsgBurnONFT) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgBurnONFT", + value: MsgBurnONFT.encode(value).finish() + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + createDenom(value: MsgCreateDenom) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgCreateDenom", + value + }; + }, + updateDenom(value: MsgUpdateDenom) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgUpdateDenom", + value + }; + }, + transferDenom(value: MsgTransferDenom) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgTransferDenom", + value + }; + }, + purgeDenom(value: MsgPurgeDenom) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgPurgeDenom", + value + }; + }, + mintONFT(value: MsgMintONFT) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgMintONFT", + value + }; + }, + transferONFT(value: MsgTransferONFT) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgTransferONFT", + value + }; + }, + burnONFT(value: MsgBurnONFT) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgBurnONFT", + value + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgUpdateParams", + value + }; + } + }, + fromPartial: { + createDenom(value: MsgCreateDenom) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgCreateDenom", + value: MsgCreateDenom.fromPartial(value) + }; + }, + updateDenom(value: MsgUpdateDenom) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgUpdateDenom", + value: MsgUpdateDenom.fromPartial(value) + }; + }, + transferDenom(value: MsgTransferDenom) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgTransferDenom", + value: MsgTransferDenom.fromPartial(value) + }; + }, + purgeDenom(value: MsgPurgeDenom) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgPurgeDenom", + value: MsgPurgeDenom.fromPartial(value) + }; + }, + mintONFT(value: MsgMintONFT) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgMintONFT", + value: MsgMintONFT.fromPartial(value) + }; + }, + transferONFT(value: MsgTransferONFT) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgTransferONFT", + value: MsgTransferONFT.fromPartial(value) + }; + }, + burnONFT(value: MsgBurnONFT) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgBurnONFT", + value: MsgBurnONFT.fromPartial(value) + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/tx.rpc.msg.ts new file mode 100644 index 000000000..684eef93d --- /dev/null +++ b/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,73 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgCreateDenom, MsgCreateDenomResponse, MsgUpdateDenom, MsgUpdateDenomResponse, MsgTransferDenom, MsgTransferDenomResponse, MsgPurgeDenom, MsgPurgeDenomResponse, MsgMintONFT, MsgMintONFTResponse, MsgTransferONFT, MsgTransferONFTResponse, MsgBurnONFT, MsgBurnONFTResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; +export interface Msg { + createDenom(request: MsgCreateDenom): Promise; + updateDenom(request: MsgUpdateDenom): Promise; + transferDenom(request: MsgTransferDenom): Promise; + purgeDenom(request: MsgPurgeDenom): Promise; + mintONFT(request: MsgMintONFT): Promise; + transferONFT(request: MsgTransferONFT): Promise; + burnONFT(request: MsgBurnONFT): Promise; + /** + * UpdateParams defines a governance operation for updating the onft module + * parameters. The authority is hard-coded to the onft module account. + * + * Since: cosmos-sdk 0.47 + */ + updateParams(request: MsgUpdateParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.createDenom = this.createDenom.bind(this); + this.updateDenom = this.updateDenom.bind(this); + this.transferDenom = this.transferDenom.bind(this); + this.purgeDenom = this.purgeDenom.bind(this); + this.mintONFT = this.mintONFT.bind(this); + this.transferONFT = this.transferONFT.bind(this); + this.burnONFT = this.burnONFT.bind(this); + this.updateParams = this.updateParams.bind(this); + } + createDenom(request: MsgCreateDenom, useInterfaces: boolean = true): Promise { + const data = MsgCreateDenom.encode(request).finish(); + const promise = this.rpc.request("OmniFlix.onft.v1beta1.Msg", "CreateDenom", data); + return promise.then(data => MsgCreateDenomResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + updateDenom(request: MsgUpdateDenom, useInterfaces: boolean = true): Promise { + const data = MsgUpdateDenom.encode(request).finish(); + const promise = this.rpc.request("OmniFlix.onft.v1beta1.Msg", "UpdateDenom", data); + return promise.then(data => MsgUpdateDenomResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + transferDenom(request: MsgTransferDenom, useInterfaces: boolean = true): Promise { + const data = MsgTransferDenom.encode(request).finish(); + const promise = this.rpc.request("OmniFlix.onft.v1beta1.Msg", "TransferDenom", data); + return promise.then(data => MsgTransferDenomResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + purgeDenom(request: MsgPurgeDenom, useInterfaces: boolean = true): Promise { + const data = MsgPurgeDenom.encode(request).finish(); + const promise = this.rpc.request("OmniFlix.onft.v1beta1.Msg", "PurgeDenom", data); + return promise.then(data => MsgPurgeDenomResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + mintONFT(request: MsgMintONFT, useInterfaces: boolean = true): Promise { + const data = MsgMintONFT.encode(request).finish(); + const promise = this.rpc.request("OmniFlix.onft.v1beta1.Msg", "MintONFT", data); + return promise.then(data => MsgMintONFTResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + transferONFT(request: MsgTransferONFT, useInterfaces: boolean = true): Promise { + const data = MsgTransferONFT.encode(request).finish(); + const promise = this.rpc.request("OmniFlix.onft.v1beta1.Msg", "TransferONFT", data); + return promise.then(data => MsgTransferONFTResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + burnONFT(request: MsgBurnONFT, useInterfaces: boolean = true): Promise { + const data = MsgBurnONFT.encode(request).finish(); + const promise = this.rpc.request("OmniFlix.onft.v1beta1.Msg", "BurnONFT", data); + return promise.then(data => MsgBurnONFTResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + updateParams(request: MsgUpdateParams, useInterfaces: boolean = true): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("OmniFlix.onft.v1beta1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/tx.ts b/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/tx.ts new file mode 100644 index 000000000..932f073e6 --- /dev/null +++ b/packages/types/protobuf/codegen/OmniFlix/onft/v1beta1/tx.ts @@ -0,0 +1,1735 @@ +//@ts-nocheck +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { WeightedAddress, WeightedAddressAmino, WeightedAddressSDKType, Metadata, MetadataAmino, MetadataSDKType } from "./onft"; +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; +export interface MsgCreateDenom { + id: string; + symbol: string; + name: string; + description: string; + previewUri: string; + schema: string; + sender: string; + creationFee: Coin | undefined; + uri: string; + uriHash: string; + data: string; + royaltyReceivers: WeightedAddress[]; +} +export interface MsgCreateDenomProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.MsgCreateDenom"; + value: Uint8Array; +} +export interface MsgCreateDenomAmino { + id?: string; + symbol?: string; + name?: string; + description?: string; + preview_uri?: string; + schema?: string; + sender?: string; + creation_fee?: CoinAmino | undefined; + uri?: string; + uri_hash?: string; + data?: string; + royalty_receivers?: WeightedAddressAmino[]; +} +export interface MsgCreateDenomAminoMsg { + type: "OmniFlix/onft/MsgCreateDenom"; + value: MsgCreateDenomAmino; +} +export interface MsgCreateDenomSDKType { + id: string; + symbol: string; + name: string; + description: string; + preview_uri: string; + schema: string; + sender: string; + creation_fee: CoinSDKType | undefined; + uri: string; + uri_hash: string; + data: string; + royalty_receivers: WeightedAddressSDKType[]; +} +export interface MsgCreateDenomResponse {} +export interface MsgCreateDenomResponseProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.MsgCreateDenomResponse"; + value: Uint8Array; +} +export interface MsgCreateDenomResponseAmino {} +export interface MsgCreateDenomResponseAminoMsg { + type: "/OmniFlix.onft.v1beta1.MsgCreateDenomResponse"; + value: MsgCreateDenomResponseAmino; +} +export interface MsgCreateDenomResponseSDKType {} +export interface MsgUpdateDenom { + id: string; + name: string; + description: string; + previewUri: string; + sender: string; + royaltyReceivers: WeightedAddress[]; +} +export interface MsgUpdateDenomProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.MsgUpdateDenom"; + value: Uint8Array; +} +export interface MsgUpdateDenomAmino { + id?: string; + name?: string; + description?: string; + preview_uri?: string; + sender?: string; + royalty_receivers?: WeightedAddressAmino[]; +} +export interface MsgUpdateDenomAminoMsg { + type: "OmniFlix/onft/MsgUpdateDenom"; + value: MsgUpdateDenomAmino; +} +export interface MsgUpdateDenomSDKType { + id: string; + name: string; + description: string; + preview_uri: string; + sender: string; + royalty_receivers: WeightedAddressSDKType[]; +} +export interface MsgUpdateDenomResponse {} +export interface MsgUpdateDenomResponseProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.MsgUpdateDenomResponse"; + value: Uint8Array; +} +export interface MsgUpdateDenomResponseAmino {} +export interface MsgUpdateDenomResponseAminoMsg { + type: "/OmniFlix.onft.v1beta1.MsgUpdateDenomResponse"; + value: MsgUpdateDenomResponseAmino; +} +export interface MsgUpdateDenomResponseSDKType {} +export interface MsgPurgeDenom { + id: string; + sender: string; +} +export interface MsgPurgeDenomProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.MsgPurgeDenom"; + value: Uint8Array; +} +export interface MsgPurgeDenomAmino { + id?: string; + sender?: string; +} +export interface MsgPurgeDenomAminoMsg { + type: "OmniFlix/onft/MsgPurgeDenom"; + value: MsgPurgeDenomAmino; +} +export interface MsgPurgeDenomSDKType { + id: string; + sender: string; +} +export interface MsgPurgeDenomResponse {} +export interface MsgPurgeDenomResponseProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.MsgPurgeDenomResponse"; + value: Uint8Array; +} +export interface MsgPurgeDenomResponseAmino {} +export interface MsgPurgeDenomResponseAminoMsg { + type: "/OmniFlix.onft.v1beta1.MsgPurgeDenomResponse"; + value: MsgPurgeDenomResponseAmino; +} +export interface MsgPurgeDenomResponseSDKType {} +export interface MsgTransferDenom { + id: string; + sender: string; + recipient: string; +} +export interface MsgTransferDenomProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.MsgTransferDenom"; + value: Uint8Array; +} +export interface MsgTransferDenomAmino { + id?: string; + sender?: string; + recipient?: string; +} +export interface MsgTransferDenomAminoMsg { + type: "OmniFlix/onft/MsgTransferDenom"; + value: MsgTransferDenomAmino; +} +export interface MsgTransferDenomSDKType { + id: string; + sender: string; + recipient: string; +} +export interface MsgTransferDenomResponse {} +export interface MsgTransferDenomResponseProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.MsgTransferDenomResponse"; + value: Uint8Array; +} +export interface MsgTransferDenomResponseAmino {} +export interface MsgTransferDenomResponseAminoMsg { + type: "/OmniFlix.onft.v1beta1.MsgTransferDenomResponse"; + value: MsgTransferDenomResponseAmino; +} +export interface MsgTransferDenomResponseSDKType {} +export interface MsgMintONFT { + id: string; + denomId: string; + metadata: Metadata | undefined; + data: string; + transferable: boolean; + extensible: boolean; + nsfw: boolean; + royaltyShare: string; + sender: string; + recipient: string; +} +export interface MsgMintONFTProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.MsgMintONFT"; + value: Uint8Array; +} +export interface MsgMintONFTAmino { + id?: string; + denom_id?: string; + metadata?: MetadataAmino | undefined; + data?: string; + transferable?: boolean; + extensible?: boolean; + nsfw?: boolean; + royalty_share?: string; + sender?: string; + recipient?: string; +} +export interface MsgMintONFTAminoMsg { + type: "OmniFlix/onft/MsgMintONFT"; + value: MsgMintONFTAmino; +} +export interface MsgMintONFTSDKType { + id: string; + denom_id: string; + metadata: MetadataSDKType | undefined; + data: string; + transferable: boolean; + extensible: boolean; + nsfw: boolean; + royalty_share: string; + sender: string; + recipient: string; +} +export interface MsgMintONFTResponse {} +export interface MsgMintONFTResponseProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.MsgMintONFTResponse"; + value: Uint8Array; +} +export interface MsgMintONFTResponseAmino {} +export interface MsgMintONFTResponseAminoMsg { + type: "/OmniFlix.onft.v1beta1.MsgMintONFTResponse"; + value: MsgMintONFTResponseAmino; +} +export interface MsgMintONFTResponseSDKType {} +export interface MsgTransferONFT { + id: string; + denomId: string; + sender: string; + recipient: string; +} +export interface MsgTransferONFTProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.MsgTransferONFT"; + value: Uint8Array; +} +export interface MsgTransferONFTAmino { + id?: string; + denom_id?: string; + sender?: string; + recipient?: string; +} +export interface MsgTransferONFTAminoMsg { + type: "OmniFlix/onft/MsgTransferONFT"; + value: MsgTransferONFTAmino; +} +export interface MsgTransferONFTSDKType { + id: string; + denom_id: string; + sender: string; + recipient: string; +} +export interface MsgTransferONFTResponse {} +export interface MsgTransferONFTResponseProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.MsgTransferONFTResponse"; + value: Uint8Array; +} +export interface MsgTransferONFTResponseAmino {} +export interface MsgTransferONFTResponseAminoMsg { + type: "/OmniFlix.onft.v1beta1.MsgTransferONFTResponse"; + value: MsgTransferONFTResponseAmino; +} +export interface MsgTransferONFTResponseSDKType {} +export interface MsgBurnONFT { + id: string; + denomId: string; + sender: string; +} +export interface MsgBurnONFTProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.MsgBurnONFT"; + value: Uint8Array; +} +export interface MsgBurnONFTAmino { + id?: string; + denom_id?: string; + sender?: string; +} +export interface MsgBurnONFTAminoMsg { + type: "OmniFlix/onft/MsgBurnONFT"; + value: MsgBurnONFTAmino; +} +export interface MsgBurnONFTSDKType { + id: string; + denom_id: string; + sender: string; +} +export interface MsgBurnONFTResponse {} +export interface MsgBurnONFTResponseProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.MsgBurnONFTResponse"; + value: Uint8Array; +} +export interface MsgBurnONFTResponseAmino {} +export interface MsgBurnONFTResponseAminoMsg { + type: "/OmniFlix.onft.v1beta1.MsgBurnONFTResponse"; + value: MsgBurnONFTResponseAmino; +} +export interface MsgBurnONFTResponseSDKType {} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address of the governance account. */ + authority: string; + /** + * params defines the onft module parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params | undefined; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsAmino { + /** authority is the address of the governance account. */ + authority?: string; + /** + * params defines the onft module parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino | undefined; +} +export interface MsgUpdateParamsAminoMsg { + type: "/OmniFlix.onft.v1beta1.MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType | undefined; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/OmniFlix.onft.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/OmniFlix.onft.v1beta1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseSDKType {} +function createBaseMsgCreateDenom(): MsgCreateDenom { + return { + id: "", + symbol: "", + name: "", + description: "", + previewUri: "", + schema: "", + sender: "", + creationFee: Coin.fromPartial({}), + uri: "", + uriHash: "", + data: "", + royaltyReceivers: [] + }; +} +export const MsgCreateDenom = { + typeUrl: "/OmniFlix.onft.v1beta1.MsgCreateDenom", + encode(message: MsgCreateDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.symbol !== "") { + writer.uint32(18).string(message.symbol); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.previewUri !== "") { + writer.uint32(42).string(message.previewUri); + } + if (message.schema !== "") { + writer.uint32(50).string(message.schema); + } + if (message.sender !== "") { + writer.uint32(58).string(message.sender); + } + if (message.creationFee !== undefined) { + Coin.encode(message.creationFee, writer.uint32(66).fork()).ldelim(); + } + if (message.uri !== "") { + writer.uint32(74).string(message.uri); + } + if (message.uriHash !== "") { + writer.uint32(82).string(message.uriHash); + } + if (message.data !== "") { + writer.uint32(90).string(message.data); + } + for (const v of message.royaltyReceivers) { + WeightedAddress.encode(v!, writer.uint32(98).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgCreateDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDenom(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.symbol = reader.string(); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.previewUri = reader.string(); + break; + case 6: + message.schema = reader.string(); + break; + case 7: + message.sender = reader.string(); + break; + case 8: + message.creationFee = Coin.decode(reader, reader.uint32(), useInterfaces); + break; + case 9: + message.uri = reader.string(); + break; + case 10: + message.uriHash = reader.string(); + break; + case 11: + message.data = reader.string(); + break; + case 12: + message.royaltyReceivers.push(WeightedAddress.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateDenom { + const message = createBaseMsgCreateDenom(); + message.id = object.id ?? ""; + message.symbol = object.symbol ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.previewUri = object.previewUri ?? ""; + message.schema = object.schema ?? ""; + message.sender = object.sender ?? ""; + message.creationFee = object.creationFee !== undefined && object.creationFee !== null ? Coin.fromPartial(object.creationFee) : undefined; + message.uri = object.uri ?? ""; + message.uriHash = object.uriHash ?? ""; + message.data = object.data ?? ""; + message.royaltyReceivers = object.royaltyReceivers?.map(e => WeightedAddress.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgCreateDenomAmino): MsgCreateDenom { + const message = createBaseMsgCreateDenom(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.preview_uri !== undefined && object.preview_uri !== null) { + message.previewUri = object.preview_uri; + } + if (object.schema !== undefined && object.schema !== null) { + message.schema = object.schema; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.creation_fee !== undefined && object.creation_fee !== null) { + message.creationFee = Coin.fromAmino(object.creation_fee); + } + if (object.uri !== undefined && object.uri !== null) { + message.uri = object.uri; + } + if (object.uri_hash !== undefined && object.uri_hash !== null) { + message.uriHash = object.uri_hash; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + message.royaltyReceivers = object.royalty_receivers?.map(e => WeightedAddress.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgCreateDenom, useInterfaces: boolean = false): MsgCreateDenomAmino { + const obj: any = {}; + obj.id = message.id; + obj.symbol = message.symbol; + obj.name = message.name; + obj.description = message.description; + obj.preview_uri = message.previewUri; + obj.schema = message.schema; + obj.sender = message.sender; + obj.creation_fee = message.creationFee ? Coin.toAmino(message.creationFee, useInterfaces) : undefined; + obj.uri = message.uri; + obj.uri_hash = message.uriHash; + obj.data = message.data; + if (message.royaltyReceivers) { + obj.royalty_receivers = message.royaltyReceivers.map(e => e ? WeightedAddress.toAmino(e, useInterfaces) : undefined); + } else { + obj.royalty_receivers = []; + } + return obj; + }, + fromAminoMsg(object: MsgCreateDenomAminoMsg): MsgCreateDenom { + return MsgCreateDenom.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateDenom, useInterfaces: boolean = false): MsgCreateDenomAminoMsg { + return { + type: "OmniFlix/onft/MsgCreateDenom", + value: MsgCreateDenom.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgCreateDenomProtoMsg, useInterfaces: boolean = false): MsgCreateDenom { + return MsgCreateDenom.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgCreateDenom): Uint8Array { + return MsgCreateDenom.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateDenom): MsgCreateDenomProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgCreateDenom", + value: MsgCreateDenom.encode(message).finish() + }; + } +}; +function createBaseMsgCreateDenomResponse(): MsgCreateDenomResponse { + return {}; +} +export const MsgCreateDenomResponse = { + typeUrl: "/OmniFlix.onft.v1beta1.MsgCreateDenomResponse", + encode(_: MsgCreateDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgCreateDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCreateDenomResponse { + const message = createBaseMsgCreateDenomResponse(); + return message; + }, + fromAmino(_: MsgCreateDenomResponseAmino): MsgCreateDenomResponse { + const message = createBaseMsgCreateDenomResponse(); + return message; + }, + toAmino(_: MsgCreateDenomResponse, useInterfaces: boolean = false): MsgCreateDenomResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreateDenomResponseAminoMsg): MsgCreateDenomResponse { + return MsgCreateDenomResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCreateDenomResponseProtoMsg, useInterfaces: boolean = false): MsgCreateDenomResponse { + return MsgCreateDenomResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgCreateDenomResponse): Uint8Array { + return MsgCreateDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateDenomResponse): MsgCreateDenomResponseProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgCreateDenomResponse", + value: MsgCreateDenomResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateDenom(): MsgUpdateDenom { + return { + id: "", + name: "", + description: "", + previewUri: "", + sender: "", + royaltyReceivers: [] + }; +} +export const MsgUpdateDenom = { + typeUrl: "/OmniFlix.onft.v1beta1.MsgUpdateDenom", + encode(message: MsgUpdateDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + if (message.previewUri !== "") { + writer.uint32(34).string(message.previewUri); + } + if (message.sender !== "") { + writer.uint32(42).string(message.sender); + } + for (const v of message.royaltyReceivers) { + WeightedAddress.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateDenom(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.previewUri = reader.string(); + break; + case 5: + message.sender = reader.string(); + break; + case 6: + message.royaltyReceivers.push(WeightedAddress.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateDenom { + const message = createBaseMsgUpdateDenom(); + message.id = object.id ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.previewUri = object.previewUri ?? ""; + message.sender = object.sender ?? ""; + message.royaltyReceivers = object.royaltyReceivers?.map(e => WeightedAddress.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgUpdateDenomAmino): MsgUpdateDenom { + const message = createBaseMsgUpdateDenom(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.preview_uri !== undefined && object.preview_uri !== null) { + message.previewUri = object.preview_uri; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + message.royaltyReceivers = object.royalty_receivers?.map(e => WeightedAddress.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgUpdateDenom, useInterfaces: boolean = false): MsgUpdateDenomAmino { + const obj: any = {}; + obj.id = message.id; + obj.name = message.name; + obj.description = message.description; + obj.preview_uri = message.previewUri; + obj.sender = message.sender; + if (message.royaltyReceivers) { + obj.royalty_receivers = message.royaltyReceivers.map(e => e ? WeightedAddress.toAmino(e, useInterfaces) : undefined); + } else { + obj.royalty_receivers = []; + } + return obj; + }, + fromAminoMsg(object: MsgUpdateDenomAminoMsg): MsgUpdateDenom { + return MsgUpdateDenom.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateDenom, useInterfaces: boolean = false): MsgUpdateDenomAminoMsg { + return { + type: "OmniFlix/onft/MsgUpdateDenom", + value: MsgUpdateDenom.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgUpdateDenomProtoMsg, useInterfaces: boolean = false): MsgUpdateDenom { + return MsgUpdateDenom.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateDenom): Uint8Array { + return MsgUpdateDenom.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateDenom): MsgUpdateDenomProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgUpdateDenom", + value: MsgUpdateDenom.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateDenomResponse(): MsgUpdateDenomResponse { + return {}; +} +export const MsgUpdateDenomResponse = { + typeUrl: "/OmniFlix.onft.v1beta1.MsgUpdateDenomResponse", + encode(_: MsgUpdateDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateDenomResponse { + const message = createBaseMsgUpdateDenomResponse(); + return message; + }, + fromAmino(_: MsgUpdateDenomResponseAmino): MsgUpdateDenomResponse { + const message = createBaseMsgUpdateDenomResponse(); + return message; + }, + toAmino(_: MsgUpdateDenomResponse, useInterfaces: boolean = false): MsgUpdateDenomResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateDenomResponseAminoMsg): MsgUpdateDenomResponse { + return MsgUpdateDenomResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateDenomResponseProtoMsg, useInterfaces: boolean = false): MsgUpdateDenomResponse { + return MsgUpdateDenomResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateDenomResponse): Uint8Array { + return MsgUpdateDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateDenomResponse): MsgUpdateDenomResponseProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgUpdateDenomResponse", + value: MsgUpdateDenomResponse.encode(message).finish() + }; + } +}; +function createBaseMsgPurgeDenom(): MsgPurgeDenom { + return { + id: "", + sender: "" + }; +} +export const MsgPurgeDenom = { + typeUrl: "/OmniFlix.onft.v1beta1.MsgPurgeDenom", + encode(message: MsgPurgeDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.sender !== "") { + writer.uint32(18).string(message.sender); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgPurgeDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPurgeDenom(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgPurgeDenom { + const message = createBaseMsgPurgeDenom(); + message.id = object.id ?? ""; + message.sender = object.sender ?? ""; + return message; + }, + fromAmino(object: MsgPurgeDenomAmino): MsgPurgeDenom { + const message = createBaseMsgPurgeDenom(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; + }, + toAmino(message: MsgPurgeDenom, useInterfaces: boolean = false): MsgPurgeDenomAmino { + const obj: any = {}; + obj.id = message.id; + obj.sender = message.sender; + return obj; + }, + fromAminoMsg(object: MsgPurgeDenomAminoMsg): MsgPurgeDenom { + return MsgPurgeDenom.fromAmino(object.value); + }, + toAminoMsg(message: MsgPurgeDenom, useInterfaces: boolean = false): MsgPurgeDenomAminoMsg { + return { + type: "OmniFlix/onft/MsgPurgeDenom", + value: MsgPurgeDenom.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgPurgeDenomProtoMsg, useInterfaces: boolean = false): MsgPurgeDenom { + return MsgPurgeDenom.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgPurgeDenom): Uint8Array { + return MsgPurgeDenom.encode(message).finish(); + }, + toProtoMsg(message: MsgPurgeDenom): MsgPurgeDenomProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgPurgeDenom", + value: MsgPurgeDenom.encode(message).finish() + }; + } +}; +function createBaseMsgPurgeDenomResponse(): MsgPurgeDenomResponse { + return {}; +} +export const MsgPurgeDenomResponse = { + typeUrl: "/OmniFlix.onft.v1beta1.MsgPurgeDenomResponse", + encode(_: MsgPurgeDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgPurgeDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPurgeDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgPurgeDenomResponse { + const message = createBaseMsgPurgeDenomResponse(); + return message; + }, + fromAmino(_: MsgPurgeDenomResponseAmino): MsgPurgeDenomResponse { + const message = createBaseMsgPurgeDenomResponse(); + return message; + }, + toAmino(_: MsgPurgeDenomResponse, useInterfaces: boolean = false): MsgPurgeDenomResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgPurgeDenomResponseAminoMsg): MsgPurgeDenomResponse { + return MsgPurgeDenomResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgPurgeDenomResponseProtoMsg, useInterfaces: boolean = false): MsgPurgeDenomResponse { + return MsgPurgeDenomResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgPurgeDenomResponse): Uint8Array { + return MsgPurgeDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgPurgeDenomResponse): MsgPurgeDenomResponseProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgPurgeDenomResponse", + value: MsgPurgeDenomResponse.encode(message).finish() + }; + } +}; +function createBaseMsgTransferDenom(): MsgTransferDenom { + return { + id: "", + sender: "", + recipient: "" + }; +} +export const MsgTransferDenom = { + typeUrl: "/OmniFlix.onft.v1beta1.MsgTransferDenom", + encode(message: MsgTransferDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.sender !== "") { + writer.uint32(18).string(message.sender); + } + if (message.recipient !== "") { + writer.uint32(26).string(message.recipient); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgTransferDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransferDenom(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.sender = reader.string(); + break; + case 3: + message.recipient = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgTransferDenom { + const message = createBaseMsgTransferDenom(); + message.id = object.id ?? ""; + message.sender = object.sender ?? ""; + message.recipient = object.recipient ?? ""; + return message; + }, + fromAmino(object: MsgTransferDenomAmino): MsgTransferDenom { + const message = createBaseMsgTransferDenom(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + return message; + }, + toAmino(message: MsgTransferDenom, useInterfaces: boolean = false): MsgTransferDenomAmino { + const obj: any = {}; + obj.id = message.id; + obj.sender = message.sender; + obj.recipient = message.recipient; + return obj; + }, + fromAminoMsg(object: MsgTransferDenomAminoMsg): MsgTransferDenom { + return MsgTransferDenom.fromAmino(object.value); + }, + toAminoMsg(message: MsgTransferDenom, useInterfaces: boolean = false): MsgTransferDenomAminoMsg { + return { + type: "OmniFlix/onft/MsgTransferDenom", + value: MsgTransferDenom.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgTransferDenomProtoMsg, useInterfaces: boolean = false): MsgTransferDenom { + return MsgTransferDenom.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgTransferDenom): Uint8Array { + return MsgTransferDenom.encode(message).finish(); + }, + toProtoMsg(message: MsgTransferDenom): MsgTransferDenomProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgTransferDenom", + value: MsgTransferDenom.encode(message).finish() + }; + } +}; +function createBaseMsgTransferDenomResponse(): MsgTransferDenomResponse { + return {}; +} +export const MsgTransferDenomResponse = { + typeUrl: "/OmniFlix.onft.v1beta1.MsgTransferDenomResponse", + encode(_: MsgTransferDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgTransferDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransferDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgTransferDenomResponse { + const message = createBaseMsgTransferDenomResponse(); + return message; + }, + fromAmino(_: MsgTransferDenomResponseAmino): MsgTransferDenomResponse { + const message = createBaseMsgTransferDenomResponse(); + return message; + }, + toAmino(_: MsgTransferDenomResponse, useInterfaces: boolean = false): MsgTransferDenomResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgTransferDenomResponseAminoMsg): MsgTransferDenomResponse { + return MsgTransferDenomResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgTransferDenomResponseProtoMsg, useInterfaces: boolean = false): MsgTransferDenomResponse { + return MsgTransferDenomResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgTransferDenomResponse): Uint8Array { + return MsgTransferDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgTransferDenomResponse): MsgTransferDenomResponseProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgTransferDenomResponse", + value: MsgTransferDenomResponse.encode(message).finish() + }; + } +}; +function createBaseMsgMintONFT(): MsgMintONFT { + return { + id: "", + denomId: "", + metadata: Metadata.fromPartial({}), + data: "", + transferable: false, + extensible: false, + nsfw: false, + royaltyShare: "", + sender: "", + recipient: "" + }; +} +export const MsgMintONFT = { + typeUrl: "/OmniFlix.onft.v1beta1.MsgMintONFT", + encode(message: MsgMintONFT, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.denomId !== "") { + writer.uint32(18).string(message.denomId); + } + if (message.metadata !== undefined) { + Metadata.encode(message.metadata, writer.uint32(26).fork()).ldelim(); + } + if (message.data !== "") { + writer.uint32(34).string(message.data); + } + if (message.transferable === true) { + writer.uint32(40).bool(message.transferable); + } + if (message.extensible === true) { + writer.uint32(48).bool(message.extensible); + } + if (message.nsfw === true) { + writer.uint32(56).bool(message.nsfw); + } + if (message.royaltyShare !== "") { + writer.uint32(66).string(Decimal.fromUserInput(message.royaltyShare, 18).atomics); + } + if (message.sender !== "") { + writer.uint32(74).string(message.sender); + } + if (message.recipient !== "") { + writer.uint32(82).string(message.recipient); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgMintONFT { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMintONFT(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.denomId = reader.string(); + break; + case 3: + message.metadata = Metadata.decode(reader, reader.uint32(), useInterfaces); + break; + case 4: + message.data = reader.string(); + break; + case 5: + message.transferable = reader.bool(); + break; + case 6: + message.extensible = reader.bool(); + break; + case 7: + message.nsfw = reader.bool(); + break; + case 8: + message.royaltyShare = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 9: + message.sender = reader.string(); + break; + case 10: + message.recipient = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgMintONFT { + const message = createBaseMsgMintONFT(); + message.id = object.id ?? ""; + message.denomId = object.denomId ?? ""; + message.metadata = object.metadata !== undefined && object.metadata !== null ? Metadata.fromPartial(object.metadata) : undefined; + message.data = object.data ?? ""; + message.transferable = object.transferable ?? false; + message.extensible = object.extensible ?? false; + message.nsfw = object.nsfw ?? false; + message.royaltyShare = object.royaltyShare ?? ""; + message.sender = object.sender ?? ""; + message.recipient = object.recipient ?? ""; + return message; + }, + fromAmino(object: MsgMintONFTAmino): MsgMintONFT { + const message = createBaseMsgMintONFT(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.denom_id !== undefined && object.denom_id !== null) { + message.denomId = object.denom_id; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = Metadata.fromAmino(object.metadata); + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } + if (object.transferable !== undefined && object.transferable !== null) { + message.transferable = object.transferable; + } + if (object.extensible !== undefined && object.extensible !== null) { + message.extensible = object.extensible; + } + if (object.nsfw !== undefined && object.nsfw !== null) { + message.nsfw = object.nsfw; + } + if (object.royalty_share !== undefined && object.royalty_share !== null) { + message.royaltyShare = object.royalty_share; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + return message; + }, + toAmino(message: MsgMintONFT, useInterfaces: boolean = false): MsgMintONFTAmino { + const obj: any = {}; + obj.id = message.id; + obj.denom_id = message.denomId; + obj.metadata = message.metadata ? Metadata.toAmino(message.metadata, useInterfaces) : undefined; + obj.data = message.data; + obj.transferable = message.transferable; + obj.extensible = message.extensible; + obj.nsfw = message.nsfw; + obj.royalty_share = message.royaltyShare; + obj.sender = message.sender; + obj.recipient = message.recipient; + return obj; + }, + fromAminoMsg(object: MsgMintONFTAminoMsg): MsgMintONFT { + return MsgMintONFT.fromAmino(object.value); + }, + toAminoMsg(message: MsgMintONFT, useInterfaces: boolean = false): MsgMintONFTAminoMsg { + return { + type: "OmniFlix/onft/MsgMintONFT", + value: MsgMintONFT.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgMintONFTProtoMsg, useInterfaces: boolean = false): MsgMintONFT { + return MsgMintONFT.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgMintONFT): Uint8Array { + return MsgMintONFT.encode(message).finish(); + }, + toProtoMsg(message: MsgMintONFT): MsgMintONFTProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgMintONFT", + value: MsgMintONFT.encode(message).finish() + }; + } +}; +function createBaseMsgMintONFTResponse(): MsgMintONFTResponse { + return {}; +} +export const MsgMintONFTResponse = { + typeUrl: "/OmniFlix.onft.v1beta1.MsgMintONFTResponse", + encode(_: MsgMintONFTResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgMintONFTResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMintONFTResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgMintONFTResponse { + const message = createBaseMsgMintONFTResponse(); + return message; + }, + fromAmino(_: MsgMintONFTResponseAmino): MsgMintONFTResponse { + const message = createBaseMsgMintONFTResponse(); + return message; + }, + toAmino(_: MsgMintONFTResponse, useInterfaces: boolean = false): MsgMintONFTResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgMintONFTResponseAminoMsg): MsgMintONFTResponse { + return MsgMintONFTResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgMintONFTResponseProtoMsg, useInterfaces: boolean = false): MsgMintONFTResponse { + return MsgMintONFTResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgMintONFTResponse): Uint8Array { + return MsgMintONFTResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgMintONFTResponse): MsgMintONFTResponseProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgMintONFTResponse", + value: MsgMintONFTResponse.encode(message).finish() + }; + } +}; +function createBaseMsgTransferONFT(): MsgTransferONFT { + return { + id: "", + denomId: "", + sender: "", + recipient: "" + }; +} +export const MsgTransferONFT = { + typeUrl: "/OmniFlix.onft.v1beta1.MsgTransferONFT", + encode(message: MsgTransferONFT, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.denomId !== "") { + writer.uint32(18).string(message.denomId); + } + if (message.sender !== "") { + writer.uint32(26).string(message.sender); + } + if (message.recipient !== "") { + writer.uint32(34).string(message.recipient); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgTransferONFT { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransferONFT(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.denomId = reader.string(); + break; + case 3: + message.sender = reader.string(); + break; + case 4: + message.recipient = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgTransferONFT { + const message = createBaseMsgTransferONFT(); + message.id = object.id ?? ""; + message.denomId = object.denomId ?? ""; + message.sender = object.sender ?? ""; + message.recipient = object.recipient ?? ""; + return message; + }, + fromAmino(object: MsgTransferONFTAmino): MsgTransferONFT { + const message = createBaseMsgTransferONFT(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.denom_id !== undefined && object.denom_id !== null) { + message.denomId = object.denom_id; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + return message; + }, + toAmino(message: MsgTransferONFT, useInterfaces: boolean = false): MsgTransferONFTAmino { + const obj: any = {}; + obj.id = message.id; + obj.denom_id = message.denomId; + obj.sender = message.sender; + obj.recipient = message.recipient; + return obj; + }, + fromAminoMsg(object: MsgTransferONFTAminoMsg): MsgTransferONFT { + return MsgTransferONFT.fromAmino(object.value); + }, + toAminoMsg(message: MsgTransferONFT, useInterfaces: boolean = false): MsgTransferONFTAminoMsg { + return { + type: "OmniFlix/onft/MsgTransferONFT", + value: MsgTransferONFT.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgTransferONFTProtoMsg, useInterfaces: boolean = false): MsgTransferONFT { + return MsgTransferONFT.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgTransferONFT): Uint8Array { + return MsgTransferONFT.encode(message).finish(); + }, + toProtoMsg(message: MsgTransferONFT): MsgTransferONFTProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgTransferONFT", + value: MsgTransferONFT.encode(message).finish() + }; + } +}; +function createBaseMsgTransferONFTResponse(): MsgTransferONFTResponse { + return {}; +} +export const MsgTransferONFTResponse = { + typeUrl: "/OmniFlix.onft.v1beta1.MsgTransferONFTResponse", + encode(_: MsgTransferONFTResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgTransferONFTResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTransferONFTResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgTransferONFTResponse { + const message = createBaseMsgTransferONFTResponse(); + return message; + }, + fromAmino(_: MsgTransferONFTResponseAmino): MsgTransferONFTResponse { + const message = createBaseMsgTransferONFTResponse(); + return message; + }, + toAmino(_: MsgTransferONFTResponse, useInterfaces: boolean = false): MsgTransferONFTResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgTransferONFTResponseAminoMsg): MsgTransferONFTResponse { + return MsgTransferONFTResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgTransferONFTResponseProtoMsg, useInterfaces: boolean = false): MsgTransferONFTResponse { + return MsgTransferONFTResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgTransferONFTResponse): Uint8Array { + return MsgTransferONFTResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgTransferONFTResponse): MsgTransferONFTResponseProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgTransferONFTResponse", + value: MsgTransferONFTResponse.encode(message).finish() + }; + } +}; +function createBaseMsgBurnONFT(): MsgBurnONFT { + return { + id: "", + denomId: "", + sender: "" + }; +} +export const MsgBurnONFT = { + typeUrl: "/OmniFlix.onft.v1beta1.MsgBurnONFT", + encode(message: MsgBurnONFT, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.denomId !== "") { + writer.uint32(18).string(message.denomId); + } + if (message.sender !== "") { + writer.uint32(26).string(message.sender); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgBurnONFT { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBurnONFT(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.denomId = reader.string(); + break; + case 3: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgBurnONFT { + const message = createBaseMsgBurnONFT(); + message.id = object.id ?? ""; + message.denomId = object.denomId ?? ""; + message.sender = object.sender ?? ""; + return message; + }, + fromAmino(object: MsgBurnONFTAmino): MsgBurnONFT { + const message = createBaseMsgBurnONFT(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.denom_id !== undefined && object.denom_id !== null) { + message.denomId = object.denom_id; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + return message; + }, + toAmino(message: MsgBurnONFT, useInterfaces: boolean = false): MsgBurnONFTAmino { + const obj: any = {}; + obj.id = message.id; + obj.denom_id = message.denomId; + obj.sender = message.sender; + return obj; + }, + fromAminoMsg(object: MsgBurnONFTAminoMsg): MsgBurnONFT { + return MsgBurnONFT.fromAmino(object.value); + }, + toAminoMsg(message: MsgBurnONFT, useInterfaces: boolean = false): MsgBurnONFTAminoMsg { + return { + type: "OmniFlix/onft/MsgBurnONFT", + value: MsgBurnONFT.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgBurnONFTProtoMsg, useInterfaces: boolean = false): MsgBurnONFT { + return MsgBurnONFT.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgBurnONFT): Uint8Array { + return MsgBurnONFT.encode(message).finish(); + }, + toProtoMsg(message: MsgBurnONFT): MsgBurnONFTProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgBurnONFT", + value: MsgBurnONFT.encode(message).finish() + }; + } +}; +function createBaseMsgBurnONFTResponse(): MsgBurnONFTResponse { + return {}; +} +export const MsgBurnONFTResponse = { + typeUrl: "/OmniFlix.onft.v1beta1.MsgBurnONFTResponse", + encode(_: MsgBurnONFTResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgBurnONFTResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBurnONFTResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgBurnONFTResponse { + const message = createBaseMsgBurnONFTResponse(); + return message; + }, + fromAmino(_: MsgBurnONFTResponseAmino): MsgBurnONFTResponse { + const message = createBaseMsgBurnONFTResponse(); + return message; + }, + toAmino(_: MsgBurnONFTResponse, useInterfaces: boolean = false): MsgBurnONFTResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgBurnONFTResponseAminoMsg): MsgBurnONFTResponse { + return MsgBurnONFTResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgBurnONFTResponseProtoMsg, useInterfaces: boolean = false): MsgBurnONFTResponse { + return MsgBurnONFTResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgBurnONFTResponse): Uint8Array { + return MsgBurnONFTResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBurnONFTResponse): MsgBurnONFTResponseProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgBurnONFTResponse", + value: MsgBurnONFTResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/OmniFlix.onft.v1beta1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams, useInterfaces: boolean = false): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg, useInterfaces: boolean = false): MsgUpdateParams { + return MsgUpdateParams.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/OmniFlix.onft.v1beta1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse, useInterfaces: boolean = false): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg, useInterfaces: boolean = false): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/OmniFlix.onft.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/OmniFlix/rpc.query.ts b/packages/types/protobuf/codegen/OmniFlix/rpc.query.ts new file mode 100644 index 000000000..9a7015759 --- /dev/null +++ b/packages/types/protobuf/codegen/OmniFlix/rpc.query.ts @@ -0,0 +1,61 @@ +import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import { QueryClient } from "@cosmjs/stargate"; +export const createRPCQueryClient = async ({ + rpcEndpoint +}: { + rpcEndpoint: string | HttpEndpoint; +}) => { + const tmClient = await Tendermint34Client.connect(rpcEndpoint); + const client = new QueryClient(tmClient); + return { + cosmos: { + auth: { + v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + authz: { + v1beta1: (await import("../cosmos/authz/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + bank: { + v1beta1: (await import("../cosmos/bank/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + base: { + tendermint: { + v1beta1: (await import("../cosmos/base/tendermint/v1beta1/query.rpc.Service")).createRpcQueryExtension(client) + } + }, + distribution: { + v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + gov: { + v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), + v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + mint: { + v1beta1: (await import("../cosmos/mint/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + params: { + v1beta1: (await import("../cosmos/params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + slashing: { + v1beta1: (await import("../cosmos/slashing/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + staking: { + v1beta1: (await import("../cosmos/staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + tx: { + v1beta1: (await import("../cosmos/tx/v1beta1/service.rpc.Service")).createRpcQueryExtension(client) + }, + upgrade: { + v1beta1: (await import("../cosmos/upgrade/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, + OmniFlix: { + onft: { + v1beta1: (await import("./onft/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + } + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/OmniFlix/rpc.tx.ts b/packages/types/protobuf/codegen/OmniFlix/rpc.tx.ts new file mode 100644 index 000000000..f04d583d1 --- /dev/null +++ b/packages/types/protobuf/codegen/OmniFlix/rpc.tx.ts @@ -0,0 +1,45 @@ +import { Rpc } from "../helpers"; +export const createRPCMsgClient = async ({ + rpc +}: { + rpc: Rpc; +}) => ({ + cosmos: { + auth: { + v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + authz: { + v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + bank: { + v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + distribution: { + v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + gov: { + v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), + v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + mint: { + v1beta1: new (await import("../cosmos/mint/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + slashing: { + v1beta1: new (await import("../cosmos/slashing/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + staking: { + v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + upgrade: { + v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + } + }, + OmniFlix: { + onft: { + v1beta1: new (await import("./onft/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + } + } +}); \ No newline at end of file diff --git a/packages/types/protobuf/codegen/alliance/bundle.ts b/packages/types/protobuf/codegen/alliance/bundle.ts index b65aac5b7..8369d38a4 100644 --- a/packages/types/protobuf/codegen/alliance/bundle.ts +++ b/packages/types/protobuf/codegen/alliance/bundle.ts @@ -8,12 +8,12 @@ import * as _6 from "./alliance/query"; import * as _7 from "./alliance/redelegations"; import * as _8 from "./alliance/tx"; import * as _9 from "./alliance/unbonding"; -import * as _369 from "./alliance/tx.amino"; -import * as _370 from "./alliance/tx.registry"; -import * as _371 from "./alliance/query.rpc.Query"; -import * as _372 from "./alliance/tx.rpc.msg"; -import * as _624 from "./rpc.query"; -import * as _625 from "./rpc.tx"; +import * as _374 from "./alliance/tx.amino"; +import * as _375 from "./alliance/tx.registry"; +import * as _376 from "./alliance/query.rpc.Query"; +import * as _377 from "./alliance/tx.rpc.msg"; +import * as _633 from "./rpc.query"; +import * as _634 from "./rpc.tx"; export namespace alliance { export const alliance = { ..._0, @@ -26,13 +26,13 @@ export namespace alliance { ..._7, ..._8, ..._9, - ..._369, - ..._370, - ..._371, - ..._372 + ..._374, + ..._375, + ..._376, + ..._377 }; export const ClientFactory = { - ..._624, - ..._625 + ..._633, + ..._634 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/bitsong/bundle.ts b/packages/types/protobuf/codegen/bitsong/bundle.ts index 580f4a0bf..703acd06f 100644 --- a/packages/types/protobuf/codegen/bitsong/bundle.ts +++ b/packages/types/protobuf/codegen/bitsong/bundle.ts @@ -1,16 +1,16 @@ import * as _11 from "./fantoken/v1beta1/tx"; -import * as _373 from "./fantoken/v1beta1/tx.amino"; -import * as _374 from "./fantoken/v1beta1/tx.registry"; -import * as _375 from "./fantoken/v1beta1/tx.rpc.msg"; -import * as _626 from "./rpc.tx"; +import * as _378 from "./fantoken/v1beta1/tx.amino"; +import * as _379 from "./fantoken/v1beta1/tx.registry"; +import * as _380 from "./fantoken/v1beta1/tx.rpc.msg"; +import * as _635 from "./rpc.tx"; export namespace bitsong { export const fantoken = { ..._11, - ..._373, - ..._374, - ..._375 + ..._378, + ..._379, + ..._380 }; export const ClientFactory = { - ..._626 + ..._635 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/circle/bundle.ts b/packages/types/protobuf/codegen/circle/bundle.ts index 606d608b8..42021b654 100644 --- a/packages/types/protobuf/codegen/circle/bundle.ts +++ b/packages/types/protobuf/codegen/circle/bundle.ts @@ -14,12 +14,12 @@ import * as _24 from "./cctp/v1/sending_and_receiving_messages_paused"; import * as _25 from "./cctp/v1/signature_threshold"; import * as _26 from "./cctp/v1/token_pair"; import * as _27 from "./cctp/v1/tx"; -import * as _376 from "./cctp/v1/tx.amino"; -import * as _377 from "./cctp/v1/tx.registry"; -import * as _378 from "./cctp/v1/query.rpc.Query"; -import * as _379 from "./cctp/v1/tx.rpc.msg"; -import * as _627 from "./rpc.query"; -import * as _628 from "./rpc.tx"; +import * as _381 from "./cctp/v1/tx.amino"; +import * as _382 from "./cctp/v1/tx.registry"; +import * as _383 from "./cctp/v1/query.rpc.Query"; +import * as _384 from "./cctp/v1/tx.rpc.msg"; +import * as _636 from "./rpc.query"; +import * as _637 from "./rpc.tx"; export namespace circle { export namespace cctp { export const v1 = { @@ -39,14 +39,14 @@ export namespace circle { ..._25, ..._26, ..._27, - ..._376, - ..._377, - ..._378, - ..._379 + ..._381, + ..._382, + ..._383, + ..._384 }; } export const ClientFactory = { - ..._627, - ..._628 + ..._636, + ..._637 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/bundle.ts b/packages/types/protobuf/codegen/cosmos/bundle.ts index 4613157a4..5716d1a07 100644 --- a/packages/types/protobuf/codegen/cosmos/bundle.ts +++ b/packages/types/protobuf/codegen/cosmos/bundle.ts @@ -60,55 +60,55 @@ import * as _87 from "./tx/v1beta1/tx"; import * as _88 from "./upgrade/v1beta1/query"; import * as _89 from "./upgrade/v1beta1/tx"; import * as _90 from "./upgrade/v1beta1/upgrade"; -import * as _380 from "./auth/v1beta1/tx.amino"; -import * as _381 from "./authz/v1beta1/tx.amino"; -import * as _382 from "./bank/v1beta1/tx.amino"; -import * as _383 from "./distribution/v1beta1/tx.amino"; -import * as _384 from "./feegrant/v1beta1/tx.amino"; -import * as _385 from "./gov/v1/tx.amino"; -import * as _386 from "./gov/v1beta1/tx.amino"; -import * as _387 from "./mint/v1beta1/tx.amino"; -import * as _388 from "./slashing/v1beta1/tx.amino"; -import * as _389 from "./staking/v1beta1/tx.amino"; -import * as _390 from "./upgrade/v1beta1/tx.amino"; -import * as _391 from "./auth/v1beta1/tx.registry"; -import * as _392 from "./authz/v1beta1/tx.registry"; -import * as _393 from "./bank/v1beta1/tx.registry"; -import * as _394 from "./distribution/v1beta1/tx.registry"; -import * as _395 from "./feegrant/v1beta1/tx.registry"; -import * as _396 from "./gov/v1/tx.registry"; -import * as _397 from "./gov/v1beta1/tx.registry"; -import * as _398 from "./mint/v1beta1/tx.registry"; -import * as _399 from "./slashing/v1beta1/tx.registry"; -import * as _400 from "./staking/v1beta1/tx.registry"; -import * as _401 from "./upgrade/v1beta1/tx.registry"; -import * as _402 from "./auth/v1beta1/query.rpc.Query"; -import * as _403 from "./authz/v1beta1/query.rpc.Query"; -import * as _404 from "./bank/v1beta1/query.rpc.Query"; -import * as _405 from "./base/tendermint/v1beta1/query.rpc.Service"; -import * as _406 from "./distribution/v1beta1/query.rpc.Query"; -import * as _407 from "./feegrant/v1beta1/query.rpc.Query"; -import * as _408 from "./gov/v1/query.rpc.Query"; -import * as _409 from "./gov/v1beta1/query.rpc.Query"; -import * as _410 from "./mint/v1beta1/query.rpc.Query"; -import * as _411 from "./params/v1beta1/query.rpc.Query"; -import * as _412 from "./slashing/v1beta1/query.rpc.Query"; -import * as _413 from "./staking/v1beta1/query.rpc.Query"; -import * as _414 from "./tx/v1beta1/service.rpc.Service"; -import * as _415 from "./upgrade/v1beta1/query.rpc.Query"; -import * as _416 from "./auth/v1beta1/tx.rpc.msg"; -import * as _417 from "./authz/v1beta1/tx.rpc.msg"; -import * as _418 from "./bank/v1beta1/tx.rpc.msg"; -import * as _419 from "./distribution/v1beta1/tx.rpc.msg"; -import * as _420 from "./feegrant/v1beta1/tx.rpc.msg"; -import * as _421 from "./gov/v1/tx.rpc.msg"; -import * as _422 from "./gov/v1beta1/tx.rpc.msg"; -import * as _423 from "./mint/v1beta1/tx.rpc.msg"; -import * as _424 from "./slashing/v1beta1/tx.rpc.msg"; -import * as _425 from "./staking/v1beta1/tx.rpc.msg"; -import * as _426 from "./upgrade/v1beta1/tx.rpc.msg"; -import * as _629 from "./rpc.query"; -import * as _630 from "./rpc.tx"; +import * as _385 from "./auth/v1beta1/tx.amino"; +import * as _386 from "./authz/v1beta1/tx.amino"; +import * as _387 from "./bank/v1beta1/tx.amino"; +import * as _388 from "./distribution/v1beta1/tx.amino"; +import * as _389 from "./feegrant/v1beta1/tx.amino"; +import * as _390 from "./gov/v1/tx.amino"; +import * as _391 from "./gov/v1beta1/tx.amino"; +import * as _392 from "./mint/v1beta1/tx.amino"; +import * as _393 from "./slashing/v1beta1/tx.amino"; +import * as _394 from "./staking/v1beta1/tx.amino"; +import * as _395 from "./upgrade/v1beta1/tx.amino"; +import * as _396 from "./auth/v1beta1/tx.registry"; +import * as _397 from "./authz/v1beta1/tx.registry"; +import * as _398 from "./bank/v1beta1/tx.registry"; +import * as _399 from "./distribution/v1beta1/tx.registry"; +import * as _400 from "./feegrant/v1beta1/tx.registry"; +import * as _401 from "./gov/v1/tx.registry"; +import * as _402 from "./gov/v1beta1/tx.registry"; +import * as _403 from "./mint/v1beta1/tx.registry"; +import * as _404 from "./slashing/v1beta1/tx.registry"; +import * as _405 from "./staking/v1beta1/tx.registry"; +import * as _406 from "./upgrade/v1beta1/tx.registry"; +import * as _407 from "./auth/v1beta1/query.rpc.Query"; +import * as _408 from "./authz/v1beta1/query.rpc.Query"; +import * as _409 from "./bank/v1beta1/query.rpc.Query"; +import * as _410 from "./base/tendermint/v1beta1/query.rpc.Service"; +import * as _411 from "./distribution/v1beta1/query.rpc.Query"; +import * as _412 from "./feegrant/v1beta1/query.rpc.Query"; +import * as _413 from "./gov/v1/query.rpc.Query"; +import * as _414 from "./gov/v1beta1/query.rpc.Query"; +import * as _415 from "./mint/v1beta1/query.rpc.Query"; +import * as _416 from "./params/v1beta1/query.rpc.Query"; +import * as _417 from "./slashing/v1beta1/query.rpc.Query"; +import * as _418 from "./staking/v1beta1/query.rpc.Query"; +import * as _419 from "./tx/v1beta1/service.rpc.Service"; +import * as _420 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _421 from "./auth/v1beta1/tx.rpc.msg"; +import * as _422 from "./authz/v1beta1/tx.rpc.msg"; +import * as _423 from "./bank/v1beta1/tx.rpc.msg"; +import * as _424 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _425 from "./feegrant/v1beta1/tx.rpc.msg"; +import * as _426 from "./gov/v1/tx.rpc.msg"; +import * as _427 from "./gov/v1beta1/tx.rpc.msg"; +import * as _428 from "./mint/v1beta1/tx.rpc.msg"; +import * as _429 from "./slashing/v1beta1/tx.rpc.msg"; +import * as _430 from "./staking/v1beta1/tx.rpc.msg"; +import * as _431 from "./upgrade/v1beta1/tx.rpc.msg"; +import * as _638 from "./rpc.query"; +import * as _639 from "./rpc.tx"; export namespace cosmos { export namespace auth { export const v1beta1 = { @@ -116,10 +116,10 @@ export namespace cosmos { ..._30, ..._31, ..._32, - ..._380, - ..._391, - ..._402, - ..._416 + ..._385, + ..._396, + ..._407, + ..._421 }; } export namespace authz { @@ -129,10 +129,10 @@ export namespace cosmos { ..._35, ..._36, ..._37, - ..._381, - ..._392, - ..._403, - ..._417 + ..._386, + ..._397, + ..._408, + ..._422 }; } export namespace bank { @@ -142,10 +142,10 @@ export namespace cosmos { ..._40, ..._41, ..._42, - ..._382, - ..._393, - ..._404, - ..._418 + ..._387, + ..._398, + ..._409, + ..._423 }; } export namespace base { @@ -163,7 +163,7 @@ export namespace cosmos { export const v1beta1 = { ..._45, ..._46, - ..._405 + ..._410 }; } export const v1beta1 = { @@ -187,10 +187,10 @@ export namespace cosmos { ..._52, ..._53, ..._54, - ..._383, - ..._394, - ..._406, - ..._419 + ..._388, + ..._399, + ..._411, + ..._424 }; } export namespace feegrant { @@ -199,10 +199,10 @@ export namespace cosmos { ..._56, ..._57, ..._58, - ..._384, - ..._395, - ..._407, - ..._420 + ..._389, + ..._400, + ..._412, + ..._425 }; } export namespace gov { @@ -211,20 +211,20 @@ export namespace cosmos { ..._60, ..._61, ..._62, - ..._385, - ..._396, - ..._408, - ..._421 + ..._390, + ..._401, + ..._413, + ..._426 }; export const v1beta1 = { ..._63, ..._64, ..._65, ..._66, - ..._386, - ..._397, - ..._409, - ..._422 + ..._391, + ..._402, + ..._414, + ..._427 }; } export namespace mint { @@ -233,10 +233,10 @@ export namespace cosmos { ..._68, ..._69, ..._70, - ..._387, - ..._398, - ..._410, - ..._423 + ..._392, + ..._403, + ..._415, + ..._428 }; } export namespace msg { @@ -253,7 +253,7 @@ export namespace cosmos { export const v1beta1 = { ..._73, ..._74, - ..._411 + ..._416 }; } export namespace query { @@ -267,10 +267,10 @@ export namespace cosmos { ..._77, ..._78, ..._79, - ..._388, - ..._399, - ..._412, - ..._424 + ..._393, + ..._404, + ..._417, + ..._429 }; } export namespace staking { @@ -280,10 +280,10 @@ export namespace cosmos { ..._82, ..._83, ..._84, - ..._389, - ..._400, - ..._413, - ..._425 + ..._394, + ..._405, + ..._418, + ..._430 }; } export namespace tx { @@ -295,7 +295,7 @@ export namespace cosmos { export const v1beta1 = { ..._86, ..._87, - ..._414 + ..._419 }; } export namespace upgrade { @@ -303,14 +303,14 @@ export namespace cosmos { ..._88, ..._89, ..._90, - ..._390, - ..._401, - ..._415, - ..._426 + ..._395, + ..._406, + ..._420, + ..._431 }; } export const ClientFactory = { - ..._629, - ..._630 + ..._638, + ..._639 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmwasm/bundle.ts b/packages/types/protobuf/codegen/cosmwasm/bundle.ts index 462214bac..23c2a8244 100644 --- a/packages/types/protobuf/codegen/cosmwasm/bundle.ts +++ b/packages/types/protobuf/codegen/cosmwasm/bundle.ts @@ -10,16 +10,16 @@ import * as _99 from "./wasm/v1/proposal"; import * as _100 from "./wasm/v1/query"; import * as _101 from "./wasm/v1/tx"; import * as _102 from "./wasm/v1/types"; -import * as _427 from "./tokenfactory/v1beta1/tx.amino"; -import * as _428 from "./wasm/v1/tx.amino"; -import * as _429 from "./tokenfactory/v1beta1/tx.registry"; -import * as _430 from "./wasm/v1/tx.registry"; -import * as _431 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _432 from "./wasm/v1/query.rpc.Query"; -import * as _433 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _434 from "./wasm/v1/tx.rpc.msg"; -import * as _631 from "./rpc.query"; -import * as _632 from "./rpc.tx"; +import * as _432 from "./tokenfactory/v1beta1/tx.amino"; +import * as _433 from "./wasm/v1/tx.amino"; +import * as _434 from "./tokenfactory/v1beta1/tx.registry"; +import * as _435 from "./wasm/v1/tx.registry"; +import * as _436 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _437 from "./wasm/v1/query.rpc.Query"; +import * as _438 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _439 from "./wasm/v1/tx.rpc.msg"; +import * as _640 from "./rpc.query"; +import * as _641 from "./rpc.tx"; export namespace cosmwasm { export namespace tokenfactory { export const v1beta1 = { @@ -28,10 +28,10 @@ export namespace cosmwasm { ..._93, ..._94, ..._95, - ..._427, - ..._429, - ..._431, - ..._433 + ..._432, + ..._434, + ..._436, + ..._438 }; } export namespace wasm { @@ -43,14 +43,14 @@ export namespace cosmwasm { ..._100, ..._101, ..._102, - ..._428, - ..._430, - ..._432, - ..._434 + ..._433, + ..._435, + ..._437, + ..._439 }; } export const ClientFactory = { - ..._631, - ..._632 + ..._640, + ..._641 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmwasm/wasm/v1/types.ts b/packages/types/protobuf/codegen/cosmwasm/wasm/v1/types.ts index 2038d7725..2ede42783 100644 --- a/packages/types/protobuf/codegen/cosmwasm/wasm/v1/types.ts +++ b/packages/types/protobuf/codegen/cosmwasm/wasm/v1/types.ts @@ -569,7 +569,7 @@ export const Params = { toAmino(message: Params, useInterfaces: boolean = false): ParamsAmino { const obj: any = {}; obj.code_upload_access = message.codeUploadAccess ? AccessConfig.toAmino(message.codeUploadAccess, useInterfaces) : AccessConfig.fromPartial({}); - obj.instantiate_default_permission = accessTypeToJSON(message.instantiateDefaultPermission); + obj.instantiate_default_permission = message.instantiateDefaultPermission; return obj; }, fromAminoMsg(object: ParamsAminoMsg): Params { diff --git a/packages/types/protobuf/codegen/feemarket/bundle.ts b/packages/types/protobuf/codegen/feemarket/bundle.ts index bccbbb731..996fbc546 100644 --- a/packages/types/protobuf/codegen/feemarket/bundle.ts +++ b/packages/types/protobuf/codegen/feemarket/bundle.ts @@ -2,12 +2,12 @@ import * as _103 from "./feemarket/v1/genesis"; import * as _104 from "./feemarket/v1/params"; import * as _105 from "./feemarket/v1/query"; import * as _106 from "./feemarket/v1/tx"; -import * as _435 from "./feemarket/v1/tx.amino"; -import * as _436 from "./feemarket/v1/tx.registry"; -import * as _437 from "./feemarket/v1/query.rpc.Query"; -import * as _438 from "./feemarket/v1/tx.rpc.msg"; -import * as _633 from "./rpc.query"; -import * as _634 from "./rpc.tx"; +import * as _440 from "./feemarket/v1/tx.amino"; +import * as _441 from "./feemarket/v1/tx.registry"; +import * as _442 from "./feemarket/v1/query.rpc.Query"; +import * as _443 from "./feemarket/v1/tx.rpc.msg"; +import * as _642 from "./rpc.query"; +import * as _643 from "./rpc.tx"; export namespace feemarket { export namespace feemarket { export const v1 = { @@ -15,14 +15,14 @@ export namespace feemarket { ..._104, ..._105, ..._106, - ..._435, - ..._436, - ..._437, - ..._438 + ..._440, + ..._441, + ..._442, + ..._443 }; } export const ClientFactory = { - ..._633, - ..._634 + ..._642, + ..._643 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/gaia/bundle.ts b/packages/types/protobuf/codegen/gaia/bundle.ts index 4811e38b3..9cd516d97 100644 --- a/packages/types/protobuf/codegen/gaia/bundle.ts +++ b/packages/types/protobuf/codegen/gaia/bundle.ts @@ -1,26 +1,26 @@ import * as _107 from "./globalfee/v1beta1/genesis"; import * as _108 from "./globalfee/v1beta1/query"; import * as _109 from "./globalfee/v1beta1/tx"; -import * as _439 from "./globalfee/v1beta1/tx.amino"; -import * as _440 from "./globalfee/v1beta1/tx.registry"; -import * as _441 from "./globalfee/v1beta1/query.rpc.Query"; -import * as _442 from "./globalfee/v1beta1/tx.rpc.msg"; -import * as _635 from "./rpc.query"; -import * as _636 from "./rpc.tx"; +import * as _444 from "./globalfee/v1beta1/tx.amino"; +import * as _445 from "./globalfee/v1beta1/tx.registry"; +import * as _446 from "./globalfee/v1beta1/query.rpc.Query"; +import * as _447 from "./globalfee/v1beta1/tx.rpc.msg"; +import * as _644 from "./rpc.query"; +import * as _645 from "./rpc.tx"; export namespace gaia { export namespace globalfee { export const v1beta1 = { ..._107, ..._108, ..._109, - ..._439, - ..._440, - ..._441, - ..._442 + ..._444, + ..._445, + ..._446, + ..._447 }; } export const ClientFactory = { - ..._635, - ..._636 + ..._644, + ..._645 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/bundle.ts b/packages/types/protobuf/codegen/ibc/bundle.ts index 5d1baf6df..0a9b04b79 100644 --- a/packages/types/protobuf/codegen/ibc/bundle.ts +++ b/packages/types/protobuf/codegen/ibc/bundle.ts @@ -20,28 +20,28 @@ import * as _136 from "./core/client/v1/client"; import * as _137 from "./core/client/v1/genesis"; import * as _138 from "./core/client/v1/query"; import * as _139 from "./core/client/v1/tx"; -import * as _443 from "./applications/interchain_accounts/controller/v1/tx.amino"; -import * as _444 from "./applications/interchain_accounts/host/v1/tx.amino"; -import * as _445 from "./applications/transfer/v1/tx.amino"; -import * as _446 from "./core/channel/v1/tx.amino"; -import * as _447 from "./core/client/v1/tx.amino"; -import * as _448 from "./applications/interchain_accounts/controller/v1/tx.registry"; -import * as _449 from "./applications/interchain_accounts/host/v1/tx.registry"; -import * as _450 from "./applications/transfer/v1/tx.registry"; -import * as _451 from "./core/channel/v1/tx.registry"; -import * as _452 from "./core/client/v1/tx.registry"; -import * as _453 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; -import * as _454 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; -import * as _455 from "./applications/transfer/v1/query.rpc.Query"; -import * as _456 from "./core/channel/v1/query.rpc.Query"; -import * as _457 from "./core/client/v1/query.rpc.Query"; -import * as _458 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; -import * as _459 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; -import * as _460 from "./applications/transfer/v1/tx.rpc.msg"; -import * as _461 from "./core/channel/v1/tx.rpc.msg"; -import * as _462 from "./core/client/v1/tx.rpc.msg"; -import * as _637 from "./rpc.query"; -import * as _638 from "./rpc.tx"; +import * as _448 from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as _449 from "./applications/interchain_accounts/host/v1/tx.amino"; +import * as _450 from "./applications/transfer/v1/tx.amino"; +import * as _451 from "./core/channel/v1/tx.amino"; +import * as _452 from "./core/client/v1/tx.amino"; +import * as _453 from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as _454 from "./applications/interchain_accounts/host/v1/tx.registry"; +import * as _455 from "./applications/transfer/v1/tx.registry"; +import * as _456 from "./core/channel/v1/tx.registry"; +import * as _457 from "./core/client/v1/tx.registry"; +import * as _458 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; +import * as _459 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; +import * as _460 from "./applications/transfer/v1/query.rpc.Query"; +import * as _461 from "./core/channel/v1/query.rpc.Query"; +import * as _462 from "./core/client/v1/query.rpc.Query"; +import * as _463 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; +import * as _464 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; +import * as _465 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _466 from "./core/channel/v1/tx.rpc.msg"; +import * as _467 from "./core/client/v1/tx.rpc.msg"; +import * as _646 from "./rpc.query"; +import * as _647 from "./rpc.tx"; export namespace ibc { export namespace applications { export namespace interchain_accounts { @@ -50,10 +50,10 @@ export namespace ibc { ..._118, ..._119, ..._120, - ..._443, ..._448, ..._453, - ..._458 + ..._458, + ..._463 }; } export namespace host { @@ -61,10 +61,10 @@ export namespace ibc { ..._121, ..._122, ..._123, - ..._444, ..._449, ..._454, - ..._459 + ..._459, + ..._464 }; } export const v1 = { @@ -80,10 +80,10 @@ export namespace ibc { ..._129, ..._130, ..._131, - ..._445, ..._450, ..._455, - ..._460 + ..._460, + ..._465 }; } } @@ -94,10 +94,10 @@ export namespace ibc { ..._133, ..._134, ..._135, - ..._446, ..._451, ..._456, - ..._461 + ..._461, + ..._466 }; } export namespace client { @@ -106,15 +106,15 @@ export namespace ibc { ..._137, ..._138, ..._139, - ..._447, ..._452, ..._457, - ..._462 + ..._462, + ..._467 }; } } export const ClientFactory = { - ..._637, - ..._638 + ..._646, + ..._647 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/index.ts b/packages/types/protobuf/codegen/index.ts index 33d823734..34823bc2d 100644 --- a/packages/types/protobuf/codegen/index.ts +++ b/packages/types/protobuf/codegen/index.ts @@ -30,6 +30,8 @@ export * from "./kujira/bundle"; export * from "./kujira/client"; export * from "./neutron/bundle"; export * from "./neutron/client"; +export * from "./OmniFlix/bundle"; +export * from "./OmniFlix/client"; export * from "./osmosis/bundle"; export * from "./osmosis/client"; export * from "./pstake/bundle"; diff --git a/packages/types/protobuf/codegen/juno/bundle.ts b/packages/types/protobuf/codegen/juno/bundle.ts index 587058688..44efc3572 100644 --- a/packages/types/protobuf/codegen/juno/bundle.ts +++ b/packages/types/protobuf/codegen/juno/bundle.ts @@ -6,16 +6,16 @@ import * as _144 from "./mint/genesis"; import * as _145 from "./mint/mint"; import * as _146 from "./mint/query"; import * as _147 from "./mint/tx"; -import * as _463 from "./feeshare/v1/tx.amino"; -import * as _464 from "./mint/tx.amino"; -import * as _465 from "./feeshare/v1/tx.registry"; -import * as _466 from "./mint/tx.registry"; -import * as _467 from "./feeshare/v1/query.rpc.Query"; -import * as _468 from "./mint/query.rpc.Query"; -import * as _469 from "./feeshare/v1/tx.rpc.msg"; -import * as _470 from "./mint/tx.rpc.msg"; -import * as _639 from "./rpc.query"; -import * as _640 from "./rpc.tx"; +import * as _468 from "./feeshare/v1/tx.amino"; +import * as _469 from "./mint/tx.amino"; +import * as _470 from "./feeshare/v1/tx.registry"; +import * as _471 from "./mint/tx.registry"; +import * as _472 from "./feeshare/v1/query.rpc.Query"; +import * as _473 from "./mint/query.rpc.Query"; +import * as _474 from "./feeshare/v1/tx.rpc.msg"; +import * as _475 from "./mint/tx.rpc.msg"; +import * as _648 from "./rpc.query"; +import * as _649 from "./rpc.tx"; export namespace juno { export namespace feeshare { export const v1 = { @@ -23,10 +23,10 @@ export namespace juno { ..._141, ..._142, ..._143, - ..._463, - ..._465, - ..._467, - ..._469 + ..._468, + ..._470, + ..._472, + ..._474 }; } export const mint = { @@ -34,13 +34,13 @@ export namespace juno { ..._145, ..._146, ..._147, - ..._464, - ..._466, - ..._468, - ..._470 + ..._469, + ..._471, + ..._473, + ..._475 }; export const ClientFactory = { - ..._639, - ..._640 + ..._648, + ..._649 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/bundle.ts b/packages/types/protobuf/codegen/kujira/bundle.ts index 95969085d..f388802ca 100644 --- a/packages/types/protobuf/codegen/kujira/bundle.ts +++ b/packages/types/protobuf/codegen/kujira/bundle.ts @@ -12,17 +12,17 @@ import * as _158 from "./scheduler/hook"; import * as _159 from "./scheduler/params"; import * as _160 from "./scheduler/proposal"; import * as _161 from "./scheduler/query"; -import * as _471 from "./denom/tx.amino"; -import * as _472 from "./oracle/tx.amino"; -import * as _473 from "./denom/tx.registry"; -import * as _474 from "./oracle/tx.registry"; -import * as _475 from "./denom/query.rpc.Query"; -import * as _476 from "./oracle/query.rpc.Query"; -import * as _477 from "./scheduler/query.rpc.Query"; -import * as _478 from "./denom/tx.rpc.msg"; -import * as _479 from "./oracle/tx.rpc.msg"; -import * as _641 from "./rpc.query"; -import * as _642 from "./rpc.tx"; +import * as _476 from "./denom/tx.amino"; +import * as _477 from "./oracle/tx.amino"; +import * as _478 from "./denom/tx.registry"; +import * as _479 from "./oracle/tx.registry"; +import * as _480 from "./denom/query.rpc.Query"; +import * as _481 from "./oracle/query.rpc.Query"; +import * as _482 from "./scheduler/query.rpc.Query"; +import * as _483 from "./denom/tx.rpc.msg"; +import * as _484 from "./oracle/tx.rpc.msg"; +import * as _650 from "./rpc.query"; +import * as _651 from "./rpc.tx"; export namespace kujira { export const denom = { ..._148, @@ -30,20 +30,20 @@ export namespace kujira { ..._150, ..._151, ..._152, - ..._471, - ..._473, - ..._475, - ..._478 + ..._476, + ..._478, + ..._480, + ..._483 }; export const oracle = { ..._153, ..._154, ..._155, ..._156, - ..._472, - ..._474, - ..._476, - ..._479 + ..._477, + ..._479, + ..._481, + ..._484 }; export const scheduler = { ..._157, @@ -51,10 +51,10 @@ export namespace kujira { ..._159, ..._160, ..._161, - ..._477 + ..._482 }; export const ClientFactory = { - ..._641, - ..._642 + ..._650, + ..._651 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/neutron/bundle.ts b/packages/types/protobuf/codegen/neutron/bundle.ts index 7d3d1d705..7dac8de00 100644 --- a/packages/types/protobuf/codegen/neutron/bundle.ts +++ b/packages/types/protobuf/codegen/neutron/bundle.ts @@ -36,32 +36,32 @@ import * as _196 from "./interchaintxs/v1/genesis"; import * as _197 from "./interchaintxs/v1/params"; import * as _198 from "./interchaintxs/v1/query"; import * as _199 from "./interchaintxs/v1/tx"; -import * as _480 from "./cron/tx.amino"; -import * as _481 from "./dex/tx.amino"; -import * as _482 from "./feeburner/tx.amino"; -import * as _483 from "./feerefunder/tx.amino"; -import * as _484 from "./interchainqueries/tx.amino"; -import * as _485 from "./interchaintxs/v1/tx.amino"; -import * as _486 from "./cron/tx.registry"; -import * as _487 from "./dex/tx.registry"; -import * as _488 from "./feeburner/tx.registry"; -import * as _489 from "./feerefunder/tx.registry"; -import * as _490 from "./interchainqueries/tx.registry"; -import * as _491 from "./interchaintxs/v1/tx.registry"; -import * as _492 from "./cron/query.rpc.Query"; -import * as _493 from "./dex/query.rpc.Query"; -import * as _494 from "./feeburner/query.rpc.Query"; -import * as _495 from "./feerefunder/query.rpc.Query"; -import * as _496 from "./interchainqueries/query.rpc.Query"; -import * as _497 from "./interchaintxs/v1/query.rpc.Query"; -import * as _498 from "./cron/tx.rpc.msg"; -import * as _499 from "./dex/tx.rpc.msg"; -import * as _500 from "./feeburner/tx.rpc.msg"; -import * as _501 from "./feerefunder/tx.rpc.msg"; -import * as _502 from "./interchainqueries/tx.rpc.msg"; -import * as _503 from "./interchaintxs/v1/tx.rpc.msg"; -import * as _643 from "./rpc.query"; -import * as _644 from "./rpc.tx"; +import * as _485 from "./cron/tx.amino"; +import * as _486 from "./dex/tx.amino"; +import * as _487 from "./feeburner/tx.amino"; +import * as _488 from "./feerefunder/tx.amino"; +import * as _489 from "./interchainqueries/tx.amino"; +import * as _490 from "./interchaintxs/v1/tx.amino"; +import * as _491 from "./cron/tx.registry"; +import * as _492 from "./dex/tx.registry"; +import * as _493 from "./feeburner/tx.registry"; +import * as _494 from "./feerefunder/tx.registry"; +import * as _495 from "./interchainqueries/tx.registry"; +import * as _496 from "./interchaintxs/v1/tx.registry"; +import * as _497 from "./cron/query.rpc.Query"; +import * as _498 from "./dex/query.rpc.Query"; +import * as _499 from "./feeburner/query.rpc.Query"; +import * as _500 from "./feerefunder/query.rpc.Query"; +import * as _501 from "./interchainqueries/query.rpc.Query"; +import * as _502 from "./interchaintxs/v1/query.rpc.Query"; +import * as _503 from "./cron/tx.rpc.msg"; +import * as _504 from "./dex/tx.rpc.msg"; +import * as _505 from "./feeburner/tx.rpc.msg"; +import * as _506 from "./feerefunder/tx.rpc.msg"; +import * as _507 from "./interchainqueries/tx.rpc.msg"; +import * as _508 from "./interchaintxs/v1/tx.rpc.msg"; +import * as _652 from "./rpc.query"; +import * as _653 from "./rpc.tx"; export namespace neutron { export namespace contractmanager { export const v1 = { @@ -74,10 +74,10 @@ export namespace neutron { ..._165, ..._166, ..._167, - ..._480, - ..._486, - ..._492, - ..._498 + ..._485, + ..._491, + ..._497, + ..._503 }; export const dex = { ..._168, @@ -94,10 +94,10 @@ export namespace neutron { ..._179, ..._180, ..._181, - ..._481, - ..._487, - ..._493, - ..._499 + ..._486, + ..._492, + ..._498, + ..._504 }; export const feeburner = { ..._182, @@ -105,10 +105,10 @@ export namespace neutron { ..._184, ..._185, ..._186, - ..._482, - ..._488, - ..._494, - ..._500 + ..._487, + ..._493, + ..._499, + ..._505 }; export const feerefunder = { ..._187, @@ -116,20 +116,20 @@ export namespace neutron { ..._189, ..._190, ..._191, - ..._483, - ..._489, - ..._495, - ..._501 + ..._488, + ..._494, + ..._500, + ..._506 }; export const interchainqueries = { ..._192, ..._193, ..._194, ..._195, - ..._484, - ..._490, - ..._496, - ..._502 + ..._489, + ..._495, + ..._501, + ..._507 }; export namespace interchaintxs { export const v1 = { @@ -137,14 +137,14 @@ export namespace neutron { ..._197, ..._198, ..._199, - ..._485, - ..._491, - ..._497, - ..._503 + ..._490, + ..._496, + ..._502, + ..._508 }; } export const ClientFactory = { - ..._643, - ..._644 + ..._652, + ..._653 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/noble/bundle.ts b/packages/types/protobuf/codegen/noble/bundle.ts index 6b12c7bd2..f4d52a715 100644 --- a/packages/types/protobuf/codegen/noble/bundle.ts +++ b/packages/types/protobuf/codegen/noble/bundle.ts @@ -1,16 +1,16 @@ -import * as _356 from "../tariff/genesis"; -import * as _357 from "../tariff/params"; -import * as _358 from "../tariff/query"; -import * as _623 from "../tariff/query.rpc.Query"; -import * as _655 from "./rpc.query"; +import * as _361 from "../tariff/genesis"; +import * as _362 from "../tariff/params"; +import * as _363 from "../tariff/query"; +import * as _632 from "../tariff/query.rpc.Query"; +import * as _666 from "./rpc.query"; export namespace noble { export const tariff = { - ..._356, - ..._357, - ..._358, - ..._623 + ..._361, + ..._362, + ..._363, + ..._632 }; export const ClientFactory = { - ..._655 + ..._666 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/bundle.ts b/packages/types/protobuf/codegen/osmosis/bundle.ts index b5429427a..c1c6cacff 100644 --- a/packages/types/protobuf/codegen/osmosis/bundle.ts +++ b/packages/types/protobuf/codegen/osmosis/bundle.ts @@ -1,167 +1,162 @@ -import * as _200 from "./accum/v1beta1/accum"; -import * as _201 from "./concentratedliquidity/params"; -import * as _202 from "./cosmwasmpool/v1beta1/genesis"; -import * as _203 from "./cosmwasmpool/v1beta1/gov"; -import * as _204 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; -import * as _205 from "./cosmwasmpool/v1beta1/model/module_query_msg"; -import * as _206 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; -import * as _207 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; -import * as _208 from "./cosmwasmpool/v1beta1/model/pool"; -import * as _209 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; -import * as _210 from "./cosmwasmpool/v1beta1/model/tx"; -import * as _211 from "./cosmwasmpool/v1beta1/params"; -import * as _212 from "./cosmwasmpool/v1beta1/query"; -import * as _213 from "./cosmwasmpool/v1beta1/tx"; -import * as _214 from "./gamm/pool-models/balancer/balancerPool"; -import * as _215 from "./gamm/v1beta1/genesis"; -import * as _216 from "./gamm/v1beta1/gov"; -import * as _217 from "./gamm/v1beta1/query"; -import * as _218 from "./gamm/v1beta1/shared"; -import * as _219 from "./gamm/v1beta1/tx"; -import * as _220 from "./gamm/pool-models/balancer/tx/tx"; -import * as _221 from "./gamm/pool-models/stableswap/stableswap_pool"; -import * as _222 from "./gamm/pool-models/stableswap/tx"; -import * as _223 from "./incentives/gauge"; -import * as _224 from "./incentives/genesis"; -import * as _225 from "./incentives/gov"; -import * as _226 from "./incentives/group"; -import * as _227 from "./incentives/params"; -import * as _228 from "./incentives/query"; -import * as _229 from "./incentives/tx"; -import * as _230 from "./lockup/genesis"; -import * as _231 from "./lockup/lock"; -import * as _232 from "./lockup/params"; -import * as _233 from "./lockup/query"; -import * as _234 from "./lockup/tx"; -import * as _235 from "./pool-incentives/v1beta1/genesis"; -import * as _236 from "./pool-incentives/v1beta1/gov"; -import * as _237 from "./pool-incentives/v1beta1/incentives"; -import * as _238 from "./pool-incentives/v1beta1/query"; -import * as _239 from "./pool-incentives/v1beta1/shared"; -import * as _240 from "./poolmanager/v1beta1/genesis"; -import * as _241 from "./poolmanager/v1beta1/gov"; -import * as _242 from "./poolmanager/v1beta1/module_route"; -import * as _243 from "./poolmanager/v1beta1/query"; -import * as _244 from "./poolmanager/v1beta1/swap_route"; -import * as _245 from "./poolmanager/v1beta1/tx"; -import * as _246 from "./protorev/v1beta1/genesis"; -import * as _247 from "./protorev/v1beta1/gov"; -import * as _248 from "./protorev/v1beta1/params"; -import * as _249 from "./protorev/v1beta1/protorev"; -import * as _250 from "./protorev/v1beta1/query"; -import * as _251 from "./protorev/v1beta1/tx"; -import * as _252 from "./smartaccount/v1beta1/genesis"; -import * as _253 from "./smartaccount/v1beta1/models"; -import * as _254 from "./smartaccount/v1beta1/params"; -import * as _255 from "./smartaccount/v1beta1/query"; -import * as _256 from "./smartaccount/v1beta1/tx"; -import * as _257 from "./superfluid/genesis"; -import * as _258 from "./superfluid/params"; -import * as _259 from "./superfluid/query"; -import * as _260 from "./superfluid/superfluid"; -import * as _261 from "./superfluid/tx"; -import * as _262 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _263 from "./tokenfactory/v1beta1/genesis"; -import * as _264 from "./tokenfactory/v1beta1/params"; -import * as _265 from "./tokenfactory/v1beta1/query"; -import * as _266 from "./tokenfactory/v1beta1/tx"; -import * as _267 from "./txfees/v1beta1/feetoken"; -import * as _268 from "./txfees/v1beta1/genesis"; -import * as _269 from "./txfees/v1beta1/gov"; -import * as _270 from "./txfees/v1beta1/params"; -import * as _271 from "./txfees/v1beta1/query"; -import * as _272 from "./txfees/v1beta1/tx"; -import * as _273 from "./valset-pref/v1beta1/query"; -import * as _274 from "./valset-pref/v1beta1/state"; -import * as _275 from "./valset-pref/v1beta1/tx"; -import * as _504 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; -import * as _505 from "./concentratedliquidity/v1beta1/tx.amino"; -import * as _506 from "./gamm/pool-models/balancer/tx/tx.amino"; -import * as _507 from "./gamm/pool-models/stableswap/tx.amino"; -import * as _508 from "./gamm/v1beta1/tx.amino"; -import * as _509 from "./incentives/tx.amino"; -import * as _510 from "./lockup/tx.amino"; -import * as _511 from "./poolmanager/v1beta1/tx.amino"; -import * as _512 from "./protorev/v1beta1/tx.amino"; -import * as _513 from "./smartaccount/v1beta1/tx.amino"; -import * as _514 from "./superfluid/tx.amino"; -import * as _515 from "./tokenfactory/v1beta1/tx.amino"; -import * as _516 from "./txfees/v1beta1/tx.amino"; -import * as _517 from "./valset-pref/v1beta1/tx.amino"; -import * as _518 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; -import * as _519 from "./concentratedliquidity/v1beta1/tx.registry"; -import * as _520 from "./gamm/pool-models/balancer/tx/tx.registry"; -import * as _521 from "./gamm/pool-models/stableswap/tx.registry"; -import * as _522 from "./gamm/v1beta1/tx.registry"; -import * as _523 from "./incentives/tx.registry"; -import * as _524 from "./lockup/tx.registry"; -import * as _525 from "./poolmanager/v1beta1/tx.registry"; -import * as _526 from "./protorev/v1beta1/tx.registry"; -import * as _527 from "./smartaccount/v1beta1/tx.registry"; -import * as _528 from "./superfluid/tx.registry"; -import * as _529 from "./tokenfactory/v1beta1/tx.registry"; -import * as _530 from "./txfees/v1beta1/tx.registry"; -import * as _531 from "./valset-pref/v1beta1/tx.registry"; -import * as _532 from "./concentratedliquidity/v1beta1/query.rpc.Query"; -import * as _533 from "./cosmwasmpool/v1beta1/query.rpc.Query"; -import * as _534 from "./gamm/v1beta1/query.rpc.Query"; -import * as _535 from "./incentives/query.rpc.Query"; -import * as _536 from "./lockup/query.rpc.Query"; -import * as _537 from "./pool-incentives/v1beta1/query.rpc.Query"; -import * as _538 from "./poolmanager/v1beta1/query.rpc.Query"; -import * as _539 from "./protorev/v1beta1/query.rpc.Query"; -import * as _540 from "./smartaccount/v1beta1/query.rpc.Query"; -import * as _541 from "./superfluid/query.rpc.Query"; -import * as _542 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _543 from "./txfees/v1beta1/query.rpc.Query"; -import * as _544 from "./valset-pref/v1beta1/query.rpc.Query"; -import * as _545 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; -import * as _546 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; -import * as _547 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; -import * as _548 from "./gamm/pool-models/stableswap/tx.rpc.msg"; -import * as _549 from "./gamm/v1beta1/tx.rpc.msg"; -import * as _550 from "./incentives/tx.rpc.msg"; -import * as _551 from "./lockup/tx.rpc.msg"; -import * as _552 from "./poolmanager/v1beta1/tx.rpc.msg"; -import * as _553 from "./protorev/v1beta1/tx.rpc.msg"; -import * as _554 from "./smartaccount/v1beta1/tx.rpc.msg"; -import * as _555 from "./superfluid/tx.rpc.msg"; -import * as _556 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _557 from "./txfees/v1beta1/tx.rpc.msg"; -import * as _558 from "./valset-pref/v1beta1/tx.rpc.msg"; -import * as _645 from "./rpc.query"; -import * as _646 from "./rpc.tx"; +import * as _205 from "./accum/v1beta1/accum"; +import * as _206 from "./concentratedliquidity/params"; +import * as _207 from "./cosmwasmpool/v1beta1/genesis"; +import * as _208 from "./cosmwasmpool/v1beta1/gov"; +import * as _209 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; +import * as _210 from "./cosmwasmpool/v1beta1/model/module_query_msg"; +import * as _211 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; +import * as _212 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; +import * as _213 from "./cosmwasmpool/v1beta1/model/pool"; +import * as _214 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; +import * as _215 from "./cosmwasmpool/v1beta1/model/tx"; +import * as _216 from "./cosmwasmpool/v1beta1/params"; +import * as _217 from "./cosmwasmpool/v1beta1/query"; +import * as _218 from "./cosmwasmpool/v1beta1/tx"; +import * as _219 from "./gamm/pool-models/balancer/balancerPool"; +import * as _220 from "./gamm/v1beta1/genesis"; +import * as _221 from "./gamm/v1beta1/gov"; +import * as _222 from "./gamm/v1beta1/query"; +import * as _223 from "./gamm/v1beta1/shared"; +import * as _224 from "./gamm/v1beta1/tx"; +import * as _225 from "./gamm/pool-models/balancer/tx/tx"; +import * as _226 from "./gamm/pool-models/stableswap/stableswap_pool"; +import * as _227 from "./gamm/pool-models/stableswap/tx"; +import * as _228 from "./incentives/gauge"; +import * as _229 from "./incentives/genesis"; +import * as _230 from "./incentives/gov"; +import * as _231 from "./incentives/group"; +import * as _232 from "./incentives/params"; +import * as _233 from "./incentives/query"; +import * as _234 from "./incentives/tx"; +import * as _235 from "./lockup/genesis"; +import * as _236 from "./lockup/lock"; +import * as _237 from "./lockup/params"; +import * as _238 from "./lockup/query"; +import * as _239 from "./lockup/tx"; +import * as _240 from "./pool-incentives/v1beta1/genesis"; +import * as _241 from "./pool-incentives/v1beta1/gov"; +import * as _242 from "./pool-incentives/v1beta1/incentives"; +import * as _243 from "./pool-incentives/v1beta1/query"; +import * as _244 from "./pool-incentives/v1beta1/shared"; +import * as _245 from "./poolmanager/v1beta1/genesis"; +import * as _246 from "./poolmanager/v1beta1/gov"; +import * as _247 from "./poolmanager/v1beta1/module_route"; +import * as _248 from "./poolmanager/v1beta1/query"; +import * as _249 from "./poolmanager/v1beta1/swap_route"; +import * as _250 from "./poolmanager/v1beta1/tx"; +import * as _251 from "./protorev/v1beta1/genesis"; +import * as _252 from "./protorev/v1beta1/gov"; +import * as _253 from "./protorev/v1beta1/params"; +import * as _254 from "./protorev/v1beta1/protorev"; +import * as _255 from "./protorev/v1beta1/query"; +import * as _256 from "./protorev/v1beta1/tx"; +import * as _257 from "./smartaccount/v1beta1/genesis"; +import * as _258 from "./smartaccount/v1beta1/models"; +import * as _259 from "./smartaccount/v1beta1/params"; +import * as _260 from "./smartaccount/v1beta1/query"; +import * as _261 from "./smartaccount/v1beta1/tx"; +import * as _262 from "./superfluid/genesis"; +import * as _263 from "./superfluid/params"; +import * as _264 from "./superfluid/query"; +import * as _265 from "./superfluid/superfluid"; +import * as _266 from "./superfluid/tx"; +import * as _267 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _268 from "./tokenfactory/v1beta1/genesis"; +import * as _269 from "./tokenfactory/v1beta1/params"; +import * as _270 from "./tokenfactory/v1beta1/query"; +import * as _271 from "./tokenfactory/v1beta1/tx"; +import * as _272 from "./txfees/v1beta1/feetoken"; +import * as _273 from "./txfees/v1beta1/genesis"; +import * as _274 from "./txfees/v1beta1/gov"; +import * as _275 from "./txfees/v1beta1/params"; +import * as _276 from "./txfees/v1beta1/query"; +import * as _277 from "./txfees/v1beta1/tx"; +import * as _278 from "./valset-pref/v1beta1/query"; +import * as _279 from "./valset-pref/v1beta1/state"; +import * as _280 from "./valset-pref/v1beta1/tx"; +import * as _513 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; +import * as _514 from "./concentratedliquidity/v1beta1/tx.amino"; +import * as _515 from "./gamm/pool-models/balancer/tx/tx.amino"; +import * as _516 from "./gamm/pool-models/stableswap/tx.amino"; +import * as _517 from "./gamm/v1beta1/tx.amino"; +import * as _518 from "./incentives/tx.amino"; +import * as _519 from "./lockup/tx.amino"; +import * as _520 from "./poolmanager/v1beta1/tx.amino"; +import * as _521 from "./protorev/v1beta1/tx.amino"; +import * as _522 from "./smartaccount/v1beta1/tx.amino"; +import * as _523 from "./superfluid/tx.amino"; +import * as _524 from "./tokenfactory/v1beta1/tx.amino"; +import * as _525 from "./txfees/v1beta1/tx.amino"; +import * as _526 from "./valset-pref/v1beta1/tx.amino"; +import * as _527 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; +import * as _528 from "./concentratedliquidity/v1beta1/tx.registry"; +import * as _529 from "./gamm/pool-models/balancer/tx/tx.registry"; +import * as _530 from "./gamm/pool-models/stableswap/tx.registry"; +import * as _531 from "./gamm/v1beta1/tx.registry"; +import * as _532 from "./incentives/tx.registry"; +import * as _533 from "./lockup/tx.registry"; +import * as _534 from "./poolmanager/v1beta1/tx.registry"; +import * as _535 from "./protorev/v1beta1/tx.registry"; +import * as _536 from "./smartaccount/v1beta1/tx.registry"; +import * as _537 from "./superfluid/tx.registry"; +import * as _538 from "./tokenfactory/v1beta1/tx.registry"; +import * as _539 from "./txfees/v1beta1/tx.registry"; +import * as _540 from "./valset-pref/v1beta1/tx.registry"; +import * as _541 from "./concentratedliquidity/v1beta1/query.rpc.Query"; +import * as _542 from "./cosmwasmpool/v1beta1/query.rpc.Query"; +import * as _543 from "./gamm/v1beta1/query.rpc.Query"; +import * as _544 from "./incentives/query.rpc.Query"; +import * as _545 from "./lockup/query.rpc.Query"; +import * as _546 from "./pool-incentives/v1beta1/query.rpc.Query"; +import * as _547 from "./poolmanager/v1beta1/query.rpc.Query"; +import * as _548 from "./protorev/v1beta1/query.rpc.Query"; +import * as _549 from "./smartaccount/v1beta1/query.rpc.Query"; +import * as _550 from "./superfluid/query.rpc.Query"; +import * as _551 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _552 from "./txfees/v1beta1/query.rpc.Query"; +import * as _553 from "./valset-pref/v1beta1/query.rpc.Query"; +import * as _554 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; +import * as _555 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; +import * as _556 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; +import * as _557 from "./gamm/pool-models/stableswap/tx.rpc.msg"; +import * as _558 from "./gamm/v1beta1/tx.rpc.msg"; +import * as _559 from "./incentives/tx.rpc.msg"; +import * as _560 from "./lockup/tx.rpc.msg"; +import * as _561 from "./poolmanager/v1beta1/tx.rpc.msg"; +import * as _562 from "./protorev/v1beta1/tx.rpc.msg"; +import * as _563 from "./smartaccount/v1beta1/tx.rpc.msg"; +import * as _564 from "./superfluid/tx.rpc.msg"; +import * as _565 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _566 from "./txfees/v1beta1/tx.rpc.msg"; +import * as _567 from "./valset-pref/v1beta1/tx.rpc.msg"; +import * as _656 from "./rpc.query"; +import * as _657 from "./rpc.tx"; export namespace osmosis { export namespace accum { export const v1beta1 = { - ..._200 + ..._205 }; } export const concentratedliquidity = { - ..._201, + ..._206, poolmodel: { concentrated: { v1beta1: { - ..._504, - ..._518, - ..._545 + ..._513, + ..._527, + ..._554 } } }, v1beta1: { - ..._505, - ..._519, - ..._532, - ..._546 + ..._514, + ..._528, + ..._541, + ..._555 } }; export namespace cosmwasmpool { export const v1beta1 = { - ..._202, - ..._203, - ..._204, - ..._205, - ..._206, ..._207, ..._208, ..._209, @@ -169,168 +164,173 @@ export namespace osmosis { ..._211, ..._212, ..._213, - ..._533 - }; - } - export namespace gamm { - export const v1beta1 = { ..._214, ..._215, ..._216, ..._217, ..._218, + ..._542 + }; + } + export namespace gamm { + export const v1beta1 = { ..._219, - ..._508, - ..._522, - ..._534, - ..._549 + ..._220, + ..._221, + ..._222, + ..._223, + ..._224, + ..._517, + ..._531, + ..._543, + ..._558 }; export namespace poolmodels { export namespace balancer { export const v1beta1 = { - ..._220, - ..._506, - ..._520, - ..._547 + ..._225, + ..._515, + ..._529, + ..._556 }; } export namespace stableswap { export const v1beta1 = { - ..._221, - ..._222, - ..._507, - ..._521, - ..._548 + ..._226, + ..._227, + ..._516, + ..._530, + ..._557 }; } } } export const incentives = { - ..._223, - ..._224, - ..._225, - ..._226, - ..._227, ..._228, ..._229, - ..._509, - ..._523, - ..._535, - ..._550 - }; - export const lockup = { ..._230, ..._231, ..._232, ..._233, ..._234, - ..._510, - ..._524, - ..._536, - ..._551 + ..._518, + ..._532, + ..._544, + ..._559 + }; + export const lockup = { + ..._235, + ..._236, + ..._237, + ..._238, + ..._239, + ..._519, + ..._533, + ..._545, + ..._560 }; export namespace poolincentives { - export const v1beta1 = { - ..._235, - ..._236, - ..._237, - ..._238, - ..._239, - ..._537 - }; - } - export namespace poolmanager { export const v1beta1 = { ..._240, ..._241, ..._242, ..._243, ..._244, - ..._245, - ..._511, - ..._525, - ..._538, - ..._552 + ..._546 }; } - export namespace protorev { + export namespace poolmanager { export const v1beta1 = { + ..._245, ..._246, ..._247, ..._248, ..._249, ..._250, - ..._251, - ..._512, - ..._526, - ..._539, - ..._553 + ..._520, + ..._534, + ..._547, + ..._561 }; } - export namespace smartaccount { + export namespace protorev { export const v1beta1 = { + ..._251, ..._252, ..._253, ..._254, ..._255, ..._256, - ..._513, - ..._527, - ..._540, - ..._554 + ..._521, + ..._535, + ..._548, + ..._562 }; } - export const superfluid = { - ..._257, - ..._258, - ..._259, - ..._260, - ..._261, - ..._514, - ..._528, - ..._541, - ..._555 - }; - export namespace tokenfactory { + export namespace smartaccount { export const v1beta1 = { - ..._262, - ..._263, - ..._264, - ..._265, - ..._266, - ..._515, - ..._529, - ..._542, - ..._556 + ..._257, + ..._258, + ..._259, + ..._260, + ..._261, + ..._522, + ..._536, + ..._549, + ..._563 }; } - export namespace txfees { + export const superfluid = { + ..._262, + ..._263, + ..._264, + ..._265, + ..._266, + ..._523, + ..._537, + ..._550, + ..._564 + }; + export namespace tokenfactory { export const v1beta1 = { ..._267, ..._268, ..._269, ..._270, ..._271, - ..._272, - ..._516, - ..._530, - ..._543, - ..._557 + ..._524, + ..._538, + ..._551, + ..._565 }; } - export namespace valsetpref { + export namespace txfees { export const v1beta1 = { + ..._272, ..._273, ..._274, ..._275, - ..._517, - ..._531, - ..._544, - ..._558 + ..._276, + ..._277, + ..._525, + ..._539, + ..._552, + ..._566 + }; + } + export namespace valsetpref { + export const v1beta1 = { + ..._278, + ..._279, + ..._280, + ..._526, + ..._540, + ..._553, + ..._567 }; } export const ClientFactory = { - ..._645, - ..._646 + ..._656, + ..._657 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/bundle.ts b/packages/types/protobuf/codegen/pstake/bundle.ts index be67c481a..ab2f01173 100644 --- a/packages/types/protobuf/codegen/pstake/bundle.ts +++ b/packages/types/protobuf/codegen/pstake/bundle.ts @@ -1,98 +1,98 @@ -import * as _276 from "./liquidstake/v1beta1/genesis"; -import * as _277 from "./liquidstake/v1beta1/liquidstake"; -import * as _278 from "./liquidstake/v1beta1/query"; -import * as _279 from "./liquidstake/v1beta1/tx"; -import * as _280 from "./liquidstakeibc/v1beta1/genesis"; -import * as _281 from "./liquidstakeibc/v1beta1/liquidstakeibc"; -import * as _282 from "./liquidstakeibc/v1beta1/msgs"; -import * as _283 from "./liquidstakeibc/v1beta1/params"; -import * as _284 from "./liquidstakeibc/v1beta1/query"; -import * as _285 from "./lscosmos/v1beta1/genesis"; -import * as _286 from "./lscosmos/v1beta1/governance_proposal"; -import * as _287 from "./lscosmos/v1beta1/lscosmos"; -import * as _288 from "./lscosmos/v1beta1/msgs"; -import * as _289 from "./lscosmos/v1beta1/params"; -import * as _290 from "./lscosmos/v1beta1/query"; -import * as _291 from "./ratesync/v1beta1/contract"; -import * as _292 from "./ratesync/v1beta1/genesis"; -import * as _293 from "./ratesync/v1beta1/params"; -import * as _294 from "./ratesync/v1beta1/query"; -import * as _295 from "./ratesync/v1beta1/ratesync"; -import * as _296 from "./ratesync/v1beta1/tx"; -import * as _559 from "./liquidstake/v1beta1/tx.amino"; -import * as _560 from "./liquidstakeibc/v1beta1/msgs.amino"; -import * as _561 from "./lscosmos/v1beta1/msgs.amino"; -import * as _562 from "./ratesync/v1beta1/tx.amino"; -import * as _563 from "./liquidstake/v1beta1/tx.registry"; -import * as _564 from "./liquidstakeibc/v1beta1/msgs.registry"; -import * as _565 from "./lscosmos/v1beta1/msgs.registry"; -import * as _566 from "./ratesync/v1beta1/tx.registry"; -import * as _567 from "./liquidstake/v1beta1/query.rpc.Query"; -import * as _568 from "./liquidstakeibc/v1beta1/query.rpc.Query"; -import * as _569 from "./lscosmos/v1beta1/query.rpc.Query"; -import * as _570 from "./ratesync/v1beta1/query.rpc.Query"; -import * as _571 from "./liquidstake/v1beta1/tx.rpc.msg"; -import * as _572 from "./liquidstakeibc/v1beta1/msgs.rpc.msg"; -import * as _573 from "./lscosmos/v1beta1/msgs.rpc.msg"; -import * as _574 from "./ratesync/v1beta1/tx.rpc.msg"; -import * as _647 from "./rpc.query"; -import * as _648 from "./rpc.tx"; +import * as _281 from "./liquidstake/v1beta1/genesis"; +import * as _282 from "./liquidstake/v1beta1/liquidstake"; +import * as _283 from "./liquidstake/v1beta1/query"; +import * as _284 from "./liquidstake/v1beta1/tx"; +import * as _285 from "./liquidstakeibc/v1beta1/genesis"; +import * as _286 from "./liquidstakeibc/v1beta1/liquidstakeibc"; +import * as _287 from "./liquidstakeibc/v1beta1/msgs"; +import * as _288 from "./liquidstakeibc/v1beta1/params"; +import * as _289 from "./liquidstakeibc/v1beta1/query"; +import * as _290 from "./lscosmos/v1beta1/genesis"; +import * as _291 from "./lscosmos/v1beta1/governance_proposal"; +import * as _292 from "./lscosmos/v1beta1/lscosmos"; +import * as _293 from "./lscosmos/v1beta1/msgs"; +import * as _294 from "./lscosmos/v1beta1/params"; +import * as _295 from "./lscosmos/v1beta1/query"; +import * as _296 from "./ratesync/v1beta1/contract"; +import * as _297 from "./ratesync/v1beta1/genesis"; +import * as _298 from "./ratesync/v1beta1/params"; +import * as _299 from "./ratesync/v1beta1/query"; +import * as _300 from "./ratesync/v1beta1/ratesync"; +import * as _301 from "./ratesync/v1beta1/tx"; +import * as _568 from "./liquidstake/v1beta1/tx.amino"; +import * as _569 from "./liquidstakeibc/v1beta1/msgs.amino"; +import * as _570 from "./lscosmos/v1beta1/msgs.amino"; +import * as _571 from "./ratesync/v1beta1/tx.amino"; +import * as _572 from "./liquidstake/v1beta1/tx.registry"; +import * as _573 from "./liquidstakeibc/v1beta1/msgs.registry"; +import * as _574 from "./lscosmos/v1beta1/msgs.registry"; +import * as _575 from "./ratesync/v1beta1/tx.registry"; +import * as _576 from "./liquidstake/v1beta1/query.rpc.Query"; +import * as _577 from "./liquidstakeibc/v1beta1/query.rpc.Query"; +import * as _578 from "./lscosmos/v1beta1/query.rpc.Query"; +import * as _579 from "./ratesync/v1beta1/query.rpc.Query"; +import * as _580 from "./liquidstake/v1beta1/tx.rpc.msg"; +import * as _581 from "./liquidstakeibc/v1beta1/msgs.rpc.msg"; +import * as _582 from "./lscosmos/v1beta1/msgs.rpc.msg"; +import * as _583 from "./ratesync/v1beta1/tx.rpc.msg"; +import * as _658 from "./rpc.query"; +import * as _659 from "./rpc.tx"; export namespace pstake { export namespace liquidstake { export const v1beta1 = { - ..._276, - ..._277, - ..._278, - ..._279, - ..._559, - ..._563, - ..._567, - ..._571 - }; - } - export namespace liquidstakeibc { - export const v1beta1 = { - ..._280, ..._281, ..._282, ..._283, ..._284, - ..._560, - ..._564, ..._568, - ..._572 + ..._572, + ..._576, + ..._580 }; } - export namespace lscosmos { + export namespace liquidstakeibc { export const v1beta1 = { ..._285, ..._286, ..._287, ..._288, ..._289, - ..._290, - ..._561, - ..._565, ..._569, - ..._573 + ..._573, + ..._577, + ..._581 }; } - export namespace ratesync { + export namespace lscosmos { export const v1beta1 = { + ..._290, ..._291, ..._292, ..._293, ..._294, ..._295, - ..._296, - ..._562, - ..._566, ..._570, - ..._574 + ..._574, + ..._578, + ..._582 + }; + } + export namespace ratesync { + export const v1beta1 = { + ..._296, + ..._297, + ..._298, + ..._299, + ..._300, + ..._301, + ..._571, + ..._575, + ..._579, + ..._583 }; } export const ClientFactory = { - ..._647, - ..._648 + ..._658, + ..._659 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/publicawesome/bundle.ts b/packages/types/protobuf/codegen/publicawesome/bundle.ts index d025cc08e..e1434349d 100644 --- a/packages/types/protobuf/codegen/publicawesome/bundle.ts +++ b/packages/types/protobuf/codegen/publicawesome/bundle.ts @@ -1,88 +1,88 @@ -import * as _297 from "./stargaze/alloc/v1beta1/genesis"; -import * as _298 from "./stargaze/alloc/v1beta1/params"; -import * as _299 from "./stargaze/alloc/v1beta1/query"; -import * as _300 from "./stargaze/alloc/v1beta1/tx"; -import * as _301 from "./stargaze/cron/v1/cron"; -import * as _302 from "./stargaze/cron/v1/genesis"; -import * as _303 from "./stargaze/cron/v1/proposal"; -import * as _304 from "./stargaze/cron/v1/query"; -import * as _305 from "./stargaze/cron/v1/tx"; -import * as _306 from "./stargaze/globalfee/v1/genesis"; -import * as _307 from "./stargaze/globalfee/v1/globalfee"; -import * as _308 from "./stargaze/globalfee/v1/proposal"; -import * as _309 from "./stargaze/globalfee/v1/query"; -import * as _310 from "./stargaze/globalfee/v1/tx"; -import * as _311 from "./stargaze/mint/v1beta1/genesis"; -import * as _312 from "./stargaze/mint/v1beta1/mint"; -import * as _313 from "./stargaze/mint/v1beta1/query"; -import * as _314 from "./stargaze/mint/v1beta1/tx"; -import * as _575 from "./stargaze/alloc/v1beta1/tx.amino"; -import * as _576 from "./stargaze/cron/v1/tx.amino"; -import * as _577 from "./stargaze/globalfee/v1/tx.amino"; -import * as _578 from "./stargaze/alloc/v1beta1/tx.registry"; -import * as _579 from "./stargaze/cron/v1/tx.registry"; -import * as _580 from "./stargaze/globalfee/v1/tx.registry"; -import * as _581 from "./stargaze/alloc/v1beta1/query.rpc.Query"; -import * as _582 from "./stargaze/cron/v1/query.rpc.Query"; -import * as _583 from "./stargaze/globalfee/v1/query.rpc.Query"; -import * as _584 from "./stargaze/mint/v1beta1/query.rpc.Query"; -import * as _585 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; -import * as _586 from "./stargaze/cron/v1/tx.rpc.msg"; -import * as _587 from "./stargaze/globalfee/v1/tx.rpc.msg"; -import * as _649 from "./rpc.query"; -import * as _650 from "./rpc.tx"; +import * as _302 from "./stargaze/alloc/v1beta1/genesis"; +import * as _303 from "./stargaze/alloc/v1beta1/params"; +import * as _304 from "./stargaze/alloc/v1beta1/query"; +import * as _305 from "./stargaze/alloc/v1beta1/tx"; +import * as _306 from "./stargaze/cron/v1/cron"; +import * as _307 from "./stargaze/cron/v1/genesis"; +import * as _308 from "./stargaze/cron/v1/proposal"; +import * as _309 from "./stargaze/cron/v1/query"; +import * as _310 from "./stargaze/cron/v1/tx"; +import * as _311 from "./stargaze/globalfee/v1/genesis"; +import * as _312 from "./stargaze/globalfee/v1/globalfee"; +import * as _313 from "./stargaze/globalfee/v1/proposal"; +import * as _314 from "./stargaze/globalfee/v1/query"; +import * as _315 from "./stargaze/globalfee/v1/tx"; +import * as _316 from "./stargaze/mint/v1beta1/genesis"; +import * as _317 from "./stargaze/mint/v1beta1/mint"; +import * as _318 from "./stargaze/mint/v1beta1/query"; +import * as _319 from "./stargaze/mint/v1beta1/tx"; +import * as _584 from "./stargaze/alloc/v1beta1/tx.amino"; +import * as _585 from "./stargaze/cron/v1/tx.amino"; +import * as _586 from "./stargaze/globalfee/v1/tx.amino"; +import * as _587 from "./stargaze/alloc/v1beta1/tx.registry"; +import * as _588 from "./stargaze/cron/v1/tx.registry"; +import * as _589 from "./stargaze/globalfee/v1/tx.registry"; +import * as _590 from "./stargaze/alloc/v1beta1/query.rpc.Query"; +import * as _591 from "./stargaze/cron/v1/query.rpc.Query"; +import * as _592 from "./stargaze/globalfee/v1/query.rpc.Query"; +import * as _593 from "./stargaze/mint/v1beta1/query.rpc.Query"; +import * as _594 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; +import * as _595 from "./stargaze/cron/v1/tx.rpc.msg"; +import * as _596 from "./stargaze/globalfee/v1/tx.rpc.msg"; +import * as _660 from "./rpc.query"; +import * as _661 from "./rpc.tx"; export namespace publicawesome { export namespace stargaze { export namespace alloc { export const v1beta1 = { - ..._297, - ..._298, - ..._299, - ..._300, - ..._575, - ..._578, - ..._581, - ..._585 - }; - } - export namespace cron { - export const v1 = { - ..._301, ..._302, ..._303, ..._304, ..._305, - ..._576, - ..._579, - ..._582, - ..._586 + ..._584, + ..._587, + ..._590, + ..._594 }; } - export namespace globalfee { + export namespace cron { export const v1 = { ..._306, ..._307, ..._308, ..._309, ..._310, - ..._577, - ..._580, - ..._583, - ..._587 + ..._585, + ..._588, + ..._591, + ..._595 }; } - export namespace mint { - export const v1beta1 = { + export namespace globalfee { + export const v1 = { ..._311, ..._312, ..._313, ..._314, - ..._584 + ..._315, + ..._586, + ..._589, + ..._592, + ..._596 + }; + } + export namespace mint { + export const v1beta1 = { + ..._316, + ..._317, + ..._318, + ..._319, + ..._593 }; } } export const ClientFactory = { - ..._649, - ..._650 + ..._660, + ..._661 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/regen/bundle.ts b/packages/types/protobuf/codegen/regen/bundle.ts index 20954122c..a7f80b600 100644 --- a/packages/types/protobuf/codegen/regen/bundle.ts +++ b/packages/types/protobuf/codegen/regen/bundle.ts @@ -1,134 +1,134 @@ -import * as _315 from "./data/v1/events"; -import * as _316 from "./data/v1/state"; -import * as _317 from "./data/v1/tx"; -import * as _318 from "./data/v1/types"; -import * as _319 from "./data/v2/events"; -import * as _320 from "./data/v2/state"; -import * as _321 from "./data/v2/tx"; -import * as _322 from "./data/v2/types"; -import * as _323 from "./ecocredit/basket/v1/events"; -import * as _324 from "./ecocredit/basket/v1/state"; -import * as _325 from "./ecocredit/basket/v1/tx"; -import * as _326 from "./ecocredit/basket/v1/types"; -import * as _327 from "./ecocredit/marketplace/v1/events"; -import * as _328 from "./ecocredit/marketplace/v1/state"; -import * as _329 from "./ecocredit/marketplace/v1/tx"; -import * as _330 from "./ecocredit/marketplace/v1/types"; -import * as _331 from "./ecocredit/orderbook/v1alpha1/memory"; -import * as _332 from "./ecocredit/v1/events"; -import * as _333 from "./ecocredit/v1/state"; -import * as _334 from "./ecocredit/v1/tx"; -import * as _335 from "./ecocredit/v1/types"; -import * as _336 from "./ecocredit/v1alpha1/events"; -import * as _337 from "./ecocredit/v1alpha1/genesis"; -import * as _338 from "./ecocredit/v1alpha1/tx"; -import * as _339 from "./ecocredit/v1alpha1/types"; -import * as _340 from "./intertx/v1/query"; -import * as _341 from "./intertx/v1/tx"; -import * as _588 from "./data/v1/tx.amino"; -import * as _589 from "./data/v2/tx.amino"; -import * as _590 from "./ecocredit/basket/v1/tx.amino"; -import * as _591 from "./ecocredit/marketplace/v1/tx.amino"; -import * as _592 from "./ecocredit/v1/tx.amino"; -import * as _593 from "./ecocredit/v1alpha1/tx.amino"; -import * as _594 from "./intertx/v1/tx.amino"; -import * as _595 from "./data/v1/tx.registry"; -import * as _596 from "./data/v2/tx.registry"; -import * as _597 from "./ecocredit/basket/v1/tx.registry"; -import * as _598 from "./ecocredit/marketplace/v1/tx.registry"; -import * as _599 from "./ecocredit/v1/tx.registry"; -import * as _600 from "./ecocredit/v1alpha1/tx.registry"; -import * as _601 from "./intertx/v1/tx.registry"; -import * as _602 from "./intertx/v1/query.rpc.Query"; -import * as _603 from "./data/v1/tx.rpc.msg"; -import * as _604 from "./data/v2/tx.rpc.msg"; -import * as _605 from "./ecocredit/basket/v1/tx.rpc.msg"; -import * as _606 from "./ecocredit/marketplace/v1/tx.rpc.msg"; -import * as _607 from "./ecocredit/v1/tx.rpc.msg"; -import * as _608 from "./ecocredit/v1alpha1/tx.rpc.msg"; -import * as _609 from "./intertx/v1/tx.rpc.msg"; -import * as _651 from "./rpc.query"; -import * as _652 from "./rpc.tx"; +import * as _320 from "./data/v1/events"; +import * as _321 from "./data/v1/state"; +import * as _322 from "./data/v1/tx"; +import * as _323 from "./data/v1/types"; +import * as _324 from "./data/v2/events"; +import * as _325 from "./data/v2/state"; +import * as _326 from "./data/v2/tx"; +import * as _327 from "./data/v2/types"; +import * as _328 from "./ecocredit/basket/v1/events"; +import * as _329 from "./ecocredit/basket/v1/state"; +import * as _330 from "./ecocredit/basket/v1/tx"; +import * as _331 from "./ecocredit/basket/v1/types"; +import * as _332 from "./ecocredit/marketplace/v1/events"; +import * as _333 from "./ecocredit/marketplace/v1/state"; +import * as _334 from "./ecocredit/marketplace/v1/tx"; +import * as _335 from "./ecocredit/marketplace/v1/types"; +import * as _336 from "./ecocredit/orderbook/v1alpha1/memory"; +import * as _337 from "./ecocredit/v1/events"; +import * as _338 from "./ecocredit/v1/state"; +import * as _339 from "./ecocredit/v1/tx"; +import * as _340 from "./ecocredit/v1/types"; +import * as _341 from "./ecocredit/v1alpha1/events"; +import * as _342 from "./ecocredit/v1alpha1/genesis"; +import * as _343 from "./ecocredit/v1alpha1/tx"; +import * as _344 from "./ecocredit/v1alpha1/types"; +import * as _345 from "./intertx/v1/query"; +import * as _346 from "./intertx/v1/tx"; +import * as _597 from "./data/v1/tx.amino"; +import * as _598 from "./data/v2/tx.amino"; +import * as _599 from "./ecocredit/basket/v1/tx.amino"; +import * as _600 from "./ecocredit/marketplace/v1/tx.amino"; +import * as _601 from "./ecocredit/v1/tx.amino"; +import * as _602 from "./ecocredit/v1alpha1/tx.amino"; +import * as _603 from "./intertx/v1/tx.amino"; +import * as _604 from "./data/v1/tx.registry"; +import * as _605 from "./data/v2/tx.registry"; +import * as _606 from "./ecocredit/basket/v1/tx.registry"; +import * as _607 from "./ecocredit/marketplace/v1/tx.registry"; +import * as _608 from "./ecocredit/v1/tx.registry"; +import * as _609 from "./ecocredit/v1alpha1/tx.registry"; +import * as _610 from "./intertx/v1/tx.registry"; +import * as _611 from "./intertx/v1/query.rpc.Query"; +import * as _612 from "./data/v1/tx.rpc.msg"; +import * as _613 from "./data/v2/tx.rpc.msg"; +import * as _614 from "./ecocredit/basket/v1/tx.rpc.msg"; +import * as _615 from "./ecocredit/marketplace/v1/tx.rpc.msg"; +import * as _616 from "./ecocredit/v1/tx.rpc.msg"; +import * as _617 from "./ecocredit/v1alpha1/tx.rpc.msg"; +import * as _618 from "./intertx/v1/tx.rpc.msg"; +import * as _662 from "./rpc.query"; +import * as _663 from "./rpc.tx"; export namespace regen { export namespace data { export const v1 = { - ..._315, - ..._316, - ..._317, - ..._318, - ..._588, - ..._595, - ..._603 - }; - export const v2 = { - ..._319, ..._320, ..._321, ..._322, - ..._589, - ..._596, - ..._604 + ..._323, + ..._597, + ..._604, + ..._612 + }; + export const v2 = { + ..._324, + ..._325, + ..._326, + ..._327, + ..._598, + ..._605, + ..._613 }; } export namespace ecocredit { export namespace basket { export const v1 = { - ..._323, - ..._324, - ..._325, - ..._326, - ..._590, - ..._597, - ..._605 + ..._328, + ..._329, + ..._330, + ..._331, + ..._599, + ..._606, + ..._614 }; } export namespace marketplace { export const v1 = { - ..._327, - ..._328, - ..._329, - ..._330, - ..._591, - ..._598, - ..._606 + ..._332, + ..._333, + ..._334, + ..._335, + ..._600, + ..._607, + ..._615 }; } export namespace orderbook { export const v1alpha1 = { - ..._331 + ..._336 }; } export const v1 = { - ..._332, - ..._333, - ..._334, - ..._335, - ..._592, - ..._599, - ..._607 - }; - export const v1alpha1 = { - ..._336, ..._337, ..._338, ..._339, - ..._593, - ..._600, - ..._608 + ..._340, + ..._601, + ..._608, + ..._616 + }; + export const v1alpha1 = { + ..._341, + ..._342, + ..._343, + ..._344, + ..._602, + ..._609, + ..._617 }; } export namespace intertx { export const v1 = { - ..._340, - ..._341, - ..._594, - ..._601, - ..._602, - ..._609 + ..._345, + ..._346, + ..._603, + ..._610, + ..._611, + ..._618 }; } export const ClientFactory = { - ..._651, - ..._652 + ..._662, + ..._663 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/bundle.ts b/packages/types/protobuf/codegen/secret/bundle.ts index 203747186..21d80da3d 100644 --- a/packages/types/protobuf/codegen/secret/bundle.ts +++ b/packages/types/protobuf/codegen/secret/bundle.ts @@ -1,78 +1,78 @@ -import * as _342 from "./compute/v1beta1/genesis"; -import * as _343 from "./compute/v1beta1/msg"; -import * as _344 from "./compute/v1beta1/query"; -import * as _345 from "./compute/v1beta1/types"; -import * as _346 from "./emergencybutton/v1beta1/genesis"; -import * as _347 from "./emergencybutton/v1beta1/params"; -import * as _348 from "./emergencybutton/v1beta1/query"; -import * as _349 from "./emergencybutton/v1beta1/tx"; -import * as _350 from "./intertx/v1beta1/query"; -import * as _351 from "./intertx/v1beta1/tx"; -import * as _352 from "./registration/v1beta1/genesis"; -import * as _353 from "./registration/v1beta1/msg"; -import * as _354 from "./registration/v1beta1/query"; -import * as _355 from "./registration/v1beta1/types"; -import * as _610 from "./compute/v1beta1/msg.amino"; -import * as _611 from "./emergencybutton/v1beta1/tx.amino"; -import * as _612 from "./intertx/v1beta1/tx.amino"; -import * as _613 from "./compute/v1beta1/msg.registry"; -import * as _614 from "./emergencybutton/v1beta1/tx.registry"; -import * as _615 from "./intertx/v1beta1/tx.registry"; -import * as _616 from "./compute/v1beta1/query.rpc.Query"; -import * as _617 from "./emergencybutton/v1beta1/query.rpc.Query"; -import * as _618 from "./intertx/v1beta1/query.rpc.Query"; -import * as _619 from "./registration/v1beta1/query.rpc.Query"; -import * as _620 from "./compute/v1beta1/msg.rpc.msg"; -import * as _621 from "./emergencybutton/v1beta1/tx.rpc.msg"; -import * as _622 from "./intertx/v1beta1/tx.rpc.msg"; -import * as _653 from "./rpc.query"; -import * as _654 from "./rpc.tx"; +import * as _347 from "./compute/v1beta1/genesis"; +import * as _348 from "./compute/v1beta1/msg"; +import * as _349 from "./compute/v1beta1/query"; +import * as _350 from "./compute/v1beta1/types"; +import * as _351 from "./emergencybutton/v1beta1/genesis"; +import * as _352 from "./emergencybutton/v1beta1/params"; +import * as _353 from "./emergencybutton/v1beta1/query"; +import * as _354 from "./emergencybutton/v1beta1/tx"; +import * as _355 from "./intertx/v1beta1/query"; +import * as _356 from "./intertx/v1beta1/tx"; +import * as _357 from "./registration/v1beta1/genesis"; +import * as _358 from "./registration/v1beta1/msg"; +import * as _359 from "./registration/v1beta1/query"; +import * as _360 from "./registration/v1beta1/types"; +import * as _619 from "./compute/v1beta1/msg.amino"; +import * as _620 from "./emergencybutton/v1beta1/tx.amino"; +import * as _621 from "./intertx/v1beta1/tx.amino"; +import * as _622 from "./compute/v1beta1/msg.registry"; +import * as _623 from "./emergencybutton/v1beta1/tx.registry"; +import * as _624 from "./intertx/v1beta1/tx.registry"; +import * as _625 from "./compute/v1beta1/query.rpc.Query"; +import * as _626 from "./emergencybutton/v1beta1/query.rpc.Query"; +import * as _627 from "./intertx/v1beta1/query.rpc.Query"; +import * as _628 from "./registration/v1beta1/query.rpc.Query"; +import * as _629 from "./compute/v1beta1/msg.rpc.msg"; +import * as _630 from "./emergencybutton/v1beta1/tx.rpc.msg"; +import * as _631 from "./intertx/v1beta1/tx.rpc.msg"; +import * as _664 from "./rpc.query"; +import * as _665 from "./rpc.tx"; export namespace secret { export namespace compute { export const v1beta1 = { - ..._342, - ..._343, - ..._344, - ..._345, - ..._610, - ..._613, - ..._616, - ..._620 + ..._347, + ..._348, + ..._349, + ..._350, + ..._619, + ..._622, + ..._625, + ..._629 }; } export namespace emergencybutton { export const v1beta1 = { - ..._346, - ..._347, - ..._348, - ..._349, - ..._611, - ..._614, - ..._617, - ..._621 + ..._351, + ..._352, + ..._353, + ..._354, + ..._620, + ..._623, + ..._626, + ..._630 }; } export namespace intertx { export const v1beta1 = { - ..._350, - ..._351, - ..._612, - ..._615, - ..._618, - ..._622 + ..._355, + ..._356, + ..._621, + ..._624, + ..._627, + ..._631 }; } export namespace registration { export const v1beta1 = { - ..._352, - ..._353, - ..._354, - ..._355, - ..._619 + ..._357, + ..._358, + ..._359, + ..._360, + ..._628 }; } export const ClientFactory = { - ..._653, - ..._654 + ..._664, + ..._665 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/tendermint/bundle.ts b/packages/types/protobuf/codegen/tendermint/bundle.ts index d9bf879a8..3e043ad7a 100644 --- a/packages/types/protobuf/codegen/tendermint/bundle.ts +++ b/packages/types/protobuf/codegen/tendermint/bundle.ts @@ -1,32 +1,32 @@ -import * as _359 from "./abci/types"; -import * as _360 from "./crypto/keys"; -import * as _361 from "./crypto/proof"; -import * as _362 from "./p2p/types"; -import * as _363 from "./types/block"; -import * as _364 from "./types/evidence"; -import * as _365 from "./types/params"; -import * as _366 from "./types/types"; -import * as _367 from "./types/validator"; -import * as _368 from "./version/types"; +import * as _364 from "./abci/types"; +import * as _365 from "./crypto/keys"; +import * as _366 from "./crypto/proof"; +import * as _367 from "./p2p/types"; +import * as _368 from "./types/block"; +import * as _369 from "./types/evidence"; +import * as _370 from "./types/params"; +import * as _371 from "./types/types"; +import * as _372 from "./types/validator"; +import * as _373 from "./version/types"; export namespace tendermint { export const abci = { - ..._359 + ..._364 }; export const crypto = { - ..._360, - ..._361 + ..._365, + ..._366 }; export const p2p = { - ..._362 + ..._367 }; export const types = { - ..._363, - ..._364, - ..._365, - ..._366, - ..._367 + ..._368, + ..._369, + ..._370, + ..._371, + ..._372 }; export const version = { - ..._368 + ..._373 }; } \ No newline at end of file diff --git a/packages/types/protobuf/proto/OmniFlix/alloc/v1beta1/genesis.proto b/packages/types/protobuf/proto/OmniFlix/alloc/v1beta1/genesis.proto new file mode 100644 index 000000000..72400d192 --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/alloc/v1beta1/genesis.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package OmniFlix.alloc.v1beta1; + +import "gogoproto/gogo.proto"; +import "OmniFlix/alloc/v1beta1/params.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/alloc/types"; + +// GenesisState defines the alloc module's genesis state. +message GenesisState { + Params params = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/packages/types/protobuf/proto/OmniFlix/alloc/v1beta1/params.proto b/packages/types/protobuf/proto/OmniFlix/alloc/v1beta1/params.proto new file mode 100644 index 000000000..b10fbc8ae --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/alloc/v1beta1/params.proto @@ -0,0 +1,66 @@ +syntax = "proto3"; + +package OmniFlix.alloc.v1beta1; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/alloc/types"; + +import "gogoproto/gogo.proto"; + + +message WeightedAddress { + string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + string weight = 2 [ + (gogoproto.moretags) = "yaml:\"weight\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +message DistributionProportions { + string staking_rewards = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"staking_rewards\"", + (gogoproto.nullable) = false + ]; + string nft_incentives = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"nft_incentives\"", + (gogoproto.nullable) = false + ]; + string node_hosts_incentives = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"node_hosts_incentives\"", + (gogoproto.nullable) = false + ]; + string developer_rewards = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"developer_rewards\"", + (gogoproto.nullable) = false + ]; + string community_pool = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"community_pool\"", + (gogoproto.nullable) = false + ]; +} + +message Params { + // distribution_proportions defines the proportion of the minted denom + DistributionProportions distribution_proportions = 1 + [ (gogoproto.nullable) = false ]; + // address to receive developer rewards + repeated WeightedAddress weighted_developer_rewards_receivers = 2 [ + (gogoproto.moretags) = "yaml:\"weighted_developer_rewards_receivers\"", + (gogoproto.nullable) = false + ]; + // address to receive nft incentives + repeated WeightedAddress weighted_nft_incentives_receivers = 3 [ + (gogoproto.moretags) = "yaml:\"weighted_nft_incentives_receivers\"", + (gogoproto.nullable) = false + ]; + // address to receive node host incentives + repeated WeightedAddress weighted_node_hosts_incentives_receivers = 4 [ + (gogoproto.moretags) = "yaml:\"weighted_node_hosts_incentives_receivers\"", + (gogoproto.nullable) = false + ]; +} diff --git a/packages/types/protobuf/proto/OmniFlix/alloc/v1beta1/query.proto b/packages/types/protobuf/proto/OmniFlix/alloc/v1beta1/query.proto new file mode 100644 index 000000000..8391b8e7e --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/alloc/v1beta1/query.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package OmniFlix.alloc.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "OmniFlix/alloc/v1beta1/params.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/alloc/types"; + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} + + + +// Query defines the gRPC querier service. +service Query { + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/omniflix/alloc/v1beta1/params"; + } +} + diff --git a/packages/types/protobuf/proto/OmniFlix/alloc/v1beta1/tx.proto b/packages/types/protobuf/proto/OmniFlix/alloc/v1beta1/tx.proto new file mode 100644 index 000000000..b2b1da926 --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/alloc/v1beta1/tx.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; +package OmniFlix.alloc.v1beta1; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/alloc/types"; + +import "cosmos/msg/v1/msg.proto"; +import "OmniFlix/alloc/v1beta1/params.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; + +service Msg { + option (cosmos.msg.v1.service) = true; + // UpdateParams defines a governance operation for updating the x/alloc module + // parameters. The authority is hard-coded to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/alloc parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/packages/types/protobuf/proto/OmniFlix/globalfee/v1beta1/genesis.proto b/packages/types/protobuf/proto/OmniFlix/globalfee/v1beta1/genesis.proto new file mode 100644 index 000000000..9420b4345 --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/globalfee/v1beta1/genesis.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package OmniFlix.globalfee.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/globalfee/types"; + +// GenesisState - initial state of module +message GenesisState { + // Params of this module + Params params = 1 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "params,omitempty" + ]; +} + +// Params defines the set of module parameters. +message Params { + // minimum_gas_prices stores the minimum gas price(s) for all TX on the chain. + // When multiple coins are defined then they are accepted alternatively. + // The list must be sorted by denoms asc. No duplicate denoms or zero amount + // values allowed. For more information see + // https://docs.cosmos.network/main/modules/auth#concepts + repeated cosmos.base.v1beta1.DecCoin minimum_gas_prices = 1 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "minimum_gas_prices,omitempty", + (gogoproto.moretags) = "yaml:\"minimum_gas_prices\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" + ]; + + // bypass_min_fee_msg_types defines a list of message type urls + // that are free of fee charge. + repeated string bypass_min_fee_msg_types = 2 [ + (gogoproto.jsontag) = "bypass_min_fee_msg_types,omitempty", + (gogoproto.moretags) = "yaml:\"bypass_min_fee_msg_types\"" + ]; + + // max_total_bypass_min_fee_msg_gas_usage defines the total maximum gas usage + // allowed for a transaction containing only messages of types in bypass_min_fee_msg_types + // to bypass fee charge. + uint64 max_total_bypass_min_fee_msg_gas_usage = 3; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/OmniFlix/globalfee/v1beta1/query.proto b/packages/types/protobuf/proto/OmniFlix/globalfee/v1beta1/query.proto new file mode 100644 index 000000000..3864b54fa --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/globalfee/v1beta1/query.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package OmniFlix.globalfee.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "OmniFlix/globalfee/v1beta1/genesis.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/globalfee/types"; + +// Query defines the gRPC querier service. +service Query { + rpc Params(QueryParamsRequest) + returns (QueryParamsResponse) { + option (google.api.http).get = + "/omniflix/globalfee/v1beta1/params"; + } +} + +// QueryMinimumGasPricesRequest is the request type for the +// Query/MinimumGasPrices RPC method. +message QueryParamsRequest {} + +// QueryMinimumGasPricesResponse is the response type for the +// Query/MinimumGasPrices RPC method. +message QueryParamsResponse { + Params params = 1 [(gogoproto.nullable) = false]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/OmniFlix/globalfee/v1beta1/tx.proto b/packages/types/protobuf/proto/OmniFlix/globalfee/v1beta1/tx.proto new file mode 100644 index 000000000..fdeeea3c9 --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/globalfee/v1beta1/tx.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; +package OmniFlix.globalfee.v1beta1; + + +import "cosmos/msg/v1/msg.proto"; +import "OmniFlix/globalfee/v1beta1/genesis.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/globalfee/types"; + +// Msg defines the x/globalfee Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // UpdateParams defines a governance operation for updating the x/globalfee module + // parameters. The authority is hard-coded to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/mint parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/packages/types/protobuf/proto/OmniFlix/itc/v1/genesis.proto b/packages/types/protobuf/proto/OmniFlix/itc/v1/genesis.proto new file mode 100644 index 000000000..bcb46fa10 --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/itc/v1/genesis.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package OmniFlix.itc.v1; + +import "gogoproto/gogo.proto"; +import "OmniFlix/itc/v1/params.proto"; +import "OmniFlix/itc/v1/itc.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/itc/types"; + +// GenesisState defines the itc module's genesis state. +message GenesisState { + repeated Campaign campaigns = 1 [(gogoproto.nullable) = false]; + uint64 next_campaign_number = 2; + repeated Claim claims = 3 [(gogoproto.nullable) = false]; + Params params = 4 [(gogoproto.nullable) = false]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/OmniFlix/itc/v1/itc.proto b/packages/types/protobuf/proto/OmniFlix/itc/v1/itc.proto new file mode 100644 index 000000000..bd94dd8b9 --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/itc/v1/itc.proto @@ -0,0 +1,121 @@ +syntax = "proto3"; +package OmniFlix.itc.v1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/itc/types"; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.goproto_enum_prefix_all) = false; + +message Campaign { + uint64 id = 1; + string name = 2; + string description = 3; + google.protobuf.Timestamp start_time = 4 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"start_time\"" + ]; + google.protobuf.Timestamp end_time = 5 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"end_time\"" + ]; + string creator = 6; + string nft_denom_id = 7 [ + (gogoproto.moretags) = "yaml:\"nft_denom_id\"" + ]; + uint64 max_allowed_claims = 8 [ + (gogoproto.moretags) = "yaml:\"max_allowed_claims\"" + ]; + InteractionType interaction = 9; + ClaimType claim_type = 10; + cosmos.base.v1beta1.Coin tokens_per_claim = 11 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"tokens_per_claim\"" + ]; + cosmos.base.v1beta1.Coin total_tokens = 12 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"total_tokens\"" + ]; + cosmos.base.v1beta1.Coin available_tokens = 13 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"available_tokens\"" + ]; + repeated string received_nft_ids = 14 [ + (gogoproto.moretags) = "yaml:\"received_nft_ids\"" + ]; + NFTDetails nft_mint_details = 15 [ + (gogoproto.moretags) = "yaml:\"nft_mint_details\"" + ]; + Distribution distribution = 16 [ + (gogoproto.moretags) = "yaml:\"distribution\"" + ]; + uint64 mint_count = 17 [ + (gogoproto.moretags) = "yaml:\"mint_count\"" + ]; + uint64 claim_count = 18 [ + (gogoproto.moretags) = "yaml:\"claim_count\"" + ]; +} + +message Distribution { + DistributionType type = 1; + google.protobuf.Duration stream_duration = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true + ]; +} + +enum DistributionType { + DISTRIBUTION_TYPE_INSTANT = 0; + DISTRIBUTION_TYPE_STREAM = 1; +} + +enum InteractionType { + INTERACTION_TYPE_BURN = 0; + INTERACTION_TYPE_TRANSFER = 1; + INTERACTION_TYPE_HOLD = 2; +} + +enum CampaignStatus { + CAMPAIGN_STATUS_UNSPECIFIED = 0; + CAMPAIGN_STATUS_INACTIVE = 1; + CAMPAIGN_STATUS_ACTIVE = 2; +} + +enum ClaimType { + CLAIM_TYPE_FT = 0; + CLAIM_TYPE_NFT = 1; + CLAIM_TYPE_FT_AND_NFT = 2; +} + +message NFTDetails { + string denom_id = 1; + string name = 2; + string description = 3; + string media_uri = 4; + string preview_uri = 5; + string royalty_share = 6 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"royalty_share\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec" + ]; + bool transferable = 7; + bool extensible = 8; + bool nsfw = 9; + string data = 10; + string uri_hash = 11; + uint64 start_index = 12; + string name_delimiter = 13; +} + +message Claim { + uint64 campaign_id = 1; + string address = 2; + string nft_id = 3; + InteractionType interaction = 4; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/OmniFlix/itc/v1/params.proto b/packages/types/protobuf/proto/OmniFlix/itc/v1/params.proto new file mode 100644 index 000000000..03498183e --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/itc/v1/params.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; + +package OmniFlix.itc.v1; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/itc/types"; +option (gogoproto.goproto_getters_all) = false; + + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; + +message Params { + google.protobuf.Duration max_campaign_duration = 1 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "yaml:\"max_campaign_duration\"" + ]; + cosmos.base.v1beta1.Coin creation_fee = 2 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"creation_fee\"" + ]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/OmniFlix/itc/v1/query.proto b/packages/types/protobuf/proto/OmniFlix/itc/v1/query.proto new file mode 100644 index 000000000..420af66e5 --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/itc/v1/query.proto @@ -0,0 +1,75 @@ +syntax = "proto3"; +package OmniFlix.itc.v1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "OmniFlix/itc/v1/params.proto"; +import "OmniFlix/itc/v1/itc.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/itc/types"; +option (gogoproto.goproto_getters_all) = false; + +// Query defines the gRPC querier service. +service Query { + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/omniflix/itc/v1/params"; + } + + rpc Campaigns(QueryCampaignsRequest) returns (QueryCampaignsResponse) { + option (google.api.http).get = "/omniflix/itc/v1/campaigns"; + } + + rpc Campaign(QueryCampaignRequest) returns (QueryCampaignResponse) { + option (google.api.http).get = "/omniflix/itc/v1/campaigns/{campaign_id}"; + } + + rpc Claims(QueryClaimsRequest) returns (QueryClaimsResponse) { + option (google.api.http).get = "/omniflix/itc/v1/claims"; + } +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false]; +} + +// QueryCampaignsRequest is the request type for the Query/Campaigns RPC method. +message QueryCampaignsRequest { + CampaignStatus status = 1; + string creator = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryCampaignsResponse is the response type for the Query/Campaigns RPC +// method. +message QueryCampaignsResponse { + repeated Campaign campaigns = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryCampaignRequest is the request type for the Query/Campaign RPC method. +message QueryCampaignRequest { + uint64 campaign_id = 1 [(gogoproto.moretags) = "yaml:\"campaign_id\""]; +} + +// QueryCampaignResponse is the response type for the Query/Campaign RPC method. +message QueryCampaignResponse { + Campaign Campaign = 1 [(gogoproto.nullable) = false]; +} + +// QueryClaimsRequest is the request type for the Query/Claims RPC method. +message QueryClaimsRequest { + uint64 campaign_id = 1; + string address = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +message QueryClaimsResponse { + repeated Claim claims = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/OmniFlix/itc/v1/tx.proto b/packages/types/protobuf/proto/OmniFlix/itc/v1/tx.proto new file mode 100644 index 000000000..59f8e7468 --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/itc/v1/tx.proto @@ -0,0 +1,133 @@ +syntax = "proto3"; +package OmniFlix.itc.v1; + +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; +import "OmniFlix/itc/v1/itc.proto"; +import "OmniFlix/itc/v1/params.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/itc/types"; +option (gogoproto.goproto_getters_all) = false; + +service Msg { + option (cosmos.msg.v1.service) = true; + + rpc CreateCampaign(MsgCreateCampaign) returns (MsgCreateCampaignResponse); + + rpc CancelCampaign(MsgCancelCampaign) returns (MsgCancelCampaignResponse); + + rpc Claim(MsgClaim) returns (MsgClaimResponse); + + rpc DepositCampaign(MsgDepositCampaign) returns (MsgDepositCampaignResponse); + + // UpdateParams defines a governance operation for updating the x/itc module + // parameters. The authority is hard-coded to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +message MsgCreateCampaign { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "OmniFlix/itc/MsgCreateCampaign"; + option (gogoproto.equal) = false; + + string name = 1; + string description = 2; + InteractionType interaction = 3; + ClaimType claim_type = 4 [(gogoproto.moretags) = "yaml:\"claim_type\""]; + string nft_denom_id = 5 [(gogoproto.moretags) = "yaml:\"nft_denom_id\""]; + cosmos.base.v1beta1.Coin tokens_per_claim = 6 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"tokens_per_claim\"" + ]; + uint64 max_allowed_claims = 7 [ + (gogoproto.moretags) = "yaml:\"max_allowed_claims\"" + ]; + cosmos.base.v1beta1.Coin deposit = 8 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"deposit\"" + ]; + NFTDetails nft_mint_details = 9 [(gogoproto.moretags) = "yaml:\"nft_details\""]; + google.protobuf.Timestamp start_time = 10 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"start_time\"" + ]; + + google.protobuf.Duration duration = 11 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true + ]; + + Distribution distribution = 12; + string creator = 13; + cosmos.base.v1beta1.Coin creation_fee = 14 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"creation_fee\"" + ]; +} + +message MsgCreateCampaignResponse {} + +message MsgCancelCampaign { + option (cosmos.msg.v1.signer) = "creator"; + option (amino.name) = "OmniFlix/itc/MsgCancelCampaign"; + option (gogoproto.equal) = false; + + uint64 campaign_id = 1; + string creator = 2; +} + +message MsgCancelCampaignResponse {} + +message MsgClaim { + option (cosmos.msg.v1.signer) = "claimer"; + option (amino.name) = "OmniFlix/itc/MsgClaim"; + option (gogoproto.equal) = false; + + uint64 campaign_id = 1; + string nft_id = 2; + InteractionType interaction = 3; + string claimer = 4; +} + +message MsgClaimResponse {} + +message MsgDepositCampaign { + option (cosmos.msg.v1.signer) = "depositor"; + option (amino.name) = "OmniFlix/itc/MsgDepositCampaign"; + option (gogoproto.equal) = false; + + uint64 campaign_id = 1; + cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false]; + string depositor = 3; +} + +message MsgDepositCampaignResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/itc parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/auction.proto b/packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/auction.proto new file mode 100644 index 000000000..46aa892fc --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/auction.proto @@ -0,0 +1,60 @@ +syntax = "proto3"; +package OmniFlix.marketplace.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "OmniFlix/marketplace/v1beta1/listing.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/marketplace/types"; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.goproto_enum_prefix_all) = false; + +message AuctionListing { + uint64 id = 1; + string nft_id = 2 [(gogoproto.moretags) = "yaml:\"nft_id\""]; + string denom_id = 3 [(gogoproto.moretags) = "yaml:\"denom_id\""]; + cosmos.base.v1beta1.Coin start_price = 4 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"start_price\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + google.protobuf.Timestamp start_time = 5 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"start_time\"" + ]; + google.protobuf.Timestamp end_time = 6 [ + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"end_time\"" + ]; + string owner = 7; + string increment_percentage = 8 [ + (gogoproto.moretags) = "yaml:\"increment_percentage\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + repeated string whitelist_accounts = 9 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"whitelist_accounts\"" + ]; + repeated WeightedAddress split_shares = 10 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"split_shares\"" + ]; +} + +enum AuctionStatus { + AUCTION_STATUS_UNSPECIFIED = 0; + AUCTION_STATUS_INACTIVE = 1; + AUCTION_STATUS_ACTIVE = 2; +} + +message Bid { + option (gogoproto.equal) = true; + + uint64 auction_id = 1 [(gogoproto.moretags) = "yaml:\"auction_id\""]; + string bidder = 2; + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; + google.protobuf.Timestamp time = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/events.proto b/packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/events.proto new file mode 100644 index 000000000..e6f6cd8b7 --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/events.proto @@ -0,0 +1,63 @@ +syntax = "proto3"; +package OmniFlix.marketplace.v1beta1; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/marketplace/types"; + +// EventListONFT is emitted on NFT Listing on market +message EventListNFT { + string id = 1; + string nft_id = 2; + string denom_id = 3; + string owner = 4; +} +// EventEditListing is emitted on edit Listing on market +message EventEditListing { + string id = 1; + string nft_id = 2; + string denom_id = 3; + string owner = 4; +} + +// EventDeListONFT is emitted on NFT DeListing from market +message EventDeListNFT { + string id = 1; + string nft_id = 2; + string denom_id = 3; + string owner = 4; +} + +// EventBuyONFT is emitted on NFT Buy +message EventBuyNFT { + string id = 1; + string nft_id = 2; + string denom_id = 3; + string owner = 4; + string buyer = 5; +} + +// EventCreateAuction is emitted on creating auction +message EventCreateAuction { + string id = 1; + string nft_id = 2; + string denom_id = 3; + string owner = 4; + string min_price = 5; +} + +// EventCancelAuction is emitted on canceling auction +message EventCancelAuction { + string id = 1; + string nft_id = 2; + string denom_id = 3; + string owner = 4; +} + +// EventPlaceBid is emitted on placing bid for an auction +message EventPlaceBid { + string auction_id = 1; + string nft_id = 2; + string denom_id = 3; + string bidder = 4; + string amount = 5; +} + diff --git a/packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/genesis.proto b/packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/genesis.proto new file mode 100644 index 000000000..b4bd619c5 --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/genesis.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; +package OmniFlix.marketplace.v1beta1; + +import "gogoproto/gogo.proto"; +import "OmniFlix/marketplace/v1beta1/listing.proto"; +import "OmniFlix/marketplace/v1beta1/auction.proto"; +import "OmniFlix/marketplace/v1beta1/params.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/marketplace/types"; + +message GenesisState { + // NFTs that are listed in marketplace + repeated Listing listings = 1 [(gogoproto.nullable) = false]; + uint64 ListingCount = 2; + Params params = 3 [(gogoproto.nullable) = false]; + repeated AuctionListing auctions = 4 [(gogoproto.nullable) = false]; + repeated Bid bids = 5 [(gogoproto.nullable) = false]; + uint64 next_auction_number = 6; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/listing.proto b/packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/listing.proto new file mode 100644 index 000000000..e3432a68f --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/listing.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; +package OmniFlix.marketplace.v1beta1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/marketplace/types"; +option (gogoproto.goproto_getters_all) = false; + + +message Listing { + string id = 1; + string nft_id = 2 [(gogoproto.moretags) = "yaml:\"nft_id\""]; + string denom_id = 3 [(gogoproto.moretags) = "yaml:\"denom_id\""]; + cosmos.base.v1beta1.Coin price = 4 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + string owner = 5 [(gogoproto.moretags) = "yaml:\"owner\""]; + repeated WeightedAddress split_shares = 6 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"split_shares\"" + ]; +} + +message WeightedAddress { + option (gogoproto.equal) = true; + + string address = 1 [(gogoproto.moretags) = "yaml:\"address\""]; + string weight = 2 [ + (gogoproto.moretags) = "yaml:\"weight\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/params.proto b/packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/params.proto new file mode 100644 index 000000000..07958db5d --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/params.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; +package OmniFlix.marketplace.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/marketplace/types"; +option (gogoproto.goproto_getters_all) = false; + + + +message Params { + string sale_commission = 1 [ + (gogoproto.moretags) = "yaml:\"sale_commission\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + Distribution distribution = 2 [(gogoproto.nullable) = false]; + google.protobuf.Duration bid_close_duration = 3 [ + (gogoproto.moretags) = "yaml:\"bid_close_duration\"", + (gogoproto.stdduration) = true, + (gogoproto.nullable) = false + ]; + google.protobuf.Duration max_auction_duration = 4 [ + (gogoproto.moretags) = "yaml:\"max_auction_duration\"", + (gogoproto.stdduration) = true, + (gogoproto.nullable) = false + ]; +} + +message Distribution { + string staking = 1 [ + (gogoproto.moretags) = "yaml:\"staking\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + string community_pool = 2 [ + (gogoproto.moretags) = "yaml:\"community_pool\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/query.proto b/packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/query.proto new file mode 100644 index 000000000..62ccb4ebe --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/query.proto @@ -0,0 +1,173 @@ +syntax = "proto3"; +package OmniFlix.marketplace.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "OmniFlix/marketplace/v1beta1/listing.proto"; +import "OmniFlix/marketplace/v1beta1/params.proto"; +import "OmniFlix/marketplace/v1beta1/auction.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/marketplace/types"; + +service Query { + // Params queries params of the marketplace module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/omniflix/marketplace/v1beta1/params"; + } + + rpc Listings(QueryListingsRequest) returns (QueryListingsResponse) { + option (google.api.http).get = "/omniflix/marketplace/v1beta1/listings"; + } + + rpc Listing(QueryListingRequest) returns (QueryListingResponse) { + option (google.api.http).get = "/omniflix/marketplace/v1beta1/listings/{id}"; + } + + rpc ListingsByOwner(QueryListingsByOwnerRequest) returns (QueryListingsByOwnerResponse) { + option (google.api.http).get = "/omniflix/marketplace/v1beta1/listings-by-owner/{owner}"; + } + + rpc ListingsByPriceDenom(QueryListingsByPriceDenomRequest) returns (QueryListingsByPriceDenomResponse) { + option (google.api.http).get = "/omniflix/marketplace/v1beta1/listings-by-price-denom/{price_denom}"; + } + + rpc ListingByNftId(QueryListingByNFTIDRequest) returns (QueryListingResponse) { + option (google.api.http).get = "/omniflix/marketplace/v1beta1/listing-by-nft/{nft_id}"; + } + + // auction queries + rpc Auctions(QueryAuctionsRequest) returns (QueryAuctionsResponse) { + option (google.api.http).get = "/omniflix/marketplace/v1beta1/auctions"; + } + + rpc Auction(QueryAuctionRequest) returns (QueryAuctionResponse) { + option (google.api.http).get = "/omniflix/marketplace/v1beta1/auctions/{id}"; + } + + rpc AuctionsByOwner(QueryAuctionsByOwnerRequest) returns (QueryAuctionsResponse) { + option (google.api.http).get = "/omniflix/marketplace/v1beta1/auctions-by-owner/{owner}"; + } + + rpc AuctionsByPriceDenom(QueryAuctionsByPriceDenomRequest) returns (QueryAuctionsResponse) { + option (google.api.http).get = "/omniflix/marketplace/v1beta1/auctions-by-price-denom/{price_denom}"; + } + + rpc AuctionByNftId(QueryAuctionByNFTIDRequest) returns (QueryAuctionResponse) { + option (google.api.http).get = "/omniflix/marketplace/v1beta1/auction-by-nft/{nft_id}"; + } + + rpc Bids(QueryBidsRequest) returns (QueryBidsResponse) { + option (google.api.http).get = "/omniflix/marketplace/v1beta1/bids"; + } + + rpc Bid(QueryBidRequest) returns (QueryBidResponse) { + option (google.api.http).get = "/omniflix/marketplace/v1beta1/bids/{id}"; + } +} + + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false]; +} + +message QueryListingsRequest { + string owner = 1; + string price_denom = 2 [(gogoproto.moretags) = "yaml:\"price_denom\""]; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +message QueryListingsResponse { + repeated Listing listings = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryListingRequest { + string id = 1; +} + +message QueryListingResponse { + Listing listing = 1; +} + +message QueryListingsByOwnerRequest { + string owner = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message QueryListingsByOwnerResponse { + repeated Listing listings = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryListingByNFTIDRequest { + string nft_id = 1 [(gogoproto.moretags) = "yaml:\"nft_id\""]; +} + +message QueryListingsByPriceDenomRequest { + string price_denom = 1 [(gogoproto.moretags) = "yaml:\"price_denom\""]; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message QueryListingsByPriceDenomResponse { + repeated Listing listings = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryAuctionsRequest { + AuctionStatus status = 1; + string owner = 2; + string price_denom = 3 [(gogoproto.moretags) = "yaml:\"price_denom\""]; + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +message QueryAuctionsResponse { + repeated AuctionListing auctions = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryAuctionRequest { + uint64 id = 1; +} + +message QueryAuctionResponse { + AuctionListing auction = 1; +} + +message QueryAuctionsByOwnerRequest { + string owner = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message QueryAuctionByNFTIDRequest { + string nft_id = 1 [(gogoproto.moretags) = "yaml:\"nft_id\""]; +} + +message QueryAuctionsByPriceDenomRequest { + string price_denom = 1 [(gogoproto.moretags) = "yaml:\"price_denom\""]; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message QueryBidsRequest { + string bidder = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message QueryBidsResponse { + repeated Bid bids = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; + +} + +message QueryBidRequest { + uint64 id = 1; +} + +message QueryBidResponse { + Bid bid = 1; +} diff --git a/packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/tx.proto b/packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/tx.proto new file mode 100644 index 000000000..f8a7f0605 --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/marketplace/v1beta1/tx.proto @@ -0,0 +1,187 @@ +syntax = "proto3"; +package OmniFlix.marketplace.v1beta1; + +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "OmniFlix/marketplace/v1beta1/listing.proto"; +import "OmniFlix/marketplace/v1beta1/auction.proto"; +import "OmniFlix/marketplace/v1beta1/params.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/marketplace/types"; +option (gogoproto.goproto_getters_all) = false; + +service Msg { + option (cosmos.msg.v1.service) = true; + + rpc ListNFT(MsgListNFT) returns (MsgListNFTResponse); + + rpc EditListing(MsgEditListing) returns (MsgEditListingResponse); + + rpc DeListNFT(MsgDeListNFT) returns (MsgDeListNFTResponse); + + rpc BuyNFT(MsgBuyNFT) returns (MsgBuyNFTResponse); + + rpc CreateAuction(MsgCreateAuction) returns (MsgCreateAuctionResponse); + + rpc CancelAuction(MsgCancelAuction) returns (MsgCancelAuctionResponse); + + rpc PlaceBid(MsgPlaceBid) returns (MsgPlaceBidResponse); + + // UpdateParams defines a governance operation for updating the x/marketplace module + // parameters. The authority is hard-coded to the x/marketplace module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + +} + + +message MsgListNFT { + option (cosmos.msg.v1.signer) = "owner"; + option (amino.name) = "OmniFlix/marketplace/MsgListNFT"; + option (gogoproto.equal) = false; + + string id = 1; + string nft_id = 2; + string denom_id = 3; + cosmos.base.v1beta1.Coin price = 4 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + string owner = 5; + repeated WeightedAddress split_shares = 6 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"split_shares\"" + ]; +} +message MsgListNFTResponse {} + +message MsgEditListing { + option (cosmos.msg.v1.signer) = "owner"; + option (amino.name) = "OmniFlix/marketplace/MsgEditListing"; + option (gogoproto.equal) = false; + + string id = 1; + cosmos.base.v1beta1.Coin price = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + string owner = 3; +} +message MsgEditListingResponse {} + +message MsgDeListNFT { + option (cosmos.msg.v1.signer) = "owner"; + option (amino.name) = "OmniFlix/marketplace/MsgDeListNFT"; + option (gogoproto.equal) = false; + + string id = 1; + string owner = 2; +} + +message MsgDeListNFTResponse {} + +message MsgBuyNFT { + option (cosmos.msg.v1.signer) = "buyer"; + option (amino.name) = "OmniFlix/marketplace/MsgBuyNFT"; + option (gogoproto.equal) = false; + + string id = 1; + cosmos.base.v1beta1.Coin price = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + string buyer = 3; +} + +message MsgBuyNFTResponse {} + +message MsgCreateAuction { + option (cosmos.msg.v1.signer) = "owner"; + option (amino.name) = "OmniFlix/marketplace/MsgCreateAuction"; + option (gogoproto.equal) = false; + + string nft_id = 1; + string denom_id = 2; + google.protobuf.Timestamp start_time = 3 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"start_time\"" + ]; + cosmos.base.v1beta1.Coin start_price = 4 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.moretags) = "yaml:\"start_price\"" + ]; + google.protobuf.Duration duration = 5 [(gogoproto.stdduration) = true]; + string increment_percentage = 6 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"increment_percentage\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec" + ]; + repeated string whitelist_accounts = 7 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"whitelist_accounts\"" + ]; + repeated WeightedAddress split_shares = 8 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"split_shares\"" + ]; + string owner = 9; +} + +message MsgCreateAuctionResponse { + AuctionListing auction = 1; +} + +message MsgCancelAuction { + option (cosmos.msg.v1.signer) = "owner"; + option (amino.name) = "OmniFlix/marketplace/MsgCancelAuction"; + option (gogoproto.equal) = false; + + uint64 auction_id = 1 [(gogoproto.moretags) = "yaml:\"auction_id\""]; + string owner = 2; +} + +message MsgCancelAuctionResponse {} + +message MsgPlaceBid { + option (cosmos.msg.v1.signer) = "bidder"; + option (amino.name) = "OmniFlix/marketplace/MsgPlaceBid"; + option (gogoproto.equal) = false; + + uint64 auction_id = 1 [(gogoproto.moretags) = "yaml:\"auction_id\""]; + cosmos.base.v1beta1.Coin amount = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + string bidder = 3; +} + +message MsgPlaceBidResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/marketplace parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/packages/types/protobuf/proto/OmniFlix/onft/v1beta1/genesis.proto b/packages/types/protobuf/proto/OmniFlix/onft/v1beta1/genesis.proto new file mode 100644 index 000000000..ca1e430eb --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/onft/v1beta1/genesis.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package OmniFlix.onft.v1beta1; + +import "gogoproto/gogo.proto"; +import "OmniFlix/onft/v1beta1/onft.proto"; +import "OmniFlix/onft/v1beta1/params.proto"; +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/onft/types"; + +// GenesisState defines the nft module's genesis state. +message GenesisState { + repeated Collection collections = 1 [(gogoproto.nullable) = false]; + Params params = 2 [(gogoproto.nullable) = false]; +} diff --git a/packages/types/protobuf/proto/OmniFlix/onft/v1beta1/onft.proto b/packages/types/protobuf/proto/OmniFlix/onft/v1beta1/onft.proto new file mode 100644 index 000000000..b23cd4a0e --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/onft/v1beta1/onft.proto @@ -0,0 +1,131 @@ +syntax = "proto3"; +package OmniFlix.onft.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/onft/types"; +option (gogoproto.goproto_getters_all) = false; + +// Collection +message Collection { + Denom denom = 1 [(gogoproto.nullable) = false]; + repeated ONFT onfts = 2 [(gogoproto.customname) = "ONFTs", (gogoproto.nullable) = false]; +} + +message IDCollection { + string denom_id = 1 [(gogoproto.moretags) = "yaml:\"denom_id\""]; + repeated string onft_ids = 2 [(gogoproto.moretags) = "yaml:\"onft_ids\""]; +} + +message Denom { + string id = 1; + string symbol = 2; + string name = 3; + string schema = 4; + string creator = 5; + string description = 6; + string preview_uri = 7 [ + (gogoproto.moretags) = "yaml:\"preview_uri\"", + (gogoproto.customname) = "PreviewURI" + ]; + string uri = 8; + string uri_hash = 9; + string data = 10; + repeated WeightedAddress royalty_receivers = 11 [ + (gogoproto.moretags) = "yaml:\"royalty_receivers\"" + ]; +} + +message DenomMetadata { + string creator = 1; + string schema = 2; + string description = 3; + string preview_uri = 4; + string data = 5; + string uri_hash = 6; + repeated WeightedAddress royalty_receivers = 7 [ + (gogoproto.moretags) = "yaml:\"royalty_receivers\"" + ]; +} + +//ASSET or ONFT +message ONFT { + option (gogoproto.equal) = true; + + string id = 1; + Metadata metadata = 2 [(gogoproto.nullable) = false]; + string data = 3; + string owner = 4; + bool transferable = 5; + bool extensible = 6; + google.protobuf.Timestamp created_at = 7 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"created_at\"" + ]; + bool nsfw = 8; + string royalty_share = 9 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"royalty_share\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec" + ]; +} + +message Metadata { + option (gogoproto.equal) = true; + + string name = 1 [(gogoproto.moretags) = "yaml:\"name\""]; + string description = 2 [(gogoproto.moretags) = "yaml:\"description\""]; + string media_uri = 3 [ + (gogoproto.moretags) = "yaml:\"media_uri\"", + (gogoproto.customname) = "MediaURI" + ]; + string preview_uri = 4 [ + (gogoproto.moretags) = "yaml:\"preview_uri\"", + (gogoproto.customname) = "PreviewURI" + ]; + string uri_hash = 5; +} + +message ONFTMetadata { + string name = 1; + string description =2; + string preview_uri = 3 [ + (gogoproto.moretags) = "yaml:\"preview_uri\"", + (gogoproto.customname) = "PreviewURI" + ]; + string data = 4; + bool transferable = 5; + bool extensible = 6; + google.protobuf.Timestamp created_at = 7 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"created_at\"" + ]; + bool nsfw = 8; + string royalty_share = 9 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"royalty_share\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec" + ]; + string uri_hash = 10; +} + +message Owner { + string address = 1; + repeated IDCollection id_collections = 2 [ + (gogoproto.moretags) = "yaml:\"idcs\"", + (gogoproto.customname) = "IDCollections", + (gogoproto.nullable) = false + ]; +} + +message WeightedAddress { + string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + string weight = 2 [ + (gogoproto.moretags) = "yaml:\"weight\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/OmniFlix/onft/v1beta1/params.proto b/packages/types/protobuf/proto/OmniFlix/onft/v1beta1/params.proto new file mode 100644 index 000000000..22af8cce5 --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/onft/v1beta1/params.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package OmniFlix.onft.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/onft/types"; +option (gogoproto.goproto_getters_all) = false; + + + +message Params { + cosmos.base.v1beta1.Coin denom_creation_fee = 1 [ + (gogoproto.moretags) = "yaml:\"denom_creation_fee\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/OmniFlix/onft/v1beta1/query.proto b/packages/types/protobuf/proto/OmniFlix/onft/v1beta1/query.proto new file mode 100644 index 000000000..93be694dd --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/onft/v1beta1/query.proto @@ -0,0 +1,151 @@ +syntax = "proto3"; +package OmniFlix.onft.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "OmniFlix/onft/v1beta1/onft.proto"; +import "OmniFlix/onft/v1beta1/params.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/onft/types"; + +service Query { + rpc Collection(QueryCollectionRequest) returns (QueryCollectionResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/collections/{denom_id}"; + } + + rpc IBCCollection(QueryIBCCollectionRequest) returns (QueryCollectionResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/collections/ibc/{hash}"; + } + + rpc Denom(QueryDenomRequest) returns (QueryDenomResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/denoms/{denom_id}"; + } + + rpc IBCDenom(QueryIBCDenomRequest) returns (QueryDenomResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/denoms/ibc/{hash}"; + } + + rpc Denoms(QueryDenomsRequest) returns (QueryDenomsResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/denoms"; + } + rpc ONFT(QueryONFTRequest) returns (QueryONFTResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/denoms/{denom_id}/onfts/{id}"; + } + rpc IBCDenomONFT(QueryIBCDenomONFTRequest) returns (QueryONFTResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/denoms/ibc/{hash}/onfts/{id}"; + } + rpc OwnerONFTs(QueryOwnerONFTsRequest) returns (QueryOwnerONFTsResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/onfts/{denom_id}/{owner}"; + } + rpc OwnerIBCDenomONFTs(QueryOwnerIBCDenomONFTsRequest) returns (QueryOwnerONFTsResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/onfts/ibc/{hash}/{owner}"; + } + rpc Supply(QuerySupplyRequest) returns (QuerySupplyResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/denoms/{denom_id}/supply"; + } + rpc IBCDenomSupply(QueryIBCDenomSupplyRequest) returns (QuerySupplyResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/denoms/ibc/{hash}/supply"; + } + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/params"; + } +} + +message QueryCollectionRequest { + string denom_id = 1 [(gogoproto.moretags) = "yaml:\"denom_id\""]; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message QueryCollectionResponse { + Collection collection = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryIBCCollectionRequest { + string hash = 1 [(gogoproto.moretags) = "yaml:\"hash\""]; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message QueryDenomRequest { + string denom_id = 1 [(gogoproto.moretags) = "yaml:\"denom_id\""]; +} + +message QueryDenomResponse { + Denom denom = 1; +} + +message QueryIBCDenomRequest { + string hash = 1 [(gogoproto.moretags) = "yaml:\"hash\""]; +} + +message QueryDenomsRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; + string owner = 2; +} + +message QueryDenomsResponse { + repeated Denom denoms = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryONFTRequest { + string denom_id = 1 [(gogoproto.moretags) = "yaml:\"denom_id\""]; + string id = 2; +} + +message QueryONFTResponse { + ONFT onft = 1 [(gogoproto.customname) = "ONFT"]; +} + +message QueryIBCDenomONFTRequest { + string hash = 1 [(gogoproto.moretags) = "yaml:\"hash\""]; + string id = 2; +} + + +message QueryOwnerONFTsRequest { + string denom_id = 1 [(gogoproto.moretags) = "yaml:\"denom_id\""]; + string owner = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +message QueryOwnerONFTsResponse { + Owner owner = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryOwnerIBCDenomONFTsRequest { + string hash = 1 [(gogoproto.moretags) = "yaml:\"hash\""]; + string owner = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +message QuerySupplyRequest { + string denom_id = 1 [(gogoproto.moretags) = "yaml:\"denom_id\""]; + string owner = 2; +} + +message QuerySupplyResponse { + uint64 amount = 1; +} + +message QueryIBCDenomSupplyRequest { + string hash = 1 [(gogoproto.moretags) = "yaml:\"hash\""]; + string owner = 2; +} + +message OwnerONFTCollection { + Denom denom = 1 [(gogoproto.nullable) = false]; + repeated ONFT onfts = 2 [(gogoproto.nullable) = false]; +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false]; +} \ No newline at end of file diff --git a/packages/types/protobuf/proto/OmniFlix/onft/v1beta1/tx.proto b/packages/types/protobuf/proto/OmniFlix/onft/v1beta1/tx.proto new file mode 100644 index 000000000..8ccbc2511 --- /dev/null +++ b/packages/types/protobuf/proto/OmniFlix/onft/v1beta1/tx.proto @@ -0,0 +1,179 @@ +syntax = "proto3"; +package OmniFlix.onft.v1beta1; + +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; +import "OmniFlix/onft/v1beta1/params.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "OmniFlix/onft/v1beta1/onft.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v5/x/onft/types"; +option (gogoproto.goproto_getters_all) = false; + +service Msg { + option (cosmos.msg.v1.service) = true; + + rpc CreateDenom(MsgCreateDenom) returns (MsgCreateDenomResponse); + + rpc UpdateDenom(MsgUpdateDenom) returns (MsgUpdateDenomResponse); + + rpc TransferDenom(MsgTransferDenom) returns (MsgTransferDenomResponse); + + rpc PurgeDenom(MsgPurgeDenom) returns (MsgPurgeDenomResponse); + + rpc MintONFT(MsgMintONFT) returns (MsgMintONFTResponse); + + rpc TransferONFT(MsgTransferONFT) returns (MsgTransferONFTResponse); + + rpc BurnONFT(MsgBurnONFT) returns (MsgBurnONFTResponse); + + // UpdateParams defines a governance operation for updating the onft module + // parameters. The authority is hard-coded to the onft module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +message MsgCreateDenom { + option (cosmos.msg.v1.signer) = "sender"; + option (amino.name) = "OmniFlix/onft/MsgCreateDenom"; + option (gogoproto.equal) = false; + + string id = 1; + string symbol = 2; + string name = 3; + string description = 4; + string preview_uri = 5 [ + (gogoproto.moretags) = "yaml:\"preview_uri\"", + (gogoproto.customname) = "PreviewURI" + ]; + string schema = 6; + string sender = 7; + cosmos.base.v1beta1.Coin creation_fee = 8 [ + (gogoproto.moretags) = "yaml:\"creation_fee\"", + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + string uri = 9; + string uri_hash = 10; + string data = 11; + repeated WeightedAddress royalty_receivers = 12 [ + (gogoproto.moretags) = "yaml:\"royalty_receivers\"" + ]; +} + +message MsgCreateDenomResponse {} + +message MsgUpdateDenom { + option (cosmos.msg.v1.signer) = "sender"; + option (amino.name) = "OmniFlix/onft/MsgUpdateDenom"; + option (gogoproto.equal) = false; + + string id = 1; + string name = 2; + string description = 3; + string preview_uri = 4 [ + (gogoproto.moretags) = "yaml:\"preview_uri\"", + (gogoproto.customname) = "PreviewURI" + ]; + string sender = 5; + repeated WeightedAddress royalty_receivers = 6 [ + (gogoproto.moretags) = "yaml:\"royalty_receivers\"" + ]; +} + +message MsgUpdateDenomResponse {} + +message MsgPurgeDenom { + option (cosmos.msg.v1.signer) = "sender"; + option (amino.name) = "OmniFlix/onft/MsgPurgeDenom"; + option (gogoproto.equal) = false; + + string id = 1; + string sender = 2; +} + +message MsgPurgeDenomResponse {} + +message MsgTransferDenom { + option (cosmos.msg.v1.signer) = "sender"; + option (amino.name) = "OmniFlix/onft/MsgTransferDenom"; + option (gogoproto.equal) = false; + + string id = 1; + string sender = 2; + string recipient = 3; +} + +message MsgTransferDenomResponse {} + +message MsgMintONFT { + option (cosmos.msg.v1.signer) = "sender"; + option (amino.name) = "OmniFlix/onft/MsgMintONFT"; + option (gogoproto.equal) = false; + + string id = 1; + string denom_id = 2 [(gogoproto.moretags) = "yaml:\"denom_id\""]; + Metadata metadata = 3 [(gogoproto.nullable) = false]; + string data = 4; + bool transferable = 5; + bool extensible = 6; + bool nsfw = 7; + string royalty_share = 8 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"royalty_share\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec" + ]; + string sender = 9; + string recipient = 10; +} + +message MsgMintONFTResponse {} + +message MsgTransferONFT { + option (cosmos.msg.v1.signer) = "sender"; + option (amino.name) = "OmniFlix/onft/MsgTransferONFT"; + option (gogoproto.equal) = false; + + string id = 1; + string denom_id = 2 [(gogoproto.moretags) = "yaml:\"denom_id\""]; + string sender = 3; + string recipient = 4; +} + +message MsgTransferONFTResponse {} + +message MsgBurnONFT { + option (cosmos.msg.v1.signer) = "sender"; + option (amino.name) = "OmniFlix/onft/MsgBurnONFT"; + option (gogoproto.equal) = false; + + string id = 1; + string denom_id = 2 [(gogoproto.moretags) = "yaml:\"denom_id\""]; + string sender = 3; +} + +message MsgBurnONFTResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the onft module parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/packages/types/protobuf/scripts/codegen.js b/packages/types/protobuf/scripts/codegen.js index 247dde379..9178f1948 100644 --- a/packages/types/protobuf/scripts/codegen.js +++ b/packages/types/protobuf/scripts/codegen.js @@ -122,6 +122,7 @@ telescope({ 'secret.emergencybutton.v1beta1', 'secret.intertx.v1beta1', 'secret.registration.v1beta1', + 'OmniFlix.onft.v1beta1', // interferes with v1beta1 MsgSubmitProposal amino encoders since the // type names overlap diff --git a/packages/types/protobuf/utils.ts b/packages/types/protobuf/utils.ts index de3d1920a..111087f44 100644 --- a/packages/types/protobuf/utils.ts +++ b/packages/types/protobuf/utils.ts @@ -40,6 +40,8 @@ import { kujiraProtoRegistry, neutronAminoConverters, neutronProtoRegistry, + omniFlixAminoConverters, + omniFlixProtoRegistry, osmosisAminoConverters, osmosisProtoRegistry, pstakeAminoConverters, @@ -691,6 +693,7 @@ export const PROTOBUF_TYPES: ReadonlyArray<[string, GeneratedType]> = [ ...pstakeProtoRegistry, ...bitsongProtoRegistry, ...secretProtoRegistry, + ...omniFlixProtoRegistry, // Not a query or TX so it isn't included in any of the registries. But we // want to decode this because it appears in gov props. We need to find a // better way to collect all generated types in a single registry... @@ -731,6 +734,7 @@ export const aminoTypes = new AminoTypes({ ...pstakeAminoConverters, ...bitsongAminoConverters, ...secretAminoConverters, + ...omniFlixAminoConverters, }) // Encodes a protobuf message value from its JSON representation into a byte diff --git a/packages/types/token.ts b/packages/types/token.ts index 0ea27ce1f..c36a628e4 100644 --- a/packages/types/token.ts +++ b/packages/types/token.ts @@ -12,9 +12,22 @@ import { TokenInfoResponse } from './contracts/Cw20Base' import { LoadingData, LoadingDataWithError } from './misc' export enum TokenType { + /** + * Native token. + */ Native = 'native', + /** + * CosmWasm token. + */ Cw20 = 'cw20', + /** + * CosmWasm NFT. + */ Cw721 = 'cw721', + /** + * OmniFlix ONFT. + */ + Onft = 'onft', } export type GenericTokenSource = Pick< diff --git a/packages/utils/client.ts b/packages/utils/client.ts index 9b21c2059..a67d2f2f2 100644 --- a/packages/utils/client.ts +++ b/packages/utils/client.ts @@ -9,6 +9,7 @@ import { } from '@cosmjs/tendermint-rpc' import { + OmniFlix, cosmos, cosmwasm, feemarket, @@ -277,6 +278,22 @@ export const kujiraProtoRpcClientRouter = new ChainClientRouter({ ), }) +/* + * Router for connecting to an RPC client with OmniFlix protobufs. + */ +export const omniflixProtoRpcClientRouter = new ChainClientRouter({ + handleConnect: async (chainId: string) => + retry( + 10, + async (attempt) => + ( + await OmniFlix.ClientFactory.createRPCQueryClient({ + rpcEndpoint: getRpcForChainId(chainId, attempt - 1), + }) + ).OmniFlix + ), +}) + /* * Router for connecting to an RPC client with feemarket protobufs. */ diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 7a8638b39..c337f47be 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -2116,8 +2116,6 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ name: 'omniflixhub', mainnet: false, accentColor: '#d71d6a', - // NFT DAOs not yet ready. - nftDaosUnderDevelopment: true, factoryContractAddress: 'omniflix1990vf0gumc2wqynl6cr836avhfd89y9225q0dk0s5dwzm7pnkgtqmn4dy7', explorerUrlTemplates: { @@ -2144,6 +2142,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ DaoProposalSingle: 194, DaoVotingCw4: 195, DaoVotingTokenStaked: 197, + DaoVotingOnftStaked: 198, // Unused DaoVotingCw721Staked: -1, diff --git a/packages/utils/constants/contracts.ts b/packages/utils/constants/contracts.ts index 5e5462fab..e6c555f56 100644 --- a/packages/utils/constants/contracts.ts +++ b/packages/utils/constants/contracts.ts @@ -65,6 +65,10 @@ export const DAO_VOTING_CW721_STAKED_CONTRACT_NAMES = [ 'crates.io:dao-voting-snip721-staked', ] +export const DAO_VOTING_ONFT_STAKED_CONTRACT_NAMES = [ + 'crates.io:dao-voting-onft-staked', +] + export const DAO_VOTING_TOKEN_STAKED_CONTRACT_NAMES = [ // V2.3.0+ 'crates.io:dao-voting-token-staked', diff --git a/packages/utils/pagination.ts b/packages/utils/pagination.ts index 7f02dd312..25d4cbc59 100644 --- a/packages/utils/pagination.ts +++ b/packages/utils/pagination.ts @@ -6,14 +6,15 @@ import { export const getAllRpcResponse = async < P extends { pagination?: PageRequest; [key: string]: any }, R extends { pagination?: PageResponse; [key: string]: any }, - K extends keyof R + K extends keyof R, + V = R[K] extends any[] ? R[K] : R[K][] >( queryFn: (params: P, useInterfaces?: boolean) => Promise, params: P, key: K, reverse = false, useInterfaces = false -): Promise => { +): Promise => { let pagination: Partial | undefined const data = [] as any[] @@ -39,14 +40,21 @@ export const getAllRpcResponse = async < } : undefined - const results = response[key] as any[] - // If no results retrieved, stop. - if (!results?.length) { - break - } + const results = response[key] as any - data.push(...results) + // If `key` accesses an array, flatten into result data. Otherwise, just + // concatenate all the responses (in case the paginated array is nested + // inside `key`). + if (Array.isArray(results)) { + // If no results retrieved, stop. + if (!results?.length) { + break + } + data.push(...results) + } else { + data.push(results) + } } while (pagination !== undefined) - return data as R[K] + return data as V } From 1060af394a6621cc3896b264a05dab5fbeeee779 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 8 Jul 2024 19:02:07 -0400 Subject: [PATCH 299/438] updated secret testnet code IDs and hashes --- packages/utils/constants/chains.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index c337f47be..812a7e287 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -2148,7 +2148,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ DaoVotingCw721Staked: -1, }, }, - // TODO(secret-testnet) + // // TODO(secret-testnet) // { // chainId: ChainId.SecretTestnet, // name: 'secret', @@ -2167,20 +2167,20 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // codeIds: { // // TODO(secret-testnet) // Cw1Whitelist: -1, - // Cw4Group: 8168, + // Cw4Group: 9158, // Cw20Base: 8164, // snip20 // Cw721Base: 8172, // snip721 // CwPayrollFactory: 8186, // CwTokenSwap: 8187, // CwVesting: 8189, - // DaoCore: 8607, + // DaoCore: 9155, // DaoPreProposeApprovalSingle: 8180, // DaoPreProposeApprover: 8181, // DaoPreProposeMultiple: 8177, // DaoPreProposeSingle: 8175, // DaoProposalMultiple: 8178, // DaoProposalSingle: 8176, - // DaoVotingCw4: 8169, + // DaoVotingCw4: 9160, // DaoVotingCw20Staked: 8170, // snip20 // DaoVotingCw721Staked: 8182, // snip721 // DaoVotingTokenStaked: 8174, @@ -2194,7 +2194,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // // TODO(secret-testnet) // Cw1Whitelist: '', // Cw4Group: - // '0945d46e86259fffb84c5d7d501f773071ef8101a4112ae5ce1847c2abe297ab', + // '588d5b95d865df2b18d05fa32f93fc6d82864ec84cca87ef139390e6e0524e58', // Cw20Base: // 'c2508a75824974eeaa578a5d1af07006b1c3911b5c2909813d74672797264775', // snip20 // Cw721Base: @@ -2206,7 +2206,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // CwVesting: // '0dae83b3616c066d0cdbf061b977707f99d6b91bdc7b44a81285a688e37552b0', // DaoCore: - // 'ad3f67d0983fd13726f34148835e07f65f9225ad698a30d0b55e78e783363fd4', + // '24514b34e44eed3898400192d8744fdb0f89cb98cec0377127d364dc2e71ce6f', // DaoPreProposeApprovalSingle: // '88410e9c96687c01af289c59730d90a425a974c81abf20a76597f076959cb7fc', // DaoPreProposeApprover: @@ -2220,7 +2220,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // DaoProposalSingle: // '0d412146fccc5936cacc463db54e7721eae03d13977e4c3c3ee570fdbba530c6', // DaoVotingCw4: - // '732a247721d7629a0c33bbf39c40a5b410fcd7d9b58415f3bcd91fb68a792176', + // 'f80641ebe9bf07ac2e44f6a7c33de7ece8d4706a709b3ea2ccad046384251009', // DaoVotingCw20Staked: // '715b7aa5925b46a7fcff277f4ad3763016429daec8ddedd568f892dad2eb88d0', // snip20 // DaoVotingCw721Staked: From b2243d4187600a89a0d85f6220d590695b433d4a Mon Sep 17 00:00:00 2001 From: ismellike Date: Tue, 9 Jul 2024 00:15:14 -0500 Subject: [PATCH 300/438] Fix funds not being sent in prepropose.propose (#1802) --- .../SingleChoiceProposalModule.ts | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts b/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts index 066735412..cef3f5168 100644 --- a/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts +++ b/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts @@ -197,15 +197,20 @@ export class SingleChoiceProposalModule extends ProposalModuleBase< client, sender, this.prePropose.address - ).propose({ - msg: { - // Type mismatch between Cosmos msgs and Secret Network Cosmos msgs. - // The contract execution will fail if the messages are invalid, so - // this is safe. The UI should ensure that the co rrect messages are - // used for the given chain anyways. - propose: data as any, + ).propose( + { + msg: { + // Type mismatch between Cosmos msgs and Secret Network Cosmos msgs. + // The contract execution will fail if the messages are invalid, so + // this is safe. The UI should ensure that the co rrect messages are + // used for the given chain anyways. + propose: data as any, + }, }, - }) + undefined, + undefined, + funds + ) isPreProposeApprovalProposal = this.prePropose.contractName === ContractName.PreProposeApprovalSingle From 574e05dbd70e9812f22379c70c9c8d22f92b789f Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 9 Jul 2024 02:15:21 -0400 Subject: [PATCH 301/438] support dao-voting-sg-community-nft voting module --- packages/i18n/locales/en/translation.json | 8 +- .../contracts/DaoVotingSgCommunityNft.ts | 385 ++++++++++++++++ packages/state/contracts/index.ts | 4 + .../DaoVotingSgCommunityNft.extra.ts | 82 ++++ .../contracts/DaoVotingSgCommunityNft.ts | 426 ++++++++++++++++++ .../state/query/queries/contracts/index.ts | 2 + packages/stateful/clients/dao/CwDao.ts | 2 + .../SgCommunityNftVotingModule.ts | 62 +++ .../stateful/clients/voting-module/index.ts | 1 + .../ProfileCardMemberInfo.tsx | 11 +- .../components/MembersTab.tsx | 60 +++ .../components/ProfileCardMemberInfo.tsx | 402 +++++++++++++++++ .../components/index.ts | 2 + .../DaoVotingSgCommunityNft/hooks/index.ts | 1 + .../hooks/useMainDaoInfoCards.ts | 34 ++ .../adapters/DaoVotingSgCommunityNft/index.ts | 43 ++ .../voting-module-adapter/adapters/index.ts | 1 + .../stateful/voting-module-adapter/core.ts | 4 +- packages/types/clients/dao.ts | 9 +- packages/types/clients/voting-module.ts | 7 +- .../contracts/DaoVotingSgCommunityNft.ts | 131 ++++++ packages/utils/constants/chains.ts | 2 + packages/utils/constants/contracts.ts | 4 + packages/utils/format.ts | 4 +- 24 files changed, 1674 insertions(+), 13 deletions(-) create mode 100644 packages/state/contracts/DaoVotingSgCommunityNft.ts create mode 100644 packages/state/query/queries/contracts/DaoVotingSgCommunityNft.extra.ts create mode 100644 packages/state/query/queries/contracts/DaoVotingSgCommunityNft.ts create mode 100644 packages/stateful/clients/voting-module/SgCommunityNftVotingModule.ts create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingSgCommunityNft/components/MembersTab.tsx create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingSgCommunityNft/components/ProfileCardMemberInfo.tsx create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingSgCommunityNft/components/index.ts create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingSgCommunityNft/hooks/index.ts create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingSgCommunityNft/hooks/useMainDaoInfoCards.ts create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingSgCommunityNft/index.ts create mode 100644 packages/types/contracts/DaoVotingSgCommunityNft.ts diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 8dfb24f29..215036638 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -155,6 +155,7 @@ "installKeplr": "Install Keplr", "instantiate": "Instantiate", "keepNotification": "Keep notification", + "leaveDao": "Leave DAO", "loadDraft": "Load draft", "loadMessageTemplate": "Load message template", "loadMore": "Load more", @@ -199,6 +200,7 @@ "refundAndCancel": "Refund and cancel", "register": "Register", "registerSlashes": "Register slashes", + "registerToVote": "Register to vote", "registered": "Registered", "reject": "Reject", "relay": "Relay", @@ -1075,8 +1077,7 @@ "meBalancesNftsDescription": "These are the NFTs you own on {{chainName}}.", "members": "members", "membersTooltip": "The number of members in the DAO.", - "membershipDaoNotMemberInfo_dao": "You are not a member of {{daoName}}. To become a member, existing members must vote to add you.", - "membershipDaoNotMemberInfo_proposal": "You were not a member of {{daoName}} when this proposal was created, so you cannot vote on it.", + "membershipDaoNotMemberInfo": "You are not a member of {{daoName}}. To become a member, existing members must vote to add you.", "memoPlaceholder": "Enter a memo (optional)...", "mergeProfilesExplanation": "Select the profile you want to keep (the rest will be merged into it).", "mergeProfilesTooltip": "Your wallet is attached to multiple profiles. Merge them to avoid confusion.", @@ -1134,6 +1135,7 @@ "none": "None", "notAdmin": "Your DAO is not the admin of this contract. The proposal will not be executable while this is the case.", "notInstalledWalletsTooltip": "Wallets which do not seem to be installed.", + "notMemberForProposal": "You were not a member of {{daoName}} when this proposal was created, so you cannot vote on it.", "notMet": "Not met", "nothingFound": "Nothing found.", "nothingHereYet": "Nothing here yet.", @@ -1495,11 +1497,13 @@ "proposalSimulation": "Proposal simulated successfully. If executed right now, it would not fail.", "proposalVetoed": "Proposal vetoed.", "ratingsSubmitted": "Ratings submitted.", + "registered": "Registered successfully.", "restaked": "Restaked successfully.", "saved": "Saved successfully.", "staked": "Staked successfully.", "tokenSwapContractInstantiated": "Token swap created successfully.", "transactionExecuted": "Transaction executed successfully.", + "unregistered": "Unregistered successfully.", "unstaked": "Unstaked successfully.", "voteCast": "Vote successfully cast.", "withdrewPayment": "Withdrew payment." diff --git a/packages/state/contracts/DaoVotingSgCommunityNft.ts b/packages/state/contracts/DaoVotingSgCommunityNft.ts new file mode 100644 index 000000000..8e450ffa6 --- /dev/null +++ b/packages/state/contracts/DaoVotingSgCommunityNft.ts @@ -0,0 +1,385 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import { Coin, StdFee } from '@cosmjs/amino' +import { + CosmWasmClient, + ExecuteResult, + SigningCosmWasmClient, +} from '@cosmjs/cosmwasm-stargate' + +import { + Action, + Addr, + HooksResponse, + InfoResponse, + ListVotersResponse, + OwnershipForString, + RegisteredNftResponse, + TotalPowerAtHeightResponse, + Uint128, + VotingPowerAtHeightResponse, +} from '@dao-dao/types/contracts/DaoVotingSgCommunityNft' +import { CHAIN_GAS_MULTIPLIER } from '@dao-dao/utils' + +export interface DaoVotingSgCommunityNftReadOnlyInterface { + contractAddress: string + nftContract: () => Promise + hooks: () => Promise + registeredNft: ({ + address, + }: { + address: string + }) => Promise + listVoters: ({ + limit, + startAfter, + }: { + limit?: number + startAfter?: string + }) => Promise + ownership: () => Promise + votingPowerAtHeight: ({ + address, + height, + }: { + address: string + height?: number + }) => Promise + totalPowerAtHeight: ({ + height, + }: { + height?: number + }) => Promise + dao: () => Promise + info: () => Promise +} +export class DaoVotingSgCommunityNftQueryClient + implements DaoVotingSgCommunityNftReadOnlyInterface +{ + client: CosmWasmClient + contractAddress: string + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client + this.contractAddress = contractAddress + this.nftContract = this.nftContract.bind(this) + this.hooks = this.hooks.bind(this) + this.registeredNft = this.registeredNft.bind(this) + this.listVoters = this.listVoters.bind(this) + this.ownership = this.ownership.bind(this) + this.votingPowerAtHeight = this.votingPowerAtHeight.bind(this) + this.totalPowerAtHeight = this.totalPowerAtHeight.bind(this) + this.dao = this.dao.bind(this) + this.info = this.info.bind(this) + } + nftContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + nft_contract: {}, + }) + } + hooks = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + hooks: {}, + }) + } + registeredNft = async ({ + address, + }: { + address: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + registered_nft: { + address, + }, + }) + } + listVoters = async ({ + limit, + startAfter, + }: { + limit?: number + startAfter?: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + list_voters: { + limit, + start_after: startAfter, + }, + }) + } + ownership = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership: {}, + }) + } + votingPowerAtHeight = async ({ + address, + height, + }: { + address: string + height?: number + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + voting_power_at_height: { + address, + height, + }, + }) + } + totalPowerAtHeight = async ({ + height, + }: { + height?: number + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + total_power_at_height: { + height, + }, + }) + } + dao = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + dao: {}, + }) + } + info = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + info: {}, + }) + } +} +export interface DaoVotingSgCommunityNftInterface + extends DaoVotingSgCommunityNftReadOnlyInterface { + contractAddress: string + sender: string + register: ( + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + unregister: ( + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + setVotingPower: ( + { + power, + tokenId, + }: { + power: Uint128 + tokenId: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + sync: ( + { + tokenId, + }: { + tokenId: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + addHook: ( + { + addr, + }: { + addr: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + removeHook: ( + { + addr, + }: { + addr: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + updateOwnership: ( + action: Action, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise +} +export class DaoVotingSgCommunityNftClient + extends DaoVotingSgCommunityNftQueryClient + implements DaoVotingSgCommunityNftInterface +{ + client: SigningCosmWasmClient + sender: string + contractAddress: string + constructor( + client: SigningCosmWasmClient, + sender: string, + contractAddress: string + ) { + super(client, contractAddress) + this.client = client + this.sender = sender + this.contractAddress = contractAddress + this.register = this.register.bind(this) + this.unregister = this.unregister.bind(this) + this.setVotingPower = this.setVotingPower.bind(this) + this.sync = this.sync.bind(this) + this.addHook = this.addHook.bind(this) + this.removeHook = this.removeHook.bind(this) + this.updateOwnership = this.updateOwnership.bind(this) + } + register = async ( + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + register: {}, + }, + fee, + memo, + _funds + ) + } + unregister = async ( + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + unregister: {}, + }, + fee, + memo, + _funds + ) + } + setVotingPower = async ( + { + power, + tokenId, + }: { + power: Uint128 + tokenId: string + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + set_voting_power: { + power, + token_id: tokenId, + }, + }, + fee, + memo, + _funds + ) + } + sync = async ( + { + tokenId, + }: { + tokenId: string + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + sync: { + token_id: tokenId, + }, + }, + fee, + memo, + _funds + ) + } + addHook = async ( + { + addr, + }: { + addr: string + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + add_hook: { + addr, + }, + }, + fee, + memo, + _funds + ) + } + removeHook = async ( + { + addr, + }: { + addr: string + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + remove_hook: { + addr, + }, + }, + fee, + memo, + _funds + ) + } + updateOwnership = async ( + action: Action, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + update_ownership: action, + }, + fee, + memo, + _funds + ) + } +} diff --git a/packages/state/contracts/index.ts b/packages/state/contracts/index.ts index 35a14f452..5d3957f9e 100644 --- a/packages/state/contracts/index.ts +++ b/packages/state/contracts/index.ts @@ -136,3 +136,7 @@ export { DaoVotingOnftStakedClient, DaoVotingOnftStakedQueryClient, } from './DaoVotingOnftStaked' +export { + DaoVotingSgCommunityNftClient, + DaoVotingSgCommunityNftQueryClient, +} from './DaoVotingSgCommunityNft' diff --git a/packages/state/query/queries/contracts/DaoVotingSgCommunityNft.extra.ts b/packages/state/query/queries/contracts/DaoVotingSgCommunityNft.extra.ts new file mode 100644 index 000000000..add82f956 --- /dev/null +++ b/packages/state/query/queries/contracts/DaoVotingSgCommunityNft.extra.ts @@ -0,0 +1,82 @@ +import { QueryClient, queryOptions } from '@tanstack/react-query' + +import { indexerQueries } from '../indexer' +import { cw721BaseQueries } from './Cw721Base' +import { daoVotingSgCommunityNftQueries } from './DaoVotingSgCommunityNft' + +/** + * Check if an address owns any NFT from the collection used by a + * dao-voting-sg-community-nft voting module. + */ +export const fetchDaoVotingSgCommunityNftWalletHasNft = async ( + queryClient: QueryClient, + { + chainId, + votingModuleAddress, + walletAddress, + }: { + chainId: string + votingModuleAddress: string + walletAddress: string + } +): Promise => { + const nftContract = await queryClient.fetchQuery( + daoVotingSgCommunityNftQueries.nftContract(queryClient, { + chainId, + contractAddress: votingModuleAddress, + }) + ) + + const { tokens } = await queryClient.fetchQuery( + cw721BaseQueries.tokens({ + chainId, + contractAddress: nftContract, + args: { + owner: walletAddress, + }, + }) + ) + + return tokens.length > 0 +} + +export const daoVotingSgCommunityNftExtraQueries = { + /** + * Fetch all voters for a dao-voting-sg-community-nft voting module. + */ + allVoters: ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } + ) => + indexerQueries.queryContract< + { + address: string + weight: number + votingPowerPercent: number + }[] + >(queryClient, { + chainId, + contractAddress: address, + formula: 'daoVotingSgCommunityNft/allVotersWithVotingPower', + noFallback: true, + }), + /** + * Check if an address owns any NFT from the collection used by a + * dao-voting-sg-community-nft voting module. + */ + walletHasNft: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['daoVotingSgCommunityNftExtra', 'walletHasNft', options], + queryFn: () => + fetchDaoVotingSgCommunityNftWalletHasNft(queryClient, options), + }), +} diff --git a/packages/state/query/queries/contracts/DaoVotingSgCommunityNft.ts b/packages/state/query/queries/contracts/DaoVotingSgCommunityNft.ts new file mode 100644 index 000000000..7a9f7a3bc --- /dev/null +++ b/packages/state/query/queries/contracts/DaoVotingSgCommunityNft.ts @@ -0,0 +1,426 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import { QueryClient, UseQueryOptions } from '@tanstack/react-query' + +import { + Addr, + HooksResponse, + InfoResponse, + ListVotersResponse, + OwnershipForString, + RegisteredNftResponse, + TotalPowerAtHeightResponse, + VotingPowerAtHeightResponse, +} from '@dao-dao/types/contracts/DaoVotingSgCommunityNft' +import { getCosmWasmClientForChainId } from '@dao-dao/utils' + +import { DaoVotingSgCommunityNftQueryClient } from '../../../contracts/DaoVotingSgCommunityNft' +import { contractQueries } from '../contract' +import { indexerQueries } from '../indexer' + +export const daoVotingSgCommunityNftQueryKeys = { + contract: [ + { + contract: 'daoVotingSgCommunityNft', + }, + ] as const, + address: (contractAddress: string) => + [ + { + ...daoVotingSgCommunityNftQueryKeys.contract[0], + address: contractAddress, + }, + ] as const, + nftContract: (contractAddress: string, args?: Record) => + [ + { + ...daoVotingSgCommunityNftQueryKeys.address(contractAddress)[0], + method: 'nft_contract', + args, + }, + ] as const, + hooks: (contractAddress: string, args?: Record) => + [ + { + ...daoVotingSgCommunityNftQueryKeys.address(contractAddress)[0], + method: 'hooks', + args, + }, + ] as const, + registeredNft: (contractAddress: string, args?: Record) => + [ + { + ...daoVotingSgCommunityNftQueryKeys.address(contractAddress)[0], + method: 'registered_nft', + args, + }, + ] as const, + listVoters: (contractAddress: string, args?: Record) => + [ + { + ...daoVotingSgCommunityNftQueryKeys.address(contractAddress)[0], + method: 'list_voters', + args, + }, + ] as const, + ownership: (contractAddress: string, args?: Record) => + [ + { + ...daoVotingSgCommunityNftQueryKeys.address(contractAddress)[0], + method: 'ownership', + args, + }, + ] as const, + votingPowerAtHeight: ( + contractAddress: string, + args?: Record + ) => + [ + { + ...daoVotingSgCommunityNftQueryKeys.address(contractAddress)[0], + method: 'voting_power_at_height', + args, + }, + ] as const, + totalPowerAtHeight: ( + contractAddress: string, + args?: Record + ) => + [ + { + ...daoVotingSgCommunityNftQueryKeys.address(contractAddress)[0], + method: 'total_power_at_height', + args, + }, + ] as const, + dao: (contractAddress: string, args?: Record) => + [ + { + ...daoVotingSgCommunityNftQueryKeys.address(contractAddress)[0], + method: 'dao', + args, + }, + ] as const, + info: (contractAddress: string, args?: Record) => + [ + { + ...daoVotingSgCommunityNftQueryKeys.address(contractAddress)[0], + method: 'info', + args, + }, + ] as const, +} +export const daoVotingSgCommunityNftQueries = { + nftContract: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + options, + }: DaoVotingSgCommunityNftNftContractQuery + ): UseQueryOptions => ({ + queryKey: daoVotingSgCommunityNftQueryKeys.nftContract(contractAddress), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'daoVotingSgCommunityNft/nftContract', + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new DaoVotingSgCommunityNftQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).nftContract() + }, + ...options, + }), + hooks: ({ + chainId, + contractAddress, + options, + }: DaoVotingSgCommunityNftHooksQuery): UseQueryOptions< + HooksResponse, + Error, + TData + > => ({ + queryKey: daoVotingSgCommunityNftQueryKeys.hooks(contractAddress), + queryFn: async () => { + return new DaoVotingSgCommunityNftQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).hooks() + }, + ...options, + }), + registeredNft: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + args, + options, + }: DaoVotingSgCommunityNftRegisteredNftQuery + ): UseQueryOptions => ({ + queryKey: daoVotingSgCommunityNftQueryKeys.registeredNft( + contractAddress, + args + ), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'daoVotingSgCommunityNft/registeredNft', + args, + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new DaoVotingSgCommunityNftQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).registeredNft({ + address: args.address, + }) + }, + ...options, + }), + listVoters: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + args, + options, + }: DaoVotingSgCommunityNftListVotersQuery + ): UseQueryOptions => ({ + queryKey: daoVotingSgCommunityNftQueryKeys.listVoters( + contractAddress, + args + ), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'daoVotingSgCommunityNft/listVoters', + args, + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new DaoVotingSgCommunityNftQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).listVoters({ + limit: args.limit, + startAfter: args.startAfter, + }) + }, + ...options, + }), + ownership: ({ + chainId, + contractAddress, + options, + }: DaoVotingSgCommunityNftOwnershipQuery): UseQueryOptions< + OwnershipForString, + Error, + TData + > => ({ + queryKey: daoVotingSgCommunityNftQueryKeys.ownership(contractAddress), + queryFn: async () => { + return new DaoVotingSgCommunityNftQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).ownership() + }, + ...options, + }), + votingPowerAtHeight: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + args, + options, + }: DaoVotingSgCommunityNftVotingPowerAtHeightQuery + ): UseQueryOptions => ({ + queryKey: daoVotingSgCommunityNftQueryKeys.votingPowerAtHeight( + contractAddress, + args + ), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'daoVotingSgCommunityNft/votingPowerAtHeight', + args: { + address: args.address, + }, + ...(args.height && { block: { height: args.height } }), + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new DaoVotingSgCommunityNftQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).votingPowerAtHeight({ + address: args.address, + height: args.height, + }) + }, + ...options, + }), + totalPowerAtHeight: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + args, + options, + }: DaoVotingSgCommunityNftTotalPowerAtHeightQuery + ): UseQueryOptions => ({ + queryKey: daoVotingSgCommunityNftQueryKeys.totalPowerAtHeight( + contractAddress, + args + ), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'daoVotingSgCommunityNft/totalPowerAtHeight', + ...(args.height && { block: { height: args.height } }), + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new DaoVotingSgCommunityNftQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).totalPowerAtHeight({ + height: args.height, + }) + }, + ...options, + }), + dao: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + options, + }: DaoVotingSgCommunityNftDaoQuery + ): UseQueryOptions => ({ + queryKey: daoVotingSgCommunityNftQueryKeys.dao(contractAddress), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'daoVotingSgCommunityNft/dao', + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new DaoVotingSgCommunityNftQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).dao() + }, + ...options, + }), + info: contractQueries.info, +} +export interface DaoVotingSgCommunityNftReactQuery< + TResponse, + TData = TResponse +> { + chainId: string + contractAddress: string + options?: Omit< + UseQueryOptions, + 'queryKey' | 'queryFn' | 'initialData' + > & { + initialData?: undefined + } +} +export interface DaoVotingSgCommunityNftInfoQuery + extends DaoVotingSgCommunityNftReactQuery {} +export interface DaoVotingSgCommunityNftDaoQuery + extends DaoVotingSgCommunityNftReactQuery {} +export interface DaoVotingSgCommunityNftTotalPowerAtHeightQuery + extends DaoVotingSgCommunityNftReactQuery { + args: { + height?: number + } +} +export interface DaoVotingSgCommunityNftVotingPowerAtHeightQuery + extends DaoVotingSgCommunityNftReactQuery< + VotingPowerAtHeightResponse, + TData + > { + args: { + address: string + height?: number + } +} +export interface DaoVotingSgCommunityNftOwnershipQuery + extends DaoVotingSgCommunityNftReactQuery {} +export interface DaoVotingSgCommunityNftListVotersQuery + extends DaoVotingSgCommunityNftReactQuery { + args: { + limit?: number + startAfter?: string + } +} +export interface DaoVotingSgCommunityNftRegisteredNftQuery + extends DaoVotingSgCommunityNftReactQuery { + args: { + address: string + } +} +export interface DaoVotingSgCommunityNftHooksQuery + extends DaoVotingSgCommunityNftReactQuery {} +export interface DaoVotingSgCommunityNftNftContractQuery + extends DaoVotingSgCommunityNftReactQuery {} diff --git a/packages/state/query/queries/contracts/index.ts b/packages/state/query/queries/contracts/index.ts index a636fb7ef..feda9fe55 100644 --- a/packages/state/query/queries/contracts/index.ts +++ b/packages/state/query/queries/contracts/index.ts @@ -30,3 +30,5 @@ export * from './NeutronVotingRegistry' export * from './DaoVotingOnftStaked' export * from './DaoVotingOnftStaked.extra' export * from './Cw721Base' +export * from './DaoVotingSgCommunityNft' +export * from './DaoVotingSgCommunityNft.extra' diff --git a/packages/stateful/clients/dao/CwDao.ts b/packages/stateful/clients/dao/CwDao.ts index d3f5cf9c6..a00822be9 100644 --- a/packages/stateful/clients/dao/CwDao.ts +++ b/packages/stateful/clients/dao/CwDao.ts @@ -38,6 +38,7 @@ import { NativeStakedVotingModule, NeutronVotingRegistryVotingModule, OnftStakedVotingModule, + SgCommunityNftVotingModule, TokenStakedVotingModule, } from '../voting-module' import { DaoBase } from './base' @@ -50,6 +51,7 @@ const getVotingModuleBases = () => [ TokenStakedVotingModule, NeutronVotingRegistryVotingModule, OnftStakedVotingModule, + SgCommunityNftVotingModule, ] const getProposalModuleBases = () => [ diff --git a/packages/stateful/clients/voting-module/SgCommunityNftVotingModule.ts b/packages/stateful/clients/voting-module/SgCommunityNftVotingModule.ts new file mode 100644 index 000000000..ead8b5540 --- /dev/null +++ b/packages/stateful/clients/voting-module/SgCommunityNftVotingModule.ts @@ -0,0 +1,62 @@ +import { FetchQueryOptions, skipToken } from '@tanstack/react-query' + +import { daoVotingSgCommunityNftQueries } from '@dao-dao/state/query' +import { ModuleInstantiateInfo } from '@dao-dao/types' +import { + TotalPowerAtHeightResponse, + VotingPowerAtHeightResponse, +} from '@dao-dao/types/contracts/DaoVotingSgCommunityNft' +import { DAO_VOTING_SG_COMMUNITY_NFT_CONTRACT_NAMES } from '@dao-dao/utils' + +import { CwDao } from '../dao/CwDao' +import { VotingModuleBase } from './base' + +export class SgCommunityNftVotingModule extends VotingModuleBase { + static contractNames: readonly string[] = + DAO_VOTING_SG_COMMUNITY_NFT_CONTRACT_NAMES + + /** + * Generate the module instantiate info to plug into the DAO instantiate info + * generator function. + */ + static generateModuleInstantiateInfo(): ModuleInstantiateInfo { + throw new Error('Not implemented') + } + + getVotingPowerQuery( + address?: string, + height?: number + ): FetchQueryOptions { + // If no address, return query in loading state. + if (!address) { + return { + queryKey: [], + queryFn: skipToken, + } + } + + return daoVotingSgCommunityNftQueries.votingPowerAtHeight( + this.queryClient, + { + chainId: this.dao.chainId, + contractAddress: this.address, + args: { + address, + height, + }, + } + ) + } + + getTotalVotingPowerQuery( + height?: number + ): FetchQueryOptions { + return daoVotingSgCommunityNftQueries.totalPowerAtHeight(this.queryClient, { + chainId: this.dao.chainId, + contractAddress: this.address, + args: { + height, + }, + }) + } +} diff --git a/packages/stateful/clients/voting-module/index.ts b/packages/stateful/clients/voting-module/index.ts index fea572ea9..876ec5dcb 100644 --- a/packages/stateful/clients/voting-module/index.ts +++ b/packages/stateful/clients/voting-module/index.ts @@ -5,6 +5,7 @@ export * from './Cw721StakedVotingModule' export * from './NativeStakedVotingModule' export * from './NeutronVotingRegistryVotingModule' export * from './OnftStakedVotingModule' +export * from './SgCommunityNftVotingModule' export * from './Snip20StakedVotingModule.secret' export * from './Snip721StakedVotingModule.secret' export * from './TokenStakedVotingModule.secret' diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/ProfileCardMemberInfo/ProfileCardMemberInfo.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/ProfileCardMemberInfo/ProfileCardMemberInfo.tsx index 825940c6c..dbf2f37e3 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/ProfileCardMemberInfo/ProfileCardMemberInfo.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/components/ProfileCardMemberInfo/ProfileCardMemberInfo.tsx @@ -17,7 +17,13 @@ export const ProfileCardMemberInfo = ({ }: ProfileCardMemberInfoProps) => { const { t } = useTranslation() - return votingPower.loading || votingPower.data > 0 ? ( + return cantVoteOnProposal ? ( +

+ {t('info.notMemberForProposal', { + daoName, + })} +

+ ) : votingPower.loading || votingPower.data > 0 ? (

{t('title.votingPower')}

) : ( -

+

{t('info.membershipDaoNotMemberInfo', { daoName, - context: cantVoteOnProposal ? 'proposal' : 'dao', })}

) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingSgCommunityNft/components/MembersTab.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingSgCommunityNft/components/MembersTab.tsx new file mode 100644 index 000000000..aa346a36b --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingSgCommunityNft/components/MembersTab.tsx @@ -0,0 +1,60 @@ +import { useQueryClient } from '@tanstack/react-query' +import { useTranslation } from 'react-i18next' + +import { daoVotingSgCommunityNftExtraQueries } from '@dao-dao/state' +import { MembersTab as StatelessMembersTab } from '@dao-dao/stateless' +import { StatefulDaoMemberCardProps } from '@dao-dao/types' + +import { + ButtonLink, + DaoMemberCard, + EntityDisplay, +} from '../../../../components' +import { useQueryLoadingDataWithError } from '../../../../hooks' +import { useVotingModuleAdapterOptions } from '../../../react/context' + +export const MembersTab = () => { + const { t } = useTranslation() + const { chainId, votingModuleAddress } = useVotingModuleAdapterOptions() + + const queryClient = useQueryClient() + const members = useQueryLoadingDataWithError( + daoVotingSgCommunityNftExtraQueries.allVoters(queryClient, { + chainId, + address: votingModuleAddress, + }), + (data) => + data?.map( + ({ + address, + weight, + votingPowerPercent, + }): StatefulDaoMemberCardProps => ({ + address, + balanceLabel: t('title.votingWeight'), + balance: { + loading: false, + data: { + amount: weight, + }, + }, + votingPowerPercent: { + loading: false, + data: votingPowerPercent, + }, + }) + ) ?? [] + ) + + return ( + + ) +} diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingSgCommunityNft/components/ProfileCardMemberInfo.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingSgCommunityNft/components/ProfileCardMemberInfo.tsx new file mode 100644 index 000000000..8ba19c6c0 --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingSgCommunityNft/components/ProfileCardMemberInfo.tsx @@ -0,0 +1,402 @@ +import { ArrowOutward, Dangerous, HowToVote } from '@mui/icons-material' +import { useQueries, useQueryClient } from '@tanstack/react-query' +import clsx from 'clsx' +import { useCallback, useEffect, useState } from 'react' +import toast from 'react-hot-toast' +import { useTranslation } from 'react-i18next' + +import { + daoVotingSgCommunityNftExtraQueries, + daoVotingSgCommunityNftQueries, + indexerQueries, +} from '@dao-dao/state/query' +import { Button, useDaoContext } from '@dao-dao/stateless' +import { + BaseProfileCardMemberInfoProps, + LoadingDataWithError, +} from '@dao-dao/types' +import { + CHAIN_GAS_MULTIPLIER, + executeSmartContract, + formatPercentOf100, + processError, +} from '@dao-dao/utils' + +import { ButtonLink } from '../../../../components/ButtonLink' +import { + useAwaitNextBlock, + useQueryLoadingDataWithError, + useWallet, +} from '../../../../hooks' + +export const ProfileCardMemberInfo = ({ + cantVoteOnProposal, +}: BaseProfileCardMemberInfoProps) => { + const { t } = useTranslation() + const { dao } = useDaoContext() + const { + address: walletAddress, + isWalletConnected, + getSigningClient, + } = useWallet() + const queryClient = useQueryClient() + + const loadingWalletHasNft = useQueryLoadingDataWithError({ + ...daoVotingSgCommunityNftExtraQueries.walletHasNft(queryClient, { + chainId: dao.chainId, + votingModuleAddress: dao.votingModule.address, + walletAddress: walletAddress || '', + }), + enabled: !!walletAddress, + }) + const loadingWalletRegistered = useQueryLoadingDataWithError({ + ...daoVotingSgCommunityNftQueries.registeredNft(queryClient, { + chainId: dao.chainId, + contractAddress: dao.votingModule.address, + args: { + address: walletAddress || '', + }, + }), + enabled: !!walletAddress, + }) + + const walletHasNoNft = + !loadingWalletHasNft.loading && + (loadingWalletHasNft.errored || !loadingWalletHasNft.data) + + const votingPowerPercent = useQueries({ + queries: [ + dao.votingModule.getVotingPowerQuery(walletAddress), + dao.votingModule.getTotalVotingPowerQuery(), + ], + combine: ([votingPower, totalPower]): LoadingDataWithError => { + if (votingPower.isError) { + return { + loading: false, + errored: true, + error: votingPower.error, + } + } else if (totalPower.isError) { + return { + loading: false, + errored: true, + error: totalPower.error, + } + } + + if (votingPower.isPending || totalPower.isPending) { + return { + loading: true, + errored: false, + } + } + + return { + loading: false, + errored: false, + updating: votingPower.isRefetching || totalPower.isRefetching, + data: + Number(totalPower.data.power) === 0 + ? 0 + : (Number(votingPower.data.power) / Number(totalPower.data.power)) * + 100, + } + }, + }) + + const refreshState = useCallback(async () => { + await Promise.all([ + // Refetch indexer query first. + queryClient + .refetchQueries({ + queryKey: indexerQueries.queryContract(queryClient, { + chainId: dao.chainId, + contractAddress: dao.votingModule.address, + formula: 'daoVotingSgCommunityNft/votingPowerAtHeight', + args: { + address: walletAddress || '', + }, + }).queryKey, + }) + .finally(() => + queryClient.refetchQueries({ + queryKey: + dao.votingModule.getVotingPowerQuery(walletAddress).queryKey, + }) + ), + + // Invalidate indexer query first. + queryClient + .refetchQueries({ + queryKey: indexerQueries.queryContract(queryClient, { + chainId: dao.chainId, + contractAddress: dao.votingModule.address, + formula: 'daoVotingSgCommunityNft/totalPowerAtHeight', + }).queryKey, + }) + .finally(() => + queryClient.refetchQueries({ + queryKey: dao.votingModule.getTotalVotingPowerQuery().queryKey, + }) + ), + + queryClient.refetchQueries({ + queryKey: daoVotingSgCommunityNftExtraQueries.allVoters(queryClient, { + chainId: dao.chainId, + address: dao.votingModule.address, + }).queryKey, + }), + + // Refetch indexer query first. + queryClient + .refetchQueries({ + queryKey: indexerQueries.queryContract(queryClient, { + chainId: dao.chainId, + contractAddress: dao.votingModule.address, + formula: 'daoVotingSgCommunityNft/registeredNft', + args: { + address: walletAddress || '', + }, + }).queryKey, + }) + .finally(() => + queryClient.refetchQueries({ + queryKey: daoVotingSgCommunityNftQueries.registeredNft( + queryClient, + { + chainId: dao.chainId, + contractAddress: dao.votingModule.address, + args: { + address: walletAddress || '', + }, + } + ).queryKey, + }) + ), + ]) + }, [dao.chainId, dao.votingModule, queryClient, walletAddress]) + + const awaitNextBlock = useAwaitNextBlock() + + const [loading, setLoading] = useState(false) + + const onRegister = useCallback(async () => { + if (!isWalletConnected || !walletAddress) { + return toast.error(t('error.logInToContinue')) + } + + setLoading(true) + try { + await executeSmartContract( + getSigningClient, + walletAddress, + dao.votingModule.address, + { + register: {}, + }, + undefined, + CHAIN_GAS_MULTIPLIER + ) + + // Voting power will not appear until the next block. + await awaitNextBlock() + + // Wait for refresh to complete before displaying toast and stopping load. + await refreshState() + + toast.success(t('success.registered')) + } catch (err) { + console.error(err) + toast.error(processError(err)) + } finally { + setLoading(false) + } + }, [ + isWalletConnected, + walletAddress, + t, + getSigningClient, + dao.votingModule.address, + awaitNextBlock, + refreshState, + ]) + + const onUnregister = useCallback(async () => { + if (!isWalletConnected || !walletAddress) { + return toast.error(t('error.logInToContinue')) + } + + setLoading(true) + try { + await executeSmartContract( + getSigningClient, + walletAddress, + dao.votingModule.address, + { + unregister: {}, + }, + undefined, + CHAIN_GAS_MULTIPLIER + ) + + // Voting power will not appear until the next block. + await awaitNextBlock() + + // Wait for refresh to complete before displaying toast and stopping load. + await refreshState() + + toast.success(t('success.unregistered')) + } catch (err) { + console.error(err) + toast.error(processError(err)) + } finally { + setLoading(false) + } + }, [ + isWalletConnected, + walletAddress, + t, + getSigningClient, + dao.votingModule.address, + awaitNextBlock, + refreshState, + ]) + + // If the user visits the Stargaze Loyalty Program page, automatically refresh + // to check if they acquired an NFT for 5 minutes. + const [visitedStargazeLoyaltyProgram, setVisitedStargazeLoyaltyProgram] = + useState() + useEffect(() => { + if (!visitedStargazeLoyaltyProgram) { + return + } + // Don't poll if the user has an NFT (meaning it's been detected). + if ( + !loadingWalletHasNft.loading && + !loadingWalletHasNft.errored && + loadingWalletHasNft.data + ) { + setVisitedStargazeLoyaltyProgram(undefined) + return + } + + // Every 10 seconds, re-check if the user has an NFT. + const interval = setInterval(() => { + // cw721-base tokens query that the next query depends on + queryClient.invalidateQueries({ + queryKey: [ + { + method: 'tokens', + args: { + owner: walletAddress || '', + }, + }, + ], + }) + // query to check if wallet has NFT, depends on the above + queryClient.invalidateQueries({ + queryKey: daoVotingSgCommunityNftExtraQueries.walletHasNft( + queryClient, + { + chainId: dao.chainId, + votingModuleAddress: dao.votingModule.address, + walletAddress: walletAddress || '', + } + ).queryKey, + }) + + // If we've been polling for over 5 minutes, stop. + if (Date.now() - visitedStargazeLoyaltyProgram > 5 * 60 * 1000) { + setVisitedStargazeLoyaltyProgram(undefined) + } + }, 10 * 1000) + + return () => clearInterval(interval) + }, [ + dao.chainId, + dao.votingModule.address, + loadingWalletHasNft, + queryClient, + visitedStargazeLoyaltyProgram, + walletAddress, + walletHasNoNft, + ]) + + return cantVoteOnProposal ? ( +

+ {t('info.notMemberForProposal', { + daoName: dao.name, + })} +

+ ) : ( + <> +
+

{t('title.votingPower')}

+

+ {votingPowerPercent.loading + ? '...' + : votingPowerPercent.errored + ? // eslint-disable-next-line i18next/no-literal-string + '' + : formatPercentOf100(votingPowerPercent.data)} +

+
+ + {!loadingWalletRegistered.loading && !loadingWalletRegistered.errored ? ( + loadingWalletRegistered.data.token_id ? ( + + ) : walletHasNoNft ? ( + setVisitedStargazeLoyaltyProgram(Date.now())} + size="lg" + variant="brand" + // eslint-disable-next-line i18next/no-literal-string + > + Stargaze Loyalty Program + + + ) : ( + + ) + ) : ( + ) ) : ( - )} ) From 4ad8ef82a6ad039026ddedc69fed54858551336c Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 9 Jul 2024 12:35:03 -0400 Subject: [PATCH 304/438] added chain ID to missing account error --- packages/stateful/components/dao/tabs/AppsTab.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/stateful/components/dao/tabs/AppsTab.tsx b/packages/stateful/components/dao/tabs/AppsTab.tsx index 6e2d61848..ef1b0e87d 100644 --- a/packages/stateful/components/dao/tabs/AppsTab.tsx +++ b/packages/stateful/components/dao/tabs/AppsTab.tsx @@ -116,7 +116,7 @@ export const AppsTab = () => { throw new Error( t('error.daoMissingAccountsOnChains', { daoName: name, - chains: getDisplayNameForChainId(chainId), + chains: `${getDisplayNameForChainId(chainId)} (${chainId})`, count: 1, }) ) @@ -186,7 +186,9 @@ export const AppsTab = () => { daoName: name, chains: [chainIds] .flat() - .map((chainId) => getDisplayNameForChainId(chainId)) + .map( + (chainId) => `${getDisplayNameForChainId(chainId)} (${chainId})` + ) .join(', '), count: [chainIds].flat().length, }), From 0fd69298482b53ac8d1fc756a2ba2fa224e87c2d Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 9 Jul 2024 12:53:23 -0400 Subject: [PATCH 305/438] fixed secret code hash and updated DAO creation gas price --- .../state/contracts/SecretCwAdminFactory.ts | 2 +- packages/state/contracts/SecretDaoDaoCore.ts | 32 +++++++++---------- .../SecretDaoPreProposeApprovalSingle.ts | 14 ++++---- .../contracts/SecretDaoPreProposeMultiple.ts | 14 ++++---- .../contracts/SecretDaoPreProposeSingle.ts | 14 ++++---- .../contracts/SecretDaoProposalMultiple.ts | 26 +++++++-------- .../contracts/SecretDaoProposalSingle.ts | 26 +++++++-------- .../contracts/SecretDaoVotingSnip20Staked.ts | 2 +- .../contracts/SecretDaoVotingSnip721Staked.ts | 14 ++++---- .../contracts/SecretDaoVotingTokenStaked.ts | 14 ++++---- .../stateful/components/dao/CreateDaoForm.tsx | 3 +- packages/utils/constants/chains.ts | 2 +- packages/utils/constants/other.ts | 7 ++++ 13 files changed, 89 insertions(+), 81 deletions(-) diff --git a/packages/state/contracts/SecretCwAdminFactory.ts b/packages/state/contracts/SecretCwAdminFactory.ts index d7b1c6f2b..a4dca9e86 100644 --- a/packages/state/contracts/SecretCwAdminFactory.ts +++ b/packages/state/contracts/SecretCwAdminFactory.ts @@ -62,7 +62,7 @@ export class SecretCwAdminFactoryClient }: { moduleInfo: ModuleInstantiateInfo }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { diff --git a/packages/state/contracts/SecretDaoDaoCore.ts b/packages/state/contracts/SecretDaoDaoCore.ts index 6f5cbf493..18bdff05b 100644 --- a/packages/state/contracts/SecretDaoDaoCore.ts +++ b/packages/state/contracts/SecretDaoDaoCore.ts @@ -532,7 +532,7 @@ export class SecretDaoDaoCoreClient }: { msgs: CosmosMsgForEmpty[] }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -555,7 +555,7 @@ export class SecretDaoDaoCoreClient }: { msgs: CosmosMsgForEmpty[] }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -578,7 +578,7 @@ export class SecretDaoDaoCoreClient }: { duration: Duration }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -609,7 +609,7 @@ export class SecretDaoDaoCoreClient msg?: Binary sender: Addr }, - fee: number = 500_000, + fee: number = 1_000_000, _memo?: string, _funds?: Coin[] ): Promise => { @@ -640,7 +640,7 @@ export class SecretDaoDaoCoreClient sender: Addr tokenId: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -665,7 +665,7 @@ export class SecretDaoDaoCoreClient }: { key: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -690,7 +690,7 @@ export class SecretDaoDaoCoreClient key: string value: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -714,7 +714,7 @@ export class SecretDaoDaoCoreClient }: { admin?: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -732,7 +732,7 @@ export class SecretDaoDaoCoreClient ) } acceptAdminNomination = async ( - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -748,7 +748,7 @@ export class SecretDaoDaoCoreClient ) } withdrawAdminNomination = async ( - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -769,7 +769,7 @@ export class SecretDaoDaoCoreClient }: { config: Config }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -794,7 +794,7 @@ export class SecretDaoDaoCoreClient toAdd: string[] toRemove: string[] }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -820,7 +820,7 @@ export class SecretDaoDaoCoreClient toAdd: string[] toRemove: string[] }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -846,7 +846,7 @@ export class SecretDaoDaoCoreClient toAdd: ModuleInstantiateInfo[] toDisable: string[] }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -870,7 +870,7 @@ export class SecretDaoDaoCoreClient }: { module: ModuleInstantiateInfo }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -895,7 +895,7 @@ export class SecretDaoDaoCoreClient toAdd: SubDao[] toRemove: string[] }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { diff --git a/packages/state/contracts/SecretDaoPreProposeApprovalSingle.ts b/packages/state/contracts/SecretDaoPreProposeApprovalSingle.ts index 19e5f5a04..d5ecd1fe3 100644 --- a/packages/state/contracts/SecretDaoPreProposeApprovalSingle.ts +++ b/packages/state/contracts/SecretDaoPreProposeApprovalSingle.ts @@ -213,7 +213,7 @@ export class SecretDaoPreProposeApprovalSingleClient auth: Auth msg: ProposeMessage }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -239,7 +239,7 @@ export class SecretDaoPreProposeApprovalSingleClient depositInfo?: UncheckedDepositInfo openProposalSubmission: boolean }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -265,7 +265,7 @@ export class SecretDaoPreProposeApprovalSingleClient denom?: UncheckedDenom key?: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -289,7 +289,7 @@ export class SecretDaoPreProposeApprovalSingleClient }: { msg: ExecuteExt }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -314,7 +314,7 @@ export class SecretDaoPreProposeApprovalSingleClient address: string codeHash: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -340,7 +340,7 @@ export class SecretDaoPreProposeApprovalSingleClient address: string codeHash: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -366,7 +366,7 @@ export class SecretDaoPreProposeApprovalSingleClient newStatus: Status proposalId: number }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { diff --git a/packages/state/contracts/SecretDaoPreProposeMultiple.ts b/packages/state/contracts/SecretDaoPreProposeMultiple.ts index 72c7bda59..7d490233c 100644 --- a/packages/state/contracts/SecretDaoPreProposeMultiple.ts +++ b/packages/state/contracts/SecretDaoPreProposeMultiple.ts @@ -212,7 +212,7 @@ export class SecretDaoPreProposeMultipleClient auth: Auth msg: ProposeMessage }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -238,7 +238,7 @@ export class SecretDaoPreProposeMultipleClient depositInfo?: UncheckedDepositInfo openProposalSubmission: boolean }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -264,7 +264,7 @@ export class SecretDaoPreProposeMultipleClient denom?: UncheckedDenom key?: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -288,7 +288,7 @@ export class SecretDaoPreProposeMultipleClient }: { msg: Empty }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -313,7 +313,7 @@ export class SecretDaoPreProposeMultipleClient address: string codeHash: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -339,7 +339,7 @@ export class SecretDaoPreProposeMultipleClient address: string codeHash: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -365,7 +365,7 @@ export class SecretDaoPreProposeMultipleClient newStatus: Status proposalId: number }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { diff --git a/packages/state/contracts/SecretDaoPreProposeSingle.ts b/packages/state/contracts/SecretDaoPreProposeSingle.ts index 42a759548..bd5e4f6a2 100644 --- a/packages/state/contracts/SecretDaoPreProposeSingle.ts +++ b/packages/state/contracts/SecretDaoPreProposeSingle.ts @@ -212,7 +212,7 @@ export class SecretDaoPreProposeSingleClient auth: Auth msg: ProposeMessage }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -238,7 +238,7 @@ export class SecretDaoPreProposeSingleClient depositInfo?: UncheckedDepositInfo openProposalSubmission: boolean }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -264,7 +264,7 @@ export class SecretDaoPreProposeSingleClient denom?: UncheckedDenom key?: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -288,7 +288,7 @@ export class SecretDaoPreProposeSingleClient }: { msg: Empty }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -313,7 +313,7 @@ export class SecretDaoPreProposeSingleClient address: string codeHash: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -339,7 +339,7 @@ export class SecretDaoPreProposeSingleClient address: string codeHash: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -365,7 +365,7 @@ export class SecretDaoPreProposeSingleClient newStatus: Status proposalId: number }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { diff --git a/packages/state/contracts/SecretDaoProposalMultiple.ts b/packages/state/contracts/SecretDaoProposalMultiple.ts index b58d277a0..469c82f95 100644 --- a/packages/state/contracts/SecretDaoProposalMultiple.ts +++ b/packages/state/contracts/SecretDaoProposalMultiple.ts @@ -425,7 +425,7 @@ export class SecretDaoProposalMultipleClient proposer?: string title: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -457,7 +457,7 @@ export class SecretDaoProposalMultipleClient rationale?: string vote: MultipleChoiceVote }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -485,7 +485,7 @@ export class SecretDaoProposalMultipleClient auth: Auth proposalId: number }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -509,7 +509,7 @@ export class SecretDaoProposalMultipleClient }: { proposalId: number }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -532,7 +532,7 @@ export class SecretDaoProposalMultipleClient }: { proposalId: number }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -567,7 +567,7 @@ export class SecretDaoProposalMultipleClient veto?: VetoConfig votingStrategy: VotingStrategy }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -598,7 +598,7 @@ export class SecretDaoProposalMultipleClient proposalId: number rationale?: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -622,7 +622,7 @@ export class SecretDaoProposalMultipleClient }: { info: PreProposeInfo }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -647,7 +647,7 @@ export class SecretDaoProposalMultipleClient address: string codeHash: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -673,7 +673,7 @@ export class SecretDaoProposalMultipleClient address: string codeHash: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -699,7 +699,7 @@ export class SecretDaoProposalMultipleClient address: string codeHash: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -725,7 +725,7 @@ export class SecretDaoProposalMultipleClient address: string codeHash: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -751,7 +751,7 @@ export class SecretDaoProposalMultipleClient address: Addr codeHash: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { diff --git a/packages/state/contracts/SecretDaoProposalSingle.ts b/packages/state/contracts/SecretDaoProposalSingle.ts index a649270e4..cf0eea27f 100644 --- a/packages/state/contracts/SecretDaoProposalSingle.ts +++ b/packages/state/contracts/SecretDaoProposalSingle.ts @@ -425,7 +425,7 @@ export class SecretDaoProposalSingleClient proposer?: string title: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -457,7 +457,7 @@ export class SecretDaoProposalSingleClient rationale?: string vote: Vote }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -485,7 +485,7 @@ export class SecretDaoProposalSingleClient proposalId: number rationale?: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -511,7 +511,7 @@ export class SecretDaoProposalSingleClient auth: Auth proposalId: number }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -535,7 +535,7 @@ export class SecretDaoProposalSingleClient }: { proposalId: number }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -558,7 +558,7 @@ export class SecretDaoProposalSingleClient }: { proposalId: number }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -593,7 +593,7 @@ export class SecretDaoProposalSingleClient threshold: Threshold veto?: VetoConfig }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -622,7 +622,7 @@ export class SecretDaoProposalSingleClient }: { info: PreProposeInfo }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -647,7 +647,7 @@ export class SecretDaoProposalSingleClient address: string codeHash: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -673,7 +673,7 @@ export class SecretDaoProposalSingleClient address: string codeHash: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -699,7 +699,7 @@ export class SecretDaoProposalSingleClient address: string codeHash: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -725,7 +725,7 @@ export class SecretDaoProposalSingleClient address: string codeHash: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -751,7 +751,7 @@ export class SecretDaoProposalSingleClient address: Addr codeHash: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { diff --git a/packages/state/contracts/SecretDaoVotingSnip20Staked.ts b/packages/state/contracts/SecretDaoVotingSnip20Staked.ts index 0439c5b7c..eac1d6a53 100644 --- a/packages/state/contracts/SecretDaoVotingSnip20Staked.ts +++ b/packages/state/contracts/SecretDaoVotingSnip20Staked.ts @@ -155,7 +155,7 @@ export class SecretDaoVotingSnip20StakedClient }: { newThreshold?: ActiveThreshold }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { diff --git a/packages/state/contracts/SecretDaoVotingSnip721Staked.ts b/packages/state/contracts/SecretDaoVotingSnip721Staked.ts index 1cd09b223..fce1598c1 100644 --- a/packages/state/contracts/SecretDaoVotingSnip721Staked.ts +++ b/packages/state/contracts/SecretDaoVotingSnip721Staked.ts @@ -253,7 +253,7 @@ export class SecretDaoVotingSnip721StakedClient sender: Addr tokenId: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -278,7 +278,7 @@ export class SecretDaoVotingSnip721StakedClient }: { tokenIds: string[] }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -296,7 +296,7 @@ export class SecretDaoVotingSnip721StakedClient ) } claimNfts = async ( - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -317,7 +317,7 @@ export class SecretDaoVotingSnip721StakedClient }: { duration?: Duration }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -342,7 +342,7 @@ export class SecretDaoVotingSnip721StakedClient addr: string codeHash: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -368,7 +368,7 @@ export class SecretDaoVotingSnip721StakedClient addr: string codeHash: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -392,7 +392,7 @@ export class SecretDaoVotingSnip721StakedClient }: { newThreshold?: ActiveThreshold }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { diff --git a/packages/state/contracts/SecretDaoVotingTokenStaked.ts b/packages/state/contracts/SecretDaoVotingTokenStaked.ts index 9aa080777..8f56edd57 100644 --- a/packages/state/contracts/SecretDaoVotingTokenStaked.ts +++ b/packages/state/contracts/SecretDaoVotingTokenStaked.ts @@ -263,7 +263,7 @@ export class SecretDaoVotingTokenStakedClient this.removeHook = this.removeHook.bind(this) } stake = async ( - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -284,7 +284,7 @@ export class SecretDaoVotingTokenStakedClient }: { amount: Uint128 }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -307,7 +307,7 @@ export class SecretDaoVotingTokenStakedClient }: { duration?: Duration }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -325,7 +325,7 @@ export class SecretDaoVotingTokenStakedClient ) } claim = async ( - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -346,7 +346,7 @@ export class SecretDaoVotingTokenStakedClient }: { newThreshold?: ActiveThreshold }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -371,7 +371,7 @@ export class SecretDaoVotingTokenStakedClient addr: string codeHash: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { @@ -397,7 +397,7 @@ export class SecretDaoVotingTokenStakedClient addr: string codeHash: string }, - fee: number = 500_000, + fee: number = 1_000_000, memo?: string, _funds?: Coin[] ): Promise => { diff --git a/packages/stateful/components/dao/CreateDaoForm.tsx b/packages/stateful/components/dao/CreateDaoForm.tsx index dad396f03..dda548e8c 100644 --- a/packages/stateful/components/dao/CreateDaoForm.tsx +++ b/packages/stateful/components/dao/CreateDaoForm.tsx @@ -49,6 +49,7 @@ import { CHAIN_GAS_MULTIPLIER, DaoProposalMultipleAdapterId, NEW_DAO_TOKEN_DECIMALS, + SECRET_GAS_PRICES, TokenBasedCreatorId, convertMicroDenomToDenomWithDecimals, decodeJsonFromBase64, @@ -486,7 +487,7 @@ export const InnerCreateDaoForm = ({ label: instantiateMsg.name, }, }, - 500_000, + SECRET_GAS_PRICES.DAO_CREATION, undefined, instantiateFunds ) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 3d27731d2..6e05d028d 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -2196,7 +2196,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // // TODO(secret-testnet) // Cw1Whitelist: '', // Cw4Group: - // '588d5b95d865df2b18d05fa32f93fc6d82864ec84cca87ef139390e6e0524e58', + // 'dbf5ab79a2fee24347284fc1be79df2ff5506b8002e317426d3025060e6b782b', // Cw20Base: // 'c2508a75824974eeaa578a5d1af07006b1c3911b5c2909813d74672797264775', // snip20 // Cw721Base: diff --git a/packages/utils/constants/other.ts b/packages/utils/constants/other.ts index a41b40402..d1c2a825a 100644 --- a/packages/utils/constants/other.ts +++ b/packages/utils/constants/other.ts @@ -171,3 +171,10 @@ export const INVALID_CONTRACT_ERROR_SUBSTRINGS = [ 'unknown query path', 'decoding bech32 failed', ] + +/** + * Gas prices for Secret transactions. + */ +export const SECRET_GAS_PRICES = { + DAO_CREATION: 1_000_000, +} From 78b7e7f4277db7d90e32d2db26e5ab6ade7cc7e7 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 9 Jul 2024 12:53:53 -0400 Subject: [PATCH 306/438] renamed variable --- packages/stateful/components/dao/CreateDaoForm.tsx | 4 ++-- packages/utils/constants/other.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/stateful/components/dao/CreateDaoForm.tsx b/packages/stateful/components/dao/CreateDaoForm.tsx index dda548e8c..08ba88ff8 100644 --- a/packages/stateful/components/dao/CreateDaoForm.tsx +++ b/packages/stateful/components/dao/CreateDaoForm.tsx @@ -49,7 +49,7 @@ import { CHAIN_GAS_MULTIPLIER, DaoProposalMultipleAdapterId, NEW_DAO_TOKEN_DECIMALS, - SECRET_GAS_PRICES, + SECRET_GAS, TokenBasedCreatorId, convertMicroDenomToDenomWithDecimals, decodeJsonFromBase64, @@ -487,7 +487,7 @@ export const InnerCreateDaoForm = ({ label: instantiateMsg.name, }, }, - SECRET_GAS_PRICES.DAO_CREATION, + SECRET_GAS.DAO_CREATION, undefined, instantiateFunds ) diff --git a/packages/utils/constants/other.ts b/packages/utils/constants/other.ts index d1c2a825a..52bfe6419 100644 --- a/packages/utils/constants/other.ts +++ b/packages/utils/constants/other.ts @@ -175,6 +175,6 @@ export const INVALID_CONTRACT_ERROR_SUBSTRINGS = [ /** * Gas prices for Secret transactions. */ -export const SECRET_GAS_PRICES = { +export const SECRET_GAS = { DAO_CREATION: 1_000_000, } From decc2a989380c7f7d9abb2fd353b9d10d07a00b8 Mon Sep 17 00:00:00 2001 From: noah Date: Tue, 9 Jul 2024 15:10:56 -0400 Subject: [PATCH 307/438] Implement Timewave's Rebalancer (#1530) --- packages/i18n/locales/bad/translation.json | 3 +- packages/i18n/locales/dog/translation.json | 2 +- packages/i18n/locales/en/translation.json | 70 +- packages/state/contracts/ValenceRebalancer.ts | 409 +++++++++++ packages/state/contracts/index.ts | 4 + packages/state/query/queries/account.ts | 185 ++++- packages/state/query/queries/contract.ts | 11 + .../contracts/ValenceRebalancer.extra.ts | 77 ++ .../queries/contracts/ValenceRebalancer.ts | 308 ++++++++ .../state/query/queries/contracts/index.ts | 2 + packages/state/recoil/selectors/account.ts | 141 +--- packages/state/recoil/selectors/contract.ts | 17 + .../ManageWidgets/Component.tsx | 9 +- packages/stateful/actions/core/index.ts | 2 + .../core/smart_contracting/Execute/index.tsx | 18 +- .../smart_contracting/Instantiate/index.tsx | 18 +- .../smart_contracting/Instantiate2/index.tsx | 18 +- .../actions/core/treasury/Spend/Component.tsx | 47 +- .../actions/core/treasury/Spend/index.tsx | 553 +++++++------- .../ConfigureRebalancer/Component.stories.tsx | 218 ++++++ .../valence/ConfigureRebalancer/Component.tsx | 660 +++++++++++++++++ .../valence/ConfigureRebalancer/README.md | 24 + .../valence/ConfigureRebalancer/index.tsx | 679 ++++++++++++++++++ .../CreateValenceAccount/Component.tsx | 108 +++ .../valence/CreateValenceAccount/README.md | 27 + .../valence/CreateValenceAccount/index.tsx | 248 +++++++ .../core/valence/FundRebalancer/index.tsx | 94 +++ .../PauseRebalancer/Component.stories.tsx | 35 + .../valence/PauseRebalancer/Component.tsx | 15 + .../core/valence/PauseRebalancer/README.md | 20 + .../core/valence/PauseRebalancer/index.tsx | 103 +++ .../ResumeRebalancer/Component.stories.tsx | 35 + .../valence/ResumeRebalancer/Component.tsx | 15 + .../core/valence/ResumeRebalancer/README.md | 20 + .../core/valence/ResumeRebalancer/index.tsx | 103 +++ .../valence/WithdrawFromRebalancer/index.tsx | 171 +++++ .../stateful/actions/core/valence/index.ts | 30 + .../actions/hooks/useTokenBalances.ts | 28 +- packages/stateful/actions/react/provider.tsx | 45 +- .../stateful/command/contexts/generic/dao.tsx | 22 +- packages/stateful/components/ProposalList.tsx | 7 +- .../components/TreasuryHistoryGraph.tsx | 129 +++- .../components/dao/tabs/TreasuryTab.tsx | 26 + .../components/gov/GovProposalVoter.tsx | 7 +- .../components/gov/NewGovProposal.tsx | 32 +- .../stateful/components/pages/Account.tsx | 2 + .../components/pages/AccountWallet.tsx | 14 + .../components/profile/ProfileWallet.tsx | 37 +- .../components/wallet/WalletProvider.tsx | 5 +- packages/stateful/feed/react/useFeed.ts | 9 +- packages/stateful/hooks/index.ts | 1 + .../stateful/hooks/useCreateCw1Whitelist.ts | 7 +- packages/stateful/hooks/useFollowingDaos.ts | 2 + .../stateful/hooks/useGenerateInstantiate2.ts | 41 ++ .../hooks/useInstantiateAndExecute.ts | 17 +- packages/stateful/hooks/useWallet.ts | 9 +- packages/stateful/hooks/useWebSocket.ts | 10 +- .../RebalancerProjector.stories.tsx | 50 ++ .../components/RebalancerProjector.tsx | 241 +++++++ .../components/ValenceAccountDisplay.tsx | 164 +++++ .../components/ValenceAccountsSection.tsx | 62 ++ .../components/actions/ActionLibrary.tsx | 105 +-- .../components/actions/NativeCoinSelector.tsx | 9 +- .../dao/tabs/TreasuryTab.stories.tsx | 5 + .../components/dao/tabs/TreasuryTab.tsx | 73 +- packages/stateless/components/index.ts | 3 + .../components/inputs/TokenInput.tsx | 42 +- .../components/modals/InboxSettingsModal.tsx | 6 +- .../components/popup/FilterableItemPopup.tsx | 7 +- .../profile/ProfileWallet.stories.tsx | 6 + .../components/profile/ProfileWallet.tsx | 68 +- .../components/token/TokenLineHeader.tsx | 17 +- packages/stateless/hooks/useCachedLoadable.ts | 7 +- packages/stateless/hooks/useInfiniteScroll.ts | 1 + packages/stateless/hooks/useSearchFilter.ts | 6 +- packages/stateless/hooks/useTrackDropdown.ts | 21 +- packages/stateless/package.json | 1 + packages/stateless/pages/Account.tsx | 10 +- packages/types/account.ts | 37 +- packages/types/actions.ts | 25 +- packages/types/chain.ts | 16 + packages/types/components/ProfileWallet.ts | 19 + packages/types/components/TokenInput.ts | 5 + .../types/components/TreasuryHistoryGraph.ts | 3 + .../types/components/ValenceAccountDisplay.ts | 19 + packages/types/components/index.ts | 1 + packages/types/contracts/ValenceAccount.ts | 212 ++++++ packages/types/contracts/ValenceRebalancer.ts | 257 +++++++ packages/utils/constants/chains.ts | 12 + packages/utils/constants/contracts.ts | 1 + packages/utils/constants/other.ts | 13 + packages/utils/dao.ts | 5 +- packages/utils/index.ts | 1 + packages/utils/token.ts | 6 + packages/utils/valence.ts | 26 + yarn.lock | 5 + 96 files changed, 5907 insertions(+), 609 deletions(-) create mode 100644 packages/state/contracts/ValenceRebalancer.ts create mode 100644 packages/state/query/queries/contracts/ValenceRebalancer.extra.ts create mode 100644 packages/state/query/queries/contracts/ValenceRebalancer.ts create mode 100644 packages/stateful/actions/core/valence/ConfigureRebalancer/Component.stories.tsx create mode 100644 packages/stateful/actions/core/valence/ConfigureRebalancer/Component.tsx create mode 100644 packages/stateful/actions/core/valence/ConfigureRebalancer/README.md create mode 100644 packages/stateful/actions/core/valence/ConfigureRebalancer/index.tsx create mode 100644 packages/stateful/actions/core/valence/CreateValenceAccount/Component.tsx create mode 100644 packages/stateful/actions/core/valence/CreateValenceAccount/README.md create mode 100644 packages/stateful/actions/core/valence/CreateValenceAccount/index.tsx create mode 100644 packages/stateful/actions/core/valence/FundRebalancer/index.tsx create mode 100644 packages/stateful/actions/core/valence/PauseRebalancer/Component.stories.tsx create mode 100644 packages/stateful/actions/core/valence/PauseRebalancer/Component.tsx create mode 100644 packages/stateful/actions/core/valence/PauseRebalancer/README.md create mode 100644 packages/stateful/actions/core/valence/PauseRebalancer/index.tsx create mode 100644 packages/stateful/actions/core/valence/ResumeRebalancer/Component.stories.tsx create mode 100644 packages/stateful/actions/core/valence/ResumeRebalancer/Component.tsx create mode 100644 packages/stateful/actions/core/valence/ResumeRebalancer/README.md create mode 100644 packages/stateful/actions/core/valence/ResumeRebalancer/index.tsx create mode 100644 packages/stateful/actions/core/valence/WithdrawFromRebalancer/index.tsx create mode 100644 packages/stateful/actions/core/valence/index.ts create mode 100644 packages/stateful/components/pages/AccountWallet.tsx create mode 100644 packages/stateful/hooks/useGenerateInstantiate2.ts create mode 100644 packages/stateless/components/RebalancerProjector.stories.tsx create mode 100644 packages/stateless/components/RebalancerProjector.tsx create mode 100644 packages/stateless/components/ValenceAccountDisplay.tsx create mode 100644 packages/stateless/components/ValenceAccountsSection.tsx create mode 100644 packages/types/components/ValenceAccountDisplay.ts create mode 100644 packages/types/contracts/ValenceAccount.ts create mode 100644 packages/types/contracts/ValenceRebalancer.ts create mode 100644 packages/utils/valence.ts diff --git a/packages/i18n/locales/bad/translation.json b/packages/i18n/locales/bad/translation.json index a00427a15..7d8fd7c5d 100644 --- a/packages/i18n/locales/bad/translation.json +++ b/packages/i18n/locales/bad/translation.json @@ -87,8 +87,8 @@ "copy": "bad", "copyAddress": "bad bad", "copyAddressToClipboard": "bad bad bad bad", + "copyChainAddress": "bad bad bad", "copyDaoAddress": "bad bad bad", - "copyDaoChainAddress": "bad bad bad", "copyIdToClipboard": "bad bad bad bad", "copyToClipboard": "bad bad bad", "create": "bad", @@ -894,7 +894,6 @@ "createStep2": "bad bad", "createStep3": "bad bad", "createStep4": "bad bad bad", - "createVestingContractManager": "bad bad bad bad bad bad bad bad bad bad bad bad", "createdPressContract": "bad bad bad bad bad bad", "createdVestingContractManager": "bad bad bad bad bad bad bad", "creatingDao": "bad bad", diff --git a/packages/i18n/locales/dog/translation.json b/packages/i18n/locales/dog/translation.json index 014ceb05e..b1eff6849 100644 --- a/packages/i18n/locales/dog/translation.json +++ b/packages/i18n/locales/dog/translation.json @@ -20,7 +20,7 @@ "continue": "continnue", "copy": "copee", "copyAddressToClipboard": "copee addres 2 clipboar", - "copyDaoChainAddress": "copee {{chain}} addres", + "copyChainAddress": "copee {{chain}} addres", "copyToClipboard": "copee 2 clipboar", "create": "cre8", "createAProposal": "cre8 a puppozal", diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 215036638..510a8c2b5 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -3,7 +3,7 @@ "ica": "ICA", "native": "Native", "polytone": "Cross-chain", - "valence": "Valence" + "valence": "Rebalancer" }, "actionCategory": { "advancedDescription": "Execute custom actions and bulk import actions.", @@ -26,6 +26,10 @@ "nftsLabel": "NFTs", "pressDescription": "Publish, update, and remove posts.", "pressLabel": "Press", + "rebalancerDescription_dao": "Manage the automatic rebalancing of this DAO's treasury.", + "rebalancerDescription_gov": "Manage the automatic rebalancing of this DAO's treasury.", + "rebalancerDescription_wallet": "Manage the automatic rebalancing of your tokens.", + "rebalancerLabel": "Rebalancer", "smartContractingDescription": "Create, execute, and manage smart contracts.", "smartContractingLabel": "Smart Contracting", "treasuryDescription_dao": "Manage this DAO's treasury (for example, send payments, stake or swap tokens, etc.).", @@ -102,8 +106,8 @@ "copy": "Copy", "copyAddress": "Copy address", "copyAddressToClipboard": "Copy address to clipboard", + "copyChainAddress": "Copy {{chain}} address", "copyDaoAddress": "Copy DAO address", - "copyDaoChainAddress": "Copy {{chain}} address", "copyIdToClipboard": "Copy ID to clipboard", "copyLinkToProposalDraft": "Copy link to proposal draft", "copyToClipboard": "Copy to clipboard", @@ -223,6 +227,7 @@ "setAsProfilePhoto": "Set as profile photo", "setDisplayName": "set display name", "setUpDiscordNotifier": "Set up Discord Notifier", + "setUpRebalancer": "Set up rebalancer", "settings": "Settings", "showInstantiateMessage": "Show Instantiate Message", "showQrCode": "Show QR code", @@ -405,6 +410,7 @@ "errorOccurredOnPage": "An error occurred on this page.", "failedParsingCoreVersion": "Failed to determine core version.", "failedToConnect": "Failed to connect.", + "failedToFindChainAccount": "Failed to find account on {{chain}}.", "failedToFindGovernanceProposal": "Failed to find governance proposal with ID {{id}}.", "failedToFindMatchingProposalModule": "Failed to find matching proposal module.", "failedToGetAccountFromWallet": "Failed to get account from wallet.", @@ -418,8 +424,6 @@ "failedToRelayPackets": "Failed to relay packets to {{chain}}.", "feeTokenNotFound": "Fee token not found.", "govTokenBalancesDoNotSumTo100": "Total token distribution percentage must equal 100%, but it currently sums to {{totalPercent}}.", - "icaAddressNotLoaded": "ICA address not loaded.", - "icaAlreadyExists": "You already have an account on {{chain}}.", "icaDoesNotExist": "You do not have an account on {{chain}}.", "icaHostUnsupported": "ICA is either unsupported or misconfigured on {{chain}}, so it is unsafe to use.", "insufficientBalance": "Insufficient balance of {{amount}} ${{tokenSymbol}}.", @@ -448,6 +452,8 @@ "metadataUpload": "Failed to upload metadata.", "missingGovernanceTokenAddress": "Missing governance token address.", "missingGovernanceTokenDenom": "Missing governance token denom.", + "missingIbcChainAccounts_one": "An account needs to be created on the following chain so it can be used during this multi-hop IBC transaction: {{chains}}. In the event of a catastrophic failure, there is a small chance that a multi-hop IBC transaction will not be reversible, and tokens will end up on one of the intermediary chains. In this case, an account must exist on each intermediary to act as a failsafe. Either a cross-chain or ICA account works and will be automatically detected once created.", + "missingIbcChainAccounts_other": "Accounts need to be created on the following chains so they can be used during this multi-hop IBC transaction: {{chains}}. In the event of a catastrophic failure, there is a small chance that a multi-hop IBC transaction will not be reversible, and tokens will end up on one of the intermediary chains. In this case, an account must exist on each intermediary to act as a failsafe. Either a cross-chain or ICA account works and will be automatically detected once created.", "missingNativeToken": "Missing native token.", "mustBeAtLeastSixtySeconds": "Must be at least 60 seconds.", "mustBeMemberToAddMember": "You must be a member of the DAO to propose adding a new member.", @@ -475,6 +481,7 @@ "noSingleChoiceProposalModule": "The DAO does not have a single choice proposal module.", "noSingleChoiceProposalModuleAppsDisabled": "The DAO does not have a recognizable single choice proposal module, so Apps cannot be used at this time.", "noTreasuryHistory": "No history found. Try sending some tokens to the treasury, or check back later.", + "noValenceAccount": "No Rebalancer account found.", "noValidatorFound": "No validator found.", "noValidatorSelected": "No validator selected.", "noVestingContractSelected": "No vesting contract selected.", @@ -498,6 +505,8 @@ "notificationsNotAllowed": "Notifications not allowed.", "pageNotFound": "We couldn't find that page.", "parentMustUpgradeToV2": "SubDAOs cannot upgrade themselves. The parent DAO must upgrade this SubDAO.", + "percentageDoesNotSumTo100": "Total percentage must equal 100%, but it currently sums to {{totalPercent}}.", + "polytoneConnectionNotFound": "Polytone connection not found.", "polytoneExecutedNoRelay": "The proposal was executed, but not all of the cross-chain messages have been relayed. You must relay them to complete the execution.", "proposalIdNotFound": "An unexpected error occurred while redirecting to the proposal. Go back to the DAO's home page and reload to find it.", "proposalNotFound": "Proposal not found.", @@ -510,6 +519,7 @@ "stargazeDaoNoCrossChainAccountsForPress": "This Stargaze DAO has no cross-chain accounts, and Press does not work on Stargaze. Create a cross-chain account for the DAO before setting up Press.", "stepPercentsMustSumTo100": "Step percentages must sum to 100%.", "subDaoAlreadyExists": "SubDAO already exists.", + "tokenAlreadySelected": "Token already selected.", "tokenSwapContractNotChosen": "You must create a token swap or enter the address of an existing token swap before using this action.", "tooFewChoices": "The proposal must have at least two choices.", "tooManyChoices": "The proposal cannot have more than {{count}} choices.", @@ -524,6 +534,7 @@ "unsupportedApprovalFailedRender": "Failed to render approval proposal. Unsupported module.", "unsupportedChains_one": "Unsupported chain: {{chains}}.", "unsupportedChains_other": "Unsupported chains: {{chains}}.", + "unsupportedValenceChain": "Valence accounts are not supported on this chain.", "unsupportedWallet": "Unsupported wallet. Please use a different wallet." }, "form": { @@ -533,6 +544,7 @@ "addressInputPlaceholder_contract": "Search DAO name or enter an address...", "addressInputPlaceholder_wallet": "Search profile name or enter an address...", "admin": "Admin", + "advanced": "Advanced", "afterDelay": "after delay", "allowRevotingDescription": "This will allow members to change their vote on proposals before the voting duration deadline. As a result, proposals will not be able to finish early.", "allowRevotingTitle": "Allow revoting", @@ -555,6 +567,7 @@ "automaticallyAddNFTsTooltip": "Should NFTs sent to the DAO get added to the treasury?", "automaticallyAddTokensTitle": "Automatically add tokens", "automaticallyAddTokensTooltip": "Should tokens sent to the DAO get added to the treasury?", + "baseToken": "Base token", "blocksToPauseFor": "Blocks to pause for", "buttonLabel": "Button label", "calls": "Calls", @@ -615,6 +628,7 @@ "expeditedDescription": "Expedited proposals have a shorter voting duration and higher voting threshold.", "explicitContent": "Explicit content", "externalLink": "External link", + "fast": "Fast", "feeShareContractAddressDescription": "The address to claim fee share for. NOTE: you must be admin or the creator of this smart contract to claim fees for it.", "feeShareToggleWithdrawerAddress": "Custom withdrawer address", "feeShareToggleWithdrawerAddressTooltip_dao": "Customize the address allowed to withdraw fees. Defaults to the DAO.", @@ -642,6 +656,7 @@ "ibcTimeoutTooltip_created": "In rare cases, an IBC transaction may fail to relay to the destination chain. A timeout is required to prevent failed transactions from retrying forever and unexpectedly executing in the future. A good timeout is probably a few days to a week after execution.", "image": "Image", "imageUrlTooltip": "A link to an image.", + "initialBalances": "Initial balances", "initialDeposit": "Initial deposit", "initialSupply": "Total token supply", "instantiatedAddress": "Instantiated address", @@ -651,6 +666,9 @@ "itemValueEmpty": "This item is currently set to an empty value.", "limits": "Limits", "maxCharacters": "Max of {{max}} characters", + "maximumSellablePerCycle": "Maximum sellable per cycle", + "maximumSellablePerCycleDescription": "The proportion of maximum value that is allowed to be sold in one cycle.", + "medium": "Medium", "membersAddress": "Member's address", "membersToAddOrUpdate": "Members to add or update", "membersToAddOrUpdateDescription": "Set the voting power of each member individually. DAO DAO will calculate the voting weight percentage for you.", @@ -659,6 +677,7 @@ "messageType": "Message type", "migrateDescription": "This will <1>migrate the selected contract to a new code ID.", "migrateMessage": "Migrate message", + "minBalance": "Minimum balance", "minter": "Minter", "minterContract": "Minter contract", "minterContractMessage": "Minter contract message", @@ -672,6 +691,7 @@ "nftCollectionAddress": "NFT collection address", "nftMintInstructions": "Create a unique token ID for the NFT and enter the address of the initial owner below.", "nftUploadMetadataInstructions": "Input the NFT's metadata, and then press 'Upload' to store it on IPFS.", + "noLimit": "No limit", "noOne": "No one", "nobody": "Nobody", "oneOneCollection": "1/1 Collection", @@ -693,6 +713,9 @@ "plan": "Plan", "postToDelete": "Post to delete", "postToUpdate": "Post to update", + "priority": "Priority", + "projection": "Projection", + "proportional": "Proportional", "proposalDepositDescription": "The number of tokens that must be deposited to create a proposal. Setting this may deter spam, but setting it too high may limit broad participation.", "proposalDepositTitle": "Proposal deposit", "proposalIdPlaceholder": "Proposal ID", @@ -707,6 +730,11 @@ "quorumTitle": "Quorum", "ratingInstructionsPlaceholder": "This is what DAO members will see when they are rating the contributions. Explain how they should rate.", "ratingsSubmitted": "You submitted ratings for this cycle. Submitting again will overwrite your previous response.", + "rebalancerBaseTokenDescription": "The token used to calculate the portfolio value. Tokens may be worth different values depending on the base token, though the market tends to consolidate prices through arbitrage.", + "rebalancerMinBalanceDescription": "Require the rebalancer to maintain a minimum balance of one of the rebalanced tokens, overriding a lower target.", + "rebalancerSpeedAdvancedDescription": "The rebalancer uses a proportional-integral-derivative (PID) control loop to auction funds daily. Set the coefficients for the proportional, integral, and derivative terms below.", + "rebalancerSpeedDescription": "How quickly the portfolio is rebalanced.\n- **Slow** rebalances 5% of your portfolio error every day.\n- **Medium** rebalances 10% of your portfolio error every day.\n- **Fast** rebalances 20% of your portfolio error every day.\n\nPortfolio error is the difference between your target portfolio and your current portfolio.", + "rebalancerTrusteeDescription": "The trustee can pause and resume rebalancing.", "recipient": "Recipient", "redelegateDestinationValidator": "Destination validator", "redelegateDestinationValidatorTooltip": "The validator you are redelegating to.", @@ -726,9 +754,11 @@ "showAdvancedNftFields": "Show advanced fields", "showAdvancedNftFieldsTooltip": "The form above only allows setting name and description in the metadata attached to the image. Turn this on to view more advanced fields.", "showAdvancedSettings": "Show advanced settings", + "slow": "Slow", "smartContractAddress": "Smart contract address", "smartContractMessage": "Smart contract message", "smartContractMessageDescription": "The smart contract message to execute.", + "speed": "Speed", "spendingAllowance": "Spending allowance", "spendingAllowanceDescription": "The amount of funds allowed to be spent by the authorized account.", "standardCollection": "Standard Collection", @@ -739,6 +769,8 @@ "suggestedItems": "Suggested items", "suggestedValues": "Suggested values", "symbol": "Symbol", + "targetOverrideStrategy": "Target override strategy", + "targetOverrideStrategyDescription": "The strategy used for overriding targets when settings conflict (for example, a minimum balance may cause a token to surpass its target percentage after a price increase).\n- **Proportional** means that all other targets are adjusted proportionally.\n- **Priority** means that the rebalancer will try to ensure the higher priority targets (based on their order) are met, sacrificing the targets of the lower priority tokens.", "tierNameTitle": "Tier name", "tierNameTooltip": "The \"class\" of member. For example: \"Core developers\" or \"friends and family.\" These names are only for your reference.", "timelockDuration": "Timelock duration", @@ -753,6 +785,9 @@ "tokenInstructions": "Token instructions", "tokenSwapCreateInstructions": "In this step, you will create the token swap. This creation step describes how many funds each party needs to send for the swap to complete. <2>No funds will be transferred at this time.", "tokenSwapExistingInstructions": "In this step, you will choose a token swap that you (or the counterparty) has already initiated. After you fund a swap, you can withdraw the tokens you funded unless (or until) the counterparty has paid. Likewise, the counterparty can withdraw the tokens they funded until you pay.", + "tokenTargets": "Token targets", + "tokens": "Tokens", + "trustee": "Trustee", "uniqueTokenId": "Unique token ID", "unjailValidatorMessage": "Unjail validator message", "unjailValidatorMessageTooltip": "When a validator is 'jailed' for downtime, you must submit an Unjail transaction from the operator account in order to be able to get block proposer rewards again.", @@ -884,6 +919,7 @@ "allCrossChainAccountsCreated": "All available cross-chain accounts have been created. If you want to request support for other chains, please reach out to us on Discord.", "allNftSupportedChainsAddedPrompt": "NFTs loaded from all DAO DAO-supported chains.", "allNftSupportedChainsAddedPromptTooltip": "You have added all chains that DAO DAO supports to your profile.", + "allSupportedTokensAdded": "All supported tokens have been added.", "allowlist": "Allowlist", "amountWillBeReceived": "Amount that will be received", "andNumMore": "and {{count}} more", @@ -930,6 +966,7 @@ "compensationCycleClosedAwaitingCompletion": "Contributions and ratings have been submitted. Review the results and create a proposal to complete the cycle. Alternatively, you may link it to an existing proposal or complete it without creating a proposal.", "completeRelayOrLoseFunds": "Make sure you have completed the relaying process, or you may lose the tokens you sent to the relayers to pay fees.", "completed": "Completed", + "configureRebalancerDescription": "Configure the treasury rebalancer.", "configureVestingPaymentsDescription": "Configure vesting payments and enable them on more chains.", "configureWalletModalExplanation": "You have a wallet extension installed, but it doesn't seem like you've set up a wallet. Create a wallet to continue.", "connectedTo": "Connected to {{name}}", @@ -957,6 +994,7 @@ "createStep2": "Governance configuration", "createStep3": "Voting configuration", "createStep4": "Review and approve", + "createValenceAccountDescription": "Create a new Rebalancer account.", "createdPressContract": "The press contract has been created.", "creatingDao": "Creating DAO...", "creationPolicyTooltip": "Who is allowed to create proposals?", @@ -1023,6 +1061,7 @@ "followTooltip": "Follow this DAO to show it in your feed and receive proposal notifications according to your settings.", "forceExecuteTooltip": "Ignore form errors and attempt to execute the transaction anyway. The transaction will still be simulated on-chain as a final verification that the actions are valid.", "forcePublishTooltip": "Ignore form errors and attempt to publish the proposal anyway. The proposal actions will still be simulated on-chain as a final verification that the actions are valid.", + "fundRebalancerDescription": "Deposit funds into the rebalancer.", "funded": "Funded", "getTokensOn": "Get tokens on {{name}}.", "goToParent": "Go to parent DAO", @@ -1085,6 +1124,7 @@ "migrateMigalooV4TokenFactoryExplanation": "The token factory module on Migaloo has been migrated to a new version that is more actively maintained. Because this DAO created a new token before the migration, the DAO's token factory contract that interacts with the chain module must now be upgraded. This action upgrades the token factory contract to a version that supports the new token factory module.", "migrateSmartContractActionDescription": "Migrate a CosmWasm contract to a new code ID.", "migrateTokenFactoryModuleDescription": "Update the DAO to support the new token factory module.", + "minBalanceToCreateAccount": "A minimum balance of {{balance}} is required to create an account.", "minimumOutputRequiredDescription_dao": "Before the proposal is passed and executed, the swap price will fluctuate. If the price drops and no longer satisfies this minimum output required, the swap will not occur.", "minimumOutputRequiredDescription_gov": "Before the proposal is passed and executed, the swap price will fluctuate. If the price drops and no longer satisfies this minimum output required, the swap will not occur.", "minimumOutputRequiredDescription_wallet": "The exact swap price will fluctuate during the transaction, but the minimum output amount is guaranteed. If the price drops and no longer satisfies this minimum output required, the swap will not occur.", @@ -1125,6 +1165,7 @@ "noQuorum": "No quorum", "noSubDaosYet": "No SubDAOs yet.", "noSubmission": "No submission", + "noTarget": "no target", "noTokenSelected": "No token selected", "noVestingPaymentsFound": "No vesting payments found.", "noVetoableProposalsFound": "No vetoable proposals found.", @@ -1168,6 +1209,8 @@ "passingThresholdTooltip_quorum": "The proportion of voters who must vote 'Yes' on a single choice proposal for it to pass. Because quorum is enabled, this threshold is calculated only from those who voted.", "pastGovPropQuorumHiddenExplanation_passed": "Quorum is hidden because the total voting power has changed since this proposal closed. The proposal passed, so the quorum must have been reached.", "pastGovPropQuorumHiddenExplanation_rejected": "Quorum is hidden because the total voting power has changed since this proposal closed.", + "pauseRebalancerDescription": "Pause rebalancing.", + "pauseRebalancerExplanation": "This action temporarily stops rebalancing.", "pending": "Pending", "pendingRewards": "Pending rewards", "percentVotingPower": "{{percent}} voting power", @@ -1235,6 +1278,8 @@ "ratingClosesAt": "Rating closes at {{date}}.", "reached": "Reached", "realVotingVaultDescription": "Deposit {{tokenSymbol}} to get voting power.", + "rebalancerGraphTooltip": "The graph below shows the historical balances of the rebalanced tokens, which are displayed directly underneath the graph.", + "rebalancerProjectionExplanation": "This projection displays the expected behavior of the system assuming prices remain constant. In reality, prices will fluctuate.", "recognizeSubDaoDescription": "{{name}} is a legitimate SubDAO. This adds it to the SubDAOs tab.", "redelegate": "Redelegate", "refund": "Refund", @@ -1246,6 +1291,8 @@ "removeCw20FromTreasuryActionDescription": "Stop displaying the DAO's balance of a CW20 token in the treasury view.", "removeCw721FromTreasuryActionDescription": "Stop displaying the NFTs owned by the DAO from a CW721 NFT collection in the treasury view.", "required": "Required", + "resumeRebalancerDescription": "Resume rebalancing.", + "resumeRebalancerExplanation": "This action resumes rebalancing.", "retroactiveCompensationDescription": "After each contribution cycle, contributors are assigned points based on their contributions. Payment is split based on the points they receive.", "reviewActionImportData": "Review the following actions to make sure they look right. If they do, click the Import button at the bottom to add them to the proposal.", "reviewYourProposal": "Review your proposal...", @@ -1301,6 +1348,8 @@ "supportedChainNftsNotShowingUpPrompt": "Click to find NFTs on other DAO DAO-supported chains", "supportedChainNftsNotShowingUpPromptTooltip": "You have not added all chains that DAO DAO supports to your profile. Add them to find more NFTs to use as your profile picture.", "supportsMarkdown": "Supports Markdown", + "swapTokensOnWyndDescription": "Swap tokens on WYND DEX.", + "target": "target", "testnet": "Testnet", "tierMemberGovTokenAllocationTooltip": "This member will receive {{tokens}} ${{tokenSymbol}} when the DAO is created.", "to": "to", @@ -1329,6 +1378,7 @@ "transferNftDescription_gov": "Transfer an NFT from the Community Pool.", "transferNftDescription_wallet": "Transfer an NFT from your wallet.", "treasuryBalanceDescription": "{{numberOfTokensMinted, number}} tokens will be minted. {{memberPercent}} will be sent to members according to the distribution below. The remaining {{treasuryPercent}} will go to the DAO's treasury, where they can be distributed later via governance proposals.", + "treasuryHistoryTooltip": "The graph below displays the historical value of the treasury across all chains.", "treasuryPercent": "Treasury percent", "treasuryValueTooltip": "This graph displays the historical value of the treasury across all chains, excluding staked balances.", "tryingAgain": "Trying again...", @@ -1403,11 +1453,13 @@ "votingPowerAtCreationTooltip": "This was your voting power at the time of proposal creation.", "votingVaultsExplanation": "Voting power in the DAO derives from multiple sources.", "waitingForRateAndPropose": "Waiting for DAO members to rate and propose...", + "walletPageDescription": "View the tokens and NFTs for wallet {{address}}.", "whatAreYouLookingForPrompt": "What are you looking for?", "whatDoTheyWantToBeRated": "What do they want to be rated?", "whatDoYouWantToBeRated": "What do you want to be rated?", "widgetActive": "This widget is active.", "winningOptionTooltip": "This is the winning option.", + "withdrawFromRebalancerDescription": "Withdraw funds from the rebalancer.", "withdrawStakingRewards": "Withdraw staking rewards", "withdrawTokenSwapDescription": "Withdraw funds from a token swap that has not yet completed.", "wouldYouLikeToSearchQuestion": "Would you like to search for a DAO?", @@ -1571,6 +1623,7 @@ "completedCompensationCycles": "Completed compensation cycles", "config": "Config", "configuration": "Configuration", + "configureRebalancer": "Configure Rebalancer", "configureVestingPayments": "Configure Vesting Payments", "configureWalletToContinue": "Configure your wallet to continue", "congratsOnDao": "Congrats on your DAO!", @@ -1589,6 +1642,7 @@ "createNftCollection": "Create NFT Collection", "createPost": "Create Post", "createProposal": "Create proposal", + "createValenceAccount": "Create Rebalancer Account", "createValidator": "Create a validator", "created": "Created", "createdAccount": "Created account", @@ -1651,6 +1705,7 @@ "fixChildAdmin": "Fix {{child}} admin", "following": "Following", "fundAndExecute": "Fund and execute", + "fundRebalancer": "Fund Rebalancer", "github": "GitHub", "governance": "Governance", "governanceConfiguration": "Governance configuration", @@ -1721,6 +1776,7 @@ "noProposal": "No proposal", "noWinner": "No winner", "nominateContributor": "Nominate Contributor", + "nonRebalancedTokens": "Non-rebalanced tokens", "noneOfTheAbove": "None of the above", "notAMember": "Not a Member", "notInstalled": "Not installed", @@ -1749,6 +1805,7 @@ "owner": "Owner", "pages": "Pages", "passingThreshold": "Passing threshold", + "pauseRebalancer": "Pause Rebalancer", "payout": "Payout", "payroll": "Payroll", "pending": "Pending", @@ -1779,6 +1836,7 @@ "quorum": "Quorum", "ratioOfVotes": "Ratio of votes", "rawData": "Raw data", + "rebalancer": "Rebalancer", "recentProposals": "Recent proposals", "recipient": "Recipient", "recognizeSubDao": "Recognize {{name}} as a SubDAO", @@ -1794,6 +1852,7 @@ "resetting": "Resetting...", "restake": "Restake", "results": "Results", + "resumeRebalancer": "Resume Rebalancer", "retroactive": "Retroactive", "retroactiveCompensation": "Retroactive compensation", "reviewTransaction": "Review Transaction", @@ -1835,6 +1894,8 @@ "suggestions": "Suggestions", "summary": "Summary", "supplies": "Supplies", + "swapTokensOnWynd": "Swap Tokens on WYND", + "target": "Target", "threshold": "Threshold", "tied": "Tied", "tierNum": "Tier {{tier}}", @@ -1924,6 +1985,7 @@ "widgets": "Widgets", "winner": "Winner", "winningChoice": "Winning choice", + "withdrawFromRebalancer": "Withdraw from Rebalancer", "withdrawTokenSwap": "Withdraw Token Swap", "withdrawValidatorCommission": "Claim validator commission", "yourDaos": "Your DAOs", diff --git a/packages/state/contracts/ValenceRebalancer.ts b/packages/state/contracts/ValenceRebalancer.ts new file mode 100644 index 000000000..8988dc48b --- /dev/null +++ b/packages/state/contracts/ValenceRebalancer.ts @@ -0,0 +1,409 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import { StdFee } from '@cosmjs/amino' +import { + CosmWasmClient, + ExecuteResult, + SigningCosmWasmClient, +} from '@cosmjs/cosmwasm-stargate' + +import { + Addr, + ArrayOfTupleOfAddrAndRebalancerConfig, + Coin, + ManagersAddrsResponse, + NullableCoin, + PauseData, + QueryFeeAction, + RebalancerAdminMsg, + RebalancerConfig, + RebalancerData, + RebalancerUpdateData, + SystemRebalanceStatus, + WhitelistsResponse, +} from '@dao-dao/types/contracts/ValenceRebalancer' +import { CHAIN_GAS_MULTIPLIER } from '@dao-dao/utils' + +export interface ValenceRebalancerReadOnlyInterface { + contractAddress: string + getConfig: ({ addr }: { addr: string }) => Promise + getAllConfigs: ({ + limit, + startAfter, + }: { + limit?: number + startAfter?: string + }) => Promise + getPausedConfig: ({ addr }: { addr: string }) => Promise + getSystemStatus: () => Promise + getServiceFee: ({ + account, + action, + }: { + account: string + action: QueryFeeAction + }) => Promise + getWhiteLists: () => Promise + getManagersAddrs: () => Promise + getAdmin: () => Promise +} +export class ValenceRebalancerQueryClient + implements ValenceRebalancerReadOnlyInterface +{ + client: CosmWasmClient + contractAddress: string + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client + this.contractAddress = contractAddress + this.getConfig = this.getConfig.bind(this) + this.getAllConfigs = this.getAllConfigs.bind(this) + this.getPausedConfig = this.getPausedConfig.bind(this) + this.getSystemStatus = this.getSystemStatus.bind(this) + this.getServiceFee = this.getServiceFee.bind(this) + this.getWhiteLists = this.getWhiteLists.bind(this) + this.getManagersAddrs = this.getManagersAddrs.bind(this) + this.getAdmin = this.getAdmin.bind(this) + } + getConfig = async ({ addr }: { addr: string }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_config: { + addr, + }, + }) + } + getAllConfigs = async ({ + limit, + startAfter, + }: { + limit?: number + startAfter?: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_all_configs: { + limit, + start_after: startAfter, + }, + }) + } + getPausedConfig = async ({ addr }: { addr: string }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_paused_config: { + addr, + }, + }) + } + getSystemStatus = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_system_status: {}, + }) + } + getServiceFee = async ({ + account, + action, + }: { + account: string + action: QueryFeeAction + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_service_fee: { + account, + action, + }, + }) + } + getWhiteLists = async (): Promise => { + return this.client.queryContractSmart( + this.contractAddress, + 'get_white_lists' + ) + } + getManagersAddrs = async (): Promise => { + return this.client.queryContractSmart( + this.contractAddress, + 'get_managers_addrs' + ) + } + getAdmin = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, 'get_admin') + } +} +export interface ValenceRebalancerInterface + extends ValenceRebalancerReadOnlyInterface { + contractAddress: string + sender: string + admin: ( + rebalancerAdminMsg: RebalancerAdminMsg, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + systemRebalance: ( + { + limit, + }: { + limit?: number + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + register: ( + { + data, + registerFor, + }: { + data?: RebalancerData + registerFor: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + deregister: ( + { + deregisterFor, + }: { + deregisterFor: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + update: ( + { + data, + updateFor, + }: { + data: RebalancerUpdateData + updateFor: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + pause: ( + { + pauseFor, + reason, + sender, + }: { + pauseFor: string + reason?: string + sender: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise + resume: ( + { + resumeFor, + sender, + }: { + resumeFor: string + sender: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + _funds?: Coin[] + ) => Promise +} +export class ValenceRebalancerClient + extends ValenceRebalancerQueryClient + implements ValenceRebalancerInterface +{ + client: SigningCosmWasmClient + sender: string + contractAddress: string + constructor( + client: SigningCosmWasmClient, + sender: string, + contractAddress: string + ) { + super(client, contractAddress) + this.client = client + this.sender = sender + this.contractAddress = contractAddress + this.admin = this.admin.bind(this) + this.systemRebalance = this.systemRebalance.bind(this) + this.register = this.register.bind(this) + this.deregister = this.deregister.bind(this) + this.update = this.update.bind(this) + this.pause = this.pause.bind(this) + this.resume = this.resume.bind(this) + } + admin = async ( + rebalancerAdminMsg: RebalancerAdminMsg, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + admin: rebalancerAdminMsg, + }, + fee, + memo, + _funds + ) + } + systemRebalance = async ( + { + limit, + }: { + limit?: number + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + system_rebalance: { + limit, + }, + }, + fee, + memo, + _funds + ) + } + register = async ( + { + data, + registerFor, + }: { + data?: RebalancerData + registerFor: string + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + register: { + data, + register_for: registerFor, + }, + }, + fee, + memo, + _funds + ) + } + deregister = async ( + { + deregisterFor, + }: { + deregisterFor: string + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + deregister: { + deregister_for: deregisterFor, + }, + }, + fee, + memo, + _funds + ) + } + update = async ( + { + data, + updateFor, + }: { + data: RebalancerUpdateData + updateFor: string + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + update: { + data, + update_for: updateFor, + }, + }, + fee, + memo, + _funds + ) + } + pause = async ( + { + pauseFor, + reason, + sender, + }: { + pauseFor: string + reason?: string + sender: string + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + pause: { + pause_for: pauseFor, + reason, + sender, + }, + }, + fee, + memo, + _funds + ) + } + resume = async ( + { + resumeFor, + sender, + }: { + resumeFor: string + sender: string + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + _funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + resume: { + resume_for: resumeFor, + sender, + }, + }, + fee, + memo, + _funds + ) + } +} diff --git a/packages/state/contracts/index.ts b/packages/state/contracts/index.ts index 5d3957f9e..653c59791 100644 --- a/packages/state/contracts/index.ts +++ b/packages/state/contracts/index.ts @@ -91,6 +91,10 @@ export { PolytoneProxyClient, PolytoneProxyQueryClient } from './PolytoneProxy' export { PolytoneVoiceClient, PolytoneVoiceQueryClient } from './PolytoneVoice' export { SecretCwAdminFactoryClient } from './SecretCwAdminFactory' export { Sg721BaseClient, Sg721BaseQueryClient } from './Sg721Base' +export { + ValenceRebalancerClient, + ValenceRebalancerQueryClient, +} from './ValenceRebalancer' export { SecretDaoDaoCoreClient, SecretDaoDaoCoreQueryClient, diff --git a/packages/state/query/queries/account.ts b/packages/state/query/queries/account.ts index 842ebb293..2aae1211a 100644 --- a/packages/state/query/queries/account.ts +++ b/packages/state/query/queries/account.ts @@ -6,8 +6,11 @@ import { AccountType, CryptographicMultisigAccount, Cw3MultisigAccount, + GenericToken, MultisigAccount, PolytoneProxies, + TokenType, + ValenceAccount, } from '@dao-dao/types' import { ListItemsResponse } from '@dao-dao/types/contracts/DaoDaoCore' import { Threshold } from '@dao-dao/types/contracts/DaoProposalSingle.common' @@ -21,15 +24,18 @@ import { getChainForChainId, getConfiguredChainConfig, getIbcTransferInfoBetweenChains, + getSupportedChainConfig, ibcProtoRpcClientRouter, secp256k1PublicKeyToBech32Address, } from '@dao-dao/utils' import { chainQueries } from './chain' import { contractQueries } from './contract' -import { cw3FlexMultisigQueries } from './contracts' +import { cw3FlexMultisigQueries, valenceRebalancerQueries } from './contracts' import { daoDaoCoreQueries } from './contracts/DaoDaoCore' +import { indexerQueries } from './indexer' import { polytoneQueries } from './polytone' +import { tokenQueries } from './token' /** * Fetch the list of accounts associated with the specified address, with @@ -62,20 +68,31 @@ export const fetchAccountList = async ( ) } - const [isDao, isPolytoneProxy] = await Promise.all([ + const [isDao, isPolytoneProxy, isValenceAccount] = await Promise.all([ queryClient.fetchQuery( contractQueries.isDao(queryClient, { chainId, address }) ), queryClient.fetchQuery( contractQueries.isPolytoneProxy(queryClient, { chainId, address }) ), + queryClient.fetchQuery( + contractQueries.isValenceAccount(queryClient, { chainId, address }) + ), ]) - const mainAccount: Account = { - chainId, - address, - type: isPolytoneProxy ? AccountType.Polytone : AccountType.Native, - } + const mainAccount: Account = isValenceAccount + ? // If this is a valence account, get its config. + await queryClient.fetchQuery( + accountQueries.valence(queryClient, { + chainId, + address, + }) + ) + : { + chainId, + address, + type: isPolytoneProxy ? AccountType.Polytone : AccountType.Native, + } const [polytoneProxies, registeredIcas] = await Promise.all([ mainAccount.type !== AccountType.Polytone @@ -143,6 +160,25 @@ export const fetchAccountList = async ( } }) + // Get valence accounts controlled by all non-valence accounts. + const valenceAccounts = ( + await Promise.allSettled( + allAccounts + .filter(({ type }) => type !== AccountType.Valence) + .map(({ chainId, address }) => + queryClient.fetchQuery( + accountQueries.valenceAccounts(queryClient, { + address, + chainId, + }) + ) + ) + ) + ).flatMap((p) => (p.status === 'fulfilled' ? p.value : [])) + + // Add valence accounts. + allAccounts.push(...valenceAccounts) + return allAccounts } @@ -379,6 +415,119 @@ export const fetchMultisigAccount = async ( } } +/** + * Fetch a Valence account. + */ +export const fetchValenceAccount = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise => { + const rebalancerAddress = + getSupportedChainConfig(chainId)?.valence?.rebalancer + + const rebalancerConfig = rebalancerAddress + ? await queryClient + .fetchQuery( + valenceRebalancerQueries.getConfig({ + chainId, + contractAddress: rebalancerAddress, + args: { + addr: address, + }, + }) + ) + // This will error when no rebalancer is configured. + .catch(() => null) + : null + + const uniqueDenoms = rebalancerConfig?.targets.map(({ denom }) => denom) || [] + // Map token denom to token. + const tokenMap = ( + await Promise.all( + uniqueDenoms.map((denom) => + queryClient.fetchQuery( + tokenQueries.info(queryClient, { + chainId, + type: TokenType.Native, + denomOrAddress: denom, + }) + ) + ) + ) + ).reduce( + (acc, token) => ({ + ...acc, + [token.denomOrAddress]: token, + }), + {} as Record + ) + + const account: ValenceAccount = { + type: AccountType.Valence, + chainId, + address, + config: { + rebalancer: rebalancerConfig && { + config: rebalancerConfig, + targets: rebalancerConfig.targets.map((target) => ({ + token: tokenMap[target.denom], + // TODO(rebalancer): Get targets over time. + targets: [ + { + timestamp: 0, + ...target, + }, + ], + })), + }, + }, + } + + return account +} + +/** + * Fetch the Valence accounts owned by a given address. + */ +export const fetchValenceAccounts = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise => { + const addresses = await queryClient.fetchQuery( + indexerQueries.queryWallet(queryClient, { + chainId, + walletAddress: address, + formula: 'valence/accounts', + }) + ) + if (!addresses || !Array.isArray(addresses)) { + return [] + } + + return Promise.all( + addresses.map((address) => + queryClient.fetchQuery( + accountQueries.valence(queryClient, { + chainId, + address, + }) + ) + ) + ) +} + export const accountQueries = { /** * Fetch the list of accounts associated with the specified address. @@ -434,4 +583,26 @@ export const accountQueries = { ? () => fetchMultisigAccount(queryClient, options) : skipToken, }), + /** + * Fetch a Valence account. + */ + valence: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['account', 'valence', options], + queryFn: () => fetchValenceAccount(queryClient, options), + }), + /** + * Fetch the Valence accounts owned by a given address. + */ + valenceAccounts: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['account', 'valenceAccounts', options], + queryFn: () => fetchValenceAccounts(queryClient, options), + }), } diff --git a/packages/state/query/queries/contract.ts b/packages/state/query/queries/contract.ts index 482244db6..0782e9e89 100644 --- a/packages/state/query/queries/contract.ts +++ b/packages/state/query/queries/contract.ts @@ -238,6 +238,17 @@ export const contractQueries = { ...options, nameOrNames: ContractName.PolytoneProxy, }), + /** + * Check if a contract is a Valence account. + */ + isValenceAccount: ( + queryClient: QueryClient, + options: Omit[1], 'nameOrNames'> + ) => + contractQueries.isContract(queryClient, { + ...options, + nameOrNames: ContractName.ValenceAccount, + }), /** * Check if a contract is a cw1-whitelist. */ diff --git a/packages/state/query/queries/contracts/ValenceRebalancer.extra.ts b/packages/state/query/queries/contracts/ValenceRebalancer.extra.ts new file mode 100644 index 000000000..797f9bb8d --- /dev/null +++ b/packages/state/query/queries/contracts/ValenceRebalancer.extra.ts @@ -0,0 +1,77 @@ +import { QueryClient, queryOptions, skipToken } from '@tanstack/react-query' + +import { GenericToken, TokenType } from '@dao-dao/types' + +import { tokenQueries } from '../token' +import { valenceRebalancerQueries } from './ValenceRebalancer' + +/** + * Get the generic tokens for the whitelisted tokens in the rebalancer. + */ +export const fetchValenceRebalancerWhitelistGenericTokens = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise<{ + baseDenoms: GenericToken[] + denoms: GenericToken[] +}> => { + const whitelists = await queryClient.fetchQuery( + valenceRebalancerQueries.getWhiteLists({ + chainId, + contractAddress: address, + }) + ) + + const [baseDenoms, denoms] = await Promise.all([ + Promise.all( + whitelists.base_denom_whitelist.map(({ denom }) => + queryClient.fetchQuery( + tokenQueries.info(queryClient, { + chainId, + type: TokenType.Native, + denomOrAddress: denom, + }) + ) + ) + ), + Promise.all( + whitelists.denom_whitelist.map((denom) => + queryClient.fetchQuery( + tokenQueries.info(queryClient, { + chainId, + type: TokenType.Native, + denomOrAddress: denom, + }) + ) + ) + ), + ]) + + return { + baseDenoms, + denoms, + } +} + +export const valenceRebalancerExtraQueries = { + /** + * Get the generic tokens for the whitelisted tokens in the rebalancer. + */ + whitelistGenericTokens: ( + queryClient: QueryClient, + options?: Parameters[1] + ) => + queryOptions({ + queryKey: ['valenceRebalancerExtra', 'whitelistGenericTokens', options], + queryFn: options + ? () => + fetchValenceRebalancerWhitelistGenericTokens(queryClient, options) + : skipToken, + }), +} diff --git a/packages/state/query/queries/contracts/ValenceRebalancer.ts b/packages/state/query/queries/contracts/ValenceRebalancer.ts new file mode 100644 index 000000000..0f8567104 --- /dev/null +++ b/packages/state/query/queries/contracts/ValenceRebalancer.ts @@ -0,0 +1,308 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import { UseQueryOptions } from '@tanstack/react-query' + +import { Addr } from '@dao-dao/types' +import { + ArrayOfTupleOfAddrAndRebalancerConfig, + ManagersAddrsResponse, + NullableCoin, + PauseData, + QueryFeeAction, + RebalancerConfig, + SystemRebalanceStatus, + WhitelistsResponse, +} from '@dao-dao/types/contracts/ValenceRebalancer' +import { getCosmWasmClientForChainId } from '@dao-dao/utils' + +import { ValenceRebalancerQueryClient } from '../../../contracts/ValenceRebalancer' + +export const valenceRebalancerQueryKeys = { + contract: [ + { + contract: 'valenceRebalancer', + }, + ] as const, + address: (contractAddress: string) => + [ + { + ...valenceRebalancerQueryKeys.contract[0], + address: contractAddress, + }, + ] as const, + getConfig: (contractAddress: string, args?: Record) => + [ + { + ...valenceRebalancerQueryKeys.address(contractAddress)[0], + method: 'get_config', + args, + }, + ] as const, + getAllConfigs: (contractAddress: string, args?: Record) => + [ + { + ...valenceRebalancerQueryKeys.address(contractAddress)[0], + method: 'get_all_configs', + args, + }, + ] as const, + getPausedConfig: (contractAddress: string, args?: Record) => + [ + { + ...valenceRebalancerQueryKeys.address(contractAddress)[0], + method: 'get_paused_config', + args, + }, + ] as const, + getSystemStatus: (contractAddress: string, args?: Record) => + [ + { + ...valenceRebalancerQueryKeys.address(contractAddress)[0], + method: 'get_system_status', + args, + }, + ] as const, + getServiceFee: (contractAddress: string, args?: Record) => + [ + { + ...valenceRebalancerQueryKeys.address(contractAddress)[0], + method: 'get_service_fee', + args, + }, + ] as const, + getWhiteLists: (contractAddress: string, args?: Record) => + [ + { + ...valenceRebalancerQueryKeys.address(contractAddress)[0], + method: 'get_white_lists', + args, + }, + ] as const, + getManagersAddrs: (contractAddress: string, args?: Record) => + [ + { + ...valenceRebalancerQueryKeys.address(contractAddress)[0], + method: 'get_managers_addrs', + args, + }, + ] as const, + getAdmin: (contractAddress: string, args?: Record) => + [ + { + ...valenceRebalancerQueryKeys.address(contractAddress)[0], + method: 'get_admin', + args, + }, + ] as const, +} +export const valenceRebalancerQueries = { + getConfig: ({ + chainId, + contractAddress, + args, + options, + }: ValenceRebalancerGetConfigQuery): UseQueryOptions< + RebalancerConfig, + Error, + TData + > => ({ + queryKey: valenceRebalancerQueryKeys.getConfig(contractAddress, args), + queryFn: async () => { + return new ValenceRebalancerQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).getConfig({ + addr: args.addr, + }) + }, + ...options, + }), + getAllConfigs: ({ + chainId, + contractAddress, + args, + options, + }: ValenceRebalancerGetAllConfigsQuery): UseQueryOptions< + ArrayOfTupleOfAddrAndRebalancerConfig, + Error, + TData + > => ({ + queryKey: valenceRebalancerQueryKeys.getAllConfigs(contractAddress, args), + queryFn: async () => { + return new ValenceRebalancerQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).getAllConfigs({ + limit: args.limit, + startAfter: args.startAfter, + }) + }, + ...options, + }), + getPausedConfig: ({ + chainId, + contractAddress, + args, + options, + }: ValenceRebalancerGetPausedConfigQuery): UseQueryOptions< + PauseData, + Error, + TData + > => ({ + queryKey: valenceRebalancerQueryKeys.getPausedConfig(contractAddress, args), + queryFn: async () => { + return new ValenceRebalancerQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).getPausedConfig({ + addr: args.addr, + }) + }, + ...options, + }), + getSystemStatus: ({ + chainId, + contractAddress, + options, + }: ValenceRebalancerGetSystemStatusQuery): UseQueryOptions< + SystemRebalanceStatus, + Error, + TData + > => ({ + queryKey: valenceRebalancerQueryKeys.getSystemStatus(contractAddress), + queryFn: async () => { + return new ValenceRebalancerQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).getSystemStatus() + }, + ...options, + }), + getServiceFee: ({ + chainId, + contractAddress, + args, + options, + }: ValenceRebalancerGetServiceFeeQuery): UseQueryOptions< + NullableCoin, + Error, + TData + > => ({ + queryKey: valenceRebalancerQueryKeys.getServiceFee(contractAddress, args), + queryFn: async () => { + return new ValenceRebalancerQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).getServiceFee({ + account: args.account, + action: args.action, + }) + }, + ...options, + }), + getWhiteLists: ({ + chainId, + contractAddress, + options, + }: ValenceRebalancerGetWhiteListsQuery): UseQueryOptions< + WhitelistsResponse, + Error, + TData + > => ({ + queryKey: valenceRebalancerQueryKeys.getWhiteLists(contractAddress), + queryFn: async () => { + return new ValenceRebalancerQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).getWhiteLists() + }, + ...options, + }), + getManagersAddrs: ({ + chainId, + contractAddress, + options, + }: ValenceRebalancerGetManagersAddrsQuery): UseQueryOptions< + ManagersAddrsResponse, + Error, + TData + > => ({ + queryKey: valenceRebalancerQueryKeys.getManagersAddrs(contractAddress), + queryFn: async () => { + return new ValenceRebalancerQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).getManagersAddrs() + }, + ...options, + }), + getAdmin: ({ + chainId, + contractAddress, + options, + }: ValenceRebalancerGetAdminQuery): UseQueryOptions< + Addr, + Error, + TData + > => ({ + queryKey: valenceRebalancerQueryKeys.getAdmin(contractAddress), + queryFn: async () => { + return new ValenceRebalancerQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).getAdmin() + }, + ...options, + }), +} +export interface ValenceRebalancerReactQuery { + chainId: string + contractAddress: string + options?: Omit< + UseQueryOptions, + 'queryKey' | 'queryFn' | 'initialData' + > & { + initialData?: undefined + } +} +export interface ValenceRebalancerGetServiceFeeQuery + extends ValenceRebalancerReactQuery { + args: { + account: string + action: QueryFeeAction + } +} +export interface ValenceRebalancerGetPausedConfigQuery + extends ValenceRebalancerReactQuery { + args: { + addr: string + } +} +export interface ValenceRebalancerGetSystemStatusQuery + extends ValenceRebalancerReactQuery {} +export interface ValenceRebalancerGetAllConfigsQuery + extends ValenceRebalancerReactQuery< + ArrayOfTupleOfAddrAndRebalancerConfig, + TData + > { + args: { + limit?: number + startAfter?: string + } +} +export interface ValenceRebalancerGetConfigQuery + extends ValenceRebalancerReactQuery { + args: { + addr: string + } +} +export interface ValenceRebalancerGetWhiteListsQuery + extends ValenceRebalancerReactQuery {} +export interface ValenceRebalancerGetManagersAddrsQuery + extends ValenceRebalancerReactQuery {} +export interface ValenceRebalancerGetAdminQuery + extends ValenceRebalancerReactQuery {} diff --git a/packages/state/query/queries/contracts/index.ts b/packages/state/query/queries/contracts/index.ts index feda9fe55..44555c994 100644 --- a/packages/state/query/queries/contracts/index.ts +++ b/packages/state/query/queries/contracts/index.ts @@ -6,6 +6,8 @@ export * from './PolytoneNote' export * from './PolytoneProxy' export * from './PolytoneVoice' export * from './votingModule' +export * from './ValenceRebalancer' +export * from './ValenceRebalancer.extra' export * from './SecretDaoDaoCore' export * from './SecretDaoPreProposeSingle' export * from './DaoProposalSingle.v2' diff --git a/packages/state/recoil/selectors/account.ts b/packages/state/recoil/selectors/account.ts index 852e22b97..1b7806d91 100644 --- a/packages/state/recoil/selectors/account.ts +++ b/packages/state/recoil/selectors/account.ts @@ -10,21 +10,14 @@ import { AccountType, GenericToken, GenericTokenBalanceWithOwner, - IcaAccount, TokenType, WithChainId, } from '@dao-dao/types' -import { - ICA_CHAINS_TX_PREFIX, - POLYTONE_CONFIG_PER_CHAIN, - getConfiguredChainConfig, - tokensEqual, -} from '@dao-dao/utils' +import { POLYTONE_CONFIG_PER_CHAIN, tokensEqual } from '@dao-dao/utils' -import { moduleAddressSelector } from './chain' -import { isDaoSelector, isPolytoneProxySelector } from './contract' -import { DaoDaoCoreSelectors, PolytoneProxySelectors } from './contracts' -import { icaRemoteAddressSelector } from './ica' +import { accountQueries } from '../../query' +import { queryClientAtom } from '../atoms' +import { PolytoneProxySelectors } from './contracts' import { genericTokenBalanceSelector, genericTokenBalancesSelector, @@ -32,8 +25,12 @@ import { genericTokenUndelegatingBalancesSelector, } from './token' -// Get accounts controlled by this address, including its native chain, all -// polytone proxies, and all ICA accounts. +/** + * Fetch the list of accounts associated with the specified address, with + * support for: + * - detecting if the address is a polytone proxy + * - automatically loading a DAO's registered ICAs + */ export const accountsSelector = selectorFamily< Account[], WithChainId<{ @@ -46,102 +43,14 @@ export const accountsSelector = selectorFamily< get: ({ chainId, address, includeIcaChains }) => ({ get }) => { - const chainConfig = getConfiguredChainConfig(chainId) - // In case address is the name of a chain, get the gov module address. - if (chainConfig?.name === address) { - address = get( - moduleAddressSelector({ - chainId, - name: 'gov', - }) - ) - } - - const [isDao, isPolytoneProxy] = get( - waitForAll([ - isDaoSelector({ - chainId, - address, - }), - isPolytoneProxySelector({ - chainId, - address, - }), - ]) + const queryClient = get(queryClientAtom) + return queryClient.fetchQuery( + accountQueries.list(queryClient, { + chainId, + address, + ...(includeIcaChains && { includeIcaChains }), + }) ) - - // If this is a DAO, get its polytone proxies and registered ICAs. - const [polytoneProxies, registeredIcas] = isDao - ? get( - waitForAll([ - DaoDaoCoreSelectors.polytoneProxiesSelector({ - chainId, - contractAddress: address, - }), - DaoDaoCoreSelectors.listAllItemsWithPrefixSelector({ - chainId, - contractAddress: address, - prefix: ICA_CHAINS_TX_PREFIX, - }), - ]) - ) - : [] - - const mainAccount: Account = { - chainId, - address, - type: isPolytoneProxy ? AccountType.Polytone : AccountType.Native, - } - - const allAccounts: Account[] = [ - // Main account. - mainAccount, - // Polytone. - ...Object.entries(polytoneProxies || {}).map( - ([chainId, address]): Account => ({ - chainId, - address, - type: AccountType.Polytone, - }) - ), - ] - - // If main account is native, load ICA accounts. - const icaChains = - mainAccount.type === AccountType.Native - ? [ - ...(registeredIcas || []).map(([key]) => key), - ...(includeIcaChains || []), - ] - : [] - - // Get ICA addresses controlled by native account. - const icas = icaChains.length - ? get( - waitForAllSettled( - icaChains.map((chainId) => - icaRemoteAddressSelector({ - srcChainId: mainAccount.chainId, - address: mainAccount.address, - destChainId: chainId, - }) - ) - ) - ).flatMap((addressLoadable, index): IcaAccount | [] => - addressLoadable.valueMaybe() - ? { - type: AccountType.Ica, - chainId: icaChains[index], - address: addressLoadable.valueMaybe()!, - } - : [] - ) - : [] - - // Add ICA accounts. - allAccounts.push(...icas) - - return allAccounts }, }) @@ -166,6 +75,10 @@ export const allBalancesSelector = selectorFamily< >[] // Ignore staked and unstaking tokens. ignoreStaked?: boolean + // Include only these account types. + includeAccountTypes?: AccountType[] + // Exclude these account types. + excludeAccountTypes?: AccountType[] }> >({ key: 'allBalances', @@ -179,6 +92,8 @@ export const allBalancesSelector = selectorFamily< filter, additionalTokens, ignoreStaked, + includeAccountTypes, + excludeAccountTypes = [AccountType.Valence], }) => ({ get }) => { const allAccounts = get( @@ -187,7 +102,15 @@ export const allBalancesSelector = selectorFamily< address: mainAddress, includeIcaChains, }) - ) + ).filter(({ type }) => { + if (includeAccountTypes) { + return includeAccountTypes.includes(type) + } + if (excludeAccountTypes) { + return !excludeAccountTypes.includes(type) + } + return true + }) const accountBalances = get( waitForAll( diff --git a/packages/state/recoil/selectors/contract.ts b/packages/state/recoil/selectors/contract.ts index c575c687a..02a4999ea 100644 --- a/packages/state/recoil/selectors/contract.ts +++ b/packages/state/recoil/selectors/contract.ts @@ -271,3 +271,20 @@ export const isPolytoneProxySelector = selectorFamily< }) ), }) + +export const isValenceAccountSelector = selectorFamily< + boolean, + WithChainId<{ address: string }> +>({ + key: 'isValenceAccount', + get: + ({ address, chainId }) => + ({ get }) => + get( + isContractSelector({ + contractAddress: address, + chainId, + name: 'valence-account', + }) + ), +}) diff --git a/packages/stateful/actions/core/dao_appearance/ManageWidgets/Component.tsx b/packages/stateful/actions/core/dao_appearance/ManageWidgets/Component.tsx index bff806851..cfc78b31d 100644 --- a/packages/stateful/actions/core/dao_appearance/ManageWidgets/Component.tsx +++ b/packages/stateful/actions/core/dao_appearance/ManageWidgets/Component.tsx @@ -1,6 +1,6 @@ import { ArrowDropDown, VisibilityRounded } from '@mui/icons-material' import cloneDeep from 'lodash.clonedeep' -import { ComponentType, useCallback, useEffect, useRef } from 'react' +import { ComponentType, useCallback, useEffect } from 'react' import { useFormContext } from 'react-hook-form' import { useTranslation } from 'react-i18next' @@ -11,6 +11,7 @@ import { Loader, SegmentedControlsTitle, Tooltip, + useUpdatingRef, } from '@dao-dao/stateless' import { DaoWidget, SuspenseLoaderProps, Widget } from '@dao-dao/types' import { ActionComponent } from '@dao-dao/types/actions' @@ -47,8 +48,7 @@ export const ManageWidgetsComponent: ActionComponent = ( const widget = availableWidgets.find((widget) => widget.id === widgetId) // Memoize so the callbacks don't infinite loop. - const existingWidgetsRef = useRef(existingWidgets) - existingWidgetsRef.current = existingWidgets + const existingWidgetsRef = useUpdatingRef(existingWidgets) const selectWidget = useCallback( ({ id, defaultValues }: Widget) => { @@ -67,7 +67,7 @@ export const ManageWidgetsComponent: ActionComponent = ( // previous widget. clearErrors((fieldNamePrefix + 'values') as 'values') }, - [clearErrors, fieldNamePrefix, setValue] + [clearErrors, existingWidgetsRef, fieldNamePrefix, setValue] ) // When creating, if mode set to 'set', select the first available widget. If @@ -97,6 +97,7 @@ export const ManageWidgetsComponent: ActionComponent = ( availableWidgets, isCreating, widgetId, + existingWidgetsRef, ]) return ( diff --git a/packages/stateful/actions/core/index.ts b/packages/stateful/actions/core/index.ts index 282d6b910..62754a3ba 100644 --- a/packages/stateful/actions/core/index.ts +++ b/packages/stateful/actions/core/index.ts @@ -16,6 +16,7 @@ import { makeDaoGovernanceActionCategory } from './dao_governance' import { makeManageNftsActionCategory } from './nfts' import { makeSmartContractingActionCategory } from './smart_contracting' import { makeTreasuryActionCategory } from './treasury' +import { makeValenceActionCategory } from './valence' // Get all core action category makers. export const getCoreActionCategoryMakers = (): ActionCategoryMaker[] => [ @@ -27,6 +28,7 @@ export const getCoreActionCategoryMakers = (): ActionCategoryMaker[] => [ makeSmartContractingActionCategory, makeAuthorizationsActionCategory, makeChainGovernanceActionCategory, + makeValenceActionCategory, makeAdvancedActionCategory, // Add action category makers here to display them. ] diff --git a/packages/stateful/actions/core/smart_contracting/Execute/index.tsx b/packages/stateful/actions/core/smart_contracting/Execute/index.tsx index 2284eb6ef..851286dcf 100644 --- a/packages/stateful/actions/core/smart_contracting/Execute/index.tsx +++ b/packages/stateful/actions/core/smart_contracting/Execute/index.tsx @@ -119,13 +119,17 @@ const useTransformToCosmos: UseTransformToCosmos = () => { sender: getChainAddressForActionOptions(options, chainId) || '', contractAddress: address, msg, - funds: funds.map(({ denom, amount }, index) => ({ - denom, - amount: convertDenomToMicroDenomStringWithDecimals( - amount, - fundsTokens[index]!.decimals - ), - })), + funds: funds + .map(({ denom, amount }, index) => ({ + denom, + amount: convertDenomToMicroDenomStringWithDecimals( + amount, + fundsTokens[index]!.decimals + ), + })) + // Neutron errors with `invalid coins` if the funds list is not + // alphabetized. + .sort((a, b) => a.denom.localeCompare(b.denom)), }) } diff --git a/packages/stateful/actions/core/smart_contracting/Instantiate/index.tsx b/packages/stateful/actions/core/smart_contracting/Instantiate/index.tsx index 0b3ee8c3e..ed91f6a85 100644 --- a/packages/stateful/actions/core/smart_contracting/Instantiate/index.tsx +++ b/packages/stateful/actions/core/smart_contracting/Instantiate/index.tsx @@ -282,13 +282,17 @@ export const makeInstantiateAction: ActionMaker = ( ) } - const convertedFunds = funds.map(({ denom, amount }, index) => ({ - denom, - amount: convertDenomToMicroDenomStringWithDecimals( - amount, - fundsTokens[index]!.decimals - ), - })) + const convertedFunds = funds + .map(({ denom, amount }, index) => ({ + denom, + amount: convertDenomToMicroDenomStringWithDecimals( + amount, + fundsTokens[index]!.decimals + ), + })) + // Neutron errors with `invalid coins` if the funds list is not + // alphabetized. + .sort((a, b) => a.denom.localeCompare(b.denom)) return maybeMakePolytoneExecuteMessage( currentChainId, diff --git a/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx b/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx index 3940ecff1..1e2872ed6 100644 --- a/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx +++ b/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx @@ -192,13 +192,17 @@ export const makeInstantiate2Action: ActionMaker = ( codeId: codeId ? BigInt(codeId) : 0n, label, msg: toUtf8(JSON.stringify(msg)), - funds: funds.map(({ denom, amount }) => ({ - denom, - amount: convertDenomToMicroDenomStringWithDecimals( - amount, - getNativeTokenForChainId(chainId).decimals - ), - })), + funds: funds + .map(({ denom, amount }) => ({ + denom, + amount: convertDenomToMicroDenomStringWithDecimals( + amount, + getNativeTokenForChainId(chainId).decimals + ), + })) + // Neutron errors with `invalid coins` if the funds list is + // not alphabetized. + .sort((a, b) => a.denom.localeCompare(b.denom)), salt: toUtf8(salt), fixMsg: false, } as MsgInstantiateContract2, diff --git a/packages/stateful/actions/core/treasury/Spend/Component.tsx b/packages/stateful/actions/core/treasury/Spend/Component.tsx index 7dc8f819a..f1686f2ef 100644 --- a/packages/stateful/actions/core/treasury/Spend/Component.tsx +++ b/packages/stateful/actions/core/treasury/Spend/Component.tsx @@ -120,6 +120,8 @@ export interface SpendOptions { AddressInput: ComponentType< AddressInputProps & RefAttributes > + // Hide the destination chain/address picker. + noChangeDestination?: boolean } export const SpendComponent: ActionComponent = ({ @@ -137,6 +139,7 @@ export const SpendComponent: ActionComponent = ({ neutronTransferFee, proposalModuleMaxVotingPeriodInBlocks, AddressInput, + noChangeDestination, }, addAction, remove, @@ -419,27 +422,29 @@ export const SpendComponent: ActionComponent = ({ ref={toContainerRef} > {/* Cannot send over IBC from the gov module. */} - {isCreating && context.type !== ActionContextType.Gov && ( - { - // Type-check. None option is disabled so should not be - // possible. - if (!chainId) { - return - } + {isCreating && + context.type !== ActionContextType.Gov && + !noChangeDestination && ( + { + // Type-check. None option is disabled so should not be + // possible. + if (!chainId) { + return + } - setValue( - (fieldNamePrefix + 'toChainId') as 'toChainId', - chainId - ) - }} - selectedChainId={toChainId} - sourceChainId={spendChainId} - /> - )} + setValue( + (fieldNamePrefix + 'toChainId') as 'toChainId', + chainId + ) + }} + selectedChainId={toChainId} + sourceChainId={spendChainId} + /> + )} {/* Change search address and placeholder based on destination chain. */} @@ -449,7 +454,7 @@ export const SpendComponent: ActionComponent = ({ > = () => { } } -const Component: ActionComponent = (props) => { +export const StatefulSpendComponent: ComponentType< + ActionComponentProps & { + /** + * Disallow changing the destination chain and address. This is useful if + * the Spend component is being wrapped by another component. + */ + noChangeDestination?: boolean + /** + * Whether or not to restrict the token options to Valence accounts. + * Defaults to false. + */ + fromValence?: boolean + } +> = (props) => { const { context, address, @@ -196,6 +209,8 @@ const Component: ActionComponent = (props) => { denomOrAddress: denom, }, ], + includeAccountTypes: props.fromValence ? [AccountType.Valence] : undefined, + excludeAccountTypes: props.fromValence ? [] : undefined, }) // Should always be defined if in a DAO proposal. Even for a DAO, it may not @@ -559,255 +574,12 @@ const Component: ActionComponent = (props) => { !!proposalModuleMaxVotingPeriod && 'blocks' in proposalModuleMaxVotingPeriod, AddressInput, + noChangeDestination: props.noChangeDestination, }} /> ) } -const useTransformToCosmos: UseTransformToCosmos = () => { - const options = useActionOptions() - - const loadingTokenBalances = useTokenBalances() - - const neutronTransferFee = useCachedLoading( - neutronIbcTransferFeeSelector, - undefined - ) - - // Should always be defined if in a DAO proposal. Even for a DAO, it may not - // be defined if being authz executed or something similar. - const maxVotingPeriodSelector = - useProposalModuleAdapterCommonContextIfAvailable()?.common?.selectors - ?.maxVotingPeriod || - // If no selector, default to 0 time (likely in authz context). - constSelector({ time: 0 }) - const proposalModuleMaxVotingPeriod = useCachedLoadingWithError( - options.context.type === ActionContextType.Dao - ? maxVotingPeriodSelector - : options.context.type === ActionContextType.Wallet - ? // Wallets execute transactions right away, so there's no voting delay. - constSelector({ - time: 0, - }) - : options.context.type === ActionContextType.Gov - ? constSelector({ - // Seconds - time: options.context.params.votingPeriod - ? Number(options.context.params.votingPeriod.seconds) + - options.context.params.votingPeriod.nanos / 1e9 - : // If no voting period loaded, default to 30 days. - 30 * 24 * 60 * 60, - }) - : undefined - ) - - return useCallback( - ({ - fromChainId, - toChainId, - from, - to, - amount: _amount, - denom, - ibcTimeout, - useDirectIbcPath, - _skipIbcTransferMsg, - }: SpendData) => { - if (loadingTokenBalances.loading) { - return - } - - const { token, owner } = - loadingTokenBalances.data.find( - ({ owner, token }) => - owner.address === from && - token.chainId === fromChainId && - token.denomOrAddress === denom - ) || {} - if (!token || !owner) { - throw new Error(`Unknown token: ${denom}`) - } - - const amount = convertDenomToMicroDenomStringWithDecimals( - _amount, - token.decimals - ) - - // Gov module community pool spend. - if (options.context.type === ActionContextType.Gov) { - return makeStargateMessage({ - stargate: { - typeUrl: MsgCommunityPoolSpend.typeUrl, - value: { - authority: options.address, - recipient: to, - amount: coins(amount, denom), - } as MsgCommunityPoolSpend, - }, - }) - } - - let msg: UnifiedCosmosMsg | undefined - // IBC transfer. - if (token.type === TokenType.Native && toChainId !== fromChainId) { - // Require that this loads before using IBC. - if ( - proposalModuleMaxVotingPeriod.loading || - proposalModuleMaxVotingPeriod.errored - ) { - throw new Error('Failed to load proposal module max voting period') - } - - // Default to conservative 30 days if no IBC timeout is set for some - // reason. This should never happen. - const timeoutSeconds = ibcTimeout - ? convertDurationWithUnitsToSeconds(ibcTimeout) - : 30 * 24 * 60 * 60 - // Convert seconds to nanoseconds. - const timeoutTimestamp = BigInt( - Date.now() * 1e6 + - // Add timeout to voting period if it's a time duration. - ((!('time' in proposalModuleMaxVotingPeriod.data) - ? 0 - : proposalModuleMaxVotingPeriod.data.time) + - timeoutSeconds) * - 1e9 - ) - - // If no Skip IBC msg or it errored or disabled, use single-hop IBC - // transfer. - if ( - useDirectIbcPath || - !_skipIbcTransferMsg || - _skipIbcTransferMsg.loading || - _skipIbcTransferMsg.errored - ) { - const { sourceChannel } = getIbcTransferInfoBetweenChains( - fromChainId, - toChainId - ) - msg = makeStargateMessage({ - stargate: { - typeUrl: - fromChainId === ChainId.NeutronMainnet || - fromChainId === ChainId.NeutronTestnet - ? NeutronMsgTransfer.typeUrl - : MsgTransfer.typeUrl, - value: { - sourcePort: 'transfer', - sourceChannel, - token: coin(amount, denom), - sender: from, - receiver: to, - timeoutTimestamp, - memo: '', - // Add Neutron IBC transfer fee if sending from Neutron. - ...((fromChainId === ChainId.NeutronMainnet || - fromChainId === ChainId.NeutronTestnet) && { - fee: neutronTransferFee.loading - ? undefined - : neutronTransferFee.data?.fee, - }), - } as NeutronMsgTransfer, - }, - }) - } else { - if ( - _skipIbcTransferMsg.data.msg_type_url !== MsgTransfer.typeUrl && - _skipIbcTransferMsg.data.msg_type_url !== NeutronMsgTransfer.typeUrl - ) { - throw new Error( - `Unexpected Skip transfer message type: ${_skipIbcTransferMsg.data.msg_type_url}` - ) - } - - const skipTransferMsgValue = JSON.parse(_skipIbcTransferMsg.data.msg) - msg = makeStargateMessage({ - stargate: { - typeUrl: - fromChainId === ChainId.NeutronMainnet || - fromChainId === ChainId.NeutronTestnet - ? NeutronMsgTransfer.typeUrl - : MsgTransfer.typeUrl, - value: { - ...(fromChainId === ChainId.NeutronMainnet || - fromChainId === ChainId.NeutronTestnet - ? NeutronMsgTransfer - : MsgTransfer - ).fromAmino({ - ...skipTransferMsgValue, - // Replace all forwarding timeouts with our own. If no memo, - // use empty string. This will be undefined if PFM is not used - // and it's only a single hop. - memo: - (typeof skipTransferMsgValue.memo === 'string' && - skipTransferMsgValue.memo.replace( - /"timeout":\d+/g, - `"timeout":${timeoutTimestamp.toString()}` - )) || - '', - timeout_timestamp: timeoutTimestamp, - timeout_height: undefined, - }), - // Add Neutron IBC transfer fee if sending from Neutron. - ...((fromChainId === ChainId.NeutronMainnet || - fromChainId === ChainId.NeutronTestnet) && { - fee: neutronTransferFee.loading - ? undefined - : neutronTransferFee.data?.fee, - }), - }, - }, - }) - } - } else if (token.type === TokenType.Native) { - msg = { - bank: makeBankMessage(amount, to, denom), - } - } else if (token.type === TokenType.Cw20) { - msg = makeWasmMessage({ - wasm: { - execute: { - contract_addr: denom, - funds: [], - msg: { - transfer: { - recipient: to, - amount, - }, - }, - }, - }, - }) - } - - if (!msg) { - throw new Error(`Unknown token type: ${token.type}`) - } - - return owner.type === AccountType.Ica - ? maybeMakeIcaExecuteMessage( - options.chain.chain_id, - fromChainId, - options.address, - owner.address, - msg - ) - : maybeMakePolytoneExecuteMessage( - options.chain.chain_id, - fromChainId, - msg - ) - }, - [ - loadingTokenBalances, - options, - neutronTransferFee, - proposalModuleMaxVotingPeriod, - ] - ) -} - const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( msg: Record ) => { @@ -1002,15 +774,276 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( return { match: false } } -export const makeSpendAction: ActionMaker = ({ t, context }) => ({ - key: ActionKey.Spend, - Icon: MoneyEmoji, - label: t('title.spend'), - description: t('info.spendActionDescription', { - context: context.type, - }), - Component, - useDefaults, - useTransformToCosmos, - useDecodedCosmosMsg, -}) +export const makeSpendAction: ActionMaker< + SpendData, + { + /** + * Whether or not to restrict the token options to Valence accounts. + * Defaults to false. + */ + fromValence?: boolean + } +> = ({ t, context, fromValence }) => { + const useTransformToCosmos: UseTransformToCosmos = () => { + const options = useActionOptions() + + const loadingTokenBalances = useTokenBalances({ + includeAccountTypes: fromValence ? [AccountType.Valence] : undefined, + excludeAccountTypes: fromValence ? [] : undefined, + }) + + const neutronTransferFee = useCachedLoading( + neutronIbcTransferFeeSelector, + undefined + ) + + // Should always be defined if in a DAO proposal. Even for a DAO, it may not + // be defined if being authz executed or something similar. + const maxVotingPeriodSelector = + useProposalModuleAdapterCommonContextIfAvailable()?.common?.selectors + ?.maxVotingPeriod || + // If no selector, default to 0 time (likely in authz context). + constSelector({ time: 0 }) + const proposalModuleMaxVotingPeriod = useCachedLoadingWithError( + options.context.type === ActionContextType.Dao + ? maxVotingPeriodSelector + : options.context.type === ActionContextType.Wallet + ? // Wallets execute transactions right away, so there's no voting delay. + constSelector({ + time: 0, + }) + : options.context.type === ActionContextType.Gov + ? constSelector({ + // Seconds + time: options.context.params.votingPeriod + ? Number(options.context.params.votingPeriod.seconds) + + options.context.params.votingPeriod.nanos / 1e9 + : // If no voting period loaded, default to 30 days. + 30 * 24 * 60 * 60, + }) + : undefined + ) + + return useCallback( + ({ + fromChainId, + toChainId, + from, + to, + amount: _amount, + denom, + ibcTimeout, + useDirectIbcPath, + _skipIbcTransferMsg, + }: SpendData) => { + if (loadingTokenBalances.loading) { + return + } + + const { token, owner } = + loadingTokenBalances.data.find( + ({ owner, token }) => + owner.address === from && + token.chainId === fromChainId && + token.denomOrAddress === denom + ) || {} + if (!token || !owner) { + throw new Error(`Unknown token: ${denom}`) + } + + const amount = convertDenomToMicroDenomStringWithDecimals( + _amount, + token.decimals + ) + + // Gov module community pool spend. + if (options.context.type === ActionContextType.Gov) { + return makeStargateMessage({ + stargate: { + typeUrl: MsgCommunityPoolSpend.typeUrl, + value: { + authority: options.address, + recipient: to, + amount: coins(amount, denom), + } as MsgCommunityPoolSpend, + }, + }) + } + + let msg: UnifiedCosmosMsg | undefined + // IBC transfer. + if (token.type === TokenType.Native && toChainId !== fromChainId) { + // Require that this loads before using IBC. + if ( + proposalModuleMaxVotingPeriod.loading || + proposalModuleMaxVotingPeriod.errored + ) { + throw new Error('Failed to load proposal module max voting period') + } + + // Default to conservative 30 days if no IBC timeout is set for some + // reason. This should never happen. + const timeoutSeconds = ibcTimeout + ? convertDurationWithUnitsToSeconds(ibcTimeout) + : 30 * 24 * 60 * 60 + // Convert seconds to nanoseconds. + const timeoutTimestamp = BigInt( + Date.now() * 1e6 + + // Add timeout to voting period if it's a time duration. + ((!('time' in proposalModuleMaxVotingPeriod.data) + ? 0 + : proposalModuleMaxVotingPeriod.data.time) + + timeoutSeconds) * + 1e9 + ) + + // If no Skip IBC msg or it errored or disabled, use single-hop IBC + // transfer. + if ( + useDirectIbcPath || + !_skipIbcTransferMsg || + _skipIbcTransferMsg.loading || + _skipIbcTransferMsg.errored + ) { + const { sourceChannel } = getIbcTransferInfoBetweenChains( + fromChainId, + toChainId + ) + msg = makeStargateMessage({ + stargate: { + typeUrl: + fromChainId === ChainId.NeutronMainnet || + fromChainId === ChainId.NeutronTestnet + ? NeutronMsgTransfer.typeUrl + : MsgTransfer.typeUrl, + value: { + sourcePort: 'transfer', + sourceChannel, + token: coin(amount, denom), + sender: from, + receiver: to, + timeoutTimestamp, + memo: '', + // Add Neutron IBC transfer fee if sending from Neutron. + ...((fromChainId === ChainId.NeutronMainnet || + fromChainId === ChainId.NeutronTestnet) && { + fee: neutronTransferFee.loading + ? undefined + : neutronTransferFee.data?.fee, + }), + } as NeutronMsgTransfer, + }, + }) + } else { + if ( + _skipIbcTransferMsg.data.msg_type_url !== MsgTransfer.typeUrl && + _skipIbcTransferMsg.data.msg_type_url !== + NeutronMsgTransfer.typeUrl + ) { + throw new Error( + `Unexpected Skip transfer message type: ${_skipIbcTransferMsg.data.msg_type_url}` + ) + } + + const skipTransferMsgValue = JSON.parse( + _skipIbcTransferMsg.data.msg + ) + msg = makeStargateMessage({ + stargate: { + typeUrl: + fromChainId === ChainId.NeutronMainnet || + fromChainId === ChainId.NeutronTestnet + ? NeutronMsgTransfer.typeUrl + : MsgTransfer.typeUrl, + value: { + ...(fromChainId === ChainId.NeutronMainnet || + fromChainId === ChainId.NeutronTestnet + ? NeutronMsgTransfer + : MsgTransfer + ).fromAmino({ + ...skipTransferMsgValue, + // Replace all forwarding timeouts with our own. If no memo, + // use empty string. This will be undefined if PFM is not + // used and it's only a single hop. + memo: + (typeof skipTransferMsgValue.memo === 'string' && + skipTransferMsgValue.memo.replace( + /"timeout":\d+/g, + `"timeout":${timeoutTimestamp.toString()}` + )) || + '', + timeout_timestamp: timeoutTimestamp, + timeout_height: undefined, + }), + // Add Neutron IBC transfer fee if sending from Neutron. + ...((fromChainId === ChainId.NeutronMainnet || + fromChainId === ChainId.NeutronTestnet) && { + fee: neutronTransferFee.loading + ? undefined + : neutronTransferFee.data?.fee, + }), + }, + }, + }) + } + } else if (token.type === TokenType.Native) { + msg = { + bank: makeBankMessage(amount, to, denom), + } + } else if (token.type === TokenType.Cw20) { + msg = makeWasmMessage({ + wasm: { + execute: { + contract_addr: denom, + funds: [], + msg: { + transfer: { + recipient: to, + amount, + }, + }, + }, + }, + }) + } + + if (!msg) { + throw new Error(`Unknown token type: ${token.type}`) + } + + return owner.type === AccountType.Ica + ? maybeMakeIcaExecuteMessage( + options.chain.chain_id, + fromChainId, + options.address, + owner.address, + msg + ) + : maybeMakePolytoneExecuteMessage( + options.chain.chain_id, + fromChainId, + msg + ) + }, + [ + loadingTokenBalances, + options, + neutronTransferFee, + proposalModuleMaxVotingPeriod, + ] + ) + } + + return { + key: ActionKey.Spend, + Icon: MoneyEmoji, + label: t('title.spend'), + description: t('info.spendActionDescription', { + context: context.type, + }), + Component: StatefulSpendComponent, + useDefaults, + useTransformToCosmos, + useDecodedCosmosMsg, + } +} diff --git a/packages/stateful/actions/core/valence/ConfigureRebalancer/Component.stories.tsx b/packages/stateful/actions/core/valence/ConfigureRebalancer/Component.stories.tsx new file mode 100644 index 000000000..a2c2387dc --- /dev/null +++ b/packages/stateful/actions/core/valence/ConfigureRebalancer/Component.stories.tsx @@ -0,0 +1,218 @@ +import { ComponentMeta, ComponentStory } from '@storybook/react' + +import { AddressInput } from '@dao-dao/stateless' +import { + makeDaoInfo, + makeDaoProvidersDecorator, + makeReactHookFormDecorator, +} from '@dao-dao/storybook/decorators' +import { ChainId, TokenType } from '@dao-dao/types' +import { getNativeIbcUsdc, getNativeTokenForChainId } from '@dao-dao/utils' + +import { + ConfigureRebalancerComponent, + ConfigureRebalancerData, +} from './Component' + +export default { + title: + 'DAO DAO / packages / stateful / actions / core / valence / ConfigureRebalancer', + component: ConfigureRebalancerComponent, + decorators: [ + makeReactHookFormDecorator({ + chainId: ChainId.NeutronMainnet, + baseDenom: getNativeIbcUsdc(ChainId.NeutronMainnet)!.denomOrAddress, + tokens: [ + { + percent: 50, + denom: getNativeTokenForChainId(ChainId.NeutronMainnet) + .denomOrAddress, + }, + { + percent: 50, + denom: getNativeIbcUsdc(ChainId.NeutronMainnet)!.denomOrAddress, + }, + ], + pid: { + kp: 0.5, + ki: 0.2, + kd: 0.1, + }, + maxLimit: 500, + targetOverrideStrategy: 'proportional', + }), + makeDaoProvidersDecorator(makeDaoInfo()), + ], +} as ComponentMeta + +const Template: ComponentStory = ( + args +) => + +export const Default = Template.bind({}) +Default.args = { + fieldNamePrefix: '', + allActionsWithData: [], + index: 0, + options: { + nativeBalances: { + loading: false, + data: [ + { + token: getNativeTokenForChainId(ChainId.NeutronMainnet), + balance: '46252349169321', + }, + { + token: { + chainId: ChainId.NeutronMainnet, + type: TokenType.Native, + denomOrAddress: getNativeIbcUsdc(ChainId.NeutronMainnet)! + .denomOrAddress, + decimals: 6, + symbol: 'USDC', + imageUrl: '', + source: { + chainId: ChainId.NeutronMainnet, + type: TokenType.Native, + denomOrAddress: getNativeIbcUsdc(ChainId.NeutronMainnet)! + .denomOrAddress, + }, + }, + balance: '102948124125', + }, + { + token: { + chainId: ChainId.NeutronMainnet, + type: TokenType.Native, + denomOrAddress: 'uatom', + decimals: 6, + symbol: 'ATOM', + imageUrl: '', + source: { + chainId: ChainId.NeutronMainnet, + type: TokenType.Native, + denomOrAddress: 'uatom', + }, + }, + balance: '1284135723893', + }, + ], + }, + denomWhitelistTokens: { + loading: false, + data: [ + getNativeTokenForChainId(ChainId.NeutronMainnet), + { + chainId: ChainId.NeutronMainnet, + type: TokenType.Native, + denomOrAddress: getNativeIbcUsdc(ChainId.NeutronMainnet)! + .denomOrAddress, + decimals: 6, + symbol: 'USDC', + imageUrl: '', + source: { + chainId: ChainId.NeutronMainnet, + type: TokenType.Native, + denomOrAddress: getNativeIbcUsdc(ChainId.NeutronMainnet)! + .denomOrAddress, + }, + }, + { + chainId: ChainId.NeutronMainnet, + type: TokenType.Native, + denomOrAddress: 'uatom', + decimals: 6, + symbol: 'ATOM', + imageUrl: '', + source: { + chainId: ChainId.NeutronMainnet, + type: TokenType.Native, + denomOrAddress: 'uatom', + }, + }, + ], + }, + baseDenomWhitelistTokens: { + loading: false, + data: [ + getNativeTokenForChainId(ChainId.NeutronMainnet), + { + chainId: ChainId.NeutronMainnet, + type: TokenType.Native, + denomOrAddress: getNativeIbcUsdc(ChainId.NeutronMainnet)! + .denomOrAddress, + decimals: 6, + symbol: 'USDC', + imageUrl: '', + source: { + chainId: ChainId.NeutronMainnet, + type: TokenType.Native, + denomOrAddress: getNativeIbcUsdc(ChainId.NeutronMainnet)! + .denomOrAddress, + }, + }, + { + chainId: ChainId.NeutronMainnet, + type: TokenType.Native, + denomOrAddress: 'uatom', + decimals: 6, + symbol: 'ATOM', + imageUrl: '', + source: { + chainId: ChainId.NeutronMainnet, + type: TokenType.Native, + denomOrAddress: 'uatom', + }, + }, + ], + }, + prices: { + loading: false, + errored: false, + data: [ + { + token: getNativeTokenForChainId(ChainId.NeutronMainnet), + usdPrice: 1.5, + }, + { + token: { + chainId: ChainId.NeutronMainnet, + type: TokenType.Native, + denomOrAddress: getNativeIbcUsdc(ChainId.NeutronMainnet)! + .denomOrAddress, + decimals: 6, + symbol: 'USDC', + imageUrl: '', + source: { + chainId: ChainId.NeutronMainnet, + type: TokenType.Native, + denomOrAddress: getNativeIbcUsdc(ChainId.NeutronMainnet)! + .denomOrAddress, + }, + }, + usdPrice: 1, + }, + { + token: { + chainId: ChainId.NeutronMainnet, + type: TokenType.Native, + denomOrAddress: 'uatom', + decimals: 6, + symbol: 'ATOM', + imageUrl: '', + source: { + chainId: ChainId.NeutronMainnet, + type: TokenType.Native, + denomOrAddress: 'uatom', + }, + }, + usdPrice: 12, + }, + ], + }, + minBalanceToken: undefined, + AddressInput, + }, + isCreating: true, + errors: {}, +} diff --git a/packages/stateful/actions/core/valence/ConfigureRebalancer/Component.tsx b/packages/stateful/actions/core/valence/ConfigureRebalancer/Component.tsx new file mode 100644 index 000000000..c9bd01f62 --- /dev/null +++ b/packages/stateful/actions/core/valence/ConfigureRebalancer/Component.tsx @@ -0,0 +1,660 @@ +import { Close, InfoOutlined } from '@mui/icons-material' +import { ComponentType, useEffect, useState } from 'react' +import { useFieldArray, useFormContext } from 'react-hook-form' +import { useTranslation } from 'react-i18next' + +import { + Button, + ErrorPage, + IconButton, + InputErrorMessage, + InputLabel, + Loader, + MarkdownRenderer, + NumberInput, + RebalancerProjector, + RebalancerProjectorAsset, + SegmentedControls, + SelectInput, + SwitchCard, + TokenInput, + Tooltip, + useSupportedChainContext, +} from '@dao-dao/stateless' +import { + AddressInputProps, + GenericToken, + GenericTokenBalance, + GenericTokenWithUsdPrice, + LoadingData, + LoadingDataWithError, + ValenceAccount, +} from '@dao-dao/types' +import { ActionComponent } from '@dao-dao/types/actions' +import { TargetOverrideStrategy } from '@dao-dao/types/contracts/ValenceRebalancer' +import { + convertMicroDenomToDenomWithDecimals, + formatPercentOf100, + makeValidateAddress, + validatePositive, + validateRequired, +} from '@dao-dao/utils' + +export type PidPreset = 'slow' | 'medium' | 'fast' +export const pidPresets: { + preset: PidPreset + kp: number + ki: number + kd: number +}[] = [ + { + preset: 'slow', + kp: 0.05, + ki: 0, + kd: 0, + }, + { + preset: 'medium', + kp: 0.1, + ki: 0, + kd: 0, + }, + { + preset: 'fast', + kp: 0.2, + ki: 0, + kd: 0, + }, +] + +export type ConfigureRebalancerData = { + // Will be set when a valence account is found so the transformation function + // has the address. + valenceAccount?: ValenceAccount + chainId: string + trustee?: string + baseDenom: string + tokens: { + denom: string + percent: number + }[] + pid: { + kp: number + ki: number + kd: number + } + /** + * Set to true if the advanced field is chosen in the PID preset dropdown. + */ + showCustomPid?: boolean + maxLimit?: number + minBalance?: { + denom: string + amount: number + } + targetOverrideStrategy: TargetOverrideStrategy +} + +export type ConfigureRebalancerOptions = { + nativeBalances: LoadingData + baseDenomWhitelistTokens: LoadingData + denomWhitelistTokens: LoadingData + prices: LoadingDataWithError + minBalanceToken: GenericToken | undefined + AddressInput: ComponentType> +} + +export const ConfigureRebalancerComponent: ActionComponent< + ConfigureRebalancerOptions +> = ({ + fieldNamePrefix, + errors, + isCreating, + options: { + nativeBalances, + baseDenomWhitelistTokens, + denomWhitelistTokens, + prices, + minBalanceToken, + AddressInput, + }, +}) => { + const { t } = useTranslation() + const { + chain: { bech32_prefix: bech32Prefix }, + } = useSupportedChainContext() + + const { control, watch, register, setValue, clearErrors, setError } = + useFormContext() + const { + fields: tokensFields, + append: appendToken, + remove: removeToken, + } = useFieldArray({ + control, + name: (fieldNamePrefix + 'tokens') as 'tokens', + }) + + const baseDenom = watch((fieldNamePrefix + 'baseDenom') as 'baseDenom') + const targetOverrideStrategy = watch( + (fieldNamePrefix + 'targetOverrideStrategy') as 'targetOverrideStrategy' + ) + const pid = watch((fieldNamePrefix + 'pid') as 'pid') + const tokens = watch((fieldNamePrefix + 'tokens') as 'tokens', []) + const totalPercent = tokens.reduce((acc, { percent }) => acc + percent, 0) + const showCustomPid = watch( + (fieldNamePrefix + 'showCustomPid') as 'showCustomPid' + ) + + // Get selected whitelist tokens. + const denomWhitelistTokensSelected = denomWhitelistTokens.loading + ? [] + : denomWhitelistTokens.data.filter((token) => + tokens.some(({ denom }) => token.denomOrAddress === denom) + ) + const denomWhitelistTokensRemaining = denomWhitelistTokens.loading + ? [] + : denomWhitelistTokens.data.filter( + (token) => !tokens.some(({ denom }) => token.denomOrAddress === denom) + ) + + const maxLimit = watch((fieldNamePrefix + 'maxLimit') as 'maxLimit') + const maxLimitEnabled = maxLimit !== undefined + + const minBalance = watch((fieldNamePrefix + 'minBalance') as 'minBalance') + const minBalanceEnabled = minBalance !== undefined + + // Validate all add up to 100%. + useEffect(() => { + if (totalPercent === 100) { + clearErrors((fieldNamePrefix + 'tokens') as 'tokens') + } else { + setError((fieldNamePrefix + 'tokens') as 'tokens', { + type: 'manual', + message: t('error.percentageDoesNotSumTo100', { + totalPercent: formatPercentOf100(totalPercent), + }), + }) + } + }, [t, clearErrors, setError, totalPercent, fieldNamePrefix]) + + const [projection, setProjection] = useState(isCreating) + + // Once per day for the next 180 days. + const rebalanceTimestamps = new Array(180) + .fill(0) + .map((_, i) => new Date(Date.now() + (i + 1) * 24 * 60 * 60 * 1000)) + + const selectedPidPreset = pidPresets.find( + (preset) => + preset.kp === pid.kp && preset.ki === pid.ki && preset.kd === pid.kd + )?.preset + + return ( + <> +
+
+ +

+ {t('form.rebalancerBaseTokenDescription')} +

+ + + setValue( + (fieldNamePrefix + 'baseDenom') as 'baseDenom', + denomOrAddress + ) + } + readOnly={!isCreating} + selectedToken={ + baseDenomWhitelistTokens.loading + ? undefined + : baseDenomWhitelistTokens.data.find( + ({ denomOrAddress }) => denomOrAddress === baseDenom + ) + } + tokens={baseDenomWhitelistTokens} + /> +
+ +
+ +

+ {t('form.rebalancerTrusteeDescription')} +

+ + +
+ +
+ + + {tokensFields.map(({ id }, index) => ( +
+
+ + // Still show this selected token. + selected.denomOrAddress !== tokens[index]?.denom + )} + onSelectToken={({ denomOrAddress }) => + setValue( + (fieldNamePrefix + + `tokens.${index}.denom`) as `tokens.${number}.denom`, + denomOrAddress + ) + } + readOnly={!isCreating} + selectedToken={ + denomWhitelistTokens.loading + ? undefined + : denomWhitelistTokens.data.find( + ({ denomOrAddress }) => + denomOrAddress === tokens[index]?.denom + ) + } + tokens={denomWhitelistTokens} + /> + + {isCreating && ( + removeToken(index)} + size="sm" + variant="ghost" + /> + )} +
+ + +
+ ))} + + + + {isCreating ? ( + + + + ) : ( + tokensFields.length === 0 && ( +

+ {t('info.none')} +

+ ) + )} +
+ +
+ + + + + disabled={!isCreating} + onSelect={(value) => + setValue( + (fieldNamePrefix + + 'targetOverrideStrategy') as 'targetOverrideStrategy', + value + ) + } + selected={targetOverrideStrategy} + tabs={[ + { + label: t('form.proportional'), + value: 'proportional', + }, + { + label: t('form.priority'), + value: 'priority', + }, + ]} + /> +
+ +
+
+ + + + setValue( + (fieldNamePrefix + 'minBalance') as 'minBalance', + minBalanceEnabled + ? undefined + : { + denom: tokens[0]?.denom ?? '', + amount: 1, + } + ) + } + readOnly={!isCreating} + sizing="sm" + /> +
+ +

+ {t('form.rebalancerMinBalanceDescription')} +

+ + {minBalanceEnabled && ( + + setValue( + (fieldNamePrefix + 'minBalance.denom') as 'minBalance.denom', + denomOrAddress + ) + } + readOnly={!isCreating} + selectedToken={ + minBalance && + denomWhitelistTokensSelected.find( + ({ denomOrAddress }) => denomOrAddress === minBalance.denom + ) + } + tokens={ + denomWhitelistTokens.loading + ? { loading: true } + : { + loading: false, + data: denomWhitelistTokensSelected, + } + } + /> + )} +
+ +
+
+ + + + setValue( + (fieldNamePrefix + 'maxLimit') as 'maxLimit', + maxLimitEnabled ? undefined : 5 + ) + } + readOnly={!isCreating} + sizing="sm" + /> +
+ +

+ {t('form.maximumSellablePerCycleDescription')} +

+ + {maxLimitEnabled && ( +
+ +
+ )} +
+ +
+ + + + + { + const pid = pidPresets.find((p) => p.preset === preset) + if (pid) { + setValue((fieldNamePrefix + 'pid.kp') as 'pid.kp', pid.kp) + setValue((fieldNamePrefix + 'pid.ki') as 'pid.ki', pid.ki) + setValue((fieldNamePrefix + 'pid.kd') as 'pid.kd', pid.kd) + } + // Show custom fields if selected advanced. + setValue( + (fieldNamePrefix + 'showCustomPid') as 'showCustomPid', + !pid + ) + }} + > + + + + + +
+ + {/* Custom PID */} + {showCustomPid && ( + <> +

+ {t('form.rebalancerSpeedAdvancedDescription')} +

+ +
+
+ {/* eslint-disable-next-line i18next/no-literal-string */} + + + +
+ +
+ {/* eslint-disable-next-line i18next/no-literal-string */} + + + +
+ +
+ {/* eslint-disable-next-line i18next/no-literal-string */} + + + +
+
+ + )} +
+ +
+ + setProjection((p) => !p)} + sizing="sm" + /> + + {projection && ( + <> +
+ +

+ {t('info.rebalancerProjectionExplanation')} +

+
+ + {nativeBalances.loading || + prices.loading || + denomWhitelistTokens.loading ? ( + + ) : prices.errored ? ( + + ) : ( + { + const token = denomWhitelistTokens.data.find( + ({ denomOrAddress }) => denomOrAddress === denom + ) + const { balance: _balance } = + nativeBalances.data.find( + ({ token }) => token.denomOrAddress === denom + ) ?? {} + const balance = Number(_balance) || 0 + const price = prices.data.find( + ({ token: { denomOrAddress: priceDenom } }) => + priceDenom === denom + )?.usdPrice + + if (!token || price === undefined) { + return [] + } + + return { + symbol: token.symbol, + initialAmount: convertMicroDenomToDenomWithDecimals( + balance, + token.decimals + ), + targetProportion: percent / 100, + // Add an extra price to account for the initial balance. + prices: new Array(rebalanceTimestamps.length + 1) + .fill(0) + .map(() => price), + } + } + )} + className="!h-72" + pid={{ + ...pid, + interval: 1, + }} + rebalanceTimestamps={rebalanceTimestamps} + /> + )} + + )} + + ) +} diff --git a/packages/stateful/actions/core/valence/ConfigureRebalancer/README.md b/packages/stateful/actions/core/valence/ConfigureRebalancer/README.md new file mode 100644 index 000000000..55ddb1d2e --- /dev/null +++ b/packages/stateful/actions/core/valence/ConfigureRebalancer/README.md @@ -0,0 +1,24 @@ +# ConfigureRebalancer + +Configure the rebalancer. + +## Bulk import format + +This is relevant when bulk importing actions, as described in [this +guide](https://github.com/DA0-DA0/dao-dao-ui/wiki/Bulk-importing-actions). + +### Key + +`configureRebalancer` + +### Data format + +```json +{ + "chainId": "", + ... +} +``` + +If used in a DAO, `chainId` determines which account the rebalancer is operating +on, which can be the native chain or any supported Polytone chain. diff --git a/packages/stateful/actions/core/valence/ConfigureRebalancer/index.tsx b/packages/stateful/actions/core/valence/ConfigureRebalancer/index.tsx new file mode 100644 index 000000000..db77b7652 --- /dev/null +++ b/packages/stateful/actions/core/valence/ConfigureRebalancer/index.tsx @@ -0,0 +1,679 @@ +import { fromBase64, fromUtf8 } from '@cosmjs/encoding' +import { useQueries, useQueryClient } from '@tanstack/react-query' +import cloneDeep from 'lodash.clonedeep' +import { useCallback, useEffect } from 'react' +import { useFormContext } from 'react-hook-form' +import { waitForAll } from 'recoil' + +import { + genericTokenSelector, + tokenQueries, + valenceRebalancerExtraQueries, +} from '@dao-dao/state' +import { usdPriceSelector } from '@dao-dao/state/recoil/selectors' +import { + BalanceEmoji, + ChainProvider, + DaoSupportedChainPickerInput, + useCachedLoading, + useCachedLoadingWithError, + useUpdatingRef, +} from '@dao-dao/stateless' +import { + AccountType, + GenericTokenBalance, + LoadingData, + TokenType, + UseDecodedCosmosMsg, + ValenceAccount, +} from '@dao-dao/types' +import { + ActionChainContextType, + ActionComponent, + ActionContextType, + ActionKey, + ActionMaker, + UseDefaults, + UseTransformToCosmos, +} from '@dao-dao/types/actions' +import { ExecuteMsg as ValenceAccountExecuteMsg } from '@dao-dao/types/contracts/ValenceAccount' +import { + RebalancerData, + RebalancerUpdateData, +} from '@dao-dao/types/contracts/ValenceRebalancer' +import { + VALENCE_INSTANTIATE2_SALT, + VALENCE_SUPPORTED_CHAINS, + convertDenomToMicroDenomStringWithDecimals, + convertMicroDenomToDenomWithDecimals, + decodePolytoneExecuteMsg, + encodeJsonToBase64, + getAccount, + getChainAddressForActionOptions, + makeCombineQueryResultsIntoLoadingData, + makeWasmMessage, + maybeMakePolytoneExecuteMessage, + mustGetSupportedChainConfig, + objectMatchesStructure, +} from '@dao-dao/utils' + +import { AddressInput } from '../../../../components/AddressInput' +import { + useGenerateInstantiate2, + useQueryLoadingDataWithError, +} from '../../../../hooks' +import { useTokenBalances } from '../../../hooks/useTokenBalances' +import { useActionForKey, useActionOptions } from '../../../react' +import { CreateValenceAccountData } from '../CreateValenceAccount/Component' +import { + ConfigureRebalancerData, + ConfigureRebalancerComponent as StatelessConfigureRebalancerComponent, + pidPresets, +} from './Component' + +const Component: ActionComponent = ( + props +) => { + const queryClient = useQueryClient() + const options = useActionOptions() + const { watch, setValue } = useFormContext() + const valenceAccount = watch( + (props.fieldNamePrefix + 'valenceAccount') as 'valenceAccount' + ) + const chainId = watch((props.fieldNamePrefix + 'chainId') as 'chainId') + const selectedTokens = watch((props.fieldNamePrefix + 'tokens') as 'tokens') + + // Get predictable valence account address in case we have to create it. + const generatedValenceAddress = useGenerateInstantiate2({ + chainId, + creator: getChainAddressForActionOptions(options, chainId) || '', + codeId: + (options.chainContext.type === ActionChainContextType.Supported && + options.chainContext.config.codeIds.ValenceAccount) || + -1, + salt: VALENCE_INSTANTIATE2_SALT, + }) + + const existingValenceAccount = getAccount({ + accounts: options.context.accounts, + chainId, + types: [AccountType.Valence], + }) + + // Check if create valence account action already exists. + const existingCreateValenceAccountActionIndex = + props.allActionsWithData.findIndex( + ({ actionKey }) => actionKey === ActionKey.CreateValenceAccount + ) + // Get the data from the Valence creation action if it exists. + const existingCreateValenceAccountActionData = + existingCreateValenceAccountActionIndex > -1 + ? (props.allActionsWithData[existingCreateValenceAccountActionIndex] + ?.data as CreateValenceAccountData) + : undefined + const createValenceAccountActionDefaults = useActionForKey( + ActionKey.CreateValenceAccount + )?.useDefaults() + // Can add create valence account if no existing action and defaults loaded. + const canAddCreateValenceAccountAction = + !existingValenceAccount && + (existingCreateValenceAccountActionIndex === -1 || + existingCreateValenceAccountActionIndex > props.index) && + createValenceAccountActionDefaults + const addCreateValenceAccountActionIfNeededRef = useUpdatingRef(() => { + if (canAddCreateValenceAccountAction) { + props.addAction?.( + { + actionKey: ActionKey.CreateValenceAccount, + data: cloneDeep(createValenceAccountActionDefaults), + }, + props.index + ) + } + }) + + // Set valence account if not set, or add action to create if not found before + // this configure action. + useEffect(() => { + if (!valenceAccount) { + // If existing account found, set it. + if (existingValenceAccount?.type === AccountType.Valence) { + setValue( + (props.fieldNamePrefix + 'valenceAccount') as 'valenceAccount', + existingValenceAccount + ) + } + // Otherwise attempt to use generated one. + else if ( + !generatedValenceAddress.loading && + !generatedValenceAddress.errored + ) { + setValue( + (props.fieldNamePrefix + 'valenceAccount') as 'valenceAccount', + { + type: AccountType.Valence, + chainId, + address: generatedValenceAddress.data, + config: { + rebalancer: null, + }, + } + ) + } + } + + // Attempt to add create valence account action if needed. + if (canAddCreateValenceAccountAction) { + addCreateValenceAccountActionIfNeededRef.current() + } + }, [ + setValue, + valenceAccount, + props.fieldNamePrefix, + existingValenceAccount, + canAddCreateValenceAccountAction, + addCreateValenceAccountActionIfNeededRef, + generatedValenceAddress, + chainId, + ]) + + const rebalancer = mustGetSupportedChainConfig(chainId).valence?.rebalancer + const whitelists = useQueryLoadingDataWithError( + valenceRebalancerExtraQueries.whitelistGenericTokens( + queryClient, + rebalancer + ? { + chainId, + address: rebalancer, + } + : undefined + ) + ) + + const minBalanceDenom = watch( + (props.fieldNamePrefix + 'minBalance.denom') as 'minBalance.denom' + ) + const minBalanceToken = useCachedLoading( + minBalanceDenom + ? genericTokenSelector({ + chainId, + type: TokenType.Native, + denomOrAddress: minBalanceDenom, + }) + : undefined, + undefined + ) + + const currentBalances = useTokenBalances({ + filter: TokenType.Native, + // Ensure chosen tokens are loaded. + additionalTokens: selectedTokens.map(({ denom }) => ({ + chainId, + type: TokenType.Native, + denomOrAddress: denom, + })), + // Only fetch balances for Valence account. + includeAccountTypes: [AccountType.Valence], + }) + + // Load tokens used in the create valence account action if it exists. + const initialTokens = useQueries({ + queries: + existingCreateValenceAccountActionData?.funds.map(({ denom }) => + tokenQueries.info(queryClient, { + chainId, + type: TokenType.Native, + denomOrAddress: denom, + }) + ) ?? [], + combine: makeCombineQueryResultsIntoLoadingData({ + transform: (tokens) => + tokens.map( + (token): GenericTokenBalance => ({ + token, + balance: convertDenomToMicroDenomStringWithDecimals( + existingCreateValenceAccountActionData?.funds + .find(({ denom }) => denom === token.denomOrAddress) + ?.amount?.toString() || 0, + token.decimals + ), + }) + ), + }), + }) + + const nativeBalances: LoadingData = + // If creating new Valence account, use initial tokens from that action, + // since there will be no current balances loaded yet. + existingCreateValenceAccountActionData + ? initialTokens + : currentBalances.loading + ? currentBalances + : { + loading: false, + updating: currentBalances.updating, + data: currentBalances.data.filter( + ({ token }) => token.chainId === chainId + ), + } + + const prices = useCachedLoadingWithError( + whitelists.loading || whitelists.errored + ? undefined + : waitForAll( + whitelists.data.denoms.map(({ chainId, type, denomOrAddress }) => + usdPriceSelector({ + chainId, + type, + denomOrAddress, + }) + ) + ), + (data) => data.flatMap((data) => data || []) + ) + + return ( + <> + {options.context.type === ActionContextType.Dao && + VALENCE_SUPPORTED_CHAINS.length > 1 && ( + + )} + + + + + + ) +} + +const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( + msg: Record +) => { + const queryClient = useQueryClient() + let chainId = useActionOptions().chain.chain_id + const decodedPolytone = decodePolytoneExecuteMsg(chainId, msg) + if (decodedPolytone.match) { + chainId = decodedPolytone.chainId + msg = decodedPolytone.msg + } + + let serviceName: string | undefined + let data: RebalancerData | RebalancerUpdateData | undefined + if ( + objectMatchesStructure(msg, { + wasm: { + execute: { + contract_addr: {}, + funds: {}, + msg: {}, + }, + }, + }) + ) { + const serviceData = + 'register_to_service' in msg.wasm.execute.msg + ? msg.wasm.execute.msg.register_to_service + : 'update_service' in msg.wasm.execute.msg + ? msg.wasm.execute.msg.update_service + : undefined + if ( + objectMatchesStructure(serviceData, { + service_name: {}, + data: {}, + }) + ) { + serviceName = serviceData.service_name as string + data = JSON.parse(fromUtf8(fromBase64(serviceData.data as string))) + } + } + + // Get target with min balance set. + const minBalanceTarget = data?.targets.find(({ min_balance }) => min_balance) + const minBalanceToken = useCachedLoading( + minBalanceTarget?.denom + ? genericTokenSelector({ + chainId, + type: TokenType.Native, + denomOrAddress: minBalanceTarget.denom, + }) + : undefined, + undefined + ) + + const rebalancer = mustGetSupportedChainConfig(chainId).valence?.rebalancer + const whitelists = useQueryLoadingDataWithError( + valenceRebalancerExtraQueries.whitelistGenericTokens( + queryClient, + rebalancer + ? { + chainId, + address: rebalancer, + } + : undefined + ) + ) + + if ( + serviceName !== 'rebalancer' || + !data || + !objectMatchesStructure(data, { + base_denom: {}, + targets: {}, + pid: {}, + target_override_strategy: {}, + }) || + whitelists.loading || + whitelists.errored + ) { + return { + match: false, + } + } + + const kp = Number(data.pid?.p || -1) + const ki = Number(data.pid?.i || -1) + const kd = Number(data.pid?.d || -1) + + // Show custom PID fields if no preset found for these settings. + const showCustomPid = !pidPresets.some( + (preset) => preset.kp === kp && preset.ki === ki && preset.kd === kd + ) + + return { + match: true, + data: { + chainId, + trustee: + typeof data.trustee === 'string' + ? 'update_service' in msg.wasm.execute.msg && data.trustee === 'clear' + ? undefined + : data.trustee + : 'update_service' in msg.wasm.execute.msg && + typeof data.trustee === 'object' && + data.trustee && + 'set' in data.trustee + ? data.trustee.set + : undefined, + baseDenom: + data.base_denom || whitelists.data.baseDenoms[0].denomOrAddress, + tokens: data.targets.map(({ denom, bps }) => ({ + denom, + percent: bps / 100, + })), + pid: { + kp, + ki, + kd, + }, + showCustomPid, + maxLimit: + typeof data.max_limit_bps === 'number' + ? data.max_limit_bps / 100 + : undefined, + minBalance: + minBalanceTarget?.min_balance && !minBalanceToken.loading + ? { + denom: minBalanceTarget.denom, + amount: convertMicroDenomToDenomWithDecimals( + minBalanceTarget.min_balance, + minBalanceToken.data?.decimals ?? 0 + ), + } + : undefined, + targetOverrideStrategy: data.target_override_strategy || 'proportional', + }, + } +} + +export const makeConfigureRebalancerAction: ActionMaker< + ConfigureRebalancerData +> = (options) => { + const { + t, + chain: { chain_id: srcChainId }, + context, + } = options + + const valenceAccount = getAccount({ + accounts: context.accounts, + types: [AccountType.Valence], + }) as ValenceAccount | undefined + const chainId = valenceAccount?.chainId || VALENCE_SUPPORTED_CHAINS[0] + const rebalancer = mustGetSupportedChainConfig(chainId).valence?.rebalancer + + const useDefaults: UseDefaults = () => { + const queryClient = useQueryClient() + const whitelists = useQueryLoadingDataWithError( + valenceRebalancerExtraQueries.whitelistGenericTokens( + queryClient, + rebalancer + ? { + chainId, + address: rebalancer, + } + : undefined + ) + ) + + const rebalancerConfig = valenceAccount?.config?.rebalancer?.config + const minBalanceTarget = rebalancerConfig?.targets.find( + ({ min_balance }) => min_balance + ) + const minBalanceToken = useCachedLoading( + minBalanceTarget?.denom + ? genericTokenSelector({ + chainId, + type: TokenType.Native, + denomOrAddress: minBalanceTarget.denom, + }) + : undefined, + undefined + ) + + if (whitelists.loading) { + return + } else if (whitelists.errored) { + return whitelists.error + } + + const defaultPid: ConfigureRebalancerData['pid'] = rebalancerConfig + ? { + kp: Number(rebalancerConfig.pid.p), + ki: Number(rebalancerConfig.pid.i), + kd: Number(rebalancerConfig.pid.d), + } + : { + ...pidPresets.find((p) => p.preset === 'medium')!, + } + const showCustomPid = !pidPresets.some( + (preset) => + preset.kp === defaultPid.kp && + preset.ki === defaultPid.ki && + preset.kd === defaultPid.kd + ) + + return { + // If no valence account found, the action will detect this and add the + // create account action automatically. + valenceAccount, + chainId, + trustee: rebalancerConfig?.trustee || undefined, + baseDenom: + rebalancerConfig?.base_denom || + whitelists.data.baseDenoms[0].denomOrAddress, + tokens: rebalancerConfig?.targets.map(({ denom, percentage }) => ({ + denom, + percent: Number(percentage) * 100, + })) || [ + { + denom: whitelists.data.baseDenoms[0].denomOrAddress, + percent: 50, + }, + { + denom: whitelists.data.baseDenoms[1].denomOrAddress, + percent: 50, + }, + ], + pid: defaultPid, + showCustomPid, + maxLimitBps: + rebalancerConfig?.max_limit && + !isNaN(Number(rebalancerConfig.max_limit)) + ? Number(rebalancerConfig.max_limit) + : 500, + minBalance: + minBalanceTarget?.min_balance && !minBalanceToken.loading + ? { + denom: minBalanceTarget.denom, + amount: convertMicroDenomToDenomWithDecimals( + minBalanceTarget.min_balance, + minBalanceToken.data?.decimals ?? 0 + ), + } + : undefined, + targetOverrideStrategy: + rebalancerConfig?.target_override_strategy || 'proportional', + } + } + + const useTransformToCosmos: UseTransformToCosmos< + ConfigureRebalancerData + > = () => { + const queryClient = useQueryClient() + const whitelists = useQueryLoadingDataWithError( + valenceRebalancerExtraQueries.whitelistGenericTokens( + queryClient, + rebalancer + ? { + chainId, + address: rebalancer, + } + : undefined + ) + ) + + return useCallback( + ({ + valenceAccount, + chainId, + trustee, + baseDenom, + tokens, + pid, + maxLimit, + minBalance, + targetOverrideStrategy, + }: ConfigureRebalancerData) => { + if (whitelists.loading) { + return + } else if (whitelists.errored) { + throw whitelists.error + } + + if (!valenceAccount) { + throw new Error('Missing valence account.') + } + + return maybeMakePolytoneExecuteMessage( + srcChainId, + chainId, + makeWasmMessage({ + wasm: { + execute: { + contract_addr: valenceAccount.address, + funds: [], + msg: { + // If rebalancer already exists, update it. Otherwise, + // register it. + [valenceAccount.config.rebalancer + ? 'update_service' + : 'register_to_service']: { + service_name: 'rebalancer', + data: encodeJsonToBase64({ + // Common options. + ...({ + base_denom: baseDenom, + // BPS + max_limit_bps: maxLimit && maxLimit * 100, + pid: { + p: pid.kp.toString(), + i: pid.ki.toString(), + d: pid.kd.toString(), + }, + target_override_strategy: targetOverrideStrategy, + targets: tokens.map(({ denom, percent }) => ({ + denom, + min_balance: + minBalance && minBalance.denom === denom + ? convertDenomToMicroDenomStringWithDecimals( + minBalance.amount, + // Should always find this. + whitelists.data.denoms.find( + (d) => d.denomOrAddress === denom + )?.decimals ?? 0 + ) + : undefined, + // BPS + bps: percent * 100, + })), + } as Pick< + RebalancerData, + keyof RebalancerData & keyof RebalancerUpdateData + >), + // Differences between data and update. + ...(valenceAccount.config.rebalancer + ? ({ + trustee: trustee ? { set: trustee } : 'clear', + } as Partial) + : ({ + trustee: trustee || null, + } as Partial)), + }), + }, + } as ValenceAccountExecuteMsg, + }, + }, + }) + ) + }, + [whitelists] + ) + } + + return { + key: ActionKey.ConfigureRebalancer, + Icon: BalanceEmoji, + label: t('title.configureRebalancer'), + description: t('info.configureRebalancerDescription', { + context: context.type, + }), + notReusable: true, + Component, + useDefaults, + useTransformToCosmos, + useDecodedCosmosMsg, + } +} diff --git a/packages/stateful/actions/core/valence/CreateValenceAccount/Component.tsx b/packages/stateful/actions/core/valence/CreateValenceAccount/Component.tsx new file mode 100644 index 000000000..ae2a430d4 --- /dev/null +++ b/packages/stateful/actions/core/valence/CreateValenceAccount/Component.tsx @@ -0,0 +1,108 @@ +import { useFieldArray, useFormContext } from 'react-hook-form' +import { useTranslation } from 'react-i18next' + +import { + Button, + InputLabel, + NativeCoinSelector, + NativeCoinSelectorProps, + useChain, +} from '@dao-dao/stateless' +import { GenericTokenBalance, LoadingData } from '@dao-dao/types' +import { ActionComponent } from '@dao-dao/types/actions' +import { getNativeTokenForChainId } from '@dao-dao/utils' + +export type CreateValenceAccountData = { + chainId: string + funds: { denom: string; amount: number }[] +} + +export type CreateValenceAccountOptions = { + nativeBalances: LoadingData +} + +export const CreateValenceAccountComponent: ActionComponent< + CreateValenceAccountOptions +> = (props) => { + const { t } = useTranslation() + const { chain_id: chainId } = useChain() + + const { control, watch } = useFormContext() + const { + fields: coins, + append: appendCoin, + remove: removeCoin, + } = useFieldArray({ + control, + name: (props.fieldNamePrefix + 'funds') as 'funds', + }) + + return ( + <> +
+ + + {props.isCreating && ( +

+ {t('info.minBalanceToCreateAccount', { + balance: t('format.token', { + amount: 10, + symbol: 'NTRN', + }), + })} +

+ )} + + {coins.map(({ id }, index) => { + const isNtrn = + watch( + (props.fieldNamePrefix + + `funds.${index}.denom`) as `funds.${number}.denom` + ) === 'untrn' + + return ( + 1 + ? () => removeCoin(index) + : undefined, + } as NativeCoinSelectorProps)} + errors={props.errors?.funds?.[index]} + fieldNamePrefix={props.fieldNamePrefix + `funds.${index}.`} + min={ + // Minimum balance of 10 $NTRN. + isNtrn ? 10 : undefined + } + /> + ) + })} + + {!props.isCreating && coins.length === 0 && ( +

+ {t('info.none')} +

+ )} + + {props.isCreating && ( + + )} +
+ + ) +} diff --git a/packages/stateful/actions/core/valence/CreateValenceAccount/README.md b/packages/stateful/actions/core/valence/CreateValenceAccount/README.md new file mode 100644 index 000000000..d5bde95d1 --- /dev/null +++ b/packages/stateful/actions/core/valence/CreateValenceAccount/README.md @@ -0,0 +1,27 @@ +# CreateValenceAccount + +Create a Valence account. + +## Bulk import format + +This is relevant when bulk importing actions, as described in [this +guide](https://github.com/DA0-DA0/dao-dao-ui/wiki/Bulk-importing-actions). + +### Key + +`createValenceAccount` + +### Data format + +```json +{ + "chainId": "", + "funds": [ + // Optional. If not provided, no funds will be sent. + { + "denom": "", + "amount": "" + } + ] +} +``` diff --git a/packages/stateful/actions/core/valence/CreateValenceAccount/index.tsx b/packages/stateful/actions/core/valence/CreateValenceAccount/index.tsx new file mode 100644 index 000000000..79492f8a0 --- /dev/null +++ b/packages/stateful/actions/core/valence/CreateValenceAccount/index.tsx @@ -0,0 +1,248 @@ +import { fromUtf8, toUtf8 } from '@cosmjs/encoding' +import { useCallback } from 'react' +import { useFormContext } from 'react-hook-form' +import { waitForAll } from 'recoil' + +import { genericTokenSelector } from '@dao-dao/state/recoil' +import { + AtomEmoji, + ChainProvider, + DaoSupportedChainPickerInput, + useCachedLoading, +} from '@dao-dao/stateless' +import { TokenType, makeStargateMessage } from '@dao-dao/types' +import { + ActionComponent, + ActionContextType, + ActionKey, + ActionMaker, + UseDecodedCosmosMsg, + UseDefaults, + UseTransformToCosmos, +} from '@dao-dao/types/actions' +import { InstantiateMsg as ValenceAccountInstantiateMsg } from '@dao-dao/types/contracts/ValenceAccount' +import { MsgInstantiateContract2 } from '@dao-dao/types/protobuf/codegen/cosmwasm/wasm/v1/tx' +import { + VALENCE_INSTANTIATE2_SALT, + VALENCE_SUPPORTED_CHAINS, + convertDenomToMicroDenomStringWithDecimals, + convertMicroDenomToDenomWithDecimals, + decodePolytoneExecuteMsg, + getChainAddressForActionOptions, + getDisplayNameForChainId, + getSupportedChainConfig, + isDecodedStargateMsg, + maybeMakePolytoneExecuteMessage, +} from '@dao-dao/utils' + +import { useTokenBalances } from '../../../hooks' +import { useActionOptions } from '../../../react/context' +import { + CreateValenceAccountComponent, + CreateValenceAccountData, +} from './Component' + +const Component: ActionComponent = (props) => { + const { context } = useActionOptions() + const { watch, setValue } = useFormContext() + + const chainId = watch((props.fieldNamePrefix + 'chainId') as 'chainId') + const funds = watch((props.fieldNamePrefix + 'funds') as 'funds') + + const nativeBalances = useTokenBalances({ + filter: TokenType.Native, + // Load selected tokens when not creating in case they are no longer + // returned in the list of all tokens for the given DAO/wallet after the + // proposal is made. + additionalTokens: props.isCreating + ? undefined + : funds.map(({ denom }) => ({ + chainId, + type: TokenType.Native, + denomOrAddress: denom, + })), + }) + + return ( + <> + {context.type === ActionContextType.Dao && + VALENCE_SUPPORTED_CHAINS.length > 1 && ( + { + // Reset funds when switching chain. + setValue((props.fieldNamePrefix + 'funds') as 'funds', []) + }} + /> + )} + + + + + + ) +} + +const useDefaults: UseDefaults = () => ({ + chainId: VALENCE_SUPPORTED_CHAINS[0], + funds: [ + { + denom: 'untrn', + amount: 10, + }, + ], +}) + +export const makeCreateValenceAccountAction: ActionMaker< + CreateValenceAccountData +> = (options) => { + const { + t, + chain: { chain_id: currentChainId }, + } = options + + const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( + msg: Record + ) => { + let chainId = currentChainId + const decodedPolytone = decodePolytoneExecuteMsg(chainId, msg) + if (decodedPolytone.match) { + chainId = decodedPolytone.chainId + msg = decodedPolytone.msg + } + + const typedMsg = + isDecodedStargateMsg(msg) && + msg.stargate.typeUrl === MsgInstantiateContract2.typeUrl && + fromUtf8(msg.stargate.value.salt) === VALENCE_INSTANTIATE2_SALT + ? (msg.stargate.value as MsgInstantiateContract2) + : undefined + + const valenceAccountCodeId = + getSupportedChainConfig(chainId)?.codeIds?.ValenceAccount + + const fundTokens = useCachedLoading( + typedMsg + ? waitForAll( + typedMsg.funds.map(({ denom }) => + genericTokenSelector({ + chainId, + type: TokenType.Native, + denomOrAddress: denom, + }) + ) + ) + : undefined, + [] + ) + + return valenceAccountCodeId !== undefined && typedMsg + ? { + match: true, + data: { + chainId, + funds: typedMsg.funds.map(({ denom, amount }) => ({ + denom, + amount: convertMicroDenomToDenomWithDecimals( + amount, + (!fundTokens.loading && + fundTokens.data.find( + (token) => + token.chainId === chainId && + token.denomOrAddress === denom + )?.decimals) || + 0 + ), + })), + }, + } + : { + match: false, + } + } + + const useTransformToCosmos: UseTransformToCosmos< + CreateValenceAccountData + > = () => { + const nativeBalances = useTokenBalances({ + filter: TokenType.Native, + }) + + return useCallback( + ({ chainId, funds }) => { + const config = getSupportedChainConfig(chainId) + if (!config?.codeIds?.ValenceAccount || !config?.valence) { + throw new Error(t('error.unsupportedValenceChain')) + } + + const sender = getChainAddressForActionOptions(options, chainId) + if (!sender) { + throw new Error( + t('error.failedToFindChainAccount', { + chain: getDisplayNameForChainId(chainId), + }) + ) + } + + return maybeMakePolytoneExecuteMessage( + currentChainId, + chainId, + makeStargateMessage({ + stargate: { + typeUrl: MsgInstantiateContract2.typeUrl, + value: { + sender, + admin: sender, + codeId: BigInt(config.codeIds.ValenceAccount), + label: 'Valence Account', + msg: toUtf8( + JSON.stringify({ + services_manager: config.valence.servicesManager, + } as ValenceAccountInstantiateMsg) + ), + funds: funds.map(({ denom, amount }) => ({ + denom, + amount: convertDenomToMicroDenomStringWithDecimals( + amount, + (!nativeBalances.loading && + nativeBalances.data.find( + ({ token }) => + token.chainId === chainId && + token.denomOrAddress === denom + )?.token.decimals) || + 0 + ), + })), + salt: toUtf8(VALENCE_INSTANTIATE2_SALT), + fixMsg: false, + } as MsgInstantiateContract2, + }, + }) + ) + }, + [nativeBalances] + ) + } + + return { + key: ActionKey.CreateValenceAccount, + Icon: AtomEmoji, + label: t('title.createValenceAccount'), + description: t('info.createValenceAccountDescription'), + notReusable: true, + Component, + useDefaults, + useTransformToCosmos, + useDecodedCosmosMsg, + // The configure rebalancer action is responsible for adding this action. + programmaticOnly: true, + } +} diff --git a/packages/stateful/actions/core/valence/FundRebalancer/index.tsx b/packages/stateful/actions/core/valence/FundRebalancer/index.tsx new file mode 100644 index 000000000..6581d5f10 --- /dev/null +++ b/packages/stateful/actions/core/valence/FundRebalancer/index.tsx @@ -0,0 +1,94 @@ +import { MoneyWingsEmoji } from '@dao-dao/stateless' +import { AccountType, ActionMaker, ChainId } from '@dao-dao/types' +import { + ActionComponent, + ActionKey, + UseDecodedCosmosMsg, + UseDefaults, + UseTransformToCosmos, +} from '@dao-dao/types/actions' +import { getAccount } from '@dao-dao/utils' + +import { StatefulSpendComponent, makeSpendAction } from '../../treasury/Spend' +import { SpendData } from '../../treasury/Spend/Component' + +export type FundRebalancerData = SpendData + +export const makeFundRebalancerAction: ActionMaker = ( + options +) => { + const { + t, + context, + address, + chain: { chain_id: chainId }, + } = options + + const spendAction = makeSpendAction(options) + if (!spendAction) { + return null + } + + const valenceAccount = getAccount({ + accounts: context.accounts, + chainId: ChainId.NeutronMainnet, + types: [AccountType.Valence], + }) + + const useDefaults: UseDefaults = () => { + const spendDefaults = spendAction.useDefaults() + + if (!valenceAccount) { + return new Error(t('error.noValenceAccount')) + } + + if (!spendDefaults) { + return + } else if (spendDefaults instanceof Error) { + return spendDefaults + } + + return { + ...spendDefaults, + fromChainId: chainId, + from: address, + toChainId: ChainId.NeutronMainnet, + to: valenceAccount.address, + } + } + + const useTransformToCosmos: UseTransformToCosmos = + spendAction.useTransformToCosmos + + const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( + msg: Record + ) => { + const decoded = spendAction.useDecodedCosmosMsg(msg) + + return decoded.match && + valenceAccount && + decoded.data.toChainId === valenceAccount.chainId && + decoded.data.to === valenceAccount.address + ? decoded + : { + match: false, + } + } + + const Component: ActionComponent = (props) => ( + + ) + + return { + key: ActionKey.FundRebalancer, + Icon: MoneyWingsEmoji, + label: t('title.fundRebalancer'), + description: t('info.fundRebalancerDescription'), + Component, + useDefaults, + useTransformToCosmos, + useDecodedCosmosMsg, + // Hide if no Valence account created. + hideFromPicker: !valenceAccount, + } +} diff --git a/packages/stateful/actions/core/valence/PauseRebalancer/Component.stories.tsx b/packages/stateful/actions/core/valence/PauseRebalancer/Component.stories.tsx new file mode 100644 index 000000000..2e8ed9311 --- /dev/null +++ b/packages/stateful/actions/core/valence/PauseRebalancer/Component.stories.tsx @@ -0,0 +1,35 @@ +import { ComponentMeta, ComponentStory } from '@storybook/react' + +import { + ReactHookFormDecorator, + makeDaoInfo, + makeDaoProvidersDecorator, +} from '@dao-dao/storybook' + +import { PauseRebalancerComponent } from './Component' + +export default { + title: + 'DAO DAO / packages / stateful / actions / core / valence / PauseRebalancer', + component: PauseRebalancerComponent, + decorators: [ + ReactHookFormDecorator, + makeDaoProvidersDecorator(makeDaoInfo()), + ], +} as ComponentMeta + +const Template: ComponentStory = (args) => ( + +) + +export const Default = Template.bind({}) +Default.args = { + fieldNamePrefix: '', + allActionsWithData: [], + index: 0, + data: { + account: '', + }, + isCreating: true, + errors: {}, +} diff --git a/packages/stateful/actions/core/valence/PauseRebalancer/Component.tsx b/packages/stateful/actions/core/valence/PauseRebalancer/Component.tsx new file mode 100644 index 000000000..3466d8073 --- /dev/null +++ b/packages/stateful/actions/core/valence/PauseRebalancer/Component.tsx @@ -0,0 +1,15 @@ +import { useTranslation } from 'react-i18next' + +import { ActionComponent } from '@dao-dao/types/actions' + +export type PauseRebalancerData = { + account: string +} + +export const PauseRebalancerComponent: ActionComponent< + undefined, + PauseRebalancerData +> = () => { + const { t } = useTranslation() + return

{t('info.pauseRebalancerExplanation')}

+} diff --git a/packages/stateful/actions/core/valence/PauseRebalancer/README.md b/packages/stateful/actions/core/valence/PauseRebalancer/README.md new file mode 100644 index 000000000..a85e956e6 --- /dev/null +++ b/packages/stateful/actions/core/valence/PauseRebalancer/README.md @@ -0,0 +1,20 @@ +# PauseRebalancer + +Pause the rebalancer. + +## Bulk import format + +This is relevant when bulk importing actions, as described in [this +guide](https://github.com/DA0-DA0/dao-dao-ui/wiki/Bulk-importing-actions). + +### Key + +`pauseRebalancer` + +### Data format + +```json +{ + "account": "" +} +``` diff --git a/packages/stateful/actions/core/valence/PauseRebalancer/index.tsx b/packages/stateful/actions/core/valence/PauseRebalancer/index.tsx new file mode 100644 index 000000000..e42086c66 --- /dev/null +++ b/packages/stateful/actions/core/valence/PauseRebalancer/index.tsx @@ -0,0 +1,103 @@ +import { useCallback } from 'react' + +import { PlayPauseEmoji } from '@dao-dao/stateless' +import { AccountType, ActionMaker, ChainId } from '@dao-dao/types' +import { + ActionKey, + UseDecodedCosmosMsg, + UseDefaults, + UseTransformToCosmos, +} from '@dao-dao/types/actions' +import { + getAccountAddress, + makeWasmMessage, + objectMatchesStructure, +} from '@dao-dao/utils' + +import { useActionOptions } from '../../../react' +import { + PauseRebalancerComponent as Component, + PauseRebalancerData, +} from './Component' + +const useDefaults: UseDefaults = () => { + const { t, context } = useActionOptions() + + const account = getAccountAddress({ + accounts: context.accounts, + chainId: ChainId.NeutronMainnet, + types: [AccountType.Valence], + }) + + if (!account) { + return new Error(t('error.noValenceAccount')) + } + + return { + account, + } +} + +const useTransformToCosmos: UseTransformToCosmos = () => + useCallback( + ({ account }: PauseRebalancerData) => + makeWasmMessage({ + wasm: { + execute: { + contract_addr: account, + funds: [], + msg: { + pause_service: { + service_name: 'rebalancer', + }, + }, + }, + }, + }), + [] + ) + +const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( + msg: Record +) => + objectMatchesStructure(msg, { + wasm: { + execute: { + contract_addr: {}, + funds: {}, + msg: { + pause_service: { + service_name: {}, + }, + }, + }, + }, + }) && msg.wasm.execute.msg.pause_service.service_name === 'rebalancer' + ? { + match: true, + data: { + account: msg.wasm.execute.contract_addr, + }, + } + : { + match: false, + } + +export const makePauseRebalancerAction: ActionMaker = ({ + t, + context, +}) => ({ + key: ActionKey.PauseRebalancer, + Icon: PlayPauseEmoji, + label: t('title.pauseRebalancer'), + description: t('info.pauseRebalancerDescription'), + notReusable: true, + Component, + useDefaults, + useTransformToCosmos, + useDecodedCosmosMsg, + // Hide if no Valence account created. + hideFromPicker: !context.accounts.some( + ({ type }) => type === AccountType.Valence + ), +}) diff --git a/packages/stateful/actions/core/valence/ResumeRebalancer/Component.stories.tsx b/packages/stateful/actions/core/valence/ResumeRebalancer/Component.stories.tsx new file mode 100644 index 000000000..7ba09681f --- /dev/null +++ b/packages/stateful/actions/core/valence/ResumeRebalancer/Component.stories.tsx @@ -0,0 +1,35 @@ +import { ComponentMeta, ComponentStory } from '@storybook/react' + +import { + ReactHookFormDecorator, + makeDaoInfo, + makeDaoProvidersDecorator, +} from '@dao-dao/storybook' + +import { ResumeRebalancerComponent } from './Component' + +export default { + title: + 'DAO DAO / packages / stateful / actions / core / valence / ResumeRebalancer', + component: ResumeRebalancerComponent, + decorators: [ + ReactHookFormDecorator, + makeDaoProvidersDecorator(makeDaoInfo()), + ], +} as ComponentMeta + +const Template: ComponentStory = (args) => ( + +) + +export const Default = Template.bind({}) +Default.args = { + fieldNamePrefix: '', + allActionsWithData: [], + index: 0, + data: { + account: '', + }, + isCreating: true, + errors: {}, +} diff --git a/packages/stateful/actions/core/valence/ResumeRebalancer/Component.tsx b/packages/stateful/actions/core/valence/ResumeRebalancer/Component.tsx new file mode 100644 index 000000000..50cf26aa4 --- /dev/null +++ b/packages/stateful/actions/core/valence/ResumeRebalancer/Component.tsx @@ -0,0 +1,15 @@ +import { useTranslation } from 'react-i18next' + +import { ActionComponent } from '@dao-dao/types/actions' + +export type ResumeRebalancerData = { + account: string +} + +export const ResumeRebalancerComponent: ActionComponent< + undefined, + ResumeRebalancerData +> = () => { + const { t } = useTranslation() + return

{t('info.resumeRebalancerExplanation')}

+} diff --git a/packages/stateful/actions/core/valence/ResumeRebalancer/README.md b/packages/stateful/actions/core/valence/ResumeRebalancer/README.md new file mode 100644 index 000000000..1ec47c26e --- /dev/null +++ b/packages/stateful/actions/core/valence/ResumeRebalancer/README.md @@ -0,0 +1,20 @@ +# ResumeRebalancer + +Resume the rebalancer. + +## Bulk import format + +This is relevant when bulk importing actions, as described in [this +guide](https://github.com/DA0-DA0/dao-dao-ui/wiki/Bulk-importing-actions). + +### Key + +`resumeRebalancer` + +### Data format + +```json +{ + "account": "" +} +``` diff --git a/packages/stateful/actions/core/valence/ResumeRebalancer/index.tsx b/packages/stateful/actions/core/valence/ResumeRebalancer/index.tsx new file mode 100644 index 000000000..aaab31d48 --- /dev/null +++ b/packages/stateful/actions/core/valence/ResumeRebalancer/index.tsx @@ -0,0 +1,103 @@ +import { useCallback } from 'react' + +import { PlayPauseEmoji } from '@dao-dao/stateless' +import { AccountType, ActionMaker, ChainId } from '@dao-dao/types' +import { + ActionKey, + UseDecodedCosmosMsg, + UseDefaults, + UseTransformToCosmos, +} from '@dao-dao/types/actions' +import { + getAccountAddress, + makeWasmMessage, + objectMatchesStructure, +} from '@dao-dao/utils' + +import { useActionOptions } from '../../../react' +import { + ResumeRebalancerComponent as Component, + ResumeRebalancerData, +} from './Component' + +const useDefaults: UseDefaults = () => { + const { t, context } = useActionOptions() + + const account = getAccountAddress({ + accounts: context.accounts, + chainId: ChainId.NeutronMainnet, + types: [AccountType.Valence], + }) + + if (!account) { + return new Error(t('error.noValenceAccount')) + } + + return { + account, + } +} + +const useTransformToCosmos: UseTransformToCosmos = () => + useCallback( + ({ account }: ResumeRebalancerData) => + makeWasmMessage({ + wasm: { + execute: { + contract_addr: account, + funds: [], + msg: { + resume_service: { + service_name: 'rebalancer', + }, + }, + }, + }, + }), + [] + ) + +const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( + msg: Record +) => + objectMatchesStructure(msg, { + wasm: { + execute: { + contract_addr: {}, + funds: {}, + msg: { + resume_service: { + service_name: {}, + }, + }, + }, + }, + }) && msg.wasm.execute.msg.resume_service.service_name === 'rebalancer' + ? { + match: true, + data: { + account: msg.wasm.execute.contract_addr, + }, + } + : { + match: false, + } + +export const makeResumeRebalancerAction: ActionMaker = ({ + t, + context, +}) => ({ + key: ActionKey.ResumeRebalancer, + Icon: PlayPauseEmoji, + label: t('title.resumeRebalancer'), + description: t('info.resumeRebalancerDescription'), + notReusable: true, + Component, + useDefaults, + useTransformToCosmos, + useDecodedCosmosMsg, + // Hide if no Valence account created. + hideFromPicker: !context.accounts.some( + ({ type }) => type === AccountType.Valence + ), +}) diff --git a/packages/stateful/actions/core/valence/WithdrawFromRebalancer/index.tsx b/packages/stateful/actions/core/valence/WithdrawFromRebalancer/index.tsx new file mode 100644 index 000000000..287ee8bf3 --- /dev/null +++ b/packages/stateful/actions/core/valence/WithdrawFromRebalancer/index.tsx @@ -0,0 +1,171 @@ +import { useCallback } from 'react' + +import { DownArrowEmoji } from '@dao-dao/stateless' +import { AccountType, ActionMaker, ChainId } from '@dao-dao/types' +import { + ActionComponent, + ActionKey, + UseDecodedCosmosMsg, + UseDefaults, + UseTransformToCosmos, +} from '@dao-dao/types/actions' +import { + decodeIcaExecuteMsg, + decodePolytoneExecuteMsg, + getAccount, + makeWasmMessage, + objectMatchesStructure, +} from '@dao-dao/utils' + +import { StatefulSpendComponent, makeSpendAction } from '../../treasury/Spend' +import { SpendData } from '../../treasury/Spend/Component' + +export type WithdrawFromRebalancerData = SpendData + +export const makeWithdrawFromRebalancerAction: ActionMaker< + WithdrawFromRebalancerData +> = (options) => { + const { + t, + context, + address, + chain: { chain_id: currentChainId }, + } = options + + const spendAction = makeSpendAction({ + ...options, + fromValence: true, + }) + if (!spendAction) { + return null + } + + const valenceAccount = getAccount({ + accounts: context.accounts, + chainId: ChainId.NeutronMainnet, + types: [AccountType.Valence], + }) + + const useDefaults: UseDefaults = () => { + const spendDefaults = spendAction.useDefaults() + + if (!valenceAccount) { + return new Error(t('error.noValenceAccount')) + } + + if (!spendDefaults) { + return + } else if (spendDefaults instanceof Error) { + return spendDefaults + } + + return { + ...spendDefaults, + fromChainId: ChainId.NeutronMainnet, + from: valenceAccount.address, + toChainId: currentChainId, + to: address, + } + } + + const useTransformToCosmos: UseTransformToCosmos< + WithdrawFromRebalancerData + > = () => { + const transform = spendAction.useTransformToCosmos() + + return useCallback( + (data) => { + if (!valenceAccount) { + throw new Error(t('error.noValenceAccount')) + } + + const transformed = transform(data) + if (!transformed) { + return + } + + return makeWasmMessage({ + wasm: { + execute: { + contract_addr: valenceAccount.address, + funds: [], + msg: { + execute_by_admin: { + msgs: [transformed], + }, + }, + }, + }, + }) + }, + [transform] + ) + } + + const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( + msg: Record + ) => { + let chainId = currentChainId + const decodedPolytone = decodePolytoneExecuteMsg(chainId, msg) + if (decodedPolytone.match) { + msg = decodedPolytone.msg + chainId = decodedPolytone.chainId + } else { + const decodedIca = decodeIcaExecuteMsg(chainId, msg) + if (decodedIca.match) { + chainId = decodedIca.chainId + msg = decodedIca.msgWithSender?.msg || {} + } + } + + const isExecuteByAdmin = + objectMatchesStructure(msg, { + wasm: { + execute: { + contract_addr: {}, + funds: {}, + msg: { + execute_by_admin: { + msgs: {}, + }, + }, + }, + }, + }) && + msg.wasm.execute.contract_addr === valenceAccount?.address && + Array.isArray(msg.wasm.execute.msg.execute_by_admin.msgs) && + msg.wasm.execute.msg.execute_by_admin.msgs.length === 1 + + // Only attempt to decode execute by admin msg. + const decoded = spendAction.useDecodedCosmosMsg( + isExecuteByAdmin ? msg.wasm.execute.msg.execute_by_admin.msgs[0] : {} + ) + + return isExecuteByAdmin && + decoded.match && + valenceAccount && + decoded.data.toChainId === currentChainId && + decoded.data.to === address + ? decoded + : { + match: false, + } + } + + const Component: ActionComponent = (props) => ( + + ) + + return { + key: ActionKey.WithdrawFromRebalancer, + Icon: DownArrowEmoji, + label: t('title.withdrawFromRebalancer'), + description: t('info.withdrawFromRebalancerDescription'), + Component, + useDefaults, + useTransformToCosmos, + useDecodedCosmosMsg, + // Hide if no Valence account created. + hideFromPicker: !valenceAccount, + } +} diff --git a/packages/stateful/actions/core/valence/index.ts b/packages/stateful/actions/core/valence/index.ts new file mode 100644 index 000000000..bdae74b9e --- /dev/null +++ b/packages/stateful/actions/core/valence/index.ts @@ -0,0 +1,30 @@ +import { ActionCategoryKey, ActionCategoryMaker } from '@dao-dao/types' +import { actionContextSupportsValence } from '@dao-dao/utils' + +import { makeConfigureRebalancerAction } from './ConfigureRebalancer' +import { makeCreateValenceAccountAction } from './CreateValenceAccount' +import { makeFundRebalancerAction } from './FundRebalancer' +import { makePauseRebalancerAction } from './PauseRebalancer' +import { makeResumeRebalancerAction } from './ResumeRebalancer' +import { makeWithdrawFromRebalancerAction } from './WithdrawFromRebalancer' + +export const makeValenceActionCategory: ActionCategoryMaker = (options) => + actionContextSupportsValence(options) + ? { + key: ActionCategoryKey.Rebalancer, + label: options.t('actionCategory.rebalancerLabel', { + context: options.context.type, + }), + description: options.t('actionCategory.rebalancerDescription', { + context: options.context.type, + }), + actionMakers: [ + makeConfigureRebalancerAction, + makeFundRebalancerAction, + makeWithdrawFromRebalancerAction, + makePauseRebalancerAction, + makeResumeRebalancerAction, + makeCreateValenceAccountAction, + ], + } + : null diff --git a/packages/stateful/actions/hooks/useTokenBalances.ts b/packages/stateful/actions/hooks/useTokenBalances.ts index 02fc371e7..58b5b0339 100644 --- a/packages/stateful/actions/hooks/useTokenBalances.ts +++ b/packages/stateful/actions/hooks/useTokenBalances.ts @@ -4,6 +4,7 @@ import { } from '@dao-dao/state' import { useCachedLoading } from '@dao-dao/stateless' import { + AccountType, ActionContextType, GenericToken, GenericTokenBalanceWithOwner, @@ -15,16 +16,37 @@ import { useCw20CommonGovernanceTokenInfoIfExists } from '../../voting-module-ad import { useActionOptions } from '../react' export type UseTokenBalancesOptions = { - // Only return balances for tokens of this type. + /** + * Only return balances for tokens of this type. + */ filter?: TokenType - // If these are not returned in the balances, they will be added to the end. + /** + * If these are not returned in the balances, they will be added to the end. + */ additionalTokens?: Pick[] + /** + * Don't load balances from Valence accounts. Defaults to true. + */ + ignoreValence?: boolean + /** + * Include only these account types. + */ + includeAccountTypes?: AccountType[] + /** + * Exclude these account types. + * + * Valence account funds must first be withdrawn into the DAO's treasury + * before they can be used in actions, so this defaults to excluding them. + */ + excludeAccountTypes?: AccountType[] } // Get native and cw20 token unstaked balances for the current context account. export const useTokenBalances = ({ filter, additionalTokens, + includeAccountTypes, + excludeAccountTypes = [AccountType.Valence], }: UseTokenBalancesOptions = {}): LoadingData< GenericTokenBalanceWithOwner[] > => { @@ -55,6 +77,8 @@ export const useTokenBalances = ({ // This hook is used to fetch usable balances for actions. Staked // balances are not desired. ignoreStaked: true, + includeAccountTypes, + excludeAccountTypes, }), [], (error) => console.error(error) diff --git a/packages/stateful/actions/react/provider.tsx b/packages/stateful/actions/react/provider.tsx index bae2d6ea9..aa89635b7 100644 --- a/packages/stateful/actions/react/provider.tsx +++ b/packages/stateful/actions/react/provider.tsx @@ -2,7 +2,11 @@ import { useMemo } from 'react' import { useTranslation } from 'react-i18next' import { waitForAll } from 'recoil' -import { govParamsSelector, moduleAddressSelector } from '@dao-dao/state/recoil' +import { + accountsSelector, + govParamsSelector, + moduleAddressSelector, +} from '@dao-dao/state/recoil' import { ErrorPage, Loader, @@ -20,6 +24,7 @@ import { ActionContextType, ActionOptions, ActionsProviderProps, + ChainId, GovActionsProviderProps, IActionsContext, WalletActionsProviderProps, @@ -55,6 +60,7 @@ export const DaoActionsProvider = ({ children }: ActionsProviderProps) => { context: { type: ActionContextType.Dao, dao, + accounts: dao.info.accounts, }, } @@ -182,14 +188,28 @@ export const WalletActionsProvider = ({ address: overrideAddress, children, }: WalletActionsProviderProps) => { - const { address: connectedAddress } = useWallet() + const { address: connectedAddress, chain } = useWallet() const address = overrideAddress === undefined ? connectedAddress : overrideAddress const { profile } = useProfile({ address }) - if (address === undefined || profile.loading) { + const accounts = useCachedLoadingWithError( + address + ? accountsSelector({ + chainId: chain.chain_id, + address, + }) + : undefined + ) + + if ( + address === undefined || + profile.loading || + accounts.loading || + accounts.errored + ) { return } @@ -199,6 +219,7 @@ export const WalletActionsProvider = ({ context={{ type: ActionContextType.Wallet, profile: profile.data, + accounts: accounts.data, }} > {children} @@ -223,16 +244,32 @@ export const GovActionsProvider = ({ ]) ) - return govDataLoading.loading ? ( + const accounts = useCachedLoadingWithError( + govDataLoading.loading || govDataLoading.errored + ? undefined + : accountsSelector({ + chainId, + address: govDataLoading.data[0], + // Make sure to load ICAs for Neutron so Valence accounts load. + includeIcaChains: [ChainId.NeutronMainnet], + }) + ) + + return govDataLoading.loading || + (accounts.loading && !govDataLoading.errored) ? ( <>{loader || } ) : govDataLoading.errored ? ( + ) : accounts.errored ? ( + ) : ( {children} diff --git a/packages/stateful/command/contexts/generic/dao.tsx b/packages/stateful/command/contexts/generic/dao.tsx index 16f448653..292b68b54 100644 --- a/packages/stateful/command/contexts/generic/dao.tsx +++ b/packages/stateful/command/contexts/generic/dao.tsx @@ -13,7 +13,7 @@ import useDeepCompareEffect from 'use-deep-compare-effect' import { navigatingToHrefAtom } from '@dao-dao/state' import { useDaoInfoContext, useDaoNavHelpers } from '@dao-dao/stateless' -import { ContractVersion, Feature } from '@dao-dao/types' +import { AccountType, ContractVersion, Feature } from '@dao-dao/types' import { CommandModalContextMaker, CommandModalContextSection, @@ -58,7 +58,7 @@ export const makeGenericDaoContext: CommandModalContextMaker<{ coreAddress, }) - const [copied, setCopied] = useState() + const [copied, setCopied] = useState() // Debounce clearing copied. useEffect(() => { const timeout = setTimeout(() => setCopied(undefined), 2000) @@ -150,19 +150,23 @@ export const makeGenericDaoContext: CommandModalContextMaker<{ }), loading: updatingFollowing, }, - ...accounts.map(({ chainId, address }) => ({ + ...accounts.map(({ chainId, address, type }, accountIndex) => ({ name: - copied === chainId + copied === accountIndex ? t('info.copiedChainAddress', { - chain: getDisplayNameForChainId(chainId), + chain: + getDisplayNameForChainId(chainId) + + (type === AccountType.Valence ? ' (Valence)' : ''), }) - : t('button.copyDaoChainAddress', { - chain: getDisplayNameForChainId(chainId), + : t('button.copyChainAddress', { + chain: + getDisplayNameForChainId(chainId) + + (type === AccountType.Valence ? ' (Valence)' : ''), }), - Icon: copied === chainId ? Check : CopyAll, + Icon: copied === accountIndex ? Check : CopyAll, onChoose: () => { navigator.clipboard.writeText(address) - setCopied(chainId) + setCopied(accountIndex) }, })), ], diff --git a/packages/stateful/components/ProposalList.tsx b/packages/stateful/components/ProposalList.tsx index 3b0207cda..ef52710e0 100644 --- a/packages/stateful/components/ProposalList.tsx +++ b/packages/stateful/components/ProposalList.tsx @@ -1,4 +1,4 @@ -import { useEffect, useMemo, useRef, useState } from 'react' +import { useEffect, useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import { useRecoilCallback, useSetRecoilState } from 'recoil' @@ -325,11 +325,10 @@ export const ProposalList = ({ ) // Load once on mount. - const loadMoreRef = useRef(loadMore) - loadMoreRef.current = loadMore + const loadMoreRef = useUpdatingRef(loadMore) useEffect(() => { loadMoreRef.current() - }, []) + }, [loadMoreRef]) // Refresh all proposals on proposal WebSocket messages. const setRefreshProposalsId = useSetRecoilState(refreshProposalsIdAtom) diff --git a/packages/stateful/components/TreasuryHistoryGraph.tsx b/packages/stateful/components/TreasuryHistoryGraph.tsx index 51a87d3ed..5ecaca275 100644 --- a/packages/stateful/components/TreasuryHistoryGraph.tsx +++ b/packages/stateful/components/TreasuryHistoryGraph.tsx @@ -27,14 +27,17 @@ import { useNamedThemeColor, } from '@dao-dao/stateless' import { + AccountType, TokenPriceHistoryRange, TreasuryHistoryGraphProps, } from '@dao-dao/types' import { DISTRIBUTION_COLORS, formatDateTimeTz, + formatPercentOf100, serializeTokenSource, shortenTokenSymbol, + tokenSourcesEqual, } from '@dao-dao/utils' import 'chartjs-adapter-date-fns' @@ -51,11 +54,12 @@ ChartJS.register( annotationPlugin ) -// TODO: add way to set base price denom to use instead of USD +// TODO(rebalancer): add way to set base price denom to use instead of USD export const TreasuryHistoryGraph = ({ chainId, address, account, + showRebalancer = false, className, graphClassName, registerTokenColors, @@ -83,6 +87,17 @@ export const TreasuryHistoryGraph = ({ chainId: account.chainId, address: account.address, }, + // Filter by rebalancer tokens. + tokens: + showRebalancer && account.type === AccountType.Valence + ? account.config.rebalancer?.targets.map( + ({ token: { chainId, type, denomOrAddress } }) => ({ + chainId, + type, + denomOrAddress, + }) + ) + : undefined, }, }) ) @@ -115,6 +130,7 @@ export const TreasuryHistoryGraph = ({ } return { + token, order: 2, label: '$' + @@ -128,11 +144,82 @@ export const TreasuryHistoryGraph = ({ } }) + const showTargets = + !!account && + account.type === AccountType.Valence && + !!account.config.rebalancer?.targets.length && + showRebalancer && + !treasuryValueHistory.loading && + !treasuryValueHistory.errored + + // Show targets if rebalancer configured account. + const targetValues = !showTargets + ? [] + : (account.config.rebalancer?.targets || []).flatMap( + ({ token, targets }) => { + if (targets.length === 0) { + return [] + } + + const data = treasuryValueHistory.data.timestamps.map( + (_timestamp, timestampIndex) => { + // Find first target that is after this timestamp so we can + // choose the most recent target before it. + let nextTargetIndex = targets.findIndex( + (target) => target.timestamp > _timestamp.getTime() + ) + const targetIndex = + nextTargetIndex === -1 + ? // If all targets are before, use last one. + targets.length - 1 + : // If all targets are after, no target for this timestamp. + nextTargetIndex === 0 + ? undefined + : // Otherwise use the previous one. + nextTargetIndex - 1 + if (targetIndex === undefined) { + return null + } + + // Get total value at this point in time. + const totalValue = + treasuryValueHistory.data.totals[timestampIndex] + if (totalValue === null) { + return null + } + + const { percentage } = targets[targetIndex] + + // The target at this point is based on the total value. + return totalValue * Number(percentage) + } + ) + + return { + token, + order: 3, + label: + '$' + + shortenTokenSymbol(token.symbol).tokenSymbol + + ' ' + + t('title.target'), + data, + borderDash: [2.5, 2.5], + borderColor: tokenColors[serializeTokenSource(token)], + backgroundColor: tokenColors[serializeTokenSource(token)], + pointRadius: 0, + pointHitRadius: 0, + borderWidth: 2.5, + } + } + ) + const totalValues = treasuryValueHistory.loading || treasuryValueHistory.errored ? [] : [ { + token: undefined, order: 1, label: t('title.totalValue'), data: treasuryValueHistory.data.totals, @@ -142,13 +229,18 @@ export const TreasuryHistoryGraph = ({ }, ] - const datasets = [...tokenValues, ...totalValues] + const datasets = [...tokenValues, ...targetValues, ...totalValues] const [tooltipData, setTooltipData] = useState>() // Contains information on the data point that is currently hovered. Can be // used to retrieve the timestamp value (`.parsed.x`) and index in the dataset // (`.dataIndex`). const tooltipFirstDataPoint = tooltipData?.dataPoints[0] + const tooltipTotalValue = + tooltipData && + (tooltipData.dataPoints.find( + ({ datasetIndex }) => datasetIndex === datasets.length - 1 + )?.raw as number | undefined) const containerRef = useRef(null) const tooltipRef = useRef(null) @@ -355,7 +447,14 @@ export const TreasuryHistoryGraph = ({ ), ].flatMap( ( - { data, label, borderWidth, borderColor, backgroundColor }, + { + token, + data, + label, + borderWidth, + borderColor, + backgroundColor, + }, index ) => { const value = data[tooltipFirstDataPoint.dataIndex] @@ -363,6 +462,12 @@ export const TreasuryHistoryGraph = ({ return } + const targetValue = + token && + targetValues.find(({ token: t }) => + tokenSourcesEqual(token, t) + )?.data[tooltipFirstDataPoint.dataIndex] + return (
+ + {index > 0 && !!tooltipTotalValue && showTargets && ( + <> +

+ {formatPercentOf100( + (value / tooltipTotalValue) * 100 + )} + + {` (${ + typeof targetValue === 'number' + ? `${t('info.target')}: ${formatPercentOf100( + (targetValue / tooltipTotalValue) * 100 + )}` + : t('info.noTarget') + })`} +

+ + )}
) diff --git a/packages/stateful/components/dao/tabs/TreasuryTab.tsx b/packages/stateful/components/dao/tabs/TreasuryTab.tsx index 3c2b48b67..bc720d6bd 100644 --- a/packages/stateful/components/dao/tabs/TreasuryTab.tsx +++ b/packages/stateful/components/dao/tabs/TreasuryTab.tsx @@ -19,6 +19,7 @@ import { useNativeCommonGovernanceTokenInfoIfExists, } from '../../../voting-module-adapter' import { ButtonLink } from '../../ButtonLink' +import { IconButtonLink } from '../../IconButtonLink' import { LazyNftCard } from '../../nft' import { TreasuryHistoryGraph } from '../../TreasuryHistoryGraph' import { DaoFiatDepositModal } from '../DaoFiatDepositModal' @@ -70,13 +71,38 @@ export const TreasuryTab = () => { : [], }) + const configureRebalancerAction = useActionForKey( + ActionKey.ConfigureRebalancer + ) + const configureRebalancerActionDefaults = + configureRebalancerAction?.useDefaults() + const configureRebalancerPrefill = getDaoProposalSinglePrefill({ + actions: configureRebalancerAction + ? [ + { + actionKey: ActionKey.ConfigureRebalancer, + data: configureRebalancerActionDefaults, + }, + ] + : [], + }) + return ( ButtonLink={ButtonLink} FiatDepositModal={DaoFiatDepositModal} + IconButtonLink={IconButtonLink} NftCard={LazyNftCard} TokenLine={DaoTokenLine} TreasuryHistoryGraph={TreasuryHistoryGraph} + configureRebalancerHref={ + // Prefill URL only valid if action exists. + configureRebalancerAction + ? getDaoProposalPath(daoInfo.coreAddress, 'create', { + prefill: configureRebalancerPrefill, + }) + : undefined + } connected={isWalletConnected} createCrossChainAccountHref={ // Only show create cross-chain account button if we can use the action diff --git a/packages/stateful/components/gov/GovProposalVoter.tsx b/packages/stateful/components/gov/GovProposalVoter.tsx index 90ef6327b..92ca481c6 100644 --- a/packages/stateful/components/gov/GovProposalVoter.tsx +++ b/packages/stateful/components/gov/GovProposalVoter.tsx @@ -1,5 +1,5 @@ import { EncodeObject } from '@cosmjs/proto-signing' -import { useCallback, useRef, useState } from 'react' +import { useCallback, useState } from 'react' import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' import { useSetRecoilState } from 'recoil' @@ -10,6 +10,7 @@ import { ProposalVoter as StatelessProposalVoter, useChain, useGovProposalVoteOptions, + useUpdatingRef, } from '@dao-dao/stateless' import { GovProposalWithMetadata, ProposalVoterProps } from '@dao-dao/types' import { @@ -70,8 +71,7 @@ const InnerGovProposalVoter = ({ [setRefreshProposal] ) - const onVoteSuccessRef = useRef(onVoteSuccess) - onVoteSuccessRef.current = onVoteSuccess + const onVoteSuccessRef = useUpdatingRef(onVoteSuccess) const [castingVote, setCastingVote] = useState(false) const castVote = useCallback( @@ -114,6 +114,7 @@ const InnerGovProposalVoter = ({ [ getSigningStargateClient, isWalletConnected, + onVoteSuccessRef, proposalId, refreshProposal, t, diff --git a/packages/stateful/components/gov/NewGovProposal.tsx b/packages/stateful/components/gov/NewGovProposal.tsx index 4d0ee228a..0abed0e14 100644 --- a/packages/stateful/components/gov/NewGovProposal.tsx +++ b/packages/stateful/components/gov/NewGovProposal.tsx @@ -38,6 +38,7 @@ import { } from 'recoil' import { + accountsSelector, govProposalSelector, latestProposalSaveAtom, proposalCreatedCardPropsAtom, @@ -54,9 +55,11 @@ import { PageLoader, ProposalContentDisplay, Tooltip, + useCachedLoadingWithError, useConfiguredChainContext, useDaoNavHelpers, useHoldingKey, + useUpdatingRef, } from '@dao-dao/stateless' import { Action, @@ -84,6 +87,7 @@ import { getRpcForChainId, govProposalActionDataToDecodedContent, isCosmWasmStargateMsg, + makeEmptyUnifiedProfile, objectMatchesStructure, processError, transformIpfsUrlToHttpsIfNecessary, @@ -92,7 +96,7 @@ import { import { WalletActionsProvider, useActionOptions } from '../../actions' import { makeGovernanceProposalAction } from '../../actions/core/chain_governance/GovernanceProposal' -import { useEntity } from '../../hooks' +import { useEntity, useProfile } from '../../hooks' import { useWallet } from '../../hooks/useWallet' import { EntityDisplay } from '../EntityDisplay' import { GovProposalActionDisplay } from './GovProposalActionDisplay' @@ -113,6 +117,15 @@ export const NewGovProposal = (innerProps: NewGovProposalProps) => { const chainContext = useConfiguredChainContext() const { address: walletAddress = '' } = useWallet() + const { profile } = useProfile() + const accounts = useCachedLoadingWithError( + walletAddress + ? accountsSelector({ + chainId: chainContext.chainId, + address: walletAddress, + }) + : undefined + ) const governanceProposalAction = makeGovernanceProposalAction({ t, @@ -124,6 +137,10 @@ export const NewGovProposal = (innerProps: NewGovProposalProps) => { address: walletAddress, context: { type: ActionContextType.Wallet, + profile: profile.loading + ? makeEmptyUnifiedProfile(chainContext.chainId, walletAddress) + : profile.data, + accounts: accounts.loading || accounts.errored ? [] : accounts.data, }, })! const defaults = governanceProposalAction.useDefaults() @@ -204,7 +221,7 @@ export const NewGovProposal = (innerProps: NewGovProposalProps) => { loadFromPrefill() }, [router.query.prefill, router.query.pi, router.isReady, prefillChecked, t]) - return !defaults || !prefillChecked ? ( + return !defaults || accounts.loading || !prefillChecked ? ( ) : defaults instanceof Error ? ( @@ -548,12 +565,12 @@ const InnerNewGovProposal = ({ } const saveQueuedRef = useRef(false) - const saveLatestProposalRef = useRef(() => {}) - saveLatestProposalRef.current = () => + const saveLatestProposalRef = useUpdatingRef(() => setLatestProposalSave( // If created proposal, clear latest proposal save. proposalCreatedCardProps ? {} : cloneDeep(proposalData) ) + ) // Save latest data to atom and thus localStorage every second. useEffect(() => { @@ -573,7 +590,12 @@ const InnerNewGovProposal = ({ saveLatestProposalRef.current() saveQueuedRef.current = false }, 1000) - }, [proposalCreatedCardProps, setLatestProposalSave, proposalData]) + }, [ + proposalCreatedCardProps, + setLatestProposalSave, + proposalData, + saveLatestProposalRef, + ]) const [drafts, setDrafts] = useRecoilState( proposalDraftsAtom(localStorageKey) diff --git a/packages/stateful/components/pages/Account.tsx b/packages/stateful/components/pages/Account.tsx index dfecabe6d..b36a6a252 100644 --- a/packages/stateful/components/pages/Account.tsx +++ b/packages/stateful/components/pages/Account.tsx @@ -34,6 +34,7 @@ import { ButtonLink } from '../ButtonLink' import { PageHeaderContent } from '../PageHeaderContent' import { SuspenseLoader } from '../SuspenseLoader' import { AccountDaos } from './AccountDaos' +import { AccountWallet } from './AccountWallet' export const Account: NextPage = () => { const { t } = useTranslation() @@ -139,6 +140,7 @@ export const Account: NextPage = () => { { + const { query: { address } = {} } = useRouter() + + // Type-check. This should already be validated in the Wallet component. + if (typeof address !== 'string' || !address) { + throw new Error('Invalid address.') + } + + return +} diff --git a/packages/stateful/components/profile/ProfileWallet.tsx b/packages/stateful/components/profile/ProfileWallet.tsx index f38f48146..fde6d9e9b 100644 --- a/packages/stateful/components/profile/ProfileWallet.tsx +++ b/packages/stateful/components/profile/ProfileWallet.tsx @@ -9,13 +9,26 @@ import { ProfileWallet as StatelessProfileWallet, useCachedLoadingWithError, } from '@dao-dao/stateless' +import { ActionKey, StatefulProfileWalletProps } from '@dao-dao/types' +import { getActionBuilderPrefillPath } from '@dao-dao/utils' +import { useActionForKey } from '../../actions' import { useProfile } from '../../hooks' +import { ButtonLink } from '../ButtonLink' +import { IconButtonLink } from '../IconButtonLink' +import { TreasuryHistoryGraph } from '../TreasuryHistoryGraph' +import { WalletTokenLineReadonly } from '../wallet' import { WalletTokenLine } from '../wallet/WalletTokenLine' import { ProfileAddChains } from './ProfileAddChains' -export const ProfileWallet = () => { - const { chains, uniquePublicKeys } = useProfile() +export const ProfileWallet = ({ address }: StatefulProfileWalletProps = {}) => { + // Read-only if address is defined. + const readOnly = !!address + + const { chains, uniquePublicKeys } = useProfile({ + address, + }) + const accounts = useCachedLoadingWithError( chains.loading ? undefined @@ -61,12 +74,30 @@ export const ProfileWallet = () => { (chainLoadables) => chainLoadables.flatMap((l) => l.valueMaybe() || []) ) + const configureRebalancerActionDefaults = useActionForKey( + ActionKey.ConfigureRebalancer + )?.useDefaults() + return ( ) diff --git a/packages/stateful/components/wallet/WalletProvider.tsx b/packages/stateful/components/wallet/WalletProvider.tsx index 6189f48f8..d7959ad81 100644 --- a/packages/stateful/components/wallet/WalletProvider.tsx +++ b/packages/stateful/components/wallet/WalletProvider.tsx @@ -36,6 +36,7 @@ import { mountedInBrowserAtom, web3AuthPromptAtom, } from '@dao-dao/state/recoil' +import { useUpdatingRef } from '@dao-dao/stateless' import { CHAIN_ENDPOINTS, MAINNET, @@ -228,8 +229,7 @@ const InnerWalletProvider = ({ children }: PropsWithChildren<{}>) => { const previousChain = usePrevious(chain.chain_name) const previousConnected = usePrevious(isWalletConnected) const previousWalletName = usePrevious(wallet?.name) - const walletRepoRef = useRef(walletRepo) - walletRepoRef.current = walletRepo + const walletRepoRef = useUpdatingRef(walletRepo) const reconnectingRef = useRef(false) useEffect(() => { if ( @@ -253,6 +253,7 @@ const InnerWalletProvider = ({ children }: PropsWithChildren<{}>) => { previousChain, chain.chain_name, previousWalletName, + walletRepoRef, ]) // Refresh connection on wallet change. diff --git a/packages/stateful/feed/react/useFeed.ts b/packages/stateful/feed/react/useFeed.ts index abd0211be..e5fc8aa94 100644 --- a/packages/stateful/feed/react/useFeed.ts +++ b/packages/stateful/feed/react/useFeed.ts @@ -1,8 +1,8 @@ -import { useEffect, useMemo, useRef } from 'react' +import { useEffect, useMemo } from 'react' import { waitForAll } from 'recoil' import { lazyDaoCardPropsSelector } from '@dao-dao/state/recoil' -import { useCachedLoadable } from '@dao-dao/stateless' +import { useCachedLoadable, useUpdatingRef } from '@dao-dao/stateless' import { FeedDaoWithItems, FeedState } from '@dao-dao/types' import { getSources } from '../core' @@ -38,12 +38,11 @@ export const useFeed = (): FeedState => { // Update all sources once per minute. Memoize refresh function so that it // doesn't restart the interval when the ref changes. - const refreshRef = useRef(refresh) - refreshRef.current = refresh + const refreshRef = useUpdatingRef(refresh) useEffect(() => { const interval = setInterval(() => refreshRef.current(), 60 * 1000) return () => clearInterval(interval) - }, []) + }, [refreshRef]) // Sort and combine items from all sources. const { pendingItemCount, totalItemCount, sourceDaosWithItems } = diff --git a/packages/stateful/hooks/index.ts b/packages/stateful/hooks/index.ts index 3df2e6df2..1fe5ebd58 100644 --- a/packages/stateful/hooks/index.ts +++ b/packages/stateful/hooks/index.ts @@ -11,6 +11,7 @@ export * from './useDaoWithWalletSecretNetworkPermit' export * from './useEntity' export * from './useExecutedProposalTxLoadable' export * from './useFollowingDaos' +export * from './useGenerateInstantiate2' export * from './useGovDaoTabs' export * from './useInbox' export * from './useInboxApi' diff --git a/packages/stateful/hooks/useCreateCw1Whitelist.ts b/packages/stateful/hooks/useCreateCw1Whitelist.ts index bbc81472c..ce062a2df 100644 --- a/packages/stateful/hooks/useCreateCw1Whitelist.ts +++ b/packages/stateful/hooks/useCreateCw1Whitelist.ts @@ -1,7 +1,8 @@ -import { useCallback, useRef, useState } from 'react' +import { useCallback, useState } from 'react' import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' +import { useUpdatingRef } from '@dao-dao/stateless' import { CreateCw1Whitelist } from '@dao-dao/types' import { InstantiateMsg as Cw1WhitelistInstantiateMsg } from '@dao-dao/types/contracts/Cw1Whitelist' import { @@ -53,8 +54,7 @@ export const useCreateCw1Whitelist = ({ getSupportedChainConfig(chainId)?.codeIds?.Cw1Whitelist ?? -1 const [creatingCw1Whitelist, setCreatingCw1Whitelist] = useState(false) - const validationRef = useRef(validation) - validationRef.current = validation + const validationRef = useUpdatingRef(validation) const createCw1Whitelist: CreateCw1Whitelist = useCallback( async (admins: string[], mutable = false) => { try { @@ -105,6 +105,7 @@ export const useCreateCw1Whitelist = ({ cw1WhitelistCodeId, getSigningClient, t, + validationRef, walletAddress, ] ) diff --git a/packages/stateful/hooks/useFollowingDaos.ts b/packages/stateful/hooks/useFollowingDaos.ts index fcd669cd9..1f946cc1f 100644 --- a/packages/stateful/hooks/useFollowingDaos.ts +++ b/packages/stateful/hooks/useFollowingDaos.ts @@ -76,6 +76,8 @@ export const useFollowingDaos = (): UseFollowingDaosReturn => { 'Update Following' ) + // Turn this into a reference so we can use it in `setFollowing` without + // memoizing. const addChainsRef = useUpdatingRef(addChains) const setFollowing = useCallback( diff --git a/packages/stateful/hooks/useGenerateInstantiate2.ts b/packages/stateful/hooks/useGenerateInstantiate2.ts new file mode 100644 index 000000000..53f85cb97 --- /dev/null +++ b/packages/stateful/hooks/useGenerateInstantiate2.ts @@ -0,0 +1,41 @@ +import { instantiate2Address } from '@cosmjs/cosmwasm-stargate' +import { fromHex, toUtf8 } from '@cosmjs/encoding' + +import { codeDetailsSelector } from '@dao-dao/state/recoil' +import { useCachedLoadingWithError } from '@dao-dao/stateless' +import { LoadingDataWithError } from '@dao-dao/types' +import { getChainForChainId } from '@dao-dao/utils' + +export type UseGenerateInstantiate2Options = { + chainId: string + creator: string + codeId: number + salt: string +} + +/** + * This hook generates a predictable address for a contract. + */ +export const useGenerateInstantiate2 = ({ + chainId, + creator, + codeId, + salt, +}: UseGenerateInstantiate2Options): LoadingDataWithError => { + const chain = getChainForChainId(chainId) + + return useCachedLoadingWithError( + // Load checksum of the contract code. + codeDetailsSelector({ + chainId, + codeId, + }), + (data) => + instantiate2Address( + fromHex(data.checksum), + creator, + toUtf8(salt), + chain.bech32_prefix + ) + ) +} diff --git a/packages/stateful/hooks/useInstantiateAndExecute.ts b/packages/stateful/hooks/useInstantiateAndExecute.ts index a8f9e007c..294986f96 100644 --- a/packages/stateful/hooks/useInstantiateAndExecute.ts +++ b/packages/stateful/hooks/useInstantiateAndExecute.ts @@ -8,7 +8,7 @@ import { useTranslation } from 'react-i18next' import { v4 as uuidv4 } from 'uuid' import { codeDetailsSelector } from '@dao-dao/state/recoil' -import { useCachedLoadable } from '@dao-dao/stateless' +import { useCachedLoadingWithError } from '@dao-dao/stateless' import { Coin, UnifiedCosmosMsg, cwMsgToEncodeObject } from '@dao-dao/types' import { CHAIN_GAS_MULTIPLIER, @@ -61,18 +61,19 @@ export const useInstantiateAndExecute = ( }) // Load checksum of the contract code. - const codeDetailsLoadable = useCachedLoadable( + const checksum = useCachedLoadingWithError( chainId ? codeDetailsSelector({ chainId, codeId, }) - : undefined + : undefined, + (data) => fromHex(data.checksum) ) const instantiateAndExecute: InstantiateAndExecute = useCallback( async ({ instantiate, executes }) => { - if (codeDetailsLoadable.state !== 'hasValue') { + if (checksum.loading || checksum.errored) { throw new Error(t('error.loadingData')) } @@ -85,13 +86,11 @@ export const useInstantiateAndExecute = ( throw new Error('Secret Network does not support instantiate2.') } - // Get the checksum of the contract code. - const checksum = fromHex(codeDetailsLoadable.contents.checksum) // Random salt. const salt = uuidv4() const contractAddress = instantiate2Address( - checksum, + checksum.data, address, toUtf8(salt), chain.bech32_prefix @@ -136,11 +135,11 @@ export const useInstantiateAndExecute = ( response, } }, - [address, chain, codeDetailsLoadable, codeId, getSigningClient, t] + [address, chain, checksum, codeId, getSigningClient, t] ) return { - ready: codeDetailsLoadable.state === 'hasValue' && !!address, + ready: !checksum.loading && !checksum.errored && !!address, instantiateAndExecute, } } diff --git a/packages/stateful/hooks/useWallet.ts b/packages/stateful/hooks/useWallet.ts index 84f19be3e..8fad99b76 100644 --- a/packages/stateful/hooks/useWallet.ts +++ b/packages/stateful/hooks/useWallet.ts @@ -16,6 +16,7 @@ import { makeGetSignerOptions } from '@dao-dao/state/utils' import { useCachedLoading, useChainContextIfAvailable, + useUpdatingRef, } from '@dao-dao/stateless' import { LoadingData } from '@dao-dao/types' import { @@ -85,8 +86,7 @@ export const useWallet = ({ const _walletChain = useChain(chain.chain_name, false) // Memoize wallet chain since it changes every render. The hook above forces // re-render when address changes, so this is safe. - const walletChainRef = useRef(_walletChain) - walletChainRef.current = _walletChain + const walletChainRef = useUpdatingRef(_walletChain) // Chain of main wallet connection. const mainWalletChainId = useRecoilValue(walletChainIdAtom) @@ -97,8 +97,7 @@ export const useWallet = ({ const mainWalletConnected = !!mainWallet?.isWalletConnected // Memoize wallet chain since it changes every render. The hook above forces // re-render when address changes, so this is safe. - const mainWalletRef = useRef(mainWallet) - mainWalletRef.current = mainWallet + const mainWalletRef = useUpdatingRef(mainWallet) // Only attempt connection once per enable. const attemptedConnection = useRef(false) @@ -143,6 +142,7 @@ export const useWallet = ({ attemptConnection, connect, _walletChain.isWalletConnected, + mainWalletRef, ]) const [account, setAccount] = useState() @@ -185,6 +185,7 @@ export const useWallet = ({ }, [ account?.address, loadAccount, + walletChainRef, walletChainRef.current.address, walletChainRef.current.chain.chain_id, walletChainRef.current.status, diff --git a/packages/stateful/hooks/useWebSocket.ts b/packages/stateful/hooks/useWebSocket.ts index dc7fb618e..dbbc572f3 100644 --- a/packages/stateful/hooks/useWebSocket.ts +++ b/packages/stateful/hooks/useWebSocket.ts @@ -1,5 +1,5 @@ import { Channel } from 'pusher-js' -import { useCallback, useEffect, useRef, useState } from 'react' +import { useCallback, useEffect, useState } from 'react' import { constSelector, useRecoilValue, useSetRecoilState } from 'recoil' import { useDeepCompareMemoize } from 'use-deep-compare-effect' @@ -186,14 +186,12 @@ export const useOnWebSocketMessage = ( // Store listening in ref so the fallback function can access it within the // same instance of the function without re-rendering. - const listeningRef = useRef(listening) - listeningRef.current = listening + const listeningRef = useUpdatingRef(listening) // Create a memoized fallback function that calls the callback with the // fallback data after waiting a block. This is useful for ensuring the // callback gets executed when the WebSocket is misbehaving. - const defaultFallbackDataRef = useRef(defaultFallbackData) - defaultFallbackDataRef.current = defaultFallbackData + const defaultFallbackDataRef = useUpdatingRef(defaultFallbackData) const fallback: OnMessageFallback = useCallback( async (data, { skipWait = false, onlyIfNotListening = true } = {}) => { // Do nothing if we are already listening. @@ -209,7 +207,7 @@ export const useOnWebSocketMessage = ( callbackRef.current(data ?? defaultFallbackDataRef.current ?? {}, true) }, - [callbackRef] + [callbackRef, defaultFallbackDataRef, listeningRef] ) return { diff --git a/packages/stateless/components/RebalancerProjector.stories.tsx b/packages/stateless/components/RebalancerProjector.stories.tsx new file mode 100644 index 000000000..bec8f731a --- /dev/null +++ b/packages/stateless/components/RebalancerProjector.stories.tsx @@ -0,0 +1,50 @@ +import { ComponentMeta, ComponentStory } from '@storybook/react' + +import { RebalancerProjector } from './RebalancerProjector' + +export default { + title: 'DAO DAO / packages / stateless / components / RebalancerProjector', + component: RebalancerProjector, +} as ComponentMeta + +const Template: ComponentStory = (args) => ( + +) + +const numRebalances = 40 + +export const Default = Template.bind({}) +Default.args = { + pid: { + kp: 0.5, + ki: 0.2, + kd: 0.1, + interval: 1, + }, + assets: [ + { + symbol: 'NTRN', + initialAmount: 1250, + targetProportion: 5 / 8, + // Random disturbance. + prices: [...Array(numRebalances + 1)].reduce( + (acc) => [ + ...acc, + acc[acc.length - 1] * (1 + (Math.random() - 0.5) * 0.5), + ], + [0.4] + ), + }, + { + symbol: 'USDC', + initialAmount: 300, + targetProportion: 3 / 8, + // Constant at $1. + prices: [...Array(numRebalances + 1)].map(() => 1), + }, + ], + rebalanceTimestamps: [...Array(numRebalances)].map( + (_, index) => + new Date(new Date().getTime() - (numRebalances - index) * 1000) + ), +} diff --git a/packages/stateless/components/RebalancerProjector.tsx b/packages/stateless/components/RebalancerProjector.tsx new file mode 100644 index 000000000..6e5540cc6 --- /dev/null +++ b/packages/stateless/components/RebalancerProjector.tsx @@ -0,0 +1,241 @@ +import { + CategoryScale, + ChartDataset, + Chart as ChartJS, + Legend, + LineElement, + LinearScale, + PointElement, + ScatterDataPoint, + Title, + Tooltip, +} from 'chart.js' +import clsx from 'clsx' +import Controller from 'node-pid-controller' +import { useState } from 'react' +import { Line } from 'react-chartjs-2' +import useDeepCompareEffect from 'use-deep-compare-effect' + +import { DISTRIBUTION_COLORS, formatDate } from '@dao-dao/utils' + +import { useUpdatingRef } from '../hooks' +import { useNamedThemeColor } from '../theme' + +ChartJS.register( + CategoryScale, + LinearScale, + PointElement, + LineElement, + Title, + Tooltip, + Legend +) + +export type RebalancerProjectorAsset = { + symbol: string + initialAmount: number + targetProportion: number + // $ per 1 unit of asset. Each item is the price at each point in time when a + // rebalance occurs. The length should be `rebalanceTimestamps.length + 1` so + // that this includes the initial balance. + prices: number[] +} + +export type RebalancerProjectorProps = { + pid: { + kp: number + ki: number + kd: number + // Seconds between each rebalance. + interval: number + } + assets: RebalancerProjectorAsset[] + // When to rebalance. There should be one fewer rebalance timestamps than + // prices for each asset, since the initial price is included. + rebalanceTimestamps: Date[] + className?: string +} + +export const RebalancerProjector = ({ + pid: { kp, ki, kd, interval }, + assets, + rebalanceTimestamps, + className, +}: RebalancerProjectorProps) => { + const textColor = useNamedThemeColor('text-tertiary') + const borderColor = useNamedThemeColor('border-primary') + + const [datasets, setDatasets] = useState< + ChartDataset<'line', (number | ScatterDataPoint | null)[]>[] + >([]) + + const numRebalances = rebalanceTimestamps.length + const makeProjections = () => { + // The PID controller for each asset. + const controllers = [...Array(assets.length)].map( + () => + new Controller({ + k_p: kp, + k_i: ki, + k_d: kd, + dt: interval, + }) + ) + + // Each projection is a list of all assets' amount and price after each + // rebalance. + const projections = [...Array(numRebalances)].reduce( + ( + acc: { + amount: number + price: number + }[][], + _, + rebalanceIndex + ) => { + const lastProjection = acc[acc.length - 1] + + // Update the price for each asset. + const newProjection = assets.map(({ prices }, index) => ({ + amount: lastProjection[index].amount, + price: prices[rebalanceIndex + 1], + })) + + // Get total value of assets based on new prices. + const totalValue = newProjection.reduce( + (acc, { amount, price }) => acc + amount * price, + 0 + ) + + // TODO(rebalancer): Contrain buy amounts to only how much we are able + // to sell of other assets. Just like the sell amount is bounded by 0 on + // the bottom, we need to bound the buy amount by the total value not + // already sold of other assets. + + // Use PID controller with new values to rebalance amounts. + assets.forEach(({ targetProportion }, index) => { + const controller = controllers[index] + const { amount: lastAmount, price } = newProjection[index] + + const targetValue = targetProportion * totalValue + controller.setTarget(targetValue) + + const currentValue = lastAmount * price + // Rebalance with PID. + const rebalanceValue = controller.update(currentValue) + // Cannot sell more than we have. + const newAmount = Math.max(0, lastAmount + rebalanceValue / price) + + // Update projection amount. + newProjection[index].amount = newAmount + }) + + return [...acc, newProjection] + }, + [ + // Start with initial amount and price for each asset. + assets.map(({ initialAmount, prices }) => ({ + amount: initialAmount, + price: prices[0], + })), + ] + ) + + setDatasets( + [ + ...assets.map( + ( + { symbol }, + assetIndex + ): ChartDataset<'line', (number | ScatterDataPoint | null)[]> => ({ + label: `${symbol} Value`, + data: projections.map( + (projection) => + projection[assetIndex].amount * projection[assetIndex].price + ), + }) + ), + // // Total + // { + // label: 'Total Value', + // data: projections.map((projection) => + // projection.reduce( + // (acc, { amount, price }) => acc + amount * price, + // 0 + // ) + // ), + // }, + ].map((p, index) => ({ + ...p, + borderColor: DISTRIBUTION_COLORS[index % DISTRIBUTION_COLORS.length], + backgroundColor: + DISTRIBUTION_COLORS[index % DISTRIBUTION_COLORS.length], + })) + ) + } + const makeProjectionsRef = useUpdatingRef(makeProjections) + + // When any projection info changes... + useDeepCompareEffect(() => { + makeProjectionsRef.current() + }, [kp, ki, kd, interval, assets, numRebalances]) + + return ( +
+ formatDate(t))], + datasets, + }} + options={{ + responsive: true, + maintainAspectRatio: false, + // Disable all events (hover, tooltip, etc.) + events: [], + animation: false, + elements: { + point: { + radius: 0, + }, + }, + plugins: { + title: { + display: false, + }, + tooltip: { + // Show all x-axis values in one tooltip. + mode: 'index', + }, + }, + scales: { + x: { + display: true, + ticks: { + color: textColor, + }, + grid: { + color: borderColor, + tickColor: 'transparent', + }, + }, + y: { + display: true, + title: { + text: 'Est. USD Value', + display: true, + color: textColor, + }, + ticks: { + color: textColor, + }, + grid: { + color: borderColor, + tickColor: 'transparent', + }, + }, + }, + }} + /> +
+ ) +} diff --git a/packages/stateless/components/ValenceAccountDisplay.tsx b/packages/stateless/components/ValenceAccountDisplay.tsx new file mode 100644 index 000000000..9621d0581 --- /dev/null +++ b/packages/stateless/components/ValenceAccountDisplay.tsx @@ -0,0 +1,164 @@ +import { Build } from '@mui/icons-material' +import { useState } from 'react' +import { useTranslation } from 'react-i18next' + +import { TokenCardInfo, ValenceAccountDisplayProps } from '@dao-dao/types' +import { serializeTokenSource } from '@dao-dao/utils' + +import { ErrorPage } from './error' +import { Loader } from './logo' +import { TokenLineHeader } from './token' +import { Tooltip, TooltipInfoIcon } from './tooltip' + +export const ValenceAccountDisplay = ({ + account, + tokens, + TokenLine, + TreasuryHistoryGraph, + ButtonLink, + IconButtonLink, + configureRebalancerHref, + className, +}: ValenceAccountDisplayProps) => { + const { t } = useTranslation() + + const valenceAccountRebalancerTargets = + account.config?.rebalancer?.targets.map(({ token }) => + serializeTokenSource(token) + ) || [] + + // Maps serialized token source to color. + const [tokenSourceColorMap, setTokenSourceColorMap] = useState< + Record + >({}) + + // Rebalanced tokens + const rebalancedTokens = + tokens.loading || tokens.errored + ? [] + : tokens.data.filter(({ token }) => + valenceAccountRebalancerTargets.includes(serializeTokenSource(token)) + ) + // Other tokens + const otherTokens = + tokens.loading || tokens.errored + ? [] + : tokens.data.filter((token) => !rebalancedTokens.includes(token)) + + return ( +
+
+
+

{t('title.rebalancer')}

+ + +
+ + {!!configureRebalancerHref && ( + + + + )} +
+ +
+ {tokens.loading || + (!tokens.errored && tokens.updating && tokens.data.length === 0) ? ( + + ) : tokens.errored ? ( + +
+              {tokens.error instanceof Error
+                ? tokens.error.message
+                : `${tokens.error}`}
+            
+
+ ) : ( + tokens.data.length > 0 && ( + <> + {account.config.rebalancer && ( + + )} + +
+ {account.config.rebalancer && ( + <> + + + {rebalancedTokens.map((props, index) => ( + + ))} + + {otherTokens.length > 0 && ( + <> +
+ +

+ {t('title.nonRebalancedTokens')} +

+ + )} + + )} + + {otherTokens.length > 0 && ( + + )} + + {otherTokens.map((props, index) => ( + + ))} + + {!!configureRebalancerHref && !account.config.rebalancer && ( + + {t('button.setUpRebalancer')} + + )} +
+ + ) + )} +
+
+ ) +} diff --git a/packages/stateless/components/ValenceAccountsSection.tsx b/packages/stateless/components/ValenceAccountsSection.tsx new file mode 100644 index 000000000..0cd180c53 --- /dev/null +++ b/packages/stateless/components/ValenceAccountsSection.tsx @@ -0,0 +1,62 @@ +import clsx from 'clsx' + +import { + LoadingDataWithError, + TokenCardInfo, + ValenceAccount, + ValenceAccountDisplayProps, +} from '@dao-dao/types' +import { areAccountsEqual } from '@dao-dao/utils' + +import { ValenceAccountDisplay } from './ValenceAccountDisplay' + +export type ValenceAccountsSectionProps = { + /** + * The accounts to display. + */ + accounts: ValenceAccount[] + /** + * The tokens to display. + */ + tokens: LoadingDataWithError + /** + * Optional container class name. + */ + className?: string +} & Pick< + ValenceAccountDisplayProps, + | 'ButtonLink' + | 'IconButtonLink' + | 'TokenLine' + | 'TreasuryHistoryGraph' + | 'configureRebalancerHref' +> + +export const ValenceAccountsSection = ({ + accounts, + tokens, + className, + ...valenceAccountDisplayProps +}: ValenceAccountsSectionProps) => ( +
+ {accounts.map((account) => ( + + areAccountsEqual(owner, account) + ), + } + } + /> + ))} +
+) diff --git a/packages/stateless/components/actions/ActionLibrary.tsx b/packages/stateless/components/actions/ActionLibrary.tsx index b5db31c0c..36b51bc66 100644 --- a/packages/stateless/components/actions/ActionLibrary.tsx +++ b/packages/stateless/components/actions/ActionLibrary.tsx @@ -1,4 +1,4 @@ -import { Star } from '@mui/icons-material' +import { Star, WarningRounded } from '@mui/icons-material' import clsx from 'clsx' import Fuse from 'fuse.js' import cloneDeep from 'lodash.clonedeep' @@ -16,11 +16,12 @@ import { LoadedActions, } from '@dao-dao/types' -import { useSearchFilter } from '../../hooks' +import { useSearchFilter, useUpdatingRef } from '../../hooks' import { Button } from '../buttons' import { Collapsible } from '../Collapsible' import { SearchBar } from '../inputs' import { Loader } from '../logo' +import { NoContent } from '../NoContent' import { TooltipInfoIcon } from '../tooltip' export type ActionLibraryProps = { @@ -61,8 +62,7 @@ export const ActionLibrary = ({ }) const actionData = watch(actionDataFieldName as 'actionData') || [] - const onSelectRef = useRef(onSelect) - onSelectRef.current = onSelect + const onSelectRef = useUpdatingRef(onSelect) const onSelectAction = useCallback( (action: Action) => { const loadedAction = loadedActions[action.key] @@ -83,7 +83,7 @@ export const ActionLibrary = ({ data: cloneDeep(loadedAction.defaults ?? {}), }) }, - [addAction, loadedActions] + [addAction, loadedActions, onSelectRef] ) const [_categoryKeySelected, setCategoryKeySelected] = useState< @@ -303,49 +303,58 @@ export const ActionLibrary = ({
-
- {showingActions.map((action, index) => ( - - ))} -
+ {showingActions.length > 0 ? ( +
+ {showingActions.map((action, index) => ( + + ))} +
+ ) : ( + + )}
) diff --git a/packages/stateless/components/actions/NativeCoinSelector.tsx b/packages/stateless/components/actions/NativeCoinSelector.tsx index 0ecb296c2..76cd48da2 100644 --- a/packages/stateless/components/actions/NativeCoinSelector.tsx +++ b/packages/stateless/components/actions/NativeCoinSelector.tsx @@ -30,6 +30,7 @@ export type NativeCoinSelectorProps = Pick< onRemove?: () => void className?: string dontValidate?: boolean + min?: number } export const NativeCoinSelector = ({ @@ -41,6 +42,7 @@ export const NativeCoinSelector = ({ className, chainId, dontValidate = false, + min, }: NativeCoinSelectorProps) => { const { t } = useTranslation() const nativeToken = getNativeTokenForChainId(chainId) @@ -149,10 +151,11 @@ export const NativeCoinSelector = ({ dontValidate, ]) - const minAmount = convertMicroDenomToDenomWithDecimals( + const minUnit = convertMicroDenomToDenomWithDecimals( 1, selectedTokenBalance?.token?.decimals ?? nativeToken.decimals ) + const minAmount = min ?? minUnit return (
@@ -165,7 +168,7 @@ export const NativeCoinSelector = ({ fieldName: fieldNamePrefix + 'amount', error: errors?.amount || errors?._error, min: minAmount, - step: minAmount, + step: minUnit, max: dontValidate ? undefined : selectedTokenBalance && @@ -195,7 +198,7 @@ export const NativeCoinSelector = ({ } /> - {isCreating && ( + {isCreating && onRemove && ( = { connected: boolean @@ -43,11 +46,17 @@ export type TreasuryTabProps = { * created. */ createCrossChainAccountHref: string | undefined + /** + * Configure rebalancer proposal prefill URL. If undefined, this means the + * action cannot be used. + */ + configureRebalancerHref: string | undefined FiatDepositModal: ComponentType TreasuryHistoryGraph: ComponentType TokenLine: ComponentType NftCard: ComponentType ButtonLink: ComponentType + IconButtonLink: ComponentType } export const TreasuryTab = ({ @@ -55,11 +64,13 @@ export const TreasuryTab = ({ tokens, nfts, createCrossChainAccountHref, + configureRebalancerHref, FiatDepositModal, TreasuryHistoryGraph, TokenLine, NftCard, ButtonLink, + IconButtonLink, }: TreasuryTabProps) => { const { t } = useTranslation() const { @@ -68,9 +79,14 @@ export const TreasuryTab = ({ const { chainId: daoChainId, coreAddress, accounts } = useDaoInfoContext() // Combine chain tokens into loadable, lazily. Load all that are ready. - const allTokens = useMemo((): LoadingDataWithError => { + const { nonValenceTokens, valenceTokens } = useMemo((): { + nonValenceTokens: LoadingDataWithError + valenceTokens: LoadingDataWithError + } => { const chainTokens = Object.values(tokens) - return chainTokens.every((l) => l?.loading) + const allTokens: LoadingDataWithError = chainTokens.every( + (l) => l?.loading + ) ? { loading: true, errored: false, @@ -94,6 +110,29 @@ export const TreasuryTab = ({ l && !l.loading && !l.errored ? l.data : [] ), } + + return { + nonValenceTokens: + allTokens.loading || allTokens.errored + ? allTokens + : { + // Filter out any valence account tokens. + ...allTokens, + data: allTokens.data.filter( + ({ owner }) => owner.type !== AccountType.Valence + ), + }, + valenceTokens: + allTokens.loading || allTokens.errored + ? allTokens + : { + // Keep only valence account tokens. + ...allTokens, + data: allTokens.data.filter( + ({ owner }) => owner.type === AccountType.Valence + ), + }, + } }, [tokens]) // Combine chain tokens into loadable, lazily. Load all that are ready. @@ -147,10 +186,17 @@ export const TreasuryTab = ({ sortedData: sortedTokens, buttonPopupProps: sortTokenButtonPopupProps, } = useButtonPopupSorter({ - data: allTokens.loading || allTokens.errored ? undefined : allTokens.data, + data: + nonValenceTokens.loading || nonValenceTokens.errored + ? undefined + : nonValenceTokens.data, options: tokenSortOptions, }) + const valenceAccounts = accounts.filter( + (a): a is ValenceAccount => a.type === AccountType.Valence + ) + return ( <> {/* header min-height of 3.5rem standardized across all tabs */} @@ -210,7 +256,7 @@ export const TreasuryTab = ({ @@ -233,13 +279,13 @@ export const TreasuryTab = ({
- {allTokens.loading ? ( + {nonValenceTokens.loading ? (
- ) : allTokens.errored ? ( - + ) : nonValenceTokens.errored ? ( + ) : (
@@ -297,6 +343,19 @@ export const TreasuryTab = ({ ) )} + {valenceAccounts.length > 0 && ( + + )} + {/* OmniFlix Hub NFTs are not yet supported. */} {currentChainId !== ChainId.OmniflixHubMainnet && ( diff --git a/packages/stateless/components/index.ts b/packages/stateless/components/index.ts index 2a0ad2a68..e571bfcc5 100644 --- a/packages/stateless/components/index.ts +++ b/packages/stateless/components/index.ts @@ -46,11 +46,14 @@ export * from './Notifications' export * from './OptionCard' export * from './Pagination' export * from './PayEntityDisplay' +export * from './RebalancerProjector' export * from './StatusCard' export * from './StatusDisplay' export * from './SteppedWalkthrough' export * from './TabBar' export * from './Table' export * from './TokenSwapStatus' +export * from './ValenceAccountDisplay' +export * from './ValenceAccountsSection' export * from './ValidatorPicker' export * from './VotingPowerDistribution' diff --git a/packages/stateless/components/inputs/TokenInput.tsx b/packages/stateless/components/inputs/TokenInput.tsx index 2e9d10883..46c6123c2 100644 --- a/packages/stateless/components/inputs/TokenInput.tsx +++ b/packages/stateless/components/inputs/TokenInput.tsx @@ -38,6 +38,7 @@ export const TokenInput = < // use-cases exist for this component, so the token selection is left up to // the caller instead of being handled internally like the amount field. tokens, + hideTokens, onSelectToken, selectedToken: _selectedToken, // Fallback when no token is selected. If nothing is provided, a placeholder @@ -198,23 +199,30 @@ export const TokenInput = < items={ tokens.loading ? [] - : tokens.data.map((token, index) => ({ - key: index + token.denomOrAddress, - label: token.symbol, - iconUrl: transformIpfsUrlToHttpsIfNecessary( - token.imageUrl || getFallbackImage(token.denomOrAddress) - ), - ...token, - rightNode: ( -

- {allTokensOnSameChain - ? token.denomOrAddress - : getDisplayNameForChainId(token.chainId)} -

- ), - iconClassName: '!h-8 !w-8', - contentContainerClassName: '!gap-3', - })) + : tokens.data + .filter( + (token) => + !hideTokens?.some((hidden) => + tokensEqual(hidden, token) + ) + ) + .map((token, index) => ({ + key: index + token.denomOrAddress, + label: token.symbol, + iconUrl: transformIpfsUrlToHttpsIfNecessary( + token.imageUrl || getFallbackImage(token.denomOrAddress) + ), + ...token, + rightNode: ( +

+ {allTokensOnSameChain + ? token.denomOrAddress + : getDisplayNameForChainId(token.chainId)} +

+ ), + iconClassName: '!h-8 !w-8', + contentContainerClassName: '!gap-3', + })) } onSelect={(token) => onSelectToken(token as T)} searchPlaceholder={t('info.searchForToken')} diff --git a/packages/stateless/components/modals/InboxSettingsModal.tsx b/packages/stateless/components/modals/InboxSettingsModal.tsx index c62319fbe..627d8704e 100644 --- a/packages/stateless/components/modals/InboxSettingsModal.tsx +++ b/packages/stateless/components/modals/InboxSettingsModal.tsx @@ -21,6 +21,7 @@ import { } from '@dao-dao/types' import { validateEmail } from '@dao-dao/utils' +import { useUpdatingRef } from '../../hooks' import { Button } from '../buttons' import { IconButton } from '../icon_buttons' import { Checkbox, InputLabel, Switch, TextInput } from '../inputs' @@ -79,8 +80,7 @@ export const InboxSettingsModal = ({ const loadingRef = useRef(false) const routerPush = router.push // Memoize so we only load config once. - const loadConfigRef = useRef(loadConfig) - loadConfigRef.current = loadConfig + const loadConfigRef = useUpdatingRef(loadConfig) useEffect(() => { ;(async () => { @@ -97,7 +97,7 @@ export const InboxSettingsModal = ({ } } })() - }, [props.visible, config, routerPush, t]) + }, [props.visible, config, routerPush, t, loadConfigRef]) // Once config is loaded, populate form with config values. useEffect(() => { diff --git a/packages/stateless/components/popup/FilterableItemPopup.tsx b/packages/stateless/components/popup/FilterableItemPopup.tsx index bfebdc4cf..28f59c5e6 100644 --- a/packages/stateless/components/popup/FilterableItemPopup.tsx +++ b/packages/stateless/components/popup/FilterableItemPopup.tsx @@ -15,7 +15,7 @@ import { useTranslation } from 'react-i18next' import { PopupTrigger } from '@dao-dao/types' -import { useSearchFilter } from '../../hooks' +import { useSearchFilter, useUpdatingRef } from '../../hooks' import { Button } from '../buttons/Button' import { SearchBar } from '../inputs/SearchBar' import { Modal } from '../modals' @@ -102,8 +102,7 @@ export const FilterableItemPopup = ({ }, [selectedIndex]) // Memoize reference so that it doesn't change on every render. - const onSelectRef = useRef(onSelect) - onSelectRef.current = onSelect + const onSelectRef = useUpdatingRef(onSelect) const onSelectItem = useCallback( (item: T, originalIndex: number) => { @@ -113,7 +112,7 @@ export const FilterableItemPopup = ({ setOpen(false) } }, - [closeOnSelect, setOpen] + [closeOnSelect, onSelectRef, setOpen] ) const handleKeyPress = useCallback( diff --git a/packages/stateless/components/profile/ProfileWallet.stories.tsx b/packages/stateless/components/profile/ProfileWallet.stories.tsx index 34d20cf06..02ade770f 100644 --- a/packages/stateless/components/profile/ProfileWallet.stories.tsx +++ b/packages/stateless/components/profile/ProfileWallet.stories.tsx @@ -3,6 +3,8 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' import { ProfileAddChains, WalletTokenLine } from '@dao-dao/stateful' import { TokenCardProps } from '@dao-dao/types' +import { ButtonLink } from '../buttons' +import { IconButtonLink } from '../icon_buttons' import { makeProps as makeTokenCardProps } from '../token/TokenCard.stories' import { ProfileWallet } from './ProfileWallet' @@ -34,6 +36,8 @@ Default.args = { }, TokenLine: WalletTokenLine, ProfileAddChains, + ButtonLink, + IconButtonLink, } export const Loading = Template.bind({}) @@ -52,4 +56,6 @@ Loading.args = { }, TokenLine: WalletTokenLine, ProfileAddChains, + ButtonLink, + IconButtonLink, } diff --git a/packages/stateless/components/profile/ProfileWallet.tsx b/packages/stateless/components/profile/ProfileWallet.tsx index e527be8ac..2eb884ecd 100644 --- a/packages/stateless/components/profile/ProfileWallet.tsx +++ b/packages/stateless/components/profile/ProfileWallet.tsx @@ -4,8 +4,14 @@ import { useState } from 'react' import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' -import { ProfileWalletProps, TokenCardInfo } from '@dao-dao/types' import { + AccountType, + ProfileWalletProps, + TokenCardInfo, + ValenceAccount, +} from '@dao-dao/types' +import { + areAccountsEqual, concatAddressStartEnd, getDisplayNameForChainId, getImageUrlForChainId, @@ -19,23 +25,40 @@ import { LineLoaders } from '../LineLoader' import { NoContent } from '../NoContent' import { FilterableItemPopup } from '../popup' import { TokenLineHeader } from '../token/TokenLineHeader' +import { ValenceAccountDisplay } from '../ValenceAccountDisplay' export const ProfileWallet = ({ + readOnly, accounts, tokens, hiddenTokens, TokenLine, ProfileAddChains, + ...valenceAccountTreasuryProps }: ProfileWalletProps) => { const { t } = useTranslation() + const valenceAccounts = + accounts.loading || accounts.errored + ? [] + : accounts.data.filter( + (account): account is ValenceAccount => + account.type === AccountType.Valence + ) + // Separate valence from non-valence account tokens and display valence + // separately. + const nonValenceTokens = + tokens.loading || tokens.errored + ? [] + : tokens.data.filter(({ owner }) => owner.type !== AccountType.Valence) + const visibleBalances = tokens.loading || tokens.errored || hiddenTokens.loading || hiddenTokens.errored ? [] - : tokens.data + : nonValenceTokens .filter( ({ token }) => !hiddenTokens.data.includes(token.denomOrAddress) ) @@ -46,7 +69,7 @@ export const ProfileWallet = ({ hiddenTokens.loading || hiddenTokens.errored ? [] - : tokens.data + : nonValenceTokens .filter(({ token }) => hiddenTokens.data.includes(token.denomOrAddress) ) @@ -114,7 +137,7 @@ export const ProfileWallet = ({
{tokens.loading || hiddenTokens.loading || - (!tokens.errored && tokens.data.length > 0) ? ( + (!tokens.errored && nonValenceTokens.length > 0) ? (
@@ -142,7 +165,7 @@ export const ProfileWallet = ({ )} - {hiddenBalances.length > 0 && ( + {hiddenBalances.length > 0 && !readOnly && (
({ )}
- + {!readOnly && ( + + )} + + {/* Valence Accounts */} + {valenceAccounts.map((account) => ( + + {...valenceAccountTreasuryProps} + key={account.address} + TokenLine={TokenLine} + account={account} + className="mt-6" + tokens={ + tokens.loading || tokens.errored + ? tokens + : { + loading: false, + errored: false, + updating: tokens.updating, + data: tokens.data.filter(({ owner }) => + areAccountsEqual(owner, account) + ), + } + } + /> + ))}
) } diff --git a/packages/stateless/components/token/TokenLineHeader.tsx b/packages/stateless/components/token/TokenLineHeader.tsx index 0e43df6db..1b73075c4 100644 --- a/packages/stateless/components/token/TokenLineHeader.tsx +++ b/packages/stateless/components/token/TokenLineHeader.tsx @@ -1,12 +1,25 @@ +import clsx from 'clsx' import { useTranslation } from 'react-i18next' import { TooltipInfoIcon } from '../tooltip/TooltipInfoIcon' -export const TokenLineHeader = () => { +export type TokenLineHeaderProps = { + /** + * Optional container class name. + */ + className?: string +} + +export const TokenLineHeader = ({ className }: TokenLineHeaderProps) => { const { t } = useTranslation() return ( -
+

{t('title.token')}

{t('title.total')}

diff --git a/packages/stateless/hooks/useCachedLoadable.ts b/packages/stateless/hooks/useCachedLoadable.ts index 445c0ea22..8d75507b1 100644 --- a/packages/stateless/hooks/useCachedLoadable.ts +++ b/packages/stateless/hooks/useCachedLoadable.ts @@ -1,4 +1,4 @@ -import { useEffect, useMemo, useRef, useState } from 'react' +import { useEffect, useMemo, useState } from 'react' import { RecoilValue, constSelector, useRecoilValueLoadable } from 'recoil' import { useDeepCompareMemoize } from 'use-deep-compare-effect' @@ -61,8 +61,7 @@ export const useCachedLoadable = ( const [updating, setUpdating] = useState(loadableLoadingOrNotReady) // Store the last cached key for use in the effect below. - const lastCachedKey = useRef(cachedKey) - lastCachedKey.current = cachedKey + const lastCachedKey = useUpdatingRef(cachedKey) useEffect(() => { if (loadableLoadingOrNotReady) { @@ -106,7 +105,7 @@ export const useCachedLoadable = ( setUpdating(false) setCachedKey(recoilValue?.key) } - }, [loadable, loadableLoadingOrNotReady, recoilValue]) + }, [lastCachedKey, loadable, loadableLoadingOrNotReady, recoilValue]) // Memoize the loadable so it can be used in `useEffect` dependencies to // prevent causing infinite loops. If this is not memoized, it will change on diff --git a/packages/stateless/hooks/useInfiniteScroll.ts b/packages/stateless/hooks/useInfiniteScroll.ts index a9515e1f5..8625cc209 100644 --- a/packages/stateless/hooks/useInfiniteScroll.ts +++ b/packages/stateless/hooks/useInfiniteScroll.ts @@ -64,6 +64,7 @@ export const useInfiniteScroll = ({ } }, [element, _element]) + // Memoize loadMore in case it changes between renders. const loadMoreRef = useUpdatingRef(loadMore) useEffect(() => { diff --git a/packages/stateless/hooks/useSearchFilter.ts b/packages/stateless/hooks/useSearchFilter.ts index 9284d61c4..bd6d2621b 100644 --- a/packages/stateless/hooks/useSearchFilter.ts +++ b/packages/stateless/hooks/useSearchFilter.ts @@ -12,6 +12,7 @@ import { import { SearchBarProps } from '../components' import { useQuerySyncedState } from './useQuerySyncedState' +import { useUpdatingRef } from './useUpdatingRef' export type UseSearchFilterOptions = { /** @@ -122,15 +123,14 @@ export const useSearchFilter = ({ } }, [fuse, filter, data]) - const onFilterChangeRef = useRef(onFilterChange) - onFilterChangeRef.current = onFilterChange + const onFilterChangeRef = useUpdatingRef(onFilterChange) const onChange: ChangeEventHandler = useCallback( (event) => { const filter = event.target.value setFilter(filter) onFilterChangeRef.current?.(filter) }, - [setFilter] + [onFilterChangeRef, setFilter] ) return { diff --git a/packages/stateless/hooks/useTrackDropdown.ts b/packages/stateless/hooks/useTrackDropdown.ts index b209f6502..70f8d2042 100644 --- a/packages/stateless/hooks/useTrackDropdown.ts +++ b/packages/stateless/hooks/useTrackDropdown.ts @@ -1,5 +1,7 @@ import { useCallback, useEffect, useRef, useState } from 'react' +import { useUpdatingRef } from './useUpdatingRef' + // Pass `null` to left, right, or width to skip setting that property. export type UseTrackDropdownOptions = { // Default: rect.bottom @@ -99,22 +101,23 @@ export const useTrackDropdown = ({ } // Memoize ref to prevent listener from resetting on every render. - const updateRectRef = useRef(updateRect) - updateRectRef.current = updateRect + const updateRectRef = useUpdatingRef(updateRect) // Update the rect of the element on window scroll and resize. useEffect(() => { + const updateRect = updateRectRef.current + // The third argument set to `true` makes the event fire when any scroll // event happens, not just when the window is scrolled. The actual // scrollable container is some parent element. - window.addEventListener('scroll', updateRectRef.current, true) - // window.addEventListener('resize', updateRectRef.current, true) + window.addEventListener('scroll', updateRect, true) + // window.addEventListener('resize', updateRect, true) return () => { - window.removeEventListener('scroll', updateRectRef.current) - // window.removeEventListener('resize', updateRectRef.current) + window.removeEventListener('scroll', updateRect) + // window.removeEventListener('resize', updateRect) } - }, []) + }, [updateRectRef]) // Trigger state change when elements are set so the effects run. const [dropdownReady, setDropdownReady] = useState(false) @@ -125,7 +128,7 @@ export const useTrackDropdown = ({ if (dropdownReady && trackReady) { updateRectRef.current() } - }, [dropdownReady, trackReady]) + }, [dropdownReady, trackReady, updateRectRef]) // Use a ResizeObserver to update the rect when the element changes size. useEffect(() => { @@ -143,7 +146,7 @@ export const useTrackDropdown = ({ observer.disconnect() clearInterval(timer) } - }, [trackReady]) + }, [trackReady, updateRectRef]) // Use a callback ref so we can trigger a state change to update. const onDropdownRef = useCallback((element: HTMLDivElement | null) => { diff --git a/packages/stateless/package.json b/packages/stateless/package.json index e538a4adc..08e6921a9 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -27,6 +27,7 @@ "date-fns": "^2.30.0", "fuse.js": "^6.6.2", "lodash.clonedeep": "^4.5.0", + "node-pid-controller": "^1.0.1", "react-chartjs-2": "^5.2.0", "react-codemirror2": "^7.2.1", "react-confetti": "^6.1.0", diff --git a/packages/stateless/pages/Account.tsx b/packages/stateless/pages/Account.tsx index 7e0268a17..9b219d8a7 100644 --- a/packages/stateless/pages/Account.tsx +++ b/packages/stateless/pages/Account.tsx @@ -1,4 +1,4 @@ -import { GroupRounded } from '@mui/icons-material' +import { GroupRounded, WalletRounded } from '@mui/icons-material' import { useRouter } from 'next/router' import { ComponentType, useEffect } from 'react' import { useTranslation } from 'react-i18next' @@ -25,6 +25,7 @@ export type AccountProps = { address: string hexPublicKey: LoadingDataWithError AccountDaos: ComponentType + AccountWallet: ComponentType SuspenseLoader: ComponentType ButtonLink: ComponentType } & Pick @@ -33,6 +34,7 @@ export const Account = ({ address, hexPublicKey, AccountDaos, + AccountWallet, SuspenseLoader, ButtonLink, ...headerProps @@ -47,6 +49,12 @@ export const Account = ({ Icon: GroupRounded, Component: AccountDaos, }, + { + id: AccountTabId.Wallet, + label: t('title.wallet'), + Icon: WalletRounded, + Component: AccountWallet, + }, ] // Pre-fetch tabs. diff --git a/packages/types/account.ts b/packages/types/account.ts index 42dc6490c..1d3c72bb8 100644 --- a/packages/types/account.ts +++ b/packages/types/account.ts @@ -2,13 +2,14 @@ import { ComponentType } from 'react' import { ActionKeyAndData } from './actions' import { Threshold } from './contracts/DaoProposalSingle.common' +import { ParsedTarget, RebalancerConfig } from './contracts/ValenceRebalancer' +import { GenericToken } from './token' /** * The type of account given whatever the relevant context is. */ export enum AccountType { /** - * Wallet/smart contract/module address on the current chain given the * context. */ Native = 'native', @@ -28,6 +29,10 @@ export enum AccountType { * A cw3 smart-contract-based multisig. */ Cw3Multisig = 'cw3Multisig', + /** + * A Timewave Valence account. + */ + Valence = 'valence', } export type BaseAccount = { @@ -78,12 +83,40 @@ export type Cw3MultisigAccount = BaseAccount & { export type MultisigAccount = CryptographicMultisigAccount | Cw3MultisigAccount +export type ValenceAccount = BaseAccount & { + type: AccountType.Valence + config: ValenceAccountConfig +} + +export type ValenceAccountConfig = { + // If rebalancer setup, this will be defined. + rebalancer: { + config: RebalancerConfig + // Process targest. + targets: ValenceAccountRebalancerTarget[] + } | null +} + +export type ValenceAccountRebalancerTarget = { + /** + * The token being rebalanced. + */ + token: GenericToken + /** + * Target changes over time for this token. + */ + targets: ({ + timestamp: number + } & ParsedTarget)[] +} + export type Account = | NativeAccount | PolytoneAccount | IcaAccount | CryptographicMultisigAccount | Cw3MultisigAccount + | ValenceAccount /** * Unique identifier for account tabs, which is used in the URL path. @@ -98,7 +131,7 @@ export type AccountTab = { id: AccountTabId label: string Icon: ComponentType<{ className: string }> - Component: ComponentType + Component: ComponentType } export type AccountTxForm = { diff --git a/packages/types/actions.ts b/packages/types/actions.ts index 0952486a9..ed4d302f2 100644 --- a/packages/types/actions.ts +++ b/packages/types/actions.ts @@ -4,6 +4,7 @@ import { ComponentType, ReactNode } from 'react' import { FieldErrors } from 'react-hook-form' import { TFunction } from 'react-i18next' +import { Account } from './account' import { ConfiguredChainContext, IChainContext, @@ -12,7 +13,7 @@ import { import { IDaoBase } from './clients' import { UnifiedCosmosMsg } from './contracts/common' import { AllGovParams } from './gov' -import { PfpkProfile } from './profile' +import { UnifiedProfile } from './profile' export enum ActionCategoryKey { CommonlyUsed = 'commonlyUsed', @@ -22,6 +23,7 @@ export enum ActionCategoryKey { DaoGovernance = 'daoGovernance', SmartContracting = 'smartContracting', Treasury = 'treasury', + Rebalancer = 'rebalancer', Nfts = 'nfts', Press = 'press', Advanced = 'advanced', @@ -83,6 +85,19 @@ export enum ActionKey { UpdateProposalConfig = 'updateProposalConfig', MigrateMigalooV4TokenFactory = 'migrateMigalooV4TokenFactory', CreateDao = 'createDao', + // Valence + CreateValenceAccount = 'createValenceAccount', + ConfigureRebalancer = 'configureRebalancer', + PauseRebalancer = 'pauseRebalancer', + ResumeRebalancer = 'resumeRebalancer', + FundRebalancer = 'fundRebalancer', + WithdrawFromRebalancer = 'withdrawFromRebalancer', + // DaoProposalSingle + UpdatePreProposeSingleConfig = 'updatePreProposeSingleConfig', + UpdateProposalSingleConfig = 'updateProposalSingleConfig', + // DaoProposalMultiple + UpdatePreProposeMultipleConfig = 'updatePreProposeMultipleConfig', + UpdateProposalMultipleConfig = 'updateProposalMultipleConfig', // Press CreatePost = 'createPost', UpdatePost = 'updatePost', @@ -236,19 +251,23 @@ export enum ActionContextType { Gov = 'gov', } -export type ActionContext = +export type ActionContext = ( | { type: ActionContextType.Dao dao: IDaoBase } | { type: ActionContextType.Wallet - profile?: PfpkProfile + profile: UnifiedProfile } | { type: ActionContextType.Gov params: AllGovParams } +) & { + // All contexts should have a list of accounts. + accounts: Account[] +} export enum ActionChainContextType { /** diff --git a/packages/types/chain.ts b/packages/types/chain.ts index 984b1454d..fbd753f27 100644 --- a/packages/types/chain.ts +++ b/packages/types/chain.ts @@ -206,6 +206,19 @@ export type SupportedChainConfig = BaseChainConfig & { * Polytone connections to other chains from this chain. */ polytone?: PolytoneConfig + /** + * Timewave's Valence config. + */ + valence?: { + /** + * Address of services manager contract. + */ + servicesManager: string + /** + * Address of rebalancer contract. + */ + rebalancer: string + } } export type SupportedChain = SupportedChainConfig & { @@ -249,6 +262,9 @@ export type CodeIdConfig = { Cw20Base?: number Cw20Stake?: number DaoVotingCw20Staked?: number + + // Valence + ValenceAccount?: number } export type CodeHashConfig = { diff --git a/packages/types/components/ProfileWallet.ts b/packages/types/components/ProfileWallet.ts index 717ecf471..1d7a4705a 100644 --- a/packages/types/components/ProfileWallet.ts +++ b/packages/types/components/ProfileWallet.ts @@ -4,8 +4,13 @@ import { Account } from '../account' import { LoadingDataWithError } from '../misc' import { TokenCardInfo } from '../token' import { StatefulProfileAddChainsProps } from './ProfileAddChains' +import { ValenceAccountDisplayProps } from './ValenceAccountDisplay' export type ProfileWalletProps = { + /** + * Whether or not this profile view is read-only. + */ + readOnly: boolean /** * List of accounts for profile. */ @@ -26,4 +31,18 @@ export type ProfileWalletProps = { * Stateful profile add chains component. */ ProfileAddChains: ComponentType +} & Pick< + ValenceAccountDisplayProps, + | 'ButtonLink' + | 'IconButtonLink' + | 'configureRebalancerHref' + | 'TreasuryHistoryGraph' +> + +export type StatefulProfileWalletProps = { + /** + * Optionally choose which address to load the profile for. Otherwise, uses + * the current wallet. If defined, this will not be editable. + */ + address?: string } diff --git a/packages/types/components/TokenInput.ts b/packages/types/components/TokenInput.ts index 8e9abecc3..0fb970375 100644 --- a/packages/types/components/TokenInput.ts +++ b/packages/types/components/TokenInput.ts @@ -44,6 +44,11 @@ export type TokenInputProps< } // The pair of `type` and `denomOrAddress` must be unique for each token. tokens: LoadingData + /** + * Optionally hide these tokens from the dropdown. This is useful to hide + * tokens that have already been selected. + */ + hideTokens?: T[] onSelectToken: (token: T) => void selectedToken: Pick | undefined tokenFallback?: ReactNode diff --git a/packages/types/components/TreasuryHistoryGraph.ts b/packages/types/components/TreasuryHistoryGraph.ts index a4d433480..3bde0929c 100644 --- a/packages/types/components/TreasuryHistoryGraph.ts +++ b/packages/types/components/TreasuryHistoryGraph.ts @@ -8,6 +8,9 @@ export type TreasuryHistoryGraphProps = { address: string // If defined, only show history for this account. account?: Account + // If account above is a valence account, and `showRebalancer` is true, only + // show rebalanced tokens with their associated targets. + showRebalancer?: boolean // Applied to container. className?: string // Applied to graph container. diff --git a/packages/types/components/ValenceAccountDisplay.ts b/packages/types/components/ValenceAccountDisplay.ts new file mode 100644 index 000000000..ae1bb571c --- /dev/null +++ b/packages/types/components/ValenceAccountDisplay.ts @@ -0,0 +1,19 @@ +import { ComponentType } from 'react' + +import { ValenceAccount } from '../account' +import { LoadingDataWithError } from '../misc' +import { TokenCardInfo } from '../token' +import { ButtonLinkProps } from './Buttonifier' +import { IconButtonLinkProps } from './IconButtonLink' +import { TreasuryHistoryGraphProps } from './TreasuryHistoryGraph' + +export type ValenceAccountDisplayProps = { + account: ValenceAccount + tokens: LoadingDataWithError + TokenLine: ComponentType + TreasuryHistoryGraph: ComponentType + ButtonLink: ComponentType + IconButtonLink: ComponentType + configureRebalancerHref?: string + className?: string +} diff --git a/packages/types/components/index.ts b/packages/types/components/index.ts index 9a0bb7235..be88a3461 100644 --- a/packages/types/components/index.ts +++ b/packages/types/components/index.ts @@ -58,6 +58,7 @@ export * from './TokenInput' export * from './TokenSwapStatus' export * from './Trans' export * from './TreasuryHistoryGraph' +export * from './ValenceAccountDisplay' export * from './ValidatorPicker' export * from './WalletDaos' export * from './WalletProfileHeader' diff --git a/packages/types/contracts/ValenceAccount.ts b/packages/types/contracts/ValenceAccount.ts new file mode 100644 index 000000000..6115b34a5 --- /dev/null +++ b/packages/types/contracts/ValenceAccount.ts @@ -0,0 +1,212 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +export interface InstantiateMsg { + referral?: string | null + services_manager: string +} +export type ExecuteMsg = + | { + register_to_service: { + data?: Binary | null + service_name: ValenceServices + } + } + | { + deregister_from_service: { + service_name: ValenceServices + } + } + | { + update_service: { + data: Binary + service_name: ValenceServices + } + } + | { + pause_service: { + reason?: string | null + service_name: ValenceServices + } + } + | { + resume_service: { + service_name: ValenceServices + } + } + | { + send_funds_by_service: { + atomic: boolean + msgs: CosmosMsgForEmpty[] + } + } + | { + execute_by_service: { + atomic: boolean + msgs: CosmosMsgForEmpty[] + } + } + | { + execute_by_admin: { + msgs: CosmosMsgForEmpty[] + } + } + | { + start_admin_change: { + addr: string + expiration: Expiration + } + } + | { + cancel_admin_change: {} + } + | { + approve_admin_change: {} + } +export type Binary = string +export type ValenceServices = 'rebalancer' +export type CosmosMsgForEmpty = + | { + bank: BankMsg + } + | { + custom: Empty + } + | { + stargate: { + type_url: string + value: Binary + [k: string]: unknown + } + } + | { + ibc: IbcMsg + } + | { + wasm: WasmMsg + } + | { + gov: GovMsg + } +export type BankMsg = + | { + send: { + amount: Coin[] + to_address: string + [k: string]: unknown + } + } + | { + burn: { + amount: Coin[] + [k: string]: unknown + } + } +export type Uint128 = string +export type IbcMsg = + | { + transfer: { + amount: Coin + channel_id: string + timeout: IbcTimeout + to_address: string + [k: string]: unknown + } + } + | { + send_packet: { + channel_id: string + data: Binary + timeout: IbcTimeout + [k: string]: unknown + } + } + | { + close_channel: { + channel_id: string + [k: string]: unknown + } + } +export type Timestamp = Uint64 +export type Uint64 = string +export type WasmMsg = + | { + execute: { + contract_addr: string + funds: Coin[] + msg: Binary + [k: string]: unknown + } + } + | { + instantiate: { + admin?: string | null + code_id: number + funds: Coin[] + label: string + msg: Binary + [k: string]: unknown + } + } + | { + migrate: { + contract_addr: string + msg: Binary + new_code_id: number + [k: string]: unknown + } + } + | { + update_admin: { + admin: string + contract_addr: string + [k: string]: unknown + } + } + | { + clear_admin: { + contract_addr: string + [k: string]: unknown + } + } +export type GovMsg = { + vote: { + proposal_id: number + vote: VoteOption + [k: string]: unknown + } +} +export type VoteOption = 'yes' | 'no' | 'abstain' | 'no_with_veto' +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export interface Coin { + amount: Uint128 + denom: string + [k: string]: unknown +} +export interface Empty { + [k: string]: unknown +} +export interface IbcTimeout { + block?: IbcTimeoutBlock | null + timestamp?: Timestamp | null + [k: string]: unknown +} +export interface IbcTimeoutBlock { + height: number + revision: number + [k: string]: unknown +} +export type QueryMsg = 'get_admin' +export type Addr = string diff --git a/packages/types/contracts/ValenceRebalancer.ts b/packages/types/contracts/ValenceRebalancer.ts new file mode 100644 index 000000000..3b1aab867 --- /dev/null +++ b/packages/types/contracts/ValenceRebalancer.ts @@ -0,0 +1,257 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +export type Uint128 = string +export type Timestamp = Uint64 +export type Uint64 = string +export interface InstantiateMsg { + auctions_manager_addr: string + base_denom_whitelist: BaseDenom[] + cycle_period?: number | null + cycle_start: Timestamp + denom_whitelist: string[] + fees: ServiceFeeConfig + services_manager_addr: string +} +export interface BaseDenom { + denom: string + min_balance_limit: Uint128 +} +export interface ServiceFeeConfig { + denom: string + register_fee: Uint128 + resume_fee: Uint128 +} +export type ExecuteMsg = + | 'approve_admin_change' + | { + admin: RebalancerAdminMsg + } + | { + system_rebalance: { + limit?: number | null + } + } + | { + register: { + data?: RebalancerData | null + register_for: string + } + } + | { + deregister: { + deregister_for: string + } + } + | { + update: { + data: RebalancerUpdateData + update_for: string + } + } + | { + pause: { + pause_for: string + reason?: string | null + sender: string + } + } + | { + resume: { + resume_for: string + sender: string + } + } +export type RebalancerAdminMsg = + | 'cancel_admin_change' + | { + update_system_status: { + status: SystemRebalanceStatus + } + } + | { + update_denom_whitelist: { + to_add: string[] + to_remove: string[] + } + } + | { + update_base_denom_whitelist: { + to_add: BaseDenom[] + to_remove: string[] + } + } + | { + update_services_manager: { + addr: string + } + } + | { + update_auctions_manager: { + addr: string + } + } + | { + update_cycle_period: { + period: number + } + } + | { + update_fess: { + fees: ServiceFeeConfig + } + } + | { + start_admin_change: { + addr: string + expiration: Expiration + } + } +export type SystemRebalanceStatus = + | { + not_started: { + cycle_start: Timestamp + } + } + | { + processing: { + cycle_started: Timestamp + prices: [Pair, Decimal][] + start_from: Addr + } + } + | { + finished: { + next_cycle: Timestamp + } + } +export type Pair = [string, string] +export type Decimal = string +export type Addr = string +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export type TargetOverrideStrategy = 'proportional' | 'priority' +export type OptionalFieldForUint64 = + | 'clear' + | { + set: number + } +export type OptionalFieldForString = + | 'clear' + | { + set: string + } +export interface RebalancerData { + base_denom: string + max_limit_bps?: number | null + pid: PID + target_override_strategy: TargetOverrideStrategy + targets: Target[] + trustee?: string | null +} +export interface PID { + d: string + i: string + p: string +} +export interface Target { + bps: number + denom: string + min_balance?: Uint128 | null +} +export interface RebalancerUpdateData { + base_denom?: string | null + max_limit_bps?: OptionalFieldForUint64 | null + pid?: PID | null + target_override_strategy?: TargetOverrideStrategy | null + targets: Target[] + trustee?: OptionalFieldForString | null +} +export type QueryMsg = + | ( + | 'get_system_status' + | 'get_white_lists' + | 'get_managers_addrs' + | 'get_admin' + ) + | { + get_config: { + addr: string + } + } + | { + get_all_configs: { + limit?: number | null + start_after?: string | null + } + } + | { + get_paused_config: { + addr: string + } + } + | { + get_service_fee: { + account: string + action: QueryFeeAction + } + } +export type QueryFeeAction = 'register' | 'resume' +export type SignedDecimal = string +export type ArrayOfTupleOfAddrAndRebalancerConfig = [Addr, RebalancerConfig][] +export interface RebalancerConfig { + base_denom: string + has_min_balance: boolean + last_rebalance: Timestamp + max_limit: Decimal + pid: ParsedPID + target_override_strategy: TargetOverrideStrategy + targets: ParsedTarget[] + trustee?: Addr | null +} +export interface ParsedPID { + d: SignedDecimal + i: SignedDecimal + p: SignedDecimal +} +export interface ParsedTarget { + denom: string + last_i: SignedDecimal + last_input?: SignedDecimal | null + min_balance?: Uint128 | null + percentage: Decimal +} +export interface ManagersAddrsResponse { + auctions: Addr + services: Addr +} +export type PauseReason = + | 'empty_balance' + | { + account_reason: string + } +export interface PauseData { + config: RebalancerConfig + pauser: Addr + reason: PauseReason +} +export type NullableCoin = Coin | null +export interface Coin { + amount: Uint128 + denom: string +} +export interface WhitelistsResponse { + base_denom_whitelist: BaseDenom[] + denom_whitelist: string[] +} diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 6e05d028d..7ebca86d5 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -666,6 +666,8 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ DaoVotingCw4: 574, DaoVotingCw721Staked: 576, DaoVotingTokenStaked: 577, + + ValenceAccount: 1506, }, historicalCodeIds: { [ContractVersion.V210]: { @@ -673,6 +675,12 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ DaoProposalMultiple: 226, }, }, + valence: { + servicesManager: + 'neutron1gantvpnat0la8kkkzrnj48d5d8wxdjllh5r2w4r2hcrpwy00s69quypupa', + rebalancer: + 'neutron1qs6mzpmcw3dvg5l8nyywetcj326scszdj7v4pfk55xwshd4prqnqfwc0z2', + }, // There is no IBC connection with: // - Juno // - Migaloo @@ -2245,6 +2253,10 @@ export const POLYTONE_CONFIG_PER_CHAIN: [ChainId, PolytoneConfig][] = polytone, ]) +export const VALENCE_SUPPORTED_CHAINS = SUPPORTED_CHAINS.filter( + ({ valence }) => valence +).map(({ chainId }) => chainId as ChainId) + export const CHAIN_ENDPOINTS: Partial< Record< ChainId, diff --git a/packages/utils/constants/contracts.ts b/packages/utils/constants/contracts.ts index b85ed8347..2c3b35471 100644 --- a/packages/utils/constants/contracts.ts +++ b/packages/utils/constants/contracts.ts @@ -16,6 +16,7 @@ export enum ContractName { NeutronCwdPreProposeSingleOverrule = 'crates.io:cwd-pre-propose-single-overrule', // https://github.com/oraichain/cw20-staking/tree/master/contracts/proxy-snapshot OraichainCw20StakingProxySnapshot = 'cw20-staking-proxy-snapshot', + ValenceAccount = 'crates.io:valence-account', } export const NEUTRON_SUBDAO_CORE_CONTRACT_NAMES = [ diff --git a/packages/utils/constants/other.ts b/packages/utils/constants/other.ts index 52bfe6419..9965f1d34 100644 --- a/packages/utils/constants/other.ts +++ b/packages/utils/constants/other.ts @@ -172,6 +172,19 @@ export const INVALID_CONTRACT_ERROR_SUBSTRINGS = [ 'decoding bech32 failed', ] +/** + * The salt used to generate a predictable Valence account address. + */ +export const VALENCE_INSTANTIATE2_SALT = 'valence' + +/** + * DAOs allowed to use the Valence Rebalancer. + */ +export const VALENCE_ALLOWLIST = [ + // NEWT DAO + 'neutron1lqhw66n563pr2vszv4zqhjp7akwpd74vfj5gukh2crw45t5kfmvsa96ujv', +] + /** * Gas prices for Secret transactions. */ diff --git a/packages/utils/dao.ts b/packages/utils/dao.ts index 81c557d53..08e4404db 100644 --- a/packages/utils/dao.ts +++ b/packages/utils/dao.ts @@ -72,11 +72,12 @@ export const getAccount = ({ types = [AccountType.Native, AccountType.Polytone], }: { accounts: readonly Account[] - chainId: string + chainId?: string types?: readonly AccountType[] }): Account | undefined => accounts.find( - (account) => types.includes(account.type) && account.chainId === chainId + (account) => + types.includes(account.type) && (!chainId || account.chainId === chainId) ) // Gets the account address on the specified chain or undefined if nonexistent. diff --git a/packages/utils/index.ts b/packages/utils/index.ts index 856ca867f..a4ba1bd63 100644 --- a/packages/utils/index.ts +++ b/packages/utils/index.ts @@ -36,4 +36,5 @@ export * from './string' export * from './time' export * from './token' export * from './url' +export * from './valence' export * from './vesting' diff --git a/packages/utils/token.ts b/packages/utils/token.ts index 3ffffd985..76f1f0d0c 100644 --- a/packages/utils/token.ts +++ b/packages/utils/token.ts @@ -20,6 +20,11 @@ export const tokensEqual = ( a.type === b.type && a.denomOrAddress === b.denomOrAddress +export const tokenSourcesEqual = ( + a: GenericToken | GenericTokenSource, + b: GenericToken | GenericTokenSource +): boolean => serializeTokenSource(a) === serializeTokenSource(b) + export const serializeTokenSource = ( tokenOrSource: GenericToken | GenericTokenSource ): string => { @@ -27,6 +32,7 @@ export const serializeTokenSource = ( 'source' in tokenOrSource ? tokenOrSource.source : tokenOrSource return [source.chainId, source.type, source.denomOrAddress].join(':') } + export const deserializeTokenSource = (source: string): GenericTokenSource => { const [chainId, type, denomOrAddress] = source.split(':') return { diff --git a/packages/utils/valence.ts b/packages/utils/valence.ts new file mode 100644 index 000000000..1140e62b8 --- /dev/null +++ b/packages/utils/valence.ts @@ -0,0 +1,26 @@ +import { + AccountType, + ActionContextType, + ActionOptions, + ChainId, +} from '@dao-dao/types' + +import { VALENCE_ALLOWLIST } from './constants' +import { VALENCE_SUPPORTED_CHAINS } from './constants/chains' + +// Whether or not the current action context supports Valence accounts. +export const actionContextSupportsValence = ({ + context, + chain: { chain_id: chainId }, +}: ActionOptions): boolean => + // Must either be on the valence allowlist or already have a Valence account. + context.accounts.some( + (a) => + VALENCE_ALLOWLIST.includes(a.address) || a.type === AccountType.Valence + ) && + // Must be on a supported Valence chain. + (VALENCE_SUPPORTED_CHAINS.includes(chainId as ChainId) || + (context.type === ActionContextType.Dao && + VALENCE_SUPPORTED_CHAINS.some( + (chainId) => chainId in context.dao.info.polytoneProxies + ))) diff --git a/yarn.lock b/yarn.lock index e34c8525e..bec988948 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19797,6 +19797,11 @@ node-libs-browser@^2.2.1: util "^0.11.0" vm-browserify "^1.0.1" +node-pid-controller@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/node-pid-controller/-/node-pid-controller-1.0.1.tgz#779d1a19c4a3a54284ed0d50da83bf4125f2abf5" + integrity sha512-36gdeRz2emhIsznLpXksJSqmR13NU3vR+rkRlfHWCGGlZu9fK+dcTPRpud0FiH6b2Nhwm0kbcVk7vXFlg8Sw1w== + node-releases@^2.0.13: version "2.0.13" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.13.tgz#d5ed1627c23e3461e819b02e57b75e4899b1c81d" From 70018ae3062d18f35a1cc62eab22f0ee1ffcd54d Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 9 Jul 2024 15:21:53 -0400 Subject: [PATCH 308/438] fixed vote not refreshing --- .../MultipleChoiceProposalModule.secret.ts | 20 ++++--- .../MultipleChoiceProposalModule.ts | 19 ++++--- .../SingleChoiceProposalModule.secret.ts | 21 ++++---- .../SingleChoiceProposalModule.ts | 19 ++++--- .../hooks/useProposalRefreshers.ts | 41 +++++++++++--- .../DaoProposalSingle/hooks/useCastVote.ts | 16 +----- .../hooks/useProposalRefreshers.ts | 54 +++++++++++++------ 7 files changed, 107 insertions(+), 83 deletions(-) diff --git a/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.secret.ts b/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.secret.ts index 105601be9..ee9805889 100644 --- a/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.secret.ts +++ b/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.secret.ts @@ -1,4 +1,4 @@ -import { FetchQueryOptions, skipToken } from '@tanstack/react-query' +import { FetchQueryOptions } from '@tanstack/react-query' import { SecretDaoPreProposeMultipleClient, @@ -278,21 +278,19 @@ export class SecretMultipleChoiceProposalModule extends ProposalModuleBase< }): FetchQueryOptions { // If no voter nor permit, return query in loading state. const permit = voter && this.dao.getExistingPermit(voter) - if (!permit) { - return { - queryKey: [], - queryFn: skipToken, - } - } - return secretDaoProposalMultipleQueries.getVote({ chainId: this.dao.chainId, contractAddress: this.info.address, + // Force type-cast since the query won't be enabled until this is set. + // This allows us to pass an undefined `voter` argument in order to + // invalidate/refresh the query for all voters. args: { proposalId, - auth: { - permit, - }, + ...(permit && { auth: { permit } }), + } as any, + // If no voter nor permit, return query in loading state. + options: { + enabled: !!permit, }, }) } diff --git a/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.ts b/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.ts index 3d1d4f49b..161ae6805 100644 --- a/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.ts +++ b/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.ts @@ -1,4 +1,4 @@ -import { FetchQueryOptions, skipToken } from '@tanstack/react-query' +import { FetchQueryOptions } from '@tanstack/react-query' import { DaoPreProposeMultipleClient, @@ -304,20 +304,19 @@ export class MultipleChoiceProposalModule extends ProposalModuleBase< proposalId: number voter?: string }): FetchQueryOptions { - // If no voter, return query in loading state. - if (!voter) { - return { - queryKey: [], - queryFn: skipToken, - } - } - return daoProposalMultipleQueries.getVote(this.queryClient, { chainId: this.dao.chainId, contractAddress: this.info.address, + // Force type-cast since the query won't be enabled until this is set. + // This allows us to pass an undefined `voter` argument in order to + // invalidate/refresh the query for all voters. args: { proposalId, - voter, + ...(voter && { voter }), + } as any, + // If no voter, return query in loading state. + options: { + enabled: !!voter, }, }) } diff --git a/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.secret.ts b/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.secret.ts index ba4650e2d..c19f70408 100644 --- a/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.secret.ts +++ b/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.secret.ts @@ -1,4 +1,4 @@ -import { FetchQueryOptions, skipToken } from '@tanstack/react-query' +import { FetchQueryOptions } from '@tanstack/react-query' import { SecretDaoPreProposeSingleClient, @@ -301,23 +301,20 @@ export class SecretSingleChoiceProposalModule extends ProposalModuleBase< proposalId: number voter?: string }): FetchQueryOptions { - // If no voter nor permit, return query in loading state. const permit = voter && this.dao.getExistingPermit(voter) - if (!permit) { - return { - queryKey: [], - queryFn: skipToken, - } - } - return secretDaoProposalSingleQueries.getVote({ chainId: this.dao.chainId, contractAddress: this.info.address, + // Force type-cast since the query won't be enabled until this is set. + // This allows us to pass an undefined `voter` argument in order to + // invalidate/refresh the query for all voters. args: { proposalId, - auth: { - permit, - }, + ...(permit && { auth: { permit } }), + } as any, + // If no voter nor permit, return query in loading state. + options: { + enabled: !!permit, }, }) } diff --git a/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts b/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts index cef3f5168..210e74a7e 100644 --- a/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts +++ b/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts @@ -1,4 +1,4 @@ -import { FetchQueryOptions, skipToken } from '@tanstack/react-query' +import { FetchQueryOptions } from '@tanstack/react-query' import { CwProposalSingleV1Client, @@ -345,14 +345,6 @@ export class SingleChoiceProposalModule extends ProposalModuleBase< proposalId: number voter?: string }): FetchQueryOptions { - // If no voter, return query in loading state. - if (!voter) { - return { - queryKey: [], - queryFn: skipToken, - } - } - const query = this.info.version === ContractVersion.V1 ? cwProposalSingleV1Queries.vote @@ -361,9 +353,16 @@ export class SingleChoiceProposalModule extends ProposalModuleBase< return query(this.queryClient, { chainId: this.dao.chainId, contractAddress: this.info.address, + // Force type-cast since the query won't be enabled until this is set. + // This allows us to pass an undefined `voter` argument in order to + // invalidate/refresh the query for all voters. args: { proposalId, - voter, + ...(voter && { voter }), + } as any, + // If no voter, return query in loading state. + options: { + enabled: !!voter, }, }) } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useProposalRefreshers.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useProposalRefreshers.ts index dd83744b5..fe7e0e283 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useProposalRefreshers.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useProposalRefreshers.ts @@ -1,33 +1,58 @@ +import { useQueryClient } from '@tanstack/react-query' import { useCallback } from 'react' import { useSetRecoilState } from 'recoil' -import { refreshProposalIdAtom, refreshProposalsIdAtom } from '@dao-dao/state' +import { + indexerQueries, + refreshProposalIdAtom, + refreshProposalsIdAtom, +} from '@dao-dao/state' import { ProposalRefreshers } from '@dao-dao/types' -import { useProposalModuleAdapterOptions } from '../../../react/context' +import { useProposalModuleAdapterContext } from '../../../react/context' import { useLoadingProposal } from './useLoadingProposal' export const useProposalRefreshers = (): ProposalRefreshers => { const { - proposalModule: { address: proposalModuleAddress }, - proposalNumber, - } = useProposalModuleAdapterOptions() + proposalModule, + options: { proposalNumber }, + } = useProposalModuleAdapterContext() + const queryClient = useQueryClient() const setRefreshProposalsId = useSetRecoilState(refreshProposalsIdAtom) const setRefreshProposalId = useSetRecoilState( refreshProposalIdAtom({ - address: proposalModuleAddress, + address: proposalModule.address, proposalId: proposalNumber, }) ) const refreshProposal = useCallback(() => { setRefreshProposalId((id) => id + 1) - }, [setRefreshProposalId]) + + // Invalidate indexer query first. + queryClient.invalidateQueries({ + queryKey: indexerQueries.queryContract(queryClient, { + chainId: proposalModule.dao.chainId, + contractAddress: proposalModule.address, + formula: 'daoProposalMultiple/vote', + args: { + proposalId: proposalNumber, + }, + }).queryKey, + }) + // And then the contract query that depends on it. + queryClient.invalidateQueries({ + queryKey: proposalModule.getVoteQuery({ + proposalId: proposalNumber, + voter: undefined, + }).queryKey, + }) + }, [proposalModule, proposalNumber, queryClient, setRefreshProposalId]) const refreshProposalAndAll = useCallback(() => { - setRefreshProposalsId((id) => id + 1) refreshProposal() + setRefreshProposalsId((id) => id + 1) }, [setRefreshProposalsId, refreshProposal]) const loadingProposal = useLoadingProposal() diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useCastVote.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useCastVote.ts index 7d803d6d5..aadfe1566 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useCastVote.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useCastVote.ts @@ -1,15 +1,10 @@ import { useCallback, useEffect, useState } from 'react' import toast from 'react-hot-toast' -import { ContractVersion } from '@dao-dao/types' import { Vote } from '@dao-dao/types/contracts/DaoProposalSingle.common' import { processError } from '@dao-dao/utils' -import { - CwProposalSingleV1Hooks, - DaoProposalSingleV2Hooks, - useWallet, -} from '../../../../hooks' +import { useWallet } from '../../../../hooks' import { useProposalModuleAdapterContext } from '../../../react' import { useLoadingWalletVoteInfo } from './useLoadingWalletVoteInfo' @@ -24,15 +19,6 @@ export const useCastVote = (onSuccess?: () => void | Promise) => { getSigningClient, } = useWallet() - const _castVote = ( - proposalModule.version === ContractVersion.V1 - ? CwProposalSingleV1Hooks.useVote - : DaoProposalSingleV2Hooks.useVote - )({ - contractAddress: proposalModule.address, - sender: walletAddress ?? '', - }) - const [castingVote, setCastingVote] = useState(false) // On vote update, stop loading. This ensures the vote button doesn't stop diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalRefreshers.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalRefreshers.ts index 7681ea0fd..ded7819ae 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalRefreshers.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalRefreshers.ts @@ -1,51 +1,71 @@ +import { useQueryClient } from '@tanstack/react-query' import { useCallback } from 'react' import { constSelector, useSetRecoilState } from 'recoil' import { DaoPreProposeApprovalSingleSelectors, DaoProposalSingleCommonSelectors, + indexerQueries, refreshProposalIdAtom, refreshProposalsIdAtom, } from '@dao-dao/state' import { useCachedLoading } from '@dao-dao/stateless' import { ProposalRefreshers } from '@dao-dao/types' -import { useProposalModuleAdapterOptions } from '../../../react/context' +import { useProposalModuleAdapterContext } from '../../../react/context' export const useProposalRefreshers = (): ProposalRefreshers => { const { - proposalModule: { address: proposalModuleAddress, prePropose }, - proposalNumber, - chain: { chain_id: chainId }, - isPreProposeApprovalProposal, - } = useProposalModuleAdapterOptions() + proposalModule, + options: { proposalNumber, isPreProposeApprovalProposal }, + } = useProposalModuleAdapterContext() + const queryClient = useQueryClient() const setRefreshProposalsId = useSetRecoilState(refreshProposalsIdAtom) const setRefreshProposalId = useSetRecoilState( refreshProposalIdAtom({ address: - isPreProposeApprovalProposal && prePropose - ? prePropose.address - : proposalModuleAddress, + isPreProposeApprovalProposal && proposalModule.prePropose + ? proposalModule.prePropose.address + : proposalModule.address, proposalId: proposalNumber, }) ) - // Refresh just this proposal. const refreshProposal = useCallback(() => { setRefreshProposalId((id) => id + 1) - }, [setRefreshProposalId]) + + // Invalidate indexer query first. + queryClient.invalidateQueries({ + queryKey: indexerQueries.queryContract(queryClient, { + chainId: proposalModule.dao.chainId, + contractAddress: proposalModule.address, + formula: 'daoProposalSingle/vote', + args: { + proposalId: proposalNumber, + }, + }).queryKey, + }) + // And then the contract query that depends on it. + queryClient.invalidateQueries({ + queryKey: proposalModule.getVoteQuery({ + proposalId: proposalNumber, + voter: undefined, + }).queryKey, + }) + }, [proposalModule, proposalNumber, queryClient, setRefreshProposalId]) // Refresh all proposal lists and proposals. const refreshProposalAndAll = useCallback(() => { + refreshProposal() setRefreshProposalsId((id) => id + 1) - }, [setRefreshProposalsId]) + }, [refreshProposal, setRefreshProposalsId]) const loadingProposal = useCachedLoading( !isPreProposeApprovalProposal ? DaoProposalSingleCommonSelectors.proposalSelector({ - contractAddress: proposalModuleAddress, - chainId, + contractAddress: proposalModule.address, + chainId: proposalModule.dao.chainId, params: [ { proposalId: proposalNumber, @@ -57,10 +77,10 @@ export const useProposalRefreshers = (): ProposalRefreshers => { ) const loadingPreProposeApprovalProposal = useCachedLoading( - isPreProposeApprovalProposal && prePropose + isPreProposeApprovalProposal && proposalModule.prePropose ? DaoPreProposeApprovalSingleSelectors.queryExtensionSelector({ - chainId, - contractAddress: prePropose.address, + chainId: proposalModule.dao.chainId, + contractAddress: proposalModule.prePropose.address, params: [ { msg: { From 38085860161d0794eae6d7a896790bb42b8762d3 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 9 Jul 2024 15:24:56 -0400 Subject: [PATCH 309/438] cleaned up --- .../proposal-module/MultipleChoiceProposalModule.ts | 10 +++++----- .../proposal-module/SingleChoiceProposalModule.ts | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.ts b/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.ts index 161ae6805..bfe58c32b 100644 --- a/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.ts +++ b/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.ts @@ -307,13 +307,13 @@ export class MultipleChoiceProposalModule extends ProposalModuleBase< return daoProposalMultipleQueries.getVote(this.queryClient, { chainId: this.dao.chainId, contractAddress: this.info.address, - // Force type-cast since the query won't be enabled until this is set. - // This allows us to pass an undefined `voter` argument in order to - // invalidate/refresh the query for all voters. args: { proposalId, - ...(voter && { voter }), - } as any, + // Force type-cast since the query won't be enabled until this is set. + // This allows us to pass an undefined `voter` argument in order to + // invalidate/refresh the query for all voters. + voter: voter!, + }, // If no voter, return query in loading state. options: { enabled: !!voter, diff --git a/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts b/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts index 210e74a7e..cab01948b 100644 --- a/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts +++ b/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts @@ -353,13 +353,13 @@ export class SingleChoiceProposalModule extends ProposalModuleBase< return query(this.queryClient, { chainId: this.dao.chainId, contractAddress: this.info.address, - // Force type-cast since the query won't be enabled until this is set. - // This allows us to pass an undefined `voter` argument in order to - // invalidate/refresh the query for all voters. args: { proposalId, - ...(voter && { voter }), - } as any, + // Force type-cast since the query won't be enabled until this is set. + // This allows us to pass an undefined `voter` argument in order to + // invalidate/refresh the query for all voters. + voter: voter!, + }, // If no voter, return query in loading state. options: { enabled: !!voter, From 84a9b5e751b9cbd5c79cf36cf9f1448f348723dd Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 9 Jul 2024 15:47:30 -0400 Subject: [PATCH 310/438] moved some rebalancer config to advanced section --- packages/i18n/locales/en/translation.json | 1 - .../valence/ConfigureRebalancer/Component.tsx | 185 ++++++++++-------- .../CreateValenceAccount/Component.tsx | 57 ++---- 3 files changed, 116 insertions(+), 127 deletions(-) diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 510a8c2b5..70c6b452e 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -1124,7 +1124,6 @@ "migrateMigalooV4TokenFactoryExplanation": "The token factory module on Migaloo has been migrated to a new version that is more actively maintained. Because this DAO created a new token before the migration, the DAO's token factory contract that interacts with the chain module must now be upgraded. This action upgrades the token factory contract to a version that supports the new token factory module.", "migrateSmartContractActionDescription": "Migrate a CosmWasm contract to a new code ID.", "migrateTokenFactoryModuleDescription": "Update the DAO to support the new token factory module.", - "minBalanceToCreateAccount": "A minimum balance of {{balance}} is required to create an account.", "minimumOutputRequiredDescription_dao": "Before the proposal is passed and executed, the swap price will fluctuate. If the price drops and no longer satisfies this minimum output required, the swap will not occur.", "minimumOutputRequiredDescription_gov": "Before the proposal is passed and executed, the swap price will fluctuate. If the price drops and no longer satisfies this minimum output required, the swap will not occur.", "minimumOutputRequiredDescription_wallet": "The exact swap price will fluctuate during the transaction, but the minimum output amount is guaranteed. If the price drops and no longer satisfies this minimum output required, the swap will not occur.", diff --git a/packages/stateful/actions/core/valence/ConfigureRebalancer/Component.tsx b/packages/stateful/actions/core/valence/ConfigureRebalancer/Component.tsx index c9bd01f62..56e3f3b7c 100644 --- a/packages/stateful/actions/core/valence/ConfigureRebalancer/Component.tsx +++ b/packages/stateful/actions/core/valence/ConfigureRebalancer/Component.tsx @@ -179,6 +179,7 @@ export const ConfigureRebalancerComponent: ActionComponent< }, [t, clearErrors, setError, totalPercent, fieldNamePrefix]) const [projection, setProjection] = useState(isCreating) + const [showAdvanced, setShowAdvanced] = useState(false) // Once per day for the next 180 days. const rebalanceTimestamps = new Array(180) @@ -219,21 +220,6 @@ export const ConfigureRebalancerComponent: ActionComponent< />
-
- -

- {t('form.rebalancerTrusteeDescription')} -

- - -
-
@@ -333,36 +319,6 @@ export const ConfigureRebalancerComponent: ActionComponent< )}
-
- - - - - disabled={!isCreating} - onSelect={(value) => - setValue( - (fieldNamePrefix + - 'targetOverrideStrategy') as 'targetOverrideStrategy', - value - ) - } - selected={targetOverrideStrategy} - tabs={[ - { - label: t('form.proportional'), - value: 'proportional', - }, - { - label: t('form.priority'), - value: 'priority', - }, - ]} - /> -
-
@@ -432,47 +388,6 @@ export const ConfigureRebalancerComponent: ActionComponent< )}
-
-
- - - - setValue( - (fieldNamePrefix + 'maxLimit') as 'maxLimit', - maxLimitEnabled ? undefined : 5 - ) - } - readOnly={!isCreating} - sizing="sm" - /> -
- -

- {t('form.maximumSellablePerCycleDescription')} -

- - {maxLimitEnabled && ( -
- -
- )} -
-
@@ -583,6 +498,104 @@ export const ConfigureRebalancerComponent: ActionComponent<
)} + + setShowAdvanced((s) => !s)} + sizing="sm" + /> + + {showAdvanced && ( +
+
+ +

+ {t('form.rebalancerTrusteeDescription')} +

+ + +
+ +
+ + + + + disabled={!isCreating} + onSelect={(value) => + setValue( + (fieldNamePrefix + + 'targetOverrideStrategy') as 'targetOverrideStrategy', + value + ) + } + selected={targetOverrideStrategy} + tabs={[ + { + label: t('form.proportional'), + value: 'proportional', + }, + { + label: t('form.priority'), + value: 'priority', + }, + ]} + /> +
+ +
+
+ + + + setValue( + (fieldNamePrefix + 'maxLimit') as 'maxLimit', + maxLimitEnabled ? undefined : 5 + ) + } + readOnly={!isCreating} + sizing="sm" + /> +
+ +

+ {t('form.maximumSellablePerCycleDescription')} +

+ + {maxLimitEnabled && ( +
+ +
+ )} +
+
+ )}
diff --git a/packages/stateful/actions/core/valence/CreateValenceAccount/Component.tsx b/packages/stateful/actions/core/valence/CreateValenceAccount/Component.tsx index ae2a430d4..0c54d8843 100644 --- a/packages/stateful/actions/core/valence/CreateValenceAccount/Component.tsx +++ b/packages/stateful/actions/core/valence/CreateValenceAccount/Component.tsx @@ -27,7 +27,7 @@ export const CreateValenceAccountComponent: ActionComponent< const { t } = useTranslation() const { chain_id: chainId } = useChain() - const { control, watch } = useFormContext() + const { control } = useFormContext() const { fields: coins, append: appendCoin, @@ -42,45 +42,22 @@ export const CreateValenceAccountComponent: ActionComponent<
- {props.isCreating && ( -

- {t('info.minBalanceToCreateAccount', { - balance: t('format.token', { - amount: 10, - symbol: 'NTRN', - }), - })} -

- )} - - {coins.map(({ id }, index) => { - const isNtrn = - watch( - (props.fieldNamePrefix + - `funds.${index}.denom`) as `funds.${number}.denom` - ) === 'untrn' - - return ( - 1 - ? () => removeCoin(index) - : undefined, - } as NativeCoinSelectorProps)} - errors={props.errors?.funds?.[index]} - fieldNamePrefix={props.fieldNamePrefix + `funds.${index}.`} - min={ - // Minimum balance of 10 $NTRN. - isNtrn ? 10 : undefined - } - /> - ) - })} + {coins.map(({ id }, index) => ( + 1 + ? () => removeCoin(index) + : undefined, + } as NativeCoinSelectorProps)} + errors={props.errors?.funds?.[index]} + fieldNamePrefix={props.fieldNamePrefix + `funds.${index}.`} + /> + ))} {!props.isCreating && coins.length === 0 && (

From 0bf7c9b1bff3e2dbd198ba996ce93af62a167397 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 9 Jul 2024 16:46:29 -0400 Subject: [PATCH 311/438] add service fee to valence account creation action --- packages/i18n/locales/en/translation.json | 3 + .../contracts/ValenceRebalancer.extra.ts | 63 +++++++- .../CreateValenceAccount/Component.tsx | 146 +++++++++++++++--- .../valence/CreateValenceAccount/index.tsx | 106 +++++++++++-- 4 files changed, 280 insertions(+), 38 deletions(-) diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 70c6b452e..b234a12cb 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -372,6 +372,7 @@ "accountListAlreadySaved": "Account list already saved.", "accountListNeedsSaving": "Save the account list once you're done.", "accountNotFound": "Account not found.", + "acknowledgeServiceFee": "You must acknowledge the service fee before you can continue.", "actionFailedToLoad": "The \"{{action}}\" action failed to load: {{error}}.", "addressNotAMember": "This address it not a member of the DAO.", "addressNotFoundOnChain": "Address not found on chain.", @@ -897,6 +898,8 @@ }, "info": { "abstainVote": "Abstain", + "acknowledgeServiceFee": "We acknowledge that {{fee}} will be charged from the treasury for registration to the rebalancer.", + "acknowledgeServiceFee_none": "We acknowledge that there is no fee to register for the rebalancer.", "actionLibraryDescription": "Choose one or more actions to perform upon execution.", "actionPageWarning": "There are {{actions}} actions across {{pages}} pages. Make sure you view all pages before voting.", "actionPaysTokenSwap_paid": "This action sent {{amount}} ${{tokenSymbol}} to the token swap contract below.", diff --git a/packages/state/query/queries/contracts/ValenceRebalancer.extra.ts b/packages/state/query/queries/contracts/ValenceRebalancer.extra.ts index 797f9bb8d..4db36a43f 100644 --- a/packages/state/query/queries/contracts/ValenceRebalancer.extra.ts +++ b/packages/state/query/queries/contracts/ValenceRebalancer.extra.ts @@ -1,6 +1,6 @@ import { QueryClient, queryOptions, skipToken } from '@tanstack/react-query' -import { GenericToken, TokenType } from '@dao-dao/types' +import { GenericToken, GenericTokenBalance, TokenType } from '@dao-dao/types' import { tokenQueries } from '../token' import { valenceRebalancerQueries } from './ValenceRebalancer' @@ -59,6 +59,49 @@ export const fetchValenceRebalancerWhitelistGenericTokens = async ( } } +/** + * Get the rebalancer registration service fee. + */ +export const fetchValenceRebalancerRegistrationServiceFee = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise => { + const serviceFee = await queryClient.fetchQuery( + valenceRebalancerQueries.getServiceFee({ + chainId, + contractAddress: address, + args: { + account: '', + action: 'register', + }, + }) + ) + + const token = + serviceFee && + (await queryClient.fetchQuery( + tokenQueries.info(queryClient, { + chainId, + type: TokenType.Native, + denomOrAddress: serviceFee.denom, + }) + )) + + return ( + serviceFee && + token && { + token, + balance: serviceFee.amount, + } + ) +} + export const valenceRebalancerExtraQueries = { /** * Get the generic tokens for the whitelisted tokens in the rebalancer. @@ -74,4 +117,22 @@ export const valenceRebalancerExtraQueries = { fetchValenceRebalancerWhitelistGenericTokens(queryClient, options) : skipToken, }), + /** + * Get the rebalancer registration service fee. + */ + rebalancerRegistrationServiceFee: ( + queryClient: QueryClient, + options?: Parameters[1] + ) => + queryOptions({ + queryKey: [ + 'valenceRebalancerExtra', + 'rebalancerRegistrationServiceFee', + options, + ], + queryFn: options + ? () => + fetchValenceRebalancerRegistrationServiceFee(queryClient, options) + : skipToken, + }), } diff --git a/packages/stateful/actions/core/valence/CreateValenceAccount/Component.tsx b/packages/stateful/actions/core/valence/CreateValenceAccount/Component.tsx index 0c54d8843..0a551135b 100644 --- a/packages/stateful/actions/core/valence/CreateValenceAccount/Component.tsx +++ b/packages/stateful/actions/core/valence/CreateValenceAccount/Component.tsx @@ -1,42 +1,101 @@ +import { useEffect } from 'react' import { useFieldArray, useFormContext } from 'react-hook-form' import { useTranslation } from 'react-i18next' import { Button, + FormCheckbox, InputLabel, NativeCoinSelector, NativeCoinSelectorProps, useChain, } from '@dao-dao/stateless' -import { GenericTokenBalance, LoadingData } from '@dao-dao/types' +import { + GenericTokenBalance, + LoadingData, + LoadingDataWithError, +} from '@dao-dao/types' import { ActionComponent } from '@dao-dao/types/actions' -import { getNativeTokenForChainId } from '@dao-dao/utils' +import { Coin } from '@dao-dao/types/protobuf/codegen/cosmos/base/v1beta1/coin' +import { + convertMicroDenomToDenomWithDecimals, + getNativeTokenForChainId, +} from '@dao-dao/utils' export type CreateValenceAccountData = { chainId: string funds: { denom: string; amount: number }[] + acknowledgedServiceFee?: boolean + serviceFee?: Coin } export type CreateValenceAccountOptions = { nativeBalances: LoadingData + serviceFee: LoadingDataWithError } export const CreateValenceAccountComponent: ActionComponent< CreateValenceAccountOptions > = (props) => { + const { + fieldNamePrefix, + isCreating, + errors, + options: { serviceFee }, + } = props + const { t } = useTranslation() const { chain_id: chainId } = useChain() - const { control } = useFormContext() + const { control, watch, setValue, setError, clearErrors } = + useFormContext() const { fields: coins, append: appendCoin, remove: removeCoin, } = useFieldArray({ control, - name: (props.fieldNamePrefix + 'funds') as 'funds', + name: (fieldNamePrefix + 'funds') as 'funds', }) + const acknowledgedServiceFee = watch( + (fieldNamePrefix + 'acknowledgedServiceFee') as 'acknowledgedServiceFee' + ) + + useEffect(() => { + if (!isCreating) { + return + } + + if (acknowledgedServiceFee) { + if (errors?.acknowledgedServiceFee) { + clearErrors( + (fieldNamePrefix + + 'acknowledgedServiceFee') as 'acknowledgedServiceFee' + ) + } + } else { + if (!errors?.acknowledgedServiceFee) { + setError( + (fieldNamePrefix + + 'acknowledgedServiceFee') as 'acknowledgedServiceFee', + { + type: 'required', + message: t('error.acknowledgeServiceFee'), + } + ) + } + } + }, [ + isCreating, + acknowledgedServiceFee, + fieldNamePrefix, + clearErrors, + setError, + t, + errors?.acknowledgedServiceFee, + ]) + return ( <>

@@ -50,34 +109,79 @@ export const CreateValenceAccountComponent: ActionComponent< chainId, onRemove: // Don't allow removing the first token. - props.isCreating && coins.length > 1 + isCreating && coins.length > 1 ? () => removeCoin(index) : undefined, } as NativeCoinSelectorProps)} - errors={props.errors?.funds?.[index]} - fieldNamePrefix={props.fieldNamePrefix + `funds.${index}.`} + errors={errors?.funds?.[index]} + fieldNamePrefix={fieldNamePrefix + `funds.${index}.`} /> ))} - {!props.isCreating && coins.length === 0 && ( + {!isCreating && coins.length === 0 && (

{t('info.none')}

)} - {props.isCreating && ( - + {isCreating && ( + <> + + +
+ + +

+ setValue( + (fieldNamePrefix + + 'acknowledgedServiceFee') as 'acknowledgedServiceFee', + !acknowledgedServiceFee + ) + } + > + {t('info.acknowledgeServiceFee', { + fee: serviceFee.loading + ? '...' + : serviceFee.errored + ? '' + : serviceFee.data + ? t('format.token', { + amount: convertMicroDenomToDenomWithDecimals( + serviceFee.data.balance, + serviceFee.data.token.decimals + ), + symbol: serviceFee.data.token.symbol, + }) + : '', + context: + serviceFee.loading || serviceFee.errored || serviceFee.data + ? undefined + : 'none', + })} +

+
+ )}
diff --git a/packages/stateful/actions/core/valence/CreateValenceAccount/index.tsx b/packages/stateful/actions/core/valence/CreateValenceAccount/index.tsx index 79492f8a0..dd2a7ded6 100644 --- a/packages/stateful/actions/core/valence/CreateValenceAccount/index.tsx +++ b/packages/stateful/actions/core/valence/CreateValenceAccount/index.tsx @@ -1,8 +1,10 @@ import { fromUtf8, toUtf8 } from '@cosmjs/encoding' -import { useCallback } from 'react' +import { useQueryClient } from '@tanstack/react-query' +import { useCallback, useEffect } from 'react' import { useFormContext } from 'react-hook-form' import { waitForAll } from 'recoil' +import { valenceRebalancerExtraQueries } from '@dao-dao/state/query' import { genericTokenSelector } from '@dao-dao/state/recoil' import { AtomEmoji, @@ -33,8 +35,11 @@ import { getSupportedChainConfig, isDecodedStargateMsg, maybeMakePolytoneExecuteMessage, + mustGetSupportedChainConfig, + tokensEqual, } from '@dao-dao/utils' +import { useQueryLoadingDataWithError } from '../../../../hooks' import { useTokenBalances } from '../../../hooks' import { useActionOptions } from '../../../react/context' import { @@ -63,6 +68,34 @@ const Component: ActionComponent = (props) => { })), }) + const queryClient = useQueryClient() + const rebalancer = mustGetSupportedChainConfig(chainId).valence?.rebalancer + const serviceFee = useQueryLoadingDataWithError( + valenceRebalancerExtraQueries.rebalancerRegistrationServiceFee( + queryClient, + rebalancer + ? { + chainId, + address: rebalancer, + } + : undefined + ) + ) + useEffect(() => { + setValue( + (props.fieldNamePrefix + 'serviceFee') as 'serviceFee', + serviceFee.loading || + serviceFee.errored || + serviceFee.updating || + !serviceFee.data + ? undefined + : { + amount: serviceFee.data.balance, + denom: serviceFee.data.token.denomOrAddress, + } + ) + }, [props.fieldNamePrefix, serviceFee, setValue]) + return ( <> {context.type === ActionContextType.Dao && @@ -83,7 +116,28 @@ const Component: ActionComponent = (props) => { ({ + ...data, + // Subtract service fee from balance for corresponding + // token to ensure that they leave enough for the fee. + // This value is used as the input max. + balance: + !serviceFee.errored && + serviceFee.data && + tokensEqual(data.token, serviceFee.data.token) + ? ( + BigInt(balance) - BigInt(serviceFee.data.balance) + ).toString() + : balance, + })), + }, + serviceFee, }} /> @@ -177,7 +231,7 @@ export const makeCreateValenceAccountAction: ActionMaker< }) return useCallback( - ({ chainId, funds }) => { + ({ chainId, funds, serviceFee }) => { const config = getSupportedChainConfig(chainId) if (!config?.codeIds?.ValenceAccount || !config?.valence) { throw new Error(t('error.unsupportedValenceChain')) @@ -192,6 +246,35 @@ export const makeCreateValenceAccountAction: ActionMaker< ) } + const convertedFunds = funds.map(({ denom, amount }) => ({ + denom, + amount: convertDenomToMicroDenomStringWithDecimals( + amount, + (!nativeBalances.loading && + nativeBalances.data.find( + ({ token }) => + token.chainId === chainId && token.denomOrAddress === denom + )?.token.decimals) || + 0 + ), + })) + // Add service fee to funds. + if (serviceFee && serviceFee.amount !== '0') { + const existing = convertedFunds.find( + (f) => f.denom === serviceFee.denom + ) + if (existing) { + existing.amount = ( + BigInt(existing.amount) + BigInt(serviceFee.amount) + ).toString() + } else { + convertedFunds.push({ + denom: serviceFee.denom, + amount: serviceFee.amount, + }) + } + } + return maybeMakePolytoneExecuteMessage( currentChainId, chainId, @@ -208,19 +291,10 @@ export const makeCreateValenceAccountAction: ActionMaker< services_manager: config.valence.servicesManager, } as ValenceAccountInstantiateMsg) ), - funds: funds.map(({ denom, amount }) => ({ - denom, - amount: convertDenomToMicroDenomStringWithDecimals( - amount, - (!nativeBalances.loading && - nativeBalances.data.find( - ({ token }) => - token.chainId === chainId && - token.denomOrAddress === denom - )?.token.decimals) || - 0 - ), - })), + funds: convertedFunds + // Neutron errors with `invalid coins` if the funds list is + // not alphabetized. + .sort((a, b) => a.denom.localeCompare(b.denom)), salt: toUtf8(VALENCE_INSTANTIATE2_SALT), fixMsg: false, } as MsgInstantiateContract2, From 7f61944e7b3a28036402e44d0b4e987d0936c833 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 9 Jul 2024 17:01:18 -0400 Subject: [PATCH 312/438] show service fee not acknowledged error and fix negative balance --- .../CreateValenceAccount/Component.tsx | 3 ++ .../valence/CreateValenceAccount/index.tsx | 35 +++++++++++-------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/packages/stateful/actions/core/valence/CreateValenceAccount/Component.tsx b/packages/stateful/actions/core/valence/CreateValenceAccount/Component.tsx index 0a551135b..18f7cc4db 100644 --- a/packages/stateful/actions/core/valence/CreateValenceAccount/Component.tsx +++ b/packages/stateful/actions/core/valence/CreateValenceAccount/Component.tsx @@ -5,6 +5,7 @@ import { useTranslation } from 'react-i18next' import { Button, FormCheckbox, + InputErrorMessage, InputLabel, NativeCoinSelector, NativeCoinSelectorProps, @@ -181,6 +182,8 @@ export const CreateValenceAccountComponent: ActionComponent< })}

+ + )}
diff --git a/packages/stateful/actions/core/valence/CreateValenceAccount/index.tsx b/packages/stateful/actions/core/valence/CreateValenceAccount/index.tsx index dd2a7ded6..0323e000b 100644 --- a/packages/stateful/actions/core/valence/CreateValenceAccount/index.tsx +++ b/packages/stateful/actions/core/valence/CreateValenceAccount/index.tsx @@ -122,20 +122,27 @@ const Component: ActionComponent = (props) => { : { loading: false, updating: nativeBalances.updating, - data: nativeBalances.data.map(({ balance, ...data }) => ({ - ...data, - // Subtract service fee from balance for corresponding - // token to ensure that they leave enough for the fee. - // This value is used as the input max. - balance: - !serviceFee.errored && - serviceFee.data && - tokensEqual(data.token, serviceFee.data.token) - ? ( - BigInt(balance) - BigInt(serviceFee.data.balance) - ).toString() - : balance, - })), + data: nativeBalances.data.map( + ({ balance: _balance, ...data }) => { + // Subtract service fee from balance for corresponding + // token to ensure that they leave enough for the fee. + // This value is used as the input max. + let balance = + !serviceFee.errored && + serviceFee.data && + tokensEqual(data.token, serviceFee.data.token) + ? BigInt(_balance) - BigInt(serviceFee.data.balance) + : BigInt(_balance) + if (balance < 0n) { + balance = 0n + } + + return { + ...data, + balance: balance.toString(), + } + } + ), }, serviceFee, }} From 3c633b3fc7947ac3d65989fdc9e7256d3893e43a Mon Sep 17 00:00:00 2001 From: noah Date: Thu, 11 Jul 2024 02:33:59 -0400 Subject: [PATCH 313/438] Datetime picker (#1804) --- packages/i18n/locales/en/translation.json | 11 +- .../treasury/ManageVesting/BeginVesting.tsx | 47 +-- .../components/stateless/NewSurveyForm.tsx | 309 +++++++----------- .../components/inputs/DateTimePicker.css | 309 ++++++++++++++++++ .../components/inputs/DateTimePicker.tsx | 188 +++++++++++ packages/stateless/components/inputs/index.ts | 1 + packages/stateless/package.json | 1 + packages/utils/package.json | 2 + packages/utils/time.ts | 17 + packages/utils/validation/index.ts | 8 - yarn.lock | 119 ++++++- 11 files changed, 778 insertions(+), 234 deletions(-) create mode 100644 packages/stateless/components/inputs/DateTimePicker.css create mode 100644 packages/stateless/components/inputs/DateTimePicker.tsx diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index b234a12cb..0ae5c0743 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -434,8 +434,6 @@ "invalidActionKeys": "Invalid action keys found: {{keys}}", "invalidChain": "Invalid chain.", "invalidCosmosMessage": "Invalid <2>Cosmos message", - "invalidDate": "Invalid date format. Please use YYYY-MM-DD.", - "invalidDateTime": "Invalid date/time format. Please use YYYY-MM-DD HH:MM.", "invalidDuplicateFound": "Invalid. Duplicate found in other list.", "invalidExecuteMessage": "Invalid execute message", "invalidFileTypeBulkImport": "Invalid file type. Expected JSON or CSV.", @@ -580,15 +578,14 @@ "collectionName": "Collection name", "collectionSymbol": "Collection symbol", "combined": "Combined", - "compensationCycleName": "Compensation cycle name", "compensationCycleNamePlaceholder": "October Contributor Drop", "contractLabel": "Contract label", "contractPermissions": "Contract permissions", "contractPermissionsDescription": "The contract permissions this authorization grants the grantee.", "contribution": "Contribution", "contributionAttributes": "Contribution attributes", - "contributionAttributesDescription": "These are the values for which raters will be asked to provide ratings on contributions, and the associated tokens comprise the compensation paid out for that attribute. For example, \"Community impact\", \"Financial value\", \"Code quality\", etc.", - "contributionInstructionsPlaceholder": "This is what contributors will see when they submit their contributions. Explain how they should submit.", + "contributionAttributesDescription": "These are the values for which raters will be asked to provide ratings on submissions, and the associated tokens comprise the compensation paid out for that attribute. For example, \"Community impact\", \"Financial value\", \"Code quality\", etc.", + "contributionInstructionsPlaceholder": "This is what submitters will see. Provide some guidelines.", "contributionSubmitted": "You submitted a contribution for this cycle. Submitting again will overwrite your previous response.", "contributorAddress": "Contributor's address", "createNewCollection": "Create new collection", @@ -729,7 +726,7 @@ "quorumDescription": "The minimum percentage of voting power that must vote on a proposal for it to be considered. For example, in the US House of Representatives, 218 members must be present for a vote. If you have a DAO with many inactive members, setting this value too high may make it difficult to pass proposals.", "quorumDescription_create": "The minimum percentage of voting power that must vote on a proposal for it to be considered. For example, in the US House of Representatives, 218 members must be present for a vote. If you have a DAO with many inactive members, setting this value too high may make it difficult to pass proposals.\n\n*If not using a quorum for the single choice proposal passing threshold, this quorum will only apply to multiple choice proposals.*", "quorumTitle": "Quorum", - "ratingInstructionsPlaceholder": "This is what DAO members will see when they are rating the contributions. Explain how they should rate.", + "ratingInstructionsPlaceholder": "This is what DAO members will see when they are rating submissions. Provide some guidelines.", "ratingsSubmitted": "You submitted ratings for this cycle. Submitting again will overwrite your previous response.", "rebalancerBaseTokenDescription": "The token used to calculate the portfolio value. Tokens may be worth different values depending on the base token, though the market tends to consolidate prices through arbitrage.", "rebalancerMinBalanceDescription": "Require the rebalancer to maintain a minimum balance of one of the rebalanced tokens, overriding a lower target.", @@ -1013,6 +1010,7 @@ "daoInfoWillRefresh": "DAO information may take up to {{seconds}} seconds to update on all pages once proposal is executed.", "daoNameAZ": "DAO name (A → Z)", "daoNameZA": "DAO name (Z → A)", + "daoRatingsDescription": "Once the submission window closes, the members of this DAO will be able to rate each submission. Choose when the ratings window closes, and add some guidelines for the raters.", "daoVetoerExplanation": "A vetoer can veto proposals in the DAO.", "daodaoLogo": "DAO DAO Logo", "daodaoWithVersion": "DAO DAO v{{version}}", @@ -1274,6 +1272,7 @@ "proposalThresholdTooltip": "A proposal must attain this proportion of 'Yes' votes to pass.", "proposeDeleteTooltip": "Propose deleting this post", "proposeUpdateTooltip": "Propose updates to this post", + "publicSubmissionsDescription": "First, choose the time range during which submissions can be made, and add some guidelines for the submitters.", "pushNotificationsTooltip": "Receive inbox notifications on your mobile phone or browser.", "quorumTooltip_multiple": "The minimum amount of voting power that must vote on a proposal for it to be passable. When quorum is not met, even if a winner is chosen, the proposal will be rejected.", "quorumTooltip_single": "The minimum amount of voting power that must vote on a proposal for it to be passable. When quorum is not met, even if the passing threshold is met, the proposal will be rejected.", diff --git a/packages/stateful/actions/core/treasury/ManageVesting/BeginVesting.tsx b/packages/stateful/actions/core/treasury/ManageVesting/BeginVesting.tsx index 9048d4fda..cf566ffe9 100644 --- a/packages/stateful/actions/core/treasury/ManageVesting/BeginVesting.tsx +++ b/packages/stateful/actions/core/treasury/ManageVesting/BeginVesting.tsx @@ -15,10 +15,11 @@ import { Button, ChainProvider, CopyToClipboard, + DateTimePicker, + DateTimePickerNoForm, IconButton, InputErrorMessage, InputLabel, - InputThemedText, NumberInput, RadioInput, RadioInputOption, @@ -55,7 +56,6 @@ import { getDisplayNameForChainId, getSupportedChainConfig, makeValidateAddress, - makeValidateDate, validateNonNegative, validatePositive, validateRequired, @@ -227,9 +227,8 @@ export const BeginVesting: ActionComponent = ({ } }, [clearErrors, fieldNamePrefix, isCreating, setError, t, totalStepPercent]) - const formattedStartDate = startDate && formatDateTimeTz(startDate) - const formattedFinishDate = stepPoints?.length - ? formatDateTimeTz(new Date(stepPoints[stepPoints.length - 1].timestamp)) + const finishDate = stepPoints?.length + ? new Date(stepPoints[stepPoints.length - 1].timestamp) : undefined const selectedToken = tokens.find( @@ -562,39 +561,25 @@ export const BeginVesting: ActionComponent = ({
{/* Start Date */}
-
- + - {/* Date Preview */} - {formattedStartDate && isCreating && ( -

{formattedStartDate}

- )} +
+ +
- - {isCreating ? ( -
- - -
- ) : ( - {formattedStartDate} - )}
{/* Finish Date, once created */} - {!isCreating && formattedFinishDate && ( + {!isCreating && finishDate && (
- - {formattedFinishDate} - +
)}
diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/NewSurveyForm.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/NewSurveyForm.tsx index 049d9230d..04bbec34a 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/NewSurveyForm.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/NewSurveyForm.tsx @@ -1,22 +1,18 @@ import { Add } from '@mui/icons-material' -import clsx from 'clsx' import { useCallback } from 'react' import { FormProvider, useFieldArray, useForm } from 'react-hook-form' import { useTranslation } from 'react-i18next' import { Button, + DateTimePicker, InputErrorMessage, InputLabel, InputThemedText, TextAreaInput, TextInput, } from '@dao-dao/stateless' -import { - formatDateTimeTz, - makeValidateDate, - validateRequired, -} from '@dao-dao/utils' +import { validateRequired } from '@dao-dao/utils' import { NewSurveyFormData } from '../../types' import { NewAttribute, NewAttributeProps } from './NewAttribute' @@ -57,7 +53,6 @@ export const NewSurveyForm = ({ const contributionsCloseRatingsOpenAt = watch( 'contributionsCloseRatingsOpenAt' ) - const ratingsCloseAt = watch('ratingsCloseAt') const { append: appendAttribute, @@ -80,7 +75,7 @@ export const NewSurveyForm = ({ return (
@@ -90,7 +85,7 @@ export const NewSurveyForm = ({ {/* Survey Name */}
- +
-

- {t('title.publicSubmissions')} -

-
- {/* Contribution Dates */} -
- {/* Contribution Open Date */} -
-
+
+

+ {t('title.publicSubmissions')} +

+

+ {t('info.publicSubmissionsDescription')} +

+ +
+ {/* Contribution Dates */} +
+ {/* Contribution Open Date */} +
- {/* Date Preview */} - {!!contributionsOpenAt && - !isNaN(Date.parse(contributionsOpenAt)) && ( -

- {formatDateTimeTz(new Date(contributionsOpenAt))} -

- )} +
+ + +
-
- - -
-
- - {/* Contribution Close Date */} -
-
+ {/* Contribution Close Date */} +
- {/* Date Preview */} - {!!contributionsCloseRatingsOpenAt && - !isNaN(Date.parse(contributionsCloseRatingsOpenAt)) && ( -

- {formatDateTimeTz( - new Date(contributionsCloseRatingsOpenAt) - )} -

- )} +
+ + +
+
+ + {/* Contribution Instructions */} +
+ + {t('form.instructions')} + + {/* eslint-disable-next-line i18next/no-literal-string */} + {' – '} + {t('info.supportsMarkdown')} + +
- - // Valid if dates not yet available. - !( - contributionsOpenAt && - !isNaN(Date.parse(contributionsOpenAt)) && - contributionsCloseRatingsOpenAt && - !isNaN(Date.parse(contributionsCloseRatingsOpenAt)) - ) || - new Date(contributionsCloseRatingsOpenAt) > - new Date(contributionsOpenAt) || - t('error.closeDateMustBeAfterOpenDate'), - ]} - /> - +
- - {/* Contribution Instructions */} -
- - {t('form.instructions')} - - {/* eslint-disable-next-line i18next/no-literal-string */} - {' – '} - {t('info.supportsMarkdown')} - - - -
- - -
-
-

- {t('title.daoRatings')} -

-
- {/* Rating Dates */} -
- {/* Rating Open Date, same as Contribution Close Date */} -
-
+
+

{t('title.daoRatings')}

+

+ {t('info.daoRatingsDescription')} +

+ +
+ {/* Rating Dates */} +
+ {/* Rating Open Date, same as Contribution Close Date */} +
- {/* Date Preview */} - {!!contributionsCloseRatingsOpenAt && - !isNaN(Date.parse(contributionsCloseRatingsOpenAt)) && ( -

- {formatDateTimeTz( - new Date(contributionsCloseRatingsOpenAt) - )} -

- )} + {/* Set explicit height to match rating close date input */} + + {t('form.sameAsPublicSubmissionCloseDate')} +
- {/* Copy from contribution close date. */} - - {contributionsCloseRatingsOpenAt || - t('form.sameAsPublicSubmissionCloseDate')} - -
- - {/* Rating Close Date */} -
-
+ {/* Rating Close Date */} +
- {/* Date Preview */} - {!!ratingsCloseAt && !isNaN(Date.parse(ratingsCloseAt)) && ( -

- {formatDateTimeTz(new Date(ratingsCloseAt))} -

- )} +
+ + +
+
+ + {/* Rating Instructions */} +
+ + {t('form.instructions')} + + {/* eslint-disable-next-line i18next/no-literal-string */} + {' – '} + {t('info.supportsMarkdown')} + +
- - // Valid if dates not yet available. - !( - contributionsCloseRatingsOpenAt && - !isNaN(Date.parse(contributionsCloseRatingsOpenAt)) && - ratingsCloseAt && - !isNaN(Date.parse(ratingsCloseAt)) - ) || - new Date(ratingsCloseAt) > - new Date(contributionsCloseRatingsOpenAt) || - t('error.closeDateMustBeAfterOpenDate'), - ]} + rows={5} + validation={[validateRequired]} /> - +
- - {/* Rating Instructions */} -
- - {t('form.instructions')} - - {/* eslint-disable-next-line i18next/no-literal-string */} - {' – '} - {t('info.supportsMarkdown')} - - - -
- - -
-
-
+

{t('form.contributionAttributes')}

@@ -319,7 +252,7 @@ export const NewSurveyForm = ({ {t('form.contributionAttributesDescription')}

-
+
{attributes.map((attribute, index) => (
- diff --git a/packages/stateless/components/inputs/DateTimePicker.css b/packages/stateless/components/inputs/DateTimePicker.css new file mode 100644 index 000000000..ccd553bb1 --- /dev/null +++ b/packages/stateless/components/inputs/DateTimePicker.css @@ -0,0 +1,309 @@ +.react-datetime-picker { + display: inline-flex; + position: relative; +} + +.react-datetime-picker, +.react-datetime-picker *, +.react-datetime-picker *:before, +.react-datetime-picker *:after { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +.react-datetime-picker--disabled { + background-color: var(--background-interactive-disabled); + color: var(--text-interactive-disabled); +} + +.react-datetime-picker__wrapper { + display: flex; + flex-grow: 1; + flex-shrink: 0; + flex-direction: row; + align-items: center; + padding: 0.5rem 0.75rem; + overflow-x: auto; + width: 100%; +} + +.react-datetime-picker__wrapper input, +.react-datetime-picker__wrapper select { + outline: none !important; + cursor: text; +} + +/* Hide AM/PM dropdown arrow icon */ +.react-datetime-picker__wrapper select { + /* for Firefox */ + -moz-appearance: none; + /* for Chrome */ + -webkit-appearance: none; +} +/* For IE10 */ +.react-datetime-picker__wrapper select::-ms-expand { + display: none; +} + +.react-datetime-picker__inputGroup { + min-width: calc(4px + (4px * 3) + 0.54em * 6 + 0.217em * 2); + flex-shrink: 0; + padding: 0 2px; +} + +.react-datetime-picker__inputGroup__divider { + padding: 1px 0; + white-space: pre; +} + +.react-datetime-picker__inputGroup__divider, +.react-datetime-picker__inputGroup__leadingZero { + display: inline-block; + font: inherit; +} + +.react-datetime-picker__inputGroup__input { + min-width: 0.54em; + height: calc(100% - 2px); + position: relative; + padding: 1px; + border: 0; + background: none; + color: currentColor; + font: inherit; + box-sizing: content-box; + -webkit-appearance: textfield; + -moz-appearance: textfield; + appearance: textfield; +} + +.react-datetime-picker__inputGroup__input::-webkit-outer-spin-button, +.react-datetime-picker__inputGroup__input::-webkit-inner-spin-button { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + margin: 0; +} + +.react-datetime-picker__inputGroup__input:invalid { + background: var(--background-interactive-error); +} + +.react-datetime-picker__inputGroup__input--hasLeadingZero { + margin-left: -0.54em; + padding-left: calc(1px + 0.54em); +} + +.react-datetime-picker__inputGroup__amPm { + font: inherit; + -webkit-appearance: menulist; + -moz-appearance: menulist; + appearance: menulist; +} + +.react-datetime-picker__calendar-button { + flex-grow: 1; +} + +.react-datetime-picker__button { + border: 0; + background: transparent; + padding: 0.25rem 0.375rem; +} + +.react-datetime-picker__button:enabled { + cursor: pointer; +} + +.react-datetime-picker__button:enabled:hover + .react-datetime-picker__button__icon, +.react-datetime-picker__button:enabled:focus + .react-datetime-picker__button__icon { + stroke: var(--icon-brand); +} + +.react-datetime-picker__button:disabled .react-datetime-picker__button__icon { + stroke: var(--icon-interactive-disabled); +} + +.react-datetime-picker__button svg { + display: inherit; +} + +.react-datetime-picker__calendar { + z-index: 1; +} + +.react-datetime-picker__calendar--closed { + display: none; +} + +.react-datetime-picker__calendar { + width: 20rem; + max-width: 96vw; + margin-top: 0.25rem; +} + +.react-datetime-picker__calendar .react-calendar { + border-width: thin; +} + +.react-calendar { + width: 350px; + max-width: 100%; + background: var(--component-dropdown); + border: 1px solid var(--border-primary); + color: var(--text-primary); + line-height: 1.125rem; + border-radius: 0.375rem; + overflow: hidden; +} + +.react-calendar--doubleView { + width: 700px; +} + +.react-calendar--doubleView .react-calendar__viewContainer { + display: flex; + margin: -0.5rem; +} + +.react-calendar--doubleView .react-calendar__viewContainer > * { + width: 50%; + margin: 0.5rem; +} + +.react-calendar, +.react-calendar *, +.react-calendar *:before, +.react-calendar *:after { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +.react-calendar button { + margin: 0; + border: 0; + outline: none; +} + +.react-calendar button:enabled:hover { + cursor: pointer; +} + +.react-calendar__navigation { + display: flex; + height: 2.75rem; + margin-bottom: 0.25rem; +} + +.react-calendar__navigation button { + min-width: 2.75rem; + background: none; + border-radius: 0.125rem; +} + +.react-calendar__navigation button:disabled { + opacity: 0.2; +} + +.react-calendar__navigation button:enabled:hover { + opacity: 0.8; + background-color: var(--background-button-secondary-default); +} + +.react-calendar__navigation button:enabled:active, +.react-calendar__navigation button:enabled:focus { + opacity: 0.7; + background-color: var(--background-button-secondary-default); +} + +.react-calendar__month-view__weekdays { + text-align: center; + text-transform: uppercase; + font: inherit; + font-size: 0.75em; + font-weight: bold; +} + +.react-calendar__month-view__weekdays__weekday { + padding: 0.5em; +} + +.react-calendar__month-view__weekdays__weekday abbr { + text-decoration: none; +} + +.react-calendar__month-view__weekNumbers .react-calendar__tile { + display: flex; + align-items: center; + justify-content: center; + font: inherit; + font-size: 0.75em; + font-weight: bold; +} + +/* .react-calendar__month-view__days__day--weekend {} */ + +.react-calendar__month-view__days__day--neighboringMonth, +.react-calendar__decade-view__years__year--neighboringDecade, +.react-calendar__century-view__decades__decade--neighboringCentury { + color: var(--text-tertiary); +} + +.react-calendar__year-view .react-calendar__tile, +.react-calendar__decade-view .react-calendar__tile, +.react-calendar__century-view .react-calendar__tile { + padding: 1.25rem 0.75rem; + font-size: 0.9em; +} + +.react-calendar__tile { + max-width: 100%; + padding: 0.625rem 0.42rem; + background: none; + text-align: center; + line-height: 1rem; + font: inherit; + font-size: 0.833em; + transition: all 150ms ease; + border-radius: 0.125rem; +} + +.react-calendar__tile:disabled { + opacity: 0.1; +} + +/* .react-calendar__month-view__days__day--neighboringMonth:disabled, +.react-calendar__decade-view__years__year--neighboringDecade:disabled, +.react-calendar__century-view__decades__decade--neighboringCentury:disabled {} */ + +.react-calendar__tile:enabled:hover { + opacity: 0.8; + background-color: var(--background-button-secondary-default); +} + +.react-calendar__tile:enabled:active, +.react-calendar__tile:enabled:focus { + opacity: 0.7; + background-color: var(--background-button-secondary-default); +} + +.react-calendar__tile--now { + background: var(--background-interactive-active) !important; +} + +.react-calendar__tile--active, +.react-calendar__tile--hasActive { + background: var(--background-button-active) !important; +} + +.react-calendar__tile--hasActive { + opacity: 0.8; +} + +.react-calendar--selectRange .react-calendar__tile--hover { + background-color: var(--background-interactive-valid); +} diff --git a/packages/stateless/components/inputs/DateTimePicker.tsx b/packages/stateless/components/inputs/DateTimePicker.tsx new file mode 100644 index 000000000..8c531ca55 --- /dev/null +++ b/packages/stateless/components/inputs/DateTimePicker.tsx @@ -0,0 +1,188 @@ +import './DateTimePicker.css' + +import { Today } from '@mui/icons-material' +import clsx from 'clsx' +import { useEffect, useState } from 'react' +import ReactDateTimePicker from 'react-datetime-picker' +import { + Control, + Controller, + FieldPathValue, + FieldValues, + Path, + Validate, +} from 'react-hook-form' +import { useTranslation } from 'react-i18next' + +import { browserIs12Hour, browserTimeZone } from '@dao-dao/utils' + +import { useUpdatingRef } from '../../hooks' + +export type DateTimePickerNoFormProps = { + /** + * Date value. + */ + value: string | Date | null | undefined + /** + * The onChange function that is called when the value changes. + */ + onChange?: (value: Date | null) => void | Promise + /** + * Override default input field name of "datetime". + */ + name?: string + /** + * Any truthy value adds an error border style. + */ + error?: unknown + /** + * Whether or not the input is disabled. + */ + disabled?: boolean + /** + * Minimum date. + */ + minDate?: Date + /** + * Maximum date. + */ + maxDate?: Date + /** + * Optional class names to apply to the input container. + */ + className?: string +} + +export type DateTimePickerProps< + FV extends FieldValues, + FieldName extends Path +> = Omit & { + /** + * The control value returned by `useForm`. + */ + control: Control + /** + * The field name for the value this will contain. + */ + fieldName: FieldName + /** + * A list of functions that, when given the current value of this field, + * return true if the value is valid and an error message otherwise. + */ + validation?: Validate>[] + /** + * Whether or not the input is required. + */ + required?: boolean +} + +export const DateTimePicker = < + FV extends FieldValues, + FieldName extends Path +>({ + control, + fieldName, + validation, + required, + ...props +}: DateTimePickerProps) => { + const { t } = useTranslation() + const validate = validation?.reduce( + (a, v) => ({ ...a, [v.toString()]: v }), + {} + ) + + return ( + ( + + )} + rules={{ + required: required && t('info.required'), + validate, + }} + /> + ) +} + +export const DateTimePickerNoForm = ({ + value, + onChange, + name, + error, + disabled, + minDate, + maxDate, + className, +}: DateTimePickerNoFormProps) => { + // Check if locale uses 12/24 hour format. + const [is12HourFormat] = useState(browserIs12Hour) + const [tz] = useState(browserTimeZone) + + // If min or max date change, update the value manually if needed. + const onChangeRef = useUpdatingRef(onChange) + useEffect(() => { + if ( + disabled || + !onChangeRef.current || + !value || + (typeof value === 'string' && isNaN(Date.parse(value))) || + (!minDate && !maxDate) + ) { + return + } + + const date = value instanceof Date ? value : new Date(value) + + if (minDate && date < minDate) { + onChangeRef.current(minDate) + } else if (maxDate && date > maxDate) { + onChangeRef.current(maxDate) + } + }, [minDate, maxDate, onChangeRef, value, disabled]) + + return ( + ( +
+ {/* Add timezone in between the time and calendar icon button */} +

e.stopPropagation()} + > + {tz} +

+ + {!disabled && ( + + )} +
+ )} + className={clsx( + '!secondary-text !text-text-body w-full transition !bg-transparent focus:outline-none rounded-md ring-1 focus:ring-2', + // Outline color + error + ? 'ring-border-interactive-error' + : 'ring-border-primary focus:ring-border-interactive-focus', + className + )} + clearIcon={null} + dayPlaceholder="00" + disableClock + disabled={disabled} + format={'y-MM-dd ' + (is12HourFormat ? `h:mm a` : 'HH:mm')} + hourPlaceholder={is12HourFormat ? '0' : '00'} + maxDate={maxDate} + minDate={minDate} + minutePlaceholder="00" + monthPlaceholder="00" + name={name} + onChange={onChange} + value={value} + yearPlaceholder="0000" + /> + ) +} diff --git a/packages/stateless/components/inputs/index.ts b/packages/stateless/components/inputs/index.ts index 36a332b35..e0d7df9a7 100644 --- a/packages/stateless/components/inputs/index.ts +++ b/packages/stateless/components/inputs/index.ts @@ -1,6 +1,7 @@ export * from './AddressInput' export * from './Checkbox' export * from './CodeMirrorInput' +export * from './DateTimePicker' export * from './DaoSupportedChainPickerInput' export * from './Dropdown' export * from './FileDropInput' diff --git a/packages/stateless/package.json b/packages/stateless/package.json index 08e6921a9..a8661fc69 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -32,6 +32,7 @@ "react-codemirror2": "^7.2.1", "react-confetti": "^6.1.0", "react-csv": "^2.2.2", + "react-datetime-picker": "^6.0.1", "react-hook-form": "7.20.4", "react-hot-toast": "^2.1.1", "react-intersection-observer": "^9.4.1", diff --git a/packages/utils/package.json b/packages/utils/package.json index 8f66c07d6..2d9f43afc 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -27,6 +27,7 @@ "json5": "^2.2.0", "lodash.clonedeep": "^4.5.0", "long": "^5.2.1", + "luxon": "^3.4.4", "next-i18next": "^11.0.0", "query-string": "^7.1.3", "react-hot-toast": "^2.1.1", @@ -42,6 +43,7 @@ "@cosmjs/proto-signing": "^0.32.3", "@dao-dao/config": "2.4.2-rc.1", "@tanstack/react-query": "^5.40.0", + "@types/luxon": "^3.4.2", "@types/pako": "^2.0.3", "commander": "^12.1.0", "cosmjs-types": "^0.9.0", diff --git a/packages/utils/time.ts b/packages/utils/time.ts index 2e4c77a24..6287bed18 100644 --- a/packages/utils/time.ts +++ b/packages/utils/time.ts @@ -1,3 +1,5 @@ +import { DateTime } from 'luxon' + const secPerDay = 24 * 60 * 60 export const secondsToWdhms = ( seconds: string | number, @@ -69,3 +71,18 @@ export const findValueAtTimestamp = ( : // Otherwise just use the previous value. data[nextIndex - 1] } + +/** + * Check whether or not the browser uses 12-hour time with AM/PM. + */ +export const browserIs12Hour = () => + new Intl.DateTimeFormat(navigator.language, { + hour: 'numeric', + }) + .formatToParts() + .some((part) => part.type === 'dayPeriod') + +/** + * Get current browser's time zone abbreviation. + */ +export const browserTimeZone = () => DateTime.local().toFormat('ZZZZ') diff --git a/packages/utils/validation/index.ts b/packages/utils/validation/index.ts index d22597551..b1ba7d4ef 100644 --- a/packages/utils/validation/index.ts +++ b/packages/utils/validation/index.ts @@ -1,5 +1,4 @@ import JSON5 from 'json5' -import { TFunction } from 'react-i18next' import { isValidBech32Address, @@ -51,13 +50,6 @@ export const validateUrlWithIpfs = (v: string | undefined) => (v && isValidUrl(v, true)) || 'Invalid image URL: must start with https or ipfs.' -export const makeValidateDate = - (t: TFunction, time = false, required = true) => - (v: string | undefined) => - (!required && !v) || - (v && !isNaN(Date.parse(v))) || - t(time ? 'error.invalidDateTime' : 'error.invalidDate') - export const makeValidateTokenFactoryDenom = (bech32Prefix: string, required = true) => (v: any) => diff --git a/yarn.lock b/yarn.lock index bec988948..757fc600d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8817,6 +8817,11 @@ resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a" integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== +"@types/luxon@^3.4.2": + version "3.4.2" + resolved "https://registry.yarnpkg.com/@types/luxon/-/luxon-3.4.2.tgz#e4fc7214a420173cea47739c33cdf10874694db7" + integrity sha512-TifLZlFudklWlMBfhubvgqTXRzLDI5pCbGa4P8a3wPyUQSW+1xQ5eDsreP9DWHX3tjq1ke96uYG/nwundroWcA== + "@types/mdast@^3.0.0": version "3.0.10" resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-3.0.10.tgz#4724244a82a4598884cbbe9bcfd73dff927ee8af" @@ -10102,6 +10107,11 @@ fast-url-parser "^1.1.3" tslib "^2.3.1" +"@wojtekmaj/date-utils@^1.1.3", "@wojtekmaj/date-utils@^1.5.0": + version "1.5.1" + resolved "https://registry.yarnpkg.com/@wojtekmaj/date-utils/-/date-utils-1.5.1.tgz#c3cd67177ac781cfa5736219d702a55a2aea5f2b" + integrity sha512-+i7+JmNiE/3c9FKxzWFi2IjRJ+KzZl1QPu6QNrsgaa2MuBgXvUy4gA1TVzf/JMdIIloB76xSKikTWuyYAIVLww== + "@wry/caches@^1.0.0": version "1.0.1" resolved "https://registry.yarnpkg.com/@wry/caches/-/caches-1.0.1.tgz#8641fd3b6e09230b86ce8b93558d44cf1ece7e52" @@ -12153,6 +12163,11 @@ clsx@^1.1.1, clsx@^1.2.1: resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.2.1.tgz#0ddc4a20a549b59c93a4116bb26f5294ca17dc12" integrity sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg== +clsx@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/clsx/-/clsx-2.1.1.tgz#eed397c9fd8bd882bfb18deab7102049a2f32999" + integrity sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA== + cmd-shim@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/cmd-shim/-/cmd-shim-5.0.0.tgz#8d0aaa1a6b0708630694c4dbde070ed94c707724" @@ -13182,6 +13197,11 @@ detect-browser@5.3.0, detect-browser@^5.2.0: resolved "https://registry.yarnpkg.com/detect-browser/-/detect-browser-5.3.0.tgz#9705ef2bddf46072d0f7265a1fe300e36fe7ceca" integrity sha512-53rsFbGdwMwlF7qvCt0ypLM5V5/Mbl0szB7GPN8y9NCcbknYOeVVXdrXEq+90IwAfrrzt6Hd+u2E2ntakICU8w== +detect-element-overflow@^1.4.0: + version "1.4.2" + resolved "https://registry.yarnpkg.com/detect-element-overflow/-/detect-element-overflow-1.4.2.tgz#2e48509e5aa07647f4335b5f4f52c146b92f99c5" + integrity sha512-4m6cVOtvm/GJLjo7WFkPfwXoEIIbM7GQwIh4WEa4g7IsNi1YzwUsGL5ApNLrrHL29bHeNeQ+/iZhw+YHqgE2Fw== + detect-indent@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" @@ -15197,6 +15217,13 @@ get-symbol-description@^1.0.0: call-bind "^1.0.2" get-intrinsic "^1.1.1" +get-user-locale@^2.2.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/get-user-locale/-/get-user-locale-2.3.2.tgz#d37ae6e670c2b57d23a96fb4d91e04b2059d52cf" + integrity sha512-O2GWvQkhnbDoWFUJfaBlDIKUEdND8ATpBXD6KXcbhxlfktyD/d8w6mkzM/IlQEqGZAMz/PW6j6Hv53BiigKLUQ== + dependencies: + mem "^8.0.0" + get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" @@ -18426,6 +18453,11 @@ lru-queue@^0.1.0: dependencies: es5-ext "~0.10.2" +luxon@^3.4.4: + version "3.4.4" + resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.4.4.tgz#cf20dc27dc532ba41a169c43fdcc0063601577af" + integrity sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA== + magic-string@^0.27.0: version "0.27.0" resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.27.0.tgz#e4a3413b4bab6d98d2becffd48b4a257effdbbf3" @@ -18453,6 +18485,11 @@ make-error@1.x, make-error@^1.1.1: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== +make-event-props@^1.6.0: + version "1.6.2" + resolved "https://registry.yarnpkg.com/make-event-props/-/make-event-props-1.6.2.tgz#c8e0e48eb28b9b808730de38359f6341de7ec5a2" + integrity sha512-iDwf7mA03WPiR8QxvcVHmVWEPfMY1RZXerDVNCRYW7dUr2ppH3J58Rwb39/WG39yTZdRSxr3x+2v22tvI0VEvA== + make-fetch-happen@^10.0.3, make-fetch-happen@^10.0.6: version "10.2.1" resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-10.2.1.tgz#f5e3835c5e9817b617f2770870d9492d28678164" @@ -18718,7 +18755,7 @@ meilisearch@^0.30.0: dependencies: cross-fetch "^3.1.5" -mem@^8.1.1: +mem@^8.0.0, mem@^8.1.1: version "8.1.1" resolved "https://registry.yarnpkg.com/mem/-/mem-8.1.1.tgz#cf118b357c65ab7b7e0817bdf00c8062297c0122" integrity sha512-qFCFUDs7U3b8mBDPyz5EToEKoAkgCzqquIgi9nkkR9bixxOVOre+09lbuH7+9Kn2NFpm56M3GUWVbU2hQgdACA== @@ -21681,11 +21718,30 @@ rc@^1.2.7: minimist "^1.2.0" strip-json-comments "~2.0.1" +react-calendar@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/react-calendar/-/react-calendar-5.0.0.tgz#cf302db689ee1bba53d92644f7543e12164a7c0e" + integrity sha512-bHcE5e5f+VUKLd4R19BGkcSQLpuwjKBVG0fKz74cwPW5xDfNsReHdDbfd4z3mdjuUuZzVtw4Q920mkwK5/ZOEg== + dependencies: + "@wojtekmaj/date-utils" "^1.1.3" + clsx "^2.0.0" + get-user-locale "^2.2.1" + warning "^4.0.0" + react-chartjs-2@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/react-chartjs-2/-/react-chartjs-2-5.2.0.tgz#43c1e3549071c00a1a083ecbd26c1ad34d385f5d" integrity sha512-98iN5aguJyVSxp5U3CblRLH67J8gkfyGNbiK3c+l1QI/G4irHMPQw44aEPmjVag+YKTyQ260NcF82GTQ3bdscA== +react-clock@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/react-clock/-/react-clock-5.0.0.tgz#369b1c258b304a538a4de7d8cae18c7be77e51d5" + integrity sha512-Cj3XqwLB1svtGWiw/A6vmLIPb9OhA/BsWUpS46lXTNTilK7zmP2zmtFgQEAfWUssc3nERXkMXzI0YrkzDpc0gQ== + dependencies: + "@wojtekmaj/date-utils" "^1.5.0" + clsx "^2.0.0" + get-user-locale "^2.2.1" + react-codemirror2@^7.2.1: version "7.2.1" resolved "https://registry.yarnpkg.com/react-codemirror2/-/react-codemirror2-7.2.1.tgz#38dab492fcbe5fb8ebf5630e5bb7922db8d3a10c" @@ -21703,6 +21759,34 @@ react-csv@^2.2.2: resolved "https://registry.yarnpkg.com/react-csv/-/react-csv-2.2.2.tgz#5bbf0d72a846412221a14880f294da9d6def9bfb" integrity sha512-RG5hOcZKZFigIGE8LxIEV/OgS1vigFQT4EkaHeKgyuCbUAu9Nbd/1RYq++bJcJJ9VOqO/n9TZRADsXNDR4VEpw== +react-date-picker@^11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/react-date-picker/-/react-date-picker-11.0.0.tgz#f7dc25e9a679f94ad44f11644ea0fdc541be1834" + integrity sha512-l+siu5HSZ/ciGL1293KCAHl4o9aD5rw16V4tB0C43h7QbMv2dWGgj7Dxgt8iztLaPVtEfOt/+sxNiTYw4WVq6A== + dependencies: + "@wojtekmaj/date-utils" "^1.1.3" + clsx "^2.0.0" + get-user-locale "^2.2.1" + make-event-props "^1.6.0" + react-calendar "^5.0.0" + react-fit "^2.0.0" + update-input-width "^1.4.0" + +react-datetime-picker@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/react-datetime-picker/-/react-datetime-picker-6.0.1.tgz#7a88ba84cdccd5096029965966723d74a0461535" + integrity sha512-G7W8bK0SLuO66RVWYGD2q1bD4Wk4pUOpJCq9r44A4P33uq0aAtd3dT1HNEu2fvlmMpYxC4J571ZPI9bUG46pDA== + dependencies: + "@wojtekmaj/date-utils" "^1.1.3" + clsx "^2.0.0" + get-user-locale "^2.2.1" + make-event-props "^1.6.0" + react-calendar "^5.0.0" + react-clock "^5.0.0" + react-date-picker "^11.0.0" + react-fit "^2.0.0" + react-time-picker "^7.0.0" + react-docgen-typescript@^2.1.1: version "2.2.2" resolved "https://registry.yarnpkg.com/react-docgen-typescript/-/react-docgen-typescript-2.2.2.tgz#4611055e569edc071204aadb20e1c93e1ab1659c" @@ -21746,6 +21830,14 @@ react-fast-compare@^3.0.1: resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.0.tgz#641a9da81b6a6320f270e89724fb45a0b39e43bb" integrity sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA== +react-fit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/react-fit/-/react-fit-2.0.1.tgz#4bcb4de7aa94c9fdf452b0c63de0889496f50244" + integrity sha512-Eip6ALs/+6Jv82Si0I9UnfysdwVlAhkkZRycgmMdnj7jwUg69SVFp84ICxwB8zszkfvJJ2MGAAo9KAYM8ZUykQ== + dependencies: + detect-element-overflow "^1.4.0" + warning "^4.0.0" + react-hook-form@7.20.4: version "7.20.4" resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.20.4.tgz#7c23dcaed54812fba9ac63be0313b7c5d11d2b93" @@ -21842,6 +21934,19 @@ react-refresh@^0.11.0: resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.11.0.tgz#77198b944733f0f1f1a90e791de4541f9f074046" integrity sha512-F27qZr8uUqwhWZboondsPx8tnC3Ct3SxZA3V5WyEvujRyyNv0VYPhoBg1gZ8/MV5tubQp76Trw8lTv9hzRBa+A== +react-time-picker@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/react-time-picker/-/react-time-picker-7.0.0.tgz#3f9d80d2de8a8ffc57c41dd71095477f6a7ffc03" + integrity sha512-k6mUjkI+OsY73mg0yjMxqkLXv/UXR1LN7AARNqfyGZOwqHqo1JrjL3lLHTHWQ86HmPTBL/dZACbIX/fV1NLmWg== + dependencies: + "@wojtekmaj/date-utils" "^1.1.3" + clsx "^2.0.0" + get-user-locale "^2.2.1" + make-event-props "^1.6.0" + react-clock "^5.0.0" + react-fit "^2.0.0" + update-input-width "^1.4.0" + react-timeago@^7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/react-timeago/-/react-timeago-7.2.0.tgz#ae929d7423a63cbc3dc228e49d22fbf586d459ca" @@ -25084,6 +25189,11 @@ update-browserslist-db@^1.0.13: escalade "^3.1.2" picocolors "^1.0.0" +update-input-width@^1.4.0: + version "1.4.2" + resolved "https://registry.yarnpkg.com/update-input-width/-/update-input-width-1.4.2.tgz#49d327a39395185b0fd440b9c3b1d6f81173655c" + integrity sha512-/p0XLhrQQQ4bMWD7bL9duYObwYCO1qGr8R19xcMmoMSmXuQ7/1//veUnCObQ7/iW6E2pGS6rFkS4TfH4ur7e/g== + upper-case-first@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/upper-case-first/-/upper-case-first-2.0.2.tgz#992c3273f882abd19d1e02894cc147117f844324" @@ -25374,6 +25484,13 @@ walker@^1.0.7, walker@^1.0.8, walker@~1.0.5: dependencies: makeerror "1.0.12" +warning@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/warning/-/warning-4.0.3.tgz#16e9e077eb8a86d6af7d64aa1e05fd85b4678ca3" + integrity sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w== + dependencies: + loose-envify "^1.0.0" + wasm-ast-types@^0.25.0: version "0.25.0" resolved "https://registry.yarnpkg.com/wasm-ast-types/-/wasm-ast-types-0.25.0.tgz#9f4056803c99fae6899c1f226e46cf730d9fe2db" From 275ebe6f4457ec087772467ce1b69c56a28c321e Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 11 Jul 2024 02:44:42 -0400 Subject: [PATCH 314/438] updated secret code IDs/hashes --- packages/utils/constants/chains.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 7ebca86d5..5ea6f2cb7 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -2177,7 +2177,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // codeIds: { // // TODO(secret-testnet) // Cw1Whitelist: -1, - // Cw4Group: 9158, + // Cw4Group: 9161, // Cw20Base: 8164, // snip20 // Cw721Base: 8172, // snip721 // CwPayrollFactory: 8186, @@ -2194,7 +2194,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // DaoVotingCw20Staked: 8170, // snip20 // DaoVotingCw721Staked: 8182, // snip721 // DaoVotingTokenStaked: 8174, - // QueryAuth: 8195, + // QueryAuth: 9323, // // unused // CwTokenfactoryIssuerMain: -1, @@ -2204,7 +2204,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // // TODO(secret-testnet) // Cw1Whitelist: '', // Cw4Group: - // 'dbf5ab79a2fee24347284fc1be79df2ff5506b8002e317426d3025060e6b782b', + // '588d5b95d865df2b18d05fa32f93fc6d82864ec84cca87ef139390e6e0524e58', // Cw20Base: // 'c2508a75824974eeaa578a5d1af07006b1c3911b5c2909813d74672797264775', // snip20 // Cw721Base: @@ -2238,7 +2238,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // DaoVotingTokenStaked: // '3bc835c9e0fdd0deea88202d3de32caa8125891eb0821973f1c5244f818f2d45', // QueryAuth: - // 'dbedf461d93392c5f5e36e07feb46ac4ce0700069d1be6c0796980ef48d1aab4', + // 'a9e52a8f517de56ad7fb21a1d57c43e9442d425f91ba2f2a190bea90ee504f46', // // unused // CwTokenfactoryIssuerMain: '', From e0b1dc26aef404e04d15fa6bced0acdb0a1d7b45 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 11 Jul 2024 13:29:41 -0400 Subject: [PATCH 315/438] updated secret code IDs/hashes --- packages/utils/constants/chains.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 5ea6f2cb7..5fe4ff699 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -2177,20 +2177,20 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // codeIds: { // // TODO(secret-testnet) // Cw1Whitelist: -1, - // Cw4Group: 9161, + // Cw4Group: 9422, // Cw20Base: 8164, // snip20 // Cw721Base: 8172, // snip721 // CwPayrollFactory: 8186, // CwTokenSwap: 8187, // CwVesting: 8189, - // DaoCore: 9155, + // DaoCore: 9426, // DaoPreProposeApprovalSingle: 8180, // DaoPreProposeApprover: 8181, - // DaoPreProposeMultiple: 8177, - // DaoPreProposeSingle: 8175, - // DaoProposalMultiple: 8178, - // DaoProposalSingle: 8176, - // DaoVotingCw4: 9160, + // DaoPreProposeMultiple: 9416, + // DaoPreProposeSingle: 9415, + // DaoProposalMultiple: 9414, + // DaoProposalSingle: 9413, + // DaoVotingCw4: 9421, // DaoVotingCw20Staked: 8170, // snip20 // DaoVotingCw721Staked: 8182, // snip721 // DaoVotingTokenStaked: 8174, @@ -2204,7 +2204,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // // TODO(secret-testnet) // Cw1Whitelist: '', // Cw4Group: - // '588d5b95d865df2b18d05fa32f93fc6d82864ec84cca87ef139390e6e0524e58', + // '06882aeaecdd4bf6c364dca04acaa774eddfb5524efbb33a4e4c7b0ecd8e2939', // Cw20Base: // 'c2508a75824974eeaa578a5d1af07006b1c3911b5c2909813d74672797264775', // snip20 // Cw721Base: @@ -2216,7 +2216,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // CwVesting: // '0dae83b3616c066d0cdbf061b977707f99d6b91bdc7b44a81285a688e37552b0', // DaoCore: - // '24514b34e44eed3898400192d8744fdb0f89cb98cec0377127d364dc2e71ce6f', + // '4b8a0809f9548934eef483e3a93ec1dcdcd98df7ba4798f0683c3cc1666930e1', // DaoPreProposeApprovalSingle: // '88410e9c96687c01af289c59730d90a425a974c81abf20a76597f076959cb7fc', // DaoPreProposeApprover: @@ -2226,9 +2226,9 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // DaoPreProposeSingle: // 'd5fde27c749424968f14a70f4383d3aa1df97ba9ab4933a7e648186ecf8afa1c', // DaoProposalMultiple: - // '78584b7acdbeae211e71b8711147985217999ab7cf146812df456c48a24835b9', + // 'dfc954ec00f93cb9b45930adcd0aa62ba273bc7d48e5a094b51cbba78b0ddbb5', // DaoProposalSingle: - // '0d412146fccc5936cacc463db54e7721eae03d13977e4c3c3ee570fdbba530c6', + // 'd617f9f97dbb13794292cb7da3f6b8bd20061ca8f51444456c1b2e0aff96d2b9', // DaoVotingCw4: // 'f80641ebe9bf07ac2e44f6a7c33de7ece8d4706a709b3ea2ccad046384251009', // DaoVotingCw20Staked: From c23b243bf9e5137df6d449edbdb8850ca5675f7c Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 11 Jul 2024 14:31:16 -0400 Subject: [PATCH 316/438] updated secret code IDs/hashes and factory address --- packages/utils/constants/chains.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 5fe4ff699..3c031a32e 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -2164,7 +2164,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // name: 'secret', // mainnet: false, // accentColor: '#000000', - // factoryContractAddress: 'secret13dk93ms25qu8j06pxn2p9yphzmsskpejtmddh0', + // factoryContractAddress: 'secret1tns0rehvxwggxqhnwe4s57g57d2ym70su8ta0g', // noIndexer: true, // createWithCw20: true, // explorerUrlTemplates: { @@ -2183,7 +2183,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // CwPayrollFactory: 8186, // CwTokenSwap: 8187, // CwVesting: 8189, - // DaoCore: 9426, + // DaoCore: 9430, // DaoPreProposeApprovalSingle: 8180, // DaoPreProposeApprover: 8181, // DaoPreProposeMultiple: 9416, @@ -2216,7 +2216,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // CwVesting: // '0dae83b3616c066d0cdbf061b977707f99d6b91bdc7b44a81285a688e37552b0', // DaoCore: - // '4b8a0809f9548934eef483e3a93ec1dcdcd98df7ba4798f0683c3cc1666930e1', + // 'e31dd725fac8537c5498f3f08efee522a6544ef0144a5c5176d02c2fe57c241e', // DaoPreProposeApprovalSingle: // '88410e9c96687c01af289c59730d90a425a974c81abf20a76597f076959cb7fc', // DaoPreProposeApprover: From 974301e372bd08e38c79ecc682d9509e0926d777 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 15 Jul 2024 13:25:04 -0500 Subject: [PATCH 317/438] default kujira tokens to 6 decimals --- packages/state/query/queries/chain.ts | 8 +- packages/state/query/queries/contract.ts | 25 +++ packages/state/query/queries/token.ts | 67 ++++++- packages/state/recoil/selectors/contract.ts | 17 -- packages/state/recoil/selectors/token.ts | 178 +----------------- .../NftBased/GovernanceConfigurationInput.tsx | 20 +- .../UnstakingDurationVotingConfigItem.tsx | 24 ++- 7 files changed, 130 insertions(+), 209 deletions(-) diff --git a/packages/state/query/queries/chain.ts b/packages/state/query/queries/chain.ts index d02757c23..23e67ee4d 100644 --- a/packages/state/query/queries/chain.ts +++ b/packages/state/query/queries/chain.ts @@ -342,7 +342,13 @@ export const fetchDenomMetadata = async ({ ? displayDenom.denom.split('/').pop()! : displayDenom.denom : metadata.symbol) || denom, - preferredDecimals: displayDenom?.exponent ?? 0, + preferredDecimals: + displayDenom?.exponent || + (chainId === ChainId.KujiraMainnet || + chainId === ChainId.KujiraTestnet + ? // Kujira does not let setting token metadata, so default to 6. + 6 + : 0), } } } catch (err) { diff --git a/packages/state/query/queries/contract.ts b/packages/state/query/queries/contract.ts index 0782e9e89..f24bd9638 100644 --- a/packages/state/query/queries/contract.ts +++ b/packages/state/query/queries/contract.ts @@ -11,6 +11,7 @@ import { isSecretNetwork, isValidBech32Address, objectMatchesStructure, + secretCosmWasmClientRouter, } from '@dao-dao/utils' import { chainQueries } from './chain' @@ -188,6 +189,20 @@ export const fetchContractInstantiationTime = async ( ) } +/** + * Get code hash for a Secret Network contract. + */ +export const fetchSecretContractCodeHash = async ({ + chainId, + address, +}: { + chainId: string + address: string +}): Promise => { + const client = await secretCosmWasmClientRouter.connect(chainId) + return client.queryCodeHashForContractAddress(address) +} + export const contractQueries = { /** * Fetch contract info stored in state, which contains its name and version. @@ -271,4 +286,14 @@ export const contractQueries = { queryKey: ['contract', 'instantiationTime', options], queryFn: () => fetchContractInstantiationTime(queryClient, options), }), + /** + * Fetch the code hash for a Secret Network contract. + */ + secretCodeHash: ( + options: Parameters[0] + ) => + queryOptions({ + queryKey: ['contract', 'secretCodeHash', options], + queryFn: () => fetchSecretContractCodeHash(options), + }), } diff --git a/packages/state/query/queries/token.ts b/packages/state/query/queries/token.ts index 196783f3e..affe5165f 100644 --- a/packages/state/query/queries/token.ts +++ b/packages/state/query/queries/token.ts @@ -7,9 +7,11 @@ import { getIbcTransferInfoFromChannel, getTokenForChainIdAndDenom, ibcProtoRpcClientRouter, + isSecretNetwork, } from '@dao-dao/utils' import { chainQueries } from './chain' +import { contractQueries } from './contract' import { cw20BaseQueries } from './contracts' import { indexerQueries } from './indexer' import { skipQueries } from './skip' @@ -22,13 +24,20 @@ export const fetchTokenInfo = async ( { chainId, type, denomOrAddress }: GenericTokenSource ): Promise => { const [source, asset] = await Promise.all([ - queryClient.fetchQuery( - tokenQueries.source(queryClient, { + queryClient + .fetchQuery( + tokenQueries.source(queryClient, { + chainId, + type, + denomOrAddress, + }) + ) + // On error, fallback to passed in params as the source. + .catch(() => ({ chainId, type, denomOrAddress, - }) - ), + })), queryClient .fetchQuery( skipQueries.asset(queryClient, { @@ -49,6 +58,15 @@ export const fetchTokenInfo = async ( decimals: asset.decimals || 0, imageUrl: asset.logo_uri || getFallbackImage(denomOrAddress), source, + snip20CodeHash: + isSecretNetwork(asset.chain_id) && asset.is_cw20 && asset.token_contract + ? await queryClient.fetchQuery( + contractQueries.secretCodeHash({ + chainId: asset.chain_id, + address: asset.token_contract, + }) + ) + : null, } } else if (source.chainId !== chainId) { // If Skip API does not have the info, check if Skip API has the source @@ -70,6 +88,15 @@ export const fetchTokenInfo = async ( decimals: sourceAsset.decimals || 0, imageUrl: sourceAsset.logo_uri || getFallbackImage(denomOrAddress), source, + snip20CodeHash: + isSecretNetwork(chainId) && type === TokenType.Cw20 + ? await queryClient.fetchQuery( + contractQueries.secretCodeHash({ + chainId, + address: denomOrAddress, + }) + ) + : null, } } } @@ -98,6 +125,14 @@ export const fetchTokenInfo = async ( decimals: tokenInfo.decimals, imageUrl: imageUrl || getFallbackImage(denomOrAddress), source, + snip20CodeHash: isSecretNetwork(chainId) + ? await queryClient.fetchQuery( + contractQueries.secretCodeHash({ + chainId, + address: denomOrAddress, + }) + ) + : null, } } @@ -106,6 +141,14 @@ export const fetchTokenInfo = async ( return { ...getTokenForChainIdAndDenom(chainId, denomOrAddress, false), source, + snip20CodeHash: isSecretNetwork(chainId) + ? await queryClient.fetchQuery( + contractQueries.secretCodeHash({ + chainId, + address: denomOrAddress, + }) + ) + : null, } } catch (err) { console.error(err) @@ -129,6 +172,14 @@ export const fetchTokenInfo = async ( decimals: chainMetadata.preferredDecimals, imageUrl: getFallbackImage(denomOrAddress), source, + snip20CodeHash: isSecretNetwork(chainId) + ? await queryClient.fetchQuery( + contractQueries.secretCodeHash({ + chainId, + address: denomOrAddress, + }) + ) + : null, } } } catch (err) { @@ -144,6 +195,14 @@ export const fetchTokenInfo = async ( decimals: 0, imageUrl: getFallbackImage(denomOrAddress), source, + snip20CodeHash: isSecretNetwork(chainId) + ? await queryClient.fetchQuery( + contractQueries.secretCodeHash({ + chainId, + address: denomOrAddress, + }) + ) + : null, } } diff --git a/packages/state/recoil/selectors/contract.ts b/packages/state/recoil/selectors/contract.ts index 02a4999ea..0f5a8ca91 100644 --- a/packages/state/recoil/selectors/contract.ts +++ b/packages/state/recoil/selectors/contract.ts @@ -11,7 +11,6 @@ import { isSecretNetwork, isValidBech32Address, parseContractVersion, - secretCosmWasmClientRouter, } from '@dao-dao/utils' import { @@ -172,22 +171,6 @@ export const contractInfoSelector = selectorFamily< }, }) -/** - * Get code hash for a Secret Network contract. - */ -export const secretContractCodeHashSelector = selectorFamily< - string, - WithChainId<{ contractAddress: string }> ->({ - key: 'secretContractCodeHash', - get: - ({ chainId, contractAddress }) => - async () => { - const client = await secretCosmWasmClientRouter.connect(chainId) - return client.queryCodeHashForContractAddress(contractAddress) - }, -}) - export const isContractSelector = selectorFamily< boolean, WithChainId< diff --git a/packages/state/recoil/selectors/token.ts b/packages/state/recoil/selectors/token.ts index 8df482c19..79a114b9e 100644 --- a/packages/state/recoil/selectors/token.ts +++ b/packages/state/recoil/selectors/token.ts @@ -23,15 +23,13 @@ import { convertMicroDenomToDenomWithDecimals, getChainForChainId, getChainForChainName, - getFallbackImage, getIbcTransferInfoFromChannel, getNativeTokenForChainId, - getTokenForChainIdAndDenom, - isSecretNetwork, - isValidTokenFactoryDenom, isValidWalletAddress, } from '@dao-dao/utils' +import { tokenQueries } from '../../query' +import { queryClientAtom } from '../atoms' import { astroportUsdPriceSelector } from './astroport' import { denomMetadataSelector, @@ -42,7 +40,7 @@ import { nativeDenomBalanceSelector, nativeUnstakingDurationSecondsSelector, } from './chain' -import { isDaoSelector, secretContractCodeHashSelector } from './contract' +import { isDaoSelector } from './contract' import { Cw20BaseSelectors, Cw20StakeSelectors, @@ -57,174 +55,14 @@ import { whiteWhaleUsdPriceSelector } from './whale' export const genericTokenSelector = selectorFamily< GenericToken, - Pick + GenericTokenSource >({ key: 'genericToken', get: - ({ type, denomOrAddress, chainId }) => - ({ get }) => { - const source = get( - genericTokenSourceSelector({ - type, - chainId, - denomOrAddress, - }) - ) - - // Check if Skip API has the info. - const skipAsset = get( - skipAssetSelector({ - chainId, - type, - denomOrAddress, - }) - ) - - if (skipAsset) { - return { - chainId: skipAsset.chain_id, - type: skipAsset.is_cw20 ? TokenType.Cw20 : TokenType.Native, - denomOrAddress: - (skipAsset.is_cw20 && skipAsset.token_contract) || skipAsset.denom, - symbol: - skipAsset.recommended_symbol || skipAsset.symbol || skipAsset.denom, - decimals: skipAsset.decimals || 0, - imageUrl: skipAsset.logo_uri || getFallbackImage(denomOrAddress), - source, - snip20CodeHash: - isSecretNetwork(skipAsset.chain_id) && - skipAsset.is_cw20 && - skipAsset.token_contract - ? get( - secretContractCodeHashSelector({ - chainId: skipAsset.chain_id, - contractAddress: skipAsset.token_contract, - }) - ) - : null, - } - } else if (source.chainId !== chainId) { - // If Skip API does not have the info, check if Skip API has the source - // if it's different. This has happened before when Skip does not have - // an IBC asset that we were able to reverse engineer the source for. - const skipSourceAsset = get(skipAssetSelector(source)) - - if (skipSourceAsset) { - return { - chainId, - type, - denomOrAddress, - symbol: - skipSourceAsset.recommended_symbol || - skipSourceAsset.symbol || - skipSourceAsset.denom, - decimals: skipSourceAsset.decimals || 0, - imageUrl: - skipSourceAsset.logo_uri || getFallbackImage(denomOrAddress), - source, - snip20CodeHash: - isSecretNetwork(skipSourceAsset.chain_id) && - skipSourceAsset.is_cw20 && - skipSourceAsset.token_contract - ? get( - secretContractCodeHashSelector({ - chainId: skipSourceAsset.chain_id, - contractAddress: skipSourceAsset.token_contract, - }) - ) - : null, - } - } - } - - let tokenInfo = - type === TokenType.Cw20 - ? get( - Cw20BaseSelectors.tokenInfoSelector({ - contractAddress: denomOrAddress, - chainId, - params: [], - }) - ) - : // Native factory tokens. - type === TokenType.Native && - isValidTokenFactoryDenom( - denomOrAddress, - getChainForChainId(chainId).bech32_prefix - ) - ? get( - nativeDenomMetadataInfoSelector({ - denom: denomOrAddress, - chainId, - }) - ) - : // Native token or invalid type. - undefined - - // If native non-factory token, try to get the token from the asset list. - if (!tokenInfo) { - try { - return { - ...getTokenForChainIdAndDenom(chainId, denomOrAddress, false), - source, - } - } catch { - // If that fails, try to fetch from chain if not IBC asset. - try { - tokenInfo = denomOrAddress.startsWith('ibc/') - ? undefined - : get( - nativeDenomMetadataInfoSelector({ - denom: denomOrAddress, - chainId, - }) - ) - } catch (err) { - // If not an error, rethrow. This may be a promise, which is how - // recoil waits for the `get` to resolve. - if (!(err instanceof Error)) { - throw err - } - } - - // If that fails, return placeholder token. - if (!tokenInfo) { - return { - ...getTokenForChainIdAndDenom(chainId, denomOrAddress), - source, - } - } - } - } - - const imageUrl = - type === TokenType.Cw20 - ? get( - Cw20BaseSelectors.logoUrlSelector({ - contractAddress: denomOrAddress, - chainId, - }) - ) - : getFallbackImage(denomOrAddress) - - return { - chainId, - type, - denomOrAddress, - symbol: tokenInfo.symbol, - decimals: tokenInfo.decimals, - imageUrl, - source, - snip20CodeHash: - isSecretNetwork(chainId) && type === TokenType.Cw20 - ? get( - secretContractCodeHashSelector({ - chainId, - contractAddress: denomOrAddress, - }) - ) - : null, - } + (params) => + async ({ get }) => { + const client = get(queryClientAtom) + return await client.fetchQuery(tokenQueries.info(client, params)) }, }) diff --git a/packages/stateful/creators/NftBased/GovernanceConfigurationInput.tsx b/packages/stateful/creators/NftBased/GovernanceConfigurationInput.tsx index 0820197d1..7fd4c42b3 100644 --- a/packages/stateful/creators/NftBased/GovernanceConfigurationInput.tsx +++ b/packages/stateful/creators/NftBased/GovernanceConfigurationInput.tsx @@ -1,12 +1,11 @@ import { useQueries } from '@tanstack/react-query' import { useEffect } from 'react' import { useTranslation } from 'react-i18next' -import { constSelector, useRecoilValueLoadable } from 'recoil' import { + contractQueries, cw721BaseQueries, omniflixQueries, - secretContractCodeHashSelector, } from '@dao-dao/state' import { InputErrorMessage, @@ -22,6 +21,7 @@ import { validateRequired, } from '@dao-dao/utils' +import { useQueryLoadingDataWithError } from '../../hooks' import { CreatorData, GovernanceTokenType } from './types' export const GovernanceConfigurationInput = ({ @@ -76,20 +76,24 @@ export const GovernanceConfigurationInput = ({ isOmniFlix ? omniflixResult : cw721Result, }) - const secretCodeHashLoadable = useRecoilValueLoadable( + const secretCodeHash = useQueryLoadingDataWithError( existingAddressValid && isSecretNetwork(chainId) - ? secretContractCodeHashSelector({ + ? contractQueries.secretCodeHash({ chainId, - contractAddress: existingGovernanceNftCollectionAddress, + address: existingGovernanceNftCollectionAddress, }) - : constSelector(undefined) + : undefined ) useEffect(() => { if (isSecretNetwork(chainId)) { setValue( 'creator.data.secretCodeHash', - secretCodeHashLoadable.valueMaybe() + secretCodeHash.loading || + secretCodeHash.updating || + secretCodeHash.errored + ? undefined + : secretCodeHash.data ) } @@ -121,7 +125,7 @@ export const GovernanceConfigurationInput = ({ collectionInfoLoadable, errors?.creator?.data?.existingCollectionInfo, isOmniFlix, - secretCodeHashLoadable, + secretCodeHash, setError, setValue, t, diff --git a/packages/stateful/creators/TokenBased/UnstakingDurationVotingConfigItem.tsx b/packages/stateful/creators/TokenBased/UnstakingDurationVotingConfigItem.tsx index 957a2eb75..b8c1d84f9 100644 --- a/packages/stateful/creators/TokenBased/UnstakingDurationVotingConfigItem.tsx +++ b/packages/stateful/creators/TokenBased/UnstakingDurationVotingConfigItem.tsx @@ -1,9 +1,8 @@ import { useEffect } from 'react' import { UseFormWatch } from 'react-hook-form' import { useTranslation } from 'react-i18next' -import { constSelector, useRecoilValueLoadable } from 'recoil' -import { secretContractCodeHashSelector } from '@dao-dao/state/recoil' +import { contractQueries } from '@dao-dao/state/query' import { ClockEmoji, InputErrorMessage, @@ -29,6 +28,7 @@ import { } from '@dao-dao/utils' import { AddressInput } from '../../components/AddressInput' +import { useQueryLoadingDataWithError } from '../../hooks' import { CreatorData, GovernanceTokenType } from './types' export const UnstakingDurationInput = ({ @@ -52,15 +52,15 @@ export const UnstakingDurationInput = ({ createWithCw20 && customStakingAddress !== undefined // Load custom staking contract code hash on Secret Network. - const customStakingCodeHashLoadable = useRecoilValueLoadable( + const customStakingCodeHash = useQueryLoadingDataWithError( isSecretNetwork(chainId) && customStakingAddress && isValidBech32Address(customStakingAddress, bech32Prefix) - ? secretContractCodeHashSelector({ + ? contractQueries.secretCodeHash({ chainId, - contractAddress: customStakingAddress, + address: customStakingAddress, }) - : constSelector(undefined) + : undefined ) useEffect(() => { if (!isSecretNetwork(chainId)) { @@ -69,9 +69,13 @@ export const UnstakingDurationInput = ({ setValue( 'customStakingCodeHash', - customStakingCodeHashLoadable.valueMaybe() + customStakingCodeHash.loading || + customStakingCodeHash.updating || + customStakingCodeHash.errored + ? undefined + : customStakingCodeHash.data ) - }, [setValue, chainId, customStakingCodeHashLoadable]) + }, [setValue, chainId, customStakingCodeHash]) return ( <> @@ -110,7 +114,9 @@ export const UnstakingDurationInput = ({
From 377ebec2d04986cde8800f6c8ffe2cb852f4cb6e Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 16 Jul 2024 11:01:01 -0500 Subject: [PATCH 318/438] added astroport app --- packages/utils/constants/apps.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/utils/constants/apps.ts b/packages/utils/constants/apps.ts index a9f509152..6e0b6af90 100644 --- a/packages/utils/constants/apps.ts +++ b/packages/utils/constants/apps.ts @@ -8,6 +8,11 @@ export const DAO_APPS: DaoApp[] = [ imageUrl: 'https://app.osmosis.zone/images/preview.jpg', url: 'https://app.osmosis.zone', }, + { + name: 'Astroport', + imageUrl: 'https://app.astroport.fi/thumbnail.jpg', + url: 'https://app.astroport.fi/swap', + }, { name: 'Stargaze', imageUrl: 'https://stargaze.zone/TwitterCard.png', @@ -15,11 +20,6 @@ export const DAO_APPS: DaoApp[] = [ ? 'https://stargaze.zone' : 'https://testnet.publicawesome.dev', }, - { - name: 'Calculated Finance', - imageUrl: '/apps/calcfi.jpg', - url: 'https://app.calculated.fi/?chain=osmosis-1', - }, { name: 'Stargaze Studio', imageUrl: 'https://studio.stargaze.zone/assets/android-chrome-256x256.png', @@ -27,6 +27,11 @@ export const DAO_APPS: DaoApp[] = [ ? 'https://studio.stargaze.zone' : 'https://studio.publicawesome.dev', }, + { + name: 'Calculated Finance', + imageUrl: '/apps/calcfi.jpg', + url: 'https://app.calculated.fi/?chain=osmosis-1', + }, { name: 'FIN', platform: 'Kujira', From df778e7673732eadf310b0c0c5662956a5af16fa Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 16 Jul 2024 14:10:51 -0500 Subject: [PATCH 319/438] try preferred RPC 3 times --- packages/utils/chain.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/utils/chain.ts b/packages/utils/chain.ts index 4b00242b8..5247aecdf 100644 --- a/packages/utils/chain.ts +++ b/packages/utils/chain.ts @@ -55,14 +55,15 @@ export const getRpcForChainId = ( CHAIN_ENDPOINTS[chainId as keyof typeof CHAIN_ENDPOINTS]) || {} )?.rpc - if (rpc && offset === 0) { + // Try preferred RPC 3 times before falling back to chain registry. + if (rpc && offset < 3) { return rpc } - // If RPC was found but not used, offset > 0, and subtract 1 from offset so we - // try the first RPC in the chain registry list. + // If RPC was found but not used, offset > 3, so subtract 3 so we start trying + // the first RPC in the chain registry list. if (rpc) { - offset -= 1 + offset -= 3 } // Fallback to chain registry. From 69de447aca31b0397a94c04ad749996f42bee4ce Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 16 Jul 2024 14:18:00 -0500 Subject: [PATCH 320/438] added update staking config action to cw20-based DAOs --- .../UpdateStakingConfig/Component.stories.tsx | 37 ++++++ .../actions/UpdateStakingConfig/Component.tsx | 112 +++++++++++++++++ .../actions/UpdateStakingConfig/README.md | 24 ++++ .../actions/UpdateStakingConfig/index.ts | 113 ++++++++++++++++++ .../DaoVotingCw20Staked/actions/index.ts | 1 + .../adapters/DaoVotingCw20Staked/index.ts | 4 +- 6 files changed, 289 insertions(+), 2 deletions(-) create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/UpdateStakingConfig/Component.stories.tsx create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/UpdateStakingConfig/Component.tsx create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/UpdateStakingConfig/README.md create mode 100644 packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/UpdateStakingConfig/index.ts diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/UpdateStakingConfig/Component.stories.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/UpdateStakingConfig/Component.stories.tsx new file mode 100644 index 000000000..ee30aa122 --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/UpdateStakingConfig/Component.stories.tsx @@ -0,0 +1,37 @@ +import { ComponentMeta, ComponentStory } from '@storybook/react' + +import { makeReactHookFormDecorator } from '@dao-dao/storybook' +import { DurationUnits } from '@dao-dao/types' + +import { + UpdateStakingConfigComponent, + UpdateStakingConfigData, +} from './Component' + +export default { + title: + 'DAO DAO / packages / stateful / voting-module-adapter / adapters / DaoVotingCw20Staked / actions / UpdateStakingConfig', + component: UpdateStakingConfigComponent, + decorators: [ + makeReactHookFormDecorator({ + unstakingDurationEnabled: true, + unstakingDuration: { + value: 4, + units: DurationUnits.Days, + }, + }), + ], +} as ComponentMeta + +const Template: ComponentStory = ( + args +) => + +export const Default = Template.bind({}) +Default.args = { + fieldNamePrefix: '', + allActionsWithData: [], + index: 0, + data: {}, + isCreating: true, +} diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/UpdateStakingConfig/Component.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/UpdateStakingConfig/Component.tsx new file mode 100644 index 000000000..9e2fa6f60 --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/UpdateStakingConfig/Component.tsx @@ -0,0 +1,112 @@ +import { useFormContext } from 'react-hook-form' +import { useTranslation } from 'react-i18next' + +import { + FormSwitchCard, + InputErrorMessage, + NumberInput, + SelectInput, +} from '@dao-dao/stateless' +import { + ActionComponent, + BooleanFieldNames, + DurationUnitsValues, + DurationWithUnits, +} from '@dao-dao/types' +import { validatePositive, validateRequired } from '@dao-dao/utils' + +export type UpdateStakingConfigData = { + unstakingDurationEnabled: boolean + unstakingDuration: DurationWithUnits +} + +export const UpdateStakingConfigComponent: ActionComponent = ({ + fieldNamePrefix, + errors, + isCreating, +}) => { + const { t } = useTranslation() + const { register, watch, setValue } = + useFormContext() + + const unstakingDurationEnabled = watch( + (fieldNamePrefix + 'unstakingDurationEnabled') as 'unstakingDurationEnabled' + ) + const unstakingDuration = watch( + (fieldNamePrefix + 'unstakingDuration') as 'unstakingDuration' + ) + + return ( + <> + + > + containerClassName="self-start" + fieldName={ + (fieldNamePrefix + + 'unstakingDurationEnabled') as 'unstakingDurationEnabled' + } + label={t('form.unstakingDurationTitle')} + readOnly={!isCreating} + setValue={setValue} + tooltip={t('form.unstakingDurationDescription')} + value={unstakingDurationEnabled} + /> + + {unstakingDurationEnabled && ( + <> +
+ + + {isCreating && ( + + {DurationUnitsValues.map((type, idx) => ( + + ))} + + )} +
+ + + + )} + + ) +} diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/UpdateStakingConfig/README.md b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/UpdateStakingConfig/README.md new file mode 100644 index 000000000..389b34430 --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/UpdateStakingConfig/README.md @@ -0,0 +1,24 @@ +# UpdateStakingConfig + +Update cw20 token staking configuration. + +## Bulk import format + +This is relevant when bulk importing actions, as described in [this +guide](https://github.com/DA0-DA0/dao-dao-ui/wiki/Bulk-importing-actions). + +### Key + +`updateStakingConfig` + +### Data format + +```json +{ + "unstakingDurationEnabled": , + "unstakingDuration": { + "value": "", + "units": "" + } +} +``` diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/UpdateStakingConfig/index.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/UpdateStakingConfig/index.ts new file mode 100644 index 000000000..bddfdf908 --- /dev/null +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/UpdateStakingConfig/index.ts @@ -0,0 +1,113 @@ +import { useCallback } from 'react' + +import { GearEmoji } from '@dao-dao/stateless' +import { DurationUnits } from '@dao-dao/types' +import { + ActionKey, + ActionMaker, + UseDecodedCosmosMsg, + UseDefaults, + UseTransformToCosmos, +} from '@dao-dao/types/actions' +import { + convertDurationToDurationWithUnits, + convertDurationWithUnitsToDuration, + makeWasmMessage, + objectMatchesStructure, +} from '@dao-dao/utils' + +import { useStakingInfo } from '../../hooks' +import { + UpdateStakingConfigComponent as Component, + UpdateStakingConfigData, +} from './Component' + +const useDefaults: UseDefaults = () => { + const { unstakingDuration } = useStakingInfo() + + return { + unstakingDurationEnabled: !!unstakingDuration, + unstakingDuration: unstakingDuration + ? convertDurationToDurationWithUnits(unstakingDuration) + : { + value: 2, + units: DurationUnits.Weeks, + }, + } +} + +const useTransformToCosmos: UseTransformToCosmos< + UpdateStakingConfigData +> = () => { + const { stakingContractAddress } = useStakingInfo() + + return useCallback( + ({ unstakingDurationEnabled, unstakingDuration }) => + makeWasmMessage({ + wasm: { + execute: { + contract_addr: stakingContractAddress, + funds: [], + msg: { + update_config: { + duration: unstakingDurationEnabled + ? convertDurationWithUnitsToDuration(unstakingDuration) + : null, + }, + }, + }, + }, + }), + [stakingContractAddress] + ) +} + +const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( + msg: Record +) => { + const { stakingContractAddress } = useStakingInfo() + + return objectMatchesStructure(msg, { + wasm: { + execute: { + contract_addr: {}, + funds: {}, + msg: { + update_config: {}, + }, + }, + }, + }) && msg.wasm.execute.contract_addr === stakingContractAddress + ? { + match: true, + data: { + unstakingDurationEnabled: + !!msg.wasm.execute.msg.update_config.duration, + unstakingDuration: msg.wasm.execute.msg.update_config.duration + ? convertDurationToDurationWithUnits( + msg.wasm.execute.msg.update_config.duration + ) + : { + value: 2, + units: DurationUnits.Weeks, + }, + }, + } + : { + match: false, + } +} + +export const makeUpdateStakingConfigAction: ActionMaker< + UpdateStakingConfigData +> = ({ t }) => ({ + key: ActionKey.UpdateStakingConfig, + Icon: GearEmoji, + label: t('title.updateStakingConfig'), + description: t('info.updateStakingConfigDescription'), + Component, + useDefaults, + useTransformToCosmos, + useDecodedCosmosMsg, + notReusable: true, +}) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/index.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/index.ts index 5e20a9e96..40591c371 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/index.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/actions/index.ts @@ -1 +1,2 @@ export * from './Mint' +export * from './UpdateStakingConfig' diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/index.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/index.ts index d3f347ef3..ab569765a 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/index.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/index.ts @@ -11,7 +11,7 @@ import { DaoVotingCw20StakedAdapterId, } from '@dao-dao/utils' -import { makeMintAction } from './actions' +import { makeMintAction, makeUpdateStakingConfigAction } from './actions' import { MembersTab, ProfileCardMemberInfo, StakingModal } from './components' import { useCommonGovernanceTokenInfo, @@ -54,7 +54,7 @@ export const DaoVotingCw20StakedAdapter: VotingModuleAdapter = { () => ({ // Add to DAO Governance category. key: ActionCategoryKey.DaoGovernance, - actionMakers: [makeMintAction], + actionMakers: [makeMintAction, makeUpdateStakingConfigAction], }), ], }, From dee1fc9728bb0317817edc09f9e2adbe4b013809 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 16 Jul 2024 14:35:01 -0500 Subject: [PATCH 321/438] Deploy Vercel From 1bd30957666b10a01ab10e2a996e1121eb0c0d0f Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 16 Jul 2024 16:28:01 -0500 Subject: [PATCH 322/438] updated terra classic explorer --- packages/utils/constants/chains.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 3c031a32e..3fffc1f29 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -1376,10 +1376,11 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ factoryContractAddress: 'terra18d67ywrfwxq6924xdsg4ahrsjrtuvnu0q5v0ttj07fakw2thspps2fn9yy', explorerUrlTemplates: { - tx: 'https://finder.terra.money/classic/tx/REPLACE', + tx: 'https://finder.terra-classic.hexxagon.io/mainnet/tx/REPLACE', gov: 'https://ping.pub/terra-luna/gov', govProp: 'https://ping.pub/terra-luna/gov/REPLACE', - wallet: 'https://finder.terra.money/classic/address/REPLACE', + wallet: + 'https://finder.terra-classic.hexxagon.io/mainnet/address/REPLACE', }, codeIdsVersion: ContractVersion.V242, codeIds: { From 48e8016481d5236d87f18fa195dcede3a030da0b Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 17 Jul 2024 16:58:24 -0400 Subject: [PATCH 323/438] fixed chain gov DAOs --- packages/stateful/components/dao/DaoProviders.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stateful/components/dao/DaoProviders.tsx b/packages/stateful/components/dao/DaoProviders.tsx index f7db5ff05..1f4dadf21 100644 --- a/packages/stateful/components/dao/DaoProviders.tsx +++ b/packages/stateful/components/dao/DaoProviders.tsx @@ -112,7 +112,7 @@ const InitializedDaoProviders = ({ }: InitializedDaoProvidersProps) => { // Don't wrap chain governance in voting module or DAO actions provider. const inner = - context instanceof ChainXGovDao ? ( + context.dao instanceof ChainXGovDao ? ( children ) : ( Date: Wed, 17 Jul 2024 22:56:00 -0400 Subject: [PATCH 324/438] Become SubDAO (#1779) --- packages/i18n/locales/en/translation.json | 13 ++ .../actions/core/dao_governance/index.ts | 2 - packages/stateful/actions/core/index.ts | 2 + .../smart_contracting/UpdateAdmin/index.tsx | 2 +- .../AcceptSubDao/Component.stories.tsx | 27 +++ .../core/subdaos/AcceptSubDao/Component.tsx | 181 ++++++++++++++++++ .../core/subdaos/AcceptSubDao/README.md | 20 ++ .../core/subdaos/AcceptSubDao/index.tsx | 71 +++++++ .../BecomeSubDao/Component.stories.tsx | 27 +++ .../core/subdaos/BecomeSubDao/Component.tsx | 58 ++++++ .../core/subdaos/BecomeSubDao/README.md | 20 ++ .../core/subdaos/BecomeSubDao/index.tsx | 75 ++++++++ .../ManageSubDaos/Component.stories.tsx | 2 +- .../ManageSubDaos/Component.tsx | 2 +- .../ManageSubDaos/README.md | 0 .../ManageSubDaos/index.tsx | 0 .../stateful/actions/core/subdaos/index.ts | 16 ++ packages/stateless/components/emoji.tsx | 4 + packages/types/actions.ts | 4 + 19 files changed, 521 insertions(+), 5 deletions(-) create mode 100644 packages/stateful/actions/core/subdaos/AcceptSubDao/Component.stories.tsx create mode 100644 packages/stateful/actions/core/subdaos/AcceptSubDao/Component.tsx create mode 100644 packages/stateful/actions/core/subdaos/AcceptSubDao/README.md create mode 100644 packages/stateful/actions/core/subdaos/AcceptSubDao/index.tsx create mode 100644 packages/stateful/actions/core/subdaos/BecomeSubDao/Component.stories.tsx create mode 100644 packages/stateful/actions/core/subdaos/BecomeSubDao/Component.tsx create mode 100644 packages/stateful/actions/core/subdaos/BecomeSubDao/README.md create mode 100644 packages/stateful/actions/core/subdaos/BecomeSubDao/index.tsx rename packages/stateful/actions/core/{dao_governance => subdaos}/ManageSubDaos/Component.stories.tsx (90%) rename packages/stateful/actions/core/{dao_governance => subdaos}/ManageSubDaos/Component.tsx (99%) rename packages/stateful/actions/core/{dao_governance => subdaos}/ManageSubDaos/README.md (100%) rename packages/stateful/actions/core/{dao_governance => subdaos}/ManageSubDaos/index.tsx (100%) create mode 100644 packages/stateful/actions/core/subdaos/index.ts diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 0ae5c0743..7c72d117c 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -32,6 +32,8 @@ "rebalancerLabel": "Rebalancer", "smartContractingDescription": "Create, execute, and manage smart contracts.", "smartContractingLabel": "Smart Contracting", + "subDaosDescription": "Manage SubDAOs or become a SubDAO.", + "subDaosLabel": "SubDAOs", "treasuryDescription_dao": "Manage this DAO's treasury (for example, send payments, stake or swap tokens, etc.).", "treasuryDescription_gov": "Manage the community pool (for example, send payments, stake or swap tokens, etc.).", "treasuryDescription_wallet": "Manage your tokens (for example, send payments, stake or swap tokens, etc.).", @@ -315,6 +317,7 @@ "cameraWithFlash": "Camera with flash", "chains": "Chains", "chart": "Chart", + "check": "Check", "clock": "Clock", "closedLockWithKey": "Closed lock with key", "computerDisk": "Computer disk", @@ -537,6 +540,7 @@ "unsupportedWallet": "Unsupported wallet. Please use a different wallet." }, "form": { + "acceptSubDaoAddressInputLabel": "SubDAO to accept", "addAnImage": "Add an image", "address": "Address", "addressInputPlaceholder_any": "Search profile or DAO name or enter an address...", @@ -567,6 +571,7 @@ "automaticallyAddTokensTitle": "Automatically add tokens", "automaticallyAddTokensTooltip": "Should tokens sent to the DAO get added to the treasury?", "baseToken": "Base token", + "becomeSubDaoAdminInputLabel": "New parent DAO", "blocksToPauseFor": "Blocks to pause for", "buttonLabel": "Button label", "calls": "Calls", @@ -895,6 +900,9 @@ }, "info": { "abstainVote": "Abstain", + "acceptSubDaoActionDescription": "Accept a pending SubDAO's ownership transfer request. Be sure that the SubDAO-to-be has already requested to join your DAO through the \"Become SubDAO\" action.", + "acceptSubDaoActionOtherActionsAdded": "Other actions that are required to register a new SubDAO have been added to the proposal automatically.", + "acceptSubDaoDescription": "Accept a DAO's request to become a SubDAO.", "acknowledgeServiceFee": "We acknowledge that {{fee}} will be charged from the treasury for registration to the rebalancer.", "acknowledgeServiceFee_none": "We acknowledge that there is no fee to register for the rebalancer.", "actionLibraryDescription": "Choose one or more actions to perform upon execution.", @@ -944,6 +952,9 @@ "available": "available", "availableBalance": "Available balance", "availableHistoryLoaded": "All available history has been loaded.", + "becomeSubDaoActionDescription": "Provide the address of a DAO to request to become its SubDAO. The DAO will then need to accept your request to complete the ownership transfer and become your parent. Once the transfer is complete, only your new parent DAO can transfer ownership in the future. Keep in mind that your parent DAO will have full authority to execute anything it wants to on behalf of this DAO.", + "becomeSubDaoActionDescription_created": "The parent DAO needs to accept this request to complete the ownership transfer and become your parent. Once the transfer is complete, only your new parent DAO can transfer ownership in the future. Keep in mind that your parent DAO will have full authority to execute anything it wants to on behalf of this DAO.", + "becomeSubDaoDescription": "Request to become a SubDAO of a DAO.", "betterNonPfmIbcPathAvailable": "A better path exists that unwinds the IBC token properly, but it requires hops that cannot be performed in a single proposal due to the configuration of one or more of the chains involved. You may safely use the direct path above, though it likely results in an undesirable IBC token on the final chain that will eventually need to be unwound. If you wish to unwind it manually, follow the path below by creating an individual proposal for the first hop, then a second proposal once the first one is passed and executed, and so on.", "betterPfmIbcPathAvailable_one": "A better path exists that unwinds the IBC token properly, but it requires you to have an account on {{chains}}. An account must exist on each intermediary chain in a multi-hop transaction to act as a failsafe in the event of catastrophic failure (unlikely). Either a cross-chain or ICA account works and will be automatically detected once created. You may safely use the direct path above, though it likely results in an undesirable IBC token on the final chain that will eventually need to be unwound.", "betterPfmIbcPathAvailable_other": "A better path exists that unwinds the IBC token properly, but it requires you to have accounts on the following chains: {{chains}}. An account must exist on each intermediary chain in a multi-hop transaction to act as a failsafe in the event of catastrophic failure (unlikely). Either a cross-chain or ICA account works and will be automatically detected once created. You may safely use the direct path above, though it likely results in an undesirable IBC token on the final chain that will eventually need to be unwound.", @@ -1564,6 +1575,7 @@ "title": { "404": "404: Not Found", "500": "500: Error", + "acceptSubDao": "Accept SubDAO Request", "accepted": "Accepted", "acceptingSubmissions": "Accepting submissions", "account": "Account", @@ -1590,6 +1602,7 @@ "averages": "Averages", "balance": "Balance", "balances": "Balances", + "becomeSubDao": "Become SubDAO", "beforeYouEnter": "Before you enter", "beginVesting": "Begin vesting", "blockCompleted": "Block completed", diff --git a/packages/stateful/actions/core/dao_governance/index.ts b/packages/stateful/actions/core/dao_governance/index.ts index a75740b40..ad16d2932 100644 --- a/packages/stateful/actions/core/dao_governance/index.ts +++ b/packages/stateful/actions/core/dao_governance/index.ts @@ -6,7 +6,6 @@ import { makeDaoAdminExecAction } from './DaoAdminExec' import { makeEnableMultipleChoiceAction } from './EnableMultipleChoice' import { makeManageStorageItemsAction } from './ManageStorageItems' import { makeManageSubDaoPauseAction } from './ManageSubDaoPause' -import { makeManageSubDaosAction } from './ManageSubDaos' import { makeManageVetoableDaosAction } from './ManageVetoableDaos' import { makeNeutronOverruleSubDaoProposalAction } from './NeutronOverruleSubDaoProposal' import { makeSetUpApproverAction } from './SetUpApprover' @@ -26,7 +25,6 @@ export const makeDaoGovernanceActionCategory: ActionCategoryMaker = ({ }), actionMakers: [ makeEnableMultipleChoiceAction, - makeManageSubDaosAction, makeManageStorageItemsAction, makeDaoAdminExecAction, makeUpgradeV1ToV2Action, diff --git a/packages/stateful/actions/core/index.ts b/packages/stateful/actions/core/index.ts index 62754a3ba..eff4bd6dc 100644 --- a/packages/stateful/actions/core/index.ts +++ b/packages/stateful/actions/core/index.ts @@ -15,6 +15,7 @@ import { makeDaoAppearanceActionCategory } from './dao_appearance' import { makeDaoGovernanceActionCategory } from './dao_governance' import { makeManageNftsActionCategory } from './nfts' import { makeSmartContractingActionCategory } from './smart_contracting' +import { makeSubDaosActionCategory } from './subdaos' import { makeTreasuryActionCategory } from './treasury' import { makeValenceActionCategory } from './valence' @@ -23,6 +24,7 @@ export const getCoreActionCategoryMakers = (): ActionCategoryMaker[] => [ makeCommonlyUsedCategory, makeTreasuryActionCategory, makeDaoGovernanceActionCategory, + makeSubDaosActionCategory, makeDaoAppearanceActionCategory, makeManageNftsActionCategory, makeSmartContractingActionCategory, diff --git a/packages/stateful/actions/core/smart_contracting/UpdateAdmin/index.tsx b/packages/stateful/actions/core/smart_contracting/UpdateAdmin/index.tsx index d396a9096..dd84bb62d 100644 --- a/packages/stateful/actions/core/smart_contracting/UpdateAdmin/index.tsx +++ b/packages/stateful/actions/core/smart_contracting/UpdateAdmin/index.tsx @@ -33,7 +33,7 @@ import { import { useActionOptions } from '../../../react' import { UpdateAdminComponent as StatelessUpdateAdminComponent } from './Component' -interface UpdateAdminData { +export type UpdateAdminData = { chainId: string contract: string newAdmin: string diff --git a/packages/stateful/actions/core/subdaos/AcceptSubDao/Component.stories.tsx b/packages/stateful/actions/core/subdaos/AcceptSubDao/Component.stories.tsx new file mode 100644 index 000000000..cc7d8e1dd --- /dev/null +++ b/packages/stateful/actions/core/subdaos/AcceptSubDao/Component.stories.tsx @@ -0,0 +1,27 @@ +import { ComponentMeta, ComponentStory } from '@storybook/react' + +import { ReactHookFormDecorator } from '@dao-dao/storybook' + +import { AddressInput } from '../../../../components' +import { AcceptSubDaoComponent } from './Component' + +export default { + title: + 'DAO DAO / packages / stateful / actions / core / subdaos / AcceptSubDao', + component: AcceptSubDaoComponent, + decorators: [ReactHookFormDecorator], +} as ComponentMeta + +const Template: ComponentStory = (args) => ( + +) + +export const Default = Template.bind({}) +Default.args = { + fieldNamePrefix: '', + isCreating: true, + errors: {}, + options: { + AddressInput, + }, +} diff --git a/packages/stateful/actions/core/subdaos/AcceptSubDao/Component.tsx b/packages/stateful/actions/core/subdaos/AcceptSubDao/Component.tsx new file mode 100644 index 000000000..00847c900 --- /dev/null +++ b/packages/stateful/actions/core/subdaos/AcceptSubDao/Component.tsx @@ -0,0 +1,181 @@ +import { ComponentType, useEffect, useState } from 'react' +import { useFormContext } from 'react-hook-form' +import { useTranslation } from 'react-i18next' + +import { InputErrorMessage, InputLabel } from '@dao-dao/stateless' +import { AddressInputProps } from '@dao-dao/types' +import { ActionComponent, ActionKey } from '@dao-dao/types/actions' +import { + isValidBech32Address, + makeValidateAddress, + validateRequired, +} from '@dao-dao/utils' + +import { useActionOptions } from '../../../react' +import { DaoAdminExecData } from '../../dao_governance/DaoAdminExec/Component' +import { UpdateAdminData } from '../../smart_contracting/UpdateAdmin' +import { ManageSubDaosData } from '../ManageSubDaos/Component' + +export type AcceptSubDaoData = { + address: string +} + +type AcceptSubDaoDataOptions = { + AddressInput: ComponentType> +} + +export const AcceptSubDaoComponent: ActionComponent< + AcceptSubDaoDataOptions, + AcceptSubDaoData +> = ({ + fieldNamePrefix, + errors, + isCreating, + allActionsWithData, + index, + addAction, + options: { AddressInput }, +}) => { + const { t } = useTranslation() + const { + address: currentAddress, + chain: { chain_id: chainId, bech32_prefix: bech32Prefix }, + } = useActionOptions() + + const { watch, register, setValue, getValues } = + useFormContext() + + const addressFieldName = (fieldNamePrefix + 'address') as 'address' + + const address = watch(addressFieldName) + const isValid = !!address && isValidBech32Address(address, bech32Prefix) + const [otherActionsAdded, setOtherActionsAdded] = useState(false) + useEffect(() => { + if (!isCreating || !isValid) { + return + } + + const existingUpdateAdminIndex = allActionsWithData.findIndex( + (a, i) => + i > index && + a.actionKey === ActionKey.DaoAdminExec && + (a.data as DaoAdminExecData)?._actionData?.length === 1 && + (a.data as DaoAdminExecData)._actionData![0].actionKey === + ActionKey.UpdateAdmin && + (a.data as DaoAdminExecData)._actionData![0].data.newAdmin === + currentAddress + ) + const existingManageSubDaosIndex = allActionsWithData.findIndex( + (a, i) => i > index && a.actionKey === ActionKey.ManageSubDaos + ) + + if (existingUpdateAdminIndex === -1) { + addAction( + { + actionKey: ActionKey.DaoAdminExec, + data: { + coreAddress: address, + _actionData: [ + { + actionKey: ActionKey.UpdateAdmin, + data: { + chainId, + contract: address, + newAdmin: currentAddress, + } as UpdateAdminData, + }, + ], + } as DaoAdminExecData, + }, + // After current action. + index + 1 + ) + } else { + // Path to the address field on the update admin sub-action of the DAO + // admin exec action. + const existingAddressFieldName = fieldNamePrefix.replace( + new RegExp(`${index}\\.data.$`), + `${existingUpdateAdminIndex}.data._actionData.0.data.contract` + ) + + // If the address isn't correct, update the existing one. + if (getValues(existingAddressFieldName as any) !== address) { + setValue(existingAddressFieldName as any, address) + } + } + + if (existingManageSubDaosIndex === -1) { + addAction( + { + actionKey: ActionKey.ManageSubDaos, + data: { + toAdd: [ + { + addr: address, + }, + ], + toRemove: [], + } as ManageSubDaosData, + }, + // After DAO admin exec / update admin action. + index + 2 + ) + } else { + // Path to the address field on the manage subDAOs action. + const existingAddressFieldName = fieldNamePrefix.replace( + new RegExp(`${index}\\.data.$`), + `${existingManageSubDaosIndex}.data.toAdd.0.addr` + ) + + // If the address isn't correct, update the existing one. + if (getValues(existingAddressFieldName as any) !== address) { + setValue(existingAddressFieldName as any, address) + } + } + + setOtherActionsAdded(true) + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [ + isCreating, + isValid, + address, + index, + addAction, + currentAddress, + chainId, + fieldNamePrefix, + getValues, + setValue, + ]) + + return ( + <> +
+ {isCreating && ( +

+ {t('info.acceptSubDaoActionDescription')} +

+ )} + +
+ + + +
+ + {otherActionsAdded && ( +

+ {t('info.acceptSubDaoActionOtherActionsAdded')} +

+ )} +
+ + ) +} diff --git a/packages/stateful/actions/core/subdaos/AcceptSubDao/README.md b/packages/stateful/actions/core/subdaos/AcceptSubDao/README.md new file mode 100644 index 000000000..3a0552d35 --- /dev/null +++ b/packages/stateful/actions/core/subdaos/AcceptSubDao/README.md @@ -0,0 +1,20 @@ +# AcceptSubDao + +Accept SubDAO join request and complete its ownership transfer. + +## Bulk import format + +This is relevant when bulk importing actions, as described in [this +guide](https://github.com/DA0-DA0/dao-dao-ui/wiki/Bulk-importing-actions). + +### Key + +`acceptSubDao` + +### Data format + +```json +{ + "address": "" +} +``` diff --git a/packages/stateful/actions/core/subdaos/AcceptSubDao/index.tsx b/packages/stateful/actions/core/subdaos/AcceptSubDao/index.tsx new file mode 100644 index 000000000..6a452abf8 --- /dev/null +++ b/packages/stateful/actions/core/subdaos/AcceptSubDao/index.tsx @@ -0,0 +1,71 @@ +import { CheckEmoji } from '@dao-dao/stateless' +import { + ActionComponent, + ActionKey, + ActionMaker, + UseDecodedCosmosMsg, + UseDefaults, +} from '@dao-dao/types/actions' +import { makeWasmMessage } from '@dao-dao/utils' + +import { AddressInput } from '../../../../components' +import { AcceptSubDaoComponent, AcceptSubDaoData } from './Component' + +const useDefaults: UseDefaults = () => ({ + address: '', +}) + +const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( + msg: Record +) => { + try { + const match = Boolean(msg.wasm.execute.msg.accept_admin_nomination) + + if (match) { + return { + match, + data: { + address: msg.wasm.execute.contract_addr, + }, + } + } + + return { match: false } + } catch (e) { + return { match: false } + } +} + +const Component: ActionComponent = (props) => { + return +} + +export const makeAcceptSubDaoAction: ActionMaker = ({ + t, +}) => { + function useTransformToCosmos() { + return ({ address }: { address: string }) => + makeWasmMessage({ + wasm: { + execute: { + contract_addr: address, + funds: [], + msg: { + accept_admin_nomination: {}, + }, + }, + }, + }) + } + + return { + key: ActionKey.AcceptSubDao, + Icon: CheckEmoji, + label: t('title.acceptSubDao'), + description: t('info.acceptSubDaoDescription'), + Component, + useDefaults, + useTransformToCosmos, + useDecodedCosmosMsg, + } +} diff --git a/packages/stateful/actions/core/subdaos/BecomeSubDao/Component.stories.tsx b/packages/stateful/actions/core/subdaos/BecomeSubDao/Component.stories.tsx new file mode 100644 index 000000000..282b0cf7c --- /dev/null +++ b/packages/stateful/actions/core/subdaos/BecomeSubDao/Component.stories.tsx @@ -0,0 +1,27 @@ +import { ComponentMeta, ComponentStory } from '@storybook/react' + +import { ReactHookFormDecorator } from '@dao-dao/storybook' + +import { AddressInput } from '../../../../components' +import { BecomeSubDaoComponent } from './Component' + +export default { + title: + 'DAO DAO / packages / stateful / actions / core / subdaos / BecomeSubDao', + component: BecomeSubDaoComponent, + decorators: [ReactHookFormDecorator], +} as ComponentMeta + +const Template: ComponentStory = (args) => ( + +) + +export const Default = Template.bind({}) +Default.args = { + fieldNamePrefix: '', + isCreating: true, + errors: {}, + options: { + AddressInput, + }, +} diff --git a/packages/stateful/actions/core/subdaos/BecomeSubDao/Component.tsx b/packages/stateful/actions/core/subdaos/BecomeSubDao/Component.tsx new file mode 100644 index 000000000..7178c132a --- /dev/null +++ b/packages/stateful/actions/core/subdaos/BecomeSubDao/Component.tsx @@ -0,0 +1,58 @@ +import { ComponentType } from 'react' +import { useFormContext } from 'react-hook-form' +import { useTranslation } from 'react-i18next' + +import { InputErrorMessage, InputLabel } from '@dao-dao/stateless' +import { AddressInputProps } from '@dao-dao/types' +import { ActionComponent } from '@dao-dao/types/actions' +import { makeValidateAddress, validateRequired } from '@dao-dao/utils' + +import { useActionOptions } from '../../../react' + +export type BecomeSubDaoData = { + admin: string +} + +type BecomeSubDaoDataOptions = { + AddressInput: ComponentType> +} + +export const BecomeSubDaoComponent: ActionComponent< + BecomeSubDaoDataOptions, + BecomeSubDaoData +> = ({ fieldNamePrefix, errors, isCreating, options: { AddressInput } }) => { + const { t } = useTranslation() + const { + chain: { bech32_prefix: bech32Prefix }, + } = useActionOptions() + + const { register } = useFormContext() + + const adminFieldName = (fieldNamePrefix + 'admin') as 'admin' + + return ( + <> +
+

+ {t('info.becomeSubDaoActionDescription', { + context: !isCreating ? 'created' : undefined, + })} +

+ +
+ + +
+ +
+ + ) +} diff --git a/packages/stateful/actions/core/subdaos/BecomeSubDao/README.md b/packages/stateful/actions/core/subdaos/BecomeSubDao/README.md new file mode 100644 index 000000000..aa802592b --- /dev/null +++ b/packages/stateful/actions/core/subdaos/BecomeSubDao/README.md @@ -0,0 +1,20 @@ +# BecomeSubDao + +To become a SubDAO, the first step would be to initiate ownership transfer by nominating your parent DAO, before that DAO can accept the ownership transfer. + +## Bulk import format + +This is relevant when bulk importing actions, as described in [this +guide](https://github.com/DA0-DA0/dao-dao-ui/wiki/Bulk-importing-actions). + +### Key + +`becomeSubDao` + +### Data format + +```json +{ + "admin": "" +} +``` diff --git a/packages/stateful/actions/core/subdaos/BecomeSubDao/index.tsx b/packages/stateful/actions/core/subdaos/BecomeSubDao/index.tsx new file mode 100644 index 000000000..238aa5166 --- /dev/null +++ b/packages/stateful/actions/core/subdaos/BecomeSubDao/index.tsx @@ -0,0 +1,75 @@ +import { BabyEmoji } from '@dao-dao/stateless' +import { + ActionComponent, + ActionContextType, + ActionKey, + ActionMaker, + UseDecodedCosmosMsg, + UseDefaults, +} from '@dao-dao/types/actions' +import { makeWasmMessage } from '@dao-dao/utils' + +import { AddressInput } from '../../../../components' +import { BecomeSubDaoComponent, BecomeSubDaoData } from './Component' + +const useDefaults: UseDefaults = () => ({ + admin: '', +}) + +const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( + msg: Record +) => { + try { + return { + match: true, + data: { + admin: msg.wasm.execute.msg.nominate_admin.admin, + }, + } + } catch { + return { match: false } + } +} + +const Component: ActionComponent = (props) => { + return +} + +export const makeBecomeSubDaoAction: ActionMaker = ({ + t, + address, + context, +}) => { + function useTransformToCosmos() { + return ({ admin }: { admin: string }) => + makeWasmMessage({ + wasm: { + execute: { + contract_addr: address, + funds: [], + msg: { + nominate_admin: { + admin, + }, + }, + }, + }, + }) + } + + return { + key: ActionKey.BecomeSubDao, + Icon: BabyEmoji, + label: t('title.becomeSubDao'), + description: t('info.becomeSubDaoDescription'), + Component, + useDefaults, + useTransformToCosmos, + useDecodedCosmosMsg, + notReusable: true, + // If parent DAO exists, hide this action. + hideFromPicker: + context.type === ActionContextType.Dao && + context.dao.info.parentDao !== null, + } +} diff --git a/packages/stateful/actions/core/dao_governance/ManageSubDaos/Component.stories.tsx b/packages/stateful/actions/core/subdaos/ManageSubDaos/Component.stories.tsx similarity index 90% rename from packages/stateful/actions/core/dao_governance/ManageSubDaos/Component.stories.tsx rename to packages/stateful/actions/core/subdaos/ManageSubDaos/Component.stories.tsx index b26ec46a4..afe02b4af 100644 --- a/packages/stateful/actions/core/dao_governance/ManageSubDaos/Component.stories.tsx +++ b/packages/stateful/actions/core/subdaos/ManageSubDaos/Component.stories.tsx @@ -8,7 +8,7 @@ import { ManageSubDaosComponent } from './Component' export default { title: - 'DAO DAO / packages / stateful / actions / core / dao_governance / ManageSubDaos', + 'DAO DAO / packages / stateful / actions / core / subdaos / ManageSubDaos', component: ManageSubDaosComponent, decorators: [ReactHookFormDecorator], } as ComponentMeta diff --git a/packages/stateful/actions/core/dao_governance/ManageSubDaos/Component.tsx b/packages/stateful/actions/core/subdaos/ManageSubDaos/Component.tsx similarity index 99% rename from packages/stateful/actions/core/dao_governance/ManageSubDaos/Component.tsx rename to packages/stateful/actions/core/subdaos/ManageSubDaos/Component.tsx index 24fc7c071..b0d45253e 100644 --- a/packages/stateful/actions/core/dao_governance/ManageSubDaos/Component.tsx +++ b/packages/stateful/actions/core/subdaos/ManageSubDaos/Component.tsx @@ -20,7 +20,7 @@ import { makeValidateAddress, validateRequired } from '@dao-dao/utils' import { useActionOptions } from '../../../react' -export interface ManageSubDaosData { +export type ManageSubDaosData = { toAdd: SubDao[] toRemove: { address: string }[] } diff --git a/packages/stateful/actions/core/dao_governance/ManageSubDaos/README.md b/packages/stateful/actions/core/subdaos/ManageSubDaos/README.md similarity index 100% rename from packages/stateful/actions/core/dao_governance/ManageSubDaos/README.md rename to packages/stateful/actions/core/subdaos/ManageSubDaos/README.md diff --git a/packages/stateful/actions/core/dao_governance/ManageSubDaos/index.tsx b/packages/stateful/actions/core/subdaos/ManageSubDaos/index.tsx similarity index 100% rename from packages/stateful/actions/core/dao_governance/ManageSubDaos/index.tsx rename to packages/stateful/actions/core/subdaos/ManageSubDaos/index.tsx diff --git a/packages/stateful/actions/core/subdaos/index.ts b/packages/stateful/actions/core/subdaos/index.ts new file mode 100644 index 000000000..111d1af22 --- /dev/null +++ b/packages/stateful/actions/core/subdaos/index.ts @@ -0,0 +1,16 @@ +import { ActionCategoryKey, ActionCategoryMaker } from '@dao-dao/types' + +import { makeAcceptSubDaoAction } from './AcceptSubDao' +import { makeBecomeSubDaoAction } from './BecomeSubDao' +import { makeManageSubDaosAction } from './ManageSubDaos' + +export const makeSubDaosActionCategory: ActionCategoryMaker = ({ t }) => ({ + key: ActionCategoryKey.SubDaos, + label: t('actionCategory.subDaosLabel'), + description: t('actionCategory.subDaosDescription'), + actionMakers: [ + makeManageSubDaosAction, + makeBecomeSubDaoAction, + makeAcceptSubDaoAction, + ], +}) diff --git a/packages/stateless/components/emoji.tsx b/packages/stateless/components/emoji.tsx index 229082db6..8114cd067 100644 --- a/packages/stateless/components/emoji.tsx +++ b/packages/stateless/components/emoji.tsx @@ -276,3 +276,7 @@ export const PlayPauseEmoji = () => ( export const PufferfishEmoji = () => ( ) + +export const CheckEmoji = () => ( + +) diff --git a/packages/types/actions.ts b/packages/types/actions.ts index ed4d302f2..e98627896 100644 --- a/packages/types/actions.ts +++ b/packages/types/actions.ts @@ -21,6 +21,7 @@ export enum ActionCategoryKey { ChainGovernance = 'chainGovernance', DaoAppearance = 'daoAppearance', DaoGovernance = 'daoGovernance', + SubDaos = 'subDaos', SmartContracting = 'smartContracting', Treasury = 'treasury', Rebalancer = 'rebalancer', @@ -102,6 +103,9 @@ export enum ActionKey { CreatePost = 'createPost', UpdatePost = 'updatePost', DeletePost = 'deletePost', + // Become SubDAO + AcceptSubDao = 'acceptSubDao', + BecomeSubDao = 'becomeSubDao', } export type ActionAndData = { From 69a8d5bcb2109d7413c5a20ed411a5a92138b8af Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 18 Jul 2024 21:14:30 -0400 Subject: [PATCH 325/438] increase funds needed if relay fails due to insufficient funds --- .../components/SelfRelayExecuteModal.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/stateful/components/SelfRelayExecuteModal.tsx b/packages/stateful/components/SelfRelayExecuteModal.tsx index 90bf84cdf..522e8300a 100644 --- a/packages/stateful/components/SelfRelayExecuteModal.tsx +++ b/packages/stateful/components/SelfRelayExecuteModal.tsx @@ -169,6 +169,11 @@ export const SelfRelayExecuteModal = ({ // true. const [canceling, setCanceling] = useState(false) + // If relay fails due to insufficient funds, this multiplier is applied to the + // funds needed that is defined at the top. + const [fundsNeededRetryMultiplier, setFundsNeededRetryMultiplier] = + useState(1) + // When the modal is closed, reset state. useEffect(() => { if (visible) { @@ -230,9 +235,11 @@ export const SelfRelayExecuteModal = ({ // adjusting for number of packets. const getRelayerFundsRef = useUpdatingRef( (chainId: string): number => - // Use relayer funds as base and increase by 5% per packet + // Use relayer funds as base, increase by 5% per packet, and apply retry + // multiplier. (RELAYER_FUNDS_NEEDED[chainId] ?? 0) * - (1 + crossChainPackets.length * 0.05) + (1 + crossChainPackets.length * 0.05) * + fundsNeededRetryMultiplier ) const walletFunds = useCachedLoadingWithError( @@ -777,6 +784,9 @@ export const SelfRelayExecuteModal = ({ // Refresh all balances. relayers.map(refreshBalances) console.error(err) + // Increase multipler by 25% so we retry with more funds than + // before. + setFundsNeededRetryMultiplier((m) => m + 0.25) throw new Error(t('error.relayerWalletNeedsFunds')) } @@ -881,6 +891,9 @@ export const SelfRelayExecuteModal = ({ // Refresh all balances. relayers.map(refreshBalances) console.error(err) + // Increase multipler by 25% so we retry with more funds than + // before. + setFundsNeededRetryMultiplier((m) => m + 0.25) throw new Error(t('error.relayerWalletNeedsFunds')) } From 39145233b0d0bc4c32ec51e5d33c9d6b3fc360e5 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 18 Jul 2024 21:34:38 -0400 Subject: [PATCH 326/438] switched juno mainnet RPC --- packages/utils/constants/chains.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 3fffc1f29..99e2e0f3a 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -2268,8 +2268,8 @@ export const CHAIN_ENDPOINTS: Partial< > > = { [ChainId.JunoMainnet]: { - rpc: 'https://juno-rpc.polkachu.com', - rest: 'https://juno-api.polkachu.com', + rpc: 'https://juno-rpc.publicnode.com', + rest: 'https://juno-rest.publicnode.com', }, [ChainId.JunoTestnet]: { rpc: 'https://juno-testnet-rpc.polkachu.com', From 68e4b865552bf5f60e5135a4e620276cb35b0f71 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 18 Jul 2024 22:56:05 -0400 Subject: [PATCH 327/438] added script to dump go relayer entries --- packages/state/utils/chain.ts | 6 +- .../core/advanced/Custom/Component.tsx | 4 +- .../stateful/components/dao/tabs/AppsTab.tsx | 4 +- .../stateful/hooks/useSimulateCosmosMsgs.ts | 3 +- .../types/protobuf/codegen/OmniFlix/bundle.ts | 44 +- .../types/protobuf/codegen/alliance/bundle.ts | 24 +- .../types/protobuf/codegen/bitsong/bundle.ts | 16 +- .../types/protobuf/codegen/circle/bundle.ts | 24 +- .../types/protobuf/codegen/cosmos/bundle.ts | 270 +-- .../codegen/cosmos/ics23/v1/proofs.ts | 2073 +++++++++++++++++ .../types/protobuf/codegen/cosmwasm/bundle.ts | 68 +- .../protobuf/codegen/feemarket/bundle.ts | 34 +- .../types/protobuf/codegen/gaia/bundle.ts | 32 +- .../protobuf/codegen/gogoproto/bundle.ts | 4 +- .../types/protobuf/codegen/google/bundle.ts | 22 +- packages/types/protobuf/codegen/ibc/bundle.ts | 172 +- packages/types/protobuf/codegen/ibc/client.ts | 7 +- .../ibc/core/commitment/v1/commitment.ts | 414 ++++ .../ibc/core/connection/v1/connection.ts | 998 ++++++++ .../codegen/ibc/core/connection/v1/genesis.ts | 143 ++ .../ibc/core/connection/v1/query.rpc.Query.ts | 96 + .../codegen/ibc/core/connection/v1/query.ts | 1390 +++++++++++ .../ibc/core/connection/v1/tx.amino.ts | 28 + .../ibc/core/connection/v1/tx.registry.ts | 107 + .../ibc/core/connection/v1/tx.rpc.msg.ts | 58 + .../codegen/ibc/core/connection/v1/tx.ts | 1354 +++++++++++ .../types/protobuf/codegen/ibc/rpc.query.ts | 3 + packages/types/protobuf/codegen/ibc/rpc.tx.ts | 3 + .../types/protobuf/codegen/juno/bundle.ts | 72 +- .../types/protobuf/codegen/kujira/bundle.ts | 92 +- .../types/protobuf/codegen/neutron/bundle.ts | 218 +- .../types/protobuf/codegen/noble/bundle.ts | 20 +- .../types/protobuf/codegen/osmosis/bundle.ts | 480 ++-- .../types/protobuf/codegen/pstake/bundle.ts | 140 +- .../protobuf/codegen/publicawesome/bundle.ts | 126 +- .../types/protobuf/codegen/regen/bundle.ts | 204 +- .../types/protobuf/codegen/secret/bundle.ts | 116 +- .../protobuf/codegen/tendermint/bundle.ts | 40 +- packages/types/protobuf/scripts/codegen.js | 1 + packages/types/protobuf/utils.ts | 51 +- packages/utils/README.md | 25 +- packages/utils/package.json | 3 +- packages/utils/scripts/dump-go-relayer.ts | 141 ++ ...dump-relayer.ts => dump-hermes-relayer.ts} | 20 +- 44 files changed, 8004 insertions(+), 1146 deletions(-) create mode 100644 packages/types/protobuf/codegen/cosmos/ics23/v1/proofs.ts create mode 100644 packages/types/protobuf/codegen/ibc/core/commitment/v1/commitment.ts create mode 100644 packages/types/protobuf/codegen/ibc/core/connection/v1/connection.ts create mode 100644 packages/types/protobuf/codegen/ibc/core/connection/v1/genesis.ts create mode 100644 packages/types/protobuf/codegen/ibc/core/connection/v1/query.rpc.Query.ts create mode 100644 packages/types/protobuf/codegen/ibc/core/connection/v1/query.ts create mode 100644 packages/types/protobuf/codegen/ibc/core/connection/v1/tx.amino.ts create mode 100644 packages/types/protobuf/codegen/ibc/core/connection/v1/tx.registry.ts create mode 100644 packages/types/protobuf/codegen/ibc/core/connection/v1/tx.rpc.msg.ts create mode 100644 packages/types/protobuf/codegen/ibc/core/connection/v1/tx.ts create mode 100644 packages/utils/scripts/dump-go-relayer.ts rename packages/utils/scripts/{dump-relayer.ts => dump-hermes-relayer.ts} (91%) diff --git a/packages/state/utils/chain.ts b/packages/state/utils/chain.ts index 0ef24a918..e0bf69543 100644 --- a/packages/state/utils/chain.ts +++ b/packages/state/utils/chain.ts @@ -2,7 +2,7 @@ import { Chain } from '@chain-registry/types' import { SigningCosmWasmClientOptions } from '@cosmjs/cosmwasm-stargate' import { QueryClient } from '@tanstack/react-query' -import { aminoTypes, typesRegistry } from '@dao-dao/types' +import { getAminoTypes, getTypesRegistry } from '@dao-dao/types' import { getChainForChainName } from '@dao-dao/utils' import { DynamicGasPrice } from './DynamicGasPrice' @@ -27,7 +27,7 @@ export const makeGetSignerOptions = return { gasPrice, - registry: typesRegistry, - aminoTypes, + registry: getTypesRegistry(), + aminoTypes: getAminoTypes(), } } diff --git a/packages/stateful/actions/core/advanced/Custom/Component.tsx b/packages/stateful/actions/core/advanced/Custom/Component.tsx index 5531230f4..2817eb245 100644 --- a/packages/stateful/actions/core/advanced/Custom/Component.tsx +++ b/packages/stateful/actions/core/advanced/Custom/Component.tsx @@ -8,7 +8,7 @@ import { FilterableItemPopup, useChain, } from '@dao-dao/stateless' -import { ChainId, PROTOBUF_TYPES } from '@dao-dao/types' +import { ChainId, getProtobufTypes } from '@dao-dao/types' import { ActionComponent } from '@dao-dao/types/actions' import { convertJsonToCWCosmosMsg, @@ -31,7 +31,7 @@ export const CustomComponent: ActionComponent = ({ const types = useMemo( () => - PROTOBUF_TYPES.filter( + getProtobufTypes().filter( ([type]) => // Only show protobuf message types. type.split('.').pop()?.startsWith('Msg') && diff --git a/packages/stateful/components/dao/tabs/AppsTab.tsx b/packages/stateful/components/dao/tabs/AppsTab.tsx index ef1b0e87d..9091e3d22 100644 --- a/packages/stateful/components/dao/tabs/AppsTab.tsx +++ b/packages/stateful/components/dao/tabs/AppsTab.tsx @@ -33,8 +33,8 @@ import { BaseNewProposalProps, ProposalDraft, UnifiedCosmosMsg, - aminoTypes, decodedStargateMsgToCw, + getAminoTypes, protobufToCwMsg, } from '@dao-dao/types' import { TxBody } from '@dao-dao/types/protobuf/codegen/cosmos/tx/v1beta1/tx' @@ -159,7 +159,7 @@ export const AppsTab = () => { chainId, decodedStargateMsgToCw( getChainForChainId(chainId), - aminoTypes.fromAmino(msg) + getAminoTypes().fromAmino(msg) ).msg ) ) diff --git a/packages/stateful/hooks/useSimulateCosmosMsgs.ts b/packages/stateful/hooks/useSimulateCosmosMsgs.ts index e7e3e9161..bc7c231e2 100644 --- a/packages/stateful/hooks/useSimulateCosmosMsgs.ts +++ b/packages/stateful/hooks/useSimulateCosmosMsgs.ts @@ -6,7 +6,7 @@ import { useChain } from '@dao-dao/stateless' import { UnifiedCosmosMsg, cwMsgToEncodeObject, - typesRegistry, + getTypesRegistry, } from '@dao-dao/types' import { cosmos } from '@dao-dao/types/protobuf' import { SignMode } from '@dao-dao/types/protobuf/codegen/cosmos/tx/signing/v1beta1/signing' @@ -105,6 +105,7 @@ const doSimulation = async ( ) => { const cosmosRpcClient = await cosmosProtoRpcClientRouter.connect(chainId) + const typesRegistry = getTypesRegistry() const encodedMsgs = msgs.map((msg) => { const encoded = cwMsgToEncodeObject(chainId, msg, senderAddress) return typesRegistry.encodeAsAny(encoded) diff --git a/packages/types/protobuf/codegen/OmniFlix/bundle.ts b/packages/types/protobuf/codegen/OmniFlix/bundle.ts index 5b7206f1a..2e8a582ba 100644 --- a/packages/types/protobuf/codegen/OmniFlix/bundle.ts +++ b/packages/types/protobuf/codegen/OmniFlix/bundle.ts @@ -1,30 +1,30 @@ -import * as _200 from "./onft/v1beta1/genesis"; -import * as _201 from "./onft/v1beta1/onft"; -import * as _202 from "./onft/v1beta1/params"; -import * as _203 from "./onft/v1beta1/query"; -import * as _204 from "./onft/v1beta1/tx"; -import * as _509 from "./onft/v1beta1/tx.amino"; -import * as _510 from "./onft/v1beta1/tx.registry"; -import * as _511 from "./onft/v1beta1/query.rpc.Query"; -import * as _512 from "./onft/v1beta1/tx.rpc.msg"; -import * as _654 from "./rpc.query"; -import * as _655 from "./rpc.tx"; +import * as _206 from "./onft/v1beta1/genesis"; +import * as _207 from "./onft/v1beta1/onft"; +import * as _208 from "./onft/v1beta1/params"; +import * as _209 from "./onft/v1beta1/query"; +import * as _210 from "./onft/v1beta1/tx"; +import * as _519 from "./onft/v1beta1/tx.amino"; +import * as _520 from "./onft/v1beta1/tx.registry"; +import * as _521 from "./onft/v1beta1/query.rpc.Query"; +import * as _522 from "./onft/v1beta1/tx.rpc.msg"; +import * as _664 from "./rpc.query"; +import * as _665 from "./rpc.tx"; export namespace OmniFlix { export namespace onft { export const v1beta1 = { - ..._200, - ..._201, - ..._202, - ..._203, - ..._204, - ..._509, - ..._510, - ..._511, - ..._512 + ..._206, + ..._207, + ..._208, + ..._209, + ..._210, + ..._519, + ..._520, + ..._521, + ..._522 }; } export const ClientFactory = { - ..._654, - ..._655 + ..._664, + ..._665 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/alliance/bundle.ts b/packages/types/protobuf/codegen/alliance/bundle.ts index 8369d38a4..68390a816 100644 --- a/packages/types/protobuf/codegen/alliance/bundle.ts +++ b/packages/types/protobuf/codegen/alliance/bundle.ts @@ -8,12 +8,12 @@ import * as _6 from "./alliance/query"; import * as _7 from "./alliance/redelegations"; import * as _8 from "./alliance/tx"; import * as _9 from "./alliance/unbonding"; -import * as _374 from "./alliance/tx.amino"; -import * as _375 from "./alliance/tx.registry"; -import * as _376 from "./alliance/query.rpc.Query"; -import * as _377 from "./alliance/tx.rpc.msg"; -import * as _633 from "./rpc.query"; -import * as _634 from "./rpc.tx"; +import * as _380 from "./alliance/tx.amino"; +import * as _381 from "./alliance/tx.registry"; +import * as _382 from "./alliance/query.rpc.Query"; +import * as _383 from "./alliance/tx.rpc.msg"; +import * as _643 from "./rpc.query"; +import * as _644 from "./rpc.tx"; export namespace alliance { export const alliance = { ..._0, @@ -26,13 +26,13 @@ export namespace alliance { ..._7, ..._8, ..._9, - ..._374, - ..._375, - ..._376, - ..._377 + ..._380, + ..._381, + ..._382, + ..._383 }; export const ClientFactory = { - ..._633, - ..._634 + ..._643, + ..._644 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/bitsong/bundle.ts b/packages/types/protobuf/codegen/bitsong/bundle.ts index 703acd06f..0aed32711 100644 --- a/packages/types/protobuf/codegen/bitsong/bundle.ts +++ b/packages/types/protobuf/codegen/bitsong/bundle.ts @@ -1,16 +1,16 @@ import * as _11 from "./fantoken/v1beta1/tx"; -import * as _378 from "./fantoken/v1beta1/tx.amino"; -import * as _379 from "./fantoken/v1beta1/tx.registry"; -import * as _380 from "./fantoken/v1beta1/tx.rpc.msg"; -import * as _635 from "./rpc.tx"; +import * as _384 from "./fantoken/v1beta1/tx.amino"; +import * as _385 from "./fantoken/v1beta1/tx.registry"; +import * as _386 from "./fantoken/v1beta1/tx.rpc.msg"; +import * as _645 from "./rpc.tx"; export namespace bitsong { export const fantoken = { ..._11, - ..._378, - ..._379, - ..._380 + ..._384, + ..._385, + ..._386 }; export const ClientFactory = { - ..._635 + ..._645 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/circle/bundle.ts b/packages/types/protobuf/codegen/circle/bundle.ts index 42021b654..7f6f4687b 100644 --- a/packages/types/protobuf/codegen/circle/bundle.ts +++ b/packages/types/protobuf/codegen/circle/bundle.ts @@ -14,12 +14,12 @@ import * as _24 from "./cctp/v1/sending_and_receiving_messages_paused"; import * as _25 from "./cctp/v1/signature_threshold"; import * as _26 from "./cctp/v1/token_pair"; import * as _27 from "./cctp/v1/tx"; -import * as _381 from "./cctp/v1/tx.amino"; -import * as _382 from "./cctp/v1/tx.registry"; -import * as _383 from "./cctp/v1/query.rpc.Query"; -import * as _384 from "./cctp/v1/tx.rpc.msg"; -import * as _636 from "./rpc.query"; -import * as _637 from "./rpc.tx"; +import * as _387 from "./cctp/v1/tx.amino"; +import * as _388 from "./cctp/v1/tx.registry"; +import * as _389 from "./cctp/v1/query.rpc.Query"; +import * as _390 from "./cctp/v1/tx.rpc.msg"; +import * as _646 from "./rpc.query"; +import * as _647 from "./rpc.tx"; export namespace circle { export namespace cctp { export const v1 = { @@ -39,14 +39,14 @@ export namespace circle { ..._25, ..._26, ..._27, - ..._381, - ..._382, - ..._383, - ..._384 + ..._387, + ..._388, + ..._389, + ..._390 }; } export const ClientFactory = { - ..._636, - ..._637 + ..._646, + ..._647 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/bundle.ts b/packages/types/protobuf/codegen/cosmos/bundle.ts index 5716d1a07..a88419184 100644 --- a/packages/types/protobuf/codegen/cosmos/bundle.ts +++ b/packages/types/protobuf/codegen/cosmos/bundle.ts @@ -36,79 +36,80 @@ import * as _63 from "./gov/v1beta1/genesis"; import * as _64 from "./gov/v1beta1/gov"; import * as _65 from "./gov/v1beta1/query"; import * as _66 from "./gov/v1beta1/tx"; -import * as _67 from "./mint/v1beta1/genesis"; -import * as _68 from "./mint/v1beta1/mint"; -import * as _69 from "./mint/v1beta1/query"; -import * as _70 from "./mint/v1beta1/tx"; -import * as _71 from "./msg/v1/msg"; -import * as _72 from "./orm/v1/orm"; -import * as _73 from "./params/v1beta1/params"; -import * as _74 from "./params/v1beta1/query"; -import * as _75 from "./query/v1/query"; -import * as _76 from "./slashing/v1beta1/genesis"; -import * as _77 from "./slashing/v1beta1/query"; -import * as _78 from "./slashing/v1beta1/slashing"; -import * as _79 from "./slashing/v1beta1/tx"; -import * as _80 from "./staking/v1beta1/authz"; -import * as _81 from "./staking/v1beta1/genesis"; -import * as _82 from "./staking/v1beta1/query"; -import * as _83 from "./staking/v1beta1/staking"; -import * as _84 from "./staking/v1beta1/tx"; -import * as _85 from "./tx/signing/v1beta1/signing"; -import * as _86 from "./tx/v1beta1/service"; -import * as _87 from "./tx/v1beta1/tx"; -import * as _88 from "./upgrade/v1beta1/query"; -import * as _89 from "./upgrade/v1beta1/tx"; -import * as _90 from "./upgrade/v1beta1/upgrade"; -import * as _385 from "./auth/v1beta1/tx.amino"; -import * as _386 from "./authz/v1beta1/tx.amino"; -import * as _387 from "./bank/v1beta1/tx.amino"; -import * as _388 from "./distribution/v1beta1/tx.amino"; -import * as _389 from "./feegrant/v1beta1/tx.amino"; -import * as _390 from "./gov/v1/tx.amino"; -import * as _391 from "./gov/v1beta1/tx.amino"; -import * as _392 from "./mint/v1beta1/tx.amino"; -import * as _393 from "./slashing/v1beta1/tx.amino"; -import * as _394 from "./staking/v1beta1/tx.amino"; -import * as _395 from "./upgrade/v1beta1/tx.amino"; -import * as _396 from "./auth/v1beta1/tx.registry"; -import * as _397 from "./authz/v1beta1/tx.registry"; -import * as _398 from "./bank/v1beta1/tx.registry"; -import * as _399 from "./distribution/v1beta1/tx.registry"; -import * as _400 from "./feegrant/v1beta1/tx.registry"; -import * as _401 from "./gov/v1/tx.registry"; -import * as _402 from "./gov/v1beta1/tx.registry"; -import * as _403 from "./mint/v1beta1/tx.registry"; -import * as _404 from "./slashing/v1beta1/tx.registry"; -import * as _405 from "./staking/v1beta1/tx.registry"; -import * as _406 from "./upgrade/v1beta1/tx.registry"; -import * as _407 from "./auth/v1beta1/query.rpc.Query"; -import * as _408 from "./authz/v1beta1/query.rpc.Query"; -import * as _409 from "./bank/v1beta1/query.rpc.Query"; -import * as _410 from "./base/tendermint/v1beta1/query.rpc.Service"; -import * as _411 from "./distribution/v1beta1/query.rpc.Query"; -import * as _412 from "./feegrant/v1beta1/query.rpc.Query"; -import * as _413 from "./gov/v1/query.rpc.Query"; -import * as _414 from "./gov/v1beta1/query.rpc.Query"; -import * as _415 from "./mint/v1beta1/query.rpc.Query"; -import * as _416 from "./params/v1beta1/query.rpc.Query"; -import * as _417 from "./slashing/v1beta1/query.rpc.Query"; -import * as _418 from "./staking/v1beta1/query.rpc.Query"; -import * as _419 from "./tx/v1beta1/service.rpc.Service"; -import * as _420 from "./upgrade/v1beta1/query.rpc.Query"; -import * as _421 from "./auth/v1beta1/tx.rpc.msg"; -import * as _422 from "./authz/v1beta1/tx.rpc.msg"; -import * as _423 from "./bank/v1beta1/tx.rpc.msg"; -import * as _424 from "./distribution/v1beta1/tx.rpc.msg"; -import * as _425 from "./feegrant/v1beta1/tx.rpc.msg"; -import * as _426 from "./gov/v1/tx.rpc.msg"; -import * as _427 from "./gov/v1beta1/tx.rpc.msg"; -import * as _428 from "./mint/v1beta1/tx.rpc.msg"; -import * as _429 from "./slashing/v1beta1/tx.rpc.msg"; -import * as _430 from "./staking/v1beta1/tx.rpc.msg"; -import * as _431 from "./upgrade/v1beta1/tx.rpc.msg"; -import * as _638 from "./rpc.query"; -import * as _639 from "./rpc.tx"; +import * as _67 from "./ics23/v1/proofs"; +import * as _68 from "./mint/v1beta1/genesis"; +import * as _69 from "./mint/v1beta1/mint"; +import * as _70 from "./mint/v1beta1/query"; +import * as _71 from "./mint/v1beta1/tx"; +import * as _72 from "./msg/v1/msg"; +import * as _73 from "./orm/v1/orm"; +import * as _74 from "./params/v1beta1/params"; +import * as _75 from "./params/v1beta1/query"; +import * as _76 from "./query/v1/query"; +import * as _77 from "./slashing/v1beta1/genesis"; +import * as _78 from "./slashing/v1beta1/query"; +import * as _79 from "./slashing/v1beta1/slashing"; +import * as _80 from "./slashing/v1beta1/tx"; +import * as _81 from "./staking/v1beta1/authz"; +import * as _82 from "./staking/v1beta1/genesis"; +import * as _83 from "./staking/v1beta1/query"; +import * as _84 from "./staking/v1beta1/staking"; +import * as _85 from "./staking/v1beta1/tx"; +import * as _86 from "./tx/signing/v1beta1/signing"; +import * as _87 from "./tx/v1beta1/service"; +import * as _88 from "./tx/v1beta1/tx"; +import * as _89 from "./upgrade/v1beta1/query"; +import * as _90 from "./upgrade/v1beta1/tx"; +import * as _91 from "./upgrade/v1beta1/upgrade"; +import * as _391 from "./auth/v1beta1/tx.amino"; +import * as _392 from "./authz/v1beta1/tx.amino"; +import * as _393 from "./bank/v1beta1/tx.amino"; +import * as _394 from "./distribution/v1beta1/tx.amino"; +import * as _395 from "./feegrant/v1beta1/tx.amino"; +import * as _396 from "./gov/v1/tx.amino"; +import * as _397 from "./gov/v1beta1/tx.amino"; +import * as _398 from "./mint/v1beta1/tx.amino"; +import * as _399 from "./slashing/v1beta1/tx.amino"; +import * as _400 from "./staking/v1beta1/tx.amino"; +import * as _401 from "./upgrade/v1beta1/tx.amino"; +import * as _402 from "./auth/v1beta1/tx.registry"; +import * as _403 from "./authz/v1beta1/tx.registry"; +import * as _404 from "./bank/v1beta1/tx.registry"; +import * as _405 from "./distribution/v1beta1/tx.registry"; +import * as _406 from "./feegrant/v1beta1/tx.registry"; +import * as _407 from "./gov/v1/tx.registry"; +import * as _408 from "./gov/v1beta1/tx.registry"; +import * as _409 from "./mint/v1beta1/tx.registry"; +import * as _410 from "./slashing/v1beta1/tx.registry"; +import * as _411 from "./staking/v1beta1/tx.registry"; +import * as _412 from "./upgrade/v1beta1/tx.registry"; +import * as _413 from "./auth/v1beta1/query.rpc.Query"; +import * as _414 from "./authz/v1beta1/query.rpc.Query"; +import * as _415 from "./bank/v1beta1/query.rpc.Query"; +import * as _416 from "./base/tendermint/v1beta1/query.rpc.Service"; +import * as _417 from "./distribution/v1beta1/query.rpc.Query"; +import * as _418 from "./feegrant/v1beta1/query.rpc.Query"; +import * as _419 from "./gov/v1/query.rpc.Query"; +import * as _420 from "./gov/v1beta1/query.rpc.Query"; +import * as _421 from "./mint/v1beta1/query.rpc.Query"; +import * as _422 from "./params/v1beta1/query.rpc.Query"; +import * as _423 from "./slashing/v1beta1/query.rpc.Query"; +import * as _424 from "./staking/v1beta1/query.rpc.Query"; +import * as _425 from "./tx/v1beta1/service.rpc.Service"; +import * as _426 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _427 from "./auth/v1beta1/tx.rpc.msg"; +import * as _428 from "./authz/v1beta1/tx.rpc.msg"; +import * as _429 from "./bank/v1beta1/tx.rpc.msg"; +import * as _430 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _431 from "./feegrant/v1beta1/tx.rpc.msg"; +import * as _432 from "./gov/v1/tx.rpc.msg"; +import * as _433 from "./gov/v1beta1/tx.rpc.msg"; +import * as _434 from "./mint/v1beta1/tx.rpc.msg"; +import * as _435 from "./slashing/v1beta1/tx.rpc.msg"; +import * as _436 from "./staking/v1beta1/tx.rpc.msg"; +import * as _437 from "./upgrade/v1beta1/tx.rpc.msg"; +import * as _648 from "./rpc.query"; +import * as _649 from "./rpc.tx"; export namespace cosmos { export namespace auth { export const v1beta1 = { @@ -116,10 +117,10 @@ export namespace cosmos { ..._30, ..._31, ..._32, - ..._385, - ..._396, - ..._407, - ..._421 + ..._391, + ..._402, + ..._413, + ..._427 }; } export namespace authz { @@ -129,10 +130,10 @@ export namespace cosmos { ..._35, ..._36, ..._37, - ..._386, - ..._397, - ..._408, - ..._422 + ..._392, + ..._403, + ..._414, + ..._428 }; } export namespace bank { @@ -142,10 +143,10 @@ export namespace cosmos { ..._40, ..._41, ..._42, - ..._387, - ..._398, - ..._409, - ..._423 + ..._393, + ..._404, + ..._415, + ..._429 }; } export namespace base { @@ -163,7 +164,7 @@ export namespace cosmos { export const v1beta1 = { ..._45, ..._46, - ..._410 + ..._416 }; } export const v1beta1 = { @@ -187,10 +188,10 @@ export namespace cosmos { ..._52, ..._53, ..._54, - ..._388, - ..._399, - ..._411, - ..._424 + ..._394, + ..._405, + ..._417, + ..._430 }; } export namespace feegrant { @@ -199,10 +200,10 @@ export namespace cosmos { ..._56, ..._57, ..._58, - ..._389, - ..._400, - ..._412, - ..._425 + ..._395, + ..._406, + ..._418, + ..._431 }; } export namespace gov { @@ -211,106 +212,111 @@ export namespace cosmos { ..._60, ..._61, ..._62, - ..._390, - ..._401, - ..._413, - ..._426 + ..._396, + ..._407, + ..._419, + ..._432 }; export const v1beta1 = { ..._63, ..._64, ..._65, ..._66, - ..._391, - ..._402, - ..._414, - ..._427 + ..._397, + ..._408, + ..._420, + ..._433 + }; + } + export namespace ics23 { + export const v1 = { + ..._67 }; } export namespace mint { export const v1beta1 = { - ..._67, ..._68, ..._69, ..._70, - ..._392, - ..._403, - ..._415, - ..._428 + ..._71, + ..._398, + ..._409, + ..._421, + ..._434 }; } export namespace msg { export const v1 = { - ..._71 + ..._72 }; } export namespace orm { export const v1 = { - ..._72 + ..._73 }; } export namespace params { export const v1beta1 = { - ..._73, ..._74, - ..._416 + ..._75, + ..._422 }; } export namespace query { export const v1 = { - ..._75 + ..._76 }; } export namespace slashing { export const v1beta1 = { - ..._76, ..._77, ..._78, ..._79, - ..._393, - ..._404, - ..._417, - ..._429 + ..._80, + ..._399, + ..._410, + ..._423, + ..._435 }; } export namespace staking { export const v1beta1 = { - ..._80, ..._81, ..._82, ..._83, ..._84, - ..._394, - ..._405, - ..._418, - ..._430 + ..._85, + ..._400, + ..._411, + ..._424, + ..._436 }; } export namespace tx { export namespace signing { export const v1beta1 = { - ..._85 + ..._86 }; } export const v1beta1 = { - ..._86, ..._87, - ..._419 + ..._88, + ..._425 }; } export namespace upgrade { export const v1beta1 = { - ..._88, ..._89, ..._90, - ..._395, - ..._406, - ..._420, - ..._431 + ..._91, + ..._401, + ..._412, + ..._426, + ..._437 }; } export const ClientFactory = { - ..._638, - ..._639 + ..._648, + ..._649 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/ics23/v1/proofs.ts b/packages/types/protobuf/codegen/cosmos/ics23/v1/proofs.ts new file mode 100644 index 000000000..9a61919ee --- /dev/null +++ b/packages/types/protobuf/codegen/cosmos/ics23/v1/proofs.ts @@ -0,0 +1,2073 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +export enum HashOp { + /** NO_HASH - NO_HASH is the default if no data passed. Note this is an illegal argument some places. */ + NO_HASH = 0, + SHA256 = 1, + SHA512 = 2, + KECCAK = 3, + RIPEMD160 = 4, + /** BITCOIN - ripemd160(sha256(x)) */ + BITCOIN = 5, + SHA512_256 = 6, + UNRECOGNIZED = -1, +} +export const HashOpSDKType = HashOp; +export const HashOpAmino = HashOp; +export function hashOpFromJSON(object: any): HashOp { + switch (object) { + case 0: + case "NO_HASH": + return HashOp.NO_HASH; + case 1: + case "SHA256": + return HashOp.SHA256; + case 2: + case "SHA512": + return HashOp.SHA512; + case 3: + case "KECCAK": + return HashOp.KECCAK; + case 4: + case "RIPEMD160": + return HashOp.RIPEMD160; + case 5: + case "BITCOIN": + return HashOp.BITCOIN; + case 6: + case "SHA512_256": + return HashOp.SHA512_256; + case -1: + case "UNRECOGNIZED": + default: + return HashOp.UNRECOGNIZED; + } +} +export function hashOpToJSON(object: HashOp): string { + switch (object) { + case HashOp.NO_HASH: + return "NO_HASH"; + case HashOp.SHA256: + return "SHA256"; + case HashOp.SHA512: + return "SHA512"; + case HashOp.KECCAK: + return "KECCAK"; + case HashOp.RIPEMD160: + return "RIPEMD160"; + case HashOp.BITCOIN: + return "BITCOIN"; + case HashOp.SHA512_256: + return "SHA512_256"; + case HashOp.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * LengthOp defines how to process the key and value of the LeafOp + * to include length information. After encoding the length with the given + * algorithm, the length will be prepended to the key and value bytes. + * (Each one with it's own encoded length) + */ +export enum LengthOp { + /** NO_PREFIX - NO_PREFIX don't include any length info */ + NO_PREFIX = 0, + /** VAR_PROTO - VAR_PROTO uses protobuf (and go-amino) varint encoding of the length */ + VAR_PROTO = 1, + /** VAR_RLP - VAR_RLP uses rlp int encoding of the length */ + VAR_RLP = 2, + /** FIXED32_BIG - FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer */ + FIXED32_BIG = 3, + /** FIXED32_LITTLE - FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer */ + FIXED32_LITTLE = 4, + /** FIXED64_BIG - FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer */ + FIXED64_BIG = 5, + /** FIXED64_LITTLE - FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer */ + FIXED64_LITTLE = 6, + /** REQUIRE_32_BYTES - REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output) */ + REQUIRE_32_BYTES = 7, + /** REQUIRE_64_BYTES - REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output) */ + REQUIRE_64_BYTES = 8, + UNRECOGNIZED = -1, +} +export const LengthOpSDKType = LengthOp; +export const LengthOpAmino = LengthOp; +export function lengthOpFromJSON(object: any): LengthOp { + switch (object) { + case 0: + case "NO_PREFIX": + return LengthOp.NO_PREFIX; + case 1: + case "VAR_PROTO": + return LengthOp.VAR_PROTO; + case 2: + case "VAR_RLP": + return LengthOp.VAR_RLP; + case 3: + case "FIXED32_BIG": + return LengthOp.FIXED32_BIG; + case 4: + case "FIXED32_LITTLE": + return LengthOp.FIXED32_LITTLE; + case 5: + case "FIXED64_BIG": + return LengthOp.FIXED64_BIG; + case 6: + case "FIXED64_LITTLE": + return LengthOp.FIXED64_LITTLE; + case 7: + case "REQUIRE_32_BYTES": + return LengthOp.REQUIRE_32_BYTES; + case 8: + case "REQUIRE_64_BYTES": + return LengthOp.REQUIRE_64_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return LengthOp.UNRECOGNIZED; + } +} +export function lengthOpToJSON(object: LengthOp): string { + switch (object) { + case LengthOp.NO_PREFIX: + return "NO_PREFIX"; + case LengthOp.VAR_PROTO: + return "VAR_PROTO"; + case LengthOp.VAR_RLP: + return "VAR_RLP"; + case LengthOp.FIXED32_BIG: + return "FIXED32_BIG"; + case LengthOp.FIXED32_LITTLE: + return "FIXED32_LITTLE"; + case LengthOp.FIXED64_BIG: + return "FIXED64_BIG"; + case LengthOp.FIXED64_LITTLE: + return "FIXED64_LITTLE"; + case LengthOp.REQUIRE_32_BYTES: + return "REQUIRE_32_BYTES"; + case LengthOp.REQUIRE_64_BYTES: + return "REQUIRE_64_BYTES"; + case LengthOp.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * ExistenceProof takes a key and a value and a set of steps to perform on it. + * The result of peforming all these steps will provide a "root hash", which can + * be compared to the value in a header. + * + * Since it is computationally infeasible to produce a hash collission for any of the used + * cryptographic hash functions, if someone can provide a series of operations to transform + * a given key and value into a root hash that matches some trusted root, these key and values + * must be in the referenced merkle tree. + * + * The only possible issue is maliablity in LeafOp, such as providing extra prefix data, + * which should be controlled by a spec. Eg. with lengthOp as NONE, + * prefix = FOO, key = BAR, value = CHOICE + * and + * prefix = F, key = OOBAR, value = CHOICE + * would produce the same value. + * + * With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field + * in the ProofSpec is valuable to prevent this mutability. And why all trees should + * length-prefix the data before hashing it. + */ +export interface ExistenceProof { + key: Uint8Array; + value: Uint8Array; + leaf?: LeafOp | undefined; + path: InnerOp[]; +} +export interface ExistenceProofProtoMsg { + typeUrl: "/cosmos.ics23.v1.ExistenceProof"; + value: Uint8Array; +} +/** + * ExistenceProof takes a key and a value and a set of steps to perform on it. + * The result of peforming all these steps will provide a "root hash", which can + * be compared to the value in a header. + * + * Since it is computationally infeasible to produce a hash collission for any of the used + * cryptographic hash functions, if someone can provide a series of operations to transform + * a given key and value into a root hash that matches some trusted root, these key and values + * must be in the referenced merkle tree. + * + * The only possible issue is maliablity in LeafOp, such as providing extra prefix data, + * which should be controlled by a spec. Eg. with lengthOp as NONE, + * prefix = FOO, key = BAR, value = CHOICE + * and + * prefix = F, key = OOBAR, value = CHOICE + * would produce the same value. + * + * With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field + * in the ProofSpec is valuable to prevent this mutability. And why all trees should + * length-prefix the data before hashing it. + */ +export interface ExistenceProofAmino { + key?: string; + value?: string; + leaf?: LeafOpAmino | undefined; + path?: InnerOpAmino[]; +} +export interface ExistenceProofAminoMsg { + type: "cosmos-sdk/ExistenceProof"; + value: ExistenceProofAmino; +} +/** + * ExistenceProof takes a key and a value and a set of steps to perform on it. + * The result of peforming all these steps will provide a "root hash", which can + * be compared to the value in a header. + * + * Since it is computationally infeasible to produce a hash collission for any of the used + * cryptographic hash functions, if someone can provide a series of operations to transform + * a given key and value into a root hash that matches some trusted root, these key and values + * must be in the referenced merkle tree. + * + * The only possible issue is maliablity in LeafOp, such as providing extra prefix data, + * which should be controlled by a spec. Eg. with lengthOp as NONE, + * prefix = FOO, key = BAR, value = CHOICE + * and + * prefix = F, key = OOBAR, value = CHOICE + * would produce the same value. + * + * With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field + * in the ProofSpec is valuable to prevent this mutability. And why all trees should + * length-prefix the data before hashing it. + */ +export interface ExistenceProofSDKType { + key: Uint8Array; + value: Uint8Array; + leaf?: LeafOpSDKType | undefined; + path: InnerOpSDKType[]; +} +/** + * NonExistenceProof takes a proof of two neighbors, one left of the desired key, + * one right of the desired key. If both proofs are valid AND they are neighbors, + * then there is no valid proof for the given key. + */ +export interface NonExistenceProof { + /** TODO: remove this as unnecessary??? we prove a range */ + key: Uint8Array; + left?: ExistenceProof | undefined; + right?: ExistenceProof | undefined; +} +export interface NonExistenceProofProtoMsg { + typeUrl: "/cosmos.ics23.v1.NonExistenceProof"; + value: Uint8Array; +} +/** + * NonExistenceProof takes a proof of two neighbors, one left of the desired key, + * one right of the desired key. If both proofs are valid AND they are neighbors, + * then there is no valid proof for the given key. + */ +export interface NonExistenceProofAmino { + /** TODO: remove this as unnecessary??? we prove a range */ + key?: string; + left?: ExistenceProofAmino | undefined; + right?: ExistenceProofAmino | undefined; +} +export interface NonExistenceProofAminoMsg { + type: "cosmos-sdk/NonExistenceProof"; + value: NonExistenceProofAmino; +} +/** + * NonExistenceProof takes a proof of two neighbors, one left of the desired key, + * one right of the desired key. If both proofs are valid AND they are neighbors, + * then there is no valid proof for the given key. + */ +export interface NonExistenceProofSDKType { + key: Uint8Array; + left?: ExistenceProofSDKType | undefined; + right?: ExistenceProofSDKType | undefined; +} +/** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */ +export interface CommitmentProof { + exist?: ExistenceProof | undefined; + nonexist?: NonExistenceProof | undefined; + batch?: BatchProof | undefined; + compressed?: CompressedBatchProof | undefined; +} +export interface CommitmentProofProtoMsg { + typeUrl: "/cosmos.ics23.v1.CommitmentProof"; + value: Uint8Array; +} +/** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */ +export interface CommitmentProofAmino { + exist?: ExistenceProofAmino | undefined; + nonexist?: NonExistenceProofAmino | undefined; + batch?: BatchProofAmino | undefined; + compressed?: CompressedBatchProofAmino | undefined; +} +export interface CommitmentProofAminoMsg { + type: "cosmos-sdk/CommitmentProof"; + value: CommitmentProofAmino; +} +/** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */ +export interface CommitmentProofSDKType { + exist?: ExistenceProofSDKType | undefined; + nonexist?: NonExistenceProofSDKType | undefined; + batch?: BatchProofSDKType | undefined; + compressed?: CompressedBatchProofSDKType | undefined; +} +/** + * LeafOp represents the raw key-value data we wish to prove, and + * must be flexible to represent the internal transformation from + * the original key-value pairs into the basis hash, for many existing + * merkle trees. + * + * key and value are passed in. So that the signature of this operation is: + * leafOp(key, value) -> output + * + * To process this, first prehash the keys and values if needed (ANY means no hash in this case): + * hkey = prehashKey(key) + * hvalue = prehashValue(value) + * + * Then combine the bytes, and hash it + * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) + */ +export interface LeafOp { + hash: HashOp; + prehashKey: HashOp; + prehashValue: HashOp; + length: LengthOp; + /** + * prefix is a fixed bytes that may optionally be included at the beginning to differentiate + * a leaf node from an inner node. + */ + prefix: Uint8Array; +} +export interface LeafOpProtoMsg { + typeUrl: "/cosmos.ics23.v1.LeafOp"; + value: Uint8Array; +} +/** + * LeafOp represents the raw key-value data we wish to prove, and + * must be flexible to represent the internal transformation from + * the original key-value pairs into the basis hash, for many existing + * merkle trees. + * + * key and value are passed in. So that the signature of this operation is: + * leafOp(key, value) -> output + * + * To process this, first prehash the keys and values if needed (ANY means no hash in this case): + * hkey = prehashKey(key) + * hvalue = prehashValue(value) + * + * Then combine the bytes, and hash it + * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) + */ +export interface LeafOpAmino { + hash?: HashOp; + prehash_key?: HashOp; + prehash_value?: HashOp; + length?: LengthOp; + /** + * prefix is a fixed bytes that may optionally be included at the beginning to differentiate + * a leaf node from an inner node. + */ + prefix?: string; +} +export interface LeafOpAminoMsg { + type: "cosmos-sdk/LeafOp"; + value: LeafOpAmino; +} +/** + * LeafOp represents the raw key-value data we wish to prove, and + * must be flexible to represent the internal transformation from + * the original key-value pairs into the basis hash, for many existing + * merkle trees. + * + * key and value are passed in. So that the signature of this operation is: + * leafOp(key, value) -> output + * + * To process this, first prehash the keys and values if needed (ANY means no hash in this case): + * hkey = prehashKey(key) + * hvalue = prehashValue(value) + * + * Then combine the bytes, and hash it + * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) + */ +export interface LeafOpSDKType { + hash: HashOp; + prehash_key: HashOp; + prehash_value: HashOp; + length: LengthOp; + prefix: Uint8Array; +} +/** + * InnerOp represents a merkle-proof step that is not a leaf. + * It represents concatenating two children and hashing them to provide the next result. + * + * The result of the previous step is passed in, so the signature of this op is: + * innerOp(child) -> output + * + * The result of applying InnerOp should be: + * output = op.hash(op.prefix || child || op.suffix) + * + * where the || operator is concatenation of binary data, + * and child is the result of hashing all the tree below this step. + * + * Any special data, like prepending child with the length, or prepending the entire operation with + * some value to differentiate from leaf nodes, should be included in prefix and suffix. + * If either of prefix or suffix is empty, we just treat it as an empty string + */ +export interface InnerOp { + hash: HashOp; + prefix: Uint8Array; + suffix: Uint8Array; +} +export interface InnerOpProtoMsg { + typeUrl: "/cosmos.ics23.v1.InnerOp"; + value: Uint8Array; +} +/** + * InnerOp represents a merkle-proof step that is not a leaf. + * It represents concatenating two children and hashing them to provide the next result. + * + * The result of the previous step is passed in, so the signature of this op is: + * innerOp(child) -> output + * + * The result of applying InnerOp should be: + * output = op.hash(op.prefix || child || op.suffix) + * + * where the || operator is concatenation of binary data, + * and child is the result of hashing all the tree below this step. + * + * Any special data, like prepending child with the length, or prepending the entire operation with + * some value to differentiate from leaf nodes, should be included in prefix and suffix. + * If either of prefix or suffix is empty, we just treat it as an empty string + */ +export interface InnerOpAmino { + hash?: HashOp; + prefix?: string; + suffix?: string; +} +export interface InnerOpAminoMsg { + type: "cosmos-sdk/InnerOp"; + value: InnerOpAmino; +} +/** + * InnerOp represents a merkle-proof step that is not a leaf. + * It represents concatenating two children and hashing them to provide the next result. + * + * The result of the previous step is passed in, so the signature of this op is: + * innerOp(child) -> output + * + * The result of applying InnerOp should be: + * output = op.hash(op.prefix || child || op.suffix) + * + * where the || operator is concatenation of binary data, + * and child is the result of hashing all the tree below this step. + * + * Any special data, like prepending child with the length, or prepending the entire operation with + * some value to differentiate from leaf nodes, should be included in prefix and suffix. + * If either of prefix or suffix is empty, we just treat it as an empty string + */ +export interface InnerOpSDKType { + hash: HashOp; + prefix: Uint8Array; + suffix: Uint8Array; +} +/** + * ProofSpec defines what the expected parameters are for a given proof type. + * This can be stored in the client and used to validate any incoming proofs. + * + * verify(ProofSpec, Proof) -> Proof | Error + * + * As demonstrated in tests, if we don't fix the algorithm used to calculate the + * LeafHash for a given tree, there are many possible key-value pairs that can + * generate a given hash (by interpretting the preimage differently). + * We need this for proper security, requires client knows a priori what + * tree format server uses. But not in code, rather a configuration object. + */ +export interface ProofSpec { + /** + * any field in the ExistenceProof must be the same as in this spec. + * except Prefix, which is just the first bytes of prefix (spec can be longer) + */ + leafSpec?: LeafOp | undefined; + innerSpec?: InnerSpec | undefined; + /** max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) */ + maxDepth: number; + /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ + minDepth: number; + /** + * prehash_key_before_comparison is a flag that indicates whether to use the + * prehash_key specified by LeafOp to compare lexical ordering of keys for + * non-existence proofs. + */ + prehashKeyBeforeComparison: boolean; +} +export interface ProofSpecProtoMsg { + typeUrl: "/cosmos.ics23.v1.ProofSpec"; + value: Uint8Array; +} +/** + * ProofSpec defines what the expected parameters are for a given proof type. + * This can be stored in the client and used to validate any incoming proofs. + * + * verify(ProofSpec, Proof) -> Proof | Error + * + * As demonstrated in tests, if we don't fix the algorithm used to calculate the + * LeafHash for a given tree, there are many possible key-value pairs that can + * generate a given hash (by interpretting the preimage differently). + * We need this for proper security, requires client knows a priori what + * tree format server uses. But not in code, rather a configuration object. + */ +export interface ProofSpecAmino { + /** + * any field in the ExistenceProof must be the same as in this spec. + * except Prefix, which is just the first bytes of prefix (spec can be longer) + */ + leaf_spec?: LeafOpAmino | undefined; + inner_spec?: InnerSpecAmino | undefined; + /** max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) */ + max_depth?: number; + /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ + min_depth?: number; + /** + * prehash_key_before_comparison is a flag that indicates whether to use the + * prehash_key specified by LeafOp to compare lexical ordering of keys for + * non-existence proofs. + */ + prehash_key_before_comparison?: boolean; +} +export interface ProofSpecAminoMsg { + type: "cosmos-sdk/ProofSpec"; + value: ProofSpecAmino; +} +/** + * ProofSpec defines what the expected parameters are for a given proof type. + * This can be stored in the client and used to validate any incoming proofs. + * + * verify(ProofSpec, Proof) -> Proof | Error + * + * As demonstrated in tests, if we don't fix the algorithm used to calculate the + * LeafHash for a given tree, there are many possible key-value pairs that can + * generate a given hash (by interpretting the preimage differently). + * We need this for proper security, requires client knows a priori what + * tree format server uses. But not in code, rather a configuration object. + */ +export interface ProofSpecSDKType { + leaf_spec?: LeafOpSDKType | undefined; + inner_spec?: InnerSpecSDKType | undefined; + max_depth: number; + min_depth: number; + prehash_key_before_comparison: boolean; +} +/** + * InnerSpec contains all store-specific structure info to determine if two proofs from a + * given store are neighbors. + * + * This enables: + * + * isLeftMost(spec: InnerSpec, op: InnerOp) + * isRightMost(spec: InnerSpec, op: InnerOp) + * isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) + */ +export interface InnerSpec { + /** + * Child order is the ordering of the children node, must count from 0 + * iavl tree is [0, 1] (left then right) + * merk is [0, 2, 1] (left, right, here) + */ + childOrder: number[]; + childSize: number; + minPrefixLength: number; + maxPrefixLength: number; + /** empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) */ + emptyChild: Uint8Array; + /** hash is the algorithm that must be used for each InnerOp */ + hash: HashOp; +} +export interface InnerSpecProtoMsg { + typeUrl: "/cosmos.ics23.v1.InnerSpec"; + value: Uint8Array; +} +/** + * InnerSpec contains all store-specific structure info to determine if two proofs from a + * given store are neighbors. + * + * This enables: + * + * isLeftMost(spec: InnerSpec, op: InnerOp) + * isRightMost(spec: InnerSpec, op: InnerOp) + * isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) + */ +export interface InnerSpecAmino { + /** + * Child order is the ordering of the children node, must count from 0 + * iavl tree is [0, 1] (left then right) + * merk is [0, 2, 1] (left, right, here) + */ + child_order?: number[]; + child_size?: number; + min_prefix_length?: number; + max_prefix_length?: number; + /** empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) */ + empty_child?: string; + /** hash is the algorithm that must be used for each InnerOp */ + hash?: HashOp; +} +export interface InnerSpecAminoMsg { + type: "cosmos-sdk/InnerSpec"; + value: InnerSpecAmino; +} +/** + * InnerSpec contains all store-specific structure info to determine if two proofs from a + * given store are neighbors. + * + * This enables: + * + * isLeftMost(spec: InnerSpec, op: InnerOp) + * isRightMost(spec: InnerSpec, op: InnerOp) + * isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) + */ +export interface InnerSpecSDKType { + child_order: number[]; + child_size: number; + min_prefix_length: number; + max_prefix_length: number; + empty_child: Uint8Array; + hash: HashOp; +} +/** BatchProof is a group of multiple proof types than can be compressed */ +export interface BatchProof { + entries: BatchEntry[]; +} +export interface BatchProofProtoMsg { + typeUrl: "/cosmos.ics23.v1.BatchProof"; + value: Uint8Array; +} +/** BatchProof is a group of multiple proof types than can be compressed */ +export interface BatchProofAmino { + entries?: BatchEntryAmino[]; +} +export interface BatchProofAminoMsg { + type: "cosmos-sdk/BatchProof"; + value: BatchProofAmino; +} +/** BatchProof is a group of multiple proof types than can be compressed */ +export interface BatchProofSDKType { + entries: BatchEntrySDKType[]; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface BatchEntry { + exist?: ExistenceProof | undefined; + nonexist?: NonExistenceProof | undefined; +} +export interface BatchEntryProtoMsg { + typeUrl: "/cosmos.ics23.v1.BatchEntry"; + value: Uint8Array; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface BatchEntryAmino { + exist?: ExistenceProofAmino | undefined; + nonexist?: NonExistenceProofAmino | undefined; +} +export interface BatchEntryAminoMsg { + type: "cosmos-sdk/BatchEntry"; + value: BatchEntryAmino; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface BatchEntrySDKType { + exist?: ExistenceProofSDKType | undefined; + nonexist?: NonExistenceProofSDKType | undefined; +} +export interface CompressedBatchProof { + entries: CompressedBatchEntry[]; + lookupInners: InnerOp[]; +} +export interface CompressedBatchProofProtoMsg { + typeUrl: "/cosmos.ics23.v1.CompressedBatchProof"; + value: Uint8Array; +} +export interface CompressedBatchProofAmino { + entries?: CompressedBatchEntryAmino[]; + lookup_inners?: InnerOpAmino[]; +} +export interface CompressedBatchProofAminoMsg { + type: "cosmos-sdk/CompressedBatchProof"; + value: CompressedBatchProofAmino; +} +export interface CompressedBatchProofSDKType { + entries: CompressedBatchEntrySDKType[]; + lookup_inners: InnerOpSDKType[]; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface CompressedBatchEntry { + exist?: CompressedExistenceProof | undefined; + nonexist?: CompressedNonExistenceProof | undefined; +} +export interface CompressedBatchEntryProtoMsg { + typeUrl: "/cosmos.ics23.v1.CompressedBatchEntry"; + value: Uint8Array; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface CompressedBatchEntryAmino { + exist?: CompressedExistenceProofAmino | undefined; + nonexist?: CompressedNonExistenceProofAmino | undefined; +} +export interface CompressedBatchEntryAminoMsg { + type: "cosmos-sdk/CompressedBatchEntry"; + value: CompressedBatchEntryAmino; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface CompressedBatchEntrySDKType { + exist?: CompressedExistenceProofSDKType | undefined; + nonexist?: CompressedNonExistenceProofSDKType | undefined; +} +export interface CompressedExistenceProof { + key: Uint8Array; + value: Uint8Array; + leaf?: LeafOp | undefined; + /** these are indexes into the lookup_inners table in CompressedBatchProof */ + path: number[]; +} +export interface CompressedExistenceProofProtoMsg { + typeUrl: "/cosmos.ics23.v1.CompressedExistenceProof"; + value: Uint8Array; +} +export interface CompressedExistenceProofAmino { + key?: string; + value?: string; + leaf?: LeafOpAmino | undefined; + /** these are indexes into the lookup_inners table in CompressedBatchProof */ + path?: number[]; +} +export interface CompressedExistenceProofAminoMsg { + type: "cosmos-sdk/CompressedExistenceProof"; + value: CompressedExistenceProofAmino; +} +export interface CompressedExistenceProofSDKType { + key: Uint8Array; + value: Uint8Array; + leaf?: LeafOpSDKType | undefined; + path: number[]; +} +export interface CompressedNonExistenceProof { + /** TODO: remove this as unnecessary??? we prove a range */ + key: Uint8Array; + left?: CompressedExistenceProof | undefined; + right?: CompressedExistenceProof | undefined; +} +export interface CompressedNonExistenceProofProtoMsg { + typeUrl: "/cosmos.ics23.v1.CompressedNonExistenceProof"; + value: Uint8Array; +} +export interface CompressedNonExistenceProofAmino { + /** TODO: remove this as unnecessary??? we prove a range */ + key?: string; + left?: CompressedExistenceProofAmino | undefined; + right?: CompressedExistenceProofAmino | undefined; +} +export interface CompressedNonExistenceProofAminoMsg { + type: "cosmos-sdk/CompressedNonExistenceProof"; + value: CompressedNonExistenceProofAmino; +} +export interface CompressedNonExistenceProofSDKType { + key: Uint8Array; + left?: CompressedExistenceProofSDKType | undefined; + right?: CompressedExistenceProofSDKType | undefined; +} +function createBaseExistenceProof(): ExistenceProof { + return { + key: new Uint8Array(), + value: new Uint8Array(), + leaf: undefined, + path: [] + }; +} +export const ExistenceProof = { + typeUrl: "/cosmos.ics23.v1.ExistenceProof", + encode(message: ExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + if (message.leaf !== undefined) { + LeafOp.encode(message.leaf, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.path) { + InnerOp.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ExistenceProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExistenceProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.leaf = LeafOp.decode(reader, reader.uint32(), useInterfaces); + break; + case 4: + message.path.push(InnerOp.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ExistenceProof { + const message = createBaseExistenceProof(); + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + message.leaf = object.leaf !== undefined && object.leaf !== null ? LeafOp.fromPartial(object.leaf) : undefined; + message.path = object.path?.map(e => InnerOp.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ExistenceProofAmino): ExistenceProof { + const message = createBaseExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = LeafOp.fromAmino(object.leaf); + } + message.path = object.path?.map(e => InnerOp.fromAmino(e)) || []; + return message; + }, + toAmino(message: ExistenceProof, useInterfaces: boolean = false): ExistenceProofAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + obj.leaf = message.leaf ? LeafOp.toAmino(message.leaf, useInterfaces) : undefined; + if (message.path) { + obj.path = message.path.map(e => e ? InnerOp.toAmino(e, useInterfaces) : undefined); + } else { + obj.path = []; + } + return obj; + }, + fromAminoMsg(object: ExistenceProofAminoMsg): ExistenceProof { + return ExistenceProof.fromAmino(object.value); + }, + toAminoMsg(message: ExistenceProof, useInterfaces: boolean = false): ExistenceProofAminoMsg { + return { + type: "cosmos-sdk/ExistenceProof", + value: ExistenceProof.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: ExistenceProofProtoMsg, useInterfaces: boolean = false): ExistenceProof { + return ExistenceProof.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ExistenceProof): Uint8Array { + return ExistenceProof.encode(message).finish(); + }, + toProtoMsg(message: ExistenceProof): ExistenceProofProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.ExistenceProof", + value: ExistenceProof.encode(message).finish() + }; + } +}; +function createBaseNonExistenceProof(): NonExistenceProof { + return { + key: new Uint8Array(), + left: undefined, + right: undefined + }; +} +export const NonExistenceProof = { + typeUrl: "/cosmos.ics23.v1.NonExistenceProof", + encode(message: NonExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.left !== undefined) { + ExistenceProof.encode(message.left, writer.uint32(18).fork()).ldelim(); + } + if (message.right !== undefined) { + ExistenceProof.encode(message.right, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): NonExistenceProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNonExistenceProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.left = ExistenceProof.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.right = ExistenceProof.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): NonExistenceProof { + const message = createBaseNonExistenceProof(); + message.key = object.key ?? new Uint8Array(); + message.left = object.left !== undefined && object.left !== null ? ExistenceProof.fromPartial(object.left) : undefined; + message.right = object.right !== undefined && object.right !== null ? ExistenceProof.fromPartial(object.right) : undefined; + return message; + }, + fromAmino(object: NonExistenceProofAmino): NonExistenceProof { + const message = createBaseNonExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.left !== undefined && object.left !== null) { + message.left = ExistenceProof.fromAmino(object.left); + } + if (object.right !== undefined && object.right !== null) { + message.right = ExistenceProof.fromAmino(object.right); + } + return message; + }, + toAmino(message: NonExistenceProof, useInterfaces: boolean = false): NonExistenceProofAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.left = message.left ? ExistenceProof.toAmino(message.left, useInterfaces) : undefined; + obj.right = message.right ? ExistenceProof.toAmino(message.right, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: NonExistenceProofAminoMsg): NonExistenceProof { + return NonExistenceProof.fromAmino(object.value); + }, + toAminoMsg(message: NonExistenceProof, useInterfaces: boolean = false): NonExistenceProofAminoMsg { + return { + type: "cosmos-sdk/NonExistenceProof", + value: NonExistenceProof.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: NonExistenceProofProtoMsg, useInterfaces: boolean = false): NonExistenceProof { + return NonExistenceProof.decode(message.value, undefined, useInterfaces); + }, + toProto(message: NonExistenceProof): Uint8Array { + return NonExistenceProof.encode(message).finish(); + }, + toProtoMsg(message: NonExistenceProof): NonExistenceProofProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.NonExistenceProof", + value: NonExistenceProof.encode(message).finish() + }; + } +}; +function createBaseCommitmentProof(): CommitmentProof { + return { + exist: undefined, + nonexist: undefined, + batch: undefined, + compressed: undefined + }; +} +export const CommitmentProof = { + typeUrl: "/cosmos.ics23.v1.CommitmentProof", + encode(message: CommitmentProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.exist !== undefined) { + ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); + } + if (message.nonexist !== undefined) { + NonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim(); + } + if (message.batch !== undefined) { + BatchProof.encode(message.batch, writer.uint32(26).fork()).ldelim(); + } + if (message.compressed !== undefined) { + CompressedBatchProof.encode(message.compressed, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): CommitmentProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommitmentProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exist = ExistenceProof.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.nonexist = NonExistenceProof.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.batch = BatchProof.decode(reader, reader.uint32(), useInterfaces); + break; + case 4: + message.compressed = CompressedBatchProof.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CommitmentProof { + const message = createBaseCommitmentProof(); + message.exist = object.exist !== undefined && object.exist !== null ? ExistenceProof.fromPartial(object.exist) : undefined; + message.nonexist = object.nonexist !== undefined && object.nonexist !== null ? NonExistenceProof.fromPartial(object.nonexist) : undefined; + message.batch = object.batch !== undefined && object.batch !== null ? BatchProof.fromPartial(object.batch) : undefined; + message.compressed = object.compressed !== undefined && object.compressed !== null ? CompressedBatchProof.fromPartial(object.compressed) : undefined; + return message; + }, + fromAmino(object: CommitmentProofAmino): CommitmentProof { + const message = createBaseCommitmentProof(); + if (object.exist !== undefined && object.exist !== null) { + message.exist = ExistenceProof.fromAmino(object.exist); + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = NonExistenceProof.fromAmino(object.nonexist); + } + if (object.batch !== undefined && object.batch !== null) { + message.batch = BatchProof.fromAmino(object.batch); + } + if (object.compressed !== undefined && object.compressed !== null) { + message.compressed = CompressedBatchProof.fromAmino(object.compressed); + } + return message; + }, + toAmino(message: CommitmentProof, useInterfaces: boolean = false): CommitmentProofAmino { + const obj: any = {}; + obj.exist = message.exist ? ExistenceProof.toAmino(message.exist, useInterfaces) : undefined; + obj.nonexist = message.nonexist ? NonExistenceProof.toAmino(message.nonexist, useInterfaces) : undefined; + obj.batch = message.batch ? BatchProof.toAmino(message.batch, useInterfaces) : undefined; + obj.compressed = message.compressed ? CompressedBatchProof.toAmino(message.compressed, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: CommitmentProofAminoMsg): CommitmentProof { + return CommitmentProof.fromAmino(object.value); + }, + toAminoMsg(message: CommitmentProof, useInterfaces: boolean = false): CommitmentProofAminoMsg { + return { + type: "cosmos-sdk/CommitmentProof", + value: CommitmentProof.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: CommitmentProofProtoMsg, useInterfaces: boolean = false): CommitmentProof { + return CommitmentProof.decode(message.value, undefined, useInterfaces); + }, + toProto(message: CommitmentProof): Uint8Array { + return CommitmentProof.encode(message).finish(); + }, + toProtoMsg(message: CommitmentProof): CommitmentProofProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.CommitmentProof", + value: CommitmentProof.encode(message).finish() + }; + } +}; +function createBaseLeafOp(): LeafOp { + return { + hash: 0, + prehashKey: 0, + prehashValue: 0, + length: 0, + prefix: new Uint8Array() + }; +} +export const LeafOp = { + typeUrl: "/cosmos.ics23.v1.LeafOp", + encode(message: LeafOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash !== 0) { + writer.uint32(8).int32(message.hash); + } + if (message.prehashKey !== 0) { + writer.uint32(16).int32(message.prehashKey); + } + if (message.prehashValue !== 0) { + writer.uint32(24).int32(message.prehashValue); + } + if (message.length !== 0) { + writer.uint32(32).int32(message.length); + } + if (message.prefix.length !== 0) { + writer.uint32(42).bytes(message.prefix); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): LeafOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLeafOp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = (reader.int32() as any); + break; + case 2: + message.prehashKey = (reader.int32() as any); + break; + case 3: + message.prehashValue = (reader.int32() as any); + break; + case 4: + message.length = (reader.int32() as any); + break; + case 5: + message.prefix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LeafOp { + const message = createBaseLeafOp(); + message.hash = object.hash ?? 0; + message.prehashKey = object.prehashKey ?? 0; + message.prehashValue = object.prehashValue ?? 0; + message.length = object.length ?? 0; + message.prefix = object.prefix ?? new Uint8Array(); + return message; + }, + fromAmino(object: LeafOpAmino): LeafOp { + const message = createBaseLeafOp(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = hashOpFromJSON(object.hash); + } + if (object.prehash_key !== undefined && object.prehash_key !== null) { + message.prehashKey = hashOpFromJSON(object.prehash_key); + } + if (object.prehash_value !== undefined && object.prehash_value !== null) { + message.prehashValue = hashOpFromJSON(object.prehash_value); + } + if (object.length !== undefined && object.length !== null) { + message.length = lengthOpFromJSON(object.length); + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = bytesFromBase64(object.prefix); + } + return message; + }, + toAmino(message: LeafOp, useInterfaces: boolean = false): LeafOpAmino { + const obj: any = {}; + obj.hash = message.hash; + obj.prehash_key = message.prehashKey; + obj.prehash_value = message.prehashValue; + obj.length = message.length; + obj.prefix = message.prefix ? base64FromBytes(message.prefix) : undefined; + return obj; + }, + fromAminoMsg(object: LeafOpAminoMsg): LeafOp { + return LeafOp.fromAmino(object.value); + }, + toAminoMsg(message: LeafOp, useInterfaces: boolean = false): LeafOpAminoMsg { + return { + type: "cosmos-sdk/LeafOp", + value: LeafOp.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: LeafOpProtoMsg, useInterfaces: boolean = false): LeafOp { + return LeafOp.decode(message.value, undefined, useInterfaces); + }, + toProto(message: LeafOp): Uint8Array { + return LeafOp.encode(message).finish(); + }, + toProtoMsg(message: LeafOp): LeafOpProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.LeafOp", + value: LeafOp.encode(message).finish() + }; + } +}; +function createBaseInnerOp(): InnerOp { + return { + hash: 0, + prefix: new Uint8Array(), + suffix: new Uint8Array() + }; +} +export const InnerOp = { + typeUrl: "/cosmos.ics23.v1.InnerOp", + encode(message: InnerOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash !== 0) { + writer.uint32(8).int32(message.hash); + } + if (message.prefix.length !== 0) { + writer.uint32(18).bytes(message.prefix); + } + if (message.suffix.length !== 0) { + writer.uint32(26).bytes(message.suffix); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): InnerOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInnerOp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = (reader.int32() as any); + break; + case 2: + message.prefix = reader.bytes(); + break; + case 3: + message.suffix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InnerOp { + const message = createBaseInnerOp(); + message.hash = object.hash ?? 0; + message.prefix = object.prefix ?? new Uint8Array(); + message.suffix = object.suffix ?? new Uint8Array(); + return message; + }, + fromAmino(object: InnerOpAmino): InnerOp { + const message = createBaseInnerOp(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = hashOpFromJSON(object.hash); + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = bytesFromBase64(object.prefix); + } + if (object.suffix !== undefined && object.suffix !== null) { + message.suffix = bytesFromBase64(object.suffix); + } + return message; + }, + toAmino(message: InnerOp, useInterfaces: boolean = false): InnerOpAmino { + const obj: any = {}; + obj.hash = message.hash; + obj.prefix = message.prefix ? base64FromBytes(message.prefix) : undefined; + obj.suffix = message.suffix ? base64FromBytes(message.suffix) : undefined; + return obj; + }, + fromAminoMsg(object: InnerOpAminoMsg): InnerOp { + return InnerOp.fromAmino(object.value); + }, + toAminoMsg(message: InnerOp, useInterfaces: boolean = false): InnerOpAminoMsg { + return { + type: "cosmos-sdk/InnerOp", + value: InnerOp.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: InnerOpProtoMsg, useInterfaces: boolean = false): InnerOp { + return InnerOp.decode(message.value, undefined, useInterfaces); + }, + toProto(message: InnerOp): Uint8Array { + return InnerOp.encode(message).finish(); + }, + toProtoMsg(message: InnerOp): InnerOpProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.InnerOp", + value: InnerOp.encode(message).finish() + }; + } +}; +function createBaseProofSpec(): ProofSpec { + return { + leafSpec: undefined, + innerSpec: undefined, + maxDepth: 0, + minDepth: 0, + prehashKeyBeforeComparison: false + }; +} +export const ProofSpec = { + typeUrl: "/cosmos.ics23.v1.ProofSpec", + encode(message: ProofSpec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.leafSpec !== undefined) { + LeafOp.encode(message.leafSpec, writer.uint32(10).fork()).ldelim(); + } + if (message.innerSpec !== undefined) { + InnerSpec.encode(message.innerSpec, writer.uint32(18).fork()).ldelim(); + } + if (message.maxDepth !== 0) { + writer.uint32(24).int32(message.maxDepth); + } + if (message.minDepth !== 0) { + writer.uint32(32).int32(message.minDepth); + } + if (message.prehashKeyBeforeComparison === true) { + writer.uint32(40).bool(message.prehashKeyBeforeComparison); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ProofSpec { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProofSpec(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.leafSpec = LeafOp.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.innerSpec = InnerSpec.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.maxDepth = reader.int32(); + break; + case 4: + message.minDepth = reader.int32(); + break; + case 5: + message.prehashKeyBeforeComparison = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ProofSpec { + const message = createBaseProofSpec(); + message.leafSpec = object.leafSpec !== undefined && object.leafSpec !== null ? LeafOp.fromPartial(object.leafSpec) : undefined; + message.innerSpec = object.innerSpec !== undefined && object.innerSpec !== null ? InnerSpec.fromPartial(object.innerSpec) : undefined; + message.maxDepth = object.maxDepth ?? 0; + message.minDepth = object.minDepth ?? 0; + message.prehashKeyBeforeComparison = object.prehashKeyBeforeComparison ?? false; + return message; + }, + fromAmino(object: ProofSpecAmino): ProofSpec { + const message = createBaseProofSpec(); + if (object.leaf_spec !== undefined && object.leaf_spec !== null) { + message.leafSpec = LeafOp.fromAmino(object.leaf_spec); + } + if (object.inner_spec !== undefined && object.inner_spec !== null) { + message.innerSpec = InnerSpec.fromAmino(object.inner_spec); + } + if (object.max_depth !== undefined && object.max_depth !== null) { + message.maxDepth = object.max_depth; + } + if (object.min_depth !== undefined && object.min_depth !== null) { + message.minDepth = object.min_depth; + } + if (object.prehash_key_before_comparison !== undefined && object.prehash_key_before_comparison !== null) { + message.prehashKeyBeforeComparison = object.prehash_key_before_comparison; + } + return message; + }, + toAmino(message: ProofSpec, useInterfaces: boolean = false): ProofSpecAmino { + const obj: any = {}; + obj.leaf_spec = message.leafSpec ? LeafOp.toAmino(message.leafSpec, useInterfaces) : undefined; + obj.inner_spec = message.innerSpec ? InnerSpec.toAmino(message.innerSpec, useInterfaces) : undefined; + obj.max_depth = message.maxDepth; + obj.min_depth = message.minDepth; + obj.prehash_key_before_comparison = message.prehashKeyBeforeComparison; + return obj; + }, + fromAminoMsg(object: ProofSpecAminoMsg): ProofSpec { + return ProofSpec.fromAmino(object.value); + }, + toAminoMsg(message: ProofSpec, useInterfaces: boolean = false): ProofSpecAminoMsg { + return { + type: "cosmos-sdk/ProofSpec", + value: ProofSpec.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: ProofSpecProtoMsg, useInterfaces: boolean = false): ProofSpec { + return ProofSpec.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ProofSpec): Uint8Array { + return ProofSpec.encode(message).finish(); + }, + toProtoMsg(message: ProofSpec): ProofSpecProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.ProofSpec", + value: ProofSpec.encode(message).finish() + }; + } +}; +function createBaseInnerSpec(): InnerSpec { + return { + childOrder: [], + childSize: 0, + minPrefixLength: 0, + maxPrefixLength: 0, + emptyChild: new Uint8Array(), + hash: 0 + }; +} +export const InnerSpec = { + typeUrl: "/cosmos.ics23.v1.InnerSpec", + encode(message: InnerSpec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.childOrder) { + writer.int32(v); + } + writer.ldelim(); + if (message.childSize !== 0) { + writer.uint32(16).int32(message.childSize); + } + if (message.minPrefixLength !== 0) { + writer.uint32(24).int32(message.minPrefixLength); + } + if (message.maxPrefixLength !== 0) { + writer.uint32(32).int32(message.maxPrefixLength); + } + if (message.emptyChild.length !== 0) { + writer.uint32(42).bytes(message.emptyChild); + } + if (message.hash !== 0) { + writer.uint32(48).int32(message.hash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): InnerSpec { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInnerSpec(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.childOrder.push(reader.int32()); + } + } else { + message.childOrder.push(reader.int32()); + } + break; + case 2: + message.childSize = reader.int32(); + break; + case 3: + message.minPrefixLength = reader.int32(); + break; + case 4: + message.maxPrefixLength = reader.int32(); + break; + case 5: + message.emptyChild = reader.bytes(); + break; + case 6: + message.hash = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InnerSpec { + const message = createBaseInnerSpec(); + message.childOrder = object.childOrder?.map(e => e) || []; + message.childSize = object.childSize ?? 0; + message.minPrefixLength = object.minPrefixLength ?? 0; + message.maxPrefixLength = object.maxPrefixLength ?? 0; + message.emptyChild = object.emptyChild ?? new Uint8Array(); + message.hash = object.hash ?? 0; + return message; + }, + fromAmino(object: InnerSpecAmino): InnerSpec { + const message = createBaseInnerSpec(); + message.childOrder = object.child_order?.map(e => e) || []; + if (object.child_size !== undefined && object.child_size !== null) { + message.childSize = object.child_size; + } + if (object.min_prefix_length !== undefined && object.min_prefix_length !== null) { + message.minPrefixLength = object.min_prefix_length; + } + if (object.max_prefix_length !== undefined && object.max_prefix_length !== null) { + message.maxPrefixLength = object.max_prefix_length; + } + if (object.empty_child !== undefined && object.empty_child !== null) { + message.emptyChild = bytesFromBase64(object.empty_child); + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = hashOpFromJSON(object.hash); + } + return message; + }, + toAmino(message: InnerSpec, useInterfaces: boolean = false): InnerSpecAmino { + const obj: any = {}; + if (message.childOrder) { + obj.child_order = message.childOrder.map(e => e); + } else { + obj.child_order = []; + } + obj.child_size = message.childSize; + obj.min_prefix_length = message.minPrefixLength; + obj.max_prefix_length = message.maxPrefixLength; + obj.empty_child = message.emptyChild ? base64FromBytes(message.emptyChild) : undefined; + obj.hash = message.hash; + return obj; + }, + fromAminoMsg(object: InnerSpecAminoMsg): InnerSpec { + return InnerSpec.fromAmino(object.value); + }, + toAminoMsg(message: InnerSpec, useInterfaces: boolean = false): InnerSpecAminoMsg { + return { + type: "cosmos-sdk/InnerSpec", + value: InnerSpec.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: InnerSpecProtoMsg, useInterfaces: boolean = false): InnerSpec { + return InnerSpec.decode(message.value, undefined, useInterfaces); + }, + toProto(message: InnerSpec): Uint8Array { + return InnerSpec.encode(message).finish(); + }, + toProtoMsg(message: InnerSpec): InnerSpecProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.InnerSpec", + value: InnerSpec.encode(message).finish() + }; + } +}; +function createBaseBatchProof(): BatchProof { + return { + entries: [] + }; +} +export const BatchProof = { + typeUrl: "/cosmos.ics23.v1.BatchProof", + encode(message: BatchProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.entries) { + BatchEntry.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): BatchProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entries.push(BatchEntry.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BatchProof { + const message = createBaseBatchProof(); + message.entries = object.entries?.map(e => BatchEntry.fromPartial(e)) || []; + return message; + }, + fromAmino(object: BatchProofAmino): BatchProof { + const message = createBaseBatchProof(); + message.entries = object.entries?.map(e => BatchEntry.fromAmino(e)) || []; + return message; + }, + toAmino(message: BatchProof, useInterfaces: boolean = false): BatchProofAmino { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map(e => e ? BatchEntry.toAmino(e, useInterfaces) : undefined); + } else { + obj.entries = []; + } + return obj; + }, + fromAminoMsg(object: BatchProofAminoMsg): BatchProof { + return BatchProof.fromAmino(object.value); + }, + toAminoMsg(message: BatchProof, useInterfaces: boolean = false): BatchProofAminoMsg { + return { + type: "cosmos-sdk/BatchProof", + value: BatchProof.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: BatchProofProtoMsg, useInterfaces: boolean = false): BatchProof { + return BatchProof.decode(message.value, undefined, useInterfaces); + }, + toProto(message: BatchProof): Uint8Array { + return BatchProof.encode(message).finish(); + }, + toProtoMsg(message: BatchProof): BatchProofProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.BatchProof", + value: BatchProof.encode(message).finish() + }; + } +}; +function createBaseBatchEntry(): BatchEntry { + return { + exist: undefined, + nonexist: undefined + }; +} +export const BatchEntry = { + typeUrl: "/cosmos.ics23.v1.BatchEntry", + encode(message: BatchEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.exist !== undefined) { + ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); + } + if (message.nonexist !== undefined) { + NonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): BatchEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exist = ExistenceProof.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.nonexist = NonExistenceProof.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BatchEntry { + const message = createBaseBatchEntry(); + message.exist = object.exist !== undefined && object.exist !== null ? ExistenceProof.fromPartial(object.exist) : undefined; + message.nonexist = object.nonexist !== undefined && object.nonexist !== null ? NonExistenceProof.fromPartial(object.nonexist) : undefined; + return message; + }, + fromAmino(object: BatchEntryAmino): BatchEntry { + const message = createBaseBatchEntry(); + if (object.exist !== undefined && object.exist !== null) { + message.exist = ExistenceProof.fromAmino(object.exist); + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = NonExistenceProof.fromAmino(object.nonexist); + } + return message; + }, + toAmino(message: BatchEntry, useInterfaces: boolean = false): BatchEntryAmino { + const obj: any = {}; + obj.exist = message.exist ? ExistenceProof.toAmino(message.exist, useInterfaces) : undefined; + obj.nonexist = message.nonexist ? NonExistenceProof.toAmino(message.nonexist, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: BatchEntryAminoMsg): BatchEntry { + return BatchEntry.fromAmino(object.value); + }, + toAminoMsg(message: BatchEntry, useInterfaces: boolean = false): BatchEntryAminoMsg { + return { + type: "cosmos-sdk/BatchEntry", + value: BatchEntry.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: BatchEntryProtoMsg, useInterfaces: boolean = false): BatchEntry { + return BatchEntry.decode(message.value, undefined, useInterfaces); + }, + toProto(message: BatchEntry): Uint8Array { + return BatchEntry.encode(message).finish(); + }, + toProtoMsg(message: BatchEntry): BatchEntryProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.BatchEntry", + value: BatchEntry.encode(message).finish() + }; + } +}; +function createBaseCompressedBatchProof(): CompressedBatchProof { + return { + entries: [], + lookupInners: [] + }; +} +export const CompressedBatchProof = { + typeUrl: "/cosmos.ics23.v1.CompressedBatchProof", + encode(message: CompressedBatchProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.entries) { + CompressedBatchEntry.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.lookupInners) { + InnerOp.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): CompressedBatchProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCompressedBatchProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entries.push(CompressedBatchEntry.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.lookupInners.push(InnerOp.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CompressedBatchProof { + const message = createBaseCompressedBatchProof(); + message.entries = object.entries?.map(e => CompressedBatchEntry.fromPartial(e)) || []; + message.lookupInners = object.lookupInners?.map(e => InnerOp.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CompressedBatchProofAmino): CompressedBatchProof { + const message = createBaseCompressedBatchProof(); + message.entries = object.entries?.map(e => CompressedBatchEntry.fromAmino(e)) || []; + message.lookupInners = object.lookup_inners?.map(e => InnerOp.fromAmino(e)) || []; + return message; + }, + toAmino(message: CompressedBatchProof, useInterfaces: boolean = false): CompressedBatchProofAmino { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map(e => e ? CompressedBatchEntry.toAmino(e, useInterfaces) : undefined); + } else { + obj.entries = []; + } + if (message.lookupInners) { + obj.lookup_inners = message.lookupInners.map(e => e ? InnerOp.toAmino(e, useInterfaces) : undefined); + } else { + obj.lookup_inners = []; + } + return obj; + }, + fromAminoMsg(object: CompressedBatchProofAminoMsg): CompressedBatchProof { + return CompressedBatchProof.fromAmino(object.value); + }, + toAminoMsg(message: CompressedBatchProof, useInterfaces: boolean = false): CompressedBatchProofAminoMsg { + return { + type: "cosmos-sdk/CompressedBatchProof", + value: CompressedBatchProof.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: CompressedBatchProofProtoMsg, useInterfaces: boolean = false): CompressedBatchProof { + return CompressedBatchProof.decode(message.value, undefined, useInterfaces); + }, + toProto(message: CompressedBatchProof): Uint8Array { + return CompressedBatchProof.encode(message).finish(); + }, + toProtoMsg(message: CompressedBatchProof): CompressedBatchProofProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.CompressedBatchProof", + value: CompressedBatchProof.encode(message).finish() + }; + } +}; +function createBaseCompressedBatchEntry(): CompressedBatchEntry { + return { + exist: undefined, + nonexist: undefined + }; +} +export const CompressedBatchEntry = { + typeUrl: "/cosmos.ics23.v1.CompressedBatchEntry", + encode(message: CompressedBatchEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.exist !== undefined) { + CompressedExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); + } + if (message.nonexist !== undefined) { + CompressedNonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): CompressedBatchEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCompressedBatchEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exist = CompressedExistenceProof.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.nonexist = CompressedNonExistenceProof.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CompressedBatchEntry { + const message = createBaseCompressedBatchEntry(); + message.exist = object.exist !== undefined && object.exist !== null ? CompressedExistenceProof.fromPartial(object.exist) : undefined; + message.nonexist = object.nonexist !== undefined && object.nonexist !== null ? CompressedNonExistenceProof.fromPartial(object.nonexist) : undefined; + return message; + }, + fromAmino(object: CompressedBatchEntryAmino): CompressedBatchEntry { + const message = createBaseCompressedBatchEntry(); + if (object.exist !== undefined && object.exist !== null) { + message.exist = CompressedExistenceProof.fromAmino(object.exist); + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = CompressedNonExistenceProof.fromAmino(object.nonexist); + } + return message; + }, + toAmino(message: CompressedBatchEntry, useInterfaces: boolean = false): CompressedBatchEntryAmino { + const obj: any = {}; + obj.exist = message.exist ? CompressedExistenceProof.toAmino(message.exist, useInterfaces) : undefined; + obj.nonexist = message.nonexist ? CompressedNonExistenceProof.toAmino(message.nonexist, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: CompressedBatchEntryAminoMsg): CompressedBatchEntry { + return CompressedBatchEntry.fromAmino(object.value); + }, + toAminoMsg(message: CompressedBatchEntry, useInterfaces: boolean = false): CompressedBatchEntryAminoMsg { + return { + type: "cosmos-sdk/CompressedBatchEntry", + value: CompressedBatchEntry.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: CompressedBatchEntryProtoMsg, useInterfaces: boolean = false): CompressedBatchEntry { + return CompressedBatchEntry.decode(message.value, undefined, useInterfaces); + }, + toProto(message: CompressedBatchEntry): Uint8Array { + return CompressedBatchEntry.encode(message).finish(); + }, + toProtoMsg(message: CompressedBatchEntry): CompressedBatchEntryProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.CompressedBatchEntry", + value: CompressedBatchEntry.encode(message).finish() + }; + } +}; +function createBaseCompressedExistenceProof(): CompressedExistenceProof { + return { + key: new Uint8Array(), + value: new Uint8Array(), + leaf: undefined, + path: [] + }; +} +export const CompressedExistenceProof = { + typeUrl: "/cosmos.ics23.v1.CompressedExistenceProof", + encode(message: CompressedExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + if (message.leaf !== undefined) { + LeafOp.encode(message.leaf, writer.uint32(26).fork()).ldelim(); + } + writer.uint32(34).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): CompressedExistenceProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCompressedExistenceProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.leaf = LeafOp.decode(reader, reader.uint32(), useInterfaces); + break; + case 4: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CompressedExistenceProof { + const message = createBaseCompressedExistenceProof(); + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + message.leaf = object.leaf !== undefined && object.leaf !== null ? LeafOp.fromPartial(object.leaf) : undefined; + message.path = object.path?.map(e => e) || []; + return message; + }, + fromAmino(object: CompressedExistenceProofAmino): CompressedExistenceProof { + const message = createBaseCompressedExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = LeafOp.fromAmino(object.leaf); + } + message.path = object.path?.map(e => e) || []; + return message; + }, + toAmino(message: CompressedExistenceProof, useInterfaces: boolean = false): CompressedExistenceProofAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + obj.leaf = message.leaf ? LeafOp.toAmino(message.leaf, useInterfaces) : undefined; + if (message.path) { + obj.path = message.path.map(e => e); + } else { + obj.path = []; + } + return obj; + }, + fromAminoMsg(object: CompressedExistenceProofAminoMsg): CompressedExistenceProof { + return CompressedExistenceProof.fromAmino(object.value); + }, + toAminoMsg(message: CompressedExistenceProof, useInterfaces: boolean = false): CompressedExistenceProofAminoMsg { + return { + type: "cosmos-sdk/CompressedExistenceProof", + value: CompressedExistenceProof.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: CompressedExistenceProofProtoMsg, useInterfaces: boolean = false): CompressedExistenceProof { + return CompressedExistenceProof.decode(message.value, undefined, useInterfaces); + }, + toProto(message: CompressedExistenceProof): Uint8Array { + return CompressedExistenceProof.encode(message).finish(); + }, + toProtoMsg(message: CompressedExistenceProof): CompressedExistenceProofProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.CompressedExistenceProof", + value: CompressedExistenceProof.encode(message).finish() + }; + } +}; +function createBaseCompressedNonExistenceProof(): CompressedNonExistenceProof { + return { + key: new Uint8Array(), + left: undefined, + right: undefined + }; +} +export const CompressedNonExistenceProof = { + typeUrl: "/cosmos.ics23.v1.CompressedNonExistenceProof", + encode(message: CompressedNonExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.left !== undefined) { + CompressedExistenceProof.encode(message.left, writer.uint32(18).fork()).ldelim(); + } + if (message.right !== undefined) { + CompressedExistenceProof.encode(message.right, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): CompressedNonExistenceProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCompressedNonExistenceProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.left = CompressedExistenceProof.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.right = CompressedExistenceProof.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CompressedNonExistenceProof { + const message = createBaseCompressedNonExistenceProof(); + message.key = object.key ?? new Uint8Array(); + message.left = object.left !== undefined && object.left !== null ? CompressedExistenceProof.fromPartial(object.left) : undefined; + message.right = object.right !== undefined && object.right !== null ? CompressedExistenceProof.fromPartial(object.right) : undefined; + return message; + }, + fromAmino(object: CompressedNonExistenceProofAmino): CompressedNonExistenceProof { + const message = createBaseCompressedNonExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.left !== undefined && object.left !== null) { + message.left = CompressedExistenceProof.fromAmino(object.left); + } + if (object.right !== undefined && object.right !== null) { + message.right = CompressedExistenceProof.fromAmino(object.right); + } + return message; + }, + toAmino(message: CompressedNonExistenceProof, useInterfaces: boolean = false): CompressedNonExistenceProofAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.left = message.left ? CompressedExistenceProof.toAmino(message.left, useInterfaces) : undefined; + obj.right = message.right ? CompressedExistenceProof.toAmino(message.right, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: CompressedNonExistenceProofAminoMsg): CompressedNonExistenceProof { + return CompressedNonExistenceProof.fromAmino(object.value); + }, + toAminoMsg(message: CompressedNonExistenceProof, useInterfaces: boolean = false): CompressedNonExistenceProofAminoMsg { + return { + type: "cosmos-sdk/CompressedNonExistenceProof", + value: CompressedNonExistenceProof.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: CompressedNonExistenceProofProtoMsg, useInterfaces: boolean = false): CompressedNonExistenceProof { + return CompressedNonExistenceProof.decode(message.value, undefined, useInterfaces); + }, + toProto(message: CompressedNonExistenceProof): Uint8Array { + return CompressedNonExistenceProof.encode(message).finish(); + }, + toProtoMsg(message: CompressedNonExistenceProof): CompressedNonExistenceProofProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.CompressedNonExistenceProof", + value: CompressedNonExistenceProof.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmwasm/bundle.ts b/packages/types/protobuf/codegen/cosmwasm/bundle.ts index 23c2a8244..b81ec94cc 100644 --- a/packages/types/protobuf/codegen/cosmwasm/bundle.ts +++ b/packages/types/protobuf/codegen/cosmwasm/bundle.ts @@ -1,56 +1,56 @@ -import * as _91 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _92 from "./tokenfactory/v1beta1/genesis"; -import * as _93 from "./tokenfactory/v1beta1/params"; -import * as _94 from "./tokenfactory/v1beta1/query"; -import * as _95 from "./tokenfactory/v1beta1/tx"; -import * as _96 from "./wasm/v1/authz"; -import * as _97 from "./wasm/v1/genesis"; -import * as _98 from "./wasm/v1/ibc"; -import * as _99 from "./wasm/v1/proposal"; -import * as _100 from "./wasm/v1/query"; -import * as _101 from "./wasm/v1/tx"; -import * as _102 from "./wasm/v1/types"; -import * as _432 from "./tokenfactory/v1beta1/tx.amino"; -import * as _433 from "./wasm/v1/tx.amino"; -import * as _434 from "./tokenfactory/v1beta1/tx.registry"; -import * as _435 from "./wasm/v1/tx.registry"; -import * as _436 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _437 from "./wasm/v1/query.rpc.Query"; -import * as _438 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _439 from "./wasm/v1/tx.rpc.msg"; -import * as _640 from "./rpc.query"; -import * as _641 from "./rpc.tx"; +import * as _92 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _93 from "./tokenfactory/v1beta1/genesis"; +import * as _94 from "./tokenfactory/v1beta1/params"; +import * as _95 from "./tokenfactory/v1beta1/query"; +import * as _96 from "./tokenfactory/v1beta1/tx"; +import * as _97 from "./wasm/v1/authz"; +import * as _98 from "./wasm/v1/genesis"; +import * as _99 from "./wasm/v1/ibc"; +import * as _100 from "./wasm/v1/proposal"; +import * as _101 from "./wasm/v1/query"; +import * as _102 from "./wasm/v1/tx"; +import * as _103 from "./wasm/v1/types"; +import * as _438 from "./tokenfactory/v1beta1/tx.amino"; +import * as _439 from "./wasm/v1/tx.amino"; +import * as _440 from "./tokenfactory/v1beta1/tx.registry"; +import * as _441 from "./wasm/v1/tx.registry"; +import * as _442 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _443 from "./wasm/v1/query.rpc.Query"; +import * as _444 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _445 from "./wasm/v1/tx.rpc.msg"; +import * as _650 from "./rpc.query"; +import * as _651 from "./rpc.tx"; export namespace cosmwasm { export namespace tokenfactory { export const v1beta1 = { - ..._91, ..._92, ..._93, ..._94, ..._95, - ..._432, - ..._434, - ..._436, - ..._438 + ..._96, + ..._438, + ..._440, + ..._442, + ..._444 }; } export namespace wasm { export const v1 = { - ..._96, ..._97, ..._98, ..._99, ..._100, ..._101, ..._102, - ..._433, - ..._435, - ..._437, - ..._439 + ..._103, + ..._439, + ..._441, + ..._443, + ..._445 }; } export const ClientFactory = { - ..._640, - ..._641 + ..._650, + ..._651 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/feemarket/bundle.ts b/packages/types/protobuf/codegen/feemarket/bundle.ts index 996fbc546..27f308d9b 100644 --- a/packages/types/protobuf/codegen/feemarket/bundle.ts +++ b/packages/types/protobuf/codegen/feemarket/bundle.ts @@ -1,28 +1,28 @@ -import * as _103 from "./feemarket/v1/genesis"; -import * as _104 from "./feemarket/v1/params"; -import * as _105 from "./feemarket/v1/query"; -import * as _106 from "./feemarket/v1/tx"; -import * as _440 from "./feemarket/v1/tx.amino"; -import * as _441 from "./feemarket/v1/tx.registry"; -import * as _442 from "./feemarket/v1/query.rpc.Query"; -import * as _443 from "./feemarket/v1/tx.rpc.msg"; -import * as _642 from "./rpc.query"; -import * as _643 from "./rpc.tx"; +import * as _104 from "./feemarket/v1/genesis"; +import * as _105 from "./feemarket/v1/params"; +import * as _106 from "./feemarket/v1/query"; +import * as _107 from "./feemarket/v1/tx"; +import * as _446 from "./feemarket/v1/tx.amino"; +import * as _447 from "./feemarket/v1/tx.registry"; +import * as _448 from "./feemarket/v1/query.rpc.Query"; +import * as _449 from "./feemarket/v1/tx.rpc.msg"; +import * as _652 from "./rpc.query"; +import * as _653 from "./rpc.tx"; export namespace feemarket { export namespace feemarket { export const v1 = { - ..._103, ..._104, ..._105, ..._106, - ..._440, - ..._441, - ..._442, - ..._443 + ..._107, + ..._446, + ..._447, + ..._448, + ..._449 }; } export const ClientFactory = { - ..._642, - ..._643 + ..._652, + ..._653 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/gaia/bundle.ts b/packages/types/protobuf/codegen/gaia/bundle.ts index 9cd516d97..c0619f548 100644 --- a/packages/types/protobuf/codegen/gaia/bundle.ts +++ b/packages/types/protobuf/codegen/gaia/bundle.ts @@ -1,26 +1,26 @@ -import * as _107 from "./globalfee/v1beta1/genesis"; -import * as _108 from "./globalfee/v1beta1/query"; -import * as _109 from "./globalfee/v1beta1/tx"; -import * as _444 from "./globalfee/v1beta1/tx.amino"; -import * as _445 from "./globalfee/v1beta1/tx.registry"; -import * as _446 from "./globalfee/v1beta1/query.rpc.Query"; -import * as _447 from "./globalfee/v1beta1/tx.rpc.msg"; -import * as _644 from "./rpc.query"; -import * as _645 from "./rpc.tx"; +import * as _108 from "./globalfee/v1beta1/genesis"; +import * as _109 from "./globalfee/v1beta1/query"; +import * as _110 from "./globalfee/v1beta1/tx"; +import * as _450 from "./globalfee/v1beta1/tx.amino"; +import * as _451 from "./globalfee/v1beta1/tx.registry"; +import * as _452 from "./globalfee/v1beta1/query.rpc.Query"; +import * as _453 from "./globalfee/v1beta1/tx.rpc.msg"; +import * as _654 from "./rpc.query"; +import * as _655 from "./rpc.tx"; export namespace gaia { export namespace globalfee { export const v1beta1 = { - ..._107, ..._108, ..._109, - ..._444, - ..._445, - ..._446, - ..._447 + ..._110, + ..._450, + ..._451, + ..._452, + ..._453 }; } export const ClientFactory = { - ..._644, - ..._645 + ..._654, + ..._655 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/gogoproto/bundle.ts b/packages/types/protobuf/codegen/gogoproto/bundle.ts index 7c55fbc57..9b9cbe3c4 100644 --- a/packages/types/protobuf/codegen/gogoproto/bundle.ts +++ b/packages/types/protobuf/codegen/gogoproto/bundle.ts @@ -1,4 +1,4 @@ -import * as _110 from "./gogo"; +import * as _111 from "./gogo"; export const gogoproto = { - ..._110 + ..._111 }; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/google/bundle.ts b/packages/types/protobuf/codegen/google/bundle.ts index 4fe26b93b..2f2bd6e9c 100644 --- a/packages/types/protobuf/codegen/google/bundle.ts +++ b/packages/types/protobuf/codegen/google/bundle.ts @@ -1,20 +1,20 @@ -import * as _111 from "./api/annotations"; -import * as _112 from "./api/http"; -import * as _113 from "./protobuf/any"; -import * as _114 from "./protobuf/descriptor"; -import * as _115 from "./protobuf/duration"; -import * as _116 from "./protobuf/empty"; -import * as _117 from "./protobuf/timestamp"; +import * as _112 from "./api/annotations"; +import * as _113 from "./api/http"; +import * as _114 from "./protobuf/any"; +import * as _115 from "./protobuf/descriptor"; +import * as _116 from "./protobuf/duration"; +import * as _117 from "./protobuf/empty"; +import * as _118 from "./protobuf/timestamp"; export namespace google { export const api = { - ..._111, - ..._112 + ..._112, + ..._113 }; export const protobuf = { - ..._113, ..._114, ..._115, ..._116, - ..._117 + ..._117, + ..._118 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/bundle.ts b/packages/types/protobuf/codegen/ibc/bundle.ts index 0a9b04b79..69b8d6ac7 100644 --- a/packages/types/protobuf/codegen/ibc/bundle.ts +++ b/packages/types/protobuf/codegen/ibc/bundle.ts @@ -1,120 +1,146 @@ -import * as _118 from "./applications/interchain_accounts/controller/v1/controller"; -import * as _119 from "./applications/interchain_accounts/controller/v1/query"; -import * as _120 from "./applications/interchain_accounts/controller/v1/tx"; -import * as _121 from "./applications/interchain_accounts/host/v1/host"; -import * as _122 from "./applications/interchain_accounts/host/v1/query"; -import * as _123 from "./applications/interchain_accounts/host/v1/tx"; -import * as _124 from "./applications/interchain_accounts/v1/account"; -import * as _125 from "./applications/interchain_accounts/v1/metadata"; -import * as _126 from "./applications/interchain_accounts/v1/packet"; -import * as _127 from "./applications/transfer/v1/authz"; -import * as _128 from "./applications/transfer/v1/genesis"; -import * as _129 from "./applications/transfer/v1/query"; -import * as _130 from "./applications/transfer/v1/transfer"; -import * as _131 from "./applications/transfer/v1/tx"; -import * as _132 from "./core/channel/v1/channel"; -import * as _133 from "./core/channel/v1/genesis"; -import * as _134 from "./core/channel/v1/query"; -import * as _135 from "./core/channel/v1/tx"; -import * as _136 from "./core/client/v1/client"; -import * as _137 from "./core/client/v1/genesis"; -import * as _138 from "./core/client/v1/query"; -import * as _139 from "./core/client/v1/tx"; -import * as _448 from "./applications/interchain_accounts/controller/v1/tx.amino"; -import * as _449 from "./applications/interchain_accounts/host/v1/tx.amino"; -import * as _450 from "./applications/transfer/v1/tx.amino"; -import * as _451 from "./core/channel/v1/tx.amino"; -import * as _452 from "./core/client/v1/tx.amino"; -import * as _453 from "./applications/interchain_accounts/controller/v1/tx.registry"; -import * as _454 from "./applications/interchain_accounts/host/v1/tx.registry"; -import * as _455 from "./applications/transfer/v1/tx.registry"; -import * as _456 from "./core/channel/v1/tx.registry"; -import * as _457 from "./core/client/v1/tx.registry"; -import * as _458 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; -import * as _459 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; -import * as _460 from "./applications/transfer/v1/query.rpc.Query"; -import * as _461 from "./core/channel/v1/query.rpc.Query"; -import * as _462 from "./core/client/v1/query.rpc.Query"; -import * as _463 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; -import * as _464 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; -import * as _465 from "./applications/transfer/v1/tx.rpc.msg"; -import * as _466 from "./core/channel/v1/tx.rpc.msg"; -import * as _467 from "./core/client/v1/tx.rpc.msg"; -import * as _646 from "./rpc.query"; -import * as _647 from "./rpc.tx"; +import * as _119 from "./applications/interchain_accounts/controller/v1/controller"; +import * as _120 from "./applications/interchain_accounts/controller/v1/query"; +import * as _121 from "./applications/interchain_accounts/controller/v1/tx"; +import * as _122 from "./applications/interchain_accounts/host/v1/host"; +import * as _123 from "./applications/interchain_accounts/host/v1/query"; +import * as _124 from "./applications/interchain_accounts/host/v1/tx"; +import * as _125 from "./applications/interchain_accounts/v1/account"; +import * as _126 from "./applications/interchain_accounts/v1/metadata"; +import * as _127 from "./applications/interchain_accounts/v1/packet"; +import * as _128 from "./applications/transfer/v1/authz"; +import * as _129 from "./applications/transfer/v1/genesis"; +import * as _130 from "./applications/transfer/v1/query"; +import * as _131 from "./applications/transfer/v1/transfer"; +import * as _132 from "./applications/transfer/v1/tx"; +import * as _133 from "./core/channel/v1/channel"; +import * as _134 from "./core/channel/v1/genesis"; +import * as _135 from "./core/channel/v1/query"; +import * as _136 from "./core/channel/v1/tx"; +import * as _137 from "./core/client/v1/client"; +import * as _138 from "./core/client/v1/genesis"; +import * as _139 from "./core/client/v1/query"; +import * as _140 from "./core/client/v1/tx"; +import * as _141 from "./core/commitment/v1/commitment"; +import * as _142 from "./core/connection/v1/connection"; +import * as _143 from "./core/connection/v1/genesis"; +import * as _144 from "./core/connection/v1/query"; +import * as _145 from "./core/connection/v1/tx"; +import * as _454 from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as _455 from "./applications/interchain_accounts/host/v1/tx.amino"; +import * as _456 from "./applications/transfer/v1/tx.amino"; +import * as _457 from "./core/channel/v1/tx.amino"; +import * as _458 from "./core/client/v1/tx.amino"; +import * as _459 from "./core/connection/v1/tx.amino"; +import * as _460 from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as _461 from "./applications/interchain_accounts/host/v1/tx.registry"; +import * as _462 from "./applications/transfer/v1/tx.registry"; +import * as _463 from "./core/channel/v1/tx.registry"; +import * as _464 from "./core/client/v1/tx.registry"; +import * as _465 from "./core/connection/v1/tx.registry"; +import * as _466 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; +import * as _467 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; +import * as _468 from "./applications/transfer/v1/query.rpc.Query"; +import * as _469 from "./core/channel/v1/query.rpc.Query"; +import * as _470 from "./core/client/v1/query.rpc.Query"; +import * as _471 from "./core/connection/v1/query.rpc.Query"; +import * as _472 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; +import * as _473 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; +import * as _474 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _475 from "./core/channel/v1/tx.rpc.msg"; +import * as _476 from "./core/client/v1/tx.rpc.msg"; +import * as _477 from "./core/connection/v1/tx.rpc.msg"; +import * as _656 from "./rpc.query"; +import * as _657 from "./rpc.tx"; export namespace ibc { export namespace applications { export namespace interchain_accounts { export namespace controller { export const v1 = { - ..._118, ..._119, ..._120, - ..._448, - ..._453, - ..._458, - ..._463 + ..._121, + ..._454, + ..._460, + ..._466, + ..._472 }; } export namespace host { export const v1 = { - ..._121, ..._122, ..._123, - ..._449, - ..._454, - ..._459, - ..._464 + ..._124, + ..._455, + ..._461, + ..._467, + ..._473 }; } export const v1 = { - ..._124, ..._125, - ..._126 + ..._126, + ..._127 }; } export namespace transfer { export const v1 = { - ..._127, ..._128, ..._129, ..._130, ..._131, - ..._450, - ..._455, - ..._460, - ..._465 + ..._132, + ..._456, + ..._462, + ..._468, + ..._474 }; } } export namespace core { export namespace channel { export const v1 = { - ..._132, ..._133, ..._134, ..._135, - ..._451, - ..._456, - ..._461, - ..._466 + ..._136, + ..._457, + ..._463, + ..._469, + ..._475 }; } export namespace client { export const v1 = { - ..._136, ..._137, ..._138, ..._139, - ..._452, - ..._457, - ..._462, - ..._467 + ..._140, + ..._458, + ..._464, + ..._470, + ..._476 + }; + } + export namespace commitment { + export const v1 = { + ..._141 + }; + } + export namespace connection { + export const v1 = { + ..._142, + ..._143, + ..._144, + ..._145, + ..._459, + ..._465, + ..._471, + ..._477 }; } } export const ClientFactory = { - ..._646, - ..._647 + ..._656, + ..._657 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/client.ts b/packages/types/protobuf/codegen/ibc/client.ts index 3498ab06f..624f2ae58 100644 --- a/packages/types/protobuf/codegen/ibc/client.ts +++ b/packages/types/protobuf/codegen/ibc/client.ts @@ -6,19 +6,22 @@ import * as ibcApplicationsInterchainAccountsHostV1TxRegistry from "./applicatio import * as ibcApplicationsTransferV1TxRegistry from "./applications/transfer/v1/tx.registry"; import * as ibcCoreChannelV1TxRegistry from "./core/channel/v1/tx.registry"; import * as ibcCoreClientV1TxRegistry from "./core/client/v1/tx.registry"; +import * as ibcCoreConnectionV1TxRegistry from "./core/connection/v1/tx.registry"; import * as ibcApplicationsInterchainAccountsControllerV1TxAmino from "./applications/interchain_accounts/controller/v1/tx.amino"; import * as ibcApplicationsInterchainAccountsHostV1TxAmino from "./applications/interchain_accounts/host/v1/tx.amino"; import * as ibcApplicationsTransferV1TxAmino from "./applications/transfer/v1/tx.amino"; import * as ibcCoreChannelV1TxAmino from "./core/channel/v1/tx.amino"; import * as ibcCoreClientV1TxAmino from "./core/client/v1/tx.amino"; +import * as ibcCoreConnectionV1TxAmino from "./core/connection/v1/tx.amino"; export const ibcAminoConverters = { ...ibcApplicationsInterchainAccountsControllerV1TxAmino.AminoConverter, ...ibcApplicationsInterchainAccountsHostV1TxAmino.AminoConverter, ...ibcApplicationsTransferV1TxAmino.AminoConverter, ...ibcCoreChannelV1TxAmino.AminoConverter, - ...ibcCoreClientV1TxAmino.AminoConverter + ...ibcCoreClientV1TxAmino.AminoConverter, + ...ibcCoreConnectionV1TxAmino.AminoConverter }; -export const ibcProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...ibcApplicationsInterchainAccountsControllerV1TxRegistry.registry, ...ibcApplicationsInterchainAccountsHostV1TxRegistry.registry, ...ibcApplicationsTransferV1TxRegistry.registry, ...ibcCoreChannelV1TxRegistry.registry, ...ibcCoreClientV1TxRegistry.registry]; +export const ibcProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...ibcApplicationsInterchainAccountsControllerV1TxRegistry.registry, ...ibcApplicationsInterchainAccountsHostV1TxRegistry.registry, ...ibcApplicationsTransferV1TxRegistry.registry, ...ibcCoreChannelV1TxRegistry.registry, ...ibcCoreClientV1TxRegistry.registry, ...ibcCoreConnectionV1TxRegistry.registry]; export const getSigningIbcClientOptions = ({ defaultTypes = defaultRegistryTypes }: { diff --git a/packages/types/protobuf/codegen/ibc/core/commitment/v1/commitment.ts b/packages/types/protobuf/codegen/ibc/core/commitment/v1/commitment.ts new file mode 100644 index 000000000..c7b7c2825 --- /dev/null +++ b/packages/types/protobuf/codegen/ibc/core/commitment/v1/commitment.ts @@ -0,0 +1,414 @@ +import { CommitmentProof, CommitmentProofAmino, CommitmentProofSDKType } from "../../../../cosmos/ics23/v1/proofs"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * MerkleRoot defines a merkle root hash. + * In the Cosmos SDK, the AppHash of a block header becomes the root. + */ +export interface MerkleRoot { + hash: Uint8Array; +} +export interface MerkleRootProtoMsg { + typeUrl: "/ibc.core.commitment.v1.MerkleRoot"; + value: Uint8Array; +} +/** + * MerkleRoot defines a merkle root hash. + * In the Cosmos SDK, the AppHash of a block header becomes the root. + */ +export interface MerkleRootAmino { + hash?: string; +} +export interface MerkleRootAminoMsg { + type: "cosmos-sdk/MerkleRoot"; + value: MerkleRootAmino; +} +/** + * MerkleRoot defines a merkle root hash. + * In the Cosmos SDK, the AppHash of a block header becomes the root. + */ +export interface MerkleRootSDKType { + hash: Uint8Array; +} +/** + * MerklePrefix is merkle path prefixed to the key. + * The constructed key from the Path and the key will be append(Path.KeyPath, + * append(Path.KeyPrefix, key...)) + */ +export interface MerklePrefix { + keyPrefix: Uint8Array; +} +export interface MerklePrefixProtoMsg { + typeUrl: "/ibc.core.commitment.v1.MerklePrefix"; + value: Uint8Array; +} +/** + * MerklePrefix is merkle path prefixed to the key. + * The constructed key from the Path and the key will be append(Path.KeyPath, + * append(Path.KeyPrefix, key...)) + */ +export interface MerklePrefixAmino { + key_prefix?: string; +} +export interface MerklePrefixAminoMsg { + type: "cosmos-sdk/MerklePrefix"; + value: MerklePrefixAmino; +} +/** + * MerklePrefix is merkle path prefixed to the key. + * The constructed key from the Path and the key will be append(Path.KeyPath, + * append(Path.KeyPrefix, key...)) + */ +export interface MerklePrefixSDKType { + key_prefix: Uint8Array; +} +/** + * MerklePath is the path used to verify commitment proofs, which can be an + * arbitrary structured object (defined by a commitment type). + * MerklePath is represented from root-to-leaf + */ +export interface MerklePath { + keyPath: string[]; +} +export interface MerklePathProtoMsg { + typeUrl: "/ibc.core.commitment.v1.MerklePath"; + value: Uint8Array; +} +/** + * MerklePath is the path used to verify commitment proofs, which can be an + * arbitrary structured object (defined by a commitment type). + * MerklePath is represented from root-to-leaf + */ +export interface MerklePathAmino { + key_path?: string[]; +} +export interface MerklePathAminoMsg { + type: "cosmos-sdk/MerklePath"; + value: MerklePathAmino; +} +/** + * MerklePath is the path used to verify commitment proofs, which can be an + * arbitrary structured object (defined by a commitment type). + * MerklePath is represented from root-to-leaf + */ +export interface MerklePathSDKType { + key_path: string[]; +} +/** + * MerkleProof is a wrapper type over a chain of CommitmentProofs. + * It demonstrates membership or non-membership for an element or set of + * elements, verifiable in conjunction with a known commitment root. Proofs + * should be succinct. + * MerkleProofs are ordered from leaf-to-root + */ +export interface MerkleProof { + proofs: CommitmentProof[]; +} +export interface MerkleProofProtoMsg { + typeUrl: "/ibc.core.commitment.v1.MerkleProof"; + value: Uint8Array; +} +/** + * MerkleProof is a wrapper type over a chain of CommitmentProofs. + * It demonstrates membership or non-membership for an element or set of + * elements, verifiable in conjunction with a known commitment root. Proofs + * should be succinct. + * MerkleProofs are ordered from leaf-to-root + */ +export interface MerkleProofAmino { + proofs?: CommitmentProofAmino[]; +} +export interface MerkleProofAminoMsg { + type: "cosmos-sdk/MerkleProof"; + value: MerkleProofAmino; +} +/** + * MerkleProof is a wrapper type over a chain of CommitmentProofs. + * It demonstrates membership or non-membership for an element or set of + * elements, verifiable in conjunction with a known commitment root. Proofs + * should be succinct. + * MerkleProofs are ordered from leaf-to-root + */ +export interface MerkleProofSDKType { + proofs: CommitmentProofSDKType[]; +} +function createBaseMerkleRoot(): MerkleRoot { + return { + hash: new Uint8Array() + }; +} +export const MerkleRoot = { + typeUrl: "/ibc.core.commitment.v1.MerkleRoot", + encode(message: MerkleRoot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash.length !== 0) { + writer.uint32(10).bytes(message.hash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MerkleRoot { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMerkleRoot(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MerkleRoot { + const message = createBaseMerkleRoot(); + message.hash = object.hash ?? new Uint8Array(); + return message; + }, + fromAmino(object: MerkleRootAmino): MerkleRoot { + const message = createBaseMerkleRoot(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + return message; + }, + toAmino(message: MerkleRoot, useInterfaces: boolean = false): MerkleRootAmino { + const obj: any = {}; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + return obj; + }, + fromAminoMsg(object: MerkleRootAminoMsg): MerkleRoot { + return MerkleRoot.fromAmino(object.value); + }, + toAminoMsg(message: MerkleRoot, useInterfaces: boolean = false): MerkleRootAminoMsg { + return { + type: "cosmos-sdk/MerkleRoot", + value: MerkleRoot.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MerkleRootProtoMsg, useInterfaces: boolean = false): MerkleRoot { + return MerkleRoot.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MerkleRoot): Uint8Array { + return MerkleRoot.encode(message).finish(); + }, + toProtoMsg(message: MerkleRoot): MerkleRootProtoMsg { + return { + typeUrl: "/ibc.core.commitment.v1.MerkleRoot", + value: MerkleRoot.encode(message).finish() + }; + } +}; +function createBaseMerklePrefix(): MerklePrefix { + return { + keyPrefix: new Uint8Array() + }; +} +export const MerklePrefix = { + typeUrl: "/ibc.core.commitment.v1.MerklePrefix", + encode(message: MerklePrefix, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.keyPrefix.length !== 0) { + writer.uint32(10).bytes(message.keyPrefix); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MerklePrefix { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMerklePrefix(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.keyPrefix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MerklePrefix { + const message = createBaseMerklePrefix(); + message.keyPrefix = object.keyPrefix ?? new Uint8Array(); + return message; + }, + fromAmino(object: MerklePrefixAmino): MerklePrefix { + const message = createBaseMerklePrefix(); + if (object.key_prefix !== undefined && object.key_prefix !== null) { + message.keyPrefix = bytesFromBase64(object.key_prefix); + } + return message; + }, + toAmino(message: MerklePrefix, useInterfaces: boolean = false): MerklePrefixAmino { + const obj: any = {}; + obj.key_prefix = message.keyPrefix ? base64FromBytes(message.keyPrefix) : undefined; + return obj; + }, + fromAminoMsg(object: MerklePrefixAminoMsg): MerklePrefix { + return MerklePrefix.fromAmino(object.value); + }, + toAminoMsg(message: MerklePrefix, useInterfaces: boolean = false): MerklePrefixAminoMsg { + return { + type: "cosmos-sdk/MerklePrefix", + value: MerklePrefix.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MerklePrefixProtoMsg, useInterfaces: boolean = false): MerklePrefix { + return MerklePrefix.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MerklePrefix): Uint8Array { + return MerklePrefix.encode(message).finish(); + }, + toProtoMsg(message: MerklePrefix): MerklePrefixProtoMsg { + return { + typeUrl: "/ibc.core.commitment.v1.MerklePrefix", + value: MerklePrefix.encode(message).finish() + }; + } +}; +function createBaseMerklePath(): MerklePath { + return { + keyPath: [] + }; +} +export const MerklePath = { + typeUrl: "/ibc.core.commitment.v1.MerklePath", + encode(message: MerklePath, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.keyPath) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MerklePath { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMerklePath(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.keyPath.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MerklePath { + const message = createBaseMerklePath(); + message.keyPath = object.keyPath?.map(e => e) || []; + return message; + }, + fromAmino(object: MerklePathAmino): MerklePath { + const message = createBaseMerklePath(); + message.keyPath = object.key_path?.map(e => e) || []; + return message; + }, + toAmino(message: MerklePath, useInterfaces: boolean = false): MerklePathAmino { + const obj: any = {}; + if (message.keyPath) { + obj.key_path = message.keyPath.map(e => e); + } else { + obj.key_path = []; + } + return obj; + }, + fromAminoMsg(object: MerklePathAminoMsg): MerklePath { + return MerklePath.fromAmino(object.value); + }, + toAminoMsg(message: MerklePath, useInterfaces: boolean = false): MerklePathAminoMsg { + return { + type: "cosmos-sdk/MerklePath", + value: MerklePath.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MerklePathProtoMsg, useInterfaces: boolean = false): MerklePath { + return MerklePath.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MerklePath): Uint8Array { + return MerklePath.encode(message).finish(); + }, + toProtoMsg(message: MerklePath): MerklePathProtoMsg { + return { + typeUrl: "/ibc.core.commitment.v1.MerklePath", + value: MerklePath.encode(message).finish() + }; + } +}; +function createBaseMerkleProof(): MerkleProof { + return { + proofs: [] + }; +} +export const MerkleProof = { + typeUrl: "/ibc.core.commitment.v1.MerkleProof", + encode(message: MerkleProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.proofs) { + CommitmentProof.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MerkleProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMerkleProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proofs.push(CommitmentProof.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MerkleProof { + const message = createBaseMerkleProof(); + message.proofs = object.proofs?.map(e => CommitmentProof.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MerkleProofAmino): MerkleProof { + const message = createBaseMerkleProof(); + message.proofs = object.proofs?.map(e => CommitmentProof.fromAmino(e)) || []; + return message; + }, + toAmino(message: MerkleProof, useInterfaces: boolean = false): MerkleProofAmino { + const obj: any = {}; + if (message.proofs) { + obj.proofs = message.proofs.map(e => e ? CommitmentProof.toAmino(e, useInterfaces) : undefined); + } else { + obj.proofs = []; + } + return obj; + }, + fromAminoMsg(object: MerkleProofAminoMsg): MerkleProof { + return MerkleProof.fromAmino(object.value); + }, + toAminoMsg(message: MerkleProof, useInterfaces: boolean = false): MerkleProofAminoMsg { + return { + type: "cosmos-sdk/MerkleProof", + value: MerkleProof.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MerkleProofProtoMsg, useInterfaces: boolean = false): MerkleProof { + return MerkleProof.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MerkleProof): Uint8Array { + return MerkleProof.encode(message).finish(); + }, + toProtoMsg(message: MerkleProof): MerkleProofProtoMsg { + return { + typeUrl: "/ibc.core.commitment.v1.MerkleProof", + value: MerkleProof.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/core/connection/v1/connection.ts b/packages/types/protobuf/codegen/ibc/core/connection/v1/connection.ts new file mode 100644 index 000000000..6cc2bb4d2 --- /dev/null +++ b/packages/types/protobuf/codegen/ibc/core/connection/v1/connection.ts @@ -0,0 +1,998 @@ +import { MerklePrefix, MerklePrefixAmino, MerklePrefixSDKType } from "../../commitment/v1/commitment"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** + * State defines if a connection is in one of the following states: + * INIT, TRYOPEN, OPEN or UNINITIALIZED. + */ +export enum State { + /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */ + STATE_UNINITIALIZED_UNSPECIFIED = 0, + /** STATE_INIT - A connection end has just started the opening handshake. */ + STATE_INIT = 1, + /** + * STATE_TRYOPEN - A connection end has acknowledged the handshake step on the counterparty + * chain. + */ + STATE_TRYOPEN = 2, + /** STATE_OPEN - A connection end has completed the handshake. */ + STATE_OPEN = 3, + UNRECOGNIZED = -1, +} +export const StateSDKType = State; +export const StateAmino = State; +export function stateFromJSON(object: any): State { + switch (object) { + case 0: + case "STATE_UNINITIALIZED_UNSPECIFIED": + return State.STATE_UNINITIALIZED_UNSPECIFIED; + case 1: + case "STATE_INIT": + return State.STATE_INIT; + case 2: + case "STATE_TRYOPEN": + return State.STATE_TRYOPEN; + case 3: + case "STATE_OPEN": + return State.STATE_OPEN; + case -1: + case "UNRECOGNIZED": + default: + return State.UNRECOGNIZED; + } +} +export function stateToJSON(object: State): string { + switch (object) { + case State.STATE_UNINITIALIZED_UNSPECIFIED: + return "STATE_UNINITIALIZED_UNSPECIFIED"; + case State.STATE_INIT: + return "STATE_INIT"; + case State.STATE_TRYOPEN: + return "STATE_TRYOPEN"; + case State.STATE_OPEN: + return "STATE_OPEN"; + case State.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * ConnectionEnd defines a stateful object on a chain connected to another + * separate one. + * NOTE: there must only be 2 defined ConnectionEnds to establish + * a connection between two chains. + */ +export interface ConnectionEnd { + /** client associated with this connection. */ + clientId: string; + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection. + */ + versions: Version[]; + /** current state of the connection end. */ + state: State; + /** counterparty chain associated with this connection. */ + counterparty: Counterparty | undefined; + /** + * delay period that must pass before a consensus state can be used for + * packet-verification NOTE: delay period logic is only implemented by some + * clients. + */ + delayPeriod: bigint; +} +export interface ConnectionEndProtoMsg { + typeUrl: "/ibc.core.connection.v1.ConnectionEnd"; + value: Uint8Array; +} +/** + * ConnectionEnd defines a stateful object on a chain connected to another + * separate one. + * NOTE: there must only be 2 defined ConnectionEnds to establish + * a connection between two chains. + */ +export interface ConnectionEndAmino { + /** client associated with this connection. */ + client_id?: string; + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection. + */ + versions?: VersionAmino[]; + /** current state of the connection end. */ + state?: State; + /** counterparty chain associated with this connection. */ + counterparty?: CounterpartyAmino | undefined; + /** + * delay period that must pass before a consensus state can be used for + * packet-verification NOTE: delay period logic is only implemented by some + * clients. + */ + delay_period?: string; +} +export interface ConnectionEndAminoMsg { + type: "cosmos-sdk/ConnectionEnd"; + value: ConnectionEndAmino; +} +/** + * ConnectionEnd defines a stateful object on a chain connected to another + * separate one. + * NOTE: there must only be 2 defined ConnectionEnds to establish + * a connection between two chains. + */ +export interface ConnectionEndSDKType { + client_id: string; + versions: VersionSDKType[]; + state: State; + counterparty: CounterpartySDKType | undefined; + delay_period: bigint; +} +/** + * IdentifiedConnection defines a connection with additional connection + * identifier field. + */ +export interface IdentifiedConnection { + /** connection identifier. */ + id: string; + /** client associated with this connection. */ + clientId: string; + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection + */ + versions: Version[]; + /** current state of the connection end. */ + state: State; + /** counterparty chain associated with this connection. */ + counterparty: Counterparty | undefined; + /** delay period associated with this connection. */ + delayPeriod: bigint; +} +export interface IdentifiedConnectionProtoMsg { + typeUrl: "/ibc.core.connection.v1.IdentifiedConnection"; + value: Uint8Array; +} +/** + * IdentifiedConnection defines a connection with additional connection + * identifier field. + */ +export interface IdentifiedConnectionAmino { + /** connection identifier. */ + id?: string; + /** client associated with this connection. */ + client_id?: string; + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection + */ + versions?: VersionAmino[]; + /** current state of the connection end. */ + state?: State; + /** counterparty chain associated with this connection. */ + counterparty?: CounterpartyAmino | undefined; + /** delay period associated with this connection. */ + delay_period?: string; +} +export interface IdentifiedConnectionAminoMsg { + type: "cosmos-sdk/IdentifiedConnection"; + value: IdentifiedConnectionAmino; +} +/** + * IdentifiedConnection defines a connection with additional connection + * identifier field. + */ +export interface IdentifiedConnectionSDKType { + id: string; + client_id: string; + versions: VersionSDKType[]; + state: State; + counterparty: CounterpartySDKType | undefined; + delay_period: bigint; +} +/** Counterparty defines the counterparty chain associated with a connection end. */ +export interface Counterparty { + /** + * identifies the client on the counterparty chain associated with a given + * connection. + */ + clientId: string; + /** + * identifies the connection end on the counterparty chain associated with a + * given connection. + */ + connectionId: string; + /** commitment merkle prefix of the counterparty chain. */ + prefix: MerklePrefix | undefined; +} +export interface CounterpartyProtoMsg { + typeUrl: "/ibc.core.connection.v1.Counterparty"; + value: Uint8Array; +} +/** Counterparty defines the counterparty chain associated with a connection end. */ +export interface CounterpartyAmino { + /** + * identifies the client on the counterparty chain associated with a given + * connection. + */ + client_id?: string; + /** + * identifies the connection end on the counterparty chain associated with a + * given connection. + */ + connection_id?: string; + /** commitment merkle prefix of the counterparty chain. */ + prefix?: MerklePrefixAmino | undefined; +} +export interface CounterpartyAminoMsg { + type: "cosmos-sdk/Counterparty"; + value: CounterpartyAmino; +} +/** Counterparty defines the counterparty chain associated with a connection end. */ +export interface CounterpartySDKType { + client_id: string; + connection_id: string; + prefix: MerklePrefixSDKType | undefined; +} +/** ClientPaths define all the connection paths for a client state. */ +export interface ClientPaths { + /** list of connection paths */ + paths: string[]; +} +export interface ClientPathsProtoMsg { + typeUrl: "/ibc.core.connection.v1.ClientPaths"; + value: Uint8Array; +} +/** ClientPaths define all the connection paths for a client state. */ +export interface ClientPathsAmino { + /** list of connection paths */ + paths?: string[]; +} +export interface ClientPathsAminoMsg { + type: "cosmos-sdk/ClientPaths"; + value: ClientPathsAmino; +} +/** ClientPaths define all the connection paths for a client state. */ +export interface ClientPathsSDKType { + paths: string[]; +} +/** ConnectionPaths define all the connection paths for a given client state. */ +export interface ConnectionPaths { + /** client state unique identifier */ + clientId: string; + /** list of connection paths */ + paths: string[]; +} +export interface ConnectionPathsProtoMsg { + typeUrl: "/ibc.core.connection.v1.ConnectionPaths"; + value: Uint8Array; +} +/** ConnectionPaths define all the connection paths for a given client state. */ +export interface ConnectionPathsAmino { + /** client state unique identifier */ + client_id?: string; + /** list of connection paths */ + paths?: string[]; +} +export interface ConnectionPathsAminoMsg { + type: "cosmos-sdk/ConnectionPaths"; + value: ConnectionPathsAmino; +} +/** ConnectionPaths define all the connection paths for a given client state. */ +export interface ConnectionPathsSDKType { + client_id: string; + paths: string[]; +} +/** + * Version defines the versioning scheme used to negotiate the IBC verison in + * the connection handshake. + */ +export interface Version { + /** unique version identifier */ + identifier: string; + /** list of features compatible with the specified identifier */ + features: string[]; +} +export interface VersionProtoMsg { + typeUrl: "/ibc.core.connection.v1.Version"; + value: Uint8Array; +} +/** + * Version defines the versioning scheme used to negotiate the IBC verison in + * the connection handshake. + */ +export interface VersionAmino { + /** unique version identifier */ + identifier?: string; + /** list of features compatible with the specified identifier */ + features?: string[]; +} +export interface VersionAminoMsg { + type: "cosmos-sdk/Version"; + value: VersionAmino; +} +/** + * Version defines the versioning scheme used to negotiate the IBC verison in + * the connection handshake. + */ +export interface VersionSDKType { + identifier: string; + features: string[]; +} +/** Params defines the set of Connection parameters. */ +export interface Params { + /** + * maximum expected time per block (in nanoseconds), used to enforce block delay. This parameter should reflect the + * largest amount of time that the chain might reasonably take to produce the next block under normal operating + * conditions. A safe choice is 3-5x the expected time per block. + */ + maxExpectedTimePerBlock: bigint; +} +export interface ParamsProtoMsg { + typeUrl: "/ibc.core.connection.v1.Params"; + value: Uint8Array; +} +/** Params defines the set of Connection parameters. */ +export interface ParamsAmino { + /** + * maximum expected time per block (in nanoseconds), used to enforce block delay. This parameter should reflect the + * largest amount of time that the chain might reasonably take to produce the next block under normal operating + * conditions. A safe choice is 3-5x the expected time per block. + */ + max_expected_time_per_block?: string; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** Params defines the set of Connection parameters. */ +export interface ParamsSDKType { + max_expected_time_per_block: bigint; +} +function createBaseConnectionEnd(): ConnectionEnd { + return { + clientId: "", + versions: [], + state: 0, + counterparty: Counterparty.fromPartial({}), + delayPeriod: BigInt(0) + }; +} +export const ConnectionEnd = { + typeUrl: "/ibc.core.connection.v1.ConnectionEnd", + encode(message: ConnectionEnd, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.versions) { + Version.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(24).int32(message.state); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(34).fork()).ldelim(); + } + if (message.delayPeriod !== BigInt(0)) { + writer.uint32(40).uint64(message.delayPeriod); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ConnectionEnd { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectionEnd(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.versions.push(Version.decode(reader, reader.uint32(), useInterfaces)); + break; + case 3: + message.state = (reader.int32() as any); + break; + case 4: + message.counterparty = Counterparty.decode(reader, reader.uint32(), useInterfaces); + break; + case 5: + message.delayPeriod = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConnectionEnd { + const message = createBaseConnectionEnd(); + message.clientId = object.clientId ?? ""; + message.versions = object.versions?.map(e => Version.fromPartial(e)) || []; + message.state = object.state ?? 0; + message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; + message.delayPeriod = object.delayPeriod !== undefined && object.delayPeriod !== null ? BigInt(object.delayPeriod.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ConnectionEndAmino): ConnectionEnd { + const message = createBaseConnectionEnd(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.versions = object.versions?.map(e => Version.fromAmino(e)) || []; + if (object.state !== undefined && object.state !== null) { + message.state = stateFromJSON(object.state); + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + return message; + }, + toAmino(message: ConnectionEnd, useInterfaces: boolean = false): ConnectionEndAmino { + const obj: any = {}; + obj.client_id = message.clientId; + if (message.versions) { + obj.versions = message.versions.map(e => e ? Version.toAmino(e, useInterfaces) : undefined); + } else { + obj.versions = []; + } + obj.state = message.state; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty, useInterfaces) : undefined; + obj.delay_period = message.delayPeriod ? message.delayPeriod.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ConnectionEndAminoMsg): ConnectionEnd { + return ConnectionEnd.fromAmino(object.value); + }, + toAminoMsg(message: ConnectionEnd, useInterfaces: boolean = false): ConnectionEndAminoMsg { + return { + type: "cosmos-sdk/ConnectionEnd", + value: ConnectionEnd.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: ConnectionEndProtoMsg, useInterfaces: boolean = false): ConnectionEnd { + return ConnectionEnd.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ConnectionEnd): Uint8Array { + return ConnectionEnd.encode(message).finish(); + }, + toProtoMsg(message: ConnectionEnd): ConnectionEndProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.ConnectionEnd", + value: ConnectionEnd.encode(message).finish() + }; + } +}; +function createBaseIdentifiedConnection(): IdentifiedConnection { + return { + id: "", + clientId: "", + versions: [], + state: 0, + counterparty: Counterparty.fromPartial({}), + delayPeriod: BigInt(0) + }; +} +export const IdentifiedConnection = { + typeUrl: "/ibc.core.connection.v1.IdentifiedConnection", + encode(message: IdentifiedConnection, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.clientId !== "") { + writer.uint32(18).string(message.clientId); + } + for (const v of message.versions) { + Version.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(32).int32(message.state); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(42).fork()).ldelim(); + } + if (message.delayPeriod !== BigInt(0)) { + writer.uint32(48).uint64(message.delayPeriod); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): IdentifiedConnection { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdentifiedConnection(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.clientId = reader.string(); + break; + case 3: + message.versions.push(Version.decode(reader, reader.uint32(), useInterfaces)); + break; + case 4: + message.state = (reader.int32() as any); + break; + case 5: + message.counterparty = Counterparty.decode(reader, reader.uint32(), useInterfaces); + break; + case 6: + message.delayPeriod = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IdentifiedConnection { + const message = createBaseIdentifiedConnection(); + message.id = object.id ?? ""; + message.clientId = object.clientId ?? ""; + message.versions = object.versions?.map(e => Version.fromPartial(e)) || []; + message.state = object.state ?? 0; + message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; + message.delayPeriod = object.delayPeriod !== undefined && object.delayPeriod !== null ? BigInt(object.delayPeriod.toString()) : BigInt(0); + return message; + }, + fromAmino(object: IdentifiedConnectionAmino): IdentifiedConnection { + const message = createBaseIdentifiedConnection(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.versions = object.versions?.map(e => Version.fromAmino(e)) || []; + if (object.state !== undefined && object.state !== null) { + message.state = stateFromJSON(object.state); + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + return message; + }, + toAmino(message: IdentifiedConnection, useInterfaces: boolean = false): IdentifiedConnectionAmino { + const obj: any = {}; + obj.id = message.id; + obj.client_id = message.clientId; + if (message.versions) { + obj.versions = message.versions.map(e => e ? Version.toAmino(e, useInterfaces) : undefined); + } else { + obj.versions = []; + } + obj.state = message.state; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty, useInterfaces) : undefined; + obj.delay_period = message.delayPeriod ? message.delayPeriod.toString() : undefined; + return obj; + }, + fromAminoMsg(object: IdentifiedConnectionAminoMsg): IdentifiedConnection { + return IdentifiedConnection.fromAmino(object.value); + }, + toAminoMsg(message: IdentifiedConnection, useInterfaces: boolean = false): IdentifiedConnectionAminoMsg { + return { + type: "cosmos-sdk/IdentifiedConnection", + value: IdentifiedConnection.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: IdentifiedConnectionProtoMsg, useInterfaces: boolean = false): IdentifiedConnection { + return IdentifiedConnection.decode(message.value, undefined, useInterfaces); + }, + toProto(message: IdentifiedConnection): Uint8Array { + return IdentifiedConnection.encode(message).finish(); + }, + toProtoMsg(message: IdentifiedConnection): IdentifiedConnectionProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.IdentifiedConnection", + value: IdentifiedConnection.encode(message).finish() + }; + } +}; +function createBaseCounterparty(): Counterparty { + return { + clientId: "", + connectionId: "", + prefix: MerklePrefix.fromPartial({}) + }; +} +export const Counterparty = { + typeUrl: "/ibc.core.connection.v1.Counterparty", + encode(message: Counterparty, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.connectionId !== "") { + writer.uint32(18).string(message.connectionId); + } + if (message.prefix !== undefined) { + MerklePrefix.encode(message.prefix, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Counterparty { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCounterparty(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.connectionId = reader.string(); + break; + case 3: + message.prefix = MerklePrefix.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Counterparty { + const message = createBaseCounterparty(); + message.clientId = object.clientId ?? ""; + message.connectionId = object.connectionId ?? ""; + message.prefix = object.prefix !== undefined && object.prefix !== null ? MerklePrefix.fromPartial(object.prefix) : undefined; + return message; + }, + fromAmino(object: CounterpartyAmino): Counterparty { + const message = createBaseCounterparty(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = MerklePrefix.fromAmino(object.prefix); + } + return message; + }, + toAmino(message: Counterparty, useInterfaces: boolean = false): CounterpartyAmino { + const obj: any = {}; + obj.client_id = message.clientId; + obj.connection_id = message.connectionId; + obj.prefix = message.prefix ? MerklePrefix.toAmino(message.prefix, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: CounterpartyAminoMsg): Counterparty { + return Counterparty.fromAmino(object.value); + }, + toAminoMsg(message: Counterparty, useInterfaces: boolean = false): CounterpartyAminoMsg { + return { + type: "cosmos-sdk/Counterparty", + value: Counterparty.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: CounterpartyProtoMsg, useInterfaces: boolean = false): Counterparty { + return Counterparty.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Counterparty): Uint8Array { + return Counterparty.encode(message).finish(); + }, + toProtoMsg(message: Counterparty): CounterpartyProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.Counterparty", + value: Counterparty.encode(message).finish() + }; + } +}; +function createBaseClientPaths(): ClientPaths { + return { + paths: [] + }; +} +export const ClientPaths = { + typeUrl: "/ibc.core.connection.v1.ClientPaths", + encode(message: ClientPaths, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.paths) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ClientPaths { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientPaths(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClientPaths { + const message = createBaseClientPaths(); + message.paths = object.paths?.map(e => e) || []; + return message; + }, + fromAmino(object: ClientPathsAmino): ClientPaths { + const message = createBaseClientPaths(); + message.paths = object.paths?.map(e => e) || []; + return message; + }, + toAmino(message: ClientPaths, useInterfaces: boolean = false): ClientPathsAmino { + const obj: any = {}; + if (message.paths) { + obj.paths = message.paths.map(e => e); + } else { + obj.paths = []; + } + return obj; + }, + fromAminoMsg(object: ClientPathsAminoMsg): ClientPaths { + return ClientPaths.fromAmino(object.value); + }, + toAminoMsg(message: ClientPaths, useInterfaces: boolean = false): ClientPathsAminoMsg { + return { + type: "cosmos-sdk/ClientPaths", + value: ClientPaths.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: ClientPathsProtoMsg, useInterfaces: boolean = false): ClientPaths { + return ClientPaths.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ClientPaths): Uint8Array { + return ClientPaths.encode(message).finish(); + }, + toProtoMsg(message: ClientPaths): ClientPathsProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.ClientPaths", + value: ClientPaths.encode(message).finish() + }; + } +}; +function createBaseConnectionPaths(): ConnectionPaths { + return { + clientId: "", + paths: [] + }; +} +export const ConnectionPaths = { + typeUrl: "/ibc.core.connection.v1.ConnectionPaths", + encode(message: ConnectionPaths, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.paths) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ConnectionPaths { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConnectionPaths(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConnectionPaths { + const message = createBaseConnectionPaths(); + message.clientId = object.clientId ?? ""; + message.paths = object.paths?.map(e => e) || []; + return message; + }, + fromAmino(object: ConnectionPathsAmino): ConnectionPaths { + const message = createBaseConnectionPaths(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.paths = object.paths?.map(e => e) || []; + return message; + }, + toAmino(message: ConnectionPaths, useInterfaces: boolean = false): ConnectionPathsAmino { + const obj: any = {}; + obj.client_id = message.clientId; + if (message.paths) { + obj.paths = message.paths.map(e => e); + } else { + obj.paths = []; + } + return obj; + }, + fromAminoMsg(object: ConnectionPathsAminoMsg): ConnectionPaths { + return ConnectionPaths.fromAmino(object.value); + }, + toAminoMsg(message: ConnectionPaths, useInterfaces: boolean = false): ConnectionPathsAminoMsg { + return { + type: "cosmos-sdk/ConnectionPaths", + value: ConnectionPaths.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: ConnectionPathsProtoMsg, useInterfaces: boolean = false): ConnectionPaths { + return ConnectionPaths.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ConnectionPaths): Uint8Array { + return ConnectionPaths.encode(message).finish(); + }, + toProtoMsg(message: ConnectionPaths): ConnectionPathsProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.ConnectionPaths", + value: ConnectionPaths.encode(message).finish() + }; + } +}; +function createBaseVersion(): Version { + return { + identifier: "", + features: [] + }; +} +export const Version = { + typeUrl: "/ibc.core.connection.v1.Version", + encode(message: Version, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.identifier !== "") { + writer.uint32(10).string(message.identifier); + } + for (const v of message.features) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Version { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVersion(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifier = reader.string(); + break; + case 2: + message.features.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Version { + const message = createBaseVersion(); + message.identifier = object.identifier ?? ""; + message.features = object.features?.map(e => e) || []; + return message; + }, + fromAmino(object: VersionAmino): Version { + const message = createBaseVersion(); + if (object.identifier !== undefined && object.identifier !== null) { + message.identifier = object.identifier; + } + message.features = object.features?.map(e => e) || []; + return message; + }, + toAmino(message: Version, useInterfaces: boolean = false): VersionAmino { + const obj: any = {}; + obj.identifier = message.identifier; + if (message.features) { + obj.features = message.features.map(e => e); + } else { + obj.features = []; + } + return obj; + }, + fromAminoMsg(object: VersionAminoMsg): Version { + return Version.fromAmino(object.value); + }, + toAminoMsg(message: Version, useInterfaces: boolean = false): VersionAminoMsg { + return { + type: "cosmos-sdk/Version", + value: Version.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: VersionProtoMsg, useInterfaces: boolean = false): Version { + return Version.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Version): Uint8Array { + return Version.encode(message).finish(); + }, + toProtoMsg(message: Version): VersionProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.Version", + value: Version.encode(message).finish() + }; + } +}; +function createBaseParams(): Params { + return { + maxExpectedTimePerBlock: BigInt(0) + }; +} +export const Params = { + typeUrl: "/ibc.core.connection.v1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxExpectedTimePerBlock !== BigInt(0)) { + writer.uint32(8).uint64(message.maxExpectedTimePerBlock); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxExpectedTimePerBlock = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.maxExpectedTimePerBlock = object.maxExpectedTimePerBlock !== undefined && object.maxExpectedTimePerBlock !== null ? BigInt(object.maxExpectedTimePerBlock.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.max_expected_time_per_block !== undefined && object.max_expected_time_per_block !== null) { + message.maxExpectedTimePerBlock = BigInt(object.max_expected_time_per_block); + } + return message; + }, + toAmino(message: Params, useInterfaces: boolean = false): ParamsAmino { + const obj: any = {}; + obj.max_expected_time_per_block = message.maxExpectedTimePerBlock ? message.maxExpectedTimePerBlock.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params, useInterfaces: boolean = false): ParamsAminoMsg { + return { + type: "cosmos-sdk/Params", + value: Params.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: ParamsProtoMsg, useInterfaces: boolean = false): Params { + return Params.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/core/connection/v1/genesis.ts b/packages/types/protobuf/codegen/ibc/core/connection/v1/genesis.ts new file mode 100644 index 000000000..356665513 --- /dev/null +++ b/packages/types/protobuf/codegen/ibc/core/connection/v1/genesis.ts @@ -0,0 +1,143 @@ +//@ts-nocheck +import { IdentifiedConnection, IdentifiedConnectionAmino, IdentifiedConnectionSDKType, ConnectionPaths, ConnectionPathsAmino, ConnectionPathsSDKType, Params, ParamsAmino, ParamsSDKType } from "./connection"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** GenesisState defines the ibc connection submodule's genesis state. */ +export interface GenesisState { + connections: IdentifiedConnection[]; + clientConnectionPaths: ConnectionPaths[]; + /** the sequence for the next generated connection identifier */ + nextConnectionSequence: bigint; + params: Params | undefined; +} +export interface GenesisStateProtoMsg { + typeUrl: "/ibc.core.connection.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the ibc connection submodule's genesis state. */ +export interface GenesisStateAmino { + connections?: IdentifiedConnectionAmino[]; + client_connection_paths?: ConnectionPathsAmino[]; + /** the sequence for the next generated connection identifier */ + next_connection_sequence?: string; + params?: ParamsAmino | undefined; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the ibc connection submodule's genesis state. */ +export interface GenesisStateSDKType { + connections: IdentifiedConnectionSDKType[]; + client_connection_paths: ConnectionPathsSDKType[]; + next_connection_sequence: bigint; + params: ParamsSDKType | undefined; +} +function createBaseGenesisState(): GenesisState { + return { + connections: [], + clientConnectionPaths: [], + nextConnectionSequence: BigInt(0), + params: Params.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/ibc.core.connection.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.connections) { + IdentifiedConnection.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.clientConnectionPaths) { + ConnectionPaths.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.nextConnectionSequence !== BigInt(0)) { + writer.uint32(24).uint64(message.nextConnectionSequence); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connections.push(IdentifiedConnection.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.clientConnectionPaths.push(ConnectionPaths.decode(reader, reader.uint32(), useInterfaces)); + break; + case 3: + message.nextConnectionSequence = reader.uint64(); + break; + case 4: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.connections = object.connections?.map(e => IdentifiedConnection.fromPartial(e)) || []; + message.clientConnectionPaths = object.clientConnectionPaths?.map(e => ConnectionPaths.fromPartial(e)) || []; + message.nextConnectionSequence = object.nextConnectionSequence !== undefined && object.nextConnectionSequence !== null ? BigInt(object.nextConnectionSequence.toString()) : BigInt(0); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.connections = object.connections?.map(e => IdentifiedConnection.fromAmino(e)) || []; + message.clientConnectionPaths = object.client_connection_paths?.map(e => ConnectionPaths.fromAmino(e)) || []; + if (object.next_connection_sequence !== undefined && object.next_connection_sequence !== null) { + message.nextConnectionSequence = BigInt(object.next_connection_sequence); + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: GenesisState, useInterfaces: boolean = false): GenesisStateAmino { + const obj: any = {}; + if (message.connections) { + obj.connections = message.connections.map(e => e ? IdentifiedConnection.toAmino(e, useInterfaces) : undefined); + } else { + obj.connections = []; + } + if (message.clientConnectionPaths) { + obj.client_connection_paths = message.clientConnectionPaths.map(e => e ? ConnectionPaths.toAmino(e, useInterfaces) : undefined); + } else { + obj.client_connection_paths = []; + } + obj.next_connection_sequence = message.nextConnectionSequence ? message.nextConnectionSequence.toString() : undefined; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState, useInterfaces: boolean = false): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg, useInterfaces: boolean = false): GenesisState { + return GenesisState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/core/connection/v1/query.rpc.Query.ts b/packages/types/protobuf/codegen/ibc/core/connection/v1/query.rpc.Query.ts new file mode 100644 index 000000000..4dbb2209a --- /dev/null +++ b/packages/types/protobuf/codegen/ibc/core/connection/v1/query.rpc.Query.ts @@ -0,0 +1,96 @@ +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryConnectionRequest, QueryConnectionResponse, QueryConnectionsRequest, QueryConnectionsResponse, QueryClientConnectionsRequest, QueryClientConnectionsResponse, QueryConnectionClientStateRequest, QueryConnectionClientStateResponse, QueryConnectionConsensusStateRequest, QueryConnectionConsensusStateResponse, QueryConnectionParamsRequest, QueryConnectionParamsResponse } from "./query"; +/** Query provides defines the gRPC querier service */ +export interface Query { + /** Connection queries an IBC connection end. */ + connection(request: QueryConnectionRequest): Promise; + /** Connections queries all the IBC connections of a chain. */ + connections(request?: QueryConnectionsRequest): Promise; + /** + * ClientConnections queries the connection paths associated with a client + * state. + */ + clientConnections(request: QueryClientConnectionsRequest): Promise; + /** + * ConnectionClientState queries the client state associated with the + * connection. + */ + connectionClientState(request: QueryConnectionClientStateRequest): Promise; + /** + * ConnectionConsensusState queries the consensus state associated with the + * connection. + */ + connectionConsensusState(request: QueryConnectionConsensusStateRequest): Promise; + /** ConnectionParams queries all parameters of the ibc connection submodule. */ + connectionParams(request?: QueryConnectionParamsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.connection = this.connection.bind(this); + this.connections = this.connections.bind(this); + this.clientConnections = this.clientConnections.bind(this); + this.connectionClientState = this.connectionClientState.bind(this); + this.connectionConsensusState = this.connectionConsensusState.bind(this); + this.connectionParams = this.connectionParams.bind(this); + } + connection(request: QueryConnectionRequest, useInterfaces: boolean = true): Promise { + const data = QueryConnectionRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "Connection", data); + return promise.then(data => QueryConnectionResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + connections(request: QueryConnectionsRequest = { + pagination: undefined + }, useInterfaces: boolean = true): Promise { + const data = QueryConnectionsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "Connections", data); + return promise.then(data => QueryConnectionsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + clientConnections(request: QueryClientConnectionsRequest, useInterfaces: boolean = true): Promise { + const data = QueryClientConnectionsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "ClientConnections", data); + return promise.then(data => QueryClientConnectionsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + connectionClientState(request: QueryConnectionClientStateRequest, useInterfaces: boolean = true): Promise { + const data = QueryConnectionClientStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "ConnectionClientState", data); + return promise.then(data => QueryConnectionClientStateResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + connectionConsensusState(request: QueryConnectionConsensusStateRequest, useInterfaces: boolean = true): Promise { + const data = QueryConnectionConsensusStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "ConnectionConsensusState", data); + return promise.then(data => QueryConnectionConsensusStateResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + connectionParams(request: QueryConnectionParamsRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryConnectionParamsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "ConnectionParams", data); + return promise.then(data => QueryConnectionParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + connection(request: QueryConnectionRequest, useInterfaces: boolean = true): Promise { + return queryService.connection(request, useInterfaces); + }, + connections(request?: QueryConnectionsRequest, useInterfaces: boolean = true): Promise { + return queryService.connections(request, useInterfaces); + }, + clientConnections(request: QueryClientConnectionsRequest, useInterfaces: boolean = true): Promise { + return queryService.clientConnections(request, useInterfaces); + }, + connectionClientState(request: QueryConnectionClientStateRequest, useInterfaces: boolean = true): Promise { + return queryService.connectionClientState(request, useInterfaces); + }, + connectionConsensusState(request: QueryConnectionConsensusStateRequest, useInterfaces: boolean = true): Promise { + return queryService.connectionConsensusState(request, useInterfaces); + }, + connectionParams(request?: QueryConnectionParamsRequest, useInterfaces: boolean = true): Promise { + return queryService.connectionParams(request, useInterfaces); + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/core/connection/v1/query.ts b/packages/types/protobuf/codegen/ibc/core/connection/v1/query.ts new file mode 100644 index 000000000..8d282869f --- /dev/null +++ b/packages/types/protobuf/codegen/ibc/core/connection/v1/query.ts @@ -0,0 +1,1390 @@ +//@ts-nocheck +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../../cosmos/base/query/v1beta1/pagination"; +import { ConnectionEnd, ConnectionEndAmino, ConnectionEndSDKType, IdentifiedConnection, IdentifiedConnectionAmino, IdentifiedConnectionSDKType } from "./connection"; +import { Height, HeightAmino, HeightSDKType, IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType, Params, ParamsAmino, ParamsSDKType } from "../../client/v1/client"; +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * QueryConnectionRequest is the request type for the Query/Connection RPC + * method + */ +export interface QueryConnectionRequest { + /** connection unique identifier */ + connectionId: string; +} +export interface QueryConnectionRequestProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryConnectionRequest"; + value: Uint8Array; +} +/** + * QueryConnectionRequest is the request type for the Query/Connection RPC + * method + */ +export interface QueryConnectionRequestAmino { + /** connection unique identifier */ + connection_id?: string; +} +export interface QueryConnectionRequestAminoMsg { + type: "cosmos-sdk/QueryConnectionRequest"; + value: QueryConnectionRequestAmino; +} +/** + * QueryConnectionRequest is the request type for the Query/Connection RPC + * method + */ +export interface QueryConnectionRequestSDKType { + connection_id: string; +} +/** + * QueryConnectionResponse is the response type for the Query/Connection RPC + * method. Besides the connection end, it includes a proof and the height from + * which the proof was retrieved. + */ +export interface QueryConnectionResponse { + /** connection associated with the request identifier */ + connection?: ConnectionEnd | undefined; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height | undefined; +} +export interface QueryConnectionResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryConnectionResponse"; + value: Uint8Array; +} +/** + * QueryConnectionResponse is the response type for the Query/Connection RPC + * method. Besides the connection end, it includes a proof and the height from + * which the proof was retrieved. + */ +export interface QueryConnectionResponseAmino { + /** connection associated with the request identifier */ + connection?: ConnectionEndAmino | undefined; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino | undefined; +} +export interface QueryConnectionResponseAminoMsg { + type: "cosmos-sdk/QueryConnectionResponse"; + value: QueryConnectionResponseAmino; +} +/** + * QueryConnectionResponse is the response type for the Query/Connection RPC + * method. Besides the connection end, it includes a proof and the height from + * which the proof was retrieved. + */ +export interface QueryConnectionResponseSDKType { + connection?: ConnectionEndSDKType | undefined; + proof: Uint8Array; + proof_height: HeightSDKType | undefined; +} +/** + * QueryConnectionsRequest is the request type for the Query/Connections RPC + * method + */ +export interface QueryConnectionsRequest { + pagination?: PageRequest | undefined; +} +export interface QueryConnectionsRequestProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryConnectionsRequest"; + value: Uint8Array; +} +/** + * QueryConnectionsRequest is the request type for the Query/Connections RPC + * method + */ +export interface QueryConnectionsRequestAmino { + pagination?: PageRequestAmino | undefined; +} +export interface QueryConnectionsRequestAminoMsg { + type: "cosmos-sdk/QueryConnectionsRequest"; + value: QueryConnectionsRequestAmino; +} +/** + * QueryConnectionsRequest is the request type for the Query/Connections RPC + * method + */ +export interface QueryConnectionsRequestSDKType { + pagination?: PageRequestSDKType | undefined; +} +/** + * QueryConnectionsResponse is the response type for the Query/Connections RPC + * method. + */ +export interface QueryConnectionsResponse { + /** list of stored connections of the chain. */ + connections: IdentifiedConnection[]; + /** pagination response */ + pagination?: PageResponse | undefined; + /** query block height */ + height: Height | undefined; +} +export interface QueryConnectionsResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryConnectionsResponse"; + value: Uint8Array; +} +/** + * QueryConnectionsResponse is the response type for the Query/Connections RPC + * method. + */ +export interface QueryConnectionsResponseAmino { + /** list of stored connections of the chain. */ + connections?: IdentifiedConnectionAmino[]; + /** pagination response */ + pagination?: PageResponseAmino | undefined; + /** query block height */ + height?: HeightAmino | undefined; +} +export interface QueryConnectionsResponseAminoMsg { + type: "cosmos-sdk/QueryConnectionsResponse"; + value: QueryConnectionsResponseAmino; +} +/** + * QueryConnectionsResponse is the response type for the Query/Connections RPC + * method. + */ +export interface QueryConnectionsResponseSDKType { + connections: IdentifiedConnectionSDKType[]; + pagination?: PageResponseSDKType | undefined; + height: HeightSDKType | undefined; +} +/** + * QueryClientConnectionsRequest is the request type for the + * Query/ClientConnections RPC method + */ +export interface QueryClientConnectionsRequest { + /** client identifier associated with a connection */ + clientId: string; +} +export interface QueryClientConnectionsRequestProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryClientConnectionsRequest"; + value: Uint8Array; +} +/** + * QueryClientConnectionsRequest is the request type for the + * Query/ClientConnections RPC method + */ +export interface QueryClientConnectionsRequestAmino { + /** client identifier associated with a connection */ + client_id?: string; +} +export interface QueryClientConnectionsRequestAminoMsg { + type: "cosmos-sdk/QueryClientConnectionsRequest"; + value: QueryClientConnectionsRequestAmino; +} +/** + * QueryClientConnectionsRequest is the request type for the + * Query/ClientConnections RPC method + */ +export interface QueryClientConnectionsRequestSDKType { + client_id: string; +} +/** + * QueryClientConnectionsResponse is the response type for the + * Query/ClientConnections RPC method + */ +export interface QueryClientConnectionsResponse { + /** slice of all the connection paths associated with a client. */ + connectionPaths: string[]; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was generated */ + proofHeight: Height | undefined; +} +export interface QueryClientConnectionsResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryClientConnectionsResponse"; + value: Uint8Array; +} +/** + * QueryClientConnectionsResponse is the response type for the + * Query/ClientConnections RPC method + */ +export interface QueryClientConnectionsResponseAmino { + /** slice of all the connection paths associated with a client. */ + connection_paths?: string[]; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was generated */ + proof_height?: HeightAmino | undefined; +} +export interface QueryClientConnectionsResponseAminoMsg { + type: "cosmos-sdk/QueryClientConnectionsResponse"; + value: QueryClientConnectionsResponseAmino; +} +/** + * QueryClientConnectionsResponse is the response type for the + * Query/ClientConnections RPC method + */ +export interface QueryClientConnectionsResponseSDKType { + connection_paths: string[]; + proof: Uint8Array; + proof_height: HeightSDKType | undefined; +} +/** + * QueryConnectionClientStateRequest is the request type for the + * Query/ConnectionClientState RPC method + */ +export interface QueryConnectionClientStateRequest { + /** connection identifier */ + connectionId: string; +} +export interface QueryConnectionClientStateRequestProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryConnectionClientStateRequest"; + value: Uint8Array; +} +/** + * QueryConnectionClientStateRequest is the request type for the + * Query/ConnectionClientState RPC method + */ +export interface QueryConnectionClientStateRequestAmino { + /** connection identifier */ + connection_id?: string; +} +export interface QueryConnectionClientStateRequestAminoMsg { + type: "cosmos-sdk/QueryConnectionClientStateRequest"; + value: QueryConnectionClientStateRequestAmino; +} +/** + * QueryConnectionClientStateRequest is the request type for the + * Query/ConnectionClientState RPC method + */ +export interface QueryConnectionClientStateRequestSDKType { + connection_id: string; +} +/** + * QueryConnectionClientStateResponse is the response type for the + * Query/ConnectionClientState RPC method + */ +export interface QueryConnectionClientStateResponse { + /** client state associated with the channel */ + identifiedClientState?: IdentifiedClientState | undefined; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height | undefined; +} +export interface QueryConnectionClientStateResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryConnectionClientStateResponse"; + value: Uint8Array; +} +/** + * QueryConnectionClientStateResponse is the response type for the + * Query/ConnectionClientState RPC method + */ +export interface QueryConnectionClientStateResponseAmino { + /** client state associated with the channel */ + identified_client_state?: IdentifiedClientStateAmino | undefined; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino | undefined; +} +export interface QueryConnectionClientStateResponseAminoMsg { + type: "cosmos-sdk/QueryConnectionClientStateResponse"; + value: QueryConnectionClientStateResponseAmino; +} +/** + * QueryConnectionClientStateResponse is the response type for the + * Query/ConnectionClientState RPC method + */ +export interface QueryConnectionClientStateResponseSDKType { + identified_client_state?: IdentifiedClientStateSDKType | undefined; + proof: Uint8Array; + proof_height: HeightSDKType | undefined; +} +/** + * QueryConnectionConsensusStateRequest is the request type for the + * Query/ConnectionConsensusState RPC method + */ +export interface QueryConnectionConsensusStateRequest { + /** connection identifier */ + connectionId: string; + revisionNumber: bigint; + revisionHeight: bigint; +} +export interface QueryConnectionConsensusStateRequestProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryConnectionConsensusStateRequest"; + value: Uint8Array; +} +/** + * QueryConnectionConsensusStateRequest is the request type for the + * Query/ConnectionConsensusState RPC method + */ +export interface QueryConnectionConsensusStateRequestAmino { + /** connection identifier */ + connection_id?: string; + revision_number?: string; + revision_height?: string; +} +export interface QueryConnectionConsensusStateRequestAminoMsg { + type: "cosmos-sdk/QueryConnectionConsensusStateRequest"; + value: QueryConnectionConsensusStateRequestAmino; +} +/** + * QueryConnectionConsensusStateRequest is the request type for the + * Query/ConnectionConsensusState RPC method + */ +export interface QueryConnectionConsensusStateRequestSDKType { + connection_id: string; + revision_number: bigint; + revision_height: bigint; +} +/** + * QueryConnectionConsensusStateResponse is the response type for the + * Query/ConnectionConsensusState RPC method + */ +export interface QueryConnectionConsensusStateResponse { + /** consensus state associated with the channel */ + consensusState?: Any | undefined; + /** client ID associated with the consensus state */ + clientId: string; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height | undefined; +} +export interface QueryConnectionConsensusStateResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryConnectionConsensusStateResponse"; + value: Uint8Array; +} +/** + * QueryConnectionConsensusStateResponse is the response type for the + * Query/ConnectionConsensusState RPC method + */ +export interface QueryConnectionConsensusStateResponseAmino { + /** consensus state associated with the channel */ + consensus_state?: AnyAmino | undefined; + /** client ID associated with the consensus state */ + client_id?: string; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino | undefined; +} +export interface QueryConnectionConsensusStateResponseAminoMsg { + type: "cosmos-sdk/QueryConnectionConsensusStateResponse"; + value: QueryConnectionConsensusStateResponseAmino; +} +/** + * QueryConnectionConsensusStateResponse is the response type for the + * Query/ConnectionConsensusState RPC method + */ +export interface QueryConnectionConsensusStateResponseSDKType { + consensus_state?: AnySDKType | undefined; + client_id: string; + proof: Uint8Array; + proof_height: HeightSDKType | undefined; +} +/** QueryConnectionParamsRequest is the request type for the Query/ConnectionParams RPC method. */ +export interface QueryConnectionParamsRequest {} +export interface QueryConnectionParamsRequestProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryConnectionParamsRequest"; + value: Uint8Array; +} +/** QueryConnectionParamsRequest is the request type for the Query/ConnectionParams RPC method. */ +export interface QueryConnectionParamsRequestAmino {} +export interface QueryConnectionParamsRequestAminoMsg { + type: "cosmos-sdk/QueryConnectionParamsRequest"; + value: QueryConnectionParamsRequestAmino; +} +/** QueryConnectionParamsRequest is the request type for the Query/ConnectionParams RPC method. */ +export interface QueryConnectionParamsRequestSDKType {} +/** QueryConnectionParamsResponse is the response type for the Query/ConnectionParams RPC method. */ +export interface QueryConnectionParamsResponse { + /** params defines the parameters of the module. */ + params?: Params | undefined; +} +export interface QueryConnectionParamsResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryConnectionParamsResponse"; + value: Uint8Array; +} +/** QueryConnectionParamsResponse is the response type for the Query/ConnectionParams RPC method. */ +export interface QueryConnectionParamsResponseAmino { + /** params defines the parameters of the module. */ + params?: ParamsAmino | undefined; +} +export interface QueryConnectionParamsResponseAminoMsg { + type: "cosmos-sdk/QueryConnectionParamsResponse"; + value: QueryConnectionParamsResponseAmino; +} +/** QueryConnectionParamsResponse is the response type for the Query/ConnectionParams RPC method. */ +export interface QueryConnectionParamsResponseSDKType { + params?: ParamsSDKType | undefined; +} +function createBaseQueryConnectionRequest(): QueryConnectionRequest { + return { + connectionId: "" + }; +} +export const QueryConnectionRequest = { + typeUrl: "/ibc.core.connection.v1.QueryConnectionRequest", + encode(message: QueryConnectionRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryConnectionRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConnectionRequest { + const message = createBaseQueryConnectionRequest(); + message.connectionId = object.connectionId ?? ""; + return message; + }, + fromAmino(object: QueryConnectionRequestAmino): QueryConnectionRequest { + const message = createBaseQueryConnectionRequest(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + return message; + }, + toAmino(message: QueryConnectionRequest, useInterfaces: boolean = false): QueryConnectionRequestAmino { + const obj: any = {}; + obj.connection_id = message.connectionId; + return obj; + }, + fromAminoMsg(object: QueryConnectionRequestAminoMsg): QueryConnectionRequest { + return QueryConnectionRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryConnectionRequest, useInterfaces: boolean = false): QueryConnectionRequestAminoMsg { + return { + type: "cosmos-sdk/QueryConnectionRequest", + value: QueryConnectionRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryConnectionRequestProtoMsg, useInterfaces: boolean = false): QueryConnectionRequest { + return QueryConnectionRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryConnectionRequest): Uint8Array { + return QueryConnectionRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryConnectionRequest): QueryConnectionRequestProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryConnectionRequest", + value: QueryConnectionRequest.encode(message).finish() + }; + } +}; +function createBaseQueryConnectionResponse(): QueryConnectionResponse { + return { + connection: undefined, + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryConnectionResponse = { + typeUrl: "/ibc.core.connection.v1.QueryConnectionResponse", + encode(message: QueryConnectionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.connection !== undefined) { + ConnectionEnd.encode(message.connection, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryConnectionResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connection = ConnectionEnd.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConnectionResponse { + const message = createBaseQueryConnectionResponse(); + message.connection = object.connection !== undefined && object.connection !== null ? ConnectionEnd.fromPartial(object.connection) : undefined; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryConnectionResponseAmino): QueryConnectionResponse { + const message = createBaseQueryConnectionResponse(); + if (object.connection !== undefined && object.connection !== null) { + message.connection = ConnectionEnd.fromAmino(object.connection); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryConnectionResponse, useInterfaces: boolean = false): QueryConnectionResponseAmino { + const obj: any = {}; + obj.connection = message.connection ? ConnectionEnd.toAmino(message.connection, useInterfaces) : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight, useInterfaces) : {}; + return obj; + }, + fromAminoMsg(object: QueryConnectionResponseAminoMsg): QueryConnectionResponse { + return QueryConnectionResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryConnectionResponse, useInterfaces: boolean = false): QueryConnectionResponseAminoMsg { + return { + type: "cosmos-sdk/QueryConnectionResponse", + value: QueryConnectionResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryConnectionResponseProtoMsg, useInterfaces: boolean = false): QueryConnectionResponse { + return QueryConnectionResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryConnectionResponse): Uint8Array { + return QueryConnectionResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryConnectionResponse): QueryConnectionResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryConnectionResponse", + value: QueryConnectionResponse.encode(message).finish() + }; + } +}; +function createBaseQueryConnectionsRequest(): QueryConnectionsRequest { + return { + pagination: undefined + }; +} +export const QueryConnectionsRequest = { + typeUrl: "/ibc.core.connection.v1.QueryConnectionsRequest", + encode(message: QueryConnectionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryConnectionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConnectionsRequest { + const message = createBaseQueryConnectionsRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryConnectionsRequestAmino): QueryConnectionsRequest { + const message = createBaseQueryConnectionsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryConnectionsRequest, useInterfaces: boolean = false): QueryConnectionsRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryConnectionsRequestAminoMsg): QueryConnectionsRequest { + return QueryConnectionsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryConnectionsRequest, useInterfaces: boolean = false): QueryConnectionsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryConnectionsRequest", + value: QueryConnectionsRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryConnectionsRequestProtoMsg, useInterfaces: boolean = false): QueryConnectionsRequest { + return QueryConnectionsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryConnectionsRequest): Uint8Array { + return QueryConnectionsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryConnectionsRequest): QueryConnectionsRequestProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryConnectionsRequest", + value: QueryConnectionsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryConnectionsResponse(): QueryConnectionsResponse { + return { + connections: [], + pagination: undefined, + height: Height.fromPartial({}) + }; +} +export const QueryConnectionsResponse = { + typeUrl: "/ibc.core.connection.v1.QueryConnectionsResponse", + encode(message: QueryConnectionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.connections) { + IdentifiedConnection.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryConnectionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connections.push(IdentifiedConnection.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.height = Height.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConnectionsResponse { + const message = createBaseQueryConnectionsResponse(); + message.connections = object.connections?.map(e => IdentifiedConnection.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + message.height = object.height !== undefined && object.height !== null ? Height.fromPartial(object.height) : undefined; + return message; + }, + fromAmino(object: QueryConnectionsResponseAmino): QueryConnectionsResponse { + const message = createBaseQueryConnectionsResponse(); + message.connections = object.connections?.map(e => IdentifiedConnection.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + return message; + }, + toAmino(message: QueryConnectionsResponse, useInterfaces: boolean = false): QueryConnectionsResponseAmino { + const obj: any = {}; + if (message.connections) { + obj.connections = message.connections.map(e => e ? IdentifiedConnection.toAmino(e, useInterfaces) : undefined); + } else { + obj.connections = []; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination, useInterfaces) : undefined; + obj.height = message.height ? Height.toAmino(message.height, useInterfaces) : {}; + return obj; + }, + fromAminoMsg(object: QueryConnectionsResponseAminoMsg): QueryConnectionsResponse { + return QueryConnectionsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryConnectionsResponse, useInterfaces: boolean = false): QueryConnectionsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryConnectionsResponse", + value: QueryConnectionsResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryConnectionsResponseProtoMsg, useInterfaces: boolean = false): QueryConnectionsResponse { + return QueryConnectionsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryConnectionsResponse): Uint8Array { + return QueryConnectionsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryConnectionsResponse): QueryConnectionsResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryConnectionsResponse", + value: QueryConnectionsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryClientConnectionsRequest(): QueryClientConnectionsRequest { + return { + clientId: "" + }; +} +export const QueryClientConnectionsRequest = { + typeUrl: "/ibc.core.connection.v1.QueryClientConnectionsRequest", + encode(message: QueryClientConnectionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryClientConnectionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientConnectionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClientConnectionsRequest { + const message = createBaseQueryClientConnectionsRequest(); + message.clientId = object.clientId ?? ""; + return message; + }, + fromAmino(object: QueryClientConnectionsRequestAmino): QueryClientConnectionsRequest { + const message = createBaseQueryClientConnectionsRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + return message; + }, + toAmino(message: QueryClientConnectionsRequest, useInterfaces: boolean = false): QueryClientConnectionsRequestAmino { + const obj: any = {}; + obj.client_id = message.clientId; + return obj; + }, + fromAminoMsg(object: QueryClientConnectionsRequestAminoMsg): QueryClientConnectionsRequest { + return QueryClientConnectionsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryClientConnectionsRequest, useInterfaces: boolean = false): QueryClientConnectionsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryClientConnectionsRequest", + value: QueryClientConnectionsRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryClientConnectionsRequestProtoMsg, useInterfaces: boolean = false): QueryClientConnectionsRequest { + return QueryClientConnectionsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryClientConnectionsRequest): Uint8Array { + return QueryClientConnectionsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryClientConnectionsRequest): QueryClientConnectionsRequestProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryClientConnectionsRequest", + value: QueryClientConnectionsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryClientConnectionsResponse(): QueryClientConnectionsResponse { + return { + connectionPaths: [], + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryClientConnectionsResponse = { + typeUrl: "/ibc.core.connection.v1.QueryClientConnectionsResponse", + encode(message: QueryClientConnectionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.connectionPaths) { + writer.uint32(10).string(v!); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryClientConnectionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClientConnectionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionPaths.push(reader.string()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClientConnectionsResponse { + const message = createBaseQueryClientConnectionsResponse(); + message.connectionPaths = object.connectionPaths?.map(e => e) || []; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryClientConnectionsResponseAmino): QueryClientConnectionsResponse { + const message = createBaseQueryClientConnectionsResponse(); + message.connectionPaths = object.connection_paths?.map(e => e) || []; + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryClientConnectionsResponse, useInterfaces: boolean = false): QueryClientConnectionsResponseAmino { + const obj: any = {}; + if (message.connectionPaths) { + obj.connection_paths = message.connectionPaths.map(e => e); + } else { + obj.connection_paths = []; + } + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight, useInterfaces) : {}; + return obj; + }, + fromAminoMsg(object: QueryClientConnectionsResponseAminoMsg): QueryClientConnectionsResponse { + return QueryClientConnectionsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryClientConnectionsResponse, useInterfaces: boolean = false): QueryClientConnectionsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryClientConnectionsResponse", + value: QueryClientConnectionsResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryClientConnectionsResponseProtoMsg, useInterfaces: boolean = false): QueryClientConnectionsResponse { + return QueryClientConnectionsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryClientConnectionsResponse): Uint8Array { + return QueryClientConnectionsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryClientConnectionsResponse): QueryClientConnectionsResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryClientConnectionsResponse", + value: QueryClientConnectionsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryConnectionClientStateRequest(): QueryConnectionClientStateRequest { + return { + connectionId: "" + }; +} +export const QueryConnectionClientStateRequest = { + typeUrl: "/ibc.core.connection.v1.QueryConnectionClientStateRequest", + encode(message: QueryConnectionClientStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryConnectionClientStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionClientStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConnectionClientStateRequest { + const message = createBaseQueryConnectionClientStateRequest(); + message.connectionId = object.connectionId ?? ""; + return message; + }, + fromAmino(object: QueryConnectionClientStateRequestAmino): QueryConnectionClientStateRequest { + const message = createBaseQueryConnectionClientStateRequest(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + return message; + }, + toAmino(message: QueryConnectionClientStateRequest, useInterfaces: boolean = false): QueryConnectionClientStateRequestAmino { + const obj: any = {}; + obj.connection_id = message.connectionId; + return obj; + }, + fromAminoMsg(object: QueryConnectionClientStateRequestAminoMsg): QueryConnectionClientStateRequest { + return QueryConnectionClientStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryConnectionClientStateRequest, useInterfaces: boolean = false): QueryConnectionClientStateRequestAminoMsg { + return { + type: "cosmos-sdk/QueryConnectionClientStateRequest", + value: QueryConnectionClientStateRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryConnectionClientStateRequestProtoMsg, useInterfaces: boolean = false): QueryConnectionClientStateRequest { + return QueryConnectionClientStateRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryConnectionClientStateRequest): Uint8Array { + return QueryConnectionClientStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryConnectionClientStateRequest): QueryConnectionClientStateRequestProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryConnectionClientStateRequest", + value: QueryConnectionClientStateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryConnectionClientStateResponse(): QueryConnectionClientStateResponse { + return { + identifiedClientState: undefined, + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryConnectionClientStateResponse = { + typeUrl: "/ibc.core.connection.v1.QueryConnectionClientStateResponse", + encode(message: QueryConnectionClientStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.identifiedClientState !== undefined) { + IdentifiedClientState.encode(message.identifiedClientState, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryConnectionClientStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionClientStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifiedClientState = IdentifiedClientState.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConnectionClientStateResponse { + const message = createBaseQueryConnectionClientStateResponse(); + message.identifiedClientState = object.identifiedClientState !== undefined && object.identifiedClientState !== null ? IdentifiedClientState.fromPartial(object.identifiedClientState) : undefined; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryConnectionClientStateResponseAmino): QueryConnectionClientStateResponse { + const message = createBaseQueryConnectionClientStateResponse(); + if (object.identified_client_state !== undefined && object.identified_client_state !== null) { + message.identifiedClientState = IdentifiedClientState.fromAmino(object.identified_client_state); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryConnectionClientStateResponse, useInterfaces: boolean = false): QueryConnectionClientStateResponseAmino { + const obj: any = {}; + obj.identified_client_state = message.identifiedClientState ? IdentifiedClientState.toAmino(message.identifiedClientState, useInterfaces) : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight, useInterfaces) : {}; + return obj; + }, + fromAminoMsg(object: QueryConnectionClientStateResponseAminoMsg): QueryConnectionClientStateResponse { + return QueryConnectionClientStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryConnectionClientStateResponse, useInterfaces: boolean = false): QueryConnectionClientStateResponseAminoMsg { + return { + type: "cosmos-sdk/QueryConnectionClientStateResponse", + value: QueryConnectionClientStateResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryConnectionClientStateResponseProtoMsg, useInterfaces: boolean = false): QueryConnectionClientStateResponse { + return QueryConnectionClientStateResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryConnectionClientStateResponse): Uint8Array { + return QueryConnectionClientStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryConnectionClientStateResponse): QueryConnectionClientStateResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryConnectionClientStateResponse", + value: QueryConnectionClientStateResponse.encode(message).finish() + }; + } +}; +function createBaseQueryConnectionConsensusStateRequest(): QueryConnectionConsensusStateRequest { + return { + connectionId: "", + revisionNumber: BigInt(0), + revisionHeight: BigInt(0) + }; +} +export const QueryConnectionConsensusStateRequest = { + typeUrl: "/ibc.core.connection.v1.QueryConnectionConsensusStateRequest", + encode(message: QueryConnectionConsensusStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + if (message.revisionNumber !== BigInt(0)) { + writer.uint32(16).uint64(message.revisionNumber); + } + if (message.revisionHeight !== BigInt(0)) { + writer.uint32(24).uint64(message.revisionHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryConnectionConsensusStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionConsensusStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + message.revisionNumber = reader.uint64(); + break; + case 3: + message.revisionHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConnectionConsensusStateRequest { + const message = createBaseQueryConnectionConsensusStateRequest(); + message.connectionId = object.connectionId ?? ""; + message.revisionNumber = object.revisionNumber !== undefined && object.revisionNumber !== null ? BigInt(object.revisionNumber.toString()) : BigInt(0); + message.revisionHeight = object.revisionHeight !== undefined && object.revisionHeight !== null ? BigInt(object.revisionHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryConnectionConsensusStateRequestAmino): QueryConnectionConsensusStateRequest { + const message = createBaseQueryConnectionConsensusStateRequest(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.revision_number !== undefined && object.revision_number !== null) { + message.revisionNumber = BigInt(object.revision_number); + } + if (object.revision_height !== undefined && object.revision_height !== null) { + message.revisionHeight = BigInt(object.revision_height); + } + return message; + }, + toAmino(message: QueryConnectionConsensusStateRequest, useInterfaces: boolean = false): QueryConnectionConsensusStateRequestAmino { + const obj: any = {}; + obj.connection_id = message.connectionId; + obj.revision_number = message.revisionNumber ? message.revisionNumber.toString() : undefined; + obj.revision_height = message.revisionHeight ? message.revisionHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryConnectionConsensusStateRequestAminoMsg): QueryConnectionConsensusStateRequest { + return QueryConnectionConsensusStateRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryConnectionConsensusStateRequest, useInterfaces: boolean = false): QueryConnectionConsensusStateRequestAminoMsg { + return { + type: "cosmos-sdk/QueryConnectionConsensusStateRequest", + value: QueryConnectionConsensusStateRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryConnectionConsensusStateRequestProtoMsg, useInterfaces: boolean = false): QueryConnectionConsensusStateRequest { + return QueryConnectionConsensusStateRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryConnectionConsensusStateRequest): Uint8Array { + return QueryConnectionConsensusStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryConnectionConsensusStateRequest): QueryConnectionConsensusStateRequestProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryConnectionConsensusStateRequest", + value: QueryConnectionConsensusStateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryConnectionConsensusStateResponse(): QueryConnectionConsensusStateResponse { + return { + consensusState: undefined, + clientId: "", + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryConnectionConsensusStateResponse = { + typeUrl: "/ibc.core.connection.v1.QueryConnectionConsensusStateResponse", + encode(message: QueryConnectionConsensusStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim(); + } + if (message.clientId !== "") { + writer.uint32(18).string(message.clientId); + } + if (message.proof.length !== 0) { + writer.uint32(26).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryConnectionConsensusStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionConsensusStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusState = Any.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.clientId = reader.string(); + break; + case 3: + message.proof = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConnectionConsensusStateResponse { + const message = createBaseQueryConnectionConsensusStateResponse(); + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; + message.clientId = object.clientId ?? ""; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryConnectionConsensusStateResponseAmino): QueryConnectionConsensusStateResponse { + const message = createBaseQueryConnectionConsensusStateResponse(); + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryConnectionConsensusStateResponse, useInterfaces: boolean = false): QueryConnectionConsensusStateResponseAmino { + const obj: any = {}; + obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState, useInterfaces) : undefined; + obj.client_id = message.clientId; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight, useInterfaces) : {}; + return obj; + }, + fromAminoMsg(object: QueryConnectionConsensusStateResponseAminoMsg): QueryConnectionConsensusStateResponse { + return QueryConnectionConsensusStateResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryConnectionConsensusStateResponse, useInterfaces: boolean = false): QueryConnectionConsensusStateResponseAminoMsg { + return { + type: "cosmos-sdk/QueryConnectionConsensusStateResponse", + value: QueryConnectionConsensusStateResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryConnectionConsensusStateResponseProtoMsg, useInterfaces: boolean = false): QueryConnectionConsensusStateResponse { + return QueryConnectionConsensusStateResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryConnectionConsensusStateResponse): Uint8Array { + return QueryConnectionConsensusStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryConnectionConsensusStateResponse): QueryConnectionConsensusStateResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryConnectionConsensusStateResponse", + value: QueryConnectionConsensusStateResponse.encode(message).finish() + }; + } +}; +function createBaseQueryConnectionParamsRequest(): QueryConnectionParamsRequest { + return {}; +} +export const QueryConnectionParamsRequest = { + typeUrl: "/ibc.core.connection.v1.QueryConnectionParamsRequest", + encode(_: QueryConnectionParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryConnectionParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryConnectionParamsRequest { + const message = createBaseQueryConnectionParamsRequest(); + return message; + }, + fromAmino(_: QueryConnectionParamsRequestAmino): QueryConnectionParamsRequest { + const message = createBaseQueryConnectionParamsRequest(); + return message; + }, + toAmino(_: QueryConnectionParamsRequest, useInterfaces: boolean = false): QueryConnectionParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryConnectionParamsRequestAminoMsg): QueryConnectionParamsRequest { + return QueryConnectionParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryConnectionParamsRequest, useInterfaces: boolean = false): QueryConnectionParamsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryConnectionParamsRequest", + value: QueryConnectionParamsRequest.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryConnectionParamsRequestProtoMsg, useInterfaces: boolean = false): QueryConnectionParamsRequest { + return QueryConnectionParamsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryConnectionParamsRequest): Uint8Array { + return QueryConnectionParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryConnectionParamsRequest): QueryConnectionParamsRequestProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryConnectionParamsRequest", + value: QueryConnectionParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryConnectionParamsResponse(): QueryConnectionParamsResponse { + return { + params: undefined + }; +} +export const QueryConnectionParamsResponse = { + typeUrl: "/ibc.core.connection.v1.QueryConnectionParamsResponse", + encode(message: QueryConnectionParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryConnectionParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConnectionParamsResponse { + const message = createBaseQueryConnectionParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryConnectionParamsResponseAmino): QueryConnectionParamsResponse { + const message = createBaseQueryConnectionParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryConnectionParamsResponse, useInterfaces: boolean = false): QueryConnectionParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryConnectionParamsResponseAminoMsg): QueryConnectionParamsResponse { + return QueryConnectionParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryConnectionParamsResponse, useInterfaces: boolean = false): QueryConnectionParamsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryConnectionParamsResponse", + value: QueryConnectionParamsResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: QueryConnectionParamsResponseProtoMsg, useInterfaces: boolean = false): QueryConnectionParamsResponse { + return QueryConnectionParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryConnectionParamsResponse): Uint8Array { + return QueryConnectionParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryConnectionParamsResponse): QueryConnectionParamsResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryConnectionParamsResponse", + value: QueryConnectionParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/core/connection/v1/tx.amino.ts b/packages/types/protobuf/codegen/ibc/core/connection/v1/tx.amino.ts new file mode 100644 index 000000000..719f737c2 --- /dev/null +++ b/packages/types/protobuf/codegen/ibc/core/connection/v1/tx.amino.ts @@ -0,0 +1,28 @@ +import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; +export const AminoConverter = { + "/ibc.core.connection.v1.MsgConnectionOpenInit": { + aminoType: "cosmos-sdk/MsgConnectionOpenInit", + toAmino: MsgConnectionOpenInit.toAmino, + fromAmino: MsgConnectionOpenInit.fromAmino + }, + "/ibc.core.connection.v1.MsgConnectionOpenTry": { + aminoType: "cosmos-sdk/MsgConnectionOpenTry", + toAmino: MsgConnectionOpenTry.toAmino, + fromAmino: MsgConnectionOpenTry.fromAmino + }, + "/ibc.core.connection.v1.MsgConnectionOpenAck": { + aminoType: "cosmos-sdk/MsgConnectionOpenAck", + toAmino: MsgConnectionOpenAck.toAmino, + fromAmino: MsgConnectionOpenAck.fromAmino + }, + "/ibc.core.connection.v1.MsgConnectionOpenConfirm": { + aminoType: "cosmos-sdk/MsgConnectionOpenConfirm", + toAmino: MsgConnectionOpenConfirm.toAmino, + fromAmino: MsgConnectionOpenConfirm.fromAmino + }, + "/ibc.core.connection.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/core/connection/v1/tx.registry.ts b/packages/types/protobuf/codegen/ibc/core/connection/v1/tx.registry.ts new file mode 100644 index 000000000..29451ea3d --- /dev/null +++ b/packages/types/protobuf/codegen/ibc/core/connection/v1/tx.registry.ts @@ -0,0 +1,107 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.connection.v1.MsgConnectionOpenInit", MsgConnectionOpenInit], ["/ibc.core.connection.v1.MsgConnectionOpenTry", MsgConnectionOpenTry], ["/ibc.core.connection.v1.MsgConnectionOpenAck", MsgConnectionOpenAck], ["/ibc.core.connection.v1.MsgConnectionOpenConfirm", MsgConnectionOpenConfirm], ["/ibc.core.connection.v1.MsgUpdateParams", MsgUpdateParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + connectionOpenInit(value: MsgConnectionOpenInit) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit", + value: MsgConnectionOpenInit.encode(value).finish() + }; + }, + connectionOpenTry(value: MsgConnectionOpenTry) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry", + value: MsgConnectionOpenTry.encode(value).finish() + }; + }, + connectionOpenAck(value: MsgConnectionOpenAck) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck", + value: MsgConnectionOpenAck.encode(value).finish() + }; + }, + connectionOpenConfirm(value: MsgConnectionOpenConfirm) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", + value: MsgConnectionOpenConfirm.encode(value).finish() + }; + }, + updateConnectionParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + connectionOpenInit(value: MsgConnectionOpenInit) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit", + value + }; + }, + connectionOpenTry(value: MsgConnectionOpenTry) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry", + value + }; + }, + connectionOpenAck(value: MsgConnectionOpenAck) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck", + value + }; + }, + connectionOpenConfirm(value: MsgConnectionOpenConfirm) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", + value + }; + }, + updateConnectionParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + value + }; + } + }, + fromPartial: { + connectionOpenInit(value: MsgConnectionOpenInit) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit", + value: MsgConnectionOpenInit.fromPartial(value) + }; + }, + connectionOpenTry(value: MsgConnectionOpenTry) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry", + value: MsgConnectionOpenTry.fromPartial(value) + }; + }, + connectionOpenAck(value: MsgConnectionOpenAck) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck", + value: MsgConnectionOpenAck.fromPartial(value) + }; + }, + connectionOpenConfirm(value: MsgConnectionOpenConfirm) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", + value: MsgConnectionOpenConfirm.fromPartial(value) + }; + }, + updateConnectionParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/core/connection/v1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/ibc/core/connection/v1/tx.rpc.msg.ts new file mode 100644 index 000000000..1f9837686 --- /dev/null +++ b/packages/types/protobuf/codegen/ibc/core/connection/v1/tx.rpc.msg.ts @@ -0,0 +1,58 @@ +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { MsgConnectionOpenInit, MsgConnectionOpenInitResponse, MsgConnectionOpenTry, MsgConnectionOpenTryResponse, MsgConnectionOpenAck, MsgConnectionOpenAckResponse, MsgConnectionOpenConfirm, MsgConnectionOpenConfirmResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; +/** Msg defines the ibc/connection Msg service. */ +export interface Msg { + /** ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. */ + connectionOpenInit(request: MsgConnectionOpenInit): Promise; + /** ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. */ + connectionOpenTry(request: MsgConnectionOpenTry): Promise; + /** ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. */ + connectionOpenAck(request: MsgConnectionOpenAck): Promise; + /** + * ConnectionOpenConfirm defines a rpc handler method for + * MsgConnectionOpenConfirm. + */ + connectionOpenConfirm(request: MsgConnectionOpenConfirm): Promise; + /** + * UpdateConnectionParams defines a rpc handler method for + * MsgUpdateParams. + */ + updateConnectionParams(request: MsgUpdateParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.connectionOpenInit = this.connectionOpenInit.bind(this); + this.connectionOpenTry = this.connectionOpenTry.bind(this); + this.connectionOpenAck = this.connectionOpenAck.bind(this); + this.connectionOpenConfirm = this.connectionOpenConfirm.bind(this); + this.updateConnectionParams = this.updateConnectionParams.bind(this); + } + connectionOpenInit(request: MsgConnectionOpenInit, useInterfaces: boolean = true): Promise { + const data = MsgConnectionOpenInit.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenInit", data); + return promise.then(data => MsgConnectionOpenInitResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + connectionOpenTry(request: MsgConnectionOpenTry, useInterfaces: boolean = true): Promise { + const data = MsgConnectionOpenTry.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenTry", data); + return promise.then(data => MsgConnectionOpenTryResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + connectionOpenAck(request: MsgConnectionOpenAck, useInterfaces: boolean = true): Promise { + const data = MsgConnectionOpenAck.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenAck", data); + return promise.then(data => MsgConnectionOpenAckResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + connectionOpenConfirm(request: MsgConnectionOpenConfirm, useInterfaces: boolean = true): Promise { + const data = MsgConnectionOpenConfirm.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenConfirm", data); + return promise.then(data => MsgConnectionOpenConfirmResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + updateConnectionParams(request: MsgUpdateParams, useInterfaces: boolean = true): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Msg", "UpdateConnectionParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/core/connection/v1/tx.ts b/packages/types/protobuf/codegen/ibc/core/connection/v1/tx.ts new file mode 100644 index 000000000..35fb9938f --- /dev/null +++ b/packages/types/protobuf/codegen/ibc/core/connection/v1/tx.ts @@ -0,0 +1,1354 @@ +//@ts-nocheck +import { Counterparty, CounterpartyAmino, CounterpartySDKType, Version, VersionAmino, VersionSDKType } from "./connection"; +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { Height, HeightAmino, HeightSDKType, Params, ParamsAmino, ParamsSDKType } from "../../client/v1/client"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * MsgConnectionOpenInit defines the msg sent by an account on Chain A to + * initialize a connection with Chain B. + */ +export interface MsgConnectionOpenInit { + clientId: string; + counterparty: Counterparty | undefined; + version?: Version | undefined; + delayPeriod: bigint; + signer: string; +} +export interface MsgConnectionOpenInitProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit"; + value: Uint8Array; +} +/** + * MsgConnectionOpenInit defines the msg sent by an account on Chain A to + * initialize a connection with Chain B. + */ +export interface MsgConnectionOpenInitAmino { + client_id?: string; + counterparty?: CounterpartyAmino | undefined; + version?: VersionAmino | undefined; + delay_period?: string; + signer?: string; +} +export interface MsgConnectionOpenInitAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenInit"; + value: MsgConnectionOpenInitAmino; +} +/** + * MsgConnectionOpenInit defines the msg sent by an account on Chain A to + * initialize a connection with Chain B. + */ +export interface MsgConnectionOpenInitSDKType { + client_id: string; + counterparty: CounterpartySDKType | undefined; + version?: VersionSDKType | undefined; + delay_period: bigint; + signer: string; +} +/** + * MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response + * type. + */ +export interface MsgConnectionOpenInitResponse {} +export interface MsgConnectionOpenInitResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInitResponse"; + value: Uint8Array; +} +/** + * MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response + * type. + */ +export interface MsgConnectionOpenInitResponseAmino {} +export interface MsgConnectionOpenInitResponseAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenInitResponse"; + value: MsgConnectionOpenInitResponseAmino; +} +/** + * MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response + * type. + */ +export interface MsgConnectionOpenInitResponseSDKType {} +/** + * MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a + * connection on Chain B. + */ +export interface MsgConnectionOpenTry { + clientId: string; + /** Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. */ + /** @deprecated */ + previousConnectionId: string; + clientState?: Any | undefined; + counterparty: Counterparty | undefined; + delayPeriod: bigint; + counterpartyVersions: Version[]; + proofHeight: Height | undefined; + /** + * proof of the initialization the connection on Chain A: `UNITIALIZED -> + * INIT` + */ + proofInit: Uint8Array; + /** proof of client state included in message */ + proofClient: Uint8Array; + /** proof of client consensus state */ + proofConsensus: Uint8Array; + consensusHeight: Height | undefined; + signer: string; + /** optional proof data for host state machines that are unable to introspect their own consensus state */ + hostConsensusStateProof: Uint8Array; +} +export interface MsgConnectionOpenTryProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry"; + value: Uint8Array; +} +/** + * MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a + * connection on Chain B. + */ +export interface MsgConnectionOpenTryAmino { + client_id?: string; + /** Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. */ + /** @deprecated */ + previous_connection_id?: string; + client_state?: AnyAmino | undefined; + counterparty?: CounterpartyAmino | undefined; + delay_period?: string; + counterparty_versions?: VersionAmino[]; + proof_height?: HeightAmino | undefined; + /** + * proof of the initialization the connection on Chain A: `UNITIALIZED -> + * INIT` + */ + proof_init?: string; + /** proof of client state included in message */ + proof_client?: string; + /** proof of client consensus state */ + proof_consensus?: string; + consensus_height?: HeightAmino | undefined; + signer?: string; + /** optional proof data for host state machines that are unable to introspect their own consensus state */ + host_consensus_state_proof?: string; +} +export interface MsgConnectionOpenTryAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenTry"; + value: MsgConnectionOpenTryAmino; +} +/** + * MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a + * connection on Chain B. + */ +export interface MsgConnectionOpenTrySDKType { + client_id: string; + /** @deprecated */ + previous_connection_id: string; + client_state?: AnySDKType | undefined; + counterparty: CounterpartySDKType | undefined; + delay_period: bigint; + counterparty_versions: VersionSDKType[]; + proof_height: HeightSDKType | undefined; + proof_init: Uint8Array; + proof_client: Uint8Array; + proof_consensus: Uint8Array; + consensus_height: HeightSDKType | undefined; + signer: string; + host_consensus_state_proof: Uint8Array; +} +/** MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. */ +export interface MsgConnectionOpenTryResponse {} +export interface MsgConnectionOpenTryResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTryResponse"; + value: Uint8Array; +} +/** MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. */ +export interface MsgConnectionOpenTryResponseAmino {} +export interface MsgConnectionOpenTryResponseAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenTryResponse"; + value: MsgConnectionOpenTryResponseAmino; +} +/** MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. */ +export interface MsgConnectionOpenTryResponseSDKType {} +/** + * MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to + * acknowledge the change of connection state to TRYOPEN on Chain B. + */ +export interface MsgConnectionOpenAck { + connectionId: string; + counterpartyConnectionId: string; + version?: Version | undefined; + clientState?: Any | undefined; + proofHeight: Height | undefined; + /** + * proof of the initialization the connection on Chain B: `UNITIALIZED -> + * TRYOPEN` + */ + proofTry: Uint8Array; + /** proof of client state included in message */ + proofClient: Uint8Array; + /** proof of client consensus state */ + proofConsensus: Uint8Array; + consensusHeight: Height | undefined; + signer: string; + /** optional proof data for host state machines that are unable to introspect their own consensus state */ + hostConsensusStateProof: Uint8Array; +} +export interface MsgConnectionOpenAckProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck"; + value: Uint8Array; +} +/** + * MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to + * acknowledge the change of connection state to TRYOPEN on Chain B. + */ +export interface MsgConnectionOpenAckAmino { + connection_id?: string; + counterparty_connection_id?: string; + version?: VersionAmino | undefined; + client_state?: AnyAmino | undefined; + proof_height?: HeightAmino | undefined; + /** + * proof of the initialization the connection on Chain B: `UNITIALIZED -> + * TRYOPEN` + */ + proof_try?: string; + /** proof of client state included in message */ + proof_client?: string; + /** proof of client consensus state */ + proof_consensus?: string; + consensus_height?: HeightAmino | undefined; + signer?: string; + /** optional proof data for host state machines that are unable to introspect their own consensus state */ + host_consensus_state_proof?: string; +} +export interface MsgConnectionOpenAckAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenAck"; + value: MsgConnectionOpenAckAmino; +} +/** + * MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to + * acknowledge the change of connection state to TRYOPEN on Chain B. + */ +export interface MsgConnectionOpenAckSDKType { + connection_id: string; + counterparty_connection_id: string; + version?: VersionSDKType | undefined; + client_state?: AnySDKType | undefined; + proof_height: HeightSDKType | undefined; + proof_try: Uint8Array; + proof_client: Uint8Array; + proof_consensus: Uint8Array; + consensus_height: HeightSDKType | undefined; + signer: string; + host_consensus_state_proof: Uint8Array; +} +/** MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. */ +export interface MsgConnectionOpenAckResponse {} +export interface MsgConnectionOpenAckResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAckResponse"; + value: Uint8Array; +} +/** MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. */ +export interface MsgConnectionOpenAckResponseAmino {} +export interface MsgConnectionOpenAckResponseAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenAckResponse"; + value: MsgConnectionOpenAckResponseAmino; +} +/** MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. */ +export interface MsgConnectionOpenAckResponseSDKType {} +/** + * MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of connection state to OPEN on Chain A. + */ +export interface MsgConnectionOpenConfirm { + connectionId: string; + /** proof for the change of the connection state on Chain A: `INIT -> OPEN` */ + proofAck: Uint8Array; + proofHeight: Height | undefined; + signer: string; +} +export interface MsgConnectionOpenConfirmProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm"; + value: Uint8Array; +} +/** + * MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of connection state to OPEN on Chain A. + */ +export interface MsgConnectionOpenConfirmAmino { + connection_id?: string; + /** proof for the change of the connection state on Chain A: `INIT -> OPEN` */ + proof_ack?: string; + proof_height?: HeightAmino | undefined; + signer?: string; +} +export interface MsgConnectionOpenConfirmAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenConfirm"; + value: MsgConnectionOpenConfirmAmino; +} +/** + * MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of connection state to OPEN on Chain A. + */ +export interface MsgConnectionOpenConfirmSDKType { + connection_id: string; + proof_ack: Uint8Array; + proof_height: HeightSDKType | undefined; + signer: string; +} +/** + * MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm + * response type. + */ +export interface MsgConnectionOpenConfirmResponse {} +export interface MsgConnectionOpenConfirmResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse"; + value: Uint8Array; +} +/** + * MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm + * response type. + */ +export interface MsgConnectionOpenConfirmResponseAmino {} +export interface MsgConnectionOpenConfirmResponseAminoMsg { + type: "cosmos-sdk/MsgConnectionOpenConfirmResponse"; + value: MsgConnectionOpenConfirmResponseAmino; +} +/** + * MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm + * response type. + */ +export interface MsgConnectionOpenConfirmResponseSDKType {} +/** MsgUpdateParams defines the sdk.Msg type to update the connection parameters. */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the connection parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params | undefined; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams defines the sdk.Msg type to update the connection parameters. */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the connection parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino | undefined; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams defines the sdk.Msg type to update the connection parameters. */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType | undefined; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseSDKType {} +function createBaseMsgConnectionOpenInit(): MsgConnectionOpenInit { + return { + clientId: "", + counterparty: Counterparty.fromPartial({}), + version: undefined, + delayPeriod: BigInt(0), + signer: "" + }; +} +export const MsgConnectionOpenInit = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit", + encode(message: MsgConnectionOpenInit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(18).fork()).ldelim(); + } + if (message.version !== undefined) { + Version.encode(message.version, writer.uint32(26).fork()).ldelim(); + } + if (message.delayPeriod !== BigInt(0)) { + writer.uint32(32).uint64(message.delayPeriod); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgConnectionOpenInit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenInit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.counterparty = Counterparty.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.version = Version.decode(reader, reader.uint32(), useInterfaces); + break; + case 4: + message.delayPeriod = reader.uint64(); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgConnectionOpenInit { + const message = createBaseMsgConnectionOpenInit(); + message.clientId = object.clientId ?? ""; + message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; + message.version = object.version !== undefined && object.version !== null ? Version.fromPartial(object.version) : undefined; + message.delayPeriod = object.delayPeriod !== undefined && object.delayPeriod !== null ? BigInt(object.delayPeriod.toString()) : BigInt(0); + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgConnectionOpenInitAmino): MsgConnectionOpenInit { + const message = createBaseMsgConnectionOpenInit(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.version !== undefined && object.version !== null) { + message.version = Version.fromAmino(object.version); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgConnectionOpenInit, useInterfaces: boolean = false): MsgConnectionOpenInitAmino { + const obj: any = {}; + obj.client_id = message.clientId; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty, useInterfaces) : undefined; + obj.version = message.version ? Version.toAmino(message.version, useInterfaces) : undefined; + obj.delay_period = message.delayPeriod ? message.delayPeriod.toString() : undefined; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenInitAminoMsg): MsgConnectionOpenInit { + return MsgConnectionOpenInit.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenInit, useInterfaces: boolean = false): MsgConnectionOpenInitAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenInit", + value: MsgConnectionOpenInit.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgConnectionOpenInitProtoMsg, useInterfaces: boolean = false): MsgConnectionOpenInit { + return MsgConnectionOpenInit.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgConnectionOpenInit): Uint8Array { + return MsgConnectionOpenInit.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenInit): MsgConnectionOpenInitProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit", + value: MsgConnectionOpenInit.encode(message).finish() + }; + } +}; +function createBaseMsgConnectionOpenInitResponse(): MsgConnectionOpenInitResponse { + return {}; +} +export const MsgConnectionOpenInitResponse = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInitResponse", + encode(_: MsgConnectionOpenInitResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgConnectionOpenInitResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenInitResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgConnectionOpenInitResponse { + const message = createBaseMsgConnectionOpenInitResponse(); + return message; + }, + fromAmino(_: MsgConnectionOpenInitResponseAmino): MsgConnectionOpenInitResponse { + const message = createBaseMsgConnectionOpenInitResponse(); + return message; + }, + toAmino(_: MsgConnectionOpenInitResponse, useInterfaces: boolean = false): MsgConnectionOpenInitResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenInitResponseAminoMsg): MsgConnectionOpenInitResponse { + return MsgConnectionOpenInitResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenInitResponse, useInterfaces: boolean = false): MsgConnectionOpenInitResponseAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenInitResponse", + value: MsgConnectionOpenInitResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgConnectionOpenInitResponseProtoMsg, useInterfaces: boolean = false): MsgConnectionOpenInitResponse { + return MsgConnectionOpenInitResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgConnectionOpenInitResponse): Uint8Array { + return MsgConnectionOpenInitResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenInitResponse): MsgConnectionOpenInitResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInitResponse", + value: MsgConnectionOpenInitResponse.encode(message).finish() + }; + } +}; +function createBaseMsgConnectionOpenTry(): MsgConnectionOpenTry { + return { + clientId: "", + previousConnectionId: "", + clientState: undefined, + counterparty: Counterparty.fromPartial({}), + delayPeriod: BigInt(0), + counterpartyVersions: [], + proofHeight: Height.fromPartial({}), + proofInit: new Uint8Array(), + proofClient: new Uint8Array(), + proofConsensus: new Uint8Array(), + consensusHeight: Height.fromPartial({}), + signer: "", + hostConsensusStateProof: new Uint8Array() + }; +} +export const MsgConnectionOpenTry = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry", + encode(message: MsgConnectionOpenTry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.previousConnectionId !== "") { + writer.uint32(18).string(message.previousConnectionId); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(26).fork()).ldelim(); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(34).fork()).ldelim(); + } + if (message.delayPeriod !== BigInt(0)) { + writer.uint32(40).uint64(message.delayPeriod); + } + for (const v of message.counterpartyVersions) { + Version.encode(v!, writer.uint32(50).fork()).ldelim(); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(58).fork()).ldelim(); + } + if (message.proofInit.length !== 0) { + writer.uint32(66).bytes(message.proofInit); + } + if (message.proofClient.length !== 0) { + writer.uint32(74).bytes(message.proofClient); + } + if (message.proofConsensus.length !== 0) { + writer.uint32(82).bytes(message.proofConsensus); + } + if (message.consensusHeight !== undefined) { + Height.encode(message.consensusHeight, writer.uint32(90).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(98).string(message.signer); + } + if (message.hostConsensusStateProof.length !== 0) { + writer.uint32(106).bytes(message.hostConsensusStateProof); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgConnectionOpenTry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenTry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.previousConnectionId = reader.string(); + break; + case 3: + message.clientState = Any.decode(reader, reader.uint32(), useInterfaces); + break; + case 4: + message.counterparty = Counterparty.decode(reader, reader.uint32(), useInterfaces); + break; + case 5: + message.delayPeriod = reader.uint64(); + break; + case 6: + message.counterpartyVersions.push(Version.decode(reader, reader.uint32(), useInterfaces)); + break; + case 7: + message.proofHeight = Height.decode(reader, reader.uint32(), useInterfaces); + break; + case 8: + message.proofInit = reader.bytes(); + break; + case 9: + message.proofClient = reader.bytes(); + break; + case 10: + message.proofConsensus = reader.bytes(); + break; + case 11: + message.consensusHeight = Height.decode(reader, reader.uint32(), useInterfaces); + break; + case 12: + message.signer = reader.string(); + break; + case 13: + message.hostConsensusStateProof = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgConnectionOpenTry { + const message = createBaseMsgConnectionOpenTry(); + message.clientId = object.clientId ?? ""; + message.previousConnectionId = object.previousConnectionId ?? ""; + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; + message.delayPeriod = object.delayPeriod !== undefined && object.delayPeriod !== null ? BigInt(object.delayPeriod.toString()) : BigInt(0); + message.counterpartyVersions = object.counterpartyVersions?.map(e => Version.fromPartial(e)) || []; + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.proofInit = object.proofInit ?? new Uint8Array(); + message.proofClient = object.proofClient ?? new Uint8Array(); + message.proofConsensus = object.proofConsensus ?? new Uint8Array(); + message.consensusHeight = object.consensusHeight !== undefined && object.consensusHeight !== null ? Height.fromPartial(object.consensusHeight) : undefined; + message.signer = object.signer ?? ""; + message.hostConsensusStateProof = object.hostConsensusStateProof ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgConnectionOpenTryAmino): MsgConnectionOpenTry { + const message = createBaseMsgConnectionOpenTry(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.previous_connection_id !== undefined && object.previous_connection_id !== null) { + message.previousConnectionId = object.previous_connection_id; + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + if (object.delay_period !== undefined && object.delay_period !== null) { + message.delayPeriod = BigInt(object.delay_period); + } + message.counterpartyVersions = object.counterparty_versions?.map(e => Version.fromAmino(e)) || []; + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.proof_init !== undefined && object.proof_init !== null) { + message.proofInit = bytesFromBase64(object.proof_init); + } + if (object.proof_client !== undefined && object.proof_client !== null) { + message.proofClient = bytesFromBase64(object.proof_client); + } + if (object.proof_consensus !== undefined && object.proof_consensus !== null) { + message.proofConsensus = bytesFromBase64(object.proof_consensus); + } + if (object.consensus_height !== undefined && object.consensus_height !== null) { + message.consensusHeight = Height.fromAmino(object.consensus_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.host_consensus_state_proof !== undefined && object.host_consensus_state_proof !== null) { + message.hostConsensusStateProof = bytesFromBase64(object.host_consensus_state_proof); + } + return message; + }, + toAmino(message: MsgConnectionOpenTry, useInterfaces: boolean = false): MsgConnectionOpenTryAmino { + const obj: any = {}; + obj.client_id = message.clientId; + obj.previous_connection_id = message.previousConnectionId; + obj.client_state = message.clientState ? Any.toAmino(message.clientState, useInterfaces) : undefined; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty, useInterfaces) : undefined; + obj.delay_period = message.delayPeriod ? message.delayPeriod.toString() : undefined; + if (message.counterpartyVersions) { + obj.counterparty_versions = message.counterpartyVersions.map(e => e ? Version.toAmino(e, useInterfaces) : undefined); + } else { + obj.counterparty_versions = []; + } + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight, useInterfaces) : {}; + obj.proof_init = message.proofInit ? base64FromBytes(message.proofInit) : undefined; + obj.proof_client = message.proofClient ? base64FromBytes(message.proofClient) : undefined; + obj.proof_consensus = message.proofConsensus ? base64FromBytes(message.proofConsensus) : undefined; + obj.consensus_height = message.consensusHeight ? Height.toAmino(message.consensusHeight, useInterfaces) : {}; + obj.signer = message.signer; + obj.host_consensus_state_proof = message.hostConsensusStateProof ? base64FromBytes(message.hostConsensusStateProof) : undefined; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenTryAminoMsg): MsgConnectionOpenTry { + return MsgConnectionOpenTry.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenTry, useInterfaces: boolean = false): MsgConnectionOpenTryAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenTry", + value: MsgConnectionOpenTry.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgConnectionOpenTryProtoMsg, useInterfaces: boolean = false): MsgConnectionOpenTry { + return MsgConnectionOpenTry.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgConnectionOpenTry): Uint8Array { + return MsgConnectionOpenTry.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenTry): MsgConnectionOpenTryProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry", + value: MsgConnectionOpenTry.encode(message).finish() + }; + } +}; +function createBaseMsgConnectionOpenTryResponse(): MsgConnectionOpenTryResponse { + return {}; +} +export const MsgConnectionOpenTryResponse = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTryResponse", + encode(_: MsgConnectionOpenTryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgConnectionOpenTryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenTryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgConnectionOpenTryResponse { + const message = createBaseMsgConnectionOpenTryResponse(); + return message; + }, + fromAmino(_: MsgConnectionOpenTryResponseAmino): MsgConnectionOpenTryResponse { + const message = createBaseMsgConnectionOpenTryResponse(); + return message; + }, + toAmino(_: MsgConnectionOpenTryResponse, useInterfaces: boolean = false): MsgConnectionOpenTryResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenTryResponseAminoMsg): MsgConnectionOpenTryResponse { + return MsgConnectionOpenTryResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenTryResponse, useInterfaces: boolean = false): MsgConnectionOpenTryResponseAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenTryResponse", + value: MsgConnectionOpenTryResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgConnectionOpenTryResponseProtoMsg, useInterfaces: boolean = false): MsgConnectionOpenTryResponse { + return MsgConnectionOpenTryResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgConnectionOpenTryResponse): Uint8Array { + return MsgConnectionOpenTryResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenTryResponse): MsgConnectionOpenTryResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTryResponse", + value: MsgConnectionOpenTryResponse.encode(message).finish() + }; + } +}; +function createBaseMsgConnectionOpenAck(): MsgConnectionOpenAck { + return { + connectionId: "", + counterpartyConnectionId: "", + version: undefined, + clientState: undefined, + proofHeight: Height.fromPartial({}), + proofTry: new Uint8Array(), + proofClient: new Uint8Array(), + proofConsensus: new Uint8Array(), + consensusHeight: Height.fromPartial({}), + signer: "", + hostConsensusStateProof: new Uint8Array() + }; +} +export const MsgConnectionOpenAck = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck", + encode(message: MsgConnectionOpenAck, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + if (message.counterpartyConnectionId !== "") { + writer.uint32(18).string(message.counterpartyConnectionId); + } + if (message.version !== undefined) { + Version.encode(message.version, writer.uint32(26).fork()).ldelim(); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(34).fork()).ldelim(); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(42).fork()).ldelim(); + } + if (message.proofTry.length !== 0) { + writer.uint32(50).bytes(message.proofTry); + } + if (message.proofClient.length !== 0) { + writer.uint32(58).bytes(message.proofClient); + } + if (message.proofConsensus.length !== 0) { + writer.uint32(66).bytes(message.proofConsensus); + } + if (message.consensusHeight !== undefined) { + Height.encode(message.consensusHeight, writer.uint32(74).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(82).string(message.signer); + } + if (message.hostConsensusStateProof.length !== 0) { + writer.uint32(90).bytes(message.hostConsensusStateProof); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgConnectionOpenAck { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenAck(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + message.counterpartyConnectionId = reader.string(); + break; + case 3: + message.version = Version.decode(reader, reader.uint32(), useInterfaces); + break; + case 4: + message.clientState = Any.decode(reader, reader.uint32(), useInterfaces); + break; + case 5: + message.proofHeight = Height.decode(reader, reader.uint32(), useInterfaces); + break; + case 6: + message.proofTry = reader.bytes(); + break; + case 7: + message.proofClient = reader.bytes(); + break; + case 8: + message.proofConsensus = reader.bytes(); + break; + case 9: + message.consensusHeight = Height.decode(reader, reader.uint32(), useInterfaces); + break; + case 10: + message.signer = reader.string(); + break; + case 11: + message.hostConsensusStateProof = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgConnectionOpenAck { + const message = createBaseMsgConnectionOpenAck(); + message.connectionId = object.connectionId ?? ""; + message.counterpartyConnectionId = object.counterpartyConnectionId ?? ""; + message.version = object.version !== undefined && object.version !== null ? Version.fromPartial(object.version) : undefined; + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.proofTry = object.proofTry ?? new Uint8Array(); + message.proofClient = object.proofClient ?? new Uint8Array(); + message.proofConsensus = object.proofConsensus ?? new Uint8Array(); + message.consensusHeight = object.consensusHeight !== undefined && object.consensusHeight !== null ? Height.fromPartial(object.consensusHeight) : undefined; + message.signer = object.signer ?? ""; + message.hostConsensusStateProof = object.hostConsensusStateProof ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgConnectionOpenAckAmino): MsgConnectionOpenAck { + const message = createBaseMsgConnectionOpenAck(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.counterparty_connection_id !== undefined && object.counterparty_connection_id !== null) { + message.counterpartyConnectionId = object.counterparty_connection_id; + } + if (object.version !== undefined && object.version !== null) { + message.version = Version.fromAmino(object.version); + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.proof_try !== undefined && object.proof_try !== null) { + message.proofTry = bytesFromBase64(object.proof_try); + } + if (object.proof_client !== undefined && object.proof_client !== null) { + message.proofClient = bytesFromBase64(object.proof_client); + } + if (object.proof_consensus !== undefined && object.proof_consensus !== null) { + message.proofConsensus = bytesFromBase64(object.proof_consensus); + } + if (object.consensus_height !== undefined && object.consensus_height !== null) { + message.consensusHeight = Height.fromAmino(object.consensus_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.host_consensus_state_proof !== undefined && object.host_consensus_state_proof !== null) { + message.hostConsensusStateProof = bytesFromBase64(object.host_consensus_state_proof); + } + return message; + }, + toAmino(message: MsgConnectionOpenAck, useInterfaces: boolean = false): MsgConnectionOpenAckAmino { + const obj: any = {}; + obj.connection_id = message.connectionId; + obj.counterparty_connection_id = message.counterpartyConnectionId; + obj.version = message.version ? Version.toAmino(message.version, useInterfaces) : undefined; + obj.client_state = message.clientState ? Any.toAmino(message.clientState, useInterfaces) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight, useInterfaces) : {}; + obj.proof_try = message.proofTry ? base64FromBytes(message.proofTry) : undefined; + obj.proof_client = message.proofClient ? base64FromBytes(message.proofClient) : undefined; + obj.proof_consensus = message.proofConsensus ? base64FromBytes(message.proofConsensus) : undefined; + obj.consensus_height = message.consensusHeight ? Height.toAmino(message.consensusHeight, useInterfaces) : {}; + obj.signer = message.signer; + obj.host_consensus_state_proof = message.hostConsensusStateProof ? base64FromBytes(message.hostConsensusStateProof) : undefined; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenAckAminoMsg): MsgConnectionOpenAck { + return MsgConnectionOpenAck.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenAck, useInterfaces: boolean = false): MsgConnectionOpenAckAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenAck", + value: MsgConnectionOpenAck.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgConnectionOpenAckProtoMsg, useInterfaces: boolean = false): MsgConnectionOpenAck { + return MsgConnectionOpenAck.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgConnectionOpenAck): Uint8Array { + return MsgConnectionOpenAck.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenAck): MsgConnectionOpenAckProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck", + value: MsgConnectionOpenAck.encode(message).finish() + }; + } +}; +function createBaseMsgConnectionOpenAckResponse(): MsgConnectionOpenAckResponse { + return {}; +} +export const MsgConnectionOpenAckResponse = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAckResponse", + encode(_: MsgConnectionOpenAckResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgConnectionOpenAckResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenAckResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgConnectionOpenAckResponse { + const message = createBaseMsgConnectionOpenAckResponse(); + return message; + }, + fromAmino(_: MsgConnectionOpenAckResponseAmino): MsgConnectionOpenAckResponse { + const message = createBaseMsgConnectionOpenAckResponse(); + return message; + }, + toAmino(_: MsgConnectionOpenAckResponse, useInterfaces: boolean = false): MsgConnectionOpenAckResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenAckResponseAminoMsg): MsgConnectionOpenAckResponse { + return MsgConnectionOpenAckResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenAckResponse, useInterfaces: boolean = false): MsgConnectionOpenAckResponseAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenAckResponse", + value: MsgConnectionOpenAckResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgConnectionOpenAckResponseProtoMsg, useInterfaces: boolean = false): MsgConnectionOpenAckResponse { + return MsgConnectionOpenAckResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgConnectionOpenAckResponse): Uint8Array { + return MsgConnectionOpenAckResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenAckResponse): MsgConnectionOpenAckResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAckResponse", + value: MsgConnectionOpenAckResponse.encode(message).finish() + }; + } +}; +function createBaseMsgConnectionOpenConfirm(): MsgConnectionOpenConfirm { + return { + connectionId: "", + proofAck: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgConnectionOpenConfirm = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", + encode(message: MsgConnectionOpenConfirm, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + if (message.proofAck.length !== 0) { + writer.uint32(18).bytes(message.proofAck); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(34).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgConnectionOpenConfirm { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenConfirm(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + message.proofAck = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32(), useInterfaces); + break; + case 4: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgConnectionOpenConfirm { + const message = createBaseMsgConnectionOpenConfirm(); + message.connectionId = object.connectionId ?? ""; + message.proofAck = object.proofAck ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgConnectionOpenConfirmAmino): MsgConnectionOpenConfirm { + const message = createBaseMsgConnectionOpenConfirm(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.proof_ack !== undefined && object.proof_ack !== null) { + message.proofAck = bytesFromBase64(object.proof_ack); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgConnectionOpenConfirm, useInterfaces: boolean = false): MsgConnectionOpenConfirmAmino { + const obj: any = {}; + obj.connection_id = message.connectionId; + obj.proof_ack = message.proofAck ? base64FromBytes(message.proofAck) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight, useInterfaces) : {}; + obj.signer = message.signer; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenConfirmAminoMsg): MsgConnectionOpenConfirm { + return MsgConnectionOpenConfirm.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenConfirm, useInterfaces: boolean = false): MsgConnectionOpenConfirmAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenConfirm", + value: MsgConnectionOpenConfirm.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgConnectionOpenConfirmProtoMsg, useInterfaces: boolean = false): MsgConnectionOpenConfirm { + return MsgConnectionOpenConfirm.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgConnectionOpenConfirm): Uint8Array { + return MsgConnectionOpenConfirm.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenConfirm): MsgConnectionOpenConfirmProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", + value: MsgConnectionOpenConfirm.encode(message).finish() + }; + } +}; +function createBaseMsgConnectionOpenConfirmResponse(): MsgConnectionOpenConfirmResponse { + return {}; +} +export const MsgConnectionOpenConfirmResponse = { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse", + encode(_: MsgConnectionOpenConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgConnectionOpenConfirmResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgConnectionOpenConfirmResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgConnectionOpenConfirmResponse { + const message = createBaseMsgConnectionOpenConfirmResponse(); + return message; + }, + fromAmino(_: MsgConnectionOpenConfirmResponseAmino): MsgConnectionOpenConfirmResponse { + const message = createBaseMsgConnectionOpenConfirmResponse(); + return message; + }, + toAmino(_: MsgConnectionOpenConfirmResponse, useInterfaces: boolean = false): MsgConnectionOpenConfirmResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgConnectionOpenConfirmResponseAminoMsg): MsgConnectionOpenConfirmResponse { + return MsgConnectionOpenConfirmResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgConnectionOpenConfirmResponse, useInterfaces: boolean = false): MsgConnectionOpenConfirmResponseAminoMsg { + return { + type: "cosmos-sdk/MsgConnectionOpenConfirmResponse", + value: MsgConnectionOpenConfirmResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgConnectionOpenConfirmResponseProtoMsg, useInterfaces: boolean = false): MsgConnectionOpenConfirmResponse { + return MsgConnectionOpenConfirmResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgConnectionOpenConfirmResponse): Uint8Array { + return MsgConnectionOpenConfirmResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgConnectionOpenConfirmResponse): MsgConnectionOpenConfirmResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse", + value: MsgConnectionOpenConfirmResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams, useInterfaces: boolean = false): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.params = message.params ? Params.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams, useInterfaces: boolean = false): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg, useInterfaces: boolean = false): MsgUpdateParams { + return MsgUpdateParams.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse, useInterfaces: boolean = false): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse, useInterfaces: boolean = false): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg, useInterfaces: boolean = false): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/rpc.query.ts b/packages/types/protobuf/codegen/ibc/rpc.query.ts index bb51968df..d77e503a3 100644 --- a/packages/types/protobuf/codegen/ibc/rpc.query.ts +++ b/packages/types/protobuf/codegen/ibc/rpc.query.ts @@ -72,6 +72,9 @@ export const createRPCQueryClient = async ({ }, client: { v1: (await import("./core/client/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, + connection: { + v1: (await import("./core/connection/v1/query.rpc.Query")).createRpcQueryExtension(client) } } } diff --git a/packages/types/protobuf/codegen/ibc/rpc.tx.ts b/packages/types/protobuf/codegen/ibc/rpc.tx.ts index 14f8597c8..37c90e6ec 100644 --- a/packages/types/protobuf/codegen/ibc/rpc.tx.ts +++ b/packages/types/protobuf/codegen/ibc/rpc.tx.ts @@ -57,6 +57,9 @@ export const createRPCMsgClient = async ({ }, client: { v1: new (await import("./core/client/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + connection: { + v1: new (await import("./core/connection/v1/tx.rpc.msg")).MsgClientImpl(rpc) } } } diff --git a/packages/types/protobuf/codegen/juno/bundle.ts b/packages/types/protobuf/codegen/juno/bundle.ts index 44efc3572..d79950df8 100644 --- a/packages/types/protobuf/codegen/juno/bundle.ts +++ b/packages/types/protobuf/codegen/juno/bundle.ts @@ -1,46 +1,46 @@ -import * as _140 from "./feeshare/v1/feeshare"; -import * as _141 from "./feeshare/v1/genesis"; -import * as _142 from "./feeshare/v1/query"; -import * as _143 from "./feeshare/v1/tx"; -import * as _144 from "./mint/genesis"; -import * as _145 from "./mint/mint"; -import * as _146 from "./mint/query"; -import * as _147 from "./mint/tx"; -import * as _468 from "./feeshare/v1/tx.amino"; -import * as _469 from "./mint/tx.amino"; -import * as _470 from "./feeshare/v1/tx.registry"; -import * as _471 from "./mint/tx.registry"; -import * as _472 from "./feeshare/v1/query.rpc.Query"; -import * as _473 from "./mint/query.rpc.Query"; -import * as _474 from "./feeshare/v1/tx.rpc.msg"; -import * as _475 from "./mint/tx.rpc.msg"; -import * as _648 from "./rpc.query"; -import * as _649 from "./rpc.tx"; +import * as _146 from "./feeshare/v1/feeshare"; +import * as _147 from "./feeshare/v1/genesis"; +import * as _148 from "./feeshare/v1/query"; +import * as _149 from "./feeshare/v1/tx"; +import * as _150 from "./mint/genesis"; +import * as _151 from "./mint/mint"; +import * as _152 from "./mint/query"; +import * as _153 from "./mint/tx"; +import * as _478 from "./feeshare/v1/tx.amino"; +import * as _479 from "./mint/tx.amino"; +import * as _480 from "./feeshare/v1/tx.registry"; +import * as _481 from "./mint/tx.registry"; +import * as _482 from "./feeshare/v1/query.rpc.Query"; +import * as _483 from "./mint/query.rpc.Query"; +import * as _484 from "./feeshare/v1/tx.rpc.msg"; +import * as _485 from "./mint/tx.rpc.msg"; +import * as _658 from "./rpc.query"; +import * as _659 from "./rpc.tx"; export namespace juno { export namespace feeshare { export const v1 = { - ..._140, - ..._141, - ..._142, - ..._143, - ..._468, - ..._470, - ..._472, - ..._474 + ..._146, + ..._147, + ..._148, + ..._149, + ..._478, + ..._480, + ..._482, + ..._484 }; } export const mint = { - ..._144, - ..._145, - ..._146, - ..._147, - ..._469, - ..._471, - ..._473, - ..._475 + ..._150, + ..._151, + ..._152, + ..._153, + ..._479, + ..._481, + ..._483, + ..._485 }; export const ClientFactory = { - ..._648, - ..._649 + ..._658, + ..._659 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/bundle.ts b/packages/types/protobuf/codegen/kujira/bundle.ts index f388802ca..807cc0bc6 100644 --- a/packages/types/protobuf/codegen/kujira/bundle.ts +++ b/packages/types/protobuf/codegen/kujira/bundle.ts @@ -1,60 +1,60 @@ -import * as _148 from "./denom/authorityMetadata"; -import * as _149 from "./denom/genesis"; -import * as _150 from "./denom/params"; -import * as _151 from "./denom/query"; -import * as _152 from "./denom/tx"; -import * as _153 from "./oracle/genesis"; -import * as _154 from "./oracle/oracle"; -import * as _155 from "./oracle/query"; -import * as _156 from "./oracle/tx"; -import * as _157 from "./scheduler/genesis"; -import * as _158 from "./scheduler/hook"; -import * as _159 from "./scheduler/params"; -import * as _160 from "./scheduler/proposal"; -import * as _161 from "./scheduler/query"; -import * as _476 from "./denom/tx.amino"; -import * as _477 from "./oracle/tx.amino"; -import * as _478 from "./denom/tx.registry"; -import * as _479 from "./oracle/tx.registry"; -import * as _480 from "./denom/query.rpc.Query"; -import * as _481 from "./oracle/query.rpc.Query"; -import * as _482 from "./scheduler/query.rpc.Query"; -import * as _483 from "./denom/tx.rpc.msg"; -import * as _484 from "./oracle/tx.rpc.msg"; -import * as _650 from "./rpc.query"; -import * as _651 from "./rpc.tx"; +import * as _154 from "./denom/authorityMetadata"; +import * as _155 from "./denom/genesis"; +import * as _156 from "./denom/params"; +import * as _157 from "./denom/query"; +import * as _158 from "./denom/tx"; +import * as _159 from "./oracle/genesis"; +import * as _160 from "./oracle/oracle"; +import * as _161 from "./oracle/query"; +import * as _162 from "./oracle/tx"; +import * as _163 from "./scheduler/genesis"; +import * as _164 from "./scheduler/hook"; +import * as _165 from "./scheduler/params"; +import * as _166 from "./scheduler/proposal"; +import * as _167 from "./scheduler/query"; +import * as _486 from "./denom/tx.amino"; +import * as _487 from "./oracle/tx.amino"; +import * as _488 from "./denom/tx.registry"; +import * as _489 from "./oracle/tx.registry"; +import * as _490 from "./denom/query.rpc.Query"; +import * as _491 from "./oracle/query.rpc.Query"; +import * as _492 from "./scheduler/query.rpc.Query"; +import * as _493 from "./denom/tx.rpc.msg"; +import * as _494 from "./oracle/tx.rpc.msg"; +import * as _660 from "./rpc.query"; +import * as _661 from "./rpc.tx"; export namespace kujira { export const denom = { - ..._148, - ..._149, - ..._150, - ..._151, - ..._152, - ..._476, - ..._478, - ..._480, - ..._483 - }; - export const oracle = { - ..._153, ..._154, ..._155, ..._156, - ..._477, - ..._479, - ..._481, - ..._484 - }; - export const scheduler = { ..._157, ..._158, + ..._486, + ..._488, + ..._490, + ..._493 + }; + export const oracle = { ..._159, ..._160, ..._161, - ..._482 + ..._162, + ..._487, + ..._489, + ..._491, + ..._494 + }; + export const scheduler = { + ..._163, + ..._164, + ..._165, + ..._166, + ..._167, + ..._492 }; export const ClientFactory = { - ..._650, - ..._651 + ..._660, + ..._661 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/neutron/bundle.ts b/packages/types/protobuf/codegen/neutron/bundle.ts index 7dac8de00..9447bb144 100644 --- a/packages/types/protobuf/codegen/neutron/bundle.ts +++ b/packages/types/protobuf/codegen/neutron/bundle.ts @@ -1,91 +1,85 @@ -import * as _162 from "./contractmanager/v1/failure"; -import * as _163 from "./cron/genesis"; -import * as _164 from "./cron/params"; -import * as _165 from "./cron/query"; -import * as _166 from "./cron/schedule"; -import * as _167 from "./cron/tx"; -import * as _168 from "./dex/deposit_record"; -import * as _169 from "./dex/genesis"; -import * as _170 from "./dex/limit_order_expiration"; -import * as _171 from "./dex/limit_order_tranche_user"; -import * as _172 from "./dex/limit_order_tranche"; -import * as _173 from "./dex/pair_id"; -import * as _174 from "./dex/params"; -import * as _175 from "./dex/pool_metadata"; -import * as _176 from "./dex/pool_reserves"; -import * as _177 from "./dex/pool"; -import * as _178 from "./dex/query"; -import * as _179 from "./dex/tick_liquidity"; -import * as _180 from "./dex/trade_pair_id"; -import * as _181 from "./dex/tx"; -import * as _182 from "./feeburner/genesis"; -import * as _183 from "./feeburner/params"; -import * as _184 from "./feeburner/query"; -import * as _185 from "./feeburner/total_burned_neutrons_amount"; -import * as _186 from "./feeburner/tx"; -import * as _187 from "./feerefunder/fee"; -import * as _188 from "./feerefunder/genesis"; -import * as _189 from "./feerefunder/params"; -import * as _190 from "./feerefunder/query"; -import * as _191 from "./feerefunder/tx"; -import * as _192 from "./interchainqueries/genesis"; -import * as _193 from "./interchainqueries/params"; -import * as _194 from "./interchainqueries/query"; -import * as _195 from "./interchainqueries/tx"; -import * as _196 from "./interchaintxs/v1/genesis"; -import * as _197 from "./interchaintxs/v1/params"; -import * as _198 from "./interchaintxs/v1/query"; -import * as _199 from "./interchaintxs/v1/tx"; -import * as _485 from "./cron/tx.amino"; -import * as _486 from "./dex/tx.amino"; -import * as _487 from "./feeburner/tx.amino"; -import * as _488 from "./feerefunder/tx.amino"; -import * as _489 from "./interchainqueries/tx.amino"; -import * as _490 from "./interchaintxs/v1/tx.amino"; -import * as _491 from "./cron/tx.registry"; -import * as _492 from "./dex/tx.registry"; -import * as _493 from "./feeburner/tx.registry"; -import * as _494 from "./feerefunder/tx.registry"; -import * as _495 from "./interchainqueries/tx.registry"; -import * as _496 from "./interchaintxs/v1/tx.registry"; -import * as _497 from "./cron/query.rpc.Query"; -import * as _498 from "./dex/query.rpc.Query"; -import * as _499 from "./feeburner/query.rpc.Query"; -import * as _500 from "./feerefunder/query.rpc.Query"; -import * as _501 from "./interchainqueries/query.rpc.Query"; -import * as _502 from "./interchaintxs/v1/query.rpc.Query"; -import * as _503 from "./cron/tx.rpc.msg"; -import * as _504 from "./dex/tx.rpc.msg"; -import * as _505 from "./feeburner/tx.rpc.msg"; -import * as _506 from "./feerefunder/tx.rpc.msg"; -import * as _507 from "./interchainqueries/tx.rpc.msg"; -import * as _508 from "./interchaintxs/v1/tx.rpc.msg"; -import * as _652 from "./rpc.query"; -import * as _653 from "./rpc.tx"; +import * as _168 from "./contractmanager/v1/failure"; +import * as _169 from "./cron/genesis"; +import * as _170 from "./cron/params"; +import * as _171 from "./cron/query"; +import * as _172 from "./cron/schedule"; +import * as _173 from "./cron/tx"; +import * as _174 from "./dex/deposit_record"; +import * as _175 from "./dex/genesis"; +import * as _176 from "./dex/limit_order_expiration"; +import * as _177 from "./dex/limit_order_tranche_user"; +import * as _178 from "./dex/limit_order_tranche"; +import * as _179 from "./dex/pair_id"; +import * as _180 from "./dex/params"; +import * as _181 from "./dex/pool_metadata"; +import * as _182 from "./dex/pool_reserves"; +import * as _183 from "./dex/pool"; +import * as _184 from "./dex/query"; +import * as _185 from "./dex/tick_liquidity"; +import * as _186 from "./dex/trade_pair_id"; +import * as _187 from "./dex/tx"; +import * as _188 from "./feeburner/genesis"; +import * as _189 from "./feeburner/params"; +import * as _190 from "./feeburner/query"; +import * as _191 from "./feeburner/total_burned_neutrons_amount"; +import * as _192 from "./feeburner/tx"; +import * as _193 from "./feerefunder/fee"; +import * as _194 from "./feerefunder/genesis"; +import * as _195 from "./feerefunder/params"; +import * as _196 from "./feerefunder/query"; +import * as _197 from "./feerefunder/tx"; +import * as _198 from "./interchainqueries/genesis"; +import * as _199 from "./interchainqueries/params"; +import * as _200 from "./interchainqueries/query"; +import * as _201 from "./interchainqueries/tx"; +import * as _202 from "./interchaintxs/v1/genesis"; +import * as _203 from "./interchaintxs/v1/params"; +import * as _204 from "./interchaintxs/v1/query"; +import * as _205 from "./interchaintxs/v1/tx"; +import * as _495 from "./cron/tx.amino"; +import * as _496 from "./dex/tx.amino"; +import * as _497 from "./feeburner/tx.amino"; +import * as _498 from "./feerefunder/tx.amino"; +import * as _499 from "./interchainqueries/tx.amino"; +import * as _500 from "./interchaintxs/v1/tx.amino"; +import * as _501 from "./cron/tx.registry"; +import * as _502 from "./dex/tx.registry"; +import * as _503 from "./feeburner/tx.registry"; +import * as _504 from "./feerefunder/tx.registry"; +import * as _505 from "./interchainqueries/tx.registry"; +import * as _506 from "./interchaintxs/v1/tx.registry"; +import * as _507 from "./cron/query.rpc.Query"; +import * as _508 from "./dex/query.rpc.Query"; +import * as _509 from "./feeburner/query.rpc.Query"; +import * as _510 from "./feerefunder/query.rpc.Query"; +import * as _511 from "./interchainqueries/query.rpc.Query"; +import * as _512 from "./interchaintxs/v1/query.rpc.Query"; +import * as _513 from "./cron/tx.rpc.msg"; +import * as _514 from "./dex/tx.rpc.msg"; +import * as _515 from "./feeburner/tx.rpc.msg"; +import * as _516 from "./feerefunder/tx.rpc.msg"; +import * as _517 from "./interchainqueries/tx.rpc.msg"; +import * as _518 from "./interchaintxs/v1/tx.rpc.msg"; +import * as _662 from "./rpc.query"; +import * as _663 from "./rpc.tx"; export namespace neutron { export namespace contractmanager { export const v1 = { - ..._162 + ..._168 }; } export const cron = { - ..._163, - ..._164, - ..._165, - ..._166, - ..._167, - ..._485, - ..._491, - ..._497, - ..._503 - }; - export const dex = { - ..._168, ..._169, ..._170, ..._171, ..._172, ..._173, + ..._495, + ..._501, + ..._507, + ..._513 + }; + export const dex = { ..._174, ..._175, ..._176, @@ -94,57 +88,63 @@ export namespace neutron { ..._179, ..._180, ..._181, - ..._486, - ..._492, - ..._498, - ..._504 - }; - export const feeburner = { ..._182, ..._183, ..._184, ..._185, ..._186, - ..._487, - ..._493, - ..._499, - ..._505 - }; - export const feerefunder = { ..._187, + ..._496, + ..._502, + ..._508, + ..._514 + }; + export const feeburner = { ..._188, ..._189, ..._190, ..._191, - ..._488, - ..._494, - ..._500, - ..._506 - }; - export const interchainqueries = { ..._192, + ..._497, + ..._503, + ..._509, + ..._515 + }; + export const feerefunder = { ..._193, ..._194, ..._195, - ..._489, - ..._495, - ..._501, - ..._507 + ..._196, + ..._197, + ..._498, + ..._504, + ..._510, + ..._516 + }; + export const interchainqueries = { + ..._198, + ..._199, + ..._200, + ..._201, + ..._499, + ..._505, + ..._511, + ..._517 }; export namespace interchaintxs { export const v1 = { - ..._196, - ..._197, - ..._198, - ..._199, - ..._490, - ..._496, - ..._502, - ..._508 + ..._202, + ..._203, + ..._204, + ..._205, + ..._500, + ..._506, + ..._512, + ..._518 }; } export const ClientFactory = { - ..._652, - ..._653 + ..._662, + ..._663 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/noble/bundle.ts b/packages/types/protobuf/codegen/noble/bundle.ts index f4d52a715..b389cbea0 100644 --- a/packages/types/protobuf/codegen/noble/bundle.ts +++ b/packages/types/protobuf/codegen/noble/bundle.ts @@ -1,16 +1,16 @@ -import * as _361 from "../tariff/genesis"; -import * as _362 from "../tariff/params"; -import * as _363 from "../tariff/query"; -import * as _632 from "../tariff/query.rpc.Query"; -import * as _666 from "./rpc.query"; +import * as _367 from "../tariff/genesis"; +import * as _368 from "../tariff/params"; +import * as _369 from "../tariff/query"; +import * as _642 from "../tariff/query.rpc.Query"; +import * as _676 from "./rpc.query"; export namespace noble { export const tariff = { - ..._361, - ..._362, - ..._363, - ..._632 + ..._367, + ..._368, + ..._369, + ..._642 }; export const ClientFactory = { - ..._666 + ..._676 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/bundle.ts b/packages/types/protobuf/codegen/osmosis/bundle.ts index c1c6cacff..a1f72c87b 100644 --- a/packages/types/protobuf/codegen/osmosis/bundle.ts +++ b/packages/types/protobuf/codegen/osmosis/bundle.ts @@ -1,259 +1,245 @@ -import * as _205 from "./accum/v1beta1/accum"; -import * as _206 from "./concentratedliquidity/params"; -import * as _207 from "./cosmwasmpool/v1beta1/genesis"; -import * as _208 from "./cosmwasmpool/v1beta1/gov"; -import * as _209 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; -import * as _210 from "./cosmwasmpool/v1beta1/model/module_query_msg"; -import * as _211 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; -import * as _212 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; -import * as _213 from "./cosmwasmpool/v1beta1/model/pool"; -import * as _214 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; -import * as _215 from "./cosmwasmpool/v1beta1/model/tx"; -import * as _216 from "./cosmwasmpool/v1beta1/params"; -import * as _217 from "./cosmwasmpool/v1beta1/query"; -import * as _218 from "./cosmwasmpool/v1beta1/tx"; -import * as _219 from "./gamm/pool-models/balancer/balancerPool"; -import * as _220 from "./gamm/v1beta1/genesis"; -import * as _221 from "./gamm/v1beta1/gov"; -import * as _222 from "./gamm/v1beta1/query"; -import * as _223 from "./gamm/v1beta1/shared"; -import * as _224 from "./gamm/v1beta1/tx"; -import * as _225 from "./gamm/pool-models/balancer/tx/tx"; -import * as _226 from "./gamm/pool-models/stableswap/stableswap_pool"; -import * as _227 from "./gamm/pool-models/stableswap/tx"; -import * as _228 from "./incentives/gauge"; -import * as _229 from "./incentives/genesis"; -import * as _230 from "./incentives/gov"; -import * as _231 from "./incentives/group"; -import * as _232 from "./incentives/params"; -import * as _233 from "./incentives/query"; -import * as _234 from "./incentives/tx"; -import * as _235 from "./lockup/genesis"; -import * as _236 from "./lockup/lock"; -import * as _237 from "./lockup/params"; -import * as _238 from "./lockup/query"; -import * as _239 from "./lockup/tx"; -import * as _240 from "./pool-incentives/v1beta1/genesis"; -import * as _241 from "./pool-incentives/v1beta1/gov"; -import * as _242 from "./pool-incentives/v1beta1/incentives"; -import * as _243 from "./pool-incentives/v1beta1/query"; -import * as _244 from "./pool-incentives/v1beta1/shared"; -import * as _245 from "./poolmanager/v1beta1/genesis"; -import * as _246 from "./poolmanager/v1beta1/gov"; -import * as _247 from "./poolmanager/v1beta1/module_route"; -import * as _248 from "./poolmanager/v1beta1/query"; -import * as _249 from "./poolmanager/v1beta1/swap_route"; -import * as _250 from "./poolmanager/v1beta1/tx"; -import * as _251 from "./protorev/v1beta1/genesis"; -import * as _252 from "./protorev/v1beta1/gov"; -import * as _253 from "./protorev/v1beta1/params"; -import * as _254 from "./protorev/v1beta1/protorev"; -import * as _255 from "./protorev/v1beta1/query"; -import * as _256 from "./protorev/v1beta1/tx"; -import * as _257 from "./smartaccount/v1beta1/genesis"; -import * as _258 from "./smartaccount/v1beta1/models"; -import * as _259 from "./smartaccount/v1beta1/params"; -import * as _260 from "./smartaccount/v1beta1/query"; -import * as _261 from "./smartaccount/v1beta1/tx"; -import * as _262 from "./superfluid/genesis"; -import * as _263 from "./superfluid/params"; -import * as _264 from "./superfluid/query"; -import * as _265 from "./superfluid/superfluid"; -import * as _266 from "./superfluid/tx"; -import * as _267 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _268 from "./tokenfactory/v1beta1/genesis"; -import * as _269 from "./tokenfactory/v1beta1/params"; -import * as _270 from "./tokenfactory/v1beta1/query"; -import * as _271 from "./tokenfactory/v1beta1/tx"; -import * as _272 from "./txfees/v1beta1/feetoken"; -import * as _273 from "./txfees/v1beta1/genesis"; -import * as _274 from "./txfees/v1beta1/gov"; -import * as _275 from "./txfees/v1beta1/params"; -import * as _276 from "./txfees/v1beta1/query"; -import * as _277 from "./txfees/v1beta1/tx"; -import * as _278 from "./valset-pref/v1beta1/query"; -import * as _279 from "./valset-pref/v1beta1/state"; -import * as _280 from "./valset-pref/v1beta1/tx"; -import * as _513 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; -import * as _514 from "./concentratedliquidity/v1beta1/tx.amino"; -import * as _515 from "./gamm/pool-models/balancer/tx/tx.amino"; -import * as _516 from "./gamm/pool-models/stableswap/tx.amino"; -import * as _517 from "./gamm/v1beta1/tx.amino"; -import * as _518 from "./incentives/tx.amino"; -import * as _519 from "./lockup/tx.amino"; -import * as _520 from "./poolmanager/v1beta1/tx.amino"; -import * as _521 from "./protorev/v1beta1/tx.amino"; -import * as _522 from "./smartaccount/v1beta1/tx.amino"; -import * as _523 from "./superfluid/tx.amino"; -import * as _524 from "./tokenfactory/v1beta1/tx.amino"; -import * as _525 from "./txfees/v1beta1/tx.amino"; -import * as _526 from "./valset-pref/v1beta1/tx.amino"; -import * as _527 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; -import * as _528 from "./concentratedliquidity/v1beta1/tx.registry"; -import * as _529 from "./gamm/pool-models/balancer/tx/tx.registry"; -import * as _530 from "./gamm/pool-models/stableswap/tx.registry"; -import * as _531 from "./gamm/v1beta1/tx.registry"; -import * as _532 from "./incentives/tx.registry"; -import * as _533 from "./lockup/tx.registry"; -import * as _534 from "./poolmanager/v1beta1/tx.registry"; -import * as _535 from "./protorev/v1beta1/tx.registry"; -import * as _536 from "./smartaccount/v1beta1/tx.registry"; -import * as _537 from "./superfluid/tx.registry"; -import * as _538 from "./tokenfactory/v1beta1/tx.registry"; -import * as _539 from "./txfees/v1beta1/tx.registry"; -import * as _540 from "./valset-pref/v1beta1/tx.registry"; -import * as _541 from "./concentratedliquidity/v1beta1/query.rpc.Query"; -import * as _542 from "./cosmwasmpool/v1beta1/query.rpc.Query"; -import * as _543 from "./gamm/v1beta1/query.rpc.Query"; -import * as _544 from "./incentives/query.rpc.Query"; -import * as _545 from "./lockup/query.rpc.Query"; -import * as _546 from "./pool-incentives/v1beta1/query.rpc.Query"; -import * as _547 from "./poolmanager/v1beta1/query.rpc.Query"; -import * as _548 from "./protorev/v1beta1/query.rpc.Query"; -import * as _549 from "./smartaccount/v1beta1/query.rpc.Query"; -import * as _550 from "./superfluid/query.rpc.Query"; -import * as _551 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _552 from "./txfees/v1beta1/query.rpc.Query"; -import * as _553 from "./valset-pref/v1beta1/query.rpc.Query"; -import * as _554 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; -import * as _555 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; -import * as _556 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; -import * as _557 from "./gamm/pool-models/stableswap/tx.rpc.msg"; -import * as _558 from "./gamm/v1beta1/tx.rpc.msg"; -import * as _559 from "./incentives/tx.rpc.msg"; -import * as _560 from "./lockup/tx.rpc.msg"; -import * as _561 from "./poolmanager/v1beta1/tx.rpc.msg"; -import * as _562 from "./protorev/v1beta1/tx.rpc.msg"; -import * as _563 from "./smartaccount/v1beta1/tx.rpc.msg"; -import * as _564 from "./superfluid/tx.rpc.msg"; -import * as _565 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _566 from "./txfees/v1beta1/tx.rpc.msg"; -import * as _567 from "./valset-pref/v1beta1/tx.rpc.msg"; -import * as _656 from "./rpc.query"; -import * as _657 from "./rpc.tx"; +import * as _211 from "./accum/v1beta1/accum"; +import * as _212 from "./concentratedliquidity/params"; +import * as _213 from "./cosmwasmpool/v1beta1/genesis"; +import * as _214 from "./cosmwasmpool/v1beta1/gov"; +import * as _215 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; +import * as _216 from "./cosmwasmpool/v1beta1/model/module_query_msg"; +import * as _217 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; +import * as _218 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; +import * as _219 from "./cosmwasmpool/v1beta1/model/pool"; +import * as _220 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; +import * as _221 from "./cosmwasmpool/v1beta1/model/tx"; +import * as _222 from "./cosmwasmpool/v1beta1/params"; +import * as _223 from "./cosmwasmpool/v1beta1/query"; +import * as _224 from "./cosmwasmpool/v1beta1/tx"; +import * as _225 from "./gamm/pool-models/balancer/balancerPool"; +import * as _226 from "./gamm/v1beta1/genesis"; +import * as _227 from "./gamm/v1beta1/gov"; +import * as _228 from "./gamm/v1beta1/query"; +import * as _229 from "./gamm/v1beta1/shared"; +import * as _230 from "./gamm/v1beta1/tx"; +import * as _231 from "./gamm/pool-models/balancer/tx/tx"; +import * as _232 from "./gamm/pool-models/stableswap/stableswap_pool"; +import * as _233 from "./gamm/pool-models/stableswap/tx"; +import * as _234 from "./incentives/gauge"; +import * as _235 from "./incentives/genesis"; +import * as _236 from "./incentives/gov"; +import * as _237 from "./incentives/group"; +import * as _238 from "./incentives/params"; +import * as _239 from "./incentives/query"; +import * as _240 from "./incentives/tx"; +import * as _241 from "./lockup/genesis"; +import * as _242 from "./lockup/lock"; +import * as _243 from "./lockup/params"; +import * as _244 from "./lockup/query"; +import * as _245 from "./lockup/tx"; +import * as _246 from "./pool-incentives/v1beta1/genesis"; +import * as _247 from "./pool-incentives/v1beta1/gov"; +import * as _248 from "./pool-incentives/v1beta1/incentives"; +import * as _249 from "./pool-incentives/v1beta1/query"; +import * as _250 from "./pool-incentives/v1beta1/shared"; +import * as _251 from "./poolmanager/v1beta1/genesis"; +import * as _252 from "./poolmanager/v1beta1/gov"; +import * as _253 from "./poolmanager/v1beta1/module_route"; +import * as _254 from "./poolmanager/v1beta1/query"; +import * as _255 from "./poolmanager/v1beta1/swap_route"; +import * as _256 from "./poolmanager/v1beta1/tx"; +import * as _257 from "./protorev/v1beta1/genesis"; +import * as _258 from "./protorev/v1beta1/gov"; +import * as _259 from "./protorev/v1beta1/params"; +import * as _260 from "./protorev/v1beta1/protorev"; +import * as _261 from "./protorev/v1beta1/query"; +import * as _262 from "./protorev/v1beta1/tx"; +import * as _263 from "./smartaccount/v1beta1/genesis"; +import * as _264 from "./smartaccount/v1beta1/models"; +import * as _265 from "./smartaccount/v1beta1/params"; +import * as _266 from "./smartaccount/v1beta1/query"; +import * as _267 from "./smartaccount/v1beta1/tx"; +import * as _268 from "./superfluid/genesis"; +import * as _269 from "./superfluid/params"; +import * as _270 from "./superfluid/query"; +import * as _271 from "./superfluid/superfluid"; +import * as _272 from "./superfluid/tx"; +import * as _273 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _274 from "./tokenfactory/v1beta1/genesis"; +import * as _275 from "./tokenfactory/v1beta1/params"; +import * as _276 from "./tokenfactory/v1beta1/query"; +import * as _277 from "./tokenfactory/v1beta1/tx"; +import * as _278 from "./txfees/v1beta1/feetoken"; +import * as _279 from "./txfees/v1beta1/genesis"; +import * as _280 from "./txfees/v1beta1/gov"; +import * as _281 from "./txfees/v1beta1/params"; +import * as _282 from "./txfees/v1beta1/query"; +import * as _283 from "./txfees/v1beta1/tx"; +import * as _284 from "./valset-pref/v1beta1/query"; +import * as _285 from "./valset-pref/v1beta1/state"; +import * as _286 from "./valset-pref/v1beta1/tx"; +import * as _523 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; +import * as _524 from "./concentratedliquidity/v1beta1/tx.amino"; +import * as _525 from "./gamm/pool-models/balancer/tx/tx.amino"; +import * as _526 from "./gamm/pool-models/stableswap/tx.amino"; +import * as _527 from "./gamm/v1beta1/tx.amino"; +import * as _528 from "./incentives/tx.amino"; +import * as _529 from "./lockup/tx.amino"; +import * as _530 from "./poolmanager/v1beta1/tx.amino"; +import * as _531 from "./protorev/v1beta1/tx.amino"; +import * as _532 from "./smartaccount/v1beta1/tx.amino"; +import * as _533 from "./superfluid/tx.amino"; +import * as _534 from "./tokenfactory/v1beta1/tx.amino"; +import * as _535 from "./txfees/v1beta1/tx.amino"; +import * as _536 from "./valset-pref/v1beta1/tx.amino"; +import * as _537 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; +import * as _538 from "./concentratedliquidity/v1beta1/tx.registry"; +import * as _539 from "./gamm/pool-models/balancer/tx/tx.registry"; +import * as _540 from "./gamm/pool-models/stableswap/tx.registry"; +import * as _541 from "./gamm/v1beta1/tx.registry"; +import * as _542 from "./incentives/tx.registry"; +import * as _543 from "./lockup/tx.registry"; +import * as _544 from "./poolmanager/v1beta1/tx.registry"; +import * as _545 from "./protorev/v1beta1/tx.registry"; +import * as _546 from "./smartaccount/v1beta1/tx.registry"; +import * as _547 from "./superfluid/tx.registry"; +import * as _548 from "./tokenfactory/v1beta1/tx.registry"; +import * as _549 from "./txfees/v1beta1/tx.registry"; +import * as _550 from "./valset-pref/v1beta1/tx.registry"; +import * as _551 from "./concentratedliquidity/v1beta1/query.rpc.Query"; +import * as _552 from "./cosmwasmpool/v1beta1/query.rpc.Query"; +import * as _553 from "./gamm/v1beta1/query.rpc.Query"; +import * as _554 from "./incentives/query.rpc.Query"; +import * as _555 from "./lockup/query.rpc.Query"; +import * as _556 from "./pool-incentives/v1beta1/query.rpc.Query"; +import * as _557 from "./poolmanager/v1beta1/query.rpc.Query"; +import * as _558 from "./protorev/v1beta1/query.rpc.Query"; +import * as _559 from "./smartaccount/v1beta1/query.rpc.Query"; +import * as _560 from "./superfluid/query.rpc.Query"; +import * as _561 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _562 from "./txfees/v1beta1/query.rpc.Query"; +import * as _563 from "./valset-pref/v1beta1/query.rpc.Query"; +import * as _564 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; +import * as _565 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; +import * as _566 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; +import * as _567 from "./gamm/pool-models/stableswap/tx.rpc.msg"; +import * as _568 from "./gamm/v1beta1/tx.rpc.msg"; +import * as _569 from "./incentives/tx.rpc.msg"; +import * as _570 from "./lockup/tx.rpc.msg"; +import * as _571 from "./poolmanager/v1beta1/tx.rpc.msg"; +import * as _572 from "./protorev/v1beta1/tx.rpc.msg"; +import * as _573 from "./smartaccount/v1beta1/tx.rpc.msg"; +import * as _574 from "./superfluid/tx.rpc.msg"; +import * as _575 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _576 from "./txfees/v1beta1/tx.rpc.msg"; +import * as _577 from "./valset-pref/v1beta1/tx.rpc.msg"; +import * as _666 from "./rpc.query"; +import * as _667 from "./rpc.tx"; export namespace osmosis { export namespace accum { export const v1beta1 = { - ..._205 + ..._211 }; } export const concentratedliquidity = { - ..._206, + ..._212, poolmodel: { concentrated: { v1beta1: { - ..._513, - ..._527, - ..._554 + ..._523, + ..._537, + ..._564 } } }, v1beta1: { - ..._514, - ..._528, - ..._541, - ..._555 + ..._524, + ..._538, + ..._551, + ..._565 } }; export namespace cosmwasmpool { export const v1beta1 = { - ..._207, - ..._208, - ..._209, - ..._210, - ..._211, - ..._212, ..._213, ..._214, ..._215, ..._216, ..._217, ..._218, - ..._542 - }; - } - export namespace gamm { - export const v1beta1 = { ..._219, ..._220, ..._221, ..._222, ..._223, ..._224, - ..._517, - ..._531, - ..._543, - ..._558 + ..._552 + }; + } + export namespace gamm { + export const v1beta1 = { + ..._225, + ..._226, + ..._227, + ..._228, + ..._229, + ..._230, + ..._527, + ..._541, + ..._553, + ..._568 }; export namespace poolmodels { export namespace balancer { export const v1beta1 = { - ..._225, - ..._515, - ..._529, - ..._556 + ..._231, + ..._525, + ..._539, + ..._566 }; } export namespace stableswap { export const v1beta1 = { - ..._226, - ..._227, - ..._516, - ..._530, - ..._557 + ..._232, + ..._233, + ..._526, + ..._540, + ..._567 }; } } } export const incentives = { - ..._228, - ..._229, - ..._230, - ..._231, - ..._232, - ..._233, ..._234, - ..._518, - ..._532, - ..._544, - ..._559 - }; - export const lockup = { ..._235, ..._236, ..._237, ..._238, ..._239, - ..._519, - ..._533, - ..._545, - ..._560 + ..._240, + ..._528, + ..._542, + ..._554, + ..._569 + }; + export const lockup = { + ..._241, + ..._242, + ..._243, + ..._244, + ..._245, + ..._529, + ..._543, + ..._555, + ..._570 }; export namespace poolincentives { export const v1beta1 = { - ..._240, - ..._241, - ..._242, - ..._243, - ..._244, - ..._546 - }; - } - export namespace poolmanager { - export const v1beta1 = { - ..._245, ..._246, ..._247, ..._248, ..._249, ..._250, - ..._520, - ..._534, - ..._547, - ..._561 + ..._556 }; } - export namespace protorev { + export namespace poolmanager { export const v1beta1 = { ..._251, ..._252, @@ -261,76 +247,90 @@ export namespace osmosis { ..._254, ..._255, ..._256, - ..._521, - ..._535, - ..._548, - ..._562 + ..._530, + ..._544, + ..._557, + ..._571 }; } - export namespace smartaccount { + export namespace protorev { export const v1beta1 = { ..._257, ..._258, ..._259, ..._260, ..._261, - ..._522, - ..._536, - ..._549, - ..._563 + ..._262, + ..._531, + ..._545, + ..._558, + ..._572 }; } - export const superfluid = { - ..._262, - ..._263, - ..._264, - ..._265, - ..._266, - ..._523, - ..._537, - ..._550, - ..._564 - }; - export namespace tokenfactory { + export namespace smartaccount { export const v1beta1 = { + ..._263, + ..._264, + ..._265, + ..._266, ..._267, - ..._268, - ..._269, - ..._270, - ..._271, - ..._524, - ..._538, - ..._551, - ..._565 + ..._532, + ..._546, + ..._559, + ..._573 }; } - export namespace txfees { + export const superfluid = { + ..._268, + ..._269, + ..._270, + ..._271, + ..._272, + ..._533, + ..._547, + ..._560, + ..._574 + }; + export namespace tokenfactory { export const v1beta1 = { - ..._272, ..._273, ..._274, ..._275, ..._276, ..._277, - ..._525, - ..._539, - ..._552, - ..._566 + ..._534, + ..._548, + ..._561, + ..._575 }; } - export namespace valsetpref { + export namespace txfees { export const v1beta1 = { ..._278, ..._279, ..._280, - ..._526, - ..._540, - ..._553, - ..._567 + ..._281, + ..._282, + ..._283, + ..._535, + ..._549, + ..._562, + ..._576 + }; + } + export namespace valsetpref { + export const v1beta1 = { + ..._284, + ..._285, + ..._286, + ..._536, + ..._550, + ..._563, + ..._577 }; } export const ClientFactory = { - ..._656, - ..._657 + ..._666, + ..._667 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/bundle.ts b/packages/types/protobuf/codegen/pstake/bundle.ts index ab2f01173..6fcc20ad9 100644 --- a/packages/types/protobuf/codegen/pstake/bundle.ts +++ b/packages/types/protobuf/codegen/pstake/bundle.ts @@ -1,83 +1,69 @@ -import * as _281 from "./liquidstake/v1beta1/genesis"; -import * as _282 from "./liquidstake/v1beta1/liquidstake"; -import * as _283 from "./liquidstake/v1beta1/query"; -import * as _284 from "./liquidstake/v1beta1/tx"; -import * as _285 from "./liquidstakeibc/v1beta1/genesis"; -import * as _286 from "./liquidstakeibc/v1beta1/liquidstakeibc"; -import * as _287 from "./liquidstakeibc/v1beta1/msgs"; -import * as _288 from "./liquidstakeibc/v1beta1/params"; -import * as _289 from "./liquidstakeibc/v1beta1/query"; -import * as _290 from "./lscosmos/v1beta1/genesis"; -import * as _291 from "./lscosmos/v1beta1/governance_proposal"; -import * as _292 from "./lscosmos/v1beta1/lscosmos"; -import * as _293 from "./lscosmos/v1beta1/msgs"; -import * as _294 from "./lscosmos/v1beta1/params"; -import * as _295 from "./lscosmos/v1beta1/query"; -import * as _296 from "./ratesync/v1beta1/contract"; -import * as _297 from "./ratesync/v1beta1/genesis"; -import * as _298 from "./ratesync/v1beta1/params"; -import * as _299 from "./ratesync/v1beta1/query"; -import * as _300 from "./ratesync/v1beta1/ratesync"; -import * as _301 from "./ratesync/v1beta1/tx"; -import * as _568 from "./liquidstake/v1beta1/tx.amino"; -import * as _569 from "./liquidstakeibc/v1beta1/msgs.amino"; -import * as _570 from "./lscosmos/v1beta1/msgs.amino"; -import * as _571 from "./ratesync/v1beta1/tx.amino"; -import * as _572 from "./liquidstake/v1beta1/tx.registry"; -import * as _573 from "./liquidstakeibc/v1beta1/msgs.registry"; -import * as _574 from "./lscosmos/v1beta1/msgs.registry"; -import * as _575 from "./ratesync/v1beta1/tx.registry"; -import * as _576 from "./liquidstake/v1beta1/query.rpc.Query"; -import * as _577 from "./liquidstakeibc/v1beta1/query.rpc.Query"; -import * as _578 from "./lscosmos/v1beta1/query.rpc.Query"; -import * as _579 from "./ratesync/v1beta1/query.rpc.Query"; -import * as _580 from "./liquidstake/v1beta1/tx.rpc.msg"; -import * as _581 from "./liquidstakeibc/v1beta1/msgs.rpc.msg"; -import * as _582 from "./lscosmos/v1beta1/msgs.rpc.msg"; -import * as _583 from "./ratesync/v1beta1/tx.rpc.msg"; -import * as _658 from "./rpc.query"; -import * as _659 from "./rpc.tx"; +import * as _287 from "./liquidstake/v1beta1/genesis"; +import * as _288 from "./liquidstake/v1beta1/liquidstake"; +import * as _289 from "./liquidstake/v1beta1/query"; +import * as _290 from "./liquidstake/v1beta1/tx"; +import * as _291 from "./liquidstakeibc/v1beta1/genesis"; +import * as _292 from "./liquidstakeibc/v1beta1/liquidstakeibc"; +import * as _293 from "./liquidstakeibc/v1beta1/msgs"; +import * as _294 from "./liquidstakeibc/v1beta1/params"; +import * as _295 from "./liquidstakeibc/v1beta1/query"; +import * as _296 from "./lscosmos/v1beta1/genesis"; +import * as _297 from "./lscosmos/v1beta1/governance_proposal"; +import * as _298 from "./lscosmos/v1beta1/lscosmos"; +import * as _299 from "./lscosmos/v1beta1/msgs"; +import * as _300 from "./lscosmos/v1beta1/params"; +import * as _301 from "./lscosmos/v1beta1/query"; +import * as _302 from "./ratesync/v1beta1/contract"; +import * as _303 from "./ratesync/v1beta1/genesis"; +import * as _304 from "./ratesync/v1beta1/params"; +import * as _305 from "./ratesync/v1beta1/query"; +import * as _306 from "./ratesync/v1beta1/ratesync"; +import * as _307 from "./ratesync/v1beta1/tx"; +import * as _578 from "./liquidstake/v1beta1/tx.amino"; +import * as _579 from "./liquidstakeibc/v1beta1/msgs.amino"; +import * as _580 from "./lscosmos/v1beta1/msgs.amino"; +import * as _581 from "./ratesync/v1beta1/tx.amino"; +import * as _582 from "./liquidstake/v1beta1/tx.registry"; +import * as _583 from "./liquidstakeibc/v1beta1/msgs.registry"; +import * as _584 from "./lscosmos/v1beta1/msgs.registry"; +import * as _585 from "./ratesync/v1beta1/tx.registry"; +import * as _586 from "./liquidstake/v1beta1/query.rpc.Query"; +import * as _587 from "./liquidstakeibc/v1beta1/query.rpc.Query"; +import * as _588 from "./lscosmos/v1beta1/query.rpc.Query"; +import * as _589 from "./ratesync/v1beta1/query.rpc.Query"; +import * as _590 from "./liquidstake/v1beta1/tx.rpc.msg"; +import * as _591 from "./liquidstakeibc/v1beta1/msgs.rpc.msg"; +import * as _592 from "./lscosmos/v1beta1/msgs.rpc.msg"; +import * as _593 from "./ratesync/v1beta1/tx.rpc.msg"; +import * as _668 from "./rpc.query"; +import * as _669 from "./rpc.tx"; export namespace pstake { export namespace liquidstake { export const v1beta1 = { - ..._281, - ..._282, - ..._283, - ..._284, - ..._568, - ..._572, - ..._576, - ..._580 - }; - } - export namespace liquidstakeibc { - export const v1beta1 = { - ..._285, - ..._286, ..._287, ..._288, ..._289, - ..._569, - ..._573, - ..._577, - ..._581 + ..._290, + ..._578, + ..._582, + ..._586, + ..._590 }; } - export namespace lscosmos { + export namespace liquidstakeibc { export const v1beta1 = { - ..._290, ..._291, ..._292, ..._293, ..._294, ..._295, - ..._570, - ..._574, - ..._578, - ..._582 + ..._579, + ..._583, + ..._587, + ..._591 }; } - export namespace ratesync { + export namespace lscosmos { export const v1beta1 = { ..._296, ..._297, @@ -85,14 +71,28 @@ export namespace pstake { ..._299, ..._300, ..._301, - ..._571, - ..._575, - ..._579, - ..._583 + ..._580, + ..._584, + ..._588, + ..._592 + }; + } + export namespace ratesync { + export const v1beta1 = { + ..._302, + ..._303, + ..._304, + ..._305, + ..._306, + ..._307, + ..._581, + ..._585, + ..._589, + ..._593 }; } export const ClientFactory = { - ..._658, - ..._659 + ..._668, + ..._669 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/publicawesome/bundle.ts b/packages/types/protobuf/codegen/publicawesome/bundle.ts index e1434349d..31378642d 100644 --- a/packages/types/protobuf/codegen/publicawesome/bundle.ts +++ b/packages/types/protobuf/codegen/publicawesome/bundle.ts @@ -1,88 +1,88 @@ -import * as _302 from "./stargaze/alloc/v1beta1/genesis"; -import * as _303 from "./stargaze/alloc/v1beta1/params"; -import * as _304 from "./stargaze/alloc/v1beta1/query"; -import * as _305 from "./stargaze/alloc/v1beta1/tx"; -import * as _306 from "./stargaze/cron/v1/cron"; -import * as _307 from "./stargaze/cron/v1/genesis"; -import * as _308 from "./stargaze/cron/v1/proposal"; -import * as _309 from "./stargaze/cron/v1/query"; -import * as _310 from "./stargaze/cron/v1/tx"; -import * as _311 from "./stargaze/globalfee/v1/genesis"; -import * as _312 from "./stargaze/globalfee/v1/globalfee"; -import * as _313 from "./stargaze/globalfee/v1/proposal"; -import * as _314 from "./stargaze/globalfee/v1/query"; -import * as _315 from "./stargaze/globalfee/v1/tx"; -import * as _316 from "./stargaze/mint/v1beta1/genesis"; -import * as _317 from "./stargaze/mint/v1beta1/mint"; -import * as _318 from "./stargaze/mint/v1beta1/query"; -import * as _319 from "./stargaze/mint/v1beta1/tx"; -import * as _584 from "./stargaze/alloc/v1beta1/tx.amino"; -import * as _585 from "./stargaze/cron/v1/tx.amino"; -import * as _586 from "./stargaze/globalfee/v1/tx.amino"; -import * as _587 from "./stargaze/alloc/v1beta1/tx.registry"; -import * as _588 from "./stargaze/cron/v1/tx.registry"; -import * as _589 from "./stargaze/globalfee/v1/tx.registry"; -import * as _590 from "./stargaze/alloc/v1beta1/query.rpc.Query"; -import * as _591 from "./stargaze/cron/v1/query.rpc.Query"; -import * as _592 from "./stargaze/globalfee/v1/query.rpc.Query"; -import * as _593 from "./stargaze/mint/v1beta1/query.rpc.Query"; -import * as _594 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; -import * as _595 from "./stargaze/cron/v1/tx.rpc.msg"; -import * as _596 from "./stargaze/globalfee/v1/tx.rpc.msg"; -import * as _660 from "./rpc.query"; -import * as _661 from "./rpc.tx"; +import * as _308 from "./stargaze/alloc/v1beta1/genesis"; +import * as _309 from "./stargaze/alloc/v1beta1/params"; +import * as _310 from "./stargaze/alloc/v1beta1/query"; +import * as _311 from "./stargaze/alloc/v1beta1/tx"; +import * as _312 from "./stargaze/cron/v1/cron"; +import * as _313 from "./stargaze/cron/v1/genesis"; +import * as _314 from "./stargaze/cron/v1/proposal"; +import * as _315 from "./stargaze/cron/v1/query"; +import * as _316 from "./stargaze/cron/v1/tx"; +import * as _317 from "./stargaze/globalfee/v1/genesis"; +import * as _318 from "./stargaze/globalfee/v1/globalfee"; +import * as _319 from "./stargaze/globalfee/v1/proposal"; +import * as _320 from "./stargaze/globalfee/v1/query"; +import * as _321 from "./stargaze/globalfee/v1/tx"; +import * as _322 from "./stargaze/mint/v1beta1/genesis"; +import * as _323 from "./stargaze/mint/v1beta1/mint"; +import * as _324 from "./stargaze/mint/v1beta1/query"; +import * as _325 from "./stargaze/mint/v1beta1/tx"; +import * as _594 from "./stargaze/alloc/v1beta1/tx.amino"; +import * as _595 from "./stargaze/cron/v1/tx.amino"; +import * as _596 from "./stargaze/globalfee/v1/tx.amino"; +import * as _597 from "./stargaze/alloc/v1beta1/tx.registry"; +import * as _598 from "./stargaze/cron/v1/tx.registry"; +import * as _599 from "./stargaze/globalfee/v1/tx.registry"; +import * as _600 from "./stargaze/alloc/v1beta1/query.rpc.Query"; +import * as _601 from "./stargaze/cron/v1/query.rpc.Query"; +import * as _602 from "./stargaze/globalfee/v1/query.rpc.Query"; +import * as _603 from "./stargaze/mint/v1beta1/query.rpc.Query"; +import * as _604 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; +import * as _605 from "./stargaze/cron/v1/tx.rpc.msg"; +import * as _606 from "./stargaze/globalfee/v1/tx.rpc.msg"; +import * as _670 from "./rpc.query"; +import * as _671 from "./rpc.tx"; export namespace publicawesome { export namespace stargaze { export namespace alloc { export const v1beta1 = { - ..._302, - ..._303, - ..._304, - ..._305, - ..._584, - ..._587, - ..._590, - ..._594 - }; - } - export namespace cron { - export const v1 = { - ..._306, - ..._307, ..._308, ..._309, ..._310, - ..._585, - ..._588, - ..._591, - ..._595 + ..._311, + ..._594, + ..._597, + ..._600, + ..._604 }; } - export namespace globalfee { + export namespace cron { export const v1 = { - ..._311, ..._312, ..._313, ..._314, ..._315, - ..._586, - ..._589, - ..._592, - ..._596 + ..._316, + ..._595, + ..._598, + ..._601, + ..._605 }; } - export namespace mint { - export const v1beta1 = { - ..._316, + export namespace globalfee { + export const v1 = { ..._317, ..._318, ..._319, - ..._593 + ..._320, + ..._321, + ..._596, + ..._599, + ..._602, + ..._606 + }; + } + export namespace mint { + export const v1beta1 = { + ..._322, + ..._323, + ..._324, + ..._325, + ..._603 }; } } export const ClientFactory = { - ..._660, - ..._661 + ..._670, + ..._671 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/regen/bundle.ts b/packages/types/protobuf/codegen/regen/bundle.ts index a7f80b600..2368af012 100644 --- a/packages/types/protobuf/codegen/regen/bundle.ts +++ b/packages/types/protobuf/codegen/regen/bundle.ts @@ -1,134 +1,134 @@ -import * as _320 from "./data/v1/events"; -import * as _321 from "./data/v1/state"; -import * as _322 from "./data/v1/tx"; -import * as _323 from "./data/v1/types"; -import * as _324 from "./data/v2/events"; -import * as _325 from "./data/v2/state"; -import * as _326 from "./data/v2/tx"; -import * as _327 from "./data/v2/types"; -import * as _328 from "./ecocredit/basket/v1/events"; -import * as _329 from "./ecocredit/basket/v1/state"; -import * as _330 from "./ecocredit/basket/v1/tx"; -import * as _331 from "./ecocredit/basket/v1/types"; -import * as _332 from "./ecocredit/marketplace/v1/events"; -import * as _333 from "./ecocredit/marketplace/v1/state"; -import * as _334 from "./ecocredit/marketplace/v1/tx"; -import * as _335 from "./ecocredit/marketplace/v1/types"; -import * as _336 from "./ecocredit/orderbook/v1alpha1/memory"; -import * as _337 from "./ecocredit/v1/events"; -import * as _338 from "./ecocredit/v1/state"; -import * as _339 from "./ecocredit/v1/tx"; -import * as _340 from "./ecocredit/v1/types"; -import * as _341 from "./ecocredit/v1alpha1/events"; -import * as _342 from "./ecocredit/v1alpha1/genesis"; -import * as _343 from "./ecocredit/v1alpha1/tx"; -import * as _344 from "./ecocredit/v1alpha1/types"; -import * as _345 from "./intertx/v1/query"; -import * as _346 from "./intertx/v1/tx"; -import * as _597 from "./data/v1/tx.amino"; -import * as _598 from "./data/v2/tx.amino"; -import * as _599 from "./ecocredit/basket/v1/tx.amino"; -import * as _600 from "./ecocredit/marketplace/v1/tx.amino"; -import * as _601 from "./ecocredit/v1/tx.amino"; -import * as _602 from "./ecocredit/v1alpha1/tx.amino"; -import * as _603 from "./intertx/v1/tx.amino"; -import * as _604 from "./data/v1/tx.registry"; -import * as _605 from "./data/v2/tx.registry"; -import * as _606 from "./ecocredit/basket/v1/tx.registry"; -import * as _607 from "./ecocredit/marketplace/v1/tx.registry"; -import * as _608 from "./ecocredit/v1/tx.registry"; -import * as _609 from "./ecocredit/v1alpha1/tx.registry"; -import * as _610 from "./intertx/v1/tx.registry"; -import * as _611 from "./intertx/v1/query.rpc.Query"; -import * as _612 from "./data/v1/tx.rpc.msg"; -import * as _613 from "./data/v2/tx.rpc.msg"; -import * as _614 from "./ecocredit/basket/v1/tx.rpc.msg"; -import * as _615 from "./ecocredit/marketplace/v1/tx.rpc.msg"; -import * as _616 from "./ecocredit/v1/tx.rpc.msg"; -import * as _617 from "./ecocredit/v1alpha1/tx.rpc.msg"; -import * as _618 from "./intertx/v1/tx.rpc.msg"; -import * as _662 from "./rpc.query"; -import * as _663 from "./rpc.tx"; +import * as _326 from "./data/v1/events"; +import * as _327 from "./data/v1/state"; +import * as _328 from "./data/v1/tx"; +import * as _329 from "./data/v1/types"; +import * as _330 from "./data/v2/events"; +import * as _331 from "./data/v2/state"; +import * as _332 from "./data/v2/tx"; +import * as _333 from "./data/v2/types"; +import * as _334 from "./ecocredit/basket/v1/events"; +import * as _335 from "./ecocredit/basket/v1/state"; +import * as _336 from "./ecocredit/basket/v1/tx"; +import * as _337 from "./ecocredit/basket/v1/types"; +import * as _338 from "./ecocredit/marketplace/v1/events"; +import * as _339 from "./ecocredit/marketplace/v1/state"; +import * as _340 from "./ecocredit/marketplace/v1/tx"; +import * as _341 from "./ecocredit/marketplace/v1/types"; +import * as _342 from "./ecocredit/orderbook/v1alpha1/memory"; +import * as _343 from "./ecocredit/v1/events"; +import * as _344 from "./ecocredit/v1/state"; +import * as _345 from "./ecocredit/v1/tx"; +import * as _346 from "./ecocredit/v1/types"; +import * as _347 from "./ecocredit/v1alpha1/events"; +import * as _348 from "./ecocredit/v1alpha1/genesis"; +import * as _349 from "./ecocredit/v1alpha1/tx"; +import * as _350 from "./ecocredit/v1alpha1/types"; +import * as _351 from "./intertx/v1/query"; +import * as _352 from "./intertx/v1/tx"; +import * as _607 from "./data/v1/tx.amino"; +import * as _608 from "./data/v2/tx.amino"; +import * as _609 from "./ecocredit/basket/v1/tx.amino"; +import * as _610 from "./ecocredit/marketplace/v1/tx.amino"; +import * as _611 from "./ecocredit/v1/tx.amino"; +import * as _612 from "./ecocredit/v1alpha1/tx.amino"; +import * as _613 from "./intertx/v1/tx.amino"; +import * as _614 from "./data/v1/tx.registry"; +import * as _615 from "./data/v2/tx.registry"; +import * as _616 from "./ecocredit/basket/v1/tx.registry"; +import * as _617 from "./ecocredit/marketplace/v1/tx.registry"; +import * as _618 from "./ecocredit/v1/tx.registry"; +import * as _619 from "./ecocredit/v1alpha1/tx.registry"; +import * as _620 from "./intertx/v1/tx.registry"; +import * as _621 from "./intertx/v1/query.rpc.Query"; +import * as _622 from "./data/v1/tx.rpc.msg"; +import * as _623 from "./data/v2/tx.rpc.msg"; +import * as _624 from "./ecocredit/basket/v1/tx.rpc.msg"; +import * as _625 from "./ecocredit/marketplace/v1/tx.rpc.msg"; +import * as _626 from "./ecocredit/v1/tx.rpc.msg"; +import * as _627 from "./ecocredit/v1alpha1/tx.rpc.msg"; +import * as _628 from "./intertx/v1/tx.rpc.msg"; +import * as _672 from "./rpc.query"; +import * as _673 from "./rpc.tx"; export namespace regen { export namespace data { export const v1 = { - ..._320, - ..._321, - ..._322, - ..._323, - ..._597, - ..._604, - ..._612 - }; - export const v2 = { - ..._324, - ..._325, ..._326, ..._327, - ..._598, - ..._605, - ..._613 + ..._328, + ..._329, + ..._607, + ..._614, + ..._622 + }; + export const v2 = { + ..._330, + ..._331, + ..._332, + ..._333, + ..._608, + ..._615, + ..._623 }; } export namespace ecocredit { export namespace basket { export const v1 = { - ..._328, - ..._329, - ..._330, - ..._331, - ..._599, - ..._606, - ..._614 + ..._334, + ..._335, + ..._336, + ..._337, + ..._609, + ..._616, + ..._624 }; } export namespace marketplace { export const v1 = { - ..._332, - ..._333, - ..._334, - ..._335, - ..._600, - ..._607, - ..._615 + ..._338, + ..._339, + ..._340, + ..._341, + ..._610, + ..._617, + ..._625 }; } export namespace orderbook { export const v1alpha1 = { - ..._336 + ..._342 }; } export const v1 = { - ..._337, - ..._338, - ..._339, - ..._340, - ..._601, - ..._608, - ..._616 - }; - export const v1alpha1 = { - ..._341, - ..._342, ..._343, ..._344, - ..._602, - ..._609, - ..._617 + ..._345, + ..._346, + ..._611, + ..._618, + ..._626 + }; + export const v1alpha1 = { + ..._347, + ..._348, + ..._349, + ..._350, + ..._612, + ..._619, + ..._627 }; } export namespace intertx { export const v1 = { - ..._345, - ..._346, - ..._603, - ..._610, - ..._611, - ..._618 + ..._351, + ..._352, + ..._613, + ..._620, + ..._621, + ..._628 }; } export const ClientFactory = { - ..._662, - ..._663 + ..._672, + ..._673 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/bundle.ts b/packages/types/protobuf/codegen/secret/bundle.ts index 21d80da3d..0b45cdc14 100644 --- a/packages/types/protobuf/codegen/secret/bundle.ts +++ b/packages/types/protobuf/codegen/secret/bundle.ts @@ -1,78 +1,78 @@ -import * as _347 from "./compute/v1beta1/genesis"; -import * as _348 from "./compute/v1beta1/msg"; -import * as _349 from "./compute/v1beta1/query"; -import * as _350 from "./compute/v1beta1/types"; -import * as _351 from "./emergencybutton/v1beta1/genesis"; -import * as _352 from "./emergencybutton/v1beta1/params"; -import * as _353 from "./emergencybutton/v1beta1/query"; -import * as _354 from "./emergencybutton/v1beta1/tx"; -import * as _355 from "./intertx/v1beta1/query"; -import * as _356 from "./intertx/v1beta1/tx"; -import * as _357 from "./registration/v1beta1/genesis"; -import * as _358 from "./registration/v1beta1/msg"; -import * as _359 from "./registration/v1beta1/query"; -import * as _360 from "./registration/v1beta1/types"; -import * as _619 from "./compute/v1beta1/msg.amino"; -import * as _620 from "./emergencybutton/v1beta1/tx.amino"; -import * as _621 from "./intertx/v1beta1/tx.amino"; -import * as _622 from "./compute/v1beta1/msg.registry"; -import * as _623 from "./emergencybutton/v1beta1/tx.registry"; -import * as _624 from "./intertx/v1beta1/tx.registry"; -import * as _625 from "./compute/v1beta1/query.rpc.Query"; -import * as _626 from "./emergencybutton/v1beta1/query.rpc.Query"; -import * as _627 from "./intertx/v1beta1/query.rpc.Query"; -import * as _628 from "./registration/v1beta1/query.rpc.Query"; -import * as _629 from "./compute/v1beta1/msg.rpc.msg"; -import * as _630 from "./emergencybutton/v1beta1/tx.rpc.msg"; -import * as _631 from "./intertx/v1beta1/tx.rpc.msg"; -import * as _664 from "./rpc.query"; -import * as _665 from "./rpc.tx"; +import * as _353 from "./compute/v1beta1/genesis"; +import * as _354 from "./compute/v1beta1/msg"; +import * as _355 from "./compute/v1beta1/query"; +import * as _356 from "./compute/v1beta1/types"; +import * as _357 from "./emergencybutton/v1beta1/genesis"; +import * as _358 from "./emergencybutton/v1beta1/params"; +import * as _359 from "./emergencybutton/v1beta1/query"; +import * as _360 from "./emergencybutton/v1beta1/tx"; +import * as _361 from "./intertx/v1beta1/query"; +import * as _362 from "./intertx/v1beta1/tx"; +import * as _363 from "./registration/v1beta1/genesis"; +import * as _364 from "./registration/v1beta1/msg"; +import * as _365 from "./registration/v1beta1/query"; +import * as _366 from "./registration/v1beta1/types"; +import * as _629 from "./compute/v1beta1/msg.amino"; +import * as _630 from "./emergencybutton/v1beta1/tx.amino"; +import * as _631 from "./intertx/v1beta1/tx.amino"; +import * as _632 from "./compute/v1beta1/msg.registry"; +import * as _633 from "./emergencybutton/v1beta1/tx.registry"; +import * as _634 from "./intertx/v1beta1/tx.registry"; +import * as _635 from "./compute/v1beta1/query.rpc.Query"; +import * as _636 from "./emergencybutton/v1beta1/query.rpc.Query"; +import * as _637 from "./intertx/v1beta1/query.rpc.Query"; +import * as _638 from "./registration/v1beta1/query.rpc.Query"; +import * as _639 from "./compute/v1beta1/msg.rpc.msg"; +import * as _640 from "./emergencybutton/v1beta1/tx.rpc.msg"; +import * as _641 from "./intertx/v1beta1/tx.rpc.msg"; +import * as _674 from "./rpc.query"; +import * as _675 from "./rpc.tx"; export namespace secret { export namespace compute { export const v1beta1 = { - ..._347, - ..._348, - ..._349, - ..._350, - ..._619, - ..._622, - ..._625, - ..._629 + ..._353, + ..._354, + ..._355, + ..._356, + ..._629, + ..._632, + ..._635, + ..._639 }; } export namespace emergencybutton { export const v1beta1 = { - ..._351, - ..._352, - ..._353, - ..._354, - ..._620, - ..._623, - ..._626, - ..._630 + ..._357, + ..._358, + ..._359, + ..._360, + ..._630, + ..._633, + ..._636, + ..._640 }; } export namespace intertx { export const v1beta1 = { - ..._355, - ..._356, - ..._621, - ..._624, - ..._627, - ..._631 + ..._361, + ..._362, + ..._631, + ..._634, + ..._637, + ..._641 }; } export namespace registration { export const v1beta1 = { - ..._357, - ..._358, - ..._359, - ..._360, - ..._628 + ..._363, + ..._364, + ..._365, + ..._366, + ..._638 }; } export const ClientFactory = { - ..._664, - ..._665 + ..._674, + ..._675 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/tendermint/bundle.ts b/packages/types/protobuf/codegen/tendermint/bundle.ts index 3e043ad7a..b19a28221 100644 --- a/packages/types/protobuf/codegen/tendermint/bundle.ts +++ b/packages/types/protobuf/codegen/tendermint/bundle.ts @@ -1,32 +1,32 @@ -import * as _364 from "./abci/types"; -import * as _365 from "./crypto/keys"; -import * as _366 from "./crypto/proof"; -import * as _367 from "./p2p/types"; -import * as _368 from "./types/block"; -import * as _369 from "./types/evidence"; -import * as _370 from "./types/params"; -import * as _371 from "./types/types"; -import * as _372 from "./types/validator"; -import * as _373 from "./version/types"; +import * as _370 from "./abci/types"; +import * as _371 from "./crypto/keys"; +import * as _372 from "./crypto/proof"; +import * as _373 from "./p2p/types"; +import * as _374 from "./types/block"; +import * as _375 from "./types/evidence"; +import * as _376 from "./types/params"; +import * as _377 from "./types/types"; +import * as _378 from "./types/validator"; +import * as _379 from "./version/types"; export namespace tendermint { export const abci = { - ..._364 + ..._370 }; export const crypto = { - ..._365, - ..._366 + ..._371, + ..._372 }; export const p2p = { - ..._367 + ..._373 }; export const types = { - ..._368, - ..._369, - ..._370, - ..._371, - ..._372 + ..._374, + ..._375, + ..._376, + ..._377, + ..._378 }; export const version = { - ..._373 + ..._379 }; } \ No newline at end of file diff --git a/packages/types/protobuf/scripts/codegen.js b/packages/types/protobuf/scripts/codegen.js index 9178f1948..073c70e5c 100644 --- a/packages/types/protobuf/scripts/codegen.js +++ b/packages/types/protobuf/scripts/codegen.js @@ -67,6 +67,7 @@ telescope({ 'ibc.applications.interchain_accounts.controller.v1', 'ibc.core.channel.v1', 'ibc.core.client.v1', + 'ibc.core.connection.v1', 'juno.feeshare.v1', 'juno.mint', 'neutron.contractmanager.v1', diff --git a/packages/types/protobuf/utils.ts b/packages/types/protobuf/utils.ts index 111087f44..a8e04ccf7 100644 --- a/packages/types/protobuf/utils.ts +++ b/packages/types/protobuf/utils.ts @@ -676,7 +676,7 @@ export const decodedStakingStargateMsgToCw = ({ } } -export const PROTOBUF_TYPES: ReadonlyArray<[string, GeneratedType]> = [ +export const getProtobufTypes = (): ReadonlyArray<[string, GeneratedType]> => [ ...cosmosProtoRegistry, ...cosmwasmProtoRegistry, ['/google.protobuf.Timestamp', google.protobuf.Timestamp as GeneratedType], @@ -716,26 +716,27 @@ export const PROTOBUF_TYPES: ReadonlyArray<[string, GeneratedType]> = [ MsgDeleteAllianceProposal as GeneratedType, ], ] -export const typesRegistry = new Registry(PROTOBUF_TYPES) - -export const aminoTypes = new AminoTypes({ - ...cosmosAminoConverters, - ...cosmwasmAminoConverters, - ...junoAminoConverters, - ...osmosisAminoConverters, - ...ibcAminoConverters, - ...stargazeAminoConverters, - ...gaiaAminoConverters, - ...neutronAminoConverters, - ...regenAminoConverters, - ...allianceAminoConverters, - ...circleAminoConverters, - ...kujiraAminoConverters, - ...pstakeAminoConverters, - ...bitsongAminoConverters, - ...secretAminoConverters, - ...omniFlixAminoConverters, -}) +export const getTypesRegistry = () => new Registry(getProtobufTypes()) + +export const getAminoTypes = () => + new AminoTypes({ + ...cosmosAminoConverters, + ...cosmwasmAminoConverters, + ...junoAminoConverters, + ...osmosisAminoConverters, + ...ibcAminoConverters, + ...stargazeAminoConverters, + ...gaiaAminoConverters, + ...neutronAminoConverters, + ...regenAminoConverters, + ...allianceAminoConverters, + ...circleAminoConverters, + ...kujiraAminoConverters, + ...pstakeAminoConverters, + ...bitsongAminoConverters, + ...secretAminoConverters, + ...omniFlixAminoConverters, + }) // Encodes a protobuf message value from its JSON representation into a byte // array. @@ -743,7 +744,7 @@ export const encodeProtobufValue = ( typeUrl: string, value: any ): Uint8Array => { - const type = typesRegistry.lookupType(typeUrl) + const type = getTypesRegistry().lookupType(typeUrl) if (!type) { throw new Error(`Type ${typeUrl} not found in registry.`) } @@ -760,7 +761,7 @@ export const decodeProtobufValue = ( // decoding `Any` types where protobuf interfaces exist. recursive = true ): any => { - const type = typesRegistry.lookupType(typeUrl) + const type = getTypesRegistry().lookupType(typeUrl) if (!type) { throw new Error(`Type ${typeUrl} not found in registry.`) } @@ -789,11 +790,11 @@ export const decodeRawProtobufMsg = ( // Convert protobuf Any into its Amino msg. export const rawProtobufMsgToAmino = ( ...params: Parameters -): AminoMsg => aminoTypes.toAmino(decodeRawProtobufMsg(...params)) +): AminoMsg => getAminoTypes().toAmino(decodeRawProtobufMsg(...params)) // Convert Amino msg into raw protobuf Any. export const aminoToRawProtobufMsg = (msg: AminoMsg): Any => { - const { typeUrl, value } = aminoTypes.fromAmino(msg) + const { typeUrl, value } = getAminoTypes().fromAmino(msg) return { typeUrl, value: encodeProtobufValue(typeUrl, value), diff --git a/packages/utils/README.md b/packages/utils/README.md index 719664e5c..6f756efad 100644 --- a/packages/utils/README.md +++ b/packages/utils/README.md @@ -18,13 +18,34 @@ Options: -h, --help display help for command ``` -### dump-relayer +### dump-go-relayer + +Dump the specified chain Polytone connection(s) in the format expected by the +Go relayer. + +```sh +Usage: yarn dump-go-relayer [options] + +dump Polytone relayer entries for one or multiple chains. passing no arguments will dump entries for all chains + +Options: + -a, --chain-a chain A + -b, --chain-b chain B + -m, --many comma-separated list of chains to dump + -h, --help display help for command +``` + +To dump the entries between two specific chains, specify both chains (with `-a` +and `-b`). To dump all entries for one or multiple chains, use either `-a`, +`-b`, or `-m`. To dump all entries for all chains, pass no arguments. + +### dump-hermes-relayer Dump the specified chain Polytone connection(s) in the format expected by the Hermes relayer. ```sh -Usage: yarn dump-relayer [options] +Usage: yarn dump-hermes-relayer [options] dump Polytone relayer entries for one or multiple chains. passing no arguments will dump entries for all chains diff --git a/packages/utils/package.json b/packages/utils/package.json index 2d9f43afc..781157529 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -6,7 +6,8 @@ "format": "eslint . --fix", "lint": "eslint .", "test": "jest", - "dump-relayer": "ts-node ./scripts/dump-relayer.ts", + "dump-go-relayer": "ts-node ./scripts/dump-go-relayer.ts", + "dump-hermes-relayer": "ts-node ./scripts/dump-hermes-relayer.ts", "log-code-ids": "ts-node ./scripts/log-code-ids.ts" }, "dependencies": { diff --git a/packages/utils/scripts/dump-go-relayer.ts b/packages/utils/scripts/dump-go-relayer.ts new file mode 100644 index 000000000..e4bd6b0a0 --- /dev/null +++ b/packages/utils/scripts/dump-go-relayer.ts @@ -0,0 +1,141 @@ +import { Command } from 'commander' + +import { getChainForChainId } from '../chain' +import { ibcProtoRpcClientRouter } from '../client' +import { SUPPORTED_CHAINS } from '../constants/chains' + +// Parse arguments. +const program = new Command() +program.description( + 'dump Polytone relayer entries for one or multiple chains. passing no arguments will dump entries for all chains' +) +program.option('-a, --chain-a ', 'chain A') +program.option('-b, --chain-b ', 'chain B') +program.option('-m, --many ', 'comma-separated list of chains to dump') +program.parse(process.argv) +const { chainA, chainB, many } = program.opts() + +const failed: { + srcChainId: string + destChainId: string + error: unknown +}[] = [] + +const dumpAll = async (chainIds: string[]) => { + const chains = SUPPORTED_CHAINS.filter((c) => chainIds.includes(c.chainId)) + if (chains.length === 0) { + throw new Error('no chains') + } + + for (const srcChain of chains) { + try { + await dumpChain(srcChain.chainId) + } catch (error) { + failed.push({ + srcChainId: srcChain.chainId, + destChainId: 'ALL', + error, + }) + } + } +} + +const dumpChain = async (srcChainId: string, chainIdFilter?: string[]) => { + const srcChain = SUPPORTED_CHAINS.find((c) => c.chainId === srcChainId) + if (!srcChain) { + throw new Error(`unknown src chain ${srcChainId}`) + } + + const polytoneConnections = Object.entries(srcChain.polytone || {}).filter( + ([chainId]) => !chainIdFilter?.length || chainIdFilter.includes(chainId) + ) + if (polytoneConnections.length === 0) { + throw new Error('no polytone connections') + } + + const srcIbc = await ibcProtoRpcClientRouter.connect(srcChainId) + + const results = await Promise.all( + polytoneConnections.map( + async ([destChainId, polytone]): Promise => { + try { + const srcClientId = ( + await srcIbc.core.connection.v1.connection({ + connectionId: polytone.localConnection, + }) + )?.connection?.clientId + if (!srcClientId) { + throw new Error( + `no src client ID for ${polytone.localConnection} on chain ${srcChainId}` + ) + } + + const destClientId = ( + await ( + await ibcProtoRpcClientRouter.connect(destChainId) + ).core.connection.v1.connection({ + connectionId: polytone.remoteConnection, + }) + )?.connection?.clientId + if (!destClientId) { + throw new Error( + `no dest client ID for ${polytone.remoteConnection} on chain ${destChainId}` + ) + } + + const srcChainName = getChainForChainId(srcChainId).chain_name + const destChainName = getChainForChainId(destChainId).chain_name + + return ` ${srcChainName}-${destChainName}: + src: + chain-id: ${srcChainId} + client-id: ${srcClientId} + connection-id: ${polytone.localConnection} + dst: + chain-id: ${destChainId} + client-id: ${destClientId} + connection-id: ${polytone.remoteConnection} + src-channel-filter: + rule: allowlist + channel-list: + - ${polytone.localChannel}` + } catch (error) { + failed.push({ + srcChainId, + destChainId, + error, + }) + } + } + ) + ) + + console.log(results.filter(Boolean).sort().join('\n')) +} + +const main = async () => { + console.log() + + if (chainA && chainB) { + await dumpChain(chainA, [chainB]) + } else if (chainA) { + await dumpAll(chainA.split(',')) + } else if (chainB) { + await dumpAll(chainB.split(',')) + } else if (many) { + await dumpAll(many.split(',')) + } else { + await dumpAll( + SUPPORTED_CHAINS.flatMap((c) => (c.polytone ? c.chainId : [])) + ) + } + + if (failed.length > 0) { + console.log('\nFAILED:') + console.table(failed) + } + + process.exit(0) +} + +main() diff --git a/packages/utils/scripts/dump-relayer.ts b/packages/utils/scripts/dump-hermes-relayer.ts similarity index 91% rename from packages/utils/scripts/dump-relayer.ts rename to packages/utils/scripts/dump-hermes-relayer.ts index 791a62001..6576e2c62 100644 --- a/packages/utils/scripts/dump-relayer.ts +++ b/packages/utils/scripts/dump-hermes-relayer.ts @@ -71,34 +71,24 @@ const dumpBidirectional = (chainIdA: string, chainIdB: string) => { ?.polytone?.[chainIdB] const chainB = SUPPORTED_CHAINS.find((chain) => chain.chainId === chainIdB) ?.polytone?.[chainIdA] - if (!chainA && !chainB) { + if (!chainA || !chainB) { console.error('Invalid chain pair') return } console.log(chainIdA + ':') - if (chainA) { - console.log(` + console.log(` # polytone to ${chainIdB} (note) - ["wasm.${chainA.note}", "${chainA.localChannel}"],`) - } - if (chainB) { - console.log(` + ["wasm.${chainA.note}", "${chainA.localChannel}"], # polytone from ${chainIdB} (voice) ["wasm.${chainB.voice}", "${chainB.remoteChannel}"],`) - } console.log('\n\n' + chainIdB + ':') - if (chainB) { - console.log(` + console.log(` # polytone to ${chainIdA} (note) - ["wasm.${chainB.note}", "${chainB.localChannel}"],`) - } - if (chainA) { - console.log(` + ["wasm.${chainB.note}", "${chainB.localChannel}"], # polytone from ${chainIdA} (voice) ["wasm.${chainA.voice}", "${chainA.remoteChannel}"],`) - } } if (chainA && chainB) { From 921a64c56672cf9b1da63fa35ca487a193acda14 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 19 Jul 2024 12:15:45 -0400 Subject: [PATCH 328/438] secret testnet DAO creation works! --- .../state/contracts/SecretCwAdminFactory.ts | 30 +++- packages/state/query/queries/chain.ts | 7 + packages/stateful/clients/dao/SecretCwDao.ts | 9 +- .../MultipleChoiceProposalModule.secret.ts | 14 +- .../MultipleChoiceProposalModule.ts | 14 +- .../SingleChoiceProposalModule.secret.ts | 22 ++- .../SingleChoiceProposalModule.ts | 29 ++- .../stateful/components/dao/CreateDaoForm.tsx | 14 +- .../types/contracts/SecretCwAdminFactory.ts | 22 +-- packages/types/contracts/SecretDaoDaoCore.ts | 4 - packages/utils/client.ts | 6 +- packages/utils/constants/chains.ts | 169 +++++++++--------- packages/utils/error.ts | 2 + packages/utils/secret/signingClient.ts | 15 +- 14 files changed, 205 insertions(+), 152 deletions(-) diff --git a/packages/state/contracts/SecretCwAdminFactory.ts b/packages/state/contracts/SecretCwAdminFactory.ts index a4dca9e86..1b9c47f43 100644 --- a/packages/state/contracts/SecretCwAdminFactory.ts +++ b/packages/state/contracts/SecretCwAdminFactory.ts @@ -4,10 +4,7 @@ import { SigningCosmWasmClient, } from '@cosmjs/cosmwasm-stargate' -import { - Coin, - ModuleInstantiateInfo, -} from '@dao-dao/types/contracts/SecretCwAdminFactory' +import { Binary, Coin } from '@dao-dao/types/contracts/SecretCwAdminFactory' export interface SecretCwAdminFactoryReadOnlyInterface { contractAddress: string @@ -28,9 +25,15 @@ export interface SecretCwAdminFactoryInterface sender: string instantiateContractWithSelfAdmin: ( { - moduleInfo, + instantiateMsg, + codeId, + codeHash, + label, }: { - moduleInfo: ModuleInstantiateInfo + instantiateMsg: Binary + codeId: number + codeHash: string + label: string }, fee?: number, memo?: string, @@ -58,9 +61,15 @@ export class SecretCwAdminFactoryClient } instantiateContractWithSelfAdmin = async ( { - moduleInfo, + instantiateMsg, + codeId, + codeHash, + label, }: { - moduleInfo: ModuleInstantiateInfo + instantiateMsg: Binary + codeId: number + codeHash: string + label: string }, fee: number = 1_000_000, memo?: string, @@ -71,7 +80,10 @@ export class SecretCwAdminFactoryClient this.contractAddress, { instantiate_contract_with_self_admin: { - module_info: moduleInfo, + instantiate_msg: instantiateMsg, + code_id: codeId, + code_hash: codeHash, + label, }, }, fee, diff --git a/packages/state/query/queries/chain.ts b/packages/state/query/queries/chain.ts index 23e67ee4d..c67290920 100644 --- a/packages/state/query/queries/chain.ts +++ b/packages/state/query/queries/chain.ts @@ -23,8 +23,10 @@ import { getAllRpcResponse, getCosmWasmClientForChainId, getNativeTokenForChainId, + isSecretNetwork, isValidBech32Address, osmosisProtoRpcClientRouter, + secretCosmWasmClientRouter, stargateClientRouter, } from '@dao-dao/utils' @@ -288,6 +290,11 @@ export const fetchWasmContractAdmin = async ({ chainId: string address: string }): Promise => { + if (isSecretNetwork(chainId)) { + const client = await secretCosmWasmClientRouter.connect(chainId) + return (await client.getContract(address))?.admin ?? null + } + // CosmWasmClient.getContract is not compatible with Terra Classic for some // reason, so use protobuf query directly. const client = await cosmwasmProtoRpcClientRouter.connect(chainId) diff --git a/packages/stateful/clients/dao/SecretCwDao.ts b/packages/stateful/clients/dao/SecretCwDao.ts index 50695bf74..9751171cb 100644 --- a/packages/stateful/clients/dao/SecretCwDao.ts +++ b/packages/stateful/clients/dao/SecretCwDao.ts @@ -80,13 +80,7 @@ export class SecretCwDao extends CwDao { proposalModules: ModuleInstantiateInfo[] ): SecretInstantiateInfo { const { codeIds, codeHashes } = mustGetSupportedChainConfig(chainId) - if ( - !codeHashes || - !codeHashes.QueryAuth || - !codeIds.QueryAuth || - !codeHashes.Cw20Base || - !codeHashes.Cw721Base - ) { + if (!codeHashes || !codeHashes.QueryAuth || !codeIds.QueryAuth) { throw new Error('Codes not properly configured for chain ' + chainId) } @@ -106,6 +100,7 @@ export class SecretCwDao extends CwDao { proposal_modules_instantiate_info: proposalModules, query_auth_code_hash: codeHashes.QueryAuth, query_auth_code_id: codeIds.QueryAuth, + // TODO(secret-testnet): remove snip20_code_hash: codeHashes.Cw20Base, snip721_code_hash: codeHashes.Cw721Base, voting_module_instantiate_info: votingModule, diff --git a/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.secret.ts b/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.secret.ts index ee9805889..6a3a6cb15 100644 --- a/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.secret.ts +++ b/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.secret.ts @@ -152,7 +152,12 @@ export class SecretMultipleChoiceProposalModule extends ProposalModuleBase< }) proposalNumber = Number( - findWasmAttributeValue(events, this.address, 'proposal_id') ?? -1 + findWasmAttributeValue( + this.dao.chainId, + events, + this.address, + 'proposal_id' + ) ?? -1 ) } else { const { events } = await new SecretDaoProposalMultipleClient( @@ -171,7 +176,12 @@ export class SecretMultipleChoiceProposalModule extends ProposalModuleBase< ) proposalNumber = Number( - findWasmAttributeValue(events, this.address, 'proposal_id') ?? -1 + findWasmAttributeValue( + this.dao.chainId, + events, + this.address, + 'proposal_id' + ) ?? -1 ) } diff --git a/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.ts b/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.ts index bfe58c32b..c3db29b1b 100644 --- a/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.ts +++ b/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.ts @@ -201,7 +201,12 @@ export class MultipleChoiceProposalModule extends ProposalModuleBase< ) proposalNumber = Number( - findWasmAttributeValue(events, this.address, 'proposal_id') ?? -1 + findWasmAttributeValue( + this.dao.chainId, + events, + this.address, + 'proposal_id' + ) ?? -1 ) } else { const { events } = await new DaoProposalMultipleClient( @@ -220,7 +225,12 @@ export class MultipleChoiceProposalModule extends ProposalModuleBase< ) proposalNumber = Number( - findWasmAttributeValue(events, this.address, 'proposal_id') ?? -1 + findWasmAttributeValue( + this.dao.chainId, + events, + this.address, + 'proposal_id' + ) ?? -1 ) } diff --git a/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.secret.ts b/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.secret.ts index c19f70408..16b0c7006 100644 --- a/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.secret.ts +++ b/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.secret.ts @@ -176,11 +176,20 @@ export class SecretSingleChoiceProposalModule extends ProposalModuleBase< // pre-propose-approval proposals have a different event isPreProposeApprovalProposal ? Number( - findWasmAttributeValue(events, this.prePropose.address, 'id') ?? - -1 + findWasmAttributeValue( + this.dao.chainId, + events, + this.prePropose.address, + 'id' + ) ?? -1 ) : Number( - findWasmAttributeValue(events, this.address, 'proposal_id') ?? -1 + findWasmAttributeValue( + this.dao.chainId, + events, + this.address, + 'proposal_id' + ) ?? -1 ) } else { const { events } = await new SecretDaoProposalSingleClient( @@ -199,7 +208,12 @@ export class SecretSingleChoiceProposalModule extends ProposalModuleBase< ) proposalNumber = Number( - findWasmAttributeValue(events, this.address, 'proposal_id') ?? -1 + findWasmAttributeValue( + this.dao.chainId, + events, + this.address, + 'proposal_id' + ) ?? -1 ) } diff --git a/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts b/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts index cab01948b..f5c314a17 100644 --- a/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts +++ b/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts @@ -188,7 +188,12 @@ export class SingleChoiceProposalModule extends ProposalModuleBase< ) proposalNumber = Number( - findWasmAttributeValue(events, this.address, 'proposal_id') ?? -1 + findWasmAttributeValue( + this.dao.chainId, + events, + this.address, + 'proposal_id' + ) ?? -1 ) // Every other version supports pre-propose. @@ -218,11 +223,20 @@ export class SingleChoiceProposalModule extends ProposalModuleBase< // pre-propose-approval proposals have a different event isPreProposeApprovalProposal ? Number( - findWasmAttributeValue(events, this.prePropose.address, 'id') ?? - -1 + findWasmAttributeValue( + this.dao.chainId, + events, + this.prePropose.address, + 'id' + ) ?? -1 ) : Number( - findWasmAttributeValue(events, this.address, 'proposal_id') ?? -1 + findWasmAttributeValue( + this.dao.chainId, + events, + this.address, + 'proposal_id' + ) ?? -1 ) } else { const { events } = await new DaoProposalSingleV2Client( @@ -241,7 +255,12 @@ export class SingleChoiceProposalModule extends ProposalModuleBase< ) proposalNumber = Number( - findWasmAttributeValue(events, this.address, 'proposal_id') ?? -1 + findWasmAttributeValue( + this.dao.chainId, + events, + this.address, + 'proposal_id' + ) ?? -1 ) } diff --git a/packages/stateful/components/dao/CreateDaoForm.tsx b/packages/stateful/components/dao/CreateDaoForm.tsx index 08ba88ff8..61fca7713 100644 --- a/packages/stateful/components/dao/CreateDaoForm.tsx +++ b/packages/stateful/components/dao/CreateDaoForm.tsx @@ -478,20 +478,17 @@ export const InnerCreateDaoForm = ({ const instantiateFunds = getFundsFromDaoInstantiateMsg(instantiateMsg) const { events } = await secretInstantiateWithSelfAdmin( { - moduleInfo: { - code_id: codeIds.DaoCore, - code_hash: codeHashes.DaoCore, - msg: encodeJsonToBase64(instantiateMsg), - admin: { core_module: {} }, - funds: instantiateFunds, - label: instantiateMsg.name, - }, + instantiateMsg: encodeJsonToBase64(instantiateMsg), + codeId: codeIds.DaoCore, + codeHash: codeHashes.DaoCore, + label: instantiateMsg.name, }, SECRET_GAS.DAO_CREATION, undefined, instantiateFunds ) return findWasmAttributeValue( + chainId, events, factoryContractAddress, 'set contract admin as itself' @@ -508,6 +505,7 @@ export const InnerCreateDaoForm = ({ getFundsFromDaoInstantiateMsg(instantiateMsg) ) return findWasmAttributeValue( + chainId, events, factoryContractAddress, 'set contract admin as itself' diff --git a/packages/types/contracts/SecretCwAdminFactory.ts b/packages/types/contracts/SecretCwAdminFactory.ts index d1b08fb37..a60ea41ef 100644 --- a/packages/types/contracts/SecretCwAdminFactory.ts +++ b/packages/types/contracts/SecretCwAdminFactory.ts @@ -1,28 +1,14 @@ export interface InstantiateMsg {} export type ExecuteMsg = { instantiate_contract_with_self_admin: { - module_info: ModuleInstantiateInfo + instantiate_msg: Binary + code_id: number + code_hash: string + label: string } } -export type Admin = - | { - address: { - addr: string - } - } - | { - core_module: {} - } export type Uint128 = string export type Binary = string -export interface ModuleInstantiateInfo { - admin?: Admin | null - code_hash: string - code_id: number - funds: Coin[] - label: string - msg: Binary -} export interface Coin { amount: Uint128 denom: string diff --git a/packages/types/contracts/SecretDaoDaoCore.ts b/packages/types/contracts/SecretDaoDaoCore.ts index c9142e812..2d6a1b2a8 100644 --- a/packages/types/contracts/SecretDaoDaoCore.ts +++ b/packages/types/contracts/SecretDaoDaoCore.ts @@ -25,8 +25,6 @@ export interface InstantiateMsg { proposal_modules_instantiate_info: ModuleInstantiateInfo[] query_auth_code_hash: string query_auth_code_id: number - snip20_code_hash: string - snip721_code_hash: string voting_module_instantiate_info: ModuleInstantiateInfo } export interface InitialItem { @@ -299,8 +297,6 @@ export interface Config { description: string image_url?: string | null name: string - snip20_code_hash: string - snip721_code_hash: string } export interface SubDao { addr: string diff --git a/packages/utils/client.ts b/packages/utils/client.ts index a67d2f2f2..08abfbc72 100644 --- a/packages/utils/client.ts +++ b/packages/utils/client.ts @@ -329,6 +329,7 @@ export const getCosmWasmClientForChainId = async ( * key for a given contract address. */ export const findWasmAttributeValue = ( + chainId: string, events: readonly Event[], contractAddress: string, attributeKey: string @@ -338,7 +339,10 @@ export const findWasmAttributeValue = ( type === 'wasm' && attributes.some( ({ key, value }) => - key === '_contract_address' && value === contractAddress + key === + (isSecretNetwork(chainId) + ? 'contract_address' + : '_contract_address') && value === contractAddress ) && attributes.some(({ key }) => key === attributeKey) ) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 99e2e0f3a..3edf10279 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -2159,93 +2159,92 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ DaoVotingCw721Staked: -1, }, }, - // // TODO(secret-testnet) - // { - // chainId: ChainId.SecretTestnet, - // name: 'secret', - // mainnet: false, - // accentColor: '#000000', - // factoryContractAddress: 'secret1tns0rehvxwggxqhnwe4s57g57d2ym70su8ta0g', - // noIndexer: true, - // createWithCw20: true, - // explorerUrlTemplates: { - // tx: 'https://testnet.ping.pub/secret/tx/REPLACE', - // gov: 'https://testnet.ping.pub/secret/gov', - // govProp: 'https://testnet.ping.pub/secret/gov/REPLACE', - // wallet: 'https://testnet.ping.pub/secret/account/REPLACE', - // }, - // codeIdsVersion: ContractVersion.V242, - // codeIds: { - // // TODO(secret-testnet) - // Cw1Whitelist: -1, - // Cw4Group: 9422, - // Cw20Base: 8164, // snip20 - // Cw721Base: 8172, // snip721 - // CwPayrollFactory: 8186, - // CwTokenSwap: 8187, - // CwVesting: 8189, - // DaoCore: 9430, - // DaoPreProposeApprovalSingle: 8180, - // DaoPreProposeApprover: 8181, - // DaoPreProposeMultiple: 9416, - // DaoPreProposeSingle: 9415, - // DaoProposalMultiple: 9414, - // DaoProposalSingle: 9413, - // DaoVotingCw4: 9421, - // DaoVotingCw20Staked: 8170, // snip20 - // DaoVotingCw721Staked: 8182, // snip721 - // DaoVotingTokenStaked: 8174, - // QueryAuth: 9323, + { + chainId: ChainId.SecretTestnet, + name: 'secret', + mainnet: false, + accentColor: '#000000', + factoryContractAddress: 'secret1u0ahaxkm0yq47khp5cwfps4jdr8u0ulk2tlaax', + noIndexer: true, + createWithCw20: true, + explorerUrlTemplates: { + tx: 'https://testnet.ping.pub/secret/tx/REPLACE', + gov: 'https://testnet.ping.pub/secret/gov', + govProp: 'https://testnet.ping.pub/secret/gov/REPLACE', + wallet: 'https://testnet.ping.pub/secret/account/REPLACE', + }, + codeIdsVersion: ContractVersion.V242, + codeIds: { + // TODO(secret-testnet) + Cw1Whitelist: -1, + Cw4Group: 9604, + Cw20Base: 8164, // snip20 + Cw721Base: 8172, // snip721 + CwPayrollFactory: 8186, + CwTokenSwap: 8187, + CwVesting: 8189, + DaoCore: 9605, + DaoPreProposeApprovalSingle: 8180, + DaoPreProposeApprover: 8181, + DaoPreProposeMultiple: 9416, + DaoPreProposeSingle: 9603, + DaoProposalMultiple: 9414, + DaoProposalSingle: 9602, + DaoVotingCw4: 9601, + DaoVotingCw20Staked: 8170, // snip20 + DaoVotingCw721Staked: 8182, // snip721 + DaoVotingTokenStaked: 8174, + QueryAuth: 9606, - // // unused - // CwTokenfactoryIssuerMain: -1, - // DaoMigrator: -1, - // }, - // codeHashes: { - // // TODO(secret-testnet) - // Cw1Whitelist: '', - // Cw4Group: - // '06882aeaecdd4bf6c364dca04acaa774eddfb5524efbb33a4e4c7b0ecd8e2939', - // Cw20Base: - // 'c2508a75824974eeaa578a5d1af07006b1c3911b5c2909813d74672797264775', // snip20 - // Cw721Base: - // 'ab0f16b065e766eee7181c4357d29bc6f947d73dbd48943fc0e501b2147a492e', // snip721 - // CwPayrollFactory: - // 'f6f0bd62757f19c513fd2e0bccea1aa4d6bc57ff65c2cdd1f5c849a397eea9fd', - // CwTokenSwap: - // '26f2ce755019de01c65a5742ac3c8e704130a2feaa92bd69d161e76030998f2c', - // CwVesting: - // '0dae83b3616c066d0cdbf061b977707f99d6b91bdc7b44a81285a688e37552b0', - // DaoCore: - // 'e31dd725fac8537c5498f3f08efee522a6544ef0144a5c5176d02c2fe57c241e', - // DaoPreProposeApprovalSingle: - // '88410e9c96687c01af289c59730d90a425a974c81abf20a76597f076959cb7fc', - // DaoPreProposeApprover: - // '5fc6a014fd017a62bbfea437322857e952eac7572c901a0a6ca23ef7598f971f', - // DaoPreProposeMultiple: - // '24e2a494b9450e6747bdf2b00b01e0f9afb54d455121c58b3857396af74d298f', - // DaoPreProposeSingle: - // 'd5fde27c749424968f14a70f4383d3aa1df97ba9ab4933a7e648186ecf8afa1c', - // DaoProposalMultiple: - // 'dfc954ec00f93cb9b45930adcd0aa62ba273bc7d48e5a094b51cbba78b0ddbb5', - // DaoProposalSingle: - // 'd617f9f97dbb13794292cb7da3f6b8bd20061ca8f51444456c1b2e0aff96d2b9', - // DaoVotingCw4: - // 'f80641ebe9bf07ac2e44f6a7c33de7ece8d4706a709b3ea2ccad046384251009', - // DaoVotingCw20Staked: - // '715b7aa5925b46a7fcff277f4ad3763016429daec8ddedd568f892dad2eb88d0', // snip20 - // DaoVotingCw721Staked: - // '90f91337256cb3db1b44567ced0457b51271263f67e5df3590de77d22c04a3b3', // snip721 - // DaoVotingTokenStaked: - // '3bc835c9e0fdd0deea88202d3de32caa8125891eb0821973f1c5244f818f2d45', - // QueryAuth: - // 'a9e52a8f517de56ad7fb21a1d57c43e9442d425f91ba2f2a190bea90ee504f46', + // unused + CwTokenfactoryIssuerMain: -1, + DaoMigrator: -1, + }, + codeHashes: { + // TODO(secret-testnet) + Cw1Whitelist: '', + Cw4Group: + '2b2d733412552485adb842831da10efe3e63b9902f734d12167a3ec0f30e1dba', + Cw20Base: + 'c2508a75824974eeaa578a5d1af07006b1c3911b5c2909813d74672797264775', // snip20 + Cw721Base: + 'ab0f16b065e766eee7181c4357d29bc6f947d73dbd48943fc0e501b2147a492e', // snip721 + CwPayrollFactory: + 'f6f0bd62757f19c513fd2e0bccea1aa4d6bc57ff65c2cdd1f5c849a397eea9fd', + CwTokenSwap: + '26f2ce755019de01c65a5742ac3c8e704130a2feaa92bd69d161e76030998f2c', + CwVesting: + '0dae83b3616c066d0cdbf061b977707f99d6b91bdc7b44a81285a688e37552b0', + DaoCore: + '39bc1c500e8245698e56a03fd913943c70786eee6f16f947207f11aef0b39fde', + DaoPreProposeApprovalSingle: + '88410e9c96687c01af289c59730d90a425a974c81abf20a76597f076959cb7fc', + DaoPreProposeApprover: + '5fc6a014fd017a62bbfea437322857e952eac7572c901a0a6ca23ef7598f971f', + DaoPreProposeMultiple: + '24e2a494b9450e6747bdf2b00b01e0f9afb54d455121c58b3857396af74d298f', + DaoPreProposeSingle: + '97aad664a9a3da63b5694e13f539f37984d2b520ffc66f833d98fb1e51d06ea4', + DaoProposalMultiple: + 'dfc954ec00f93cb9b45930adcd0aa62ba273bc7d48e5a094b51cbba78b0ddbb5', + DaoProposalSingle: + 'b1720ab4cb55893c285618e8150cfe1d9a7b9ae12913909e254a750b12e23827', + DaoVotingCw4: + '87813dd42fc186ea286f14c5bfd050b43995d8af81b626c3261188acca5aa0b1', + DaoVotingCw20Staked: + '715b7aa5925b46a7fcff277f4ad3763016429daec8ddedd568f892dad2eb88d0', // snip20 + DaoVotingCw721Staked: + '90f91337256cb3db1b44567ced0457b51271263f67e5df3590de77d22c04a3b3', // snip721 + DaoVotingTokenStaked: + '3bc835c9e0fdd0deea88202d3de32caa8125891eb0821973f1c5244f818f2d45', + QueryAuth: + '3a6c30fa077ba8b8d665e46d215bd0ed7448c8fe0ae3da3d28e81dd4ca0380e3', - // // unused - // CwTokenfactoryIssuerMain: '', - // DaoMigrator: '', - // }, - // }, + // unused + CwTokenfactoryIssuerMain: '', + DaoMigrator: '', + }, + }, ] export const POLYTONE_CONFIG_PER_CHAIN: [ChainId, PolytoneConfig][] = diff --git a/packages/utils/error.ts b/packages/utils/error.ts index 3f07f7201..ecdba8a9e 100644 --- a/packages/utils/error.ts +++ b/packages/utils/error.ts @@ -118,6 +118,7 @@ export enum CommonError { ContractExecutionFailed = 'Contract execution failed.', ContractMigrationFailed = 'Contract migration failed.', InsufficientGas = 'Insufficient gas.', + ContractNameExists = 'Name already taken.', } // List of error substrings to match to determine the common error. Elements in @@ -210,6 +211,7 @@ const commonErrorPatterns: Record = { // wasm code format from polytone listener callback error 'codespace: wasm, code: 6', ], + [CommonError.ContractNameExists]: ['contract account already exists'], } const commonErrorPatternsEntries = Object.entries(commonErrorPatterns) as [ CommonError, diff --git a/packages/utils/secret/signingClient.ts b/packages/utils/secret/signingClient.ts index 9d0a240d1..4d5f89f82 100644 --- a/packages/utils/secret/signingClient.ts +++ b/packages/utils/secret/signingClient.ts @@ -1,13 +1,14 @@ import { - ChangeAdminResult, Code, CodeDetails, Contract, ContractCodeHistoryEntry, ExecuteInstruction, + ExecuteResult, InstantiateOptions, InstantiateResult, JsonObject, + MigrateResult, SigningCosmWasmClient, SigningCosmWasmClientOptions, UploadResult, @@ -137,11 +138,11 @@ export class SecretSigningCosmWasmClient extends SigningCosmWasmClient { this.secretNetworkClient = new SecretNetworkClient(secretOptions) } - protected getSecretNetworkClient(): SecretNetworkClient | undefined { + public getSecretNetworkClient(): SecretNetworkClient | undefined { return this.secretNetworkClient } - protected forceGetSecretNetworkClient(): SecretNetworkClient { + public forceGetSecretNetworkClient(): SecretNetworkClient { if (!this.secretNetworkClient) { throw new Error( 'Secret network client not available. You cannot use online functionality in offline mode.' @@ -471,7 +472,7 @@ export class SecretSigningCosmWasmClient extends SigningCosmWasmClient { newAdmin: string, fee: StdFee | 'auto' | number, memo = '' - ): Promise { + ): Promise { if (typeof fee !== 'number') { throw new Error( 'Secret Network signing client requires a numeric fee to use as the gasLimit.' @@ -514,7 +515,7 @@ export class SecretSigningCosmWasmClient extends SigningCosmWasmClient { contractAddress: string, fee: StdFee | 'auto' | number, memo = '' - ): Promise { + ): Promise { if (typeof fee !== 'number') { throw new Error( 'Secret Network signing client requires a numeric fee to use as the gasLimit.' @@ -558,7 +559,7 @@ export class SecretSigningCosmWasmClient extends SigningCosmWasmClient { migrateMsg: JsonObject, fee: StdFee | 'auto' | number, memo = '' - ): Promise { + ): Promise { if (typeof fee !== 'number') { throw new Error( 'Secret Network signing client requires a numeric fee to use as the gasLimit.' @@ -605,7 +606,7 @@ export class SecretSigningCosmWasmClient extends SigningCosmWasmClient { instructions: readonly ExecuteInstruction[], fee: StdFee | 'auto' | number, memo = '' - ): Promise { + ): Promise { if (typeof fee !== 'number') { throw new Error( 'Secret Network signing client requires a numeric fee to use as the gasLimit.' From 635405ef855028d162db93d11ffc0fb7884a5673 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 19 Jul 2024 13:07:21 -0400 Subject: [PATCH 329/438] fixed secret permit creation --- packages/stateful/clients/dao/SecretCwDao.ts | 28 +++++++++---------- .../MultipleChoiceProposalModule.secret.ts | 2 +- .../SingleChoiceProposalModule.secret.ts | 2 +- .../voting-module/Cw4VotingModule.secret.ts | 2 +- .../Snip20StakedVotingModule.secret.ts | 2 +- .../Snip721StakedVotingModule.secret.ts | 2 +- .../TokenStakedVotingModule.secret.ts | 2 +- .../stateful/components/dao/DaoProviders.tsx | 10 +++---- .../useDaoWithWalletSecretNetworkPermit.ts | 10 ++----- packages/utils/secret/permit.ts | 27 ++++++++++-------- 10 files changed, 41 insertions(+), 46 deletions(-) diff --git a/packages/stateful/clients/dao/SecretCwDao.ts b/packages/stateful/clients/dao/SecretCwDao.ts index 9751171cb..23cf5ffc5 100644 --- a/packages/stateful/clients/dao/SecretCwDao.ts +++ b/packages/stateful/clients/dao/SecretCwDao.ts @@ -1,4 +1,4 @@ -import { OfflineAminoSigner } from '@cosmjs/amino' +import { ChainWalletContext } from '@cosmos-kit/core' import { FetchQueryOptions, skipToken } from '@tanstack/react-query' import { secretDaoDaoCoreQueries } from '@dao-dao/state/query' @@ -56,10 +56,10 @@ export type SecretPermitUpdateEvent = { export class SecretCwDao extends CwDao { /** - * Function to retrieve the offline amino signer from the current wallet. Must - * be set before `getPermit` and `getVotingPower` can be used. + * Function to sign with amino as the current wallet. Must be set before + * `getPermit` and `getVotingPower` can be used. */ - private getOfflineSignerAmino?: () => OfflineAminoSigner + private signAmino?: ChainWalletContext['signAmino'] /** * Generate the DAO instantiate info. Use the voting module and proposal @@ -154,13 +154,11 @@ export class SecretCwDao extends CwDao { } /** - * Register a function to retrieve the offline amino signer from the current - * wallet. Must be set before `getPermit` and `getVotingPower` can be used. + * Register a function to sign with amino as the current wallet. Must be set + * before `getPermit` and `getVotingPower` can be used. */ - registerOfflineSignerAminoGetter( - getOfflineSignerAmino: () => OfflineAminoSigner - ) { - this.getOfflineSignerAmino = getOfflineSignerAmino + registerSignAmino(signAmino: ChainWalletContext['signAmino']) { + this.signAmino = signAmino } /** @@ -193,18 +191,18 @@ export class SecretCwDao extends CwDao { return existing } - if (!this.getOfflineSignerAmino) { + if (!this.signAmino) { throw new Error( - 'Offline amino signer getter not registered. Call registerOfflineSignerAminoGetter first.' + 'Amino signer not registered. Call registerSignAmino first.' ) } // Create a new permit. const permit = await createSecretNetworkPermit({ chainId: this.options.chainId, - address, key: this.options.coreAddress, - offlineSignerAmino: this.getOfflineSignerAmino(), + signAmino: (signDoc, signOptions) => + this.signAmino!(address, signDoc, signOptions), }) // Save to local storage. @@ -264,7 +262,7 @@ export class SecretCwDao extends CwDao { height?: number, /** * Whether or not to prompt the wallet for a permit. If true, - * `registerOfflineSignerAminoGetter` must be called first. + * `registerSignAmino` must be called first. * * Defaults to false. */ diff --git a/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.secret.ts b/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.secret.ts index 6a3a6cb15..7187faa0a 100644 --- a/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.secret.ts +++ b/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.secret.ts @@ -309,7 +309,7 @@ export class SecretMultipleChoiceProposalModule extends ProposalModuleBase< options: Parameters[0], /** * Whether or not to prompt the wallet for a permit. If true, - * `dao.registerOfflineSignerAminoGetter` must be called first. + * `dao.registerSignAmino` must be called first. * * Defaults to false. */ diff --git a/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.secret.ts b/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.secret.ts index 16b0c7006..3b5735d02 100644 --- a/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.secret.ts +++ b/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.secret.ts @@ -337,7 +337,7 @@ export class SecretSingleChoiceProposalModule extends ProposalModuleBase< options: Parameters[0], /** * Whether or not to prompt the wallet for a permit. If true, - * `dao.registerOfflineSignerAminoGetter` must be called first. + * `dao.registerSignAmino` must be called first. * * Defaults to false. */ diff --git a/packages/stateful/clients/voting-module/Cw4VotingModule.secret.ts b/packages/stateful/clients/voting-module/Cw4VotingModule.secret.ts index 483bf38a4..1f6b9b71c 100644 --- a/packages/stateful/clients/voting-module/Cw4VotingModule.secret.ts +++ b/packages/stateful/clients/voting-module/Cw4VotingModule.secret.ts @@ -106,7 +106,7 @@ export class SecretCw4VotingModule extends VotingModuleBase { height?: number, /** * Whether or not to prompt the wallet for a permit. If true, - * `dao.registerOfflineSignerAminoGetter` must be called first. + * `dao.registerSignAmino` must be called first. * * Defaults to false. */ diff --git a/packages/stateful/clients/voting-module/Snip20StakedVotingModule.secret.ts b/packages/stateful/clients/voting-module/Snip20StakedVotingModule.secret.ts index 565667c65..b7f278eaf 100644 --- a/packages/stateful/clients/voting-module/Snip20StakedVotingModule.secret.ts +++ b/packages/stateful/clients/voting-module/Snip20StakedVotingModule.secret.ts @@ -181,7 +181,7 @@ export class SecretSnip20StakedVotingModule extends VotingModuleBase height?: number, /** * Whether or not to prompt the wallet for a permit. If true, - * `dao.registerOfflineSignerAminoGetter` must be called first. + * `dao.registerSignAmino` must be called first. * * Defaults to false. */ diff --git a/packages/stateful/components/dao/DaoProviders.tsx b/packages/stateful/components/dao/DaoProviders.tsx index 1f4dadf21..1d12bd285 100644 --- a/packages/stateful/components/dao/DaoProviders.tsx +++ b/packages/stateful/components/dao/DaoProviders.tsx @@ -60,18 +60,16 @@ export const DaoProviders = ({ ) // Register wallet offline signer if Secret DAO so it can request permits. - const { isWalletConnected, getOfflineSignerAmino } = useWallet() + const { isWalletConnected, signAmino } = useWallet() // Stabilize reference so callback doesn't change. This only needs to update // on wallet connection state change anyway. - const getOfflineSignerAminoRef = useUpdatingRef(getOfflineSignerAmino) + const signAminoRef = useUpdatingRef(signAmino) useEffect(() => { if (context.dao instanceof SecretCwDao && isWalletConnected) { - context.dao.registerOfflineSignerAminoGetter( - getOfflineSignerAminoRef.current - ) + context.dao.registerSignAmino(signAminoRef.current) } - }, [context, isWalletConnected, getOfflineSignerAminoRef]) + }, [context, isWalletConnected, signAminoRef]) // Start loading only if client not initialized. If the data is already // cached, the DAO instance may be initialized on creation. diff --git a/packages/stateful/hooks/useDaoWithWalletSecretNetworkPermit.ts b/packages/stateful/hooks/useDaoWithWalletSecretNetworkPermit.ts index 2900b7cb4..1e63e022a 100644 --- a/packages/stateful/hooks/useDaoWithWalletSecretNetworkPermit.ts +++ b/packages/stateful/hooks/useDaoWithWalletSecretNetworkPermit.ts @@ -37,8 +37,6 @@ export type UseWalletWithSecretNetworkPermitReturn = UseWalletReturn & { /** * Hook to help manage a wallet's Secret Network permits for a DAO. - * - * TODO(dao-client): refactor this into a more general wallet / DAO client hook */ export const useDaoWithWalletSecretNetworkPermit = ({ dao, @@ -51,15 +49,13 @@ export const useDaoWithWalletSecretNetworkPermit = ({ // Stabilize reference so callback doesn't change. This only needs to update // on wallet connection state change anyway. - const getOfflineSignerAminoRef = useUpdatingRef(wallet.getOfflineSignerAmino) + const signAminoRef = useUpdatingRef(wallet.signAmino) // Register for offline signer if Secret DAO. useEffect(() => { if (daoClient instanceof SecretCwDao && wallet.isWalletConnected) { - daoClient.registerOfflineSignerAminoGetter( - getOfflineSignerAminoRef.current - ) + daoClient.registerSignAmino(signAminoRef.current) } - }, [daoClient, getOfflineSignerAminoRef, wallet.isWalletConnected]) + }, [daoClient, signAminoRef, wallet.isWalletConnected]) // Attempt to initialize with existing permit. const [permit, setPermit] = useState(() => diff --git a/packages/utils/secret/permit.ts b/packages/utils/secret/permit.ts index 22853708b..bbb8e6096 100644 --- a/packages/utils/secret/permit.ts +++ b/packages/utils/secret/permit.ts @@ -1,18 +1,22 @@ -import { OfflineAminoSigner, makeSignDoc } from '@cosmjs/amino' +import { AminoSignResponse, StdSignDoc, makeSignDoc } from '@cosmjs/amino' import { PermitForPermitData } from '@dao-dao/types' import { encodeJsonToBase64 } from '../messages' +export type CreateSecretNetworkPermitSignAmino = ( + signDoc: StdSignDoc, + signOptions: { + // Needed so that we can manually set gas and fees. + preferNoSetFee: true + } +) => Promise + export type CreateSecretNetworkPermitOptions = { /** * Chain ID. */ chainId: string - /** - * Wallet address. - */ - address: string /** * Arbitrary string. */ @@ -24,7 +28,7 @@ export type CreateSecretNetworkPermitOptions = { /** * Offline Amino signer that corresponds with chain ID and wallet address. */ - offlineSignerAmino: OfflineAminoSigner + signAmino: CreateSecretNetworkPermitSignAmino } /** @@ -32,10 +36,9 @@ export type CreateSecretNetworkPermitOptions = { */ export const createSecretNetworkPermit = async ({ chainId, - address, key, data = {}, - offlineSignerAmino, + signAmino, }: CreateSecretNetworkPermitOptions): Promise => { const encodedData = encodeJsonToBase64(data) @@ -65,10 +68,10 @@ export const createSecretNetworkPermit = async ({ 0 ) - const { signed, signature } = await offlineSignerAmino.signAmino( - address, - signDoc - ) + const { signed, signature } = await signAmino(signDoc, { + // Needed so that we can manually set gas and fees. + preferNoSetFee: true, + }) const permit: PermitForPermitData = { account_number: signed.account_number, From 7338b8a4efce262ff3cb8690b3aa408007127c35 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 19 Jul 2024 13:33:33 -0400 Subject: [PATCH 330/438] hide members on secret network and update gas fees --- .../SecretDaoPreProposeApprovalSingle.ts | 3 +- .../contracts/SecretDaoPreProposeMultiple.ts | 3 +- .../contracts/SecretDaoPreProposeSingle.ts | 3 +- .../contracts/SecretDaoProposalMultiple.ts | 11 +++---- .../contracts/SecretDaoProposalSingle.ts | 11 +++---- .../contracts/SecretDaoVotingSnip721Staked.ts | 5 ++-- .../contracts/SecretDaoVotingTokenStaked.ts | 7 +++-- .../hooks/useMainDaoInfoCards.tsx | 26 +++++++++------- .../adapters/DaoVotingCw20Staked/index.ts | 24 ++++++++------- .../DaoVotingCw4/hooks/useMainDaoInfoCards.ts | 30 +++++++++++-------- .../adapters/DaoVotingCw4/index.ts | 24 ++++++++------- .../hooks/useMainDaoInfoCards.tsx | 26 +++++++++------- .../adapters/DaoVotingCw721Staked/index.ts | 26 ++++++++++------ .../hooks/useMainDaoInfoCards.tsx | 26 +++++++++------- .../adapters/DaoVotingTokenStaked/index.ts | 24 ++++++++------- packages/utils/constants/other.ts | 8 +++++ 16 files changed, 157 insertions(+), 100 deletions(-) diff --git a/packages/state/contracts/SecretDaoPreProposeApprovalSingle.ts b/packages/state/contracts/SecretDaoPreProposeApprovalSingle.ts index d5ecd1fe3..38ef81058 100644 --- a/packages/state/contracts/SecretDaoPreProposeApprovalSingle.ts +++ b/packages/state/contracts/SecretDaoPreProposeApprovalSingle.ts @@ -25,6 +25,7 @@ import { UncheckedDenom, UncheckedDepositInfo, } from '@dao-dao/types/contracts/SecretDaoPreProposeApprovalSingle' +import { SECRET_GAS } from '@dao-dao/utils' export interface SecretDaoPreProposeApprovalSingleReadOnlyInterface { contractAddress: string @@ -213,7 +214,7 @@ export class SecretDaoPreProposeApprovalSingleClient auth: Auth msg: ProposeMessage }, - fee: number = 1_000_000, + fee: number = SECRET_GAS.PROPOSE, memo?: string, _funds?: Coin[] ): Promise => { diff --git a/packages/state/contracts/SecretDaoPreProposeMultiple.ts b/packages/state/contracts/SecretDaoPreProposeMultiple.ts index 7d490233c..87efd5d27 100644 --- a/packages/state/contracts/SecretDaoPreProposeMultiple.ts +++ b/packages/state/contracts/SecretDaoPreProposeMultiple.ts @@ -24,6 +24,7 @@ import { UncheckedDenom, UncheckedDepositInfo, } from '@dao-dao/types/contracts/SecretDaoPreProposeMultiple' +import { SECRET_GAS } from '@dao-dao/utils' export interface SecretDaoPreProposeMultipleReadOnlyInterface { contractAddress: string @@ -212,7 +213,7 @@ export class SecretDaoPreProposeMultipleClient auth: Auth msg: ProposeMessage }, - fee: number = 1_000_000, + fee: number = SECRET_GAS.PROPOSE, memo?: string, _funds?: Coin[] ): Promise => { diff --git a/packages/state/contracts/SecretDaoPreProposeSingle.ts b/packages/state/contracts/SecretDaoPreProposeSingle.ts index bd5e4f6a2..45b7d660e 100644 --- a/packages/state/contracts/SecretDaoPreProposeSingle.ts +++ b/packages/state/contracts/SecretDaoPreProposeSingle.ts @@ -24,6 +24,7 @@ import { UncheckedDenom, UncheckedDepositInfo, } from '@dao-dao/types/contracts/SecretDaoPreProposeSingle' +import { SECRET_GAS } from '@dao-dao/utils' export interface SecretDaoPreProposeSingleReadOnlyInterface { contractAddress: string @@ -212,7 +213,7 @@ export class SecretDaoPreProposeSingleClient auth: Auth msg: ProposeMessage }, - fee: number = 1_000_000, + fee: number = SECRET_GAS.PROPOSE, memo?: string, _funds?: Coin[] ): Promise => { diff --git a/packages/state/contracts/SecretDaoProposalMultiple.ts b/packages/state/contracts/SecretDaoProposalMultiple.ts index 469c82f95..6541ac495 100644 --- a/packages/state/contracts/SecretDaoProposalMultiple.ts +++ b/packages/state/contracts/SecretDaoProposalMultiple.ts @@ -30,6 +30,7 @@ import { VoteResponse, VotingStrategy, } from '@dao-dao/types/contracts/SecretDaoProposalMultiple' +import { SECRET_GAS } from '@dao-dao/utils' export interface SecretDaoProposalMultipleReadOnlyInterface { contractAddress: string @@ -425,7 +426,7 @@ export class SecretDaoProposalMultipleClient proposer?: string title: string }, - fee: number = 1_000_000, + fee: number = SECRET_GAS.PROPOSE, memo?: string, _funds?: Coin[] ): Promise => { @@ -457,7 +458,7 @@ export class SecretDaoProposalMultipleClient rationale?: string vote: MultipleChoiceVote }, - fee: number = 1_000_000, + fee: number = SECRET_GAS.VOTE, memo?: string, _funds?: Coin[] ): Promise => { @@ -485,7 +486,7 @@ export class SecretDaoProposalMultipleClient auth: Auth proposalId: number }, - fee: number = 1_000_000, + fee: number = SECRET_GAS.EXECUTE, memo?: string, _funds?: Coin[] ): Promise => { @@ -509,7 +510,7 @@ export class SecretDaoProposalMultipleClient }: { proposalId: number }, - fee: number = 1_000_000, + fee: number = SECRET_GAS.VETO, memo?: string, _funds?: Coin[] ): Promise => { @@ -532,7 +533,7 @@ export class SecretDaoProposalMultipleClient }: { proposalId: number }, - fee: number = 1_000_000, + fee: number = SECRET_GAS.CLOSE, memo?: string, _funds?: Coin[] ): Promise => { diff --git a/packages/state/contracts/SecretDaoProposalSingle.ts b/packages/state/contracts/SecretDaoProposalSingle.ts index cf0eea27f..967c3f855 100644 --- a/packages/state/contracts/SecretDaoProposalSingle.ts +++ b/packages/state/contracts/SecretDaoProposalSingle.ts @@ -30,6 +30,7 @@ import { VoteListResponse, VoteResponse, } from '@dao-dao/types/contracts/SecretDaoProposalSingle' +import { SECRET_GAS } from '@dao-dao/utils' export interface SecretDaoProposalSingleReadOnlyInterface { contractAddress: string @@ -425,7 +426,7 @@ export class SecretDaoProposalSingleClient proposer?: string title: string }, - fee: number = 1_000_000, + fee: number = SECRET_GAS.PROPOSE, memo?: string, _funds?: Coin[] ): Promise => { @@ -457,7 +458,7 @@ export class SecretDaoProposalSingleClient rationale?: string vote: Vote }, - fee: number = 1_000_000, + fee: number = SECRET_GAS.VOTE, memo?: string, _funds?: Coin[] ): Promise => { @@ -511,7 +512,7 @@ export class SecretDaoProposalSingleClient auth: Auth proposalId: number }, - fee: number = 1_000_000, + fee: number = SECRET_GAS.EXECUTE, memo?: string, _funds?: Coin[] ): Promise => { @@ -535,7 +536,7 @@ export class SecretDaoProposalSingleClient }: { proposalId: number }, - fee: number = 1_000_000, + fee: number = SECRET_GAS.VETO, memo?: string, _funds?: Coin[] ): Promise => { @@ -558,7 +559,7 @@ export class SecretDaoProposalSingleClient }: { proposalId: number }, - fee: number = 1_000_000, + fee: number = SECRET_GAS.CLOSE, memo?: string, _funds?: Coin[] ): Promise => { diff --git a/packages/state/contracts/SecretDaoVotingSnip721Staked.ts b/packages/state/contracts/SecretDaoVotingSnip721Staked.ts index fce1598c1..067cdd92a 100644 --- a/packages/state/contracts/SecretDaoVotingSnip721Staked.ts +++ b/packages/state/contracts/SecretDaoVotingSnip721Staked.ts @@ -28,6 +28,7 @@ import { TotalPowerAtHeightResponse, VotingPowerAtHeightResponse, } from '@dao-dao/types/contracts/SecretDaoVotingSnip721Staked' +import { SECRET_GAS } from '@dao-dao/utils' export interface SecretDaoVotingSnip721StakedReadOnlyInterface { contractAddress: string @@ -278,7 +279,7 @@ export class SecretDaoVotingSnip721StakedClient }: { tokenIds: string[] }, - fee: number = 1_000_000, + fee: number = SECRET_GAS.UNSTAKE, memo?: string, _funds?: Coin[] ): Promise => { @@ -296,7 +297,7 @@ export class SecretDaoVotingSnip721StakedClient ) } claimNfts = async ( - fee: number = 1_000_000, + fee: number = SECRET_GAS.CLAIM, memo?: string, _funds?: Coin[] ): Promise => { diff --git a/packages/state/contracts/SecretDaoVotingTokenStaked.ts b/packages/state/contracts/SecretDaoVotingTokenStaked.ts index 8f56edd57..ba943ac13 100644 --- a/packages/state/contracts/SecretDaoVotingTokenStaked.ts +++ b/packages/state/contracts/SecretDaoVotingTokenStaked.ts @@ -29,6 +29,7 @@ import { Uint128, VotingPowerAtHeightResponse, } from '@dao-dao/types/contracts/SecretDaoVotingTokenStaked' +import { SECRET_GAS } from '@dao-dao/utils' export interface SecretDaoVotingTokenStakedReadOnlyInterface { contractAddress: string @@ -263,7 +264,7 @@ export class SecretDaoVotingTokenStakedClient this.removeHook = this.removeHook.bind(this) } stake = async ( - fee: number = 1_000_000, + fee: number = SECRET_GAS.STAKE, memo?: string, _funds?: Coin[] ): Promise => { @@ -284,7 +285,7 @@ export class SecretDaoVotingTokenStakedClient }: { amount: Uint128 }, - fee: number = 1_000_000, + fee: number = SECRET_GAS.UNSTAKE, memo?: string, _funds?: Coin[] ): Promise => { @@ -325,7 +326,7 @@ export class SecretDaoVotingTokenStakedClient ) } claim = async ( - fee: number = 1_000_000, + fee: number = SECRET_GAS.CLAIM, memo?: string, _funds?: Coin[] ): Promise => { diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useMainDaoInfoCards.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useMainDaoInfoCards.tsx index 27748e39b..76ee5bf78 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useMainDaoInfoCards.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useMainDaoInfoCards.tsx @@ -10,6 +10,7 @@ import { convertDenomToMicroDenomWithDecimals, convertDurationToHumanReadableString, formatPercentOf100, + isSecretNetwork, } from '@dao-dao/utils' import { useMembership } from '../../../../hooks' @@ -37,16 +38,21 @@ export const useMainDaoInfoCards = (): DaoInfoCard[] => { ) return [ - { - label: t('title.members'), - tooltip: t('info.membersTooltip'), - loading: loadingMembers.loading, - value: loadingMembers.loading - ? undefined - : loadingMembers.errored - ? '' - : loadingMembers.data?.length ?? '', - }, + // Can't view members on Secret Network. + ...(isSecretNetwork(chainId) + ? [] + : [ + { + label: t('title.members'), + tooltip: t('info.membersTooltip'), + loading: loadingMembers.loading, + value: loadingMembers.loading + ? undefined + : loadingMembers.errored + ? '' + : loadingMembers.data?.length ?? '', + }, + ]), { label: t('title.totalSupply'), tooltip: t('info.totalSupplyTooltip', { diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/index.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/index.ts index ab569765a..d985ccf9c 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/index.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/index.ts @@ -9,6 +9,7 @@ import { import { DAO_VOTING_CW20_STAKED_CONTRACT_NAMES, DaoVotingCw20StakedAdapterId, + isSecretNetwork, } from '@dao-dao/utils' import { makeMintAction, makeUpdateStakingConfigAction } from './actions' @@ -23,7 +24,7 @@ export const DaoVotingCw20StakedAdapter: VotingModuleAdapter = { id: DaoVotingCw20StakedAdapterId, contractNames: DAO_VOTING_CW20_STAKED_CONTRACT_NAMES, - load: () => ({ + load: ({ chainId }) => ({ // Hooks hooks: { useMainDaoInfoCards, @@ -37,15 +38,18 @@ export const DaoVotingCw20StakedAdapter: VotingModuleAdapter = { ProfileCardMemberInfo, StakingModal, - extraTabs: [ - { - id: DaoTabId.Members, - labelI18nKey: 'title.members', - Component: MembersTab, - Icon: PeopleAltOutlined, - IconFilled: PeopleAltRounded, - }, - ], + // Can't view members on Secret Network. + extraTabs: isSecretNetwork(chainId) + ? undefined + : [ + { + id: DaoTabId.Members, + labelI18nKey: 'title.members', + Component: MembersTab, + Icon: PeopleAltOutlined, + IconFilled: PeopleAltRounded, + }, + ], }, // Functions diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/hooks/useMainDaoInfoCards.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/hooks/useMainDaoInfoCards.ts index ac7c6a992..9459eaac2 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/hooks/useMainDaoInfoCards.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/hooks/useMainDaoInfoCards.ts @@ -1,27 +1,31 @@ import { useTranslation } from 'react-i18next' import { DaoInfoCard } from '@dao-dao/types' +import { isSecretNetwork } from '@dao-dao/utils' import { useVotingModuleAdapterOptions } from '../../../react/context' import { useLoadingVotingModule } from './useLoadingVotingModule' export const useMainDaoInfoCards = (): DaoInfoCard[] => { const { t } = useTranslation() - const { coreAddress } = useVotingModuleAdapterOptions() + const { chainId, coreAddress } = useVotingModuleAdapterOptions() const votingModule = useLoadingVotingModule(coreAddress, { fetchMembers: true, }) - return [ - { - label: t('title.members'), - tooltip: t('info.membersTooltip'), - loading: votingModule.loading, - value: votingModule.loading - ? undefined - : votingModule.errored - ? '' - : votingModule.data.members?.length ?? '', - }, - ] + // Can't view members on Secret Network. + return isSecretNetwork(chainId) + ? [] + : [ + { + label: t('title.members'), + tooltip: t('info.membersTooltip'), + loading: votingModule.loading, + value: votingModule.loading + ? undefined + : votingModule.errored + ? '' + : votingModule.data.members?.length ?? '', + }, + ] } diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/index.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/index.ts index a689bdc16..bc62fc829 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/index.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw4/index.ts @@ -8,6 +8,7 @@ import { import { DAO_VOTING_CW4_CONTRACT_NAMES, DaoVotingCw4AdapterId, + isSecretNetwork, } from '@dao-dao/utils' import { makeManageMembersAction } from './actions' @@ -22,7 +23,7 @@ export const DaoVotingCw4Adapter: VotingModuleAdapter = { id: DaoVotingCw4AdapterId, contractNames: DAO_VOTING_CW4_CONTRACT_NAMES, - load: () => ({ + load: ({ chainId }) => ({ // Hooks hooks: { useMainDaoInfoCards, @@ -31,15 +32,18 @@ export const DaoVotingCw4Adapter: VotingModuleAdapter = { // Components components: { - extraTabs: [ - { - id: DaoTabId.Members, - labelI18nKey: 'title.members', - Component: MembersTab, - Icon: PeopleAltOutlined, - IconFilled: PeopleAltRounded, - }, - ], + // Can't view members on Secret Network. + extraTabs: isSecretNetwork(chainId) + ? undefined + : [ + { + id: DaoTabId.Members, + labelI18nKey: 'title.members', + Component: MembersTab, + Icon: PeopleAltOutlined, + IconFilled: PeopleAltRounded, + }, + ], MainDaoInfoCardsLoader, ProfileCardMemberInfo, diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/hooks/useMainDaoInfoCards.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/hooks/useMainDaoInfoCards.tsx index 03e212e9a..0994d5c56 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/hooks/useMainDaoInfoCards.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/hooks/useMainDaoInfoCards.tsx @@ -7,6 +7,7 @@ import { DaoInfoCard } from '@dao-dao/types' import { convertDurationToHumanReadableString, formatPercentOf100, + isSecretNetwork, } from '@dao-dao/utils' import { useQueryLoadingDataWithError } from '../../../../hooks' @@ -39,16 +40,21 @@ export const useMainDaoInfoCards = (): DaoInfoCard[] => { ) return [ - { - label: t('title.members'), - tooltip: t('info.membersTooltip'), - loading: loadingMembers.loading, - value: loadingMembers.loading - ? undefined - : loadingMembers.errored - ? '' - : loadingMembers.data.length ?? '', - }, + // Can't view members on Secret Network. + ...(isSecretNetwork(chainId) + ? [] + : [ + { + label: t('title.members'), + tooltip: t('info.membersTooltip'), + loading: loadingMembers.loading, + value: loadingMembers.loading + ? undefined + : loadingMembers.errored + ? '' + : loadingMembers.data.length ?? '', + }, + ]), { label: t('title.totalSupply'), tooltip: t('info.totalSupplyTooltip', { diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/index.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/index.ts index 40f15234a..3a314469c 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/index.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/index.ts @@ -10,7 +10,10 @@ import { DaoTabId, VotingModuleAdapter, } from '@dao-dao/types' -import { DAO_VOTING_CW721_STAKED_CONTRACT_NAMES } from '@dao-dao/utils' +import { + DAO_VOTING_CW721_STAKED_CONTRACT_NAMES, + isSecretNetwork, +} from '@dao-dao/utils' import { makeUpdateStakingConfigAction } from './actions' import { @@ -28,7 +31,7 @@ export const DaoVotingCw721StakedAdapter: VotingModuleAdapter = { id: 'DaoVotingCw721Staked', contractNames: DAO_VOTING_CW721_STAKED_CONTRACT_NAMES, - load: () => ({ + load: ({ chainId }) => ({ // Hooks hooks: { useMainDaoInfoCards, @@ -39,13 +42,18 @@ export const DaoVotingCw721StakedAdapter: VotingModuleAdapter = { // Components components: { extraTabs: [ - { - id: DaoTabId.Members, - labelI18nKey: 'title.members', - Component: MembersTab, - Icon: PeopleAltOutlined, - IconFilled: PeopleAltRounded, - }, + // Can't view members on Secret Network. + ...(isSecretNetwork(chainId) + ? [] + : [ + { + id: DaoTabId.Members, + labelI18nKey: 'title.members', + Component: MembersTab, + Icon: PeopleAltOutlined, + IconFilled: PeopleAltRounded, + }, + ]), { id: DaoTabId.Collection, labelI18nKey: 'title.nftCollection', diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/hooks/useMainDaoInfoCards.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/hooks/useMainDaoInfoCards.tsx index abfff5623..0902de74d 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/hooks/useMainDaoInfoCards.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/hooks/useMainDaoInfoCards.tsx @@ -9,6 +9,7 @@ import { DaoInfoCard } from '@dao-dao/types' import { convertDurationToHumanReadableString, convertMicroDenomToDenomWithDecimals, + isSecretNetwork, } from '@dao-dao/utils' import { useVotingModuleAdapterOptions } from '../../../react/context' @@ -39,16 +40,21 @@ export const useMainDaoInfoCards = (): DaoInfoCard[] => { ) return [ - { - label: t('title.members'), - tooltip: t('info.membersTooltip'), - loading: loadingMembers.loading, - value: loadingMembers.loading - ? undefined - : loadingMembers.errored - ? '' - : loadingMembers.data?.length ?? '', - }, + // Can't view members on Secret Network. + ...(isSecretNetwork(chainId) + ? [] + : [ + { + label: t('title.members'), + tooltip: t('info.membersTooltip'), + loading: loadingMembers.loading, + value: loadingMembers.loading + ? undefined + : loadingMembers.errored + ? '' + : loadingMembers.data?.length ?? '', + }, + ]), { label: t('title.totalSupply'), tooltip: t('info.totalSupplyTooltip', { diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/index.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/index.ts index 7d21353f0..b23284bc8 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/index.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/index.ts @@ -9,6 +9,7 @@ import { import { DAO_VOTING_TOKEN_STAKED_CONTRACT_NAMES, DaoVotingTokenStakedAdapterId, + isSecretNetwork, } from '@dao-dao/utils' import { @@ -24,7 +25,7 @@ export const DaoVotingTokenStakedAdapter: VotingModuleAdapter = { id: DaoVotingTokenStakedAdapterId, contractNames: DAO_VOTING_TOKEN_STAKED_CONTRACT_NAMES, - load: () => ({ + load: ({ chainId }) => ({ // Hooks hooks: { useMainDaoInfoCards, @@ -38,15 +39,18 @@ export const DaoVotingTokenStakedAdapter: VotingModuleAdapter = { ProfileCardMemberInfo, StakingModal, - extraTabs: [ - { - id: DaoTabId.Members, - labelI18nKey: 'title.members', - Component: MembersTab, - Icon: PeopleAltOutlined, - IconFilled: PeopleAltRounded, - }, - ], + // Can't view members on Secret Network. + extraTabs: isSecretNetwork(chainId) + ? undefined + : [ + { + id: DaoTabId.Members, + labelI18nKey: 'title.members', + Component: MembersTab, + Icon: PeopleAltOutlined, + IconFilled: PeopleAltRounded, + }, + ], }, // Functions diff --git a/packages/utils/constants/other.ts b/packages/utils/constants/other.ts index 9965f1d34..317bc863f 100644 --- a/packages/utils/constants/other.ts +++ b/packages/utils/constants/other.ts @@ -190,4 +190,12 @@ export const VALENCE_ALLOWLIST = [ */ export const SECRET_GAS = { DAO_CREATION: 1_000_000, + PROPOSE: 100_000, + VOTE: 100_000, + EXECUTE: 1_000_000, + CLOSE: 100_000, + VETO: 100_000, + STAKE: 100_000, + UNSTAKE: 100_000, + CLAIM: 100_000, } From 236bf1df363a9f6f115ac49b60d0e740c3909891 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 19 Jul 2024 14:21:51 -0400 Subject: [PATCH 331/438] added pre-propose info queries --- packages/state/query/queries/contracts/DaoPreProposeMultiple.ts | 2 ++ packages/state/query/queries/contracts/DaoPreProposeSingle.ts | 2 ++ .../queries/contracts/SecretDaoPreProposeApprovalSingle.ts | 2 ++ .../query/queries/contracts/SecretDaoPreProposeMultiple.ts | 2 ++ .../state/query/queries/contracts/SecretDaoPreProposeSingle.ts | 2 ++ 5 files changed, 10 insertions(+) diff --git a/packages/state/query/queries/contracts/DaoPreProposeMultiple.ts b/packages/state/query/queries/contracts/DaoPreProposeMultiple.ts index 438391f5a..75a87fa5e 100644 --- a/packages/state/query/queries/contracts/DaoPreProposeMultiple.ts +++ b/packages/state/query/queries/contracts/DaoPreProposeMultiple.ts @@ -18,6 +18,7 @@ import { import { getCosmWasmClientForChainId } from '@dao-dao/utils' import { DaoPreProposeMultipleQueryClient } from '../../../contracts/DaoPreProposeMultiple' +import { contractQueries } from '../contract' import { indexerQueries } from '../indexer' export const daoPreProposeMultipleQueryKeys = { @@ -282,6 +283,7 @@ export const daoPreProposeMultipleQueries = { }, ...options, }), + info: contractQueries.info, } export interface DaoPreProposeMultipleReactQuery { chainId: string diff --git a/packages/state/query/queries/contracts/DaoPreProposeSingle.ts b/packages/state/query/queries/contracts/DaoPreProposeSingle.ts index 238dabc5a..44d309197 100644 --- a/packages/state/query/queries/contracts/DaoPreProposeSingle.ts +++ b/packages/state/query/queries/contracts/DaoPreProposeSingle.ts @@ -18,6 +18,7 @@ import { import { getCosmWasmClientForChainId } from '@dao-dao/utils' import { DaoPreProposeSingleQueryClient } from '../../../contracts/DaoPreProposeSingle' +import { contractQueries } from '../contract' import { indexerQueries } from '../indexer' export const daoPreProposeSingleQueryKeys = { @@ -278,6 +279,7 @@ export const daoPreProposeSingleQueries = { }, ...options, }), + info: contractQueries.info, } export interface DaoPreProposeSingleReactQuery { chainId: string diff --git a/packages/state/query/queries/contracts/SecretDaoPreProposeApprovalSingle.ts b/packages/state/query/queries/contracts/SecretDaoPreProposeApprovalSingle.ts index ab7e8e618..cef64d591 100644 --- a/packages/state/query/queries/contracts/SecretDaoPreProposeApprovalSingle.ts +++ b/packages/state/query/queries/contracts/SecretDaoPreProposeApprovalSingle.ts @@ -17,6 +17,7 @@ import { import { getCosmWasmClientForChainId } from '@dao-dao/utils' import { SecretDaoPreProposeApprovalSingleQueryClient } from '../../../contracts/SecretDaoPreProposeApprovalSingle' +import { contractQueries } from '../contract' export const secretDaoPreProposeApprovalSingleQueryKeys = { contract: [ @@ -217,6 +218,7 @@ export const secretDaoPreProposeApprovalSingleQueries = { }), ...options, }), + info: contractQueries.info, } export interface SecretDaoPreProposeApprovalSingleReactQuery< TResponse, diff --git a/packages/state/query/queries/contracts/SecretDaoPreProposeMultiple.ts b/packages/state/query/queries/contracts/SecretDaoPreProposeMultiple.ts index 6d9f5b6d7..1103fb5fd 100644 --- a/packages/state/query/queries/contracts/SecretDaoPreProposeMultiple.ts +++ b/packages/state/query/queries/contracts/SecretDaoPreProposeMultiple.ts @@ -17,6 +17,7 @@ import { import { getCosmWasmClientForChainId } from '@dao-dao/utils' import { SecretDaoPreProposeMultipleQueryClient } from '../../../contracts/SecretDaoPreProposeMultiple' +import { contractQueries } from '../contract' export const secretDaoPreProposeMultipleQueryKeys = { contract: [ @@ -202,6 +203,7 @@ export const secretDaoPreProposeMultipleQueries = { }), ...options, }), + info: contractQueries.info, } export interface SecretDaoPreProposeMultipleReactQuery< TResponse, diff --git a/packages/state/query/queries/contracts/SecretDaoPreProposeSingle.ts b/packages/state/query/queries/contracts/SecretDaoPreProposeSingle.ts index e042d80f1..a55628ade 100644 --- a/packages/state/query/queries/contracts/SecretDaoPreProposeSingle.ts +++ b/packages/state/query/queries/contracts/SecretDaoPreProposeSingle.ts @@ -17,6 +17,7 @@ import { import { getCosmWasmClientForChainId } from '@dao-dao/utils' import { SecretDaoPreProposeSingleQueryClient } from '../../../contracts/SecretDaoPreProposeSingle' +import { contractQueries } from '../contract' export const secretDaoPreProposeSingleQueryKeys = { contract: [ @@ -202,6 +203,7 @@ export const secretDaoPreProposeSingleQueries = { }), ...options, }), + info: contractQueries.info, } export interface SecretDaoPreProposeSingleReactQuery< TResponse, From 7abd5d8240d2676a95dc7abfe14abd45edff8a50 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 22 Jul 2024 18:16:46 -0400 Subject: [PATCH 332/438] added polytone connection dispatch script --- packages/dispatch/README.md | 33 ++ packages/dispatch/package.json | 5 +- packages/dispatch/scripts/chains.ts | 50 +-- packages/dispatch/scripts/deploy.ts | 83 +---- packages/dispatch/scripts/polytone.ts | 473 ++++++++++++++++++++++++++ packages/dispatch/scripts/utils.ts | 111 ++++++ packages/state/query/queries/skip.ts | 45 +++ yarn.lock | 70 +++- 8 files changed, 757 insertions(+), 113 deletions(-) create mode 100644 packages/dispatch/scripts/polytone.ts create mode 100644 packages/dispatch/scripts/utils.ts diff --git a/packages/dispatch/README.md b/packages/dispatch/README.md index 8e4afb1c0..6bf67a411 100644 --- a/packages/dispatch/README.md +++ b/packages/dispatch/README.md @@ -26,3 +26,36 @@ Options: -x, --exclude ignore contracts containing any of these comma-separated substrings (e.g. cw721) -h, --help display help for command ``` + +### Polytone + +Establish a new Polytone connection between two connections by instantiating the +contracts and setting up an IBC channel. + +You can use an existing IBC connection or create a new one. + +``` +Usage: yarn polytone [options] + +Options: + -s, --src source chain ID + -d, --dest destination chain ID + -c, --existing-connection existing source connection ID that connects to the + destination. if not provided, will attempt to resolve + this automatically if a transfer channel exists between + the chains, failing otherwise. + -n, --new-connection create a new IBC connection. you probably do not want to + use this if a connection already exists. creating your + own connection increases the risk that the IBC clients + expire and need to be reset, since activity keeps + connections alive. using an existing connection means + there is a higher chance others will be using the + connection, which is a good thing. + --note note contract to use, instead of creating a new one. you + may use this if the script errored before. + --listener listener contract to use, instead of creating a new one. + you may use this if the script errored before. + --voice voice contract to use, instead of creating a new one. + you may use this if the script errored before. + -h, --help display help for command +``` diff --git a/packages/dispatch/package.json b/packages/dispatch/package.json index fab6884b4..eb215a969 100644 --- a/packages/dispatch/package.json +++ b/packages/dispatch/package.json @@ -6,9 +6,11 @@ "scripts": { "format": "eslint . --fix", "lint": "eslint .", - "deploy": "ts-node ./scripts/deploy.ts" + "deploy": "ts-node ./scripts/deploy.ts", + "polytone": "ts-node ./scripts/polytone.ts" }, "devDependencies": { + "@confio/relayer": "^0.12.0", "@dao-dao/config": "2.4.2-rc.1", "@dao-dao/state": "2.4.2-rc.1", "@dao-dao/types": "2.4.2-rc.1", @@ -17,6 +19,7 @@ "commander": "^11.0.0", "dotenv": "^16.4.5", "eslint": "^8.23.1", + "sinon": "^18.0.0", "ts-node": "^10.9.1", "typescript": "5.3.3" }, diff --git a/packages/dispatch/scripts/chains.ts b/packages/dispatch/scripts/chains.ts index 2fcdc6d3d..1d637f2b0 100644 --- a/packages/dispatch/scripts/chains.ts +++ b/packages/dispatch/scripts/chains.ts @@ -1,8 +1,6 @@ +import { ChainId } from '@dao-dao/types' + interface ChainConfig { - /** - * Chain fee denom. - */ - feeDenom: string /** * Polytone Listener code ID. */ @@ -26,101 +24,87 @@ interface ChainConfig { } /** - * Map chain name to deployment config. + * Map chain ID to deployment config. */ export const chains: Record = { - juno: { - feeDenom: 'ujuno', + [ChainId.JunoMainnet]: { listenerCodeId: 3319, noteCodeId: 3320, proxyCodeId: 3321, voiceCodeId: 3322, }, - osmosis: { - feeDenom: 'uosmo', + [ChainId.OsmosisMainnet]: { listenerCodeId: 125, noteCodeId: 126, proxyCodeId: 127, voiceCodeId: 128, }, - stargaze: { - feeDenom: 'ustars', + [ChainId.StargazeMainnet]: { listenerCodeId: 94, noteCodeId: 95, proxyCodeId: 96, voiceCodeId: 97, }, - migaloo: { - feeDenom: 'uwhale', + [ChainId.MigalooMainnet]: { listenerCodeId: 255, noteCodeId: 256, proxyCodeId: 257, voiceCodeId: 258, }, - neutron: { - feeDenom: 'untrn', + [ChainId.NeutronMainnet]: { listenerCodeId: 229, noteCodeId: 230, proxyCodeId: 231, voiceCodeId: 2373, }, - oraichain: { - feeDenom: 'orai', + [ChainId.OraichainMainnet]: { listenerCodeId: 1567, noteCodeId: 1568, proxyCodeId: 1569, voiceCodeId: 1570, }, - chihuahua: { - feeDenom: 'uhuahua', + [ChainId.ChihuahuaMainnet]: { listenerCodeId: 539, noteCodeId: 540, proxyCodeId: 541, voiceCodeId: 542, }, - terra2: { - feeDenom: 'uluna', + [ChainId.TerraMainnet]: { listenerCodeId: 2370, noteCodeId: 2371, proxyCodeId: 2372, voiceCodeId: 2373, }, - terra: { - feeDenom: 'uluna', + [ChainId.TerraClassicMainnet]: { listenerCodeId: 8751, noteCodeId: 8752, }, - omniflixhub: { - feeDenom: 'uflix', + [ChainId.OmniflixHubMainnet]: { listenerCodeId: 1, noteCodeId: 2, proxyCodeId: 3, voiceCodeId: 4, }, - kujira: { - feeDenom: 'ukuji', + [ChainId.KujiraMainnet]: { listenerCodeId: 276, noteCodeId: 277, proxyCodeId: 279, voiceCodeId: 278, }, - archway: { - feeDenom: 'aarch', + [ChainId.ArchwayMainnet]: { listenerCodeId: 392, noteCodeId: 394, proxyCodeId: 395, voiceCodeId: 396, }, - injective: { - feeDenom: 'inj', + [ChainId.InjectiveMainnet]: { listenerCodeId: 969, noteCodeId: 970, proxyCodeId: 971, voiceCodeId: 972, addrLen: 20, }, - bitsong: { - feeDenom: 'ubtsg', + [ChainId.BitsongMainnet]: { listenerCodeId: 24, noteCodeId: 25, proxyCodeId: 26, diff --git a/packages/dispatch/scripts/deploy.ts b/packages/dispatch/scripts/deploy.ts index 4227d3a41..bf3700dcf 100644 --- a/packages/dispatch/scripts/deploy.ts +++ b/packages/dispatch/scripts/deploy.ts @@ -13,23 +13,20 @@ import { makeReactQueryClient, skipQueries, } from '@dao-dao/state' -import { - ContractVersion, - SupportedChainConfig, - cwMsgToEncodeObject, -} from '@dao-dao/types' +import { ContractVersion, SupportedChainConfig } from '@dao-dao/types' import { MsgExec } from '@dao-dao/types/protobuf/codegen/cosmos/authz/v1beta1/tx' import { MsgStoreCode } from '@dao-dao/types/protobuf/codegen/cosmwasm/wasm/v1/tx' import { AccessType } from '@dao-dao/types/protobuf/codegen/cosmwasm/wasm/v1/types' import { CHAIN_GAS_MULTIPLIER, - encodeJsonToBase64, findEventsAttributeValue, getRpcForChainId, gzipCompress, maybeGetChainForChainId, } from '@dao-dao/utils' +import { instantiateContract } from './utils' + const { parsed: { MNEMONIC, DAO_CONTRACTS_DIR, POLYTONE_CONTRACTS_DIR } = {} } = dotenv.config() @@ -221,77 +218,6 @@ const main = async () => { return Number(codeId) } - const instantiateContract = async ({ - id, - codeId, - msg, - label, - prefixLength, - }: { - id: string - codeId: number - msg: Record - label: string - prefixLength: number - }) => { - const { events, transactionHash } = await client.signAndBroadcast( - sender, - [ - cwMsgToEncodeObject( - chainId, - { - wasm: { - instantiate: { - code_id: codeId, - msg: encodeJsonToBase64(msg), - funds: [], - label, - admin: undefined, - }, - }, - }, - sender - ), - ], - CHAIN_GAS_MULTIPLIER - ) - - const contractAddress = findEventsAttributeValue( - events, - 'instantiate', - '_contract_address' - ) - - log( - chalk.greenBright( - `[${id}.TX]${' '.repeat( - prefixLength - id.length - 5 - )}${transactionHash}` - ) - ) - - if (!contractAddress) { - log( - chalk.red( - `[${id}.CONTRACT]${' '.repeat( - prefixLength - id.length - 11 - )}not found` - ) - ) - process.exit(1) - } - - log( - chalk.green( - `[${id}.CONTRACT]${' '.repeat( - prefixLength - id.length - 11 - )}${contractAddress}` - ) - ) - - return contractAddress - } - log() // Upload polytone contracts only. @@ -365,6 +291,9 @@ const main = async () => { } const adminFactoryAddress = await instantiateContract({ + client, + sender, + chainId, id: 'cw_admin_factory', codeId: cwAdminFactoryCodeId, msg: {}, diff --git a/packages/dispatch/scripts/polytone.ts b/packages/dispatch/scripts/polytone.ts new file mode 100644 index 000000000..593b78478 --- /dev/null +++ b/packages/dispatch/scripts/polytone.ts @@ -0,0 +1,473 @@ +import { IbcClient, Link, Logger } from '@confio/relayer' +import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate' +import { DirectSecp256k1HdWallet } from '@cosmjs/proto-signing' +import chalk from 'chalk' +import { Command } from 'commander' +import dotenv from 'dotenv' + +import { + chainQueries, + makeGetSignerOptions, + makeReactQueryClient, + skipQueries, +} from '@dao-dao/state' +import { PolytoneConnection } from '@dao-dao/types' +import { Order } from '@dao-dao/types/protobuf/codegen/ibc/core/channel/v1/channel' +import { + getNativeTokenForChainId, + getRpcForChainId, + ibcProtoRpcClientRouter, + maybeGetChainForChainId, +} from '@dao-dao/utils' + +import { chains } from './chains' +import { getBlockMaxGas, instantiateContract } from './utils' + +const { log } = console + +const { parsed: { MNEMONIC } = {} } = dotenv.config() + +if (!MNEMONIC) { + log(chalk.red('MNEMONIC not set')) + process.exit(1) +} + +const program = new Command() +program.requiredOption('-s, --src ', 'source chain ID') +program.requiredOption('-d, --dest ', 'destination chain ID') +program.option( + '-c, --existing-connection ', + 'existing source connection ID that connects to the destination. if not provided, will attempt to resolve this automatically if a transfer channel exists between the chains, failing otherwise.' +) +program.option( + '-n, --new-connection', + 'create a new IBC connection. you probably do not want to use this if a connection already exists. creating your own connection increases the risk that the IBC clients expire and need to be reset, since activity keeps connections alive. using an existing connection means there is a higher chance others will be using the connection, which is a good thing.' +) +program.option( + '--note ', + 'note contract to use, instead of creating a new one. you may use this if the script errored before.' +) +program.option( + '--listener ', + 'listener contract to use, instead of creating a new one. you may use this if the script errored before.' +) +program.option( + '--voice ', + 'voice contract to use, instead of creating a new one. you may use this if the script errored before.' +) + +program.parse(process.argv) +const { + src: srcChainId, + dest: destChainId, + existingConnection, + newConnection, + note: _note, + listener: _listener, + voice: _voice, +} = program.opts() + +const main = async () => { + const queryClient = await makeReactQueryClient() + + const { noteCodeId, listenerCodeId } = + chains[srcChainId as keyof typeof chains] || {} + if (!noteCodeId || !listenerCodeId) { + throw new Error( + `Source chain ${srcChainId} note and/or listener code IDs not configured` + ) + } + + const { + voiceCodeId, + proxyCodeId, + addrLen: destAddrLen, + } = chains[destChainId as keyof typeof chains] || {} + if (!voiceCodeId || !proxyCodeId) { + throw new Error( + `Destination chain ${destChainId} voice and/or proxy code IDs not configured` + ) + } + + const [srcChain, destChain] = await Promise.all([ + maybeGetChainForChainId(srcChainId) || + // Fetch from Skip API if doesn't exist locally. + queryClient.fetchQuery( + skipQueries.chain(queryClient, { + chainId: srcChainId, + }) + ), + maybeGetChainForChainId(destChainId) || + // Fetch from Skip API if doesn't exist locally. + queryClient.fetchQuery( + skipQueries.chain(queryClient, { + chainId: destChainId, + }) + ), + queryClient.prefetchQuery( + chainQueries.dynamicGasPrice({ chainId: srcChainId }) + ), + queryClient.prefetchQuery( + chainQueries.dynamicGasPrice({ chainId: destChainId }) + ), + ]) + + const srcSigner = await DirectSecp256k1HdWallet.fromMnemonic(MNEMONIC, { + prefix: srcChain.bech32_prefix, + }) + const srcSender = (await srcSigner.getAccounts())[0].address + + const destSigner = await DirectSecp256k1HdWallet.fromMnemonic(MNEMONIC, { + prefix: destChain.bech32_prefix, + }) + const destSender = (await destSigner.getAccounts())[0].address + + log() + log( + chalk.underline( + `Connecting ${srcChain.chain_name} to ${destChain.chain_name} with ${srcSender} and ${destSender}...` + ) + ) + + const ibcLogger: Logger = { + error: (msg) => { + log(chalk.red(msg)) + return ibcLogger + }, + warn: (msg) => { + log(chalk.yellow(msg)) + return ibcLogger + }, + info: (msg) => { + log(chalk.green(msg)) + return ibcLogger + }, + verbose: (msg) => { + log(chalk.blue(msg)) + return ibcLogger + }, + debug: (msg) => { + log(chalk.cyan(msg)) + return ibcLogger + }, + } + + const [ + srcClient, + srcIbcQueryClient, + srcIbcClient, + srcBlockMaxGas, + destClient, + destIbcQueryClient, + destIbcClient, + destBlockMaxGas, + ] = await Promise.all([ + SigningCosmWasmClient.connectWithSigner( + getRpcForChainId(srcChainId), + srcSigner, + makeGetSignerOptions(queryClient)(srcChain.chain_name) + ), + ibcProtoRpcClientRouter.connect(srcChainId), + IbcClient.connectWithSigner( + getRpcForChainId(srcChainId), + srcSigner, + srcSender, + { + gasPrice: makeGetSignerOptions(queryClient)(srcChain.chain_name) + .gasPrice!, + // How long it waits in between checking for a new block. + estimatedBlockTime: 3000, + // How long it waits until looking for acks. + estimatedIndexerTime: 3000, + logger: ibcLogger, + } + ), + getBlockMaxGas({ chainId: srcChainId }), + SigningCosmWasmClient.connectWithSigner( + getRpcForChainId(destChainId), + destSigner, + makeGetSignerOptions(queryClient)(destChain.chain_name) + ), + ibcProtoRpcClientRouter.connect(destChainId), + IbcClient.connectWithSigner( + getRpcForChainId(destChainId), + destSigner, + destSender, + { + gasPrice: makeGetSignerOptions(queryClient)(destChain.chain_name) + .gasPrice!, + // How long it waits in between checking for a new block. + estimatedBlockTime: 3000, + // How long it waits until looking for acks. + estimatedIndexerTime: 3000, + logger: ibcLogger, + } + ), + getBlockMaxGas({ chainId: destChainId }), + ]) + + /** + * Get the connection ID from the source to the destination chain, by reverse + * engineering the transfer channel for the fee denom. + */ + const getSrcConnectionId = async () => { + const { trace } = await queryClient.fetchQuery( + skipQueries.recommendedAsset(queryClient, { + fromChainId: destChainId, + denom: getNativeTokenForChainId(destChainId).denomOrAddress, + toChainId: srcChainId, + }) + ) + + if (!trace) { + throw new Error('No trace found') + } + + const parts = trace.split('/') + if (parts.length !== 2) { + throw new Error('Expected 2 parts in trace. Got: ' + trace) + } + if (parts[0] !== 'transfer') { + throw new Error('Expected transfer port in trace. Got: ' + trace) + } + + const srcChannelId = parts[1] + + const srcConnectionHops = ( + await srcIbcQueryClient.core.channel.v1.channel({ + channelId: srcChannelId, + portId: 'transfer', + }) + ).channel?.connectionHops + if (!srcConnectionHops || srcConnectionHops.length !== 1) { + throw new Error('Expected 1 connection hop. Got: ' + srcConnectionHops) + } + + return srcConnectionHops[0] + } + + let srcConnectionId: string | undefined + let destConnectionId: string | undefined + + if (!newConnection) { + log() + log(chalk.underline('Verifying existing connection...')) + + let _srcConnectionId: string | undefined = existingConnection + + // add `connection-` prefix if just a number is provided + if ( + _srcConnectionId && + !_srcConnectionId.startsWith('connection-') && + !isNaN(Number(_srcConnectionId)) + ) { + _srcConnectionId = 'connection-' + _srcConnectionId + } + + try { + _srcConnectionId ||= await getSrcConnectionId() + } catch (err) { + throw new Error( + `Failed to get source connection ID: ${err}. Set with --existing-connection or create a new connection with --new-connection.` + ) + } + + const srcConnection = ( + await srcIbcQueryClient.core.connection.v1.connection({ + connectionId: _srcConnectionId, + }) + ).connection + if (!srcConnection) { + throw new Error('No source connection found for ID: ' + _srcConnectionId) + } + + const srcClientStatus = ( + await srcIbcQueryClient.core.client.v1.clientStatus({ + clientId: srcConnection.clientId, + }) + ).status + if (srcClientStatus !== 'ACTIVE') { + throw new Error( + `Source connection client ${srcConnection.clientId} is not active: ${srcClientStatus}` + ) + } + + const _destConnectionId = srcConnection.counterparty?.connectionId + if (!_destConnectionId) { + throw new Error('No destination connection ID found') + } + + // Ensure connections are for each other. + const destConnection = ( + await destIbcQueryClient.core.connection.v1.connection({ + connectionId: _destConnectionId, + }) + ).connection + if (!destConnection) { + throw new Error( + 'No destination connection found for ID: ' + _destConnectionId + ) + } + + if (destConnection.counterparty?.connectionId !== _srcConnectionId) { + throw new Error( + 'Destination connection client ID does not match source connection client ID. Is the source connection ID correct?' + ) + } + + const destClientStatus = ( + await destIbcQueryClient.core.client.v1.clientStatus({ + clientId: destConnection.clientId, + }) + ).status + if (destClientStatus !== 'ACTIVE') { + throw new Error( + `Destination connection client ${destConnection.clientId} is not active: ${destClientStatus}` + ) + } + + srcConnectionId = _srcConnectionId + destConnectionId = _destConnectionId + } + + // Create note and listener on source chain. + + log() + log(chalk.underline('Instantiating contracts...')) + + const consolePrefixLength = 24 + + const note = await instantiateContract({ + client: srcClient, + sender: srcSender, + chainId: srcChainId, + id: 'note', + codeId: noteCodeId, + msg: { + block_max_gas: srcBlockMaxGas, + }, + label: `polytone_note_to_${destChainId}`, + prefixLength: consolePrefixLength, + override: _note, + }) + + const listener = await instantiateContract({ + client: srcClient, + sender: srcSender, + chainId: srcChainId, + id: 'listener', + codeId: listenerCodeId, + msg: { + note, + }, + label: `polytone_listener_from_${destChainId}`, + prefixLength: consolePrefixLength, + override: _listener, + }) + + // Create voice on destination chain. + + const voice = await instantiateContract({ + client: destClient, + sender: destSender, + chainId: destChainId, + id: 'voice', + codeId: voiceCodeId, + msg: { + proxy_code_id: `${proxyCodeId}`, + block_max_gas: destBlockMaxGas, + ...(destAddrLen && { + contract_addr_len: `${destAddrLen}`, + }), + }, + label: `polytone_voice_from_${srcChainId}`, + prefixLength: consolePrefixLength, + override: _voice, + }) + + // Connect note and voice over IBC. + + log() + log( + chalk.underline( + `Opening IBC ${newConnection ? 'connection and ' : ''}channels...` + ) + ) + + let link: Link + + if (newConnection) { + link = await Link.createWithNewConnections( + srcIbcClient, + destIbcClient, + ibcLogger + ) + + srcConnectionId = link.endA.connectionID + destConnectionId = link.endB.connectionID + + log( + chalk.green( + `created source (${srcChainId}) IBC client: ${link.endA.clientID}` + ) + ) + log( + chalk.green( + `created destination (${destChainId}) IBC client: ${link.endB.clientID}` + ) + ) + } else { + // should never happen + if (!srcConnectionId || !destConnectionId) { + throw new Error( + 'Expected source and destination connection IDs to be set. Got: ' + + srcConnectionId + + ' and ' + + destConnectionId + ) + } + + link = await Link.createWithExistingConnections( + srcIbcClient, + destIbcClient, + srcConnectionId, + destConnectionId, + ibcLogger + ) + } + + const channelPair = await link.createChannel( + 'A', + `wasm.${note}`, + `wasm.${voice}`, + Order.ORDER_UNORDERED, + 'polytone-1' + ) + + log() + log(chalk.green('Done! UI config entry:')) + + const config: PolytoneConnection = { + note, + listener, + voice, + localConnection: srcConnectionId, + remoteConnection: destConnectionId, + localChannel: channelPair.src.channelId, + remoteChannel: channelPair.dest.channelId, + } + + log(JSON.stringify(config, null, 2)) +} + +main() + .then(() => process.exit(0)) + .catch((error) => { + if (error instanceof Error) { + console.error(chalk.red(error.stack)) + } else { + log(chalk.red(error)) + } + log() + process.exit(1) + }) diff --git a/packages/dispatch/scripts/utils.ts b/packages/dispatch/scripts/utils.ts new file mode 100644 index 000000000..4b3c9876a --- /dev/null +++ b/packages/dispatch/scripts/utils.ts @@ -0,0 +1,111 @@ +import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate' +import chalk from 'chalk' + +import { cwMsgToEncodeObject } from '@dao-dao/types' +import { + CHAIN_GAS_MULTIPLIER, + encodeJsonToBase64, + findEventsAttributeValue, + getRpcForChainId, +} from '@dao-dao/utils' + +const { log } = console + +export const instantiateContract = async ({ + client, + sender, + chainId, + id, + codeId, + msg, + label, + prefixLength, + override, +}: { + client: SigningCosmWasmClient + sender: string + chainId: string + id: string + codeId: number + msg: Record + label: string + prefixLength: number + /** + * If passed, use this contract instead of instantiating a new one. + */ + override?: string +}) => { + let contractAddress = override + + if (!contractAddress) { + const { events, transactionHash } = await client.signAndBroadcast( + sender, + [ + cwMsgToEncodeObject( + chainId, + { + wasm: { + instantiate: { + code_id: codeId, + msg: encodeJsonToBase64(msg), + funds: [], + label, + admin: undefined, + }, + }, + }, + sender + ), + ], + CHAIN_GAS_MULTIPLIER + ) + + contractAddress = findEventsAttributeValue( + events, + 'instantiate', + '_contract_address' + ) + + log( + chalk.greenBright( + `[${id}.TX]${' '.repeat( + prefixLength - id.length - 5 + )}${transactionHash}` + ) + ) + + if (!contractAddress) { + log( + chalk.red( + `[${id}.CONTRACT]${' '.repeat( + prefixLength - id.length - 11 + )}not found` + ) + ) + process.exit(1) + } + } + + log( + chalk.green( + `[${id}.CONTRACT]${' '.repeat( + prefixLength - id.length - 11 + )}${contractAddress}` + ) + ) + + return contractAddress +} + +export const getBlockMaxGas = async ({ + chainId, +}: { + chainId: string +}): Promise => { + const blockMaxGas = ( + await (await fetch(`${getRpcForChainId(chainId)}/consensus_params`)).json() + ).result.consensus_params.block.max_gas + + // if no max gas, default to 100000000 + return blockMaxGas === '-1' ? '100000000' : blockMaxGas +} diff --git a/packages/state/query/queries/skip.ts b/packages/state/query/queries/skip.ts index e56d6dda9..bcc51ae4a 100644 --- a/packages/state/query/queries/skip.ts +++ b/packages/state/query/queries/skip.ts @@ -61,6 +61,40 @@ export const fetchSkipAsset = async ( return asset } +/** + * Fetch Skip recommended asset. + */ +export const fetchSkipRecommendedAsset = async ( + queryClient: QueryClient, + { + fromChainId, + denom, + toChainId, + }: { + fromChainId: string + denom: string + toChainId: string + } +): Promise => { + const { asset } = + (await queryClient.fetchQuery( + indexerQueries.snapper({ + query: 'skip-recommended-asset', + parameters: { + sourceAssetChainId: fromChainId, + sourceAssetDenom: denom, + destChainId: toChainId, + }, + }) + )) ?? {} + + if (!asset) { + throw new Error('No Skip recommended asset found') + } + + return asset +} + export const skipQueries = { /** * Fetch Skip chain. @@ -84,4 +118,15 @@ export const skipQueries = { queryKey: ['skip', 'asset', options], queryFn: () => fetchSkipAsset(queryClient, options), }), + /** + * Fetch Skip recommended asset. + */ + recommendedAsset: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['skip', 'recommendedAsset', options], + queryFn: () => fetchSkipRecommendedAsset(queryClient, options), + }), } diff --git a/yarn.lock b/yarn.lock index 757fc600d..f34d12ef8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6633,6 +6633,13 @@ dependencies: type-detect "4.0.8" +"@sinonjs/commons@^3.0.0", "@sinonjs/commons@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-3.0.1.tgz#1029357e44ca901a615585f6d27738dbc89084cd" + integrity sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ== + dependencies: + type-detect "4.0.8" + "@sinonjs/fake-timers@^10.0.2": version "10.0.2" resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.0.2.tgz#d10549ed1f423d80639c528b6c7f5a1017747d0c" @@ -6640,6 +6647,27 @@ dependencies: "@sinonjs/commons" "^2.0.0" +"@sinonjs/fake-timers@^11.2.2": + version "11.2.2" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-11.2.2.tgz#50063cc3574f4a27bd8453180a04171c85cc9699" + integrity sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw== + dependencies: + "@sinonjs/commons" "^3.0.0" + +"@sinonjs/samsam@^8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-8.0.0.tgz#0d488c91efb3fa1442e26abea81759dfc8b5ac60" + integrity sha512-Bp8KUVlLp8ibJZrnvq2foVhP0IVX2CIprMJPK0vqGqgrDa0OHVKeZyBykqskkrdxV6yKBPmGasO8LVjAKR3Gew== + dependencies: + "@sinonjs/commons" "^2.0.0" + lodash.get "^4.4.2" + type-detect "^4.0.8" + +"@sinonjs/text-encoding@^0.7.2": + version "0.7.2" + resolved "https://registry.yarnpkg.com/@sinonjs/text-encoding/-/text-encoding-0.7.2.tgz#5981a8db18b56ba38ef0efb7d995b12aa7b51918" + integrity sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ== + "@smithy/abort-controller@^3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@smithy/abort-controller/-/abort-controller-3.0.0.tgz#5815f5d4618e14bf8d031bb98a99adabbb831168" @@ -13292,6 +13320,11 @@ diff@^5.0.0: resolved "https://registry.yarnpkg.com/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40" integrity sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw== +diff@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.2.0.tgz#26ded047cd1179b78b9537d5ef725503ce1ae531" + integrity sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A== + diffie-hellman@^5.0.0: version "5.0.3" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" @@ -17825,6 +17858,11 @@ just-diff@^5.0.1: resolved "https://registry.yarnpkg.com/just-diff/-/just-diff-5.2.0.tgz#60dca55891cf24cd4a094e33504660692348a241" integrity sha512-6ufhP9SHjb7jibNFrNxyFZ6od3g+An6Ai9mhGRvcYe8UJlH0prseN64M+6ZBBUoKYHZsitDP42gAJ8+eVWr3lw== +just-extend@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/just-extend/-/just-extend-6.2.0.tgz#b816abfb3d67ee860482e7401564672558163947" + integrity sha512-cYofQu2Xpom82S6qD778jBDpwvvy39s1l/hrYij2u9AMdQcGRpaBu6kY4mVhuno5kJVi1DAz4aiphA2WI1/OAw== + jwt-decode@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jwt-decode/-/jwt-decode-4.0.0.tgz#2270352425fd413785b2faf11f6e755c5151bd4b" @@ -19704,6 +19742,17 @@ nice-try@^1.0.4: resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== +nise@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/nise/-/nise-6.0.0.tgz#ae56fccb5d912037363c3b3f29ebbfa28bde8b48" + integrity sha512-K8ePqo9BFvN31HXwEtTNGzgrPpmvgciDsFz8aztFjt4LqKO/JeFD8tBOeuDiCMXrIl/m1YvfH8auSpxfaD09wg== + dependencies: + "@sinonjs/commons" "^3.0.0" + "@sinonjs/fake-timers" "^11.2.2" + "@sinonjs/text-encoding" "^0.7.2" + just-extend "^6.2.0" + path-to-regexp "^6.2.1" + no-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" @@ -20797,6 +20846,11 @@ path-to-regexp@0.1.7: resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== +path-to-regexp@^6.2.1: + version "6.2.2" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-6.2.2.tgz#324377a83e5049cbecadc5554d6a63a9a4866b36" + integrity sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw== + path-type@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" @@ -23146,6 +23200,18 @@ simple-swizzle@^0.2.2: dependencies: is-arrayish "^0.3.1" +sinon@^18.0.0: + version "18.0.0" + resolved "https://registry.yarnpkg.com/sinon/-/sinon-18.0.0.tgz#69ca293dbc3e82590a8b0d46c97f63ebc1e5fc01" + integrity sha512-+dXDXzD1sBO6HlmZDd7mXZCR/y5ECiEiGCBSGuFD/kZ0bDTofPYc6JaeGmPSF+1j1MejGUWkORbYOLDyvqCWpA== + dependencies: + "@sinonjs/commons" "^3.0.1" + "@sinonjs/fake-timers" "^11.2.2" + "@sinonjs/samsam" "^8.0.0" + diff "^5.2.0" + nise "^6.0.0" + supports-color "^7" + sirv@^1.0.7: version "1.0.19" resolved "https://registry.yarnpkg.com/sirv/-/sirv-1.0.19.tgz#1d73979b38c7fe91fcba49c85280daa9c2363b49" @@ -23926,7 +23992,7 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" -supports-color@^7.0.0, supports-color@^7.1.0: +supports-color@^7, supports-color@^7.0.0, supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== @@ -24743,7 +24809,7 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -type-detect@4.0.8: +type-detect@4.0.8, type-detect@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== From e6e94345d6a0f4e3a75ee12ce97c2fc5cd9f4f73 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 22 Jul 2024 18:24:36 -0400 Subject: [PATCH 333/438] fixed SubDAOs not loading when cross-chain SubDAOs exist --- .../components/dao/tabs/SubDaosTab.tsx | 19 ++++++++----------- packages/stateful/queries/dao.ts | 2 +- .../dao/tabs/SubDaosTab.stories.tsx | 3 ++- .../components/dao/tabs/SubDaosTab.tsx | 7 +++++-- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/packages/stateful/components/dao/tabs/SubDaosTab.tsx b/packages/stateful/components/dao/tabs/SubDaosTab.tsx index 1db14d71f..71bff50bd 100644 --- a/packages/stateful/components/dao/tabs/SubDaosTab.tsx +++ b/packages/stateful/components/dao/tabs/SubDaosTab.tsx @@ -9,7 +9,7 @@ import { ActionKey, Feature } from '@dao-dao/types' import { getDaoProposalSinglePrefill } from '@dao-dao/utils' import { useActionForKey } from '../../../actions' -import { useMembership, useQueryLoadingData } from '../../../hooks' +import { useMembership, useQueryLoadingDataWithError } from '../../../hooks' import { daoQueries } from '../../../queries' import { ButtonLink } from '../../ButtonLink' import { DaoCard } from '../DaoCard' @@ -21,16 +21,13 @@ export const SubDaosTab = () => { const { isMember = false } = useMembership() const queryClient = useQueryClient() - const subDaos = useQueryLoadingData( - { - ...daoQueries.subDaoInfos(queryClient, { - chainId, - coreAddress, - }), - enabled: !!supportedFeatures[Feature.SubDaos], - }, - [] - ) + const subDaos = useQueryLoadingDataWithError({ + ...daoQueries.subDaoInfos(queryClient, { + chainId, + coreAddress, + }), + enabled: !!supportedFeatures[Feature.SubDaos], + }) const upgradeToV2Action = useActionForKey(ActionKey.UpgradeV1ToV2) const upgradeToV2ActionDefaults = upgradeToV2Action?.useDefaults() diff --git a/packages/stateful/queries/dao.ts b/packages/stateful/queries/dao.ts index c8847747d..0e27e8306 100644 --- a/packages/stateful/queries/dao.ts +++ b/packages/stateful/queries/dao.ts @@ -370,7 +370,7 @@ export const fetchSubDaoInfos = async ( ) return await Promise.all( - subDaos.map(({ addr }) => + subDaos.map(({ chainId, addr }) => queryClient.fetchQuery( daoQueries.info(queryClient, { chainId, coreAddress: addr }) ) diff --git a/packages/stateless/components/dao/tabs/SubDaosTab.stories.tsx b/packages/stateless/components/dao/tabs/SubDaosTab.stories.tsx index c7f5d0fe3..4c2376da6 100644 --- a/packages/stateless/components/dao/tabs/SubDaosTab.stories.tsx +++ b/packages/stateless/components/dao/tabs/SubDaosTab.stories.tsx @@ -48,6 +48,7 @@ Default.args = { isMember: true, subDaos: { loading: false, + errored: false, data: [ { ...makeDaoCardProps(1).info, @@ -79,5 +80,5 @@ Default.args = { export const Loading = Template.bind({}) Loading.args = { ...Default.args, - subDaos: { loading: true }, + subDaos: { loading: true, errored: false }, } diff --git a/packages/stateless/components/dao/tabs/SubDaosTab.tsx b/packages/stateless/components/dao/tabs/SubDaosTab.tsx index 4c7476177..2577f06d4 100644 --- a/packages/stateless/components/dao/tabs/SubDaosTab.tsx +++ b/packages/stateless/components/dao/tabs/SubDaosTab.tsx @@ -7,12 +7,13 @@ import { ContractVersion, DaoInfo, Feature, - LoadingData, + LoadingDataWithError, StatefulDaoCardProps, } from '@dao-dao/types' import { useDaoInfoContext } from '../../../contexts' import { useDaoNavHelpers } from '../../../hooks' +import { ErrorPage } from '../../error' import { GridCardContainer } from '../../GridCardContainer' import { NoContent } from '../../NoContent' import { Tooltip } from '../../tooltip' @@ -20,7 +21,7 @@ import { DaoCardLoader } from '../DaoCard' export interface SubDaosTabProps { DaoCard: ComponentType - subDaos: LoadingData + subDaos: LoadingDataWithError isMember: boolean createSubDaoHref?: string upgradeToV2Href?: string @@ -87,6 +88,8 @@ export const SubDaosTab = ({ buttonLabel={t('button.proposeUpgrade')} href={isMember ? upgradeToV2Href : undefined} /> + ) : subDaos.errored ? ( + ) : subDaos.loading || subDaos.data.length > 0 ? ( <>

From 5c8b24f4f51e3beffb8ccbd2d1cb3b52612898b2 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 22 Jul 2024 18:37:27 -0400 Subject: [PATCH 334/438] fixed DaoProviders not refreshing when address changes --- .../stateful/actions/core/authorizations/AuthzExec/index.tsx | 5 +++++ .../actions/core/dao_governance/DaoAdminExec/index.tsx | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/packages/stateful/actions/core/authorizations/AuthzExec/index.tsx b/packages/stateful/actions/core/authorizations/AuthzExec/index.tsx index 01c180aab..b3b7a485a 100644 --- a/packages/stateful/actions/core/authorizations/AuthzExec/index.tsx +++ b/packages/stateful/actions/core/authorizations/AuthzExec/index.tsx @@ -116,6 +116,11 @@ const InnerComponentWrapper: ActionComponent< ) : isDao.data ? ( } diff --git a/packages/stateful/actions/core/dao_governance/DaoAdminExec/index.tsx b/packages/stateful/actions/core/dao_governance/DaoAdminExec/index.tsx index 91d1ca036..c40bc2c2e 100644 --- a/packages/stateful/actions/core/dao_governance/DaoAdminExec/index.tsx +++ b/packages/stateful/actions/core/dao_governance/DaoAdminExec/index.tsx @@ -130,6 +130,11 @@ const Component: ActionComponent = (props) => { return ( Date: Mon, 22 Jul 2024 18:44:19 -0400 Subject: [PATCH 335/438] fixed build --- packages/stateful/components/gov/GovSubDaosTab.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/stateful/components/gov/GovSubDaosTab.tsx b/packages/stateful/components/gov/GovSubDaosTab.tsx index 1bc284146..1ac4aadb6 100644 --- a/packages/stateful/components/gov/GovSubDaosTab.tsx +++ b/packages/stateful/components/gov/GovSubDaosTab.tsx @@ -39,9 +39,13 @@ export const GovSubDaosTab = () => { isMember={true} subDaos={ subDaos.loading - ? subDaos + ? { + loading: true, + errored: false, + } : { loading: false, + errored: false, updating: subDaos.updating, data: subDaos.data.flatMap((subDao) => subDao || []), } From eff869d7e22f8fb100b03fb7903159eba1213288 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 23 Jul 2024 12:04:48 -0400 Subject: [PATCH 336/438] updated valence account code ID --- packages/utils/constants/chains.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 3edf10279..6de8ae0bd 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -667,7 +667,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ DaoVotingCw721Staked: 576, DaoVotingTokenStaked: 577, - ValenceAccount: 1506, + ValenceAccount: 1618, }, historicalCodeIds: { [ContractVersion.V210]: { From 11717862e8b090043c36f192fc2f1e57591fdb88 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 23 Jul 2024 15:43:21 -0400 Subject: [PATCH 337/438] fixed dispatch script a bit --- packages/dispatch/package.json | 4 +- packages/dispatch/scripts/polytone.ts | 72 +++++++++++++++++++++++++-- 2 files changed, 72 insertions(+), 4 deletions(-) diff --git a/packages/dispatch/package.json b/packages/dispatch/package.json index eb215a969..69f602ed2 100644 --- a/packages/dispatch/package.json +++ b/packages/dispatch/package.json @@ -26,6 +26,8 @@ "prettier": "@dao-dao/config/prettier", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.3", - "@cosmjs/proto-signing": "^0.32.3" + "@cosmjs/proto-signing": "^0.32.3", + "@cosmjs/stargate": "^0.32.3", + "@cosmjs/tendermint-rpc": "^0.32.3" } } diff --git a/packages/dispatch/scripts/polytone.ts b/packages/dispatch/scripts/polytone.ts index 593b78478..7bf6074c7 100644 --- a/packages/dispatch/scripts/polytone.ts +++ b/packages/dispatch/scripts/polytone.ts @@ -1,6 +1,8 @@ import { IbcClient, Link, Logger } from '@confio/relayer' import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate' import { DirectSecp256k1HdWallet } from '@cosmjs/proto-signing' +import { QueryClient, setupStakingExtension } from '@cosmjs/stargate' +import { connectComet } from '@cosmjs/tendermint-rpc' import chalk from 'chalk' import { Command } from 'commander' import dotenv from 'dotenv' @@ -11,7 +13,7 @@ import { makeReactQueryClient, skipQueries, } from '@dao-dao/state' -import { PolytoneConnection } from '@dao-dao/types' +import { ChainId, PolytoneConnection } from '@dao-dao/types' import { Order } from '@dao-dao/types/protobuf/codegen/ibc/core/channel/v1/channel' import { getNativeTokenForChainId, @@ -286,7 +288,7 @@ const main = async () => { clientId: srcConnection.clientId, }) ).status - if (srcClientStatus !== 'ACTIVE') { + if (srcClientStatus !== 'Active') { throw new Error( `Source connection client ${srcConnection.clientId} is not active: ${srcClientStatus}` ) @@ -320,7 +322,7 @@ const main = async () => { clientId: destConnection.clientId, }) ).status - if (destClientStatus !== 'ACTIVE') { + if (destClientStatus !== 'Active') { throw new Error( `Destination connection client ${destConnection.clientId} is not active: ${destClientStatus}` ) @@ -397,6 +399,70 @@ const main = async () => { let link: Link if (newConnection) { + // For Neutron, which does not have staking, use its parent chain's (Cosmos + // Hub's) unbonding time instead. This is needed to create a new + // connection/clients. + const neutronIbcClient = + srcChainId === ChainId.NeutronMainnet + ? srcIbcClient + : destChainId === ChainId.NeutronMainnet + ? destIbcClient + : undefined + if (neutronIbcClient) { + const cosmosHubStakingQueryClient = QueryClient.withExtensions( + await connectComet(getRpcForChainId(ChainId.CosmosHubMainnet)), + setupStakingExtension + ) + neutronIbcClient.query.staking.params = async () => { + const { params } = await cosmosHubStakingQueryClient.staking.params() + return { + params: { + ...params, + unbondingTime: { + // Subtract one day. + seconds: params.unbondingTime.seconds - BigInt(24 * 3600), + nanos: params.unbondingTime.nanos, + }, + }, + } + } + } + + // replace auto fee with larger chain multiplier to cover gas + const srcOriginalSignAndBroadcast = srcIbcClient.sign.signAndBroadcast.bind( + srcIbcClient.sign + ) + srcIbcClient.sign.signAndBroadcast = ( + signerAddress, + messages, + fee, + memo, + timeoutHeight + ) => + srcOriginalSignAndBroadcast( + signerAddress, + messages, + fee === 'auto' ? 2 : fee, + memo, + timeoutHeight + ) + const destOriginalSignAndBroadcast = + destIbcClient.sign.signAndBroadcast.bind(destIbcClient.sign) + destIbcClient.sign.signAndBroadcast = ( + signerAddress, + messages, + fee, + memo, + timeoutHeight + ) => + destOriginalSignAndBroadcast( + signerAddress, + messages, + fee === 'auto' ? 2 : fee, + memo, + timeoutHeight + ) + link = await Link.createWithNewConnections( srcIbcClient, destIbcClient, From 8a1f5902a887fba2198b4bca3a863fe126f4f592 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 23 Jul 2024 15:52:04 -0400 Subject: [PATCH 338/438] auto convert udenom to DENOM for factory tokens --- packages/state/query/queries/chain.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/state/query/queries/chain.ts b/packages/state/query/queries/chain.ts index c67290920..f4ed9ee0c 100644 --- a/packages/state/query/queries/chain.ts +++ b/packages/state/query/queries/chain.ts @@ -340,15 +340,21 @@ export const fetchDenomMetadata = async ({ denomUnits.find(({ exponent }) => exponent > 0) ?? denomUnits[0] + const extractedSymbol = displayDenom + ? displayDenom.denom.startsWith('factory/') + ? displayDenom.denom.split('/').pop()! + : displayDenom.denom + : metadata.symbol + return { metadata, // If factory denom, extract symbol at the end. preferredSymbol: - (displayDenom - ? displayDenom.denom.startsWith('factory/') - ? displayDenom.denom.split('/').pop()! - : displayDenom.denom - : metadata.symbol) || denom, + // convert `utoken` to `TOKEN` + (extractedSymbol.startsWith('u') && + extractedSymbol.toLowerCase() === extractedSymbol + ? extractedSymbol.substring(1).toUpperCase() + : extractedSymbol) || denom, preferredDecimals: displayDenom?.exponent || (chainId === ChainId.KujiraMainnet || From bf9b93bc6fca27754974acf33137e1cf538bbef0 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 23 Jul 2024 16:48:27 -0400 Subject: [PATCH 339/438] added neutron to migaloo/juno polytones --- packages/utils/constants/chains.ts | 39 +++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 6de8ae0bd..9660cf6ab 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -681,9 +681,6 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ rebalancer: 'neutron1qs6mzpmcw3dvg5l8nyywetcj326scszdj7v4pfk55xwshd4prqnqfwc0z2', }, - // There is no IBC connection with: - // - Juno - // - Migaloo polytone: { [ChainId.OsmosisMainnet]: { // neutron @@ -804,6 +801,42 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // injective remoteChannel: 'channel-304', }, + [ChainId.MigalooMainnet]: { + // neutron + note: 'neutron1454e3h2ajqa986lwg63hrc3lqdzrcqfn2zxkzrleq9kw342jyndqp0393j', + // neutron + listener: + 'neutron1ml36whejpprr2ndcd7d3ll8k0p5et2lxmxqpjw4l2zz40f4h08uqvxwz7j', + // migaloo + voice: + 'migaloo1zq0zp52lquys72jl49j7vs3jck2et2pjdj874s8sgdwez4rp3p2sjy6kk6', + // neutron + localConnection: 'connection-93', + // migaloo + remoteConnection: 'connection-105', + // neutron + localChannel: 'channel-4720', + // migaloo + remoteChannel: 'channel-134', + }, + [ChainId.JunoMainnet]: { + // neutron + note: 'neutron174ne8p7zh539sht8sfjsa9r6uwe3pzlvqedr0yquml9crfzsfnlshvlse8', + // neutron + listener: + 'neutron16n92xe0336c3tr5fjy42uff39vh2xpdk9zlz24vq0vnuhnu7882q8x5fr6', + // juno + voice: + 'juno1c9hx3q7sd2d0xgknc52ft6qsqxemkuxh3nt8d4rmdtdua25x5h0sdd2zm5', + // neutron + localConnection: 'connection-95', + // juno + remoteConnection: 'connection-530', + // neutron + localChannel: 'channel-4721', + // juno + remoteChannel: 'channel-593', + }, }, }, { From 6f6a4d8578c7654e9565f5e53ee6dec745ece479 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 23 Jul 2024 17:20:03 -0400 Subject: [PATCH 340/438] added ccv proto types --- .../types/protobuf/codegen/OmniFlix/bundle.ts | 44 +- .../types/protobuf/codegen/alliance/bundle.ts | 24 +- .../types/protobuf/codegen/bitsong/bundle.ts | 16 +- .../types/protobuf/codegen/circle/bundle.ts | 24 +- .../types/protobuf/codegen/cosmos/bundle.ts | 196 ++-- .../types/protobuf/codegen/cosmwasm/bundle.ts | 40 +- .../protobuf/codegen/feemarket/bundle.ts | 24 +- .../types/protobuf/codegen/gaia/bundle.ts | 24 +- packages/types/protobuf/codegen/ibc/bundle.ts | 112 ++- .../lightclients/tendermint/v1/tendermint.ts | 855 ++++++++++++++++ packages/types/protobuf/codegen/index.ts | 2 + .../codegen/interchain_security/bundle.ts | 36 + .../ccv/consumer/v1/consumer.ts | 298 ++++++ .../ccv/consumer/v1/genesis.ts | 871 +++++++++++++++++ .../ccv/consumer/v1/query.rpc.Query.ts | 64 ++ .../ccv/consumer/v1/query.ts | 918 ++++++++++++++++++ .../ccv/consumer/v1/tx.amino.ts | 8 + .../ccv/consumer/v1/tx.registry.ts | 35 + .../ccv/consumer/v1/tx.rpc.msg.ts | 19 + .../interchain_security/ccv/consumer/v1/tx.ts | 166 ++++ .../ccv/v1/shared_consumer.ts | 630 ++++++++++++ .../interchain_security/ccv/v1/wire.ts | 916 +++++++++++++++++ .../codegen/interchain_security/client.ts | 47 + .../codegen/interchain_security/rpc.query.ts | 63 ++ .../codegen/interchain_security/rpc.tx.ts | 47 + .../types/protobuf/codegen/juno/bundle.ts | 72 +- .../types/protobuf/codegen/kujira/bundle.ts | 94 +- .../types/protobuf/codegen/neutron/bundle.ts | 220 ++--- .../types/protobuf/codegen/noble/bundle.ts | 20 +- .../types/protobuf/codegen/osmosis/bundle.ts | 492 +++++----- .../types/protobuf/codegen/pstake/bundle.ts | 146 +-- .../protobuf/codegen/publicawesome/bundle.ts | 132 +-- .../types/protobuf/codegen/regen/bundle.ts | 204 ++-- .../types/protobuf/codegen/secret/bundle.ts | 116 +-- .../protobuf/codegen/tendermint/bundle.ts | 40 +- .../ccv/consumer/v1/consumer.proto | 44 + .../ccv/consumer/v1/genesis.proto | 92 ++ .../ccv/consumer/v1/query.proto | 87 ++ .../ccv/consumer/v1/tx.proto | 29 + .../ccv/v1/shared_consumer.proto | 100 ++ .../interchain_security/ccv/v1/wire.proto | 122 +++ packages/types/protobuf/scripts/codegen.js | 1 + 42 files changed, 6474 insertions(+), 1016 deletions(-) create mode 100644 packages/types/protobuf/codegen/ibc/lightclients/tendermint/v1/tendermint.ts create mode 100644 packages/types/protobuf/codegen/interchain_security/bundle.ts create mode 100644 packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/consumer.ts create mode 100644 packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/genesis.ts create mode 100644 packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/query.rpc.Query.ts create mode 100644 packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/query.ts create mode 100644 packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/tx.amino.ts create mode 100644 packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/tx.registry.ts create mode 100644 packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/tx.rpc.msg.ts create mode 100644 packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/tx.ts create mode 100644 packages/types/protobuf/codegen/interchain_security/ccv/v1/shared_consumer.ts create mode 100644 packages/types/protobuf/codegen/interchain_security/ccv/v1/wire.ts create mode 100644 packages/types/protobuf/codegen/interchain_security/client.ts create mode 100644 packages/types/protobuf/codegen/interchain_security/rpc.query.ts create mode 100644 packages/types/protobuf/codegen/interchain_security/rpc.tx.ts create mode 100644 packages/types/protobuf/proto/interchain_security/ccv/consumer/v1/consumer.proto create mode 100644 packages/types/protobuf/proto/interchain_security/ccv/consumer/v1/genesis.proto create mode 100644 packages/types/protobuf/proto/interchain_security/ccv/consumer/v1/query.proto create mode 100644 packages/types/protobuf/proto/interchain_security/ccv/consumer/v1/tx.proto create mode 100644 packages/types/protobuf/proto/interchain_security/ccv/v1/shared_consumer.proto create mode 100644 packages/types/protobuf/proto/interchain_security/ccv/v1/wire.proto diff --git a/packages/types/protobuf/codegen/OmniFlix/bundle.ts b/packages/types/protobuf/codegen/OmniFlix/bundle.ts index 2e8a582ba..65c7d585d 100644 --- a/packages/types/protobuf/codegen/OmniFlix/bundle.ts +++ b/packages/types/protobuf/codegen/OmniFlix/bundle.ts @@ -1,30 +1,30 @@ -import * as _206 from "./onft/v1beta1/genesis"; -import * as _207 from "./onft/v1beta1/onft"; -import * as _208 from "./onft/v1beta1/params"; -import * as _209 from "./onft/v1beta1/query"; -import * as _210 from "./onft/v1beta1/tx"; -import * as _519 from "./onft/v1beta1/tx.amino"; -import * as _520 from "./onft/v1beta1/tx.registry"; -import * as _521 from "./onft/v1beta1/query.rpc.Query"; -import * as _522 from "./onft/v1beta1/tx.rpc.msg"; -import * as _664 from "./rpc.query"; -import * as _665 from "./rpc.tx"; +import * as _213 from "./onft/v1beta1/genesis"; +import * as _214 from "./onft/v1beta1/onft"; +import * as _215 from "./onft/v1beta1/params"; +import * as _216 from "./onft/v1beta1/query"; +import * as _217 from "./onft/v1beta1/tx"; +import * as _530 from "./onft/v1beta1/tx.amino"; +import * as _531 from "./onft/v1beta1/tx.registry"; +import * as _532 from "./onft/v1beta1/query.rpc.Query"; +import * as _533 from "./onft/v1beta1/tx.rpc.msg"; +import * as _677 from "./rpc.query"; +import * as _678 from "./rpc.tx"; export namespace OmniFlix { export namespace onft { export const v1beta1 = { - ..._206, - ..._207, - ..._208, - ..._209, - ..._210, - ..._519, - ..._520, - ..._521, - ..._522 + ..._213, + ..._214, + ..._215, + ..._216, + ..._217, + ..._530, + ..._531, + ..._532, + ..._533 }; } export const ClientFactory = { - ..._664, - ..._665 + ..._677, + ..._678 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/alliance/bundle.ts b/packages/types/protobuf/codegen/alliance/bundle.ts index 68390a816..992d335f5 100644 --- a/packages/types/protobuf/codegen/alliance/bundle.ts +++ b/packages/types/protobuf/codegen/alliance/bundle.ts @@ -8,12 +8,12 @@ import * as _6 from "./alliance/query"; import * as _7 from "./alliance/redelegations"; import * as _8 from "./alliance/tx"; import * as _9 from "./alliance/unbonding"; -import * as _380 from "./alliance/tx.amino"; -import * as _381 from "./alliance/tx.registry"; -import * as _382 from "./alliance/query.rpc.Query"; -import * as _383 from "./alliance/tx.rpc.msg"; -import * as _643 from "./rpc.query"; -import * as _644 from "./rpc.tx"; +import * as _387 from "./alliance/tx.amino"; +import * as _388 from "./alliance/tx.registry"; +import * as _389 from "./alliance/query.rpc.Query"; +import * as _390 from "./alliance/tx.rpc.msg"; +import * as _654 from "./rpc.query"; +import * as _655 from "./rpc.tx"; export namespace alliance { export const alliance = { ..._0, @@ -26,13 +26,13 @@ export namespace alliance { ..._7, ..._8, ..._9, - ..._380, - ..._381, - ..._382, - ..._383 + ..._387, + ..._388, + ..._389, + ..._390 }; export const ClientFactory = { - ..._643, - ..._644 + ..._654, + ..._655 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/bitsong/bundle.ts b/packages/types/protobuf/codegen/bitsong/bundle.ts index 0aed32711..3e7f156c5 100644 --- a/packages/types/protobuf/codegen/bitsong/bundle.ts +++ b/packages/types/protobuf/codegen/bitsong/bundle.ts @@ -1,16 +1,16 @@ import * as _11 from "./fantoken/v1beta1/tx"; -import * as _384 from "./fantoken/v1beta1/tx.amino"; -import * as _385 from "./fantoken/v1beta1/tx.registry"; -import * as _386 from "./fantoken/v1beta1/tx.rpc.msg"; -import * as _645 from "./rpc.tx"; +import * as _391 from "./fantoken/v1beta1/tx.amino"; +import * as _392 from "./fantoken/v1beta1/tx.registry"; +import * as _393 from "./fantoken/v1beta1/tx.rpc.msg"; +import * as _656 from "./rpc.tx"; export namespace bitsong { export const fantoken = { ..._11, - ..._384, - ..._385, - ..._386 + ..._391, + ..._392, + ..._393 }; export const ClientFactory = { - ..._645 + ..._656 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/circle/bundle.ts b/packages/types/protobuf/codegen/circle/bundle.ts index 7f6f4687b..228b1f2cf 100644 --- a/packages/types/protobuf/codegen/circle/bundle.ts +++ b/packages/types/protobuf/codegen/circle/bundle.ts @@ -14,12 +14,12 @@ import * as _24 from "./cctp/v1/sending_and_receiving_messages_paused"; import * as _25 from "./cctp/v1/signature_threshold"; import * as _26 from "./cctp/v1/token_pair"; import * as _27 from "./cctp/v1/tx"; -import * as _387 from "./cctp/v1/tx.amino"; -import * as _388 from "./cctp/v1/tx.registry"; -import * as _389 from "./cctp/v1/query.rpc.Query"; -import * as _390 from "./cctp/v1/tx.rpc.msg"; -import * as _646 from "./rpc.query"; -import * as _647 from "./rpc.tx"; +import * as _394 from "./cctp/v1/tx.amino"; +import * as _395 from "./cctp/v1/tx.registry"; +import * as _396 from "./cctp/v1/query.rpc.Query"; +import * as _397 from "./cctp/v1/tx.rpc.msg"; +import * as _657 from "./rpc.query"; +import * as _658 from "./rpc.tx"; export namespace circle { export namespace cctp { export const v1 = { @@ -39,14 +39,14 @@ export namespace circle { ..._25, ..._26, ..._27, - ..._387, - ..._388, - ..._389, - ..._390 + ..._394, + ..._395, + ..._396, + ..._397 }; } export const ClientFactory = { - ..._646, - ..._647 + ..._657, + ..._658 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmos/bundle.ts b/packages/types/protobuf/codegen/cosmos/bundle.ts index a88419184..c1e2cc990 100644 --- a/packages/types/protobuf/codegen/cosmos/bundle.ts +++ b/packages/types/protobuf/codegen/cosmos/bundle.ts @@ -61,55 +61,55 @@ import * as _88 from "./tx/v1beta1/tx"; import * as _89 from "./upgrade/v1beta1/query"; import * as _90 from "./upgrade/v1beta1/tx"; import * as _91 from "./upgrade/v1beta1/upgrade"; -import * as _391 from "./auth/v1beta1/tx.amino"; -import * as _392 from "./authz/v1beta1/tx.amino"; -import * as _393 from "./bank/v1beta1/tx.amino"; -import * as _394 from "./distribution/v1beta1/tx.amino"; -import * as _395 from "./feegrant/v1beta1/tx.amino"; -import * as _396 from "./gov/v1/tx.amino"; -import * as _397 from "./gov/v1beta1/tx.amino"; -import * as _398 from "./mint/v1beta1/tx.amino"; -import * as _399 from "./slashing/v1beta1/tx.amino"; -import * as _400 from "./staking/v1beta1/tx.amino"; -import * as _401 from "./upgrade/v1beta1/tx.amino"; -import * as _402 from "./auth/v1beta1/tx.registry"; -import * as _403 from "./authz/v1beta1/tx.registry"; -import * as _404 from "./bank/v1beta1/tx.registry"; -import * as _405 from "./distribution/v1beta1/tx.registry"; -import * as _406 from "./feegrant/v1beta1/tx.registry"; -import * as _407 from "./gov/v1/tx.registry"; -import * as _408 from "./gov/v1beta1/tx.registry"; -import * as _409 from "./mint/v1beta1/tx.registry"; -import * as _410 from "./slashing/v1beta1/tx.registry"; -import * as _411 from "./staking/v1beta1/tx.registry"; -import * as _412 from "./upgrade/v1beta1/tx.registry"; -import * as _413 from "./auth/v1beta1/query.rpc.Query"; -import * as _414 from "./authz/v1beta1/query.rpc.Query"; -import * as _415 from "./bank/v1beta1/query.rpc.Query"; -import * as _416 from "./base/tendermint/v1beta1/query.rpc.Service"; -import * as _417 from "./distribution/v1beta1/query.rpc.Query"; -import * as _418 from "./feegrant/v1beta1/query.rpc.Query"; -import * as _419 from "./gov/v1/query.rpc.Query"; -import * as _420 from "./gov/v1beta1/query.rpc.Query"; -import * as _421 from "./mint/v1beta1/query.rpc.Query"; -import * as _422 from "./params/v1beta1/query.rpc.Query"; -import * as _423 from "./slashing/v1beta1/query.rpc.Query"; -import * as _424 from "./staking/v1beta1/query.rpc.Query"; -import * as _425 from "./tx/v1beta1/service.rpc.Service"; -import * as _426 from "./upgrade/v1beta1/query.rpc.Query"; -import * as _427 from "./auth/v1beta1/tx.rpc.msg"; -import * as _428 from "./authz/v1beta1/tx.rpc.msg"; -import * as _429 from "./bank/v1beta1/tx.rpc.msg"; -import * as _430 from "./distribution/v1beta1/tx.rpc.msg"; -import * as _431 from "./feegrant/v1beta1/tx.rpc.msg"; -import * as _432 from "./gov/v1/tx.rpc.msg"; -import * as _433 from "./gov/v1beta1/tx.rpc.msg"; -import * as _434 from "./mint/v1beta1/tx.rpc.msg"; -import * as _435 from "./slashing/v1beta1/tx.rpc.msg"; -import * as _436 from "./staking/v1beta1/tx.rpc.msg"; -import * as _437 from "./upgrade/v1beta1/tx.rpc.msg"; -import * as _648 from "./rpc.query"; -import * as _649 from "./rpc.tx"; +import * as _398 from "./auth/v1beta1/tx.amino"; +import * as _399 from "./authz/v1beta1/tx.amino"; +import * as _400 from "./bank/v1beta1/tx.amino"; +import * as _401 from "./distribution/v1beta1/tx.amino"; +import * as _402 from "./feegrant/v1beta1/tx.amino"; +import * as _403 from "./gov/v1/tx.amino"; +import * as _404 from "./gov/v1beta1/tx.amino"; +import * as _405 from "./mint/v1beta1/tx.amino"; +import * as _406 from "./slashing/v1beta1/tx.amino"; +import * as _407 from "./staking/v1beta1/tx.amino"; +import * as _408 from "./upgrade/v1beta1/tx.amino"; +import * as _409 from "./auth/v1beta1/tx.registry"; +import * as _410 from "./authz/v1beta1/tx.registry"; +import * as _411 from "./bank/v1beta1/tx.registry"; +import * as _412 from "./distribution/v1beta1/tx.registry"; +import * as _413 from "./feegrant/v1beta1/tx.registry"; +import * as _414 from "./gov/v1/tx.registry"; +import * as _415 from "./gov/v1beta1/tx.registry"; +import * as _416 from "./mint/v1beta1/tx.registry"; +import * as _417 from "./slashing/v1beta1/tx.registry"; +import * as _418 from "./staking/v1beta1/tx.registry"; +import * as _419 from "./upgrade/v1beta1/tx.registry"; +import * as _420 from "./auth/v1beta1/query.rpc.Query"; +import * as _421 from "./authz/v1beta1/query.rpc.Query"; +import * as _422 from "./bank/v1beta1/query.rpc.Query"; +import * as _423 from "./base/tendermint/v1beta1/query.rpc.Service"; +import * as _424 from "./distribution/v1beta1/query.rpc.Query"; +import * as _425 from "./feegrant/v1beta1/query.rpc.Query"; +import * as _426 from "./gov/v1/query.rpc.Query"; +import * as _427 from "./gov/v1beta1/query.rpc.Query"; +import * as _428 from "./mint/v1beta1/query.rpc.Query"; +import * as _429 from "./params/v1beta1/query.rpc.Query"; +import * as _430 from "./slashing/v1beta1/query.rpc.Query"; +import * as _431 from "./staking/v1beta1/query.rpc.Query"; +import * as _432 from "./tx/v1beta1/service.rpc.Service"; +import * as _433 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _434 from "./auth/v1beta1/tx.rpc.msg"; +import * as _435 from "./authz/v1beta1/tx.rpc.msg"; +import * as _436 from "./bank/v1beta1/tx.rpc.msg"; +import * as _437 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _438 from "./feegrant/v1beta1/tx.rpc.msg"; +import * as _439 from "./gov/v1/tx.rpc.msg"; +import * as _440 from "./gov/v1beta1/tx.rpc.msg"; +import * as _441 from "./mint/v1beta1/tx.rpc.msg"; +import * as _442 from "./slashing/v1beta1/tx.rpc.msg"; +import * as _443 from "./staking/v1beta1/tx.rpc.msg"; +import * as _444 from "./upgrade/v1beta1/tx.rpc.msg"; +import * as _659 from "./rpc.query"; +import * as _660 from "./rpc.tx"; export namespace cosmos { export namespace auth { export const v1beta1 = { @@ -117,10 +117,10 @@ export namespace cosmos { ..._30, ..._31, ..._32, - ..._391, - ..._402, - ..._413, - ..._427 + ..._398, + ..._409, + ..._420, + ..._434 }; } export namespace authz { @@ -130,10 +130,10 @@ export namespace cosmos { ..._35, ..._36, ..._37, - ..._392, - ..._403, - ..._414, - ..._428 + ..._399, + ..._410, + ..._421, + ..._435 }; } export namespace bank { @@ -143,10 +143,10 @@ export namespace cosmos { ..._40, ..._41, ..._42, - ..._393, - ..._404, - ..._415, - ..._429 + ..._400, + ..._411, + ..._422, + ..._436 }; } export namespace base { @@ -164,7 +164,7 @@ export namespace cosmos { export const v1beta1 = { ..._45, ..._46, - ..._416 + ..._423 }; } export const v1beta1 = { @@ -188,10 +188,10 @@ export namespace cosmos { ..._52, ..._53, ..._54, - ..._394, - ..._405, - ..._417, - ..._430 + ..._401, + ..._412, + ..._424, + ..._437 }; } export namespace feegrant { @@ -200,10 +200,10 @@ export namespace cosmos { ..._56, ..._57, ..._58, - ..._395, - ..._406, - ..._418, - ..._431 + ..._402, + ..._413, + ..._425, + ..._438 }; } export namespace gov { @@ -212,20 +212,20 @@ export namespace cosmos { ..._60, ..._61, ..._62, - ..._396, - ..._407, - ..._419, - ..._432 + ..._403, + ..._414, + ..._426, + ..._439 }; export const v1beta1 = { ..._63, ..._64, ..._65, ..._66, - ..._397, - ..._408, - ..._420, - ..._433 + ..._404, + ..._415, + ..._427, + ..._440 }; } export namespace ics23 { @@ -239,10 +239,10 @@ export namespace cosmos { ..._69, ..._70, ..._71, - ..._398, - ..._409, - ..._421, - ..._434 + ..._405, + ..._416, + ..._428, + ..._441 }; } export namespace msg { @@ -259,7 +259,7 @@ export namespace cosmos { export const v1beta1 = { ..._74, ..._75, - ..._422 + ..._429 }; } export namespace query { @@ -273,10 +273,10 @@ export namespace cosmos { ..._78, ..._79, ..._80, - ..._399, - ..._410, - ..._423, - ..._435 + ..._406, + ..._417, + ..._430, + ..._442 }; } export namespace staking { @@ -286,10 +286,10 @@ export namespace cosmos { ..._83, ..._84, ..._85, - ..._400, - ..._411, - ..._424, - ..._436 + ..._407, + ..._418, + ..._431, + ..._443 }; } export namespace tx { @@ -301,7 +301,7 @@ export namespace cosmos { export const v1beta1 = { ..._87, ..._88, - ..._425 + ..._432 }; } export namespace upgrade { @@ -309,14 +309,14 @@ export namespace cosmos { ..._89, ..._90, ..._91, - ..._401, - ..._412, - ..._426, - ..._437 + ..._408, + ..._419, + ..._433, + ..._444 }; } export const ClientFactory = { - ..._648, - ..._649 + ..._659, + ..._660 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/cosmwasm/bundle.ts b/packages/types/protobuf/codegen/cosmwasm/bundle.ts index b81ec94cc..267c53825 100644 --- a/packages/types/protobuf/codegen/cosmwasm/bundle.ts +++ b/packages/types/protobuf/codegen/cosmwasm/bundle.ts @@ -10,16 +10,16 @@ import * as _100 from "./wasm/v1/proposal"; import * as _101 from "./wasm/v1/query"; import * as _102 from "./wasm/v1/tx"; import * as _103 from "./wasm/v1/types"; -import * as _438 from "./tokenfactory/v1beta1/tx.amino"; -import * as _439 from "./wasm/v1/tx.amino"; -import * as _440 from "./tokenfactory/v1beta1/tx.registry"; -import * as _441 from "./wasm/v1/tx.registry"; -import * as _442 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _443 from "./wasm/v1/query.rpc.Query"; -import * as _444 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _445 from "./wasm/v1/tx.rpc.msg"; -import * as _650 from "./rpc.query"; -import * as _651 from "./rpc.tx"; +import * as _445 from "./tokenfactory/v1beta1/tx.amino"; +import * as _446 from "./wasm/v1/tx.amino"; +import * as _447 from "./tokenfactory/v1beta1/tx.registry"; +import * as _448 from "./wasm/v1/tx.registry"; +import * as _449 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _450 from "./wasm/v1/query.rpc.Query"; +import * as _451 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _452 from "./wasm/v1/tx.rpc.msg"; +import * as _661 from "./rpc.query"; +import * as _662 from "./rpc.tx"; export namespace cosmwasm { export namespace tokenfactory { export const v1beta1 = { @@ -28,10 +28,10 @@ export namespace cosmwasm { ..._94, ..._95, ..._96, - ..._438, - ..._440, - ..._442, - ..._444 + ..._445, + ..._447, + ..._449, + ..._451 }; } export namespace wasm { @@ -43,14 +43,14 @@ export namespace cosmwasm { ..._101, ..._102, ..._103, - ..._439, - ..._441, - ..._443, - ..._445 + ..._446, + ..._448, + ..._450, + ..._452 }; } export const ClientFactory = { - ..._650, - ..._651 + ..._661, + ..._662 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/feemarket/bundle.ts b/packages/types/protobuf/codegen/feemarket/bundle.ts index 27f308d9b..5e6a11adf 100644 --- a/packages/types/protobuf/codegen/feemarket/bundle.ts +++ b/packages/types/protobuf/codegen/feemarket/bundle.ts @@ -2,12 +2,12 @@ import * as _104 from "./feemarket/v1/genesis"; import * as _105 from "./feemarket/v1/params"; import * as _106 from "./feemarket/v1/query"; import * as _107 from "./feemarket/v1/tx"; -import * as _446 from "./feemarket/v1/tx.amino"; -import * as _447 from "./feemarket/v1/tx.registry"; -import * as _448 from "./feemarket/v1/query.rpc.Query"; -import * as _449 from "./feemarket/v1/tx.rpc.msg"; -import * as _652 from "./rpc.query"; -import * as _653 from "./rpc.tx"; +import * as _453 from "./feemarket/v1/tx.amino"; +import * as _454 from "./feemarket/v1/tx.registry"; +import * as _455 from "./feemarket/v1/query.rpc.Query"; +import * as _456 from "./feemarket/v1/tx.rpc.msg"; +import * as _663 from "./rpc.query"; +import * as _664 from "./rpc.tx"; export namespace feemarket { export namespace feemarket { export const v1 = { @@ -15,14 +15,14 @@ export namespace feemarket { ..._105, ..._106, ..._107, - ..._446, - ..._447, - ..._448, - ..._449 + ..._453, + ..._454, + ..._455, + ..._456 }; } export const ClientFactory = { - ..._652, - ..._653 + ..._663, + ..._664 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/gaia/bundle.ts b/packages/types/protobuf/codegen/gaia/bundle.ts index c0619f548..e9f622ed0 100644 --- a/packages/types/protobuf/codegen/gaia/bundle.ts +++ b/packages/types/protobuf/codegen/gaia/bundle.ts @@ -1,26 +1,26 @@ import * as _108 from "./globalfee/v1beta1/genesis"; import * as _109 from "./globalfee/v1beta1/query"; import * as _110 from "./globalfee/v1beta1/tx"; -import * as _450 from "./globalfee/v1beta1/tx.amino"; -import * as _451 from "./globalfee/v1beta1/tx.registry"; -import * as _452 from "./globalfee/v1beta1/query.rpc.Query"; -import * as _453 from "./globalfee/v1beta1/tx.rpc.msg"; -import * as _654 from "./rpc.query"; -import * as _655 from "./rpc.tx"; +import * as _457 from "./globalfee/v1beta1/tx.amino"; +import * as _458 from "./globalfee/v1beta1/tx.registry"; +import * as _459 from "./globalfee/v1beta1/query.rpc.Query"; +import * as _460 from "./globalfee/v1beta1/tx.rpc.msg"; +import * as _665 from "./rpc.query"; +import * as _666 from "./rpc.tx"; export namespace gaia { export namespace globalfee { export const v1beta1 = { ..._108, ..._109, ..._110, - ..._450, - ..._451, - ..._452, - ..._453 + ..._457, + ..._458, + ..._459, + ..._460 }; } export const ClientFactory = { - ..._654, - ..._655 + ..._665, + ..._666 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/bundle.ts b/packages/types/protobuf/codegen/ibc/bundle.ts index 69b8d6ac7..fa31861fc 100644 --- a/packages/types/protobuf/codegen/ibc/bundle.ts +++ b/packages/types/protobuf/codegen/ibc/bundle.ts @@ -25,32 +25,33 @@ import * as _142 from "./core/connection/v1/connection"; import * as _143 from "./core/connection/v1/genesis"; import * as _144 from "./core/connection/v1/query"; import * as _145 from "./core/connection/v1/tx"; -import * as _454 from "./applications/interchain_accounts/controller/v1/tx.amino"; -import * as _455 from "./applications/interchain_accounts/host/v1/tx.amino"; -import * as _456 from "./applications/transfer/v1/tx.amino"; -import * as _457 from "./core/channel/v1/tx.amino"; -import * as _458 from "./core/client/v1/tx.amino"; -import * as _459 from "./core/connection/v1/tx.amino"; -import * as _460 from "./applications/interchain_accounts/controller/v1/tx.registry"; -import * as _461 from "./applications/interchain_accounts/host/v1/tx.registry"; -import * as _462 from "./applications/transfer/v1/tx.registry"; -import * as _463 from "./core/channel/v1/tx.registry"; -import * as _464 from "./core/client/v1/tx.registry"; -import * as _465 from "./core/connection/v1/tx.registry"; -import * as _466 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; -import * as _467 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; -import * as _468 from "./applications/transfer/v1/query.rpc.Query"; -import * as _469 from "./core/channel/v1/query.rpc.Query"; -import * as _470 from "./core/client/v1/query.rpc.Query"; -import * as _471 from "./core/connection/v1/query.rpc.Query"; -import * as _472 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; -import * as _473 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; -import * as _474 from "./applications/transfer/v1/tx.rpc.msg"; -import * as _475 from "./core/channel/v1/tx.rpc.msg"; -import * as _476 from "./core/client/v1/tx.rpc.msg"; -import * as _477 from "./core/connection/v1/tx.rpc.msg"; -import * as _656 from "./rpc.query"; -import * as _657 from "./rpc.tx"; +import * as _146 from "./lightclients/tendermint/v1/tendermint"; +import * as _461 from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as _462 from "./applications/interchain_accounts/host/v1/tx.amino"; +import * as _463 from "./applications/transfer/v1/tx.amino"; +import * as _464 from "./core/channel/v1/tx.amino"; +import * as _465 from "./core/client/v1/tx.amino"; +import * as _466 from "./core/connection/v1/tx.amino"; +import * as _467 from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as _468 from "./applications/interchain_accounts/host/v1/tx.registry"; +import * as _469 from "./applications/transfer/v1/tx.registry"; +import * as _470 from "./core/channel/v1/tx.registry"; +import * as _471 from "./core/client/v1/tx.registry"; +import * as _472 from "./core/connection/v1/tx.registry"; +import * as _473 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; +import * as _474 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; +import * as _475 from "./applications/transfer/v1/query.rpc.Query"; +import * as _476 from "./core/channel/v1/query.rpc.Query"; +import * as _477 from "./core/client/v1/query.rpc.Query"; +import * as _478 from "./core/connection/v1/query.rpc.Query"; +import * as _479 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; +import * as _480 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; +import * as _481 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _482 from "./core/channel/v1/tx.rpc.msg"; +import * as _483 from "./core/client/v1/tx.rpc.msg"; +import * as _484 from "./core/connection/v1/tx.rpc.msg"; +import * as _667 from "./rpc.query"; +import * as _668 from "./rpc.tx"; export namespace ibc { export namespace applications { export namespace interchain_accounts { @@ -59,10 +60,10 @@ export namespace ibc { ..._119, ..._120, ..._121, - ..._454, - ..._460, - ..._466, - ..._472 + ..._461, + ..._467, + ..._473, + ..._479 }; } export namespace host { @@ -70,10 +71,10 @@ export namespace ibc { ..._122, ..._123, ..._124, - ..._455, - ..._461, - ..._467, - ..._473 + ..._462, + ..._468, + ..._474, + ..._480 }; } export const v1 = { @@ -89,10 +90,10 @@ export namespace ibc { ..._130, ..._131, ..._132, - ..._456, - ..._462, - ..._468, - ..._474 + ..._463, + ..._469, + ..._475, + ..._481 }; } } @@ -103,10 +104,10 @@ export namespace ibc { ..._134, ..._135, ..._136, - ..._457, - ..._463, - ..._469, - ..._475 + ..._464, + ..._470, + ..._476, + ..._482 }; } export namespace client { @@ -115,10 +116,10 @@ export namespace ibc { ..._138, ..._139, ..._140, - ..._458, - ..._464, - ..._470, - ..._476 + ..._465, + ..._471, + ..._477, + ..._483 }; } export namespace commitment { @@ -132,15 +133,22 @@ export namespace ibc { ..._143, ..._144, ..._145, - ..._459, - ..._465, - ..._471, - ..._477 + ..._466, + ..._472, + ..._478, + ..._484 + }; + } + } + export namespace lightclients { + export namespace tendermint { + export const v1 = { + ..._146 }; } } export const ClientFactory = { - ..._656, - ..._657 + ..._667, + ..._668 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/ibc/lightclients/tendermint/v1/tendermint.ts b/packages/types/protobuf/codegen/ibc/lightclients/tendermint/v1/tendermint.ts new file mode 100644 index 000000000..65a63bce8 --- /dev/null +++ b/packages/types/protobuf/codegen/ibc/lightclients/tendermint/v1/tendermint.ts @@ -0,0 +1,855 @@ +import { Duration, DurationAmino, DurationSDKType } from "../../../../google/protobuf/duration"; +import { Height, HeightAmino, HeightSDKType } from "../../../core/client/v1/client"; +import { ProofSpec, ProofSpecAmino, ProofSpecSDKType } from "../../../../cosmos/ics23/v1/proofs"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; +import { MerkleRoot, MerkleRootAmino, MerkleRootSDKType } from "../../../core/commitment/v1/commitment"; +import { SignedHeader, SignedHeaderAmino, SignedHeaderSDKType } from "../../../../tendermint/types/types"; +import { ValidatorSet, ValidatorSetAmino, ValidatorSetSDKType } from "../../../../tendermint/types/validator"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * ClientState from Tendermint tracks the current validator set, latest height, + * and a possible frozen height. + */ +export interface ClientState { + chainId: string; + trustLevel: Fraction | undefined; + /** + * duration of the period since the LastestTimestamp during which the + * submitted headers are valid for upgrade + */ + trustingPeriod: Duration | undefined; + /** duration of the staking unbonding period */ + unbondingPeriod: Duration | undefined; + /** defines how much new (untrusted) header's Time can drift into the future. */ + maxClockDrift: Duration | undefined; + /** Block height when the client was frozen due to a misbehaviour */ + frozenHeight: Height | undefined; + /** Latest height the client was updated to */ + latestHeight: Height | undefined; + /** Proof specifications used in verifying counterparty state */ + proofSpecs: ProofSpec[]; + /** + * Path at which next upgraded client will be committed. + * Each element corresponds to the key for a single CommitmentProof in the + * chained proof. NOTE: ClientState must stored under + * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored + * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using + * the default upgrade module, upgrade_path should be []string{"upgrade", + * "upgradedIBCState"}` + */ + upgradePath: string[]; + /** allow_update_after_expiry is deprecated */ + /** @deprecated */ + allowUpdateAfterExpiry: boolean; + /** allow_update_after_misbehaviour is deprecated */ + /** @deprecated */ + allowUpdateAfterMisbehaviour: boolean; +} +export interface ClientStateProtoMsg { + typeUrl: "/ibc.lightclients.tendermint.v1.ClientState"; + value: Uint8Array; +} +/** + * ClientState from Tendermint tracks the current validator set, latest height, + * and a possible frozen height. + */ +export interface ClientStateAmino { + chain_id?: string; + trust_level?: FractionAmino | undefined; + /** + * duration of the period since the LastestTimestamp during which the + * submitted headers are valid for upgrade + */ + trusting_period?: DurationAmino | undefined; + /** duration of the staking unbonding period */ + unbonding_period?: DurationAmino | undefined; + /** defines how much new (untrusted) header's Time can drift into the future. */ + max_clock_drift?: DurationAmino | undefined; + /** Block height when the client was frozen due to a misbehaviour */ + frozen_height?: HeightAmino | undefined; + /** Latest height the client was updated to */ + latest_height?: HeightAmino | undefined; + /** Proof specifications used in verifying counterparty state */ + proof_specs?: ProofSpecAmino[]; + /** + * Path at which next upgraded client will be committed. + * Each element corresponds to the key for a single CommitmentProof in the + * chained proof. NOTE: ClientState must stored under + * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored + * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using + * the default upgrade module, upgrade_path should be []string{"upgrade", + * "upgradedIBCState"}` + */ + upgrade_path?: string[]; + /** allow_update_after_expiry is deprecated */ + /** @deprecated */ + allow_update_after_expiry?: boolean; + /** allow_update_after_misbehaviour is deprecated */ + /** @deprecated */ + allow_update_after_misbehaviour?: boolean; +} +export interface ClientStateAminoMsg { + type: "cosmos-sdk/ClientState"; + value: ClientStateAmino; +} +/** + * ClientState from Tendermint tracks the current validator set, latest height, + * and a possible frozen height. + */ +export interface ClientStateSDKType { + chain_id: string; + trust_level: FractionSDKType | undefined; + trusting_period: DurationSDKType | undefined; + unbonding_period: DurationSDKType | undefined; + max_clock_drift: DurationSDKType | undefined; + frozen_height: HeightSDKType | undefined; + latest_height: HeightSDKType | undefined; + proof_specs: ProofSpecSDKType[]; + upgrade_path: string[]; + /** @deprecated */ + allow_update_after_expiry: boolean; + /** @deprecated */ + allow_update_after_misbehaviour: boolean; +} +/** ConsensusState defines the consensus state from Tendermint. */ +export interface ConsensusState { + /** + * timestamp that corresponds to the block height in which the ConsensusState + * was stored. + */ + timestamp: Date | undefined; + /** commitment root (i.e app hash) */ + root: MerkleRoot | undefined; + nextValidatorsHash: Uint8Array; +} +export interface ConsensusStateProtoMsg { + typeUrl: "/ibc.lightclients.tendermint.v1.ConsensusState"; + value: Uint8Array; +} +/** ConsensusState defines the consensus state from Tendermint. */ +export interface ConsensusStateAmino { + /** + * timestamp that corresponds to the block height in which the ConsensusState + * was stored. + */ + timestamp?: string | undefined; + /** commitment root (i.e app hash) */ + root?: MerkleRootAmino | undefined; + next_validators_hash?: string; +} +export interface ConsensusStateAminoMsg { + type: "cosmos-sdk/ConsensusState"; + value: ConsensusStateAmino; +} +/** ConsensusState defines the consensus state from Tendermint. */ +export interface ConsensusStateSDKType { + timestamp: Date | undefined; + root: MerkleRootSDKType | undefined; + next_validators_hash: Uint8Array; +} +/** + * Misbehaviour is a wrapper over two conflicting Headers + * that implements Misbehaviour interface expected by ICS-02 + */ +export interface Misbehaviour { + /** ClientID is deprecated */ + /** @deprecated */ + clientId: string; + header1?: Header | undefined; + header2?: Header | undefined; +} +export interface MisbehaviourProtoMsg { + typeUrl: "/ibc.lightclients.tendermint.v1.Misbehaviour"; + value: Uint8Array; +} +/** + * Misbehaviour is a wrapper over two conflicting Headers + * that implements Misbehaviour interface expected by ICS-02 + */ +export interface MisbehaviourAmino { + /** ClientID is deprecated */ + /** @deprecated */ + client_id?: string; + header_1?: HeaderAmino | undefined; + header_2?: HeaderAmino | undefined; +} +export interface MisbehaviourAminoMsg { + type: "cosmos-sdk/Misbehaviour"; + value: MisbehaviourAmino; +} +/** + * Misbehaviour is a wrapper over two conflicting Headers + * that implements Misbehaviour interface expected by ICS-02 + */ +export interface MisbehaviourSDKType { + /** @deprecated */ + client_id: string; + header_1?: HeaderSDKType | undefined; + header_2?: HeaderSDKType | undefined; +} +/** + * Header defines the Tendermint client consensus Header. + * It encapsulates all the information necessary to update from a trusted + * Tendermint ConsensusState. The inclusion of TrustedHeight and + * TrustedValidators allows this update to process correctly, so long as the + * ConsensusState for the TrustedHeight exists, this removes race conditions + * among relayers The SignedHeader and ValidatorSet are the new untrusted update + * fields for the client. The TrustedHeight is the height of a stored + * ConsensusState on the client that will be used to verify the new untrusted + * header. The Trusted ConsensusState must be within the unbonding period of + * current time in order to correctly verify, and the TrustedValidators must + * hash to TrustedConsensusState.NextValidatorsHash since that is the last + * trusted validator set at the TrustedHeight. + */ +export interface Header { + signedHeader?: SignedHeader | undefined; + validatorSet?: ValidatorSet | undefined; + trustedHeight: Height | undefined; + trustedValidators?: ValidatorSet | undefined; +} +export interface HeaderProtoMsg { + typeUrl: "/ibc.lightclients.tendermint.v1.Header"; + value: Uint8Array; +} +/** + * Header defines the Tendermint client consensus Header. + * It encapsulates all the information necessary to update from a trusted + * Tendermint ConsensusState. The inclusion of TrustedHeight and + * TrustedValidators allows this update to process correctly, so long as the + * ConsensusState for the TrustedHeight exists, this removes race conditions + * among relayers The SignedHeader and ValidatorSet are the new untrusted update + * fields for the client. The TrustedHeight is the height of a stored + * ConsensusState on the client that will be used to verify the new untrusted + * header. The Trusted ConsensusState must be within the unbonding period of + * current time in order to correctly verify, and the TrustedValidators must + * hash to TrustedConsensusState.NextValidatorsHash since that is the last + * trusted validator set at the TrustedHeight. + */ +export interface HeaderAmino { + signed_header?: SignedHeaderAmino | undefined; + validator_set?: ValidatorSetAmino | undefined; + trusted_height?: HeightAmino | undefined; + trusted_validators?: ValidatorSetAmino | undefined; +} +export interface HeaderAminoMsg { + type: "cosmos-sdk/Header"; + value: HeaderAmino; +} +/** + * Header defines the Tendermint client consensus Header. + * It encapsulates all the information necessary to update from a trusted + * Tendermint ConsensusState. The inclusion of TrustedHeight and + * TrustedValidators allows this update to process correctly, so long as the + * ConsensusState for the TrustedHeight exists, this removes race conditions + * among relayers The SignedHeader and ValidatorSet are the new untrusted update + * fields for the client. The TrustedHeight is the height of a stored + * ConsensusState on the client that will be used to verify the new untrusted + * header. The Trusted ConsensusState must be within the unbonding period of + * current time in order to correctly verify, and the TrustedValidators must + * hash to TrustedConsensusState.NextValidatorsHash since that is the last + * trusted validator set at the TrustedHeight. + */ +export interface HeaderSDKType { + signed_header?: SignedHeaderSDKType | undefined; + validator_set?: ValidatorSetSDKType | undefined; + trusted_height: HeightSDKType | undefined; + trusted_validators?: ValidatorSetSDKType | undefined; +} +/** + * Fraction defines the protobuf message type for tmmath.Fraction that only + * supports positive values. + */ +export interface Fraction { + numerator: bigint; + denominator: bigint; +} +export interface FractionProtoMsg { + typeUrl: "/ibc.lightclients.tendermint.v1.Fraction"; + value: Uint8Array; +} +/** + * Fraction defines the protobuf message type for tmmath.Fraction that only + * supports positive values. + */ +export interface FractionAmino { + numerator?: string; + denominator?: string; +} +export interface FractionAminoMsg { + type: "cosmos-sdk/Fraction"; + value: FractionAmino; +} +/** + * Fraction defines the protobuf message type for tmmath.Fraction that only + * supports positive values. + */ +export interface FractionSDKType { + numerator: bigint; + denominator: bigint; +} +function createBaseClientState(): ClientState { + return { + chainId: "", + trustLevel: Fraction.fromPartial({}), + trustingPeriod: Duration.fromPartial({}), + unbondingPeriod: Duration.fromPartial({}), + maxClockDrift: Duration.fromPartial({}), + frozenHeight: Height.fromPartial({}), + latestHeight: Height.fromPartial({}), + proofSpecs: [], + upgradePath: [], + allowUpdateAfterExpiry: false, + allowUpdateAfterMisbehaviour: false + }; +} +export const ClientState = { + typeUrl: "/ibc.lightclients.tendermint.v1.ClientState", + encode(message: ClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + if (message.trustLevel !== undefined) { + Fraction.encode(message.trustLevel, writer.uint32(18).fork()).ldelim(); + } + if (message.trustingPeriod !== undefined) { + Duration.encode(message.trustingPeriod, writer.uint32(26).fork()).ldelim(); + } + if (message.unbondingPeriod !== undefined) { + Duration.encode(message.unbondingPeriod, writer.uint32(34).fork()).ldelim(); + } + if (message.maxClockDrift !== undefined) { + Duration.encode(message.maxClockDrift, writer.uint32(42).fork()).ldelim(); + } + if (message.frozenHeight !== undefined) { + Height.encode(message.frozenHeight, writer.uint32(50).fork()).ldelim(); + } + if (message.latestHeight !== undefined) { + Height.encode(message.latestHeight, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.proofSpecs) { + ProofSpec.encode(v!, writer.uint32(66).fork()).ldelim(); + } + for (const v of message.upgradePath) { + writer.uint32(74).string(v!); + } + if (message.allowUpdateAfterExpiry === true) { + writer.uint32(80).bool(message.allowUpdateAfterExpiry); + } + if (message.allowUpdateAfterMisbehaviour === true) { + writer.uint32(88).bool(message.allowUpdateAfterMisbehaviour); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ClientState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + case 2: + message.trustLevel = Fraction.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.trustingPeriod = Duration.decode(reader, reader.uint32(), useInterfaces); + break; + case 4: + message.unbondingPeriod = Duration.decode(reader, reader.uint32(), useInterfaces); + break; + case 5: + message.maxClockDrift = Duration.decode(reader, reader.uint32(), useInterfaces); + break; + case 6: + message.frozenHeight = Height.decode(reader, reader.uint32(), useInterfaces); + break; + case 7: + message.latestHeight = Height.decode(reader, reader.uint32(), useInterfaces); + break; + case 8: + message.proofSpecs.push(ProofSpec.decode(reader, reader.uint32(), useInterfaces)); + break; + case 9: + message.upgradePath.push(reader.string()); + break; + case 10: + message.allowUpdateAfterExpiry = reader.bool(); + break; + case 11: + message.allowUpdateAfterMisbehaviour = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClientState { + const message = createBaseClientState(); + message.chainId = object.chainId ?? ""; + message.trustLevel = object.trustLevel !== undefined && object.trustLevel !== null ? Fraction.fromPartial(object.trustLevel) : undefined; + message.trustingPeriod = object.trustingPeriod !== undefined && object.trustingPeriod !== null ? Duration.fromPartial(object.trustingPeriod) : undefined; + message.unbondingPeriod = object.unbondingPeriod !== undefined && object.unbondingPeriod !== null ? Duration.fromPartial(object.unbondingPeriod) : undefined; + message.maxClockDrift = object.maxClockDrift !== undefined && object.maxClockDrift !== null ? Duration.fromPartial(object.maxClockDrift) : undefined; + message.frozenHeight = object.frozenHeight !== undefined && object.frozenHeight !== null ? Height.fromPartial(object.frozenHeight) : undefined; + message.latestHeight = object.latestHeight !== undefined && object.latestHeight !== null ? Height.fromPartial(object.latestHeight) : undefined; + message.proofSpecs = object.proofSpecs?.map(e => ProofSpec.fromPartial(e)) || []; + message.upgradePath = object.upgradePath?.map(e => e) || []; + message.allowUpdateAfterExpiry = object.allowUpdateAfterExpiry ?? false; + message.allowUpdateAfterMisbehaviour = object.allowUpdateAfterMisbehaviour ?? false; + return message; + }, + fromAmino(object: ClientStateAmino): ClientState { + const message = createBaseClientState(); + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.trust_level !== undefined && object.trust_level !== null) { + message.trustLevel = Fraction.fromAmino(object.trust_level); + } + if (object.trusting_period !== undefined && object.trusting_period !== null) { + message.trustingPeriod = Duration.fromAmino(object.trusting_period); + } + if (object.unbonding_period !== undefined && object.unbonding_period !== null) { + message.unbondingPeriod = Duration.fromAmino(object.unbonding_period); + } + if (object.max_clock_drift !== undefined && object.max_clock_drift !== null) { + message.maxClockDrift = Duration.fromAmino(object.max_clock_drift); + } + if (object.frozen_height !== undefined && object.frozen_height !== null) { + message.frozenHeight = Height.fromAmino(object.frozen_height); + } + if (object.latest_height !== undefined && object.latest_height !== null) { + message.latestHeight = Height.fromAmino(object.latest_height); + } + message.proofSpecs = object.proof_specs?.map(e => ProofSpec.fromAmino(e)) || []; + message.upgradePath = object.upgrade_path?.map(e => e) || []; + if (object.allow_update_after_expiry !== undefined && object.allow_update_after_expiry !== null) { + message.allowUpdateAfterExpiry = object.allow_update_after_expiry; + } + if (object.allow_update_after_misbehaviour !== undefined && object.allow_update_after_misbehaviour !== null) { + message.allowUpdateAfterMisbehaviour = object.allow_update_after_misbehaviour; + } + return message; + }, + toAmino(message: ClientState, useInterfaces: boolean = false): ClientStateAmino { + const obj: any = {}; + obj.chain_id = message.chainId; + obj.trust_level = message.trustLevel ? Fraction.toAmino(message.trustLevel, useInterfaces) : undefined; + obj.trusting_period = message.trustingPeriod ? Duration.toAmino(message.trustingPeriod, useInterfaces) : undefined; + obj.unbonding_period = message.unbondingPeriod ? Duration.toAmino(message.unbondingPeriod, useInterfaces) : undefined; + obj.max_clock_drift = message.maxClockDrift ? Duration.toAmino(message.maxClockDrift, useInterfaces) : undefined; + obj.frozen_height = message.frozenHeight ? Height.toAmino(message.frozenHeight, useInterfaces) : {}; + obj.latest_height = message.latestHeight ? Height.toAmino(message.latestHeight, useInterfaces) : {}; + if (message.proofSpecs) { + obj.proof_specs = message.proofSpecs.map(e => e ? ProofSpec.toAmino(e, useInterfaces) : undefined); + } else { + obj.proof_specs = []; + } + if (message.upgradePath) { + obj.upgrade_path = message.upgradePath.map(e => e); + } else { + obj.upgrade_path = []; + } + obj.allow_update_after_expiry = message.allowUpdateAfterExpiry; + obj.allow_update_after_misbehaviour = message.allowUpdateAfterMisbehaviour; + return obj; + }, + fromAminoMsg(object: ClientStateAminoMsg): ClientState { + return ClientState.fromAmino(object.value); + }, + toAminoMsg(message: ClientState, useInterfaces: boolean = false): ClientStateAminoMsg { + return { + type: "cosmos-sdk/ClientState", + value: ClientState.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: ClientStateProtoMsg, useInterfaces: boolean = false): ClientState { + return ClientState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ClientState): Uint8Array { + return ClientState.encode(message).finish(); + }, + toProtoMsg(message: ClientState): ClientStateProtoMsg { + return { + typeUrl: "/ibc.lightclients.tendermint.v1.ClientState", + value: ClientState.encode(message).finish() + }; + } +}; +function createBaseConsensusState(): ConsensusState { + return { + timestamp: new Date(), + root: MerkleRoot.fromPartial({}), + nextValidatorsHash: new Uint8Array() + }; +} +export const ConsensusState = { + typeUrl: "/ibc.lightclients.tendermint.v1.ConsensusState", + encode(message: ConsensusState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(10).fork()).ldelim(); + } + if (message.root !== undefined) { + MerkleRoot.encode(message.root, writer.uint32(18).fork()).ldelim(); + } + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(26).bytes(message.nextValidatorsHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ConsensusState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 2: + message.root = MerkleRoot.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.nextValidatorsHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConsensusState { + const message = createBaseConsensusState(); + message.timestamp = object.timestamp ?? undefined; + message.root = object.root !== undefined && object.root !== null ? MerkleRoot.fromPartial(object.root) : undefined; + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: ConsensusStateAmino): ConsensusState { + const message = createBaseConsensusState(); + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.root !== undefined && object.root !== null) { + message.root = MerkleRoot.fromAmino(object.root); + } + if (object.next_validators_hash !== undefined && object.next_validators_hash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.next_validators_hash); + } + return message; + }, + toAmino(message: ConsensusState, useInterfaces: boolean = false): ConsensusStateAmino { + const obj: any = {}; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.root = message.root ? MerkleRoot.toAmino(message.root, useInterfaces) : undefined; + obj.next_validators_hash = message.nextValidatorsHash ? base64FromBytes(message.nextValidatorsHash) : undefined; + return obj; + }, + fromAminoMsg(object: ConsensusStateAminoMsg): ConsensusState { + return ConsensusState.fromAmino(object.value); + }, + toAminoMsg(message: ConsensusState, useInterfaces: boolean = false): ConsensusStateAminoMsg { + return { + type: "cosmos-sdk/ConsensusState", + value: ConsensusState.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: ConsensusStateProtoMsg, useInterfaces: boolean = false): ConsensusState { + return ConsensusState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ConsensusState): Uint8Array { + return ConsensusState.encode(message).finish(); + }, + toProtoMsg(message: ConsensusState): ConsensusStateProtoMsg { + return { + typeUrl: "/ibc.lightclients.tendermint.v1.ConsensusState", + value: ConsensusState.encode(message).finish() + }; + } +}; +function createBaseMisbehaviour(): Misbehaviour { + return { + clientId: "", + header1: undefined, + header2: undefined + }; +} +export const Misbehaviour = { + typeUrl: "/ibc.lightclients.tendermint.v1.Misbehaviour", + encode(message: Misbehaviour, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.header1 !== undefined) { + Header.encode(message.header1, writer.uint32(18).fork()).ldelim(); + } + if (message.header2 !== undefined) { + Header.encode(message.header2, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Misbehaviour { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMisbehaviour(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.header1 = Header.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.header2 = Header.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Misbehaviour { + const message = createBaseMisbehaviour(); + message.clientId = object.clientId ?? ""; + message.header1 = object.header1 !== undefined && object.header1 !== null ? Header.fromPartial(object.header1) : undefined; + message.header2 = object.header2 !== undefined && object.header2 !== null ? Header.fromPartial(object.header2) : undefined; + return message; + }, + fromAmino(object: MisbehaviourAmino): Misbehaviour { + const message = createBaseMisbehaviour(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.header_1 !== undefined && object.header_1 !== null) { + message.header1 = Header.fromAmino(object.header_1); + } + if (object.header_2 !== undefined && object.header_2 !== null) { + message.header2 = Header.fromAmino(object.header_2); + } + return message; + }, + toAmino(message: Misbehaviour, useInterfaces: boolean = false): MisbehaviourAmino { + const obj: any = {}; + obj.client_id = message.clientId; + obj.header_1 = message.header1 ? Header.toAmino(message.header1, useInterfaces) : undefined; + obj.header_2 = message.header2 ? Header.toAmino(message.header2, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MisbehaviourAminoMsg): Misbehaviour { + return Misbehaviour.fromAmino(object.value); + }, + toAminoMsg(message: Misbehaviour, useInterfaces: boolean = false): MisbehaviourAminoMsg { + return { + type: "cosmos-sdk/Misbehaviour", + value: Misbehaviour.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: MisbehaviourProtoMsg, useInterfaces: boolean = false): Misbehaviour { + return Misbehaviour.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Misbehaviour): Uint8Array { + return Misbehaviour.encode(message).finish(); + }, + toProtoMsg(message: Misbehaviour): MisbehaviourProtoMsg { + return { + typeUrl: "/ibc.lightclients.tendermint.v1.Misbehaviour", + value: Misbehaviour.encode(message).finish() + }; + } +}; +function createBaseHeader(): Header { + return { + signedHeader: undefined, + validatorSet: undefined, + trustedHeight: Height.fromPartial({}), + trustedValidators: undefined + }; +} +export const Header = { + typeUrl: "/ibc.lightclients.tendermint.v1.Header", + encode(message: Header, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signedHeader !== undefined) { + SignedHeader.encode(message.signedHeader, writer.uint32(10).fork()).ldelim(); + } + if (message.validatorSet !== undefined) { + ValidatorSet.encode(message.validatorSet, writer.uint32(18).fork()).ldelim(); + } + if (message.trustedHeight !== undefined) { + Height.encode(message.trustedHeight, writer.uint32(26).fork()).ldelim(); + } + if (message.trustedValidators !== undefined) { + ValidatorSet.encode(message.trustedValidators, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Header { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeader(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signedHeader = SignedHeader.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.validatorSet = ValidatorSet.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.trustedHeight = Height.decode(reader, reader.uint32(), useInterfaces); + break; + case 4: + message.trustedValidators = ValidatorSet.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial

): Header { + const message = createBaseHeader(); + message.signedHeader = object.signedHeader !== undefined && object.signedHeader !== null ? SignedHeader.fromPartial(object.signedHeader) : undefined; + message.validatorSet = object.validatorSet !== undefined && object.validatorSet !== null ? ValidatorSet.fromPartial(object.validatorSet) : undefined; + message.trustedHeight = object.trustedHeight !== undefined && object.trustedHeight !== null ? Height.fromPartial(object.trustedHeight) : undefined; + message.trustedValidators = object.trustedValidators !== undefined && object.trustedValidators !== null ? ValidatorSet.fromPartial(object.trustedValidators) : undefined; + return message; + }, + fromAmino(object: HeaderAmino): Header { + const message = createBaseHeader(); + if (object.signed_header !== undefined && object.signed_header !== null) { + message.signedHeader = SignedHeader.fromAmino(object.signed_header); + } + if (object.validator_set !== undefined && object.validator_set !== null) { + message.validatorSet = ValidatorSet.fromAmino(object.validator_set); + } + if (object.trusted_height !== undefined && object.trusted_height !== null) { + message.trustedHeight = Height.fromAmino(object.trusted_height); + } + if (object.trusted_validators !== undefined && object.trusted_validators !== null) { + message.trustedValidators = ValidatorSet.fromAmino(object.trusted_validators); + } + return message; + }, + toAmino(message: Header, useInterfaces: boolean = false): HeaderAmino { + const obj: any = {}; + obj.signed_header = message.signedHeader ? SignedHeader.toAmino(message.signedHeader, useInterfaces) : undefined; + obj.validator_set = message.validatorSet ? ValidatorSet.toAmino(message.validatorSet, useInterfaces) : undefined; + obj.trusted_height = message.trustedHeight ? Height.toAmino(message.trustedHeight, useInterfaces) : {}; + obj.trusted_validators = message.trustedValidators ? ValidatorSet.toAmino(message.trustedValidators, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: HeaderAminoMsg): Header { + return Header.fromAmino(object.value); + }, + toAminoMsg(message: Header, useInterfaces: boolean = false): HeaderAminoMsg { + return { + type: "cosmos-sdk/Header", + value: Header.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: HeaderProtoMsg, useInterfaces: boolean = false): Header { + return Header.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Header): Uint8Array { + return Header.encode(message).finish(); + }, + toProtoMsg(message: Header): HeaderProtoMsg { + return { + typeUrl: "/ibc.lightclients.tendermint.v1.Header", + value: Header.encode(message).finish() + }; + } +}; +function createBaseFraction(): Fraction { + return { + numerator: BigInt(0), + denominator: BigInt(0) + }; +} +export const Fraction = { + typeUrl: "/ibc.lightclients.tendermint.v1.Fraction", + encode(message: Fraction, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.numerator !== BigInt(0)) { + writer.uint32(8).uint64(message.numerator); + } + if (message.denominator !== BigInt(0)) { + writer.uint32(16).uint64(message.denominator); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): Fraction { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFraction(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.numerator = reader.uint64(); + break; + case 2: + message.denominator = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Fraction { + const message = createBaseFraction(); + message.numerator = object.numerator !== undefined && object.numerator !== null ? BigInt(object.numerator.toString()) : BigInt(0); + message.denominator = object.denominator !== undefined && object.denominator !== null ? BigInt(object.denominator.toString()) : BigInt(0); + return message; + }, + fromAmino(object: FractionAmino): Fraction { + const message = createBaseFraction(); + if (object.numerator !== undefined && object.numerator !== null) { + message.numerator = BigInt(object.numerator); + } + if (object.denominator !== undefined && object.denominator !== null) { + message.denominator = BigInt(object.denominator); + } + return message; + }, + toAmino(message: Fraction, useInterfaces: boolean = false): FractionAmino { + const obj: any = {}; + obj.numerator = message.numerator ? message.numerator.toString() : undefined; + obj.denominator = message.denominator ? message.denominator.toString() : undefined; + return obj; + }, + fromAminoMsg(object: FractionAminoMsg): Fraction { + return Fraction.fromAmino(object.value); + }, + toAminoMsg(message: Fraction, useInterfaces: boolean = false): FractionAminoMsg { + return { + type: "cosmos-sdk/Fraction", + value: Fraction.toAmino(message, useInterfaces) + }; + }, + fromProtoMsg(message: FractionProtoMsg, useInterfaces: boolean = false): Fraction { + return Fraction.decode(message.value, undefined, useInterfaces); + }, + toProto(message: Fraction): Uint8Array { + return Fraction.encode(message).finish(); + }, + toProtoMsg(message: Fraction): FractionProtoMsg { + return { + typeUrl: "/ibc.lightclients.tendermint.v1.Fraction", + value: Fraction.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/index.ts b/packages/types/protobuf/codegen/index.ts index 34823bc2d..2f6f96997 100644 --- a/packages/types/protobuf/codegen/index.ts +++ b/packages/types/protobuf/codegen/index.ts @@ -24,6 +24,8 @@ export * from "./gogoproto/bundle"; export * from "./google/bundle"; export * from "./ibc/bundle"; export * from "./ibc/client"; +export * from "./interchain_security/bundle"; +export * from "./interchain_security/client"; export * from "./juno/bundle"; export * from "./juno/client"; export * from "./kujira/bundle"; diff --git a/packages/types/protobuf/codegen/interchain_security/bundle.ts b/packages/types/protobuf/codegen/interchain_security/bundle.ts new file mode 100644 index 000000000..a75156f08 --- /dev/null +++ b/packages/types/protobuf/codegen/interchain_security/bundle.ts @@ -0,0 +1,36 @@ +import * as _147 from "./ccv/consumer/v1/consumer"; +import * as _148 from "./ccv/consumer/v1/genesis"; +import * as _149 from "./ccv/consumer/v1/query"; +import * as _150 from "./ccv/consumer/v1/tx"; +import * as _151 from "./ccv/v1/shared_consumer"; +import * as _152 from "./ccv/v1/wire"; +import * as _485 from "./ccv/consumer/v1/tx.amino"; +import * as _486 from "./ccv/consumer/v1/tx.registry"; +import * as _487 from "./ccv/consumer/v1/query.rpc.Query"; +import * as _488 from "./ccv/consumer/v1/tx.rpc.msg"; +import * as _669 from "./rpc.query"; +import * as _670 from "./rpc.tx"; +export namespace interchain_security { + export namespace ccv { + export namespace consumer { + export const v1 = { + ..._147, + ..._148, + ..._149, + ..._150, + ..._485, + ..._486, + ..._487, + ..._488 + }; + } + export const v1 = { + ..._151, + ..._152 + }; + } + export const ClientFactory = { + ..._669, + ..._670 + }; +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/consumer.ts b/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/consumer.ts new file mode 100644 index 000000000..67c2d3ab6 --- /dev/null +++ b/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/consumer.ts @@ -0,0 +1,298 @@ +import { Any, AnyProtoMsg, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes, toTimestamp, fromTimestamp } from "../../../../helpers"; +import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing"; +import { Pubkey } from "@cosmjs/amino"; +/** + * CrossChainValidator defines the type used to store validator information + * internal to the consumer CCV module. Note one cross chain validator entry is + * persisted for each consumer validator, where incoming VSC packets update this + * data, which is eventually forwarded to comet for consumer chain consensus. + * + * Note this type is only used internally to the consumer CCV module. + */ +export interface CrossChainValidator { + address: Uint8Array; + power: bigint; + /** pubkey is the consensus public key of the validator, as a Protobuf Any. */ + pubkey?: (Any) | undefined; + /** + * !!! DEPRECATED !!! opted_out is deprecated because after the introduction of Partial Set Security (PSS) + * we removed the soft opt-out feature. + */ + /** @deprecated */ + optedOut: boolean; +} +export interface CrossChainValidatorProtoMsg { + typeUrl: "/interchain_security.ccv.consumer.v1.CrossChainValidator"; + value: Uint8Array; +} +export type CrossChainValidatorEncoded = Omit & { + /** pubkey is the consensus public key of the validator, as a Protobuf Any. */pubkey?: AnyProtoMsg | undefined; +}; +/** + * CrossChainValidator defines the type used to store validator information + * internal to the consumer CCV module. Note one cross chain validator entry is + * persisted for each consumer validator, where incoming VSC packets update this + * data, which is eventually forwarded to comet for consumer chain consensus. + * + * Note this type is only used internally to the consumer CCV module. + */ +export interface CrossChainValidatorAmino { + address?: string; + power?: string; + /** pubkey is the consensus public key of the validator, as a Protobuf Any. */ + pubkey?: AnyAmino | undefined; + /** + * !!! DEPRECATED !!! opted_out is deprecated because after the introduction of Partial Set Security (PSS) + * we removed the soft opt-out feature. + */ + /** @deprecated */ + opted_out?: boolean; +} +export interface CrossChainValidatorAminoMsg { + type: "/interchain_security.ccv.consumer.v1.CrossChainValidator"; + value: CrossChainValidatorAmino; +} +/** + * CrossChainValidator defines the type used to store validator information + * internal to the consumer CCV module. Note one cross chain validator entry is + * persisted for each consumer validator, where incoming VSC packets update this + * data, which is eventually forwarded to comet for consumer chain consensus. + * + * Note this type is only used internally to the consumer CCV module. + */ +export interface CrossChainValidatorSDKType { + address: Uint8Array; + power: bigint; + pubkey?: AnySDKType | undefined; + /** @deprecated */ + opted_out: boolean; +} +/** + * A record storing the state of a slash packet sent to the provider chain + * which may bounce back and forth until handled by the provider. + * + * Note this type is only used internally to the consumer CCV module. + */ +export interface SlashRecord { + waitingOnReply: boolean; + sendTime: Date | undefined; +} +export interface SlashRecordProtoMsg { + typeUrl: "/interchain_security.ccv.consumer.v1.SlashRecord"; + value: Uint8Array; +} +/** + * A record storing the state of a slash packet sent to the provider chain + * which may bounce back and forth until handled by the provider. + * + * Note this type is only used internally to the consumer CCV module. + */ +export interface SlashRecordAmino { + waiting_on_reply?: boolean; + send_time?: string | undefined; +} +export interface SlashRecordAminoMsg { + type: "/interchain_security.ccv.consumer.v1.SlashRecord"; + value: SlashRecordAmino; +} +/** + * A record storing the state of a slash packet sent to the provider chain + * which may bounce back and forth until handled by the provider. + * + * Note this type is only used internally to the consumer CCV module. + */ +export interface SlashRecordSDKType { + waiting_on_reply: boolean; + send_time: Date | undefined; +} +function createBaseCrossChainValidator(): CrossChainValidator { + return { + address: new Uint8Array(), + power: BigInt(0), + pubkey: undefined, + optedOut: false + }; +} +export const CrossChainValidator = { + typeUrl: "/interchain_security.ccv.consumer.v1.CrossChainValidator", + encode(message: CrossChainValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address.length !== 0) { + writer.uint32(10).bytes(message.address); + } + if (message.power !== BigInt(0)) { + writer.uint32(16).int64(message.power); + } + if (message.pubkey !== undefined) { + Any.encode((message.pubkey as Any), writer.uint32(26).fork()).ldelim(); + } + if (message.optedOut === true) { + writer.uint32(32).bool(message.optedOut); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): CrossChainValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCrossChainValidator(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.bytes(); + break; + case 2: + message.power = reader.int64(); + break; + case 3: + message.pubkey = useInterfaces ? (Cosmos_cryptoPubKey_InterfaceDecoder(reader) as Any) : Any.decode(reader, reader.uint32(), useInterfaces); + break; + case 4: + message.optedOut = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CrossChainValidator { + const message = createBaseCrossChainValidator(); + message.address = object.address ?? new Uint8Array(); + message.power = object.power !== undefined && object.power !== null ? BigInt(object.power.toString()) : BigInt(0); + message.pubkey = object.pubkey !== undefined && object.pubkey !== null ? Any.fromPartial(object.pubkey) : undefined; + message.optedOut = object.optedOut ?? false; + return message; + }, + fromAmino(object: CrossChainValidatorAmino): CrossChainValidator { + const message = createBaseCrossChainValidator(); + if (object.address !== undefined && object.address !== null) { + message.address = bytesFromBase64(object.address); + } + if (object.power !== undefined && object.power !== null) { + message.power = BigInt(object.power); + } + if (object.pubkey !== undefined && object.pubkey !== null) { + message.pubkey = encodePubkey(object.pubkey); + } + if (object.opted_out !== undefined && object.opted_out !== null) { + message.optedOut = object.opted_out; + } + return message; + }, + toAmino(message: CrossChainValidator, useInterfaces: boolean = false): CrossChainValidatorAmino { + const obj: any = {}; + obj.address = message.address ? base64FromBytes(message.address) : undefined; + obj.power = message.power ? message.power.toString() : undefined; + obj.pubkey = message.pubkey ? decodePubkey(message.pubkey) : undefined; + obj.opted_out = message.optedOut; + return obj; + }, + fromAminoMsg(object: CrossChainValidatorAminoMsg): CrossChainValidator { + return CrossChainValidator.fromAmino(object.value); + }, + fromProtoMsg(message: CrossChainValidatorProtoMsg, useInterfaces: boolean = false): CrossChainValidator { + return CrossChainValidator.decode(message.value, undefined, useInterfaces); + }, + toProto(message: CrossChainValidator): Uint8Array { + return CrossChainValidator.encode(message).finish(); + }, + toProtoMsg(message: CrossChainValidator): CrossChainValidatorProtoMsg { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.CrossChainValidator", + value: CrossChainValidator.encode(message).finish() + }; + } +}; +function createBaseSlashRecord(): SlashRecord { + return { + waitingOnReply: false, + sendTime: new Date() + }; +} +export const SlashRecord = { + typeUrl: "/interchain_security.ccv.consumer.v1.SlashRecord", + encode(message: SlashRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.waitingOnReply === true) { + writer.uint32(8).bool(message.waitingOnReply); + } + if (message.sendTime !== undefined) { + Timestamp.encode(toTimestamp(message.sendTime), writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): SlashRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSlashRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.waitingOnReply = reader.bool(); + break; + case 2: + message.sendTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SlashRecord { + const message = createBaseSlashRecord(); + message.waitingOnReply = object.waitingOnReply ?? false; + message.sendTime = object.sendTime ?? undefined; + return message; + }, + fromAmino(object: SlashRecordAmino): SlashRecord { + const message = createBaseSlashRecord(); + if (object.waiting_on_reply !== undefined && object.waiting_on_reply !== null) { + message.waitingOnReply = object.waiting_on_reply; + } + if (object.send_time !== undefined && object.send_time !== null) { + message.sendTime = fromTimestamp(Timestamp.fromAmino(object.send_time)); + } + return message; + }, + toAmino(message: SlashRecord, useInterfaces: boolean = false): SlashRecordAmino { + const obj: any = {}; + obj.waiting_on_reply = message.waitingOnReply; + obj.send_time = message.sendTime ? Timestamp.toAmino(toTimestamp(message.sendTime)) : undefined; + return obj; + }, + fromAminoMsg(object: SlashRecordAminoMsg): SlashRecord { + return SlashRecord.fromAmino(object.value); + }, + fromProtoMsg(message: SlashRecordProtoMsg, useInterfaces: boolean = false): SlashRecord { + return SlashRecord.decode(message.value, undefined, useInterfaces); + }, + toProto(message: SlashRecord): Uint8Array { + return SlashRecord.encode(message).finish(); + }, + toProtoMsg(message: SlashRecord): SlashRecordProtoMsg { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.SlashRecord", + value: SlashRecord.encode(message).finish() + }; + } +}; +export const Cosmos_cryptoPubKey_InterfaceDecoder = (input: BinaryReader | Uint8Array): Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32(), true); + switch (data.typeUrl) { + default: + return data; + } +}; +export const Cosmos_cryptoPubKey_FromAmino = (content: AnyAmino) => { + return encodePubkey(content); +}; +export const Cosmos_cryptoPubKey_ToAmino = (content: Any, useInterfaces: boolean = false): Pubkey | null => { + return decodePubkey(content); +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/genesis.ts b/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/genesis.ts new file mode 100644 index 000000000..13c7b67e8 --- /dev/null +++ b/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/genesis.ts @@ -0,0 +1,871 @@ +//@ts-nocheck +import { ConsumerParams, ConsumerParamsAmino, ConsumerParamsSDKType, ProviderInfo, ProviderInfoAmino, ProviderInfoSDKType } from "../../v1/shared_consumer"; +import { ClientState, ClientStateAmino, ClientStateSDKType, ConsensusState, ConsensusStateAmino, ConsensusStateSDKType } from "../../../../ibc/lightclients/tendermint/v1/tendermint"; +import { ValidatorUpdate, ValidatorUpdateAmino, ValidatorUpdateSDKType } from "../../../../tendermint/abci/types"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; +import { ConsumerPacketData, ConsumerPacketDataAmino, ConsumerPacketDataSDKType } from "../../v1/wire"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../../helpers"; +/** + * GenesisState defines the CCV consumer genesis state + * + * Note: this type is only used on consumer side and references shared types with + * provider + */ +export interface GenesisState { + /** ConsumerParams is a shared type with provider module */ + params: ConsumerParams | undefined; + /** Client ID of the provider. Empty for a new chain, filled in on restart. */ + providerClientId: string; + /** Channel ID of the provider. Empty for a new chain, filled in on restart. */ + providerChannelId: string; + /** true for new chain, false for chain restart. */ + newChain: boolean; + /** !!! DEPRECATED !!! ProviderClientState is deprecated. Use provider.client_state instead */ + /** @deprecated */ + providerClientState?: ClientState | undefined; + /** !!! DEPRECATED !!! ProviderConsensusState is deprecated. Use provider.consensus_state instead */ + /** @deprecated */ + providerConsensusState?: ConsensusState | undefined; + /** MaturingPackets nil on new chain, filled in on restart. */ + maturingPackets: MaturingVSCPacket[]; + /** !!! DEPRECATED !!!! InitialValset is deprecated. Use provider.initial_val_set instead */ + /** @deprecated */ + initialValSet: ValidatorUpdate[]; + /** HeightToValsetUpdateId nil on new chain, filled in on restart. */ + heightToValsetUpdateId: HeightToValsetUpdateID[]; + /** OutstandingDowntimes nil on new chain, filled in on restart. */ + outstandingDowntimeSlashing: OutstandingDowntime[]; + /** PendingConsumerPackets nil on new chain, filled in on restart. */ + pendingConsumerPackets: ConsumerPacketDataList | undefined; + /** LastTransmissionBlockHeight nil on new chain, filled in on restart. */ + lastTransmissionBlockHeight: LastTransmissionBlockHeight | undefined; + /** flag indicating whether the consumer CCV module starts in pre-CCV state */ + preCCV: boolean; + provider: ProviderInfo | undefined; +} +export interface GenesisStateProtoMsg { + typeUrl: "/interchain_security.ccv.consumer.v1.GenesisState"; + value: Uint8Array; +} +/** + * GenesisState defines the CCV consumer genesis state + * + * Note: this type is only used on consumer side and references shared types with + * provider + */ +export interface GenesisStateAmino { + /** ConsumerParams is a shared type with provider module */ + params?: ConsumerParamsAmino | undefined; + /** Client ID of the provider. Empty for a new chain, filled in on restart. */ + provider_client_id?: string; + /** Channel ID of the provider. Empty for a new chain, filled in on restart. */ + provider_channel_id?: string; + /** true for new chain, false for chain restart. */ + new_chain?: boolean; + /** !!! DEPRECATED !!! ProviderClientState is deprecated. Use provider.client_state instead */ + /** @deprecated */ + provider_client_state?: ClientStateAmino | undefined; + /** !!! DEPRECATED !!! ProviderConsensusState is deprecated. Use provider.consensus_state instead */ + /** @deprecated */ + provider_consensus_state?: ConsensusStateAmino | undefined; + /** MaturingPackets nil on new chain, filled in on restart. */ + maturing_packets?: MaturingVSCPacketAmino[]; + /** !!! DEPRECATED !!!! InitialValset is deprecated. Use provider.initial_val_set instead */ + /** @deprecated */ + initial_val_set?: ValidatorUpdateAmino[]; + /** HeightToValsetUpdateId nil on new chain, filled in on restart. */ + height_to_valset_update_id?: HeightToValsetUpdateIDAmino[]; + /** OutstandingDowntimes nil on new chain, filled in on restart. */ + outstanding_downtime_slashing?: OutstandingDowntimeAmino[]; + /** PendingConsumerPackets nil on new chain, filled in on restart. */ + pending_consumer_packets?: ConsumerPacketDataListAmino | undefined; + /** LastTransmissionBlockHeight nil on new chain, filled in on restart. */ + last_transmission_block_height?: LastTransmissionBlockHeightAmino | undefined; + /** flag indicating whether the consumer CCV module starts in pre-CCV state */ + preCCV?: boolean; + provider?: ProviderInfoAmino | undefined; +} +export interface GenesisStateAminoMsg { + type: "/interchain_security.ccv.consumer.v1.GenesisState"; + value: GenesisStateAmino; +} +/** + * GenesisState defines the CCV consumer genesis state + * + * Note: this type is only used on consumer side and references shared types with + * provider + */ +export interface GenesisStateSDKType { + params: ConsumerParamsSDKType | undefined; + provider_client_id: string; + provider_channel_id: string; + new_chain: boolean; + /** @deprecated */ + provider_client_state?: ClientStateSDKType | undefined; + /** @deprecated */ + provider_consensus_state?: ConsensusStateSDKType | undefined; + maturing_packets: MaturingVSCPacketSDKType[]; + /** @deprecated */ + initial_val_set: ValidatorUpdateSDKType[]; + height_to_valset_update_id: HeightToValsetUpdateIDSDKType[]; + outstanding_downtime_slashing: OutstandingDowntimeSDKType[]; + pending_consumer_packets: ConsumerPacketDataListSDKType | undefined; + last_transmission_block_height: LastTransmissionBlockHeightSDKType | undefined; + preCCV: boolean; + provider: ProviderInfoSDKType | undefined; +} +/** + * HeightValsetUpdateID represents a mapping internal to the consumer CCV module + * which links a block height to each recv valset update id. + */ +export interface HeightToValsetUpdateID { + height: bigint; + valsetUpdateId: bigint; +} +export interface HeightToValsetUpdateIDProtoMsg { + typeUrl: "/interchain_security.ccv.consumer.v1.HeightToValsetUpdateID"; + value: Uint8Array; +} +/** + * HeightValsetUpdateID represents a mapping internal to the consumer CCV module + * which links a block height to each recv valset update id. + */ +export interface HeightToValsetUpdateIDAmino { + height?: string; + valset_update_id?: string; +} +export interface HeightToValsetUpdateIDAminoMsg { + type: "/interchain_security.ccv.consumer.v1.HeightToValsetUpdateID"; + value: HeightToValsetUpdateIDAmino; +} +/** + * HeightValsetUpdateID represents a mapping internal to the consumer CCV module + * which links a block height to each recv valset update id. + */ +export interface HeightToValsetUpdateIDSDKType { + height: bigint; + valset_update_id: bigint; +} +/** + * OutstandingDowntime defines the type used internally to the consumer CCV + * module and is used in order to not send multiple slashing requests for + * the same downtime infraction. + */ +export interface OutstandingDowntime { + /** + * OutstandingDowntime defines the type used internally to the consumer CCV + * module and is used in order to not send multiple slashing requests for + * the same downtime infraction. + */ + validatorConsensusAddress: string; +} +export interface OutstandingDowntimeProtoMsg { + typeUrl: "/interchain_security.ccv.consumer.v1.OutstandingDowntime"; + value: Uint8Array; +} +/** + * OutstandingDowntime defines the type used internally to the consumer CCV + * module and is used in order to not send multiple slashing requests for + * the same downtime infraction. + */ +export interface OutstandingDowntimeAmino { + /** + * OutstandingDowntime defines the type used internally to the consumer CCV + * module and is used in order to not send multiple slashing requests for + * the same downtime infraction. + */ + validator_consensus_address?: string; +} +export interface OutstandingDowntimeAminoMsg { + type: "/interchain_security.ccv.consumer.v1.OutstandingDowntime"; + value: OutstandingDowntimeAmino; +} +/** + * OutstandingDowntime defines the type used internally to the consumer CCV + * module and is used in order to not send multiple slashing requests for + * the same downtime infraction. + */ +export interface OutstandingDowntimeSDKType { + validator_consensus_address: string; +} +/** + * LastTransmissionBlockHeight is the last time validator holding + * pools were transmitted to the provider chain. This type is used internally + * to the consumer CCV module. + */ +export interface LastTransmissionBlockHeight { + /** + * LastTransmissionBlockHeight is the last time validator holding + * pools were transmitted to the provider chain. This type is used internally + * to the consumer CCV module. + */ + height: bigint; +} +export interface LastTransmissionBlockHeightProtoMsg { + typeUrl: "/interchain_security.ccv.consumer.v1.LastTransmissionBlockHeight"; + value: Uint8Array; +} +/** + * LastTransmissionBlockHeight is the last time validator holding + * pools were transmitted to the provider chain. This type is used internally + * to the consumer CCV module. + */ +export interface LastTransmissionBlockHeightAmino { + /** + * LastTransmissionBlockHeight is the last time validator holding + * pools were transmitted to the provider chain. This type is used internally + * to the consumer CCV module. + */ + height?: string; +} +export interface LastTransmissionBlockHeightAminoMsg { + type: "/interchain_security.ccv.consumer.v1.LastTransmissionBlockHeight"; + value: LastTransmissionBlockHeightAmino; +} +/** + * LastTransmissionBlockHeight is the last time validator holding + * pools were transmitted to the provider chain. This type is used internally + * to the consumer CCV module. + */ +export interface LastTransmissionBlockHeightSDKType { + height: bigint; +} +/** + * MaturingVSCPacket represents a vsc packet that is maturing internal to the + * consumer CCV module, where the consumer has not yet relayed a VSCMatured + * packet back to the provider. + */ +export interface MaturingVSCPacket { + vscId: bigint; + maturityTime: Date | undefined; +} +export interface MaturingVSCPacketProtoMsg { + typeUrl: "/interchain_security.ccv.consumer.v1.MaturingVSCPacket"; + value: Uint8Array; +} +/** + * MaturingVSCPacket represents a vsc packet that is maturing internal to the + * consumer CCV module, where the consumer has not yet relayed a VSCMatured + * packet back to the provider. + */ +export interface MaturingVSCPacketAmino { + vscId?: string; + maturity_time?: string | undefined; +} +export interface MaturingVSCPacketAminoMsg { + type: "/interchain_security.ccv.consumer.v1.MaturingVSCPacket"; + value: MaturingVSCPacketAmino; +} +/** + * MaturingVSCPacket represents a vsc packet that is maturing internal to the + * consumer CCV module, where the consumer has not yet relayed a VSCMatured + * packet back to the provider. + */ +export interface MaturingVSCPacketSDKType { + vscId: bigint; + maturity_time: Date | undefined; +} +/** + * ConsumerPacketDataList is a list of consumer packet data packets. + * + * Note this type is used internally to the consumer CCV module + * for exporting / importing state in InitGenesis and ExportGenesis. + */ +export interface ConsumerPacketDataList { + list: ConsumerPacketData[]; +} +export interface ConsumerPacketDataListProtoMsg { + typeUrl: "/interchain_security.ccv.consumer.v1.ConsumerPacketDataList"; + value: Uint8Array; +} +/** + * ConsumerPacketDataList is a list of consumer packet data packets. + * + * Note this type is used internally to the consumer CCV module + * for exporting / importing state in InitGenesis and ExportGenesis. + */ +export interface ConsumerPacketDataListAmino { + list?: ConsumerPacketDataAmino[]; +} +export interface ConsumerPacketDataListAminoMsg { + type: "/interchain_security.ccv.consumer.v1.ConsumerPacketDataList"; + value: ConsumerPacketDataListAmino; +} +/** + * ConsumerPacketDataList is a list of consumer packet data packets. + * + * Note this type is used internally to the consumer CCV module + * for exporting / importing state in InitGenesis and ExportGenesis. + */ +export interface ConsumerPacketDataListSDKType { + list: ConsumerPacketDataSDKType[]; +} +function createBaseGenesisState(): GenesisState { + return { + params: ConsumerParams.fromPartial({}), + providerClientId: "", + providerChannelId: "", + newChain: false, + providerClientState: undefined, + providerConsensusState: undefined, + maturingPackets: [], + initialValSet: [], + heightToValsetUpdateId: [], + outstandingDowntimeSlashing: [], + pendingConsumerPackets: ConsumerPacketDataList.fromPartial({}), + lastTransmissionBlockHeight: LastTransmissionBlockHeight.fromPartial({}), + preCCV: false, + provider: ProviderInfo.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/interchain_security.ccv.consumer.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + ConsumerParams.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + if (message.providerClientId !== "") { + writer.uint32(18).string(message.providerClientId); + } + if (message.providerChannelId !== "") { + writer.uint32(26).string(message.providerChannelId); + } + if (message.newChain === true) { + writer.uint32(32).bool(message.newChain); + } + if (message.providerClientState !== undefined) { + ClientState.encode(message.providerClientState, writer.uint32(42).fork()).ldelim(); + } + if (message.providerConsensusState !== undefined) { + ConsensusState.encode(message.providerConsensusState, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.maturingPackets) { + MaturingVSCPacket.encode(v!, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.initialValSet) { + ValidatorUpdate.encode(v!, writer.uint32(66).fork()).ldelim(); + } + for (const v of message.heightToValsetUpdateId) { + HeightToValsetUpdateID.encode(v!, writer.uint32(74).fork()).ldelim(); + } + for (const v of message.outstandingDowntimeSlashing) { + OutstandingDowntime.encode(v!, writer.uint32(82).fork()).ldelim(); + } + if (message.pendingConsumerPackets !== undefined) { + ConsumerPacketDataList.encode(message.pendingConsumerPackets, writer.uint32(90).fork()).ldelim(); + } + if (message.lastTransmissionBlockHeight !== undefined) { + LastTransmissionBlockHeight.encode(message.lastTransmissionBlockHeight, writer.uint32(98).fork()).ldelim(); + } + if (message.preCCV === true) { + writer.uint32(104).bool(message.preCCV); + } + if (message.provider !== undefined) { + ProviderInfo.encode(message.provider, writer.uint32(114).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = ConsumerParams.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.providerClientId = reader.string(); + break; + case 3: + message.providerChannelId = reader.string(); + break; + case 4: + message.newChain = reader.bool(); + break; + case 5: + message.providerClientState = ClientState.decode(reader, reader.uint32(), useInterfaces); + break; + case 6: + message.providerConsensusState = ConsensusState.decode(reader, reader.uint32(), useInterfaces); + break; + case 7: + message.maturingPackets.push(MaturingVSCPacket.decode(reader, reader.uint32(), useInterfaces)); + break; + case 8: + message.initialValSet.push(ValidatorUpdate.decode(reader, reader.uint32(), useInterfaces)); + break; + case 9: + message.heightToValsetUpdateId.push(HeightToValsetUpdateID.decode(reader, reader.uint32(), useInterfaces)); + break; + case 10: + message.outstandingDowntimeSlashing.push(OutstandingDowntime.decode(reader, reader.uint32(), useInterfaces)); + break; + case 11: + message.pendingConsumerPackets = ConsumerPacketDataList.decode(reader, reader.uint32(), useInterfaces); + break; + case 12: + message.lastTransmissionBlockHeight = LastTransmissionBlockHeight.decode(reader, reader.uint32(), useInterfaces); + break; + case 13: + message.preCCV = reader.bool(); + break; + case 14: + message.provider = ProviderInfo.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? ConsumerParams.fromPartial(object.params) : undefined; + message.providerClientId = object.providerClientId ?? ""; + message.providerChannelId = object.providerChannelId ?? ""; + message.newChain = object.newChain ?? false; + message.providerClientState = object.providerClientState !== undefined && object.providerClientState !== null ? ClientState.fromPartial(object.providerClientState) : undefined; + message.providerConsensusState = object.providerConsensusState !== undefined && object.providerConsensusState !== null ? ConsensusState.fromPartial(object.providerConsensusState) : undefined; + message.maturingPackets = object.maturingPackets?.map(e => MaturingVSCPacket.fromPartial(e)) || []; + message.initialValSet = object.initialValSet?.map(e => ValidatorUpdate.fromPartial(e)) || []; + message.heightToValsetUpdateId = object.heightToValsetUpdateId?.map(e => HeightToValsetUpdateID.fromPartial(e)) || []; + message.outstandingDowntimeSlashing = object.outstandingDowntimeSlashing?.map(e => OutstandingDowntime.fromPartial(e)) || []; + message.pendingConsumerPackets = object.pendingConsumerPackets !== undefined && object.pendingConsumerPackets !== null ? ConsumerPacketDataList.fromPartial(object.pendingConsumerPackets) : undefined; + message.lastTransmissionBlockHeight = object.lastTransmissionBlockHeight !== undefined && object.lastTransmissionBlockHeight !== null ? LastTransmissionBlockHeight.fromPartial(object.lastTransmissionBlockHeight) : undefined; + message.preCCV = object.preCCV ?? false; + message.provider = object.provider !== undefined && object.provider !== null ? ProviderInfo.fromPartial(object.provider) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = ConsumerParams.fromAmino(object.params); + } + if (object.provider_client_id !== undefined && object.provider_client_id !== null) { + message.providerClientId = object.provider_client_id; + } + if (object.provider_channel_id !== undefined && object.provider_channel_id !== null) { + message.providerChannelId = object.provider_channel_id; + } + if (object.new_chain !== undefined && object.new_chain !== null) { + message.newChain = object.new_chain; + } + if (object.provider_client_state !== undefined && object.provider_client_state !== null) { + message.providerClientState = ClientState.fromAmino(object.provider_client_state); + } + if (object.provider_consensus_state !== undefined && object.provider_consensus_state !== null) { + message.providerConsensusState = ConsensusState.fromAmino(object.provider_consensus_state); + } + message.maturingPackets = object.maturing_packets?.map(e => MaturingVSCPacket.fromAmino(e)) || []; + message.initialValSet = object.initial_val_set?.map(e => ValidatorUpdate.fromAmino(e)) || []; + message.heightToValsetUpdateId = object.height_to_valset_update_id?.map(e => HeightToValsetUpdateID.fromAmino(e)) || []; + message.outstandingDowntimeSlashing = object.outstanding_downtime_slashing?.map(e => OutstandingDowntime.fromAmino(e)) || []; + if (object.pending_consumer_packets !== undefined && object.pending_consumer_packets !== null) { + message.pendingConsumerPackets = ConsumerPacketDataList.fromAmino(object.pending_consumer_packets); + } + if (object.last_transmission_block_height !== undefined && object.last_transmission_block_height !== null) { + message.lastTransmissionBlockHeight = LastTransmissionBlockHeight.fromAmino(object.last_transmission_block_height); + } + if (object.preCCV !== undefined && object.preCCV !== null) { + message.preCCV = object.preCCV; + } + if (object.provider !== undefined && object.provider !== null) { + message.provider = ProviderInfo.fromAmino(object.provider); + } + return message; + }, + toAmino(message: GenesisState, useInterfaces: boolean = false): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? ConsumerParams.toAmino(message.params, useInterfaces) : undefined; + obj.provider_client_id = message.providerClientId; + obj.provider_channel_id = message.providerChannelId; + obj.new_chain = message.newChain; + obj.provider_client_state = message.providerClientState ? ClientState.toAmino(message.providerClientState, useInterfaces) : undefined; + obj.provider_consensus_state = message.providerConsensusState ? ConsensusState.toAmino(message.providerConsensusState, useInterfaces) : undefined; + if (message.maturingPackets) { + obj.maturing_packets = message.maturingPackets.map(e => e ? MaturingVSCPacket.toAmino(e, useInterfaces) : undefined); + } else { + obj.maturing_packets = []; + } + if (message.initialValSet) { + obj.initial_val_set = message.initialValSet.map(e => e ? ValidatorUpdate.toAmino(e, useInterfaces) : undefined); + } else { + obj.initial_val_set = []; + } + if (message.heightToValsetUpdateId) { + obj.height_to_valset_update_id = message.heightToValsetUpdateId.map(e => e ? HeightToValsetUpdateID.toAmino(e, useInterfaces) : undefined); + } else { + obj.height_to_valset_update_id = []; + } + if (message.outstandingDowntimeSlashing) { + obj.outstanding_downtime_slashing = message.outstandingDowntimeSlashing.map(e => e ? OutstandingDowntime.toAmino(e, useInterfaces) : undefined); + } else { + obj.outstanding_downtime_slashing = []; + } + obj.pending_consumer_packets = message.pendingConsumerPackets ? ConsumerPacketDataList.toAmino(message.pendingConsumerPackets, useInterfaces) : undefined; + obj.last_transmission_block_height = message.lastTransmissionBlockHeight ? LastTransmissionBlockHeight.toAmino(message.lastTransmissionBlockHeight, useInterfaces) : undefined; + obj.preCCV = message.preCCV; + obj.provider = message.provider ? ProviderInfo.toAmino(message.provider, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg, useInterfaces: boolean = false): GenesisState { + return GenesisState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +function createBaseHeightToValsetUpdateID(): HeightToValsetUpdateID { + return { + height: BigInt(0), + valsetUpdateId: BigInt(0) + }; +} +export const HeightToValsetUpdateID = { + typeUrl: "/interchain_security.ccv.consumer.v1.HeightToValsetUpdateID", + encode(message: HeightToValsetUpdateID, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).uint64(message.height); + } + if (message.valsetUpdateId !== BigInt(0)) { + writer.uint32(16).uint64(message.valsetUpdateId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): HeightToValsetUpdateID { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeightToValsetUpdateID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint64(); + break; + case 2: + message.valsetUpdateId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): HeightToValsetUpdateID { + const message = createBaseHeightToValsetUpdateID(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.valsetUpdateId = object.valsetUpdateId !== undefined && object.valsetUpdateId !== null ? BigInt(object.valsetUpdateId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: HeightToValsetUpdateIDAmino): HeightToValsetUpdateID { + const message = createBaseHeightToValsetUpdateID(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.valset_update_id !== undefined && object.valset_update_id !== null) { + message.valsetUpdateId = BigInt(object.valset_update_id); + } + return message; + }, + toAmino(message: HeightToValsetUpdateID, useInterfaces: boolean = false): HeightToValsetUpdateIDAmino { + const obj: any = {}; + obj.height = message.height ? message.height.toString() : undefined; + obj.valset_update_id = message.valsetUpdateId ? message.valsetUpdateId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: HeightToValsetUpdateIDAminoMsg): HeightToValsetUpdateID { + return HeightToValsetUpdateID.fromAmino(object.value); + }, + fromProtoMsg(message: HeightToValsetUpdateIDProtoMsg, useInterfaces: boolean = false): HeightToValsetUpdateID { + return HeightToValsetUpdateID.decode(message.value, undefined, useInterfaces); + }, + toProto(message: HeightToValsetUpdateID): Uint8Array { + return HeightToValsetUpdateID.encode(message).finish(); + }, + toProtoMsg(message: HeightToValsetUpdateID): HeightToValsetUpdateIDProtoMsg { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.HeightToValsetUpdateID", + value: HeightToValsetUpdateID.encode(message).finish() + }; + } +}; +function createBaseOutstandingDowntime(): OutstandingDowntime { + return { + validatorConsensusAddress: "" + }; +} +export const OutstandingDowntime = { + typeUrl: "/interchain_security.ccv.consumer.v1.OutstandingDowntime", + encode(message: OutstandingDowntime, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorConsensusAddress !== "") { + writer.uint32(10).string(message.validatorConsensusAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): OutstandingDowntime { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOutstandingDowntime(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorConsensusAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): OutstandingDowntime { + const message = createBaseOutstandingDowntime(); + message.validatorConsensusAddress = object.validatorConsensusAddress ?? ""; + return message; + }, + fromAmino(object: OutstandingDowntimeAmino): OutstandingDowntime { + const message = createBaseOutstandingDowntime(); + if (object.validator_consensus_address !== undefined && object.validator_consensus_address !== null) { + message.validatorConsensusAddress = object.validator_consensus_address; + } + return message; + }, + toAmino(message: OutstandingDowntime, useInterfaces: boolean = false): OutstandingDowntimeAmino { + const obj: any = {}; + obj.validator_consensus_address = message.validatorConsensusAddress; + return obj; + }, + fromAminoMsg(object: OutstandingDowntimeAminoMsg): OutstandingDowntime { + return OutstandingDowntime.fromAmino(object.value); + }, + fromProtoMsg(message: OutstandingDowntimeProtoMsg, useInterfaces: boolean = false): OutstandingDowntime { + return OutstandingDowntime.decode(message.value, undefined, useInterfaces); + }, + toProto(message: OutstandingDowntime): Uint8Array { + return OutstandingDowntime.encode(message).finish(); + }, + toProtoMsg(message: OutstandingDowntime): OutstandingDowntimeProtoMsg { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.OutstandingDowntime", + value: OutstandingDowntime.encode(message).finish() + }; + } +}; +function createBaseLastTransmissionBlockHeight(): LastTransmissionBlockHeight { + return { + height: BigInt(0) + }; +} +export const LastTransmissionBlockHeight = { + typeUrl: "/interchain_security.ccv.consumer.v1.LastTransmissionBlockHeight", + encode(message: LastTransmissionBlockHeight, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).int64(message.height); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): LastTransmissionBlockHeight { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLastTransmissionBlockHeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LastTransmissionBlockHeight { + const message = createBaseLastTransmissionBlockHeight(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + return message; + }, + fromAmino(object: LastTransmissionBlockHeightAmino): LastTransmissionBlockHeight { + const message = createBaseLastTransmissionBlockHeight(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + return message; + }, + toAmino(message: LastTransmissionBlockHeight, useInterfaces: boolean = false): LastTransmissionBlockHeightAmino { + const obj: any = {}; + obj.height = message.height ? message.height.toString() : undefined; + return obj; + }, + fromAminoMsg(object: LastTransmissionBlockHeightAminoMsg): LastTransmissionBlockHeight { + return LastTransmissionBlockHeight.fromAmino(object.value); + }, + fromProtoMsg(message: LastTransmissionBlockHeightProtoMsg, useInterfaces: boolean = false): LastTransmissionBlockHeight { + return LastTransmissionBlockHeight.decode(message.value, undefined, useInterfaces); + }, + toProto(message: LastTransmissionBlockHeight): Uint8Array { + return LastTransmissionBlockHeight.encode(message).finish(); + }, + toProtoMsg(message: LastTransmissionBlockHeight): LastTransmissionBlockHeightProtoMsg { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.LastTransmissionBlockHeight", + value: LastTransmissionBlockHeight.encode(message).finish() + }; + } +}; +function createBaseMaturingVSCPacket(): MaturingVSCPacket { + return { + vscId: BigInt(0), + maturityTime: new Date() + }; +} +export const MaturingVSCPacket = { + typeUrl: "/interchain_security.ccv.consumer.v1.MaturingVSCPacket", + encode(message: MaturingVSCPacket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.vscId !== BigInt(0)) { + writer.uint32(8).uint64(message.vscId); + } + if (message.maturityTime !== undefined) { + Timestamp.encode(toTimestamp(message.maturityTime), writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MaturingVSCPacket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMaturingVSCPacket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vscId = reader.uint64(); + break; + case 2: + message.maturityTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MaturingVSCPacket { + const message = createBaseMaturingVSCPacket(); + message.vscId = object.vscId !== undefined && object.vscId !== null ? BigInt(object.vscId.toString()) : BigInt(0); + message.maturityTime = object.maturityTime ?? undefined; + return message; + }, + fromAmino(object: MaturingVSCPacketAmino): MaturingVSCPacket { + const message = createBaseMaturingVSCPacket(); + if (object.vscId !== undefined && object.vscId !== null) { + message.vscId = BigInt(object.vscId); + } + if (object.maturity_time !== undefined && object.maturity_time !== null) { + message.maturityTime = fromTimestamp(Timestamp.fromAmino(object.maturity_time)); + } + return message; + }, + toAmino(message: MaturingVSCPacket, useInterfaces: boolean = false): MaturingVSCPacketAmino { + const obj: any = {}; + obj.vscId = message.vscId ? message.vscId.toString() : undefined; + obj.maturity_time = message.maturityTime ? Timestamp.toAmino(toTimestamp(message.maturityTime)) : undefined; + return obj; + }, + fromAminoMsg(object: MaturingVSCPacketAminoMsg): MaturingVSCPacket { + return MaturingVSCPacket.fromAmino(object.value); + }, + fromProtoMsg(message: MaturingVSCPacketProtoMsg, useInterfaces: boolean = false): MaturingVSCPacket { + return MaturingVSCPacket.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MaturingVSCPacket): Uint8Array { + return MaturingVSCPacket.encode(message).finish(); + }, + toProtoMsg(message: MaturingVSCPacket): MaturingVSCPacketProtoMsg { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.MaturingVSCPacket", + value: MaturingVSCPacket.encode(message).finish() + }; + } +}; +function createBaseConsumerPacketDataList(): ConsumerPacketDataList { + return { + list: [] + }; +} +export const ConsumerPacketDataList = { + typeUrl: "/interchain_security.ccv.consumer.v1.ConsumerPacketDataList", + encode(message: ConsumerPacketDataList, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.list) { + ConsumerPacketData.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ConsumerPacketDataList { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsumerPacketDataList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.list.push(ConsumerPacketData.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConsumerPacketDataList { + const message = createBaseConsumerPacketDataList(); + message.list = object.list?.map(e => ConsumerPacketData.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ConsumerPacketDataListAmino): ConsumerPacketDataList { + const message = createBaseConsumerPacketDataList(); + message.list = object.list?.map(e => ConsumerPacketData.fromAmino(e)) || []; + return message; + }, + toAmino(message: ConsumerPacketDataList, useInterfaces: boolean = false): ConsumerPacketDataListAmino { + const obj: any = {}; + if (message.list) { + obj.list = message.list.map(e => e ? ConsumerPacketData.toAmino(e, useInterfaces) : undefined); + } else { + obj.list = []; + } + return obj; + }, + fromAminoMsg(object: ConsumerPacketDataListAminoMsg): ConsumerPacketDataList { + return ConsumerPacketDataList.fromAmino(object.value); + }, + fromProtoMsg(message: ConsumerPacketDataListProtoMsg, useInterfaces: boolean = false): ConsumerPacketDataList { + return ConsumerPacketDataList.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ConsumerPacketDataList): Uint8Array { + return ConsumerPacketDataList.encode(message).finish(); + }, + toProtoMsg(message: ConsumerPacketDataList): ConsumerPacketDataListProtoMsg { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.ConsumerPacketDataList", + value: ConsumerPacketDataList.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/query.rpc.Query.ts b/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/query.rpc.Query.ts new file mode 100644 index 000000000..a37a90ae1 --- /dev/null +++ b/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/query.rpc.Query.ts @@ -0,0 +1,64 @@ +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryNextFeeDistributionEstimateRequest, QueryNextFeeDistributionEstimateResponse, QueryParamsRequest, QueryParamsResponse, QueryProviderInfoRequest, QueryProviderInfoResponse, QueryThrottleStateRequest, QueryThrottleStateResponse } from "./query"; +export interface Query { + /** + * ConsumerGenesis queries the genesis state needed to start a consumer chain + * whose proposal has been accepted + */ + queryNextFeeDistribution(request?: QueryNextFeeDistributionEstimateRequest): Promise; + /** QueryParams queries the ccv/consumer module parameters. */ + queryParams(request?: QueryParamsRequest): Promise; + queryProviderInfo(request?: QueryProviderInfoRequest): Promise; + /** QueryThrottleState returns on-chain state relevant to throttled consumer packets */ + queryThrottleState(request?: QueryThrottleStateRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.queryNextFeeDistribution = this.queryNextFeeDistribution.bind(this); + this.queryParams = this.queryParams.bind(this); + this.queryProviderInfo = this.queryProviderInfo.bind(this); + this.queryThrottleState = this.queryThrottleState.bind(this); + } + queryNextFeeDistribution(request: QueryNextFeeDistributionEstimateRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryNextFeeDistributionEstimateRequest.encode(request).finish(); + const promise = this.rpc.request("interchain_security.ccv.consumer.v1.Query", "QueryNextFeeDistribution", data); + return promise.then(data => QueryNextFeeDistributionEstimateResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + queryParams(request: QueryParamsRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("interchain_security.ccv.consumer.v1.Query", "QueryParams", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + queryProviderInfo(request: QueryProviderInfoRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryProviderInfoRequest.encode(request).finish(); + const promise = this.rpc.request("interchain_security.ccv.consumer.v1.Query", "QueryProviderInfo", data); + return promise.then(data => QueryProviderInfoResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } + queryThrottleState(request: QueryThrottleStateRequest = {}, useInterfaces: boolean = true): Promise { + const data = QueryThrottleStateRequest.encode(request).finish(); + const promise = this.rpc.request("interchain_security.ccv.consumer.v1.Query", "QueryThrottleState", data); + return promise.then(data => QueryThrottleStateResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + queryNextFeeDistribution(request?: QueryNextFeeDistributionEstimateRequest, useInterfaces: boolean = true): Promise { + return queryService.queryNextFeeDistribution(request, useInterfaces); + }, + queryParams(request?: QueryParamsRequest, useInterfaces: boolean = true): Promise { + return queryService.queryParams(request, useInterfaces); + }, + queryProviderInfo(request?: QueryProviderInfoRequest, useInterfaces: boolean = true): Promise { + return queryService.queryProviderInfo(request, useInterfaces); + }, + queryThrottleState(request?: QueryThrottleStateRequest, useInterfaces: boolean = true): Promise { + return queryService.queryThrottleState(request, useInterfaces); + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/query.ts b/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/query.ts new file mode 100644 index 000000000..b2ae810ea --- /dev/null +++ b/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/query.ts @@ -0,0 +1,918 @@ +//@ts-nocheck +import { ConsumerParams, ConsumerParamsAmino, ConsumerParamsSDKType } from "../../v1/shared_consumer"; +import { SlashRecord, SlashRecordAmino, SlashRecordSDKType } from "./consumer"; +import { ConsumerPacketData, ConsumerPacketDataAmino, ConsumerPacketDataSDKType } from "../../v1/wire"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** NextFeeDistributionEstimate holds information about next fee distribution */ +export interface NextFeeDistributionEstimate { + /** current block height at the time of querying */ + currentHeight: bigint; + /** block height at which last distribution took place */ + lastHeight: bigint; + /** block height at which next distribution will take place */ + nextHeight: bigint; + /** ratio between consumer and provider fee distribution */ + distributionFraction: string; + /** total accruead fees at the time of querying */ + total: string; + /** amount distributed to provider chain */ + toProvider: string; + /** amount distributed (kept) by consumer chain */ + toConsumer: string; +} +export interface NextFeeDistributionEstimateProtoMsg { + typeUrl: "/interchain_security.ccv.consumer.v1.NextFeeDistributionEstimate"; + value: Uint8Array; +} +/** NextFeeDistributionEstimate holds information about next fee distribution */ +export interface NextFeeDistributionEstimateAmino { + /** current block height at the time of querying */ + currentHeight?: string; + /** block height at which last distribution took place */ + lastHeight?: string; + /** block height at which next distribution will take place */ + nextHeight?: string; + /** ratio between consumer and provider fee distribution */ + distribution_fraction?: string; + /** total accruead fees at the time of querying */ + total?: string; + /** amount distributed to provider chain */ + toProvider?: string; + /** amount distributed (kept) by consumer chain */ + toConsumer?: string; +} +export interface NextFeeDistributionEstimateAminoMsg { + type: "/interchain_security.ccv.consumer.v1.NextFeeDistributionEstimate"; + value: NextFeeDistributionEstimateAmino; +} +/** NextFeeDistributionEstimate holds information about next fee distribution */ +export interface NextFeeDistributionEstimateSDKType { + currentHeight: bigint; + lastHeight: bigint; + nextHeight: bigint; + distribution_fraction: string; + total: string; + toProvider: string; + toConsumer: string; +} +export interface QueryNextFeeDistributionEstimateRequest {} +export interface QueryNextFeeDistributionEstimateRequestProtoMsg { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryNextFeeDistributionEstimateRequest"; + value: Uint8Array; +} +export interface QueryNextFeeDistributionEstimateRequestAmino {} +export interface QueryNextFeeDistributionEstimateRequestAminoMsg { + type: "/interchain_security.ccv.consumer.v1.QueryNextFeeDistributionEstimateRequest"; + value: QueryNextFeeDistributionEstimateRequestAmino; +} +export interface QueryNextFeeDistributionEstimateRequestSDKType {} +export interface QueryNextFeeDistributionEstimateResponse { + data?: NextFeeDistributionEstimate | undefined; +} +export interface QueryNextFeeDistributionEstimateResponseProtoMsg { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryNextFeeDistributionEstimateResponse"; + value: Uint8Array; +} +export interface QueryNextFeeDistributionEstimateResponseAmino { + data?: NextFeeDistributionEstimateAmino | undefined; +} +export interface QueryNextFeeDistributionEstimateResponseAminoMsg { + type: "/interchain_security.ccv.consumer.v1.QueryNextFeeDistributionEstimateResponse"; + value: QueryNextFeeDistributionEstimateResponseAmino; +} +export interface QueryNextFeeDistributionEstimateResponseSDKType { + data?: NextFeeDistributionEstimateSDKType | undefined; +} +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryParamsRequest"; + value: Uint8Array; +} +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/interchain_security.ccv.consumer.v1.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params holds all the parameters of this module. */ + params: ConsumerParams | undefined; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** params holds all the parameters of this module. */ + params?: ConsumerParamsAmino | undefined; +} +export interface QueryParamsResponseAminoMsg { + type: "/interchain_security.ccv.consumer.v1.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ConsumerParamsSDKType | undefined; +} +export interface QueryProviderInfoRequest {} +export interface QueryProviderInfoRequestProtoMsg { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryProviderInfoRequest"; + value: Uint8Array; +} +export interface QueryProviderInfoRequestAmino {} +export interface QueryProviderInfoRequestAminoMsg { + type: "/interchain_security.ccv.consumer.v1.QueryProviderInfoRequest"; + value: QueryProviderInfoRequestAmino; +} +export interface QueryProviderInfoRequestSDKType {} +export interface QueryProviderInfoResponse { + consumer: ChainInfo | undefined; + provider: ChainInfo | undefined; +} +export interface QueryProviderInfoResponseProtoMsg { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryProviderInfoResponse"; + value: Uint8Array; +} +export interface QueryProviderInfoResponseAmino { + consumer?: ChainInfoAmino | undefined; + provider?: ChainInfoAmino | undefined; +} +export interface QueryProviderInfoResponseAminoMsg { + type: "/interchain_security.ccv.consumer.v1.QueryProviderInfoResponse"; + value: QueryProviderInfoResponseAmino; +} +export interface QueryProviderInfoResponseSDKType { + consumer: ChainInfoSDKType | undefined; + provider: ChainInfoSDKType | undefined; +} +export interface QueryThrottleStateRequest {} +export interface QueryThrottleStateRequestProtoMsg { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryThrottleStateRequest"; + value: Uint8Array; +} +export interface QueryThrottleStateRequestAmino {} +export interface QueryThrottleStateRequestAminoMsg { + type: "/interchain_security.ccv.consumer.v1.QueryThrottleStateRequest"; + value: QueryThrottleStateRequestAmino; +} +export interface QueryThrottleStateRequestSDKType {} +export interface QueryThrottleStateResponse { + slashRecord?: SlashRecord | undefined; + packetDataQueue: ConsumerPacketData[]; +} +export interface QueryThrottleStateResponseProtoMsg { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryThrottleStateResponse"; + value: Uint8Array; +} +export interface QueryThrottleStateResponseAmino { + slash_record?: SlashRecordAmino | undefined; + packet_data_queue?: ConsumerPacketDataAmino[]; +} +export interface QueryThrottleStateResponseAminoMsg { + type: "/interchain_security.ccv.consumer.v1.QueryThrottleStateResponse"; + value: QueryThrottleStateResponseAmino; +} +export interface QueryThrottleStateResponseSDKType { + slash_record?: SlashRecordSDKType | undefined; + packet_data_queue: ConsumerPacketDataSDKType[]; +} +export interface ChainInfo { + chainID: string; + clientID: string; + connectionID: string; + channelID: string; +} +export interface ChainInfoProtoMsg { + typeUrl: "/interchain_security.ccv.consumer.v1.ChainInfo"; + value: Uint8Array; +} +export interface ChainInfoAmino { + chainID?: string; + clientID?: string; + connectionID?: string; + channelID?: string; +} +export interface ChainInfoAminoMsg { + type: "/interchain_security.ccv.consumer.v1.ChainInfo"; + value: ChainInfoAmino; +} +export interface ChainInfoSDKType { + chainID: string; + clientID: string; + connectionID: string; + channelID: string; +} +function createBaseNextFeeDistributionEstimate(): NextFeeDistributionEstimate { + return { + currentHeight: BigInt(0), + lastHeight: BigInt(0), + nextHeight: BigInt(0), + distributionFraction: "", + total: "", + toProvider: "", + toConsumer: "" + }; +} +export const NextFeeDistributionEstimate = { + typeUrl: "/interchain_security.ccv.consumer.v1.NextFeeDistributionEstimate", + encode(message: NextFeeDistributionEstimate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.currentHeight !== BigInt(0)) { + writer.uint32(8).int64(message.currentHeight); + } + if (message.lastHeight !== BigInt(0)) { + writer.uint32(16).int64(message.lastHeight); + } + if (message.nextHeight !== BigInt(0)) { + writer.uint32(24).int64(message.nextHeight); + } + if (message.distributionFraction !== "") { + writer.uint32(34).string(message.distributionFraction); + } + if (message.total !== "") { + writer.uint32(42).string(message.total); + } + if (message.toProvider !== "") { + writer.uint32(50).string(message.toProvider); + } + if (message.toConsumer !== "") { + writer.uint32(58).string(message.toConsumer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): NextFeeDistributionEstimate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNextFeeDistributionEstimate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.currentHeight = reader.int64(); + break; + case 2: + message.lastHeight = reader.int64(); + break; + case 3: + message.nextHeight = reader.int64(); + break; + case 4: + message.distributionFraction = reader.string(); + break; + case 5: + message.total = reader.string(); + break; + case 6: + message.toProvider = reader.string(); + break; + case 7: + message.toConsumer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): NextFeeDistributionEstimate { + const message = createBaseNextFeeDistributionEstimate(); + message.currentHeight = object.currentHeight !== undefined && object.currentHeight !== null ? BigInt(object.currentHeight.toString()) : BigInt(0); + message.lastHeight = object.lastHeight !== undefined && object.lastHeight !== null ? BigInt(object.lastHeight.toString()) : BigInt(0); + message.nextHeight = object.nextHeight !== undefined && object.nextHeight !== null ? BigInt(object.nextHeight.toString()) : BigInt(0); + message.distributionFraction = object.distributionFraction ?? ""; + message.total = object.total ?? ""; + message.toProvider = object.toProvider ?? ""; + message.toConsumer = object.toConsumer ?? ""; + return message; + }, + fromAmino(object: NextFeeDistributionEstimateAmino): NextFeeDistributionEstimate { + const message = createBaseNextFeeDistributionEstimate(); + if (object.currentHeight !== undefined && object.currentHeight !== null) { + message.currentHeight = BigInt(object.currentHeight); + } + if (object.lastHeight !== undefined && object.lastHeight !== null) { + message.lastHeight = BigInt(object.lastHeight); + } + if (object.nextHeight !== undefined && object.nextHeight !== null) { + message.nextHeight = BigInt(object.nextHeight); + } + if (object.distribution_fraction !== undefined && object.distribution_fraction !== null) { + message.distributionFraction = object.distribution_fraction; + } + if (object.total !== undefined && object.total !== null) { + message.total = object.total; + } + if (object.toProvider !== undefined && object.toProvider !== null) { + message.toProvider = object.toProvider; + } + if (object.toConsumer !== undefined && object.toConsumer !== null) { + message.toConsumer = object.toConsumer; + } + return message; + }, + toAmino(message: NextFeeDistributionEstimate, useInterfaces: boolean = false): NextFeeDistributionEstimateAmino { + const obj: any = {}; + obj.currentHeight = message.currentHeight ? message.currentHeight.toString() : undefined; + obj.lastHeight = message.lastHeight ? message.lastHeight.toString() : undefined; + obj.nextHeight = message.nextHeight ? message.nextHeight.toString() : undefined; + obj.distribution_fraction = message.distributionFraction; + obj.total = message.total; + obj.toProvider = message.toProvider; + obj.toConsumer = message.toConsumer; + return obj; + }, + fromAminoMsg(object: NextFeeDistributionEstimateAminoMsg): NextFeeDistributionEstimate { + return NextFeeDistributionEstimate.fromAmino(object.value); + }, + fromProtoMsg(message: NextFeeDistributionEstimateProtoMsg, useInterfaces: boolean = false): NextFeeDistributionEstimate { + return NextFeeDistributionEstimate.decode(message.value, undefined, useInterfaces); + }, + toProto(message: NextFeeDistributionEstimate): Uint8Array { + return NextFeeDistributionEstimate.encode(message).finish(); + }, + toProtoMsg(message: NextFeeDistributionEstimate): NextFeeDistributionEstimateProtoMsg { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.NextFeeDistributionEstimate", + value: NextFeeDistributionEstimate.encode(message).finish() + }; + } +}; +function createBaseQueryNextFeeDistributionEstimateRequest(): QueryNextFeeDistributionEstimateRequest { + return {}; +} +export const QueryNextFeeDistributionEstimateRequest = { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryNextFeeDistributionEstimateRequest", + encode(_: QueryNextFeeDistributionEstimateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryNextFeeDistributionEstimateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextFeeDistributionEstimateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryNextFeeDistributionEstimateRequest { + const message = createBaseQueryNextFeeDistributionEstimateRequest(); + return message; + }, + fromAmino(_: QueryNextFeeDistributionEstimateRequestAmino): QueryNextFeeDistributionEstimateRequest { + const message = createBaseQueryNextFeeDistributionEstimateRequest(); + return message; + }, + toAmino(_: QueryNextFeeDistributionEstimateRequest, useInterfaces: boolean = false): QueryNextFeeDistributionEstimateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryNextFeeDistributionEstimateRequestAminoMsg): QueryNextFeeDistributionEstimateRequest { + return QueryNextFeeDistributionEstimateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryNextFeeDistributionEstimateRequestProtoMsg, useInterfaces: boolean = false): QueryNextFeeDistributionEstimateRequest { + return QueryNextFeeDistributionEstimateRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryNextFeeDistributionEstimateRequest): Uint8Array { + return QueryNextFeeDistributionEstimateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryNextFeeDistributionEstimateRequest): QueryNextFeeDistributionEstimateRequestProtoMsg { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryNextFeeDistributionEstimateRequest", + value: QueryNextFeeDistributionEstimateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryNextFeeDistributionEstimateResponse(): QueryNextFeeDistributionEstimateResponse { + return { + data: undefined + }; +} +export const QueryNextFeeDistributionEstimateResponse = { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryNextFeeDistributionEstimateResponse", + encode(message: QueryNextFeeDistributionEstimateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data !== undefined) { + NextFeeDistributionEstimate.encode(message.data, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryNextFeeDistributionEstimateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextFeeDistributionEstimateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = NextFeeDistributionEstimate.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryNextFeeDistributionEstimateResponse { + const message = createBaseQueryNextFeeDistributionEstimateResponse(); + message.data = object.data !== undefined && object.data !== null ? NextFeeDistributionEstimate.fromPartial(object.data) : undefined; + return message; + }, + fromAmino(object: QueryNextFeeDistributionEstimateResponseAmino): QueryNextFeeDistributionEstimateResponse { + const message = createBaseQueryNextFeeDistributionEstimateResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = NextFeeDistributionEstimate.fromAmino(object.data); + } + return message; + }, + toAmino(message: QueryNextFeeDistributionEstimateResponse, useInterfaces: boolean = false): QueryNextFeeDistributionEstimateResponseAmino { + const obj: any = {}; + obj.data = message.data ? NextFeeDistributionEstimate.toAmino(message.data, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryNextFeeDistributionEstimateResponseAminoMsg): QueryNextFeeDistributionEstimateResponse { + return QueryNextFeeDistributionEstimateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryNextFeeDistributionEstimateResponseProtoMsg, useInterfaces: boolean = false): QueryNextFeeDistributionEstimateResponse { + return QueryNextFeeDistributionEstimateResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryNextFeeDistributionEstimateResponse): Uint8Array { + return QueryNextFeeDistributionEstimateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryNextFeeDistributionEstimateResponse): QueryNextFeeDistributionEstimateResponseProtoMsg { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryNextFeeDistributionEstimateResponse", + value: QueryNextFeeDistributionEstimateResponse.encode(message).finish() + }; + } +}; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest, useInterfaces: boolean = false): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg, useInterfaces: boolean = false): QueryParamsRequest { + return QueryParamsRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: ConsumerParams.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + ConsumerParams.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = ConsumerParams.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? ConsumerParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = ConsumerParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse, useInterfaces: boolean = false): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? ConsumerParams.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg, useInterfaces: boolean = false): QueryParamsResponse { + return QueryParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryProviderInfoRequest(): QueryProviderInfoRequest { + return {}; +} +export const QueryProviderInfoRequest = { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryProviderInfoRequest", + encode(_: QueryProviderInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryProviderInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProviderInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryProviderInfoRequest { + const message = createBaseQueryProviderInfoRequest(); + return message; + }, + fromAmino(_: QueryProviderInfoRequestAmino): QueryProviderInfoRequest { + const message = createBaseQueryProviderInfoRequest(); + return message; + }, + toAmino(_: QueryProviderInfoRequest, useInterfaces: boolean = false): QueryProviderInfoRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryProviderInfoRequestAminoMsg): QueryProviderInfoRequest { + return QueryProviderInfoRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryProviderInfoRequestProtoMsg, useInterfaces: boolean = false): QueryProviderInfoRequest { + return QueryProviderInfoRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryProviderInfoRequest): Uint8Array { + return QueryProviderInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryProviderInfoRequest): QueryProviderInfoRequestProtoMsg { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryProviderInfoRequest", + value: QueryProviderInfoRequest.encode(message).finish() + }; + } +}; +function createBaseQueryProviderInfoResponse(): QueryProviderInfoResponse { + return { + consumer: ChainInfo.fromPartial({}), + provider: ChainInfo.fromPartial({}) + }; +} +export const QueryProviderInfoResponse = { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryProviderInfoResponse", + encode(message: QueryProviderInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.consumer !== undefined) { + ChainInfo.encode(message.consumer, writer.uint32(10).fork()).ldelim(); + } + if (message.provider !== undefined) { + ChainInfo.encode(message.provider, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryProviderInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProviderInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consumer = ChainInfo.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.provider = ChainInfo.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProviderInfoResponse { + const message = createBaseQueryProviderInfoResponse(); + message.consumer = object.consumer !== undefined && object.consumer !== null ? ChainInfo.fromPartial(object.consumer) : undefined; + message.provider = object.provider !== undefined && object.provider !== null ? ChainInfo.fromPartial(object.provider) : undefined; + return message; + }, + fromAmino(object: QueryProviderInfoResponseAmino): QueryProviderInfoResponse { + const message = createBaseQueryProviderInfoResponse(); + if (object.consumer !== undefined && object.consumer !== null) { + message.consumer = ChainInfo.fromAmino(object.consumer); + } + if (object.provider !== undefined && object.provider !== null) { + message.provider = ChainInfo.fromAmino(object.provider); + } + return message; + }, + toAmino(message: QueryProviderInfoResponse, useInterfaces: boolean = false): QueryProviderInfoResponseAmino { + const obj: any = {}; + obj.consumer = message.consumer ? ChainInfo.toAmino(message.consumer, useInterfaces) : undefined; + obj.provider = message.provider ? ChainInfo.toAmino(message.provider, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: QueryProviderInfoResponseAminoMsg): QueryProviderInfoResponse { + return QueryProviderInfoResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryProviderInfoResponseProtoMsg, useInterfaces: boolean = false): QueryProviderInfoResponse { + return QueryProviderInfoResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryProviderInfoResponse): Uint8Array { + return QueryProviderInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryProviderInfoResponse): QueryProviderInfoResponseProtoMsg { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryProviderInfoResponse", + value: QueryProviderInfoResponse.encode(message).finish() + }; + } +}; +function createBaseQueryThrottleStateRequest(): QueryThrottleStateRequest { + return {}; +} +export const QueryThrottleStateRequest = { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryThrottleStateRequest", + encode(_: QueryThrottleStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryThrottleStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryThrottleStateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryThrottleStateRequest { + const message = createBaseQueryThrottleStateRequest(); + return message; + }, + fromAmino(_: QueryThrottleStateRequestAmino): QueryThrottleStateRequest { + const message = createBaseQueryThrottleStateRequest(); + return message; + }, + toAmino(_: QueryThrottleStateRequest, useInterfaces: boolean = false): QueryThrottleStateRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryThrottleStateRequestAminoMsg): QueryThrottleStateRequest { + return QueryThrottleStateRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryThrottleStateRequestProtoMsg, useInterfaces: boolean = false): QueryThrottleStateRequest { + return QueryThrottleStateRequest.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryThrottleStateRequest): Uint8Array { + return QueryThrottleStateRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryThrottleStateRequest): QueryThrottleStateRequestProtoMsg { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryThrottleStateRequest", + value: QueryThrottleStateRequest.encode(message).finish() + }; + } +}; +function createBaseQueryThrottleStateResponse(): QueryThrottleStateResponse { + return { + slashRecord: undefined, + packetDataQueue: [] + }; +} +export const QueryThrottleStateResponse = { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryThrottleStateResponse", + encode(message: QueryThrottleStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.slashRecord !== undefined) { + SlashRecord.encode(message.slashRecord, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.packetDataQueue) { + ConsumerPacketData.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): QueryThrottleStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryThrottleStateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.slashRecord = SlashRecord.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.packetDataQueue.push(ConsumerPacketData.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryThrottleStateResponse { + const message = createBaseQueryThrottleStateResponse(); + message.slashRecord = object.slashRecord !== undefined && object.slashRecord !== null ? SlashRecord.fromPartial(object.slashRecord) : undefined; + message.packetDataQueue = object.packetDataQueue?.map(e => ConsumerPacketData.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryThrottleStateResponseAmino): QueryThrottleStateResponse { + const message = createBaseQueryThrottleStateResponse(); + if (object.slash_record !== undefined && object.slash_record !== null) { + message.slashRecord = SlashRecord.fromAmino(object.slash_record); + } + message.packetDataQueue = object.packet_data_queue?.map(e => ConsumerPacketData.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryThrottleStateResponse, useInterfaces: boolean = false): QueryThrottleStateResponseAmino { + const obj: any = {}; + obj.slash_record = message.slashRecord ? SlashRecord.toAmino(message.slashRecord, useInterfaces) : undefined; + if (message.packetDataQueue) { + obj.packet_data_queue = message.packetDataQueue.map(e => e ? ConsumerPacketData.toAmino(e, useInterfaces) : undefined); + } else { + obj.packet_data_queue = []; + } + return obj; + }, + fromAminoMsg(object: QueryThrottleStateResponseAminoMsg): QueryThrottleStateResponse { + return QueryThrottleStateResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryThrottleStateResponseProtoMsg, useInterfaces: boolean = false): QueryThrottleStateResponse { + return QueryThrottleStateResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: QueryThrottleStateResponse): Uint8Array { + return QueryThrottleStateResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryThrottleStateResponse): QueryThrottleStateResponseProtoMsg { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.QueryThrottleStateResponse", + value: QueryThrottleStateResponse.encode(message).finish() + }; + } +}; +function createBaseChainInfo(): ChainInfo { + return { + chainID: "", + clientID: "", + connectionID: "", + channelID: "" + }; +} +export const ChainInfo = { + typeUrl: "/interchain_security.ccv.consumer.v1.ChainInfo", + encode(message: ChainInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.chainID !== "") { + writer.uint32(10).string(message.chainID); + } + if (message.clientID !== "") { + writer.uint32(18).string(message.clientID); + } + if (message.connectionID !== "") { + writer.uint32(26).string(message.connectionID); + } + if (message.channelID !== "") { + writer.uint32(34).string(message.channelID); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ChainInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseChainInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainID = reader.string(); + break; + case 2: + message.clientID = reader.string(); + break; + case 3: + message.connectionID = reader.string(); + break; + case 4: + message.channelID = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ChainInfo { + const message = createBaseChainInfo(); + message.chainID = object.chainID ?? ""; + message.clientID = object.clientID ?? ""; + message.connectionID = object.connectionID ?? ""; + message.channelID = object.channelID ?? ""; + return message; + }, + fromAmino(object: ChainInfoAmino): ChainInfo { + const message = createBaseChainInfo(); + if (object.chainID !== undefined && object.chainID !== null) { + message.chainID = object.chainID; + } + if (object.clientID !== undefined && object.clientID !== null) { + message.clientID = object.clientID; + } + if (object.connectionID !== undefined && object.connectionID !== null) { + message.connectionID = object.connectionID; + } + if (object.channelID !== undefined && object.channelID !== null) { + message.channelID = object.channelID; + } + return message; + }, + toAmino(message: ChainInfo, useInterfaces: boolean = false): ChainInfoAmino { + const obj: any = {}; + obj.chainID = message.chainID; + obj.clientID = message.clientID; + obj.connectionID = message.connectionID; + obj.channelID = message.channelID; + return obj; + }, + fromAminoMsg(object: ChainInfoAminoMsg): ChainInfo { + return ChainInfo.fromAmino(object.value); + }, + fromProtoMsg(message: ChainInfoProtoMsg, useInterfaces: boolean = false): ChainInfo { + return ChainInfo.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ChainInfo): Uint8Array { + return ChainInfo.encode(message).finish(); + }, + toProtoMsg(message: ChainInfo): ChainInfoProtoMsg { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.ChainInfo", + value: ChainInfo.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/tx.amino.ts b/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/tx.amino.ts new file mode 100644 index 000000000..4d50fe5ca --- /dev/null +++ b/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/tx.amino.ts @@ -0,0 +1,8 @@ +import { MsgUpdateParams } from "./tx"; +export const AminoConverter = { + "/interchain_security.ccv.consumer.v1.MsgUpdateParams": { + aminoType: "/interchain_security.ccv.consumer.v1.MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/tx.registry.ts b/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/tx.registry.ts new file mode 100644 index 000000000..a829f6bb3 --- /dev/null +++ b/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/tx.registry.ts @@ -0,0 +1,35 @@ +//@ts-nocheck +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/interchain_security.ccv.consumer.v1.MsgUpdateParams", MsgUpdateParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.MsgUpdateParams", + value + }; + } + }, + fromPartial: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/tx.rpc.msg.ts b/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/tx.rpc.msg.ts new file mode 100644 index 000000000..e86f139ac --- /dev/null +++ b/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/tx.rpc.msg.ts @@ -0,0 +1,19 @@ +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + updateParams(request: MsgUpdateParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.updateParams = this.updateParams.bind(this); + } + updateParams(request: MsgUpdateParams, useInterfaces: boolean = true): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("interchain_security.ccv.consumer.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data), undefined, useInterfaces)); + } +} \ No newline at end of file diff --git a/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/tx.ts b/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/tx.ts new file mode 100644 index 000000000..0afeaf008 --- /dev/null +++ b/packages/types/protobuf/codegen/interchain_security/ccv/consumer/v1/tx.ts @@ -0,0 +1,166 @@ +//@ts-nocheck +import { ConsumerParams, ConsumerParamsAmino, ConsumerParamsSDKType } from "../../v1/shared_consumer"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** MsgUpdateParams is the Msg/UpdateParams request type */ +export interface MsgUpdateParams { + /** signer is the address of the governance account. */ + authority: string; + /** params defines the x/provider parameters to update. */ + params: ConsumerParams | undefined; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/interchain_security.ccv.consumer.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams is the Msg/UpdateParams request type */ +export interface MsgUpdateParamsAmino { + /** signer is the address of the governance account. */ + authority?: string; + /** params defines the x/provider parameters to update. */ + params?: ConsumerParamsAmino | undefined; +} +export interface MsgUpdateParamsAminoMsg { + type: "/interchain_security.ccv.consumer.v1.MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams is the Msg/UpdateParams request type */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ConsumerParamsSDKType | undefined; +} +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/interchain_security.ccv.consumer.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/interchain_security.ccv.consumer.v1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +export interface MsgUpdateParamsResponseSDKType {} +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: ConsumerParams.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/interchain_security.ccv.consumer.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + ConsumerParams.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = ConsumerParams.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? ConsumerParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = ConsumerParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams, useInterfaces: boolean = false): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority; + obj.params = message.params ? ConsumerParams.toAmino(message.params, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg, useInterfaces: boolean = false): MsgUpdateParams { + return MsgUpdateParams.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/interchain_security.ccv.consumer.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse, useInterfaces: boolean = false): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg, useInterfaces: boolean = false): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value, undefined, useInterfaces); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/interchain_security.ccv.consumer.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/interchain_security/ccv/v1/shared_consumer.ts b/packages/types/protobuf/codegen/interchain_security/ccv/v1/shared_consumer.ts new file mode 100644 index 000000000..0fc7b595d --- /dev/null +++ b/packages/types/protobuf/codegen/interchain_security/ccv/v1/shared_consumer.ts @@ -0,0 +1,630 @@ +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { ClientState, ClientStateAmino, ClientStateSDKType, ConsensusState, ConsensusStateAmino, ConsensusStateSDKType } from "../../../ibc/lightclients/tendermint/v1/tendermint"; +import { ValidatorUpdate, ValidatorUpdateAmino, ValidatorUpdateSDKType } from "../../../tendermint/abci/types"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * ConsumerParams defines the parameters for CCV consumer module. + * + * Note this type is referenced in both the consumer and provider CCV modules, + * and persisted on the provider, see MakeConsumerGenesis and + * SetConsumerGenesis. + */ +export interface ConsumerParams { + /** + * TODO: Remove enabled flag and find a better way to setup integration tests + * See: https://github.com/cosmos/interchain-security/issues/339 + */ + enabled: boolean; + /** + * Distribution Params + * Number of blocks between ibc-token-transfers from the consumer chain to + * the provider chain. Note that at this transmission event a fraction of + * the accumulated tokens are divided and sent consumer redistribution + * address. + */ + blocksPerDistributionTransmission: bigint; + /** + * Channel, and provider-chain receiving address to send distribution token + * transfers over. These parameters is auto-set during the consumer <-> + * provider handshake procedure. + */ + distributionTransmissionChannel: string; + providerFeePoolAddrStr: string; + /** Sent CCV related IBC packets will timeout after this duration */ + ccvTimeoutPeriod: Duration | undefined; + /** Sent transfer related IBC packets will timeout after this duration */ + transferTimeoutPeriod: Duration | undefined; + /** + * The fraction of tokens allocated to the consumer redistribution address + * during distribution events. The fraction is a string representing a + * decimal number. For example "0.75" would represent 75%. + */ + consumerRedistributionFraction: string; + /** + * The number of historical info entries to persist in store. + * This param is a part of the cosmos sdk staking module. In the case of + * a ccv enabled consumer chain, the ccv module acts as the staking module. + */ + historicalEntries: bigint; + /** + * Unbonding period for the consumer, + * which should be smaller than that of the provider in general. + */ + unbondingPeriod: Duration | undefined; + /** !!! DEPRECATED !!! soft_opt_out_threshold is deprecated. see docs/docs/adrs/adr-015-partial-set-security.md */ + /** @deprecated */ + softOptOutThreshold: string; + /** + * Reward denoms. These are the denominations which are allowed to be sent to + * the provider as rewards. + */ + rewardDenoms: string[]; + /** + * Provider-originated reward denoms. These are denoms coming from the + * provider which are allowed to be used as rewards. e.g. "uatom" + */ + providerRewardDenoms: string[]; + /** The period after which a consumer can retry sending a throttled packet. */ + retryDelayPeriod: Duration | undefined; +} +export interface ConsumerParamsProtoMsg { + typeUrl: "/interchain_security.ccv.v1.ConsumerParams"; + value: Uint8Array; +} +/** + * ConsumerParams defines the parameters for CCV consumer module. + * + * Note this type is referenced in both the consumer and provider CCV modules, + * and persisted on the provider, see MakeConsumerGenesis and + * SetConsumerGenesis. + */ +export interface ConsumerParamsAmino { + /** + * TODO: Remove enabled flag and find a better way to setup integration tests + * See: https://github.com/cosmos/interchain-security/issues/339 + */ + enabled?: boolean; + /** + * Distribution Params + * Number of blocks between ibc-token-transfers from the consumer chain to + * the provider chain. Note that at this transmission event a fraction of + * the accumulated tokens are divided and sent consumer redistribution + * address. + */ + blocks_per_distribution_transmission?: string; + /** + * Channel, and provider-chain receiving address to send distribution token + * transfers over. These parameters is auto-set during the consumer <-> + * provider handshake procedure. + */ + distribution_transmission_channel?: string; + provider_fee_pool_addr_str?: string; + /** Sent CCV related IBC packets will timeout after this duration */ + ccv_timeout_period?: DurationAmino | undefined; + /** Sent transfer related IBC packets will timeout after this duration */ + transfer_timeout_period?: DurationAmino | undefined; + /** + * The fraction of tokens allocated to the consumer redistribution address + * during distribution events. The fraction is a string representing a + * decimal number. For example "0.75" would represent 75%. + */ + consumer_redistribution_fraction?: string; + /** + * The number of historical info entries to persist in store. + * This param is a part of the cosmos sdk staking module. In the case of + * a ccv enabled consumer chain, the ccv module acts as the staking module. + */ + historical_entries?: string; + /** + * Unbonding period for the consumer, + * which should be smaller than that of the provider in general. + */ + unbonding_period?: DurationAmino | undefined; + /** !!! DEPRECATED !!! soft_opt_out_threshold is deprecated. see docs/docs/adrs/adr-015-partial-set-security.md */ + /** @deprecated */ + soft_opt_out_threshold?: string; + /** + * Reward denoms. These are the denominations which are allowed to be sent to + * the provider as rewards. + */ + reward_denoms?: string[]; + /** + * Provider-originated reward denoms. These are denoms coming from the + * provider which are allowed to be used as rewards. e.g. "uatom" + */ + provider_reward_denoms?: string[]; + /** The period after which a consumer can retry sending a throttled packet. */ + retry_delay_period?: DurationAmino | undefined; +} +export interface ConsumerParamsAminoMsg { + type: "/interchain_security.ccv.v1.ConsumerParams"; + value: ConsumerParamsAmino; +} +/** + * ConsumerParams defines the parameters for CCV consumer module. + * + * Note this type is referenced in both the consumer and provider CCV modules, + * and persisted on the provider, see MakeConsumerGenesis and + * SetConsumerGenesis. + */ +export interface ConsumerParamsSDKType { + enabled: boolean; + blocks_per_distribution_transmission: bigint; + distribution_transmission_channel: string; + provider_fee_pool_addr_str: string; + ccv_timeout_period: DurationSDKType | undefined; + transfer_timeout_period: DurationSDKType | undefined; + consumer_redistribution_fraction: string; + historical_entries: bigint; + unbonding_period: DurationSDKType | undefined; + /** @deprecated */ + soft_opt_out_threshold: string; + reward_denoms: string[]; + provider_reward_denoms: string[]; + retry_delay_period: DurationSDKType | undefined; +} +/** + * ConsumerGenesisState defines shared genesis information between provider and + * consumer + */ +export interface ConsumerGenesisState { + params: ConsumerParams | undefined; + provider: ProviderInfo | undefined; + /** true for new chain, false for chain restart. */ + newChain: boolean; +} +export interface ConsumerGenesisStateProtoMsg { + typeUrl: "/interchain_security.ccv.v1.ConsumerGenesisState"; + value: Uint8Array; +} +/** + * ConsumerGenesisState defines shared genesis information between provider and + * consumer + */ +export interface ConsumerGenesisStateAmino { + params?: ConsumerParamsAmino | undefined; + provider?: ProviderInfoAmino | undefined; + /** true for new chain, false for chain restart. */ + new_chain?: boolean; +} +export interface ConsumerGenesisStateAminoMsg { + type: "/interchain_security.ccv.v1.ConsumerGenesisState"; + value: ConsumerGenesisStateAmino; +} +/** + * ConsumerGenesisState defines shared genesis information between provider and + * consumer + */ +export interface ConsumerGenesisStateSDKType { + params: ConsumerParamsSDKType | undefined; + provider: ProviderInfoSDKType | undefined; + new_chain: boolean; +} +/** + * ProviderInfo defines all information a consumer needs from a provider + * Shared data type between provider and consumer + */ +export interface ProviderInfo { + /** ProviderClientState filled in on new chain, nil on restart. */ + clientState?: ClientState | undefined; + /** ProviderConsensusState filled in on new chain, nil on restart. */ + consensusState?: ConsensusState | undefined; + /** InitialValset filled in on new chain and on restart. */ + initialValSet: ValidatorUpdate[]; +} +export interface ProviderInfoProtoMsg { + typeUrl: "/interchain_security.ccv.v1.ProviderInfo"; + value: Uint8Array; +} +/** + * ProviderInfo defines all information a consumer needs from a provider + * Shared data type between provider and consumer + */ +export interface ProviderInfoAmino { + /** ProviderClientState filled in on new chain, nil on restart. */ + client_state?: ClientStateAmino | undefined; + /** ProviderConsensusState filled in on new chain, nil on restart. */ + consensus_state?: ConsensusStateAmino | undefined; + /** InitialValset filled in on new chain and on restart. */ + initial_val_set?: ValidatorUpdateAmino[]; +} +export interface ProviderInfoAminoMsg { + type: "/interchain_security.ccv.v1.ProviderInfo"; + value: ProviderInfoAmino; +} +/** + * ProviderInfo defines all information a consumer needs from a provider + * Shared data type between provider and consumer + */ +export interface ProviderInfoSDKType { + client_state?: ClientStateSDKType | undefined; + consensus_state?: ConsensusStateSDKType | undefined; + initial_val_set: ValidatorUpdateSDKType[]; +} +function createBaseConsumerParams(): ConsumerParams { + return { + enabled: false, + blocksPerDistributionTransmission: BigInt(0), + distributionTransmissionChannel: "", + providerFeePoolAddrStr: "", + ccvTimeoutPeriod: Duration.fromPartial({}), + transferTimeoutPeriod: Duration.fromPartial({}), + consumerRedistributionFraction: "", + historicalEntries: BigInt(0), + unbondingPeriod: Duration.fromPartial({}), + softOptOutThreshold: "", + rewardDenoms: [], + providerRewardDenoms: [], + retryDelayPeriod: Duration.fromPartial({}) + }; +} +export const ConsumerParams = { + typeUrl: "/interchain_security.ccv.v1.ConsumerParams", + encode(message: ConsumerParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.enabled === true) { + writer.uint32(8).bool(message.enabled); + } + if (message.blocksPerDistributionTransmission !== BigInt(0)) { + writer.uint32(16).int64(message.blocksPerDistributionTransmission); + } + if (message.distributionTransmissionChannel !== "") { + writer.uint32(26).string(message.distributionTransmissionChannel); + } + if (message.providerFeePoolAddrStr !== "") { + writer.uint32(34).string(message.providerFeePoolAddrStr); + } + if (message.ccvTimeoutPeriod !== undefined) { + Duration.encode(message.ccvTimeoutPeriod, writer.uint32(42).fork()).ldelim(); + } + if (message.transferTimeoutPeriod !== undefined) { + Duration.encode(message.transferTimeoutPeriod, writer.uint32(50).fork()).ldelim(); + } + if (message.consumerRedistributionFraction !== "") { + writer.uint32(58).string(message.consumerRedistributionFraction); + } + if (message.historicalEntries !== BigInt(0)) { + writer.uint32(64).int64(message.historicalEntries); + } + if (message.unbondingPeriod !== undefined) { + Duration.encode(message.unbondingPeriod, writer.uint32(74).fork()).ldelim(); + } + if (message.softOptOutThreshold !== "") { + writer.uint32(82).string(message.softOptOutThreshold); + } + for (const v of message.rewardDenoms) { + writer.uint32(90).string(v!); + } + for (const v of message.providerRewardDenoms) { + writer.uint32(98).string(v!); + } + if (message.retryDelayPeriod !== undefined) { + Duration.encode(message.retryDelayPeriod, writer.uint32(106).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ConsumerParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsumerParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enabled = reader.bool(); + break; + case 2: + message.blocksPerDistributionTransmission = reader.int64(); + break; + case 3: + message.distributionTransmissionChannel = reader.string(); + break; + case 4: + message.providerFeePoolAddrStr = reader.string(); + break; + case 5: + message.ccvTimeoutPeriod = Duration.decode(reader, reader.uint32(), useInterfaces); + break; + case 6: + message.transferTimeoutPeriod = Duration.decode(reader, reader.uint32(), useInterfaces); + break; + case 7: + message.consumerRedistributionFraction = reader.string(); + break; + case 8: + message.historicalEntries = reader.int64(); + break; + case 9: + message.unbondingPeriod = Duration.decode(reader, reader.uint32(), useInterfaces); + break; + case 10: + message.softOptOutThreshold = reader.string(); + break; + case 11: + message.rewardDenoms.push(reader.string()); + break; + case 12: + message.providerRewardDenoms.push(reader.string()); + break; + case 13: + message.retryDelayPeriod = Duration.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConsumerParams { + const message = createBaseConsumerParams(); + message.enabled = object.enabled ?? false; + message.blocksPerDistributionTransmission = object.blocksPerDistributionTransmission !== undefined && object.blocksPerDistributionTransmission !== null ? BigInt(object.blocksPerDistributionTransmission.toString()) : BigInt(0); + message.distributionTransmissionChannel = object.distributionTransmissionChannel ?? ""; + message.providerFeePoolAddrStr = object.providerFeePoolAddrStr ?? ""; + message.ccvTimeoutPeriod = object.ccvTimeoutPeriod !== undefined && object.ccvTimeoutPeriod !== null ? Duration.fromPartial(object.ccvTimeoutPeriod) : undefined; + message.transferTimeoutPeriod = object.transferTimeoutPeriod !== undefined && object.transferTimeoutPeriod !== null ? Duration.fromPartial(object.transferTimeoutPeriod) : undefined; + message.consumerRedistributionFraction = object.consumerRedistributionFraction ?? ""; + message.historicalEntries = object.historicalEntries !== undefined && object.historicalEntries !== null ? BigInt(object.historicalEntries.toString()) : BigInt(0); + message.unbondingPeriod = object.unbondingPeriod !== undefined && object.unbondingPeriod !== null ? Duration.fromPartial(object.unbondingPeriod) : undefined; + message.softOptOutThreshold = object.softOptOutThreshold ?? ""; + message.rewardDenoms = object.rewardDenoms?.map(e => e) || []; + message.providerRewardDenoms = object.providerRewardDenoms?.map(e => e) || []; + message.retryDelayPeriod = object.retryDelayPeriod !== undefined && object.retryDelayPeriod !== null ? Duration.fromPartial(object.retryDelayPeriod) : undefined; + return message; + }, + fromAmino(object: ConsumerParamsAmino): ConsumerParams { + const message = createBaseConsumerParams(); + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } + if (object.blocks_per_distribution_transmission !== undefined && object.blocks_per_distribution_transmission !== null) { + message.blocksPerDistributionTransmission = BigInt(object.blocks_per_distribution_transmission); + } + if (object.distribution_transmission_channel !== undefined && object.distribution_transmission_channel !== null) { + message.distributionTransmissionChannel = object.distribution_transmission_channel; + } + if (object.provider_fee_pool_addr_str !== undefined && object.provider_fee_pool_addr_str !== null) { + message.providerFeePoolAddrStr = object.provider_fee_pool_addr_str; + } + if (object.ccv_timeout_period !== undefined && object.ccv_timeout_period !== null) { + message.ccvTimeoutPeriod = Duration.fromAmino(object.ccv_timeout_period); + } + if (object.transfer_timeout_period !== undefined && object.transfer_timeout_period !== null) { + message.transferTimeoutPeriod = Duration.fromAmino(object.transfer_timeout_period); + } + if (object.consumer_redistribution_fraction !== undefined && object.consumer_redistribution_fraction !== null) { + message.consumerRedistributionFraction = object.consumer_redistribution_fraction; + } + if (object.historical_entries !== undefined && object.historical_entries !== null) { + message.historicalEntries = BigInt(object.historical_entries); + } + if (object.unbonding_period !== undefined && object.unbonding_period !== null) { + message.unbondingPeriod = Duration.fromAmino(object.unbonding_period); + } + if (object.soft_opt_out_threshold !== undefined && object.soft_opt_out_threshold !== null) { + message.softOptOutThreshold = object.soft_opt_out_threshold; + } + message.rewardDenoms = object.reward_denoms?.map(e => e) || []; + message.providerRewardDenoms = object.provider_reward_denoms?.map(e => e) || []; + if (object.retry_delay_period !== undefined && object.retry_delay_period !== null) { + message.retryDelayPeriod = Duration.fromAmino(object.retry_delay_period); + } + return message; + }, + toAmino(message: ConsumerParams, useInterfaces: boolean = false): ConsumerParamsAmino { + const obj: any = {}; + obj.enabled = message.enabled; + obj.blocks_per_distribution_transmission = message.blocksPerDistributionTransmission ? message.blocksPerDistributionTransmission.toString() : undefined; + obj.distribution_transmission_channel = message.distributionTransmissionChannel; + obj.provider_fee_pool_addr_str = message.providerFeePoolAddrStr; + obj.ccv_timeout_period = message.ccvTimeoutPeriod ? Duration.toAmino(message.ccvTimeoutPeriod, useInterfaces) : undefined; + obj.transfer_timeout_period = message.transferTimeoutPeriod ? Duration.toAmino(message.transferTimeoutPeriod, useInterfaces) : undefined; + obj.consumer_redistribution_fraction = message.consumerRedistributionFraction; + obj.historical_entries = message.historicalEntries ? message.historicalEntries.toString() : undefined; + obj.unbonding_period = message.unbondingPeriod ? Duration.toAmino(message.unbondingPeriod, useInterfaces) : undefined; + obj.soft_opt_out_threshold = message.softOptOutThreshold; + if (message.rewardDenoms) { + obj.reward_denoms = message.rewardDenoms.map(e => e); + } else { + obj.reward_denoms = []; + } + if (message.providerRewardDenoms) { + obj.provider_reward_denoms = message.providerRewardDenoms.map(e => e); + } else { + obj.provider_reward_denoms = []; + } + obj.retry_delay_period = message.retryDelayPeriod ? Duration.toAmino(message.retryDelayPeriod, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: ConsumerParamsAminoMsg): ConsumerParams { + return ConsumerParams.fromAmino(object.value); + }, + fromProtoMsg(message: ConsumerParamsProtoMsg, useInterfaces: boolean = false): ConsumerParams { + return ConsumerParams.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ConsumerParams): Uint8Array { + return ConsumerParams.encode(message).finish(); + }, + toProtoMsg(message: ConsumerParams): ConsumerParamsProtoMsg { + return { + typeUrl: "/interchain_security.ccv.v1.ConsumerParams", + value: ConsumerParams.encode(message).finish() + }; + } +}; +function createBaseConsumerGenesisState(): ConsumerGenesisState { + return { + params: ConsumerParams.fromPartial({}), + provider: ProviderInfo.fromPartial({}), + newChain: false + }; +} +export const ConsumerGenesisState = { + typeUrl: "/interchain_security.ccv.v1.ConsumerGenesisState", + encode(message: ConsumerGenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + ConsumerParams.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + if (message.provider !== undefined) { + ProviderInfo.encode(message.provider, writer.uint32(18).fork()).ldelim(); + } + if (message.newChain === true) { + writer.uint32(24).bool(message.newChain); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ConsumerGenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsumerGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = ConsumerParams.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.provider = ProviderInfo.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.newChain = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConsumerGenesisState { + const message = createBaseConsumerGenesisState(); + message.params = object.params !== undefined && object.params !== null ? ConsumerParams.fromPartial(object.params) : undefined; + message.provider = object.provider !== undefined && object.provider !== null ? ProviderInfo.fromPartial(object.provider) : undefined; + message.newChain = object.newChain ?? false; + return message; + }, + fromAmino(object: ConsumerGenesisStateAmino): ConsumerGenesisState { + const message = createBaseConsumerGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = ConsumerParams.fromAmino(object.params); + } + if (object.provider !== undefined && object.provider !== null) { + message.provider = ProviderInfo.fromAmino(object.provider); + } + if (object.new_chain !== undefined && object.new_chain !== null) { + message.newChain = object.new_chain; + } + return message; + }, + toAmino(message: ConsumerGenesisState, useInterfaces: boolean = false): ConsumerGenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? ConsumerParams.toAmino(message.params, useInterfaces) : undefined; + obj.provider = message.provider ? ProviderInfo.toAmino(message.provider, useInterfaces) : undefined; + obj.new_chain = message.newChain; + return obj; + }, + fromAminoMsg(object: ConsumerGenesisStateAminoMsg): ConsumerGenesisState { + return ConsumerGenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: ConsumerGenesisStateProtoMsg, useInterfaces: boolean = false): ConsumerGenesisState { + return ConsumerGenesisState.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ConsumerGenesisState): Uint8Array { + return ConsumerGenesisState.encode(message).finish(); + }, + toProtoMsg(message: ConsumerGenesisState): ConsumerGenesisStateProtoMsg { + return { + typeUrl: "/interchain_security.ccv.v1.ConsumerGenesisState", + value: ConsumerGenesisState.encode(message).finish() + }; + } +}; +function createBaseProviderInfo(): ProviderInfo { + return { + clientState: undefined, + consensusState: undefined, + initialValSet: [] + }; +} +export const ProviderInfo = { + typeUrl: "/interchain_security.ccv.v1.ProviderInfo", + encode(message: ProviderInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientState !== undefined) { + ClientState.encode(message.clientState, writer.uint32(10).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + ConsensusState.encode(message.consensusState, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.initialValSet) { + ValidatorUpdate.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ProviderInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProviderInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientState = ClientState.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.consensusState = ConsensusState.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.initialValSet.push(ValidatorUpdate.decode(reader, reader.uint32(), useInterfaces)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ProviderInfo { + const message = createBaseProviderInfo(); + message.clientState = object.clientState !== undefined && object.clientState !== null ? ClientState.fromPartial(object.clientState) : undefined; + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? ConsensusState.fromPartial(object.consensusState) : undefined; + message.initialValSet = object.initialValSet?.map(e => ValidatorUpdate.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ProviderInfoAmino): ProviderInfo { + const message = createBaseProviderInfo(); + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = ClientState.fromAmino(object.client_state); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = ConsensusState.fromAmino(object.consensus_state); + } + message.initialValSet = object.initial_val_set?.map(e => ValidatorUpdate.fromAmino(e)) || []; + return message; + }, + toAmino(message: ProviderInfo, useInterfaces: boolean = false): ProviderInfoAmino { + const obj: any = {}; + obj.client_state = message.clientState ? ClientState.toAmino(message.clientState, useInterfaces) : undefined; + obj.consensus_state = message.consensusState ? ConsensusState.toAmino(message.consensusState, useInterfaces) : undefined; + if (message.initialValSet) { + obj.initial_val_set = message.initialValSet.map(e => e ? ValidatorUpdate.toAmino(e, useInterfaces) : undefined); + } else { + obj.initial_val_set = []; + } + return obj; + }, + fromAminoMsg(object: ProviderInfoAminoMsg): ProviderInfo { + return ProviderInfo.fromAmino(object.value); + }, + fromProtoMsg(message: ProviderInfoProtoMsg, useInterfaces: boolean = false): ProviderInfo { + return ProviderInfo.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ProviderInfo): Uint8Array { + return ProviderInfo.encode(message).finish(); + }, + toProtoMsg(message: ProviderInfo): ProviderInfoProtoMsg { + return { + typeUrl: "/interchain_security.ccv.v1.ProviderInfo", + value: ProviderInfo.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/interchain_security/ccv/v1/wire.ts b/packages/types/protobuf/codegen/interchain_security/ccv/v1/wire.ts new file mode 100644 index 000000000..cc5f28421 --- /dev/null +++ b/packages/types/protobuf/codegen/interchain_security/ccv/v1/wire.ts @@ -0,0 +1,916 @@ +import { ValidatorUpdate, ValidatorUpdateAmino, ValidatorUpdateSDKType, Validator, ValidatorAmino, ValidatorSDKType } from "../../../tendermint/abci/types"; +import { Infraction, infractionFromJSON } from "../../../cosmos/staking/v1beta1/staking"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** ConsumerPacketType indicates interchain security specific packet types. */ +export enum ConsumerPacketDataType { + /** CONSUMER_PACKET_TYPE_UNSPECIFIED - UNSPECIFIED packet type */ + CONSUMER_PACKET_TYPE_UNSPECIFIED = 0, + /** CONSUMER_PACKET_TYPE_SLASH - Slash packet */ + CONSUMER_PACKET_TYPE_SLASH = 1, + /** CONSUMER_PACKET_TYPE_VSCM - VSCMatured packet */ + CONSUMER_PACKET_TYPE_VSCM = 2, + UNRECOGNIZED = -1, +} +export const ConsumerPacketDataTypeSDKType = ConsumerPacketDataType; +export const ConsumerPacketDataTypeAmino = ConsumerPacketDataType; +export function consumerPacketDataTypeFromJSON(object: any): ConsumerPacketDataType { + switch (object) { + case 0: + case "CONSUMER_PACKET_TYPE_UNSPECIFIED": + return ConsumerPacketDataType.CONSUMER_PACKET_TYPE_UNSPECIFIED; + case 1: + case "CONSUMER_PACKET_TYPE_SLASH": + return ConsumerPacketDataType.CONSUMER_PACKET_TYPE_SLASH; + case 2: + case "CONSUMER_PACKET_TYPE_VSCM": + return ConsumerPacketDataType.CONSUMER_PACKET_TYPE_VSCM; + case -1: + case "UNRECOGNIZED": + default: + return ConsumerPacketDataType.UNRECOGNIZED; + } +} +export function consumerPacketDataTypeToJSON(object: ConsumerPacketDataType): string { + switch (object) { + case ConsumerPacketDataType.CONSUMER_PACKET_TYPE_UNSPECIFIED: + return "CONSUMER_PACKET_TYPE_UNSPECIFIED"; + case ConsumerPacketDataType.CONSUMER_PACKET_TYPE_SLASH: + return "CONSUMER_PACKET_TYPE_SLASH"; + case ConsumerPacketDataType.CONSUMER_PACKET_TYPE_VSCM: + return "CONSUMER_PACKET_TYPE_VSCM"; + case ConsumerPacketDataType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * InfractionType indicates the infraction type a validator committed. + * Note ccv.InfractionType to maintain compatibility between ICS versions + * using different versions of the cosmos-sdk and ibc-go modules. + */ +export enum InfractionType { + /** INFRACTION_TYPE_UNSPECIFIED - UNSPECIFIED defines an empty infraction type. */ + INFRACTION_TYPE_UNSPECIFIED = 0, + /** INFRACTION_TYPE_DOUBLE_SIGN - DOUBLE_SIGN defines a validator that double-signs a block. */ + INFRACTION_TYPE_DOUBLE_SIGN = 1, + /** INFRACTION_TYPE_DOWNTIME - DOWNTIME defines a validator that missed signing too many blocks. */ + INFRACTION_TYPE_DOWNTIME = 2, + UNRECOGNIZED = -1, +} +export const InfractionTypeSDKType = InfractionType; +export const InfractionTypeAmino = InfractionType; +export function infractionTypeFromJSON(object: any): InfractionType { + switch (object) { + case 0: + case "INFRACTION_TYPE_UNSPECIFIED": + return InfractionType.INFRACTION_TYPE_UNSPECIFIED; + case 1: + case "INFRACTION_TYPE_DOUBLE_SIGN": + return InfractionType.INFRACTION_TYPE_DOUBLE_SIGN; + case 2: + case "INFRACTION_TYPE_DOWNTIME": + return InfractionType.INFRACTION_TYPE_DOWNTIME; + case -1: + case "UNRECOGNIZED": + default: + return InfractionType.UNRECOGNIZED; + } +} +export function infractionTypeToJSON(object: InfractionType): string { + switch (object) { + case InfractionType.INFRACTION_TYPE_UNSPECIFIED: + return "INFRACTION_TYPE_UNSPECIFIED"; + case InfractionType.INFRACTION_TYPE_DOUBLE_SIGN: + return "INFRACTION_TYPE_DOUBLE_SIGN"; + case InfractionType.INFRACTION_TYPE_DOWNTIME: + return "INFRACTION_TYPE_DOWNTIME"; + case InfractionType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * This packet is sent from provider chain to consumer chain if the validator + * set for consumer chain changes (due to new bonding/unbonding messages or + * slashing events) A VSCMatured packet from consumer chain will be sent + * asynchronously once unbonding period is over, and this will function as + * `UnbondingOver` message for this packet. + */ +export interface ValidatorSetChangePacketData { + validatorUpdates: ValidatorUpdate[]; + valsetUpdateId: bigint; + /** + * consensus address of consumer chain validators + * successfully slashed on the provider chain + */ + slashAcks: string[]; +} +export interface ValidatorSetChangePacketDataProtoMsg { + typeUrl: "/interchain_security.ccv.v1.ValidatorSetChangePacketData"; + value: Uint8Array; +} +/** + * This packet is sent from provider chain to consumer chain if the validator + * set for consumer chain changes (due to new bonding/unbonding messages or + * slashing events) A VSCMatured packet from consumer chain will be sent + * asynchronously once unbonding period is over, and this will function as + * `UnbondingOver` message for this packet. + */ +export interface ValidatorSetChangePacketDataAmino { + validator_updates?: ValidatorUpdateAmino[]; + valset_update_id?: string; + /** + * consensus address of consumer chain validators + * successfully slashed on the provider chain + */ + slash_acks?: string[]; +} +export interface ValidatorSetChangePacketDataAminoMsg { + type: "/interchain_security.ccv.v1.ValidatorSetChangePacketData"; + value: ValidatorSetChangePacketDataAmino; +} +/** + * This packet is sent from provider chain to consumer chain if the validator + * set for consumer chain changes (due to new bonding/unbonding messages or + * slashing events) A VSCMatured packet from consumer chain will be sent + * asynchronously once unbonding period is over, and this will function as + * `UnbondingOver` message for this packet. + */ +export interface ValidatorSetChangePacketDataSDKType { + validator_updates: ValidatorUpdateSDKType[]; + valset_update_id: bigint; + slash_acks: string[]; +} +/** + * This packet is sent from the consumer chain to the provider chain + * to notify that a VSC packet reached maturity on the consumer chain. + */ +export interface VSCMaturedPacketData { + /** the id of the VSC packet that reached maturity */ + valsetUpdateId: bigint; +} +export interface VSCMaturedPacketDataProtoMsg { + typeUrl: "/interchain_security.ccv.v1.VSCMaturedPacketData"; + value: Uint8Array; +} +/** + * This packet is sent from the consumer chain to the provider chain + * to notify that a VSC packet reached maturity on the consumer chain. + */ +export interface VSCMaturedPacketDataAmino { + /** the id of the VSC packet that reached maturity */ + valset_update_id?: string; +} +export interface VSCMaturedPacketDataAminoMsg { + type: "/interchain_security.ccv.v1.VSCMaturedPacketData"; + value: VSCMaturedPacketDataAmino; +} +/** + * This packet is sent from the consumer chain to the provider chain + * to notify that a VSC packet reached maturity on the consumer chain. + */ +export interface VSCMaturedPacketDataSDKType { + valset_update_id: bigint; +} +/** + * This packet is sent from the consumer chain to the provider chain + * to request the slashing of a validator as a result of an infraction + * committed on the consumer chain. + */ +export interface SlashPacketData { + validator: Validator | undefined; + /** map to the infraction block height on the provider */ + valsetUpdateId: bigint; + /** tell if the slashing is for a downtime or a double-signing infraction */ + infraction: Infraction; +} +export interface SlashPacketDataProtoMsg { + typeUrl: "/interchain_security.ccv.v1.SlashPacketData"; + value: Uint8Array; +} +/** + * This packet is sent from the consumer chain to the provider chain + * to request the slashing of a validator as a result of an infraction + * committed on the consumer chain. + */ +export interface SlashPacketDataAmino { + validator?: ValidatorAmino | undefined; + /** map to the infraction block height on the provider */ + valset_update_id?: string; + /** tell if the slashing is for a downtime or a double-signing infraction */ + infraction?: Infraction; +} +export interface SlashPacketDataAminoMsg { + type: "/interchain_security.ccv.v1.SlashPacketData"; + value: SlashPacketDataAmino; +} +/** + * This packet is sent from the consumer chain to the provider chain + * to request the slashing of a validator as a result of an infraction + * committed on the consumer chain. + */ +export interface SlashPacketDataSDKType { + validator: ValidatorSDKType | undefined; + valset_update_id: bigint; + infraction: Infraction; +} +/** ConsumerPacketData contains a consumer packet data and a type tag */ +export interface ConsumerPacketData { + type: ConsumerPacketDataType; + slashPacketData?: SlashPacketData | undefined; + vscMaturedPacketData?: VSCMaturedPacketData | undefined; +} +export interface ConsumerPacketDataProtoMsg { + typeUrl: "/interchain_security.ccv.v1.ConsumerPacketData"; + value: Uint8Array; +} +/** ConsumerPacketData contains a consumer packet data and a type tag */ +export interface ConsumerPacketDataAmino { + type?: ConsumerPacketDataType; + slashPacketData?: SlashPacketDataAmino | undefined; + vscMaturedPacketData?: VSCMaturedPacketDataAmino | undefined; +} +export interface ConsumerPacketDataAminoMsg { + type: "/interchain_security.ccv.v1.ConsumerPacketData"; + value: ConsumerPacketDataAmino; +} +/** ConsumerPacketData contains a consumer packet data and a type tag */ +export interface ConsumerPacketDataSDKType { + type: ConsumerPacketDataType; + slashPacketData?: SlashPacketDataSDKType | undefined; + vscMaturedPacketData?: VSCMaturedPacketDataSDKType | undefined; +} +/** Note this type is used during IBC handshake methods for both the consumer and provider */ +export interface HandshakeMetadata { + providerFeePoolAddr: string; + version: string; +} +export interface HandshakeMetadataProtoMsg { + typeUrl: "/interchain_security.ccv.v1.HandshakeMetadata"; + value: Uint8Array; +} +/** Note this type is used during IBC handshake methods for both the consumer and provider */ +export interface HandshakeMetadataAmino { + provider_fee_pool_addr?: string; + version?: string; +} +export interface HandshakeMetadataAminoMsg { + type: "/interchain_security.ccv.v1.HandshakeMetadata"; + value: HandshakeMetadataAmino; +} +/** Note this type is used during IBC handshake methods for both the consumer and provider */ +export interface HandshakeMetadataSDKType { + provider_fee_pool_addr: string; + version: string; +} +/** + * ConsumerPacketData contains a consumer packet data and a type tag + * that is compatible with ICS v1 and v2 over the wire. It is not used for internal storage. + */ +export interface ConsumerPacketDataV1 { + type: ConsumerPacketDataType; + slashPacketData?: SlashPacketDataV1 | undefined; + vscMaturedPacketData?: VSCMaturedPacketData | undefined; +} +export interface ConsumerPacketDataV1ProtoMsg { + typeUrl: "/interchain_security.ccv.v1.ConsumerPacketDataV1"; + value: Uint8Array; +} +/** + * ConsumerPacketData contains a consumer packet data and a type tag + * that is compatible with ICS v1 and v2 over the wire. It is not used for internal storage. + */ +export interface ConsumerPacketDataV1Amino { + type?: ConsumerPacketDataType; + slashPacketData?: SlashPacketDataV1Amino | undefined; + vscMaturedPacketData?: VSCMaturedPacketDataAmino | undefined; +} +export interface ConsumerPacketDataV1AminoMsg { + type: "/interchain_security.ccv.v1.ConsumerPacketDataV1"; + value: ConsumerPacketDataV1Amino; +} +/** + * ConsumerPacketData contains a consumer packet data and a type tag + * that is compatible with ICS v1 and v2 over the wire. It is not used for internal storage. + */ +export interface ConsumerPacketDataV1SDKType { + type: ConsumerPacketDataType; + slashPacketData?: SlashPacketDataV1SDKType | undefined; + vscMaturedPacketData?: VSCMaturedPacketDataSDKType | undefined; +} +/** + * This packet is sent from the consumer chain to the provider chain + * It is backward compatible with the ICS v1 and v2 version of the packet. + */ +export interface SlashPacketDataV1 { + validator: Validator | undefined; + /** map to the infraction block height on the provider */ + valsetUpdateId: bigint; + /** tell if the slashing is for a downtime or a double-signing infraction */ + infraction: InfractionType; +} +export interface SlashPacketDataV1ProtoMsg { + typeUrl: "/interchain_security.ccv.v1.SlashPacketDataV1"; + value: Uint8Array; +} +/** + * This packet is sent from the consumer chain to the provider chain + * It is backward compatible with the ICS v1 and v2 version of the packet. + */ +export interface SlashPacketDataV1Amino { + validator?: ValidatorAmino | undefined; + /** map to the infraction block height on the provider */ + valset_update_id?: string; + /** tell if the slashing is for a downtime or a double-signing infraction */ + infraction?: InfractionType; +} +export interface SlashPacketDataV1AminoMsg { + type: "/interchain_security.ccv.v1.SlashPacketDataV1"; + value: SlashPacketDataV1Amino; +} +/** + * This packet is sent from the consumer chain to the provider chain + * It is backward compatible with the ICS v1 and v2 version of the packet. + */ +export interface SlashPacketDataV1SDKType { + validator: ValidatorSDKType | undefined; + valset_update_id: bigint; + infraction: InfractionType; +} +function createBaseValidatorSetChangePacketData(): ValidatorSetChangePacketData { + return { + validatorUpdates: [], + valsetUpdateId: BigInt(0), + slashAcks: [] + }; +} +export const ValidatorSetChangePacketData = { + typeUrl: "/interchain_security.ccv.v1.ValidatorSetChangePacketData", + encode(message: ValidatorSetChangePacketData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.validatorUpdates) { + ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.valsetUpdateId !== BigInt(0)) { + writer.uint32(16).uint64(message.valsetUpdateId); + } + for (const v of message.slashAcks) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ValidatorSetChangePacketData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidatorSetChangePacketData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorUpdates.push(ValidatorUpdate.decode(reader, reader.uint32(), useInterfaces)); + break; + case 2: + message.valsetUpdateId = reader.uint64(); + break; + case 3: + message.slashAcks.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ValidatorSetChangePacketData { + const message = createBaseValidatorSetChangePacketData(); + message.validatorUpdates = object.validatorUpdates?.map(e => ValidatorUpdate.fromPartial(e)) || []; + message.valsetUpdateId = object.valsetUpdateId !== undefined && object.valsetUpdateId !== null ? BigInt(object.valsetUpdateId.toString()) : BigInt(0); + message.slashAcks = object.slashAcks?.map(e => e) || []; + return message; + }, + fromAmino(object: ValidatorSetChangePacketDataAmino): ValidatorSetChangePacketData { + const message = createBaseValidatorSetChangePacketData(); + message.validatorUpdates = object.validator_updates?.map(e => ValidatorUpdate.fromAmino(e)) || []; + if (object.valset_update_id !== undefined && object.valset_update_id !== null) { + message.valsetUpdateId = BigInt(object.valset_update_id); + } + message.slashAcks = object.slash_acks?.map(e => e) || []; + return message; + }, + toAmino(message: ValidatorSetChangePacketData, useInterfaces: boolean = false): ValidatorSetChangePacketDataAmino { + const obj: any = {}; + if (message.validatorUpdates) { + obj.validator_updates = message.validatorUpdates.map(e => e ? ValidatorUpdate.toAmino(e, useInterfaces) : undefined); + } else { + obj.validator_updates = []; + } + obj.valset_update_id = message.valsetUpdateId ? message.valsetUpdateId.toString() : undefined; + if (message.slashAcks) { + obj.slash_acks = message.slashAcks.map(e => e); + } else { + obj.slash_acks = []; + } + return obj; + }, + fromAminoMsg(object: ValidatorSetChangePacketDataAminoMsg): ValidatorSetChangePacketData { + return ValidatorSetChangePacketData.fromAmino(object.value); + }, + fromProtoMsg(message: ValidatorSetChangePacketDataProtoMsg, useInterfaces: boolean = false): ValidatorSetChangePacketData { + return ValidatorSetChangePacketData.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ValidatorSetChangePacketData): Uint8Array { + return ValidatorSetChangePacketData.encode(message).finish(); + }, + toProtoMsg(message: ValidatorSetChangePacketData): ValidatorSetChangePacketDataProtoMsg { + return { + typeUrl: "/interchain_security.ccv.v1.ValidatorSetChangePacketData", + value: ValidatorSetChangePacketData.encode(message).finish() + }; + } +}; +function createBaseVSCMaturedPacketData(): VSCMaturedPacketData { + return { + valsetUpdateId: BigInt(0) + }; +} +export const VSCMaturedPacketData = { + typeUrl: "/interchain_security.ccv.v1.VSCMaturedPacketData", + encode(message: VSCMaturedPacketData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.valsetUpdateId !== BigInt(0)) { + writer.uint32(8).uint64(message.valsetUpdateId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): VSCMaturedPacketData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVSCMaturedPacketData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.valsetUpdateId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): VSCMaturedPacketData { + const message = createBaseVSCMaturedPacketData(); + message.valsetUpdateId = object.valsetUpdateId !== undefined && object.valsetUpdateId !== null ? BigInt(object.valsetUpdateId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: VSCMaturedPacketDataAmino): VSCMaturedPacketData { + const message = createBaseVSCMaturedPacketData(); + if (object.valset_update_id !== undefined && object.valset_update_id !== null) { + message.valsetUpdateId = BigInt(object.valset_update_id); + } + return message; + }, + toAmino(message: VSCMaturedPacketData, useInterfaces: boolean = false): VSCMaturedPacketDataAmino { + const obj: any = {}; + obj.valset_update_id = message.valsetUpdateId ? message.valsetUpdateId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: VSCMaturedPacketDataAminoMsg): VSCMaturedPacketData { + return VSCMaturedPacketData.fromAmino(object.value); + }, + fromProtoMsg(message: VSCMaturedPacketDataProtoMsg, useInterfaces: boolean = false): VSCMaturedPacketData { + return VSCMaturedPacketData.decode(message.value, undefined, useInterfaces); + }, + toProto(message: VSCMaturedPacketData): Uint8Array { + return VSCMaturedPacketData.encode(message).finish(); + }, + toProtoMsg(message: VSCMaturedPacketData): VSCMaturedPacketDataProtoMsg { + return { + typeUrl: "/interchain_security.ccv.v1.VSCMaturedPacketData", + value: VSCMaturedPacketData.encode(message).finish() + }; + } +}; +function createBaseSlashPacketData(): SlashPacketData { + return { + validator: Validator.fromPartial({}), + valsetUpdateId: BigInt(0), + infraction: 0 + }; +} +export const SlashPacketData = { + typeUrl: "/interchain_security.ccv.v1.SlashPacketData", + encode(message: SlashPacketData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + } + if (message.valsetUpdateId !== BigInt(0)) { + writer.uint32(16).uint64(message.valsetUpdateId); + } + if (message.infraction !== 0) { + writer.uint32(24).int32(message.infraction); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): SlashPacketData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSlashPacketData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.valsetUpdateId = reader.uint64(); + break; + case 3: + message.infraction = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SlashPacketData { + const message = createBaseSlashPacketData(); + message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; + message.valsetUpdateId = object.valsetUpdateId !== undefined && object.valsetUpdateId !== null ? BigInt(object.valsetUpdateId.toString()) : BigInt(0); + message.infraction = object.infraction ?? 0; + return message; + }, + fromAmino(object: SlashPacketDataAmino): SlashPacketData { + const message = createBaseSlashPacketData(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + if (object.valset_update_id !== undefined && object.valset_update_id !== null) { + message.valsetUpdateId = BigInt(object.valset_update_id); + } + if (object.infraction !== undefined && object.infraction !== null) { + message.infraction = infractionFromJSON(object.infraction); + } + return message; + }, + toAmino(message: SlashPacketData, useInterfaces: boolean = false): SlashPacketDataAmino { + const obj: any = {}; + obj.validator = message.validator ? Validator.toAmino(message.validator, useInterfaces) : undefined; + obj.valset_update_id = message.valsetUpdateId ? message.valsetUpdateId.toString() : undefined; + obj.infraction = message.infraction; + return obj; + }, + fromAminoMsg(object: SlashPacketDataAminoMsg): SlashPacketData { + return SlashPacketData.fromAmino(object.value); + }, + fromProtoMsg(message: SlashPacketDataProtoMsg, useInterfaces: boolean = false): SlashPacketData { + return SlashPacketData.decode(message.value, undefined, useInterfaces); + }, + toProto(message: SlashPacketData): Uint8Array { + return SlashPacketData.encode(message).finish(); + }, + toProtoMsg(message: SlashPacketData): SlashPacketDataProtoMsg { + return { + typeUrl: "/interchain_security.ccv.v1.SlashPacketData", + value: SlashPacketData.encode(message).finish() + }; + } +}; +function createBaseConsumerPacketData(): ConsumerPacketData { + return { + type: 0, + slashPacketData: undefined, + vscMaturedPacketData: undefined + }; +} +export const ConsumerPacketData = { + typeUrl: "/interchain_security.ccv.v1.ConsumerPacketData", + encode(message: ConsumerPacketData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (message.slashPacketData !== undefined) { + SlashPacketData.encode(message.slashPacketData, writer.uint32(18).fork()).ldelim(); + } + if (message.vscMaturedPacketData !== undefined) { + VSCMaturedPacketData.encode(message.vscMaturedPacketData, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ConsumerPacketData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsumerPacketData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = (reader.int32() as any); + break; + case 2: + message.slashPacketData = SlashPacketData.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.vscMaturedPacketData = VSCMaturedPacketData.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConsumerPacketData { + const message = createBaseConsumerPacketData(); + message.type = object.type ?? 0; + message.slashPacketData = object.slashPacketData !== undefined && object.slashPacketData !== null ? SlashPacketData.fromPartial(object.slashPacketData) : undefined; + message.vscMaturedPacketData = object.vscMaturedPacketData !== undefined && object.vscMaturedPacketData !== null ? VSCMaturedPacketData.fromPartial(object.vscMaturedPacketData) : undefined; + return message; + }, + fromAmino(object: ConsumerPacketDataAmino): ConsumerPacketData { + const message = createBaseConsumerPacketData(); + if (object.type !== undefined && object.type !== null) { + message.type = consumerPacketDataTypeFromJSON(object.type); + } + if (object.slashPacketData !== undefined && object.slashPacketData !== null) { + message.slashPacketData = SlashPacketData.fromAmino(object.slashPacketData); + } + if (object.vscMaturedPacketData !== undefined && object.vscMaturedPacketData !== null) { + message.vscMaturedPacketData = VSCMaturedPacketData.fromAmino(object.vscMaturedPacketData); + } + return message; + }, + toAmino(message: ConsumerPacketData, useInterfaces: boolean = false): ConsumerPacketDataAmino { + const obj: any = {}; + obj.type = message.type; + obj.slashPacketData = message.slashPacketData ? SlashPacketData.toAmino(message.slashPacketData, useInterfaces) : undefined; + obj.vscMaturedPacketData = message.vscMaturedPacketData ? VSCMaturedPacketData.toAmino(message.vscMaturedPacketData, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: ConsumerPacketDataAminoMsg): ConsumerPacketData { + return ConsumerPacketData.fromAmino(object.value); + }, + fromProtoMsg(message: ConsumerPacketDataProtoMsg, useInterfaces: boolean = false): ConsumerPacketData { + return ConsumerPacketData.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ConsumerPacketData): Uint8Array { + return ConsumerPacketData.encode(message).finish(); + }, + toProtoMsg(message: ConsumerPacketData): ConsumerPacketDataProtoMsg { + return { + typeUrl: "/interchain_security.ccv.v1.ConsumerPacketData", + value: ConsumerPacketData.encode(message).finish() + }; + } +}; +function createBaseHandshakeMetadata(): HandshakeMetadata { + return { + providerFeePoolAddr: "", + version: "" + }; +} +export const HandshakeMetadata = { + typeUrl: "/interchain_security.ccv.v1.HandshakeMetadata", + encode(message: HandshakeMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.providerFeePoolAddr !== "") { + writer.uint32(10).string(message.providerFeePoolAddr); + } + if (message.version !== "") { + writer.uint32(18).string(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): HandshakeMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHandshakeMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.providerFeePoolAddr = reader.string(); + break; + case 2: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): HandshakeMetadata { + const message = createBaseHandshakeMetadata(); + message.providerFeePoolAddr = object.providerFeePoolAddr ?? ""; + message.version = object.version ?? ""; + return message; + }, + fromAmino(object: HandshakeMetadataAmino): HandshakeMetadata { + const message = createBaseHandshakeMetadata(); + if (object.provider_fee_pool_addr !== undefined && object.provider_fee_pool_addr !== null) { + message.providerFeePoolAddr = object.provider_fee_pool_addr; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; + }, + toAmino(message: HandshakeMetadata, useInterfaces: boolean = false): HandshakeMetadataAmino { + const obj: any = {}; + obj.provider_fee_pool_addr = message.providerFeePoolAddr; + obj.version = message.version; + return obj; + }, + fromAminoMsg(object: HandshakeMetadataAminoMsg): HandshakeMetadata { + return HandshakeMetadata.fromAmino(object.value); + }, + fromProtoMsg(message: HandshakeMetadataProtoMsg, useInterfaces: boolean = false): HandshakeMetadata { + return HandshakeMetadata.decode(message.value, undefined, useInterfaces); + }, + toProto(message: HandshakeMetadata): Uint8Array { + return HandshakeMetadata.encode(message).finish(); + }, + toProtoMsg(message: HandshakeMetadata): HandshakeMetadataProtoMsg { + return { + typeUrl: "/interchain_security.ccv.v1.HandshakeMetadata", + value: HandshakeMetadata.encode(message).finish() + }; + } +}; +function createBaseConsumerPacketDataV1(): ConsumerPacketDataV1 { + return { + type: 0, + slashPacketData: undefined, + vscMaturedPacketData: undefined + }; +} +export const ConsumerPacketDataV1 = { + typeUrl: "/interchain_security.ccv.v1.ConsumerPacketDataV1", + encode(message: ConsumerPacketDataV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (message.slashPacketData !== undefined) { + SlashPacketDataV1.encode(message.slashPacketData, writer.uint32(18).fork()).ldelim(); + } + if (message.vscMaturedPacketData !== undefined) { + VSCMaturedPacketData.encode(message.vscMaturedPacketData, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): ConsumerPacketDataV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsumerPacketDataV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = (reader.int32() as any); + break; + case 2: + message.slashPacketData = SlashPacketDataV1.decode(reader, reader.uint32(), useInterfaces); + break; + case 3: + message.vscMaturedPacketData = VSCMaturedPacketData.decode(reader, reader.uint32(), useInterfaces); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConsumerPacketDataV1 { + const message = createBaseConsumerPacketDataV1(); + message.type = object.type ?? 0; + message.slashPacketData = object.slashPacketData !== undefined && object.slashPacketData !== null ? SlashPacketDataV1.fromPartial(object.slashPacketData) : undefined; + message.vscMaturedPacketData = object.vscMaturedPacketData !== undefined && object.vscMaturedPacketData !== null ? VSCMaturedPacketData.fromPartial(object.vscMaturedPacketData) : undefined; + return message; + }, + fromAmino(object: ConsumerPacketDataV1Amino): ConsumerPacketDataV1 { + const message = createBaseConsumerPacketDataV1(); + if (object.type !== undefined && object.type !== null) { + message.type = consumerPacketDataTypeFromJSON(object.type); + } + if (object.slashPacketData !== undefined && object.slashPacketData !== null) { + message.slashPacketData = SlashPacketDataV1.fromAmino(object.slashPacketData); + } + if (object.vscMaturedPacketData !== undefined && object.vscMaturedPacketData !== null) { + message.vscMaturedPacketData = VSCMaturedPacketData.fromAmino(object.vscMaturedPacketData); + } + return message; + }, + toAmino(message: ConsumerPacketDataV1, useInterfaces: boolean = false): ConsumerPacketDataV1Amino { + const obj: any = {}; + obj.type = message.type; + obj.slashPacketData = message.slashPacketData ? SlashPacketDataV1.toAmino(message.slashPacketData, useInterfaces) : undefined; + obj.vscMaturedPacketData = message.vscMaturedPacketData ? VSCMaturedPacketData.toAmino(message.vscMaturedPacketData, useInterfaces) : undefined; + return obj; + }, + fromAminoMsg(object: ConsumerPacketDataV1AminoMsg): ConsumerPacketDataV1 { + return ConsumerPacketDataV1.fromAmino(object.value); + }, + fromProtoMsg(message: ConsumerPacketDataV1ProtoMsg, useInterfaces: boolean = false): ConsumerPacketDataV1 { + return ConsumerPacketDataV1.decode(message.value, undefined, useInterfaces); + }, + toProto(message: ConsumerPacketDataV1): Uint8Array { + return ConsumerPacketDataV1.encode(message).finish(); + }, + toProtoMsg(message: ConsumerPacketDataV1): ConsumerPacketDataV1ProtoMsg { + return { + typeUrl: "/interchain_security.ccv.v1.ConsumerPacketDataV1", + value: ConsumerPacketDataV1.encode(message).finish() + }; + } +}; +function createBaseSlashPacketDataV1(): SlashPacketDataV1 { + return { + validator: Validator.fromPartial({}), + valsetUpdateId: BigInt(0), + infraction: 0 + }; +} +export const SlashPacketDataV1 = { + typeUrl: "/interchain_security.ccv.v1.SlashPacketDataV1", + encode(message: SlashPacketDataV1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + } + if (message.valsetUpdateId !== BigInt(0)) { + writer.uint32(16).uint64(message.valsetUpdateId); + } + if (message.infraction !== 0) { + writer.uint32(24).int32(message.infraction); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number, useInterfaces: boolean = false): SlashPacketDataV1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSlashPacketDataV1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32(), useInterfaces); + break; + case 2: + message.valsetUpdateId = reader.uint64(); + break; + case 3: + message.infraction = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SlashPacketDataV1 { + const message = createBaseSlashPacketDataV1(); + message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; + message.valsetUpdateId = object.valsetUpdateId !== undefined && object.valsetUpdateId !== null ? BigInt(object.valsetUpdateId.toString()) : BigInt(0); + message.infraction = object.infraction ?? 0; + return message; + }, + fromAmino(object: SlashPacketDataV1Amino): SlashPacketDataV1 { + const message = createBaseSlashPacketDataV1(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + if (object.valset_update_id !== undefined && object.valset_update_id !== null) { + message.valsetUpdateId = BigInt(object.valset_update_id); + } + if (object.infraction !== undefined && object.infraction !== null) { + message.infraction = infractionTypeFromJSON(object.infraction); + } + return message; + }, + toAmino(message: SlashPacketDataV1, useInterfaces: boolean = false): SlashPacketDataV1Amino { + const obj: any = {}; + obj.validator = message.validator ? Validator.toAmino(message.validator, useInterfaces) : undefined; + obj.valset_update_id = message.valsetUpdateId ? message.valsetUpdateId.toString() : undefined; + obj.infraction = message.infraction; + return obj; + }, + fromAminoMsg(object: SlashPacketDataV1AminoMsg): SlashPacketDataV1 { + return SlashPacketDataV1.fromAmino(object.value); + }, + fromProtoMsg(message: SlashPacketDataV1ProtoMsg, useInterfaces: boolean = false): SlashPacketDataV1 { + return SlashPacketDataV1.decode(message.value, undefined, useInterfaces); + }, + toProto(message: SlashPacketDataV1): Uint8Array { + return SlashPacketDataV1.encode(message).finish(); + }, + toProtoMsg(message: SlashPacketDataV1): SlashPacketDataV1ProtoMsg { + return { + typeUrl: "/interchain_security.ccv.v1.SlashPacketDataV1", + value: SlashPacketDataV1.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/interchain_security/client.ts b/packages/types/protobuf/codegen/interchain_security/client.ts new file mode 100644 index 000000000..6c5845cfd --- /dev/null +++ b/packages/types/protobuf/codegen/interchain_security/client.ts @@ -0,0 +1,47 @@ +import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; +import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; +import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as interchainSecurityCcvConsumerV1TxRegistry from "./ccv/consumer/v1/tx.registry"; +import * as interchainSecurityCcvConsumerV1TxAmino from "./ccv/consumer/v1/tx.amino"; +export const interchainSecurityAminoConverters = { + ...interchainSecurityCcvConsumerV1TxAmino.AminoConverter +}; +export const interchainSecurityProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...interchainSecurityCcvConsumerV1TxRegistry.registry]; +export const getSigningInterchainSecurityClientOptions = ({ + defaultTypes = defaultRegistryTypes +}: { + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +} = {}): { + registry: Registry; + aminoTypes: AminoTypes; +} => { + const registry = new Registry([...defaultTypes, ...interchainSecurityProtoRegistry]); + const aminoTypes = new AminoTypes({ + ...interchainSecurityAminoConverters + }); + return { + registry, + aminoTypes + }; +}; +export const getSigningInterchainSecurityClient = async ({ + rpcEndpoint, + signer, + defaultTypes = defaultRegistryTypes +}: { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; + defaultTypes?: ReadonlyArray<[string, GeneratedType]>; +}) => { + const { + registry, + aminoTypes + } = getSigningInterchainSecurityClientOptions({ + defaultTypes + }); + const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { + registry: (registry as any), + aminoTypes + }); + return client; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/interchain_security/rpc.query.ts b/packages/types/protobuf/codegen/interchain_security/rpc.query.ts new file mode 100644 index 000000000..75eca666e --- /dev/null +++ b/packages/types/protobuf/codegen/interchain_security/rpc.query.ts @@ -0,0 +1,63 @@ +import { Tendermint34Client, HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import { QueryClient } from "@cosmjs/stargate"; +export const createRPCQueryClient = async ({ + rpcEndpoint +}: { + rpcEndpoint: string | HttpEndpoint; +}) => { + const tmClient = await Tendermint34Client.connect(rpcEndpoint); + const client = new QueryClient(tmClient); + return { + cosmos: { + auth: { + v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + authz: { + v1beta1: (await import("../cosmos/authz/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + bank: { + v1beta1: (await import("../cosmos/bank/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + base: { + tendermint: { + v1beta1: (await import("../cosmos/base/tendermint/v1beta1/query.rpc.Service")).createRpcQueryExtension(client) + } + }, + distribution: { + v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + feegrant: { + v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + gov: { + v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), + v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + mint: { + v1beta1: (await import("../cosmos/mint/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + params: { + v1beta1: (await import("../cosmos/params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + slashing: { + v1beta1: (await import("../cosmos/slashing/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + staking: { + v1beta1: (await import("../cosmos/staking/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + tx: { + v1beta1: (await import("../cosmos/tx/v1beta1/service.rpc.Service")).createRpcQueryExtension(client) + }, + upgrade: { + v1beta1: (await import("../cosmos/upgrade/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, + interchain_security: { + ccv: { + consumer: { + v1: (await import("./ccv/consumer/v1/query.rpc.Query")).createRpcQueryExtension(client) + } + } + } + }; +}; \ No newline at end of file diff --git a/packages/types/protobuf/codegen/interchain_security/rpc.tx.ts b/packages/types/protobuf/codegen/interchain_security/rpc.tx.ts new file mode 100644 index 000000000..252960f24 --- /dev/null +++ b/packages/types/protobuf/codegen/interchain_security/rpc.tx.ts @@ -0,0 +1,47 @@ +import { Rpc } from "../helpers"; +export const createRPCMsgClient = async ({ + rpc +}: { + rpc: Rpc; +}) => ({ + cosmos: { + auth: { + v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + authz: { + v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + bank: { + v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + distribution: { + v1beta1: new (await import("../cosmos/distribution/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + feegrant: { + v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + gov: { + v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), + v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + mint: { + v1beta1: new (await import("../cosmos/mint/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + slashing: { + v1beta1: new (await import("../cosmos/slashing/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + staking: { + v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + upgrade: { + v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + } + }, + interchain_security: { + ccv: { + consumer: { + v1: new (await import("./ccv/consumer/v1/tx.rpc.msg")).MsgClientImpl(rpc) + } + } + } +}); \ No newline at end of file diff --git a/packages/types/protobuf/codegen/juno/bundle.ts b/packages/types/protobuf/codegen/juno/bundle.ts index d79950df8..3e13a2bf2 100644 --- a/packages/types/protobuf/codegen/juno/bundle.ts +++ b/packages/types/protobuf/codegen/juno/bundle.ts @@ -1,46 +1,46 @@ -import * as _146 from "./feeshare/v1/feeshare"; -import * as _147 from "./feeshare/v1/genesis"; -import * as _148 from "./feeshare/v1/query"; -import * as _149 from "./feeshare/v1/tx"; -import * as _150 from "./mint/genesis"; -import * as _151 from "./mint/mint"; -import * as _152 from "./mint/query"; -import * as _153 from "./mint/tx"; -import * as _478 from "./feeshare/v1/tx.amino"; -import * as _479 from "./mint/tx.amino"; -import * as _480 from "./feeshare/v1/tx.registry"; -import * as _481 from "./mint/tx.registry"; -import * as _482 from "./feeshare/v1/query.rpc.Query"; -import * as _483 from "./mint/query.rpc.Query"; -import * as _484 from "./feeshare/v1/tx.rpc.msg"; -import * as _485 from "./mint/tx.rpc.msg"; -import * as _658 from "./rpc.query"; -import * as _659 from "./rpc.tx"; +import * as _153 from "./feeshare/v1/feeshare"; +import * as _154 from "./feeshare/v1/genesis"; +import * as _155 from "./feeshare/v1/query"; +import * as _156 from "./feeshare/v1/tx"; +import * as _157 from "./mint/genesis"; +import * as _158 from "./mint/mint"; +import * as _159 from "./mint/query"; +import * as _160 from "./mint/tx"; +import * as _489 from "./feeshare/v1/tx.amino"; +import * as _490 from "./mint/tx.amino"; +import * as _491 from "./feeshare/v1/tx.registry"; +import * as _492 from "./mint/tx.registry"; +import * as _493 from "./feeshare/v1/query.rpc.Query"; +import * as _494 from "./mint/query.rpc.Query"; +import * as _495 from "./feeshare/v1/tx.rpc.msg"; +import * as _496 from "./mint/tx.rpc.msg"; +import * as _671 from "./rpc.query"; +import * as _672 from "./rpc.tx"; export namespace juno { export namespace feeshare { export const v1 = { - ..._146, - ..._147, - ..._148, - ..._149, - ..._478, - ..._480, - ..._482, - ..._484 + ..._153, + ..._154, + ..._155, + ..._156, + ..._489, + ..._491, + ..._493, + ..._495 }; } export const mint = { - ..._150, - ..._151, - ..._152, - ..._153, - ..._479, - ..._481, - ..._483, - ..._485 + ..._157, + ..._158, + ..._159, + ..._160, + ..._490, + ..._492, + ..._494, + ..._496 }; export const ClientFactory = { - ..._658, - ..._659 + ..._671, + ..._672 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/kujira/bundle.ts b/packages/types/protobuf/codegen/kujira/bundle.ts index 807cc0bc6..91907c2bb 100644 --- a/packages/types/protobuf/codegen/kujira/bundle.ts +++ b/packages/types/protobuf/codegen/kujira/bundle.ts @@ -1,60 +1,60 @@ -import * as _154 from "./denom/authorityMetadata"; -import * as _155 from "./denom/genesis"; -import * as _156 from "./denom/params"; -import * as _157 from "./denom/query"; -import * as _158 from "./denom/tx"; -import * as _159 from "./oracle/genesis"; -import * as _160 from "./oracle/oracle"; -import * as _161 from "./oracle/query"; -import * as _162 from "./oracle/tx"; -import * as _163 from "./scheduler/genesis"; -import * as _164 from "./scheduler/hook"; -import * as _165 from "./scheduler/params"; -import * as _166 from "./scheduler/proposal"; -import * as _167 from "./scheduler/query"; -import * as _486 from "./denom/tx.amino"; -import * as _487 from "./oracle/tx.amino"; -import * as _488 from "./denom/tx.registry"; -import * as _489 from "./oracle/tx.registry"; -import * as _490 from "./denom/query.rpc.Query"; -import * as _491 from "./oracle/query.rpc.Query"; -import * as _492 from "./scheduler/query.rpc.Query"; -import * as _493 from "./denom/tx.rpc.msg"; -import * as _494 from "./oracle/tx.rpc.msg"; -import * as _660 from "./rpc.query"; -import * as _661 from "./rpc.tx"; +import * as _161 from "./denom/authorityMetadata"; +import * as _162 from "./denom/genesis"; +import * as _163 from "./denom/params"; +import * as _164 from "./denom/query"; +import * as _165 from "./denom/tx"; +import * as _166 from "./oracle/genesis"; +import * as _167 from "./oracle/oracle"; +import * as _168 from "./oracle/query"; +import * as _169 from "./oracle/tx"; +import * as _170 from "./scheduler/genesis"; +import * as _171 from "./scheduler/hook"; +import * as _172 from "./scheduler/params"; +import * as _173 from "./scheduler/proposal"; +import * as _174 from "./scheduler/query"; +import * as _497 from "./denom/tx.amino"; +import * as _498 from "./oracle/tx.amino"; +import * as _499 from "./denom/tx.registry"; +import * as _500 from "./oracle/tx.registry"; +import * as _501 from "./denom/query.rpc.Query"; +import * as _502 from "./oracle/query.rpc.Query"; +import * as _503 from "./scheduler/query.rpc.Query"; +import * as _504 from "./denom/tx.rpc.msg"; +import * as _505 from "./oracle/tx.rpc.msg"; +import * as _673 from "./rpc.query"; +import * as _674 from "./rpc.tx"; export namespace kujira { export const denom = { - ..._154, - ..._155, - ..._156, - ..._157, - ..._158, - ..._486, - ..._488, - ..._490, - ..._493 - }; - export const oracle = { - ..._159, - ..._160, ..._161, ..._162, - ..._487, - ..._489, - ..._491, - ..._494 - }; - export const scheduler = { ..._163, ..._164, ..._165, + ..._497, + ..._499, + ..._501, + ..._504 + }; + export const oracle = { ..._166, ..._167, - ..._492 + ..._168, + ..._169, + ..._498, + ..._500, + ..._502, + ..._505 + }; + export const scheduler = { + ..._170, + ..._171, + ..._172, + ..._173, + ..._174, + ..._503 }; export const ClientFactory = { - ..._660, - ..._661 + ..._673, + ..._674 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/neutron/bundle.ts b/packages/types/protobuf/codegen/neutron/bundle.ts index 9447bb144..688a48e13 100644 --- a/packages/types/protobuf/codegen/neutron/bundle.ts +++ b/packages/types/protobuf/codegen/neutron/bundle.ts @@ -1,92 +1,85 @@ -import * as _168 from "./contractmanager/v1/failure"; -import * as _169 from "./cron/genesis"; -import * as _170 from "./cron/params"; -import * as _171 from "./cron/query"; -import * as _172 from "./cron/schedule"; -import * as _173 from "./cron/tx"; -import * as _174 from "./dex/deposit_record"; -import * as _175 from "./dex/genesis"; -import * as _176 from "./dex/limit_order_expiration"; -import * as _177 from "./dex/limit_order_tranche_user"; -import * as _178 from "./dex/limit_order_tranche"; -import * as _179 from "./dex/pair_id"; -import * as _180 from "./dex/params"; -import * as _181 from "./dex/pool_metadata"; -import * as _182 from "./dex/pool_reserves"; -import * as _183 from "./dex/pool"; -import * as _184 from "./dex/query"; -import * as _185 from "./dex/tick_liquidity"; -import * as _186 from "./dex/trade_pair_id"; -import * as _187 from "./dex/tx"; -import * as _188 from "./feeburner/genesis"; -import * as _189 from "./feeburner/params"; -import * as _190 from "./feeburner/query"; -import * as _191 from "./feeburner/total_burned_neutrons_amount"; -import * as _192 from "./feeburner/tx"; -import * as _193 from "./feerefunder/fee"; -import * as _194 from "./feerefunder/genesis"; -import * as _195 from "./feerefunder/params"; -import * as _196 from "./feerefunder/query"; -import * as _197 from "./feerefunder/tx"; -import * as _198 from "./interchainqueries/genesis"; -import * as _199 from "./interchainqueries/params"; -import * as _200 from "./interchainqueries/query"; -import * as _201 from "./interchainqueries/tx"; -import * as _202 from "./interchaintxs/v1/genesis"; -import * as _203 from "./interchaintxs/v1/params"; -import * as _204 from "./interchaintxs/v1/query"; -import * as _205 from "./interchaintxs/v1/tx"; -import * as _495 from "./cron/tx.amino"; -import * as _496 from "./dex/tx.amino"; -import * as _497 from "./feeburner/tx.amino"; -import * as _498 from "./feerefunder/tx.amino"; -import * as _499 from "./interchainqueries/tx.amino"; -import * as _500 from "./interchaintxs/v1/tx.amino"; -import * as _501 from "./cron/tx.registry"; -import * as _502 from "./dex/tx.registry"; -import * as _503 from "./feeburner/tx.registry"; -import * as _504 from "./feerefunder/tx.registry"; -import * as _505 from "./interchainqueries/tx.registry"; -import * as _506 from "./interchaintxs/v1/tx.registry"; -import * as _507 from "./cron/query.rpc.Query"; -import * as _508 from "./dex/query.rpc.Query"; -import * as _509 from "./feeburner/query.rpc.Query"; -import * as _510 from "./feerefunder/query.rpc.Query"; -import * as _511 from "./interchainqueries/query.rpc.Query"; -import * as _512 from "./interchaintxs/v1/query.rpc.Query"; -import * as _513 from "./cron/tx.rpc.msg"; -import * as _514 from "./dex/tx.rpc.msg"; -import * as _515 from "./feeburner/tx.rpc.msg"; -import * as _516 from "./feerefunder/tx.rpc.msg"; -import * as _517 from "./interchainqueries/tx.rpc.msg"; -import * as _518 from "./interchaintxs/v1/tx.rpc.msg"; -import * as _662 from "./rpc.query"; -import * as _663 from "./rpc.tx"; +import * as _175 from "./contractmanager/v1/failure"; +import * as _176 from "./cron/genesis"; +import * as _177 from "./cron/params"; +import * as _178 from "./cron/query"; +import * as _179 from "./cron/schedule"; +import * as _180 from "./cron/tx"; +import * as _181 from "./dex/deposit_record"; +import * as _182 from "./dex/genesis"; +import * as _183 from "./dex/limit_order_expiration"; +import * as _184 from "./dex/limit_order_tranche_user"; +import * as _185 from "./dex/limit_order_tranche"; +import * as _186 from "./dex/pair_id"; +import * as _187 from "./dex/params"; +import * as _188 from "./dex/pool_metadata"; +import * as _189 from "./dex/pool_reserves"; +import * as _190 from "./dex/pool"; +import * as _191 from "./dex/query"; +import * as _192 from "./dex/tick_liquidity"; +import * as _193 from "./dex/trade_pair_id"; +import * as _194 from "./dex/tx"; +import * as _195 from "./feeburner/genesis"; +import * as _196 from "./feeburner/params"; +import * as _197 from "./feeburner/query"; +import * as _198 from "./feeburner/total_burned_neutrons_amount"; +import * as _199 from "./feeburner/tx"; +import * as _200 from "./feerefunder/fee"; +import * as _201 from "./feerefunder/genesis"; +import * as _202 from "./feerefunder/params"; +import * as _203 from "./feerefunder/query"; +import * as _204 from "./feerefunder/tx"; +import * as _205 from "./interchainqueries/genesis"; +import * as _206 from "./interchainqueries/params"; +import * as _207 from "./interchainqueries/query"; +import * as _208 from "./interchainqueries/tx"; +import * as _209 from "./interchaintxs/v1/genesis"; +import * as _210 from "./interchaintxs/v1/params"; +import * as _211 from "./interchaintxs/v1/query"; +import * as _212 from "./interchaintxs/v1/tx"; +import * as _506 from "./cron/tx.amino"; +import * as _507 from "./dex/tx.amino"; +import * as _508 from "./feeburner/tx.amino"; +import * as _509 from "./feerefunder/tx.amino"; +import * as _510 from "./interchainqueries/tx.amino"; +import * as _511 from "./interchaintxs/v1/tx.amino"; +import * as _512 from "./cron/tx.registry"; +import * as _513 from "./dex/tx.registry"; +import * as _514 from "./feeburner/tx.registry"; +import * as _515 from "./feerefunder/tx.registry"; +import * as _516 from "./interchainqueries/tx.registry"; +import * as _517 from "./interchaintxs/v1/tx.registry"; +import * as _518 from "./cron/query.rpc.Query"; +import * as _519 from "./dex/query.rpc.Query"; +import * as _520 from "./feeburner/query.rpc.Query"; +import * as _521 from "./feerefunder/query.rpc.Query"; +import * as _522 from "./interchainqueries/query.rpc.Query"; +import * as _523 from "./interchaintxs/v1/query.rpc.Query"; +import * as _524 from "./cron/tx.rpc.msg"; +import * as _525 from "./dex/tx.rpc.msg"; +import * as _526 from "./feeburner/tx.rpc.msg"; +import * as _527 from "./feerefunder/tx.rpc.msg"; +import * as _528 from "./interchainqueries/tx.rpc.msg"; +import * as _529 from "./interchaintxs/v1/tx.rpc.msg"; +import * as _675 from "./rpc.query"; +import * as _676 from "./rpc.tx"; export namespace neutron { export namespace contractmanager { export const v1 = { - ..._168 + ..._175 }; } export const cron = { - ..._169, - ..._170, - ..._171, - ..._172, - ..._173, - ..._495, - ..._501, - ..._507, - ..._513 - }; - export const dex = { - ..._174, - ..._175, ..._176, ..._177, ..._178, ..._179, ..._180, + ..._506, + ..._512, + ..._518, + ..._524 + }; + export const dex = { ..._181, ..._182, ..._183, @@ -94,57 +87,64 @@ export namespace neutron { ..._185, ..._186, ..._187, - ..._496, - ..._502, - ..._508, - ..._514 - }; - export const feeburner = { ..._188, ..._189, ..._190, ..._191, ..._192, - ..._497, - ..._503, - ..._509, - ..._515 - }; - export const feerefunder = { ..._193, ..._194, + ..._507, + ..._513, + ..._519, + ..._525 + }; + export const feeburner = { ..._195, ..._196, ..._197, - ..._498, - ..._504, - ..._510, - ..._516 - }; - export const interchainqueries = { ..._198, ..._199, + ..._508, + ..._514, + ..._520, + ..._526 + }; + export const feerefunder = { ..._200, ..._201, - ..._499, - ..._505, - ..._511, - ..._517 + ..._202, + ..._203, + ..._204, + ..._509, + ..._515, + ..._521, + ..._527 + }; + export const interchainqueries = { + ..._205, + ..._206, + ..._207, + ..._208, + ..._510, + ..._516, + ..._522, + ..._528 }; export namespace interchaintxs { export const v1 = { - ..._202, - ..._203, - ..._204, - ..._205, - ..._500, - ..._506, - ..._512, - ..._518 + ..._209, + ..._210, + ..._211, + ..._212, + ..._511, + ..._517, + ..._523, + ..._529 }; } export const ClientFactory = { - ..._662, - ..._663 + ..._675, + ..._676 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/noble/bundle.ts b/packages/types/protobuf/codegen/noble/bundle.ts index b389cbea0..93526834c 100644 --- a/packages/types/protobuf/codegen/noble/bundle.ts +++ b/packages/types/protobuf/codegen/noble/bundle.ts @@ -1,16 +1,16 @@ -import * as _367 from "../tariff/genesis"; -import * as _368 from "../tariff/params"; -import * as _369 from "../tariff/query"; -import * as _642 from "../tariff/query.rpc.Query"; -import * as _676 from "./rpc.query"; +import * as _374 from "../tariff/genesis"; +import * as _375 from "../tariff/params"; +import * as _376 from "../tariff/query"; +import * as _653 from "../tariff/query.rpc.Query"; +import * as _689 from "./rpc.query"; export namespace noble { export const tariff = { - ..._367, - ..._368, - ..._369, - ..._642 + ..._374, + ..._375, + ..._376, + ..._653 }; export const ClientFactory = { - ..._676 + ..._689 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/osmosis/bundle.ts b/packages/types/protobuf/codegen/osmosis/bundle.ts index a1f72c87b..a91ced2bd 100644 --- a/packages/types/protobuf/codegen/osmosis/bundle.ts +++ b/packages/types/protobuf/codegen/osmosis/bundle.ts @@ -1,336 +1,336 @@ -import * as _211 from "./accum/v1beta1/accum"; -import * as _212 from "./concentratedliquidity/params"; -import * as _213 from "./cosmwasmpool/v1beta1/genesis"; -import * as _214 from "./cosmwasmpool/v1beta1/gov"; -import * as _215 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; -import * as _216 from "./cosmwasmpool/v1beta1/model/module_query_msg"; -import * as _217 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; -import * as _218 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; -import * as _219 from "./cosmwasmpool/v1beta1/model/pool"; -import * as _220 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; -import * as _221 from "./cosmwasmpool/v1beta1/model/tx"; -import * as _222 from "./cosmwasmpool/v1beta1/params"; -import * as _223 from "./cosmwasmpool/v1beta1/query"; -import * as _224 from "./cosmwasmpool/v1beta1/tx"; -import * as _225 from "./gamm/pool-models/balancer/balancerPool"; -import * as _226 from "./gamm/v1beta1/genesis"; -import * as _227 from "./gamm/v1beta1/gov"; -import * as _228 from "./gamm/v1beta1/query"; -import * as _229 from "./gamm/v1beta1/shared"; -import * as _230 from "./gamm/v1beta1/tx"; -import * as _231 from "./gamm/pool-models/balancer/tx/tx"; -import * as _232 from "./gamm/pool-models/stableswap/stableswap_pool"; -import * as _233 from "./gamm/pool-models/stableswap/tx"; -import * as _234 from "./incentives/gauge"; -import * as _235 from "./incentives/genesis"; -import * as _236 from "./incentives/gov"; -import * as _237 from "./incentives/group"; -import * as _238 from "./incentives/params"; -import * as _239 from "./incentives/query"; -import * as _240 from "./incentives/tx"; -import * as _241 from "./lockup/genesis"; -import * as _242 from "./lockup/lock"; -import * as _243 from "./lockup/params"; -import * as _244 from "./lockup/query"; -import * as _245 from "./lockup/tx"; -import * as _246 from "./pool-incentives/v1beta1/genesis"; -import * as _247 from "./pool-incentives/v1beta1/gov"; -import * as _248 from "./pool-incentives/v1beta1/incentives"; -import * as _249 from "./pool-incentives/v1beta1/query"; -import * as _250 from "./pool-incentives/v1beta1/shared"; -import * as _251 from "./poolmanager/v1beta1/genesis"; -import * as _252 from "./poolmanager/v1beta1/gov"; -import * as _253 from "./poolmanager/v1beta1/module_route"; -import * as _254 from "./poolmanager/v1beta1/query"; -import * as _255 from "./poolmanager/v1beta1/swap_route"; -import * as _256 from "./poolmanager/v1beta1/tx"; -import * as _257 from "./protorev/v1beta1/genesis"; -import * as _258 from "./protorev/v1beta1/gov"; -import * as _259 from "./protorev/v1beta1/params"; -import * as _260 from "./protorev/v1beta1/protorev"; -import * as _261 from "./protorev/v1beta1/query"; -import * as _262 from "./protorev/v1beta1/tx"; -import * as _263 from "./smartaccount/v1beta1/genesis"; -import * as _264 from "./smartaccount/v1beta1/models"; -import * as _265 from "./smartaccount/v1beta1/params"; -import * as _266 from "./smartaccount/v1beta1/query"; -import * as _267 from "./smartaccount/v1beta1/tx"; -import * as _268 from "./superfluid/genesis"; -import * as _269 from "./superfluid/params"; -import * as _270 from "./superfluid/query"; -import * as _271 from "./superfluid/superfluid"; -import * as _272 from "./superfluid/tx"; -import * as _273 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _274 from "./tokenfactory/v1beta1/genesis"; -import * as _275 from "./tokenfactory/v1beta1/params"; -import * as _276 from "./tokenfactory/v1beta1/query"; -import * as _277 from "./tokenfactory/v1beta1/tx"; -import * as _278 from "./txfees/v1beta1/feetoken"; -import * as _279 from "./txfees/v1beta1/genesis"; -import * as _280 from "./txfees/v1beta1/gov"; -import * as _281 from "./txfees/v1beta1/params"; -import * as _282 from "./txfees/v1beta1/query"; -import * as _283 from "./txfees/v1beta1/tx"; -import * as _284 from "./valset-pref/v1beta1/query"; -import * as _285 from "./valset-pref/v1beta1/state"; -import * as _286 from "./valset-pref/v1beta1/tx"; -import * as _523 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; -import * as _524 from "./concentratedliquidity/v1beta1/tx.amino"; -import * as _525 from "./gamm/pool-models/balancer/tx/tx.amino"; -import * as _526 from "./gamm/pool-models/stableswap/tx.amino"; -import * as _527 from "./gamm/v1beta1/tx.amino"; -import * as _528 from "./incentives/tx.amino"; -import * as _529 from "./lockup/tx.amino"; -import * as _530 from "./poolmanager/v1beta1/tx.amino"; -import * as _531 from "./protorev/v1beta1/tx.amino"; -import * as _532 from "./smartaccount/v1beta1/tx.amino"; -import * as _533 from "./superfluid/tx.amino"; -import * as _534 from "./tokenfactory/v1beta1/tx.amino"; -import * as _535 from "./txfees/v1beta1/tx.amino"; -import * as _536 from "./valset-pref/v1beta1/tx.amino"; -import * as _537 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; -import * as _538 from "./concentratedliquidity/v1beta1/tx.registry"; -import * as _539 from "./gamm/pool-models/balancer/tx/tx.registry"; -import * as _540 from "./gamm/pool-models/stableswap/tx.registry"; -import * as _541 from "./gamm/v1beta1/tx.registry"; -import * as _542 from "./incentives/tx.registry"; -import * as _543 from "./lockup/tx.registry"; -import * as _544 from "./poolmanager/v1beta1/tx.registry"; -import * as _545 from "./protorev/v1beta1/tx.registry"; -import * as _546 from "./smartaccount/v1beta1/tx.registry"; -import * as _547 from "./superfluid/tx.registry"; -import * as _548 from "./tokenfactory/v1beta1/tx.registry"; -import * as _549 from "./txfees/v1beta1/tx.registry"; -import * as _550 from "./valset-pref/v1beta1/tx.registry"; -import * as _551 from "./concentratedliquidity/v1beta1/query.rpc.Query"; -import * as _552 from "./cosmwasmpool/v1beta1/query.rpc.Query"; -import * as _553 from "./gamm/v1beta1/query.rpc.Query"; -import * as _554 from "./incentives/query.rpc.Query"; -import * as _555 from "./lockup/query.rpc.Query"; -import * as _556 from "./pool-incentives/v1beta1/query.rpc.Query"; -import * as _557 from "./poolmanager/v1beta1/query.rpc.Query"; -import * as _558 from "./protorev/v1beta1/query.rpc.Query"; -import * as _559 from "./smartaccount/v1beta1/query.rpc.Query"; -import * as _560 from "./superfluid/query.rpc.Query"; -import * as _561 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _562 from "./txfees/v1beta1/query.rpc.Query"; -import * as _563 from "./valset-pref/v1beta1/query.rpc.Query"; -import * as _564 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; -import * as _565 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; -import * as _566 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; -import * as _567 from "./gamm/pool-models/stableswap/tx.rpc.msg"; -import * as _568 from "./gamm/v1beta1/tx.rpc.msg"; -import * as _569 from "./incentives/tx.rpc.msg"; -import * as _570 from "./lockup/tx.rpc.msg"; -import * as _571 from "./poolmanager/v1beta1/tx.rpc.msg"; -import * as _572 from "./protorev/v1beta1/tx.rpc.msg"; -import * as _573 from "./smartaccount/v1beta1/tx.rpc.msg"; -import * as _574 from "./superfluid/tx.rpc.msg"; -import * as _575 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _576 from "./txfees/v1beta1/tx.rpc.msg"; -import * as _577 from "./valset-pref/v1beta1/tx.rpc.msg"; -import * as _666 from "./rpc.query"; -import * as _667 from "./rpc.tx"; +import * as _218 from "./accum/v1beta1/accum"; +import * as _219 from "./concentratedliquidity/params"; +import * as _220 from "./cosmwasmpool/v1beta1/genesis"; +import * as _221 from "./cosmwasmpool/v1beta1/gov"; +import * as _222 from "./cosmwasmpool/v1beta1/model/instantiate_msg"; +import * as _223 from "./cosmwasmpool/v1beta1/model/module_query_msg"; +import * as _224 from "./cosmwasmpool/v1beta1/model/module_sudo_msg"; +import * as _225 from "./cosmwasmpool/v1beta1/model/pool_query_msg"; +import * as _226 from "./cosmwasmpool/v1beta1/model/pool"; +import * as _227 from "./cosmwasmpool/v1beta1/model/transmuter_msgs"; +import * as _228 from "./cosmwasmpool/v1beta1/model/tx"; +import * as _229 from "./cosmwasmpool/v1beta1/params"; +import * as _230 from "./cosmwasmpool/v1beta1/query"; +import * as _231 from "./cosmwasmpool/v1beta1/tx"; +import * as _232 from "./gamm/pool-models/balancer/balancerPool"; +import * as _233 from "./gamm/v1beta1/genesis"; +import * as _234 from "./gamm/v1beta1/gov"; +import * as _235 from "./gamm/v1beta1/query"; +import * as _236 from "./gamm/v1beta1/shared"; +import * as _237 from "./gamm/v1beta1/tx"; +import * as _238 from "./gamm/pool-models/balancer/tx/tx"; +import * as _239 from "./gamm/pool-models/stableswap/stableswap_pool"; +import * as _240 from "./gamm/pool-models/stableswap/tx"; +import * as _241 from "./incentives/gauge"; +import * as _242 from "./incentives/genesis"; +import * as _243 from "./incentives/gov"; +import * as _244 from "./incentives/group"; +import * as _245 from "./incentives/params"; +import * as _246 from "./incentives/query"; +import * as _247 from "./incentives/tx"; +import * as _248 from "./lockup/genesis"; +import * as _249 from "./lockup/lock"; +import * as _250 from "./lockup/params"; +import * as _251 from "./lockup/query"; +import * as _252 from "./lockup/tx"; +import * as _253 from "./pool-incentives/v1beta1/genesis"; +import * as _254 from "./pool-incentives/v1beta1/gov"; +import * as _255 from "./pool-incentives/v1beta1/incentives"; +import * as _256 from "./pool-incentives/v1beta1/query"; +import * as _257 from "./pool-incentives/v1beta1/shared"; +import * as _258 from "./poolmanager/v1beta1/genesis"; +import * as _259 from "./poolmanager/v1beta1/gov"; +import * as _260 from "./poolmanager/v1beta1/module_route"; +import * as _261 from "./poolmanager/v1beta1/query"; +import * as _262 from "./poolmanager/v1beta1/swap_route"; +import * as _263 from "./poolmanager/v1beta1/tx"; +import * as _264 from "./protorev/v1beta1/genesis"; +import * as _265 from "./protorev/v1beta1/gov"; +import * as _266 from "./protorev/v1beta1/params"; +import * as _267 from "./protorev/v1beta1/protorev"; +import * as _268 from "./protorev/v1beta1/query"; +import * as _269 from "./protorev/v1beta1/tx"; +import * as _270 from "./smartaccount/v1beta1/genesis"; +import * as _271 from "./smartaccount/v1beta1/models"; +import * as _272 from "./smartaccount/v1beta1/params"; +import * as _273 from "./smartaccount/v1beta1/query"; +import * as _274 from "./smartaccount/v1beta1/tx"; +import * as _275 from "./superfluid/genesis"; +import * as _276 from "./superfluid/params"; +import * as _277 from "./superfluid/query"; +import * as _278 from "./superfluid/superfluid"; +import * as _279 from "./superfluid/tx"; +import * as _280 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _281 from "./tokenfactory/v1beta1/genesis"; +import * as _282 from "./tokenfactory/v1beta1/params"; +import * as _283 from "./tokenfactory/v1beta1/query"; +import * as _284 from "./tokenfactory/v1beta1/tx"; +import * as _285 from "./txfees/v1beta1/feetoken"; +import * as _286 from "./txfees/v1beta1/genesis"; +import * as _287 from "./txfees/v1beta1/gov"; +import * as _288 from "./txfees/v1beta1/params"; +import * as _289 from "./txfees/v1beta1/query"; +import * as _290 from "./txfees/v1beta1/tx"; +import * as _291 from "./valset-pref/v1beta1/query"; +import * as _292 from "./valset-pref/v1beta1/state"; +import * as _293 from "./valset-pref/v1beta1/tx"; +import * as _534 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.amino"; +import * as _535 from "./concentratedliquidity/v1beta1/tx.amino"; +import * as _536 from "./gamm/pool-models/balancer/tx/tx.amino"; +import * as _537 from "./gamm/pool-models/stableswap/tx.amino"; +import * as _538 from "./gamm/v1beta1/tx.amino"; +import * as _539 from "./incentives/tx.amino"; +import * as _540 from "./lockup/tx.amino"; +import * as _541 from "./poolmanager/v1beta1/tx.amino"; +import * as _542 from "./protorev/v1beta1/tx.amino"; +import * as _543 from "./smartaccount/v1beta1/tx.amino"; +import * as _544 from "./superfluid/tx.amino"; +import * as _545 from "./tokenfactory/v1beta1/tx.amino"; +import * as _546 from "./txfees/v1beta1/tx.amino"; +import * as _547 from "./valset-pref/v1beta1/tx.amino"; +import * as _548 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.registry"; +import * as _549 from "./concentratedliquidity/v1beta1/tx.registry"; +import * as _550 from "./gamm/pool-models/balancer/tx/tx.registry"; +import * as _551 from "./gamm/pool-models/stableswap/tx.registry"; +import * as _552 from "./gamm/v1beta1/tx.registry"; +import * as _553 from "./incentives/tx.registry"; +import * as _554 from "./lockup/tx.registry"; +import * as _555 from "./poolmanager/v1beta1/tx.registry"; +import * as _556 from "./protorev/v1beta1/tx.registry"; +import * as _557 from "./smartaccount/v1beta1/tx.registry"; +import * as _558 from "./superfluid/tx.registry"; +import * as _559 from "./tokenfactory/v1beta1/tx.registry"; +import * as _560 from "./txfees/v1beta1/tx.registry"; +import * as _561 from "./valset-pref/v1beta1/tx.registry"; +import * as _562 from "./concentratedliquidity/v1beta1/query.rpc.Query"; +import * as _563 from "./cosmwasmpool/v1beta1/query.rpc.Query"; +import * as _564 from "./gamm/v1beta1/query.rpc.Query"; +import * as _565 from "./incentives/query.rpc.Query"; +import * as _566 from "./lockup/query.rpc.Query"; +import * as _567 from "./pool-incentives/v1beta1/query.rpc.Query"; +import * as _568 from "./poolmanager/v1beta1/query.rpc.Query"; +import * as _569 from "./protorev/v1beta1/query.rpc.Query"; +import * as _570 from "./smartaccount/v1beta1/query.rpc.Query"; +import * as _571 from "./superfluid/query.rpc.Query"; +import * as _572 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _573 from "./txfees/v1beta1/query.rpc.Query"; +import * as _574 from "./valset-pref/v1beta1/query.rpc.Query"; +import * as _575 from "./concentratedliquidity/poolmodel/concentrated/v1beta1/tx.rpc.msg"; +import * as _576 from "./concentratedliquidity/v1beta1/tx.rpc.msg"; +import * as _577 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; +import * as _578 from "./gamm/pool-models/stableswap/tx.rpc.msg"; +import * as _579 from "./gamm/v1beta1/tx.rpc.msg"; +import * as _580 from "./incentives/tx.rpc.msg"; +import * as _581 from "./lockup/tx.rpc.msg"; +import * as _582 from "./poolmanager/v1beta1/tx.rpc.msg"; +import * as _583 from "./protorev/v1beta1/tx.rpc.msg"; +import * as _584 from "./smartaccount/v1beta1/tx.rpc.msg"; +import * as _585 from "./superfluid/tx.rpc.msg"; +import * as _586 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _587 from "./txfees/v1beta1/tx.rpc.msg"; +import * as _588 from "./valset-pref/v1beta1/tx.rpc.msg"; +import * as _679 from "./rpc.query"; +import * as _680 from "./rpc.tx"; export namespace osmosis { export namespace accum { export const v1beta1 = { - ..._211 + ..._218 }; } export const concentratedliquidity = { - ..._212, + ..._219, poolmodel: { concentrated: { v1beta1: { - ..._523, - ..._537, - ..._564 + ..._534, + ..._548, + ..._575 } } }, v1beta1: { - ..._524, - ..._538, - ..._551, - ..._565 + ..._535, + ..._549, + ..._562, + ..._576 } }; export namespace cosmwasmpool { export const v1beta1 = { - ..._213, - ..._214, - ..._215, - ..._216, - ..._217, - ..._218, - ..._219, ..._220, ..._221, ..._222, ..._223, ..._224, - ..._552 - }; - } - export namespace gamm { - export const v1beta1 = { ..._225, ..._226, ..._227, ..._228, ..._229, ..._230, - ..._527, - ..._541, - ..._553, - ..._568 + ..._231, + ..._563 + }; + } + export namespace gamm { + export const v1beta1 = { + ..._232, + ..._233, + ..._234, + ..._235, + ..._236, + ..._237, + ..._538, + ..._552, + ..._564, + ..._579 }; export namespace poolmodels { export namespace balancer { export const v1beta1 = { - ..._231, - ..._525, - ..._539, - ..._566 + ..._238, + ..._536, + ..._550, + ..._577 }; } export namespace stableswap { export const v1beta1 = { - ..._232, - ..._233, - ..._526, - ..._540, - ..._567 + ..._239, + ..._240, + ..._537, + ..._551, + ..._578 }; } } } export const incentives = { - ..._234, - ..._235, - ..._236, - ..._237, - ..._238, - ..._239, - ..._240, - ..._528, - ..._542, - ..._554, - ..._569 - }; - export const lockup = { ..._241, ..._242, ..._243, ..._244, ..._245, - ..._529, - ..._543, - ..._555, - ..._570 + ..._246, + ..._247, + ..._539, + ..._553, + ..._565, + ..._580 + }; + export const lockup = { + ..._248, + ..._249, + ..._250, + ..._251, + ..._252, + ..._540, + ..._554, + ..._566, + ..._581 }; export namespace poolincentives { export const v1beta1 = { - ..._246, - ..._247, - ..._248, - ..._249, - ..._250, - ..._556 - }; - } - export namespace poolmanager { - export const v1beta1 = { - ..._251, - ..._252, ..._253, ..._254, ..._255, ..._256, - ..._530, - ..._544, - ..._557, - ..._571 + ..._257, + ..._567 }; } - export namespace protorev { + export namespace poolmanager { export const v1beta1 = { - ..._257, ..._258, ..._259, ..._260, ..._261, ..._262, - ..._531, - ..._545, - ..._558, - ..._572 + ..._263, + ..._541, + ..._555, + ..._568, + ..._582 }; } - export namespace smartaccount { + export namespace protorev { export const v1beta1 = { - ..._263, ..._264, ..._265, ..._266, ..._267, - ..._532, - ..._546, - ..._559, - ..._573 + ..._268, + ..._269, + ..._542, + ..._556, + ..._569, + ..._583 }; } - export const superfluid = { - ..._268, - ..._269, - ..._270, - ..._271, - ..._272, - ..._533, - ..._547, - ..._560, - ..._574 - }; - export namespace tokenfactory { + export namespace smartaccount { export const v1beta1 = { + ..._270, + ..._271, + ..._272, ..._273, ..._274, - ..._275, - ..._276, - ..._277, - ..._534, - ..._548, - ..._561, - ..._575 + ..._543, + ..._557, + ..._570, + ..._584 }; } - export namespace txfees { + export const superfluid = { + ..._275, + ..._276, + ..._277, + ..._278, + ..._279, + ..._544, + ..._558, + ..._571, + ..._585 + }; + export namespace tokenfactory { export const v1beta1 = { - ..._278, - ..._279, ..._280, ..._281, ..._282, ..._283, - ..._535, - ..._549, - ..._562, - ..._576 + ..._284, + ..._545, + ..._559, + ..._572, + ..._586 }; } - export namespace valsetpref { + export namespace txfees { export const v1beta1 = { - ..._284, ..._285, ..._286, - ..._536, - ..._550, - ..._563, - ..._577 + ..._287, + ..._288, + ..._289, + ..._290, + ..._546, + ..._560, + ..._573, + ..._587 + }; + } + export namespace valsetpref { + export const v1beta1 = { + ..._291, + ..._292, + ..._293, + ..._547, + ..._561, + ..._574, + ..._588 }; } export const ClientFactory = { - ..._666, - ..._667 + ..._679, + ..._680 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/pstake/bundle.ts b/packages/types/protobuf/codegen/pstake/bundle.ts index 6fcc20ad9..8dbb7bae9 100644 --- a/packages/types/protobuf/codegen/pstake/bundle.ts +++ b/packages/types/protobuf/codegen/pstake/bundle.ts @@ -1,98 +1,98 @@ -import * as _287 from "./liquidstake/v1beta1/genesis"; -import * as _288 from "./liquidstake/v1beta1/liquidstake"; -import * as _289 from "./liquidstake/v1beta1/query"; -import * as _290 from "./liquidstake/v1beta1/tx"; -import * as _291 from "./liquidstakeibc/v1beta1/genesis"; -import * as _292 from "./liquidstakeibc/v1beta1/liquidstakeibc"; -import * as _293 from "./liquidstakeibc/v1beta1/msgs"; -import * as _294 from "./liquidstakeibc/v1beta1/params"; -import * as _295 from "./liquidstakeibc/v1beta1/query"; -import * as _296 from "./lscosmos/v1beta1/genesis"; -import * as _297 from "./lscosmos/v1beta1/governance_proposal"; -import * as _298 from "./lscosmos/v1beta1/lscosmos"; -import * as _299 from "./lscosmos/v1beta1/msgs"; -import * as _300 from "./lscosmos/v1beta1/params"; -import * as _301 from "./lscosmos/v1beta1/query"; -import * as _302 from "./ratesync/v1beta1/contract"; -import * as _303 from "./ratesync/v1beta1/genesis"; -import * as _304 from "./ratesync/v1beta1/params"; -import * as _305 from "./ratesync/v1beta1/query"; -import * as _306 from "./ratesync/v1beta1/ratesync"; -import * as _307 from "./ratesync/v1beta1/tx"; -import * as _578 from "./liquidstake/v1beta1/tx.amino"; -import * as _579 from "./liquidstakeibc/v1beta1/msgs.amino"; -import * as _580 from "./lscosmos/v1beta1/msgs.amino"; -import * as _581 from "./ratesync/v1beta1/tx.amino"; -import * as _582 from "./liquidstake/v1beta1/tx.registry"; -import * as _583 from "./liquidstakeibc/v1beta1/msgs.registry"; -import * as _584 from "./lscosmos/v1beta1/msgs.registry"; -import * as _585 from "./ratesync/v1beta1/tx.registry"; -import * as _586 from "./liquidstake/v1beta1/query.rpc.Query"; -import * as _587 from "./liquidstakeibc/v1beta1/query.rpc.Query"; -import * as _588 from "./lscosmos/v1beta1/query.rpc.Query"; -import * as _589 from "./ratesync/v1beta1/query.rpc.Query"; -import * as _590 from "./liquidstake/v1beta1/tx.rpc.msg"; -import * as _591 from "./liquidstakeibc/v1beta1/msgs.rpc.msg"; -import * as _592 from "./lscosmos/v1beta1/msgs.rpc.msg"; -import * as _593 from "./ratesync/v1beta1/tx.rpc.msg"; -import * as _668 from "./rpc.query"; -import * as _669 from "./rpc.tx"; +import * as _294 from "./liquidstake/v1beta1/genesis"; +import * as _295 from "./liquidstake/v1beta1/liquidstake"; +import * as _296 from "./liquidstake/v1beta1/query"; +import * as _297 from "./liquidstake/v1beta1/tx"; +import * as _298 from "./liquidstakeibc/v1beta1/genesis"; +import * as _299 from "./liquidstakeibc/v1beta1/liquidstakeibc"; +import * as _300 from "./liquidstakeibc/v1beta1/msgs"; +import * as _301 from "./liquidstakeibc/v1beta1/params"; +import * as _302 from "./liquidstakeibc/v1beta1/query"; +import * as _303 from "./lscosmos/v1beta1/genesis"; +import * as _304 from "./lscosmos/v1beta1/governance_proposal"; +import * as _305 from "./lscosmos/v1beta1/lscosmos"; +import * as _306 from "./lscosmos/v1beta1/msgs"; +import * as _307 from "./lscosmos/v1beta1/params"; +import * as _308 from "./lscosmos/v1beta1/query"; +import * as _309 from "./ratesync/v1beta1/contract"; +import * as _310 from "./ratesync/v1beta1/genesis"; +import * as _311 from "./ratesync/v1beta1/params"; +import * as _312 from "./ratesync/v1beta1/query"; +import * as _313 from "./ratesync/v1beta1/ratesync"; +import * as _314 from "./ratesync/v1beta1/tx"; +import * as _589 from "./liquidstake/v1beta1/tx.amino"; +import * as _590 from "./liquidstakeibc/v1beta1/msgs.amino"; +import * as _591 from "./lscosmos/v1beta1/msgs.amino"; +import * as _592 from "./ratesync/v1beta1/tx.amino"; +import * as _593 from "./liquidstake/v1beta1/tx.registry"; +import * as _594 from "./liquidstakeibc/v1beta1/msgs.registry"; +import * as _595 from "./lscosmos/v1beta1/msgs.registry"; +import * as _596 from "./ratesync/v1beta1/tx.registry"; +import * as _597 from "./liquidstake/v1beta1/query.rpc.Query"; +import * as _598 from "./liquidstakeibc/v1beta1/query.rpc.Query"; +import * as _599 from "./lscosmos/v1beta1/query.rpc.Query"; +import * as _600 from "./ratesync/v1beta1/query.rpc.Query"; +import * as _601 from "./liquidstake/v1beta1/tx.rpc.msg"; +import * as _602 from "./liquidstakeibc/v1beta1/msgs.rpc.msg"; +import * as _603 from "./lscosmos/v1beta1/msgs.rpc.msg"; +import * as _604 from "./ratesync/v1beta1/tx.rpc.msg"; +import * as _681 from "./rpc.query"; +import * as _682 from "./rpc.tx"; export namespace pstake { export namespace liquidstake { export const v1beta1 = { - ..._287, - ..._288, - ..._289, - ..._290, - ..._578, - ..._582, - ..._586, - ..._590 - }; - } - export namespace liquidstakeibc { - export const v1beta1 = { - ..._291, - ..._292, - ..._293, ..._294, ..._295, - ..._579, - ..._583, - ..._587, - ..._591 + ..._296, + ..._297, + ..._589, + ..._593, + ..._597, + ..._601 }; } - export namespace lscosmos { + export namespace liquidstakeibc { export const v1beta1 = { - ..._296, - ..._297, ..._298, ..._299, ..._300, ..._301, - ..._580, - ..._584, - ..._588, - ..._592 + ..._302, + ..._590, + ..._594, + ..._598, + ..._602 }; } - export namespace ratesync { + export namespace lscosmos { export const v1beta1 = { - ..._302, ..._303, ..._304, ..._305, ..._306, ..._307, - ..._581, - ..._585, - ..._589, - ..._593 + ..._308, + ..._591, + ..._595, + ..._599, + ..._603 + }; + } + export namespace ratesync { + export const v1beta1 = { + ..._309, + ..._310, + ..._311, + ..._312, + ..._313, + ..._314, + ..._592, + ..._596, + ..._600, + ..._604 }; } export const ClientFactory = { - ..._668, - ..._669 + ..._681, + ..._682 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/publicawesome/bundle.ts b/packages/types/protobuf/codegen/publicawesome/bundle.ts index 31378642d..22df21c25 100644 --- a/packages/types/protobuf/codegen/publicawesome/bundle.ts +++ b/packages/types/protobuf/codegen/publicawesome/bundle.ts @@ -1,88 +1,88 @@ -import * as _308 from "./stargaze/alloc/v1beta1/genesis"; -import * as _309 from "./stargaze/alloc/v1beta1/params"; -import * as _310 from "./stargaze/alloc/v1beta1/query"; -import * as _311 from "./stargaze/alloc/v1beta1/tx"; -import * as _312 from "./stargaze/cron/v1/cron"; -import * as _313 from "./stargaze/cron/v1/genesis"; -import * as _314 from "./stargaze/cron/v1/proposal"; -import * as _315 from "./stargaze/cron/v1/query"; -import * as _316 from "./stargaze/cron/v1/tx"; -import * as _317 from "./stargaze/globalfee/v1/genesis"; -import * as _318 from "./stargaze/globalfee/v1/globalfee"; -import * as _319 from "./stargaze/globalfee/v1/proposal"; -import * as _320 from "./stargaze/globalfee/v1/query"; -import * as _321 from "./stargaze/globalfee/v1/tx"; -import * as _322 from "./stargaze/mint/v1beta1/genesis"; -import * as _323 from "./stargaze/mint/v1beta1/mint"; -import * as _324 from "./stargaze/mint/v1beta1/query"; -import * as _325 from "./stargaze/mint/v1beta1/tx"; -import * as _594 from "./stargaze/alloc/v1beta1/tx.amino"; -import * as _595 from "./stargaze/cron/v1/tx.amino"; -import * as _596 from "./stargaze/globalfee/v1/tx.amino"; -import * as _597 from "./stargaze/alloc/v1beta1/tx.registry"; -import * as _598 from "./stargaze/cron/v1/tx.registry"; -import * as _599 from "./stargaze/globalfee/v1/tx.registry"; -import * as _600 from "./stargaze/alloc/v1beta1/query.rpc.Query"; -import * as _601 from "./stargaze/cron/v1/query.rpc.Query"; -import * as _602 from "./stargaze/globalfee/v1/query.rpc.Query"; -import * as _603 from "./stargaze/mint/v1beta1/query.rpc.Query"; -import * as _604 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; -import * as _605 from "./stargaze/cron/v1/tx.rpc.msg"; -import * as _606 from "./stargaze/globalfee/v1/tx.rpc.msg"; -import * as _670 from "./rpc.query"; -import * as _671 from "./rpc.tx"; +import * as _315 from "./stargaze/alloc/v1beta1/genesis"; +import * as _316 from "./stargaze/alloc/v1beta1/params"; +import * as _317 from "./stargaze/alloc/v1beta1/query"; +import * as _318 from "./stargaze/alloc/v1beta1/tx"; +import * as _319 from "./stargaze/cron/v1/cron"; +import * as _320 from "./stargaze/cron/v1/genesis"; +import * as _321 from "./stargaze/cron/v1/proposal"; +import * as _322 from "./stargaze/cron/v1/query"; +import * as _323 from "./stargaze/cron/v1/tx"; +import * as _324 from "./stargaze/globalfee/v1/genesis"; +import * as _325 from "./stargaze/globalfee/v1/globalfee"; +import * as _326 from "./stargaze/globalfee/v1/proposal"; +import * as _327 from "./stargaze/globalfee/v1/query"; +import * as _328 from "./stargaze/globalfee/v1/tx"; +import * as _329 from "./stargaze/mint/v1beta1/genesis"; +import * as _330 from "./stargaze/mint/v1beta1/mint"; +import * as _331 from "./stargaze/mint/v1beta1/query"; +import * as _332 from "./stargaze/mint/v1beta1/tx"; +import * as _605 from "./stargaze/alloc/v1beta1/tx.amino"; +import * as _606 from "./stargaze/cron/v1/tx.amino"; +import * as _607 from "./stargaze/globalfee/v1/tx.amino"; +import * as _608 from "./stargaze/alloc/v1beta1/tx.registry"; +import * as _609 from "./stargaze/cron/v1/tx.registry"; +import * as _610 from "./stargaze/globalfee/v1/tx.registry"; +import * as _611 from "./stargaze/alloc/v1beta1/query.rpc.Query"; +import * as _612 from "./stargaze/cron/v1/query.rpc.Query"; +import * as _613 from "./stargaze/globalfee/v1/query.rpc.Query"; +import * as _614 from "./stargaze/mint/v1beta1/query.rpc.Query"; +import * as _615 from "./stargaze/alloc/v1beta1/tx.rpc.msg"; +import * as _616 from "./stargaze/cron/v1/tx.rpc.msg"; +import * as _617 from "./stargaze/globalfee/v1/tx.rpc.msg"; +import * as _683 from "./rpc.query"; +import * as _684 from "./rpc.tx"; export namespace publicawesome { export namespace stargaze { export namespace alloc { export const v1beta1 = { - ..._308, - ..._309, - ..._310, - ..._311, - ..._594, - ..._597, - ..._600, - ..._604 - }; - } - export namespace cron { - export const v1 = { - ..._312, - ..._313, - ..._314, ..._315, ..._316, - ..._595, - ..._598, - ..._601, - ..._605 + ..._317, + ..._318, + ..._605, + ..._608, + ..._611, + ..._615 }; } - export namespace globalfee { + export namespace cron { export const v1 = { - ..._317, - ..._318, ..._319, ..._320, ..._321, - ..._596, - ..._599, - ..._602, - ..._606 - }; - } - export namespace mint { - export const v1beta1 = { ..._322, ..._323, + ..._606, + ..._609, + ..._612, + ..._616 + }; + } + export namespace globalfee { + export const v1 = { ..._324, ..._325, - ..._603 + ..._326, + ..._327, + ..._328, + ..._607, + ..._610, + ..._613, + ..._617 + }; + } + export namespace mint { + export const v1beta1 = { + ..._329, + ..._330, + ..._331, + ..._332, + ..._614 }; } } export const ClientFactory = { - ..._670, - ..._671 + ..._683, + ..._684 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/regen/bundle.ts b/packages/types/protobuf/codegen/regen/bundle.ts index 2368af012..c6d21fc3d 100644 --- a/packages/types/protobuf/codegen/regen/bundle.ts +++ b/packages/types/protobuf/codegen/regen/bundle.ts @@ -1,134 +1,134 @@ -import * as _326 from "./data/v1/events"; -import * as _327 from "./data/v1/state"; -import * as _328 from "./data/v1/tx"; -import * as _329 from "./data/v1/types"; -import * as _330 from "./data/v2/events"; -import * as _331 from "./data/v2/state"; -import * as _332 from "./data/v2/tx"; -import * as _333 from "./data/v2/types"; -import * as _334 from "./ecocredit/basket/v1/events"; -import * as _335 from "./ecocredit/basket/v1/state"; -import * as _336 from "./ecocredit/basket/v1/tx"; -import * as _337 from "./ecocredit/basket/v1/types"; -import * as _338 from "./ecocredit/marketplace/v1/events"; -import * as _339 from "./ecocredit/marketplace/v1/state"; -import * as _340 from "./ecocredit/marketplace/v1/tx"; -import * as _341 from "./ecocredit/marketplace/v1/types"; -import * as _342 from "./ecocredit/orderbook/v1alpha1/memory"; -import * as _343 from "./ecocredit/v1/events"; -import * as _344 from "./ecocredit/v1/state"; -import * as _345 from "./ecocredit/v1/tx"; -import * as _346 from "./ecocredit/v1/types"; -import * as _347 from "./ecocredit/v1alpha1/events"; -import * as _348 from "./ecocredit/v1alpha1/genesis"; -import * as _349 from "./ecocredit/v1alpha1/tx"; -import * as _350 from "./ecocredit/v1alpha1/types"; -import * as _351 from "./intertx/v1/query"; -import * as _352 from "./intertx/v1/tx"; -import * as _607 from "./data/v1/tx.amino"; -import * as _608 from "./data/v2/tx.amino"; -import * as _609 from "./ecocredit/basket/v1/tx.amino"; -import * as _610 from "./ecocredit/marketplace/v1/tx.amino"; -import * as _611 from "./ecocredit/v1/tx.amino"; -import * as _612 from "./ecocredit/v1alpha1/tx.amino"; -import * as _613 from "./intertx/v1/tx.amino"; -import * as _614 from "./data/v1/tx.registry"; -import * as _615 from "./data/v2/tx.registry"; -import * as _616 from "./ecocredit/basket/v1/tx.registry"; -import * as _617 from "./ecocredit/marketplace/v1/tx.registry"; -import * as _618 from "./ecocredit/v1/tx.registry"; -import * as _619 from "./ecocredit/v1alpha1/tx.registry"; -import * as _620 from "./intertx/v1/tx.registry"; -import * as _621 from "./intertx/v1/query.rpc.Query"; -import * as _622 from "./data/v1/tx.rpc.msg"; -import * as _623 from "./data/v2/tx.rpc.msg"; -import * as _624 from "./ecocredit/basket/v1/tx.rpc.msg"; -import * as _625 from "./ecocredit/marketplace/v1/tx.rpc.msg"; -import * as _626 from "./ecocredit/v1/tx.rpc.msg"; -import * as _627 from "./ecocredit/v1alpha1/tx.rpc.msg"; -import * as _628 from "./intertx/v1/tx.rpc.msg"; -import * as _672 from "./rpc.query"; -import * as _673 from "./rpc.tx"; +import * as _333 from "./data/v1/events"; +import * as _334 from "./data/v1/state"; +import * as _335 from "./data/v1/tx"; +import * as _336 from "./data/v1/types"; +import * as _337 from "./data/v2/events"; +import * as _338 from "./data/v2/state"; +import * as _339 from "./data/v2/tx"; +import * as _340 from "./data/v2/types"; +import * as _341 from "./ecocredit/basket/v1/events"; +import * as _342 from "./ecocredit/basket/v1/state"; +import * as _343 from "./ecocredit/basket/v1/tx"; +import * as _344 from "./ecocredit/basket/v1/types"; +import * as _345 from "./ecocredit/marketplace/v1/events"; +import * as _346 from "./ecocredit/marketplace/v1/state"; +import * as _347 from "./ecocredit/marketplace/v1/tx"; +import * as _348 from "./ecocredit/marketplace/v1/types"; +import * as _349 from "./ecocredit/orderbook/v1alpha1/memory"; +import * as _350 from "./ecocredit/v1/events"; +import * as _351 from "./ecocredit/v1/state"; +import * as _352 from "./ecocredit/v1/tx"; +import * as _353 from "./ecocredit/v1/types"; +import * as _354 from "./ecocredit/v1alpha1/events"; +import * as _355 from "./ecocredit/v1alpha1/genesis"; +import * as _356 from "./ecocredit/v1alpha1/tx"; +import * as _357 from "./ecocredit/v1alpha1/types"; +import * as _358 from "./intertx/v1/query"; +import * as _359 from "./intertx/v1/tx"; +import * as _618 from "./data/v1/tx.amino"; +import * as _619 from "./data/v2/tx.amino"; +import * as _620 from "./ecocredit/basket/v1/tx.amino"; +import * as _621 from "./ecocredit/marketplace/v1/tx.amino"; +import * as _622 from "./ecocredit/v1/tx.amino"; +import * as _623 from "./ecocredit/v1alpha1/tx.amino"; +import * as _624 from "./intertx/v1/tx.amino"; +import * as _625 from "./data/v1/tx.registry"; +import * as _626 from "./data/v2/tx.registry"; +import * as _627 from "./ecocredit/basket/v1/tx.registry"; +import * as _628 from "./ecocredit/marketplace/v1/tx.registry"; +import * as _629 from "./ecocredit/v1/tx.registry"; +import * as _630 from "./ecocredit/v1alpha1/tx.registry"; +import * as _631 from "./intertx/v1/tx.registry"; +import * as _632 from "./intertx/v1/query.rpc.Query"; +import * as _633 from "./data/v1/tx.rpc.msg"; +import * as _634 from "./data/v2/tx.rpc.msg"; +import * as _635 from "./ecocredit/basket/v1/tx.rpc.msg"; +import * as _636 from "./ecocredit/marketplace/v1/tx.rpc.msg"; +import * as _637 from "./ecocredit/v1/tx.rpc.msg"; +import * as _638 from "./ecocredit/v1alpha1/tx.rpc.msg"; +import * as _639 from "./intertx/v1/tx.rpc.msg"; +import * as _685 from "./rpc.query"; +import * as _686 from "./rpc.tx"; export namespace regen { export namespace data { export const v1 = { - ..._326, - ..._327, - ..._328, - ..._329, - ..._607, - ..._614, - ..._622 + ..._333, + ..._334, + ..._335, + ..._336, + ..._618, + ..._625, + ..._633 }; export const v2 = { - ..._330, - ..._331, - ..._332, - ..._333, - ..._608, - ..._615, - ..._623 + ..._337, + ..._338, + ..._339, + ..._340, + ..._619, + ..._626, + ..._634 }; } export namespace ecocredit { export namespace basket { export const v1 = { - ..._334, - ..._335, - ..._336, - ..._337, - ..._609, - ..._616, - ..._624 + ..._341, + ..._342, + ..._343, + ..._344, + ..._620, + ..._627, + ..._635 }; } export namespace marketplace { export const v1 = { - ..._338, - ..._339, - ..._340, - ..._341, - ..._610, - ..._617, - ..._625 + ..._345, + ..._346, + ..._347, + ..._348, + ..._621, + ..._628, + ..._636 }; } export namespace orderbook { export const v1alpha1 = { - ..._342 + ..._349 }; } export const v1 = { - ..._343, - ..._344, - ..._345, - ..._346, - ..._611, - ..._618, - ..._626 + ..._350, + ..._351, + ..._352, + ..._353, + ..._622, + ..._629, + ..._637 }; export const v1alpha1 = { - ..._347, - ..._348, - ..._349, - ..._350, - ..._612, - ..._619, - ..._627 + ..._354, + ..._355, + ..._356, + ..._357, + ..._623, + ..._630, + ..._638 }; } export namespace intertx { export const v1 = { - ..._351, - ..._352, - ..._613, - ..._620, - ..._621, - ..._628 + ..._358, + ..._359, + ..._624, + ..._631, + ..._632, + ..._639 }; } export const ClientFactory = { - ..._672, - ..._673 + ..._685, + ..._686 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/secret/bundle.ts b/packages/types/protobuf/codegen/secret/bundle.ts index 0b45cdc14..5705a1c95 100644 --- a/packages/types/protobuf/codegen/secret/bundle.ts +++ b/packages/types/protobuf/codegen/secret/bundle.ts @@ -1,78 +1,78 @@ -import * as _353 from "./compute/v1beta1/genesis"; -import * as _354 from "./compute/v1beta1/msg"; -import * as _355 from "./compute/v1beta1/query"; -import * as _356 from "./compute/v1beta1/types"; -import * as _357 from "./emergencybutton/v1beta1/genesis"; -import * as _358 from "./emergencybutton/v1beta1/params"; -import * as _359 from "./emergencybutton/v1beta1/query"; -import * as _360 from "./emergencybutton/v1beta1/tx"; -import * as _361 from "./intertx/v1beta1/query"; -import * as _362 from "./intertx/v1beta1/tx"; -import * as _363 from "./registration/v1beta1/genesis"; -import * as _364 from "./registration/v1beta1/msg"; -import * as _365 from "./registration/v1beta1/query"; -import * as _366 from "./registration/v1beta1/types"; -import * as _629 from "./compute/v1beta1/msg.amino"; -import * as _630 from "./emergencybutton/v1beta1/tx.amino"; -import * as _631 from "./intertx/v1beta1/tx.amino"; -import * as _632 from "./compute/v1beta1/msg.registry"; -import * as _633 from "./emergencybutton/v1beta1/tx.registry"; -import * as _634 from "./intertx/v1beta1/tx.registry"; -import * as _635 from "./compute/v1beta1/query.rpc.Query"; -import * as _636 from "./emergencybutton/v1beta1/query.rpc.Query"; -import * as _637 from "./intertx/v1beta1/query.rpc.Query"; -import * as _638 from "./registration/v1beta1/query.rpc.Query"; -import * as _639 from "./compute/v1beta1/msg.rpc.msg"; -import * as _640 from "./emergencybutton/v1beta1/tx.rpc.msg"; -import * as _641 from "./intertx/v1beta1/tx.rpc.msg"; -import * as _674 from "./rpc.query"; -import * as _675 from "./rpc.tx"; +import * as _360 from "./compute/v1beta1/genesis"; +import * as _361 from "./compute/v1beta1/msg"; +import * as _362 from "./compute/v1beta1/query"; +import * as _363 from "./compute/v1beta1/types"; +import * as _364 from "./emergencybutton/v1beta1/genesis"; +import * as _365 from "./emergencybutton/v1beta1/params"; +import * as _366 from "./emergencybutton/v1beta1/query"; +import * as _367 from "./emergencybutton/v1beta1/tx"; +import * as _368 from "./intertx/v1beta1/query"; +import * as _369 from "./intertx/v1beta1/tx"; +import * as _370 from "./registration/v1beta1/genesis"; +import * as _371 from "./registration/v1beta1/msg"; +import * as _372 from "./registration/v1beta1/query"; +import * as _373 from "./registration/v1beta1/types"; +import * as _640 from "./compute/v1beta1/msg.amino"; +import * as _641 from "./emergencybutton/v1beta1/tx.amino"; +import * as _642 from "./intertx/v1beta1/tx.amino"; +import * as _643 from "./compute/v1beta1/msg.registry"; +import * as _644 from "./emergencybutton/v1beta1/tx.registry"; +import * as _645 from "./intertx/v1beta1/tx.registry"; +import * as _646 from "./compute/v1beta1/query.rpc.Query"; +import * as _647 from "./emergencybutton/v1beta1/query.rpc.Query"; +import * as _648 from "./intertx/v1beta1/query.rpc.Query"; +import * as _649 from "./registration/v1beta1/query.rpc.Query"; +import * as _650 from "./compute/v1beta1/msg.rpc.msg"; +import * as _651 from "./emergencybutton/v1beta1/tx.rpc.msg"; +import * as _652 from "./intertx/v1beta1/tx.rpc.msg"; +import * as _687 from "./rpc.query"; +import * as _688 from "./rpc.tx"; export namespace secret { export namespace compute { export const v1beta1 = { - ..._353, - ..._354, - ..._355, - ..._356, - ..._629, - ..._632, - ..._635, - ..._639 + ..._360, + ..._361, + ..._362, + ..._363, + ..._640, + ..._643, + ..._646, + ..._650 }; } export namespace emergencybutton { export const v1beta1 = { - ..._357, - ..._358, - ..._359, - ..._360, - ..._630, - ..._633, - ..._636, - ..._640 + ..._364, + ..._365, + ..._366, + ..._367, + ..._641, + ..._644, + ..._647, + ..._651 }; } export namespace intertx { export const v1beta1 = { - ..._361, - ..._362, - ..._631, - ..._634, - ..._637, - ..._641 + ..._368, + ..._369, + ..._642, + ..._645, + ..._648, + ..._652 }; } export namespace registration { export const v1beta1 = { - ..._363, - ..._364, - ..._365, - ..._366, - ..._638 + ..._370, + ..._371, + ..._372, + ..._373, + ..._649 }; } export const ClientFactory = { - ..._674, - ..._675 + ..._687, + ..._688 }; } \ No newline at end of file diff --git a/packages/types/protobuf/codegen/tendermint/bundle.ts b/packages/types/protobuf/codegen/tendermint/bundle.ts index b19a28221..aae183c52 100644 --- a/packages/types/protobuf/codegen/tendermint/bundle.ts +++ b/packages/types/protobuf/codegen/tendermint/bundle.ts @@ -1,32 +1,32 @@ -import * as _370 from "./abci/types"; -import * as _371 from "./crypto/keys"; -import * as _372 from "./crypto/proof"; -import * as _373 from "./p2p/types"; -import * as _374 from "./types/block"; -import * as _375 from "./types/evidence"; -import * as _376 from "./types/params"; -import * as _377 from "./types/types"; -import * as _378 from "./types/validator"; -import * as _379 from "./version/types"; +import * as _377 from "./abci/types"; +import * as _378 from "./crypto/keys"; +import * as _379 from "./crypto/proof"; +import * as _380 from "./p2p/types"; +import * as _381 from "./types/block"; +import * as _382 from "./types/evidence"; +import * as _383 from "./types/params"; +import * as _384 from "./types/types"; +import * as _385 from "./types/validator"; +import * as _386 from "./version/types"; export namespace tendermint { export const abci = { - ..._370 + ..._377 }; export const crypto = { - ..._371, - ..._372 + ..._378, + ..._379 }; export const p2p = { - ..._373 + ..._380 }; export const types = { - ..._374, - ..._375, - ..._376, - ..._377, - ..._378 + ..._381, + ..._382, + ..._383, + ..._384, + ..._385 }; export const version = { - ..._379 + ..._386 }; } \ No newline at end of file diff --git a/packages/types/protobuf/proto/interchain_security/ccv/consumer/v1/consumer.proto b/packages/types/protobuf/proto/interchain_security/ccv/consumer/v1/consumer.proto new file mode 100644 index 000000000..e77b5c9a1 --- /dev/null +++ b/packages/types/protobuf/proto/interchain_security/ccv/consumer/v1/consumer.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; +package interchain_security.ccv.consumer.v1; + +option go_package = "github.com/cosmos/interchain-security/v5/x/ccv/consumer/types"; + +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/timestamp.proto"; + +// +// Note any type defined in this file is ONLY used internally to the consumer +// CCV module. These schemas can change with proper consideration of +// compatibility or migration. + +// CrossChainValidator defines the type used to store validator information +// internal to the consumer CCV module. Note one cross chain validator entry is +// persisted for each consumer validator, where incoming VSC packets update this +// data, which is eventually forwarded to comet for consumer chain consensus. +// +// Note this type is only used internally to the consumer CCV module. +message CrossChainValidator { + bytes address = 1; + int64 power = 2; + // pubkey is the consensus public key of the validator, as a Protobuf Any. + google.protobuf.Any pubkey = 3 [ + (cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey", + (gogoproto.moretags) = "yaml:\"consensus_pubkey\"" + ]; + + // !!! DEPRECATED !!! opted_out is deprecated because after the introduction of Partial Set Security (PSS) + // we removed the soft opt-out feature. + bool opted_out = 4 [deprecated = true]; +} + +// A record storing the state of a slash packet sent to the provider chain +// which may bounce back and forth until handled by the provider. +// +// Note this type is only used internally to the consumer CCV module. +message SlashRecord { + bool waiting_on_reply = 1; + google.protobuf.Timestamp send_time = 2 + [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; +} diff --git a/packages/types/protobuf/proto/interchain_security/ccv/consumer/v1/genesis.proto b/packages/types/protobuf/proto/interchain_security/ccv/consumer/v1/genesis.proto new file mode 100644 index 000000000..642b78451 --- /dev/null +++ b/packages/types/protobuf/proto/interchain_security/ccv/consumer/v1/genesis.proto @@ -0,0 +1,92 @@ +syntax = "proto3"; + +package interchain_security.ccv.consumer.v1; + +option go_package = "github.com/cosmos/interchain-security/v5/x/ccv/consumer/types"; + +import "interchain_security/ccv/v1/shared_consumer.proto"; +import "ibc/lightclients/tendermint/v1/tendermint.proto"; + +import "gogoproto/gogo.proto"; +import "interchain_security/ccv/v1/wire.proto"; +import "google/protobuf/timestamp.proto"; +import "tendermint/abci/types.proto"; + + + + +// GenesisState defines the CCV consumer genesis state +// +// Note: this type is only used on consumer side and references shared types with +// provider +message GenesisState { + // ConsumerParams is a shared type with provider module + interchain_security.ccv.v1.ConsumerParams params = 1 + [ (gogoproto.nullable) = false ]; + // Client ID of the provider. Empty for a new chain, filled in on restart. + string provider_client_id = 2; + // Channel ID of the provider. Empty for a new chain, filled in on restart. + string provider_channel_id = 3; + // true for new chain, false for chain restart. + bool new_chain = 4; + // !!! DEPRECATED !!! ProviderClientState is deprecated. Use provider.client_state instead + ibc.lightclients.tendermint.v1.ClientState provider_client_state = 5 [ deprecated = true]; + // !!! DEPRECATED !!! ProviderConsensusState is deprecated. Use provider.consensus_state instead + ibc.lightclients.tendermint.v1.ConsensusState provider_consensus_state = 6 [ deprecated = true]; + // MaturingPackets nil on new chain, filled in on restart. + repeated MaturingVSCPacket maturing_packets = 7 + [ (gogoproto.nullable) = false ]; + // !!! DEPRECATED !!!! InitialValset is deprecated. Use provider.initial_val_set instead + repeated .tendermint.abci.ValidatorUpdate initial_val_set = 8 [ (gogoproto.nullable) = false, deprecated = true ]; + // HeightToValsetUpdateId nil on new chain, filled in on restart. + repeated HeightToValsetUpdateID height_to_valset_update_id = 9 + [ (gogoproto.nullable) = false ]; + // OutstandingDowntimes nil on new chain, filled in on restart. + repeated OutstandingDowntime outstanding_downtime_slashing = 10 + [ (gogoproto.nullable) = false ]; + // PendingConsumerPackets nil on new chain, filled in on restart. + ConsumerPacketDataList pending_consumer_packets = 11 + [ (gogoproto.nullable) = false ]; + // LastTransmissionBlockHeight nil on new chain, filled in on restart. + LastTransmissionBlockHeight last_transmission_block_height = 12 + [ (gogoproto.nullable) = false ]; + // flag indicating whether the consumer CCV module starts in pre-CCV state + bool preCCV = 13; + interchain_security.ccv.v1.ProviderInfo provider = 14 + [ (gogoproto.nullable) = false ]; +} + +// HeightValsetUpdateID represents a mapping internal to the consumer CCV module +// which links a block height to each recv valset update id. +message HeightToValsetUpdateID { + uint64 height = 1; + uint64 valset_update_id = 2; +} + +// OutstandingDowntime defines the type used internally to the consumer CCV +// module and is used in order to not send multiple slashing requests for +// the same downtime infraction. +message OutstandingDowntime { string validator_consensus_address = 1; } + +// LastTransmissionBlockHeight is the last time validator holding +// pools were transmitted to the provider chain. This type is used internally +// to the consumer CCV module. +message LastTransmissionBlockHeight { int64 height = 1; } + +// MaturingVSCPacket represents a vsc packet that is maturing internal to the +// consumer CCV module, where the consumer has not yet relayed a VSCMatured +// packet back to the provider. +message MaturingVSCPacket { + uint64 vscId = 1; + google.protobuf.Timestamp maturity_time = 2 + [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; +} + +// ConsumerPacketDataList is a list of consumer packet data packets. +// +// Note this type is used internally to the consumer CCV module +// for exporting / importing state in InitGenesis and ExportGenesis. +message ConsumerPacketDataList { + repeated interchain_security.ccv.v1.ConsumerPacketData list = 1 + [ (gogoproto.nullable) = false ]; +} diff --git a/packages/types/protobuf/proto/interchain_security/ccv/consumer/v1/query.proto b/packages/types/protobuf/proto/interchain_security/ccv/consumer/v1/query.proto new file mode 100644 index 000000000..0e9b088e1 --- /dev/null +++ b/packages/types/protobuf/proto/interchain_security/ccv/consumer/v1/query.proto @@ -0,0 +1,87 @@ +syntax = "proto3"; + +package interchain_security.ccv.consumer.v1; +import "interchain_security/ccv/v1/shared_consumer.proto"; +option go_package = "github.com/cosmos/interchain-security/v5/x/ccv/consumer/types"; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "interchain_security/ccv/consumer/v1/consumer.proto"; +import "interchain_security/ccv/v1/wire.proto"; + +service Query { + // ConsumerGenesis queries the genesis state needed to start a consumer chain + // whose proposal has been accepted + rpc QueryNextFeeDistribution(QueryNextFeeDistributionEstimateRequest) + returns (QueryNextFeeDistributionEstimateResponse) { + option (google.api.http).get = + "/interchain_security/ccv/consumer/next-fee-distribution"; + } + // QueryParams queries the ccv/consumer module parameters. + rpc QueryParams(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/interchain_security/ccv/consumer/params"; + } + + rpc QueryProviderInfo(QueryProviderInfoRequest) returns (QueryProviderInfoResponse) { + option (google.api.http).get = "/interchain_security/ccv/consumer/provider-info"; + } + + // QueryThrottleState returns on-chain state relevant to throttled consumer packets + rpc QueryThrottleState(QueryThrottleStateRequest) returns (QueryThrottleStateResponse) { + option (google.api.http).get = "/interchain_security/ccv/consumer/throttle_state"; + } +} + +// NextFeeDistributionEstimate holds information about next fee distribution +message NextFeeDistributionEstimate { + // current block height at the time of querying + int64 currentHeight = 1; + // block height at which last distribution took place + int64 lastHeight = 2; + // block height at which next distribution will take place + int64 nextHeight = 3; + // ratio between consumer and provider fee distribution + string distribution_fraction = 4; + // total accruead fees at the time of querying + string total = 5; + // amount distributed to provider chain + string toProvider = 6; + // amount distributed (kept) by consumer chain + string toConsumer = 7; +} + +message QueryNextFeeDistributionEstimateRequest {} + +message QueryNextFeeDistributionEstimateResponse { + NextFeeDistributionEstimate data = 1; +} + +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + interchain_security.ccv.v1.ConsumerParams params = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryProviderInfoRequest {} + +message QueryProviderInfoResponse { + ChainInfo consumer = 1 [ (gogoproto.nullable) = false ]; + ChainInfo provider = 2 [ (gogoproto.nullable) = false ]; +} + +message QueryThrottleStateRequest {} + +message QueryThrottleStateResponse { + SlashRecord slash_record = 1 [ (gogoproto.nullable) = true ]; + repeated interchain_security.ccv.v1.ConsumerPacketData packet_data_queue = 2 [ (gogoproto.nullable) = false ]; +} + + +message ChainInfo { + string chainID = 1; + string clientID = 2; + string connectionID = 3; + string channelID = 4; +} diff --git a/packages/types/protobuf/proto/interchain_security/ccv/consumer/v1/tx.proto b/packages/types/protobuf/proto/interchain_security/ccv/consumer/v1/tx.proto new file mode 100644 index 000000000..e76b8dd3b --- /dev/null +++ b/packages/types/protobuf/proto/interchain_security/ccv/consumer/v1/tx.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package interchain_security.ccv.consumer.v1; +option go_package = "github.com/cosmos/interchain-security/v5/x/ccv/consumer/types"; + +import "amino/amino.proto"; +import "google/api/annotations.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "interchain_security/ccv/v1/shared_consumer.proto"; + +// Msg defines the Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // signer is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/provider parameters to update. + interchain_security.ccv.v1.ConsumerParams params = 2 [(gogoproto.nullable) = false]; +} + +message MsgUpdateParamsResponse {} diff --git a/packages/types/protobuf/proto/interchain_security/ccv/v1/shared_consumer.proto b/packages/types/protobuf/proto/interchain_security/ccv/v1/shared_consumer.proto new file mode 100644 index 000000000..f1535df01 --- /dev/null +++ b/packages/types/protobuf/proto/interchain_security/ccv/v1/shared_consumer.proto @@ -0,0 +1,100 @@ +syntax = "proto3"; + +package interchain_security.ccv.v1; + +option go_package = "github.com/cosmos/interchain-security/v5/x/ccv/types"; + +import "tendermint/abci/types.proto"; +import "ibc/lightclients/tendermint/v1/tendermint.proto"; +import "google/protobuf/duration.proto"; +import "gogoproto/gogo.proto"; + +// +// Note any type defined in this file is referenced/persisted in both the +// consumer and provider CCV modules, but not sent over the wire. These schemas +// could change, only with careful consideration of effects! +// + +// ConsumerParams defines the parameters for CCV consumer module. +// +// Note this type is referenced in both the consumer and provider CCV modules, +// and persisted on the provider, see MakeConsumerGenesis and +// SetConsumerGenesis. +// +message ConsumerParams { + // TODO: Remove enabled flag and find a better way to setup integration tests + // See: https://github.com/cosmos/interchain-security/issues/339 + bool enabled = 1; + + /////////////////////// + // Distribution Params + // Number of blocks between ibc-token-transfers from the consumer chain to + // the provider chain. Note that at this transmission event a fraction of + // the accumulated tokens are divided and sent consumer redistribution + // address. + int64 blocks_per_distribution_transmission = 2; + + // Channel, and provider-chain receiving address to send distribution token + // transfers over. These parameters is auto-set during the consumer <-> + // provider handshake procedure. + string distribution_transmission_channel = 3; + string provider_fee_pool_addr_str = 4; + // Sent CCV related IBC packets will timeout after this duration + google.protobuf.Duration ccv_timeout_period = 5 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + + // Sent transfer related IBC packets will timeout after this duration + google.protobuf.Duration transfer_timeout_period = 6 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + + // The fraction of tokens allocated to the consumer redistribution address + // during distribution events. The fraction is a string representing a + // decimal number. For example "0.75" would represent 75%. + string consumer_redistribution_fraction = 7; + + // The number of historical info entries to persist in store. + // This param is a part of the cosmos sdk staking module. In the case of + // a ccv enabled consumer chain, the ccv module acts as the staking module. + int64 historical_entries = 8; + + // Unbonding period for the consumer, + // which should be smaller than that of the provider in general. + google.protobuf.Duration unbonding_period = 9 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + + // !!! DEPRECATED !!! soft_opt_out_threshold is deprecated. see docs/docs/adrs/adr-015-partial-set-security.md + string soft_opt_out_threshold = 10 [deprecated = true]; + + // Reward denoms. These are the denominations which are allowed to be sent to + // the provider as rewards. + repeated string reward_denoms = 11; + + // Provider-originated reward denoms. These are denoms coming from the + // provider which are allowed to be used as rewards. e.g. "uatom" + repeated string provider_reward_denoms = 12; + + // The period after which a consumer can retry sending a throttled packet. + google.protobuf.Duration retry_delay_period = 13 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; +} + +// ConsumerGenesisState defines shared genesis information between provider and +// consumer +message ConsumerGenesisState { + ConsumerParams params = 1 [ (gogoproto.nullable) = false ]; + ProviderInfo provider = 2 [ (gogoproto.nullable) = false ]; + // true for new chain, false for chain restart. + bool new_chain = 3; // TODO:Check if this is really needed +} + +// ProviderInfo defines all information a consumer needs from a provider +// Shared data type between provider and consumer +message ProviderInfo { + // ProviderClientState filled in on new chain, nil on restart. + ibc.lightclients.tendermint.v1.ClientState client_state = 1; + // ProviderConsensusState filled in on new chain, nil on restart. + ibc.lightclients.tendermint.v1.ConsensusState consensus_state = 2; + // InitialValset filled in on new chain and on restart. + repeated .tendermint.abci.ValidatorUpdate initial_val_set = 3 + [ (gogoproto.nullable) = false ]; +} diff --git a/packages/types/protobuf/proto/interchain_security/ccv/v1/wire.proto b/packages/types/protobuf/proto/interchain_security/ccv/v1/wire.proto new file mode 100644 index 000000000..f0ba6ab41 --- /dev/null +++ b/packages/types/protobuf/proto/interchain_security/ccv/v1/wire.proto @@ -0,0 +1,122 @@ +syntax = "proto3"; + +package interchain_security.ccv.v1; + +option go_package = "github.com/cosmos/interchain-security/v5/x/ccv/types"; + +import "cosmos/staking/v1beta1/staking.proto"; + +import "gogoproto/gogo.proto"; +import "tendermint/abci/types.proto"; + +// +// Note any type defined in this file is used by both the consumer and provider +// AND SENT OVER THE WIRE via a ccv channel. Ideally these schemas should never change, or at least +// be backwards compatible if ever changed. +// + +// This packet is sent from provider chain to consumer chain if the validator +// set for consumer chain changes (due to new bonding/unbonding messages or +// slashing events) A VSCMatured packet from consumer chain will be sent +// asynchronously once unbonding period is over, and this will function as +// `UnbondingOver` message for this packet. +message ValidatorSetChangePacketData { + repeated .tendermint.abci.ValidatorUpdate validator_updates = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"validator_updates\"" + ]; + uint64 valset_update_id = 2; + // consensus address of consumer chain validators + // successfully slashed on the provider chain + repeated string slash_acks = 3; +} + +// This packet is sent from the consumer chain to the provider chain +// to notify that a VSC packet reached maturity on the consumer chain. +message VSCMaturedPacketData { + // the id of the VSC packet that reached maturity + uint64 valset_update_id = 1; +} + +// This packet is sent from the consumer chain to the provider chain +// to request the slashing of a validator as a result of an infraction +// committed on the consumer chain. +message SlashPacketData { + tendermint.abci.Validator validator = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"validator\"" + ]; + // map to the infraction block height on the provider + uint64 valset_update_id = 2; + // tell if the slashing is for a downtime or a double-signing infraction + cosmos.staking.v1beta1.Infraction infraction = 3; +} + +// ConsumerPacketData contains a consumer packet data and a type tag +message ConsumerPacketData { + ConsumerPacketDataType type = 1; + + oneof data { + SlashPacketData slashPacketData = 2; + VSCMaturedPacketData vscMaturedPacketData = 3; + } +} + +// ConsumerPacketType indicates interchain security specific packet types. +enum ConsumerPacketDataType { + option (gogoproto.goproto_enum_prefix) = false; + + // UNSPECIFIED packet type + CONSUMER_PACKET_TYPE_UNSPECIFIED = 0 + [ (gogoproto.enumvalue_customname) = "UnspecifiedPacket" ]; + // Slash packet + CONSUMER_PACKET_TYPE_SLASH = 1 + [ (gogoproto.enumvalue_customname) = "SlashPacket" ]; + // VSCMatured packet + CONSUMER_PACKET_TYPE_VSCM = 2 + [ (gogoproto.enumvalue_customname) = "VscMaturedPacket" ]; +} + +// Note this type is used during IBC handshake methods for both the consumer and provider +message HandshakeMetadata { + string provider_fee_pool_addr = 1; + string version = 2; +} + +// ConsumerPacketData contains a consumer packet data and a type tag +// that is compatible with ICS v1 and v2 over the wire. It is not used for internal storage. +message ConsumerPacketDataV1 { + ConsumerPacketDataType type = 1; + + oneof data { + SlashPacketDataV1 slashPacketData = 2; + VSCMaturedPacketData vscMaturedPacketData = 3; + } +} + +// This packet is sent from the consumer chain to the provider chain +// It is backward compatible with the ICS v1 and v2 version of the packet. +message SlashPacketDataV1 { + tendermint.abci.Validator validator = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"validator\"" + ]; + // map to the infraction block height on the provider + uint64 valset_update_id = 2; + // tell if the slashing is for a downtime or a double-signing infraction + InfractionType infraction = 3; +} + +// InfractionType indicates the infraction type a validator committed. +// Note ccv.InfractionType to maintain compatibility between ICS versions +// using different versions of the cosmos-sdk and ibc-go modules. +enum InfractionType { + option (gogoproto.goproto_enum_prefix) = false; + + // UNSPECIFIED defines an empty infraction type. + INFRACTION_TYPE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "InfractionEmpty"]; + // DOUBLE_SIGN defines a validator that double-signs a block. + INFRACTION_TYPE_DOUBLE_SIGN = 1 [(gogoproto.enumvalue_customname) = "DoubleSign"]; + // DOWNTIME defines a validator that missed signing too many blocks. + INFRACTION_TYPE_DOWNTIME = 2 [(gogoproto.enumvalue_customname) = "Downtime"]; +} diff --git a/packages/types/protobuf/scripts/codegen.js b/packages/types/protobuf/scripts/codegen.js index 073c70e5c..94d2f079c 100644 --- a/packages/types/protobuf/scripts/codegen.js +++ b/packages/types/protobuf/scripts/codegen.js @@ -124,6 +124,7 @@ telescope({ 'secret.intertx.v1beta1', 'secret.registration.v1beta1', 'OmniFlix.onft.v1beta1', + 'interchain_security.ccv.consumer.v1', // interferes with v1beta1 MsgSubmitProposal amino encoders since the // type names overlap From 717a54c3da1f2a5a3145f5d4c494309fdd4ac357 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 23 Jul 2024 17:20:15 -0400 Subject: [PATCH 341/438] added ccv query for neutron in polytone script --- packages/dispatch/scripts/polytone.ts | 38 +++-- packages/utils/client.ts | 192 ++++++++++---------------- 2 files changed, 95 insertions(+), 135 deletions(-) diff --git a/packages/dispatch/scripts/polytone.ts b/packages/dispatch/scripts/polytone.ts index 7bf6074c7..2abf5a2dc 100644 --- a/packages/dispatch/scripts/polytone.ts +++ b/packages/dispatch/scripts/polytone.ts @@ -1,8 +1,6 @@ import { IbcClient, Link, Logger } from '@confio/relayer' import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate' import { DirectSecp256k1HdWallet } from '@cosmjs/proto-signing' -import { QueryClient, setupStakingExtension } from '@cosmjs/stargate' -import { connectComet } from '@cosmjs/tendermint-rpc' import chalk from 'chalk' import { Command } from 'commander' import dotenv from 'dotenv' @@ -19,6 +17,7 @@ import { getNativeTokenForChainId, getRpcForChainId, ibcProtoRpcClientRouter, + interchainSecurityProtoRpcClientRouter, maybeGetChainForChainId, } from '@dao-dao/utils' @@ -399,8 +398,10 @@ const main = async () => { let link: Link if (newConnection) { - // For Neutron, which does not have staking, use its parent chain's (Cosmos - // Hub's) unbonding time instead. This is needed to create a new + // For Neutron, which is a consumer chain, fetch unbonding period from + // consumer chain params so we can compute trust period manually instead of + // letting @confio/relayer fail attempting to query staking params which do + // not exist on consumer chains. This is needed to create a new // connection/clients. const neutronIbcClient = srcChainId === ChainId.NeutronMainnet @@ -409,20 +410,27 @@ const main = async () => { ? destIbcClient : undefined if (neutronIbcClient) { - const cosmosHubStakingQueryClient = QueryClient.withExtensions( - await connectComet(getRpcForChainId(ChainId.CosmosHubMainnet)), - setupStakingExtension - ) neutronIbcClient.query.staking.params = async () => { - const { params } = await cosmosHubStakingQueryClient.staking.params() + const interchainSecurityClient = + await interchainSecurityProtoRpcClientRouter.connect( + ChainId.NeutronMainnet + ) + const ccvUnbondingPeriod = ( + await interchainSecurityClient.ccv.consumer.v1.queryParams() + ).params?.unbondingPeriod + if (!ccvUnbondingPeriod) { + throw new Error('No CCV unbonding period found') + } + return { params: { - ...params, - unbondingTime: { - // Subtract one day. - seconds: params.unbondingTime.seconds - BigInt(24 * 3600), - nanos: params.unbondingTime.nanos, - }, + unbondingTime: ccvUnbondingPeriod, + // Not used. + maxValidators: -1, + maxEntries: -1, + historicalEntries: -1, + bondDenom: '', + minCommissionRate: '', }, } } diff --git a/packages/utils/client.ts b/packages/utils/client.ts index 08abfbc72..9f351c58b 100644 --- a/packages/utils/client.ts +++ b/packages/utils/client.ts @@ -14,6 +14,7 @@ import { cosmwasm, feemarket, ibc, + interchain_security, juno, kujira, neutron, @@ -150,165 +151,116 @@ export const stargateClientRouter = new ChainClientRouter({ }), }) +/* + * Factory function to make routers that connect to an RPC client with specific + * protobufs loaded. + */ +const makeProtoRpcClientRouter = ( + protoBundle: { + ClientFactory: { + createRPCQueryClient: ({ + rpcEndpoint, + }: { + rpcEndpoint: string + }) => Promise + } + }, + key: K +): ChainClientRouter => + new ChainClientRouter({ + handleConnect: async (chainId: string) => + retry( + 10, + async (attempt) => + ( + await protoBundle.ClientFactory.createRPCQueryClient({ + rpcEndpoint: getRpcForChainId(chainId, attempt - 1), + }) + )[key] + ), + }) + /* * Router for connecting to an RPC client with Cosmos protobufs. */ -export const cosmosProtoRpcClientRouter = new ChainClientRouter({ - handleConnect: async (chainId: string) => - retry( - 10, - async (attempt) => - ( - await cosmos.ClientFactory.createRPCQueryClient({ - rpcEndpoint: getRpcForChainId(chainId, attempt - 1), - }) - ).cosmos - ), -}) +export const cosmosProtoRpcClientRouter = makeProtoRpcClientRouter( + cosmos, + 'cosmos' +) /* * Router for connecting to an RPC client with IBC protobufs. */ -export const ibcProtoRpcClientRouter = new ChainClientRouter({ - handleConnect: async (chainId: string) => - retry( - 10, - async (attempt) => - ( - await ibc.ClientFactory.createRPCQueryClient({ - rpcEndpoint: getRpcForChainId(chainId, attempt - 1), - }) - ).ibc - ), -}) +export const ibcProtoRpcClientRouter = makeProtoRpcClientRouter(ibc, 'ibc') + +/* + * Router for connecting to an RPC client with interchain security protobufs. + */ +export const interchainSecurityProtoRpcClientRouter = makeProtoRpcClientRouter( + interchain_security, + 'interchain_security' +) /* * Router for connecting to an RPC client with CosmWasm protobufs. */ -export const cosmwasmProtoRpcClientRouter = new ChainClientRouter({ - handleConnect: async (chainId: string) => - retry( - 10, - async (attempt) => - ( - await cosmwasm.ClientFactory.createRPCQueryClient({ - rpcEndpoint: getRpcForChainId(chainId, attempt - 1), - }) - ).cosmwasm - ), -}) +export const cosmwasmProtoRpcClientRouter = makeProtoRpcClientRouter( + cosmwasm, + 'cosmwasm' +) /* * Router for connecting to an RPC client with Osmosis protobufs. */ -export const osmosisProtoRpcClientRouter = new ChainClientRouter({ - handleConnect: async (chainId: string) => - retry( - 10, - async (attempt) => - ( - await osmosis.ClientFactory.createRPCQueryClient({ - rpcEndpoint: getRpcForChainId(chainId, attempt - 1), - }) - ).osmosis - ), -}) +export const osmosisProtoRpcClientRouter = makeProtoRpcClientRouter( + osmosis, + 'osmosis' +) /* * Router for connecting to an RPC client with Noble protobufs. */ -export const nobleProtoRpcClientRouter = new ChainClientRouter({ - handleConnect: async (chainId: string) => - retry( - 10, - async (attempt) => - ( - await noble.ClientFactory.createRPCQueryClient({ - rpcEndpoint: getRpcForChainId(chainId, attempt - 1), - }) - ).noble - ), -}) +export const nobleProtoRpcClientRouter = makeProtoRpcClientRouter( + noble, + 'noble' +) /* * Router for connecting to an RPC client with Neutron protobufs. */ -export const neutronProtoRpcClientRouter = new ChainClientRouter({ - handleConnect: async (chainId: string) => - retry( - 10, - async (attempt) => - ( - await neutron.ClientFactory.createRPCQueryClient({ - rpcEndpoint: getRpcForChainId(chainId, attempt - 1), - }) - ).neutron - ), -}) +export const neutronProtoRpcClientRouter = makeProtoRpcClientRouter( + neutron, + 'neutron' +) /* * Router for connecting to an RPC client with Juno protobufs. */ -export const junoProtoRpcClientRouter = new ChainClientRouter({ - handleConnect: async (chainId: string) => - retry( - 10, - async (attempt) => - ( - await juno.ClientFactory.createRPCQueryClient({ - rpcEndpoint: getRpcForChainId(chainId, attempt - 1), - }) - ).juno - ), -}) +export const junoProtoRpcClientRouter = makeProtoRpcClientRouter(juno, 'juno') /* * Router for connecting to an RPC client with Kujira protobufs. */ -export const kujiraProtoRpcClientRouter = new ChainClientRouter({ - handleConnect: async (chainId: string) => - retry( - 10, - async (attempt) => - ( - await kujira.ClientFactory.createRPCQueryClient({ - rpcEndpoint: getRpcForChainId(chainId, attempt - 1), - }) - ).kujira - ), -}) +export const kujiraProtoRpcClientRouter = makeProtoRpcClientRouter( + kujira, + 'kujira' +) /* * Router for connecting to an RPC client with OmniFlix protobufs. */ -export const omniflixProtoRpcClientRouter = new ChainClientRouter({ - handleConnect: async (chainId: string) => - retry( - 10, - async (attempt) => - ( - await OmniFlix.ClientFactory.createRPCQueryClient({ - rpcEndpoint: getRpcForChainId(chainId, attempt - 1), - }) - ).OmniFlix - ), -}) +export const omniflixProtoRpcClientRouter = makeProtoRpcClientRouter( + OmniFlix, + 'OmniFlix' +) /* * Router for connecting to an RPC client with feemarket protobufs. */ -export const feemarketProtoRpcClientRouter = new ChainClientRouter({ - handleConnect: async (chainId: string) => - retry( - 10, - async (attempt) => - ( - await feemarket.ClientFactory.createRPCQueryClient({ - rpcEndpoint: getRpcForChainId(chainId, attempt - 1), - }) - ).feemarket - ), -}) +export const feemarketProtoRpcClientRouter = makeProtoRpcClientRouter( + feemarket, + 'feemarket' +) /** * Get CosmWasmClient for the appropriate chain. From 55ca74984daf70e1b4fb027933ad6588aa5cd148 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 23 Jul 2024 21:40:16 -0400 Subject: [PATCH 342/438] convert spend error into warning, and make balance clickable to autofill max --- packages/i18n/locales/en/translation.json | 2 +- .../actions/core/treasury/Spend/Component.tsx | 145 ++++++------------ .../components/inputs/InputErrorMessage.tsx | 7 +- .../components/token/TokenAmountDisplay.tsx | 53 ++++--- .../types/components/TokenAmountDisplay.ts | 25 ++- 5 files changed, 100 insertions(+), 132 deletions(-) diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 7c72d117c..4999ce709 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -387,7 +387,6 @@ "cannotStakeMoreThanYouHave": "You can't stake or unstake more tokens than you have.", "cannotTxZeroTokens": "You can't stake, unstake, or claim zero tokens.", "cannotUseCreateNftCollectionOnStargaze": "You cannot create a new NFT Collection via this action on Stargaze. Use the Stargaze Studio app on the DAO's Apps page instead.", - "cantSpendMoreThanTreasury": "Can't spend more tokens than are in the treasury ({{amount}} ${{tokenSymbol}}).", "chainNotConnected": "Chain not connected.", "checkInternetOrTryAgain": "Check your internet connection, refresh the page, or try again later.", "closeDateMustBeAfterOpenDate": "Close date must be after open date.", @@ -517,6 +516,7 @@ "relayerWalletNeedsFunds": "The relayer wallet needs more funds to pay fees. Press Retry to top up the wallet and try again.", "selectAChainToContinue": "Select a chain to continue.", "simulationFailedInvalidProposalActions": "Simulation failed. Verify your proposal actions are valid.", + "spendActionInsufficientWarning": "You have {{amount}} ${{tokenSymbol}}, which may not be sufficient for this spend unless another action transfers funds to the DAO.", "stakeInsufficient": "The DAO has {{amount}} ${{tokenSymbol}} staked, which is insufficient.", "stargazeDaoNoCrossChainAccountsForPress": "This Stargaze DAO has no cross-chain accounts, and Press does not work on Stargaze. Create a cross-chain account for the DAO before setting up Press.", "stepPercentsMustSumTo100": "Step percentages must sum to 100%.", diff --git a/packages/stateful/actions/core/treasury/Spend/Component.tsx b/packages/stateful/actions/core/treasury/Spend/Component.tsx index f1686f2ef..5b0e70d3b 100644 --- a/packages/stateful/actions/core/treasury/Spend/Component.tsx +++ b/packages/stateful/actions/core/treasury/Spend/Component.tsx @@ -3,7 +3,7 @@ import { SubdirectoryArrowRightRounded, } from '@mui/icons-material' import clsx from 'clsx' -import { ComponentType, RefAttributes, useCallback, useEffect } from 'react' +import { ComponentType, RefAttributes, useEffect, useMemo } from 'react' import { useFormContext } from 'react-hook-form' import { useTranslation } from 'react-i18next' @@ -83,8 +83,6 @@ export interface SpendData { // If true, will not use the PFM optimized path from Skip. useDirectIbcPath?: boolean - _error?: string - // Defined once loaded for IBC transfers. Needed for transforming. _skipIbcTransferMsg?: LoadingDataWithError @@ -150,8 +148,7 @@ export const SpendComponent: ActionComponent = ({ chain: { chain_id: mainChainId }, } = useActionOptions() - const { register, watch, setValue, setError, clearErrors } = - useFormContext() + const { register, watch, setValue } = useFormContext() const spendChainId = watch((fieldNamePrefix + 'fromChainId') as 'fromChainId') const spendAmount = watch((fieldNamePrefix + 'amount') as 'amount') @@ -223,99 +220,6 @@ export const SpendComponent: ActionComponent = ({ } }, [context, currentEntity, fieldNamePrefix, recipient, setValue, toChain]) - const validatePossibleSpend = useCallback( - ( - from: string, - chainId: string, - denom: string, - amount: number - ): string | boolean => { - if (tokens.loading) { - return true - } - - const insufficientBalanceI18nKey = - context.type === ActionContextType.Wallet - ? 'error.insufficientWalletBalance' - : 'error.cantSpendMoreThanTreasury' - - const tokenBalance = tokens.data.find( - ({ owner, token }) => - owner.address === from && - token.chainId === chainId && - token.denomOrAddress === denom - ) - if (tokenBalance) { - const microAmount = convertDenomToMicroDenomWithDecimals( - amount, - tokenBalance.token.decimals - ) - - return ( - microAmount <= Number(tokenBalance.balance) || - t(insufficientBalanceI18nKey, { - amount: convertMicroDenomToDenomWithDecimals( - tokenBalance.balance, - tokenBalance.token.decimals - ).toLocaleString(undefined, { - maximumFractionDigits: tokenBalance.token.decimals, - }), - tokenSymbol: tokenBalance.token.symbol, - }) - ) - } - - return t('error.unknownDenom', { denom }) - }, - [context.type, t, tokens] - ) - - // Update amount+denom combo error each time either field is updated instead - // of setting errors individually on each field. Since we only show one or the - // other and can't detect which error is newer, this would lead to the error - // not updating if amount set an error and then denom was changed. - useEffect(() => { - // Prevent infinite loops by not setting errors if already set, and only - // clearing errors unless already set. - const currentError = errors?._error - - if (!spendDenom || !spendAmount) { - if (currentError) { - clearErrors((fieldNamePrefix + '_error') as '_error') - } - return - } - - const validation = validatePossibleSpend( - from, - spendChainId, - spendDenom, - spendAmount - ) - if (validation === true) { - if (currentError) { - clearErrors((fieldNamePrefix + '_error') as '_error') - } - } else if (typeof validation === 'string') { - if (!currentError || currentError.message !== validation) { - setError((fieldNamePrefix + '_error') as '_error', { - type: 'custom', - message: validation, - }) - } - } - }, [ - spendAmount, - spendDenom, - setError, - clearErrors, - validatePossibleSpend, - fieldNamePrefix, - errors?._error, - spendChainId, - from, - ]) - const selectedToken = tokens.loading ? undefined : tokens.data.find( @@ -329,6 +233,37 @@ export const SpendComponent: ActionComponent = ({ selectedToken?.token.decimals ?? 0 ) + // A warning if the denom was not found in the treasury or the amount is too + // high. We don't want to make this an error because often people want to + // spend funds that a previous action makes available, so just show a warning. + const warning = useMemo(() => { + if (tokens.loading) { + return + } + if (!selectedToken) { + return t('error.unknownDenom', { denom: spendDenom }) + } + + const microAmount = convertDenomToMicroDenomWithDecimals( + spendAmount, + selectedToken.token.decimals + ) + + if (microAmount <= Number(selectedToken.balance)) { + return + } + + return t('error.spendActionInsufficientWarning', { + amount: convertMicroDenomToDenomWithDecimals( + selectedToken.balance, + selectedToken.token.decimals + ).toLocaleString(undefined, { + maximumFractionDigits: selectedToken.token.decimals, + }), + tokenSymbol: selectedToken.token.symbol, + }) + }, [selectedToken, spendAmount, spendDenom, t, tokens.loading]) + const { containerRef, childRef, wrapped } = useDetectWrap() const Icon = wrapped ? SubdirectoryArrowRightRounded : ArrowRightAltRounded @@ -355,7 +290,6 @@ export const SpendComponent: ActionComponent = ({ 1, selectedToken?.token.decimals ?? 0 ), - max: balance, step: convertMicroDenomToDenomWithDecimals( 1, selectedToken?.token.decimals ?? 0 @@ -469,12 +403,18 @@ export const SpendComponent: ActionComponent = ({
- {(errors?.amount || errors?.denom || errors?.to || errors?._error) && ( + {!!( + errors?.amount || + errors?.denom || + errors?.to || + errors?._error || + warning + ) && (
- +
)} @@ -486,6 +426,9 @@ export const SpendComponent: ActionComponent = ({ amount={balance} decimals={selectedToken.token.decimals} iconUrl={selectedToken.token.imageUrl} + onClick={() => + setValue((fieldNamePrefix + 'amount') as 'amount', balance) + } showFullAmount symbol={selectedToken.token.symbol} /> diff --git a/packages/stateless/components/inputs/InputErrorMessage.tsx b/packages/stateless/components/inputs/InputErrorMessage.tsx index a09245006..adc76f679 100644 --- a/packages/stateless/components/inputs/InputErrorMessage.tsx +++ b/packages/stateless/components/inputs/InputErrorMessage.tsx @@ -4,11 +4,13 @@ import { useTranslation } from 'react-i18next' export interface InputErrorMessageProps { error?: FieldError | string | Error | unknown + warning?: boolean className?: string } export const InputErrorMessage = ({ error, + warning, className, }: InputErrorMessageProps) => { const { t } = useTranslation() @@ -26,7 +28,10 @@ export const InputErrorMessage = ({ return message ? ( diff --git a/packages/stateless/components/token/TokenAmountDisplay.tsx b/packages/stateless/components/token/TokenAmountDisplay.tsx index 486e10e16..834b13265 100644 --- a/packages/stateless/components/token/TokenAmountDisplay.tsx +++ b/packages/stateless/components/token/TokenAmountDisplay.tsx @@ -43,6 +43,7 @@ export const TokenAmountDisplay = ({ symbol, hideSymbol, estimatedUsdValue, + onClick, ...props }: TokenAmountDisplayProps) => { const { t } = useTranslation() @@ -155,19 +156,8 @@ export const TokenAmountDisplay = ({ : '') + translateOrOmitSymbol(tokenTranslation, showFullAmount ? full : compact) - const content = ( -

- {prefix} - {display} - {suffix} -

- ) - - // Show full value in tooltip if different from compact and not an - // estimated USD value. + // Show full value in tooltip if different from compact and not an estimated + // USD value. const shouldShowFullTooltip = !showFullAmount && wasCompacted && !estimatedUsdValue @@ -194,9 +184,16 @@ export const TokenAmountDisplay = ({ ) : undefined } > - {iconUrl ? ( -
- {/* Icon */} +
+ {/* Icon */} + {!!iconUrl && (
- - {/* Amount Display */} - {content} -
- ) : ( - // Amount Display - content - )} + )} + + {/* Amount Display */} +

+ {prefix} + {display} + {suffix} +

+
) } diff --git a/packages/types/components/TokenAmountDisplay.ts b/packages/types/components/TokenAmountDisplay.ts index 84931aad4..b4fc862a3 100644 --- a/packages/types/components/TokenAmountDisplay.ts +++ b/packages/types/components/TokenAmountDisplay.ts @@ -12,17 +12,31 @@ export type TokenAmountDisplayProps = Omit< prefixClassName?: string suffix?: string suffixClassName?: string - // Max decimals to display. + /** + * Max decimals to display. + */ maxDecimals?: number - // Don't show approximation indication (like a tilde). + /** + * Don't show approximation indication (like a tilde). + */ hideApprox?: boolean - // Add to tooltip if present. + /** + * Add to tooltip if present. + */ dateFetched?: Date - // Show full amount if true. + /** + * Show full amount if true. + */ showFullAmount?: boolean - // If present, will add a rounded icon to the left. + /** + * If present, will add a rounded icon to the left. + */ iconUrl?: string iconClassName?: string + /** + * Optionally specify a callback when clicked and make the pointer a cursor. + */ + onClick?: () => void } & ( // If not USD estimate, require symbol and decimals. | { symbol: string @@ -58,6 +72,7 @@ export type StatefulTokenAmountDisplayProps = Pick< | 'hideApprox' | 'showFullAmount' | 'iconClassName' + | 'onClick' > & { coin: Coin } From f44b3f86b826c6567bc7423ed1ba200c489ed1ae Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 24 Jul 2024 04:33:56 -0400 Subject: [PATCH 343/438] spend action UX overhaul with custom token entry --- packages/i18n/locales/en/translation.json | 13 +- .../core/treasury/Spend/Component.stories.tsx | 6 + .../actions/core/treasury/Spend/Component.tsx | 557 ++++++++++++------ .../actions/core/treasury/Spend/README.md | 8 + .../actions/core/treasury/Spend/index.tsx | 136 +++-- .../components/StakingModal.tsx | 4 +- .../stateless/components/CopyToClipboard.tsx | 14 +- .../stateless/components/EntityDisplay.tsx | 14 +- packages/stateless/components/StatusCard.tsx | 4 +- .../stateless/components/chain/ChainLogo.tsx | 5 +- .../components/dao/DaoMemberCard.tsx | 4 +- .../components/dao/tabs/TreasuryTab.tsx | 27 +- .../components/inputs/AccountSelector.tsx | 198 +++++++ .../components/inputs/InputLabel.tsx | 12 +- .../components/inputs/NumberInput.tsx | 97 +-- .../components/inputs/PercentButton.tsx | 5 +- .../components/inputs/TokenInput.stories.tsx | 2 +- .../components/inputs/TokenInput.tsx | 220 ++++--- packages/stateless/components/inputs/index.ts | 1 + .../components/popup/ChainPickerPopup.tsx | 2 +- packages/stateless/components/popup/Popup.tsx | 26 +- .../components/profile/ProfileWallet.tsx | 4 +- .../components/token/TokenAmountDisplay.tsx | 49 +- .../tooltip/TooltipTruncatedText.tsx | 4 +- .../components/vesting/VestingPaymentCard.tsx | 4 +- .../components/wallet/NavWalletConnected.tsx | 8 +- packages/stateless/hooks/useDetectWrap.ts | 48 +- packages/types/components/NumberInput.ts | 64 ++ packages/types/components/Popup.ts | 12 +- packages/types/components/StakingModal.ts | 4 +- .../types/components/TokenAmountDisplay.ts | 5 + packages/types/components/TokenInput.ts | 105 +++- packages/types/components/index.ts | 1 + packages/types/misc.ts | 6 + packages/utils/assets.ts | 23 +- packages/utils/conversion.ts | 50 +- 36 files changed, 1199 insertions(+), 543 deletions(-) create mode 100644 packages/stateless/components/inputs/AccountSelector.tsx create mode 100644 packages/types/components/NumberInput.ts diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 4999ce709..f743d88bb 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -220,6 +220,7 @@ "save": "Save", "saveDraft": "Save draft", "searchDaos": "Search DAOs", + "selectAccount": "Select account", "selectAllNfts": "Select all {{count}} NFTs", "selectChain": "Select chain", "selectNft": "Select NFT", @@ -416,6 +417,7 @@ "failedToFindChainAccount": "Failed to find account on {{chain}}.", "failedToFindGovernanceProposal": "Failed to find governance proposal with ID {{id}}.", "failedToFindMatchingProposalModule": "Failed to find matching proposal module.", + "failedToFindSpendingAccount": "Failed to find spending account.", "failedToGetAccountFromWallet": "Failed to get account from wallet.", "failedToGetFactoryTokenInfo": "Failed to get factory token info. Please enter a valid factory denom.", "failedToGetTokenInfo": "Failed to get token info. Please enter a valid {{tokenType}} contract address.", @@ -516,7 +518,8 @@ "relayerWalletNeedsFunds": "The relayer wallet needs more funds to pay fees. Press Retry to top up the wallet and try again.", "selectAChainToContinue": "Select a chain to continue.", "simulationFailedInvalidProposalActions": "Simulation failed. Verify your proposal actions are valid.", - "spendActionInsufficientWarning": "You have {{amount}} ${{tokenSymbol}}, which may not be sufficient for this spend unless another action transfers funds to the DAO.", + "spendActionCustomTokenNoDecimals": "No decimals were detected for the custom token you entered, so automatic decimal conversion is disabled. Be sure to input the amount in micro-denom units. If you don't know what that means, ask for assistance.", + "spendActionInsufficientWarning": "You currently have {{amount}} ${{tokenSymbol}}, which may not be sufficient unless another action transfers funds to the DAO before this one.", "stakeInsufficient": "The DAO has {{amount}} ${{tokenSymbol}} staked, which is insufficient.", "stargazeDaoNoCrossChainAccountsForPress": "This Stargaze DAO has no cross-chain accounts, and Press does not work on Stargaze. Create a cross-chain account for the DAO before setting up Press.", "stepPercentsMustSumTo100": "Step percentages must sum to 100%.", @@ -555,6 +558,7 @@ "allowedMethodsDescription": "Comma separated list of smart contract method names to authorize (i.e. set_item, remove_item)", "allowsTradingAfter": "Allows trading after", "amount": "amount", + "amountReceived": "Amount received", "anotherAccount": "Another account", "approverDescription": "Specify a DAO that must approve proposals before they can be voted on. This does not currently work with multiple choice proposals.", "attributeName": "Attribute name", @@ -641,6 +645,7 @@ "feeShareWithdrawerAddressTooltip": "The address that can withdraw fees.", "fileName": "File name", "finishDate": "Finish date", + "from": "From", "fromValidator": "From Validator", "fundExistingTokenSwap": "Fund existing token swap", "funds": "Funds", @@ -779,6 +784,7 @@ "timelockDuration": "Timelock duration", "timelockDurationTooltip": "The duration of time after a proposal's voting period expires during which it can be vetoed. The proposal cannot be executed until this timelock expires. If a proposal passes early due to sufficient voting turnout, the timelock still applies after the proposal's entire voting period (and NOT the early pass time).", "title": "Title", + "to": "To", "toValidator": "To Validator", "tokenAddress": "Token address", "tokenContractAddressTitle": "Token contract address", @@ -929,7 +935,6 @@ "allNftSupportedChainsAddedPromptTooltip": "You have added all chains that DAO DAO supports to your profile.", "allSupportedTokensAdded": "All supported tokens have been added.", "allowlist": "Allowlist", - "amountWillBeReceived": "Amount that will be received", "andNumMore": "and {{count}} more", "anyone": "Anyone", "approvalProposalExplanation_approved": "This proposal was accepted by the approver.", @@ -1055,6 +1060,7 @@ "enableMultipleChoiceProposalsExplanation": "This action will enable the creation of multiple choice proposals, which allow voting on many options in one proposal. Each option can have a list of actions that execute if that option wins. It will be configured to match the current config of the single choice proposal module.", "enableVetoerDaoDescription": "Display proposals from a DAO on the home page when they are vetoable.", "enabled": "Enabled", + "enterCustomToken": "Enter custom token", "enterNameBeforeSavingDraft": "Enter a name before saving a draft", "errored": "Errored", "establishedTooltip": "When the DAO was created.", @@ -1105,6 +1111,7 @@ "lastBlock": "Last block", "lastUpdatedOnDate": "Last updated on {{date}}", "loading": "Loading...", + "loadingCustomToken": "Loading custom token metadata...", "loadingMembership": "Loading membership...", "loadingProposalStatus": "The proposal is loading...", "logInToViewMembership": "Log in to view your membership status in the DAO.", @@ -1152,6 +1159,7 @@ "nftCollectionExplanation_unstaked": "These NFTs would provide voting power if they were staked, but no one is currently staking them.", "nftImage": "NFT image", "no": "No", + "noAccountSelected": "No account selected", "noActionsAdded": "No actions have been added. Add an action below.", "noActionsAdded_dao": "No actions have been added. If you want this proposal to do something upon execution, add an action below.", "noActiveCompensationCycle": "There is no active compensation cycle.", @@ -1331,6 +1339,7 @@ "socialLoginWarning": "Social logins may be less secure than a self-managed wallet. We recommend the self-managed wallets, above, if you plan on storing large amounts of money.", "socialLoginWarning_onlySocial": "Social logins may be less secure than a self-managed wallet. We recommend a self-managed wallet if you plan on storing large amounts of money.", "socialLoginsPoweredByWeb3Auth": "Social logins powered by web3auth", + "spendActionCustomTokenDecimalsFound": "Automatic decimal conversion for ${{tokenSymbol}} with {{decimals}} decimals is enabled. Be sure to input the amount with {{decimals}} decimal places, as you normally would.", "spendActionDescription_dao": "Spend native or CW20 tokens from the treasury.", "spendActionDescription_gov": "Spend tokens from the community pool.", "spendActionDescription_wallet": "Spend native tokens from your wallet.", diff --git a/packages/stateful/actions/core/treasury/Spend/Component.stories.tsx b/packages/stateful/actions/core/treasury/Spend/Component.stories.tsx index e1ee09001..c6d111928 100644 --- a/packages/stateful/actions/core/treasury/Spend/Component.stories.tsx +++ b/packages/stateful/actions/core/treasury/Spend/Component.stories.tsx @@ -22,6 +22,8 @@ export default { from: '', to: '', amount: 1, + decimals: 6, + cw20: false, denom: getNativeTokenForChainId(CHAIN_ID).denomOrAddress, }), makeDaoProvidersDecorator(makeDaoInfo()), @@ -38,6 +40,10 @@ Default.args = { allActionsWithData: [], index: 0, options: { + token: { + loading: true, + errored: false, + }, tokens: { loading: false, data: [ diff --git a/packages/stateful/actions/core/treasury/Spend/Component.tsx b/packages/stateful/actions/core/treasury/Spend/Component.tsx index 5b0e70d3b..30da0ea93 100644 --- a/packages/stateful/actions/core/treasury/Spend/Component.tsx +++ b/packages/stateful/actions/core/treasury/Spend/Component.tsx @@ -1,13 +1,17 @@ -import { - ArrowRightAltRounded, - SubdirectoryArrowRightRounded, -} from '@mui/icons-material' +import { ArrowRightAltRounded } from '@mui/icons-material' import clsx from 'clsx' -import { ComponentType, RefAttributes, useEffect, useMemo } from 'react' +import { + ComponentType, + RefAttributes, + useEffect, + useMemo, + useState, +} from 'react' import { useFormContext } from 'react-hook-form' import { useTranslation } from 'react-i18next' import { + AccountSelector, Button, ChainLabel, ChainLogo, @@ -19,6 +23,7 @@ import { InputThemedText, Loader, NumberInput, + PercentButton, SelectInput, StatusCard, TokenAmountDisplay, @@ -46,7 +51,6 @@ import { } from '@dao-dao/types/actions' import { Params as NobleTariffParams } from '@dao-dao/types/protobuf/codegen/tariff/params' import { - convertDenomToMicroDenomWithDecimals, convertMicroDenomToDenomWithDecimals, formatDateTimeTz, formatPercentOf100, @@ -54,6 +58,7 @@ import { getChainForChainId, getDisplayNameForChainId, getSupportedChainConfig, + isValidBech32Address, makeValidateAddress, processError, transformBech32Address, @@ -63,40 +68,63 @@ import { import { useActionOptions } from '../../../react' -export interface SpendData { +export type SpendData = { fromChainId: string - // If same as chainId, then normal spend or CW20 transfer. Otherwise, IBC - // transfer. + /* + * If same as fromChainId, then normal spend or CW20 transfer. Otherwise, IBC + * transfer. + */ toChainId: string - // Address with the tokens. This is needed since there may be multiple - // accounts controlled by the DAO on the same chain. + /* + * Address with the tokens. This is needed since there may be multiple + * accounts controlled by the DAO on the same chain. + */ from: string to: string amount: number denom: string - - // Relative IBC transfer timeout after max voting period. + decimals: number + /** + * Whether or not `denom` is a CW20 token address. CW20 tokens cannot be sent + * to a different chain. + */ + cw20: boolean + /** + * Relative IBC transfer timeout after max voting period. + */ ibcTimeout?: DurationWithUnits - // Once created, this is loaded from the message. + /** + * Once created, this is loaded from the message. + */ _absoluteIbcTimeout?: number - - // If true, will not use the PFM optimized path from Skip. + /** + * If true, will not use the PFM optimized path from Skip. + */ useDirectIbcPath?: boolean - - // Defined once loaded for IBC transfers. Needed for transforming. + /** + * Defined once loaded for IBC transfers. Needed for transforming. + */ _skipIbcTransferMsg?: LoadingDataWithError - - // Loaded from IBC transfer message on decode. + /** + * Loaded from IBC transfer message on decode. + */ _ibcData?: { sourceChannel: string - // Loaded for packet-forwarding-middleware detection after creation (likely - // created using Skip's router API). + /** + * Loaded for packet-forwarding-middleware detection after creation (likely + * created using Skip's router API). + */ pfmMemo?: string } } -export interface SpendOptions { +export type SpendOptions = { + // The tokens in all accounts controlled by the spender. tokens: LoadingData + // The current token input. May or may not be in the list of tokens above, if + // they entered a custom token. + token: LoadingDataWithError + // The current recipient entity. currentEntity: Entity | undefined // If this is an IBC transfer, this is the path of chains. ibcPath: LoadingDataWithError @@ -128,6 +156,7 @@ export const SpendComponent: ActionComponent = ({ isCreating, options: { tokens, + token, currentEntity, ibcPath, ibcAmountOut, @@ -153,6 +182,8 @@ export const SpendComponent: ActionComponent = ({ const spendChainId = watch((fieldNamePrefix + 'fromChainId') as 'fromChainId') const spendAmount = watch((fieldNamePrefix + 'amount') as 'amount') const spendDenom = watch((fieldNamePrefix + 'denom') as 'denom') + const spendDecimals = watch((fieldNamePrefix + 'decimals') as 'decimals') + const isCw20 = watch((fieldNamePrefix + 'cw20') as 'cw20') const from = watch((fieldNamePrefix + 'from') as 'from') const recipient = watch((fieldNamePrefix + 'to') as 'to') const useDirectIbcPath = watch( @@ -171,7 +202,9 @@ export const SpendComponent: ActionComponent = ({ const toChain = getChainForChainId(toChainId) // IBC transfer if destination chain ID is different from source chain ID. - const isIbc = spendChainId !== toChainId + // Don't show until amount is nonzero, since the Skip API requires a nonzero + // amount to compute the IBC path. + const showIbcPath = spendChainId !== toChainId && !!spendAmount // On destination chain ID change, update address intelligently. useEffect(() => { @@ -220,14 +253,30 @@ export const SpendComponent: ActionComponent = ({ } }, [context, currentEntity, fieldNamePrefix, recipient, setValue, toChain]) - const selectedToken = tokens.loading - ? undefined - : tokens.data.find( - ({ owner, token }) => - owner.address === from && - token.chainId === spendChainId && - token.denomOrAddress === spendDenom - ) + // If entering a custom token, we need to show a list of from chains/addresses + // that the DAO controls. Usually that information is retrieved from the token + // list. + const [customToken, setCustomToken] = useState(false) + + const loadedCustomToken = + customToken && + !token.loading && + !token.errored && + token.data.chainId === spendChainId && + token.data.denomOrAddress === spendDenom && + token.data.decimals > 0 + + // Don't select token if entering a custom token. + const selectedToken = + customToken || tokens.loading + ? undefined + : tokens.data.find( + ({ owner, token }) => + owner.address === from && + token.chainId === spendChainId && + token.denomOrAddress === spendDenom && + (token.type === TokenType.Cw20) === isCw20 + ) const balance = convertMicroDenomToDenomWithDecimals( selectedToken?.balance ?? 0, selectedToken?.token.decimals ?? 0 @@ -237,35 +286,39 @@ export const SpendComponent: ActionComponent = ({ // high. We don't want to make this an error because often people want to // spend funds that a previous action makes available, so just show a warning. const warning = useMemo(() => { - if (tokens.loading) { + if (customToken) { + return + } + if (!isCreating || tokens.loading || !spendDenom) { return } if (!selectedToken) { return t('error.unknownDenom', { denom: spendDenom }) } - const microAmount = convertDenomToMicroDenomWithDecimals( - spendAmount, - selectedToken.token.decimals - ) + const decimals = selectedToken?.token.decimals || 0 + const symbol = selectedToken?.token.symbol || spendDenom - if (microAmount <= Number(selectedToken.balance)) { + if (spendAmount <= balance) { return } return t('error.spendActionInsufficientWarning', { - amount: convertMicroDenomToDenomWithDecimals( - selectedToken.balance, - selectedToken.token.decimals - ).toLocaleString(undefined, { - maximumFractionDigits: selectedToken.token.decimals, + amount: balance.toLocaleString(undefined, { + maximumFractionDigits: decimals, }), - tokenSymbol: selectedToken.token.symbol, + tokenSymbol: symbol, }) - }, [selectedToken, spendAmount, spendDenom, t, tokens.loading]) - - const { containerRef, childRef, wrapped } = useDetectWrap() - const Icon = wrapped ? SubdirectoryArrowRightRounded : ArrowRightAltRounded + }, [ + balance, + customToken, + isCreating, + selectedToken, + spendAmount, + spendDenom, + t, + tokens.loading, + ]) const { containerRef: toContainerRef, @@ -275,84 +328,239 @@ export const SpendComponent: ActionComponent = ({ return ( <> -
- { - // If chain changes and the dest chain is the same, switch it. - if (spendChainId === toChainId && chainId !== spendChainId) { - setValue((fieldNamePrefix + 'toChainId') as 'toChainId', chainId) - } + {isCreating ? ( + <> + + +
+ { + setValue( + (fieldNamePrefix + 'fromChainId') as 'fromChainId', + account.chainId + ) + setValue((fieldNamePrefix + 'from') as 'from', account.address) + }} + selectedAccount={context.accounts.find( + (a) => a.chainId === spendChainId && a.address === from + )} + /> - setValue( - (fieldNamePrefix + 'fromChainId') as 'fromChainId', - chainId - ) - setValue((fieldNamePrefix + 'denom') as 'denom', denomOrAddress) - setValue((fieldNamePrefix + 'from') as 'from', owner.address) + { + setValue((fieldNamePrefix + 'denom') as 'denom', custom) + // If denom entered is a valid contract address, it's most + // likely a cw20 token. I've never seen a native denom that was + // formatted like an address. + setValue( + (fieldNamePrefix + 'cw20') as 'cw20', + isValidBech32Address( + custom, + getChainForChainId(spendChainId).bech32_prefix + ) + ) + }} + onSelectToken={(token) => { + setCustomToken(!token) + + // Custom token + if (!token) { + setValue((fieldNamePrefix + 'decimals') as 'decimals', 0) + return + } - // If token is cw20, set destination chain to same as source. - if (type === TokenType.Cw20) { - setValue((fieldNamePrefix + 'toChainId') as 'toChainId', chainId) - } - }} - readOnly={!isCreating} - selectedToken={selectedToken?.token} - showChainImage - tokens={ - tokens.loading - ? { loading: true } - : { - loading: false, - data: tokens.data.map(({ owner, balance, token }) => ({ - ...token, - owner, - description: - t('title.balance') + - ': ' + - convertMicroDenomToDenomWithDecimals( - balance, - token.decimals - ).toLocaleString(undefined, { - maximumFractionDigits: token.decimals, - }), - })), + // If chain changes and the dest chain is the same, switch it. + if ( + spendChainId === toChainId && + token.chainId !== spendChainId + ) { + setValue( + (fieldNamePrefix + 'toChainId') as 'toChainId', + token.chainId + ) } - } - /> -
-
- + setValue( + (fieldNamePrefix + 'fromChainId') as 'fromChainId', + token.chainId + ) + setValue( + (fieldNamePrefix + 'from') as 'from', + token.owner.address + ) + + setValue( + (fieldNamePrefix + 'denom') as 'denom', + token.denomOrAddress + ) + setValue( + (fieldNamePrefix + 'decimals') as 'decimals', + token.decimals + ) + setValue( + (fieldNamePrefix + 'cw20') as 'cw20', + token.type === TokenType.Cw20 + ) + + // If token is cw20, set destination chain to same as source. + if (token.type === TokenType.Cw20) { + setValue( + (fieldNamePrefix + 'toChainId') as 'toChainId', + token.chainId + ) + } + }} + readOnly={!isCreating} + selectedToken={selectedToken?.token} + tokens={ + tokens.loading + ? { loading: true } + : { + loading: false, + data: tokens.data.map(({ owner, balance, token }) => ({ + ...token, + owner, + description: + t('title.balance') + + ': ' + + convertMicroDenomToDenomWithDecimals( + balance, + token.decimals + ).toLocaleString(undefined, { + maximumFractionDigits: token.decimals, + }), + })), + } + } + />
+ {isCreating && + !!( + errors?.amount || + errors?.denom || + errors?.to || + errors?._error || + warning + ) && ( +
+ + + + +
+ )} + + { + // Show custom token load status and decimal conversion info once a + // denom has started being entered. + isCreating && + customToken && + !!spendDenom && + (!token.loading && !token.updating ? ( + loadedCustomToken ? ( + + ) : ( + + ) + ) : ( + + )) + } + + {selectedToken && isCreating && ( +
+
+

{t('info.yourBalance')}:

+ + + setValue((fieldNamePrefix + 'amount') as 'amount', balance) + } + showFullAmount + symbol={selectedToken.token.symbol} + /> +
+ + {balance > 0 && ( +
+ {[10, 25, 50, 75, 100].map((percent) => ( + + setValue( + (fieldNamePrefix + 'amount') as 'amount', + amount + ) + } + /> + ))} +
+ )} +
+ )} + + +
{/* Cannot send over IBC from the gov module. */} @@ -381,11 +589,8 @@ export const SpendComponent: ActionComponent = ({ )} {/* Change search address and placeholder based on destination chain. */} - -
+
+ = ({ makeValidateAddress(toChain.bech32_prefix), ]} /> -
- + +
-
-
- - {!!( - errors?.amount || - errors?.denom || - errors?.to || - errors?._error || - warning - ) && ( -
- - - - -
- )} - - {selectedToken && isCreating && ( -
-

{t('info.yourBalance')}:

- + + ) : ( +
- setValue((fieldNamePrefix + 'amount') as 'amount', balance) + amount={spendAmount} + decimals={spendDecimals} + iconClassName="!h-6 !w-6" + iconUrl={ + token.loading || token.errored ? undefined : token.data.imageUrl } + showChainId={spendChainId} showFullAmount - symbol={selectedToken.token.symbol} + symbol={ + token.loading || token.errored ? spendDenom : token.data.symbol + } /> -
- )} - {selectedToken && - !ibcAmountOut.loading && - !ibcAmountOut.errored && - ibcAmountOut.data && ( -
-

{t('info.amountWillBeReceived')}:

- - + + + -
- )} + +
+ )} - {isIbc && ( -
+ {showIbcPath && ( +
= ({ {index !== ibcPath.data.length - 1 && ( - + )} ))} @@ -525,7 +708,7 @@ export const SpendComponent: ActionComponent = ({ {!neutronTransferFee.loading && !neutronTransferFee.errored && neutronTransferFee.data && ( -

+

{t('info.neutronTransferFeeApplied', { fee: neutronTransferFee.data .map(({ token, balance }) => @@ -568,7 +751,7 @@ export const SpendComponent: ActionComponent = ({ {index !== betterNonPfmIbcPath.data!.length - 1 && ( - + )} ))} @@ -710,11 +893,29 @@ export const SpendComponent: ActionComponent = ({ {formatDateTimeTz(new Date(_absoluteIbcTimeout))} ) : ( -

+

{t('error.loadingData')}

)}
+ + {selectedToken && + !ibcAmountOut.loading && + !ibcAmountOut.errored && + ibcAmountOut.data && + ibcAmountOut.data !== spendAmount && ( +
+ + + +
+ )}
)} @@ -746,7 +947,7 @@ const NobleTariff = ({ } return ( -

+

{t('info.nobleTariffApplied', { feePercent: formatPercentOf100(feeDecimal * 100), tokenSymbol: symbol, diff --git a/packages/stateful/actions/core/treasury/Spend/README.md b/packages/stateful/actions/core/treasury/Spend/README.md index 36299f0e2..3f696f47a 100644 --- a/packages/stateful/actions/core/treasury/Spend/README.md +++ b/packages/stateful/actions/core/treasury/Spend/README.md @@ -21,6 +21,8 @@ guide](https://github.com/DA0-DA0/dao-dao-ui/wiki/Bulk-importing-actions). "to": "", "amount": "", "denom": "", + "cw20": "", + "decimals": ", "units": "seconds" @@ -28,6 +30,12 @@ guide](https://github.com/DA0-DA0/dao-dao-ui/wiki/Bulk-importing-actions). } ``` +You must set `decimals` correctly for the specified amount. The final message +gets generated with `amount * 10^(decimals)` microunits of the specified denom. +For example: `amount = 5`, `decimals = 6`, and `denom = "untrn"` => +`5000000untrn` or `5 * 10^6 untrn`, where `untrn` is the microdenom/true +denomination of `NTRN`. + If used in a DAO, `fromChainId` and `from` determine which account has the tokens being sent, which can be the native chain or any supported Polytone or ICA chain. `toChainId` is unrelated, and it determines if the tokens are sent to diff --git a/packages/stateful/actions/core/treasury/Spend/index.tsx b/packages/stateful/actions/core/treasury/Spend/index.tsx index caa3885f8..52218842f 100644 --- a/packages/stateful/actions/core/treasury/Spend/index.tsx +++ b/packages/stateful/actions/core/treasury/Spend/index.tsx @@ -4,6 +4,7 @@ import { ComponentType, useCallback, useEffect, useState } from 'react' import { useFormContext } from 'react-hook-form' import { constSelector, useRecoilValue } from 'recoil' +import { tokenQueries } from '@dao-dao/state/query' import { accountsSelector, genericTokenSelector, @@ -61,6 +62,7 @@ import { isValidBech32Address, makeBankMessage, makeWasmMessage, + maybeGetChainForChainId, maybeGetNativeTokenForChainId, maybeMakeIcaExecuteMessage, maybeMakePolytoneExecuteMessage, @@ -122,13 +124,17 @@ const useDefaults: UseDefaults = () => { return proposalModuleMaxVotingPeriod.error } + const nativeToken = maybeGetNativeTokenForChainId(chainId) + return { fromChainId: chainId, toChainId: chainId, from: address, to: walletAddress, amount: 1, - denom: maybeGetNativeTokenForChainId(chainId)?.denomOrAddress || '', + denom: nativeToken?.denomOrAddress || '', + decimals: nativeToken?.decimals || 0, + cw20: nativeToken?.type === TokenType.Cw20, ibcTimeout: 'time' in proposalModuleMaxVotingPeriod.data ? // 1 week if voting period is a time since we can append it after. @@ -163,7 +169,8 @@ export const StatefulSpendComponent: ComponentType< address, chain: { chain_id: currentChainId }, } = useActionOptions() - const { watch, setValue } = useFormContext() + const { watch, setValue, getValues } = useFormContext() + const queryClient = useQueryClient() const fromChainId = watch( (props.fieldNamePrefix + 'fromChainId') as 'fromChainId' @@ -173,6 +180,7 @@ export const StatefulSpendComponent: ComponentType< const recipient = watch((props.fieldNamePrefix + 'to') as 'to') const toChainId = watch((props.fieldNamePrefix + 'toChainId') as 'toChainId') const amount = watch((props.fieldNamePrefix + 'amount') as 'amount') + const isCw20 = watch((props.fieldNamePrefix + 'cw20') as 'cw20') const useDirectIbcPath = watch( (props.fieldNamePrefix + 'useDirectIbcPath') as 'useDirectIbcPath' ) @@ -199,13 +207,7 @@ export const StatefulSpendComponent: ComponentType< : [ { chainId: fromChainId, - // Cw20 denoms are contract addresses, native denoms are not. - type: isValidBech32Address( - denom, - getChainForChainId(fromChainId).bech32_prefix - ) - ? TokenType.Cw20 - : TokenType.Native, + type: isCw20 ? TokenType.Cw20 : TokenType.Native, denomOrAddress: denom, }, ], @@ -213,6 +215,51 @@ export const StatefulSpendComponent: ComponentType< excludeAccountTypes: props.fromValence ? [] : undefined, }) + // Load token for component and ensure fields are up to date in case using + // custom token input. + const loadingToken = useQueryLoadingDataWithError( + fromChainId && denom + ? tokenQueries.info(queryClient, { + chainId: fromChainId, + denomOrAddress: denom, + // isCw20 not immediately updated for custom tokens. + type: ( + props.isCreating + ? isValidBech32Address( + denom, + maybeGetChainForChainId(fromChainId)?.bech32_prefix + ) + : isCw20 + ) + ? TokenType.Cw20 + : TokenType.Native, + }) + : undefined + ) + useEffect(() => { + if (loadingToken.loading || loadingToken.errored) { + return + } + + const decimals = getValues( + (props.fieldNamePrefix + 'decimals') as 'decimals' + ) + const isCw20 = getValues((props.fieldNamePrefix + 'cw20') as 'cw20') + + if (decimals !== loadingToken.data.decimals) { + setValue( + (props.fieldNamePrefix + 'decimals') as 'decimals', + loadingToken.data.decimals + ) + } + if (isCw20 !== (loadingToken.data.type === TokenType.Cw20)) { + setValue( + (props.fieldNamePrefix + 'cw20') as 'cw20', + loadingToken.data.type === TokenType.Cw20 + ) + } + }, [getValues, loadingToken, props.fieldNamePrefix, setValue]) + // Should always be defined if in a DAO proposal. Even for a DAO, it may not // be defined if being authz executed or something similar. const maxVotingPeriodSelector = @@ -520,7 +567,6 @@ export const StatefulSpendComponent: ComponentType< ]) const [currentEntity, setCurrentEntity] = useState() - const queryClient = useQueryClient() const loadingEntity = useQueryLoadingDataWithError( entityQueries.info( queryClient, @@ -546,6 +592,7 @@ export const StatefulSpendComponent: ComponentType< {...props} options={{ tokens: loadingTokens, + token: loadingToken, currentEntity, ibcPath, ibcAmountOut, @@ -585,6 +632,7 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( ) => { const options = useActionOptions() const defaults = useDefaults() + const queryClient = useQueryClient() let chainId = options.chain.chain_id let from = options.address @@ -645,9 +693,9 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( }) && msg.stargate.value.sourcePort === 'transfer' - const token = useCachedLoadingWithError( + const token = useQueryLoadingDataWithError( isNative || isCw20 || isIbcTransfer - ? genericTokenSelector({ + ? tokenQueries.info(queryClient, { chainId, type: isNative || isIbcTransfer ? TokenType.Native : TokenType.Cw20, denomOrAddress: isIbcTransfer @@ -723,6 +771,9 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( token.data.decimals ), denom: token.data.denomOrAddress, + decimals: token.data.decimals, + // Should always be false. + cw20: token.data.type === TokenType.Cw20, // Nanoseconds to milliseconds. _absoluteIbcTimeout: Number( @@ -750,6 +801,8 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( token.data.decimals ), denom: token.data.denomOrAddress, + decimals: token.data.decimals, + cw20: false, }, } } else if (token.data.type === TokenType.Cw20) { @@ -767,6 +820,8 @@ const useDecodedCosmosMsg: UseDecodedCosmosMsg = ( token.data.decimals ), denom: msg.wasm.execute.contract_addr, + decimals: token.data.decimals, + cw20: true, }, } } @@ -783,15 +838,10 @@ export const makeSpendAction: ActionMaker< */ fromValence?: boolean } -> = ({ t, context, fromValence }) => { +> = ({ t, context }) => { const useTransformToCosmos: UseTransformToCosmos = () => { const options = useActionOptions() - const loadingTokenBalances = useTokenBalances({ - includeAccountTypes: fromValence ? [AccountType.Valence] : undefined, - excludeAccountTypes: fromValence ? [] : undefined, - }) - const neutronTransferFee = useCachedLoading( neutronIbcTransferFeeSelector, undefined @@ -832,30 +882,25 @@ export const makeSpendAction: ActionMaker< to, amount: _amount, denom, + decimals, + cw20, ibcTimeout, useDirectIbcPath, _skipIbcTransferMsg, }: SpendData) => { - if (loadingTokenBalances.loading) { - return - } - - const { token, owner } = - loadingTokenBalances.data.find( - ({ owner, token }) => - owner.address === from && - token.chainId === fromChainId && - token.denomOrAddress === denom - ) || {} - if (!token || !owner) { - throw new Error(`Unknown token: ${denom}`) - } - const amount = convertDenomToMicroDenomStringWithDecimals( _amount, - token.decimals + decimals ) + const spendAccount = context.accounts.find( + (a) => a.chainId === fromChainId && a.address === from + ) + // Should never happen. + if (!spendAccount) { + throw new Error(t('error.failedToFindSpendingAccount')) + } + // Gov module community pool spend. if (options.context.type === ActionContextType.Gov) { return makeStargateMessage({ @@ -871,8 +916,8 @@ export const makeSpendAction: ActionMaker< } let msg: UnifiedCosmosMsg | undefined - // IBC transfer. - if (token.type === TokenType.Native && toChainId !== fromChainId) { + // IBC transfer of native token. + if (!cw20 && toChainId !== fromChainId) { // Require that this loads before using IBC. if ( proposalModuleMaxVotingPeriod.loading || @@ -986,11 +1031,11 @@ export const makeSpendAction: ActionMaker< }, }) } - } else if (token.type === TokenType.Native) { + } else if (!cw20) { msg = { bank: makeBankMessage(amount, to, denom), } - } else if (token.type === TokenType.Cw20) { + } else { msg = makeWasmMessage({ wasm: { execute: { @@ -1007,16 +1052,12 @@ export const makeSpendAction: ActionMaker< }) } - if (!msg) { - throw new Error(`Unknown token type: ${token.type}`) - } - - return owner.type === AccountType.Ica + return spendAccount.type === AccountType.Ica ? maybeMakeIcaExecuteMessage( options.chain.chain_id, fromChainId, options.address, - owner.address, + spendAccount.address, msg ) : maybeMakePolytoneExecuteMessage( @@ -1025,12 +1066,7 @@ export const makeSpendAction: ActionMaker< msg ) }, - [ - loadingTokenBalances, - options, - neutronTransferFee, - proposalModuleMaxVotingPeriod, - ] + [options, neutronTransferFee, proposalModuleMaxVotingPeriod] ) } diff --git a/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/StakingModal.tsx b/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/StakingModal.tsx index 821336f13..d4f3beb0d 100644 --- a/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/StakingModal.tsx +++ b/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/StakingModal.tsx @@ -18,7 +18,7 @@ import { StakingModal as StatelessStakingModal, useCachedLoadingWithError, } from '@dao-dao/stateless' -import { BaseStakingModalProps } from '@dao-dao/types' +import { BaseStakingModalProps, TokenInputOption } from '@dao-dao/types' import { CHAIN_GAS_MULTIPLIER, convertDenomToMicroDenomStringWithDecimals, @@ -299,7 +299,7 @@ const InnerStakingModal = ({ loading: false, data: realVaults.map(({ bondToken }) => bondToken), }, - onSelectToken: (token) => { + onSelectToken: (token: TokenInputOption) => { const index = loadingVaults.loading || loadingVaults.errored ? -1 diff --git a/packages/stateless/components/CopyToClipboard.tsx b/packages/stateless/components/CopyToClipboard.tsx index fe89e9825..cb0c2cb57 100644 --- a/packages/stateless/components/CopyToClipboard.tsx +++ b/packages/stateless/components/CopyToClipboard.tsx @@ -5,7 +5,7 @@ import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' import { CopyToClipboardProps } from '@dao-dao/types/components/CopyToClipboard' -import { concatAddressBoth, concatAddressStartEnd } from '@dao-dao/utils' +import { abbreviateString } from '@dao-dao/utils' import { Tooltip } from './tooltip/Tooltip' @@ -77,14 +77,10 @@ export const CopyToClipboard = ({ > {label ?? (takeStartEnd - ? concatAddressStartEnd( - value, - takeStartEnd.start, - takeStartEnd.end - ) + ? abbreviateString(value, takeStartEnd.start, takeStartEnd.end) : takeAll ? value - : concatAddressBoth(value, takeN))} + : abbreviateString(value, takeN ?? 7))} @@ -127,10 +123,10 @@ export const CopyToClipboardUnderline = ({ > {label ?? (takeStartEnd - ? concatAddressStartEnd(value, takeStartEnd.start, takeStartEnd.end) + ? abbreviateString(value, takeStartEnd.start, takeStartEnd.end) : takeAll ? value - : concatAddressBoth(value, takeN))} + : abbreviateString(value, takeN ?? 7))}

) diff --git a/packages/stateless/components/EntityDisplay.tsx b/packages/stateless/components/EntityDisplay.tsx index cdde2ced8..97f467dce 100644 --- a/packages/stateless/components/EntityDisplay.tsx +++ b/packages/stateless/components/EntityDisplay.tsx @@ -1,5 +1,4 @@ /* eslint-disable i18next/no-literal-string */ -import { fromBech32 } from '@cosmjs/encoding' import { Check, CopyAllOutlined } from '@mui/icons-material' import clsx from 'clsx' import { useEffect, useState } from 'react' @@ -7,7 +6,7 @@ import { useTranslation } from 'react-i18next' import { EntityDisplayProps, EntityType } from '@dao-dao/types' import { - concatAddressStartEnd, + abbreviateAddress, getFallbackImage, toAccessibleImageUrl, } from '@dao-dao/utils' @@ -59,15 +58,6 @@ export const EntityDisplay = ({ const { textRef, truncated } = useDetectTruncate() - // Use bech32 prefix length to determine how much to truncate from beginning. - let prefixLength - try { - prefixLength = fromBech32(address).prefix.length - } catch (e) { - // Conservative estimate. - prefixLength = 6 - } - // If name exists, use it. Otherwise, fallback to address, potentially // truncated. const textDisplay = @@ -78,7 +68,7 @@ export const EntityDisplay = ({ : loadingEntity.data.name : showFullAddress ? address - : concatAddressStartEnd(address, prefixLength + 3, 3) + : abbreviateAddress(address, 3) return (
( function ChainLogo({ chainId, className, style, size = 20, ...props }, ref) { return (
) : (

- {intelligentAddressConcat(address)} + {abbreviateAddress(address)}

) diff --git a/packages/stateless/components/dao/tabs/TreasuryTab.tsx b/packages/stateless/components/dao/tabs/TreasuryTab.tsx index f9c961b94..65979db4f 100644 --- a/packages/stateless/components/dao/tabs/TreasuryTab.tsx +++ b/packages/stateless/components/dao/tabs/TreasuryTab.tsx @@ -19,18 +19,17 @@ import { } from '@dao-dao/types' import { NEUTRON_GOVERNANCE_DAO, - concatAddressStartEnd, getDisplayNameForChainId, - getImageUrlForChainId, serializeTokenSource, } from '@dao-dao/utils' import { useDaoInfoContext, useSupportedChainContext } from '../../../contexts' import { useButtonPopupSorter, useTokenSortOptions } from '../../../hooks' import { ErrorPage } from '../../error' +import { AccountSelector } from '../../inputs' import { LineLoaders } from '../../LineLoader' import { NftSection } from '../../nft/NftSection' -import { ButtonPopup, FilterableItemPopup } from '../../popup' +import { ButtonPopup } from '../../popup' import { StatusCard } from '../../StatusCard' import { TokenLineHeader } from '../../token' import { Tooltip, TooltipInfoIcon } from '../../tooltip' @@ -203,23 +202,8 @@ export const TreasuryTab = ({

{t('title.treasury')}

- ({ - key: chainId + address, - label: getDisplayNameForChainId(chainId), - iconUrl: getImageUrlForChainId(chainId), - description: concatAddressStartEnd(address, 10, 6), - rightNode: ( -

- {t(`accountTypeLabel.${type}`)} -

- ), - iconClassName: '!h-8 !w-8', - contentContainerClassName: '!gap-4', - chainId, - address, - }))} + { navigator.clipboard.writeText(address) toast.success( @@ -228,7 +212,6 @@ export const TreasuryTab = ({ }) ) }} - searchPlaceholder={t('info.searchForAccount')} trigger={{ type: 'button', props: { @@ -376,5 +359,3 @@ export const TreasuryTab = ({ ) } - -const FILTERABLE_KEYS = ['label', 'chainId', 'address'] diff --git a/packages/stateless/components/inputs/AccountSelector.tsx b/packages/stateless/components/inputs/AccountSelector.tsx new file mode 100644 index 000000000..4c9ba1a19 --- /dev/null +++ b/packages/stateless/components/inputs/AccountSelector.tsx @@ -0,0 +1,198 @@ +import { ArrowDropDown, Check, CopyAllOutlined } from '@mui/icons-material' +import clsx from 'clsx' +import { useEffect, useState } from 'react' +import toast from 'react-hot-toast' +import { useTranslation } from 'react-i18next' + +import { Account } from '@dao-dao/types' +import { + abbreviateAddress, + getDisplayNameForChainId, + getImageUrlForChainId, +} from '@dao-dao/utils' + +import { ChainLogo } from '../chain' +import { + FilterableItemPopup, + FilterableItemPopupProps, +} from '../popup/FilterableItemPopup' + +export type AccountSelectorProps = { + /** + * The list of accounts. + */ + accounts: Account[] + /** + * Account selection callback function. + */ + onSelect: (account: Account) => void + /** + * Optionally show the current account in the trigger button. Otherwise shows + * a generic selection prompt. + */ + selectedAccount?: Account + /** + * Optionally hide the account chain image when selected account is showing. + */ + hideChainImage?: boolean + /** + * The default number of characters to slice from the beginning and end of the + * selected account address when abbreviating it in the trigger button. Set to + * -1 to show the whole address. + * + * Defaults to 3. + */ + addressAbbreviationLength?: number +} & ( + | { + /** + * Optionally override the trigger. + */ + trigger: FilterableItemPopupProps['trigger'] + /** + * Optionally show a loader and disallow selection, if the trigger is not + * being overridden. + */ + loading?: never + /** + * Optionally disable selection, if the trigger is not being overridden. + */ + disabled?: never + /** + * Optionally apply a class name to the container button, if the trigger + * is not being overridden. + */ + className?: never + } + | { + /** + * Optionally override the trigger. + */ + trigger?: never + /** + * Optionally show a loader and disallow selection, if the trigger is not + * being overridden. + */ + loading?: boolean + /** + * Optionally disable selection, if the trigger is not being overridden. + */ + disabled?: boolean + /** + * Optionally apply a class name to the container button, if the trigger + * is not being overridden. + */ + className?: string + } +) + +/** + * A generic account selector popup input. + */ +export const AccountSelector = ({ + accounts, + onSelect, + selectedAccount, + hideChainImage, + addressAbbreviationLength = 3, + className, + loading, + disabled, + trigger, +}: AccountSelectorProps) => { + const { t } = useTranslation() + + const [copied, setCopied] = useState(false) + // Unset copied after 2 seconds. + useEffect(() => { + const timeout = setTimeout(() => setCopied(false), 2000) + // Cleanup on unmount. + return () => clearTimeout(timeout) + }, [copied]) + + const CopyIcon = copied ? Check : CopyAllOutlined + + return ( + ({ + account, + key: account.chainId + account.address, + label: getDisplayNameForChainId(account.chainId), + iconUrl: getImageUrlForChainId(account.chainId), + description: abbreviateAddress(account.address), + rightNode: ( +

+ {t(`accountTypeLabel.${account.type}`)} +

+ ), + iconClassName: '!h-8 !w-8', + contentContainerClassName: '!gap-4', + }))} + onSelect={({ account }) => onSelect(account)} + searchPlaceholder={t('info.searchForAccount')} + trigger={ + trigger || { + type: 'button', + tooltip: + disabled && selectedAccount ? t('button.copyAddress') : undefined, + props: { + className: clsx('min-w-[10rem] w-min', className), + contentContainerClassName: + 'justify-between text-icon-primary !gap-4', + loading, + size: 'lg', + variant: 'ghost_outline', + // Disable click entirely if not turning into copy button below. + disabled: disabled && !selectedAccount, + // Override trigger and make it copy on click when disabled. + onClick: + disabled && selectedAccount + ? () => { + navigator.clipboard.writeText(selectedAccount.address) + setCopied(true) + toast.success(t('info.copiedToClipboard')) + } + : undefined, + children: ( + <> + {selectedAccount ? ( +
+ {!hideChainImage && ( + + )} + +

+ {addressAbbreviationLength === -1 + ? selectedAccount.address + : abbreviateAddress( + selectedAccount.address, + addressAbbreviationLength + )} +

+
+ ) : ( +

+ {disabled + ? t('info.noAccountSelected') + : t('button.selectAccount')} +

+ )} + + {disabled ? ( + selectedAccount && ( + + ) + ) : ( + + )} + + ), + }, + } + } + /> + ) +} + +const FILTERABLE_KEYS = ['label', 'chainId', 'address'] diff --git a/packages/stateless/components/inputs/InputLabel.tsx b/packages/stateless/components/inputs/InputLabel.tsx index 7f2c05685..75cde2857 100644 --- a/packages/stateless/components/inputs/InputLabel.tsx +++ b/packages/stateless/components/inputs/InputLabel.tsx @@ -5,11 +5,11 @@ import { useTranslation } from 'react-i18next' import { TooltipInfoIcon } from '../tooltip/TooltipInfoIcon' export interface InputLabelProps - extends Omit, 'children' | 'title'> { + extends Omit, 'children' | 'title'> { mono?: boolean name?: string tooltip?: ReactNode - containerProps?: Omit, 'children'> + containerProps?: Omit, 'children'> children?: ReactNode | ReactNode[] optional?: boolean primary?: boolean @@ -31,11 +31,11 @@ export const InputLabel = ({ const { t } = useTranslation() return ( - +
) } diff --git a/packages/stateless/components/inputs/NumberInput.tsx b/packages/stateless/components/inputs/NumberInput.tsx index 5a38156ee..2396a679b 100644 --- a/packages/stateless/components/inputs/NumberInput.tsx +++ b/packages/stateless/components/inputs/NumberInput.tsx @@ -1,18 +1,13 @@ import { Add, Remove } from '@mui/icons-material' import clsx from 'clsx' -import { ComponentPropsWithoutRef } from 'react' -import { - FieldPathValue, - FieldValues, - Path, - UseFormRegister, - Validate, -} from 'react-hook-form' +import { FieldValues, Path } from 'react-hook-form' import { useTranslation } from 'react-i18next' +import { NumberInputProps } from '@dao-dao/types' import { convertDenomToMicroDenomWithDecimals, convertMicroDenomToDenomWithDecimals, + toAccessibleImageUrl, } from '@dao-dao/utils' import { IconButton } from '../icon_buttons' @@ -23,56 +18,6 @@ import { IconButton } from '../icon_buttons' // react-hook-form form, the `setValue` function can easily be mocked, and the // first fieldName argument (which will be an empty string) can be ignored. -export interface NumberInputProps< - FV extends FieldValues, - FieldName extends Path -> extends Omit< - ComponentPropsWithoutRef<'input'>, - 'type' | 'required' | 'value' - > { - // The field name for the form. - fieldName?: FieldName - // Register function returned by `useForm`/`useFormContext`. - register?: UseFormRegister - // Validations to apply when registering this input. - validation?: Validate>[] - // Applies to the input when registering with a form. - required?: boolean - // Transform the value displayed in the input by these decimals. - transformDecimals?: number - // If error present, outline input in red. - error?: any - // Hide plus/minus buttons - hidePlusMinus?: boolean - // Value passed to the input. - value?: number - // Used to get the value when the plus/minus buttons are clicked. Accepts the - // react-hook-form `watch` function, or any custom function. - watch?: (fieldName: any) => number | undefined - // Used to set the value when the plus/minus buttons are clicked. Accepts the - // react-hook-form `watch` function, or any custom function. - setValue?: ( - fieldName: any, - value: number, - options?: { shouldValidate: boolean } - ) => void - // Applies to the outer-most container, which contains the plus/minus buttons, - // the input, and the unit. - containerClassName?: string - // Size of the container. - sizing?: 'sm' | 'md' | 'lg' | 'auto' | 'fill' | 'none' - // Remove padding, rounded corners, and outline. - ghost?: boolean - // A unit to display to the right of the number. - unit?: string - // Applies to both the input text and the unit. - textClassName?: string - // Applies to the unit only. - unitClassName?: string - // Size of the plus/minus buttons. Defaults to 'sm'. - plusMinusButtonSize?: 'sm' | 'lg' -} - export const NumberInput = < FV extends FieldValues, FieldName extends Path @@ -93,8 +38,11 @@ export const NumberInput = < transformDecimals, ghost, unit, + unitIconUrl, textClassName, unitClassName, + unitIconClassName, + unitContainerClassName, plusMinusButtonSize = 'sm', ...props }: NumberInputProps) => { @@ -241,16 +189,35 @@ export const NumberInput = < }))} /> - {unit && ( -

- {unit} -

+ {unitIconUrl && ( +
+ )} + +

+ {unit} +

+
)}
) diff --git a/packages/stateless/components/inputs/PercentButton.tsx b/packages/stateless/components/inputs/PercentButton.tsx index 816d6f48c..0029f7d75 100644 --- a/packages/stateless/components/inputs/PercentButton.tsx +++ b/packages/stateless/components/inputs/PercentButton.tsx @@ -1,6 +1,6 @@ import clsx from 'clsx' -import { LoadingData } from '@dao-dao/types' +import { ButtonProps, LoadingData } from '@dao-dao/types' import { Button } from '../buttons' @@ -13,6 +13,7 @@ export interface PercentButtonProps { decimals: number className?: string absoluteOffset?: number + size?: ButtonProps['size'] } export const PercentButton = ({ @@ -24,6 +25,7 @@ export const PercentButton = ({ decimals, className, absoluteOffset, + size, }: PercentButtonProps) => ( + {!readOnly && ( + + )}
-
-
-

- {thirdPerson - ? t('info.whatDoTheyWantToBeRated') - : t('info.whatDoYouWantToBeRated')} -

- -
- - -

- {t('info.dontKnowNotSure')} +

+ {!readOnly && ( +
+

+ {thirdPerson + ? t('info.whatDoTheyWantToBeRated') + : t('info.whatDoYouWantToBeRated')}

+ +
+ + +

+ {t('info.dontKnowNotSure')} +

+
-
+ )}
{survey.attributes.map(({ name }, attributeIndex) => ( @@ -145,6 +158,7 @@ export const ContributionFormInput = ({ - -const Template: ComponentStory = (args) => ( - -) - -export const makeProps = (): NewSurveyFormProps => ({ - loading: false, - onCreate: async () => alert('create'), - ...makeNewAttributeTokenProps(), -}) - -export const Default = Template.bind({}) -Default.args = makeProps() diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ProposalCreationForm.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ProposalCreationForm.tsx deleted file mode 100644 index f12e5f1b0..000000000 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ProposalCreationForm.tsx +++ /dev/null @@ -1,554 +0,0 @@ -import { GavelRounded, Visibility, VisibilityOff } from '@mui/icons-material' -import clsx from 'clsx' -import { - ComponentType, - Dispatch, - Fragment, - SetStateAction, - useMemo, - useState, -} from 'react' -import { useForm } from 'react-hook-form' -import { useTranslation } from 'react-i18next' - -import { - Button, - CosmosMessageDisplay, - InputErrorMessage, - Loader, - MarkdownRenderer, - ProposalContentDisplay, - SegmentedControls, - SwitchCard, - TextAreaInput, - TextInput, - TokenAmountDisplay, -} from '@dao-dao/stateless' -import { - Entity, - GenericTokenWithUsdPrice, - LoadingData, - StatefulEntityDisplayProps, - StatefulProposalListProps, -} from '@dao-dao/types' -import { - convertMicroDenomToDenomWithDecimals, - decodedMessagesString, - validateRequired, -} from '@dao-dao/utils' - -import { NewProposalData } from '../../../../../../proposal-module-adapter/adapters/DaoProposalSingle/types' -import { CompleteRatings, Status } from '../../types' - -export type ProposalCreationFormData = { - type: 'new' | 'existing' | 'none' - newProposal: Omit - existing: string -} - -export interface ProposalCreationFormProps { - status: Status - completeRatings: CompleteRatings - onComplete: (data: ProposalCreationFormData) => Promise - loading: boolean - EntityDisplay: ComponentType - tokenPrices: GenericTokenWithUsdPrice[] - walletAddress: string - entity: LoadingData - weightByVotingPower: boolean - setWeightByVotingPower: Dispatch> - ProposalList: ComponentType -} - -export const ProposalCreationForm = ({ - status: { survey }, - completeRatings, - onComplete, - loading, - EntityDisplay, - tokenPrices, - walletAddress, - entity, - weightByVotingPower, - setWeightByVotingPower, - ProposalList, -}: ProposalCreationFormProps) => { - const { t } = useTranslation() - - // Map token denom to price info. - const tokenMap = useMemo( - () => - tokenPrices.reduce( - (acc, tokenInfo) => ({ - ...acc, - [tokenInfo.token.denomOrAddress]: tokenInfo, - }), - {} as Record - ), - [tokenPrices] - ) - - // Markdown table of ratings by each rater for each contributor and attribute. - const ratingMarkdownTables = - '## Ratings\n\n' + - survey.attributes - .map(({ name }, attributeIndex) => - [ - // Attribute Title - '### ' + name, - // Table Header - [ - '', - 'Contributor', - ...completeRatings.ratings.map(({ rater }) => rater.address), - '', - ] - .join(' | ') - .trim(), - // Table Header Divider - ['', '---', ...completeRatings.ratings.map(() => '---'), ''] - .join(' | ') - .trim(), - // Table Rows, per-contributor ratings. - ...completeRatings.contributions.map((contribution) => - [ - '', - // Contributor. - contribution.contributor.address, - // Rating by each rater for this contributor. - ...completeRatings.ratings.map(({ contributions }) => { - const rating = contributions.find( - ({ id }) => id === contribution.id - )?.attributes[attributeIndex] - - return typeof rating === 'number' ? rating : '' - }), - '', - ] - .join(' | ') - .trim() - ), - ].join('\n') - ) - .join('\n\n') - - const [showPreview, setShowPreview] = useState(false) - const { - watch, - register, - setValue, - handleSubmit, - formState: { errors }, - } = useForm({ - defaultValues: { - type: 'new', - newProposal: { - title: '', - description: ratingMarkdownTables, - }, - existing: '', - }, - }) - const formData = watch() - const type = formData.type - const proposalTitle = formData.newProposal.title - const proposalDescription = formData.newProposal.description - - return ( -
-

{survey.name}

- - - -
- {survey.attributes.map(({ name }, attributeIndex) => ( -
-

{name}

- -
'auto') - .join(' ')}`, - }} - > - {/* Row for titles, which are mostly rater names. */} -

- {t('title.contributor')} -

- {completeRatings.ratings.map(({ rater }, ratingIndex) => ( - - ))} - - {/* Row for each contributor. */} - {completeRatings.contributions.map( - (contribution, contributionIndex) => { - // Every other row. - const backgroundClassName = - // eslint-disable-next-line i18next/no-literal-string - contributionIndex % 2 !== 0 && 'bg-background-tertiary' - - return ( - - - - {completeRatings.ratings.map( - ({ rater, contributions }, ratingIndex) => { - const rating = contributions.find( - ({ id }) => id === contribution.id - )?.attributes[attributeIndex] - - return ( -
- {typeof rating === 'number' ? ( -

{rating}

- ) : // Nothing if abstained. - null} -
- ) - } - )} -
- ) - } - )} -
-
- ))} - - - - className="self-start mb-2" - onSelect={(type) => setValue('type', type)} - selected={type} - tabs={[ - { - label: t('title.newProposal'), - value: 'new', - }, - { - label: t('title.existingProposal'), - value: 'existing', - }, - { - label: t('title.noProposal'), - value: 'none', - }, - ]} - /> - - {type === 'new' ? ( - <> - {/* Proposal title and description. */} -
-
-

- {t('form.title')} -

- -
- - -
-
-
-

- {t('form.description')} -

- -
- - -
-
-
- - setWeightByVotingPower((w) => !w)} - sizing="md" - tooltip={t('form.weightByVotingPowerTooltip')} - /> - - {/* Contributor results grid. */} -
'auto') - .join(' ')} auto`, - }} - > - {/* Row for titles, which are mostly attribute names. */} -

- {t('title.contributor')} -

- {survey.attributes.map(({ name }, attributeIndex) => ( -

- {name} -

- ))} -

- {t('title.compensation')} -

- - {/* Row for each contributor. */} - {completeRatings.contributions.map( - ({ id, contributor, compensation }, contributionIndex) => { - // Every other row. - const backgroundClassName = - // eslint-disable-next-line i18next/no-literal-string - contributionIndex % 2 !== 0 && 'bg-background-tertiary' - - const tokens = compensation.compensationPerAttribute - .flatMap(({ cw20Tokens, nativeTokens }) => [ - ...nativeTokens, - ...cw20Tokens, - ]) - .reduce( - (acc, { denomOrAddress, amount }) => ({ - ...acc, - [denomOrAddress]: - (acc[denomOrAddress] ?? 0) + - convertMicroDenomToDenomWithDecimals( - amount, - tokenMap[denomOrAddress]?.token.decimals ?? 0 - ), - }), - {} as Record - ) - const totalUsdc = Object.entries(tokens) - .map( - ([denomOrAddress, amount]) => - (tokenMap[denomOrAddress]?.usdPrice ?? 0) * amount - ) - .reduce((acc, amount) => acc + amount, 0) - - return ( - - {/* Profile display */} - - - {/* Attribute averages */} - {survey.attributes.map((_, attributeIndex) => ( -

- {compensation.compensationPerAttribute[ - attributeIndex - ].averageRating.toLocaleString(undefined, { - maximumSignificantDigits: 4, - })} -

- ))} - - {/* Total compensation */} -
- {Object.entries(tokens).map( - ([denomOrAddress, amount], index) => ( - - ) - )} - -
- -
-
-
- ) - } - )} -
- -
- - - -
- - {showPreview && ( -
- - } - title={proposalTitle} - /> -
- )} - - ) : type === 'existing' ? ( - <> -
-

- {t('info.selectExistingProposalBelow')} -

- - {loading && } -
- - {} - : ({ proposalId }) => { - setValue('existing', proposalId) - onComplete({ - ...formData, - existing: proposalId, - }) - } - } - /> - - ) : ( - <> - - - )} - -
-
- ) -} diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/RatingForm.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/RatingForm.tsx deleted file mode 100644 index e889d91a4..000000000 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/RatingForm.tsx +++ /dev/null @@ -1,376 +0,0 @@ -import { Publish } from '@mui/icons-material' -import { ComponentType, useEffect, useMemo } from 'react' -import { FormProvider, useForm } from 'react-hook-form' -import { useTranslation } from 'react-i18next' - -import { - Button, - Checkbox, - InputErrorMessage, - InputLabel, - MarkdownRenderer, - RangeInput, - TokenAmountDisplay, - useChain, -} from '@dao-dao/stateless' -import { - AddressInputProps, - GenericTokenWithUsdPrice, - StatefulEntityDisplayProps, - TransProps, -} from '@dao-dao/types' -import { - convertMicroDenomToDenomWithDecimals, - formatDateTimeTz, - makeValidateAddress, - validateRequired, -} from '@dao-dao/utils' - -import { - Contribution, - ContributionCompensation, - ContributionFormData, - ContributionRating, - RatingsFormData, - Status, -} from '../../types' -import { computeCompensation } from '../../utils' -import { ContributionFormInput } from './ContributionFormInput' - -export interface ContributionRatingData { - contributions: Contribution[] - existingRatings: ContributionRating[] -} - -export type NominationForm = ContributionFormData & { - contributor: string -} - -export interface RatingFormProps { - status: Status - data: ContributionRatingData - onSubmit: (data: RatingsFormData) => Promise - loadingSubmit: boolean - EntityDisplay: ComponentType - AddressInput: ComponentType> - Trans: ComponentType - tokenPrices: GenericTokenWithUsdPrice[] - onNominate: (data: NominationForm) => Promise - loadingNominate: boolean -} - -export const RatingForm = ({ - status: { survey, rated }, - data, - onSubmit, - loadingSubmit, - EntityDisplay, - AddressInput, - Trans, - tokenPrices, - onNominate, - loadingNominate, -}: RatingFormProps) => { - const { t } = useTranslation() - const { bech32_prefix: bech32Prefix } = useChain() - - const { watch, setValue, handleSubmit, reset } = useForm({ - defaultValues: { - ratings: [], - }, - }) - - // When contributions load, set the default form values. - const ratings = watch('ratings') - useEffect(() => { - if (data && ratings.length !== data.contributions.length) { - reset({ - ratings: data.contributions.map(({ id }) => ({ - contributionId: id, - // Weight doesn't matter since it's a projection based on one rating. - weight: 1, - attributes: [ - // Try to find existing rating. - ...(data.existingRatings.find( - ({ contributionId }) => contributionId === id - )?.attributes ?? - // Default to abstain. - survey.attributes.map(() => null)), - ], - })), - }) - } - }, [data, ratings, reset, survey.attributes]) - - // Compute compensation for each contribution to display projection. - const compensation: ContributionCompensation[] = data - ? computeCompensation( - data.contributions.map(({ id }) => id), - ratings, - survey.attributes - ) - : [] - - // Map token denom to price info. - const tokenMap = useMemo( - () => - tokenPrices.reduce( - (acc, tokenInfo) => ({ - ...acc, - [tokenInfo.token.denomOrAddress]: tokenInfo, - }), - {} as Record - ), - [tokenPrices] - ) - - const nominationFormMethods = useForm({ - defaultValues: { - contribution: '', - images: [], - ratings: survey.attributes.map(() => null), - }, - }) - - return ( -
-
-

{survey.name}

-

- {t('info.ratingClosesAt', { - date: formatDateTimeTz(new Date(survey.ratingsCloseAt)), - })} -

-
- - - -
-
'auto') - .join(' ')} auto`, - }} - > - {data.contributions.map((contribution, contributionIndex) => { - const compensationForContribution = - compensation[contributionIndex].compensationPerAttribute - const projectedTokens = compensationForContribution - .flatMap(({ cw20Tokens, nativeTokens }) => [ - ...nativeTokens, - ...cw20Tokens, - ]) - .reduce( - (acc, { denomOrAddress, amount }) => ({ - ...acc, - [denomOrAddress]: - (acc[denomOrAddress] ?? 0) + - convertMicroDenomToDenomWithDecimals( - amount, - tokenMap[denomOrAddress]?.token.decimals ?? 0 - ), - }), - {} as Record - ) - const projectedTotalUsdc = Object.entries(projectedTokens) - .map( - ([denomOrAddress, amount]) => - (tokenMap[denomOrAddress]?.usdPrice ?? 0) * amount - ) - .reduce((acc, amount) => acc + amount, 0) - - const attributeRatingsFieldName = - `ratings.${contributionIndex}.attributes` as const - const attributeRatings = watch(attributeRatingsFieldName) || [] - const allRatingsAbstain = attributeRatings.every( - (rating) => rating === null - ) - const toggleAbstain = () => - allRatingsAbstain - ? setValue( - attributeRatingsFieldName, - [...Array(survey.attributes.length)].map(() => 0) - ) - : setValue( - attributeRatingsFieldName, - [...Array(survey.attributes.length)].map(() => null) - ) - - return ( -
-
- - - -
- -
-
- - -

- {t('info.dontKnowNotSure')} -

-
- - {survey.attributes.map(({ name }, attributeIndex) => ( -
-
-

{name}

- - {/* What they feel they should be rated */} - {contribution.ratings?.[attributeIndex] !== null && ( -

- {t('title.requestedRating')}:{' '} - {contribution.ratings?.[attributeIndex]} -

- )} -
- - -
- ))} -
- - {/* Projected compensation */} - {!allRatingsAbstain && ( -
-

- {t('title.projectedCompensation')} -

- -
- {Object.entries(projectedTokens).map( - ([denomOrAddress, amount], index) => ( - - ) - )} - -
- -
-
-
- )} -
- ) - })} -
- - {rated && ( -

- {t('form.ratingsSubmitted')} -

- )} - - -
- -
-

{t('title.nominateContributor')}

- - - -
-
- - - -
- - - - - -
-
-
- ) -} diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/SurveyList.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/SurveyList.tsx new file mode 100644 index 000000000..eb64df6ef --- /dev/null +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/SurveyList.tsx @@ -0,0 +1,85 @@ +import { ArrowDropDown } from '@mui/icons-material' +import { ComponentType } from 'react' +import { useTranslation } from 'react-i18next' + +import { + StatefulSurveyRowProps, + SurveyStatus, + SurveyWithMetadata, +} from '../../types' + +export type SurveyListProps = { + surveys: SurveyWithMetadata[] + SurveyRow: ComponentType +} + +export const SurveyList = ({ surveys, SurveyRow }: SurveyListProps) => { + const { t } = useTranslation() + + const grouped = surveys.reduce( + (acc, survey) => { + let group = acc.find((g) => g.status === survey.survey.status) + if (!group) { + group = { + status: survey.survey.status, + title: t( + survey.survey.status in statusTitles + ? statusTitles[survey.survey.status] + : '' + ), + surveys: [], + } + acc.push(group) + } + + group.surveys.push(survey) + + return acc + }, + [] as { + status: SurveyStatus + title: string + surveys: SurveyWithMetadata[] + }[] + ) + + grouped.sort( + (a, b) => statusOrder.indexOf(a.status) - statusOrder.indexOf(b.status) + ) + + return ( + <> + {grouped.map(({ status, title, surveys }) => ( +
+
+ + +

{title}

+
+ +
+ {surveys.map((survey) => ( + + ))} +
+
+ ))} + + ) +} + +const statusTitles: Record = { + [SurveyStatus.Inactive]: 'title.upcoming', + [SurveyStatus.AcceptingContributions]: 'title.acceptingSubmissions', + [SurveyStatus.AcceptingRatings]: 'info.waitingForRateAndPropose', + [SurveyStatus.AwaitingCompletion]: 'info.waitingForRateAndPropose', + [SurveyStatus.Complete]: 'title.history', +} + +const statusOrder: SurveyStatus[] = [ + SurveyStatus.Inactive, + SurveyStatus.AcceptingContributions, + SurveyStatus.AcceptingRatings, + SurveyStatus.AwaitingCompletion, + SurveyStatus.Complete, +] diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/OpenSurveySection.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/SurveyRow.tsx similarity index 59% rename from packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/OpenSurveySection.tsx rename to packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/SurveyRow.tsx index acb14bbc3..ff409e856 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/OpenSurveySection.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/SurveyRow.tsx @@ -1,26 +1,44 @@ -import { ArrowDropDown } from '@mui/icons-material' import clsx from 'clsx' +import { ComponentType } from 'react' import { useTranslation } from 'react-i18next' -import { ProposalWalletVote, Tooltip } from '@dao-dao/stateless' +import { + ProposalWalletVote, + Tooltip, + useDaoContext, + useDaoNavHelpers, +} from '@dao-dao/stateless' +import { LinkWrapperProps, WidgetId } from '@dao-dao/types' import { formatDateTimeTz } from '@dao-dao/utils' -import { Status, SurveyStatus } from '../../types' +import { PagePath, SurveyStatus, SurveyWithMetadata } from '../../types' -export interface OpenSurveySectionProps { - status: Status - onClick?: () => void - loading: boolean +export type SurveyRowProps = { + /** + * The active survey. + */ + survey: SurveyWithMetadata + /** + * Whether or not a wallet is connected. + */ connected: boolean + /** + * Whether or not the current wallet was a member of the DAO when the survey + * was created. + */ isMember: boolean - tooltip?: string + /** + * Stateful link wrapper component. + */ + LinkWrapper: ComponentType } -export const OpenSurveySection = ({ - status: { +export const SurveyRow = ({ + survey: { contribution, rated, survey: { + uuid, status, name, contributionsOpenAt, @@ -28,20 +46,13 @@ export const OpenSurveySection = ({ ratingsCloseAt, }, }, - onClick, - loading, connected, isMember, - tooltip, -}: OpenSurveySectionProps) => { + LinkWrapper, +}: SurveyRowProps) => { const { t } = useTranslation() - - const sectionTitleKey = - status === SurveyStatus.Inactive - ? 'title.upcoming' - : status === SurveyStatus.AcceptingContributions - ? 'title.acceptingSubmissions' - : 'info.waitingForRateAndPropose' + const { dao } = useDaoContext() + const { getDaoPath } = useDaoNavHelpers() // Display upcoming date first, then date when contributions close. Even // during processing, show the date when contributions closed. @@ -110,50 +121,50 @@ export const OpenSurveySection = ({ /> ) - return ( - <> -
- + const tooltip = isMember + ? undefined + : status === SurveyStatus.AcceptingRatings || + status === SurveyStatus.AwaitingCompletion + ? t('info.submissionsBeingRated') + : undefined -

{t(sectionTitleKey)}

-
+ return ( + + + {/* Desktop */} +
+

{name}

- -
- {/* Desktop */} -
-

{name}

+

+ {date} +

-

- {date} -

+ {statusDisplay} +
+ {/* Mobile */} +
+
+

{name}

{statusDisplay}
- {/* Mobile */} -
-
-

{name}

- {statusDisplay} -
- -
-

- {date} -

-
+
+

+ {date} +

- - + + ) } diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/TabRenderer.stories.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/TabRenderer.stories.tsx index 2676e7ba8..66864f940 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/TabRenderer.stories.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/TabRenderer.stories.tsx @@ -1,12 +1,8 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' -import { IconButtonLink } from '@dao-dao/stateless' import { DaoPageWrapperDecorator } from '@dao-dao/storybook' -import { - Default as NewStoryFormStory, - makeProps as makeNewSurveyFormProps, -} from './NewSurveyForm.stories' +import { ButtonLink } from '../../../../../../components' import { TabRenderer } from './TabRenderer' export default { @@ -22,43 +18,6 @@ const Template: ComponentStory = (args) => ( export const Default = Template.bind({}) Default.args = { - loadingStatus: { loading: false, data: undefined }, - loadingCompletedSurveys: { - loading: false, - data: [ - { - id: 1, - name: 'October 2022 Contributor Drop', - contributionCount: 10, - contributionsOpenedAt: '2022-10-01T12:00:00.000Z', - proposalId: 'A1', - createdAtBlockHeight: 1, - }, - { - id: 2, - name: 'November 2022 Contributor Drop', - contributionCount: 7, - contributionsOpenedAt: '2022-11-01T12:00:00.000Z', - proposalId: 'A2', - createdAtBlockHeight: 2, - }, - { - id: 3, - name: 'December 2022 Contributor Drop', - contributionCount: 14, - contributionsOpenedAt: '2022-12-01T12:00:00.000Z', - proposalId: 'A3', - createdAtBlockHeight: 3, - }, - ], - }, - loadingMembershipDuringCompletedSurveys: { - loading: false, - errored: false, - data: ['0', '5', '10'], - }, isMember: true, - NewSurveyForm: () => , - downloadCompletedSurvey: async (survey) => alert('download ' + survey.name), - IconButtonLink, + ButtonLink, } diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/TabRenderer.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/TabRenderer.tsx index 06c1254ce..eb54641c7 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/TabRenderer.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/TabRenderer.tsx @@ -1,94 +1,62 @@ -import { Add, ArrowDropDown, Ballot, Remove } from '@mui/icons-material' -import clsx from 'clsx' -import { ComponentType, useState } from 'react' +import { Add, ArrowBackRounded, Remove } from '@mui/icons-material' +import { ComponentType } from 'react' import { useTranslation } from 'react-i18next' import { - Button, - LineLoader, - LineLoaders, - NoContent, Tooltip, useDaoInfoContext, useDaoNavHelpers, } from '@dao-dao/stateless' -import { LoadingData, LoadingDataWithError } from '@dao-dao/types' -import { IconButtonLinkProps } from '@dao-dao/types/components/IconButtonLink' +import { ButtonLinkProps, WidgetId } from '@dao-dao/types' -import { - CompletedSurveyListing, - StatefulOpenSurveySectionProps, - Status, -} from '../../types' -import { CompletedSurveyRow } from './CompletedSurveyRow' +import { PagePath } from '../../types' export interface TabRendererProps { - loadingStatus: LoadingData - loadingCompletedSurveys: LoadingData isMember: boolean - NewSurveyForm: ComponentType - OpenSurveySection: ComponentType< - Pick - > - downloadCompletedSurvey: (pastSurvey: CompletedSurveyListing) => void - loadingCompletedSurveyId: number | undefined - loadingMembershipDuringCompletedSurveys: LoadingDataWithError - IconButtonLink: ComponentType + pages: Record + ButtonLink: ComponentType } export const TabRenderer = ({ - loadingStatus, - loadingCompletedSurveys, isMember, - NewSurveyForm, - OpenSurveySection, - downloadCompletedSurvey, - loadingCompletedSurveyId, - loadingMembershipDuringCompletedSurveys, - IconButtonLink, + pages, + ButtonLink, }: TabRendererProps) => { const { t } = useTranslation() const { coreAddress } = useDaoInfoContext() - const { getDaoProposalPath } = useDaoNavHelpers() - - const [showCreate, setShowCreate] = useState(false) - // Can create survey if member of DAO and there does not exist a current - // survey. - const canCreateSurvey = - isMember && !loadingStatus.loading && !loadingStatus.data + const { daoSubpathComponents, getDaoPath } = useDaoNavHelpers() - // Subtitle status. - const subtitleStatus = - !loadingStatus.loading && !loadingStatus.data - ? t('info.noActiveCompensationCycle') - : null + const pagePath = daoSubpathComponents[1] || '' + const Page = + pagePath in pages ? pages[pagePath as PagePath] : pages[PagePath.Home] return (
-
-

- {t('title.retroactiveCompensation')} -

- - {subtitleStatus &&

{subtitleStatus}

} -
+

+ {t('title.retroactiveCompensation')} +

- +
- {loadingStatus.loading ? ( - - ) : // If no active survey, text is shown at the top. No need to render anything here. - !loadingStatus.data ? null : ( - + {/* Back button. */} + {pagePath !== PagePath.Home && ( + + + {t('button.back')} + )} - {canCreateSurvey && showCreate ? ( - - ) : ( - <> -
- -

{t('title.history')}

-
- - {loadingCompletedSurveys.loading ? ( - - ) : loadingCompletedSurveys.data.length > 0 ? ( -
- {loadingCompletedSurveys.data.map((survey, index) => { - const wasMemberDuringSurvey = - !loadingMembershipDuringCompletedSurveys.loading && - !loadingMembershipDuringCompletedSurveys.errored && - Number(loadingMembershipDuringCompletedSurveys.data[index]) > - 0 - - return ( - - wasMemberDuringSurvey - ? // If was a member, prompt for authentication before downloading CSV. - downloadCompletedSurvey(survey) - : // If was not a member but proposal exists, open survey in new tab on select. - survey.proposalId && - window.open( - getDaoProposalPath(coreAddress, survey.proposalId), - '_blank' - ) - } - survey={survey} - tooltip={ - wasMemberDuringSurvey - ? t('button.downloadSurveyCsv') - : t('button.goToProposal') - } - /> - ) - })} -
- ) : ( - setShowCreate(true) - : undefined - } - /> - )} - - )} +
) } diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/CreateSurvey.stories.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/CreateSurvey.stories.tsx new file mode 100644 index 000000000..888c4ae28 --- /dev/null +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/CreateSurvey.stories.tsx @@ -0,0 +1,24 @@ +import { ComponentMeta, ComponentStory } from '@storybook/react' + +import { makeTokenProps as makeNewAttributeTokenProps } from '../NewAttribute.stories' +import { CreateSurvey, CreateSurveyProps } from './CreateSurvey' + +export default { + title: + 'DAO DAO / packages / stateful / widgets / widgets / RetroactiveCompensation / components / stateless / pages / CreateSurvey', + component: CreateSurvey, + excludeStories: ['makeProps'], +} as ComponentMeta + +const Template: ComponentStory = (args) => ( + +) + +export const makeProps = (): CreateSurveyProps => ({ + loading: false, + onCreate: async () => alert('create'), + ...makeNewAttributeTokenProps(), +}) + +export const Default = Template.bind({}) +Default.args = makeProps() diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/NewSurveyForm.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/CreateSurvey.tsx similarity index 97% rename from packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/NewSurveyForm.tsx rename to packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/CreateSurvey.tsx index 04bbec34a..5892c5a6e 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/NewSurveyForm.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/CreateSurvey.tsx @@ -14,20 +14,19 @@ import { } from '@dao-dao/stateless' import { validateRequired } from '@dao-dao/utils' -import { NewSurveyFormData } from '../../types' -import { NewAttribute, NewAttributeProps } from './NewAttribute' +import { NewSurveyFormData } from '../../../types' +import { NewAttribute, NewAttributeProps } from '../NewAttribute' -export interface NewSurveyFormProps - extends Pick { +export type CreateSurveyProps = Pick & { onCreate: (newCompensationCycle: NewSurveyFormData) => Promise loading: boolean } -export const NewSurveyForm = ({ +export const CreateSurvey = ({ onCreate, loading, ...newAttributeProps -}: NewSurveyFormProps) => { +}: CreateSurveyProps) => { const { t } = useTranslation() const formMethods = useForm({ diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/Home.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/Home.tsx new file mode 100644 index 000000000..3d615d431 --- /dev/null +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/Home.tsx @@ -0,0 +1,61 @@ +import { Ballot } from '@mui/icons-material' +import { ComponentType } from 'react' +import { useTranslation } from 'react-i18next' + +import { + ErrorPage, + LineLoader, + NoContent, + useDaoInfoContext, + useDaoNavHelpers, +} from '@dao-dao/stateless' +import { LoadingDataWithError, WidgetId } from '@dao-dao/types' +import { IconButtonLinkProps } from '@dao-dao/types/components/IconButtonLink' + +import { + PagePath, + StatefulSurveyRowProps, + SurveyWithMetadata, +} from '../../../types' +import { SurveyList } from '../SurveyList' + +export type HomeProps = { + loadingSurveys: LoadingDataWithError + isMember: boolean + IconButtonLink: ComponentType + SurveyRow: ComponentType +} + +export const Home = ({ loadingSurveys, isMember, SurveyRow }: HomeProps) => { + const { t } = useTranslation() + const { coreAddress } = useDaoInfoContext() + const { getDaoPath } = useDaoNavHelpers() + + return ( +
+ {loadingSurveys.loading ? ( + + ) : loadingSurveys.errored ? ( + + ) : loadingSurveys.data.length > 0 ? ( + + ) : ( + + )} +
+ ) +} diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ProposalCreationForm.stories.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Complete.stories.tsx similarity index 88% rename from packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ProposalCreationForm.stories.tsx rename to packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Complete.stories.tsx index 5ea8c3c5d..a75aef7a6 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ProposalCreationForm.stories.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Complete.stories.tsx @@ -4,18 +4,18 @@ import { CHAIN_ID } from '@dao-dao/storybook' import { EntityType, TokenType } from '@dao-dao/types' import { getNativeTokenForChainId } from '@dao-dao/utils' -import { EntityDisplay } from '../../../../../../components' -import { makeSurvey } from './ContributionForm.stories' -import { ProposalCreationForm } from './ProposalCreationForm' +import { EntityDisplay } from '../../../../../../../../components' +import { Complete } from './Complete' +import { makeSurvey } from './Submit.stories' export default { title: - 'DAO DAO / packages / stateful / payroll / adapters / Retroactive / components / stateless / ProposalCreationForm', - component: ProposalCreationForm, -} as ComponentMeta + 'DAO DAO / packages / stateful / widgets / widgets / RetroactiveCompensation / components / stateless / pages / ProposalCreationForm', + component: Complete, +} as ComponentMeta -const Template: ComponentStory = (args) => ( - +const Template: ComponentStory = (args) => ( + ) export const Default = Template.bind({}) @@ -141,7 +141,7 @@ Default.args = { cosmosMsgs: [], }, onComplete: async (data) => alert('complete: ' + JSON.stringify(data)), - loading: false, + completing: false, EntityDisplay, tokenPrices: [ { diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Complete.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Complete.tsx new file mode 100644 index 000000000..48d7dfd50 --- /dev/null +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Complete.tsx @@ -0,0 +1,642 @@ +import { GavelRounded, Visibility, VisibilityOff } from '@mui/icons-material' +import clsx from 'clsx' +import { + ComponentType, + Dispatch, + Fragment, + SetStateAction, + useMemo, + useState, +} from 'react' +import { useForm } from 'react-hook-form' +import { useTranslation } from 'react-i18next' + +import { + Button, + CosmosMessageDisplay, + InputErrorMessage, + Loader, + MarkdownRenderer, + ProposalContentDisplay, + SegmentedControls, + SwitchCard, + TextAreaInput, + TextInput, + TokenAmountDisplay, +} from '@dao-dao/stateless' +import { + Entity, + GenericTokenWithUsdPrice, + LoadingData, + LoadingDataWithError, + StatefulEntityDisplayProps, + StatefulProposalListProps, +} from '@dao-dao/types' +import { Boolean } from '@dao-dao/types/contracts/DaoVotingCw721Staked' +import { + convertMicroDenomToDenomWithDecimals, + decodedMessagesString, + validateRequired, +} from '@dao-dao/utils' + +import { NewProposalData } from '../../../../../../../../proposal-module-adapter/adapters/DaoProposalSingle/types' +import { CompleteRatings, SurveyWithMetadata } from '../../../../types' + +export type ProposalCreationFormData = { + type: 'new' | 'existing' | 'none' + newProposal: Omit + existing: string +} + +export type CompleteProps = { + /** + * The active survey. + */ + status: SurveyWithMetadata + /** + * The complete survey ratings to derive the final distribution form. If + * undefined, info has not yet been loaded. + */ + completeRatings: CompleteRatings | undefined + /** + * Whether or not the ratings are loading. + */ + loadingRatings: boolean + /** + * Function to load the ratings. + */ + loadRatings: () => void + /** + * Whether or not the current wallet can complete. + */ + canComplete: LoadingDataWithError + /** + * Callback to submit form data. + */ + onComplete: (data: ProposalCreationFormData) => Promise + /** + * Whether or not the form is being submitted. + */ + completing: Boolean + /** + * The prices for tokens distributed in this survey. + */ + tokenPrices: GenericTokenWithUsdPrice[] + /** + * The currently connected wallet address. + */ + walletAddress: string + /** + * The entity for the wallet. + */ + entity: LoadingData + /** + * Whether or not to weight the ratings by voting power. + */ + weightByVotingPower: boolean + /** + * Change the weight by voting power setting. + */ + setWeightByVotingPower: Dispatch> + /** + * Stateful entity display component. + */ + EntityDisplay: ComponentType + /** + * Stateful proposal list component. + */ + ProposalList: ComponentType +} + +export const Complete = ({ canComplete, ...props }: CompleteProps) => { + const { t } = useTranslation() + + return ( +
+

+ {props.status.survey.name} +

+ + {/* Match style of submit and rate forms with markdown instructions at the top under the title. */} + + + {props.completeRatings ? ( + + ) : ( + !canComplete.loading && + (canComplete.errored ? ( +

+ {t('error.failedToLoadMembershipRefreshPage')} +

+ ) : ( + canComplete.data && ( + + ) + )) + )} +
+ ) +} + +export const InnerComplete = ({ + status: { survey }, + completeRatings, + onComplete, + completing, + tokenPrices, + walletAddress, + entity, + weightByVotingPower, + setWeightByVotingPower, + EntityDisplay, + ProposalList, +}: Omit & { + completeRatings: CompleteRatings +}) => { + const { t } = useTranslation() + + // Map token denom to price info. + const tokenMap = useMemo( + () => + tokenPrices.reduce( + (acc, tokenInfo) => ({ + ...acc, + [tokenInfo.token.denomOrAddress]: tokenInfo, + }), + {} as Record + ), + [tokenPrices] + ) + + // Markdown table of ratings by each rater for each contributor and attribute. + const ratingMarkdownTables = completeRatings + ? '## Ratings\n\n' + + survey.attributes + .map(({ name }, attributeIndex) => + [ + // Attribute Title + '### ' + name, + // Table Header + [ + '', + 'Contributor', + ...completeRatings.ratings.map(({ rater }) => rater.address), + '', + ] + .join(' | ') + .trim(), + // Table Header Divider + ['', '---', ...completeRatings.ratings.map(() => '---'), ''] + .join(' | ') + .trim(), + // Table Rows, per-contributor ratings. + ...completeRatings.contributions.map((contribution) => + [ + '', + // Contributor. + contribution.contributor.address, + // Rating by each rater for this contributor. + ...completeRatings.ratings.map(({ contributions }) => { + const rating = contributions.find( + ({ id }) => id === contribution.id + )?.attributes[attributeIndex] + + return typeof rating === 'number' ? rating : '' + }), + '', + ] + .join(' | ') + .trim() + ), + ].join('\n') + ) + .join('\n\n') + : undefined + + const [showPreview, setShowPreview] = useState(false) + const { + watch, + register, + setValue, + handleSubmit, + formState: { errors }, + } = useForm({ + defaultValues: { + type: 'new', + newProposal: { + title: '', + description: ratingMarkdownTables, + }, + existing: '', + }, + }) + const formData = watch() + const type = formData.type + const proposalTitle = formData.newProposal.title + const proposalDescription = formData.newProposal.description + + return ( +
+

{t('title.results')}

+ + {survey.attributes.map(({ name }, attributeIndex) => ( +
+

{name}

+ +
'auto') + .join(' ')}`, + }} + > + {/* Row for titles, which are mostly rater names. */} +

+ {t('title.contributor')} +

+ {completeRatings.ratings.map(({ rater }, ratingIndex) => ( + + ))} + + {/* Row for each contributor. */} + {completeRatings.contributions.map( + (contribution, contributionIndex) => { + // Every other row. + const backgroundClassName = + // eslint-disable-next-line i18next/no-literal-string + contributionIndex % 2 !== 0 && 'bg-background-tertiary' + + return ( + + + + {completeRatings.ratings.map( + ({ rater, contributions }, ratingIndex) => { + const rating = contributions.find( + ({ id }) => id === contribution.id + )?.attributes[attributeIndex] + + return ( +
+ {typeof rating === 'number' ? ( +

{rating}

+ ) : // Nothing if abstained. + null} +
+ ) + } + )} +
+ ) + } + )} +
+
+ ))} + +

+ {t('info.howCompleteCycle')} +

+ +
+ + className="self-start mb-2" + onSelect={(type) => setValue('type', type)} + selected={type} + tabs={[ + { + label: t('title.newProposal'), + value: 'new', + }, + { + label: t('title.existingProposal'), + value: 'existing', + }, + { + label: t('title.noProposal'), + value: 'none', + }, + ]} + /> + + {type === 'new' ? ( + <> + {/* Proposal title and description. */} +
+
+

{t('form.title')}

+ +
+ + +
+
+
+

+ {t('form.description')} +

+ +
+ + +
+
+
+ + setWeightByVotingPower((w) => !w)} + sizing="md" + tooltip={t('form.weightByVotingPowerTooltip')} + tooltipIconSize="sm" + /> + + {/* Contributor results grid. */} +
'auto') + .join(' ')} auto`, + }} + > + {/* Row for titles, which are mostly attribute names. */} +

+ {t('title.contributor')} +

+ {survey.attributes.map(({ name }, attributeIndex) => ( +

+ {name} +

+ ))} +

+ {t('title.compensation')} +

+ + {/* Row for each contributor. */} + {completeRatings.contributions.map( + ({ id, contributor, compensation }, contributionIndex) => { + // Every other row. + const backgroundClassName = + // eslint-disable-next-line i18next/no-literal-string + contributionIndex % 2 !== 0 && 'bg-background-tertiary' + + const tokens = compensation.compensationPerAttribute + .flatMap(({ cw20Tokens, nativeTokens }) => [ + ...nativeTokens, + ...cw20Tokens, + ]) + .reduce( + (acc, { denomOrAddress, amount }) => ({ + ...acc, + [denomOrAddress]: + (acc[denomOrAddress] ?? 0) + + convertMicroDenomToDenomWithDecimals( + amount, + tokenMap[denomOrAddress]?.token.decimals ?? 0 + ), + }), + {} as Record + ) + const totalUsdc = Object.entries(tokens) + .map( + ([denomOrAddress, amount]) => + (tokenMap[denomOrAddress]?.usdPrice ?? 0) * amount + ) + .reduce((acc, amount) => acc + amount, 0) + + return ( + + {/* Profile display */} + + + {/* Attribute averages */} + {survey.attributes.map((_, attributeIndex) => ( +

+ {compensation.compensationPerAttribute[ + attributeIndex + ].averageRating.toLocaleString(undefined, { + maximumSignificantDigits: 4, + })} +

+ ))} + + {/* Total compensation */} +
+ {Object.entries(tokens).map( + ([denomOrAddress, amount], index) => ( + + ) + )} + +
+ +
+
+
+ ) + } + )} +
+ +
+ + + +
+ + {showPreview && ( +
+ + } + title={proposalTitle} + /> +
+ )} + + ) : type === 'existing' ? ( + <> +
+

+ {t('info.selectExistingProposalBelow')} +

+ + {completing && } +
+ + {} + : ({ proposalId }) => { + setValue('existing', proposalId) + onComplete({ + ...formData, + existing: proposalId, + }) + } + } + /> + + ) : ( + <> + + + )} + +
+ ) +} diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Info.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Info.tsx new file mode 100644 index 000000000..d3147bdc8 --- /dev/null +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Info.tsx @@ -0,0 +1,100 @@ +import { ArrowOutward, Download } from '@mui/icons-material' +import { ComponentType } from 'react' +import { useTranslation } from 'react-i18next' + +import { + Button, + Tooltip, + useDaoContext, + useDaoNavHelpers, +} from '@dao-dao/stateless' +import { ButtonLinkProps, LoadingDataWithError } from '@dao-dao/types' +import { formatDateTimeTz } from '@dao-dao/utils' + +import { SurveyWithMetadata } from '../../../../types' + +export type InfoProps = { + /** + * Survey. + */ + status: SurveyWithMetadata + /** + * Whether or not the current wallet can download the survey CSV. + */ + canDownload: LoadingDataWithError + /** + * Callback to download CSV. + */ + download: () => void + /** + * Whether or not CSV is downloading. + */ + downloading: boolean + /** + * Stateful button link component. + */ + ButtonLink: ComponentType +} + +export const Info = ({ + status: { + survey: { name, contributionsOpenAt, proposalId, contributionCount }, + }, + canDownload, + download, + downloading, + ButtonLink, +}: InfoProps) => { + const { t } = useTranslation() + const { dao } = useDaoContext() + const { getDaoProposalPath } = useDaoNavHelpers() + + return ( +
+
+

{name}

+

+ {formatDateTimeTz(new Date(contributionsOpenAt))} +

+
+ +

+ {t('info.numSubmissions', { count: contributionCount })} +

+ +
+ {!!proposalId && ( + + {t('button.openProposal')} + + + )} + + + + +
+
+ ) +} diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/RatingForm.stories.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Rate.stories.tsx similarity index 81% rename from packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/RatingForm.stories.tsx rename to packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Rate.stories.tsx index 35ee43adc..fa513036f 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/RatingForm.stories.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Rate.stories.tsx @@ -8,19 +8,17 @@ import { AddressInput, EntityDisplay, Trans, -} from '../../../../../../components' -import { makeSurvey } from './ContributionForm.stories' -import { RatingForm } from './RatingForm' +} from '../../../../../../../../components' +import { Rate } from './Rate' +import { makeSurvey } from './Submit.stories' export default { title: - 'DAO DAO / packages / stateful / payroll / adapters / Retroactive / components / stateless / RatingForm', - component: RatingForm, -} as ComponentMeta + 'DAO DAO / packages / stateful / widgets / widgets / RetroactiveCompensation / components / stateless / Rate', + component: Rate, +} as ComponentMeta -const Template: ComponentStory = (args) => ( - -) +const Template: ComponentStory = (args) => export const Default = Template.bind({}) Default.args = { @@ -30,7 +28,7 @@ Default.args = { contributionSelfRatings: null, rated: false, }, - data: { + state: { contributions: [ { id: 1, diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Rate.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Rate.tsx new file mode 100644 index 000000000..c837bc8b1 --- /dev/null +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Rate.tsx @@ -0,0 +1,502 @@ +import { Publish } from '@mui/icons-material' +import { ComponentType, useEffect, useMemo } from 'react' +import { FormProvider, useForm } from 'react-hook-form' +import { useTranslation } from 'react-i18next' + +import { + Button, + Checkbox, + InputErrorMessage, + InputLabel, + MarkdownRenderer, + RangeInput, + TokenAmountDisplay, + useChain, +} from '@dao-dao/stateless' +import { + AddressInputProps, + GenericTokenWithUsdPrice, + LoadingDataWithError, + StatefulEntityDisplayProps, + TransProps, +} from '@dao-dao/types' +import { + convertMicroDenomToDenomWithDecimals, + formatDateTimeTz, + makeValidateAddress, + validateRequired, +} from '@dao-dao/utils' + +import { + Contribution, + ContributionCompensation, + ContributionFormData, + ContributionRating, + RatingsFormData, + SurveyWithMetadata, +} from '../../../../types' +import { + computeCompensation, + extractContributionFormDataFromSurvey, +} from '../../../../utils' +import { ContributionFormInput } from '../../ContributionFormInput' + +export type SurveyContributionRatingState = { + contributions: Contribution[] + existingRatings: ContributionRating[] +} + +export type NominationForm = ContributionFormData & { + contributor: string +} + +export type RateProps = { + /** + * The active survey. + */ + status: SurveyWithMetadata + /** + * The survey contributions and existing ratings. If undefined, info has not + * yet been loaded. + */ + state: SurveyContributionRatingState | undefined + /** + * Whether or not the state is loading. + */ + loadingState: boolean + /** + * Function to load the state. + */ + loadState: () => void + /** + * Whether or not the current wallet can rate. + */ + canRate: LoadingDataWithError + /** + * Callback to submit form data. + */ + onSubmit: (data: RatingsFormData) => Promise + /** + * Whether or not the form is being submitted. + */ + loadingSubmit: boolean + /** + * The prices for tokens distributed in this survey. + */ + tokenPrices: GenericTokenWithUsdPrice[] + /** + * Callback to nominate a new contributor. + */ + onNominate: (data: NominationForm) => Promise + /** + * Whether or not the nominate form is being submitted. + */ + loadingNominate: boolean + /** + * Stateful entity display component. + */ + EntityDisplay: ComponentType + /** + * Stateful address input component. + */ + AddressInput: ComponentType> + /** + * Stateful i18n translation component. + */ + Trans: ComponentType +} + +export const Rate = ({ + status, + state, + loadingState, + loadState, + canRate, + onSubmit, + loadingSubmit, + EntityDisplay, + AddressInput, + Trans, + tokenPrices, + onNominate, + loadingNominate, +}: RateProps) => { + const { survey } = status + + const { t } = useTranslation() + const { bech32_prefix: bech32Prefix } = useChain() + + const { watch, setValue, handleSubmit, reset } = useForm({ + defaultValues: { + ratings: [], + }, + }) + + // When contributions load, set the default form values. + const ratings = watch('ratings') + useEffect(() => { + if (state && ratings.length !== state.contributions.length) { + reset({ + ratings: state.contributions.map(({ id }) => ({ + contributionId: id, + // Weight doesn't matter since it's a projection based on one rating. + weight: 1, + attributes: [ + // Try to find existing rating. + ...(state.existingRatings.find( + ({ contributionId }) => contributionId === id + )?.attributes ?? + // Default to abstain. + survey.attributes.map(() => null)), + ], + })), + }) + } + }, [state, ratings, reset, survey.attributes]) + + // Compute compensation for each contribution to display projection. + const compensation: ContributionCompensation[] = state + ? computeCompensation( + state.contributions.map(({ id }) => id), + ratings, + survey.attributes + ) + : [] + + // Map token denom to price info. + const tokenMap = useMemo( + () => + tokenPrices.reduce( + (acc, tokenInfo) => ({ + ...acc, + [tokenInfo.token.denomOrAddress]: tokenInfo, + }), + {} as Record + ), + [tokenPrices] + ) + + const nominationFormMethods = useForm({ + defaultValues: { + contribution: '', + images: [], + ratings: survey.attributes.map(() => null), + }, + }) + + // Form used to display submission. + const submissionFormMethods = useForm({ + defaultValues: extractContributionFormDataFromSurvey(status), + }) + + return ( +
+
+

{survey.name}

+

+ {t('info.ratingClosesAt', { + date: formatDateTimeTz(new Date(survey.ratingsCloseAt)), + })} +

+
+ + {/* Match style of submit and rate forms with markdown instructions at the top under the title. */} + + + {!state ? ( + <> + {!canRate.loading && + (canRate.errored ? ( +

+ {t('error.failedToLoadMembershipRefreshPage')} +

+ ) : ( + canRate.data && ( + + ) + ))} + +

{t('title.yourSubmission')}

+
+ {status.contribution ? ( +
+ + + +
+ ) : ( +

+ {t('info.retroactiveDidNotSubmit')} +

+ )} +
+ + ) : ( + <> +

{t('title.rate')}

+ + + +
+
'auto') + .join(' ')} auto`, + }} + > + {state.contributions.map((contribution, contributionIndex) => { + const compensationForContribution = + compensation[contributionIndex].compensationPerAttribute + const projectedTokens = compensationForContribution + .flatMap(({ cw20Tokens, nativeTokens }) => [ + ...nativeTokens, + ...cw20Tokens, + ]) + .reduce( + (acc, { denomOrAddress, amount }) => ({ + ...acc, + [denomOrAddress]: + (acc[denomOrAddress] ?? 0) + + convertMicroDenomToDenomWithDecimals( + amount, + tokenMap[denomOrAddress]?.token.decimals ?? 0 + ), + }), + {} as Record + ) + const projectedTotalUsdc = Object.entries(projectedTokens) + .map( + ([denomOrAddress, amount]) => + (tokenMap[denomOrAddress]?.usdPrice ?? 0) * amount + ) + .reduce((acc, amount) => acc + amount, 0) + + const attributeRatingsFieldName = + `ratings.${contributionIndex}.attributes` as const + const attributeRatings = watch(attributeRatingsFieldName) || [] + const allRatingsAbstain = attributeRatings.every( + (rating) => rating === null + ) + const toggleAbstain = () => + allRatingsAbstain + ? setValue( + attributeRatingsFieldName, + [...Array(survey.attributes.length)].map(() => 0) + ) + : setValue( + attributeRatingsFieldName, + [...Array(survey.attributes.length)].map(() => null) + ) + + return ( +
+
+ + + +
+ +
+
+ + +

+ {t('info.dontKnowNotSure')} +

+
+ + {survey.attributes.map(({ name }, attributeIndex) => ( +
+
+

{name}

+ + {/* What they feel they should be rated */} + {contribution.ratings?.[attributeIndex] !== + null && ( +

+ {t('title.requestedRating')}:{' '} + {contribution.ratings?.[attributeIndex]} +

+ )} +
+ + +
+ ))} +
+ + {/* Projected compensation */} + {!allRatingsAbstain && ( +
+

+ {t('title.projectedCompensation')} +

+ +
+ {Object.entries(projectedTokens).map( + ([denomOrAddress, amount], index) => ( + + ) + )} + +
+ +
+
+
+ )} +
+ ) + })} +
+ + {status.rated && ( +

+ {t('form.ratingsSubmitted')} +

+ )} + + +
+ +
+

{t('title.nominateContributor')}

+ + + +
+
+ + + +
+ + + + + +
+
+ + )} +
+ ) +} diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionForm.stories.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Submit.stories.tsx similarity index 79% rename from packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionForm.stories.tsx rename to packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Submit.stories.tsx index 1be9f141d..02f622f8b 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionForm.stories.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Submit.stories.tsx @@ -3,25 +3,25 @@ import { ComponentMeta, ComponentStory } from '@storybook/react' import { EntityDisplay } from '@dao-dao/stateless/components/EntityDisplay' import { Default as ConnectWalletStory } from '@dao-dao/stateless/components/wallet/ConnectWallet.stories' import { CHAIN_ID } from '@dao-dao/storybook' -import { EntityType, TokenType } from '@dao-dao/types' -import { getNativeTokenForChainId } from '@dao-dao/utils' +import { EntityType } from '@dao-dao/types' -import { Trans } from '../../../../../../components' -import { Survey, SurveyStatus } from '../../types' -import { ContributionForm } from './ContributionForm' +import { Trans } from '../../../../../../../../components' +import { Survey, SurveyStatus } from '../../../../types' +import { Submit } from './Submit' export default { title: - 'DAO DAO / packages / stateful / payroll / adapters / Retroactive / components / stateless / ContributionForm', - component: ContributionForm, + 'DAO DAO / packages / stateful / widgets / widgets / RetroactiveCompensation / components / stateless / pages / Submit', + component: Submit, excludeStories: ['makeSurvey'], -} as ComponentMeta +} as ComponentMeta -const Template: ComponentStory = (args) => ( - -) +const Template: ComponentStory = (args) => + +let surveyId = 1 export const makeSurvey = (): Survey => ({ + uuid: (surveyId++).toString(), status: SurveyStatus.AcceptingContributions, name: 'DAO DAO Contributor Drop November 2022', contributionsOpenAt: '2022-11-21T08:00:00.000Z', @@ -53,7 +53,9 @@ export const makeSurvey = (): Survey => ({ cw20Tokens: [], }, ], + proposalId: null, createdAtBlockHeight: 1, + contributionCount: 1, }) export const Default = Template.bind({}) @@ -77,30 +79,6 @@ Default.args = { imageUrl: '/placeholders/1.svg', }, }, - tokenPrices: [ - { - token: { - chainId: CHAIN_ID, - type: TokenType.Cw20, - denomOrAddress: 'dao', - symbol: 'DAO', - decimals: 6, - imageUrl: '/daodao.png', - source: { - chainId: CHAIN_ID, - type: TokenType.Cw20, - denomOrAddress: 'dao', - }, - }, - usdPrice: 1, - timestamp: new Date(), - }, - { - token: getNativeTokenForChainId(CHAIN_ID), - usdPrice: 1, - timestamp: new Date(), - }, - ], EntityDisplay: () => ( Promise + /** + * Whether or not the form is being submitted. + */ loading: boolean + /** + * The wallet entity. + */ loadingEntity: LoadingData - tokenPrices: GenericTokenWithUsdPrice[] + /** + * Wallet entity display. + */ EntityDisplay: ComponentType + /** + * Connect wallet button. + */ ConnectWallet: ComponentType + /** + * Stateful i18n translation component. + */ Trans: ComponentType } -export const ContributionForm = ({ +export const Submit = ({ connected, - status: { - survey, - contribution: existingContribution, - contributionSelfRatings, - }, + status, onSubmit, loading, loadingEntity, EntityDisplay, ConnectWallet, Trans, -}: ContributionFormProps) => { - const { t } = useTranslation() +}: SubmitProps) => { + const { survey } = status - let defaultContribution = existingContribution || '' - // Pull images out of the contribution text. - const defaultImages = defaultContribution - ? defaultContribution - .split('\n\n') - .pop() - ?.split('\n') - .map((part) => - part.startsWith('![') ? part.split('](')[1].slice(0, -1) : undefined - ) - .flatMap((url) => (url ? { url } : [])) - : [] - // If images were found, remove them from the text. - if (defaultImages?.length) { - defaultContribution = defaultContribution - .split('\n\n') - .slice(0, -1) - .join('\n\n') - } + const { t } = useTranslation() const formMethods = useForm({ - defaultValues: { - contribution: defaultContribution, - images: defaultImages, - ratings: contributionSelfRatings || survey.attributes.map(() => null), - }, + defaultValues: extractContributionFormDataFromSurvey(status), }) - const contributed = !!existingContribution + const contributed = !!status.contribution const dateText = survey.status === SurveyStatus.Inactive diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/queries.ts b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/queries.ts new file mode 100644 index 000000000..61748ef14 --- /dev/null +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/queries.ts @@ -0,0 +1,112 @@ +import { QueryClient, queryOptions } from '@tanstack/react-query' + +import { API_BASE } from './constants' +import { SurveyWithMetadata } from './types' + +/** + * Fetch survey with wallet metadata. + */ +export const fetchSurvey = async ({ + daoAddress, + walletPublicKey = '_', + uuid, +}: { + daoAddress: string + walletPublicKey?: string + uuid: string +}): Promise => { + const response = await fetch( + `${API_BASE}/${daoAddress}/${uuid}/${walletPublicKey}/status` + ) + + if (!response.ok) { + const responseBody = await response.json().catch((err) => ({ + error: err instanceof Error ? err.message : JSON.stringify(err), + })) + console.error( + `Failed to fetch retroactive compensation survey for ID ${uuid}.`, + response, + responseBody + ) + throw new Error( + 'error' in responseBody + ? responseBody.error + : JSON.stringify(responseBody) + ) + } + + const survey: SurveyWithMetadata = await response.json() + + return survey +} + +/** + * List surveys. + */ +export const listSurveys = async ( + queryClient: QueryClient, + { + daoAddress, + walletPublicKey = '_', + }: { + daoAddress: string + walletPublicKey?: string + } +): Promise => { + const response = await fetch( + `${API_BASE}/${daoAddress}/${walletPublicKey}/list` + ) + + if (!response.ok) { + const responseBody = await response.json().catch((err) => ({ + error: err instanceof Error ? err.message : JSON.stringify(err), + })) + console.error( + 'Failed to fetch retroactive compensation surveys.', + response, + responseBody + ) + throw new Error( + 'error' in responseBody + ? responseBody.error + : JSON.stringify(responseBody) + ) + } + + const surveys: SurveyWithMetadata[] = (await response.json()).surveys + + surveys.forEach((survey) => { + queryClient.setQueryData( + retroactiveCompensationQueries.survey({ + daoAddress, + walletPublicKey, + uuid: survey.survey.uuid, + }).queryKey, + survey + ) + }) + + return surveys +} + +export const retroactiveCompensationQueries = { + /** + * Fetch survey with wallet metadata. + */ + survey: (options: Parameters[0]) => + queryOptions({ + queryKey: ['retroactiveCompensation', 'survey', options], + queryFn: () => fetchSurvey(options), + }), + /** + * List surveys. + */ + listSurveys: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['retroactiveCompensation', 'listSurveys', options], + queryFn: () => listSurveys(queryClient, options), + }), +} diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/selectors.ts b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/selectors.ts deleted file mode 100644 index 38eba4c30..000000000 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/selectors.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { selectorFamily } from 'recoil' - -import { refreshStatusAtom } from './atoms' -import { API_BASE } from './constants' -import { CompletedSurveyListing, Status } from './types' - -export const statusSelector = selectorFamily< - Status | undefined, - { - daoAddress: string - walletPublicKey: string - } ->({ - key: 'payrollRetroactiveStatus', - get: - ({ daoAddress, walletPublicKey }) => - async ({ get }) => { - get(refreshStatusAtom({ daoAddress })) - - const response = await fetch( - `${API_BASE}/${daoAddress}/${walletPublicKey}/status` - ) - // If not found, return undefined since there is no active survey. - if (response.status === 404) { - return undefined - } else if (!response.ok) { - const responseBody = await response.json().catch((err) => ({ - error: err instanceof Error ? err.message : JSON.stringify(err), - })) - console.error( - 'Failed to fetch retroactive payroll survey status.', - response, - responseBody - ) - throw new Error( - 'error' in responseBody - ? responseBody.error - : JSON.stringify(responseBody) - ) - } - - return await response.json() - }, -}) - -export const listCompletedSurveysSelector = selectorFamily< - CompletedSurveyListing[], - { - daoAddress: string - } ->({ - key: 'listCompletedSurveys', - get: - ({ daoAddress }) => - async ({ get }) => { - get(refreshStatusAtom({ daoAddress })) - - const response = await fetch(`${API_BASE}/${daoAddress}/list`) - // If not found, return undefined since there is no active survey. - if (response.status === 404) { - return undefined - } else if (!response.ok) { - const responseBody = await response.json().catch((err) => ({ - error: err instanceof Error ? err.message : JSON.stringify(err), - })) - console.error( - 'Failed to fetch retroactive payroll survey list.', - response, - responseBody - ) - throw new Error( - 'error' in responseBody - ? responseBody.error - : JSON.stringify(responseBody) - ) - } - - const body = await response.json() - if (!('surveys' in body) || !Array.isArray(body.surveys)) { - throw new Error( - 'Unexpected response from retroactive payroll survey list.' - ) - } - - return body.surveys - }, -}) diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/types.ts b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/types.ts index b0b2e9c41..d7227c4f9 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/types.ts +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/types.ts @@ -8,29 +8,30 @@ export enum SurveyStatus { Complete = 'complete', } -export interface NativeToken { +export type NativeToken = { denom: string amount: string } -export interface Cw20Token { +export type Cw20Token = { address: string amount: string } -export interface Attribute { +export type Attribute = { name: string nativeTokens: NativeToken[] cw20Tokens: Cw20Token[] } -export interface AnyToken { +export type AnyToken = { denomOrAddress: string amount: string } -export interface Survey { - status: string +export type Survey = { + uuid: string + status: SurveyStatus name: string contributionsOpenAt: string contributionsCloseRatingsOpenAt: string @@ -38,13 +39,14 @@ export interface Survey { contributionInstructions: string ratingInstructions: string attributes: Attribute[] + proposalId: string | null createdAtBlockHeight: number + contributionCount: number } export type NewSurveyRequest = Omit -export interface NewSurveyFormData - extends Omit { +export type NewSurveyFormData = Omit & { // Combine native and CW20 tokens into one, and uncombine before submitting. attributes: { name: string @@ -52,23 +54,14 @@ export interface NewSurveyFormData }[] } -export interface Status { +export type SurveyWithMetadata = { survey: Survey contribution: string | null contributionSelfRatings: (number | null)[] | null rated: boolean } -export interface CompletedSurveyListing { - id: number - name: string - contributionCount: number - contributionsOpenedAt: string - proposalId: string - createdAtBlockHeight: number -} - -export interface ContributionRating { +export type ContributionRating = { contributionId: number /** * Weight can be any number. The computation utility function normalizes @@ -79,16 +72,16 @@ export interface ContributionRating { attributes: (number | null)[] } -export interface RatingsFormData { +export type RatingsFormData = { ratings: ContributionRating[] } -export interface Identity { +export type Identity = { publicKey: string address: string } -export interface ContributionResponse { +export type ContributionResponse = { id: number contributor: string content: string @@ -97,12 +90,11 @@ export interface ContributionResponse { updatedAt: string } -export interface Contribution - extends Omit { +export type Contribution = Omit & { contributor: Identity } -export interface RatingResponse { +export type RatingResponse = { rater: string raterVotingPower: string contributions: { @@ -112,11 +104,11 @@ export interface RatingResponse { }[] } -export interface Rating extends Omit { +export type Rating = Omit & { rater: Identity } -export interface RatingsResponse { +export type RatingsResponse = { contributions: ContributionResponse[] ratings: RatingResponse[] } @@ -126,7 +118,7 @@ export type RatingsResponseWithIdentities = { ratings: Rating[] } -export interface ContributionCompensation { +export type ContributionCompensation = { contributionId: number compensationPerAttribute: { averageRating: number @@ -135,26 +127,22 @@ export interface ContributionCompensation { }[] } -export interface ContributionWithCompensation extends Contribution { +export type ContributionWithCompensation = Contribution & { compensation: ContributionCompensation } -export interface CompleteRatings { +export type CompleteRatings = { contributions: ContributionWithCompensation[] ratings: Rating[] cosmosMsgs: UnifiedCosmosMsg[] } -export type CompletedSurvey = Omit & { +export type CompletedSurvey = Survey & { id: number contributions: ContributionResponse[] ratings: RatingResponse[] } -export interface StatefulOpenSurveySectionProps { - status: Status -} - export type ContributionFormData = { contribution: string images?: { @@ -162,3 +150,16 @@ export type ContributionFormData = { }[] ratings: (number | null)[] } + +export enum PagePath { + Home = '', + Create = 'create', + View = 's', +} + +export type StatefulSurveyRowProps = { + /** + * The active survey. + */ + survey: SurveyWithMetadata +} diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts index b0751e00c..ee660e955 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts @@ -4,6 +4,7 @@ import { ContributionCompensation, ContributionFormData, ContributionRating, + SurveyWithMetadata, } from './types' // Distribute compensation per survey attribute among the contributions @@ -138,3 +139,37 @@ export const prepareContributionFormData = ( delete formData.images return formData } + +/** + * Extract contribution form data from survey. + */ +export const extractContributionFormDataFromSurvey = ({ + survey: { attributes }, + contribution, + contributionSelfRatings, +}: SurveyWithMetadata): ContributionFormData => { + contribution ||= '' + + // Pull images out of the contribution text. + const images = contribution + ? contribution + .split('\n\n') + .pop() + ?.split('\n') + .map((part) => + part.startsWith('![') ? part.split('](')[1].slice(0, -1) : undefined + ) + .flatMap((url) => (url ? { url } : [])) + : [] + + // If images were found, remove them from the text. + if (images?.length) { + contribution = contribution.split('\n\n').slice(0, -1).join('\n\n') + } + + return { + contribution, + images, + ratings: contributionSelfRatings || attributes.map(() => null), + } +} diff --git a/packages/stateless/components/NoContent.tsx b/packages/stateless/components/NoContent.tsx index a08efb662..1ec39311b 100644 --- a/packages/stateless/components/NoContent.tsx +++ b/packages/stateless/components/NoContent.tsx @@ -16,6 +16,7 @@ export interface NoContentProps { small?: boolean error?: boolean noBorder?: boolean + shallow?: boolean } // This component displays a dashed outline and centers its content in a way @@ -43,6 +44,7 @@ export const NoContent = forwardRef( small, error, noBorder, + shallow, }, ref ) { @@ -107,7 +109,12 @@ export const NoContent = forwardRef( ) return href ? ( - + {content} ) : ( diff --git a/packages/stateless/hooks/useUpdatingRef.ts b/packages/stateless/hooks/useUpdatingRef.ts index 477621fa9..ac9752310 100644 --- a/packages/stateless/hooks/useUpdatingRef.ts +++ b/packages/stateless/hooks/useUpdatingRef.ts @@ -1,10 +1,14 @@ import { useRef } from 'react' +import { ImmutableRef } from '@dao-dao/types' + /** * Create ref that is updated on every render. This effectively memoizes the * value so it can be used in effects without causing constant re-renders. */ -export const useUpdatingRef = (value: T) => { +export const useUpdatingRef = ( + value: T +): ImmutableRef => { const ref = useRef(value) ref.current = value return ref diff --git a/packages/types/misc.ts b/packages/types/misc.ts index c0b479ebd..f929d3fd2 100644 --- a/packages/types/misc.ts +++ b/packages/types/misc.ts @@ -71,3 +71,11 @@ export type LoadingDataWithError = errored: true error: Error } + +/** + * A non-nullable ref with a current value that cannot be changed. This is used + * by `useUpdatingRef` to prevent modifying the returned mutable ref object. + */ +export type ImmutableRef = { + readonly current: T +} From ed261a2cd6136039e670383d7b8db54e175a14d1 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 30 Jul 2024 22:33:27 -0400 Subject: [PATCH 374/438] added chain ID to contract query keys --- .../query/queries/contracts/Cw1Whitelist.ts | 21 +- .../state/query/queries/contracts/Cw20Base.ts | 92 +++++--- .../queries/contracts/Cw3FlexMultisig.ts | 111 +++++++--- .../query/queries/contracts/Cw721Base.ts | 143 +++++++++---- .../queries/contracts/CwProposalSingle.v1.ts | 118 +++++++--- .../query/queries/contracts/DaoDaoCore.ts | 201 +++++++++++++----- .../contracts/DaoPreProposeMultiple.ts | 82 +++++-- .../queries/contracts/DaoPreProposeSingle.ts | 82 +++++-- .../queries/contracts/DaoProposalMultiple.ts | 154 ++++++++++---- .../queries/contracts/DaoProposalSingle.v2.ts | 154 ++++++++++---- .../queries/contracts/DaoVotingCw20Staked.ts | 78 +++++-- .../query/queries/contracts/DaoVotingCw4.ts | 49 +++-- .../queries/contracts/DaoVotingCw721Staked.ts | 100 ++++++--- .../contracts/DaoVotingNativeStaked.ts | 70 ++++-- .../queries/contracts/DaoVotingOnftStaked.ts | 100 ++++++--- .../contracts/DaoVotingSgCommunityNft.ts | 110 ++++++++-- .../queries/contracts/DaoVotingTokenStaked.ts | 123 ++++++++--- .../contracts/NeutronVotingRegistry.ts | 50 +++-- .../query/queries/contracts/PolytoneNote.ts | 17 +- .../query/queries/contracts/PolytoneProxy.ts | 13 +- .../query/queries/contracts/PolytoneVoice.ts | 12 +- .../queries/contracts/SecretDaoDaoCore.ts | 200 ++++++++++++----- .../SecretDaoPreProposeApprovalSingle.ts | 69 ++++-- .../contracts/SecretDaoPreProposeMultiple.ts | 90 ++++++-- .../contracts/SecretDaoPreProposeSingle.ts | 87 ++++++-- .../contracts/SecretDaoProposalMultiple.ts | 189 ++++++++++++---- .../contracts/SecretDaoProposalSingle.ts | 193 +++++++++++++---- .../queries/contracts/SecretDaoVotingCw4.ts | 44 ++-- .../contracts/SecretDaoVotingSnip20Staked.ts | 116 +++++++--- .../contracts/SecretDaoVotingSnip721Staked.ts | 138 +++++++++--- .../contracts/SecretDaoVotingTokenStaked.ts | 173 ++++++++++++--- .../queries/contracts/ValenceRebalancer.ts | 108 +++++++--- .../hooks/useStakingInfo.ts | 20 +- 33 files changed, 2507 insertions(+), 800 deletions(-) diff --git a/packages/state/query/queries/contracts/Cw1Whitelist.ts b/packages/state/query/queries/contracts/Cw1Whitelist.ts index 5836d9a96..46c4c8270 100644 --- a/packages/state/query/queries/contracts/Cw1Whitelist.ts +++ b/packages/state/query/queries/contracts/Cw1Whitelist.ts @@ -13,17 +13,22 @@ export const cw1WhitelistQueryKeys = { contract: 'cw1Whitelist', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...cw1WhitelistQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - adminList: (contractAddress: string, args?: Record) => + adminList: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw1WhitelistQueryKeys.address(contractAddress)[0], + ...cw1WhitelistQueryKeys.address(chainId, contractAddress)[0], method: 'admin_list', ...(args && { args }), }, @@ -32,12 +37,13 @@ export const cw1WhitelistQueryKeys = { * If this is a cw1-whitelist, return the admins. Otherwise, return null. */ adminsIfCw1Whitelist: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...cw1WhitelistQueryKeys.address(contractAddress)[0], + ...cw1WhitelistQueryKeys.address(chainId, contractAddress)[0], method: 'adminsIfCw1Whitelist', ...(args && { args }), }, @@ -48,7 +54,7 @@ export const cw1WhitelistQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: Cw1WhitelistAdminListQuery ): UseQueryOptions => ({ - queryKey: cw1WhitelistQueryKeys.adminList(contractAddress), + queryKey: cw1WhitelistQueryKeys.adminList(chainId, contractAddress), queryFn: async () => { let indexerNonExistent = false try { @@ -91,7 +97,10 @@ export const cw1WhitelistQueries = { options, }: Cw1WhitelistAdminsIfCw1WhitelistQuery ): UseQueryOptions => ({ - queryKey: cw1WhitelistQueryKeys.adminsIfCw1Whitelist(contractAddress), + queryKey: cw1WhitelistQueryKeys.adminsIfCw1Whitelist( + chainId, + contractAddress + ), queryFn: async () => { const isCw1Whitelist = await queryClient.fetchQuery( contractQueries.isCw1Whitelist(queryClient, { diff --git a/packages/state/query/queries/contracts/Cw20Base.ts b/packages/state/query/queries/contracts/Cw20Base.ts index d7a807f7d..664fbbc89 100644 --- a/packages/state/query/queries/contracts/Cw20Base.ts +++ b/packages/state/query/queries/contracts/Cw20Base.ts @@ -28,84 +28,118 @@ export const cw20BaseQueryKeys = { contract: 'cw20Base', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...cw20BaseQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - balance: (contractAddress: string, args?: Record) => + balance: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw20BaseQueryKeys.address(contractAddress)[0], + ...cw20BaseQueryKeys.address(chainId, contractAddress)[0], method: 'balance', args, }, ] as const, - tokenInfo: (contractAddress: string, args?: Record) => + tokenInfo: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw20BaseQueryKeys.address(contractAddress)[0], + ...cw20BaseQueryKeys.address(chainId, contractAddress)[0], method: 'token_info', args, }, ] as const, - minter: (contractAddress: string, args?: Record) => + minter: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw20BaseQueryKeys.address(contractAddress)[0], + ...cw20BaseQueryKeys.address(chainId, contractAddress)[0], method: 'minter', args, }, ] as const, - allowance: (contractAddress: string, args?: Record) => + allowance: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw20BaseQueryKeys.address(contractAddress)[0], + ...cw20BaseQueryKeys.address(chainId, contractAddress)[0], method: 'allowance', args, }, ] as const, - allAllowances: (contractAddress: string, args?: Record) => + allAllowances: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw20BaseQueryKeys.address(contractAddress)[0], + ...cw20BaseQueryKeys.address(chainId, contractAddress)[0], method: 'all_allowances', args, }, ] as const, allSpenderAllowances: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...cw20BaseQueryKeys.address(contractAddress)[0], + ...cw20BaseQueryKeys.address(chainId, contractAddress)[0], method: 'all_spender_allowances', args, }, ] as const, - allAccounts: (contractAddress: string, args?: Record) => + allAccounts: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw20BaseQueryKeys.address(contractAddress)[0], + ...cw20BaseQueryKeys.address(chainId, contractAddress)[0], method: 'all_accounts', args, }, ] as const, - marketingInfo: (contractAddress: string, args?: Record) => + marketingInfo: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw20BaseQueryKeys.address(contractAddress)[0], + ...cw20BaseQueryKeys.address(chainId, contractAddress)[0], method: 'marketing_info', args, }, ] as const, - downloadLogo: (contractAddress: string, args?: Record) => + downloadLogo: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw20BaseQueryKeys.address(contractAddress)[0], + ...cw20BaseQueryKeys.address(chainId, contractAddress)[0], method: 'download_logo', args, }, @@ -116,7 +150,7 @@ export const cw20BaseQueries = { queryClient: QueryClient, { chainId, contractAddress, args, options }: Cw20BaseBalanceQuery ): UseQueryOptions => ({ - queryKey: cw20BaseQueryKeys.balance(contractAddress, args), + queryKey: cw20BaseQueryKeys.balance(chainId, contractAddress, args), queryFn: async () => { try { // Attempt to fetch data from the indexer @@ -148,7 +182,7 @@ export const cw20BaseQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: Cw20BaseTokenInfoQuery ): UseQueryOptions => ({ - queryKey: cw20BaseQueryKeys.tokenInfo(contractAddress), + queryKey: cw20BaseQueryKeys.tokenInfo(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer @@ -175,7 +209,7 @@ export const cw20BaseQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: Cw20BaseMinterQuery ): UseQueryOptions => ({ - queryKey: cw20BaseQueryKeys.minter(contractAddress), + queryKey: cw20BaseQueryKeys.minter(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer @@ -202,7 +236,7 @@ export const cw20BaseQueries = { queryClient: QueryClient, { chainId, contractAddress, args, options }: Cw20BaseAllowanceQuery ): UseQueryOptions => ({ - queryKey: cw20BaseQueryKeys.allowance(contractAddress, args), + queryKey: cw20BaseQueryKeys.allowance(chainId, contractAddress, args), queryFn: async () => { try { // Attempt to fetch data from the indexer @@ -238,7 +272,7 @@ export const cw20BaseQueries = { options, }: Cw20BaseAllAllowancesQuery ): UseQueryOptions => ({ - queryKey: cw20BaseQueryKeys.allAllowances(contractAddress, args), + queryKey: cw20BaseQueryKeys.allAllowances(chainId, contractAddress, args), queryFn: async () => { try { // Attempt to fetch data from the indexer @@ -278,7 +312,11 @@ export const cw20BaseQueries = { Error, TData > => ({ - queryKey: cw20BaseQueryKeys.allSpenderAllowances(contractAddress, args), + queryKey: cw20BaseQueryKeys.allSpenderAllowances( + chainId, + contractAddress, + args + ), queryFn: async () => new Cw20BaseQueryClient( await cosmWasmClientRouter.connect(chainId), @@ -294,7 +332,7 @@ export const cw20BaseQueries = { queryClient: QueryClient, { chainId, contractAddress, args, options }: Cw20BaseAllAccountsQuery ): UseQueryOptions => ({ - queryKey: cw20BaseQueryKeys.allAccounts(contractAddress, args), + queryKey: cw20BaseQueryKeys.allAccounts(chainId, contractAddress, args), queryFn: async () => { try { // Attempt to fetch data from the indexer @@ -327,7 +365,7 @@ export const cw20BaseQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: Cw20BaseMarketingInfoQuery ): UseQueryOptions => ({ - queryKey: cw20BaseQueryKeys.marketingInfo(contractAddress), + queryKey: cw20BaseQueryKeys.marketingInfo(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer @@ -359,7 +397,7 @@ export const cw20BaseQueries = { Error, TData > => ({ - queryKey: cw20BaseQueryKeys.downloadLogo(contractAddress), + queryKey: cw20BaseQueryKeys.downloadLogo(chainId, contractAddress), queryFn: async () => new Cw20BaseQueryClient( await cosmWasmClientRouter.connect(chainId), diff --git a/packages/state/query/queries/contracts/Cw3FlexMultisig.ts b/packages/state/query/queries/contracts/Cw3FlexMultisig.ts index e5eec8bbd..fbd3445f3 100644 --- a/packages/state/query/queries/contracts/Cw3FlexMultisig.ts +++ b/packages/state/query/queries/contracts/Cw3FlexMultisig.ts @@ -26,81 +26,118 @@ export const cw3FlexMultisigQueryKeys = { contract: 'cw3FlexMultisig', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...cw3FlexMultisigQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - threshold: (contractAddress: string, args?: Record) => + threshold: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw3FlexMultisigQueryKeys.address(contractAddress)[0], + ...cw3FlexMultisigQueryKeys.address(chainId, contractAddress)[0], method: 'threshold', args, }, ] as const, - proposal: (contractAddress: string, args?: Record) => + proposal: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw3FlexMultisigQueryKeys.address(contractAddress)[0], + ...cw3FlexMultisigQueryKeys.address(chainId, contractAddress)[0], method: 'proposal', args, }, ] as const, - listProposals: (contractAddress: string, args?: Record) => + listProposals: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw3FlexMultisigQueryKeys.address(contractAddress)[0], + ...cw3FlexMultisigQueryKeys.address(chainId, contractAddress)[0], method: 'list_proposals', args, }, ] as const, - reverseProposals: (contractAddress: string, args?: Record) => + reverseProposals: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw3FlexMultisigQueryKeys.address(contractAddress)[0], + ...cw3FlexMultisigQueryKeys.address(chainId, contractAddress)[0], method: 'reverse_proposals', args, }, ] as const, - getVote: (contractAddress: string, args?: Record) => + getVote: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw3FlexMultisigQueryKeys.address(contractAddress)[0], + ...cw3FlexMultisigQueryKeys.address(chainId, contractAddress)[0], method: 'vote', args, }, ] as const, - listVotes: (contractAddress: string, args?: Record) => + listVotes: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw3FlexMultisigQueryKeys.address(contractAddress)[0], + ...cw3FlexMultisigQueryKeys.address(chainId, contractAddress)[0], method: 'list_votes', args, }, ] as const, - voter: (contractAddress: string, args?: Record) => + voter: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw3FlexMultisigQueryKeys.address(contractAddress)[0], + ...cw3FlexMultisigQueryKeys.address(chainId, contractAddress)[0], method: 'voter', args, }, ] as const, - listVoters: (contractAddress: string, args?: Record) => + listVoters: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw3FlexMultisigQueryKeys.address(contractAddress)[0], + ...cw3FlexMultisigQueryKeys.address(chainId, contractAddress)[0], method: 'list_voters', args, }, ] as const, - config: (contractAddress: string, args?: Record) => + config: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw3FlexMultisigQueryKeys.address(contractAddress)[0], + ...cw3FlexMultisigQueryKeys.address(chainId, contractAddress)[0], method: 'config', args, }, @@ -116,7 +153,7 @@ export const cw3FlexMultisigQueries = { Error, TData > => ({ - queryKey: cw3FlexMultisigQueryKeys.threshold(contractAddress), + queryKey: cw3FlexMultisigQueryKeys.threshold(chainId, contractAddress), queryFn: async () => new Cw3FlexMultisigQueryClient( await getCosmWasmClientForChainId(chainId), @@ -134,7 +171,7 @@ export const cw3FlexMultisigQueries = { Error, TData > => ({ - queryKey: cw3FlexMultisigQueryKeys.proposal(contractAddress, args), + queryKey: cw3FlexMultisigQueryKeys.proposal(chainId, contractAddress, args), queryFn: async () => new Cw3FlexMultisigQueryClient( await getCosmWasmClientForChainId(chainId), @@ -154,7 +191,11 @@ export const cw3FlexMultisigQueries = { Error, TData > => ({ - queryKey: cw3FlexMultisigQueryKeys.listProposals(contractAddress, args), + queryKey: cw3FlexMultisigQueryKeys.listProposals( + chainId, + contractAddress, + args + ), queryFn: async () => new Cw3FlexMultisigQueryClient( await getCosmWasmClientForChainId(chainId), @@ -175,7 +216,11 @@ export const cw3FlexMultisigQueries = { Error, TData > => ({ - queryKey: cw3FlexMultisigQueryKeys.reverseProposals(contractAddress, args), + queryKey: cw3FlexMultisigQueryKeys.reverseProposals( + chainId, + contractAddress, + args + ), queryFn: async () => new Cw3FlexMultisigQueryClient( await getCosmWasmClientForChainId(chainId), @@ -196,7 +241,7 @@ export const cw3FlexMultisigQueries = { Error, TData > => ({ - queryKey: cw3FlexMultisigQueryKeys.getVote(contractAddress, args), + queryKey: cw3FlexMultisigQueryKeys.getVote(chainId, contractAddress, args), queryFn: async () => new Cw3FlexMultisigQueryClient( await getCosmWasmClientForChainId(chainId), @@ -217,7 +262,11 @@ export const cw3FlexMultisigQueries = { Error, TData > => ({ - queryKey: cw3FlexMultisigQueryKeys.listVotes(contractAddress, args), + queryKey: cw3FlexMultisigQueryKeys.listVotes( + chainId, + contractAddress, + args + ), queryFn: async () => new Cw3FlexMultisigQueryClient( await getCosmWasmClientForChainId(chainId), @@ -239,7 +288,7 @@ export const cw3FlexMultisigQueries = { Error, TData > => ({ - queryKey: cw3FlexMultisigQueryKeys.voter(contractAddress, args), + queryKey: cw3FlexMultisigQueryKeys.voter(chainId, contractAddress, args), queryFn: async () => new Cw3FlexMultisigQueryClient( await getCosmWasmClientForChainId(chainId), @@ -259,7 +308,11 @@ export const cw3FlexMultisigQueries = { Error, TData > => ({ - queryKey: cw3FlexMultisigQueryKeys.listVoters(contractAddress, args), + queryKey: cw3FlexMultisigQueryKeys.listVoters( + chainId, + contractAddress, + args + ), queryFn: async () => new Cw3FlexMultisigQueryClient( await getCosmWasmClientForChainId(chainId), @@ -280,7 +333,7 @@ export const cw3FlexMultisigQueries = { Error, TData > => ({ - queryKey: cw3FlexMultisigQueryKeys.listVoters(contractAddress), + queryKey: cw3FlexMultisigQueryKeys.listVoters(chainId, contractAddress), queryFn: async () => { const voters: VoterListResponse['voters'] = [] @@ -324,7 +377,7 @@ export const cw3FlexMultisigQueries = { Error, TData > => ({ - queryKey: cw3FlexMultisigQueryKeys.config(contractAddress), + queryKey: cw3FlexMultisigQueryKeys.config(chainId, contractAddress), queryFn: async () => new Cw3FlexMultisigQueryClient( await getCosmWasmClientForChainId(chainId), diff --git a/packages/state/query/queries/contracts/Cw721Base.ts b/packages/state/query/queries/contracts/Cw721Base.ts index dd5aed14b..cd972ef46 100644 --- a/packages/state/query/queries/contracts/Cw721Base.ts +++ b/packages/state/query/queries/contracts/Cw721Base.ts @@ -37,121 +37,178 @@ export const cw721BaseQueryKeys = { contract: 'cw721Base', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...cw721BaseQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - ownerOf: (contractAddress: string, args?: Record) => + ownerOf: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw721BaseQueryKeys.address(contractAddress)[0], + ...cw721BaseQueryKeys.address(chainId, contractAddress)[0], method: 'owner_of', args, }, ] as const, - approval: (contractAddress: string, args?: Record) => + approval: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw721BaseQueryKeys.address(contractAddress)[0], + ...cw721BaseQueryKeys.address(chainId, contractAddress)[0], method: 'approval', args, }, ] as const, - approvals: (contractAddress: string, args?: Record) => + approvals: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw721BaseQueryKeys.address(contractAddress)[0], + ...cw721BaseQueryKeys.address(chainId, contractAddress)[0], method: 'approvals', args, }, ] as const, - operator: (contractAddress: string, args?: Record) => + operator: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw721BaseQueryKeys.address(contractAddress)[0], + ...cw721BaseQueryKeys.address(chainId, contractAddress)[0], method: 'operator', args, }, ] as const, - allOperators: (contractAddress: string, args?: Record) => + allOperators: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw721BaseQueryKeys.address(contractAddress)[0], + ...cw721BaseQueryKeys.address(chainId, contractAddress)[0], method: 'all_operators', args, }, ] as const, - numTokens: (contractAddress: string, args?: Record) => + numTokens: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw721BaseQueryKeys.address(contractAddress)[0], + ...cw721BaseQueryKeys.address(chainId, contractAddress)[0], method: 'num_tokens', args, }, ] as const, - contractInfo: (contractAddress: string, args?: Record) => + contractInfo: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw721BaseQueryKeys.address(contractAddress)[0], + ...cw721BaseQueryKeys.address(chainId, contractAddress)[0], method: 'contract_info', args, }, ] as const, - nftInfo: (contractAddress: string, args?: Record) => + nftInfo: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw721BaseQueryKeys.address(contractAddress)[0], + ...cw721BaseQueryKeys.address(chainId, contractAddress)[0], method: 'nft_info', args, }, ] as const, - allNftInfo: (contractAddress: string, args?: Record) => + allNftInfo: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw721BaseQueryKeys.address(contractAddress)[0], + ...cw721BaseQueryKeys.address(chainId, contractAddress)[0], method: 'all_nft_info', args, }, ] as const, - tokens: (contractAddress: string, args?: Record) => + tokens: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw721BaseQueryKeys.address(contractAddress)[0], + ...cw721BaseQueryKeys.address(chainId, contractAddress)[0], method: 'tokens', args, }, ] as const, - allTokens: (contractAddress: string, args?: Record) => + allTokens: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw721BaseQueryKeys.address(contractAddress)[0], + ...cw721BaseQueryKeys.address(chainId, contractAddress)[0], method: 'all_tokens', args, }, ] as const, - minter: (contractAddress: string, args?: Record) => + minter: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw721BaseQueryKeys.address(contractAddress)[0], + ...cw721BaseQueryKeys.address(chainId, contractAddress)[0], method: 'minter', args, }, ] as const, - extension: (contractAddress: string, args?: Record) => + extension: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw721BaseQueryKeys.address(contractAddress)[0], + ...cw721BaseQueryKeys.address(chainId, contractAddress)[0], method: 'extension', args, }, ] as const, - ownership: (contractAddress: string, args?: Record) => + ownership: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cw721BaseQueryKeys.address(contractAddress)[0], + ...cw721BaseQueryKeys.address(chainId, contractAddress)[0], method: 'ownership', args, }, @@ -168,7 +225,7 @@ export const cw721BaseQueries = { Error, TData > => ({ - queryKey: cw721BaseQueryKeys.ownerOf(contractAddress, args), + queryKey: cw721BaseQueryKeys.ownerOf(chainId, contractAddress, args), queryFn: async () => { return new Cw721BaseQueryClient( await getCosmWasmClientForChainId(chainId), @@ -190,7 +247,7 @@ export const cw721BaseQueries = { Error, TData > => ({ - queryKey: cw721BaseQueryKeys.approval(contractAddress, args), + queryKey: cw721BaseQueryKeys.approval(chainId, contractAddress, args), queryFn: async () => { return new Cw721BaseQueryClient( await getCosmWasmClientForChainId(chainId), @@ -213,7 +270,7 @@ export const cw721BaseQueries = { Error, TData > => ({ - queryKey: cw721BaseQueryKeys.approvals(contractAddress, args), + queryKey: cw721BaseQueryKeys.approvals(chainId, contractAddress, args), queryFn: async () => { return new Cw721BaseQueryClient( await getCosmWasmClientForChainId(chainId), @@ -235,7 +292,7 @@ export const cw721BaseQueries = { Error, TData > => ({ - queryKey: cw721BaseQueryKeys.operator(contractAddress, args), + queryKey: cw721BaseQueryKeys.operator(chainId, contractAddress, args), queryFn: async () => { return new Cw721BaseQueryClient( await getCosmWasmClientForChainId(chainId), @@ -258,7 +315,7 @@ export const cw721BaseQueries = { Error, TData > => ({ - queryKey: cw721BaseQueryKeys.allOperators(contractAddress, args), + queryKey: cw721BaseQueryKeys.allOperators(chainId, contractAddress, args), queryFn: async () => { return new Cw721BaseQueryClient( await getCosmWasmClientForChainId(chainId), @@ -281,7 +338,7 @@ export const cw721BaseQueries = { Error, TData > => ({ - queryKey: cw721BaseQueryKeys.numTokens(contractAddress), + queryKey: cw721BaseQueryKeys.numTokens(chainId, contractAddress), queryFn: async () => { return new Cw721BaseQueryClient( await getCosmWasmClientForChainId(chainId), @@ -299,7 +356,7 @@ export const cw721BaseQueries = { Error, TData > => ({ - queryKey: cw721BaseQueryKeys.contractInfo(contractAddress), + queryKey: cw721BaseQueryKeys.contractInfo(chainId, contractAddress), queryFn: async () => { return new Cw721BaseQueryClient( await getCosmWasmClientForChainId(chainId), @@ -318,7 +375,7 @@ export const cw721BaseQueries = { Error, TData > => ({ - queryKey: cw721BaseQueryKeys.nftInfo(contractAddress, args), + queryKey: cw721BaseQueryKeys.nftInfo(chainId, contractAddress, args), queryFn: async () => { return new Cw721BaseQueryClient( await getCosmWasmClientForChainId(chainId), @@ -339,7 +396,7 @@ export const cw721BaseQueries = { Error, TData > => ({ - queryKey: cw721BaseQueryKeys.allNftInfo(contractAddress, args), + queryKey: cw721BaseQueryKeys.allNftInfo(chainId, contractAddress, args), queryFn: async () => { return new Cw721BaseQueryClient( await getCosmWasmClientForChainId(chainId), @@ -361,7 +418,7 @@ export const cw721BaseQueries = { Error, TData > => ({ - queryKey: cw721BaseQueryKeys.tokens(contractAddress, args), + queryKey: cw721BaseQueryKeys.tokens(chainId, contractAddress, args), queryFn: async () => { return new Cw721BaseQueryClient( await getCosmWasmClientForChainId(chainId), @@ -384,7 +441,7 @@ export const cw721BaseQueries = { Error, TData > => ({ - queryKey: cw721BaseQueryKeys.allTokens(contractAddress, args), + queryKey: cw721BaseQueryKeys.allTokens(chainId, contractAddress, args), queryFn: async () => { return new Cw721BaseQueryClient( await getCosmWasmClientForChainId(chainId), @@ -405,7 +462,7 @@ export const cw721BaseQueries = { Error, TData > => ({ - queryKey: cw721BaseQueryKeys.minter(contractAddress), + queryKey: cw721BaseQueryKeys.minter(chainId, contractAddress), queryFn: async () => { return new Cw721BaseQueryClient( await getCosmWasmClientForChainId(chainId), @@ -420,7 +477,7 @@ export const cw721BaseQueries = { args, options, }: Cw721BaseExtensionQuery): UseQueryOptions => ({ - queryKey: cw721BaseQueryKeys.extension(contractAddress, args), + queryKey: cw721BaseQueryKeys.extension(chainId, contractAddress, args), queryFn: async () => { return new Cw721BaseQueryClient( await getCosmWasmClientForChainId(chainId), @@ -440,7 +497,7 @@ export const cw721BaseQueries = { Error, TData > => ({ - queryKey: cw721BaseQueryKeys.ownership(contractAddress), + queryKey: cw721BaseQueryKeys.ownership(chainId, contractAddress), queryFn: async () => { return new Cw721BaseQueryClient( await getCosmWasmClientForChainId(chainId), diff --git a/packages/state/query/queries/contracts/CwProposalSingle.v1.ts b/packages/state/query/queries/contracts/CwProposalSingle.v1.ts index 1eab95b09..261497fa2 100644 --- a/packages/state/query/queries/contracts/CwProposalSingle.v1.ts +++ b/packages/state/query/queries/contracts/CwProposalSingle.v1.ts @@ -30,89 +30,130 @@ export const cwProposalSingleV1QueryKeys = { contract: 'cwProposalSingleV1', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...cwProposalSingleV1QueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - config: (contractAddress: string, args?: Record) => + config: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cwProposalSingleV1QueryKeys.address(contractAddress)[0], + ...cwProposalSingleV1QueryKeys.address(chainId, contractAddress)[0], method: 'config', args, }, ] as const, - proposal: (contractAddress: string, args?: Record) => + proposal: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cwProposalSingleV1QueryKeys.address(contractAddress)[0], + ...cwProposalSingleV1QueryKeys.address(chainId, contractAddress)[0], method: 'proposal', args, }, ] as const, - listProposals: (contractAddress: string, args?: Record) => + listProposals: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cwProposalSingleV1QueryKeys.address(contractAddress)[0], + ...cwProposalSingleV1QueryKeys.address(chainId, contractAddress)[0], method: 'list_proposals', args, }, ] as const, - reverseProposals: (contractAddress: string, args?: Record) => + reverseProposals: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cwProposalSingleV1QueryKeys.address(contractAddress)[0], + ...cwProposalSingleV1QueryKeys.address(chainId, contractAddress)[0], method: 'reverse_proposals', args, }, ] as const, - proposalCount: (contractAddress: string, args?: Record) => + proposalCount: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cwProposalSingleV1QueryKeys.address(contractAddress)[0], + ...cwProposalSingleV1QueryKeys.address(chainId, contractAddress)[0], method: 'proposal_count', args, }, ] as const, - vote: (contractAddress: string, args?: Record) => + vote: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cwProposalSingleV1QueryKeys.address(contractAddress)[0], + ...cwProposalSingleV1QueryKeys.address(chainId, contractAddress)[0], method: 'vote', args, }, ] as const, - listVotes: (contractAddress: string, args?: Record) => + listVotes: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cwProposalSingleV1QueryKeys.address(contractAddress)[0], + ...cwProposalSingleV1QueryKeys.address(chainId, contractAddress)[0], method: 'list_votes', args, }, ] as const, - proposalHooks: (contractAddress: string, args?: Record) => + proposalHooks: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cwProposalSingleV1QueryKeys.address(contractAddress)[0], + ...cwProposalSingleV1QueryKeys.address(chainId, contractAddress)[0], method: 'proposal_hooks', args, }, ] as const, - voteHooks: (contractAddress: string, args?: Record) => + voteHooks: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cwProposalSingleV1QueryKeys.address(contractAddress)[0], + ...cwProposalSingleV1QueryKeys.address(chainId, contractAddress)[0], method: 'vote_hooks', args, }, ] as const, - info: (contractAddress: string, args?: Record) => + info: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...cwProposalSingleV1QueryKeys.address(contractAddress)[0], + ...cwProposalSingleV1QueryKeys.address(chainId, contractAddress)[0], method: 'info', args, }, @@ -123,7 +164,7 @@ export const cwProposalSingleV1Queries = { queryClient: QueryClient, { chainId, contractAddress, options }: CwProposalSingleV1ConfigQuery ): UseQueryOptions => ({ - queryKey: cwProposalSingleV1QueryKeys.config(contractAddress), + queryKey: cwProposalSingleV1QueryKeys.config(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -155,7 +196,11 @@ export const cwProposalSingleV1Queries = { options, }: CwProposalSingleV1ProposalQuery ): UseQueryOptions => ({ - queryKey: cwProposalSingleV1QueryKeys.proposal(contractAddress, args), + queryKey: cwProposalSingleV1QueryKeys.proposal( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -190,7 +235,11 @@ export const cwProposalSingleV1Queries = { options, }: CwProposalSingleV1ListProposalsQuery ): UseQueryOptions => ({ - queryKey: cwProposalSingleV1QueryKeys.listProposals(contractAddress, args), + queryKey: cwProposalSingleV1QueryKeys.listProposals( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -229,6 +278,7 @@ export const cwProposalSingleV1Queries = { }: CwProposalSingleV1ReverseProposalsQuery ): UseQueryOptions => ({ queryKey: cwProposalSingleV1QueryKeys.reverseProposals( + chainId, contractAddress, args ), @@ -268,7 +318,10 @@ export const cwProposalSingleV1Queries = { options, }: CwProposalSingleV1ProposalCountQuery ): UseQueryOptions => ({ - queryKey: cwProposalSingleV1QueryKeys.proposalCount(contractAddress), + queryKey: cwProposalSingleV1QueryKeys.proposalCount( + chainId, + contractAddress + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -305,7 +358,7 @@ export const cwProposalSingleV1Queries = { options, }: CwProposalSingleV1VoteQuery ): UseQueryOptions => ({ - queryKey: cwProposalSingleV1QueryKeys.vote(contractAddress, args), + queryKey: cwProposalSingleV1QueryKeys.vote(chainId, contractAddress, args), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -343,7 +396,11 @@ export const cwProposalSingleV1Queries = { options, }: CwProposalSingleV1ListVotesQuery ): UseQueryOptions => ({ - queryKey: cwProposalSingleV1QueryKeys.listVotes(contractAddress, args), + queryKey: cwProposalSingleV1QueryKeys.listVotes( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -382,7 +439,10 @@ export const cwProposalSingleV1Queries = { Error, TData > => ({ - queryKey: cwProposalSingleV1QueryKeys.proposalHooks(contractAddress), + queryKey: cwProposalSingleV1QueryKeys.proposalHooks( + chainId, + contractAddress + ), queryFn: async () => new CwProposalSingleV1QueryClient( await getCosmWasmClientForChainId(chainId), @@ -399,7 +459,7 @@ export const cwProposalSingleV1Queries = { Error, TData > => ({ - queryKey: cwProposalSingleV1QueryKeys.voteHooks(contractAddress), + queryKey: cwProposalSingleV1QueryKeys.voteHooks(chainId, contractAddress), queryFn: async () => new CwProposalSingleV1QueryClient( await getCosmWasmClientForChainId(chainId), diff --git a/packages/state/query/queries/contracts/DaoDaoCore.ts b/packages/state/query/queries/contracts/DaoDaoCore.ts index ec9e5410a..c5751b22a 100644 --- a/packages/state/query/queries/contracts/DaoDaoCore.ts +++ b/packages/state/query/queries/contracts/DaoDaoCore.ts @@ -37,181 +37,250 @@ export const daoDaoCoreQueryKeys = { contract: 'daoDaoCore', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...daoDaoCoreQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - admin: (contractAddress: string, args?: Record) => + admin: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoDaoCoreQueryKeys.address(contractAddress)[0], + ...daoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'admin', args, }, ] as const, - adminNomination: (contractAddress: string, args?: Record) => + adminNomination: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoDaoCoreQueryKeys.address(contractAddress)[0], + ...daoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'admin_nomination', args, }, ] as const, - config: (contractAddress: string, args?: Record) => + config: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoDaoCoreQueryKeys.address(contractAddress)[0], + ...daoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'config', args, }, ] as const, - cw20Balances: (contractAddress: string, args?: Record) => + cw20Balances: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoDaoCoreQueryKeys.address(contractAddress)[0], + ...daoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'cw20_balances', args, }, ] as const, - cw20TokenList: (contractAddress: string, args?: Record) => + cw20TokenList: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoDaoCoreQueryKeys.address(contractAddress)[0], + ...daoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'cw20_token_list', args, }, ] as const, - cw721TokenList: (contractAddress: string, args?: Record) => + cw721TokenList: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoDaoCoreQueryKeys.address(contractAddress)[0], + ...daoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'cw721_token_list', args, }, ] as const, - dumpState: (contractAddress: string, args?: Record) => + dumpState: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoDaoCoreQueryKeys.address(contractAddress)[0], + ...daoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'dump_state', args, }, ] as const, - getItem: (contractAddress: string, args?: Record) => + getItem: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoDaoCoreQueryKeys.address(contractAddress)[0], + ...daoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'get_item', args, }, ] as const, - listItems: (contractAddress: string, args?: Record) => + listItems: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoDaoCoreQueryKeys.address(contractAddress)[0], + ...daoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'list_items', args, }, ] as const, - listAllItems: (contractAddress: string, args?: Record) => + listAllItems: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoDaoCoreQueryKeys.address(contractAddress)[0], + ...daoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'list_all_items', args, }, ] as const, - info: (contractAddress: string, args?: Record) => + info: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoDaoCoreQueryKeys.address(contractAddress)[0], + ...daoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'info', args, }, ] as const, - proposalModules: (contractAddress: string, args?: Record) => + proposalModules: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoDaoCoreQueryKeys.address(contractAddress)[0], + ...daoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'proposal_modules', args, }, ] as const, activeProposalModules: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...daoDaoCoreQueryKeys.address(contractAddress)[0], + ...daoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'active_proposal_modules', args, }, ] as const, proposalModuleCount: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...daoDaoCoreQueryKeys.address(contractAddress)[0], + ...daoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'proposal_module_count', args, }, ] as const, - pauseInfo: (contractAddress: string, args?: Record) => + pauseInfo: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoDaoCoreQueryKeys.address(contractAddress)[0], + ...daoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'pause_info', args, }, ] as const, - votingModule: (contractAddress: string, args?: Record) => + votingModule: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoDaoCoreQueryKeys.address(contractAddress)[0], + ...daoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'voting_module', args, }, ] as const, - listSubDaos: (contractAddress: string, args?: Record) => + listSubDaos: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoDaoCoreQueryKeys.address(contractAddress)[0], + ...daoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'list_sub_daos', args, }, ] as const, - daoURI: (contractAddress: string, args?: Record) => + daoURI: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoDaoCoreQueryKeys.address(contractAddress)[0], + ...daoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'dao_u_r_i', args, }, ] as const, votingPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...daoDaoCoreQueryKeys.address(contractAddress)[0], + ...daoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'voting_power_at_height', args, }, ] as const, totalPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...daoDaoCoreQueryKeys.address(contractAddress)[0], + ...daoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'total_power_at_height', args, }, @@ -222,7 +291,7 @@ export const daoDaoCoreQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoDaoCoreAdminQuery ): UseQueryOptions => ({ - queryKey: daoDaoCoreQueryKeys.admin(contractAddress), + queryKey: daoDaoCoreQueryKeys.admin(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -249,7 +318,7 @@ export const daoDaoCoreQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoDaoCoreAdminNominationQuery ): UseQueryOptions => ({ - queryKey: daoDaoCoreQueryKeys.adminNomination(contractAddress), + queryKey: daoDaoCoreQueryKeys.adminNomination(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -278,7 +347,7 @@ export const daoDaoCoreQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoDaoCoreConfigQuery ): UseQueryOptions => ({ - queryKey: daoDaoCoreQueryKeys.config(contractAddress), + queryKey: daoDaoCoreQueryKeys.config(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -311,7 +380,7 @@ export const daoDaoCoreQueries = { Error, TData > => ({ - queryKey: daoDaoCoreQueryKeys.cw20Balances(contractAddress, args), + queryKey: daoDaoCoreQueryKeys.cw20Balances(chainId, contractAddress, args), queryFn: async () => { return new DaoDaoCoreQueryClient( await getCosmWasmClientForChainId(chainId), @@ -333,7 +402,7 @@ export const daoDaoCoreQueries = { Error, TData > => ({ - queryKey: daoDaoCoreQueryKeys.cw20TokenList(contractAddress, args), + queryKey: daoDaoCoreQueryKeys.cw20TokenList(chainId, contractAddress, args), queryFn: async () => { return new DaoDaoCoreQueryClient( await getCosmWasmClientForChainId(chainId), @@ -355,7 +424,11 @@ export const daoDaoCoreQueries = { Error, TData > => ({ - queryKey: daoDaoCoreQueryKeys.cw721TokenList(contractAddress, args), + queryKey: daoDaoCoreQueryKeys.cw721TokenList( + chainId, + contractAddress, + args + ), queryFn: async () => { return new DaoDaoCoreQueryClient( await getCosmWasmClientForChainId(chainId), @@ -371,7 +444,7 @@ export const daoDaoCoreQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoDaoCoreDumpStateQuery ): UseQueryOptions => ({ - queryKey: daoDaoCoreQueryKeys.dumpState(contractAddress), + queryKey: daoDaoCoreQueryKeys.dumpState(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -401,7 +474,7 @@ export const daoDaoCoreQueries = { queryClient: QueryClient, { chainId, contractAddress, args, options }: DaoDaoCoreGetItemQuery ): UseQueryOptions => ({ - queryKey: daoDaoCoreQueryKeys.getItem(contractAddress, args), + queryKey: daoDaoCoreQueryKeys.getItem(chainId, contractAddress, args), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -440,7 +513,7 @@ export const daoDaoCoreQueries = { Error, TData > => ({ - queryKey: daoDaoCoreQueryKeys.listItems(contractAddress, args), + queryKey: daoDaoCoreQueryKeys.listItems(chainId, contractAddress, args), queryFn: async () => { return new DaoDaoCoreQueryClient( await getCosmWasmClientForChainId(chainId), @@ -461,7 +534,7 @@ export const daoDaoCoreQueries = { options, }: DaoDaoCoreListAllItemsQuery ): UseQueryOptions => ({ - queryKey: daoDaoCoreQueryKeys.listAllItems(contractAddress, args), + queryKey: daoDaoCoreQueryKeys.listAllItems(chainId, contractAddress, args), queryFn: async () => { let items: ListItemsResponse | undefined @@ -534,7 +607,11 @@ export const daoDaoCoreQueries = { options, }: DaoDaoCoreProposalModulesQuery ): UseQueryOptions => ({ - queryKey: daoDaoCoreQueryKeys.proposalModules(contractAddress, args), + queryKey: daoDaoCoreQueryKeys.proposalModules( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -570,7 +647,11 @@ export const daoDaoCoreQueries = { options, }: DaoDaoCoreActiveProposalModulesQuery ): UseQueryOptions => ({ - queryKey: daoDaoCoreQueryKeys.activeProposalModules(contractAddress, args), + queryKey: daoDaoCoreQueryKeys.activeProposalModules( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -606,7 +687,7 @@ export const daoDaoCoreQueries = { Error, TData > => ({ - queryKey: daoDaoCoreQueryKeys.proposalModuleCount(contractAddress), + queryKey: daoDaoCoreQueryKeys.proposalModuleCount(chainId, contractAddress), queryFn: async () => { return new DaoDaoCoreQueryClient( await getCosmWasmClientForChainId(chainId), @@ -619,7 +700,7 @@ export const daoDaoCoreQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoDaoCorePauseInfoQuery ): UseQueryOptions => ({ - queryKey: daoDaoCoreQueryKeys.pauseInfo(contractAddress), + queryKey: daoDaoCoreQueryKeys.pauseInfo(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -646,7 +727,7 @@ export const daoDaoCoreQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoDaoCoreVotingModuleQuery ): UseQueryOptions => ({ - queryKey: daoDaoCoreQueryKeys.votingModule(contractAddress), + queryKey: daoDaoCoreQueryKeys.votingModule(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -679,7 +760,7 @@ export const daoDaoCoreQueries = { Error, TData > => ({ - queryKey: daoDaoCoreQueryKeys.listSubDaos(contractAddress, args), + queryKey: daoDaoCoreQueryKeys.listSubDaos(chainId, contractAddress, args), queryFn: async () => { return new DaoDaoCoreQueryClient( await getCosmWasmClientForChainId(chainId), @@ -695,7 +776,7 @@ export const daoDaoCoreQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoDaoCoreDaoURIQuery ): UseQueryOptions => ({ - queryKey: daoDaoCoreQueryKeys.daoURI(contractAddress), + queryKey: daoDaoCoreQueryKeys.daoURI(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -727,7 +808,11 @@ export const daoDaoCoreQueries = { options, }: DaoDaoCoreVotingPowerAtHeightQuery ): UseQueryOptions => ({ - queryKey: daoDaoCoreQueryKeys.votingPowerAtHeight(contractAddress, args), + queryKey: daoDaoCoreQueryKeys.votingPowerAtHeight( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -766,7 +851,11 @@ export const daoDaoCoreQueries = { options, }: DaoDaoCoreTotalPowerAtHeightQuery ): UseQueryOptions => ({ - queryKey: daoDaoCoreQueryKeys.totalPowerAtHeight(contractAddress, args), + queryKey: daoDaoCoreQueryKeys.totalPowerAtHeight( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. diff --git a/packages/state/query/queries/contracts/DaoPreProposeMultiple.ts b/packages/state/query/queries/contracts/DaoPreProposeMultiple.ts index 75a87fa5e..459e1ce8b 100644 --- a/packages/state/query/queries/contracts/DaoPreProposeMultiple.ts +++ b/packages/state/query/queries/contracts/DaoPreProposeMultiple.ts @@ -27,68 +27,94 @@ export const daoPreProposeMultipleQueryKeys = { contract: 'daoPreProposeMultiple', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...daoPreProposeMultipleQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - proposalModule: (contractAddress: string, args?: Record) => + proposalModule: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoPreProposeMultipleQueryKeys.address(contractAddress)[0], + ...daoPreProposeMultipleQueryKeys.address(chainId, contractAddress)[0], method: 'proposal_module', args, }, ] as const, - dao: (contractAddress: string, args?: Record) => + dao: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoPreProposeMultipleQueryKeys.address(contractAddress)[0], + ...daoPreProposeMultipleQueryKeys.address(chainId, contractAddress)[0], method: 'dao', args, }, ] as const, - config: (contractAddress: string, args?: Record) => + config: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoPreProposeMultipleQueryKeys.address(contractAddress)[0], + ...daoPreProposeMultipleQueryKeys.address(chainId, contractAddress)[0], method: 'config', args, }, ] as const, - depositInfo: (contractAddress: string, args?: Record) => + depositInfo: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoPreProposeMultipleQueryKeys.address(contractAddress)[0], + ...daoPreProposeMultipleQueryKeys.address(chainId, contractAddress)[0], method: 'deposit_info', args, }, ] as const, - canPropose: (contractAddress: string, args?: Record) => + canPropose: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoPreProposeMultipleQueryKeys.address(contractAddress)[0], + ...daoPreProposeMultipleQueryKeys.address(chainId, contractAddress)[0], method: 'can_propose', args, }, ] as const, proposalSubmittedHooks: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...daoPreProposeMultipleQueryKeys.address(contractAddress)[0], + ...daoPreProposeMultipleQueryKeys.address(chainId, contractAddress)[0], method: 'proposal_submitted_hooks', args, }, ] as const, - queryExtension: (contractAddress: string, args?: Record) => + queryExtension: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoPreProposeMultipleQueryKeys.address(contractAddress)[0], + ...daoPreProposeMultipleQueryKeys.address(chainId, contractAddress)[0], method: 'query_extension', args, }, @@ -103,7 +129,10 @@ export const daoPreProposeMultipleQueries = { options, }: DaoPreProposeMultipleProposalModuleQuery ): UseQueryOptions => ({ - queryKey: daoPreProposeMultipleQueryKeys.proposalModule(contractAddress), + queryKey: daoPreProposeMultipleQueryKeys.proposalModule( + chainId, + contractAddress + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -130,7 +159,7 @@ export const daoPreProposeMultipleQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoPreProposeMultipleDaoQuery ): UseQueryOptions => ({ - queryKey: daoPreProposeMultipleQueryKeys.dao(contractAddress), + queryKey: daoPreProposeMultipleQueryKeys.dao(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -161,7 +190,7 @@ export const daoPreProposeMultipleQueries = { options, }: DaoPreProposeMultipleConfigQuery ): UseQueryOptions => ({ - queryKey: daoPreProposeMultipleQueryKeys.config(contractAddress), + queryKey: daoPreProposeMultipleQueryKeys.config(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -193,7 +222,11 @@ export const daoPreProposeMultipleQueries = { options, }: DaoPreProposeMultipleDepositInfoQuery ): UseQueryOptions => ({ - queryKey: daoPreProposeMultipleQueryKeys.depositInfo(contractAddress, args), + queryKey: daoPreProposeMultipleQueryKeys.depositInfo( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -229,7 +262,11 @@ export const daoPreProposeMultipleQueries = { Error, TData > => ({ - queryKey: daoPreProposeMultipleQueryKeys.canPropose(contractAddress, args), + queryKey: daoPreProposeMultipleQueryKeys.canPropose( + chainId, + contractAddress, + args + ), queryFn: async () => { return new DaoPreProposeMultipleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -249,8 +286,10 @@ export const daoPreProposeMultipleQueries = { Error, TData > => ({ - queryKey: - daoPreProposeMultipleQueryKeys.proposalSubmittedHooks(contractAddress), + queryKey: daoPreProposeMultipleQueryKeys.proposalSubmittedHooks( + chainId, + contractAddress + ), queryFn: async () => { return new DaoPreProposeMultipleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -270,6 +309,7 @@ export const daoPreProposeMultipleQueries = { TData > => ({ queryKey: daoPreProposeMultipleQueryKeys.queryExtension( + chainId, contractAddress, args ), diff --git a/packages/state/query/queries/contracts/DaoPreProposeSingle.ts b/packages/state/query/queries/contracts/DaoPreProposeSingle.ts index 44d309197..0f16943b8 100644 --- a/packages/state/query/queries/contracts/DaoPreProposeSingle.ts +++ b/packages/state/query/queries/contracts/DaoPreProposeSingle.ts @@ -27,68 +27,94 @@ export const daoPreProposeSingleQueryKeys = { contract: 'daoPreProposeSingle', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...daoPreProposeSingleQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - proposalModule: (contractAddress: string, args?: Record) => + proposalModule: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoPreProposeSingleQueryKeys.address(contractAddress)[0], + ...daoPreProposeSingleQueryKeys.address(chainId, contractAddress)[0], method: 'proposal_module', args, }, ] as const, - dao: (contractAddress: string, args?: Record) => + dao: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoPreProposeSingleQueryKeys.address(contractAddress)[0], + ...daoPreProposeSingleQueryKeys.address(chainId, contractAddress)[0], method: 'dao', args, }, ] as const, - config: (contractAddress: string, args?: Record) => + config: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoPreProposeSingleQueryKeys.address(contractAddress)[0], + ...daoPreProposeSingleQueryKeys.address(chainId, contractAddress)[0], method: 'config', args, }, ] as const, - depositInfo: (contractAddress: string, args?: Record) => + depositInfo: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoPreProposeSingleQueryKeys.address(contractAddress)[0], + ...daoPreProposeSingleQueryKeys.address(chainId, contractAddress)[0], method: 'deposit_info', args, }, ] as const, - canPropose: (contractAddress: string, args?: Record) => + canPropose: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoPreProposeSingleQueryKeys.address(contractAddress)[0], + ...daoPreProposeSingleQueryKeys.address(chainId, contractAddress)[0], method: 'can_propose', args, }, ] as const, proposalSubmittedHooks: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...daoPreProposeSingleQueryKeys.address(contractAddress)[0], + ...daoPreProposeSingleQueryKeys.address(chainId, contractAddress)[0], method: 'proposal_submitted_hooks', args, }, ] as const, - queryExtension: (contractAddress: string, args?: Record) => + queryExtension: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoPreProposeSingleQueryKeys.address(contractAddress)[0], + ...daoPreProposeSingleQueryKeys.address(chainId, contractAddress)[0], method: 'query_extension', args, }, @@ -103,7 +129,10 @@ export const daoPreProposeSingleQueries = { options, }: DaoPreProposeSingleProposalModuleQuery ): UseQueryOptions => ({ - queryKey: daoPreProposeSingleQueryKeys.proposalModule(contractAddress), + queryKey: daoPreProposeSingleQueryKeys.proposalModule( + chainId, + contractAddress + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -130,7 +159,7 @@ export const daoPreProposeSingleQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoPreProposeSingleDaoQuery ): UseQueryOptions => ({ - queryKey: daoPreProposeSingleQueryKeys.dao(contractAddress), + queryKey: daoPreProposeSingleQueryKeys.dao(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -157,7 +186,7 @@ export const daoPreProposeSingleQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoPreProposeSingleConfigQuery ): UseQueryOptions => ({ - queryKey: daoPreProposeSingleQueryKeys.config(contractAddress), + queryKey: daoPreProposeSingleQueryKeys.config(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -189,7 +218,11 @@ export const daoPreProposeSingleQueries = { options, }: DaoPreProposeSingleDepositInfoQuery ): UseQueryOptions => ({ - queryKey: daoPreProposeSingleQueryKeys.depositInfo(contractAddress, args), + queryKey: daoPreProposeSingleQueryKeys.depositInfo( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -225,7 +258,11 @@ export const daoPreProposeSingleQueries = { Error, TData > => ({ - queryKey: daoPreProposeSingleQueryKeys.canPropose(contractAddress, args), + queryKey: daoPreProposeSingleQueryKeys.canPropose( + chainId, + contractAddress, + args + ), queryFn: async () => { return new DaoPreProposeSingleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -245,8 +282,10 @@ export const daoPreProposeSingleQueries = { Error, TData > => ({ - queryKey: - daoPreProposeSingleQueryKeys.proposalSubmittedHooks(contractAddress), + queryKey: daoPreProposeSingleQueryKeys.proposalSubmittedHooks( + chainId, + contractAddress + ), queryFn: async () => { return new DaoPreProposeSingleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -266,6 +305,7 @@ export const daoPreProposeSingleQueries = { TData > => ({ queryKey: daoPreProposeSingleQueryKeys.queryExtension( + chainId, contractAddress, args ), diff --git a/packages/state/query/queries/contracts/DaoProposalMultiple.ts b/packages/state/query/queries/contracts/DaoProposalMultiple.ts index 760174fb1..9e316612d 100644 --- a/packages/state/query/queries/contracts/DaoProposalMultiple.ts +++ b/packages/state/query/queries/contracts/DaoProposalMultiple.ts @@ -29,116 +29,166 @@ export const daoProposalMultipleQueryKeys = { contract: 'daoProposalMultiple', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...daoProposalMultipleQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - config: (contractAddress: string, args?: Record) => + config: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalMultipleQueryKeys.address(contractAddress)[0], + ...daoProposalMultipleQueryKeys.address(chainId, contractAddress)[0], method: 'config', args, }, ] as const, - proposal: (contractAddress: string, args?: Record) => + proposal: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalMultipleQueryKeys.address(contractAddress)[0], + ...daoProposalMultipleQueryKeys.address(chainId, contractAddress)[0], method: 'proposal', args, }, ] as const, - listProposals: (contractAddress: string, args?: Record) => + listProposals: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalMultipleQueryKeys.address(contractAddress)[0], + ...daoProposalMultipleQueryKeys.address(chainId, contractAddress)[0], method: 'list_proposals', args, }, ] as const, - reverseProposals: (contractAddress: string, args?: Record) => + reverseProposals: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalMultipleQueryKeys.address(contractAddress)[0], + ...daoProposalMultipleQueryKeys.address(chainId, contractAddress)[0], method: 'reverse_proposals', args, }, ] as const, - getVote: (contractAddress: string, args?: Record) => + getVote: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalMultipleQueryKeys.address(contractAddress)[0], + ...daoProposalMultipleQueryKeys.address(chainId, contractAddress)[0], method: 'get_vote', args, }, ] as const, - listVotes: (contractAddress: string, args?: Record) => + listVotes: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalMultipleQueryKeys.address(contractAddress)[0], + ...daoProposalMultipleQueryKeys.address(chainId, contractAddress)[0], method: 'list_votes', args, }, ] as const, - proposalCount: (contractAddress: string, args?: Record) => + proposalCount: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalMultipleQueryKeys.address(contractAddress)[0], + ...daoProposalMultipleQueryKeys.address(chainId, contractAddress)[0], method: 'proposal_count', args, }, ] as const, proposalCreationPolicy: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...daoProposalMultipleQueryKeys.address(contractAddress)[0], + ...daoProposalMultipleQueryKeys.address(chainId, contractAddress)[0], method: 'proposal_creation_policy', args, }, ] as const, - proposalHooks: (contractAddress: string, args?: Record) => + proposalHooks: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalMultipleQueryKeys.address(contractAddress)[0], + ...daoProposalMultipleQueryKeys.address(chainId, contractAddress)[0], method: 'proposal_hooks', args, }, ] as const, - voteHooks: (contractAddress: string, args?: Record) => + voteHooks: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalMultipleQueryKeys.address(contractAddress)[0], + ...daoProposalMultipleQueryKeys.address(chainId, contractAddress)[0], method: 'vote_hooks', args, }, ] as const, - dao: (contractAddress: string, args?: Record) => + dao: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalMultipleQueryKeys.address(contractAddress)[0], + ...daoProposalMultipleQueryKeys.address(chainId, contractAddress)[0], method: 'dao', args, }, ] as const, - info: (contractAddress: string, args?: Record) => + info: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalMultipleQueryKeys.address(contractAddress)[0], + ...daoProposalMultipleQueryKeys.address(chainId, contractAddress)[0], method: 'info', args, }, ] as const, - nextProposalId: (contractAddress: string, args?: Record) => + nextProposalId: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalMultipleQueryKeys.address(contractAddress)[0], + ...daoProposalMultipleQueryKeys.address(chainId, contractAddress)[0], method: 'next_proposal_id', args, }, @@ -149,7 +199,7 @@ export const daoProposalMultipleQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoProposalMultipleConfigQuery ): UseQueryOptions => ({ - queryKey: daoProposalMultipleQueryKeys.config(contractAddress), + queryKey: daoProposalMultipleQueryKeys.config(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -181,7 +231,11 @@ export const daoProposalMultipleQueries = { options, }: DaoProposalMultipleProposalQuery ): UseQueryOptions => ({ - queryKey: daoProposalMultipleQueryKeys.proposal(contractAddress, args), + queryKey: daoProposalMultipleQueryKeys.proposal( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -218,7 +272,11 @@ export const daoProposalMultipleQueries = { options, }: DaoProposalMultipleListProposalsQuery ): UseQueryOptions => ({ - queryKey: daoProposalMultipleQueryKeys.listProposals(contractAddress, args), + queryKey: daoProposalMultipleQueryKeys.listProposals( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -257,6 +315,7 @@ export const daoProposalMultipleQueries = { }: DaoProposalMultipleReverseProposalsQuery ): UseQueryOptions => ({ queryKey: daoProposalMultipleQueryKeys.reverseProposals( + chainId, contractAddress, args ), @@ -297,7 +356,11 @@ export const daoProposalMultipleQueries = { options, }: DaoProposalMultipleGetVoteQuery ): UseQueryOptions => ({ - queryKey: daoProposalMultipleQueryKeys.getVote(contractAddress, args), + queryKey: daoProposalMultipleQueryKeys.getVote( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -335,7 +398,11 @@ export const daoProposalMultipleQueries = { options, }: DaoProposalMultipleListVotesQuery ): UseQueryOptions => ({ - queryKey: daoProposalMultipleQueryKeys.listVotes(contractAddress, args), + queryKey: daoProposalMultipleQueryKeys.listVotes( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -373,7 +440,10 @@ export const daoProposalMultipleQueries = { options, }: DaoProposalMultipleProposalCountQuery ): UseQueryOptions => ({ - queryKey: daoProposalMultipleQueryKeys.proposalCount(contractAddress), + queryKey: daoProposalMultipleQueryKeys.proposalCount( + chainId, + contractAddress + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -404,8 +474,10 @@ export const daoProposalMultipleQueries = { options, }: DaoProposalMultipleProposalCreationPolicyQuery ): UseQueryOptions => ({ - queryKey: - daoProposalMultipleQueryKeys.proposalCreationPolicy(contractAddress), + queryKey: daoProposalMultipleQueryKeys.proposalCreationPolicy( + chainId, + contractAddress + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -437,7 +509,10 @@ export const daoProposalMultipleQueries = { Error, TData > => ({ - queryKey: daoProposalMultipleQueryKeys.proposalHooks(contractAddress), + queryKey: daoProposalMultipleQueryKeys.proposalHooks( + chainId, + contractAddress + ), queryFn: async () => { return new DaoProposalMultipleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -455,7 +530,7 @@ export const daoProposalMultipleQueries = { Error, TData > => ({ - queryKey: daoProposalMultipleQueryKeys.voteHooks(contractAddress), + queryKey: daoProposalMultipleQueryKeys.voteHooks(chainId, contractAddress), queryFn: async () => { return new DaoProposalMultipleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -468,7 +543,7 @@ export const daoProposalMultipleQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoProposalMultipleDaoQuery ): UseQueryOptions => ({ - queryKey: daoProposalMultipleQueryKeys.dao(contractAddress), + queryKey: daoProposalMultipleQueryKeys.dao(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -500,7 +575,10 @@ export const daoProposalMultipleQueries = { options, }: DaoProposalMultipleNextProposalIdQuery ): UseQueryOptions => ({ - queryKey: daoProposalMultipleQueryKeys.nextProposalId(contractAddress), + queryKey: daoProposalMultipleQueryKeys.nextProposalId( + chainId, + contractAddress + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. diff --git a/packages/state/query/queries/contracts/DaoProposalSingle.v2.ts b/packages/state/query/queries/contracts/DaoProposalSingle.v2.ts index 2969bb880..42bc68b0b 100644 --- a/packages/state/query/queries/contracts/DaoProposalSingle.v2.ts +++ b/packages/state/query/queries/contracts/DaoProposalSingle.v2.ts @@ -29,116 +29,166 @@ export const daoProposalSingleV2QueryKeys = { contract: 'daoProposalSingleV2', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...daoProposalSingleV2QueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - config: (contractAddress: string, args?: Record) => + config: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalSingleV2QueryKeys.address(contractAddress)[0], + ...daoProposalSingleV2QueryKeys.address(chainId, contractAddress)[0], method: 'config', args, }, ] as const, - proposal: (contractAddress: string, args?: Record) => + proposal: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalSingleV2QueryKeys.address(contractAddress)[0], + ...daoProposalSingleV2QueryKeys.address(chainId, contractAddress)[0], method: 'proposal', args, }, ] as const, - listProposals: (contractAddress: string, args?: Record) => + listProposals: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalSingleV2QueryKeys.address(contractAddress)[0], + ...daoProposalSingleV2QueryKeys.address(chainId, contractAddress)[0], method: 'list_proposals', args, }, ] as const, - reverseProposals: (contractAddress: string, args?: Record) => + reverseProposals: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalSingleV2QueryKeys.address(contractAddress)[0], + ...daoProposalSingleV2QueryKeys.address(chainId, contractAddress)[0], method: 'reverse_proposals', args, }, ] as const, - getVote: (contractAddress: string, args?: Record) => + getVote: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalSingleV2QueryKeys.address(contractAddress)[0], + ...daoProposalSingleV2QueryKeys.address(chainId, contractAddress)[0], method: 'get_vote', args, }, ] as const, - listVotes: (contractAddress: string, args?: Record) => + listVotes: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalSingleV2QueryKeys.address(contractAddress)[0], + ...daoProposalSingleV2QueryKeys.address(chainId, contractAddress)[0], method: 'list_votes', args, }, ] as const, - proposalCount: (contractAddress: string, args?: Record) => + proposalCount: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalSingleV2QueryKeys.address(contractAddress)[0], + ...daoProposalSingleV2QueryKeys.address(chainId, contractAddress)[0], method: 'proposal_count', args, }, ] as const, proposalCreationPolicy: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...daoProposalSingleV2QueryKeys.address(contractAddress)[0], + ...daoProposalSingleV2QueryKeys.address(chainId, contractAddress)[0], method: 'proposal_creation_policy', args, }, ] as const, - proposalHooks: (contractAddress: string, args?: Record) => + proposalHooks: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalSingleV2QueryKeys.address(contractAddress)[0], + ...daoProposalSingleV2QueryKeys.address(chainId, contractAddress)[0], method: 'proposal_hooks', args, }, ] as const, - voteHooks: (contractAddress: string, args?: Record) => + voteHooks: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalSingleV2QueryKeys.address(contractAddress)[0], + ...daoProposalSingleV2QueryKeys.address(chainId, contractAddress)[0], method: 'vote_hooks', args, }, ] as const, - dao: (contractAddress: string, args?: Record) => + dao: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalSingleV2QueryKeys.address(contractAddress)[0], + ...daoProposalSingleV2QueryKeys.address(chainId, contractAddress)[0], method: 'dao', args, }, ] as const, - info: (contractAddress: string, args?: Record) => + info: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalSingleV2QueryKeys.address(contractAddress)[0], + ...daoProposalSingleV2QueryKeys.address(chainId, contractAddress)[0], method: 'info', args, }, ] as const, - nextProposalId: (contractAddress: string, args?: Record) => + nextProposalId: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoProposalSingleV2QueryKeys.address(contractAddress)[0], + ...daoProposalSingleV2QueryKeys.address(chainId, contractAddress)[0], method: 'next_proposal_id', args, }, @@ -149,7 +199,7 @@ export const daoProposalSingleV2Queries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoProposalSingleV2ConfigQuery ): UseQueryOptions => ({ - queryKey: daoProposalSingleV2QueryKeys.config(contractAddress), + queryKey: daoProposalSingleV2QueryKeys.config(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -181,7 +231,11 @@ export const daoProposalSingleV2Queries = { options, }: DaoProposalSingleV2ProposalQuery ): UseQueryOptions => ({ - queryKey: daoProposalSingleV2QueryKeys.proposal(contractAddress, args), + queryKey: daoProposalSingleV2QueryKeys.proposal( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -218,7 +272,11 @@ export const daoProposalSingleV2Queries = { options, }: DaoProposalSingleV2ListProposalsQuery ): UseQueryOptions => ({ - queryKey: daoProposalSingleV2QueryKeys.listProposals(contractAddress, args), + queryKey: daoProposalSingleV2QueryKeys.listProposals( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -257,6 +315,7 @@ export const daoProposalSingleV2Queries = { }: DaoProposalSingleV2ReverseProposalsQuery ): UseQueryOptions => ({ queryKey: daoProposalSingleV2QueryKeys.reverseProposals( + chainId, contractAddress, args ), @@ -297,7 +356,11 @@ export const daoProposalSingleV2Queries = { options, }: DaoProposalSingleV2GetVoteQuery ): UseQueryOptions => ({ - queryKey: daoProposalSingleV2QueryKeys.getVote(contractAddress, args), + queryKey: daoProposalSingleV2QueryKeys.getVote( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -335,7 +398,11 @@ export const daoProposalSingleV2Queries = { options, }: DaoProposalSingleV2ListVotesQuery ): UseQueryOptions => ({ - queryKey: daoProposalSingleV2QueryKeys.listVotes(contractAddress, args), + queryKey: daoProposalSingleV2QueryKeys.listVotes( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -373,7 +440,10 @@ export const daoProposalSingleV2Queries = { options, }: DaoProposalSingleV2ProposalCountQuery ): UseQueryOptions => ({ - queryKey: daoProposalSingleV2QueryKeys.proposalCount(contractAddress), + queryKey: daoProposalSingleV2QueryKeys.proposalCount( + chainId, + contractAddress + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -404,8 +474,10 @@ export const daoProposalSingleV2Queries = { options, }: DaoProposalSingleV2ProposalCreationPolicyQuery ): UseQueryOptions => ({ - queryKey: - daoProposalSingleV2QueryKeys.proposalCreationPolicy(contractAddress), + queryKey: daoProposalSingleV2QueryKeys.proposalCreationPolicy( + chainId, + contractAddress + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -437,7 +509,10 @@ export const daoProposalSingleV2Queries = { Error, TData > => ({ - queryKey: daoProposalSingleV2QueryKeys.proposalHooks(contractAddress), + queryKey: daoProposalSingleV2QueryKeys.proposalHooks( + chainId, + contractAddress + ), queryFn: async () => { return new DaoProposalSingleV2QueryClient( await getCosmWasmClientForChainId(chainId), @@ -455,7 +530,7 @@ export const daoProposalSingleV2Queries = { Error, TData > => ({ - queryKey: daoProposalSingleV2QueryKeys.voteHooks(contractAddress), + queryKey: daoProposalSingleV2QueryKeys.voteHooks(chainId, contractAddress), queryFn: async () => { return new DaoProposalSingleV2QueryClient( await getCosmWasmClientForChainId(chainId), @@ -468,7 +543,7 @@ export const daoProposalSingleV2Queries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoProposalSingleV2DaoQuery ): UseQueryOptions => ({ - queryKey: daoProposalSingleV2QueryKeys.dao(contractAddress), + queryKey: daoProposalSingleV2QueryKeys.dao(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -500,7 +575,10 @@ export const daoProposalSingleV2Queries = { options, }: DaoProposalSingleV2NextProposalIdQuery ): UseQueryOptions => ({ - queryKey: daoProposalSingleV2QueryKeys.nextProposalId(contractAddress), + queryKey: daoProposalSingleV2QueryKeys.nextProposalId( + chainId, + contractAddress + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. diff --git a/packages/state/query/queries/contracts/DaoVotingCw20Staked.ts b/packages/state/query/queries/contracts/DaoVotingCw20Staked.ts index d7d27acc6..46c7a5a61 100644 --- a/packages/state/query/queries/contracts/DaoVotingCw20Staked.ts +++ b/packages/state/query/queries/contracts/DaoVotingCw20Staked.ts @@ -26,79 +26,106 @@ export const daoVotingCw20StakedQueryKeys = { contract: 'daoVotingCw20Staked', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...daoVotingCw20StakedQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - stakingContract: (contractAddress: string, args?: Record) => + stakingContract: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingCw20StakedQueryKeys.address(contractAddress)[0], + ...daoVotingCw20StakedQueryKeys.address(chainId, contractAddress)[0], method: 'staking_contract', args, }, ] as const, - activeThreshold: (contractAddress: string, args?: Record) => + activeThreshold: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingCw20StakedQueryKeys.address(contractAddress)[0], + ...daoVotingCw20StakedQueryKeys.address(chainId, contractAddress)[0], method: 'active_threshold', args, }, ] as const, votingPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...daoVotingCw20StakedQueryKeys.address(contractAddress)[0], + ...daoVotingCw20StakedQueryKeys.address(chainId, contractAddress)[0], method: 'voting_power_at_height', args, }, ] as const, totalPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...daoVotingCw20StakedQueryKeys.address(contractAddress)[0], + ...daoVotingCw20StakedQueryKeys.address(chainId, contractAddress)[0], method: 'total_power_at_height', args, }, ] as const, - dao: (contractAddress: string, args?: Record) => + dao: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingCw20StakedQueryKeys.address(contractAddress)[0], + ...daoVotingCw20StakedQueryKeys.address(chainId, contractAddress)[0], method: 'dao', args, }, ] as const, - info: (contractAddress: string, args?: Record) => + info: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingCw20StakedQueryKeys.address(contractAddress)[0], + ...daoVotingCw20StakedQueryKeys.address(chainId, contractAddress)[0], method: 'info', args, }, ] as const, - tokenContract: (contractAddress: string, args?: Record) => + tokenContract: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingCw20StakedQueryKeys.address(contractAddress)[0], + ...daoVotingCw20StakedQueryKeys.address(chainId, contractAddress)[0], method: 'token_contract', args, }, ] as const, - isActive: (contractAddress: string, args?: Record) => + isActive: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingCw20StakedQueryKeys.address(contractAddress)[0], + ...daoVotingCw20StakedQueryKeys.address(chainId, contractAddress)[0], method: 'is_active', args, }, @@ -113,7 +140,10 @@ export const daoVotingCw20StakedQueries = { options, }: DaoVotingCw20StakedStakingContractQuery ): UseQueryOptions => ({ - queryKey: daoVotingCw20StakedQueryKeys.stakingContract(contractAddress), + queryKey: daoVotingCw20StakedQueryKeys.stakingContract( + chainId, + contractAddress + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -144,7 +174,10 @@ export const daoVotingCw20StakedQueries = { options, }: DaoVotingCw20StakedActiveThresholdQuery ): UseQueryOptions => ({ - queryKey: daoVotingCw20StakedQueryKeys.activeThreshold(contractAddress), + queryKey: daoVotingCw20StakedQueryKeys.activeThreshold( + chainId, + contractAddress + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -180,6 +213,7 @@ export const daoVotingCw20StakedQueries = { }: DaoVotingCw20StakedVotingPowerAtHeightQuery ): UseQueryOptions => ({ queryKey: daoVotingCw20StakedQueryKeys.votingPowerAtHeight( + chainId, contractAddress, args ), @@ -222,6 +256,7 @@ export const daoVotingCw20StakedQueries = { }: DaoVotingCw20StakedTotalPowerAtHeightQuery ): UseQueryOptions => ({ queryKey: daoVotingCw20StakedQueryKeys.totalPowerAtHeight( + chainId, contractAddress, args ), @@ -254,7 +289,7 @@ export const daoVotingCw20StakedQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoVotingCw20StakedDaoQuery ): UseQueryOptions => ({ - queryKey: daoVotingCw20StakedQueryKeys.dao(contractAddress), + queryKey: daoVotingCw20StakedQueryKeys.dao(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -286,7 +321,10 @@ export const daoVotingCw20StakedQueries = { options, }: DaoVotingCw20StakedTokenContractQuery ): UseQueryOptions => ({ - queryKey: daoVotingCw20StakedQueryKeys.tokenContract(contractAddress), + queryKey: daoVotingCw20StakedQueryKeys.tokenContract( + chainId, + contractAddress + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -318,7 +356,7 @@ export const daoVotingCw20StakedQueries = { Error, TData > => ({ - queryKey: daoVotingCw20StakedQueryKeys.isActive(contractAddress), + queryKey: daoVotingCw20StakedQueryKeys.isActive(chainId, contractAddress), queryFn: async () => { return new DaoVotingCw20StakedQueryClient( await getCosmWasmClientForChainId(chainId), diff --git a/packages/state/query/queries/contracts/DaoVotingCw4.ts b/packages/state/query/queries/contracts/DaoVotingCw4.ts index afe7d223e..7f2cb6763 100644 --- a/packages/state/query/queries/contracts/DaoVotingCw4.ts +++ b/packages/state/query/queries/contracts/DaoVotingCw4.ts @@ -24,55 +24,70 @@ export const daoVotingCw4QueryKeys = { contract: 'daoVotingCw4', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...daoVotingCw4QueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - groupContract: (contractAddress: string, args?: Record) => + groupContract: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingCw4QueryKeys.address(contractAddress)[0], + ...daoVotingCw4QueryKeys.address(chainId, contractAddress)[0], method: 'group_contract', args, }, ] as const, votingPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...daoVotingCw4QueryKeys.address(contractAddress)[0], + ...daoVotingCw4QueryKeys.address(chainId, contractAddress)[0], method: 'voting_power_at_height', args, }, ] as const, totalPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...daoVotingCw4QueryKeys.address(contractAddress)[0], + ...daoVotingCw4QueryKeys.address(chainId, contractAddress)[0], method: 'total_power_at_height', args, }, ] as const, - dao: (contractAddress: string, args?: Record) => + dao: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingCw4QueryKeys.address(contractAddress)[0], + ...daoVotingCw4QueryKeys.address(chainId, contractAddress)[0], method: 'dao', args, }, ] as const, - info: (contractAddress: string, args?: Record) => + info: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingCw4QueryKeys.address(contractAddress)[0], + ...daoVotingCw4QueryKeys.address(chainId, contractAddress)[0], method: 'info', args, }, @@ -83,7 +98,7 @@ export const daoVotingCw4Queries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoVotingCw4GroupContractQuery ): UseQueryOptions => ({ - queryKey: daoVotingCw4QueryKeys.groupContract(contractAddress), + queryKey: daoVotingCw4QueryKeys.groupContract(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -115,7 +130,11 @@ export const daoVotingCw4Queries = { options, }: DaoVotingCw4VotingPowerAtHeightQuery ): UseQueryOptions => ({ - queryKey: daoVotingCw4QueryKeys.votingPowerAtHeight(contractAddress, args), + queryKey: daoVotingCw4QueryKeys.votingPowerAtHeight( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -156,7 +175,11 @@ export const daoVotingCw4Queries = { options, }: DaoVotingCw4TotalPowerAtHeightQuery ): UseQueryOptions => ({ - queryKey: daoVotingCw4QueryKeys.totalPowerAtHeight(contractAddress, args), + queryKey: daoVotingCw4QueryKeys.totalPowerAtHeight( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -188,7 +211,7 @@ export const daoVotingCw4Queries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoVotingCw4DaoQuery ): UseQueryOptions => ({ - queryKey: daoVotingCw4QueryKeys.dao(contractAddress), + queryKey: daoVotingCw4QueryKeys.dao(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. diff --git a/packages/state/query/queries/contracts/DaoVotingCw721Staked.ts b/packages/state/query/queries/contracts/DaoVotingCw721Staked.ts index 99558064e..340229318 100644 --- a/packages/state/query/queries/contracts/DaoVotingCw721Staked.ts +++ b/packages/state/query/queries/contracts/DaoVotingCw721Staked.ts @@ -30,95 +30,130 @@ export const daoVotingCw721StakedQueryKeys = { contract: 'daoVotingCw721Staked', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...daoVotingCw721StakedQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - config: (contractAddress: string, args?: Record) => + config: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingCw721StakedQueryKeys.address(contractAddress)[0], + ...daoVotingCw721StakedQueryKeys.address(chainId, contractAddress)[0], method: 'config', args, }, ] as const, - nftClaims: (contractAddress: string, args?: Record) => + nftClaims: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingCw721StakedQueryKeys.address(contractAddress)[0], + ...daoVotingCw721StakedQueryKeys.address(chainId, contractAddress)[0], method: 'nft_claims', args, }, ] as const, - hooks: (contractAddress: string, args?: Record) => + hooks: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingCw721StakedQueryKeys.address(contractAddress)[0], + ...daoVotingCw721StakedQueryKeys.address(chainId, contractAddress)[0], method: 'hooks', args, }, ] as const, - stakedNfts: (contractAddress: string, args?: Record) => + stakedNfts: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingCw721StakedQueryKeys.address(contractAddress)[0], + ...daoVotingCw721StakedQueryKeys.address(chainId, contractAddress)[0], method: 'staked_nfts', args, }, ] as const, - activeThreshold: (contractAddress: string, args?: Record) => + activeThreshold: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingCw721StakedQueryKeys.address(contractAddress)[0], + ...daoVotingCw721StakedQueryKeys.address(chainId, contractAddress)[0], method: 'active_threshold', args, }, ] as const, - isActive: (contractAddress: string, args?: Record) => + isActive: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingCw721StakedQueryKeys.address(contractAddress)[0], + ...daoVotingCw721StakedQueryKeys.address(chainId, contractAddress)[0], method: 'is_active', args, }, ] as const, votingPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...daoVotingCw721StakedQueryKeys.address(contractAddress)[0], + ...daoVotingCw721StakedQueryKeys.address(chainId, contractAddress)[0], method: 'voting_power_at_height', args, }, ] as const, totalPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...daoVotingCw721StakedQueryKeys.address(contractAddress)[0], + ...daoVotingCw721StakedQueryKeys.address(chainId, contractAddress)[0], method: 'total_power_at_height', args, }, ] as const, - dao: (contractAddress: string, args?: Record) => + dao: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingCw721StakedQueryKeys.address(contractAddress)[0], + ...daoVotingCw721StakedQueryKeys.address(chainId, contractAddress)[0], method: 'dao', args, }, ] as const, - info: (contractAddress: string, args?: Record) => + info: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingCw721StakedQueryKeys.address(contractAddress)[0], + ...daoVotingCw721StakedQueryKeys.address(chainId, contractAddress)[0], method: 'info', args, }, @@ -133,7 +168,7 @@ export const daoVotingCw721StakedQueries = { options, }: DaoVotingCw721StakedConfigQuery ): UseQueryOptions => ({ - queryKey: daoVotingCw721StakedQueryKeys.config(contractAddress), + queryKey: daoVotingCw721StakedQueryKeys.config(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -165,7 +200,11 @@ export const daoVotingCw721StakedQueries = { options, }: DaoVotingCw721StakedNftClaimsQuery ): UseQueryOptions => ({ - queryKey: daoVotingCw721StakedQueryKeys.nftClaims(contractAddress, args), + queryKey: daoVotingCw721StakedQueryKeys.nftClaims( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -202,7 +241,7 @@ export const daoVotingCw721StakedQueries = { Error, TData > => ({ - queryKey: daoVotingCw721StakedQueryKeys.hooks(contractAddress), + queryKey: daoVotingCw721StakedQueryKeys.hooks(chainId, contractAddress), queryFn: async () => { return new DaoVotingCw721StakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -220,7 +259,11 @@ export const daoVotingCw721StakedQueries = { options, }: DaoVotingCw721StakedStakedNftsQuery ): UseQueryOptions => ({ - queryKey: daoVotingCw721StakedQueryKeys.stakedNfts(contractAddress, args), + queryKey: daoVotingCw721StakedQueryKeys.stakedNfts( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -256,7 +299,10 @@ export const daoVotingCw721StakedQueries = { options, }: DaoVotingCw721StakedActiveThresholdQuery ): UseQueryOptions => ({ - queryKey: daoVotingCw721StakedQueryKeys.activeThreshold(contractAddress), + queryKey: daoVotingCw721StakedQueryKeys.activeThreshold( + chainId, + contractAddress + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -290,7 +336,7 @@ export const daoVotingCw721StakedQueries = { Error, TData > => ({ - queryKey: daoVotingCw721StakedQueryKeys.isActive(contractAddress), + queryKey: daoVotingCw721StakedQueryKeys.isActive(chainId, contractAddress), queryFn: async () => { return new DaoVotingCw721StakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -309,6 +355,7 @@ export const daoVotingCw721StakedQueries = { }: DaoVotingCw721StakedVotingPowerAtHeightQuery ): UseQueryOptions => ({ queryKey: daoVotingCw721StakedQueryKeys.votingPowerAtHeight( + chainId, contractAddress, args ), @@ -351,6 +398,7 @@ export const daoVotingCw721StakedQueries = { }: DaoVotingCw721StakedTotalPowerAtHeightQuery ): UseQueryOptions => ({ queryKey: daoVotingCw721StakedQueryKeys.totalPowerAtHeight( + chainId, contractAddress, args ), @@ -383,7 +431,7 @@ export const daoVotingCw721StakedQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoVotingCw721StakedDaoQuery ): UseQueryOptions => ({ - queryKey: daoVotingCw721StakedQueryKeys.dao(contractAddress), + queryKey: daoVotingCw721StakedQueryKeys.dao(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. diff --git a/packages/state/query/queries/contracts/DaoVotingNativeStaked.ts b/packages/state/query/queries/contracts/DaoVotingNativeStaked.ts index 551f0f398..8d02b2248 100644 --- a/packages/state/query/queries/contracts/DaoVotingNativeStaked.ts +++ b/packages/state/query/queries/contracts/DaoVotingNativeStaked.ts @@ -27,71 +27,94 @@ export const daoVotingNativeStakedQueryKeys = { contract: 'daoVotingNativeStaked', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...daoVotingNativeStakedQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - getConfig: (contractAddress: string, args?: Record) => + getConfig: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingNativeStakedQueryKeys.address(contractAddress)[0], + ...daoVotingNativeStakedQueryKeys.address(chainId, contractAddress)[0], method: 'get_config', args, }, ] as const, - claims: (contractAddress: string, args?: Record) => + claims: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingNativeStakedQueryKeys.address(contractAddress)[0], + ...daoVotingNativeStakedQueryKeys.address(chainId, contractAddress)[0], method: 'claims', args, }, ] as const, - listStakers: (contractAddress: string, args?: Record) => + listStakers: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingNativeStakedQueryKeys.address(contractAddress)[0], + ...daoVotingNativeStakedQueryKeys.address(chainId, contractAddress)[0], method: 'list_stakers', args, }, ] as const, votingPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...daoVotingNativeStakedQueryKeys.address(contractAddress)[0], + ...daoVotingNativeStakedQueryKeys.address(chainId, contractAddress)[0], method: 'voting_power_at_height', args, }, ] as const, totalPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...daoVotingNativeStakedQueryKeys.address(contractAddress)[0], + ...daoVotingNativeStakedQueryKeys.address(chainId, contractAddress)[0], method: 'total_power_at_height', args, }, ] as const, - dao: (contractAddress: string, args?: Record) => + dao: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingNativeStakedQueryKeys.address(contractAddress)[0], + ...daoVotingNativeStakedQueryKeys.address(chainId, contractAddress)[0], method: 'dao', args, }, ] as const, - info: (contractAddress: string, args?: Record) => + info: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingNativeStakedQueryKeys.address(contractAddress)[0], + ...daoVotingNativeStakedQueryKeys.address(chainId, contractAddress)[0], method: 'info', args, }, @@ -106,7 +129,10 @@ export const daoVotingNativeStakedQueries = { options, }: DaoVotingNativeStakedGetConfigQuery ): UseQueryOptions => ({ - queryKey: daoVotingNativeStakedQueryKeys.getConfig(contractAddress), + queryKey: daoVotingNativeStakedQueryKeys.getConfig( + chainId, + contractAddress + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -138,7 +164,11 @@ export const daoVotingNativeStakedQueries = { options, }: DaoVotingNativeStakedClaimsQuery ): UseQueryOptions => ({ - queryKey: daoVotingNativeStakedQueryKeys.claims(contractAddress, args), + queryKey: daoVotingNativeStakedQueryKeys.claims( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -175,7 +205,11 @@ export const daoVotingNativeStakedQueries = { options, }: DaoVotingNativeStakedListStakersQuery ): UseQueryOptions => ({ - queryKey: daoVotingNativeStakedQueryKeys.listStakers(contractAddress, args), + queryKey: daoVotingNativeStakedQueryKeys.listStakers( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -214,6 +248,7 @@ export const daoVotingNativeStakedQueries = { }: DaoVotingNativeStakedVotingPowerAtHeightQuery ): UseQueryOptions => ({ queryKey: daoVotingNativeStakedQueryKeys.votingPowerAtHeight( + chainId, contractAddress, args ), @@ -256,6 +291,7 @@ export const daoVotingNativeStakedQueries = { }: DaoVotingNativeStakedTotalPowerAtHeightQuery ): UseQueryOptions => ({ queryKey: daoVotingNativeStakedQueryKeys.totalPowerAtHeight( + chainId, contractAddress, args ), @@ -288,7 +324,7 @@ export const daoVotingNativeStakedQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoVotingNativeStakedDaoQuery ): UseQueryOptions => ({ - queryKey: daoVotingNativeStakedQueryKeys.dao(contractAddress), + queryKey: daoVotingNativeStakedQueryKeys.dao(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. diff --git a/packages/state/query/queries/contracts/DaoVotingOnftStaked.ts b/packages/state/query/queries/contracts/DaoVotingOnftStaked.ts index 2726cc9b6..a8334f040 100644 --- a/packages/state/query/queries/contracts/DaoVotingOnftStaked.ts +++ b/packages/state/query/queries/contracts/DaoVotingOnftStaked.ts @@ -30,95 +30,130 @@ export const daoVotingOnftStakedQueryKeys = { contract: 'daoVotingOnftStaked', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...daoVotingOnftStakedQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - config: (contractAddress: string, args?: Record) => + config: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingOnftStakedQueryKeys.address(contractAddress)[0], + ...daoVotingOnftStakedQueryKeys.address(chainId, contractAddress)[0], method: 'config', args, }, ] as const, - nftClaims: (contractAddress: string, args?: Record) => + nftClaims: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingOnftStakedQueryKeys.address(contractAddress)[0], + ...daoVotingOnftStakedQueryKeys.address(chainId, contractAddress)[0], method: 'nft_claims', args, }, ] as const, - hooks: (contractAddress: string, args?: Record) => + hooks: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingOnftStakedQueryKeys.address(contractAddress)[0], + ...daoVotingOnftStakedQueryKeys.address(chainId, contractAddress)[0], method: 'hooks', args, }, ] as const, - stakedNfts: (contractAddress: string, args?: Record) => + stakedNfts: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingOnftStakedQueryKeys.address(contractAddress)[0], + ...daoVotingOnftStakedQueryKeys.address(chainId, contractAddress)[0], method: 'staked_nfts', args, }, ] as const, - activeThreshold: (contractAddress: string, args?: Record) => + activeThreshold: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingOnftStakedQueryKeys.address(contractAddress)[0], + ...daoVotingOnftStakedQueryKeys.address(chainId, contractAddress)[0], method: 'active_threshold', args, }, ] as const, - isActive: (contractAddress: string, args?: Record) => + isActive: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingOnftStakedQueryKeys.address(contractAddress)[0], + ...daoVotingOnftStakedQueryKeys.address(chainId, contractAddress)[0], method: 'is_active', args, }, ] as const, votingPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...daoVotingOnftStakedQueryKeys.address(contractAddress)[0], + ...daoVotingOnftStakedQueryKeys.address(chainId, contractAddress)[0], method: 'voting_power_at_height', args, }, ] as const, totalPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...daoVotingOnftStakedQueryKeys.address(contractAddress)[0], + ...daoVotingOnftStakedQueryKeys.address(chainId, contractAddress)[0], method: 'total_power_at_height', args, }, ] as const, - dao: (contractAddress: string, args?: Record) => + dao: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingOnftStakedQueryKeys.address(contractAddress)[0], + ...daoVotingOnftStakedQueryKeys.address(chainId, contractAddress)[0], method: 'dao', args, }, ] as const, - info: (contractAddress: string, args?: Record) => + info: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingOnftStakedQueryKeys.address(contractAddress)[0], + ...daoVotingOnftStakedQueryKeys.address(chainId, contractAddress)[0], method: 'info', args, }, @@ -129,7 +164,7 @@ export const daoVotingOnftStakedQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoVotingOnftStakedConfigQuery ): UseQueryOptions => ({ - queryKey: daoVotingOnftStakedQueryKeys.config(contractAddress), + queryKey: daoVotingOnftStakedQueryKeys.config(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -161,7 +196,11 @@ export const daoVotingOnftStakedQueries = { options, }: DaoVotingOnftStakedNftClaimsQuery ): UseQueryOptions => ({ - queryKey: daoVotingOnftStakedQueryKeys.nftClaims(contractAddress, args), + queryKey: daoVotingOnftStakedQueryKeys.nftClaims( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -198,7 +237,7 @@ export const daoVotingOnftStakedQueries = { Error, TData > => ({ - queryKey: daoVotingOnftStakedQueryKeys.hooks(contractAddress), + queryKey: daoVotingOnftStakedQueryKeys.hooks(chainId, contractAddress), queryFn: async () => { return new DaoVotingOnftStakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -216,7 +255,11 @@ export const daoVotingOnftStakedQueries = { options, }: DaoVotingOnftStakedStakedNftsQuery ): UseQueryOptions => ({ - queryKey: daoVotingOnftStakedQueryKeys.stakedNfts(contractAddress, args), + queryKey: daoVotingOnftStakedQueryKeys.stakedNfts( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -252,7 +295,10 @@ export const daoVotingOnftStakedQueries = { options, }: DaoVotingOnftStakedActiveThresholdQuery ): UseQueryOptions => ({ - queryKey: daoVotingOnftStakedQueryKeys.activeThreshold(contractAddress), + queryKey: daoVotingOnftStakedQueryKeys.activeThreshold( + chainId, + contractAddress + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -284,7 +330,7 @@ export const daoVotingOnftStakedQueries = { Error, TData > => ({ - queryKey: daoVotingOnftStakedQueryKeys.isActive(contractAddress), + queryKey: daoVotingOnftStakedQueryKeys.isActive(chainId, contractAddress), queryFn: async () => { return new DaoVotingOnftStakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -303,6 +349,7 @@ export const daoVotingOnftStakedQueries = { }: DaoVotingOnftStakedVotingPowerAtHeightQuery ): UseQueryOptions => ({ queryKey: daoVotingOnftStakedQueryKeys.votingPowerAtHeight( + chainId, contractAddress, args ), @@ -345,6 +392,7 @@ export const daoVotingOnftStakedQueries = { }: DaoVotingOnftStakedTotalPowerAtHeightQuery ): UseQueryOptions => ({ queryKey: daoVotingOnftStakedQueryKeys.totalPowerAtHeight( + chainId, contractAddress, args ), @@ -377,7 +425,7 @@ export const daoVotingOnftStakedQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoVotingOnftStakedDaoQuery ): UseQueryOptions => ({ - queryKey: daoVotingOnftStakedQueryKeys.dao(contractAddress), + queryKey: daoVotingOnftStakedQueryKeys.dao(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. diff --git a/packages/state/query/queries/contracts/DaoVotingSgCommunityNft.ts b/packages/state/query/queries/contracts/DaoVotingSgCommunityNft.ts index 7a9f7a3bc..33b37e11b 100644 --- a/packages/state/query/queries/contracts/DaoVotingSgCommunityNft.ts +++ b/packages/state/query/queries/contracts/DaoVotingSgCommunityNft.ts @@ -28,87 +28,145 @@ export const daoVotingSgCommunityNftQueryKeys = { contract: 'daoVotingSgCommunityNft', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...daoVotingSgCommunityNftQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - nftContract: (contractAddress: string, args?: Record) => + nftContract: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingSgCommunityNftQueryKeys.address(contractAddress)[0], + ...daoVotingSgCommunityNftQueryKeys.address( + chainId, + contractAddress + )[0], method: 'nft_contract', args, }, ] as const, - hooks: (contractAddress: string, args?: Record) => + hooks: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingSgCommunityNftQueryKeys.address(contractAddress)[0], + ...daoVotingSgCommunityNftQueryKeys.address( + chainId, + contractAddress + )[0], method: 'hooks', args, }, ] as const, - registeredNft: (contractAddress: string, args?: Record) => + registeredNft: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingSgCommunityNftQueryKeys.address(contractAddress)[0], + ...daoVotingSgCommunityNftQueryKeys.address( + chainId, + contractAddress + )[0], method: 'registered_nft', args, }, ] as const, - listVoters: (contractAddress: string, args?: Record) => + listVoters: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingSgCommunityNftQueryKeys.address(contractAddress)[0], + ...daoVotingSgCommunityNftQueryKeys.address( + chainId, + contractAddress + )[0], method: 'list_voters', args, }, ] as const, - ownership: (contractAddress: string, args?: Record) => + ownership: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingSgCommunityNftQueryKeys.address(contractAddress)[0], + ...daoVotingSgCommunityNftQueryKeys.address( + chainId, + contractAddress + )[0], method: 'ownership', args, }, ] as const, votingPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...daoVotingSgCommunityNftQueryKeys.address(contractAddress)[0], + ...daoVotingSgCommunityNftQueryKeys.address( + chainId, + contractAddress + )[0], method: 'voting_power_at_height', args, }, ] as const, totalPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...daoVotingSgCommunityNftQueryKeys.address(contractAddress)[0], + ...daoVotingSgCommunityNftQueryKeys.address( + chainId, + contractAddress + )[0], method: 'total_power_at_height', args, }, ] as const, - dao: (contractAddress: string, args?: Record) => + dao: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingSgCommunityNftQueryKeys.address(contractAddress)[0], + ...daoVotingSgCommunityNftQueryKeys.address( + chainId, + contractAddress + )[0], method: 'dao', args, }, ] as const, - info: (contractAddress: string, args?: Record) => + info: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingSgCommunityNftQueryKeys.address(contractAddress)[0], + ...daoVotingSgCommunityNftQueryKeys.address( + chainId, + contractAddress + )[0], method: 'info', args, }, @@ -123,7 +181,10 @@ export const daoVotingSgCommunityNftQueries = { options, }: DaoVotingSgCommunityNftNftContractQuery ): UseQueryOptions => ({ - queryKey: daoVotingSgCommunityNftQueryKeys.nftContract(contractAddress), + queryKey: daoVotingSgCommunityNftQueryKeys.nftContract( + chainId, + contractAddress + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -155,7 +216,7 @@ export const daoVotingSgCommunityNftQueries = { Error, TData > => ({ - queryKey: daoVotingSgCommunityNftQueryKeys.hooks(contractAddress), + queryKey: daoVotingSgCommunityNftQueryKeys.hooks(chainId, contractAddress), queryFn: async () => { return new DaoVotingSgCommunityNftQueryClient( await getCosmWasmClientForChainId(chainId), @@ -174,6 +235,7 @@ export const daoVotingSgCommunityNftQueries = { }: DaoVotingSgCommunityNftRegisteredNftQuery ): UseQueryOptions => ({ queryKey: daoVotingSgCommunityNftQueryKeys.registeredNft( + chainId, contractAddress, args ), @@ -212,6 +274,7 @@ export const daoVotingSgCommunityNftQueries = { }: DaoVotingSgCommunityNftListVotersQuery ): UseQueryOptions => ({ queryKey: daoVotingSgCommunityNftQueryKeys.listVoters( + chainId, contractAddress, args ), @@ -250,7 +313,10 @@ export const daoVotingSgCommunityNftQueries = { Error, TData > => ({ - queryKey: daoVotingSgCommunityNftQueryKeys.ownership(contractAddress), + queryKey: daoVotingSgCommunityNftQueryKeys.ownership( + chainId, + contractAddress + ), queryFn: async () => { return new DaoVotingSgCommunityNftQueryClient( await getCosmWasmClientForChainId(chainId), @@ -269,6 +335,7 @@ export const daoVotingSgCommunityNftQueries = { }: DaoVotingSgCommunityNftVotingPowerAtHeightQuery ): UseQueryOptions => ({ queryKey: daoVotingSgCommunityNftQueryKeys.votingPowerAtHeight( + chainId, contractAddress, args ), @@ -311,6 +378,7 @@ export const daoVotingSgCommunityNftQueries = { }: DaoVotingSgCommunityNftTotalPowerAtHeightQuery ): UseQueryOptions => ({ queryKey: daoVotingSgCommunityNftQueryKeys.totalPowerAtHeight( + chainId, contractAddress, args ), @@ -347,7 +415,7 @@ export const daoVotingSgCommunityNftQueries = { options, }: DaoVotingSgCommunityNftDaoQuery ): UseQueryOptions => ({ - queryKey: daoVotingSgCommunityNftQueryKeys.dao(contractAddress), + queryKey: daoVotingSgCommunityNftQueryKeys.dao(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. diff --git a/packages/state/query/queries/contracts/DaoVotingTokenStaked.ts b/packages/state/query/queries/contracts/DaoVotingTokenStaked.ts index db1e512cf..c65cb98c9 100644 --- a/packages/state/query/queries/contracts/DaoVotingTokenStaked.ts +++ b/packages/state/query/queries/contracts/DaoVotingTokenStaked.ts @@ -32,111 +32,154 @@ export const daoVotingTokenStakedQueryKeys = { contract: 'daoVotingTokenStaked', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...daoVotingTokenStakedQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - getConfig: (contractAddress: string, args?: Record) => + getConfig: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...daoVotingTokenStakedQueryKeys.address(chainId, contractAddress)[0], method: 'get_config', args, }, ] as const, - claims: (contractAddress: string, args?: Record) => + claims: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...daoVotingTokenStakedQueryKeys.address(chainId, contractAddress)[0], method: 'claims', args, }, ] as const, - listStakers: (contractAddress: string, args?: Record) => + listStakers: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...daoVotingTokenStakedQueryKeys.address(chainId, contractAddress)[0], method: 'list_stakers', args, }, ] as const, - activeThreshold: (contractAddress: string, args?: Record) => + activeThreshold: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...daoVotingTokenStakedQueryKeys.address(chainId, contractAddress)[0], method: 'active_threshold', args, }, ] as const, - getHooks: (contractAddress: string, args?: Record) => + getHooks: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...daoVotingTokenStakedQueryKeys.address(chainId, contractAddress)[0], method: 'get_hooks', args, }, ] as const, - tokenContract: (contractAddress: string, args?: Record) => + tokenContract: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...daoVotingTokenStakedQueryKeys.address(chainId, contractAddress)[0], method: 'token_contract', args, }, ] as const, - denom: (contractAddress: string, args?: Record) => + denom: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...daoVotingTokenStakedQueryKeys.address(chainId, contractAddress)[0], method: 'denom', args, }, ] as const, - isActive: (contractAddress: string, args?: Record) => + isActive: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...daoVotingTokenStakedQueryKeys.address(chainId, contractAddress)[0], method: 'is_active', args, }, ] as const, votingPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...daoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...daoVotingTokenStakedQueryKeys.address(chainId, contractAddress)[0], method: 'voting_power_at_height', args, }, ] as const, totalPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...daoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...daoVotingTokenStakedQueryKeys.address(chainId, contractAddress)[0], method: 'total_power_at_height', args, }, ] as const, - dao: (contractAddress: string, args?: Record) => + dao: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...daoVotingTokenStakedQueryKeys.address(chainId, contractAddress)[0], method: 'dao', args, }, ] as const, - info: (contractAddress: string, args?: Record) => + info: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...daoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...daoVotingTokenStakedQueryKeys.address(chainId, contractAddress)[0], method: 'info', args, }, @@ -151,7 +194,7 @@ export const daoVotingTokenStakedQueries = { options, }: DaoVotingTokenStakedGetConfigQuery ): UseQueryOptions => ({ - queryKey: daoVotingTokenStakedQueryKeys.getConfig(contractAddress), + queryKey: daoVotingTokenStakedQueryKeys.getConfig(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -183,7 +226,11 @@ export const daoVotingTokenStakedQueries = { options, }: DaoVotingTokenStakedClaimsQuery ): UseQueryOptions => ({ - queryKey: daoVotingTokenStakedQueryKeys.claims(contractAddress, args), + queryKey: daoVotingTokenStakedQueryKeys.claims( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -218,7 +265,11 @@ export const daoVotingTokenStakedQueries = { options, }: DaoVotingTokenStakedListStakersQuery ): UseQueryOptions => ({ - queryKey: daoVotingTokenStakedQueryKeys.listStakers(contractAddress, args), + queryKey: daoVotingTokenStakedQueryKeys.listStakers( + chainId, + contractAddress, + args + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -253,7 +304,10 @@ export const daoVotingTokenStakedQueries = { options, }: DaoVotingTokenStakedActiveThresholdQuery ): UseQueryOptions => ({ - queryKey: daoVotingTokenStakedQueryKeys.activeThreshold(contractAddress), + queryKey: daoVotingTokenStakedQueryKeys.activeThreshold( + chainId, + contractAddress + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -287,7 +341,7 @@ export const daoVotingTokenStakedQueries = { Error, TData > => ({ - queryKey: daoVotingTokenStakedQueryKeys.getHooks(contractAddress), + queryKey: daoVotingTokenStakedQueryKeys.getHooks(chainId, contractAddress), queryFn: async () => { return new DaoVotingTokenStakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -304,7 +358,10 @@ export const daoVotingTokenStakedQueries = { options, }: DaoVotingTokenStakedTokenContractQuery ): UseQueryOptions => ({ - queryKey: daoVotingTokenStakedQueryKeys.tokenContract(contractAddress), + queryKey: daoVotingTokenStakedQueryKeys.tokenContract( + chainId, + contractAddress + ), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -331,7 +388,7 @@ export const daoVotingTokenStakedQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoVotingTokenStakedDenomQuery ): UseQueryOptions => ({ - queryKey: daoVotingTokenStakedQueryKeys.denom(contractAddress), + queryKey: daoVotingTokenStakedQueryKeys.denom(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -365,7 +422,7 @@ export const daoVotingTokenStakedQueries = { Error, TData > => ({ - queryKey: daoVotingTokenStakedQueryKeys.isActive(contractAddress), + queryKey: daoVotingTokenStakedQueryKeys.isActive(chainId, contractAddress), queryFn: async () => { return new DaoVotingTokenStakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -384,6 +441,7 @@ export const daoVotingTokenStakedQueries = { }: DaoVotingTokenStakedVotingPowerAtHeightQuery ): UseQueryOptions => ({ queryKey: daoVotingTokenStakedQueryKeys.votingPowerAtHeight( + chainId, contractAddress, args ), @@ -426,6 +484,7 @@ export const daoVotingTokenStakedQueries = { }: DaoVotingTokenStakedTotalPowerAtHeightQuery ): UseQueryOptions => ({ queryKey: daoVotingTokenStakedQueryKeys.totalPowerAtHeight( + chainId, contractAddress, args ), @@ -458,7 +517,7 @@ export const daoVotingTokenStakedQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: DaoVotingTokenStakedDaoQuery ): UseQueryOptions => ({ - queryKey: daoVotingTokenStakedQueryKeys.dao(contractAddress), + queryKey: daoVotingTokenStakedQueryKeys.dao(chainId, contractAddress), queryFn: async () => { try { // Attempt to fetch data from the indexer. diff --git a/packages/state/query/queries/contracts/NeutronVotingRegistry.ts b/packages/state/query/queries/contracts/NeutronVotingRegistry.ts index c6e480a68..8093b27bf 100644 --- a/packages/state/query/queries/contracts/NeutronVotingRegistry.ts +++ b/packages/state/query/queries/contracts/NeutronVotingRegistry.ts @@ -24,63 +24,82 @@ export const neutronVotingRegistryQueryKeys = { contract: 'neutronVotingRegistry', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...neutronVotingRegistryQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - dao: (contractAddress: string, args?: Record) => + dao: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...neutronVotingRegistryQueryKeys.address(contractAddress)[0], + ...neutronVotingRegistryQueryKeys.address(chainId, contractAddress)[0], method: 'dao', args, }, ] as const, - config: (contractAddress: string, args?: Record) => + config: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...neutronVotingRegistryQueryKeys.address(contractAddress)[0], + ...neutronVotingRegistryQueryKeys.address(chainId, contractAddress)[0], method: 'config', args, }, ] as const, - votingVaults: (contractAddress: string, args?: Record) => + votingVaults: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...neutronVotingRegistryQueryKeys.address(contractAddress)[0], + ...neutronVotingRegistryQueryKeys.address(chainId, contractAddress)[0], method: 'voting_vaults', args, }, ] as const, votingPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...neutronVotingRegistryQueryKeys.address(contractAddress)[0], + ...neutronVotingRegistryQueryKeys.address(chainId, contractAddress)[0], method: 'voting_power_at_height', args, }, ] as const, totalPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...neutronVotingRegistryQueryKeys.address(contractAddress)[0], + ...neutronVotingRegistryQueryKeys.address(chainId, contractAddress)[0], method: 'total_power_at_height', args, }, ] as const, - info: (contractAddress: string, args?: Record) => + info: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...neutronVotingRegistryQueryKeys.address(contractAddress)[0], + ...neutronVotingRegistryQueryKeys.address(chainId, contractAddress)[0], method: 'info', args, }, @@ -96,7 +115,7 @@ export const neutronVotingRegistryQueries = { Error, TData > => ({ - queryKey: neutronVotingRegistryQueryKeys.dao(contractAddress), + queryKey: neutronVotingRegistryQueryKeys.dao(chainId, contractAddress), queryFn: async () => new NeutronVotingRegistryQueryClient( await getCosmWasmClientForChainId(chainId), @@ -113,7 +132,7 @@ export const neutronVotingRegistryQueries = { Error, TData > => ({ - queryKey: neutronVotingRegistryQueryKeys.config(contractAddress), + queryKey: neutronVotingRegistryQueryKeys.config(chainId, contractAddress), queryFn: async () => new NeutronVotingRegistryQueryClient( await getCosmWasmClientForChainId(chainId), @@ -132,6 +151,7 @@ export const neutronVotingRegistryQueries = { TData > => ({ queryKey: neutronVotingRegistryQueryKeys.votingVaults( + chainId, contractAddress, args ), @@ -155,6 +175,7 @@ export const neutronVotingRegistryQueries = { TData > => ({ queryKey: neutronVotingRegistryQueryKeys.votingPowerAtHeight( + chainId, contractAddress, args ), @@ -179,6 +200,7 @@ export const neutronVotingRegistryQueries = { TData > => ({ queryKey: neutronVotingRegistryQueryKeys.totalPowerAtHeight( + chainId, contractAddress, args ), @@ -200,7 +222,7 @@ export const neutronVotingRegistryQueries = { Error, TData > => ({ - queryKey: neutronVotingRegistryQueryKeys.info(contractAddress), + queryKey: neutronVotingRegistryQueryKeys.info(chainId, contractAddress), queryFn: async () => new NeutronVotingRegistryQueryClient( await getCosmWasmClientForChainId(chainId), diff --git a/packages/state/query/queries/contracts/PolytoneNote.ts b/packages/state/query/queries/contracts/PolytoneNote.ts index 7646e3872..c5c500f45 100644 --- a/packages/state/query/queries/contracts/PolytoneNote.ts +++ b/packages/state/query/queries/contracts/PolytoneNote.ts @@ -12,17 +12,22 @@ export const polytoneNoteQueryKeys = { contract: 'polytoneNote', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...polytoneNoteQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - remoteAddress: (contractAddress: string, args?: Record) => + remoteAddress: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...polytoneNoteQueryKeys.address(contractAddress)[0], + ...polytoneNoteQueryKeys.address(chainId, contractAddress)[0], method: 'remote_address', ...(args && { args }), }, @@ -38,7 +43,11 @@ export const polytoneNoteQueries = { options, }: PolytoneNoteRemoteAddressQuery ): UseQueryOptions => ({ - queryKey: polytoneNoteQueryKeys.remoteAddress(contractAddress, args), + queryKey: polytoneNoteQueryKeys.remoteAddress( + chainId, + contractAddress, + args + ), queryFn: async () => { try { return await queryClient.fetchQuery( diff --git a/packages/state/query/queries/contracts/PolytoneProxy.ts b/packages/state/query/queries/contracts/PolytoneProxy.ts index 66b232c76..d19a2c839 100644 --- a/packages/state/query/queries/contracts/PolytoneProxy.ts +++ b/packages/state/query/queries/contracts/PolytoneProxy.ts @@ -12,17 +12,22 @@ export const polytoneProxyQueryKeys = { contract: 'polytoneProxy', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...polytoneProxyQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - instantiator: (contractAddress: string, args?: Record) => + instantiator: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...polytoneProxyQueryKeys.address(contractAddress)[0], + ...polytoneProxyQueryKeys.address(chainId, contractAddress)[0], method: 'instantiator', ...(args && { args }), }, @@ -33,7 +38,7 @@ export const polytoneProxyQueries = { queryClient: QueryClient, { chainId, contractAddress, options }: PolytoneProxyInstantiatorQuery ): UseQueryOptions => ({ - queryKey: polytoneProxyQueryKeys.instantiator(contractAddress), + queryKey: polytoneProxyQueryKeys.instantiator(chainId, contractAddress), queryFn: async () => { let indexerNonExistent = false try { diff --git a/packages/state/query/queries/contracts/PolytoneVoice.ts b/packages/state/query/queries/contracts/PolytoneVoice.ts index 0ebd17f50..5dab50a98 100644 --- a/packages/state/query/queries/contracts/PolytoneVoice.ts +++ b/packages/state/query/queries/contracts/PolytoneVoice.ts @@ -12,20 +12,22 @@ export const polytoneVoiceQueryKeys = { contract: 'polytoneVoice', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...polytoneVoiceQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, senderInfoForProxy: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...polytoneVoiceQueryKeys.address(contractAddress)[0], + ...polytoneVoiceQueryKeys.address(chainId, contractAddress)[0], method: 'sender_info_for_proxy', ...(args && { args }), }, @@ -41,7 +43,11 @@ export const polytoneVoiceQueries = { options, }: PolytoneVoiceSenderInfoForProxyQuery ): UseQueryOptions => ({ - queryKey: polytoneVoiceQueryKeys.senderInfoForProxy(contractAddress, args), + queryKey: polytoneVoiceQueryKeys.senderInfoForProxy( + chainId, + contractAddress, + args + ), queryFn: async () => { let indexerNonExistent = false try { diff --git a/packages/state/query/queries/contracts/SecretDaoDaoCore.ts b/packages/state/query/queries/contracts/SecretDaoDaoCore.ts index 59d10b5fe..c6549653a 100644 --- a/packages/state/query/queries/contracts/SecretDaoDaoCore.ts +++ b/packages/state/query/queries/contracts/SecretDaoDaoCore.ts @@ -36,173 +36,238 @@ export const secretDaoDaoCoreQueryKeys = { contract: 'secretDaoDaoCore', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...secretDaoDaoCoreQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - admin: (contractAddress: string, args?: Record) => + admin: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoDaoCoreQueryKeys.address(contractAddress)[0], + ...secretDaoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'admin', args, }, ] as const, - adminNomination: (contractAddress: string, args?: Record) => + adminNomination: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoDaoCoreQueryKeys.address(contractAddress)[0], + ...secretDaoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'admin_nomination', args, }, ] as const, - config: (contractAddress: string, args?: Record) => + config: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoDaoCoreQueryKeys.address(contractAddress)[0], + ...secretDaoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'config', args, }, ] as const, - cw20Balances: (contractAddress: string, args?: Record) => + cw20Balances: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoDaoCoreQueryKeys.address(contractAddress)[0], + ...secretDaoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'cw20_balances', args, }, ] as const, - cw20TokenList: (contractAddress: string, args?: Record) => + cw20TokenList: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoDaoCoreQueryKeys.address(contractAddress)[0], + ...secretDaoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'cw20_token_list', args, }, ] as const, - cw721TokenList: (contractAddress: string, args?: Record) => + cw721TokenList: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoDaoCoreQueryKeys.address(contractAddress)[0], + ...secretDaoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'cw721_token_list', args, }, ] as const, - dumpState: (contractAddress: string, args?: Record) => + dumpState: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoDaoCoreQueryKeys.address(contractAddress)[0], + ...secretDaoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'dump_state', args, }, ] as const, - getItem: (contractAddress: string, args?: Record) => + getItem: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoDaoCoreQueryKeys.address(contractAddress)[0], + ...secretDaoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'get_item', args, }, ] as const, - listItems: (contractAddress: string, args?: Record) => + listItems: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoDaoCoreQueryKeys.address(contractAddress)[0], + ...secretDaoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'list_items', args, }, ] as const, - info: (contractAddress: string, args?: Record) => + info: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoDaoCoreQueryKeys.address(contractAddress)[0], + ...secretDaoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'info', args, }, ] as const, - proposalModules: (contractAddress: string, args?: Record) => + proposalModules: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoDaoCoreQueryKeys.address(contractAddress)[0], + ...secretDaoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'proposal_modules', args, }, ] as const, activeProposalModules: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...secretDaoDaoCoreQueryKeys.address(contractAddress)[0], + ...secretDaoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'active_proposal_modules', args, }, ] as const, proposalModuleCount: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...secretDaoDaoCoreQueryKeys.address(contractAddress)[0], + ...secretDaoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'proposal_module_count', args, }, ] as const, - pauseInfo: (contractAddress: string, args?: Record) => + pauseInfo: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoDaoCoreQueryKeys.address(contractAddress)[0], + ...secretDaoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'pause_info', args, }, ] as const, - votingModule: (contractAddress: string, args?: Record) => + votingModule: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoDaoCoreQueryKeys.address(contractAddress)[0], + ...secretDaoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'voting_module', args, }, ] as const, - listSubDaos: (contractAddress: string, args?: Record) => + listSubDaos: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoDaoCoreQueryKeys.address(contractAddress)[0], + ...secretDaoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'list_sub_daos', args, }, ] as const, - daoURI: (contractAddress: string, args?: Record) => + daoURI: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoDaoCoreQueryKeys.address(contractAddress)[0], + ...secretDaoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'dao_u_r_i', args, }, ] as const, votingPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...secretDaoDaoCoreQueryKeys.address(contractAddress)[0], + ...secretDaoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'voting_power_at_height', args, }, ] as const, totalPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...secretDaoDaoCoreQueryKeys.address(contractAddress)[0], + ...secretDaoDaoCoreQueryKeys.address(chainId, contractAddress)[0], method: 'total_power_at_height', args, }, @@ -218,7 +283,7 @@ export const secretDaoDaoCoreQueries = { Error, TData > => ({ - queryKey: secretDaoDaoCoreQueryKeys.admin(contractAddress), + queryKey: secretDaoDaoCoreQueryKeys.admin(chainId, contractAddress), queryFn: async () => new SecretDaoDaoCoreQueryClient( await getCosmWasmClientForChainId(chainId), @@ -235,7 +300,10 @@ export const secretDaoDaoCoreQueries = { Error, TData > => ({ - queryKey: secretDaoDaoCoreQueryKeys.adminNomination(contractAddress), + queryKey: secretDaoDaoCoreQueryKeys.adminNomination( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoDaoCoreQueryClient( await getCosmWasmClientForChainId(chainId), @@ -252,7 +320,7 @@ export const secretDaoDaoCoreQueries = { Error, TData > => ({ - queryKey: secretDaoDaoCoreQueryKeys.config(contractAddress), + queryKey: secretDaoDaoCoreQueryKeys.config(chainId, contractAddress), queryFn: async () => new SecretDaoDaoCoreQueryClient( await getCosmWasmClientForChainId(chainId), @@ -270,7 +338,11 @@ export const secretDaoDaoCoreQueries = { Error, TData > => ({ - queryKey: secretDaoDaoCoreQueryKeys.cw20Balances(contractAddress, args), + queryKey: secretDaoDaoCoreQueryKeys.cw20Balances( + chainId, + contractAddress, + args + ), queryFn: async () => new SecretDaoDaoCoreQueryClient( await getCosmWasmClientForChainId(chainId), @@ -291,7 +363,11 @@ export const secretDaoDaoCoreQueries = { Error, TData > => ({ - queryKey: secretDaoDaoCoreQueryKeys.cw20TokenList(contractAddress, args), + queryKey: secretDaoDaoCoreQueryKeys.cw20TokenList( + chainId, + contractAddress, + args + ), queryFn: async () => new SecretDaoDaoCoreQueryClient( await getCosmWasmClientForChainId(chainId), @@ -312,7 +388,11 @@ export const secretDaoDaoCoreQueries = { Error, TData > => ({ - queryKey: secretDaoDaoCoreQueryKeys.cw721TokenList(contractAddress, args), + queryKey: secretDaoDaoCoreQueryKeys.cw721TokenList( + chainId, + contractAddress, + args + ), queryFn: async () => new SecretDaoDaoCoreQueryClient( await getCosmWasmClientForChainId(chainId), @@ -332,7 +412,7 @@ export const secretDaoDaoCoreQueries = { Error, TData > => ({ - queryKey: secretDaoDaoCoreQueryKeys.dumpState(contractAddress), + queryKey: secretDaoDaoCoreQueryKeys.dumpState(chainId, contractAddress), queryFn: async () => new SecretDaoDaoCoreQueryClient( await getCosmWasmClientForChainId(chainId), @@ -350,7 +430,7 @@ export const secretDaoDaoCoreQueries = { Error, TData > => ({ - queryKey: secretDaoDaoCoreQueryKeys.getItem(contractAddress, args), + queryKey: secretDaoDaoCoreQueryKeys.getItem(chainId, contractAddress, args), queryFn: async () => new SecretDaoDaoCoreQueryClient( await getCosmWasmClientForChainId(chainId), @@ -370,7 +450,11 @@ export const secretDaoDaoCoreQueries = { Error, TData > => ({ - queryKey: secretDaoDaoCoreQueryKeys.listItems(contractAddress, args), + queryKey: secretDaoDaoCoreQueryKeys.listItems( + chainId, + contractAddress, + args + ), queryFn: async () => new SecretDaoDaoCoreQueryClient( await getCosmWasmClientForChainId(chainId), @@ -390,7 +474,7 @@ export const secretDaoDaoCoreQueries = { Error, TData > => ({ - queryKey: secretDaoDaoCoreQueryKeys.info(contractAddress), + queryKey: secretDaoDaoCoreQueryKeys.info(chainId, contractAddress), queryFn: async () => new SecretDaoDaoCoreQueryClient( await getCosmWasmClientForChainId(chainId), @@ -408,7 +492,11 @@ export const secretDaoDaoCoreQueries = { Error, TData > => ({ - queryKey: secretDaoDaoCoreQueryKeys.proposalModules(contractAddress, args), + queryKey: secretDaoDaoCoreQueryKeys.proposalModules( + chainId, + contractAddress, + args + ), queryFn: async () => new SecretDaoDaoCoreQueryClient( await getCosmWasmClientForChainId(chainId), @@ -430,6 +518,7 @@ export const secretDaoDaoCoreQueries = { TData > => ({ queryKey: secretDaoDaoCoreQueryKeys.activeProposalModules( + chainId, contractAddress, args ), @@ -452,7 +541,10 @@ export const secretDaoDaoCoreQueries = { Error, TData > => ({ - queryKey: secretDaoDaoCoreQueryKeys.proposalModuleCount(contractAddress), + queryKey: secretDaoDaoCoreQueryKeys.proposalModuleCount( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoDaoCoreQueryClient( await getCosmWasmClientForChainId(chainId), @@ -469,7 +561,7 @@ export const secretDaoDaoCoreQueries = { Error, TData > => ({ - queryKey: secretDaoDaoCoreQueryKeys.pauseInfo(contractAddress), + queryKey: secretDaoDaoCoreQueryKeys.pauseInfo(chainId, contractAddress), queryFn: async () => new SecretDaoDaoCoreQueryClient( await getCosmWasmClientForChainId(chainId), @@ -486,7 +578,7 @@ export const secretDaoDaoCoreQueries = { Error, TData > => ({ - queryKey: secretDaoDaoCoreQueryKeys.votingModule(contractAddress), + queryKey: secretDaoDaoCoreQueryKeys.votingModule(chainId, contractAddress), queryFn: async () => new SecretDaoDaoCoreQueryClient( await getCosmWasmClientForChainId(chainId), @@ -504,7 +596,11 @@ export const secretDaoDaoCoreQueries = { Error, TData > => ({ - queryKey: secretDaoDaoCoreQueryKeys.listSubDaos(contractAddress, args), + queryKey: secretDaoDaoCoreQueryKeys.listSubDaos( + chainId, + contractAddress, + args + ), queryFn: async () => new SecretDaoDaoCoreQueryClient( await getCosmWasmClientForChainId(chainId), @@ -524,7 +620,7 @@ export const secretDaoDaoCoreQueries = { Error, TData > => ({ - queryKey: secretDaoDaoCoreQueryKeys.daoURI(contractAddress), + queryKey: secretDaoDaoCoreQueryKeys.daoURI(chainId, contractAddress), queryFn: async () => new SecretDaoDaoCoreQueryClient( await getCosmWasmClientForChainId(chainId), @@ -543,6 +639,7 @@ export const secretDaoDaoCoreQueries = { TData > => ({ queryKey: secretDaoDaoCoreQueryKeys.votingPowerAtHeight( + chainId, contractAddress, args ), @@ -567,6 +664,7 @@ export const secretDaoDaoCoreQueries = { TData > => ({ queryKey: secretDaoDaoCoreQueryKeys.totalPowerAtHeight( + chainId, contractAddress, args ), diff --git a/packages/state/query/queries/contracts/SecretDaoPreProposeApprovalSingle.ts b/packages/state/query/queries/contracts/SecretDaoPreProposeApprovalSingle.ts index cef64d591..bff51e972 100644 --- a/packages/state/query/queries/contracts/SecretDaoPreProposeApprovalSingle.ts +++ b/packages/state/query/queries/contracts/SecretDaoPreProposeApprovalSingle.ts @@ -25,47 +25,68 @@ export const secretDaoPreProposeApprovalSingleQueryKeys = { contract: 'secretDaoPreProposeApprovalSingle', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...secretDaoPreProposeApprovalSingleQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - proposalModule: (contractAddress: string, args?: Record) => + proposalModule: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { ...secretDaoPreProposeApprovalSingleQueryKeys.address( + chainId, contractAddress )[0], method: 'proposal_module', args, }, ] as const, - dao: (contractAddress: string, args?: Record) => + dao: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { ...secretDaoPreProposeApprovalSingleQueryKeys.address( + chainId, contractAddress )[0], method: 'dao', args, }, ] as const, - config: (contractAddress: string, args?: Record) => + config: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { ...secretDaoPreProposeApprovalSingleQueryKeys.address( + chainId, contractAddress )[0], method: 'config', args, }, ] as const, - depositInfo: (contractAddress: string, args?: Record) => + depositInfo: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { ...secretDaoPreProposeApprovalSingleQueryKeys.address( + chainId, contractAddress )[0], method: 'deposit_info', @@ -73,22 +94,29 @@ export const secretDaoPreProposeApprovalSingleQueryKeys = { }, ] as const, proposalSubmittedHooks: ( + chainId: string, contractAddress: string, args?: Record ) => [ { ...secretDaoPreProposeApprovalSingleQueryKeys.address( + chainId, contractAddress )[0], method: 'proposal_submitted_hooks', args, }, ] as const, - queryExtension: (contractAddress: string, args?: Record) => + queryExtension: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { ...secretDaoPreProposeApprovalSingleQueryKeys.address( + chainId, contractAddress )[0], method: 'query_extension', @@ -106,10 +134,10 @@ export const secretDaoPreProposeApprovalSingleQueries = { Error, TData > => ({ - queryKey: - secretDaoPreProposeApprovalSingleQueryKeys.proposalModule( - contractAddress - ), + queryKey: secretDaoPreProposeApprovalSingleQueryKeys.proposalModule( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoPreProposeApprovalSingleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -126,7 +154,10 @@ export const secretDaoPreProposeApprovalSingleQueries = { Error, TData > => ({ - queryKey: secretDaoPreProposeApprovalSingleQueryKeys.dao(contractAddress), + queryKey: secretDaoPreProposeApprovalSingleQueryKeys.dao( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoPreProposeApprovalSingleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -143,8 +174,10 @@ export const secretDaoPreProposeApprovalSingleQueries = { Error, TData > => ({ - queryKey: - secretDaoPreProposeApprovalSingleQueryKeys.config(contractAddress), + queryKey: secretDaoPreProposeApprovalSingleQueryKeys.config( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoPreProposeApprovalSingleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -163,6 +196,7 @@ export const secretDaoPreProposeApprovalSingleQueries = { TData > => ({ queryKey: secretDaoPreProposeApprovalSingleQueryKeys.depositInfo( + chainId, contractAddress, args ), @@ -184,10 +218,10 @@ export const secretDaoPreProposeApprovalSingleQueries = { Error, TData > => ({ - queryKey: - secretDaoPreProposeApprovalSingleQueryKeys.proposalSubmittedHooks( - contractAddress - ), + queryKey: secretDaoPreProposeApprovalSingleQueryKeys.proposalSubmittedHooks( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoPreProposeApprovalSingleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -206,6 +240,7 @@ export const secretDaoPreProposeApprovalSingleQueries = { TData > => ({ queryKey: secretDaoPreProposeApprovalSingleQueryKeys.queryExtension( + chainId, contractAddress, args ), diff --git a/packages/state/query/queries/contracts/SecretDaoPreProposeMultiple.ts b/packages/state/query/queries/contracts/SecretDaoPreProposeMultiple.ts index 1103fb5fd..ba89ecd9c 100644 --- a/packages/state/query/queries/contracts/SecretDaoPreProposeMultiple.ts +++ b/packages/state/query/queries/contracts/SecretDaoPreProposeMultiple.ts @@ -25,60 +25,100 @@ export const secretDaoPreProposeMultipleQueryKeys = { contract: 'secretDaoPreProposeMultiple', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...secretDaoPreProposeMultipleQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - proposalModule: (contractAddress: string, args?: Record) => + proposalModule: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoPreProposeMultipleQueryKeys.address(contractAddress)[0], + ...secretDaoPreProposeMultipleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'proposal_module', args, }, ] as const, - dao: (contractAddress: string, args?: Record) => + dao: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoPreProposeMultipleQueryKeys.address(contractAddress)[0], + ...secretDaoPreProposeMultipleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'dao', args, }, ] as const, - config: (contractAddress: string, args?: Record) => + config: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoPreProposeMultipleQueryKeys.address(contractAddress)[0], + ...secretDaoPreProposeMultipleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'config', args, }, ] as const, - depositInfo: (contractAddress: string, args?: Record) => + depositInfo: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoPreProposeMultipleQueryKeys.address(contractAddress)[0], + ...secretDaoPreProposeMultipleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'deposit_info', args, }, ] as const, proposalSubmittedHooks: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...secretDaoPreProposeMultipleQueryKeys.address(contractAddress)[0], + ...secretDaoPreProposeMultipleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'proposal_submitted_hooks', args, }, ] as const, - queryExtension: (contractAddress: string, args?: Record) => + queryExtension: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoPreProposeMultipleQueryKeys.address(contractAddress)[0], + ...secretDaoPreProposeMultipleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'query_extension', args, }, @@ -94,8 +134,10 @@ export const secretDaoPreProposeMultipleQueries = { Error, TData > => ({ - queryKey: - secretDaoPreProposeMultipleQueryKeys.proposalModule(contractAddress), + queryKey: secretDaoPreProposeMultipleQueryKeys.proposalModule( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoPreProposeMultipleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -112,7 +154,10 @@ export const secretDaoPreProposeMultipleQueries = { Error, TData > => ({ - queryKey: secretDaoPreProposeMultipleQueryKeys.dao(contractAddress), + queryKey: secretDaoPreProposeMultipleQueryKeys.dao( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoPreProposeMultipleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -129,7 +174,10 @@ export const secretDaoPreProposeMultipleQueries = { Error, TData > => ({ - queryKey: secretDaoPreProposeMultipleQueryKeys.config(contractAddress), + queryKey: secretDaoPreProposeMultipleQueryKeys.config( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoPreProposeMultipleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -148,6 +196,7 @@ export const secretDaoPreProposeMultipleQueries = { TData > => ({ queryKey: secretDaoPreProposeMultipleQueryKeys.depositInfo( + chainId, contractAddress, args ), @@ -169,10 +218,10 @@ export const secretDaoPreProposeMultipleQueries = { Error, TData > => ({ - queryKey: - secretDaoPreProposeMultipleQueryKeys.proposalSubmittedHooks( - contractAddress - ), + queryKey: secretDaoPreProposeMultipleQueryKeys.proposalSubmittedHooks( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoPreProposeMultipleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -191,6 +240,7 @@ export const secretDaoPreProposeMultipleQueries = { TData > => ({ queryKey: secretDaoPreProposeMultipleQueryKeys.queryExtension( + chainId, contractAddress, args ), diff --git a/packages/state/query/queries/contracts/SecretDaoPreProposeSingle.ts b/packages/state/query/queries/contracts/SecretDaoPreProposeSingle.ts index a55628ade..f6cb15607 100644 --- a/packages/state/query/queries/contracts/SecretDaoPreProposeSingle.ts +++ b/packages/state/query/queries/contracts/SecretDaoPreProposeSingle.ts @@ -25,60 +25,100 @@ export const secretDaoPreProposeSingleQueryKeys = { contract: 'secretDaoPreProposeSingle', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...secretDaoPreProposeSingleQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - proposalModule: (contractAddress: string, args?: Record) => + proposalModule: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoPreProposeSingleQueryKeys.address(contractAddress)[0], + ...secretDaoPreProposeSingleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'proposal_module', args, }, ] as const, - dao: (contractAddress: string, args?: Record) => + dao: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoPreProposeSingleQueryKeys.address(contractAddress)[0], + ...secretDaoPreProposeSingleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'dao', args, }, ] as const, - config: (contractAddress: string, args?: Record) => + config: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoPreProposeSingleQueryKeys.address(contractAddress)[0], + ...secretDaoPreProposeSingleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'config', args, }, ] as const, - depositInfo: (contractAddress: string, args?: Record) => + depositInfo: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoPreProposeSingleQueryKeys.address(contractAddress)[0], + ...secretDaoPreProposeSingleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'deposit_info', args, }, ] as const, proposalSubmittedHooks: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...secretDaoPreProposeSingleQueryKeys.address(contractAddress)[0], + ...secretDaoPreProposeSingleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'proposal_submitted_hooks', args, }, ] as const, - queryExtension: (contractAddress: string, args?: Record) => + queryExtension: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoPreProposeSingleQueryKeys.address(contractAddress)[0], + ...secretDaoPreProposeSingleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'query_extension', args, }, @@ -94,8 +134,10 @@ export const secretDaoPreProposeSingleQueries = { Error, TData > => ({ - queryKey: - secretDaoPreProposeSingleQueryKeys.proposalModule(contractAddress), + queryKey: secretDaoPreProposeSingleQueryKeys.proposalModule( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoPreProposeSingleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -112,7 +154,7 @@ export const secretDaoPreProposeSingleQueries = { Error, TData > => ({ - queryKey: secretDaoPreProposeSingleQueryKeys.dao(contractAddress), + queryKey: secretDaoPreProposeSingleQueryKeys.dao(chainId, contractAddress), queryFn: async () => new SecretDaoPreProposeSingleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -129,7 +171,10 @@ export const secretDaoPreProposeSingleQueries = { Error, TData > => ({ - queryKey: secretDaoPreProposeSingleQueryKeys.config(contractAddress), + queryKey: secretDaoPreProposeSingleQueryKeys.config( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoPreProposeSingleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -148,6 +193,7 @@ export const secretDaoPreProposeSingleQueries = { TData > => ({ queryKey: secretDaoPreProposeSingleQueryKeys.depositInfo( + chainId, contractAddress, args ), @@ -169,10 +215,10 @@ export const secretDaoPreProposeSingleQueries = { Error, TData > => ({ - queryKey: - secretDaoPreProposeSingleQueryKeys.proposalSubmittedHooks( - contractAddress - ), + queryKey: secretDaoPreProposeSingleQueryKeys.proposalSubmittedHooks( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoPreProposeSingleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -191,6 +237,7 @@ export const secretDaoPreProposeSingleQueries = { TData > => ({ queryKey: secretDaoPreProposeSingleQueryKeys.queryExtension( + chainId, contractAddress, args ), diff --git a/packages/state/query/queries/contracts/SecretDaoProposalMultiple.ts b/packages/state/query/queries/contracts/SecretDaoProposalMultiple.ts index 60f4ba27d..401808cfe 100644 --- a/packages/state/query/queries/contracts/SecretDaoProposalMultiple.ts +++ b/packages/state/query/queries/contracts/SecretDaoProposalMultiple.ts @@ -29,116 +29,205 @@ export const secretDaoProposalMultipleQueryKeys = { contract: 'secretDaoProposalMultiple', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...secretDaoProposalMultipleQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - config: (contractAddress: string, args?: Record) => + config: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalMultipleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalMultipleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'config', args, }, ] as const, - proposal: (contractAddress: string, args?: Record) => + proposal: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalMultipleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalMultipleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'proposal', args, }, ] as const, - listProposals: (contractAddress: string, args?: Record) => + listProposals: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalMultipleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalMultipleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'list_proposals', args, }, ] as const, - reverseProposals: (contractAddress: string, args?: Record) => + reverseProposals: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalMultipleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalMultipleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'reverse_proposals', args, }, ] as const, - getVote: (contractAddress: string, args?: Record) => + getVote: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalMultipleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalMultipleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'get_vote', args, }, ] as const, - listVotes: (contractAddress: string, args?: Record) => + listVotes: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalMultipleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalMultipleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'list_votes', args, }, ] as const, - proposalCount: (contractAddress: string, args?: Record) => + proposalCount: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalMultipleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalMultipleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'proposal_count', args, }, ] as const, proposalCreationPolicy: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...secretDaoProposalMultipleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalMultipleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'proposal_creation_policy', args, }, ] as const, - proposalHooks: (contractAddress: string, args?: Record) => + proposalHooks: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalMultipleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalMultipleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'proposal_hooks', args, }, ] as const, - voteHooks: (contractAddress: string, args?: Record) => + voteHooks: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalMultipleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalMultipleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'vote_hooks', args, }, ] as const, - dao: (contractAddress: string, args?: Record) => + dao: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalMultipleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalMultipleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'dao', args, }, ] as const, - info: (contractAddress: string, args?: Record) => + info: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalMultipleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalMultipleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'info', args, }, ] as const, - nextProposalId: (contractAddress: string, args?: Record) => + nextProposalId: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalMultipleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalMultipleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'next_proposal_id', args, }, @@ -154,7 +243,10 @@ export const secretDaoProposalMultipleQueries = { Error, TData > => ({ - queryKey: secretDaoProposalMultipleQueryKeys.config(contractAddress), + queryKey: secretDaoProposalMultipleQueryKeys.config( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoProposalMultipleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -173,6 +265,7 @@ export const secretDaoProposalMultipleQueries = { TData > => ({ queryKey: secretDaoProposalMultipleQueryKeys.proposal( + chainId, contractAddress, args ), @@ -196,6 +289,7 @@ export const secretDaoProposalMultipleQueries = { TData > => ({ queryKey: secretDaoProposalMultipleQueryKeys.listProposals( + chainId, contractAddress, args ), @@ -220,6 +314,7 @@ export const secretDaoProposalMultipleQueries = { TData > => ({ queryKey: secretDaoProposalMultipleQueryKeys.reverseProposals( + chainId, contractAddress, args ), @@ -243,7 +338,11 @@ export const secretDaoProposalMultipleQueries = { Error, TData > => ({ - queryKey: secretDaoProposalMultipleQueryKeys.getVote(contractAddress, args), + queryKey: secretDaoProposalMultipleQueryKeys.getVote( + chainId, + contractAddress, + args + ), queryFn: async () => new SecretDaoProposalMultipleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -265,6 +364,7 @@ export const secretDaoProposalMultipleQueries = { TData > => ({ queryKey: secretDaoProposalMultipleQueryKeys.listVotes( + chainId, contractAddress, args ), @@ -288,7 +388,10 @@ export const secretDaoProposalMultipleQueries = { Error, TData > => ({ - queryKey: secretDaoProposalMultipleQueryKeys.proposalCount(contractAddress), + queryKey: secretDaoProposalMultipleQueryKeys.proposalCount( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoProposalMultipleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -305,10 +408,10 @@ export const secretDaoProposalMultipleQueries = { Error, TData > => ({ - queryKey: - secretDaoProposalMultipleQueryKeys.proposalCreationPolicy( - contractAddress - ), + queryKey: secretDaoProposalMultipleQueryKeys.proposalCreationPolicy( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoProposalMultipleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -325,7 +428,10 @@ export const secretDaoProposalMultipleQueries = { Error, TData > => ({ - queryKey: secretDaoProposalMultipleQueryKeys.proposalHooks(contractAddress), + queryKey: secretDaoProposalMultipleQueryKeys.proposalHooks( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoProposalMultipleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -342,7 +448,10 @@ export const secretDaoProposalMultipleQueries = { Error, TData > => ({ - queryKey: secretDaoProposalMultipleQueryKeys.voteHooks(contractAddress), + queryKey: secretDaoProposalMultipleQueryKeys.voteHooks( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoProposalMultipleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -359,7 +468,7 @@ export const secretDaoProposalMultipleQueries = { Error, TData > => ({ - queryKey: secretDaoProposalMultipleQueryKeys.dao(contractAddress), + queryKey: secretDaoProposalMultipleQueryKeys.dao(chainId, contractAddress), queryFn: async () => new SecretDaoProposalMultipleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -376,7 +485,7 @@ export const secretDaoProposalMultipleQueries = { Error, TData > => ({ - queryKey: secretDaoProposalMultipleQueryKeys.info(contractAddress), + queryKey: secretDaoProposalMultipleQueryKeys.info(chainId, contractAddress), queryFn: async () => new SecretDaoProposalMultipleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -393,8 +502,10 @@ export const secretDaoProposalMultipleQueries = { Error, TData > => ({ - queryKey: - secretDaoProposalMultipleQueryKeys.nextProposalId(contractAddress), + queryKey: secretDaoProposalMultipleQueryKeys.nextProposalId( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoProposalMultipleQueryClient( await getCosmWasmClientForChainId(chainId), diff --git a/packages/state/query/queries/contracts/SecretDaoProposalSingle.ts b/packages/state/query/queries/contracts/SecretDaoProposalSingle.ts index de7452da8..5830b3e63 100644 --- a/packages/state/query/queries/contracts/SecretDaoProposalSingle.ts +++ b/packages/state/query/queries/contracts/SecretDaoProposalSingle.ts @@ -29,116 +29,205 @@ export const secretDaoProposalSingleQueryKeys = { contract: 'secretDaoProposalSingle', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...secretDaoProposalSingleQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - config: (contractAddress: string, args?: Record) => + config: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalSingleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalSingleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'config', args, }, ] as const, - proposal: (contractAddress: string, args?: Record) => + proposal: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalSingleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalSingleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'proposal', args, }, ] as const, - listProposals: (contractAddress: string, args?: Record) => + listProposals: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalSingleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalSingleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'list_proposals', args, }, ] as const, - reverseProposals: (contractAddress: string, args?: Record) => + reverseProposals: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalSingleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalSingleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'reverse_proposals', args, }, ] as const, - getVote: (contractAddress: string, args?: Record) => + getVote: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalSingleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalSingleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'get_vote', args, }, ] as const, - listVotes: (contractAddress: string, args?: Record) => + listVotes: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalSingleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalSingleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'list_votes', args, }, ] as const, - proposalCount: (contractAddress: string, args?: Record) => + proposalCount: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalSingleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalSingleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'proposal_count', args, }, ] as const, proposalCreationPolicy: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...secretDaoProposalSingleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalSingleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'proposal_creation_policy', args, }, ] as const, - proposalHooks: (contractAddress: string, args?: Record) => + proposalHooks: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalSingleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalSingleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'proposal_hooks', args, }, ] as const, - voteHooks: (contractAddress: string, args?: Record) => + voteHooks: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalSingleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalSingleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'vote_hooks', args, }, ] as const, - dao: (contractAddress: string, args?: Record) => + dao: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalSingleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalSingleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'dao', args, }, ] as const, - info: (contractAddress: string, args?: Record) => + info: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalSingleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalSingleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'info', args, }, ] as const, - nextProposalId: (contractAddress: string, args?: Record) => + nextProposalId: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoProposalSingleQueryKeys.address(contractAddress)[0], + ...secretDaoProposalSingleQueryKeys.address( + chainId, + contractAddress + )[0], method: 'next_proposal_id', args, }, @@ -154,7 +243,7 @@ export const secretDaoProposalSingleQueries = { Error, TData > => ({ - queryKey: secretDaoProposalSingleQueryKeys.config(contractAddress), + queryKey: secretDaoProposalSingleQueryKeys.config(chainId, contractAddress), queryFn: async () => new SecretDaoProposalSingleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -172,7 +261,11 @@ export const secretDaoProposalSingleQueries = { Error, TData > => ({ - queryKey: secretDaoProposalSingleQueryKeys.proposal(contractAddress, args), + queryKey: secretDaoProposalSingleQueryKeys.proposal( + chainId, + contractAddress, + args + ), queryFn: async () => new SecretDaoProposalSingleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -193,6 +286,7 @@ export const secretDaoProposalSingleQueries = { TData > => ({ queryKey: secretDaoProposalSingleQueryKeys.listProposals( + chainId, contractAddress, args ), @@ -217,6 +311,7 @@ export const secretDaoProposalSingleQueries = { TData > => ({ queryKey: secretDaoProposalSingleQueryKeys.reverseProposals( + chainId, contractAddress, args ), @@ -240,7 +335,11 @@ export const secretDaoProposalSingleQueries = { Error, TData > => ({ - queryKey: secretDaoProposalSingleQueryKeys.getVote(contractAddress, args), + queryKey: secretDaoProposalSingleQueryKeys.getVote( + chainId, + contractAddress, + args + ), queryFn: async () => new SecretDaoProposalSingleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -261,7 +360,11 @@ export const secretDaoProposalSingleQueries = { Error, TData > => ({ - queryKey: secretDaoProposalSingleQueryKeys.listVotes(contractAddress, args), + queryKey: secretDaoProposalSingleQueryKeys.listVotes( + chainId, + contractAddress, + args + ), queryFn: async () => new SecretDaoProposalSingleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -282,7 +385,10 @@ export const secretDaoProposalSingleQueries = { Error, TData > => ({ - queryKey: secretDaoProposalSingleQueryKeys.proposalCount(contractAddress), + queryKey: secretDaoProposalSingleQueryKeys.proposalCount( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoProposalSingleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -299,8 +405,10 @@ export const secretDaoProposalSingleQueries = { Error, TData > => ({ - queryKey: - secretDaoProposalSingleQueryKeys.proposalCreationPolicy(contractAddress), + queryKey: secretDaoProposalSingleQueryKeys.proposalCreationPolicy( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoProposalSingleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -317,7 +425,10 @@ export const secretDaoProposalSingleQueries = { Error, TData > => ({ - queryKey: secretDaoProposalSingleQueryKeys.proposalHooks(contractAddress), + queryKey: secretDaoProposalSingleQueryKeys.proposalHooks( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoProposalSingleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -334,7 +445,10 @@ export const secretDaoProposalSingleQueries = { Error, TData > => ({ - queryKey: secretDaoProposalSingleQueryKeys.voteHooks(contractAddress), + queryKey: secretDaoProposalSingleQueryKeys.voteHooks( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoProposalSingleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -351,7 +465,7 @@ export const secretDaoProposalSingleQueries = { Error, TData > => ({ - queryKey: secretDaoProposalSingleQueryKeys.dao(contractAddress), + queryKey: secretDaoProposalSingleQueryKeys.dao(chainId, contractAddress), queryFn: async () => new SecretDaoProposalSingleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -368,7 +482,7 @@ export const secretDaoProposalSingleQueries = { Error, TData > => ({ - queryKey: secretDaoProposalSingleQueryKeys.info(contractAddress), + queryKey: secretDaoProposalSingleQueryKeys.info(chainId, contractAddress), queryFn: async () => new SecretDaoProposalSingleQueryClient( await getCosmWasmClientForChainId(chainId), @@ -385,7 +499,10 @@ export const secretDaoProposalSingleQueries = { Error, TData > => ({ - queryKey: secretDaoProposalSingleQueryKeys.nextProposalId(contractAddress), + queryKey: secretDaoProposalSingleQueryKeys.nextProposalId( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoProposalSingleQueryClient( await getCosmWasmClientForChainId(chainId), diff --git a/packages/state/query/queries/contracts/SecretDaoVotingCw4.ts b/packages/state/query/queries/contracts/SecretDaoVotingCw4.ts index c023843fd..e4c30eea9 100644 --- a/packages/state/query/queries/contracts/SecretDaoVotingCw4.ts +++ b/packages/state/query/queries/contracts/SecretDaoVotingCw4.ts @@ -23,55 +23,70 @@ export const secretDaoVotingCw4QueryKeys = { contract: 'secretDaoVotingCw4', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...secretDaoVotingCw4QueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - groupContract: (contractAddress: string, args?: Record) => + groupContract: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingCw4QueryKeys.address(contractAddress)[0], + ...secretDaoVotingCw4QueryKeys.address(chainId, contractAddress)[0], method: 'group_contract', args, }, ] as const, votingPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...secretDaoVotingCw4QueryKeys.address(contractAddress)[0], + ...secretDaoVotingCw4QueryKeys.address(chainId, contractAddress)[0], method: 'voting_power_at_height', args, }, ] as const, totalPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...secretDaoVotingCw4QueryKeys.address(contractAddress)[0], + ...secretDaoVotingCw4QueryKeys.address(chainId, contractAddress)[0], method: 'total_power_at_height', args, }, ] as const, - dao: (contractAddress: string, args?: Record) => + dao: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingCw4QueryKeys.address(contractAddress)[0], + ...secretDaoVotingCw4QueryKeys.address(chainId, contractAddress)[0], method: 'dao', args, }, ] as const, - info: (contractAddress: string, args?: Record) => + info: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingCw4QueryKeys.address(contractAddress)[0], + ...secretDaoVotingCw4QueryKeys.address(chainId, contractAddress)[0], method: 'info', args, }, @@ -87,7 +102,10 @@ export const secretDaoVotingCw4Queries = { Error, TData > => ({ - queryKey: secretDaoVotingCw4QueryKeys.groupContract(contractAddress), + queryKey: secretDaoVotingCw4QueryKeys.groupContract( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoVotingCw4QueryClient( await getCosmWasmClientForChainId(chainId), @@ -106,6 +124,7 @@ export const secretDaoVotingCw4Queries = { TData > => ({ queryKey: secretDaoVotingCw4QueryKeys.votingPowerAtHeight( + chainId, contractAddress, args ), @@ -130,6 +149,7 @@ export const secretDaoVotingCw4Queries = { TData > => ({ queryKey: secretDaoVotingCw4QueryKeys.totalPowerAtHeight( + chainId, contractAddress, args ), @@ -151,7 +171,7 @@ export const secretDaoVotingCw4Queries = { Error, TData > => ({ - queryKey: secretDaoVotingCw4QueryKeys.dao(contractAddress), + queryKey: secretDaoVotingCw4QueryKeys.dao(chainId, contractAddress), queryFn: async () => new SecretDaoVotingCw4QueryClient( await getCosmWasmClientForChainId(chainId), @@ -168,7 +188,7 @@ export const secretDaoVotingCw4Queries = { Error, TData > => ({ - queryKey: secretDaoVotingCw4QueryKeys.info(contractAddress), + queryKey: secretDaoVotingCw4QueryKeys.info(chainId, contractAddress), queryFn: async () => new SecretDaoVotingCw4QueryClient( await getCosmWasmClientForChainId(chainId), diff --git a/packages/state/query/queries/contracts/SecretDaoVotingSnip20Staked.ts b/packages/state/query/queries/contracts/SecretDaoVotingSnip20Staked.ts index ef125d679..ce3a54c9e 100644 --- a/packages/state/query/queries/contracts/SecretDaoVotingSnip20Staked.ts +++ b/packages/state/query/queries/contracts/SecretDaoVotingSnip20Staked.ts @@ -25,79 +25,130 @@ export const secretDaoVotingSnip20StakedQueryKeys = { contract: 'secretDaoVotingSnip20Staked', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...secretDaoVotingSnip20StakedQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - stakingContract: (contractAddress: string, args?: Record) => + stakingContract: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingSnip20StakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingSnip20StakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'staking_contract', args, }, ] as const, - activeThreshold: (contractAddress: string, args?: Record) => + activeThreshold: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingSnip20StakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingSnip20StakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'active_threshold', args, }, ] as const, votingPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...secretDaoVotingSnip20StakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingSnip20StakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'voting_power_at_height', args, }, ] as const, totalPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...secretDaoVotingSnip20StakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingSnip20StakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'total_power_at_height', args, }, ] as const, - dao: (contractAddress: string, args?: Record) => + dao: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingSnip20StakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingSnip20StakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'dao', args, }, ] as const, - info: (contractAddress: string, args?: Record) => + info: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingSnip20StakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingSnip20StakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'info', args, }, ] as const, - tokenContract: (contractAddress: string, args?: Record) => + tokenContract: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingSnip20StakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingSnip20StakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'token_contract', args, }, ] as const, - isActive: (contractAddress: string, args?: Record) => + isActive: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingSnip20StakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingSnip20StakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'is_active', args, }, @@ -113,8 +164,10 @@ export const secretDaoVotingSnip20StakedQueries = { Error, TData > => ({ - queryKey: - secretDaoVotingSnip20StakedQueryKeys.stakingContract(contractAddress), + queryKey: secretDaoVotingSnip20StakedQueryKeys.stakingContract( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoVotingSnip20StakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -131,8 +184,10 @@ export const secretDaoVotingSnip20StakedQueries = { Error, TData > => ({ - queryKey: - secretDaoVotingSnip20StakedQueryKeys.activeThreshold(contractAddress), + queryKey: secretDaoVotingSnip20StakedQueryKeys.activeThreshold( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoVotingSnip20StakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -151,6 +206,7 @@ export const secretDaoVotingSnip20StakedQueries = { TData > => ({ queryKey: secretDaoVotingSnip20StakedQueryKeys.votingPowerAtHeight( + chainId, contractAddress, args ), @@ -175,6 +231,7 @@ export const secretDaoVotingSnip20StakedQueries = { TData > => ({ queryKey: secretDaoVotingSnip20StakedQueryKeys.totalPowerAtHeight( + chainId, contractAddress, args ), @@ -196,7 +253,10 @@ export const secretDaoVotingSnip20StakedQueries = { Error, TData > => ({ - queryKey: secretDaoVotingSnip20StakedQueryKeys.dao(contractAddress), + queryKey: secretDaoVotingSnip20StakedQueryKeys.dao( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoVotingSnip20StakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -213,7 +273,10 @@ export const secretDaoVotingSnip20StakedQueries = { Error, TData > => ({ - queryKey: secretDaoVotingSnip20StakedQueryKeys.info(contractAddress), + queryKey: secretDaoVotingSnip20StakedQueryKeys.info( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoVotingSnip20StakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -230,8 +293,10 @@ export const secretDaoVotingSnip20StakedQueries = { Error, TData > => ({ - queryKey: - secretDaoVotingSnip20StakedQueryKeys.tokenContract(contractAddress), + queryKey: secretDaoVotingSnip20StakedQueryKeys.tokenContract( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoVotingSnip20StakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -248,7 +313,10 @@ export const secretDaoVotingSnip20StakedQueries = { Error, TData > => ({ - queryKey: secretDaoVotingSnip20StakedQueryKeys.isActive(contractAddress), + queryKey: secretDaoVotingSnip20StakedQueryKeys.isActive( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoVotingSnip20StakedQueryClient( await getCosmWasmClientForChainId(chainId), diff --git a/packages/state/query/queries/contracts/SecretDaoVotingSnip721Staked.ts b/packages/state/query/queries/contracts/SecretDaoVotingSnip721Staked.ts index f9c12a368..a3dbca835 100644 --- a/packages/state/query/queries/contracts/SecretDaoVotingSnip721Staked.ts +++ b/packages/state/query/queries/contracts/SecretDaoVotingSnip721Staked.ts @@ -29,95 +29,160 @@ export const secretDaoVotingSnip721StakedQueryKeys = { contract: 'secretDaoVotingSnip721Staked', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...secretDaoVotingSnip721StakedQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - config: (contractAddress: string, args?: Record) => + config: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingSnip721StakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingSnip721StakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'config', args, }, ] as const, - nftClaims: (contractAddress: string, args?: Record) => + nftClaims: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingSnip721StakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingSnip721StakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'nft_claims', args, }, ] as const, - hooks: (contractAddress: string, args?: Record) => + hooks: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingSnip721StakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingSnip721StakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'hooks', args, }, ] as const, - stakedNfts: (contractAddress: string, args?: Record) => + stakedNfts: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingSnip721StakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingSnip721StakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'staked_nfts', args, }, ] as const, - activeThreshold: (contractAddress: string, args?: Record) => + activeThreshold: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingSnip721StakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingSnip721StakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'active_threshold', args, }, ] as const, - isActive: (contractAddress: string, args?: Record) => + isActive: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingSnip721StakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingSnip721StakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'is_active', args, }, ] as const, votingPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...secretDaoVotingSnip721StakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingSnip721StakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'voting_power_at_height', args, }, ] as const, totalPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...secretDaoVotingSnip721StakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingSnip721StakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'total_power_at_height', args, }, ] as const, - dao: (contractAddress: string, args?: Record) => + dao: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingSnip721StakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingSnip721StakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'dao', args, }, ] as const, - info: (contractAddress: string, args?: Record) => + info: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingSnip721StakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingSnip721StakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'info', args, }, @@ -133,7 +198,10 @@ export const secretDaoVotingSnip721StakedQueries = { Error, TData > => ({ - queryKey: secretDaoVotingSnip721StakedQueryKeys.config(contractAddress), + queryKey: secretDaoVotingSnip721StakedQueryKeys.config( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoVotingSnip721StakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -152,6 +220,7 @@ export const secretDaoVotingSnip721StakedQueries = { TData > => ({ queryKey: secretDaoVotingSnip721StakedQueryKeys.nftClaims( + chainId, contractAddress, args ), @@ -173,7 +242,10 @@ export const secretDaoVotingSnip721StakedQueries = { Error, TData > => ({ - queryKey: secretDaoVotingSnip721StakedQueryKeys.hooks(contractAddress), + queryKey: secretDaoVotingSnip721StakedQueryKeys.hooks( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoVotingSnip721StakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -192,6 +264,7 @@ export const secretDaoVotingSnip721StakedQueries = { TData > => ({ queryKey: secretDaoVotingSnip721StakedQueryKeys.stakedNfts( + chainId, contractAddress, args ), @@ -213,8 +286,10 @@ export const secretDaoVotingSnip721StakedQueries = { Error, TData > => ({ - queryKey: - secretDaoVotingSnip721StakedQueryKeys.activeThreshold(contractAddress), + queryKey: secretDaoVotingSnip721StakedQueryKeys.activeThreshold( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoVotingSnip721StakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -231,7 +306,10 @@ export const secretDaoVotingSnip721StakedQueries = { Error, TData > => ({ - queryKey: secretDaoVotingSnip721StakedQueryKeys.isActive(contractAddress), + queryKey: secretDaoVotingSnip721StakedQueryKeys.isActive( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoVotingSnip721StakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -250,6 +328,7 @@ export const secretDaoVotingSnip721StakedQueries = { TData > => ({ queryKey: secretDaoVotingSnip721StakedQueryKeys.votingPowerAtHeight( + chainId, contractAddress, args ), @@ -274,6 +353,7 @@ export const secretDaoVotingSnip721StakedQueries = { TData > => ({ queryKey: secretDaoVotingSnip721StakedQueryKeys.totalPowerAtHeight( + chainId, contractAddress, args ), @@ -295,7 +375,10 @@ export const secretDaoVotingSnip721StakedQueries = { Error, TData > => ({ - queryKey: secretDaoVotingSnip721StakedQueryKeys.dao(contractAddress), + queryKey: secretDaoVotingSnip721StakedQueryKeys.dao( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoVotingSnip721StakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -312,7 +395,10 @@ export const secretDaoVotingSnip721StakedQueries = { Error, TData > => ({ - queryKey: secretDaoVotingSnip721StakedQueryKeys.info(contractAddress), + queryKey: secretDaoVotingSnip721StakedQueryKeys.info( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoVotingSnip721StakedQueryClient( await getCosmWasmClientForChainId(chainId), diff --git a/packages/state/query/queries/contracts/SecretDaoVotingTokenStaked.ts b/packages/state/query/queries/contracts/SecretDaoVotingTokenStaked.ts index 40cb77721..3c04962be 100644 --- a/packages/state/query/queries/contracts/SecretDaoVotingTokenStaked.ts +++ b/packages/state/query/queries/contracts/SecretDaoVotingTokenStaked.ts @@ -31,111 +31,190 @@ export const secretDaoVotingTokenStakedQueryKeys = { contract: 'secretDaoVotingTokenStaked', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...secretDaoVotingTokenStakedQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - getConfig: (contractAddress: string, args?: Record) => + getConfig: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingTokenStakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'get_config', args, }, ] as const, - claims: (contractAddress: string, args?: Record) => + claims: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingTokenStakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'claims', args, }, ] as const, - listStakers: (contractAddress: string, args?: Record) => + listStakers: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingTokenStakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'list_stakers', args, }, ] as const, - activeThreshold: (contractAddress: string, args?: Record) => + activeThreshold: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingTokenStakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'active_threshold', args, }, ] as const, - getHooks: (contractAddress: string, args?: Record) => + getHooks: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingTokenStakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'get_hooks', args, }, ] as const, - tokenContract: (contractAddress: string, args?: Record) => + tokenContract: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingTokenStakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'token_contract', args, }, ] as const, - denom: (contractAddress: string, args?: Record) => + denom: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingTokenStakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'denom', args, }, ] as const, - isActive: (contractAddress: string, args?: Record) => + isActive: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingTokenStakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'is_active', args, }, ] as const, votingPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...secretDaoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingTokenStakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'voting_power_at_height', args, }, ] as const, totalPowerAtHeight: ( + chainId: string, contractAddress: string, args?: Record ) => [ { - ...secretDaoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingTokenStakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'total_power_at_height', args, }, ] as const, - dao: (contractAddress: string, args?: Record) => + dao: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingTokenStakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'dao', args, }, ] as const, - info: (contractAddress: string, args?: Record) => + info: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...secretDaoVotingTokenStakedQueryKeys.address(contractAddress)[0], + ...secretDaoVotingTokenStakedQueryKeys.address( + chainId, + contractAddress + )[0], method: 'info', args, }, @@ -151,7 +230,10 @@ export const secretDaoVotingTokenStakedQueries = { Error, TData > => ({ - queryKey: secretDaoVotingTokenStakedQueryKeys.getConfig(contractAddress), + queryKey: secretDaoVotingTokenStakedQueryKeys.getConfig( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoVotingTokenStakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -169,7 +251,11 @@ export const secretDaoVotingTokenStakedQueries = { Error, TData > => ({ - queryKey: secretDaoVotingTokenStakedQueryKeys.claims(contractAddress, args), + queryKey: secretDaoVotingTokenStakedQueryKeys.claims( + chainId, + contractAddress, + args + ), queryFn: async () => new SecretDaoVotingTokenStakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -190,6 +276,7 @@ export const secretDaoVotingTokenStakedQueries = { TData > => ({ queryKey: secretDaoVotingTokenStakedQueryKeys.listStakers( + chainId, contractAddress, args ), @@ -212,8 +299,10 @@ export const secretDaoVotingTokenStakedQueries = { Error, TData > => ({ - queryKey: - secretDaoVotingTokenStakedQueryKeys.activeThreshold(contractAddress), + queryKey: secretDaoVotingTokenStakedQueryKeys.activeThreshold( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoVotingTokenStakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -230,7 +319,10 @@ export const secretDaoVotingTokenStakedQueries = { Error, TData > => ({ - queryKey: secretDaoVotingTokenStakedQueryKeys.getHooks(contractAddress), + queryKey: secretDaoVotingTokenStakedQueryKeys.getHooks( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoVotingTokenStakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -247,8 +339,10 @@ export const secretDaoVotingTokenStakedQueries = { Error, TData > => ({ - queryKey: - secretDaoVotingTokenStakedQueryKeys.tokenContract(contractAddress), + queryKey: secretDaoVotingTokenStakedQueryKeys.tokenContract( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoVotingTokenStakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -265,7 +359,10 @@ export const secretDaoVotingTokenStakedQueries = { Error, TData > => ({ - queryKey: secretDaoVotingTokenStakedQueryKeys.denom(contractAddress), + queryKey: secretDaoVotingTokenStakedQueryKeys.denom( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoVotingTokenStakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -282,7 +379,10 @@ export const secretDaoVotingTokenStakedQueries = { Error, TData > => ({ - queryKey: secretDaoVotingTokenStakedQueryKeys.isActive(contractAddress), + queryKey: secretDaoVotingTokenStakedQueryKeys.isActive( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoVotingTokenStakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -301,6 +401,7 @@ export const secretDaoVotingTokenStakedQueries = { TData > => ({ queryKey: secretDaoVotingTokenStakedQueryKeys.votingPowerAtHeight( + chainId, contractAddress, args ), @@ -325,6 +426,7 @@ export const secretDaoVotingTokenStakedQueries = { TData > => ({ queryKey: secretDaoVotingTokenStakedQueryKeys.totalPowerAtHeight( + chainId, contractAddress, args ), @@ -346,7 +448,7 @@ export const secretDaoVotingTokenStakedQueries = { Error, TData > => ({ - queryKey: secretDaoVotingTokenStakedQueryKeys.dao(contractAddress), + queryKey: secretDaoVotingTokenStakedQueryKeys.dao(chainId, contractAddress), queryFn: async () => new SecretDaoVotingTokenStakedQueryClient( await getCosmWasmClientForChainId(chainId), @@ -363,7 +465,10 @@ export const secretDaoVotingTokenStakedQueries = { Error, TData > => ({ - queryKey: secretDaoVotingTokenStakedQueryKeys.info(contractAddress), + queryKey: secretDaoVotingTokenStakedQueryKeys.info( + chainId, + contractAddress + ), queryFn: async () => new SecretDaoVotingTokenStakedQueryClient( await getCosmWasmClientForChainId(chainId), diff --git a/packages/state/query/queries/contracts/ValenceRebalancer.ts b/packages/state/query/queries/contracts/ValenceRebalancer.ts index 0f8567104..36a855747 100644 --- a/packages/state/query/queries/contracts/ValenceRebalancer.ts +++ b/packages/state/query/queries/contracts/ValenceRebalancer.ts @@ -27,73 +27,106 @@ export const valenceRebalancerQueryKeys = { contract: 'valenceRebalancer', }, ] as const, - address: (contractAddress: string) => + address: (chainId: string, contractAddress: string) => [ { ...valenceRebalancerQueryKeys.contract[0], + chainId, address: contractAddress, }, ] as const, - getConfig: (contractAddress: string, args?: Record) => + getConfig: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...valenceRebalancerQueryKeys.address(contractAddress)[0], + ...valenceRebalancerQueryKeys.address(chainId, contractAddress)[0], method: 'get_config', args, }, ] as const, - getAllConfigs: (contractAddress: string, args?: Record) => + getAllConfigs: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...valenceRebalancerQueryKeys.address(contractAddress)[0], + ...valenceRebalancerQueryKeys.address(chainId, contractAddress)[0], method: 'get_all_configs', args, }, ] as const, - getPausedConfig: (contractAddress: string, args?: Record) => + getPausedConfig: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...valenceRebalancerQueryKeys.address(contractAddress)[0], + ...valenceRebalancerQueryKeys.address(chainId, contractAddress)[0], method: 'get_paused_config', args, }, ] as const, - getSystemStatus: (contractAddress: string, args?: Record) => + getSystemStatus: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...valenceRebalancerQueryKeys.address(contractAddress)[0], + ...valenceRebalancerQueryKeys.address(chainId, contractAddress)[0], method: 'get_system_status', args, }, ] as const, - getServiceFee: (contractAddress: string, args?: Record) => + getServiceFee: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...valenceRebalancerQueryKeys.address(contractAddress)[0], + ...valenceRebalancerQueryKeys.address(chainId, contractAddress)[0], method: 'get_service_fee', args, }, ] as const, - getWhiteLists: (contractAddress: string, args?: Record) => + getWhiteLists: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...valenceRebalancerQueryKeys.address(contractAddress)[0], + ...valenceRebalancerQueryKeys.address(chainId, contractAddress)[0], method: 'get_white_lists', args, }, ] as const, - getManagersAddrs: (contractAddress: string, args?: Record) => + getManagersAddrs: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...valenceRebalancerQueryKeys.address(contractAddress)[0], + ...valenceRebalancerQueryKeys.address(chainId, contractAddress)[0], method: 'get_managers_addrs', args, }, ] as const, - getAdmin: (contractAddress: string, args?: Record) => + getAdmin: ( + chainId: string, + contractAddress: string, + args?: Record + ) => [ { - ...valenceRebalancerQueryKeys.address(contractAddress)[0], + ...valenceRebalancerQueryKeys.address(chainId, contractAddress)[0], method: 'get_admin', args, }, @@ -110,7 +143,11 @@ export const valenceRebalancerQueries = { Error, TData > => ({ - queryKey: valenceRebalancerQueryKeys.getConfig(contractAddress, args), + queryKey: valenceRebalancerQueryKeys.getConfig( + chainId, + contractAddress, + args + ), queryFn: async () => { return new ValenceRebalancerQueryClient( await getCosmWasmClientForChainId(chainId), @@ -131,7 +168,11 @@ export const valenceRebalancerQueries = { Error, TData > => ({ - queryKey: valenceRebalancerQueryKeys.getAllConfigs(contractAddress, args), + queryKey: valenceRebalancerQueryKeys.getAllConfigs( + chainId, + contractAddress, + args + ), queryFn: async () => { return new ValenceRebalancerQueryClient( await getCosmWasmClientForChainId(chainId), @@ -153,7 +194,11 @@ export const valenceRebalancerQueries = { Error, TData > => ({ - queryKey: valenceRebalancerQueryKeys.getPausedConfig(contractAddress, args), + queryKey: valenceRebalancerQueryKeys.getPausedConfig( + chainId, + contractAddress, + args + ), queryFn: async () => { return new ValenceRebalancerQueryClient( await getCosmWasmClientForChainId(chainId), @@ -173,7 +218,10 @@ export const valenceRebalancerQueries = { Error, TData > => ({ - queryKey: valenceRebalancerQueryKeys.getSystemStatus(contractAddress), + queryKey: valenceRebalancerQueryKeys.getSystemStatus( + chainId, + contractAddress + ), queryFn: async () => { return new ValenceRebalancerQueryClient( await getCosmWasmClientForChainId(chainId), @@ -192,7 +240,11 @@ export const valenceRebalancerQueries = { Error, TData > => ({ - queryKey: valenceRebalancerQueryKeys.getServiceFee(contractAddress, args), + queryKey: valenceRebalancerQueryKeys.getServiceFee( + chainId, + contractAddress, + args + ), queryFn: async () => { return new ValenceRebalancerQueryClient( await getCosmWasmClientForChainId(chainId), @@ -213,7 +265,10 @@ export const valenceRebalancerQueries = { Error, TData > => ({ - queryKey: valenceRebalancerQueryKeys.getWhiteLists(contractAddress), + queryKey: valenceRebalancerQueryKeys.getWhiteLists( + chainId, + contractAddress + ), queryFn: async () => { return new ValenceRebalancerQueryClient( await getCosmWasmClientForChainId(chainId), @@ -231,7 +286,10 @@ export const valenceRebalancerQueries = { Error, TData > => ({ - queryKey: valenceRebalancerQueryKeys.getManagersAddrs(contractAddress), + queryKey: valenceRebalancerQueryKeys.getManagersAddrs( + chainId, + contractAddress + ), queryFn: async () => { return new ValenceRebalancerQueryClient( await getCosmWasmClientForChainId(chainId), @@ -249,7 +307,7 @@ export const valenceRebalancerQueries = { Error, TData > => ({ - queryKey: valenceRebalancerQueryKeys.getAdmin(contractAddress), + queryKey: valenceRebalancerQueryKeys.getAdmin(chainId, contractAddress), queryFn: async () => { return new ValenceRebalancerQueryClient( await getCosmWasmClientForChainId(chainId), diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useStakingInfo.ts b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useStakingInfo.ts index cc04b9d65..1ef6ea285 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useStakingInfo.ts +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingOnftStaked/hooks/useStakingInfo.ts @@ -139,9 +139,13 @@ export const useStakingInfo = ({ }) // Then invalidate contract query that uses indexer query. queryClient.invalidateQueries({ - queryKey: daoVotingOnftStakedQueryKeys.stakedNfts(votingModuleAddress, { - address: walletAddress, - }), + queryKey: daoVotingOnftStakedQueryKeys.stakedNfts( + chainId, + votingModuleAddress, + { + address: walletAddress, + } + ), }) }, [ chainId, @@ -184,9 +188,13 @@ export const useStakingInfo = ({ }) // Then invalidate contract query that uses indexer query. queryClient.invalidateQueries({ - queryKey: daoVotingOnftStakedQueryKeys.nftClaims(votingModuleAddress, { - address: walletAddress, - }), + queryKey: daoVotingOnftStakedQueryKeys.nftClaims( + chainId, + votingModuleAddress, + { + address: walletAddress, + } + ), }) }, [chainId, queryClient, votingModuleAddress, walletAddress]) From 260a20a4e37ab7651f5a34aa4af8c84c55dda0f3 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 30 Jul 2024 22:45:55 -0400 Subject: [PATCH 375/438] add ability to generate contract queries without indexer, and add chain ID to contract queries --- packages/config/scripts/cwgen.ts | 45 +++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/packages/config/scripts/cwgen.ts b/packages/config/scripts/cwgen.ts index bce05916e..b321d015c 100644 --- a/packages/config/scripts/cwgen.ts +++ b/packages/config/scripts/cwgen.ts @@ -27,8 +27,13 @@ program.requiredOption( '-p, --path ', 'path to contract folder that contains "schema" folder' ) +program.option( + // Adds inverted `indexer` boolean to the options object. + '--no-indexer', + "don't add indexer queries" +) program.parse() -const { name, path: dir } = program.opts() +const { name, path: dir, indexer } = program.opts() codegen({ contracts: [ @@ -123,7 +128,12 @@ codegen({ // add imports content = content.replace( 'export const', - "import { getCosmWasmClientForChainId } from '@dao-dao/utils'\nimport { contractQueries } from '../contract'\nimport { indexerQueries } from '../indexer'\n\nexport const" + [ + "import { getCosmWasmClientForChainId } from '@dao-dao/utils'", + "import { contractQueries } from '../contract'", + ...(indexer ? ["import { indexerQueries } from '../indexer'"] : []), + '\nexport const', + ].join('\n') ) content = content.replace( 'import { UseQueryOptions', @@ -144,10 +154,12 @@ codegen({ 'info: contractQueries.info,' ) // add queryClient argument to functions - content = content.replace( - /(: ]+>\()\{/g, - '$1queryClient: QueryClient,{' - ) + if (indexer) { + content = content.replace( + /(: ]+>\()\{/g, + '$1queryClient: QueryClient,{' + ) + } // replace client with chain ID and contract address content = content.replace( /client: [^;]+;/g, @@ -155,11 +167,26 @@ codegen({ ) content = content.replace(/client,/g, 'chainId, contractAddress,') content = content.replace(/client\?\.contractAddress/g, 'contractAddress') + // add chain ID to query keys + content = content.replace( + /( \w+): \(contractAddress: string/g, + '$1: (chainId: string, contractAddress: string' + ) + content = content.replace( + /(QueryKeys\.[^(]+\()contractAddress/g, + '$1chainId, contractAddress' + ) + content = content.replace( + /(\.\.\..+QueryKeys\.contract\[0\],\n)(\s+)(address: contractAddress)/g, + '$1$2chainId,\n$2$3' + ) + const camelCasedContractName = contractName.charAt(0).toLowerCase() + contractName.slice(1) content = content.replace( /queryFn: \(\) => client\.([^(]+)(\([^\)]*\)),/gm, - ` + indexer + ? ` queryFn: async () => { try { // Attempt to fetch data from the indexer. @@ -177,6 +204,10 @@ codegen({ // If indexer query fails, fallback to contract query. return new ${contractName}QueryClient(await getCosmWasmClientForChainId(chainId), contractAddress).$1$2 + },`.trim() + : ` + queryFn: async () => { + return new ${contractName}QueryClient(await getCosmWasmClientForChainId(chainId), contractAddress).$1$2 },`.trim() ) From a90179530a925d66718f8b9ae30ba0da23c8855c Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 31 Jul 2024 11:42:07 -0400 Subject: [PATCH 376/438] don't submit weight when rating retroactive compensation --- .../Renderer/components/stateful/pages/ViewSurvey/Rate.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/pages/ViewSurvey/Rate.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/pages/ViewSurvey/Rate.tsx index 0720ebd8c..08dd7bade 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/pages/ViewSurvey/Rate.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateful/pages/ViewSurvey/Rate.tsx @@ -97,12 +97,15 @@ export const Rate = ({ status, refreshRef, isMember }: ViewSurveyPageProps) => { const [loadingSubmit, setLoadingSubmit] = useState(false) const onSubmit = useCallback( - async (data: RatingsFormData) => { + async ({ ratings }: RatingsFormData) => { setLoadingSubmit(true) try { await postRequest(`/${coreAddress}/${status.survey.uuid}/rate`, { - ...data, + // no need to submit weight to ratings. not used by backend. + ratings: ratings.map(({ weight: _, ...rating }) => ({ + ...rating, + })), }) toast.success(t('success.ratingsSubmitted')) // Reload status on success. From bce279991f4df030ec0a642c6aeb7743296b9aae Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 31 Jul 2024 12:13:40 -0400 Subject: [PATCH 377/438] fixed sticky followed DAOs that can't be unfollowed --- packages/stateful/hooks/useFollowingDaos.ts | 44 +++++++++++++++++---- packages/stateful/hooks/useProfile.ts | 2 +- 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/packages/stateful/hooks/useFollowingDaos.ts b/packages/stateful/hooks/useFollowingDaos.ts index 1f946cc1f..ffa7c27ea 100644 --- a/packages/stateful/hooks/useFollowingDaos.ts +++ b/packages/stateful/hooks/useFollowingDaos.ts @@ -14,6 +14,7 @@ import { DaoSource } from '@dao-dao/types' import { FOLLOWING_DAOS_PREFIX, KVPK_API_BASE, + daoSourcesEqual, processError, serializeDaoSource, } from '@dao-dao/utils' @@ -49,8 +50,7 @@ export const useFollowingDaos = (): UseFollowingDaosReturn => { walletPublicKey: publicKey, }) ) - ), - (data) => data.flat() + ) ) const setRefreshFollowingDaos = useSetRecoilState(refreshFollowingDaosAtom) @@ -64,7 +64,7 @@ export const useFollowingDaos = (): UseFollowingDaosReturn => { const followingDaosSet = new Set( followingDaosLoading.loading || followingDaosLoading.errored ? [] - : followingDaosLoading.data.map(serializeDaoSource) + : followingDaosLoading.data.flat().map(serializeDaoSource) ) return (dao: DaoSource) => followingDaosSet.has(serializeDaoSource(dao)) @@ -160,6 +160,29 @@ export const useFollowingDaos = (): UseFollowingDaosReturn => { setUpdating(true) try { + // Try to find which public key is following this DAO and use a chain ID + // for unfollowing with that same public key. By default we follow from + // the chain the DAO is on, so this is for backwards compatibilty in + // case some follows are stuck on another public key. We have to + // unfollow using the same public key that followed since keys are + // stored under the signing public key. + const followingPublicKeyIndex = + followingDaosLoading.loading || followingDaosLoading.errored + ? undefined + : followingDaosLoading.data.findIndex((follows) => + follows.some((f) => daoSourcesEqual(f, dao)) + ) + const unfollowChainId = + (uniquePublicKeys.loading || + followingPublicKeyIndex === undefined || + followingPublicKeyIndex === -1 + ? undefined + : uniquePublicKeys.data[followingPublicKeyIndex]?.chains[0] + ?.chainId) || + // Fallback to DAO chain ID since this will most likely be the right + // chain. + dao.chainId + const serializedDaoSource = serializeDaoSource(dao) await postRequest( @@ -169,9 +192,7 @@ export const useFollowingDaos = (): UseFollowingDaosReturn => { value: null, }, undefined, - // Use DAO chain ID for following state to ensure we use the same - // chain ID when following and unfollowing the DAO. - dao.chainId + unfollowChainId ) setTemporary((prev) => ({ @@ -195,7 +216,16 @@ export const useFollowingDaos = (): UseFollowingDaosReturn => { setUpdating(false) } }, - [postRequest, ready, refreshFollowing, setTemporary, t, updating] + [ + followingDaosLoading, + postRequest, + ready, + refreshFollowing, + setTemporary, + t, + uniquePublicKeys, + updating, + ] ) return { diff --git a/packages/stateful/hooks/useProfile.ts b/packages/stateful/hooks/useProfile.ts index 2fb2697bf..dd02146af 100644 --- a/packages/stateful/hooks/useProfile.ts +++ b/packages/stateful/hooks/useProfile.ts @@ -188,7 +188,7 @@ export const useProfile = ({ publicKey, bech32Hash: toBech32Hash(address), chains: chains.data.flatMap((c) => - c.publicKey.hex === publicKey ? [c] : c + c.publicKey.hex === publicKey ? c : [] ), })), } From 6930cf89f8de337fa0338f2f918e36e8cc89424f Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 31 Jul 2024 13:19:31 -0400 Subject: [PATCH 378/438] added ability to upload images and files to retroactive compensation --- apps/dapp/pages/api/uploadFile.ts | 4 + apps/sda/pages/api/uploadFile.ts | 4 + packages/i18n/locales/en/translation.json | 1 + .../stateless/ContributionFormInput.tsx | 132 ++++++++++++------ .../pages/ViewSurvey/Complete.stories.tsx | 9 +- .../pages/ViewSurvey/Rate.stories.tsx | 9 +- .../stateless/pages/ViewSurvey/Rate.tsx | 13 +- .../pages/ViewSurvey/Submit.stories.tsx | 7 +- .../RetroactiveCompensation/Renderer/types.ts | 26 +++- .../RetroactiveCompensation/Renderer/utils.ts | 56 ++------ .../components/inputs/FileUploadInput.tsx | 73 ++++++++++ .../components/inputs/ImageUploadInput.tsx | 4 +- packages/stateless/components/inputs/index.ts | 1 + packages/utils/api/uploadFile.ts | 41 ++++++ packages/utils/api/uploadImage.ts | 9 +- packages/utils/api/uploadNft.ts | 7 +- packages/utils/server/form.ts | 37 +++-- 17 files changed, 319 insertions(+), 114 deletions(-) create mode 100644 apps/dapp/pages/api/uploadFile.ts create mode 100644 apps/sda/pages/api/uploadFile.ts create mode 100644 packages/stateless/components/inputs/FileUploadInput.tsx create mode 100644 packages/utils/api/uploadFile.ts diff --git a/apps/dapp/pages/api/uploadFile.ts b/apps/dapp/pages/api/uploadFile.ts new file mode 100644 index 000000000..fccca6d3c --- /dev/null +++ b/apps/dapp/pages/api/uploadFile.ts @@ -0,0 +1,4 @@ +// GNU AFFERO GENERAL PUBLIC LICENSE Version 3. Copyright (C) 2022 DAO DAO Contributors. +// See the "LICENSE" file in the root directory of this package for more copyright information. + +export { default, config } from '@dao-dao/utils/api/uploadFile' diff --git a/apps/sda/pages/api/uploadFile.ts b/apps/sda/pages/api/uploadFile.ts new file mode 100644 index 000000000..fccca6d3c --- /dev/null +++ b/apps/sda/pages/api/uploadFile.ts @@ -0,0 +1,4 @@ +// GNU AFFERO GENERAL PUBLIC LICENSE Version 3. Copyright (C) 2022 DAO DAO Contributors. +// See the "LICENSE" file in the root directory of this package for more copyright information. + +export { default, config } from '@dao-dao/utils/api/uploadFile' diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index c778824b6..5634700cc 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -54,6 +54,7 @@ "addAttribute": "Add attribute", "addChains": "Add chains", "addCollection": "Add collection", + "addFile": "Add file", "addImage": "Add image", "addMember": "Add a member", "addMembers": "Add members", diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionFormInput.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionFormInput.tsx index 1d33afc43..17425b049 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionFormInput.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionFormInput.tsx @@ -5,7 +5,9 @@ import { useTranslation } from 'react-i18next' import { Button, + ButtonLink, Checkbox, + FileUploadInput, IconButton, ImageUploadInput, InputErrorMessage, @@ -46,14 +48,14 @@ export const ContributionFormInput = ({ } = useFormContext() const { - fields: imageFields, - append: appendImage, - remove: removeImage, + fields: fileFields, + append: appendFile, + remove: removeFile, } = useFieldArray({ control, - name: 'images', + name: 'files', }) - const images = watch('images') + const files = watch('files') const contribution = watch('contribution') const ratings = watch('ratings', []) @@ -88,43 +90,93 @@ export const ContributionFormInput = ({ )}
- {imageFields.map(({ id }, index) => ( -
- {images?.[index].url ? ( - // eslint-disable-next-line @next/next/no-img-element - {images[index].url} - ) : ( - !readOnly && ( - setValue(`images.${index}.url`, url)} - /> - ) - )} - - {!readOnly && ( - removeImage(index)} - size="sm" - variant="ghost" - /> - )} -
- ))} + {fileFields.map( + ({ id }, index) => + (files?.[index].url || !readOnly) && ( +
+ {files?.[index].url ? ( + files[index].image ? ( + // eslint-disable-next-line @next/next/no-img-element + {files[index].url} + ) : ( + + {/* eslint-disable-next-line i18next/no-literal-string */} + {files[index].name || 'File'} + + ) + ) : ( + !readOnly && + (files?.[index].image ? ( + { + setValue(`files.${index}.name`, file.name) + setValue(`files.${index}.url`, url) + setValue(`files.${index}.mimetype`, file.type) + }} + /> + ) : ( + { + setValue(`files.${index}.name`, file.name) + setValue(`files.${index}.url`, url) + setValue(`files.${index}.mimetype`, file.type) + }} + /> + )) + )} + + {!readOnly && ( + removeFile(index)} + size="sm" + variant="ghost" + /> + )} +
+ ) + )} {!readOnly && ( - +
+ + + +
)}
diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Complete.stories.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Complete.stories.tsx index a75aef7a6..8694bb87b 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Complete.stories.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Complete.stories.tsx @@ -22,8 +22,11 @@ export const Default = Template.bind({}) Default.args = { status: { survey: makeSurvey(), - contribution: 'this is my contribution\n\npls give me money', - contributionSelfRatings: null, + contribution: { + content: 'this is my contribution\n\npls give me money', + files: [], + selfRatings: null, + }, rated: false, }, completeRatings: { @@ -37,6 +40,7 @@ Default.args = { content: 'I contributed so much of my BLOOD SWEAT AND TEARS', createdAt: new Date().toISOString(), updatedAt: new Date().toISOString(), + files: [], ratings: [20, 40], compensation: { contributionId: 1, @@ -72,6 +76,7 @@ Default.args = { }, content: "i did absolutely nothing but i expect money because i'm around", + files: [], ratings: [20, 40], createdAt: new Date().toISOString(), updatedAt: new Date().toISOString(), diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Rate.stories.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Rate.stories.tsx index fa513036f..b678b47e8 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Rate.stories.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Rate.stories.tsx @@ -24,8 +24,11 @@ export const Default = Template.bind({}) Default.args = { status: { survey: makeSurvey(), - contribution: 'this is my contribution\n\npls give me money', - contributionSelfRatings: null, + contribution: { + content: 'this is my contribution\n\npls give me money', + files: [], + selfRatings: null, + }, rated: false, }, state: { @@ -37,6 +40,7 @@ Default.args = { address: 'juno1', }, content: 'I did stuff', + files: [], ratings: [20, 40], createdAt: new Date().toISOString(), updatedAt: new Date().toISOString(), @@ -48,6 +52,7 @@ Default.args = { address: 'juno2', }, content: 'I did other stuff\n:D', + files: [], ratings: [20, 40], createdAt: new Date().toISOString(), updatedAt: new Date().toISOString(), diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Rate.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Rate.tsx index c837bc8b1..398ba40de 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Rate.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Rate.tsx @@ -179,7 +179,7 @@ export const Rate = ({ const nominationFormMethods = useForm({ defaultValues: { contribution: '', - images: [], + files: [], ratings: survey.attributes.map(() => null), }, }) @@ -326,7 +326,16 @@ export const Rate = ({ + `${mimetype.startsWith('image') ? '!' : ''}[${ + name || url + }](${url})` + ) || []), + ].join('\n\n')} />
diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Submit.stories.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Submit.stories.tsx index 02f622f8b..0990ef1e5 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Submit.stories.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/pages/ViewSurvey/Submit.stories.tsx @@ -63,8 +63,11 @@ Default.args = { connected: true, status: { survey: makeSurvey(), - contribution: 'this is my contribution\n\npls give me money', - contributionSelfRatings: null, + contribution: { + content: 'this is my contribution\n\npls give me money', + files: [], + selfRatings: null, + }, rated: false, }, onSubmit: async (data) => alert('submit: ' + JSON.stringify(data)), diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/types.ts b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/types.ts index d7227c4f9..823c7248c 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/types.ts +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/types.ts @@ -54,10 +54,23 @@ export type NewSurveyFormData = Omit & { }[] } +export type ContributionFile = { + name: string + url: string + mimetype: string +} + +/** + * Survey with extra metadata about the requesting user's relationship to the + * survey. + */ export type SurveyWithMetadata = { survey: Survey - contribution: string | null - contributionSelfRatings: (number | null)[] | null + contribution: { + content: string + files: ContributionFile[] | null + selfRatings: (number | null)[] | null + } | null rated: boolean } @@ -85,6 +98,7 @@ export type ContributionResponse = { id: number contributor: string content: string + files: ContributionFile[] | null ratings: (number | null)[] | null createdAt: string updatedAt: string @@ -145,9 +159,11 @@ export type CompletedSurvey = Survey & { export type ContributionFormData = { contribution: string - images?: { - url?: string - }[] + files: Partial< + ContributionFile & { + image: boolean + } + >[] ratings: (number | null)[] } diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts index ee660e955..c9adde5f0 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts @@ -120,25 +120,17 @@ export const computeCompensation = ( } /** - * Prepare contribution form data by combining text and images into the - * contribution text and removing the images. + * Prepare contribution form data by removing files that don't have all the + * fields set and removing the image field. */ export const prepareContributionFormData = ( data: D -): D => { - const formData: D = { - ...data, - // Add Markdown image lines to bottom of contribution if they exist. - contribution: [ - data.contribution, - data.images?.flatMap(({ url }) => `![${url}](${url})` || []).join('\n'), - ] - .filter(Boolean) - .join('\n\n'), - } - delete formData.images - return formData -} +): D => ({ + ...data, + files: data.files.flatMap(({ image: _, ...file }) => + file.name && file.url && file.mimetype ? file : [] + ), +}) /** * Extract contribution form data from survey. @@ -146,30 +138,8 @@ export const prepareContributionFormData = ( export const extractContributionFormDataFromSurvey = ({ survey: { attributes }, contribution, - contributionSelfRatings, -}: SurveyWithMetadata): ContributionFormData => { - contribution ||= '' - - // Pull images out of the contribution text. - const images = contribution - ? contribution - .split('\n\n') - .pop() - ?.split('\n') - .map((part) => - part.startsWith('![') ? part.split('](')[1].slice(0, -1) : undefined - ) - .flatMap((url) => (url ? { url } : [])) - : [] - - // If images were found, remove them from the text. - if (images?.length) { - contribution = contribution.split('\n\n').slice(0, -1).join('\n\n') - } - - return { - contribution, - images, - ratings: contributionSelfRatings || attributes.map(() => null), - } -} +}: SurveyWithMetadata): ContributionFormData => ({ + contribution: contribution?.content || '', + files: contribution?.files || [], + ratings: contribution?.selfRatings || attributes.map(() => null), +}) diff --git a/packages/stateless/components/inputs/FileUploadInput.tsx b/packages/stateless/components/inputs/FileUploadInput.tsx new file mode 100644 index 000000000..f924cb885 --- /dev/null +++ b/packages/stateless/components/inputs/FileUploadInput.tsx @@ -0,0 +1,73 @@ +import { CloudDownloadRounded, CloudUploadRounded } from '@mui/icons-material' +import { useState } from 'react' + +import { FileDropInput, FileDropInputProps } from './FileDropInput' + +export type FileUploadInputProps = Omit< + FileDropInputProps, + 'onSelect' | 'loading' +> & { + onChange: (url: string, file: File) => void | Promise + onError?: (error: unknown) => void + allowedMimetypes?: string[] +} + +export const FileUploadInput = ({ + onChange, + onError, + allowedMimetypes, + ...props +}: FileUploadInputProps) => { + const [uploading, setUploading] = useState(false) + + const uploadFile = async (file: File) => { + setUploading(true) + + try { + if (allowedMimetypes?.length && !allowedMimetypes.includes(file.type)) { + throw new Error( + `Invalid file type. Allowed: ${allowedMimetypes.join(', ')}` + ) + } + + const form = new FormData() + form.append('file', file) + + // Next.js API route. + const response = await fetch('/api/uploadFile', { + method: 'POST', + body: form, + }) + + if (!response.ok) { + const fallback = `Failed to upload file. Status: ${response.status} ${response.statusText}` + throw new Error( + (await response.json().catch(() => ({ error: fallback })))?.error || + fallback + ) + } + + const { cid } = await response.json() + if (!cid) { + throw new Error('Failed to upload file') + } + + onChange(`ipfs://${cid}`, file) + } catch (err) { + console.error(err) + onError?.(err) + } finally { + setUploading(false) + } + } + + return ( + + ) +} diff --git a/packages/stateless/components/inputs/ImageUploadInput.tsx b/packages/stateless/components/inputs/ImageUploadInput.tsx index 556b04510..287febcb0 100644 --- a/packages/stateless/components/inputs/ImageUploadInput.tsx +++ b/packages/stateless/components/inputs/ImageUploadInput.tsx @@ -6,7 +6,7 @@ export type ImageUploadInputProps = Omit< ImageDropInputProps, 'onSelect' | 'loading' > & { - onChange: (url: string) => void | Promise + onChange: (url: string, file: File) => void | Promise onError?: (error: unknown) => void } @@ -43,7 +43,7 @@ export const ImageUploadInput = ({ throw new Error('Failed to upload image') } - onChange(`ipfs://${cid}`) + onChange(`ipfs://${cid}`, file) } catch (err) { console.error(err) onError?.(err) diff --git a/packages/stateless/components/inputs/index.ts b/packages/stateless/components/inputs/index.ts index a8bf701c1..8e219dede 100644 --- a/packages/stateless/components/inputs/index.ts +++ b/packages/stateless/components/inputs/index.ts @@ -6,6 +6,7 @@ export * from './DateTimePicker' export * from './DaoSupportedChainPickerInput' export * from './Dropdown' export * from './FileDropInput' +export * from './FileUploadInput' export * from './ImageDropInput' export * from './ImageSelector' export * from './ImageUploadInput' diff --git a/packages/utils/api/uploadFile.ts b/packages/utils/api/uploadFile.ts new file mode 100644 index 000000000..0d0985496 --- /dev/null +++ b/packages/utils/api/uploadFile.ts @@ -0,0 +1,41 @@ +import { NextApiRequest, NextApiResponse } from 'next' +import { v4 as uuidv4 } from 'uuid' + +import { parseForm, uploadToFilebase } from '../server' + +export default async function handler( + req: NextApiRequest, + res: NextApiResponse +) { + try { + // Parse file from form. + const { fileData, fileExtension, mimetype } = await parseForm(req, { + requireFile: true, + }) + // Type-check. Parser should throw error if no file is found. + if (!fileData || !fileExtension) { + throw new Error('No file found.') + } + + const cid = await uploadToFilebase( + fileData, + `${uuidv4()}.${fileExtension}`, + mimetype + ) + + return res.status(200).json({ + cid, + }) + } catch (err) { + return res + .status(400) + .json({ error: err instanceof Error ? err.message : err }) + } +} + +// Disable default body parser since Formidable parses for us. +export const config = { + api: { + bodyParser: false, + }, +} diff --git a/packages/utils/api/uploadImage.ts b/packages/utils/api/uploadImage.ts index 6de201b76..1d44a0b4d 100644 --- a/packages/utils/api/uploadImage.ts +++ b/packages/utils/api/uploadImage.ts @@ -9,8 +9,13 @@ export default async function handler( ) { try { // Parse image from form. - const { imageData, imageExtension, mimetype } = await parseForm(req, { - requireImage: true, + const { + fileData: imageData, + fileExtension: imageExtension, + mimetype, + } = await parseForm(req, { + requireFile: true, + allowedFiletype: 'image', }) // Type-check. Parser should throw error if no image is found. if (!imageData || !imageExtension) { diff --git a/packages/utils/api/uploadNft.ts b/packages/utils/api/uploadNft.ts index d71647a3f..6885480dd 100644 --- a/packages/utils/api/uploadNft.ts +++ b/packages/utils/api/uploadNft.ts @@ -12,11 +12,12 @@ export default async function handler( // Parse form fields and image. const { fields: { name, description = '', extra: _extra }, - imageData, - imageExtension, + fileData: imageData, + fileExtension: imageExtension, mimetype, } = await parseForm(req, { - requireImage: false, + requireFile: false, + allowedFiletype: 'image', }) // Make sure name is not empty. diff --git a/packages/utils/server/form.ts b/packages/utils/server/form.ts index 1b0c06019..252bb82ec 100644 --- a/packages/utils/server/form.ts +++ b/packages/utils/server/form.ts @@ -7,16 +7,27 @@ import { NextApiRequest } from 'next' export const parseForm = async ( req: NextApiRequest, { - requireImage = false, + requireFile = false, + allowedFiletype = 'any', + maxFileSizeMb = 3, + }: { /** - * Limit the maximum size of the uploaded image in megabytes. Defaults to 3. + * Whether or not to require a file is uploaded. */ - maxFileSizeMb = 3, + requireFile?: boolean + /** + * Restrict the type of file that can be uploaded. Defaults to 'any'. + */ + allowedFiletype?: 'any' | 'image' + /** + * Limit the maximum size of the uploaded file in megabytes. Defaults to 3. + */ + maxFileSizeMb?: number } = {} ): Promise<{ fields: Record - imageData: Buffer | undefined - imageExtension: string | undefined + fileData: Buffer | undefined + fileExtension: string | undefined mimetype: string | undefined }> => { // Get fields and files from form. @@ -50,7 +61,7 @@ export const parseForm = async ( const files = Object.values(_files).flat() // Make sure there is only one file, or optionally none if not required. - if (requireImage && files.length === 0) { + if (requireFile && files.length === 0) { throw new Error('No files found.') } else if (files.length > 1) { throw new Error('Too many files found.') @@ -59,7 +70,11 @@ export const parseForm = async ( const file: File | undefined = files[0] // Makes sure file is an image. - if (file && !file.mimetype?.startsWith('image')) { + if ( + file && + allowedFiletype === 'image' && + !file.mimetype?.startsWith('image') + ) { throw new Error('Only images are supported.') } @@ -70,13 +85,13 @@ export const parseForm = async ( } return acc }, {} as Record) - // Read image data from temporarily uploaded location. - const imageData = file ? await fs.readFile(file.filepath) : undefined + // Read file data from temporarily uploaded location. + const fileData = file ? await fs.readFile(file.filepath) : undefined return { fields, - imageData, - imageExtension: file?.originalFilename?.includes('.') + fileData, + fileExtension: file?.originalFilename?.includes('.') ? file.originalFilename.split('.').slice(-1)[0] : undefined, mimetype: file?.mimetype ?? undefined, From a2c1ba7fdbe2560ab84772b5105fda64dea7ff1e Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 31 Jul 2024 13:37:24 -0400 Subject: [PATCH 379/438] render images correctly in contribution form --- .../Renderer/components/stateless/ContributionFormInput.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionFormInput.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionFormInput.tsx index 17425b049..880ae26ab 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionFormInput.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionFormInput.tsx @@ -95,7 +95,7 @@ export const ContributionFormInput = ({ (files?.[index].url || !readOnly) && (
{files?.[index].url ? ( - files[index].image ? ( + files[index].mimetype?.startsWith('image') ? ( // eslint-disable-next-line @next/next/no-img-element {files[index].url} Date: Wed, 31 Jul 2024 13:40:07 -0400 Subject: [PATCH 380/438] render images correctly in contribution form again --- .../widgets/RetroactiveCompensation/Renderer/utils.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts index c9adde5f0..dfecd8e4c 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/utils.ts @@ -140,6 +140,10 @@ export const extractContributionFormDataFromSurvey = ({ contribution, }: SurveyWithMetadata): ContributionFormData => ({ contribution: contribution?.content || '', - files: contribution?.files || [], + files: + contribution?.files?.map((f) => ({ + ...f, + image: f.mimetype.startsWith('image'), + })) || [], ratings: contribution?.selfRatings || attributes.map(() => null), }) From 1ce4c17c32298f37f85d38ce8e21ac9e39d5cdbb Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 31 Jul 2024 13:44:17 -0400 Subject: [PATCH 381/438] fallback to URL if no name --- .../Renderer/components/stateless/ContributionFormInput.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionFormInput.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionFormInput.tsx index 880ae26ab..c8a8e61c5 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionFormInput.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/ContributionFormInput.tsx @@ -112,8 +112,7 @@ export const ContributionFormInput = ({ openInNewTab variant="underline" > - {/* eslint-disable-next-line i18next/no-literal-string */} - {files[index].name || 'File'} + {files[index].name || files[index].url} ) ) : ( From 3a750a9dff814b4b54e803077735d693a07c714f Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 31 Jul 2024 13:49:54 -0400 Subject: [PATCH 382/438] fixed title and status groups --- .../components/stateless/SurveyList.tsx | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/SurveyList.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/SurveyList.tsx index eb64df6ef..ff5a20bc9 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/SurveyList.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/SurveyList.tsx @@ -18,15 +18,16 @@ export const SurveyList = ({ surveys, SurveyRow }: SurveyListProps) => { const grouped = surveys.reduce( (acc, survey) => { - let group = acc.find((g) => g.status === survey.survey.status) + const titleI18nKey = + survey.survey.status in statusTitles + ? statusTitles[survey.survey.status] + : '' + + let group = acc.find((g) => g.titleI18nKey === titleI18nKey) if (!group) { group = { status: survey.survey.status, - title: t( - survey.survey.status in statusTitles - ? statusTitles[survey.survey.status] - : '' - ), + titleI18nKey, surveys: [], } acc.push(group) @@ -38,7 +39,7 @@ export const SurveyList = ({ surveys, SurveyRow }: SurveyListProps) => { }, [] as { status: SurveyStatus - title: string + titleI18nKey: string surveys: SurveyWithMetadata[] }[] ) @@ -49,12 +50,12 @@ export const SurveyList = ({ surveys, SurveyRow }: SurveyListProps) => { return ( <> - {grouped.map(({ status, title, surveys }) => ( -
+ {grouped.map(({ titleI18nKey, surveys }) => ( +
-

{title}

+

{t(titleI18nKey)}

From 5c5ede2d743495f98ed704836d4b32fe4035b677 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 31 Jul 2024 13:50:18 -0400 Subject: [PATCH 383/438] fixed other title --- .../Renderer/components/stateless/SurveyList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/SurveyList.tsx b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/SurveyList.tsx index ff5a20bc9..bc30e0152 100644 --- a/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/SurveyList.tsx +++ b/packages/stateful/widgets/widgets/RetroactiveCompensation/Renderer/components/stateless/SurveyList.tsx @@ -21,7 +21,7 @@ export const SurveyList = ({ surveys, SurveyRow }: SurveyListProps) => { const titleI18nKey = survey.survey.status in statusTitles ? statusTitles[survey.survey.status] - : '' + : 'title.other' let group = acc.find((g) => g.titleI18nKey === titleI18nKey) if (!group) { From a0657b28a74d1b25c548c39bf4f054246a1942e2 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 1 Aug 2024 12:59:09 -0400 Subject: [PATCH 384/438] added voting module fallback class --- packages/i18n/locales/en/translation.json | 2 +- packages/stateful/clients/dao/CwDao.ts | 16 +++--- .../voting-module/FallbackVotingModule.ts | 57 +++++++++++++++++++ .../stateful/clients/voting-module/index.ts | 1 + .../adapters/Fallback/Placeholder.tsx | 4 +- 5 files changed, 69 insertions(+), 11 deletions(-) create mode 100644 packages/stateful/clients/voting-module/FallbackVotingModule.ts diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 5634700cc..41209de26 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -1488,7 +1488,7 @@ "votingEndBlockTooltip": "The block height at which voting ends.", "votingEndedBlockTooltip": "The block height at which voting ended.", "votingModuleAdapterCreationDiscord": "Want to help us support this voting module? Join the <2><0>DAO DAO Discord<1/> and post in #dao-help.", - "votingModuleNotYetSupported": "This DAO uses a voting module that our UI does not yet support. Functionality may be limited.", + "votingModuleNotYetSupported": "This DAO uses a voting module that is not supported by our UI. Functionality is limited.", "votingPowerAtCreationTooltip": "This was your voting power at the time of proposal creation.", "votingVaultsExplanation": "Voting power in the DAO derives from multiple sources.", "waitingForRateAndPropose": "Waiting for DAO members to rate and propose...", diff --git a/packages/stateful/clients/dao/CwDao.ts b/packages/stateful/clients/dao/CwDao.ts index 7ddb7b252..c2ff3c3f5 100644 --- a/packages/stateful/clients/dao/CwDao.ts +++ b/packages/stateful/clients/dao/CwDao.ts @@ -35,6 +35,7 @@ import { Cw20StakedVotingModule, Cw4VotingModule, Cw721StakedVotingModule, + FallbackVotingModule, NativeStakedVotingModule, NeutronVotingRegistryVotingModule, OnftStakedVotingModule, @@ -153,15 +154,16 @@ export class CwDao extends DaoBase { this._info = info if (info) { - const VotingModule = getVotingModuleBases().find((Base) => - Base.contractNames.includes(info.votingModuleInfo.contract) - ) - if (!VotingModule) { - throw new Error( - 'Voting module not found for contract: ' + - info.votingModuleInfo.contract + const VotingModule = + getVotingModuleBases().find((Base) => + Base.contractNames.includes(info.votingModuleInfo.contract) + ) || FallbackVotingModule + if (VotingModule === FallbackVotingModule) { + console.error( + `Voting module not found for contract: ${info.votingModuleInfo.contract}. Using fallback.` ) } + this._votingModule = new VotingModule( this.queryClient, this, diff --git a/packages/stateful/clients/voting-module/FallbackVotingModule.ts b/packages/stateful/clients/voting-module/FallbackVotingModule.ts new file mode 100644 index 000000000..82700aa3f --- /dev/null +++ b/packages/stateful/clients/voting-module/FallbackVotingModule.ts @@ -0,0 +1,57 @@ +import { FetchQueryOptions, skipToken } from '@tanstack/react-query' + +import { daoDaoCoreQueries } from '@dao-dao/state/query' +import { ModuleInstantiateInfo } from '@dao-dao/types' +import { + TotalPowerAtHeightResponse, + VotingPowerAtHeightResponse, +} from '@dao-dao/types/contracts/DaoVotingCw4' + +import { CwDao } from '../dao/CwDao' +import { VotingModuleBase } from './base' + +export class FallbackVotingModule extends VotingModuleBase { + static contractNames: readonly string[] = [] + + /** + * Generate the module instantiate info to plug into the DAO instantiate info + * generator function. + */ + static generateModuleInstantiateInfo(): ModuleInstantiateInfo { + throw new Error('Not implemented') + } + + getVotingPowerQuery( + address?: string, + height?: number + ): FetchQueryOptions { + // If no address, return query in loading state. + if (!address) { + return { + queryKey: [], + queryFn: skipToken, + } + } + + return daoDaoCoreQueries.votingPowerAtHeight(this.queryClient, { + chainId: this.dao.chainId, + contractAddress: this.dao.coreAddress, + args: { + address, + height, + }, + }) + } + + getTotalVotingPowerQuery( + height?: number + ): FetchQueryOptions { + return daoDaoCoreQueries.totalPowerAtHeight(this.queryClient, { + chainId: this.dao.chainId, + contractAddress: this.dao.coreAddress, + args: { + height, + }, + }) + } +} diff --git a/packages/stateful/clients/voting-module/index.ts b/packages/stateful/clients/voting-module/index.ts index 876ec5dcb..6d46821b1 100644 --- a/packages/stateful/clients/voting-module/index.ts +++ b/packages/stateful/clients/voting-module/index.ts @@ -2,6 +2,7 @@ export * from './Cw4VotingModule' export * from './Cw4VotingModule.secret' export * from './Cw20StakedVotingModule' export * from './Cw721StakedVotingModule' +export * from './FallbackVotingModule' export * from './NativeStakedVotingModule' export * from './NeutronVotingRegistryVotingModule' export * from './OnftStakedVotingModule' diff --git a/packages/stateful/voting-module-adapter/adapters/Fallback/Placeholder.tsx b/packages/stateful/voting-module-adapter/adapters/Fallback/Placeholder.tsx index 19a30e9f7..a85757769 100644 --- a/packages/stateful/voting-module-adapter/adapters/Fallback/Placeholder.tsx +++ b/packages/stateful/voting-module-adapter/adapters/Fallback/Placeholder.tsx @@ -4,8 +4,6 @@ export const Placeholder = () => { const { t } = useTranslation() return ( -

- {t('info.votingModuleNotYetSupported')} -

+

{t('info.votingModuleNotYetSupported')}

) } From a04dcab01ba7e0abe5707ec9e721c5aa86e5c1b4 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 1 Aug 2024 14:28:23 -0400 Subject: [PATCH 385/438] use kleomedes juno RPC --- packages/utils/constants/chains.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 3ffb58617..d09b9f9fb 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -2389,8 +2389,8 @@ export const CHAIN_ENDPOINTS: Partial< > > = { [ChainId.JunoMainnet]: { - rpc: 'https://juno-rpc.publicnode.com', - rest: 'https://juno-rest.publicnode.com', + rpc: 'https://juno-rpc.kleomedes.network', + rest: 'https://juno-api.kleomedes.network', }, [ChainId.JunoTestnet]: { rpc: 'https://juno-testnet-rpc.polkachu.com', From f0f8f9afe35e69f550789902950cdccd85d966ec Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 1 Aug 2024 14:42:14 -0400 Subject: [PATCH 386/438] detect ICA create message when querying relay state --- packages/types/proposal.ts | 41 +++++++++++++++++---------- packages/utils/messages/cw.ts | 53 +++++++++++++++++++++++++++++++++-- 2 files changed, 76 insertions(+), 18 deletions(-) diff --git a/packages/types/proposal.ts b/packages/types/proposal.ts index c0248950a..6c75c56eb 100644 --- a/packages/types/proposal.ts +++ b/packages/types/proposal.ts @@ -68,25 +68,36 @@ export type DecodedPolytoneMsg = export type DecodedIcaMsgMatch = { match: true chainId: string - // The first message, or undefined if none. - msgWithSender: - | { - sender: string - msg: Record - } - | undefined - // The first message, or undefined if none. - cosmosMsgWithSender: - | { - sender: string - msg: UnifiedCosmosMsg - } - | undefined - // All messages. + /** + * Whether or not this is an ICA create or execute message. + */ + type: 'create' | 'execute' + /** + * The first message, or undefined if none. Will be undefined if execute with + * no messages and for create messages. + */ + msgWithSender?: { + sender: string + msg: Record + } + /** + * The first Cosmos message, or undefined if none. Will be undefined if + * execute with no messages and for create messages. + */ + cosmosMsgWithSender?: { + sender: string + msg: UnifiedCosmosMsg + } + /** + * All messages. + */ msgsWithSenders: { sender: string msg: Record }[] + /** + * All Cosmos messages. + */ cosmosMsgsWithSenders: { sender: string msg: UnifiedCosmosMsg diff --git a/packages/utils/messages/cw.ts b/packages/utils/messages/cw.ts index 57ae44b9a..e6a88ca07 100644 --- a/packages/utils/messages/cw.ts +++ b/packages/utils/messages/cw.ts @@ -20,7 +20,10 @@ import { UnifiedCosmosMsg, WasmMsg, } from '@dao-dao/types/contracts/common' -import { MsgSendTx } from '@dao-dao/types/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx' +import { + MsgRegisterInterchainAccount, + MsgSendTx, +} from '@dao-dao/types/protobuf/codegen/ibc/applications/interchain_accounts/controller/v1/tx' import { CosmosTx, InterchainAccountPacketData, @@ -531,13 +534,54 @@ export const decodeIcaExecuteMsg = ( return { match: true, chainId: chain.chain_id, + type: 'execute', msgWithSender: msgsWithSenders[0], cosmosMsgWithSender: cosmosMsgsWithSenders[0], msgsWithSenders, cosmosMsgsWithSenders, } } catch (err) { - console.error('ICA decode error', err) + console.error('ICA execute decode error', err) + return { + match: false, + } + } +} + +/** + * Checks if the message is an ICA create message and extracts the chain ID. + */ +export const decodeIcaCreateMsg = ( + srcChainId: string, + decodedMsg: Record +): DecodedIcaMsg => { + if ( + !isDecodedStargateMsg(decodedMsg) || + decodedMsg.stargate.typeUrl !== MsgRegisterInterchainAccount.typeUrl + ) { + return { + match: false, + } + } + + try { + const { connectionId } = decodedMsg.stargate + .value as MsgRegisterInterchainAccount + const { destinationChain } = getIbcTransferInfoFromConnection( + srcChainId, + connectionId + ) + const chain = getChainForChainName(destinationChain.chain_name) + + return { + match: true, + chainId: chain.chain_id, + type: 'create', + msgsWithSenders: [], + cosmosMsgsWithSenders: [], + } + } catch (err) { + console.error('ICA create decode error', err) return { match: false, } @@ -569,7 +613,10 @@ export const decodeCrossChainMessages = ( } } - const decodedIca = decodeIcaExecuteMsg(srcChainId, msg, 'any') + let decodedIca = decodeIcaExecuteMsg(srcChainId, msg, 'any') + if (!decodedIca.match) { + decodedIca = decodeIcaCreateMsg(srcChainId, msg) + } if (decodedIca.match) { const ibcInfo = getIbcTransferInfoBetweenChains( srcChainId, From 8ed0a7c86dff149c7fb5fbfd2f09ce2e3f8571b5 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 1 Aug 2024 14:58:04 -0400 Subject: [PATCH 387/438] retry different RPCs when self-relaying --- .../components/SelfRelayExecuteModal.tsx | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/packages/stateful/components/SelfRelayExecuteModal.tsx b/packages/stateful/components/SelfRelayExecuteModal.tsx index 14e15a4ec..6a6381dcf 100644 --- a/packages/stateful/components/SelfRelayExecuteModal.tsx +++ b/packages/stateful/components/SelfRelayExecuteModal.tsx @@ -68,6 +68,7 @@ import { getRpcForChainId, makeBankMessage, processError, + retry, } from '@dao-dao/utils' import { useWallet } from '../hooks' @@ -375,17 +376,19 @@ export const SelfRelayExecuteModal = ({ const relayerAddress = (await signer.getAccounts())[0].address // Create IBC client with newly created signer. - const client = await IbcClient.connectWithSigner( - getRpcForChainId(chain.chain_id), - signer, - relayerAddress, - { - // How long it waits in between checking for a new block. - estimatedBlockTime: 3000, - // How long it waits until looking for acks. - estimatedIndexerTime: 3000, - gasPrice: new DynamicGasPrice(queryClient, chain), - } + const client = await retry(10, (attempt) => + IbcClient.connectWithSigner( + getRpcForChainId(chain.chain_id, attempt - 1), + signer, + relayerAddress, + { + // How long it waits in between checking for a new block. + estimatedBlockTime: 3000, + // How long it waits until looking for acks. + estimatedIndexerTime: 3000, + gasPrice: new DynamicGasPrice(queryClient, chain), + } + ) ) return { From 1fdf7147f333346cfea35a64b1bbfe8b721900ee Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 1 Aug 2024 14:58:58 -0400 Subject: [PATCH 388/438] added noble mainnet self relay funds needed --- packages/stateful/components/SelfRelayExecuteModal.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/stateful/components/SelfRelayExecuteModal.tsx b/packages/stateful/components/SelfRelayExecuteModal.tsx index 6a6381dcf..5d8fe20ca 100644 --- a/packages/stateful/components/SelfRelayExecuteModal.tsx +++ b/packages/stateful/components/SelfRelayExecuteModal.tsx @@ -101,6 +101,7 @@ const RELAYER_FUNDS_NEEDED: Partial> = { [ChainId.TerraClassicMainnet]: 1000 * 10 ** 6, [ChainId.OmniflixHubMainnet]: 1 * 10 ** 6, [ChainId.BitsongMainnet]: 10 * 10 ** 6, + [ChainId.NobleMainnet]: 0.1 * 10 ** 6, } type Relayer = { From 5696d960384106f97cea0c4159ff3a39d725038e Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 1 Aug 2024 16:02:03 -0400 Subject: [PATCH 389/438] fixed missing error --- packages/i18n/locales/en/translation.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 41209de26..439e32776 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -436,6 +436,7 @@ "failedToRelayPackets": "Failed to relay packets to {{chain}}.", "feeTokenNotFound": "Fee token not found.", "govTokenBalancesDoNotSumTo100": "Total token distribution percentage must equal 100%, but it currently sums to {{totalPercent}}.", + "icaAlreadyExists": "You already have an account on {{chain}}.", "icaDoesNotExist": "You do not have an account on {{chain}}.", "icaHostUnsupported": "ICA is either unsupported or misconfigured on {{chain}}, so it is unsafe to use.", "insufficientBalance": "Insufficient balance of {{amount}} ${{tokenSymbol}}.", From 1db1556361d9d37ac671953dc9dcee3967e2b3d7 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 1 Aug 2024 16:51:19 -0400 Subject: [PATCH 390/438] fixed vote not refreshing --- .../MultipleChoiceProposalModule.secret.ts | 2 +- .../MultipleChoiceProposalModule.ts | 8 +- .../SingleChoiceProposalModule.secret.ts | 2 +- .../SingleChoiceProposalModule.ts | 8 +- .../stateful/clients/proposal-module/base.ts | 2 +- .../components/ProposalVotes/index.tsx | 101 ++++++++++++------ .../hooks/useProposalRefreshers.ts | 5 +- .../components/ProposalVotes/index.tsx | 97 +++++++++++------ .../hooks/useProposalRefreshers.ts | 5 +- packages/types/clients/proposal-module.ts | 2 +- packages/types/proposal-module-adapter.ts | 1 + 11 files changed, 153 insertions(+), 80 deletions(-) diff --git a/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.secret.ts b/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.secret.ts index f1d055f0f..b4d17f69e 100644 --- a/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.secret.ts +++ b/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.secret.ts @@ -221,7 +221,7 @@ export class SecretMultipleChoiceProposalModule extends ProposalModuleBase< }, }) - await this.queryClient.invalidateQueries({ + await this.queryClient.refetchQueries({ queryKey: this.getVoteQuery({ proposalId, voter: sender, diff --git a/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.ts b/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.ts index 52705942f..240e5cda2 100644 --- a/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.ts +++ b/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.ts @@ -262,7 +262,7 @@ export class MultipleChoiceProposalModule extends ProposalModuleBase< vote, }) - await this.queryClient.invalidateQueries({ + await this.queryClient.refetchQueries({ queryKey: this.getVoteQuery({ proposalId, voter: sender, @@ -318,11 +318,11 @@ export class MultipleChoiceProposalModule extends ProposalModuleBase< contractAddress: this.info.address, args: { proposalId, - // Force type-cast since the query won't be enabled until this is set. + ...(voter && { voter }), + // Force type-cast since the query won't be enabled until voter is set. // This allows us to pass an undefined `voter` argument in order to // invalidate/refresh the query for all voters. - voter: voter!, - }, + } as any, // If no voter, return query in loading state. options: { enabled: !!voter, diff --git a/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.secret.ts b/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.secret.ts index 988f77c96..3105bf254 100644 --- a/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.secret.ts +++ b/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.secret.ts @@ -252,7 +252,7 @@ export class SecretSingleChoiceProposalModule extends ProposalModuleBase< }, }) - await this.queryClient.invalidateQueries({ + await this.queryClient.refetchQueries({ queryKey: this.getVoteQuery({ proposalId, voter: sender, diff --git a/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts b/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts index e268432b6..dc0d23ea5 100644 --- a/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts +++ b/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts @@ -300,7 +300,7 @@ export class SingleChoiceProposalModule extends ProposalModuleBase< vote, }) - await this.queryClient.invalidateQueries({ + await this.queryClient.refetchQueries({ queryKey: this.getVoteQuery({ proposalId, voter: sender, @@ -373,11 +373,11 @@ export class SingleChoiceProposalModule extends ProposalModuleBase< contractAddress: this.info.address, args: { proposalId, - // Force type-cast since the query won't be enabled until this is set. + ...(voter && { voter }), + // Force type-cast since the query won't be enabled until voter is set. // This allows us to pass an undefined `voter` argument in order to // invalidate/refresh the query for all voters. - voter: voter!, - }, + } as any, // If no voter, return query in loading state. options: { enabled: !!voter, diff --git a/packages/stateful/clients/proposal-module/base.ts b/packages/stateful/clients/proposal-module/base.ts index a20991987..ba68b1214 100644 --- a/packages/stateful/clients/proposal-module/base.ts +++ b/packages/stateful/clients/proposal-module/base.ts @@ -112,7 +112,7 @@ export abstract class ProposalModuleBase< */ abstract getVoteQuery(options: { proposalId: number - voter: string | undefined + voter?: string }): FetchQueryOptions /** diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx index c0bfaff4e..f33030687 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalVotes/index.tsx @@ -12,7 +12,11 @@ import { BaseProposalVotesProps } from '@dao-dao/types' import { EntityDisplay } from '../../../../../components/EntityDisplay' import { useProposalModuleAdapterOptions } from '../../../../react/context' -import { useLoadingProposal, useLoadingVoteOptions } from '../../hooks' +import { + useLoadingProposal, + useLoadingVoteOptions, + useProposalRefreshers, +} from '../../hooks' import { VoteDisplay } from './VoteDisplay' const VOTES_PER_PAGE = 20 @@ -23,6 +27,7 @@ export const ProposalVotes = (props: BaseProposalVotesProps) => { proposalModule: { address: proposalModuleAddress }, proposalNumber, } = useProposalModuleAdapterOptions() + const { refreshProposalId } = useProposalRefreshers() const loadingProposal = useLoadingProposal() const voteOptions = useLoadingVoteOptions() @@ -36,7 +41,12 @@ export const ProposalVotes = (props: BaseProposalVotesProps) => { const [votes, setVotes] = useState([]) const loadVotes = useRecoilCallback( ({ snapshot }) => - async () => { + async ( + /** + * Reload all existing votes. + */ + reloadAll = false + ) => { // Don't load votes until proposal is ready so that the `totalPower` // calculation in the transformation function works correctly. if (loadingProposal.loading) { @@ -45,38 +55,65 @@ export const ProposalVotes = (props: BaseProposalVotesProps) => { setLoading(true) try { - const newVotes = ( - await snapshot.getPromise( - DaoProposalMultipleSelectors.listVotesSelector({ - chainId, - contractAddress: proposalModuleAddress, - params: [ - { - proposalId: proposalNumber, - limit: VOTES_PER_PAGE, - startAfter: - votes.length > 0 - ? votes[votes.length - 1].voterAddress - : undefined, - }, - ], + let newVotes: ProposalVote[] = [] + let noMoreVotes = false + + while (true) { + const pageVotes = ( + await snapshot.getPromise( + DaoProposalMultipleSelectors.listVotesSelector({ + chainId, + contractAddress: proposalModuleAddress, + params: [ + { + proposalId: proposalNumber, + limit: VOTES_PER_PAGE, + startAfter: reloadAll + ? newVotes[newVotes.length - 1]?.voterAddress + : votes[votes.length - 1]?.voterAddress, + }, + ], + }) + ) + ).votes.map( + ({ vote, voter, power, rationale, votedAt }): ProposalVote => ({ + voterAddress: voter, + vote, + votingPowerPercent: + totalPower === 0 ? 0 : (Number(power) / totalPower) * 100, + rationale, + votedAt: votedAt ? new Date(votedAt) : undefined, }) ) - ).votes.map( - ({ vote, voter, power, rationale, votedAt }): ProposalVote => ({ - voterAddress: voter, - vote, - votingPowerPercent: - totalPower === 0 ? 0 : (Number(power) / totalPower) * 100, - rationale, - votedAt: votedAt ? new Date(votedAt) : undefined, - }) - ) + + newVotes.push(...pageVotes) + + // No more votes if we loaded less than the limit we requested. + noMoreVotes = pageVotes.length < VOTES_PER_PAGE + if (noMoreVotes) { + break + } + + if (reloadAll) { + // If reloading all, stop once we load at least as many votes as + // we already have. + if (newVotes.length >= votes.length) { + break + } + } else { + break + } + } setVotes((prev) => - uniqBy([...prev, ...newVotes], ({ voterAddress }) => voterAddress) + uniqBy( + // Reset votes array with new votes that started from the + // beginning if we're reloading all. Otherwise, just append. + [...(reloadAll ? [] : prev), ...newVotes], + ({ voterAddress }) => voterAddress + ) ) - setNoMoreVotes(newVotes.length < VOTES_PER_PAGE) + setNoMoreVotes(noMoreVotes) } finally { setLoading(false) } @@ -90,13 +127,13 @@ export const ProposalVotes = (props: BaseProposalVotesProps) => { votes, ] ) - // Load once proposal is ready. + // Load once proposal is ready or refresh proposal ID changes. useEffect(() => { if (!loadingProposal.loading) { - loadVotes() + loadVotes(true) } // eslint-disable-next-line react-hooks/exhaustive-deps - }, [loadingProposal.loading]) + }, [loadingProposal.loading, refreshProposalId]) const getAllVotes = useRecoilCallback( ({ snapshot }) => diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useProposalRefreshers.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useProposalRefreshers.ts index fe7e0e283..0fc01e69e 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useProposalRefreshers.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/hooks/useProposalRefreshers.ts @@ -1,6 +1,6 @@ import { useQueryClient } from '@tanstack/react-query' import { useCallback } from 'react' -import { useSetRecoilState } from 'recoil' +import { useRecoilState, useSetRecoilState } from 'recoil' import { indexerQueries, @@ -20,7 +20,7 @@ export const useProposalRefreshers = (): ProposalRefreshers => { const queryClient = useQueryClient() const setRefreshProposalsId = useSetRecoilState(refreshProposalsIdAtom) - const setRefreshProposalId = useSetRecoilState( + const [refreshProposalId, setRefreshProposalId] = useRecoilState( refreshProposalIdAtom({ address: proposalModule.address, proposalId: proposalNumber, @@ -58,6 +58,7 @@ export const useProposalRefreshers = (): ProposalRefreshers => { const loadingProposal = useLoadingProposal() return { + refreshProposalId, refreshProposal, refreshProposalAndAll, refreshing: loadingProposal.loading || !!loadingProposal.updating, diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx index c006b6e1f..52a063309 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalVotes/index.tsx @@ -12,7 +12,7 @@ import { BaseProposalVotesProps } from '@dao-dao/types' import { EntityDisplay } from '../../../../../components/EntityDisplay' import { useProposalModuleAdapterOptions } from '../../../../react/context' -import { useLoadingProposal } from '../../hooks' +import { useLoadingProposal, useProposalRefreshers } from '../../hooks' import { VoteDisplay } from './VoteDisplay' const VOTES_PER_PAGE = 20 @@ -23,6 +23,7 @@ export const ProposalVotes = (props: BaseProposalVotesProps) => { proposalNumber, chain: { chain_id: chainId }, } = useProposalModuleAdapterOptions() + const { refreshProposalId } = useProposalRefreshers() const loadingProposal = useLoadingProposal() @@ -35,7 +36,12 @@ export const ProposalVotes = (props: BaseProposalVotesProps) => { const [votes, setVotes] = useState([]) const loadVotes = useRecoilCallback( ({ snapshot }) => - async () => { + async ( + /** + * Reload all existing votes. + */ + reloadAll = false + ) => { // Don't load votes until proposal is ready so that the `totalPower` // calculation in the transformation function works correctly. if (loadingProposal.loading) { @@ -44,38 +50,65 @@ export const ProposalVotes = (props: BaseProposalVotesProps) => { setLoading(true) try { - const newVotes = ( - await snapshot.getPromise( - DaoProposalSingleCommonSelectors.listVotesSelector({ - chainId, - contractAddress: proposalModuleAddress, - params: [ - { - proposalId: proposalNumber, - limit: VOTES_PER_PAGE, - startAfter: - votes.length > 0 - ? votes[votes.length - 1].voterAddress - : undefined, - }, - ], + let newVotes: ProposalVote[] = [] + let noMoreVotes = false + + while (true) { + const pageVotes = ( + await snapshot.getPromise( + DaoProposalSingleCommonSelectors.listVotesSelector({ + chainId, + contractAddress: proposalModuleAddress, + params: [ + { + proposalId: proposalNumber, + limit: VOTES_PER_PAGE, + startAfter: reloadAll + ? newVotes[newVotes.length - 1]?.voterAddress + : votes[votes.length - 1]?.voterAddress, + }, + ], + }) + ) + ).votes.map( + ({ vote, voter, power, rationale, votedAt }): ProposalVote => ({ + voterAddress: voter, + vote, + votingPowerPercent: + totalPower === 0 ? 0 : (Number(power) / totalPower) * 100, + rationale, + votedAt: votedAt ? new Date(votedAt) : undefined, }) ) - ).votes.map( - ({ vote, voter, power, rationale, votedAt }): ProposalVote => ({ - voterAddress: voter, - vote, - votingPowerPercent: - totalPower === 0 ? 0 : (Number(power) / totalPower) * 100, - rationale, - votedAt: votedAt ? new Date(votedAt) : undefined, - }) - ) + + newVotes.push(...pageVotes) + + // No more votes if we loaded less than the limit we requested. + noMoreVotes = pageVotes.length < VOTES_PER_PAGE + if (noMoreVotes) { + break + } + + if (reloadAll) { + // If reloading all, stop once we load at least as many votes as + // we already have. + if (newVotes.length >= votes.length) { + break + } + } else { + break + } + } setVotes((prev) => - uniqBy([...prev, ...newVotes], ({ voterAddress }) => voterAddress) + uniqBy( + // Reset votes array with new votes that started from the + // beginning if we're reloading all. Otherwise, just append. + [...(reloadAll ? [] : prev), ...newVotes], + ({ voterAddress }) => voterAddress + ) ) - setNoMoreVotes(newVotes.length < VOTES_PER_PAGE) + setNoMoreVotes(noMoreVotes) } finally { setLoading(false) } @@ -89,13 +122,13 @@ export const ProposalVotes = (props: BaseProposalVotesProps) => { votes, ] ) - // Load once proposal is ready. + // Load once proposal is ready or refresh proposal ID changes. useEffect(() => { if (!loadingProposal.loading) { - loadVotes() + loadVotes(true) } // eslint-disable-next-line react-hooks/exhaustive-deps - }, [loadingProposal.loading]) + }, [loadingProposal.loading, refreshProposalId]) const getAllVotes = useRecoilCallback( ({ snapshot }) => diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalRefreshers.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalRefreshers.ts index ded7819ae..23d70233c 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalRefreshers.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/hooks/useProposalRefreshers.ts @@ -1,6 +1,6 @@ import { useQueryClient } from '@tanstack/react-query' import { useCallback } from 'react' -import { constSelector, useSetRecoilState } from 'recoil' +import { constSelector, useRecoilState, useSetRecoilState } from 'recoil' import { DaoPreProposeApprovalSingleSelectors, @@ -22,7 +22,7 @@ export const useProposalRefreshers = (): ProposalRefreshers => { const queryClient = useQueryClient() const setRefreshProposalsId = useSetRecoilState(refreshProposalsIdAtom) - const setRefreshProposalId = useSetRecoilState( + const [refreshProposalId, setRefreshProposalId] = useRecoilState( refreshProposalIdAtom({ address: isPreProposeApprovalProposal && proposalModule.prePropose @@ -96,6 +96,7 @@ export const useProposalRefreshers = (): ProposalRefreshers => { ) return { + refreshProposalId, refreshProposal, refreshProposalAndAll, refreshing: isPreProposeApprovalProposal diff --git a/packages/types/clients/proposal-module.ts b/packages/types/clients/proposal-module.ts index 14203b67f..bece2cc3e 100644 --- a/packages/types/clients/proposal-module.ts +++ b/packages/types/clients/proposal-module.ts @@ -96,7 +96,7 @@ export interface IProposalModuleBase< */ getVoteQuery(options: { proposalId: number - voter: string | undefined + voter?: string }): FetchQueryOptions /** diff --git a/packages/types/proposal-module-adapter.ts b/packages/types/proposal-module-adapter.ts index dbc81e25e..722a111dc 100644 --- a/packages/types/proposal-module-adapter.ts +++ b/packages/types/proposal-module-adapter.ts @@ -358,6 +358,7 @@ export type WalletVoteInfo = { } export type ProposalRefreshers = { + refreshProposalId: number refreshProposal: () => void refreshProposalAndAll: () => void refreshing: boolean From a1e6723d32dcff917a9ca94a7ba826e9879d5790 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 1 Aug 2024 17:47:26 -0400 Subject: [PATCH 391/438] updated secret testnet proposal module code IDs/hashes --- packages/utils/constants/chains.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index d09b9f9fb..8bd78280a 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -2310,8 +2310,8 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ DaoPreProposeApprover: 9764, DaoPreProposeMultiple: 9748, DaoPreProposeSingle: 9798, - DaoProposalMultiple: 9749, - DaoProposalSingle: 9901, + DaoProposalMultiple: 10055, + DaoProposalSingle: 10054, DaoVotingCw4: 9790, DaoVotingCw20Staked: 9793, // snip20 DaoVotingCw721Staked: 9767, // snip721 @@ -2346,9 +2346,9 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ DaoPreProposeMultiple: '612c77da536f67edadde8d132d7e8e255dee0fcb5a52155163215809b4ac683c', DaoPreProposeSingle: - 'e10ae1c3c1ffd3fb3102ed12b6daf0a854885257cca1ad0051ef0dbf992d50fc', + '6cd22250c1756dc00b9cc0dbad81907547b0e8db8cde51becb2486c21d323f6d', DaoProposalMultiple: - 'ee0fa42d0b33670494252f3c50219fe0076a96542a5c9ac66b2fa91c0ad6c41f', + 'abe4630509aeda95d1613e22d579b009ae5fe7a6b83f0476d8ca0f69343998b7', DaoProposalSingle: '6cd22250c1756dc00b9cc0dbad81907547b0e8db8cde51becb2486c21d323f6d', DaoVotingCw4: From 6a9fa9ccb9b4f03a442caf6d3315bbdf7e41d5dc Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 1 Aug 2024 18:31:28 -0400 Subject: [PATCH 392/438] fixced secret testnet code hash --- packages/utils/constants/chains.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 8bd78280a..ab6df5855 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -2346,7 +2346,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ DaoPreProposeMultiple: '612c77da536f67edadde8d132d7e8e255dee0fcb5a52155163215809b4ac683c', DaoPreProposeSingle: - '6cd22250c1756dc00b9cc0dbad81907547b0e8db8cde51becb2486c21d323f6d', + 'e10ae1c3c1ffd3fb3102ed12b6daf0a854885257cca1ad0051ef0dbf992d50fc', DaoProposalMultiple: 'abe4630509aeda95d1613e22d579b009ae5fe7a6b83f0476d8ca0f69343998b7', DaoProposalSingle: From 6a11d3f2eee27323088a8a7c89b1711459f8243d Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 2 Aug 2024 01:36:36 -0400 Subject: [PATCH 393/438] added create permit profile card to proposal page --- packages/i18n/locales/en/translation.json | 3 +- .../components/dao/CreateDaoPermit.tsx | 47 +++++++++++++++++++ packages/stateful/components/dao/index.ts | 1 + .../stateful/components/dao/tabs/HomeTab.tsx | 43 +++-------------- .../gov/GovProposalStatusAndInfo.tsx | 13 ++--- .../profile/ProfileProposalCard.tsx | 25 +++++++--- .../useDaoWithWalletSecretNetworkPermit.ts | 31 ++++++++---- .../stateful/hooks/useProposalVetoState.tsx | 6 +-- .../components/ProposalStatusAndInfo.tsx | 15 +++--- .../components/ProposalStatusAndInfo.tsx | 11 ++--- .../ProposalStatusAndInfoLoader.tsx | 3 +- .../profile/ProfileCreatePermitCard.tsx | 38 +++++++++++++++ .../stateless/components/profile/index.ts | 1 + .../ProposalStatusAndInfo.stories.tsx | 5 +- .../proposal/ProposalStatusAndInfo.tsx | 10 ++-- packages/stateless/pages/Proposal.stories.tsx | 3 +- packages/types/components/CreateDaoPermit.ts | 6 +++ .../types/components/ProfileCardWrapper.ts | 2 +- packages/types/components/index.ts | 1 + 19 files changed, 171 insertions(+), 93 deletions(-) create mode 100644 packages/stateful/components/dao/CreateDaoPermit.tsx create mode 100644 packages/stateless/components/profile/ProfileCreatePermitCard.tsx create mode 100644 packages/types/components/CreateDaoPermit.ts diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 439e32776..37d522a47 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -1015,7 +1015,7 @@ "createNftCollectionDescription_dao": "Create a new NFT collection controlled by the DAO.", "createNftCollectionDescription_gov": "Create a new NFT collection controlled by the chain.", "createNftCollectionDescription_wallet": "Create a new NFT collection controlled by you.", - "createPermitToInteractWithDao": "Create a permit for this browser to view your membership status and interact with the DAO securely.", + "createPermitToInteractWithDao": "Create a permit for this browser to view your membership status, vote, and interact with the DAO securely.", "createPostDescription": "Create a post on the DAO's press.", "createPressContract": "To set up Press, you must first create a smart contract to manage it.", "createStep1": "Pick a DAO type and name it", @@ -1166,6 +1166,7 @@ "mintActionDescription": "Mint new governance tokens.", "mintExplanation": "This action mints new tokens, increasing the token supply. With great power comes great responsibility; be careful! If you have an active threshold set, this may lock the DAO.", "mintNftDescription": "Create a new NFT.", + "missingPermit": "Missing permit", "mustViewAllActionPagesBeforeVoting": "You must view all action pages before voting.", "na": "N/A", "name": "Name", diff --git a/packages/stateful/components/dao/CreateDaoPermit.tsx b/packages/stateful/components/dao/CreateDaoPermit.tsx new file mode 100644 index 000000000..6db623573 --- /dev/null +++ b/packages/stateful/components/dao/CreateDaoPermit.tsx @@ -0,0 +1,47 @@ +import { Key } from '@mui/icons-material' +import clsx from 'clsx' +import { useState } from 'react' +import toast from 'react-hot-toast' +import { useTranslation } from 'react-i18next' + +import { Button } from '@dao-dao/stateless' +import { CreateDaoPermitProps } from '@dao-dao/types' +import { processError } from '@dao-dao/utils' + +import { useDaoWithWalletSecretNetworkPermit } from '../../hooks' + +export const CreateDaoPermit = ({ className }: CreateDaoPermitProps) => { + const { t } = useTranslation() + const { getPermit } = useDaoWithWalletSecretNetworkPermit() + + const [creatingPermit, setCreatingPermit] = useState(false) + const createPermit = async () => { + setCreatingPermit(true) + try { + await getPermit() + toast.success(t('success.createdPermit')) + } catch (error) { + console.error(error) + toast.error(processError(error)) + } finally { + setCreatingPermit(false) + } + } + + return ( +
+

{t('info.createPermitToInteractWithDao')}

+ + +
+ ) +} diff --git a/packages/stateful/components/dao/index.ts b/packages/stateful/components/dao/index.ts index 869eda7b9..7cc7c1341 100644 --- a/packages/stateful/components/dao/index.ts +++ b/packages/stateful/components/dao/index.ts @@ -2,6 +2,7 @@ export * from './tabs' export * from './tabs/HomeTab' export * from './CreateDaoForm' +export * from './CreateDaoPermit' export * from './CreateDaoProposal' export * from './CreateSubDao' export * from './DaoCard' diff --git a/packages/stateful/components/dao/tabs/HomeTab.tsx b/packages/stateful/components/dao/tabs/HomeTab.tsx index 6656a5315..6f2d01143 100644 --- a/packages/stateful/components/dao/tabs/HomeTab.tsx +++ b/packages/stateful/components/dao/tabs/HomeTab.tsx @@ -1,18 +1,14 @@ -import { Key } from '@mui/icons-material' -import { useMemo, useState } from 'react' -import toast from 'react-hot-toast' +import { useMemo } from 'react' import { useTranslation } from 'react-i18next' import { waitForAll } from 'recoil' import { - Button, DaoSplashHeader, useAppContext, useCachedLoadable, useDaoContext, } from '@dao-dao/stateless' import { CheckedDepositInfo, DaoPageMode } from '@dao-dao/types' -import { processError } from '@dao-dao/utils' import { useDaoWithWalletSecretNetworkPermit } from '../../../hooks' import { matchAndLoadCommon } from '../../../proposal-module-adapter' @@ -20,6 +16,7 @@ import { useVotingModuleAdapter } from '../../../voting-module-adapter' import { ButtonLink } from '../../ButtonLink' import { ConnectWallet } from '../../ConnectWallet' import { LinkWrapper } from '../../LinkWrapper' +import { CreateDaoPermit } from '../CreateDaoPermit' import { DaoWidgets } from '../DaoWidgets' import { MainDaoInfoCards } from '../MainDaoInfoCards' @@ -27,23 +24,9 @@ export const HomeTab = () => { const { t } = useTranslation() const { dao } = useDaoContext() const { mode } = useAppContext() - const { isSecretNetwork, isWalletConnected, permit, getPermit } = + const { isWalletConnected, isSecretNetworkPermitNeeded } = useDaoWithWalletSecretNetworkPermit() - const [creatingPermit, setCreatingPermit] = useState(false) - const createPermit = async () => { - setCreatingPermit(true) - try { - await getPermit() - toast.success(t('success.createdPermit')) - } catch (error) { - console.error(error) - toast.error(processError(error)) - } finally { - setCreatingPermit(false) - } - } - const { components: { ProfileCardMemberInfo }, hooks: { useCommonGovernanceTokenInfo }, @@ -94,7 +77,7 @@ export const HomeTab = () => {

{t('title.membership')}

- {isWalletConnected && (!isSecretNetwork || permit) ? ( + {isWalletConnected && !isSecretNetworkPermitNeeded ? ( 0 @@ -102,22 +85,8 @@ export const HomeTab = () => { : undefined } /> - ) : isWalletConnected && isSecretNetwork && !permit ? ( - <> -

- {t('info.createPermitToInteractWithDao')} -

- - - + ) : isSecretNetworkPermitNeeded ? ( + ) : ( <>

{t('info.logInToViewMembership')}

diff --git a/packages/stateful/components/gov/GovProposalStatusAndInfo.tsx b/packages/stateful/components/gov/GovProposalStatusAndInfo.tsx index 9e5c77e44..75a064c41 100644 --- a/packages/stateful/components/gov/GovProposalStatusAndInfo.tsx +++ b/packages/stateful/components/gov/GovProposalStatusAndInfo.tsx @@ -35,10 +35,7 @@ import { GovProposalWithMetadata, TokenType, } from '@dao-dao/types' -import { - ProposalStatus, - Vote, -} from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' +import { ProposalStatus } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' import { MsgDeposit } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/tx' import { CHAIN_GAS_MULTIPLIER, @@ -141,7 +138,7 @@ const InnerGovProposalStatusAndInfo = ({ depositToken.decimals ) - const info: ProposalStatusAndInfoProps['info'] = [ + const info: ProposalStatusAndInfoProps['info'] = [ { Icon: (props) => , label: t('title.dao'), @@ -164,7 +161,7 @@ const InnerGovProposalStatusAndInfo = ({ ), }, - ] as ProposalStatusAndInfoProps['info']) + ] as ProposalStatusAndInfoProps['info']) : []), { Icon: RotateRightOutlined, @@ -201,7 +198,7 @@ const InnerGovProposalStatusAndInfo = ({ ), }, - ] as ProposalStatusAndInfoProps['info']) + ] as ProposalStatusAndInfoProps['info']) : []), ] @@ -361,7 +358,7 @@ const InnerProposalStatusAndInfoLoader = ( const LoaderP: ComponentType<{ className: string }> = ({ className }) => (

...

) - const info: ProposalStatusAndInfoProps['info'] = [ + const info: ProposalStatusAndInfoProps['info'] = [ { Icon: (props) => , label: t('title.dao'), diff --git a/packages/stateful/components/profile/ProfileProposalCard.tsx b/packages/stateful/components/profile/ProfileProposalCard.tsx index 932a28b58..45a4ad8dc 100644 --- a/packages/stateful/components/profile/ProfileProposalCard.tsx +++ b/packages/stateful/components/profile/ProfileProposalCard.tsx @@ -5,26 +5,28 @@ import { updateProfileNftVisibleAtom } from '@dao-dao/state/recoil' import { Loader, ProfileCantVoteCard, + ProfileCreatePermitCard, ProfileVoteCard, useCachedLoadable, - useDaoContext, } from '@dao-dao/stateless' import { CheckedDepositInfo } from '@dao-dao/types/contracts/common' -import { useManageProfile, useMembership } from '../../hooks' +import { + useDaoWithWalletSecretNetworkPermit, + useManageProfile, + useMembership, +} from '../../hooks' import { matchAndLoadCommon, useProposalModuleAdapter, } from '../../proposal-module-adapter' import { useVotingModuleAdapter } from '../../voting-module-adapter' +import { CreateDaoPermit } from '../dao' import { SuspenseLoader } from '../SuspenseLoader' -export interface ProfileProposalCardProps { - onVoteSuccess: () => void | Promise -} - export const ProfileProposalCard = () => { - const { dao } = useDaoContext() + const { dao, isSecretNetworkPermitNeeded } = + useDaoWithWalletSecretNetworkPermit() const { profile, updateProfile: { go: updateProfile }, @@ -81,6 +83,15 @@ export const ProfileProposalCard = () => { const loadingWalletVoteInfo = useLoadingWalletVoteInfo() + if (isSecretNetworkPermitNeeded) { + return ( + + ) + } + // This card should only display when a wallet is connected. The wallet vote // info hook returns undefined when there is no wallet connected. If we are // here and there is no wallet connected, something is probably just loading, diff --git a/packages/stateful/hooks/useDaoWithWalletSecretNetworkPermit.ts b/packages/stateful/hooks/useDaoWithWalletSecretNetworkPermit.ts index 1e63e022a..f8f4d44c8 100644 --- a/packages/stateful/hooks/useDaoWithWalletSecretNetworkPermit.ts +++ b/packages/stateful/hooks/useDaoWithWalletSecretNetworkPermit.ts @@ -9,7 +9,10 @@ import { useDaoClient } from './useDaoClient' import { useOnSecretNetworkPermitUpdate } from './useOnSecretNetworkPermitUpdate' import { UseWalletOptions, UseWalletReturn, useWallet } from './useWallet' -export type UseWalletWithSecretNetworkPermitOptions = UseWalletOptions & { +export type UseWalletWithSecretNetworkPermitOptions = Omit< + UseWalletOptions, + 'chainId' +> & { /** * DAO to fetch the permit for, or the current DAO context. */ @@ -21,6 +24,12 @@ export type UseWalletWithSecretNetworkPermitReturn = UseWalletReturn & { * Whether or not the current chain is Secret Network. */ isSecretNetwork: boolean + /** + * Whether or not a permit is needed. This is true when the wallet is + * connected, the DAO is on Secret Network, and no permit has been found for + * the current DAO in the browser. + */ + isSecretNetworkPermitNeeded: boolean /** * DAO client. */ @@ -45,7 +54,10 @@ export const useDaoWithWalletSecretNetworkPermit = ({ const { dao: daoClient } = useDaoClient({ dao, }) - const wallet = useWallet(options) + const wallet = useWallet({ + chainId: daoClient.chainId, + ...options, + }) // Stabilize reference so callback doesn't change. This only needs to update // on wallet connection state change anyway. @@ -107,16 +119,19 @@ export const useDaoWithWalletSecretNetworkPermit = ({ return permit }, [daoClient, wallet.address, wallet.isWalletConnected]) - const response = useMemo( - (): UseWalletWithSecretNetworkPermitReturn => ({ + const response = useMemo((): UseWalletWithSecretNetworkPermitReturn => { + const isSecret = isSecretNetwork(daoClient.chainId) + + return { ...wallet, - isSecretNetwork: isSecretNetwork(wallet.chain.chain_id), + isSecretNetwork: isSecret, + isSecretNetworkPermitNeeded: + wallet.isWalletConnected && isSecret && !permit, dao: daoClient, permit, getPermit, - }), - [wallet, daoClient, permit, getPermit] - ) + } + }, [wallet, daoClient, permit, getPermit]) return response } diff --git a/packages/stateful/hooks/useProposalVetoState.tsx b/packages/stateful/hooks/useProposalVetoState.tsx index df59ffe56..e29838ff5 100644 --- a/packages/stateful/hooks/useProposalVetoState.tsx +++ b/packages/stateful/hooks/useProposalVetoState.tsx @@ -50,7 +50,7 @@ export type UseProposalVetoStateReturn = { vetoEnabled: boolean canBeVetoed: boolean vetoOrEarlyExecute: ProposalStatusAndInfoProps['vetoOrEarlyExecute'] - vetoInfoItems: ProposalStatusAndInfoProps['info'] + vetoInfoItems: ProposalStatusAndInfoProps['info'] } /** @@ -390,14 +390,14 @@ export const useProposalVetoState = ({ ), }, - ] as ProposalStatusAndInfoProps['info']) + ] as ProposalStatusAndInfoProps['info']) : (vetoerEntities.map((entity) => ({ Icon: ThumbDownOutlined, label: t('title.vetoer'), Value: (props) => ( ), - })) as ProposalStatusAndInfoProps['info']) + })) as ProposalStatusAndInfoProps['info']) : [], } } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalStatusAndInfo.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalStatusAndInfo.tsx index ced04c1aa..1acf2d6c1 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalStatusAndInfo.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/components/ProposalStatusAndInfo.tsx @@ -33,7 +33,6 @@ import { DepositRefundPolicy, ProposalStatusEnum, } from '@dao-dao/types' -import { MultipleChoiceVote } from '@dao-dao/types/contracts/DaoProposalMultiple' import { formatDateTimeTz, formatPercentOf100, @@ -174,7 +173,7 @@ const InnerProposalStatusAndInfo = ({ const timeAgoFormatter = useTranslatedTimeDeltaFormatter({ words: false }) - const info: ProposalStatusAndInfoProps['info'] = [ + const info: ProposalStatusAndInfoProps['info'] = [ { Icon: (props) => , label: t('title.dao'), @@ -204,7 +203,7 @@ const InnerProposalStatusAndInfo = ({ label: t('title.revoting'), Value: (props) =>

{t('info.enabled')}

, }, - ] as ProposalStatusAndInfoProps['info']) + ] as ProposalStatusAndInfoProps['info']) : []), ...(timestampInfo.display ? ([ @@ -217,7 +216,7 @@ const InnerProposalStatusAndInfo = ({ ), }, - ] as ProposalStatusAndInfoProps['info']) + ] as ProposalStatusAndInfoProps['info']) : []), ...(vetoTimelockExpiration ? ([ @@ -235,7 +234,7 @@ const InnerProposalStatusAndInfo = ({ ), }, - ] as ProposalStatusAndInfoProps['info']) + ] as ProposalStatusAndInfoProps['info']) : []), ...(loadingExecutionTxHash.loading || loadingExecutionTxHash.data ? ([ @@ -268,7 +267,7 @@ const InnerProposalStatusAndInfo = ({
) : null, }, - ] as ProposalStatusAndInfoProps['info']) + ] as ProposalStatusAndInfoProps['info']) : []), ...(winningChoice && (statusKey === ProposalStatusEnum.Passed || @@ -284,7 +283,7 @@ const InnerProposalStatusAndInfo = ({ ), }, - ] as ProposalStatusAndInfoProps['info']) + ] as ProposalStatusAndInfoProps['info']) : []), ] @@ -399,7 +398,7 @@ const InnerProposalStatusAndInfoLoader = ( const LoaderP: ComponentType<{ className: string }> = ({ className }) => (

...

) - const info: ProposalStatusAndInfoProps['info'] = [ + const info: ProposalStatusAndInfoProps['info'] = [ { Icon: (props) => , label: t('title.dao'), diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfo.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfo.tsx index 14d805dfd..80496ce98 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfo.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfo.tsx @@ -34,7 +34,6 @@ import { PreProposeModuleType, ProposalStatusEnum, } from '@dao-dao/types' -import { Vote } from '@dao-dao/types/contracts/DaoProposalSingle.common' import { formatDateTimeTz, formatPercentOf100, @@ -218,7 +217,7 @@ const InnerProposalStatusAndInfo = ({ onExecuteSuccess, }) - const info: ProposalStatusAndInfoProps['info'] = [ + const info: ProposalStatusAndInfoProps['info'] = [ { Icon: (props) => , label: t('title.dao'), @@ -282,7 +281,7 @@ const InnerProposalStatusAndInfo = ({ label: t('title.revoting'), Value: (props) =>

{t('info.enabled')}

, }, - ] as ProposalStatusAndInfoProps['info']) + ] as ProposalStatusAndInfoProps['info']) : []), ...(timestampInfo.display ? ([ @@ -295,7 +294,7 @@ const InnerProposalStatusAndInfo = ({ ), }, - ] as ProposalStatusAndInfoProps['info']) + ] as ProposalStatusAndInfoProps['info']) : []), ...(vetoTimelockExpiration ? ([ @@ -313,7 +312,7 @@ const InnerProposalStatusAndInfo = ({ ), }, - ] as ProposalStatusAndInfoProps['info']) + ] as ProposalStatusAndInfoProps['info']) : []), ...(loadingExecutionTxHash.loading || loadingExecutionTxHash.data ? ([ @@ -346,7 +345,7 @@ const InnerProposalStatusAndInfo = ({
) : null, }, - ] as ProposalStatusAndInfoProps['info']) + ] as ProposalStatusAndInfoProps['info']) : []), ...(approvedProposalPath ? ([ diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfoLoader.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfoLoader.tsx index 3de9fdf87..4b5051d8c 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfoLoader.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/components/ProposalStatusAndInfoLoader.tsx @@ -15,7 +15,6 @@ import { useDaoNavHelpers, } from '@dao-dao/stateless' import { BaseProposalStatusAndInfoProps } from '@dao-dao/types' -import { Vote } from '@dao-dao/types/contracts/DaoProposalSingle.common' import { ButtonLink } from '../../../../components/ButtonLink' @@ -29,7 +28,7 @@ export const ProposalStatusAndInfoLoader = ( const LoaderP: ComponentType<{ className: string }> = ({ className }) => (

...

) - const info: ProposalStatusAndInfoProps['info'] = [ + const info: ProposalStatusAndInfoProps['info'] = [ { Icon: (props) => , label: t('title.dao'), diff --git a/packages/stateless/components/profile/ProfileCreatePermitCard.tsx b/packages/stateless/components/profile/ProfileCreatePermitCard.tsx new file mode 100644 index 000000000..14ddfbd55 --- /dev/null +++ b/packages/stateless/components/profile/ProfileCreatePermitCard.tsx @@ -0,0 +1,38 @@ +import { ComponentType } from 'react' +import { useTranslation } from 'react-i18next' + +import { CreateDaoPermitProps, ProfileCardWrapperProps } from '@dao-dao/types' + +import { ProfileCardWrapper } from './ProfileCardWrapper' + +export type ProfileCreatePermitCardProps = Omit< + ProfileCardWrapperProps, + | 'children' + | 'underHeaderComponent' + | 'childContainerClassName' + | 'established' + | 'compact' +> & { + CreatePermit: ComponentType +} + +export const ProfileCreatePermitCard = ({ + CreatePermit, + ...wrapperProps +}: ProfileCreatePermitCardProps) => { + const { t } = useTranslation() + + return ( + + {t('info.missingPermit')} +

+ } + {...wrapperProps} + > + +
+ ) +} diff --git a/packages/stateless/components/profile/index.ts b/packages/stateless/components/profile/index.ts index 7d2b2edbb..a3aac2b31 100644 --- a/packages/stateless/components/profile/index.ts +++ b/packages/stateless/components/profile/index.ts @@ -3,6 +3,7 @@ export * from './ProfileAddChains' export * from './ProfileActions' export * from './ProfileCantVoteCard' export * from './ProfileCardWrapper' +export * from './ProfileCreatePermitCard' export * from './ProfileDaos' export * from './ProfileFeed' export * from './ProfileImage' diff --git a/packages/stateless/components/proposal/ProposalStatusAndInfo.stories.tsx b/packages/stateless/components/proposal/ProposalStatusAndInfo.stories.tsx index 4ab9cc308..050a85a0f 100644 --- a/packages/stateless/components/proposal/ProposalStatusAndInfo.stories.tsx +++ b/packages/stateless/components/proposal/ProposalStatusAndInfo.stories.tsx @@ -8,7 +8,6 @@ import { import { ComponentMeta, ComponentStory } from '@storybook/react' import { ProposalVoterProps } from '@dao-dao/types' -import { Vote as VoteType } from '@dao-dao/types/contracts/DaoProposalSingle.common' import { ButtonLink } from '../buttons' import { CopyToClipboardUnderline } from '../CopyToClipboard' @@ -23,9 +22,7 @@ export default { component: ProposalStatusAndInfo, } as ComponentMeta -const Template: ComponentStory> = ( - args -) => ( +const Template: ComponentStory = (args) => (
diff --git a/packages/stateless/components/proposal/ProposalStatusAndInfo.tsx b/packages/stateless/components/proposal/ProposalStatusAndInfo.tsx index c44c27483..974d902cd 100644 --- a/packages/stateless/components/proposal/ProposalStatusAndInfo.tsx +++ b/packages/stateless/components/proposal/ProposalStatusAndInfo.tsx @@ -3,13 +3,11 @@ import clsx from 'clsx' import { ComponentType, Fragment, ReactNode } from 'react' import { useTranslation } from 'react-i18next' -import { ProposalVoterProps } from '@dao-dao/types' - import { Button } from '../buttons' import { StatusCard } from '../StatusCard' import { ProposalVoteButton } from './ProposalVoteButton' -export type ProposalStatusAndInfoProps = { +export type ProposalStatusAndInfoProps = { status?: string info: { Icon: ComponentType<{ className: string }> @@ -42,10 +40,10 @@ export type ProposalStatusAndInfoProps = { /** * Voter component. Only shown on desktop. Should only be defined if can vote. */ - Voter?: ComponentType, 'className'>> + Voter?: ComponentType<{ className: string }> } -export const ProposalStatusAndInfo = ({ +export const ProposalStatusAndInfo = ({ status, info, inline = false, @@ -54,7 +52,7 @@ export const ProposalStatusAndInfo = ({ footer, className, Voter, -}: ProposalStatusAndInfoProps) => { +}: ProposalStatusAndInfoProps) => { const { t } = useTranslation() return ( diff --git a/packages/stateless/pages/Proposal.stories.tsx b/packages/stateless/pages/Proposal.stories.tsx index 294c84e11..12f36f5c3 100644 --- a/packages/stateless/pages/Proposal.stories.tsx +++ b/packages/stateless/pages/Proposal.stories.tsx @@ -10,7 +10,6 @@ import { makeDappLayoutDecorator, makeProposalModuleAdapterDecorator, } from '@dao-dao/storybook/decorators' -import { Vote } from '@dao-dao/types/contracts/DaoProposalSingle.common' import { ProposalContentDisplayProps, @@ -44,7 +43,7 @@ export const Default = Template.bind({}) Default.args = { ProposalStatusAndInfo: (props) => ( )} + {...(ProposalStatusAndInfoVoteStory.args as ProposalStatusAndInfoProps)} {...props} /> ), diff --git a/packages/types/components/CreateDaoPermit.ts b/packages/types/components/CreateDaoPermit.ts new file mode 100644 index 000000000..1afb078f9 --- /dev/null +++ b/packages/types/components/CreateDaoPermit.ts @@ -0,0 +1,6 @@ +export type CreateDaoPermitProps = { + /** + * Optionally apply a class name to the container. + */ + className?: string +} diff --git a/packages/types/components/ProfileCardWrapper.ts b/packages/types/components/ProfileCardWrapper.ts index 982a170cd..3aff13995 100644 --- a/packages/types/components/ProfileCardWrapper.ts +++ b/packages/types/components/ProfileCardWrapper.ts @@ -6,7 +6,7 @@ import { UnifiedProfile } from '../profile' export type ProfileCardWrapperProps = { children?: ReactNode | ReactNode[] profile: LoadingData - underHeaderComponent: ReactNode + underHeaderComponent?: ReactNode childContainerClassName?: string compact?: boolean className?: string diff --git a/packages/types/components/index.ts b/packages/types/components/index.ts index 57ff898d5..db7870eec 100644 --- a/packages/types/components/index.ts +++ b/packages/types/components/index.ts @@ -9,6 +9,7 @@ export * from './Collapsible' export * from './CommandModal' export * from './ConnectWallet' export * from './CopyToClipboard' +export * from './CreateDaoPermit' export * from './DaoCard' export * from './DaoDappTabbedHome' export * from './DaoDropdown' From 4371e85a7b226ecfcf1a249c637b7a9fe71dd54f Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 2 Aug 2024 01:36:47 -0400 Subject: [PATCH 394/438] increase gas costs --- packages/utils/constants/other.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/utils/constants/other.ts b/packages/utils/constants/other.ts index d58ba7d1f..49087e4ac 100644 --- a/packages/utils/constants/other.ts +++ b/packages/utils/constants/other.ts @@ -191,10 +191,10 @@ export const VALENCE_ALLOWLIST = [ export const SECRET_GAS = { DAO_CREATION: 1_000_000, PROPOSE: 1_000_000, - VOTE: 100_000, + VOTE: 500_000, EXECUTE: 1_000_000, - CLOSE: 100_000, - VETO: 100_000, + CLOSE: 500_000, + VETO: 500_000, STAKE: 100_000, UNSTAKE: 100_000, CLAIM: 100_000, From 634515bb5ef5416edd58463486bc0216f7d8d6e6 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 2 Aug 2024 18:45:19 -0400 Subject: [PATCH 395/438] replaced a bunch of recoil selectors with react-query, fixed vesting payments loading, cleaned up wallet balances code --- packages/state/contracts/CwPayrollFactory.ts | 47 +- packages/state/contracts/CwVesting.ts | 103 ++-- packages/state/query/queries/chain.ts | 225 ++++++++ .../queries/contracts/Cw1Whitelist.extra.ts | 51 ++ .../query/queries/contracts/Cw1Whitelist.ts | 56 -- .../contracts/CwPayrollFactory.extra.ts | 87 ++++ .../queries/contracts/CwPayrollFactory.ts | 493 ++++++++++++++++++ .../queries/contracts/CwVesting.extra.ts | 473 +++++++++++++++++ .../query/queries/contracts/CwVesting.ts | 330 ++++++++++++ .../state/query/queries/contracts/index.ts | 5 + packages/state/recoil/atoms/refresh.ts | 16 +- packages/state/recoil/selectors/chain.ts | 178 ------- .../selectors/contracts/Cw1Whitelist.ts | 87 +--- .../selectors/contracts/CwPayrollFactory.ts | 327 ------------ .../recoil/selectors/contracts/CwVesting.ts | 199 +------ .../state/recoil/selectors/contracts/index.ts | 1 - packages/state/recoil/selectors/index.ts | 1 - packages/state/recoil/selectors/token.ts | 140 ++--- packages/state/recoil/selectors/vesting.ts | 401 -------------- .../core/treasury/ManageStaking/index.tsx | 67 +-- .../ManageVesting/BeginVesting.stories.tsx | 2 +- .../treasury/ManageVesting/BeginVesting.tsx | 4 +- .../treasury/ManageVesting/CancelVesting.tsx | 5 +- .../core/treasury/ManageVesting/index.tsx | 104 ++-- .../components/PfpkNftSelectionModal.tsx | 3 +- .../stateful/components/dao/CreateDaoForm.tsx | 3 +- .../stateful/components/dao/DaoTokenCard.tsx | 31 +- .../components/dao/DaoTokenDepositModal.tsx | 12 +- .../components/dao/DaoTxTreasuryHistory.tsx | 7 +- .../components/vesting/VestingPaymentCard.tsx | 88 +++- .../components/vesting/VestingPaymentLine.tsx | 35 ++ .../vesting/VestingStakingModal.tsx | 65 ++- packages/stateful/components/vesting/index.ts | 1 + .../components/wallet/WalletStakingModal.tsx | 82 +-- .../components/wallet/WalletTokenCard.tsx | 42 +- packages/stateful/hooks/index.ts | 1 - .../hooks/query/useQueryLoadingData.ts | 20 +- packages/stateful/hooks/useWallet.ts | 54 +- packages/stateful/hooks/useWalletBalances.ts | 97 ---- .../common/hooks/makeUsePublishProposal.ts | 21 +- .../common/hooks/makeUsePublishProposal.ts | 21 +- packages/stateful/queries/entity.ts | 6 +- .../components/ProfileCardMemberInfo.tsx | 8 +- .../components/StakingModal.tsx | 8 +- .../components/ProfileCardMemberInfo.tsx | 8 +- .../components/ProfileCardMemberInfo.tsx | 10 +- .../components/StakingModal.tsx | 8 +- .../components/ProfileCardMemberInfo.tsx | 10 +- .../components/StakingModal.tsx | 8 +- .../components/StakingModal.tsx | 4 +- .../Renderer/TabRenderer/TabRenderer.tsx | 51 +- .../Renderer/TabRenderer/index.tsx | 76 +-- .../components/token/TokenAmountDisplay.tsx | 4 +- .../components/vesting/VestingPaymentLine.tsx | 14 +- .../types/components/TokenAmountDisplay.ts | 4 + .../types/components/VestingPaymentCard.ts | 5 + .../types/components/VestingPaymentLine.ts | 16 + packages/types/components/index.ts | 2 + packages/types/contracts/CwPayrollFactory.ts | 47 +- packages/types/contracts/CwVesting.ts | 24 +- packages/types/vesting.ts | 1 + packages/utils/constants/other.ts | 7 +- 62 files changed, 2495 insertions(+), 1811 deletions(-) create mode 100644 packages/state/query/queries/contracts/Cw1Whitelist.extra.ts create mode 100644 packages/state/query/queries/contracts/CwPayrollFactory.extra.ts create mode 100644 packages/state/query/queries/contracts/CwPayrollFactory.ts create mode 100644 packages/state/query/queries/contracts/CwVesting.extra.ts create mode 100644 packages/state/query/queries/contracts/CwVesting.ts delete mode 100644 packages/state/recoil/selectors/contracts/CwPayrollFactory.ts delete mode 100644 packages/state/recoil/selectors/vesting.ts create mode 100644 packages/stateful/components/vesting/VestingPaymentLine.tsx delete mode 100644 packages/stateful/hooks/useWalletBalances.ts create mode 100644 packages/types/components/VestingPaymentCard.ts create mode 100644 packages/types/components/VestingPaymentLine.ts diff --git a/packages/state/contracts/CwPayrollFactory.ts b/packages/state/contracts/CwPayrollFactory.ts index 549b4b414..8fa59ed26 100644 --- a/packages/state/contracts/CwPayrollFactory.ts +++ b/packages/state/contracts/CwPayrollFactory.ts @@ -1,3 +1,9 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + import { Coin, StdFee } from '@cosmjs/amino' import { CosmWasmClient, @@ -5,12 +11,15 @@ import { SigningCosmWasmClient, } from '@cosmjs/cosmwasm-stargate' -import { Binary, Uint128, Uint64 } from '@dao-dao/types' -import { ArrayOfVestingContract } from '@dao-dao/types/contracts/CwPayrollFactory' import { + Action, + ArrayOfVestingContract, + Binary, InstantiateMsg, OwnershipForAddr, -} from '@dao-dao/types/contracts/CwVesting' + Uint128, + Uint64, +} from '@dao-dao/types/contracts/CwPayrollFactory' import { CHAIN_GAS_MULTIPLIER } from '@dao-dao/utils' export interface CwPayrollFactoryReadOnlyInterface { @@ -73,7 +82,6 @@ export class CwPayrollFactoryQueryClient { client: CosmWasmClient contractAddress: string - constructor(client: CosmWasmClient, contractAddress: string) { this.client = client this.contractAddress = contractAddress @@ -91,7 +99,6 @@ export class CwPayrollFactoryQueryClient this.ownership = this.ownership.bind(this) this.codeId = this.codeId.bind(this) } - listVestingContracts = async ({ limit, startAfter, @@ -215,7 +222,7 @@ export interface CwPayrollFactoryInterface }, fee?: number | StdFee | 'auto', memo?: string, - funds?: Coin[] + _funds?: Coin[] ) => Promise instantiateNativePayrollContract: ( { @@ -227,7 +234,7 @@ export interface CwPayrollFactoryInterface }, fee?: number | StdFee | 'auto', memo?: string, - funds?: Coin[] + _funds?: Coin[] ) => Promise updateCodeId: ( { @@ -237,12 +244,13 @@ export interface CwPayrollFactoryInterface }, fee?: number | StdFee | 'auto', memo?: string, - funds?: Coin[] + _funds?: Coin[] ) => Promise updateOwnership: ( + action: Action, fee?: number | StdFee | 'auto', memo?: string, - funds?: Coin[] + _funds?: Coin[] ) => Promise } export class CwPayrollFactoryClient @@ -252,7 +260,6 @@ export class CwPayrollFactoryClient client: SigningCosmWasmClient sender: string contractAddress: string - constructor( client: SigningCosmWasmClient, sender: string, @@ -268,7 +275,6 @@ export class CwPayrollFactoryClient this.updateCodeId = this.updateCodeId.bind(this) this.updateOwnership = this.updateOwnership.bind(this) } - receive = async ( { amount, @@ -281,7 +287,7 @@ export class CwPayrollFactoryClient }, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, @@ -295,7 +301,7 @@ export class CwPayrollFactoryClient }, fee, memo, - funds + _funds ) } instantiateNativePayrollContract = async ( @@ -308,7 +314,7 @@ export class CwPayrollFactoryClient }, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, @@ -321,7 +327,7 @@ export class CwPayrollFactoryClient }, fee, memo, - funds + _funds ) } updateCodeId = async ( @@ -332,7 +338,7 @@ export class CwPayrollFactoryClient }, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, @@ -344,23 +350,24 @@ export class CwPayrollFactoryClient }, fee, memo, - funds + _funds ) } updateOwnership = async ( + action: Action, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, this.contractAddress, { - update_ownership: {}, + update_ownership: action, }, fee, memo, - funds + _funds ) } } diff --git a/packages/state/contracts/CwVesting.ts b/packages/state/contracts/CwVesting.ts index aa505c8c2..a52b12626 100644 --- a/packages/state/contracts/CwVesting.ts +++ b/packages/state/contracts/CwVesting.ts @@ -1,3 +1,9 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + import { Coin, StdFee } from '@cosmjs/amino' import { CosmWasmClient, @@ -6,14 +12,13 @@ import { } from '@cosmjs/cosmwasm-stargate' import { + Action, Binary, - Timestamp, - Uint128, - Uint64, -} from '@dao-dao/types/contracts/common' -import { + NullableUint64, OwnershipForAddr, StakeTrackerQuery, + Timestamp, + Uint128, Vest, } from '@dao-dao/types/contracts/CwVesting' import { CHAIN_GAS_MULTIPLIER } from '@dao-dao/utils' @@ -25,13 +30,12 @@ export interface CwVestingReadOnlyInterface { distributable: ({ t }: { t?: Timestamp }) => Promise vested: ({ t }: { t?: Timestamp }) => Promise totalToVest: () => Promise - vestDuration: () => Promise - stake: (query: StakeTrackerQuery) => Promise + vestDuration: () => Promise + stake: (stakeTrackerQuery: StakeTrackerQuery) => Promise } export class CwVestingQueryClient implements CwVestingReadOnlyInterface { client: CosmWasmClient contractAddress: string - constructor(client: CosmWasmClient, contractAddress: string) { this.client = client this.contractAddress = contractAddress @@ -43,7 +47,6 @@ export class CwVestingQueryClient implements CwVestingReadOnlyInterface { this.vestDuration = this.vestDuration.bind(this) this.stake = this.stake.bind(this) } - ownership = async (): Promise => { return this.client.queryContractSmart(this.contractAddress, { ownership: {}, @@ -73,14 +76,14 @@ export class CwVestingQueryClient implements CwVestingReadOnlyInterface { total_to_vest: {}, }) } - vestDuration = async (): Promise => { + vestDuration = async (): Promise => { return this.client.queryContractSmart(this.contractAddress, { vest_duration: {}, }) } - stake = async (query: StakeTrackerQuery): Promise => { + stake = async (stakeTrackerQuery: StakeTrackerQuery): Promise => { return this.client.queryContractSmart(this.contractAddress, { - stake: query, + stake: stakeTrackerQuery, }) } } @@ -99,7 +102,7 @@ export interface CwVestingInterface extends CwVestingReadOnlyInterface { }, fee?: number | StdFee | 'auto', memo?: string, - funds?: Coin[] + _funds?: Coin[] ) => Promise distribute: ( { @@ -109,12 +112,12 @@ export interface CwVestingInterface extends CwVestingReadOnlyInterface { }, fee?: number | StdFee | 'auto', memo?: string, - funds?: Coin[] + _funds?: Coin[] ) => Promise cancel: ( fee?: number | StdFee | 'auto', memo?: string, - funds?: Coin[] + _funds?: Coin[] ) => Promise delegate: ( { @@ -126,7 +129,7 @@ export interface CwVestingInterface extends CwVestingReadOnlyInterface { }, fee?: number | StdFee | 'auto', memo?: string, - funds?: Coin[] + _funds?: Coin[] ) => Promise redelegate: ( { @@ -140,7 +143,7 @@ export interface CwVestingInterface extends CwVestingReadOnlyInterface { }, fee?: number | StdFee | 'auto', memo?: string, - funds?: Coin[] + _funds?: Coin[] ) => Promise undelegate: ( { @@ -152,7 +155,7 @@ export interface CwVestingInterface extends CwVestingReadOnlyInterface { }, fee?: number | StdFee | 'auto', memo?: string, - funds?: Coin[] + _funds?: Coin[] ) => Promise setWithdrawAddress: ( { @@ -162,7 +165,7 @@ export interface CwVestingInterface extends CwVestingReadOnlyInterface { }, fee?: number | StdFee | 'auto', memo?: string, - funds?: Coin[] + _funds?: Coin[] ) => Promise withdrawDelegatorReward: ( { @@ -172,9 +175,8 @@ export interface CwVestingInterface extends CwVestingReadOnlyInterface { }, fee?: number | StdFee | 'auto', memo?: string, - funds?: Coin[] + _funds?: Coin[] ) => Promise - // Batch withdraw rewards from multiple validators. withdrawDelegatorRewards: ( { validators, @@ -182,8 +184,7 @@ export interface CwVestingInterface extends CwVestingReadOnlyInterface { validators: string[] }, fee?: number | StdFee | 'auto', - memo?: string, - funds?: Coin[] + memo?: string ) => Promise withdrawCanceledPayment: ( { @@ -193,7 +194,7 @@ export interface CwVestingInterface extends CwVestingReadOnlyInterface { }, fee?: number | StdFee | 'auto', memo?: string, - funds?: Coin[] + _funds?: Coin[] ) => Promise registerSlash: ( { @@ -209,12 +210,13 @@ export interface CwVestingInterface extends CwVestingReadOnlyInterface { }, fee?: number | StdFee | 'auto', memo?: string, - funds?: Coin[] + _funds?: Coin[] ) => Promise updateOwnership: ( + action: Action, fee?: number | StdFee | 'auto', memo?: string, - funds?: Coin[] + _funds?: Coin[] ) => Promise } export class CwVestingClient @@ -224,7 +226,6 @@ export class CwVestingClient client: SigningCosmWasmClient sender: string contractAddress: string - constructor( client: SigningCosmWasmClient, sender: string, @@ -247,7 +248,6 @@ export class CwVestingClient this.registerSlash = this.registerSlash.bind(this) this.updateOwnership = this.updateOwnership.bind(this) } - receive = async ( { amount, @@ -260,7 +260,7 @@ export class CwVestingClient }, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, @@ -274,7 +274,7 @@ export class CwVestingClient }, fee, memo, - funds + _funds ) } distribute = async ( @@ -285,7 +285,7 @@ export class CwVestingClient }, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, @@ -297,13 +297,13 @@ export class CwVestingClient }, fee, memo, - funds + _funds ) } cancel = async ( fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, @@ -313,7 +313,7 @@ export class CwVestingClient }, fee, memo, - funds + _funds ) } delegate = async ( @@ -326,7 +326,7 @@ export class CwVestingClient }, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, @@ -339,7 +339,7 @@ export class CwVestingClient }, fee, memo, - funds + _funds ) } redelegate = async ( @@ -354,7 +354,7 @@ export class CwVestingClient }, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, @@ -368,7 +368,7 @@ export class CwVestingClient }, fee, memo, - funds + _funds ) } undelegate = async ( @@ -381,7 +381,7 @@ export class CwVestingClient }, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, @@ -394,7 +394,7 @@ export class CwVestingClient }, fee, memo, - funds + _funds ) } setWithdrawAddress = async ( @@ -405,7 +405,7 @@ export class CwVestingClient }, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, @@ -417,7 +417,7 @@ export class CwVestingClient }, fee, memo, - funds + _funds ) } withdrawDelegatorReward = async ( @@ -428,7 +428,7 @@ export class CwVestingClient }, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, @@ -440,7 +440,7 @@ export class CwVestingClient }, fee, memo, - funds + _funds ) } // Batch withdraw rewards from multiple validators. @@ -475,7 +475,7 @@ export class CwVestingClient }, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, @@ -487,7 +487,7 @@ export class CwVestingClient }, fee, memo, - funds + _funds ) } registerSlash = async ( @@ -504,7 +504,7 @@ export class CwVestingClient }, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, @@ -519,23 +519,24 @@ export class CwVestingClient }, fee, memo, - funds + _funds ) } updateOwnership = async ( + action: Action, fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, - funds?: Coin[] + _funds?: Coin[] ): Promise => { return await this.client.execute( this.sender, this.contractAddress, { - update_ownership: {}, + update_ownership: action, }, fee, memo, - funds + _funds ) } } diff --git a/packages/state/query/queries/chain.ts b/packages/state/query/queries/chain.ts index 8fc574b79..506c79ef5 100644 --- a/packages/state/query/queries/chain.ts +++ b/packages/state/query/queries/chain.ts @@ -1,22 +1,29 @@ import { fromBase64 } from '@cosmjs/encoding' import { Coin } from '@cosmjs/stargate' import { QueryClient, queryOptions, skipToken } from '@tanstack/react-query' +import uniq from 'lodash.uniq' import { ChainId, + Delegation, GovProposalVersion, GovProposalWithDecodedContent, + NativeDelegationInfo, ProposalV1, ProposalV1Beta1, + UnbondingDelegation, + Validator, } from '@dao-dao/types' import { ModuleAccount } from '@dao-dao/types/protobuf/codegen/cosmos/auth/v1beta1/auth' import { Metadata } from '@dao-dao/types/protobuf/codegen/cosmos/bank/v1beta1/bank' import { DecCoin } from '@dao-dao/types/protobuf/codegen/cosmos/base/v1beta1/coin' import { ProposalStatus } from '@dao-dao/types/protobuf/codegen/cosmos/gov/v1beta1/gov' import { + NONEXISTENT_QUERY_ERROR_SUBSTRINGS, cosmosProtoRpcClientRouter, cosmosSdkVersionIs46OrHigher, cosmosSdkVersionIs47OrHigher, + cosmosValidatorToValidator, cosmwasmProtoRpcClientRouter, decodeGovProposal, feemarketProtoRpcClientRouter, @@ -188,6 +195,23 @@ export const fetchBlockTimestamp = async ({ return new Date((await client.getBlock(height)).header.time).getTime() } +/** + * Fetch the native token balance for a given address. + */ +export const fetchNativeBalance = async ({ + chainId, + address, +}: { + chainId: string + address: string +}): Promise => { + const client = await stargateClientRouter.connect(chainId) + return await client.getBalance( + address, + getNativeTokenForChainId(chainId).denomOrAddress + ) +} + /** * Fetch the sum of native tokens staked across all validators. */ @@ -246,6 +270,180 @@ export const fetchTotalNativeStakedBalance = async ({ return pool.bondedTokens } +/** + * Fetch native delegation info. + */ +export const fetchNativeDelegationInfo = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise => { + // Neutron does not support staking. + if ( + chainId === ChainId.NeutronMainnet || + chainId === ChainId.NeutronTestnet + ) { + return { + delegations: [], + unbondingDelegations: [], + } + } + + const client = await cosmosProtoRpcClientRouter.connect(chainId) + + try { + const delegations = await getAllRpcResponse( + client.staking.v1beta1.delegatorDelegations, + { + delegatorAddr: address, + pagination: undefined, + }, + 'delegationResponses' + ) + const rewards = ( + await client.distribution.v1beta1.delegationTotalRewards({ + delegatorAddress: address, + }) + ).rewards + const unbondingDelegations = await getAllRpcResponse( + client.staking.v1beta1.delegatorUnbondingDelegations, + { + delegatorAddr: address, + pagination: undefined, + }, + 'unbondingResponses' + ) + + const uniqueValidators = uniq([ + ...delegations.flatMap( + ({ delegation }) => delegation?.validatorAddress || [] + ), + ...unbondingDelegations.map(({ validatorAddress }) => validatorAddress), + ]) + const validators = await Promise.all( + uniqueValidators.map((address) => + queryClient.fetchQuery( + chainQueries.validator({ + chainId, + address, + }) + ) + ) + ) + + return { + delegations: delegations.flatMap( + ({ + delegation: { validatorAddress: address } = { + validatorAddress: '', + }, + balance: delegationBalance, + }): Delegation | [] => { + if ( + !delegationBalance || + delegationBalance.denom !== + getNativeTokenForChainId(chainId).denomOrAddress + ) { + return [] + } + + const validator = validators.find((v) => v.address === address) + let pendingReward = rewards + .find(({ validatorAddress }) => validatorAddress === address) + ?.reward.find( + ({ denom }) => + denom === getNativeTokenForChainId(chainId).denomOrAddress + ) + + if (!validator || !pendingReward) { + return [] + } + + // Truncate. + pendingReward.amount = pendingReward.amount.split('.')[0] + + return { + validator, + delegated: delegationBalance, + pendingReward, + } + } + ), + + // Only returns native token unbondings, no need to check. + unbondingDelegations: unbondingDelegations.flatMap( + ({ validatorAddress, entries }) => { + const validator = validators.find( + (v) => v.address === validatorAddress + ) + if (!validator) { + return [] + } + + return entries.map( + ({ + creationHeight, + completionTime, + balance, + }): UnbondingDelegation => ({ + validator, + balance: { + amount: balance, + denom: getNativeTokenForChainId(chainId).denomOrAddress, + }, + startedAtHeight: Number(creationHeight), + finishesAt: completionTime || new Date(0), + }) + ) + } + ), + } + } catch (err) { + // Fails on chains without staking. + if ( + err instanceof Error && + NONEXISTENT_QUERY_ERROR_SUBSTRINGS.some((substring) => + (err as Error).message.includes(substring) + ) + ) { + return { + delegations: [], + unbondingDelegations: [], + } + } + + // Rethrow error if anything else, like a network error. + throw err + } +} + +/** + * Fetch a validator. + */ +export const fetchValidator = async ({ + chainId, + address, +}: { + chainId: string + address: string +}): Promise => { + const client = await cosmosProtoRpcClientRouter.connect(chainId) + + const { validator } = await client.staking.v1beta1.validator({ + validatorAddr: address, + }) + if (!validator) { + throw new Error('Validator not found') + } + + return cosmosValidatorToValidator(validator) +} + /** * Fetch the dynamic gas price for the native fee token. */ @@ -682,6 +880,14 @@ export const chainQueries = { queryKey: ['chain', 'blockTimestamp', options], queryFn: () => fetchBlockTimestamp(options), }), + /** + * Fetch the native token balance for a given address. + */ + nativeBalance: (options?: Parameters[0]) => + queryOptions({ + queryKey: ['chain', 'nativeBalance', options], + queryFn: options ? () => fetchNativeBalance(options) : skipToken, + }), /** * Fetch the sum of native tokens staked across all validators. */ @@ -702,6 +908,25 @@ export const chainQueries = { queryKey: ['chain', 'totalNativeStakedBalance', options], queryFn: () => fetchTotalNativeStakedBalance(options), }), + /** + * Fetch native delegation info. + */ + nativeDelegationInfo: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['chain', 'nativeDelegationInfo', options], + queryFn: () => fetchNativeDelegationInfo(queryClient, options), + }), + /** + * Fetch a validator. + */ + validator: (options: Parameters[0]) => + queryOptions({ + queryKey: ['chain', 'validator', options], + queryFn: () => fetchValidator(options), + }), /** * Fetch the dynamic gas price for the native fee token. */ diff --git a/packages/state/query/queries/contracts/Cw1Whitelist.extra.ts b/packages/state/query/queries/contracts/Cw1Whitelist.extra.ts new file mode 100644 index 000000000..25b21442d --- /dev/null +++ b/packages/state/query/queries/contracts/Cw1Whitelist.extra.ts @@ -0,0 +1,51 @@ +import { QueryClient, queryOptions } from '@tanstack/react-query' + +import { contractQueries } from '../contract' +import { cw1WhitelistQueries } from './Cw1Whitelist' + +/** + * If this is a cw1-whitelist, fetch the admins. Otherwise, return null. + */ +export const fetchAdminsIfCw1Whitelist = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise => { + const isCw1Whitelist = await queryClient.fetchQuery( + contractQueries.isCw1Whitelist(queryClient, { + chainId, + address, + }) + ) + if (!isCw1Whitelist) { + return null + } + + return ( + await queryClient.fetchQuery( + cw1WhitelistQueries.adminList(queryClient, { + chainId, + contractAddress: address, + }) + ) + ).admins +} + +export const cw1WhitelistExtraQueries = { + /** + * If this is a cw1-whitelist, return the admins. Otherwise, return null. + */ + adminsIfCw1Whitelist: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['cw1WhitelistExtra', 'adminsIfCw1Whitelist', options], + queryFn: () => fetchAdminsIfCw1Whitelist(queryClient, options), + }), +} diff --git a/packages/state/query/queries/contracts/Cw1Whitelist.ts b/packages/state/query/queries/contracts/Cw1Whitelist.ts index 46c4c8270..7a0a9659c 100644 --- a/packages/state/query/queries/contracts/Cw1Whitelist.ts +++ b/packages/state/query/queries/contracts/Cw1Whitelist.ts @@ -4,7 +4,6 @@ import { AdminListResponse } from '@dao-dao/types/contracts/Cw1Whitelist' import { getCosmWasmClientForChainId } from '@dao-dao/utils' import { Cw1WhitelistQueryClient } from '../../../contracts/Cw1Whitelist' -import { contractQueries } from '../contract' import { indexerQueries } from '../indexer' export const cw1WhitelistQueryKeys = { @@ -33,21 +32,6 @@ export const cw1WhitelistQueryKeys = { ...(args && { args }), }, ] as const, - /** - * If this is a cw1-whitelist, return the admins. Otherwise, return null. - */ - adminsIfCw1Whitelist: ( - chainId: string, - contractAddress: string, - args?: Record - ) => - [ - { - ...cw1WhitelistQueryKeys.address(chainId, contractAddress)[0], - method: 'adminsIfCw1Whitelist', - ...(args && { args }), - }, - ] as const, } export const cw1WhitelistQueries = { adminList: ( @@ -86,43 +70,6 @@ export const cw1WhitelistQueries = { }, ...options, }), - /** - * If this is a cw1-whitelist, return the admins. Otherwise, return null. - */ - adminsIfCw1Whitelist: ( - queryClient: QueryClient, - { - chainId, - contractAddress, - options, - }: Cw1WhitelistAdminsIfCw1WhitelistQuery - ): UseQueryOptions => ({ - queryKey: cw1WhitelistQueryKeys.adminsIfCw1Whitelist( - chainId, - contractAddress - ), - queryFn: async () => { - const isCw1Whitelist = await queryClient.fetchQuery( - contractQueries.isCw1Whitelist(queryClient, { - chainId, - address: contractAddress, - }) - ) - if (!isCw1Whitelist) { - return null - } - - return ( - await queryClient.fetchQuery( - cw1WhitelistQueries.adminList(queryClient, { - chainId, - contractAddress, - }) - ) - ).admins - }, - ...options, - }), } export interface Cw1WhitelistReactQuery { chainId: string @@ -136,6 +83,3 @@ export interface Cw1WhitelistReactQuery { } export interface Cw1WhitelistAdminListQuery extends Cw1WhitelistReactQuery {} - -export interface Cw1WhitelistAdminsIfCw1WhitelistQuery - extends Cw1WhitelistReactQuery {} diff --git a/packages/state/query/queries/contracts/CwPayrollFactory.extra.ts b/packages/state/query/queries/contracts/CwPayrollFactory.extra.ts new file mode 100644 index 000000000..d0456032e --- /dev/null +++ b/packages/state/query/queries/contracts/CwPayrollFactory.extra.ts @@ -0,0 +1,87 @@ +import { QueryClient, queryOptions } from '@tanstack/react-query' + +import { ArrayOfVestingContract } from '@dao-dao/types/contracts/CwPayrollFactory' + +import { indexerQueries } from '../indexer' +import { cwPayrollFactoryQueries } from './CwPayrollFactory' + +/** + * List all vesting contracts. + */ +export const listAllVestingContracts = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise<{ + chainId: string + contracts: ArrayOfVestingContract +}> => { + try { + const list: ArrayOfVestingContract = await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress: address, + formula: 'cwPayrollFactory/listVestingContracts', + }) + ) + if (list && Array.isArray(list)) { + return { + chainId, + contracts: list, + } + } + } catch (err) { + console.error(err) + } + + // If indexer query fails, fallback to contract queries. + const vestingContracts: ArrayOfVestingContract = [] + const limit = 30 + while (true) { + const response = await queryClient.fetchQuery( + cwPayrollFactoryQueries.listVestingContracts(queryClient, { + chainId, + contractAddress: address, + args: { + startAfter: vestingContracts[vestingContracts.length - 1]?.contract, + limit, + }, + }) + ) + + if (!response?.length) { + break + } + + vestingContracts.push(...response) + + // If we have less than the limit of items, we've exhausted them. + if (response.length < limit) { + break + } + } + + return { + chainId, + contracts: vestingContracts, + } +} + +export const cwPayrollFactoryExtraQueries = { + /** + * List all vesting contracts. + */ + listAllVestingContracts: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['cwVestingExtra', 'listAllVestingContracts', options], + queryFn: () => listAllVestingContracts(queryClient, options), + }), +} diff --git a/packages/state/query/queries/contracts/CwPayrollFactory.ts b/packages/state/query/queries/contracts/CwPayrollFactory.ts new file mode 100644 index 000000000..e26d0f741 --- /dev/null +++ b/packages/state/query/queries/contracts/CwPayrollFactory.ts @@ -0,0 +1,493 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import { QueryClient, UseQueryOptions } from '@tanstack/react-query' + +import { + ArrayOfVestingContract, + OwnershipForAddr, + Uint64, +} from '@dao-dao/types/contracts/CwPayrollFactory' +import { getCosmWasmClientForChainId } from '@dao-dao/utils' + +import { CwPayrollFactoryQueryClient } from '../../../contracts/CwPayrollFactory' +import { indexerQueries } from '../indexer' + +export const cwPayrollFactoryQueryKeys = { + contract: [ + { + contract: 'cwPayrollFactory', + }, + ] as const, + address: (chainId: string, contractAddress: string) => + [ + { + ...cwPayrollFactoryQueryKeys.contract[0], + chainId, + address: contractAddress, + }, + ] as const, + listVestingContracts: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...cwPayrollFactoryQueryKeys.address(chainId, contractAddress)[0], + method: 'list_vesting_contracts', + args, + }, + ] as const, + listVestingContractsReverse: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...cwPayrollFactoryQueryKeys.address(chainId, contractAddress)[0], + method: 'list_vesting_contracts_reverse', + args, + }, + ] as const, + listVestingContractsByInstantiator: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...cwPayrollFactoryQueryKeys.address(chainId, contractAddress)[0], + method: 'list_vesting_contracts_by_instantiator', + args, + }, + ] as const, + listVestingContractsByInstantiatorReverse: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...cwPayrollFactoryQueryKeys.address(chainId, contractAddress)[0], + method: 'list_vesting_contracts_by_instantiator_reverse', + args, + }, + ] as const, + listVestingContractsByRecipient: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...cwPayrollFactoryQueryKeys.address(chainId, contractAddress)[0], + method: 'list_vesting_contracts_by_recipient', + args, + }, + ] as const, + listVestingContractsByRecipientReverse: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...cwPayrollFactoryQueryKeys.address(chainId, contractAddress)[0], + method: 'list_vesting_contracts_by_recipient_reverse', + args, + }, + ] as const, + ownership: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...cwPayrollFactoryQueryKeys.address(chainId, contractAddress)[0], + method: 'ownership', + args, + }, + ] as const, + codeId: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...cwPayrollFactoryQueryKeys.address(chainId, contractAddress)[0], + method: 'code_id', + args, + }, + ] as const, +} +export const cwPayrollFactoryQueries = { + listVestingContracts: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + args, + options, + }: CwPayrollFactoryListVestingContractsQuery + ): UseQueryOptions => ({ + queryKey: cwPayrollFactoryQueryKeys.listVestingContracts( + chainId, + contractAddress, + args + ), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'cwPayrollFactory/listVestingContracts', + args, + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new CwPayrollFactoryQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).listVestingContracts({ + limit: args.limit, + startAfter: args.startAfter, + }) + }, + ...options, + }), + listVestingContractsReverse: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + args, + options, + }: CwPayrollFactoryListVestingContractsReverseQuery + ): UseQueryOptions => ({ + queryKey: cwPayrollFactoryQueryKeys.listVestingContractsReverse( + chainId, + contractAddress, + args + ), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'cwPayrollFactory/listVestingContractsReverse', + args, + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new CwPayrollFactoryQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).listVestingContractsReverse({ + limit: args.limit, + startBefore: args.startBefore, + }) + }, + ...options, + }), + listVestingContractsByInstantiator: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + args, + options, + }: CwPayrollFactoryListVestingContractsByInstantiatorQuery + ): UseQueryOptions => ({ + queryKey: cwPayrollFactoryQueryKeys.listVestingContractsByInstantiator( + chainId, + contractAddress, + args + ), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'cwPayrollFactory/listVestingContractsByInstantiator', + args, + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new CwPayrollFactoryQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).listVestingContractsByInstantiator({ + instantiator: args.instantiator, + limit: args.limit, + startAfter: args.startAfter, + }) + }, + ...options, + }), + listVestingContractsByInstantiatorReverse: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + args, + options, + }: CwPayrollFactoryListVestingContractsByInstantiatorReverseQuery + ): UseQueryOptions => ({ + queryKey: + cwPayrollFactoryQueryKeys.listVestingContractsByInstantiatorReverse( + chainId, + contractAddress, + args + ), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: + 'cwPayrollFactory/listVestingContractsByInstantiatorReverse', + args, + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new CwPayrollFactoryQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).listVestingContractsByInstantiatorReverse({ + instantiator: args.instantiator, + limit: args.limit, + startBefore: args.startBefore, + }) + }, + ...options, + }), + listVestingContractsByRecipient: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + args, + options, + }: CwPayrollFactoryListVestingContractsByRecipientQuery + ): UseQueryOptions => ({ + queryKey: cwPayrollFactoryQueryKeys.listVestingContractsByRecipient( + chainId, + contractAddress, + args + ), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'cwPayrollFactory/listVestingContractsByRecipient', + args, + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new CwPayrollFactoryQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).listVestingContractsByRecipient({ + limit: args.limit, + recipient: args.recipient, + startAfter: args.startAfter, + }) + }, + ...options, + }), + listVestingContractsByRecipientReverse: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + args, + options, + }: CwPayrollFactoryListVestingContractsByRecipientReverseQuery + ): UseQueryOptions => ({ + queryKey: cwPayrollFactoryQueryKeys.listVestingContractsByRecipientReverse( + chainId, + contractAddress, + args + ), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'cwPayrollFactory/listVestingContractsByRecipientReverse', + args, + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new CwPayrollFactoryQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).listVestingContractsByRecipientReverse({ + limit: args.limit, + recipient: args.recipient, + startBefore: args.startBefore, + }) + }, + ...options, + }), + ownership: ( + queryClient: QueryClient, + { chainId, contractAddress, options }: CwPayrollFactoryOwnershipQuery + ): UseQueryOptions => ({ + queryKey: cwPayrollFactoryQueryKeys.ownership(chainId, contractAddress), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'cwPayrollFactory/ownership', + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new CwPayrollFactoryQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).ownership() + }, + ...options, + }), + codeId: ( + queryClient: QueryClient, + { chainId, contractAddress, options }: CwPayrollFactoryCodeIdQuery + ): UseQueryOptions => ({ + queryKey: cwPayrollFactoryQueryKeys.codeId(chainId, contractAddress), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'cwPayrollFactory/codeId', + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new CwPayrollFactoryQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).codeId() + }, + ...options, + }), +} +export interface CwPayrollFactoryReactQuery { + chainId: string + contractAddress: string + options?: Omit< + UseQueryOptions, + 'queryKey' | 'queryFn' | 'initialData' + > & { + initialData?: undefined + } +} +export interface CwPayrollFactoryCodeIdQuery + extends CwPayrollFactoryReactQuery {} +export interface CwPayrollFactoryOwnershipQuery + extends CwPayrollFactoryReactQuery {} +export interface CwPayrollFactoryListVestingContractsByRecipientReverseQuery< + TData +> extends CwPayrollFactoryReactQuery { + args: { + limit?: number + recipient: string + startBefore?: string + } +} +export interface CwPayrollFactoryListVestingContractsByRecipientQuery + extends CwPayrollFactoryReactQuery { + args: { + limit?: number + recipient: string + startAfter?: string + } +} +export interface CwPayrollFactoryListVestingContractsByInstantiatorReverseQuery< + TData +> extends CwPayrollFactoryReactQuery { + args: { + instantiator: string + limit?: number + startBefore?: string + } +} +export interface CwPayrollFactoryListVestingContractsByInstantiatorQuery + extends CwPayrollFactoryReactQuery { + args: { + instantiator: string + limit?: number + startAfter?: string + } +} +export interface CwPayrollFactoryListVestingContractsReverseQuery + extends CwPayrollFactoryReactQuery { + args: { + limit?: number + startBefore?: string + } +} +export interface CwPayrollFactoryListVestingContractsQuery + extends CwPayrollFactoryReactQuery { + args: { + limit?: number + startAfter?: string + } +} diff --git a/packages/state/query/queries/contracts/CwVesting.extra.ts b/packages/state/query/queries/contracts/CwVesting.extra.ts new file mode 100644 index 000000000..4819bbd04 --- /dev/null +++ b/packages/state/query/queries/contracts/CwVesting.extra.ts @@ -0,0 +1,473 @@ +import { QueryClient, queryOptions } from '@tanstack/react-query' + +import { + TokenType, + VestingInfo, + VestingStep, + VestingValidatorWithSlashes, +} from '@dao-dao/types' +import { convertMicroDenomToDenomWithDecimals } from '@dao-dao/utils' + +import { chainQueries } from '../chain' +import { indexerQueries } from '../indexer' +import { tokenQueries } from '../token' +import { cw1WhitelistExtraQueries } from './Cw1Whitelist.extra' +import { cwPayrollFactoryExtraQueries } from './CwPayrollFactory.extra' +import { cwVestingQueries } from './CwVesting' + +/** + * Fetch info for a vesting payment. + */ +export const fetchVestingPaymentInfo = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise => { + const [ + { vest, token }, + vested, + total, + distributable, + owner, + { slashes, hasUnregisteredSlashes, actualSlashed }, + delegationInfo, + ] = await Promise.all([ + queryClient + .fetchQuery( + cwVestingQueries.info(queryClient, { + chainId, + contractAddress: address, + }) + ) + .then(async (vest) => { + const token = await queryClient.fetchQuery( + tokenQueries.info(queryClient, { + chainId, + type: 'cw20' in vest.denom ? TokenType.Cw20 : TokenType.Native, + denomOrAddress: + 'cw20' in vest.denom ? vest.denom.cw20 : vest.denom.native, + }) + ) + + return { + vest, + token, + } + }), + queryClient.fetchQuery( + cwVestingQueries.vested(queryClient, { + chainId, + contractAddress: address, + args: {}, + }) + ), + queryClient.fetchQuery( + cwVestingQueries.totalToVest(queryClient, { + chainId, + contractAddress: address, + }) + ), + queryClient.fetchQuery( + cwVestingQueries.distributable({ + chainId, + contractAddress: address, + args: {}, + }) + ), + queryClient + .fetchQuery( + cwVestingQueries.ownership(queryClient, { + chainId, + contractAddress: address, + }) + ) + .then(async ({ owner }): Promise => { + if (!owner) { + return null + } + + const cw1WhitelistAdmins = owner + ? await queryClient.fetchQuery( + cw1WhitelistExtraQueries.adminsIfCw1Whitelist(queryClient, { + chainId, + address: owner, + }) + ) + : null + + return cw1WhitelistAdmins + ? { + address: owner, + isCw1Whitelist: true, + cw1WhitelistAdmins, + } + : { + address: owner, + isCw1Whitelist: false, + } + }), + // TODO(vesting): add stake slash history analysis back + { + slashes: [] as VestingValidatorWithSlashes[], + hasUnregisteredSlashes: false, + actualSlashed: 0n, + }, + // Promise.all([ + // queryClient.fetchQuery( + // cwVestingExtraQueries.stakeHistory(queryClient, { + // chainId, + // contractAddress: address, + // }) + // ), + // queryClient + // .fetchQuery( + // cwVestingExtraQueries.unbondingDurationSeconds(queryClient, { + // chainId, + // address, + // }) + // ) + // // Fails on chains without an indexer. + // .catch(() => null), + // ]).then( + // async ([stakeHistory, unbondingDurationSeconds]): Promise<{ + // slashes: VestingValidatorWithSlashes[] + // hasUnregisteredSlashes: boolean + // actualSlashed: bigint + // }> => { + // const uniqueValidators = uniq( + // stakeHistory?.stakeEvents.flatMap((event) => + // event.type === 'redelegate' ? event.toValidator : event.validator + // ) ?? [] + // ) + + // const validatorSlashes = await Promise.all( + // uniqueValidators.map((validator) => + // queryClient + // .fetchQuery( + // indexerQueries.queryValidator(queryClient, { + // chainId, + // validatorOperatorAddress: validator, + // formula: 'staking/slashes', + // noFallback: true, + // }) + // ) + // .then((slashes) => ({ + // validator, + // slashes, + // })) + // ) + // ) + + // const slashes = + // stakeHistory && unbondingDurationSeconds !== null + // ? getVestingValidatorSlashes( + // stakeHistory, + // unbondingDurationSeconds, + // validatorSlashes + // ) + // : [] + + // const hasUnregisteredSlashes = + // slashes?.some(({ slashes }) => + // slashes.some(({ unregisteredAmount }) => unregisteredAmount > 0) + // ) ?? false + + // const actualSlashed = slashes?.reduce( + // (slashed, { slashes }) => + // slashed + + // slashes.reduce( + // (acc, { amount }) => acc + BigInt(amount), + // BigInt(0) + // ), + // BigInt(0) + // ) + + // return { + // slashes, + // hasUnregisteredSlashes, + // actualSlashed, + // } + // } + // ), + queryClient.fetchQuery( + chainQueries.nativeDelegationInfo(queryClient, { + chainId, + address, + }) + ), + ]) + + const actualStaked = delegationInfo.delegations.reduce( + (acc, { delegated }) => acc + BigInt(delegated.amount), + 0n + ) + const actualUnstaking = delegationInfo.unbondingDelegations.reduce( + (acc, { balance }) => acc + BigInt(balance.amount), + 0n + ) + + // If cannot compute the actual slashed amount, then we cannot compute the + // stakable amount, so default to 0 to prevent the UI from allowing staking. + const stakable = + actualSlashed === undefined + ? '0' + : ( + BigInt(total) - + BigInt(vest.claimed) - + BigInt(actualStaked) - + BigInt(actualUnstaking) - + actualSlashed + ).toString() + + const completed = + (vest.status === 'funded' || + (typeof vest.status === 'object' && 'canceled' in vest.status)) && + vest.claimed === total + + const startTimeMs = Number(vest.start_time) / 1e6 + const startDate = new Date(startTimeMs) + + const steps: VestingStep[] = + // Constant is used when a vest is canceled. + 'constant' in vest.vested + ? [ + { + timestamp: startTimeMs, + amount: convertMicroDenomToDenomWithDecimals( + vest.vested.constant.y, + token.decimals + ), + }, + { + timestamp: startTimeMs, + amount: convertMicroDenomToDenomWithDecimals( + vest.vested.constant.y, + token.decimals + ), + }, + ] + : 'saturating_linear' in vest.vested + ? [ + { + timestamp: startTimeMs + vest.vested.saturating_linear.min_x * 1000, + amount: convertMicroDenomToDenomWithDecimals( + vest.vested.saturating_linear.min_y, + token.decimals + ), + }, + { + timestamp: startTimeMs + vest.vested.saturating_linear.max_x * 1000, + amount: convertMicroDenomToDenomWithDecimals( + vest.vested.saturating_linear.max_y, + token.decimals + ), + }, + ] + : vest.vested.piecewise_linear.steps.reduce( + (acc, [seconds, amount], index): VestingStep[] => { + // Ignore first step if hardcoded 0 amount at 1 second. + if (index === 0 && seconds === 1 && amount === '0') { + return acc + } + + return [ + ...acc, + { + timestamp: startTimeMs + seconds * 1000, + amount: convertMicroDenomToDenomWithDecimals( + amount, + token.decimals + ), + }, + ] + }, + [] as VestingStep[] + ) + + const endDate = new Date(steps[steps.length - 1].timestamp) + + return { + chainId, + vestingContractAddress: address, + vest, + token, + owner, + vested, + distributable, + total, + stakable, + slashes, + hasUnregisteredSlashes, + completed, + startDate, + endDate, + steps, + } +} + +/** + * Fetch vesting payments owned by a given address. + */ +export const fetchVestingPaymentsOwnedBy = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise => { + const vestingPayments: string[] = await queryClient.fetchQuery( + indexerQueries.queryWallet(queryClient, { + chainId, + walletAddress: address, + formula: 'vesting/ownerOf', + noFallback: true, + }) + ) + + return vestingPayments && Array.isArray(vestingPayments) + ? vestingPayments + : [] +} + +/** + * Fetch vesting payment infos owned by a given address. + */ +export const fetchVestingInfosOwnedBy = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise => { + const vestingPayments = await queryClient.fetchQuery( + cwVestingExtraQueries.vestingPaymentsOwnedBy(queryClient, { + chainId, + address, + }) + ) + + return ( + await Promise.allSettled( + vestingPayments.map((address) => + queryClient.fetchQuery( + cwVestingExtraQueries.info(queryClient, { + chainId, + address, + }) + ) + ) + ) + ).flatMap((l) => (l.status === 'fulfilled' ? l.value : [])) +} + +/** + * Fetch vesting payment infos created by a given factory. + */ +export const fetchVestingInfosForFactory = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise => { + const { contracts } = await queryClient.fetchQuery( + cwPayrollFactoryExtraQueries.listAllVestingContracts(queryClient, { + chainId, + address, + }) + ) + + return ( + await Promise.allSettled( + contracts.map(({ contract }) => + queryClient.fetchQuery( + cwVestingExtraQueries.info(queryClient, { + chainId, + address: contract, + }) + ) + ) + ) + ).flatMap((l) => (l.status === 'fulfilled' ? l.value : [])) +} + +export const cwVestingExtraQueries = { + /** + * Fetch info for a vesting payment. + */ + info: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['cwVestingExtra', 'vestingPaymentInfo', options], + queryFn: () => fetchVestingPaymentInfo(queryClient, options), + }), + /** + * Fetch unbonding duration seconds configured for a vest. + */ + unbondingDurationSeconds: ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } + ) => + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress: address, + formula: 'cwVesting/unbondingDurationSeconds', + // No contract query for this. + noFallback: true, + }), + /** + * Fetch vesting payments owned by a given address. + */ + vestingPaymentsOwnedBy: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['cwVestingExtra', 'vestingPaymentsOwnedBy', options], + queryFn: () => fetchVestingPaymentsOwnedBy(queryClient, options), + }), + /** + * Fetch vesting payment infos owned by a given address. + */ + vestingInfosOwnedBy: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['cwVestingExtra', 'vestingInfosOwnedBy', options], + queryFn: () => fetchVestingInfosOwnedBy(queryClient, options), + }), + /** + * Fetch vesting payment infos created by a given factory. + */ + vestingInfosForFactory: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['cwVestingExtra', 'vestingInfosForFactory', options], + queryFn: () => fetchVestingInfosForFactory(queryClient, options), + }), +} diff --git a/packages/state/query/queries/contracts/CwVesting.ts b/packages/state/query/queries/contracts/CwVesting.ts new file mode 100644 index 000000000..6a14d2749 --- /dev/null +++ b/packages/state/query/queries/contracts/CwVesting.ts @@ -0,0 +1,330 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import { QueryClient, UseQueryOptions } from '@tanstack/react-query' + +import { + NullableUint64, + OwnershipForAddr, + StakeTrackerQuery, + Timestamp, + Uint128, + Vest, +} from '@dao-dao/types/contracts/CwVesting' +import { getCosmWasmClientForChainId } from '@dao-dao/utils' + +import { CwVestingQueryClient } from '../../../contracts/CwVesting' +import { indexerQueries } from '../indexer' + +export const cwVestingQueryKeys = { + contract: [ + { + contract: 'cwVesting', + }, + ] as const, + address: (chainId: string, contractAddress: string) => + [ + { + ...cwVestingQueryKeys.contract[0], + chainId, + address: contractAddress, + }, + ] as const, + ownership: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...cwVestingQueryKeys.address(chainId, contractAddress)[0], + method: 'ownership', + args, + }, + ] as const, + info: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...cwVestingQueryKeys.address(chainId, contractAddress)[0], + method: 'info', + args, + }, + ] as const, + distributable: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...cwVestingQueryKeys.address(chainId, contractAddress)[0], + method: 'distributable', + args, + }, + ] as const, + vested: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...cwVestingQueryKeys.address(chainId, contractAddress)[0], + method: 'vested', + args, + }, + ] as const, + totalToVest: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...cwVestingQueryKeys.address(chainId, contractAddress)[0], + method: 'total_to_vest', + args, + }, + ] as const, + vestDuration: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...cwVestingQueryKeys.address(chainId, contractAddress)[0], + method: 'vest_duration', + args, + }, + ] as const, + stake: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...cwVestingQueryKeys.address(chainId, contractAddress)[0], + method: 'stake', + args, + }, + ] as const, +} +export const cwVestingQueries = { + ownership: ( + queryClient: QueryClient, + { chainId, contractAddress, options }: CwVestingOwnershipQuery + ): UseQueryOptions => ({ + queryKey: cwVestingQueryKeys.ownership(chainId, contractAddress), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'cwVesting/ownership', + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new CwVestingQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).ownership() + }, + ...options, + }), + info: ( + queryClient: QueryClient, + { chainId, contractAddress, options }: CwVestingInfoQuery + ): UseQueryOptions => ({ + queryKey: cwVestingQueryKeys.info(chainId, contractAddress), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'cwVesting/info', + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new CwVestingQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).info() + }, + ...options, + }), + distributable: ({ + chainId, + contractAddress, + args, + options, + }: CwVestingDistributableQuery): UseQueryOptions< + Uint128, + Error, + TData + > => ({ + queryKey: cwVestingQueryKeys.distributable(chainId, contractAddress, args), + queryFn: async () => { + return new CwVestingQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).distributable({ + t: args.t, + }) + }, + ...options, + }), + vested: ( + queryClient: QueryClient, + { chainId, contractAddress, args, options }: CwVestingVestedQuery + ): UseQueryOptions => ({ + queryKey: cwVestingQueryKeys.vested(chainId, contractAddress, args), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'cwVesting/vested', + args, + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new CwVestingQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).vested({ + t: args.t, + }) + }, + ...options, + }), + totalToVest: ( + queryClient: QueryClient, + { chainId, contractAddress, options }: CwVestingTotalToVestQuery + ): UseQueryOptions => ({ + queryKey: cwVestingQueryKeys.totalToVest(chainId, contractAddress), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'cwVesting/totalToVest', + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new CwVestingQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).totalToVest() + }, + ...options, + }), + vestDuration: ( + queryClient: QueryClient, + { chainId, contractAddress, options }: CwVestingVestDurationQuery + ): UseQueryOptions => ({ + queryKey: cwVestingQueryKeys.vestDuration(chainId, contractAddress), + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'cwVesting/vestDuration', + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new CwVestingQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).vestDuration() + }, + ...options, + }), + stake: ({ + chainId, + contractAddress, + args, + options, + }: CwVestingStakeQuery): UseQueryOptions => ({ + queryKey: cwVestingQueryKeys.stake(chainId, contractAddress, args), + queryFn: async () => { + return new CwVestingQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).stake(args) + }, + ...options, + }), +} +export interface CwVestingReactQuery { + chainId: string + contractAddress: string + options?: Omit< + UseQueryOptions, + 'queryKey' | 'queryFn' | 'initialData' + > & { + initialData?: undefined + } +} +export interface CwVestingStakeQuery + extends CwVestingReactQuery { + args: StakeTrackerQuery +} +export interface CwVestingVestDurationQuery + extends CwVestingReactQuery {} +export interface CwVestingTotalToVestQuery + extends CwVestingReactQuery {} +export interface CwVestingVestedQuery + extends CwVestingReactQuery { + args: { + t?: Timestamp + } +} +export interface CwVestingDistributableQuery + extends CwVestingReactQuery { + args: { + t?: Timestamp + } +} +export interface CwVestingInfoQuery + extends CwVestingReactQuery {} +export interface CwVestingOwnershipQuery + extends CwVestingReactQuery {} diff --git a/packages/state/query/queries/contracts/index.ts b/packages/state/query/queries/contracts/index.ts index 44555c994..ae903ef08 100644 --- a/packages/state/query/queries/contracts/index.ts +++ b/packages/state/query/queries/contracts/index.ts @@ -1,4 +1,5 @@ export * from './Cw1Whitelist' +export * from './Cw1Whitelist.extra' export * from './Cw20Base' export * from './Cw3FlexMultisig' export * from './DaoDaoCore' @@ -34,3 +35,7 @@ export * from './DaoVotingOnftStaked.extra' export * from './Cw721Base' export * from './DaoVotingSgCommunityNft' export * from './DaoVotingSgCommunityNft.extra' +export * from './CwVesting' +export * from './CwVesting.extra' +export * from './CwPayrollFactory' +export * from './CwPayrollFactory.extra' diff --git a/packages/state/recoil/atoms/refresh.ts b/packages/state/recoil/atoms/refresh.ts index 37e9493f9..2073ed2ac 100644 --- a/packages/state/recoil/atoms/refresh.ts +++ b/packages/state/recoil/atoms/refresh.ts @@ -1,5 +1,7 @@ import { atom, atomFamily } from 'recoil' +import { GenericTokenSource } from '@dao-dao/types' + // Change this to refresh claims for the given wallet. export const refreshClaimsIdAtom = atomFamily({ key: 'refreshClaimsId', @@ -50,12 +52,12 @@ export const refreshWalletStargazeNftsAtom = atomFamily({ default: 0, }) -// Change this to refresh native token staking info for the given address. -export const refreshNativeTokenStakingInfoAtom = atomFamily< +// Change this to refresh token card lazy info for the given token and owner. +export const refreshTokenCardLazyInfoAtom = atomFamily< number, - string | undefined + { token: GenericTokenSource; owner: string } >({ - key: 'refreshNativeTokenStakingInfo', + key: 'refreshTokenCardLazyInfo', default: 0, }) @@ -83,12 +85,6 @@ export const refreshFollowingDaosAtom = atom({ default: 0, }) -// Change this to refresh a vesting contract's data. -export const refreshVestingAtom = atomFamily({ - key: 'refreshVesting', - default: 0, -}) - // Change this to refresh saved TXs. export const refreshSavedTxsAtom = atom({ key: 'refreshSavedTxs', diff --git a/packages/state/recoil/selectors/chain.ts b/packages/state/recoil/selectors/chain.ts index 7e1564fd5..b8fb9e416 100644 --- a/packages/state/recoil/selectors/chain.ts +++ b/packages/state/recoil/selectors/chain.ts @@ -17,16 +17,13 @@ import { AllGovParams, AmountWithTimestamp, ChainId, - Delegation, GenericTokenBalance, GenericTokenBalanceWithOwner, GovProposalVersion, GovProposalWithDecodedContent, - NativeDelegationInfo, ProposalV1, ProposalV1Beta1, TokenType, - UnbondingDelegation, Validator, ValidatorSlash, WithChainId, @@ -75,7 +72,6 @@ import { refreshBlockHeightAtom, refreshGovProposalsAtom, refreshIbcDataAtom, - refreshNativeTokenStakingInfoAtom, refreshOpenProposalsAtom, refreshWalletBalancesIdAtom, } from '../atoms/refresh' @@ -345,39 +341,6 @@ export const nativeBalancesSelector = selectorFamily< }, }) -// Refreshes when wallet balances refresh. -export const nativeBalancesFetchedAtSelector = selectorFamily< - Date, - WithChainId<{ address: string }> ->({ - key: 'nativeBalancesFetchedAt', - get: - ({ address }) => - ({ get }) => { - get(refreshWalletBalancesIdAtom(address)) - return new Date() - }, -}) - -export const nativeBalanceSelector = selectorFamily< - Coin, - WithChainId<{ address: string }> ->({ - key: 'nativeBalance', - get: - ({ address, chainId }) => - async ({ get }) => { - const client = get(stargateClientForChainSelector(chainId)) - - get(refreshWalletBalancesIdAtom(address)) - - return await client.getBalance( - address, - getNativeTokenForChainId(chainId).denomOrAddress - ) - }, -}) - export const tokenFactoryDenomCreationFeeSelector = selectorFamily< Coin[] | undefined, string @@ -614,31 +577,6 @@ export const blocksPerYearSelector = selectorFamily>({ }, }) -// Queries the chain for the commission of a given validator address. -export const validatorSelector = selectorFamily< - Validator, - WithChainId<{ address: string }> ->({ - key: 'validator', - get: - ({ address: validatorAddr, chainId }) => - async ({ get }) => { - get(refreshWalletBalancesIdAtom('')) - get(refreshWalletBalancesIdAtom(validatorAddr)) - - const client = get(cosmosRpcClientForChainSelector(chainId)) - - const { validator } = await client.staking.v1beta1.validator({ - validatorAddr, - }) - if (!validator) { - throw new Error('Validator not found') - } - - return cosmosValidatorToValidator(validator) - }, -}) - export const nativeUnstakingDurationSecondsSelector = selectorFamily< number, WithChainId<{}> @@ -1384,122 +1322,6 @@ export const validatorsSelector = selectorFamily>({ }, }) -export const nativeDelegationInfoSelector = selectorFamily< - NativeDelegationInfo, - WithChainId<{ address: string }> ->({ - key: 'nativeDelegationInfo', - get: - ({ address: delegatorAddr, chainId }) => - async ({ get }) => { - const client = get(cosmosRpcClientForChainSelector(chainId)) - - get(refreshNativeTokenStakingInfoAtom(delegatorAddr)) - - const delegations = await getAllRpcResponse( - client.staking.v1beta1.delegatorDelegations, - { - delegatorAddr, - pagination: undefined, - }, - 'delegationResponses' - ) - const validators = await getAllRpcResponse( - client.staking.v1beta1.delegatorValidators, - { - delegatorAddr, - pagination: undefined, - }, - 'validators' - ) - const rewards = ( - await client.distribution.v1beta1.delegationTotalRewards({ - delegatorAddress: delegatorAddr, - }) - ).rewards - const unbondingDelegations = await getAllRpcResponse( - client.staking.v1beta1.delegatorUnbondingDelegations, - { - delegatorAddr, - pagination: undefined, - }, - 'unbondingResponses' - ) - - return { - delegations: delegations - .map( - ({ - delegation: { validatorAddress: address } = { - validatorAddress: '', - }, - balance: delegationBalance, - }): Delegation | undefined => { - if ( - !delegationBalance || - delegationBalance.denom !== - getNativeTokenForChainId(chainId).denomOrAddress - ) { - return - } - - const validator = validators.find( - ({ operatorAddress }) => operatorAddress === address - ) - let pendingReward = rewards - .find(({ validatorAddress }) => validatorAddress === address) - ?.reward.find( - ({ denom }) => - denom === getNativeTokenForChainId(chainId).denomOrAddress - ) - - if (!validator || !pendingReward) { - return - } - - // Truncate. - pendingReward.amount = pendingReward.amount.split('.')[0] - - return { - validator: cosmosValidatorToValidator(validator), - delegated: delegationBalance, - pendingReward, - } - } - ) - .filter(Boolean) as Delegation[], - - // Only returns native token unbondings, no need to check. - unbondingDelegations: unbondingDelegations.flatMap( - ({ validatorAddress, entries }) => { - const validator = get( - validatorSelector({ - address: validatorAddress, - chainId, - }) - ) - - return entries.map( - ({ - creationHeight, - completionTime, - balance, - }): UnbondingDelegation => ({ - validator, - balance: { - amount: balance, - denom: getNativeTokenForChainId(chainId).denomOrAddress, - }, - startedAtHeight: Number(creationHeight), - finishesAt: completionTime || new Date(0), - }) - ) - } - ), - } - }, -}) - export const transactionSelector = selectorFamily< IndexedTx | undefined, WithChainId<{ txHash: string }> diff --git a/packages/state/recoil/selectors/contracts/Cw1Whitelist.ts b/packages/state/recoil/selectors/contracts/Cw1Whitelist.ts index b2dab4299..1c388303c 100644 --- a/packages/state/recoil/selectors/contracts/Cw1Whitelist.ts +++ b/packages/state/recoil/selectors/contracts/Cw1Whitelist.ts @@ -1,93 +1,30 @@ import { selectorFamily } from 'recoil' import { WithChainId } from '@dao-dao/types' -import { AdminListResponse } from '@dao-dao/types/contracts/Cw1Whitelist' -import { ContractName } from '@dao-dao/utils' -import { Cw1WhitelistQueryClient } from '../../../contracts/Cw1Whitelist' -import { cosmWasmClientForChainSelector } from '../chain' -import { isContractSelector } from '../contract' -import { queryContractIndexerSelector } from '../indexer' +import { cw1WhitelistExtraQueries } from '../../../query' +import { queryClientAtom } from '../../atoms' type QueryClientParams = WithChainId<{ contractAddress: string }> -export const queryClient = selectorFamily< - Cw1WhitelistQueryClient, - QueryClientParams ->({ - key: 'cw1WhitelistQueryClient', - get: - ({ contractAddress, chainId }) => - ({ get }) => { - const client = get(cosmWasmClientForChainSelector(chainId)) - return new Cw1WhitelistQueryClient(client, contractAddress) - }, - dangerouslyAllowMutability: true, -}) - -export const adminListSelector = selectorFamily< - AdminListResponse, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cw1WhitelistAdminList', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const adminList = get( - queryContractIndexerSelector({ - ...queryClientParams, - formula: 'cw1Whitelist/adminList', - }) - ) - if (adminList) { - return adminList - } - - // If indexer query fails, fallback to contract query. - const client = get(queryClient(queryClientParams)) - return await client.adminList(...params) - }, -}) -// export const canExecuteSelector = selectorFamily< -// CanExecuteResponse, -// QueryClientParams & { -// params: Parameters -// } -// >({ -// key: 'cw1WhitelistCanExecute', -// get: -// ({ params, ...queryClientParams }) => -// async ({ get }) => { -// const client = get(queryClient(queryClientParams)) -// return await client.canExecute(...params) -// }, -// }) - // If this is a cw1-whitelist contract, return the admins. Otherwise, return -// undefined. +// null. export const adminsIfCw1Whitelist = selectorFamily< - string[] | undefined, + string[] | null, QueryClientParams >({ key: 'cw1WhitelistCanExecute', get: - (queryClientParams) => + ({ chainId, contractAddress: address }) => async ({ get }) => { - if ( - !get( - isContractSelector({ - ...queryClientParams, - name: ContractName.Cw1Whitelist, - }) - ) - ) { - return - } - - return get(adminListSelector({ ...queryClientParams, params: [] })).admins + const queryClient = get(queryClientAtom) + return await queryClient.fetchQuery( + cw1WhitelistExtraQueries.adminsIfCw1Whitelist(queryClient, { + chainId, + address, + }) + ) }, }) diff --git a/packages/state/recoil/selectors/contracts/CwPayrollFactory.ts b/packages/state/recoil/selectors/contracts/CwPayrollFactory.ts deleted file mode 100644 index 19c3bdded..000000000 --- a/packages/state/recoil/selectors/contracts/CwPayrollFactory.ts +++ /dev/null @@ -1,327 +0,0 @@ -import { selectorFamily } from 'recoil' - -import { Uint64, WithChainId } from '@dao-dao/types' -import { ArrayOfVestingContract } from '@dao-dao/types/contracts/CwPayrollFactory' -import { OwnershipForAddr } from '@dao-dao/types/contracts/CwVesting' - -import { - CwPayrollFactoryClient, - CwPayrollFactoryQueryClient, -} from '../../../contracts/CwPayrollFactory' -import { refreshVestingAtom, signingCosmWasmClientAtom } from '../../atoms' -import { cosmWasmClientForChainSelector } from '../chain' -import { queryContractIndexerSelector } from '../indexer' - -type QueryClientParams = WithChainId<{ - contractAddress: string -}> - -const queryClient = selectorFamily< - CwPayrollFactoryQueryClient, - QueryClientParams ->({ - key: 'cwPayrollFactoryQueryClient', - get: - ({ contractAddress, chainId }) => - ({ get }) => { - const client = get(cosmWasmClientForChainSelector(chainId)) - return new CwPayrollFactoryQueryClient(client, contractAddress) - }, - dangerouslyAllowMutability: true, -}) - -export type ExecuteClientParams = WithChainId<{ - contractAddress: string - sender: string -}> - -export const executeClient = selectorFamily< - CwPayrollFactoryClient | undefined, - ExecuteClientParams ->({ - key: 'cwPayrollFactoryExecuteClient', - get: - ({ chainId, contractAddress, sender }) => - ({ get }) => { - const client = get(signingCosmWasmClientAtom({ chainId })) - if (!client) return - return new CwPayrollFactoryClient(client, sender, contractAddress) - }, - dangerouslyAllowMutability: true, -}) -// Use allVestingContractsSelector instead, since it uses the indexer and -// fallsback to looping over pagination to retrieve all from contract. -export const _listVestingContractsSelector = selectorFamily< - ArrayOfVestingContract, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cwPayrollFactoryListVestingContracts', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const id = get(refreshVestingAtom('')) - - const list = get( - queryContractIndexerSelector({ - ...queryClientParams, - formula: 'cwPayrollFactory/listVestingContracts', - args: params[0], - id, - }) - ) - if (list) { - return list - } - - // If indexer query fails, fallback to contract query. - const client = get(queryClient(queryClientParams)) - return await client.listVestingContracts(...params) - }, -}) -export const listVestingContractsReverseSelector = selectorFamily< - ArrayOfVestingContract, - QueryClientParams & { - params: Parameters< - CwPayrollFactoryQueryClient['listVestingContractsReverse'] - > - } ->({ - key: 'cwPayrollFactoryListVestingContractsReverse', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const list = get( - queryContractIndexerSelector({ - ...queryClientParams, - formula: 'cwPayrollFactory/listVestingContractsReverse', - args: params[0], - }) - ) - if (list) { - return list - } - - // If indexer query fails, fallback to contract query. - const client = get(queryClient(queryClientParams)) - return await client.listVestingContractsReverse(...params) - }, -}) -export const listVestingContractsByInstantiatorSelector = selectorFamily< - ArrayOfVestingContract, - QueryClientParams & { - params: Parameters< - CwPayrollFactoryQueryClient['listVestingContractsByInstantiator'] - > - } ->({ - key: 'cwPayrollFactoryListVestingContractsByInstantiator', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const list = get( - queryContractIndexerSelector({ - ...queryClientParams, - formula: 'cwPayrollFactory/listVestingContractsByInstantiator', - args: params[0], - }) - ) - if (list) { - return list - } - - // If indexer query fails, fallback to contract query. - const client = get(queryClient(queryClientParams)) - return await client.listVestingContractsByInstantiator(...params) - }, -}) -export const listVestingContractsByInstantiatorReverseSelector = selectorFamily< - ArrayOfVestingContract, - QueryClientParams & { - params: Parameters< - CwPayrollFactoryQueryClient['listVestingContractsByInstantiatorReverse'] - > - } ->({ - key: 'cwPayrollFactoryListVestingContractsByInstantiatorReverse', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const list = get( - queryContractIndexerSelector({ - ...queryClientParams, - formula: 'cwPayrollFactory/listVestingContractsByInstantiatorReverse', - args: params[0], - }) - ) - if (list) { - return list - } - - // If indexer query fails, fallback to contract query. - const client = get(queryClient(queryClientParams)) - return await client.listVestingContractsByInstantiatorReverse(...params) - }, -}) -export const listVestingContractsByRecipientSelector = selectorFamily< - ArrayOfVestingContract, - QueryClientParams & { - params: Parameters< - CwPayrollFactoryQueryClient['listVestingContractsByRecipient'] - > - } ->({ - key: 'cwPayrollFactoryListVestingContractsByRecipient', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const list = get( - queryContractIndexerSelector({ - ...queryClientParams, - formula: 'cwPayrollFactory/listVestingContractsByRecipient', - args: params[0], - }) - ) - if (list) { - return list - } - - // If indexer query fails, fallback to contract query. - const client = get(queryClient(queryClientParams)) - return await client.listVestingContractsByRecipient(...params) - }, -}) -export const listVestingContractsByRecipientReverseSelector = selectorFamily< - ArrayOfVestingContract, - QueryClientParams & { - params: Parameters< - CwPayrollFactoryQueryClient['listVestingContractsByRecipientReverse'] - > - } ->({ - key: 'cwPayrollFactoryListVestingContractsByRecipientReverse', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const list = get( - queryContractIndexerSelector({ - ...queryClientParams, - formula: 'cwPayrollFactory/listVestingContractsByRecipientReverse', - args: params[0], - }) - ) - if (list) { - return list - } - - // If indexer query fails, fallback to contract query. - const client = get(queryClient(queryClientParams)) - return await client.listVestingContractsByRecipientReverse(...params) - }, -}) -export const ownershipSelector = selectorFamily< - OwnershipForAddr, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cwPayrollFactoryOwnership', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const ownership = get( - queryContractIndexerSelector({ - ...queryClientParams, - formula: 'cwPayrollFactory/ownership', - }) - ) - if (ownership) { - return ownership - } - - // If indexer query fails, fallback to contract query. - const client = get(queryClient(queryClientParams)) - return await client.ownership(...params) - }, -}) -export const codeIdSelector = selectorFamily< - Uint64, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cwPayrollFactoryCodeId', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const codeId = get( - queryContractIndexerSelector({ - ...queryClientParams, - formula: 'cwPayrollFactory/codeId', - }) - ) - if (codeId) { - return codeId - } - - // If indexer query fails, fallback to contract query. - const client = get(queryClient(queryClientParams)) - return await client.codeId(...params) - }, -}) - -const ALL_VESTING_CONTRACTS_LIMIT = 30 -export const allVestingContractsSelector = selectorFamily< - ArrayOfVestingContract, - QueryClientParams ->({ - key: 'cwPayrollFactoryAllVestingContracts', - get: - (queryClientParams) => - async ({ get }) => { - const id = get(refreshVestingAtom('')) - - const list = get( - queryContractIndexerSelector({ - ...queryClientParams, - formula: 'cwPayrollFactory/listVestingContracts', - id, - }) - ) - if (list) { - return list - } - - // If indexer query fails, fallback to contract query. - - const vestingContracts: ArrayOfVestingContract = [] - while (true) { - const response = await get( - _listVestingContractsSelector({ - ...queryClientParams, - params: [ - { - startAfter: - vestingContracts[vestingContracts.length - 1]?.contract, - limit: ALL_VESTING_CONTRACTS_LIMIT, - }, - ], - }) - ) - - if (!response?.length) { - break - } - - vestingContracts.push(...response) - - // If we have less than the limit of items, we've exhausted them. - if (response.length < ALL_VESTING_CONTRACTS_LIMIT) { - break - } - } - - return vestingContracts - }, -}) diff --git a/packages/state/recoil/selectors/contracts/CwVesting.ts b/packages/state/recoil/selectors/contracts/CwVesting.ts index 4b440005e..9ce0e76c8 100644 --- a/packages/state/recoil/selectors/contracts/CwVesting.ts +++ b/packages/state/recoil/selectors/contracts/CwVesting.ts @@ -1,35 +1,9 @@ import { selectorFamily } from 'recoil' -import { - CwVestingStakeHistory, - Uint128, - Uint64, - WithChainId, -} from '@dao-dao/types' -import { OwnershipForAddr, Vest } from '@dao-dao/types/contracts/CwVesting' +import { WithChainId } from '@dao-dao/types' -import { - CwVestingClient, - CwVestingQueryClient, -} from '../../../contracts/CwVesting' -import { refreshVestingAtom, signingCosmWasmClientAtom } from '../../atoms' -import { cosmWasmClientForChainSelector } from '../chain' -import { QueryIndexerParams, queryContractIndexerSelector } from '../indexer' - -type QueryClientParams = WithChainId<{ - contractAddress: string -}> - -const queryClient = selectorFamily({ - key: 'cwVestingQueryClient', - get: - ({ contractAddress, chainId }) => - ({ get }) => { - const client = get(cosmWasmClientForChainSelector(chainId)) - return new CwVestingQueryClient(client, contractAddress) - }, - dangerouslyAllowMutability: true, -}) +import { CwVestingClient } from '../../../contracts/CwVesting' +import { signingCosmWasmClientAtom } from '../../atoms' export type ExecuteClientParams = WithChainId<{ contractAddress: string @@ -50,170 +24,3 @@ export const executeClient = selectorFamily< }, dangerouslyAllowMutability: true, }) - -export const infoSelector = selectorFamily< - Vest, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cwVestingInfo', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const anyId = get(refreshVestingAtom('')) - const thisId = get(refreshVestingAtom(queryClientParams.contractAddress)) - - const info = get( - queryContractIndexerSelector({ - ...queryClientParams, - formula: 'cwVesting/info', - id: anyId + thisId, - }) - ) - if (info) { - return info - } - - // If indexer query fails, fallback to contract query. - const client = get(queryClient(queryClientParams)) - return await client.info(...params) - }, -}) -export const ownershipSelector = selectorFamily< - OwnershipForAddr, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cwVestingOwnership', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - get(refreshVestingAtom('')) - get(refreshVestingAtom(queryClientParams.contractAddress)) - const client = get(queryClient(queryClientParams)) - return await client.ownership(...params) - }, -}) -export const distributableSelector = selectorFamily< - Uint128, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cwVestingDistributable', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - get(refreshVestingAtom('')) - get(refreshVestingAtom(queryClientParams.contractAddress)) - const client = get(queryClient(queryClientParams)) - return await client.distributable(...params) - }, -}) -export const vestedSelector = selectorFamily< - Uint128, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cwVestingVested', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - get(refreshVestingAtom('')) - get(refreshVestingAtom(queryClientParams.contractAddress)) - const client = get(queryClient(queryClientParams)) - return await client.vested(...params) - }, -}) -export const totalToVestSelector = selectorFamily< - Uint128, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cwVestingTotalToVest', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.totalToVest(...params) - }, -}) -export const vestDurationSelector = selectorFamily< - Uint64, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cwVestingVestDuration', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.vestDuration(...params) - }, -}) -export const stakeSelector = selectorFamily< - Uint128, - QueryClientParams & { - params: Parameters - } ->({ - key: 'cwVestingStake', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - get(refreshVestingAtom('')) - get(refreshVestingAtom(queryClientParams.contractAddress)) - const client = get(queryClient(queryClientParams)) - return await client.stake(...params) - }, -}) - -//! Custom selectors - -// TODO(indexer): Use TX events indexer for this instead. -export const stakeHistorySelector = selectorFamily< - CwVestingStakeHistory | null, - QueryClientParams & Pick ->({ - key: 'cwVestingValidatorStakeHistory', - get: - ({ contractAddress, chainId }) => - ({ get }) => { - const anyId = get(refreshVestingAtom('')) - const thisId = get(refreshVestingAtom(contractAddress)) - - return get( - queryContractIndexerSelector({ - contractAddress, - formula: 'cwVesting/stakeHistory', - chainId, - id: anyId + thisId, - noFallback: true, - }) - ) - }, -}) - -// No query to get this value, so require it. -export const unbondingDurationSecondsSelector = selectorFamily< - number | null, - QueryClientParams ->({ - key: 'cwVestingValidatorUnbondingDurationSeconds', - get: - ({ contractAddress, chainId }) => - ({ get }) => - get( - queryContractIndexerSelector({ - contractAddress, - formula: 'cwVesting/unbondingDurationSeconds', - chainId, - noFallback: true, - }) - ), -}) diff --git a/packages/state/recoil/selectors/contracts/index.ts b/packages/state/recoil/selectors/contracts/index.ts index 50eb5bf99..e7d7331b1 100644 --- a/packages/state/recoil/selectors/contracts/index.ts +++ b/packages/state/recoil/selectors/contracts/index.ts @@ -5,7 +5,6 @@ export * as Cw20BaseSelectors from './Cw20Base' export * as Cw20StakeSelectors from './Cw20Stake' export * as Cw721BaseSelectors from './Cw721Base' export * as CwAdminFactorySelectors from './CwAdminFactory' -export * as CwPayrollFactorySelectors from './CwPayrollFactory' export * as CwProposalSingleV1Selectors from './CwProposalSingle.v1' export * as CwTokenfactoryIssuerSelectors from './CwTokenfactoryIssuer' export * as CwTokenSwapSelectors from './CwTokenSwap' diff --git a/packages/state/recoil/selectors/index.ts b/packages/state/recoil/selectors/index.ts index 55c52c7d5..684883c47 100644 --- a/packages/state/recoil/selectors/index.ts +++ b/packages/state/recoil/selectors/index.ts @@ -17,6 +17,5 @@ export * from './proposal' export * from './skip' export * from './token' export * from './treasury' -export * from './vesting' export * from './wallet' export * from './whale' diff --git a/packages/state/recoil/selectors/token.ts b/packages/state/recoil/selectors/token.ts index 79a114b9e..bbeaf2ed8 100644 --- a/packages/state/recoil/selectors/token.ts +++ b/packages/state/recoil/selectors/token.ts @@ -28,15 +28,14 @@ import { isValidWalletAddress, } from '@dao-dao/utils' -import { tokenQueries } from '../../query' -import { queryClientAtom } from '../atoms' +import { chainQueries, tokenQueries } from '../../query' +import { queryClientAtom, refreshTokenCardLazyInfoAtom } from '../atoms' import { astroportUsdPriceSelector } from './astroport' import { denomMetadataSelector, ibcRpcClientForChainSelector, nativeBalancesSelector, nativeDelegatedBalanceSelector, - nativeDelegationInfoSelector, nativeDenomBalanceSelector, nativeUnstakingDurationSecondsSelector, } from './chain' @@ -355,7 +354,10 @@ export const genericTokenUndelegatingBalancesSelector = selectorFamily< get: (params) => async ({ get }) => { - const { unbondingDelegations } = get(nativeDelegationInfoSelector(params)) + const queryClient = get(queryClientAtom) + const { unbondingDelegations } = await queryClient.fetchQuery( + chainQueries.nativeDelegationInfo(queryClient, params) + ) const tokens = get( waitForAll( @@ -596,7 +598,14 @@ export const tokenCardLazyInfoSelector = selectorFamily< key: 'tokenCardLazyInfo', get: ({ owner, token, unstakedBalance }) => - ({ get }) => { + async ({ get }) => { + get( + refreshTokenCardLazyInfoAtom({ + token: token.source, + owner, + }) + ) + const { chainId, type } = token let stakingInfo: TokenCardLazyInfo['stakingInfo'] = undefined @@ -615,77 +624,68 @@ export const tokenCardLazyInfoSelector = selectorFamily< token.denomOrAddress === getNativeTokenForChainId(chainId).denomOrAddress ) { - // Neutron does not have staking so this may error. Ignore if so. - const nativeDelegationInfoLoadable = get( - waitForAllSettled([ - nativeDelegationInfoSelector({ - address: owner, - chainId, - }), - ]) - )[0] - const nativeDelegationInfo = - nativeDelegationInfoLoadable.state === 'hasValue' - ? nativeDelegationInfoLoadable.contents - : undefined - - if (nativeDelegationInfo) { - const unstakingDurationSeconds = get( - nativeUnstakingDurationSecondsSelector({ + const queryClient = get(queryClientAtom) + const { delegations, unbondingDelegations } = + await queryClient.fetchQuery( + chainQueries.nativeDelegationInfo(queryClient, { chainId, + address: owner, }) ) - const unstakingTasks = nativeDelegationInfo.unbondingDelegations.map( - ({ balance, finishesAt }) => ({ - token, - status: UnstakingTaskStatus.Unstaking, - amount: convertMicroDenomToDenomWithDecimals( - balance.amount, - token.decimals - ), - date: finishesAt, - }) - ) + const unstakingDurationSeconds = get( + nativeUnstakingDurationSecondsSelector({ + chainId, + }) + ) - const stakes = nativeDelegationInfo.delegations.map( - ({ validator, delegated, pendingReward }) => ({ - token, - validator, - amount: convertMicroDenomToDenomWithDecimals( - delegated.amount, - token.decimals - ), - rewards: convertMicroDenomToDenomWithDecimals( - pendingReward.amount, - token.decimals - ), - }) - ) + const unstakingTasks = unbondingDelegations.map( + ({ balance, finishesAt }) => ({ + token, + status: UnstakingTaskStatus.Unstaking, + amount: convertMicroDenomToDenomWithDecimals( + balance.amount, + token.decimals + ), + date: finishesAt, + }) + ) - const totalStaked = - stakes.reduce((acc, stake) => acc + stake.amount, 0) ?? 0 - const totalPendingRewards = - stakes?.reduce((acc, stake) => acc + stake.rewards, 0) ?? 0 - const totalUnstaking = - unstakingTasks.reduce( - (acc, task) => - acc + - // Only include balance of unstaking tasks. - (task.status === UnstakingTaskStatus.Unstaking - ? task.amount - : 0), - 0 - ) ?? 0 - - stakingInfo = { - unstakingTasks, - unstakingDurationSeconds, - stakes, - totalStaked, - totalPendingRewards, - totalUnstaking, - } + const stakes = delegations.map( + ({ validator, delegated, pendingReward }) => ({ + token, + validator, + amount: convertMicroDenomToDenomWithDecimals( + delegated.amount, + token.decimals + ), + rewards: convertMicroDenomToDenomWithDecimals( + pendingReward.amount, + token.decimals + ), + }) + ) + + const totalStaked = + stakes.reduce((acc, stake) => acc + stake.amount, 0) ?? 0 + const totalPendingRewards = + stakes?.reduce((acc, stake) => acc + stake.rewards, 0) ?? 0 + const totalUnstaking = + unstakingTasks.reduce( + (acc, task) => + acc + + // Only include balance of unstaking tasks. + (task.status === UnstakingTaskStatus.Unstaking ? task.amount : 0), + 0 + ) ?? 0 + + stakingInfo = { + unstakingTasks, + unstakingDurationSeconds, + stakes, + totalStaked, + totalPendingRewards, + totalUnstaking, } } diff --git a/packages/state/recoil/selectors/vesting.ts b/packages/state/recoil/selectors/vesting.ts deleted file mode 100644 index 2f157ecd8..000000000 --- a/packages/state/recoil/selectors/vesting.ts +++ /dev/null @@ -1,401 +0,0 @@ -import uniq from 'lodash.uniq' -import { selectorFamily, waitForAll, waitForAllSettled } from 'recoil' - -import { - TokenType, - VestingInfo, - VestingStep, - WithChainId, -} from '@dao-dao/types' -import { - ContractName, - convertMicroDenomToDenomWithDecimals, - getVestingValidatorSlashes, -} from '@dao-dao/utils' - -import { refreshVestingAtom } from '../atoms' -import { nativeDelegationInfoSelector, validatorSlashesSelector } from './chain' -import { isContractSelector } from './contract' -import { - Cw1WhitelistSelectors, - CwPayrollFactorySelectors, - CwVestingSelectors, -} from './contracts' -import { queryWalletIndexerSelector } from './indexer' -import { genericTokenSelector } from './token' - -export const vestingPaymentsOwnedBySelector = selectorFamily< - string[], - WithChainId<{ address: string }> ->({ - key: 'vestingPaymentsOwnedBy', - get: - ({ chainId, address }) => - ({ get }) => { - const vestingPayments: string[] = get( - queryWalletIndexerSelector({ - chainId, - walletAddress: address, - formula: 'vesting/ownerOf', - noFallback: true, - }) - ) - - return vestingPayments && Array.isArray(vestingPayments) - ? vestingPayments - : [] - }, -}) - -export const vestingInfosOwnedBySelector = selectorFamily< - VestingInfo[], - WithChainId<{ address: string }> ->({ - key: 'vestingInfosOwnedBy', - get: - ({ chainId, address }) => - ({ get }) => { - const vestingPaymentContracts = get( - vestingPaymentsOwnedBySelector({ - chainId, - address, - }) - ) - - return get( - waitForAll( - vestingPaymentContracts.map((vestingContractAddress) => - vestingInfoSelector({ - vestingContractAddress, - chainId, - }) - ) - ) - ) - }, -}) - -export const vestingFactoryOwnerSelector = selectorFamily< - string | undefined, - WithChainId<{ factory: string }> ->({ - key: 'vestingFactoryOwner', - get: - ({ chainId, factory }) => - ({ get }) => { - const ownership = get( - CwPayrollFactorySelectors.ownershipSelector({ - contractAddress: factory, - chainId, - params: [], - }) - ) - - return ownership.owner || undefined - }, -}) - -export const vestingInfosForFactorySelector = selectorFamily< - VestingInfo[], - WithChainId<{ factory: string }> ->({ - key: 'vestingInfosForFactory', - get: - ({ chainId, factory }) => - ({ get }) => { - const vestingPaymentContracts = get( - CwPayrollFactorySelectors.allVestingContractsSelector({ - chainId, - contractAddress: factory, - }) - ) - - return get( - waitForAll( - vestingPaymentContracts.map(({ contract }) => - vestingInfoSelector({ - chainId, - vestingContractAddress: contract, - }) - ) - ) - ) - }, -}) - -export const vestingInfoSelector = selectorFamily< - VestingInfo, - WithChainId<{ vestingContractAddress: string }> ->({ - key: 'vestingInfo', - get: - ({ vestingContractAddress, chainId }) => - ({ get }) => { - get(refreshVestingAtom('')) - get(refreshVestingAtom(vestingContractAddress)) - - const [ - vest, - vested, - total, - distributable, - { owner }, - stakeHistory, - unbondingDurationSeconds, - [actualDelegationInfoLoadable], - ] = get( - waitForAll([ - CwVestingSelectors.infoSelector({ - contractAddress: vestingContractAddress, - chainId, - params: [], - }), - CwVestingSelectors.vestedSelector({ - contractAddress: vestingContractAddress, - chainId, - params: [{}], - }), - CwVestingSelectors.totalToVestSelector({ - contractAddress: vestingContractAddress, - chainId, - params: [], - }), - CwVestingSelectors.distributableSelector({ - contractAddress: vestingContractAddress, - chainId, - params: [{}], - }), - CwVestingSelectors.ownershipSelector({ - contractAddress: vestingContractAddress, - chainId, - params: [], - }), - CwVestingSelectors.stakeHistorySelector({ - contractAddress: vestingContractAddress, - chainId, - }), - CwVestingSelectors.unbondingDurationSecondsSelector({ - contractAddress: vestingContractAddress, - chainId, - }), - // This fails to load on chains without staking support, like Neutron. - // If so, it's fine, we know nothing is staked. - waitForAllSettled([ - nativeDelegationInfoSelector({ - address: vestingContractAddress, - chainId, - }), - ]), - ]) - ) - - const ownerIsCw1Whitelist = owner - ? get( - isContractSelector({ - chainId, - contractAddress: owner, - name: ContractName.Cw1Whitelist, - }) - ) - : false - const cw1WhitelistAdmins = - owner && ownerIsCw1Whitelist - ? get( - Cw1WhitelistSelectors.adminListSelector({ - contractAddress: owner, - chainId, - params: [], - }) - ).admins - : undefined - - const token = get( - genericTokenSelector({ - type: 'cw20' in vest.denom ? TokenType.Cw20 : TokenType.Native, - denomOrAddress: - 'cw20' in vest.denom ? vest.denom.cw20 : vest.denom.native, - chainId, - }) - ) - - const uniqueValidators = uniq( - stakeHistory?.stakeEvents.flatMap((event) => - event.type === 'redelegate' ? event.toValidator : event.validator - ) ?? [] - ) - // Get all the slashes for each validator from the indexer. - const validatorSlashes = get( - waitForAll( - uniqueValidators.map((validatorOperatorAddress) => - validatorSlashesSelector({ - validatorOperatorAddress, - chainId, - }) - ) - ) - ).map((slashes, index) => ({ - validator: uniqueValidators[index], - slashes, - })) - - const vestingValidatorSlashes = - stakeHistory && unbondingDurationSeconds !== null - ? getVestingValidatorSlashes( - stakeHistory, - unbondingDurationSeconds, - validatorSlashes - ) - : [] - - const hasUnregisteredSlashes = - vestingValidatorSlashes?.some(({ slashes }) => - slashes.some(({ unregisteredAmount }) => unregisteredAmount > 0) - ) ?? false - - const actualSlashed = vestingValidatorSlashes?.reduce( - (slashed, { slashes }) => - slashed + - slashes.reduce((acc, { amount }) => acc + BigInt(amount), BigInt(0)), - BigInt(0) - ) - - // This errors on chains without staking support, like Neutron. If so, - // it's fine, we know nothing is staked. - if ( - actualDelegationInfoLoadable.state === 'hasError' && - (!(actualDelegationInfoLoadable.contents instanceof Error) || - !actualDelegationInfoLoadable.contents.message.includes( - 'unknown query path' - )) - ) { - throw actualDelegationInfoLoadable.contents - } - - // Should always have loaded here. - const actualDelegationInfo = actualDelegationInfoLoadable.valueMaybe() - - const actualStaked = - actualDelegationInfo?.delegations.reduce( - (acc, { delegated }) => acc + BigInt(delegated.amount), - BigInt(0) - ) ?? BigInt(0) - const actualUnstaking = - actualDelegationInfo?.unbondingDelegations.reduce( - (acc, { balance }) => acc + BigInt(balance.amount), - BigInt(0) - ) ?? BigInt(0) - - // If cannot compute the actual slashed amount, then we cannot compute the - // stakable amount, so default to 0 to prevent the UI from allowing - // staking. - const stakable = - actualSlashed === undefined - ? '0' - : ( - BigInt(total) - - BigInt(vest.claimed) - - BigInt(actualStaked) - - BigInt(actualUnstaking) - - actualSlashed - ).toString() - - const completed = - (vest.status === 'funded' || - (typeof vest.status === 'object' && 'canceled' in vest.status)) && - vest.claimed === total - - const startTimeMs = Number(vest.start_time) / 1e6 - const startDate = new Date(startTimeMs) - - const steps: VestingStep[] = - // Constant is used when a vest is canceled. - 'constant' in vest.vested - ? [ - { - timestamp: startTimeMs, - amount: convertMicroDenomToDenomWithDecimals( - vest.vested.constant.y, - token.decimals - ), - }, - { - timestamp: startTimeMs, - amount: convertMicroDenomToDenomWithDecimals( - vest.vested.constant.y, - token.decimals - ), - }, - ] - : 'saturating_linear' in vest.vested - ? [ - { - timestamp: - startTimeMs + vest.vested.saturating_linear.min_x * 1000, - amount: convertMicroDenomToDenomWithDecimals( - vest.vested.saturating_linear.min_y, - token.decimals - ), - }, - { - timestamp: - startTimeMs + vest.vested.saturating_linear.max_x * 1000, - amount: convertMicroDenomToDenomWithDecimals( - vest.vested.saturating_linear.max_y, - token.decimals - ), - }, - ] - : vest.vested.piecewise_linear.steps.reduce( - (acc, [seconds, amount], index): VestingStep[] => { - // Ignore first step if hardcoded 0 amount at 1 second. - if (index === 0 && seconds === 1 && amount === '0') { - return acc - } - - return [ - ...acc, - { - timestamp: startTimeMs + seconds * 1000, - amount: convertMicroDenomToDenomWithDecimals( - amount, - token.decimals - ), - }, - ] - }, - [] as VestingStep[] - ) - - const endDate = new Date(steps[steps.length - 1].timestamp) - - return { - chainId, - vestingContractAddress, - vest, - token, - owner: owner - ? { - address: owner, - ...(ownerIsCw1Whitelist && cw1WhitelistAdmins - ? { - isCw1Whitelist: true, - cw1WhitelistAdmins, - } - : { - isCw1Whitelist: false, - }), - } - : undefined, - vested, - distributable, - total, - stakable, - slashes: vestingValidatorSlashes, - hasUnregisteredSlashes, - completed, - startDate, - endDate, - steps, - } - }, -}) diff --git a/packages/stateful/actions/core/treasury/ManageStaking/index.tsx b/packages/stateful/actions/core/treasury/ManageStaking/index.tsx index 4e5a53eb8..af1300955 100644 --- a/packages/stateful/actions/core/treasury/ManageStaking/index.tsx +++ b/packages/stateful/actions/core/treasury/ManageStaking/index.tsx @@ -1,11 +1,11 @@ import { coin, parseCoins } from '@cosmjs/amino' +import { useQueryClient } from '@tanstack/react-query' import { useCallback } from 'react' import { useFormContext } from 'react-hook-form' import { useTranslation } from 'react-i18next' -import { constSelector } from 'recoil' import { - nativeDelegationInfoSelector, + chainQueries, nativeUnstakingDurationSecondsSelector, validatorsSelector, } from '@dao-dao/state' @@ -21,6 +21,7 @@ import { ChainId, Coin, LoadingData, + NativeDelegationInfo, TokenType, UnifiedCosmosMsg, decodedStakingStargateMsgToCw, @@ -57,7 +58,10 @@ import { import { AddressInput } from '../../../../components/AddressInput' import { SuspenseLoader } from '../../../../components/SuspenseLoader' -import { useExecutedProposalTxLoadable } from '../../../../hooks' +import { + useExecutedProposalTxLoadable, + useQueryLoadingData, +} from '../../../../hooks' import { useTokenBalances } from '../../../hooks' import { useActionOptions } from '../../../react' import { @@ -299,14 +303,19 @@ const InnerComponent: ActionComponent = (props) => { } const address = getChainAddressForActionOptions(options, chainId) - const loadingNativeDelegationInfo = useCachedLoading( + + const queryClient = useQueryClient() + const loadingNativeDelegationInfo = useQueryLoadingData( address - ? nativeDelegationInfoSelector({ + ? chainQueries.nativeDelegationInfo(queryClient, { chainId, address, }) - : constSelector(undefined), - undefined + : undefined, + { + delegations: [], + unbondingDelegations: [], + } as NativeDelegationInfo ) const loadingValidators = useCachedLoading( @@ -408,24 +417,22 @@ const InnerComponent: ActionComponent = (props) => { loadingNativeBalance.loading || !loadingNativeBalance.data ? '0' : loadingNativeBalance.data.amount, - stakes: - loadingNativeDelegationInfo.loading || - !loadingNativeDelegationInfo.data - ? [] - : loadingNativeDelegationInfo.data.delegations.map( - ({ validator, delegated, pendingReward }) => ({ - token: nativeToken, - validator, - amount: convertMicroDenomToDenomWithDecimals( - delegated.amount, - nativeToken.decimals - ), - rewards: convertMicroDenomToDenomWithDecimals( - pendingReward.amount, - nativeToken.decimals - ), - }) - ), + stakes: loadingNativeDelegationInfo.loading + ? [] + : loadingNativeDelegationInfo.data.delegations.map( + ({ validator, delegated, pendingReward }) => ({ + token: nativeToken, + validator, + amount: convertMicroDenomToDenomWithDecimals( + delegated.amount, + nativeToken.decimals + ), + rewards: convertMicroDenomToDenomWithDecimals( + pendingReward.amount, + nativeToken.decimals + ), + }) + ), validators: loadingValidators.loading ? [] : loadingValidators.data, executed: executedTxLoadable.state === 'hasValue' && @@ -491,9 +498,10 @@ export const makeManageStakingAction: ActionMaker = ({ const useDefaults: UseDefaults = () => { const stakeActions = useStakeActions() - const loadingNativeDelegationInfo = useCachedLoading( + const queryClient = useQueryClient() + const loadingNativeDelegationInfo = useQueryLoadingData( address - ? nativeDelegationInfoSelector({ + ? chainQueries.nativeDelegationInfo(queryClient, { chainId, address, }) @@ -501,7 +509,7 @@ export const makeManageStakingAction: ActionMaker = ({ { delegations: [], unbondingDelegations: [], - } + } as NativeDelegationInfo ) return { @@ -510,8 +518,7 @@ export const makeManageStakingAction: ActionMaker = ({ // Default to first validator if exists. validator: (!loadingNativeDelegationInfo.loading && - loadingNativeDelegationInfo.data?.delegations[0]?.validator - .address) || + loadingNativeDelegationInfo.data.delegations[0]?.validator.address) || '', toValidator: '', amount: 1, diff --git a/packages/stateful/actions/core/treasury/ManageVesting/BeginVesting.stories.tsx b/packages/stateful/actions/core/treasury/ManageVesting/BeginVesting.stories.tsx index 90db7f8d2..4576b96eb 100644 --- a/packages/stateful/actions/core/treasury/ManageVesting/BeginVesting.stories.tsx +++ b/packages/stateful/actions/core/treasury/ManageVesting/BeginVesting.stories.tsx @@ -88,7 +88,7 @@ Default.args = { preV1VestingFactoryOwner: { loading: false, errored: false, - data: undefined, + data: null, }, AddressInput, EntityDisplay, diff --git a/packages/stateful/actions/core/treasury/ManageVesting/BeginVesting.tsx b/packages/stateful/actions/core/treasury/ManageVesting/BeginVesting.tsx index cf566ffe9..8ab2cf774 100644 --- a/packages/stateful/actions/core/treasury/ManageVesting/BeginVesting.tsx +++ b/packages/stateful/actions/core/treasury/ManageVesting/BeginVesting.tsx @@ -92,9 +92,9 @@ export type BeginVestingOptions = { // If undefined, no widget is setup, and begin vesting should be disabled. widgetData: VestingPaymentsWidgetData | undefined tokens: GenericTokenBalanceWithOwner[] - // The vesting contract factory owner. If undefined, no owner is set. This is + // The vesting contract factory owner. If null, no owner is set. This is // only used for pre-v1 vesting widgets. - preV1VestingFactoryOwner: LoadingDataWithError + preV1VestingFactoryOwner: LoadingDataWithError AddressInput: ComponentType> EntityDisplay: ComponentType createCw1WhitelistOwners: CreateCw1Whitelist diff --git a/packages/stateful/actions/core/treasury/ManageVesting/CancelVesting.tsx b/packages/stateful/actions/core/treasury/ManageVesting/CancelVesting.tsx index f380b8466..69bf24780 100644 --- a/packages/stateful/actions/core/treasury/ManageVesting/CancelVesting.tsx +++ b/packages/stateful/actions/core/treasury/ManageVesting/CancelVesting.tsx @@ -14,6 +14,7 @@ import { LoadingData, LoadingDataWithError, StatefulEntityDisplayProps, + StatefulVestingPaymentCardProps, VestingInfo, } from '@dao-dao/types' import { @@ -33,7 +34,7 @@ export type CancelVestingOptions = { vestingInfos: LoadingDataWithError cancelledVestingContract: LoadingData EntityDisplay: ComponentType - VestingPaymentCard: ComponentType + VestingPaymentCard: ComponentType } export const CancelVesting: ActionComponent = ({ @@ -149,7 +150,7 @@ export const CancelVesting: ActionComponent = ({ cancelledVestingContract.loading ? ( ) : cancelledVestingContract.data ? ( - + ) : (

{t('error.loadingData')} diff --git a/packages/stateful/actions/core/treasury/ManageVesting/index.tsx b/packages/stateful/actions/core/treasury/ManageVesting/index.tsx index 3ad324a02..977085107 100644 --- a/packages/stateful/actions/core/treasury/ManageVesting/index.tsx +++ b/packages/stateful/actions/core/treasury/ManageVesting/index.tsx @@ -1,24 +1,24 @@ import { coins } from '@cosmjs/amino' +import { useQueries, useQueryClient } from '@tanstack/react-query' import { ComponentType, useCallback, useEffect } from 'react' import { useFormContext } from 'react-hook-form' import { useTranslation } from 'react-i18next' import { constSelector, useRecoilValueLoadable, waitForAll } from 'recoil' +import { + cwPayrollFactoryQueries, + cwVestingExtraQueries, +} from '@dao-dao/state/query' import { Cw1WhitelistSelectors, genericTokenSelector, nativeUnstakingDurationSecondsSelector, - vestingFactoryOwnerSelector, - vestingInfoSelector, - vestingInfosOwnedBySelector, } from '@dao-dao/state/recoil' import { Loader, MoneyWingsEmoji, SegmentedControls, useCachedLoadable, - useCachedLoading, - useCachedLoadingWithError, } from '@dao-dao/stateless' import { DurationUnits, @@ -28,6 +28,7 @@ import { TypedOption, UnifiedCosmosMsg, VestingContractVersion, + VestingInfo, VestingPaymentsWidgetData, WidgetId, } from '@dao-dao/types' @@ -60,6 +61,7 @@ import { getDisplayNameForChainId, getNativeTokenForChainId, isValidBech32Address, + makeCombineQueryResultsIntoLoadingDataWithError, makeWasmMessage, maybeMakePolytoneExecuteMessage, objectMatchesStructure, @@ -72,7 +74,11 @@ import { Trans, VestingPaymentCard, } from '../../../../components' -import { useCreateCw1Whitelist } from '../../../../hooks' +import { + useCreateCw1Whitelist, + useQueryLoadingData, + useQueryLoadingDataWithError, +} from '../../../../hooks' import { useWidget } from '../../../../widgets' import { useTokenBalances } from '../../../hooks/useTokenBalances' import { useActionOptions } from '../../../react' @@ -112,26 +118,28 @@ const useVestingInfosOwnedByEntity = () => { address: nativeAddress, chain: { chain_id: nativeChainId }, } = useActionOptions() + const queryClient = useQueryClient() - return useCachedLoadingWithError( - waitForAll( + return useQueries({ + queries: context.type === ActionContextType.Dao ? // Get vesting infos owned by any of the DAO's accounts. context.dao.accounts.map(({ chainId, address }) => - vestingInfosOwnedBySelector({ + cwVestingExtraQueries.vestingInfosOwnedBy(queryClient, { address, chainId, }) ) : [ - vestingInfosOwnedBySelector({ + cwVestingExtraQueries.vestingInfosOwnedBy(queryClient, { address: nativeAddress, chainId: nativeChainId, }), - ] - ), - (data) => data.flat() - ) + ], + combine: makeCombineQueryResultsIntoLoadingDataWithError({ + transform: (infos) => infos.flat(), + }), + }) } const Component: ComponentType< @@ -178,28 +186,32 @@ const Component: ComponentType< const tokenBalances = useTokenBalances() // Only used on pre-v1 vesting widgets. - const preV1VestingFactoryOwner = useCachedLoadingWithError( + const queryClient = useQueryClient() + const preV1VestingFactoryOwner = useQueryLoadingDataWithError( widgetData && !widgetData.version && widgetData.factory - ? vestingFactoryOwnerSelector({ - factory: widgetData.factory, + ? cwPayrollFactoryQueries.ownership(queryClient, { chainId: nativeChainId, + contractAddress: widgetData.factory, }) - : undefined + : undefined, + ({ owner }) => owner || null ) const vestingInfos = useVestingInfosOwnedByEntity() - const selectedVest = useCachedLoading( + const didSelectVest = !props.isCreating && - (mode === 'registerSlash' || mode === 'cancel') && - selectedAddress && - selectedChainId - ? vestingInfoSelector({ - vestingContractAddress: selectedAddress, + (mode === 'registerSlash' || mode === 'cancel') && + !!selectedChainId && + !!selectedAddress + const selectedVest = useQueryLoadingData( + didSelectVest + ? cwVestingExtraQueries.info(queryClient, { chainId: selectedChainId, + address: selectedAddress, }) - : constSelector(undefined), - undefined + : undefined, + undefined as VestingInfo | undefined ) // Prevent action from being submitted if no address is selected while we're @@ -353,7 +365,12 @@ const Component: ComponentType< fieldNamePrefix={props.fieldNamePrefix + 'registerSlash.'} options={{ vestingInfos, - selectedVest, + selectedVest: didSelectVest + ? selectedVest + : { + loading: false, + data: undefined, + }, EntityDisplay, Trans, }} @@ -365,7 +382,12 @@ const Component: ComponentType< fieldNamePrefix={props.fieldNamePrefix + 'cancel.'} options={{ vestingInfos, - cancelledVestingContract: selectedVest, + cancelledVestingContract: didSelectVest + ? selectedVest + : { + loading: false, + data: undefined, + }, EntityDisplay, VestingPaymentCard, }} @@ -492,16 +514,18 @@ export const makeManageVestingAction: ActionMaker = ( return () => { const loadingTokenBalances = useTokenBalances() + const queryClient = useQueryClient() // Pre-v1 vesting widgets use the factory owner as the vesting owner. - const preV1VestingFactoryOwner = useCachedLoading( - widgetData?.factory && !widgetData.version - ? vestingFactoryOwnerSelector({ - factory: widgetData.factory, + const preV1Vesting = !!widgetData?.factory && !widgetData.version + const preV1VestingFactoryOwner = useQueryLoadingDataWithError( + preV1Vesting + ? cwPayrollFactoryQueries.ownership(queryClient, { chainId: nativeChainId, + contractAddress: widgetData!.factory!, }) - : constSelector(undefined), - undefined + : undefined, + ({ owner }) => owner || null ) // Get the native unbonding duration for each chain that a vesting @@ -530,7 +554,7 @@ export const makeManageVestingAction: ActionMaker = ( if (mode === 'begin' && widgetData) { if ( loadingTokenBalances.loading || - preV1VestingFactoryOwner.loading || + (preV1Vesting && preV1VestingFactoryOwner.loading) || nativeUnstakingDurationSecondsLoadable.state !== 'hasValue' ) { return @@ -587,8 +611,11 @@ export const makeManageVestingAction: ActionMaker = ( owner: // Widgets prior to V1 use the factory owner. !vestingSource.version - ? // Default to empty string if undefined so that it errors. This should never error. - preV1VestingFactoryOwner.data || '' + ? // Default to empty string just in case. This should never be loading here or errored. + (!preV1VestingFactoryOwner.loading && + !preV1VestingFactoryOwner.errored && + preV1VestingFactoryOwner.data) || + '' : // V1 and later can set the owner, or no widget data (when used by a wallet). !widgetData || (vestingSource.version && @@ -790,8 +817,9 @@ export const makeManageVestingAction: ActionMaker = ( }, [ loadingTokenBalances, - nativeUnstakingDurationSecondsLoadable, + preV1Vesting, preV1VestingFactoryOwner, + nativeUnstakingDurationSecondsLoadable, loadingVestingInfos, ] ) diff --git a/packages/stateful/components/PfpkNftSelectionModal.tsx b/packages/stateful/components/PfpkNftSelectionModal.tsx index f4a5a9db1..a31a7af59 100644 --- a/packages/stateful/components/PfpkNftSelectionModal.tsx +++ b/packages/stateful/components/PfpkNftSelectionModal.tsx @@ -40,7 +40,6 @@ import { useManageProfile, useProfile, useWallet, - useWalletBalances, } from '../hooks' import { NftSelectionModal } from './nft' import { ProfileAddChains } from './profile' @@ -61,6 +60,7 @@ export const InnerPfpkNftSelectionModal = ({ isWalletError, message: walletErrorMessage, chain, + refreshBalances, } = useWallet({ attemptConnection: visible, }) @@ -96,7 +96,6 @@ export const InnerPfpkNftSelectionModal = ({ profile, updateProfile: { updating: updatingProfile, go: updateProfile }, } = useManageProfile() - const { refreshBalances } = useWalletBalances() // Initialize to selected NFT. const [selectedKey, setSelectedKey] = useState( !profile.loading && profile.data.nft diff --git a/packages/stateful/components/dao/CreateDaoForm.tsx b/packages/stateful/components/dao/CreateDaoForm.tsx index 59e1ebd4b..878748e00 100644 --- a/packages/stateful/components/dao/CreateDaoForm.tsx +++ b/packages/stateful/components/dao/CreateDaoForm.tsx @@ -83,7 +83,6 @@ import { useFollowingDaos, useQuerySyncedRecoilState, useWallet, - useWalletBalances, } from '../../hooks' import { getAdapterById as getProposalModuleAdapterById } from '../../proposal-module-adapter' import { @@ -434,8 +433,8 @@ export const InnerCreateDaoForm = ({ isWalletConnected, address: walletAddress, getSigningClient, + refreshBalances, } = useWallet() - const { refreshBalances } = useWalletBalances() const instantiateWithSelfAdmin = CwAdminFactoryHooks.useInstantiateWithAdminFactory({ diff --git a/packages/stateful/components/dao/DaoTokenCard.tsx b/packages/stateful/components/dao/DaoTokenCard.tsx index e1df2e8f2..11d2fed06 100644 --- a/packages/stateful/components/dao/DaoTokenCard.tsx +++ b/packages/stateful/components/dao/DaoTokenCard.tsx @@ -3,13 +3,15 @@ import { ArchiveRounded, PaidRounded, } from '@mui/icons-material' +import { useQueryClient } from '@tanstack/react-query' import { useRouter } from 'next/router' import { useCallback, useState } from 'react' import { useTranslation } from 'react-i18next' import { useSetRecoilState } from 'recoil' import { - refreshNativeTokenStakingInfoAtom, + chainQueries, + refreshTokenCardLazyInfoAtom, tokenCardLazyInfoSelector, } from '@dao-dao/state' import { @@ -73,13 +75,28 @@ export const DaoTokenCard = ({ !!governanceTokenInfo && tokensEqual(token, governanceTokenInfo) // Refresh staking info. - const setRefreshNativeTokenStakingInfo = useSetRecoilState( - refreshNativeTokenStakingInfoAtom(owner.address) - ) - const refreshNativeTokenStakingInfo = useCallback( - () => setRefreshNativeTokenStakingInfo((id) => id + 1), - [setRefreshNativeTokenStakingInfo] + const setRefreshTokenCardLazyInfo = useSetRecoilState( + refreshTokenCardLazyInfoAtom({ + token: token.source, + owner: owner.address, + }) ) + const queryClient = useQueryClient() + const refreshNativeTokenStakingInfo = useCallback(() => { + // Invalidate validators. + queryClient.invalidateQueries({ + queryKey: ['chain', 'validator', { chainId: owner.chainId }], + }) + // Then native delegation info. + queryClient.invalidateQueries({ + queryKey: chainQueries.nativeDelegationInfo(queryClient, { + chainId: owner.chainId, + address: owner.address, + }).queryKey, + }) + // Then token card lazy info. + setRefreshTokenCardLazyInfo((id) => id + 1) + }, [owner.address, owner.chainId, queryClient, setRefreshTokenCardLazyInfo]) const lazyStakes = lazyInfo.loading ? [] diff --git a/packages/stateful/components/dao/DaoTokenDepositModal.tsx b/packages/stateful/components/dao/DaoTokenDepositModal.tsx index 253aaa095..4a32c76e1 100644 --- a/packages/stateful/components/dao/DaoTokenDepositModal.tsx +++ b/packages/stateful/components/dao/DaoTokenDepositModal.tsx @@ -24,7 +24,7 @@ import { processError, } from '@dao-dao/utils' -import { Cw20BaseHooks, useWallet, useWalletBalances } from '../../hooks' +import { Cw20BaseHooks, useWallet } from '../../hooks' import { ConnectWallet } from '../ConnectWallet' export type DaoTokenDepositModalProps = Pick< @@ -42,14 +42,16 @@ export const DaoTokenDepositModal = ({ }: DaoTokenDepositModalProps) => { const { t } = useTranslation() const { name: daoName } = useDaoInfoContext() - const { isWalletConnected, address, getSigningStargateClient } = useWallet({ + const { + isWalletConnected, + address, + getSigningStargateClient, + refreshBalances: refreshWalletBalances, + } = useWallet({ chainId: token.chainId, // Only attempt connection when the modal is visible. attemptConnection: props.visible, }) - const { refreshBalances: refreshWalletBalances } = useWalletBalances({ - chainId: token.chainId, - }) const depositAddress = owner.address diff --git a/packages/stateful/components/dao/DaoTxTreasuryHistory.tsx b/packages/stateful/components/dao/DaoTxTreasuryHistory.tsx index 70f52fa53..d8aa87b95 100644 --- a/packages/stateful/components/dao/DaoTxTreasuryHistory.tsx +++ b/packages/stateful/components/dao/DaoTxTreasuryHistory.tsx @@ -1,4 +1,5 @@ import { ArrowOutwardRounded, East, West } from '@mui/icons-material' +import { useSuspenseQuery } from '@tanstack/react-query' import { useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import { useRecoilCallback, useRecoilValue } from 'recoil' @@ -8,7 +9,7 @@ import { blockHeightSelector, blockHeightTimestampSafeSelector, blockHeightTimestampSelector, - nativeBalanceSelector, + chainQueries, transformedTreasuryTransactionsSelector, } from '@dao-dao/state' import { @@ -157,8 +158,8 @@ export const InnerDaoTxTreasuryHistory = ({ ] ) - const nativeBalance = useRecoilValue( - nativeBalanceSelector({ + const { data: nativeBalance } = useSuspenseQuery( + chainQueries.nativeBalance({ chainId, address: coreAddress, }) diff --git a/packages/stateful/components/vesting/VestingPaymentCard.tsx b/packages/stateful/components/vesting/VestingPaymentCard.tsx index 307a776b3..e50810ee3 100644 --- a/packages/stateful/components/vesting/VestingPaymentCard.tsx +++ b/packages/stateful/components/vesting/VestingPaymentCard.tsx @@ -1,13 +1,14 @@ +import { useQueryClient } from '@tanstack/react-query' import { useState } from 'react' import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' -import { useSetRecoilState } from 'recoil' import { - refreshVestingAtom, - refreshWalletBalancesIdAtom, - tokenCardLazyInfoSelector, -} from '@dao-dao/state/recoil' + chainQueries, + cwVestingExtraQueries, + cwVestingQueryKeys, +} from '@dao-dao/state/query' +import { tokenCardLazyInfoSelector } from '@dao-dao/state/recoil' import { VestingPaymentCard as StatelessVestingPaymentCard, useAddToken, @@ -15,7 +16,12 @@ import { useChain, useDaoNavHelpers, } from '@dao-dao/stateless' -import { ActionKey, ChainId, EntityType, VestingInfo } from '@dao-dao/types' +import { + ActionKey, + ChainId, + EntityType, + StatefulVestingPaymentCardProps, +} from '@dao-dao/types' import { convertMicroDenomToDenomWithDecimals, getDaoProposalSinglePrefill, @@ -27,8 +33,8 @@ import { import { useAwaitNextBlock, useEntity, + useQueryLoadingDataWithError, useWallet, - useWalletBalances, } from '../../hooks' import { useDistribute, @@ -38,11 +44,33 @@ import { ButtonLink } from '../ButtonLink' import { EntityDisplay } from '../EntityDisplay' import { VestingStakingModal } from './VestingStakingModal' -export const VestingPaymentCard = (vestingInfo: VestingInfo) => { +export const VestingPaymentCard = ({ + vestingInfo: fallbackInfo, +}: StatefulVestingPaymentCardProps) => { const { t } = useTranslation() const { chain_id: chainId } = useChain() const { goToDaoProposal } = useDaoNavHelpers() - const { isWalletConnected, refreshBalances } = useWalletBalances() + + const { + address: walletAddress = '', + isWalletConnected, + refreshBalances, + } = useWallet({ + attemptConnection: true, + }) + + const queryClient = useQueryClient() + // Use info passed into props as fallback, since it came from the list query; + // the individual query updates more frequently. + const freshInfo = useQueryLoadingDataWithError( + cwVestingExtraQueries.info(queryClient, { + chainId, + address: fallbackInfo.vestingContractAddress, + }) + ) + + const vestingInfo = + freshInfo.loading || freshInfo.errored ? fallbackInfo : freshInfo.data const { vestingContractAddress, @@ -77,20 +105,44 @@ export const VestingPaymentCard = (vestingInfo: VestingInfo) => { } ) - const setRefreshVestingInfo = useSetRecoilState( - refreshVestingAtom(vestingContractAddress) - ) - const setRefreshBalances = useSetRecoilState( - refreshWalletBalancesIdAtom(vestingContractAddress) - ) const refresh = () => { - setRefreshVestingInfo((r) => r + 1) - setRefreshBalances((r) => r + 1) + // Invalidate validators. + queryClient.invalidateQueries({ + queryKey: ['chain', 'validator', { chainId }], + }) + // Invalidate staking info. + queryClient.invalidateQueries({ + queryKey: chainQueries.nativeDelegationInfo(queryClient, { + chainId, + address: vestingContractAddress, + }).queryKey, + }) + // Invalidate vesting indexer queries. + queryClient.invalidateQueries({ + queryKey: [ + 'indexer', + 'query', + { + chainId, + address: vestingContractAddress, + }, + ], + }) + // Then invalidate contract queries that depend on indexer queries. + queryClient.invalidateQueries({ + queryKey: cwVestingQueryKeys.address(chainId, vestingContractAddress), + }) + // Then info query. + queryClient.invalidateQueries({ + queryKey: cwVestingExtraQueries.info(queryClient, { + chainId, + address: vestingContractAddress, + }).queryKey, + }) } const awaitNextBlock = useAwaitNextBlock() - const { address: walletAddress = '' } = useWallet() const distribute = useDistribute({ contractAddress: vestingContractAddress, sender: walletAddress, diff --git a/packages/stateful/components/vesting/VestingPaymentLine.tsx b/packages/stateful/components/vesting/VestingPaymentLine.tsx new file mode 100644 index 000000000..da8f75754 --- /dev/null +++ b/packages/stateful/components/vesting/VestingPaymentLine.tsx @@ -0,0 +1,35 @@ +import { useQueryClient } from '@tanstack/react-query' + +import { cwVestingExtraQueries } from '@dao-dao/state/query' +import { VestingPaymentLine as StatelessVestingPaymentLine } from '@dao-dao/stateless' +import { StatefulVestingPaymentLineProps } from '@dao-dao/types' + +import { useQueryLoadingDataWithError } from '../../hooks' +import { EntityDisplay } from '../EntityDisplay' + +export const VestingPaymentLine = ({ + vestingInfo: fallbackInfo, + ...props +}: StatefulVestingPaymentLineProps) => { + const queryClient = useQueryClient() + + // Use info passed into props as fallback, since it came from the list query; + // the individual query updates more frequently. + const freshInfo = useQueryLoadingDataWithError( + cwVestingExtraQueries.info(queryClient, { + chainId: fallbackInfo.chainId, + address: fallbackInfo.vestingContractAddress, + }) + ) + + const vestingInfo = + freshInfo.loading || freshInfo.errored ? fallbackInfo : freshInfo.data + + return ( + + ) +} diff --git a/packages/stateful/components/vesting/VestingStakingModal.tsx b/packages/stateful/components/vesting/VestingStakingModal.tsx index a3fca6f67..eaf9cadc0 100644 --- a/packages/stateful/components/vesting/VestingStakingModal.tsx +++ b/packages/stateful/components/vesting/VestingStakingModal.tsx @@ -1,13 +1,15 @@ +import { useQueryClient } from '@tanstack/react-query' import { useState } from 'react' import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' -import { useSetRecoilState } from 'recoil' +import { + chainQueries, + cwVestingExtraQueries, + cwVestingQueryKeys, +} from '@dao-dao/state/query' import { nativeUnstakingDurationSecondsSelector, - refreshNativeTokenStakingInfoAtom, - refreshVestingAtom, - refreshWalletBalancesIdAtom, validatorsSelector, } from '@dao-dao/state/recoil' import { @@ -15,7 +17,6 @@ import { StakingModalProps, StakingMode, useCachedLoadable, - useChain, useDaoNavHelpers, } from '@dao-dao/stateless' import { ActionKey, TokenStake, VestingInfo } from '@dao-dao/types' @@ -45,6 +46,7 @@ export type VestingStakingModalProps = Pick< export const VestingStakingModal = ({ vestingInfo: { + chainId, vestingContractAddress, stakable, vest: { recipient }, @@ -54,8 +56,8 @@ export const VestingStakingModal = ({ ...props }: VestingStakingModalProps) => { const { t } = useTranslation() - const { chain_id: chainId } = useChain() const { goToDaoProposal } = useDaoNavHelpers() + const queryClient = useQueryClient() const validatorsLoadable = useCachedLoadable( validatorsSelector({ @@ -69,22 +71,14 @@ export const VestingStakingModal = ({ }) ) - // Refreshes validator balances. - const setRefreshValidatorBalances = useSetRecoilState( - refreshWalletBalancesIdAtom('') - ) - const setRefreshVesting = useSetRecoilState( - refreshVestingAtom(vestingContractAddress) - ) - const setRefreshStaking = useSetRecoilState( - refreshNativeTokenStakingInfoAtom(vestingContractAddress) - ) const awaitNextBlock = useAwaitNextBlock() const [amount, setAmount] = useState(0) const [loading, setLoading] = useState(false) - const { address: walletAddress = '' } = useWallet() + const { address: walletAddress = '' } = useWallet({ + chainId, + }) const delegate = useDelegate({ contractAddress: vestingContractAddress, sender: walletAddress, @@ -237,9 +231,40 @@ export const VestingStakingModal = ({ if (!recipientIsDao) { // Wait a block for balances to update. await awaitNextBlock() - setRefreshValidatorBalances((id) => id + 1) - setRefreshVesting((id) => id + 1) - setRefreshStaking((id) => id + 1) + + // Invalidate validators. + queryClient.invalidateQueries({ + queryKey: ['chain', 'validator', { chainId }], + }) + // Invalidate staking info. + queryClient.invalidateQueries({ + queryKey: chainQueries.nativeDelegationInfo(queryClient, { + chainId, + address: vestingContractAddress, + }).queryKey, + }) + // Invalidate vesting indexer queries. + queryClient.invalidateQueries({ + queryKey: [ + 'indexer', + 'query', + { + chainId, + address: vestingContractAddress, + }, + ], + }) + // Then invalidate contract queries that depend on indexer queries. + queryClient.invalidateQueries({ + queryKey: cwVestingQueryKeys.address(chainId, vestingContractAddress), + }) + // Then info query. + queryClient.invalidateQueries({ + queryKey: cwVestingExtraQueries.info(queryClient, { + chainId, + address: vestingContractAddress, + }).queryKey, + }) toast.success( mode === StakingMode.Stake diff --git a/packages/stateful/components/vesting/index.ts b/packages/stateful/components/vesting/index.ts index 0432f6ffd..a9a4d5cb7 100644 --- a/packages/stateful/components/vesting/index.ts +++ b/packages/stateful/components/vesting/index.ts @@ -1,2 +1,3 @@ export * from './VestingStakingModal' export * from './VestingPaymentCard' +export * from './VestingPaymentLine' diff --git a/packages/stateful/components/wallet/WalletStakingModal.tsx b/packages/stateful/components/wallet/WalletStakingModal.tsx index 613d9bb1a..006a06fd3 100644 --- a/packages/stateful/components/wallet/WalletStakingModal.tsx +++ b/packages/stateful/components/wallet/WalletStakingModal.tsx @@ -1,13 +1,12 @@ import { coin } from '@cosmjs/stargate' +import { useQueryClient } from '@tanstack/react-query' import { useState } from 'react' import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' -import { useSetRecoilState } from 'recoil' +import { chainQueries } from '@dao-dao/state/query' import { - nativeDelegationInfoSelector, nativeUnstakingDurationSecondsSelector, - refreshWalletBalancesIdAtom, validatorsSelector, } from '@dao-dao/state/recoil' import { @@ -25,7 +24,12 @@ import { processError, } from '@dao-dao/utils' -import { useAwaitNextBlock, useWallet, useWalletBalances } from '../../hooks' +import { + useAwaitNextBlock, + useQueryLoadingData, + useQueryLoadingDataWithError, + useWallet, +} from '../../hooks' export type WalletStakingModalProps = Pick< StakingModalProps, @@ -39,16 +43,29 @@ export const WalletStakingModal = (props: WalletStakingModalProps) => { chain: { chain_id: chainId }, nativeToken, } = useChainContext() - const { address: walletAddress = '', getSigningStargateClient } = useWallet() + const { + address: walletAddress = '', + getSigningStargateClient, + refreshBalances, + } = useWallet() if (!nativeToken) { throw new Error(t('error.missingNativeToken')) } - const { walletBalance, refreshBalances } = useWalletBalances() - // Refreshes validator balances. - const setRefreshValidatorBalances = useSetRecoilState( - refreshWalletBalancesIdAtom('') + // Fetch wallet balance. + const loadingStakableTokens = useQueryLoadingData( + walletAddress + ? chainQueries.nativeBalance({ + chainId, + address: walletAddress, + }) + : undefined, + 0, + { + transform: ({ amount }) => + convertMicroDenomToDenomWithDecimals(amount, nativeToken.decimals), + } ) const awaitNextBlock = useAwaitNextBlock() @@ -67,29 +84,28 @@ export const WalletStakingModal = (props: WalletStakingModalProps) => { }) ) - const nativeDelegationInfo = useCachedLoadable( - nativeDelegationInfoSelector({ + const queryClient = useQueryClient() + const loadingStakes = useQueryLoadingDataWithError( + chainQueries.nativeDelegationInfo(queryClient, { address: walletAddress, chainId, - }) + }), + ({ delegations }) => + delegations.map(({ validator, delegated, pendingReward }) => ({ + token: nativeToken, + validator, + amount: convertMicroDenomToDenomWithDecimals( + delegated.amount, + nativeToken.decimals + ), + rewards: convertMicroDenomToDenomWithDecimals( + pendingReward.amount, + nativeToken.decimals + ), + })) ) const stakes = - nativeDelegationInfo.state === 'hasValue' && nativeDelegationInfo.contents - ? nativeDelegationInfo.contents.delegations.map( - ({ validator, delegated, pendingReward }) => ({ - token: nativeToken, - validator, - amount: convertMicroDenomToDenomWithDecimals( - delegated.amount, - nativeToken.decimals - ), - rewards: convertMicroDenomToDenomWithDecimals( - pendingReward.amount, - nativeToken.decimals - ), - }) - ) - : [] + !loadingStakes.loading && !loadingStakes.errored ? loadingStakes.data : [] const onAction = async ( mode: StakingMode, @@ -157,7 +173,6 @@ export const WalletStakingModal = (props: WalletStakingModalProps) => { // Wait a block for balances to update. await awaitNextBlock() - setRefreshValidatorBalances((id) => id + 1) refreshBalances() toast.success( @@ -181,14 +196,7 @@ export const WalletStakingModal = (props: WalletStakingModalProps) => { } initialMode={StakingMode.Stake} loading={loading} - loadingStakableTokens={ - walletBalance === undefined - ? { loading: true } - : { - loading: false, - data: walletBalance, - } - } + loadingStakableTokens={loadingStakableTokens} onAction={onAction} setAmount={setAmount} token={nativeToken} diff --git a/packages/stateful/components/wallet/WalletTokenCard.tsx b/packages/stateful/components/wallet/WalletTokenCard.tsx index 0ad7dd5e9..1a1df9234 100644 --- a/packages/stateful/components/wallet/WalletTokenCard.tsx +++ b/packages/stateful/components/wallet/WalletTokenCard.tsx @@ -7,15 +7,17 @@ import { Visibility, VisibilityOff, } from '@mui/icons-material' +import { useQueryClient } from '@tanstack/react-query' import { useCallback, useState } from 'react' import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' import { useSetRecoilState } from 'recoil' import { + chainQueries, hiddenBalancesSelector, refreshHiddenBalancesAtom, - refreshNativeTokenStakingInfoAtom, + refreshTokenCardLazyInfoAtom, temporaryHiddenBalancesAtom, tokenCardLazyInfoSelector, } from '@dao-dao/state' @@ -47,7 +49,6 @@ import { useCfWorkerAuthPostRequest, useProfile, useWallet, - useWalletBalances, } from '../../hooks' import { ButtonLink } from '../ButtonLink' import { EntityDisplay } from '../EntityDisplay' @@ -62,10 +63,7 @@ export const WalletTokenCard = (props: TokenCardInfo) => { ? undefined : chains.data.find((c) => c.chainId === props.token.chainId) - const { chainWallet } = useWallet({ - chainId: props.token.chainId, - }) - const { refreshBalances } = useWalletBalances({ + const { chainWallet, refreshBalances } = useWallet({ chainId: props.token.chainId, }) @@ -83,13 +81,33 @@ export const WalletTokenCard = (props: TokenCardInfo) => { ) // Refresh staking info. - const setRefreshNativeTokenStakingInfo = useSetRecoilState( - refreshNativeTokenStakingInfoAtom(profileChain?.address) - ) - const refreshNativeTokenStakingInfo = useCallback( - () => setRefreshNativeTokenStakingInfo((id) => id + 1), - [setRefreshNativeTokenStakingInfo] + const setRefreshTokenCardLazyInfo = useSetRecoilState( + refreshTokenCardLazyInfoAtom({ + token: props.token.source, + owner: props.owner.address, + }) ) + const queryClient = useQueryClient() + const refreshNativeTokenStakingInfo = useCallback(() => { + // Invalidate validators. + queryClient.invalidateQueries({ + queryKey: ['chain', 'validator', { chainId: props.token.chainId }], + }) + // Then native delegation info. + queryClient.invalidateQueries({ + queryKey: chainQueries.nativeDelegationInfo(queryClient, { + chainId: props.token.chainId, + address: props.owner.address, + }).queryKey, + }) + // Then token card lazy info. + setRefreshTokenCardLazyInfo((id) => id + 1) + }, [ + props.owner.address, + props.token.chainId, + queryClient, + setRefreshTokenCardLazyInfo, + ]) const { ready: hiddenBalancesReady, postRequest: postHiddenBalancesRequest } = useCfWorkerAuthPostRequest( diff --git a/packages/stateful/hooks/index.ts b/packages/stateful/hooks/index.ts index 8d3129a5e..16a56fae9 100644 --- a/packages/stateful/hooks/index.ts +++ b/packages/stateful/hooks/index.ts @@ -35,5 +35,4 @@ export * from './useSyncWalletSigner' export * from './useTokenSwapStatusInfoForContract' export * from './useUpdateNavigatingHref' export * from './useWallet' -export * from './useWalletBalances' export * from './useWebSocket' diff --git a/packages/stateful/hooks/query/useQueryLoadingData.ts b/packages/stateful/hooks/query/useQueryLoadingData.ts index 7102df703..68d0032e5 100644 --- a/packages/stateful/hooks/query/useQueryLoadingData.ts +++ b/packages/stateful/hooks/query/useQueryLoadingData.ts @@ -1,4 +1,4 @@ -import { useQuery } from '@tanstack/react-query' +import { skipToken, useQuery } from '@tanstack/react-query' import { useMemo } from 'react' import { useDeepCompareMemoize } from 'use-deep-compare-effect' @@ -16,10 +16,12 @@ export const useQueryLoadingData = < /** * Query options to passthrough to useQuery. */ - options: Omit< - Parameters>[0], - 'select' - >, + options: + | Omit< + Parameters>[0], + 'select' + > + | undefined, /** * Default value in case of an error. */ @@ -35,7 +37,13 @@ export const useQueryLoadingData = < transform?: (data: TQueryFnData) => TTransformedData } ): LoadingData => { - const { isPending, isError, isRefetching, data, error } = useQuery(options) + const { isPending, isError, isRefetching, data, error } = useQuery( + // Loading state if options undefined. + options || { + queryKey: [] as any, + queryFn: skipToken, + } + ) const onErrorRef = useUpdatingRef(extra?.onError) const transformRef = useUpdatingRef(extra?.transform) diff --git a/packages/stateful/hooks/useWallet.ts b/packages/stateful/hooks/useWallet.ts index 8fad99b76..2a0cf2c24 100644 --- a/packages/stateful/hooks/useWallet.ts +++ b/packages/stateful/hooks/useWallet.ts @@ -5,10 +5,11 @@ import { useChain, useManager } from '@cosmos-kit/react-lite' import { SecretUtils } from '@keplr-wallet/types' import { useQueryClient } from '@tanstack/react-query' import { useCallback, useEffect, useMemo, useRef, useState } from 'react' -import { useRecoilValue } from 'recoil' +import { useRecoilValue, useSetRecoilState } from 'recoil' import { chainQueries } from '@dao-dao/state/query' import { + refreshWalletBalancesIdAtom, walletChainIdAtom, walletHexPublicKeySelector, } from '@dao-dao/state/recoil' @@ -60,9 +61,13 @@ export type UseWalletReturn = Omit & { */ getSigningClient: () => Promise /** - * Fetch SecretUtils from the wallet if available + * Fetch SecretUtils from the wallet if available. */ getSecretUtils: () => SecretUtils + /** + * Refresh wallet balances. + */ + refreshBalances: () => void } export const useWallet = ({ @@ -202,6 +207,49 @@ export const useWallet = ({ }) }, [queryClient, chain.chain_id]) + const setRefreshWalletBalancesId = useSetRecoilState( + refreshWalletBalancesIdAtom(walletChainRef.current.address ?? '') + ) + const refreshBalances = useCallback(() => { + const address = walletChainRef.current.address + + // Refresh Recoil balance selectors. + setRefreshWalletBalancesId((id) => id + 1) + + // Invalidate native and staked balances. + queryClient.invalidateQueries({ + queryKey: [ + 'chain', + 'nativeBalance', + { + chainId, + ...(address && { address }), + }, + ], + }) + queryClient.invalidateQueries({ + queryKey: [ + 'chain', + 'nativeStakedBalance', + { + chainId, + ...(address && { address }), + }, + ], + }) + // Invalidate validators. + queryClient.invalidateQueries({ + queryKey: ['chain', 'validator', { chainId }], + }) + // Then native delegation info. + queryClient.invalidateQueries({ + queryKey: chainQueries.nativeDelegationInfo(queryClient, { + chainId, + ...(address && { address }), + } as any).queryKey, + }) + }, [chainId, queryClient, setRefreshWalletBalancesId, walletChainRef]) + const response = useMemo( (): UseWalletReturn => { // TODO(secret): support different enigma utils sources based on connected @@ -264,6 +312,7 @@ export const useWallet = ({ getSecretSigningCosmWasmClient, getSigningClient, getSecretUtils, + refreshBalances, } }, // eslint-disable-next-line react-hooks/exhaustive-deps @@ -277,6 +326,7 @@ export const useWallet = ({ walletChainRef.current?.status, hexPublicKeyFromChain, queryClient, + refreshBalances, ] ) diff --git a/packages/stateful/hooks/useWalletBalances.ts b/packages/stateful/hooks/useWalletBalances.ts deleted file mode 100644 index e907d03a6..000000000 --- a/packages/stateful/hooks/useWalletBalances.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { useQueryClient } from '@tanstack/react-query' -import { useCallback } from 'react' -import { useSetRecoilState } from 'recoil' - -import { - nativeBalanceSelector, - refreshNativeTokenStakingInfoAtom, - refreshWalletBalancesIdAtom, -} from '@dao-dao/state' -import { useCachedLoadable } from '@dao-dao/stateless' -import { - convertMicroDenomToDenomWithDecimals, - getNativeTokenForChainId, -} from '@dao-dao/utils' - -import { useWallet } from './useWallet' - -export type UseWalletInfoOptions = { - chainId?: string -} - -export type UseWalletInfoReturn = { - isWalletConnected: boolean - walletBalance: number | undefined - refreshBalances: () => void -} - -export const useWalletBalances = ({ - chainId, -}: UseWalletInfoOptions = {}): UseWalletInfoReturn => { - const { - chain: walletChain, - address, - isWalletConnected, - } = useWallet({ - chainId, - }) - chainId ||= walletChain.chain_id - - const nativeToken = getNativeTokenForChainId(chainId) - - // Fetch wallet balance. - const { - state: walletNativeBalanceState, - contents: walletNativeBalanceContents, - } = useCachedLoadable( - address - ? nativeBalanceSelector({ - address, - chainId, - }) - : undefined - ) - const walletBalance = - walletNativeBalanceState === 'hasValue' && - walletNativeBalanceContents && - nativeToken - ? convertMicroDenomToDenomWithDecimals( - walletNativeBalanceContents.amount, - nativeToken.decimals - ) - : undefined - - const setRefreshWalletBalancesId = useSetRecoilState( - refreshWalletBalancesIdAtom(address ?? '') - ) - const setRefreshStakingId = useSetRecoilState( - refreshNativeTokenStakingInfoAtom(address ?? '') - ) - const queryClient = useQueryClient() - const refreshBalances = useCallback(() => { - setRefreshWalletBalancesId((id) => id + 1) - setRefreshStakingId((id) => id + 1) - queryClient.invalidateQueries({ - queryKey: [ - 'chain', - 'nativeStakedBalance', - { - chainId, - address: address ?? '', - }, - ], - }) - }, [ - address, - chainId, - queryClient, - setRefreshStakingId, - setRefreshWalletBalancesId, - ]) - - return { - isWalletConnected, - walletBalance, - refreshBalances, - } -} diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/hooks/makeUsePublishProposal.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/hooks/makeUsePublishProposal.ts index a0167eae0..818ccf033 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/hooks/makeUsePublishProposal.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/hooks/makeUsePublishProposal.ts @@ -2,17 +2,9 @@ import { coins } from '@cosmjs/stargate' import { useCallback, useEffect, useState } from 'react' import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' -import { - constSelector, - useRecoilValueLoadable, - useSetRecoilState, -} from 'recoil' +import { constSelector, useRecoilValueLoadable } from 'recoil' -import { - Cw20BaseSelectors, - nativeDenomBalanceSelector, - refreshWalletBalancesIdAtom, -} from '@dao-dao/state' +import { Cw20BaseSelectors, nativeDenomBalanceSelector } from '@dao-dao/state' import { useCachedLoadable } from '@dao-dao/stateless' import { MAX_NUM_PROPOSAL_CHOICES, @@ -51,6 +43,7 @@ export const makeUsePublishProposal = isWalletConnected, address: walletAddress, getSigningClient, + refreshBalances, } = useWallet() const { isMember = false } = useMembership() @@ -135,14 +128,6 @@ export const makeUsePublishProposal = Number(nativeDepositTokenBalance.amount) < requiredProposalDeposit))) - const setRefreshWalletBalancesId = useSetRecoilState( - refreshWalletBalancesIdAtom(walletAddress ?? '') - ) - const refreshBalances = useCallback( - () => setRefreshWalletBalancesId((id) => id + 1), - [setRefreshWalletBalancesId] - ) - const increaseCw20DepositAllowance = Cw20BaseHooks.useIncreaseAllowance({ contractAddress: depositInfoCw20TokenAddress ?? '', sender: walletAddress ?? '', diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/makeUsePublishProposal.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/makeUsePublishProposal.ts index a122d94ff..2f3d470f3 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/makeUsePublishProposal.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/hooks/makeUsePublishProposal.ts @@ -2,17 +2,9 @@ import { coins } from '@cosmjs/stargate' import { useCallback, useEffect, useState } from 'react' import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' -import { - constSelector, - useRecoilValueLoadable, - useSetRecoilState, -} from 'recoil' +import { constSelector, useRecoilValueLoadable } from 'recoil' -import { - Cw20BaseSelectors, - nativeDenomBalanceSelector, - refreshWalletBalancesIdAtom, -} from '@dao-dao/state' +import { Cw20BaseSelectors, nativeDenomBalanceSelector } from '@dao-dao/state' import { useCachedLoadable } from '@dao-dao/stateless' import { checkProposalSubmissionPolicy, @@ -50,6 +42,7 @@ export const makeUsePublishProposal = isWalletConnected, address: walletAddress, getSigningClient, + refreshBalances, } = useWallet() const { isMember = false } = useMembership() @@ -134,14 +127,6 @@ export const makeUsePublishProposal = Number(nativeDepositTokenBalance.amount) < requiredProposalDeposit))) - const setRefreshWalletBalancesId = useSetRecoilState( - refreshWalletBalancesIdAtom(walletAddress ?? '') - ) - const refreshBalances = useCallback( - () => setRefreshWalletBalancesId((id) => id + 1), - [setRefreshWalletBalancesId] - ) - const increaseCw20DepositAllowance = Cw20BaseHooks.useIncreaseAllowance({ contractAddress: depositInfoCw20TokenAddress ?? '', sender: walletAddress ?? '', diff --git a/packages/stateful/queries/entity.ts b/packages/stateful/queries/entity.ts index 4354a61af..b74ca7164 100644 --- a/packages/stateful/queries/entity.ts +++ b/packages/stateful/queries/entity.ts @@ -3,7 +3,7 @@ import { QueryClient, queryOptions, skipToken } from '@tanstack/react-query' import { chainQueries, contractQueries, - cw1WhitelistQueries, + cw1WhitelistExtraQueries, polytoneQueries, profileQueries, } from '@dao-dao/state/query' @@ -128,9 +128,9 @@ export const fetchEntityInfo = async ( // Attempt to load cw1-whitelist admins. queryClient .fetchQuery( - cw1WhitelistQueries.adminsIfCw1Whitelist(queryClient, { + cw1WhitelistExtraQueries.adminsIfCw1Whitelist(queryClient, { chainId, - contractAddress: address, + address, }) ) .then((admins): Promise | undefined => { diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/ProfileCardMemberInfo.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/ProfileCardMemberInfo.tsx index cd8fbf531..e2b90a8f6 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/ProfileCardMemberInfo.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/ProfileCardMemberInfo.tsx @@ -31,7 +31,6 @@ import { OraichainCw20StakingHooks, useAwaitNextBlock, useWallet, - useWalletBalances, } from '../../../../hooks' import { ProfileCardMemberInfoTokens } from '../../../components' import { useGovernanceTokenInfo, useStakingInfo } from '../hooks' @@ -44,8 +43,11 @@ export const ProfileCardMemberInfo = ({ const { t } = useTranslation() const { chain_id: chainId } = useChain() const { name: daoName } = useDaoInfoContext() - const { address: walletAddress, isWalletConnected } = useWallet() - const { refreshBalances } = useWalletBalances() + const { + address: walletAddress, + isWalletConnected, + refreshBalances, + } = useWallet() const [showStakingModal, setShowStakingModal] = useState(false) const [claimingLoading, setClaimingLoading] = useState(false) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/StakingModal.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/StakingModal.tsx index 9f1d9f3f4..f3fd63e06 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/StakingModal.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/StakingModal.tsx @@ -37,7 +37,6 @@ import { OraichainCw20StakingHooks, useAwaitNextBlock, useWallet, - useWalletBalances, } from '../../../../hooks' import { useVotingModuleAdapterOptions } from '../../../react/context' import { useGovernanceTokenInfo, useStakingInfo } from '../hooks' @@ -57,8 +56,11 @@ const InnerStakingModal = ({ maxDeposit, }: BaseStakingModalProps) => { const { t } = useTranslation() - const { address: walletAddress, isWalletConnected } = useWallet() - const { refreshBalances } = useWalletBalances() + const { + address: walletAddress, + isWalletConnected, + refreshBalances, + } = useWallet() const { chainId, coreAddress } = useVotingModuleAdapterOptions() const [stakingLoading, setStakingLoading] = useRecoilState(stakingLoadingAtom) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/ProfileCardMemberInfo.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/ProfileCardMemberInfo.tsx index bb063c0b4..d07003b2a 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/ProfileCardMemberInfo.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw721Staked/components/ProfileCardMemberInfo.tsx @@ -28,7 +28,6 @@ import { DaoVotingCw721StakedHooks, useAwaitNextBlock, useWallet, - useWalletBalances, } from '../../../../hooks' import { ProfileCardMemberInfoTokens } from '../../../components' import { useGovernanceCollectionInfo, useStakingInfo } from '../hooks' @@ -41,8 +40,11 @@ export const ProfileCardMemberInfo = ({ const { t } = useTranslation() const { chain_id: chainId } = useChain() const { name: daoName } = useDaoInfoContext() - const { address: walletAddress, isWalletConnected } = useWallet() - const { refreshBalances } = useWalletBalances() + const { + address: walletAddress, + isWalletConnected, + refreshBalances, + } = useWallet() const [showStakingModal, setShowStakingModal] = useState(false) const [claimingLoading, setClaimingLoading] = useState(false) const stakingLoading = useRecoilValue(stakingLoadingAtom) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/ProfileCardMemberInfo.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/ProfileCardMemberInfo.tsx index 0da757f3d..434234449 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/ProfileCardMemberInfo.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/ProfileCardMemberInfo.tsx @@ -25,7 +25,6 @@ import { DaoVotingNativeStakedHooks, useAwaitNextBlock, useWallet, - useWalletBalances, } from '../../../../hooks' import { ProfileCardMemberInfoTokens } from '../../../components' import { useVotingModuleAdapterOptions } from '../../../react/context' @@ -39,10 +38,11 @@ export const ProfileCardMemberInfo = ({ const { t } = useTranslation() const { name: daoName } = useDaoInfoContext() const { chainId, votingModuleAddress } = useVotingModuleAdapterOptions() - const { address: walletAddress, isWalletConnected } = useWallet({ - chainId, - }) - const { refreshBalances } = useWalletBalances({ + const { + address: walletAddress, + isWalletConnected, + refreshBalances, + } = useWallet({ chainId, }) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/StakingModal.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/StakingModal.tsx index c4493614d..96d7386a6 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/StakingModal.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/StakingModal.tsx @@ -27,7 +27,6 @@ import { DaoVotingNativeStakedHooks, useAwaitNextBlock, useWallet, - useWalletBalances, } from '../../../../hooks' import { useVotingModuleAdapterOptions } from '../../../react/context' import { useGovernanceTokenInfo, useStakingInfo } from '../hooks' @@ -47,8 +46,11 @@ const InnerStakingModal = ({ maxDeposit, }: BaseStakingModalProps) => { const { t } = useTranslation() - const { address: walletAddress, isWalletConnected } = useWallet() - const { refreshBalances } = useWalletBalances() + const { + address: walletAddress, + isWalletConnected, + refreshBalances, + } = useWallet() const { coreAddress, votingModuleAddress } = useVotingModuleAdapterOptions() const [stakingLoading, setStakingLoading] = useRecoilState(stakingLoadingAtom) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/ProfileCardMemberInfo.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/ProfileCardMemberInfo.tsx index 22341d9b6..b787ce088 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/ProfileCardMemberInfo.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/ProfileCardMemberInfo.tsx @@ -25,7 +25,6 @@ import { DaoVotingTokenStakedHooks, useAwaitNextBlock, useWallet, - useWalletBalances, } from '../../../../hooks' import { ProfileCardMemberInfoTokens } from '../../../components' import { useVotingModuleAdapterOptions } from '../../../react/context' @@ -39,10 +38,11 @@ export const ProfileCardMemberInfo = ({ const { t } = useTranslation() const { name: daoName } = useDaoInfoContext() const { chainId, votingModuleAddress } = useVotingModuleAdapterOptions() - const { address: walletAddress, isWalletConnected } = useWallet({ - chainId, - }) - const { refreshBalances } = useWalletBalances({ + const { + address: walletAddress, + isWalletConnected, + refreshBalances, + } = useWallet({ chainId, }) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/StakingModal.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/StakingModal.tsx index a994ebaba..d1bf20420 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/StakingModal.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/StakingModal.tsx @@ -27,7 +27,6 @@ import { DaoVotingTokenStakedHooks, useAwaitNextBlock, useWallet, - useWalletBalances, } from '../../../../hooks' import { useVotingModuleAdapterOptions } from '../../../react/context' import { useGovernanceTokenInfo, useStakingInfo } from '../hooks' @@ -47,8 +46,11 @@ const InnerStakingModal = ({ maxDeposit, }: BaseStakingModalProps) => { const { t } = useTranslation() - const { address: walletAddress, isWalletConnected } = useWallet() - const { refreshBalances } = useWalletBalances() + const { + address: walletAddress, + isWalletConnected, + refreshBalances, + } = useWallet() const { coreAddress, votingModuleAddress } = useVotingModuleAdapterOptions() const [stakingLoading, setStakingLoading] = useRecoilState(stakingLoadingAtom) diff --git a/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/StakingModal.tsx b/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/StakingModal.tsx index d4f3beb0d..9be67c379 100644 --- a/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/StakingModal.tsx +++ b/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/StakingModal.tsx @@ -32,7 +32,6 @@ import { NeutronVaultHooks, useAwaitNextBlock, useWallet, - useWalletBalances, } from '../../../../hooks' import { useVotingModuleAdapterOptions } from '../../../react/context' import { useVotingModule } from '../hooks' @@ -51,8 +50,7 @@ const InnerStakingModal = ({ initialMode = StakingMode.Stake, }: BaseStakingModalProps) => { const { t } = useTranslation() - const { address = '', isWalletConnected } = useWallet() - const { refreshBalances } = useWalletBalances() + const { address = '', isWalletConnected, refreshBalances } = useWallet() const { coreAddress, chainId } = useVotingModuleAdapterOptions() const { loadingVaults } = useVotingModule() diff --git a/packages/stateful/widgets/widgets/VestingPayments/Renderer/TabRenderer/TabRenderer.tsx b/packages/stateful/widgets/widgets/VestingPayments/Renderer/TabRenderer/TabRenderer.tsx index 7445d2bb4..17dbf6f4b 100644 --- a/packages/stateful/widgets/widgets/VestingPayments/Renderer/TabRenderer/TabRenderer.tsx +++ b/packages/stateful/widgets/widgets/VestingPayments/Renderer/TabRenderer/TabRenderer.tsx @@ -11,14 +11,14 @@ import { Modal, NoContent, Tooltip, - VestingPaymentLine, useDaoInfoContext, useDaoNavHelpers, } from '@dao-dao/stateless' import { ButtonLinkProps, LoadingDataWithError, - StatefulEntityDisplayProps, + StatefulVestingPaymentCardProps, + StatefulVestingPaymentLineProps, TransProps, VestingInfo, WidgetId, @@ -32,8 +32,8 @@ export interface TabRendererProps { createVestingPaymentHref: string | undefined registerSlashesHref: string | undefined ButtonLink: ComponentType - VestingPaymentCard: ComponentType - EntityDisplay: ComponentType + VestingPaymentCard: ComponentType + VestingPaymentLine: ComponentType Trans: ComponentType } @@ -44,7 +44,7 @@ export const TabRenderer = ({ registerSlashesHref, ButtonLink, VestingPaymentCard, - EntityDisplay, + VestingPaymentLine, Trans, }: TabRendererProps) => { const { t } = useTranslation() @@ -229,16 +229,20 @@ export const TabRenderer = ({

{vestingPaymentsNeedingSlashRegistration.map( - (props, index) => ( + (vestingInfo, index) => ( { setVestingPaymentModalOpen(true) - setOpenVestingContract(props.vestingContractAddress) + setOpenVestingContract( + vestingInfo.vestingContractAddress + ) }} transparentBackground={index % 2 !== 0} - {...props} + vestingInfo={vestingInfo} /> ) )} @@ -250,16 +254,17 @@ export const TabRenderer = ({
- {activeVestingPayments.map((props, index) => ( + {activeVestingPayments.map((vestingInfo, index) => ( { setVestingPaymentModalOpen(true) - setOpenVestingContract(props.vestingContractAddress) + setOpenVestingContract(vestingInfo.vestingContractAddress) }} transparentBackground={index % 2 !== 0} - {...props} + vestingInfo={vestingInfo} /> ))}
@@ -296,16 +301,20 @@ export const TabRenderer = ({

{t('title.totalVested')}

- {completedVestingPayments.map((props, index) => ( + {completedVestingPayments.map((vestingInfo, index) => ( { setVestingPaymentModalOpen(true) - setOpenVestingContract(props.vestingContractAddress) + setOpenVestingContract( + vestingInfo.vestingContractAddress + ) }} transparentBackground={index % 2 !== 0} - {...props} + vestingInfo={vestingInfo} /> ))}
@@ -333,7 +342,7 @@ export const TabRenderer = ({ > {openVestingPayment ? ( - + ) : ( diff --git a/packages/stateful/widgets/widgets/VestingPayments/Renderer/TabRenderer/index.tsx b/packages/stateful/widgets/widgets/VestingPayments/Renderer/TabRenderer/index.tsx index b98c0e9a5..4367988be 100644 --- a/packages/stateful/widgets/widgets/VestingPayments/Renderer/TabRenderer/index.tsx +++ b/packages/stateful/widgets/widgets/VestingPayments/Renderer/TabRenderer/index.tsx @@ -1,28 +1,26 @@ -import { useEffect } from 'react' -import { useSetRecoilState, waitForAll } from 'recoil' +import { useQueries, useQueryClient } from '@tanstack/react-query' import { - refreshVestingAtom, - vestingInfosForFactorySelector, -} from '@dao-dao/state/recoil' -import { - useCachedLoadingWithError, - useDaoInfoContext, - useDaoNavHelpers, -} from '@dao-dao/stateless' + cwPayrollFactoryExtraQueries, + cwVestingExtraQueries, +} from '@dao-dao/state/query' +import { useDaoInfoContext, useDaoNavHelpers } from '@dao-dao/stateless' import { ActionKey, VestingPaymentsWidgetData, WidgetRendererProps, } from '@dao-dao/types' -import { getDaoProposalSinglePrefill } from '@dao-dao/utils' +import { + getDaoProposalSinglePrefill, + makeCombineQueryResultsIntoLoadingDataWithError, +} from '@dao-dao/utils' import { useActionForKey } from '../../../../../actions' import { ButtonLink, - EntityDisplay, Trans, VestingPaymentCard, + VestingPaymentLine, } from '../../../../../components' import { useMembership } from '../../../../../hooks/useMembership' import { TabRenderer as StatelessTabRenderer } from './TabRenderer' @@ -34,15 +32,9 @@ export const TabRenderer = ({ const { getDaoProposalPath } = useDaoNavHelpers() const { isMember = false } = useMembership() - const setRefresh = useSetRecoilState(refreshVestingAtom('')) - // Refresh vesting data every 30 seconds. - useEffect(() => { - const interval = setInterval(() => setRefresh((id) => id + 1), 30000) - return () => clearInterval(interval) - }, [setRefresh]) - - const vestingPaymentsLoading = useCachedLoadingWithError( - waitForAll([ + const queryClient = useQueryClient() + const vestingContractsLoading = useQueries({ + queries: [ // Factory or factory list depending on version. ...(factories ? Object.entries(factories).map(([chainId, { address }]) => ({ @@ -59,41 +51,59 @@ export const TabRenderer = ({ : // Should never happen. [] ).map(({ chainId, address }) => - vestingInfosForFactorySelector({ + cwPayrollFactoryExtraQueries.listAllVestingContracts(queryClient, { chainId, - factory: address, + address, }) ), // Old factories. ...(oldFactories || []).map(({ address }) => - vestingInfosForFactorySelector({ + cwPayrollFactoryExtraQueries.listAllVestingContracts(queryClient, { chainId: defaultChainId, - factory: address, + address, }) ), - ]), - // Combine all vesting infos into one list across chains. - (data) => data.flat() - ) + ], + combine: makeCombineQueryResultsIntoLoadingDataWithError({ + firstLoad: 'one', + }), + }) + // Fetch infos individually so they refresh when data is updated elsewhere. + const vestingInfosLoading = useQueries({ + queries: + vestingContractsLoading.loading || vestingContractsLoading.errored + ? [] + : vestingContractsLoading.data.flatMap(({ chainId, contracts }) => + contracts.map(({ contract }) => + cwVestingExtraQueries.info(queryClient, { + chainId, + address: contract, + }) + ) + ), + combine: makeCombineQueryResultsIntoLoadingDataWithError({ + firstLoad: 'one', + }), + }) const vestingAction = useActionForKey(ActionKey.ManageVesting) const vestingActionDefaults = vestingAction?.useDefaults() // Vesting payments that need a slash registered. const vestingPaymentsNeedingSlashRegistration = - vestingPaymentsLoading.loading || vestingPaymentsLoading.errored + vestingInfosLoading.loading || vestingInfosLoading.errored ? [] - : vestingPaymentsLoading.data.filter( + : vestingInfosLoading.data.filter( ({ hasUnregisteredSlashes }) => hasUnregisteredSlashes ) return ( ) } diff --git a/packages/stateless/components/token/TokenAmountDisplay.tsx b/packages/stateless/components/token/TokenAmountDisplay.tsx index 40338592a..2e905e1a0 100644 --- a/packages/stateless/components/token/TokenAmountDisplay.tsx +++ b/packages/stateless/components/token/TokenAmountDisplay.tsx @@ -51,6 +51,7 @@ export const TokenAmountDisplay = ({ hideSymbol, estimatedUsdValue, onClick, + wrapperClassName, ...props }: TokenAmountDisplayProps) => { const { t } = useTranslation() @@ -195,7 +196,8 @@ export const TokenAmountDisplay = ({ className={clsx( 'flex min-w-0 flex-row items-center gap-2', onClick && - 'cursor-pointer transition-opacity hover:opacity-80 active:opacity-70' + 'cursor-pointer transition-opacity hover:opacity-80 active:opacity-70', + wrapperClassName )} onClick={onClick} > diff --git a/packages/stateless/components/vesting/VestingPaymentLine.tsx b/packages/stateless/components/vesting/VestingPaymentLine.tsx index c058ef1bf..df45359af 100644 --- a/packages/stateless/components/vesting/VestingPaymentLine.tsx +++ b/packages/stateless/components/vesting/VestingPaymentLine.tsx @@ -1,5 +1,4 @@ import clsx from 'clsx' -import { ComponentType } from 'react' import { useTranslation } from 'react-i18next' import TimeAgo from 'react-timeago' @@ -9,24 +8,18 @@ import { Tooltip, useTranslatedTimeDeltaFormatter, } from '@dao-dao/stateless' -import { StatefulEntityDisplayProps, VestingInfo } from '@dao-dao/types' +import { VestingPaymentLineProps } from '@dao-dao/types' import { convertMicroDenomToDenomWithDecimals, formatDate, formatDateTimeTz, } from '@dao-dao/utils' -export type VestingPaymentLineProps = VestingInfo & { - EntityDisplay: ComponentType - onClick: () => void - transparentBackground?: boolean -} - export const VestingPaymentLine = ({ - EntityDisplay, + vestingInfo, onClick, transparentBackground, - ...vestingInfo + EntityDisplay, }: VestingPaymentLineProps) => { const { t } = useTranslation() const startTimeAgoFormatter = useTranslatedTimeDeltaFormatter({ @@ -96,6 +89,7 @@ export const VestingPaymentLine = ({ className="body-text truncate text-right font-mono" decimals={token.decimals} symbol={token.symbol} + wrapperClassName="justify-end" /> ) : ( diff --git a/packages/types/components/TokenAmountDisplay.ts b/packages/types/components/TokenAmountDisplay.ts index eb580f2bb..7f01c5610 100644 --- a/packages/types/components/TokenAmountDisplay.ts +++ b/packages/types/components/TokenAmountDisplay.ts @@ -42,6 +42,10 @@ export type TokenAmountDisplayProps = Omit< * Optionally specify a callback when clicked and make the pointer a cursor. */ onClick?: () => void + /** + * Optionally apply a class name to the div wrapper. + */ + wrapperClassName?: string } & ( // If not USD estimate, require symbol and decimals. | { symbol: string diff --git a/packages/types/components/VestingPaymentCard.ts b/packages/types/components/VestingPaymentCard.ts new file mode 100644 index 000000000..e3de08765 --- /dev/null +++ b/packages/types/components/VestingPaymentCard.ts @@ -0,0 +1,5 @@ +import { VestingInfo } from '../vesting' + +export type StatefulVestingPaymentCardProps = { + vestingInfo: VestingInfo +} diff --git a/packages/types/components/VestingPaymentLine.ts b/packages/types/components/VestingPaymentLine.ts new file mode 100644 index 000000000..6a75d43a9 --- /dev/null +++ b/packages/types/components/VestingPaymentLine.ts @@ -0,0 +1,16 @@ +import { ComponentType } from 'react' + +import { VestingInfo } from '../vesting' +import { StatefulEntityDisplayProps } from './EntityDisplay' + +export type VestingPaymentLineProps = { + vestingInfo: VestingInfo + onClick: () => void + transparentBackground?: boolean + EntityDisplay: ComponentType +} + +export type StatefulVestingPaymentLineProps = Omit< + VestingPaymentLineProps, + 'EntityDisplay' +> diff --git a/packages/types/components/index.ts b/packages/types/components/index.ts index db7870eec..80cda224c 100644 --- a/packages/types/components/index.ts +++ b/packages/types/components/index.ts @@ -62,5 +62,7 @@ export * from './Trans' export * from './TreasuryHistoryGraph' export * from './ValenceAccountDisplay' export * from './ValidatorPicker' +export * from './VestingPaymentCard' +export * from './VestingPaymentLine' export * from './WalletDaos' export * from './WalletProfileHeader' diff --git a/packages/types/contracts/CwPayrollFactory.ts b/packages/types/contracts/CwPayrollFactory.ts index 630a55b07..5537f48a8 100644 --- a/packages/types/contracts/CwPayrollFactory.ts +++ b/packages/types/contracts/CwPayrollFactory.ts @@ -1,7 +1,12 @@ -import { Binary, Expiration, Uint128 } from './common' +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + import { InstantiateMsg as VestingInstantiateMsg } from './CwVesting' -export type InstantiateMsg = { +export interface InstantiateMsg { owner?: string | null vesting_code_id: number } @@ -24,7 +29,23 @@ export type ExecuteMsg = | { update_ownership: Action } -type Action = +export type Uint128 = string +export type Binary = string +export type UncheckedDenom = + | { + native: string + } + | { + cw20: string + } +export type Schedule = + | 'saturating_linear' + | { + piecewise_linear: [number, Uint128][] + } +export type Timestamp = Uint64 +export type Uint64 = string +export type Action = | { transfer_ownership: { expiry?: Expiration | null @@ -33,7 +54,17 @@ type Action = } | 'accept_ownership' | 'renounce_ownership' -interface Cw20ReceiveMsg { +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } +export interface Cw20ReceiveMsg { amount: Uint128 msg: Binary sender: string @@ -86,8 +117,14 @@ export type QueryMsg = code_id: {} } export type ArrayOfVestingContract = VestingContract[] -interface VestingContract { +export interface VestingContract { contract: string instantiator: string recipient: string } +export type Addr = string +export interface OwnershipForAddr { + owner?: Addr | null + pending_expiry?: Expiration | null + pending_owner?: Addr | null +} diff --git a/packages/types/contracts/CwVesting.ts b/packages/types/contracts/CwVesting.ts index 25923bbd5..a36a4bce6 100644 --- a/packages/types/contracts/CwVesting.ts +++ b/packages/types/contracts/CwVesting.ts @@ -1,4 +1,8 @@ -import { Addr, Binary, Expiration, Timestamp, Uint128 } from './common' +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ export type UncheckedDenom = | { @@ -12,6 +16,9 @@ export type Schedule = | { piecewise_linear: [number, Uint128][] } +export type Uint128 = string +export type Timestamp = Uint64 +export type Uint64 = string export interface InstantiateMsg { denom: UncheckedDenom description?: string | null @@ -81,6 +88,7 @@ export type ExecuteMsg = | { update_ownership: Action } +export type Binary = string export type Action = | { transfer_ownership: { @@ -90,6 +98,16 @@ export type Action = } | 'accept_ownership' | 'renounce_ownership' +export type Expiration = + | { + at_height: number + } + | { + at_time: Timestamp + } + | { + never: {} + } export interface Cw20ReceiveMsg { amount: Uint128 msg: Binary @@ -104,7 +122,7 @@ export type QueryMsg = } | { distributable: { - t?: number | null + t?: Timestamp | null } } | { @@ -145,6 +163,7 @@ export type CheckedDenom = | { cw20: Addr } +export type Addr = string export type Status = | ('unfunded' | 'funded') | { @@ -189,3 +208,4 @@ export interface OwnershipForAddr { pending_expiry?: Expiration | null pending_owner?: Addr | null } +export type NullableUint64 = Uint64 | null diff --git a/packages/types/vesting.ts b/packages/types/vesting.ts index 025e2ea4b..23a66ebf1 100644 --- a/packages/types/vesting.ts +++ b/packages/types/vesting.ts @@ -108,6 +108,7 @@ export type VestingInfo = { } )) | undefined + | null // Amount vested so far. vested: string // Amount available to distribute. diff --git a/packages/utils/constants/other.ts b/packages/utils/constants/other.ts index 49087e4ac..e7e2d8d2c 100644 --- a/packages/utils/constants/other.ts +++ b/packages/utils/constants/other.ts @@ -161,6 +161,11 @@ export const DISTRIBUTION_COLORS_EVERY_OTHER = [ '#F4925A', // 9 ] +/** + * Error substrings that indicate a query does not exist. + */ +export const NONEXISTENT_QUERY_ERROR_SUBSTRINGS = ['unknown query path'] + /** * Error substrings that indicate a contract is invalid or does not exist. */ @@ -168,8 +173,8 @@ export const INVALID_CONTRACT_ERROR_SUBSTRINGS = [ 'Error parsing into type', 'no such contract', 'not found', - 'unknown query path', 'decoding bech32 failed', + ...NONEXISTENT_QUERY_ERROR_SUBSTRINGS, ] /** From b36d977842453f95b6a571d275784b1d65ab2e46 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 2 Aug 2024 18:49:25 -0400 Subject: [PATCH 396/438] fixed build --- packages/utils/proposal.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/utils/proposal.ts b/packages/utils/proposal.ts index cf85d39f5..3c65cbd0a 100644 --- a/packages/utils/proposal.ts +++ b/packages/utils/proposal.ts @@ -74,7 +74,7 @@ export const convertCosmosVetoConfigToVeto = ( veto: VetoConfig | null | undefined, // If provided, `veto.vetoer` should be a cw1-whitelist contract address, and // this should be its list of admins. - cw1WhitelistAdmins?: string[] + cw1WhitelistAdmins?: string[] | null ): ProposalVetoConfig => veto ? { From 34ada8bcb56a4fbfd55ac305acf2f086784d42df Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 2 Aug 2024 19:07:39 -0400 Subject: [PATCH 397/438] dont show vesting withdraw button if not for the current wallet --- .../components/vesting/VestingPaymentCard.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/stateless/components/vesting/VestingPaymentCard.tsx b/packages/stateless/components/vesting/VestingPaymentCard.tsx index 40ed81f58..ee0cd828e 100644 --- a/packages/stateless/components/vesting/VestingPaymentCard.tsx +++ b/packages/stateless/components/vesting/VestingPaymentCard.tsx @@ -143,13 +143,16 @@ export const VestingPaymentCard = ({ return () => clearTimeout(timeout) }, [copied]) - // Can only withdraw if there is a distributable amount and a wallet is - // connected. - const canWithdraw = isWalletConnected && distributableAmount > 0 - const recipientIsDao = !recipientEntity.loading && recipientEntity.data.type === EntityType.Dao + // Can only withdraw if there is a distributable amount and the recipient is + // the currently connected wallet or is a DAO. + const canWithdraw = + isWalletConnected && + (recipientIsWallet || recipientIsDao) && + distributableAmount > 0 + const buttonPopupSections: ButtonPopupSection[] = useMemo( () => [ // Only show payout actions if recipient is the currently connected From fd4b8510c28dd63e9f67f1513fe5a080e495de6f Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Mon, 5 Aug 2024 18:27:08 -0400 Subject: [PATCH 398/438] fixed accept SubDAO cross-chain support --- .../dao_governance/DaoAdminExec/index.tsx | 42 ++--- .../core/subdaos/AcceptSubDao/Component.tsx | 160 ++++++++++++++---- .../core/subdaos/AcceptSubDao/index.tsx | 71 ++++++-- .../stateful/actions/core/subdaos/index.ts | 28 ++- 4 files changed, 223 insertions(+), 78 deletions(-) diff --git a/packages/stateful/actions/core/dao_governance/DaoAdminExec/index.tsx b/packages/stateful/actions/core/dao_governance/DaoAdminExec/index.tsx index 0e70cfdcc..370fd1434 100644 --- a/packages/stateful/actions/core/dao_governance/DaoAdminExec/index.tsx +++ b/packages/stateful/actions/core/dao_governance/DaoAdminExec/index.tsx @@ -11,7 +11,6 @@ import { RadioInputNoForm, } from '@dao-dao/stateless' import { - ActionChainContextType, ActionComponent, ActionContextType, ActionKey, @@ -186,11 +185,13 @@ const Component: ActionComponent = (props) => { /> )} - + {context.type === ActionContextType.Dao && ( + + )} @@ -287,22 +288,13 @@ const useTransformToCosmos: UseTransformToCosmos = () => { export const makeDaoAdminExecAction: ActionMaker = ({ t, - context, - chainContext, -}) => - // Only allow using this action in DAOs or gov props on chains with CW. - context.type === ActionContextType.Dao || - (context.type === ActionContextType.Gov && - chainContext.type !== ActionChainContextType.Any && - !chainContext.config.noCosmWasm) - ? { - key: ActionKey.DaoAdminExec, - Icon: JoystickEmoji, - label: t('title.daoAdminExec'), - description: t('info.daoAdminExecDescription'), - Component, - useDefaults, - useTransformToCosmos, - useDecodedCosmosMsg, - } - : null +}) => ({ + key: ActionKey.DaoAdminExec, + Icon: JoystickEmoji, + label: t('title.daoAdminExec'), + description: t('info.daoAdminExecDescription'), + Component, + useDefaults, + useTransformToCosmos, + useDecodedCosmosMsg, +}) diff --git a/packages/stateful/actions/core/subdaos/AcceptSubDao/Component.tsx b/packages/stateful/actions/core/subdaos/AcceptSubDao/Component.tsx index f4cf538de..6f8ada92c 100644 --- a/packages/stateful/actions/core/subdaos/AcceptSubDao/Component.tsx +++ b/packages/stateful/actions/core/subdaos/AcceptSubDao/Component.tsx @@ -1,10 +1,15 @@ import { ComponentType, useEffect, useState } from 'react' import { useFormContext } from 'react-hook-form' import { useTranslation } from 'react-i18next' +import { v4 as uuidv4 } from 'uuid' import { InputErrorMessage, InputLabel, useChain } from '@dao-dao/stateless' import { AddressInputProps } from '@dao-dao/types' -import { ActionComponent, ActionKey } from '@dao-dao/types/actions' +import { + ActionComponent, + ActionKey, + ActionKeyAndData, +} from '@dao-dao/types/actions' import { getChainAddressForActionOptions, isValidBech32Address, @@ -57,6 +62,28 @@ export const AcceptSubDaoComponent: ActionComponent< return } + // Check if this is being used within a cross-chain execute action. If so, + // we need to add the manage subDAOs action to the parent action context, + // which is most likely a DAO. + const parentActionRootFieldNamePrefix = fieldNamePrefix.replace( + new RegExp(`data\\._actionData\\.${index}\\.data\\.$`), + '' + ) + const outerCrossChainExecuteIndex = + parentActionRootFieldNamePrefix.length < fieldNamePrefix.length && + getValues((parentActionRootFieldNamePrefix + 'actionKey') as any) === + ActionKey.CrossChainExecute + ? // trim dot at the end, and then the index is the last item. it probably looks like: `actionData.INDEX.` + Number(parentActionRootFieldNamePrefix.slice(0, -1).split('.').pop()) + : undefined + // remove outer cross-chain execute index from field name prefix to get list + // of all actions in the parent context + const parentActionDataListFieldName = + parentActionRootFieldNamePrefix.replace( + new RegExp(`.${outerCrossChainExecuteIndex}.$`), + '' + ) + const existingUpdateAdminIndex = allActionsWithData.findIndex( (a, i) => i > index && @@ -67,9 +94,20 @@ export const AcceptSubDaoComponent: ActionComponent< (a.data as DaoAdminExecData)._actionData![0].data.newAdmin === currentAddress ) - const existingManageSubDaosIndex = allActionsWithData.findIndex( - (a, i) => i > index && a.actionKey === ActionKey.ManageSubDaos - ) + const existingManageSubDaosIndex = + outerCrossChainExecuteIndex !== undefined + ? ( + getValues( + parentActionDataListFieldName as any + ) as ActionKeyAndData[] + ).findIndex( + (a, i) => + i > outerCrossChainExecuteIndex && + a.actionKey === ActionKey.ManageSubDaos + ) + : allActionsWithData.findIndex( + (a, i) => i > index && a.actionKey === ActionKey.ManageSubDaos + ) if (existingUpdateAdminIndex === -1) { addAction( @@ -97,46 +135,110 @@ export const AcceptSubDaoComponent: ActionComponent< // Prefix to the fields on the update admin sub-action of the DAO admin // exec action. const existingActionPrefix = fieldNamePrefix.replace( - new RegExp(`${index}\\.data.$`), - `${existingUpdateAdminIndex}.data._actionData.0.data.` + new RegExp(`${index}\\.data\\.$`), + `${existingUpdateAdminIndex}.data.` ) // If the fields aren't correct, update the existing one. if (getValues((existingActionPrefix + 'chainId') as any) !== chainId) { setValue((existingActionPrefix + 'chainId') as any, chainId) } - if (getValues((existingActionPrefix + 'contract') as any) !== address) { - setValue((existingActionPrefix + 'contract') as any, address) + if ( + getValues((existingActionPrefix + 'coreAddress') as any) !== address + ) { + setValue((existingActionPrefix + 'coreAddress') as any, address) + } + if ( + getValues( + (existingActionPrefix + '_actionData.0.data.chainId') as any + ) !== chainId + ) { + setValue( + (existingActionPrefix + '_actionData.0.data.chainId') as any, + chainId + ) + } + if ( + getValues( + (existingActionPrefix + '_actionData.0.data.contract') as any + ) !== address + ) { + setValue( + (existingActionPrefix + '_actionData.0.data.contract') as any, + address + ) } if ( - getValues((existingActionPrefix + 'newAdmin') as any) !== currentAddress + getValues( + (existingActionPrefix + '_actionData.0.data.newAdmin') as any + ) !== currentAddress ) { - setValue((existingActionPrefix + 'newAdmin') as any, currentAddress) + setValue( + (existingActionPrefix + '_actionData.0.data.newAdmin') as any, + currentAddress + ) } } if (existingManageSubDaosIndex === -1) { - addAction( - { - actionKey: ActionKey.ManageSubDaos, - data: { - toAdd: [ - { - addr: address, - }, - ], - toRemove: [], - } as ManageSubDaosData, - }, - // After DAO admin exec / update admin action. - index + 2 - ) + // If within cross-chain execute action, add Manage SubDAOs action after + // the cross-chain execute action in the parent context. + if (outerCrossChainExecuteIndex !== undefined) { + setValue( + parentActionDataListFieldName as any, + ( + getValues( + parentActionDataListFieldName as any + ) as ActionKeyAndData[] + ).flatMap((existing, index) => [ + existing, + // If this is the cross-chain execute action, insert manage subDAOs + // action after. + ...(index === outerCrossChainExecuteIndex + ? [ + { + _id: uuidv4(), + actionKey: ActionKey.ManageSubDaos, + data: { + toAdd: [ + { + addr: address, + }, + ], + toRemove: [], + } as ManageSubDaosData, + }, + ] + : []), + ]) + ) + } else { + addAction( + { + actionKey: ActionKey.ManageSubDaos, + data: { + toAdd: [ + { + addr: address, + }, + ], + toRemove: [], + } as ManageSubDaosData, + }, + // After DAO admin exec / update admin action. + index + 2 + ) + } } else { // Path to the address field on the manage subDAOs action. - const existingAddressFieldName = fieldNamePrefix.replace( - new RegExp(`${index}\\.data.$`), - `${existingManageSubDaosIndex}.data.toAdd.0.addr` - ) + const existingAddressFieldName = + outerCrossChainExecuteIndex !== undefined + ? parentActionDataListFieldName + + `.${existingManageSubDaosIndex}.data.toAdd.0.addr` + : fieldNamePrefix.replace( + new RegExp(`${index}\\.data\\.$`), + `${existingManageSubDaosIndex}.data.toAdd.0.addr` + ) // If the address isn't correct, update the existing one. if (getValues(existingAddressFieldName as any) !== address) { diff --git a/packages/stateful/actions/core/subdaos/AcceptSubDao/index.tsx b/packages/stateful/actions/core/subdaos/AcceptSubDao/index.tsx index d025d0d96..cebb0771c 100644 --- a/packages/stateful/actions/core/subdaos/AcceptSubDao/index.tsx +++ b/packages/stateful/actions/core/subdaos/AcceptSubDao/index.tsx @@ -8,6 +8,7 @@ import { } from '@dao-dao/stateless' import { ActionComponent, + ActionContextType, ActionKey, ActionMaker, UseDecodedCosmosMsg, @@ -23,6 +24,7 @@ import { import { AddressInput } from '../../../../components' import { useActionOptions } from '../../../react' +import { CrossChainExecuteData } from '../../advanced/CrossChainExecute/Component' import { AcceptSubDaoComponent, AcceptSubDaoData } from './Component' const useDefaults: UseDefaults = () => ({ @@ -79,8 +81,13 @@ const useTransformToCosmos: UseTransformToCosmos = () => { const Component: ActionComponent = (props) => { const { t } = useTranslation() + const { + context, + chain: { chain_id: nativeChainId }, + } = useActionOptions() const { watch } = useFormContext() const chainId = watch((props.fieldNamePrefix + 'chainId') as 'chainId') + const address = watch((props.fieldNamePrefix + 'address') as 'address') return ( <> @@ -88,11 +95,43 @@ const Component: ActionComponent = (props) => {

{t('info.acceptSubDaoActionDescription')}

)} - + {context.type === ActionContextType.Dao && ( + { + if (newChainId !== nativeChainId) { + props.remove() + props.addAction( + { + actionKey: ActionKey.CrossChainExecute, + data: { + chainId: newChainId, + _actionData: [ + { + actionKey: ActionKey.AcceptSubDao, + data: { + chainId: newChainId, + address, + } as AcceptSubDaoData, + }, + ], + } as CrossChainExecuteData, + }, + props.index + ) + } + } + : undefined + } + onlyDaoChainIds + /> + )} = (props) => { export const makeAcceptSubDaoAction: ActionMaker = ({ t, -}) => { - return { - key: ActionKey.AcceptSubDao, - Icon: CheckEmoji, - label: t('title.acceptSubDao'), - description: t('info.acceptSubDaoDescription'), - Component, - useDefaults, - useTransformToCosmos, - useDecodedCosmosMsg, - } -} +}) => ({ + key: ActionKey.AcceptSubDao, + Icon: CheckEmoji, + label: t('title.acceptSubDao'), + description: t('info.acceptSubDaoDescription'), + Component, + useDefaults, + useTransformToCosmos, + useDecodedCosmosMsg, +}) diff --git a/packages/stateful/actions/core/subdaos/index.ts b/packages/stateful/actions/core/subdaos/index.ts index 111d1af22..de1005122 100644 --- a/packages/stateful/actions/core/subdaos/index.ts +++ b/packages/stateful/actions/core/subdaos/index.ts @@ -1,16 +1,30 @@ -import { ActionCategoryKey, ActionCategoryMaker } from '@dao-dao/types' +import { + ActionCategoryKey, + ActionCategoryMaker, + ActionContextType, +} from '@dao-dao/types' import { makeAcceptSubDaoAction } from './AcceptSubDao' import { makeBecomeSubDaoAction } from './BecomeSubDao' import { makeManageSubDaosAction } from './ManageSubDaos' -export const makeSubDaosActionCategory: ActionCategoryMaker = ({ t }) => ({ +export const makeSubDaosActionCategory: ActionCategoryMaker = ({ + t, + context, +}) => ({ key: ActionCategoryKey.SubDaos, label: t('actionCategory.subDaosLabel'), description: t('actionCategory.subDaosDescription'), - actionMakers: [ - makeManageSubDaosAction, - makeBecomeSubDaoAction, - makeAcceptSubDaoAction, - ], + actionMakers: + context.type === ActionContextType.Dao + ? [ + makeManageSubDaosAction, + makeBecomeSubDaoAction, + makeAcceptSubDaoAction, + ] + : [ + // Allow non-DAOs to become the parent of DAOs. This may be chain + // governance or a DAO's polytone proxy for cross-chain SubDAOs. + makeAcceptSubDaoAction, + ], }) From 60b58b1eb5116312624278c41a7fc442ba1fd747 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 6 Aug 2024 11:41:06 -0400 Subject: [PATCH 399/438] don't detect ICA create messages for now since self-relaying doesn't work --- packages/utils/messages/cw.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/utils/messages/cw.ts b/packages/utils/messages/cw.ts index e6a88ca07..ea1b49d33 100644 --- a/packages/utils/messages/cw.ts +++ b/packages/utils/messages/cw.ts @@ -614,9 +614,10 @@ export const decodeCrossChainMessages = ( } let decodedIca = decodeIcaExecuteMsg(srcChainId, msg, 'any') - if (!decodedIca.match) { - decodedIca = decodeIcaCreateMsg(srcChainId, msg) - } + // TODO(ICA-create): fix self-relaying ICA create messages + // if (!decodedIca.match) { + // decodedIca = decodeIcaCreateMsg(srcChainId, msg) + // } if (decodedIca.match) { const ibcInfo = getIbcTransferInfoBetweenChains( srcChainId, From 0a00bf3f3ce4a106566b404b7713ce9f69086293 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 11 Aug 2024 01:57:38 -0400 Subject: [PATCH 400/438] use queries instead of selectors for loading members --- .../contracts/DaoVotingCw20Staked.ts | 35 ------------------- .../contracts/DaoVotingNativeStaked.ts | 32 ----------------- .../contracts/DaoVotingTokenStaked.ts | 30 ---------------- .../components/MembersTab.tsx | 18 +++++----- .../hooks/useMainDaoInfoCards.tsx | 17 ++++----- .../components/MembersTab.tsx | 18 +++++----- .../hooks/useMainDaoInfoCards.tsx | 16 +++++---- .../components/MembersTab.tsx | 18 +++++----- .../hooks/useMainDaoInfoCards.tsx | 16 +++++---- 9 files changed, 57 insertions(+), 143 deletions(-) diff --git a/packages/state/recoil/selectors/contracts/DaoVotingCw20Staked.ts b/packages/state/recoil/selectors/contracts/DaoVotingCw20Staked.ts index 395de865f..133b0df4e 100644 --- a/packages/state/recoil/selectors/contracts/DaoVotingCw20Staked.ts +++ b/packages/state/recoil/selectors/contracts/DaoVotingCw20Staked.ts @@ -214,38 +214,3 @@ export const isActiveSelector = selectorFamily< return await client.isActive(...params) }, }) - -///! Custom selectors - -export const topStakersSelector = selectorFamily< - | { - address: string - balance: string - votingPowerPercent: number - }[] - | undefined, - QueryClientParams & { limit?: number } ->({ - key: 'daoVotingCw20StakedTopStakers', - get: - ({ limit, ...queryClientParams }) => - ({ get }) => { - const id = - get(refreshWalletBalancesIdAtom(undefined)) + - get(refreshDaoVotingPowerAtom(queryClientParams.contractAddress)) - - return ( - get( - queryContractIndexerSelector({ - ...queryClientParams, - formula: 'daoVotingCw20Staked/topStakers', - args: { - limit, - }, - id, - noFallback: true, - }) - ) ?? undefined - ) - }, -}) diff --git a/packages/state/recoil/selectors/contracts/DaoVotingNativeStaked.ts b/packages/state/recoil/selectors/contracts/DaoVotingNativeStaked.ts index 2ed21ff37..5026f6f79 100644 --- a/packages/state/recoil/selectors/contracts/DaoVotingNativeStaked.ts +++ b/packages/state/recoil/selectors/contracts/DaoVotingNativeStaked.ts @@ -231,35 +231,3 @@ export const totalPowerAtHeightSelector = selectorFamily< }, }) export const infoSelector = contractInfoSelector - -///! Custom selectors - -export const topStakersSelector = selectorFamily< - | { - address: string - balance: string - votingPowerPercent: number - }[] - | undefined, - QueryClientParams ->({ - key: 'daoVotingNativeStakedTopStakers', - get: - (queryClientParams) => - ({ get }) => { - const id = - get(refreshWalletBalancesIdAtom(undefined)) + - get(refreshDaoVotingPowerAtom(queryClientParams.contractAddress)) - - return ( - get( - queryContractIndexerSelector({ - ...queryClientParams, - formula: 'daoVotingNativeStaked/topStakers', - id, - noFallback: true, - }) - ) ?? undefined - ) - }, -}) diff --git a/packages/state/recoil/selectors/contracts/DaoVotingTokenStaked.ts b/packages/state/recoil/selectors/contracts/DaoVotingTokenStaked.ts index 4a312ffde..753cafbe7 100644 --- a/packages/state/recoil/selectors/contracts/DaoVotingTokenStaked.ts +++ b/packages/state/recoil/selectors/contracts/DaoVotingTokenStaked.ts @@ -332,36 +332,6 @@ export const infoSelector = contractInfoSelector ///! Custom selectors -export const topStakersSelector = selectorFamily< - | { - address: string - balance: string - votingPowerPercent: number - }[] - | undefined, - QueryClientParams ->({ - key: 'daoVotingTokenStakedTopStakers', - get: - (queryClientParams) => - ({ get }) => { - const id = - get(refreshWalletBalancesIdAtom(undefined)) + - get(refreshDaoVotingPowerAtom(queryClientParams.contractAddress)) - - return ( - get( - queryContractIndexerSelector({ - ...queryClientParams, - formula: 'daoVotingTokenStaked/topStakers', - id, - noFallback: true, - }) - ) ?? undefined - ) - }, -}) - /** * Returns the cw-tokenfactory-issuer contract address if this voting module * uses a token factory denom and uses a cw-tokenfactory-issuer contract. diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/MembersTab.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/MembersTab.tsx index 3cddc5a6e..0915b37bb 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/MembersTab.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/components/MembersTab.tsx @@ -1,10 +1,8 @@ +import { useQueryClient } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' -import { DaoVotingCw20StakedSelectors } from '@dao-dao/state/recoil' -import { - MembersTab as StatelessMembersTab, - useCachedLoadingWithError, -} from '@dao-dao/stateless' +import { indexerQueries } from '@dao-dao/state/query' +import { MembersTab as StatelessMembersTab } from '@dao-dao/stateless' import { StatefulDaoMemberCardProps } from '@dao-dao/types' import { convertMicroDenomToDenomWithDecimals } from '@dao-dao/utils' @@ -13,6 +11,7 @@ import { DaoMemberCard, EntityDisplay, } from '../../../../components' +import { useQueryLoadingDataWithError } from '../../../../hooks' import { useVotingModuleAdapterOptions } from '../../../react/context' import { useGovernanceTokenInfo } from '../hooks/useGovernanceTokenInfo' @@ -21,10 +20,13 @@ export const MembersTab = () => { const { chainId, votingModuleAddress } = useVotingModuleAdapterOptions() const { governanceToken } = useGovernanceTokenInfo() - const members = useCachedLoadingWithError( - DaoVotingCw20StakedSelectors.topStakersSelector({ + const queryClient = useQueryClient() + const members = useQueryLoadingDataWithError( + indexerQueries.queryContract(queryClient, { chainId, contractAddress: votingModuleAddress, + formula: 'daoVotingCw20Staked/topStakers', + noFallback: true, }), (data) => data?.map( @@ -32,7 +34,7 @@ export const MembersTab = () => { address, balance, votingPowerPercent, - }): StatefulDaoMemberCardProps => ({ + }: any): StatefulDaoMemberCardProps => ({ address, balanceLabel: t('title.staked'), balance: { diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useMainDaoInfoCards.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useMainDaoInfoCards.tsx index 76ee5bf78..6428a6385 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useMainDaoInfoCards.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingCw20Staked/hooks/useMainDaoInfoCards.tsx @@ -1,10 +1,8 @@ +import { useQueryClient } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' -import { DaoVotingCw20StakedSelectors } from '@dao-dao/state' -import { - TokenAmountDisplay, - useCachedLoadingWithError, -} from '@dao-dao/stateless' +import { indexerQueries } from '@dao-dao/state' +import { TokenAmountDisplay } from '@dao-dao/stateless' import { DaoInfoCard } from '@dao-dao/types' import { convertDenomToMicroDenomWithDecimals, @@ -13,7 +11,7 @@ import { isSecretNetwork, } from '@dao-dao/utils' -import { useMembership } from '../../../../hooks' +import { useMembership, useQueryLoadingDataWithError } from '../../../../hooks' import { useVotingModuleAdapterOptions } from '../../../react/context' import { useGovernanceTokenInfo } from './useGovernanceTokenInfo' import { useStakingInfo } from './useStakingInfo' @@ -30,10 +28,13 @@ export const useMainDaoInfoCards = (): DaoInfoCard[] => { supply, } = useGovernanceTokenInfo() - const loadingMembers = useCachedLoadingWithError( - DaoVotingCw20StakedSelectors.topStakersSelector({ + const queryClient = useQueryClient() + const loadingMembers = useQueryLoadingDataWithError( + indexerQueries.queryContract(queryClient, { chainId, contractAddress: votingModuleAddress, + formula: 'daoVotingCw20Staked/topStakers', + noFallback: true, }) ) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/MembersTab.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/MembersTab.tsx index a13c1dfc6..d61a547b7 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/MembersTab.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/components/MembersTab.tsx @@ -1,10 +1,8 @@ +import { useQueryClient } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' -import { DaoVotingNativeStakedSelectors } from '@dao-dao/state/recoil' -import { - MembersTab as StatelessMembersTab, - useCachedLoadingWithError, -} from '@dao-dao/stateless' +import { indexerQueries } from '@dao-dao/state/query' +import { MembersTab as StatelessMembersTab } from '@dao-dao/stateless' import { StatefulDaoMemberCardProps } from '@dao-dao/types' import { convertMicroDenomToDenomWithDecimals } from '@dao-dao/utils' @@ -13,6 +11,7 @@ import { DaoMemberCard, EntityDisplay, } from '../../../../components' +import { useQueryLoadingDataWithError } from '../../../../hooks' import { useVotingModuleAdapterOptions } from '../../../react/context' import { useGovernanceTokenInfo } from '../hooks/useGovernanceTokenInfo' @@ -21,10 +20,13 @@ export const MembersTab = () => { const { chainId, votingModuleAddress } = useVotingModuleAdapterOptions() const { governanceToken } = useGovernanceTokenInfo() - const members = useCachedLoadingWithError( - DaoVotingNativeStakedSelectors.topStakersSelector({ + const queryClient = useQueryClient() + const members = useQueryLoadingDataWithError( + indexerQueries.queryContract(queryClient, { chainId, contractAddress: votingModuleAddress, + formula: 'daoVotingNativeStaked/topStakers', + noFallback: true, }), (data) => data?.map( @@ -32,7 +34,7 @@ export const MembersTab = () => { address, balance, votingPowerPercent, - }): StatefulDaoMemberCardProps => ({ + }: any): StatefulDaoMemberCardProps => ({ address, balanceLabel: t('title.staked'), balance: { diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/hooks/useMainDaoInfoCards.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/hooks/useMainDaoInfoCards.tsx index 83d64c2a1..ebbdc647f 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/hooks/useMainDaoInfoCards.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingNativeStaked/hooks/useMainDaoInfoCards.tsx @@ -1,16 +1,15 @@ +import { useQueryClient } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' -import { DaoVotingNativeStakedSelectors } from '@dao-dao/state' -import { - TokenAmountDisplay, - useCachedLoadingWithError, -} from '@dao-dao/stateless' +import { indexerQueries } from '@dao-dao/state' +import { TokenAmountDisplay } from '@dao-dao/stateless' import { DaoInfoCard } from '@dao-dao/types' import { convertDurationToHumanReadableString, convertMicroDenomToDenomWithDecimals, } from '@dao-dao/utils' +import { useQueryLoadingDataWithError } from '../../../../hooks' import { useVotingModuleAdapterOptions } from '../../../react/context' import { useGovernanceTokenInfo } from './useGovernanceTokenInfo' import { useStakingInfo } from './useStakingInfo' @@ -31,10 +30,13 @@ export const useMainDaoInfoCards = (): DaoInfoCard[] => { supply, } = useGovernanceTokenInfo() - const loadingMembers = useCachedLoadingWithError( - DaoVotingNativeStakedSelectors.topStakersSelector({ + const queryClient = useQueryClient() + const loadingMembers = useQueryLoadingDataWithError( + indexerQueries.queryContract(queryClient, { chainId, contractAddress: votingModuleAddress, + formula: 'daoVotingNativeStaked/topStakers', + noFallback: true, }) ) diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/MembersTab.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/MembersTab.tsx index 0d36aa018..8d161249e 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/MembersTab.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/components/MembersTab.tsx @@ -1,10 +1,8 @@ +import { useQueryClient } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' -import { DaoVotingTokenStakedSelectors } from '@dao-dao/state/recoil' -import { - MembersTab as StatelessMembersTab, - useCachedLoadingWithError, -} from '@dao-dao/stateless' +import { indexerQueries } from '@dao-dao/state/query' +import { MembersTab as StatelessMembersTab } from '@dao-dao/stateless' import { StatefulDaoMemberCardProps } from '@dao-dao/types' import { convertMicroDenomToDenomWithDecimals } from '@dao-dao/utils' @@ -13,6 +11,7 @@ import { DaoMemberCard, EntityDisplay, } from '../../../../components' +import { useQueryLoadingDataWithError } from '../../../../hooks' import { useVotingModuleAdapterOptions } from '../../../react/context' import { useGovernanceTokenInfo } from '../hooks/useGovernanceTokenInfo' @@ -21,10 +20,13 @@ export const MembersTab = () => { const { chainId, votingModuleAddress } = useVotingModuleAdapterOptions() const { governanceToken } = useGovernanceTokenInfo() - const members = useCachedLoadingWithError( - DaoVotingTokenStakedSelectors.topStakersSelector({ + const queryClient = useQueryClient() + const members = useQueryLoadingDataWithError( + indexerQueries.queryContract(queryClient, { chainId, contractAddress: votingModuleAddress, + formula: 'daoVotingTokenStaked/topStakers', + noFallback: true, }), (data) => data?.map( @@ -32,7 +34,7 @@ export const MembersTab = () => { address, balance, votingPowerPercent, - }): StatefulDaoMemberCardProps => ({ + }: any): StatefulDaoMemberCardProps => ({ address, balanceLabel: t('title.staked'), balance: { diff --git a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/hooks/useMainDaoInfoCards.tsx b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/hooks/useMainDaoInfoCards.tsx index 0902de74d..6650a514f 100644 --- a/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/hooks/useMainDaoInfoCards.tsx +++ b/packages/stateful/voting-module-adapter/adapters/DaoVotingTokenStaked/hooks/useMainDaoInfoCards.tsx @@ -1,10 +1,8 @@ +import { useQueryClient } from '@tanstack/react-query' import { useTranslation } from 'react-i18next' -import { DaoVotingTokenStakedSelectors } from '@dao-dao/state' -import { - TokenAmountDisplay, - useCachedLoadingWithError, -} from '@dao-dao/stateless' +import { indexerQueries } from '@dao-dao/state' +import { TokenAmountDisplay } from '@dao-dao/stateless' import { DaoInfoCard } from '@dao-dao/types' import { convertDurationToHumanReadableString, @@ -12,6 +10,7 @@ import { isSecretNetwork, } from '@dao-dao/utils' +import { useQueryLoadingDataWithError } from '../../../../hooks' import { useVotingModuleAdapterOptions } from '../../../react/context' import { useGovernanceTokenInfo } from './useGovernanceTokenInfo' import { useStakingInfo } from './useStakingInfo' @@ -32,10 +31,13 @@ export const useMainDaoInfoCards = (): DaoInfoCard[] => { supply, } = useGovernanceTokenInfo() - const loadingMembers = useCachedLoadingWithError( - DaoVotingTokenStakedSelectors.topStakersSelector({ + const queryClient = useQueryClient() + const loadingMembers = useQueryLoadingDataWithError( + indexerQueries.queryContract(queryClient, { chainId, contractAddress: votingModuleAddress, + formula: 'daoVotingTokenStaked/topStakers', + noFallback: true, }) ) From 493cd08f591160af54e71a771e03eb037447ee6a Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Sun, 11 Aug 2024 02:04:43 -0400 Subject: [PATCH 401/438] updated spend bulk import action data in README --- packages/stateful/actions/core/treasury/Spend/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/stateful/actions/core/treasury/Spend/README.md b/packages/stateful/actions/core/treasury/Spend/README.md index 210d28524..23dc6ab3b 100644 --- a/packages/stateful/actions/core/treasury/Spend/README.md +++ b/packages/stateful/actions/core/treasury/Spend/README.md @@ -19,8 +19,9 @@ guide](https://github.com/DA0-DA0/dao-dao-ui/wiki/Bulk-importing-actions). "toChainId": "", "from": "", "to": "", - "amount": "", + "amount": , "denom": "", + "decimals": , "cw20": "", "decimals": " Date: Tue, 13 Aug 2024 09:17:57 -0400 Subject: [PATCH 402/438] fixed migrate admin warning --- .../actions/core/smart_contracting/Migrate/Component.tsx | 9 ++++++--- .../actions/core/smart_contracting/Migrate/index.tsx | 3 +-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/stateful/actions/core/smart_contracting/Migrate/Component.tsx b/packages/stateful/actions/core/smart_contracting/Migrate/Component.tsx index f19063591..209c36c98 100644 --- a/packages/stateful/actions/core/smart_contracting/Migrate/Component.tsx +++ b/packages/stateful/actions/core/smart_contracting/Migrate/Component.tsx @@ -12,6 +12,7 @@ import { } from '@dao-dao/stateless' import { ActionComponent } from '@dao-dao/types/actions' import { + getChainAddressForActionOptions, makeValidateAddress, validateJSON, validatePositive, @@ -33,10 +34,12 @@ export const MigrateContractComponent: ActionComponent = ({ options: { onContractChange, contractAdmin }, }) => { const { t } = useTranslation() - const { address } = useActionOptions() - const { bech32_prefix: bech32Prefix } = useChain() + const options = useActionOptions() + const { chain_id: chainId, bech32_prefix: bech32Prefix } = useChain() const { register, control } = useFormContext() + const address = getChainAddressForActionOptions(options, chainId) + return ( <>

@@ -82,7 +85,7 @@ export const MigrateContractComponent: ActionComponent = ({

- {contractAdmin !== address && ( + {!!address && !!contractAdmin && contractAdmin !== address && ( )} diff --git a/packages/stateful/actions/core/smart_contracting/Migrate/index.tsx b/packages/stateful/actions/core/smart_contracting/Migrate/index.tsx index d54784aa6..8823b3501 100644 --- a/packages/stateful/actions/core/smart_contracting/Migrate/index.tsx +++ b/packages/stateful/actions/core/smart_contracting/Migrate/index.tsx @@ -174,8 +174,7 @@ const Component: ActionComponent = (props) => { setContract(contract), }} /> From 21473fec440e0101445e5269a12cb43a07c4071a Mon Sep 17 00:00:00 2001 From: noah Date: Tue, 13 Aug 2024 12:00:29 -0400 Subject: [PATCH 403/438] set up widgets on DAO creation via instantiate2 (#1809) --- packages/i18n/locales/en/translation.json | 8 +- packages/state/contracts/CwAdminFactory.ts | 56 +++++- packages/state/query/queries/contract.ts | 52 ++++++ packages/state/query/queries/proposal.ts | 10 +- .../ManageWidgets/Component.tsx | 9 + .../dao_appearance/ManageWidgets/index.tsx | 12 +- .../smart_contracting/Instantiate2/index.tsx | 4 +- .../ConfigureVestingPayments/Component.tsx | 9 +- .../ConfigureVestingPayments/index.tsx | 6 +- .../EnableRetroactiveCompensation/index.tsx | 4 +- .../clients/dao/CreatingDaoPlaceholder.ts | 126 ++++++++++++++ packages/stateful/clients/dao/index.ts | 1 + .../MultipleChoiceProposalModule.ts | 6 +- .../SingleChoiceProposalModule.ts | 6 +- .../components/dao/CreateDaoExtensions.tsx | 147 ++++++++++++++++ .../stateful/components/dao/CreateDaoForm.tsx | 160 +++++++++++++++--- .../hooks/contracts/CwAdminFactory.ts | 3 + .../stateful/hooks/useGenerateInstantiate2.ts | 30 ++-- .../actions/UpdatePreProposeConfig/index.tsx | 6 +- .../UpdatePreProposeSingleConfig/index.tsx | 6 +- packages/stateful/recoil/atoms/newDao.ts | 3 + packages/stateful/widgets/core.ts | 3 +- .../stateful/widgets/react/useWidgets.tsx | 4 +- .../stateful/widgets/widgets/MintNft/index.ts | 4 + .../widgets/widgets/Press/PressEditor.tsx | 41 +++-- .../stateful/widgets/widgets/Press/index.ts | 4 + .../VestingPayments/VestingPaymentsEditor.tsx | 49 +++--- .../components/dao/create/pages/index.ts | 15 +- .../decorators/DaoPageWrapperDecorator.tsx | 2 + packages/types/chain.ts | 5 + packages/types/contracts/CwAdminFactory.ts | 24 ++- .../contracts/DaoPreProposeApprovalSingle.ts | 6 +- .../types/contracts/DaoPreProposeApprover.ts | 6 +- .../types/contracts/DaoPreProposeMultiple.ts | 6 +- .../types/contracts/DaoPreProposeSingle.ts | 6 +- packages/types/dao.ts | 21 +++ packages/types/widgets.ts | 39 ++++- packages/utils/constants/chains.ts | 67 ++++---- packages/utils/contracts.ts | 49 ++++-- packages/utils/conversion.ts | 4 +- packages/utils/index.ts | 1 + packages/utils/widgets.ts | 7 + 42 files changed, 833 insertions(+), 194 deletions(-) create mode 100644 packages/stateful/clients/dao/CreatingDaoPlaceholder.ts create mode 100644 packages/stateful/components/dao/CreateDaoExtensions.tsx create mode 100644 packages/utils/widgets.ts diff --git a/packages/i18n/locales/en/translation.json b/packages/i18n/locales/en/translation.json index 37d522a47..d1a8299c1 100644 --- a/packages/i18n/locales/en/translation.json +++ b/packages/i18n/locales/en/translation.json @@ -529,7 +529,8 @@ "simulationFailedInvalidProposalActions": "Simulation failed. Verify your proposal actions are valid.", "spendActionInsufficientWarning": "You currently have {{amount}} ${{tokenSymbol}}, which may not be sufficient unless another action transfers funds to the DAO before this one.", "stakeInsufficient": "The DAO has {{amount}} ${{tokenSymbol}} staked, which is insufficient.", - "stargazeDaoNoCrossChainAccountsForPress": "This Stargaze DAO has no cross-chain accounts, and Press does not work on Stargaze. Create a cross-chain account for the DAO before setting up Press.", + "stargazeDaoNoCrossChainAccountsForPress_action": "This Stargaze DAO has no cross-chain accounts, and Press does not work on Stargaze. Create a cross-chain account for the DAO before setting up Press.", + "stargazeDaoNoCrossChainAccountsForPress_daoCreation": "Press does not currently work on Stargaze. Create the DAO first, and then create a cross-chain account in order to set up Press.", "stepPercentsMustSumTo100": "Step percentages must sum to 100%.", "subDaoAlreadyExists": "SubDAO already exists.", "tokenAlreadySelected": "Token already selected.", @@ -1082,6 +1083,7 @@ "estimatedUsdValueTooltip": "USD value is estimated using price data from CoinGecko, Osmosis, White Whale, and Astroport. This is not fully reflective of realizable spending power due to liquidity limitations.", "executeSmartContractActionDescription": "Execute a message on a smart contract.", "executorAccountTooltip": "This is the account that will be executing the message on the smart contract. The contract will see this as the `sender`.", + "extensionsDescription": "Optionally set up extensions to expand your DAO's capabilities. You can always set these up later.", "failing": "Failing", "feeShareDescription": "Earn gas fees from a smart contract you deployed.", "feedDescription": "Open proposals in the DAOs you follow will show up here.", @@ -1464,7 +1466,8 @@ "vestingIsCancellableByOther": "This vesting payment can be cancelled by the following address after it's created.", "vestingIsCancellableByOwner_dao": "This vesting payment can be cancelled by the DAO after it's created.", "vestingIsCancellableByOwner_wallet": "You will be able to cancel this vesting payment after it's created.", - "vestingManagerExplanation": "To create vesting payments, you must first create a vesting payment manager on each chain that you want to pay from, and the DAO must have an account on each chain before you can create the manager.", + "vestingManagerExplanation_action": "To create vesting payments on a chain, the DAO must have an account and vesting payment manager on that chain. Create vesting payment managers on any of the available chains below, or create cross-chain accounts so you can set up managers in another proposal.", + "vestingManagerExplanation_daoCreation": "To create vesting payments on a chain, the DAO must have an account and vesting payment manager on that chain. Since you are creating a DAO, you can only set up vesting on the DAO's home chain for now. Create cross-chain accounts via proposals once the DAO is created in order to manage vesting payments on other chains.", "vestingManagerNeeded": "To create a vesting payment on {{chain}}, the DAO must first setup a vesting payment manager by passing a proposal with the setup action. Click the button to add the setup action and remove this vesting payment.", "vestingNotCancellable": "This vesting payment cannot be cancelled later.", "vestingPaymentsDescription": "A vesting payment distributes funds according to any schedule you choose, and the DAO can enable or disable early cancelation.", @@ -1737,6 +1740,7 @@ "existingToken": "Existing token", "expires": "Expires", "extension": "Extension", + "extensions": "Extensions", "factoryToken": "Factory token", "featuredDaos": "Featured DAOs", "feeShare": "Fee share", diff --git a/packages/state/contracts/CwAdminFactory.ts b/packages/state/contracts/CwAdminFactory.ts index 44e693ead..210c66079 100644 --- a/packages/state/contracts/CwAdminFactory.ts +++ b/packages/state/contracts/CwAdminFactory.ts @@ -21,6 +21,24 @@ export interface CwAdminFactoryInterface { memo?: string, funds?: Coin[] ) => Promise + instantiate2ContractWithSelfAdmin: ( + { + codeId, + instantiateMsg, + label, + salt, + expect, + }: { + codeId: number + instantiateMsg: Binary + label: string + salt: Binary + expect?: string | null + }, + fee?: number | StdFee | 'auto', + memo?: string, + funds?: Coin[] + ) => Promise } export class CwAdminFactoryClient implements CwAdminFactoryInterface { client: SigningCosmWasmClient @@ -37,8 +55,9 @@ export class CwAdminFactoryClient implements CwAdminFactoryInterface { this.contractAddress = contractAddress this.instantiateContractWithSelfAdmin = this.instantiateContractWithSelfAdmin.bind(this) + this.instantiate2ContractWithSelfAdmin = + this.instantiate2ContractWithSelfAdmin.bind(this) } - instantiateContractWithSelfAdmin = async ( { codeId, @@ -68,4 +87,39 @@ export class CwAdminFactoryClient implements CwAdminFactoryInterface { funds ) } + instantiate2ContractWithSelfAdmin = async ( + { + codeId, + instantiateMsg, + label, + salt, + expect, + }: { + codeId: number + instantiateMsg: Binary + label: string + salt: Binary + expect?: string | null + }, + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, + memo?: string, + funds?: Coin[] + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + instantiate2_contract_with_self_admin: { + code_id: codeId, + instantiate_msg: instantiateMsg, + label, + salt, + expect, + }, + }, + fee, + memo, + funds + ) + } } diff --git a/packages/state/query/queries/contract.ts b/packages/state/query/queries/contract.ts index f24bd9638..77b14393a 100644 --- a/packages/state/query/queries/contract.ts +++ b/packages/state/query/queries/contract.ts @@ -2,10 +2,13 @@ import { fromUtf8, toUtf8 } from '@cosmjs/encoding' import { QueryClient, queryOptions, skipToken } from '@tanstack/react-query' import { InfoResponse } from '@dao-dao/types' +import { CodeInfoResponse } from '@dao-dao/types/protobuf/codegen/cosmwasm/wasm/v1/query' +import { AccessType } from '@dao-dao/types/protobuf/codegen/cosmwasm/wasm/v1/types' import { ContractName, DAO_CORE_CONTRACT_NAMES, INVALID_CONTRACT_ERROR_SUBSTRINGS, + cosmwasmProtoRpcClientRouter, getChainForChainId, getCosmWasmClientForChainId, isSecretNetwork, @@ -189,6 +192,47 @@ export const fetchContractInstantiationTime = async ( ) } +/** + * Fetch contract code info. + */ +export const fetchContractCodeInfo = async ({ + chainId, + codeId, +}: { + chainId: string + codeId: number +}): Promise => { + if (isSecretNetwork(chainId)) { + const client = await secretCosmWasmClientRouter.connect(chainId) + const code = await client.getCodeDetails(codeId) + return { + codeId: BigInt(code.id), + creator: code.creator, + dataHash: toUtf8(code.checksum), + // Secret Network is permissionless. + instantiatePermission: { + permission: AccessType.Everybody, + addresses: [], + }, + } + } + + // CosmWasmClient.getContract is not compatible with Terra Classic for some + // reason, so use protobuf query directly. + const client = await cosmwasmProtoRpcClientRouter.connect(chainId) + const codeInfo = ( + await client.wasm.v1.code({ + codeId: BigInt(codeId), + }) + )?.codeInfo + + if (!codeInfo) { + throw new Error('Code info not found for code ID: ' + codeId) + } + + return codeInfo +} + /** * Get code hash for a Secret Network contract. */ @@ -286,6 +330,14 @@ export const contractQueries = { queryKey: ['contract', 'instantiationTime', options], queryFn: () => fetchContractInstantiationTime(queryClient, options), }), + /** + * Fetch contract code info. + */ + codeInfo: (options: Parameters[0]) => + queryOptions({ + queryKey: ['contract', 'codeInfo', options], + queryFn: () => fetchContractCodeInfo(options), + }), /** * Fetch the code hash for a Secret Network contract. */ diff --git a/packages/state/query/queries/proposal.ts b/packages/state/query/queries/proposal.ts index 2cce9a9b1..8d88cdb29 100644 --- a/packages/state/query/queries/proposal.ts +++ b/packages/state/query/queries/proposal.ts @@ -277,11 +277,15 @@ export const fetchPreProposeModule = async ( 'open_proposal_submission' in moduleConfig ? moduleConfig.open_proposal_submission ? { - anyone: {}, + anyone: { + denylist: [], + }, } : { specific: { dao_members: true, + allowlist: [], + denylist: [], }, } : // >= v2.5.0 @@ -291,12 +295,16 @@ export const fetchPreProposeModule = async ( { specific: { dao_members: true, + allowlist: [], + denylist: [], }, } : // If no config loaded, assume only members can propose. { specific: { dao_members: true, + allowlist: [], + denylist: [], }, } diff --git a/packages/stateful/actions/core/dao_appearance/ManageWidgets/Component.tsx b/packages/stateful/actions/core/dao_appearance/ManageWidgets/Component.tsx index cfc78b31d..e9be8cba9 100644 --- a/packages/stateful/actions/core/dao_appearance/ManageWidgets/Component.tsx +++ b/packages/stateful/actions/core/dao_appearance/ManageWidgets/Component.tsx @@ -16,6 +16,8 @@ import { import { DaoWidget, SuspenseLoaderProps, Widget } from '@dao-dao/types' import { ActionComponent } from '@dao-dao/types/actions' +import { useActionOptions } from '../../../react' + export type ManageWidgetsData = { mode: 'set' | 'delete' id: string @@ -41,6 +43,7 @@ export const ManageWidgetsComponent: ActionComponent = ( const { t } = useTranslation() const { setValue, watch, clearErrors } = useFormContext() + const actionOptions = useActionOptions() const mode = watch((fieldNamePrefix + 'mode') as 'mode') const widgetId = watch((fieldNamePrefix + 'id') as 'id') @@ -187,9 +190,12 @@ export const ManageWidgetsComponent: ActionComponent = (
@@ -211,8 +217,11 @@ export const ManageWidgetsComponent: ActionComponent = (
diff --git a/packages/stateful/actions/core/dao_appearance/ManageWidgets/index.tsx b/packages/stateful/actions/core/dao_appearance/ManageWidgets/index.tsx index fddad047a..d879f7e9d 100644 --- a/packages/stateful/actions/core/dao_appearance/ManageWidgets/index.tsx +++ b/packages/stateful/actions/core/dao_appearance/ManageWidgets/index.tsx @@ -12,7 +12,7 @@ import { UseTransformToCosmos, } from '@dao-dao/types/actions' import { - DAO_WIDGET_ITEM_NAMESPACE, + getWidgetStorageItemKey, makeWasmMessage, objectMatchesStructure, } from '@dao-dao/utils' @@ -86,13 +86,13 @@ export const makeManageWidgetsAction: ActionMaker = ({ mode === 'set' ? { set_item: { - key: DAO_WIDGET_ITEM_NAMESPACE + id, + key: getWidgetStorageItemKey(id), [valueKey]: JSON.stringify(values), }, } : { remove_item: { - key: DAO_WIDGET_ITEM_NAMESPACE + id, + key: getWidgetStorageItemKey(id), }, }, }, @@ -117,11 +117,11 @@ export const makeManageWidgetsAction: ActionMaker = ({ msg.wasm.execute.contract_addr === address && (('set_item' in msg.wasm.execute.msg && msg.wasm.execute.msg.set_item.key.startsWith( - DAO_WIDGET_ITEM_NAMESPACE + getWidgetStorageItemKey('') )) || ('remove_item' in msg.wasm.execute.msg && msg.wasm.execute.msg.remove_item.key.startsWith( - DAO_WIDGET_ITEM_NAMESPACE + getWidgetStorageItemKey('') ))) ) { const mode = 'set_item' in msg.wasm.execute.msg ? 'set' : 'delete' @@ -142,7 +142,7 @@ export const makeManageWidgetsAction: ActionMaker = ({ id: (mode === 'set' ? msg.wasm.execute.msg.set_item.key : msg.wasm.execute.msg.remove_item.key - ).replace(new RegExp(`^${DAO_WIDGET_ITEM_NAMESPACE}`), ''), + ).replace(new RegExp(`^${getWidgetStorageItemKey('')}`), ''), values, }, } diff --git a/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx b/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx index f2d6532df..c437ec327 100644 --- a/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx +++ b/packages/stateful/actions/core/smart_contracting/Instantiate2/index.tsx @@ -353,7 +353,7 @@ export const makeInstantiate2Action: ActionMaker = ( const instantiateMsg = makeStargateMessage({ stargate: { typeUrl: MsgInstantiateContract2.typeUrl, - value: { + value: MsgInstantiateContract2.fromPartial({ sender: getChainAddressForActionOptions(options, chainId), admin: admin || '', codeId: codeId ? BigInt(codeId) : 0n, @@ -362,7 +362,7 @@ export const makeInstantiate2Action: ActionMaker = ( funds: convertedFunds, salt: toUtf8(salt), fixMsg: false, - } as MsgInstantiateContract2, + }), }, }) diff --git a/packages/stateful/actions/core/treasury/ConfigureVestingPayments/Component.tsx b/packages/stateful/actions/core/treasury/ConfigureVestingPayments/Component.tsx index 70a99e331..ff794a3fe 100644 --- a/packages/stateful/actions/core/treasury/ConfigureVestingPayments/Component.tsx +++ b/packages/stateful/actions/core/treasury/ConfigureVestingPayments/Component.tsx @@ -4,12 +4,14 @@ import { VestingPaymentsWidgetData } from '@dao-dao/types' import { ActionComponent } from '@dao-dao/types/actions' import { VestingPaymentsEditor } from '../../../../widgets/widgets/VestingPayments/VestingPaymentsEditor' +import { useActionOptions } from '../../../react' export const ConfigureVestingPaymentsComponent: ActionComponent< undefined, VestingPaymentsWidgetData > = (props) => { const { t } = useTranslation() + const options = useActionOptions() return ( <> @@ -17,7 +19,12 @@ export const ConfigureVestingPaymentsComponent: ActionComponent< {t('info.vestingPaymentsDescription')}

- + ) } diff --git a/packages/stateful/actions/core/treasury/ConfigureVestingPayments/index.tsx b/packages/stateful/actions/core/treasury/ConfigureVestingPayments/index.tsx index 806b4976e..523d77d7a 100644 --- a/packages/stateful/actions/core/treasury/ConfigureVestingPayments/index.tsx +++ b/packages/stateful/actions/core/treasury/ConfigureVestingPayments/index.tsx @@ -11,7 +11,7 @@ import { UseDefaults, UseTransformToCosmos, } from '@dao-dao/types/actions' -import { DAO_WIDGET_ITEM_NAMESPACE } from '@dao-dao/utils' +import { getWidgetStorageItemKey } from '@dao-dao/utils' import { useWidgets } from '../../../../widgets' import { makeManageWidgetsAction } from '../../dao_appearance/ManageWidgets' @@ -77,9 +77,7 @@ export const makeConfigureVestingPaymentsAction: ActionMaker< } const vestingEnabled = - !!context.dao.info.items[ - DAO_WIDGET_ITEM_NAMESPACE + WidgetId.VestingPayments - ] + !!context.dao.info.items[getWidgetStorageItemKey(WidgetId.VestingPayments)] return { key: ActionKey.ConfigureVestingPayments, diff --git a/packages/stateful/actions/core/treasury/EnableRetroactiveCompensation/index.tsx b/packages/stateful/actions/core/treasury/EnableRetroactiveCompensation/index.tsx index ef9d68526..99491b634 100644 --- a/packages/stateful/actions/core/treasury/EnableRetroactiveCompensation/index.tsx +++ b/packages/stateful/actions/core/treasury/EnableRetroactiveCompensation/index.tsx @@ -9,7 +9,7 @@ import { UseDefaults, UseTransformToCosmos, } from '@dao-dao/types/actions' -import { DAO_WIDGET_ITEM_NAMESPACE } from '@dao-dao/utils' +import { getWidgetStorageItemKey } from '@dao-dao/utils' import { RetroactiveCompensationWidget } from '../../../../widgets/widgets/RetroactiveCompensation' import { makeManageWidgetsAction } from '../../dao_appearance/ManageWidgets' @@ -73,7 +73,7 @@ export const makeEnableRetroactiveCompensationAction: ActionMaker = ( // compensation enabled. hideFromPicker: !!context.dao.info.items[ - DAO_WIDGET_ITEM_NAMESPACE + RetroactiveCompensationWidget.id + getWidgetStorageItemKey(RetroactiveCompensationWidget.id) ], } } diff --git a/packages/stateful/clients/dao/CreatingDaoPlaceholder.ts b/packages/stateful/clients/dao/CreatingDaoPlaceholder.ts new file mode 100644 index 000000000..31e17c3ff --- /dev/null +++ b/packages/stateful/clients/dao/CreatingDaoPlaceholder.ts @@ -0,0 +1,126 @@ +import { Chain } from '@chain-registry/types' +import { + FetchQueryOptions, + QueryClient, + skipToken, +} from '@tanstack/react-query' + +import { + AccountType, + ContractVersion, + DaoInfo, + IProposalModuleBase, + IVotingModuleBase, + InstantiateInfo, +} from '@dao-dao/types' +import { + TotalPowerAtHeightResponse, + VotingPowerAtHeightResponse, +} from '@dao-dao/types/contracts/DaoDaoCore' +import { getChainForChainId, getSupportedFeatures } from '@dao-dao/utils' + +import { DaoBase } from './base' + +/** + * A placeholder DAO class used when creating a DAO. This is necessary for the + * widget editors since some depend on the DAO context. + */ +export class CreatingDaoPlaceholder extends DaoBase { + protected _info: DaoInfo + + constructor( + protected readonly options: { + chainId: string + coreAddress: string + coreVersion: ContractVersion + name: string + description: string + imageUrl: string + } + ) { + super(new QueryClient()) + + this._info = { + chainId: options.chainId, + coreAddress: options.coreAddress, + coreVersion: options.coreVersion, + supportedFeatures: getSupportedFeatures(options.coreVersion), + votingModuleAddress: '', + votingModuleInfo: { + contract: '', + version: '', + }, + proposalModules: [], + contractAdmin: '', + admin: '', + name: options.name, + description: options.description, + imageUrl: options.imageUrl, + created: Date.now(), + isActive: true, + activeThreshold: null, + items: {}, + polytoneProxies: {}, + accounts: [ + { + type: AccountType.Native, + chainId: options.chainId, + address: options.coreAddress, + }, + ], + parentDao: null, + } + } + + static generateInstantiateInfo(): InstantiateInfo { + throw new Error('Not implemented') + } + + async init() {} + + get initialized() { + return true + } + + get info(): DaoInfo { + return this._info + } + + get chainId(): string { + return this.options.chainId + } + + get chain(): Chain { + return getChainForChainId(this.chainId) + } + + get coreAddress(): string { + return this.options.coreAddress + } + + get votingModule(): IVotingModuleBase { + throw new Error('Not implemented') + } + + get proposalModules(): readonly IProposalModuleBase[] { + return [] + } + + getVotingPowerQuery(): FetchQueryOptions { + return { + queryKey: [], + queryFn: skipToken, + } + } + + getTotalVotingPowerQuery(): FetchQueryOptions { + return { + queryKey: [], + queryFn: skipToken, + } + } + + async getProposalCount(): Promise { + return 0 + } +} diff --git a/packages/stateful/clients/dao/index.ts b/packages/stateful/clients/dao/index.ts index 6ff8db912..92df01501 100644 --- a/packages/stateful/clients/dao/index.ts +++ b/packages/stateful/clients/dao/index.ts @@ -1,4 +1,5 @@ export * from './ChainXGovDao' +export * from './CreatingDaoPlaceholder' export * from './CwDao' export * from './SecretCwDao' diff --git a/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.ts b/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.ts index 240e5cda2..aa8effa51 100644 --- a/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.ts +++ b/packages/stateful/clients/proposal-module/MultipleChoiceProposalModule.ts @@ -110,11 +110,15 @@ export class MultipleChoiceProposalModule extends ProposalModuleBase< submission_policy: config.submissionPolicy === 'anyone' ? { - anyone: {}, + anyone: { + denylist: [], + }, } : { specific: { dao_members: true, + allowlist: [], + denylist: [], }, }, } diff --git a/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts b/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts index dc0d23ea5..1d5a669fc 100644 --- a/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts +++ b/packages/stateful/clients/proposal-module/SingleChoiceProposalModule.ts @@ -90,11 +90,15 @@ export class SingleChoiceProposalModule extends ProposalModuleBase< submission_policy: config.submissionPolicy === 'anyone' ? { - anyone: {}, + anyone: { + denylist: [], + }, } : { specific: { dao_members: true, + allowlist: [], + denylist: [], }, }, } diff --git a/packages/stateful/components/dao/CreateDaoExtensions.tsx b/packages/stateful/components/dao/CreateDaoExtensions.tsx new file mode 100644 index 000000000..965e7c3b0 --- /dev/null +++ b/packages/stateful/components/dao/CreateDaoExtensions.tsx @@ -0,0 +1,147 @@ +import { Add } from '@mui/icons-material' +import clsx from 'clsx' +import cloneDeep from 'lodash.clonedeep' +import { useMemo } from 'react' +import { FieldErrors } from 'react-hook-form' +import { useTranslation } from 'react-i18next' + +import { + DaoContext, + IconButton, + Loader, + useSupportedChainContext, +} from '@dao-dao/stateless' +import { CreateDaoContext } from '@dao-dao/types' +import { getFallbackImage } from '@dao-dao/utils' + +import { CreatingDaoPlaceholder } from '../../clients/dao/CreatingDaoPlaceholder' + +export const CreateDaoExtensions = (context: CreateDaoContext) => { + const { t } = useTranslation() + const { + chainId, + config: { codeIdsVersion }, + } = useSupportedChainContext() + + const { + availableWidgets, + predictedDaoAddress, + form: { + setValue, + watch, + clearErrors, + formState: { errors }, + }, + } = context + + const existingWidgets = watch('widgets') || {} + + const name = watch('name') + const description = watch('description') + const imageUrl = watch('imageUrl') + + const dao = useMemo( + () => + predictedDaoAddress.loading || predictedDaoAddress.errored + ? undefined + : new CreatingDaoPlaceholder({ + chainId, + coreAddress: predictedDaoAddress.data, + coreVersion: codeIdsVersion, + name, + description, + imageUrl: imageUrl || getFallbackImage('placeholderDaoAddress'), + }), + [chainId, codeIdsVersion, description, imageUrl, name, predictedDaoAddress] + ) + + return ( + <> +

+ {t('title.extensions')} +

+

+ {t('info.extensionsDescription')} +

+ +
+ {/* If DAO undefined, predicted DAO address is still loading. */} + {!dao ? ( + + ) : ( + availableWidgets.map(({ id, defaultValues, Editor }) => { + const added = !!existingWidgets[id] + + return ( +
+
+ { + if (added) { + // Remove. + + setValue(`widgets.${id}`, null) + // Clear errors to ensure form isn't blocked by fields + // that no longer exist. + clearErrors(`widgets.${id}`) + } else { + // Add. + + // Clone so we don't mutate the default values object. + setValue( + `widgets.${id}`, + cloneDeep(defaultValues || {}) + ) + } + }} + variant="ghost" + /> + +
+

+ {t(`widgetTitle.${id}`)} +

+

+ {t(`widgetDescription.${id}`)} +

+
+
+ + {added && Editor && ( +
+ + + +
+ )} +
+ ) + }) + )} +
+ + ) +} diff --git a/packages/stateful/components/dao/CreateDaoForm.tsx b/packages/stateful/components/dao/CreateDaoForm.tsx index 878748e00..08af957b2 100644 --- a/packages/stateful/components/dao/CreateDaoForm.tsx +++ b/packages/stateful/components/dao/CreateDaoForm.tsx @@ -1,3 +1,4 @@ +import { toBase64, toUtf8 } from '@cosmjs/encoding' import { ArrowBack } from '@mui/icons-material' import { useQueryClient } from '@tanstack/react-query' import cloneDeep from 'lodash.clonedeep' @@ -18,7 +19,10 @@ import { averageColorSelector, walletChainIdAtom } from '@dao-dao/state/recoil' import { Button, ChainProvider, - CreateDaoPages, + CreateDaoGovernance, + CreateDaoReview, + CreateDaoStart, + CreateDaoVoting, DaoHeader, ImageSelector, Loader, @@ -33,6 +37,7 @@ import { } from '@dao-dao/stateless' import { ActionKey, + ContractVersion, CreateDaoContext, CreateDaoCustomValidator, DaoPageMode, @@ -43,7 +48,10 @@ import { ProposalModuleAdapter, SecretModuleInstantiateInfo, } from '@dao-dao/types' -import { InstantiateMsg as DaoDaoCoreInstantiateMsg } from '@dao-dao/types/contracts/DaoDaoCore' +import { + InstantiateMsg as DaoDaoCoreInstantiateMsg, + InitialItem, +} from '@dao-dao/types/contracts/DaoDaoCore' import { InstantiateMsg as SecretDaoDaoCoreInstantiateMsg } from '@dao-dao/types/contracts/SecretDaoDaoCore' import { CHAIN_GAS_MULTIPLIER, @@ -61,11 +69,13 @@ import { getNativeTokenForChainId, getSupportedChainConfig, getSupportedChains, + getWidgetStorageItemKey, instantiateSmartContract, isSecretNetwork, makeWasmMessage, parseContractVersion, processError, + versionGte, } from '@dao-dao/utils' import { CustomData } from '../../actions/core/advanced/Custom/Component' @@ -81,6 +91,7 @@ import { SecretCwAdminFactoryHooks, useAwaitNextBlock, useFollowingDaos, + useGenerateInstantiate2, useQuerySyncedRecoilState, useWallet, } from '../../hooks' @@ -90,6 +101,7 @@ import { makeDefaultNewDao, newDaoAtom, } from '../../recoil/atoms/newDao' +import { getWidgets } from '../../widgets' import { LinkWrapper } from '../LinkWrapper' import { PageHeaderContent } from '../PageHeaderContent' import { SuspenseLoader } from '../SuspenseLoader' @@ -97,6 +109,7 @@ import { TokenAmountDisplay } from '../TokenAmountDisplay' import { Trans } from '../Trans' import { WalletChainSwitcher } from '../wallet' import { loadCommonVotingConfigItems } from './commonVotingConfig' +import { CreateDaoExtensions } from './CreateDaoExtensions' import { ImportMultisigModal } from './ImportMultisigModal' // i18n keys @@ -107,7 +120,7 @@ export enum CreateDaoSubmitValue { Create = 'button.createDAO', } -export interface CreateDaoFormProps { +export type CreateDaoFormProps = { parentDao?: DaoParentInfo // Primarily for testing in storybook. @@ -163,12 +176,28 @@ export const InnerCreateDaoForm = ({ config: { name: chainGovName, factoryContractAddress, - codeIds, + codeIdsVersion, + codeIds: { DaoCore: daoCoreCodeId }, codeHashes, createViaGovernance, + noInstantiate2Create, }, } = chainContext + // Only v2.5.0 and above supports instantiate2 in admin factory, so we can set + // up widgets with the predictable DAO address. + const supportsInstantiate2 = + versionGte(codeIdsVersion, ContractVersion.V250) && !noInstantiate2Create + + const CreateDaoPages = [ + CreateDaoStart, + CreateDaoGovernance, + CreateDaoVoting, + // Need instantiate2 to setup extensions on DAO creation. + ...(supportsInstantiate2 ? [CreateDaoExtensions] : []), + CreateDaoReview, + ] + const { goToDao, goToDaoProposal } = useDaoNavHelpers() const { setFollowing } = useFollowingDaos() @@ -243,6 +272,11 @@ export const InnerCreateDaoForm = ({ cached.votingConfig ) + // Ensure UUID is set. + if (!cached.uuid) { + cached.uuid = defaultNewDao.uuid + } + return merge( // Merges into this object. cached, @@ -258,12 +292,14 @@ export const InnerCreateDaoForm = ({ const newDao = form.watch() const { + uuid, name, description, imageUrl, creator: { id: creatorId, data: creatorData }, proposalModuleAdapters, votingConfig, + widgets, } = newDao // If chain ID changes, update form values. @@ -356,6 +392,12 @@ export const InnerCreateDaoForm = ({ [proposalModuleAdapters, votingConfig.enableMultipleChoice] ) + // Get available widgets. + const availableWidgets: CreateDaoContext['availableWidgets'] = useMemo( + () => getWidgets(chainId), + [chainId] + ) + let instantiateMsg: | DaoDaoCoreInstantiateMsg | SecretDaoDaoCoreInstantiateMsg @@ -387,6 +429,19 @@ export const InnerCreateDaoForm = ({ name: name.trim(), description, imageUrl, + // Add widgets if configured. + ...(widgets && + Object.keys(widgets).length > 0 && { + initialItems: Object.entries(widgets).flatMap( + ([id, values]): InitialItem | [] => + values + ? { + key: getWidgetStorageItemKey(id), + value: JSON.stringify(values), + } + : [] + ), + }), } if (isSecretNetwork(chainId)) { @@ -436,11 +491,37 @@ export const InnerCreateDaoForm = ({ refreshBalances, } = useWallet() + const predictedDaoAddress = useGenerateInstantiate2({ + chainId, + creator: factoryContractAddress, + codeId: daoCoreCodeId, + salt: uuid, + }) + + // If the predicted DAO address differs from the one in the form, update it + // and clear widgets, since widgets depend on knowing the DAO address ahead of + // time. + useEffect(() => { + if ( + !predictedDaoAddress.loading && + !predictedDaoAddress.errored && + predictedDaoAddress.data !== newDao.predictedDaoAddress + ) { + form.setValue('predictedDaoAddress', predictedDaoAddress.data) + form.setValue('widgets', {}) + } + }, [form, newDao.predictedDaoAddress, predictedDaoAddress]) + const instantiateWithSelfAdmin = CwAdminFactoryHooks.useInstantiateWithAdminFactory({ contractAddress: factoryContractAddress, sender: walletAddress ?? '', }) + const instantiate2WithSelfAdmin = + CwAdminFactoryHooks.useInstantiate2WithAdminFactory({ + contractAddress: factoryContractAddress, + sender: walletAddress ?? '', + }) const secretInstantiateWithSelfAdmin = SecretCwAdminFactoryHooks.useInstantiateContractWithSelfAdmin({ contractAddress: factoryContractAddress, @@ -466,11 +547,14 @@ export const InnerCreateDaoForm = ({ return await instantiateSmartContract( getSigningClient, walletAddress, - codeIds.DaoCore, + daoCoreCodeId, contractLabel, instantiateMsg, instantiateFunds, - instantiateMsg.admin + instantiateMsg.admin, + undefined, + undefined, + supportsInstantiate2 ? toUtf8(uuid) : undefined ) } else if (isSecret) { if (!codeHashes?.DaoCore) { @@ -480,7 +564,7 @@ export const InnerCreateDaoForm = ({ const { events } = await secretInstantiateWithSelfAdmin( { instantiateMsg: encodeJsonToBase64(instantiateMsg), - codeId: codeIds.DaoCore, + codeId: daoCoreCodeId, codeHash: codeHashes.DaoCore, label: contractLabel, }, @@ -495,16 +579,33 @@ export const InnerCreateDaoForm = ({ 'set contract admin as itself' )! } else { - const { events } = await instantiateWithSelfAdmin( - { - codeId: codeIds.DaoCore, - instantiateMsg: encodeJsonToBase64(instantiateMsg), - label: contractLabel, - }, - CHAIN_GAS_MULTIPLIER, - undefined, - instantiateFunds - ) + if (supportsInstantiate2 && !newDao.predictedDaoAddress) { + throw new Error('Predicted DAO address not found') + } + + const { events } = await (supportsInstantiate2 + ? instantiate2WithSelfAdmin( + { + codeId: daoCoreCodeId, + instantiateMsg: encodeJsonToBase64(instantiateMsg), + label: contractLabel, + salt: toBase64(toUtf8(uuid)), + expect: newDao.predictedDaoAddress, + }, + CHAIN_GAS_MULTIPLIER, + undefined, + instantiateFunds + ) + : instantiateWithSelfAdmin( + { + codeId: daoCoreCodeId, + instantiateMsg: encodeJsonToBase64(instantiateMsg), + label: contractLabel, + }, + CHAIN_GAS_MULTIPLIER, + undefined, + instantiateFunds + )) return findWasmAttributeValue( chainId, events, @@ -561,6 +662,10 @@ export const InnerCreateDaoForm = ({ const contractLabel = `DAO DAO DAO (${Date.now()})` + if (supportsInstantiate2 && !newDao.predictedDaoAddress) { + throw new Error('Predicted DAO address not found') + } + // Redirect to prefilled chain governance prop page. goToDaoProposal(chainGovName, 'create', { prefill: encodeJsonToBase64({ @@ -579,13 +684,18 @@ export const InnerCreateDaoForm = ({ message: JSON.stringify( makeWasmMessage({ wasm: { - instantiate: { + [supportsInstantiate2 + ? 'instantiate2' + : 'instantiate']: { admin: instantiateMsg.admin, - code_id: codeIds.DaoCore, + code_id: daoCoreCodeId, funds: getFundsFromDaoInstantiateMsg(instantiateMsg), label: contractLabel, msg: instantiateMsg, + ...(supportsInstantiate2 && { + salt: toBase64(toUtf8(uuid)), + }), }, }, }), @@ -608,11 +718,17 @@ export const InnerCreateDaoForm = ({ funds: getFundsFromDaoInstantiateMsg(instantiateMsg), msg: { - instantiate_contract_with_self_admin: { - code_id: codeIds.DaoCore, + [supportsInstantiate2 + ? 'instantiate2_contract_with_self_admin' + : 'instantiate_contract_with_self_admin']: { + code_id: daoCoreCodeId, instantiate_msg: encodeJsonToBase64(instantiateMsg), label: contractLabel, + ...(supportsInstantiate2 && { + salt: toBase64(toUtf8(uuid)), + expect: newDao.predictedDaoAddress, + }), }, }, }, @@ -827,7 +943,9 @@ export const InnerCreateDaoForm = ({ commonVotingConfig: loadCommonVotingConfigItems(), availableCreators, creator, + predictedDaoAddress, proposalModuleDaoCreationAdapters, + availableWidgets, makeDefaultNewDao, SuspenseLoader, ImportMultisigModal, diff --git a/packages/stateful/hooks/contracts/CwAdminFactory.ts b/packages/stateful/hooks/contracts/CwAdminFactory.ts index 757eabb6b..db61deb83 100644 --- a/packages/stateful/hooks/contracts/CwAdminFactory.ts +++ b/packages/stateful/hooks/contracts/CwAdminFactory.ts @@ -50,3 +50,6 @@ const wrapExecuteHook = export const useInstantiateWithAdminFactory = wrapExecuteHook( 'instantiateContractWithSelfAdmin' ) +export const useInstantiate2WithAdminFactory = wrapExecuteHook( + 'instantiate2ContractWithSelfAdmin' +) diff --git a/packages/stateful/hooks/useGenerateInstantiate2.ts b/packages/stateful/hooks/useGenerateInstantiate2.ts index 53f85cb97..36d1defee 100644 --- a/packages/stateful/hooks/useGenerateInstantiate2.ts +++ b/packages/stateful/hooks/useGenerateInstantiate2.ts @@ -1,11 +1,12 @@ import { instantiate2Address } from '@cosmjs/cosmwasm-stargate' -import { fromHex, toUtf8 } from '@cosmjs/encoding' +import { toUtf8 } from '@cosmjs/encoding' -import { codeDetailsSelector } from '@dao-dao/state/recoil' -import { useCachedLoadingWithError } from '@dao-dao/stateless' +import { contractQueries } from '@dao-dao/state/query' import { LoadingDataWithError } from '@dao-dao/types' import { getChainForChainId } from '@dao-dao/utils' +import { useQueryLoadingDataWithError } from './query' + export type UseGenerateInstantiate2Options = { chainId: string creator: string @@ -24,18 +25,15 @@ export const useGenerateInstantiate2 = ({ }: UseGenerateInstantiate2Options): LoadingDataWithError => { const chain = getChainForChainId(chainId) - return useCachedLoadingWithError( - // Load checksum of the contract code. - codeDetailsSelector({ - chainId, - codeId, - }), - (data) => - instantiate2Address( - fromHex(data.checksum), - creator, - toUtf8(salt), - chain.bech32_prefix - ) + // Load checksum of the contract code. + return useQueryLoadingDataWithError( + chainId && creator && codeId + ? contractQueries.codeInfo({ + chainId, + codeId, + }) + : undefined, + ({ dataHash }) => + instantiate2Address(dataHash, creator, toUtf8(salt), chain.bech32_prefix) ) } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/actions/UpdatePreProposeConfig/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/actions/UpdatePreProposeConfig/index.tsx index 76b252edc..5bb9dbd04 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/actions/UpdatePreProposeConfig/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalMultiple/common/actions/UpdatePreProposeConfig/index.tsx @@ -289,11 +289,15 @@ export const makeUpdatePreProposeConfigActionMaker = ? { submission_policy: anyoneCanPropose ? { - anyone: {}, + anyone: { + denylist: [], + }, } : { specific: { dao_members: true, + allowlist: [], + denylist: [], }, }, } diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdatePreProposeSingleConfig/index.tsx b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdatePreProposeSingleConfig/index.tsx index 45708586d..9eaddf4ba 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdatePreProposeSingleConfig/index.tsx +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/common/actions/UpdatePreProposeSingleConfig/index.tsx @@ -293,11 +293,15 @@ export const makeUpdatePreProposeSingleConfigActionMaker = ? { submission_policy: anyoneCanPropose ? { - anyone: {}, + anyone: { + denylist: [], + }, } : { specific: { dao_members: true, + allowlist: [], + denylist: [], }, }, } diff --git a/packages/stateful/recoil/atoms/newDao.ts b/packages/stateful/recoil/atoms/newDao.ts index 49cec655d..469609d87 100644 --- a/packages/stateful/recoil/atoms/newDao.ts +++ b/packages/stateful/recoil/atoms/newDao.ts @@ -1,5 +1,6 @@ import cloneDeep from 'lodash.clonedeep' import { atom, atomFamily } from 'recoil' +import { v4 as uuidv4 } from 'uuid' import { localStorageEffectJSON } from '@dao-dao/state/recoil/effects' import { @@ -26,6 +27,7 @@ import { // Avoid cyclic dependencies issues with the adapter modules by using a lazy // maker function. export const makeDefaultNewDao = (chainId: string): NewDao => ({ + uuid: uuidv4(), chainId, name: '', description: '', @@ -82,6 +84,7 @@ export const makeDefaultNewDao = (chainId: string): NewDao => ({ veto: convertCosmosVetoConfigToVeto(null), }, advancedVotingConfigEnabled: false, + widgets: {}, }) export const newDaoAtom = atomFamily< diff --git a/packages/stateful/widgets/core.ts b/packages/stateful/widgets/core.ts index 8b8aec680..102487acd 100644 --- a/packages/stateful/widgets/core.ts +++ b/packages/stateful/widgets/core.ts @@ -14,8 +14,7 @@ export const getWidgets = (chainId: string): readonly Widget[] => RetroactiveCompensationWidget, PressWidget, ].filter( - (widget) => - !widget.supportedChainIds || widget.supportedChainIds.includes(chainId) + (widget) => !widget.isChainSupported || widget.isChainSupported(chainId) ) export const getWidgetById = (chainId: string, id: string) => diff --git a/packages/stateful/widgets/react/useWidgets.tsx b/packages/stateful/widgets/react/useWidgets.tsx index 21860cb75..9201a21ab 100644 --- a/packages/stateful/widgets/react/useWidgets.tsx +++ b/packages/stateful/widgets/react/useWidgets.tsx @@ -12,8 +12,8 @@ import { WidgetVisibilityContext, } from '@dao-dao/types' import { - DAO_WIDGET_ITEM_NAMESPACE, getFilteredDaoItemsByPrefix, + getWidgetStorageItemKey, } from '@dao-dao/utils' import { useMembership } from '../../hooks' @@ -38,7 +38,7 @@ export const useWidgets = ({ const loadingWidgets = useMemo((): LoadingData => { const parsedWidgets = getFilteredDaoItemsByPrefix( items, - DAO_WIDGET_ITEM_NAMESPACE + getWidgetStorageItemKey('') ) .map(([id, widgetJson]): DaoWidget | undefined => { try { diff --git a/packages/stateful/widgets/widgets/MintNft/index.ts b/packages/stateful/widgets/widgets/MintNft/index.ts index 3715c0a77..eb1a7906c 100644 --- a/packages/stateful/widgets/widgets/MintNft/index.ts +++ b/packages/stateful/widgets/widgets/MintNft/index.ts @@ -1,3 +1,5 @@ +import { ImageOutlined, ImageRounded } from '@mui/icons-material' + import { Widget, WidgetId, @@ -11,6 +13,8 @@ import { MintNftData } from './types' export const MintNftWidget: Widget = { id: WidgetId.MintNft, + Icon: ImageOutlined, + IconFilled: ImageRounded, location: WidgetLocation.Home, visibilityContext: WidgetVisibilityContext.Always, defaultValues: { diff --git a/packages/stateful/widgets/widgets/Press/PressEditor.tsx b/packages/stateful/widgets/widgets/Press/PressEditor.tsx index a50c81e7e..b988493fa 100644 --- a/packages/stateful/widgets/widgets/Press/PressEditor.tsx +++ b/packages/stateful/widgets/widgets/Press/PressEditor.tsx @@ -8,41 +8,35 @@ import { Button, CopyableAddress, DaoSupportedChainPickerInput, + useChain, useDaoInfoContext, useSupportedChainContext, } from '@dao-dao/stateless' import { ActionKey, ChainId, WidgetEditorProps } from '@dao-dao/types' import { InstantiateMsg as Cw721InstantiateMsg } from '@dao-dao/types/contracts/Cw721Base' import { - getChainAddressForActionOptions, + getAccountAddress, getSupportedChainConfig, instantiateSmartContract, processError, } from '@dao-dao/utils' -import { useActionOptions } from '../../../actions' import { ConnectWallet } from '../../../components/ConnectWallet' import { useWallet } from '../../../hooks/useWallet' import { PressData } from './types' export const PressEditor = ({ - remove, - addAction, fieldNamePrefix, isCreating, + ...props }: WidgetEditorProps) => { const { t } = useTranslation() - const actionOptions = useActionOptions() - const { config: { polytone }, } = useSupportedChainContext() - const { - name: daoName, - chainId: daoChainId, - polytoneProxies, - } = useDaoInfoContext() + const { chain_id: nativeChainId } = useChain() + const { name: daoName, polytoneProxies } = useDaoInfoContext() const { setValue, setError, clearErrors, watch } = useFormContext() const chainId = watch((fieldNamePrefix + 'chainId') as 'chainId') @@ -51,13 +45,13 @@ export const PressEditor = ({ // Auto-select valid chain ID if undefined. useEffect(() => { const defaultChainId = - daoChainId === ChainId.StargazeMainnet + nativeChainId === ChainId.StargazeMainnet ? Object.keys(polytoneProxies)[0] - : daoChainId + : nativeChainId if (!chainId && defaultChainId) { setValue((fieldNamePrefix + 'chainId') as 'chainId', defaultChainId) } - }, [chainId, daoChainId, setValue, fieldNamePrefix, polytoneProxies]) + }, [chainId, nativeChainId, setValue, fieldNamePrefix, polytoneProxies]) const { address: walletAddress = '', @@ -77,7 +71,10 @@ export const PressEditor = ({ toast.error(t('error.selectAChainToContinue')) return } - const minter = getChainAddressForActionOptions(actionOptions, chainId) + const minter = getAccountAddress({ + accounts: props.accounts, + chainId, + }) if (!minter) { toast.error(t('error.addressNotFoundOnChain')) return @@ -134,8 +131,8 @@ export const PressEditor = ({ }, [setError, clearErrors, t, contract, fieldNamePrefix, chainId]) const stargazeDaoNoCrossChainAccounts = - (daoChainId === ChainId.StargazeMainnet || - daoChainId === ChainId.StargazeTestnet) && + (nativeChainId === ChainId.StargazeMainnet || + nativeChainId === ChainId.StargazeTestnet) && !Object.keys(polytoneProxies).length return ( @@ -144,14 +141,16 @@ export const PressEditor = ({ {isCreating && stargazeDaoNoCrossChainAccounts ? ( <>

- {t('error.stargazeDaoNoCrossChainAccountsForPress')} + {t('error.stargazeDaoNoCrossChainAccountsForPress', { + context: props.type, + })}

- {remove && addAction && ( + {props.type === 'action' && props.remove && props.addAction && (
{unstaking.length > 0 && ( diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index d55d62c82..16c259cdb 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -2175,37 +2175,35 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ mainnet: true, accentColor: '#d71d6a', factoryContractAddress: - 'omniflix13ehuhysn5mqjeaheeuew2gjs785f6k7jm8vfsqg3jhtpkwppcmzqjrdywp', + 'omniflix1zrhumzxl9hexjwh95te3as6fcjv46cty8z8ephtg70f5am3pw46sk93q7l', explorerUrlTemplates: { tx: 'https://ping.pub/omniflixhub/tx/REPLACE', gov: 'https://ping.pub/omniflixhub/gov', govProp: 'https://ping.pub/omniflixhub/gov/REPLACE', wallet: 'https://ping.pub/omniflixhub/account/REPLACE', }, - daoCreatorDisabled: { - // NFT DAOs not yet ready. - [NftBasedCreatorId]: 'underDevelopment', - }, - codeIdsVersion: ContractVersion.V242, + codeIdsVersion: ContractVersion.V250, codeIds: { Cw1Whitelist: 5, Cw4Group: 6, - CwPayrollFactory: 8, - CwTokenSwap: 9, - CwTokenfactoryIssuerMain: 21, - CwVesting: 10, - DaoCore: 11, - DaoMigrator: -1, // not needed since only v2 DAOs exist - DaoPreProposeApprovalSingle: 13, - DaoPreProposeApprover: 14, - DaoPreProposeMultiple: 15, - DaoPreProposeSingle: 16, - DaoProposalMultiple: 17, - DaoProposalSingle: 18, - DaoVotingCw4: 19, - DaoVotingTokenStaked: 22, + CwPayrollFactory: 27, + CwTokenSwap: 28, + CwTokenfactoryIssuerMain: 29, + CwVesting: 30, + DaoCore: 31, + DaoPreProposeApprovalSingle: 32, + DaoPreProposeApprover: 33, + DaoPreProposeMultiple: 34, + DaoPreProposeSingle: 35, + DaoProposalMultiple: 36, + DaoProposalSingle: 37, + DaoRewardsDistributor: 38, + DaoVotingCw4: 39, + DaoVotingOnftStaked: 25, + DaoVotingTokenStaked: 40, // Unused + DaoMigrator: -1, // not needed since only v2 DAOs exist DaoVotingCw721Staked: -1, }, polytone: { From e3055d0a5d1eaa248860305f60cb5365ba886abb Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Tue, 13 Aug 2024 17:51:30 -0400 Subject: [PATCH 409/438] bumped version to v2.5.0-rc.2 --- apps/dapp/package.json | 16 ++++++++-------- apps/sda/package.json | 16 ++++++++-------- lerna.json | 2 +- package.json | 4 ++-- packages/config/package.json | 2 +- packages/dispatch/package.json | 10 +++++----- packages/email/package.json | 6 +++--- packages/i18n/package.json | 4 ++-- packages/state/package.json | 8 ++++---- packages/stateful/package.json | 16 ++++++++-------- packages/stateless/package.json | 12 ++++++------ packages/storybook/package.json | 16 ++++++++-------- packages/types/package.json | 4 ++-- packages/utils/package.json | 6 +++--- 14 files changed, 61 insertions(+), 61 deletions(-) diff --git a/apps/dapp/package.json b/apps/dapp/package.json index 0cfdbc4eb..185c9d068 100644 --- a/apps/dapp/package.json +++ b/apps/dapp/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/dapp", - "version": "2.5.0-rc.1", + "version": "2.5.0-rc.2", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -20,12 +20,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.5.0-rc.1", - "@dao-dao/state": "2.5.0-rc.1", - "@dao-dao/stateful": "2.5.0-rc.1", - "@dao-dao/stateless": "2.5.0-rc.1", - "@dao-dao/types": "2.5.0-rc.1", - "@dao-dao/utils": "2.5.0-rc.1", + "@dao-dao/i18n": "2.5.0-rc.2", + "@dao-dao/state": "2.5.0-rc.2", + "@dao-dao/stateful": "2.5.0-rc.2", + "@dao-dao/stateless": "2.5.0-rc.2", + "@dao-dao/types": "2.5.0-rc.2", + "@dao-dao/utils": "2.5.0-rc.2", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -52,7 +52,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.5.0-rc.1", + "@dao-dao/config": "2.5.0-rc.2", "@next/bundle-analyzer": "^14.1.0", "@playwright/test": "^1.44.1", "@sentry/cli": "^2.21.3", diff --git a/apps/sda/package.json b/apps/sda/package.json index e5d77c2dc..398e0924c 100644 --- a/apps/sda/package.json +++ b/apps/sda/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/sda", - "version": "2.5.0-rc.1", + "version": "2.5.0-rc.2", "license": "AGPL-3.0-only", "scripts": { "analyze": "ANALYZE=true next build", @@ -17,12 +17,12 @@ "ts:watch": "ts --watch" }, "dependencies": { - "@dao-dao/i18n": "2.5.0-rc.1", - "@dao-dao/state": "2.5.0-rc.1", - "@dao-dao/stateful": "2.5.0-rc.1", - "@dao-dao/stateless": "2.5.0-rc.1", - "@dao-dao/types": "2.5.0-rc.1", - "@dao-dao/utils": "2.5.0-rc.1", + "@dao-dao/i18n": "2.5.0-rc.2", + "@dao-dao/state": "2.5.0-rc.2", + "@dao-dao/stateful": "2.5.0-rc.2", + "@dao-dao/stateless": "2.5.0-rc.2", + "@dao-dao/types": "2.5.0-rc.2", + "@dao-dao/utils": "2.5.0-rc.2", "@fontsource/inter": "^4.5.7", "@fontsource/jetbrains-mono": "^4.5.5", "@keplr-wallet/common": "^0.11.49", @@ -48,7 +48,7 @@ "sharp": "^0.31.1" }, "devDependencies": { - "@dao-dao/config": "2.5.0-rc.1", + "@dao-dao/config": "2.5.0-rc.2", "@next/bundle-analyzer": "^12.1.0", "@sentry/cli": "^2.21.3", "@solana/web3.js": "^1.75.0", diff --git a/lerna.json b/lerna.json index e13b7b1b3..bcb19d055 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", "useWorkspaces": true, - "version": "2.5.0-rc.1" + "version": "2.5.0-rc.2" } diff --git a/package.json b/package.json index 2f2356310..e89287105 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dao-dao-ui", - "version": "2.5.0-rc.1", + "version": "2.5.0-rc.2", "workspaces": [ "apps/*", "packages/*" @@ -26,7 +26,7 @@ "utils": "yarn workspace @dao-dao/utils", "email": "yarn workspace @dao-dao/email", "dispatch": "yarn workspace @dao-dao/dispatch", - "publish-all": "lerna publish --no-private from-package" + "publish-all": "find . -name '*.log' -delete && lerna publish --no-private from-package" }, "devDependencies": { "@types/jest": "^29.5.0", diff --git a/packages/config/package.json b/packages/config/package.json index b2b2ae210..b9f9e69f1 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/config", - "version": "2.5.0-rc.1", + "version": "2.5.0-rc.2", "license": "BSD-3-Clause-Clear", "scripts": { "cwgen": "ts-node ./scripts/cwgen.ts" diff --git a/packages/dispatch/package.json b/packages/dispatch/package.json index 098a66d10..dfd02e96c 100644 --- a/packages/dispatch/package.json +++ b/packages/dispatch/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/dispatch", - "version": "2.5.0-rc.1", + "version": "2.5.0-rc.2", "license": "BSD-3-Clause-Clear", "private": true, "scripts": { @@ -11,10 +11,10 @@ }, "devDependencies": { "@confio/relayer": "^0.12.0", - "@dao-dao/config": "2.5.0-rc.1", - "@dao-dao/state": "2.5.0-rc.1", - "@dao-dao/types": "2.5.0-rc.1", - "@dao-dao/utils": "2.5.0-rc.1", + "@dao-dao/config": "2.5.0-rc.2", + "@dao-dao/state": "2.5.0-rc.2", + "@dao-dao/types": "2.5.0-rc.2", + "@dao-dao/utils": "2.5.0-rc.2", "chalk": "^4", "commander": "^11.0.0", "dotenv": "^16.4.5", diff --git a/packages/email/package.json b/packages/email/package.json index 41cdb9c1d..7927146e7 100644 --- a/packages/email/package.json +++ b/packages/email/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/email", - "version": "2.5.0-rc.1", + "version": "2.5.0-rc.2", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -10,8 +10,8 @@ }, "devDependencies": { "@aws-sdk/client-ses": "^3.592.0", - "@dao-dao/config": "2.5.0-rc.1", - "@dao-dao/types": "2.5.0-rc.1", + "@dao-dao/config": "2.5.0-rc.2", + "@dao-dao/types": "2.5.0-rc.2", "@react-email/components": "^0.0.7", "@react-email/render": "0.0.7", "commander": "^11.0.0", diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 872dd3a7e..31986fdb5 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/i18n", - "version": "2.5.0-rc.1", + "version": "2.5.0-rc.2", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -17,7 +17,7 @@ "react-i18next": "^11.0.0" }, "devDependencies": { - "@dao-dao/config": "2.5.0-rc.1", + "@dao-dao/config": "2.5.0-rc.2", "eslint-plugin-i18n-json": "^3.1.0", "i18n-unused": "^0.10.0" }, diff --git a/packages/state/package.json b/packages/state/package.json index e397f7d6f..3bb803039 100644 --- a/packages/state/package.json +++ b/packages/state/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/state", - "version": "2.5.0-rc.1", + "version": "2.5.0-rc.2", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc && npm run build:gql", @@ -17,7 +17,7 @@ "@cosmjs/proto-signing": "^0.32.3", "@cosmjs/stargate": "^0.32.3", "@cosmjs/tendermint-rpc": "^0.32.3", - "@dao-dao/utils": "2.5.0-rc.1", + "@dao-dao/utils": "2.5.0-rc.2", "@tanstack/react-query": "^5.40.0", "graphql": "^16.8.1", "json5": "^2.2.0", @@ -29,8 +29,8 @@ }, "devDependencies": { "@chain-registry/types": "^0.41.3", - "@dao-dao/config": "2.5.0-rc.1", - "@dao-dao/types": "2.5.0-rc.1", + "@dao-dao/config": "2.5.0-rc.2", + "@dao-dao/types": "2.5.0-rc.2", "@graphql-codegen/cli": "^5.0.0", "@graphql-codegen/client-preset": "^4.1.0", "@graphql-typed-document-node/core": "^3.2.0", diff --git a/packages/stateful/package.json b/packages/stateful/package.json index 22e33ab83..8b586e861 100644 --- a/packages/stateful/package.json +++ b/packages/stateful/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateful", - "version": "2.5.0-rc.1", + "version": "2.5.0-rc.2", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -39,10 +39,10 @@ "@cosmos-kit/vectis": "^2.9.0", "@cosmos-kit/web3auth": "^2.8.0", "@cosmos-kit/xdefi": "^2.8.0", - "@dao-dao/i18n": "2.5.0-rc.1", - "@dao-dao/state": "2.5.0-rc.1", - "@dao-dao/stateless": "2.5.0-rc.1", - "@dao-dao/utils": "2.5.0-rc.1", + "@dao-dao/i18n": "2.5.0-rc.2", + "@dao-dao/state": "2.5.0-rc.2", + "@dao-dao/stateless": "2.5.0-rc.2", + "@dao-dao/utils": "2.5.0-rc.2", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -80,9 +80,9 @@ "devDependencies": { "@chain-registry/types": "^0.41.3", "@cosmjs/amino": "^0.32.3", - "@dao-dao/config": "2.5.0-rc.1", + "@dao-dao/config": "2.5.0-rc.2", "@dao-dao/cosmiframe": "0.1.0", - "@dao-dao/types": "2.5.0-rc.1", + "@dao-dao/types": "2.5.0-rc.2", "@storybook/react": "^6.5.10", "@types/file-saver": "^2.0.5", "@types/lodash.clonedeep": "^4.5.0", @@ -103,7 +103,7 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/storybook": "2.5.0-rc.1", + "@dao-dao/storybook": "2.5.0-rc.2", "next": "^12 || ^13", "react": "^17 || ^18" }, diff --git a/packages/stateless/package.json b/packages/stateless/package.json index 13e4f8e46..5280ad092 100644 --- a/packages/stateless/package.json +++ b/packages/stateless/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/stateless", - "version": "2.5.0-rc.1", + "version": "2.5.0-rc.2", "license": "BSD-3-Clause-Clear", "scripts": { "build": "tsc", @@ -9,8 +9,8 @@ }, "dependencies": { "@cosmjs/encoding": "^0.32.3", - "@dao-dao/types": "2.5.0-rc.1", - "@dao-dao/utils": "2.5.0-rc.1", + "@dao-dao/types": "2.5.0-rc.2", + "@dao-dao/utils": "2.5.0-rc.2", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/icons-material": "^5.10.3", @@ -47,7 +47,7 @@ "devDependencies": { "@chain-registry/types": "^0.41.3", "@cosmos-kit/core": "^2.11.0", - "@dao-dao/config": "2.5.0-rc.1", + "@dao-dao/config": "2.5.0-rc.2", "@storybook/react": "^6.5.10", "@types/lodash.clonedeep": "^4.5.0", "@types/react": "^17.0.37", @@ -70,8 +70,8 @@ "unist-util-visit-parents": "^5.1.3" }, "peerDependencies": { - "@dao-dao/stateful": "2.5.0-rc.1", - "@dao-dao/storybook": "2.5.0-rc.1", + "@dao-dao/stateful": "2.5.0-rc.2", + "@dao-dao/storybook": "2.5.0-rc.2", "next": "^12 || ^13", "react": "^17 || ^18", "react-dom": "^17 || ^18" diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 3c1e6474b..4a4ae0735 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/storybook", - "version": "2.5.0-rc.1", + "version": "2.5.0-rc.2", "license": "BSD-3-Clause-Clear", "scripts": { "build": "build-storybook", @@ -8,10 +8,10 @@ "generate": "ts-node --esm ./scripts/generate.ts" }, "devDependencies": { - "@dao-dao/config": "2.5.0-rc.1", - "@dao-dao/i18n": "2.5.0-rc.1", - "@dao-dao/types": "2.5.0-rc.1", - "@dao-dao/utils": "2.5.0-rc.1", + "@dao-dao/config": "2.5.0-rc.2", + "@dao-dao/i18n": "2.5.0-rc.2", + "@dao-dao/types": "2.5.0-rc.2", + "@dao-dao/utils": "2.5.0-rc.2", "@storybook/addon-actions": "^6.5.12", "@storybook/addon-essentials": "^6.5.12", "@storybook/addon-links": "^6.5.12", @@ -46,9 +46,9 @@ "typescript": "5.3.3" }, "peerDependencies": { - "@dao-dao/state": "2.5.0-rc.1", - "@dao-dao/stateful": "2.5.0-rc.1", - "@dao-dao/stateless": "2.5.0-rc.1" + "@dao-dao/state": "2.5.0-rc.2", + "@dao-dao/stateful": "2.5.0-rc.2", + "@dao-dao/stateless": "2.5.0-rc.2" }, "prettier": "@dao-dao/config/prettier", "gitHead": "d7b959f412c3990123b0e2afb11f32acd9c3764c" diff --git a/packages/types/package.json b/packages/types/package.json index 2a4a996f3..ff93fc14e 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/types", - "version": "2.5.0-rc.1", + "version": "2.5.0-rc.2", "license": "BSD-3-Clause-Clear", "scripts": { "lint": "eslint .", @@ -24,7 +24,7 @@ "devDependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.3", "@cosmology/telescope": "^1.8.3", - "@dao-dao/config": "2.5.0-rc.1", + "@dao-dao/config": "2.5.0-rc.2", "@tanstack/react-query": "^5.40.0" }, "peerDependencies": { diff --git a/packages/utils/package.json b/packages/utils/package.json index 988173e23..9acb8d0f6 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@dao-dao/utils", - "version": "2.5.0-rc.1", + "version": "2.5.0-rc.2", "license": "BSD-3-Clause-Clear", "scripts": { "format": "eslint . --fix", @@ -17,7 +17,7 @@ "@cosmjs/encoding": "^0.32.3", "@cosmjs/stargate": "^0.32.3", "@cosmjs/tendermint-rpc": "^0.32.3", - "@dao-dao/types": "2.5.0-rc.1", + "@dao-dao/types": "2.5.0-rc.2", "@sentry/nextjs": "^7.7.0", "@types/lodash.clonedeep": "^4.5.0", "@types/ripemd160": "^2.0.0", @@ -42,7 +42,7 @@ "devDependencies": { "@chain-registry/types": "^0.41.3", "@cosmjs/proto-signing": "^0.32.3", - "@dao-dao/config": "2.5.0-rc.1", + "@dao-dao/config": "2.5.0-rc.2", "@tanstack/react-query": "^5.40.0", "@types/luxon": "^3.4.2", "@types/pako": "^2.0.3", From 287a85aeaf5154544d0d541b97a764d6a164c560 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 15 Aug 2024 18:54:54 -0400 Subject: [PATCH 410/438] fixed vesting payment setup on DAO creation --- .../VestingPayments/VestingPaymentsEditor.tsx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/stateful/widgets/widgets/VestingPayments/VestingPaymentsEditor.tsx b/packages/stateful/widgets/widgets/VestingPayments/VestingPaymentsEditor.tsx index 4b6526a87..535ac5569 100644 --- a/packages/stateful/widgets/widgets/VestingPayments/VestingPaymentsEditor.tsx +++ b/packages/stateful/widgets/widgets/VestingPayments/VestingPaymentsEditor.tsx @@ -52,13 +52,18 @@ export const VestingPaymentsEditor = ( // A DAO can create a vesting payment factory on the current chain and any // polytone connection that is also a supported chain (since the vesting - // factory+contract only exists on supported chains). - const possibleChainIds = [ - nativeChainId, - ...Object.keys(polytone).filter((chainId) => - getSupportedChainConfig(chainId) - ), - ] + // factory+contract only exists on supported chains). When creating a DAO, no + // cross-chain accounts exist or can be created, so only show the native + // chain. + const possibleChainIds = + props.type === 'daoCreation' + ? [nativeChainId] + : [ + nativeChainId, + ...Object.keys(polytone).filter((chainId) => + getSupportedChainConfig(chainId) + ), + ] // Prevent action from being submitted if the vesting factories map does not // exist. From 337aaa03b2ea954e4e31f6f042fd80755d2182fd Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 15 Aug 2024 19:23:34 -0400 Subject: [PATCH 411/438] remove duplicate cosmos hub --- apps/dapp/pages/[[...tab]].tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/dapp/pages/[[...tab]].tsx b/apps/dapp/pages/[[...tab]].tsx index 1ec3c3fc4..45a067029 100644 --- a/apps/dapp/pages/[[...tab]].tsx +++ b/apps/dapp/pages/[[...tab]].tsx @@ -15,7 +15,7 @@ import { StatefulHomeProps, daoQueries as statefulDaoQueries, } from '@dao-dao/stateful' -import { AccountTabId, ChainId, DaoDaoIndexerChainStats } from '@dao-dao/types' +import { AccountTabId, DaoDaoIndexerChainStats } from '@dao-dao/types' import { MAINNET, chainIsIndexed, @@ -47,8 +47,6 @@ export const getStaticProps: GetStaticProps = async ({ : [getDaoInfoForChainId(chainId, [])] : // Get chain x/gov DAOs if not on a chain-specific home. [ - // Start with Cosmos Hub on mainnet. - ...(MAINNET ? [ChainId.CosmosHubMainnet] : []), // Add DAO DAO-supported chains. ...getSupportedChains().flatMap(({ chainId, noGov }) => noGov ? [] : chainId From f3981d4f81647f7b465996a3c8717ba47f1117e6 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 16 Aug 2024 16:46:34 -0400 Subject: [PATCH 412/438] fixed secret network accounts fail to load --- packages/state/query/queries/contract.ts | 6 +++++ packages/stateful/actions/react/provider.tsx | 24 +++++++++----------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/packages/state/query/queries/contract.ts b/packages/state/query/queries/contract.ts index 77b14393a..1eb96c2e3 100644 --- a/packages/state/query/queries/contract.ts +++ b/packages/state/query/queries/contract.ts @@ -136,6 +136,12 @@ export const fetchIsContract = async ( return false } + // On Secret Network, just return, since there are weird failures for + // failed contract queries. + if (isSecretNetwork(chainId)) { + return false + } + // Rethrow other errors because it should not have failed. throw err } diff --git a/packages/stateful/actions/react/provider.tsx b/packages/stateful/actions/react/provider.tsx index aa89635b7..fc9b68e80 100644 --- a/packages/stateful/actions/react/provider.tsx +++ b/packages/stateful/actions/react/provider.tsx @@ -1,7 +1,9 @@ +import { useQueryClient } from '@tanstack/react-query' import { useMemo } from 'react' import { useTranslation } from 'react-i18next' import { waitForAll } from 'recoil' +import { accountQueries } from '@dao-dao/state/query' import { accountsSelector, govParamsSelector, @@ -30,7 +32,7 @@ import { WalletActionsProviderProps, } from '@dao-dao/types' -import { useProfile } from '../../hooks' +import { useProfile, useQueryLoadingDataWithError } from '../../hooks' import { useWallet } from '../../hooks/useWallet' import { matchAndLoadCommon } from '../../proposal-module-adapter' import { useVotingModuleAdapter } from '../../voting-module-adapter' @@ -195,25 +197,21 @@ export const WalletActionsProvider = ({ const { profile } = useProfile({ address }) - const accounts = useCachedLoadingWithError( + const queryClient = useQueryClient() + const accounts = useQueryLoadingDataWithError( address - ? accountsSelector({ + ? accountQueries.list(queryClient, { chainId: chain.chain_id, address, }) : undefined ) - if ( - address === undefined || - profile.loading || - accounts.loading || - accounts.errored - ) { - return - } - - return ( + return address === undefined || profile.loading || accounts.loading ? ( + + ) : accounts.errored ? ( + + ) : ( Date: Sat, 17 Aug 2024 13:48:16 -0400 Subject: [PATCH 413/438] updated secret network code IDs/hashes and fixed hook error --- .../hooks/query/useQueryLoadingData.ts | 22 ++++++++++++----- .../query/useQueryLoadingDataWithError.ts | 24 +++++++++++++------ .../stateful/hooks/useGenerateInstantiate2.ts | 8 +++++-- packages/utils/constants/chains.ts | 8 +++---- 4 files changed, 43 insertions(+), 19 deletions(-) diff --git a/packages/stateful/hooks/query/useQueryLoadingData.ts b/packages/stateful/hooks/query/useQueryLoadingData.ts index 68d0032e5..2230174ac 100644 --- a/packages/stateful/hooks/query/useQueryLoadingData.ts +++ b/packages/stateful/hooks/query/useQueryLoadingData.ts @@ -64,12 +64,22 @@ export const useQueryLoadingData = < data: memoizedDefaultValue, } } else { - return { - loading: false, - updating: isRefetching, - data: transformRef.current - ? transformRef.current(data) - : (data as unknown as TTransformedData), + try { + return { + loading: false, + updating: isRefetching, + data: transformRef.current + ? transformRef.current(data) + : (data as unknown as TTransformedData), + } + + // Catch errors in `transform` function. + } catch (err) { + onErrorRef.current?.(err instanceof Error ? err : new Error(`${err}`)) + return { + loading: false, + data: memoizedDefaultValue, + } } } }, [ diff --git a/packages/stateful/hooks/query/useQueryLoadingDataWithError.ts b/packages/stateful/hooks/query/useQueryLoadingDataWithError.ts index aed148147..0ec10a36c 100644 --- a/packages/stateful/hooks/query/useQueryLoadingDataWithError.ts +++ b/packages/stateful/hooks/query/useQueryLoadingDataWithError.ts @@ -46,13 +46,23 @@ export const useQueryLoadingDataWithError = < error, } } else { - return { - loading: false, - errored: false, - updating: isRefetching, - data: transformRef.current - ? transformRef.current(data) - : (data as unknown as TTransformedData), + try { + return { + loading: false, + errored: false, + updating: isRefetching, + data: transformRef.current + ? transformRef.current(data) + : (data as unknown as TTransformedData), + } + + // Catch errors in `transform` function. + } catch (err) { + return { + loading: false, + errored: true, + error: err instanceof Error ? err : new Error(`${err}`), + } } } }, [isPending, isError, isRefetching, data, error, transformRef]) diff --git a/packages/stateful/hooks/useGenerateInstantiate2.ts b/packages/stateful/hooks/useGenerateInstantiate2.ts index 36d1defee..2a02b9e5f 100644 --- a/packages/stateful/hooks/useGenerateInstantiate2.ts +++ b/packages/stateful/hooks/useGenerateInstantiate2.ts @@ -3,7 +3,7 @@ import { toUtf8 } from '@cosmjs/encoding' import { contractQueries } from '@dao-dao/state/query' import { LoadingDataWithError } from '@dao-dao/types' -import { getChainForChainId } from '@dao-dao/utils' +import { getChainForChainId, isSecretNetwork } from '@dao-dao/utils' import { useQueryLoadingDataWithError } from './query' @@ -27,7 +27,11 @@ export const useGenerateInstantiate2 = ({ // Load checksum of the contract code. return useQueryLoadingDataWithError( - chainId && creator && codeId + chainId && + creator && + codeId && + // Instantiate2 not supported on Secret Network, so just don't load. + !isSecretNetwork(chainId) ? contractQueries.codeInfo({ chainId, codeId, diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 16c259cdb..7049a3121 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -2659,8 +2659,8 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ DaoPreProposeApprover: 9764, DaoPreProposeMultiple: 9748, DaoPreProposeSingle: 9798, - DaoProposalMultiple: 10055, - DaoProposalSingle: 10054, + DaoProposalMultiple: 10058, + DaoProposalSingle: 10057, DaoVotingCw4: 9790, DaoVotingCw20Staked: 9793, // snip20 DaoVotingCw721Staked: 9767, // snip721 @@ -2697,9 +2697,9 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ DaoPreProposeSingle: 'e10ae1c3c1ffd3fb3102ed12b6daf0a854885257cca1ad0051ef0dbf992d50fc', DaoProposalMultiple: - 'abe4630509aeda95d1613e22d579b009ae5fe7a6b83f0476d8ca0f69343998b7', + '00a5268893a57795c54f6a1d74cc722160ada0c499808078923c02ac93418d21', DaoProposalSingle: - '6cd22250c1756dc00b9cc0dbad81907547b0e8db8cde51becb2486c21d323f6d', + '397df138ed1ce0b46b0d5e8dde6078c6e7a9bbab3eee03648f880422cd0f161c', DaoVotingCw4: 'a0f4f3069d8bb0789d90829052c32ec93d16eb1113feb4063f5265c3bda3f6f7', DaoVotingCw20Staked: From 9224c79d1fa1e3f50e36fe9032a33f3c49831e3d Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 28 Aug 2024 17:19:01 +0300 Subject: [PATCH 414/438] fixed chain x/gov DAO sidebar nav match other DAOs on that chain --- packages/stateless/components/dao/DaoDropdown.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/stateless/components/dao/DaoDropdown.tsx b/packages/stateless/components/dao/DaoDropdown.tsx index 0d420fb6a..7c3d517af 100644 --- a/packages/stateless/components/dao/DaoDropdown.tsx +++ b/packages/stateless/components/dao/DaoDropdown.tsx @@ -22,7 +22,13 @@ export const DaoDropdown = ({ const { getDaoPath } = useDaoNavHelpers() const href = getDaoPath(coreAddress) - const selected = asPath.startsWith(href) + // Ensure no more alphanumeric characters follow DAO address in URL. This + // regex should look something like `^/dao/cosmos\b.*`, to ensure that DAOs + // whose addresses are prefixes of other DAO addresses do not match. This + // ensures that a chain x/gov DAO does not show as selected when a DAO on that + // chain is selected, since a DAO's address prefix may start with the name of + // the chain x/gov DAO itself. + const selected = new RegExp(`^${href}\\b.*`).test(asPath) // If compact, just show image. return compact ? ( From f3f13cdfcc3b86c4e5dda8c42e950556fcdc35d7 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 28 Aug 2024 17:25:05 +0300 Subject: [PATCH 415/438] fix skip route error detection --- packages/state/recoil/selectors/skip.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/state/recoil/selectors/skip.ts b/packages/state/recoil/selectors/skip.ts index 5f7c44210..ec81611bd 100644 --- a/packages/state/recoil/selectors/skip.ts +++ b/packages/state/recoil/selectors/skip.ts @@ -162,7 +162,12 @@ export const skipRouteSelector = selectorFamily< throw new Error('No recommended asset found.') } - const route: SkipRoute = await ( + const route: + | SkipRoute + | { + code: number + message: string + } = await ( await fetch(SKIP_API_BASE + '/v2/fungible/route', { method: 'POST', headers: { @@ -178,6 +183,10 @@ export const skipRouteSelector = selectorFamily< }) ).json() + if ('code' in route && 'message' in route) { + throw new Error(`Skip API error: ${route.message}`) + } + if (route.does_swap) { throw new Error('Route requires a swap.') } From 7f2ef51ea51f9992cfd1cb8558116e66f3243255 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 28 Aug 2024 17:35:57 +0300 Subject: [PATCH 416/438] fixed null approver proposal number --- .../adapters/DaoProposalSingle/selectors.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/selectors.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/selectors.ts index 175ff378b..01d4897fc 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/selectors.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/selectors.ts @@ -87,6 +87,14 @@ export const approverIdForPreProposeApprovalIdSelector = selectorFamily< ]) ) + // If no proposal number found, approver must not have been setup when + // this pre-propose approval proposal was created. + if (!approverProposalNumber) { + throw new Error( + 'no approver proposal created for this pre-propose approval proposal' + ) + } + // Get prefix of proposal module with dao-pre-propose-approver attached // so we can link to the approver proposal. const approverDaoApproverProposalModulePrefix = From 25de4687350bbcdeb133627f64fde9009983ad79 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Wed, 28 Aug 2024 17:38:31 +0300 Subject: [PATCH 417/438] fixed type --- .../adapters/DaoProposalSingle/selectors.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/selectors.ts b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/selectors.ts index 01d4897fc..c3e6f3698 100644 --- a/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/selectors.ts +++ b/packages/stateful/proposal-module-adapter/adapters/DaoProposalSingle/selectors.ts @@ -83,7 +83,7 @@ export const approverIdForPreProposeApprovalIdSelector = selectorFamily< }, }, ], - }) as RecoilValueReadOnly, + }) as RecoilValueReadOnly, ]) ) From 38e70d3065bbcdec8f340afd4a762d8495f7b48e Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 29 Aug 2024 20:08:10 +0300 Subject: [PATCH 418/438] convert neutron voting registry and vault queries from recoil to react query to fix load failure issues --- packages/state/contracts/NeutronVault.ts | 18 +- .../queries/contracts/NeutronVault.extra.ts | 127 +++++++ .../query/queries/contracts/NeutronVault.ts | 359 ++++++++++++++++++ .../contracts/NeutronVotingRegistry.extra.ts | 72 ++++ .../contracts/NeutronVotingRegistry.ts | 121 +++--- .../state/query/queries/contracts/index.ts | 3 + .../selectors/contracts/NeutronVault.ts | 257 +------------ .../contracts/NeutronVotingRegistry.ts | 176 --------- .../state/recoil/selectors/contracts/index.ts | 2 - .../components/dao/DaoVotingVaultCard.tsx | 50 +-- .../components/ProfileCardMemberInfo.tsx | 65 ++-- .../components/StakingModal.tsx | 35 +- .../components/VaultsTab.tsx | 17 +- .../hooks/useMainDaoInfoCards.tsx | 50 +-- .../hooks/useVotingModule.ts | 72 +--- .../ProfileCardMemberInfoTokens.tsx | 11 +- packages/types/contracts/NeutronVault.ts | 14 +- packages/types/dao.ts | 1 + packages/utils/conversion.ts | 14 +- 19 files changed, 772 insertions(+), 692 deletions(-) create mode 100644 packages/state/query/queries/contracts/NeutronVault.extra.ts create mode 100644 packages/state/query/queries/contracts/NeutronVault.ts create mode 100644 packages/state/query/queries/contracts/NeutronVotingRegistry.extra.ts delete mode 100644 packages/state/recoil/selectors/contracts/NeutronVotingRegistry.ts diff --git a/packages/state/contracts/NeutronVault.ts b/packages/state/contracts/NeutronVault.ts index 92a877342..7fa8435d0 100644 --- a/packages/state/contracts/NeutronVault.ts +++ b/packages/state/contracts/NeutronVault.ts @@ -1,5 +1,5 @@ /** - * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -11,14 +11,18 @@ import { SigningCosmWasmClient, } from '@cosmjs/cosmwasm-stargate' -import { Addr, InfoResponse, Uint128 } from '@dao-dao/types' import { + Addr, ArrayOfTupleOfAddrAndUint128, BondingStatusResponse, Config, + InfoResponse, + String, TotalPowerAtHeightResponse, + Uint128, VotingPowerAtHeightResponse, } from '@dao-dao/types/contracts/NeutronVault' +import { CHAIN_GAS_MULTIPLIER } from '@dao-dao/utils' export interface NeutronVaultReadOnlyInterface { contractAddress: string @@ -57,7 +61,6 @@ export interface NeutronVaultReadOnlyInterface { export class NeutronVaultQueryClient implements NeutronVaultReadOnlyInterface { client: CosmWasmClient contractAddress: string - constructor(client: CosmWasmClient, contractAddress: string) { this.client = client this.contractAddress = contractAddress @@ -71,7 +74,6 @@ export class NeutronVaultQueryClient implements NeutronVaultReadOnlyInterface { this.listBonders = this.listBonders.bind(this) this.info = this.info.bind(this) } - config = async (): Promise => { return this.client.queryContractSmart(this.contractAddress, { config: {}, @@ -191,7 +193,6 @@ export class NeutronVaultClient client: SigningCosmWasmClient sender: string contractAddress: string - constructor( client: SigningCosmWasmClient, sender: string, @@ -205,7 +206,6 @@ export class NeutronVaultClient this.bond = this.bond.bind(this) this.unbond = this.unbond.bind(this) } - updateConfig = async ( { description, @@ -216,7 +216,7 @@ export class NeutronVaultClient name: string owner: string }, - fee: number | StdFee | 'auto' = 'auto', + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, _funds?: Coin[] ): Promise => { @@ -236,7 +236,7 @@ export class NeutronVaultClient ) } bond = async ( - fee: number | StdFee | 'auto' = 'auto', + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, _funds?: Coin[] ): Promise => { @@ -257,7 +257,7 @@ export class NeutronVaultClient }: { amount: Uint128 }, - fee: number | StdFee | 'auto' = 'auto', + fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER, memo?: string, _funds?: Coin[] ): Promise => { diff --git a/packages/state/query/queries/contracts/NeutronVault.extra.ts b/packages/state/query/queries/contracts/NeutronVault.extra.ts new file mode 100644 index 000000000..a1b34957c --- /dev/null +++ b/packages/state/query/queries/contracts/NeutronVault.extra.ts @@ -0,0 +1,127 @@ +import { QueryClient, queryOptions } from '@tanstack/react-query' + +import { GenericToken, TokenType } from '@dao-dao/types' + +import { tokenQueries } from '../token' +import { neutronVaultQueries } from './NeutronVault' + +/** + * Fetch whether or not this is a virtual vault. + */ +export const fetchNeutronVaultIsVirtual = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise => { + try { + await queryClient.fetchQuery( + neutronVaultQueries.listBonders({ + chainId, + contractAddress: address, + args: { + limit: 1, + }, + }) + ) + } catch (err) { + // Virtual vaults don't allow bonding. + return ( + err instanceof Error && + err.message.includes('Bonding is not available for this contract') + ) + } + + return false +} + +/** + * Determine if this vault is real or virtual, and retrieve the bond token if + * it's real. + */ +export const fetchNeutronVaultInfo = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise< + // Real vaults have bond tokens. + | { + real: true + bondToken: GenericToken + } + // Virtual vaults do not have bond tokens. + | { + real: false + } +> => { + const isVirtual = await queryClient.fetchQuery( + neutronVaultExtraQueries.isVirtual(queryClient, { + chainId, + address, + }) + ) + if (isVirtual) { + return { + real: false, + } + } + + const config = await queryClient.fetchQuery( + neutronVaultQueries.config({ + chainId, + contractAddress: address, + }) + ) + + if (!('denom' in config)) { + throw new Error('No denom for real vault') + } + + const bondToken = await queryClient.fetchQuery( + tokenQueries.info(queryClient, { + type: TokenType.Native, + chainId, + denomOrAddress: config.denom, + }) + ) + + return { + real: true, + bondToken, + } +} + +export const neutronVaultExtraQueries = { + /** + * Check whether or not this is a virtual vault. + */ + isVirtual: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['neutronVaultExtra', 'isVirtual', options], + queryFn: () => fetchNeutronVaultIsVirtual(queryClient, options), + }), + /** + * Determine if this vault is real or virtual, and retrieve the bond token if + * it's real. + */ + info: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['neutronVaultExtra', 'info', options], + queryFn: () => fetchNeutronVaultInfo(queryClient, options), + }), +} diff --git a/packages/state/query/queries/contracts/NeutronVault.ts b/packages/state/query/queries/contracts/NeutronVault.ts new file mode 100644 index 000000000..c072d7bcb --- /dev/null +++ b/packages/state/query/queries/contracts/NeutronVault.ts @@ -0,0 +1,359 @@ +/** + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import { UseQueryOptions } from '@tanstack/react-query' + +import { + Addr, + ArrayOfTupleOfAddrAndUint128, + BondingStatusResponse, + Config, + InfoResponse, + String, + TotalPowerAtHeightResponse, + VotingPowerAtHeightResponse, +} from '@dao-dao/types/contracts/NeutronVault' +import { getCosmWasmClientForChainId } from '@dao-dao/utils' + +import { NeutronVaultQueryClient } from '../../../contracts/NeutronVault' +import { contractQueries } from '../contract' + +export const neutronVaultQueryKeys = { + contract: [ + { + contract: 'neutronVault', + }, + ] as const, + address: (chainId: string, contractAddress: string) => + [ + { + ...neutronVaultQueryKeys.contract[0], + chainId, + address: contractAddress, + }, + ] as const, + config: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...neutronVaultQueryKeys.address(chainId, contractAddress)[0], + method: 'config', + args, + }, + ] as const, + votingPowerAtHeight: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...neutronVaultQueryKeys.address(chainId, contractAddress)[0], + method: 'voting_power_at_height', + args, + }, + ] as const, + totalPowerAtHeight: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...neutronVaultQueryKeys.address(chainId, contractAddress)[0], + method: 'total_power_at_height', + args, + }, + ] as const, + bondingStatus: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...neutronVaultQueryKeys.address(chainId, contractAddress)[0], + method: 'bonding_status', + args, + }, + ] as const, + dao: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...neutronVaultQueryKeys.address(chainId, contractAddress)[0], + method: 'dao', + args, + }, + ] as const, + name: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...neutronVaultQueryKeys.address(chainId, contractAddress)[0], + method: 'name', + args, + }, + ] as const, + description: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...neutronVaultQueryKeys.address(chainId, contractAddress)[0], + method: 'description', + args, + }, + ] as const, + listBonders: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...neutronVaultQueryKeys.address(chainId, contractAddress)[0], + method: 'list_bonders', + args, + }, + ] as const, + info: ( + chainId: string, + contractAddress: string, + args?: Record + ) => + [ + { + ...neutronVaultQueryKeys.address(chainId, contractAddress)[0], + method: 'info', + args, + }, + ] as const, +} +export const neutronVaultQueries = { + config: ({ + chainId, + contractAddress, + options, + }: NeutronVaultConfigQuery): UseQueryOptions< + Config, + Error, + TData + > => ({ + queryKey: neutronVaultQueryKeys.config(chainId, contractAddress), + queryFn: async () => { + return new NeutronVaultQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).config() + }, + ...options, + }), + votingPowerAtHeight: ({ + chainId, + contractAddress, + args, + options, + }: NeutronVaultVotingPowerAtHeightQuery): UseQueryOptions< + VotingPowerAtHeightResponse, + Error, + TData + > => ({ + queryKey: neutronVaultQueryKeys.votingPowerAtHeight( + chainId, + contractAddress, + args + ), + queryFn: async () => { + return new NeutronVaultQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).votingPowerAtHeight({ + address: args.address, + height: args.height, + }) + }, + ...options, + }), + totalPowerAtHeight: ({ + chainId, + contractAddress, + args, + options, + }: NeutronVaultTotalPowerAtHeightQuery): UseQueryOptions< + TotalPowerAtHeightResponse, + Error, + TData + > => ({ + queryKey: neutronVaultQueryKeys.totalPowerAtHeight( + chainId, + contractAddress, + args + ), + queryFn: async () => { + return new NeutronVaultQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).totalPowerAtHeight({ + height: args.height, + }) + }, + ...options, + }), + bondingStatus: ({ + chainId, + contractAddress, + args, + options, + }: NeutronVaultBondingStatusQuery): UseQueryOptions< + BondingStatusResponse, + Error, + TData + > => ({ + queryKey: neutronVaultQueryKeys.bondingStatus( + chainId, + contractAddress, + args + ), + queryFn: async () => { + return new NeutronVaultQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).bondingStatus({ + address: args.address, + height: args.height, + }) + }, + ...options, + }), + dao: ({ + chainId, + contractAddress, + options, + }: NeutronVaultDaoQuery): UseQueryOptions => ({ + queryKey: neutronVaultQueryKeys.dao(chainId, contractAddress), + queryFn: async () => { + return new NeutronVaultQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).dao() + }, + ...options, + }), + name: ({ + chainId, + contractAddress, + options, + }: NeutronVaultNameQuery): UseQueryOptions => ({ + queryKey: neutronVaultQueryKeys.name(chainId, contractAddress), + queryFn: async () => { + return new NeutronVaultQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).name() + }, + ...options, + }), + description: ({ + chainId, + contractAddress, + options, + }: NeutronVaultDescriptionQuery): UseQueryOptions< + String, + Error, + TData + > => ({ + queryKey: neutronVaultQueryKeys.description(chainId, contractAddress), + queryFn: async () => { + return new NeutronVaultQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).description() + }, + ...options, + }), + listBonders: ({ + chainId, + contractAddress, + args, + options, + }: NeutronVaultListBondersQuery): UseQueryOptions< + ArrayOfTupleOfAddrAndUint128, + Error, + TData + > => ({ + queryKey: neutronVaultQueryKeys.listBonders(chainId, contractAddress, args), + queryFn: async () => { + return new NeutronVaultQueryClient( + await getCosmWasmClientForChainId(chainId), + contractAddress + ).listBonders({ + limit: args.limit, + startAfter: args.startAfter, + }) + }, + ...options, + }), + info: contractQueries.info, +} +export interface NeutronVaultReactQuery { + chainId: string + contractAddress: string + options?: Omit< + UseQueryOptions, + 'queryKey' | 'queryFn' | 'initialData' + > & { + initialData?: undefined + } +} +export interface NeutronVaultInfoQuery + extends NeutronVaultReactQuery {} +export interface NeutronVaultListBondersQuery + extends NeutronVaultReactQuery { + args: { + limit?: number + startAfter?: string + } +} +export interface NeutronVaultDescriptionQuery + extends NeutronVaultReactQuery {} +export interface NeutronVaultNameQuery + extends NeutronVaultReactQuery {} +export interface NeutronVaultDaoQuery + extends NeutronVaultReactQuery {} +export interface NeutronVaultBondingStatusQuery + extends NeutronVaultReactQuery { + args: { + address: string + height?: number + } +} +export interface NeutronVaultTotalPowerAtHeightQuery + extends NeutronVaultReactQuery { + args: { + height?: number + } +} +export interface NeutronVaultVotingPowerAtHeightQuery + extends NeutronVaultReactQuery { + args: { + address: string + height?: number + } +} +export interface NeutronVaultConfigQuery + extends NeutronVaultReactQuery {} diff --git a/packages/state/query/queries/contracts/NeutronVotingRegistry.extra.ts b/packages/state/query/queries/contracts/NeutronVotingRegistry.extra.ts new file mode 100644 index 000000000..e7b45f98a --- /dev/null +++ b/packages/state/query/queries/contracts/NeutronVotingRegistry.extra.ts @@ -0,0 +1,72 @@ +import { QueryClient, queryOptions } from '@tanstack/react-query' + +import { VotingVaultWithInfo } from '@dao-dao/types' + +import { neutronVaultQueries } from './NeutronVault' +import { neutronVaultExtraQueries } from './NeutronVault.extra' +import { neutronVotingRegistryQueries } from './NeutronVotingRegistry' + +/** + * Fetch voting vaults with info. + */ +export const fetchNeutronVaultsWithInfo = async ( + queryClient: QueryClient, + { + chainId, + address, + }: { + chainId: string + address: string + } +): Promise => { + const vaults = await queryClient.fetchQuery( + neutronVotingRegistryQueries.votingVaults({ + chainId, + contractAddress: address, + args: {}, + }) + ) + + const vaultsWithInfo = ( + await Promise.allSettled( + vaults.map( + async (vault): Promise => ({ + ...vault, + info: await queryClient.fetchQuery( + neutronVaultExtraQueries.info(queryClient, { + chainId, + address: vault.address, + }) + ), + totalPower: ( + await queryClient.fetchQuery( + neutronVaultQueries.totalPowerAtHeight({ + chainId, + contractAddress: vault.address, + args: {}, + }) + ) + ).power, + }) + ) + ) + ) + .flatMap((i) => (i.status === 'fulfilled' ? i.value : [])) + .sort((a, b) => a.name.localeCompare(b.name)) + + return vaultsWithInfo +} + +export const neutronVotingRegistryExtraQueries = { + /** + * Fetch voting vaults with info. + */ + vaultsWithInfo: ( + queryClient: QueryClient, + options: Parameters[1] + ) => + queryOptions({ + queryKey: ['neutronVotingRegistryExtra', 'vaultsWithInfo', options], + queryFn: () => fetchNeutronVaultsWithInfo(queryClient, options), + }), +} diff --git a/packages/state/query/queries/contracts/NeutronVotingRegistry.ts b/packages/state/query/queries/contracts/NeutronVotingRegistry.ts index 8093b27bf..39a465e70 100644 --- a/packages/state/query/queries/contracts/NeutronVotingRegistry.ts +++ b/packages/state/query/queries/contracts/NeutronVotingRegistry.ts @@ -4,7 +4,7 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { UseQueryOptions } from '@tanstack/react-query' +import { QueryClient, UseQueryOptions } from '@tanstack/react-query' import { Addr, @@ -17,6 +17,8 @@ import { import { getCosmWasmClientForChainId } from '@dao-dao/utils' import { NeutronVotingRegistryQueryClient } from '../../../contracts/NeutronVotingRegistry' +import { contractQueries } from '../contract' +import { indexerQueries } from '../indexer' export const neutronVotingRegistryQueryKeys = { contract: [ @@ -106,38 +108,68 @@ export const neutronVotingRegistryQueryKeys = { ] as const, } export const neutronVotingRegistryQueries = { - dao: ({ - chainId, - contractAddress, - options, - }: NeutronVotingRegistryDaoQuery): UseQueryOptions< - Addr, - Error, - TData - > => ({ + dao: ( + queryClient: QueryClient, + { chainId, contractAddress, options }: NeutronVotingRegistryDaoQuery + ): UseQueryOptions => ({ queryKey: neutronVotingRegistryQueryKeys.dao(chainId, contractAddress), - queryFn: async () => - new NeutronVotingRegistryQueryClient( + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'item', + args: { + key: 'dao', + }, + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new NeutronVotingRegistryQueryClient( await getCosmWasmClientForChainId(chainId), contractAddress - ).dao(), + ).dao() + }, ...options, }), - config: ({ - chainId, - contractAddress, - options, - }: NeutronVotingRegistryConfigQuery): UseQueryOptions< - Config, - Error, - TData - > => ({ + config: ( + queryClient: QueryClient, + { + chainId, + contractAddress, + options, + }: NeutronVotingRegistryConfigQuery + ): UseQueryOptions => ({ queryKey: neutronVotingRegistryQueryKeys.config(chainId, contractAddress), - queryFn: async () => - new NeutronVotingRegistryQueryClient( + queryFn: async () => { + try { + // Attempt to fetch data from the indexer. + return await queryClient.fetchQuery( + indexerQueries.queryContract(queryClient, { + chainId, + contractAddress, + formula: 'item', + args: { + key: 'config', + }, + }) + ) + } catch (error) { + console.error(error) + } + + // If indexer query fails, fallback to contract query. + return new NeutronVotingRegistryQueryClient( await getCosmWasmClientForChainId(chainId), contractAddress - ).config(), + ).config() + }, ...options, }), votingVaults: ({ @@ -155,13 +187,14 @@ export const neutronVotingRegistryQueries = { contractAddress, args ), - queryFn: async () => - new NeutronVotingRegistryQueryClient( + queryFn: async () => { + return new NeutronVotingRegistryQueryClient( await getCosmWasmClientForChainId(chainId), contractAddress ).votingVaults({ height: args.height, - }), + }) + }, ...options, }), votingPowerAtHeight: ({ @@ -179,14 +212,15 @@ export const neutronVotingRegistryQueries = { contractAddress, args ), - queryFn: async () => - new NeutronVotingRegistryQueryClient( + queryFn: async () => { + return new NeutronVotingRegistryQueryClient( await getCosmWasmClientForChainId(chainId), contractAddress ).votingPowerAtHeight({ address: args.address, height: args.height, - }), + }) + }, ...options, }), totalPowerAtHeight: ({ @@ -204,32 +238,17 @@ export const neutronVotingRegistryQueries = { contractAddress, args ), - queryFn: async () => - new NeutronVotingRegistryQueryClient( + queryFn: async () => { + return new NeutronVotingRegistryQueryClient( await getCosmWasmClientForChainId(chainId), contractAddress ).totalPowerAtHeight({ height: args.height, - }), - ...options, - }), - info: ({ - chainId, - contractAddress, - options, - }: NeutronVotingRegistryInfoQuery): UseQueryOptions< - InfoResponse, - Error, - TData - > => ({ - queryKey: neutronVotingRegistryQueryKeys.info(chainId, contractAddress), - queryFn: async () => - new NeutronVotingRegistryQueryClient( - await getCosmWasmClientForChainId(chainId), - contractAddress - ).info(), + }) + }, ...options, }), + info: contractQueries.info, } export interface NeutronVotingRegistryReactQuery { chainId: string diff --git a/packages/state/query/queries/contracts/index.ts b/packages/state/query/queries/contracts/index.ts index ae903ef08..ed31be1d5 100644 --- a/packages/state/query/queries/contracts/index.ts +++ b/packages/state/query/queries/contracts/index.ts @@ -30,6 +30,7 @@ export * from './SecretDaoVotingSnip721Staked' export * from './SecretDaoPreProposeApprovalSingle' export * from './SecretDaoVotingSnip20Staked' export * from './NeutronVotingRegistry' +export * from './NeutronVotingRegistry.extra' export * from './DaoVotingOnftStaked' export * from './DaoVotingOnftStaked.extra' export * from './Cw721Base' @@ -39,3 +40,5 @@ export * from './CwVesting' export * from './CwVesting.extra' export * from './CwPayrollFactory' export * from './CwPayrollFactory.extra' +export * from './NeutronVault' +export * from './NeutronVault.extra' diff --git a/packages/state/recoil/selectors/contracts/NeutronVault.ts b/packages/state/recoil/selectors/contracts/NeutronVault.ts index dd55e8271..ac08cacab 100644 --- a/packages/state/recoil/selectors/contracts/NeutronVault.ts +++ b/packages/state/recoil/selectors/contracts/NeutronVault.ts @@ -4,47 +4,12 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { selectorFamily, waitForAllSettled } from 'recoil' +import { selectorFamily } from 'recoil' -import { Addr, GenericToken, TokenType, WithChainId } from '@dao-dao/types' -import { - ArrayOfTupleOfAddrAndUint128, - BondingStatusResponse, - Config, - TotalPowerAtHeightResponse, - VotingPowerAtHeightResponse, -} from '@dao-dao/types/contracts/NeutronVault' +import { WithChainId } from '@dao-dao/types' -import { - NeutronVaultClient, - NeutronVaultQueryClient, -} from '../../../contracts/NeutronVault' -import { - refreshDaoVotingPowerAtom, - refreshWalletBalancesIdAtom, - signingCosmWasmClientAtom, -} from '../../atoms' -import { cosmWasmClientForChainSelector } from '../chain' -import { contractInfoSelector } from '../contract' -import { genericTokenSelector } from '../token' - -type QueryClientParams = WithChainId<{ - contractAddress: string -}> - -export const queryClient = selectorFamily< - NeutronVaultQueryClient, - QueryClientParams ->({ - key: 'neutronVaultQueryClient', - get: - ({ contractAddress, chainId }) => - ({ get }) => { - const client = get(cosmWasmClientForChainSelector(chainId)) - return new NeutronVaultQueryClient(client, contractAddress) - }, - dangerouslyAllowMutability: true, -}) +import { NeutronVaultClient } from '../../../contracts/NeutronVault' +import { signingCosmWasmClientAtom } from '../../atoms' export type ExecuteClientParams = WithChainId<{ contractAddress: string @@ -66,217 +31,3 @@ export const executeClient = selectorFamily< }, dangerouslyAllowMutability: true, }) - -export const configSelector = selectorFamily< - Config, - QueryClientParams & { - params: Parameters - } ->({ - key: 'neutronVaultConfig', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.config(...params) - }, -}) -export const votingPowerAtHeightSelector = selectorFamily< - VotingPowerAtHeightResponse, - QueryClientParams & { - params: Parameters - } ->({ - key: 'neutronVaultVotingPowerAtHeight', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - get(refreshWalletBalancesIdAtom(params[0].address)) - - // Don't use the indexer because different vaults have different voting - // power sources. - const client = get(queryClient(queryClientParams)) - return await client.votingPowerAtHeight(...params) - }, -}) -export const totalPowerAtHeightSelector = selectorFamily< - TotalPowerAtHeightResponse, - QueryClientParams & { - params: Parameters - } ->({ - key: 'neutronVaultTotalPowerAtHeight', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - get(refreshWalletBalancesIdAtom(undefined)) - get(refreshDaoVotingPowerAtom(queryClientParams.contractAddress)) - - // Don't use the indexer because different vaults have different voting - // power sources. - const client = get(queryClient(queryClientParams)) - return await client.totalPowerAtHeight(...params) - }, -}) -export const bondingStatusSelector = selectorFamily< - BondingStatusResponse, - QueryClientParams & { - params: Parameters - } ->({ - key: 'neutronVaultBondingStatus', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - get(refreshWalletBalancesIdAtom(params[0].address)) - - // Don't use the indexer because different vaults have different voting - // power sources. - const client = get(queryClient(queryClientParams)) - return await client.bondingStatus(...params) - }, -}) -export const daoSelector = selectorFamily< - Addr, - QueryClientParams & { - params: Parameters - } ->({ - key: 'neutronVaultDao', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.dao(...params) - }, -}) -export const nameSelector = selectorFamily< - String, - QueryClientParams & { - params: Parameters - } ->({ - key: 'neutronVaultName', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.name(...params) - }, -}) -export const descriptionSelector = selectorFamily< - String, - QueryClientParams & { - params: Parameters - } ->({ - key: 'neutronVaultDescription', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.description(...params) - }, -}) -export const listBondersSelector = selectorFamily< - ArrayOfTupleOfAddrAndUint128, - QueryClientParams & { - params: Parameters - } ->({ - key: 'neutronVaultListBonders', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.listBonders(...params) - }, -}) -export const infoSelector = contractInfoSelector - -/** - * Test whether or not this is a virtual vault. - */ -export const isVirtualSelector = selectorFamily({ - key: 'neutronVaultIsVirtual', - get: - (queryClientParams) => - async ({ get }) => { - const listBonders = get( - waitForAllSettled([ - listBondersSelector({ - ...queryClientParams, - params: [ - { - limit: 1, - }, - ], - }), - ]) - )[0] - - return ( - listBonders.state === 'hasError' && - listBonders.contents instanceof Error && - listBonders.contents.message.includes( - 'Bonding is not available for this contract' - ) - ) - }, -}) - -/** - * Determine if this vault is real or virtual, and retrieve the bond token if - * it's real. - */ -export const vaultInfoSelector = selectorFamily< - // Real vaults have bond tokens. - | { - real: true - bondToken: GenericToken - } - // Virtual vaults do not have bond tokens. - | { - real: false - }, - QueryClientParams ->({ - key: 'neutronVaultVaultInfo', - get: - (queryClientParams) => - async ({ get }) => { - const [isVirtual, _config] = get( - waitForAllSettled([ - isVirtualSelector(queryClientParams), - configSelector({ - ...queryClientParams, - params: [], - }), - ]) - ) - - if (isVirtual.state === 'hasValue' && isVirtual.contents) { - return { - real: false, - } - } - - const config = _config.state === 'hasValue' ? _config.contents : undefined - if (!config || !('denom' in config)) { - throw new Error('No config or denom for real vault') - } - - const bondToken = get( - genericTokenSelector({ - chainId: queryClientParams.chainId, - type: TokenType.Native, - denomOrAddress: config.denom, - }) - ) - - return { - real: true, - bondToken, - } - }, -}) diff --git a/packages/state/recoil/selectors/contracts/NeutronVotingRegistry.ts b/packages/state/recoil/selectors/contracts/NeutronVotingRegistry.ts deleted file mode 100644 index e144af954..000000000 --- a/packages/state/recoil/selectors/contracts/NeutronVotingRegistry.ts +++ /dev/null @@ -1,176 +0,0 @@ -/** - * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, - * and run the @cosmwasm/ts-codegen generate command to regenerate this file. - */ - -import { selectorFamily } from 'recoil' - -import { Addr, WithChainId } from '@dao-dao/types' -import { - ArrayOfVotingVault, - Config, - TotalPowerAtHeightResponse, - VotingPowerAtHeightResponse, -} from '@dao-dao/types/contracts/NeutronVotingRegistry' - -import { - NeutronVotingRegistryClient, - NeutronVotingRegistryQueryClient, -} from '../../../contracts/NeutronVotingRegistry' -import { - refreshDaoVotingPowerAtom, - refreshWalletBalancesIdAtom, - signingCosmWasmClientAtom, -} from '../../atoms' -import { cosmWasmClientForChainSelector } from '../chain' -import { contractInfoSelector } from '../contract' -import { queryContractIndexerSelector } from '../indexer' - -type QueryClientParams = WithChainId<{ - contractAddress: string -}> - -export const queryClient = selectorFamily< - NeutronVotingRegistryQueryClient, - QueryClientParams ->({ - key: 'neutronVotingRegistryQueryClient', - get: - ({ contractAddress, chainId }) => - ({ get }) => { - const client = get(cosmWasmClientForChainSelector(chainId)) - return new NeutronVotingRegistryQueryClient(client, contractAddress) - }, - dangerouslyAllowMutability: true, -}) - -export type ExecuteClientParams = WithChainId<{ - contractAddress: string - sender: string -}> - -export const executeClient = selectorFamily< - NeutronVotingRegistryClient | undefined, - ExecuteClientParams ->({ - key: 'neutronVotingRegistryExecuteClient', - get: - ({ chainId, contractAddress, sender }) => - ({ get }) => { - const client = get(signingCosmWasmClientAtom({ chainId })) - if (!client) return - - return new NeutronVotingRegistryClient(client, sender, contractAddress) - }, - dangerouslyAllowMutability: true, -}) - -export const daoSelector = selectorFamily< - Addr, - QueryClientParams & { - params: Parameters - } ->({ - key: 'neutronVotingRegistryDao', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const dao = get( - queryContractIndexerSelector({ - ...queryClientParams, - formula: 'item', - args: { - key: 'dao', - }, - }) - ) - if (dao) { - return dao - } - - // Fallback to chain query if indexer fails. - const client = get(queryClient(queryClientParams)) - return await client.dao(...params) - }, -}) -export const configSelector = selectorFamily< - Config, - QueryClientParams & { - params: Parameters - } ->({ - key: 'neutronVotingRegistryConfig', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const config = get( - queryContractIndexerSelector({ - ...queryClientParams, - formula: 'item', - args: { - key: 'config', - }, - }) - ) - if (config) { - return config - } - - // Fallback to chain query if indexer fails. - const client = get(queryClient(queryClientParams)) - return await client.config(...params) - }, -}) -export const votingVaultsSelector = selectorFamily< - ArrayOfVotingVault, - QueryClientParams & { - params: Parameters - } ->({ - key: 'neutronVotingRegistryVotingVaults', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - const client = get(queryClient(queryClientParams)) - return await client.votingVaults(...params) - }, -}) -export const votingPowerAtHeightSelector = selectorFamily< - VotingPowerAtHeightResponse, - QueryClientParams & { - params: Parameters - } ->({ - key: 'neutronVotingRegistryVotingPowerAtHeight', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - get(refreshWalletBalancesIdAtom(params[0].address)) - - // Don't use the indexer because different vaults have different voting - // power sources. - const client = get(queryClient(queryClientParams)) - return await client.votingPowerAtHeight(...params) - }, -}) -export const totalPowerAtHeightSelector = selectorFamily< - TotalPowerAtHeightResponse, - QueryClientParams & { - params: Parameters - } ->({ - key: 'neutronVotingRegistryTotalPowerAtHeight', - get: - ({ params, ...queryClientParams }) => - async ({ get }) => { - get(refreshWalletBalancesIdAtom(undefined)) - get(refreshDaoVotingPowerAtom(queryClientParams.contractAddress)) - - // Don't use the indexer because different vaults have different voting - // power sources. - const client = get(queryClient(queryClientParams)) - return await client.totalPowerAtHeight(...params) - }, -}) -export const infoSelector = contractInfoSelector diff --git a/packages/state/recoil/selectors/contracts/index.ts b/packages/state/recoil/selectors/contracts/index.ts index e7d7331b1..854f1f373 100644 --- a/packages/state/recoil/selectors/contracts/index.ts +++ b/packages/state/recoil/selectors/contracts/index.ts @@ -26,8 +26,6 @@ export * as DaoVotingTokenStakedSelectors from './DaoVotingTokenStaked' export * as NeutronCwdPreProposeSingleOverruleSelectors from './NeutronCwdPreProposeSingleOverrule' export * as NeutronCwdSubdaoPreProposeSingleSelectors from './NeutronCwdSubdaoPreProposeSingle' export * as NeutronCwdSubdaoTimelockSingleSelectors from './NeutronCwdSubdaoTimelockSingle' -export * as NeutronVaultSelectors from './NeutronVault' -export * as NeutronVotingRegistrySelectors from './NeutronVotingRegistry' export * as OraichainCw20StakingSelectors from './OraichainCw20Staking' export * as PolytoneListenerSelectors from './PolytoneListener' export * as PolytoneNoteSelectors from './PolytoneNote' diff --git a/packages/stateful/components/dao/DaoVotingVaultCard.tsx b/packages/stateful/components/dao/DaoVotingVaultCard.tsx index e8b703a7c..fc7ca7a71 100644 --- a/packages/stateful/components/dao/DaoVotingVaultCard.tsx +++ b/packages/stateful/components/dao/DaoVotingVaultCard.tsx @@ -1,45 +1,31 @@ -import { constSelector } from 'recoil' - -import { NeutronVaultSelectors } from '@dao-dao/state' +import { neutronVaultQueries } from '@dao-dao/state' import { DaoVotingVaultCard as StatelessDaoVotingVaultCard, - useCachedLoadingWithError, useChain, } from '@dao-dao/stateless' import { StatefulDaoVotingVaultCardProps } from '@dao-dao/types' -import { useWallet } from '../../hooks' +import { useQueryLoadingDataWithError, useWallet } from '../../hooks' export const DaoVotingVaultCard = (props: StatefulDaoVotingVaultCardProps) => { const { chain_id: chainId } = useChain() const { address } = useWallet() - const loadingVaultVotingPower = useCachedLoadingWithError( - NeutronVaultSelectors.totalPowerAtHeightSelector({ - contractAddress: props.vault.address, - chainId, - params: [{}], - }) - ) - const loadingWalletVotingPower = useCachedLoadingWithError( + const loadingWalletVotingPower = useQueryLoadingDataWithError( address - ? NeutronVaultSelectors.votingPowerAtHeightSelector({ - contractAddress: props.vault.address, + ? neutronVaultQueries.votingPowerAtHeight({ chainId, - params: [ - { - address, - }, - ], + contractAddress: props.vault.address, + args: { + address, + }, }) - : constSelector(undefined) + : undefined ) return ( { data: props.totalVotingPower.data === 0 ? 0 - : (Number(loadingVaultVotingPower.data.power) / + : (Number(props.vault.totalPower) / props.totalVotingPower.data) * 100, } } walletVotingPowerPercent={ - loadingVaultVotingPower.loading || - loadingVaultVotingPower.errored || - loadingWalletVotingPower.loading || - loadingWalletVotingPower.errored + !address + ? { + loading: false, + data: undefined, + } + : loadingWalletVotingPower.loading || loadingWalletVotingPower.errored ? { loading: true, } : { loading: false, data: - loadingWalletVotingPower.data === undefined - ? undefined - : loadingVaultVotingPower.data.power === '0' + props.vault.totalPower === '0' ? 0 : (Number(loadingWalletVotingPower.data.power) / - Number(loadingVaultVotingPower.data.power)) * + Number(props.vault.totalPower)) * 100, } } diff --git a/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/ProfileCardMemberInfo.tsx b/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/ProfileCardMemberInfo.tsx index c125b3e13..f32695449 100644 --- a/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/ProfileCardMemberInfo.tsx +++ b/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/ProfileCardMemberInfo.tsx @@ -1,10 +1,11 @@ +import { useQueries } from '@tanstack/react-query' import { useState } from 'react' import { useRecoilValue, waitForAll } from 'recoil' import { - NeutronVaultSelectors, - NeutronVotingRegistrySelectors, genericTokenBalanceSelector, + neutronVaultQueries, + neutronVotingRegistryQueries, stakingLoadingAtom, } from '@dao-dao/state' import { @@ -12,9 +13,12 @@ import { useDaoInfoContext, } from '@dao-dao/stateless' import { BaseProfileCardMemberInfoProps } from '@dao-dao/types' -import { convertMicroDenomToDenomWithDecimals } from '@dao-dao/utils' +import { + convertMicroDenomToDenomWithDecimals, + makeCombineQueryResultsIntoLoadingDataWithError, +} from '@dao-dao/utils' -import { useWallet } from '../../../../hooks' +import { useQueryLoadingDataWithError, useWallet } from '../../../../hooks' import { ProfileCardMemberInfoTokens } from '../../../components' import { useVotingModule } from '../hooks' import { StakingModal } from './StakingModal' @@ -42,43 +46,42 @@ export const ProfileCardMemberInfo = ({ : [] ) - const loadingWalletVotingPower = useCachedLoadingWithError( + const loadingWalletVotingPower = useQueryLoadingDataWithError( !address ? undefined - : NeutronVotingRegistrySelectors.votingPowerAtHeightSelector({ - contractAddress: votingRegistryAddress, + : neutronVotingRegistryQueries.votingPowerAtHeight({ chainId, - params: [ - { - address, - }, - ], + contractAddress: votingRegistryAddress, + args: { + address, + }, }) ) - const loadingTotalVotingPower = useCachedLoadingWithError( - NeutronVotingRegistrySelectors.totalPowerAtHeightSelector({ - contractAddress: votingRegistryAddress, + const loadingTotalVotingPower = useQueryLoadingDataWithError( + neutronVotingRegistryQueries.totalPowerAtHeight({ chainId, - params: [{}], + contractAddress: votingRegistryAddress, + args: {}, }) ) - const loadingStakedTokens = useCachedLoadingWithError( - loadingVaults.loading || loadingVaults.errored || !address - ? undefined - : waitForAll( - realVaults.map(({ address: contractAddress }) => - NeutronVaultSelectors.bondingStatusSelector({ - contractAddress, + const loadingStakedTokens = useQueries({ + queries: + loadingVaults.loading || loadingVaults.errored || !address + ? [] + : realVaults.map(({ address: contractAddress }) => + neutronVaultQueries.bondingStatus({ chainId, - params: [ - { - address, - }, - ], + contractAddress, + args: { + address, + }, }) - ) - ) - ) + ), + combine: makeCombineQueryResultsIntoLoadingDataWithError({ + // Show loading if empty array is passed. + loadIfNone: true, + }), + }) const loadingUnstakedTokens = useCachedLoadingWithError( loadingVaults.loading || loadingVaults.errored || !address ? undefined diff --git a/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/StakingModal.tsx b/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/StakingModal.tsx index 9be67c379..15003379b 100644 --- a/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/StakingModal.tsx +++ b/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/StakingModal.tsx @@ -1,12 +1,13 @@ import { coins } from '@cosmjs/stargate' +import { useQueries } from '@tanstack/react-query' import { useCallback, useState } from 'react' import toast from 'react-hot-toast' import { useTranslation } from 'react-i18next' import { useRecoilState, useSetRecoilState, waitForAll } from 'recoil' import { - NeutronVaultSelectors, genericTokenBalanceSelector, + neutronVaultQueries, refreshDaoVotingPowerAtom, refreshFollowingDaosAtom, refreshWalletBalancesIdAtom, @@ -23,6 +24,7 @@ import { CHAIN_GAS_MULTIPLIER, convertDenomToMicroDenomStringWithDecimals, convertMicroDenomToDenomWithDecimals, + makeCombineQueryResultsIntoLoadingDataWithError, processError, tokensEqual, } from '@dao-dao/utils' @@ -66,23 +68,24 @@ const InnerStakingModal = ({ : [] ) - const loadingStakedTokens = useCachedLoadingWithError( - loadingVaults.loading || loadingVaults.errored || !address - ? undefined - : waitForAll( - realVaults.map(({ address: contractAddress }) => - NeutronVaultSelectors.bondingStatusSelector({ - contractAddress, + const loadingStakedTokens = useQueries({ + queries: + loadingVaults.loading || loadingVaults.errored || !address + ? [] + : realVaults.map(({ address: contractAddress }) => + neutronVaultQueries.bondingStatus({ chainId, - params: [ - { - address, - }, - ], + contractAddress, + args: { + address, + }, }) - ) - ) - ) + ), + combine: makeCombineQueryResultsIntoLoadingDataWithError({ + // Show loading if empty array is passed. + loadIfNone: true, + }), + }) const loadingUnstakedTokens = useCachedLoadingWithError( loadingVaults.loading || loadingVaults.errored || !address ? undefined diff --git a/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/VaultsTab.tsx b/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/VaultsTab.tsx index 6f70471ba..eb8fc945d 100644 --- a/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/VaultsTab.tsx +++ b/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/components/VaultsTab.tsx @@ -1,21 +1,18 @@ -import { NeutronVotingRegistrySelectors } from '@dao-dao/state' -import { - NeutronVotingVaultsTab, - useCachedLoadingWithError, - useChain, -} from '@dao-dao/stateless' +import { neutronVotingRegistryQueries } from '@dao-dao/state' +import { NeutronVotingVaultsTab, useChain } from '@dao-dao/stateless' import { DaoVotingVaultCard } from '../../../../components' +import { useQueryLoadingDataWithError } from '../../../../hooks' import { useVotingModule } from '../hooks' export const VaultsTab = () => { const { chain_id: chainId } = useChain() const { votingRegistryAddress, loadingVaults } = useVotingModule() - const loadingTotalVotingPower = useCachedLoadingWithError( - NeutronVotingRegistrySelectors.totalPowerAtHeightSelector({ - contractAddress: votingRegistryAddress, + const loadingTotalVotingPower = useQueryLoadingDataWithError( + neutronVotingRegistryQueries.totalPowerAtHeight({ chainId, - params: [{}], + contractAddress: votingRegistryAddress, + args: {}, }) ) diff --git a/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/hooks/useMainDaoInfoCards.tsx b/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/hooks/useMainDaoInfoCards.tsx index 3364f698f..40fa9b71c 100644 --- a/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/hooks/useMainDaoInfoCards.tsx +++ b/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/hooks/useMainDaoInfoCards.tsx @@ -1,12 +1,6 @@ import { useTranslation } from 'react-i18next' -import { - constSelector, - useRecoilValueLoadable, - waitForAllSettled, -} from 'recoil' -import { NeutronVaultSelectors } from '@dao-dao/state' -import { TokenAmountDisplay, useChain } from '@dao-dao/stateless' +import { TokenAmountDisplay } from '@dao-dao/stateless' import { DaoInfoCard } from '@dao-dao/types' import { convertMicroDenomToDenomWithDecimals } from '@dao-dao/utils' @@ -14,35 +8,13 @@ import { useVotingModule } from './useVotingModule' export const useMainDaoInfoCards = (): DaoInfoCard[] => { const { t } = useTranslation() - const { chain_id: chainId } = useChain() const { loadingVaults } = useVotingModule() - const loadingVaultsVotingPower = useRecoilValueLoadable( - loadingVaults.loading || loadingVaults.errored - ? constSelector(undefined) - : waitForAllSettled( - loadingVaults.data.map(({ address }) => - NeutronVaultSelectors.totalPowerAtHeightSelector({ - contractAddress: address, - chainId, - params: [{}], - }) - ) - ) - ) - return loadingVaults.loading || - loadingVaults.errored || - loadingVaultsVotingPower.state === 'hasError' || - !loadingVaultsVotingPower.contents + return loadingVaults.loading || loadingVaults.errored ? [] - : loadingVaults.data.flatMap(({ info }, index) => { - const votingPower = - loadingVaultsVotingPower.state === 'loading' - ? ({ state: 'loading' } as const) - : loadingVaultsVotingPower.contents![index] - - return info.real && votingPower?.state !== 'hasError' + : loadingVaults.data.flatMap(({ info, totalPower }) => + info.real ? { label: t('info.tokenStaked', { tokenSymbol: info.bondToken.symbol, @@ -52,19 +24,15 @@ export const useMainDaoInfoCards = (): DaoInfoCard[] => { }), value: ( ), } : [] - }) + ) } diff --git a/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/hooks/useVotingModule.ts b/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/hooks/useVotingModule.ts index ff7be97ee..7811d37a4 100644 --- a/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/hooks/useVotingModule.ts +++ b/packages/stateful/voting-module-adapter/adapters/NeutronVotingRegistry/hooks/useVotingModule.ts @@ -1,13 +1,9 @@ -import { useMemo } from 'react' -import { waitForAll } from 'recoil' +import { useQueryClient } from '@tanstack/react-query' -import { - NeutronVaultSelectors, - NeutronVotingRegistrySelectors, -} from '@dao-dao/state' -import { useCachedLoadingWithError } from '@dao-dao/stateless' +import { neutronVotingRegistryExtraQueries } from '@dao-dao/state' import { LoadingDataWithError, VotingVaultWithInfo } from '@dao-dao/types' +import { useQueryLoadingDataWithError } from '../../../../hooks' import { useVotingModuleAdapterOptions } from '../../../react/context' export type LoadingVaults = LoadingDataWithError @@ -20,62 +16,16 @@ export type UseVotingModuleReturn = { export const useVotingModule = (): UseVotingModuleReturn => { const { chainId, votingModuleAddress } = useVotingModuleAdapterOptions() - const votingVaults = useCachedLoadingWithError( - NeutronVotingRegistrySelectors.votingVaultsSelector({ + const queryClient = useQueryClient() + const loadingVaults = useQueryLoadingDataWithError( + neutronVotingRegistryExtraQueries.vaultsWithInfo(queryClient, { chainId, - contractAddress: votingModuleAddress, - params: [{}], + address: votingModuleAddress, }) ) - const vaultInfos = useCachedLoadingWithError( - votingVaults.loading || votingVaults.errored - ? undefined - : waitForAll( - votingVaults.data.map(({ address }) => - NeutronVaultSelectors.vaultInfoSelector({ - chainId, - contractAddress: address, - }) - ) - ) - ) - - return useMemo( - (): UseVotingModuleReturn => ({ - votingRegistryAddress: votingModuleAddress, - loadingVaults: - votingVaults.loading || vaultInfos.loading - ? { - loading: true, - errored: false, - } - : votingVaults.errored - ? { - loading: false, - errored: true, - error: votingVaults.error, - } - : vaultInfos.errored - ? { - loading: false, - errored: true, - error: vaultInfos.error, - } - : { - loading: false, - errored: false, - updating: votingVaults.updating || vaultInfos.updating, - data: votingVaults.data - .map( - (vault, index): VotingVaultWithInfo => ({ - ...vault, - info: vaultInfos.data[index], - }) - ) - .sort((a, b) => a.name.localeCompare(b.name)), - }, - }), - [votingModuleAddress, votingVaults, vaultInfos] - ) + return { + votingRegistryAddress: votingModuleAddress, + loadingVaults, + } } diff --git a/packages/stateful/voting-module-adapter/components/ProfileCardMemberInfoTokens.tsx b/packages/stateful/voting-module-adapter/components/ProfileCardMemberInfoTokens.tsx index a01fdbe4e..6467ae193 100644 --- a/packages/stateful/voting-module-adapter/components/ProfileCardMemberInfoTokens.tsx +++ b/packages/stateful/voting-module-adapter/components/ProfileCardMemberInfoTokens.tsx @@ -101,9 +101,10 @@ export const ProfileCardMemberInfoTokens = ({ const canBeMemberButIsnt = !isMember && hasUnstaked const onlyOneToken = !loadingTokens.loading && loadingTokens.data.length === 1 - const onlyTokenSymbol = loadingTokens.loading - ? '...' - : loadingTokens.data[0].token.symbol + const onlyTokenSymbol = + loadingTokens.loading || loadingTokens.data.length === 0 + ? '...' + : loadingTokens.data[0].token.symbol // If cannot vote on proposal, this means they did not have voting power at // the time of proposal creation. Show proposal-specific message when in a @@ -270,7 +271,9 @@ export const ProfileCardMemberInfoTokens = ({ canBeMemberButIsnt ? 'secondary' : 'brand' } > - {loadingTokens.loading || !onlyOneToken + {loadingTokens.loading || + loadingTokens.data.length === 0 || + !onlyOneToken ? t('button.claimYourTokens') : t('button.claimNumTokens', { amount: claimableBalance.toLocaleString(undefined, { diff --git a/packages/types/contracts/NeutronVault.ts b/packages/types/contracts/NeutronVault.ts index 3fa82a695..a24f849ab 100644 --- a/packages/types/contracts/NeutronVault.ts +++ b/packages/types/contracts/NeutronVault.ts @@ -1,11 +1,9 @@ /** - * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. + * This file was automatically generated by @cosmwasm/ts-codegen@1.10.0. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { Addr, Uint128 } from './common' - export interface InstantiateMsg { denom: string description: string @@ -28,6 +26,7 @@ export type ExecuteMsg = amount: Uint128 } } +export type Uint128 = string export type QueryMsg = | { config: {} @@ -72,12 +71,21 @@ export interface BondingStatusResponse { height: number unbondable_abount: Uint128 } +export type Addr = string export interface Config { denom: string description: string name: string owner: Addr } +export type String = string +export interface InfoResponse { + info: ContractVersion +} +export interface ContractVersion { + contract: string + version: string +} export type ArrayOfTupleOfAddrAndUint128 = [Addr, Uint128][] export interface TotalPowerAtHeightResponse { height: number diff --git a/packages/types/dao.ts b/packages/types/dao.ts index 84acae274..504647fca 100644 --- a/packages/types/dao.ts +++ b/packages/types/dao.ts @@ -569,4 +569,5 @@ export type VotingVaultInfo = export type VotingVaultWithInfo = VotingVault & { info: VotingVaultInfo + totalPower: string } diff --git a/packages/utils/conversion.ts b/packages/utils/conversion.ts index 948727d21..cd62485ea 100644 --- a/packages/utils/conversion.ts +++ b/packages/utils/conversion.ts @@ -301,18 +301,25 @@ export const makeCombineQueryResultsIntoLoadingData = export const makeCombineQueryResultsIntoLoadingDataWithError = ({ firstLoad = 'all', + loadIfNone = false, errorIf = 'any', transform = (results: T[]) => results as R, }: { /** * Whether or not to show loading until all of the results are loaded, at * least one result is loaded, or none of the results are loaded. If 'one', - * will show not loading (just updating) once the first result is loaded. If - * 'none', will never show loading. + * will show not loading again (just updating) once the first result is + * loaded. If 'none', will never show loading. * * Defaults to 'all'. */ firstLoad?: 'all' | 'one' | 'none' + /** + * Whether or not to show loading when no queries are passed. + * + * Defaults to false. + */ + loadIfNone?: boolean /** * Whether or not to show error if any of the results are errored or all. If * set to 'all' but only some of the results are errored, the errored @@ -329,7 +336,8 @@ export const makeCombineQueryResultsIntoLoadingDataWithError = (results: UseQueryResult[]): LoadingDataWithError => { const isLoading = firstLoad === 'all' - ? results.some((r) => r.isPending) + ? (loadIfNone && results.length === 0) || + results.some((r) => r.isPending) : firstLoad === 'one' ? results.length > 0 && results.every((r) => r.isPending) : false From f2a9e7f5972a41613f44a0662dc172c1d376b455 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 29 Aug 2024 20:49:23 +0300 Subject: [PATCH 419/438] fixed wallet DAO filtering --- packages/stateless/components/wallet/WalletDaos.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/stateless/components/wallet/WalletDaos.tsx b/packages/stateless/components/wallet/WalletDaos.tsx index 4a01b5d26..139177678 100644 --- a/packages/stateless/components/wallet/WalletDaos.tsx +++ b/packages/stateless/components/wallet/WalletDaos.tsx @@ -105,8 +105,8 @@ export const WalletDaos = ({ } const FILTERABLE_KEYS: Fuse.FuseOptionKey[] = [ - 'chainId', - 'coreAddress', - 'name', - 'description', + 'info.chainId', + 'info.coreAddress', + 'info.name', + 'info.description', ] From 94315b40eb8210381cfd0a16323beaceef9aa560 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Fri, 30 Aug 2024 08:58:06 +0200 Subject: [PATCH 420/438] added v2.5.0 code IDs for neutron --- packages/utils/constants/chains.ts | 74 ++++++++++++++++-------------- 1 file changed, 40 insertions(+), 34 deletions(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 7049a3121..c56c5d9de 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -881,7 +881,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ mainnet: true, accentColor: '#000000', factoryContractAddress: - 'neutron1xms03jykg6e2g402dxj3cw4q6ygm0r5rctdt5d7j99xehwtevm3sxl52n5', + 'neutron1xsvrsy4m37pay0fkd6ur75hsl8p6netvxvzvpvj7h4tsp9udxuysqxpuzh', govContractAddress: NEUTRON_GOVERNANCE_DAO, subDaos: [ 'neutron1fuyxwxlsgjkfjmxfthq8427dm2am3ya3cwcdr8gls29l7jadtazsuyzwcc', @@ -891,7 +891,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ tx: 'https://neutron.celat.one/neutron-1/txs/REPLACE', wallet: 'https://neutron.celat.one/neutron-1/accounts/REPLACE', }, - codeIdsVersion: ContractVersion.V240, + codeIdsVersion: ContractVersion.V250, codeIds: { // https://github.com/CosmWasm/cw-plus Cw1Whitelist: 552, @@ -899,23 +899,26 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // https://github.com/CosmWasm/cw-nfts Cw721Base: 232, - CwPayrollFactory: 553, - CwTokenSwap: 564, - CwTokenfactoryIssuerMain: 565, - CwVesting: 703, - DaoCore: 567, - DaoMigrator: -1, // not needed since only v2 DAOs exist - DaoPreProposeApprovalSingle: 569, - DaoPreProposeApprover: 570, - DaoPreProposeMultiple: 575, - DaoPreProposeSingle: 571, - DaoProposalMultiple: 572, - DaoProposalSingle: 573, - DaoVotingCw4: 574, - DaoVotingCw721Staked: 576, - DaoVotingTokenStaked: 577, + CwPayrollFactory: 1851, + CwTokenSwap: 1852, + CwTokenfactoryIssuerMain: 1853, + CwVesting: 1854, + DaoCore: 1855, + DaoPreProposeApprovalSingle: 1856, + DaoPreProposeApprover: 1857, + DaoPreProposeMultiple: 1858, + DaoPreProposeSingle: 1859, + DaoProposalMultiple: 1860, + DaoProposalSingle: 1861, + DaoRewardsDistributor: 1862, + DaoVotingCw4: 1863, + DaoVotingCw721Staked: 1864, + DaoVotingTokenStaked: 1865, ValenceAccount: 1618, + + // unused + DaoMigrator: -1, }, historicalCodeIds: { [ContractVersion.V210]: { @@ -2528,13 +2531,13 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ mainnet: false, accentColor: '#000000', factoryContractAddress: - 'neutron1gu2c0ddyrzk78cuzdlwwtz4c07mfyumx43wefe2fgtv5rf7fvlrq5upnkr', + 'neutron1ujfsy8m04mxxam3az6hfxfp2rlky0vk32pknjcwv0weu2fcc2n9sxup3sd', govContractAddress: NEUTRON_GOVERNANCE_DAO, explorerUrlTemplates: { tx: 'https://neutron.celat.one/pion-1/txs/REPLACE', wallet: 'https://neutron.celat.one/pion-1/accounts/REPLACE', }, - codeIdsVersion: ContractVersion.V242, + codeIdsVersion: ContractVersion.V250, codeIds: { // https://github.com/CosmWasm/cw-plus Cw1Whitelist: 4618, @@ -2542,21 +2545,24 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // https://github.com/CosmWasm/cw-nfts Cw721Base: 4620, - CwPayrollFactory: 4622, - CwTokenSwap: 4623, - CwTokenfactoryIssuerMain: 4635, - CwVesting: 4624, - DaoCore: 4625, - DaoMigrator: -1, // not needed since only v2 DAOs exist - DaoPreProposeApprovalSingle: 4627, - DaoPreProposeApprover: 4628, - DaoPreProposeMultiple: 4629, - DaoPreProposeSingle: 4630, - DaoProposalMultiple: 4631, - DaoProposalSingle: 4632, - DaoVotingCw4: 4633, - DaoVotingCw721Staked: 4634, - DaoVotingTokenStaked: 4636, + CwPayrollFactory: 6286, + CwTokenSwap: 6287, + CwTokenfactoryIssuerMain: 6288, + CwVesting: 6289, + DaoCore: 6290, + DaoPreProposeApprovalSingle: 6291, + DaoPreProposeApprover: 6292, + DaoPreProposeMultiple: 6293, + DaoPreProposeSingle: 6294, + DaoProposalMultiple: 6295, + DaoProposalSingle: 6296, + DaoRewardsDistributor: 6297, + DaoVotingCw4: 6298, + DaoVotingCw721Staked: 6299, + DaoVotingTokenStaked: 6300, + + // unused + DaoMigrator: -1, }, }, { From acbc039dd3a9be736e7cc79fb026b7e1af7a9a6e Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Sat, 31 Aug 2024 22:43:16 +0530 Subject: [PATCH 421/438] Create .env --- apps/dapp/.env | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 apps/dapp/.env diff --git a/apps/dapp/.env b/apps/dapp/.env new file mode 100644 index 000000000..1eac362a6 --- /dev/null +++ b/apps/dapp/.env @@ -0,0 +1,54 @@ +NEXT_PUBLIC_MAINNET=true + +NEXT_PUBLIC_SITE_URL=https://daodao.zone +NEXT_PUBLIC_LEGACY_URL_PREFIX=https://legacy.daodao.zone +NEXT_PUBLIC_DAO_DAO_DAO_ADDRESS=juno10h0hc64jv006rr8qy0zhlu4jsxct8qwa0vtaleayh0ujz0zynf2s2r7v8q + +# https://dashboard.web3auth.io +NEXT_PUBLIC_WEB3AUTH_CLIENT_ID=BMGcq4QJkuTZoUZl3P_jk4X5uy3BsamFBzaFRmhwkRf16B3m4ZW--pP7Nbk8zlOt-u5SuXYbs2KigxnxxEz437k + +# Stargaze +NEXT_PUBLIC_STARGAZE_GQL_INDEXER_URI=https://graphql.mainnet.stargaze-apis.com/graphql +NEXT_PUBLIC_STARGAZE_URL_BASE=https://stargaze.zone +NEXT_PUBLIC_STARGAZE_NAMES_CONTRACT=stars1fx74nkqkw2748av8j7ew7r3xt9cgjqduwn8m0ur5lhe49uhlsasszc5fhr + +# Wallet profiles +NEXT_PUBLIC_PFPK_API_BASE=https://pfpk.daodao.zone + +# Search +NEXT_PUBLIC_SEARCH_HOST=https://search.daodao.zone +NEXT_PUBLIC_SEARCH_API_KEY=1d599098d24298ffd8b295508eaedccb149163f847b862069cc6de31495dc71b + +# Filebase +FILEBASE_ACCESS_KEY_ID= +FILEBASE_SECRET_ACCESS_KEY= +FILEBASE_BUCKET=dao-dao-ui + +# Payroll +NEXT_PUBLIC_RETROACTIVE_COMPENSATION_API_BASE=https://retroactive-compensation.daodao.zone + +NEXT_PUBLIC_FAST_AVERAGE_COLOR_API_TEMPLATE=https://fac.withoutdoing.com/URL + +# Comma separated list of action keys to disable. +NEXT_PUBLIC_DISABLED_ACTIONS= + +# Discord notifications +NEXT_PUBLIC_DISCORD_NOTIFIER_CLIENT_ID=1060326264801595402 +NEXT_PUBLIC_DISCORD_NOTIFIER_API_BASE=https://discord-notifier.daodao.zone + +# Inbox +NEXT_PUBLIC_INBOX_API_BASE=https://inbox.daodao.zone + +# KVPK +NEXT_PUBLIC_KVPK_API_BASE=https://kvpk.daodao.zone + +# Kado API +NEXT_PUBLIC_KADO_API_KEY=bcee9402-d79f-427b-bafd-dd111e4ce287 + +# WebSockets API +NEXT_PUBLIC_WEB_SOCKET_PUSHER_APP_KEY=daodao +NEXT_PUBLIC_WEB_SOCKET_PUSHER_HOST=ws.daodao.zone +NEXT_PUBLIC_WEB_SOCKET_PUSHER_PORT=443 + +# Web Push +NEXT_PUBLIC_WEB_PUSH_PUBLIC_KEY=BIB5MGacpO1AsiCWPIKeJo3VUz2c9UPvwNuHyxVT+cROGstU3wJs++GyQFmONZjBN9aqdqFi8j2NSnmTPl/PA2w= From 4b2d6b228c3f67cea4ccf9b4beb2e0d4f6dac700 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Sat, 31 Aug 2024 23:55:35 +0530 Subject: [PATCH 422/438] Update chains.ts --- packages/utils/constants/chains.ts | 43 ++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index c56c5d9de..d55c5fa3e 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -1703,6 +1703,49 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ }, }, }, + { + chainId: ChainId.QuasarTestnet, + name: 'quasar', + mainnet: false, + accentColor: '#3ccd64', + factoryContractAddress: + 'quasar1sjce8d68wuf8g6rta23du4ellyt3j4hw3yhwxt29d8n48cjygevsanfvsc', + explorerUrlTemplates: { + tx: 'https://testnet.ping.pub/Quasar%20Test/tx/REPLACE', + gov: 'https://testnet.ping.pub//Quasar%20Test/gov', + govProp: 'https://testnet.ping.pub/Quasar%20Test/gov/REPLACE', + wallet: 'https://testnet.ping.pub/Quasar%20Test/account/REPLACE', + }, + indexes: { + search: 'quasar_testnet_daos', + // Use same as mainnet. + featured: 'quasar_featured_daos', + }, + codeIds: { + // https://github.com/CosmWasm/cw-plus + // Cw1Whitelist: 60, + Cw4Group: 58, // v0.16 + // https://github.com/CosmWasm/cw-nfts + Cw721Base: 59, + + // ContractVersion.V240 + CwPayrollFactory: 32, + CwTokenSwap: 34, + CwTokenfactoryIssuer: 33, + CwVesting: 35, + DaoCore: 36, + DaoMigrator: 37, + // DaoPreProposeApprovalSingle: 38, + // DaoPreProposeApprover: 39, + DaoPreProposeMultiple: 40, + DaoPreProposeSingle: 41, + DaoProposalMultiple: 44, + DaoProposalSingle: 45, + DaoVotingCw4: 50, + DaoVotingCw721Staked: 52, + DaoVotingTokenStaked: 53, + }, + }, { // Ensure this chain stays below Terra so that the logic in // makeGetDaoStaticProps works with Terra Classic fallback. From 3d9a5dd275880063ae3d2dbdc34e35823e4d37d4 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Sat, 31 Aug 2024 23:57:03 +0530 Subject: [PATCH 423/438] Update chain.ts --- packages/types/chain.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/types/chain.ts b/packages/types/chain.ts index f7e7a407f..f39d1a936 100644 --- a/packages/types/chain.ts +++ b/packages/types/chain.ts @@ -83,6 +83,7 @@ export enum ChainId { OmniflixHubTestnet = 'flixnet-4', SecretMainnet = 'secret-4', SecretTestnet = 'pulsar-3', + QuasarTestnet = 'quasar-test-1', } export type BaseChainConfig = { From 84d8ed488cb4668a9c27c327ae68d169b66dcd1b Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Sun, 1 Sep 2024 00:06:46 +0530 Subject: [PATCH 424/438] Update chains.ts --- packages/utils/constants/chains.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index d55c5fa3e..4212c22c8 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -2886,6 +2886,10 @@ export const CHAIN_ENDPOINTS: Partial< rpc: 'https://rpc.pulsar.scrttestnet.com', rest: 'https://api.pulsar.scrttestnet.com', }, + [ChainId.QuasarTestnet]: { + rpc: 'https://quasar-testnet-rpc.polkachu.com/', + rest: 'https://quasar-testnet-api.polkachu.com/', + }, } // The chains not to show in the governance UI. From 9b3609fc0d15f4f8d932234b5861bd7132be1f30 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Sun, 1 Sep 2024 00:15:25 +0530 Subject: [PATCH 425/438] Update chains.ts --- packages/utils/constants/chains.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 4212c22c8..7e653b4d7 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -1731,7 +1731,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ // ContractVersion.V240 CwPayrollFactory: 32, CwTokenSwap: 34, - CwTokenfactoryIssuer: 33, + // CwTokenfactoryIssuer: 33, CwVesting: 35, DaoCore: 36, DaoMigrator: 37, From 22e6063ec9bdff367b709007a66ca92bcc6792e6 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Sun, 1 Sep 2024 00:24:51 +0530 Subject: [PATCH 426/438] Update chains.ts --- packages/utils/constants/chains.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 7e653b4d7..d53538ae9 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -1723,7 +1723,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ }, codeIds: { // https://github.com/CosmWasm/cw-plus - // Cw1Whitelist: 60, + Cw1Whitelist: 60, Cw4Group: 58, // v0.16 // https://github.com/CosmWasm/cw-nfts Cw721Base: 59, @@ -1735,8 +1735,8 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ CwVesting: 35, DaoCore: 36, DaoMigrator: 37, - // DaoPreProposeApprovalSingle: 38, - // DaoPreProposeApprover: 39, + DaoPreProposeApprovalSingle: 38, + DaoPreProposeApprover: 39, DaoPreProposeMultiple: 40, DaoPreProposeSingle: 41, DaoProposalMultiple: 44, From d34afcd4b481381cf53c4a086dbe331aa0a4e78e Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Sun, 1 Sep 2024 00:28:50 +0530 Subject: [PATCH 427/438] Update chains.ts --- packages/utils/constants/chains.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index d53538ae9..4b1751b1e 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -1732,6 +1732,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ CwPayrollFactory: 32, CwTokenSwap: 34, // CwTokenfactoryIssuer: 33, + CwTokenfactoryIssuerMain:33, CwVesting: 35, DaoCore: 36, DaoMigrator: 37, From eca207f42b904a3d56fe2dbb6eeae93816863363 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Sun, 1 Sep 2024 00:33:33 +0530 Subject: [PATCH 428/438] Update chains.ts --- packages/utils/constants/chains.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 4b1751b1e..7109e2ade 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -1716,11 +1716,6 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ govProp: 'https://testnet.ping.pub/Quasar%20Test/gov/REPLACE', wallet: 'https://testnet.ping.pub/Quasar%20Test/account/REPLACE', }, - indexes: { - search: 'quasar_testnet_daos', - // Use same as mainnet. - featured: 'quasar_featured_daos', - }, codeIds: { // https://github.com/CosmWasm/cw-plus Cw1Whitelist: 60, From a4c65ce783436a66126c5216f27c62a81b0f3b6c Mon Sep 17 00:00:00 2001 From: akure Date: Sun, 1 Sep 2024 13:20:11 +0530 Subject: [PATCH 429/438] updated ChainID for quasar testnet --- .vscode/settings.json | 4 ++++ packages/utils/constants/chains.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/.vscode/settings.json b/.vscode/settings.json index f99f36fd9..a257783e0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -33,6 +33,10 @@ { "pattern": "packages/*", "!cwd": false + }, + { + "pattern": "node_modules/*", + "!cwd": false } ], "eslint.validate": [ diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 7109e2ade..855584b37 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -1716,6 +1716,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ govProp: 'https://testnet.ping.pub/Quasar%20Test/gov/REPLACE', wallet: 'https://testnet.ping.pub/Quasar%20Test/account/REPLACE', }, + codeIdsVersion: ContractVersion.V240, codeIds: { // https://github.com/CosmWasm/cw-plus Cw1Whitelist: 60, From b9bc44e81fe77b664eb6b6a3de570f817ab4bb20 Mon Sep 17 00:00:00 2001 From: akure Date: Sun, 1 Sep 2024 14:07:37 +0530 Subject: [PATCH 430/438] update .env for testnet --- apps/dapp/.env | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/apps/dapp/.env b/apps/dapp/.env index 1eac362a6..9339522c0 100644 --- a/apps/dapp/.env +++ b/apps/dapp/.env @@ -1,16 +1,15 @@ -NEXT_PUBLIC_MAINNET=true +NEXT_PUBLIC_MAINNET=false -NEXT_PUBLIC_SITE_URL=https://daodao.zone -NEXT_PUBLIC_LEGACY_URL_PREFIX=https://legacy.daodao.zone -NEXT_PUBLIC_DAO_DAO_DAO_ADDRESS=juno10h0hc64jv006rr8qy0zhlu4jsxct8qwa0vtaleayh0ujz0zynf2s2r7v8q +NEXT_PUBLIC_SITE_URL=https://testnet.daodao.zone +NEXT_PUBLIC_DAO_DAO_DAO_ADDRESS= # https://dashboard.web3auth.io -NEXT_PUBLIC_WEB3AUTH_CLIENT_ID=BMGcq4QJkuTZoUZl3P_jk4X5uy3BsamFBzaFRmhwkRf16B3m4ZW--pP7Nbk8zlOt-u5SuXYbs2KigxnxxEz437k +NEXT_PUBLIC_WEB3AUTH_CLIENT_ID=BKloh0zJRJMSnZnro2qr6eDkT2echfshttYXPnCwb7BcAawwYJF9Df_xDoXGD4EE_l2tToFoByp890nl8HTGKMY # Stargaze -NEXT_PUBLIC_STARGAZE_GQL_INDEXER_URI=https://graphql.mainnet.stargaze-apis.com/graphql -NEXT_PUBLIC_STARGAZE_URL_BASE=https://stargaze.zone -NEXT_PUBLIC_STARGAZE_NAMES_CONTRACT=stars1fx74nkqkw2748av8j7ew7r3xt9cgjqduwn8m0ur5lhe49uhlsasszc5fhr +NEXT_PUBLIC_STARGAZE_GQL_INDEXER_URI=https://galaxy-graphql-testnet.fly.dev/graphql +NEXT_PUBLIC_STARGAZE_URL_BASE=https://testnet.publicawesome.dev +NEXT_PUBLIC_STARGAZE_NAMES_CONTRACT=stars1rgn9tuxnl3ju9td3mfxdl2vm4t8xuaztcdakgtyx23c4ffm97cus25fvjs # Wallet profiles NEXT_PUBLIC_PFPK_API_BASE=https://pfpk.daodao.zone @@ -32,7 +31,7 @@ NEXT_PUBLIC_FAST_AVERAGE_COLOR_API_TEMPLATE=https://fac.withoutdoing.com/URL # Comma separated list of action keys to disable. NEXT_PUBLIC_DISABLED_ACTIONS= -# Discord notifications +# Discord notifier NEXT_PUBLIC_DISCORD_NOTIFIER_CLIENT_ID=1060326264801595402 NEXT_PUBLIC_DISCORD_NOTIFIER_API_BASE=https://discord-notifier.daodao.zone From ca6ca84d285d0fc791d900a3a2f8c307f6350af5 Mon Sep 17 00:00:00 2001 From: akure Date: Sun, 1 Sep 2024 16:52:12 +0530 Subject: [PATCH 431/438] add catch error in static page gen. --- apps/dapp/pages/[[...tab]].tsx | 179 ++++++++++++++++++--------------- 1 file changed, 99 insertions(+), 80 deletions(-) diff --git a/apps/dapp/pages/[[...tab]].tsx b/apps/dapp/pages/[[...tab]].tsx index 45a067029..d6df1156a 100644 --- a/apps/dapp/pages/[[...tab]].tsx +++ b/apps/dapp/pages/[[...tab]].tsx @@ -33,94 +33,113 @@ export const getStaticProps: GetStaticProps = async ({ params, }) => { const tabPath = - params?.tab && Array.isArray(params?.tab) ? params.tab[0] : undefined + params?.tab && Array.isArray(params?.tab) ? params.tab[0] : undefined - // If defined, try to find matching chain. If found, show chain-only page. - const selectedChain = tabPath - ? getSupportedChains().find(({ name }) => name === tabPath) - : undefined - const chainId = selectedChain?.chainId +// If defined, try to find matching chain. If found, show chain-only page. +const selectedChain = tabPath + ? getSupportedChains().find(({ name }) => name === tabPath) + : undefined +const chainId = selectedChain?.chainId - const chainGovDaos = chainId - ? selectedChain.noGov - ? undefined - : [getDaoInfoForChainId(chainId, [])] - : // Get chain x/gov DAOs if not on a chain-specific home. - [ - // Add DAO DAO-supported chains. - ...getSupportedChains().flatMap(({ chainId, noGov }) => - noGov ? [] : chainId - ), - // Add some other common chains. - ...(MAINNET - ? [ - 'akashnet-2', - 'secret-4', - 'regen-1', - 'injective-1', - 'celestia', - 'archway-1', - ] - : []), - ].map((chainId) => getDaoInfoForChainId(chainId, [])) +const chainGovDaos = chainId + ? selectedChain.noGov + ? undefined + : [getDaoInfoForChainId(chainId, [])] + : // Get chain x/gov DAOs if not on a chain-specific home. + [ + // Add DAO DAO-supported chains. + ...getSupportedChains().flatMap(({ chainId, noGov }) => + noGov ? [] : chainId + ), + // Add some other common chains. + ...(MAINNET + ? [ + 'akashnet-2', + 'secret-4', + 'regen-1', + 'injective-1', + 'celestia', + 'archway-1', + ] + : []), + ].map((chainId) => getDaoInfoForChainId(chainId, [])) - const [i18nProps, tvl, allStats, monthStats, weekStats] = await Promise.all([ - // Get i18n translations props. - serverSideTranslations(locale, ['translation']), +const [i18nProps, tvl, allStats, monthStats, weekStats] = await Promise.all([ + // Get i18n translations props. + serverSideTranslations(locale, ['translation']), - // Get all or chain-specific stats and TVL. - !chainId || chainIsIndexed(chainId) - ? queryClient - .fetchQuery( - indexerQueries.snapper({ - query: chainId ? 'daodao-chain-tvl' : 'daodao-all-tvl', - parameters: chainId ? { chainId } : undefined, - }) - ) - .catch(() => 0) - : null, - !chainId || chainIsIndexed(chainId) - ? queryClient.fetchQuery( - indexerQueries.snapper({ - query: chainId ? 'daodao-chain-stats' : 'daodao-all-stats', + // Get all or chain-specific stats and TVL. + !chainId || chainIsIndexed(chainId) + ? queryClient + .fetchQuery( + indexerQueries.snapper({ + query: chainId ? 'daodao-chain-tvl' : 'daodao-all-tvl', parameters: chainId ? { chainId } : undefined, }) ) - : null, - !chainId || chainIsIndexed(chainId) - ? queryClient.fetchQuery( - indexerQueries.snapper({ - query: chainId ? 'daodao-chain-stats' : 'daodao-all-stats', - parameters: { - ...(chainId ? { chainId } : undefined), - daysAgo: 30, - }, - }) - ) - : null, - !chainId || chainIsIndexed(chainId) - ? queryClient.fetchQuery( - indexerQueries.snapper({ - query: chainId ? 'daodao-chain-stats' : 'daodao-all-stats', - parameters: { - ...(chainId ? { chainId } : undefined), - daysAgo: 7, - }, - }) - ) - : null, + .catch((error) => { + console.error(`Error fetching TVL for chain ${chainId}:`, error) + return null + }) + : null, + !chainId || chainIsIndexed(chainId) + ? queryClient.fetchQuery( + indexerQueries.snapper({ + query: chainId ? 'daodao-chain-stats' : 'daodao-all-stats', + parameters: chainId ? { chainId } : undefined, + }) + ) + .catch((error) => { + console.error(`Error fetching stats for chain ${chainId}:`, error) + return null + }) + : null, + !chainId || chainIsIndexed(chainId) + ? queryClient.fetchQuery( + indexerQueries.snapper({ + query: chainId ? 'daodao-chain-stats' : 'daodao-all-stats', + parameters: { + ...(chainId ? { chainId } : undefined), + daysAgo: 30, + }, + }) + ) + .catch((error) => { + console.error(`Error fetching 30-day stats for chain ${chainId}:`, error) + return null + }) + : null, + !chainId || chainIsIndexed(chainId) + ? queryClient.fetchQuery( + indexerQueries.snapper({ + query: chainId ? 'daodao-chain-stats' : 'daodao-all-stats', + parameters: { + ...(chainId ? { chainId } : undefined), + daysAgo: 7, + }, + }) + ) + .catch((error) => { + console.error(`Error fetching 7-day stats for chain ${chainId}:`, error) + return null + }) + : null, - // Pre-fetch featured DAOs. - queryClient - .fetchQuery(daoQueries.listFeatured()) - .then((featured) => - Promise.all( - featured?.map((dao) => - queryClient.fetchQuery(statefulDaoQueries.info(queryClient, dao)) - ) || [] - ) - ), - ]) + // Pre-fetch featured DAOs. + queryClient + .fetchQuery(daoQueries.listFeatured()) + .then((featured) => + Promise.all( + featured?.map((dao) => + queryClient.fetchQuery(statefulDaoQueries.info(queryClient, dao)) + ) || [] + ) + ) + .catch((error) => { + console.error(`Error fetching featured DAOs:`, error) + return [] + }), +]) return { props: { From dda8ca592aba49f5dae0e267948f0a845a8c64e0 Mon Sep 17 00:00:00 2001 From: akure Date: Sun, 1 Sep 2024 17:27:57 +0530 Subject: [PATCH 432/438] fix pretty --- apps/dapp/pages/[[...tab]].tsx | 209 +++++++++++++++++---------------- 1 file changed, 109 insertions(+), 100 deletions(-) diff --git a/apps/dapp/pages/[[...tab]].tsx b/apps/dapp/pages/[[...tab]].tsx index d6df1156a..6cea42ada 100644 --- a/apps/dapp/pages/[[...tab]].tsx +++ b/apps/dapp/pages/[[...tab]].tsx @@ -33,113 +33,122 @@ export const getStaticProps: GetStaticProps = async ({ params, }) => { const tabPath = - params?.tab && Array.isArray(params?.tab) ? params.tab[0] : undefined + params?.tab && Array.isArray(params?.tab) ? params.tab[0] : undefined -// If defined, try to find matching chain. If found, show chain-only page. -const selectedChain = tabPath - ? getSupportedChains().find(({ name }) => name === tabPath) - : undefined -const chainId = selectedChain?.chainId + // If defined, try to find matching chain. If found, show chain-only page. + const selectedChain = tabPath + ? getSupportedChains().find(({ name }) => name === tabPath) + : undefined + const chainId = selectedChain?.chainId -const chainGovDaos = chainId - ? selectedChain.noGov - ? undefined - : [getDaoInfoForChainId(chainId, [])] - : // Get chain x/gov DAOs if not on a chain-specific home. - [ - // Add DAO DAO-supported chains. - ...getSupportedChains().flatMap(({ chainId, noGov }) => - noGov ? [] : chainId - ), - // Add some other common chains. - ...(MAINNET - ? [ - 'akashnet-2', - 'secret-4', - 'regen-1', - 'injective-1', - 'celestia', - 'archway-1', - ] - : []), - ].map((chainId) => getDaoInfoForChainId(chainId, [])) + const chainGovDaos = chainId + ? selectedChain.noGov + ? undefined + : [getDaoInfoForChainId(chainId, [])] + : // Get chain x/gov DAOs if not on a chain-specific home. + [ + // Add DAO DAO-supported chains. + ...getSupportedChains().flatMap(({ chainId, noGov }) => + noGov ? [] : chainId + ), + // Add some other common chains. + ...(MAINNET + ? [ + 'akashnet-2', + 'secret-4', + 'regen-1', + 'injective-1', + 'celestia', + 'archway-1', + ] + : []), + ].map((chainId) => getDaoInfoForChainId(chainId, [])) -const [i18nProps, tvl, allStats, monthStats, weekStats] = await Promise.all([ - // Get i18n translations props. - serverSideTranslations(locale, ['translation']), + const [i18nProps, tvl, allStats, monthStats, weekStats] = await Promise.all([ + // Get i18n translations props. + serverSideTranslations(locale, ['translation']), - // Get all or chain-specific stats and TVL. - !chainId || chainIsIndexed(chainId) - ? queryClient - .fetchQuery( - indexerQueries.snapper({ - query: chainId ? 'daodao-chain-tvl' : 'daodao-all-tvl', - parameters: chainId ? { chainId } : undefined, + // Get all or chain-specific stats and TVL. + !chainId || chainIsIndexed(chainId) + ? queryClient + .fetchQuery( + indexerQueries.snapper({ + query: chainId ? 'daodao-chain-tvl' : 'daodao-all-tvl', + parameters: chainId ? { chainId } : undefined, + }) + ) + .catch((error) => { + console.error(`Error fetching TVL for chain ${chainId}:`, error) + return null }) - ) - .catch((error) => { - console.error(`Error fetching TVL for chain ${chainId}:`, error) - return null - }) - : null, - !chainId || chainIsIndexed(chainId) - ? queryClient.fetchQuery( - indexerQueries.snapper({ - query: chainId ? 'daodao-chain-stats' : 'daodao-all-stats', - parameters: chainId ? { chainId } : undefined, - }) - ) - .catch((error) => { - console.error(`Error fetching stats for chain ${chainId}:`, error) - return null - }) - : null, - !chainId || chainIsIndexed(chainId) - ? queryClient.fetchQuery( - indexerQueries.snapper({ - query: chainId ? 'daodao-chain-stats' : 'daodao-all-stats', - parameters: { - ...(chainId ? { chainId } : undefined), - daysAgo: 30, - }, - }) - ) - .catch((error) => { - console.error(`Error fetching 30-day stats for chain ${chainId}:`, error) - return null - }) - : null, - !chainId || chainIsIndexed(chainId) - ? queryClient.fetchQuery( - indexerQueries.snapper({ - query: chainId ? 'daodao-chain-stats' : 'daodao-all-stats', - parameters: { - ...(chainId ? { chainId } : undefined), - daysAgo: 7, - }, - }) - ) - .catch((error) => { - console.error(`Error fetching 7-day stats for chain ${chainId}:`, error) - return null - }) - : null, + : null, + !chainId || chainIsIndexed(chainId) + ? queryClient + .fetchQuery( + indexerQueries.snapper({ + query: chainId ? 'daodao-chain-stats' : 'daodao-all-stats', + parameters: chainId ? { chainId } : undefined, + }) + ) + .catch((error) => { + console.error(`Error fetching stats for chain ${chainId}:`, error) + return null + }) + : null, + !chainId || chainIsIndexed(chainId) + ? queryClient + .fetchQuery( + indexerQueries.snapper({ + query: chainId ? 'daodao-chain-stats' : 'daodao-all-stats', + parameters: { + ...(chainId ? { chainId } : undefined), + daysAgo: 30, + }, + }) + ) + .catch((error) => { + console.error( + `Error fetching 30-day stats for chain ${chainId}:`, + error + ) + return null + }) + : null, + !chainId || chainIsIndexed(chainId) + ? queryClient + .fetchQuery( + indexerQueries.snapper({ + query: chainId ? 'daodao-chain-stats' : 'daodao-all-stats', + parameters: { + ...(chainId ? { chainId } : undefined), + daysAgo: 7, + }, + }) + ) + .catch((error) => { + console.error( + `Error fetching 7-day stats for chain ${chainId}:`, + error + ) + return null + }) + : null, - // Pre-fetch featured DAOs. - queryClient - .fetchQuery(daoQueries.listFeatured()) - .then((featured) => - Promise.all( - featured?.map((dao) => - queryClient.fetchQuery(statefulDaoQueries.info(queryClient, dao)) - ) || [] + // Pre-fetch featured DAOs. + queryClient + .fetchQuery(daoQueries.listFeatured()) + .then((featured) => + Promise.all( + featured?.map((dao) => + queryClient.fetchQuery(statefulDaoQueries.info(queryClient, dao)) + ) || [] + ) ) - ) - .catch((error) => { - console.error(`Error fetching featured DAOs:`, error) - return [] - }), -]) + .catch((error) => { + console.error(`Error fetching featured DAOs:`, error) + return [] + }), + ]) return { props: { From 5d1dc1a7c60fed043018f07c97c14b28ae913101 Mon Sep 17 00:00:00 2001 From: akure Date: Sun, 1 Sep 2024 17:41:20 +0530 Subject: [PATCH 433/438] add default values --- apps/dapp/pages/[[...tab]].tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/dapp/pages/[[...tab]].tsx b/apps/dapp/pages/[[...tab]].tsx index 6cea42ada..19d09f44d 100644 --- a/apps/dapp/pages/[[...tab]].tsx +++ b/apps/dapp/pages/[[...tab]].tsx @@ -79,9 +79,9 @@ export const getStaticProps: GetStaticProps = async ({ ) .catch((error) => { console.error(`Error fetching TVL for chain ${chainId}:`, error) - return null + return 0 // Default value }) - : null, + : 0, !chainId || chainIsIndexed(chainId) ? queryClient .fetchQuery( @@ -92,9 +92,9 @@ export const getStaticProps: GetStaticProps = async ({ ) .catch((error) => { console.error(`Error fetching stats for chain ${chainId}:`, error) - return null + return { total: 0, unique: 0, active: 0 } // Default value }) - : null, + : { total: 0, unique: 0, active: 0 }, !chainId || chainIsIndexed(chainId) ? queryClient .fetchQuery( @@ -111,9 +111,9 @@ export const getStaticProps: GetStaticProps = async ({ `Error fetching 30-day stats for chain ${chainId}:`, error ) - return null + return { total: 0, unique: 0, active: 0 } // Default value }) - : null, + : { total: 0, unique: 0, active: 0 }, !chainId || chainIsIndexed(chainId) ? queryClient .fetchQuery( @@ -130,9 +130,9 @@ export const getStaticProps: GetStaticProps = async ({ `Error fetching 7-day stats for chain ${chainId}:`, error ) - return null + return { total: 0, unique: 0, active: 0 } // Default value }) - : null, + : { total: 0, unique: 0, active: 0 }, // Pre-fetch featured DAOs. queryClient From d0635032651c2474d343fd7380147be792eab9a5 Mon Sep 17 00:00:00 2001 From: akure Date: Mon, 2 Sep 2024 07:58:14 +0530 Subject: [PATCH 434/438] updated contract version --- packages/utils/constants/chains.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/utils/constants/chains.ts b/packages/utils/constants/chains.ts index 855584b37..d65345568 100644 --- a/packages/utils/constants/chains.ts +++ b/packages/utils/constants/chains.ts @@ -1716,7 +1716,7 @@ export const SUPPORTED_CHAINS: SupportedChainConfig[] = [ govProp: 'https://testnet.ping.pub/Quasar%20Test/gov/REPLACE', wallet: 'https://testnet.ping.pub/Quasar%20Test/account/REPLACE', }, - codeIdsVersion: ContractVersion.V240, + codeIdsVersion: ContractVersion.V230, codeIds: { // https://github.com/CosmWasm/cw-plus Cw1Whitelist: 60, From abf01f8fbaf66802f3202318d37e1eab420622df Mon Sep 17 00:00:00 2001 From: akure Date: Mon, 2 Sep 2024 08:33:53 +0530 Subject: [PATCH 435/438] try fixing static page gen. --- apps/dapp/pages/[[...tab]].tsx | 65 +++++++++++++++++----------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/apps/dapp/pages/[[...tab]].tsx b/apps/dapp/pages/[[...tab]].tsx index 19d09f44d..256deb133 100644 --- a/apps/dapp/pages/[[...tab]].tsx +++ b/apps/dapp/pages/[[...tab]].tsx @@ -2,7 +2,6 @@ // See the "LICENSE" file in the root directory of this package for more copyright information. import { GetStaticPaths, GetStaticProps } from 'next' - import { serverSideTranslations } from '@dao-dao/i18n/serverSideTranslations' import { daoQueries, @@ -35,7 +34,6 @@ export const getStaticProps: GetStaticProps = async ({ const tabPath = params?.tab && Array.isArray(params?.tab) ? params.tab[0] : undefined - // If defined, try to find matching chain. If found, show chain-only page. const selectedChain = tabPath ? getSupportedChains().find(({ name }) => name === tabPath) : undefined @@ -45,13 +43,10 @@ export const getStaticProps: GetStaticProps = async ({ ? selectedChain.noGov ? undefined : [getDaoInfoForChainId(chainId, [])] - : // Get chain x/gov DAOs if not on a chain-specific home. - [ - // Add DAO DAO-supported chains. + : [ ...getSupportedChains().flatMap(({ chainId, noGov }) => noGov ? [] : chainId ), - // Add some other common chains. ...(MAINNET ? [ 'akashnet-2', @@ -65,10 +60,7 @@ export const getStaticProps: GetStaticProps = async ({ ].map((chainId) => getDaoInfoForChainId(chainId, [])) const [i18nProps, tvl, allStats, monthStats, weekStats] = await Promise.all([ - // Get i18n translations props. serverSideTranslations(locale, ['translation']), - - // Get all or chain-specific stats and TVL. !chainId || chainIsIndexed(chainId) ? queryClient .fetchQuery( @@ -79,7 +71,7 @@ export const getStaticProps: GetStaticProps = async ({ ) .catch((error) => { console.error(`Error fetching TVL for chain ${chainId}:`, error) - return 0 // Default value + return 0 }) : 0, !chainId || chainIsIndexed(chainId) @@ -92,9 +84,9 @@ export const getStaticProps: GetStaticProps = async ({ ) .catch((error) => { console.error(`Error fetching stats for chain ${chainId}:`, error) - return { total: 0, unique: 0, active: 0 } // Default value + return null as DaoDaoIndexerChainStats | null }) - : { total: 0, unique: 0, active: 0 }, + : null, !chainId || chainIsIndexed(chainId) ? queryClient .fetchQuery( @@ -111,9 +103,9 @@ export const getStaticProps: GetStaticProps = async ({ `Error fetching 30-day stats for chain ${chainId}:`, error ) - return { total: 0, unique: 0, active: 0 } // Default value + return null as DaoDaoIndexerChainStats | null }) - : { total: 0, unique: 0, active: 0 }, + : null, !chainId || chainIsIndexed(chainId) ? queryClient .fetchQuery( @@ -130,11 +122,10 @@ export const getStaticProps: GetStaticProps = async ({ `Error fetching 7-day stats for chain ${chainId}:`, error ) - return { total: 0, unique: 0, active: 0 } // Default value + return null as DaoDaoIndexerChainStats | null }) - : { total: 0, unique: 0, active: 0 }, + : null, - // Pre-fetch featured DAOs. queryClient .fetchQuery(daoQueries.listFeatured()) .then((featured) => @@ -150,45 +141,53 @@ export const getStaticProps: GetStaticProps = async ({ }), ]) + const stats = { + all: allStats || { + daos: 0, + proposals: 0, + votes: 0, + uniqueVoters: 0, + }, + month: monthStats || { + daos: 0, + proposals: 0, + votes: 0, + uniqueVoters: 0, + }, + week: weekStats || { + daos: 0, + proposals: 0, + votes: 0, + uniqueVoters: 0, + }, + tvl, + chains: chainId ? 1 : getSupportedChains().length, + } + return { props: { ...i18nProps, - // Chain-specific home page. ...(chainId && { chainId }), - // All or chain-specific stats. - stats: { - all: allStats, - month: monthStats, - week: weekStats, - tvl, - // If chain is 1, it will not be shown. - chains: chainId ? 1 : getSupportedChains().length, - }, - // Chain x/gov DAOs. + stats, ...(chainGovDaos && { chainGovDaos }), - // Dehydrate react-query state with featured DAOs preloaded. reactQueryDehydratedState: dehydrateSerializable(queryClient), }, - // Revalidate every 6 hours. revalidate: 6 * 60 * 60, } } export const getStaticPaths: GetStaticPaths = () => ({ paths: [ - // Index page with no tab specified. { params: { tab: [], }, }, - // All tabs. ...Object.values(AccountTabId).map((tab) => ({ params: { tab: [tab], }, })), - // All chains. ...getSupportedChains().map(({ name }) => ({ params: { tab: [name], From 2e4919911f184bf41d046a0da0ace32372b68cd6 Mon Sep 17 00:00:00 2001 From: akure Date: Mon, 2 Sep 2024 08:40:00 +0530 Subject: [PATCH 436/438] fix lint issue --- apps/dapp/pages/[[...tab]].tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/dapp/pages/[[...tab]].tsx b/apps/dapp/pages/[[...tab]].tsx index 256deb133..b10862dc6 100644 --- a/apps/dapp/pages/[[...tab]].tsx +++ b/apps/dapp/pages/[[...tab]].tsx @@ -2,19 +2,24 @@ // See the "LICENSE" file in the root directory of this package for more copyright information. import { GetStaticPaths, GetStaticProps } from 'next' + import { serverSideTranslations } from '@dao-dao/i18n/serverSideTranslations' + import { daoQueries, dehydrateSerializable, indexerQueries, makeReactQueryClient, } from '@dao-dao/state' + import { Home, StatefulHomeProps, daoQueries as statefulDaoQueries, } from '@dao-dao/stateful' + import { AccountTabId, DaoDaoIndexerChainStats } from '@dao-dao/types' + import { MAINNET, chainIsIndexed, From f6f007bc3026676ca2e89293d18e041f09d0939a Mon Sep 17 00:00:00 2001 From: akure Date: Mon, 2 Sep 2024 08:52:11 +0530 Subject: [PATCH 437/438] fix lint issue --- apps/dapp/pages/[[...tab]].tsx | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/apps/dapp/pages/[[...tab]].tsx b/apps/dapp/pages/[[...tab]].tsx index b10862dc6..ddfb1fcce 100644 --- a/apps/dapp/pages/[[...tab]].tsx +++ b/apps/dapp/pages/[[...tab]].tsx @@ -1,31 +1,28 @@ // GNU AFFERO GENERAL PUBLIC LICENSE Version 3. Copyright (C) 2022 DAO DAO Contributors. // See the "LICENSE" file in the root directory of this package for more copyright information. -import { GetStaticPaths, GetStaticProps } from 'next' - -import { serverSideTranslations } from '@dao-dao/i18n/serverSideTranslations' +import { GetStaticPaths, GetStaticProps } from 'next'; +import { serverSideTranslations } from '@dao-dao/i18n/serverSideTranslations'; import { daoQueries, dehydrateSerializable, indexerQueries, makeReactQueryClient, -} from '@dao-dao/state' - +} from '@dao-dao/state'; import { Home, StatefulHomeProps, daoQueries as statefulDaoQueries, -} from '@dao-dao/stateful' - -import { AccountTabId, DaoDaoIndexerChainStats } from '@dao-dao/types' - +} from '@dao-dao/stateful'; +import { AccountTabId, DaoDaoIndexerChainStats } from '@dao-dao/types'; import { MAINNET, chainIsIndexed, getDaoInfoForChainId, getSupportedChains, -} from '@dao-dao/utils' +} from '@dao-dao/utils'; + export default Home From d2919ccb0a588d464dce3d543a76a0fb83dcc1c1 Mon Sep 17 00:00:00 2001 From: akure Date: Mon, 2 Sep 2024 08:58:34 +0530 Subject: [PATCH 438/438] fix pretty issue --- apps/dapp/pages/[[...tab]].tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/apps/dapp/pages/[[...tab]].tsx b/apps/dapp/pages/[[...tab]].tsx index ddfb1fcce..7dc3e5982 100644 --- a/apps/dapp/pages/[[...tab]].tsx +++ b/apps/dapp/pages/[[...tab]].tsx @@ -1,28 +1,27 @@ // GNU AFFERO GENERAL PUBLIC LICENSE Version 3. Copyright (C) 2022 DAO DAO Contributors. // See the "LICENSE" file in the root directory of this package for more copyright information. -import { GetStaticPaths, GetStaticProps } from 'next'; +import { GetStaticPaths, GetStaticProps } from 'next' -import { serverSideTranslations } from '@dao-dao/i18n/serverSideTranslations'; +import { serverSideTranslations } from '@dao-dao/i18n/serverSideTranslations' import { daoQueries, dehydrateSerializable, indexerQueries, makeReactQueryClient, -} from '@dao-dao/state'; +} from '@dao-dao/state' import { Home, StatefulHomeProps, daoQueries as statefulDaoQueries, -} from '@dao-dao/stateful'; -import { AccountTabId, DaoDaoIndexerChainStats } from '@dao-dao/types'; +} from '@dao-dao/stateful' +import { AccountTabId, DaoDaoIndexerChainStats } from '@dao-dao/types' import { MAINNET, chainIsIndexed, getDaoInfoForChainId, getSupportedChains, -} from '@dao-dao/utils'; - +} from '@dao-dao/utils' export default Home